AURobotServers  4
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
UResVarPool Class Reference

#include <uresvarpool.h>

Inheritance diagram for UResVarPool:
Inheritance graph

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)
 
UVarPooladdStruct (const char *name, const char *comment, bool copy=false)
 
UVariableaddVar (const char *name, const double initialValue, const char *type, const char *comment)
 
UVariableaddVar (const char *name, const char *initialValue, const char *type, const char *comment)
 
UVariableaddVarA (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)
 
UVarCalcgetVarPool ()
 
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 ()
 
UCmdExegetCorePointer ()
 
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
UResBasegetStaticResource (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]
 
UVarCalcvarPool
 

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
 
UReplayreplayParent
 
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...
 

Detailed Description

Shared ressource that adds a variable pool instance

    @author Christian <chrand@mail.dk>

Constructor & Destructor Documentation

UResVarPool::UResVarPool ( )
inline
UResVarPool::~UResVarPool ( )
virtual

Destructor

References varPool.

Referenced by UResVarPool().

Member Function Documentation

int UResVarPool::addMethod ( const char *  formalName,
const char *  paramTypes,
const char *  comment 
)

Add a method to this local var pool.

Parameters
formalNameis the name of the method (max 32 characters, starting with an alpha ...)
paramTypesstring with one char for each parameter d=double, s=string c=class object...)
commentis the help text displayed when the method is listed (on line help)
Returns
-1 if the method could not be added (or exist already), else the index number of the added method.

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).

Parameters
formalNameis the name of the method (max 32 characters, starting with an alpha ...)
paramTypesstring with one char for each parameter d=double, s=string c=class object...)
commentis the help text displayed when the method is listed (on line help)
Returns
-1 if the method could not be added (or exist already), else the index number of the added method.

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.

Parameters
nameis the name of the new variable (less than 30 chars, start with an alfabet char (7-bit) followed by alfanumeric or underscore)
commenta description of the variable, for on-line help
copyshould 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.

Parameters
nameis the name of the new variable (less than 30 chars)
initialValueis the start value of the variable (one element)
typeis variable type, see UVariable::varType (d, s, d3d, d2d, d6d, dq, t, pose, rot, m2)
commenta 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.

Parameters
nameis the name of the new variable (less than 30 chars)
initialValueis 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
typeis variable type, see UVariable::varType (d, s, d3d, d2d, d6d, dq, t, pose, rot, m2)
commenta 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.

UVariable* UResVarPool::addVarA ( const char *  name,
const char *  initialValue,
const char *  type,
const char *  comment 
)
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.

Parameters
nameis the name of the new variable (less than 30 chars)
initialValueis the start value as string e.g. "0.22 0.44 1.2" (array of 3 elements)
typeis variable type, see UVariable::varType (d, s, d3d, d2d, d6d, dq, t, pose, rot, m2)
commenta 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 
)
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.

Parameters
nameis the name of the method, it may adress a sub structure, e.g. aa.bbbb
paramOrderthe 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.
paramsis an array of UVariable pointers. with the actual parameters
returnStructis an array of pointers to a datatype compatible with the UDataBase base type. This array pointer may be NULL.
returnStructCntis 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.
Returns
true if the method exist.

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.

Parameters
functionis full name of function to call.
stringParamis the single string parameter used in the call
Returns
true if function exist (plugin is loaded)

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.

Parameters
functionis full name of function to call.
strParis the single string parameter used in the call
datais the data needed by the call.
coosysis an integer as the last parameter (often coordinate system of the data 0=odo,1=utm,2=map)
Returns
-1 if function does not exist (plugin not loaded), else the return value of the function (integer)

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().

bool UResVarPool::createVarSpace ( const int  varCnt,
const int  structCnt,
const int  methCnt,
const char *  note,
bool  copy = false 
)
virtual
bool UResVarPool::getGlobalString ( const char *  name,
const char **  value 
)

Get global variable (string) value.

Parameters
nameis 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.
valueshould be the adress of a const char pointer.
Returns
true if the variable exist and is a string variable.

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

Parameters
naemname 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().

bool UResVarPool::getGlobalValue ( const char *  name,
const char **  value 
)
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

Parameters
namename of variable that may include a structure, e.g. aaa.b
valuepointer to a double value, where the value of the specified variable is returned if the variable do not exist, then nothing is changed.
Returns
false if the variable do not exist.

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.

Parameters
idxis the index of the first variable, assuming the order x,y,z
Returns
result in a UPosition structure

References UVarPool::getLocalValue3D(), and varPool.

Referenced by getGlobalValue().

UPosRot UResVarPool::getLocalValue6D ( int  idx)

Get 6D position from 6 variables, starting with this index.

Parameters
idxis the index of the first of 6 variables, assuming the order x,y,z,Omage,Phi,Kappa.
Returns
values in a UPosRot structure

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().

