00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef TGO4PANELCONTAINER_H
00015 #define TGO4PANELCONTAINER_H
00016
00017 #include "TGo4Proxy.h"
00018
00019 #include "TString.h"
00020
00021 class TList;
00022 class TTimer;
00023
00024 class TGo4ObjectManager;
00025 class TGo4AnalysisProxy;
00026 class TGo4HServProxy;
00027 class TGo4DabcProxy;
00028 class TGo4Picture;
00029 class TAxis;
00030 class TVirtualTreePlayer;
00031 class TGraph;
00032
00033 class TGo4BrowserProxy : public TGo4Proxy {
00034 public:
00035 TGo4BrowserProxy();
00036 TGo4BrowserProxy(const char* datapath,
00037 const char* viewpath,
00038 Bool_t withRootBrowser = kFALSE);
00039 virtual ~TGo4BrowserProxy();
00040
00041 virtual void Initialize(TGo4Slot* slot);
00042 virtual void Finalize(TGo4Slot* slot);
00043
00044 virtual Bool_t Use() const { return kFALSE; }
00045
00046 virtual Bool_t ProcessEvent(TGo4Slot* slot, TGo4Slot* source, Int_t id, void* param);
00047 virtual Int_t GetObjectKind() { return TGo4Access::kndFolder; }
00048 virtual const char* GetContainedClassName() { return ClassName(); }
00049 virtual TObject* GetAssignedObject() { return this; }
00050
00051
00052
00053 void DataSlotName(const char* item, TString& res);
00054 void BrowserSlotName(const char* item, TString& res);
00055 TGo4Slot* BrowserSlot(const char* item);
00056 TGo4Slot* DataSlot(const char* item);
00057 TGo4Slot* BrowserMemorySlot();
00058 Bool_t BrowserItemName(TGo4Slot* itemslot, TString& res);
00059
00060 void UpdateBrowserContent();
00061 void InformBrowserUpdate();
00062 void SetItemsFilter(Int_t filter);
00063 Int_t GetItemFilter() const { return fiFilterIndex; }
00064
00065 Int_t RequestBrowserObject(const char* name, Int_t wait_time = 0);
00066 Int_t RequestBrowserObject(TGo4Slot* slot, Int_t wait_time = 0);
00067
00068 void OpenFile(const char* fname);
00069 Bool_t ConnectHServer(const char* servername,
00070 Int_t portnumber,
00071 const char* basename,
00072 const char* userpass,
00073 const char* filter);
00074 Bool_t ConnectDabc(const char* nodename);
00075
00076 void MakeFilesList(TObjArray* arr);
00077 void MakeDabcList(TObjArray* arr);
00078 void MakeHServerList(TObjArray* arr);
00079
00080 Bool_t ProduceExplicitCopy(const char* itemname, const char* tgtpath = 0, Bool_t forcerequest = kFALSE);
00081 Bool_t ProduceExplicitCopy(TGo4Slot* itemslot, const char* tgtpath = 0, Bool_t forcerequest = kFALSE);
00082
00083 void ClearClipboard();
00084 void AddToClipboard(const char* itemname);
00085 Bool_t IsClipboard();
00086 void CopyClipboard(const char* tgtpath, Bool_t forcerequest = kFALSE);
00087
00088
00089 void CreateMemorySubfolder(const char* itemname, const char* newfoldername);
00090 void RenameMemoryItem(const char* itemname, const char* newname);
00091 void ClearMemoryItem(const char* itemname);
00092
00093 void RequestObjectStatus(const char* name, TGo4Slot* tgtslot);
00094
00095 void RequestEventStatus(const char* evname,
00096 Bool_t astree,
00097 TGo4Slot* tgtslot);
00098
00099 void PerformTreeDraw(const char* treename,
00100 const char* Xexp,
00101 const char* Yexp,
00102 const char* Zexp,
00103 const char* cutcond,
00104 const char* hname,
00105 TString& createdhistoname);
00106
00107 TString SaveToMemory(const char* pathname, TObject* obj, Bool_t ownership, Bool_t overwrite = kFALSE);
00108 void CreateMemoryFolder(const char* foldername = 0);
00109
00110 void Scan_gROOT();
00111
00112 Bool_t SaveBrowserToFile(const char* filename,
00113 Bool_t prefetch = kFALSE,
00114 const char* selectedpath = 0,
00115 const char* description = 0);
00116 void ExportItemsTo(TObjArray* items,
00117 Bool_t fetchitems,
00118 const char* filename,
00119 const char* filedir,
00120 const char* format,
00121 const char* description);
00122
00123 TObject* GetBrowserObject(const char* name, Int_t update = 0);
00124
00125 Bool_t DeleteDataSource(TGo4Slot* itemslot);
00126
00127 void DoItemMonitor(TGo4Slot* slot);
00128
00129 TGo4Slot* BrowserTopSlot();
00130 TGo4Slot* ItemSlot(const char* itemname);
00131
00132 Bool_t DefineTreeName(const char* itemname, TString& treename);
00133 Bool_t DefineLeafName(const char* itemname, const char* treename, TString& leafname);
00134
00135 TGo4Slot* FindAnalysisSlot(Bool_t databranch = kTRUE);
00136 TGo4AnalysisProxy* FindAnalysis(const char* itemname = 0);
00137 TString FindItemInAnalysis(const char* objname);
00138 TString FindItem(const char* objname);
00139 void FetchItem(const char* itemname, Int_t wait_time = 0);
00140 void RedrawItem(const char* itemname);
00141
00142 Bool_t DefineFileObject(const char* itemname, TString& filedataslot, const char** filepath);
00143 Bool_t UpdateObjectInFile(const char* itemname, const char* fileslotname, const char* filepath);
00144 Bool_t SaveItemToFile(const char* itemname, const char* filename, const char* subfolder = 0);
00145
00146 Bool_t UpdateAnalysisItem(const char* itemname, TObject* obj = 0);
00147
00148 Bool_t DefineRelatedObject(const char* itemname, const char* objectname, TString& objectitem);
00149
00150 Bool_t IsItemRemote(const char* name);
00151 Bool_t IsItemRemote(TGo4Slot* slot);
00152 Bool_t IsAnalysisItem(const char* name);
00153
00154 static void SetItemTimeDate(TGo4Slot* slot, const char* stime = 0, const char* sdate = 0);
00155 static const char* ItemTime(TGo4Slot* slot);
00156 static const char* ItemDate(TGo4Slot* slot);
00157
00158 static void SetLinkedName(TGo4Slot* slot, const char* itemname);
00159 static const char* GetLinkedName(TGo4Slot* slot);
00160
00161 void SetCanDelete(TGo4Slot* slot, Bool_t on = kTRUE);
00162 Bool_t IsCanDelete(TGo4Slot* slot);
00163
00164 Int_t ItemKind(const char* name);
00165 static Int_t ItemKind(TGo4Slot* slot);
00166 void SetItemKind(TGo4Slot* slot, Int_t kind, const char* classname, const char* info, Int_t sizeinfo);
00167 static const char* ItemInfo(TGo4Slot* slot);
00168 Int_t ItemSizeInfo(TGo4Slot* slot);
00169
00170 void SetCalcSize(TGo4Slot* slot, Int_t size);
00171 Int_t GetCalcSize(TGo4Slot* slot);
00172
00173 TClass* ItemClass(const char* name);
00174 TClass* ItemClass(TGo4Slot* slot);
00175 const char* ItemClassName(const char* name);
00176 static const char* ItemClassName(TGo4Slot* slot);
00177
00178 Int_t ItemCanDo(const char* name);
00179 Int_t ItemCanDo(TGo4Slot* slot);
00180 static void SetItemCanDo(TGo4Slot* slot, Int_t cando);
00181
00182 Bool_t IsItemMonitored(TGo4Slot* slot);
00183 void SetItemMonitored(TGo4Slot* slot, Bool_t on = kTRUE);
00184
00185 void SetProtectionBits(TGo4Slot* slot, Int_t delprot, Int_t clearprot);
00186 void GetProtectionBits(TGo4Slot* slot, Int_t& delprot, Int_t& clearprot);
00187
00188 void ToggleMonitoring(Int_t period);
00189 void SetMonitorBlockingFlag(Bool_t blocked = kFALSE) { fbBlockMonitoring = blocked; }
00190 Int_t MonitoringPeriod() const { return fiMonitoringPeriod; }
00191 Int_t UpdateVisibleAnalysisObjects(bool checkmonitor);
00192 Int_t UpdateAllMonitoredObjects();
00193
00194 TGo4AnalysisProxy* DefineAnalysisObject(const char* itemname, TString& analysisname);
00195 TGo4HServProxy* DefineHServerProxy(const char* itemname);
00196 TGo4DabcProxy* DefineDabcProxy(const char* itemname);
00197
00198 static bool CanExportItem(int cando);
00199 static bool CanInfoItem(int cando);
00200 static bool CanCloseItem(int cando);
00201 static bool CanClearItem(int cando);
00202 static bool CanDrawItem(int cando);
00203 static bool CanDragItem(int cando);
00204 static bool CanEditItem(int cando);
00205
00206 static Int_t DefineItemProperties(Int_t kind, TClass* cl, TString& pixmap);
00207 static Bool_t UpdateObjectContent(TObject* obj, TObject* newobj, Int_t* hasrebinx = 0, Int_t* hasrebiny = 0);
00208
00209 void SyncBrowserSlots();
00210
00211 virtual Bool_t HandleTimer(TTimer* timer);
00212
00213 protected:
00214
00215 void UpdateAllCanvases();
00216
00217 void AddWaitingList(TGo4Slot* itemslot, const char* destination = 0);
00218 void CheckWaitingList(TGo4Slot* source);
00219
00220 static Int_t CompareAxis(TAxis* ax1, TAxis* ax2);
00221 static Bool_t CompareAxisValues(Double_t v1, Double_t v2, Double_t scale);
00222
00223 Int_t CalculateFolderSizes(TGo4Slot* topslot);
00224
00225 void CheckPictureMonitor(TGo4Slot* slot);
00226 void CheckPictureMonitor(TGo4Picture* pic, const char* picitemname);
00227
00228 static void SaveAxisTimeProperties(TGraph* gr, Bool_t& timedisplay, TString& format);
00229 static void RestoreAxisTimeProperties(TGraph* gr, Bool_t& timedisplay, TString& format);
00230
00231 TString fxDataPath;
00232 TString fxBrowserPath;
00233 TString fxViewPath;
00234 Bool_t fbWithRootBrowser;
00235 TString fxMemoryPath;
00236 TGo4ObjectManager* fxOM;
00237 TGo4Slot* fxBrowserSlot;
00238 Int_t fiMonitoringPeriod;
00239 TTimer* fxMonitorTimer;
00240 Bool_t fbBlockMonitoring;
00241 Int_t fiFilterIndex;
00242 TList* fxWaitingList;
00243 TObjArray* fxClipboard;
00244 TTimer* fxSyncTimer;
00245 Bool_t fbBlockSync;
00246 TVirtualTreePlayer* fDummyTreePlayer;
00247
00248 ClassDef(TGo4BrowserProxy,1);
00249 };
00250
00251 #endif