GSI Object Oriented Online Offline (Go4) GO4-6.4.0
Loading...
Searching...
No Matches
TGo4BrowserProxy.h
Go to the documentation of this file.
1// $Id$
2//-----------------------------------------------------------------------
3// The GSI Online Offline Object Oriented (Go4) Project
4// Experiment Data Processing at EE department, GSI
5//-----------------------------------------------------------------------
6// Copyright (C) 2000- GSI Helmholtzzentrum fuer Schwerionenforschung GmbH
7// Planckstr. 1, 64291 Darmstadt, Germany
8// Contact: http://go4.gsi.de
9//-----------------------------------------------------------------------
10// This software can be used under the license agreements as stated
11// in Go4License.txt file which is part of the distribution.
12//-----------------------------------------------------------------------
13
14#ifndef TGO4BROWSERPROXY_H
15#define TGO4BROWSERPROXY_H
16
17#include "TGo4Proxy.h"
18
19#include "TString.h"
20
21class TList;
22class TTimer;
23class TAxis;
24class TGraph;
25class TH1;
26
29class TGo4ServerProxy;
30class TGo4Picture;
31class TVirtualTreePlayer;
32
34 public:
36 TGo4BrowserProxy(const char *datapath,
37 const char *viewpath,
38 Bool_t withRootBrowser = kFALSE);
39 virtual ~TGo4BrowserProxy();
40
41 void Initialize(TGo4Slot *slot) override;
42 void Finalize(TGo4Slot *slot) override;
43
44 Bool_t Use() const override { return kFALSE; }
45
46 Bool_t ProcessEvent(TGo4Slot *slot, TGo4Slot *source, Int_t id, void *param) override;
47 Int_t GetObjectKind() const override { return TGo4Access::kndFolder; }
48 const char *GetContainedClassName() const override { return ClassName(); }
49 TObject *GetAssignedObject() override { return this; }
50
51 // browser functionality
52
53 void DataSlotName(const char *item, TString &res) const;
54 void BrowserSlotName(const char *item, TString &res) const;
55 TGo4Slot *BrowserSlot(const char *item = nullptr);
56 TGo4Slot *DataSlot(const char *item);
58 Bool_t BrowserItemName(TGo4Slot *itemslot, TString &res);
59
62 void SetItemsFilter(Int_t filter); // 0 - all, 1 - fetched, 2 - monitored
63 Int_t GetItemFilter() const { return fiFilterIndex; }
64
65 Int_t RequestBrowserObject(const char *name, Int_t wait_time = 0);
66 Int_t RequestBrowserObject(TGo4Slot *slot, Int_t wait_time = 0);
67
68 void AddServerProxy(TGo4ServerProxy *serv, const char *slotname, const char *info);
69 void OpenFile(const char *fname);
70 Bool_t ConnectHServer(const char *servername,
71 Int_t portnumber,
72 const char *basename,
73 const char *userpass,
74 const char *filter);
75 Bool_t ConnectDabc(const char *nodename);
76
77 void MakeFilesList(TObjArray *arr);
78 void MakeDabcList(TObjArray *arr);
79 void MakeHttpList(TObjArray *arr);
80 void MakeHServerList(TObjArray *arr);
81
82 Bool_t ProduceExplicitCopy(const char *itemname, const char *tgtpath = nullptr, Bool_t forcerequest = kFALSE);
83 Bool_t ProduceExplicitCopy(TGo4Slot *itemslot, const char *tgtpath = nullptr, Bool_t forcerequest = kFALSE);
84
85 void ClearClipboard();
86 void AddToClipboard(const char *itemname);
87 Bool_t IsClipboard() const;
88 void CopyClipboard(const char *tgtpath, Bool_t forcerequest = kFALSE);
89
90 void CreateMemorySubfolder(const char *itemname, const char *newfoldername);
91 void RenameMemoryItem(const char *itemname, const char *newname);
92 void ClearMemoryItem(const char *itemname);
93
94 void RequestObjectStatus(const char *name, TGo4Slot *tgtslot);
95
96 void PerformTreeDraw(const char *treename,
97 const char *Xexp,
98 const char *Yexp,
99 const char *Zexp,
100 const char *cutcond,
101 const char *hname,
102 TString &createdhistoname);
103
104 TString SaveToMemory(const char *pathname, TObject *obj, Bool_t ownership, Bool_t overwrite = kFALSE);
105 void CreateMemoryFolder(const char *foldername = nullptr);
106
107 void Scan_gROOT();
108
109 Bool_t SaveBrowserToFile(const char *filename,
110 Bool_t prefetch = kFALSE,
111 const char *selectedpath = nullptr,
112 const char *description = nullptr);
113 void ExportItemsTo(TObjArray *items, // array of TObjString
114 Bool_t fetchitems,
115 const char *filename,
116 const char *filedir,
117 const char *format,
118 const char *description);
119
120 void ImportObjectFromFile(const char *filename,const char *filedir,
121 const char *format);
122
123 TObject *GetBrowserObject(const char *name, Int_t update = 0);
124
125 Bool_t DeleteDataSource(TGo4Slot *itemslot);
126
127 void DoItemMonitor(TGo4Slot *slot);
128
130 TGo4Slot *ItemSlot(const char *itemname);
131
132 Bool_t DefineTreeName(const char *itemname, TString &treename);
133 Bool_t DefineLeafName(const char *itemname, const char *treename, TString &leafname);
134
135 TGo4Slot *FindServerSlot(Bool_t databranch, Int_t kind = 0);
136 TGo4AnalysisProxy *FindAnalysis(const char *itemname = nullptr);
137 TGo4ServerProxy *FindServer(const char *itemname = nullptr, Bool_t asanalysis = kTRUE);
138 TString FindItemInAnalysis(const char *objname);
139 TString FindItem(const char *objname);
140 void FetchItem(const char *itemname, Int_t wait_time = 0);
141 void RedrawItem(const char *itemname);
142
143 Bool_t DefineFileObject(const char *itemname, TString &filedataslot, const char **filepath);
144 Bool_t UpdateObjectInFile(const char *itemname, const char *fileslotname, const char *filepath);
145 Bool_t SaveItemToFile(const char *itemname, const char *filename, const char *subfolder = nullptr);
146
147 Bool_t UpdateAnalysisItem(const char *itemname, TObject *obj = nullptr);
148
149 Bool_t DefineRelatedObject(const char *itemname, const char *objectname, TString &objectitem, Int_t mask = 3);
150
151 Bool_t IsItemRemote(const char *name);
152 Bool_t IsItemRemote(TGo4Slot *slot) const;
153 Bool_t IsAnalysisItem(const char *name);
154
155 static void SetItemTimeDate(TGo4Slot *slot, const char *stime = nullptr, const char *sdate = nullptr);
156 static const char *ItemTime(TGo4Slot *slot);
157 static const char *ItemDate(TGo4Slot *slot);
158
159 static void SetLinkedName(TGo4Slot *slot, const char *itemname);
160 static const char *GetLinkedName(TGo4Slot *slot);
161
162 void SetCanDelete(TGo4Slot *slot, Bool_t on = kTRUE);
163 Bool_t IsCanDelete(TGo4Slot *slot) const;
164
165 Int_t ItemKind(const char *name);
166 static Int_t ItemKind(TGo4Slot *slot);
167 void SetItemKind(TGo4Slot *slot, Int_t kind, const char *classname, const char *info, Int_t sizeinfo);
168 static const char *ItemInfo(TGo4Slot *slot);
169 Int_t ItemSizeInfo(TGo4Slot *slot);
170
171 void SetCalcSize(TGo4Slot *slot, Int_t size);
172 Int_t GetCalcSize(TGo4Slot *slot);
173
174 TClass *ItemClass(const char *name);
175 TClass *ItemClass(TGo4Slot *slot);
176 const char *ItemClassName(const char *name);
177 static const char *ItemClassName(TGo4Slot *slot);
178
179 Int_t ItemCanDo(const char *name);
180 Int_t ItemCanDo(TGo4Slot *slot);
181 static void SetItemCanDo(TGo4Slot *slot, Int_t cando);
182
183 Bool_t IsItemMonitored(TGo4Slot *slot) const;
184 void SetItemMonitored(TGo4Slot *slot, Bool_t on = kTRUE);
185
186 void SetProtectionBits(TGo4Slot *slot, Int_t delprot, Int_t clearprot);
187 void GetProtectionBits(TGo4Slot *slot, Int_t &delprot, Int_t &clearprot);
188
189 void ToggleMonitoring(Int_t period);
190 void SetMonitorBlockingFlag(Bool_t blocked = kFALSE) { fbBlockMonitoring = blocked; }
191 Int_t MonitoringPeriod() const { return fiMonitoringPeriod; }
192 Int_t UpdateVisibleAnalysisObjects(bool checkmonitor);
194
195 TGo4ServerProxy *DefineServerProxy(const char *itemname);
196 TGo4ServerProxy *DefineServerObject(const char *itemname, TString *objname = nullptr, Bool_t onlyanalysis = kTRUE);
197 TGo4ServerProxy *DefineAnalysisObject(const char *itemname, TString &analysisname);
198
199 static bool CanExecuteItem(int cando);
200 static bool CanExpandItem(int cando);
201 static bool CanExportItem(int cando);
202 static bool CanInfoItem(int cando);
203 static bool CanCloseItem(int cando);
204 static bool CanClearItem(int cando);
205 static bool CanDrawItem(int cando);
206 static bool CanDragItem(int cando);
207 static bool CanEditItem(int cando);
208
209 static Int_t DefineItemProperties(Int_t kind, TClass *cl, TString &pixmap);
210 static Bool_t UpdateObjectContent(TObject *obj, TObject *newobj, Int_t *hasrebinx = nullptr, Int_t *hasrebiny = nullptr);
211
212 void SyncBrowserSlots();
213
214 Bool_t HandleTimer(TTimer *timer) override;
215
216 protected:
217
218 void UpdateAllCanvases();
219
220 void AddWaitingList(TGo4Slot *itemslot, const char *destination = nullptr);
221 void CheckWaitingList(TGo4Slot *source);
222
223 static Int_t CompareAxis(TAxis *ax1, TAxis *ax2);
224 static Bool_t CompareAxisValues(Double_t v1, Double_t v2, Double_t scale);
225
226 Int_t CalculateFolderSizes(TGo4Slot *topslot);
227
228 void CheckPictureMonitor(TGo4Slot *slot);
229 void CheckPictureMonitor(TGo4Picture *pic, const char *picitemname);
230
231 static void SaveAxisTimeProperties(TGraph *gr, Bool_t& timedisplay, TString &format);
232 static void RestoreAxisTimeProperties(TGraph *gr, Bool_t& timedisplay, TString &format);
233
235 static void UpdateListOfFunctions(TGraph *oldgr, TGraph *newgr);
236
238 static void UpdateHistoListOfFunctions(TH1 *oldh, TH1 *newh);
239
240 TString fxDataPath;
242 TString fxViewPath;
243 Bool_t fbWithRootBrowser{kFALSE};
244 TString fxMemoryPath;
248 TTimer *fxMonitorTimer{nullptr};
249 Bool_t fbBlockMonitoring{kFALSE};
250 Int_t fiFilterIndex{0};
251 TList *fxWaitingList{nullptr};
252 TObjArray *fxClipboard{nullptr};
253 TTimer *fxSyncTimer{nullptr};
254 Bool_t fbBlockSync{kFALSE};
255 TVirtualTreePlayer *fDummyTreePlayer{nullptr};
256
258};
259
260#endif
static Bool_t CompareAxisValues(Double_t v1, Double_t v2, Double_t scale)
void CheckWaitingList(TGo4Slot *source)
Int_t RequestBrowserObject(const char *name, Int_t wait_time=0)
void RenameMemoryItem(const char *itemname, const char *newname)
static bool CanExportItem(int cando)
TObject * GetAssignedObject() override
void ImportObjectFromFile(const char *filename, const char *filedir, const char *format)
Bool_t SaveBrowserToFile(const char *filename, Bool_t prefetch=kFALSE, const char *selectedpath=nullptr, const char *description=nullptr)
Bool_t SaveItemToFile(const char *itemname, const char *filename, const char *subfolder=nullptr)
TObjArray * fxClipboard
TGo4AnalysisProxy * FindAnalysis(const char *itemname=nullptr)
Bool_t DefineTreeName(const char *itemname, TString &treename)
Bool_t IsCanDelete(TGo4Slot *slot) const
static void SetLinkedName(TGo4Slot *slot, const char *itemname)
void SetItemKind(TGo4Slot *slot, Int_t kind, const char *classname, const char *info, Int_t sizeinfo)
TGo4Slot * FindServerSlot(Bool_t databranch, Int_t kind=0)
void MakeDabcList(TObjArray *arr)
void PerformTreeDraw(const char *treename, const char *Xexp, const char *Yexp, const char *Zexp, const char *cutcond, const char *hname, TString &createdhistoname)
void Initialize(TGo4Slot *slot) override
Bool_t DeleteDataSource(TGo4Slot *itemslot)
TGo4Slot * BrowserSlot(const char *item=nullptr)
static bool CanCloseItem(int cando)
Bool_t DefineLeafName(const char *itemname, const char *treename, TString &leafname)
TGo4ServerProxy * DefineServerProxy(const char *itemname)
void MakeFilesList(TObjArray *arr)
TGo4Slot * BrowserTopSlot()
TGo4ServerProxy * DefineAnalysisObject(const char *itemname, TString &analysisname)
TGo4Slot * ItemSlot(const char *itemname)
static bool CanExecuteItem(int cando)
Int_t ItemSizeInfo(TGo4Slot *slot)
Bool_t ProduceExplicitCopy(const char *itemname, const char *tgtpath=nullptr, Bool_t forcerequest=kFALSE)
TObject * GetBrowserObject(const char *name, Int_t update=0)
void ToggleMonitoring(Int_t period)
ClassDefOverride(TGo4BrowserProxy, 0)
to overcome problem in ROOT
void CreateMemoryFolder(const char *foldername=nullptr)
void CreateMemorySubfolder(const char *itemname, const char *newfoldername)
static bool CanExpandItem(int cando)
static void SetItemCanDo(TGo4Slot *slot, Int_t cando)
TString SaveToMemory(const char *pathname, TObject *obj, Bool_t ownership, Bool_t overwrite=kFALSE)
static bool CanClearItem(int cando)
Int_t ItemCanDo(const char *name)
Int_t MonitoringPeriod() const
void SetProtectionBits(TGo4Slot *slot, Int_t delprot, Int_t clearprot)
void ExportItemsTo(TObjArray *items, Bool_t fetchitems, const char *filename, const char *filedir, const char *format, const char *description)
Int_t ItemKind(const char *name)
TGo4Slot * DataSlot(const char *item)
static Int_t CompareAxis(TAxis *ax1, TAxis *ax2)
Int_t GetCalcSize(TGo4Slot *slot)
Bool_t ConnectHServer(const char *servername, Int_t portnumber, const char *basename, const char *userpass, const char *filter)
Bool_t DefineFileObject(const char *itemname, TString &filedataslot, const char **filepath)
TGo4Slot * BrowserMemorySlot()
void RedrawItem(const char *itemname)
void SetCanDelete(TGo4Slot *slot, Bool_t on=kTRUE)
void GetProtectionBits(TGo4Slot *slot, Int_t &delprot, Int_t &clearprot)
static const char * ItemTime(TGo4Slot *slot)
void FetchItem(const char *itemname, Int_t wait_time=0)
TGo4ServerProxy * FindServer(const char *itemname=nullptr, Bool_t asanalysis=kTRUE)
void SetItemsFilter(Int_t filter)
void SetItemMonitored(TGo4Slot *slot, Bool_t on=kTRUE)
void CopyClipboard(const char *tgtpath, Bool_t forcerequest=kFALSE)
static void SaveAxisTimeProperties(TGraph *gr, Bool_t &timedisplay, TString &format)
void ClearMemoryItem(const char *itemname)
static const char * ItemInfo(TGo4Slot *slot)
Int_t UpdateVisibleAnalysisObjects(bool checkmonitor)
void BrowserSlotName(const char *item, TString &res) const
void SetMonitorBlockingFlag(Bool_t blocked=kFALSE)
void Finalize(TGo4Slot *slot) override
static Bool_t UpdateObjectContent(TObject *obj, TObject *newobj, Int_t *hasrebinx=nullptr, Int_t *hasrebiny=nullptr)
Bool_t UpdateAnalysisItem(const char *itemname, TObject *obj=nullptr)
Bool_t BrowserItemName(TGo4Slot *itemslot, TString &res)
static Int_t DefineItemProperties(Int_t kind, TClass *cl, TString &pixmap)
static void UpdateListOfFunctions(TGraph *oldgr, TGraph *newgr)
preserve fit result functions contained in any graph-like objects
void AddServerProxy(TGo4ServerProxy *serv, const char *slotname, const char *info)
void AddWaitingList(TGo4Slot *itemslot, const char *destination=nullptr)
const char * GetContainedClassName() const override
TVirtualTreePlayer * fDummyTreePlayer
void AddToClipboard(const char *itemname)
Bool_t IsItemRemote(const char *name)
Bool_t DefineRelatedObject(const char *itemname, const char *objectname, TString &objectitem, Int_t mask=3)
static void RestoreAxisTimeProperties(TGraph *gr, Bool_t &timedisplay, TString &format)
void DataSlotName(const char *item, TString &res) const
static bool CanInfoItem(int cando)
static bool CanEditItem(int cando)
static const char * GetLinkedName(TGo4Slot *slot)
static const char * ItemDate(TGo4Slot *slot)
Bool_t ProcessEvent(TGo4Slot *slot, TGo4Slot *source, Int_t id, void *param) override
Bool_t HandleTimer(TTimer *timer) override
static bool CanDrawItem(int cando)
const char * ItemClassName(const char *name)
TString FindItemInAnalysis(const char *objname)
TGo4ServerProxy * DefineServerObject(const char *itemname, TString *objname=nullptr, Bool_t onlyanalysis=kTRUE)
Int_t CalculateFolderSizes(TGo4Slot *topslot)
Bool_t IsItemMonitored(TGo4Slot *slot) const
TClass * ItemClass(const char *name)
void DoItemMonitor(TGo4Slot *slot)
Bool_t ConnectDabc(const char *nodename)
void RequestObjectStatus(const char *name, TGo4Slot *tgtslot)
TString FindItem(const char *objname)
Bool_t IsAnalysisItem(const char *name)
Bool_t IsClipboard() const
void MakeHttpList(TObjArray *arr)
void MakeHServerList(TObjArray *arr)
void OpenFile(const char *fname)
static bool CanDragItem(int cando)
Bool_t Use() const override
void SetCalcSize(TGo4Slot *slot, Int_t size)
void CheckPictureMonitor(TGo4Slot *slot)
TGo4ObjectManager * fxOM
static void UpdateHistoListOfFunctions(TH1 *oldh, TH1 *newh)
JAM24: also preserve fit result functions contained in any TH1.
static void SetItemTimeDate(TGo4Slot *slot, const char *stime=nullptr, const char *sdate=nullptr)
Int_t GetObjectKind() const override
Bool_t UpdateObjectInFile(const char *itemname, const char *fileslotname, const char *filepath)
Int_t GetItemFilter() const
Picture cconfiguration in Go4.
Definition TGo4Picture.h:40
special base class for remote data servers like DABC, HTTP, hist server