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

TGo4BrowserProxy.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 TGO4PANELCONTAINER_H
00017 #define TGO4PANELCONTAINER_H
00018 
00019 #include "TGo4Proxy.h"
00020 
00021 #include "TString.h"
00022 
00023 class TList;
00024 class TTimer;
00025 
00026 class TGo4ObjectManager;
00027 class TGo4AnalysisProxy;
00028 class TGo4HServProxy;
00029 class TGo4Picture;
00030 class TAxis;
00031 class TVirtualTreePlayer;
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       // browser functionality
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); // 0 - all, 1 - fetched, 2 - monitored
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 
00075       void MakeFilesList(TObjArray* arr);
00076       void MakeHServerList(TObjArray* arr);
00077 
00078       Bool_t ProduceExplicitCopy(const char* itemname, const char* tgtpath = 0, Bool_t forcerequest = kFALSE);
00079       Bool_t ProduceExplicitCopy(TGo4Slot* itemslot, const char* tgtpath = 0, Bool_t forcerequest = kFALSE);
00080 
00081       void ClearClipboard();
00082       void AddToClipboard(const char* itemname);
00083       Bool_t IsClipboard();
00084       void CopyClipboard(const char* tgtpath, Bool_t forcerequest = kFALSE);
00085 
00086 
00087       void CreateMemorySubfolder(const char* itemname, const char* newfoldername);
00088       void RenameMemoryItem(const char* itemname, const char* newname);
00089 
00090       void RequestObjectStatus(const char* name, TGo4Slot* tgtslot);
00091 
00092       void RequestEventStatus(const char* evname,
00093                               Bool_t astree,
00094                               TGo4Slot* tgtslot);
00095 
00096       void PerformTreeDraw(const char* treename,
00097                            const char* Xexp,
00098                            const char* Yexp,
00099                            const char* Zexp,
00100                            const char* cutcond,
00101                            const char* hname,
00102                            TString& createdhistoname);
00103 
00104       TString SaveToMemory(const char* pathname, TObject* obj, Bool_t ownership, Bool_t overwrite = kFALSE);
00105       void CreateMemoryFolder(const char* foldername = 0);
00106 
00107       void Scan_gROOT();
00108 
00109       Bool_t SaveBrowserToFile(const char* filename,
00110                                Bool_t prefetch = kFALSE,
00111                                const char* selectedpath = 0,
00112                                const char* description = 0);
00113       void ExportItemsTo(TObjArray* items,  // array of TObjString
00114                          Bool_t fetchitems,
00115                          const char* filename,
00116                          const char* filedir,
00117                          const char* format,
00118                          const char* description);
00119 
00120       TObject* GetBrowserObject(const char* name, Int_t update = 0);
00121 
00122       Bool_t DeleteDataSource(TGo4Slot* itemslot);
00123 
00124       void DoItemMonitor(TGo4Slot* slot);
00125 
00126       TGo4Slot* BrowserTopSlot();
00127       TGo4Slot* ItemSlot(const char* itemname);
00128 
00129       Bool_t DefineTreeName(const char* itemname, TString& treename);
00130       Bool_t DefineLeafName(const char* itemname, const char* treename, TString& leafname);
00131 
00132       TGo4Slot* FindAnalysisSlot(Bool_t databranch = kTRUE);
00133       TGo4AnalysisProxy* FindAnalysis(const char* itemname = 0);
00134       TString FindItemInAnalysis(const char* objname);
00135       TString FindItem(const char* objname);
00136       void FetchItem(const char* itemname, Int_t wait_time = 0);
00137       void RedrawItem(const char* itemname);
00138 
00139       Bool_t DefineFileObject(const char* itemname, TString& filedataslot, const char* &filepath);
00140       Bool_t UpdateObjectInFile(const char* itemname, const char* fileslotname, const char* filepath);
00141       Bool_t SaveItemToFile(const char* itemname, const char* filename, const char* subfolder = 0);
00142 
00143       Bool_t UpdateAnalysisItem(const char* itemname, TObject* obj = 0);
00144 
00145       Bool_t DefineRelatedObject(const char* itemname, const char* objectname, TString& objectitem);
00146 
00147       Bool_t IsItemRemote(const char* name);
00148       Bool_t IsItemRemote(TGo4Slot* slot);
00149       Bool_t IsAnalysisItem(const char* name);
00150 
00151       static void SetItemTimeDate(TGo4Slot* slot, const char* stime = 0, const char* sdate = 0);
00152       static const char* ItemTime(TGo4Slot* slot);
00153       static const char* ItemDate(TGo4Slot* slot);
00154 
00155       static void SetLinkedName(TGo4Slot* slot, const char* itemname);
00156       static const char* GetLinkedName(TGo4Slot* slot);
00157 
00158       void SetCanDelete(TGo4Slot* slot, Bool_t on = kTRUE);
00159       Bool_t IsCanDelete(TGo4Slot* slot);
00160 
00161       Int_t ItemKind(const char* name);
00162       static Int_t ItemKind(TGo4Slot* slot);
00163       void SetItemKind(TGo4Slot* slot, Int_t kind, const char* classname, const char* info, Int_t sizeinfo);
00164       static const char* ItemInfo(TGo4Slot* slot);
00165       Int_t ItemSizeInfo(TGo4Slot* slot);
00166 
00167       void SetCalcSize(TGo4Slot* slot, Int_t size);
00168       Int_t GetCalcSize(TGo4Slot* slot);
00169 
00170       TClass* ItemClass(const char* name);
00171       TClass* ItemClass(TGo4Slot* slot);
00172       const char* ItemClassName(const char* name);
00173       static const char* ItemClassName(TGo4Slot* slot);
00174 
00175       Int_t ItemCanDo(const char* name);
00176       Int_t ItemCanDo(TGo4Slot* slot);
00177       static void SetItemCanDo(TGo4Slot* slot, Int_t cando);
00178 
00179       Bool_t IsItemMonitored(TGo4Slot* slot);
00180       void SetItemMonitored(TGo4Slot* slot, Bool_t on = kTRUE);
00181 
00182       void SetProtectionBits(TGo4Slot* slot, Int_t delprot, Int_t clearprot);
00183       void GetProtectionBits(TGo4Slot* slot, Int_t& delprot, Int_t& clearprot);
00184 
00185       void ToggleMonitoring(Int_t period);
00186       void SetMonitorBlockingFlag(Bool_t blocked = kFALSE) { fbBlockMonitoring = blocked; }
00187       Int_t MonitoringPeriod() const { return fiMonitoringPeriod; }
00188       Int_t UpdateVisibleAnalysisObjects(bool checkmonitor);
00189       Int_t UpdateAllMonitoredObjects();
00190 
00191       TGo4AnalysisProxy* DefineAnalysisObject(const char* itemname, TString& analysisname);
00192       TGo4HServProxy* DefineHServerProxy(const char* itemname);
00193 
00194       static bool CanExportItem(int cando);
00195       static bool CanInfoItem(int cando);
00196       static bool CanCloseItem(int cando);
00197       static bool CanClearItem(int cando);
00198       static bool CanDrawItem(int cando);
00199       static bool CanDragItem(int cando);
00200       static bool CanEditItem(int cando);
00201 
00202       static Int_t DefineItemProperties(Int_t kind, TClass* cl, TString& pixmap);
00203       static Bool_t UpdateObjectContent(TObject* obj, TObject* newobj, Int_t* hasrebinx = 0, Int_t* hasrebiny = 0);
00204 
00205       void SyncBrowserSlots();
00206 
00207       virtual Bool_t HandleTimer(TTimer* timer);
00208 
00209    protected:
00210 
00211       void UpdateAllCanvases();
00212 
00213       void AddWaitingList(TGo4Slot* itemslot, const char* destination = 0);
00214       void CheckWaitingList(TGo4Slot* source);
00215 
00216       static Int_t CompareAxis(TAxis* ax1, TAxis* ax2);
00217       static Bool_t CompareAxisValues(Double_t v1, Double_t v2, Double_t scale);
00218 
00219       Int_t CalculateFolderSizes(TGo4Slot* topslot);
00220 
00221       void CheckPictureMonitor(TGo4Slot* slot);
00222       void CheckPictureMonitor(TGo4Picture* pic, const char* picitemname);
00223 
00224       TString            fxDataPath;    
00225       TString            fxBrowserPath; 
00226       TString            fxViewPath;    
00227       Bool_t             fbWithRootBrowser; 
00228       TString            fxMemoryPath;  
00229       TGo4ObjectManager* fxOM;          
00230       TGo4Slot*          fxBrowserSlot; 
00231       Int_t              fiMonitoringPeriod; 
00232       TTimer*            fxMonitorTimer; 
00233       Bool_t             fbBlockMonitoring;  
00234       Int_t              fiFilterIndex;  
00235       TList*             fxWaitingList; 
00236       TObjArray*         fxClipboard; 
00237       TTimer*            fxSyncTimer; 
00238       Bool_t             fbBlockSync; 
00239       TVirtualTreePlayer* fDummyTreePlayer; 
00240 
00241    ClassDef(TGo4BrowserProxy,1);
00242 };
00243 
00244 #endif
00245 
00246 //----------------------------END OF GO4 SOURCE FILE ---------------------

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