示例#1
0
    def OnLoad(self, event):
        wildcard = "cbf images (*.cbf)|*.cbf|All Files (*.*)|*.*"
        dlg = wx.FileDialog(
            self,
            message="Select a cbf image",
            defaultDir=os.getcwd(),
            wildcard=wildcard,
            defaultFile="",
            style=wx.OPEN,
        )
        done = False
        while not done:
            try:
                if dlg.ShowModal() == wx.ID_OK:
                    filename = dlg.GetPath()
                    self.Close(True)
                    launcher.view_experiment(filename)
                    done = True
                elif dlg.ShowModal() == wx.ID_CANCEL:
                    done = True
                    dlg.Destroy()

            except IOError:
                message = "Invalid file. Please choose another."
                caption = "Error"
                wx.MessageBox(message, caption, wx.ICON_ERROR)
示例#2
0
    def OnLoad(self, event):
        wildcard = "cbf images (*.cbf)|*.cbf|All Files (*.*)|*.*"
        dlg = wx.FileDialog(self, message = "Select a cbf image",
                            defaultDir = os.getcwd(), wildcard = wildcard,
                            defaultFile = "", style = wx.OPEN)
        done = False
        while not done:
            try:
                if dlg.ShowModal() == wx.ID_OK:
                    filename = dlg.GetPath()
                    self.Close(True)
                    launcher.view_experiment(filename)
                    done = True
                elif dlg.ShowModal() == wx.ID_CANCEL:
                    done = True
                    dlg.Destroy()

            except IOError:
                message = "Invalid file. Please choose another."
                caption = "Error"
                wx.MessageBox(message, caption, wx.ICON_ERROR)
示例#3
0
 def OnReset(self, event):
     self.Close(True)
     launcher.view_experiment(filename)
示例#4
0
 def OnReset(self, event):
     self.Close(True)
     launcher.view_experiment(filename)