GSI Object Oriented Online Offline (Go4) GO4-6.4.0
Loading...
Searching...
No Matches
TGo4Script.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 TGO4SCRIPT_H
15#define TGO4SCRIPT_H
16
18#include "TString.h"
19
20class TGo4MainWindow;
21class TGo4ConfigStep;
22class TGo4Picture;
23
25
26 friend class TGo4MainWindow;
27
28 protected:
29 void ProcessEvents(Int_t timeout = -1) override;
30
31 public:
32 TGo4Script(TGo4MainWindow* mainwin);
33 virtual ~TGo4Script();
34
35 // general purpose
36 void Wait(double tm_sec) override;
37
38 void HotStart(const char *filename) override;
39
40 void Message(const char *msg) override;
41
42 // analysis start and configuration
43
44 void LaunchAnalysis() override;
45 void LaunchAnalysis(const char *ClientName,
46 const char *ClientDir,
47 const char *ClientExec,
48 const char *ClientNode,
49 Int_t ShellMode = 2, // 0 = exec, 1 = rsh 2 = ssh
50 Int_t TermMode = 1, // 1 = Qt 2 = Xterm 3 = konsole
51 Int_t ExeMode = 0, // 0 = exe, 1 = lib
52 const char *UserArgs = nullptr) override;
53 void ConnectAnalysis(const char *ServerNode,
54 Int_t ServerPort,
55 Int_t ControllerMode, // 0 - obsrver, 1- controller, 2 - administrator
56 const char *password = nullptr) override;
57
58 void WaitAnalysis(Int_t delay_sec) override;
59 void DisconnectAnalysis() override;
60 void ShutdownAnalysis() override;
61
62 void SubmitAnalysisConfig(int tmout = 20) override;
63 void StartAnalysis() override;
64 void StopAnalysis() override;
65 void RefreshNamesList(int tmout = 10) override;
66
67
68 void SetAnalysisTerminalMode(int mode) override; // -1 - close, 0-minimized, 1-normal
69 void SetAnalysisConfigMode(int mode) override; // -1 - close, 0-minimized, 1-normal
70
71 // steps configuration
72
73 void AnalysisAutoSave(const char *filename,
74 Int_t interval,
75 Int_t compression,
76 Bool_t enabled,
77 Bool_t overwrite) override;
78
79 void AnalysisConfigName(const char *filename) override;
80
81 void ConfigStep(const char *stepname,
82 Bool_t enableprocess,
83 Bool_t enablesource,
84 Bool_t enablestore) override;
85
86 void StepFileSource(const char *stepname,
87 const char *sourcename,
88 int timeout) override;
89
90 void StepMbsFileSource(const char *stepname,
91 const char *sourcename,
92 int timeout,
93 const char *TagFile,
94 int start = 0,
95 int stop = 0,
96 int interval = 0) override;
97
98 void StepMbsStreamSource(const char *stepname,
99 const char *sourcename,
100 int timeout,
101 int start = 0,
102 int stop = 0,
103 int interval = 0) override;
104
105 void StepMbsTransportSource(const char *stepname,
106 const char *sourcename,
107 int timeout,
108 int start = 0,
109 int stop = 0,
110 int interval = 0) override;
111
112 void StepMbsEventServerSource(const char *stepname,
113 const char *sourcename,
114 int timeout,
115 int start = 0,
116 int stop = 0,
117 int interval = 0) override;
118
119 void StepMbsRevServSource(const char *stepname,
120 const char *sourcename,
121 int timeout,
122 int port = 0,
123 int start = 0,
124 int stop = 0,
125 int interval = 0) override;
126
127 void StepMbsSelection(const char *stepname,
128 int start,
129 int stop,
130 int interval) override;
131
132 void StepRandomSource(const char *stepname,
133 const char *sourcename,
134 int timeout) override;
135
136 void StepUserSource(const char *stepname,
137 const char *sourcename,
138 int timeout,
139 int port,
140 const char *expr) override;
141
142 void StepHDF5Source(const char *stepname,
143 const char *sourcename,
144 int timeout) override;
145
146
147 void StepMbsPort(const char *stepname,
148 int port) override;
149
150 void StepMbsRetryCnt(const char *stepname,
151 int cnt) override;
152
153 void StepFileStore(const char *stepname,
154 const char *storename,
155 bool overwrite,
156 int bufsize,
157 int splitlevel,
158 int compression,
159 int autosaveperiod = 10000) override;
160
161 void StepBackStore(const char *stepname,
162 const char *storename,
163 int bufsize,
164 int splitlevel) override;
165
166 void StepUserStore(const char *stepname,
167 const char *storename) override;
168
169 void StepHDF5Store(const char *stepname,
170 const char *storename,
171 int flags) override;
172
173 // windows management
174
175 void SetMainWindowState(int qtversion, const char *val) override;
176 void SetMainWindowGeometry(int qtversion, const char *val) override;
177
179 ViewPanelHandle StartViewPanel(int x, int y, int width, int height, int mode = 1, TGo4Picture *pic = nullptr) override;
180 TString GetViewPanelName(ViewPanelHandle panel) override;
181 ViewPanelHandle FindViewPanel(const char *name) override;
182 Bool_t SetViewPanelName(ViewPanelHandle panel, const char *newname) override;
184 void RedrawPanel(ViewPanelHandle handle) override;
185 void DivideViewPanel(ViewPanelHandle panel, Int_t numX, Int_t numY) override;
186 TPad *SelectPad(ViewPanelHandle panel, Int_t number = 0) override;
187 TGo4Picture *GetPadOptions(ViewPanelHandle panel, Int_t padnumber = 0) override;
188 void SetSuperimpose(ViewPanelHandle panel, Bool_t on = kTRUE) override;
189 void SetApplyToAll(ViewPanelHandle panel, Bool_t on = kTRUE) override;
190
191 void StartFitPanel() override;
192
193 Bool_t DrawItem(const char *itemname, ViewPanelHandle panel = nullptr, const char *drawopt = nullptr) override;
194
195 const char *GetDrawnItemName(ViewPanelHandle panel, int cnt = 0) override;
196
197 TGo4ServerProxy *ConnectHttp(const char *servername, const char *account = nullptr, const char *pass = nullptr) override;
198
199 protected:
200
201 static TGo4Script* ScriptInstance();
202
203 Bool_t CanConfigureAnalysis();
204 Bool_t StartScriptExecution(const char *fname);
205 Bool_t ContinueExecution();
206 void FinishExecution();
207
208 Bool_t IsWaitSomething() const;
209
210 TGo4ConfigStep* GetStepGUI(const char *stepname);
211
212 static void ProduceScript(const char *filename, TGo4MainWindow* main);
213
214 Int_t getCounts(Double_t time);
215 void doOutput(const char *str);
216
217 Int_t execGUICommands();
218
219 void DoPostProcessing();
220
222 Int_t fiWaitCounter{0};
223 TString fStrBuf;
225 Bool_t fErrorFlag{kFALSE};
227};
228
229#endif
int main(int argc, char **argv)
void * ViewPanelHandle
This is the Go4 Main Window.
Picture cconfiguration in Go4.
Definition TGo4Picture.h:40
void StepMbsSelection(const char *stepname, int start, int stop, int interval) override
Set event selection for MBS source.
void StepMbsEventServerSource(const char *stepname, const char *sourcename, int timeout, int start=0, int stop=0, int interval=0) override
Set MBS event server as step data source.
void StepMbsFileSource(const char *stepname, const char *sourcename, int timeout, const char *TagFile, int start=0, int stop=0, int interval=0) override
Set MBS file source as step data source.
Int_t fiWaitCounter
Definition TGo4Script.h:222
void LaunchAnalysis() override
Launch analysis in client mode, using default configuration.
void StopAnalysis() override
Stop (suspend) analysis execution.
void AnalysisAutoSave(const char *filename, Int_t interval, Int_t compression, Bool_t enabled, Bool_t overwrite) override
Configure autosave properties of analysis.
Bool_t DrawItem(const char *itemname, ViewPanelHandle panel=nullptr, const char *drawopt=nullptr) override
Draw browser item on specified viewpanel.
Int_t fBlockConfigFlag
Definition TGo4Script.h:226
void ShutdownAnalysis() override
Shutdown running analysis.
void StepFileStore(const char *stepname, const char *storename, bool overwrite, int bufsize, int splitlevel, int compression, int autosaveperiod=10000) override
Set file as step data storage.
Int_t fiWaitForGUIReaction
Definition TGo4Script.h:221
void SetMainWindowGeometry(int qtversion, const char *val) override
Set geometry of main window.
ViewPanelHandle FindViewPanel(const char *name) override
Return handle on viewpanel with specified name.
void SetApplyToAll(ViewPanelHandle panel, Bool_t on=kTRUE) override
Set apply to all flag for active pad of viewpanel.
virtual ~TGo4Script()
void StartFitPanel() override
Starts fit panel.
TGo4Picture * GetPadOptions(ViewPanelHandle panel, Int_t padnumber=0) override
Returns pad options for pad with specified number.
void SetMainWindowState(int qtversion, const char *val) override
Set state of all tool boxes in main window.
TGo4Script(TGo4MainWindow *mainwin)
void Wait(double tm_sec) override
Wait specified number of seconds.
void DisconnectAnalysis() override
Disconnects from running analysis.
Bool_t ContinueExecution()
void StepUserSource(const char *stepname, const char *sourcename, int timeout, int port, const char *expr) override
Set user data source as step data source.
void StartAnalysis() override
Starts (resume) analysis execution.
void StepUserStore(const char *stepname, const char *storename) override
Set user store as step data storage.
TString GetViewPanelName(ViewPanelHandle panel) override
Return name of viewpanel.
static void ProduceScript(const char *filename, TGo4MainWindow *main)
TGo4ServerProxy * ConnectHttp(const char *servername, const char *account=nullptr, const char *pass=nullptr) override
Connect to HTTP server.
ViewPanelHandle GetActiveViewPanel() override
Return handle of last active viewpanel.
void DivideViewPanel(ViewPanelHandle panel, Int_t numX, Int_t numY) override
Divide viewpanel on subpads.
Bool_t IsWaitSomething() const
void StepHDF5Source(const char *stepname, const char *sourcename, int timeout) override
Set hdf5 data source as step data source.
void StepMbsRetryCnt(const char *stepname, int cnt) override
Set retry number for MBS source like stream or transport server.
void AnalysisConfigName(const char *filename) override
Configure name of file, where analysis configuration will be saved.
TGo4MainWindow * fMainWin
Definition TGo4Script.h:224
void StepMbsTransportSource(const char *stepname, const char *sourcename, int timeout, int start=0, int stop=0, int interval=0) override
Set MBS transport server as step data source.
Bool_t CanConfigureAnalysis()
void WaitAnalysis(Int_t delay_sec) override
Waits, until connection to analysis is established.
void SetAnalysisTerminalMode(int mode) override
Set analysis terminal window mode.
void ConfigStep(const char *stepname, Bool_t enableprocess, Bool_t enablesource, Bool_t enablestore) override
Set basic step properties.
void SetAnalysisConfigMode(int mode) override
Set analysis configuration window mode.
void StepMbsRevServSource(const char *stepname, const char *sourcename, int timeout, int port=0, int start=0, int stop=0, int interval=0) override
Set MBS remote event server as step data source.
Int_t execGUICommands()
static TGo4Script * ScriptInstance()
void RefreshNamesList(int tmout=10) override
Sends new request to the analysis and waits for new names list.
void doOutput(const char *str)
void StepMbsStreamSource(const char *stepname, const char *sourcename, int timeout, int start=0, int stop=0, int interval=0) override
Set MBS stream server as step data source.
void RedrawPanel(ViewPanelHandle handle) override
Forces of panel redraw.
void HotStart(const char *filename) override
Executes hotstart file, generated in go4 GUI.
friend class TGo4MainWindow
Definition TGo4Script.h:26
void ConnectAnalysis(const char *ServerNode, Int_t ServerPort, Int_t ControllerMode, const char *password=nullptr) override
Connect to running analysis server.
TString fStrBuf
Definition TGo4Script.h:223
void StepHDF5Store(const char *stepname, const char *storename, int flags) override
Set hdf5 data source as step data storage.
Bool_t StartScriptExecution(const char *fname)
void SetSuperimpose(ViewPanelHandle panel, Bool_t on=kTRUE) override
Set superimpose flag for active pad of viewpanel.
Bool_t SetViewPanelName(ViewPanelHandle panel, const char *newname) override
Change name of viewpanel.
Bool_t fErrorFlag
Definition TGo4Script.h:225
void StepRandomSource(const char *stepname, const char *sourcename, int timeout) override
Set random generator as step data source.
void StepMbsPort(const char *stepname, int port) override
Set custom port number for MBS source like stream or transport server.
TPad * SelectPad(ViewPanelHandle panel, Int_t number=0) override
Set active pad on viewpanel.
Int_t getCounts(Double_t time)
void SubmitAnalysisConfig(int tmout=20) override
Submit configuration to analysis.
void Message(const char *msg) override
Display message in GUI status line.
void StepFileSource(const char *stepname, const char *sourcename, int timeout) override
Set file source as step data source.
TGo4ConfigStep * GetStepGUI(const char *stepname)
void ProcessEvents(Int_t timeout=-1) override
ViewPanelHandle StartViewPanel() override
Create new view panel.
const char * GetDrawnItemName(ViewPanelHandle panel, int cnt=0) override
Provide item name, drawn in the view panel.
void DoPostProcessing()
void StepBackStore(const char *stepname, const char *storename, int bufsize, int splitlevel) override
Set back store as step data storage.
void FinishExecution()
special base class for remote data servers like DABC, HTTP, hist server