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

#include <ufunctionbase.h>

Inheritance diagram for UFunctionBase:
Inheritance graph

Public Member Functions

bool addResource (UResBase *resource, UFunctionBase *owner)
 
void closeLogfile ()
 
virtual const char * commandList ()
 
virtual void createResources ()
 
const char * getAliasName ()
 
const char * getLoadedFileName ()
 
void * getLoadedModuleRef ()
 
virtual bool gotAllResources (char *missingThese, int missingTheseCnt)
 
bool isMine (const char *cmdName)
 
bool isStatic ()
 is the module loaded as static A module is static if the ldFilename has a length of zero. More...
 
virtual const char * name ()
 
bool newCmd (UServerInMsg *newMsg, UDataBase *extra)
 
bool newCommand (UServerInMsg *newMsg, void *extra)
 
bool openLogfile (const char *name)
 
void print (const char *preString)
 
virtual void resourceUpdated ()
 
bool sendEndTag (UServerInMsg *msg)
 
bool sendEndTag ()
 
bool sendFullTag (const char *attributes)
 
bool sendHelpDone (UServerInMsg *msg)
 
bool sendHelpDone ()
 
bool sendHelpStart (UServerInMsg *msg, const char *subject)
 
bool sendHelpStart (const char *subject)
 
bool sendHelpStart ()
 
bool sendMsg (UServerInMsg *msg, const char *message, int size)
 
bool sendMsg (const char *message)
 
bool sendMsg (UServerInMsg *msg, const char *message)
 
bool sendMsg (int clientIdx, const char *message, int size)
 
bool sendMsgInt (int clientIdx, const char *message)
 
bool sendStartTag (const char *attributes)
 
bool sendText (UServerInMsg *msg, const char *text)
 
bool sendText (const char *text)
 
virtual void setAliasName (const char *name)
 
virtual void setCommand (const char *cmdList, const char *name, const char *note)
 
void setLoadedModuleRef (void *module, const char *moduleFileName)
 
virtual void setLoadTime (UTime)
 
void setName (const char *name)
 
virtual bool setResource (UResBase *resource, bool remove)
 
void setVerbose (bool value)
 
 UFunctionBase ()
 
virtual ~UFunctionBase ()
 
- Public Member Functions inherited from UCallBack
bool addOnEvent (UOnEvent *dataObject)
 
virtual bool onEvent (const char *interface, const char *dataType, void *data)
 
 UCallBack ()
 
virtual ~UCallBack ()
 
- 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)
 
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 ()
 
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)
 
void setVarPool (UVarCalc *sharedVarPool)
 
int updateQTvars (int structIdx)
 
 UResVarPool ()
 
virtual ~UResVarPool ()
 
- Public Member Functions inherited from UResBase
void createReplayVar (UVarPool *pool)
 
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 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 ()
 

Public Attributes

bool silent
 is reply to client and console to be limited More...
 
- Public Attributes inherited from UReplay
bool replayTimeAdvancePending
 
UTime replayTimeNow
 

Static Public Attributes

static const int MAX_ID_LENGTH = 30
 
static const int MAX_RESOURCE_LIST_SIZE = 250
 

Protected Member Functions

int getCmdIndex ()
 
UResBasegetStaticResource (const char *resName, bool mayCreate, bool staticOnly=true)
 get a pointer to a static resource. More...
 
virtual bool handleCommand (UServerInMsg *msg, void *extra)
 
bool isClientAlive (int clientIdx, double holdOffTime)
 
bool sendDebug (UServerInMsg *msg, const char *debugText)
 
bool sendDebug (const char *debugText)
 
bool sendError (UServerInMsg *msg, const char *errorText)
 
bool sendError (const char *errorText)
 
bool sendHelp (UServerInMsg *msg, const char *infoText)
 
bool sendHelp (const char *infoText)
 
bool sendInfo (UServerInMsg *msg, const char *infoText)
 
bool sendInfo (const char *infoText)
 
bool sendWarning (UServerInMsg *msg, const char *warningText)
 
bool sendWarning (const char *warningText)
 
UResBasesetThisResource (const char *ID, UResBase *resource, bool remove, bool *changed, UResBase *currentResPtr, bool *isLocal)
 
- Protected Member Functions inherited from UResVarPool
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...
 

Protected Attributes

char aliasName [MAX_ID_LENGTH]
 
UCmdExecmdHandler
 
char * cmdToks [20]
 
int cmdToksCnt
 
char commandsHandled [MAX_RESOURCE_LIST_SIZE]
 
UServerInMsgmsg
 
char pluginName [MAX_RESOURCE_LIST_SIZE]
 
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
 
UReplayreplayParent
 
UTime replayTimeNext
 

Private Attributes

int cmdIndex
 
char ldFileName [MAX_FILENAME_LENGTH]
 
void * ldModule
 

Additional Inherited Members

- Static Public Member Functions inherited from UResVarPool
static const char * getResClassID ()
 
- 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

Basic class for loadable functions for this component server.

Author
Christian Andersen

Constructor & Destructor Documentation

UFunctionBase::UFunctionBase ( )
UFunctionBase::~UFunctionBase ( )
virtual

Destructor

Member Function Documentation

bool UFunctionBase::addResource ( UResBase resource,
UFunctionBase owner 
)
void UFunctionBase::closeLogfile ( )

Close logfile

Referenced by setVerbose().

virtual const char* UFunctionBase::commandList ( )
inlinevirtual

Function, that shall return a string with all handled commands, i.e. should return "gmk gmk2d guidemark", if commands starting with any of these three keywords are handled by this function

Reimplemented in UFunctionSmrIf.

References addResource(), commandsHandled, and setResource().

Referenced by print(), and UCmdExe::sysModuleCmd().

virtual void UFunctionBase::createResources ( )
inlinevirtual
const char* UFunctionBase::getAliasName ( )
inline

Get the alias name. An alias name renames some generic plugins to give a new command keyword and a new resource and plugin name. This is especially used for the generic server interface plugin, as this can handle plugins from more than one server, the base name is if, but the alias name could be "laser" for an interface to the laser server or "cam" for tnterface to the camera server. Both plugins loaded into e.g. a behaviour server.

Returns
the alias name (a single name, starting with a character and continue alfanumeric (no spaces), max length 32 chars).

References aliasName.

Referenced by UFuncPiCam::callGotNewDataWithObject(), UFuncPiCam::createResources(), UFuncKinect::createResources(), UFuncPTgrey::createResources(), UFuncPTgrey::handlePTgrey(), UFuncPTgrey::logImageToFile(), UFuncPTgrey::PrintCameraInfo(), UFuncPTgrey::Receiver(), UFuncPTgrey::runSetting(), setCommand(), UFuncPTgrey::stop(), UCmdExe::sysModuleCmd(), and UCmdExe::unloadFunctionModule().

int UFunctionBase::getCmdIndex ( )
inlineprotected

Get the command index

Returns
the command number in the command string list. first is 0.

References cmdIndex.

Referenced by UFunctionImgPool::handleCommand(), UFuncPiCam::handleCommand(), UFuncKinect::handleCommand(), UFunctionIf::handleCommand(), and UFuncPTgrey::handleCommand().

const char* UFunctionBase::getLoadedFileName ( )
inline

Get loaded module name. Returns an empty string if not a dynamic loaded module

References gotAllResources(), ldFileName, sendEndTag(), sendFullTag(), sendStartTag(), sendText(), and setAliasName().

Referenced by UCmdExe::sysModuleCmd(), UCmdExe::unloadFunctionModule(), and UCmdExe::unloadThisModule().

void* UFunctionBase::getLoadedModuleRef ( )
inline

Get loadable module pointer for further symbol ref

References ldModule.

Referenced by UCmdExe::getLoadedModuleRef(), and UCmdExe::sysModuleCmd().

UResBase * UFunctionBase::getStaticResource ( const char *  resName,
bool  mayCreate,
bool  staticOnly = true 
)
protected

get a pointer to a static resource.

Parameters
resNameThe name of the resource to be acquired.
mayCreateif set to true, then the resource will be created if it do not exist.
staticOnlyif true, then static resources - like 'odoPose' - are searched only.
Returns
NULL if not found (or core not available), else a bointer to an existing type

References cmdHandler, and UCmdExe::getStaticResource().

Referenced by UFuncKinect::callGotNewDataWithObject(), UFuncLoca2::correlateLines(), UFuncKinect::decodeReplayLine(), UFuncPpl::drawPolygons(), UFuncBallKL::filterMask(), UFuncPiPi::filterMask(), UFuncCropRow::filterMask(), UFuncBall::filterMask(), UFuncBall_improved::filterMask(), UFuncLinefinder::filterMask(), UFuncBallKL::findBall(), UFuncPiPi::findBall(), UFuncBall::findBall(), UFuncBall_improved::findBall(), UFuncCropRow::findPlants(), UFuncImSeg::findSegments(), UFuncTracking::FirstImage(), UFuncEfLine::getCurrentOdoPose(), UFuncLaserBase::getDevice(), UFuncLaserBase::getScan(), UFuncLobst::getScan(), UFuncEfLine::getScan(), UFuncKinect::GetXYZCoordinates(), UFuncLocalize::handleAddLine(), UFuncLoca2::handleAddLine(), UFunctionAvoid::handleAvoid(), Funcavoid::handleCommand(), UFuncRectify::handleCommand(), UFuncObj3d::handleCommand(), UFuncRoseBot::handleCommand(), UFuncCropRow::handleCommand(), UFuncPpl::handleCommand(), UFuncLoca2::handleCommand(), UFuncLocalize::handleLocalize(), UFunctionAvoid::handlePoseToPose(), UFuncLinefinder::houghTest(), UFuncImgPoly::initializeFindPath(), UFuncPiCam::logImageToFile(), UFuncPTgrey::logImageToFile(), UFuncKinect::logImageToFile(), UFuncTOF::logImageToFile(), UFuncBall::makeDisplayPolygon(), UFuncImSeg::makeDisplayPolygon(), UFuncImSeg::makeLBPimage(), UFuncPCLTest::MakeMap(), UFuncKinect::makeObj3Dcloud(), UFuncStraightLine::polygonToPolyPlugin(), UFuncTOF::processChannel8(), UFuncKinect::processDepthImages(), UFuncStereo::processImages(), UFuncTOF::processImages(), UFuncPTgrey::Receiver(), UFuncPiCam::run(), UFuncKinect::run(), setLoadTime(), UFuncStraightLine::toRobot(), UFuncStraightLine::toWorld(), UFuncTracking::TrackObjects(), UFuncKinect::updateCloud(), UFuncLoca2::updateStatus(), and UFuncLocalize::updateStatus().

bool UFunctionBase::gotAllResources ( char *  missingThese,
int  missingTheseCnt 
)
virtual
bool UFunctionBase::handleCommand ( UServerInMsg msg,
void *  extra 
)
protectedvirtual
bool UFunctionBase::isClientAlive ( int  clientIdx,
double  holdOffTime 
)
protected

Test to see if client is active. Especially for event push messages.

References cmdHandler, and UCmdExe::isClientAlive().

Referenced by setLoadTime().

bool UFunctionBase::isMine ( const char *  cmdName)

if a command with this name mine.

Parameters
cmdNameis the searched command name.
Returns
true if found. The command name index is saved, and can be obtaind by thje function getCmdIndex().

References cmdIndex, cmdToks, and cmdToksCnt.

Referenced by UCmdExe::executeFunction(), and setLoadTime().

bool UFunctionBase::isStatic ( )
inline

is the module loaded as static A module is static if the ldFilename has a length of zero.

Returns
true if the module is loaded as static

References ldFileName.

Referenced by UCmdExe::isModuleStatic().

virtual const char* UFunctionBase::name ( )
inlinevirtual
bool UFunctionBase::newCmd ( UServerInMsg newMsg,
UDataBase extra 
)

New command to be handled by this module - NB!

Todo:
move all push functions and plugins to this type - rather than the void in newCommand
Parameters
msgis a pointer to the queue element with the command
extrais an optional data element acheived form a push command casted to type UDataBase
Returns
true, if command is handled

References msg.

Referenced by setLoadTime().

bool UFunctionBase::newCommand ( UServerInMsg newMsg,
void *  extra 
)

New command to be handled by this module

Parameters
msgis a pointer to the queue element with the command
extrais an optional void pointer to a data element acheived form a push command
Returns
true, if command is handled

References handleCommand(), and msg.

Referenced by UCmdExe::executeFunction(), UCmdExe::handleOneServerPushMessage(), and setLoadTime().

bool UFunctionBase::openLogfile ( const char *  name)

Open logfile - in default image directory

Referenced by setVerbose().

void UFunctionBase::print ( const char *  preString)
virtual

Print information on this object to console.

Reimplemented from UResBase.

References commandList(), ldFileName, ldModule, and name().

Referenced by setVerbose().

virtual void UFunctionBase::resourceUpdated ( )
inlinevirtual

This function is called if a resource for this function is updated - this could be used to verify that all resources are available and full functionality may be available.

References msg, sendHelpDone(), sendHelpStart(), sendMsg(), and sendMsgInt().

Referenced by UCmdExe::deleteFunction(), and UCmdExe::resourcesUpdate().

bool UFunctionBase::sendDebug ( UServerInMsg msg,
const char *  debugText 
)
protected
bool UFunctionBase::sendDebug ( const char *  debugText)
protected

Send a standard warning reply of the form: <'tagname' debug="'warning text'"/>, where 'tagname' is that tagname of the command and 'warning text' is the provided reply text (quotes are added by the function). true if send.

References cmdHandler, UQevent::consoleReply(), msg, qevent, UCmdExe::sendDebug(), and silent.

bool UFunctionBase::sendEndTag ( UServerInMsg msg)

Send a closing end-tag for this message. Returns true if the message was send.

References USmlTagIn::getTagName(), sendMsg(), and UServerInMsg::tag.

bool UFunctionBase::sendEndTag ( )
bool UFunctionBase::sendError ( UServerInMsg msg,
const char *  errorText 
)
protected

Send a standard error reply of the form: < 'tagname' debug="warning text"/>, where 'tagname' is that tagname of the command and 'warning text' is the provided reply text (quotes are added by the function). true if send.

References cmdHandler, UQevent::consoleReply(), qevent, and UCmdExe::sendError().

Referenced by UFunctionDisp::handleCommand(), UFunctionVarPool::handleVar(), setLoadTime(), and UFuncRule::unloadRule().

bool UFunctionBase::sendError ( const char *  errorText)
protected

Send a standard error reply of the form: < 'tagname' debug="warning text"/>, where 'tagname' is that tagname of the command and 'warning text' is the provided reply text (quotes are added by the function). true if send.

References cmdHandler, UQevent::consoleReply(), msg, qevent, and UCmdExe::sendError().

bool UFunctionBase::sendFullTag ( const char *  attributes)

send a full tag message with these attributes. I.e. a "<tagname attributes/>\n" The tag name is the same as the command name (the command tag name)

Parameters
attributesis a string with all additional attributes to be placed inside the tag.
Returns
true if send successfully.

References USmlTagIn::getTagName(), msg, sendMsg(), and UServerInMsg::tag.

Referenced by getLoadedFileName().

bool UFunctionBase::sendHelp ( UServerInMsg msg,
const char *  infoText 
)
protected

Send a standard warning reply of the form: <'tagname' info="'warning text'"/>, where 'tagname' is that tagname of the command and 'warning text' is the provided reply text (quotes are added by the function). Returns true if send.

References cmdHandler, UQevent::consoleReply(), qevent, and UCmdExe::sendHelp().

Referenced by UFunctionCamGmk::handleGmkGetCommand(), UFunctionPoseHist::handlePoseHistCommand(), UFunctionLaser::handleSetCommand(), and setLoadTime().

bool UFunctionBase::sendHelp ( const char *  infoText)
protected

Send a standard warning reply of the form: <'tagname' info="'warning text'"/>, where 'tagname' is that tagname of the command and 'warning text' is the provided reply text (quotes are added by the function). true if send.

References cmdHandler, UQevent::consoleReply(), msg, qevent, and UCmdExe::sendHelp().

bool UFunctionBase::sendHelpDone ( UServerInMsg msg)

Send an help close tag and an info message matching the message in msg

Parameters
msgreference to client connection
Returns
true if send

References cmdHandler, and UCmdExe::sendHelpDone().

bool UFunctionBase::sendHelpDone ( )

Send an help close tag and an info message matching the message in msg

Returns
true if send

References cmdHandler, msg, and UCmdExe::sendHelpDone().

Referenced by UFuncCog::centerOfGravity(), UFuncPlan::handleAddCon(), UFuncLocalize::handleAddLine(), UFuncPlan::handleAddPoint(), UFunctionAvoid::handleAvoid(), UFuncPlan::handlecalculatecost(), UFunctionCam::handleCamGetCommand(), UFunctionCam::handleCamPushCommand(), UFunctionCam::handleCamSetCommand(), UFunctionCam::handleCamsGetCommand(), UFuncImu::handleCommand(), Funcavoid::handleCommand(), UFuncVarMrc::handleCommand(), UFuncRectify::handleCommand(), UFuncBall_improved::handleCommand(), UFuncBallKL::handleCommand(), UFuncPiPi::handleCommand(), UFuncObj3d::handleCommand(), UFuncBall::handleCommand(), UFuncRoseBot::handleCommand(), UFunctionGps::handleCommand(), UFuncFile::handleCommand(), UFuncCropRow::handleCommand(), UFuncLobst::handleCommand(), UFuncMapObst::handleCommand(), UFuncPoly::handleCommand(), UFuncBin::handleCommand(), UFuncCron::handleCommand(), UFuncPpl::handleCommand(), UFuncRadar::handleCommand(), UFuncImSeg::handleCommand(), UFuncStraightLine::handleCommand(), UFuncLoca2::handleCommand(), UFuncPcp::handleCommand(), UFuncEfLine::handleCommand(), UFuncLinefinder::handleCommand(), UFuncPCLTest::handleCommand(), UFuncV4lGst::handleCommand(), UFuncFz::handleCommand(), UFuncTracking::handleCommand(), UFuncPlan::handleFindRoute(), UFuncPlan::handleGetPoint(), UFunctionImgPool::handleImageSetCommand(), UFuncKeep::handleKeep(), UFuncKinect::handleKinect(), UFunctionLaserIfData::handleLaserObst(), UFuncLocalize::handleLocalize(), UFuncLocalize::handleLocalizeMHF(), UFuncLocalize::handleLocalizeUKF(), UFuncPiCam::handleNormal(), UFunctionPassable::handleObstGet(), UFuncLocalize::handleOutputDist(), UFunctionAvoid::handlePoseToPose(), UFuncPTgrey::handlePTgrey(), UFuncLocalize::handleResample(), UFuncLocalize::handleResetLocalizer(), UFuncPlan::handleResetPlan(), UFuncRhdIf::handleRhd(), UFuncRule::handleRuleSet(), UFuncLocalize::handleSetInitCov(), UFuncLocalize::handleSetInitPose(), UFuncLocalize::handleSetTable(), UFuncStereo::handleStereo(), UFuncTOF::handleTOF(), UFuncV360::handleV360Command(), UFunctionVarPool::handleVar(), UFunctionVarPool::handleVarPush(), UFuncRule::listAllMissions(), UFunctionPoseHist::listPoses(), UFuncRule::listState(), resourceUpdated(), and UFunctionVarPool::sendVar().

bool UFunctionBase::sendHelpStart ( UServerInMsg msg,
const char *  subject 
)

Send an help open tag with the provided subject, like <help subject="subject">

Parameters
msgreference to client connection
subjecthelp subject
Returns
true if send

References cmdHandler, and UCmdExe::sendHelpStart().

bool UFunctionBase::sendHelpStart ( const char *  subject)

