GSI Object Oriented Online Offline (Go4)  GO4-6.3.0
TGo4MainWindow.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 TGO4MAINWINDOW_H
15 #define TGO4MAINWINDOW_H
16 
17 #include <QMainWindow>
18 
19 class QGo4Widget;
20 class TGo4FitPanel;
21 class TGo4ParaEdit;
22 class TGo4HistogramInfo;
23 class TGo4ConditionInfo;
24 class TGo4EditDynEntry;
25 class TGo4EventInfo;
28 class TGo4AnalysisWindow;
30 class TGo4SetScaleValues;
31 
32 class TGo4MdiArea;
33 class TGo4ViewPanel;
34 class TPad;
35 class TGo4Slot;
36 class TGo4ObjectManager;
37 class TGo4Style;
38 class TGo4AnalysisProxy;
39 class TGo4BrowserProxy;
40 class TGo4WidgetProxy;
41 class TGo4ServerProxy;
42 
43 class QAction;
44 class QMenu;
45 class QSpinBox;
46 class QPushButton;
47 class QCloseEvent;
48 class QApplication;
49 
55 class TGo4MainWindow : public QMainWindow {
56  Q_OBJECT
57 
58  public:
59  TGo4MainWindow(QApplication*);
60  virtual ~TGo4MainWindow();
61 
62  void HotStart(const char *fname);
63  void ProcessQtEvents();
64  void StatusMessage(const QString& mess);
65  const char *LastTypedPassword() const;
66  TGo4ViewPanel *FindViewPanel(const char *name);
67  TGo4ViewPanel *DisplayBrowserItem(const char *itemname, TGo4ViewPanel *panel, TPad *pad, bool activate, int updatelevel, const char *drawopt);
68 
69  TGo4ServerProxy *ConnectHttpServer(const char *addr = nullptr, const char *user = nullptr, const char *pass = nullptr, bool with_qt_process = false, bool get_analysis_config = false);
70  void ConnectServer(bool interactive = true, const char *password = "");
71  void PrepareForClientConnection(bool interactive = true);
72  void LaunchClient(bool interactive = true);
73  void DisconnectAnalysis(bool interactive = true);
74  void ShutdownAnalysis(bool interactive = true);
75 
76  TGo4AnalysisWindow* EstablishAnalysisWindow(bool needoutput, bool withkillbnt = false, bool force_recreate = false);
80 
81  // starting editors
82  TGo4ViewPanel *MakeNewPanel(int div = 0);
84  TGo4ParaEdit* StartParaEdit(const char *itemname = nullptr);
90 
91  void CreateNewHist(int isremote = -1);
92  void CreateNewCondition(bool forothereditor = false);
93  void CreateNewDynEntry(bool forothereditor = false);
94 
97 
98  public slots:
99 
100  void about();
101  void aboutQt();
102  void aboutROOT();
103  void aboutDABC();
104  void windowsMenuAboutToShow();
105  void UserPanelSlot();
106  void LoadLibrarySlot();
107  void CloseAllFilesSlot();
108  void OpenFileSlot();
109  void OpenRemoteFileSlot();
110  void ConnectDabcSlot();
111  void ConnectHttpSlot();
112  void ConnectHServerSlot();
113  void SaveFileSlot();
114  void CascadeSubWindows();
115 
117  void LogSettingsSlot();
118 
119  void IntroHelpSlot();
120  void RefHelpSlot();
121  void FitHelpSlot();
122  void MinAllWindows();
123  void ToggleFullScreenSlot();
124  void SaveSettingsSlot();
125  void ChangeFontSlot();
126  void ChangeTerminalFontSlot();
127  void SetStyleSlot(const QString&);
128  void ForseCloseSlot();
129 
130  void ChangeFetchWhenDrawSlot(bool);
131  void ChangeFetchWhenCopySlot(bool);
132  void ChangeFetchWhenSaveSlot(bool);
133  void ChangeHideEventElement(bool);
134  void ChangeDrawOnceSlot(bool);
135  void ChangeWindowRubberBandSlot(bool);
136 
137  void CanvasColorSlot();
138  void SuperimposeSlot(bool);
139  void CrosshairSlot(bool);
140  void EventStatusSlot(bool);
141  void MarkerSettingsSlot();
142  void OptStatsSlot();
143  void ChangeCloneFlagSlot(bool);
144  void ChangeDrawTimeFlagSlot(bool);
145  void ChangeDrawDateFlagSlot(bool);
146  void ChangeDrawItemFlagSlot(bool);
148 
149  void ChangeTerminalTimeStampSlot(bool);
151 
152  void DrawLineWidthSlot();
153  void DrawFillColorSlot();
154  void DrawFillStyleSlot();
155 
156  void TH1DrawOptSlot();
157  void TH2DrawOptSlot();
158  void TH3DrawOptSlot();
159  void TGraphDrawOptSlot();
160  void GStyleStatFormatSlot();
161  void PaletteSettingsSlot();
162 
164  void ToggleAnalysisWindow();
165  void CloseAnalysisWindow();
166 
167  bool SubmitAnalysisSettings();
169  void StartAnalysisSlot();
170  void StopAnalysisSlot();
171 
172  // modify default high-dpi scaling
173  void ScaleFactorSlot();
174 
175  // slots connected to editors
176  void editorServiceSlot(QGo4Widget* editor, int serviceid, const char *str, void *par);
177 
178  void ProcessHotStart();
179  void StopGUIScriptSlot();
180  void CreateGUIScriptSlot();
182  void checkPanelRepaintSlot();
183 
184  protected:
185 
186  void ShowAboudDialog(const QString &title, const QString &text, const QString &icon);
187 
188  void AddAnalysisBar();
189  void AddAnalysisMenu();
190  void AddFileMenu();
191  void AddFileToolBar();
192  void AddSettingMenu();
193  void AddToolsBar();
194  void AddToolsMenu();
195 
196  void AddAnalysisMacrosBar();
197 
198  void closeEvent(QCloseEvent *ce) override;
199 
200  void ConnectGo4Widget(QGo4Widget *editor);
201 
202  void CascadeMdiPosition(QWidget *sub);
203 
204  void WindowActivated(int id);
205 
206  void UpdateCaptionButtons();
207 
208  bool startUserGUI(const char *);
209  TGo4AnalysisProxy *AddAnalysisProxy(bool isserver, bool needoutput);
210  bool RemoveAnalysisProxy(int waittime = 30, bool servershutdown = false);
213 
214  QGo4Widget *FindGo4Widget(const char *name, bool activate);
215  TGo4Slot *GetWidgetTopSlot(QGo4Widget *widget, bool force);
216 
217  bool SaveBrowserItemToFile(const char *itemname, const char *subfolder);
218 
220  void TerminateAnalysis(bool interactive = true);
221 
222  void ToggleMbsMonitor(const char *nodename);
224 
225  void SavePanelCanvas(TGo4ViewPanel *panel);
226 
227  void HelpWindow(const char *filename, const char *msg = nullptr);
228 
229  void UpdateBrowser();
230 
231  QApplication* fApp{nullptr};
232 
233  QMenu* windowsMenu{nullptr};
235  TGo4Style* fxStyle{nullptr};
237  QString fOMDataPath;
238  QString fOMBrowserPath;
239  QString fOMEditorsPath;
240 
241  QString fKillCommand;
242 
243  int fNewWidgetX{0};
244  int fNewWidgetY{0};
245 
247  int fConnectingCounter{0}; // counter to establish connection
248  bool fbGetAnalysisConfig{false}; // flag to decide if we want to have analysis config after connect
249  QString fConnectingHttp; // http address (set when doing connection to http)
250  QString fLastPassword;
251  QString fLastFileDir;
252 
253  bool fbPanelTimerActive{false};
254  bool fbFullScreen{false};
255 
256  QAction* faWebCanvas{nullptr};
257  QAction* faSuperimpose{nullptr};
258  QAction* faCrosshair{nullptr};
259  QAction* faEventstatus{nullptr};
260  QAction* faDrawTime{nullptr};
261  QAction* faDrawDate{nullptr};
262  QAction* faDrawItem{nullptr};
263 
264  QAction* faLaunchAnal{nullptr};
265  QAction* faConnectAnal{nullptr};
266  QAction* faPrepareAnal{nullptr};
267  QAction* faDisconnectAnal{nullptr};
268  QAction* faShutdownAnal{nullptr};
269  QAction* faSumbStartAnal{nullptr};
270  QAction* faStartAnal{nullptr};
271  QAction* faStopAnal{nullptr};
272  QAction* faAnalConfig{nullptr};
273  QAction* faAnalTermin{nullptr};
274 };
275 
276 #endif
TGo4ConditionEditor * StartConditionEditor()
QAction * faDisconnectAnal
TGo4ServerProxy * ConnectHttpServer(const char *addr=nullptr, const char *user=nullptr, const char *pass=nullptr, bool with_qt_process=false, bool get_analysis_config=false)
QAction * faEventstatus
void HotStart(const char *fname)
QAction * faSuperimpose
void EstablishAnalysisWindowForHttp()
void PrepareForClientConnection(bool interactive=true)
void StatusMessage(const QString &mess)
QAction * faCrosshair
void ChangeTerminalFontSlot()
TGo4AnalysisProxy * AddAnalysisProxy(bool isserver, bool needoutput)
void HelpWindow(const char *filename, const char *msg=nullptr)
void CreateNewHist(int isremote=-1)
void ToggleFullScreenSlot()
void ConnectServer(bool interactive=true, const char *password="")
void EventStatusSlot(bool)
bool SaveBrowserItemToFile(const char *itemname, const char *subfolder)
TGo4MainWindow(QApplication *)
QAction * faShutdownAnal
QAction * faConnectAnal
QString fConnectingHttp
void checkPanelRepaintSlot()
QAction * faPrepareAnal
void ChangeDrawTimeFlagSlot(bool)
void ConnectGo4Widget(QGo4Widget *editor)
void ToggleAnalysisConfiguration()
void LaunchClient(bool interactive=true)
TGo4AnalysisConfiguration * EstablishAnalysisConfiguration(int level)
QString fOMBrowserPath
QAction * faWebCanvas
void ChangeHideEventElement(bool)
TGo4AnalysisStatusMonitor * EstablishRatemeter(int level)
void UpdateDockAnalysisWindow()
bool SubmitAnalysisSettings()
void ToggleMbsMonitor(const char *nodename)
void CreateNewCondition(bool forothereditor=false)
void ChangeTerminalTimeStampSlot(bool)
void closeEvent(QCloseEvent *ce) override
void ShowAboudDialog(const QString &title, const QString &text, const QString &icon)
void CheckConnectingCounterSlot()
QAction * faAnalConfig
QAction * faStartAnal
TGo4FitPanel * StartFitPanel()
TGo4ParaEdit * StartParaEdit(const char *itemname=nullptr)
QString fLastFileDir
TGo4BrowserProxy * Browser()
QAction * faAnalTermin
QAction * faDrawItem
void InputTerminalParametersSlot()
TGo4SetScaleValues * ToggleScaleValues()
QString fOMEditorsPath
void SavePanelCanvas(TGo4ViewPanel *panel)
void windowsMenuAboutToShow()
TGo4HistogramInfo * StartHistogramInfo()
void ChangeFetchWhenSaveSlot(bool)
QString fLastPassword
void SuperimposeSlot(bool)
QAction * faDrawDate
QAction * faLaunchAnal
TGo4AnalysisWindow * EstablishAnalysisWindow(bool needoutput, bool withkillbnt=false, bool force_recreate=false)
void ChangeDrawDateFlagSlot(bool)
TGo4EventInfo * StartEventInfo()
QAction * faSumbStartAnal
TGo4MdiArea * fxMdiArea
void ChangeFetchWhenCopySlot(bool)
void WindowActivated(int id)
virtual ~TGo4MainWindow()
void ChangeSaveWhiteBackgroundSlot(bool)
TGo4ViewPanel * FindViewPanel(const char *name)
bool startUserGUI(const char *)
QAction * faStopAnal
void ChangeFetchWhenDrawSlot(bool)
QGo4Widget * FindGo4Widget(const char *name, bool activate)
const char * LastTypedPassword() const
TGo4ObjectManager * OM()
TGo4EditDynEntry * StartEditDynEntry()
void SetStyleSlot(const QString &)
void editorServiceSlot(QGo4Widget *editor, int serviceid, const char *str, void *par)
QString fKillCommand
void ChangeDrawItemFlagSlot(bool)
void SubmitStartAnalysisSlot()
void CreateNewDynEntry(bool forothereditor=false)
void ChangeCloneFlagSlot(bool)
void ShutdownAnalysis(bool interactive=true)
QApplication * fApp
TGo4ViewPanel * DisplayBrowserItem(const char *itemname, TGo4ViewPanel *panel, TPad *pad, bool activate, int updatelevel, const char *drawopt)
TGo4AnalysisConfiguration * FindAnalysisConfiguration()
TGo4ViewPanel * MakeNewPanel(int div=0)
void TerminateAnalysis(bool interactive=true)
void DisconnectAnalysis(bool interactive=true)
TGo4AnalysisWindow * FindAnalysisWindow()
void CrosshairSlot(bool)
bool RemoveAnalysisProxy(int waittime=30, bool servershutdown=false)
QAction * faDrawTime
TGo4Style * fxStyle
void CascadeMdiPosition(QWidget *sub)
void ChangeDrawOnceSlot(bool)
void ChangeTerminalTimeStampFormatSlot()
TGo4ObjectManager * fxOM
TGo4ConditionInfo * StartConditionInfo()
TGo4Slot * GetWidgetTopSlot(QGo4Widget *widget, bool force)
void ChangeWindowRubberBandSlot(bool)
string msg
Definition: go4init.py:11