Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

/Go4GUI/TGo4ScriptSlots.h

Go to the documentation of this file.
00001 //---------------------------------------------------------------
00002 //        Go4 Release Package v2.10-5 (build 21005) 
00003 //                      03-Nov-2005
00004 //---------------------------------------------------------------
00005 //       The GSI Online Offline Object Oriented (Go4) Project
00006 //       Experiment Data Processing at DVEE 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 TGO4SCRIPTSLOTS_H
00017 #define TGO4SCRIPTSLOTS_H
00018 
00019 #include "Go4GUIBase/TGo4SlotsBaseClass.h"
00020 #include "TString.h"
00021 
00022 #include <fstream.h>
00023 
00024 class TGo4ScriptWidget;
00025 class TGo4GUIRegistry;
00026 class TGo4ScriptStatus;
00027 class QTextEdit;
00028 class TObjArray;
00029 class TGo4AnalysisConfiguration;
00030 class TGo4ConfigStep;
00031 class TPad;
00032 class TGo4PreviewPanel;
00033 
00034 class TGo4ScriptSlots : public TGo4SlotsBaseClass {
00035 
00036    public:
00037       TGo4ScriptSlots(const char * name, const char * title, TGo4ScriptWidget *p);
00038       virtual ~TGo4ScriptSlots();
00039 
00040       TGo4Status* GetStatus();
00041 
00042       void SetGUI(TGo4ScriptWidget *p);
00043       TGo4ScriptWidget* GetGUI() { return fxScriptWidget; }
00044 
00045       void setOutput(QTextEdit* output);
00046       bool StartScriptExecution();
00047       bool ProcessScriptExecution();
00048 
00049       void GenerateStartupScript(const char* fname);
00050 
00051       // here is functions to operate inside Go4GUI and only this functions can be used
00052 
00053       // general purpose
00054       void Wait(double tm_sec);
00055 
00056       void LoadLibrary(const char* fname);
00057 
00058       // analysis start and configuration
00059 
00060       void LaunchAnalysis();
00061       void LaunchAnalysis(const char* ClientName,
00062                           const char* ClientDir,
00063                           const char* ClientExec,
00064                           const char* ClientNode,
00065                           Int_t ClientMode =  2,      // 1 = rsh  2 = ssh
00066                           Int_t ClientShell = 1);     // 1 = Qt   2 = Xterm
00067       
00068       void ConnectAnalysis(const char* ServerNode,
00069                            Int_t ServerPort,
00070                            Int_t ControllMode,
00071                            const char* ControllPass);
00072 
00073       void WaitAnalysis(Int_t delay_sec);
00074       void DisconnectAnalysis();
00075       void SubmitAnalysisConfig();
00076       void StartAnalysis();
00077       void StopAnalysis();
00078 
00079       void StartMonitor(Int_t delay_sec, Bool_t monitorall = kFALSE);
00080       void StopMonitor();
00081 
00082       void SetAnalysisTerminalMode(int mode);  // -1 - close , 0-minimized, 1-normal
00083       void SetAnalysisConfigMode(int mode);   // -1 - close , 0-minimized, 1-normal
00084 
00085       // steps configuration
00086 
00087       void AnalysisAutoSave(const char* filename,
00088                             Int_t interval,
00089                             Int_t compression,
00090                             Bool_t enabled,
00091                             Bool_t overwrite);
00092 
00093       void AnalysisConfigName(const char* filename);
00094 
00095       void ConfigStep(const char* stepname,
00096                       Bool_t enableprocess,
00097                       Bool_t enablesource,
00098                       Bool_t enablestore);
00099 
00100       void StepFileSource(const char* stepname,
00101                           const char* sourcename,
00102                           int timeout);
00103 
00104       void StepMbsFileSource(const char* stepname,
00105                              const char* sourcename,
00106                              int timeout,
00107                              const char* TagFile,
00108                              int start,
00109                              int stop,
00110                              int interval);
00111 
00112       void StepMbsStreamSource(const char* stepname,
00113                                const char* sourcename,
00114                                int timeout);
00115 
00116       void StepMbsTransportSource(const char* stepname,
00117                                   const char* sourcename,
00118                                   int timeout);
00119 
00120       void StepMbsEventServerSource(const char* stepname,
00121                                     const char* sourcename,
00122                                     int timeout);
00123 
00124       void StepMbsRevServSource(const char* stepname,
00125                                 const char* sourcename,
00126                                 int timeout,
00127                                 int port);
00128 
00129       void StepRandomSource(const char* stepname,
00130                             const char* sourcename,
00131                             int timeout);
00132 
00133       void StepUserSource(const char* stepname,
00134                           const char* sourcename,
00135                           int timeout,
00136                           int port,
00137                           const char* expr);
00138 
00139       void StepFileStore(const char* stepname,
00140                          const char* storename,
00141                          bool overwrite,
00142                          int bufsize,
00143                          int splitlevel,
00144                          int compression);
00145 
00146       void StepBackStore(const char* stepname,
00147                          const char* storename,
00148                          int bufsize,
00149                          int splitlevel);
00150 
00151       // view panel functions
00152 
00153       void* StartViewPanel(int numpads = 1);
00154       void* StartViewPanel(int numx, int numy);
00155       void SetViewPanelPosition(void* panel, int x, int y, int width, int height, int mode = 1);
00156       void SetViewPanelMode(void* panel, int mode = 1); // -1 - close , 0-minimized, 1-normal, 2- maximized
00157       void SetPadOptions(void* panel, int npad, 
00158                          const char* drawoptions, 
00159                          int logscale = 000,     // 000 - all linear, 100 - only x log, 111 - all three logarithm
00160                          int padstaus = 11001);  // xxxxx, where x is 0 or 1; 1-stats, 2-title, 3-legend, 4-crosshair, 5-autoscale
00161       void SetPadRange(void* panel, int npad,
00162                        Double_t minx, Double_t maxx,
00163                        Double_t miny, Double_t maxy,
00164                        Double_t minz = 0., Double_t maxz = 0.);
00165 
00166       void CreateSubPad(void* panel, int npad,
00167                         Double_t xlow, Double_t ylow,
00168                         Double_t xup, Double_t yup);
00169       void* ViewPanelPad(void* panel);
00170       void SetActivePad(void* panel, int npad = 0);
00171 
00172       // objects manipulation
00173 
00174       void GetObject(const char* objname, void* panel = 0, int npad = 0);
00175       void GetCondition(const char* condname, void* panel, int npad);
00176       void MonitorObject(const char* objname);
00177 
00178       void WaitObject(const char* objname, double tm_sec = 1.);
00179       void WaitMonitor(const char* objname, double tm_sec = 1.);
00180 
00181       void OpenFile(const char* filename);
00182       void CloseFile(const char* filename);
00183 
00184       void DisplayFileObject(const char* objname, void* panel = 0, int npad = 0, bool update = true);
00185       void DisplayObject(const char* objname, void* panel = 0, int npad = 0, bool update = true);
00186       void DisplayMonitorObject(const char* objname, void* panel = 0, int npad = 0, bool update = true);
00187 
00188       void SwitchSuperImpose(void* panel, int npad, Bool_t superimpose = kTRUE);
00189 
00190       void SuperImpose(void* panel, int npad,
00191                        const char* objname0,
00192                        const char* objname1,
00193                        const char* objname2 = 0,
00194                        const char* objname3 = 0,
00195                        const char* objname4 = 0,
00196                        const char* objname5 = 0,
00197                        const char* objname6 = 0,
00198                        const char* objname7 = 0,
00199                        const char* objname8 = 0,
00200                        const char* objname9 = 0);
00201 
00202       void SuperImpose(int num, const char** names,
00203                        void* panel = 0, int npad =0);
00204 
00205       static const char* GUIScriptExtension;
00206 
00207    protected:
00208 
00209       void DisplayObj(int numtab, const char* objname, void* panel, int npad, bool update);
00210 
00211       void ProduceAnalysisSetupScript(ofstream& fs, TGo4AnalysisConfiguration* confgui);
00212 
00213       void ExploreAllPads(TPad* toppad, TObjArray* arr);
00214 
00215       TPad* FindPad(TGo4PreviewPanel* panel, int npad);
00216 
00217       TGo4ConfigStep* GetStepGUI(const char* stepname);
00218 
00219       int execGUICommands();
00220 
00221       void doOutput(const char* str);
00222       
00223       Bool_t IsAnalysisReady();
00224 
00225       TGo4GUIRegistry*    fxRegistry;                  
00226       TGo4ScriptWidget*   fxScriptWidget;              
00227       TGo4ScriptStatus*   fxStatus;                    
00228       QTextEdit*          fxOutput;                    
00229 
00230       Int_t               fiWaitForGUIReaction;        
00231       Int_t               fiWaitCounter;               
00232       TString             fStrBuf;                     
00233 
00234    ClassDef(TGo4ScriptSlots, 1);
00235 };
00236 
00237 
00238 #endif
00239 
00240 
00241 //----------------------------END OF GO4 SOURCE FILE ---------------------

Generated on Tue Nov 8 10:56:03 2005 for Go4-v2.10-5 by doxygen1.2.15