Instrument Neutral Distributed Interface INDI  2.0.2
indilightboxinterface.h
Go to the documentation of this file.
1 /*
2  Light Box / Switch Interface
3  Copyright (C) 2015 Jasem Mutlaq (mutlaqja@ikarustech.com)
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Lesser General Public
7  License as published by the Free Software Foundation; either
8  version 2.1 of the License, or (at your option) any later version.
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  Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public
16  License along with this library; if not, write to the Free Software
17  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 
19 */
20 
21 #pragma once
22 
23 #include "indibase.h"
24 
25 #include <stdint.h>
26 
43 namespace INDI
44 {
45 
47 {
48  public:
49  enum
50  {
53  };
54 
55  protected:
56  LightBoxInterface(DefaultDevice *device, bool isDimmable);
57  virtual ~LightBoxInterface();
58 
63  void initLightBoxProperties(const char *deviceName, const char *groupNam);
64 
69  void isGetLightBoxProperties(const char *deviceName);
70 
72  bool processLightBoxSwitch(const char *dev, const char *name, ISState *states, char *names[], int n);
73 
75  bool processLightBoxNumber(const char *dev, const char *name, double values[], char *names[], int n);
76 
78  bool processLightBoxText(const char *dev, const char *name, char *texts[], char *names[], int n);
79 
81  bool saveLightBoxConfigItems(FILE *fp);
82  bool snoopLightBox(XMLEle *root);
83 
89  virtual bool SetLightBoxBrightness(uint16_t value);
90 
96  virtual bool EnableLightBox(bool enable);
97 
98  // Turn on/off light
101 
102  // Light Intensity
105 
106  // Active devices to snoop
109 
112 
113  private:
114  void addFilterDuration(const char *filterName, uint16_t filterDuration);
115 
116  DefaultDevice *device;
117  uint8_t currentFilterSlot;
118  bool isDimmable;
119 };
120 }
Class to provide extended functionality for devices in addition to the functionality provided by INDI...
INumberVectorProperty LightIntensityNP
bool processLightBoxNumber(const char *dev, const char *name, double values[], char *names[], int n)
Process light box number properties.
ISwitchVectorProperty LightSP
ITextVectorProperty ActiveDeviceTP
virtual bool EnableLightBox(bool enable)
EnableLightBox Turn on/off on a light box. Must be impelemented in the child class.
virtual bool SetLightBoxBrightness(uint16_t value)
setBrightness Set light level. Must be impelemented in the child class, if supported.
bool processLightBoxSwitch(const char *dev, const char *name, ISState *states, char *names[], int n)
Process light box switch properties.
void initLightBoxProperties(const char *deviceName, const char *groupNam)
Initilize light box properties. It is recommended to call this function within initProperties() of yo...
INumberVectorProperty FilterIntensityNP
bool processLightBoxText(const char *dev, const char *name, char *texts[], char *names[], int n)
Process light box text properties.
void isGetLightBoxProperties(const char *deviceName)
isGetLightBoxProperties Get light box properties
LightBoxInterface(DefaultDevice *device, bool isDimmable)
ISState
Switch state.
Definition: indiapi.h:150
Namespace to encapsulate INDI client, drivers, and mediator classes.
One number descriptor.
One switch descriptor.
One text descriptor.
Number vector property descriptor.
Definition: indiapi.h:319
Switch vector property descriptor.
Definition: indiapi.h:367
Text vector property descriptor.
Definition: indiapi.h:246