yocto_voltageoutput.h
Go to the documentation of this file.
1 /*********************************************************************
2  *
3  * $Id: yocto_voltageoutput.h 28748 2017-10-03 08:23:39Z seb $
4  *
5  * Declares yFindVoltageOutput(), the high-level API for VoltageOutput 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_VOLTAGEOUTPUT_H
42 #define YOCTO_VOLTAGEOUTPUT_H
43 
44 #include "yocto_api.h"
45 #include <cfloat>
46 #include <cmath>
47 #include <map>
48 
49 //--- (YVoltageOutput return codes)
50 //--- (end of YVoltageOutput return codes)
51 //--- (YVoltageOutput definitions)
52 class YVoltageOutput; // forward declaration
53 
54 typedef void (*YVoltageOutputValueCallback)(YVoltageOutput *func, const string& functionValue);
55 #define Y_CURRENTVOLTAGE_INVALID (YAPI_INVALID_DOUBLE)
56 #define Y_VOLTAGETRANSITION_INVALID (YAPI_INVALID_STRING)
57 #define Y_VOLTAGEATSTARTUP_INVALID (YAPI_INVALID_DOUBLE)
58 //--- (end of YVoltageOutput definitions)
59 
60 //--- (YVoltageOutput declaration)
67 #ifdef __BORLANDC__
68 #pragma option push -w-8022
69 #endif
70 //--- (end of YVoltageOutput declaration)
71 protected:
72  //--- (YVoltageOutput attributes)
73  // Attributes (function value cache)
78 
79  friend YVoltageOutput *yFindVoltageOutput(const string& func);
80  friend YVoltageOutput *yFirstVoltageOutput(void);
81 
82  // Function-specific method for parsing of JSON output and caching result
83  virtual int _parseAttr(YJSONObject* json_val);
84 
85  // Constructor is protected, use yFindVoltageOutput factory function to instantiate
86  YVoltageOutput(const string& func);
87  //--- (end of YVoltageOutput attributes)
88 
89 public:
90  ~YVoltageOutput();
91  //--- (YVoltageOutput accessors declaration)
92 
93  static const double CURRENTVOLTAGE_INVALID;
94  static const string VOLTAGETRANSITION_INVALID;
95  static const double VOLTAGEATSTARTUP_INVALID;
96 
106  int set_currentVoltage(double newval);
107  inline int setCurrentVoltage(double newval)
108  { return this->set_currentVoltage(newval); }
109 
117  double get_currentVoltage(void);
118 
119  inline double currentVoltage(void)
120  { return this->get_currentVoltage(); }
121 
122  string get_voltageTransition(void);
123 
124  inline string voltageTransition(void)
125  { return this->get_voltageTransition(); }
126 
127  int set_voltageTransition(const string& newval);
128  inline int setVoltageTransition(const string& newval)
129  { return this->set_voltageTransition(newval); }
130 
141  int set_voltageAtStartUp(double newval);
142  inline int setVoltageAtStartUp(double newval)
143  { return this->set_voltageAtStartUp(newval); }
144 
152  double get_voltageAtStartUp(void);
153 
154  inline double voltageAtStartUp(void)
155  { return this->get_voltageAtStartUp(); }
156 
184  static YVoltageOutput* FindVoltageOutput(string func);
185 
199 
200  virtual int _invokeValueCallback(string value);
201 
212  virtual int voltageMove(double V_target,int ms_duration);
213 
214 
215  inline static YVoltageOutput* Find(string func)
216  { return YVoltageOutput::FindVoltageOutput(func); }
217 
225  YVoltageOutput *nextVoltageOutput(void);
226  inline YVoltageOutput *next(void)
227  { return this->nextVoltageOutput();}
228 
238  static YVoltageOutput* FirstVoltageOutput(void);
239  inline static YVoltageOutput* First(void)
241 #ifdef __BORLANDC__
242 #pragma option pop
243 #endif
244  //--- (end of YVoltageOutput accessors declaration)
245 };
246 
247 //--- (YVoltageOutput functions declaration)
248 
276 inline YVoltageOutput* yFindVoltageOutput(const string& func)
277 { return YVoltageOutput::FindVoltageOutput(func);}
289 
290 //--- (end of YVoltageOutput functions declaration)
291 
292 #endif
int setCurrentVoltage(double newval)
static YVoltageOutput * FindVoltageOutput(string func)
int setVoltageAtStartUp(double newval)
static const double VOLTAGEATSTARTUP_INVALID
static YVoltageOutput * FirstVoltageOutput(void)
string voltageTransition(void)
virtual int _parseAttr(YJSONObject *json_val)
Definition: yocto_api.cpp:2367
double voltageAtStartUp(void)
static const double CURRENTVOLTAGE_INVALID
YVoltageOutput * yFirstVoltageOutput(void)
virtual int registerValueCallback(YFunctionValueCallback callback)
Definition: yocto_api.cpp:2544
static YVoltageOutput * First(void)
#define YOCTO_CLASS_EXPORT
Definition: yocto_api.h:61
int setVoltageTransition(const string &newval)
YVoltageOutput * next(void)
YVoltageOutputValueCallback _valueCallbackVoltageOutput
YVoltageOutput * yFindVoltageOutput(const string &func)
void(* YVoltageOutputValueCallback)(YVoltageOutput *func, const string &functionValue)
static YVoltageOutput * Find(string func)
static const string VOLTAGETRANSITION_INVALID
double currentVoltage(void)
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