def OnFileLoad(self, e): """Load workspace""" # # Get access to main app # app = wx.GetApp() dlg = wx.FileDialog(self, 'Load Experiment', style=wx.FD_OPEN | wx.FD_FILE_MUST_EXIST | wx.FD_CHANGE_DIR) if dlg.ShowModal() == wx.ID_OK: f = dlg.GetPath() pass dlg.Destroy() try: self.SetStatusText('Loading Experiment File') app.ws = loadExp(f) self.SetStatusText('Done Loading Experiment File') self.updateFromExp() except Exception as e: wx.MessageBox('failed to load experiment:\n%s' % str(e)) pass self.updateFromExp() return
def OnFileNew(self, e): """Create a new experiment""" app = wx.GetApp() app.ws = loadExp('') # NOW: need to update workspace self.updateFromExp() return
def __makeData(self, inpFile): """Keep globals for easy access from subwindows""" # # Data # # * XRD Workspace # self.ws = loadExp(inpFile) # # * Image Information # self.imgMode = ImageModes.SINGLE_FRAME self.imgCal = None self.imgSweep = None return