Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #include "TGo4ExampleClientStatus.h"
00015
00016 #include "TH1.h"
00017 #include "Riostream.h"
00018
00019 #include "TGo4Log.h"
00020
00021 TGo4ExampleClientStatus::TGo4ExampleClientStatus(const char* name) : TGo4ClientStatus(name)
00022 {
00023 GO4TRACE((12,"TGo4ExampleClientStatus::TGo4ExampleClientStatus(const char*)",__LINE__, __FILE__));
00024 }
00025
00026 void TGo4ExampleClientStatus::SetHistoStatus(TH1* histogram)
00027 {
00028 GO4TRACE((12,"TGo4ClientStatus::SetHistoStatus(TH1*)",__LINE__, __FILE__));
00029 fxHistogramName = histogram->GetName();
00030
00031
00032 }
00033
00034 void TGo4ExampleClientStatus::SetNames(const char* main, const char* watch)
00035 {
00036 GO4TRACE((12,"TGo4ClientStatus::SetNames(const char*,...)",__LINE__, __FILE__));
00037 fxMainName = main;
00038 fxWatchName = watch;
00039 }
00040
00041 Int_t TGo4ExampleClientStatus::PrintStatus(Text_t* buffer, Int_t buflen)
00042 {
00043 GO4TRACE((12,"TGo4ExampleClientStatus::PrintStatus()",__LINE__, __FILE__));
00044
00045 if(buflen<=0 && buffer!=0)return 0;
00046 Int_t locallen=4096;
00047 Text_t localbuf[4096];
00048 Text_t* current=localbuf;
00049 Int_t size=0;
00050 Int_t restlen=locallen;
00051
00052 current=PrintBuffer(current,restlen, "G-OOOO-> ExampleClient Status Class %s Printout: <-OOOO-G\n",GetName());
00053 current=PrintBuffer(current,restlen, "G-OOOO-> ---------------------------------------------- <-OOOO-G\n");
00054 current=PrintBuffer(current,restlen, "G-OOOO-> Main Runnable Name: %s\n",fxMainName.Data());
00055 current=PrintBuffer(current,restlen, "G-OOOO-> Watch Runnable Name: %s\n",fxWatchName.Data());
00056 current=PrintBuffer(current,restlen, "G-OOOO-> Demo Histogram Name: %s\n",fxHistogramName.Data());
00057 current=PrintBuffer(current,restlen, "G-OOOO-> ---------------------------------------------- <-OOOO-G\n");
00058 Int_t delta=TGo4ClientStatus::PrintStatus(current,restlen);
00059 restlen-=delta;
00060 current+=delta;
00061 current=PrintBuffer(current,restlen, "G-OOOO-> END Example Client Status Class Printout END <-OOOO-G\n");
00062 if(buffer==0)
00063 {
00064 std::cout << localbuf << std::endl;
00065 }
00066 else
00067 {
00068 size=locallen-restlen;
00069 if(size>buflen-1) size=buflen-1;
00070 strncpy(buffer,localbuf,size);
00071 }
00072 return size;
00073 }
00074
00075 TGo4ExampleClientStatus::~TGo4ExampleClientStatus()
00076 {
00077 GO4TRACE((12,"TGo4ExampleClientStatus::~TGo4ExampleClientStatus()",__LINE__, __FILE__));
00078 }