GSI Object Oriented Online Offline (Go4)  GO4-5.3.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TGo4MainWindow.h
Go to the documentation of this file.
1 // $Id: TGo4MainWindow.h 1989 2017-02-24 11:45:30Z adamczew $
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 für 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 #include <QCloseEvent>
20 
21 #include <QCheckBox>
22 
23 class QApplication;
24 
25 class QGo4Widget;
26 class TGo4FitPanel;
27 class TGo4ParaEdit;
28 class TGo4HistogramInfo;
29 class TGo4ConditionInfo;
30 class TGo4EditDynEntry;
31 class TGo4EventInfo;
34 class TGo4AnalysisWindow;
36 class TGo4SetScaleValues;
37 
38 class TGo4MdiArea;
39 class TGo4ViewPanel;
40 class TPad;
41 class TGo4Slot;
42 class TGo4ObjectManager;
43 class TGo4Style;
44 class TGo4AnalysisProxy;
45 class TGo4BrowserProxy;
46 class TGo4WidgetProxy;
47 class TGo4ServerProxy;
48 
49 class QAction;
50 class QSignalMapper;
51 class QMenu;
52 
53 class QSpinBox;
54 class QPushButton;
55 
56 
65 class TGo4MainWindow : public QMainWindow {
66  Q_OBJECT
67 
68  public:
69  TGo4MainWindow(QApplication*);
70  virtual ~TGo4MainWindow();
71 
72  void HotStart(const char* fname);
73  void ProcessQtEvents();
74  void StatusMessage(const QString& mess);
75  const char* LastTypedPassword() const;
76  TGo4ViewPanel* FindViewPanel(const char* name);
77  TGo4ViewPanel* DisplayBrowserItem(const char* itemname, TGo4ViewPanel* panel, TPad* pad, bool activate, int updatelevel, const char* drawopt);
78 
81 
82  public slots:
83 
84  void about();
85  void aboutQt();
86  void aboutROOT();
87  void aboutDABC();
89  void UserPanelSlot();
90  TGo4ViewPanel* MakeNewPanel(int div = 0);
91  void LoadLibrarySlot();
92  void CloseAllFilesSlot();
93  void OpenFileSlot();
94  void OpenRemoteFileSlot();
95  void ConnectDabcSlot();
96  TGo4ServerProxy* ConnectHttpSlot(const char* addr = 0, const char* user=0, const char* pass=0, bool with_qt_process = false, bool get_analysis_config=false);
97  void ConnectHServerSlot();
98  void SaveFileSlot();
99  void CascadeSubWindows();
100 
102  void LogSettingsSlot();
103 
104  void IntroHelpSlot();
105  void RefHelpSlot();
106  void FitHelpSlot();
107  void MinAllWindows();
108  void ToggleFullScreenSlot();
109  void SaveSettingsSlot();
110  void ChangeFontSlot();
111  void ChangeTerminalFontSlot();
112  void SetStyleSlot(const QString&);
113  void windowsMenuActivated( int id );
114  void ForseCloseSlot();
115 
119  void ChangeHideEventElement();
120  void ChangeDrawOnceSlot();
122 
123  void CanvasColorSlot();
124  void SuperimposeSlot();
125  void CrosshairSlot();
126  void EventStatusSlot();
127  void MarkerSettingsSlot();
128  void OptStatsSlot();
129  void ChangeCloneFlagSlot();
130  void ChangeDrawTimeFlagSlot();
131  void ChangeDrawDateFlagSlot();
132  void ChangeDrawItemFlagSlot();
134 
135 
138 
139  void DrawLineWidthSlot();
140  void DrawFillColorSlot();
141  void DrawFillStyleSlot();
142 
143  void TH1DrawOptSlot();
144  void TH2DrawOptSlot();
145  void TH3DrawOptSlot();
146  void TGraphDrawOptSlot();
147  void GStyleStatFormatSlot();
148  void PaletteSettingsSlot();
149 
150  void PrepareForClientConnectionSlot(bool interactive = true);
151  void LaunchClientSlot(bool interactive = true);
152  void ConnectServerSlot(bool interactive = true, const char* password = "");
153  void DisconnectAnalysisSlot(bool interactive = true);
154  void ShutdownAnalysisSlot(bool interactive = true);
156  void ToggleAnalysisWindow();
157  void CloseAnalysisWindow();
159 
160  bool SubmitAnalysisSettings();
162  void StartAnalysisSlot();
163  void StopAnalysisSlot();
164 
165  void CreateNewHistSlot(int isremote = -1);
166  void CreateNewConditionSlot(bool forothereditor = false);
167  void CreateNewDynEntrySlot(bool forothereditor = false);
168 
169 
170 
171  // modify default highdpi scaling
172  void ScaleFactorSlot();
173 
174  // starting editors slots
176  TGo4ParaEdit* StartParaEdit(const char* itemname = 0);
182 
185  TGo4AnalysisWindow* EstablishAnalysisWindow(bool needoutput, bool withkillbnt = false, bool force_recreate = false);
186 
187  // slots connected to editors
188  void editorServiceSlot(QGo4Widget* editor, int serviceid, const char* str, void* par);
189 
190  void ProcessHotStart();
191  void StopGUIScriptSlot();
192  void CreateGUIScriptSlot();
194  void checkPanelRepaintSlot();
195 
196 
197 
198  protected:
199 
200  void AddAnalysisBar();
201  void AddAnalysisMenu();
202  void AddFileMenu();
203  void AddFileToolBar();
204  void AddSettingMenu();
205  void AddToolsBar();
206  void AddToolsMenu();
207 
208  void AddAnalysisMacrosBar();
209 
210  virtual void closeEvent( QCloseEvent * ce );
211 
212  void ConnectGo4Widget(QGo4Widget* editor);
213 
214  void CascadeMdiPosition(QWidget* sub);
215 
216  void UpdateCaptionButtons();
217 
218  bool startUserGUI(const char*);
219  TGo4AnalysisProxy* AddAnalysisProxy(bool isserver, bool needoutput);
220  bool RemoveAnalysisProxy(int waittime = 30, bool servershutdown = false);
223 
224  QGo4Widget* FindGo4Widget(const char* name, bool activate);
225  TGo4Slot* GetWidgetTopSlot(QGo4Widget* widget, bool force);
226 
227  bool SaveBrowserItemToFile(const char* itemname, const char* subfolder);
228 
230  void TerminateAnalysis(bool interactive = true);
231 
232  void ToggleMbsMonitor(const char* nodename);
234 
235  void SavePanelCanvas(TGo4ViewPanel* panel);
236 
237  void HelpWindow(const char* filename, const char* msg = 0);
238 
239  void UpdateBrowser();
240 
241  QApplication* fApp;
242 
243  QMenu* windowsMenu;
244  QSignalMapper* winMapper;
248  QString fOMDataPath;
249  QString fOMBrowserPath;
250  QString fOMEditorsPath;
251 
252  QString fKillCommand;
253 
256 
258  int fConnectingCounter; // counter to establish connection
259  bool fbGetAnalysisConfig; // flag to decide if we want to have analysis config after connect
260  QString fConnectingHttp; // http address (set when doing connection to http)
261  QString fLastPassword;
262  QString fLastFileDir;
263 
266 
267  QAction* faFetchWhenDraw;
268  QAction* faFetchWhenCopy;
269  QAction* faFetchWhenSave;
271  QAction* faDrawOnce;
273 
274  QAction* faSuperimpose;
275  QAction* faCrosshair;
276  QAction* faEventstatus;
277  QAction* faClone;
278  QAction* faDrawTime;
279  QAction* faDrawDate;
280  QAction* faDrawItem;
281  QAction* faSaveWhite;
282 
283 
284  QAction* faLaunchAnal;
285  QAction* faConnectAnal;
286  QAction* faPrepareAnal;
288  QAction* faShutdownAnal;
289  QAction* faSumbStartAnal;
290  QAction* faStartAnal;
291  QAction* faStopAnal;
292  QAction* faAnalConfig;
293  QAction* faAnalTermin;
294  QAction* faTermTimeStamp;
295 };
296 
297 #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)
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