Instrument Neutral Distributed Interface INDI  1.9.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 }
indibase.h
INDI::LightBoxInterface
Definition: indilightboxinterface.h:46
INDI::LightBoxInterface::~LightBoxInterface
virtual ~LightBoxInterface()
Definition: indilightboxinterface.cpp:38
ISwitch
One switch descriptor.
INDI::LightBoxInterface::LightSP
ISwitchVectorProperty LightSP
Definition: indilightboxinterface.h:99
INumber
One number descriptor.
INDI::LightBoxInterface::EnableLightBox
virtual bool EnableLightBox(bool enable)
EnableLightBox Turn on/off on a light box. Must be impelemented in the child class.
Definition: indilightboxinterface.cpp:201
INDI::LightBoxInterface::initLightBoxProperties
void initLightBoxProperties(const char *deviceName, const char *groupNam)
Initilize light box properties. It is recommended to call this function within initProperties() of yo...
Definition: indilightboxinterface.cpp:42
INDI::LightBoxInterface::processLightBoxText
bool processLightBoxText(const char *dev, const char *name, char *texts[], char *names[], int n)
Process light box text properties.
Definition: indilightboxinterface.cpp:169
INDI::LightBoxInterface::FLAT_LIGHT_ON
@ FLAT_LIGHT_ON
Definition: indilightboxinterface.h:51
INDI::LightBoxInterface::saveLightBoxConfigItems
bool saveLightBoxConfigItems(FILE *fp)
Definition: indilightboxinterface.cpp:334
INDI::LightBoxInterface::processLightBoxNumber
bool processLightBoxNumber(const char *dev, const char *name, double values[], char *names[], int n)
Process light box number properties.
Definition: indilightboxinterface.cpp:122
INDI::LightBoxInterface::LightIntensityNP
INumberVectorProperty LightIntensityNP
Definition: indilightboxinterface.h:103
INDI::LightBoxInterface::snoopLightBox
bool snoopLightBox(XMLEle *root)
Definition: indilightboxinterface.cpp:215
_ITextVectorProperty
Text vector property descriptor.
Definition: indiapi.h:244
INDI::LightBoxInterface::FLAT_LIGHT_OFF
@ FLAT_LIGHT_OFF
Definition: indilightboxinterface.h:52
INDI::LightBoxInterface::isGetLightBoxProperties
void isGetLightBoxProperties(const char *deviceName)
isGetLightBoxProperties Get light box properties
Definition: indilightboxinterface.cpp:68
_INumberVectorProperty
Number vector property descriptor.
Definition: indiapi.h:317
IText
One text descriptor.
INDI::LightBoxInterface::ActiveDeviceT
IText ActiveDeviceT[1]
Definition: indilightboxinterface.h:108
INDI::LightBoxInterface::FilterIntensityNP
INumberVectorProperty FilterIntensityNP
Definition: indilightboxinterface.h:110
xml_ele_
Definition: lilxml.c:105
INDI::LightBoxInterface::LightIntensityN
INumber LightIntensityN[1]
Definition: indilightboxinterface.h:104
INDI::LightBoxInterface::ActiveDeviceTP
ITextVectorProperty ActiveDeviceTP
Definition: indilightboxinterface.h:107
INDI
Namespace to encapsulate INDI client, drivers, and mediator classes.
Definition: AlignmentSubsystemForClients.cpp:11
INDI::LightBoxInterface::updateLightBoxProperties
bool updateLightBoxProperties()
Definition: indilightboxinterface.cpp:77
INDI::LightBoxInterface::LightS
ISwitch LightS[2]
Definition: indilightboxinterface.h:100
ISState
ISState
Switch state.
Definition: indiapi.h:148
INDI::DefaultDevice
Class to provide extended functionality for devices in addition to the functionality provided by INDI...
Definition: defaultdevice.h:118
INDI::LightBoxInterface::processLightBoxSwitch
bool processLightBoxSwitch(const char *dev, const char *name, ISState *states, char *names[], int n)
Process light box switch properties.
Definition: indilightboxinterface.cpp:93
INDI::LightBoxInterface::FilterIntensityN
INumber * FilterIntensityN
Definition: indilightboxinterface.h:111
INDI::LightBoxInterface::LightBoxInterface
LightBoxInterface(DefaultDevice *device, bool isDimmable)
Definition: indilightboxinterface.cpp:30
_ISwitchVectorProperty
Switch vector property descriptor.
Definition: indiapi.h:365
INDI::LightBoxInterface::SetLightBoxBrightness
virtual bool SetLightBoxBrightness(uint16_t value)
setBrightness Set light level. Must be impelemented in the child class, if supported.
Definition: indilightboxinterface.cpp:208