GSI Object Oriented Online Offline (Go4) GO4-6.4.0
Loading...
Searching...
No Matches
TGo4AbstractInterface.h
Go to the documentation of this file.
1// $Id$
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
26class TGo4ServerProxy;
27class TPad;
28class TGo4Picture;
29
30typedef void *ViewPanelHandle;
31
33
34
83
84class TGo4AbstractInterface : public TObject {
85 private:
89
90 protected:
93
95 static TString fInitSharedLibs;
96
98
99 virtual void ProcessEvents(Int_t timeout = -1) = 0;
100
101 Bool_t LoadHotStart(const char *filename);
102 Bool_t IsHotStart() const;
103 const char *NextHotStartCmd();
104 void FreeHotStartCmds();
105 static void ProduceLoadLibs(std::ostream &fs);
106
108 static const char *DefaultPicTitle();
109
110
111 public:
112
115 static void SetInitSharedLibs(const char *libs = nullptr);
116
118 virtual ~TGo4AbstractInterface();
119
124
126 static void DeleteInstance();
127
129 static const char *FileExtension();
130
132 static Int_t DelayMillisec();
133
137 TGo4ObjectManager *OM() const { return fOM; }
138
143 TGo4BrowserProxy *Browser() const { return fBrowser; }
144
149
154
158 virtual void HotStart(const char *filename) = 0;
159
160 // general purpose
161
163 virtual void LoadLibrary(const char *fname);
164
167 virtual void OpenFile(const char *fname);
168
173 virtual TString FindItem(const char *objname);
174
177 virtual Bool_t CopyItem(const char *itemname);
178
181 virtual Bool_t DeleteItem(const char *itemname);
182
190 virtual void FetchItem(const char *itemname, Int_t wait_time = 2000);
191
201 virtual TObject *GetObject(const char *itemname, Int_t updatelevel = 1);
202
211 virtual TString SaveToMemory(const char *path, TObject *obj, Bool_t ownership = kFALSE);
212
219 virtual Bool_t SaveToFile(const char *itemname,
220 const char *filename,
221 const char *filetitle = nullptr);
222
234 virtual Bool_t ExportToFile(const char *itemname,
235 const char *dirpath,
236 const char *format,
237 const char *filetitle = nullptr);
238
247 virtual void ConnectHServer(const char *servername,
248 Int_t portnumber,
249 const char *basename,
250 const char *userpass,
251 const char *filter);
252
255 virtual void ConnectDabc(const char *servername);
256
260 virtual TGo4ServerProxy *ConnectHttp(const char *servername, const char *account = nullptr, const char *pass = nullptr) { return nullptr; }
261
265 virtual void Wait(double tm_sec) {}
266
268 virtual void Message(const char *msg) {}
269
270 // analysis start and configuration
271
274 virtual void LaunchAnalysis() {}
275
285 virtual void LaunchAnalysis(const char *ClientName,
286 const char *ClientDir,
287 const char *ClientExec,
288 const char *ClientNode,
289 Int_t ShellMode = 2, // 0 = exec, 1 = rsh, 2 = ssh
290 Int_t TermMode = 1, // 1 = Qt, 2 = Xterm, 3 = konsole
291 Int_t ExeMode = 0, // 0 = exe, 1 = lib
292 const char *UserArgs = nullptr) {}
293
299 virtual void ConnectAnalysis(const char *ServerNode,
300 Int_t ServerPort,
301 Int_t UserMode, // 0 - observer, 1- controller, 2 - administrator
302 const char *password = nullptr) {}
303
309 virtual void WaitAnalysis(Int_t delay_sec) {}
310
312 virtual Bool_t IsAnalysisConnected();
313
316 virtual void DisconnectAnalysis() {}
317
321 virtual void ShutdownAnalysis() {}
322
327 virtual void ExecuteLine(const char *remotecmd);
328
330 virtual void RequestAnalysisConfig();
331
354 virtual void SubmitAnalysisConfig(int tmout = 20) {}
355
357 virtual void StartAnalysis() {}
358
360 virtual void StopAnalysis() {}
361
363 virtual void RefreshNamesList(int tmout = 10) {}
364
370 virtual void SetAnalysisTerminalMode(int mode) {}
371
377 virtual void SetAnalysisConfigMode(int mode) {}
378
382 virtual void MonitorItem(const char *itemname, Bool_t on = kTRUE);
383
387 virtual void StartMonitoring(Int_t period = 10);
388
390 virtual void StopMonitoring();
391
393 virtual void AnalysisAutoSave(const char *filename,
394 Int_t interval,
395 Int_t compression,
396 Bool_t enabled,
397 Bool_t overwrite) {}
398
400 virtual void AnalysisConfigName(const char *filename) {}
401
402 // steps configuration
403
405 virtual void ConfigStep(const char *stepname,
406 Bool_t enableprocess,
407 Bool_t enablesource,
408 Bool_t enablestore) {}
409
411 virtual void StepFileSource(const char *stepname,
412 const char *sourcename,
413 int timeout) {}
414
416 virtual void StepMbsFileSource(const char *stepname,
417 const char *sourcename,
418 int timeout,
419 const char *TagFile,
420 int start = 0,
421 int stop = 0,
422 int interval = 0) {}
423
425 virtual void StepMbsStreamSource(const char *stepname,
426 const char *sourcename,
427 int timeout,
428 int start = 0,
429 int stop = 0,
430 int interval = 0) {}
431
433 virtual void StepMbsTransportSource(const char *stepname,
434 const char *sourcename,
435 int timeout,
436 int start = 0,
437 int stop = 0,
438 int interval = 0) {}
439
441 virtual void StepMbsEventServerSource(const char *stepname,
442 const char *sourcename,
443 int timeout,
444 int start = 0,
445 int stop = 0,
446 int interval = 0) {}
447
449 virtual void StepMbsRevServSource(const char *stepname,
450 const char *sourcename,
451 int timeout,
452 int port = 0,
453 int start = 0,
454 int stop = 0,
455 int interval = 0) {}
456
458 virtual void StepMbsSelection(const char *stepname,
459 int start,
460 int stop,
461 int interval) {}
462
464 virtual void StepRandomSource(const char *stepname,
465 const char *sourcename,
466 int timeout) {}
467
469 virtual void StepMbsPort(const char *stepname,
470 int port) {}
471
473 virtual void StepMbsRetryCnt(const char *stepname,
474 int cnt) {}
475
477 virtual void StepUserSource(const char *stepname,
478 const char *sourcename,
479 int timeout,
480 int port,
481 const char *expr) {}
482
484 virtual void StepHDF5Source(const char *stepname,
485 const char *sourcename,
486 int timeout) {}
487
489 virtual void StepFileStore(const char *stepname,
490 const char *storename,
491 bool overwrite,
492 int bufsize,
493 int splitlevel,
494 int compression,
495 int autosaveperiod = 0) {}
496
498 virtual void StepBackStore(const char *stepname,
499 const char *storename,
500 int bufsize,
501 int splitlevel) {}
502
504 virtual void StepUserStore(const char *stepname,
505 const char *storename) {}
506
508 virtual void StepHDF5Store(const char *stepname,
509 const char *storename,
510 int flags) {}
511
512 // windows management
513
515 virtual void SetMainWindowState(int qtversion, const char *val) {}
516
518 virtual void SetMainWindowGeometry(int qtversion, const char *val) {}
519
523 virtual ViewPanelHandle StartViewPanel() { return nullptr; }
524
537 virtual ViewPanelHandle StartViewPanel(int x, int y, int width, int height, int mode = 1, TGo4Picture *pic = nullptr) { return nullptr; }
538
540 virtual TString GetViewPanelName(ViewPanelHandle panel) { return TString(); }
541
543 virtual ViewPanelHandle FindViewPanel(const char *name) { return nullptr; }
544
546 virtual Bool_t SetViewPanelName(ViewPanelHandle panel, const char *newname) { return kFALSE; }
547
549 virtual ViewPanelHandle GetActiveViewPanel() { return nullptr; }
550
552 virtual void RedrawPanel(ViewPanelHandle panel) {}
553
555 virtual void DivideViewPanel(ViewPanelHandle panel, Int_t numX, Int_t numY) {}
556
561 virtual TPad *SelectPad(ViewPanelHandle panel, Int_t number = 0) { return nullptr; }
562
564 virtual TGo4Picture *GetPadOptions(ViewPanelHandle panel, Int_t padnumber = 0) { return nullptr; }
565
567 virtual void SetSuperimpose(ViewPanelHandle panel, Bool_t on = kTRUE) {}
568
570 virtual void SetApplyToAll(ViewPanelHandle panel, Bool_t on = kTRUE) {}
571
576 virtual Bool_t DrawItem(const char *itemname, ViewPanelHandle panel = nullptr, const char *drawopt = nullptr) { return kFALSE; }
577
581 virtual void RedrawItem(const char *itemname);
582
585 virtual const char *GetDrawnItemName(ViewPanelHandle panel, int cnt = 0) { return nullptr; }
586
588 virtual void StartFitPanel() {}
589
591};
592
593
594#endif
@ Go4_maximized
@ Go4_minimized
void * ViewPanelHandle
virtual void ConnectHServer(const char *servername, Int_t portnumber, const char *basename, const char *userpass, const char *filter)
Connect to GSI histogram server.
virtual void SubmitAnalysisConfig(int tmout=20)
Submit configuration to analysis.
virtual void StartFitPanel()
Starts fit panel.
virtual void StepFileStore(const char *stepname, const char *storename, bool overwrite, int bufsize, int splitlevel, int compression, int autosaveperiod=0)
Set file as step data storage.
virtual void AnalysisConfigName(const char *filename)
Configure name of file, where analysis configuration will be saved.
virtual void RedrawPanel(ViewPanelHandle panel)
Forces of panel redraw.
virtual void MonitorItem(const char *itemname, Bool_t on=kTRUE)
Enable/disable monitoring of browser item.
TGo4AnalysisProxy * Analysis()
Returns pointer on analysis proxy.
virtual TString GetViewPanelName(ViewPanelHandle panel)
Return name of viewpanel.
static Int_t DelayMillisec()
Default delay during hotstart file extension.
virtual void SetAnalysisTerminalMode(int mode)
Set analysis terminal window mode.
virtual void StopAnalysis()
Stop (suspend) analysis execution.
virtual TGo4Picture * GetPadOptions(ViewPanelHandle panel, Int_t padnumber=0)
Returns pad options for pad with specified number.
virtual void StepMbsRevServSource(const char *stepname, const char *sourcename, int timeout, int port=0, int start=0, int stop=0, int interval=0)
Set MBS remote event server as step data source.
virtual void RedrawItem(const char *itemname)
Redraw item of given name on all viewpanels/editors.
virtual void HotStart(const char *filename)=0
Executes hotstart file, generated in go4 GUI.
virtual ViewPanelHandle GetActiveViewPanel()
Return handle of last active viewpanel.
virtual void OpenFile(const char *fname)
Open specified file in read-only mode.
virtual void LoadLibrary(const char *fname)
Load specified ROOT library.
static TGo4AbstractInterface * Instance()
Return pointer on instance of implementation of TGo4AbstractInterface class.
virtual void WaitAnalysis(Int_t delay_sec)
Waits, until connection to analysis is established.
virtual void ShutdownAnalysis()
Shutdown running analysis.
virtual Bool_t CopyItem(const char *itemname)
Copy item to workspace.
virtual void ConnectAnalysis(const char *ServerNode, Int_t ServerPort, Int_t UserMode, const char *password=nullptr)
Connect to running analysis server.
TGo4BrowserProxy * fBrowser
virtual void SetApplyToAll(ViewPanelHandle panel, Bool_t on=kTRUE)
Set apply to all flag for active pad of viewpanel.
virtual void ConnectDabc(const char *servername)
Connect to DABC server.
virtual void StepRandomSource(const char *stepname, const char *sourcename, int timeout)
Set random generator as step data source.
virtual void Message(const char *msg)
Display message in GUI status line.
virtual ViewPanelHandle FindViewPanel(const char *name)
Return handle on viewpanel with specified name.
virtual void Wait(double tm_sec)
Wait specified number of seconds.
virtual void StepMbsSelection(const char *stepname, int start, int stop, int interval)
Set event selection for MBS source.
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=nullptr)
Launch analysis in client mode.
static const char * DefaultPicTitle()
Returns default hotstart file extension.
TGo4BrowserProxy * Browser() const
Returns pointer on browser proxy.
virtual Bool_t ExportToFile(const char *itemname, const char *dirpath, const char *format, const char *filetitle=nullptr)
Export browser item to different file formats.
virtual void StepUserStore(const char *stepname, const char *storename)
Set user store as step data storage.
virtual Bool_t DeleteItem(const char *itemname)
Delete item (if allowed).
virtual void RequestAnalysisConfig()
Requests current analysis configuration.
virtual void StartMonitoring(Int_t period=10)
Start monitoring mode.
virtual void StepMbsPort(const char *stepname, int port)
Set custom port number for MBS source like stream or transport server.
virtual void StepBackStore(const char *stepname, const char *storename, int bufsize, int splitlevel)
Set back store as step data storage.
virtual void StepMbsTransportSource(const char *stepname, const char *sourcename, int timeout, int start=0, int stop=0, int interval=0)
Set MBS transport server as step data source.
virtual Bool_t IsAnalysisConnected()
Indicate, if analysis was successfully connected.
virtual void SetAnalysisConfigMode(int mode)
Set analysis configuration window mode.
TGo4ObjectManager * OM() const
Returns pointer on object manager.
virtual void ConfigStep(const char *stepname, Bool_t enableprocess, Bool_t enablesource, Bool_t enablestore)
Set basic step properties.
virtual TGo4ServerProxy * ConnectHttp(const char *servername, const char *account=nullptr, const char *pass=nullptr)
Connect to HTTP server.
virtual void StopMonitoring()
Stop monitoring mode.
virtual Bool_t SetViewPanelName(ViewPanelHandle panel, const char *newname)
Change name of viewpanel.
virtual void StepUserSource(const char *stepname, const char *sourcename, int timeout, int port, const char *expr)
Set user data source as step data source.
virtual TPad * SelectPad(ViewPanelHandle panel, Int_t number=0)
Set active pad on viewpanel.
static TGo4AbstractInterface * fgInstance
static const char * FileExtension()
Returns default hotstart file extension.
virtual void SetSuperimpose(ViewPanelHandle panel, Bool_t on=kTRUE)
Set superimpose flag for active pad of viewpanel.
TGo4ServerProxy * Server()
Returns pointer on more generic server proxy.
void Initialize(TGo4ObjectManager *om, TGo4BrowserProxy *br)
list of shared libraries when application is started
virtual void StepHDF5Source(const char *stepname, const char *sourcename, int timeout)
Set hdf5 data source as step data source.
virtual void RefreshNamesList(int tmout=10)
Sends new request to the analysis and waits for new names list.
virtual void ExecuteLine(const char *remotecmd)
Execute one macro line on analysis side.
virtual void StepMbsRetryCnt(const char *stepname, int cnt)
Set retry number for MBS source like stream or transport server.
virtual void StepMbsStreamSource(const char *stepname, const char *sourcename, int timeout, int start=0, int stop=0, int interval=0)
Set MBS stream server as step data source.
virtual void FetchItem(const char *itemname, Int_t wait_time=2000)
Fetch item from data source.
virtual Bool_t SaveToFile(const char *itemname, const char *filename, const char *filetitle=nullptr)
Save specified browser item to file.
virtual ~TGo4AbstractInterface()
destructor
virtual void SetMainWindowGeometry(int qtversion, const char *val)
Set geometry of main window.
virtual void LaunchAnalysis()
Launch analysis in client mode, using default configuration.
virtual void StepMbsFileSource(const char *stepname, const char *sourcename, int timeout, const char *TagFile, int start=0, int stop=0, int interval=0)
Set MBS file source as step data source.
virtual void DivideViewPanel(ViewPanelHandle panel, Int_t numX, Int_t numY)
Divide viewpanel on subpads.
virtual const char * GetDrawnItemName(ViewPanelHandle panel, int cnt=0)
Provide item name, drawn in the view panel.
virtual void SetMainWindowState(int qtversion, const char *val)
Set state of all tool boxes in main window.
Bool_t LoadHotStart(const char *filename)
virtual void ProcessEvents(Int_t timeout=-1)=0
virtual void StepMbsEventServerSource(const char *stepname, const char *sourcename, int timeout, int start=0, int stop=0, int interval=0)
Set MBS event server as step data source.
virtual TObject * GetObject(const char *itemname, Int_t updatelevel=1)
Returns object, assigned to specified browser item.
virtual void StepFileSource(const char *stepname, const char *sourcename, int timeout)
Set file source as step data source.
virtual ViewPanelHandle StartViewPanel(int x, int y, int width, int height, int mode=1, TGo4Picture *pic=nullptr)
Create new viewpanel with specified parameters.
virtual TString SaveToMemory(const char *path, TObject *obj, Bool_t ownership=kFALSE)
Save object in browser workspace.
virtual void StepHDF5Store(const char *stepname, const char *storename, int flags)
Set hdf5 data source as step data storage.
static void SetInitSharedLibs(const char *libs=nullptr)
method to set initial list of shared libraries, which than will not be included in hotstart file
virtual ViewPanelHandle StartViewPanel()
Create new view panel.
ClassDefOverride(TGo4AbstractInterface, 0)
virtual Bool_t DrawItem(const char *itemname, ViewPanelHandle panel=nullptr, const char *drawopt=nullptr)
Draw browser item on specified viewpanel.
static void DeleteInstance()
Delete instance of interface class.
virtual TString FindItem(const char *objname)
Find item with given object name.
virtual void AnalysisAutoSave(const char *filename, Int_t interval, Int_t compression, Bool_t enabled, Bool_t overwrite)
Configure autosave properties of analysis.
static void ProduceLoadLibs(std::ostream &fs)
virtual void DisconnectAnalysis()
Disconnects from running analysis.
virtual void StartAnalysis()
Starts (resume) analysis execution.
Picture cconfiguration in Go4.
Definition TGo4Picture.h:40
special base class for remote data servers like DABC, HTTP, hist server