yocto_display.cpp
Go to the documentation of this file.
1 /*********************************************************************
2  *
3  * $Id: yocto_display.cpp 28754 2017-10-03 11:54:51Z seb $
4  *
5  * Implements yFindDisplay(), the high-level API for Display 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 #define _CRT_SECURE_NO_DEPRECATE //do not use windows secure crt
42 #include "yocto_display.h"
43 #include "yapi/yjson.h"
44 #include "yapi/yapi.h"
45 #include <string.h>
46 #include <stdio.h>
47 #include <stdlib.h>
48 #define __FILE_ID__ "display"
49 
50 
52 //--- (generated code: YDisplayLayer initialization)
53 //--- (end of generated code: YDisplayLayer initialization)
54 _display(parent),_id(id),_cmdbuff(""),_hidden(false)
55 {}
56 
57 
59 {
60  int res = YAPI_SUCCESS;
61  if(_cmdbuff.length() > 0) {
63  _cmdbuff="";
64  }
65  return res;
66 }
67 
68 
69 // internal function to send a command for this layer
71 {
72  int res = YAPI_SUCCESS;
73 
74  if(_cmdbuff.length() + cmd.length() >= 100) {
75  // force flush before, to prevent overflow
76  res = flush_now();
77  }
78  if(_cmdbuff.length() == 0) {
79  // always prepend layer ID first
80  _cmdbuff.append(YapiWrapper::ysprintf("%d",_id));
81  }
82  _cmdbuff.append(cmd);
83  return res;
84 }
85 
86 // internal function to send a command for this layer
88 {
89  int res = command_push(cmd);
90  if(_hidden) {
91  return res;
92  }
93  return flush_now();
94 }
95 
96 int YDisplayLayer::drawBitmap(int x,int y,int w,const std::vector<unsigned char>& data,int bgcol)
97 {
98  int size = (int)data.size();
99  char *arr = new char[size];
100  for (int i=0;i<size;i++) arr[i] = data[i];
101  string strval = string(arr,size);
102  return this->drawBitmap(x,y,w,strval,bgcol);
103 }
104 
105 
106 //--- (generated code: YDisplayLayer implementation)
107 // static attributes
108 
109 
121 {
122  _hidden = false;
123  return this->command_flush("X");
124 }
125 
137 {
138  return this->command_flush("x");
139 }
140 
154 {
155  return this->command_push(YapiWrapper::ysprintf("c%06x",color));
156 }
157 
173 {
174  return this->command_push(YapiWrapper::ysprintf("g%d",graylevel));
175 }
176 
188 {
189  return this->command_push("e");
190 }
191 
209 {
210  return this->command_push(YapiWrapper::ysprintf("a%d",mode));
211 }
212 
223 int YDisplayLayer::drawPixel(int x,int y)
224 {
225  return this->command_flush(YapiWrapper::ysprintf("P%d,%d",x,y));
226 }
227 
240 int YDisplayLayer::drawRect(int x1,int y1,int x2,int y2)
241 {
242  return this->command_flush(YapiWrapper::ysprintf("R%d,%d,%d,%d",x1,y1,x2,y2));
243 }
244 
257 int YDisplayLayer::drawBar(int x1,int y1,int x2,int y2)
258 {
259  return this->command_flush(YapiWrapper::ysprintf("B%d,%d,%d,%d",x1,y1,x2,y2));
260 }
261 
273 int YDisplayLayer::drawCircle(int x,int y,int r)
274 {
275  return this->command_flush(YapiWrapper::ysprintf("C%d,%d,%d",x,y,r));
276 }
277 
289 int YDisplayLayer::drawDisc(int x,int y,int r)
290 {
291  return this->command_flush(YapiWrapper::ysprintf("D%d,%d,%d",x,y,r));
292 }
293 
307 int YDisplayLayer::selectFont(string fontname)
308 {
309  return this->command_push(YapiWrapper::ysprintf("&%s%c",fontname.c_str(),27));
310 }
311 
330 int YDisplayLayer::drawText(int x,int y,Y_ALIGN anchor,string text)
331 {
332  return this->command_flush(YapiWrapper::ysprintf("T%d,%d,%d,%s%c",x,y,anchor,text.c_str(),27));
333 }
334 
349 int YDisplayLayer::drawImage(int x,int y,string imagename)
350 {
351  return this->command_flush(YapiWrapper::ysprintf("*%d,%d,%s%c",x,y,imagename.c_str(),27));
352 }
353 
374 int YDisplayLayer::drawBitmap(int x,int y,int w,string bitmap,int bgcol)
375 {
376  string destname;
377  destname = YapiWrapper::ysprintf("layer%d:%d,%d@%d,%d",_id,w,bgcol,x,y);
378  return _display->upload(destname,bitmap);
379 }
380 
391 int YDisplayLayer::moveTo(int x,int y)
392 {
393  return this->command_push(YapiWrapper::ysprintf("@%d,%d",x,y));
394 }
395 
408 int YDisplayLayer::lineTo(int x,int y)
409 {
410  return this->command_flush(YapiWrapper::ysprintf("-%d,%d",x,y));
411 }
412 
427 {
428  return this->command_flush(YapiWrapper::ysprintf("!%s%c",text.c_str(),27));
429 }
430 
443 int YDisplayLayer::setConsoleMargins(int x1,int y1,int x2,int y2)
444 {
445  return this->command_push(YapiWrapper::ysprintf("m%d,%d,%d,%d",x1,y1,x2,y2));
446 }
447 
460 {
461  return this->command_push(YapiWrapper::ysprintf("b%d",bgcol));
462 }
463 
475 {
476  return this->command_push(YapiWrapper::ysprintf("w%d",wordwrap));
477 }
478 
488 {
489  return this->command_flush("^");
490 }
491 
506 int YDisplayLayer::setLayerPosition(int x,int y,int scrollTime)
507 {
508  return this->command_flush(YapiWrapper::ysprintf("#%d,%d,%d",x,y,scrollTime));
509 }
510 
522 {
523  this->command_push("h");
524  _hidden = true;
525  return this->flush_now();
526 }
527 
536 {
537  _hidden = false;
538  return this->command_flush("s");
539 }
540 
547 {
548  return _display;
549 }
550 
559 {
560  return _display->get_displayWidth();
561 }
562 
571 {
572  return _display->get_displayHeight();
573 }
574 
583 {
584  return _display->get_layerWidth();
585 }
586 
595 {
596  return _display->get_layerHeight();
597 }
598 
600 {
601  _hidden = false;
602  return YAPI_SUCCESS;
603 }
604 //--- (end of generated code: YDisplayLayer implementation)
605 
606 
607 YDisplay::YDisplay(const string& func): YFunction(func)
608 //--- (generated code: YDisplay initialization)
609  ,_enabled(ENABLED_INVALID)
610  ,_startupSeq(STARTUPSEQ_INVALID)
611  ,_brightness(BRIGHTNESS_INVALID)
612  ,_orientation(ORIENTATION_INVALID)
613  ,_displayWidth(DISPLAYWIDTH_INVALID)
614  ,_displayHeight(DISPLAYHEIGHT_INVALID)
615  ,_displayType(DISPLAYTYPE_INVALID)
616  ,_layerWidth(LAYERWIDTH_INVALID)
617  ,_layerHeight(LAYERHEIGHT_INVALID)
618  ,_layerCount(LAYERCOUNT_INVALID)
619  ,_command(COMMAND_INVALID)
620  ,_valueCallbackDisplay(NULL)
621 //--- (end of generated code: YDisplay initialization)
622  ,_allDisplayLayers(0)
623  ,_recording(false)
624  ,_sequence("")
625 {
626  _className ="Display";
627 }
628 
630 {
631  unsigned int i;
632  for (i=0;i<_allDisplayLayers.size();i++){
633  delete _allDisplayLayers[i];
634  }
635  _allDisplayLayers.clear();
636  //--- (generated code: YDisplay cleanup)
637 //--- (end of generated code: YDisplay cleanup)
638 }
639 
640 
641 //--- (generated code: YDisplay implementation)
642 // static attributes
645 
647 {
648  if(json_val->has("enabled")) {
649  _enabled = (Y_ENABLED_enum)json_val->getInt("enabled");
650  }
651  if(json_val->has("startupSeq")) {
652  _startupSeq = json_val->getString("startupSeq");
653  }
654  if(json_val->has("brightness")) {
655  _brightness = json_val->getInt("brightness");
656  }
657  if(json_val->has("orientation")) {
658  _orientation = (Y_ORIENTATION_enum)json_val->getInt("orientation");
659  }
660  if(json_val->has("displayWidth")) {
661  _displayWidth = json_val->getInt("displayWidth");
662  }
663  if(json_val->has("displayHeight")) {
664  _displayHeight = json_val->getInt("displayHeight");
665  }
666  if(json_val->has("displayType")) {
667  _displayType = (Y_DISPLAYTYPE_enum)json_val->getInt("displayType");
668  }
669  if(json_val->has("layerWidth")) {
670  _layerWidth = json_val->getInt("layerWidth");
671  }
672  if(json_val->has("layerHeight")) {
673  _layerHeight = json_val->getInt("layerHeight");
674  }
675  if(json_val->has("layerCount")) {
676  _layerCount = json_val->getInt("layerCount");
677  }
678  if(json_val->has("command")) {
679  _command = json_val->getString("command");
680  }
681  return YFunction::_parseAttr(json_val);
682 }
683 
684 
693 {
694  Y_ENABLED_enum res;
696  try {
699  {
702  }
703  }
704  }
705  res = _enabled;
706  } catch (std::exception) {
708  throw;
709  }
711  return res;
712 }
713 
724 {
725  string rest_val;
726  int res;
728  try {
729  rest_val = (newval>0 ? "1" : "0");
730  res = _setAttr("enabled", rest_val);
731  } catch (std::exception) {
733  throw;
734  }
736  return res;
737 }
738 
747 {
748  string res;
750  try {
753  {
756  }
757  }
758  }
759  res = _startupSeq;
760  } catch (std::exception) {
762  throw;
763  }
765  return res;
766 }
767 
779 int YDisplay::set_startupSeq(const string& newval)
780 {
781  string rest_val;
782  int res;
784  try {
785  rest_val = newval;
786  res = _setAttr("startupSeq", rest_val);
787  } catch (std::exception) {
789  throw;
790  }
792  return res;
793 }
794 
803 {
804  int res = 0;
806  try {
809  {
812  }
813  }
814  }
815  res = _brightness;
816  } catch (std::exception) {
818  throw;
819  }
821  return res;
822 }
823 
836 {
837  string rest_val;
838  int res;
840  try {
841  char buf[32]; sprintf(buf, "%d", newval); rest_val = string(buf);
842  res = _setAttr("brightness", rest_val);
843  } catch (std::exception) {
845  throw;
846  }
848  return res;
849 }
850 
860 {
861  Y_ORIENTATION_enum res;
863  try {
866  {
869  }
870  }
871  }
872  res = _orientation;
873  } catch (std::exception) {
875  throw;
876  }
878  return res;
879 }
880 
893 {
894  string rest_val;
895  int res;
897  try {
898  char buf[32]; sprintf(buf, "%d", newval); rest_val = string(buf);
899  res = _setAttr("orientation", rest_val);
900  } catch (std::exception) {
902  throw;
903  }
905  return res;
906 }
907 
916 {
917  int res = 0;
919  try {
922  {
925  }
926  }
927  }
928  res = _displayWidth;
929  } catch (std::exception) {
931  throw;
932  }
934  return res;
935 }
936 
945 {
946  int res = 0;
948  try {
951  {
954  }
955  }
956  }
957  res = _displayHeight;
958  } catch (std::exception) {
960  throw;
961  }
963  return res;
964 }
965 
975 {
976  Y_DISPLAYTYPE_enum res;
978  try {
979  if (_cacheExpiration == 0) {
981  {
984  }
985  }
986  }
987  res = _displayType;
988  } catch (std::exception) {
990  throw;
991  }
993  return res;
994 }
995 
1004 {
1005  int res = 0;
1007  try {
1008  if (_cacheExpiration == 0) {
1010  {
1013  }
1014  }
1015  }
1016  res = _layerWidth;
1017  } catch (std::exception) {
1019  throw;
1020  }
1022  return res;
1023 }
1024 
1033 {
1034  int res = 0;
1036  try {
1037  if (_cacheExpiration == 0) {
1039  {
1042  }
1043  }
1044  }
1045  res = _layerHeight;
1046  } catch (std::exception) {
1048  throw;
1049  }
1051  return res;
1052 }
1053 
1062 {
1063  int res = 0;
1065  try {
1066  if (_cacheExpiration == 0) {
1068  {
1071  }
1072  }
1073  }
1074  res = _layerCount;
1075  } catch (std::exception) {
1077  throw;
1078  }
1080  return res;
1081 }
1082 
1084 {
1085  string res;
1087  try {
1090  {
1093  }
1094  }
1095  }
1096  res = _command;
1097  } catch (std::exception) {
1099  throw;
1100  }
1102  return res;
1103 }
1104 
1105 int YDisplay::set_command(const string& newval)
1106 {
1107  string rest_val;
1108  int res;
1110  try {
1111  rest_val = newval;
1112  res = _setAttr("command", rest_val);
1113  } catch (std::exception) {
1115  throw;
1116  }
1118  return res;
1119 }
1120 
1149 {
1150  YDisplay* obj = NULL;
1151  int taken = 0;
1152  if (YAPI::_apiInitialized) {
1154  taken = 1;
1155  }try {
1156  obj = (YDisplay*) YFunction::_FindFromCache("Display", func);
1157  if (obj == NULL) {
1158  obj = new YDisplay(func);
1159  YFunction::_AddToCache("Display", func, obj);
1160  }
1161  } catch (std::exception) {
1163  throw;
1164  }
1166  return obj;
1167 }
1168 
1181 {
1182  string val;
1183  if (callback != NULL) {
1185  } else {
1187  }
1188  _valueCallbackDisplay = callback;
1189  // Immediately invoke value callback with current value
1190  if (callback != NULL && this->isOnline()) {
1191  val = _advertisedValue;
1192  if (!(val == "")) {
1193  this->_invokeValueCallback(val);
1194  }
1195  }
1196  return 0;
1197 }
1198 
1200 {
1201  if (_valueCallbackDisplay != NULL) {
1202  _valueCallbackDisplay(this, value);
1203  } else {
1205  }
1206  return 0;
1207 }
1208 
1219 {
1220  this->flushLayers();
1221  this->resetHiddenLayerFlags();
1222  return this->sendCommand("Z");
1223 }
1224 
1236 int YDisplay::fade(int brightness,int duration)
1237 {
1238  this->flushLayers();
1239  return this->sendCommand(YapiWrapper::ysprintf("+%d,%d",brightness,duration));
1240 }
1241 
1252 {
1253  this->flushLayers();
1254  _sequence = "";
1255  _recording = true;
1256  return YAPI_SUCCESS;
1257 }
1258 
1270 int YDisplay::saveSequence(string sequenceName)
1271 {
1272  this->flushLayers();
1273  _recording = false;
1274  this->_upload(sequenceName, _sequence);
1275  //We need to use YPRINTF("") for Objective-C
1277  return YAPI_SUCCESS;
1278 }
1279 
1290 int YDisplay::playSequence(string sequenceName)
1291 {
1292  this->flushLayers();
1293  return this->sendCommand(YapiWrapper::ysprintf("S%s",sequenceName.c_str()));
1294 }
1295 
1310 int YDisplay::pauseSequence(int delay_ms)
1311 {
1312  this->flushLayers();
1313  return this->sendCommand(YapiWrapper::ysprintf("W%d",delay_ms));
1314 }
1315 
1325 {
1326  this->flushLayers();
1327  return this->sendCommand("S");
1328 }
1329 
1342 int YDisplay::upload(string pathname,string content)
1343 {
1344  return this->_upload(pathname, content);
1345 }
1346 
1361 int YDisplay::copyLayerContent(int srcLayerId,int dstLayerId)
1362 {
1363  this->flushLayers();
1364  return this->sendCommand(YapiWrapper::ysprintf("o%d,%d",srcLayerId,dstLayerId));
1365 }
1366 
1382 int YDisplay::swapLayerContent(int layerIdA,int layerIdB)
1383 {
1384  this->flushLayers();
1385  return this->sendCommand(YapiWrapper::ysprintf("E%d,%d",layerIdA,layerIdB));
1386 }
1387 
1389 {
1390  string hwid;
1391 
1392  if(YISERR(_nextFunction(hwid)) || hwid=="") {
1393  return NULL;
1394  }
1395  return YDisplay::FindDisplay(hwid);
1396 }
1397 
1399 {
1400  vector<YFUN_DESCR> v_fundescr;
1401  YDEV_DESCR ydevice;
1402  string serial, funcId, funcName, funcVal, errmsg;
1403 
1404  if(YISERR(YapiWrapper::getFunctionsByClass("Display", 0, v_fundescr, sizeof(YFUN_DESCR), errmsg)) ||
1405  v_fundescr.size() == 0 ||
1406  YISERR(YapiWrapper::getFunctionInfo(v_fundescr[0], ydevice, serial, funcId, funcName, funcVal, errmsg))) {
1407  return NULL;
1408  }
1409  return YDisplay::FindDisplay(serial+"."+funcId);
1410 }
1411 
1412 //--- (end of generated code: YDisplay implementation)
1413 
1414 
1416 {
1417  if(_allDisplayLayers.size()==0) {
1418  unsigned nb_display_layer = this->get_layerCount();
1419  for(unsigned i = 0; i < nb_display_layer; i++) {
1420  _allDisplayLayers.push_back(new YDisplayLayer(this, i));
1421  }
1422  }
1423  if(layerId >= _allDisplayLayers.size()) {
1424  this->_throw(YAPI_INVALID_ARGUMENT, "Invalid layerId");
1425  return NULL;
1426  }
1427  return _allDisplayLayers[layerId];
1428 }
1429 
1430 
1432 {
1433  for(unsigned i = 0; i < _allDisplayLayers.size(); i++) {
1434  _allDisplayLayers[i]->flush_now();
1435  }
1436  return YAPI_SUCCESS;
1437 }
1438 
1439 // internal function to clear hidden flag during resetAll
1441 {
1442  for(unsigned i = 0; i < _allDisplayLayers.size(); i++) {
1443  _allDisplayLayers[i]->resetHiddenFlag();
1444  }
1445 }
1446 
1447 int YDisplay::sendCommand(string cmd)
1448 {
1449  if(!_recording) {
1450  return this->set_command(cmd);
1451  }
1452  _sequence += cmd+"\n";
1453  return YAPI_SUCCESS;
1454 }
1455 
1456 
1457 //--- (generated code: YDisplay functions)
1458 //--- (end of generated code: YDisplay functions)
virtual int _invokeValueCallback(string value)
string _advertisedValue
Definition: yocto_api.h:1569
virtual int setLayerPosition(int x, int y, int scrollTime)
virtual int playSequence(string sequenceName)
string get_command(void)
yCRITICAL_SECTION _this_cs
Definition: yocto_api.h:1563
void(* YDisplayValueCallback)(YDisplay *func, const string &functionValue)
Definition: yocto_display.h:53
YDisplay * nextDisplay(void)
virtual int selectColorPen(int color)
Y_ENABLED_enum
Definition: yocto_current.h:59
virtual int registerValueCallback(YDisplayValueCallback callback)
int _layerHeight
YRETCODE _load_unsafe(int msValidity)
Definition: yocto_api.cpp:3327
int set_brightness(int newval)
string _startupSeq
Y_DISPLAYTYPE_enum _displayType
static YDisplay * FindDisplay(string func)
virtual int drawPixel(int x, int y)
Y_ORIENTATION_enum _orientation
int get_layerWidth(void)
int set_enabled(Y_ENABLED_enum newval)
YDisplay(const string &func)
int _displayHeight
static const int LAYERWIDTH_INVALID
static const string STARTUPSEQ_INVALID
int get_layerCount(void)
virtual int saveSequence(string sequenceName)
YRETCODE _upload(const string &path, const string &content)
Definition: yocto_api.cpp:3098
virtual int hide(void)
static int DefaultCacheValidity
Definition: yocto_api.h:468
string getString(const string &key)
Definition: yocto_api.cpp:773
static const int DISPLAYHEIGHT_INVALID
virtual int moveTo(int x, int y)
Y_ENABLED_enum get_enabled(void)
virtual YDisplay * get_display(void)
u64 _cacheExpiration
Definition: yocto_api.h:1571
virtual int setAntialiasingMode(bool mode)
virtual int fade(int brightness, int duration)
void _throw(YRETCODE errType, string errMsg)
Definition: yocto_api.cpp:2656
Y_ENABLED_enum _enabled
void resetHiddenLayerFlags(void)
void yLeaveCriticalSection(yCRITICAL_SECTION *cs)
Definition: ythread.c:672
string _command
static YRETCODE getFunctionInfo(YFUN_DESCR fundesc, YDEV_DESCR &devdescr, string &serial, string &funcId, string &funcName, string &funcVal, string &errmsg)
Definition: yocto_api.cpp:4930
virtual int selectGrayPen(int graylevel)
virtual int drawBar(int x1, int y1, int x2, int y2)
virtual int consoleOut(string text)
virtual int drawCircle(int x, int y, int r)
virtual int get_layerHeight(void)
virtual int drawImage(int x, int y, string imagename)
#define YAPI_INVALID_STRING
Definition: yocto_api.h:69
virtual int drawBitmap(int x, int y, int w, string bitmap, int bgcol)
virtual int _parseAttr(YJSONObject *json_val)
Definition: yocto_api.cpp:2367
virtual int unhide(void)
int brightness(void)
virtual int selectEraser(void)
static const int LAYERCOUNT_INVALID
virtual int copyLayerContent(int srcLayerId, int dstLayerId)
virtual int setConsoleWordWrap(bool wordwrap)
static const int LAYERHEIGHT_INVALID
Y_DISPLAYTYPE_enum get_displayType(void)
YAPI_FUNCTION YFUN_DESCR
Definition: yocto_api.h:230
int getInt(const string &key)
Definition: yocto_api.cpp:779
virtual int upload(string pathname, string content)
static u64 GetTickCount(void)
Definition: yocto_api.cpp:4755
static void _AddToCache(const string &classname, const string &func, YFunction *obj)
Definition: yocto_api.cpp:2345
int _layerWidth
virtual int clear(void)
virtual int drawText(int x, int y, Y_ALIGN anchor, string text)
virtual int _parseAttr(YJSONObject *json_val)
int _brightness
static const Y_ORIENTATION_enum ORIENTATION_INVALID
virtual int get_displayWidth(void)
int set_command(const string &newval)
virtual int swapLayerContent(int layerIdA, int layerIdB)
YAPI_DEVICE YDEV_DESCR
Definition: yocto_api.h:229
static YFunction * _FindFromCache(const string &classname, const string &func)
Definition: yocto_api.cpp:2338
virtual int pauseSequence(int delay_ms)
static const string COMMAND_INVALID
virtual int setConsoleBackground(int bgcol)
static string ysprintf(const char *fmt,...)
Definition: yocto_api.cpp:4997
Y_ALIGN
Definition: yocto_display.h:94
int _layerCount
void yEnterCriticalSection(yCRITICAL_SECTION *cs)
Definition: ythread.c:647
static yCRITICAL_SECTION _global_cs
Definition: yocto_api.h:476
bool isOnline(void)
Definition: yocto_api.cpp:3291
static const int BRIGHTNESS_INVALID
bool _recording
virtual int get_displayHeight(void)
virtual int selectFont(string fontname)
YDisplay * _display
int _displayWidth
static int getFunctionsByClass(const string &class_str, YFUN_DESCR prevfundesc, vector< YFUN_DESCR > &buffer, int maxsize, string &errmsg)
Definition: yocto_api.cpp:4852
static const Y_ENABLED_enum ENABLED_INVALID
YDisplayValueCallback _valueCallbackDisplay
virtual int resetHiddenFlag(void)
int set_orientation(Y_ORIENTATION_enum newval)
virtual int stopSequence(void)
string _className
Definition: yocto_api.h:1558
string _sequence
static const int DISPLAYWIDTH_INVALID
Y_ORIENTATION_enum
Definition: yocto_display.h:64
virtual int reset(void)
virtual int drawRect(int x1, int y1, int x2, int y2)
Y_DISPLAYTYPE_enum
Definition: yocto_display.h:74
static YDisplay * FirstDisplay(void)
int command_flush(string cmd)
YDisplayLayer * get_displayLayer(unsigned layerId)
virtual int newSequence(void)
vector< YDisplayLayer * > _allDisplayLayers
int get_brightness(void)
YDisplayLayer(YDisplay *parent, int id)
static bool _apiInitialized
Definition: yocto_api.h:475
YRETCODE _nextFunction(string &hwId)
Definition: yocto_api.cpp:2709
virtual int drawDisc(int x, int y, int r)
virtual int resetAll(void)
static void _UpdateValueCallbackList(YFunction *func, bool add)
Definition: yocto_api.cpp:3509
#define YISERR(retcode)
Definition: ydef.h:394
static const Y_DISPLAYTYPE_enum DISPLAYTYPE_INVALID
string get_startupSeq(void)
int sendCommand(string cmd)
virtual int lineTo(int x, int y)
virtual int clearConsole(void)
bool has(const string &key)
Definition: yocto_api.cpp:735
int flushLayers(void)
YRETCODE _setAttr(string attrname, string newvalue)
Definition: yocto_api.cpp:2968
int command_push(string cmd)
int set_startupSeq(const string &newval)
int get_layerHeight(void)
virtual int get_layerWidth(void)
int get_displayHeight(void)
virtual int _invokeValueCallback(string value)
Definition: yocto_api.cpp:2563
virtual int setConsoleMargins(int x1, int y1, int x2, int y2)
Y_ORIENTATION_enum get_orientation(void)
int get_displayWidth(void)


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