Send an help open tag with the provided subject, like <help subject="subject">

Parameters
subjecthelp subject
Returns
true if send

References cmdHandler, msg, and UCmdExe::sendHelpStart().

bool UFunctionBase::sendHelpStart ( )

Send an help open tag with the provided subject, like <help subject="subject"> where subject is the plug-in (alias) name

Returns
true if send

References aliasName, cmdHandler, msg, and UCmdExe::sendHelpStart().

Referenced by UFuncCog::centerOfGravity(), UFuncPlan::handleAddCon(), UFuncLocalize::handleAddLine(), UFuncPlan::handleAddPoint(), UFunctionAvoid::handleAvoid(), UFuncPlan::handlecalculatecost(), UFunctionCam::handleCamGetCommand(), UFunctionCam::handleCamPushCommand(), UFunctionCam::handleCamSetCommand(), UFunctionCam::handleCamsGetCommand(), UFuncImu::handleCommand(), Funcavoid::handleCommand(), UFuncVarMrc::handleCommand(), UFuncRectify::handleCommand(), UFuncBall_improved::handleCommand(), UFuncBallKL::handleCommand(), UFuncPiPi::handleCommand(), UFuncObj3d::handleCommand(), UFuncBall::handleCommand(), UFuncRoseBot::handleCommand(), UFunctionGps::handleCommand(), UFuncFile::handleCommand(), UFuncCropRow::handleCommand(), UFuncLobst::handleCommand(), UFuncMapObst::handleCommand(), UFuncPoly::handleCommand(), UFuncBin::handleCommand(), UFuncCron::handleCommand(), UFuncPpl::handleCommand(), UFuncRadar::handleCommand(), UFuncImSeg::handleCommand(), UFuncStraightLine::handleCommand(), UFuncLoca2::handleCommand(), UFuncPcp::handleCommand(), UFuncEfLine::handleCommand(), UFuncLinefinder::handleCommand(), UFuncPCLTest::handleCommand(), UFuncV4lGst::handleCommand(), UFuncFz::handleCommand(), UFuncTracking::handleCommand(), UFuncPlan::handleFindRoute(), UFuncPlan::handleGetPoint(), UFunctionImgPool::handleImageSetCommand(), UFuncKeep::handleKeep(), UFuncKinect::handleKinect(), UFunctionLaserIfData::handleLaserObst(), UFuncLocalize::handleLocalize(), UFuncLocalize::handleLocalizeMHF(), UFuncLocalize::handleLocalizeUKF(), UFuncPiCam::handleNormal(), UFunctionPassable::handleObstGet(), UFuncLocalize::handleOutputDist(), UFunctionAvoid::handlePoseToPose(), UFuncPTgrey::handlePTgrey(), UFuncLocalize::handleResample(), UFuncLocalize::handleResetLocalizer(), UFuncPlan::handleResetPlan(), UFuncRhdIf::handleRhd(), UFuncRule::handleRuleSet(), UFuncLocalize::handleSetInitCov(), UFuncLocalize::handleSetInitPose(), UFuncLocalize::handleSetTable(), UFuncStereo::handleStereo(), UFuncTOF::handleTOF(), UFuncV360::handleV360Command(), UFunctionVarPool::handleVar(), UFunctionVarPool::handleVarPush(), UFuncRule::listAllMissions(), UFunctionPoseHist::listPoses(), UFuncRule::listState(), resourceUpdated(), and UFunctionVarPool::sendVar().

bool UFunctionBase::sendInfo ( UServerInMsg msg,
const char *  infoText 
)
protected

Send a standard warning reply of the form: <'tagname' info="warning text"/>, where 'tagname' is that tagname of the command and 'warning text' is the provided reply text (quotes are added by the function). true if send.

References cmdHandler, UQevent::consoleReply(), USmlTagIn::getAttBool(), qevent, UCmdExe::sendInfo(), silent, and UServerInMsg::tag.

Referenced by UFuncFocus::doFocus(), UFuncRule::editRule(), UFuncImgPoly::findAreaFromSeedRGB(), UFunctionCamPath::findPath(), UFuncLocalize::handleAddLine(), UFunctionAvoid::handleAvoid(), UFunctionCam::handleCamSetCommand(), UFuncObj3d::handleCloud(), UFuncImu::handleCommand(), UFuncRectify::handleCommand(), UFuncBall_improved::handleCommand(), UFunctionCamData::handleCommand(), UFunctionDisp::handleCommand(), UFuncView::handleCommand(), UFuncBallKL::handleCommand(), UFuncPiPi::handleCommand(), UFuncObj3d::handleCommand(), UFunctionGps::handleCommand(), UFuncFile::handleCommand(), UFuncLobst::handleCommand(), UFuncCropRow::handleCommand(), UFuncPoly::handleCommand(), UFuncCron::handleCommand(), UFuncBin::handleCommand(), UFuncMapObst::handleCommand(), UFuncRadar::handleCommand(), UFuncImSeg::handleCommand(), UFuncStraightLine::handleCommand(), UFuncLoca2::handleCommand(), UFuncEfLine::handleCommand(), UFuncPcp::handleCommand(), UFuncLinefinder::handleCommand(), UFuncPCLTest::handleCommand(), UFunctionRoadDrive::handleCommand(), UFuncV4lGst::handleCommand(), UFuncFz::handleCommand(), UFuncTracking::handleCommand(), UFunctionDrivePos::handleDrivePos(), UFunctionCamGmk::handleGmkGetCommand(), UFunctionIf::handleIf(), UFunctionIf::handleIfPush(), UFunctionImage::handleImageGetCommand(), UFunctionImgPool::handleImageGetCommand(), UFunctionImgPool::handleImageSetCommand(), UFuncImgPoly::handleImgPolyCommand(), UFuncKeep::handleKeep(), UFuncKeep::handleKeepPush(), UFuncKinect::handleKinect(), UFunctionLaserIfData::handleLaserIf(), UFunctionLaserIfScan::handleLaserIf(), UFunctionLaserIfData::handleLaserObst(), UFuncLoca2::handleLocalize(), UFunctionLocater::handleLocater(), UFuncPiCam::handleNormal(), UFunctionPassable::handleObstGet(), UFunctionPassable::handlePass(), UFunctionCamPath::handlePathGetCommand(), UFunctionImgPool::handlePoolPushCommand(), UFunctionPoseHist::handlePoseHistCommand(), UFunctionPoseHist::handlePoseHistPush(), UFuncPlugBasePush::handlePush(), UFuncRhdIf::handlePushCommand(), UFuncLocalize::handleResetLocalizer(), UFuncRhdIf::handleRhd(), UFunctionPassable::handleRoad(), UFuncRule::handleRuleSet(), UFunctionLaser::handleScanGetCommand(), UFunctionLaser::handleScanPushCommand(), UFunctionLaser::handleSetCommand(), UFuncLocalize::handleSetInitCov(), UFuncLocalize::handleSetInitPose(), UFunctionSmrIf::handleSmr(), UFunctionSmrIf::handleSmrPush(), UFuncStereo::handleStereo(), UFuncV360::handleV360Command(), UFuncV360::handleV360Push(), UFunctionVarPool::handleVar(), UFunctionVarPool::handleVarPush(), UFunctionVarPool::handleVarValues(), UFuncRule::listAllMissions(), UFuncRule::listMission(), UFuncRule::listState(), UFuncRule::loadRuleFile(), UFuncRule::openLog(), UFuncRule::runStep(), UFunctionVarPool::sendVarList(), setLoadTime(), UFuncRule::startStopRule(), and UFuncRule::unloadRule().

