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

#include <ucampool.h>

Inheritance diagram for UCamPool:
Inheritance graph

Public Member Functions

void closeImageLogging ()
 
bool findDevices ()
 
void flushClientCmds (int clientIdx)
 
UCamPushgetCam (int device)
 
UCamPushgetCam (const char *posName)
 
UCamPushgetCamByPoolIndex (int index)
 
int getDeviceCount ()
 
int getFirstCamDevice ()
 
const char * getImagelogFilename ()
 
bool gotAllResources (char *missingThese, int missingTheseCnt)
 
bool isImagelogOpen ()
 
bool isLogPng ()
 
bool isLogSaveImg ()
 
UCamPushmakeDevice (int devNum, const char *posName)
 
bool openImageLogging (const char *name)
 
bool openImageLogging ()
 
virtual void print (const char *preString)
 
virtual const char * print (const char *preString, char *buff, int buffCnt)
 
bool saveSettings (Uconfig *ini)
 
virtual void saveSettings ()
 
void setCmdExe (UCmdExe *executor)
 
void setLogPng (bool value)
 
void setLogSaveImg (bool value)
 
bool setResource (UResBase *resource, bool remove)
 
void setVerbose (bool value)
 
 UCamPool ()
 
void UCamPoolInit ()
 
virtual ~UCamPool ()
 
- 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)
 
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)
 
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)
 
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)
 
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 ()
 
- Static Public Member Functions inherited from UResVarPool
static const char * getResClassID ()
 

Protected Member Functions

void createBaseVar ()
 
virtual bool decodeReplayLine (char *line)
 
- 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

UImageLogimageLog
 
UVariablevarCams
 camera devices More...
 
UVariablevarCamsCnt
 number of camera devices More...
 
UVariablevarUseGigE
 guppy support More...
 
UVariablevarUseGuppy
 guppy support More...
 
UVariablevarUseIeeeOld
 guppy support More...
 
- 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

UCamPushcam [MAX_MOUNTED_CAMERAS]
 
int camCnt
 
UCmdExecmdExe
 
UImagePoolimgPool
 
bool verboseMessages
 

Additional Inherited Members

- Public Attributes inherited from UReplay
bool replayTimeAdvancePending
 
UTime replayTimeNow
 
- Static Protected Attributes inherited from UReplay
static const int MAX_LOG_LINE_LENGTH = 10000
 
static const int REPLAY_FILE_NAME_LENGTH = 264
 max length of replay filename More...
 

Detailed Description

Pool of cameras mounted on a robot.

Author
Christian Andersen

Constructor & Destructor Documentation

UCamPool::UCamPool ( )
inline
UCamPool::~UCamPool ( )
virtual

destructor

References cam, camCnt, UCamBase::getDev(), and imageLog.

Referenced by UCamPool().

Member Function Documentation

void UCamPool::closeImageLogging ( )

Close logfile - and stop logging

References UImageLog::closeLogging(), imageLog, and ULogFile::isOpen().

Referenced by getImagelogFilename(), and UFunctionImage::handleImageGetCommand().

void UCamPool::createBaseVar ( )
protected
bool UCamPool::decodeReplayLine ( char *  line)
protectedvirtual
bool UCamPool::findDevices ( )
void UCamPool::flushClientCmds ( int  clientIdx)

Flush all active commands from (a dead) client

References cam, and camCnt.

Referenced by getCamByPoolIndex().

UCamPush * UCamPool::getCam ( int  device)
UCamPush * UCamPool::getCam ( const char *  posName)

Get a camera device from the camera position name, i.e. 'cameraLeft'

References cam, camCnt, and UCamMounted::getPosName().

UCamPush* UCamPool::getCamByPoolIndex ( int  index)
inline

Get camera by index number in cam-pool. this may not be in device order

References cam, flushClientCmds(), print(), and saveSettings().

Referenced by UFunctionCamBase::getImage(), and UFunctionCam::handleCamsGetCommand().

int UCamPool::getDeviceCount ( )
inline

Get camera device count

References camCnt.

Referenced by UFunctionCamBase::getImage(), and UFunctionCam::handleCamsGetCommand().

int UCamPool::getFirstCamDevice ( )

Get first camera device number.

Returns
-1 if no camera is available, else device number of first camera.

References cam, camCnt, UCamBase::getDev(), and UCamDevBase::getDeviceNumber().

Referenced by UFunctionCamBase::getDefaultCamDevice(), and setVerbose().

const char* UCamPool::getImagelogFilename ( )
inline
static const char* UCamPool::getResClassID ( )
inlinestatic

