fdhwlib  2.0.25
shell Class Reference

#include <shell.h>

List of all members.

Public Member Functions

Public Attributes

Private Attributes


Detailed Description

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:

  • Parsing of input/output redirection changed to "< " and " >" tags. 22-03-2002 ak
  • Use recursive calls of the shell in case of a output redirection. 13-03-2002 ak
Todo:

Add Variables + Conditions in the command line.

Start the shell with the history of the last session!

Definition at line 199 of file shell.h.


Constructor & Destructor Documentation

shell::shell ( cmds **  obj,
int  n 
)
shell::shell ( )

Member Function Documentation

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.

Returns:
Pointer to the replaced tag. In case no tag was found the function will return zero.
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.


Member Data Documentation

std::string shell::basedir[FD_STATIONS]

Definition at line 299 of file shell.h.

std::string shell::configdir

Name of the config dir.

Definition at line 339 of file shell.h.

The debug level defines the amount of messages the shell will give.

0 means normal output, higher values request more output

Definition at line 279 of file shell.h.

Id of the selected eye station.

Definition at line 288 of file shell.h.

FILE* shell::flog

File descriptor for the shells logfile.

Definition at line 342 of file shell.h.

float shell::fRes

Float result.

Definition at line 321 of file shell.h.

float shell::fResMatrix[20][24]

Float matrix.

Definition at line 330 of file shell.h.

std::string shell::gpsserver[FD_STATIONS]

Name of the gpsserver.

Definition at line 302 of file shell.h.

int shell::gpsserverPort[FD_STATIONS]

Port of the gpsserver.

Definition at line 305 of file shell.h.

std::string shell::inifile

Definition at line 283 of file shell.h.

Integer result.

Definition at line 315 of file shell.h.

int shell::iResMatrix[20][24]

Integer matrix.

Definition at line 327 of file shell.h.

Counter for the iterations.

Definition at line 308 of file shell.h.

std::string shell::location[FD_STATIONS]

Definition at line 290 of file shell.h.

int shell::locationId[FD_STATIONS]

Number of the location.

Definition at line 293 of file shell.h.

std::string shell::logfile

Name of the logfile.

Definition at line 336 of file shell.h.

int shell::n [private]

Definition at line 353 of file shell.h.

cmds* * shell::obj [private]

Definition at line 350 of file shell.h.

std::string shell::project

Definition at line 285 of file shell.h.

std::string shell::prompt

Definition at line 281 of file shell.h.

std::string shell::sRes

string result

Definition at line 324 of file shell.h.

std::string shell::sResMatrix[20]

String matrix.

Definition at line 333 of file shell.h.

Number of the selected telescope (1..24) The number correspond with the eye station Id.

Definition at line 297 of file shell.h.

unsigned long shell::uReg

32bit result value

Definition at line 318 of file shell.h.


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