Changeset 2183 for trunk/GSASIIphsGUI.py


Ignore:
Timestamp:
Mar 24, 2016 9:58:40 AM (8 years ago)
Author:
vondreele
Message:

fix General - atomic wt. now updated on isotope change
add new Stacking fault option to make sequence of DIFFaX runs varying one variable - under development
fix problem in G2image & G2imageGUI where change in FlatBkg?, Background or Dark didn't change thresholds or image plot limits - these are now set to new image limits.
Some of these used tricky changes to sizer values

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIphsGUI.py

    r2182 r2183  
    418418                        G2frame.dataFrame.Bind(wx.EVT_MENU, OnLoadDIFFaX, id=G2gd.wxID_LOADDIFFAX)
    419419                        G2frame.dataFrame.Bind(wx.EVT_MENU, OnSimulate, id=G2gd.wxID_LAYERSIMULATE)
     420                        G2frame.dataFrame.Bind(wx.EVT_MENU, OnSeqSimulate, id=G2gd.wxID_SEQUENCESIMULATE)
    420421                        if 'Wave Data' in pages:
    421422                            pass
     
    626627        def ElemSizer():
    627628           
    628             def OnIsotope(event):   #how can I update Atom weight on isotope change?
     629            def OnIsotope(event):
    629630                Obj = event.GetEventObject()
    630631                item = Indx[Obj.GetId()]
    631632                isotope = Obj.GetValue()
     633                nCols = len(generalData['AtomTypes'])+1
    632634                data['General']['Isotope'][item] = isotope
    633635                indx = generalData['AtomTypes'].index(item)
    634                 data['General']['AtomMass'][indx] = generalData['Isotopes'][item][isotope]['Mass']
     636                wt = generalData['Isotopes'][item][isotope]['Mass']
     637                elemSizer.GetChildren()[indx+3*nCols+1].Window.SetValue('%.3f'%(wt))    #tricky
     638                data['General']['AtomMass'][indx] = wt
    635639                density,mattCoeff = G2mth.getDensity(generalData)
    636640                denSizer[1].SetValue('%.3f'%(density))
     
    29252929        dlg = G2gd.DIFFaXcontrols(G2frame,ctrls)
    29262930        if dlg.ShowModal() == wx.ID_OK:
    2927             ctrls,plane,lmax = dlg.GetSelection()
     2931            ctrls,plane,lmax,x,x,x = dlg.GetSelection()
    29282932            data['Layers']['Sadp'] = {}
    29292933            data['Layers']['Sadp']['Plane'] = plane
     
    29662970        else:   #selected area
    29672971            G2pwd.StackSim(data['Layers'],ctrls)
    2968 #            G2pwd.CalcStackingSADP(data['Layers'])
     2972#            if GSASIIpath.GetConfigValue('debug'):
     2973#                G2pwd.CalcStackingSADP(data['Layers'])
    29692974        wx.CallAfter(UpdateLayerData)
     2975       
     2976    def OnSeqSimulate(event):
     2977       
     2978        ctrls = ''
     2979        Parms = G2pwd.GetStackParms(data['Layers'])
     2980        dlg = G2gd.DIFFaXcontrols(G2frame,ctrls,Parms)
     2981        if dlg.ShowModal() == wx.ID_OK:
     2982            ctrls,plane,lmax,parm,parmRange,parmStep = dlg.GetSelection()
     2983            data['Layers']['Sadp'] = {}
     2984            data['Layers']['Sadp']['Plane'] = plane
     2985            data['Layers']['Sadp']['Lmax'] = lmax
     2986            data['Layers']['Multi'] = [parm,parmRange,parmStep]
     2987        else:
     2988            return
     2989        print 'do sequence of simulations on...',parm,parmRange,parmStep
    29702990       
    29712991################################################################################
     
    70887108            FillSelectPageMenu(TabSelectionIdDict, G2frame.dataFrame.WavesData)
    70897109            G2frame.dataFrame.Bind(wx.EVT_MENU, OnWaveVary, id=G2gd.wxID_WAVEVARY)
    7090         # Stacking faults wxID_LAYERSIMULATE
     7110        # Stacking faults
    70917111        if data['General']['Type'] == 'faulted':
    70927112            FillSelectPageMenu(TabSelectionIdDict, G2frame.dataFrame.LayerData)
    70937113            G2frame.dataFrame.Bind(wx.EVT_MENU, OnLoadDIFFaX, id=G2gd.wxID_LOADDIFFAX)
    70947114            G2frame.dataFrame.Bind(wx.EVT_MENU, OnSimulate, id=G2gd.wxID_LAYERSIMULATE)
     7115            G2frame.dataFrame.Bind(wx.EVT_MENU, OnSeqSimulate, id=G2gd.wxID_SEQUENCESIMULATE)
    70957116        # Draw Options
    70967117        FillSelectPageMenu(TabSelectionIdDict, G2frame.dataFrame.DataDrawOptions)
Note: See TracChangeset for help on using the changeset viewer.