Changeset View
Standalone View
kstars/ekos/guide/guide.cpp
Show First 20 Lines • Show All 109 Lines • ▼ Show 20 Line(s) | 41 | { | |||
---|---|---|---|---|---|
110 | opsCalibration = new OpsCalibration(internalGuider); | 110 | opsCalibration = new OpsCalibration(internalGuider); | ||
111 | KPageWidgetItem *page = dialog->addPage(opsCalibration, i18n("Calibration")); | 111 | KPageWidgetItem *page = dialog->addPage(opsCalibration, i18n("Calibration")); | ||
112 | page->setIcon(QIcon::fromTheme("tool-measure")); | 112 | page->setIcon(QIcon::fromTheme("tool-measure")); | ||
113 | opsGuide = new OpsGuide(); | 113 | opsGuide = new OpsGuide(); | ||
114 | 114 | | |||
115 | connect(opsGuide, &OpsGuide::settingsUpdated, [this]() | 115 | connect(opsGuide, &OpsGuide::settingsUpdated, [this]() | ||
116 | { | 116 | { | ||
117 | onThresholdChanged(Options::guideAlgorithm()); | 117 | onThresholdChanged(Options::guideAlgorithm()); | ||
118 | configurePHD2Camera(); | ||||
118 | }); | 119 | }); | ||
119 | 120 | | |||
120 | page = dialog->addPage(opsGuide, i18n("Guide")); | 121 | page = dialog->addPage(opsGuide, i18n("Guide")); | ||
121 | page->setIcon(QIcon::fromTheme("kstars_guides")); | 122 | page->setIcon(QIcon::fromTheme("kstars_guides")); | ||
122 | 123 | | |||
123 | internalGuider->setGuideView(guideView); | 124 | internalGuider->setGuideView(guideView); | ||
124 | 125 | | |||
125 | // Set current guide type | 126 | // Set current guide type | ||
126 | setGuiderType(-1); | 127 | setGuiderType(-1); | ||
127 | 128 | | |||
129 | //This allows the current guideSubframe option to be loaded. | ||||
130 | if(guiderType == GUIDE_PHD2) | ||||
131 | setExternalGuiderBLOBEnabled(!Options::guideSubframeEnabled()); | ||||
132 | | ||||
128 | //Note: This is to prevent a button from being called the default button | 133 | //Note: This is to prevent a button from being called the default button | ||
129 | //and then executing when the user hits the enter key such as when on a Text Box | 134 | //and then executing when the user hits the enter key such as when on a Text Box | ||
130 | QList<QPushButton *> qButtons = findChildren<QPushButton *>(); | 135 | QList<QPushButton *> qButtons = findChildren<QPushButton *>(); | ||
131 | for (auto &button : qButtons) | 136 | for (auto &button : qButtons) | ||
132 | button->setAutoDefault(false); | 137 | button->setAutoDefault(false); | ||
133 | } | 138 | } | ||
134 | 139 | | |||
135 | Guide::~Guide() | 140 | Guide::~Guide() | ||
▲ Show 20 Lines • Show All 403 Lines • ▼ Show 20 Line(s) | |||||
539 | } | 544 | } | ||
540 | 545 | | |||
541 | void Guide::addCamera(ISD::GDInterface *newCCD) | 546 | void Guide::addCamera(ISD::GDInterface *newCCD) | ||
542 | { | 547 | { | ||
543 | ISD::CCD *ccd = static_cast<ISD::CCD *>(newCCD); | 548 | ISD::CCD *ccd = static_cast<ISD::CCD *>(newCCD); | ||
544 | 549 | | |||
545 | if (CCDs.contains(ccd)) | 550 | if (CCDs.contains(ccd)) | ||
546 | return; | 551 | return; | ||
547 | if (guiderType != GUIDE_INTERNAL) | 552 | if(guiderType != GUIDE_INTERNAL) | ||
TallFurryMan: Switch case might have been appropriate now that all cases are distinct. | |||||
Well my hope is to get rid of the if statement that now only happens for Linguider entirely. But I don't have Linguider to try to make the same changes that I did for PHD2. Nor do I have any experience with it. lancaster: Well my hope is to get rid of the if statement that now only happens for Linguider entirely. | |||||
I went back to the old if structure here because it makes sense to disable PHD2 cameras using the old method until they get recognized by my configure PHD2 camera method and get enabled by the user lancaster: I went back to the old if structure here because it makes sense to disable PHD2 cameras using… | |||||
548 | { | 553 | { | ||
549 | connect(ccd, &ISD::CCD::newBLOBManager, [ccd](INDI::Property * prop) | 554 | connect(ccd, &ISD::CCD::newBLOBManager, [ccd, this](INDI::Property * prop) | ||
550 | { | 555 | { | ||
551 | if (!strcmp(prop->getName(), "CCD1") || !strcmp(prop->getName(), "CCD2")) | 556 | if (!strcmp(prop->getName(), "CCD1") || !strcmp(prop->getName(), "CCD2")) | ||
552 | ccd->setBLOBEnabled(Options::guideRemoteImagesEnabled(), prop->getName()); | 557 | { | ||
558 | ccd->setBLOBEnabled(false); //This will disable PHD2 external guide frames until it is properly connected. | ||||
559 | currentCCD = ccd; | ||||
560 | } | ||||
553 | }); | 561 | }); | ||
554 | guiderCombo->clear(); | 562 | guiderCombo->clear(); | ||
555 | guiderCombo->setEnabled(false); | 563 | guiderCombo->setEnabled(false); | ||
556 | if (guiderType == GUIDE_PHD2) | 564 | if (guiderType == GUIDE_PHD2) | ||
557 | guiderCombo->addItem("PHD2"); | 565 | guiderCombo->addItem("PHD2"); | ||
558 | else | 566 | else | ||
559 | guiderCombo->addItem("LinGuider"); | 567 | guiderCombo->addItem("LinGuider"); | ||
560 | return; | | |||
561 | } | 568 | } | ||
562 | else | 569 | else | ||
570 | { | ||||
563 | guiderCombo->setEnabled(true); | 571 | guiderCombo->setEnabled(true); | ||
572 | guiderCombo->addItem(ccd->getDeviceName()); | ||||
573 | } | ||||
564 | 574 | | |||
565 | CCDs.append(ccd); | 575 | CCDs.append(ccd); | ||
576 | checkCCD(); | ||||
577 | configurePHD2Camera(); | ||||
578 | } | ||||
566 | 579 | | |||
567 | guiderCombo->addItem(ccd->getDeviceName()); | 580 | void Guide::configurePHD2Camera() | ||
581 | { | ||||
582 | //Maybe something like this can be done for Linguider? | ||||
583 | //But for now, Linguider doesn't support INDI Cameras | ||||
584 | if(guiderType != GUIDE_PHD2) | ||||
585 | return; | ||||
586 | //This prevents a crash if phd2guider is null | ||||
587 | if(!phd2Guider) | ||||
588 | return; | ||||
589 | //This way it doesn't check if the equipment isn't connected yet. | ||||
590 | //It will check again when the equipment is connected. | ||||
591 | if(!phd2Guider->isConnected()) | ||||
592 | return; | ||||
593 | //This way it doesn't check if the equipment List has not been received yet. | ||||
594 | //It will ask for the list. When the list is received it will check again. | ||||
595 | if(phd2Guider->getCurrentCamera() == "") | ||||
596 | { | ||||
597 | phd2Guider->requestCurrentEquipmentUpdate(); | ||||
598 | return; | ||||
599 | } | ||||
568 | 600 | | |||
569 | checkCCD(); | 601 | //this checks to see if a CCD in the list matches the name of PHD2's camera | ||
602 | ISD::CCD *ccdMatch = nullptr; | ||||
603 | QString currentPHD2CameraName = "None"; | ||||
604 | foreach(ISD::CCD *ccd, CCDs) | ||||
605 | { | ||||
606 | if(phd2Guider->getCurrentCamera().contains(ccd->getDeviceName())) | ||||
607 | { | ||||
608 | ccdMatch = ccd; | ||||
609 | currentPHD2CameraName = (phd2Guider->getCurrentCamera()); | ||||
610 | break; | ||||
611 | } | ||||
612 | } | ||||
613 | | ||||
614 | //If this method gives the same result as last time, no need to update the Camera info again. | ||||
615 | //That way the user doesn't see a ton of messages printing about the PHD2 external camera. | ||||
616 | //But lets make sure the blob is set correctly every time. | ||||
617 | if(lastPHD2CameraName == currentPHD2CameraName) | ||||
618 | { | ||||
At least when using the INDI Guiding simulator, ccd->getDeviceName() returns "Guide Simulator", and phd2Guider->getCurrentCamera() returns "INDI Camera [Guide Simulator]". As a result, this loop does not find the matching CCD. wreissenberger: At least when using the INDI Guiding simulator, ccd->getDeviceName() returns "Guide Simulator"… | |||||
Odd, for me, both returned "Guide Simulator". Well I could use the contains method to see if the PHD2 String contains the string from the CCD device name. lancaster: Odd, for me, both returned "Guide Simulator". Well I could use the contains method to see if… | |||||
lancaster: Try it again now with the change I just made. | |||||
619 | setExternalGuiderBLOBEnabled(!Options::guideSubframeEnabled()); | ||||
620 | return; | ||||
621 | } | ||||
622 | | ||||
623 | //This means that a Guide Camera was connected before but it changed. | ||||
624 | if(currentCCD) | ||||
625 | setExternalGuiderBLOBEnabled(false); | ||||
626 | | ||||
627 | //Updating the currentCCD | ||||
As a side note, this will be the case in my obs, so that branch will tested in my environment. I think the option "receive external guide frames" is confusing and should be renamed (no action from your part, warning is OK). TallFurryMan: As a side note, this will be the case in my obs, so that branch will tested in my environment. | |||||
So I partially agree. If you have seen my comments before, I have definitely advocated using PHD2-only connected guiders rather than using INDI connected guiders that are also connected to Ekos. In fact this is what I have been doing on my system the last couple of years. I would like to see this option of switching back and forth between receiving the full guide frames and the profile image become an option similar to and as easy to use as the "use subframe" checkboxes in Ekos. This is like my first step on that road. It still requires reconnecting or restarting. I haven't yet figured out how to make it switch perfectly. The issue is that the guide camera getting blobs enabled and disabled doesn't always seem to work except for the first time I call it. So a reconnection or restart is needed? it needs further analysis. But for now, the message just says restart Ekos and that works. lancaster: So I partially agree. If you have seen my comments before, I have definitely advocated using… | |||||
(What I meant was that my obs has two indiservers indeed, one for the guider ccd, one for Ekos. But configuring phd2 to capture from one and send corrections to the other is tricky.) TallFurryMan: (What I meant was that my obs has two indiservers indeed, one for the guider ccd, one for Ekos. | |||||
Do you mean one INDI Server for the Mount and one for the CCD? I'm not sure your configuration would cause any issues. With my new code, the only thing Ekos cares about for this option is what PHD2 is using for the Camera, not for the mount or aux mount. And basically if Ekos has a connection to the same camera, then it should get the name from PHD2, identify that they are the same camera and treat that as the "guide" camera. Then it should receive the full guide frames if the user wants that, or the guide star image instead. If the same camera isn't connected to Ekos, then all you can do is get the guide star image. lancaster: Do you mean one INDI Server for the Mount and one for the CCD?
I'm not sure your configuration… | |||||
628 | currentCCD = ccdMatch; | ||||
629 | | ||||
630 | //This updates the last camera name for the next time it is checked. | ||||
631 | lastPHD2CameraName = currentPHD2CameraName; | ||||
632 | | ||||
633 | //This sets a boolean that allows you to tell if the PHD2 camera is in Ekos | ||||
634 | phd2Guider->setCurrentCameraIsNotInEkos(currentCCD == nullptr); | ||||
635 | | ||||
636 | if(phd2Guider->isCurrentCameraNotInEkos()) | ||||
637 | { | ||||
638 | appendLogText(i18n("PHD2's current camera: %1, is NOT connected to Ekos. The PHD2 Guide Star Image will be received, but the full external guide frames cannot.", phd2Guider->getCurrentCamera())); | ||||
639 | subFrameCheck->setEnabled(false); | ||||
640 | //We don't want to actually change the user's subFrame Setting for when a camera really is connected, just check the box to tell the user. | ||||
641 | disconnect(subFrameCheck, &QCheckBox::toggled, this, &Ekos::Guide::setSubFrameEnabled); | ||||
642 | subFrameCheck->setChecked(true); | ||||
643 | return; | ||||
644 | } | ||||
645 | | ||||
646 | appendLogText(i18n("PHD2's current camera: %1, IS connected to Ekos. You can select whether to use the full external guide frames or just receive the PHD2 Guide Star Image using the SubFrame checkbox.", phd2Guider->getCurrentCamera())); | ||||
647 | subFrameCheck->setEnabled(true); | ||||
648 | connect(subFrameCheck, &QCheckBox::toggled, this, &Ekos::Guide::setSubFrameEnabled); | ||||
649 | subFrameCheck->setChecked(Options::guideSubframeEnabled()); | ||||
570 | } | 650 | } | ||
571 | 651 | | |||
572 | void Guide::addGuideHead(ISD::GDInterface *newCCD) | 652 | void Guide::addGuideHead(ISD::GDInterface *newCCD) | ||
573 | { | 653 | { | ||
574 | if (guiderType != GUIDE_INTERNAL) | 654 | if (guiderType != GUIDE_INTERNAL) | ||
575 | return; | 655 | return; | ||
576 | 656 | | |||
577 | ISD::CCD *ccd = static_cast<ISD::CCD *>(newCCD); | 657 | ISD::CCD *ccd = static_cast<ISD::CCD *>(newCCD); | ||
▲ Show 20 Lines • Show All 214 Lines • ▼ Show 20 Line(s) | 862 | { | |||
792 | { | 872 | { | ||
793 | appendLogText(i18n("Connection to the guide CCD is lost.")); | 873 | appendLogText(i18n("Connection to the guide CCD is lost.")); | ||
794 | return; | 874 | return; | ||
795 | } | 875 | } | ||
796 | 876 | | |||
797 | if (targetChip->getFrameType() != FRAME_LIGHT) | 877 | if (targetChip->getFrameType() != FRAME_LIGHT) | ||
798 | return; | 878 | return; | ||
799 | 879 | | |||
880 | if(guiderType == GUIDE_INTERNAL) | ||||
800 | binningCombo->setEnabled(targetChip->canBin()); | 881 | binningCombo->setEnabled(targetChip->canBin()); | ||
882 | | ||||
801 | int subBinX = 1, subBinY = 1; | 883 | int subBinX = 1, subBinY = 1; | ||
802 | if (targetChip->canBin()) | 884 | if (targetChip->canBin()) | ||
803 | { | 885 | { | ||
804 | int maxBinX, maxBinY; | 886 | int maxBinX, maxBinY; | ||
805 | targetChip->getBinning(&subBinX, &subBinY); | 887 | targetChip->getBinning(&subBinX, &subBinY); | ||
806 | targetChip->getMaxBin(&maxBinX, &maxBinY); | 888 | targetChip->getMaxBin(&maxBinX, &maxBinY); | ||
807 | 889 | | |||
808 | binningCombo->blockSignals(true); | 890 | binningCombo->blockSignals(true); | ||
▲ Show 20 Lines • Show All 237 Lines • ▼ Show 20 Line(s) | 1117 | { | |||
1046 | manualDitherB->setEnabled(false); | 1128 | manualDitherB->setEnabled(false); | ||
1047 | 1129 | | |||
1048 | setBusy(false); | 1130 | setBusy(false); | ||
1049 | 1131 | | |||
1050 | switch (state) | 1132 | switch (state) | ||
1051 | { | 1133 | { | ||
1052 | case GUIDE_IDLE: | 1134 | case GUIDE_IDLE: | ||
1053 | case GUIDE_CONNECTED: | 1135 | case GUIDE_CONNECTED: | ||
1054 | setBLOBEnabled(false); | | |||
1055 | break; | | |||
1056 | case GUIDE_DISCONNECTED: | 1136 | case GUIDE_DISCONNECTED: | ||
1057 | setBLOBEnabled(true); | | |||
1058 | break; | 1137 | break; | ||
1059 | 1138 | | |||
1060 | case GUIDE_CALIBRATING: | 1139 | case GUIDE_CALIBRATING: | ||
1061 | case GUIDE_DITHERING: | 1140 | case GUIDE_DITHERING: | ||
1062 | case GUIDE_STAR_SELECT: | 1141 | case GUIDE_STAR_SELECT: | ||
1063 | case GUIDE_CAPTURE: | 1142 | case GUIDE_CAPTURE: | ||
1064 | case GUIDE_GUIDING: | 1143 | case GUIDE_GUIDING: | ||
1065 | case GUIDE_LOOPING: | 1144 | case GUIDE_LOOPING: | ||
Show All 28 Lines | 1163 | { | |||
1094 | stopB->setEnabled(true); | 1173 | stopB->setEnabled(true); | ||
1095 | 1174 | | |||
1096 | pi->startAnimation(); | 1175 | pi->startAnimation(); | ||
1097 | 1176 | | |||
1098 | //disconnect(guideView, SIGNAL(trackingStarSelected(int,int)), this, &Ekos::Guide::setTrackingStar(int,int))); | 1177 | //disconnect(guideView, SIGNAL(trackingStarSelected(int,int)), this, &Ekos::Guide::setTrackingStar(int,int))); | ||
1099 | } | 1178 | } | ||
1100 | else | 1179 | else | ||
1101 | { | 1180 | { | ||
1102 | if (guiderType == GUIDE_INTERNAL) | 1181 | if(guiderType != GUIDE_LINGUIDER) | ||
1103 | { | 1182 | { | ||
1104 | captureB->setEnabled(true); | 1183 | captureB->setEnabled(true); | ||
1105 | loopB->setEnabled(true); | 1184 | loopB->setEnabled(true); | ||
1106 | darkFrameCheck->setEnabled(true); | | |||
1107 | subFrameCheck->setEnabled(true); | | |||
1108 | autoStarCheck->setEnabled(true); | 1185 | autoStarCheck->setEnabled(true); | ||
1186 | if(currentCCD) | ||||
1187 | subFrameCheck->setEnabled(true); | ||||
1109 | } | 1188 | } | ||
1189 | if (guiderType == GUIDE_INTERNAL) | ||||
1190 | darkFrameCheck->setEnabled(true); | ||||
1110 | 1191 | | |||
1111 | if (calibrationComplete) | 1192 | if (calibrationComplete) | ||
1112 | clearCalibrationB->setEnabled(true); | 1193 | clearCalibrationB->setEnabled(true); | ||
1113 | guideB->setEnabled(true); | 1194 | guideB->setEnabled(true); | ||
1114 | stopB->setEnabled(false); | 1195 | stopB->setEnabled(false); | ||
1115 | pi->stopAnimation(); | 1196 | pi->stopAnimation(); | ||
1116 | 1197 | | |||
1117 | connect(guideView, &FITSView::trackingStarSelected, this, &Ekos::Guide::setTrackingStar, Qt::UniqueConnection); | 1198 | connect(guideView, &FITSView::trackingStarSelected, this, &Ekos::Guide::setTrackingStar, Qt::UniqueConnection); | ||
▲ Show 20 Lines • Show All 325 Lines • ▼ Show 20 Line(s) | 1522 | { | |||
1443 | { | 1524 | { | ||
1444 | calibrate(); | 1525 | calibrate(); | ||
1445 | return; | 1526 | return; | ||
1446 | } | 1527 | } | ||
1447 | } | 1528 | } | ||
1448 | 1529 | | |||
1449 | saveSettings(); | 1530 | saveSettings(); | ||
1450 | guider->guide(); | 1531 | guider->guide(); | ||
1532 | | ||||
1533 | //If PHD2 gets a Guide command and it is looping, it will accept a lock position | ||||
1534 | //but if it was not looping it will ignore the lock position and do an auto star automatically | ||||
1535 | //This is not the default behavior in Ekos if auto star is not selected. | ||||
1536 | //This gets around that by noting the position of the tracking box, and enforcing it after the state switches to guide. | ||||
1537 | if(!Options::guideAutoStarEnabled()) | ||||
1538 | { | ||||
1539 | if(guiderType == GUIDE_PHD2 && guideView->isTrackingBoxEnabled()) | ||||
1540 | { | ||||
1541 | double x = starCenter.x(); | ||||
1542 | double y = starCenter.y(); | ||||
1543 | | ||||
1544 | if(guideView->getImageData() != nullptr) | ||||
1545 | { | ||||
1546 | if(guideView->getImageData()->width() > 50) | ||||
1547 | { | ||||
1548 | guideConnect = connect(this, &Guide::newStatus, this, [this, x, y](Ekos::GuideState newState) | ||||
1549 | { | ||||
1550 | if(newState == GUIDE_GUIDING) | ||||
1551 | { | ||||
1552 | phd2Guider->setLockPosition(x,y); | ||||
1553 | disconnect(guideConnect); | ||||
1554 | } | ||||
1555 | }); | ||||
1556 | } | ||||
1557 | } | ||||
1558 | } | ||||
1559 | } | ||||
1451 | }; | 1560 | }; | ||
1452 | 1561 | | |||
1453 | if (Options::defaultCaptureCCD() == guiderCombo->currentText()) | 1562 | if (Options::defaultCaptureCCD() == guiderCombo->currentText()) | ||
1454 | { | 1563 | { | ||
1455 | connect(KSMessageBox::Instance(), &KSMessageBox::accepted, this, [this, executeGuide]() | 1564 | connect(KSMessageBox::Instance(), &KSMessageBox::accepted, this, [this, executeGuide]() | ||
1456 | { | 1565 | { | ||
1457 | //QObject::disconnect(KSMessageBox::Instance(), &KSMessageBox::accepted, this, nullptr); | 1566 | //QObject::disconnect(KSMessageBox::Instance(), &KSMessageBox::accepted, this, nullptr); | ||
1458 | KSMessageBox::Instance()->disconnect(this); | 1567 | KSMessageBox::Instance()->disconnect(this); | ||
▲ Show 20 Lines • Show All 176 Lines • ▼ Show 20 Line(s) | 1743 | { | |||
1635 | Options::setGuideAlgorithm(index); | 1744 | Options::setGuideAlgorithm(index); | ||
1636 | } | 1745 | } | ||
1637 | 1746 | | |||
1638 | void Guide::setSubFrameEnabled(bool enable) | 1747 | void Guide::setSubFrameEnabled(bool enable) | ||
1639 | { | 1748 | { | ||
1640 | Options::setGuideSubframeEnabled(enable); | 1749 | Options::setGuideSubframeEnabled(enable); | ||
1641 | if (subFrameCheck->isChecked() != enable) | 1750 | if (subFrameCheck->isChecked() != enable) | ||
1642 | subFrameCheck->setChecked(enable); | 1751 | subFrameCheck->setChecked(enable); | ||
1752 | if(guiderType == GUIDE_PHD2) | ||||
1753 | setExternalGuiderBLOBEnabled(!enable); | ||||
1643 | } | 1754 | } | ||
1644 | 1755 | | |||
1645 | #if 0 | 1756 | #if 0 | ||
1646 | void Guide::setGuideRapidEnabled(bool enable) | 1757 | void Guide::setGuideRapidEnabled(bool enable) | ||
1647 | { | 1758 | { | ||
1648 | //guider->setGuideOptions(guider->getAlgorithm(), guider->useSubFrame() , enable); | 1759 | //guider->setGuideOptions(guider->getAlgorithm(), guider->useSubFrame() , enable); | ||
1649 | } | 1760 | } | ||
1650 | #endif | 1761 | #endif | ||
▲ Show 20 Lines • Show All 57 Lines • ▼ Show 20 Line(s) | 1807 | { | |||
1708 | emit newStatus(state); | 1819 | emit newStatus(state); | ||
1709 | 1820 | | |||
1710 | switch (state) | 1821 | switch (state) | ||
1711 | { | 1822 | { | ||
1712 | case GUIDE_CONNECTED: | 1823 | case GUIDE_CONNECTED: | ||
1713 | appendLogText(i18n("External guider connected.")); | 1824 | appendLogText(i18n("External guider connected.")); | ||
1714 | externalConnectB->setEnabled(false); | 1825 | externalConnectB->setEnabled(false); | ||
1715 | externalDisconnectB->setEnabled(true); | 1826 | externalDisconnectB->setEnabled(true); | ||
1716 | captureB->setEnabled(false); | | |||
1717 | loopB->setEnabled(false); | | |||
1718 | clearCalibrationB->setEnabled(true); | 1827 | clearCalibrationB->setEnabled(true); | ||
1719 | guideB->setEnabled(true); | 1828 | guideB->setEnabled(true); | ||
1720 | setBLOBEnabled(false); | 1829 | | ||
1830 | if(guiderType == GUIDE_PHD2) | ||||
1831 | { | ||||
1832 | captureB->setEnabled(true); | ||||
1833 | loopB->setEnabled(true); | ||||
1834 | autoStarCheck->setEnabled(true); | ||||
1835 | configurePHD2Camera(); | ||||
1836 | setExternalGuiderBLOBEnabled(!Options::guideSubframeEnabled()); | ||||
1837 | boxSizeCombo->setEnabled(true); | ||||
1838 | } | ||||
1721 | break; | 1839 | break; | ||
1722 | 1840 | | |||
1723 | case GUIDE_DISCONNECTED: | 1841 | case GUIDE_DISCONNECTED: | ||
1724 | appendLogText(i18n("External guider disconnected.")); | 1842 | appendLogText(i18n("External guider disconnected.")); | ||
1725 | setBusy(false); //This needs to come before caputureB since it will set it to enabled again. | 1843 | setBusy(false); //This needs to come before caputureB since it will set it to enabled again. | ||
1726 | externalConnectB->setEnabled(true); | 1844 | externalConnectB->setEnabled(true); | ||
1727 | externalDisconnectB->setEnabled(false); | 1845 | externalDisconnectB->setEnabled(false); | ||
1728 | clearCalibrationB->setEnabled(false); | 1846 | clearCalibrationB->setEnabled(false); | ||
1729 | guideB->setEnabled(false); | 1847 | guideB->setEnabled(false); | ||
1730 | captureB->setEnabled(false); | 1848 | captureB->setEnabled(false); | ||
1731 | loopB->setEnabled(false); | 1849 | loopB->setEnabled(false); | ||
1732 | setBLOBEnabled(true); | 1850 | autoStarCheck->setEnabled(false); | ||
1851 | boxSizeCombo->setEnabled(false); | ||||
1852 | //setExternalGuiderBLOBEnabled(true); | ||||
1733 | #ifdef Q_OS_OSX | 1853 | #ifdef Q_OS_OSX | ||
1734 | repaint(); //This is a band-aid for a bug in QT 5.10.0 | 1854 | repaint(); //This is a band-aid for a bug in QT 5.10.0 | ||
1735 | #endif | 1855 | #endif | ||
1736 | break; | 1856 | break; | ||
1737 | 1857 | | |||
1738 | case GUIDE_CALIBRATION_SUCESS: | 1858 | case GUIDE_CALIBRATION_SUCESS: | ||
1739 | appendLogText(i18n("Calibration completed.")); | 1859 | appendLogText(i18n("Calibration completed.")); | ||
1740 | calibrationComplete = true; | 1860 | calibrationComplete = true; | ||
▲ Show 20 Lines • Show All 159 Lines • ▼ Show 20 Line(s) | 2019 | if (newCenter.z() > 0) | |||
1900 | starCenter.setZ(newCenter.z()); | 2020 | starCenter.setZ(newCenter.z()); | ||
1901 | 2021 | | |||
1902 | if (updateNow) | 2022 | if (updateNow) | ||
1903 | syncTrackingBoxPosition(); | 2023 | syncTrackingBoxPosition(); | ||
1904 | } | 2024 | } | ||
1905 | 2025 | | |||
1906 | void Guide::syncTrackingBoxPosition() | 2026 | void Guide::syncTrackingBoxPosition() | ||
1907 | { | 2027 | { | ||
2028 | if(!currentCCD || guiderType == GUIDE_LINGUIDER) | ||||
2029 | return; | ||||
2030 | | ||||
2031 | if(guiderType == GUIDE_PHD2) | ||||
2032 | { | ||||
2033 | //This way it won't set the tracking box on the Guide Star Image. | ||||
2034 | if(guideView->getImageData() != nullptr) | ||||
2035 | { | ||||
2036 | if(guideView->getImageData()->width() < 50) | ||||
2037 | { | ||||
2038 | guideView->setTrackingBoxEnabled(false); | ||||
2039 | return; | ||||
2040 | } | ||||
2041 | } | ||||
2042 | } | ||||
2043 | | ||||
1908 | ISD::CCDChip *targetChip = currentCCD->getChip(useGuideHead ? ISD::CCDChip::GUIDE_CCD : ISD::CCDChip::PRIMARY_CCD); | 2044 | ISD::CCDChip *targetChip = currentCCD->getChip(useGuideHead ? ISD::CCDChip::GUIDE_CCD : ISD::CCDChip::PRIMARY_CCD); | ||
1909 | Q_ASSERT(targetChip); | 2045 | Q_ASSERT(targetChip); | ||
1910 | 2046 | | |||
1911 | int subBinX = 1, subBinY = 1; | 2047 | int subBinX = 1, subBinY = 1; | ||
1912 | targetChip->getBinning(&subBinX, &subBinY); | 2048 | targetChip->getBinning(&subBinX, &subBinY); | ||
1913 | 2049 | | |||
1914 | if (starCenter.isNull() == false) | 2050 | if (starCenter.isNull() == false) | ||
1915 | { | 2051 | { | ||
▲ Show 20 Lines • Show All 151 Lines • ▼ Show 20 Line(s) | 2165 | case GUIDE_PHD2: | |||
2067 | l_Focal->setEnabled(false); | 2203 | l_Focal->setEnabled(false); | ||
2068 | driftGraphicsGroup->setEnabled(true); | 2204 | driftGraphicsGroup->setEnabled(true); | ||
2069 | 2205 | | |||
2070 | ST4Combo->setEnabled(false); | 2206 | ST4Combo->setEnabled(false); | ||
2071 | exposureIN->setEnabled(true); | 2207 | exposureIN->setEnabled(true); | ||
2072 | binningCombo->setEnabled(false); | 2208 | binningCombo->setEnabled(false); | ||
2073 | boxSizeCombo->setEnabled(false); | 2209 | boxSizeCombo->setEnabled(false); | ||
2074 | filterCombo->setEnabled(false); | 2210 | filterCombo->setEnabled(false); | ||
2075 | | ||||
2076 | if (Options::guideRemoteImagesEnabled() == false) | | |||
2077 | { | | |||
2078 | //guiderCombo->setCurrentIndex(-1); | | |||
2079 | guiderCombo->setToolTip(i18n("Select a camera to disable remote streaming.")); | | |||
2080 | } | | |||
2081 | else | | |||
2082 | guiderCombo->setEnabled(false); | 2211 | guiderCombo->setEnabled(false); | ||
2083 | 2212 | | |||
2084 | if (Options::resetGuideCalibration()) | 2213 | if (Options::resetGuideCalibration()) | ||
2085 | appendLogText(i18n("Warning: Reset Guiding Calibration is enabled. It is recommended to turn this option off for PHD2.")); | 2214 | appendLogText(i18n("Warning: Reset Guiding Calibration is enabled. It is recommended to turn this option off for PHD2.")); | ||
2086 | 2215 | | |||
2087 | updateGuideParams(); | 2216 | updateGuideParams(); | ||
2088 | break; | 2217 | break; | ||
2089 | 2218 | | |||
Show All 17 Lines | 2219 | case GUIDE_LINGUIDER: | |||
2107 | driftGraphicsGroup->setEnabled(false); | 2236 | driftGraphicsGroup->setEnabled(false); | ||
2108 | 2237 | | |||
2109 | ST4Combo->setEnabled(false); | 2238 | ST4Combo->setEnabled(false); | ||
2110 | exposureIN->setEnabled(false); | 2239 | exposureIN->setEnabled(false); | ||
2111 | binningCombo->setEnabled(false); | 2240 | binningCombo->setEnabled(false); | ||
2112 | boxSizeCombo->setEnabled(false); | 2241 | boxSizeCombo->setEnabled(false); | ||
2113 | filterCombo->setEnabled(false); | 2242 | filterCombo->setEnabled(false); | ||
2114 | 2243 | | |||
2115 | if (Options::guideRemoteImagesEnabled() == false) | | |||
2116 | { | | |||
2117 | guiderCombo->setCurrentIndex(-1); | | |||
2118 | guiderCombo->setToolTip(i18n("Select a camera to disable remote streaming.")); | | |||
2119 | } | | |||
2120 | else | | |||
2121 | guiderCombo->setEnabled(false); | 2244 | guiderCombo->setEnabled(false); | ||
2122 | 2245 | | |||
2123 | updateGuideParams(); | 2246 | updateGuideParams(); | ||
2124 | 2247 | | |||
2125 | break; | 2248 | break; | ||
2126 | } | 2249 | } | ||
2127 | 2250 | | |||
2128 | if (guider != nullptr) | 2251 | if (guider != nullptr) | ||
2129 | { | 2252 | { | ||
2130 | connect(guider, &Ekos::GuideInterface::frameCaptureRequested, this, &Ekos::Guide::capture); | 2253 | connect(guider, &Ekos::GuideInterface::frameCaptureRequested, this, &Ekos::Guide::capture); | ||
2131 | connect(guider, &Ekos::GuideInterface::newLog, this, &Ekos::Guide::appendLogText); | 2254 | connect(guider, &Ekos::GuideInterface::newLog, this, &Ekos::Guide::appendLogText); | ||
2132 | connect(guider, &Ekos::GuideInterface::newStatus, this, &Ekos::Guide::setStatus); | 2255 | connect(guider, &Ekos::GuideInterface::newStatus, this, &Ekos::Guide::setStatus); | ||
2133 | connect(guider, &Ekos::GuideInterface::newStarPosition, this, &Ekos::Guide::setStarPosition); | 2256 | connect(guider, &Ekos::GuideInterface::newStarPosition, this, &Ekos::Guide::setStarPosition); | ||
2134 | 2257 | | |||
2135 | connect(guider, &Ekos::GuideInterface::newAxisDelta, this, &Ekos::Guide::setAxisDelta); | 2258 | connect(guider, &Ekos::GuideInterface::newAxisDelta, this, &Ekos::Guide::setAxisDelta); | ||
2136 | connect(guider, &Ekos::GuideInterface::newAxisPulse, this, &Ekos::Guide::setAxisPulse); | 2259 | connect(guider, &Ekos::GuideInterface::newAxisPulse, this, &Ekos::Guide::setAxisPulse); | ||
2137 | connect(guider, &Ekos::GuideInterface::newAxisSigma, this, &Ekos::Guide::setAxisSigma); | 2260 | connect(guider, &Ekos::GuideInterface::newAxisSigma, this, &Ekos::Guide::setAxisSigma); | ||
2261 | | ||||
2262 | connect(guider, &Ekos::GuideInterface::guideEquipmentUpdated, this, &Ekos::Guide::configurePHD2Camera); | ||||
2138 | } | 2263 | } | ||
2139 | 2264 | | |||
2140 | externalConnectB->setEnabled(false); | 2265 | externalConnectB->setEnabled(false); | ||
2141 | externalDisconnectB->setEnabled(false); | 2266 | externalDisconnectB->setEnabled(false); | ||
2142 | 2267 | | |||
2143 | if (guider != nullptr && guiderType != GUIDE_INTERNAL) | 2268 | if (guider != nullptr && guiderType != GUIDE_INTERNAL) | ||
2144 | { | 2269 | { | ||
2145 | externalConnectB->setEnabled(!guider->isConnected()); | 2270 | externalConnectB->setEnabled(!guider->isConnected()); | ||
▲ Show 20 Lines • Show All 282 Lines • ▼ Show 20 Line(s) | 2519 | { | |||
2428 | Options::setDECMinimumPulse(spinBox_MinPulseDEC->value()); | 2553 | Options::setDECMinimumPulse(spinBox_MinPulseDEC->value()); | ||
2429 | } | 2554 | } | ||
2430 | 2555 | | |||
2431 | void Guide::setTrackingStar(int x, int y) | 2556 | void Guide::setTrackingStar(int x, int y) | ||
2432 | { | 2557 | { | ||
2433 | QVector3D newStarPosition(x, y, -1); | 2558 | QVector3D newStarPosition(x, y, -1); | ||
2434 | setStarPosition(newStarPosition, true); | 2559 | setStarPosition(newStarPosition, true); | ||
2435 | 2560 | | |||
2561 | if(guiderType == GUIDE_PHD2) | ||||
2562 | { | ||||
2563 | //The Guide Star Image is 32 pixels across or less, so this guarantees it isn't that. | ||||
2564 | if(guideView->getImageData() != nullptr) | ||||
2565 | { | ||||
2566 | if(guideView->getImageData()->width() > 50) | ||||
2567 | phd2Guider->setLockPosition(starCenter.x(),starCenter.y()); | ||||
2568 | } | ||||
2569 | } | ||||
2570 | | ||||
2436 | /*if (state == GUIDE_STAR_SELECT) | 2571 | /*if (state == GUIDE_STAR_SELECT) | ||
2437 | { | 2572 | { | ||
2438 | guider->setStarPosition(newStarPosition); | 2573 | guider->setStarPosition(newStarPosition); | ||
2439 | guider->calibrate(); | 2574 | guider->calibrate(); | ||
2440 | }*/ | 2575 | }*/ | ||
2441 | 2576 | | |||
2442 | if (operationStack.isEmpty() == false) | 2577 | if (operationStack.isEmpty() == false) | ||
2443 | executeOperationStack(); | 2578 | executeOperationStack(); | ||
2444 | } | 2579 | } | ||
2445 | 2580 | | |||
2446 | void Guide::setAxisDelta(double ra, double de) | 2581 | void Guide::setAxisDelta(double ra, double de) | ||
2447 | { | 2582 | { | ||
2583 | //If PHD2 starts guiding because somebody pusted the button remotely, we want to set the state to guiding. | ||||
2584 | //If guide pulses start coming in, it must be guiding. | ||||
2585 | if(guiderType == GUIDE_PHD2 && state != GUIDE_GUIDING) | ||||
2586 | setStatus(GUIDE_GUIDING); | ||||
2587 | | ||||
2448 | // Time since timer started. | 2588 | // Time since timer started. | ||
2449 | double key = guideTimer.elapsed() / 1000.0; | 2589 | double key = guideTimer.elapsed() / 1000.0; | ||
2450 | 2590 | | |||
2451 | ra = -ra; //The ra is backwards in sign from how it should be displayed on the graph. | 2591 | ra = -ra; //The ra is backwards in sign from how it should be displayed on the graph. | ||
2452 | 2592 | | |||
2453 | driftGraph->graph(0)->addData(key, ra); | 2593 | driftGraph->graph(0)->addData(key, ra); | ||
2454 | driftGraph->graph(1)->addData(key, de); | 2594 | driftGraph->graph(1)->addData(key, de); | ||
2455 | 2595 | | |||
▲ Show 20 Lines • Show All 519 Lines • ▼ Show 20 Line(s) | 3098 | { | |||
2975 | } | 3115 | } | ||
2976 | else | 3116 | else | ||
2977 | fv->updateFITS(url, 0); | 3117 | fv->updateFITS(url, 0); | ||
2978 | 3118 | | |||
2979 | fv->show(); | 3119 | fv->show(); | ||
2980 | } | 3120 | } | ||
2981 | } | 3121 | } | ||
2982 | 3122 | | |||
2983 | void Guide::setBLOBEnabled(bool enable, const QString &ccd) | 3123 | void Guide::setExternalGuiderBLOBEnabled(bool enable) | ||
2984 | { | 3124 | { | ||
2985 | // Nothing to do if guider is international or remote images are enabled | 3125 | // Nothing to do if guider is internal | ||
2986 | if (guiderType == GUIDE_INTERNAL || Options::guideRemoteImagesEnabled()) | 3126 | if (guiderType == GUIDE_INTERNAL) | ||
2987 | return; | 3127 | return; | ||
2988 | 3128 | | |||
2989 | // If guider is external and remote images option is disabled AND BLOB is enabled, then we disabled it | 3129 | if(!currentCCD) | ||
3130 | return; | ||||
2990 | 3131 | | |||
2991 | foreach(ISD::CCD *oneCCD, CCDs) | 3132 | currentCCD->setBLOBEnabled(enable); | ||
2992 | { | | |||
2993 | // If it's not the desired CCD, continue. | | |||
2994 | if (ccd.isEmpty() == false && QString(oneCCD->getDeviceName()) != ccd) | | |||
2995 | continue; | | |||
2996 | 3133 | | |||
2997 | if (enable == false && oneCCD->isBLOBEnabled()) | 3134 | if(currentCCD->isBLOBEnabled()) | ||
2998 | { | 3135 | { | ||
2999 | appendLogText(i18n("Disabling remote image reception from %1", oneCCD->getDeviceName())); | 3136 | if (currentCCD->hasGuideHead() && guiderCombo->currentText().contains("Guider")) | ||
3000 | oneCCD->setBLOBEnabled(enable); | 3137 | useGuideHead = true; | ||
3001 | } | 3138 | else | ||
3002 | // Re-enable BLOB reception if it was disabled before when using external guiders | 3139 | useGuideHead = false; | ||
3003 | else if (enable && oneCCD->isBLOBEnabled() == false) | 3140 | | ||
3141 | ISD::CCDChip *targetChip = | ||||
3142 | currentCCD->getChip(useGuideHead ? ISD::CCDChip::GUIDE_CCD : ISD::CCDChip::PRIMARY_CCD); | ||||
3143 | if (targetChip) | ||||
3004 | { | 3144 | { | ||
3005 | appendLogText(i18n("Enabling remote image reception from %1", oneCCD->getDeviceName())); | 3145 | targetChip->setImageView(guideView, FITS_GUIDE); | ||
3006 | oneCCD->setBLOBEnabled(enable); | 3146 | targetChip->setCaptureMode(FITS_GUIDE); | ||
3007 | } | 3147 | } | ||
3148 | syncCCDInfo(); | ||||
3008 | } | 3149 | } | ||
3150 | | ||||
3009 | } | 3151 | } | ||
3010 | 3152 | | |||
3011 | void Guide::ditherDirectly() | 3153 | void Guide::ditherDirectly() | ||
3012 | { | 3154 | { | ||
3013 | double ditherPulse = Options::ditherNoGuidingPulse(); | 3155 | double ditherPulse = Options::ditherNoGuidingPulse(); | ||
3014 | 3156 | | |||
3015 | // Randomize pulse length. It is equal to 50% of pulse length + random value up to 50% | 3157 | // Randomize pulse length. It is equal to 50% of pulse length + random value up to 50% | ||
3016 | // e.g. if ditherPulse is 500ms then final pulse is = 250 + rand(0 to 250) | 3158 | // e.g. if ditherPulse is 500ms then final pulse is = 250 + rand(0 to 250) | ||
▲ Show 20 Lines • Show All 42 Lines • ▼ Show 20 Line(s) | |||||
3059 | { | 3201 | { | ||
3060 | Options::setDefaultST4Driver(driver); | 3202 | Options::setDefaultST4Driver(driver); | ||
3061 | } | 3203 | } | ||
3062 | 3204 | | |||
3063 | void Guide::setDefaultCCD(const QString &ccd) | 3205 | void Guide::setDefaultCCD(const QString &ccd) | ||
3064 | { | 3206 | { | ||
3065 | if (guiderType == GUIDE_INTERNAL) | 3207 | if (guiderType == GUIDE_INTERNAL) | ||
3066 | Options::setDefaultGuideCCD(ccd); | 3208 | Options::setDefaultGuideCCD(ccd); | ||
3067 | else if (ccd.isEmpty() == false) | | |||
3068 | { | | |||
3069 | QString ccdName = ccd; | | |||
3070 | ccdName = ccdName.remove(" Guider"); | | |||
3071 | setBLOBEnabled(Options::guideRemoteImagesEnabled(), ccdName); | | |||
3072 | } | | |||
3073 | } | 3209 | } | ||
3074 | 3210 | | |||
3075 | void Guide::handleManualDither() | 3211 | void Guide::handleManualDither() | ||
3076 | { | 3212 | { | ||
3077 | ISD::CCDChip *targetChip = currentCCD->getChip(useGuideHead ? ISD::CCDChip::GUIDE_CCD : ISD::CCDChip::PRIMARY_CCD); | 3213 | ISD::CCDChip *targetChip = currentCCD->getChip(useGuideHead ? ISD::CCDChip::GUIDE_CCD : ISD::CCDChip::PRIMARY_CCD); | ||
3078 | if (targetChip == nullptr) | 3214 | if (targetChip == nullptr) | ||
3079 | return; | 3215 | return; | ||
3080 | 3216 | | |||
▲ Show 20 Lines • Show All 267 Lines • ▼ Show 20 Line(s) | 3474 | { | |||
3348 | connect(guiderCombo, static_cast<void(QComboBox::*)(int)>(&QComboBox::activated), this, | 3484 | connect(guiderCombo, static_cast<void(QComboBox::*)(int)>(&QComboBox::activated), this, | ||
3349 | [&](int index) | 3485 | [&](int index) | ||
3350 | { | 3486 | { | ||
3351 | if (guiderType == GUIDE_INTERNAL) | 3487 | if (guiderType == GUIDE_INTERNAL) | ||
3352 | { | 3488 | { | ||
3353 | starCenter = QVector3D(); | 3489 | starCenter = QVector3D(); | ||
3354 | checkCCD(index); | 3490 | checkCCD(index); | ||
3355 | } | 3491 | } | ||
3356 | else if (index >= 0) | | |||
3357 | { | | |||
3358 | // Disable or enable selected CCD based on options | | |||
3359 | QString ccdName = guiderCombo->currentText().remove(" Guider"); | | |||
3360 | setBLOBEnabled(Options::guideRemoteImagesEnabled(), ccdName); | | |||
3361 | checkCCD(index); | | |||
3362 | } | | |||
3363 | } | 3492 | } | ||
3364 | ); | 3493 | ); | ||
3365 | 3494 | | |||
3366 | FOVScopeCombo->setCurrentIndex(Options::guideScopeType()); | 3495 | FOVScopeCombo->setCurrentIndex(Options::guideScopeType()); | ||
3367 | connect(FOVScopeCombo, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, &Ekos::Guide::updateTelescopeType); | 3496 | connect(FOVScopeCombo, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, &Ekos::Guide::updateTelescopeType); | ||
3368 | 3497 | | |||
3369 | // Dark Frame Check | 3498 | // Dark Frame Check | ||
3370 | connect(darkFrameCheck, &QCheckBox::toggled, this, &Ekos::Guide::setDarkFrameEnabled); | 3499 | connect(darkFrameCheck, &QCheckBox::toggled, this, &Ekos::Guide::setDarkFrameEnabled); | ||
3371 | // Subframe check | 3500 | // Subframe check | ||
3501 | if(guiderType != GUIDE_PHD2) //For PHD2, this is handled in the configurePHD2Camera method | ||||
3372 | connect(subFrameCheck, &QCheckBox::toggled, this, &Ekos::Guide::setSubFrameEnabled); | 3502 | connect(subFrameCheck, &QCheckBox::toggled, this, &Ekos::Guide::setSubFrameEnabled); | ||
3373 | // ST4 Selection | 3503 | // ST4 Selection | ||
3374 | connect(ST4Combo, static_cast<void(QComboBox::*)(const QString &)>(&QComboBox::activated), [&](const QString & text) | 3504 | connect(ST4Combo, static_cast<void(QComboBox::*)(const QString &)>(&QComboBox::activated), [&](const QString & text) | ||
3375 | { | 3505 | { | ||
3376 | setDefaultST4(text); | 3506 | setDefaultST4(text); | ||
3377 | setST4(text); | 3507 | setST4(text); | ||
3378 | }); | 3508 | }); | ||
3379 | 3509 | | |||
Show All 37 Lines | |||||
3417 | connect(spinBox_MinPulseDEC, &QSpinBox::editingFinished, this, &Ekos::Guide::syncSettings); | 3547 | connect(spinBox_MinPulseDEC, &QSpinBox::editingFinished, this, &Ekos::Guide::syncSettings); | ||
3418 | 3548 | | |||
3419 | // Capture | 3549 | // Capture | ||
3420 | connect(captureB, &QPushButton::clicked, this, [this]() | 3550 | connect(captureB, &QPushButton::clicked, this, [this]() | ||
3421 | { | 3551 | { | ||
3422 | state = GUIDE_CAPTURE; | 3552 | state = GUIDE_CAPTURE; | ||
3423 | emit newStatus(state); | 3553 | emit newStatus(state); | ||
3424 | 3554 | | |||
3555 | if(guiderType == GUIDE_PHD2) | ||||
3556 | { | ||||
3557 | configurePHD2Camera(); | ||||
3558 | if(phd2Guider->isCurrentCameraNotInEkos()) | ||||
3559 | appendLogText(i18n("The PHD2 camera is not available to Ekos, so you cannot see the captured images. But you will still see the Guide Star Image when you guide.")); | ||||
3560 | else if(Options::guideSubframeEnabled()) | ||||
3561 | { | ||||
3562 | appendLogText(i18n("To receive PHD2 images other than the Guide Star Image, SubFrame must be unchecked. Unchecking it now to enable your image captures. You can re-enable it before Guiding")); | ||||
3563 | subFrameCheck->setChecked(false); | ||||
3564 | } | ||||
3565 | phd2Guider->captureSingleFrame(); | ||||
3566 | } | ||||
3567 | else | ||||
3425 | capture(); | 3568 | capture(); | ||
3426 | }); | 3569 | }); | ||
3427 | 3570 | | |||
3428 | connect(loopB, &QPushButton::clicked, this, [this]() | 3571 | connect(loopB, &QPushButton::clicked, this, [this]() | ||
3429 | { | 3572 | { | ||
3430 | state = GUIDE_LOOPING; | 3573 | state = GUIDE_LOOPING; | ||
3431 | emit newStatus(state); | 3574 | emit newStatus(state); | ||
3432 | 3575 | | |||
3576 | if(guiderType == GUIDE_PHD2) | ||||
3577 | { | ||||
3578 | configurePHD2Camera(); | ||||
3579 | if(phd2Guider->isCurrentCameraNotInEkos()) | ||||
3580 | appendLogText(i18n("The PHD2 camera is not available to Ekos, so you cannot see the captured images. But you will still see the Guide Star Image when you guide.")); | ||||
3581 | else if(Options::guideSubframeEnabled()) | ||||
3582 | { | ||||
3583 | appendLogText(i18n("To receive PHD2 images other than the Guide Star Image, SubFrame must be unchecked. Unchecking it now to enable your image captures. You can re-enable it before Guiding")); | ||||
3584 | subFrameCheck->setChecked(false); | ||||
3585 | } | ||||
3586 | phd2Guider->loop(); | ||||
3587 | stopB->setEnabled(true); | ||||
3588 | } | ||||
3589 | else | ||||
3433 | capture(); | 3590 | capture(); | ||
3434 | }); | 3591 | }); | ||
3435 | 3592 | | |||
3436 | // Stop | 3593 | // Stop | ||
3437 | connect(stopB, &QPushButton::clicked, this, &Ekos::Guide::abort); | 3594 | connect(stopB, &QPushButton::clicked, this, &Ekos::Guide::abort); | ||
3438 | 3595 | | |||
3439 | // Clear Calibrate | 3596 | // Clear Calibrate | ||
3440 | //connect(calibrateB, &QPushButton::clicked, this, &Ekos::Guide::calibrate())); | 3597 | //connect(calibrateB, &QPushButton::clicked, this, &Ekos::Guide::calibrate())); | ||
3441 | connect(clearCalibrationB, &QPushButton::clicked, this, &Ekos::Guide::clearCalibration); | 3598 | connect(clearCalibrationB, &QPushButton::clicked, this, &Ekos::Guide::clearCalibration); | ||
3442 | 3599 | | |||
3443 | // Guide | 3600 | // Guide | ||
3444 | connect(guideB, &QPushButton::clicked, this, &Ekos::Guide::guide); | 3601 | connect(guideB, &QPushButton::clicked, this, &Ekos::Guide::guide); | ||
3445 | 3602 | | |||
3446 | // Connect External Guide | 3603 | // Connect External Guide | ||
3447 | connect(externalConnectB, &QPushButton::clicked, this, [&]() | 3604 | connect(externalConnectB, &QPushButton::clicked, this, [&]() | ||
3448 | { | 3605 | { | ||
3449 | setBLOBEnabled(false); | 3606 | //setExternalGuiderBLOBEnabled(false); | ||
3450 | guider->Connect(); | 3607 | guider->Connect(); | ||
3451 | }); | 3608 | }); | ||
3452 | connect(externalDisconnectB, &QPushButton::clicked, this, [&]() | 3609 | connect(externalDisconnectB, &QPushButton::clicked, this, [&]() | ||
3453 | { | 3610 | { | ||
3454 | setBLOBEnabled(true); | 3611 | //setExternalGuiderBLOBEnabled(true); | ||
3455 | guider->Disconnect(); | 3612 | guider->Disconnect(); | ||
3456 | }); | 3613 | }); | ||
3457 | 3614 | | |||
3458 | // Pulse Timer | 3615 | // Pulse Timer | ||
3459 | pulseTimer.setSingleShot(true); | 3616 | pulseTimer.setSingleShot(true); | ||
3460 | connect(&pulseTimer, &QTimer::timeout, this, &Ekos::Guide::capture); | 3617 | connect(&pulseTimer, &QTimer::timeout, this, &Ekos::Guide::capture); | ||
3461 | 3618 | | |||
3462 | //This connects all the buttons and slider below the guide plots. | 3619 | //This connects all the buttons and slider below the guide plots. | ||
▲ Show 20 Lines • Show All 67 Lines • Show Last 20 Lines |
Switch case might have been appropriate now that all cases are distinct.