AURobotServers
4
|
#include <uresrule.h>
Public Member Functions | |
bool | addEditLines (const char *lines) |
add line or lines to to the unloaded bart of plan More... | |
bool | completeEdit (UVarCalc *calc) |
bool | isBusy () |
bool | isDefRule () |
virtual bool | isEdit () |
virtual int | setBusyCnt (int delta) |
void | setEdit (bool value) |
UMisLoadedRule () | |
bool | unpack (USmlSource *cnn, USmlTag *tag, UVarCalc *calc) |
virtual | ~UMisLoadedRule () |
Public Member Functions inherited from UMisRule | |
void | addIniLine (UMisItem *newLine) |
void | addMainLine (UMisItem *newLine) |
void | addPostLine (UMisItem *newLine) |
virtual const char * | getDataType () |
const char * | getFileName () |
UMisItem * | getIniLines () |
int | getIniLinesCnt () |
UMisItem * | getMainLines () |
int | getMainLinesCnt () |
const char * | getName () |
UMisItem * | getPostLines () |
int | getPostLinesCnt () |
virtual const char * | print (const char *preStr, char *buf, const int bufCnt) |
void | setCalc (UVarCalc *calculator) |
void | setLogFile (ULogFile *logFile) |
void | setName (const char *toName) |
UMisRule () | |
bool | unpackRule (USmlSource *cnn, USmlTag *tag) |
virtual | ~UMisRule () |
Public Member Functions inherited from UMisItem | |
virtual ResultValue | execute (UVarCalc *calc, int state) |
const char * | findStopChar (const char *source, char stop) |
int | getLineNumber () |
bool | isA (const char *matchType) |
virtual bool | setLine (const int lineNum, const char *value, UVarCalc *calc) |
void | setLineNumber (const int line) |
UMisItem () | |
virtual | ~UMisItem () |
Public Member Functions inherited from UDataBase | |
bool | isA (const char *typeString) |
virtual bool | isAlsoA (const char *typeString) |
virtual void | snprint (const char *preString, char *buff, const int buffCnt) |
UDataBase () | |
virtual | ~UDataBase () |
Public Attributes | |
UMisLoadedRule * | nextRule |
char | sourceFileName [MAX_FILENAME_LENGTH] |
Public Attributes inherited from UMisRule | |
char * | condition |
string | dependPlugin |
string | description |
char * | destination |
bool | isFull |
bool | isLoop |
bool | isRule |
bool | isRun |
bool | isSwitch |
bool | isTop |
ULogFile * | logm |
int | order |
Priority order of this plan - relative to other (sub) plans. This value controls in wich order the list of (sub) plans are assigned processing time, i.e. if a number of sub-plans evaluate some value - e.g. the robot pose - then thise can be assigned to be evaluated before another subplan, that combines or selects the usable results from the others. A priority with a low number is executed first. The value range is 1..100, where 1 is executed before the others. if two plans have the same priority order, then the order is un-determined. Default value is 50. More... | |
char * | parameters |
int | parametersCnt |
int | switchValue |
Public Attributes inherited from UMisItem | |
UMisItem * | next |
Protected Member Functions | |
virtual const char * | getEditLines () |
void | stripEscape (char *dest, const char *source) |
Protected Member Functions inherited from UMisRule | |
void | addLine (UMisItem *elemList, UMisItem *newLine) |
virtual bool | checkSyntax (USmlSource *cnn) |
int | getLinesCnt (UMisItem *fromLine) |
int | trimWhiteSpace (char *s) |
bool | unpackBlock (USmlSource *cnn, USmlTag *tag, UMisItem **itemList) |
bool | unpackInitPostBlock (USmlSource *cnn, USmlTag *tag, UMisItem **itemList, MisPart iniBlock) |
bool | unpackLine (USmlSource *cnn, char *line, UMisItem **itemNext, int lineNum, MisPart iniBlock) |
bool | unpackSequence (USmlSource *cnn, char *lines, UMisItem **itemList, int lineNum, MisPart iniBlock=MP_MAIN) |
Protected Member Functions inherited from UMisItem | |
int | symbolLength (const char *exp) |
Private Attributes | |
int | busyCnt |
Number of times this (root) plan is beeing used. More... | |
bool | edit |
is the plan fully loaded or is it still beeing edited More... | |
char * | editLines |
unloaded part of plan More... | |
Additional Inherited Members | |
Public Types inherited from UMisItem | |
enum | ResultValue { RV_EMPTY, RV_OK, RV_OK_FALSE, RV_OK_AGAIN, RV_SYNTAX_ERROR, RV_FAILED, RV_IF_TRUE, RV_IF_FALSE } |
Static Public Member Functions inherited from UMisItem | |
static bool | isRem (const char *r) |
Protected Types inherited from UMisRule | |
enum | MisPart { MP_INIT, MP_MAIN, MP_POST } |
Protected Attributes inherited from UMisRule | |
UVarCalc * | calc |
char | fileName [MAX_FILENAME_LENGTH] |
bool | inEditAppend |
UMisItem * | iniLines |
UMisItem * | mainLines |
char | name [MAX_VAR_NAME_SIZE] |
UMisItem * | postLines |
Protected Attributes inherited from UMisItem | |
int | lineNumber |
UMisLoadedRule::UMisLoadedRule | ( | ) |
Constructor
References busyCnt, edit, editLines, nextRule, and sourceFileName.
Referenced by UResRule::addNewRule(), and UResRule::unpackMissionRule().
bool UMisLoadedRule::addEditLines | ( | const char * | lines | ) |
add line or lines to to the unloaded bart of plan
lines | a zero terminated string to be added |
References editLines, and stripEscape().
Referenced by UFuncRule::editRule(), and isBusy().
bool UMisLoadedRule::completeEdit | ( | UVarCalc * | calc | ) |
Add the potential lines in the edit buffer
calculator | reference that should be used for any load calculations |
References edit, editLines, UMisRule::inEditAppend, USmlString::isSourceAvailable(), UMisRule::setCalc(), USmlString::setSourceString(), and UMisRule::unpackRule().
Referenced by UResRule::completeEdit(), UResRule::getSyntaxErrorString(), and isBusy().
|
inlineprotectedvirtual |
Get the edit lines (un-implemented parts of a plan)
Reimplemented from UMisRule.
|
inline |
Is this plan busy - i.e. used by the sequencer. The busy cnt can be set from a locked resource only, so just
References addEditLines(), busyCnt, completeEdit(), and stripEscape().
Referenced by UFuncRule::editRule(), UResRule::tryUnloadRule(), and UFuncRule::unloadRule().
bool UMisLoadedRule::isDefRule | ( | ) |
Print mission plan to buffer
preStr | a string to add before the plan lines |
buf | a string buffer to hold the plan |
bufCnt | the size of the buffer Is the top plan the default plan |
|
inlinevirtual |
Is this plan in editing mode - i.e. append is allowed
Reimplemented from UMisRule.
References edit.
Referenced by UFuncRule::editRule(), UResRule::getRule(), and UFuncRule::unloadRule().
|
virtual |
Adjust the number of times this plan is beeing used by the sequencer - add 1 every time it is used in a plan state and remove one when plan state is released
Reimplemented from UMisRule.
References busyCnt.
Referenced by UFuncRule::listAllMissions(), and setEdit().
|
inline |
set this plan in editing mode or not - i.e. append is allowed if in edit mode
References edit, and setBusyCnt().
Referenced by UResRule::addNewRule(), UFuncRule::editRule(), and UResRule::unpackMissionRule().
|
protected |
Strip source string from escaped new-line combinaltion "\n" and replace with '
'.
dest | destination string, assumed to be able to hold the stripped version of source |
source | source string - zero terminated. |
Referenced by addEditLines(), and isBusy().
bool UMisLoadedRule::unpack | ( | USmlSource * | cnn, |
USmlTag * | tag, | ||
UVarCalc * | calc | ||
) |
Unpack a plan from this tag
cnn | is a connection to the SML (XML) file |
tag | is the open tag for the plan |
References USmlSource::isVerbose(), UMisRule::setCalc(), and UMisRule::unpackRule().
Referenced by UResRule::unpackMissionRule().
|
private |
Number of times this (root) plan is beeing used.
Referenced by isBusy(), setBusyCnt(), and UMisLoadedRule().
|
private |
is the plan fully loaded or is it still beeing edited
Referenced by completeEdit(), isEdit(), setEdit(), and UMisLoadedRule().
|
private |
unloaded part of plan
Referenced by addEditLines(), completeEdit(), UMisLoadedRule(), and ~UMisLoadedRule().
UMisLoadedRule* UMisLoadedRule::nextRule |
Pointer to next plan
Referenced by UResRule::appendRule(), UResRule::getMissionCnt(), UResRule::getRule(), UResRule::tryUnloadRule(), UMisLoadedRule(), UFuncRule::unloadRule(), and ~UMisLoadedRule().
char UMisLoadedRule::sourceFileName[MAX_FILENAME_LENGTH] |
Source filename for the mission plan
Referenced by UMisLoadedRule(), UFuncRule::unloadRule(), and UResRule::unpackMissionRule().