41 #define _CRT_SECURE_NO_DEPRECATE //do not use windows secure crt 49 #define __FILE_ID__ "segmenteddisplay" 53 ,_displayedText(DISPLAYEDTEXT_INVALID)
54 ,_displayMode(DISPLAYMODE_INVALID)
55 ,_valueCallbackSegmentedDisplay(NULL)
72 if(json_val->
has(
"displayedText")) {
75 if(json_val->
has(
"displayMode")) {
103 }
catch (std::exception) {
127 res =
_setAttr(
"displayedText", rest_val);
128 }
catch (std::exception) {
150 }
catch (std::exception) {
164 char buf[32]; sprintf(buf,
"%d", newval); rest_val = string(buf);
165 res =
_setAttr(
"displayMode", rest_val);
166 }
catch (std::exception) {
214 }
catch (std::exception) {
236 if (callback != NULL) {
243 if (callback != NULL && this->
isOnline()) {
274 vector<YFUN_DESCR> v_fundescr;
276 string serial, funcId, funcName, funcVal, errmsg;
279 v_fundescr.size() == 0 ||
yCRITICAL_SECTION _this_cs
static YSegmentedDisplay * FindSegmentedDisplay(string func)
YRETCODE _load_unsafe(int msValidity)
virtual int _invokeValueCallback(string value)
Y_DISPLAYMODE_enum get_displayMode(void)
void(* YSegmentedDisplayValueCallback)(YSegmentedDisplay *func, const string &functionValue)
static int DefaultCacheValidity
string getString(const string &key)
virtual int _parseAttr(YJSONObject *json_val)
void yLeaveCriticalSection(yCRITICAL_SECTION *cs)
static const string DISPLAYEDTEXT_INVALID
static YRETCODE getFunctionInfo(YFUN_DESCR fundesc, YDEV_DESCR &devdescr, string &serial, string &funcId, string &funcName, string &funcVal, string &errmsg)
YSegmentedDisplay(const string &func)
#define YAPI_INVALID_STRING
virtual int _parseAttr(YJSONObject *json_val)
int getInt(const string &key)
static const Y_DISPLAYMODE_enum DISPLAYMODE_INVALID
static u64 GetTickCount(void)
static void _AddToCache(const string &classname, const string &func, YFunction *obj)
static YFunction * _FindFromCache(const string &classname, const string &func)
int set_displayedText(const string &newval)
void yEnterCriticalSection(yCRITICAL_SECTION *cs)
static yCRITICAL_SECTION _global_cs
virtual int registerValueCallback(YSegmentedDisplayValueCallback callback)
Y_DISPLAYMODE_enum _displayMode
static int getFunctionsByClass(const string &class_str, YFUN_DESCR prevfundesc, vector< YFUN_DESCR > &buffer, int maxsize, string &errmsg)
string get_displayedText(void)
YSegmentedDisplayValueCallback _valueCallbackSegmentedDisplay
static bool _apiInitialized
int set_displayMode(Y_DISPLAYMODE_enum newval)
YRETCODE _nextFunction(string &hwId)
static void _UpdateValueCallbackList(YFunction *func, bool add)
bool has(const string &key)
YRETCODE _setAttr(string attrname, string newvalue)
YSegmentedDisplay * nextSegmentedDisplay(void)
virtual int _invokeValueCallback(string value)
static YSegmentedDisplay * FirstSegmentedDisplay(void)