00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef TGO4ANALYSISPROXY_H
00015 #define TGO4ANALYSISPROXY_H
00016
00017 #include "TGo4Proxy.h"
00018
00019 #include "TObjArray.h"
00020
00021 class TGo4AnalysisObjectNames;
00022 class TGo4AnalysisDummySlot;
00023 class TFolder;
00024 class TGo4AnalysisObjectAccess;
00025 class TGo4Status;
00026 class TGo4Display;
00027
00028 enum EGo4ShellKind { Go4_sh = 0, Go4_rsh = 1, Go4_ssh = 2 };
00029 enum EGo4ConsoleKind { Go4_qt = 1, Go4_xterm = 2, Go4_konsole = 3 };
00030 enum EGo4AnalysisCodeKind { Go4_exe = 0, Go4_lib = 1 };
00031
00032 class TGo4AnalysisProxy : public TGo4Proxy {
00033 public:
00034 TGo4AnalysisProxy(Bool_t isserver = kFALSE);
00035 virtual ~TGo4AnalysisProxy();
00036
00037
00038
00039 virtual void Initialize(TGo4Slot* slot);
00040 virtual void Finalize(TGo4Slot* slot);
00041
00042 virtual Bool_t HasSublevels() const;
00043
00044 virtual TGo4LevelIter* MakeIter();
00045
00046 virtual TGo4Access* MakeProxy(const char* name);
00047
00048 virtual void WriteData(TGo4Slot* slot, TDirectory* dir, Bool_t onlyobjs);
00049 virtual void ReadData(TGo4Slot* slot, TDirectory* dir);
00050
00051 virtual const char* GetContainedObjectInfo();
00052 virtual Int_t GetObjectKind() { return TGo4Access::kndFolder; }
00053 virtual const char* GetContainedClassName() { return ClassName(); }
00054 virtual TObject* GetAssignedObject() { return this; }
00055
00056 virtual void Update(TGo4Slot* slot, Bool_t strong);
00057
00058 TGo4Slot* ParentSlot() { return fxParentSlot; }
00059 TGo4Slot* SettingsSlot();
00060 TGo4Slot* RatemeterSlot();
00061 TGo4Slot* LoginfoSlot();
00062 TGo4Slot* UpdateObjectSlot();
00063
00064
00065
00066 Bool_t IsAnalysisServer() const { return fIsServer; }
00067 Bool_t IsConnected();
00068 Int_t ConnectorPort();
00069 Int_t GetRole();
00070 Bool_t IsViewer();
00071 Bool_t IsController();
00072 Bool_t IsAdministrator();
00073
00074 void SetAnalysisReady(Bool_t on = kTRUE) { fbAnalysisReady = on; }
00075 Bool_t IsAnalysisReady() const { return fbAnalysisReady; }
00076
00077 void SetAnalysisSettingsReady(Bool_t on = kTRUE) { fbAnalysisSettingsReady = on ; }
00078 Bool_t IsAnalysisSettingsReady() const { return fbAnalysisSettingsReady; }
00079
00080 Bool_t IsAnalysisRunning() const { return fbAnalysisRunning; }
00081
00082 void RefreshNamesList();
00083 void DelayedRefreshNamesList(Int_t delay_sec);
00084 Bool_t NamesListReceived();
00085
00086 void ReceiveObject(TNamed* obj);
00087 void ReceiveStatus(TGo4Status* status);
00088 Bool_t SubmitProxy(TGo4AnalysisObjectAccess* proxy);
00089
00090 void LoadConfigFile(const char* fname);
00091 void SaveConfigFile(const char* fname);
00092 void WriteAutoSave(const char* fname,
00093 Int_t complevel,
00094 Bool_t overwrite);
00095 void StartAnalysis();
00096 void StopAnalysis();
00097 void ExecuteLine(const char* line);
00098
00099 void RequestAnalysisSettings();
00100 void SubmitAnalysisSettings();
00101 void CloseAnalysisSettings();
00102
00103 void RequestObjectStatus(const char* objectname, TGo4Slot* tgtslot);
00104 void RequestEventStatus(const char* evname, Bool_t astree, TGo4Slot* tgtslot);
00105 void RemoteTreeDraw(const char* treename,
00106 const char* varexp,
00107 const char* cutcond,
00108 const char* hname);
00109 void RemotePrintEvent(const char* evname,
00110 Int_t evnumber,
00111 Int_t subid,
00112 Bool_t ishex,
00113 Bool_t islong);
00114
00115 Bool_t UpdateAnalysisObject(const char* fullpath, TObject* obj);
00116
00117 void ClearAnalysisObject(const char* fullpath);
00118 void ChageObjectProtection(const char* fullpath, const char* flags);
00119 void RemoveObjectFromAnalysis(const char* fullpath, TClass* cl = 0);
00120
00121 void PrintDynListEntry(const char* fullpath);
00122
00123 static Int_t NumberOfWaitingProxyes() { return fNumberOfWaitingProxyes; }
00124
00125 Bool_t LaunchAsClient(TString& launchcmd,
00126 TString& killcmd,
00127 Int_t shellkind,
00128 Int_t konsole,
00129 const char* name,
00130 const char* remotehost,
00131 const char* remotedir,
00132 const char* remoteexe,
00133 Int_t exe_kind = 0,
00134 const char* exeargs = 0);
00135
00136 static Bool_t LaunchAsServer(TString& launchcmd,
00137 TString& killcmd,
00138 Int_t shellkind,
00139 Int_t konsole,
00140 const char* name,
00141 const char* remotehost,
00142 const char* remotedir,
00143 const char* remoteexe,
00144 Int_t exe_kind = 0,
00145 const char* exeargs = 0);
00146
00147 Bool_t ConnectToServer(const char* remotehost,
00148 Int_t remoteport,
00149 Int_t ascontroller,
00150 const char* accesspass);
00151
00152 Bool_t WaitForConnection(Int_t seconds);
00153
00158 void DisconnectAnalysis(Int_t waittime = 30, Bool_t servershutdown = kFALSE);
00159
00160 void DisplayDeleted(TGo4Display* displ);
00161
00162 void DisplayDisconnected(TGo4Display* displ);
00163
00164 virtual Bool_t HandleTimer(TTimer* timer);
00165
00167 void SetDefaultReceiver(TGo4ObjectManager* rcv, const char* path);
00168
00169 protected:
00170
00171 static Bool_t GetLaunchString(TString& launchcmd,
00172 TString& killcmd,
00173 Bool_t server,
00174 Int_t shellkind,
00175 Int_t konsole,
00176 const char* name,
00177 const char* remotehost,
00178 const char* remotedir,
00179 const char* remoteexe,
00180 Int_t guiport,
00181 Int_t exe_kind = 0,
00182 const char* exeargs = 0);
00183
00184 TGo4AnalysisObjectAccess* FindSubmittedProxy(const char* pathname, const char* objname);
00185 void DeleteSubmittedProxy(TGo4AnalysisObjectAccess* proxy);
00186
00187 void AssignNewNamesList(TGo4AnalysisObjectNames* objnames);
00188
00189 void CallSlotUpdate();
00190
00191 Bool_t fIsServer;
00192 TGo4AnalysisDummySlot* fDummySlot;
00193 TGo4AnalysisObjectNames* fAnalysisNames;
00194 TGo4Slot* fxParentSlot;
00195 TObjArray fxSubmittedProxy;
00196 TGo4AnalysisObjectAccess* fxDefaultProxy;
00197 Bool_t fbNamesListReceived;
00198 Bool_t fbAnalysisReady;
00199 Bool_t fbAnalysisSettingsReady;
00200 Bool_t fbAnalysisRunning;
00201 Int_t fDisconectCounter;
00202 TGo4Display* fxDisplay;
00203 TString fInfoStr;
00204 Int_t fActualRole;
00205 TTimer* fxRefreshTimer;
00206 TTimer* fxConnectionTimer;
00207 static Int_t fNumberOfWaitingProxyes;
00208
00209 ClassDef(TGo4AnalysisProxy, 1);
00210 };
00211
00212
00213
00214 #endif