Changeset 1259


Ignore:
Timestamp:
Mar 20, 2014 5:05:51 PM (8 years ago)
Author:
toby
Message:

fix missing decimal on radius and format numbers in ValidatedTextCtrl? as per Bob on widget leave

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIIO.py

    r1243 r1259  
    15711571    '''Defines a base class for the reading of files with coordinates
    15721572
    1573     Objects constructed that subclass this (in import/G2phase_*.py) will be used
     1573    Objects constructed that subclass this (in import/G2phase_*.py etc.) will be used
    15741574    in :meth:`GSASII.GSASII.OnImportPhase`.
    15751575    See :ref:`Writing a Import Routine<Import_Routines>`
     
    17061706class ImportPowderData(ImportBaseclass):
    17071707    '''Defines a base class for the reading of files with powder data.
     1708
     1709    Objects constructed that subclass this (in import/G2pwd_*.py etc.) will be used
     1710    in :meth:`GSASII.GSASII.OnImportPowder`.
    17081711    See :ref:`Writing a Import Routine<Import_Routines>`
    17091712    for an explanation on how to use this class.
  • trunk/GSASIIgrid.py

    r1257 r1259  
    181181      from this value.
    182182     
    183     :param list [nDig,nPlc]: number of digits & places after decimal to use
     183    :param list nDig: number of digits & places ([nDig,nPlc]) after decimal to use
    184184      for display of float. Alternately, None can be specified which causes
    185185      numbers to be displayed with approximately 5 significant figures
     
    402402
    403403    def _onLoseFocus(self,event):
    404         if self.evaluated: self.EvaluateExpression()
     404        if self.evaluated:
     405            self.EvaluateExpression()
     406        elif self.result is not None: # show formatted result, as Bob wants
     407            self.SetValue(self.result[self.key])
    405408        if self.OnLeave: self.OnLeave(invalid=self.invalid,
    406409                                      value=self.result[self.key],
     
    409412
    410413    def _onLeaveWindow(self,event):
    411         if self.evaluated: self.EvaluateExpression()
     414        if self.evaluated:
     415            self.EvaluateExpression()
     416        elif self.result is not None: # show formatted result, as Bob wants
     417            self.SetValue(self.result[self.key])
    412418
    413419    def EvaluateExpression(self):
     
    41664172    frm.Show(True)
    41674173
    4168     # # test ScrolledMultiEditor
     4174    #======================================================================
     4175    # test ScrolledMultiEditor
     4176    #======================================================================
    41694177    # Data1 = {
    41704178    #     'Order':1,
     
    41974205    #         print k,d[k]
    41984206
    4199     choices = []
    4200     for i in range(21):
    4201         choices.append("option_"+str(i))
    4202     dlg = G2MultiChoiceDialog(frm, 'Sequential refinement',
    4203                               'Select dataset to include',
    4204                               choices)
    4205     sel = range(2,11,2)
    4206     dlg.SetSelections(sel)
    4207     dlg.SetSelections((1,5))
    4208     if dlg.ShowModal() == wx.ID_OK:
    4209         for sel in dlg.GetSelections():
    4210             print sel,choices[sel]
    4211 
     4207    #======================================================================
     4208    # test G2MultiChoiceDialog
     4209    #======================================================================
     4210    # choices = []
     4211    # for i in range(21):
     4212    #     choices.append("option_"+str(i))
     4213    # dlg = G2MultiChoiceDialog(frm, 'Sequential refinement',
     4214    #                           'Select dataset to include',
     4215    #                           choices)
     4216    # sel = range(2,11,2)
     4217    # dlg.SetSelections(sel)
     4218    # dlg.SetSelections((1,5))
     4219    # if dlg.ShowModal() == wx.ID_OK:
     4220    #     for sel in dlg.GetSelections():
     4221    #         print sel,choices[sel]
     4222   
     4223    #======================================================================
     4224    # test wx.MultiChoiceDialog
     4225    #======================================================================
    42124226    # dlg = wx.MultiChoiceDialog(frm, 'Sequential refinement',
    42134227    #                           'Select dataset to include',
     
    42204234    #         print sel,choices[sel]
    42214235
    4222 
    4223     #app.MainLoop()
     4236    pnl = wx.Panel(frm)
     4237    siz = wx.BoxSizer(wx.HORIZONTAL)
     4238
     4239    td = {'Goni':200.,'a':1}
     4240    txt = ValidatedTxtCtrl(pnl,td,'Goni')
     4241    siz.Add(txt)
     4242    txt = ValidatedTxtCtrl(pnl,td,'a')
     4243    siz.Add(txt)
     4244
     4245    pnl.SetSizer(siz)
     4246    siz.Fit(frm)
     4247    app.MainLoop()
     4248    print td
  • trunk/imports/G2pwd_fxye.py

    r1168 r1259  
    330330        self.idstring = ospath.basename(filename) + ' Bank '+str(selblk+1)
    331331        self.numbanks=len(Banks)
    332         # scan comments for temperature
    333         Temperature = 300
    334         Radius = 200
     332        # scan comments for temperature & radius
     333        Temperature = 300.
    335334        for S in self.comments:
    336335            if 'Temp' in S.split('=')[0]:
     
    341340            elif 'Gonio' in S.split('=')[0]:
    342341                try:
    343                     Radius = float(S.split('=')[1])
     342                    self.Sample['Gonio. radius'] = float(S.split('=')[1])
    344343                except:
    345344                    pass
    346345        self.Sample['Temperature'] = Temperature
    347         self.Sample['Gonio. radius'] = Radius
    348346        return True       
    349347
Note: See TracChangeset for help on using the changeset viewer.