12#include "profileinfo.h"
13#include "indi/drivermanager.h"
14#include "indi/indilistener.h"
15#include "auxiliary/ksmessagebox.h"
16#include "ekos/auxiliary/filtermanager.h"
17#include "ekos/auxiliary/opticaltrainmanager.h"
18#include "ekos/auxiliary/profilesettings.h"
19#include "ekos/capture/capture.h"
20#include "ekos/guide/guide.h"
21#include "ekos/mount/mount.h"
22#include "ekos/scheduler/scheduler.h"
23#include "ekos/scheduler/schedulermodulestate.h"
25#include "kstarsdata.h"
26#include "ekos_debug.h"
28#include "skymapcomposite.h"
29#include "catalogobject.h"
30#include "ekos/auxiliary/darklibrary.h"
35#include <KActionCollection>
36#include <basedevice.h>
42 m_Manager(manager), m_NodeManagers(
nodeManagers), m_DSOManager(CatalogsDB::dso_db_path())
48 connect(
nodeManager->message(), &Node::onTextReceived,
this, &Message::onTextReceived);
51 connect(manager, &Ekos::Manager::newModule,
this, &Message::sendModuleState);
55 m_PendingPropertiesTimer.setInterval(500);
58 m_DebouncedSend.setInterval(500);
65void Message::onConnected()
71 qCInfo(
KSTARS_EKOS) <<
"Connected to Message Websocket server at" << node->url().toDisplayString();
73 m_PendingPropertiesTimer.start();
82void Message::onDisconnected()
88 qCInfo(
KSTARS_EKOS) <<
"Disconnected from Message Websocket server at" << node->url().toDisplayString();
90 if (isConnected() ==
false)
92 m_PendingPropertiesTimer.stop();
100void Message::onTextReceived(
const QString &message)
103 if (!node || message.
isEmpty())
106 qCInfo(
KSTARS_EKOS) <<
"Websocket Message" << message;
119 if (command == commands[GET_CONNECTION])
123 else if (command == commands[LOGOUT])
125 emit expired(node->url());
128 else if (command == commands[SET_CLIENT_STATE])
131 if (payload[
"state"].toBool(
false))
133 qCInfo(
KSTARS_EKOS) <<
"EkosLive client is connected.";
136 if (KStarsData::Instance()->clock()->isActive() ==
false)
138 qCInfo(
KSTARS_EKOS) <<
"Resuming and syncing clock.";
139 KStarsData::Instance()->clock()->start();
149 qCInfo(
KSTARS_EKOS) <<
"EkosLive client is disconnected.";
151 if (
KStars::Instance()->isStartedWithClockRunning() ==
false && m_Manager->ekosStatus() == Ekos::CommunicationStatus::Idle)
154 KStarsData::Instance()->clock()->stop();
158 else if (command == commands[GET_DRIVERS])
160 else if (command == commands[GET_PROFILES])
162 else if (command == commands[GET_SCOPES])
164 else if (command == commands[GET_DSLR_LENSES])
166 else if(command == commands[INVOKE_METHOD])
168 auto object = findObject(payload[
"object"].
toString());
170 invokeMethod(
object, payload);
172 else if(command == commands[SET_PROPERTY])
174 auto object = findObject(payload[
"object"].
toString());
176 object->setProperty(payload[
"name"].
toString().toLatin1().constData(), payload[
"value"].toVariant());
178 else if(command == commands[GET_PROPERTY])
180 auto map = QVariantMap();
181 map[
"result"] =
false;
182 auto object = findObject(payload[
"object"].
toString());
185 auto value =
object->property(payload[
"name"].
toString().toLatin1().constData());
188 map[
"result"] =
true;
189 map[
"value"] = value;
195 processScopeCommands(command, payload);
197 processProfileCommands(command, payload);
199 processAstronomyCommands(command, payload);
200 else if (command == commands[DIALOG_GET_RESPONSE])
201 processDialogResponse(payload);
203 processOptionsCommands(command, payload);
205 processSchedulerCommands(command, payload);
207 processDSLRCommands(command, payload);
209 if (m_Manager->getEkosStartingStatus() != Ekos::Success)
212 if (command == commands[GET_STATES])
214 else if (command == commands[GET_STELLARSOLVER_PROFILES])
215 sendStellarSolverProfiles();
216 else if (command == commands[GET_DEVICES])
219 processCaptureCommands(command, payload);
221 processMountCommands(command, payload);
223 processFocusCommands(command, payload);
225 processGuideCommands(command, payload);
227 processAlignCommands(command, payload);
229 processPolarCommands(command, payload);
231 processTrainCommands(command, payload);
233 processFilterManagerCommands(command, payload);
235 processDarkLibraryCommands(command, payload);
237 processDeviceCommands(command, payload);
244bool Message::isConnected()
const
246 return std::any_of(m_NodeManagers.begin(), m_NodeManagers.end(), [](
auto &
nodeManager)
248 return nodeManager->message()->isConnected();
255void Message::sendStellarSolverProfiles()
257 if (m_Manager->getEkosStartingStatus() != Ekos::Success)
262 if (m_Manager->focusModule())
267 if (m_Manager->alignModule())
271 sendResponse(commands[GET_STELLARSOLVER_PROFILES], profiles);
277void Message::sendDrivers()
279 sendResponse(commands[GET_DRIVERS], DriverManager::Instance()->getDriverList());
285void Message::sendDevices()
287 if (m_Manager->getEkosStartingStatus() != Ekos::Success)
296 {
"name",
gd->getDeviceName()},
297 {
"connected",
gd->isConnected()},
298 {
"version",
gd->getDriverVersion()},
299 {
"interface",
static_cast<int>(
gd->getDriverInterface())},
305 sendResponse(commands[GET_DEVICES],
deviceList);
311void Message::sendTrains()
313 if (m_Manager->getEkosStartingStatus() != Ekos::Success)
318 for(
auto &
train :
Ekos::OpticalTrainManager::Instance()->getOpticalTrains())
321 sendResponse(commands[TRAIN_GET_ALL],
trains);
327void Message::sendTrainProfiles()
329 if (m_Manager->getEkosStartingStatus() != Ekos::Success)
332 auto profiles = Ekos::ProfileSettings::Instance()->getSettings();
340void Message::requestOpticalTrains(
bool show)
342 sendResponse(commands[TRAIN_CONFIGURATION_REQUESTED], show);
348void Message::sendScopes()
353 KStarsData::Instance()->userdb()->GetAllScopes(
allScopes);
356 scopeList.append(scope->toJson());
358 sendResponse(commands[GET_SCOPES], scopeList);
364void Message::sendDSLRLenses()
369 KStarsData::Instance()->userdb()->GetAllDSLRLenses(
allDslrLens);
374 sendResponse(commands[GET_DSLR_LENSES],
dslrList);
380void Message::sendTemperature(
double value)
388 {
"name",
oneCCD->getDeviceName()},
389 {
"temperature", value}
392 sendResponse(commands[NEW_CAMERA_STATE], temperature);
399void Message::processCaptureCommands(
const QString &command,
const QJsonObject &payload)
403 if (capture ==
nullptr)
405 qCWarning(
KSTARS_EKOS) <<
"Ignoring command" << command <<
"as capture module is not available";
409 if (command == commands[CAPTURE_PREVIEW])
413 else if (command == commands[CAPTURE_TOGGLE_VIDEO])
415 capture->
setVideoLimits(payload[
"maxBufferSize"].toInt(512), payload[
"maxPreviewFPS"].toInt(10));
418 else if (command == commands[CAPTURE_START])
420 else if (command == commands[CAPTURE_STOP])
422 else if (command == commands[CAPTURE_LOOP])
426 else if (command == commands[CAPTURE_GET_SEQUENCES])
430 else if (command == commands[CAPTURE_ADD_SEQUENCE])
435 else if (command == commands[CAPTURE_REMOVE_SEQUENCE])
437 if (capture->
removeJob(payload[
"index"].toInt()) ==
false)
440 else if (command == commands[CAPTURE_CLEAR_SEQUENCES])
444 else if (command == commands[CAPTURE_SAVE_SEQUENCE_FILE])
449 else if (command == commands[CAPTURE_LOAD_SEQUENCE_FILE])
464 path = payload[
"filepath"].toString();
474 sendResponse(commands[CAPTURE_LOAD_SEQUENCE_FILE],
response);
477 else if (command == commands[CAPTURE_GET_ALL_SETTINGS])
479 sendCaptureSettings(capture->getAllSettings());
481 else if (command == commands[CAPTURE_SET_ALL_SETTINGS])
484 capture->setAllSettings(settings);
485 KSUtils::setGlobalSettings(settings);
487 else if (command == commands[CAPTURE_GENERATE_DARK_FLATS])
498 sendResponse(commands[CAPTURE_GET_SEQUENCES],
sequenceArray);
507 sendResponse(commands[CAPTURE_GET_PREVIEW_LABEL], payload);
513void Message::sendCaptureSettings(
const QVariantMap &settings)
515 m_DebouncedSend.start();
516 m_DebouncedMap[commands[CAPTURE_GET_ALL_SETTINGS]] = settings;
522void Message::sendAlignSettings(
const QVariantMap &settings)
524 m_DebouncedSend.start();
525 m_DebouncedMap[commands[ALIGN_GET_ALL_SETTINGS]] = settings;
531void Message::sendGuideSettings(
const QVariantMap &settings)
533 m_DebouncedSend.start();
534 m_DebouncedMap[commands[GUIDE_GET_ALL_SETTINGS]] = settings;
541void Message::sendFocusSettings(
const QVariantMap &settings)
543 m_DebouncedSend.start();
544 m_DebouncedMap[commands[FOCUS_GET_ALL_SETTINGS]] = settings;
550void Message::sendMountSettings(
const QVariantMap &settings)
552 m_DebouncedSend.start();
553 m_DebouncedMap[commands[MOUNT_GET_ALL_SETTINGS]] = settings;
559void Message::sendDarkLibrarySettings(
const QVariantMap &settings)
561 m_DebouncedSend.start();
562 m_DebouncedMap[commands[DARK_LIBRARY_GET_ALL_SETTINGS]] = settings;
569void Message::sendSchedulerSettings(
const QVariantMap &settings)
571 m_DebouncedSend.start();
572 m_DebouncedMap[commands[SCHEDULER_GET_ALL_SETTINGS]] = settings;
578void Message::dispatchDebounceQueue()
586 m_DebouncedMap.clear();
589 Options::self()->save();
599 if (guide ==
nullptr)
601 qCWarning(
KSTARS_EKOS) <<
"Ignoring command" << command <<
"as guide module is not available";
605 if (command == commands[GUIDE_START])
609 else if (command == commands[GUIDE_CAPTURE])
611 else if (command == commands[GUIDE_LOOP])
613 else if (command == commands[GUIDE_STOP])
615 else if (command == commands[GUIDE_CLEAR])
617 else if (command == commands[GUIDE_SET_ALL_SETTINGS])
620 guide->setAllSettings(settings);
621 KSUtils::setGlobalSettings(settings);
623 else if (command == commands[GUIDE_GET_ALL_SETTINGS])
624 sendGuideSettings(guide->getAllSettings());
625 else if(command == commands[GUIDE_SET_CALIBRATION_SETTINGS])
628 Options::setCalibrationPulseDuration(payload[
"pulse"].toInt());
629 Options::setGuideCalibrationBacklash(payload[
"max_move"].toInt());
630 Options::setTwoAxisEnabled(payload[
"two_axis"].toBool());
631 Options::setGuideAutoSquareSizeEnabled(payload[
"square_size"].toBool());
632 Options::setGuideCalibrationBacklash(payload[
"calibrationBacklash"].toBool());
633 Options::setResetGuideCalibration(payload[
"resetCalibration"].toBool());
634 Options::setReuseGuideCalibration(payload[
"reuseCalibration"].toBool());
635 Options::setReverseDecOnPierSideChange(payload[
"reverseCalibration"].toBool());
636 sendGuideSettings(m_Manager->guideModule()->getAllSettings());
647 if (focus ==
nullptr)
649 qCWarning(
KSTARS_EKOS) <<
"Ignoring command" << command <<
"as focus module is not available";
653 if (command == commands[FOCUS_START])
655 else if (command == commands[FOCUS_CAPTURE])
660 else if (command == commands[FOCUS_STOP])
662 else if (command == commands[FOCUS_RESET])
664 else if (command == commands[FOCUS_IN])
665 focus->
focusIn(payload[
"steps"].toInt());
666 else if (command == commands[FOCUS_OUT])
667 focus->
focusOut(payload[
"steps"].toInt());
668 else if (command == commands[FOCUS_LOOP])
670 else if (command == commands[FOCUS_SET_ALL_SETTINGS])
673 focus->setAllSettings(settings);
674 KSUtils::setGlobalSettings(settings);
677 else if (command == commands[FOCUS_GET_ALL_SETTINGS])
678 sendFocusSettings(focus->getAllSettings());
679 else if (command == commands[FOCUS_SET_CROSSHAIR])
681 double x = payload[
"x"].toDouble();
682 double y = payload[
"y"].toDouble();
694 if (mount ==
nullptr)
696 qCWarning(
KSTARS_EKOS) <<
"Ignoring command" << command <<
"as mount module is not available";
700 if (command == commands[MOUNT_ABORT])
702 else if (command == commands[MOUNT_PARK])
704 else if (command == commands[MOUNT_UNPARK])
706 else if (command == commands[MOUNT_SET_TRACKING])
707 mount->setTrackEnabled(payload[
"enabled"].toBool());
708 else if (command == commands[MOUNT_SYNC_RADE])
710 mount->setJ2000Enabled(payload[
"isJ2000"].toBool());
713 else if (command == commands[MOUNT_SYNC_TARGET])
717 else if (command == commands[MOUNT_GOTO_RADE])
719 mount->setJ2000Enabled(payload[
"isJ2000"].toBool());
722 else if (command == commands[MOUNT_GOTO_TARGET])
726 else if (command == commands[MOUNT_SET_SLEW_RATE])
728 int rate = payload[
"rate"].toInt(-1);
730 mount->setSlewRate(rate);
732 else if (command == commands[MOUNT_SET_ALL_SETTINGS])
735 mount->setAllSettings(settings);
736 KSUtils::setGlobalSettings(settings);
738 else if (command == commands[MOUNT_GET_ALL_SETTINGS])
739 sendMountSettings(
mount->getAllSettings());
740 else if (command == commands[MOUNT_SET_MOTION])
742 QString direction = payload[
"direction"].toString();
743 ISD::Mount::MotionCommand action = payload[
"action"].toBool(
false) ?
744 ISD::Mount::MOTION_START : ISD::Mount::MOTION_STOP;
746 if (direction ==
"N")
747 mount->motionCommand(action, ISD::Mount::MOTION_NORTH, -1);
748 else if (direction ==
"S")
749 mount->motionCommand(action, ISD::Mount::MOTION_SOUTH, -1);
750 else if (direction ==
"E")
751 mount->motionCommand(action, -1, ISD::Mount::MOTION_EAST);
752 else if (direction ==
"W")
753 mount->motionCommand(action, -1, ISD::Mount::MOTION_WEST);
755 else if (command == commands[MOUNT_GOTO_PIXEL])
757 const auto name = payload[
"camera"].toString();
758 const auto xFactor = payload[
"x"].toDouble();
759 const auto yFactor = payload[
"y"].toDouble();
764 if (!camera || camera->getDeviceName() != name)
767 auto primaryChip = camera->getChip(ISD::CameraChip::PRIMARY_CCD);
772 auto imageData = primaryChip->getImageData();
773 if (!imageData || imageData->hasWCS() ==
false)
776 auto x =
xFactor * imageData->width();
777 auto y =
yFactor * imageData->height();
781 if (imageData->pixelToWCS(point,
coord))
790 else if (command == commands[MOUNT_TOGGLE_AUTOPARK])
791 mount->setAutoParkEnabled(payload[
"toggled"].toBool());
801 if (align ==
nullptr)
803 qCWarning(
KSTARS_EKOS) <<
"Ignoring command" << command <<
"as align module is not available";
807 if (command == commands[ALIGN_SOLVE])
811 else if (command == commands[ALIGN_SET_ALL_SETTINGS])
814 align->setAllSettings(settings);
815 KSUtils::setGlobalSettings(settings);
817 else if (command == commands[ALIGN_GET_ALL_SETTINGS])
818 sendAlignSettings(align->getAllSettings());
819 else if(command == commands[ALIGN_SET_ASTROMETRY_SETTINGS])
821 Options::setAstrometryRotatorThreshold(payload[
"threshold"].toInt());
822 Options::setAstrometryUseRotator(payload[
"rotator_control"].toBool());
823 Options::setAstrometryUseImageScale(payload[
"scale"].toBool());
824 Options::setAstrometryUsePosition(payload[
"position"].toBool());
826 else if (command == commands[ALIGN_STOP])
828 else if (command == commands[ALIGN_LOAD_AND_SLEW])
847 else if (command == commands[ALIGN_MANUAL_ROTATOR_TOGGLE])
849 align->toggleManualRotator(payload[
"toggled"].toBool());
858 if (m_Manager->getEkosStartingStatus() != Ekos::Success)
863 {
"status", Ekos::alignStates[
newState]}
866 sendResponse(commands[NEW_ALIGN_STATE], alignState);
872void Message::setAlignSolution(
const QVariantMap &solution)
874 if (m_Manager->getEkosStartingStatus() != Ekos::Success)
882 sendResponse(commands[NEW_ALIGN_STATE], alignState);
888void Message::processSchedulerCommands(
const QString &command,
const QJsonObject &payload)
892 if (command == commands[SCHEDULER_GET_JOBS])
896 else if (command == commands[SCHEDULER_ADD_JOBS])
900 else if(command == commands[SCHEDULER_REMOVE_JOBS])
902 int index = payload[
"index"].toInt();
905 else if(command == commands[SCHEDULER_GET_ALL_SETTINGS])
907 sendSchedulerSettings(
scheduler->getAllSettings());
909 else if(command == commands[SCHEDULER_SET_ALL_SETTINGS])
913 KSUtils::setGlobalSettings(settings);
915 else if (command == commands[SCHEDULER_SAVE_FILE])
920 else if (command == commands[SCHEDULER_LOAD_FILE])
935 path = payload[
"filepath"].toString();
945 sendResponse(commands[SCHEDULER_LOAD_FILE],
response);
948 else if(command == commands[SCHEDULER_START_JOB])
952 else if(command == commands[SCHEDULER_IMPORT_MOSAIC])
957 sendEvent(
i18n(
"Mosaic import failed."), KSNotification::Scheduler, KSNotification::Alert);
972 if (command == commands[PAH_START])
974 paa->startPAHProcess();
976 if (command == commands[PAH_STOP])
978 paa->stopPAHProcess();
980 else if (command == commands[PAH_REFRESH])
982 paa->setPAHRefreshDuration(payload[
"value"].toDouble(1));
983 paa->startPAHRefreshProcess();
985 else if (command == commands[PAH_SET_ALGORITHM])
989 algorithmCombo->setCurrentIndex(
static_cast<Ekos::PolarAlignmentAssistant::RefreshAlgorithm
>(payload[
"value"].toInt(1)));
991 else if (command == commands[PAH_RESET_VIEW])
993 emit resetPolarView();
995 else if (command == commands[PAH_SET_CROSSHAIR])
997 double x = payload[
"x"].toDouble();
998 double y = payload[
"y"].toDouble();
1000 if (m_BoundingRect.isNull() ==
false)
1004 double boundX = x * m_BoundingRect.width();
1005 double boundY = y * m_BoundingRect.height();
1010 x = ((
boundX + m_BoundingRect.x()) / (m_CurrentZoom / 100)) / m_ViewSize.width();
1011 y = ((
boundY + m_BoundingRect.y()) / (m_CurrentZoom / 100)) / m_ViewSize.height();
1015 paa->setPAHCorrectionOffsetPercentage(x, y);
1017 else if (command == commands[PAH_SELECT_STAR_DONE])
1023 else if (command == commands[PAH_REFRESHING_DONE])
1025 paa->stopPAHProcess();
1027 else if (command == commands[PAH_SLEW_DONE])
1029 paa->setPAHSlewDone();
1031 else if (command == commands[PAH_PAH_SET_ZOOM])
1033 double scale = payload[
"scale"].toDouble();
1034 align->setAlignZoom(scale);
1042void Message::setPAHStage(Ekos::PolarAlignmentAssistant::Stage stage)
1044 if (isConnected() ==
false || m_Manager->getEkosStartingStatus() != Ekos::Success)
1057 {
"stage",
paa->getPAHStageString(
false)}
1062 if (stage == Ekos::PolarAlignmentAssistant::PAH_STAR_SELECT)
1063 align->zoomAlignView();
1065 sendResponse(commands[NEW_POLAR_STATE],
polarState);
1071void Message::setPAHMessage(
const QString &message)
1073 if (isConnected() ==
false || m_Manager->getEkosStartingStatus() != Ekos::Success)
1083 sendResponse(commands[NEW_POLAR_STATE],
polarState);
1091 if (isConnected() ==
false || m_Manager->getEkosStartingStatus() != Ekos::Success)
1094 this->correctionVector = correctionVector;
1099 {
"center_x",
center.x()},
1100 {
"center_y",
center.y()},
1101 {
"mag", correctionVector.
length()},
1102 {
"pa", correctionVector.
angle()},
1113 sendResponse(commands[NEW_POLAR_STATE],
polarState);
1119void Message::setUpdatedErrors(
double total,
double az,
double alt)
1121 if (isConnected() ==
false || m_Manager->getEkosStartingStatus() != Ekos::Success)
1126 {
"updatedError",
total},
1127 {
"updatedAZError", az},
1128 {
"updatedALTError", alt}
1131 sendResponse(commands[NEW_POLAR_STATE], error);
1137void Message::setPAHEnabled(
bool enabled)
1139 if (m_Manager->getEkosStartingStatus() != Ekos::Success)
1144 {
"enabled", enabled}
1147 sendResponse(commands[NEW_POLAR_STATE],
polarState);
1153void Message::processProfileCommands(
const QString &command,
const QJsonObject &payload)
1155 if (command == commands[START_PROFILE])
1157 if (m_Manager->getEkosStartingStatus() != Ekos::Idle)
1160 m_Manager->setProfile(payload[
"name"].
toString());
1165 else if (command == commands[STOP_PROFILE])
1172 m_PropertySubscriptions.clear();
1174 else if (command == commands[ADD_PROFILE])
1176 m_Manager->addNamedProfile(payload);
1179 else if (command == commands[UPDATE_PROFILE])
1181 m_Manager->editNamedProfile(payload);
1184 else if (command == commands[GET_PROFILE])
1186 m_Manager->getNamedProfile(payload[
"name"].
toString());
1188 else if (command == commands[DELETE_PROFILE])
1190 m_Manager->deleteNamedProfile(payload[
"name"].
toString());
1193 else if (command == commands[SET_PROFILE_MAPPING])
1195 m_Manager->setProfileMapping(payload);
1197 else if (command == commands[SET_PROFILE_PORT_SELECTION])
1199 requestPortSelection(
false);
1200 m_Manager->acceptPortSelection();
1207void Message::sendProfiles()
1212 if (!m_Manager->getCurrentProfile(profile))
1220 {
"selectedProfile", profile->name},
1223 sendResponse(commands[GET_PROFILES], profiles);
1229void Message::sendSchedulerJobs()
1233 {
"jobs", m_Manager->schedulerModule()->moduleState()->getJSONJobs()}
1235 sendResponse(commands[SCHEDULER_GET_JOBS], jobs);
1247 sendResponse(commands[SCHEDULER_GET_JOBS], jobs);
1253void Message::sendSchedulerStatus(
const QJsonObject &status)
1255 sendResponse(commands[NEW_SCHEDULER_STATE], status);
1262void Message::setEkosStatingStatus(Ekos::CommunicationStatus status)
1264 if (status == Ekos::Pending)
1269 {
"connected",
true},
1270 {
"online",
status == Ekos::Success}
1278void Message::setINDIStatus(Ekos::CommunicationStatus status)
1291void Message::processOptionsCommands(
const QString &command,
const QJsonObject &payload)
1293 if (command == commands[OPTION_SET])
1295 const QJsonArray options = payload[
"options"].toArray();
1299 Options::self()->save();
1300 emit optionsUpdated();
1302 else if (command == commands[OPTION_GET])
1304 const QJsonArray options = payload[
"options"].toArray();
1312 map[
"value"] = value;
1315 sendResponse(commands[OPTION_GET], result);
1322void Message::processScopeCommands(
const QString &command,
const QJsonObject &payload)
1324 if (command == commands[ADD_SCOPE])
1326 KStarsData::Instance()->userdb()->AddScope(payload[
"model"].
toString(), payload[
"vendor"].
toString(),
1327 payload[
"type"].
toString(), payload[
"aperture"].toDouble(), payload[
"focal_length"].toDouble());
1329 else if (command == commands[UPDATE_SCOPE])
1331 KStarsData::Instance()->userdb()->AddScope(payload[
"model"].
toString(), payload[
"vendor"].
toString(),
1332 payload[
"type"].
toString(), payload[
"aperture"].toDouble(), payload[
"focal_length"].toDouble(), payload[
"id"].
toString());
1334 else if (command == commands[DELETE_SCOPE])
1336 KStarsData::Instance()->userdb()->DeleteEquipment(
"telescope", payload[
"id"].
toString());
1347 if (command == commands[DSLR_SET_INFO])
1349 if (m_Manager->captureModule())
1350 m_Manager->captureModule()->addDSLRInfo(
1352 payload[
"width"].toInt(),
1353 payload[
"height"].toInt(),
1354 payload[
"pixelw"].toDouble(),
1355 payload[
"pixelh"].toDouble());
1358 else if(command == commands[DSLR_ADD_LENS])
1360 KStarsData::Instance()->userdb()->AddDSLRLens(payload[
"model"].
toString(), payload[
"vendor"].
toString(),
1361 payload[
"focal_length"].toDouble(), payload[
"focal_ratio"].toDouble());
1363 else if (command == commands[DSLR_DELETE_LENS])
1365 KStarsData::Instance()->userdb()->DeleteEquipment(
"dslrlens", payload[
"id"].
toString());
1367 else if (command == commands[DSLR_UPDATE_LENS])
1369 KStarsData::Instance()->userdb()->AddDSLRLens(payload[
"model"].
toString(), payload[
"vendor"].
toString(),
1370 payload[
"focal_length"].toDouble(), payload[
"focal_ratio"].toDouble(), payload[
"id"].
toString());
1379void Message::processTrainCommands(
const QString &command,
const QJsonObject &payload)
1381 if (command == commands[TRAIN_GET_ALL])
1383 else if (command == commands[TRAIN_GET_PROFILES])
1384 sendTrainProfiles();
1385 else if (command == commands[TRAIN_SET])
1387 auto module = payload["module"].toString();
1388 auto name = payload[
"name"].toString();
1392 if (m_Manager->captureModule())
1393 m_Manager->captureModule()->setOpticalTrain(name);
1395 else if (
module ==
"focus")
1397 if (m_Manager->focusModule())
1398 m_Manager->focusModule()->setOpticalTrain(name);
1400 else if (
module ==
"guide")
1402 if (m_Manager->guideModule())
1403 m_Manager->guideModule()->setOpticalTrain(name);
1405 else if (
module ==
"align")
1407 if (m_Manager->alignModule())
1408 m_Manager->alignModule()->setOpticalTrain(name);
1410 else if (
module ==
"mount")
1412 if (m_Manager->mountModule())
1413 m_Manager->mountModule()->setOpticalTrain(name);
1415 else if (
module ==
"darklibrary")
1417 Ekos::DarkLibrary::Instance()->setOpticalTrain(name);
1420 else if (command == commands[TRAIN_ADD])
1422 Ekos::OpticalTrainManager::Instance()->addOpticalTrain(payload);
1424 else if (command == commands[TRAIN_UPDATE])
1426 Ekos::OpticalTrainManager::Instance()->setOpticalTrain(payload);
1428 else if (command == commands[TRAIN_DELETE])
1430 Ekos::OpticalTrainManager::Instance()->removeOpticalTrain(payload[
"name"].
toString());
1432 else if (command == commands[TRAIN_RESET])
1434 Ekos::OpticalTrainManager::Instance()->reset();
1436 else if (command == commands[TRAIN_ACCEPT])
1438 requestOpticalTrains(
false);
1439 Ekos::OpticalTrainManager::Instance()->accept();
1447void Message::processFilterManagerCommands(
const QString &command,
const QJsonObject &payload)
1450 if (m_Manager->captureModule())
1451 manager = m_Manager->captureModule()->filterManager();
1453 if (manager.isNull())
1456 if (command == commands[FM_GET_DATA])
1459 sendResponse(commands[FM_GET_DATA], data);
1461 else if (command == commands[FM_SET_DATA])
1463 manager->setFilterData(payload);
1470void Message::processDarkLibraryCommands(
const QString &command,
const QJsonObject &payload)
1472 if (command == commands[DARK_LIBRARY_START])
1473 Ekos::DarkLibrary::Instance()->start();
1474 else if(command == commands[DARK_LIBRARY_SET_ALL_SETTINGS])
1477 Ekos::DarkLibrary::Instance()->setAllSettings(settings);
1478 KSUtils::setGlobalSettings(settings);
1480 else if(command == commands[DARK_LIBRARY_GET_ALL_SETTINGS])
1481 sendDarkLibrarySettings(Ekos::DarkLibrary::Instance()->getAllSettings());
1482 else if(command == commands[DARK_LIBRARY_GET_DEFECT_SETTINGS])
1483 sendResponse(commands[DARK_LIBRARY_GET_DEFECT_SETTINGS], Ekos::DarkLibrary::Instance()->getDefectSettings());
1484 else if(command == commands[DARK_LIBRARY_SET_CAMERA_PRESETS])
1486 Ekos::DarkLibrary::Instance()->setCameraPresets(payload);
1488 else if (command == commands[DARK_LIBRARY_STOP])
1490 Ekos::DarkLibrary::Instance()->stop();
1492 else if (command == commands[DARK_LIBRARY_GET_MASTERS_IMAGE])
1494 const int row = payload[
"row"].toInt();
1495 Ekos::DarkLibrary::Instance()->loadIndexInView(row);
1497 else if (command == commands[DARK_LIBRARY_GET_CAMERA_PRESETS])
1499 sendResponse(commands[DARK_LIBRARY_GET_CAMERA_PRESETS], Ekos::DarkLibrary::Instance()->getCameraPresets());
1501 else if (command == commands[DARK_LIBRARY_SET_DEFECT_PIXELS])
1503 Ekos::DarkLibrary::Instance()->setDefectPixels(payload);
1505 else if (command == commands[DARK_LIBRARY_SAVE_MAP])
1507 Ekos::DarkLibrary::Instance()->saveMapB->click();
1509 else if (command == commands[DARK_LIBRARY_SET_DEFECT_FRAME])
1511 Ekos::DarkLibrary::Instance()->setDefectMapEnabled(
false);
1513 else if (command == commands[DARK_LIBRARY_GET_VIEW_MASTERS])
1515 sendResponse(commands[DARK_LIBRARY_GET_VIEW_MASTERS], Ekos::DarkLibrary::Instance()->getViewMasters());
1517 else if (command == commands[DARK_LIBRARY_CLEAR_MASTERS_ROW])
1519 const int rowIndex = payload[
"row"].toInt();
1520 Ekos::DarkLibrary::Instance()->clearRow(rowIndex);
1527void Message::processDeviceCommands(
const QString &command,
const QJsonObject &payload)
1529 QString device = payload[
"device"].toString();
1532 if (device.
isEmpty() && command == commands[DEVICE_PROPERTY_UNSUBSCRIBE])
1534 m_PropertySubscriptions.clear();
1539 if (!INDIListener::findDevice(device,
oneDevice))
1543 if (command == commands[DEVICE_PROPERTY_GET])
1546 if (
oneDevice->getJSONProperty(payload[
"property"].toString(),
propObject, payload[
"compact"].toBool(
true)))
1547 sendResponse(commands[DEVICE_PROPERTY_GET],
propObject);
1550 else if (command == commands[DEVICE_PROPERTY_SET])
1552 oneDevice->setJSONProperty(payload[
"property"].
toString(), payload[
"elements"].toArray());
1555 else if (command == commands[DEVICE_GET])
1571 sendResponse(commands[DEVICE_GET],
response);
1575 else if (command == commands[DEVICE_PROPERTY_SUBSCRIBE])
1578 const QJsonArray groups = payload[
"groups"].toArray();
1582 if (m_PropertySubscriptions.contains(device))
1583 props = m_PropertySubscriptions[device];
1592 else if (groups.
isEmpty() ==
false)
1598 props.insert(
oneProp.getName());
1608 m_PropertySubscriptions[device] = props;
1610 else if (command == commands[DEVICE_PROPERTY_UNSUBSCRIBE])
1613 const QJsonArray groups = payload[
"groups"].toArray();
1617 if (m_PropertySubscriptions.contains(device))
1618 props = m_PropertySubscriptions[device];
1628 else if (groups.
isEmpty() ==
false)
1634 props.remove(
oneProp.getName());
1644 m_PropertySubscriptions[device] = props;
1651void Message::processAstronomyCommands(
const QString &command,
const QJsonObject &payload)
1653 if (command == commands[ASTRO_GET_ALMANC])
1664 {
"SunRise",
almanac.getSunRise()},
1665 {
"SunSet",
almanac.getSunSet()},
1666 {
"SunMaxAlt",
almanac.getSunMaxAlt()},
1667 {
"SunMinAlt",
almanac.getSunMinAlt()},
1668 {
"MoonRise",
almanac.getMoonRise()},
1669 {
"MoonSet",
almanac.getMoonSet()},
1670 {
"MoonPhase",
almanac.getMoonPhase()},
1671 {
"MoonIllum",
almanac.getMoonIllum()},
1672 {
"Dawn",
almanac.getDawnAstronomicalTwilight()},
1673 {
"Dusk",
almanac.getDuskAstronomicalTwilight()},
1677 sendResponse(commands[ASTRO_GET_ALMANC],
response);
1680 else if (command == commands[ASTRO_SEARCH_OBJECTS])
1686 KStarsData::Instance()->clock()->setUTC(
jd);
1691 auto objectType =
static_cast<SkyObject::TYPE>(payload[
"type"].toInt(SkyObject::GALAXY));
1693 auto objectDirection =
static_cast<Direction
>(payload[
"direction"].toInt(All));
1703 auto *data = KStarsData::Instance();
1705 auto *
geo = KStarsData::Instance()->geo();
1708 auto start = KStarsData::Instance()->lt();
1709 auto end = getNextDawn();
1721 case SkyObject::STAR:
1722 case SkyObject::CATALOG_STAR:
1723 allObjects.append(data->skyComposite()->objectLists(SkyObject::STAR));
1724 allObjects.append(data->skyComposite()->objectLists(SkyObject::CATALOG_STAR));
1727 case SkyObject::PLANET:
1728 case SkyObject::MOON:
1729 allObjects.append(data->skyComposite()->objectLists(SkyObject::PLANET));
1730 allObjects.append(data->skyComposite()->objectLists(SkyObject::MOON));
1733 case SkyObject::COMET:
1734 allObjects.append(data->skyComposite()->objectLists(SkyObject::COMET));
1736 case SkyObject::ASTEROID:
1737 allObjects.append(data->skyComposite()->objectLists(SkyObject::ASTEROID));
1740 case SkyObject::OPEN_CLUSTER:
1744 case SkyObject::GLOBULAR_CLUSTER:
1749 case SkyObject::GASEOUS_NEBULA:
1753 case SkyObject::PLANETARY_NEBULA:
1757 case SkyObject::GALAXY:
1761 case SkyObject::SUPERNOVA:
1763 if (!Options::showSupernovae())
1765 Options::setShowSupernovae(
true);
1766 data->setFullTimeUpdate();
1769 allObjects.append(data->skyComposite()->objectLists(SkyObject::SUPERNOVA));
1772 case SkyObject::SATELLITE:
1774 if (!Options::showSatellites())
1776 Options::setShowSatellites(
true);
1777 data->setFullTimeUpdate();
1780 allObjects.append(data->skyComposite()->objectLists(SkyObject::SATELLITE));
1790 return a.second->mag() < b.second->mag();
1828 const double az = (*dsoIterator).recomputeHorizontalCoords(start, geo).az().Degrees();
1829 if (! ((
minAZ.first <= az && az <=
minAZ.second) || (
maxAZ.first <= az && az <=
maxAZ.second)))
1839 const auto az =
objectIterator.next().second->recomputeHorizontalCoords(start, geo).az().Degrees();
1840 if (! ((
minAZ.first <= az && az <=
minAZ.second) || (
maxAZ.first <= az && az <=
maxAZ.second)))
1865 double duration = 0;
1868 dms LST =
geo->GSTtoLST(t.gst());
1869 (*dsoIterator).EquatorialToHorizontal(&LST,
geo->lat());
1886 double duration = 0;
1890 auto LST =
geo->GSTtoLST(t.gst());
1923 sendResponse(commands[ASTRO_SEARCH_OBJECTS],
response);
1925 else if(command == commands[ASTRO_GET_OBJECT_INFO])
1927 const auto name = payload[
"object"].toString();
1929 SkyObject *
oneObject = KStarsData::Instance()->skyComposite()->findByName(name,
false);
1943 sendResponse(commands[ASTRO_GET_OBJECT_INFO], info);
1952 sendResponse(commands[ASTRO_GET_OBJECT_INFO], info );
1957 else if (command == commands[ASTRO_GET_OBJECTS_INFO])
1963 KStarsData::Instance()->clock()->setUTC(
jd);
1967 QVariantList objectNames = payload[
"names"].toArray().toVariantList();
1970 for (
auto &
oneName : objectNames)
1973 SkyObject *
oneObject = KStarsData::Instance()->skyComposite()->findByName(name,
false);
2000 sendResponse(commands[ASTRO_GET_OBJECTS_INFO],
objectsArray);
2003 else if (command == commands[ASTRO_GET_OBJECTS_OBSERVABILITY])
2009 KStarsData::Instance()->clock()->setUTC(
jd);
2013 QVariantList objectNames = payload[
"names"].toArray().toVariantList();
2017 auto *data = KStarsData::Instance();
2019 auto *
geo = KStarsData::Instance()->geo();
2021 auto ut = data->ut();
2023 for (
auto &
oneName : objectNames)
2029 oneObject->EquatorialToHorizontal(data->lst(),
geo->lat());
2030 dms ha(data->lst()->Degrees() -
oneObject->ra().Degrees());
2043 sendResponse(commands[ASTRO_GET_OBJECTS_OBSERVABILITY],
objectsArray);
2045 else if (command == commands[ASTRO_GET_OBJECTS_RISESET])
2051 KStarsData::Instance()->clock()->setUTC(
jd);
2055 QVariantList objectNames = payload[
"names"].toArray().toVariantList();
2059 auto *data = KStarsData::Instance();
2061 auto *
geo = KStarsData::Instance()->geo();
2067 if (data->lt().time().hour() > 12)
2070 for (
auto &
oneName : objectNames)
2093 info[
"name"] =
name;
2103 info[
"rise"] =
"Circumpolar";
2104 info[
"set"] =
"Circumpolar";
2108 info[
"rise"] =
"Never rises";
2109 info[
"set"] =
"Never rises";
2116 for (
double h = -12.0; h <= 12.0; h += 0.5)
2118 double hour = h + (24.0 * DayOffset);
2131 sendResponse(commands[ASTRO_GET_OBJECTS_RISESET],
objectsArray);
2160 sendResponse(commands[DSLR_GET_INFO],
cameraName);
2166void Message::requestPortSelection(
bool show)
2168 sendResponse(commands[GET_PROFILE_PORT_SELECTION], show);
2174void Message::sendDialog(
const QJsonObject &message)
2176 sendResponse(commands[DIALOG_GET_INFO], message);
2186 nodeManager->message()->sendResponse(command, payload);
2197 nodeManager->message()->sendResponse(command, payload);
2204void Message::sendResponse(
const QString &command,
const QString &payload)
2208 nodeManager->message()->sendResponse(command, payload);
2215void Message::sendResponse(
const QString &command,
bool payload)
2219 nodeManager->message()->sendResponse(command, payload);
2226void Message::autofocusAborted()
2230 {
"status",
"Aborted"}
2232 sendResponse(commands[NEW_FOCUS_STATE],
cStatus);
2243 if (m_ThrottleTS.msecsTo(
now) >= THROTTLE_INTERVAL)
2246 sendResponse(commands[NEW_MOUNT_STATE], status);
2250 sendResponse(commands[NEW_MOUNT_STATE], status);
2256void Message::updateCaptureStatus(
const QJsonObject &status)
2258 sendResponse(commands[NEW_CAPTURE_STATE], status);
2264void Message::updateFocusStatus(
const QJsonObject &status)
2266 sendResponse(commands[NEW_FOCUS_STATE], status);
2272void Message::updateGuideStatus(
const QJsonObject &status)
2274 sendResponse(commands[NEW_GUIDE_STATE], status);
2280void Message::updateDomeStatus(
const QJsonObject &status)
2282 sendResponse(commands[NEW_DOME_STATE], status);
2288void Message::updateCapStatus(
const QJsonObject &status)
2290 sendResponse(commands[NEW_CAP_STATE], status);
2296void Message::sendConnection()
2300 {
"connected",
true},
2301 {
"online", m_Manager->getEkosStartingStatus() == Ekos::Success}
2310void Message::sendStates()
2313 if (m_Manager->captureModule())
2315 QJsonObject captureState = {{
"status", getCaptureStatusString(m_Manager->captureModule()->status(),
false)}};
2316 sendResponse(commands[NEW_CAPTURE_STATE],
captureState);
2317 sendCaptureSequence(m_Manager->captureModule()->getSequence());
2320 if (m_Manager->mountModule())
2324 {
"status", m_Manager->mountModule()->statusString(
false)},
2325 {
"target", m_Manager->capturePreview->mountTarget->text()},
2326 {
"slewRate", m_Manager->mountModule()->slewRate()},
2327 {
"pierSide", m_Manager->mountModule()->pierSide()}
2330 sendResponse(commands[NEW_MOUNT_STATE], mountState);
2333 if (m_Manager->focusModule())
2335 QJsonObject focusState = {{
"status", getFocusStatusString(m_Manager->focusModule()->status(),
false)}};
2336 sendResponse(commands[NEW_FOCUS_STATE],
focusState);
2339 if (m_Manager->guideModule())
2341 QJsonObject guideState = {{
"status", getGuideStatusString(m_Manager->guideModule()->status(),
false)}};
2342 sendResponse(commands[NEW_GUIDE_STATE], guideState);
2345 if (m_Manager->alignModule())
2350 {
"status", getAlignStatusString(m_Manager->alignModule()->status(),
false)}
2352 sendResponse(commands[NEW_ALIGN_STATE], alignState);
2355 sendAlignSettings(m_Manager->alignModule()->getAllSettings());
2365 {
"stage",
paa->getPAHStageString(
false)},
2366 {
"enabled",
paa->isEnabled()},
2369 sendResponse(commands[NEW_POLAR_STATE],
polarState);
2377void Message::sendEvent(
const QString &message, KSNotification::EventSource source, KSNotification::EventType event)
2379 if (Options::ekosLiveNotifications() ==
false)
2385 {
"severity",
event},
2386 {
"message", message},
2390 sendResponse(commands[NEW_NOTIFICATION],
newEvent);
2396void Message::sendManualRotatorStatus(
double currentPA,
double targetPA,
double threshold)
2399 sendResponse(commands[ALIGN_MANUAL_ROTATOR_STATUS], request);
2405void Message::setBoundingRect(
QRect rect,
QSize view,
double currentZoom)
2407 m_BoundingRect = rect;
2409 m_CurrentZoom = currentZoom;
2415void Message::processDialogResponse(
const QJsonObject &payload)
2417 KSMessageBox::Instance()->selectResponse(payload[
"button"].
toString());
2423void Message::processNewProperty(INDI::Property
prop)
2428 if (m_Manager->settleStatus() != Ekos::CommunicationStatus::Success)
2433 sendResponse(commands[DEVICE_PROPERTY_ADD],
propObject);
2439void Message::processDeleteProperty(INDI::Property
prop)
2443 {
"device",
prop.getDeviceName()},
2444 {
"name",
prop.getName()}
2447 sendResponse(commands[DEVICE_PROPERTY_REMOVE], payload);
2455 if (Options::ekosLiveNotifications() ==
false)
2461 {
"device", device->getDeviceName()},
2462 {
"message", message}
2465 sendResponse(commands[DEVICE_MESSAGE], payload);
2471void Message::processUpdateProperty(INDI::Property
prop)
2473 if (m_PropertySubscriptions.contains(
prop.getDeviceName()))
2478 m_PendingProperties.remove(
prop);
2479 m_PendingProperties.insert(
prop);
2487void Message::clearPendingProperties()
2489 m_PendingProperties.clear();
2495void Message::sendPendingProperties()
2497 for (
auto &
prop : m_PendingProperties)
2499 if (
prop->isValid())
2503 sendResponse(commands[DEVICE_PROPERTY_GET],
propObject);
2507 m_PendingProperties.clear();
2513void Message::sendModuleState(
const QString &name)
2515 if (name ==
"Capture")
2517 QJsonObject captureState = {{
"status", getCaptureStatusString(m_Manager->captureModule()->status(),
false)}};
2518 sendResponse(commands[NEW_CAPTURE_STATE],
captureState);
2519 sendCaptureSequence(m_Manager->captureModule()->getSequence());
2521 else if (name ==
"Mount")
2525 {
"status", m_Manager->mountStatus->getStatusText()},
2526 {
"target", m_Manager->capturePreview->mountTarget->text()},
2527 {
"slewRate", m_Manager->mountModule()->slewRate()},
2528 {
"pierSide", m_Manager->mountModule()->pierSide()}
2531 sendResponse(commands[NEW_MOUNT_STATE], mountState);
2533 else if (name ==
"Focus")
2535 QJsonObject focusState = {{
"status", getFocusStatusString(m_Manager->focusModule()->status(),
false)}};
2536 sendResponse(commands[NEW_FOCUS_STATE],
focusState);
2538 else if (name ==
"Guide")
2540 QJsonObject guideState = {{
"status", getGuideStatusString(m_Manager->guideModule()->status(),
false)}};
2541 sendResponse(commands[NEW_GUIDE_STATE], guideState);
2543 else if (name ==
"Align")
2548 {
"status", getAlignStatusString(m_Manager->alignModule()->status(),
false)}
2550 sendResponse(commands[NEW_ALIGN_STATE], alignState);
2553 sendAlignSettings(m_Manager->alignModule()->getAllSettings());
2563 {
"stage",
paa->getPAHStageString(
false)},
2564 {
"enabled",
paa->isEnabled()},
2567 sendResponse(commands[NEW_POLAR_STATE],
polarState);
2579 if (name ==
"Manager")
2586 object = INDIListener::Instance()->findChild<
QObject *>(
name);
2604 case QVariant::Type::Int:
2605 types.number_integer = arg.
toInt();
2606 genericArg = Q_ARG(
int, types.number_integer);
2608 case QVariant::Type::UInt:
2609 types.number_unsigned_integer = arg.
toUInt();
2610 genericArg = Q_ARG(uint, types.number_unsigned_integer);
2612 case QVariant::Type::LongLong:
2614 genericArg = Q_ARG(
int, types.number_integer);
2616 case QVariant::Type::ULongLong:
2617 types.number_unsigned_integer = arg.
toULongLong();
2618 genericArg = Q_ARG(uint, types.number_unsigned_integer);
2620 case QVariant::Type::Double:
2621 types.number_double = arg.
toDouble();
2622 genericArg = Q_ARG(
double, types.number_double);
2624 case QVariant::Type::Bool:
2625 types.boolean = arg.
toBool();
2628 case QVariant::Type::String:
2632 case QVariant::Type::Url:
2633 types.url = arg.
toUrl();
2651 auto name = payload[
"name"].toString().toLatin1();
a dms subclass that caches its sine and cosine values every time the angle is changed.
A simple container object to hold the minimum information for a Deep Sky Object to be drawn on the sk...
Align class handles plate-solving and polar alignment measurement and correction using astrometry....
bool loadAndSlew(const QByteArray &image, const QString &extension)
DBUS interface function.
Captures single or sequence of images from a CCD.
bool setVideoLimits(uint16_t maxBufferSize, uint16_t maxPreviewFPS)
setVideoLimits sets the buffer size and max preview fps for live preview
void generateDarkFlats()
generateDarkFlats Generate a list of dark flat jobs from available flat frames.
void startFraming()
startFraming Like captureOne but repeating.
void capturePreview()
capturePreview Capture a single preview image
bool removeJob(int index=-1)
removeJob Remove a job sequence from the queue
SequenceJob * createJob(SequenceJob::SequenceJobType jobtype=SequenceJob::JOBTYPE_BATCH, FilenamePreviewType filenamePreview=NOT_PREVIEW)
createJob Create a new job with the settings given in the GUI.
const QJsonArray & getSequence() const
getSequence Return the JSON representation of the current sequeue queue
Supports manual focusing and auto focusing using relative and absolute INDI focusers.
void startFraming()
startFraming Begins continuous capture of the CCD and calculates HFR every frame.
void selectFocusStarFraction(double x, double y)
selectFocusStarFraction Select the focus star based by fraction of the overall size.
Q_SCRIPTABLE Q_NOREPLY void resetFrame()
DBUS interface function.
Performs calibration and autoguiding using an ST4 port or directly via the INDI driver.
Q_SCRIPTABLE bool capture()
DBUS interface function.
Q_SCRIPTABLE Q_NOREPLY void clearCalibration()
DBUS interface function.
Q_SCRIPTABLE bool abort()
DBUS interface function.
Q_SCRIPTABLE Q_NOREPLY void loop()
DBUS interface function.
Q_SCRIPTABLE bool guide()
DBUS interface function.
Supports controlling INDI telescope devices including setting/retrieving mount properties,...
The PolarAlignmentAssistant class.
The Ekos scheduler is a simple scheduler class to orchestrate automated multi object observation jobs...
INDIListener is responsible for creating ISD::GDInterface generic devices as new devices arrive from ...
Camera class controls an INDI Camera device.
A class that implements methods to find sun rise, sun set, twilight begin / end times,...
Extension of QDateTime for KStars KStarsDateTime can represent the date/time as a Julian Day,...
KStarsDateTime addDays(int nd) const
Modify the Date/Time by adding a number of days.
KStarsDateTime addSecs(double s) const
static KStarsDateTime currentDateTimeUtc()
static KStars * Instance()
Provides all necessary information about an object in the sky: its coordinates, name(s),...
TYPE
The type classification of the SkyObject.
The sky coordinates of a point in the sky.
An angle, stored as degrees, but expressible in many ways.
Q_SCRIPTABLE bool captureAndSolve(bool initialCall=true)
DBUS interface function.
Q_SCRIPTABLE Q_NOREPLY void abort()
DBUS interface function.
Q_SCRIPTABLE Q_NOREPLY void toggleVideo(bool enabled)
DBUS interface function.
Q_SCRIPTABLE bool saveSequenceQueue(const QString &path)
DBUS interface function.
Q_SCRIPTABLE bool loadSequenceQueue(const QString &fileURL, QString targetName="")
DBUS interface function.
Q_SCRIPTABLE Q_NOREPLY void stop(CaptureState targetState=CAPTURE_IDLE)
DBUS interface function.
Q_SCRIPTABLE Q_NOREPLY void start()
DBUS interface function.
Q_SCRIPTABLE Q_NOREPLY void clearSequenceQueue()
DBUS interface function.
Q_SCRIPTABLE Q_NOREPLY void capture(double settleTime=0.0)
DBUS interface function.
Q_SCRIPTABLE bool focusOut(int ms=-1)
DBUS interface function.
Q_SCRIPTABLE Q_NOREPLY void start()
DBUS interface function.
Q_SCRIPTABLE Q_NOREPLY void abort()
DBUS interface function.
Q_SCRIPTABLE bool focusIn(int ms=-1)
DBUS interface function.
QString i18n(const char *text, const TYPE &arg...)
char * toString(const EngineQuery &query)
Generic record interfaces and implementations.
Ekos is an advanced Astrophotography tool for Linux.
KDB_EXPORT void getProperties(const KDbLookupFieldSchema *lookup, QMap< QByteArray, QVariant > *values)
KIOCORE_EXPORT SimpleJob * mount(bool ro, const QByteArray &fstype, const QString &dev, const QString &point, JobFlags flags=DefaultFlags)
GeoCoordinates geo(const QVariant &location)
QString path(const QString &relativePath)
void error(QWidget *parent, const QString &text, const QString &title, const KGuiItem &buttonOk, Options options=Notify)
const QList< QKeySequence > & end()
QString name(StandardShortcut id)
NETWORKMANAGERQT_EXPORT NetworkManager::Status status()
QCA_EXPORT void setProperty(const QString &name, const QVariant &value)
QByteArray fromBase64(const QByteArray &base64, Base64Options options)
QDateTime currentDateTime()
virtual void close() override
qint64 write(const QByteArray &data)
void append(const QJsonValue &value)
QJsonArray fromStringList(const QStringList &list)
bool isEmpty() const const
QVariantList toVariantList() const const
QJsonDocument fromJson(const QByteArray &json, QJsonParseError *error)
bool contains(QLatin1StringView key) const const
QJsonObject fromVariantMap(const QVariantMap &map)
iterator insert(QLatin1StringView key, const QJsonValue &value)
QVariantMap toVariantMap() const const
qreal angle() const const
qreal length() const const
T findChild(const QString &name, Qt::FindChildOptions options) const const
QString arg(Args &&... args) const const
QString asprintf(const char *cformat,...)
QString fromStdString(const std::string &str)
QString fromUtf8(QByteArrayView str)
bool isEmpty() const const
bool startsWith(QChar c, Qt::CaseSensitivity cs) const const
QByteArray toLatin1() const const
QByteArray toUtf8() const const
QTextStream & center(QTextStream &stream)
QFuture< void > map(Iterator begin, Iterator end, MapFunctor &&function)
virtual QString fileName() const const override
void setAutoRemove(bool b)
void setHtml(const QString &html)
QString toPlainText() const const
QFuture< ArgsType< Signal > > connect(Sender *sender, Signal signal)
QUrl fromLocalFile(const QString &localFile)
QString url(FormattingOptions options) const const
QString toString(StringFormat mode) const const
bool toBool() const const
double toDouble(bool *ok) const const
int toInt(bool *ok) const const
qlonglong toLongLong(bool *ok) const const
QString toString() const const
uint toUInt(bool *ok) const const
qulonglong toULongLong(bool *ok) const const