Instrument Neutral Distributed Interface INDI 2.2.5
baader_dome.h
Go to the documentation of this file.
1/*******************************************************************************
2 Copyright(c) 2014 Jasem Mutlaq. All rights reserved.
3
4 Baader Planetarium Dome INDI Driver
5
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Library General Public
8 License version 2 as published by the Free Software Foundation.
9 .
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
14 .
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
19*******************************************************************************/
20
21#pragma once
22
23#include "indidome.h"
24
25class BaaderDome : public INDI::Dome
26{
27 public:
39
40 BaaderDome();
41 virtual ~BaaderDome() = default;
42
43 virtual const char *getDefaultName() override;
44 virtual bool initProperties() override;
45 virtual bool updateProperties() override;
46 virtual bool saveConfigItems(FILE *fp) override;
47
48 virtual bool Handshake() override;
49
50 virtual void TimerHit() override;
51
52 virtual bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override;
53
54 virtual IPState MoveRel(double azDiff) override;
55 virtual IPState MoveAbs(double az) override;
56 virtual IPState ControlShutter(ShutterOperation operation) override;
57 virtual bool Abort() override;
58
59 // Parking
60 virtual IPState Park() override;
61 virtual IPState UnPark() override;
62 virtual bool SetCurrentPark() override;
63 virtual bool SetDefaultPark() override;
64
65 protected:
66 // Commands
67 bool Ack();
68 bool UpdatePosition();
70 int ControlDomeFlap(FlapOperation operation);
71 bool UpdateFlapStatus();
74
75 // Misc
76 unsigned short MountAzToDomeAz(double mountAz);
77 double DomeAzToMountAz(unsigned short domeAz);
78 bool SetupParms();
79
81
83
87 double targetAz { 0 };
88 double calibrationStart { 0 };
89 double calibrationTarget1 { 0 };
90 double calibrationTarget2 { 0 };
93 bool sim { false };
94 double simShutterTimer { 0 };
95 double simFlapTimer { 0 };
98};
FlapStatus simFlapStatus
Definition baader_dome.h:97
int ControlDomeFlap(FlapOperation operation)
virtual IPState MoveAbs(double az) override
Move the Dome to an absolute azimuth.
bool UpdateShutterStatus()
bool SaveEncoderPosition()
CalibrationStage calibrationStage
Definition baader_dome.h:86
FlapOperation targetFlap
Definition baader_dome.h:92
unsigned short MountAzToDomeAz(double mountAz)
virtual bool saveConfigItems(FILE *fp) override
saveConfigItems Saves the Device Port and Dome Presets in the configuration file
const char * GetFlapStatusString(FlapStatus status)
double simFlapTimer
Definition baader_dome.h:95
double calibrationTarget1
Definition baader_dome.h:89
INDI::PropertySwitch DomeFlapSP
Definition baader_dome.h:82
double calibrationTarget2
Definition baader_dome.h:90
virtual const char * getDefaultName() override
virtual bool Handshake() override
perform handshake with device to check communication
virtual bool updateProperties() override
updateProperties is called whenever there is a change in the CONNECTION status of the driver....
virtual IPState ControlShutter(ShutterOperation operation) override
Open or Close shutter.
FlapStatus flapStatus
Definition baader_dome.h:85
ShutterState simShutterStatus
Definition baader_dome.h:96
double simShutterTimer
Definition baader_dome.h:94
bool UpdateFlapStatus()
bool UpdatePosition()
virtual bool SetDefaultPark() override
SetDefaultPark Set default coordinates/encoders value as the desired parking position.
bool SetupParms()
@ CALIBRATION_UNKNOWN
Definition baader_dome.h:31
@ CALIBRATION_STAGE1
Definition baader_dome.h:32
@ CALIBRATION_STAGE3
Definition baader_dome.h:34
@ CALIBRATION_COMPLETE
Definition baader_dome.h:35
@ CALIBRATION_STAGE2
Definition baader_dome.h:33
virtual bool SetCurrentPark() override
SetCurrentPark Set current coordinates/encoders value as the desired parking position.
virtual bool Abort() override
Abort all dome motion.
virtual bool initProperties() override
Initialize properties initial state and value. The child class must implement this function.
virtual IPState UnPark() override
UnPark dome. The action of the Unpark command is dome specific, but it may include opening the shutte...
ShutterOperation targetShutter
Definition baader_dome.h:91
double calibrationStart
Definition baader_dome.h:88
virtual bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override
Process the client newSwitch command.
virtual IPState Park() override
Goto Park Position. The park position is an absolute azimuth value.
double targetAz
Definition baader_dome.h:87
virtual IPState MoveRel(double azDiff) override
Move the Dome to an relative position.
INDI::PropertySwitch CalibrateSP
Definition baader_dome.h:80
virtual void TimerHit() override
Callback function to be called once SetTimer duration elapses.
double DomeAzToMountAz(unsigned short domeAz)
DomeStatus status
Definition baader_dome.h:84
virtual ~BaaderDome()=default
Class to provide general functionality of a Dome device.
Definition indidome.h:75
ShutterOperation
Shutter operation command.
Definition indidome.h:114
@ SHUTTER_OPENED
Definition indidome.h:147
ISState
Switch state.
Definition indiapi.h:148
IPState
Property state.
Definition indiapi.h:158