Changeset 186


Ignore:
Timestamp:
Dec 7, 2010 3:55:03 PM (11 years ago)
Author:
vondreele
Message:

add "solve" to menu
Pawley fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASII.py

    r182 r186  
    2020import GSASIIspc as G2spc
    2121import GSASIIstruct as G2str
     22import GSASIIsolve as G2sol
    2223import OpenGL as ogl
    2324
     
    4748
    4849[wxID_FILECLOSE, wxID_FILEEXIT, wxID_FILEOPEN,
    49  wxID_FILESAVE, wxID_FILESAVEAS, wxID_REFINE,
    50 ] = [wx.NewId() for _init_coll_File_Items in range(6)]
     50 wxID_FILESAVE, wxID_FILESAVEAS, wxID_REFINE, wxID_SOLVE,
     51] = [wx.NewId() for _init_coll_File_Items in range(7)]
    5152
    5253[wxID_PWDRREAD,wxID_SNGLREAD,wxID_ADDPHASE,wxID_DELETEPHASE,
     
    130131        self.Refine.Enable(False)
    131132        self.Bind(wx.EVT_MENU, self.OnRefine, id=wxID_REFINE)
     133        self.Solve = parent.Append(help='', id=wxID_SOLVE, kind=wx.ITEM_NORMAL,
     134            text='Solve')
     135        self.Solve.Enable(False)
     136        self.Bind(wx.EVT_MENU, self.OnSolve, id=wxID_SOLVE)
    132137       
    133138    def _init_coll_Import_Items(self,parent):
     
    263268            self.PatternTree.Expand(self.root)
    264269            self.Refine.Enable(True)
     270            self.Solve.Enable(True)
    265271
    266272    def OnSize(self,event):
     
    826832            {'General':{'Name':PhaseName,'Type':'nuclear','SGData':SGData,
    827833            'Cell':[False,10.,10.,10.,90.,90.,90,1000.],
    828             'Pawley dmin':1.0},'Atoms':[],'Drawing':{},'Histograms':{}})
     834            'Pawley dmin':1.0},'Atoms':[],'Drawing':{},'Histograms':{},'Pawley ref':[],'Models':{}})
    829835       
    830836    def OnDeletePhase(self,event):
     
    939945                            if data != [0] and data != {}:
    940946                                self.Refine.Enable(True)
     947                                self.Solve.Enable(True)         #not right but something needed here
    941948                        item, cookie = self.PatternTree.GetNextChild(self.root, cookie)               
    942949                    if Id:
     
    11531160            dlg.Destroy()
    11541161       
     1162    def OnSolve(self,event):
     1163        #works - but it'd be better if it could restore plots
     1164        G2sol.Solve(self.GSASprojectfile)
     1165        dlg = wx.MessageDialog(self,'Load new result?','Structure solution results',wx.OK|wx.CANCEL)
     1166        try:
     1167            if dlg.ShowModal() == wx.ID_OK:
     1168                self.PatternTree.DeleteChildren(self.root)
     1169                if self.HKL: self.HKL = []
     1170                if self.G2plotNB.plotList:
     1171                    self.G2plotNB.clear()
     1172                G2IO.ProjFileOpen(self)
     1173        finally:
     1174            dlg.Destroy()
     1175       
    11551176    def ErrorDialog(self,title,message):
    11561177        dlg = wx.MessageDialog(self, message, title,  wx.OK)
Note: See TracChangeset for help on using the changeset viewer.