Changeset View
Changeset View
Standalone View
Standalone View
kstars/ekos/guide/externalguide/phd2.cpp
Show First 20 Lines • Show All 61 Lines • ▼ Show 20 Line(s) | 34 | { | |||
---|---|---|---|---|---|
62 | events["GuideStep"] = GuideStep; | 62 | events["GuideStep"] = GuideStep; | ||
63 | events["GuidingDithered"] = GuidingDithered; | 63 | events["GuidingDithered"] = GuidingDithered; | ||
64 | events["LockPositionLost"] = LockPositionLost; | 64 | events["LockPositionLost"] = LockPositionLost; | ||
65 | events["Alert"] = Alert; | 65 | events["Alert"] = Alert; | ||
66 | events["GuideParamChange"] = GuideParamChange; | 66 | events["GuideParamChange"] = GuideParamChange; | ||
67 | 67 | | |||
68 | //This list of available PHD Methods is on https://github.com/OpenPHDGuiding/phd2/wiki/EventMonitoring | 68 | //This list of available PHD Methods is on https://github.com/OpenPHDGuiding/phd2/wiki/EventMonitoring | ||
69 | //Only some of the methods are implemented. The ones that say COMMAND_RECEIVED simply return a 0 saying the command was received. | 69 | //Only some of the methods are implemented. The ones that say COMMAND_RECEIVED simply return a 0 saying the command was received. | ||
70 | //capture_single_frame | 70 | methodResults["capture_single_frame"] = CAPTURE_SINGLE_FRAME; | ||
wreissenberger: Has to be defined here as methodResults[] member, otherwise `sendPHD2Request()` has an… | |||||
71 | methodResults["clear_calibration"] = CLEAR_CALIBRATION_COMMAND_RECEIVED; | 71 | methodResults["clear_calibration"] = CLEAR_CALIBRATION_COMMAND_RECEIVED; | ||
72 | methodResults["dither"] = DITHER_COMMAND_RECEIVED; | 72 | methodResults["dither"] = DITHER_COMMAND_RECEIVED; | ||
73 | //find_star | 73 | //find_star | ||
74 | //flip_calibration | 74 | //flip_calibration | ||
75 | //get_algo_param_names | 75 | //get_algo_param_names | ||
76 | //get_algo_param | 76 | //get_algo_param | ||
77 | //get_app_state | 77 | //get_app_state | ||
78 | //get_calibrated | 78 | //get_calibrated | ||
79 | //get_calibration_data | 79 | //get_calibration_data | ||
80 | methodResults["get_connected"] = IS_EQUIPMENT_CONNECTED; | 80 | methodResults["get_connected"] = IS_EQUIPMENT_CONNECTED; | ||
81 | //get_cooler_status | 81 | //get_cooler_status | ||
82 | //get_current_equipment | 82 | methodResults["get_current_equipment"] = GET_CURRENT_EQUIPMENT; | ||
83 | methodResults["get_dec_guide_mode"] = DEC_GUIDE_MODE; | 83 | methodResults["get_dec_guide_mode"] = DEC_GUIDE_MODE; | ||
84 | methodResults["get_exposure"] = EXPOSURE_TIME; | 84 | methodResults["get_exposure"] = EXPOSURE_TIME; | ||
85 | methodResults["get_exposure_durations"] = EXPOSURE_DURATIONS; | 85 | methodResults["get_exposure_durations"] = EXPOSURE_DURATIONS; | ||
86 | //get_lock_position | 86 | methodResults["get_lock_position"] = LOCK_POSITION; | ||
87 | //get_lock_shift_enabled | 87 | //get_lock_shift_enabled | ||
88 | //get_lock_shift_params | 88 | //get_lock_shift_params | ||
89 | //get_paused | 89 | //get_paused | ||
90 | methodResults["get_pixel_scale"] = PIXEL_SCALE; | 90 | methodResults["get_pixel_scale"] = PIXEL_SCALE; | ||
91 | //get_profile | 91 | //get_profile | ||
92 | //get_profiles | 92 | //get_profiles | ||
93 | //get_search_region | 93 | //get_search_region | ||
94 | //get_sensor_temperature | 94 | //get_sensor_temperature | ||
95 | methodResults["get_star_image"] = STAR_IMAGE; | 95 | methodResults["get_star_image"] = STAR_IMAGE; | ||
96 | //get_use_subframes | 96 | //get_use_subframes | ||
97 | methodResults["guide"] = GUIDE_COMMAND_RECEIVED; | 97 | methodResults["guide"] = GUIDE_COMMAND_RECEIVED; | ||
98 | //guide_pulse | 98 | //guide_pulse | ||
99 | //loop | 99 | methodResults["loop"] = LOOP; | ||
100 | //save_image | 100 | //save_image | ||
101 | //set_algo_param | 101 | //set_algo_param | ||
102 | methodResults["set_connected"] = CONNECTION_RESULT; | 102 | methodResults["set_connected"] = CONNECTION_RESULT; | ||
103 | methodResults["set_dec_guide_mode"] = SET_DEC_GUIDE_MODE_COMMAND_RECEIVED; | 103 | methodResults["set_dec_guide_mode"] = SET_DEC_GUIDE_MODE_COMMAND_RECEIVED; | ||
104 | methodResults["set_exposure"] = SET_EXPOSURE_COMMAND_RECEIVED; | 104 | methodResults["set_exposure"] = SET_EXPOSURE_COMMAND_RECEIVED; | ||
105 | //set_lock_position | 105 | methodResults["set_lock_position"] = SET_LOCK_POSITION; | ||
106 | //set_lock_shift_enabled | 106 | //set_lock_shift_enabled | ||
107 | //set_lock_shift_params | 107 | //set_lock_shift_params | ||
108 | methodResults["set_paused"] = SET_PAUSED_COMMAND_RECEIVED; | 108 | methodResults["set_paused"] = SET_PAUSED_COMMAND_RECEIVED; | ||
109 | //set_profile | 109 | //set_profile | ||
110 | //shutdown | 110 | //shutdown | ||
111 | methodResults["stop_capture"] = STOP_CAPTURE_COMMAND_RECEIVED; | 111 | methodResults["stop_capture"] = STOP_CAPTURE_COMMAND_RECEIVED; | ||
112 | 112 | | |||
113 | QDir writableDir; | 113 | QDir writableDir; | ||
▲ Show 20 Lines • Show All 165 Lines • ▼ Show 20 Line(s) | 278 | case CalibrationComplete: | |||
279 | setEquipmentConnected(); | 279 | setEquipmentConnected(); | ||
280 | emit newLog(i18n("PHD2: Calibration Complete.")); | 280 | emit newLog(i18n("PHD2: Calibration Complete.")); | ||
281 | emit newStatus(Ekos::GUIDE_CALIBRATION_SUCESS); | 281 | emit newStatus(Ekos::GUIDE_CALIBRATION_SUCESS); | ||
282 | break; | 282 | break; | ||
283 | 283 | | |||
284 | case StartGuiding: | 284 | case StartGuiding: | ||
285 | setEquipmentConnected(); | 285 | setEquipmentConnected(); | ||
286 | updateGuideParameters(); | 286 | updateGuideParameters(); | ||
287 | requestCurrentEquipmentUpdate(); | ||||
287 | // Do not report guiding as started because it will start scheduled capture before guiding is settled | 288 | // Do not report guiding as started because it will start scheduled capture before guiding is settled | ||
288 | // just print the log message and GUIDE_STARTED status will be set in SettleDone | 289 | // just print the log message and GUIDE_STARTED status will be set in SettleDone | ||
289 | // phd2 will always send SettleDone event | 290 | // phd2 will always send SettleDone event | ||
290 | emit newLog(i18n("PHD2: Waiting for guiding to settle.")); | 291 | emit newLog(i18n("PHD2: Waiting for guiding to settle.")); | ||
291 | break; | 292 | break; | ||
292 | 293 | | |||
293 | case Paused: | 294 | case Paused: | ||
294 | state = PAUSED; | 295 | state = PAUSED; | ||
▲ Show 20 Lines • Show All 173 Lines • ▼ Show 20 Line(s) | 457 | { | |||
468 | { | 469 | { | ||
469 | total_sqr_RA_error += point.x() * point.x(); | 470 | total_sqr_RA_error += point.x() * point.x(); | ||
470 | total_sqr_DE_error += point.y() * point.y(); | 471 | total_sqr_DE_error += point.y() * point.y(); | ||
471 | } | 472 | } | ||
472 | 473 | | |||
473 | emit newAxisSigma(sqrt(total_sqr_RA_error / errorLog.size()), sqrt(total_sqr_DE_error / errorLog.size())); | 474 | emit newAxisSigma(sqrt(total_sqr_RA_error / errorLog.size()), sqrt(total_sqr_DE_error / errorLog.size())); | ||
474 | 475 | | |||
475 | } | 476 | } | ||
476 | 477 | //Note that if it is receiving full size remote images, it should not get the guide star image. | |||
478 | //But if it is not getting the full size images, or if the current camera is not in Ekos, it should get the guide star image | ||||
479 | //If we are getting the full size image, we will want to know the lock position for the image that loads in the viewer. | ||||
480 | if ( Options::guideSubframeEnabled() || currentCameraIsNotInEkos ) | ||||
477 | requestStarImage(32); //This requests a star image for the guide view. 32 x 32 pixels | 481 | requestStarImage(32); //This requests a star image for the guide view. 32 x 32 pixels | ||
482 | else | ||||
483 | requestLockPosition(); | ||||
478 | } | 484 | } | ||
479 | break; | 485 | break; | ||
480 | 486 | | |||
481 | case GuidingDithered: | 487 | case GuidingDithered: | ||
482 | break; | 488 | break; | ||
483 | 489 | | |||
484 | case LockPositionSet: | 490 | case LockPositionSet: | ||
485 | emit newLog(i18n("PHD2: Lock Position Set.")); | 491 | emit newLog(i18n("PHD2: Lock Position Set.")); | ||
▲ Show 20 Lines • Show All 51 Lines • ▼ Show 20 Line(s) | 542 | else | |||
537 | qCDebug(KSTARS_EKOS_GUIDE) << "PHD2: response:" << line; | 543 | qCDebug(KSTARS_EKOS_GUIDE) << "PHD2: response:" << line; | ||
538 | 544 | | |||
539 | switch (resultType) | 545 | switch (resultType) | ||
540 | { | 546 | { | ||
541 | case NO_RESULT: | 547 | case NO_RESULT: | ||
542 | //Ekos didn't ask for this result? | 548 | //Ekos didn't ask for this result? | ||
543 | break; | 549 | break; | ||
544 | 550 | | |||
545 | //capture_single_frame | 551 | case CAPTURE_SINGLE_FRAME: //capture_single_frame | ||
552 | break; | ||||
553 | | ||||
546 | case CLEAR_CALIBRATION_COMMAND_RECEIVED: //clear_calibration | 554 | case CLEAR_CALIBRATION_COMMAND_RECEIVED: //clear_calibration | ||
547 | break; | 555 | break; | ||
548 | 556 | | |||
549 | case DITHER_COMMAND_RECEIVED: //dither | 557 | case DITHER_COMMAND_RECEIVED: //dither | ||
550 | emit newStatus(Ekos::GUIDE_DITHERING); | 558 | emit newStatus(Ekos::GUIDE_DITHERING); | ||
551 | break; | 559 | break; | ||
552 | 560 | | |||
553 | //find_star | 561 | //find_star | ||
Show All 15 Lines | 570 | { | |||
569 | { | 577 | { | ||
570 | connection = EQUIPMENT_DISCONNECTED; | 578 | connection = EQUIPMENT_DISCONNECTED; | ||
571 | emit newStatus(Ekos::GUIDE_DISCONNECTED); | 579 | emit newStatus(Ekos::GUIDE_DISCONNECTED); | ||
572 | } | 580 | } | ||
573 | } | 581 | } | ||
574 | break; | 582 | break; | ||
575 | 583 | | |||
576 | //get_cooler_status | 584 | //get_cooler_status | ||
577 | //get_current_equipment | 585 | case GET_CURRENT_EQUIPMENT: //get_current_equipment | ||
586 | { | ||||
587 | QJsonObject equipObject = jsonObj["result"].toObject(); | ||||
588 | currentCamera = equipObject["camera"].toObject()["name"].toString(); | ||||
589 | currentMount = equipObject["mount"].toObject()["name"].toString(); | ||||
590 | currentAuxMount = equipObject["aux_mount"].toObject()["name"].toString(); | ||||
591 | | ||||
592 | emit guideEquipmentUpdated(); | ||||
593 | | ||||
594 | break; | ||||
595 | } | ||||
596 | | ||||
578 | 597 | | |||
579 | case DEC_GUIDE_MODE: //get_dec_guide_mode | 598 | case DEC_GUIDE_MODE: //get_dec_guide_mode | ||
580 | { | 599 | { | ||
581 | QString mode = jsonObj["result"].toString(); | 600 | QString mode = jsonObj["result"].toString(); | ||
582 | KStars::Instance()->ekosManager()->guideModule()->updateDirectionsFromPHD2(mode); | 601 | KStars::Instance()->ekosManager()->guideModule()->updateDirectionsFromPHD2(mode); | ||
583 | emit newLog(i18n("PHD2: DEC Guide Mode is Set to: %1", mode)); | 602 | emit newLog(i18n("PHD2: DEC Guide Mode is Set to: %1", mode)); | ||
584 | } | 603 | } | ||
585 | break; | 604 | break; | ||
Show All 15 Lines | 618 | { | |||
601 | logValidExposureTimes = i18n("PHD2: Valid Exposure Times: Auto, "); | 620 | logValidExposureTimes = i18n("PHD2: Valid Exposure Times: Auto, "); | ||
602 | QList<double> values; | 621 | QList<double> values; | ||
603 | for(int i = 1; i < exposureListArray.size(); i ++) //For some reason PHD2 has a negative exposure time of 1 at the start of the array? | 622 | for(int i = 1; i < exposureListArray.size(); i ++) //For some reason PHD2 has a negative exposure time of 1 at the start of the array? | ||
604 | values << exposureListArray.at(i).toDouble() / 1000.0; //PHD2 reports in ms. | 623 | values << exposureListArray.at(i).toDouble() / 1000.0; //PHD2 reports in ms. | ||
605 | logValidExposureTimes += KStars::Instance()->ekosManager()->guideModule()->setRecommendedExposureValues(values); | 624 | logValidExposureTimes += KStars::Instance()->ekosManager()->guideModule()->setRecommendedExposureValues(values); | ||
606 | emit newLog(logValidExposureTimes); | 625 | emit newLog(logValidExposureTimes); | ||
607 | break; | 626 | break; | ||
608 | } | 627 | } | ||
609 | //get_lock_position | 628 | case LOCK_POSITION: //get_lock_position | ||
629 | { | ||||
630 | if(jsonObj["result"].toArray().count()==2) | ||||
631 | { | ||||
632 | double x = jsonObj["result"].toArray().at(0).toDouble(); | ||||
633 | double y = jsonObj["result"].toArray().at(1).toDouble(); | ||||
634 | QVector3D newStarCenter(x, y, 0); | ||||
635 | emit newStarPosition(newStarCenter, true); | ||||
636 | | ||||
637 | //This is needed so that PHD2 sends the new star pixmap when | ||||
638 | //remote images are enabled. | ||||
639 | emit newStarPixmap(guideFrame->getTrackingBoxPixmap()); | ||||
640 | } | ||||
641 | break; | ||||
642 | } | ||||
610 | //get_lock_shift_enabled | 643 | //get_lock_shift_enabled | ||
611 | //get_lock_shift_params | 644 | //get_lock_shift_params | ||
612 | //get_paused | 645 | //get_paused | ||
613 | 646 | | |||
614 | case PIXEL_SCALE: //get_pixel_scale | 647 | case PIXEL_SCALE: //get_pixel_scale | ||
615 | pixelScale = jsonObj["result"].toDouble(); | 648 | pixelScale = jsonObj["result"].toDouble(); | ||
616 | if (pixelScale == 0) | 649 | if (pixelScale == 0) | ||
617 | emit newLog(i18n("PHD2: Please set CCD and telescope parameters in PHD2, Pixel Scale is invalid.")); | 650 | emit newLog(i18n("PHD2: Please set CCD and telescope parameters in PHD2, Pixel Scale is invalid.")); | ||
Show All 13 Lines | 661 | { | |||
631 | processStarImage(jsonResult); | 664 | processStarImage(jsonResult); | ||
632 | break; | 665 | break; | ||
633 | } | 666 | } | ||
634 | 667 | | |||
635 | //get_use_subframes | 668 | //get_use_subframes | ||
636 | 669 | | |||
637 | case GUIDE_COMMAND_RECEIVED: //guide | 670 | case GUIDE_COMMAND_RECEIVED: //guide | ||
638 | break; | 671 | break; | ||
672 | | ||||
639 | //guide_pulse | 673 | //guide_pulse | ||
640 | //loop | 674 | | ||
675 | case LOOP: //loop | ||||
676 | break; | ||||
677 | | ||||
641 | //save_image | 678 | //save_image | ||
642 | //set_algo_param | 679 | //set_algo_param | ||
643 | 680 | | |||
644 | case CONNECTION_RESULT: //set_connected | 681 | case CONNECTION_RESULT: //set_connected | ||
645 | checkIfEquipmentConnected(); | 682 | checkIfEquipmentConnected(); | ||
646 | break; | 683 | break; | ||
647 | 684 | | |||
648 | case SET_DEC_GUIDE_MODE_COMMAND_RECEIVED: //set_dec_guide_mode | 685 | case SET_DEC_GUIDE_MODE_COMMAND_RECEIVED: //set_dec_guide_mode | ||
649 | checkDEGuideMode(); | 686 | checkDEGuideMode(); | ||
650 | break; | 687 | break; | ||
651 | 688 | | |||
652 | case SET_EXPOSURE_COMMAND_RECEIVED: //set_exposure | 689 | case SET_EXPOSURE_COMMAND_RECEIVED: //set_exposure | ||
653 | requestExposureTime(); //This will check what it was set to and print a message as to what it is. | 690 | requestExposureTime(); //This will check what it was set to and print a message as to what it is. | ||
654 | break; | 691 | break; | ||
655 | 692 | | |||
656 | //set_lock_position | 693 | case SET_LOCK_POSITION: //set_lock_position | ||
694 | break; | ||||
695 | | ||||
657 | //set_lock_shift_enabled | 696 | //set_lock_shift_enabled | ||
658 | //set_lock_shift_params | 697 | //set_lock_shift_params | ||
659 | 698 | | |||
660 | case SET_PAUSED_COMMAND_RECEIVED: //set_paused | 699 | case SET_PAUSED_COMMAND_RECEIVED: //set_paused | ||
661 | break; | 700 | break; | ||
662 | //set_profile | 701 | //set_profile | ||
663 | //shutdown | 702 | //shutdown | ||
664 | 703 | | |||
▲ Show 20 Lines • Show All 154 Lines • ▼ Show 20 Line(s) | |||||
819 | { | 858 | { | ||
820 | if (connection != EQUIPMENT_CONNECTED) | 859 | if (connection != EQUIPMENT_CONNECTED) | ||
821 | { | 860 | { | ||
822 | setConnectedRetries = 0; | 861 | setConnectedRetries = 0; | ||
823 | connection = EQUIPMENT_CONNECTED; | 862 | connection = EQUIPMENT_CONNECTED; | ||
824 | emit newStatus(Ekos::GUIDE_CONNECTED); | 863 | emit newStatus(Ekos::GUIDE_CONNECTED); | ||
825 | updateGuideParameters(); | 864 | updateGuideParameters(); | ||
826 | requestExposureDurations(); | 865 | requestExposureDurations(); | ||
866 | requestCurrentEquipmentUpdate(); | ||||
827 | } | 867 | } | ||
828 | } | 868 | } | ||
829 | 869 | | |||
830 | void PHD2::updateGuideParameters() | 870 | void PHD2::updateGuideParameters() | ||
831 | { | 871 | { | ||
832 | if (pixelScale == 0) | 872 | if (pixelScale == 0) | ||
833 | requestPixelScale(); | 873 | requestPixelScale(); | ||
834 | requestExposureTime(); | 874 | requestExposureTime(); | ||
835 | checkDEGuideMode(); | 875 | checkDEGuideMode(); | ||
836 | } | 876 | } | ||
837 | 877 | | |||
838 | //This section handles the methods/requests sent to PHD2, some are not implemented. | 878 | //This section handles the methods/requests sent to PHD2, some are not implemented. | ||
839 | 879 | | |||
840 | //capture_single_frame | 880 | //capture_single_frame | ||
881 | void PHD2::captureSingleFrame() | ||||
882 | { | ||||
883 | sendPHD2Request("capture_single_frame"); | ||||
884 | } | ||||
841 | 885 | | |||
842 | //clear_calibration | 886 | //clear_calibration | ||
843 | bool PHD2::clearCalibration() | 887 | bool PHD2::clearCalibration() | ||
844 | { | 888 | { | ||
845 | if (connection != EQUIPMENT_CONNECTED) | 889 | if (connection != EQUIPMENT_CONNECTED) | ||
846 | { | 890 | { | ||
847 | emit newLog(i18n("PHD2 Error: Equipment not connected.")); | 891 | emit newLog(i18n("PHD2 Error: Equipment not connected.")); | ||
848 | return false; | 892 | return false; | ||
▲ Show 20 Lines • Show All 77 Lines • ▼ Show 20 Line(s) | |||||
926 | //get_connected | 970 | //get_connected | ||
927 | void PHD2::checkIfEquipmentConnected() | 971 | void PHD2::checkIfEquipmentConnected() | ||
928 | { | 972 | { | ||
929 | sendPHD2Request("get_connected"); | 973 | sendPHD2Request("get_connected"); | ||
930 | } | 974 | } | ||
931 | 975 | | |||
932 | //get_cooler_status | 976 | //get_cooler_status | ||
933 | //get_current_equipment | 977 | //get_current_equipment | ||
978 | void PHD2::requestCurrentEquipmentUpdate() | ||||
979 | { | ||||
980 | sendPHD2Request("get_current_equipment"); | ||||
981 | } | ||||
934 | 982 | | |||
935 | //get_dec_guide_mode | 983 | //get_dec_guide_mode | ||
936 | void PHD2::checkDEGuideMode() | 984 | void PHD2::checkDEGuideMode() | ||
937 | { | 985 | { | ||
938 | sendPHD2Request("get_dec_guide_mode"); | 986 | sendPHD2Request("get_dec_guide_mode"); | ||
939 | } | 987 | } | ||
940 | 988 | | |||
941 | //get_exposure | 989 | //get_exposure | ||
942 | void PHD2::requestExposureTime() | 990 | void PHD2::requestExposureTime() | ||
943 | { | 991 | { | ||
944 | sendPHD2Request("get_exposure"); | 992 | sendPHD2Request("get_exposure"); | ||
945 | } | 993 | } | ||
946 | 994 | | |||
947 | //get_exposure_durations | 995 | //get_exposure_durations | ||
948 | void PHD2::requestExposureDurations() | 996 | void PHD2::requestExposureDurations() | ||
949 | { | 997 | { | ||
950 | sendPHD2Request("get_exposure_durations"); | 998 | sendPHD2Request("get_exposure_durations"); | ||
951 | } | 999 | } | ||
952 | 1000 | | |||
953 | //get_lock_position | 1001 | //get_lock_position | ||
1002 | void PHD2::requestLockPosition() | ||||
1003 | { | ||||
1004 | sendPHD2Request("get_lock_position"); | ||||
1005 | } | ||||
954 | //get_lock_shift_enabled | 1006 | //get_lock_shift_enabled | ||
955 | //get_lock_shift_params | 1007 | //get_lock_shift_params | ||
956 | //get_paused | 1008 | //get_paused | ||
957 | 1009 | | |||
958 | //get_pixel_scale | 1010 | //get_pixel_scale | ||
959 | void PHD2::requestPixelScale() | 1011 | void PHD2::requestPixelScale() | ||
960 | { | 1012 | { | ||
961 | sendPHD2Request("get_pixel_scale"); | 1013 | sendPHD2Request("get_pixel_scale"); | ||
962 | } | 1014 | } | ||
963 | 1015 | | |||
964 | //get_profile | 1016 | //get_profile | ||
965 | //get_profiles | 1017 | //get_profiles | ||
966 | //get_search_region | 1018 | //get_search_region | ||
967 | //get_sensor_temperature | 1019 | //get_sensor_temperature | ||
968 | 1020 | | |||
969 | //get_star_image | 1021 | //get_star_image | ||
970 | void PHD2::requestStarImage(int size) | 1022 | void PHD2::requestStarImage(int size) | ||
971 | { | 1023 | { | ||
972 | // if (!Options::guideRemoteImagesEnabled()) | | |||
973 | // return; | | |||
974 | | ||||
975 | if (starImageRequested) | 1024 | if (starImageRequested) | ||
976 | { | 1025 | { | ||
977 | if (Options::verboseLogging()) | 1026 | if (Options::verboseLogging()) | ||
978 | qCDebug(KSTARS_EKOS_GUIDE) << "PHD2: skip extra star image request"; | 1027 | qCDebug(KSTARS_EKOS_GUIDE) << "PHD2: skip extra star image request"; | ||
979 | return; | 1028 | return; | ||
980 | } | 1029 | } | ||
981 | 1030 | | |||
982 | QJsonArray args2; | 1031 | QJsonArray args2; | ||
Show All 39 Lines | 1042 | { | |||
1022 | 1071 | | |||
1023 | sendPHD2Request("guide", args); | 1072 | sendPHD2Request("guide", args); | ||
1024 | 1073 | | |||
1025 | return true; | 1074 | return true; | ||
1026 | } | 1075 | } | ||
1027 | 1076 | | |||
1028 | //guide_pulse | 1077 | //guide_pulse | ||
1029 | //loop | 1078 | //loop | ||
1079 | void PHD2::loop() | ||||
1080 | { | ||||
1081 | sendPHD2Request("loop"); | ||||
1082 | } | ||||
1030 | //save_image | 1083 | //save_image | ||
1031 | //set_algo_param | 1084 | //set_algo_param | ||
1032 | 1085 | | |||
1033 | //set_connected | 1086 | //set_connected | ||
1034 | void PHD2::connectEquipment(bool enable) | 1087 | void PHD2::connectEquipment(bool enable) | ||
1035 | { | 1088 | { | ||
1036 | if ((connection == EQUIPMENT_CONNECTED && enable == true) || | 1089 | if ((connection == EQUIPMENT_CONNECTED && enable == true) || | ||
1037 | (connection == EQUIPMENT_DISCONNECTED && enable == false)) | 1090 | (connection == EQUIPMENT_DISCONNECTED && enable == false)) | ||
▲ Show 20 Lines • Show All 50 Lines • ▼ Show 20 Line(s) | |||||
1088 | void PHD2::requestSetExposureTime(int time) //Note: time is in milliseconds | 1141 | void PHD2::requestSetExposureTime(int time) //Note: time is in milliseconds | ||
1089 | { | 1142 | { | ||
1090 | QJsonArray args; | 1143 | QJsonArray args; | ||
1091 | args << time; | 1144 | args << time; | ||
1092 | sendPHD2Request("set_exposure", args); | 1145 | sendPHD2Request("set_exposure", args); | ||
1093 | } | 1146 | } | ||
1094 | 1147 | | |||
1095 | //set_lock_position | 1148 | //set_lock_position | ||
1149 | void PHD2::setLockPosition(double x,double y) | ||||
1150 | { | ||||
1151 | // Note: false will mean if a guide star is near the coordinates, it will use that. | ||||
1152 | QJsonArray args; | ||||
1153 | args << x << y << false; | ||||
1154 | sendPHD2Request("set_lock_position", args); | ||||
1155 | } | ||||
1096 | //set_lock_shift_enabled | 1156 | //set_lock_shift_enabled | ||
1097 | //set_lock_shift_params | 1157 | //set_lock_shift_params | ||
1098 | 1158 | | |||
1099 | //set_paused | 1159 | //set_paused | ||
1100 | bool PHD2::suspend() | 1160 | bool PHD2::suspend() | ||
1101 | { | 1161 | { | ||
1102 | if (connection != EQUIPMENT_CONNECTED) | 1162 | if (connection != EQUIPMENT_CONNECTED) | ||
1103 | { | 1163 | { | ||
▲ Show 20 Lines • Show All 168 Lines • Show Last 20 Lines |
Has to be defined here as methodResults[] member, otherwise sendPHD2Request() has an assertion failure when called from PHD2::captureSingleFrame().