00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #include "TGo4MbsFileParameter.h"
00017
00018 #include "Riostream.h"
00019
00020 #include "TGo4Log.h"
00021 #include "TGo4Status.h"
00022 #include "Go4EventServerTypes.h"
00023
00024 const char* TGo4MbsFile__fgcNOTAGFILE = "GO4-NOLMDTAG";
00025
00026 TGo4MbsFileParameter::TGo4MbsFileParameter() :
00027 TGo4EventSourceParameter("default MBS File", GO4EV_MBS_FILE),
00028 fuStartEvent(0),
00029 fuStopEvent(0),
00030 fuEventInterval(0),
00031 fxTagFile()
00032 {
00033 TRACE((14,"TGo4MbsFileParameter::TGo4MbsFileParameter()", __LINE__, __FILE__));
00034 SetTagName(TGo4MbsFile__fgcNOTAGFILE);
00035 }
00036
00037 TGo4MbsFileParameter::TGo4MbsFileParameter(const char* name) :
00038 TGo4EventSourceParameter(name, GO4EV_MBS_FILE),
00039 fuStartEvent(0),
00040 fuStopEvent(0),
00041 fuEventInterval(0),
00042 fxTagFile()
00043 {
00044 TRACE((14,"TGo4MbsFileParameter::TGo4MbsFileParameter(const char*,...)", __LINE__, __FILE__));
00045 SetTagName(TGo4MbsFile__fgcNOTAGFILE);
00046 }
00047
00048 TGo4MbsFileParameter::~TGo4MbsFileParameter()
00049 {
00050 TRACE((14,"TGo4MbsFileParameter::~TGo4MbsFileParameter()", __LINE__, __FILE__));
00051 }
00052
00053 Int_t TGo4MbsFileParameter::PrintParameter(Text_t* buffer, Int_t buflen)
00054 {
00055 TRACE((12,"TGo4MbsFileParameter::PrintParameter()",__LINE__, __FILE__));
00056 Int_t locallen=128000;
00057 Text_t localbuf[128000];
00058 if(buflen<0 && buffer!=0)
00059 return 0;
00060 Int_t size=0;
00061 Int_t restlen=locallen;
00062 Text_t* current=localbuf;
00063
00064 Int_t delta=TGo4EventSourceParameter::PrintParameter(current,restlen);
00065 restlen-=delta;
00066 current+= delta;
00067 current=TGo4Status::PrintIndent(current,restlen);
00068 current=TGo4Status::PrintBuffer(current,restlen, " Startevent: \t%d",GetStartEvent());
00069 current=TGo4Status::PrintBuffer(current,restlen, "\t Stopevent: \t%d \n",GetStopEvent());
00070 current=TGo4Status::PrintIndent(current,restlen);
00071 current=TGo4Status::PrintBuffer(current,restlen, " Event interval: \t%d",GetEventInterval());
00072 current=TGo4Status::PrintBuffer(current,restlen, "\t Tagfile: %s \n",GetTagName());
00073 if(buffer==0)
00074 {
00075 cout << localbuf << endl;
00076 }
00077 else
00078 {
00079 size=locallen-restlen;
00080 if(size>buflen-1)
00081 size=buflen-1;
00082 strncpy(buffer,localbuf,size);
00083 }
00084 return size;
00085 }
00086
00087 Bool_t TGo4MbsFileParameter::UpdateFrom(TGo4Parameter* rhs)
00088 {
00089 TRACE((12,"TGo4MbsFileParameter::UpdateFrom()",__LINE__, __FILE__));
00090 if((rhs!=0) && rhs->InheritsFrom(TGo4MbsFileParameter::Class()))
00091 {
00092 TGo4MbsFileParameter* mbspar=dynamic_cast<TGo4MbsFileParameter*>(rhs);
00093 if(!mbspar) return kFALSE;
00094 if(!TGo4EventSourceParameter::UpdateFrom(rhs)) return kFALSE;
00095 SetStartEvent(mbspar->GetStartEvent());
00096 SetStopEvent(mbspar->GetStopEvent());
00097 SetEventInterval(mbspar->GetEventInterval());
00098 SetTagName(mbspar->GetTagName());
00099 return kTRUE;
00100 }
00101 else
00102 {
00103 return kFALSE;
00104 }
00105 return kFALSE;
00106 }
00107
00108