41 #define _CRT_SECURE_NO_DEPRECATE //do not use windows secure crt 49 #define __FILE_ID__ "multiaxiscontroller" 53 ,_nAxis(NAXIS_INVALID)
54 ,_globalState(GLOBALSTATE_INVALID)
55 ,_command(COMMAND_INVALID)
56 ,_valueCallbackMultiAxisController(NULL)
73 if(json_val->
has(
"nAxis")) {
76 if(json_val->
has(
"globalState")) {
79 if(json_val->
has(
"command")) {
107 }
catch (std::exception) {
130 char buf[32]; sprintf(buf,
"%d", newval); rest_val = string(buf);
132 }
catch (std::exception) {
163 }
catch (std::exception) {
185 }
catch (std::exception) {
200 res =
_setAttr(
"command", rest_val);
201 }
catch (std::exception) {
249 }
catch (std::exception) {
271 if (callback != NULL) {
278 if (callback != NULL && this->
isOnline()) {
305 res = ((u8)retBin[0]);
344 ndim = (int)speed.size();
370 ndim = (int)absPos.size();
396 ndim = (int)relPos.size();
464 vector<YFUN_DESCR> v_fundescr;
466 string serial, funcId, funcName, funcVal, errmsg;
469 v_fundescr.size() == 0 ||
static YMultiAxisController * FirstMultiAxisController(void)
YMultiAxisControllerValueCallback _valueCallbackMultiAxisController
yCRITICAL_SECTION _this_cs
virtual int emergencyStop(void)
virtual int abortAndBrake(void)
virtual int moveRel(vector< double > relPos)
YRETCODE _load_unsafe(int msValidity)
virtual int pause(int waitMs)
virtual int abortAndHiZ(void)
int set_nAxis(int newval)
virtual int _invokeValueCallback(string value)
static int DefaultCacheValidity
string getString(const string &key)
static const string COMMAND_INVALID
static const Y_GLOBALSTATE_enum GLOBALSTATE_INVALID
void _throw(YRETCODE errType, string errMsg)
Y_GLOBALSTATE_enum _globalState
virtual int _parseAttr(YJSONObject *json_val)
void yLeaveCriticalSection(yCRITICAL_SECTION *cs)
string _download(const string &url)
static YRETCODE getFunctionInfo(YFUN_DESCR fundesc, YDEV_DESCR &devdescr, string &serial, string &funcId, string &funcName, string &funcVal, string &errmsg)
#define YAPI_INVALID_STRING
virtual int _parseAttr(YJSONObject *json_val)
int getInt(const string &key)
static u64 GetTickCount(void)
static void _AddToCache(const string &classname, const string &func, YFunction *obj)
Y_GLOBALSTATE_enum get_globalState(void)
static YFunction * _FindFromCache(const string &classname, const string &func)
virtual int moveTo(vector< double > absPos)
static YMultiAxisController * FindMultiAxisController(string func)
static string ysprintf(const char *fmt,...)
void yEnterCriticalSection(yCRITICAL_SECTION *cs)
static yCRITICAL_SECTION _global_cs
static const int NAXIS_INVALID
virtual int sendCommand(string command)
static int getFunctionsByClass(const string &class_str, YFUN_DESCR prevfundesc, vector< YFUN_DESCR > &buffer, int maxsize, string &errmsg)
virtual int registerValueCallback(YMultiAxisControllerValueCallback callback)
YMultiAxisController * nextMultiAxisController(void)
YMultiAxisController(const string &func)
static bool _apiInitialized
YRETCODE _nextFunction(string &hwId)
static void _UpdateValueCallbackList(YFunction *func, bool add)
void(* YMultiAxisControllerValueCallback)(YMultiAxisController *func, const string &functionValue)
bool has(const string &key)
int set_command(const string &newval)
YRETCODE _setAttr(string attrname, string newvalue)
virtual int findHomePosition(vector< double > speed)
virtual int _invokeValueCallback(string value)