ROOT logo
HYDRA - THE HADES ANALYSIS PACKAGE » (UNKNOWN) » HOnlineMonClientMain

class HOnlineMonClientMain

_HADES_CLASS_DESCRIPTION

 HOnlineMonClientMain

 Main class of the HADES Online Monitoring Client.
 It contains a separat Thread in which the histograms are updated.
 The canvases are updated in the main thread, because the
 canvas-update is not threadsafe.

Function Members (Methods)

public:
HOnlineMonClientMain(TString filename = "")
virtual~HOnlineMonClientMain()
voidAddHist(HOnlineMonClientCanvas* canvas, HOnlineMonClientHist* hist)
static TClass*Class()
TThread*getMainThread()
Int_tGetMasterClient()
Int_tGetReconnect()
TStringGetServerhost()
Int_tGetServerport()
Int_tGetUpdateInterval()
voidHandleAutoSaveRateChange()
voidHandleConnectionError()
voidHandleControlbuttonClick(char* detectorname)
voidHandleMainWindowClose()
voidHandleRefreshRateChange()
voidHandleSendResetHists()
voidHandleSendStopServer()
voidHandleSingleWindowClose(char* windowname, char* detectorname)
voidHandleSnapshotSave()
voidHandleSnapshotSaveOnline()
voidHandleTryClose()
voidInit(Bool_t sendCmdOnly = kFALSE, TString host = "", Int_t port = 0, TString cmd = "")
virtual TClass*IsA() const
Int_tIsMasterClient()
voidRemoveHist(HOnlineMonClientCanvas* canvas, HOnlineMonClientHist* hist)
static voidSetAutoSaveInterval(Int_t minute)
static voidSetAutoSaveIntervalOnline(Int_t minute)
voidSetIsMasterClient(Bool_t master)
voidSetReconnect(Int_t recon)
voidSetServerhost(TString host)
voidSetServerport(Int_t port)
virtual voidShowMembers(TMemberInspector&)
virtual voidStreamer(TBuffer&)
voidStreamerNVirtual(TBuffer& ClassDef_StreamerNVirtual_b)
private:
Bool_tConnect(TString host, Int_t port)
voidCreateClientConfig(TString xmlfile)
voidCreateDetGui(HOnlineMonClientDet* detector)
voidDestroyDetGui(HOnlineMonClientDet* detector)
voidDestroySingleWindow(HOnlineMonClientSimpleWin* window)
voidDestroySingleWindow(HOnlineMonClientTabWin* window)
HOnlineMonHistAddon*GetHist(TString histoname)
TList*GetListOfHistograms()
Bool_tReConnect(TString host, Int_t port)
TStringSendCmdToServer(TString cmd)
voidSetUpdateInterval(Int_t msec)
static void*ThreadUpdateHists(void* arg)
Bool_tUpdateHist(HOnlineMonClientHist* hist)
voidUpdateHists()

Data Members

public:
HOnlineMonClientMainWin*clientmainwinpointer to mainwindow class
TListlistDetectorslist of all detectors
private:
static Int_tAutoSaveIntervalauto save interval in minutes.
static Int_tAutoSaveIntervalOnlineauto save interval in minutes.
Int_tUpdateIntervalupdate interval in secs.
TStringconfigfilename of the xml config file
Int_tdoReconnect0 = stop at crash, 1 = ask for reconnect (default), 2 = auto reconnect
static Int_tisMasterClientremember if it was a master client
static time_tlastSavedremember the time when last saved (in seconds since 1970)
static time_tlastSavedOnlineremember the time when last saved (in seconds since 1970)
static ULong64_tlastSumBytesremember last number of bytes recieved
TListlistHistsglobal list to store the opened histograms.
TListlistPadsglobal list to store the canvas subpads
static TThread*mainThreadthread for the client program
map<TString,TString>pad2histprovide mapping between subpadname and histogram name
TStringserverhost
Int_tserverport
TSocket*socketsocket for network communication
Bool_tupdateCompleteafter complete update of histograms, thread sets this to true
TThread*updateThreadthread to update histograms

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

HOnlineMonClientMain(TString filename = "")
 filename is the name of the xml configuration file
void Init(Bool_t sendCmdOnly = kFALSE, TString host = "", Int_t port = 0, TString cmd = "")
 Initialize program.
 If there is a command, execute it and exit.
 Else start client program with graphical user interface
void* ThreadUpdateHists(void* arg)
void UpdateHists()
void CreateClientConfig(TString xmlfile)
 Parse configuration file
void CreateDetGui(HOnlineMonClientDet* detector)
 Create and show all windows from given detector
void DestroyDetGui(HOnlineMonClientDet* detector)
 Hide and destroy all windows from given detector
void DestroySingleWindow(HOnlineMonClientSimpleWin* window)
 Hide and destroy a single simple window
void DestroySingleWindow(HOnlineMonClientTabWin* window)
 Hide and destroy a single tab window
void HandleRefreshRateChange()
 GUI Event Handler to handle change of refresh rate
void HandleAutoSaveRateChange()
 GUI Event Handler to handle change of refresh rate
void HandleSendStopServer()
void HandleSendResetHists()
void HandleConnectionError()
void HandleTryClose()
void HandleSnapshotSave()
 GUI Event Handler to handle snapshot button click
 Save all active canvases in a ps file in the same folder as the program.
 The filename contains a timestamp
void HandleSnapshotSaveOnline()
 GUI Event Handler to handle snapshot button click
 Save all active canvases in png file in the online snapshot path.
void HandleMainWindowClose()
 GUI Event Handler to handle close-event of the main window
~HOnlineMonClientMain()
void HandleControlbuttonClick(char* detectorname)
void SetUpdateInterval(Int_t msec)
void HandleSingleWindowClose(char* windowname, char* detectorname)
Bool_t Connect(TString host, Int_t port)
Bool_t ReConnect(TString host, Int_t port)
Bool_t UpdateHist(HOnlineMonClientHist* hist)
 update a single histogram and draw it on the current canvas.
 A timestamp is added to the histogram title
TString SendCmdToServer(TString cmd)
TList* GetListOfHistograms()
HOnlineMonHistAddon* GetHist(TString histoname)
void AddHist(HOnlineMonClientCanvas* canvas, HOnlineMonClientHist* hist)
 Put the histogram and the corresponding canvas into the global
 lists listHists / listPads.
 All histograms and canvases/pads in these lists are updated
 by the update-function
void RemoveHist(HOnlineMonClientCanvas* canvas, HOnlineMonClientHist* hist)
 Remove canvas and hist from the global list. Then, the hist and the canvas
 are no longer updated
void SetServerhost(TString host)
TString GetServerhost()
void SetServerport(Int_t port)
Int_t GetServerport()
Int_t GetUpdateInterval()
{ return UpdateInterval;}
void SetAutoSaveInterval(Int_t minute)
{AutoSaveInterval = minute;}
void SetAutoSaveIntervalOnline(Int_t minute)
TThread* getMainThread()
{ return mainThread; }
Int_t IsMasterClient()
{ return isMasterClient <= 0 ? kFALSE : kTRUE ;}
Int_t GetMasterClient()
{ return isMasterClient ;}
void SetIsMasterClient(Bool_t master)
{ isMasterClient = master;}
Int_t GetReconnect()
{ return doReconnect;}
void SetReconnect(Int_t recon)
{ doReconnect = recon;}