fdhwlib  2.0.25
TsBackgroundReader Class Reference

#include <tsbackgroundreader.h>

List of all members.

Public Member Functions

Private Attributes


Detailed Description

Readout the background data from the electronics and send the data to the recorder running at the eyepc.

The background reader is started in a separate process from the pbusdaemon or directly on the same machine. The background loop will run until the connection to the server is lost.

Todo:
Every process started with fork() will exist as zombie as long as the main process will not use the function wait().
Todo:
Try to use select() during waiting. Both the socket connection to the server and any key press can be detect much faster by this function. In the moment we have a small polling loop with a 1 second period. During the first tests it turned out that a socket connection is not properly released after the usage of select (use: netstat --ip).

Definition at line 51 of file tsbackgroundreader.h.


Constructor & Destructor Documentation

TsBackgroundReader::TsBackgroundReader ( )
TsBackgroundReader::~TsBackgroundReader ( )

Member Function Documentation

int TsBackgroundReader::connect ( std::string  ipaddr,
int  port = BGLOOP_PORT 
)
void TsBackgroundReader::disconnect ( )
void TsBackgroundReader::getParameter ( int  telId,
FILE *  fout = 0 
)

Request the samping parameter from the server.

Parameters:
telIdId of the telescope that is read out by this class.
foutOutput stream
void TsBackgroundReader::record ( bool  interactive = 0)

Record the backgrounmd data and send it to the server recording all the records from all connected teescopes.

void TsBackgroundReader::setParameter ( FILE *  fout = 0,
float  tSample = 5.0,
int  select = 0,
int  telescope = 0 
)

Set manually the parameter for the background loop.

This is useful if the background loop should run without connection to the recorder process.

int TsBackgroundReader::shutdown ( )

Shutdown server.

void TsBackgroundReader::wait ( keyboard kb = 0)

Wait for the next sample time.

The 'q' pressed at the keyboard will stop the waiting and set the running-flag to false.


Member Data Documentation

Definition at line 95 of file tsbackgroundreader.h.

FILE* TsBackgroundReader::fout [private]

Definition at line 93 of file tsbackgroundreader.h.

std::string TsBackgroundReader::ipaddr [private]

Definition at line 109 of file tsbackgroundreader.h.

int TsBackgroundReader::port [private]

Definition at line 111 of file tsbackgroundreader.h.

Definition at line 98 of file tsbackgroundreader.h.

Definition at line 105 of file tsbackgroundreader.h.

Definition at line 96 of file tsbackgroundreader.h.

Definition at line 107 of file tsbackgroundreader.h.

Definition at line 101 of file tsbackgroundreader.h.

float TsBackgroundReader::tSample [private]

Definition at line 103 of file tsbackgroundreader.h.


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