Changeset 2940


Ignore:
Timestamp:
Jul 22, 2017 11:51:59 AM (4 years ago)
Author:
vondreele
Message:

fix rigid body GUI display
remove an extra SetAutoLayout?
fix plotting problem for new MCSA model entry
make sure import phase from gp is clean (no maps, map peaks, rigid bodies, etc.)

Location:
branch/2frame
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • branch/2frame/GSASIIconstrGUI.py

    r2917 r2940  
    13101310    resList = []
    13111311    plotDefaults = {'oldxy':[0.,0.],'Quaternion':[0.,0.,0.,1.],'cameraPos':30.,'viewDir':[0,0,1],}
     1312
     1313    G2frame.rbBook = G2G.GSNoteBook(parent=G2frame.dataWindow)
     1314    G2frame.dataWindow.GetSizer().Add(G2frame.rbBook,1,wx.ALL|wx.EXPAND)
     1315    VectorRB = wx.ScrolledWindow(G2frame.rbBook)
     1316    VectorRBDisplay = wx.Panel(VectorRB)
     1317    G2frame.rbBook.AddPage(VectorRB,'Vector rigid bodies')
     1318    ResidueRB = wx.ScrolledWindow(G2frame.rbBook)
     1319    ResidueRBDisplay = wx.Panel(ResidueRB)
     1320    G2frame.rbBook.AddPage(ResidueRB,'Residue rigid bodies')
    13121321   
    13131322    def OnPageChanged(event):
     
    17591768                for col in [4,5,6]:
    17601769                    vecGrid.SetCellStyle(row,col,VERY_LIGHT_GREY,True)
    1761             vecGrid.SetMargins(0,0)
     1770            vecGrid.SetScrollRate(0,0)
    17621771            vecGrid.AutoSizeColumns(False)
    17631772            vecSizer.Add(vecGrid)
     
    17761785           
    17771786        if VectorRB.GetSizer(): VectorRB.GetSizer().Clear(True)
    1778         VectorRBDisplay = wx.Panel(VectorRB)
    17791787        VectorRBSizer = wx.BoxSizer(wx.VERTICAL)
    17801788        for rbId in data['RBIds']['Vector']:
     
    19221930                for col in range(5):
    19231931                    vecGrid.SetCellStyle(row,col,VERY_LIGHT_GREY,True)
    1924             vecGrid.SetMargins(0,0)
     1932            vecGrid.SetScrollRate(0,0)
    19251933            vecGrid.AutoSizeColumns(False)
    19261934            vecSizer = wx.BoxSizer()
     
    20512059                refChoice[rbId][i].sort()     
    20522060           
    2053         if ResidueRB.GetSizer(): ResidueRB.GetSizer().Clear(True)
    2054         ResidueRBDisplay = wx.Panel(ResidueRB)
     2061        ResidueRBDisplay.DestroyChildren()
    20552062        ResidueRBSizer = wx.BoxSizer(wx.VERTICAL)
    20562063        for rbId in data['RBIds']['Residue']:
     
    20852092
    20862093    G2gd.SetDataMenuBar(G2frame,G2frame.dataWindow.RigidBodyMenu)
    2087     #G2frame.SetLabel(G2frame.GetLabel().split('||')[0]+' || '+'Rigid bodies')
    20882094    G2frame.SetTitle('Rigid bodies')
    20892095    SetStatusLine('')
    2090     #G2frame.rbBook = G2G.GSNoteBook(parent=G2frame.dataWindow,size=G2frame.dataWindow.GetClientSize())
    2091     G2frame.rbBook = G2G.GSNoteBook(parent=G2frame.dataWindow)
    2092     G2frame.dataWindow.GetSizer().Add(G2frame.rbBook,1,wx.ALL|wx.EXPAND)
    2093 
    2094     VectorRB = wx.ScrolledWindow(G2frame.rbBook)
    2095     G2frame.rbBook.AddPage(VectorRB,'Vector rigid bodies')
    2096     ResidueRB = wx.ScrolledWindow(G2frame.rbBook)
    2097     G2frame.rbBook.AddPage(ResidueRB,'Residue rigid bodies')
    20982096    UpdateVectorRB()
    20992097    G2frame.rbBook.Bind(wx.aui.EVT_AUINOTEBOOK_PAGE_CHANGED, OnPageChanged)
  • branch/2frame/GSASIIdataGUI.py

    r2937 r2940  
    60996099    mainSizer.FitInside(G2frame.dataWindow)   
    61006100    G2frame.dataWindow.SetSizer(mainSizer)
    6101     G2frame.dataWindow.SetAutoLayout(1)
    61026101    G2frame.SetDataSize()
    61036102     
  • branch/2frame/GSASIImath.py

    r2937 r2940  
    40194019        sched.slope = data['log slope']
    40204020    sched.T0 = data['Annealing'][0]
     4021    if not sched.T0:
     4022        sched.T0 = 50.
    40214023    Tf = data['Annealing'][1]
     4024    if not Tf:
     4025        Tf = 0.001
    40224026    Tsched = [sched.T0,]
    40234027    while Tsched[-1] > Tf:
     
    46464650                'args':(refs,rcov,cosTable,ifInv,allFF,RBdata,varyList,parmDict)},callback=MCSAcallback)
    46474651    else:
     4652        T0 = MCSA['Annealing'][0]
     4653        if not T0:
     4654            T0 = None
    46484655        results = anneal(mcsaCalc,x0,args=(refs,rcov,cosTable,ifInv,allFF,RBdata,varyList,parmDict),
    46494656            schedule=MCSA['Algorithm'], full_output=True,dwell=MCSA['Annealing'][2],maxiter=10000,
    4650             T0=MCSA['Annealing'][0], Tf=MCSA['Annealing'][1],
     4657            T0=T0, Tf=MCSA['Annealing'][1],
    46514658            quench=MCSA['fast parms'][0], c=MCSA['fast parms'][1],
    46524659            lower=lower, upper=upper, slope=MCSA['log slope'],ranStart=MCSA.get('ranStart',False),
  • branch/2frame/GSASIIphsGUI.py

    r2938 r2940  
    78507850        data['MCSA']['rbData'] = rbData
    78517851        data['MCSA']['AtInfo'].update(rbData[rbType]['AtInfo'])
    7852         G2plt.PlotStructure(G2frame,data)
    78537852        UpdateMCSA()
     7853        wx.CallAfter(G2plt.PlotStructure,G2frame,data)
    78547854       
    78557855    def OnMCSAclear(event):
  • branch/2frame/GSASIIplot.py

    r2937 r2940  
    54505450
    54515451    # PlotStructure initialization here
     5452    global mcsaXYZ,mcsaTypes,mcsaBonds
    54525453    ForthirdPI = 4.0*math.pi/3.0
    54535454    generalData = data['General']
  • branch/2frame/GSASIIrestrGUI.py

    r2917 r2940  
    881881
    882882        BondRestr.SetSizer(mainSizer)
    883         #Size = mainSizer.GetMinSize()
    884         #print 'BondRestr',Size
    885         #Size = mainSizer.Fit(BondRestr)
    886         #Size[0] = 600
    887         #Size[1] = min(Size[1]+50,500)       #make room for tab, but not too big
    888         #BondRestr.SetSize(Size)
    889         #Size[0] += 40
    890         #BondRestr.SetScrollbars(10,10,Size[0]/10-4,Size[1]/10-1)
    891         #BondRestr.Scroll(0,0)
    892883        G2phsGUI.SetPhaseWindow(BondRestr,mainSizer,Scroll=0)
    893884       
  • branch/2frame/imports/G2phase_GPX.py

    r2817 r2940  
    5757            selblk = 0
    5858        else:                       # choose from options               
    59             selblk = G2IO.PhaseSelector(
    60                 phasenames,
    61                 ParentFrame=ParentFrame,
    62                 title= 'Select a phase from the list below',
    63                 )
     59            selblk = G2IO.PhaseSelector(phasenames,ParentFrame=ParentFrame,
     60                title= 'Select a phase from the list below',)
    6461            if selblk is None:
    6562                self.errors = 'No phase selected'
     
    6865        self.Phase['Histograms'] = {}       #remove any histograms
    6966        self.Phase['Pawley ref'] = []       # & any Pawley refl.
     67        self.Phase['RBModels'] = {}
     68        del self.Phase['MCSA']
     69        del self.Phase['Map Peaks']
     70        del self.Phase['General']['Map']
    7071        self.Phase['ranId'] = ran.randint(0,sys.maxint)
    7172        return True
Note: See TracChangeset for help on using the changeset viewer.