yocto_segmenteddisplay.h
Go to the documentation of this file.
1 /*********************************************************************
2  *
3  * $Id: yocto_segmenteddisplay.h 28748 2017-10-03 08:23:39Z seb $
4  *
5  * Declares yFindSegmentedDisplay(), the high-level API for SegmentedDisplay functions
6  *
7  * - - - - - - - - - License information: - - - - - - - - -
8  *
9  * Copyright (C) 2011 and beyond by Yoctopuce Sarl, Switzerland.
10  *
11  * Yoctopuce Sarl (hereafter Licensor) grants to you a perpetual
12  * non-exclusive license to use, modify, copy and integrate this
13  * file into your software for the sole purpose of interfacing
14  * with Yoctopuce products.
15  *
16  * You may reproduce and distribute copies of this file in
17  * source or object form, as long as the sole purpose of this
18  * code is to interface with Yoctopuce products. You must retain
19  * this notice in the distributed source file.
20  *
21  * You should refer to Yoctopuce General Terms and Conditions
22  * for additional information regarding your rights and
23  * obligations.
24  *
25  * THE SOFTWARE AND DOCUMENTATION ARE PROVIDED 'AS IS' WITHOUT
26  * WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING
27  * WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY, FITNESS
28  * FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO
29  * EVENT SHALL LICENSOR BE LIABLE FOR ANY INCIDENTAL, SPECIAL,
30  * INDIRECT OR CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA,
31  * COST OF PROCUREMENT OF SUBSTITUTE GOODS, TECHNOLOGY OR
32  * SERVICES, ANY CLAIMS BY THIRD PARTIES (INCLUDING BUT NOT
33  * LIMITED TO ANY DEFENSE THEREOF), ANY CLAIMS FOR INDEMNITY OR
34  * CONTRIBUTION, OR OTHER SIMILAR COSTS, WHETHER ASSERTED ON THE
35  * BASIS OF CONTRACT, TORT (INCLUDING NEGLIGENCE), BREACH OF
36  * WARRANTY, OR OTHERWISE.
37  *
38  *********************************************************************/
39 
40 
41 #ifndef YOCTO_SEGMENTEDDISPLAY_H
42 #define YOCTO_SEGMENTEDDISPLAY_H
43 
44 #include "yocto_api.h"
45 #include <cfloat>
46 #include <cmath>
47 #include <map>
48 
49 //--- (YSegmentedDisplay return codes)
50 //--- (end of YSegmentedDisplay return codes)
51 //--- (YSegmentedDisplay definitions)
52 class YSegmentedDisplay; // forward declaration
53 
54 typedef void (*YSegmentedDisplayValueCallback)(YSegmentedDisplay *func, const string& functionValue);
55 #ifndef _Y_DISPLAYMODE_ENUM
56 #define _Y_DISPLAYMODE_ENUM
57 typedef enum {
64 #endif
65 #define Y_DISPLAYEDTEXT_INVALID (YAPI_INVALID_STRING)
66 //--- (end of YSegmentedDisplay definitions)
67 
68 //--- (YSegmentedDisplay declaration)
75 #ifdef __BORLANDC__
76 #pragma option push -w-8022
77 #endif
78 //--- (end of YSegmentedDisplay declaration)
79 protected:
80  //--- (YSegmentedDisplay attributes)
81  // Attributes (function value cache)
85 
86  friend YSegmentedDisplay *yFindSegmentedDisplay(const string& func);
88 
89  // Function-specific method for parsing of JSON output and caching result
90  virtual int _parseAttr(YJSONObject* json_val);
91 
92  // Constructor is protected, use yFindSegmentedDisplay factory function to instantiate
93  YSegmentedDisplay(const string& func);
94  //--- (end of YSegmentedDisplay attributes)
95 
96 public:
98  //--- (YSegmentedDisplay accessors declaration)
99 
100  static const string DISPLAYEDTEXT_INVALID;
101  static const Y_DISPLAYMODE_enum DISPLAYMODE_DISCONNECTED = Y_DISPLAYMODE_DISCONNECTED;
102  static const Y_DISPLAYMODE_enum DISPLAYMODE_MANUAL = Y_DISPLAYMODE_MANUAL;
103  static const Y_DISPLAYMODE_enum DISPLAYMODE_AUTO1 = Y_DISPLAYMODE_AUTO1;
104  static const Y_DISPLAYMODE_enum DISPLAYMODE_AUTO60 = Y_DISPLAYMODE_AUTO60;
105  static const Y_DISPLAYMODE_enum DISPLAYMODE_INVALID = Y_DISPLAYMODE_INVALID;
106 
114  string get_displayedText(void);
115 
116  inline string displayedText(void)
117  { return this->get_displayedText(); }
118 
128  int set_displayedText(const string& newval);
129  inline int setDisplayedText(const string& newval)
130  { return this->set_displayedText(newval); }
131 
132  Y_DISPLAYMODE_enum get_displayMode(void);
133 
135  { return this->get_displayMode(); }
136 
137  int set_displayMode(Y_DISPLAYMODE_enum newval);
139  { return this->set_displayMode(newval); }
140 
168  static YSegmentedDisplay* FindSegmentedDisplay(string func);
169 
183 
184  virtual int _invokeValueCallback(string value);
185 
186 
187  inline static YSegmentedDisplay* Find(string func)
189 
197  YSegmentedDisplay *nextSegmentedDisplay(void);
198  inline YSegmentedDisplay *next(void)
199  { return this->nextSegmentedDisplay();}
200 
210  static YSegmentedDisplay* FirstSegmentedDisplay(void);
211  inline static YSegmentedDisplay* First(void)
213 #ifdef __BORLANDC__
214 #pragma option pop
215 #endif
216  //--- (end of YSegmentedDisplay accessors declaration)
217 };
218 
219 //--- (YSegmentedDisplay functions declaration)
220 
248 inline YSegmentedDisplay* yFindSegmentedDisplay(const string& func)
261 
262 //--- (end of YSegmentedDisplay functions declaration)
263 
264 #endif
static YSegmentedDisplay * FindSegmentedDisplay(string func)
int setDisplayMode(Y_DISPLAYMODE_enum newval)
void(* YSegmentedDisplayValueCallback)(YSegmentedDisplay *func, const string &functionValue)
static const string DISPLAYEDTEXT_INVALID
static YSegmentedDisplay * Find(string func)
virtual int _parseAttr(YJSONObject *json_val)
Definition: yocto_api.cpp:2367
YSegmentedDisplay * yFindSegmentedDisplay(const string &func)
Y_DISPLAYMODE_enum _displayMode
virtual int registerValueCallback(YFunctionValueCallback callback)
Definition: yocto_api.cpp:2544
static YSegmentedDisplay * First(void)
#define YOCTO_CLASS_EXPORT
Definition: yocto_api.h:61
int setDisplayedText(const string &newval)
YSegmentedDisplay * next(void)
YSegmentedDisplayValueCallback _valueCallbackSegmentedDisplay
YSegmentedDisplay * yFirstSegmentedDisplay(void)
Y_DISPLAYMODE_enum displayMode(void)
Y_DISPLAYMODE_enum
virtual int _invokeValueCallback(string value)
Definition: yocto_api.cpp:2563
static YSegmentedDisplay * FirstSegmentedDisplay(void)


yoctopuce_altimeter
Author(s): Anja Sheppard
autogenerated on Mon Jun 10 2019 15:49:11