Instrument Neutral Distributed Interface INDI 2.2.5
light_panel_simulator.cpp
Go to the documentation of this file.
1/*******************************************************************************
2 Light Panel Simulator
3
4 SPDX-FileCopyrightText: 2021 Jasem Mutlaq
5 SPDX-License-Identifier: LGPL-2.0-or-later
6*******************************************************************************/
7
9
10static std::unique_ptr<LightPanelSimulator> simulator(new LightPanelSimulator());
11
15
17{
19
20 // Get Light box properties
22}
23
32
39
46
47bool LightPanelSimulator::ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n)
48{
49 if (LI::processNumber(dev, name, values, names, n))
50 return true;
51
52 return INDI::DefaultDevice::ISNewNumber(dev, name, values, names, n);
53}
54
55bool LightPanelSimulator::ISNewText(const char *dev, const char *name, char *texts[], char *names[], int n)
56{
57 if (LI::processText(dev, name, texts, names, n))
58 return true;
59
60 return INDI::DefaultDevice::ISNewText(dev, name, texts, names, n);
61}
62
63bool LightPanelSimulator::ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n)
64{
65 if (LI::processSwitch(dev, name, states, names, n))
66 return true;
67
68 return INDI::DefaultDevice::ISNewSwitch(dev, name, states, names, n);
69}
70
76
78{
79 INDI_UNUSED(value);
80 return true;
81}
82
84{
85 INDI_UNUSED(enable);
86 return true;
87}
virtual bool updateProperties()
updateProperties is called whenever there is a change in the CONNECTION status of the driver....
virtual bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n)
Process the client newSwitch command.
virtual void ISGetProperties(const char *dev)
define the driver's properties to the client. Usually, only a minimum set of properties are defined t...
virtual bool ISSnoopDevice(XMLEle *root)
Process a snoop event from INDI server. This function is called when a snooped property is updated in...
void setDriverInterface(uint32_t value)
setInterface Set driver interface. By default the driver interface is set to GENERAL_DEVICE....
virtual bool saveConfigItems(FILE *fp)
saveConfigItems Save specific properties in the provide config file handler. Child class usually over...
virtual bool initProperties()
Initialize properties initial state and value. The child class must implement this function.
void addAuxControls()
Add Debug, Simulation, and Configuration options to the driver.
virtual bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n)
Process the client newNumber command.
virtual bool ISNewText(const char *dev, const char *name, char *texts[], char *names[], int n)
Process the client newSwitch command.
void initProperties(const char *group, uint32_t capabilities)
Initialize light box properties. It is recommended to call this function within initProperties() of y...
void ISGetProperties(const char *deviceName)
isGetLightBoxProperties Get light box properties
bool processSwitch(const char *dev, const char *name, ISState *states, char *names[], int n)
Process light box switch properties.
bool processText(const char *dev, const char *name, char *texts[], char *names[], int n)
Process light box text properties.
bool processNumber(const char *dev, const char *name, double values[], char *names[], int n)
Process light box number properties.
Provides interface to implement controllable light box/switch device.
bool updateProperties() override
updateProperties is called whenever there is a change in the CONNECTION status of the driver....
bool saveConfigItems(FILE *fp) override
saveConfigItems Save specific properties in the provide config file handler. Child class usually over...
bool ISNewText(const char *dev, const char *name, char *texts[], char *names[], int n) override
Process the client newSwitch command.
virtual bool SetLightBoxBrightness(uint16_t value) override
setBrightness Set light level. Must be implemented in the child class, if supported.
bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n) override
Process the client newNumber command.
bool ISSnoopDevice(XMLEle *root) override
Process a snoop event from INDI server. This function is called when a snooped property is updated in...
virtual bool EnableLightBox(bool enable) override
EnableLightBox Turn on/off on a light box. Must be implemented in the child class.
bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override
Process the client newSwitch command.
bool initProperties() override
Initialize properties initial state and value. The child class must implement this function.
void ISGetProperties(const char *dev) override
define the driver's properties to the client. Usually, only a minimum set of properties are defined t...
const char * MAIN_CONTROL_TAB
MAIN_CONTROL_TAB Where all the primary controls for the device are located.
ISState
Switch state.
Definition indiapi.h:148
#define INDI_UNUSED(x)
Definition indidevapi.h:132