diff --git a/kstars/ekos/capture/sequencejob.cpp b/kstars/ekos/capture/sequencejob.cpp --- a/kstars/ekos/capture/sequencejob.cpp +++ b/kstars/ekos/capture/sequencejob.cpp @@ -33,7 +33,6 @@ prepareActions[ACTION_FILTER] = true; prepareActions[ACTION_TEMPERATURE] = true; - //prepareActions[ACTION_POST_FOCUS] = true; prepareActions[ACTION_ROTATOR] = true; } @@ -76,55 +75,6 @@ activeChip->setBatchMode(!preview); - if (localDirectory.isEmpty() == false) - activeCCD->setFITSDir(localDirectory + directoryPostfix); - - activeCCD->setISOMode(timeStampPrefixEnabled); - - activeCCD->setSeqPrefix(fullPrefix); - - activeCCD->setUploadMode(uploadMode); - - // Set all custom properties - //if (preview == false) - //{ - QMapIterator> i(customProperties); - while (i.hasNext()) - { - i.next(); - INDI::Property *customProp = activeCCD->getProperty(i.key()); - if (customProp) - { - QMap numbers = i.value(); - QMapIterator j(numbers); - INumberVectorProperty *np = customProp->getNumber(); - while (j.hasNext()) - { - j.next(); - INumber *oneNumber = IUFindNumber(np, j.key().toLatin1().data()); - if (oneNumber) - oneNumber->value = j.value(); - } - - activeCCD->getDriverInfo()->getClientManager()->sendNewNumber(np); - } - } - //} - - if (activeChip->isBatchMode() && remoteDirectory.isEmpty() == false) - activeCCD->updateUploadSettings(remoteDirectory + directoryPostfix); - - if (isoIndex != -1) - { - if (isoIndex != activeChip->getISOIndex()) - activeChip->setISOIndex(isoIndex); - } - - if (gain != -1) - { - activeCCD->setGain(gain); - } - // Check if we need to change filter wheel if (frameType == FRAME_LIGHT && targetFilter != -1 && activeFilter != nullptr) { @@ -269,21 +219,59 @@ return true; } -//SequenceJob::CAPTUREResult SequenceJob::capture(bool isDark) SequenceJob::CAPTUREResult SequenceJob::capture(bool noCaptureFilter) { - // If focusing is busy, return error - //if (activeChip->getCaptureMode() == FITS_FOCUS) - // return CAPTURE_FOCUS_ERROR; - activeChip->setBatchMode(!preview); + if (localDirectory.isEmpty() == false) + activeCCD->setFITSDir(localDirectory + directoryPostfix); + + activeCCD->setISOMode(timeStampPrefixEnabled); + + activeCCD->setSeqPrefix(fullPrefix); + + activeCCD->setUploadMode(uploadMode); + + QMapIterator> i(customProperties); + while (i.hasNext()) + { + i.next(); + INDI::Property *customProp = activeCCD->getProperty(i.key()); + if (customProp) + { + QMap numbers = i.value(); + QMapIterator j(numbers); + INumberVectorProperty *np = customProp->getNumber(); + while (j.hasNext()) + { + j.next(); + INumber *oneNumber = IUFindNumber(np, j.key().toLatin1().data()); + if (oneNumber) + oneNumber->value = j.value(); + } + + activeCCD->getDriverInfo()->getClientManager()->sendNewNumber(np); + } + } + + if (activeChip->isBatchMode() && remoteDirectory.isEmpty() == false) + activeCCD->updateUploadSettings(remoteDirectory + directoryPostfix); + + if (isoIndex != -1) + { + if (isoIndex != activeChip->getISOIndex()) + activeChip->setISOIndex(isoIndex); + } + + if (gain != -1) + { + activeCCD->setGain(gain); + } + if (targetFilter != -1 && activeFilter != nullptr) { if (targetFilter != currentFilter) { - //activeFilter->runCommand(INDI_SET_FILTER, &targetFilter); - FilterManager::FilterPolicy policy = FilterManager::ALL_POLICIES; // Don't perform autofocus on preview if (isPreview()) @@ -294,12 +282,6 @@ } } - if (isoIndex != -1) - { - if (isoIndex != activeChip->getISOIndex()) - activeChip->setISOIndex(isoIndex); - } - // Only attempt to set ROI and Binning if CCD transfer format is FITS if (activeCCD->getTransferFormat() == ISD::CCD::FORMAT_FITS) { @@ -394,7 +376,6 @@ if (enforceTemperature == false || fabs(targetTemperature - currentTemperature) <= Options::maxTemperatureDiff()) prepareActions[ACTION_TEMPERATURE] = true; - //if (prepareReady == false && areActionsReady() && (status == JOB_IDLE || status == JOB_ABORTED)) if (prepareReady == false && areActionsReady()) { prepareReady = true; @@ -586,14 +567,11 @@ if (currentFilter == targetFilter) prepareActions[ACTION_FILTER] = true; - //if (prepareReady == false && areActionsReady() && (status == JOB_IDLE || status == JOB_ABORTED)) if (prepareReady == false && areActionsReady()) { prepareReady = true; emit prepareComplete(); } - //else if (prepareActions[ACTION_FILTER] == true && prepareActions[ACTION_POST_FOCUS] == false) - //emit checkFocus(); } void SequenceJob::setCurrentRotation(double value) @@ -603,7 +581,6 @@ if (fabs(currentRotation - targetRotation) * 60 <= Options::astrometryRotatorThreshold()) prepareActions[ACTION_ROTATOR] = true; - //if (prepareReady == false && areActionsReady() && (status == JOB_IDLE || status == JOB_ABORTED)) if (prepareReady == false && areActionsReady()) { prepareReady = true;