yocto_currentloopoutput.h
Go to the documentation of this file.
1 /*********************************************************************
2  *
3  * $Id: yocto_currentloopoutput.h 28748 2017-10-03 08:23:39Z seb $
4  *
5  * Declares yFindCurrentLoopOutput(), the high-level API for CurrentLoopOutput 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_CURRENTLOOPOUTPUT_H
42 #define YOCTO_CURRENTLOOPOUTPUT_H
43 
44 #include "yocto_api.h"
45 #include <cfloat>
46 #include <cmath>
47 #include <map>
48 
49 //--- (YCurrentLoopOutput return codes)
50 //--- (end of YCurrentLoopOutput return codes)
51 //--- (YCurrentLoopOutput definitions)
52 class YCurrentLoopOutput; // forward declaration
53 
54 typedef void (*YCurrentLoopOutputValueCallback)(YCurrentLoopOutput *func, const string& functionValue);
55 #ifndef _Y_LOOPPOWER_ENUM
56 #define _Y_LOOPPOWER_ENUM
57 typedef enum {
63 #endif
64 #define Y_CURRENT_INVALID (YAPI_INVALID_DOUBLE)
65 #define Y_CURRENTTRANSITION_INVALID (YAPI_INVALID_STRING)
66 #define Y_CURRENTATSTARTUP_INVALID (YAPI_INVALID_DOUBLE)
67 //--- (end of YCurrentLoopOutput definitions)
68 
69 //--- (YCurrentLoopOutput declaration)
77 #ifdef __BORLANDC__
78 #pragma option push -w-8022
79 #endif
80 //--- (end of YCurrentLoopOutput declaration)
81 protected:
82  //--- (YCurrentLoopOutput attributes)
83  // Attributes (function value cache)
84  double _current;
89 
90  friend YCurrentLoopOutput *yFindCurrentLoopOutput(const string& func);
92 
93  // Function-specific method for parsing of JSON output and caching result
94  virtual int _parseAttr(YJSONObject* json_val);
95 
96  // Constructor is protected, use yFindCurrentLoopOutput factory function to instantiate
97  YCurrentLoopOutput(const string& func);
98  //--- (end of YCurrentLoopOutput attributes)
99 
100 public:
102  //--- (YCurrentLoopOutput accessors declaration)
103 
104  static const double CURRENT_INVALID;
105  static const string CURRENTTRANSITION_INVALID;
106  static const double CURRENTATSTARTUP_INVALID;
107  static const Y_LOOPPOWER_enum LOOPPOWER_NOPWR = Y_LOOPPOWER_NOPWR;
108  static const Y_LOOPPOWER_enum LOOPPOWER_LOWPWR = Y_LOOPPOWER_LOWPWR;
109  static const Y_LOOPPOWER_enum LOOPPOWER_POWEROK = Y_LOOPPOWER_POWEROK;
110  static const Y_LOOPPOWER_enum LOOPPOWER_INVALID = Y_LOOPPOWER_INVALID;
111 
123  int set_current(double newval);
124  inline int setCurrent(double newval)
125  { return this->set_current(newval); }
126 
134  double get_current(void);
135 
136  inline double current(void)
137  { return this->get_current(); }
138 
139  string get_currentTransition(void);
140 
141  inline string currentTransition(void)
142  { return this->get_currentTransition(); }
143 
144  int set_currentTransition(const string& newval);
145  inline int setCurrentTransition(const string& newval)
146  { return this->set_currentTransition(newval); }
147 
158  int set_currentAtStartUp(double newval);
159  inline int setCurrentAtStartUp(double newval)
160  { return this->set_currentAtStartUp(newval); }
161 
169  double get_currentAtStartUp(void);
170 
171  inline double currentAtStartUp(void)
172  { return this->get_currentAtStartUp(); }
173 
184  Y_LOOPPOWER_enum get_loopPower(void);
185 
187  { return this->get_loopPower(); }
188 
216  static YCurrentLoopOutput* FindCurrentLoopOutput(string func);
217 
231 
232  virtual int _invokeValueCallback(string value);
233 
244  virtual int currentMove(double mA_target,int ms_duration);
245 
246 
247  inline static YCurrentLoopOutput* Find(string func)
249 
257  YCurrentLoopOutput *nextCurrentLoopOutput(void);
258  inline YCurrentLoopOutput *next(void)
259  { return this->nextCurrentLoopOutput();}
260 
270  static YCurrentLoopOutput* FirstCurrentLoopOutput(void);
271  inline static YCurrentLoopOutput* First(void)
273 #ifdef __BORLANDC__
274 #pragma option pop
275 #endif
276  //--- (end of YCurrentLoopOutput accessors declaration)
277 };
278 
279 //--- (YCurrentLoopOutput functions declaration)
280 
308 inline YCurrentLoopOutput* yFindCurrentLoopOutput(const string& func)
321 
322 //--- (end of YCurrentLoopOutput functions declaration)
323 
324 #endif
static const double CURRENTATSTARTUP_INVALID
int setCurrentTransition(const string &newval)
Y_LOOPPOWER_enum _loopPower
static YCurrentLoopOutput * First(void)
int setCurrentAtStartUp(double newval)
void(* YCurrentLoopOutputValueCallback)(YCurrentLoopOutput *func, const string &functionValue)
static const string CURRENTTRANSITION_INVALID
YCurrentLoopOutputValueCallback _valueCallbackCurrentLoopOutput
virtual int _parseAttr(YJSONObject *json_val)
Definition: yocto_api.cpp:2367
static const double CURRENT_INVALID
YCurrentLoopOutput * yFindCurrentLoopOutput(const string &func)
Y_LOOPPOWER_enum loopPower(void)
virtual int registerValueCallback(YFunctionValueCallback callback)
Definition: yocto_api.cpp:2544
YCurrentLoopOutput * yFirstCurrentLoopOutput(void)
#define YOCTO_CLASS_EXPORT
Definition: yocto_api.h:61
YCurrentLoopOutput * next(void)
static YCurrentLoopOutput * FindCurrentLoopOutput(string func)
static YCurrentLoopOutput * FirstCurrentLoopOutput(void)
static YCurrentLoopOutput * Find(string func)
int setCurrent(double newval)
virtual int _invokeValueCallback(string value)
Definition: yocto_api.cpp:2563


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