def __init__(self, parent): Workbench.__init__(self, parent) self.driver = Driver.Instance() #-- Toolbar Configuration self.connectTool = self.toolbar.AddLabelTool( wx.NewId(), _("Connect"), wx.Bitmap(resources.getPathForImage("connect.png")), shortHelp=_("Connect")) self.disconnectTool = self.toolbar.AddLabelTool( wx.NewId(), _("Disconnect"), wx.Bitmap(resources.getPathForImage("disconnect.png")), shortHelp=_("Disconnect")) self.toolbar.Realize() #-- Disable Toolbar Items self.enableLabelTool(self.connectTool, True) self.enableLabelTool(self.disconnectTool, False) #-- Bind Toolbar Items self.Bind(wx.EVT_TOOL, self.onConnectToolClicked, self.connectTool) self.Bind(wx.EVT_TOOL, self.onDisconnectToolClicked, self.disconnectTool) self.Layout() self.videoView = None self.Bind(wx.EVT_SHOW, self.onShow)
def __init__(self, parent, title="", hasUndo=True, hasRestore=True): wx.Panel.__init__(self, parent, size=(275, -1)) #-- Elements self.hasUndo = hasUndo self.hasRestore = hasRestore self.title = title self.titleText = TitleText(self, title, bold=True) if self.hasUndo: self.undoButton = wx.BitmapButton( self, wx.NewId(), wx.Bitmap(resources.getPathForImage("undo.png"), wx.BITMAP_TYPE_ANY)) if self.hasRestore: self.restoreButton = wx.BitmapButton( self, wx.NewId(), wx.Bitmap(resources.getPathForImage("restore.png"), wx.BITMAP_TYPE_ANY)) self.content = wx.Panel(self) self.sections = OrderedDict() if self.hasUndo: self.undoButton.Disable() self.content.Hide() #-- Events if self.hasUndo: self.undoButton.Bind(wx.EVT_BUTTON, self.onUndoButtonClicked) if self.hasRestore: self.restoreButton.Bind(wx.EVT_BUTTON, self.onRestoreButtonClicked) #-- Layout self.vbox = wx.BoxSizer(wx.VERTICAL) self.hbox = wx.BoxSizer(wx.HORIZONTAL) self.hbox.Add(self.titleText, 1, wx.LEFT | wx.EXPAND, 2) if self.hasUndo: self.hbox.Add(self.undoButton, 0, wx.ALL, 0) if self.hasRestore: self.hbox.Add(self.restoreButton, 0, wx.ALL, 0) self.vbox.Add(self.hbox, 0, wx.ALL | wx.EXPAND, 0) self.contentBox = wx.BoxSizer(wx.VERTICAL) self.content.SetSizer(self.contentBox) self.vbox.Add(self.content, 1, wx.LEFT | wx.EXPAND, 10) self.SetSizer(self.vbox) self.Layout() #-- Undo self.undoObjects = []
def onAbout(self, event): """ """ info = wx.AboutDialogInfo() icon = wx.Icon(resources.getPathForImage("horus.ico"), wx.BITMAP_TYPE_ICO) info.SetIcon(icon) info.SetName(u'Horus') info.SetVersion(VERSION) techDescription = '' if os.path.isfile(resources.getPathForVersion()): with open(resources.getPathForVersion(), 'r') as f: techDescription = '\n' + f.read().replace('\n','') info.SetDescription(_('Horus is an Open Source 3D Scanner manager') + techDescription) info.SetCopyright(u'(C) 2014-2015 Mundo Reader S.L.') info.SetWebSite(u'http://www.bq.com') info.SetLicence("""Horus is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Horus is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with File Hunter; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA""") info.AddDeveloper(u'Jesús Arroyo, Irene Sanz') info.AddDocWriter(u'Jesús Arroyo, Ángel Larrañaga') info.AddArtist(u'Jesús Arroyo, Nestor Toribio') info.AddTranslator(u'Jesús Arroyo, Irene Sanz, Alexandre Galode, Natasha da Silva') wx.AboutBox(info)
def __init__(self, parent, afterCancelCallback=None, afterCalibrationCallback=None): Page.__init__(self, parent, title=_("Simple Laser Triangulation"), subTitle=_("Put the pattern on the platform as shown in the picture and press Calibrate to continue"), left=_("Cancel"), right=_("Calibrate"), buttonLeftCallback=self.onCancel, buttonRightCallback=self.onCalibrate, panelOrientation=wx.HORIZONTAL, viewProgress=True) self.driver = Driver.Instance() self.cameraIntrinsics = calibration.CameraIntrinsics.Instance() self.laserTriangulation = calibration.LaserTriangulation.Instance() self.afterCancelCallback = afterCancelCallback self.afterCalibrationCallback = afterCalibrationCallback #-- Image View imageView = ImageView(self._panel) imageView.setImage(wx.Image(resources.getPathForImage("pattern-position-right.jpg"))) #-- Video View self.videoView = VideoView(self._panel, self.getFrame, 50) self.videoView.SetBackgroundColour(wx.BLACK) #-- Layout self.addToPanel(imageView, 3) self.addToPanel(self.videoView, 2) #-- Events self.Bind(wx.EVT_SHOW, self.onShow) self.Layout()
def onAbout(self, event): """ """ info = wx.AboutDialogInfo() icon = wx.Icon(resources.getPathForImage("horus.ico"), wx.BITMAP_TYPE_ICO) info.SetIcon(icon) info.SetName(u'Horus') info.SetVersion(VERSION) info.SetDescription(_('Horus is an Open Source 3D Scanner manager')) info.SetCopyright(u'(C) 2014-2015 Mundo Reader S.L.') info.SetWebSite(u'http://www.bq.com') info.SetLicence("""Horus is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Horus is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with File Hunter; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA""") info.AddDeveloper(u'Jesús Arroyo, Irene Sanz') info.AddDocWriter(u'Jesús Arroyo') info.AddArtist(u'Jesús Arroyo, Nestor Toribio') info.AddTranslator(u'Jesús Arroyo, Irene Sanz') wx.AboutBox(info)
def initialize(self): self._rightButton.Hide() self.subTitleText.SetLabel(_("Press space bar to perform capures")) self.currentGrid = 0 self.gauge.SetValue(0) for panel in range(self.rows*self.columns): self.panelGrid[panel].SetBackgroundColour((221, 221, 221)) self.panelGrid[panel].setImage(wx.Image(resources.getPathForImage("void.png")))
def initialize(self): self._rightButton.Hide() self.subTitleText.SetLabel(_("Press space bar to perform captures")) self.currentGrid = 0 self.gauge.SetValue(0) for panel in xrange(self.rows*self.columns): self.panelGrid[panel].SetBackgroundColour((221, 221, 221)) self.panelGrid[panel].setImage(wx.Image(resources.getPathForImage("void.png")))
def __init__(self, callback): self.callback = callback bitmap = wx.Image(getPathForImage("splash.png"), wx.BITMAP_TYPE_PNG).ConvertToBitmap() super(SplashScreen, self).__init__(bitmap, wx.SPLASH_CENTRE_ON_SCREEN, 0, None) #-- TODO: fix in wx.SplashScreen class time.sleep(0.03) #-- wx.CallAfter(self.DoCallback)
def __init__(self, parent, buttonPrevCallback=None, buttonNextCallback=None): WizardPage.__init__(self, parent, title=_("Calibration"), buttonPrevCallback=buttonPrevCallback, buttonNextCallback=buttonNextCallback) self.driver = Driver.Instance() self.cameraIntrinsics = calibration.CameraIntrinsics.Instance() self.laserTriangulation = calibration.LaserTriangulation.Instance() self.platformExtrinsics = calibration.PlatformExtrinsics.Instance() self.phase = 'none' self.patternLabel = wx.StaticText( self.panel, label= _("Put the pattern on the platform as shown in the picture and press \"Calibrate\"" )) self.patternLabel.Wrap(400) self.imageView = ImageView(self.panel) self.imageView.setImage( wx.Image(resources.getPathForImage("pattern-position-right.jpg"))) self.calibrateButton = wx.Button(self.panel, label=_("Calibrate")) self.cancelButton = wx.Button(self.panel, label=_("Cancel")) self.gauge = wx.Gauge(self.panel, range=100, size=(-1, 30)) self.resultLabel = wx.StaticText(self.panel, size=(-1, 30)) self.cancelButton.Disable() self.resultLabel.Hide() self.skipButton.Enable() self.nextButton.Disable() #-- Layout vbox = wx.BoxSizer(wx.VERTICAL) vbox.Add(self.patternLabel, 0, wx.ALL | wx.CENTER, 5) vbox.Add(self.imageView, 1, wx.ALL | wx.EXPAND, 5) vbox.Add(self.resultLabel, 0, wx.ALL | wx.CENTER, 5) vbox.Add(self.gauge, 0, wx.ALL | wx.EXPAND, 5) hbox = wx.BoxSizer(wx.HORIZONTAL) hbox.Add(self.cancelButton, 1, wx.ALL | wx.EXPAND, 5) hbox.Add(self.calibrateButton, 1, wx.ALL | wx.EXPAND, 5) vbox.Add(hbox, 0, wx.ALL | wx.EXPAND, 2) self.panel.SetSizer(vbox) self.Layout() self.calibrateButton.Bind(wx.EVT_BUTTON, self.onCalibrationButtonClicked) self.cancelButton.Bind(wx.EVT_BUTTON, self.onCancelButtonClicked) self.Bind(wx.EVT_SHOW, self.onShow) self.videoView.setMilliseconds(20) self.videoView.setCallback(self.getFrame)
def __init__(self, parent, buttonPrevCallback=None, buttonNextCallback=None): WizardPage.__init__(self, parent, title=_("Connection"), buttonPrevCallback=buttonPrevCallback, buttonNextCallback=buttonNextCallback) self.parent = parent self.driver = Driver.Instance() self.cameraIntrinsics = calibration.CameraIntrinsics.Instance() self.autoCheck = calibration.SimpleLaserTriangulation.Instance() self.connectButton = wx.Button(self.panel, label=_("Connect")) self.settingsButton = wx.Button(self.panel, label=_("Edit settings")) self.patternLabel = wx.StaticText(self.panel, label=_("Put the pattern on the platform as shown in the picture and press \"Auto check\"")) self.patternLabel.Wrap(400) self.imageView = ImageView(self.panel) self.imageView.setImage(wx.Image(resources.getPathForImage("pattern-position-right.jpg"))) self.autoCheckButton = wx.Button(self.panel, label=_("Auto check")) self.gauge = wx.Gauge(self.panel, range=100, size=(-1, 30)) self.resultLabel = wx.StaticText(self.panel, size=(-1, 30)) self.connectButton.Enable() self.settingsButton.Enable() self.patternLabel.Disable() self.imageView.Disable() self.autoCheckButton.Disable() self.skipButton.Disable() self.nextButton.Disable() self.resultLabel.Hide() self.enableNext = False vbox = wx.BoxSizer(wx.VERTICAL) hbox = wx.BoxSizer(wx.HORIZONTAL) hbox.Add(self.connectButton, 1, wx.ALL|wx.EXPAND, 5) hbox.Add(self.settingsButton, 1, wx.ALL|wx.EXPAND, 5) vbox.Add(hbox, 0, wx.ALL|wx.EXPAND, 2) vbox.Add(self.patternLabel, 0, wx.ALL|wx.CENTER, 5) vbox.Add(self.imageView, 1, wx.ALL|wx.EXPAND, 5) vbox.Add(self.resultLabel, 0, wx.ALL|wx.CENTER, 5) vbox.Add(self.gauge, 0, wx.ALL|wx.EXPAND, 5) vbox.Add(self.autoCheckButton, 0, wx.ALL|wx.EXPAND, 5) self.panel.SetSizer(vbox) self.Layout() self.connectButton.Bind(wx.EVT_BUTTON, self.onConnectButtonClicked) self.settingsButton.Bind(wx.EVT_BUTTON, self.onSettingsButtonClicked) self.autoCheckButton.Bind(wx.EVT_BUTTON, self.onAutoCheckButtonClicked) self.Bind(wx.EVT_SHOW, self.onShow) self.videoView.setMilliseconds(50) self.videoView.setCallback(self.getDetectChessboardFrame) self.updateStatus(self.driver.isConnected)
def __init__(self, parent, buttonPrevCallback=None, buttonNextCallback=None): WizardPage.__init__(self, parent, title=_("Connection"), buttonPrevCallback=buttonPrevCallback, buttonNextCallback=buttonNextCallback) self.parent = parent self.driver = Driver.Instance() self.cameraIntrinsics = calibration.CameraIntrinsics.Instance() self.autoCheck = calibration.SimpleLaserTriangulation.Instance() self.connectButton = wx.Button(self.panel, label=_("Connect")) luminosity=profile.getProfileSettingObject('luminosity').getType() self.luminosityComboBox = wx.ComboBox(self.panel, wx.ID_ANY, value=profile.getProfileSetting('luminosity'), choices=[_(luminosity[0]), _(luminosity[1]), _(luminosity[2])], style=wx.CB_READONLY) self.patternLabel = wx.StaticText(self.panel, label=_("Put the pattern on the platform and press \"Auto check\"")) self.imageView = ImageView(self.panel) self.imageView.setImage(wx.Image(resources.getPathForImage("pattern-position-right.jpg"))) self.autoCheckButton = wx.Button(self.panel, label=_("Auto check")) self.gauge = wx.Gauge(self.panel, range=100, size=(-1, 30)) self.resultLabel = wx.StaticText(self.panel, size=(-1, 30)) self.connectButton.Enable() self.patternLabel.Disable() self.imageView.Disable() self.autoCheckButton.Disable() self.skipButton.Disable() self.nextButton.Disable() self.resultLabel.Hide() self.enableNext = False vbox = wx.BoxSizer(wx.VERTICAL) hbox = wx.BoxSizer(wx.HORIZONTAL) hbox.Add(self.connectButton, 1, wx.ALL|wx.EXPAND, 5) hbox.Add(self.luminosityComboBox, 0, wx.ALL|wx.EXPAND, 5) vbox.Add(hbox, 0, wx.ALL|wx.EXPAND, 2) vbox.Add(self.patternLabel, 0, wx.ALL|wx.CENTER, 5) vbox.Add(self.imageView, 1, wx.ALL|wx.EXPAND, 5) vbox.Add(self.resultLabel, 0, wx.ALL|wx.CENTER, 5) vbox.Add(self.gauge, 0, wx.ALL|wx.EXPAND, 5) vbox.Add(self.autoCheckButton, 0, wx.ALL|wx.EXPAND, 5) self.panel.SetSizer(vbox) self.Layout() self.connectButton.Bind(wx.EVT_BUTTON, self.onConnectButtonClicked) self.luminosityComboBox.Bind(wx.EVT_COMBOBOX, self.onLuminosityComboBoxChanged) self.autoCheckButton.Bind(wx.EVT_BUTTON, self.onAutoCheckButtonClicked) self.Bind(wx.EVT_SHOW, self.onShow) self.videoView.setMilliseconds(50) self.videoView.setCallback(self.getDetectChessboardFrame) self.updateStatus(self.driver.isConnected)
def __init__(self, parent, title="", hasUndo=True, hasRestore=True): wx.Panel.__init__(self, parent, size=(275, -1)) #-- Elements self.hasUndo = hasUndo self.hasRestore = hasRestore self.title = title self.titleText = TitleText(self, title, bold=True) if self.hasUndo: self.undoButton = wx.BitmapButton(self, wx.NewId(), wx.Bitmap(resources.getPathForImage("undo.png"), wx.BITMAP_TYPE_ANY)) if self.hasRestore: self.restoreButton = wx.BitmapButton(self, wx.NewId(), wx.Bitmap(resources.getPathForImage("restore.png"), wx.BITMAP_TYPE_ANY)) self.content = wx.Panel(self) self.sections = OrderedDict() if self.hasUndo: self.undoButton.Disable() self.content.Hide() #-- Events if self.hasUndo: self.undoButton.Bind(wx.EVT_BUTTON, self.onUndoButtonClicked) if self.hasRestore: self.restoreButton.Bind(wx.EVT_BUTTON, self.onRestoreButtonClicked) #-- Layout self.vbox = wx.BoxSizer(wx.VERTICAL) self.hbox = wx.BoxSizer(wx.HORIZONTAL) self.hbox.Add(self.titleText, 1, wx.LEFT|wx.EXPAND, 2) if self.hasUndo: self.hbox.Add(self.undoButton, 0, wx.ALL, 0) if self.hasRestore: self.hbox.Add(self.restoreButton, 0, wx.ALL, 0) self.vbox.Add(self.hbox, 0, wx.ALL|wx.EXPAND, 0) self.contentBox = wx.BoxSizer(wx.VERTICAL) self.content.SetSizer(self.contentBox) self.vbox.Add(self.content, 1, wx.LEFT|wx.EXPAND, 10) self.SetSizer(self.vbox) self.Layout() #-- Undo self.undoObjects = []
def __init__(self, parent, afterCancelCallback=None, afterCalibrationCallback=None): Page.__init__(self, parent, title=_("Camera Intrinsics"), subTitle=_("Press space bar to perform captures"), left=_("Cancel"), right=_("Calibrate"), buttonLeftCallback=self.onCancel, buttonRightCallback=self.onCalibrate, panelOrientation=wx.HORIZONTAL, viewProgress=True) self.driver = Driver.Instance() self.cameraIntrinsics = calibration.CameraIntrinsics.Instance() self.afterCancelCallback = afterCancelCallback self.afterCalibrationCallback = afterCalibrationCallback #-- Video View self.videoView = VideoView(self._panel, self.getFrame, 50) self.videoView.SetBackgroundColour(wx.BLACK) #-- Image Grid Panel self.imageGridPanel = wx.Panel(self._panel) self.rows, self.columns = 2, 6 self.panelGrid = [] self.gridSizer = wx.GridSizer(self.rows, self.columns, 3, 3) for panel in xrange(self.rows * self.columns): self.panelGrid.append(ImageView(self.imageGridPanel)) self.panelGrid[panel].Bind(wx.EVT_KEY_DOWN, self.onKeyPress) self.panelGrid[panel].SetBackgroundColour((221, 221, 221)) self.panelGrid[panel].setImage( wx.Image(resources.getPathForImage("void.png"))) self.gridSizer.Add(self.panelGrid[panel], 0, wx.ALL | wx.EXPAND) self.imageGridPanel.SetSizer(self.gridSizer) #-- Layout self.addToPanel(self.videoView, 1) self.addToPanel(self.imageGridPanel, 3) #-- Events self.Bind(wx.EVT_SHOW, self.onShow) self.videoView.Bind(wx.EVT_KEY_DOWN, self.onKeyPress) self.imageGridPanel.Bind(wx.EVT_KEY_DOWN, self.onKeyPress) self.videoView.SetFocus() self.Layout()
def __init__(self, parent): wx.Panel.__init__(self, parent) logo = ImageView(self) logo.setImage(wx.Image(resources.getPathForImage("logo.png"))) titleText = wx.StaticText(self, label=_("3D Scanning for everyone")) titleText.SetFont((wx.Font(13, wx.FONTFAMILY_DEFAULT, wx.NORMAL, wx.FONTWEIGHT_NORMAL))) separator = wx.StaticLine(self, -1, style=wx.LI_HORIZONTAL) vbox = wx.BoxSizer(wx.VERTICAL) vbox.Add(logo, 10, wx.ALL^wx.BOTTOM|wx.EXPAND, 30) vbox.Add(titleText, 0, wx.TOP|wx.CENTER, 20) vbox.Add((0,0), 1, wx.ALL|wx.EXPAND, 0) vbox.Add(separator, 0, wx.ALL|wx.EXPAND, 10) self.SetSizer(vbox) self.Layout()
def loadGLTexture(filename): tex = glGenTextures(1) glBindTexture(GL_TEXTURE_2D, tex) glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR) glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR) img = wx.ImageFromBitmap(wx.Bitmap(getPathForImage(filename))) rgbData = img.GetData() alphaData = img.GetAlphaData() if alphaData is not None: data = '' for i in xrange(0, len(alphaData)): data += rgbData[i*3:i*3+3] + alphaData[i] glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, img.GetWidth(), img.GetHeight(), 0, GL_RGBA, GL_UNSIGNED_BYTE, data) else: glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, img.GetWidth(), img.GetHeight(), 0, GL_RGB, GL_UNSIGNED_BYTE, rgbData) return tex
def __init__(self, parent, buttonPrevCallback=None, buttonNextCallback=None): WizardPage.__init__(self, parent, title=_("Calibration"), buttonPrevCallback=buttonPrevCallback, buttonNextCallback=buttonNextCallback) self.driver = Driver.Instance() self.cameraIntrinsics = calibration.CameraIntrinsics.Instance() self.laserTriangulation = calibration.LaserTriangulation.Instance() self.platformExtrinsics = calibration.PlatformExtrinsics.Instance() self.phase = 'none' self.patternLabel = wx.StaticText(self.panel, label=_("Put the pattern on the platform as shown in the picture and press \"Calibrate\"")) self.patternLabel.Wrap(400) self.imageView = ImageView(self.panel) self.imageView.setImage(wx.Image(resources.getPathForImage("pattern-position-right.jpg"))) self.calibrateButton = wx.Button(self.panel, label=_("Calibrate")) self.cancelButton = wx.Button(self.panel, label=_("Cancel")) self.gauge = wx.Gauge(self.panel, range=100, size=(-1, 30)) self.resultLabel = wx.StaticText(self.panel, size=(-1, 30)) self.cancelButton.Disable() self.resultLabel.Hide() self.skipButton.Enable() self.nextButton.Disable() #-- Layout vbox = wx.BoxSizer(wx.VERTICAL) vbox.Add(self.patternLabel, 0, wx.ALL|wx.CENTER, 5) vbox.Add(self.imageView, 1, wx.ALL|wx.EXPAND, 5) vbox.Add(self.resultLabel, 0, wx.ALL|wx.CENTER, 5) vbox.Add(self.gauge, 0, wx.ALL|wx.EXPAND, 5) hbox = wx.BoxSizer(wx.HORIZONTAL) hbox.Add(self.cancelButton, 1, wx.ALL|wx.EXPAND, 5) hbox.Add(self.calibrateButton, 1, wx.ALL|wx.EXPAND, 5) vbox.Add(hbox, 0, wx.ALL|wx.EXPAND, 2) self.panel.SetSizer(vbox) self.Layout() self.calibrateButton.Bind(wx.EVT_BUTTON, self.onCalibrationButtonClicked) self.cancelButton.Bind(wx.EVT_BUTTON, self.onCancelButtonClicked) self.Bind(wx.EVT_SHOW, self.onShow) self.videoView.setMilliseconds(20) self.videoView.setCallback(self.getFrame)
def __init__(self, parent, afterCancelCallback=None, afterCalibrationCallback=None): Page.__init__(self, parent, title=_("Camera Intrinsics"), subTitle=_("Press space bar to perform captures"), left=_("Cancel"), right=_("Calibrate"), buttonLeftCallback=self.onCancel, buttonRightCallback=self.onCalibrate, panelOrientation=wx.HORIZONTAL, viewProgress=True) self.driver = Driver.Instance() self.cameraIntrinsics = calibration.CameraIntrinsics.Instance() self.afterCancelCallback = afterCancelCallback self.afterCalibrationCallback = afterCalibrationCallback #-- Video View self.videoView = VideoView(self._panel, self.getFrame, 50) self.videoView.SetBackgroundColour(wx.BLACK) #-- Image Grid Panel self.imageGridPanel = wx.Panel(self._panel) self.rows, self.columns = 2, 6 self.panelGrid = [] self.gridSizer = wx.GridSizer(self.rows, self.columns, 3, 3) for panel in xrange(self.rows*self.columns): self.panelGrid.append(ImageView(self.imageGridPanel)) self.panelGrid[panel].Bind(wx.EVT_KEY_DOWN, self.onKeyPress) self.panelGrid[panel].SetBackgroundColour((221, 221, 221)) self.panelGrid[panel].setImage(wx.Image(resources.getPathForImage("void.png"))) self.gridSizer.Add(self.panelGrid[panel], 0, wx.ALL|wx.EXPAND) self.imageGridPanel.SetSizer(self.gridSizer) #-- Layout self.addToPanel(self.videoView, 1) self.addToPanel(self.imageGridPanel, 3) #-- Events self.Bind(wx.EVT_SHOW, self.onShow) self.videoView.Bind(wx.EVT_KEY_DOWN, self.onKeyPress) self.imageGridPanel.Bind(wx.EVT_KEY_DOWN, self.onKeyPress) self.videoView.SetFocus() self.Layout()
def __init__(self, parent, resize=True, size=(-1,-1)): wx.Panel.__init__(self, parent, size=size) #, style=wx.SIMPLE_BORDER) self.xOffset = 0 self.yOffset = 0 self.defaultImage = wx.Image(resources.getPathForImage("nusb.png")) self.image = self.defaultImage self.bitmap = wx.BitmapFromImage(self.defaultImage) self.SetDoubleBuffered(True) self.Bind(wx.EVT_SHOW, self.onShow) self.Bind(wx.EVT_PAINT, self.onPaint) if resize: self.Bind(wx.EVT_SIZE, self.onResize) self.hide = True
def __init__(self, parent): super(PatternDistanceWindow, self).__init__(parent, title=_('Pattern distance'), size=(420,-1), style=wx.DEFAULT_FRAME_STYLE^wx.RESIZE_BORDER) self.value = float(profile.getProfileSetting('pattern_distance')) self.cameraIntrinsics = calibration.CameraIntrinsics.Instance() self.simpleLaserTriangulation = calibration.SimpleLaserTriangulation.Instance() self.laserTriangulation = calibration.LaserTriangulation.Instance() self.platformExtrinsics = calibration.PlatformExtrinsics.Instance() #-- Elements self.description = wx.StaticText(self, label=_('Pattern distance value must be a number higher than 0. Please, change it in the textbox below.')) self.description.Wrap(400) tooltip = _("Minimum distance between the origin of the pattern (bottom-left corner) and the pattern's base surface") self.image = wx.Image(resources.getPathForImage("pattern-distance.jpg"), wx.BITMAP_TYPE_ANY) self.patternImage = wx.StaticBitmap(self, wx.ID_ANY, wx.BitmapFromImage(self.image)) self.patternImage.SetToolTip(wx.ToolTip(tooltip)) self.patternLabel = wx.StaticText(self, label=_('Pattern distance (mm)')) self.patternLabel.SetToolTip(wx.ToolTip(tooltip)) self.patternTextbox = wx.TextCtrl(self, value = str(profile.getProfileSettingFloat('pattern_distance'))) self.okButton = wx.Button(self, label=_('OK')) self.cancelButton = wx.Button(self, label=_('Cancel')) #-- Events self.patternTextbox.Bind(wx.EVT_TEXT, self.onTextBoxChanged) self.cancelButton.Bind(wx.EVT_BUTTON, self.onClose) self.okButton.Bind(wx.EVT_BUTTON, self.onOk) self.Bind(wx.EVT_CLOSE, self.onClose) #-- Layout vbox = wx.BoxSizer(wx.VERTICAL) vbox.Add(self.description, 0, wx.ALL|wx.CENTER, 10) vbox.Add(self.patternImage, 0, wx.ALL|wx.CENTER, 10) hbox = wx.BoxSizer(wx.HORIZONTAL) hbox.Add(self.patternLabel, 0, wx.ALL, 7) hbox.Add(self.patternTextbox, 0, wx.ALL, 3) hbox.Add(self.okButton, 0, wx.ALL, 3) hbox.Add(self.cancelButton, 0, wx.ALL, 3) vbox.Add(hbox, 0, wx.ALL|wx.CENTER, 10) self.SetSizer(vbox) self.Center() self.Fit() self.ShowModal()
def onAbout(self, event): """ """ info = wx.AboutDialogInfo() icon = wx.Icon(resources.getPathForImage("horus.ico"), wx.BITMAP_TYPE_ICO) info.SetIcon(icon) info.SetName(u'Horus') info.SetVersion(version.getVersion()) techDescription = _('Horus is an Open Source 3D Scanner manager') techDescription += '\n' + 'Version: ' + version.getVersion() build = version.getBuild() if build is not '': techDescription += '\n' + 'Build: ' + version.getBuild() github = version.getGitHub() if github is not '': techDescription += '\n' + 'GitHub: ' + version.getGitHub() info.SetDescription(techDescription) info.SetCopyright(u'(C) 2014-2015 Mundo Reader S.L.') info.SetWebSite(u'http://www.bq.com') info.SetLicence("""Horus is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Horus is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with File Hunter; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA""") info.AddDeveloper(u'Jesús Arroyo, Irene Sanz, Jorge Robles') info.AddDocWriter(u'Jesús Arroyo, Ángel Larrañaga') info.AddArtist(u'Jesús Arroyo, Nestor Toribio') info.AddTranslator( u'Jesús Arroyo, Irene Sanz, Alexandre Galode, Natasha da Silva, Camille Montgolfier, Markus Hoedl, Andrea Fantini, Maria Albuquerque, Meike Schirmeister' ) wx.AboutBox(info)
def onAbout(self, event): """ """ info = wx.AboutDialogInfo() icon = wx.Icon(resources.getPathForImage("horus.ico"), wx.BITMAP_TYPE_ICO) info.SetIcon(icon) info.SetName(u'Horus') info.SetVersion(version.getVersion()) techDescription = _('Horus is an Open Source 3D Scanner manager') techDescription += '\n' + 'Version: ' + version.getVersion() build = version.getBuild() if build is not '': techDescription += '\n' + 'Build: ' + version.getBuild() github = version.getGitHub() if github is not '': techDescription += '\n' + 'GitHub: ' + version.getGitHub() info.SetDescription(techDescription) info.SetCopyright(u'(C) 2014-2015 Mundo Reader S.L.') info.SetWebSite(u'http://www.bq.com') info.SetLicence("""Horus is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Horus is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with File Hunter; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA""") info.AddDeveloper(u'Jesús Arroyo, Irene Sanz, Jorge Robles') info.AddDocWriter(u'Jesús Arroyo, Ángel Larrañaga') info.AddArtist(u'Jesús Arroyo, Nestor Toribio') info.AddTranslator(u'Jesús Arroyo, Irene Sanz, Alexandre Galode, Natasha da Silva, Camille Montgolfier, Markus Hoedl, Andrea Fantini, Maria Albuquerque, Meike Schirmeister') wx.AboutBox(info)
def load(self): #-- Toolbar Configuration self.playTool = self.toolbar.AddLabelTool( wx.NewId(), _("Play"), wx.Bitmap(resources.getPathForImage("play.png")), shortHelp=_("Play")) self.stopTool = self.toolbar.AddLabelTool( wx.NewId(), _("Stop"), wx.Bitmap(resources.getPathForImage("stop.png")), shortHelp=_("Stop")) self.pauseTool = self.toolbar.AddLabelTool( wx.NewId(), _("Pause"), wx.Bitmap(resources.getPathForImage("pause.png")), shortHelp=_("Pause")) self.toolbar.Realize() #-- Disable Toolbar Items self.enableLabelTool(self.playTool, False) self.enableLabelTool(self.stopTool, False) self.enableLabelTool(self.pauseTool, False) #-- Bind Toolbar Items self.Bind(wx.EVT_TOOL, self.onPlayToolClicked, self.playTool) self.Bind(wx.EVT_TOOL, self.onStopToolClicked, self.stopTool) self.Bind(wx.EVT_TOOL, self.onPauseToolClicked, self.pauseTool) self.scrollPanel = wx.lib.scrolledpanel.ScrolledPanel(self._panel, size=(290, -1)) self.scrollPanel.SetupScrolling(scroll_x=False, scrollIntoView=False) self.scrollPanel.SetAutoLayout(1) self.controls = ExpandableControl(self.scrollPanel) self.controls.addPanel('scan_parameters', ScanParameters(self.controls)) self.controls.addPanel('rotative_platform', RotativePlatform(self.controls)) self.controls.addPanel('image_acquisition', ImageAcquisition(self.controls)) self.controls.addPanel('image_segmentation', ImageSegmentation(self.controls)) self.controls.addPanel('point_cloud_generation', PointCloudGeneration(self.controls)) self.splitterWindow = wx.SplitterWindow(self._panel) self.videoView = VideoView(self.splitterWindow, self.getFrame, 10) self.videoView.SetBackgroundColour(wx.BLACK) self.scenePanel = wx.Panel(self.splitterWindow) self.sceneView = SceneView(self.scenePanel) self.gauge = wx.Gauge(self.scenePanel, size=(-1, 30)) self.gauge.Hide() vbox = wx.BoxSizer(wx.VERTICAL) vbox.Add(self.sceneView, 1, wx.ALL | wx.EXPAND, 0) vbox.Add(self.gauge, 0, wx.ALL | wx.EXPAND, 0) self.scenePanel.SetSizer(vbox) self.splitterWindow.SplitVertically(self.videoView, self.scenePanel) self.splitterWindow.SetMinimumPaneSize(200) #-- Layout vsbox = wx.BoxSizer(wx.VERTICAL) vsbox.Add(self.controls, 0, wx.ALL | wx.EXPAND, 0) self.scrollPanel.SetSizer(vsbox) vsbox.Fit(self.scrollPanel) self.addToPanel(self.scrollPanel, 0) self.addToPanel(self.splitterWindow, 1) #- Video View Selector _choices = [] choices = profile.getProfileSettingObject('img_type').getType() for i in choices: _choices.append(_(i)) self.videoViewsDict = dict(zip(_choices, choices)) self.buttonShowVideoViews = wx.BitmapButton( self.videoView, wx.NewId(), wx.Bitmap(resources.getPathForImage("views.png"), wx.BITMAP_TYPE_ANY), (10, 10)) self.comboVideoViews = wx.ComboBox( self.videoView, value=_(profile.getProfileSetting('img_type')), choices=_choices, style=wx.CB_READONLY, pos=(60, 10)) self.buttonShowVideoViews.Hide() self.comboVideoViews.Hide() self.buttonShowVideoViews.Bind(wx.EVT_BUTTON, self.onShowVideoViews) self.comboVideoViews.Bind(wx.EVT_COMBOBOX, self.onComboBoVideoViewsSelect) self.updateCallbacks() self.Layout()
def __init__(self, parent): super(SettingsWindow, self).__init__(parent, title=_('Settings'), size=(420,-1), style=wx.DEFAULT_FRAME_STYLE^wx.RESIZE_BORDER) self.driver = Driver.Instance() self.cameraIntrinsics = calibration.CameraIntrinsics.Instance() self.simpleLaserTriangulation = calibration.SimpleLaserTriangulation.Instance() self.laserTriangulation = calibration.LaserTriangulation.Instance() self.platformExtrinsics = calibration.PlatformExtrinsics.Instance() #-- Elements _choices = [] choices = profile.getProfileSettingObject('luminosity').getType() for i in choices: _choices.append(_(i)) self.initLuminosity = profile.getProfileSetting('luminosity') self.luminosityDict = dict(zip(_choices, choices)) self.luminosityText = wx.StaticText(self, label=_('Luminosity')) self.luminosityText.SetToolTip(wx.ToolTip(_('Change the luminosity until colored lines appear over the chess pattern in the video'))) self.luminosityComboBox = wx.ComboBox(self, wx.ID_ANY, value=_(self.initLuminosity), choices=_choices, style=wx.CB_READONLY) invert = profile.getProfileSettingBool('invert_motor') self.invertMotorCheckBox = wx.CheckBox(self, label=_("Invert the motor direction")) self.invertMotorCheckBox.SetValue(invert) tooltip = _("Minimum distance between the origin of the pattern (bottom-left corner) and the pattern's base surface") self.image = wx.Image(resources.getPathForImage("pattern-distance.jpg"), wx.BITMAP_TYPE_ANY) self.patternDistance = float(profile.getProfileSetting('pattern_distance')) self.patternImage = wx.StaticBitmap(self, wx.ID_ANY, wx.BitmapFromImage(self.image)) self.patternImage.SetToolTip(wx.ToolTip(tooltip)) self.patternLabel = wx.StaticText(self, label=_('Pattern distance (mm)')) self.patternLabel.SetToolTip(wx.ToolTip(tooltip)) self.patternTextbox = wx.TextCtrl(self, value = str(profile.getProfileSettingFloat('pattern_distance'))) self.okButton = wx.Button(self, label=_('OK')) self.cancelButton = wx.Button(self, label=_('Cancel')) #-- Events self.luminosityComboBox.Bind(wx.EVT_COMBOBOX, self.onLuminosityComboBoxChanged) self.invertMotorCheckBox.Bind(wx.EVT_CHECKBOX, self.onInvertMotor) self.patternTextbox.Bind(wx.EVT_TEXT, self.onTextBoxChanged) self.cancelButton.Bind(wx.EVT_BUTTON, self.onClose) self.okButton.Bind(wx.EVT_BUTTON, self.onOk) self.Bind(wx.EVT_CLOSE, self.onClose) #-- Layout vbox = wx.BoxSizer(wx.VERTICAL) hbox = wx.BoxSizer(wx.HORIZONTAL) hbox.Add(self.luminosityText, 0, wx.ALL, 7) hbox.Add(self.luminosityComboBox, 1, wx.ALL, 3) vbox.Add(hbox, 0, wx.ALL^wx.BOTTOM|wx.EXPAND, 7) vbox.Add(wx.StaticLine(self), 0, wx.ALL^wx.BOTTOM|wx.EXPAND, 10) hbox = wx.BoxSizer(wx.HORIZONTAL) hbox.Add(self.invertMotorCheckBox, 0, wx.ALL, 10) vbox.Add(hbox) vbox.Add(wx.StaticLine(self), 0, wx.ALL^wx.BOTTOM^wx.TOP|wx.EXPAND, 10) hbox = wx.BoxSizer(wx.HORIZONTAL) hbox.Add(self.patternLabel, 0, wx.ALL, 7) hbox.Add(self.patternTextbox, 1, wx.ALL, 3) vbox.Add(hbox, 0, wx.ALL^wx.BOTTOM|wx.EXPAND, 10) vbox.Add(self.patternImage, 0, wx.ALL|wx.CENTER, 10) hbox = wx.BoxSizer(wx.HORIZONTAL) hbox.Add(self.cancelButton, 1, wx.ALL, 3) hbox.Add(self.okButton, 1, wx.ALL, 3) vbox.Add(hbox, 0, wx.ALL|wx.EXPAND, 10) self.SetSizer(vbox) self.Center() self.Fit() self.ShowModal()
def __init__(self): super(MainWindow, self).__init__(None, title=_("Horus " + VERSION + " - Beta"), size=self.size) self.SetMinSize((600, 450)) ###-- Initialize Engine self.driver = Driver.Instance() self.simpleScan = scan.SimpleScan.Instance() self.textureScan = scan.TextureScan.Instance() self.pcg = scan.PointCloudGenerator.Instance() self.cameraIntrinsics = calibration.CameraIntrinsics.Instance() self.simpleLaserTriangulation = calibration.SimpleLaserTriangulation.Instance( ) self.laserTriangulation = calibration.LaserTriangulation.Instance() self.platformExtrinsics = calibration.PlatformExtrinsics.Instance() #-- Serial Name initialization serialList = self.serialList() currentSerial = profile.getProfileSetting('serial_name') if len(serialList) > 0: if currentSerial not in serialList: profile.putProfileSetting('serial_name', serialList[0]) #-- Video Id initialization videoList = self.videoList() currentVideoId = profile.getProfileSetting('camera_id') if len(videoList) > 0: if currentVideoId not in videoList: profile.putProfileSetting('camera_id', videoList[0]) self.workbenchList = { 'control': _("Control workbench"), 'calibration': _("Calibration workbench"), 'scanning': _("Scanning workbench") } self.lastFiles = eval(profile.getPreference('last_files')) print ">>> Horus " + VERSION + " <<<" ###-- Initialize GUI ##-- Set Icon icon = wx.Icon(resources.getPathForImage("horus.ico"), wx.BITMAP_TYPE_ICO) self.SetIcon(icon) ##-- Status Bar #self.CreateStatusBar() ##-- Menu Bar self.menuBar = wx.MenuBar() #-- Menu File self.menuFile = wx.Menu() self.menuLaunchWizard = self.menuFile.Append(wx.NewId(), _("Launch Wizard")) self.menuFile.AppendSeparator() self.menuLoadModel = self.menuFile.Append(wx.NewId(), _("Load Model")) self.menuSaveModel = self.menuFile.Append(wx.NewId(), _("Save Model")) self.menuClearModel = self.menuFile.Append(wx.NewId(), _("Clear Model")) self.menuFile.AppendSeparator() self.menuOpenProfile = self.menuFile.Append(wx.NewId(), _("Open Profile"), _("Opens Profile .ini")) self.menuSaveProfile = self.menuFile.Append(wx.NewId(), _("Save Profile")) self.menuResetProfile = self.menuFile.Append(wx.NewId(), _("Reset Profile")) self.menuFile.AppendSeparator() menuExit = self.menuFile.Append(wx.ID_EXIT, _("Exit")) self.menuBar.Append(self.menuFile, _("File")) #-- Menu Edit self.menuEdit = wx.Menu() self.menuBasicMode = self.menuEdit.AppendRadioItem( wx.NewId(), _("Basic Mode")) self.menuAdvancedMode = self.menuEdit.AppendRadioItem( wx.NewId(), _("Advanced Mode")) self.menuEdit.AppendSeparator() self.menuPreferences = self.menuEdit.Append(wx.NewId(), _("Preferences")) self.menuBar.Append(self.menuEdit, _("Edit")) #-- Menu View menuView = wx.Menu() self.menuControl = wx.Menu() self.menuControlPanel = self.menuControl.AppendCheckItem( wx.NewId(), _("Panel")) self.menuControlVideo = self.menuControl.AppendCheckItem( wx.NewId(), _("Video")) menuView.AppendMenu(wx.NewId(), _("Control"), self.menuControl) self.menuCalibration = wx.Menu() self.menuCalibrationPanel = self.menuCalibration.AppendCheckItem( wx.NewId(), _("Panel")) self.menuCalibrationVideo = self.menuCalibration.AppendCheckItem( wx.NewId(), _("Video")) menuView.AppendMenu(wx.NewId(), _("Calibration"), self.menuCalibration) self.menuScanning = wx.Menu() self.menuScanningPanel = self.menuScanning.AppendCheckItem( wx.NewId(), _("Panel")) self.menuScanningVideo = self.menuScanning.AppendCheckItem( wx.NewId(), _("Video")) self.menuScanningScene = self.menuScanning.AppendCheckItem( wx.NewId(), _("Scene")) menuView.AppendMenu(wx.NewId(), _("Scanning"), self.menuScanning) self.menuBar.Append(menuView, _("View")) #-- Menu Help menuHelp = wx.Menu() menuAbout = menuHelp.Append(wx.ID_ABOUT, _("About")) menuWelcome = menuHelp.Append(wx.ID_ANY, _("Welcome")) self.menuBar.Append(menuHelp, _("Help")) self.SetMenuBar(self.menuBar) ##-- Create Workbenchs self.controlWorkbench = ControlWorkbench(self) self.scanningWorkbench = ScanningWorkbench(self) self.calibrationWorkbench = CalibrationWorkbench(self) for workbench in [ self.controlWorkbench, self.calibrationWorkbench, self.scanningWorkbench ]: workbench.combo.Clear() workbench.combo.Append(self.workbenchList['control']) workbench.combo.Append(self.workbenchList['calibration']) workbench.combo.Append(self.workbenchList['scanning']) sizer = wx.BoxSizer(wx.VERTICAL) sizer.Add(self.controlWorkbench, 1, wx.ALL | wx.EXPAND) sizer.Add(self.calibrationWorkbench, 1, wx.ALL | wx.EXPAND) sizer.Add(self.scanningWorkbench, 1, wx.ALL | wx.EXPAND) self.SetSizer(sizer) ##-- Events self.Bind(wx.EVT_MENU, self.onLaunchWizard, self.menuLaunchWizard) self.Bind(wx.EVT_MENU, self.onLoadModel, self.menuLoadModel) self.Bind(wx.EVT_MENU, self.onSaveModel, self.menuSaveModel) self.Bind(wx.EVT_MENU, self.onClearModel, self.menuClearModel) self.Bind(wx.EVT_MENU, self.onOpenProfile, self.menuOpenProfile) self.Bind(wx.EVT_MENU, self.onSaveProfile, self.menuSaveProfile) self.Bind(wx.EVT_MENU, self.onResetProfile, self.menuResetProfile) self.Bind(wx.EVT_MENU, self.onExit, menuExit) self.Bind(wx.EVT_MENU, self.onModeChanged, self.menuBasicMode) self.Bind(wx.EVT_MENU, self.onModeChanged, self.menuAdvancedMode) self.Bind(wx.EVT_MENU, self.onPreferences, self.menuPreferences) self.Bind(wx.EVT_MENU, self.onControlPanelClicked, self.menuControlPanel) self.Bind(wx.EVT_MENU, self.onControlVideoClicked, self.menuControlVideo) self.Bind(wx.EVT_MENU, self.onCalibrationPanelClicked, self.menuCalibrationPanel) self.Bind(wx.EVT_MENU, self.onCalibrationVideoClicked, self.menuCalibrationVideo) self.Bind(wx.EVT_MENU, self.onScanningPanelClicked, self.menuScanningPanel) self.Bind(wx.EVT_MENU, self.onScanningVideoSceneClicked, self.menuScanningVideo) self.Bind(wx.EVT_MENU, self.onScanningVideoSceneClicked, self.menuScanningScene) self.Bind(wx.EVT_MENU, self.onAbout, menuAbout) self.Bind(wx.EVT_MENU, self.onWelcome, menuWelcome) self.Bind(wx.EVT_COMBOBOX, self.onComboBoxWorkbenchSelected, self.controlWorkbench.combo) self.Bind(wx.EVT_COMBOBOX, self.onComboBoxWorkbenchSelected, self.calibrationWorkbench.combo) self.Bind(wx.EVT_COMBOBOX, self.onComboBoxWorkbenchSelected, self.scanningWorkbench.combo) self.Bind(wx.EVT_CLOSE, self.onClose) self.updateProfileToAllControls() x, y, w, h = wx.Display(0).GetGeometry() ws, hs = self.size self.SetPosition((x + (w - ws) / 2., y + (h - hs) / 2.)) #self.Center() self.Show()
def __init__(self): super(MainWindow, self).__init__(None, title=_("Horus " + version.getVersion()), size=self.size) self.SetMinSize((600, 450)) ###-- Initialize Engine self.driver = Driver.Instance() self.simpleScan = scan.SimpleScan.Instance() self.textureScan = scan.TextureScan.Instance() self.pcg = scan.PointCloudGenerator.Instance() self.cameraIntrinsics = calibration.CameraIntrinsics.Instance() self.simpleLaserTriangulation = calibration.SimpleLaserTriangulation.Instance() self.laserTriangulation = calibration.LaserTriangulation.Instance() self.platformExtrinsics = calibration.PlatformExtrinsics.Instance() #-- Serial Name initialization serialList = self.serialList() currentSerial = profile.getProfileSetting('serial_name') if len(serialList) > 0: if currentSerial not in serialList: profile.putProfileSetting('serial_name', serialList[0]) #-- Video Id initialization videoList = self.videoList() currentVideoId = profile.getProfileSetting('camera_id') if len(videoList) > 0: if currentVideoId not in videoList: profile.putProfileSetting('camera_id', videoList[0]) self.lastFiles = eval(profile.getPreference('last_files')) print ">>> Horus " + version.getVersion() + " <<<" ###-- Initialize GUI ##-- Set Icon icon = wx.Icon(resources.getPathForImage("horus.ico"), wx.BITMAP_TYPE_ICO) self.SetIcon(icon) ##-- Status Bar #self.CreateStatusBar() ##-- Menu Bar self.menuBar = wx.MenuBar() #-- Menu File self.menuFile = wx.Menu() self.menuLaunchWizard = self.menuFile.Append(wx.NewId(), _("Launch Wizard")) self.menuFile.AppendSeparator() self.menuLoadModel = self.menuFile.Append(wx.NewId(), _("Load Model")) self.menuSaveModel = self.menuFile.Append(wx.NewId(), _("Save Model")) self.menuClearModel = self.menuFile.Append(wx.NewId(), _("Clear Model")) self.menuFile.AppendSeparator() self.menuOpenProfile = self.menuFile.Append(wx.NewId(), _("Open Profile"), _("Opens Profile .ini")) self.menuSaveProfile = self.menuFile.Append(wx.NewId(), _("Save Profile")) self.menuResetProfile = self.menuFile.Append(wx.NewId(), _("Reset Profile")) self.menuFile.AppendSeparator() self.menuExit = self.menuFile.Append(wx.ID_EXIT, _("Exit")) self.menuBar.Append(self.menuFile, _("File")) #-- Menu Edit self.menuEdit = wx.Menu() # self.menuBasicMode = self.menuEdit.AppendRadioItem(wx.NewId(), _("Basic Mode")) # self.menuAdvancedMode = self.menuEdit.AppendRadioItem(wx.NewId(), _("Advanced Mode")) # self.menuEdit.AppendSeparator() self.menuPreferences = self.menuEdit.Append(wx.NewId(), _("Preferences")) self.menuMachineSettings = self.menuEdit.Append(wx.NewId(), _("Machine Settings")) self.menuBar.Append(self.menuEdit, _("Edit")) #-- Menu View self.menuView = wx.Menu() self.menuControl = wx.Menu() self.menuControlPanel = self.menuControl.AppendCheckItem(wx.NewId(), _("Panel")) self.menuControlVideo = self.menuControl.AppendCheckItem(wx.NewId(), _("Video")) self.menuView.AppendMenu(wx.NewId(), _("Control"), self.menuControl) self.menuCalibration = wx.Menu() self.menuCalibrationPanel = self.menuCalibration.AppendCheckItem(wx.NewId(), _("Panel")) self.menuCalibrationVideo = self.menuCalibration.AppendCheckItem(wx.NewId(), _("Video")) self.menuView.AppendMenu(wx.NewId(), _("Calibration"), self.menuCalibration) self.menuScanning = wx.Menu() self.menuScanningPanel = self.menuScanning.AppendCheckItem(wx.NewId(), _("Panel")) self.menuScanningVideo = self.menuScanning.AppendCheckItem(wx.NewId(), _("Video")) self.menuScanningScene = self.menuScanning.AppendCheckItem(wx.NewId(), _("Scene")) self.menuView.AppendMenu(wx.NewId(), _("Scanning"), self.menuScanning) self.menuBar.Append(self.menuView, _("View")) #-- Menu Help self.menuHelp = wx.Menu() self.menuWelcome = self.menuHelp.Append(wx.ID_ANY, _("Welcome")) if profile.getPreferenceBool('check_for_updates'): self.menuUpdates = self.menuHelp.Append(wx.ID_ANY, _("Updates")) self.menuWiki = self.menuHelp.Append(wx.ID_ANY, _("Wiki")) self.menuSources = self.menuHelp.Append(wx.ID_ANY, _("Sources")) self.menuIssues = self.menuHelp.Append(wx.ID_ANY, _("Issues")) self.menuForum = self.menuHelp.Append(wx.ID_ANY, _("Forum")) self.menuAbout = self.menuHelp.Append(wx.ID_ABOUT, _("About")) self.menuBar.Append(self.menuHelp, _("Help")) self.SetMenuBar(self.menuBar) ##-- Create Workbenchs self.controlWorkbench = ControlWorkbench(self) self.scanningWorkbench = ScanningWorkbench(self) self.calibrationWorkbench = CalibrationWorkbench(self) _choices = [] choices = profile.getProfileSettingObject('workbench').getType() for i in choices: _choices.append(_(i)) self.workbenchDict = dict(zip(_choices, choices)) for workbench in [self.controlWorkbench, self.calibrationWorkbench, self.scanningWorkbench]: workbench.combo.Clear() for i in choices: workbench.combo.Append(_(i)) sizer = wx.BoxSizer(wx.VERTICAL) sizer.Add(self.controlWorkbench, 1, wx.ALL|wx.EXPAND) sizer.Add(self.calibrationWorkbench, 1, wx.ALL|wx.EXPAND) sizer.Add(self.scanningWorkbench, 1, wx.ALL|wx.EXPAND) self.SetSizer(sizer) ##-- Events self.Bind(wx.EVT_MENU, self.onLaunchWizard, self.menuLaunchWizard) self.Bind(wx.EVT_MENU, self.onLoadModel, self.menuLoadModel) self.Bind(wx.EVT_MENU, self.onSaveModel, self.menuSaveModel) self.Bind(wx.EVT_MENU, self.onClearModel, self.menuClearModel) self.Bind(wx.EVT_MENU, self.onOpenProfile, self.menuOpenProfile) self.Bind(wx.EVT_MENU, self.onSaveProfile, self.menuSaveProfile) self.Bind(wx.EVT_MENU, self.onResetProfile, self.menuResetProfile) self.Bind(wx.EVT_MENU, self.onExit, self.menuExit) # self.Bind(wx.EVT_MENU, self.onModeChanged, self.menuBasicMode) # self.Bind(wx.EVT_MENU, self.onModeChanged, self.menuAdvancedMode) self.Bind(wx.EVT_MENU, self.onPreferences, self.menuPreferences) self.Bind(wx.EVT_MENU, self.onMachineSettings, self.menuMachineSettings) self.Bind(wx.EVT_MENU, self.onControlPanelClicked, self.menuControlPanel) self.Bind(wx.EVT_MENU, self.onControlVideoClicked, self.menuControlVideo) self.Bind(wx.EVT_MENU, self.onCalibrationPanelClicked, self.menuCalibrationPanel) self.Bind(wx.EVT_MENU, self.onCalibrationVideoClicked, self.menuCalibrationVideo) self.Bind(wx.EVT_MENU, self.onScanningPanelClicked, self.menuScanningPanel) self.Bind(wx.EVT_MENU, self.onScanningVideoSceneClicked, self.menuScanningVideo) self.Bind(wx.EVT_MENU, self.onScanningVideoSceneClicked, self.menuScanningScene) self.Bind(wx.EVT_MENU, self.onAbout, self.menuAbout) self.Bind(wx.EVT_MENU, self.onWelcome, self.menuWelcome) if profile.getPreferenceBool('check_for_updates'): self.Bind(wx.EVT_MENU, self.onUpdates, self.menuUpdates) self.Bind(wx.EVT_MENU, lambda e: webbrowser.open('https://github.com/bq/horus/wiki'), self.menuWiki) self.Bind(wx.EVT_MENU, lambda e: webbrowser.open('https://github.com/bq/horus'), self.menuSources) self.Bind(wx.EVT_MENU, lambda e: webbrowser.open('https://github.com/bq/horus/issues'), self.menuIssues) self.Bind(wx.EVT_MENU, lambda e: webbrowser.open('https://groups.google.com/forum/?hl=es#!forum/ciclop-3d-scanner'), self.menuForum) self.Bind(wx.EVT_COMBOBOX, self.onComboBoxWorkbenchSelected, self.controlWorkbench.combo) self.Bind(wx.EVT_COMBOBOX, self.onComboBoxWorkbenchSelected, self.calibrationWorkbench.combo) self.Bind(wx.EVT_COMBOBOX, self.onComboBoxWorkbenchSelected, self.scanningWorkbench.combo) self.Bind(wx.EVT_CLOSE, self.onClose) self.updateProfileToAllControls() x, y, w, h = wx.Display(0).GetGeometry() ws, hs = self.size self.SetPosition((x+(w-ws)/2., y+(h-hs)/2.))
def __init__(self): super(MainWindow, self).__init__(None, title=_("Horus " + VERSION + " - Beta"), size=self.size) self.SetMinSize((600, 450)) ###-- Initialize Engine self.driver = Driver.Instance() self.simpleScan = scan.SimpleScan.Instance() self.textureScan = scan.TextureScan.Instance() self.pcg = scan.PointCloudGenerator.Instance() self.cameraIntrinsics = calibration.CameraIntrinsics.Instance() self.simpleLaserTriangulation = calibration.SimpleLaserTriangulation.Instance() self.laserTriangulation = calibration.LaserTriangulation.Instance() self.platformExtrinsics = calibration.PlatformExtrinsics.Instance() #-- Serial Name initialization serialList = self.serialList() currentSerial = profile.getProfileSetting('serial_name') if len(serialList) > 0: if currentSerial not in serialList: profile.putProfileSetting('serial_name', serialList[0]) #-- Video Id initialization videoList = self.videoList() currentVideoId = profile.getProfileSetting('camera_id') if len(videoList) > 0: if currentVideoId not in videoList: profile.putProfileSetting('camera_id', videoList[0]) self.lastFiles = eval(profile.getPreference('last_files')) print ">>> Horus " + VERSION + " <<<" ###-- Initialize GUI ##-- Set Icon icon = wx.Icon(resources.getPathForImage("horus.ico"), wx.BITMAP_TYPE_ICO) self.SetIcon(icon) ##-- Status Bar #self.CreateStatusBar() ##-- Menu Bar self.menuBar = wx.MenuBar() #-- Menu File self.menuFile = wx.Menu() self.menuLaunchWizard = self.menuFile.Append(wx.NewId(), _("Launch Wizard")) self.menuFile.AppendSeparator() self.menuLoadModel = self.menuFile.Append(wx.NewId(), _("Load Model")) self.menuSaveModel = self.menuFile.Append(wx.NewId(), _("Save Model")) self.menuClearModel = self.menuFile.Append(wx.NewId(), _("Clear Model")) self.menuFile.AppendSeparator() self.menuOpenProfile = self.menuFile.Append(wx.NewId(), _("Open Profile"), _("Opens Profile .ini")) self.menuSaveProfile = self.menuFile.Append(wx.NewId(), _("Save Profile")) self.menuResetProfile = self.menuFile.Append(wx.NewId(), _("Reset Profile")) self.menuFile.AppendSeparator() self.menuExit = self.menuFile.Append(wx.ID_EXIT, _("Exit")) self.menuBar.Append(self.menuFile, _("File")) #-- Menu Edit self.menuEdit = wx.Menu() # self.menuBasicMode = self.menuEdit.AppendRadioItem(wx.NewId(), _("Basic Mode")) # self.menuAdvancedMode = self.menuEdit.AppendRadioItem(wx.NewId(), _("Advanced Mode")) # self.menuEdit.AppendSeparator() self.menuPreferences = self.menuEdit.Append(wx.NewId(), _("Preferences")) self.menuBar.Append(self.menuEdit, _("Edit")) #-- Menu View self.menuView = wx.Menu() self.menuControl = wx.Menu() self.menuControlPanel = self.menuControl.AppendCheckItem(wx.NewId(), _("Panel")) self.menuControlVideo = self.menuControl.AppendCheckItem(wx.NewId(), _("Video")) self.menuView.AppendMenu(wx.NewId(), _("Control"), self.menuControl) self.menuCalibration = wx.Menu() self.menuCalibrationPanel = self.menuCalibration.AppendCheckItem(wx.NewId(), _("Panel")) self.menuCalibrationVideo = self.menuCalibration.AppendCheckItem(wx.NewId(), _("Video")) self.menuView.AppendMenu(wx.NewId(), _("Calibration"), self.menuCalibration) self.menuScanning = wx.Menu() self.menuScanningPanel = self.menuScanning.AppendCheckItem(wx.NewId(), _("Panel")) self.menuScanningVideo = self.menuScanning.AppendCheckItem(wx.NewId(), _("Video")) self.menuScanningScene = self.menuScanning.AppendCheckItem(wx.NewId(), _("Scene")) self.menuView.AppendMenu(wx.NewId(), _("Scanning"), self.menuScanning) self.menuBar.Append(self.menuView, _("View")) #-- Menu Help self.menuHelp = wx.Menu() self.menuWelcome = self.menuHelp.Append(wx.ID_ANY, _("Welcome")) self.menuWiki = self.menuHelp.Append(wx.ID_ANY, _("Wiki")) self.menuSources = self.menuHelp.Append(wx.ID_ANY, _("Sources")) self.menuIssues = self.menuHelp.Append(wx.ID_ANY, _("Issues")) self.menuForum = self.menuHelp.Append(wx.ID_ANY, _("Forum")) self.menuAbout = self.menuHelp.Append(wx.ID_ABOUT, _("About")) self.menuBar.Append(self.menuHelp, _("Help")) self.SetMenuBar(self.menuBar) ##-- Create Workbenchs self.controlWorkbench = ControlWorkbench(self) self.scanningWorkbench = ScanningWorkbench(self) self.calibrationWorkbench = CalibrationWorkbench(self) _choices = [] choices = profile.getProfileSettingObject('workbench').getType() for i in choices: _choices.append(_(i)) self.workbenchDict = dict(zip(_choices, choices)) for workbench in [self.controlWorkbench, self.calibrationWorkbench, self.scanningWorkbench]: workbench.combo.Clear() for i in choices: workbench.combo.Append(_(i)) sizer = wx.BoxSizer(wx.VERTICAL) sizer.Add(self.controlWorkbench, 1, wx.ALL|wx.EXPAND) sizer.Add(self.calibrationWorkbench, 1, wx.ALL|wx.EXPAND) sizer.Add(self.scanningWorkbench, 1, wx.ALL|wx.EXPAND) self.SetSizer(sizer) ##-- Events self.Bind(wx.EVT_MENU, self.onLaunchWizard, self.menuLaunchWizard) self.Bind(wx.EVT_MENU, self.onLoadModel, self.menuLoadModel) self.Bind(wx.EVT_MENU, self.onSaveModel, self.menuSaveModel) self.Bind(wx.EVT_MENU, self.onClearModel, self.menuClearModel) self.Bind(wx.EVT_MENU, self.onOpenProfile, self.menuOpenProfile) self.Bind(wx.EVT_MENU, self.onSaveProfile, self.menuSaveProfile) self.Bind(wx.EVT_MENU, self.onResetProfile, self.menuResetProfile) self.Bind(wx.EVT_MENU, self.onExit, self.menuExit) # self.Bind(wx.EVT_MENU, self.onModeChanged, self.menuBasicMode) # self.Bind(wx.EVT_MENU, self.onModeChanged, self.menuAdvancedMode) self.Bind(wx.EVT_MENU, self.onPreferences, self.menuPreferences) self.Bind(wx.EVT_MENU, self.onControlPanelClicked, self.menuControlPanel) self.Bind(wx.EVT_MENU, self.onControlVideoClicked, self.menuControlVideo) self.Bind(wx.EVT_MENU, self.onCalibrationPanelClicked, self.menuCalibrationPanel) self.Bind(wx.EVT_MENU, self.onCalibrationVideoClicked, self.menuCalibrationVideo) self.Bind(wx.EVT_MENU, self.onScanningPanelClicked, self.menuScanningPanel) self.Bind(wx.EVT_MENU, self.onScanningVideoSceneClicked, self.menuScanningVideo) self.Bind(wx.EVT_MENU, self.onScanningVideoSceneClicked, self.menuScanningScene) self.Bind(wx.EVT_MENU, self.onAbout, self.menuAbout) self.Bind(wx.EVT_MENU, self.onWelcome, self.menuWelcome) self.Bind(wx.EVT_MENU, lambda e: webbrowser.open('https://github.com/bq/horus/wiki'), self.menuWiki) self.Bind(wx.EVT_MENU, lambda e: webbrowser.open('https://github.com/bq/horus'), self.menuSources) self.Bind(wx.EVT_MENU, lambda e: webbrowser.open('https://github.com/bq/horus/issues'), self.menuIssues) self.Bind(wx.EVT_MENU, lambda e: webbrowser.open('https://groups.google.com/forum/?hl=es#!forum/ciclop-3d-scanner'), self.menuForum) self.Bind(wx.EVT_COMBOBOX, self.onComboBoxWorkbenchSelected, self.controlWorkbench.combo) self.Bind(wx.EVT_COMBOBOX, self.onComboBoxWorkbenchSelected, self.calibrationWorkbench.combo) self.Bind(wx.EVT_COMBOBOX, self.onComboBoxWorkbenchSelected, self.scanningWorkbench.combo) self.Bind(wx.EVT_CLOSE, self.onClose) self.updateProfileToAllControls() x, y, w, h = wx.Display(0).GetGeometry() ws, hs = self.size self.SetPosition((x+(w-ws)/2., y+(h-hs)/2.)) #self.Center() self.Show()
def __init__(self, parent): super(SettingsWindow, self).__init__(parent, title=_('Settings'), size=(420, -1), style=wx.DEFAULT_FRAME_STYLE ^ wx.RESIZE_BORDER) self.driver = Driver.Instance() self.cameraIntrinsics = calibration.CameraIntrinsics.Instance() self.simpleLaserTriangulation = calibration.SimpleLaserTriangulation.Instance( ) self.laserTriangulation = calibration.LaserTriangulation.Instance() self.platformExtrinsics = calibration.PlatformExtrinsics.Instance() #-- Elements _choices = [] choices = profile.getProfileSettingObject('luminosity').getType() for i in choices: _choices.append(_(i)) self.initLuminosity = profile.getProfileSetting('luminosity') self.luminosityDict = dict(zip(_choices, choices)) self.luminosityText = wx.StaticText(self, label=_('Luminosity')) self.luminosityText.SetToolTip( wx.ToolTip( _('Change the luminosity until colored lines appear over the chess pattern in the video' ))) self.luminosityComboBox = wx.ComboBox(self, wx.ID_ANY, value=_(self.initLuminosity), choices=_choices, style=wx.CB_READONLY) invert = profile.getProfileSettingBool('invert_motor') self.invertMotorCheckBox = wx.CheckBox( self, label=_("Invert the motor direction")) self.invertMotorCheckBox.SetValue(invert) tooltip = _( "Minimum distance between the origin of the pattern (bottom-left corner) and the pattern's base surface" ) self.image = wx.Image( resources.getPathForImage("pattern-distance.jpg"), wx.BITMAP_TYPE_ANY) self.patternDistance = float( profile.getProfileSetting('pattern_distance')) self.patternImage = wx.StaticBitmap(self, wx.ID_ANY, wx.BitmapFromImage(self.image)) self.patternImage.SetToolTip(wx.ToolTip(tooltip)) self.patternLabel = wx.StaticText(self, label=_('Pattern distance (mm)')) self.patternLabel.SetToolTip(wx.ToolTip(tooltip)) self.patternTextbox = wx.TextCtrl( self, value=str(profile.getProfileSettingFloat('pattern_distance'))) self.okButton = wx.Button(self, label=_('OK')) self.cancelButton = wx.Button(self, label=_('Cancel')) #-- Events self.luminosityComboBox.Bind(wx.EVT_COMBOBOX, self.onLuminosityComboBoxChanged) self.invertMotorCheckBox.Bind(wx.EVT_CHECKBOX, self.onInvertMotor) self.patternTextbox.Bind(wx.EVT_TEXT, self.onTextBoxChanged) self.cancelButton.Bind(wx.EVT_BUTTON, self.onClose) self.okButton.Bind(wx.EVT_BUTTON, self.onOk) self.Bind(wx.EVT_CLOSE, self.onClose) #-- Layout vbox = wx.BoxSizer(wx.VERTICAL) hbox = wx.BoxSizer(wx.HORIZONTAL) hbox.Add(self.luminosityText, 0, wx.ALL, 7) hbox.Add(self.luminosityComboBox, 1, wx.ALL, 3) vbox.Add(hbox, 0, wx.ALL ^ wx.BOTTOM | wx.EXPAND, 7) vbox.Add(wx.StaticLine(self), 0, wx.ALL ^ wx.BOTTOM | wx.EXPAND, 10) hbox = wx.BoxSizer(wx.HORIZONTAL) hbox.Add(self.invertMotorCheckBox, 0, wx.ALL, 10) vbox.Add(hbox) vbox.Add(wx.StaticLine(self), 0, wx.ALL ^ wx.BOTTOM ^ wx.TOP | wx.EXPAND, 10) hbox = wx.BoxSizer(wx.HORIZONTAL) hbox.Add(self.patternLabel, 0, wx.ALL, 7) hbox.Add(self.patternTextbox, 1, wx.ALL, 3) vbox.Add(hbox, 0, wx.ALL ^ wx.BOTTOM | wx.EXPAND, 10) vbox.Add(self.patternImage, 0, wx.ALL | wx.CENTER, 10) hbox = wx.BoxSizer(wx.HORIZONTAL) hbox.Add(self.cancelButton, 1, wx.ALL, 3) hbox.Add(self.okButton, 1, wx.ALL, 3) vbox.Add(hbox, 0, wx.ALL | wx.EXPAND, 10) self.SetSizer(vbox) self.Center() self.Fit() self.ShowModal()
def __init__(self, parent): Workbench.__init__(self, parent) self.driver = Driver.Instance() #-- Toolbar Configuration self.connectTool = self.toolbar.AddLabelTool(wx.NewId(), _("Connect"), wx.Bitmap(resources.getPathForImage("connect.png")), shortHelp=_("Connect")) self.disconnectTool = self.toolbar.AddLabelTool(wx.NewId(), _("Disconnect"), wx.Bitmap(resources.getPathForImage("disconnect.png")), shortHelp=_("Disconnect")) self.toolbar.Realize() #-- Disable Toolbar Items self.enableLabelTool(self.connectTool , True) self.enableLabelTool(self.disconnectTool, False) #-- Bind Toolbar Items self.Bind(wx.EVT_TOOL, self.onConnectToolClicked , self.connectTool) self.Bind(wx.EVT_TOOL, self.onDisconnectToolClicked, self.disconnectTool) self.Layout() self.videoView = None self.Bind(wx.EVT_SHOW, self.onShow)
def load(self): #-- Toolbar Configuration self.playTool = self.toolbar.AddLabelTool(wx.NewId(), _("Play"), wx.Bitmap(resources.getPathForImage("play.png")), shortHelp=_("Play")) self.stopTool = self.toolbar.AddLabelTool(wx.NewId(), _("Stop"), wx.Bitmap(resources.getPathForImage("stop.png")), shortHelp=_("Stop")) self.pauseTool = self.toolbar.AddLabelTool(wx.NewId(), _("Pause"), wx.Bitmap(resources.getPathForImage("pause.png")), shortHelp=_("Pause")) self.toolbar.Realize() #-- Disable Toolbar Items self.enableLabelTool(self.playTool , False) self.enableLabelTool(self.stopTool , False) self.enableLabelTool(self.pauseTool , False) #-- Bind Toolbar Items self.Bind(wx.EVT_TOOL, self.onPlayToolClicked , self.playTool) self.Bind(wx.EVT_TOOL, self.onStopToolClicked , self.stopTool) self.Bind(wx.EVT_TOOL, self.onPauseToolClicked , self.pauseTool) self.scrollPanel = wx.lib.scrolledpanel.ScrolledPanel(self._panel, size=(290,-1)) self.scrollPanel.SetupScrolling(scroll_x=False, scrollIntoView=False) self.scrollPanel.SetAutoLayout(1) self.controls = ExpandableControl(self.scrollPanel) self.controls.addPanel('scan_parameters', ScanParameters(self.controls)) self.controls.addPanel('rotative_platform', RotativePlatform(self.controls)) self.controls.addPanel('image_acquisition', ImageAcquisition(self.controls)) self.controls.addPanel('image_segmentation', ImageSegmentation(self.controls)) self.controls.addPanel('point_cloud_generation', PointCloudGeneration(self.controls)) self.splitterWindow = wx.SplitterWindow(self._panel) self.videoView = VideoView(self.splitterWindow, self.getFrame, 10) self.videoView.SetBackgroundColour(wx.BLACK) self.scenePanel = wx.Panel(self.splitterWindow) self.sceneView = SceneView(self.scenePanel) self.gauge = wx.Gauge(self.scenePanel, size=(-1, 30)) self.gauge.Hide() vbox = wx.BoxSizer(wx.VERTICAL) vbox.Add(self.sceneView, 1, wx.ALL|wx.EXPAND, 0) vbox.Add(self.gauge, 0, wx.ALL|wx.EXPAND, 0) self.scenePanel.SetSizer(vbox) self.splitterWindow.SplitVertically(self.videoView, self.scenePanel) self.splitterWindow.SetMinimumPaneSize(200) #-- Layout vsbox = wx.BoxSizer(wx.VERTICAL) vsbox.Add(self.controls, 0, wx.ALL|wx.EXPAND, 0) self.scrollPanel.SetSizer(vsbox) vsbox.Fit(self.scrollPanel) self.addToPanel(self.scrollPanel, 0) self.addToPanel(self.splitterWindow, 1) #- Video View Selector _choices = [] choices = profile.getProfileSettingObject('img_type').getType() for i in choices: _choices.append(_(i)) self.videoViewsDict = dict(zip(_choices, choices)) self.buttonShowVideoViews = wx.BitmapButton(self.videoView, wx.NewId(), wx.Bitmap(resources.getPathForImage("views.png"), wx.BITMAP_TYPE_ANY), (10,10)) self.comboVideoViews = wx.ComboBox(self.videoView, value=_(profile.getProfileSetting('img_type')), choices=_choices, style=wx.CB_READONLY, pos=(60,10)) self.buttonShowVideoViews.Hide() self.comboVideoViews.Hide() self.buttonShowVideoViews.Bind(wx.EVT_BUTTON, self.onShowVideoViews) self.comboVideoViews.Bind(wx.EVT_COMBOBOX, self.onComboBoVideoViewsSelect) self.updateCallbacks() self.Layout()