Changeset View
Changeset View
Standalone View
Standalone View
kstars/ekos/capture/capture.cpp
Show First 20 Lines • Show All 414 Lines • ▼ Show 20 Line(s) | 401 | { | |||
---|---|---|---|---|---|
415 | 415 | | |||
416 | FilterDevicesCombo->setCurrentIndex(1); | 416 | FilterDevicesCombo->setCurrentIndex(1); | ||
417 | 417 | | |||
418 | emit settingsUpdated(getSettings()); | 418 | emit settingsUpdated(getSettings()); | ||
419 | } | 419 | } | ||
420 | 420 | | |||
421 | void Capture::pause() | 421 | void Capture::pause() | ||
422 | { | 422 | { | ||
423 | if (m_State != CAPTURE_CAPTURING) | ||||
424 | { | ||||
425 | // Ensure that the pause function is only called during frame capturing | ||||
426 | // Handling it this way is by far easier than trying to enable/disable the pause button | ||||
427 | // Fixme: make pausing possible at all stages. This makes it necessary to separate the pausing states from CaptureState. | ||||
428 | appendLogText(i18n("Pausing only possible while frame capture is running.")); | ||||
429 | qCInfo(KSTARS_EKOS_CAPTURE) << "Pause button pressed while not capturing."; | ||||
430 | return; | ||||
431 | } | ||||
423 | pauseFunction = nullptr; | 432 | pauseFunction = nullptr; | ||
424 | m_State = CAPTURE_PAUSE_PLANNED; | 433 | m_State = CAPTURE_PAUSE_PLANNED; | ||
425 | emit newStatus(Ekos::CAPTURE_PAUSE_PLANNED); | 434 | emit newStatus(Ekos::CAPTURE_PAUSE_PLANNED); | ||
426 | appendLogText(i18n("Sequence shall be paused after current exposure is complete.")); | 435 | appendLogText(i18n("Sequence shall be paused after current exposure is complete.")); | ||
427 | pauseB->setEnabled(false); | 436 | pauseB->setEnabled(false); | ||
428 | 437 | | |||
429 | startB->setIcon(QIcon::fromTheme("media-playback-start")); | 438 | startB->setIcon(QIcon::fromTheme("media-playback-start")); | ||
430 | startB->setToolTip(i18n("Resume Sequence")); | 439 | startB->setToolTip(i18n("Resume Sequence")); | ||
▲ Show 20 Lines • Show All 930 Lines • ▼ Show 20 Line(s) | 1359 | { | |||
1361 | } | 1370 | } | ||
1362 | } | 1371 | } | ||
1363 | } | 1372 | } | ||
1364 | } | 1373 | } | ||
1365 | } | 1374 | } | ||
1366 | 1375 | | |||
1367 | bool Capture::startNextExposure() | 1376 | bool Capture::startNextExposure() | ||
1368 | { | 1377 | { | ||
1369 | if (m_State == CAPTURE_PAUSE_PLANNED) | 1378 | // check if pausing has been requested | ||
1379 | if (checkPausing() == true) | ||||
1370 | { | 1380 | { | ||
1371 | pauseFunction = &Capture::startNextExposure; | 1381 | pauseFunction = &Capture::startNextExposure; | ||
1372 | appendLogText(i18n("Sequence paused.")); | | |||
1373 | secondsLabel->setText(i18n("Paused...")); | | |||
1374 | m_State = CAPTURE_PAUSED; | | |||
1375 | setMeridianFlipStage(MF_READY); | | |||
1376 | return false; | 1382 | return false; | ||
1377 | } | 1383 | } | ||
1378 | 1384 | | |||
1379 | if (checkMeridianFlip()) | 1385 | if (checkMeridianFlip()) | ||
1380 | // execute flip before next capture | 1386 | // execute flip before next capture | ||
1381 | return false; | 1387 | return false; | ||
1382 | 1388 | | |||
1383 | if (startFocusIfRequired()) | 1389 | if (startFocusIfRequired()) | ||
▲ Show 20 Lines • Show All 130 Lines • ▼ Show 20 Line(s) | 1511 | { | |||
1514 | if (guideState == GUIDE_SUSPENDED && suspendGuideOnDownload) | 1520 | if (guideState == GUIDE_SUSPENDED && suspendGuideOnDownload) | ||
1515 | emit resumeGuiding(); | 1521 | emit resumeGuiding(); | ||
1516 | 1522 | | |||
1517 | m_State = CAPTURE_IDLE; | 1523 | m_State = CAPTURE_IDLE; | ||
1518 | emit newStatus(Ekos::CAPTURE_IDLE); | 1524 | emit newStatus(Ekos::CAPTURE_IDLE); | ||
1519 | return true; | 1525 | return true; | ||
1520 | } | 1526 | } | ||
1521 | 1527 | | |||
1522 | if (m_State == CAPTURE_PAUSE_PLANNED) | 1528 | // check if pausing has been requested | ||
1529 | if (checkPausing() == true) | ||||
1523 | { | 1530 | { | ||
1524 | pauseFunction = &Capture::setCaptureComplete; | 1531 | pauseFunction = &Capture::setCaptureComplete; | ||
1525 | appendLogText(i18n("Sequence paused.")); | | |||
1526 | secondsLabel->setText(i18n("Paused...")); | | |||
1527 | m_State = CAPTURE_PAUSED; | | |||
1528 | // handle a requested meridian flip | | |||
1529 | if (meridianFlipStage != MF_NONE) | | |||
1530 | setMeridianFlipStage(MF_READY); | | |||
1531 | return false; | 1532 | return false; | ||
1532 | } | 1533 | } | ||
1533 | 1534 | | |||
1534 | if (! activeJob->isPreview()) | 1535 | if (! activeJob->isPreview()) | ||
1535 | { | 1536 | { | ||
1536 | /* Increase the sequence's current capture count */ | 1537 | /* Increase the sequence's current capture count */ | ||
1537 | activeJob->setCompleted(activeJob->getCompleted() + 1); | 1538 | activeJob->setCompleted(activeJob->getCompleted() + 1); | ||
1538 | /* Decrease the counter for in-sequence focusing */ | 1539 | /* Decrease the counter for in-sequence focusing */ | ||
▲ Show 20 Lines • Show All 3053 Lines • ▼ Show 20 Line(s) | 4589 | { | |||
4592 | m_State = CAPTURE_CALIBRATING; | 4593 | m_State = CAPTURE_CALIBRATING; | ||
4593 | emit newStatus(Ekos::CAPTURE_CALIBRATING); | 4594 | emit newStatus(Ekos::CAPTURE_CALIBRATING); | ||
4594 | 4595 | | |||
4595 | setMeridianFlipStage(MF_GUIDING); | 4596 | setMeridianFlipStage(MF_GUIDING); | ||
4596 | emit meridianFlipCompleted(); | 4597 | emit meridianFlipCompleted(); | ||
4597 | } | 4598 | } | ||
4598 | } | 4599 | } | ||
4599 | 4600 | | |||
4601 | bool Capture::checkPausing() | ||||
4602 | { | ||||
4603 | if (m_State == CAPTURE_PAUSE_PLANNED) | ||||
4604 | { | ||||
4605 | appendLogText(i18n("Sequence paused.")); | ||||
4606 | secondsLabel->setText(i18n("Paused...")); | ||||
4607 | m_State = CAPTURE_PAUSED; | ||||
4608 | // handle a requested meridian flip | ||||
4609 | if (meridianFlipStage != MF_NONE) | ||||
4610 | setMeridianFlipStage(MF_READY); | ||||
4611 | // pause | ||||
4612 | return true; | ||||
4613 | } | ||||
4614 | // no pause | ||||
4615 | return false; | ||||
4616 | } | ||||
4617 | | ||||
4600 | 4618 | | |||
4601 | bool Capture::checkMeridianFlip() | 4619 | bool Capture::checkMeridianFlip() | ||
4602 | { | 4620 | { | ||
4603 | if (currentTelescope == nullptr) | 4621 | if (currentTelescope == nullptr) | ||
4604 | return false; | 4622 | return false; | ||
4605 | 4623 | | |||
4606 | // If active job is taking flat field image at a wall source | 4624 | // If active job is taking flat field image at a wall source | ||
4607 | // then do not flip. | 4625 | // then do not flip. | ||
▲ Show 20 Lines • Show All 1966 Lines • Show Last 20 Lines |