Instrument Neutral Distributed Interface INDI 2.2.5
dragonlair.h
Go to the documentation of this file.
1/*******************************************************************************
2 Copyright(c) 2024 Rick Bassham. All rights reserved.
3
4 Dark Dragons Astronomy DragonLAIR
5
6 This program is free software; you can redistribute it and/or modify it
7 under the terms of the GNU General Public License as published by the Free
8 Software Foundation; either version 2 of the License, or (at your option)
9 any later version.
10
11 This program is distributed in the hope that it will be useful, but WITHOUT
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 more details.
15
16 You should have received a copy of the GNU Library General Public License
17 along with this library; see the file COPYING.LIB. If not, write to
18 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 Boston, MA 02110-1301, USA.
20
21 The full GNU General Public License is included in this distribution in the
22 file called LICENSE.
23*******************************************************************************/
24
25#pragma once
26
27#include "indidome.h"
28
29class DragonLAIR : public INDI::Dome
30{
31 public:
32 DragonLAIR();
33 virtual ~DragonLAIR() = default;
34
35 virtual bool initProperties() override;
36 const char *getDefaultName() override;
37 void ISGetProperties(const char *dev) override;
38 bool updateProperties() override;
39 virtual bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override;
40 virtual bool ISNewText(const char * dev, const char * name, char * texts[], char * names[], int n) override;
41 virtual bool saveConfigItems(FILE *fp) override;
42 virtual bool ISSnoopDevice(XMLEle *root) override;
43
44 protected:
45 bool Connect() override;
46 bool Disconnect() override;
47
48 void TimerHit() override;
49
50 virtual IPState Move(DomeDirection dir, DomeMotionCommand operation) override;
51 virtual IPState Park() override;
52 virtual IPState UnPark() override;
53 virtual bool Abort() override;
54
55 private:
56 void updateStatus();
57 void openRoof();
58 void closeRoof();
59 void stopRoof();
60 void discoverDevices();
61
62 INDI::PropertyText FirmwareTP {2};
63 INDI::PropertyText IPAddressTP {1};
64 INDI::PropertySwitch DiscoverSwitchSP {1};
65
66 INDI::PropertyLight SafetySensorLP {4};
67 INDI::PropertyLight LimitSwitchLP {2};
68
69 INDI::PropertyNumber MotorStatsNP {2};
70};
virtual bool Abort() override
Abort all dome motion.
virtual IPState Move(DomeDirection dir, DomeMotionCommand operation) override
Move the Dome in a particular direction.
virtual IPState Park() override
Goto Park Position. The park position is an absolute azimuth value.
virtual bool initProperties() override
Initialize properties initial state and value. The child class must implement this function.
bool Disconnect() override
Disconnect from device.
virtual bool saveConfigItems(FILE *fp) override
saveConfigItems Saves the Device Port and Dome Presets in the configuration file
const char * getDefaultName() override
bool Connect() override
Connect to the device. INDI::DefaultDevice implementation connects to appropriate connection interfac...
bool updateProperties() override
updateProperties is called whenever there is a change in the CONNECTION status of the driver....
virtual bool ISNewText(const char *dev, const char *name, char *texts[], char *names[], int n) override
Process the client newSwitch command.
virtual bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override
Process the client newSwitch command.
virtual IPState UnPark() override
UnPark dome. The action of the Unpark command is dome specific, but it may include opening the shutte...
virtual ~DragonLAIR()=default
void ISGetProperties(const char *dev) override
define the driver's properties to the client. Usually, only a minimum set of properties are defined t...
virtual bool ISSnoopDevice(XMLEle *root) override
Process a snoop event from INDI server. This function is called when a snooped property is updated in...
void TimerHit() override
Callback function to be called once SetTimer duration elapses.
Class to provide general functionality of a Dome device.
Definition indidome.h:75
DomeMotionCommand
Definition indidome.h:97
ISState
Switch state.
Definition indiapi.h:148
IPState
Property state.
Definition indiapi.h:158