GSI Object Oriented Online Offline (Go4)  GO4-6.3.0
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 
17 #include "TGo4AbstractInterface.h"
18 #include "TString.h"
19 
20 class TGo4MainWindow;
21 class TGo4ConfigStep;
22 class 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 
178  ViewPanelHandle StartViewPanel() override;
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};
226  Int_t fBlockConfigFlag{0};
227 };
228 
229 #endif
Int_t fiWaitForGUIReaction
Definition: TGo4Script.h:221
void Wait(double tm_sec) override
Definition: TGo4Script.cxx:284
void ConfigStep(const char *stepname, Bool_t enableprocess, Bool_t enablesource, Bool_t enablestore) override
Definition: TGo4Script.cxx:505
void StepMbsFileSource(const char *stepname, const char *sourcename, int timeout, const char *TagFile, int start=0, int stop=0, int interval=0) override
Definition: TGo4Script.cxx:526
void SetMainWindowGeometry(int qtversion, const char *val) override
Definition: TGo4Script.cxx:709
Bool_t ContinueExecution()
Definition: TGo4Script.cxx:94
void StepRandomSource(const char *stepname, const char *sourcename, int timeout) override
Definition: TGo4Script.cxx:613
void DisconnectAnalysis() override
Definition: TGo4Script.cxx:368
Int_t getCounts(Double_t time)
Definition: TGo4Script.cxx:83
Int_t execGUICommands()
Definition: TGo4Script.cxx:185
TString fStrBuf
Definition: TGo4Script.h:223
void StartFitPanel() override
Definition: TGo4Script.cxx:845
void doOutput(const char *str)
Definition: TGo4Script.cxx:88
void ConnectAnalysis(const char *ServerNode, Int_t ServerPort, Int_t ControllerMode, const char *password=nullptr) override
Definition: TGo4Script.cxx:344
void ProcessEvents(Int_t timeout=-1) override
Definition: TGo4Script.cxx:180
TGo4MainWindow * fMainWin
Definition: TGo4Script.h:224
void SetMainWindowState(int qtversion, const char *val) override
Definition: TGo4Script.cxx:703
void StepBackStore(const char *stepname, const char *storename, int bufsize, int splitlevel) override
Definition: TGo4Script.cxx:676
Int_t fBlockConfigFlag
Definition: TGo4Script.h:226
void StepMbsRetryCnt(const char *stepname, int cnt) override
Definition: TGo4Script.cxx:631
TString GetViewPanelName(ViewPanelHandle panel) override
Definition: TGo4Script.cxx:746
void SubmitAnalysisConfig(int tmout=20) override
Definition: TGo4Script.cxx:388
int main(int argc, char **argv)
static TGo4Script * ScriptInstance()
Definition: TGo4Script.cxx:44
void FinishExecution()
Definition: TGo4Script.cxx:124
void StepHDF5Store(const char *stepname, const char *storename, int flags) override
Definition: TGo4Script.cxx:694
void SetAnalysisTerminalMode(int mode) override
Definition: TGo4Script.cxx:449
void StepFileStore(const char *stepname, const char *storename, bool overwrite, int bufsize, int splitlevel, int compression, int autosaveperiod=10000) override
Definition: TGo4Script.cxx:663
TGo4Script(TGo4MainWindow *mainwin)
Definition: TGo4Script.cxx:49
void WaitAnalysis(Int_t delay_sec) override
Definition: TGo4Script.cxx:360
void StepMbsTransportSource(const char *stepname, const char *sourcename, int timeout, int start=0, int stop=0, int interval=0) override
Definition: TGo4Script.cxx:557
TPad * SelectPad(ViewPanelHandle panel, Int_t number=0) override
Definition: TGo4Script.cxx:792
Bool_t SetViewPanelName(ViewPanelHandle panel, const char *newname) override
Definition: TGo4Script.cxx:758
Bool_t DrawItem(const char *itemname, ViewPanelHandle panel=nullptr, const char *drawopt=nullptr) override
Definition: TGo4Script.cxx:827
void HotStart(const char *filename) override
Definition: TGo4Script.cxx:300
void AnalysisAutoSave(const char *filename, Int_t interval, Int_t compression, Bool_t enabled, Bool_t overwrite) override
Definition: TGo4Script.cxx:477
void SetAnalysisConfigMode(int mode) override
Definition: TGo4Script.cxx:463
void StepMbsRevServSource(const char *stepname, const char *sourcename, int timeout, int port=0, int start=0, int stop=0, int interval=0) override
Definition: TGo4Script.cxx:587
ViewPanelHandle GetActiveViewPanel() override
Definition: TGo4Script.cxx:775
void SetSuperimpose(ViewPanelHandle panel, Bool_t on=kTRUE) override
Definition: TGo4Script.cxx:815
void StepFileSource(const char *stepname, const char *sourcename, int timeout) override
Definition: TGo4Script.cxx:515
void LaunchAnalysis() override
Definition: TGo4Script.cxx:305
void RedrawPanel(ViewPanelHandle handle) override
Definition: TGo4Script.cxx:780
static void ProduceScript(const char *filename, TGo4MainWindow *main)
Definition: TGo4Script.cxx:877
void StepUserStore(const char *stepname, const char *storename) override
Definition: TGo4Script.cxx:686
const char * GetDrawnItemName(ViewPanelHandle panel, int cnt=0) override
Definition: TGo4Script.cxx:838
void StartAnalysis() override
Definition: TGo4Script.cxx:399
void StepUserSource(const char *stepname, const char *sourcename, int timeout, int port, const char *expr) override
Definition: TGo4Script.cxx:638
void ShutdownAnalysis() override
Definition: TGo4Script.cxx:378
void AnalysisConfigName(const char *filename) override
Definition: TGo4Script.cxx:488
void DoPostProcessing()
Definition: TGo4Script.cxx:137
void StepMbsSelection(const char *stepname, int start, int stop, int interval) override
Definition: TGo4Script.cxx:603
Bool_t StartScriptExecution(const char *fname)
Definition: TGo4Script.cxx:67
void SetApplyToAll(ViewPanelHandle panel, Bool_t on=kTRUE) override
Definition: TGo4Script.cxx:821
void StepMbsEventServerSource(const char *stepname, const char *sourcename, int timeout, int start=0, int stop=0, int interval=0) override
Definition: TGo4Script.cxx:572
TGo4Picture * GetPadOptions(ViewPanelHandle panel, Int_t padnumber=0) override
Definition: TGo4Script.cxx:805
void * ViewPanelHandle
void StepHDF5Source(const char *stepname, const char *sourcename, int timeout) override
Definition: TGo4Script.cxx:652
Bool_t fErrorFlag
Definition: TGo4Script.h:225
void StepMbsPort(const char *stepname, int port) override
Definition: TGo4Script.cxx:624
void StopAnalysis() override
Definition: TGo4Script.cxx:412
virtual ~TGo4Script()
Definition: TGo4Script.cxx:62
TGo4ConfigStep * GetStepGUI(const char *stepname)
Definition: TGo4Script.cxx:495
Bool_t CanConfigureAnalysis()
Definition: TGo4Script.cxx:437
void Message(const char *msg) override
Definition: TGo4Script.cxx:294
ViewPanelHandle StartViewPanel() override
Definition: TGo4Script.cxx:715
void StepMbsStreamSource(const char *stepname, const char *sourcename, int timeout, int start=0, int stop=0, int interval=0) override
Definition: TGo4Script.cxx:542
ViewPanelHandle FindViewPanel(const char *name) override
Definition: TGo4Script.cxx:753
TGo4ServerProxy * ConnectHttp(const char *servername, const char *account=nullptr, const char *pass=nullptr) override
Definition: TGo4Script.cxx:850
void RefreshNamesList(int tmout=10) override
Definition: TGo4Script.cxx:425
Int_t fiWaitCounter
Definition: TGo4Script.h:222
Bool_t IsWaitSomething() const
Definition: TGo4Script.cxx:132
void DivideViewPanel(ViewPanelHandle panel, Int_t numX, Int_t numY) override
Definition: TGo4Script.cxx:786
string msg
Definition: go4init.py:11