fdhwlib  2.0.25
CalibControl Class Reference

#include <calibcontrol.h>

List of all members.

Public Member Functions

Private Attributes


Detailed Description

Interface to control the UNM calibration system.

Configuration (Default: FE.ini)

;
; Control of the UNM calibration system
[CalibControl]
host = calib1
port = 12345

Changed:

  • Added support from the busy messages, 2004-03-11 ak

Definition at line 40 of file calibcontrol.h.


Constructor & Destructor Documentation

CalibControl::CalibControl ( const char *  hostIp = "calib1",
int  portNo = 12345 
)

The contructor uses the default values calib1 and the port 12345 as prefered by J.

Matthews.

virtual CalibControl::~CalibControl ( ) [virtual]

Member Function Documentation

int CalibControl::execute ( char *  command)

Execute a command at the calibration PC.

Returns:
acknoledge 0 unknown command, 1 command accepted, 2 started sript, 3 busy
int CalibControl::getData ( FILE *  fout,
CalibData data 
)

Get the information about the last performed calibration run.

Every script will produced one line of parameters beginning with a time stamp.

Format of the time stamp (source calib1:/home/johnm/develop/logging/logging.c):

       temp_d = (float) systime.tm_yday + 1;   // add 1 so that January 1 = day 1 (not 0) 
       temp_h = (float) systime.tm_hour;
       temp_m = (float) systime.tm_min;
       temp_s = (float) systime.tm_sec;
       date = temp_d + (temp_s + (temp_m + temp_h*60.)*60.)/(24.*60.*60.);
       sprintf(date_str,"%-.5f",date);
        

@ return 0 reased end of data, no data returned, 1 returned valid data

int CalibControl::getData ( std::string *  data)

Get a string with the calibration data from the calibration units.

@ return 0 reased end of data, no data returned, 1 returned valid data

char* CalibControl::getMessage ( int *  end_flag,
int *  rpbp_bit 
)
int CalibControl::getStatus ( int *  end_flag,
int *  rpbp_bit 
)

Retrieve the status of the calibration system.

Meaning of the end_flag (source calib1:/home/johnm/develop/main.c):

  • -1 = PC boot,
  • 0 = power_on,
  • 1 = power_on w/ data requested,
  • 2 = stop (stop1 forces power_off),
  • 3 = stop w/ power off AND exit)
int CalibControl::getStatus ( FILE *  fout,
int *  end_flag,
int *  rpbp_bit 
)
void CalibControl::init ( char *  inifile = "FE.ini",
FILE *  fdebug = 0 
)

Read configuration from ini file.

Parameters:
inifileName of the inifile
fdebugOptional output during initialisation
int CalibControl::powerOff ( )
int CalibControl::powerOn ( )
void CalibControl::setLogFile ( FILE *  fout)

Define the logging output stream.

The value 0 will disable logging.

int CalibControl::shutdown ( )
int CalibControl::stop ( )

Member Data Documentation

FILE* CalibControl::fout [private]

Pointer to the output stream for logging.

Definition at line 132 of file calibcontrol.h.

std::string CalibControl::host [private]

Host IP of the calibration system.

Definition at line 126 of file calibcontrol.h.

int CalibControl::port [private]

Port used by the calibration system.

Definition at line 129 of file calibcontrol.h.


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