def onSaveProfile(self, event): """ """ dlg=wx.FileDialog(self, _("Select profile file to save"), os.path.split(profile.getPreference('last_profile'))[0], style=wx.FD_SAVE) dlg.SetWildcard("ini files (*.ini)|*.ini") if dlg.ShowModal() == wx.ID_OK: profileFile = dlg.GetPath() if not profileFile.endswith('.ini'): if platform.system() == 'Linux': #hack for linux, as for some reason the .ini is not appended. profileFile += '.ini' profile.saveProfile(profileFile) dlg.Destroy()
def onScanningPageNextClicked(self): self.driver.board.setLeftLaserOff() self.driver.board.setRightLaserOff() profile.saveProfile(os.path.join(profile.getBasePath(), 'current-profile.ini')) dlg = wx.MessageDialog(self, _("You have finished the wizard.\nPress Play button to start scanning."), _("Ready to scan!"), wx.OK | wx.ICON_INFORMATION) result = dlg.ShowModal() == wx.ID_OK dlg.Destroy() if result: self.connectionPage.videoView.stop() self.calibrationPage.videoView.stop() self.scanningPage.videoView.stop() profile.putPreference('workbench', 'Scanning workbench') self.parent.updatePCGProfile() self.parent.updateCalibrationProfile() self.parent.workbenchUpdate() self.Destroy()
def onScanningPageNextClicked(self): self.driver.board.setLeftLaserOff() self.driver.board.setRightLaserOff() profile.saveProfile( os.path.join(profile.getBasePath(), 'current-profile.ini')) dlg = wx.MessageDialog( self, _("You have finished the wizard.\nPress Play button to start scanning." ), _("Ready to scan!"), wx.OK | wx.ICON_INFORMATION) result = dlg.ShowModal() == wx.ID_OK dlg.Destroy() if result: self.connectionPage.videoView.stop() self.calibrationPage.videoView.stop() self.scanningPage.videoView.stop() profile.putPreference('workbench', 'Scanning workbench') self.parent.updatePCGProfile() self.parent.updateCalibrationProfile() self.parent.workbenchUpdate() self.Destroy()
def __del__(self): #-- Save Profile and Preferences profile.savePreferences(os.path.join(self.basePath, 'preferences.ini')) profile.saveProfile(os.path.join(self.basePath, 'current-profile.ini'))
def onComboBoxWorkbenchSelected(self, event): """ """ if _(profile.getPreference('workbench')) != event.GetEventObject().GetValue(): profile.putPreference('workbench', self.workbenchDict[event.GetEventObject().GetValue()]) profile.saveProfile(os.path.join(profile.getBasePath(), 'current-profile.ini')) self.workbenchUpdate()