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