int UResVarPool::getLocalValueInt ( int  idx)
inline
UTime UResVarPool::getLocalValueTime ( int  idx)

Get local value as time

References UVarPool::getLocalValueTime(), and varPool.

Referenced by getGlobalValue().

const char* UResVarPool::getLogFileName ( )
inline

Get logfile name

References ULogFile::getLogFileName(), and logVar.

Referenced by UFunctionVarPool::handleVar().

static const char* UResVarPool::getResClassID ( )
inlinestatic
const char * UResVarPool::getVarDescription ( int  idx)

Get description string for the variable with this index

References UVarPool::getVarDescription(), and varPool.

Referenced by getLocalValueInt().

UVarCalc* UResVarPool::getVarPool ( )
inline
bool UResVarPool::gotAllResources ( char *  missingThese,
int  missingTheseCnt 
)
virtual
bool UResVarPool::isLogFileOpen ( )
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

Parameters
lastCntis the last saved count.
newCntis 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().

bool UResVarPool::methodCall ( const char *  name,
const char *  paramOrder,
char **  strings,
const double *  doubles,
double *  value,
UDataBase **  returnStruct = NULL,
int *  returnStructCnt = NULL 
)
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().

const char * UResVarPool::print ( const char *  preString,
char *  buff,
int  buffCnt 
)
virtual
void UResVarPool::setDescription ( const char *  note,
bool  copy = false 
)
protected

Set the description note

Parameters
copyif 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.

Parameters
nameis the name of the variable and may be a substructure, e.g. aa.bb.cc.d
valueis the double value that should be assigned to the variable.
mayAddIf '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.
Returns
true if modified or added.

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

Parameters
idxis the index to the variable in this var pool
valueis double value to be assigned
elementis 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.

Parameters
nameis the name of the variable and may be a substructure, e.g. aa.bb.cc.d
valueis the double value that should be assigned to the variable.
mayAddIf '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.
Returns
true if modified or added.

References UVariable::d, UVarPool::setLocalVar(), and varPool.

bool UResVarPool::setLocalVar3D ( int  idx,
UPosition value 
)

Set 3D position to this variables.

Parameters
idxis the index of the variable, index order x,y,z
valuea position with x,y,z
Returns
true if set

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.

Parameters
idxis the index of the first of 6 variables, assuming the order x,y,z,Omage,Phi,Kappa.
valuethe 6D value (x,y,z,o,p,k)
Returns
true if there is 6 values with an index above idx (no name check)

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

Parameters
idxis the index to the variable in this var pool
valueis double value to be added
elementis the array index if variable is an array

References UVarPool::setLocalVarAdd(), and varPool.

Referenced by getLocalValueInt().

bool UResVarPool::setLocalVarPose ( int  idx,
UPose value 
)
inline

Set pose in this variable.

Parameters
idxis the index of the variable, index order x,y,h
valuea position with x,y,h
Returns
true if set

References getLocalValue6D(), UPose::h, setLocalVar3D(), setLocalVar6D(), UPose::x, and UPose::y.

bool UResVarPool::setResource ( UResBase resource,
bool  remove 
)
virtual
void UResVarPool::setVarPool ( UVarCalc sharedVarPool)
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.

Parameters
structIdxto test - ine structure is tested at at time, in order not to load main thread too much.
Returns
next structure to test.

References UVarPool::getLocalVar(), UVarPool::getStruct(), UVarPool::getVarsCnt(), UVariable::updateQtTest(), UResBase::var, varFastestUpdateTime, and varPool.

Referenced by isLogFileOpen(), UCmdExe::run(), and updateQTvars().

void UResVarPool::updateQTvars ( UVarPool vp)
private

Function to recursively call the QT update for variables left out in routine update call.

Parameters
vpis varpool to test (and all its sub-structures.

References UVarPool::getLocalVar(), UVarPool::getStruct(), UVarPool::getStructCnt(), UVarPool::getVarsCnt(), UVariable::updateQtTest(), updateQTvars(), UResBase::var, and varFastestUpdateTime.

Member Data Documentation

ULogFile UResVarPool::logVar
private

Logfile for variable updates

Referenced by getLogFileName(), isLogFileOpen(), logFileClose(), logFileOpen(), logFileStart(), and UResVarPool().

ULock UResVarPool::logVarLock
private

Filename for logfile Resource lock for variable logfile

Referenced by logFileClose(), logFileOpen(), and logFileStart().

const int UResVarPool::MAX_NOTE_SIZE = 100
staticprivate

Size of not string

Referenced by UResVarPool().

char UResVarPool::note[MAX_NOTE_SIZE]
private

Note string

Referenced by getResClassID(), UFunctionBase::setName(), and UResVarPool().

UVarCalc* UResVarPool::varPool
private

The documentation for this class was generated from the following files: