GSI Object Oriented Online Offline (Go4)  GO4-6.1.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TGo4BrowserOptions.cpp
Go to the documentation of this file.
1 // $Id: TGo4BrowserOptions.cpp 3118 2021-03-30 07:20:28Z linev $
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 #include "TGo4BrowserOptions.h"
15 
16 #include "TGo4BrowserProxy.h"
17 #include "TGo4ServerProxy.h"
18 #include "TGo4AnalysisProxy.h"
19 #include "TGo4DabcProxy.h"
20 #include "TGo4HttpProxy.h"
21 
22 TGo4BrowserOptions::TGo4BrowserOptions(QWidget *parent, const char* name) :
23  QGo4Widget(parent,name)
24 {
25  setupUi(this);
26  QObject::connect(RefreshBtn, SIGNAL(clicked()), this, SLOT(RefreshBtn_clicked()));
27  QObject::connect(ClearBtn, SIGNAL(clicked()), this, SLOT(ClearBtn_clicked()));
28  QObject::connect(StartMonitorBtn, SIGNAL(clicked()), this, SLOT(StartMonitorBtn_clicked()));
29  QObject::connect(StopMonitorBtn, SIGNAL(clicked()), this, SLOT(StopMonitorBtn_clicked()));
30  QObject::connect(FilterBox, SIGNAL(activated(int)), this, SLOT(FilterBox_activated(int)));
31 
32 }
33 
35 {
36  AddLink("","Browser");
37  UpdateView();
38 }
39 
41 {
42  int interval = Browser()->MonitoringPeriod()/1000;
43  StartMonitorBtn->setEnabled(interval<=0);
44  StopMonitorBtn->setEnabled(interval>0);
45 
46  if ((interval>1) && (IntervalSpin->value()!=interval))
47  IntervalSpin->setValue(interval);
48 }
49 
50 void TGo4BrowserOptions::linkedObjectUpdated(const char* linkname, TObject* obj)
51 {
52  if (strcmp(linkname,"Browser")==0)
53  UpdateView();
54 }
55 
57 {
59  if (an!=0) an->RefreshNamesList();
60 
61  TObjArray prlist;
62  Browser()->MakeDabcList(&prlist);
63  for(Int_t n=0;n<=prlist.GetLast();n++) {
64  TGo4DabcProxy* pr = dynamic_cast<TGo4DabcProxy*> (prlist.At(n));
65  if (pr) pr->RefreshNamesList();
66  }
67 
68  prlist.Clear();
69  Browser()->MakeHttpList(&prlist);
70  for(Int_t n=0;n<=prlist.GetLast();n++) {
71  TGo4HttpProxy* pr = dynamic_cast<TGo4HttpProxy*> (prlist.At(n));
72  if (pr) pr->RefreshNamesList();
73  }
74 
76 }
77 
79 {
81  if (an) {
83  } else {
84  TGo4ServerProxy* root_serv = Browser()->FindServer(0, kFALSE);
85  if (root_serv) {
86  TString cmd = root_serv->FindCommand("Clear");
87  if (cmd.Length()>0) root_serv->SubmitCommand(cmd);
88  }
89  }
91 }
92 
93 
95 {
96  int period = IntervalSpin->value();
97 
98  Browser()->ToggleMonitoring(period*1000);
99 
100  UpdateView();
101 }
102 
104 {
106 
107  UpdateView();
108 }
109 
111 {
112  Browser()->SetItemsFilter(indx);
113 }
114 
virtual void StopMonitorBtn_clicked()
void MakeHttpList(TObjArray *arr)
virtual void ClearBtn_clicked()
virtual void FilterBox_activated(int indx)
Int_t UpdateVisibleAnalysisObjects(bool checkmonitor)
virtual void StartMonitorBtn_clicked()
virtual Bool_t RefreshNamesList()
virtual void UpdateView()
TGo4ServerProxy * FindServer(const char *itemname=0, Bool_t asanalysis=kTRUE)
TGo4BrowserProxy * Browser()
Definition: QGo4Widget.cpp:224
TGo4BrowserOptions(QWidget *parent=0, const char *name=0)
virtual Bool_t RefreshNamesList()
virtual void linkedObjectUpdated(const char *linkname, TObject *obj)
void MakeDabcList(TObjArray *arr)
virtual void RefreshBtn_clicked()
virtual void ClearAllAnalysisObjects()
virtual Bool_t RefreshNamesList()
void AddLink(const char *itemname, const char *linkname)
Definition: QGo4Widget.cpp:122
virtual TString FindCommand(const char *name)
virtual Bool_t SubmitCommand(const char *name, Int_t waitres=-1, const char *arg1=0, const char *arg2=0, const char *arg3=0)
void SetItemsFilter(Int_t filter)
virtual void StartWorking()
Int_t MonitoringPeriod() const
void ToggleMonitoring(Int_t period)