GSI Object Oriented Online Offline (Go4)  GO4-6.1.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TGo4MainWindow.h
Go to the documentation of this file.
1 // $Id: TGo4MainWindow.h 2627 2019-10-01 08:02:45Z 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 #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 QSignalMapper;
45 class QMenu;
46 class QSpinBox;
47 class QPushButton;
48 class QCloseEvent;
49 class QApplication;
50 
56 class TGo4MainWindow : public QMainWindow {
57  Q_OBJECT
58 
59  public:
60  TGo4MainWindow(QApplication*);
61  virtual ~TGo4MainWindow();
62 
63  void HotStart(const char* fname);
64  void ProcessQtEvents();
65  void StatusMessage(const QString& mess);
66  const char* LastTypedPassword() const;
67  TGo4ViewPanel* FindViewPanel(const char* name);
68  TGo4ViewPanel* DisplayBrowserItem(const char* itemname, TGo4ViewPanel* panel, TPad* pad, bool activate, int updatelevel, const char* drawopt);
69 
72 
73  public slots:
74 
75  void about();
76  void aboutQt();
77  void aboutROOT();
78  void aboutDABC();
80  void UserPanelSlot();
81  TGo4ViewPanel* MakeNewPanel(int div = 0);
82  void LoadLibrarySlot();
83  void CloseAllFilesSlot();
84  void OpenFileSlot();
85  void OpenRemoteFileSlot();
86  void ConnectDabcSlot();
87  TGo4ServerProxy* ConnectHttpSlot(const char* addr = 0, const char* user=0, const char* pass=0, bool with_qt_process = false, bool get_analysis_config=false);
88  void ConnectHServerSlot();
89  void SaveFileSlot();
90  void CascadeSubWindows();
91 
93  void LogSettingsSlot();
94 
95  void IntroHelpSlot();
96  void RefHelpSlot();
97  void FitHelpSlot();
98  void MinAllWindows();
99  void ToggleFullScreenSlot();
100  void SaveSettingsSlot();
101  void ChangeFontSlot();
102  void ChangeTerminalFontSlot();
103  void SetStyleSlot(const QString&);
104  void windowsMenuActivated( int id );
105  void ForseCloseSlot();
106 
110  void ChangeHideEventElement();
111  void ChangeDrawOnceSlot();
113 
114  void CanvasColorSlot();
115  void SuperimposeSlot();
116  void CrosshairSlot();
117  void EventStatusSlot();
118  void MarkerSettingsSlot();
119  void OptStatsSlot();
120  void ChangeCloneFlagSlot();
121  void ChangeDrawTimeFlagSlot();
122  void ChangeDrawDateFlagSlot();
123  void ChangeDrawItemFlagSlot();
125 
128 
129  void DrawLineWidthSlot();
130  void DrawFillColorSlot();
131  void DrawFillStyleSlot();
132 
133  void TH1DrawOptSlot();
134  void TH2DrawOptSlot();
135  void TH3DrawOptSlot();
136  void TGraphDrawOptSlot();
137  void GStyleStatFormatSlot();
138  void PaletteSettingsSlot();
139 
140  void PrepareForClientConnectionSlot(bool interactive = true);
141  void LaunchClientSlot(bool interactive = true);
142  void ConnectServerSlot(bool interactive = true, const char* password = "");
143  void DisconnectAnalysisSlot(bool interactive = true);
144  void ShutdownAnalysisSlot(bool interactive = true);
146  void ToggleAnalysisWindow();
147  void CloseAnalysisWindow();
149 
150  bool SubmitAnalysisSettings();
152  void StartAnalysisSlot();
153  void StopAnalysisSlot();
154 
155  void CreateNewHistSlot(int isremote = -1);
156  void CreateNewConditionSlot(bool forothereditor = false);
157  void CreateNewDynEntrySlot(bool forothereditor = false);
158 
159  // modify default high-dpi scaling
160  void ScaleFactorSlot();
161 
162  // starting editors slots
164  TGo4ParaEdit* StartParaEdit(const char* itemname = 0);
170 
173  TGo4AnalysisWindow* EstablishAnalysisWindow(bool needoutput, bool withkillbnt = false, bool force_recreate = false);
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 AddAnalysisBar();
187  void AddAnalysisMenu();
188  void AddFileMenu();
189  void AddFileToolBar();
190  void AddSettingMenu();
191  void AddToolsBar();
192  void AddToolsMenu();
193 
194  void AddAnalysisMacrosBar();
195 
196  virtual void closeEvent( QCloseEvent * ce );
197 
198  void ConnectGo4Widget(QGo4Widget* editor);
199 
200  void CascadeMdiPosition(QWidget* sub);
201 
202  void UpdateCaptionButtons();
203 
204  bool startUserGUI(const char*);
205  TGo4AnalysisProxy* AddAnalysisProxy(bool isserver, bool needoutput);
206  bool RemoveAnalysisProxy(int waittime = 30, bool servershutdown = false);
209 
210  QGo4Widget* FindGo4Widget(const char* name, bool activate);
211  TGo4Slot* GetWidgetTopSlot(QGo4Widget* widget, bool force);
212 
213  bool SaveBrowserItemToFile(const char* itemname, const char* subfolder);
214 
216  void TerminateAnalysis(bool interactive = true);
217 
218  void ToggleMbsMonitor(const char* nodename);
220 
221  void SavePanelCanvas(TGo4ViewPanel* panel);
222 
223  void HelpWindow(const char* filename, const char* msg = 0);
224 
225  void UpdateBrowser();
226 
227  QApplication* fApp;
228 
229  QMenu* windowsMenu;
230  QSignalMapper* winMapper;
234  QString fOMDataPath;
235  QString fOMBrowserPath;
236  QString fOMEditorsPath;
237 
238  QString fKillCommand;
239 
242 
244  int fConnectingCounter; // counter to establish connection
245  bool fbGetAnalysisConfig; // flag to decide if we want to have analysis config after connect
246  QString fConnectingHttp; // http address (set when doing connection to http)
247  QString fLastPassword;
248  QString fLastFileDir;
249 
252 
253  QAction* faFetchWhenDraw;
254  QAction* faFetchWhenCopy;
255  QAction* faFetchWhenSave;
257  QAction* faDrawOnce;
259 
260  QAction* faWebCanvas;
261  QAction* faSuperimpose;
262  QAction* faCrosshair;
263  QAction* faEventstatus;
264  QAction* faClone;
265  QAction* faDrawTime;
266  QAction* faDrawDate;
267  QAction* faDrawItem;
268  QAction* faSaveWhite;
269 
270  QAction* faLaunchAnal;
271  QAction* faConnectAnal;
272  QAction* faPrepareAnal;
274  QAction* faShutdownAnal;
275  QAction* faSumbStartAnal;
276  QAction* faStartAnal;
277  QAction* faStopAnal;
278  QAction* faAnalConfig;
279  QAction* faAnalTermin;
280  QAction* faTermTimeStamp;
281 };
282 
283 #endif
QAction * faWindowRubberBand
TGo4ConditionEditor * StartConditionEditor()
QAction * faDisconnectAnal
void CreateNewHistSlot(int isremote=-1)
QAction * faEventstatus
void HotStart(const char *fname)
QAction * faSuperimpose
void EstablishAnalysisWindowForHttp()
void StatusMessage(const QString &mess)
QAction * faCrosshair
void ChangeTerminalFontSlot()
TGo4AnalysisProxy * AddAnalysisProxy(bool isserver, bool needoutput)
void ChangeDrawDateFlagSlot()
QAction * faDrawOnce
void ToggleFullScreenSlot()
void LaunchClientSlot(bool interactive=true)
bool SaveBrowserItemToFile(const char *itemname, const char *subfolder)
QAction * faSaveWhite
TGo4MainWindow(QApplication *)
void ChangeFetchWhenDrawSlot()
QAction * faShutdownAnal
QAction * faConnectAnal
QString fConnectingHttp
void checkPanelRepaintSlot()
QAction * faPrepareAnal
void ConnectGo4Widget(QGo4Widget *editor)
void HelpWindow(const char *filename, const char *msg=0)
void ToggleAnalysisConfiguration()
QAction * faClone
TGo4AnalysisConfiguration * EstablishAnalysisConfiguration(int level)
QAction * faTermTimeStamp
QString fOMBrowserPath
QAction * faFetchWhenSave
void CreateNewConditionSlot(bool forothereditor=false)
QAction * faWebCanvas
void ChangeHideEventElement()
TGo4ParaEdit * StartParaEdit(const char *itemname=0)
QAction * faHideEventElement
TGo4AnalysisStatusMonitor * EstablishRatemeter(int level)
QAction * faFetchWhenDraw
void UpdateDockAnalysisWindow()
bool SubmitAnalysisSettings()
void ToggleMbsMonitor(const char *nodename)
void ConnectServerSlot(bool interactive=true, const char *password="")
void ChangeFetchWhenCopySlot()
void CheckConnectingCounterSlot()
QAction * faAnalConfig
void ShutdownAnalysisSlot(bool interactive=true)
QAction * faStartAnal
TGo4FitPanel * StartFitPanel()
QString fLastFileDir
void ChangeTerminalTimeStampSlot()
TGo4BrowserProxy * Browser()
QAction * faAnalTermin
QAction * faDrawItem
void InputTerminalParametersSlot()
TGo4SetScaleValues * ToggleScaleValues()
QString fOMEditorsPath
void SavePanelCanvas(TGo4ViewPanel *panel)
void windowsMenuAboutToShow()
TGo4HistogramInfo * StartHistogramInfo()
void ChangeSaveWhiteBackgroundSlot()
QString fLastPassword
QAction * faDrawDate
QAction * faLaunchAnal
TGo4AnalysisWindow * EstablishAnalysisWindow(bool needoutput, bool withkillbnt=false, bool force_recreate=false)
QAction * faFetchWhenCopy
TGo4EventInfo * StartEventInfo()
void windowsMenuActivated(int id)
QAction * faSumbStartAnal
TGo4MdiArea * fxMdiArea
QSignalMapper * winMapper
virtual ~TGo4MainWindow()
TGo4ViewPanel * FindViewPanel(const char *name)
bool startUserGUI(const char *)
QAction * faStopAnal
void CreateNewDynEntrySlot(bool forothereditor=false)
QGo4Widget * FindGo4Widget(const char *name, bool activate)
TGo4ObjectManager * OM()
TGo4EditDynEntry * StartEditDynEntry()
void SetStyleSlot(const QString &)
void editorServiceSlot(QGo4Widget *editor, int serviceid, const char *str, void *par)
QString fKillCommand
void DisconnectAnalysisSlot(bool interactive=true)
void SubmitStartAnalysisSlot()
TGo4ServerProxy * ConnectHttpSlot(const char *addr=0, const char *user=0, const char *pass=0, bool with_qt_process=false, bool get_analysis_config=false)
QApplication * fApp
virtual void closeEvent(QCloseEvent *ce)
void ChangeFetchWhenSaveSlot()
void ChangeDrawTimeFlagSlot()
TGo4ViewPanel * DisplayBrowserItem(const char *itemname, TGo4ViewPanel *panel, TPad *pad, bool activate, int updatelevel, const char *drawopt)
TGo4AnalysisConfiguration * FindAnalysisConfiguration()
void ChangeDrawItemFlagSlot()
TGo4ViewPanel * MakeNewPanel(int div=0)
void TerminateAnalysis(bool interactive=true)
const char * LastTypedPassword() const
TGo4AnalysisWindow * FindAnalysisWindow()
bool RemoveAnalysisProxy(int waittime=30, bool servershutdown=false)
QAction * faDrawTime
TGo4Style * fxStyle
void CascadeMdiPosition(QWidget *sub)
void ChangeTerminalTimeStampFormatSlot()
TGo4ObjectManager * fxOM
void ChangeWindowRubberBandSlot()
void PrepareForClientConnectionSlot(bool interactive=true)
TGo4ConditionInfo * StartConditionInfo()
TGo4Slot * GetWidgetTopSlot(QGo4Widget *widget, bool force)
string msg
Definition: go4init.py:11