Instrument Neutral Distributed Interface INDI  1.9.2
indipropertyswitch.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2021 by Pawel Soja <kernel32.pl@gmail.com>
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Lesser General Public
6  License as published by the Free Software Foundation; either
7  version 2.1 of the License, or (at your option) any later version.
8 
9  This library is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  Lesser General Public License for more details.
13 
14  You should have received a copy of the GNU Lesser General Public
15  License along with this library; if not, write to the Free Software
16  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18 
19 #pragma once
20 
21 #include "indipropertybasic.h"
22 
23 namespace INDI
24 {
25 
26 class PropertySwitchPrivate;
27 class PropertySwitch: public INDI::PropertyBasic<ISwitch>
28 {
29  DECLARE_PRIVATE(PropertySwitch)
30 public:
31  PropertySwitch(size_t count);
33 
34 public:
35  bool update(const ISState states[], const char * const names[], int n);
36 
37  void fill(
38  const char *device, const char *name, const char *label, const char *group,
39  IPerm permission, ISRule rule, double timeout, IPState state
40  );
41 
42 public:
43  void reset();
44  int findOnSwitchIndex() const;
46 
47 public:
48  void setRule(ISRule rule);
49 
50 public:
51  ISRule getRule() const;
52  const char * getRuleAsString() const;
53 };
54 
55 }
IPState
IPState
Property state.
Definition: indiapi.h:158
INDI::PropertySwitch::~PropertySwitch
~PropertySwitch()
Definition: indipropertyswitch.cpp:36
INDI::PropertySwitch
Definition: indipropertyswitch.h:27
indipropertybasic.h
INDI::PropertySwitch::reset
void reset()
Definition: indipropertyswitch.cpp:39
INDI::PropertySwitch::setRule
void setRule(ISRule rule)
Definition: indipropertyswitch.cpp:73
INDI::PropertySwitch::PropertySwitch
PropertySwitch(size_t count)
Definition: indipropertyswitch.cpp:32
INDI::PropertySwitch::fill
void fill(const char *device, const char *name, const char *label, const char *group, IPerm permission, ISRule rule, double timeout, IPState state)
Definition: indipropertyswitch.cpp:63
INDI::PropertySwitch::update
bool update(const ISState states[], const char *const names[], int n)
Definition: indipropertyswitch.cpp:57
device
hid_device * device
Definition: activefocuser_utils.cpp:92
INDI::PropertySwitch::getRuleAsString
const char * getRuleAsString() const
Definition: indipropertyswitch.cpp:85
IPerm
IPerm
Permission hint, with respect to client.
Definition: indiapi.h:181
INDI::WidgetView< ISwitch >
Definition: indipropertyview.h:379
INDI::PropertySwitch::getRule
ISRule getRule() const
Definition: indipropertyswitch.cpp:79
INDI
Namespace to encapsulate INDI client, drivers, and mediator classes.
Definition: AlignmentSubsystemForClients.cpp:11
INDI::PropertyBasic
Definition: indipropertybasic.h:37
INDI::PropertySwitch::findOnSwitchIndex
int findOnSwitchIndex() const
Definition: indipropertyswitch.cpp:45
ISState
ISState
Switch state.
Definition: indiapi.h:148
ISRule
ISRule
Switch vector rule hint.
Definition: indiapi.h:170
INDI::PropertySwitch::findOnSwitch
INDI::WidgetView< ISwitch > * findOnSwitch() const
Definition: indipropertyswitch.cpp:51