def __init__(self, options=None): event_loop.EventLoop.__init__(self) self.options = options self.snapNum = 0 self.MainFrame = self #reference to this window for use in scripts etc... protocol.MainFrame = self self.initDone = False self.postInit = [] #for protocol compat self.scope = microscope.microscope() self.roi_on = False self.bin_on = False #functions to call in each polling iteration # Replaces time1 in GUI version self._want_loop_notification = [] self._is_running = False # variables to facilitate long-polling for frame updates self._current_frame = None self._new_frame_condition = threading.Condition() self._state_valid = False self._state_updated_condition = threading.Condition() self.scope.state.stateChanged.connect(self._on_scope_state_change)
def __init__(self, parent, options=None): AUIFrame.__init__(self, id=wx.ID_ANY, name='smiMainFrame', parent=parent, pos=wx.Point(20, 20), size=wx.Size(600, 800), style=wx.DEFAULT_FRAME_STYLE, title=getattr(options, 'window_title', 'PYME Acquire')) self._create_menu() self.options = options self.snapNum = 0 self.Bind(wx.EVT_CLOSE, self.OnCloseWindow) self.MainFrame = self #reference to this window for use in scripts etc... protocol.MainFrame = self self.toolPanels = [] self.camPanels = [] self.aqPanels = [] self.anPanels = [] self.postInit = [] self.initDone = False self.scope = microscope.microscope() self.splash = splashScreen.SplashScreen(self, self.scope) self.splash.Show() self.sh = wx.py.shell.Shell( id=-1, parent=self, size=wx.Size(-1, -1), style=0, locals=self.__dict__, introText= 'PYMEAcquire - note that help, license, etc. below is for Python, not PYME\n\n' ) self.AddPage(self.sh, caption='Shell') self.CreateToolPanel(getattr(options, 'gui_mode', 'default')) self.SetSize((1030, 895)) self.roi_on = False self.bin_on = False self.time1 = mytimer.mytimer() self.time1.Start(50) wx.CallAfter(self._initialize_hardware) #self.time1.WantNotification.append(self.runInitScript) self.time1.WantNotification.append(self.splash.Tick)
def __init__(self, parent, options=None): self._init_ctrls(parent) self.options = options self._mgr = aui.AuiManager(agwFlags=aui.AUI_MGR_DEFAULT | aui.AUI_MGR_AUTONB_NO_CAPTION) atabstyle = self._mgr.GetAutoNotebookStyle() self._mgr.SetAutoNotebookStyle((atabstyle ^ aui.AUI_NB_BOTTOM) | aui.AUI_NB_TOP) # tell AuiManager to manage this frame self._mgr.SetManagedWindow(self) self.snapNum = 0 wx.EVT_CLOSE(self, self.OnCloseWindow) self.MainFrame = self #reference to this window for use in scripts etc... self.MainMenu = self.menuBar1 protocol.MainFrame = self self.toolPanels = [] self.camPanels = [] self.postInit = [] self.initDone = False self.scope = microscope.microscope() self.splash = splashScreen.SplashScreen(self, self.scope) self.splash.Show() # self.sh = wx.py.shell.Shell(id=-1, # parent=self.notebook1, size=wx.Size(-1, -1), style=0, locals=self.__dict__, # introText='Python SMI bindings - note that help, license etc below is for Python, not PySMI\n\n') # self.sh = wx.py.shell.Shell( id=-1, parent=self, size=wx.Size(-1, -1), style=0, locals=self.__dict__, introText= 'Python SMI bindings - note that help, license etc below is for Python, not PySMI\n\n' ) #self.notebook1.AddPage(imageId=-1, page=self.sh, select=True, text='Console') #self.notebook1.AddPage(imageId=-1, page=self.panel1, select=False, text='About') #self.notebook1.AddPage(page=self.sh, select=True, caption='Console') self._mgr.AddPane( self.sh, aui.AuiPaneInfo().Name("shell").Caption( "Console").Centre().CloseButton(False)) # self.notebook1.AddPage( page=self.panel1, select=False, caption='About') #self.SetSize((400, 800)) self.CreateToolPanel() #self.SetSize((1000, 800)) #self.sizer = wx.BoxSizer() #self.sizer.Add(self.notebook1, 1, wx.EXPAND) #self.SetSizer(self.Sizer) self.SetSize((1030, 895)) #self._mgr.Update() self.roi_on = False self.bin_on = False self.time1 = mytimer.mytimer() self.time1.Start(500) self.time1.WantNotification.append(self.runInitScript) self.time1.WantNotification.append(self.checkInitDone) self.time1.WantNotification.append(self.splash.Tick)
def __init__(self, parent, options = None): self._init_ctrls(parent) self.options = options self._mgr = aui.AuiManager(agwFlags = aui.AUI_MGR_DEFAULT | aui.AUI_MGR_AUTONB_NO_CAPTION) atabstyle = self._mgr.GetAutoNotebookStyle() self._mgr.SetAutoNotebookStyle((atabstyle ^ aui.AUI_NB_BOTTOM) | aui.AUI_NB_TOP) # tell AuiManager to manage this frame self._mgr.SetManagedWindow(self) self.snapNum = 0 wx.EVT_CLOSE(self, self.OnCloseWindow) self.MainFrame = self #reference to this window for use in scripts etc... self.MainMenu = self.menuBar1 protocol.MainFrame = self self.toolPanels = [] self.camPanels = [] self.postInit = [] self.initDone = False self.scope = microscope.microscope() self.splash = splashScreen.SplashScreen(self, self.scope) self.splash.Show() # self.sh = wx.py.shell.Shell(id=-1, # parent=self.notebook1, size=wx.Size(-1, -1), style=0, locals=self.__dict__, # introText='Python SMI bindings - note that help, license etc below is for Python, not PySMI\n\n') # self.sh = wx.py.shell.Shell(id=-1, parent=self, size=wx.Size(-1, -1), style=0, locals=self.__dict__, introText='Python SMI bindings - note that help, license etc below is for Python, not PySMI\n\n') #self.notebook1.AddPage(imageId=-1, page=self.sh, select=True, text='Console') #self.notebook1.AddPage(imageId=-1, page=self.panel1, select=False, text='About') #self.notebook1.AddPage(page=self.sh, select=True, caption='Console') self._mgr.AddPane(self.sh, aui.AuiPaneInfo(). Name("shell").Caption("Console").Centre().CloseButton(False)) # self.notebook1.AddPage( page=self.panel1, select=False, caption='About') #self.SetSize((400, 800)) self.CreateToolPanel() #self.SetSize((1000, 800)) #self.sizer = wx.BoxSizer() #self.sizer.Add(self.notebook1, 1, wx.EXPAND) #self.SetSizer(self.Sizer) self.SetSize((1030, 895)) #self._mgr.Update() self.roi_on = False self.bin_on = False self.time1 = mytimer.mytimer() self.time1.Start(500) self.time1.WantNotification.append(self.runInitScript) self.time1.WantNotification.append(self.checkInitDone) self.time1.WantNotification.append(self.splash.Tick)