File indexing completed on 2024-05-05 15:55:31
0001 /* Ekos Observatory Module 0002 SPDX-FileCopyrightText: Wolfgang Reissenberger <sterne-jaeger@t-online.de> 0003 0004 SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 0007 #pragma once 0008 0009 #include "../auxiliary/dome.h" 0010 #include "observatoryweathermodel.h" 0011 0012 #include <QObject> 0013 0014 0015 namespace Ekos 0016 { 0017 0018 class ObservatoryDomeModel: public QObject 0019 { 0020 Q_OBJECT 0021 0022 public: 0023 ObservatoryDomeModel() = default; 0024 0025 void initModel(Dome *dome); 0026 bool isActive() {return initialized;} 0027 0028 ISD::Dome::Status status(); 0029 ISD::Dome::ShutterStatus shutterStatus(); 0030 0031 // proxies to the underlying dome object 0032 bool canPark() 0033 { 0034 return (domeInterface != nullptr && domeInterface->canPark()); 0035 } 0036 void park(); 0037 void unpark(); 0038 ISD::ParkStatus parkStatus(); 0039 0040 double azimuthPosition() 0041 { 0042 return domeInterface->azimuthPosition(); 0043 } 0044 void setAzimuthPosition(double position) 0045 { 0046 domeInterface->setAzimuthPosition(position); 0047 } 0048 0049 bool canAbsoluteMove() 0050 { 0051 return (domeInterface != nullptr && domeInterface->canAbsoluteMove()); 0052 } 0053 0054 void setRelativePosition(double position) 0055 { 0056 domeInterface->setRelativePosition(position); 0057 } 0058 0059 bool canRelativeMove() 0060 { 0061 return (domeInterface != nullptr && domeInterface->canRelativeMove()); 0062 } 0063 0064 bool isRolloffRoof() 0065 { 0066 return (domeInterface != nullptr && domeInterface->isRolloffRoof()); 0067 } 0068 0069 bool isAutoSync() 0070 { 0071 return (domeInterface != nullptr && domeInterface->isAutoSync()); 0072 } 0073 0074 void setAutoSync(bool activate); 0075 0076 void abort(); 0077 0078 bool hasShutter() 0079 { 0080 return (domeInterface != nullptr && domeInterface->hasShutter()); 0081 } 0082 void openShutter(); 0083 void closeShutter(); 0084 0085 bool moveDome(bool moveCW, bool start); 0086 0087 public slots: 0088 void execute(WeatherActions actions); 0089 0090 0091 private: 0092 Dome *domeInterface; 0093 bool initialized = false; 0094 0095 signals: 0096 void newStatus(ISD::Dome::Status state); 0097 void newParkStatus(ISD::ParkStatus status); 0098 void newShutterStatus(ISD::Dome::ShutterStatus status); 0099 void newAutoSyncStatus(bool enabled); 0100 void azimuthPositionChanged(double position); 0101 void ready(); 0102 void disconnected(); 0103 void newLog(const QString &text); 0104 }; 0105 0106 }