bool UFunctionBase::sendInfo ( const char *  infoText)
protected

Send a standard warning reply of the form: <'tagname' info="warning text"/>, where 'tagname' is that tagname of the command and 'warning text' is the provided reply text (quotes are added by the function). true if send.

References cmdHandler, UQevent::consoleReply(), msg, qevent, UCmdExe::sendInfo(), and silent.

bool UFunctionBase::sendMsg ( UServerInMsg msg,
const char *  message,
int  size 
)

Send reply message to client with specific length

  • can be used for binary messages as well. Returns true if send. Returns false if client (or server) has gone.

References cmdHandler, and UCmdExe::sendMsg().

Referenced by UFuncCog::centerOfGravity(), UFunctionIf::dataTrap(), UFuncCog::doBark(), UFuncFocus::doFocus(), UFunctionCam::handleCamGetCommand(), UFunctionCam::handleCamPushCommand(), UFunctionCam::handleCamSetCommand(), UFunctionCam::handleCamsGetCommand(), UFuncObj3d::handleCloud(), Funcavoid::handleCommand(), UFuncVarMrc::handleCommand(), UFuncBall_improved::handleCommand(), UFunctionDisp::handleCommand(), UFunctionCamData::handleCommand(), UFuncBallKL::handleCommand(), UFuncView::handleCommand(), UFuncPiPi::handleCommand(), UFuncBall::handleCommand(), UFuncRoseBot::handleCommand(), UFunctionGps::handleCommand(), UFuncFile::handleCommand(), UFuncCropRow::handleCommand(), UFuncLobst::handleCommand(), UFuncPoly::handleCommand(), UFuncCron::handleCommand(), UFuncPpl::handleCommand(), UFuncImSeg::handleCommand(), UFuncLoca2::handleCommand(), UFuncPcp::handleCommand(), UFuncLinefinder::handleCommand(), UFunctionRoadDrive::handleCommand(), UFunctionDrivePos::handleDrivePos(), UFuncPlan::handleFindRoute(), UFuncPlan::handleGetPoint(), UFunctionCamGmk::handleGmkGetCommand(), UFunctionIf::handleIf(), UFunctionIf::handleIfPush(), UFunctionImage::handleImageGetCommand(), UFunctionImgPool::handleImageGetCommand(), UFunctionImgPool::handleImageListCommand(), UFuncImgPoly::handleImgPolyCommand(), UFuncKeep::handleKeepPush(), UFunctionLaserIfData::handleLaserIf(), UFunctionLaserIfScan::handleLaserIf(), UFunctionLaserIfData::handleLaserObst(), UFuncLocalize::handleLocalize(), UFuncLoca2::handleLocalize(), UFuncLocalize::handleLocalizeMHF(), UFuncLocalize::handleLocalizeUKF(), UFunctionLocater::handleLocater(), UFunctionPassable::handlePass(), UFunctionCamPath::handlePathGetCommand(), UFunctionImgPool::handlePoolPushCommand(), UFunctionPoseHist::handlePoseHistCommand(), UFunctionPoseHist::handlePoseHistPush(), UFuncPlugBasePush::handlePush(), UFuncRhdIf::handlePushCommand(), UFunctionPassable::handleRoad(), UFunctionLaser::handleScanGetCommand(), UFunctionLaser::handleScanPushCommand(), UFunctionLaser::handleSetCommand(), UFunctionSmrIf::handleSmr(), UFunctionSmrIf::handleSmrPush(), UFuncStereo::handleStereo(), UFuncV360::handleV360Push(), UFunctionVarPool::handleVarPush(), UFunctionVarPool::handleVarValues(), UFuncRule::listMission(), UFuncRule::listState(), UFuncRule::loadRuleFile(), UFunctionVarPool::makeAMethodCall(), resourceUpdated(), UFuncEfLine::sendAllLines(), UFuncEfLine::sendBoxLines(), UFuncEfLine::sendBoxPose(), UFunctionAvoid::sendCurrentAvoidPath(), UFunctionAvoid::sendCurrentPath(), UFunctionVarPool::sendDescription(), sendEndTag(), UFunctionPassable::sendFullScan(), sendFullTag(), UFunctionCamGmk::sendGmk(), UFunctionImgBase::sendImage(), UFunctionAvoid::sendManSeq(), UFuncObj3d::sendObjects(), UFunctionPassable::sendObstacles(), UFunctionPassable::sendRoadLines(), UFuncEfLine::sendRobotPoseAndSensorPosition(), UFunctionLaser::sendScan(), sendStartTag(), UFuncRule::sendStateMessage(), UFunctionCam::sendStatusReply(), UFunctionVarPool::sendVar(), UFunctionVarPool::sendVarList(), and UFuncStraightLine::toWorld().

bool UFunctionBase::sendMsg ( const char *  message)

Send text reply mesage to client. Returns true if send. Returns false if client (or server) has gone.

References cmdHandler, msg, and UCmdExe::sendMsg().

bool UFunctionBase::sendMsg ( UServerInMsg msg,
const char *  message 
)

Send text reply mesage to client. Returns true if send. Returns false if client (or server) has gone.

References cmdHandler, and UCmdExe::sendMsg().

bool UFunctionBase::sendMsg ( int  clientIdx,
const char *  message,
int  size 
)

Send reply message to client with specific length

  • can be used for binary messages as well. Returns true if send. Returns false if client (or server) has gone. NB! call is depricated, as connection can not be locked during long transmissions.
    Todo:
    remove this function

References cmdHandler, and UCmdExe::sendMsg().

bool UFunctionBase::sendMsgInt ( int  clientIdx,
const char *  message 
)

Send text reply mesage to client. Returns true if send. Returns false if client (or server) has gone. NB! call is depricated, as connection can not be locked during long transmissions.

Todo:
remove this function

