yocto_gyro.h
Go to the documentation of this file.
1 /*********************************************************************
2  *
3  * $Id: yocto_gyro.h 28748 2017-10-03 08:23:39Z seb $
4  *
5  * Declares yFindGyro(), the high-level API for Gyro 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_GYRO_H
42 #define YOCTO_GYRO_H
43 
44 #include "yocto_api.h"
45 #include <cfloat>
46 #include <cmath>
47 #include <map>
48 
49 //--- (generated code: YQt return codes)
50 //--- (end of generated code: YQt return codes)
51 //--- (generated code: YQt definitions)
52 class YQt; // forward declaration
53 
54 typedef void (*YQtValueCallback)(YQt *func, const string& functionValue);
55 class YMeasure; // forward declaration
56 typedef void (*YQtTimedReportCallback)(YQt *func, YMeasure measure);
57 //--- (end of generated code: YQt definitions)
58 
59 //--- (generated code: YQt declaration)
68 #ifdef __BORLANDC__
69 #pragma option push -w-8022
70 #endif
71 //--- (end of generated code: YQt declaration)
72 protected:
73  //--- (generated code: YQt attributes)
74  // Attributes (function value cache)
77 
78  friend YQt *yFindQt(const string& func);
79  friend YQt *yFirstQt(void);
80 
81  // Constructor is protected, use yFindQt factory function to instantiate
82  YQt(const string& func);
83  //--- (end of generated code: YQt attributes)
84 
85 public:
86  ~YQt();
87  //--- (generated code: YQt accessors declaration)
88 
89 
117  static YQt* FindQt(string func);
118 
130  virtual int registerValueCallback(YQtValueCallback callback);
132 
133  virtual int _invokeValueCallback(string value);
134 
148 
149  virtual int _invokeTimedReportCallback(YMeasure value);
150 
151 
152  inline static YQt* Find(string func)
153  { return YQt::FindQt(func); }
154 
162  YQt *nextQt(void);
163  inline YQt *next(void)
164  { return this->nextQt();}
165 
175  static YQt* FirstQt(void);
176  inline static YQt* First(void)
177  { return YQt::FirstQt();}
178 #ifdef __BORLANDC__
179 #pragma option pop
180 #endif
181  //--- (end of generated code: YQt accessors declaration)
182 };
183 
184 //--- (generated code: YQt functions declaration)
185 
213 inline YQt* yFindQt(const string& func)
214 { return YQt::FindQt(func);}
224 inline YQt* yFirstQt(void)
225 { return YQt::FirstQt();}
226 
227 //--- (end of generated code: YQt functions declaration)
228 
229 
230 
231 //--- (generated code: YGyro return codes)
232 //--- (end of generated code: YGyro return codes)
233 //--- (generated code: YGyro definitions)
234 class YGyro; // forward declaration
235 
236 typedef void (*YGyroValueCallback)(YGyro *func, const string& functionValue);
237 class YMeasure; // forward declaration
238 typedef void (*YGyroTimedReportCallback)(YGyro *func, YMeasure measure);
239 #define Y_BANDWIDTH_INVALID (YAPI_INVALID_INT)
240 #define Y_XVALUE_INVALID (YAPI_INVALID_DOUBLE)
241 #define Y_YVALUE_INVALID (YAPI_INVALID_DOUBLE)
242 #define Y_ZVALUE_INVALID (YAPI_INVALID_DOUBLE)
243 //--- (end of generated code: YGyro definitions)
244 
245 typedef void(*YQuatCallback)(YGyro *yGyro, double w, double x, double y, double z);
246 typedef void(*YAnglesCallback)(YGyro *yGyro, double roll, double pitch, double head);
247 
248 //--- (generated code: YGyro declaration)
263 #ifdef __BORLANDC__
264 #pragma option push -w-8022
265 #endif
266 //--- (end of generated code: YGyro declaration)
267 protected:
268  //--- (generated code: YGyro attributes)
269  // Attributes (function value cache)
271  double _xValue;
272  double _yValue;
273  double _zValue;
281  double _w;
282  double _x;
283  double _y;
284  double _z;
286  double _head;
287  double _pitch;
288  double _roll;
291 
292  friend YGyro *yFindGyro(const string& func);
293  friend YGyro *yFirstGyro(void);
294 
295  // Function-specific method for parsing of JSON output and caching result
296  virtual int _parseAttr(YJSONObject* json_val);
297 
298  // Constructor is protected, use yFindGyro factory function to instantiate
299  YGyro(const string& func);
300  //--- (end of generated code: YGyro attributes)
301 
302 public:
303  ~YGyro();
304  //--- (generated code: YGyro accessors declaration)
305 
306  static const int BANDWIDTH_INVALID = YAPI_INVALID_INT;
307  static const double XVALUE_INVALID;
308  static const double YVALUE_INVALID;
309  static const double ZVALUE_INVALID;
310 
318  int get_bandwidth(void);
319 
320  inline int bandwidth(void)
321  { return this->get_bandwidth(); }
322 
333  int set_bandwidth(int newval);
334  inline int setBandwidth(int newval)
335  { return this->set_bandwidth(newval); }
336 
345  double get_xValue(void);
346 
347  inline double xValue(void)
348  { return this->get_xValue(); }
349 
358  double get_yValue(void);
359 
360  inline double yValue(void)
361  { return this->get_yValue(); }
362 
371  double get_zValue(void);
372 
373  inline double zValue(void)
374  { return this->get_zValue(); }
375 
403  static YGyro* FindGyro(string func);
404 
416  virtual int registerValueCallback(YGyroValueCallback callback);
418 
419  virtual int _invokeValueCallback(string value);
420 
434 
435  virtual int _invokeTimedReportCallback(YMeasure value);
436 
437  virtual int _loadQuaternion(void);
438 
439  virtual int _loadAngles(void);
440 
452  virtual double get_roll(void);
453 
465  virtual double get_pitch(void);
466 
478  virtual double get_heading(void);
479 
489  virtual double get_quaternionW(void);
490 
501  virtual double get_quaternionX(void);
502 
513  virtual double get_quaternionY(void);
514 
525  virtual double get_quaternionZ(void);
526 
542  virtual int registerQuaternionCallback(YQuatCallback callback);
543 
559  virtual int registerAnglesCallback(YAnglesCallback callback);
560 
561  virtual int _invokeGyroCallbacks(int qtIndex,double qtValue);
562 
563 
564  inline static YGyro* Find(string func)
565  { return YGyro::FindGyro(func); }
566 
574  YGyro *nextGyro(void);
575  inline YGyro *next(void)
576  { return this->nextGyro();}
577 
587  static YGyro* FirstGyro(void);
588  inline static YGyro* First(void)
589  { return YGyro::FirstGyro();}
590 #ifdef __BORLANDC__
591 #pragma option pop
592 #endif
593  //--- (end of generated code: YGyro accessors declaration)
594 };
595 
596 //--- (generated code: YGyro functions declaration)
597 
625 inline YGyro* yFindGyro(const string& func)
626 { return YGyro::FindGyro(func);}
636 inline YGyro* yFirstGyro(void)
637 { return YGyro::FirstGyro();}
638 
639 //--- (end of generated code: YGyro functions declaration)
640 
641 #endif
static YGyro * Find(string func)
Definition: yocto_gyro.h:564
double _y
Definition: yocto_gyro.h:283
YQt * _qt_y
Definition: yocto_gyro.h:279
static const double ZVALUE_INVALID
Definition: yocto_gyro.h:309
YGyro * next(void)
Definition: yocto_gyro.h:575
static YGyro * First(void)
Definition: yocto_gyro.h:588
YQt * _qt_x
Definition: yocto_gyro.h:278
double _pitch
Definition: yocto_gyro.h:287
double _w
Definition: yocto_gyro.h:281
YQt * yFindQt(const string &func)
Definition: yocto_gyro.h:213
static YGyro * FirstGyro(void)
Definition: yocto_gyro.cpp:874
double _zValue
Definition: yocto_gyro.h:273
YQuatCallback _quatCallback
Definition: yocto_gyro.h:289
void(* YQtTimedReportCallback)(YQt *func, YMeasure measure)
Definition: yocto_gyro.h:56
double _roll
Definition: yocto_gyro.h:288
static YQt * FindQt(string func)
Definition: yocto_gyro.cpp:98
YGyroValueCallback _valueCallbackGyro
Definition: yocto_gyro.h:274
YQt * _qt_w
Definition: yocto_gyro.h:277
YQtValueCallback _valueCallbackQt
Definition: yocto_gyro.h:75
void(* YQtValueCallback)(YQt *func, const string &functionValue)
Definition: yocto_gyro.h:54
double _yValue
Definition: yocto_gyro.h:272
int _qt_stamp
Definition: yocto_gyro.h:276
double _head
Definition: yocto_gyro.h:286
YQt * yFirstQt(void)
Definition: yocto_gyro.h:224
double _z
Definition: yocto_gyro.h:284
YQt * next(void)
Definition: yocto_gyro.h:163
static YQt * First(void)
Definition: yocto_gyro.h:176
YAnglesCallback _anglesCallback
Definition: yocto_gyro.h:290
YGyro * yFirstGyro(void)
Definition: yocto_gyro.h:636
static YQt * Find(string func)
Definition: yocto_gyro.h:152
double zValue(void)
Definition: yocto_gyro.h:373
static YGyro * FindGyro(string func)
Definition: yocto_gyro.cpp:467
virtual int registerTimedReportCallback(YSensorTimedReportCallback callback)
Definition: yocto_api.cpp:7923
static const double XVALUE_INVALID
Definition: yocto_gyro.h:307
double _xValue
Definition: yocto_gyro.h:271
virtual int _invokeTimedReportCallback(YMeasure value)
Definition: yocto_api.cpp:7936
int _angles_stamp
Definition: yocto_gyro.h:285
virtual int _invokeValueCallback(string value)
Definition: yocto_api.cpp:7645
void(* YQuatCallback)(YGyro *yGyro, double w, double x, double y, double z)
Definition: yocto_gyro.h:245
double xValue(void)
Definition: yocto_gyro.h:347
double yValue(void)
Definition: yocto_gyro.h:360
static const double YVALUE_INVALID
Definition: yocto_gyro.h:308
double _x
Definition: yocto_gyro.h:282
virtual int _parseAttr(YJSONObject *json_val)
Definition: yocto_api.cpp:7015
virtual int registerValueCallback(YSensorValueCallback callback)
Definition: yocto_api.cpp:7626
YGyro * yFindGyro(const string &func)
Definition: yocto_gyro.h:625
YQt * _qt_z
Definition: yocto_gyro.h:280
int bandwidth(void)
Definition: yocto_gyro.h:320
#define YOCTO_CLASS_EXPORT
Definition: yocto_api.h:61
YQtTimedReportCallback _timedReportCallbackQt
Definition: yocto_gyro.h:76
Definition: yocto_gyro.h:67
void(* YGyroTimedReportCallback)(YGyro *func, YMeasure measure)
Definition: yocto_gyro.h:238
#define YAPI_INVALID_INT
Definition: yocto_api.h:70
void(* YAnglesCallback)(YGyro *yGyro, double roll, double pitch, double head)
Definition: yocto_gyro.h:246
YGyroTimedReportCallback _timedReportCallbackGyro
Definition: yocto_gyro.h:275
int setBandwidth(int newval)
Definition: yocto_gyro.h:334
int _bandwidth
Definition: yocto_gyro.h:270
void(* YGyroValueCallback)(YGyro *func, const string &functionValue)
Definition: yocto_gyro.h:236
static YQt * FirstQt(void)
Definition: yocto_gyro.cpp:203


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