Changeset View
Changeset View
Standalone View
Standalone View
kstars/ekos/guide/guide.cpp
Context not available. | |||||
192 | // Capture | 192 | // Capture | ||
---|---|---|---|---|---|
193 | connect(captureB, &QPushButton::clicked, this, [this]() | 193 | connect(captureB, &QPushButton::clicked, this, [this]() | ||
194 | { | 194 | { | ||
195 | state = GUIDE_CAPTURE; | 195 | state = Ekos::GuideState::GUIDE_CAPTURE; | ||
196 | emit newStatus(state); | 196 | emit newStatus(state); | ||
197 | 197 | | |||
198 | capture(); | 198 | capture(); | ||
Context not available. | |||||
200 | 200 | | |||
201 | connect(loopB, &QPushButton::clicked, this, [this]() | 201 | connect(loopB, &QPushButton::clicked, this, [this]() | ||
202 | { | 202 | { | ||
203 | state = GUIDE_LOOPING; | 203 | state = Ekos::GuideState::GUIDE_LOOPING; | ||
204 | emit newStatus(state); | 204 | emit newStatus(state); | ||
205 | 205 | | |||
206 | capture(); | 206 | capture(); | ||
Context not available. | |||||
449 | 449 | | |||
450 | internalGuider->setGuideView(guideView); | 450 | internalGuider->setGuideView(guideView); | ||
451 | 451 | | |||
452 | state = GUIDE_IDLE; | 452 | state = Ekos::GuideState::GUIDE_IDLE; | ||
453 | 453 | | |||
454 | // Set current guide type | 454 | // Set current guide type | ||
455 | setGuiderType(-1); | 455 | setGuiderType(-1); | ||
Context not available. | |||||
1148 | 1148 | | |||
1149 | bool Guide::capture() | 1149 | bool Guide::capture() | ||
1150 | { | 1150 | { | ||
1151 | buildOperationStack(GUIDE_CAPTURE); | 1151 | buildOperationStack(Ekos::GuideState::GUIDE_CAPTURE); | ||
1152 | 1152 | | |||
1153 | return executeOperationStack(); | 1153 | return executeOperationStack(); | ||
1154 | } | 1154 | } | ||
Context not available. | |||||
1195 | #if 0 | 1195 | #if 0 | ||
1196 | switch (state) | 1196 | switch (state) | ||
1197 | { | 1197 | { | ||
1198 | case GUIDE_GUIDING: | 1198 | case Ekos::GuideState::GUIDE_GUIDING: | ||
1199 | if (Options::rapidGuideEnabled() == false) | 1199 | if (Options::rapidGuideEnabled() == false) | ||
1200 | connect(currentCCD, SIGNAL(BLOBUpdated(IBLOB *)), this, SLOT(newFITS(IBLOB *)), Qt::UniqueConnection); | 1200 | connect(currentCCD, SIGNAL(BLOBUpdated(IBLOB *)), this, SLOT(newFITS(IBLOB *)), Qt::UniqueConnection); | ||
1201 | targetChip->capture(seqExpose); | 1201 | targetChip->capture(seqExpose); | ||
Context not available. | |||||
1216 | 1216 | | |||
1217 | // Increase exposure for calibration frame if we need auto-select a star | 1217 | // Increase exposure for calibration frame if we need auto-select a star | ||
1218 | // To increase chances we detect one. | 1218 | // To increase chances we detect one. | ||
1219 | if (operationStack.contains(GUIDE_STAR_SELECT) && Options::guideAutoStarEnabled()) | 1219 | if (operationStack.contains(Ekos::GuideState::GUIDE_STAR_SELECT) && Options::guideAutoStarEnabled()) | ||
1220 | finalExposure *= 3; | 1220 | finalExposure *= 3; | ||
1221 | 1221 | | |||
1222 | // Timeout is exposure duration + timeout threshold in seconds | 1222 | // Timeout is exposure duration + timeout threshold in seconds | ||
Context not available. | |||||
1243 | 1243 | | |||
1244 | switch (state) | 1244 | switch (state) | ||
1245 | { | 1245 | { | ||
1246 | case GUIDE_IDLE: | 1246 | case Ekos::GuideState::GUIDE_IDLE: | ||
1247 | case GUIDE_CONNECTED: | 1247 | case Ekos::GuideState::GUIDE_CONNECTED: | ||
1248 | setBLOBEnabled(false); | 1248 | setBLOBEnabled(false); | ||
1249 | break; | 1249 | break; | ||
1250 | case GUIDE_DISCONNECTED: | 1250 | case Ekos::GuideState::GUIDE_DISCONNECTED: | ||
1251 | setBLOBEnabled(true); | 1251 | setBLOBEnabled(true); | ||
1252 | break; | 1252 | break; | ||
1253 | 1253 | | |||
1254 | case GUIDE_CALIBRATING: | 1254 | case Ekos::GuideState::GUIDE_CALIBRATING: | ||
1255 | case GUIDE_DITHERING: | 1255 | case Ekos::GuideState::GUIDE_DITHERING: | ||
1256 | case GUIDE_STAR_SELECT: | 1256 | case Ekos::GuideState::GUIDE_STAR_SELECT: | ||
1257 | case GUIDE_CAPTURE: | 1257 | case Ekos::GuideState::GUIDE_CAPTURE: | ||
1258 | case GUIDE_GUIDING: | 1258 | case Ekos::GuideState::GUIDE_GUIDING: | ||
1259 | case GUIDE_LOOPING: | 1259 | case Ekos::GuideState::GUIDE_LOOPING: | ||
1260 | guider->abort(); | 1260 | guider->abort(); | ||
1261 | default: | 1261 | default: | ||
1262 | break; | 1262 | break; | ||
Context not available. | |||||
1316 | if (captureTimeoutCounter >= 3) | 1316 | if (captureTimeoutCounter >= 3) | ||
1317 | { | 1317 | { | ||
1318 | captureTimeoutCounter = 0; | 1318 | captureTimeoutCounter = 0; | ||
1319 | if (state == GUIDE_GUIDING) | 1319 | if (state == Ekos::GuideState::GUIDE_GUIDING) | ||
1320 | appendLogText(i18n("Exposure timeout. Aborting Autoguide.")); | 1320 | appendLogText(i18n("Exposure timeout. Aborting Autoguide.")); | ||
1321 | else if (state == GUIDE_DITHERING) | 1321 | else if (state == Ekos::GuideState::GUIDE_DITHERING) | ||
1322 | appendLogText(i18n("Exposure timeout. Aborting Dithering.")); | 1322 | appendLogText(i18n("Exposure timeout. Aborting Dithering.")); | ||
1323 | else if (state == GUIDE_CALIBRATING) | 1323 | else if (state == Ekos::GuideState::GUIDE_CALIBRATING) | ||
1324 | appendLogText(i18n("Exposure timeout. Aborting Calibration.")); | 1324 | appendLogText(i18n("Exposure timeout. Aborting Calibration.")); | ||
1325 | 1325 | | |||
1326 | abort(); | 1326 | abort(); | ||
Context not available. | |||||
1388 | 1388 | | |||
1389 | switch (state) | 1389 | switch (state) | ||
1390 | { | 1390 | { | ||
1391 | case GUIDE_IDLE: | 1391 | case Ekos::GuideState::GUIDE_IDLE: | ||
1392 | case GUIDE_ABORTED: | 1392 | case Ekos::GuideState::GUIDE_ABORTED: | ||
1393 | case GUIDE_CONNECTED: | 1393 | case Ekos::GuideState::GUIDE_CONNECTED: | ||
1394 | case GUIDE_DISCONNECTED: | 1394 | case Ekos::GuideState::GUIDE_DISCONNECTED: | ||
1395 | case GUIDE_CALIBRATION_SUCESS: | 1395 | case Ekos::GuideState::GUIDE_CALIBRATION_SUCESS: | ||
1396 | case GUIDE_CALIBRATION_ERROR: | 1396 | case Ekos::GuideState::GUIDE_CALIBRATION_ERROR: | ||
1397 | case GUIDE_DITHERING_ERROR: | 1397 | case Ekos::GuideState::GUIDE_DITHERING_ERROR: | ||
1398 | setBusy(false); | 1398 | setBusy(false); | ||
1399 | break; | 1399 | break; | ||
1400 | 1400 | | |||
1401 | case GUIDE_CAPTURE: | 1401 | case Ekos::GuideState::GUIDE_CAPTURE: | ||
1402 | state = GUIDE_IDLE; | 1402 | state = Ekos::GuideState::GUIDE_IDLE; | ||
1403 | emit newStatus(state); | 1403 | emit newStatus(state); | ||
1404 | setBusy(false); | 1404 | setBusy(false); | ||
1405 | break; | 1405 | break; | ||
1406 | 1406 | | |||
1407 | case GUIDE_LOOPING: | 1407 | case Ekos::GuideState::GUIDE_LOOPING: | ||
1408 | capture(); | 1408 | capture(); | ||
1409 | break; | 1409 | break; | ||
1410 | 1410 | | |||
1411 | case GUIDE_CALIBRATING: | 1411 | case Ekos::GuideState::GUIDE_CALIBRATING: | ||
1412 | guider->calibrate(); | 1412 | guider->calibrate(); | ||
1413 | break; | 1413 | break; | ||
1414 | 1414 | | |||
1415 | case GUIDE_GUIDING: | 1415 | case Ekos::GuideState::GUIDE_GUIDING: | ||
1416 | guider->guide(); | 1416 | guider->guide(); | ||
1417 | break; | 1417 | break; | ||
1418 | 1418 | | |||
1419 | case GUIDE_DITHERING: | 1419 | case Ekos::GuideState::GUIDE_DITHERING: | ||
1420 | guider->dither(Options::ditherPixels()); | 1420 | guider->dither(Options::ditherPixels()); | ||
1421 | break; | 1421 | break; | ||
1422 | 1422 | | |||
1423 | case GUIDE_REACQUIRE: | 1423 | case Ekos::GuideState::GUIDE_REACQUIRE: | ||
1424 | guider->reacquire(); | 1424 | guider->reacquire(); | ||
1425 | break; | 1425 | break; | ||
1426 | 1426 | | |||
1427 | case GUIDE_DITHERING_SETTLE: | 1427 | case Ekos::GuideState::GUIDE_DITHERING_SETTLE: | ||
1428 | if (Options::ditherNoGuiding()) | 1428 | if (Options::ditherNoGuiding()) | ||
1429 | return; | 1429 | return; | ||
1430 | capture(); | 1430 | capture(); | ||
Context not available. | |||||
1470 | if (GuideDriver == nullptr || (ra_dir == NO_DIR && dec_dir == NO_DIR)) | 1470 | if (GuideDriver == nullptr || (ra_dir == NO_DIR && dec_dir == NO_DIR)) | ||
1471 | return false; | 1471 | return false; | ||
1472 | 1472 | | |||
1473 | if (state == GUIDE_CALIBRATING) | 1473 | if (state == Ekos::GuideState::GUIDE_CALIBRATING) | ||
1474 | pulseTimer.start((ra_msecs > dec_msecs ? ra_msecs : dec_msecs) + 100); | 1474 | pulseTimer.start((ra_msecs > dec_msecs ? ra_msecs : dec_msecs) + 100); | ||
1475 | 1475 | | |||
1476 | return GuideDriver->doPulse(ra_dir, ra_msecs, dec_dir, dec_msecs); | 1476 | return GuideDriver->doPulse(ra_dir, ra_msecs, dec_dir, dec_msecs); | ||
Context not available. | |||||
1481 | if (GuideDriver == nullptr || dir == NO_DIR) | 1481 | if (GuideDriver == nullptr || dir == NO_DIR) | ||
1482 | return false; | 1482 | return false; | ||
1483 | 1483 | | |||
1484 | if (state == GUIDE_CALIBRATING) | 1484 | if (state == Ekos::GuideState::GUIDE_CALIBRATING) | ||
1485 | pulseTimer.start(msecs + 100); | 1485 | pulseTimer.start(msecs + 100); | ||
1486 | 1486 | | |||
1487 | return GuideDriver->doPulse(dir, msecs); | 1487 | return GuideDriver->doPulse(dir, msecs); | ||
Context not available. | |||||
1535 | if (guider->dither() == false) | 1535 | if (guider->dither() == false) | ||
1536 | { | 1536 | { | ||
1537 | appendLogText(i18n("Dithering failed. Autoguiding aborted.")); | 1537 | appendLogText(i18n("Dithering failed. Autoguiding aborted.")); | ||
1538 | emit newStatus(GUIDE_DITHERING_ERROR); | 1538 | emit newStatus(Ekos::GuideState::GUIDE_DITHERING_ERROR); | ||
1539 | guider->abort(); | 1539 | guider->abort(); | ||
1540 | //emit ditherFailed(); | 1540 | //emit ditherFailed(); | ||
1541 | } | 1541 | } | ||
Context not available. | |||||
1585 | bool Guide::calibrate() | 1585 | bool Guide::calibrate() | ||
1586 | { | 1586 | { | ||
1587 | // Set status to idle and let the operations change it as they get executed | 1587 | // Set status to idle and let the operations change it as they get executed | ||
1588 | state = GUIDE_IDLE; | 1588 | state = Ekos::GuideState::GUIDE_IDLE; | ||
1589 | emit newStatus(state); | 1589 | emit newStatus(state); | ||
1590 | 1590 | | |||
1591 | ISD::CCDChip *targetChip = currentCCD->getChip(useGuideHead ? ISD::CCDChip::GUIDE_CCD : ISD::CCDChip::PRIMARY_CCD); | 1591 | ISD::CCDChip *targetChip = currentCCD->getChip(useGuideHead ? ISD::CCDChip::GUIDE_CCD : ISD::CCDChip::PRIMARY_CCD); | ||
Context not available. | |||||
1607 | 1607 | | |||
1608 | saveSettings(); | 1608 | saveSettings(); | ||
1609 | 1609 | | |||
1610 | buildOperationStack(GUIDE_CALIBRATING); | 1610 | buildOperationStack(Ekos::GuideState::GUIDE_CALIBRATING); | ||
1611 | 1611 | | |||
1612 | executeOperationStack(); | 1612 | executeOperationStack(); | ||
1613 | 1613 | | |||
Context not available. | |||||
1633 | 1633 | | |||
1634 | bool Guide::dither() | 1634 | bool Guide::dither() | ||
1635 | { | 1635 | { | ||
1636 | if (Options::ditherNoGuiding() && state == GUIDE_IDLE) | 1636 | if (Options::ditherNoGuiding() && state == Ekos::GuideState::GUIDE_IDLE) | ||
1637 | { | 1637 | { | ||
1638 | ditherDirectly(); | 1638 | ditherDirectly(); | ||
1639 | return true; | 1639 | return true; | ||
1640 | } | 1640 | } | ||
1641 | 1641 | | |||
1642 | if (state == GUIDE_DITHERING || state == GUIDE_DITHERING_SETTLE) | 1642 | if (state == Ekos::GuideState::GUIDE_DITHERING || state == Ekos::GuideState::GUIDE_DITHERING_SETTLE) | ||
1643 | return true; | 1643 | return true; | ||
1644 | 1644 | | |||
1645 | //This adds a dither text item to the graph where dithering occurred. | 1645 | //This adds a dither text item to the graph where dithering occurred. | ||
Context not available. | |||||
1656 | 1656 | | |||
1657 | if (guiderType == GUIDE_INTERNAL) | 1657 | if (guiderType == GUIDE_INTERNAL) | ||
1658 | { | 1658 | { | ||
1659 | if (state != GUIDE_GUIDING) | 1659 | if (state != Ekos::GuideState::GUIDE_GUIDING) | ||
1660 | capture(); | 1660 | capture(); | ||
1661 | 1661 | | |||
1662 | setStatus(GUIDE_DITHERING); | 1662 | setStatus(Ekos::GuideState::GUIDE_DITHERING); | ||
1663 | 1663 | | |||
1664 | return true; | 1664 | return true; | ||
1665 | } | 1665 | } | ||
Context not available. | |||||
1669 | 1669 | | |||
1670 | bool Guide::suspend() | 1670 | bool Guide::suspend() | ||
1671 | { | 1671 | { | ||
1672 | if (state == GUIDE_SUSPENDED) | 1672 | if (state == Ekos::GuideState::GUIDE_SUSPENDED) | ||
1673 | return true; | 1673 | return true; | ||
1674 | else if (state >= GUIDE_CAPTURE) | 1674 | else if (state >= Ekos::GuideState::GUIDE_CAPTURE) | ||
1675 | return guider->suspend(); | 1675 | return guider->suspend(); | ||
1676 | else | 1676 | else | ||
1677 | return false; | 1677 | return false; | ||
Context not available. | |||||
1679 | 1679 | | |||
1680 | bool Guide::resume() | 1680 | bool Guide::resume() | ||
1681 | { | 1681 | { | ||
1682 | if (state == GUIDE_GUIDING) | 1682 | if (state == Ekos::GuideState::GUIDE_GUIDING) | ||
1683 | return true; | 1683 | return true; | ||
1684 | else if (state == GUIDE_SUSPENDED) | 1684 | else if (state == Ekos::GuideState::GUIDE_SUSPENDED) | ||
1685 | return guider->resume(); | 1685 | return guider->resume(); | ||
1686 | else | 1686 | else | ||
1687 | return false; | 1687 | return false; | ||
Context not available. | |||||
1691 | { | 1691 | { | ||
1692 | switch (newState) | 1692 | switch (newState) | ||
1693 | { | 1693 | { | ||
1694 | case CAPTURE_DITHERING: | 1694 | case Ekos::CaptureState::CAPTURE_DITHERING: | ||
1695 | dither(); | 1695 | dither(); | ||
1696 | break; | 1696 | break; | ||
1697 | 1697 | | |||
Context not available. | |||||
1703 | void Guide::setMountStatus(ISD::Telescope::TelescopeStatus newState) | 1703 | void Guide::setMountStatus(ISD::Telescope::TelescopeStatus newState) | ||
1704 | { | 1704 | { | ||
1705 | // If we're guiding, and the mount either slews or parks, then we abort. | 1705 | // If we're guiding, and the mount either slews or parks, then we abort. | ||
1706 | if ((state == GUIDE_GUIDING || state == GUIDE_DITHERING) && (newState == ISD::Telescope::MOUNT_PARKING || newState == ISD::Telescope::MOUNT_SLEWING)) | 1706 | if ((state == Ekos::GuideState::GUIDE_GUIDING || state == Ekos::GuideState::GUIDE_DITHERING) && | ||
1707 | (newState == ISD::Telescope::MOUNT_PARKING || newState == ISD::Telescope::MOUNT_SLEWING)) | ||||
1707 | { | 1708 | { | ||
1708 | if (newState == ISD::Telescope::MOUNT_PARKING) | 1709 | if (newState == ISD::Telescope::MOUNT_PARKING) | ||
1709 | appendLogText(i18n("Mount is parking! Aborting guide...")); | 1710 | appendLogText(i18n("Mount is parking! Aborting guide...")); | ||
Context not available. | |||||
1857 | 1858 | | |||
1858 | switch (state) | 1859 | switch (state) | ||
1859 | { | 1860 | { | ||
1860 | case GUIDE_CONNECTED: | 1861 | case Ekos::GuideState::GUIDE_CONNECTED: | ||
1861 | appendLogText(i18n("External guider connected.")); | 1862 | appendLogText(i18n("External guider connected.")); | ||
1862 | externalConnectB->setEnabled(false); | 1863 | externalConnectB->setEnabled(false); | ||
1863 | externalDisconnectB->setEnabled(true); | 1864 | externalDisconnectB->setEnabled(true); | ||
Context not available. | |||||
1868 | setBLOBEnabled(false); | 1869 | setBLOBEnabled(false); | ||
1869 | break; | 1870 | break; | ||
1870 | 1871 | | |||
1871 | case GUIDE_DISCONNECTED: | 1872 | case Ekos::GuideState::GUIDE_DISCONNECTED: | ||
1872 | appendLogText(i18n("External guider disconnected.")); | 1873 | appendLogText(i18n("External guider disconnected.")); | ||
1873 | setBusy(false); //This needs to come before caputureB since it will set it to enabled again. | 1874 | setBusy(false); //This needs to come before caputureB since it will set it to enabled again. | ||
1874 | externalConnectB->setEnabled(true); | 1875 | externalConnectB->setEnabled(true); | ||
Context not available. | |||||
1883 | #endif | 1884 | #endif | ||
1884 | break; | 1885 | break; | ||
1885 | 1886 | | |||
1886 | case GUIDE_CALIBRATION_SUCESS: | 1887 | case Ekos::GuideState::GUIDE_CALIBRATION_SUCESS: | ||
1887 | appendLogText(i18n("Calibration completed.")); | 1888 | appendLogText(i18n("Calibration completed.")); | ||
1888 | calibrationComplete = true; | 1889 | calibrationComplete = true; | ||
1889 | /*if (autoCalibrateGuide) | 1890 | /*if (autoCalibrateGuide) | ||
Context not available. | |||||
1897 | guide(); | 1898 | guide(); | ||
1898 | break; | 1899 | break; | ||
1899 | 1900 | | |||
1900 | case GUIDE_CALIBRATION_ERROR: | 1901 | case Ekos::GuideState::GUIDE_CALIBRATION_ERROR: | ||
1901 | case GUIDE_IDLE: | 1902 | case Ekos::GuideState::GUIDE_IDLE: | ||
1902 | setBusy(false); | 1903 | setBusy(false); | ||
1903 | break; | 1904 | break; | ||
1904 | 1905 | | |||
1905 | case GUIDE_CALIBRATING: | 1906 | case Ekos::GuideState::GUIDE_CALIBRATING: | ||
1906 | appendLogText(i18n("Calibration started.")); | 1907 | appendLogText(i18n("Calibration started.")); | ||
1907 | setBusy(true); | 1908 | setBusy(true); | ||
1908 | break; | 1909 | break; | ||
1909 | 1910 | | |||
1910 | case GUIDE_GUIDING: | 1911 | case Ekos::GuideState::GUIDE_GUIDING: | ||
1911 | if (previousState == GUIDE_SUSPENDED || previousState == GUIDE_DITHERING_SUCCESS) | 1912 | if (previousState == Ekos::GuideState::GUIDE_SUSPENDED || | ||
1913 | previousState == Ekos::GuideState::GUIDE_DITHERING_SUCCESS) | ||||
1914 | { | ||||
1912 | appendLogText(i18n("Guiding resumed.")); | 1915 | appendLogText(i18n("Guiding resumed.")); | ||
1916 | } | ||||
1913 | else | 1917 | else | ||
1914 | { | 1918 | { | ||
1915 | appendLogText(i18n("Autoguiding started.")); | 1919 | appendLogText(i18n("Autoguiding started.")); | ||
Context not available. | |||||
1922 | 1926 | | |||
1923 | break; | 1927 | break; | ||
1924 | 1928 | | |||
1925 | case GUIDE_ABORTED: | 1929 | case Ekos::GuideState::GUIDE_ABORTED: | ||
1926 | appendLogText(i18n("Autoguiding aborted.")); | 1930 | appendLogText(i18n("Autoguiding aborted.")); | ||
1927 | setBusy(false); | 1931 | setBusy(false); | ||
1928 | break; | 1932 | break; | ||
1929 | 1933 | | |||
1930 | case GUIDE_SUSPENDED: | 1934 | case Ekos::GuideState::GUIDE_SUSPENDED: | ||
1931 | appendLogText(i18n("Guiding suspended.")); | 1935 | appendLogText(i18n("Guiding suspended.")); | ||
1932 | break; | 1936 | break; | ||
1933 | 1937 | | |||
1934 | case GUIDE_REACQUIRE: | 1938 | case Ekos::GuideState::GUIDE_REACQUIRE: | ||
1935 | capture(); | 1939 | capture(); | ||
1936 | break; | 1940 | break; | ||
1937 | 1941 | | |||
1938 | case GUIDE_DITHERING: | 1942 | case Ekos::GuideState::GUIDE_DITHERING: | ||
1939 | appendLogText(i18n("Dithering in progress.")); | 1943 | appendLogText(i18n("Dithering in progress.")); | ||
1940 | break; | 1944 | break; | ||
1941 | 1945 | | |||
1942 | case GUIDE_DITHERING_SETTLE: | 1946 | case Ekos::GuideState::GUIDE_DITHERING_SETTLE: | ||
1943 | if (Options::ditherSettle() > 0) | 1947 | if (Options::ditherSettle() > 0) | ||
1944 | appendLogText(i18np("Post-dither settling for %1 second...", "Post-dither settling for %1 seconds...", Options::ditherSettle())); | 1948 | appendLogText(i18np("Post-dither settling for %1 second...", "Post-dither settling for %1 seconds...", Options::ditherSettle())); | ||
1945 | capture(); | 1949 | capture(); | ||
1946 | break; | 1950 | break; | ||
1947 | 1951 | | |||
1948 | case GUIDE_DITHERING_ERROR: | 1952 | case Ekos::GuideState::GUIDE_DITHERING_ERROR: | ||
1949 | appendLogText(i18n("Dithering failed!")); | 1953 | appendLogText(i18n("Dithering failed!")); | ||
1950 | // LinGuider guide continue after dithering failure | 1954 | // LinGuider guide continue after dithering failure | ||
1951 | if (guiderType != GUIDE_LINGUIDER) | 1955 | if (guiderType != GUIDE_LINGUIDER) | ||
1952 | { | 1956 | { | ||
1953 | //state = GUIDE_IDLE; | 1957 | //state = Ekos::GuideState::GUIDE_IDLE; | ||
1954 | state = GUIDE_ABORTED; | 1958 | state = Ekos::GuideState::GUIDE_ABORTED; | ||
1955 | setBusy(false); | 1959 | setBusy(false); | ||
1956 | } | 1960 | } | ||
1957 | break; | 1961 | break; | ||
1958 | 1962 | | |||
1959 | case GUIDE_DITHERING_SUCCESS: | 1963 | case Ekos::GuideState::GUIDE_DITHERING_SUCCESS: | ||
1960 | appendLogText(i18n("Dithering completed successfully.")); | 1964 | appendLogText(i18n("Dithering completed successfully.")); | ||
1961 | // Go back to guiding state immediately if using regular guider | 1965 | // Go back to guiding state immediately if using regular guider | ||
1962 | if (Options::ditherNoGuiding() == false) | 1966 | if (Options::ditherNoGuiding() == false) | ||
1963 | { | 1967 | { | ||
1964 | setStatus(GUIDE_GUIDING); | 1968 | setStatus(Ekos::GuideState::GUIDE_GUIDING); | ||
1965 | // Only capture again if we are using internal guider | 1969 | // Only capture again if we are using internal guider | ||
1966 | if (guiderType == GUIDE_INTERNAL) | 1970 | if (guiderType == GUIDE_INTERNAL) | ||
1967 | capture(); | 1971 | capture(); | ||
Context not available. | |||||
2012 | INDI_UNUSED(exposure); | 2016 | INDI_UNUSED(exposure); | ||
2013 | 2017 | | |||
2014 | if (expState == IPS_ALERT && | 2018 | if (expState == IPS_ALERT && | ||
2015 | ((state == GUIDE_GUIDING) || (state == GUIDE_DITHERING) || (state == GUIDE_CALIBRATING))) | 2019 | ((state == Ekos::GuideState::GUIDE_GUIDING) || (state == Ekos::GuideState::GUIDE_DITHERING) || | ||
2020 | (state == Ekos::GuideState::GUIDE_CALIBRATING))) | ||||
2016 | { | 2021 | { | ||
2017 | appendLogText(i18n("Exposure failed. Restarting exposure...")); | 2022 | appendLogText(i18n("Exposure failed. Restarting exposure...")); | ||
2018 | currentCCD->setTransformFormat(ISD::CCD::FORMAT_FITS); | 2023 | currentCCD->setTransformFormat(ISD::CCD::FORMAT_FITS); | ||
Context not available. | |||||
2094 | else if (type == guiderType) | 2099 | else if (type == guiderType) | ||
2095 | return true; | 2100 | return true; | ||
2096 | 2101 | | |||
2097 | if (state == GUIDE_CALIBRATING || state == GUIDE_GUIDING || state == GUIDE_DITHERING) | 2102 | if (state == Ekos::GuideState::GUIDE_CALIBRATING || state == Ekos::GuideState::GUIDE_GUIDING || | ||
2103 | state == Ekos::GuideState::GUIDE_DITHERING) | ||||
2098 | { | 2104 | { | ||
2099 | appendLogText(i18n("Cannot change guider type while active.")); | 2105 | appendLogText(i18n("Cannot change guider type while active.")); | ||
2100 | return false; | 2106 | return false; | ||
Context not available. | |||||
2561 | QVector3D newStarPosition(x, y, -1); | 2567 | QVector3D newStarPosition(x, y, -1); | ||
2562 | setStarPosition(newStarPosition, true); | 2568 | setStarPosition(newStarPosition, true); | ||
2563 | 2569 | | |||
2564 | /*if (state == GUIDE_STAR_SELECT) | 2570 | /*if (state == Ekos::GuideState::GUIDE_STAR_SELECT) | ||
2565 | { | 2571 | { | ||
2566 | guider->setStarPosition(newStarPosition); | 2572 | guider->setStarPosition(newStarPosition); | ||
2567 | guider->calibrate(); | 2573 | guider->calibrate(); | ||
Context not available. | |||||
2749 | 2755 | | |||
2750 | switch (operation) | 2756 | switch (operation) | ||
2751 | { | 2757 | { | ||
2752 | case GUIDE_CAPTURE: | 2758 | case Ekos::GuideState::GUIDE_CAPTURE: | ||
2753 | if (Options::guideDarkFrameEnabled()) | 2759 | if (Options::guideDarkFrameEnabled()) | ||
2754 | operationStack.push(GUIDE_DARK); | 2760 | operationStack.push(Ekos::GuideState::GUIDE_DARK); | ||
2755 | 2761 | | |||
2756 | operationStack.push(GUIDE_CAPTURE); | 2762 | operationStack.push(Ekos::GuideState::GUIDE_CAPTURE); | ||
2757 | operationStack.push(GUIDE_SUBFRAME); | 2763 | operationStack.push(Ekos::GuideState::GUIDE_SUBFRAME); | ||
2758 | break; | 2764 | break; | ||
2759 | 2765 | | |||
2760 | case GUIDE_CALIBRATING: | 2766 | case Ekos::GuideState::GUIDE_CALIBRATING: | ||
2761 | operationStack.push(GUIDE_CALIBRATING); | 2767 | operationStack.push(Ekos::GuideState::GUIDE_CALIBRATING); | ||
2762 | if (guiderType == GUIDE_INTERNAL && (starCenter.isNull() || (Options::guideAutoStarEnabled()))) | 2768 | if (guiderType == GUIDE_INTERNAL && (starCenter.isNull() || (Options::guideAutoStarEnabled()))) | ||
2763 | { | 2769 | { | ||
2764 | if (Options::guideDarkFrameEnabled()) | 2770 | if (Options::guideDarkFrameEnabled()) | ||
2765 | operationStack.push(GUIDE_DARK); | 2771 | operationStack.push(Ekos::GuideState::GUIDE_DARK); | ||
2766 | 2772 | | |||
2767 | // If subframe is enabled and we need to auto select a star, then we need to make the final capture | 2773 | // If subframe is enabled and we need to auto select a star, then we need to make the final capture | ||
2768 | // of the subframed image. This is only done if we aren't already subframed. | 2774 | // of the subframed image. This is only done if we aren't already subframed. | ||
2769 | if (subFramed == false && Options::guideSubframeEnabled() && Options::guideAutoStarEnabled()) | 2775 | if (subFramed == false && Options::guideSubframeEnabled() && Options::guideAutoStarEnabled()) | ||
2770 | operationStack.push(GUIDE_CAPTURE); | 2776 | operationStack.push(Ekos::GuideState::GUIDE_CAPTURE); | ||
2771 | 2777 | | |||
2772 | // Do not subframe and auto-select star on Image Guiding mode | 2778 | // Do not subframe and auto-select star on Image Guiding mode | ||
2773 | if (Options::imageGuidingEnabled() == false) | 2779 | if (Options::imageGuidingEnabled() == false) | ||
2774 | { | 2780 | { | ||
2775 | operationStack.push(GUIDE_SUBFRAME); | 2781 | operationStack.push(Ekos::GuideState::GUIDE_SUBFRAME); | ||
2776 | operationStack.push(GUIDE_STAR_SELECT); | 2782 | operationStack.push(Ekos::GuideState::GUIDE_STAR_SELECT); | ||
2777 | } | 2783 | } | ||
2778 | 2784 | | |||
2779 | operationStack.push(GUIDE_CAPTURE); | 2785 | operationStack.push(Ekos::GuideState::GUIDE_CAPTURE); | ||
2780 | 2786 | | |||
2781 | // If we are being ask to go full frame, let's do that first | 2787 | // If we are being ask to go full frame, let's do that first | ||
2782 | if (subFramed == true && Options::guideSubframeEnabled() == false) | 2788 | if (subFramed == true && Options::guideSubframeEnabled() == false) | ||
2783 | operationStack.push(GUIDE_SUBFRAME); | 2789 | operationStack.push(Ekos::GuideState::GUIDE_SUBFRAME); | ||
2784 | } | 2790 | } | ||
2785 | break; | 2791 | break; | ||
2786 | 2792 | | |||
Context not available. | |||||
2800 | 2806 | | |||
2801 | switch (nextOperation) | 2807 | switch (nextOperation) | ||
2802 | { | 2808 | { | ||
2803 | case GUIDE_SUBFRAME: | 2809 | case Ekos::GuideState::GUIDE_SUBFRAME: | ||
2804 | actionRequired = executeOneOperation(nextOperation); | 2810 | actionRequired = executeOneOperation(nextOperation); | ||
2805 | break; | 2811 | break; | ||
2806 | 2812 | | |||
2807 | case GUIDE_DARK: | 2813 | case Ekos::GuideState::GUIDE_DARK: | ||
2808 | actionRequired = executeOneOperation(nextOperation); | 2814 | actionRequired = executeOneOperation(nextOperation); | ||
2809 | break; | 2815 | break; | ||
2810 | 2816 | | |||
2811 | case GUIDE_CAPTURE: | 2817 | case Ekos::GuideState::GUIDE_CAPTURE: | ||
2812 | actionRequired = captureOneFrame(); | 2818 | actionRequired = captureOneFrame(); | ||
2813 | break; | 2819 | break; | ||
2814 | 2820 | | |||
2815 | case GUIDE_STAR_SELECT: | 2821 | case Ekos::GuideState::GUIDE_STAR_SELECT: | ||
2816 | actionRequired = executeOneOperation(nextOperation); | 2822 | actionRequired = executeOneOperation(nextOperation); | ||
2817 | break; | 2823 | break; | ||
2818 | 2824 | | |||
2819 | case GUIDE_CALIBRATING: | 2825 | case Ekos::GuideState::GUIDE_CALIBRATING: | ||
2820 | if (guiderType == GUIDE_INTERNAL) | 2826 | if (guiderType == GUIDE_INTERNAL) | ||
2821 | { | 2827 | { | ||
2822 | guider->setStarPosition(starCenter); | 2828 | guider->setStarPosition(starCenter); | ||
Context not available. | |||||
2825 | // No need to calibrate | 2831 | // No need to calibrate | ||
2826 | if (Options::imageGuidingEnabled()) | 2832 | if (Options::imageGuidingEnabled()) | ||
2827 | { | 2833 | { | ||
2828 | setStatus(GUIDE_CALIBRATION_SUCESS); | 2834 | setStatus(Ekos::GuideState::GUIDE_CALIBRATION_SUCESS); | ||
2829 | break; | 2835 | break; | ||
2830 | } | 2836 | } | ||
2831 | 2837 | | |||
Context not available. | |||||
2843 | } | 2849 | } | ||
2844 | else | 2850 | else | ||
2845 | { | 2851 | { | ||
2846 | emit newStatus(GUIDE_CALIBRATION_ERROR); | 2852 | emit newStatus(Ekos::GuideState::GUIDE_CALIBRATION_ERROR); | ||
2847 | state = GUIDE_IDLE; | 2853 | state = Ekos::GuideState::GUIDE_IDLE; | ||
2848 | appendLogText(i18n("Calibration failed to start!")); | 2854 | appendLogText(i18n("Calibration failed to start!")); | ||
2849 | setBusy(false); | 2855 | setBusy(false); | ||
2850 | } | 2856 | } | ||
Context not available. | |||||
2873 | 2879 | | |||
2874 | switch (operation) | 2880 | switch (operation) | ||
2875 | { | 2881 | { | ||
2876 | case GUIDE_SUBFRAME: | 2882 | case Ekos::GuideState::GUIDE_SUBFRAME: | ||
2877 | { | 2883 | { | ||
2878 | // Do not subframe if we are capturing calibration frame | 2884 | // Do not subframe if we are capturing calibration frame | ||
2879 | if (subFramed == false && Options::guideSubframeEnabled() == true && targetChip->canSubframe()) | 2885 | if (subFramed == false && Options::guideSubframeEnabled() == true && targetChip->canSubframe()) | ||
Context not available. | |||||
2943 | } | 2949 | } | ||
2944 | break; | 2950 | break; | ||
2945 | 2951 | | |||
2946 | case GUIDE_DARK: | 2952 | case Ekos::GuideState::GUIDE_DARK: | ||
2947 | { | 2953 | { | ||
2948 | // Do we need to take a dark frame? | 2954 | // Do we need to take a dark frame? | ||
2949 | if (Options::guideDarkFrameEnabled()) | 2955 | if (Options::guideDarkFrameEnabled()) | ||
Context not available. | |||||
2975 | } | 2981 | } | ||
2976 | break; | 2982 | break; | ||
2977 | 2983 | | |||
2978 | case GUIDE_STAR_SELECT: | 2984 | case Ekos::GuideState::GUIDE_STAR_SELECT: | ||
2979 | { | 2985 | { | ||
2980 | state = GUIDE_STAR_SELECT; | 2986 | state = Ekos::GuideState::GUIDE_STAR_SELECT; | ||
2981 | emit newStatus(state); | 2987 | emit newStatus(state); | ||
2982 | 2988 | | |||
2983 | if (Options::guideAutoStarEnabled()) | 2989 | if (Options::guideAutoStarEnabled()) | ||
Context not available. | |||||
2991 | { | 2997 | { | ||
2992 | appendLogText(i18n("Failed to select an auto star.")); | 2998 | appendLogText(i18n("Failed to select an auto star.")); | ||
2993 | actionRequired = true; | 2999 | actionRequired = true; | ||
2994 | state = GUIDE_CALIBRATION_ERROR; | 3000 | state = Ekos::GuideState::GUIDE_CALIBRATION_ERROR; | ||
2995 | emit newStatus(state); | 3001 | emit newStatus(state); | ||
2996 | setBusy(false); | 3002 | setBusy(false); | ||
2997 | } | 3003 | } | ||
Context not available. | |||||
3099 | qCInfo(KSTARS_EKOS_GUIDE) << "Non-guiding dither successful."; | 3105 | qCInfo(KSTARS_EKOS_GUIDE) << "Non-guiding dither successful."; | ||
3100 | QTimer::singleShot( (ra_msec > de_msec ? ra_msec : de_msec) + Options::ditherSettle() * 1000 + 100, [this]() | 3106 | QTimer::singleShot( (ra_msec > de_msec ? ra_msec : de_msec) + Options::ditherSettle() * 1000 + 100, [this]() | ||
3101 | { | 3107 | { | ||
3102 | emit newStatus(GUIDE_DITHERING_SUCCESS); | 3108 | emit newStatus(Ekos::GuideState::GUIDE_DITHERING_SUCCESS); | ||
3103 | state = GUIDE_IDLE; | 3109 | state = Ekos::GuideState::GUIDE_IDLE; | ||
3104 | }); | 3110 | }); | ||
3105 | } | 3111 | } | ||
3106 | else | 3112 | else | ||
3107 | { | 3113 | { | ||
3108 | qCWarning(KSTARS_EKOS_GUIDE) << "Non-guiding dither failed."; | 3114 | qCWarning(KSTARS_EKOS_GUIDE) << "Non-guiding dither failed."; | ||
3109 | emit newStatus(GUIDE_DITHERING_ERROR); | 3115 | emit newStatus(Ekos::GuideState::GUIDE_DITHERING_ERROR); | ||
3110 | state = GUIDE_IDLE; | 3116 | state = Ekos::GuideState::GUIDE_IDLE; | ||
3111 | } | 3117 | } | ||
3112 | } | 3118 | } | ||
3113 | 3119 | | |||
Context not available. |