GSI Object Oriented Online Offline (Go4)  GO4-6.1.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TGo4Script.h
Go to the documentation of this file.
1 // $Id: TGo4Script.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 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);
30 
31  public:
32  TGo4Script(TGo4MainWindow* mainwin);
33  virtual ~TGo4Script();
34 
35  // general purpose
36  void Wait(double tm_sec);
37 
38  void HotStart(const char* filename);
39 
40  void Message(const char* msg);
41 
42  // analysis start and configuration
43 
44  void LaunchAnalysis();
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 = 0);
53  void ConnectAnalysis(const char* ServerNode,
54  Int_t ServerPort,
55  Int_t ControllerMode, // 0 - obsrver, 1- controller, 2 - administrator
56  const char* password = 0);
57 
58  void WaitAnalysis(Int_t delay_sec);
59  void DisconnectAnalysis();
60  void ShutdownAnalysis();
61 
62  void SubmitAnalysisConfig(int tmout = 20);
63  void StartAnalysis();
64  void StopAnalysis();
65  void RefreshNamesList(int tmout = 10);
66 
67 
68  void SetAnalysisTerminalMode(int mode); // -1 - close , 0-minimized, 1-normal
69  void SetAnalysisConfigMode(int mode); // -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);
78 
79  void AnalysisConfigName(const char* filename);
80 
81  void ConfigStep(const char* stepname,
82  Bool_t enableprocess,
83  Bool_t enablesource,
84  Bool_t enablestore);
85 
86  void StepFileSource(const char* stepname,
87  const char* sourcename,
88  int timeout);
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);
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);
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);
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);
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);
126 
127  void StepMbsSelection(const char* stepname,
128  int start,
129  int stop,
130  int interval);
131 
132  void StepRandomSource(const char* stepname,
133  const char* sourcename,
134  int timeout);
135 
136  void StepUserSource(const char* stepname,
137  const char* sourcename,
138  int timeout,
139  int port,
140  const char* expr);
141 
142  void StepHDF5Source(const char* stepname,
143  const char* sourcename,
144  int timeout);
145 
146 
147  void StepMbsPort(const char* stepname,
148  int port);
149 
150  void StepMbsRetryCnt(const char* stepname,
151  int cnt);
152 
153 
154  void StepFileStore(const char* stepname,
155  const char* storename,
156  bool overwrite,
157  int bufsize,
158  int splitlevel,
159  int compression,
160  int autosaveperiod=10000);
161 
162  void StepBackStore(const char* stepname,
163  const char* storename,
164  int bufsize,
165  int splitlevel);
166 
167  void StepUserStore(const char* stepname,
168  const char* storename);
169 
170  void StepHDF5Store(const char* stepname,
171  const char* storename,
172  int flags);
173 
174  // windows management
175 
176  void SetMainWindowState(int qtversion, const char* val);
177  void SetMainWindowGeometry(int qtversion, const char* val);
178 
180  ViewPanelHandle StartViewPanel(int x, int y, int width, int height, int mode = 1, TGo4Picture* pic = 0);
181  TString GetViewPanelName(ViewPanelHandle panel);
182  ViewPanelHandle FindViewPanel(const char* name);
183  Bool_t SetViewPanelName(ViewPanelHandle panel, const char* newname);
185  void RedrawPanel(ViewPanelHandle handle);
186  void DivideViewPanel(ViewPanelHandle panel, Int_t numX, Int_t numY);
187  TPad* SelectPad(ViewPanelHandle panel, Int_t number = 0);
188  TGo4Picture* GetPadOptions(ViewPanelHandle panel, Int_t padnumber = 0);
189  void SetSuperimpose(ViewPanelHandle panel, Bool_t on = kTRUE);
190  void SetApplyToAll(ViewPanelHandle panel, Bool_t on = kTRUE);
191 
192  void StartFitPanel();
193 
194  Bool_t DrawItem(const char* itemname, ViewPanelHandle panel = 0, const char* drawopt = 0);
195 
196  const char* GetDrawnItemName(ViewPanelHandle panel, int cnt = 0);
197 
198  virtual TGo4ServerProxy* ConnectHttp(const char* servername, const char* account=0, const char* pass=0);
199 
200  protected:
201 
202  static TGo4Script* ScriptInstance();
203 
204  Bool_t CanConfigureAnalysis();
205  Bool_t StartScriptExecution(const char* fname);
206  Bool_t ContinueExecution();
207  void FinishExecution();
208 
209  Bool_t IsWaitSomething();
210 
211  TGo4ConfigStep* GetStepGUI(const char* stepname);
212 
213  static void ProduceScript(const char* filename, TGo4MainWindow* main);
214 
215  Int_t getCounts(Double_t time);
216  void doOutput(const char* str);
217 
218  Int_t execGUICommands();
219 
220  void DoPostProcessing();
221 
224  TString fStrBuf;
226  Bool_t fErrorFlag;
228 };
229 
230 #endif
Int_t fiWaitForGUIReaction
Definition: TGo4Script.h:222
void StepUserStore(const char *stepname, const char *storename)
Definition: TGo4Script.cxx:681
Bool_t ContinueExecution()
Definition: TGo4Script.cxx:94
void SetApplyToAll(ViewPanelHandle panel, Bool_t on=kTRUE)
Definition: TGo4Script.cxx:813
void StepUserSource(const char *stepname, const char *sourcename, int timeout, int port, const char *expr)
Definition: TGo4Script.cxx:633
Int_t getCounts(Double_t time)
Definition: TGo4Script.cxx:83
TPad * SelectPad(ViewPanelHandle panel, Int_t number=0)
Definition: TGo4Script.cxx:784
Int_t execGUICommands()
Definition: TGo4Script.cxx:185
TString fStrBuf
Definition: TGo4Script.h:224
void RedrawPanel(ViewPanelHandle handle)
Definition: TGo4Script.cxx:772
ViewPanelHandle StartViewPanel()
Definition: TGo4Script.cxx:710
ViewPanelHandle GetActiveViewPanel()
Definition: TGo4Script.cxx:767
void StepHDF5Store(const char *stepname, const char *storename, int flags)
Definition: TGo4Script.cxx:689
void StepRandomSource(const char *stepname, const char *sourcename, int timeout)
Definition: TGo4Script.cxx:608
void StepMbsPort(const char *stepname, int port)
Definition: TGo4Script.cxx:619
void StepMbsSelection(const char *stepname, int start, int stop, int interval)
Definition: TGo4Script.cxx:598
void StepMbsFileSource(const char *stepname, const char *sourcename, int timeout, const char *TagFile, int start=0, int stop=0, int interval=0)
Definition: TGo4Script.cxx:521
void doOutput(const char *str)
Definition: TGo4Script.cxx:88
void SetAnalysisConfigMode(int mode)
Definition: TGo4Script.cxx:461
void ShutdownAnalysis()
Definition: TGo4Script.cxx:379
TGo4MainWindow * fMainWin
Definition: TGo4Script.h:225
virtual TGo4ServerProxy * ConnectHttp(const char *servername, const char *account=0, const char *pass=0)
Definition: TGo4Script.cxx:842
void StartFitPanel()
Definition: TGo4Script.cxx:837
Int_t fBlockConfigFlag
Definition: TGo4Script.h:227
void LaunchAnalysis()
Definition: TGo4Script.cxx:306
void SubmitAnalysisConfig(int tmout=20)
Definition: TGo4Script.cxx:389
void ConnectAnalysis(const char *ServerNode, Int_t ServerPort, Int_t ControllerMode, const char *password=0)
Definition: TGo4Script.cxx:345
Bool_t DrawItem(const char *itemname, ViewPanelHandle panel=0, const char *drawopt=0)
Definition: TGo4Script.cxx:819
int main(int argc, char **argv)
void ProcessEvents(Int_t timeout=-1)
Definition: TGo4Script.cxx:180
void DisconnectAnalysis()
Definition: TGo4Script.cxx:369
void StepFileSource(const char *stepname, const char *sourcename, int timeout)
Definition: TGo4Script.cxx:510
static TGo4Script * ScriptInstance()
Definition: TGo4Script.cxx:44
void DivideViewPanel(ViewPanelHandle panel, Int_t numX, Int_t numY)
Definition: TGo4Script.cxx:778
void FinishExecution()
Definition: TGo4Script.cxx:124
void SetAnalysisTerminalMode(int mode)
Definition: TGo4Script.cxx:450
TGo4Script(TGo4MainWindow *mainwin)
Definition: TGo4Script.cxx:49
ViewPanelHandle FindViewPanel(const char *name)
Definition: TGo4Script.cxx:745
TString GetViewPanelName(ViewPanelHandle panel)
Definition: TGo4Script.cxx:738
void StopAnalysis()
Definition: TGo4Script.cxx:413
void StepMbsRevServSource(const char *stepname, const char *sourcename, int timeout, int port=0, int start=0, int stop=0, int interval=0)
Definition: TGo4Script.cxx:582
TGo4Picture * GetPadOptions(ViewPanelHandle panel, Int_t padnumber=0)
Definition: TGo4Script.cxx:797
void ConfigStep(const char *stepname, Bool_t enableprocess, Bool_t enablesource, Bool_t enablestore)
Definition: TGo4Script.cxx:500
void Message(const char *msg)
Definition: TGo4Script.cxx:294
void HotStart(const char *filename)
Definition: TGo4Script.cxx:301
void SetMainWindowGeometry(int qtversion, const char *val)
Definition: TGo4Script.cxx:704
void WaitAnalysis(Int_t delay_sec)
Definition: TGo4Script.cxx:361
void StepMbsTransportSource(const char *stepname, const char *sourcename, int timeout, int start=0, int stop=0, int interval=0)
Definition: TGo4Script.cxx:552
static void ProduceScript(const char *filename, TGo4MainWindow *main)
Definition: TGo4Script.cxx:869
void RefreshNamesList(int tmout=10)
Definition: TGo4Script.cxx:426
void SetSuperimpose(ViewPanelHandle panel, Bool_t on=kTRUE)
Definition: TGo4Script.cxx:807
void AnalysisAutoSave(const char *filename, Int_t interval, Int_t compression, Bool_t enabled, Bool_t overwrite)
Definition: TGo4Script.cxx:472
void DoPostProcessing()
Definition: TGo4Script.cxx:137
Bool_t StartScriptExecution(const char *fname)
Definition: TGo4Script.cxx:67
void SetMainWindowState(int qtversion, const char *val)
Definition: TGo4Script.cxx:698
Bool_t IsWaitSomething()
Definition: TGo4Script.cxx:132
void * ViewPanelHandle
Bool_t fErrorFlag
Definition: TGo4Script.h:226
void StartAnalysis()
Definition: TGo4Script.cxx:400
void StepHDF5Source(const char *stepname, const char *sourcename, int timeout)
Definition: TGo4Script.cxx:647
void AnalysisConfigName(const char *filename)
Definition: TGo4Script.cxx:483
virtual ~TGo4Script()
Definition: TGo4Script.cxx:62
TGo4ConfigStep * GetStepGUI(const char *stepname)
Definition: TGo4Script.cxx:490
Bool_t CanConfigureAnalysis()
Definition: TGo4Script.cxx:438
void StepBackStore(const char *stepname, const char *storename, int bufsize, int splitlevel)
Definition: TGo4Script.cxx:671
void Wait(double tm_sec)
Definition: TGo4Script.cxx:284
const char * GetDrawnItemName(ViewPanelHandle panel, int cnt=0)
Definition: TGo4Script.cxx:830
void StepMbsRetryCnt(const char *stepname, int cnt)
Definition: TGo4Script.cxx:626
Int_t fiWaitCounter
Definition: TGo4Script.h:223
void StepFileStore(const char *stepname, const char *storename, bool overwrite, int bufsize, int splitlevel, int compression, int autosaveperiod=10000)
Definition: TGo4Script.cxx:658
Bool_t SetViewPanelName(ViewPanelHandle panel, const char *newname)
Definition: TGo4Script.cxx:750
void StepMbsEventServerSource(const char *stepname, const char *sourcename, int timeout, int start=0, int stop=0, int interval=0)
Definition: TGo4Script.cxx:567
void StepMbsStreamSource(const char *stepname, const char *sourcename, int timeout, int start=0, int stop=0, int interval=0)
Definition: TGo4Script.cxx:537
string msg
Definition: go4init.py:11