AURobotServers
4
|
#include <uvariable.h>
Public Types | |
enum | varType { none, d, s, d3d, d2d, d6d, dq, t, pose, rot, m2, i, b } |
Public Member Functions | |
double | add (double value, int idx=0, UTime *updTime=NULL) |
int | cols () |
void | copy (const UVariable *source, bool alsoName) |
bool | descriptionBufferUsed () const |
UPosition | get3D () const |
UPosRot | get6D () const |
bool | getBool (const int idx=0) |
int | getByteCnt () const |
virtual const char * | getDataType () |
double | getDouble (const int idx=0) |
int | getElementCnt () const |
virtual int | getElementCnt2 () const |
float | getFloat (const int idx=0) |
const char * | getGetAsXmlAttribute (char *buff, const int buffCnt) |
int | getInt (const int idx=0) |
bool | getM (matrix *mat) |
bool | getM (UMatrix *mat) |
UVarPool * | getParent () |
UPose | getPose () const |
UPoseTime | getPoseTime () const |
URotation | getRot () const |
int | getSize () |
const char * | getString (const int idx=0) const |
UTime | getTime (const int idx=0) |
UVariable::varType | getType () const |
const char * | getTypeChar (char *to, const int toCnt) |
bool | getValueBool (const int idx=0) |
const char * | getValueBuffer () const |
double | getValued (const int idx) |
double | getValued () const |
const char * | getValuedAsString (int idx, const char *preStr, char *buff, const int buffCnt, int histIdx=0) |
int | getValueInt (const int idx=0) |
const char * | getValues (const int idx=0) const |
const char * | getValuesAsString (char *buff, const int buffCnt, int histIdx) |
const char * | getValuesAsStringQuoted (char *buff, const int buffCnt, int histIdx) |
double * | getValuesd () |
const char * | getValuesdAsString (char *buff, const int buffCnt, int histIdx) |
const char * | getValuesmAsString (char *buff, const int buffCnt) |
const char * | getValuesmAsStringLimited (char *buff, const int buffCnt, int maxRows, int maxCols) |
void | inverse () |
inverse - element by element inverse all values one by one, i.e. a = 1.0/a. if |a| < 1e-100, then a is set to +1e100 Works on double based variables only. More... | |
virtual bool | isAlsoA (const char *typeString) |
bool | isDouble () const |
bool | isString () const |
bool | isTypeA (const varType testType) |
bool | makeTimeSeries (int histCnt, double maxUpdateRate) |
void | negate () |
negate - element by element Negate value of this variable, i.e. change sign of all values. Works on double based variables only. More... | |
bool | openVarLog (bool logFileOpen) |
int | rows () |
void | saveToLog (ULogFile *logFile, const char *prename, ULock *fileLock) |
bool | set3D (UPosition *value, UTime *updT=NULL) |
bool | set6D (UPosRot *value, UTime *updT=NULL) |
bool | setAll (double value) |
bool | setBinaryAnd (UVariable *left, UVariable *right) |
element by element binary AND values Make this variable an array of same size as left and right, with the values: this[i]= long(left[i]) & long(right[i]) More... | |
bool | setBinaryOr (UVariable *left, UVariable *right) |
element by element binary OR values Make this variable an array of same size as left and right, with the values: this[i]= long(left[i]) & long(right[i]) More... | |
bool | setBinaryShiftLeft (UVariable *left, UVariable *right) |
element by element bit shift left Make this variable an array of same size as left,and shift based on first element of right with the values: this[i]= double(long(left[i]) << long(right[0])) More... | |
bool | setBinaryShiftRight (UVariable *left, UVariable *right) |
element by element bit shift right Make this variable an array of same size as left,and shift based on first element of right with the values: this[i]= double(long(left[i]) << long(right[0])) More... | |
bool | setBinaryXor (UVariable *left, UVariable *right) |
element by element binary XOR values Make this variable an array of same size as left and right, with the values: this[i]= long(left[i]) ^ long(right[i]) More... | |
bool | setBool (bool value, const int idx=0, bool mayAdd=false, UTime *updT=NULL) |
const char * | setDescription (const char *desc, bool makeCopy) |
bool | setDiff (UVariable *left, UVariable *right) |
element by element difference of values Make this variable an array of same size as left and right, with the values: this[i]= left[i] - right[i] More... | |
bool | setDivide (UVariable *left, UVariable *right) |
element by element division of values Make this variable an array of same size as left and right, with the values: this[i]= left[i] / right[i] More... | |
bool | setDouble (double value, const int idx=0, bool mayAdd=false, UTime *updT=NULL) |
bool | setDouble (double *values, const int valuesCnt, UTime *updT=NULL) |
bool | setEq (UVariable *left, UVariable *right) |
Equal Sets the value of this variable (size 1) to 1 if all the elements in left is (exactly) equal to the one on the right. The left and right size must be equal. Else the value is 0. More... | |
bool | setGe (UVariable *left, UVariable *right) |
Greater or equal- element by element Make this variable an array of same size as left and right, with the values this[i]=1.0 if left[i] is >= right[i], else 0.0. More... | |
bool | setGt (UVariable *left, UVariable *right) |
Greater than - element by element Make this variable an array of same size as left and right, with the values this[i]=1.0 if left[i] is > right[i], else 0.0. More... | |
bool | setInt (int value, const int idx=0, bool mayAdd=false, UTime *updT=NULL) |
bool | setLe (UVariable *left, UVariable *right) |
Less than or equal - element by element Make this variable an array of same size as left and right, with the values this[i]=1.0 if left[i] is <= right[i], else 0.0. More... | |
bool | setLogicalAnd (UVariable *left, UVariable *right) |
element by element logical And values Make this variable an array of same size as left and right, with the values: this[i]= left[i] and right[i] More... | |
bool | setLogicalOr (UVariable *left, UVariable *right) |
element by element logical OR values Make this variable an array of same size as left and right, with the values: this[i]= left[i] or right[i] More... | |
bool | setLt (UVariable *left, UVariable *right) |
Less than - element by element Make this variable an array of same size as left and right, with the values this[i]=1.0 if left[i] is < right[i], else 0.0. More... | |
bool | setModulo (UVariable *left, UVariable *right) |
element by element modulo operation Make this variable an array of same size as left,and operate based on first element of right with the values: this[i]= double(long(left[i]) % long(right[0])) More... | |
void | setName (const char *newName, int *idx=NULL) |
bool | setNe (UVariable *left, UVariable *right) |
Not equal Sets the value of this variable (size 1) to 1 if one or more of the elements in left is not (exactly) equal to the one on the right. The left and right size must be equal. Else the value is 0. More... | |
bool | setNot () |
set all element to the negated value of the current value. More... | |
void | setParent (UVarPool *value) |
bool | setPlus (UVariable *left, UVariable *right) |
element by element sum of values Make this variable an array of same size as left and right, with the values: this[i]= left[i] + right[i] More... | |
bool | setPose (UPose *value, UTime *updT=NULL) |
bool | setPose (UPoseTime *value, UTime *updT=NULL) |
bool | setPow (UVariable *left, UVariable *right) |
element by element power operation Make this variable an array of same size as left,and operate based on first element of right with the values: this[i]= pow(left[i], right[0]) More... | |
bool | setProduct (UVariable *left, UVariable *right) |
element by element product of values Make this variable an array of same size as left and right, with the values: this[i]= left[i] * right[i] More... | |
bool | setRot (URotation *value, UTime *updT=NULL) |
int | setSize (int rows, int cols) |
int | setSize (int elements) |
bool | setString (const char *attValue, const int idx, bool mayAdd, UTime *updT=NULL) |
bool | setTime (UTime t, const int idx=0) |
bool | setTimeNow (const int idx=0) |
bool | setType (varType newType) |
bool | setTypeChar (const char *to) |
bool | setUnit () |
bool | setValue (const UVariable *source, const int idx, UTime *updT=NULL) |
bool | setValued (double value, const int ix=0, bool mayAdd=false, UTime *updT=NULL) |
bool | setValued (const char *attValue, const int idx, bool mayAdd, UTime *updT=NULL) |
bool | setValueM (UMatrix *mat, UTime *updT=NULL) |
bool | setValueM (matrix *mat, UTime *updT=NULL) |
bool | setValueM (int rCnt, int cCnt, double *values, UTime *updT=NULL) |
bool | setValueNew (const char *newName, const char *attValue, const char *type, const char *comment) |
bool | setValues (const char *attValue, const int idx, bool mayAdd, UTime *updT=NULL) |
virtual void | snprint (const char *preString, char *buff, const int buffCnt) |
void | updateQtTest (float holdTime) |
UVariable () | |
UVariable (UVariable *source) | |
virtual | ~UVariable () |
Public Member Functions inherited from UDataBase | |
bool | isA (const char *typeString) |
UDataBase () | |
virtual | ~UDataBase () |
Public Member Functions inherited from UVarLog | |
void | changed (double *data, bool isDouble=true, UTime *updTime=NULL) |
int | getHistoryRows () |
const char * | getLogFilename () |
int | getMeanMinMax (int element, UTime toTime, double *mean, double *min, double *max, int sampleInterval=1) |
UMatrix * | getTimeSeries (UMatrix *buffer, int maxRows) |
int | getTimeVector (double *buffer, int bufferCnt, int element) |
UTime | getUpdTime () |
int | getVectorToTime (double *buffer, int bufferCnt, int element, UTime tot, int interval, double *gotdt) |
bool | hasHist () const |
bool | makeHist (int histCnt, int elementCnt, double maxUpdateRate) |
bool | openLog (bool doOpen, const char *preName=NULL, const char *varName=NULL) |
bool | setMaxUpdateRate (double maxUpdateRate) |
bool | setReplay (bool doOpen, const char *preName, const char *varName, UReplay *replayParent) |
UVarLog () | |
virtual | ~UVarLog () |
Static Public Member Functions | |
static bool | splitNameIndex (const char *nameWithIndex, int *index, int *col, int *nameLng) |
static varType | typeFromChar (const char *typ) |
Public Attributes | |
const char * | description |
char | name [MAX_VAR_NAME_SIZE+1] |
Public Attributes inherited from UVarLog | |
UVarHist * | hist |
Protected Member Functions | |
virtual bool | decodeReplayLine (char *line) |
void | setUpdated (UTime *updTime=NULL) |
Protected Attributes | |
int | byteCnt |
varType | dataType |
double * | dValue |
int | elementCnt |
int | elementSize |
bool | isDoubleBased |
UVarPool * | parent |
UTime | updTimeLast |
UTime | updTimeNewest |
Private Attributes | |
char * | descriptionBuffer |
A variable for the calculator
enum UVariable::varType |
UVariable::UVariable | ( | ) |
Constructor
References byteCnt, d, dataType, description, descriptionBuffer, dValue, elementCnt, elementSize, isDoubleBased, name, and parent.
UVariable::UVariable | ( | UVariable * | source | ) |
Copy constructior
References byteCnt, copy(), descriptionBuffer, dValue, elementCnt, and parent.
|
virtual |
Destructor
References byteCnt, description, descriptionBuffer, dValue, and elementCnt.
double UVariable::add | ( | double | value, |
int | idx = 0 , |
||
UTime * | updTime = NULL |
||
) |
Add a value to this double sized variable
value | to add |
idx | optional index to the value |
updTime | set to this update time if relevant (relevant if variable has history) |
References getValued(), and setValued().
Referenced by UFuncV4lGst::busCall(), UFuncKinect::callGotNewDataWithObject(), UResIf::connectionChange(), UFuncKinect::decodeReplayLine(), UImagePool::decodeReplayLine(), UNamedBoxes::doDetect(), UResDrivePos::driveOdo(), UResRoadDrive::driveSide(), UImgPush::fillBuffer(), UImgPush::fillShowBuffer(), UImagePool::getImage(), getType(), UResCamIfCam::gotNewData(), UFuncLocalize::handleLocalize(), UFuncLoca2::handleLocalize(), UFuncLocalize::handleLocalizeMHF(), UFuncLocalize::handleLocalizeUKF(), UResBin::handleNewData(), UResLaserIfObst::handleObst(), UFuncStereo::handleStereo(), UQtgui::imgPanEvent(), UImgPush::imgUpdated(), UResLocater::locate(), UFuncPTgrey::Receiver(), UFuncImu::run(), UVarPool::setLocalVarAdd(), UCmdExe::sysModuleCmd(), UKeepItem::tick(), UQtgui::topPanLeft(), UResPoseHist::updateVarPool(), and UFuncV4lGst::useBuffer().
int UVariable::cols | ( | ) |
Get number of rows for this variable.
References dataType, dValue, elementCnt, m2, and roundi().
Referenced by getParent(), getValuesdAsString(), getValuesmAsStringLimited(), UFunctionVarPool::sendVar(), UFunctionVarPool::sendVarList(), setName(), setSize(), setUnit(), and testVar().
void UVariable::copy | ( | const UVariable * | source, |
bool | alsoName | ||
) |
Copy the content of the source variable to this variable
source | - the data source. |
References byteCnt, dataType, description, descriptionBuffer, descriptionBufferUsed(), dValue, elementCnt, elementSize, getByteCnt(), getElementCnt(), getType(), UVarHist::getUpdTime(), getValueBuffer(), UVarLog::hasHist(), UVarLog::hist, i, isDouble(), m2, MAX_VAR_NAME_SIZE, name, setDescription(), setType(), setUpdated(), and t.
Referenced by UVarCalc::evaluateV(), UVarCalc::getValueAnyV(), getValues(), UVarCalc::getVariableAny(), UMisRuleState::methodCallV(), UResRuleState::methodCallV(), UVarPool::setLocalVar(), UVarCalcOper::setValue(), setValue(), and UVariable().
|
protectedvirtual |
Decode this replay line, that is assumed to be valid.
line | is a pointer to the line. |
Reimplemented from UVarLog.
References dValue, elementCnt, isDoubleBased, UTime::setTimeU(), setUpdated(), t, and UTime::valid.
Referenced by descriptionBufferUsed().
|
inline |
Is the description buffer used
References decodeReplayLine(), description, descriptionBuffer, setAll(), setUnit(), setUpdated(), and updateQtTest().
Referenced by copy().
UPosition UVariable::get3D | ( | ) | const |
Get first 3 values in a UPosition structure
References dValue, elementCnt, and UPosition::set().
Referenced by UResAvoid::codeXmlRobotFront(), UResAvoid::findPathToHere(), UVarPool::getLocalValue3D(), getValues(), UResPcp::methodCallV(), UResPoly::methodCallV(), and UFuncView::run().
UPosRot UVariable::get6D | ( | ) | const |
Get first 6 values in a UPosRot structure
References dValue, elementCnt, and UPosRot::set().
Referenced by UVarPool::getLocalValue6D(), UCamMounted::getPos(), UCamMounted::getPosCC(), UCamMounted::getRot(), and getValues().
|
inline |
Get boolean type value of this variable
idx | variable may be an array, so an index is provided |
References getInt(), getTime(), getValueBool(), and setValued().
Referenced by UFuncPCLTest::CalcMapFromCloud(), UFuncKinect::callGotNewDataWithObject(), UResAvoid::copyAvoidObstacles(), UResAvoid::copyCellPolys(), UResAvoid::copyFootprintPolys(), UResPassable::doFullAnalysis(), UResLocater::doLocatorUpdates(), UResPassable::doObstAnalysis(), UFuncPpl::drawPolygons(), UImgPush::fillBuffer(), UImgPush::fillShowBuffer(), UResAvoid::findPathToHere(), UImagePool::getImage(), UResKeep::getKeepList(), UFakeDevice::getNewestData(), UResObstacle::getObstacleGroupSettings(), UResObstacle::getOutdoorExtraDist(), UResAuEf::getParams(), UResPassable::getSettingsFromVarPool(), UFuncKinect::GetXYZCoordinates(), UResCamIfCam::gotNewData(), UFuncPlan::handleAddCon(), UFuncPlan::handleAddPoint(), UFuncImu::handleCommand(), UFuncRadar::handleCommand(), UFuncPlan::handleFindRoute(), UFuncPlan::handleGetPoint(), UFunctionCamGmk::handleGmkGetCommand(), UFuncKinect::handleKinect(), UFuncPiCam::handleNormal(), UResLaserIfObst::handleObst(), UResIfVar::handlePoseHist(), UFuncPTgrey::handlePTgrey(), UFuncPlan::handleResetPlan(), UFuncStereo::handleStereo(), UResIfVar::handleVar(), UImgPush::imgUpdated(), UFuncStereo::initializeStereo(), UResIf::interfaceTick(), UResRhdIf::isConnected(), UCamDevBase::isLog(), UResObstacle::isOutdoorContext(), UCamDevBase::isReplay(), UResRhdIf::isWriteGranted(), UResRhdIf::isWriteRequested(), UResLocater::locate(), UResLobst::makeObst(), UMisRuleState::methodCall(), UFunctionPassable::polygonToPolyPlugin(), UResLocater::polygonToPolyPlugin(), UFuncStraightLine::polygonToPolyPlugin(), UKeepItem::print(), UFuncKinect::processDepthImages(), UFuncStereo::processImages(), UResIf::quitRemoteEnd(), UResLocater::rowEndDetect(), UFuncImu::run(), UFuncView::run(), UResRhdIf::run(), UFuncPiCam::run(), UFuncKinect::run(), UFuncRadar::run(), UResKeep::run(), UFuncRadar::runRead(), UFuncPTgrey::runSetting(), UResLobst::sendAsObstacles(), UResSmrCtl::sendNewManoeuvreToSMR(), UFuncLaserBox::sendToPolyPlugin(), UResLocater::set_state(), UResLocater::set_utmstate(), UImgPush::setTcpPort(), UResLocater::setUtmPoseToMapPose(), UResSmrCtl::start(), UResSmrCtl::startPoseStreaming(), startUFuncTOFThreadData(), UKeepItem::tick(), UResRhdIf::tryConnect(), UFuncKinect::updateCloud(), UResPoseHist::updateVarPool(), UResAvoid::useRev2(), and UFuncKinect::~UFuncKinect().
|
inline |
|
inlinevirtual |
|
inline |
Supplementary call
idx | variable may be an array, default is 0 |
References getValued().
Referenced by UFuncPCLTest::CalcMapFromCloud(), UFuncLoca2::correlateLines(), UNamedBox::doDetect(), UImgPush::fillBuffer(), UImgPush::fillShowBuffer(), UFuncBall::findBall(), UFuncBallKL::findBallCandidates(), UFuncPiPi::findBallCandidates(), UFuncBall::findBallCandidates(), UFuncBall_improved::findBallCandidates(), UResAvoid::findPathToHere(), UFuncImSeg::findSegments(), UFakeDevice::getNewestData(), UResObstacle::getObstacleGroupSettings(), UFuncKinect::GetXYZCoordinates(), UFuncCropRow::handleCommand(), UFuncPpl::handleCommand(), UFuncLocalize::handleLocalize(), UFuncLoca2::handleLocalize(), UFuncLocalize::handleLocalizeMHF(), UFuncLocalize::handleLocalizeUKF(), UFuncStereo::handleStereo(), UQtgui::imgPanEvent(), UCamRad::lensParChanged(), UResLocater::locate(), UFuncPCLTest::MakeMap(), UResLobst::makeObst(), UFuncLoca2::markBestJointMatches(), UResLocater::match_points(), UResRuleState::methodCallV(), UFuncView::run(), UFuncKinect::run(), UCmdExe::run(), UServerPort::serviceClients(), UNamedBox::setCornersAsPolygon(), UQtgui::topPanLeft(), UQtgui::topViewZoomIn(), UQtgui::topViewZoomOut(), UFuncLoca2::updateDisplacement(), and UCamRad::updateLensParams().
|
inline |
Get number of elements, i.e. 3 for a 3d type or elements in a vector or an array. if a string, then the length of the string (as returned by strlen())
References elementCnt.
Referenced by copy(), UVarCalc::evaluateV(), UVarPool::getLocalValue(), UFuncPiPi::handleCommand(), UFuncStereo::initializeStereo(), UResRuleState::methodCallV(), openVarLog(), UResRhdIf::run(), setBinaryAnd(), setBinaryOr(), setBinaryShiftLeft(), setBinaryShiftRight(), setBinaryXor(), setDiff(), setDivide(), setEq(), setGe(), setGt(), setLe(), setLogicalAnd(), setLogicalOr(), setLt(), setModulo(), setNe(), setPlus(), setPow(), setProduct(), setValue(), and testVar().
|
inlinevirtual |
Get number of elements as getElementCnt() (used virtually from time series subclass)
Reimplemented from UVarLog.
References elementCnt.
|
inline |
Supplementary call
idx | variable may be an array, default is 0 |
References getValued().
const char * UVariable::getGetAsXmlAttribute | ( | char * | buff, |
const int | buffCnt | ||
) |
make an attribute string from the name and value of this variable
buff | is the string buffer to hold the result |
buffCnt | is the length of the buffer |
References elementCnt, getValuedAsString(), i, and name.
Referenced by getType(), and setValued().
int UVariable::getInt | ( | const int | idx = 0 | ) |
Get integer type value of this variable
idx | variable may be an array, so an index is provided |
References d, getValued(), and roundi().
Referenced by UFuncKinect::callGotNewDataWithObject(), UResAvoid::copyCellPolys(), UFuncKinect::decodeReplayLine(), UFuncFz::doClassify(), UNamedBoxes::doDetect(), UFuncImSeg::doGrayLevelCooccurenceMatrix(), UFuncImSeg::doLBPhistogramMatch(), UFuncBallKL::filterMask(), UFuncPiPi::filterMask(), UFuncCropRow::filterMask(), UFuncBall::filterMask(), UFuncBall_improved::filterMask(), UFuncLinefinder::filterMask(), UFuncBallKL::findBall(), UFuncPiPi::findBall(), UFuncBall::findBall(), UFuncBall_improved::findBall(), UFuncBallKL::findBallCandidates(), UFuncPiPi::findBallCandidates(), UFuncBall::findBallCandidates(), UFuncBall_improved::findBallCandidates(), UFuncImSeg::findBestCoooccurrence(), UResAvoid::findPathToHere(), UFuncCropRow::findPlants(), UFuncImSeg::findSegments(), UFuncTracking::FirstImage(), getBool(), UResObstacle::getFixedObstCnt(), UImagePool::getImage(), UResAuEf::getParams(), UResRhdIf::getPort(), UResPassable::getSettingsFromVarPool(), UImgPush::getTcpPort(), UFuncKinect::GetXYZCoordinates(), UResCamIfImg::gotNewImage(), UFuncBall_improved::handleCommand(), UFuncBallKL::handleCommand(), UFuncPiPi::handleCommand(), UFuncCropRow::handleCommand(), UFuncPpl::handleCommand(), UFuncStraightLine::handleCommand(), UFuncLinefinder::handleCommand(), UFuncV4lGst::handleCommand(), UFuncFz::handleCommand(), UFuncLaserBox::handleCommand(), UFunctionCamGmk::handleGmkGetCommand(), UFuncImgPoly::handleImgPolyCommand(), UFuncKinect::handleKinect(), UFuncLoca2::handleLocalize(), UFuncPiCam::handleNormal(), UFuncPTgrey::handlePTgrey(), UFuncStereo::handleStereo(), UFuncLinefinder::houghTest(), UImgPush::imgUpdated(), UFuncFz::initializeClassesFromLine(), UFuncStereo::initializeStereo(), UResIf::interfaceTick(), UFuncFz::loadNewImage(), UFuncPiCam::logFileTest(), UFuncKinect::logFileTest(), UFuncPiCam::logImageToFile(), UFuncPTgrey::logImageToFile(), UFuncKinect::logImageToFile(), UFuncTOF::logImageToFile(), UFuncImSeg::makeLBPimage(), UFuncPCLTest::MakeMap(), UFuncKinect::makeObj3Dcloud(), UResLobst::makeObst(), UFuncBallKL::maskColors(), UFuncPiPi::maskColors(), UFuncBall::maskColors(), UFuncBall_improved::maskColors(), UFuncLinefinder::maskColors(), UFuncImSeg::meanShiftSegment(), UFuncKinect::methodCall(), UResPcp::methodCallV(), UResPoly::methodCallV(), UResIf::openConnection(), UKeepItem::print(), UFuncTOF::processChannel8(), UFuncKinect::processDepthImages(), UFuncStereo::processImages(), UFuncTOF::processImages(), UResLocater::quality(), UFuncPTgrey::Receiver(), UFuncImu::run(), UFuncView::run(), UResRhdIf::run(), UImgPush::run(), UFuncPiCam::run(), UFuncKinect::run(), UFuncRadar::run(), UFuncV4lGst::run(), UFuncPiCam::runAlive(), UFuncPTgrey::runSetting(), UFuncTOF::runSetting(), UResLaserIfScan::snprint(), startUFuncTOFThreadData(), UCmdExe::sysModuleCmd(), UFuncTracking::TrackObjects(), UResRhdIf::tryConnect(), UFuncKinect::updateCloud(), UFuncV4lGst::useBuffer(), and UCamDevGuppy::~UCamDevGuppy().
bool UVariable::getM | ( | matrix * | mat | ) |
Get values to a matrix structure.
The mat matrix must be initialized, and the size of the matrix will not be changed. If the size of this matrix do not match mat, then no data is loaded into mat, and function returns false.
mat | is a IAU matrix, where the result will be placed. |
References dataType, dValue, m2, and roundi().
Referenced by getValuesd().
bool UVariable::getM | ( | UMatrix * | mat | ) |
Get values to a matrix structure.
The mat matrix must be initialized, and the size of the matrix will not be changed. If the size of this matrix do not match mat, then no data is loaded into mat, and function returns false.
mat | is a openCV matrix (packed into the UMatrix class), where the result will be placed. |
References UMatrix::cols(), dataType, dValue, m2, roundi(), UMatrix::rows(), and UMatrix::setMat().
|
inline |
Get the parent var pool - e.g. to get fully qualified variable name
References cols(), getSize(), parent, rows(), and setSize().
Referenced by UQtgui::updVarEvent(), and UQStandardItem::UQStandardItem().
UPose UVariable::getPose | ( | ) | const |
Get first 3 values in a UPose structure
References dValue, elementCnt, and UPose::set().
Referenced by UVarPool::getLocalValuePose(), getValues(), UResMapObst::methodCallV(), UResAvoid::methodCallV(), UResPoly::methodCallV(), UResRuleState::methodCallV(), and UResLocater::varprint().
UPoseTime UVariable::getPoseTime | ( | ) | const |
Get first 3 values in a UPose structure
References dValue, elementCnt, UPose::set(), and UPoseTime::setPt().
Referenced by getValues().
URotation UVariable::getRot | ( | ) | const |
Get first 3 values in a URotation structure
References dValue, elementCnt, and URotation::set().
Referenced by UVarPool::getLocalValueRot(), and getValues().
int UVariable::getSize | ( | ) |
References dataType, elementCnt, and m2.
Referenced by getParent(), UFunctionVarPool::sendVar(), and setSize().
|
inline |
Get pointer to value of this variable (assuming it is a string).
idx=0 | index to possible starting position of returned string |
References getValues().
Referenced by UTermEmulator::addIfButtons(), UNamedBoxes::findNamedBox(), UVarPool::getGlobalString(), UFuncV4lGst::handleCommand(), UFuncLaserBox::handleCommand(), UResIf::openConnection(), UImgPush::run(), UFuncRadar::run(), and UFuncV4lGst::run().
UTime UVariable::getTime | ( | const int | idx = 0 | ) |
Get UTime type value from this variable
idx | variable may be an array, so an index is provided |
References d, getValued(), and UTime::setTime().
Referenced by UFuncKinect::callGotNewDataWithObject(), getBool(), UResAvoid::getCalcTime(), UResAuEf::getLastUpdateTime(), UResCamIfCam::snprint(), and UResCamIfImg::snprint().
|
inline |
Get data type as a character string to this buffer
to | a character buffer to store result |
toCnt | the size of the buffer |
References add(), dataType, getGetAsXmlAttribute(), getValuedAsString(), getValuesAsString(), getValuesAsStringQuoted(), getValuesdAsString(), getValuesmAsString(), getValuesmAsStringLimited(), setName(), setTypeChar(), splitNameIndex(), and typeFromChar().
Referenced by copy(), and UFunctionVarPool::sendVar().
const char * UVariable::getTypeChar | ( | char * | to, |
const int | toCnt | ||
) |
Get data type as a character string to this buffer
to | a character buffer to store result |
toCnt | the size of the buffer |
References b, d, d2d, d3d, d6d, dataType, dq, i, m2, pose, rot, s, and t.
Referenced by isString(), saveToLog(), and UFunctionVarPool::sendVar().
bool UVariable::getValueBool | ( | const int | idx = 0 | ) |
Get boolean type value of this variable
idx | variable may be an array, so an index is provided |
References getValued(), and isDouble().
Referenced by UTermEmulator::addIfButtons(), UResPoseHist::addIfNeeded(), getBool(), getValueInt(), UKeepItem::isWait(), UResCamIfGmk::newDataAvailable(), and UCmdExe::run().
|
inline |
Get the base of the variables in this variable.
References dValue.
Referenced by copy(), getValuesAsString(), UVarMethod::methodCallV(), and setValue().
double UVariable::getValued | ( | const int | idx | ) |
Get double type value of this variable
idx | variable may be an array, so an index is provided |
References dataType, dValue, elementCnt, isDouble(), and m2.
Referenced by UResAvoid::copyCellPolys(), UFuncLoca2::correlateLines(), UResPassable::doFullAnalysis(), UResLocater::doLocatorUpdates(), UResPassable::doObstAnalysis(), UResDrivePos::driveOdo(), UResRoadDrive::driveSide(), UMisLoop::evalCondition(), UMisControl::evaluateCondition(), UMisCaseSwitch::evaluateExpr(), UVarCalc::evaluateUnaryValV(), UMisAssign::execute(), UMisIf::execute(), UMisControl::execute(), UFuncBallKL::findBall(), UFuncBall::findBall(), UFuncBall_improved::findBall(), UResAvoid::findPathToHere(), UResRoseBot::findRows(), UResSmrIf::getAcc(), UFuncBall::getBallSize(), UFuncBall_improved::getBallSize(), UVarPool::getGlobalValue(), UVarPool::getLocalValue(), UVarPool::getLocalValueBool(), UResPoseHist::getMinDist(), UResPoseHist::getMinTheta(), UResPoseHist::getMinTime(), UResSmrIf::getMinTurnRad(), UResMapObst::getNearObstacles(), UResObstacle::getObstacleGroupSettings(), UResAuEf::getParams(), UResPassable::getSettingsFromVarPool(), UResSmrIf::getSpeed(), UResSmrIf::getTurnAcc(), UVarCalc::getValueAnyV(), UFuncBallKL::handleCommand(), UFuncRoseBot::handleCommand(), UFuncLocalize::handleLocalize(), UFuncLoca2::handleLocalize(), UFuncLocalize::handleLocalizeMHF(), UFuncLocalize::handleLocalizeUKF(), UFuncLocalize::handleSetInitCov(), UMisRuleState::initCall(), UResIf::interfaceTick(), UCamRad::lensParChanged(), UResLobst::makeObst(), UResLocater::match_points(), UMisRuleState::methodCall(), UMisRuleState::methodCallV(), UResRuleState::methodCallV(), UResLaserIfObst::newDataAvailable(), UResCamIfGmk::newDataAvailable(), UResLaserIfSf::newDataAvailable(), UResLocater::odoPredict(), UKeepItem::print(), UResLocater::rowEndDetect(), UResSmrCtl::run(), UFuncKinect::run(), UFuncTOF::runSetting(), UResSmrCtl::sendNewManoeuvreToSMR(), UFunctionVarPool::sendVar(), setBinaryAnd(), setBinaryOr(), setBinaryShiftLeft(), setBinaryShiftRight(), setBinaryXor(), setDiff(), setDivide(), setEq(), setGe(), setGt(), setLe(), UVarPool::setLocalVar(), setLogicalAnd(), setLogicalOr(), setLt(), setModulo(), setNe(), setPlus(), setPow(), setProduct(), setValue(), UResCamIfCam::snprint(), UResCamIfImg::snprint(), UResLaserIfSf::snprint(), UMisRuleState::step(), UKeepItem::tick(), UCamRad::updateLensParams(), and UResPoseHist::updateVarPool().
|
inline |
Get double type value of this variable
References dValue.
Referenced by add(), getDouble(), getFloat(), getInt(), getTime(), getValueBool(), getValueInt(), getValuesmAsStringLimited(), and isTypeA().
const char * UVariable::getValuedAsString | ( | int | idx, |
const char * | preStr, | ||
char * | buff, | ||
const int | buffCnt, | ||
int | histIdx = 0 |
||
) |
Get value (double type) as string - for data transfer
idx | is the index if variable is an array |
preStr | is optional characters to put in front of value string, e.g. a space |
buff | is the buffer for the result |
buffCnt | is the length of the provided buffer |
References d, dataType, dValue, UVarHist::getData(), UVarLog::hasHist(), UVarLog::hist, and m2.
Referenced by getGetAsXmlAttribute(), getType(), and getValuesdAsString().
|
inline |
Get integer type value of this variable
idx | variable may be an array, so an index is provided |
References getValueBool(), getValued(), and roundi().
Referenced by UKeepItem::tick().
|
inline |
Get the base of the variables in this variable, assuming it is a string.
idx=0 | index to possible starting position of returned string |
References copy(), dValue, get3D(), get6D(), getPose(), getPoseTime(), getRot(), inverse(), negate(), set3D(), set6D(), setBinaryAnd(), setBinaryOr(), setBinaryShiftLeft(), setBinaryShiftRight(), setBinaryXor(), setDiff(), setDivide(), setEq(), setGe(), setGt(), setLe(), setLogicalAnd(), setLogicalOr(), setLt(), setModulo(), setNe(), setNot(), setPlus(), setPose(), setPow(), setProduct(), and setRot().
Referenced by UResRhdIf::getHost(), UCamMounted::getPosName(), getString(), UVarCalc::getValueAnyV(), UResIf::interfaceTick(), UKeepItem::isA(), UKeepItem::monitorTest(), UKeepItem::print(), UFuncImu::run(), UKeepItem::tick(), and UResRhdIf::tryConnect().
const char * UVariable::getValuesAsString | ( | char * | buff, |
const int | buffCnt, | ||
int | histIdx | ||
) |
Get all values - string or double - to this string buffer
buff | is the buffer for the result |
buffCnt | is the length of the provided buffer |
histIdx | is 0 if current value, else time series index |
References getValueBuffer(), getValuesdAsString(), and isString().
Referenced by UVarCalc::evaluateToStringV(), getType(), getValuesAsStringQuoted(), UFunctionVarPool::handleVarValues(), UFunctionVarPool::sendVar(), UFunctionVarPool::sendVarList(), UQtgui::setStruct(), and UQtgui::updVarEvent().
const char * UVariable::getValuesAsStringQuoted | ( | char * | buff, |
const int | buffCnt, | ||
int | histIdx | ||
) |
Get all values - string or double - to this string buffer and pack into quotations marks or apostrophs. If double based quotation marks are used, if string the first part of the string is searched, and if a quotation mark is found (before a apostroph), then string is packed in apostroph.
buff | is the buffer for the result |
buffCnt | is the length of the provided buffer |
References dValue, getValuesAsString(), and isString().
Referenced by getType(), saveToLog(), and UFunctionVarPool::sendVar().
|
inline |
Get array of values as doubles
References dataType, dValue, getM(), m2, and openVarLog().
Referenced by UFuncStereo::initializeStereo(), and UCamRad::updateLensParams().
const char * UVariable::getValuesdAsString | ( | char * | buff, |
const int | buffCnt, | ||
int | histIdx | ||
) |
Get all double values to this string buffer
buff | is the buffer for the result |
buffCnt | is the length of the provided buffer |
histIdx | is 0 if current value, else time series index |
References cols(), dataType, getValuedAsString(), i, isDouble(), m2, and rows().
Referenced by getType(), getValuesAsString(), UFunctionVarPool::sendVarList(), snprint(), and testVar().
const char * UVariable::getValuesmAsString | ( | char * | buff, |
const int | buffCnt | ||
) |
Get string with values of a matrix, where rows are on seperate lines, and values in g format
buff | is the buffer for the result |
buffCnt | is the length of the provided buffer |
References getValuesmAsStringLimited().
Referenced by getType().
const char * UVariable::getValuesmAsStringLimited | ( | char * | buff, |
const int | buffCnt, | ||
int | maxRows, | ||
int | maxCols | ||
) |
Get string with values of a matrix, where rows are on seperate lines, and values in g format Limit the number of raws and columns
buff | is the buffer for the result |
buffCnt | is the length of the provided buffer |
maxRows | is the max number of rows shown |
maxCols | is the maximum number of columns shown |
References cols(), getValued(), i, isDouble(), mini(), and rows().
Referenced by getType(), getValuesmAsString(), and UFunctionVarPool::sendVarList().
void UVariable::inverse | ( | ) |
inverse - element by element inverse all values one by one, i.e. a = 1.0/a. if |a| < 1e-100, then a is set to +1e100 Works on double based variables only.
References dValue, elementCnt, i, and isDoubleBased.
Referenced by getValues(), and UVarCalcOper::inverseValue().
|
virtual |
Function to test if the class or one of its ancestors is of a specific type
Reimplemented from UDataBase.
References getDataType(), and UDataBase::isAlsoA().
Referenced by getDataType().
|
inline |
Test if the data is double based
References isDoubleBased.
Referenced by UVarPool::addVar(), copy(), getValueBool(), getValued(), getValuesdAsString(), getValuesmAsStringLimited(), UMisRuleState::methodCall(), UMisRuleState::methodCallV(), UResRuleState::methodCallV(), setBinaryAnd(), setBinaryOr(), setBinaryShiftLeft(), setBinaryShiftRight(), setBinaryXor(), setDiff(), setDivide(), setEq(), setGe(), setGt(), setLe(), setLogicalAnd(), setLogicalOr(), setLt(), setModulo(), setNe(), setPlus(), setPow(), setProduct(), setUpdated(), and setValued().
|
inline |
Test if the data is a string
References elementSize, getTypeChar(), isDoubleBased, saveToLog(), and setType().
Referenced by UVarPool::addVar(), UVarCalc::evaluateUnaryValV(), UVarCalc::evaluateV(), UVarPool::getGlobalString(), UVarCalc::getValueAnyV(), getValuesAsString(), getValuesAsStringQuoted(), UFunctionVarPool::handleVarValues(), UResRuleState::methodCallV(), UFunctionVarPool::sendVarList(), UVarPool::setLocalVar(), setSize(), setValue(), setValueNew(), setValues(), and snprint().
|
inline |
Test for variable type by a simple string compare. Returns true is exact match - is case sensitive)
References dataType, and getValued().
Referenced by UFunctionVarPool::handleVarValues(), and UFunctionVarPool::sendVarList().
|
inline |
Make time series history for this variable
varCnt | is the size of the time series (number of entries) to be allocated for on-line history. |
maxUpdateRate | maksimum update rate for the time series (in Hz) (must be > 1e-6 Hz) |
References elementCnt, UVarLog::makeHist(), and setDescription().
Referenced by UFuncImu::createResources(), UFunctionVarPool::handleVarValues(), and UVarPool::setLocalVar().
void UVariable::negate | ( | ) |
negate - element by element Negate value of this variable, i.e. change sign of all values. Works on double based variables only.
References dValue, elementCnt, i, and isDoubleBased.
Referenced by UVarCalc::evaluateUnaryValV(), getValues(), and UVarCalcOper::negateValue().
bool UVariable::openVarLog | ( | bool | logFileOpen | ) |
Open logfile for this variable.
logFileOpen | if true, then log is opened (with name of variable extended with '.log. if false, then log is closed. ' |
References getElementCnt(), UVarPool::getFullPreName(), UVarLog::hist, isDoubleBased, name, UVarLog::openLog(), parent, UVarHist::rowMaxCnt, and UVarHist::setHistSize().
Referenced by getValuesd(), UFunctionVarPool::handleVar(), and testVar().
int UVariable::rows | ( | ) |
Get number of rows for this variable.
References dataType, dValue, m2, and roundi().
Referenced by getParent(), getValuesdAsString(), getValuesmAsStringLimited(), UFunctionVarPool::sendVar(), UFunctionVarPool::sendVarList(), setName(), setSize(), setUnit(), and testVar().
Save this variable to logfile
References ULogFile::getF(), UTime::getMicrosec(), UTime::getSec(), getTypeChar(), getValuesAsStringQuoted(), ULogFile::isOpen(), ULock::lock(), name, UTime::now(), s, t, and ULock::unlock().
Referenced by isString(), UVarPool::setLogfile(), and setUpdated().
Set first 3 values from a UPosition structure (order x,y,z)
References setValued(), UPosition::x, UPosition::y, and UPosition::z.
Referenced by UFuncBallKL::findBall(), UFuncBall::findBall(), UFuncBall_improved::findBall(), getValues(), UResPcp::methodCall(), UResPoly::methodCall(), UResPcp::methodCallV(), UResPoly::methodCallV(), UFuncImu::run(), UFuncKinect::run(), and UVarPool::setLocalVar3D().
Set first 6 values from a UPosRot structure (order x,y,z,Omega,Phi,Kappa)
References URotation::Kappa, URotation::Omega, URotation::Phi, setValued(), UPosition::x, UPosition::y, and UPosition::z.
Referenced by getValues(), UResCamIfCam::gotNewData(), UFunctionCamGmk::handleGmkGetCommand(), UResLaserIfScan::handleLaserScan(), UResCamIfGmk::newDataAvailable(), UVarPool::setLocalVar6D(), UCamMounted::setPosOnRobot(), and UCamMounted::setPosOnRobotCC().
bool UVariable::setAll | ( | double | value | ) |
Set all elements in this (double based) variable to this value
value | value to be set into all elements - typically 0.0 or 1.0. |
References dataType, dValue, elementCnt, i, isDoubleBased, m2, and setUpdated().
Referenced by descriptionBufferUsed(), and UFunctionVarPool::handleVarValues().
element by element binary AND values Make this variable an array of same size as left and right, with the values: this[i]= long(left[i]) & long(right[i])
left | is left operator value |
right | is right operator value |
References dValue, getElementCnt(), getValued(), i, isDouble(), and mini().
Referenced by UVarCalcOper::evaluateV(), and getValues().
element by element binary OR values Make this variable an array of same size as left and right, with the values: this[i]= long(left[i]) & long(right[i])
left | is left operator value |
right | is right operator value |
References dValue, getElementCnt(), getValued(), i, isDouble(), and mini().
Referenced by UVarCalcOper::evaluateV(), and getValues().
element by element bit shift left Make this variable an array of same size as left,and shift based on first element of right with the values: this[i]= double(long(left[i]) << long(right[0]))
left | is left operator value |
right | is right operator value |
References dValue, getElementCnt(), getValued(), i, isDouble(), and roundi().
Referenced by UVarCalcOper::evaluateV(), and getValues().
element by element bit shift right Make this variable an array of same size as left,and shift based on first element of right with the values: this[i]= double(long(left[i]) << long(right[0]))
left | is left operator value |
right | is right operator value |
References dValue, getElementCnt(), getValued(), i, isDouble(), and roundi().
Referenced by UVarCalcOper::evaluateV(), and getValues().
element by element binary XOR values Make this variable an array of same size as left and right, with the values: this[i]= long(left[i]) ^ long(right[i])
left | is left operator value |
right | is right operator value |
References dValue, getElementCnt(), getValued(), i, isDouble(), and mini().
Referenced by UVarCalcOper::evaluateV(), and getValues().
|
inline |
Supplementary call to set single value
value | is the value to be set for the index idx |
idx | variable may be an array, default is 0. |
mayAdd | if true and the index is higher than element cnt, then more space is allocated. |
updT | is an optional pointer to the update time (relevant for time series only) |
References setValued(), and setValues().
Referenced by UFuncKinect::callGotNewDataWithObject(), UResIf::connectionHangUp(), UCamPool::createBaseVar(), UFunctionCamGmk::handleGmkGetCommand(), UFuncKinect::handleKinect(), UFuncPiCam::handleNormal(), UFuncPTgrey::handlePTgrey(), UResIf::interfaceTick(), UResPcp::methodCallV(), UResPoly::methodCallV(), UResCamIfPath::newDataAvailable(), UResCamIfGmk::newDataAvailable(), UFuncPTgrey::Receiver(), UFuncTOF::Receiver(), UFuncView::run(), UResRhdIf::run(), UImgPush::run(), UFuncPiCam::run(), UFuncRadar::run(), UFuncV4lGst::run(), UFuncRadar::runRead(), UFuncPTgrey::runSetting(), UImgPush::runShow(), UKeepItem::setAllowOff(), UResLaserIfObst::setLog(), UCamDevBase::setLog(), UImagePool::setLogImg(), UCamDevBase::setReplay(), UKeepItem::setWait(), UResKeep::setWait(), UResRhdIf::setWriteable(), UImagePool::showImagesAsDefault(), UImgPush::startShowing(), UImgPush::startStreaming(), startUFuncTOFThreadData(), UFuncRadar::stop(), UResRhdIf::tryConnect(), UCmdExe::updateLocalVar(), UFuncKinect::updateReplayStatus(), and UImagePool::updateReplayStatus().
const char * UVariable::setDescription | ( | const char * | desc, |
bool | makeCopy | ||
) |
Set description of a variable
desc | is the description. |
makeCopy | if true, then space iss allocated for description, if false then the value is assumed to be stationary in the lifetime of the variable, i.e. the description pointer is set directly to the source |
References description, and descriptionBuffer.
Referenced by copy(), UResIfVar::handleVar(), UFunctionVarPool::handleVarValues(), and makeTimeSeries().
element by element difference of values Make this variable an array of same size as left and right, with the values: this[i]= left[i] - right[i]
left | is left operator value |
right | is right operator value |
References dValue, getElementCnt(), getValued(), i, isDouble(), and mini().
Referenced by UVarCalcOper::evaluateV(), and getValues().
element by element division of values Make this variable an array of same size as left and right, with the values: this[i]= left[i] / right[i]
left | is left operator value |
right | is right operator value |
References dValue, getElementCnt(), getValued(), i, isDouble(), and mini().
Referenced by UVarCalcOper::evaluateV(), and getValues().
|
inline |
Supplementary call to set single value
value | is the value to be set for the index idx |
idx | variable may be an array, default is 0. |
mayAdd | if true and the index is higher than element cnt, then more space is allocated. |
updT | is an optional pointer to the update time (relevant for time series only) |
References setValued().
Referenced by UResIf::connectionChange(), UResAvoid::copyAvoidObstacles(), UResAvoid::copyCellPolys(), UResAvoid::copyFootprintPolys(), UNamedBox::doDetect(), UFuncPpl::drawPolygons(), UResRoadDrive::driveSide(), UResCamIfCam::gotNewData(), UFuncLocalize::handleAddLine(), UFuncLoca2::handleCommand(), UFuncPlan::handleFindRoute(), UFuncLocalize::handleResetLocalizer(), UResIf::interfaceTick(), UFunctionVarPool::makeAMethodCall(), UResObstacle::methodCallV(), UResMapObst::methodCallV(), UFunctionPassable::polygonToPolyPlugin(), UResLocater::polygonToPolyPlugin(), UFuncStraightLine::polygonToPolyPlugin(), UResRhdIf::run(), UCmdExe::run(), UResRoseBot::sendToPolyPlugin(), UKeepItem::setAllow(), UCamRad::setCameraParameters(), UFuncLoca2::updateStatus(), and UFuncLocalize::updateStatus().
bool UVariable::setDouble | ( | double * | values, |
const int | valuesCnt, | ||
UTime * | updT = NULL |
||
) |
Call to set a series of (double) values. If variable is too small to hold the data, then it is extended.
values | array of doubles to be inserted into the variable |
valuesCnt | number of values in array to set |
updT | is an optional pointer to the update time (relevant for time series only) |
References dValue, elementCnt, elementSize, isDoubleBased, setUpdated(), and setValued().
Equal Sets the value of this variable (size 1) to 1 if all the elements in left is (exactly) equal to the one on the right. The left and right size must be equal. Else the value is 0.
left | is left operator value |
right | is right operator value |
References dValue, getElementCnt(), getValued(), i, isDouble(), and setSize().
Referenced by UVarCalcOper::evaluateV(), and getValues().
Greater or equal- element by element Make this variable an array of same size as left and right, with the values this[i]=1.0 if left[i] is >= right[i], else 0.0.
left | is left operator value |
right | is right operator value |
References dValue, getElementCnt(), getValued(), i, isDouble(), and mini().
Referenced by UVarCalcOper::evaluateV(), and getValues().
Greater than - element by element Make this variable an array of same size as left and right, with the values this[i]=1.0 if left[i] is > right[i], else 0.0.
left | is left operator value |
right | is right operator value |
References dValue, getElementCnt(), getValued(), i, isDouble(), and mini().
Referenced by UVarCalcOper::evaluateV(), and getValues().
|
inline |
Supplementary call to set single value
value | is the value to be set for the index idx |
idx | variable may be an array, default is 0. |
mayAdd | if true and the index is higher than element cnt, then more space is allocated. |
updT | is an optional pointer to the update time (relevant for time series only) |
References setValued().
Referenced by UNamedBoxes::addBox(), UFuncKinect::callGotNewDataWithObject(), UResVarPool::callVSCD(), UImagePool::createBaseVar(), UNamedBox::doDetect(), UNamedBoxes::doDetect(), UResDrivePos::driveOdo(), UResRoadDrive::driveSide(), UCamPool::findDevices(), UResAuEf::findFeatures(), UResAvoid::findPathToHere(), UImagePool::getImage(), UResMapObst::getNearObstacles(), UFakeDevice::getNewestData(), UResCamIfCam::gotNewData(), UResCamIfImg::gotNewImage(), UFuncRadar::handleCommand(), UFuncV4lGst::handleCommand(), UFuncPlan::handleFindRoute(), UFuncPlan::handleGetPoint(), UFunctionCamGmk::handleGmkGetCommand(), UResLaserIfScan::handleLaserScan(), UResLaserIfObst::handleObst(), UResLaserIfSf::handlePass(), UFuncPlan::handleResetPlan(), UResLaserIfSf::handleRoad(), UResLaserIfSf::handleSF(), UImgPush::imgUpdated(), UResIf::interfaceTick(), UResLocater::locate(), UCamPool::makeDevice(), UResLobst::makeObst(), UCamPush::needNewPushData(), UResCamIfGmk::newDataAvailable(), UResObstacle::obstDataUpdated(), UResIf::openConnection(), UFuncStereo::processImages(), UResRhdIf::run(), UFuncPiCam::run(), UFuncPiCam::runAlive(), UResMapObst::sendMapLinesToLocalizer(), UFuncLaserBox::sendToPolyPlugin(), UResLocater::set_utmstate(), UImgPush::setLogInterval(), UResRhdIf::setPort(), UResIf::setPort(), UImgPush::setTcpPort(), UKeepItem::tick(), UCmdExe::updateLocalVar(), and UResObstacle::updateMappedObstacles().
Less than or equal - element by element Make this variable an array of same size as left and right, with the values this[i]=1.0 if left[i] is <= right[i], else 0.0.
left | is left operator value |
right | is right operator value |
References dValue, getElementCnt(), getValued(), i, isDouble(), and mini().
Referenced by UVarCalcOper::evaluateV(), and getValues().
element by element logical And values Make this variable an array of same size as left and right, with the values: this[i]= left[i] and right[i]
left | is left operator value |
right | is right operator value |
References dValue, getElementCnt(), getValued(), i, isDouble(), and mini().
Referenced by UVarCalcOper::evaluateV(), and getValues().
element by element logical OR values Make this variable an array of same size as left and right, with the values: this[i]= left[i] or right[i]
left | is left operator value |
right | is right operator value |
References dValue, getElementCnt(), getValued(), i, isDouble(), and mini().
Referenced by UVarCalcOper::evaluateV(), and getValues().
Less than - element by element Make this variable an array of same size as left and right, with the values this[i]=1.0 if left[i] is < right[i], else 0.0.
left | is left operator value |
right | is right operator value |
References dValue, getElementCnt(), getValued(), i, isDouble(), and mini().
Referenced by UVarCalcOper::evaluateV(), and getValues().
element by element modulo operation Make this variable an array of same size as left,and operate based on first element of right with the values: this[i]= double(long(left[i]) % long(right[0]))
left | is left operator value |
right | is right operator value |
References dValue, getElementCnt(), getValued(), i, isDouble(), and roundi().
Referenced by UVarCalcOper::evaluateV(), and getValues().
void UVariable::setName | ( | const char * | newName, |
int * | idx = NULL |
||
) |
Set name of variable. Strips any index from the name. If there is an index, this is returned in *idx.
name | of variable - nay have index, e.g. foo[8] |
idx | optional pointer to integer, where index is to be returned |
References cols(), MAX_VAR_NAME_SIZE, mini(), name, rows(), and splitNameIndex().
Referenced by UVarPool::addVar(), getType(), and UResRuleState::methodCallV().
Not equal Sets the value of this variable (size 1) to 1 if one or more of the elements in left is not (exactly) equal to the one on the right. The left and right size must be equal. Else the value is 0.
left | is left operator value |
right | is right operator value |
References dValue, getElementCnt(), getValued(), i, isDouble(), and setSize().
Referenced by UVarCalcOper::evaluateV(), and getValues().
bool UVariable::setNot | ( | ) |
set all element to the negated value of the current value.
References dValue, elementCnt, i, and isDoubleBased.
Referenced by UVarCalc::evaluateUnaryValV(), and getValues().
|
inline |
Set parent var pool to this variable. this is needed to let updates trigger an update event
value | pointer to the parent var-pool, may be NULL for disabling this notify event |
References parent.
Referenced by UVarPool::addVar().
element by element sum of values Make this variable an array of same size as left and right, with the values: this[i]= left[i] + right[i]
left | is left operator value |
right | is right operator value |
References dValue, getElementCnt(), getValued(), i, isDouble(), and mini().
Referenced by UVarCalcOper::evaluateV(), and getValues().
Set first 3 values from a UPose structure (order x, y, h)
References UPose::h, setValued(), UPose::x, and UPose::y.
Referenced by UResPoseHist::addIfNeeded(), UResPassable::doObstAnalysis(), UResDrivePos::driveOdo(), UResRoadDrive::driveSide(), UResMapObst::getNearObstacles(), getValues(), UFuncCropRow::handleCommand(), UResLocater::locate(), UResRuleState::methodCallV(), UResCamIfPath::newDataAvailable(), UResLocater::set_state(), UResLocater::set_utmstate(), UResPoseHist::setPoseResult(), UResObstacle::updateMappedObstacles(), and UResPoseHist::updateVarPool().
Set first 4 values from a UPose structure (order x, y, h, tod)
References UTime::getDecSec(), UPose::h, setValued(), UPoseTime::t, UPose::x, and UPose::y.
element by element power operation Make this variable an array of same size as left,and operate based on first element of right with the values: this[i]= pow(left[i], right[0])
left | is left operator value |
right | is right operator value |
References dValue, getElementCnt(), getValued(), i, and isDouble().
Referenced by UVarCalcOper::evaluateV(), and getValues().
element by element product of values Make this variable an array of same size as left and right, with the values: this[i]= left[i] * right[i]
left | is left operator value |
right | is right operator value |
References dValue, getElementCnt(), getValued(), i, isDouble(), and mini().
Referenced by UVarCalcOper::evaluateV(), and getValues().
Set first 3 values from a URotation structure
References URotation::Kappa, URotation::Omega, URotation::Phi, and setValued().
Referenced by getValues(), UResLaserIfScan::handleLaserScan(), UFuncKinect::run(), and UVarPool::setLocalVarRot().
int UVariable::setSize | ( | int | rows, |
int | cols | ||
) |
Set size for a variable. Sets the type to a matrix.
rows | number of rows. |
cols | number of columns. |
References UVarHist::colCnt, cols(), dataType, dValue, elementCnt, getSize(), UVarLog::hasHist(), UVarLog::hist, m2, maxi(), UVarHist::rowCnt, rows(), UVarHist::setHistSize(), setType(), and setValued().
Referenced by getParent(), UFunctionCamGmk::handleGmkGetCommand(), UFunctionVarPool::handleVarValues(), setEq(), setNe(), setValued(), and setValueM().
int UVariable::setSize | ( | int | elements | ) |
Set size of a double based or a string variable.
rows | number of rows. |
cols | number of columns. |
References UVarHist::colCnt, elementCnt, getSize(), UVarLog::hasHist(), UVarLog::hist, isString(), UVarHist::rowCnt, UVarHist::setHistSize(), setValued(), and setValues().
|
inline |
Set value of this string variable. If too little space allocated, then more is allocated if idx is not 0, then idx is the first character to be set, values befroe this is unchanged, but the string is not terminated after the value (if the original string is longer)
attValue | is a string to be added |
idx | index, where the first character is to be set. |
mayAdd | if true, then array is expanded as needed following idx and string length |
updT | is an optional pointer to the update time (relevant for time series only) |
References setTime(), setTimeNow(), setValue(), setValueM(), setValueNew(), setValues(), and t.
Referenced by UFuncV4lGst::busCall().
bool UVariable::setTime | ( | UTime | t, |
const int | idx = 0 |
||
) |
Set value of this variable to decimal representation of current time (decimal seconds since 1 jan 1970).
t | is time to set. |
idx | index, where the first character is to be set (default is 0). |
References UTime::getDecSec(), setValued(), and t.
Referenced by UFuncKinect::decodeReplayLine(), UNamedBoxes::doDetect(), UResAuEf::findFeatures(), UResAvoid::findPathToHere(), UResCamIfCam::gotNewData(), UResCamIfImg::gotNewImage(), UFunctionCamGmk::handleGmkGetCommand(), UResLaserIfObst::handleObst(), UResLaserIfSf::handlePass(), UResLaserIfSf::handleRoad(), UResLaserIfSf::handleSF(), UImgPush::imgUpdated(), UResCamIfPath::newDataAvailable(), UResCamIfGmk::newDataAvailable(), UResObstacle::obstDataUpdated(), UFuncStereo::processImages(), UFuncImu::run(), UFuncPiCam::run(), UFuncKinect::run(), and setString().
bool UVariable::setTimeNow | ( | const int | idx = 0 | ) |
Set value of this variable to decimal reprecentation of current time.
idx | index, where the first character is to be set (default is 0). |
References UTime::getDecSec(), UTime::now(), setValued(), and t.
Referenced by UFuncPlan::handleFindRoute(), UResBin::handleNewData(), UFuncPlan::handleResetPlan(), setString(), and UCmdExe::updateLocalVar().
bool UVariable::setType | ( | varType | newType | ) |
Set data type and element size If the type were different before, then the element size is changed and if the element reduced to be within the new buffer range. element count is unchanged if space allows.
newType | set the data type to this value |
References b, d, d2d, d3d, dataType, dq, elementSize, i, isDoubleBased, m2, pose, rot, s, and t.
Referenced by UVarPool::addVar(), copy(), isString(), UResRuleState::methodCallV(), setSize(), setTypeChar(), setValued(), setValueNew(), and setValues().
bool UVariable::setTypeChar | ( | const char * | to | ) |
Set data type from a character string
to | a character description of data type |
References setType(), and typeFromChar().
Referenced by UVarCalc::evaluateUnaryValV(), and getType().
bool UVariable::setUnit | ( | ) |
Set this m2 type variable to 1.0 in diagonal and 0.0 in other elements.
References cols(), dataType, dValue, i, m2, rows(), and setUpdated().
Referenced by descriptionBufferUsed(), and UFunctionVarPool::handleVarValues().
|
protected |
Set variable as updated, to notify for push events Set variable as updated, with timestamp - for local history only (if any)
updTime | time of this update. |
References UVarLog::changed(), dValue, UVarPool::getFullPreName(), UVarPool::getLogVar(), UVarPool::getLogVarLock(), UVarLog::hasHist(), isDouble(), name, UTime::now(), parent, saveToLog(), UServerPush::setUpdated(), updateQtTest(), updTimeNewest, and varFastestUpdateTime.
Referenced by copy(), decodeReplayLine(), descriptionBufferUsed(), setAll(), setDouble(), setUnit(), setValued(), setValueM(), and setValues().
Set value from this source. Optinally set just element 'elem'
source | is the new value |
idx | is the element in the destination to be set from the source if elem > 0 and type is double, then just the element is set from the first value in the source. if elem > 0 and type is string, then the source is treates as a new substring to be set at this position if elem == 0, then the source is copied to this variable in total (incl type) |
updT | is an optional pointer to the update time (relevant for time series only) |
References copy(), getElementCnt(), getValueBuffer(), getValued(), isString(), s, setValued(), and setValues().
Referenced by UVarPool::addVar(), UFunctionVarPool::handleVarValues(), UResRuleState::methodCallV(), UMisRuleState::setParameters(), UVarPool::setScopeVar(), and setString().
bool UVariable::setValued | ( | double | value, |
const int | ix = 0 , |
||
bool | mayAdd = false , |
||
UTime * | updT = NULL |
||
) |
Set double type value of this variable. If too little space allocated, then more is allocated
value | is the value to be set for the index idx |
ix | may be an array, so an index is provided |
mayAdd | if true and the index is higher than element cnt, then more space is allocated. |
updT | is an optional pointer to the update time (relevant for time series only) |
References buf, byteCnt, dataType, dValue, elementCnt, elementSize, getGetAsXmlAttribute(), isDouble(), m2, s, and setUpdated().
Referenced by add(), UVarPool::addVar(), UFuncKinect::callGotNewDataWithObject(), UResIf::connectionChange(), UResDrivePos::driveOdo(), UVarCalc::evaluateUnaryValV(), UResSmrIf::eventHakoVarUpdate(), UMisControl::execute(), UFuncBallKL::findBall(), UFuncPiPi::findBall(), UFuncBall::findBall(), UFuncBall_improved::findBall(), getBool(), UVarCalc::getValueAnyV(), UFuncImu::handleCommand(), UFuncView::handleCommand(), UFuncPpl::handleCommand(), UFuncKinect::handleKinect(), UFuncLoca2::handleLocalize(), UFuncPiCam::handleNormal(), UFuncPTgrey::handlePTgrey(), UFuncStereo::handleStereo(), UFuncTOF::handleTOF(), UFunctionVarPool::handleVarValues(), UMisRuleState::initCall(), UFuncStereo::initializeStereo(), UResIf::interfaceAliveTag(), UResIf::interfaceTick(), UResSmrIf::lineStateUpdated(), UFuncPiCam::logFileTest(), UFuncKinect::logFileTest(), UResLobst::makeObst(), UResLocater::match_points(), UFuncPpl::methodCall(), UMisRuleState::methodCallV(), UVarMethod::methodCallV(), UResRuleState::methodCallV(), UMisRuleState::methodWait(), UFuncView::paintBold(), UFuncTOF::processChannel8(), UFuncTOF::processImages(), UFuncPTgrey::Receiver(), UFuncTOF::Receiver(), UFuncImu::run(), UResSmrCtl::run(), UFuncKinect::run(), UFuncPTgrey::runSetting(), UResSmrCtl::sendNewManoeuvreToSMR(), set3D(), set6D(), UResIf::setBinNameValid(), setBool(), UNamedBox::setBox(), setDouble(), setInt(), UVarPool::setLocalVar(), UResPoseHist::setMinDist(), UResPoseHist::setMinTheta(), UResPoseHist::setMinTime(), UMisRuleState::setParameters(), setPose(), UFuncView::setRangeRingCnt(), UFuncView::setRobot(), setRot(), setSize(), setTime(), setTimeNow(), setValue(), setValued(), setValueNew(), testVar(), UResPoseHist::updateVarPool(), and UFuncPpl::updateVars().
bool UVariable::setValued | ( | const char * | attValue, |
const int | idx, | ||
bool | mayAdd, | ||
UTime * | updT = NULL |
||
) |
Set value of this variable, assuming value can be converted to double. If too little space allocated, then more is allocated. If variable is a matrix or the attValue has ';' (as row seperator) then the size of the matrix is set from the data, and 'idx' should be set to 0.
attValue | is a string with the values for the array, at maximum the number of variables in one element is used - e.g. 3 for a d3d type |
idx | may be an array, so an index is provided |
mayAdd | if true, then array is expanded as needed following idx |
updT | is an optional pointer to the update time (relevant for time series only) |
References d, dataType, elementCnt, isDouble(), m2, maxi(), name, setSize(), setType(), setValued(), and str2bool3().
Set value from this source. variable is resized to match the source existing variable has too few elements
mat | is the new value for the matrix variable |
References UMatrix::cols(), UMatrix::getData(), and UMatrix::rows().
Referenced by setString(), setValueM(), UFuncLoca2::updateCovStatus(), and UFuncLocalize::updateCovStatus().
bool UVariable::setValueM | ( | matrix * | mat, |
UTime * | updT = NULL |
||
) |
Set value from this source. variable is resized to match the source existing variable has too few elements
mat | is the new value for the matrix variable |
References setValueM().
bool UVariable::setValueM | ( | int | rCnt, |
int | cCnt, | ||
double * | values, | ||
UTime * | updT = NULL |
||
) |
Set value from this source.
rCnt | is the number of rows in the source array. |
cCnt | is the number of columns in each row. |
values | is an array with rCnt*cCnt elements. |
References dValue, setSize(), and setUpdated().
bool UVariable::setValueNew | ( | const char * | newName, |
const char * | attValue, | ||
const char * | type, | ||
const char * | comment | ||
) |
Assign values to a new (empty) variable.
newName | The new name of the variable |
attValue | string with value for variable |
type | string indicationg how to interpet the value string |
comment | - new comment (static string - pointer used directly) |
References d, description, isString(), MAX_VAR_NAME_SIZE, name, none, s, setType(), setValued(), setValues(), and typeFromChar().
Referenced by setString().
bool UVariable::setValues | ( | const char * | attValue, |
const int | idx, | ||
bool | mayAdd, | ||
UTime * | updT = NULL |
||
) |
Set value of this string variable. If too little space allocated, then more is allocated if idx is not 0, then idx is the first character to be set, values befroe this is unchanged, but the string is not terminated after the value (if the original string is longer)
attValue | is a string to be added |
idx | index, where the first character is to be set. |
mayAdd | if true, then array is expanded as needed following idx and string length |
updT | is an optional pointer to the update time (relevant for time series only) |
References byteCnt, dValue, elementCnt, elementSize, i, isString(), s, setType(), and setUpdated().
Referenced by UVarPool::addVar(), UResVarPool::callVS(), UResVarPool::callVSCD(), UResAvoid::copyAvoidObstacles(), UResAvoid::copyCellPolys(), UResAvoid::copyFootprintPolys(), UFuncPpl::drawPolygons(), UVarCalc::evaluateParametersV(), UVarCalc::evaluateUnaryValV(), UVarCalc::evaluateV(), UVarCalc::getValueAnyV(), UFunctionVarPool::handleVarValues(), UFunctionVarPool::makeAMethodCall(), UFuncKinect::makeObj3Dcloud(), UMisRuleState::methodCallV(), UResIf::openConnection(), UFunctionPassable::polygonToPolyPlugin(), UResLocater::polygonToPolyPlugin(), UFuncStraightLine::polygonToPolyPlugin(), UFuncImu::run(), UResRoseBot::sendToPolyPlugin(), UFuncLaserBox::sendToPolyPlugin(), UResIf::setBinName(), setBool(), UNamedBox::setBox(), UKeepItem::setExpr(), UResRhdIf::setHost(), UResIf::setHost(), UVarPool::setLocalVar(), UCamMounted::setMountName(), UKeepItem::setName(), UFuncKinect::setPointCloudUpdated(), setSize(), setString(), UCamDevBase::setTypeName(), setValue(), and setValueNew().
|
virtual |
Print status for this structure
Reimplemented from UDataBase.
References dValue, getValuesdAsString(), isString(), and name.
Referenced by getDataType().
|
static |
Split name, assuming an index is embedded in the name. The function finds first index only, no decimals allowed in index. Can be called with no object e.g. 'data[3]' returns true and index=3 length = 4 e.g. 'data[ 3 ]' returns true and index=3 length = 4 e.g. 'data[3][6]' returns true and index=3 length = 4 e.g. 'data[3,6]' returns true and index=3, col=6 length = 4 e.g. 'data[3 6]' returns true and index=3, col=6 length = 4 e.g. 'data' returns true and index=0 length = 4 e.g. 'data[]' returns true and index=0 length = 4 e.g. 'data[3.0]' returns false and index=3 length = 4 e.g. 'data[3' returns false and index=3 length = 4
nameWithIndex | is the full name, e.g. 'data[3]' |
index | is where the index is returned e.g. 3 |
nameLng | is where the length without index is returned e.g. 4 |
nameWithIndex | is the full name, e.g. 'data[3]' |
index | is where the index is returned e.g. 3 |
col | is set to column index, if specified as a matrix (and not NULL) |
nameLng | is where the length without index is returned e.g. 4 |
Referenced by UVarPool::getLocalVarIndex(), getType(), and setName().
|
static |
Get variable type from a character representattion
References b, d, d2d, d3d, d6d, dq, i, m2, none, pose, rot, s, and t.
Referenced by UVarPool::addVar(), UVarPool::addVarA(), getType(), setTypeChar(), and setValueNew().
void UVariable::updateQtTest | ( | float | holdTime | ) |
Test if this variable needs to be updated to theQT gui
References qevent, updTimeLast, updTimeNewest, and UQevent::varUpdatedEvent().
Referenced by descriptionBufferUsed(), setUpdated(), and UResVarPool::updateQTvars().
|
protected |
size of data buffer in bytes
Referenced by copy(), getByteCnt(), setValued(), setValues(), UVariable(), and ~UVariable().
|
protected |
Variable type - may be part of a semistructure (or a string) p.t. the following types are defined d : the default double - or double array dq : an array of 2 values aaaX, aaaQ - a value with an associated quality pose : an array of 3 values aaaX aaaY aaaH - in this order 2d : an array of 2 values aaaX aaaY - in this order 3d : an array of 3 values aaaX aaaY aaaZ - in this order 6d : an array of 6 values aaaX aaaY aaaZ aaaO aaaP aaaK - in this order rot : an array of 3 values aaaO aaaP aaaK - in this order s : a string m2 : 2-dimensional matrix (first 2 elements are rows and columns)
Referenced by cols(), copy(), getM(), getSize(), getType(), getTypeChar(), getValued(), getValuedAsString(), getValuesd(), getValuesdAsString(), isTypeA(), rows(), setAll(), setSize(), setType(), setUnit(), setValued(), and UVariable().
const char* UVariable::description |
Description
Referenced by UVarPool::addVar(), copy(), descriptionBufferUsed(), UVarPool::getVarDescription(), UFunctionVarPool::sendVar(), setDescription(), UQtgui::setStruct(), setValueNew(), UQtgui::updVarEvent(), UVariable(), and ~UVariable().
|
private |
Description data buffer
Referenced by copy(), descriptionBufferUsed(), setDescription(), UVariable(), and ~UVariable().
|
protected |
Value of variable
Referenced by cols(), copy(), decodeReplayLine(), get3D(), get6D(), getM(), getPose(), getPoseTime(), getRot(), getValueBuffer(), getValued(), getValuedAsString(), getValues(), getValuesAsStringQuoted(), getValuesd(), inverse(), negate(), rows(), setAll(), setBinaryAnd(), setBinaryOr(), setBinaryShiftLeft(), setBinaryShiftRight(), setBinaryXor(), setDiff(), setDivide(), setDouble(), setEq(), setGe(), setGt(), setLe(), setLogicalAnd(), setLogicalOr(), setLt(), setModulo(), setNe(), setNot(), setPlus(), setPow(), setProduct(), setSize(), setUnit(), setUpdated(), setValued(), setValueM(), setValues(), snprint(), UVariable(), and ~UVariable().
|
protected |
size of data buffer in elements
Referenced by cols(), copy(), decodeReplayLine(), get3D(), get6D(), getElementCnt(), getElementCnt2(), getGetAsXmlAttribute(), getPose(), getPoseTime(), getRot(), getSize(), getValued(), inverse(), makeTimeSeries(), negate(), setAll(), setDouble(), setNot(), setSize(), setValued(), setValues(), UVariable(), and ~UVariable().
|
protected |
size of one data element - in bytes
Referenced by copy(), isString(), setDouble(), setType(), setValued(), setValues(), and UVariable().
|
protected |
flag for double sized variables
Referenced by decodeReplayLine(), inverse(), isDouble(), isString(), negate(), openVarLog(), setAll(), setDouble(), setNot(), setType(), and UVariable().
char UVariable::name[MAX_VAR_NAME_SIZE+1] |
Name of variable
Referenced by copy(), getGetAsXmlAttribute(), UVarPool::getVarName(), UFunctionVarPool::handleVarValues(), openVarLog(), saveToLog(), UFunctionVarPool::sendVar(), UFunctionVarPool::sendVarList(), UVarPool::setLocalVar(), UVarPool::setLocalVar3D(), UVarPool::setLocalVar6D(), UVarPool::setLocalVarAdd(), UVarPool::setLocalVarRot(), setName(), setUpdated(), setValued(), setValueNew(), snprint(), MainWindow::updateQtVariable(), UQtgui::updVarEvent(), UQStandardItem::UQStandardItem(), UVariable(), MainWindow::varUpdatedEvent(), and UQtgui::varUpdatedEvent().
|
protected |
Pointer to parent var pool - especially for update notification
Referenced by getParent(), openVarLog(), setParent(), setUpdated(), and UVariable().
|
protected |
Last update time to qt
Referenced by updateQtTest().
|
protected |
Latest update time
Referenced by setUpdated(), and updateQtTest().