Changeset 368 for trunk/GSASII.py


Ignore:
Timestamp:
Sep 9, 2011 9:59:47 AM (11 years ago)
Author:
vondreele
Message:

fix controls setup & refine enable/disable
add print option to GSASIIstruct.py input routines
needed for new parameter summary feature in GSASII.py
begin view parmater summary stuff

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASII.py

    r345 r368  
    6363
    6464[wxID_FILECLOSE, wxID_FILEEXIT, wxID_FILEOPEN,  wxID_FILESAVE, wxID_FILESAVEAS,
    65 wxID_REFINE, wxID_SOLVE, wxID_MAKEPDFS,
    66 ] = [wx.NewId() for _init_coll_File_Items in range(8)]
     65wxID_REFINE, wxID_SOLVE, wxID_MAKEPDFS, wxID_VIEWLSPARMS,
     66] = [wx.NewId() for _init_coll_File_Items in range(9)]
    6767
    6868[wxID_PWDRREAD,wxID_SNGLREAD,wxID_ADDPHASE,wxID_DELETEPHASE,
     
    145145            id=wxID_MAKEPDFS, kind=wx.ITEM_NORMAL,text='Make new PDFs')
    146146        self.Bind(wx.EVT_MENU, self.OnMakePDFs, id=wxID_MAKEPDFS)
     147        self.ViewLSParms = parent.Append(help='View least squares parameters',
     148            id=wxID_VIEWLSPARMS, kind=wx.ITEM_NORMAL,text='View LS parms')
     149        self.Bind(wx.EVT_MENU, self.OnViewLSParms, id=wxID_VIEWLSPARMS)
    147150        self.Refine = parent.Append(help='', id=wxID_REFINE, kind=wx.ITEM_NORMAL,
    148151            text='Refine')
    149         self.Refine.Enable(True)
     152        self.Refine.Enable(False)
    150153        self.Bind(wx.EVT_MENU, self.OnRefine, id=wxID_REFINE)
    151154        self.Solve = parent.Append(help='', id=wxID_SOLVE, kind=wx.ITEM_NORMAL,
     
    10561059                        elif name == 'Controls':
    10571060                            data = self.PatternTree.GetItemPyData(item)
    1058                             if data != [0] and data != {}:
     1061                            if data:
    10591062                                self.Refine.Enable(True)
    10601063                                self.Solve.Enable(True)         #not right but something needed here
     
    13431346            finally:
    13441347                dlg.Destroy()
     1348
     1349    def OnViewLSParms(self,event):
     1350        parmDict = {}
     1351        self.OnFileSave(event)
     1352        Histograms,Phases = G2str.GetUsedHistogramsAndPhases(self.GSASprojectfile)
     1353        phaseVary,phaseDict,pawleyLookup = G2str.GetPhaseData(Phases,Print=False)
     1354        hapVary,hapDict,controlDict = G2str.GetHistogramPhaseData(Phases,Histograms,Print=False)
     1355        histVary,histDict,controlDict = G2str.GetHistogramData(Histograms,Print=False)
     1356        varyList = phaseVary+hapVary+histVary
     1357        parmDict.update(phaseDict)
     1358        parmDict.update(hapDict)
     1359        parmDict.update(histDict)
     1360        parmKeys = parmDict.keys()
     1361        parmKeys.sort()
     1362        for parm in parmKeys:
     1363            line = parm+str(parmDict[parm])
     1364            if parm in varyList:
     1365                line += ' True'
     1366            else:
     1367                line += ' False'
     1368            print line
     1369
     1370
    13451371       
    13461372    def OnRefine(self,event):
Note: See TracChangeset for help on using the changeset viewer.