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 __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.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.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.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.))