Resource ID for this class

Referenced by UFunctionCamBase::setResource(), and UCamPool().

bool UCamPool::gotAllResources ( char *  missingThese,
int  missingTheseCnt 
)
virtual

Test if pool has all needed resources.

Reimplemented from UResVarPool.

References cmdExe, and UCmdExe::getResClassID().

Referenced by getImagelogFilename().

bool UCamPool::isImagelogOpen ( )
inline
bool UCamPool::isLogPng ( )
inline

is image log format PNG

References imageLog, and UImageLog::isPng().

Referenced by UFunctionCam::handleCamSetCommand().

bool UCamPool::isLogSaveImg ( )
inline

Is image logging set to save image itself too?

References imageLog, and UImageLog::isLogSaveImg().

Referenced by UFunctionImage::handleImageGetCommand().

UCamPush * UCamPool::makeDevice ( int  devNum,
const char *  posName 
)
bool UCamPool::openImageLogging ( const char *  name)

Open logfile - same as request logging of images

References imageLog, ULogFile::isOpen(), and UImageLog::openLogging().

Referenced by UFunctionCam::handleCamSetCommand(), and UFunctionImage::handleImageGetCommand().

bool UCamPool::openImageLogging ( )
inline

Open image logging in default logfile

Referenced by saveSettings().

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

Print the state of cameras

Reimplemented from UResBase.

Referenced by findDevices(), and getCamByPoolIndex().

const char * UCamPool::print ( const char *  preString,
char *  buff,
int  buffCnt 
)
virtual

Print the state of cameras to a string buffer

Reimplemented from UResVarPool.

References cam, camCnt, MAX_MOUNTED_CAMERAS, and UCamPush::print().

bool UCamPool::saveSettings ( Uconfig ini)

Save camera settings to configuration file. This saves the settings if the position name is different from the default 'posUnknown'. If the position is 'posUnknown', then the position name is set to 'posD' (D beeing the device number) and the parametes are set under this name. If two cameras has the same position name, then the last are assigned a new name. If 'ini' is NULL, then the values are saved in the default config-file.

virtual void UCamPool::saveSettings ( )
inlinevirtual

Save settings to default configuration file - the file mentioned in the global string configFileCal (defined in ugen4/ucommon.h.

Reimplemented from UResBase.

References openImageLogging().

Referenced by getCamByPoolIndex().

void UCamPool::setCmdExe ( UCmdExe executor)
inline

Set command executor

References cmdExe.

void UCamPool::setLogPng ( bool  value)
inline

set image log format

References imageLog, and UImageLog::setPng().

Referenced by UFunctionCam::handleCamSetCommand().

void UCamPool::setLogSaveImg ( bool  value)
inline

Set image logging set to save image itself or not.

References imageLog, and UImageLog::setSaveImg().

Referenced by UFunctionImage::handleImageGetCommand().

bool UCamPool::setResource ( UResBase resource,
bool  remove 
)
virtual
void UCamPool::setVerbose ( bool  value)
inline

Resource version of this class Set verbose messages - mostly for debug purpose

References findDevices(), getCam(), getFirstCamDevice(), makeDevice(), and verboseMessages.

void UCamPool::UCamPoolInit ( )

Member Data Documentation

UCamPush* UCamPool::cam[MAX_MOUNTED_CAMERAS]
private
int UCamPool::camCnt
private
UCmdExe* UCamPool::cmdExe
private

Command executor for push commands.

Referenced by findDevices(), gotAllResources(), makeDevice(), setCmdExe(), setResource(), and UCamPoolInit().

UImageLog* UCamPool::imageLog
protected
UImagePool* UCamPool::imgPool
private

Image pool pointer for push buffer images

Referenced by decodeReplayLine(), setResource(), and UCamPoolInit().

UVariable* UCamPool::varCams
protected

camera devices

Referenced by createBaseVar(), findDevices(), and makeDevice().

UVariable* UCamPool::varCamsCnt
protected

number of camera devices

Referenced by createBaseVar(), findDevices(), and makeDevice().

UVariable* UCamPool::varUseGigE
protected

guppy support

Referenced by createBaseVar().

UVariable* UCamPool::varUseGuppy
protected

guppy support

Referenced by createBaseVar().

UVariable* UCamPool::varUseIeeeOld
protected

guppy support

Referenced by createBaseVar().

bool UCamPool::verboseMessages
private

Print more when relevant

Referenced by findDevices(), setVerbose(), and UCamPoolInit().


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