References cmdHandler, and UCmdExe::sendMsg().

Referenced by UFunctionIf::dataTrap(), and resourceUpdated().

bool UFunctionBase::sendStartTag ( const char *  attributes)

send a tag start message with these attributes. The tag name is the same as the command name (the command tag name) I.e. like "<tagname attributes>\n" The tag can be closed by a call to sendEndTag()

Parameters
attributesis a string with all additional attributes to be placed inside the tag open message.
Returns
true if send successfully.

References USmlTagIn::getTagName(), msg, sendMsg(), and UServerInMsg::tag.

Referenced by getLoadedFileName(), and UFunctionAvoid::handlePoseToPose().

bool UFunctionBase::sendText ( UServerInMsg msg,
const char *  text 
)

Send a text that may contain XML reserver characters '<"'&>'. The text will be converted, so that no reserver characters remain in the transmitted text. Returns true if send.

References cmdHandler, and UCmdExe::sendText().

Referenced by UFuncCog::centerOfGravity(), UFuncFocus::doFocus(), getLoadedFileName(), UFuncPlan::handleAddCon(), UFuncLocalize::handleAddLine(), UFuncPlan::handleAddPoint(), UFunctionAvoid::handleAvoid(), UFuncPlan::handlecalculatecost(), UFunctionCam::handleCamGetCommand(), UFunctionCam::handleCamPushCommand(), UFunctionCam::handleCamSetCommand(), UFunctionCam::handleCamsGetCommand(), UFuncImu::handleCommand(), Funcavoid::handleCommand(), UFuncVarMrc::handleCommand(), UFuncRectify::handleCommand(), UFuncBall_improved::handleCommand(), UFunctionCamData::handleCommand(), UFunctionDisp::handleCommand(), UFuncBallKL::handleCommand(), UFuncPiPi::handleCommand(), UFuncView::handleCommand(), UFuncObj3d::handleCommand(), UFuncBall::handleCommand(), UFunctionGps::handleCommand(), UFuncRoseBot::handleCommand(), UFuncFile::handleCommand(), UFuncCropRow::handleCommand(), UFuncLobst::handleCommand(), UFuncMapObst::handleCommand(), UFuncBin::handleCommand(), UFuncPoly::handleCommand(), UFuncCron::handleCommand(), UFuncPpl::handleCommand(), UFuncRadar::handleCommand(), UFuncImSeg::handleCommand(), UFuncStraightLine::handleCommand(), UFuncLoca2::handleCommand(), UFuncPcp::handleCommand(), UFuncEfLine::handleCommand(), UFuncLinefinder::handleCommand(), UFuncPCLTest::handleCommand(), UFunctionRoadDrive::handleCommand(), UFuncV4lGst::handleCommand(), UFuncFz::handleCommand(), UFuncTracking::handleCommand(), UFunctionDrivePos::handleDrivePos(), UFuncPlan::handleFindRoute(), UFuncPlan::handleGetPoint(), UFunctionCamGmk::handleGmkGetCommand(), UFunctionIf::handleIf(), UFunctionIf::handleIfPush(), UFunctionImage::handleImageGetCommand(), UFunctionImgPool::handleImageGetCommand(), UFunctionImgPool::handleImageSetCommand(), UFuncImgPoly::handleImgPolyCommand(), UFuncKeep::handleKeep(), UFuncKeep::handleKeepPush(), UFuncKinect::handleKinect(), UFunctionLaserIfData::handleLaserIf(), UFunctionLaserIfScan::handleLaserIf(), UFunctionLaserIfData::handleLaserObst(), UFuncLocalize::handleLocalize(), UFuncLocalize::handleLocalizeMHF(), UFuncLocalize::handleLocalizeUKF(), UFunctionLocater::handleLocater(), UFuncPiCam::handleNormal(), UFunctionPassable::handleObstGet(), UFuncLocalize::handleOutputDist(), UFunctionPassable::handlePass(), UFunctionCamPath::handlePathGetCommand(), UFunctionImgPool::handlePoolPushCommand(), UFunctionPoseHist::handlePoseHistCommand(), UFunctionPoseHist::handlePoseHistPush(), UFunctionAvoid::handlePoseToPose(), UFuncPTgrey::handlePTgrey(), UFuncPlugBasePush::handlePush(), UFuncRhdIf::handlePushCommand(), UFuncLocalize::handleResample(), UFuncLocalize::handleResetLocalizer(), UFuncPlan::handleResetPlan(), UFuncRhdIf::handleRhd(), UFunctionPassable::handleRoad(), UFuncRule::handleRuleSet(), UFunctionLaser::handleScanGetCommand(), UFunctionLaser::handleScanPushCommand(), UFunctionLaser::handleSetCommand(), UFuncLocalize::handleSetInitCov(), UFuncLocalize::handleSetInitPose(), UFuncLocalize::handleSetTable(), UFunctionSmrIf::handleSmr(), UFunctionSmrIf::handleSmrPush(), UFuncStereo::handleStereo(), UFuncTOF::handleTOF(), UFuncV360::handleV360Command(), UFuncV360::handleV360Push(), UFunctionVarPool::handleVar(), UFunctionVarPool::handleVarPush(), UFuncRule::listAllMissions(), UFuncRule::listMission(), UFunctionPoseHist::listPoses(), UFuncRule::listState(), UFuncRule::loadRuleFile(), UFunctionVarPool::makeAMethodCall(), UFuncRule::sendStateMessage(), and UFunctionVarPool::sendVar().

bool UFunctionBase::sendText ( const char *  text)

Send a text that may contain XML reserver characters '<"'&>'. The text will be converted, so that no reserver characters remain in the transmitted text. Returns true if send.

References cmdHandler, msg, and UCmdExe::sendText().

bool UFunctionBase::sendWarning ( UServerInMsg msg,
const char *  warningText 
)
protected

Send a standard warning reply of the form: <'tagname' warning="warning text"/>, where 'tagname' is that tagname of the command and 'warning text'; is the provided reply text (quotes are added by the function). Returns true if send.

References cmdHandler, UQevent::consoleReply(), qevent, UCmdExe::sendWarning(), and silent.

