#py from parse import parse #py import model #py import os #py import collections #py import re #py plugin = parse(pycpp.params['xml_file']) #py def generateLinks(arg): #py arg=re.sub('\[L\[#([^,\[\]]+)\]\]',r'\1',arg) #e.g. [L[#simxGetObjectPosition]] --> simxSetObjectPosition #py arg=re.sub('\[L\[([^,\[\]]+)\]\]',r'\1',arg) #e.g. [L[simxGetObjectPosition.html]] --> simxSetObjectPosition.html #py arg=re.sub('\[L\[([^,\[\]]+),([^,\[\]]+)\]\]',r'\2',arg) #e.g. [L[#simxGetObjectPosition,Click me]] --> Click me #py arg=re.sub('\[B\[([^\[\]]+)\]\]',r'\1',arg) #e.g. [B[text in bold]] #py arg=re.sub('\[I\[([^\[\]]+)\]\]',r'\1',arg) #e.g. [I[text in italic]] #py arg=re.sub('\['+lang+'\[([^\[\]]+)\]\]',r'\1',arg) #py arg=re.sub('\[cpp\[([^\[\]]+)\]\]',r'',arg) #py arg=re.sub('\[java\[([^\[\]]+)\]\]',r'',arg) #py arg=re.sub('\[lua\[([^\[\]]+)\]\]',r'',arg) #py arg=re.sub('\[matlab\[([^\[\]]+)\]\]',r'',arg) #py arg=re.sub('\[python\[([^\[\]]+)\]\]',r'',arg) #py return arg #py #----------------------------------------------------------------------------------------------- #py #----------------------------------------------------------------------------------------------- B0-based remote API functions
#py lang=os.getenv('remoteApiDocLang') #py if lang=='cpp':

B0-based remote API, C++

#py elif lang=='java':

B0-based remote API, Java

#py elif lang=='lua':

B0-based remote API, Lua

#py elif lang=='matlab':

B0-based remote API, Matlab

#py elif lang=='python':

B0-based remote API, Python

#py endif #py #----------------------------------------------------------------------------------------------- #py #----------------------------------------------------------------------------------------------- #py allCmds={} #py for cmd in plugin.commands: #py cmdHtmlStr='

\n' #py cmdHtmlStr+=''+cmd.name+'

