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