Referenced by UFuncCog::centerOfGravity(), UFuncFocus::doFocus(), UFuncRule::editRule(), UFuncPlan::handleAddCon(), UFuncPlan::handleAddPoint(), UFunctionAvoid::handleAvoid(), UFunctionCam::handleCamPushCommand(), UFunctionCam::handleCamSetCommand(), UFunctionCam::handleCamsGetCommand(), UFuncObj3d::handleCloud(), UFuncVarMrc::handleCommand(), UFuncRectify::handleCommand(), UFunctionImage::handleCommand(), UFunctionImgPool::handleCommand(), UFuncBall_improved::handleCommand(), UFunctionCamData::handleCommand(), UFunctionDisp::handleCommand(), UFuncView::handleCommand(), UFuncBallKL::handleCommand(), UFuncObj3d::handleCommand(), UFuncBall::handleCommand(), UFuncRoseBot::handleCommand(), UFunctionGps::handleCommand(), UFuncFile::handleCommand(), UFuncLobst::handleCommand(), UFuncCropRow::handleCommand(), UFuncPoly::handleCommand(), UFuncCron::handleCommand(), UFuncMapObst::handleCommand(), UFuncPpl::handleCommand(), UFuncRadar::handleCommand(), UFuncStraightLine::handleCommand(), UFuncImSeg::handleCommand(), UFuncLoca2::handleCommand(), UFuncPcp::handleCommand(), UFuncEfLine::handleCommand(), UFuncLinefinder::handleCommand(), UFunctionRoadDrive::handleCommand(), UFuncV4lGst::handleCommand(), UFuncFz::handleCommand(), UFunctionDrivePos::handleDrivePos(), UFuncPlan::handleFindRoute(), UFuncPlan::handleGetPoint(), UFunctionCamGmk::handleGmkGetCommand(), UFunctionIf::handleIf(), UFunctionIf::handleIfPush(), UFunctionImage::handleImageGetCommand(), UFunctionImgPool::handleImageGetCommand(), UFunctionImgPool::handleImageListCommand(), UFunctionImgPool::handleImageSetCommand(), UFuncImgPoly::handleImgPolyCommand(), UFuncKeep::handleKeep(), UFuncKeep::handleKeepPush(), UFuncKinect::handleKinect(), UFunctionLaserIfData::handleLaserIf(), UFunctionLaserIfScan::handleLaserIf(), UFunctionLaserIfData::handleLaserObst(), UFuncLocalize::handleLocalize(), UFuncLoca2::handleLocalize(), UFuncLocalize::handleLocalizeMHF(), UFuncLocalize::handleLocalizeUKF(), UFunctionLocater::handleLocater(), UFunctionPassable::handleObstGet(), UFunctionPassable::handlePass(), UFunctionCamPath::handlePathGetCommand(), UFunctionImgPool::handlePoolPushCommand(), UFunctionPoseHist::handlePoseHistCommand(), UFunctionPoseHist::handlePoseHistPush(), UFunctionAvoid::handlePoseToPose(), UFuncPlugBasePush::handlePush(), UFuncRhdIf::handlePushCommand(), UFuncRhdIf::handleRhd(), UFunctionPassable::handleRoad(), UFuncRule::handleRuleSet(), UFunctionLaser::handleScanGetCommand(), UFunctionLaser::handleScanPushCommand(), UFunctionLaser::handleSetCommand(), UFuncLocalize::handleSetInitCov(), UFuncLocalize::handleSetInitPose(), UFunctionSmrIf::handleSmr(), UFunctionSmrIf::handleSmrPush(), UFuncStereo::handleStereo(), UFuncV360::handleV360Command(), UFuncV360::handleV360Push(), UFunctionVarPool::handleVar(), UFunctionVarPool::handleVarPush(), UFuncRule::listAllMissions(), UFuncRule::listMission(), UFuncRule::listState(), UFuncRule::loadRuleFile(), UFunctionVarPool::makeAMethodCall(), UFunctionVarPool::sendVar(), UFunctionVarPool::sendVarList(), setLoadTime(), UFuncRule::startStopRule(), and UFuncRule::unloadRule().

bool UFunctionBase::sendWarning ( const char *  warningText)
protected

Send a standard warning reply of the form: <'tagname' warning="warning text"/>, where 'tagname' is that tagname of the command and 'warning text'; is the provided reply text (quotes are added by the function). true if send.

References cmdHandler, UQevent::consoleReply(), msg, qevent, UCmdExe::sendWarning(), and silent.

void UFunctionBase::setAliasName ( const char *  name)
virtual

Set alias name - default is empty

Parameters
aliasNameis the new name for the plugin - this is used for the resource and the new single command handled.

Reimplemented in UFunctionPoseHist.

References aliasName, UResBase::getResID(), MAX_ID_LENGTH, and setCommand().

Referenced by getLoadedFileName(), UCmdExe::loadFunctionModule(), UServerStatic::loadStaticModule(), UFunctionPoseHist::setAliasName(), and UFunctionIf::UFunctionIf().

void UFunctionBase::setCommand ( const char *  cmdList,
const char *  name,
const char *  note 
)
virtual

Set command list and optional version information e.g. setCommand("ball door", "ballfinder", "finds balls in images (by author)"); to set the commands "ball" and "door" to be handled by this plugin, and add some author initial and a coompile date and time for the plugin.

Parameters
cmdListis a space separated list of commands to be handled by this plugin
nameis the resource name of the plugin, and the name of the base structure for local variables.
notean optional text string shown in the module list - could also hold author name (shown in variable list and other places).

References aliasName, cmdToks, cmdToksCnt, commandsHandled, getAliasName(), MAX_ID_LENGTH, MAX_RESOURCE_LIST_SIZE, pluginName, UResVarPool::setDescription(), and UResBase::setResID().

Referenced by Funcavoid::Funcavoid(), setAliasName(), setName(), UFuncBall::UFuncBall(), UFuncBall_improved::UFuncBall_improved(), UFuncBallKL::UFuncBallKL(), UFuncBin::UFuncBin(), UFuncCron::UFuncCron(), UFuncCropRow::UFuncCropRow(), UFuncEfLine::UFuncEfLine(), UFuncFile::UFuncFile(), UFuncFocus::UFuncFocus(), UFuncFz::UFuncFz(), UFuncImgPoly::UFuncImgPoly(), UFuncImSeg::UFuncImSeg(), UFuncImu::UFuncImu(), UFuncKeep::UFuncKeep(), UFuncKinect::UFuncKinect(), UFuncLinefinder::UFuncLinefinder(), UFuncLobst::UFuncLobst(), UFuncLoca2::UFuncLoca2(), UFuncLocalize::UFuncLocalize(), UFuncMapObst::UFuncMapObst(), UFuncObj3d::UFuncObj3d(), UFuncPCLTest::UFuncPCLTest(), UFuncPcp::UFuncPcp(), UFuncPiCam::UFuncPiCam(), UFuncPiPi::UFuncPiPi(), UFuncPlan::UFuncPlan(), UFuncPoly::UFuncPoly(), UFuncPpl::UFuncPpl(), UFuncPTgrey::UFuncPTgrey(), UFuncRadar::UFuncRadar(), UFuncRectify::UFuncRectify(), UFuncRhdIf::UFuncRhdIf(), UFuncRoseBot::UFuncRoseBot(), UFuncRule::UFuncRule(), UFuncStereo::UFuncStereo(), UFuncStraightLine::UFuncStraightLine(), UFunctionAvoid::UFunctionAvoid(), UFunctionCam::UFunctionCam(), UFunctionCamData::UFunctionCamData(), UFunctionCamGmk::UFunctionCamGmk(), UFunctionCamPath::UFunctionCamPath(), UFunctionDisp::UFunctionDisp(), UFunctionDrivePos::UFunctionDrivePos(), UFunctionGps::UFunctionGps(), UFunctionIf::UFunctionIf(), UFunctionImage::UFunctionImage(), UFunctionImgPool::UFunctionImgPool(), UFunctionLaser::UFunctionLaser(), UFunctionLaserIfData::UFunctionLaserIfData(), UFunctionLaserIfScan::UFunctionLaserIfScan(), UFunctionLocater::UFunctionLocater(), UFunctionPassable::UFunctionPassable(), UFunctionPoseHist::UFunctionPoseHist(), UFunctionRoadDrive::UFunctionRoadDrive(), UFunctionSmrIf::UFunctionSmrIf(), UFunctionVarPool::UFunctionVarPool(), UFuncV360::UFuncV360(), UFuncV4lGst::UFuncV4lGst(), UFuncVarMrc::UFuncVarMrc(), and UFuncView::UFuncView().