\n' #py cmdHtmlStr+='\n' #py cmdHtmlStr+='\n' #py cmdHtmlStr+='\n' #py cmdHtmlStr+='\n' #py cmdHtmlStr+='\n' #py cmdHtmlStr+='\n' #py cmdHtmlStr+='\n' #py #----------------------------------------------------------------------------------------------- #py #----------------------------------------------------------------------------------------------- #py if lang=='cpp': #py if cmd.generic: #py cmdHtmlStr+='\n' #py cmdHtmlStr+='\n' #py cmdHtmlStr+='\n' #py cmdHtmlStr+='\n' #py cmdHtmlStr+='\n' #py cmdHtmlStr+='\n' #py #----------------------------------------------------------------------------------------------- #py if len(cmd.checkAlso)>0: #py cmdHtmlStr+='\n' #py cmdHtmlStr+='\n' #py cmdHtmlStr+='
Description'+generateLinks(cmd.description)+'
synopsisstd::vector<msgpack::object>* '+cmd.name+'(' #py else: #py if len(cmd.returns)>0: #py p = cmd.returns[0] #py cmdHtmlStr+=''+p.htype()+' '+cmd.name+'(' #py else: #py cmdHtmlStr+='void '+cmd.name+'(' #py endif #py endif #py itemCnt=len(cmd.params) #py itemIndex=-1 #py for p in cmd.params: #py itemIndex=itemIndex+1 #py if p.ctype()=='string': #py cmdHtmlStr+='const char* '+p.name #py if p.default: #py cmdHtmlStr+=' = "'+p.default+'"' #py endif #py elif p.ctype()=='byte[]': #py cmdHtmlStr+='const char* '+p.name+'_data,size_t '+p.name+'_charCnt' #py elif p.ctype()=='int[]': #py cmdHtmlStr+='const int* '+p.name+'_data,size_t '+p.name+'_intCnt' #py elif p.ctype()=='packed_unpacked': #py cmdHtmlStr+='const char* '+p.name+'_data,size_t '+p.name+'_charCnt' #py elif p.ctype()=='int[2]': #py cmdHtmlStr+='const int '+p.name+'[2]' #py elif p.ctype()=='float[]': #py cmdHtmlStr+='const float* '+p.name+'_data,size_t '+p.name+'_floatCnt' #py elif p.ctype()=='float[2]': #py cmdHtmlStr+='const float '+p.name+'[2]' #py elif p.ctype()=='float[3]': #py cmdHtmlStr+='const float '+p.name+'[3]' #py elif p.ctype()=='float[7]': #py cmdHtmlStr+='const float '+p.name+'[7]' #py elif p.ctype()=='float[12]': #py cmdHtmlStr+='const float '+p.name+'[12]' #py elif p.ctype()=='double[]': #py cmdHtmlStr+='const double* '+p.name+'_data,size_t '+p.name+'_doubleCnt' #py elif p.ctype()=='double[2]': #py cmdHtmlStr+='const double '+p.name+'[2]' #py elif p.ctype()=='double[3]': #py cmdHtmlStr+='const double '+p.name+'[3]' #py elif p.ctype()=='double[7]': #py cmdHtmlStr+='const double '+p.name+'[7]' #py elif p.ctype()=='double[12]': #py cmdHtmlStr+='const double '+p.name+'[12]' #py elif p.ctype()=='int_eval': #py cmdHtmlStr+='int/(const char*) '+p.name #py else: #py cmdHtmlStr+=p.htype()+' '+p.name #py if p.default: #py cmdHtmlStr+=' = '+p.default #py endif #py endif #py if (itemCnt>1) and itemIndex0: #py p = cmd.returns[0] #py cmdHtmlStr+=''+p.htype()+' '+cmd.name+'(' #py else: #py cmdHtmlStr+='void '+cmd.name+'(' #py endif #py endif #py itemCnt=len(cmd.params) #py itemIndex=-1 #py for p in cmd.params: #py itemIndex=itemIndex+1 #py cmdHtmlStr+=p.htype()+' '+p.name #py if p.default: #py if p.ctype()=='string': #py cmdHtmlStr+=' = "'+p.default+'"' #py else: #py cmdHtmlStr+=' = '+p.default #py endif #py endif #py if (itemCnt>1) and itemIndex0: #py p = cmd.returns[0] #py cmdHtmlStr+=''+p.htype()+' '+cmd.name+'(' #py else: #py cmdHtmlStr+=''+cmd.name+'(' #py endif #py endif #py itemCnt=len(cmd.params) #py itemIndex=-1 #py for p in cmd.params: #py itemIndex=itemIndex+1 #py cmdHtmlStr+=p.htype()+' '+p.name #py if p.default: #py if p.ctype()=='string': #py cmdHtmlStr+=' = "'+p.default+'"' #py else: #py cmdHtmlStr+=' = '+p.default #py endif #py endif #py if (itemCnt>1) and itemIndex0: #py p = cmd.returns[0] #py cmdHtmlStr+=''+p.htype()+' '+cmd.name+'(' #py else: #py cmdHtmlStr+=''+cmd.name+'(' #py endif #py endif #py itemCnt=len(cmd.params) #py itemIndex=-1 #py for p in cmd.params: #py itemIndex=itemIndex+1 #py cmdHtmlStr+=p.htype()+' '+p.name #py if p.default: #py if p.ctype()=='string': #py cmdHtmlStr+=" = '"+p.default+"'" #py else: #py cmdHtmlStr+=' = '+p.default #py endif #py endif #py if (itemCnt>1) and itemIndex0: #py p = cmd.returns[0] #py cmdHtmlStr+=''+p.htype()+' '+cmd.name+'(' #py else: #py cmdHtmlStr+=''+cmd.name+'(' #py endif #py endif #py itemCnt=len(cmd.params) #py itemIndex=-1 #py for p in cmd.params: #py itemIndex=itemIndex+1 #py cmdHtmlStr+=p.htype()+' '+p.name #py if p.default: #py if p.ctype()=='string': #py cmdHtmlStr+=" = '"+p.default+"'" #py elif p.ctype()=='bool': #py if p.default=='true': #py cmdHtmlStr+=" = True" #py else: #py cmdHtmlStr+=" = False" #py endif #py else: #py cmdHtmlStr+=' = '+p.default #py endif #py endif #py if (itemCnt>1) and itemIndex: '+generateLinks(p.description)+'\n' #py endfor #py cmdHtmlStr+='
return\n' #py #----------------------------------------------------------------------------------------------- #py #----------------------------------------------------------------------------------------------- #py if lang=='cpp': #py if cmd.generic: #py cmdHtmlStr+='
A vector containing messagePack objects. The returned pointer remains valid until another remote API function is called. For convenience, you can use the helper functions to read its values. The vector contains:
' #py for p in cmd.returns: #py cmdHtmlStr+='
'+p.name+' ('+p.ctype()+'): '+generateLinks(p.description)+'
\n' #py endfor #py else: #py if len(cmd.returns)>0: #py p = cmd.returns[0] #py cmdHtmlStr+='
'+p.description+'
\n' #py endif #py endif #py #----------------------------------------------------------------------------------------------- #py elif lang=='java': #py if cmd.generic: #py cmdHtmlStr+='
A MessageUnpacker. For convenience, you can use the helper functions to read its values. The MessageUnpacker contains:
' #py for p in cmd.returns: #py cmdHtmlStr+='
'+p.name+' ('+p.ctype()+'): '+generateLinks(p.description)+'
\n' #py endfor #py else: #py if len(cmd.returns)>0: #py p = cmd.returns[0] #py cmdHtmlStr+='
'+generateLinks(p.description)+'
\n' #py endif #py endif #py #----------------------------------------------------------------------------------------------- #py else: #py if cmd.generic: #py if lang=='lua': #py cmdHtmlStr+='
A table that contains:
' #py elif lang=='matlab': #py cmdHtmlStr+='
An array that contains:
' #py else: #py cmdHtmlStr+='
A list that contains:
' #py endif #py for p in cmd.returns: #py cmdHtmlStr+='
'+p.name+' ('+p.htype()+'): '+generateLinks(p.description)+'
\n' #py endfor #py else: #py if len(cmd.returns)>0: #py p = cmd.returns[0] #py cmdHtmlStr+='
'+generateLinks(p.description)+'
\n' #py endif #py endif #py endif #py #----------------------------------------------------------------------------------------------- #py #----------------------------------------------------------------------------------------------- #py cmdHtmlStr+='
See also\n' #py cmdHtmlStr+='
\n' #py itemCnt=len(cmd.checkAlso) #py itemIndex=-1 #py for p in cmd.checkAlso: #py itemIndex=itemIndex+1 #py cmdHtmlStr+=generateLinks(p['name']) #py if (itemCnt>1) and itemIndex'+p[0]+'' #py if (itemCnt>1) and itemIndex Topics / Communication channels
simxServiceCall
simxDefaultPublisher
simxDefaultSubscriber
simxCreatePublisher
simxCreateSubscriber
#py #----------------------------------------------------------------------------------------------- #py #----------------------------------------------------------------------------------------------- #py if (lang=='cpp') or (lang=='java'):

Helper functions

#py #-----------------------------------------------------------------------------------------------
#py #-----------------------------------------------------------------------------------------------
#py if lang=='cpp':
static void b0RemoteApi::print(const std::vector* msg)
static bool b0RemoteApi::hasValue(const std::vector* msg)
static bool b0RemoteApi::readBool(std::vector* msg,
    int pos,bool* success=nullptr)
static int b0RemoteApi::readInt(std::vector* msg,
    int pos,bool* success=nullptr)
static float b0RemoteApi::readFloat(std::vector* msg,
    int pos,bool* success=nullptr)
static double b0RemoteApi::readDouble(std::vector* msg,
    int pos,bool* success=nullptr)
static std::string b0RemoteApi::readString(std::vector* msg,
    int pos,bool* success=nullptr)
static std::string b0RemoteApi::readByteArray(std::vector* msg,
    int pos,bool* success=nullptr)
static bool b0RemoteApi::readIntArray(std::vector* msg,
    std::vector& array,int pos)
static bool b0RemoteApi::readFloatArray(std::vector* msg,
    std::vector& array,int pos)
static bool b0RemoteApi::readDoubleArray(std::vector* msg,
    std::vector& array,int pos)
static bool b0RemoteApi::readStringArray(std::vector* msg,
    std::vector& array,int pos)
#py #-----------------------------------------------------------------------------------------------
#py #-----------------------------------------------------------------------------------------------
#py elif lang=='java':
static void b0RemoteApi::print(final MessageUnpacker msg) 
static boolean b0RemoteApi::hasValue(final MessageUnpacker msg)
static Value b0RemoteApi::readValue(final MessageUnpacker msg,
    int valuesToDiscard = 0)
static boolean b0RemoteApi::readBool(final MessageUnpacker msg,
    int valuesToDiscard = 0)
static int b0RemoteApi::readInt(final MessageUnpacker msg,
    int valuesToDiscard = 0)
static float b0RemoteApi::readFloat(final MessageUnpacker msg,
    int valuesToDiscard = 0)
static double b0RemoteApi::readDouble(final MessageUnpacker msg,
    int valuesToDiscard = 0)
static String b0RemoteApi::readString(final MessageUnpacker msg,
    int valuesToDiscard = 0)
static byte[] b0RemoteApi::readByteArray(final MessageUnpacker msg,
    int valuesToDiscard = 0)
static int[] b0RemoteApi::readIntArray(final MessageUnpacker msg,
    int valuesToDiscard = 0)
static float[] b0RemoteApi::readFloatArray(final MessageUnpacker msg,
    int valuesToDiscard = 0)
static double[] b0RemoteApi::readDoubleArray(final MessageUnpacker msg,
    int valuesToDiscard = 0)
static String[] b0RemoteApi::readStringArray(final MessageUnpacker msg,
    int valuesToDiscard = 0)
#py endif
#py endif #py #----------------------------------------------------------------------------------------------- #py #----------------------------------------------------------------------------------------------- #py # following 2 lines so that jumping to the helper functions brings them to the top, otherwise confusing: