GSI Object Oriented Online Offline (Go4)  GO4-5.3.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TGo4Script.h
Go to the documentation of this file.
1 // $Id: TGo4Script.h 1995 2017-03-10 12:40:46Z 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 f�r 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 StepMbsPort(const char* stepname,
143  int port);
144 
145  void StepMbsRetryCnt(const char* stepname,
146  int cnt);
147 
148 
149  void StepFileStore(const char* stepname,
150  const char* storename,
151  bool overwrite,
152  int bufsize,
153  int splitlevel,
154  int compression,
155  int autosaveperiod=10000);
156 
157  void StepBackStore(const char* stepname,
158  const char* storename,
159  int bufsize,
160  int splitlevel);
161 
162  // windows management
163 
164  void SetMainWindowState(int qtversion, const char* val);
165  void SetMainWindowGeometry(int qtversion, const char* val);
166 
168  ViewPanelHandle StartViewPanel(int x, int y, int width, int height, int mode = 1, TGo4Picture* pic = 0);
169  TString GetViewPanelName(ViewPanelHandle panel);
170  ViewPanelHandle FindViewPanel(const char* name);
171  Bool_t SetViewPanelName(ViewPanelHandle panel, const char* newname);
173  void RedrawPanel(ViewPanelHandle handle);
174  void DivideViewPanel(ViewPanelHandle panel, Int_t numX, Int_t numY);
175  TPad* SelectPad(ViewPanelHandle panel, Int_t number = 0);
176  TGo4Picture* GetPadOptions(ViewPanelHandle panel, Int_t padnumber = 0);
177  void SetSuperimpose(ViewPanelHandle panel, Bool_t on = kTRUE);
178  void SetApplyToAll(ViewPanelHandle panel, Bool_t on = kTRUE);
179 
180  Bool_t DrawItem(const char* itemname, ViewPanelHandle panel = 0, const char* drawopt = 0);
181 
182  const char* GetDrawnItemName(ViewPanelHandle panel, int cnt = 0);
183 
184  virtual TGo4ServerProxy* ConnectHttp(const char* servername, const char* account=0, const char* pass=0);
185 
186  protected:
187 
188  static TGo4Script* ScriptInstance();
189 
190  Bool_t CanConfigureAnalysis();
191  Bool_t StartScriptExecution(const char* fname);
192  Bool_t ContinueExecution();
193  void FinishExecution();
194 
195  Bool_t IsWaitSomething();
196 
197  TGo4ConfigStep* GetStepGUI(const char* stepname);
198 
199  static void ProduceScript(const char* filename, TGo4MainWindow* main);
200 
201  Int_t getCounts(Double_t time);
202  void doOutput(const char* str);
203 
204  Int_t execGUICommands();
205 
206  void DoPostProcessing();
207 
210  TString fStrBuf;
212  Bool_t fErrorFlag;
214 };
215 
216 #endif
Int_t fiWaitForGUIReaction
Definition: TGo4Script.h:208
Bool_t ContinueExecution()
Definition: TGo4Script.cxx:101
void SetApplyToAll(ViewPanelHandle panel, Bool_t on=kTRUE)
Definition: TGo4Script.cxx:791
void StepUserSource(const char *stepname, const char *sourcename, int timeout, int port, const char *expr)
Definition: TGo4Script.cxx:640
Int_t getCounts(Double_t time)
Definition: TGo4Script.cxx:90
TPad * SelectPad(ViewPanelHandle panel, Int_t number=0)
Definition: TGo4Script.cxx:762
Int_t execGUICommands()
Definition: TGo4Script.cxx:192
TString fStrBuf
Definition: TGo4Script.h:210
void RedrawPanel(ViewPanelHandle handle)
Definition: TGo4Script.cxx:750
ViewPanelHandle StartViewPanel()
Definition: TGo4Script.cxx:688
ViewPanelHandle GetActiveViewPanel()
Definition: TGo4Script.cxx:745
void StepRandomSource(const char *stepname, const char *sourcename, int timeout)
Definition: TGo4Script.cxx:615
void StepMbsPort(const char *stepname, int port)
Definition: TGo4Script.cxx:626
void StepMbsSelection(const char *stepname, int start, int stop, int interval)
Definition: TGo4Script.cxx:605
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:528
void doOutput(const char *str)
Definition: TGo4Script.cxx:95
void SetAnalysisConfigMode(int mode)
Definition: TGo4Script.cxx:468
void ShutdownAnalysis()
Definition: TGo4Script.cxx:386
TGo4MainWindow * fMainWin
Definition: TGo4Script.h:211
virtual TGo4ServerProxy * ConnectHttp(const char *servername, const char *account=0, const char *pass=0)
Definition: TGo4Script.cxx:815
Int_t fBlockConfigFlag
Definition: TGo4Script.h:213
void LaunchAnalysis()
Definition: TGo4Script.cxx:313
void SubmitAnalysisConfig(int tmout=20)
Definition: TGo4Script.cxx:396
void ConnectAnalysis(const char *ServerNode, Int_t ServerPort, Int_t ControllerMode, const char *password=0)
Definition: TGo4Script.cxx:352
Bool_t DrawItem(const char *itemname, ViewPanelHandle panel=0, const char *drawopt=0)
Definition: TGo4Script.cxx:797
int main(int argc, char **argv)
void ProcessEvents(Int_t timeout=-1)
Definition: TGo4Script.cxx:187
void DisconnectAnalysis()
Definition: TGo4Script.cxx:376
void StepFileSource(const char *stepname, const char *sourcename, int timeout)
Definition: TGo4Script.cxx:517
static TGo4Script * ScriptInstance()
Definition: TGo4Script.cxx:51
void DivideViewPanel(ViewPanelHandle panel, Int_t numX, Int_t numY)
Definition: TGo4Script.cxx:756
void FinishExecution()
Definition: TGo4Script.cxx:131
void SetAnalysisTerminalMode(int mode)
Definition: TGo4Script.cxx:457
TGo4Script(TGo4MainWindow *mainwin)
Definition: TGo4Script.cxx:56
ViewPanelHandle FindViewPanel(const char *name)
Definition: TGo4Script.cxx:723
TString GetViewPanelName(ViewPanelHandle panel)
Definition: TGo4Script.cxx:716
void StopAnalysis()
Definition: TGo4Script.cxx:420
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:589
TGo4Picture * GetPadOptions(ViewPanelHandle panel, Int_t padnumber=0)
Definition: TGo4Script.cxx:775
void ConfigStep(const char *stepname, Bool_t enableprocess, Bool_t enablesource, Bool_t enablestore)
Definition: TGo4Script.cxx:507
void Message(const char *msg)
Definition: TGo4Script.cxx:301
void HotStart(const char *filename)
Definition: TGo4Script.cxx:308
void SetMainWindowGeometry(int qtversion, const char *val)
Definition: TGo4Script.cxx:682
void WaitAnalysis(Int_t delay_sec)
Definition: TGo4Script.cxx:368
void StepMbsTransportSource(const char *stepname, const char *sourcename, int timeout, int start=0, int stop=0, int interval=0)
Definition: TGo4Script.cxx:559
static void ProduceScript(const char *filename, TGo4MainWindow *main)
Definition: TGo4Script.cxx:842
void RefreshNamesList(int tmout=10)
Definition: TGo4Script.cxx:433
void SetSuperimpose(ViewPanelHandle panel, Bool_t on=kTRUE)
Definition: TGo4Script.cxx:785
void AnalysisAutoSave(const char *filename, Int_t interval, Int_t compression, Bool_t enabled, Bool_t overwrite)
Definition: TGo4Script.cxx:479
void DoPostProcessing()
Definition: TGo4Script.cxx:144
Bool_t StartScriptExecution(const char *fname)
Definition: TGo4Script.cxx:74
void SetMainWindowState(int qtversion, const char *val)
Definition: TGo4Script.cxx:676
Bool_t IsWaitSomething()
Definition: TGo4Script.cxx:139
void * ViewPanelHandle
Bool_t fErrorFlag
Definition: TGo4Script.h:212
void StartAnalysis()
Definition: TGo4Script.cxx:407
void AnalysisConfigName(const char *filename)
Definition: TGo4Script.cxx:490
virtual ~TGo4Script()
Definition: TGo4Script.cxx:69
TGo4ConfigStep * GetStepGUI(const char *stepname)
Definition: TGo4Script.cxx:497
Bool_t CanConfigureAnalysis()
Definition: TGo4Script.cxx:445
void StepBackStore(const char *stepname, const char *storename, int bufsize, int splitlevel)
Definition: TGo4Script.cxx:666
void Wait(double tm_sec)
Definition: TGo4Script.cxx:291
const char * GetDrawnItemName(ViewPanelHandle panel, int cnt=0)
Definition: TGo4Script.cxx:808
void StepMbsRetryCnt(const char *stepname, int cnt)
Definition: TGo4Script.cxx:633
Int_t fiWaitCounter
Definition: TGo4Script.h:209
void StepFileStore(const char *stepname, const char *storename, bool overwrite, int bufsize, int splitlevel, int compression, int autosaveperiod=10000)
Definition: TGo4Script.cxx:653
Bool_t SetViewPanelName(ViewPanelHandle panel, const char *newname)
Definition: TGo4Script.cxx:728
void StepMbsEventServerSource(const char *stepname, const char *sourcename, int timeout, int start=0, int stop=0, int interval=0)
Definition: TGo4Script.cxx:574
void StepMbsStreamSource(const char *stepname, const char *sourcename, int timeout, int start=0, int stop=0, int interval=0)
Definition: TGo4Script.cxx:544
string msg
Definition: go4init.py:11