yocto_multicellweighscale.h
Go to the documentation of this file.
1 /*********************************************************************
2  *
3  * $Id: yocto_multicellweighscale.h 29661 2018-01-18 13:32:13Z mvuilleu $
4  *
5  * Declares yFindMultiCellWeighScale(), the high-level API for MultiCellWeighScale 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_MULTICELLWEIGHSCALE_H
42 #define YOCTO_MULTICELLWEIGHSCALE_H
43 
44 #include "yocto_api.h"
45 #include <cfloat>
46 #include <cmath>
47 #include <map>
48 
49 //--- (YMultiCellWeighScale return codes)
50 //--- (end of YMultiCellWeighScale return codes)
51 //--- (YMultiCellWeighScale definitions)
52 class YMultiCellWeighScale; // forward declaration
53 
54 typedef void (*YMultiCellWeighScaleValueCallback)(YMultiCellWeighScale *func, const string& functionValue);
55 class YMeasure; // forward declaration
57 #ifndef _Y_EXCITATION_ENUM
58 #define _Y_EXCITATION_ENUM
59 typedef enum {
65 #endif
66 #define Y_CELLCOUNT_INVALID (YAPI_INVALID_UINT)
67 #define Y_COMPTEMPADAPTRATIO_INVALID (YAPI_INVALID_DOUBLE)
68 #define Y_COMPTEMPAVG_INVALID (YAPI_INVALID_DOUBLE)
69 #define Y_COMPTEMPCHG_INVALID (YAPI_INVALID_DOUBLE)
70 #define Y_COMPENSATION_INVALID (YAPI_INVALID_DOUBLE)
71 #define Y_ZEROTRACKING_INVALID (YAPI_INVALID_DOUBLE)
72 #define Y_COMMAND_INVALID (YAPI_INVALID_STRING)
73 //--- (end of YMultiCellWeighScale definitions)
74 
75 //--- (YMultiCellWeighScale declaration)
86 #ifdef __BORLANDC__
87 #pragma option push -w-8022
88 #endif
89 //--- (end of YMultiCellWeighScale declaration)
90 protected:
91  //--- (YMultiCellWeighScale attributes)
92  // Attributes (function value cache)
96  double _compTempAvg;
97  double _compTempChg;
98  double _compensation;
99  double _zeroTracking;
100  string _command;
103 
104  friend YMultiCellWeighScale *yFindMultiCellWeighScale(const string& func);
106 
107  // Function-specific method for parsing of JSON output and caching result
108  virtual int _parseAttr(YJSONObject* json_val);
109 
110  // Constructor is protected, use yFindMultiCellWeighScale factory function to instantiate
111  YMultiCellWeighScale(const string& func);
112  //--- (end of YMultiCellWeighScale attributes)
113 
114 public:
116  //--- (YMultiCellWeighScale accessors declaration)
117 
118  static const int CELLCOUNT_INVALID = YAPI_INVALID_UINT;
119  static const Y_EXCITATION_enum EXCITATION_OFF = Y_EXCITATION_OFF;
120  static const Y_EXCITATION_enum EXCITATION_DC = Y_EXCITATION_DC;
121  static const Y_EXCITATION_enum EXCITATION_AC = Y_EXCITATION_AC;
122  static const Y_EXCITATION_enum EXCITATION_INVALID = Y_EXCITATION_INVALID;
123  static const double COMPTEMPADAPTRATIO_INVALID;
124  static const double COMPTEMPAVG_INVALID;
125  static const double COMPTEMPCHG_INVALID;
126  static const double COMPENSATION_INVALID;
127  static const double ZEROTRACKING_INVALID;
128  static const string COMMAND_INVALID;
129 
141  int set_unit(const string& newval);
142  inline int setUnit(const string& newval)
143  { return this->set_unit(newval); }
144 
152  int get_cellCount(void);
153 
154  inline int cellCount(void)
155  { return this->get_cellCount(); }
156 
166  int set_cellCount(int newval);
167  inline int setCellCount(int newval)
168  { return this->set_cellCount(newval); }
169 
178  Y_EXCITATION_enum get_excitation(void);
179 
181  { return this->get_excitation(); }
182 
193  int set_excitation(Y_EXCITATION_enum newval);
194  inline int setExcitation(Y_EXCITATION_enum newval)
195  { return this->set_excitation(newval); }
196 
209  int set_compTempAdaptRatio(double newval);
210  inline int setCompTempAdaptRatio(double newval)
211  { return this->set_compTempAdaptRatio(newval); }
212 
223  double get_compTempAdaptRatio(void);
224 
225  inline double compTempAdaptRatio(void)
226  { return this->get_compTempAdaptRatio(); }
227 
235  double get_compTempAvg(void);
236 
237  inline double compTempAvg(void)
238  { return this->get_compTempAvg(); }
239 
248  double get_compTempChg(void);
249 
250  inline double compTempChg(void)
251  { return this->get_compTempChg(); }
252 
260  double get_compensation(void);
261 
262  inline double compensation(void)
263  { return this->get_compensation(); }
264 
274  int set_zeroTracking(double newval);
275  inline int setZeroTracking(double newval)
276  { return this->set_zeroTracking(newval); }
277 
287  double get_zeroTracking(void);
288 
289  inline double zeroTracking(void)
290  { return this->get_zeroTracking(); }
291 
292  string get_command(void);
293 
294  inline string command(void)
295  { return this->get_command(); }
296 
297  int set_command(const string& newval);
298  inline int setCommand(const string& newval)
299  { return this->set_command(newval); }
300 
328  static YMultiCellWeighScale* FindMultiCellWeighScale(string func);
329 
343 
344  virtual int _invokeValueCallback(string value);
345 
359 
360  virtual int _invokeTimedReportCallback(YMeasure value);
361 
370  virtual int tare(void);
371 
383  virtual int setupSpan(double currWeight,double maxWeight);
384 
385 
386  inline static YMultiCellWeighScale* Find(string func)
388 
396  YMultiCellWeighScale *nextMultiCellWeighScale(void);
398  { return this->nextMultiCellWeighScale();}
399 
409  static YMultiCellWeighScale* FirstMultiCellWeighScale(void);
410  inline static YMultiCellWeighScale* First(void)
412 #ifdef __BORLANDC__
413 #pragma option pop
414 #endif
415  //--- (end of YMultiCellWeighScale accessors declaration)
416 };
417 
418 //--- (YMultiCellWeighScale functions declaration)
419 
460 
461 //--- (end of YMultiCellWeighScale functions declaration)
462 
463 #endif
int setUnit(const string &newval)
YMultiCellWeighScale * yFindMultiCellWeighScale(const string &func)
static const double COMPENSATION_INVALID
static const double COMPTEMPADAPTRATIO_INVALID
static YMultiCellWeighScale * FindMultiCellWeighScale(string func)
static const double COMPTEMPAVG_INVALID
YMultiCellWeighScale * next(void)
void(* YMultiCellWeighScaleTimedReportCallback)(YMultiCellWeighScale *func, YMeasure measure)
static const string COMMAND_INVALID
int setCompTempAdaptRatio(double newval)
YMultiCellWeighScaleTimedReportCallback _timedReportCallbackMultiCellWeighScale
#define YAPI_INVALID_UINT
Definition: yocto_api.h:71
static const double COMPTEMPCHG_INVALID
void(* YMultiCellWeighScaleValueCallback)(YMultiCellWeighScale *func, const string &functionValue)
virtual int registerTimedReportCallback(YSensorTimedReportCallback callback)
Definition: yocto_api.cpp:7923
int setExcitation(Y_EXCITATION_enum newval)
virtual int _invokeTimedReportCallback(YMeasure value)
Definition: yocto_api.cpp:7936
virtual int _invokeValueCallback(string value)
Definition: yocto_api.cpp:7645
static YMultiCellWeighScale * Find(string func)
static const double ZEROTRACKING_INVALID
int setZeroTracking(double newval)
virtual int _parseAttr(YJSONObject *json_val)
Definition: yocto_api.cpp:7015
virtual int registerValueCallback(YSensorValueCallback callback)
Definition: yocto_api.cpp:7626
Y_EXCITATION_enum excitation(void)
#define YOCTO_CLASS_EXPORT
Definition: yocto_api.h:61
int setCommand(const string &newval)
YMultiCellWeighScaleValueCallback _valueCallbackMultiCellWeighScale
YMultiCellWeighScale * yFirstMultiCellWeighScale(void)
static YMultiCellWeighScale * First(void)
static YMultiCellWeighScale * FirstMultiCellWeighScale(void)


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