AURobotServers
4
|
#include <uresclientifvar.h>
Public Member Functions | |
void | addTags (const char *tags) |
virtual const char * | commandList () |
void | createBaseVar () |
virtual void | createResources () |
void | handleNewData (USmlTag *tag, const char *ifname) |
virtual const char * | name () |
virtual const char * | print (const char *preString, char *buff, const int buffCnt) |
virtual bool | setResource (UResBase *res, bool remove) |
virtual char * | snprint (const char *preString, char *buff, const int buffCnt) |
UResIfVar (const char *resID) | |
~UResIfVar () | |
Public Member Functions inherited from UResIfBase | |
UResIfBase () | |
~UResIfBase () | |
Public Member Functions inherited from UClientFuncBase | |
virtual void | changedNamespace (const char *newNamespace) |
virtual void | doTimeTick () |
int | getMsgCnt () |
bool | getVerbose () |
bool | sendMsg (UClientPortSml *cnn, const char *buff, int buffCnt) |
bool | sendMsg (UClientPortSml *cnn, const char *buff) |
void | setVerbose (bool value) |
UClientFuncBase () | |
virtual | ~UClientFuncBase () |
Public Member Functions inherited from UResVarPool | |
int | addMethod (const char *formalName, const char *paramTypes, const char *comment) |
int | addMethodV (const char *formalName, const char *paramTypes, const char *comment) |
UVarPool * | addStruct (const char *name, const char *comment, bool copy=false) |
UVariable * | addVar (const char *name, const double initialValue, const char *type, const char *comment) |
UVariable * | addVar (const char *name, const char *initialValue, const char *type, const char *comment) |
UVariable * | addVarA (const char *name, const char *initialValue, const char *type, const char *comment) |
bool | callGlobal (const char *name, const char *paramOrder, char **strings, const double *doubles, double *value, UDataBase **returnStruct, int *returnStructCnt) |
bool | callGlobalV (const char *name, const char *paramOrder, UVariable **params, UDataBase **returnStruct, int *returnStructCnt) |
Call a method from the root var pool scope It may be in the structure direct (no '.') or in any sub-structure that the 'name.subname' indicate. More... | |
bool | callLocal (const char *name, const char *paramOrder, char **strings, const double *doubles, double *value, UDataBase **returnStruct, int *returnStructCnt) |
bool | callVS (const char *function, const char *stringParam) |
int | callVSCD (const char *function, const char *strPar, UDataBase *data, int cooSys) |
void | createBaseVar () |
virtual bool | createVarSpace (const int varCnt, const int structCnt, const int methCnt, const char *note, bool copy=false) |
bool | getGlobalString (const char *name, const char **value) |
bool | getGlobalValue (const char *name, double *value) |
bool | getGlobalValue (const char *name, const char **value) |
bool | getGlobalValue (const char *name, bool *value) |
bool | getGlobalValue (const char *name, UTime *value) |
bool | getLocalValue (const char *name, double *value) |
get a value in this variable tree More... | |
bool | getLocalValue (const char *name, bool *value) |
bool | getLocalValue (const char *name, UTime *value) |
double | getLocalValue (int idx) |
UPosition | getLocalValue3D (int idx) |
UPosRot | getLocalValue6D (int idx) |
bool | getLocalValueBool (int idx) |
int | getLocalValueInt (int idx) |
UTime | getLocalValueTime (int idx) |
const char * | getLogFileName () |
const char * | getVarDescription (int idx) |
UVarCalc * | getVarPool () |
virtual bool | gotAllResources (char *missingThese, int missingTheseCnt) |
bool | isLogFileOpen () |
bool | isLogFileOpen (const char *structName) |
bool | isVarPoolUpdated (int lastCnt, int *newCnt) |
void | logFileClose () |
bool | logFileOpen () |
void | logFileStart (const char *structName, bool open) |
virtual bool | methodCall (const char *name, const char *paramOrder, char **strings, const double *doubles, double *value, UDataBase **returnStruct=NULL, int *returnStructCnt=NULL) |
bool | setGlobalVar (const char *name, const double value, bool mayAdd) |
Assigns a value to a variable. The variable may be a part of a structure. More... | |
bool | setLocalVar (int idx, double value, const int element) |
bool | setLocalVar (const char *name, const double value, bool mayAdd) |
Assigns a value to a variable. The variable may be a part of a structure. More... | |
bool | setLocalVar3D (int idx, UPosition *value) |
bool | setLocalVar6D (int idx, UPosRot *value) |
bool | setLocalVarAdd (int idx, double value, const int element) |
bool | setLocalVarPose (int idx, UPose *value) |
void | setVarPool (UVarCalc *sharedVarPool) |
int | updateQTvars (int structIdx) |
UResVarPool () | |
virtual | ~UResVarPool () |
Public Member Functions inherited from UResBase | |
void | createReplayVar (UVarPool *pool) |
UCmdExe * | getCorePointer () |
char * | getLogFileName (char *fn, const int fnCnt) |
int | getResFuncIdx () |
const char * | getResID () |
int | getResVersion () |
bool | isA (const char *idStr) |
bool | isAlsoA (const char *id) |
virtual void | print (const char *preString) |
virtual void | saveSettings () |
void | setCorePointer (UCmdExe *serverCore) |
void | setResFuncIdx (int idx) |
virtual void | setResID (const char *id, const int version) |
virtual void | stop (bool) |
virtual void | updateReplayStatus () |
UResBase () | |
virtual | ~UResBase () |
Public Member Functions inherited from UReplay | |
void | addChild (UReplay *child) |
virtual bool | decodeReplayLine (char *) |
char * | getLogFileName (char *fn, const int fnCnt) |
char * | getReplayFileName (char *fn, const int fnCnt) |
int | getReplayLogLine () |
bool | isReplay () |
bool | isReplayFileOpen () |
void | removeChild (UReplay *child) |
virtual void | replayAdvanceTime (UTime untilTime) |
void | replaySetBaseFileName (const char *name, const char *preName="") |
void | replaySetFileName (const char *name) |
virtual bool | replayStep () |
int | replayStep (int steps) |
virtual bool | replayToTime (UTime untilTime) |
void | setParent (UReplay *parent) |
bool | setReplay (bool value) |
UReplay () | |
virtual | ~UReplay () |
Public Member Functions inherited from ULock | |
bool | lock () |
void | lockInit () |
void | post () |
bool | tryLock () |
bool | tryWait () |
ULock () | |
void | unlock () |
bool | wait () |
~ULock () | |
Public Member Functions inherited from UVarMethodImplement | |
virtual bool | methodCallV (const char *name, const char *paramOrder, UVariable *params[], UDataBase **returnStruct, int *returnStructCnt) |
virtual | ~UVarMethodImplement () |
Protected Member Functions | |
void | handleOther (USmlTag *tag, const char *ifname) |
void | handlePoseHist (USmlTag *tag, const char *ifname) |
void | handleVar (USmlTag *tag, const char *ifname) |
Protected Member Functions inherited from UClientFuncBase | |
void | handleHelp (USmlTag *tag) |
void | printReply (USmlTagIn *tag, const char *preString) |
Protected Member Functions inherited from UResVarPool | |
void | setDescription (const char *note, bool copy=false) |
Protected Member Functions inherited from UResBase | |
UResBase * | getStaticResource (const char *resName, bool mayCreate, bool staticOnly=true) |
get a pointer to a static resource. More... | |
Protected Attributes | |
UResPoseHist * | poseHist |
UResPoseHist * | poseMap |
UResPoseHist * | poseUtm |
Protected Attributes inherited from UClientFuncBase | |
int | msgHandled |
char | serverNamespace [MAX_SML_NAME_LENGTH] |
int | serverNamespaceValue |
bool | verboseMessages |
Protected Attributes inherited from UResBase | |
int | resFuncIdx |
char | resID [MAX_RESOURCE_ID_LENGTH] |
char | resIsAlso [MAX_RESOURCE_ISALSO_LENGTH] |
int | resVersion |
Protected Attributes inherited from UReplay | |
bool | replay |
FILE * | replayFile |
char | replayFileName [REPLAY_FILE_NAME_LENGTH] |
replay filename More... | |
char | replayLine [MAX_LOG_LINE_LENGTH] |
int | replayLogLine |
UReplay * | replayParent |
UTime | replayTimeNext |
Private Attributes | |
char | tagList [MAX_TAG_LIST_SIZE] |
UVariable * | varCallDispOnNewPose |
UVariable * | varMaintainDesc |
Static Private Attributes | |
static const int | MAX_TAG_LIST_SIZE = 100 |
Additional Inherited Members | |
Static Public Member Functions inherited from UResVarPool | |
static const char * | getResClassID () |
Public Attributes inherited from UClientFuncBase | |
ULock | decodeLock |
Public Attributes inherited from UReplay | |
bool | replayTimeAdvancePending |
UTime | replayTimeNow |
Static Protected Attributes inherited from UReplay | |
static const int | MAX_LOG_LINE_LENGTH = 10000 |
static const int | REPLAY_FILE_NAME_LENGTH = 264 |
max length of replay filename More... | |
Handling of messages that should be converted into simple variables in the var pool
@author Christian <chrand@mail.dk>
|
inline |
Constructor
References addTags(), commandList(), createBaseVar(), createResources(), UResVarPool::createVarSpace(), handleNewData(), MAX_TAG_LIST_SIZE, name(), poseHist, poseMap, poseUtm, UResBase::setResID(), setResource(), snprint(), tagList, varCallDispOnNewPose, UClientFuncBase::verboseMessages, and ~UResIfVar().
UResIfVar::~UResIfVar | ( | ) |
Destructor
Referenced by UResIfVar().
void UResIfVar::addTags | ( | const char * | tags | ) |
Add tag type to list of handled tag types
References inThisStringList(), MAX_TAG_LIST_SIZE, and tagList.
Referenced by UFunctionIf::createResources(), and UResIfVar().
|
virtual |
Called by the server core when loaded, to get a list of keywords (commands) handled by this plugin. Return a list of handled functions in one string separated by a space (not case sensitive). e.g. return "COG Line". The functions should be unique on the server.
Reimplemented from UClientFuncBase.
References tagList.
Referenced by snprint(), and UResIfVar().
void UResIfVar::createBaseVar | ( | ) |
Create base variables in varPool for this interface type
References UVarPool::addVar(), UVarPool::getRootVarPool(), UVarPool::getStructDeep(), UResVarPool::getVarPool(), varCallDispOnNewPose, and varMaintainDesc.
Referenced by createResources(), and UResIfVar().
|
virtual |
Called by server after this module is integrated into the server core structure, i.e. all core services are in place, but no commands are serviced for this module yet. Create any resources that this modules needs and add these to the resource pool to be integrated in the global variable pool and method sharing. Remember to add to resource pool by a call to addResource(UResBase * newResource, this). This module must also ensure that any resources creted are deleted (in the destructor of this class) Resource shut-down code should be handled in the resource destructor.
Reimplemented from UResBase.
References createBaseVar().
Referenced by UResIfVar().
|
virtual |
Test if all needed resources are loaded. 'missingThese is a buffer where missing resources should be written. 'missingTheseCnt' isthe buffer size not to be resexceeded. Should return true if all resources are available. New data handled by this object has arrived. Starting with this first tag. The function should request all data from line until the corresponding end-tag is received. (no action needed if the tag is a full tag.)
tag | is the tag received |
ifname | is a string with the interface name from which the data was received |
Reimplemented from UClientFuncBase.
References UResPoseHist::getMapPoseID(), UResPoseHist::getOdoPoseID(), UResPoseHist::getUtmPoseID(), handleOther(), handlePoseHist(), handleVar(), USmlTagIn::isTagA(), and UClientFuncBase::msgHandled.
Referenced by UResIfVar().
|
protected |
Handle other data messages and try to add the result as variables
References USmlTag::cnnVerbose(), UVariable::d, USmlTagIn::getNextAttribute(), USmlTag::getNextTag(), USmlTagIn::getTagName(), UResVarPool::getVarPool(), USmlTagIn::isAnEndTag(), USmlTagIn::isAStartTag(), MAX_SML_NAME_LENGTH, MAX_STRUCT_NAMES, MAX_VAR_NAME_SIZE, USmlTagIn::print(), USmlTagIn::reset(), UVarPool::setLocalVar(), and USmlTag::skipToEndTag().
Referenced by handleNewData(), and print().
|
protected |
Handle pose hist relay messages (from a 'posehistpush i=x cmd="posehist pose"')
References UResPoseHist::addIfNeeded(), UResVarPool::callGlobal(), USmlTagIn::getAttValue(), UVariable::getBool(), UResPoseHist::getMapPoseID(), UResPoseHist::getNewestSource(), USmlTag::getNextTag(), UResPoseHist::getOdoPoseID(), USmlTag::getPoseT(), USmlTagIn::getTagName(), UResPoseHist::getUtmPoseID(), UResVarPool::getVarPool(), USmlTagIn::isAnEndTag(), USmlTagIn::isAStartTag(), USmlTagIn::isTagA(), USmlTagIn::isTagAnEnd(), MAX_STRUCT_NAMES, MAX_VAR_NAME_SIZE, name(), poseHist, poseMap, poseUtm, UPoseTVQ::q, USmlTagIn::reset(), USmlTag::skipToEndTag(), varCallDispOnNewPose, and UPoseTVQ::vel.
Referenced by handleNewData(), and print().
|
protected |
Handle standard variable type tags
tag | is the tag with the variable value |
ifname | is the name of the interface from where the tag was received. |
References USmlTagIn::getAttTime(), USmlTagIn::getAttValue(), UVariable::getBool(), UResBase::getCorePointer(), UVarPool::getLocalVariable(), UVarPool::getRootVarPool(), UVarPool::getStructDeep(), USmlTagIn::getTagStart(), UResVarPool::getVarPool(), USmlTagIn::isAnEndTag(), MAX_STRUCT_NAMES, MAX_VAR_NAME_SIZE, UCmdExe::postCommand(), USmlTagIn::print(), USmlTagIn::reset(), UVariable::setDescription(), UVarPool::setLocalVar(), UResBase::var, and varMaintainDesc.
Referenced by handleNewData(), and print().
|
virtual |
Static ID for this resource Called by the server core. Should return the name of function. There should be a first short part separated by a space to some additional info (e.g. version and author). The returned name is intended as informative to clients and should include a version number or compile data
Reimplemented from UClientFuncBase.
Referenced by handlePoseHist(), and UResIfVar().
|
inlinevirtual |
Print status for this resource
Reimplemented from UResVarPool.
References handleOther(), handlePoseHist(), handleVar(), and snprint().
|
virtual |
Called when resource situation has changed.
Reimplemented from UResVarPool.
References UResPoseHist::getMapPoseID(), UResPoseHist::getOdoPoseID(), UResPoseHist::getUtmPoseID(), UResBase::isA(), poseHist, poseMap, poseUtm, and UResVarPool::setResource().
Referenced by UResIfVar().
|
virtual |
Print status for this resource
References commandList(), UVarPool::getMethodCnt(), UVarPool::getMethodMax(), UVarPool::getStructCnt(), UVarPool::getStructMax(), UVarPool::getVarMax(), UResVarPool::getVarPool(), and UVarPool::getVarsCnt().
Referenced by print(), and UResIfVar().
|
staticprivate |
Size of string with tag type names.
Referenced by addTags(), and UResIfVar().
|
protected |
Pointer to pose history plugin, if such is loaded
Referenced by handlePoseHist(), setResource(), and UResIfVar().
|
protected |
Pointer to pose history plugin for map coordinates, if such is loaded
Referenced by handlePoseHist(), setResource(), and UResIfVar().
|
protected |
Pointer to pose history plugin for UTM coordinates, if such is loaded
Referenced by handlePoseHist(), setResource(), and UResIfVar().
|
private |
Tags handled by this function
Referenced by addTags(), commandList(), and UResIfVar().
|
private |
flag for informint possible display function on update
Referenced by createBaseVar(), handlePoseHist(), and UResIfVar().
|
private |
indicate weather description should be maintained when creating a copy of a variable from other sources
Referenced by createBaseVar(), and handleVar().