Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

TGo4ExampleClientStatus.cxx

Go to the documentation of this file.
00001 //-------------------------------------------------------------
00002 //        Go4 Release Package v3.04-01 (build 30401)
00003 //                      28-November-2008
00004 //---------------------------------------------------------------
00005 //   The GSI Online Offline Object Oriented (Go4) Project
00006 //   Experiment Data Processing at EE department, GSI
00007 //---------------------------------------------------------------
00008 //
00009 //Copyright (C) 2000- Gesellschaft f. Schwerionenforschung, GSI
00010 //                    Planckstr. 1, 64291 Darmstadt, Germany
00011 //Contact:            http://go4.gsi.de
00012 //----------------------------------------------------------------
00013 //This software can be used under the license agreements as stated
00014 //in Go4License.txt file which is part of the distribution.
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    // here the complete internal histogram information may be stored; we leave that
00034    // as an exercise for the reader!
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); // gives us the superclass data
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 //----------------------------END OF GO4 SOURCE FILE ---------------------

Generated on Fri Nov 28 12:59:30 2008 for Go4-v3.04-1 by  doxygen 1.4.2