Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

TGo4Script.h

Go to the documentation of this file.
00001 //-------------------------------------------------------------
00002 //        Go4 Release Package v3.04-01 (build 30401)
00003 //                      28-November-2008
00004 //---------------------------------------------------------------
00005 //   The GSI Online Offline Object Oriented (Go4) Project
00006 //   Experiment Data Processing at EE department, GSI
00007 //---------------------------------------------------------------
00008 //
00009 //Copyright (C) 2000- Gesellschaft f. Schwerionenforschung, GSI
00010 //                    Planckstr. 1, 64291 Darmstadt, Germany
00011 //Contact:            http://go4.gsi.de
00012 //----------------------------------------------------------------
00013 //This software can be used under the license agreements as stated
00014 //in Go4License.txt file which is part of the distribution.
00015 //----------------------------------------------------------------
00016 #ifndef TGO4SCRIPT_H
00017 #define TGO4SCRIPT_H
00018 
00019 #include "TGo4AbstractInterface.h"
00020 #include "TString.h"
00021 
00022 class TGo4MainWindow;
00023 class TGo4ConfigStep;
00024 class TGo4Picture;
00025 
00026 class TGo4Script : public TGo4AbstractInterface {
00027 
00028 
00029    friend class TGo4MainWindow;
00030 
00031    protected:
00032        void ProcessEvents(Int_t timeout = -1);
00033 
00034    public:
00035       TGo4Script(TGo4MainWindow* mainwin);
00036       virtual ~TGo4Script();
00037 
00038       static const char* FileExtension();
00039 
00040       // general purpose
00041       void Wait(double tm_sec);
00042 
00043       void HotStart(const char* filename);
00044 
00045       void Message(const char* msg);
00046 
00047       // analysis start and configuration
00048 
00049       void LaunchAnalysis();
00050       void LaunchAnalysis(const char* ClientName,
00051                           const char* ClientDir,
00052                           const char* ClientExec,
00053                           const char* ClientNode,
00054                           Int_t ShellMode =  2,      // 1 = rsh  2 = ssh
00055                           Int_t TermMode = 1);      // 1 = Qt   2 = Xterm 3 = konsole
00056       void ConnectAnalysis(const char* ServerNode,
00057                            Int_t ServerPort,
00058                            Int_t ControllerMode,  // 0 - obsrver, 1- controller, 2 - administrator
00059                            const char* password = 0);
00060 
00061       void WaitAnalysis(Int_t delay_sec);
00062       void DisconnectAnalysis();
00063       void ShutdownAnalysis();
00064 
00065       void SubmitAnalysisConfig();
00066       void StartAnalysis();
00067       void StopAnalysis();
00068 
00069       void SetAnalysisTerminalMode(int mode);  // -1 - close , 0-minimized, 1-normal
00070       void SetAnalysisConfigMode(int mode);   // -1 - close , 0-minimized, 1-normal
00071 
00072       // steps configuration
00073 
00074       void AnalysisAutoSave(const char* filename,
00075                             Int_t interval,
00076                             Int_t compression,
00077                             Bool_t enabled,
00078                             Bool_t overwrite);
00079 
00080       void AnalysisConfigName(const char* filename);
00081 
00082       void ConfigStep(const char* stepname,
00083                       Bool_t enableprocess,
00084                       Bool_t enablesource,
00085                       Bool_t enablestore);
00086 
00087       void StepFileSource(const char* stepname,
00088                           const char* sourcename,
00089                           int timeout);
00090 
00091       void StepMbsFileSource(const char* stepname,
00092                              const char* sourcename,
00093                              int timeout,
00094                              const char* TagFile,
00095                              int start,
00096                              int stop,
00097                              int interval);
00098 
00099       void StepMbsStreamSource(const char* stepname,
00100                                const char* sourcename,
00101                                int timeout);
00102 
00103       void StepMbsTransportSource(const char* stepname,
00104                                   const char* sourcename,
00105                                   int timeout);
00106 
00107       void StepMbsEventServerSource(const char* stepname,
00108                                     const char* sourcename,
00109                                     int timeout);
00110 
00111       void StepMbsRevServSource(const char* stepname,
00112                                 const char* sourcename,
00113                                 int timeout,
00114                                 int port);
00115 
00116       void StepRandomSource(const char* stepname,
00117                             const char* sourcename,
00118                             int timeout);
00119 
00120       void StepUserSource(const char* stepname,
00121                           const char* sourcename,
00122                           int timeout,
00123                           int port,
00124                           const char* expr);
00125 
00126       void StepFileStore(const char* stepname,
00127                          const char* storename,
00128                          bool overwrite,
00129                          int bufsize,
00130                          int splitlevel,
00131                          int compression);
00132 
00133       void StepBackStore(const char* stepname,
00134                          const char* storename,
00135                          int bufsize,
00136                          int splitlevel);
00137 
00138       // windows management
00139 
00140       ViewPanelHandle StartViewPanel();
00141       ViewPanelHandle StartViewPanel(int x, int y, int width, int height, int mode = 1, TGo4Picture* pic = 0);
00142       TString GetViewPanelName(ViewPanelHandle panel);
00143       ViewPanelHandle FindViewPanel(const char* name);
00144       Bool_t SetViewPanelName(ViewPanelHandle panel, const char* newname);
00145       ViewPanelHandle GetActiveViewPanel();
00146       void RedrawPanel(ViewPanelHandle handle);
00147       void DivideViewPanel(ViewPanelHandle panel, Int_t numX, Int_t numY);
00148       TPad* SelectPad(ViewPanelHandle panel, Int_t number = 0);
00149       void SetSuperimpose(ViewPanelHandle panel, Bool_t on = kTRUE);
00150 
00151       Bool_t DrawItem(const char* itemname, ViewPanelHandle panel = 0, const char* drawopt = 0);
00152 
00153    protected:
00154 
00155       static TGo4Script* ScriptInstance();
00156       static Int_t DelayMillisec();
00157 
00158       Bool_t StartScriptExecution(const char* fname);
00159       Bool_t ContinueExecution();
00160       void FinishExecution();
00161 
00162       Bool_t IsWaitSomething();
00163 
00164       TGo4ConfigStep* GetStepGUI(const char* stepname);
00165 
00166       static void ProduceScript(const char* filename, TGo4MainWindow* main);
00167 
00168       Int_t  getCounts(Double_t time);
00169       void   doOutput(const char* str);
00170 
00171       Int_t  execGUICommands();
00172 
00173       void  DoPostProcessing();
00174 
00175       Int_t     fiWaitForGUIReaction;  
00176       Int_t     fiWaitCounter;         
00177       TString   fStrBuf;               
00178       TGo4MainWindow* fMainWin;        
00179       Bool_t    fErrorFlag;            
00180 
00181       static const char* fgFileExtension; 
00182       static Int_t fgDellayMillisec;
00183 
00184    ClassDef(TGo4Script, 1);
00185 };
00186 
00187 #endif
00188 
00189 //----------------------------END OF GO4 SOURCE FILE ---------------------

Generated on Fri Nov 28 12:59:22 2008 for Go4-v3.04-1 by  doxygen 1.4.2