AURobotServers
4
|
#include <uresvarpool.h>
Public Member Functions | |
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) |
virtual const char * | print (const char *preString, char *buff, int buffCnt) |
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) |
virtual bool | setResource (UResBase *resource, bool remove) |
void | setVarPool (UVarCalc *sharedVarPool) |
int | updateQTvars (int structIdx) |
UResVarPool () | |
virtual | ~UResVarPool () |
Public Member Functions inherited from UResBase | |
void | createReplayVar (UVarPool *pool) |
virtual void | createResources () |
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 () |
Static Public Member Functions | |
static const char * | getResClassID () |
Protected Member Functions | |
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... | |
Private Member Functions | |
void | updateQTvars (UVarPool *vp) |
Private Attributes | |
ULogFile | logVar |
ULock | logVarLock |
char | note [MAX_NOTE_SIZE] |
UVarCalc * | varPool |
Static Private Attributes | |
static const int | MAX_NOTE_SIZE = 100 |
Additional Inherited Members | |
Public Attributes inherited from UReplay | |
bool | replayTimeAdvancePending |
UTime | replayTimeNow |
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 |
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... | |
Shared ressource that adds a variable pool instance
@author Christian <chrand@mail.dk>
|
inline |
Constructor
References appName, createVarSpace(), getResClassID(), UResBase::getResID(), logVar, MAX_NOTE_SIZE, note, ULogFile::setLogName(), UResBase::setResID(), varPool, and ~UResVarPool().
Referenced by UFunctionVarPool::createResources().
|
virtual |
int UResVarPool::addMethod | ( | const char * | formalName, |
const char * | paramTypes, | ||
const char * | comment | ||
) |
Add a method to this local var pool.
formalName | is the name of the method (max 32 characters, starting with an alpha ...) |
paramTypes | string with one char for each parameter d=double, s=string c=class object...) |
comment | is the help text displayed when the method is listed (on line help) |
References UVarPool::addMethod(), and varPool.
Referenced by addVarA(), UResCamIfPath::createBaseVar(), UResLaserIfObst::createBaseVar(), UFuncView::createBaseVar(), UResDummy::createBaseVar(), UResPoseHist::createBaseVar(), UResMapObst::createBaseVar(), UResSmrCtl::createBaseVar(), UResLobst::createBaseVar(), UResDrivePos::createBaseVar(), UResRoadDrive::createBaseVar(), UResIf::createBaseVar(), UResAvoid::createBaseVar(), UResSmrIf::createBaseVar(), UResLocater::createBaseVar(), UCmdExe::createBaseVar(), UFuncKinect::createResources(), and UFuncPpl::UFuncPpl().
int UResVarPool::addMethodV | ( | const char * | formalName, |
const char * | paramTypes, | ||
const char * | comment | ||
) |
Add a method to this local var pool (implemented using UVariable parameters).
formalName | is the name of the method (max 32 characters, starting with an alpha ...) |
paramTypes | string with one char for each parameter d=double, s=string c=class object...) |
comment | is the help text displayed when the method is listed (on line help) |
References UVarPool::addMethodV(), and varPool.
Referenced by UResObstacle::addObstacleParameters(), addVarA(), UResMapObst::createBaseVar(), and UResAvoid::createBaseVar().
UVarPool * UResVarPool::addStruct | ( | const char * | name, |
const char * | comment, | ||
bool | copy = false |
||
) |
Add a structure to the variable pool of this resource. The structure is a var-pool in its own right, and may hold variables, structures and methods. The comment is the online help for this variable.
name | is the name of the new variable (less than 30 chars, start with an alfabet char (7-bit) followed by alfanumeric or underscore) |
comment | a description of the variable, for on-line help |
copy | should comment be copied, or is it a static string, that is available after return of function. pointer to new structure (may be an existing with same name, or NULL if failed) |
References UVarPool::addStructLocal(), and varPool.
Referenced by ULaserPool::addDevice(), addVarA(), UResAvoid::createBaseVar(), UCamPool::findDevices(), UImagePool::getImage(), UCamPool::makeDevice(), and UCmdExe::sysModuleCmd().
UVariable * UResVarPool::addVar | ( | const char * | name, |
const double | initialValue, | ||
const char * | type, | ||
const char * | comment | ||
) |
Add a symbol to to the symbol stack of type double. The comment is the online help for this variable.
name | is the name of the new variable (less than 30 chars) |
initialValue | is the start value of the variable (one element) |
type | is variable type, see UVariable::varType (d, s, d3d, d2d, d6d, dq, t, pose, rot, m2) |
comment | a description of the variable, for on-line help the new variable (may be an existing with same name, or NULL if failed) |
References UVarPool::addVar(), and varPool.
Referenced by UResObstacle::addObstacleParameters(), UResPassable::addPassableIntervalParameters(), addVarA(), UResCamIfPath::createBaseVar(), UResCamIfGmk::createBaseVar(), UResLaserIfObst::createBaseVar(), UFuncBallKL::createBaseVar(), UFuncView::createBaseVar(), UResRoseBot::createBaseVar(), UResBin::createBaseVar(), UResDummy::createBaseVar(), UFuncPCLTest::createBaseVar(), UResPoseHist::createBaseVar(), UFuncPlan::createBaseVar(), UResMapObst::createBaseVar(), UResSmrCtl::createBaseVar(), UFuncImgPoly::createBaseVar(), UResLobst::createBaseVar(), UImagePool::createBaseVar(), UResAuEf::createBaseVar(), UResRhdIf::createBaseVar(), UResLaserIfScan::createBaseVar(), UResDrivePos::createBaseVar(), UResRoadDrive::createBaseVar(), UResV360::createBaseVar(), UResIf::createBaseVar(), UCamPool::createBaseVar(), ULaserPool::createBaseVar(), UResAvoid::createBaseVar(), UFuncV4lGst::createBaseVar(), UFuncLocalize::createBaseVar(), UResSmrIf::createBaseVar(), UFuncLoca2::createBaseVar(), UResLocater::createBaseVar(), UCmdExe::createBaseVar(), UFuncPiPi::createBaseVar(), UFuncCropRow::createBaseVar(), UFuncBall::createBaseVar(), UResRuleState::createBaseVar(), UFuncBall_improved::createBaseVar(), UFuncFz::createBaseVar(), UFuncImSeg::createBaseVar(), UFuncLinefinder::createBaseVar(), UFuncStraightLine::createBaseVar(), UFuncImu::createResources(), UFuncStereo::createResources(), UFunctionCamGmk::createResources(), UFuncPiCam::createResources(), UFuncKinect::createResources(), UFuncPTgrey::createResources(), UFuncTOF::createResources(), getResClassID(), UResRhdIf::run(), and UFuncPpl::UFuncPpl().
UVariable * UResVarPool::addVar | ( | const char * | name, |
const char * | initialValue, | ||
const char * | type, | ||
const char * | comment | ||
) |
Add an array symbol to to the symbol stack with an initial value from space separated value list. the value vector may be a single value, a vector of values or a matrix. The comment is the online help for this variable.
name | is the name of the new variable (less than 30 chars) |
initialValue | is the start value as string e.g. "0.22 0.44 1.2" array of 3 elements or "1 2; 3 4" a 2x2 matrix |
type | is variable type, see UVariable::varType (d, s, d3d, d2d, d6d, dq, t, pose, rot, m2) |
comment | a description of the variable, for on-line help the new variable (may be an existing with same name, or NULL if failed) |
References UVarPool::addVarA(), and varPool.
|
inline |
Add an array symbol to to the symbol stack with an initial value from space separated value list. The comment is the online help for this variable. The same function as addVar(...) but to make naming the same as when adding a structo to UVarPool.
name | is the name of the new variable (less than 30 chars) |
initialValue | is the start value as string e.g. "0.22 0.44 1.2" (array of 3 elements) |
type | is variable type, see UVariable::varType (d, s, d3d, d2d, d6d, dq, t, pose, rot, m2) |
comment | a description of the variable, for on-line help the new variable (may be an existing with same name, or NULL if failed) |
References addMethod(), addMethodV(), addStruct(), addVar(), createBaseVar(), gotAllResources(), and setResource().
Referenced by UFuncView::createBaseVar(), UImagePool::createBaseVar(), UFuncRadar::createBaseVar(), UResIf::createBaseVar(), UFuncV4lGst::createBaseVar(), UFuncLoca2::createBaseVar(), UCmdExe::createBaseVar(), UFuncImSeg::createBaseVar(), UFuncStereo::createResources(), UFuncPiCam::createResources(), UFuncKinect::createResources(), and UFuncPTgrey::createResources().
bool UResVarPool::callGlobal | ( | const char * | name, |
const char * | paramOrder, | ||
char ** | strings, | ||
const double * | doubles, | ||
double * | value, | ||
UDataBase ** | returnStruct, | ||
int * | returnStructCnt | ||
) |
Make a call to a method in the global var-pool tree
References UVarPool::callGlobal(), and varPool.
Referenced by UResDrivePos::driveOdo(), UResRoadDrive::driveSide(), UResRoadDrive::findExitPose(), UResAvoid::findPathToHere(), UResCamIfImg::getImageBuffer(), UFuncPCLTest::GetKinectPointCloudData(), UFuncTracking::GetKinectPointCloudDataRGB(), UFuncPCLTest::GetKinectPointCloudDataXYZRGB(), getLocalValueInt(), UResCamIfCam::gotNewData(), UResLaserIfScan::gotNewData(), UResCamIfImg::gotNewImage(), UResIfVar::handlePoseHist(), UFunctionVarPool::makeAMethodCall(), UResLaserIfObst::newDataAvailable(), UResCamIfGmk::newDataAvailable(), and UResLaserIfSf::newDataAvailable().
bool UResVarPool::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.
name | is the name of the method, it may adress a sub structure, e.g. aa.bbbb |
paramOrder | the specific parameter order as a string, e.g "scd" for three parameters the first 's' for string the second is a 'c' for class (eg a pose), and the last 'd's for double. |
params | is an array of UVariable pointers. with the actual parameters |
returnStruct | is an array of pointers to a datatype compatible with the UDataBase base type. This array pointer may be NULL. |
returnStructCnt | is a pointer to the number of entries in the returnStruct array. When the function returns this number will be modified to the actual number of values returned. |
References UVarPool::callScopeV(), and varPool.
Referenced by callVS(), callVSCD(), UResAvoid::copyAvoidObstacles(), UResAvoid::copyCellPolys(), UResAvoid::copyFootprintPolys(), UFuncPpl::drawPolygons(), UResRoseBot::findRows(), getLocalValueInt(), UFuncPpl::handleCommand(), UFuncLoca2::handleLocalize(), UFunctionVarPool::makeAMethodCall(), UFuncKinect::makeObj3Dcloud(), UFuncPpl::methodCall(), UFunctionPassable::polygonToPolyPlugin(), UResLocater::polygonToPolyPlugin(), UFuncStraightLine::polygonToPolyPlugin(), UResRoseBot::sendToPolyPlugin(), UFuncKinect::setPointCloudUpdated(), UFuncLobst::testMethodCall(), and UResObstacle::updateMappedObstacles().
bool UResVarPool::callLocal | ( | const char * | name, |
const char * | paramOrder, | ||
char ** | strings, | ||
const double * | doubles, | ||
double * | value, | ||
UDataBase ** | returnStruct, | ||
int * | returnStructCnt | ||
) |
Make a call to a method in this or any sub-structure var-pool
References UVarPool::callLocal(), and varPool.
Referenced by getLocalValueInt().
bool UResVarPool::callVS | ( | const char * | function, |
const char * | stringParam | ||
) |
Call other plugin with a single string parameter.
function | is full name of function to call. |
stringParam | is the single string parameter used in the call |
References callGlobalV(), and UVariable::setValues().
Referenced by getLocalValueInt(), and UFuncPlan::handleResetPlan().
int UResVarPool::callVSCD | ( | const char * | function, |
const char * | strPar, | ||
UDataBase * | data, | ||
int | cooSys | ||
) |
Call other plugin with a string, data-struct and integer parameter.
function | is full name of function to call. |
strPar | is the single string parameter used in the call |
data | is the data needed by the call. |
coosys | is an integer as the last parameter (often coordinate system of the data 0=odo,1=utm,2=map) |
References callGlobalV(), UVariable::setInt(), and UVariable::setValues().
Referenced by getLocalValueInt(), UFuncPlan::handleAddCon(), UFuncPlan::handleAddPoint(), UFuncPlan::handleFindRoute(), and UFuncPlan::handleGetPoint().
void UResVarPool::createBaseVar | ( | ) |
Create the basic variables needed by the var pool
Referenced by addVarA(), and UFunctionImgPool::createResources().
|
virtual |
Create space in var pool. This instance creates a variable pool with this initial pool size, it is expanded if more variables, structs or methods are added. A not may be added to the created structure as a description of this var pool. Returns true if space is created.
References UVarPool::createVarSpace(), and varPool.
Referenced by UResPassable::addPassableIntervalParameters(), getResClassID(), UCmdExe::UCmdExeInit(), UResAvoid::UResAvoidInit(), UResCamIf::UResCamIf(), UResCamIfCam::UResCamIfCam(), UResCamIfGmk::UResCamIfGmk(), UResCamIfImg::UResCamIfImg(), UResCamIfPath::UResCamIfPath(), UResDrivePos::UResDrivePos(), UResIf::UResIf(), UResIfVar::UResIfVar(), UResLaserIf::UResLaserIf(), UResLaserIfObst::UResLaserIfObst(), UResLaserIfSf::UResLaserIfSf(), UResRoadDrive::UResRoadDrive(), UResSmrCtl::UResSmrCtlInit(), UResSmrIf::UResSmrIfInit(), and UResVarPool().
bool UResVarPool::getGlobalString | ( | const char * | name, |
const char ** | value | ||
) |
Get global variable (string) value.
name | is the global name of the variable, this may have an index, i.e. core.servername[2], the returned string pointer then points to the third character in the servername. |
value | should be the adress of a const char pointer. |
References UVarPool::getGlobalString(), and varPool.
Referenced by getGlobalValue(), and setVarPool().
bool UResVarPool::getGlobalValue | ( | const char * | name, |
double * | value | ||
) |
Get a (double) value relative to the global variable tree pool
naem | name of variable, may contain . and index, like in 'svs.pos[2]' |
References UVarPool::getGlobalValue(), and varPool.
Referenced by UFunctionIf::createResources(), UResDrivePos::driveOdo(), UResRoadDrive::driveSide(), UResAvoid::findPathToHere(), UFuncTracking::FirstImage(), getGlobalValue(), UFuncVarMrc::handleCommand(), and setVarPool().
|
inline |
bool UResVarPool::getGlobalValue | ( | const char * | name, |
bool * | value | ||
) |
Get a (bool) value relative to the global variable tree
References UVarPool::getGlobalValue(), and varPool.
bool UResVarPool::getGlobalValue | ( | const char * | name, |
UTime * | value | ||
) |
Get a time value with this name relative to the global variable tree
References UVarPool::getGlobalValue(), and varPool.
bool UResVarPool::getLocalValue | ( | const char * | name, |
double * | value | ||
) |
get a value in this variable tree
name | name of variable that may include a structure, e.g. aaa.b |
value | pointer to a double value, where the value of the specified variable is returned if the variable do not exist, then nothing is changed. |
References UVarPool::getLocalValue(), and varPool.
Referenced by UResSmrIf::eventWatchFired(), getGlobalValue(), getLocalValueInt(), UResDummy::methodCall(), and UResSmrIf::sendAddWatch().
bool UResVarPool::getLocalValue | ( | const char * | name, |
bool * | value | ||
) |
Get a (bool) value relative to this variable tree
References UVarPool::getLocalValue(), and varPool.
bool UResVarPool::getLocalValue | ( | const char * | name, |
UTime * | value | ||
) |
Get a time value with this name relative to this variable tree
References UVarPool::getLocalValue(), and varPool.
double UResVarPool::getLocalValue | ( | int | idx | ) |
Get the value of this variable (default if no var-pool structure is available is 0.0.
References UVarPool::getLocalValue(), and varPool.
UPosition UResVarPool::getLocalValue3D | ( | int | idx | ) |
Get 3D position from 3 variables, starting with this index.
idx | is the index of the first variable, assuming the order x,y,z |
References UVarPool::getLocalValue3D(), and varPool.
Referenced by getGlobalValue().
UPosRot UResVarPool::getLocalValue6D | ( | int | idx | ) |
Get 6D position from 6 variables, starting with this index.
idx | is the index of the first of 6 variables, assuming the order x,y,z,Omage,Phi,Kappa. |
References UVarPool::getLocalValue6D(), and varPool.
Referenced by setLocalVarPose().
bool UResVarPool::getLocalValueBool | ( | int | idx | ) |
Get the boolean value of this variable (default if no var-pool structure is available is fale.
References UVarPool::getLocalValueBool(), and varPool.
Referenced by getGlobalValue().
|
inline |
Get integer value of local variable with this index
References callGlobal(), callGlobalV(), callLocal(), callVS(), callVSCD(), data, getLocalValue(), getVarDescription(), logFileClose(), logFileOpen(), logFileStart(), methodCall(), roundi(), setGlobalVar(), setLocalVar(), and setLocalVarAdd().
UTime UResVarPool::getLocalValueTime | ( | int | idx | ) |
Get local value as time
References UVarPool::getLocalValueTime(), and varPool.
Referenced by getGlobalValue().
|
inline |
Get logfile name
References ULogFile::getLogFileName(), and logVar.
Referenced by UFunctionVarPool::handleVar().
|
inlinestatic |
Resource ID for this class
References addVar(), createVarSpace(), note, and print().
Referenced by UResDisp::gotAllResources(), UFunctionVarPool::setResource(), UNavPaint::setResource(), UResAvoid::setResource(), UNavView::setResource(), UServerPush::setResource(), UResRuleState::setResource(), and UResVarPool().
const char * UResVarPool::getVarDescription | ( | int | idx | ) |
Get description string for the variable with this index
References UVarPool::getVarDescription(), and varPool.
Referenced by getLocalValueInt().
|
inline |
Get the resource var pool
References varPool.
Referenced by UResPassable::addPassableIntervalParameters(), UResCamIf::connectionChange(), UResLaserIf::connectionChange(), UResSmrIf::connectionChange(), UResCamIfCam::createBaseVar(), UResCamIfGmk::createBaseVar(), UResCamIfImg::createBaseVar(), UResCamIf::createBaseVar(), UResBin::createBaseVar(), UResLaserIfSf::createBaseVar(), UResIfVar::createBaseVar(), UResLaserIf::createBaseVar(), UResRhdIf::createBaseVar(), UCamPool::createBaseVar(), UResDrivePos::driveOdo(), UResRoadDrive::driveSide(), UCamPool::findDevices(), UResRoadDrive::findExitPose(), UResAvoid::findPathToHere(), UFuncTracking::FirstImage(), UResCamIfCam::gotNewData(), UFunctionDrivePos::handleDrivePos(), UFunctionCamGmk::handleGmkGetCommand(), UFunctionIf::handleIf(), UFunctionLaserIfScan::handleLaserIf(), UCmdExe::handleOneServerPushMessage(), UResIfVar::handleOther(), UResIfVar::handlePoseHist(), UFunctionVarPool::handleVar(), UResIfVar::handleVar(), UFunctionVarPool::handleVarPush(), UCamPool::makeDevice(), UNavPaint::paintVarAdd(), UFuncImu::run(), UFunctionVarPool::setResource(), UResRoadDrive::setTarget(), UResIfVar::snprint(), UCmdExe::sysModuleCmd(), UFuncTracking::TrackObjects(), UQtgui::updateVar(), and UServerPort::updateVars().
|
virtual |
Is this resource missing any base ressources
Reimplemented from UResBase.
Reimplemented in UFunctionBase, UResNavIfMan, UCamPool, UResDisp, UResLaserIfRoad, ULaserPool, UImagePool, UResLaserIfScan, UResDrivePos, UResRoadDrive, UResCamIf, UResPoseHist, UResCamIfImg, and UResV360.
References UCmdExe::getResClassID(), UResBase::gotAllResources(), UServerPush::gotCmdExe(), and varPool.
Referenced by addVarA(), UResCamIfImg::gotAllResources(), UResCamIf::gotAllResources(), UResLaserIfScan::gotAllResources(), UResDisp::gotAllResources(), and UResNavIfMan::gotAllResources().
|
inline |
Is logfile open - the file itself, not for one specific structure
References ULogFile::isOpen(), isVarPoolUpdated(), logVar, setDescription(), and updateQTvars().
Referenced by UFunctionVarPool::handleVar().
bool UResVarPool::isLogFileOpen | ( | const char * | structName | ) |
Is logfile open for this specific structure specific structure (empty string meens root).
References UVarPool::getStructDeep(), UVarPool::isLogfileOpen(), and varPool.
bool UResVarPool::isVarPoolUpdated | ( | int | lastCnt, |
int * | newCnt | ||
) |
test if the any variable in the local var pool (not sub-structures) is updated since last check
lastCnt | is the last saved count. |
newCnt | is where the new count is saved (if not NULL) returns true if the update count (updateCnt) is different from lastCnt |
References UServerPush::isUpdated(), and varPool.
Referenced by isLogFileOpen(), and UCmdExe::run().
void UResVarPool::logFileClose | ( | ) |
Close logfile for variable modifications
References ULogFile::closeLog(), ULock::lock(), logVar, logVarLock, and ULock::unlock().
Referenced by getLocalValueInt(), and UFunctionVarPool::handleVar().
bool UResVarPool::logFileOpen | ( | ) |
Open logfile with default name (appName).var.log in the dataPath
References ULogFile::isOpen(), ULock::lock(), logVar, logVarLock, ULogFile::openLog(), and ULock::unlock().
Referenced by getLocalValueInt(), and UFunctionVarPool::handleVar().
void UResVarPool::logFileStart | ( | const char * | structName, |
bool | open | ||
) |
Set logging of this structure. The structure may be empty to set logging for this variable pool. If 'open' is false, then logging is stopped.
References UVarPool::getStructDeep(), logVar, logVarLock, UVarPool::setLogfile(), and varPool.
Referenced by getLocalValueInt(), and UFunctionVarPool::handleVar().
|
virtual |
Function to implement a var-pool method call. The function with 'name' and pameters in the order 'paramOrder' is to be called. The actual parameters are in 'strings' and 'doubles'. A double sized result may be returned in 'value'. May return struct values in the 'returnStruct' pointer list (when the pointer list is not NULL), and in this case the 'returnStructCnt' is set to the maximum number of pointers available and should be modified to the number of valid pointers returned. Should return true if function was handled (otherwise an invalid function specification is assumed).
Reimplemented from UVarMethodImplement.
Reimplemented in UCmdExe, UResPoseHist, UResKeep, UResPoly, UResLocater, UResSmrIf, UResDisp, UResCron, UResLaserIfRoad, UResAvoid, UResLaserIf, UResDrivePos, UResCamIf, UResRoadDrive, UResPcp, UFuncKinect, UResLaserIfObst, UResIf, UResSmrCtl, UFuncPpl, UFuncView, UFuncPiCam, UResDummy, and UResMapObst.
References UVarPool::getPreName(), and varPool.
Referenced by getLocalValueInt().
|
virtual |
Print status for this resource
Reimplemented from UResBase.
Reimplemented in UResRuleState, UResGps, UResObj3d, UResKeep, UResPoseHist, UResNavIfMan, UResRule, UResPoly, UResDisp, UResCron, UResLaserIfRoad, ULaserPool, UResIfVar, UCamPool, UFunctionAvoid, UFunctionRoadDrive, UFunctionPassable, UImagePool, UFunctionIf, UFunctionLaserIfData, UFunctionLaserIfScan, UResSmrIf, UFunctionDrivePos, UResLaserIfScan, UResPcp, UResRoadLine, UFunctionSmrIf, UResDrivePos, UFuncRule, UResLaserIf, UResRoadDrive, UResV360, UResCamIf, UResAuEf, UResAvoid, UFunctionLocater, UResCamIfImg, UResPassable, UResLaserIfObst, UResSmrCtl, UResCamIfGmk, UResObstacle, UResCamIfPath, UResCamIfCam, UResIf, and UResMapObst.
References bool2str(), UVarPool::getMethodCnt(), UVarPool::getMethodMax(), UVarPool::getPreName(), UVarPool::getStruct(), UVarPool::getStructCnt(), UVarPool::getStructMax(), UVarPool::getVarMax(), UVarPool::getVarsCnt(), UVarPool::isVarPoolVerbose(), and varPool.
Referenced by getResClassID().
|
protected |
Set the description note
copy | if note is not static, then copy should be set to true. |
References UVarPool::setDescription(), and varPool.
Referenced by UImagePool::createBaseVar(), isLogFileOpen(), UFunctionBase::setCommand(), UResPoseHist::setResID(), ULaserPool::ULaserPool(), UResDummy::UResDummy(), UResLocater::UResLocater(), and UResRoseBot::UResRoseBot().
bool UResVarPool::setGlobalVar | ( | const char * | name, |
const double | value, | ||
bool | mayAdd | ||
) |
Assigns a value to a variable. The variable may be a part of a structure.
name | is the name of the variable and may be a substructure, e.g. aa.bb.cc.d |
value | is the double value that should be assigned to the variable. |
mayAdd | If 'mayAdd' is true, then the variable is added if not found. And if the structure (any of the sspecified structures) is missing, then this is added too. |
References UVarPool::setGlobalVar(), and varPool.
Referenced by getLocalValueInt(), and UResLobst::makeObst().
bool UResVarPool::setLocalVar | ( | int | idx, |
double | value, | ||
const int | element | ||
) |
Set the value of this variable from index
idx | is the index to the variable in this var pool |
value | is double value to be assigned |
element | is the array index if variable is an array |
References UVarPool::setLocalVar(), and varPool.
Referenced by UResSmrIf::eventWatchFired(), getLocalValueInt(), UResDummy::methodCall(), UResSmrIf::sendAddWatch(), and setResource().
bool UResVarPool::setLocalVar | ( | const char * | name, |
const double | value, | ||
bool | mayAdd | ||
) |
Assigns a value to a variable. The variable may be a part of a structure.
name | is the name of the variable and may be a substructure, e.g. aa.bb.cc.d |
value | is the double value that should be assigned to the variable. |
mayAdd | If 'mayAdd' is true, then the variable is added if not found. And if the structure (any of the sspecified structures) is missing, then this is added too. |
References UVariable::d, UVarPool::setLocalVar(), and varPool.
bool UResVarPool::setLocalVar3D | ( | int | idx, |
UPosition * | value | ||
) |
Set 3D position to this variables.
idx | is the index of the variable, index order x,y,z |
value | a position with x,y,z |
References UVarPool::setLocalVar3D(), and varPool.
Referenced by getGlobalValue(), and setLocalVarPose().
bool UResVarPool::setLocalVar6D | ( | int | idx, |
UPosRot * | value | ||
) |
Set 6D position to 6 consecutive variables starting with this index.
idx | is the index of the first of 6 variables, assuming the order x,y,z,Omage,Phi,Kappa. |
value | the 6D value (x,y,z,o,p,k) |
References UVarPool::setLocalVar6D(), and varPool.
Referenced by setLocalVarPose().
bool UResVarPool::setLocalVarAdd | ( | int | idx, |
double | value, | ||
const int | element | ||
) |
Add the value of this variable from index
idx | is the index to the variable in this var pool |
value | is double value to be added |
element | is the array index if variable is an array |
References UVarPool::setLocalVarAdd(), and varPool.
Referenced by getLocalValueInt().
|
inline |
Set pose in this variable.
idx | is the index of the variable, index order x,y,h |
value | a position with x,y,h |
References getLocalValue6D(), UPose::h, setLocalVar3D(), setLocalVar6D(), UPose::x, and UPose::y.
|
virtual |
Set ressource as needed (probably not used by this resource)
Reimplemented from UResBase.
Reimplemented in UResRuleState, UFuncLaserBox, UResGps, UResNavIfMan, UCamPool, UResDisp, UResLaserIfRoad, UResSmrIf, UFuncLocalize, UImagePool, UResLaserIfScan, UResIfVar, UResLaserIf, UResCamIf, UResDrivePos, UFunctionPassable, UResRoadDrive, UResAvoid, UFunctionBase, UResCamIfImg, UResPoseHist, UFunctionLaserIfData, UFunctionLaserIfScan, UFuncView, UResSmrCtl, ULaserPool, UFuncLoca2, UResIf, UResLaserIfSf, UResV360, UFunctionPoseHist, UFuncPlugBasePush, UFunctionCamData, UFunctionImgBase, UFunctionVarPool, UFunctionCamBase, and UFunctionLaser.
References UResBase::getResVersion(), setLocalVar(), UResBase::setResource(), and varPool.
Referenced by addVarA(), UResIf::setResource(), UResLaserIfSf::setResource(), UResSmrCtl::setResource(), UResCamIfImg::setResource(), UResAvoid::setResource(), UResRoadDrive::setResource(), UResDrivePos::setResource(), UResCamIf::setResource(), UResLaserIf::setResource(), UResIfVar::setResource(), UResLaserIfScan::setResource(), UResSmrIf::setResource(), UResLaserIfRoad::setResource(), UResNavIfMan::setResource(), UResGps::setResource(), UResRuleState::setResource(), and UCmdExe::UCmdExeInit().
|
inline |
Set an external var pool. This is not the usual way to get a var-pool, but can be used to share a var pool with another resource (as the sequencer do).
References getGlobalString(), getGlobalValue(), and varPool.
int UResVarPool::updateQTvars | ( | int | structIdx | ) |
Iterate a var pool structure and all its substructures for variables that are updated, but not yet send to the QT GUI part for twict the normal update time.
structIdx | to test - ine structure is tested at at time, in order not to load main thread too much. |
References UVarPool::getLocalVar(), UVarPool::getStruct(), UVarPool::getVarsCnt(), UVariable::updateQtTest(), UResBase::var, varFastestUpdateTime, and varPool.
Referenced by isLogFileOpen(), UCmdExe::run(), and updateQTvars().
|
private |
Function to recursively call the QT update for variables left out in routine update call.
vp | is varpool to test (and all its sub-structures. |
References UVarPool::getLocalVar(), UVarPool::getStruct(), UVarPool::getStructCnt(), UVarPool::getVarsCnt(), UVariable::updateQtTest(), updateQTvars(), UResBase::var, and varFastestUpdateTime.
|
private |
Logfile for variable updates
Referenced by getLogFileName(), isLogFileOpen(), logFileClose(), logFileOpen(), logFileStart(), and UResVarPool().
|
private |
Filename for logfile Resource lock for variable logfile
Referenced by logFileClose(), logFileOpen(), and logFileStart().
|
staticprivate |
Size of not string
Referenced by UResVarPool().
|
private |
Note string
Referenced by getResClassID(), UFunctionBase::setName(), and UResVarPool().
|
private |
The structure that actually holds the variables and possibly sub-structures and methosds
Referenced by addMethod(), addMethodV(), addStruct(), addVar(), callGlobal(), callGlobalV(), callLocal(), createVarSpace(), getGlobalString(), getGlobalValue(), getLocalValue(), getLocalValue3D(), getLocalValue6D(), getLocalValueBool(), getLocalValueTime(), getVarDescription(), getVarPool(), gotAllResources(), isLogFileOpen(), isVarPoolUpdated(), logFileStart(), methodCall(), print(), setDescription(), setGlobalVar(), setLocalVar(), setLocalVar3D(), setLocalVar6D(), setLocalVarAdd(), setResource(), setVarPool(), updateQTvars(), UResVarPool(), and ~UResVarPool().