Changeset View
Changeset View
Standalone View
Standalone View
kstars/ekos/capture/capture.cpp
Show First 20 Lines • Show All 1311 Lines • ▼ Show 20 Line(s) | 1307 | { | |||
---|---|---|---|---|---|
1312 | setMeridianFlipStage(MF_READY); | 1312 | setMeridianFlipStage(MF_READY); | ||
1313 | return false; | 1313 | return false; | ||
1314 | } | 1314 | } | ||
1315 | 1315 | | |||
1316 | if (checkMeridianFlip()) | 1316 | if (checkMeridianFlip()) | ||
1317 | // execute flip before next capture | 1317 | // execute flip before next capture | ||
1318 | return false; | 1318 | return false; | ||
1319 | 1319 | | |||
1320 | if (startFocusIfRequired()) | ||||
1321 | // re-focus before next capture | ||||
1322 | return false; | ||||
1323 | | ||||
1320 | if (seqDelay > 0) | 1324 | if (seqDelay > 0) | ||
1321 | { | 1325 | { | ||
1322 | secondsLabel->setText(i18n("Waiting...")); | 1326 | secondsLabel->setText(i18n("Waiting...")); | ||
1323 | m_State = CAPTURE_WAITING; | 1327 | m_State = CAPTURE_WAITING; | ||
1324 | emit newStatus(Ekos::CAPTURE_WAITING); | 1328 | emit newStatus(Ekos::CAPTURE_WAITING); | ||
1325 | } | 1329 | } | ||
1326 | 1330 | | |||
1327 | seqTimer->start(seqDelay); | 1331 | seqTimer->start(seqDelay); | ||
▲ Show 20 Lines • Show All 381 Lines • ▼ Show 20 Line(s) | 1712 | if (activeJob->getFrameType() != FRAME_LIGHT) | |||
1709 | return false; | 1713 | return false; | ||
1710 | 1714 | | |||
1711 | // if (autoFocusReady == false) | 1715 | // if (autoFocusReady == false) | ||
1712 | // return false; | 1716 | // return false; | ||
1713 | 1717 | | |||
1714 | // check if time for forced refocus | 1718 | // check if time for forced refocus | ||
1715 | if (refocusEveryNCheck->isChecked()) | 1719 | if (refocusEveryNCheck->isChecked()) | ||
1716 | { | 1720 | { | ||
1717 | qCDebug(KSTARS_EKOS_CAPTURE) << "NFocus Elapsed Time (secs): " << getRefocusEveryNTimerElapsedSec() << " Requested Interval (secs): " << refocusEveryN->value() * 60; | 1721 | qCDebug(KSTARS_EKOS_CAPTURE) << "Focus elapsed time (secs): " << getRefocusEveryNTimerElapsedSec() << ". Requested Interval (secs): " << refocusEveryN->value() * 60; | ||
1718 | isRefocus = getRefocusEveryNTimerElapsedSec() >= refocusEveryN->value() * 60; | 1722 | isRefocus = getRefocusEveryNTimerElapsedSec() >= refocusEveryN->value() * 60; | ||
1719 | } | 1723 | } | ||
1720 | else | 1724 | else | ||
1721 | isRefocus = false; | 1725 | isRefocus = false; | ||
1722 | 1726 | | |||
1723 | if (isRefocus) | 1727 | if (isRefocus) | ||
1724 | { | 1728 | { | ||
1725 | appendLogText(i18n("Scheduled refocus starting after %1 seconds...", getRefocusEveryNTimerElapsedSec())); | 1729 | appendLogText(i18n("Scheduled refocus starting after %1 seconds...", getRefocusEveryNTimerElapsedSec())); | ||
▲ Show 20 Lines • Show All 1221 Lines • ▼ Show 20 Line(s) | 2945 | { | |||
2947 | } | 2951 | } | ||
2948 | 2952 | | |||
2949 | IPState rc = processPreCaptureCalibrationStage(); | 2953 | IPState rc = processPreCaptureCalibrationStage(); | ||
2950 | 2954 | | |||
2951 | if (rc == IPS_ALERT) | 2955 | if (rc == IPS_ALERT) | ||
2952 | return; | 2956 | return; | ||
2953 | else if (rc == IPS_BUSY) | 2957 | else if (rc == IPS_BUSY) | ||
2954 | { | 2958 | { | ||
2955 | if (meridianFlipStage == MF_NONE) | 2959 | // Clear the label if we are neither executing a meridian flip nor re-focusing | ||
2960 | if (meridianFlipStage == MF_NONE && m_State != CAPTURE_FOCUSING) | ||||
2956 | secondsLabel->clear(); | 2961 | secondsLabel->clear(); | ||
2957 | QTimer::singleShot(1000, this, &Ekos::Capture::updatePreCaptureCalibrationStatus); | 2962 | QTimer::singleShot(1000, this, &Ekos::Capture::updatePreCaptureCalibrationStatus); | ||
2958 | return; | 2963 | return; | ||
2959 | } | 2964 | } | ||
2960 | 2965 | | |||
2961 | captureImage(); | 2966 | captureImage(); | ||
2962 | } | 2967 | } | ||
2963 | 2968 | | |||
▲ Show 20 Lines • Show All 194 Lines • ▼ Show 20 Line(s) | 3160 | { | |||
3158 | abort(); | 3163 | abort(); | ||
3159 | } | 3164 | } | ||
3160 | return; | 3165 | return; | ||
3161 | } | 3166 | } | ||
3162 | #endif | 3167 | #endif | ||
3163 | 3168 | | |||
3164 | if ((isRefocus || isInSequenceFocus) && activeJob && activeJob->getStatus() == SequenceJob::JOB_BUSY) | 3169 | if ((isRefocus || isInSequenceFocus) && activeJob && activeJob->getStatus() == SequenceJob::JOB_BUSY) | ||
3165 | { | 3170 | { | ||
3166 | secondsLabel->setText(QString()); | 3171 | // if the focusing has been started during the post-calibration, return to the calibration | ||
3167 | 3172 | if (calibrationStage < CAL_PRECAPTURE_COMPLETE && m_State == CAPTURE_FOCUSING) | |||
3173 | { | ||||
3168 | if (focusState == FOCUS_COMPLETE) | 3174 | if (focusState == FOCUS_COMPLETE) | ||
3169 | { | 3175 | { | ||
3170 | appendLogText(i18n("Focus complete.")); | 3176 | appendLogText(i18n("Focus complete.")); | ||
3177 | secondsLabel->setText(i18n("Focus complete.")); | ||||
3178 | m_State = CAPTURE_PROGRESS; | ||||
3179 | } | ||||
3180 | else if (focusState == FOCUS_FAILED) | ||||
3181 | { | ||||
3182 | appendLogText(i18n("Autofocus failed.")); | ||||
3183 | secondsLabel->setText(i18n("Autofocus failed.")); | ||||
3184 | abort(); | ||||
3185 | } | ||||
3186 | } | ||||
3187 | else if (focusState == FOCUS_COMPLETE) | ||||
3188 | { | ||||
3189 | appendLogText(i18n("Focus complete.")); | ||||
3190 | secondsLabel->setText(i18n("Focus complete.")); | ||||
3171 | startNextExposure(); | 3191 | startNextExposure(); | ||
3172 | } | 3192 | } | ||
3173 | else if (focusState == FOCUS_FAILED) | 3193 | else if (focusState == FOCUS_FAILED) | ||
3174 | { | 3194 | { | ||
3175 | appendLogText(i18n("Autofocus failed. Aborting exposure...")); | 3195 | appendLogText(i18n("Autofocus failed. Aborting exposure...")); | ||
3196 | secondsLabel->setText(i18n("Autofocus failed.")); | ||||
3176 | abort(); | 3197 | abort(); | ||
3177 | } | 3198 | } | ||
3178 | } | 3199 | } | ||
3179 | } | 3200 | } | ||
3180 | 3201 | | |||
3181 | void Capture::updateHFRThreshold() | 3202 | void Capture::updateHFRThreshold() | ||
3182 | { | 3203 | { | ||
3183 | if (fileHFR != 0.0) | 3204 | if (fileHFR != 0.0) | ||
▲ Show 20 Lines • Show All 41 Lines • ▼ Show 20 Line(s) | 3245 | { | |||
3225 | if (meridianFlipStage != status) | 3246 | if (meridianFlipStage != status) | ||
3226 | { | 3247 | { | ||
3227 | switch (status) | 3248 | switch (status) | ||
3228 | { | 3249 | { | ||
3229 | case MF_NONE: | 3250 | case MF_NONE: | ||
3230 | if (m_State == CAPTURE_PAUSED) | 3251 | if (m_State == CAPTURE_PAUSED) | ||
3231 | // paused after meridian flip | 3252 | // paused after meridian flip | ||
3232 | secondsLabel->setText(i18n("Paused...")); | 3253 | secondsLabel->setText(i18n("Paused...")); | ||
3254 | /* disabled since the focusing label will be overwritten | ||||
3233 | else | 3255 | else | ||
3234 | secondsLabel->setText(""); | 3256 | secondsLabel->setText(""); | ||
3257 | */ | ||||
3235 | meridianFlipStage = status; | 3258 | meridianFlipStage = status; | ||
3236 | break; | 3259 | break; | ||
3237 | 3260 | | |||
3238 | case MF_READY: | 3261 | case MF_READY: | ||
3239 | if (meridianFlipStage == MF_REQUESTED) | 3262 | if (meridianFlipStage == MF_REQUESTED) | ||
3240 | { | 3263 | { | ||
3241 | // we keep the stage on requested until the mount starts the meridian flip | 3264 | // we keep the stage on requested until the mount starts the meridian flip | ||
3242 | emit newMeridianFlipStatus(Mount::FLIP_ACCEPTED); | 3265 | emit newMeridianFlipStatus(Mount::FLIP_ACCEPTED); | ||
▲ Show 20 Lines • Show All 1721 Lines • ▼ Show 20 Line(s) | 4934 | { | |||
4964 | } | 4987 | } | ||
4965 | 4988 | | |||
4966 | // step 2: check if meridian flip already is ongoing | 4989 | // step 2: check if meridian flip already is ongoing | ||
4967 | if (meridianFlipStage != MF_NONE) | 4990 | if (meridianFlipStage != MF_NONE) | ||
4968 | return IPS_BUSY; | 4991 | return IPS_BUSY; | ||
4969 | // step 3: check if meridian flip is required | 4992 | // step 3: check if meridian flip is required | ||
4970 | if (checkMeridianFlip()) | 4993 | if (checkMeridianFlip()) | ||
4971 | return IPS_BUSY; | 4994 | return IPS_BUSY; | ||
4995 | // step 4: check if re-focusing is required | ||||
4996 | if (m_State == CAPTURE_FOCUSING || startFocusIfRequired()) | ||||
4997 | { | ||||
4998 | m_State = CAPTURE_FOCUSING; | ||||
4999 | return IPS_BUSY; | ||||
5000 | } | ||||
4972 | 5001 | | |||
4973 | calibrationStage = CAL_PRECAPTURE_COMPLETE; | 5002 | calibrationStage = CAL_PRECAPTURE_COMPLETE; | ||
4974 | 5003 | | |||
4975 | if (guideState == GUIDE_SUSPENDED) | 5004 | if (guideState == GUIDE_SUSPENDED) | ||
4976 | { | 5005 | { | ||
4977 | appendLogText(i18n("Autoguiding resumed.")); | 5006 | appendLogText(i18n("Autoguiding resumed.")); | ||
4978 | emit resumeGuiding(); | 5007 | emit resumeGuiding(); | ||
4979 | } | 5008 | } | ||
▲ Show 20 Lines • Show All 1165 Lines • Show Last 20 Lines |