Changeset 52


Ignore:
Timestamp:
Apr 23, 2010 10:45:38 AM (12 years ago)
Author:
vondreel
Message:

add help & status bar messages in various places
begin setup for saving integration results as 1-D
powder patterns

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASII.py

    r51 r52  
    7171
    7272    def _init_coll_File_Items(self, parent):
    73         parent.Append(help='', id=wxID_GSASIIFILEOPEN, kind=wx.ITEM_NORMAL,
    74             text='Open project')
    75         parent.Append(help='', id=wxID_GSASIIFILESAVE, kind=wx.ITEM_NORMAL,
    76             text='Save project')
    77         parent.Append(help='', id=wxID_GSASIIFILESAVEAS, kind=wx.ITEM_NORMAL,
    78             text='SaveAs')
    79         parent.Append(help='', id=wxID_GSASIIFILECLOSE, kind=wx.ITEM_NORMAL,
    80             text='Close project')
    81         parent.Append(help='', id=wxID_GSASIIFILEEXIT, kind=wx.ITEM_NORMAL,
     73        parent.Append(help='Open a gsasii project file (*.gpx)', id=wxID_GSASIIFILEOPEN,
     74             kind=wx.ITEM_NORMAL,text='Open project')
     75        parent.Append(help='SAve project to old file', id=wxID_GSASIIFILESAVE,
     76            kind=wx.ITEM_NORMAL,text='Save project')
     77        parent.Append(help='Save project to new file', id=wxID_GSASIIFILESAVEAS,
     78            kind=wx.ITEM_NORMAL,text='SaveAs')
     79        parent.Append(help='Close project, saving is optional', id=wxID_GSASIIFILECLOSE,
     80            kind=wx.ITEM_NORMAL,text='Close project')
     81        parent.Append(help='Exit from gsasii', id=wxID_GSASIIFILEEXIT, kind=wx.ITEM_NORMAL,
    8282            text='Exit')
    8383        self.Bind(wx.EVT_MENU, self.OnFileOpenMenu, id=wxID_GSASIIFILEOPEN)
     
    196196        self.SetMenuBar(self.GSASIIMenu)
    197197        self.Bind(wx.EVT_SIZE, self.OnSize)
     198        self.CreateStatusBar()
    198199        self.mainPanel = wx.Panel(self,-1)
    199200       
  • trunk/GSASIIgrid.py

    r51 r52  
    2020] = [wx.NewId() for _init_coll_Atom_Items in range(2)]
    2121
    22 [ wxID_IMCALIBRATE, wxID_IMINTEGRATE, wxID_IMCLEARCALIB,
    23 ] = [wx.NewId() for _init_coll_IMAGE_Items in range(3)]
     22[ wxID_IMCALIBRATE, wxID_IMINTEGRATE, wxID_IMCLEARCALIB, wxID_SAVEINTG
     23] = [wx.NewId() for _init_coll_IMAGE_Items in range(4)]
    2424
    2525[ wxID_UNDO,wxID_PEAKFIT,wxID_AUTOPEAKFIT,
     
    5151           
    5252    def _init_coll_Image_Items(self,parent):
    53         parent.Append(help='',id=wxID_IMCALIBRATE, kind=wx.ITEM_NORMAL,text='Calibrate')
    54         parent.Append(help='',id=wxID_IMCLEARCALIB, kind=wx.ITEM_NORMAL,text='Clear calibration')
     53        parent.Append(help='Calibrate detector by fitting to calibrant lines', \
     54            id=wxID_IMCALIBRATE, kind=wx.ITEM_NORMAL,text='Calibrate')
     55        parent.Append(help='Clear calibration data points and rings',id=wxID_IMCLEARCALIB, \
     56            kind=wx.ITEM_NORMAL,text='Clear calibration')
    5557        parent.Append(help='',id=wxID_IMINTEGRATE, kind=wx.ITEM_NORMAL,text='Integrate')
    56        
    57            
     58        parent.Append(help='Save integration results as a series of 1-D powder patterns', \
     59            id=wxID_SAVEINTG, kind=wx.ITEM_NORMAL,text='Save Integration')
     60                   
    5861    def _init_coll_Peak_Items(self,parent):
    59         self.UnDo = parent.Append(help='', id=wxID_UNDO, kind=wx.ITEM_NORMAL,
    60             text='UnDo')
    61         self.PeakFit = parent.Append(help='', id=wxID_PEAKFIT, kind=wx.ITEM_NORMAL,
    62             text='PeakFit')
    63         self.AutoPeakFit = parent.Append(help='', id=wxID_AUTOPEAKFIT, kind=wx.ITEM_NORMAL,
    64             text='AutoPeakFit')
     62        self.UnDo = parent.Append(help='Undo last least squares refinement', \
     63            id=wxID_UNDO, kind=wx.ITEM_NORMAL,text='UnDo')
     64        self.PeakFit = parent.Append(id=wxID_PEAKFIT, kind=wx.ITEM_NORMAL,text='PeakFit', \
     65            help='Do single cycle of peak fitting least-squares refinement' )
     66        self.AutoPeakFit = parent.Append(id=wxID_AUTOPEAKFIT, kind=wx.ITEM_NORMAL, \
     67            text='AutoPeakFit',help='Do peak fitting least-squares to convergence' )
    6568           
    6669    def _init_coll_Index_Items(self,parent):
    6770        self.IndexPeaks = parent.Append(help='', id=wxID_INDEXPEAKS, kind=wx.ITEM_NORMAL,
    6871            text='Index Cell')
    69         self.CopyCell = parent.Append(help='', id=wxID_COPYCELL, kind=wx.ITEM_NORMAL,
    70             text='Copy Cell')
    71         self.RefineCell = parent.Append(help='', id=wxID_REFINECELL, kind=wx.ITEM_NORMAL,
    72             text='Refine Cell')
     72        self.CopyCell = parent.Append( id=wxID_COPYCELL, kind=wx.ITEM_NORMAL,text='Copy Cell', \
     73            help='Copy selected unit cell from indexing to cell refinement fields')
     74        self.RefineCell = parent.Append( id=wxID_REFINECELL, kind=wx.ITEM_NORMAL, \
     75            text='Refine Cell',help='Refine unit cell parameters from indexed peaks')
    7376
    7477    def _init_utils(self):
     
    440443                self.PatternTree.SetItemPyData(self.PickId,data[:-nDel])
    441444                self.dataDisplay.ForceRefresh()
    442                 setBackgroundColors()                         
     445                setBackgroundColors()
     446                if not len(self.PatternTree.GetItemPyData(self.PickId)):
     447                    self.dataFrame.PeakFit.Enable(False)
     448                    self.dataFrame.AutoPeakFit.Enable(False)
     449                       
    443450        elif colList:
    444451            self.dataDisplay.ClearSelection()
     
    462469           
    463470    self.dataFrame.SetMenuBar(self.dataFrame.PeakMenu)
     471    Status = self.dataFrame.CreateStatusBar()
    464472    self.Bind(wx.EVT_MENU, OnUnDo, id=wxID_UNDO)
    465473    self.Bind(wx.EVT_MENU, OnPeakFit, id=wxID_PEAKFIT)
    466474    self.Bind(wx.EVT_MENU, OnAutoPeakFit, id=wxID_AUTOPEAKFIT)
     475    self.dataFrame.PeakFit.Enable(False)
     476    self.dataFrame.AutoPeakFit.Enable(False)
    467477    if data:
    468478        self.dataFrame.PeakFit.Enable(True)
     
    919929        self.dataDisplay.Destroy()
    920930    self.dataFrame.SetMenuBar(self.dataFrame.IndexMenu)
     931    Status = self.dataFrame.CreateStatusBar()
    921932    self.Bind(wx.EVT_MENU, OnIndexPeaks, id=wxID_INDEXPEAKS)
    922933    self.Bind(wx.EVT_MENU, CopyUnitCell, id=wxID_COPYCELL)
     
    11391150        except ValueError:
    11401151            pass
     1152        self.dataFrame.ImageEdit.Enable(id=wxID_SAVEINTG,enable=False)   
    11411153        outChan.SetValue(str(data['outChannels']))          #reset in case of error       
    11421154       
     
    11491161        except ValueError:
    11501162            pass
     1163        self.dataFrame.ImageEdit.Enable(id=wxID_SAVEINTG,enable=False)   
    11511164        outAzim.SetValue(str(data['outAzimuths']))          #reset in case of error       
    11521165       
     
    11851198            self.Lazim.SetEditable(False)           
    11861199            self.Razim.SetEditable(False)           
     1200        self.dataFrame.ImageEdit.Enable(id=wxID_SAVEINTG,enable=False)   
    11871201        G2plt.PlotExposedImage(self)
    11881202       
     
    12041218        self.InnerTth.SetValue("%8.2f" % (Ltth))
    12051219        self.OuterTth.SetValue("%8.2f" % (Utth))
     1220        self.dataFrame.ImageEdit.Enable(id=wxID_SAVEINTG,enable=False)   
    12061221        G2plt.PlotExposedImage(self)
    12071222       
     
    12101225        Razm = int(self.Razim.GetValue())
    12111226        data['LRazimuth'] = [Lazm,Razm]
     1227        self.dataFrame.ImageEdit.Enable(id=wxID_SAVEINTG,enable=False)   
    12121228        G2plt.PlotExposedImage(self)
    12131229           
     
    12241240        data['rings'] = []
    12251241        data['ellipses'] = []
     1242        self.dataFrame.ImageEdit.Enable(id=wxID_IMCLEARCALIB,enable=False)   
    12261243        G2plt.PlotImage(self)
    12271244           
     
    12461263            tiltSel.SetValue("%9.3f"%(data['tilt']))           
    12471264            rotSel.SetValue("%9.3f"%(data['rotation']))
     1265            self.dataFrame.ImageEdit.Enable(id=wxID_IMCLEARCALIB,enable=True)   
    12481266        else:
    12491267            Status.SetStatusText('Calibration failed')
     
    12511269    def OnIntegrate(event):
    12521270        G2cmp.ImageIntegrate(self,data)
     1271        self.dataFrame.ImageEdit.Enable(id=wxID_SAVEINTG,enable=True)   
     1272       
     1273    def OnSaveIntegrate(event):
     1274        print 'save integration'
    12531275       
    12541276    colorList = [m for m in mpl.cm.datad.keys() if not m.endswith("_r")]
     
    12591281    Status = self.dataFrame.CreateStatusBar()
    12601282    self.dataFrame.Bind(wx.EVT_MENU, OnCalibrate, id=wxID_IMCALIBRATE)
    1261     self.dataFrame.Bind(wx.EVT_MENU, OnClearCalib, id=wxID_IMCLEARCALIB)   
    1262     self.dataFrame.Bind(wx.EVT_MENU, OnIntegrate, id=wxID_IMINTEGRATE)       
     1283    self.dataFrame.Bind(wx.EVT_MENU, OnClearCalib, id=wxID_IMCLEARCALIB)
     1284    if not data['rings']:
     1285        self.dataFrame.ImageEdit.Enable(id=wxID_IMCLEARCALIB,enable=False)   
     1286    self.dataFrame.Bind(wx.EVT_MENU, OnIntegrate, id=wxID_IMINTEGRATE)
     1287    self.dataFrame.Bind(wx.EVT_MENU, OnSaveIntegrate, id=wxID_SAVEINTG)
     1288    self.dataFrame.ImageEdit.Enable(id=wxID_SAVEINTG,enable=False)   
    12631289    self.dataDisplay = wx.Panel(self.dataFrame)
    12641290    mainSizer = wx.BoxSizer(wx.VERTICAL)
Note: See TracChangeset for help on using the changeset viewer.