9#include "observatory.h"
10#include "observatoryadaptor.h"
13#include "ekos_observatory_debug.h"
17Observatory::Observatory()
19 qRegisterMetaType<ISD::Weather::Status>(
"ISD::Weather::Status");
20 qDBusRegisterMetaType<ISD::Weather::Status>();
22 new ObservatoryAdaptor(
this);
35 statusReadyButton->setEnabled(
false);
43 weatherWarningSettingsChanged();
51 weatherAlertSettingsChanged();
55 warningActionsActive = Options::warningActionsActive();
56 m_WarningActions.parkDome = Options::weatherWarningCloseDome();
57 m_WarningActions.closeShutter = Options::weatherWarningCloseShutter();
58 m_WarningActions.delay = Options::weatherWarningDelay();
59 alertActionsActive = Options::alertActionsActive();
60 m_AlertActions.parkDome = Options::weatherAlertCloseDome();
61 m_AlertActions.closeShutter = Options::weatherAlertCloseShutter();
62 m_AlertActions.delay = Options::weatherAlertDelay();
63 m_autoScaleValues = Options::weatherAutoScaleValues();
66 m_WarningActions.stopScheduler =
false;
67 m_AlertActions.stopScheduler =
false;
69 warningTimer.
setInterval(
static_cast<int>(m_WarningActions.delay * 1000));
71 alertTimer.
setInterval(
static_cast<int>(m_AlertActions.delay * 1000));
76 execute(m_WarningActions);
80 execute(m_AlertActions);
87 sensorData->setLayout(sensorDataBoxLayout);
97 setAutoScaleValues(checked);
102 weatherWarningStatusLabel->setText(getWarningActionsStatus());
103 weatherAlertStatusLabel->setText(getAlertActionsStatus());
109bool Observatory::setDome(
ISD::Dome *device)
111 if (m_Dome == device)
119 domeBox->setEnabled(
true);
121 connect(m_Dome, &ISD::Dome::Disconnected,
this, &Ekos::Observatory::shutdownDome);
122 connect(m_Dome, &ISD::Dome::newStatus,
this, &Ekos::Observatory::setDomeStatus);
123 connect(m_Dome, &ISD::Dome::newParkStatus,
this, &Ekos::Observatory::setDomeParkStatus);
124 connect(m_Dome, &ISD::Dome::newShutterStatus,
this, &Ekos::Observatory::setShutterStatus);
125 connect(m_Dome, &ISD::Dome::positionChanged,
this, &Ekos::Observatory::domeAzimuthChanged);
126 connect(m_Dome, &ISD::Dome::newAutoSyncStatus,
this, &Ekos::Observatory::showAutoSync);
136 m_Dome->setRelativePosition(relativeMotionSB->value());
146 m_Dome->moveDome(ISD::Dome::DOME_CW, checked ? ISD::Dome::MOTION_START :
ISD::Dome::MOTION_STOP);
150 m_Dome->moveDome(ISD::Dome::DOME_CCW, checked ? ISD::Dome::MOTION_START :
ISD::Dome::MOTION_STOP);
153 if (m_Dome->canPark())
157 domePark->setEnabled(
true);
158 domeUnpark->setEnabled(
true);
162 domePark->setEnabled(
false);
163 domeUnpark->setEnabled(
false);
166 enableMotionControl(
true);
170 SlavingBox->setVisible(
false);
171 domeAzimuthPosition->setText(
i18nc(
"Not Applicable",
"N/A"));
176 domeAzimuthChanged(m_Dome->position());
179 showAutoSync(m_Dome->isAutoSync());
182 enableAutoSync(
true);
186 enableAutoSync(
false);
191 if (m_Dome->hasShutter())
193 shutterBox->setVisible(
true);
194 shutterBox->setEnabled(
true);
197 shutterClosed->setEnabled(
true);
198 shutterOpen->setEnabled(
true);
199 setShutterStatus(m_Dome->shutterStatus());
200 useShutterCB->setVisible(
true);
204 shutterBox->setVisible(
false);
205 weatherWarningShutterCB->setVisible(
false);
206 weatherAlertShutterCB->setVisible(
false);
207 useShutterCB->setVisible(
false);
211 motionAbortButton->setEnabled(
true);
213 statusDefinitionBox->setVisible(
true);
214 statusDefinitionBox->setEnabled(
true);
217 setDomeParkStatus(m_Dome->parkStatus());
220 initWeatherActions(m_Dome && m_WeatherSource);
225void Observatory::shutdownDome()
227 shutterBox->setEnabled(
false);
228 shutterBox->setVisible(
false);
229 domePark->setEnabled(
false);
230 domeUnpark->setEnabled(
false);
231 shutterClosed->setEnabled(
false);
232 shutterOpen->setEnabled(
false);
238 initWeatherActions(
false);
239 statusDefinitionBox->setVisible(
false);
240 domeBox->setEnabled(
false);
243void Observatory::setDomeStatus(ISD::Dome::Status status)
245 qCDebug(KSTARS_EKOS_OBSERVATORY) <<
"Setting dome status to " <<
status;
249 case ISD::Dome::DOME_ERROR:
250 appendLogText(
i18n(
"%1 error. See INDI log for details.",
252 motionCWButton->setChecked(
false);
253 motionCCWButton->setChecked(
false);
256 case ISD::Dome::DOME_IDLE:
257 motionCWButton->setChecked(
false);
258 motionCWButton->setEnabled(
true);
259 motionCCWButton->setChecked(
false);
260 motionCCWButton->setEnabled(
true);
265 case ISD::Dome::DOME_MOVING_CW:
266 motionCWButton->setChecked(
true);
267 motionCWButton->setEnabled(
false);
268 motionCCWButton->setChecked(
false);
269 motionCCWButton->setEnabled(
true);
272 domeAzimuthPosition->setText(
i18n(
"Opening"));
273 toggleButtons(domeUnpark,
i18n(
"Unparking"), domePark,
i18n(
"Park"));
274 appendLogText(
i18n(
"Rolloff roof opening..."));
278 appendLogText(
i18n(
"Dome is moving clockwise..."));
282 case ISD::Dome::DOME_MOVING_CCW:
283 motionCWButton->setChecked(
false);
284 motionCWButton->setEnabled(
true);
285 motionCCWButton->setChecked(
true);
286 motionCCWButton->setEnabled(
false);
289 domeAzimuthPosition->setText(
i18n(
"Closing"));
290 toggleButtons(domePark,
i18n(
"Parking"), domeUnpark,
i18n(
"Unpark"));
291 appendLogText(
i18n(
"Rolloff roof is closing..."));
295 appendLogText(
i18n(
"Dome is moving counter clockwise..."));
299 case ISD::Dome::DOME_PARKED:
300 setDomeParkStatus(ISD::PARK_PARKED);
305 case ISD::Dome::DOME_PARKING:
306 toggleButtons(domePark,
i18n(
"Parking"), domeUnpark,
i18n(
"Unpark"));
307 motionCWButton->setEnabled(
true);
310 domeAzimuthPosition->setText(
i18n(
"Closing"));
312 enableMotionControl(
false);
314 motionCWButton->setChecked(
false);
315 motionCCWButton->setChecked(
true);
320 case ISD::Dome::DOME_UNPARKING:
321 toggleButtons(domeUnpark,
i18n(
"Unparking"), domePark,
i18n(
"Park"));
322 motionCCWButton->setEnabled(
true);
325 domeAzimuthPosition->setText(
i18n(
"Opening"));
327 enableMotionControl(
false);
329 motionCWButton->setChecked(
true);
330 motionCCWButton->setChecked(
false);
335 case ISD::Dome::DOME_TRACKING:
336 enableMotionControl(
true);
337 motionCWButton->setEnabled(
true);
338 motionCCWButton->setChecked(
true);
344void Observatory::setDomeParkStatus(ISD::ParkStatus status)
346 qCDebug(KSTARS_EKOS_OBSERVATORY) <<
"Setting dome park status to " <<
status;
349 case ISD::PARK_UNPARKED:
350 activateButton(domePark,
i18n(
"Park"));
351 buttonPressed(domeUnpark,
i18n(
"Unparked"));
352 motionCWButton->setChecked(
false);
353 motionCWButton->setEnabled(
true);
354 motionCCWButton->setChecked(
false);
357 domeAzimuthPosition->setText(
i18n(
"Open"));
359 enableMotionControl(
true);
362 case ISD::PARK_PARKED:
363 buttonPressed(domePark,
i18n(
"Parked"));
364 activateButton(domeUnpark,
i18n(
"Unpark"));
365 motionCWButton->setChecked(
false);
366 motionCCWButton->setChecked(
false);
367 motionCCWButton->setEnabled(
false);
370 domeAzimuthPosition->setText(
i18n(
"Closed"));
372 enableMotionControl(
false);
381void Observatory::setShutterStatus(ISD::Dome::ShutterStatus status)
383 qCDebug(KSTARS_EKOS_OBSERVATORY) <<
"Setting shutter status to " <<
status;
387 case ISD::Dome::SHUTTER_OPEN:
388 buttonPressed(shutterOpen,
i18n(
"Opened"));
389 activateButton(shutterClosed,
i18n(
"Close"));
390 appendLogText(
i18n(
"Shutter is open."));
393 case ISD::Dome::SHUTTER_OPENING:
394 toggleButtons(shutterOpen,
i18n(
"Opening"), shutterClosed,
i18n(
"Close"));
395 appendLogText(
i18n(
"Shutter is opening..."));
398 case ISD::Dome::SHUTTER_CLOSED:
399 buttonPressed(shutterClosed,
i18n(
"Closed"));
400 activateButton(shutterOpen,
i18n(
"Open"));
401 appendLogText(
i18n(
"Shutter is closed."));
403 case ISD::Dome::SHUTTER_CLOSING:
404 toggleButtons(shutterClosed,
i18n(
"Closing"), shutterOpen,
i18n(
"Open"));
405 appendLogText(
i18n(
"Shutter is closing..."));
412void Observatory::enableWeather(
bool enable)
414 weatherBox->setEnabled(enable);
415 clearGraphHistory->setVisible(enable);
416 clearGraphHistory->setEnabled(enable);
417 autoscaleValuesCB->setVisible(enable);
418 sensorData->setVisible(enable);
419 sensorGraphs->setVisible(enable);
422void Observatory::clearSensorDataHistory()
424 std::map<QString, QVector<QCPGraphData>*>::iterator it;
426 for (it = sensorGraphData.begin(); it != sensorGraphData.end(); ++it)
429 if (graphDataVector->
size() > 0)
433 graphDataVector->
clear();
435 when.setTime_t(
static_cast<uint
>(last.key));
436 updateSensorGraph(it->first, when, last.value);
441 if (!selectedSensorID.
isEmpty())
442 selectedSensorChanged(selectedSensorID);
448 if (m_WeatherSources.
contains(device))
452 for (
auto &oneWeatherSource : m_WeatherSources)
456 auto defaultSource = Options::defaultObservatoryWeatherSource();
457 if (m_WeatherSource ==
nullptr || defaultSource.isEmpty() || device->getDeviceName() == defaultSource)
458 m_WeatherSource = device;
459 m_WeatherSources.
append(device);
461 weatherSourceCombo->blockSignals(
true);
462 weatherSourceCombo->clear();
463 for (
auto &oneSource : m_WeatherSources)
464 weatherSourceCombo->addItem(oneSource->getDeviceName());
465 if (defaultSource.isEmpty())
466 Options::setDefaultObservatoryWeatherSource(weatherSourceCombo->currentText());
468 weatherSourceCombo->setCurrentText(defaultSource);
469 weatherSourceCombo->blockSignals(
false);
474 weatherWarningSchedulerCB->setVisible(
false);
475 weatherAlertSchedulerCB->setVisible(
false);
480void Observatory::enableMotionControl(
bool enabled)
482 MotionBox->setEnabled(
enabled);
485 if (m_Dome->canAbsoluteMove())
487 motionMoveAbsButton->setEnabled(
enabled);
488 absoluteMotionSB->setEnabled(
enabled);
492 motionMoveAbsButton->setEnabled(
false);
493 absoluteMotionSB->setEnabled(
false);
497 if (m_Dome->canRelativeMove())
499 motionMoveRelButton->setEnabled(
enabled);
500 relativeMotionSB->setEnabled(
enabled);
501 motionCWButton->setEnabled(
enabled);
502 motionCCWButton->setEnabled(
enabled);
506 motionMoveRelButton->setEnabled(
false);
507 relativeMotionSB->setEnabled(
false);
508 motionCWButton->setEnabled(
false);
509 motionCCWButton->setEnabled(
false);
515 motionCWButton->setText(
i18n(
"Open"));
516 motionCWButton->setToolTip(
QString());
517 motionCCWButton->setText(
i18n(
"Close"));
518 motionCCWButton->setToolTip(
QString());
519 motionCWButton->setEnabled(
enabled);
520 motionCCWButton->setEnabled(
enabled);
521 motionMoveAbsButton->setVisible(
false);
522 motionMoveRelButton->setVisible(
false);
523 absoluteMotionSB->setVisible(
false);
524 relativeMotionSB->setVisible(
false);
528void Observatory::enableAutoSync(
bool enabled)
530 if (m_Dome ==
nullptr)
539void Observatory::showAutoSync(
bool enabled)
541 slavingEnableButton->setChecked(
enabled);
542 slavingDisableButton->setChecked(!
enabled);
545void Observatory::initWeather()
548 weatherBox->setEnabled(
true);
550 connect(m_WeatherSource, &ISD::Weather::newStatus,
this, &Ekos::Observatory::setWeatherStatus);
551 connect(m_WeatherSource, &ISD::Weather::newData,
this, &Ekos::Observatory::newWeatherData);
552 connect(m_WeatherSource, &ISD::Weather::newData,
this, &Ekos::Observatory::updateSensorData);
553 connect(m_WeatherSource, &ISD::Weather::Disconnected,
this, &Ekos::Observatory::shutdownWeather);
555 autoscaleValuesCB->setChecked(autoScaleValues());
556 weatherWarningBox->setChecked(getWarningActionsActive());
557 weatherAlertBox->setChecked(getAlertActionsActive());
558 setWeatherStatus(m_WeatherSource->status());
559 setWarningActions(getWarningActions());
560 setAlertActions(getAlertActions());
561 initWeatherActions(
true);
562 weatherStatusTimer.
start(1000);
565void Observatory::shutdownWeather()
567 weatherStatusTimer.
stop();
568 setWeatherStatus(ISD::Weather::WEATHER_IDLE);
569 enableWeather(
false);
571 initWeatherActions(
false);
574void Observatory::initWeatherActions(
bool enabled)
576 if (
enabled && m_Dome !=
nullptr && m_Dome->isConnected())
579 weatherActionsBox->setVisible(
true);
580 weatherActionsBox->setEnabled(
true);
583 weatherAlertDomeCB->setEnabled(
true);
584 weatherWarningDomeCB->setEnabled(
true);
587 if (m_Dome->hasShutter())
589 weatherAlertShutterCB->setEnabled(
true);
590 weatherWarningShutterCB->setEnabled(
true);
594 weatherAlertShutterCB->setEnabled(
false);
595 weatherWarningShutterCB->setEnabled(
false);
600 weatherActionsBox->setVisible(
false);
601 weatherActionsBox->setEnabled(
false);
606void Observatory::updateSensorGraph(
const QString &sensor_label,
QDateTime now,
double value)
612 if (sensorGraphData[
id] ==
nullptr)
615 sensorRanges[id] = value > 0 ? 1 : (value < 0 ? -1 : 0);
619 sensorGraphData[id]->append(
QCPGraphData(
static_cast<double>(now.toTime_t()), value));
622 if (selectedSensorID ==
id)
625 if (sensorGraphData[
id]->
size() == 1)
632 sensorGraphs->graph()->addData(sensorGraphData[
id]->last().key, sensorGraphData[id]->last().value);
635 if ((sensorRanges[
id] > 0 && value < 0) || (sensorRanges[id] < 0 && value > 0))
636 sensorRanges[id] = 0;
638 refreshSensorGraph();
642void Observatory::updateSensorData(
const QJsonArray &data)
649 for (
const auto &oneEntry : qAsConst(data))
651 auto label = oneEntry[
"label"].toString();
652 auto value = oneEntry[
"value"].toDouble();
654 auto id = oneEntry[
"label"].toString();
656 if (sensorDataWidgets[
id] ==
nullptr)
661 labelWidget->
setStyleSheet(
"QPushButton:checked\n{\nbackground-color: maroon;\nborder: 1px outset;\nfont-weight:bold;\n}");
672 sensorDataWidgets[id] =
new QPair<QAbstractButton*, QLineEdit*>(labelWidget, valueWidget);
675 sensorDataBoxLayout->
addWidget(valueWidget, sensorDataBoxLayout->
rowCount() - 1, 1);
678 if (!selectedSensorID.
isEmpty() &&
id.indexOf(
'(') > 0 &&
id.indexOf(
'(') <
id.indexOf(
')'))
680 selectedSensorID = id;
684 sensorDataNamesGroup->
addButton(labelWidget);
688 sensorDataWidgets[id]->first->setText(label);
689 sensorDataWidgets[id]->second->setText(
QString().setNum(value,
'f', 2));
693 updateSensorGraph(label, now, value);
699 double key = sensorGraphs->xAxis->pixelToCoord(
event->localPos().x());
704 int index = sensorGraphs->graph(0)->findBegin(key);
705 double value = sensorGraphs->graph(0)->dataMainValue(index);
706 QDateTime when = QDateTime::fromTime_t(sensorGraphs->graph(0)->dataMainKey(index));
710 i18n(
"%1 = %2 @ %3", selectedSensorID, value, when.
toString(
"hh:mm")));
719void Observatory::refreshSensorGraph()
721 sensorGraphs->rescaleAxes();
724 if (autoScaleValues() ==
false)
726 if (sensorRanges[selectedSensorID] > 0)
727 sensorGraphs->yAxis->setRangeLower(0);
728 else if (sensorRanges[selectedSensorID] < 0)
729 sensorGraphs->yAxis->setRangeUpper(0);
732 sensorGraphs->replot();
735void Observatory::selectedSensorChanged(
QString id)
747 selectedSensorID = id;
748 refreshSensorGraph();
752void Observatory::setWeatherStatus(ISD::Weather::Status status)
755 if (status != m_WeatherStatus)
759 case ISD::Weather::WEATHER_OK:
760 label =
"security-high";
761 appendLogText(
i18n(
"Weather is OK"));
765 case ISD::Weather::WEATHER_WARNING:
766 label =
"security-medium";
767 appendLogText(
i18n(
"Weather Warning"));
771 case ISD::Weather::WEATHER_ALERT:
772 label =
"security-low";
773 appendLogText(
i18n(
"Weather Alert"));
784 emit newStatus(m_WeatherStatus);
789 updateSensorData(m_WeatherSource->data());
793void Observatory::initSensorGraphs()
802 sensorGraphs->xAxis->setTickLabelColor(
Qt::white);
803 sensorGraphs->yAxis->setTickLabelColor(
Qt::white);
808 sensorGraphs->xAxis->grid()->setSubGridVisible(
true);
809 sensorGraphs->yAxis->grid()->setSubGridVisible(
true);
810 sensorGraphs->xAxis->grid()->setZeroLinePen(
Qt::NoPen);
811 sensorGraphs->yAxis->grid()->setZeroLinePen(
Qt::NoPen);
819 sensorGraphs->setBackground(plotGradient);
825 sensorGraphs->axisRect()->setBackground(axisRectGradient);
828 dateTicker->setDateTimeFormat(
"hh:mm");
829 dateTicker->setTickCount(2);
830 sensorGraphs->xAxis->setTicker(dateTicker);
837 QCPGraph *graph = sensorGraphs->addGraph();
842 sensorGraphs->yAxis->setRangeLower(0);
857void Observatory::weatherWarningSettingsChanged()
860 actions.parkDome = weatherWarningDomeCB->isChecked();
861 actions.closeShutter = weatherWarningShutterCB->isChecked();
864 actions.delay =
static_cast<unsigned int>(weatherWarningDelaySB->value());
869void Observatory::weatherAlertSettingsChanged()
872 actions.parkDome = weatherAlertDomeCB->isChecked();
873 actions.closeShutter = weatherAlertShutterCB->isChecked();
876 actions.delay =
static_cast<unsigned int>(weatherAlertDelaySB->value());
881void Observatory::domeAzimuthChanged(
double position)
886void Observatory::setWarningActions(WeatherActions actions)
888 if (m_Dome !=
nullptr)
889 weatherWarningDomeCB->setChecked(
actions.parkDome);
891 weatherWarningDomeCB->setChecked(
actions.parkDome);
893 if (m_Dome !=
nullptr && m_Dome->hasShutter())
894 weatherWarningShutterCB->setChecked(
actions.closeShutter);
896 weatherWarningShutterCB->setChecked(
actions.closeShutter);
898 weatherWarningDelaySB->setValue(
static_cast<int>(
actions.delay));
903 Options::setWeatherWarningCloseDome(
actions.parkDome);
904 Options::setWeatherWarningCloseShutter(
actions.closeShutter);
905 Options::setWeatherWarningDelay(
actions.delay);
909 if (m_WeatherSource->status() == ISD::Weather::WEATHER_WARNING)
914void Observatory::setAlertActions(WeatherActions actions)
916 if (m_Dome !=
nullptr)
917 weatherAlertDomeCB->setChecked(
actions.parkDome);
919 weatherAlertDomeCB->setChecked(
false);
921 if (m_Dome !=
nullptr && m_Dome->hasShutter())
922 weatherAlertShutterCB->setChecked(
actions.closeShutter);
924 weatherAlertShutterCB->setChecked(
false);
926 weatherAlertDelaySB->setValue(
static_cast<int>(
actions.delay));
931 Options::setWeatherAlertCloseDome(
actions.parkDome);
932 Options::setWeatherAlertCloseShutter(
actions.closeShutter);
933 Options::setWeatherAlertDelay(
actions.delay);
937 if (m_WeatherSource->status() == ISD::Weather::WEATHER_ALERT)
946 buttonPressed->
setText(titlePressed);
951 buttonCounterpart->
setText(titleCounterpart);
970void Observatory::statusControlSettingsChanged()
972 ObservatoryStatusControl control;
973 control.useDome = useDomeCB->isChecked();
974 control.useShutter = useShutterCB->isChecked();
975 control.useWeather = useWeatherCB->isChecked();
976 setStatusControl(control);
980void Observatory::appendLogText(
const QString &text)
982 m_LogText.
insert(0,
i18nc(
"log entry; %1 is the date, %2 is the text",
"%1 %2",
983 KStarsData::Instance()->lt().
toString(
"yyyy-MM-ddThh:mm:ss"), text));
985 qCInfo(KSTARS_EKOS_OBSERVATORY) << text;
990void Observatory::clearLog()
996void Observatory::setWarningActionsActive(
bool active)
998 warningActionsActive = active;
999 Options::setWarningActionsActive(active);
1002 if (!active && warningTimer.
isActive())
1003 warningTimer.
stop();
1005 else if (m_WeatherSource->status() == ISD::Weather::WEATHER_WARNING)
1006 startWarningTimer();
1009void Observatory::startWarningTimer()
1011 if (warningActionsActive && (m_WarningActions.parkDome || m_WarningActions.closeShutter || m_WarningActions.stopScheduler))
1014 warningTimer.
start();
1017 warningTimer.
stop();
1020void Observatory::setAlertActionsActive(
bool active)
1022 alertActionsActive = active;
1023 Options::setAlertActionsActive(active);
1026 if (!active && alertTimer.
isActive())
1029 else if (m_WeatherSource->status() == ISD::Weather::WEATHER_ALERT)
1033void Observatory::setAutoScaleValues(
bool value)
1035 m_autoScaleValues = value;
1036 Options::setWeatherAutoScaleValues(value);
1039void Observatory::startAlertTimer()
1041 if (alertActionsActive && (m_AlertActions.parkDome || m_AlertActions.closeShutter || m_AlertActions.stopScheduler))
1050QString Observatory::getWarningActionsStatus()
1055 return i18np(
"%1 second remaining",
"%1 seconds remaining", remaining);
1058 return i18n(
"Status: inactive");
1061QString Observatory::getAlertActionsStatus()
1066 return i18np(
"%1 second remaining",
"%1 seconds remaining", remaining);
1069 return i18n(
"Status: inactive");
1072void Observatory::execute(WeatherActions actions)
1077 if (m_Dome->hasShutter() &&
actions.closeShutter)
1078 m_Dome->closeShutter();
1084void Observatory::setStatusControl(ObservatoryStatusControl control)
1086 m_StatusControl = control;
1087 Options::setObservatoryStatusUseDome(control.useDome);
1088 Options::setObservatoryStatusUseShutter(control.useShutter);
1089 Options::setObservatoryStatusUseWeather(control.useWeather);
1094 auto name = deviceRemoved->getDeviceName();
1098 if (m_Dome && m_Dome->getDeviceName() == name)
1105 if (m_WeatherSource && m_WeatherSource->getDeviceName() == name)
1108 m_WeatherSource =
nullptr;
1113 for (
auto &oneSource : m_WeatherSources)
1115 if (oneSource->getDeviceName() == name)
1118 weatherSourceCombo->removeItem(weatherSourceCombo->findText(name));
1123void Observatory::setWeatherSource(
const QString &name)
1125 Options::setDefaultObservatoryWeatherSource(name);
1126 for (
auto &oneWeatherSource : m_WeatherSources)
1128 if (oneWeatherSource->getDeviceName() == name)
1131 if (m_WeatherSource == oneWeatherSource)
1134 if (m_WeatherSource)
1137 m_WeatherSource = oneWeatherSource;
1140 for (
auto &oneWidget : sensorDataWidgets)
1142 auto pair = oneWidget.second;
1145 pair->first->deleteLater();
1146 pair->second->deleteLater();
1148 sensorDataWidgets.clear();
Class handles control of INDI dome devices.
bool isRolloffRoof()
isRolloffRoof Do we have a roll off structure?
Q_SCRIPTABLE bool setPosition(double position)
setPosition Set azimuth absolute position.
Focuser class handles control of INDI Weather devices.
const KStarsDateTime & lt() const
void setBrush(const QBrush &brush)
void setPen(const QPen &pen)
Specialized axis ticker for calendar dates and times as axis ticks.
The generic data container for one-dimensional plottables.
void add(const QCPDataContainer< DataType > &data)
Holds the data of one single data point for QCPGraph.
A plottable representing a graph in a plot.
@ esSpikeArrow
A filled arrow head with an indented back.
Represents the visual appearance of scatter points.
@ ssCircle
\enumimage{ssCircle.png} a circle
@ ssNone
no scatter symbols are drawn (e.g. in QCPGraph, data only represented with lines)
void mouseMove(QMouseEvent *event)
QString i18np(const char *singular, const char *plural, const TYPE &arg...)
QString i18nc(const char *context, const char *text, const TYPE &arg...)
QString i18n(const char *text, const TYPE &arg...)
char * toString(const EngineQuery &query)
Ekos is an advanced Astrophotography tool for Linux.
ISD is a collection of INDI Standard Devices.
QString name(GameStandardAction id)
QString label(StandardShortcut id)
NETWORKMANAGERQT_EXPORT NetworkManager::Status status()
@ iRangeDrag
0x001 Axis ranges are draggable (see QCPAxisRect::setRangeDrag, QCPAxisRect::setRangeDragAxes)
@ iRangeZoom
0x002 Axis ranges are zoomable with the mouse wheel (see QCPAxisRect::setRangeZoom,...
void setText(const QString &text)
void currentTextChanged(const QString &text)
QString toString(QStringView format, QCalendar cal) const const
bool registerObject(const QString &path, QObject *object, RegisterOptions options)
QDBusConnection sessionBus()
void setColorAt(qreal position, const QColor &color)
int rowCount() const const
void clicked(bool checked)
QIcon fromTheme(const QString &name)
void setFinalStop(const QPointF &stop)
void setStart(const QPointF &start)
void setAlignment(Qt::Alignment flag)
void append(QList< T > &&value)
bool contains(const AT &value) const const
iterator insert(const_iterator before, parameter_type value)
qsizetype removeAll(const AT &t)
qsizetype size() const const
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
bool disconnect(const QMetaObject::Connection &connection)
T qobject_cast(QObject *object)
void setObjectName(QAnyStringView name)
bool isEmpty() const const
QString number(double n, char format, int precision)
void setInterval(int msec)
bool isActive() const const
void setSingleShot(bool singleShot)
void showText(const QPoint &pos, const QString &text, QWidget *w, const QRect &rect, int msecDisplayTime)