ATLAS Offline Software
VP1MainWindow.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // //
7 // Header file for class VP1MainWindow //
8 // //
9 // Author: Thomas Kittelmann <Thomas.Kittelmann@cern.ch> //
10 // //
11 // Initial version: April 2007 //
12 // //
14 
15 #ifndef VP1MainWindow_H
16 #define VP1MainWindow_H
17 
18 // include the related GUI
19 #include "../src/ui_vp1mainwindow.h"
20 
21 // include VP1
22 #include "VP1Gui/VP1TcpServer.h"
24 
25 // include Qt
26 #include <QQueue>
27 #include <QStringList>
28 #include <QMap>
29 
30 class VP1ChannelManager;
31 class VP1TabManager;
32 class QStringList;
33 class IVP1ChannelWidget;
34 //class VP1ConfigForm;
36 class VP1AvailEvents;
38 class VP1PluginDialog;
39 class QProgressBar;
40 class QLabel;
41 class QComboBox;
43 class QMutex;
44 
45 //#include <QtGlobal>
46 //#if QT_VERSION > QT_VERSION_CHECK(5, 5, 0)
47 // class QWebEngineView; // Qt 5.6
48 //#else
49 // class QWebView;
50 //#endif
51 
52 
54 {
56  : inputDir()
57  , dirStatus()
58  , enabled(true)
59  , bold(false)
60  {};
61 
62  VP1DirStatusData(QString the_inputDir
63  , QString the_dirStatus
64  , bool the_enabled
65  , bool the_bold)
66  : inputDir(the_inputDir)
67  , dirStatus(the_dirStatus)
68  , enabled(the_enabled)
69  , bold(the_bold)
70  {};
71 
72  QString inputDir;
73  QString dirStatus;
74  bool enabled;
75  bool bold;
76 };
77 
78 typedef QMap<QAction*,VP1DirStatusData> VP1DirStatuses;
79 
80 
81 class VP1MainWindow : public QMainWindow, public Ui::VP1MainWindow
82 {
83  Q_OBJECT
84 
85 public:
86  VP1MainWindow(VP1ExecutionScheduler*,VP1AvailEvents * availEvents,QWidget *parent = 0);
88 
89  bool okToProceedToNextEvent() const;
90 
91  // Set next event to the execution scheduler and updates event controls
92  // We needed to separate this method from goToNextEvent() in order to be able
93  // to skip the bootstrap event in the https mode
94  void nextEvent();
95 
96  QStringList userRequestedFiles();
97 
98 public Q_SLOTS:
99  void loadPluginFile(QString filename);
100 
101  #ifdef BUILDVP1LIGHT
102  void request_expertSettings();
103  #endif
104  void request_addEmptyTab();
106  void request_printChannel();
107  QString request_saveChannelSnapshot(QString xLabel="");
109  void request_saveasConfig();
110  void request_saveConfig();
111  void request_loadConfig();
112  void request_loadPlugin();
113  void unloadPlugin_continue();
114  void pluginDialogClosed();
115  void saveAllCurrentChannels();
117  void getAllChannelsIntoSnapshots(QList<QPixmap>& list, QStringList& listNames);
119  QPixmap getSingleChannelCustomSnapshot(QString tabName, int width = 0);
120 
121  void tabListChanged(QStringList);
122 
124 
125  void loadConfigurationFromFile(QString file);
126  void replaceConfigurationFile(QString file);
127 
128  void addToMessageBox( const QString&, const QString& extrastyleopts = "",
129  const QString& title = "", const QString& titleextrastyleopts = "" );
130  void systemAddToMessageBox( const QString& );
131  void channelAddToMessageBox( const QString& );
132  void helperAddToMessageBox( const QString& );
133  void changeFontSize(int);
134 
135  //For use when going to a new event (this updates system lists and quit()'s the app):
136  void goToNextEvent();
137  #if defined BUILDVP1LIGHT
138  void goToPreviousEvent();
139  void chooseEvent();
140  #endif
141 public:
142  void setRunEvtNumber(const int& runnumber, const unsigned long long& eventnumber, const unsigned& triggerType = 0, const unsigned& time = 0, const bool& printmessage = true );
143  bool mustQuit() const;
144 
146  VP1TabManager * tabManager() const { return m_tabmanager; }
147 
149 
150  int getRunNumber() { return m_runnumber; }
151  unsigned long long getEventNumber() { return m_eventnumber; }
152  int getEventTimestamp() { return m_timestamp; }
153 
154 protected:
159  unsigned long long m_eventnumber;
160  unsigned m_timestamp;
162 
163  void closeEvent(QCloseEvent *event);
165 
169 
171  void listenOnTcp();
172 
174  QQueue<VP1ExternalRequest> m_requestqueue;
177  QList<VP1ExternalRequest> m_messages_blockedexactmessages;
178 
179  void addChannelIconsToComboBox(QComboBox* cb, const bool& isbasenames);
180 
183 
184  void setupStatusBar();
186 
187  QMap<QString,QString> availablePluginFiles() const;
188  QMap<QString,QString> availableFiles(const QString& extension,
189  const QString& pathvar,
190  const QString& instareasubdir,
191  const QString& extradirenvvar,
192  bool currentdir = false) const;
193 
194 public:
195  QProgressBar*progressbar;
196 protected Q_SLOTS:
199  void finishedIncomingDialog();
200  void updateTcpIcon();
201  void postInitUpdates();
202  void showMenu_loadPlugin();
204  void showMenu_loadConfFile();
209  void quickSetupTriggered();
210  void updateEventControls();
211  void addEventFile();
212  void help_openUserGuide();
213  void help_openUserSupport();
214  void help_openVP1WebSite();
215  void help_openAbout();
216 
219 
220  void launch3DstereoEditor();
221 
222 
223 protected:
237 
238  QList<QAction*> m_inputdiractions;
243 
244  //Fontsize:
248  const QString m_settingsfile;
249 
251 
252  QStringList m_userRequestedFiles;
253 
255  QMutex* m_mutex;
256 
257 // // Web broser instance to show VP1 documentation
258 // #if QT_VERSION > QT_VERSION_CHECK(5, 5, 0)
259 // QWebEngineView *m_view; // Qt 5
260 // #else
261 // QWebView *m_view;
262 // #endif
263 
264  // Event display editor
266 };
267 
268 
269 #endif
270 
VP1MainWindow::updateCentralStackWidget
void updateCentralStackWidget()
Definition: VP1MainWindow.cxx:1646
VP1MainWindow::VP1MainWindow
VP1MainWindow(VP1ExecutionScheduler *, VP1AvailEvents *availEvents, QWidget *parent=0)
Definition: VP1MainWindow.cxx:89
VP1DirStatusData
Definition: VP1MainWindow.h:54
VP1MainWindow::postInitUpdates
void postInitUpdates()
Definition: VP1MainWindow.cxx:486
VP1MainWindow::showMenu_loadPluginItemSelected
void showMenu_loadPluginItemSelected()
Definition: VP1MainWindow.cxx:1531
VP1MainWindow::selectedChannelChanged
void selectedChannelChanged(IVP1ChannelWidget *)
Definition: VP1MainWindow.cxx:637
VP1MainWindow::~VP1MainWindow
~VP1MainWindow()
Definition: VP1MainWindow.cxx:538
VP1MainWindow::m_actionEnableExpertSettings
QAction * m_actionEnableExpertSettings
Definition: VP1MainWindow.h:230
VP1MainWindow::m_mustquit
bool m_mustquit
Definition: VP1MainWindow.h:164
VP1MainWindow::m_currentconfigfile
QString m_currentconfigfile
Definition: VP1MainWindow.h:157
VP1MainWindow::launch3DstereoEditor
void launch3DstereoEditor()
Definition: VP1MainWindow.cxx:429
VP1MainWindow::m_action_openAbout
QAction * m_action_openAbout
Definition: VP1MainWindow.h:236
VP1MainWindow::changeStyleActionTriggered
void changeStyleActionTriggered()
Definition: VP1MainWindow.cxx:1586
VP1MainWindow::helperAddToMessageBox
void helperAddToMessageBox(const QString &)
Definition: VP1MainWindow.cxx:1063
VP1TcpServer
Definition: VP1TcpServer.h:22
VP1MainWindow::changeFontSize
void changeFontSize(int)
Definition: VP1MainWindow.cxx:1617
VP1TcpServer.h
VP1MainWindow::m_requestqueue
QQueue< VP1ExternalRequest > m_requestqueue
Definition: VP1MainWindow.h:174
VP1MainWindow::m_channelmanager
VP1ChannelManager * m_channelmanager
Definition: VP1MainWindow.h:155
rename_histos_in_files_from_old_code.currentdir
currentdir
Definition: rename_histos_in_files_from_old_code.py:289
VP1StreamMenuUpdater
Definition: VP1StreamMenuUpdater.h:15
VP1EventDisplayEditor.h
VP1MainWindow::help_openUserGuide
void help_openUserGuide()
Definition: VP1MainWindow.cxx:437
VP1MainWindow::help_openVP1WebSite
void help_openVP1WebSite()
Definition: VP1MainWindow.cxx:461
VP1MainWindow::setupStatusBar
void setupStatusBar()
Definition: VP1MainWindow.cxx:524
VP1MainWindow::availablePluginFiles
QMap< QString, QString > availablePluginFiles() const
Definition: VP1MainWindow.cxx:823
VP1MainWindow::getSingleChannelCustomSnapshot
QPixmap getSingleChannelCustomSnapshot(IVP1ChannelWidget *tab, int width=0)
Definition: VP1MainWindow.cxx:1162
VP1MainWindow::tabListChanged
void tabListChanged(QStringList)
Definition: VP1MainWindow.cxx:606
VP1MainWindow::replaceConfigurationFile
void replaceConfigurationFile(QString file)
Definition: VP1MainWindow.cxx:1415
VP1MainWindow::getEventNumber
unsigned long long getEventNumber()
Definition: VP1MainWindow.h:151
VP1MainWindow::loadPluginFile
void loadPluginFile(QString filename)
Definition: VP1MainWindow.cxx:581
VP1EventDisplayEditor
Definition: VP1EventDisplayEditor.h:34
VP1MainWindow::availableFiles
QMap< QString, QString > availableFiles(const QString &extension, const QString &pathvar, const QString &instareasubdir, const QString &extradirenvvar, bool currentdir=false) const
Definition: VP1MainWindow.cxx:724
VP1MainWindow::m_tcpserver
VP1TcpServer m_tcpserver
Definition: VP1MainWindow.h:170
VP1DirStatuses
QMap< QAction *, VP1DirStatusData > VP1DirStatuses
Definition: VP1MainWindow.h:78
VP1MainWindow::makeAllChannelsEventDisplay
void makeAllChannelsEventDisplay()
Definition: VP1MainWindow.cxx:1089
VP1MainWindow::m_menu_changeStyle
QMenu * m_menu_changeStyle
Definition: VP1MainWindow.h:227
VP1MainWindow::finishedIncomingDialog
void finishedIncomingDialog()
Definition: VP1MainWindow.cxx:1433
VP1MainWindow::m_inputdirstatuses
VP1DirStatuses m_inputdirstatuses
Definition: VP1MainWindow.h:239
covarianceTool.xLabel
xLabel
Definition: covarianceTool.py:542
VP1DirStatusData::bold
bool bold
Definition: VP1MainWindow.h:75
VP1MainWindow::processEnqueuedRequests
void processEnqueuedRequests()
Definition: VP1MainWindow.cxx:1442
VP1MainWindow::help_openAbout
void help_openAbout()
Definition: VP1MainWindow.cxx:474
VP1MainWindow::saveAllCurrentChannels
void saveAllCurrentChannels()
Definition: VP1MainWindow.cxx:1221
VP1MainWindow::tabManager
VP1TabManager * tabManager() const
Definition: VP1MainWindow.h:146
VP1MainWindow::request_loadConfig
void request_loadConfig()
Definition: VP1MainWindow.cxx:693
VP1ChannelManager
Definition: VP1ChannelManager.h:27
VP1MainWindow::help_openUserSupport
void help_openUserSupport()
Definition: VP1MainWindow.cxx:449
VP1MainWindow::addToMessageBox
void addToMessageBox(const QString &, const QString &extrastyleopts="", const QString &title="", const QString &titleextrastyleopts="")
Definition: VP1MainWindow.cxx:1017
VP1MainWindow::changeFontSizeActionTriggered
void changeFontSizeActionTriggered()
Definition: VP1MainWindow.cxx:1602
VP1MainWindow::m_settingsfile
const QString m_settingsfile
Definition: VP1MainWindow.h:248
VP1MainWindow::m_streamMenuUpdater
VP1StreamMenuUpdater * m_streamMenuUpdater
Definition: VP1MainWindow.h:254
VP1MainWindow::getAllChannelsIntoSnapshots
void getAllChannelsIntoSnapshots(QList< QPixmap > &list, QStringList &listNames)
Definition: VP1MainWindow.cxx:1119
VP1MainWindow::updateInputDirectoriesStatus
void updateInputDirectoriesStatus()
Definition: VP1MainWindow.cxx:1825
VP1MainWindow::m_plugindialog
VP1PluginDialog * m_plugindialog
Definition: VP1MainWindow.h:182
VP1MainWindow::m_betweenevents
bool m_betweenevents
Definition: VP1MainWindow.h:161
VP1MainWindow::closeEvent
void closeEvent(QCloseEvent *event)
Definition: VP1MainWindow.cxx:938
VP1MainWindow::m_blockallmessages
bool m_blockallmessages
Definition: VP1MainWindow.h:175
VP1MainWindow::m_menu_changeFontSize
QMenu * m_menu_changeFontSize
Definition: VP1MainWindow.h:228
VP1MainWindow::loadConfigurationFromFile
void loadConfigurationFromFile(QString file)
Definition: VP1MainWindow.cxx:1410
VP1MainWindow::showMenu_loadConfFile
void showMenu_loadConfFile()
Definition: VP1MainWindow.cxx:1542
VP1MainWindow::unloadPlugin_continue
void unloadPlugin_continue()
Definition: VP1MainWindow.cxx:864
VP1MainWindow::request_cruisemodechange
void request_cruisemodechange()
Definition: VP1MainWindow.cxx:1475
event
POOL::TEvent event(POOL::TEvent::kClassAccess)
VP1ExternalRequest
Definition: VP1ExternalRequest.h:20
VP1IncomingMessageDialog
Definition: VP1IncomingMessageDialog.h:27
VP1DirStatusData::inputDir
QString inputDir
Definition: VP1MainWindow.h:70
VP1MainWindow::m_eventnumber
unsigned long long m_eventnumber
Definition: VP1MainWindow.h:159
VP1MainWindow::okToProceedToNextEvent
bool okToProceedToNextEvent() const
Definition: VP1MainWindow.cxx:876
VP1MainWindow::m_statusbarlabel
QLabel * m_statusbarlabel
Definition: VP1MainWindow.h:185
VP1DirStatusData::dirStatus
QString dirStatus
Definition: VP1MainWindow.h:73
VP1MainWindow::m_mutex
QMutex * m_mutex
Definition: VP1MainWindow.h:255
covarianceTool.title
title
Definition: covarianceTool.py:542
VP1DirStatusData::VP1DirStatusData
VP1DirStatusData()
Definition: VP1MainWindow.h:55
VP1MainWindow::m_userRequestedFiles
QStringList m_userRequestedFiles
Definition: VP1MainWindow.h:252
VP1MainWindow::request_channelInformation
void request_channelInformation()
Definition: VP1MainWindow.cxx:1069
file
TFile * file
Definition: tile_monitor.h:29
test_pyathena.parent
parent
Definition: test_pyathena.py:15
VP1MainWindow::m_availEvents
VP1AvailEvents * m_availEvents
Definition: VP1MainWindow.h:168
VP1MainWindow::m_dummyemptycontroller
QWidget * m_dummyemptycontroller
Definition: VP1MainWindow.h:166
VP1MainWindow::m_currentincomingdialog
VP1IncomingMessageDialog * m_currentincomingdialog
Definition: VP1MainWindow.h:173
VP1DirStatusData::VP1DirStatusData
VP1DirStatusData(QString the_inputDir, QString the_dirStatus, bool the_enabled, bool the_bold)
Definition: VP1MainWindow.h:62
VP1MainWindow::request_loadPlugin
void request_loadPlugin()
Definition: VP1MainWindow.cxx:705
histSizes.list
def list(name, path='/')
Definition: histSizes.py:38
VP1MainWindow::nextEvent
void nextEvent()
Definition: VP1MainWindow.cxx:883
VP1MainWindow::m_currentunloadpluginfiles
QStringList m_currentunloadpluginfiles
Definition: VP1MainWindow.h:181
VP1MainWindow::showMenu_loadPlugin
void showMenu_loadPlugin()
Definition: VP1MainWindow.cxx:1495
VP1MainWindow::m_action_openUsersSupport
QAction * m_action_openUsersSupport
Definition: VP1MainWindow.h:234
DeMoScan.runnumber
runnumber
Definition: DeMoScan.py:266
VP1MainWindow::m_currentloadpluginpath
QString m_currentloadpluginpath
Definition: VP1MainWindow.h:241
VP1MainWindow::channelManager
VP1ChannelManager * channelManager() const
Definition: VP1MainWindow.h:145
VP1MainWindow::m_currentsaveimagepath
QString m_currentsaveimagepath
Definition: VP1MainWindow.h:240
IVP1ChannelWidget
Definition: IVP1ChannelWidget.h:34
VP1MainWindow::m_timestamp
unsigned m_timestamp
Definition: VP1MainWindow.h:160
VP1MainWindow::m_action_addEventFile
QAction * m_action_addEventFile
Definition: VP1MainWindow.h:232
VP1MainWindow::showMenu_loadConfFileItemSelected
void showMenu_loadConfFileItemSelected()
Definition: VP1MainWindow.cxx:1576
VP1ExecutionScheduler
Definition: VP1ExecutionScheduler.h:42
VP1MainWindow::m_defaultfont_pixelsize
int m_defaultfont_pixelsize
Definition: VP1MainWindow.h:247
VP1MainWindow::userRequestedExit
bool userRequestedExit()
Definition: VP1MainWindow.h:148
VP1MainWindow::m_actionSave_current_tabs
QAction * m_actionSave_current_tabs
Definition: VP1MainWindow.h:231
VP1MainWindow::getEventTimestamp
int getEventTimestamp()
Definition: VP1MainWindow.h:152
VP1PluginDialog
Definition: VP1PluginDialog.h:23
VP1MainWindow::progressbar
QProgressBar * progressbar
Definition: VP1MainWindow.h:195
VP1MainWindow::m_action_openUsersGuide
QAction * m_action_openUsersGuide
Definition: VP1MainWindow.h:233
VP1MainWindow::m_actionAdd_empty_tab
QAction * m_actionAdd_empty_tab
Definition: VP1MainWindow.h:229
VP1MainWindow::m_menu_loadConfFile
QMenu * m_menu_loadConfFile
Definition: VP1MainWindow.h:226
VP1MainWindow::m_edEditor
VP1EventDisplayEditor * m_edEditor
Definition: VP1MainWindow.h:265
VP1MainWindow::request_saveConfig
void request_saveConfig()
Definition: VP1MainWindow.cxx:683
VP1MainWindow::request_addEmptyTab
void request_addEmptyTab()
Definition: VP1MainWindow.cxx:596
VP1MainWindow::listenOnTcp
void listenOnTcp()
Definition: VP1MainWindow.cxx:1423
VP1MainWindow::m_currentStream
QString m_currentStream
Definition: VP1MainWindow.h:242
VP1MainWindow::updateTcpIcon
void updateTcpIcon()
Definition: VP1MainWindow.cxx:570
Base_Fragment.width
width
Definition: Sherpa_i/share/common/Base_Fragment.py:59
CaloSwCorrections.time
def time(flags, cells_name, *args, **kw)
Definition: CaloSwCorrections.py:242
VP1MainWindow::getRunNumber
int getRunNumber()
Definition: VP1MainWindow.h:150
VP1DirStatusData::enabled
bool enabled
Definition: VP1MainWindow.h:74
VP1MainWindow::m_action_infoAboutLoadedPlugins
QAction * m_action_infoAboutLoadedPlugins
Definition: VP1MainWindow.h:224
VP1MainWindow::request_printChannel
void request_printChannel()
Definition: VP1MainWindow.cxx:1390
CaloCellTimeCorrFiller.filename
filename
Definition: CaloCellTimeCorrFiller.py:24
VP1MainWindow::addEventFile
void addEventFile()
Definition: VP1MainWindow.cxx:1876
VP1MainWindow::request_saveChannelSnapshot
QString request_saveChannelSnapshot(QString xLabel="")
Definition: VP1MainWindow.cxx:1335
RunTileMonitoring.triggerType
triggerType
Definition: RunTileMonitoring.py:162
VP1MainWindow::m_action_openVP1Site
QAction * m_action_openVP1Site
Definition: VP1MainWindow.h:235
VP1TabManager
Definition: VP1TabManager.h:30
VP1MainWindow::addChannelIconsToComboBox
void addChannelIconsToComboBox(QComboBox *cb, const bool &isbasenames)
Definition: VP1MainWindow.cxx:627
VP1MainWindow::m_runnumber
int m_runnumber
Definition: VP1MainWindow.h:158
VP1MainWindow::setRunEvtNumber
void setRunEvtNumber(const int &runnumber, const unsigned long long &eventnumber, const unsigned &triggerType=0, const unsigned &time=0, const bool &printmessage=true)
Definition: VP1MainWindow.cxx:974
VP1AvailEvents
Definition: VP1AvailEvents.h:25
VP1MainWindow::m_scheduler
VP1ExecutionScheduler * m_scheduler
Definition: VP1MainWindow.h:167
VP1MainWindow::m_tabmanager
VP1TabManager * m_tabmanager
Definition: VP1MainWindow.h:156
VP1MainWindow::userRequestedFiles
QStringList userRequestedFiles()
Definition: VP1MainWindow.cxx:1868
VP1MainWindow::systemAddToMessageBox
void systemAddToMessageBox(const QString &)
Definition: VP1MainWindow.cxx:1037
VP1MainWindow::updateEventControls
void updateEventControls()
Definition: VP1MainWindow.cxx:1816
VP1MainWindow::goToNextEvent
void goToNextEvent()
Definition: VP1MainWindow.cxx:898
VP1MainWindow
Definition: VP1MainWindow.h:82
VP1MainWindow::m_menu_loadPlugin
QMenu * m_menu_loadPlugin
Definition: VP1MainWindow.h:225
VP1MainWindow::m_defaultfont
QFont m_defaultfont
Definition: VP1MainWindow.h:245
VP1MainWindow::receivedExternalRequest
void receivedExternalRequest(VP1ExternalRequest)
Definition: VP1MainWindow.cxx:1449
VP1MainWindow::m_defaultfont_pointsize
double m_defaultfont_pointsize
Definition: VP1MainWindow.h:246
VP1MainWindow::m_inputdiractions
QList< QAction * > m_inputdiractions
Definition: VP1MainWindow.h:238
VP1MainWindow::inputDirectoryActionTriggered
void inputDirectoryActionTriggered()
Definition: VP1MainWindow.cxx:1846
VP1MainWindow::mustQuit
bool mustQuit() const
Definition: VP1MainWindow.cxx:564
VP1MainWindow::request_saveasConfig
void request_saveasConfig()
Definition: VP1MainWindow.cxx:667
VP1MainWindow::m_messages_blockedsenders
QList< QString > m_messages_blockedsenders
Definition: VP1MainWindow.h:176
VP1MainWindow::quickSetupTriggered
void quickSetupTriggered()
Definition: VP1MainWindow.cxx:1654
VP1MainWindow::m_userRequestedExit
bool m_userRequestedExit
Definition: VP1MainWindow.h:250
VP1MainWindow::channelAddToMessageBox
void channelAddToMessageBox(const QString &)
Definition: VP1MainWindow.cxx:1052
VP1MainWindow::pluginDialogClosed
void pluginDialogClosed()
Definition: VP1MainWindow.cxx:838
VP1MainWindow::m_messages_blockedexactmessages
QList< VP1ExternalRequest > m_messages_blockedexactmessages
Definition: VP1MainWindow.h:177