def selectConfFile(self): self.confFile, _ = QtGui.QFileDialog.getOpenFileName( self, "Select Conf File", filter='Conf files (*.conf)') if self.confFile: config = Voxel.ConfigurationFile() ret = config.read(str(self.confFile)) if ret: self.calibrationWizard.previousConfiguration = config self.complete = True self.completeChanged.emit()
def setPreviousConfiguration(self, id): c = self.depthCamera.configFile.getCameraProfile(id) if not c: QtGui.QMessageBox.critical( self, 'Calibration Wizard', 'Could not get configuration for camera profile "' + self.depthCamera.getCurrentCameraProfileID() + '"') return self.previousConfiguration = Voxel.ConfigurationFile(c) self.previousProfileID = self.depthCamera.getCurrentCameraProfileID()
def validatePage(self): createNew = False if self.calibrationWizard.depthCamera: if self.profiles.currentIndex() == 0: createNew = True profileName = str(self.calibrationWizard.profileName) if createNew: print profileName id = self.depthCamera.addCameraProfile( profileName, self.depthCamera.getCurrentCameraProfileID()) if id < 0: QtGui.QMessageBox.critical( 'Failed to create a new profile "' + profileName + '". See logs for more details.') return False self.calibrationWizard.currentProfileID = id self.calibrationWizard.currentConfiguration = self.depthCamera.configFile.getCameraProfile( id) self.calibrationWizard.currentProfileName = profileName else: self.calibrationWizard.currentConfiguration = self.calibrationWizard.previousConfiguration self.calibrationWizard.currentProfileName = self.profileNames[ self.profiles.currentIndex() - 1] self.calibrationWizard.currentProfileID = self.depthCamera.getCurrentCameraProfileID( ) return True else: if self.profileSelectButtons.checkedId() == 1: self.calibrationWizard.currentConfiguration = self.calibrationWizard.previousConfiguration self.calibrationWizard.profileName = self.calibrationWizard.currentConfiguration.getProfileName( ) else: self.calibrationWizard.currentConfiguration = Voxel.ConfigurationFile( ) self.calibrationWizard.currentConfiguration.setParentID( self.calibrationWizard.previousConfiguration.getID()) self.calibrationWizard.profileName = str( self.calibrationWizard.profileName) self.calibrationWizard.currentConfiguration.setProfileName( (self.calibrationWizard.profileName)) self.calibrationWizard.currentConfiguration.setID( 150) #change this id in the actual conf file return True