40 LOG_INFO(
"Dome connected successfully!");
49 LOG_INFO(
"Dome disconnected successfully!");
69 mShutterSwitch[0].fill(
"Open",
"",
ISS_ON);
70 mShutterSwitch[1].fill(
"Close",
"",
ISS_OFF);
72 mShutterSwitch.onUpdate([
this]()
74 if (mShutterSwitch[0].getState() ==
ISS_ON)
81 mRainLight[0].fill(
"Status",
"",
IPS_IDLE);
96 if (mShutterSwitch[0].getState() ==
ISS_ON)
99 LOG_INFO(
"Rain Alert Detected! Dome is already closed.");
104 LOG_INFO(
"Rain threat passed. Opening the dome is now safe.");
107 oldRainState = newRainState;
108 }, BaseDevice::WATCH_NEW_OR_UPDATE);
138 mShutterSwitch.apply(
"Shutter is closing...");
142 mShutterSwitch[0].setState(
ISS_OFF);
143 mShutterSwitch[1].setState(
ISS_ON);
145 mShutterSwitch.setState(
IPS_OK);
146 mShutterSwitch.apply(
"Shutter is closed.");
155 if (mRainLight[0].getState() ==
IPS_ALERT)
158 mShutterSwitch[0].setState(
ISS_OFF);
159 mShutterSwitch[1].setState(
ISS_ON);
160 mShutterSwitch.apply(
"It is raining, cannot open Shutter.");
165 mShutterSwitch.apply(
"Shutter is opening...");
169 mShutterSwitch[0].setState(
ISS_ON);
170 mShutterSwitch[1].setState(
ISS_OFF);
172 mShutterSwitch.setState(
IPS_OK);
173 mShutterSwitch.apply(
"Shutter is open.");
bool Connect() override
Connect to the device. INDI::DefaultDevice implementation connects to appropriate connection interfac...
bool initProperties() override
Initialize properties initial state and value. The child class must implement this function.
bool updateProperties() override
updateProperties is called whenever there is a change in the CONNECTION status of the driver....
bool Disconnect() override
Disconnect from device.
const char * getDefaultName() override
Class to provide basic INDI device functionality.
const char * getDeviceName() const
virtual bool updateProperties()
updateProperties is called whenever there is a change in the CONNECTION status of the driver....
void watchDevice(const char *deviceName, const std::function< void(INDI::BaseDevice)> &callback)
Add a device to the watch list.
virtual bool deleteProperty(const char *propertyName)
Delete a property and unregister it. It will also be deleted from all clients.
void defineProperty(INumberVectorProperty *property)
virtual bool initProperties()
Initialize properties initial state and value. The child class must implement this function.
static void singleShot(int msec, const std::function< void()> &callback)
This static function calls a the given function after a given time interval.
const char * MAIN_CONTROL_TAB
MAIN_CONTROL_TAB Where all the primary controls for the device are located.
std::unique_ptr< Dome > dome(new Dome())
Construct a dome device that the user may operate to open or close the dome shutter door....