Ignore:
Timestamp:
Mar 15, 2020 2:57:46 AM (5 years ago)
Author:
vondreele
Message:

Add new parameter to Data tab - Layer DispSizerThis? is intended to cover multilayered materials of different phases with layers perpendicular to beam - it might have other uses.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/GSASIIddataGUI.py

    r4080 r4370  
    263263        wx.CallLater(100,RepaintHistogramInfo,DData.GetScrollPos(wx.VERTICAL))
    264264           
    265     def OnHstrainRef(event):
    266         Obj = event.GetEventObject()
    267         hist,pid = Indx[Obj.GetId()]
    268         UseList[G2frame.hist]['HStrain'][1][pid] = Obj.GetValue()
    269        
    270     def OnHstrainVal(event):
    271         event.Skip()
    272         Obj = event.GetEventObject()
    273         hist,pid = Indx[Obj.GetId()]
    274         try:
    275             strain = float(Obj.GetValue())
    276             UseList[G2frame.hist]['HStrain'][0][pid] = strain
    277         except ValueError:
    278             pass
    279         Obj.SetValue("%.3g"%(UseList[G2frame.hist]['HStrain'][0][pid]))          #reset in case of error
    280 
    281265    def OnPOAxis(event):
    282266        event.Skip()
     
    477461
    478462    def HstrainSizer():
     463       
     464        def OnHstrainRef(event):
     465            Obj = event.GetEventObject()
     466            hist,pid = Indx[Obj.GetId()]
     467            UseList[G2frame.hist]['HStrain'][1][pid] = Obj.GetValue()
     468           
     469        def OnHstrainVal(event):
     470            event.Skip()
     471            Obj = event.GetEventObject()
     472            hist,pid = Indx[Obj.GetId()]
     473            try:
     474                strain = float(Obj.GetValue())
     475                UseList[G2frame.hist]['HStrain'][0][pid] = strain
     476            except ValueError:
     477                pass
     478            Obj.SetValue("%.3g"%(UseList[G2frame.hist]['HStrain'][0][pid]))          #reset in case of error
     479       
    479480        hstrainSizer = wx.FlexGridSizer(0,6,5,5)
    480481        Hsnames = G2spc.HStrainNames(SGData)
     
    689690        flackSizer.Add(flackVal,0,WACV)
    690691        return flackSizer
     692       
     693    def DispSizer():
     694       
     695        def OnDispRef(event):
     696            Obj = event.GetEventObject()
     697            UseList[G2frame.hist]['Layer Disp'][1] = Obj.GetValue()
     698               
     699        dispSizer = wx.BoxSizer(wx.HORIZONTAL)
     700        dispRef = wx.CheckBox(DData,wx.ID_ANY,label=' Layer displacement (\xb5m): ')
     701        dispRef.SetValue(UseList[G2frame.hist]['Layer Disp'][1])
     702        dispRef.Bind(wx.EVT_CHECKBOX, OnDispRef)
     703        dispSizer.Add(dispRef,0,WACV|wx.LEFT,5)
     704        dispSizer.Add(G2G.ValidatedTxtCtrl(DData,UseList[G2frame.hist]['Layer Disp'],0,nDig=(10,2),typeHint=float),0,WACV)
     705        return dispSizer
    691706       
    692707    def twinSizer():
     
    903918                    G2frame.hist+' not in GSAS-II data tree')
    904919            return
    905         if 'Use' not in UseList[G2frame.hist]:      #patch
     920#patch
     921        if 'Use' not in UseList[G2frame.hist]:
    906922            UseList[G2frame.hist]['Use'] = True
    907923        if 'LeBail' not in UseList[G2frame.hist]:
     
    913929        if 'Fix FXU' not in UseList[G2frame.hist]:
    914930            UseList[G2frame.hist]['Fix FXU'] = ' '
     931        if 'Flack' not in UseList[G2frame.hist]:
     932            UseList[G2frame.hist]['Flack'] = [0.0,False]
     933        if 'Twins' not in UseList[G2frame.hist]:
     934            UseList[G2frame.hist]['Twins'] = [[np.array([[1,0,0],[0,1,0],[0,0,1]]),[1.0,False]],]
     935        if 'Layer Disp' not in UseList[G2frame.hist]:
     936            UseList[G2frame.hist]['Layer Disp'] = [0.0,False]
     937#end patch
    915938        bottomSizer = wx.BoxSizer(wx.VERTICAL)
    916939        useBox = wx.BoxSizer(wx.HORIZONTAL)
     
    10031026            bottomSizer.Add(wx.StaticText(DData,wx.ID_ANY,' Hydrostatic/elastic strain:'))
    10041027            bottomSizer.Add(HstrainSizer())
     1028            bottomSizer.Add(DispSizer())
    10051029               
    10061030            poSizer = wx.BoxSizer(wx.VERTICAL)
     
    10291053                bottomSizer.Add(BabSizer(),0,WACV|wx.BOTTOM,5)
    10301054        elif G2frame.hist[:4] == 'HKLF':
    1031 #patch
    1032             if 'Flack' not in UseList[G2frame.hist]:
    1033                 UseList[G2frame.hist]['Flack'] = [0.0,False]
    1034             if 'Twins' not in UseList[G2frame.hist]:
    1035                 UseList[G2frame.hist]['Twins'] = [[np.array([[1,0,0],[0,1,0],[0,0,1]]),[1.0,False]],]
    1036 #end patch
    10371055            bottomSizer.Add(ExtSizer('HKLF'),0,WACV|wx.BOTTOM,5)
    10381056            bottomSizer.Add(BabSizer(),0,WACV|wx.BOTTOM,5)
Note: See TracChangeset for help on using the changeset viewer.