CFEL - ASG Software Suite  2.5.0
CASS
Public Member Functions | Private Attributes | List of all members
HistogramUpdater Class Reference

#include <histo_updater.h>

+ Collaboration diagram for HistogramUpdater:

Public Member Functions

 HistogramUpdater (const std::string &server, int port)
 constructor More...
 
void syncHistograms ()
 update the shown histograms More...
 
void syncHistogram (const std::string &name)
 copy a single result into a histogram More...
 
void setServer (const std::string &server)
 set the server More...
 
void setPort (int port)
 set server port More...
 
void autoSync (double freq)
 automaticly update More...
 
void alsoUpdateCanvas (bool update)
 set the updateCanvas flag More...
 
void writeRootFile (const std::string &name)
 write all histograms to a root file More...
 
void reloadIni ()
 tell the server reload the .ini parameters More...
 
void controlCalibration (const std::string &command="startDarkcal")
 control the dark calibration More...
 

Private Attributes

std::string _server
 the server More...
 
int _port
 the server port More...
 
std::auto_ptr< TTimer > _timer
 the timer for auto update More...
 
bool _updateCanv
 flag whether after updating the histogram the canvas should also update More...
 

Detailed Description

Definition at line 17 of file histo_updater.h.

Constructor & Destructor Documentation

HistogramUpdater::HistogramUpdater ( const std::string &  server,
int  port 
)

constructor

connects the timers Timeout() signal with the updateHistogram() method of this class

Parameters
serverthe server ip or name
portthe server port

Definition at line 411 of file histo_updater.cpp.

References _timer.

Member Function Documentation

void HistogramUpdater::alsoUpdateCanvas ( bool  update)
inline

set the updateCanvas flag

Parameters
updatethe flag status

Definition at line 72 of file histo_updater.h.

References _updateCanv.

void HistogramUpdater::autoSync ( double  freq)

automaticly update

start autoupdate with requested frequency. If frequency is 0 stop autoupdate.

Parameters
freqThe frequency with which the histogram should be updated in Hz

Definition at line 420 of file histo_updater.cpp.

References _timer.

void HistogramUpdater::controlCalibration ( const std::string &  command = "startDarkcal")

control the dark calibration

Definition at line 511 of file histo_updater.cpp.

References _port, _server, and lucassview::TCPClient::controlCalibration().

void HistogramUpdater::reloadIni ( )

tell the server reload the .ini parameters

Definition at line 496 of file histo_updater.cpp.

References _port, _server, and lucassview::TCPClient::reloadIni().

void HistogramUpdater::setPort ( int  port)
inline

set server port

Parameters
portport that the server listens to

Definition at line 57 of file histo_updater.h.

References _port.

void HistogramUpdater::setServer ( const std::string &  server)
inline

set the server

Parameters
serverthe server ip or name

Definition at line 51 of file histo_updater.h.

References _server.

void HistogramUpdater::syncHistogram ( const std::string &  name)

copy a single result into a histogram

Parameters
nameThe name of the result to retrieve

Definition at line 456 of file histo_updater.cpp.

References _port, and _server.

void HistogramUpdater::syncHistograms ( )

update the shown histograms

create the server address from the _server and _port members. With this create a tcpclient object and use it to retrieve the list of available histograms. Use checkList() to filter out the ones that need to be updated. Now go through the list of to update histograms and call updateHist() for each one of them. After that update all Pads in the Canvases using updateCanvases().

Definition at line 430 of file histo_updater.cpp.

References _port, _server, _updateCanv, lucassview::checkList(), and lucassview::updateCanvases().

void HistogramUpdater::writeRootFile ( const std::string &  name)

write all histograms to a root file

first update all available histograms, then go through the list of root histograms and write them to file

Parameters
namethe name of the root file

Definition at line 472 of file histo_updater.cpp.

References _port, and _server.

Member Data Documentation

int HistogramUpdater::_port
private

the server port

Definition at line 94 of file histo_updater.h.

Referenced by controlCalibration(), reloadIni(), setPort(), syncHistogram(), syncHistograms(), and writeRootFile().

std::string HistogramUpdater::_server
private

the server

Definition at line 91 of file histo_updater.h.

Referenced by controlCalibration(), reloadIni(), setServer(), syncHistogram(), syncHistograms(), and writeRootFile().

std::auto_ptr<TTimer> HistogramUpdater::_timer
private

the timer for auto update

Definition at line 97 of file histo_updater.h.

Referenced by autoSync(), and HistogramUpdater().

bool HistogramUpdater::_updateCanv
private

flag whether after updating the histogram the canvas should also update

Definition at line 100 of file histo_updater.h.

Referenced by alsoUpdateCanvas(), and syncHistograms().


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