yocto_colorledcluster.h
Go to the documentation of this file.
1 /*********************************************************************
2  *
3  * $Id: yocto_colorledcluster.h 29186 2017-11-16 10:04:13Z seb $
4  *
5  * Declares yFindColorLedCluster(), the high-level API for ColorLedCluster 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_COLORLEDCLUSTER_H
42 #define YOCTO_COLORLEDCLUSTER_H
43 
44 #include "yocto_api.h"
45 #include <cfloat>
46 #include <cmath>
47 #include <map>
48 
49 //--- (YColorLedCluster return codes)
50 //--- (end of YColorLedCluster return codes)
51 //--- (YColorLedCluster definitions)
52 class YColorLedCluster; // forward declaration
53 
54 typedef void (*YColorLedClusterValueCallback)(YColorLedCluster *func, const string& functionValue);
55 #define Y_ACTIVELEDCOUNT_INVALID (YAPI_INVALID_UINT)
56 #define Y_MAXLEDCOUNT_INVALID (YAPI_INVALID_UINT)
57 #define Y_BLINKSEQMAXCOUNT_INVALID (YAPI_INVALID_UINT)
58 #define Y_BLINKSEQMAXSIZE_INVALID (YAPI_INVALID_UINT)
59 #define Y_COMMAND_INVALID (YAPI_INVALID_STRING)
60 //--- (end of YColorLedCluster definitions)
61 
62 //--- (YColorLedCluster declaration)
76 #ifdef __BORLANDC__
77 #pragma option push -w-8022
78 #endif
79 //--- (end of YColorLedCluster declaration)
80 protected:
81  //--- (YColorLedCluster attributes)
82  // Attributes (function value cache)
87  string _command;
89 
90  friend YColorLedCluster *yFindColorLedCluster(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 yFindColorLedCluster factory function to instantiate
97  YColorLedCluster(const string& func);
98  //--- (end of YColorLedCluster attributes)
99 
100 public:
101  ~YColorLedCluster();
102  //--- (YColorLedCluster accessors declaration)
103 
104  static const int ACTIVELEDCOUNT_INVALID = YAPI_INVALID_UINT;
105  static const int MAXLEDCOUNT_INVALID = YAPI_INVALID_UINT;
106  static const int BLINKSEQMAXCOUNT_INVALID = YAPI_INVALID_UINT;
107  static const int BLINKSEQMAXSIZE_INVALID = YAPI_INVALID_UINT;
108  static const string COMMAND_INVALID;
109 
117  int get_activeLedCount(void);
118 
119  inline int activeLedCount(void)
120  { return this->get_activeLedCount(); }
121 
131  int set_activeLedCount(int newval);
132  inline int setActiveLedCount(int newval)
133  { return this->set_activeLedCount(newval); }
134 
142  int get_maxLedCount(void);
143 
144  inline int maxLedCount(void)
145  { return this->get_maxLedCount(); }
146 
154  int get_blinkSeqMaxCount(void);
155 
156  inline int blinkSeqMaxCount(void)
157  { return this->get_blinkSeqMaxCount(); }
158 
166  int get_blinkSeqMaxSize(void);
167 
168  inline int blinkSeqMaxSize(void)
169  { return this->get_blinkSeqMaxSize(); }
170 
171  string get_command(void);
172 
173  inline string command(void)
174  { return this->get_command(); }
175 
176  int set_command(const string& newval);
177  inline int setCommand(const string& newval)
178  { return this->set_command(newval); }
179 
207  static YColorLedCluster* FindColorLedCluster(string func);
208 
222 
223  virtual int _invokeValueCallback(string value);
224 
225  virtual int sendCommand(string command);
226 
239  virtual int set_rgbColor(int ledIndex,int count,int rgbValue);
240 
255  virtual int set_rgbColorAtPowerOn(int ledIndex,int count,int rgbValue);
256 
269  virtual int set_hslColor(int ledIndex,int count,int hslValue);
270 
284  virtual int rgb_move(int ledIndex,int count,int rgbValue,int delay);
285 
303  virtual int hsl_move(int ledIndex,int count,int hslValue,int delay);
304 
318  virtual int addRgbMoveToBlinkSeq(int seqIndex,int rgbValue,int delay);
319 
333  virtual int addHslMoveToBlinkSeq(int seqIndex,int hslValue,int delay);
334 
348  virtual int addMirrorToBlinkSeq(int seqIndex);
349 
362  virtual int addJumpToBlinkSeq(int seqIndex,int linkSeqIndex);
363 
375  virtual int addUnlinkToBlinkSeq(int seqIndex);
376 
392  virtual int linkLedToBlinkSeq(int ledIndex,int count,int seqIndex,int offset);
393 
409  virtual int linkLedToBlinkSeqAtPowerOn(int ledIndex,int count,int seqIndex,int offset);
410 
426  virtual int linkLedToPeriodicBlinkSeq(int ledIndex,int count,int seqIndex,int periods);
427 
438  virtual int unlinkLedFromBlinkSeq(int ledIndex,int count);
439 
450  virtual int startBlinkSeq(int seqIndex);
451 
462  virtual int stopBlinkSeq(int seqIndex);
463 
474  virtual int resetBlinkSeq(int seqIndex);
475 
489  virtual int set_blinkSeqStateAtPowerOn(int seqIndex,int autostart);
490 
503  virtual int set_blinkSeqSpeed(int seqIndex,int speed);
504 
514  virtual int saveLedsConfigAtPowerOn(void);
515 
516  virtual int saveLedsState(void);
517 
529  virtual int saveBlinkSeq(int seqIndex);
530 
543  virtual int set_rgbColorBuffer(int ledIndex,string buff);
544 
557  virtual int set_rgbColorArray(int ledIndex,vector<int> rgbList);
558 
572  virtual int rgbArrayOfs_move(int ledIndex,vector<int> rgbList,int delay);
573 
586  virtual int rgbArray_move(vector<int> rgbList,int delay);
587 
600  virtual int set_hslColorBuffer(int ledIndex,string buff);
601 
614  virtual int set_hslColorArray(int ledIndex,vector<int> hslList);
615 
628  virtual int hslArray_move(vector<int> hslList,int delay);
629 
643  virtual int hslArrayOfs_move(int ledIndex,vector<int> hslList,int delay);
644 
657  virtual string get_rgbColorBuffer(int ledIndex,int count);
658 
671  virtual vector<int> get_rgbColorArray(int ledIndex,int count);
672 
685  virtual vector<int> get_rgbColorArrayAtPowerOn(int ledIndex,int count);
686 
699  virtual vector<int> get_linkedSeqArray(int ledIndex,int count);
700 
713  virtual vector<int> get_blinkSeqSignatures(int seqIndex,int count);
714 
725  virtual vector<int> get_blinkSeqStateSpeed(int seqIndex,int count);
726 
737  virtual vector<int> get_blinkSeqStateAtPowerOn(int seqIndex,int count);
738 
749  virtual vector<int> get_blinkSeqState(int seqIndex,int count);
750 
751 
752  inline static YColorLedCluster* Find(string func)
753  { return YColorLedCluster::FindColorLedCluster(func); }
754 
762  YColorLedCluster *nextColorLedCluster(void);
763  inline YColorLedCluster *next(void)
764  { return this->nextColorLedCluster();}
765 
775  static YColorLedCluster* FirstColorLedCluster(void);
776  inline static YColorLedCluster* First(void)
778 #ifdef __BORLANDC__
779 #pragma option pop
780 #endif
781  //--- (end of YColorLedCluster accessors declaration)
782 };
783 
784 //--- (YColorLedCluster functions declaration)
785 
813 inline YColorLedCluster* yFindColorLedCluster(const string& func)
826 
827 //--- (end of YColorLedCluster functions declaration)
828 
829 #endif
YColorLedCluster * yFirstColorLedCluster(void)
void(* YColorLedClusterValueCallback)(YColorLedCluster *func, const string &functionValue)
#define YAPI_INVALID_UINT
Definition: yocto_api.h:71
static YColorLedCluster * Find(string func)
virtual int _parseAttr(YJSONObject *json_val)
Definition: yocto_api.cpp:2367
ROSLIB_DECL std::string command(const std::string &cmd)
YColorLedCluster * next(void)
static YColorLedCluster * FirstColorLedCluster(void)
YColorLedCluster * yFindColorLedCluster(const string &func)
static YColorLedCluster * First(void)
virtual int registerValueCallback(YFunctionValueCallback callback)
Definition: yocto_api.cpp:2544
#define YOCTO_CLASS_EXPORT
Definition: yocto_api.h:61
int setCommand(const string &newval)
int setActiveLedCount(int newval)
static YColorLedCluster * FindColorLedCluster(string func)
virtual int _invokeValueCallback(string value)
Definition: yocto_api.cpp:2563
YColorLedClusterValueCallback _valueCallbackColorLedCluster
static const string COMMAND_INVALID


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