Instrument Neutral Distributed Interface INDI  1.9.2
indipropertyview.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 "indiapi.h"
22 #include "indidevapi.h"
23 #include "indiwidgettraits.h"
24 
25 #include "indidriver.h" // IUSaveConfigXXX (indicom.c)
26 
27 #include "indiwidgetview.h"
28 
29 #include <string>
30 #include <cstring>
31 #include <cstdarg>
32 #include <cstdlib>
33 #include <type_traits>
34 
35 namespace INDI
36 {
37 
38 template <typename> struct WidgetView;
39 template <typename> struct PropertyView;
40 
41 #define PROPERTYVIEW_BASE_ACCESS public
42 // don't use direct access to low-level property
43 //#define PROPERTYVIEW_BASE_ACCESS protected // future
44 
72 template <typename T>
73 struct PropertyView: PROPERTYVIEW_BASE_ACCESS WidgetTraits<T>::PropertyType
74 {
75  using Type = T;
78 
79  friend class Property;
80  friend class PropertyPrivate;
81  friend class BaseDevice;
82  friend class DefaultDevice;
83  template <typename>
84  friend struct WidgetView;
85 
86  template <typename X, typename Needed>
87  using enable_if_is_same_t = typename std::enable_if<std::is_same<X, Needed>::value, bool>::type;
88 public:
89  PropertyView();
90 
91  // #PS: do not delete items, they may be on the stack.
92  //~PropertyView() { for(auto &p: *this) {p.clear();} free(widget()); }
93 
94 public:
95  void setDeviceName(const char *name); /* outside implementation */
96  void setDeviceName(const std::string &name); /* outside implementation */
97 
98  void setName(const char *name); /* outside implementation */
99  void setName(const std::string &name); /* outside implementation */
100 
101  void setLabel(const char *label); /* outside implementation */
102  void setLabel(const std::string &label); /* outside implementation */
103 
104  void setGroupName(const char *name); /* outside implementation */
105  void setGroupName(const std::string &name); /* outside implementation */
106 
107  void setPermission(IPerm permission); /* outside implementation */
108  void setTimeout(double timeout); /* outside implementation */
109  void setState(IPState state);
110 
111  void setTimestamp(const char *timestamp); /* outside implementation */
112  void setTimestamp(const std::string &timestamp); /* outside implementation */
113 
114  void setAux(void *user); /* outside implementation */
115  void setWidgets(WidgetType *w, size_t count); /* outside implementation */
116 
117  template <size_t N>
118  void setWidgets(WidgetType (&w)[N]); /* outside implementation */
119 
120 public: // only for ISwitch
121  void setRule(ISRule rule); /* outside implementation */
122  bool setRule(const std::string &rule); /* outside implementation */
123 
124  template <typename X = T, enable_if_is_same_t<X, ISwitch> = true>
125  void reset() { IUResetSwitch(this); }
126 
127  template <typename X = T, enable_if_is_same_t<X, ISwitch> = true>
128  WidgetType *findOnSwitch() const { return static_cast<WidgetType *>(IUFindOnSwitch(this)); }
129 
130  template <typename X = T, enable_if_is_same_t<X, ISwitch> = true>
131  int findOnSwitchIndex() const { return IUFindOnSwitchIndex(this); }
132 
133 public: // only for INumber
134  template <typename X = T, enable_if_is_same_t<X, INumber> = true>
135  void updateMinMax(); /* outside implementation - only driver side, see indipropertyview_driver.cpp */
136 
137 public: //getters
138  const char *getDeviceName() const { return this->device; }
139  const char *getName() const { return this->name; }
140  const char *getLabel() const { return this->label; }
141  const char *getGroupName() const { return this->group; }
142 
143  IPerm getPermission() const; /* outside implementation */
144  const char *getPermissionAsString() const { return permStr(getPermission()); }
145 
146  ISRule getRule() const; /* outside implementation */
147  const char * getRuleAsString() const { return ruleStr(getRule()); }
148 
149  double getTimeout() const; /* outside implementation */
150  IPState getState() const { return this->s; }
151  const char *getStateAsString() const { return pstateStr(getState()); }
152 
153  const char *getTimestamp() const { return this->timestamp; }
154  void *getAux() const { return this->aux; }
155 
156  int count() const; /* outside implementation */
157  WidgetType *widget() const; /* outside implementation */
158 
159  WidgetType *findWidgetByName(const char *name) const; /* outside implementation */
160 
161 public: //tests
162  bool isEmpty() const { return widget() == nullptr || count() == 0; }
163 
164  bool isNameMatch(const char *otherName) const { return !strcmp(getName(), otherName); }
165  bool isNameMatch(const std::string &otherName) const { return getName() == otherName; }
166 
167  bool isLabelMatch(const char *otherLabel) const { return !strcmp(getLabel(), otherLabel); }
168  bool isLabelMatch(const std::string &otherLabel) const { return getLabel() == otherLabel; }
169 
170 public: // only driver side
171  void save(FILE *f) const; /* outside implementation */
172 
173  void vapply(const char *format, va_list args) const; /* outside implementation - only driver side, see indipropertyview_driver.cpp */
174  void vdefine(const char *format, va_list args) const; /* outside implementation - only driver side, see indipropertyview_driver.cpp */
175 
176  void apply(const char *format, ...) const ATTRIBUTE_FORMAT_PRINTF(2, 3); /* outside implementation - only driver side, see indipropertyview_driver.cpp */
177  void define(const char *format, ...) const ATTRIBUTE_FORMAT_PRINTF(2, 3); /* outside implementation - only driver side, see indipropertyview_driver.cpp */
178 
179  void apply() const { apply(nullptr); }
180  void define() const { define(nullptr); }
181 
182 public:
183  template <typename X = T, enable_if_is_same_t<X, IText> = true>
184  void fill(
185  const char *device, const char *name, const char *label, const char *group,
186  IPerm permission, double timeout, IPState state
187  ); /* outside implementation - only driver side, see indipropertyview_driver.cpp */
188 
189  template <typename X = T, enable_if_is_same_t<X, INumber> = true>
190  void fill(
191  const char *device, const char *name, const char *label, const char *group,
192  IPerm permission, double timeout, IPState state
193  ); /* outside implementation - only driver side, see indipropertyview_driver.cpp */
194 
195  template <typename X = T, enable_if_is_same_t<X, ISwitch> = true>
196  void fill(
197  const char *device, const char *name, const char *label, const char *group,
198  IPerm permission, ISRule rule, double timeout, IPState state
199  ); /* outside implementation - only driver side, see indipropertyview_driver.cpp */
200 
201  template <typename X = T, enable_if_is_same_t<X, ILight> = true>
202  void fill(
203  const char *device, const char *name, const char *label, const char *group,
204  IPState state
205  ); /* outside implementation - only driver side, see indipropertyview_driver.cpp */
206 
207  template <typename X = T, enable_if_is_same_t<X, IBLOB> = true>
208  void fill(
209  const char *device, const char *name, const char *label, const char *group,
210  IPerm permission, double timeout, IPState state
211  ); /* outside implementation - only driver side, see indipropertyview_driver.cpp */
212 
213 public:
214  template <typename X = T, enable_if_is_same_t<X, IText> = true>
215  bool update(const char * const texts[], const char * const names[], int n);
216  /* outside implementation - only driver side, see indipropertyview_driver.cpp */
217 
218  template <typename X = T, enable_if_is_same_t<X, INumber> = true>
219  bool update(const double values[], const char * const names[], int n);
220  /* outside implementation - only driver side, see indipropertyview_driver.cpp */
221 
222  template <typename X = T, enable_if_is_same_t<X, ISwitch> = true>
223  bool update(const ISState states[], const char * const names[], int n);
224  /* outside implementation - only driver side, see indipropertyview_driver.cpp */
225 
226  /*
227  template <typename X = T, enable_if_is_same_t<X, ILight> = true>
228  bool update(..., const char * const names[], int n);
229  */
230 
231  template <typename X = T, enable_if_is_same_t<X, IBLOB> = true>
232  bool update(
233  const int sizes[], const int blobsizes[], const char * const blobs[], const char * const formats[],
234  const char * const names[], int n
235  ); /* outside implementation - only driver side, see indipropertyview_driver.cpp */
236 
237 
238 public:
239  WidgetType *begin() const { return widget(); }
240  WidgetType *end() const { return widget() + count(); }
241 
242  WidgetType *at(size_t index) const { return widget() + index; }
243 public:
244  void clear()
245  {
246  for(auto &p: *this) { p.clear(); }
247  //free(widget()); // #PS: do not delete items, they may be on the stack.
248  memset(this, 0, sizeof(*this));
249  }
250 };
251 
252 template <typename>
253 struct WidgetView;
254 
255 template <>
257 {
258  using Type = IText;
259  template <typename> friend struct PropertyView;
260 
261 public:
262  WidgetView() { memset(this, 0, sizeof(*this)); }
263  WidgetView(const WidgetView &other): Type(other) { this->text = nullptr; setText(other.text); }
264  WidgetView(WidgetView &&other): Type(other) { memset(static_cast<Type*>(&other), 0, sizeof(other)); }
265  WidgetView &operator=(const WidgetView &other) { return *this = WidgetView(other); }
266  WidgetView &operator=(WidgetView &&other) { std::swap(static_cast<Type&>(other), static_cast<Type&>(*this)); return *this; }
267  ~WidgetView() { free(this->text); }
268  void clear() { free(this->text); memset(this, 0, sizeof(*this)); }
269  // bool isNull() const { return reinterpret_cast<const void*>(this) == nullptr; }
270 
271 public: // setters
272  void setParent(ITextVectorProperty *parent) { this->tvp = parent; }
273  void setParent(PropertyView<Type> *parent) { this->tvp = static_cast<ITextVectorProperty*>(parent); }
274 
275  void setName(const char *name) { strncpy(this->name, name, MAXINDINAME); }
276  void setName(const std::string &name) { setName(name.data()); }
277 
278  void setLabel(const char *label) { strncpy(this->label, label, MAXINDILABEL); }
279  void setLabel(const std::string &label) { setLabel(label.data()); }
280 
281  //void setText(const char *text) { free(this->text); this->text = strndup(text, strlen(text)); }
282  void setText(const char *text, size_t size) { this->text = strncpy(static_cast<char*>(realloc(this->text, size + 1)), text, size); this->text[size] = '\0'; }
283  void setText(const char *text) { setText(text, strlen(text)); }
284  void setText(const std::string &text) { setText(text.data(), text.size()); }
285 
286  void setAux(void *user) { this->aux0 = user; }
287  // don't use any other aux!
288 
289 public: //getters
290  const char *getName() const { return this->name; }
291  const char *getLabel() const { return this->label; }
292  const char *getText() const { return this->text; }
293 
294  void *getAux() const { return this->aux0; }
295 
296 public: //tests
297  bool isNameMatch(const char *otherName) const { return !strcmp(getName(), otherName); }
298  bool isNameMatch(const std::string &otherName) const { return getName() == otherName; }
299 
300  bool isLabelMatch(const char *otherLabel) const { return !strcmp(getLabel(), otherLabel); }
301  bool isLabelMatch(const std::string &otherLabel) const { return getLabel() == otherLabel; }
302 
303 public:
304  void fill(const char *name, const char *label, const char *initialText)
305  ; /* outside implementation - only driver side, see indipropertyview_driver.cpp */
306 
307  void fill(const std::string &name, const std::string &label, const std::string &initialText)
308  { fill(name.c_str(), label.c_str(), initialText.c_str()); }
309 };
310 
311 template <>
313 {
314  using Type = INumber;
315  template <typename> friend struct PropertyView;
316 
317 public:
318  WidgetView() { memset(this, 0, sizeof(*this)); }
319  WidgetView(const WidgetView &other): Type(other) { }
320  WidgetView(WidgetView &&other): Type(other) { memset(static_cast<Type*>(&other), 0, sizeof(other)); }
321  WidgetView &operator=(const WidgetView &other) { return *this = WidgetView(other); }
322  WidgetView &operator=(WidgetView &&other) { std::swap(static_cast<Type&>(other), static_cast<Type&>(*this)); return *this; }
324  void clear() { memset(this, 0, sizeof(*this)); }
325  // bool isNull() const { return reinterpret_cast<const void*>(this) == nullptr; }
326 
327 public: // setters
328  void setParent(INumberVectorProperty *parent) { this->nvp = parent; }
329  void setParent(PropertyView<Type> *parent) { this->nvp = static_cast<INumberVectorProperty*>(parent); }
330 
331  void setName(const char *name) { strncpy(this->name, name, MAXINDINAME); }
332  void setName(const std::string &name) { setName(name.data()); }
333 
334  void setLabel(const char *label) { strncpy(this->label, label, MAXINDILABEL); }
335  void setLabel(const std::string &label) { setLabel(label.data()); }
336 
337  void setFormat(const char *format) { strncpy(this->format, format, MAXINDIFORMAT); }
338  void setFormat(const std::string &format) { setLabel(format.data()); }
339 
340  void setMin(double min) { this->min = min; }
341  void setMax(double max) { this->max = max; }
342  void setMinMax(double min, double max) { setMin(min); setMax(max); }
343  void setStep(double step) { this->step = step; }
344  void setValue(double value) { this->value = value; }
345 
346  void setAux(void *user) { this->aux0 = user; }
347  // don't use any other aux!
348 
349 public: //getters
350  const char *getName() const { return this->name; }
351  const char *getLabel() const { return this->label; }
352  const char *getFormat() const { return this->format; }
353 
354  double getMin() const { return this->min; }
355  double getMax() const { return this->max; }
356  double getStep() const { return this->step; }
357  double getValue() const { return this->value; }
358 
359  void *getAux() const { return this->aux0; }
360 
361 public: //tests
362  bool isNameMatch(const char *otherName) const { return !strcmp(getName(), otherName); }
363  bool isNameMatch(const std::string &otherName) const { return getName() == otherName; }
364 
365  bool isLabelMatch(const char *otherLabel) const { return !strcmp(getLabel(), otherLabel); }
366  bool isLabelMatch(const std::string &otherLabel) const { return getLabel() == otherLabel; }
367 
368 public:
369  void fill(const char *name, const char *label, const char *format,
370  double min, double max, double step, double value)
371  ; /* outside implementation - only driver side, see indipropertyview_driver.cpp */
372 
373  void fill(const std::string &name, const std::string &label, const std::string &format,
374  double min, double max, double step, double value)
375  { fill(name.c_str(), label.c_str(), format.c_str(), min, max, step, value); }
376 };
377 
378 template <>
380 {
381  using Type = ISwitch;
382  template <typename> friend struct PropertyView;
383 
384 public:
385  WidgetView() { memset(this, 0, sizeof(*this)); }
386  WidgetView(const WidgetView &other): Type(other) { }
387  WidgetView(WidgetView &&other): Type(other) { memset(static_cast<Type*>(&other), 0, sizeof(other)); }
388  WidgetView &operator=(const WidgetView &other) { return *this = WidgetView(other); }
389  WidgetView &operator=(WidgetView &&other) { std::swap(static_cast<Type&>(other), static_cast<Type&>(*this)); return *this; }
391  void clear() { memset(this, 0, sizeof(*this)); }
392  // bool isNull() const { return reinterpret_cast<const void*>(this) == nullptr; }
393 
394 public: // setters
395  void setParent(ISwitchVectorProperty *parent) { this->svp = parent; }
396  void setParent(PropertyView<Type> *parent) { this->svp = static_cast<ISwitchVectorProperty*>(parent); }
397 
398  void setName(const char *name) { strncpy(this->name, name, MAXINDINAME); }
399  void setName(const std::string &name) { setName(name.data()); }
400 
401  void setLabel(const char *label) { strncpy(this->label, label, MAXINDILABEL); }
402  void setLabel(const std::string &label) { setLabel(label.data()); }
403 
404  void setState(const ISState &state) { this->s = state; }
405  bool setState(const std::string &state) { return crackISState(state.data(), &this->s) == 0; }
406 
407  void setAux(void *user) { this->aux = user; }
408  // don't use any other aux!
409 
410 public: //getters
411  const char *getName() const { return this->name; }
412  const char *getLabel() const { return this->label; }
413 
414  ISState getState() const { return this->s; }
415  const char *getStateAsString() const { return sstateStr(getState()); }
416 
417  void *getAux() const { return this->aux; }
418 
419 
420 public: //tests
421  bool isNameMatch(const char *otherName) const { return !strcmp(getName(), otherName); }
422  bool isNameMatch(const std::string &otherName) const { return getName() == otherName; }
423 
424  bool isLabelMatch(const char *otherLabel) const { return !strcmp(getLabel(), otherLabel); }
425  bool isLabelMatch(const std::string &otherLabel) const { return getLabel() == otherLabel; }
426 
427 public:
428  void fill(const char *name, const char *label, ISState state = ISS_OFF)
429  ; /* outside implementation - only driver side, see indipropertyview_driver.cpp */
430 
431  void fill(const std::string &name, const std::string &label, ISState state = ISS_OFF)
432  { fill(name.c_str(), label.c_str(), state); }
433 };
434 
435 template <>
437 {
438  using Type = ILight;
439  template <typename> friend struct PropertyView;
440 
441 public:
442  WidgetView() { memset(this, 0, sizeof(*this)); }
443  WidgetView(const WidgetView &other): Type(other) { }
444  WidgetView(WidgetView &&other): Type(other) { memset(static_cast<Type*>(&other), 0, sizeof(other)); }
445  WidgetView &operator=(const WidgetView &other) { return *this = WidgetView(other); }
446  WidgetView &operator=(WidgetView &&other) { std::swap(static_cast<Type&>(other), static_cast<Type&>(*this)); return *this; }
448  void clear() { memset(this, 0, sizeof(*this)); }
449  // bool isNull() const { return reinterpret_cast<const void*>(this) == nullptr; }
450 
451 public: // setters
452  void setParent(ILightVectorProperty *parent) { this->lvp = parent; }
453  void setParent(PropertyView<Type> *parent) { this->lvp = static_cast<ILightVectorProperty*>(parent); }
454 
455  void setName(const char *name) { strncpy(this->name, name, MAXINDINAME); }
456  void setName(const std::string &name) { setName(name.data()); }
457 
458  void setLabel(const char *label) { strncpy(this->label, label, MAXINDILABEL); }
459  void setLabel(const std::string &label) { setLabel(label.data()); }
460 
461  void setState(const IPState &state) { this->s = state; }
462  bool setState(const std::string &state) { return crackIPState(state.data(), &this->s) == 0; }
463 
464  void setAux(void *user) { this->aux = user; }
465  // don't use any other aux!
466 
467 public: //getters
468  const char *getName() const { return this->name; }
469  const char *getLabel() const { return this->label; }
470 
471  IPState getState() const { return this->s; }
472  const char *getStateAsString() const { return pstateStr(getState()); }
473 
474  void *getAux() const { return this->aux; }
475 
476 
477 public: //tests
478  bool isNameMatch(const char *otherName) const { return !strcmp(getName(), otherName); }
479  bool isNameMatch(const std::string &otherName) const { return getName() == otherName; }
480 
481  bool isLabelMatch(const char *otherLabel) const { return !strcmp(getLabel(), otherLabel); }
482  bool isLabelMatch(const std::string &otherLabel) const { return getLabel() == otherLabel; }
483 
484 public:
485  void fill(const char *name, const char *label, IPState state = IPS_OK)
486  ; /* outside implementation - only driver side, see indipropertyview_driver.cpp */
487 
488  void fill(const std::string &name, const std::string &&label, IPState state = IPS_OK)
489  { fill(name.c_str(), label.c_str(), state); }
490 };
491 
492 template <>
494 {
495  using Type = IBLOB;
496  template <typename> friend struct PropertyView;
497 
498 public:
499  WidgetView() { memset(this, 0, sizeof(*this)); }
500  WidgetView(const WidgetView &other): Type(other) { }
501  WidgetView(WidgetView &&other): Type(other) { memset(static_cast<Type*>(&other), 0, sizeof(other)); }
502  WidgetView &operator=(const WidgetView &other) { return *this = WidgetView(other); }
503  WidgetView &operator=(WidgetView &&other) { std::swap(static_cast<Type&>(other), static_cast<Type&>(*this)); return *this; }
504  ~WidgetView() { /* free(this->blob); */ }
505  void clear() { /* free(this->blob); */ memset(this, 0, sizeof(*this)); }
506  // bool isNull() const { return reinterpret_cast<const void*>(this) == nullptr; }
507 
508 public: // setters
509  void setParent(IBLOBVectorProperty *parent) { this->bvp = parent; }
510  void setParent(PropertyView<Type> *parent) { this->bvp = static_cast<IBLOBVectorProperty*>(parent); }
511 
512  void setName(const char *name) { strncpy(this->name, name, MAXINDINAME); }
513  void setName(const std::string &name) { setName(name.data()); }
514 
515  void setLabel(const char *label) { strncpy(this->label, label, MAXINDILABEL); }
516  void setLabel(const std::string &label) { setLabel(label.data()); }
517 
518  void setFormat(const char *format) { strncpy(this->format, format, MAXINDIBLOBFMT); }
519  void setFormat(const std::string &format) { setLabel(format.data()); }
520 
521  void setBlob(void *blob) { this->blob = blob; }
522  void setBlobLen(int size) { this->bloblen = size; }
523  void setSize(int size) { this->size = size; }
524 
525  void setAux(void *user) { this->aux0 = user; }
526  // don't use any other aux!
527 
528 public: //getters
529  const char *getName() const { return this->name; }
530  const char *getLabel() const { return this->label; }
531  const char *getFormat() const { return this->format; }
532 
533  const void *getBlob() const { return this->blob; }
534  int getBlobLen() const { return this->bloblen; }
535  int getSize() const { return this->size; }
536 
537  void *getAux() const { return this->aux0; }
538 
539 public: //tests
540  bool isNameMatch(const char *otherName) const { return !strcmp(getName(), otherName); }
541  bool isNameMatch(const std::string &otherName) const { return getName() == otherName; }
542 
543  bool isLabelMatch(const char *otherLabel) const { return !strcmp(getLabel(), otherLabel); }
544  bool isLabelMatch(const std::string &otherLabel) const { return getLabel() == otherLabel; }
545 
546 public:
547  void fill(const char *name, const char *label, const char *format)
548  ; /* outside implementation - only driver side, see indipropertyview_driver.cpp */
549 
550  void fill(const std::string &name, const std::string &label, const std::string &format)
551  { fill(name.c_str(), label.c_str(), format.c_str()); }
552 };
553 
554 
555 
556 
557 /* outside implementation */
558 template <typename T>
560 { memset(this, 0, sizeof(*this)); }
561 
562 template <typename T>
563 inline void PropertyView<T>::setDeviceName(const char *name)
564 { strncpy(this->device, name, MAXINDIDEVICE); }
565 
566 template <typename T>
567 inline void PropertyView<T>::setDeviceName(const std::string &name)
568 { setDeviceName(name.data()); }
569 
570 template <typename T>
571 inline void PropertyView<T>::setName(const char *name)
572 { strncpy(this->name, name, MAXINDINAME); }
573 
574 template <typename T>
575 inline void PropertyView<T>::setName(const std::string &name)
576 { setName(name.data()); }
577 
578 template <typename T>
579 inline void PropertyView<T>::setLabel(const char *label)
580 { strncpy(this->label, label, MAXINDILABEL); }
581 
582 template <typename T>
583 inline void PropertyView<T>::setLabel(const std::string &label)
584 { setLabel(label.data()); }
585 
586 template <typename T>
587 inline void PropertyView<T>::setGroupName(const char *name)
588 { strncpy(this->group, name, MAXINDIGROUP); }
589 
590 template <typename T>
591 inline void PropertyView<T>::setGroupName(const std::string &name)
592 { setGroupName(name.data()); }
593 
594 template <typename T>
596 { this->s = state; }
597 
598 template <typename T>
599 inline void PropertyView<T>::setTimestamp(const char *timestamp)
600 { strncpy(this->timestamp, timestamp, MAXINDITSTAMP); }
601 
602 template <typename T>
603 inline void PropertyView<T>::setTimestamp(const std::string &timestamp)
604 { setTimestamp(timestamp.data()); }
605 
606 template <typename T>
607 template <size_t N>
609 { setWidgets(static_cast<WidgetType*>(w), N); }
610 
611 template <typename T>
612 inline void PropertyView<T>::setAux(void *user)
613 { this->aux = user; }
614 
615 template <>
616 inline void PropertyView<IText>::save(FILE *f) const
617 { IUSaveConfigText(f, this); }
618 
619 template <>
620 inline void PropertyView<INumber>::save(FILE *f) const
621 { IUSaveConfigNumber(f, this); }
622 
623 template <>
624 inline void PropertyView<ISwitch>::save(FILE *f) const
625 { IUSaveConfigSwitch(f, this); }
626 
627 template <>
628 inline void PropertyView<ILight>::save(FILE *f) const
629 { (void)f; /* IUSaveConfigLight(f, this); */ }
630 
631 template <>
632 inline void PropertyView<IBLOB>::save(FILE *f) const
633 { IUSaveConfigBLOB(f, this); }
634 
635 template <typename T>
636 inline void PropertyView<T>::setTimeout(double timeout)
637 { this->timeout = timeout; }
638 
639 template <>
641 { }
642 
643 template <typename T>
644 inline void PropertyView<T>::setPermission(IPerm permission)
645 { this->p = permission; }
646 
647 template <>
649 { }
650 
651 template <typename T>
652 inline void PropertyView<T>::setRule(ISRule)
653 { }
654 
655 template <>
657 { this->r = rule; }
658 
659 template <typename T>
660 inline bool PropertyView<T>::setRule(const std::string &)
661 { return false; }
662 
663 template <>
664 inline bool PropertyView<ISwitch>::setRule(const std::string &rule)
665 { return crackISRule(rule.data(), &this->r) == 0; }
666 
667 template <typename T>
669 { return nullptr; }
670 
671 template <>
673 { return static_cast<WidgetView<IText> *>(IUFindText(this, name)); }
674 
675 template <>
677 { return static_cast<WidgetView<INumber> *>(IUFindNumber(this, name)); }
678 
679 template <>
681 { return static_cast<WidgetView<ISwitch> *>(IUFindSwitch(this, name)); }
682 
683 template <>
685 { return static_cast<WidgetView<ILight> *>(IUFindLight(this, name)); }
686 
687 template <>
689 { return static_cast<WidgetView<IBLOB> *>(IUFindBLOB(this, name)); }
690 
691 template <typename T>
693 { return this->p; }
694 
695 template <>
697 { return IP_RO; }
698 
699 template <typename T>
701 { return ISR_NOFMANY; }
702 
703 template <>
705 { return this->r; }
706 
707 template <typename T>
708 inline double PropertyView<T>::getTimeout() const
709 { return this->timeout; }
710 
711 template <>
712 inline double PropertyView<ILight>::getTimeout() const
713 { return 0; }
714 
715 template <>
716 inline void PropertyView<IText>::setWidgets(WidgetType *w, size_t size)
717 { this->tp = w; this->ntp = size; }
718 
719 template <>
720 inline void PropertyView<INumber>::setWidgets(WidgetType *w, size_t size)
721 { this->np = w; this->nnp = size; }
722 
723 template <>
724 inline void PropertyView<ISwitch>::setWidgets(WidgetType *w, size_t size)
725 { this->sp = w; this->nsp = size; }
726 
727 template <>
728 inline void PropertyView<ILight>::setWidgets(WidgetType *w, size_t size)
729 { this->lp = w; this->nlp = size; }
730 
731 template <>
732 inline void PropertyView<IBLOB>::setWidgets(WidgetType *w, size_t size)
733 { this->bp = w; this->nbp = size; }
734 
735 template <>
736 inline int PropertyView<IText>::count() const
737 { return this->ntp; }
738 
739 template <>
741 { return this->nnp; }
742 
743 template <>
745 { return this->nsp; }
746 
747 template <>
748 inline int PropertyView<ILight>::count() const
749 { return this->nlp; }
750 
751 template <>
752 inline int PropertyView<IBLOB>::count() const
753 { return this->nbp; }
754 
755 template <>
757 { return static_cast<WidgetType*>(this->tp); }
758 
759 template <>
761 { return static_cast<WidgetType*>(this->np); }
762 
763 template <>
765 { return static_cast<WidgetType*>(this->sp); }
766 
767 template <>
769 { return static_cast<WidgetType*>(this->lp); }
770 
771 template <>
773 { return static_cast<WidgetType*>(this->bp); }
774 
775 }
MAXINDIDEVICE
#define MAXINDIDEVICE
Definition: indiapi.h:192
INDI::WidgetView< IText >::setParent
void setParent(ITextVectorProperty *parent)
Definition: indipropertyview.h:272
crackIPState
int crackIPState(const char *str, IPState *ip)
Extract property state (Idle, OK, Busy, Alert) from the supplied string.
Definition: indicom.c:1211
INDI::WidgetView< IBLOB >::getAux
void * getAux() const
Definition: indipropertyview.h:537
INDI::PropertyView::getStateAsString
const char * getStateAsString() const
Definition: indipropertyview.h:151
INDI::WidgetView< IBLOB >::setFormat
void setFormat(const std::string &format)
Definition: indipropertyview.h:519
MAXINDIGROUP
#define MAXINDIGROUP
Definition: indiapi.h:193
IP_RO
@ IP_RO
Definition: indiapi.h:183
INDI::WidgetView< INumber >::WidgetView
WidgetView(const WidgetView &other)
Definition: indipropertyview.h:319
INDI::WidgetView< ILight >::operator=
WidgetView & operator=(const WidgetView &other)
Definition: indipropertyview.h:445
INDI::WidgetView< IText >::WidgetView
WidgetView()
Definition: indipropertyview.h:262
INDI::WidgetView< ISwitch >::isNameMatch
bool isNameMatch(const std::string &otherName) const
Definition: indipropertyview.h:422
INDI::WidgetView< ISwitch >::getAux
void * getAux() const
Definition: indipropertyview.h:417
INDI::WidgetView< INumber >::getMin
double getMin() const
Definition: indipropertyview.h:354
INDI::WidgetView< INumber >::setFormat
void setFormat(const char *format)
Definition: indipropertyview.h:337
INDI::PropertyView::setState
void setState(IPState state)
Definition: indipropertyview.h:595
INDI::PropertyView::getTimeout
double getTimeout() const
Definition: indipropertyview.h:708
INDI::PropertyView::getName
const char * getName() const
Definition: indipropertyview.h:139
INDI::WidgetView< ILight >::setAux
void setAux(void *user)
Definition: indipropertyview.h:464
INDI::WidgetView< INumber >::getMax
double getMax() const
Definition: indipropertyview.h:355
ruleStr
const char * ruleStr(ISRule r)
Definition: indicom.c:1280
INDI::WidgetView< ILight >::isLabelMatch
bool isLabelMatch(const char *otherLabel) const
Definition: indipropertyview.h:481
INDI::WidgetView< IText >::operator=
WidgetView & operator=(const WidgetView &other)
Definition: indipropertyview.h:265
INDI::WidgetView< ILight >::~WidgetView
~WidgetView()
Definition: indipropertyview.h:447
ISwitch
struct _ISwitch ISwitch
INDI::PropertyView::findWidgetByName
WidgetType * findWidgetByName(const char *name) const
Definition: indipropertyview.h:668
IPState
IPState
Property state.
Definition: indiapi.h:158
INDI::WidgetView< IText >::~WidgetView
~WidgetView()
Definition: indipropertyview.h:267
INDI::WidgetView< ILight >::setParent
void setParent(PropertyView< Type > *parent)
Definition: indipropertyview.h:453
INDI::WidgetView< ILight >::setParent
void setParent(ILightVectorProperty *parent)
Definition: indipropertyview.h:452
INDI::WidgetView< ILight >::setLabel
void setLabel(const char *label)
Definition: indipropertyview.h:458
IPS_OK
@ IPS_OK
Definition: indiapi.h:161
INDI::WidgetView< IText >::fill
void fill(const std::string &name, const std::string &label, const std::string &initialText)
Definition: indipropertyview.h:307
crackISState
int crackISState(const char *str, ISState *ip)
Extract switch state (On or Off) from the supplied string.
Definition: indicom.c:1229
INDI::WidgetTraits
Definition: indiwidgettraits.h:27
INDI::WidgetView< INumber >::setName
void setName(const char *name)
Definition: indipropertyview.h:331
min
double min(void)
MAXINDITSTAMP
#define MAXINDITSTAMP
Definition: indiapi.h:196
_ILightVectorProperty
Light vector property descriptor.
Definition: indiapi.h:415
ISwitch
One switch descriptor.
INDI::PropertyView::getRuleAsString
const char * getRuleAsString() const
Definition: indipropertyview.h:147
INDI::WidgetView< IText >::getLabel
const char * getLabel() const
Definition: indipropertyview.h:291
INDI::WidgetView< ILight >
Definition: indipropertyview.h:436
ISS_OFF
@ ISS_OFF
Definition: indiapi.h:150
INDI::PropertyView::isLabelMatch
bool isLabelMatch(const char *otherLabel) const
Definition: indipropertyview.h:167
IBLOB
struct _IBLOB IBLOB
INDI::PropertyView::fill
void fill(const char *device, const char *name, const char *label, const char *group, IPerm permission, double timeout, IPState state)
INDI::PropertyView::setRule
void setRule(ISRule rule)
indidriver.h
INDI::WidgetView< INumber >::getFormat
const char * getFormat() const
Definition: indipropertyview.h:352
INDI::WidgetView< ILight >::clear
void clear()
Definition: indipropertyview.h:448
INDI::PropertyView::vdefine
void vdefine(const char *format, va_list args) const
INDI::WidgetView< IText >::clear
void clear()
Definition: indipropertyview.h:268
indiapi.h
Constants and Data structure definitions for the interface to the reference INDI C API implementation...
INDI::WidgetView< IText >::setText
void setText(const char *text, size_t size)
Definition: indipropertyview.h:282
INDI::WidgetView< IBLOB >::fill
void fill(const std::string &name, const std::string &label, const std::string &format)
Definition: indipropertyview.h:550
INDI::WidgetView< IText >::isLabelMatch
bool isLabelMatch(const char *otherLabel) const
Definition: indipropertyview.h:300
INumber
One number descriptor.
INDI::PropertyView::findOnSwitch
WidgetType * findOnSwitch() const
Definition: indipropertyview.h:128
MAXINDINAME
#define MAXINDINAME
Definition: indiapi.h:190
INDI::WidgetView< IText >::operator=
WidgetView & operator=(WidgetView &&other)
Definition: indipropertyview.h:266
INDI::PropertyView::save
void save(FILE *f) const
ISR_NOFMANY
@ ISR_NOFMANY
Definition: indiapi.h:174
INDI::PropertyView::setLabel
void setLabel(const char *label)
Definition: indipropertyview.h:579
_IBLOBVectorProperty
BLOB (Binary Large Object) vector property descriptor.
Definition: indiapi.h:469
INDI::WidgetView< IBLOB >::getFormat
const char * getFormat() const
Definition: indipropertyview.h:531
permStr
const char * permStr(IPerm p)
Definition: indicom.c:1294
INDI::WidgetView< INumber >::setLabel
void setLabel(const std::string &label)
Definition: indipropertyview.h:335
INDI::PropertyView::getLabel
const char * getLabel() const
Definition: indipropertyview.h:140
INDI::WidgetView< IBLOB >::operator=
WidgetView & operator=(const WidgetView &other)
Definition: indipropertyview.h:502
INDI::PropertyView::define
void define() const
Definition: indipropertyview.h:180
INDI::WidgetView< INumber >::getLabel
const char * getLabel() const
Definition: indipropertyview.h:351
timestamp
const char * timestamp()
Create an ISO 8601 formatted time stamp. The format is YYYY-MM-DDTHH:MM:SS.
Definition: indicom.c:334
IUFindBLOB
IBLOB * IUFindBLOB(const IBLOBVectorProperty *bvp, const char *name)
Find an IBLOB member in a vector BLOB property.
Definition: indicom.c:1381
INDI::PropertyView::setAux
void setAux(void *user)
Definition: indipropertyview.h:612
MAXINDIBLOBFMT
#define MAXINDIBLOBFMT
Definition: indiapi.h:195
INDI::WidgetView< IBLOB >::WidgetView
WidgetView()
Definition: indipropertyview.h:499
IUFindLight
ILight * IUFindLight(const ILightVectorProperty *lvp, const char *name)
Find an ILight member in a vector Light property.
Definition: indicom.c:1371
INDI::WidgetView< INumber >::setMin
void setMin(double min)
Definition: indipropertyview.h:340
INDI::PropertyView::updateMinMax
void updateMinMax()
INDI::WidgetView< IBLOB >::getLabel
const char * getLabel() const
Definition: indipropertyview.h:530
INDI::WidgetView< ILight >::isNameMatch
bool isNameMatch(const std::string &otherName) const
Definition: indipropertyview.h:479
INDI::WidgetView< IText >::getName
const char * getName() const
Definition: indipropertyview.h:290
INDI::WidgetView< IBLOB >::setLabel
void setLabel(const std::string &label)
Definition: indipropertyview.h:516
INDI::WidgetView< INumber >::clear
void clear()
Definition: indipropertyview.h:324
INDI::PropertyView::findOnSwitchIndex
int findOnSwitchIndex() const
Definition: indipropertyview.h:131
IUSaveConfigNumber
void IUSaveConfigNumber(FILE *fp, const INumberVectorProperty *nvp)
Add a number vector property value to the configuration file.
Definition: indicom.c:1434
INDI::WidgetView< ISwitch >::setParent
void setParent(PropertyView< Type > *parent)
Definition: indipropertyview.h:396
INDI::WidgetView< INumber >::getValue
double getValue() const
Definition: indipropertyview.h:357
sstateStr
const char * sstateStr(ISState s)
Definition: indicom.c:1267
INDI::WidgetView< IBLOB >::setFormat
void setFormat(const char *format)
Definition: indipropertyview.h:518
INDI::WidgetView< ILight >::getAux
void * getAux() const
Definition: indipropertyview.h:474
INDI::WidgetView< INumber >::setMinMax
void setMinMax(double min, double max)
Definition: indipropertyview.h:342
INDI::WidgetView< IText >::getText
const char * getText() const
Definition: indipropertyview.h:292
INDI::PropertyView::end
WidgetType * end() const
Definition: indipropertyview.h:240
INDI::WidgetView< ISwitch >::WidgetView
WidgetView()
Definition: indipropertyview.h:385
max
double max(void)
INDI::WidgetView< ISwitch >::operator=
WidgetView & operator=(const WidgetView &other)
Definition: indipropertyview.h:388
INDI::WidgetView< IBLOB >::setBlobLen
void setBlobLen(int size)
Definition: indipropertyview.h:522
IUResetSwitch
void IUResetSwitch(ISwitchVectorProperty *svp)
Reset all switches in a switch vector property to OFF.
Definition: indicom.c:1421
INDI::WidgetView< ISwitch >::fill
void fill(const std::string &name, const std::string &label, ISState state=ISS_OFF)
Definition: indipropertyview.h:431
INDI::WidgetView< INumber >::isLabelMatch
bool isLabelMatch(const char *otherLabel) const
Definition: indipropertyview.h:365
INDI::Property
Provides generic container for INDI properties.
Definition: indiproperty.h:43
INDI::WidgetView< IBLOB >::getBlob
const void * getBlob() const
Definition: indipropertyview.h:533
IUFindOnSwitch
ISwitch * IUFindOnSwitch(const ISwitchVectorProperty *sp)
Returns the first ON switch it finds in the vector switch property.
Definition: indicom.c:1393
INDI::WidgetView< ILight >::operator=
WidgetView & operator=(WidgetView &&other)
Definition: indipropertyview.h:446
INDI::PropertyView::widget
WidgetType * widget() const
_ITextVectorProperty
Text vector property descriptor.
Definition: indiapi.h:244
IUSaveConfigBLOB
void IUSaveConfigBLOB(FILE *fp, const IBLOBVectorProperty *bvp)
Add a BLOB vector property value to the configuration file.
Definition: indicom.c:1449
INDI::WidgetView< ILight >::WidgetView
WidgetView()
Definition: indipropertyview.h:442
IUFindText
IText * IUFindText(const ITextVectorProperty *tvp, const char *name)
Find an IText member in a vector text property.
Definition: indicom.c:1341
INDI::WidgetView< IBLOB >::~WidgetView
~WidgetView()
Definition: indipropertyview.h:504
INDI::WidgetView< ISwitch >::getStateAsString
const char * getStateAsString() const
Definition: indipropertyview.h:415
INDI::WidgetView< IText >::WidgetView
WidgetView(const WidgetView &other)
Definition: indipropertyview.h:263
device
hid_device * device
Definition: activefocuser_utils.cpp:92
INDI::PropertyView::clear
void clear()
Definition: indipropertyview.h:244
INDI::WidgetView< INumber >::setValue
void setValue(double value)
Definition: indipropertyview.h:344
INDI::WidgetView< IBLOB >::setParent
void setParent(IBLOBVectorProperty *parent)
Definition: indipropertyview.h:509
type
__le16 type
Definition: pwc-ioctl.h:2
INDI::WidgetView< INumber >::setMax
void setMax(double max)
Definition: indipropertyview.h:341
INDI::WidgetView< INumber >::setStep
void setStep(double step)
Definition: indipropertyview.h:343
ILight
One light descriptor.
INDI::WidgetView< ISwitch >::isLabelMatch
bool isLabelMatch(const char *otherLabel) const
Definition: indipropertyview.h:424
crackISRule
int crackISRule(const char *str, ISRule *ip)
Extract switch rule (OneOfMany, OnlyOne..etc) from the supplied string.
Definition: indicom.c:1253
INDI::WidgetView< ISwitch >::operator=
WidgetView & operator=(WidgetView &&other)
Definition: indipropertyview.h:389
INDI::WidgetView< ISwitch >::WidgetView
WidgetView(WidgetView &&other)
Definition: indipropertyview.h:387
INDI::PropertyView::isLabelMatch
bool isLabelMatch(const std::string &otherLabel) const
Definition: indipropertyview.h:168
_INumberVectorProperty
Number vector property descriptor.
Definition: indiapi.h:317
INDI::WidgetView< IText >::isNameMatch
bool isNameMatch(const std::string &otherName) const
Definition: indipropertyview.h:298
IUSaveConfigText
void IUSaveConfigText(FILE *fp, const ITextVectorProperty *tvp)
Add a text vector property value to the configuration file.
Definition: indicom.c:1439
INDI::WidgetView< INumber >::isLabelMatch
bool isLabelMatch(const std::string &otherLabel) const
Definition: indipropertyview.h:366
INDI::PropertyView::getPermission
IPerm getPermission() const
Definition: indipropertyview.h:692
IText
One text descriptor.
INDI::PropertyView::begin
WidgetType * begin() const
Definition: indipropertyview.h:239
pstateStr
const char * pstateStr(IPState s)
Definition: indicom.c:1194
indidevapi.h
Interface to the reference INDI C API device implementation on the Device Driver side.
INDI::WidgetView< INumber >::WidgetView
WidgetView()
Definition: indipropertyview.h:318
INDI::WidgetView< ILight >::WidgetView
WidgetView(const WidgetView &other)
Definition: indipropertyview.h:443
INDI::PropertyView::isNameMatch
bool isNameMatch(const std::string &otherName) const
Definition: indipropertyview.h:165
INDI::PropertyView::getTimestamp
const char * getTimestamp() const
Definition: indipropertyview.h:153
INDI::WidgetView< ISwitch >::setAux
void setAux(void *user)
Definition: indipropertyview.h:407
INDI::WidgetView
Definition: indipropertyview.h:38
INDI::PropertyView::vapply
void vapply(const char *format, va_list args) const
INDI::PropertyView::getState
IPState getState() const
Definition: indipropertyview.h:150
INDI::PropertyView::setName
void setName(const char *name)
Definition: indipropertyview.h:571
INDI::PropertyView< ISwitch >::PropertyType
typename WidgetTraits< T >::PropertyType PropertyType
Definition: indipropertyview.h:76
indiwidgetview.h
INDI::WidgetView< IBLOB >
Definition: indipropertyview.h:493
INDI::WidgetView< IBLOB >::WidgetView
WidgetView(WidgetView &&other)
Definition: indipropertyview.h:501
INDI::PropertyView::setTimeout
void setTimeout(double timeout)
Definition: indipropertyview.h:636
INDI::WidgetView< INumber >::~WidgetView
~WidgetView()
Definition: indipropertyview.h:323
INDI::WidgetView< INumber >::operator=
WidgetView & operator=(WidgetView &&other)
Definition: indipropertyview.h:322
INDI::WidgetView< INumber >::getName
const char * getName() const
Definition: indipropertyview.h:350
INDI::WidgetView< ISwitch >::isNameMatch
bool isNameMatch(const char *otherName) const
Definition: indipropertyview.h:421
INDI::WidgetView< ISwitch >::setName
void setName(const std::string &name)
Definition: indipropertyview.h:399
INDI::PropertyView::isNameMatch
bool isNameMatch(const char *otherName) const
Definition: indipropertyview.h:164
INDI::PropertyView::update
bool update(const char *const texts[], const char *const names[], int n)
INDI::WidgetView< ILight >::setLabel
void setLabel(const std::string &label)
Definition: indipropertyview.h:459
INDI::PropertyView::setPermission
void setPermission(IPerm permission)
Definition: indipropertyview.h:644
INDI::WidgetView< ILight >::getStateAsString
const char * getStateAsString() const
Definition: indipropertyview.h:472
INDI::WidgetView< IBLOB >::isNameMatch
bool isNameMatch(const char *otherName) const
Definition: indipropertyview.h:540
INDI::PropertyPrivate
Definition: indiproperty_p.h:52
INumber
struct _INumber INumber
IPerm
IPerm
Permission hint, with respect to client.
Definition: indiapi.h:181
INDI::WidgetView< ILight >::setState
bool setState(const std::string &state)
Definition: indipropertyview.h:462
INDI::WidgetView< IText >::isNameMatch
bool isNameMatch(const char *otherName) const
Definition: indipropertyview.h:297
IUFindNumber
INumber * IUFindNumber(const INumberVectorProperty *nvp, const char *name)
Find an INumber member in a number text property.
Definition: indicom.c:1351
INDI::PropertyView::getRule
ISRule getRule() const
Definition: indipropertyview.h:700
INDI::WidgetView< ILight >::setName
void setName(const std::string &name)
Definition: indipropertyview.h:456
MAXINDIFORMAT
#define MAXINDIFORMAT
Definition: indiapi.h:194
INDI::WidgetView< ISwitch >::clear
void clear()
Definition: indipropertyview.h:391
INDI::WidgetView< INumber >::isNameMatch
bool isNameMatch(const char *otherName) const
Definition: indipropertyview.h:362
INDI::WidgetView< ISwitch >
Definition: indipropertyview.h:379
INDI::WidgetView< ISwitch >::getState
ISState getState() const
Definition: indipropertyview.h:414
INDI::WidgetView< IBLOB >::getSize
int getSize() const
Definition: indipropertyview.h:535
INDI::PropertyView
Provides decorator for Low-Level IXXXVectorProperty/IXXX.
Definition: indipropertyview.h:39
INDI::WidgetView< IBLOB >::setAux
void setAux(void *user)
Definition: indipropertyview.h:525
INDI::WidgetView< ILight >::isNameMatch
bool isNameMatch(const char *otherName) const
Definition: indipropertyview.h:478
INDI::WidgetView< ILight >::setName
void setName(const char *name)
Definition: indipropertyview.h:455
INDI::PropertyView::apply
void void void apply() const
Definition: indipropertyview.h:179
INDI::WidgetView< IText >::setLabel
void setLabel(const std::string &label)
Definition: indipropertyview.h:279
INDI::WidgetView< IBLOB >::isLabelMatch
bool isLabelMatch(const char *otherLabel) const
Definition: indipropertyview.h:543
INDI::WidgetView< ISwitch >::getLabel
const char * getLabel() const
Definition: indipropertyview.h:412
INDI::WidgetView< IText >::setText
void setText(const std::string &text)
Definition: indipropertyview.h:284
ILight
struct _ILight ILight
INDI::WidgetView< IText >::getAux
void * getAux() const
Definition: indipropertyview.h:294
INDI::WidgetView< ISwitch >::getName
const char * getName() const
Definition: indipropertyview.h:411
INDI::WidgetView< INumber >::isNameMatch
bool isNameMatch(const std::string &otherName) const
Definition: indipropertyview.h:363
INDI::PropertyView::setDeviceName
void setDeviceName(const char *name)
Definition: indipropertyview.h:563
Type
The Interface class is the base class for the DSP plugins of INDI.
INDI::WidgetView< ISwitch >::setState
bool setState(const std::string &state)
Definition: indipropertyview.h:405
INDI::WidgetView< ILight >::setState
void setState(const IPState &state)
Definition: indipropertyview.h:461
INDI::WidgetView< INumber >::WidgetView
WidgetView(WidgetView &&other)
Definition: indipropertyview.h:320
INDI::WidgetView< INumber >::setParent
void setParent(PropertyView< Type > *parent)
Definition: indipropertyview.h:329
INDI::PropertyView::setWidgets
void setWidgets(WidgetType *w, size_t count)
INDI::WidgetView< INumber >::setFormat
void setFormat(const std::string &format)
Definition: indipropertyview.h:338
INDI::WidgetView< IBLOB >::isLabelMatch
bool isLabelMatch(const std::string &otherLabel) const
Definition: indipropertyview.h:544
INDI::WidgetView< IBLOB >::getName
const char * getName() const
Definition: indipropertyview.h:529
INDI::WidgetView< ISwitch >::setState
void setState(const ISState &state)
Definition: indipropertyview.h:404
INDI::WidgetView< IBLOB >::setLabel
void setLabel(const char *label)
Definition: indipropertyview.h:515
INDI::WidgetView< IBLOB >::setName
void setName(const std::string &name)
Definition: indipropertyview.h:513
INDI::WidgetView< INumber >::setParent
void setParent(INumberVectorProperty *parent)
Definition: indipropertyview.h:328
INDI
Namespace to encapsulate INDI client, drivers, and mediator classes.
Definition: AlignmentSubsystemForClients.cpp:11
IText
struct _IText IText
INDI::WidgetView< IText >::WidgetView
WidgetView(WidgetView &&other)
Definition: indipropertyview.h:264
INDI::WidgetView< IBLOB >::WidgetView
WidgetView(const WidgetView &other)
Definition: indipropertyview.h:500
INDI::WidgetView< INumber >::setAux
void setAux(void *user)
Definition: indipropertyview.h:346
INDI::WidgetView< IText >::setName
void setName(const char *name)
Definition: indipropertyview.h:275
INDI::WidgetView< ILight >::getName
const char * getName() const
Definition: indipropertyview.h:468
INDI::WidgetView< IBLOB >::setParent
void setParent(PropertyView< Type > *parent)
Definition: indipropertyview.h:510
INDI::WidgetView< INumber >::getStep
double getStep() const
Definition: indipropertyview.h:356
INDI::PropertyView::getDeviceName
const char * getDeviceName() const
Definition: indipropertyview.h:138
INDI::WidgetView< ISwitch >::setLabel
void setLabel(const char *label)
Definition: indipropertyview.h:401
INDI::WidgetView< ISwitch >::setParent
void setParent(ISwitchVectorProperty *parent)
Definition: indipropertyview.h:395
PROPERTYVIEW_BASE_ACCESS
#define PROPERTYVIEW_BASE_ACCESS
Definition: indipropertyview.h:41
INDI::WidgetView< IBLOB >::setSize
void setSize(int size)
Definition: indipropertyview.h:523
INDI::WidgetView< IBLOB >::setName
void setName(const char *name)
Definition: indipropertyview.h:512
INDI::WidgetView< IBLOB >::getBlobLen
int getBlobLen() const
Definition: indipropertyview.h:534
ATTRIBUTE_FORMAT_PRINTF
#define ATTRIBUTE_FORMAT_PRINTF(A, B)
Definition: indidevapi.h:140
INDI::WidgetView< IText >::isLabelMatch
bool isLabelMatch(const std::string &otherLabel) const
Definition: indipropertyview.h:301
MAXINDILABEL
#define MAXINDILABEL
Definition: indiapi.h:191
INDI::WidgetView< INumber >::getAux
void * getAux() const
Definition: indipropertyview.h:359
INDI::WidgetView< ILight >::WidgetView
WidgetView(WidgetView &&other)
Definition: indipropertyview.h:444
INDI::WidgetView< IText >::setName
void setName(const std::string &name)
Definition: indipropertyview.h:276
INDI::PropertyView::WidgetType
WidgetView< T > WidgetType
Definition: indipropertyview.h:77
INDI::WidgetView< IBLOB >::isNameMatch
bool isNameMatch(const std::string &otherName) const
Definition: indipropertyview.h:541
INDI::WidgetView< IBLOB >::operator=
WidgetView & operator=(WidgetView &&other)
Definition: indipropertyview.h:503
ISState
ISState
Switch state.
Definition: indiapi.h:148
INDI::PropertyView::getAux
void * getAux() const
Definition: indipropertyview.h:154
INDI::WidgetView< ISwitch >::setName
void setName(const char *name)
Definition: indipropertyview.h:398
IUFindSwitch
ISwitch * IUFindSwitch(const ISwitchVectorProperty *svp, const char *name)
Find an ISwitch member in a vector switch property.
Definition: indicom.c:1361
IUFindOnSwitchIndex
int IUFindOnSwitchIndex(const ISwitchVectorProperty *sp)
Returns the index of first ON switch it finds in the vector switch property.
Definition: indicom.c:1403
INDI::PropertyView::count
int count() const
INDI::WidgetView< ILight >::fill
void fill(const std::string &name, const std::string &&label, IPState state=IPS_OK)
Definition: indipropertyview.h:488
indiwidgettraits.h
ISRule
ISRule
Switch vector rule hint.
Definition: indiapi.h:170
IUSaveConfigSwitch
void IUSaveConfigSwitch(FILE *fp, const ISwitchVectorProperty *svp)
Add a switch vector property value to the configuration file.
Definition: indicom.c:1444
INDI::WidgetView< IText >::setLabel
void setLabel(const char *label)
Definition: indipropertyview.h:278
INDI::PropertyView::reset
void reset()
Definition: indipropertyview.h:125
INDI::PropertyView::getPermissionAsString
const char * getPermissionAsString() const
Definition: indipropertyview.h:144
INDI::WidgetView< IText >
Definition: indipropertyview.h:256
INDI::DefaultDevice
Class to provide extended functionality for devices in addition to the functionality provided by INDI...
Definition: defaultdevice.h:118
INDI::WidgetView< IText >::setParent
void setParent(PropertyView< Type > *parent)
Definition: indipropertyview.h:273
INDI::WidgetView< INumber >::setLabel
void setLabel(const char *label)
Definition: indipropertyview.h:334
INDI::PropertyView::setTimestamp
void setTimestamp(const char *timestamp)
Definition: indipropertyview.h:599
INDI::WidgetView< IBLOB >::setBlob
void setBlob(void *blob)
Definition: indipropertyview.h:521
INDI::WidgetView< INumber >::fill
void fill(const std::string &name, const std::string &label, const std::string &format, double min, double max, double step, double value)
Definition: indipropertyview.h:373
INDI::WidgetView< INumber >
Definition: indipropertyview.h:312
INDI::WidgetView< ISwitch >::~WidgetView
~WidgetView()
Definition: indipropertyview.h:390
INDI::WidgetView< IText >::setAux
void setAux(void *user)
Definition: indipropertyview.h:286
INDI::WidgetView< INumber >::operator=
WidgetView & operator=(const WidgetView &other)
Definition: indipropertyview.h:321
INDI::WidgetView< ISwitch >::setLabel
void setLabel(const std::string &label)
Definition: indipropertyview.h:402
INDI::PropertyView< ISwitch >::enable_if_is_same_t
typename std::enable_if< std::is_same< X, Needed >::value, bool >::type enable_if_is_same_t
Definition: indipropertyview.h:87
INDI::WidgetView< ISwitch >::WidgetView
WidgetView(const WidgetView &other)
Definition: indipropertyview.h:386
INDI::PropertyView::isEmpty
bool isEmpty() const
Definition: indipropertyview.h:162
INDI::BaseDevice
Class to provide basic INDI device functionality.
Definition: basedevice.h:45
INDI::PropertyView::getGroupName
const char * getGroupName() const
Definition: indipropertyview.h:141
IBLOB
One Blob (Binary Large Object) descriptor.
INDI::WidgetView< ILight >::isLabelMatch
bool isLabelMatch(const std::string &otherLabel) const
Definition: indipropertyview.h:482
INDI::WidgetView< ISwitch >::isLabelMatch
bool isLabelMatch(const std::string &otherLabel) const
Definition: indipropertyview.h:425
INDI::PropertyView::setGroupName
void setGroupName(const char *name)
Definition: indipropertyview.h:587
INDI::WidgetView< IText >::setText
void setText(const char *text)
Definition: indipropertyview.h:283
INDI::PropertyView::at
WidgetType * at(size_t index) const
Definition: indipropertyview.h:242
INDI::PropertyView::PropertyView
PropertyView()
Definition: indipropertyview.h:559
_ISwitchVectorProperty
Switch vector property descriptor.
Definition: indiapi.h:365
INDI::WidgetView< IBLOB >::clear
void clear()
Definition: indipropertyview.h:505
INDI::WidgetView< INumber >::setName
void setName(const std::string &name)
Definition: indipropertyview.h:332
INDI::WidgetView< ILight >::getLabel
const char * getLabel() const
Definition: indipropertyview.h:469
INDI::WidgetView< ILight >::getState
IPState getState() const
Definition: indipropertyview.h:471