61 #if ROOT_VERSION_CODE < ROOT_VERSION(5,34,20)
62 #define HasOption(x) GetValueFromOptions(x)!=0
69 std::cout <<
"\nTGo4AnalysisWebStatus Update From Url with " << rest_url_opt << std::endl;
73 message.Form(
"TGo4AnalysisWebStatus::UpdateFromUrl ");
76 url.SetOptions(rest_url_opt);
83 if (url.HasOption(theKey.Data()))
87 message.Append(TString::Format(
", CLOSING analysis"));
94 if (url.HasOption(theKey.Data()))
96 const char* filename = url.GetValueFromOptions(theKey.Data());
98 message.Append(TString::Format(
", saving autosave file %s", filename));
105 if (url.HasOption(theKey.Data()))
107 const char* filename = url.GetValueFromOptions(theKey.Data());
109 message.Append(TString::Format(
", saving configuration file %s", filename));
116 if (url.HasOption(theKey.Data()))
118 const char* filename = url.GetValueFromOptions(theKey.Data());
123 message.Append(TString::Format(
", loaded configuration file %s", filename));
127 message.Append(TString::Format(
", /!\\ FAILED to load configuration file %s !!!", filename));
141 if (url.HasOption(theKey.Data()))
145 Bool_t enablestep = ((TString(url.GetValueFromOptions(theKey.Data())) ==
"true") ? kTRUE : kFALSE);
146 message.Append(TString::Format(
", %s=%d", theKey.Data(), enablestep));
150 if (url.HasOption(theKey.Data()))
153 Bool_t enablesource = ((TString(url.GetValueFromOptions(theKey.Data())) ==
"true") ? kTRUE : kFALSE);
154 message.Append(TString::Format(
", %s=%d", theKey.Data(), enablesource));
158 if (url.HasOption(theKey.Data()))
161 Bool_t enablestore = ((TString(url.GetValueFromOptions(theKey.Data())) ==
"true") ? kTRUE : kFALSE);
162 message.Append(TString::Format(
", %s=%d", theKey.Data(), enablestore));
167 if (url.HasOption(theKey.Data()))
169 Int_t srctype = url.GetIntValueFromOptions(theKey.Data());
170 message.Append(TString::Format(
", %s=%d", theKey.Data(), srctype));
176 TString srcname = oldsrcpar->GetName();
177 Int_t port = oldmbspar ? oldmbspar->
GetPort() : 0;
179 port = olduserpar ? olduserpar->
GetPort() : 0;
237 if (url.HasOption(theKey.Data()))
239 TString srcname = url.GetValueFromOptions(theKey.Data());
240 message.Append(TString::Format(
", %s=%s", theKey.Data(), srcname.Data()));
242 srcpar->SetName(srcname.Data());
247 if (url.HasOption(theKey.Data()))
249 Int_t port = url.GetIntValueFromOptions(theKey.Data());
250 message.Append(TString::Format(
", %s=%d", theKey.Data(), port));
260 TString::Format(
" - /!\\ NEVER COME HERE: Could not set port to type %s ", srcpar->ClassName()));
264 if (url.HasOption(theKey.Data()))
266 Int_t timeout = url.GetIntValueFromOptions(theKey.Data());
267 message.Append(TString::Format(
", %s=%d", theKey.Data(), timeout));
273 if (url.HasOption(theKey.Data()))
275 Int_t retry = url.GetIntValueFromOptions(theKey.Data());
276 message.Append(TString::Format(
", %s=%d", theKey.Data(), retry));
283 TString::Format(
" - /!\\ NEVER COME HERE: Could not set retry count to type %s ",
284 srcpar->ClassName()));
288 if (url.HasOption(theKey.Data()))
290 Int_t startevent = url.GetIntValueFromOptions(theKey.Data());
291 message.Append(TString::Format(
", %s=%d", theKey.Data(), startevent));
298 TString::Format(
" - /!\\ NEVER COME HERE: Could not set start event to type %s ",
299 srcpar->ClassName()));
303 if (url.HasOption(theKey.Data()))
305 Int_t stopevent = url.GetIntValueFromOptions(theKey.Data());
306 message.Append(TString::Format(
", %s=%d", theKey.Data(), stopevent));
313 TString::Format(
" - /!\\ NEVER COME HERE: Could not set stop event to type %s ",
314 srcpar->ClassName()));
318 if (url.HasOption(theKey.Data()))
320 Int_t skipevents = url.GetIntValueFromOptions(theKey.Data());
321 message.Append(TString::Format(
", %s=%d", theKey.Data(), skipevents));
328 TString::Format(
" - /!\\ NEVER COME HERE: Could not set event interval to type %s ",
329 srcpar->ClassName()));
333 if (url.HasOption(theKey.Data()))
335 Int_t storetype = url.GetIntValueFromOptions(theKey.Data());
336 message.Append(TString::Format(
", %s=%d", theKey.Data(), storetype));
340 TString storename = oldstorepar->GetName();
348 Int_t oldsplit = -1, oldbuf = -1, oldcomp = -1, oldauto = -1, oldover = -1;
365 TString::Format(
" - /!\\ NEVER COME HERE: old event store parameter is type %s ",
366 oldstorepar ? oldstorepar->ClassName() :
"nullpointer"));
406 if (url.HasOption(theKey.Data()))
408 TString storename = url.GetValueFromOptions(theKey.Data());
409 message.Append(TString::Format(
", %s=%s", theKey.Data(), storename.Data()));
411 storepar->SetName(storename.Data());
415 if (url.HasOption(theKey.Data()))
417 Int_t split = url.GetIntValueFromOptions(theKey.Data());
418 message.Append(TString::Format(
", %s=%d", theKey.Data(), split));
428 TString::Format(
" - /!\\ NEVER COME HERE: can not set split level to eventstore type %s ",
429 storepar ? storepar->ClassName() :
"nullpointer"));
434 if (url.HasOption(theKey.Data()))
436 Int_t bufsize = url.GetIntValueFromOptions(theKey.Data());
437 message.Append(TString::Format(
", %s=%d", theKey.Data(), bufsize));
447 TString::Format(
" - /!\\ NEVER COME HERE: can not set bufsize to eventstore type %s ",
448 storepar ? storepar->ClassName() :
"nullpointer"));
452 if (url.HasOption(theKey.Data()))
454 Int_t bufsize = url.GetIntValueFromOptions(theKey.Data());
455 message.Append(TString::Format(
", %s=%d", theKey.Data(), bufsize));
462 TString::Format(
" - /!\\ NEVER COME HERE: can not set compression to eventstore type %s ",
463 storepar ? storepar->ClassName() :
"nullpointer"));
467 if (url.HasOption(theKey.Data()))
469 Int_t treeautosave = url.GetIntValueFromOptions(theKey.Data());
470 message.Append(TString::Format(
", %s=%d", theKey.Data(), treeautosave));
477 TString::Format(
" - /!\\ NEVER COME HERE: can not set tree autosave interval to eventstore type %s ",
478 storepar ? storepar->ClassName() :
"nullpointer"));
482 if (url.HasOption(theKey.Data()))
484 Int_t overwrite = url.GetIntValueFromOptions(theKey.Data());
485 message.Append(TString::Format(
", %s=%d", theKey.Data(), overwrite));
492 TString::Format(
" - /!\\ NEVER COME HERE: can not set overwrite mode to eventstore type %s ",
493 storepar ? storepar->ClassName() :
"nullpointer"));
504 if (url.HasOption(theKey.Data()))
506 Int_t asfenabled = url.GetIntValueFromOptions(theKey.Data());
507 message.Append(TString::Format(
", %s=%d", theKey.Data(), asfenabled));
512 if (url.HasOption(theKey.Data()))
514 TString asfname = url.GetValueFromOptions(theKey.Data());
515 message.Append(TString::Format(
", %s=%s", theKey.Data(), asfname.Data()));
520 if (url.HasOption(theKey.Data()))
522 Int_t asftime = url.GetIntValueFromOptions(theKey.Data());
523 message.Append(TString::Format(
", %s=%d", theKey.Data(), asftime));
528 if (url.HasOption(theKey.Data()))
530 Int_t asfcomp = url.GetIntValueFromOptions(theKey.Data());
531 message.Append(TString::Format(
", %s=%d", theKey.Data(), asfcomp));
536 if (url.HasOption(theKey.Data()))
538 Int_t asfover = url.GetIntValueFromOptions(theKey.Data());
539 message.Append(TString::Format(
", %s=%d", theKey.Data(), asfover));
544 if (url.HasOption(theKey.Data()))
546 TString prefsname = url.GetValueFromOptions(theKey.Data());
547 message.Append(TString::Format(
", %s=%s", theKey.Data(), prefsname.Data()));
552 std::cout <<
"\nTGo4AnalysisWebStatus Update From Url :StopAnalysis..."<< std::endl;
554 std::cout <<
"\nTGo4AnalysisWebStatus Update From Url :SetStatus..."<< std::endl;
560 std::cout <<
"\nTGo4AnalysisWebStatus Update From Url :InitEventClasses..."<< std::endl;
566 std::cout <<
"\nTGo4AnalysisWebStatus Update From Url :StartAnalysis..."<< std::endl;
568 std::cout <<
"\nTGo4AnalysisWebStatus Update From Url :After StartAnalysis"<< std::endl;
569 message.Append(
"\n Analysis was started!");
588 if ((an==0) || (status==0))
return kFALSE;
640 if (ana==0)
return kFALSE;
650 if ((exeline==0) || (*exeline==0))
return kFALSE;
652 if(ana==0)
return kFALSE;
657 return errcode!=0 ? kFALSE : kTRUE;
void SetAutoFileName(const char *name)
void SetCompression(Int_t comp)
void SetStartEvent(UInt_t firstindex)
void SetProcessEnabled(Bool_t on=kTRUE)
static TString fgxURL_PREFS_SAVE
static TString fgxURL_SOURCE_TYPE
void SetStoreEnabled(Bool_t on=kTRUE)
void SetRetryCnt(Int_t cnt)
TGo4EventStoreParameter * GetStorePar() const
void SetSplitlevel(Int_t split)
static TString fgxURL_SOURCE_PORT
UInt_t GetStartEvent() const
Bool_t LoadStatus(const char *filename=0)
void SetSplitlevel(Int_t split)
virtual Int_t PrintStatus(Text_t *buffer=0, Int_t buflen=0)
Bool_t ExecuteLine(const char *cmd)
void SetStopEvent(UInt_t lastindex)
void UpdateStatus(TGo4AnalysisStatus *state)
virtual void CloseAnalysis()
static TString fgxURL_ENABLESTORE
static TString fgxURL_STORE_SPLIT
void SetAutoSaveOn(Bool_t on=kTRUE)
static TString fgxURL_SOURCE_NAME
static TString fgxURL_STORE_COMP
static TString fgxURL_ENABLESTEP
static TString fgxURL_STORE_OVERWRITE
TGo4AnalysisStepStatus * NextStepStatus()
static TString fgxURL_PREFS_LOAD
Int_t IsOverwriteMode() const
void SetSourceEnabled(Bool_t on=kTRUE)
static TString fgxURL_ENABLESOURCE
static TString fgxURL_SOURCE_FIRST
static TString fgxURL_SOURCE_LAST
TGo4AnalysisClient * GetAnalysisClient() const
static TString fgxURL_PREFS_NAME
Bool_t IsStopWorking() const
static TString fgxURL_ASF_COMP
TGo4AnalysisStatus * CreateStatus()
Int_t GetAutosaveSize() const
void SetAutosaveSize(Int_t interval)
UInt_t GetStopEvent() const
Bool_t ApplyStatus(TGo4AnalysisStatus *status)
static TString fgxURL_SOURCE_TIMEOUT
void SetStorePar(TGo4EventStoreParameter *kind)
static TString fgxURL_ASF_SAVE
Bool_t SaveStatus(const char *fname)
void SetSourcePar(TGo4EventSourceParameter *kind)
Int_t fiAutoSaveCompression
TGo4EventSourceParameter * GetSourcePar() const
static TString fgxURL_STARTRUN
void SetOverwriteMode(Bool_t over=kTRUE)
static TString fgxURL_STORE_ASF
Int_t GetCompression() const
static TString fgxURL_SOURCE_SKIP
static TString fgxURL_CLOSE
Int_t GetSplitlevel() const
static TString fgxURL_SOURCE_RETRY
void SetTimeout(Int_t out)
void SetEventInterval(UInt_t skipinterval)
void SetBufsize(Int_t bufsize)
static const char * Message(Int_t prio, const char *text,...)
Bool_t UpdateFromUrl(const char *rest_url_opt)
static TString fgxURL_STORE_TYPE
Int_t GetSplitlevel() const
static TString fgxURL_ASF_INTERVAL
virtual Bool_t InitEventClasses()
static TString fgxURL_ASF_OVERWRITE
static TString fgxURL_STORE_BUF
static TString fgxURL_ASF_NAME
static TString fgxURL_STORE_NAME
void SetAutoSaveOverwrite(Bool_t over=kTRUE)
Int_t fbAutoSaveOverwrite
Long_t ExecuteLine(const char *command, Int_t *errcode=0)
void SetAutoSaveFile(const char *filename=0, Bool_t overwrite=kFALSE, Int_t compression=5)
Bool_t LoadStatus(const char *fname)
Bool_t SaveStatus(const char *filename=0)
void SetConfigFileName(const char *name)
void SetBufsize(Int_t bufsize)
void SetAutoSaveInterval(Int_t i)
static TString fgxURL_ASF_ENABLED
TGo4AnalysisStatus * CreateStatus()
UInt_t GetEventInterval() const
static TGo4Analysis * Instance()
void SetAutoSaveCompression(Int_t i=5)
Bool_t WriteAutoSave(const char *fname, Bool_t overwrite, Int_t complevel)
void SetStatus(TGo4AnalysisStatus *state)