9#include "observatory.h"
10#include "observatoryadaptor.h"
13#include "ekos_observatory_debug.h"
16#include <QButtonGroup>
20Observatory::Observatory()
22 qRegisterMetaType<ISD::Weather::Status>(
"ISD::Weather::Status");
23 qDBusRegisterMetaType<ISD::Weather::Status>();
25 new ObservatoryAdaptor(
this);
38 statusReadyButton->setEnabled(
false);
46 weatherWarningSettingsChanged();
54 weatherAlertSettingsChanged();
58 warningActionsActive = Options::warningActionsActive();
59 m_WarningActions.parkDome = Options::weatherWarningCloseDome();
60 m_WarningActions.closeShutter = Options::weatherWarningCloseShutter();
61 m_WarningActions.delay = Options::weatherWarningDelay();
62 alertActionsActive = Options::alertActionsActive();
63 m_AlertActions.parkDome = Options::weatherAlertCloseDome();
64 m_AlertActions.closeShutter = Options::weatherAlertCloseShutter();
65 m_AlertActions.delay = Options::weatherAlertDelay();
66 m_autoScaleValues = Options::weatherAutoScaleValues();
69 m_WarningActions.stopScheduler =
false;
70 m_AlertActions.stopScheduler =
false;
72 warningTimer.
setInterval(
static_cast<int>(m_WarningActions.delay * 1000));
74 alertTimer.
setInterval(
static_cast<int>(m_AlertActions.delay * 1000));
79 execute(m_WarningActions);
83 execute(m_AlertActions);
90 sensorData->setLayout(sensorDataBoxLayout);
100 setAutoScaleValues(checked);
101 refreshSensorGraph();
105 weatherWarningStatusLabel->setText(getWarningActionsStatus());
106 weatherAlertStatusLabel->setText(getAlertActionsStatus());
112bool Observatory::setDome(
ISD::Dome *device)
114 if (m_Dome == device)
122 domeBox->setEnabled(
true);
124 connect(m_Dome, &ISD::Dome::Disconnected,
this, &Ekos::Observatory::shutdownDome);
125 connect(m_Dome, &ISD::Dome::newStatus,
this, &Ekos::Observatory::setDomeStatus);
126 connect(m_Dome, &ISD::Dome::newParkStatus,
this, &Ekos::Observatory::setDomeParkStatus);
127 connect(m_Dome, &ISD::Dome::newShutterStatus,
this, &Ekos::Observatory::setShutterStatus);
128 connect(m_Dome, &ISD::Dome::positionChanged,
this, &Ekos::Observatory::domeAzimuthChanged);
129 connect(m_Dome, &ISD::Dome::newAutoSyncStatus,
this, &Ekos::Observatory::showAutoSync);
139 m_Dome->setRelativePosition(relativeMotionSB->value());
149 m_Dome->moveDome(ISD::Dome::DOME_CW, checked ? ISD::Dome::MOTION_START : ISD::Dome::MOTION_STOP);
153 m_Dome->moveDome(ISD::Dome::DOME_CCW, checked ? ISD::Dome::MOTION_START : ISD::Dome::MOTION_STOP);
156 if (m_Dome->canPark())
160 domePark->setEnabled(
true);
161 domeUnpark->setEnabled(
true);
165 domePark->setEnabled(
false);
166 domeUnpark->setEnabled(
false);
169 enableMotionControl(
true);
173 SlavingBox->setVisible(
false);
174 domeAzimuthPosition->setText(
i18nc(
"Not Applicable",
"N/A"));
179 domeAzimuthChanged(m_Dome->position());
182 showAutoSync(m_Dome->isAutoSync());
185 enableAutoSync(
true);
189 enableAutoSync(
false);
194 if (m_Dome->hasShutter())
196 shutterBox->setVisible(
true);
197 shutterBox->setEnabled(
true);
200 shutterClosed->setEnabled(
true);
201 shutterOpen->setEnabled(
true);
202 setShutterStatus(m_Dome->shutterStatus());
203 useShutterCB->setVisible(
true);
207 shutterBox->setVisible(
false);
208 weatherWarningShutterCB->setVisible(
false);
209 weatherAlertShutterCB->setVisible(
false);
210 useShutterCB->setVisible(
false);
214 motionAbortButton->setEnabled(
true);
216 statusDefinitionBox->setVisible(
true);
217 statusDefinitionBox->setEnabled(
true);
220 setDomeParkStatus(m_Dome->parkStatus());
223 initWeatherActions(m_Dome && m_WeatherSource);
228void Observatory::shutdownDome()
230 shutterBox->setEnabled(
false);
231 shutterBox->setVisible(
false);
232 domePark->setEnabled(
false);
233 domeUnpark->setEnabled(
false);
234 shutterClosed->setEnabled(
false);
235 shutterOpen->setEnabled(
false);
241 initWeatherActions(
false);
242 statusDefinitionBox->setVisible(
false);
243 domeBox->setEnabled(
false);
246void Observatory::setDomeStatus(ISD::Dome::Status status)
248 qCDebug(KSTARS_EKOS_OBSERVATORY) <<
"Setting dome status to " <<
status;
252 case ISD::Dome::DOME_ERROR:
253 appendLogText(
i18n(
"%1 error. See INDI log for details.",
255 motionCWButton->setChecked(
false);
256 motionCCWButton->setChecked(
false);
259 case ISD::Dome::DOME_IDLE:
260 motionCWButton->setChecked(
false);
261 motionCWButton->setEnabled(
true);
262 motionCCWButton->setChecked(
false);
263 motionCCWButton->setEnabled(
true);
268 case ISD::Dome::DOME_MOVING_CW:
269 motionCWButton->setChecked(
true);
270 motionCWButton->setEnabled(
false);
271 motionCCWButton->setChecked(
false);
272 motionCCWButton->setEnabled(
true);
275 domeAzimuthPosition->setText(
i18n(
"Opening"));
276 toggleButtons(domeUnpark,
i18n(
"Unparking"), domePark,
i18n(
"Park"));
277 appendLogText(
i18n(
"Rolloff roof opening..."));
281 appendLogText(
i18n(
"Dome is moving clockwise..."));
285 case ISD::Dome::DOME_MOVING_CCW:
286 motionCWButton->setChecked(
false);
287 motionCWButton->setEnabled(
true);
288 motionCCWButton->setChecked(
true);
289 motionCCWButton->setEnabled(
false);
292 domeAzimuthPosition->setText(
i18n(
"Closing"));
293 toggleButtons(domePark,
i18n(
"Parking"), domeUnpark,
i18n(
"Unpark"));
294 appendLogText(
i18n(
"Rolloff roof is closing..."));
298 appendLogText(
i18n(
"Dome is moving counter clockwise..."));
302 case ISD::Dome::DOME_PARKED:
303 setDomeParkStatus(ISD::PARK_PARKED);
308 case ISD::Dome::DOME_PARKING:
309 toggleButtons(domePark,
i18n(
"Parking"), domeUnpark,
i18n(
"Unpark"));
310 motionCWButton->setEnabled(
true);
313 domeAzimuthPosition->setText(
i18n(
"Closing"));
315 enableMotionControl(
false);
317 motionCWButton->setChecked(
false);
318 motionCCWButton->setChecked(
true);
323 case ISD::Dome::DOME_UNPARKING:
324 toggleButtons(domeUnpark,
i18n(
"Unparking"), domePark,
i18n(
"Park"));
325 motionCCWButton->setEnabled(
true);
328 domeAzimuthPosition->setText(
i18n(
"Opening"));
330 enableMotionControl(
false);
332 motionCWButton->setChecked(
true);
333 motionCCWButton->setChecked(
false);
338 case ISD::Dome::DOME_TRACKING:
339 enableMotionControl(
true);
340 motionCWButton->setEnabled(
true);
341 motionCCWButton->setChecked(
true);
347void Observatory::setDomeParkStatus(ISD::ParkStatus status)
349 qCDebug(KSTARS_EKOS_OBSERVATORY) <<
"Setting dome park status to " <<
status;
352 case ISD::PARK_UNPARKED:
353 activateButton(domePark,
i18n(
"Park"));
354 buttonPressed(domeUnpark,
i18n(
"Unparked"));
355 motionCWButton->setChecked(
false);
356 motionCWButton->setEnabled(
true);
357 motionCCWButton->setChecked(
false);
360 domeAzimuthPosition->setText(
i18n(
"Open"));
362 enableMotionControl(
true);
365 case ISD::PARK_PARKED:
366 buttonPressed(domePark,
i18n(
"Parked"));
367 activateButton(domeUnpark,
i18n(
"Unpark"));
368 motionCWButton->setChecked(
false);
369 motionCCWButton->setChecked(
false);
370 motionCCWButton->setEnabled(
false);
373 domeAzimuthPosition->setText(
i18n(
"Closed"));
375 enableMotionControl(
false);
384void Observatory::setShutterStatus(ISD::Dome::ShutterStatus status)
386 qCDebug(KSTARS_EKOS_OBSERVATORY) <<
"Setting shutter status to " <<
status;
390 case ISD::Dome::SHUTTER_OPEN:
391 buttonPressed(shutterOpen,
i18n(
"Opened"));
392 activateButton(shutterClosed,
i18n(
"Close"));
393 appendLogText(
i18n(
"Shutter is open."));
396 case ISD::Dome::SHUTTER_OPENING:
397 toggleButtons(shutterOpen,
i18n(
"Opening"), shutterClosed,
i18n(
"Close"));
398 appendLogText(
i18n(
"Shutter is opening..."));
401 case ISD::Dome::SHUTTER_CLOSED:
402 buttonPressed(shutterClosed,
i18n(
"Closed"));
403 activateButton(shutterOpen,
i18n(
"Open"));
404 appendLogText(
i18n(
"Shutter is closed."));
406 case ISD::Dome::SHUTTER_CLOSING:
407 toggleButtons(shutterClosed,
i18n(
"Closing"), shutterOpen,
i18n(
"Open"));
408 appendLogText(
i18n(
"Shutter is closing..."));
415void Observatory::enableWeather(
bool enable)
417 weatherBox->setEnabled(enable);
418 clearGraphHistory->setVisible(enable);
419 clearGraphHistory->setEnabled(enable);
420 autoscaleValuesCB->setVisible(enable);
421 sensorData->setVisible(enable);
422 sensorGraphs->setVisible(enable);
425void Observatory::clearSensorDataHistory()
427 std::map<QString, QVector<QCPGraphData>*>::iterator it;
429 for (it = sensorGraphData.begin(); it != sensorGraphData.end(); ++it)
432 if (graphDataVector->
size() > 0)
436 graphDataVector->
clear();
439 updateSensorGraph(it->first, when, last.value);
444 if (!selectedSensorID.
isEmpty())
445 selectedSensorChanged(selectedSensorID);
451 if (m_WeatherSources.
contains(device))
455 for (
auto &oneWeatherSource : m_WeatherSources)
456 oneWeatherSource->disconnect(
this);
459 auto defaultSource = Options::defaultObservatoryWeatherSource();
460 if (m_WeatherSource ==
nullptr || defaultSource.isEmpty() || device->getDeviceName() == defaultSource)
461 m_WeatherSource = device;
462 m_WeatherSources.append(device);
465 weatherSourceCombo->clear();
466 for (
auto &oneSource : m_WeatherSources)
467 weatherSourceCombo->addItem(oneSource->getDeviceName());
468 if (defaultSource.isEmpty())
469 Options::setDefaultObservatoryWeatherSource(weatherSourceCombo->currentText());
471 weatherSourceCombo->setCurrentText(defaultSource);
472 weatherSourceCombo->blockSignals(
false);
477 weatherWarningSchedulerCB->setVisible(
false);
478 weatherAlertSchedulerCB->setVisible(
false);
483void Observatory::enableMotionControl(
bool enabled)
485 MotionBox->setEnabled(
enabled);
488 if (m_Dome->canAbsoluteMove())
490 motionMoveAbsButton->setEnabled(
enabled);
491 absoluteMotionSB->setEnabled(
enabled);
495 motionMoveAbsButton->setEnabled(
false);
496 absoluteMotionSB->setEnabled(
false);
500 if (m_Dome->canRelativeMove())
502 motionMoveRelButton->setEnabled(
enabled);
503 relativeMotionSB->setEnabled(
enabled);
504 motionCWButton->setEnabled(
enabled);
505 motionCCWButton->setEnabled(
enabled);
509 motionMoveRelButton->setEnabled(
false);
510 relativeMotionSB->setEnabled(
false);
511 motionCWButton->setEnabled(
false);
512 motionCCWButton->setEnabled(
false);
518 motionCWButton->setText(
i18n(
"Open"));
519 motionCWButton->setToolTip(
QString());
520 motionCCWButton->setText(
i18n(
"Close"));
521 motionCCWButton->setToolTip(
QString());
522 motionCWButton->setEnabled(
enabled);
523 motionCCWButton->setEnabled(
enabled);
524 motionMoveAbsButton->setVisible(
false);
525 motionMoveRelButton->setVisible(
false);
526 absoluteMotionSB->setVisible(
false);
527 relativeMotionSB->setVisible(
false);
531void Observatory::enableAutoSync(
bool enabled)
533 if (m_Dome ==
nullptr)
542void Observatory::showAutoSync(
bool enabled)
544 slavingEnableButton->setChecked(
enabled);
545 slavingDisableButton->setChecked(!
enabled);
548void Observatory::initWeather()
551 weatherBox->setEnabled(
true);
553 connect(m_WeatherSource, &ISD::Weather::newStatus,
this, &Ekos::Observatory::setWeatherStatus);
554 connect(m_WeatherSource, &ISD::Weather::newData,
this, &Ekos::Observatory::newWeatherData);
555 connect(m_WeatherSource, &ISD::Weather::newData,
this, &Ekos::Observatory::updateSensorData);
556 connect(m_WeatherSource, &ISD::Weather::Disconnected,
this, &Ekos::Observatory::shutdownWeather);
558 autoscaleValuesCB->setChecked(autoScaleValues());
559 weatherWarningBox->setChecked(getWarningActionsActive());
560 weatherAlertBox->setChecked(getAlertActionsActive());
561 setWeatherStatus(m_WeatherSource->status());
562 setWarningActions(getWarningActions());
563 setAlertActions(getAlertActions());
564 initWeatherActions(
true);
565 weatherStatusTimer.
start(1000);
568void Observatory::shutdownWeather()
570 weatherStatusTimer.
stop();
571 setWeatherStatus(ISD::Weather::WEATHER_IDLE);
572 enableWeather(
false);
574 initWeatherActions(
false);
577void Observatory::initWeatherActions(
bool enabled)
579 if (
enabled && m_Dome !=
nullptr && m_Dome->isConnected())
582 weatherActionsBox->setVisible(
true);
583 weatherActionsBox->setEnabled(
true);
586 weatherAlertDomeCB->setEnabled(
true);
587 weatherWarningDomeCB->setEnabled(
true);
590 if (m_Dome->hasShutter())
592 weatherAlertShutterCB->setEnabled(
true);
593 weatherWarningShutterCB->setEnabled(
true);
597 weatherAlertShutterCB->setEnabled(
false);
598 weatherWarningShutterCB->setEnabled(
false);
603 weatherActionsBox->setVisible(
false);
604 weatherActionsBox->setEnabled(
false);
609void Observatory::updateSensorGraph(
const QString &sensor_label,
QDateTime now,
double value)
615 if (sensorGraphData[
id] ==
nullptr)
618 sensorRanges[id] = value > 0 ? 1 : (value < 0 ? -1 : 0);
625 if (selectedSensorID ==
id)
628 if (sensorGraphData[
id]->
size() == 1)
635 sensorGraphs->graph()->addData(sensorGraphData[
id]->last().key, sensorGraphData[
id]->last().value);
638 if ((sensorRanges[
id] > 0 && value < 0) || (sensorRanges[
id] < 0 && value > 0))
639 sensorRanges[id] = 0;
641 refreshSensorGraph();
645void Observatory::updateSensorData(
const QJsonArray &data)
652 for (
const auto &oneEntry : std::as_const(data))
655 auto value = oneEntry[
QString(
"value")].toDouble();
657 auto id = oneEntry[
QString(
"label")].toString();
659 if (sensorDataWidgets[
id] ==
nullptr)
664 labelWidget->
setStyleSheet(
"QPushButton:checked\n{\nbackground-color: maroon;\nborder: 1px outset;\nfont-weight:bold;\n}");
675 sensorDataWidgets[id] =
new QPair<QAbstractButton*, QLineEdit*>(labelWidget, valueWidget);
678 sensorDataBoxLayout->
addWidget(valueWidget, sensorDataBoxLayout->
rowCount() - 1, 1);
681 if (!selectedSensorID.
isEmpty() &&
id.indexOf(
'(') > 0 &&
id.indexOf(
'(') <
id.indexOf(
')'))
683 selectedSensorID = id;
687 sensorDataNamesGroup->
addButton(labelWidget);
691 sensorDataWidgets[id]->first->setText(label);
692 sensorDataWidgets[id]->second->setText(
QString().setNum(value,
'f', 2));
696 updateSensorGraph(label, now, value);
702 double key = sensorGraphs->xAxis->pixelToCoord(
event->localPos().x());
707 int index = sensorGraphs->graph(0)->findBegin(key);
708 double value = sensorGraphs->graph(0)->dataMainValue(index);
713 i18n(
"%1 = %2 @ %3", selectedSensorID, value, when.
toString(
"hh:mm")));
722void Observatory::refreshSensorGraph()
724 sensorGraphs->rescaleAxes();
727 if (autoScaleValues() ==
false)
729 if (sensorRanges[selectedSensorID] > 0)
730 sensorGraphs->yAxis->setRangeLower(0);
731 else if (sensorRanges[selectedSensorID] < 0)
732 sensorGraphs->yAxis->setRangeUpper(0);
735 sensorGraphs->replot();
738void Observatory::selectedSensorChanged(
QString id)
750 selectedSensorID = id;
751 refreshSensorGraph();
755void Observatory::setWeatherStatus(ISD::Weather::Status status)
758 if (status != m_WeatherStatus)
762 case ISD::Weather::WEATHER_OK:
763 label =
"security-high";
764 appendLogText(
i18n(
"Weather is OK"));
768 case ISD::Weather::WEATHER_WARNING:
769 label =
"security-medium";
770 appendLogText(
i18n(
"Weather Warning"));
774 case ISD::Weather::WEATHER_ALERT:
775 label =
"security-low";
776 appendLogText(
i18n(
"Weather Alert"));
787 emit newStatus(m_WeatherStatus);
792 updateSensorData(m_WeatherSource->data());
796void Observatory::initSensorGraphs()
805 sensorGraphs->xAxis->setTickLabelColor(
Qt::white);
806 sensorGraphs->yAxis->setTickLabelColor(
Qt::white);
811 sensorGraphs->xAxis->grid()->setSubGridVisible(
true);
812 sensorGraphs->yAxis->grid()->setSubGridVisible(
true);
813 sensorGraphs->xAxis->grid()->setZeroLinePen(
Qt::NoPen);
814 sensorGraphs->yAxis->grid()->setZeroLinePen(
Qt::NoPen);
822 sensorGraphs->setBackground(plotGradient);
828 sensorGraphs->axisRect()->setBackground(axisRectGradient);
831 dateTicker->setDateTimeFormat(
"hh:mm");
832 dateTicker->setTickCount(2);
833 sensorGraphs->xAxis->setTicker(dateTicker);
840 QCPGraph *graph = sensorGraphs->addGraph();
845 sensorGraphs->yAxis->setRangeLower(0);
860void Observatory::weatherWarningSettingsChanged()
863 actions.parkDome = weatherWarningDomeCB->isChecked();
864 actions.closeShutter = weatherWarningShutterCB->isChecked();
867 actions.delay =
static_cast<unsigned int>(weatherWarningDelaySB->value());
872void Observatory::weatherAlertSettingsChanged()
875 actions.parkDome = weatherAlertDomeCB->isChecked();
876 actions.closeShutter = weatherAlertShutterCB->isChecked();
879 actions.delay =
static_cast<unsigned int>(weatherAlertDelaySB->value());
884void Observatory::domeAzimuthChanged(
double position)
889void Observatory::setWarningActions(WeatherActions actions)
891 if (m_Dome !=
nullptr)
892 weatherWarningDomeCB->setChecked(
actions.parkDome);
894 weatherWarningDomeCB->setChecked(
actions.parkDome);
896 if (m_Dome !=
nullptr && m_Dome->hasShutter())
897 weatherWarningShutterCB->setChecked(
actions.closeShutter);
899 weatherWarningShutterCB->setChecked(
actions.closeShutter);
901 weatherWarningDelaySB->setValue(
static_cast<int>(
actions.delay));
906 Options::setWeatherWarningCloseDome(
actions.parkDome);
907 Options::setWeatherWarningCloseShutter(
actions.closeShutter);
908 Options::setWeatherWarningDelay(
actions.delay);
912 if (m_WeatherSource->status() == ISD::Weather::WEATHER_WARNING)
917void Observatory::setAlertActions(WeatherActions actions)
919 if (m_Dome !=
nullptr)
920 weatherAlertDomeCB->setChecked(
actions.parkDome);
922 weatherAlertDomeCB->setChecked(
false);
924 if (m_Dome !=
nullptr && m_Dome->hasShutter())
925 weatherAlertShutterCB->setChecked(
actions.closeShutter);
927 weatherAlertShutterCB->setChecked(
false);
929 weatherAlertDelaySB->setValue(
static_cast<int>(
actions.delay));
934 Options::setWeatherAlertCloseDome(
actions.parkDome);
935 Options::setWeatherAlertCloseShutter(
actions.closeShutter);
936 Options::setWeatherAlertDelay(
actions.delay);
940 if (m_WeatherSource->status() == ISD::Weather::WEATHER_ALERT)
949 buttonPressed->
setText(titlePressed);
954 buttonCounterpart->
setText(titleCounterpart);
973void Observatory::statusControlSettingsChanged()
975 ObservatoryStatusControl control;
976 control.useDome = useDomeCB->isChecked();
977 control.useShutter = useShutterCB->isChecked();
978 control.useWeather = useWeatherCB->isChecked();
979 setStatusControl(control);
983void Observatory::appendLogText(
const QString &text)
985 m_LogText.
insert(0,
i18nc(
"log entry; %1 is the date, %2 is the text",
"%1 %2",
986 KStarsData::Instance()->lt().
toString(
"yyyy-MM-ddThh:mm:ss"), text));
988 qCInfo(KSTARS_EKOS_OBSERVATORY) << text;
993void Observatory::clearLog()
999void Observatory::setWarningActionsActive(
bool active)
1001 warningActionsActive = active;
1002 Options::setWarningActionsActive(active);
1005 if (!active && warningTimer.
isActive())
1006 warningTimer.
stop();
1008 else if (m_WeatherSource->status() == ISD::Weather::WEATHER_WARNING)
1009 startWarningTimer();
1012void Observatory::startWarningTimer()
1014 if (warningActionsActive && (m_WarningActions.parkDome || m_WarningActions.closeShutter || m_WarningActions.stopScheduler))
1017 warningTimer.
start();
1020 warningTimer.
stop();
1023void Observatory::setAlertActionsActive(
bool active)
1025 alertActionsActive = active;
1026 Options::setAlertActionsActive(active);
1029 if (!active && alertTimer.
isActive())
1032 else if (m_WeatherSource->status() == ISD::Weather::WEATHER_ALERT)
1036void Observatory::setAutoScaleValues(
bool value)
1038 m_autoScaleValues = value;
1039 Options::setWeatherAutoScaleValues(value);
1042void Observatory::startAlertTimer()
1044 if (alertActionsActive && (m_AlertActions.parkDome || m_AlertActions.closeShutter || m_AlertActions.stopScheduler))
1053QString Observatory::getWarningActionsStatus()
1058 return i18np(
"%1 second remaining",
"%1 seconds remaining", remaining);
1061 return i18n(
"Status: inactive");
1064QString Observatory::getAlertActionsStatus()
1069 return i18np(
"%1 second remaining",
"%1 seconds remaining", remaining);
1072 return i18n(
"Status: inactive");
1075void Observatory::execute(WeatherActions actions)
1080 if (m_Dome->hasShutter() &&
actions.closeShutter)
1081 m_Dome->closeShutter();
1087void Observatory::setStatusControl(ObservatoryStatusControl control)
1089 m_StatusControl = control;
1090 Options::setObservatoryStatusUseDome(control.useDome);
1091 Options::setObservatoryStatusUseShutter(control.useShutter);
1092 Options::setObservatoryStatusUseWeather(control.useWeather);
1097 auto name = deviceRemoved->getDeviceName();
1101 if (m_Dome && m_Dome->getDeviceName() == name)
1108 if (m_WeatherSource && m_WeatherSource->getDeviceName() == name)
1111 m_WeatherSource =
nullptr;
1116 for (
auto &oneSource : m_WeatherSources)
1118 if (oneSource->getDeviceName() == name)
1120 m_WeatherSources.removeAll(oneSource);
1121 weatherSourceCombo->removeItem(weatherSourceCombo->findText(name));
1126void Observatory::setWeatherSource(
const QString &name)
1128 Options::setDefaultObservatoryWeatherSource(name);
1129 for (
auto &oneWeatherSource : m_WeatherSources)
1131 if (oneWeatherSource->getDeviceName() == name)
1134 if (m_WeatherSource == oneWeatherSource)
1137 if (m_WeatherSource)
1140 m_WeatherSource = oneWeatherSource;
1143 for (
auto &oneWidget : sensorDataWidgets)
1145 auto pair = oneWidget.second;
1148 pair->first->deleteLater();
1149 pair->second->deleteLater();
1151 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.
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)
QDateTime fromSecsSinceEpoch(qint64 secs)
void setSecsSinceEpoch(qint64 secs)
qint64 toSecsSinceEpoch() const const
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)
bool contains(const AT &value) const const
iterator insert(const_iterator before, parameter_type value)
qsizetype size() const const
bool blockSignals(bool block)
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)