Changeset 167 for trunk/GSASII.py


Ignore:
Timestamp:
Oct 29, 2010 3:04:03 PM (12 years ago)
Author:
vondreele
Message:

image fixes for offset detector
drawing/phase fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASII.py

    r166 r167  
    1919import GSASIIpwdGUI as G2pdG
    2020import GSASIIspc as G2spc
     21import GSASIIstruct as G2str
    2122import OpenGL as ogl
    2223
     
    2930print "OpenGL:     ",ogl.__version__
    3031
    31 __version__ = '0.1.4'
     32__version__ = '0.1.5'
    3233
    3334# useful degree trig functions
     
    4647
    4748[wxID_FILECLOSE, wxID_FILEEXIT, wxID_FILEOPEN,
    48  wxID_FILESAVE, wxID_FILESAVEAS, wxID_UNDO,
    49 ] = [wx.NewId() for _init_coll_File_Items in range(6)]
     49 wxID_FILESAVE, wxID_FILESAVEAS, wxID_UNDO, wxID_REFINE,
     50] = [wx.NewId() for _init_coll_File_Items in range(7)]
    5051
    5152[wxID_PWDRREAD,wxID_SNGLREAD,wxID_ADDPHASE,wxID_DELETEPHASE,
     
    125126               
    126127    def _init_coll_Calculate_Items(self,parent):
     128        self.Refine = parent.Append(help='', id=wxID_REFINE, kind=wx.ITEM_NORMAL,
     129            text='Refine')
     130        self.Refine.Enable(False)
     131        self.Bind(wx.EVT_MENU, self.OnRefine, id=wxID_REFINE)
    127132        self.UnDo = parent.Append(help='', id=wxID_UNDO, kind=wx.ITEM_NORMAL,
    128133            text='UnDo')
     
    259264            G2IO.ProjFileOpen(self)
    260265            self.PatternTree.Expand(self.root)
     266            self.Refine.Enable(True)
    261267
    262268    def OnSize(self,event):
     
    389395        'MAR345 (*.mar3450;*.mar2300)|*.mar3450;*.mar2300|ADSC Image (*.img)\
    390396        |*.img|Detector tif (*.tif;*.tiff)|*.tif;*.tiff|GE Image sum (*.sum)\
    391         |*.sum|GE Image avg (*.avg)|*.avg|All files (*.*)|*.*',wx.OPEN | wx.MULTIPLE)
     397        |*.sum|GE Image avg (*.avg)|*.avg|GE Image raw (*)|*|All files (*.*)|*.*',wx.OPEN | wx.MULTIPLE)
    392398        if self.dirname:
    393399            dlg.SetDirectory(self.dirname)
     
    486492            self.PatternTree.SetItemPyData(sub,[''])
    487493            sub = self.PatternTree.AppendItem(parent=self.root,text='Controls')
    488             self.PatternTree.SetItemPyData(sub,[0])
     494            self.PatternTree.SetItemPyData(sub,{})
    489495               
    490496    class CopyDialog(wx.Dialog):
     
    926932                    while item and not Id:
    927933                        name = self.PatternTree.GetItemText(item)
    928                         if 'PWDR' in name or 'HKLF' in name or 'IMG' in name:
     934                        if name[:4] in ['PWDR','HKLF','IMG']:
    929935                            Id = item
     936                        elif name == 'Controls':
     937                            data = self.PatternTree.GetItemPyData(item)
     938                            if data != [0] and data != {}:
     939                                self.Refine.Enable(True)
    930940                        item, cookie = self.PatternTree.GetNextChild(self.root, cookie)               
    931941                    if Id:
     
    11231133        self.UnDo.Enable(False)
    11241134       
     1135    def OnRefine(self,event):
     1136        #works - but it'd be better if it could restore plots
     1137        G2str.Refine(self.GSASprojectfile)
     1138        dlg = wx.MessageDialog(self,'Load new result?','Refinement results',wx.OK|wx.CANCEL)
     1139        try:
     1140            if dlg.ShowModal() == wx.ID_OK:
     1141                self.PatternTree.DeleteChildren(self.root)
     1142                if self.HKL: self.HKL = []
     1143                if self.G2plotNB.plotList:
     1144                    self.G2plotNB.clear()
     1145                G2IO.ProjFileOpen(self)
     1146        finally:
     1147            dlg.Destroy()
     1148       
    11251149    def DoUnDo(self):
    11261150        print 'Undo last refinement'
Note: See TracChangeset for help on using the changeset viewer.