00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef TGO4SCRIPT_H
00015 #define TGO4SCRIPT_H
00016
00017 #include "TGo4AbstractInterface.h"
00018 #include "TString.h"
00019
00020 class TGo4MainWindow;
00021 class TGo4ConfigStep;
00022 class TGo4Picture;
00023
00024 class TGo4Script : public TGo4AbstractInterface {
00025
00026 friend class TGo4MainWindow;
00027
00028 protected:
00029 void ProcessEvents(Int_t timeout = -1);
00030
00031 public:
00032 TGo4Script(TGo4MainWindow* mainwin);
00033 virtual ~TGo4Script();
00034
00035
00036 void Wait(double tm_sec);
00037
00038 void HotStart(const char* filename);
00039
00040 void Message(const char* msg);
00041
00042
00043
00044 void LaunchAnalysis();
00045 void LaunchAnalysis(const char* ClientName,
00046 const char* ClientDir,
00047 const char* ClientExec,
00048 const char* ClientNode,
00049 Int_t ShellMode = 2,
00050 Int_t TermMode = 1,
00051 Int_t ExeMode = 0,
00052 const char* UserArgs = 0);
00053 void ConnectAnalysis(const char* ServerNode,
00054 Int_t ServerPort,
00055 Int_t ControllerMode,
00056 const char* password = 0);
00057
00058 void WaitAnalysis(Int_t delay_sec);
00059 void DisconnectAnalysis();
00060 void ShutdownAnalysis();
00061
00062 void SubmitAnalysisConfig(int tmout = 20);
00063 void StartAnalysis();
00064 void StopAnalysis();
00065 void RefreshNamesList(int tmout = 10);
00066
00067
00068 void SetAnalysisTerminalMode(int mode);
00069 void SetAnalysisConfigMode(int mode);
00070
00071
00072
00073 void AnalysisAutoSave(const char* filename,
00074 Int_t interval,
00075 Int_t compression,
00076 Bool_t enabled,
00077 Bool_t overwrite);
00078
00079 void AnalysisConfigName(const char* filename);
00080
00081 void ConfigStep(const char* stepname,
00082 Bool_t enableprocess,
00083 Bool_t enablesource,
00084 Bool_t enablestore);
00085
00086 void StepFileSource(const char* stepname,
00087 const char* sourcename,
00088 int timeout);
00089
00090 void StepMbsFileSource(const char* stepname,
00091 const char* sourcename,
00092 int timeout,
00093 const char* TagFile,
00094 int start = 0,
00095 int stop = 0,
00096 int interval = 0);
00097
00098 void StepMbsStreamSource(const char* stepname,
00099 const char* sourcename,
00100 int timeout,
00101 int start = 0,
00102 int stop = 0,
00103 int interval = 0);
00104
00105 void StepMbsTransportSource(const char* stepname,
00106 const char* sourcename,
00107 int timeout,
00108 int start = 0,
00109 int stop = 0,
00110 int interval = 0);
00111
00112 void StepMbsEventServerSource(const char* stepname,
00113 const char* sourcename,
00114 int timeout,
00115 int start = 0,
00116 int stop = 0,
00117 int interval = 0);
00118
00119 void StepMbsRevServSource(const char* stepname,
00120 const char* sourcename,
00121 int timeout,
00122 int port = 0,
00123 int start = 0,
00124 int stop = 0,
00125 int interval = 0);
00126
00127 void StepMbsSelection(const char* stepname,
00128 int start,
00129 int stop,
00130 int interval);
00131
00132 void StepRandomSource(const char* stepname,
00133 const char* sourcename,
00134 int timeout);
00135
00136 void StepUserSource(const char* stepname,
00137 const char* sourcename,
00138 int timeout,
00139 int port,
00140 const char* expr);
00141
00142 void StepMbsPort(const char* stepname,
00143 int port);
00144
00145 void StepMbsRetryCnt(const char* stepname,
00146 int cnt);
00147
00148
00149 void StepFileStore(const char* stepname,
00150 const char* storename,
00151 bool overwrite,
00152 int bufsize,
00153 int splitlevel,
00154 int compression);
00155
00156 void StepBackStore(const char* stepname,
00157 const char* storename,
00158 int bufsize,
00159 int splitlevel);
00160
00161
00162
00163 void SetMainWindowState(int qtversion, const char* val);
00164 void SetMainWindowGeometry(int qtversion, const char* val);
00165
00166 ViewPanelHandle StartViewPanel();
00167 ViewPanelHandle StartViewPanel(int x, int y, int width, int height, int mode = 1, TGo4Picture* pic = 0);
00168 TString GetViewPanelName(ViewPanelHandle panel);
00169 ViewPanelHandle FindViewPanel(const char* name);
00170 Bool_t SetViewPanelName(ViewPanelHandle panel, const char* newname);
00171 ViewPanelHandle GetActiveViewPanel();
00172 void RedrawPanel(ViewPanelHandle handle);
00173 void DivideViewPanel(ViewPanelHandle panel, Int_t numX, Int_t numY);
00174 TPad* SelectPad(ViewPanelHandle panel, Int_t number = 0);
00175 TGo4Picture* GetPadOptions(ViewPanelHandle panel, Int_t padnumber = 0);
00176 void SetSuperimpose(ViewPanelHandle panel, Bool_t on = kTRUE);
00177
00178 Bool_t DrawItem(const char* itemname, ViewPanelHandle panel = 0, const char* drawopt = 0);
00179
00180 const char* GetDrawnItemName(ViewPanelHandle panel, int cnt = 0);
00181
00182 protected:
00183
00184 static TGo4Script* ScriptInstance();
00185
00186 Bool_t StartScriptExecution(const char* fname);
00187 Bool_t ContinueExecution();
00188 void FinishExecution();
00189
00190 Bool_t IsWaitSomething();
00191
00192 TGo4ConfigStep* GetStepGUI(const char* stepname);
00193
00194 static void ProduceScript(const char* filename, TGo4MainWindow* main);
00195
00196 Int_t getCounts(Double_t time);
00197 void doOutput(const char* str);
00198
00199 Int_t execGUICommands();
00200
00201 void DoPostProcessing();
00202
00203 Int_t fiWaitForGUIReaction;
00204 Int_t fiWaitCounter;
00205 TString fStrBuf;
00206 TGo4MainWindow* fMainWin;
00207 Bool_t fErrorFlag;
00208 };
00209
00210 #endif