예제 #1
0
    def __init__(self, parent):
        super(Wizard, self).__init__(parent,
                                     title="",
                                     size=(640 + 120, 480 + 40))

        self.parent = parent

        self.driver = Driver.Instance()

        self.currentWorkbench = profile.getPreference('workbench')

        self.connectionPage = ConnectionPage(
            self,
            buttonPrevCallback=self.onConnectionPagePrevClicked,
            buttonNextCallback=self.onConnectionPageNextClicked)
        self.calibrationPage = CalibrationPage(
            self,
            buttonPrevCallback=self.onCalibrationPagePrevClicked,
            buttonNextCallback=self.onCalibrationPageNextClicked)
        self.scanningPage = ScanningPage(
            self,
            buttonPrevCallback=self.onScanningPagePrevClicked,
            buttonNextCallback=self.onScanningPageNextClicked)

        pages = [self.connectionPage, self.calibrationPage, self.scanningPage]

        self.connectionPage.intialize(pages)
        self.calibrationPage.intialize(pages)
        self.scanningPage.intialize(pages)

        self.connectionPage.Show()
        self.calibrationPage.Hide()
        self.scanningPage.Hide()

        self.driver.board.setUnplugCallback(
            lambda: wx.CallAfter(self.onBoardUnplugged))
        self.driver.camera.setUnplugCallback(
            lambda: wx.CallAfter(self.onCameraUnplugged))

        hbox = wx.BoxSizer(wx.HORIZONTAL)
        hbox.Add(self.connectionPage, 1, wx.ALL | wx.EXPAND, 0)
        hbox.Add(self.calibrationPage, 1, wx.ALL | wx.EXPAND, 0)
        hbox.Add(self.scanningPage, 1, wx.ALL | wx.EXPAND, 0)

        self.SetSizer(hbox)

        self.Bind(wx.EVT_CLOSE, lambda e: self.onExit())

        self.Centre()
        self.ShowModal()