Instrument Neutral Distributed Interface INDI 2.2.5
indipropertynumber.cpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2021 by Pawel Soja <[email protected]>
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#include "indipropertynumber.h"
21
22namespace INDI
23{
24
28
31
35
37 : PropertyBasic<INumber>(property_private_cast<PropertyNumberPrivate>(property.d_ptr))
38{ }
39
42
43bool PropertyNumber::update(const double values[], const char * const names[], int n)
44{
45 D_PTR(PropertyNumber);
46 return d->typedProperty.update(values, names, n) && (emitUpdate(), true);
47}
48
50 const char *device, const char *name, const char *label, const char *group,
51 IPerm permission, double timeout, IPState state
52)
53{
54 D_PTR(PropertyNumber);
55 d->typedProperty.setWidgets(d->widgets.data(), d->widgets.size());
56 d->typedProperty.fill(device, name, label, group, permission, timeout, state);
57}
58
60{
61 D_PTR(PropertyNumber);
62 d->typedProperty.updateMinMax();
63}
64
65bool PropertyNumber::isUpdated(const double values[], const char * const names[], int n) const
66{
67 D_PTR(const PropertyNumber);
68 return d->typedProperty.isUpdated(values, names, n);
69}
70
71}
hid_device * device
bool isUpdated(const double values[], const char *const names[], int n) const
bool update(const double values[], const char *const names[], int n)
void fill(const char *device, const char *name, const char *label, const char *group, IPerm permission, double timeout, IPState state)
Provides generic container for INDI properties.
friend class PropertyNumber
IPerm
Permission hint, with respect to client.
Definition indiapi.h:181
IPState
Property state.
Definition indiapi.h:158
Namespace to encapsulate INDI client, drivers, and mediator classes.
One number descriptor.