GSI Object Oriented Online Offline (Go4)  GO4-6.1.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TGo4AbstractInterface.h
Go to the documentation of this file.
1 // $Id: TGo4AbstractInterface.h 3013 2021-02-18 12:12:44Z linev $
2 //-----------------------------------------------------------------------
3 // The GSI Online Offline Object Oriented (Go4) Project
4 // Experiment Data Processing at EE department, GSI
5 //-----------------------------------------------------------------------
6 // Copyright (C) 2000- GSI Helmholtzzentrum fuer Schwerionenforschung GmbH
7 // Planckstr. 1, 64291 Darmstadt, Germany
8 // Contact: http://go4.gsi.de
9 //-----------------------------------------------------------------------
10 // This software can be used under the license agreements as stated
11 // in Go4License.txt file which is part of the distribution.
12 //-----------------------------------------------------------------------
13 
14 #ifndef TGO4ABSTRACTINTERFACE_H
15 #define TGO4ABSTRACTINTERFACE_H
16 
17 #include "TObject.h"
18 
19 #include "TString.h"
20 #include "TList.h"
21 #include <ostream>
22 
23 class TGo4ObjectManager;
24 class TGo4BrowserProxy;
25 class TGo4AnalysisProxy;
26 class TGo4ServerProxy;
27 class TPad;
29 
30 typedef void* ViewPanelHandle;
31 
32 
77 
78 
79 class TGo4AbstractInterface : public TObject {
80  private:
83  TList fxCommands;
84 
85  protected:
88 
90  static TString fInitSharedLibs;
91 
93 
94  virtual void ProcessEvents(Int_t timeout = -1) = 0;
95 
96  Bool_t LoadHotStart(const char* filename);
97  Bool_t IsHotStart();
98  const char* NextHotStartCmd();
99  void FreeHotStartCmds();
100  static void ProduceLoadLibs(std::ostream& fs);
101 
103  static const char* DefaultPicTitle();
104 
105 
106  public:
107 
110  static void SetInitSharedLibs(const char* libs = 0);
111 
113  virtual ~TGo4AbstractInterface();
114 
119 
121  static void DeleteInstance();
122 
124  static const char* FileExtension();
125 
127  static Int_t DelayMillisec();
128 
132  TGo4ObjectManager* OM() const { return fOM; }
133 
138  TGo4BrowserProxy* Browser() const { return fBrowser; }
139 
144 
149 
154  virtual void HotStart(const char* filename) = 0;
155 
156  // general purpose
157 
159  virtual void LoadLibrary(const char* fname);
160 
163  virtual void OpenFile(const char* fname);
164 
169  virtual TString FindItem(const char* objname);
170 
173  virtual Bool_t CopyItem(const char* itemname);
174 
177  virtual Bool_t DeleteItem(const char* itemname);
178 
186  virtual void FetchItem(const char* itemname, Int_t wait_time = 2000);
187 
197  virtual TObject* GetObject(const char* itemname, Int_t updatelevel = 1);
198 
208  virtual TString SaveToMemory(const char* path, TObject* obj, Bool_t ownership = kFALSE);
209 
216  virtual Bool_t SaveToFile(const char* itemname,
217  const char* filename,
218  const char* filetitle = 0);
219 
232  virtual Bool_t ExportToFile(const char* itemname,
233  const char* dirpath,
234  const char* format,
235  const char* filetitle = 0);
236 
246  virtual void ConnectHServer(const char* servername,
247  Int_t portnumber,
248  const char* basename,
249  const char* userpass,
250  const char* filter);
251 
253  virtual void ConnectDabc(const char* servername);
254 
257  virtual TGo4ServerProxy* ConnectHttp(const char* servername, const char* account=0, const char* pass=0) { return 0; }
258 
262  virtual void Wait(double tm_sec) {}
263 
265  virtual void Message(const char* msg) {}
266 
267  // analysis start and configuration
268 
271  virtual void LaunchAnalysis() {}
272 
281  virtual void LaunchAnalysis(const char* ClientName,
282  const char* ClientDir,
283  const char* ClientExec,
284  const char* ClientNode,
285  Int_t ShellMode = 2, // 0 = exec, 1 = rsh, 2 = ssh
286  Int_t TermMode = 1, // 1 = Qt, 2 = Xterm, 3 = konsole
287  Int_t ExeMode = 0, // 0 = exe, 1 = lib
288  const char* UserArgs = 0) {}
289 
296  virtual void ConnectAnalysis(const char* ServerNode,
297  Int_t ServerPort,
298  Int_t UserMode, // 0 - observer, 1- controller, 2 - administrator
299  const char* password = 0) {}
300 
306  virtual void WaitAnalysis(Int_t delay_sec) {}
307 
309  virtual Bool_t IsAnalysisConnected();
310 
313  virtual void DisconnectAnalysis() {}
314 
318  virtual void ShutdownAnalysis() {}
319 
324  virtual void ExecuteLine(const char* remotecmd);
325 
327  virtual void RequestAnalysisConfig();
328 
351  virtual void SubmitAnalysisConfig(int tmout = 20) {}
352 
354  virtual void StartAnalysis() {}
355 
357  virtual void StopAnalysis() {}
358 
360  virtual void RefreshNamesList(int tmout = 10) {}
361 
365  virtual void SetAnalysisTerminalMode(int mode) {}
366 
370  virtual void SetAnalysisConfigMode(int mode) {}
371 
375  virtual void MonitorItem(const char* itemname, Bool_t on = kTRUE);
376 
380  virtual void StartMonitoring(Int_t period = 10);
381 
383  virtual void StopMonitoring();
384 
386  virtual void AnalysisAutoSave(const char* filename,
387  Int_t interval,
388  Int_t compression,
389  Bool_t enabled,
390  Bool_t overwrite) {}
391 
393  virtual void AnalysisConfigName(const char* filename) {}
394 
395  // steps configuration
396 
398  virtual void ConfigStep(const char* stepname,
399  Bool_t enableprocess,
400  Bool_t enablesource,
401  Bool_t enablestore) {}
402 
404  virtual void StepFileSource(const char* stepname,
405  const char* sourcename,
406  int timeout) {}
407 
409  virtual void StepMbsFileSource(const char* stepname,
410  const char* sourcename,
411  int timeout,
412  const char* TagFile,
413  int start = 0,
414  int stop = 0,
415  int interval = 0) {}
416 
418  virtual void StepMbsStreamSource(const char* stepname,
419  const char* sourcename,
420  int timeout,
421  int start = 0,
422  int stop = 0,
423  int interval = 0) {}
424 
426  virtual void StepMbsTransportSource(const char* stepname,
427  const char* sourcename,
428  int timeout,
429  int start = 0,
430  int stop = 0,
431  int interval = 0) {}
432 
434  virtual void StepMbsEventServerSource(const char* stepname,
435  const char* sourcename,
436  int timeout,
437  int start = 0,
438  int stop = 0,
439  int interval = 0) {}
440 
442  virtual void StepMbsRevServSource(const char* stepname,
443  const char* sourcename,
444  int timeout,
445  int port = 0,
446  int start = 0,
447  int stop = 0,
448  int interval = 0) {}
449 
451  virtual void StepMbsSelection(const char* stepname,
452  int start,
453  int stop,
454  int interval) {}
455 
457  virtual void StepRandomSource(const char* stepname,
458  const char* sourcename,
459  int timeout) {}
460 
462  virtual void StepMbsPort(const char* stepname,
463  int port) {}
464 
466  virtual void StepMbsRetryCnt(const char* stepname,
467  int cnt) {}
468 
470  virtual void StepUserSource(const char* stepname,
471  const char* sourcename,
472  int timeout,
473  int port,
474  const char* expr) {}
475 
477  virtual void StepHDF5Source(const char* stepname,
478  const char* sourcename,
479  int timeout) {}
480 
481 
483  virtual void StepFileStore(const char* stepname,
484  const char* storename,
485  bool overwrite,
486  int bufsize,
487  int splitlevel,
488  int compression,
489  int autosaveperiod=0) {}
490 
492  virtual void StepBackStore(const char* stepname,
493  const char* storename,
494  int bufsize,
495  int splitlevel) {}
496 
498  virtual void StepUserStore(const char* stepname,
499  const char* storename) {}
500 
502  virtual void StepHDF5Store(const char* stepname,
503  const char* storename,
504  int flags) {}
505 
506  // windows management
507 
509  virtual void SetMainWindowState(int qtversion, const char* val) {}
510 
512  virtual void SetMainWindowGeometry(int qtversion, const char* val) {}
513 
517  virtual ViewPanelHandle StartViewPanel() { return 0; }
518 
529  virtual ViewPanelHandle StartViewPanel(int x, int y, int width, int height, int mode = 1, TGo4Picture* pic = 0) { return 0; }
530 
532  virtual TString GetViewPanelName(ViewPanelHandle panel) { return TString(); }
533 
535  virtual ViewPanelHandle FindViewPanel(const char* name) { return 0; }
536 
538  virtual Bool_t SetViewPanelName(ViewPanelHandle panel, const char* newname) { return kFALSE; }
539 
541  virtual ViewPanelHandle GetActiveViewPanel() { return 0; }
542 
544  virtual void RedrawPanel(ViewPanelHandle panel) {}
545 
547  virtual void DivideViewPanel(ViewPanelHandle panel, Int_t numX, Int_t numY) {}
548 
553  virtual TPad* SelectPad(ViewPanelHandle panel, Int_t number = 0) { return 0; }
554 
556  virtual TGo4Picture* GetPadOptions(ViewPanelHandle panel, Int_t padnumber = 0) { return 0; }
557 
559  virtual void SetSuperimpose(ViewPanelHandle panel, Bool_t on = kTRUE) {}
560 
562  virtual void SetApplyToAll(ViewPanelHandle panel, Bool_t on = kTRUE) {}
563 
569  virtual Bool_t DrawItem(const char* itemname, ViewPanelHandle panel = 0, const char* drawopt = 0) { return kFALSE; }
570 
574  virtual void RedrawItem(const char* itemname);
575 
578  virtual const char* GetDrawnItemName(ViewPanelHandle panel, int cnt = 0) { return 0; }
579 
580  virtual void StartFitPanel() {}
581 
583 };
584 
585 
586 #endif
virtual ViewPanelHandle StartViewPanel()
static TGo4AbstractInterface * fgInstance
virtual void StepMbsRevServSource(const char *stepname, const char *sourcename, int timeout, int port=0, int start=0, int stop=0, int interval=0)
virtual TObject * GetObject(const char *itemname, Int_t updatelevel=1)
virtual Bool_t DrawItem(const char *itemname, ViewPanelHandle panel=0, const char *drawopt=0)
virtual void RefreshNamesList(int tmout=10)
Bool_t LoadHotStart(const char *filename)
virtual void LaunchAnalysis(const char *ClientName, const char *ClientDir, const char *ClientExec, const char *ClientNode, Int_t ShellMode=2, Int_t TermMode=1, Int_t ExeMode=0, const char *UserArgs=0)
virtual void StepUserSource(const char *stepname, const char *sourcename, int timeout, int port, const char *expr)
virtual void HotStart(const char *filename)=0
virtual void StepHDF5Source(const char *stepname, const char *sourcename, int timeout)
virtual void SetAnalysisTerminalMode(int mode)
virtual TPad * SelectPad(ViewPanelHandle panel, Int_t number=0)
virtual Bool_t ExportToFile(const char *itemname, const char *dirpath, const char *format, const char *filetitle=0)
virtual void DivideViewPanel(ViewPanelHandle panel, Int_t numX, Int_t numY)
virtual void FetchItem(const char *itemname, Int_t wait_time=2000)
TGo4BrowserProxy * Browser() const
virtual void StepRandomSource(const char *stepname, const char *sourcename, int timeout)
virtual void StepMbsRetryCnt(const char *stepname, int cnt)
virtual void ConnectAnalysis(const char *ServerNode, Int_t ServerPort, Int_t UserMode, const char *password=0)
void Initialize(TGo4ObjectManager *om, TGo4BrowserProxy *br)
list of shared libraries when application is started
virtual void SetMainWindowState(int qtversion, const char *val)
virtual void RedrawItem(const char *itemname)
virtual TGo4ServerProxy * ConnectHttp(const char *servername, const char *account=0, const char *pass=0)
virtual void StepFileSource(const char *stepname, const char *sourcename, int timeout)
virtual void ConfigStep(const char *stepname, Bool_t enableprocess, Bool_t enablesource, Bool_t enablestore)
virtual void StepBackStore(const char *stepname, const char *storename, int bufsize, int splitlevel)
static void SetInitSharedLibs(const char *libs=0)
virtual void SubmitAnalysisConfig(int tmout=20)
static const char * FileExtension()
virtual TString SaveToMemory(const char *path, TObject *obj, Bool_t ownership=kFALSE)
virtual Bool_t SaveToFile(const char *itemname, const char *filename, const char *filetitle=0)
virtual void SetApplyToAll(ViewPanelHandle panel, Bool_t on=kTRUE)
virtual void OpenFile(const char *fname)
virtual const char * GetDrawnItemName(ViewPanelHandle panel, int cnt=0)
virtual void StepMbsEventServerSource(const char *stepname, const char *sourcename, int timeout, int start=0, int stop=0, int interval=0)
virtual void StepHDF5Store(const char *stepname, const char *storename, int flags)
TGo4AnalysisProxy * Analysis()
virtual ViewPanelHandle FindViewPanel(const char *name)
virtual void StepMbsSelection(const char *stepname, int start, int stop, int interval)
EGo4ViewPanelMode
virtual void Wait(double tm_sec)
virtual void SetMainWindowGeometry(int qtversion, const char *val)
virtual Bool_t IsAnalysisConnected()
virtual void ConnectHServer(const char *servername, Int_t portnumber, const char *basename, const char *userpass, const char *filter)
static const char * DefaultPicTitle()
virtual void StepMbsStreamSource(const char *stepname, const char *sourcename, int timeout, int start=0, int stop=0, int interval=0)
virtual void StepUserStore(const char *stepname, const char *storename)
virtual Bool_t DeleteItem(const char *itemname)
virtual void StartMonitoring(Int_t period=10)
virtual TGo4Picture * GetPadOptions(ViewPanelHandle panel, Int_t padnumber=0)
virtual void ProcessEvents(Int_t timeout=-1)=0
virtual void ExecuteLine(const char *remotecmd)
virtual void AnalysisConfigName(const char *filename)
virtual TString GetViewPanelName(ViewPanelHandle panel)
TGo4BrowserProxy * fBrowser
virtual Bool_t CopyItem(const char *itemname)
virtual void Message(const char *msg)
virtual void RedrawPanel(ViewPanelHandle panel)
virtual Bool_t SetViewPanelName(ViewPanelHandle panel, const char *newname)
TGo4ObjectManager * fOM
static void ProduceLoadLibs(std::ostream &fs)
virtual void ConnectDabc(const char *servername)
virtual void SetSuperimpose(ViewPanelHandle panel, Bool_t on=kTRUE)
virtual void WaitAnalysis(Int_t delay_sec)
void * ViewPanelHandle
virtual void StepMbsFileSource(const char *stepname, const char *sourcename, int timeout, const char *TagFile, int start=0, int stop=0, int interval=0)
virtual TString FindItem(const char *objname)
virtual ViewPanelHandle GetActiveViewPanel()
virtual void MonitorItem(const char *itemname, Bool_t on=kTRUE)
ClassDef(TGo4AbstractInterface, 1)
static TGo4AbstractInterface * Instance()
TGo4ObjectManager * OM() const
virtual void StepMbsPort(const char *stepname, int port)
virtual void StepMbsTransportSource(const char *stepname, const char *sourcename, int timeout, int start=0, int stop=0, int interval=0)
virtual void StepFileStore(const char *stepname, const char *storename, bool overwrite, int bufsize, int splitlevel, int compression, int autosaveperiod=0)
virtual void SetAnalysisConfigMode(int mode)
virtual void AnalysisAutoSave(const char *filename, Int_t interval, Int_t compression, Bool_t enabled, Bool_t overwrite)
virtual void LoadLibrary(const char *fname)
string msg
Definition: go4init.py:11
virtual ViewPanelHandle StartViewPanel(int x, int y, int width, int height, int mode=1, TGo4Picture *pic=0)