fdhwlib
2.0.25
|
#include <shell.h>
The class implements a simple shell that allows input and output redirection.
The instruction set is defined by the interface cmds. Here the function cmds::interprete() is used to parse one command line and initiate the appropiate actions. The class StdCmds is always used. It provide basic commands like help or quit. Others are instrctions sets can be derived from cmds and optionally be included. Once initalized, the shell is automatically invoked by using the function run.
Changes:
Add Variables + Conditions in the command line.
Start the shell with the history of the last session!
shell::shell | ( | cmds ** | obj, |
int | n | ||
) |
shell::shell | ( | ) |
void shell::convertStringToLower | ( | std::string * | result | ) |
Convert string to lower case.
void shell::getBasedir | ( | std::string * | basedir, |
int | eyeId = 0 |
||
) |
Get basedir.
const char* shell::getGpsserver | ( | int | id = 0 | ) |
Get the basedir used for the actual telescope.
Get actual gpsserver name
int shell::getGpsserverPort | ( | int | id = 0 | ) |
Get the port of the gpsserver.
const char* shell::getLocation | ( | int | eyeId = 0 | ) |
Get actual location name.
int shell::getLocationId | ( | ) |
Get actual location id.
char* shell::replaceString | ( | std::string * | result, |
const char * | tag, | ||
const char * | value | ||
) |
Replace tag in string result by value.
char* shell::replaceStringByDate | ( | std::string * | result, |
const char * | tag = "<date>" |
||
) |
Replace the string by the actual time.
char* shell::replaceStringByLocation | ( | std::string * | result, |
const char * | tag = "<location>" |
||
) |
Replace the string by the eye name.
char* shell::replaceStringByTelescope | ( | std::string * | result, |
const char * | tag = "<tel>" |
||
) |
Replace the string by the telescope number.
char* shell::replaceStringByTime | ( | std::string * | result, |
const char * | tag = "<time>" |
||
) |
Replace the string by the auger date.
Change of date is at 12:00 of the fllowing day
char* shell::replaceVariable | ( | char * | pTag, |
const char * | tag, | ||
int | value | ||
) |
Replace a single tag field.
char* shell::replaceVariable | ( | std::string * | pTag, |
const char * | tag, | ||
int | value | ||
) |
char* shell::replaceVariableByEye | ( | char * | pTag, |
const char * | tag | ||
) |
char* shell::replaceVariableByEye | ( | std::string * | pTag, |
const char * | tag | ||
) |
char* shell::replaceVariableByTelescope | ( | char * | pTag, |
const char * | tag | ||
) |
char* shell::replaceVariableByTelescope | ( | std::string * | pTag, |
const char * | tag | ||
) |
bool shell::run | ( | const char * | batch = 0 | ) |
bool shell::run | ( | FILE * | fin, |
FILE * | fout, | ||
const char * | batch = 0 , |
||
char * | execLine = 0 |
||
) |
void shell::setBasedir | ( | char * | basedir, |
int | eyeId = 0 |
||
) |
Set the basedir for the actual or a sepecific eye satation.
void shell::setTelescope | ( | int | id | ) |
Set telescope.
char* shell::version | ( | ) |
void shell::writeLogMsg | ( | const char * | msg, |
... | |||
) |
Write a line to the log file.
std::string shell::basedir[FD_STATIONS] |
std::string shell::configdir |
int shell::debug |
int shell::eyeId |
FILE* shell::flog |
float shell::fRes |
float shell::fResMatrix[20][24] |
std::string shell::gpsserver[FD_STATIONS] |
int shell::gpsserverPort[FD_STATIONS] |
std::string shell::inifile |
int shell::iRes |
int shell::iResMatrix[20][24] |
int shell::iter |
std::string shell::location[FD_STATIONS] |
int shell::locationId[FD_STATIONS] |
std::string shell::logfile |
cmds* * shell::obj [private] |
std::string shell::project |
std::string shell::prompt |
std::string shell::sRes |
std::string shell::sResMatrix[20] |
unsigned long shell::uReg |