def _onAccepted(self): """ Ok button has been clicked. Save back values to model. """ Logger().trace("ConfigController._onAccepted()") # Shooting tab self._model.headOrientation = config.HEAD_ORIENTATION_INDEX[self._view.headOrientationComboBox.currentIndex()] self._model.head.pitchArmSide = config.PITCH_ARM_SIDE_INDEX[self._view.pitchArmSideComboBox.currentIndex()] self._model.cameraOrientation = config.CAMERA_ORIENTATION_INDEX[self._view.cameraOrientationComboBox.currentIndex()] if self._model.cameraOrientation == 'custom': self._model.cameraRoll = self._view.cameraRollDoubleSpinBox.value() self._model.stabilizationDelay = self._view.stabilizationDelayDoubleSpinBox.value() # Mosaic tab self._model.mosaic.overlap = self._view.overlapSpinBox.value() / 100. self._model.mosaic.startFrom = config.MOSAIC_START_FROM_INDEX[self._view.startFromComboBox.currentIndex()] self._model.mosaic.initialDirection = config.MOSAIC_INITIAL_DIR_INDEX[self._view.initialDirectionComboBox.currentIndex()] self._model.mosaic.cr = self._view.crCheckBox.isChecked() # Camera/lens tab self._model.camera.sensorCoef = self._view.sensorCoefDoubleSpinBox.value() self._model.camera.sensorRatio = config.SENSOR_RATIO_INDEX[self._view.sensorRatioComboBox.currentIndex()] self._model.camera.sensorResolution = self._view.sensorResolutionDoubleSpinBox.value() self._model.camera.lens.type_ = config.LENS_TYPE_INDEX[self._view.lensTypeComboBox.currentIndex()] self._model.camera.lens.focal = self._view.focalDoubleSpinBox.value() self._model.camera.lens.opticalMultiplier = self._view.opticalMultiplierDoubleSpinBox.value() # Data tab ConfigManager().set('Configuration/DATA_STORAGE_DIR', unicode(self._view.dataStorageDirLineEdit.text())) ConfigManager().set('Configuration/DATA_FILE_FORMAT', unicode(self._view.dataFileFormatLineEdit.text())) ConfigManager().setBoolean('Configuration/DATA_FILE_ENABLE', bool(self._view.dataFileEnableCheckBox.isChecked())) ConfigManager().set('Configuration/DATA_TITLE', unicode(self._view.dataTitleLineEdit.text())) ConfigManager().set('Configuration/DATA_GPS', unicode(self._view.dataGpsLineEdit.text())) ConfigManager().set('Configuration/DATA_COMMENT', unicode(self._view.dataCommentLineEdit.text())) # Timer tab time_ = self._view.timerAfterTimeEdit.time() self._model.timerAfter = hmsAsStrToS(time_.toString("hh:mm:ss")) self._model.timerAfterEnable = self._view.timerAfterEnableCheckBox.isChecked() self._model.timerRepeat = self._view.timerRepeatSpinBox.value() self._model.timerRepeatEnable = self._view.timerRepeatEnableCheckBox.isChecked() time_ = self._view.timerEveryTimeEdit.time() self._model.timerEvery = hmsAsStrToS(time_.toString("hh:mm:ss")) #self._model.timerReverseDirection = self._view.timerReverseDirectionCheckBox.isChecked() # Misc tab ConfigManager().set('Configuration/LOGGER_LEVEL', config.LOGGER_INDEX[self._view.loggerLevelComboBox.currentIndex()]) self._model.shootingCounter = self._view.shootingCounterSpinBox.value() self._model.showShootingCounter = bool(self._view.showShootingCounterCheckBox.isChecked()) self._model.pauseEvery = self._view.pauseEverySpinBox.value() self._model.pauseEveryEnable = bool(self._view.pauseEveryEnableCheckBox.isChecked()) ConfigManager().save()
def __getTimerEvery(self): """ """ return hmsAsStrToS(ConfigManager().get('Configuration/TIMER_EVERY'))
def __getTimerAfter(self): """ """ return hmsAsStrToS(ConfigManager().get('Configuration/TIMER_AFTER'))