void UFunctionBase::setLoadedModuleRef ( void *  module,
const char *  moduleFileName 
)

Set loaded module and filename

References ldFileName, ldModule, and MAX_FILENAME_LENGTH.

Referenced by UCmdExe::loadFunctionModule(), and setVerbose().

virtual void UFunctionBase::setLoadTime ( UTime  )
inlinevirtual

Set module load time, i.e. just befor call to open file This is needed by the svs-library function, as image times are relative to start of module

References getStaticResource(), handleCommand(), isClientAlive(), isMine(), newCmd(), newCommand(), sendDebug(), sendError(), sendHelp(), sendInfo(), sendWarning(), and setThisResource().

Referenced by UCmdExe::loadFunctionModule().

void UFunctionBase::setName ( const char *  name)
inline

Set plugin name - the compile time will be added

References MAX_RESOURCE_LIST_SIZE, UResVarPool::note, pluginName, and setCommand().

bool UFunctionBase::setResource ( UResBase resource,
bool  remove 
)
virtual

List (space separated) of shared resources provided by this function. Must be an empty string if no resources are to be shared. Each resource ID must be no longer than 20 characters long. Get a pointer to the resource with this ID string. The match should be case sensitive. A pointer should be returned for each of the ISs in the resource ID list. Set a resource pointer as appropriate for this class. NB! this base class needs a pointer to the core for core functionality.

Reimplemented from UResVarPool.

Reimplemented in UFuncLaserBox, UFuncLocalize, UFunctionPassable, UFunctionLaserIfData, UFunctionLaserIfScan, UFuncView, UFuncLoca2, UFunctionPoseHist, UFuncPlugBasePush, UFunctionCamData, UFunctionImgBase, UFunctionVarPool, UFunctionCamBase, and UFunctionLaser.

References cmdHandler, UCmdExe::getResClassID(), and UResBase::isA().

Referenced by commandList(), UCmdExe::deleteFunction(), UCmdExe::resourcesUpdate(), UFunctionLaser::setResource(), UFunctionImgBase::setResource(), UFunctionVarPool::setResource(), UFunctionCamData::setResource(), UFuncPlugBasePush::setResource(), UFunctionPoseHist::setResource(), UFuncLoca2::setResource(), UFuncView::setResource(), UFunctionLaserIfData::setResource(), UFunctionLaserIfScan::setResource(), UFunctionPassable::setResource(), UFuncLocalize::setResource(), and UFuncLaserBox::setResource().

UResBase * UFunctionBase::setThisResource ( const char *  ID,
UResBase resource,
bool  remove,
bool *  changed,
UResBase currentResPtr,
bool *  isLocal 
)
protected

Test if the resource has this ID, and if so set the resource pointer 'currentResPtr' to the new resource and adjust the local flag as appropriate. Returns 'changed' true if the resource pointer is changed.

References UResBase::getResID().

Referenced by setLoadTime(), UFunctionCamData::setResource(), UFunctionLaserIfData::setResource(), and UFunctionLaserIfScan::setResource().

void UFunctionBase::setVerbose ( bool  value)
inline

Set verbose messages - mostly for debug purpose

References closeLogfile(), name(), openLogfile(), print(), setLoadedModuleRef(), and verboseMessages.

Referenced by runCameraServerComponent(), and testServerGen().

Member Data Documentation

char UFunctionBase::aliasName[MAX_ID_LENGTH]
protected
UCmdExe* UFunctionBase::cmdHandler
protected
int UFunctionBase::cmdIndex
private

function index - the command number in the command list

Referenced by getCmdIndex(), and isMine().

char* UFunctionBase::cmdToks[20]
protected

Pointers to start of each command

Referenced by isMine(), and setCommand().

int UFunctionBase::cmdToksCnt
protected

number of command tokens

Referenced by isMine(), and setCommand().

char UFunctionBase::commandsHandled[MAX_RESOURCE_LIST_SIZE]
protected

Space separated list of handled commands

Referenced by commandList(), setCommand(), and UFunctionBase().

char UFunctionBase::ldFileName[MAX_FILENAME_LENGTH]
private

Filename for loaded module

Referenced by getLoadedFileName(), isStatic(), print(), setLoadedModuleRef(), and UFunctionBase().

void* UFunctionBase::ldModule
private

Handle for loaded module

Referenced by getLoadedModuleRef(), print(), setLoadedModuleRef(), and UFunctionBase().

const int UFunctionBase::MAX_ID_LENGTH = 30
static

Max size of one command ID string

Referenced by UFunctionPoseHist::setAliasName(), setAliasName(), setCommand(), and UCmdExe::sysModuleCmd().

const int UFunctionBase::MAX_RESOURCE_LIST_SIZE = 250
static

Maximum length of resource list

Referenced by UFunctionPoseHist::setAliasName(), setCommand(), setName(), and UFunctionBase().

UServerInMsg* UFunctionBase::msg
protected
char UFunctionBase::pluginName[MAX_RESOURCE_LIST_SIZE]
protected

Plugin name - if a module can be loaded multible times with different names

Referenced by name(), setCommand(), and setName().

bool UFunctionBase::silent
bool UFunctionBase::verboseMessages
protected

Print more status messages to console, when 'verboseMessages' are true. Mostly for debug.

Referenced by UFuncCropRow::findPlants(), setVerbose(), and UFunctionBase().


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