\ref DustCapDBusInterface "Dust Cap DBus Interface"
*
* For low level access to INDI devices, the \ref INDIDBusInterface "INDI Dbus Interface" provides complete access to INDI devices and properties.
* Ekos Manager provides a summary of operations progress in the Summary section of the Setup tab.
*
* @author Jasem Mutlaq
* @version 1.7
*/
namespace Ekos
{
class Manager : public QDialog, public Ui::Manager
{
Q_OBJECT
Q_CLASSINFO("D-Bus Interface", "org.kde.kstars.Ekos")
Q_SCRIPTABLE Q_PROPERTY(CommunicationStatus indiStatus READ indiStatus NOTIFY indiStatusChanged)
Q_SCRIPTABLE Q_PROPERTY(CommunicationStatus ekosStatus READ ekosStatus NOTIFY ekosStatusChanged)
Q_SCRIPTABLE Q_PROPERTY(bool ekosLiveStatus READ ekosLiveStatus NOTIFY ekosLiveStatusChanged)
Q_SCRIPTABLE Q_PROPERTY(QStringList logText READ logText NOTIFY newLog)
public:
explicit Manager(QWidget *parent);
~Manager() override;
void appendLogText(const QString &);
//void refreshRemoteDrivers();
void setOptionsWidget(KPageWidgetItem *ops)
{
ekosOptionsWidget = ops;
}
void addObjectToScheduler(SkyObject *object);
Guide *guideModule()
{
return guideProcess.get();
}
Align *alignModule()
{
return alignProcess.get();
}
Mount *mountModule()
{
return mountProcess.get();
}
Focus *focusModule()
{
return focusProcess.get();
}
Dome *domeModule()
{
return domeProcess.get();
}
DustCap *capModule()
{
return dustCapProcess.get();
}
Capture *captureModule()
{
return captureProcess.get();
}
FITSView *getSummaryPreview()
{
return summaryPreview.get();
}
QString getCurrentJobName();
void announceEvent(const QString &message, KSNotification::EventType event);
/**
* @brief addProfile Add a new profile to the database.
* @param profileInfo Collection of profile parameters to include the following:
* 1. name: Profile name
* 2. auto_connect: True of False for Autoconnect?
* 3. Mode: "local" or "remote"
* 4. remote_host: Optional. remote host (default localhost)
* 5. remote_port: Optional. remote port (default 7624)
* 6. guiding: 0 for "Internal", 1 for "PHD2", or 2 for "LinGuider"
* 7. remote_guiding_host: Optional. remote host for guider application (default localhost)
* 8. remote_guide_port: Optional. remote port for guider application.
* 9. use_web_manager: True or False?
* 10. web_manager_port. Optional. INDI Web Manager port (default 8624)
* 12. primary_scope: ID of primary scope to use. This is the ID from OAL::Scope list in the database.
* 13. guide_scope: ID of guide scope to use. This is the ID from OAL::Scope list in the database.
* 14. mount: Mount driver label (default --).
* 15. ccd: CCD driver label (default --).
* 16. guider: Guider driver label (default --).
* 17. focuser: Focuser driver label (default --).
* 18. filter: Filter Wheel driver label (default --).
* 19. ao: Adaptive Optics driver label (default --).
* 20. dome: Dome driver label (default --).
* 21. Weather: Weather station driver label (default --).
* 22. aux1: aux1 driver label (default --).
* 23. aux2: aux2 driver label (default --).
* 24. aux3: aux3 driver label (default --).
* 25. aux4: aux4 driver label (default --).
*/
void addNamedProfile(const QJsonObject &profileInfo);
/** Same as above, except it edits an existing named profile */
void editNamedProfile(const QJsonObject &profileInfo);
/**
* @brief deleteProfile Delete existing equipment profile
* @param name Name of profile
* @warning Ekos must be stopped for this to work. It will fail if Ekos is online.
*/
void deleteNamedProfile(const QString &name);
/**
* @brief getProfile Get a single profile information.
* @param name Profile name
* @return A JSon object with the detail profile info as described in addProfile function.
*/
QJsonObject getNamedProfile(const QString &name);
/**
* DBus commands to manage equipment profiles.
*/
/*@{*/
/**
* DBUS interface function.
* set Current device profile.
* @param profileName Profile name
* @return True if profile is set, false if not found.
*/
Q_SCRIPTABLE bool setProfile(const QString &profileName);
/**
* DBUS interface function
* @brief getProfiles Return a list of all device profiles
* @return List of device profiles
*/
Q_SCRIPTABLE QStringList getProfiles();
/** @}*/
/**
* Manager interface provides advanced scripting capabilities to establish and shutdown Ekos services.
*/
/*@{*/
/**
* DBUS interface function.
* @return INDI connection status (0 Idle, 1 Pending, 2 Connected, 3 Error)
* @deprecated
*/
Q_SCRIPTABLE unsigned int getINDIConnectionStatus()
{
return m_indiStatus;
}
Q_SCRIPTABLE CommunicationStatus indiStatus()
{
return m_indiStatus;
}
/**
* DBUS interface function.
* @return Ekos starting status (0 Idle, 1 Pending, 2 Started, 3 Error)
* @deprecated
*/
Q_SCRIPTABLE unsigned int getEkosStartingStatus()
{
return m_ekosStatus;
}
Q_SCRIPTABLE CommunicationStatus ekosStatus()
{
return m_ekosStatus;
}
/**
* DBUS interface function.
* If connection mode is local, the function first establishes an INDI server with all the specified drivers in Ekos options or as set by the user. For remote connection,
* it establishes connection to the remote INDI server.
* @return Returns true if server started successful (local mode) or connection to remote server is successful (remote mode).
*/
Q_SCRIPTABLE bool start();
/**
* DBUS interface function.
* If connection mode is local, the function terminates the local INDI server and drivers. For remote, it disconnects from the remote INDI server.
*/
Q_SCRIPTABLE bool stop();
Q_SCRIPTABLE QStringList logText()
{
return m_LogText;
}
Q_SCRIPTABLE bool ekosLiveStatus();
/**
* DBUS interface function.
* @param enabled Connect to EkosLive if true, otherwise disconnect.
*/
Q_SCRIPTABLE void setEkosLiveConnected(bool enabled);
/**
* @brief setEkosLiveConfig Set EkosLive settings
* @param onlineService If true, connect to EkosLive Online Service. Otherwise, EkosLive offline service.
* @param rememberCredentials Remember username and password for next session.
* @param autoConnect If true, it will automatically connect to EkosLive service.
*/
Q_SCRIPTABLE void setEkosLiveConfig(bool onlineService, bool rememberCredentials, bool autoConnect);
/**
* @brief setEkosLiveUser Save EkosLive username and password
* @param username User name
* @param password Password
*/
Q_SCRIPTABLE void setEkosLiveUser(const QString &username, const QString &password);
signals:
// Have to use full Ekos::CommunicationStatus for DBus signal to work
void ekosStatusChanged(Ekos::CommunicationStatus status);
void indiStatusChanged(Ekos::CommunicationStatus status);
void ekosLiveStatusChanged(bool status);
void newLog(const QString &text);
void newModule(const QString &name);
protected:
void closeEvent(QCloseEvent *event) override;
void hideEvent(QHideEvent *) override;
void showEvent(QShowEvent *) override;
void resizeEvent(QResizeEvent *) override;
public slots:
/**
* DBUS interface function.
* Connects all the INDI devices started by Ekos.
*/
Q_SCRIPTABLE Q_NOREPLY void connectDevices();
/**
* DBUS interface function.
* Disconnects all the INDI devices started by Ekos.
*/
Q_SCRIPTABLE Q_NOREPLY void disconnectDevices();
/** @}*/
void processINDI();
void cleanDevices(bool stopDrivers = true);
void processNewDevice(ISD::GDInterface *);
void processNewProperty(INDI::Property *);
void processNewNumber(INumberVectorProperty *nvp);
void processNewText(ITextVectorProperty *tvp);
private slots:
void changeAlwaysOnTop(Qt::ApplicationState state);
void showEkosOptions();
void updateLog();
void clearLog();
void processTabChange();
void processServerTermination(const QString &host, const QString &port);
void removeDevice(ISD::GDInterface *);
void deviceConnected();
void deviceDisconnected();
//void processINDIModeChange();
void checkINDITimeout();
// Logs
void updateDebugInterfaces();
void watchDebugProperty(ISwitchVectorProperty *svp);
void setTelescope(ISD::GDInterface *);
void setCCD(ISD::GDInterface *);
void setFilter(ISD::GDInterface *);
void setFocuser(ISD::GDInterface *);
void setDome(ISD::GDInterface *);
void setWeather(ISD::GDInterface *);
void setDustCap(ISD::GDInterface *);
void setLightBox(ISD::GDInterface *);
void setST4(ISD::ST4 *);
// Profiles
void addProfile();
void editProfile();
void deleteProfile();
void wizardProfile();
// Mount Summary
void updateMountCoords(const QString &ra, const QString &dec, const QString &az, const QString &alt);
void updateMountStatus(ISD::Telescope::Status status);
void setTarget(SkyObject *o);
// Capture Summary
void updateCaptureStatus(CaptureState status);
void updateCaptureProgress(SequenceJob *job);
void updateExposureProgress(SequenceJob *job);
void updateCaptureCountDown();
// Focus summary
void setFocusStatus(FocusState status);
void updateFocusStarPixmap(QPixmap &starPixmap);
void updateFocusProfilePixmap(QPixmap &profilePixmap);
void updateCurrentHFR(double newHFR, int position);
// Guide Summary
void updateGuideStatus(GuideState status);
void updateGuideStarPixmap(QPixmap &starPix);
void updateGuideProfilePixmap(QPixmap &profilePix);
void updateSigmas(double ra, double de);
private:
void removeTabs();
void reset();
void initCapture();
void initFocus();
void initGuide();
void initAlign();
void initMount();
void initDome();
void initWeather();
+ void initObservatory(Weather *weather, Dome *dome);
void initDustCap();
void loadDrivers();
void loadProfiles();
/**
* @brief syncActiveDevices Syncs ACTIVE_DEVICES such as ACTIVE_TELESCOPE and ACTIVE_CCD
* to the currently detected devices.
*/
void syncActiveDevices();
// Connect Signals/Slots of Ekos modules
void connectModules();
// Check if INDI server is already running
bool isRunning(const QString &process);
// Find List of devices of specific family type
QList findDevices(DeviceFamily type);
ProfileInfo *getCurrentProfile();
void getCurrentProfileTelescopeInfo(double &primaryFocalLength, double &primaryAperture, double &guideFocalLength, double &guideAperture);
void updateProfileLocation(ProfileInfo *pi);
bool useGuideHead { false };
bool useST4 { false };
// Containers
// All Drivers
QHash driversList;
// All managed drivers
QList managedDrivers;
// All generic devices (i.e. those define by INDI server)
QList genericDevices;
// All Managed devices (ie. those explicitly defined in the profile)
QMap managedDevices;
// Smart pointers for the various Ekos Modules
std::unique_ptr captureProcess;
std::unique_ptr focusProcess;
std::unique_ptr guideProcess;
std::unique_ptr alignProcess;
std::unique_ptr mountProcess;
std::unique_ptr schedulerProcess;
+ std::unique_ptr observatoryProcess;
std::unique_ptr domeProcess;
std::unique_ptr weatherProcess;
std::unique_ptr dustCapProcess;
std::unique_ptr ekosLiveClient;
bool m_LocalMode { true };
bool m_isStarted { false };
bool m_RemoteManagerStart { false };
int nDevices { 0 };
QStringList m_LogText;
KPageWidgetItem *ekosOptionsWidget { nullptr };
CommunicationStatus m_ekosStatus { Ekos::Idle };
CommunicationStatus m_indiStatus { Ekos::Idle };
std::unique_ptr profileModel;
QList> profiles;
// Filter Manager
QSharedPointer filterManager;
// Mount Summary
QProgressIndicator *mountPI { nullptr };
// Capture Summary
QTime imageCountDown;
QTime overallCountDown;
QTime sequenceCountDown;
QTimer countdownTimer;
QProgressIndicator *capturePI { nullptr };
// Preview Frame
std::unique_ptr summaryPreview;
// Focus Summary
QProgressIndicator *focusPI { nullptr };
std::unique_ptr focusStarPixmap;
// Guide Summary
QProgressIndicator *guidePI { nullptr };
std::unique_ptr guideStarPixmap;
ProfileInfo *currentProfile { nullptr };
bool profileWizardLaunched { false };
// Serial Port Assistant
std::unique_ptr serialPortAssistant;
// Logs
QPointer opsLogs;
friend class EkosLive::Client;
friend class EkosLive::Message;
friend class EkosLive::Media;
};
}
diff --git a/kstars/ekos/observatory/observatory.cpp b/kstars/ekos/observatory/observatory.cpp
new file mode 100644
index 000000000..8332703fd
--- /dev/null
+++ b/kstars/ekos/observatory/observatory.cpp
@@ -0,0 +1,375 @@
+/* Ekos Observatory Module
+ Copyright (C) Wolfgang Reissenberger
+
+ This application is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+ */
+
+#include "observatory.h"
+
+#include "ekos_observatory_debug.h"
+
+namespace Ekos
+{
+Observatory::Observatory()
+{
+ setupUi(this);
+
+ // status control
+ mObservatoryModel = new ObservatoryModel();
+ setObseratoryStatusControl(mObservatoryModel->statusControl());
+ // update UI for status control
+ connect(useDomeCB, &QCheckBox::clicked, this, &Ekos::Observatory::statusControlSettingsChanged);
+ connect(useShutterCB, &QCheckBox::clicked, this, &Ekos::Observatory::statusControlSettingsChanged);
+ connect(useWeatherCB, &QCheckBox::clicked, this, &Ekos::Observatory::statusControlSettingsChanged);
+ connect(mObservatoryModel, &Ekos::ObservatoryModel::newStatus, this, &Ekos::Observatory::observatoryStatusChanged);
+ // ready button deactivated
+ // connect(statusReadyButton, &QPushButton::clicked, mObservatoryModel, &Ekos::ObservatoryModel::makeReady);
+ statusReadyButton->setEnabled(false);
+
+ setDomeModel(new ObservatoryDomeModel());
+ setWeatherModel(new ObservatoryWeatherModel());
+ statusDefinitionBox->setVisible(true);
+ statusDefinitionBox->setEnabled(true);
+ // make invisible, since not implemented yet
+ angleLabel->setVisible(false);
+ domeAngleSpinBox->setVisible(false);
+ setDomeAngleButton->setVisible(false);
+ weatherWarningSchedulerCB->setVisible(false);
+ weatherAlertSchedulerCB->setVisible(false);
+}
+
+void Observatory::setObseratoryStatusControl(ObservatoryStatusControl control)
+{
+ if (mObservatoryModel != nullptr)
+ {
+ useDomeCB->setChecked(control.useDome);
+ useShutterCB->setChecked(control.useShutter);
+ useWeatherCB->setChecked(control.useWeather);
+ }
+}
+
+
+void Observatory::setDomeModel(ObservatoryDomeModel *model)
+{
+ mObservatoryModel->setDomeModel(model);
+ if (model != nullptr)
+ {
+ connect(model, &Ekos::ObservatoryDomeModel::ready, this, &Ekos::Observatory::initDome);
+ connect(model, &Ekos::ObservatoryDomeModel::disconnected, this, &Ekos::Observatory::shutdownDome);
+ connect(model, &Ekos::ObservatoryDomeModel::newStatus, this, &Ekos::Observatory::setDomeStatus);
+ connect(model, &Ekos::ObservatoryDomeModel::newShutterStatus, this, &Ekos::Observatory::setShutterStatus);
+
+ connect(weatherWarningShutterCB, &QCheckBox::clicked, this, &Observatory::weatherWarningSettingsChanged);
+ connect(weatherWarningDomeCB, &QCheckBox::clicked, this, &Observatory::weatherWarningSettingsChanged);
+ connect(weatherWarningDelaySB, static_cast(&QSpinBox::valueChanged), [this](int i) { Q_UNUSED(i); weatherWarningSettingsChanged(); });
+
+ connect(weatherAlertShutterCB, &QCheckBox::clicked, this, &Observatory::weatherAlertSettingsChanged);
+ connect(weatherAlertDomeCB, &QCheckBox::clicked, this, &Observatory::weatherAlertSettingsChanged);
+ connect(weatherAlertDelaySB, static_cast(&QSpinBox::valueChanged), [this](int i) { Q_UNUSED(i); weatherAlertSettingsChanged(); });
+ }
+ else
+ {
+ shutdownDome();
+ disconnect(model, &Ekos::ObservatoryDomeModel::newShutterStatus, this, &Ekos::Observatory::setShutterStatus);
+ disconnect(model, &Ekos::ObservatoryDomeModel::newStatus, this, &Ekos::Observatory::setDomeStatus);
+ disconnect(model, &Ekos::ObservatoryDomeModel::ready, this, &Ekos::Observatory::initDome);
+ disconnect(model, &Ekos::ObservatoryDomeModel::disconnected, this, &Ekos::Observatory::shutdownDome);
+
+ disconnect(weatherWarningShutterCB, &QCheckBox::clicked, this, &Observatory::weatherWarningSettingsChanged);
+ disconnect(weatherWarningDomeCB, &QCheckBox::clicked, this, &Observatory::weatherWarningSettingsChanged);
+ connect(weatherWarningDelaySB, static_cast(&QSpinBox::valueChanged), [this](int i) { Q_UNUSED(i); weatherWarningSettingsChanged(); });
+
+ disconnect(weatherAlertShutterCB, &QCheckBox::clicked, this, &Observatory::weatherAlertSettingsChanged);
+ disconnect(weatherAlertDomeCB, &QCheckBox::clicked, this, &Observatory::weatherAlertSettingsChanged);
+ connect(weatherAlertDelaySB, static_cast(&QSpinBox::valueChanged), [this](int i) { Q_UNUSED(i); weatherWarningSettingsChanged(); });
+ }
+}
+
+void Observatory::initDome()
+{
+ domeBox->setEnabled(true);
+
+ if (getDomeModel() != nullptr)
+ {
+ connect(getDomeModel(), &Ekos::ObservatoryDomeModel::newLog, this, &Ekos::Observatory::appendLogText);
+
+ if (getDomeModel()->canPark())
+ {
+ connect(domePark, &QPushButton::clicked, getDomeModel(), &Ekos::ObservatoryDomeModel::park);
+ connect(domeUnpark, &QPushButton::clicked, getDomeModel(), &Ekos::ObservatoryDomeModel::unpark);
+ domePark->setEnabled(true);
+ domeUnpark->setEnabled(true);
+ }
+ else
+ {
+ domePark->setEnabled(false);
+ domeUnpark->setEnabled(false);
+ }
+
+ if (getDomeModel()->hasShutter())
+ {
+ shutterBox->setVisible(true);
+ shutterBox->setEnabled(true);
+ connect(shutterOpen, &QPushButton::clicked, getDomeModel(), &Ekos::ObservatoryDomeModel::openShutter);
+ connect(shutterClosed, &QPushButton::clicked, getDomeModel(), &Ekos::ObservatoryDomeModel::closeShutter);
+ shutterClosed->setEnabled(true);
+ shutterOpen->setEnabled(true);
+ }
+ else
+ {
+ shutterBox->setVisible(false);
+ weatherWarningShutterCB->setVisible(false);
+ weatherAlertShutterCB->setVisible(false);
+ }
+
+ setDomeStatus(getDomeModel()->status());
+ setShutterStatus(getDomeModel()->shutterStatus());
+ }
+
+}
+
+void Observatory::shutdownDome()
+{
+ domeBox->setEnabled(false);
+ shutterBox->setEnabled(false);
+ shutterBox->setVisible(false);
+ domePark->setEnabled(false);
+ domeUnpark->setEnabled(false);
+ shutterClosed->setEnabled(false);
+ shutterOpen->setEnabled(false);
+ angleLabel->setEnabled(false);
+ domeAngleSpinBox->setEnabled(false);
+ setDomeAngleButton->setEnabled(false);
+
+ disconnect(domePark, &QPushButton::clicked, getDomeModel(), &Ekos::ObservatoryDomeModel::park);
+ disconnect(domeUnpark, &QPushButton::clicked, getDomeModel(), &Ekos::ObservatoryDomeModel::unpark);
+}
+
+void Observatory::setDomeStatus(ISD::Dome::Status status)
+{
+ switch (status) {
+ case ISD::Dome::DOME_ERROR:
+ break;
+ case ISD::Dome::DOME_IDLE:
+ domePark->setChecked(false);
+ domePark->setText("PARK");
+ domeUnpark->setChecked(true);
+ domeUnpark->setText("UNPARKED");
+ appendLogText("Dome is unparked.");
+ break;
+ case ISD::Dome::DOME_MOVING:
+ appendLogText("Dome is moving...");
+ break;
+ case ISD::Dome::DOME_PARKED:
+ domePark->setChecked(true);
+ domePark->setText("PARKED");
+ domeUnpark->setChecked(false);
+ domeUnpark->setText("UNPARK");
+ appendLogText("Dome is parked.");
+ break;
+ case ISD::Dome::DOME_PARKING:
+ domePark->setText("PARKING");
+ domeUnpark->setText("UNPARK");
+ appendLogText("Dome is parking...");
+ break;
+ case ISD::Dome::DOME_UNPARKING:
+ domePark->setText("PARK");
+ domeUnpark->setText("UNPARKING");
+ appendLogText("Dome is unparking...");
+ break;
+ case ISD::Dome::DOME_TRACKING:
+ appendLogText("Dome is tracking.");
+ break;
+ default:
+ break;
+ }
+}
+
+
+void Observatory::setShutterStatus(ISD::Dome::ShutterStatus status)
+{
+ switch (status) {
+ case ISD::Dome::SHUTTER_OPEN:
+ shutterOpen->setChecked(true);
+ shutterClosed->setChecked(false);
+ shutterOpen->setText("OPEN");
+ shutterClosed->setText("CLOSE");
+ appendLogText("Shutter is open.");
+ break;
+ case ISD::Dome::SHUTTER_OPENING:
+ shutterOpen->setText("OPENING");
+ shutterClosed->setText("CLOSED");
+ appendLogText("Shutter is opening...");
+ break;
+ case ISD::Dome::SHUTTER_CLOSED:
+ shutterOpen->setChecked(false);
+ shutterClosed->setChecked(true);
+ shutterOpen->setText("OPEN");
+ shutterClosed->setText("CLOSED");
+ appendLogText("Shutter is closed.");
+ break;
+ case ISD::Dome::SHUTTER_CLOSING:
+ shutterOpen->setText("OPEN");
+ shutterClosed->setText("CLOSING");
+ appendLogText("Shutter is closing...");
+ break;
+ default:
+ break;
+ }
+}
+
+
+
+
+void Observatory::setWeatherModel(ObservatoryWeatherModel *model)
+{
+ mObservatoryModel->setWeatherModel(model);
+
+ if (model != nullptr)
+ {
+ connect(weatherWarningBox, &QGroupBox::clicked, model, &ObservatoryWeatherModel::setWarningActionsActive);
+ connect(weatherAlertBox, &QGroupBox::clicked, model, &ObservatoryWeatherModel::setAlertActionsActive);
+
+ connect(model, &Ekos::ObservatoryWeatherModel::ready, this, &Ekos::Observatory::initWeather);
+ connect(model, &Ekos::ObservatoryWeatherModel::newStatus, this, &Ekos::Observatory::setWeatherStatus);
+ connect(model, &Ekos::ObservatoryWeatherModel::disconnected, this, &Ekos::Observatory::shutdownWeather);
+ connect(&weatherStatusTimer, &QTimer::timeout, [this]()
+ {
+ weatherWarningStatusLabel->setText(getWeatherModel()->getWarningActionsStatus());
+ weatherAlertStatusLabel->setText(getWeatherModel()->getAlertActionsStatus());
+ });
+ }
+ else
+ {
+ shutdownWeather();
+ disconnect(model, &Ekos::ObservatoryWeatherModel::newStatus, this, &Ekos::Observatory::setWeatherStatus);
+ disconnect(model, &Ekos::ObservatoryWeatherModel::disconnected, this, &Ekos::Observatory::shutdownWeather);
+ disconnect(model, &Ekos::ObservatoryWeatherModel::ready, this, &Ekos::Observatory::initWeather);
+
+ disconnect(weatherWarningBox, &QGroupBox::clicked, model, &ObservatoryWeatherModel::setWarningActionsActive);
+ disconnect(weatherAlertBox, &QGroupBox::clicked, model, &ObservatoryWeatherModel::setAlertActionsActive);
+ }
+}
+
+void Observatory::initWeather()
+{
+ weatherBox->setEnabled(true);
+ weatherLabel->setEnabled(true);
+ weatherActionsBox->setVisible(true);
+ weatherActionsBox->setEnabled(true);
+ weatherWarningBox->setChecked(getWeatherModel()->getWarningActionsActive());
+ weatherAlertBox->setChecked(getWeatherModel()->getAlertActionsActive());
+ setWeatherStatus(getWeatherModel()->status());
+ setWarningActions(getWeatherModel()->getWarningActions());
+ setAlertActions(getWeatherModel()->getAlertActions());
+ weatherStatusTimer.start(1000);
+}
+
+void Observatory::shutdownWeather()
+{
+ weatherBox->setEnabled(false);
+ weatherLabel->setEnabled(false);
+ setWeatherStatus(ISD::Weather::WEATHER_IDLE);
+ weatherStatusTimer.stop();
+}
+
+
+void Observatory::setWeatherStatus(ISD::Weather::Status status)
+{
+ std::string label;
+ switch (status) {
+ case ISD::Weather::WEATHER_OK:
+ label = "security-high";
+ appendLogText("Weather is OK.");
+ break;
+ case ISD::Weather::WEATHER_WARNING:
+ label = "security-medium";
+ appendLogText("Weather WARNING!");
+ break;
+ case ISD::Weather::WEATHER_ALERT:
+ label = "security-low";
+ appendLogText("!! WEATHER ALERT !!");
+ break;
+ default:
+ label = "";
+ break;
+ }
+
+ weatherStatusLabel->setPixmap(QIcon::fromTheme(label.c_str())
+ .pixmap(QSize(48, 48)));
+}
+
+
+void Observatory::weatherWarningSettingsChanged()
+{
+ struct WeatherActions actions;
+ actions.parkDome = weatherWarningDomeCB->isChecked();
+ actions.closeShutter = weatherWarningShutterCB->isChecked();
+ actions.delay = weatherWarningDelaySB->value();
+
+ getWeatherModel()->setWarningActions(actions);
+}
+
+void Observatory::weatherAlertSettingsChanged()
+{
+ struct WeatherActions actions;
+ actions.parkDome = weatherAlertDomeCB->isChecked();
+ actions.closeShutter = weatherAlertShutterCB->isChecked();
+ actions.delay = weatherAlertDelaySB->value();
+
+ getWeatherModel()->setAlertActions(actions);
+}
+
+void Observatory::observatoryStatusChanged(bool ready)
+{
+ // statusReadyButton->setEnabled(!ready);
+ statusReadyButton->setChecked(ready);
+ emit newStatus(ready);
+}
+
+
+void Observatory::setWarningActions(WeatherActions actions)
+{
+ weatherWarningDomeCB->setChecked(actions.parkDome);
+ weatherWarningShutterCB->setChecked(actions.closeShutter);
+ weatherWarningDelaySB->setValue(actions.delay);
+}
+
+
+void Observatory::setAlertActions(WeatherActions actions)
+{
+ weatherAlertDomeCB->setChecked(actions.parkDome);
+ weatherAlertShutterCB->setChecked(actions.closeShutter);
+ weatherAlertDelaySB->setValue(actions.delay);
+}
+
+void Observatory::statusControlSettingsChanged()
+{
+ ObservatoryStatusControl control;
+ control.useDome = useDomeCB->isChecked();
+ control.useShutter = useShutterCB->isChecked();
+ control.useWeather = useWeatherCB->isChecked();
+ mObservatoryModel->setStatusControl(control);
+}
+
+
+void Observatory::appendLogText(const QString &text)
+{
+ m_LogText.insert(0, i18nc("log entry; %1 is the date, %2 is the text", "%1 %2",
+ QDateTime::currentDateTime().toString("yyyy-MM-ddThh:mm:ss"), text));
+
+ qCInfo(KSTARS_EKOS_OBSERVATORY) << text;
+
+ emit newLog(text);
+}
+
+void Observatory::clearLog()
+{
+ m_LogText.clear();
+ emit newLog(QString());
+}
+
+}
diff --git a/kstars/ekos/observatory/observatory.h b/kstars/ekos/observatory/observatory.h
new file mode 100644
index 000000000..dfb116e85
--- /dev/null
+++ b/kstars/ekos/observatory/observatory.h
@@ -0,0 +1,90 @@
+/* Ekos Observatory Module
+ Copyright (C) Wolfgang Reissenberger
+
+ This application is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+ */
+
+#pragma once
+
+#include "ui_observatory.h"
+#include "observatorymodel.h"
+#include "observatorydomemodel.h"
+#include "observatoryweathermodel.h"
+#include "indiweather.h"
+
+#include
+#include
+#include "klocalizedstring.h"
+
+
+namespace Ekos
+{
+
+class Observatory : public QWidget, public Ui::Observatory
+{
+ Q_OBJECT
+ Q_CLASSINFO("D-Bus Interface", "org.kde.kstars.Ekos.Observatory")
+ Q_PROPERTY(QStringList logText READ logText NOTIFY newLog)
+
+public:
+ Observatory();
+ ObservatoryDomeModel *getDomeModel() { return mObservatoryModel->getDomeModel(); }
+ ObservatoryWeatherModel *getWeatherModel() { return mObservatoryModel->getWeatherModel(); }
+
+ // Logging
+ QStringList logText() { return m_LogText; }
+ QString getLogText() { return m_LogText.join("\n"); }
+
+signals:
+ Q_SCRIPTABLE void newLog(const QString &text);
+
+ /**
+ * @brief Signal a new observatory status
+ */
+ Q_SCRIPTABLE void newStatus(bool isReady);
+
+private:
+ ObservatoryModel *mObservatoryModel = nullptr;
+
+ void setDomeModel(ObservatoryDomeModel *model);
+ void setWeatherModel(ObservatoryWeatherModel *model);
+
+ // Logging
+ QStringList m_LogText;
+ void appendLogText(const QString &);
+ void clearLog();
+
+ // timer for refreshing the observatory status
+ QTimer weatherStatusTimer;
+
+ // reacting on weather changes
+ void setWarningActions(WeatherActions actions);
+ void setAlertActions(WeatherActions actions);
+
+private slots:
+ // observatory status handling
+ void setObseratoryStatusControl(ObservatoryStatusControl control);
+ void statusControlSettingsChanged();
+
+ void initWeather();
+ void shutdownWeather();
+ void setWeatherStatus(ISD::Weather::Status status);
+
+
+ // reacting on weather changes
+ void weatherWarningSettingsChanged();
+ void weatherAlertSettingsChanged();
+
+ // reacting on observatory status changes
+ void observatoryStatusChanged(bool ready);
+
+ void initDome();
+ void shutdownDome();
+
+ void setDomeStatus(ISD::Dome::Status status);
+ void setShutterStatus(ISD::Dome::ShutterStatus status);
+};
+}
diff --git a/kstars/ekos/observatory/observatory.ui b/kstars/ekos/observatory/observatory.ui
new file mode 100644
index 000000000..cc4b3151f
--- /dev/null
+++ b/kstars/ekos/observatory/observatory.ui
@@ -0,0 +1,649 @@
+
+
+ Observatory
+
+
+
+ 0
+ 0
+ 904
+ 536
+
+
+
+ Observatory
+
+
+ Status of the Observatory
+
+
+
+
+
+ false
+
+
+ Observatory Status
+
+
+
+ 6
+
+
+
+
+ <html><head/><body><p>If selected, the shutter needs to be open for the observatory status being "READY".</p></body></html>
+
+
+ Shutter
+
+
+
+
+
+
+ <html><head/><body><p>If selected, the weather needs to be OK for the observatory status being "READY".</p></body></html>
+
+
+ Weather
+
+
+
+
+
+
+ <html><head/><body><p>If selected, the dome needs to be unparked for the observatory status being "READY".</p></body></html>
+
+
+ Dome
+
+
+
+
+
+
+ false
+
+
+
+ 96
+ 36
+
+
+
+
+ 72
+ 36
+
+
+
+ <html><head/><body><p>Close the shutter of the dome. For advanced control of the dome please use the INDI tab.</p></body></html>
+
+
+ QPushButton:checked
+{
+background-color: maroon;
+border: 1px outset;
+font-weight:bold;
+}
+
+
+ READY
+
+
+
+ 32
+ 16
+
+
+
+ true
+
+
+ false
+
+
+
+
+
+
+
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+
+
+
+ false
+
+
+ Dome
+
+
+
+
+
+ false
+
+
+
+ 96
+ 36
+
+
+
+
+ 96
+ 36
+
+
+
+ <html><head/><body><p>Park the dome. For advanced control of the dome please use the INDI tab.</p></body></html>
+
+
+ QPushButton:checked
+{
+background-color: maroon;
+border: 1px outset;
+font-weight:bold;
+}
+
+
+ PARK
+
+
+
+ 32
+ 16
+
+
+
+ true
+
+
+
+
+
+
+ false
+
+
+
+ 96
+ 36
+
+
+
+
+ 96
+ 36
+
+
+
+ <html><head/><body><p>Unpark the dome. For advanced control of the dome please use the INDI tab.</p></body></html>
+
+
+ QPushButton:checked
+{
+background-color: maroon;
+border: 1px outset;
+font-weight:bold;
+}
+
+
+ UNPARKED
+
+
+ true
+
+
+ false
+
+
+
+
+
+
+
+
+ false
+
+
+ Angle
+
+
+
+
+
+
+ false
+
+
+
+
+
+
+ false
+
+
+
+ 72
+ 24
+
+
+
+
+ 72
+ 24
+
+
+
+ Set
+
+
+
+
+
+
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+
+
+
+
+
+
+ false
+
+
+ Weather
+
+
+
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+
+
+
+ false
+
+
+ Display the weather status. The warning and alert limits are set in the INDI tab.
+
+
+ Weather Status:
+
+
+
+
+
+
+
+ 0
+ 0
+
+
+
+
+ 48
+ 48
+
+
+
+
+ 48
+ 48
+
+
+
+
+
+
+
+
+
+
+ false
+
+
+ Actions
+
+
+
+
+
+ War&ning
+
+
+ true
+
+
+
+ 0
+
+
+ 0
+
+
+
+
+ park dome
+
+
+
+
+
+
+ close shutter
+
+
+
+
+
+
+ stop scheduler
+
+
+
+
+
+
+
+
+ <html><head/><body><p><span style=" font-style:italic;">Status: inactive</span></p></body></html>
+
+
+ Qt::AutoText
+
+
+
+
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+
+
+
+ delay (sec):
+
+
+
+
+
+
+ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+
+
+ 9999
+
+
+
+
+
+
+
+
+
+
+
+ Ale&rt
+
+
+ true
+
+
+
+ 0
+
+
+ 0
+
+
+
+
+ close shutter
+
+
+
+
+
+
+ park dome
+
+
+
+
+
+
+ stop scheduler
+
+
+
+
+
+
+
+
+ <html><head/><body><p><span style=" font-style:italic;">Status: inactive</span></p></body></html>
+
+
+ Qt::AutoText
+
+
+
+
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+
+
+
+ delay (sec):
+
+
+
+
+
+
+ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+
+
+ 9999
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ false
+
+
+ Shutter
+
+
+
+
+
+ false
+
+
+
+ 96
+ 36
+
+
+
+
+ 72
+ 36
+
+
+
+ <html><head/><body><p>Close the shutter of the dome. For advanced control of the dome please use the INDI tab.</p></body></html>
+
+
+ QPushButton:checked
+{
+background-color: maroon;
+border: 1px outset;
+font-weight:bold;
+}
+
+
+ CLOSED
+
+
+
+ 32
+ 16
+
+
+
+ true
+
+
+
+
+
+
+ false
+
+
+
+ 96
+ 36
+
+
+
+
+ 72
+ 36
+
+
+
+ <html><head/><body><p>Open the shutter of the dome. For advanced control of the dome please use the INDI tab.</p></body></html>
+
+
+ QPushButton:checked
+{
+background-color: maroon;
+border: 1px outset;
+font-weight:bold;
+}
+
+
+ OPEN
+
+
+ true
+
+
+ false
+
+
+
+
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+
+
+
+
+
+
+ Qt::Vertical
+
+
+
+ 20
+ 40
+
+
+
+
+
+
+
+
+
diff --git a/kstars/ekos/observatory/observatorydomemodel.cpp b/kstars/ekos/observatory/observatorydomemodel.cpp
new file mode 100644
index 000000000..0094695b6
--- /dev/null
+++ b/kstars/ekos/observatory/observatorydomemodel.cpp
@@ -0,0 +1,88 @@
+/* Ekos Observatory Module
+ Copyright (C) Wolfgang Reissenberger
+
+ This application is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+ */
+
+#include "observatorydomemodel.h"
+
+namespace Ekos
+{
+
+void ObservatoryDomeModel::initModel(Dome *dome)
+{
+ mDome = dome;
+
+ connect(mDome, &Dome::ready, this, &ObservatoryDomeModel::ready);
+ connect(mDome, &Dome::disconnected, this, &ObservatoryDomeModel::disconnected);
+ connect(mDome, &Dome::newStatus, this, &ObservatoryDomeModel::newStatus);
+ connect(mDome, &Dome::newShutterStatus, this, &ObservatoryDomeModel::newShutterStatus);
+
+}
+
+
+ISD::Dome::Status ObservatoryDomeModel::status()
+{
+ if (mDome == nullptr)
+ return ISD::Dome::DOME_IDLE;
+
+ return mDome->status();
+}
+
+ISD::Dome::ShutterStatus ObservatoryDomeModel::shutterStatus()
+{
+ if (mDome == nullptr)
+ return ISD::Dome::SHUTTER_UNKNOWN;
+
+ return mDome->shutterStatus();
+}
+
+void ObservatoryDomeModel::park()
+{
+ if (mDome == nullptr)
+ return;
+
+ emit newLog("Parking dome...");
+ mDome->park();
+}
+
+
+void ObservatoryDomeModel::unpark()
+{
+ if (mDome == nullptr)
+ return;
+
+ emit newLog("Unparking dome...");
+ mDome->unpark();
+}
+
+void ObservatoryDomeModel::openShutter()
+{
+ if (mDome == nullptr)
+ return;
+
+ emit newLog("Opening shutter...");
+ mDome->controlShutter(true);
+}
+
+void ObservatoryDomeModel::closeShutter()
+{
+ if (mDome == nullptr)
+ return;
+
+ emit newLog("Closing shutter...");
+ mDome->controlShutter(false);
+}
+
+void ObservatoryDomeModel::execute(WeatherActions actions)
+{
+ if (hasShutter() && actions.closeShutter)
+ closeShutter();
+ if (actions.parkDome)
+ park();
+}
+
+}
diff --git a/kstars/ekos/observatory/observatorydomemodel.h b/kstars/ekos/observatory/observatorydomemodel.h
new file mode 100644
index 000000000..3121e1b4d
--- /dev/null
+++ b/kstars/ekos/observatory/observatorydomemodel.h
@@ -0,0 +1,57 @@
+/* Ekos Observatory Module
+ Copyright (C) Wolfgang Reissenberger
+
+ This application is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+ */
+
+#pragma once
+
+#include "../auxiliary/dome.h"
+#include "observatoryweathermodel.h"
+
+#include
+
+
+namespace Ekos
+{
+
+class ObservatoryDomeModel: public QObject
+{
+
+ Q_OBJECT
+
+public:
+ ObservatoryDomeModel() = default;
+
+ void initModel(Dome *dome);
+
+ ISD::Dome::Status status();
+ ISD::Dome::ShutterStatus shutterStatus();
+
+ // proxies to the underlying dome object
+ bool canPark() { return (mDome != nullptr && mDome->canPark()); }
+ void park();
+ void unpark();
+ bool hasShutter() { return (mDome != nullptr && mDome->hasShutter()); }
+ void openShutter();
+ void closeShutter();
+
+public slots:
+ void execute(WeatherActions actions);
+
+
+private:
+ Dome *mDome;
+
+signals:
+ void newStatus(ISD::Dome::Status state);
+ void newShutterStatus(ISD::Dome::ShutterStatus status);
+ void ready();
+ void disconnected();
+ void newLog(const QString &text);
+};
+
+}
diff --git a/kstars/ekos/observatory/observatorymodel.cpp b/kstars/ekos/observatory/observatorymodel.cpp
new file mode 100644
index 000000000..ede19249b
--- /dev/null
+++ b/kstars/ekos/observatory/observatorymodel.cpp
@@ -0,0 +1,111 @@
+/* Ekos Observatory Module
+ Copyright (C) Wolfgang Reissenberger
+
+ This application is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+ */
+
+#include "observatorymodel.h"
+#include "Options.h"
+
+namespace Ekos
+{
+
+ObservatoryModel::ObservatoryModel()
+{
+
+ mStatusControl.useDome = Options::observatoryStatusUseDome();
+ mStatusControl.useShutter = Options::observatoryStatusUseShutter();
+ mStatusControl.useWeather = Options::observatoryStatusUseWeather();
+
+ setDomeModel(new ObservatoryDomeModel());
+ setWeatherModel(new ObservatoryWeatherModel());
+}
+
+void ObservatoryModel::setDomeModel(ObservatoryDomeModel *model) {
+ mDomeModel = model;
+ if (model != nullptr)
+ {
+ connect(mDomeModel, &ObservatoryDomeModel::newStatus, [this](ISD::Dome::Status s) { Q_UNUSED(s); updateStatus(); });
+ connect(mDomeModel, &ObservatoryDomeModel::newShutterStatus, [this](ISD::Dome::ShutterStatus s) { Q_UNUSED(s); updateStatus(); });
+ if (mWeatherModel != nullptr)
+ connect(mWeatherModel, &ObservatoryWeatherModel::execute, mDomeModel, &ObservatoryDomeModel::execute);
+ }
+ else
+ {
+ if (mWeatherModel != nullptr)
+ disconnect(mWeatherModel, &ObservatoryWeatherModel::execute, mDomeModel, &ObservatoryDomeModel::execute);
+ }
+
+ updateStatus();
+}
+
+void ObservatoryModel::setWeatherModel(ObservatoryWeatherModel *model) {
+ mWeatherModel = model;
+ if (model != nullptr)
+ {
+ connect(mWeatherModel, &ObservatoryWeatherModel::newStatus, [this](ISD::Weather::Status s) { Q_UNUSED(s); updateStatus(); });
+ if (mDomeModel != nullptr)
+ {
+ connect(mWeatherModel, &ObservatoryWeatherModel::execute, mDomeModel, &ObservatoryDomeModel::execute);
+ }
+ }
+ else
+ {
+ if (mDomeModel != nullptr)
+ disconnect(mWeatherModel, &ObservatoryWeatherModel::execute, mDomeModel, &ObservatoryDomeModel::execute);
+ }
+ updateStatus();
+}
+
+
+void ObservatoryModel::setStatusControl(ObservatoryStatusControl control)
+{
+ mStatusControl = control;
+ Options::setObservatoryStatusUseDome(control.useDome);
+ Options::setObservatoryStatusUseShutter(control.useShutter);
+ Options::setObservatoryStatusUseWeather(control.useWeather);
+ updateStatus();
+}
+
+bool ObservatoryModel::isReady()
+{
+ // dome relevant for the status and dome is ready
+ if (mStatusControl.useDome && (getDomeModel() == nullptr || getDomeModel()->status() != ISD::Dome::DOME_IDLE))
+ return false;
+
+ // shutter relevant for the status and shutter open
+ if (mStatusControl.useShutter && (getDomeModel() == nullptr ||
+ (getDomeModel()->hasShutter() && getDomeModel()->shutterStatus() != ISD::Dome::SHUTTER_OPEN)))
+ return false;
+
+ // weather relevant for the status and weather is OK
+ if (mStatusControl.useWeather && (getWeatherModel() == nullptr || getWeatherModel()->status() != ISD::Weather::WEATHER_OK))
+ return false;
+
+ return true;
+}
+
+void ObservatoryModel::updateStatus()
+{
+ emit newStatus(isReady());
+}
+
+void ObservatoryModel::makeReady()
+{
+ // dome relevant for the status and dome is ready
+ if (mStatusControl.useDome && (getDomeModel() == nullptr || getDomeModel()->status() != ISD::Dome::DOME_IDLE))
+ getDomeModel()->unpark();
+
+ // shutter relevant for the status and shutter open
+ if (mStatusControl.useShutter && (getDomeModel() == nullptr ||
+ (getDomeModel()->hasShutter() && getDomeModel()->shutterStatus() != ISD::Dome::SHUTTER_OPEN)))
+ getDomeModel()->openShutter();
+
+ // weather relevant for the status and weather is OK
+ // Haha, weather we can't change
+}
+
+}
diff --git a/kstars/ekos/observatory/observatorymodel.h b/kstars/ekos/observatory/observatorymodel.h
new file mode 100644
index 000000000..98b3a81c6
--- /dev/null
+++ b/kstars/ekos/observatory/observatorymodel.h
@@ -0,0 +1,78 @@
+/* Ekos Observatory Module
+ Copyright (C) Wolfgang Reissenberger
+
+ This application is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+ */
+
+#pragma once
+
+#include "observatorydomemodel.h"
+#include "observatoryweathermodel.h"
+
+#include
+
+namespace Ekos
+{
+
+struct ObservatoryStatusControl
+{
+ bool useDome, useShutter, useWeather;
+};
+
+class ObservatoryModel : public QObject
+{
+
+ Q_OBJECT
+
+public:
+ ObservatoryModel();
+
+ ObservatoryDomeModel *getDomeModel() { return mDomeModel; }
+ ObservatoryWeatherModel *getWeatherModel() { return mWeatherModel; }
+
+ void setDomeModel(ObservatoryDomeModel *model);
+ void setWeatherModel(ObservatoryWeatherModel *model);
+
+ /**
+ * @brief Retrieve the settings that define, from which states the
+ * "ready" state of the observatory is derived from.
+ */
+ ObservatoryStatusControl statusControl() { return mStatusControl; }
+ void setStatusControl(ObservatoryStatusControl control);
+
+ /**
+ * @brief Is the observatory ready? This depends upon the states of the weather,
+ * dome etc and upon whether these settings are relevant (see status control).
+ */
+ bool isReady();
+
+public slots:
+ // call this slot in case that the weather or dome status has changed
+ void updateStatus();
+
+ /**
+ * @brief Depending on the status control settings execute everything so
+ * that the status reaches the state "READY".
+ */
+ void makeReady();
+
+signals:
+ /**
+ * @brief Signal a new observatory status
+ * @param isReady
+ */
+ void newStatus(bool isReady);
+
+
+private:
+ ObservatoryStatusControl mStatusControl;
+
+ ObservatoryDomeModel *mDomeModel = nullptr;
+ ObservatoryWeatherModel *mWeatherModel = nullptr;
+
+};
+
+}
diff --git a/kstars/ekos/observatory/observatoryweathermodel.cpp b/kstars/ekos/observatory/observatoryweathermodel.cpp
new file mode 100644
index 000000000..cab0420bd
--- /dev/null
+++ b/kstars/ekos/observatory/observatoryweathermodel.cpp
@@ -0,0 +1,156 @@
+/* Ekos Observatory Module
+ Copyright (C) Wolfgang Reissenberger
+
+ This application is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+ */
+
+#include "observatoryweathermodel.h"
+#include "Options.h"
+
+namespace Ekos
+{
+
+void ObservatoryWeatherModel::initModel(Weather *weather)
+{
+ mWeather = weather;
+
+ // ensure that we start the timers if required
+ weatherChanged(status());
+
+ connect(mWeather, &Weather::ready, this, &ObservatoryWeatherModel::updateWeatherStatus);
+ connect(mWeather, &Weather::newStatus, this, &ObservatoryWeatherModel::weatherChanged);
+ connect(mWeather, &Weather::disconnected, this, &ObservatoryWeatherModel::disconnected);
+
+ // read the default values
+ warningActionsActive = Options::warningActionsActive();
+ warningActions.parkDome = Options::weatherWarningCloseDome();
+ warningActions.closeShutter = Options::weatherWarningCloseShutter();
+ warningActions.delay = Options::weatherWarningDelay();
+ warningActions.stopScheduler = Options::weatherAlertStopScheduler();
+ alertActionsActive = Options::alertActionsActive();
+ alertActions.parkDome = Options::weatherAlertCloseDome();
+ alertActions.closeShutter = Options::weatherAlertCloseShutter();
+ alertActions.stopScheduler = Options::weatherAlertStopScheduler();
+ alertActions.delay = Options::weatherAlertDelay();
+
+ warningTimer.setInterval(warningActions.delay * 1000);
+ warningTimer.setSingleShot(true);
+ alertTimer.setInterval(alertActions.delay * 1000);
+ alertTimer.setSingleShot(true);
+
+ connect(&warningTimer, &QTimer::timeout, [this]() { execute(warningActions); });
+ connect(&alertTimer, &QTimer::timeout, [this]() { execute(alertActions); });
+
+ if (mWeather->status() != ISD::Weather::WEATHER_IDLE)
+ emit ready();
+}
+
+ISD::Weather::Status ObservatoryWeatherModel::status()
+{
+ if (mWeather == nullptr)
+ return ISD::Weather::WEATHER_IDLE;
+
+ return mWeather->status();
+}
+
+void ObservatoryWeatherModel::setWarningActionsActive(bool active)
+{
+ warningActionsActive = active;
+ Options::setWarningActionsActive(active);
+
+ // stop warning actions if deactivated
+ if (!active && warningTimer.isActive())
+ warningTimer.stop();
+ // start warning timer if activated
+ else if (active && !warningTimer.isActive() && mWeather->status() == ISD::Weather::WEATHER_WARNING)
+ warningTimer.start();
+}
+
+void ObservatoryWeatherModel::setAlertActionsActive(bool active)
+{
+ alertActionsActive = active;
+ Options::setAlertActionsActive(active);
+
+ // stop alert actions if deactivated
+ if (!active && alertTimer.isActive())
+ alertTimer.stop();
+ // start alert timer if activated
+ else if (active && !alertTimer.isActive() && mWeather->status() == ISD::Weather::WEATHER_ALERT)
+ alertTimer.start();
+}
+
+void ObservatoryWeatherModel::setWarningActions(WeatherActions actions) {
+ warningActions = actions;
+ Options::setWeatherWarningCloseDome(actions.parkDome);
+ Options::setWeatherWarningCloseShutter(actions.closeShutter);
+ Options::setWeatherWarningDelay(actions.delay);
+ warningTimer.setInterval(actions.delay * 1000);
+}
+
+
+QString ObservatoryWeatherModel::getWarningActionsStatus()
+{
+ if (warningTimer.isActive())
+ {
+ QString status;
+ int remaining = warningTimer.remainingTime()/1000;
+ return status.sprintf("%02ds remaining", remaining);
+ }
+
+ return "Status: inactive";
+}
+
+void ObservatoryWeatherModel::setAlertActions(WeatherActions actions) {
+ alertActions = actions;
+ Options::setWeatherAlertCloseDome(actions.parkDome);
+ Options::setWeatherAlertCloseShutter(actions.closeShutter);
+ Options::setWeatherAlertDelay(actions.delay);
+ alertTimer.setInterval(actions.delay * 1000);
+}
+
+QString ObservatoryWeatherModel::getAlertActionsStatus()
+{
+ if (alertTimer.isActive())
+ {
+ QString status;
+ int remaining = alertTimer.remainingTime()/1000;
+ return status.sprintf("%02ds remaining", remaining);
+ }
+
+ return "Status: inactive";
+}
+
+void ObservatoryWeatherModel::updateWeatherStatus()
+{
+ weatherChanged(status());
+ emit ready();
+}
+
+
+void ObservatoryWeatherModel::weatherChanged(ISD::Weather::Status status)
+{
+ switch (status) {
+ case ISD::Weather::WEATHER_OK:
+ warningTimer.stop();
+ alertTimer.stop();
+ break;
+ case ISD::Weather::WEATHER_WARNING:
+ if (warningActionsActive)
+ warningTimer.start();
+ alertTimer.stop();
+ break;
+ case ISD::Weather::WEATHER_ALERT:
+ warningTimer.stop();
+ if (alertActionsActive)
+ alertTimer.start();
+ break;
+ default:
+ break;
+ }
+ emit newStatus(status);
+}
+
+} // Ekos
diff --git a/kstars/ekos/observatory/observatoryweathermodel.h b/kstars/ekos/observatory/observatoryweathermodel.h
new file mode 100644
index 000000000..f3e0e9249
--- /dev/null
+++ b/kstars/ekos/observatory/observatoryweathermodel.h
@@ -0,0 +1,83 @@
+/* Ekos Observatory Module
+ Copyright (C) Wolfgang Reissenberger
+
+ This application is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+ */
+
+#pragma once
+
+#include "../auxiliary/weather.h"
+#include "indiweather.h"
+
+#include
+
+namespace Ekos
+{
+
+struct WeatherActions {
+ bool parkDome, closeShutter, stopScheduler;
+ int delay;
+};
+
+class ObservatoryWeatherModel : public QObject
+{
+
+ Q_OBJECT
+
+public:
+ ObservatoryWeatherModel() = default;
+
+ void initModel(Weather *weather);
+ ISD::Weather::Status status();
+
+ /**
+ * @brief Actions to be taken when a weather warning occurs
+ */
+ WeatherActions getWarningActions() { return warningActions; }
+ QString getWarningActionsStatus();
+ void setWarningActions(WeatherActions actions);
+ bool getWarningActionsActive() { return warningActionsActive; }
+
+ /**
+ * @brief Actions to be taken when a weather alert occurs
+ */
+ WeatherActions getAlertActions() { return alertActions; }
+ QString getAlertActionsStatus();
+ void setAlertActions(WeatherActions actions);
+ bool getAlertActionsActive() { return alertActionsActive; }
+
+public slots:
+ /**
+ * @brief Activate or deactivate the weather warning actions
+ */
+ void setWarningActionsActive(bool active);
+ /**
+ * @brief Activate or deactivate the weather alert actions
+ */
+ void setAlertActionsActive(bool active);
+
+private:
+ Weather *mWeather;
+ QTimer warningTimer, alertTimer;
+ struct WeatherActions warningActions, alertActions;
+ bool warningActionsActive, alertActionsActive;
+
+private slots:
+ void weatherChanged(ISD::Weather::Status status);
+ void updateWeatherStatus();
+
+signals:
+ void newStatus(ISD::Weather::Status status);
+ void ready();
+ void disconnected();
+ /**
+ * @brief signal that actions need to be taken due to weather conditions
+ */
+ void execute(WeatherActions actions);
+
+};
+
+}
diff --git a/kstars/indi/indidome.cpp b/kstars/indi/indidome.cpp
index 38c2e4df2..0beeb9cc8 100644
--- a/kstars/indi/indidome.cpp
+++ b/kstars/indi/indidome.cpp
@@ -1,376 +1,486 @@
/* INDI Dome
Copyright (C) 2015 Jasem Mutlaq
This application is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
*/
#include
#include
#include
#include
#include
#include "indidome.h"
#include "kstars.h"
#include "clientmanager.h"
namespace ISD
{
Dome::Dome(GDInterface *iPtr) : DeviceDecorator(iPtr)
{
dType = KSTARS_DOME;
qRegisterMetaType("ISD::Dome::Status");
qDBusRegisterMetaType();
readyTimer.reset(new QTimer());
readyTimer.get()->setInterval(250);
readyTimer.get()->setSingleShot(true);
connect(readyTimer.get(), &QTimer::timeout, this, &Dome::ready);
}
void Dome::registerProperty(INDI::Property *prop)
{
if (isConnected())
readyTimer.get()->start();
if (!strcmp(prop->getName(), "DOME_PARK"))
{
ISwitchVectorProperty *svp = prop->getSwitch();
m_CanPark = true;
if (svp)
{
ISwitch *sp = IUFindSwitch(svp, "PARK");
if (sp)
{
if ((sp->s == ISS_ON) && svp->s == IPS_OK)
{
m_ParkStatus = PARK_PARKED;
+ m_Status = DOME_PARKED;
emit newParkStatus(m_ParkStatus);
QAction *parkAction = KStars::Instance()->actionCollection()->action("dome_park");
if (parkAction)
parkAction->setEnabled(false);
QAction *unParkAction = KStars::Instance()->actionCollection()->action("dome_unpark");
if (unParkAction)
unParkAction->setEnabled(true);
}
else if ((sp->s == ISS_OFF) && svp->s == IPS_OK)
{
m_ParkStatus = PARK_UNPARKED;
+ m_Status = DOME_IDLE;
emit newParkStatus(m_ParkStatus);
QAction *parkAction = KStars::Instance()->actionCollection()->action("dome_park");
if (parkAction)
parkAction->setEnabled(true);
QAction *unParkAction = KStars::Instance()->actionCollection()->action("dome_unpark");
if (unParkAction)
unParkAction->setEnabled(false);
}
}
}
}
else if (!strcmp(prop->getName(), "ABS_DOME_POSITION"))
{
m_CanAbsMove = true;
}
else if (!strcmp(prop->getName(), "DOME_ABORT_MOTION"))
{
m_CanAbort = true;
}
+ else if (!strcmp(prop->getName(), "DOME_SHUTTER"))
+ {
+ m_HasShutter = true;
+ }
DeviceDecorator::registerProperty(prop);
}
void Dome::processLight(ILightVectorProperty *lvp)
{
DeviceDecorator::processLight(lvp);
}
void Dome::processNumber(INumberVectorProperty *nvp)
{
if (!strcmp(nvp->name, "ABS_DOME_POSITION"))
{
emit azimuthPositionChanged(nvp->np[0].value);
}
DeviceDecorator::processNumber(nvp);
}
void Dome::processSwitch(ISwitchVectorProperty *svp)
{
if (!strcmp(svp->name, "CONNECTION"))
{
ISwitch *conSP = IUFindSwitch(svp, "CONNECT");
if (conSP)
{
if (isConnected() == false && conSP->s == ISS_ON)
KStars::Instance()->slotSetDomeEnabled(true);
else if (isConnected() && conSP->s == ISS_OFF)
{
KStars::Instance()->slotSetDomeEnabled(false);
m_CanAbsMove = false;
m_CanPark = false;
}
}
}
else if (!strcmp(svp->name, "DOME_PARK"))
{
ISwitch *sp = IUFindSwitch(svp, "PARK");
if (sp)
{
if (svp->s == IPS_ALERT)
{
emit newParkStatus(PARK_ERROR);
// If alert, set park status to whatever it was opposite to. That is, if it was parking and failed
// then we set status to unparked since it did not successfully complete parking.
if (m_ParkStatus == PARK_PARKING)
m_ParkStatus = PARK_UNPARKED;
else if (m_ParkStatus == PARK_UNPARKING)
m_ParkStatus = PARK_PARKED;
emit newParkStatus(m_ParkStatus);
}
else if (svp->s == IPS_BUSY && sp->s == ISS_ON && m_ParkStatus != PARK_PARKING)
{
m_ParkStatus = PARK_PARKING;
KNotification::event(QLatin1String("DomeParking"), i18n("Dome parking is in progress"));
emit newParkStatus(m_ParkStatus);
if (m_Status != DOME_PARKING)
{
m_Status = DOME_PARKING;
emit newStatus(m_Status);
}
}
else if (svp->s == IPS_BUSY && sp->s == ISS_OFF && m_ParkStatus != PARK_UNPARKING)
{
m_ParkStatus = PARK_UNPARKING;
KNotification::event(QLatin1String("DomeUnparking"), i18n("Dome unparking is in progress"));
emit newParkStatus(m_ParkStatus);
if (m_Status != DOME_UNPARKING)
{
m_Status = DOME_UNPARKING;
emit newStatus(m_Status);
}
}
else if (svp->s == IPS_OK && sp->s == ISS_ON && m_ParkStatus != PARK_PARKED)
{
m_ParkStatus = PARK_PARKED;
KNotification::event(QLatin1String("DomeParked"), i18n("Dome parked"));
emit newParkStatus(m_ParkStatus);
QAction *parkAction = KStars::Instance()->actionCollection()->action("dome_park");
if (parkAction)
parkAction->setEnabled(false);
QAction *unParkAction = KStars::Instance()->actionCollection()->action("dome_unpark");
if (unParkAction)
unParkAction->setEnabled(true);
if (m_Status != DOME_PARKED)
{
m_Status = DOME_PARKED;
emit newStatus(m_Status);
}
}
else if ( (svp->s == IPS_OK || svp->s == IPS_IDLE) && sp->s == ISS_OFF && m_ParkStatus != PARK_UNPARKED)
{
m_ParkStatus = PARK_UNPARKED;
KNotification::event(QLatin1String("DomeUnparked"), i18n("Dome unparked"));
QAction *parkAction = KStars::Instance()->actionCollection()->action("dome_park");
if (parkAction)
parkAction->setEnabled(true);
QAction *unParkAction = KStars::Instance()->actionCollection()->action("dome_unpark");
if (unParkAction)
unParkAction->setEnabled(false);
emit newParkStatus(m_ParkStatus);
if (m_Status != DOME_IDLE)
{
m_Status = DOME_IDLE;
emit newStatus(m_Status);
}
}
}
}
else if (!strcmp(svp->name, "DOME_MOTION"))
{
Status lastStatus = m_Status;
if (svp->s == IPS_BUSY && lastStatus != DOME_MOVING && lastStatus != DOME_PARKING && lastStatus != DOME_UNPARKING)
{
m_Status = DOME_MOVING;
emit newStatus(m_Status);
}
else if (svp->s == IPS_OK && lastStatus == DOME_MOVING)
{
m_Status = DOME_TRACKING;
emit newStatus(m_Status);
}
else if (svp->s == IPS_IDLE && lastStatus != DOME_IDLE)
{
m_Status = DOME_IDLE;
emit newStatus(m_Status);
}
}
+ else if (!strcmp(svp->name, "DOME_SHUTTER"))
+ {
+ if (svp->s == IPS_ALERT)
+ {
+ emit newShutterStatus(SHUTTER_ERROR);
+
+ // If alert, set shutter status to whatever it was opposite to. That is, if it was opening and failed
+ // then we set status to closed since it did not successfully complete opening.
+ if (m_ShutterStatus == SHUTTER_CLOSING)
+ m_ShutterStatus = SHUTTER_OPEN;
+ else if (m_ShutterStatus == SHUTTER_CLOSING)
+ m_ShutterStatus = SHUTTER_CLOSED;
+
+ emit newShutterStatus(m_ShutterStatus);
+ }
+
+ ShutterStatus status = shutterStatus(svp);
+
+ switch (status) {
+ case SHUTTER_CLOSING:
+ if (m_ShutterStatus != SHUTTER_CLOSING)
+ {
+ m_ShutterStatus = SHUTTER_CLOSING;
+ KNotification::event(QLatin1String("ShutterClosing"), i18n("Shutter closing is in progress"));
+ emit newShutterStatus(m_ShutterStatus);
+ }
+ break;
+ case SHUTTER_OPENING:
+ if (m_ShutterStatus != SHUTTER_OPENING)
+ {
+ m_ShutterStatus = SHUTTER_OPENING;
+ KNotification::event(QLatin1String("ShutterOpening"), i18n("Shutter opening is in progress"));
+ emit newShutterStatus(m_ShutterStatus);
+ }
+ break;
+ case SHUTTER_CLOSED:
+ if (m_ShutterStatus != SHUTTER_CLOSED)
+ {
+ m_ShutterStatus = SHUTTER_CLOSED;
+ KNotification::event(QLatin1String("ShutterClosed"), i18n("Shutter closed"));
+ emit newShutterStatus(m_ShutterStatus);
+ }
+ break;
+ case SHUTTER_OPEN:
+ if (m_ShutterStatus != SHUTTER_OPEN)
+ {
+ m_ShutterStatus = SHUTTER_OPEN;
+ KNotification::event(QLatin1String("ShutterOpened"), i18n("Shutter opened"));
+ emit newShutterStatus(m_ShutterStatus);
+ }
+ break;
+ default:
+ break;
+ }
+
+ return;
+ }
DeviceDecorator::processSwitch(svp);
}
void Dome::processText(ITextVectorProperty *tvp)
{
DeviceDecorator::processText(tvp);
}
bool Dome::Abort()
{
if (m_CanAbort == false)
return false;
ISwitchVectorProperty *motionSP = baseDevice->getSwitch("DOME_ABORT_MOTION");
if (motionSP == nullptr)
return false;
ISwitch *abortSW = IUFindSwitch(motionSP, "ABORT");
if (abortSW == nullptr)
return false;
abortSW->s = ISS_ON;
clientManager->sendNewSwitch(motionSP);
return true;
}
bool Dome::Park()
{
ISwitchVectorProperty *parkSP = baseDevice->getSwitch("DOME_PARK");
if (parkSP == nullptr)
return false;
ISwitch *parkSW = IUFindSwitch(parkSP, "PARK");
if (parkSW == nullptr)
return false;
IUResetSwitch(parkSP);
parkSW->s = ISS_ON;
clientManager->sendNewSwitch(parkSP);
return true;
}
bool Dome::UnPark()
{
ISwitchVectorProperty *parkSP = baseDevice->getSwitch("DOME_PARK");
if (parkSP == nullptr)
return false;
ISwitch *parkSW = IUFindSwitch(parkSP, "UNPARK");
if (parkSW == nullptr)
return false;
IUResetSwitch(parkSP);
parkSW->s = ISS_ON;
clientManager->sendNewSwitch(parkSP);
return true;
}
bool Dome::isMoving() const
{
ISwitchVectorProperty *motionSP = baseDevice->getSwitch("DOME_MOTION");
if (motionSP && motionSP->s == IPS_BUSY)
return true;
return false;
}
double Dome::azimuthPosition() const
{
INumberVectorProperty *az = baseDevice->getNumber("ABS_DOME_POSITION");
if (az == nullptr)
return -1;
else
return az->np[0].value;
}
bool Dome::setAzimuthPosition(double position)
{
INumberVectorProperty *az = baseDevice->getNumber("ABS_DOME_POSITION");
if (az == nullptr)
return false;
az->np[0].value = position;
clientManager->sendNewNumber(az);
return true;
}
+bool Dome::ControlShutter(bool open)
+{
+ ISwitchVectorProperty *shutterSP = baseDevice->getSwitch("DOME_SHUTTER");
+
+ if (shutterSP == nullptr)
+ return false;
+
+ ISwitch *shutterSW = IUFindSwitch(shutterSP, open ? "SHUTTER_OPEN" : "SHUTTER_CLOSE");
+
+ if (shutterSW == nullptr)
+ return false;
+
+ IUResetSwitch(shutterSP);
+ shutterSW->s = ISS_ON;
+ clientManager->sendNewSwitch(shutterSP);
+
+ return true;
+}
+
+Dome::ShutterStatus Dome::shutterStatus()
+{
+ ISwitchVectorProperty *shutterSP = baseDevice->getSwitch("DOME_SHUTTER");
+
+ return shutterStatus(shutterSP);
+
+}
+
+Dome::ShutterStatus Dome::shutterStatus(ISwitchVectorProperty *svp)
+{
+ if (svp == nullptr)
+ return SHUTTER_UNKNOWN;
+
+ ISwitch *sp = IUFindSwitch(svp, "SHUTTER_OPEN");
+ if (sp == nullptr)
+ return SHUTTER_UNKNOWN;
+
+ if (svp->s == IPS_ALERT)
+ return SHUTTER_ERROR;
+ else if (svp->s == IPS_BUSY)
+ return (sp->s == ISS_ON) ? SHUTTER_OPENING : SHUTTER_CLOSING;
+ else if (svp->s == IPS_OK)
+ return (sp->s == ISS_ON) ? SHUTTER_OPEN : SHUTTER_CLOSED;
+
+ // this should not happen
+ return SHUTTER_UNKNOWN;
+}
+
const QString Dome::getStatusString(Dome::Status status)
{
switch (status)
{
case ISD::Dome::DOME_IDLE:
return i18n("Idle");
case ISD::Dome::DOME_PARKED:
return i18n("Parked");
case ISD::Dome::DOME_PARKING:
return i18n("Parking");
case ISD::Dome::DOME_UNPARKING:
return i18n("UnParking");
case ISD::Dome::DOME_MOVING:
return i18n("Moving");
case ISD::Dome::DOME_TRACKING:
return i18n("Tracking");
case ISD::Dome::DOME_ERROR:
return i18n("Error");
}
return i18n("Error");
}
}
QDBusArgument &operator<<(QDBusArgument &argument, const ISD::Dome::Status& source)
{
argument.beginStructure();
argument << static_cast(source);
argument.endStructure();
return argument;
}
const QDBusArgument &operator>>(const QDBusArgument &argument, ISD::Dome::Status &dest)
{
int a;
argument.beginStructure();
argument >> a;
argument.endStructure();
dest = static_cast(a);
return argument;
}
diff --git a/kstars/indi/indidome.h b/kstars/indi/indidome.h
index 0cb55dcae..94f8dabb8 100644
--- a/kstars/indi/indidome.h
+++ b/kstars/indi/indidome.h
@@ -1,104 +1,126 @@
/* INDI Dome
Copyright (C) 2015 Jasem Mutlaq
This application is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
*/
#pragma once
#include
#include
#include "indistd.h"
namespace ISD
{
/**
* @class Dome
* Focuser class handles control of INDI dome devices. Both open and closed loop (senor feedback) domes are supported.
*
* @author Jasem Mutlaq
*/
class Dome : public DeviceDecorator
{
Q_OBJECT
- public:
- explicit Dome(GDInterface *iPtr);
- typedef enum
- {
- DOME_IDLE,
- DOME_MOVING,
- DOME_TRACKING,
- DOME_PARKING,
- DOME_UNPARKING,
- DOME_PARKED,
- DOME_ERROR
- } Status;
+public:
+ explicit Dome(GDInterface *iPtr);
+ typedef enum
+ {
+ DOME_IDLE,
+ DOME_MOVING,
+ DOME_TRACKING,
+ DOME_PARKING,
+ DOME_UNPARKING,
+ DOME_PARKED,
+ DOME_ERROR
+ } Status;
+
+ typedef enum
+ {
+ SHUTTER_UNKNOWN,
+ SHUTTER_OPEN,
+ SHUTTER_CLOSED,
+ SHUTTER_OPENING,
+ SHUTTER_CLOSING,
+ SHUTTER_ERROR
+ } ShutterStatus;
void processSwitch(ISwitchVectorProperty *svp) override;
void processText(ITextVectorProperty *tvp) override;
void processNumber(INumberVectorProperty *nvp) override;
void processLight(ILightVectorProperty *lvp) override;
void registerProperty(INDI::Property *prop) override;
DeviceFamily getType() override
{
return dType;
}
bool canPark() const
{
return m_CanPark;
}
bool canAbsMove() const
{
return m_CanAbsMove;
}
bool canAbort() const
{
return m_CanAbort;
}
bool isParked() const
{
return m_ParkStatus == PARK_PARKED;
}
bool isMoving() const;
double azimuthPosition() const;
bool setAzimuthPosition(double position);
+
+ bool hasShutter() const
+ {
+ return m_HasShutter;
+ }
Status status() const
{
return m_Status;
}
static const QString getStatusString (Status status);
- public slots:
+ ShutterStatus shutterStatus();
+ ShutterStatus shutterStatus(ISwitchVectorProperty *svp);
+
+public slots:
bool Abort();
bool Park();
bool UnPark();
+ bool ControlShutter(bool open);
signals:
void newStatus(Status status);
void newParkStatus(ParkStatus status);
+ void newShutterStatus(ShutterStatus status);
void azimuthPositionChanged(double Az);
void ready();
private:
ParkStatus m_ParkStatus { PARK_UNKNOWN };
+ ShutterStatus m_ShutterStatus { SHUTTER_UNKNOWN };
Status m_Status { DOME_IDLE };
bool m_CanAbsMove { false };
bool m_CanPark { false };
bool m_CanAbort { false };
+ bool m_HasShutter { false };
std::unique_ptr readyTimer;
};
}
Q_DECLARE_METATYPE(ISD::Dome::Status)
QDBusArgument &operator<<(QDBusArgument &argument, const ISD::Dome::Status &source);
const QDBusArgument &operator>>(const QDBusArgument &argument, ISD::Dome::Status &dest);
diff --git a/kstars/indi/indilistener.cpp b/kstars/indi/indilistener.cpp
index 04323aee0..3eb7c04c2 100644
--- a/kstars/indi/indilistener.cpp
+++ b/kstars/indi/indilistener.cpp
@@ -1,473 +1,474 @@
/* INDI Listener
Copyright (C) 2012 Jasem Mutlaq (mutlaqja@ikarustech.com)
This application is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
Handle INDI Standard properties.
*/
#include "indilistener.h"
#include "clientmanager.h"
#include "deviceinfo.h"
#include "indicap.h"
#include "indiccd.h"
#include "indidome.h"
#include "indifilter.h"
#include "indifocuser.h"
#include "indilightbox.h"
#include "inditelescope.h"
#include "indiweather.h"
#include "kstars.h"
#include "Options.h"
#include "auxiliary/ksnotification.h"
#include
#include
#include
#define NINDI_STD 35
/* INDI standard property used across all clients to enable interoperability. */
const char *indi_std[NINDI_STD] = { "CONNECTION",
"DEVICE_PORT",
"TIME_UTC",
"TIME_LST",
"GEOGRAPHIC_COORD",
"EQUATORIAL_COORD",
"EQUATORIAL_EOD_COORD",
"EQUATORIAL_EOD_COORD_REQUEST",
"HORIZONTAL_COORD",
"TELESCOPE_ABORT_MOTION",
"ON_COORD_SET",
"SOLAR_SYSTEM",
"TELESCOPE_MOTION_NS",
"TELESCOPE_MOTION_WE",
"TELESCOPE_PARK",
"DOME_PARK",
"GPS_REFRESH",
"WEATHER_STATUS",
"CCD_EXPOSURE",
"CCD_TEMPERATURE",
"CCD_FRAME",
"CCD_FRAME_TYPE",
"CCD_BINNING",
"CCD_INFO",
"CCD_VIDEO_STREAM",
"RAW_STREAM",
"IMAGE_STREAM",
"FOCUS_SPEED",
"FOCUS_MOTION",
"FOCUS_TIMER",
"FILTER_SLOT",
"WATCHDOG_HEARTBEAT",
"CAP_PARK",
"FLAT_LIGHT_CONTROL",
"FLAT_LIGHT_INTENSITY" };
INDIListener *INDIListener::_INDIListener = nullptr;
INDIListener *INDIListener::Instance()
{
if (_INDIListener == nullptr)
{
_INDIListener = new INDIListener(KStars::Instance());
connect(_INDIListener, &INDIListener::newTelescope, [&]()
{
KStars::Instance()->slotSetTelescopeEnabled(true);
});
connect(_INDIListener, &INDIListener::newDome, [&]()
{
KStars::Instance()->slotSetDomeEnabled(true);
});
}
return _INDIListener;
}
INDIListener::INDIListener(QObject *parent) : QObject(parent)
{
}
INDIListener::~INDIListener()
{
qDeleteAll(devices);
qDeleteAll(st4Devices);
}
bool INDIListener::isStandardProperty(const QString &name)
{
for (auto &item : indi_std)
{
if (!strcmp(name.toLatin1().constData(), item))
return true;
}
return false;
}
ISD::GDInterface *INDIListener::getDevice(const QString &name)
{
foreach (ISD::GDInterface *gi, devices)
{
if (!strcmp(gi->getDeviceName(), name.toLatin1().constData()))
return gi;
}
return nullptr;
}
void INDIListener::addClient(ClientManager *cm)
{
qCDebug(KSTARS_INDI) << "INDIListener: Adding a new client manager to INDI listener..";
Qt::ConnectionType type = Qt::BlockingQueuedConnection;
#ifdef USE_QT5_INDI
type = Qt::DirectConnection;
#endif
clients.append(cm);
connect(cm, SIGNAL(newINDIDevice(DeviceInfo*)), this, SLOT(processDevice(DeviceInfo*)), type);
connect(cm, SIGNAL(removeINDIDevice(DeviceInfo*)), this, SLOT(removeDevice(DeviceInfo*)), type);
connect(cm, SIGNAL(newINDIProperty(INDI::Property*)), this, SLOT(registerProperty(INDI::Property*)), type);
connect(cm, SIGNAL(removeINDIProperty(INDI::Property*)), this, SLOT(removeProperty(INDI::Property*)), type);
connect(cm, SIGNAL(newINDISwitch(ISwitchVectorProperty*)), this, SLOT(processSwitch(ISwitchVectorProperty*)));
connect(cm, SIGNAL(newINDIText(ITextVectorProperty*)), this, SLOT(processText(ITextVectorProperty*)));
connect(cm, SIGNAL(newINDINumber(INumberVectorProperty*)), this, SLOT(processNumber(INumberVectorProperty*)));
connect(cm, SIGNAL(newINDILight(ILightVectorProperty*)), this, SLOT(processLight(ILightVectorProperty*)));
connect(cm, SIGNAL(newINDIBLOB(IBLOB*)), this, SLOT(processBLOB(IBLOB*)));
#if INDI_VERSION_MAJOR >= 1 && INDI_VERSION_MINOR >= 5
connect(cm, SIGNAL(newINDIUniversalMessage(QString)), this, SLOT(processUniversalMessage(QString)));
#endif
}
void INDIListener::removeClient(ClientManager *cm)
{
qCDebug(KSTARS_INDI) << "INDIListener: Removing client manager for server" << cm->getHost() << "@" << cm->getPort();
QList::iterator it = devices.begin();
clients.removeOne(cm);
while (it != devices.end())
{
DriverInfo *dv = (*it)->getDriverInfo();
bool hostSource = (dv->getDriverSource() == HOST_SOURCE) || (dv->getDriverSource() == GENERATED_SOURCE);
if (cm->isDriverManaged(dv))
{
// If we have multiple devices per driver, we need to remove them all
if (dv->getAuxInfo().value("mdpd", false).toBool() == true)
{
while (it != devices.end())
{
if (dv->getDevice((*it)->getDeviceName()) != nullptr)
{
it = devices.erase(it);
}
else
break;
}
}
else
it = devices.erase(it);
cm->removeManagedDriver(dv);
cm->disconnect(this);
if (hostSource)
return;
}
else
++it;
}
}
void INDIListener::processDevice(DeviceInfo *dv)
{
qCDebug(KSTARS_INDI) << "INDIListener: New device" << dv->getBaseDevice()->getDeviceName();
ISD::GDInterface *gd = new ISD::GenericDevice(*dv);
devices.append(gd);
emit newDevice(gd);
}
void INDIListener::removeDevice(DeviceInfo *dv)
{
qCDebug(KSTARS_INDI) << "INDIListener: Removing device" << dv->getBaseDevice()->getDeviceName() << "with unique label "
<< dv->getDriverInfo()->getUniqueLabel();
foreach (ISD::GDInterface *gd, devices)
{
if (gd->getDeviceInfo() == dv)
{
emit deviceRemoved(gd);
devices.removeOne(gd);
delete (gd);
}
}
/*foreach(ISD::GDInterface *gd, devices)
{
if ( (dv->getDriverInfo()->getDevices().size() > 1 && gd->getDeviceName() == dv->getBaseDevice()->getDeviceName())
|| dv->getDriverInfo()->getUniqueLabel() == gd->getDeviceName() || dv->getDriverInfo()->getDriverSource() == HOST_SOURCE
|| dv->getDriverInfo()->getDriverSource() == GENERATED_SOURCE)
{
if (dv->getDriverInfo()->getUniqueLabel().contains("Query") == false)
emit deviceRemoved(gd);
devices.removeOne(gd);
delete(gd);
if (dv->getDriverInfo()->getDriverSource() != HOST_SOURCE && dv->getDriverInfo()->getDriverSource() != GENERATED_SOURCE)
return;
}
}*/
}
void INDIListener::registerProperty(INDI::Property *prop)
{
qCDebug(KSTARS_INDI) << "<" << prop->getDeviceName() << ">: <" << prop->getName() << ">";
foreach (ISD::GDInterface *gd, devices)
{
if (!strcmp(gd->getDeviceName(), prop->getDeviceName()))
{
if (!strcmp(prop->getName(), "EQUATORIAL_EOD_COORD") ||
!strcmp(prop->getName(), "EQUATORIAL_COORD") ||
!strcmp(prop->getName(), "HORIZONTAL_COORD"))
{
if (gd->getType() == KSTARS_UNKNOWN)
{
devices.removeOne(gd);
gd = new ISD::Telescope(gd);
devices.append(gd);
}
emit newTelescope(gd);
}
else if (!strcmp(prop->getName(), "CCD_EXPOSURE"))
{
if (gd->getType() == KSTARS_UNKNOWN)
{
devices.removeOne(gd);
gd = new ISD::CCD(gd);
devices.append(gd);
}
emit newCCD(gd);
}
else if (!strcmp(prop->getName(), "FILTER_NAME"))
{
if (gd->getType() == KSTARS_UNKNOWN)
{
devices.removeOne(gd);
gd = new ISD::Filter(gd);
devices.append(gd);
}
emit newFilter(gd);
}
else if (!strcmp(prop->getName(), "FOCUS_MOTION"))
{
if (gd->getType() == KSTARS_UNKNOWN)
{
devices.removeOne(gd);
gd = new ISD::Focuser(gd);
devices.append(gd);
}
emit newFocuser(gd);
}
- else if (!strcmp(prop->getName(), "DOME_MOTION"))
+ else if (!strcmp(prop->getName(), "DOME_SHUTTER") ||
+ !strcmp(prop->getName(), "DOME_MOTION"))
{
if (gd->getType() == KSTARS_UNKNOWN)
{
devices.removeOne(gd);
gd = new ISD::Dome(gd);
devices.append(gd);
}
emit newDome(gd);
}
else if (!strcmp(prop->getName(), "WEATHER_STATUS"))
{
if (gd->getType() == KSTARS_UNKNOWN)
{
devices.removeOne(gd);
gd = new ISD::Weather(gd);
devices.append(gd);
}
emit newWeather(gd);
}
else if (!strcmp(prop->getName(), "CAP_PARK"))
{
if (gd->getType() == KSTARS_UNKNOWN)
{
devices.removeOne(gd);
gd = new ISD::DustCap(gd);
devices.append(gd);
}
emit newDustCap(gd);
}
else if (!strcmp(prop->getName(), "FLAT_LIGHT_CONTROL"))
{
// If light box part of dust cap
if (gd->getType() == KSTARS_UNKNOWN)
{
if (gd->getBaseDevice()->getDriverInterface() & INDI::BaseDevice::DUSTCAP_INTERFACE)
{
devices.removeOne(gd);
gd = new ISD::DustCap(gd);
devices.append(gd);
emit newDustCap(gd);
}
// If stand-alone light box
else
{
devices.removeOne(gd);
gd = new ISD::LightBox(gd);
devices.append(gd);
emit newLightBox(gd);
}
}
}
if (!strcmp(prop->getName(), "TELESCOPE_TIMED_GUIDE_WE"))
{
ISD::ST4 *st4Driver = new ISD::ST4(gd->getBaseDevice(), gd->getDriverInfo()->getClientManager());
st4Devices.append(st4Driver);
emit newST4(st4Driver);
}
gd->registerProperty(prop);
break;
}
}
}
void INDIListener::removeProperty(INDI::Property *prop)
{
if (prop == nullptr)
return;
foreach (ISD::GDInterface *gd, devices)
{
if (!strcmp(gd->getDeviceName(), prop->getDeviceName()))
{
gd->removeProperty(prop);
return;
}
}
}
void INDIListener::processSwitch(ISwitchVectorProperty *svp)
{
foreach (ISD::GDInterface *gd, devices)
{
if (!strcmp(gd->getDeviceName(), svp->device))
{
gd->processSwitch(svp);
break;
}
}
}
void INDIListener::processNumber(INumberVectorProperty *nvp)
{
foreach (ISD::GDInterface *gd, devices)
{
if (!strcmp(gd->getDeviceName(), nvp->device))
{
gd->processNumber(nvp);
break;
}
}
}
void INDIListener::processText(ITextVectorProperty *tvp)
{
foreach (ISD::GDInterface *gd, devices)
{
if (!strcmp(gd->getDeviceName(), tvp->device))
{
gd->processText(tvp);
break;
}
}
}
void INDIListener::processLight(ILightVectorProperty *lvp)
{
foreach (ISD::GDInterface *gd, devices)
{
if (!strcmp(gd->getDeviceName(), lvp->device))
{
gd->processLight(lvp);
break;
}
}
}
void INDIListener::processBLOB(IBLOB *bp)
{
foreach (ISD::GDInterface *gd, devices)
{
if (!strcmp(gd->getDeviceName(), bp->bvp->device))
{
gd->processBLOB(bp);
break;
}
}
}
void INDIListener::processMessage(INDI::BaseDevice *dp, int messageID)
{
foreach (ISD::GDInterface *gd, devices)
{
if (!strcmp(gd->getDeviceName(), dp->getDeviceName()))
{
gd->processMessage(messageID);
break;
}
}
}
void INDIListener::processUniversalMessage(const QString &message)
{
QString displayMessage = message;
// Remove timestamp info as it is not suitable for message box
int colonIndex = displayMessage.indexOf(": ");
if (colonIndex > 0)
displayMessage = displayMessage.mid(colonIndex+2);
// Special case for Alignment since it is not tied to a device
if (displayMessage.startsWith("[ALIGNMENT]"))
{
qCDebug(KSTARS_INDI) << "AlignmentSubSystem:" << displayMessage;
return;
}
if (Options::messageNotificationINDI())
{
KNotification::event(QLatin1String("IndiServerMessage"),
displayMessage+" (INDI)");
}
else
{
KSNotification::transient(displayMessage, i18n("INDI Server Message"));
}
}
diff --git a/kstars/kstars.kcfg b/kstars/kstars.kcfg
index eeb9eab6f..43678b160 100644
--- a/kstars/kstars.kcfg
+++ b/kstars/kstars.kcfg
@@ -1,2309 +1,2363 @@
ksutils.hThe screen coordinates of the Time InfoBox.QPoint(0,0)The screen coordinates of the Focus InfoBox.QPoint(600,0)The screen coordinates of the Geographic Location InfoBox.QPoint(0,600)If true, the Time InfoBox will show only its top line of data.trueIf true, the Focus InfoBox will show only its top line of data.trueIf true, the Geographic Location InfoBox will show only its top line of data.trueToggles display of all three InfoBoxes.trueToggles display of the Time InfoBox.trueToggles display of the Focus InfoBox.trueToggles display of the Geographic Location InfoBox.trueIs the Time InfoBox anchored to a window edge? 0 = not anchored; 1 = anchored to right edge; 2 = anchored to bottom edge; 3 = anchored to bottom and right edges.003Is the Focus InfoBox anchored to a window edge? 0 = not anchored; 1 = anchored to right edge; 2 = anchored to bottom edge; 3 = anchored to bottom and right edges.103Is the Geographic Location InfoBox anchored to a window edge? 0 = not anchored; 1 = anchored to right edge; 2 = anchored to bottom edge; 3 = anchored to bottom and right edges.203Toggle display of the status bar.trueToggle display of the Horizontal coordinates of the mouse cursor in the status bar.trueToggle display of the Equatorial coordinates of the mouse cursor at the current epoch in the status bar.trueToggle display of the Equatorial coordinates of the mouse cursor at the standard epoch in the status bar.falsetrue1024768trueBlack BodyList of the filenames of custom object catalogs.List of integers toggling display of each custom object catalog (any nonzero value indicates the objects in that catalog will be displayed).List of names for which custom catalogs are to be displayed.Names of objects entered into the find dialog are resolved using online services and stored in the database. This option also toggles the display of such resolved objects on the sky map.true800600truetruefalseToggle display of crosshairs centered at telescope's pointed position in the KStars sky map.trueToggle display of INDI messages in the KStars statusbar.trueShow INDI messages as desktop notifications instead of dialogs.falsetruefalsefalseThe default location of saved FITS filesKSUtils::getDefaultPath("fitsDir")INDI server will attempt to bind with ports starting from this port7624INDI server will attempt to bind with ports ending with this port9000List of the aliases for filter wheel slots.PATH to indiserver binaryKSUtils::getDefaultPath("indiServer")falsePATH to indi drivers directoryKSUtils::getDefaultPath("indiDriversDir")false320240falsefalsefalsefalsefalsefalsefalsefalsefalsefalsefalseThe City name of the current geographic location.GreenwichThe Province name of the current geographic location. This is the name of the state for locations in the U. S.The Country name of the current geographic location.United KingdomThe longitude of the current geographic location, in decimal degrees.0.0The latitude of the current geographic location, in decimal degrees.51.468-10.00.0Two-letter code that determines the dates on which daylight savings time begins and ends (you can view the rules by pressing the "Explain DST Rules" button in the Geographic Location window).--If true, focus changes will cause the sky to visibly spin to the new position. Otherwise, the display will "snap" instantly to the new position.trueIf true, clicking on the skymap will select the closest object and highlights it.falseType of cursor when exploring the sky map.1The names of the currently selected field-of-view indicators. The list of defined FOV indicator names is listed in the "Settings|FOV Symbols" menu.TelradIf true, trails attached to solar system bodies will fade into the background sky color.trueThe right ascension of the initial focus position of the sky map, in decimal hours. This value is volatile; it is reset whenever the program shuts down.180.0The declination of the initial focus position of the sky map, in decimal degrees. This value is volatile; it is reset whenever the program shuts down.45.0The name of the object that should be centered and tracked on startup. If no object should be centered, set to "nothing". This value is volatile; it is reset whenever the program shuts down.nothingTrue if the skymap should track on its initial position on startup. This value is volatile; it is reset whenever the program shuts down.falseToggle whether KStars should hide some objects while the display is moving, for smoother motion.trueToggle whether constellation boundaries are hidden while the display is in motion.trueToggle whether constellation lines are hidden while the display is in motion.falseChoose sky culture.11Toggle whether constellation names are hidden while the display is in motion.falseToggle whether the coordinate grids are hidden while the display is in motion.trueToggle whether the Milky Way contour is hidden while the display is in motion.trueToggle whether IC objects are hidden while the display is in motion.trueToggle whether Messier objects are hidden while the display is in motion.trueToggle whether NGC objects are hidden while the display is in motion.trueToggle whether extra objects are hidden while the display is in motion.trueToggle whether solar system objects are hidden while the display is in motion.falseToggle whether faint stars are hidden while the display is in motion.trueToggle whether name labels are hidden while the display is in motion.trueToggle whether asteroids are drawn in the sky map.trueToggle whether asteroid name labels are drawn in the sky map.falsetrueToggle whether comets are drawn in the sky map.trueToggle whether comet comas are drawn in the sky map.trueToggle whether comet name labels are drawn in the sky map.falseToggle whether supernovae are drawn in the sky map.falseToggle whether supernova name labels are drawn in the sky map.falseSet magnitude limit for supernovae to be shown on the skymap.16Toggle supernova alerts.trueSet magnitude limit for supernovae to be alerted.13Toggle whether constellation boundaries are drawn in the sky map.falseToggle whether constellation boundary containing the central focus point is highlighted in the sky map.falseToggle whether constellation lines are drawn in the sky map.falseToggle whether constellation art drawn in the sky map.falseToggle whether constellation name labels are drawn in the sky map.falseToggle whether deep-sky objects are drawn in the sky map.trueToggle whether the ecliptic line is drawn in the sky map.falseToggle whether the equator line is drawn in the sky map.falseCoordinate grids will automatically change according to active coordinate system.trueToggle whether the equatorial coordinate grid is drawn in the sky map.falseToggle whether the horizontal coordinate grid is drawn in the sky map.falseToggle whether the local meridian line is drawn in the sky map.falseToggle whether the region below the horizon is opaque.trueToggle whether the horizon line is drawn in the sky map.trueToggle whether flags are drawn in the sky map.trueToggle whether IC objects are drawn in the sky map.falseToggle whether NGC objects are drawn in the sky map.trueToggle whether Messier objects are drawn in the sky map.trueToggle whether Messier objects are rendered as images in the sky map.trueToggle whether extra objects are drawn in the sky map.trueToggle whether the Milky Way contour is drawn in the sky map.trueToggle whether the Milky Way contour is filled. When this option is false, the Milky Way is shown as an outline.trueMeta-option to control whether all major planets (and the Sun and Moon) are drawn in the sky map.trueToggle whether major planets (and the Sun and Moon) are rendered as images in the sky map.trueToggle whether major planets (and the Sun and Moon) are labeled in the sky map.trueToggle whether the Sun is drawn in the sky map.trueToggle whether the Moon is drawn in the sky map.trueToggle whether Mercury is drawn in the sky map.trueToggle whether Venus is drawn in the sky map.trueToggle whether Mars is drawn in the sky map.trueToggle whether Jupiter is drawn in the sky map.trueToggle whether Saturn is drawn in the sky map.trueToggle whether Uranus is drawn in the sky map.trueToggle whether Neptune is drawn in the sky map.trueToggle whether Pluto is drawn in the sky map.trueToggle whether stars are drawn in the sky map.trueToggle whether star magnitude (brightness) labels are shown in the sky map.falseToggle whether star name labels are shown in the sky map.trueToggle whether deep-sky object magnitude (brightness) labels are shown in the sky map.falseToggle whether deep-sky object name labels are shown in the sky map.falseThe timescale above which slewing mode is forced on at all times.60The background fill mode for the on-screen information boxes: 0="no BG"; 1="semi-transparent BG"; 2="opaque BG"1Algorithm for the mapping projection.0Use official IAU abbreviations for constellation names.falseUse Latin constellation names.falseUse localized constellation names (if localized names are not available, default to Latin names).trueDisplay the sky with horizontal coordinates (when false, equatorial coordinates will be used).trueToggle whether a centered object automatically gets a name label attached.trueToggle whether a centered solar system object automatically gets a trail attached, as long as it remains centered.trueToggle whether the object under the mouse cursor gets a transient name label.trueToggle whether object positions are corrected for the effects of atmospheric refraction (only applies when horizontal coordinates are used).trueToggle whether corrections due to bending of light around the sun are taken into accountfalseToggle whether the sky is rendered using antialiasing. Lines and shapes are smoother with antialiasing, but rendering the screen will take more time.trueThe zoom level, measured in pixels per radian.250.250.5000000.When zooming in or out, change zoom speed factor by this multiplier.0.20.011.0The faint magnitude limit for drawing asteroids.15.0The maximum magnitude (visibility) to filter the asteroid data download from JPL.12.000Controls the relative number of asteroid name labels drawn in the map.4.0The faint magnitude limit for drawing deep-sky objects, when fully zoomed in.16.0The faint magnitude limit for drawing deep-sky objects, when fully zoomed out.5.0When enabled, objects whose magnitudes are unknown, or not available to KStars, are drawn irrespective of the faint limits set.trueSets the density of stars in the field of view5The faint magnitude limit for drawing stars, when the map is in motion (only applicable if faint stars are set to be hidden while the map is in motion).5.0The relative density for drawing star name and magnitude labels.2.0The relative density for drawing deep-sky object name and magnitude labels.5.0If true, long names (common names) for deep-sky objects are shown in the labels.falseThe maximum solar distance for drawing comets.3.0Use experimental OpenGL backend (deprecated).falseThe state of the clock (running or not)trueObjects in the observing list will be highlighted with a symbol in the map.trueObjects in the observing list will be highlighted with a colored name label in the map.falseThe observing list will prefer DSS imagery while downloading imagery.trueThe observing list will prefer SDSS imagery while downloading imagery.falseCheck this if you use a large Dobsonian telescope. Sorting by percentage current altitude is an easy way of determining what objects are well-placed for observation. However, when using a large Dobsonian telescope, objects close to the zenith are hard to observe. Since tracking there corresponds to a rotation in azimuth, it is both counterintuitive and requires the observer to frequently move the ladder. The region around the zenith where this is particularly frustrating is called the Dobsonian hole. This checkbox makes the observing list consider objects present in the hole as unfit for observation.falseThis specifies the angular radius of the Dobsonian hole, i.e. the region where a large Dobsonian telescope cannot be pointed easily.15.0040.00The name of the color schememoonless-night.colorsThe method for rendering stars: 0="realistic colors"; 1="solid red"; 2="solid black"; 3="solid white"; 4="solid real colors"04The color saturation level of stars (only applicable when using "realistic colors" mode).610The color for the angular-distance measurement ruler.#FFFThe background color of the on-screen information boxes.#000The text color for the on-screen information boxes, when activated by a mouse click.#F00The normal text color of the on-screen information boxes.#FFFThe color for the constellation boundary lines.#222The color for the constellation boundary lines.#222The color for the constellation figure lines.#555The color for the constellation names.#AA7The color for the cardinal compass point labels.#002The color for the ecliptic line.#663The color for the equator line.#FFFThe color for the equatorial coordinate grid lines.#456The color for the horizontal coordinate grid lines.#5A3The color for objects which have extra URL links available.#A00The color for the horizon line and opaque ground.#5A3The color for the local meridian line.#0059b3The color for Messier object symbols.#0F0The color for NGC object symbols.#066The color for IC object symbols.#439The color for the Milky Way contour.#123The color for star name labels.#7AAThe color for deep-sky object name labels.#7AAThe color for solar system object labels.#439The color for solar system object trails.#963The color for the sky background.#002The color for the artificial horizon region.#C82828The color for telescope target symbols.#8B8Color of visible satellites.#00FF00Color of invisible satellites.#FF0000Color of satellites labels.#640000Color of supernova#FFA500The color for user-added object labels.#439The color for RA Guide Error bar in Ekos guide module.#00FF00The color for DEC Guide Error bar in Ekos guide module.#00A5FFThe color for solver FOV box in Ekos alignment module.#FFFF00falseXplanet binary pathKSUtils::getDefaultPath("XplanetPath")Option to use a FIFO file instead of saving to the hard disktrueHow long to wait for XPlanet before giving up in milliseconds1000How long to pause between frames in the XPlanet Animation100Width of xplanet window640Height of xplanet window480If true, display a label in the upper right corner.falseShow local time.trueShow GMT instead of local time.falseSpecify the text of the first line of the label. By default, it says something like "Looking at Earth". Any instances of %t will be replaced by the target name, and any instances of %o will be replaced by the origin name.Specify the point size.12Set the color for the label.#F00Specify the format for the date/time label. This format string is passed to strftime(3). The default is "%c %Z", which shows the date, time, and time zone in the locale’s appropriate date and time representation.%c %ZfalsetruefalsefalseDraw a glare around the sun with a radius of the specified value larger than the Sun. The default value is 28.28Place the observer above a random latitude and longitudefalsePlace the observer above the specified longitude and latitudetrueRender the target body as seen from above the specified latitude (in degrees). The default value is 0.0Place the observer above the specified longitude (in degrees). Longitude is positive going east, negative going west (for the earth and moon), so for example Los Angeles is at -118 or 242. The default value is 0.0The default is no projection. Multiple bodies will not be shown if this option is specified, although shadows will still be drawn.0Use a file as the background image, with the planet to be superimposed upon it. This option is only meaningful with the -projection option. A color may also be supplied.falseUse a file as the background image.falseThe path of the background image.Use a color as the background.trueThe color of the background.#000A star of the specified magnitude will have a pixel brightness of 1. The default value is 10. Stars will be drawn more brightly if this number is larger.10If checked, use an arc file to be plotted against the background stars.falseSpecify an arc file to be plotted against the background stars.If checked, use a config file.falseUse the specified configuration file.If checked, use kstars's FOV.falseIf checked, use the specified marker file.falseSpecify a file containing user-defined marker data to display against the background stars.If checked, write coordinates of the bounding box for each marker in a file.falseWrite coordinates of the bounding box for each marker to this file.If checked, use star map file to draw the background stars.falseStar map file pathThis option is only used when creating JPEG images. The quality can range from 0 to 100. The default value is 80.80Toggle whether satellite tracks are drawn in the sky map.falseToggle whether satellite tracks are drawn in the sky map.falseIf selected, satellites will be draw like stars, otherwise, draw satellites as small colored square.falseToggle whether satellite labels are drawn in the sky map.falseList of selected satellites.Checking this option causes recomputation of current equatorial coordinates from catalog coordinates (i.e. application of precession, nutation and aberration corrections) for every redraw of the map. This makes processing slower when there are many stars to handle, but is more likely to be bug free. There are known bugs in the rendering of stars when this recomputation is avoided.falseThe default size for DSS images downloaded from the Internet.15.0To include parts of the star field, we add some extra padding around DSS images of deep-sky objects. This option configures the total (both sides) padding added to either dimension of the field.10.0Checking this option causes KStars to generate verbose debug information for diagnostic purposes. This may cause slowdown of KStars.falseChecking this option causes KStars to generate regular debug information.trueChecking this option causes KStars to stop generating ANY debug information.falseChecking this option causes KStars log debug messages to the default output used by the platform (e.g. Standard Error).trueChecking this option causes KStars log debug messages to a log file as specified.falseLog FITS Data activity.falseLog INDI devices activity.falseLog Ekos Capture Module activity.falseLog Ekos Focus Module activity.falseLog Ekos Guide Module activity.falseLog Ekos Alignment Module activity.falseLog Ekos Mount Module activity.falsetrueDisplay all captured FITS images in a single tab instead of multiple tabs per image.trueDisplay all captured FITS images in a single FITS Viewer window. By default each camera create its own FITS Viewer instancefalseDisplay all opened FITS images in a single FITS Viewer window.trueBring the FITSViewer window to the foreground when receiving a new image.truefalse!KSUtils::isHardwareLimited()false!KSUtils::isHardwareLimited()!KSUtils::isHardwareLimited()KSUtils::isHardwareLimited()4falsefalse40.00600600truefalsetruetruetruefalseSimulatorsfalsetruefalsetrue1Minimum telescope altitude limit. If the telescope is below this limit, it will be commanded to stop.0Maximum telescope altitude limit. If the telescope is above this limit, it will be commanded to stop.90.0falsefalse10If guide deviation exceeds this limit, the exposure will be automatically aborted and only resumed when the deviation is within this limit.2If HFR deviation exceeds this limit, the autofocus routine will be automatically started.0.5falsefalsefalseSets the time interval before forced autofocus attempts during a capture sequence.60If the target hour angle exceeds this value, Ekos will command a meridian flip and if successful it will resume guiding and capture operations.falsefalseIf set, Ekos will capture a few flat images to determine the optimal exposure time to achieve the desired ADU value.0Maximum difference between measured and target ADU values to deem the value as acceptable.100000000.10falsefalse2.5truefalse130true!KSUtils::isHardwareLimited()!KSUtils::isHardwareLimited()0KSUtils::getDefaultPath("fitsDir")Step size of the absolute focuser. The step size TICKS should be adjusted so that when the focuser moves TICKS steps, the difference in HFR is more than 0.1 pixels. Lower the value when you are close to optimal focus.100Wait for this many seconds after moving the focuser before capturing the next image during AutoFocus.0Wait for this many seconds after resuming guide.0The tolerance specifies the percentage difference between the current focusing position and the minimum obtained during the focusing run. Adjustment of this value is necessary to prevent the focusing algorithm from oscillating back and forth.1Set the maximum travel distance of an absolute focuser.10000Specifies gain value of CCD when performing focusing if supported by camera.0Set box size to select a focus star.64Set horizontal binning of CCD camera while in focus mode.1Set vertical binning of CCD camera while in focus mode.1truefalseDuring full field focusing, stars which are inside this percentage of the frame are filtered out of HFR calculation (default 0%). Detection algorithms may also have an inherent filter.0.0During full field focusing, stars which are outside this percentage of the frame are filtered out of HFR calculation (default 100%). Detection algorithms may also have an inherent filter.100.0falsetruefalse0150001Specifies exposure value of CCD in seconds when performing plate solving.1Set binning index of CCD camera while in alignment mode. Default values 0-3 corresponding to 1x1 to 4x4 binning. 4 is max binning.4Use rotator when performing load and slew.falseThreshold between measured and FITS position angles in arcminutes to consider the load and slew operation successful.30001truefalsefalse300false1500truetruetruetruetrue1true2truetrue30falsePath to astrometry.net solver location.KSUtils::getDefaultPath("AstrometrySolverBinary")falsePath to astrometry.net wcsinfo location.KSUtils::getDefaultPath("AstrometryWCSInfo")falsePath to astrometry.net file location.KSUtils::getDefaultPath("AstrometryConfFile")Astrometry.net Index files Location.KSUtils::getDefaultPath("AstrometryIndexFileLocation")falseKey to access astrometry.net online web services. You must register with astrometry.net to obtain a key.iczikaqstszeptgshttp://nova.astrometry.nettrue180-11.000localhost4400localhost5656010002false1falsefalsefalse36010truefalsefalsefalse21014510500falsefalsefalse2truetruetruetruetruetrue133.33133.330000500050001001000.52truetruefalsefalseLog Ekos Scheduler Module activity.falseSort scheduler jobs by priority and altitude.truetruefalsefalsefalsefalsetruefalse2true5303000000762486243001000NonefalsefalseToggle whether the HIPS sources are drawn in the sky map.false
+
+
+
+ true
+
+
+
+ true
+
+
+
+ false
+
+
+
+ false
+
+
+
+ true
+
+
+
+ 600
+
+
+
+ true
+
+
+
+ true
+
+
+
+ true
+
+
+
+ 30
+
+
+
+ true
+
+
+
+ true
+
+
+
+ true
+
+
diff --git a/kstars/org.kde.kstars.Ekos.Observatory.xml b/kstars/org.kde.kstars.Ekos.Observatory.xml
new file mode 100644
index 000000000..728bc580e
--- /dev/null
+++ b/kstars/org.kde.kstars.Ekos.Observatory.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+