ATLAS Offline Software
Loading...
Searching...
No Matches
VP1MainWindow Class Reference

#include <VP1MainWindow.h>

Inheritance diagram for VP1MainWindow:

Public Slots

void loadPluginFile (const QString &filename)
void request_addEmptyTab ()
void request_channelInformation ()
void request_printChannel ()
QString request_saveChannelSnapshot (const QString &xLabel="")
void request_cruisemodechange ()
void request_saveasConfig ()
void request_saveConfig ()
void request_loadConfig ()
void request_loadPlugin ()
void unloadPlugin_continue ()
void pluginDialogClosed ()
void saveAllCurrentChannels ()
void makeAllChannelsEventDisplay ()
void getAllChannelsIntoSnapshots (QList< QPixmap > &list, QStringList &listNames)
QPixmap getSingleChannelCustomSnapshot (IVP1ChannelWidget *tab, int width=0)
QPixmap getSingleChannelCustomSnapshot (const QString &tabName, int width=0)
void tabListChanged (const QStringList &)
void selectedChannelChanged (IVP1ChannelWidget *)
void loadConfigurationFromFile (const QString &file)
void replaceConfigurationFile (const QString &file)
void addToMessageBox (const QString &, const QString &extrastyleopts="", const QString &title="", const QString &titleextrastyleopts="")
void systemAddToMessageBox (const QString &)
void channelAddToMessageBox (const QString &)
void helperAddToMessageBox (const QString &)
void changeFontSize (int)
void goToNextEvent ()

Public Member Functions

 VP1MainWindow (VP1ExecutionScheduler *, VP1AvailEvents *availEvents, QWidget *parent=0)
 ~VP1MainWindow ()
bool okToProceedToNextEvent () const
void nextEvent ()
QStringList userRequestedFiles ()
void setRunEvtNumber (const int &runnumber, const unsigned long long &eventnumber, const unsigned &triggerType=0, const unsigned &time=0, const bool &printmessage=true)
bool mustQuit () const
VP1ChannelManager * channelManager () const
VP1TabManager * tabManager () const
bool userRequestedExit ()
int getRunNumber ()
unsigned long long getEventNumber ()
int getEventTimestamp ()

Public Attributes

QProgressBar * progressbar

Protected Slots

void receivedExternalRequest (VP1ExternalRequest)
void processEnqueuedRequests ()
void finishedIncomingDialog ()
void updateTcpIcon ()
void postInitUpdates ()
void showMenu_loadPlugin ()
void showMenu_loadPluginItemSelected ()
void showMenu_loadConfFile ()
void showMenu_loadConfFileItemSelected ()
void changeStyleActionTriggered ()
void changeFontSizeActionTriggered ()
void updateCentralStackWidget ()
void quickSetupTriggered ()
void updateEventControls ()
void addEventFile ()
void help_openUserGuide ()
void help_openUserSupport ()
void help_openVP1WebSite ()
void help_openAbout ()
void updateInputDirectoriesStatus ()
void inputDirectoryActionTriggered ()
void launch3DstereoEditor ()

Protected Member Functions

void closeEvent (QCloseEvent *event)
void listenOnTcp ()
void addChannelIconsToComboBox (QComboBox *cb, const bool &isbasenames)
void setupStatusBar ()
QMap< QString, QString > availablePluginFiles () const
QMap< QString, QString > availableFiles (const QString &extension, const QString &pathvar, const QString &instareasubdir, const QString &extradirenvvar, bool currentdir=false) const

Protected Attributes

VP1ChannelManager * m_channelmanager
VP1TabManager * m_tabmanager
QString m_currentconfigfile
int m_runnumber
unsigned long long m_eventnumber
unsigned m_timestamp
bool m_betweenevents
bool m_mustquit
QWidget * m_dummyemptycontroller
VP1ExecutionScheduler * m_scheduler
VP1AvailEvents * m_availEvents
VP1TcpServer m_tcpserver
VP1IncomingMessageDialog * m_currentincomingdialog
QQueue< VP1ExternalRequest > m_requestqueue
bool m_blockallmessages
QList< QString > m_messages_blockedsenders
QList< VP1ExternalRequest > m_messages_blockedexactmessages
QStringList m_currentunloadpluginfiles
VP1PluginDialog * m_plugindialog
QLabel * m_statusbarlabel
QAction * m_action_infoAboutLoadedPlugins
QMenu * m_menu_loadPlugin
QMenu * m_menu_loadConfFile
QMenu * m_menu_changeStyle
QMenu * m_menu_changeFontSize
QAction * m_actionAdd_empty_tab
QAction * m_actionEnableExpertSettings
QAction * m_actionSave_current_tabs
QAction * m_action_addEventFile
QAction * m_action_openUsersGuide
QAction * m_action_openUsersSupport
QAction * m_action_openVP1Site
QAction * m_action_openAbout
QList< QAction * > m_inputdiractions
VP1DirStatuses m_inputdirstatuses
QString m_currentsaveimagepath
QString m_currentloadpluginpath
QString m_currentStream
QFont m_defaultfont
double m_defaultfont_pointsize
int m_defaultfont_pixelsize
const QString m_settingsfile
bool m_userRequestedExit
QStringList m_userRequestedFiles
VP1StreamMenuUpdater * m_streamMenuUpdater
QMutex * m_mutex
VP1EventDisplayEditor * m_edEditor

Detailed Description

Definition at line 81 of file VP1MainWindow.h.

Constructor & Destructor Documentation

◆ VP1MainWindow()

VP1MainWindow::VP1MainWindow ( VP1ExecutionScheduler * sched,
VP1AvailEvents * availEvents,
QWidget * parent = 0 )

Definition at line 108 of file VP1MainWindow.cxx.

109: QMainWindow(parent),
110 m_runnumber(-1),
111 m_eventnumber(-1),
112 m_betweenevents(true),
113 m_mustquit(false),
114 m_dummyemptycontroller(new QWidget(0)),
115 m_scheduler(sched),
116 m_availEvents(ae),
117 m_settingsfile(QDir::homePath()+QDir::separator()+".atlasvp1"),
118 m_userRequestedExit(false),
120 m_mutex(new QMutex()),
121 m_edEditor(0)
122{
123 setupUi(this); // this sets up the GUI
124
126 //
127 #if defined BUILDVP1LIGHT
128 bool checkShowAllCruiseAndEventControls = VP1QtUtils::expertSettingIsSet("expert","ExpertSettings/VP1_DEVEL_SHOW_ALL_CRUISE_AND_EVENT_CONTROLS");
129 #else
130 bool checkShowAllCruiseAndEventControls = VP1QtUtils::environmentVariableIsOn("VP1_DEVEL_SHOW_ALL_CRUISE_AND_EVENT_CONTROLS");
131 #endif
132
133 if (!checkShowAllCruiseAndEventControls) {
134 pushButton_eventseek->setVisible(false);
135 groupBox_cruise->setVisible(false);
136 }
137
138 if (m_availEvents) {
139 connect(m_availEvents,SIGNAL(message(const QString&)),this,SLOT(helperAddToMessageBox(const QString&)));
140 connect(m_availEvents,SIGNAL(freshEventsChanged()),this,SLOT(updateEventControls()));
141 }
142
143 // File menu
144 if(!m_availEvents) {
145 QMenu* menu_file = new QMenu(menubar);
146 menu_file->setObjectName("menu_file");
147 menu_file->setTitle("&File");
148 menubar->addAction(menu_file->menuAction());
149 m_action_addEventFile = menu_file->addAction("&Add event file ...");
150
151 connect(m_action_addEventFile,SIGNAL(triggered(bool)),this,SLOT(addEventFile()));
152 }
153
154 #ifndef BUILDVP1LIGHT
155 pushButton_previousevent->setVisible(false);
156 pushButton_eventselect->setVisible(false);
157 #else
158 pushButton_eventselect->setVisible(true);
159 pushButton_eventselect->setText("Event: 0/0");
160 pushButton_eventselect->setEnabled(false);
161 pushButton_previousevent->setEnabled(false);
162 //Disable all controls that are not available in VP1Light
163 // pushButton_quicksetup_3dcocktail->setEnabled(false);
164 // pushButton_quicksetup_3dcocktail->setToolTip("Not available in VP1Light");
165 pushButton_quicksetup_trackingstudies->setEnabled(false);
166 pushButton_quicksetup_trackingstudies->setToolTip("Not available in VP1Light");
167 pushButton_quicksetup_calostudies->setEnabled(false);
168 pushButton_quicksetup_calostudies->setToolTip("Not available in VP1Light");
169 action_quicklaunch_Tracking_studies->setEnabled(false);
170 action_quicklaunch_Tracking_studies->setToolTip("Not available in VP1Light");
171 action_quicklaunch_Calo_studies->setEnabled(false);
172 action_quicklaunch_Calo_studies->setToolTip("Not available in VP1Light");
173 action_quicklaunch_Storegate_browser->setEnabled(false);
174 action_quicklaunch_Storegate_browser->setToolTip("Not available in VP1Light");
175 action_quicklaunch_trackcalo_commis->setEnabled(false);
176 action_quicklaunch_trackcalo_commis->setToolTip("Not available in VP1Light");
177 m_action_addEventFile->setEnabled(false);
178 #endif
179
181 //Do we need a menu for multiple input directories?
182
183 VP1AvailEvtsLocalDir* availLocal = dynamic_cast<VP1AvailEvtsLocalDir*>(m_availEvents);
184
185 QStringList inputdirs;
186 if (availLocal)
187 inputdirs = availLocal->availableSourceDirectories();
188
189 if (availLocal&&!inputdirs.isEmpty()) {
190
191 QString currentdir = availLocal->currentSourceDir();
192 if (currentdir.endsWith("/"))
193 currentdir.chop(1);
194 m_currentStream = QDir(currentdir).dirName();
195 QMenu * menu_inputdir = new QMenu(menubar);
196 menu_inputdir->setObjectName("menu_inputdir");
197 menu_inputdir->setTitle("&Stream");
198
199 menubar->addAction(menu_inputdir->menuAction());
200
201 QActionGroup * inputdir_actiongroup = new QActionGroup(menu_inputdir);
202 QAction*action_inputdir_current(0);
203 for (QString inputdir : inputdirs) {
204 if (inputdir.endsWith("/"))
205 inputdir.chop(1);
206 QString dirname = QDir(inputdir).dirName();
207 QAction * action_inputdir = new QAction(this);
208 action_inputdir->setObjectName("action_inputdir_"+dirname);
209 action_inputdir->setData(inputdir);
210 action_inputdir->setStatusTip("Get input files from: "+inputdir);
211 action_inputdir->setCheckable(true);
212
213 if (currentdir==inputdir)
214 action_inputdir_current = action_inputdir;
215 menu_inputdir->addAction(action_inputdir);
216 inputdir_actiongroup->addAction(action_inputdir);
217 m_inputdiractions << action_inputdir;
218 connect(action_inputdir,SIGNAL(triggered(bool)),this,SLOT(inputDirectoryActionTriggered()));
219 }
220 if (action_inputdir_current) {
221 action_inputdir_current->blockSignals(true);
222 action_inputdir_current->setChecked(true);
223 action_inputdir_current->blockSignals(false);
224 }
225
226 // Populate inputdirstatuses
227 for(QAction* action : m_inputdiractions)
228 m_inputdirstatuses[action] = VP1DirStatusData(action->data().toString(),
229 QString(),
230 true,
231 false);
232
233 m_streamMenuUpdater = new VP1StreamMenuUpdater(m_inputdirstatuses,m_mutex);
234 m_streamMenuUpdater->start();
235
236 //Fixme: start timer which every minute checks the status of these directories
237 QTimer *timer = new QTimer(this);
238 connect(timer, SIGNAL(timeout()), this, SLOT(updateInputDirectoriesStatus()));
239 timer->start(5000);//update this menu rather often (this is only for P1 anyway)
240 }
241
242 //.......
243
244 m_channelmanager = new VP1ChannelManager(m_scheduler,this);
245 m_tabmanager = new VP1TabManager(this,tabWidget_central,m_channelmanager);
246 stackedWidget_customcontrols->addWidget(m_dummyemptycontroller);
247
248 //Final touches to instructions page:
249
250 // Remove any margins added by the layouts in the stacked
251 // widget. This really ought to be the default for stacked widgets!
252 for (int i=0;i<stackedWidget_central->count();++i)
253 stackedWidget_central->widget(i)->layout()->setContentsMargins(0,0,0,0);
254
255 frame_instructions->setStyleSheet("QFrame#frame_instructions { "+VP1DockWidget::highlightStyle()+" } ");
256 frame_instructions->setFrameShape(QFrame::StyledPanel);
257 // textBrowser_intro1->setStyleSheet("QTextBrowser#textBrowser_intro1 { background-color: rgba(0, 0, 0, 0%) } ");
258 // textBrowser_intro2->setStyleSheet("QTextBrowser#textBrowser_intro2 { background-color: rgba(0, 0, 0, 0%) } ");
259 #ifndef BUILDVP1LIGHT
260 connect(pushButton_quicksetup_3dcocktail,SIGNAL(clicked()),this,SLOT(quickSetupTriggered()));
261 #else
262 connect(pushButton_quicksetup_3dcocktail,SIGNAL(clicked()),this,SLOT(quickSetupTriggered()));
263 #endif
264 connect(pushButton_quicksetup_trackingstudies,SIGNAL(clicked()),this,SLOT(quickSetupTriggered()));
265 connect(pushButton_quicksetup_calostudies,SIGNAL(clicked()),this,SLOT(quickSetupTriggered()));
266 connect(pushButton_quicksetup_geometrystudies,SIGNAL(clicked()),this,SLOT(quickSetupTriggered()));
267 connect(pushButton_quicksetup_analysisstudies,SIGNAL(clicked()),this,SLOT(quickSetupTriggered()));
268
269 //Default application font:
270 m_defaultfont = QApplication::font();
274 else
276
277 //Tabs:
278 connect(m_tabmanager,SIGNAL(tabListChanged(QStringList)),this,SLOT(tabListChanged(QStringList)));
279 connect(tabWidget_central,SIGNAL(currentChanged(int)),this,SLOT(updateCentralStackWidget()));
281
282 //Channels:
283
284 connect(pushButton_saveAllChannels,SIGNAL(clicked()),this,SLOT(saveAllCurrentChannels()));
285 connect(pushButton_makeEventDisplay,SIGNAL(clicked()),this,SLOT(makeAllChannelsEventDisplay()));
286
287 connect(pushButton_3D,SIGNAL(clicked()),this,SLOT(launch3DstereoEditor()));
288
289 connect(pushButton_channelfullscreen,SIGNAL(clicked()),m_tabmanager,SLOT(showCurrentChannelFullScreen()));
290 connect(pushButton_channelinformation,SIGNAL(clicked()),this,SLOT(request_channelInformation()));
291 connect(pushButton_printchannel,SIGNAL(clicked()),this,SLOT(request_printChannel()));
292 connect(pushButton_savesnapshotchannel,SIGNAL(clicked()),this,SLOT(request_saveChannelSnapshot()));
293 connect(m_tabmanager,SIGNAL(selectedChannelChanged(IVP1ChannelWidget*)),this,SLOT(selectedChannelChanged(IVP1ChannelWidget*)));
294
295 //Menu:
296 //Quick start:
297 connect(action_quicklaunch_Tracking_studies,SIGNAL(triggered(bool)),this,SLOT(quickSetupTriggered()));
298 connect(action_quicklaunch_Calo_studies,SIGNAL(triggered(bool)),this,SLOT(quickSetupTriggered()));
299 connect(action_quicklaunch_Geometry_studies,SIGNAL(triggered(bool)),this,SLOT(quickSetupTriggered()));
300 connect(action_quicklaunch_analysisstudies,SIGNAL(triggered(bool)),this,SLOT(quickSetupTriggered()));
301 connect(action_quicklaunch_Storegate_browser,SIGNAL(triggered(bool)),this,SLOT(quickSetupTriggered()));
302 connect(action_quicklaunch_3dcocktail,SIGNAL(triggered(bool)),this,SLOT(quickSetupTriggered()));
303 connect(action_quicklaunch_trackcalo_commis,SIGNAL(triggered(bool)),this,SLOT(quickSetupTriggered()));
304 connect(action_exit_VP1,SIGNAL(triggered(bool)),this,SLOT(close()));
305
306 //Configuration
307 m_menu_loadConfFile = menuConfiguration->addMenu ( "&Load tab configuration from file" );
308 m_menu_loadConfFile->setStatusTip("Select .vp1 config file to load");
309 connect(m_menu_loadConfFile,SIGNAL(aboutToShow()),this,SLOT(showMenu_loadConfFile()));
310 menuConfiguration->addSeparator();
311 //plugins:
312 m_menu_loadPlugin = menuConfiguration->addMenu ( "&Load plugin" );
313 m_menu_loadPlugin->setStatusTip("Select plugin to load");
314 // m_action_infoAboutLoadedPlugins = menuPlugins->addAction ( "&Info about loaded plugins" );
315 // m_action_infoAboutLoadedPlugins->setStatusTip("Get information about the presently loaded plugins");
316 // m_action_infoAboutLoadedPlugins->setEnabled(false);
317 connect(m_menu_loadPlugin,SIGNAL(aboutToShow()),this,SLOT(showMenu_loadPlugin()));
318 //Style
319 m_menu_changeStyle = menu_Style->addMenu ( "&Style" );
320 QActionGroup * styleGroup = new QActionGroup(this);
321 QAction * laststyleact(0);
322 bool foundplastique=false;
323 QSettings s(m_settingsfile,QSettings::IniFormat);
324 QString defaultstyle=s.value("style/defaultstyle", "Fusion").toString();
325 for (QString style : QStyleFactory::keys() ) {
326 QAction * act = m_menu_changeStyle->addAction(style);
327 act->setStatusTip("Change application style to "+style);
328 connect(act,SIGNAL(triggered(bool)),this,SLOT(changeStyleActionTriggered()));
329 act->setCheckable(true);
330 styleGroup->addAction(act);
331 laststyleact=act;
332 if (act->text()==defaultstyle) {
333 act->setChecked(true);
334 QApplication::setStyle(QStyleFactory::create(act->text()));
335 foundplastique=true;
336 }
337 }
338 if (!foundplastique) {
339 laststyleact->setChecked(true);
340 QApplication::setStyle(QStyleFactory::create(laststyleact->text()));
341 }
342 //Fonts:
343 int savedgoal = 0;
345 savedgoal = s.value("font/pixelsize_diff", 0).toInt();
346 else
347 savedgoal = s.value("font/pointsize_relativepercent", 0).toInt();
348
349 m_menu_changeFontSize = menu_Style->addMenu ( "&Font size" );
350 QList<int> fontoptions;
352 fontoptions <<15<<10<<+5<<+3<<+2<<+1<<0<<-1<<-2<<-3<<-5<<-10<<-20<<-30;
353 else
354 fontoptions <<150<<100<<50<<30<<20<<10<<5<<0<<-5<<-10<<-20<<-30<<-50;
355
356 QActionGroup * fontGroup = new QActionGroup(this);
357 bool foundsavedgoal(false);
358 QAction * normalfontact(0);
359 for (int fontopt : fontoptions) {
361 continue;
362 QString text = (fontopt==0?"normal": (fontopt>0?"+":"")+QString::number(fontopt)+(m_defaultfont_pointsize < 0.0? " pixels" : "%"));
363 QAction * act = m_menu_changeFontSize->addAction(text);
364 act->setStatusTip("Change overall font size of application to "+text);
365 act->setData(fontopt);
366 act->setCheckable(true);
367 fontGroup->addAction(act);
368 connect(act,SIGNAL(triggered(bool)),this,SLOT(changeFontSizeActionTriggered()));
369 if (fontopt==0)
370 normalfontact=act;
371 if (savedgoal==fontopt) {
372 act->setChecked(true);
373 changeFontSize(fontopt);
374 foundsavedgoal=true;
375 }
376 }
377 if (!foundsavedgoal) {
378 normalfontact->setChecked(true);
379 }
380
381 //
382 m_actionSave_current_tabs = menuConfiguration->addAction ( "&Save current tab configuration to file" );
383 m_actionSave_current_tabs->setStatusTip("Save current tab/channel layout to .vp1 config file");
384 menuConfiguration->addSeparator();
385 m_actionAdd_empty_tab = menuConfiguration->addAction ( "&Add empty tab" );
386 m_actionAdd_empty_tab->setStatusTip("Add empty tab to the current tab list");
387 connect(m_actionAdd_empty_tab,SIGNAL(triggered(bool)),this,SLOT(request_addEmptyTab()));
388 connect(m_actionSave_current_tabs,SIGNAL(triggered(bool)),this,SLOT(request_saveasConfig()));
389
390 //ExpertSettings
391 #ifdef BUILDVP1LIGHT
392 menuConfiguration->addSeparator();
393 m_actionEnableExpertSettings = menuConfiguration->addAction ( "&Settings" );
394 m_actionEnableExpertSettings->setStatusTip("Open additional settings");
395 connect(m_actionEnableExpertSettings, &QAction::triggered, this, &VP1MainWindow::request_expertSettings);
396 #endif
397
398 //Event navigation:
399 connect(pushButton_nextevent,SIGNAL(clicked()),this,SLOT(goToNextEvent()));
400 #ifdef BUILDVP1LIGHT
401 connect(pushButton_previousevent,SIGNAL(clicked()),this,SLOT(goToPreviousEvent()));
402 connect(pushButton_eventselect,SIGNAL(clicked()),this,SLOT(chooseEvent()));
403 #endif
404
405 //Listen for external requests:
406 connect(&m_tcpserver,SIGNAL(receivedExternalRequest(VP1ExternalRequest)),this,SLOT(receivedExternalRequest(VP1ExternalRequest)));
407 listenOnTcp();
408 // updateTcpIcon();
409 connect(&m_tcpserver,SIGNAL(listenStateChanged(bool)),this,SLOT(updateTcpIcon()));
412 m_blockallmessages=false;
414
415 //Cruise:
416 connect(pushButton_cruise,SIGNAL(clicked()),this,SLOT(request_cruisemodechange()));
417 connect(radioButton_cruise_event,SIGNAL(clicked()),this,SLOT(request_cruisemodechange()));
418 connect(radioButton_cruise_tab,SIGNAL(clicked()),this,SLOT(request_cruisemodechange()));
419 connect(radioButton_cruise_both,SIGNAL(clicked()),this,SLOT(request_cruisemodechange()));
420
421 // Help menu
422 QMenu* menu_help = new QMenu(menubar);
423 menu_help->setObjectName("menu_help");
424 menu_help->setTitle("&Help");
425 menubar->addAction(menu_help->menuAction());
426 m_action_openVP1Site = menu_help->addAction("VP1 &Web Site");
427 m_action_openUsersGuide = menu_help->addAction("VP1 &User's Guide");
428 m_action_openUsersSupport = menu_help->addAction("VP1 User's &Support (in the system browser)");
429 menu_help->addSeparator();
430 m_action_openAbout = menu_help->addAction("&About VP1");
431
432 QTimer::singleShot(0, this, SLOT(postInitUpdates()));
435
436 connect(m_action_openUsersGuide,SIGNAL(triggered(bool)),this,SLOT(help_openUserGuide()));
437 connect(m_action_openVP1Site,SIGNAL(triggered(bool)),this,SLOT(help_openVP1WebSite()));
438 connect(m_action_openUsersSupport,SIGNAL(triggered(bool)),this,SLOT(help_openUserSupport()));
439 connect(m_action_openAbout,SIGNAL(triggered(bool)),this,SLOT(help_openAbout()));
440
441 // FIXME: enabling menubar again. It's part of a quickfix, described here: https://its.cern.ch/jira/browse/ATLASVPONE-120
442 #ifndef BUILDVP1LIGHT
443 menubar->setEnabled(false);
444 #endif
445}
const QString & currentSourceDir() const
const QStringList & availableSourceDirectories() const
static QString highlightStyle()
void helperAddToMessageBox(const QString &)
void changeFontSize(int)
void updateCentralStackWidget()
void help_openUserSupport()
int m_defaultfont_pixelsize
QMenu * m_menu_changeFontSize
VP1EventDisplayEditor * m_edEditor
VP1AvailEvents * m_availEvents
void receivedExternalRequest(VP1ExternalRequest)
void saveAllCurrentChannels()
double m_defaultfont_pointsize
VP1ChannelManager * m_channelmanager
VP1TabManager * m_tabmanager
QString m_currentsaveimagepath
QString m_currentloadpluginpath
VP1IncomingMessageDialog * m_currentincomingdialog
void request_saveasConfig()
QAction * m_action_openUsersSupport
QMenu * m_menu_loadPlugin
void request_cruisemodechange()
QWidget * m_dummyemptycontroller
const QString m_settingsfile
QAction * m_actionSave_current_tabs
QAction * m_action_openUsersGuide
void changeStyleActionTriggered()
QMenu * m_menu_loadConfFile
QString m_currentStream
unsigned long long m_eventnumber
void help_openUserGuide()
QAction * m_action_openVP1Site
QAction * m_actionAdd_empty_tab
QString request_saveChannelSnapshot(const QString &xLabel="")
void inputDirectoryActionTriggered()
VP1PluginDialog * m_plugindialog
VP1DirStatuses m_inputdirstatuses
void request_printChannel()
VP1TcpServer m_tcpserver
QList< QAction * > m_inputdiractions
QAction * m_actionEnableExpertSettings
VP1StreamMenuUpdater * m_streamMenuUpdater
void request_channelInformation()
VP1ExecutionScheduler * m_scheduler
void makeAllChannelsEventDisplay()
QAction * m_action_addEventFile
void changeFontSizeActionTriggered()
void selectedChannelChanged(IVP1ChannelWidget *)
void request_addEmptyTab()
void tabListChanged(const QStringList &)
QAction * m_action_openAbout
void launch3DstereoEditor()
void updateInputDirectoriesStatus()
void showMenu_loadConfFile()
void help_openVP1WebSite()
QMenu * m_menu_changeStyle
static bool environmentVariableIsOn(const QString &name)
static bool expertSettingIsSet(const QString &type, const QString &name)
static QString defaultFileSelectDirectory()
str inputdir
define the input files
timer(name, disabled=False)
std::string dirname(std::string name)
Definition utils.cxx:200

◆ ~VP1MainWindow()

VP1MainWindow::~VP1MainWindow ( )

Definition at line 557 of file VP1MainWindow.cxx.

558{
559 if (m_edEditor) {
560 VP1Msg::messageDebug("deleting the editor");
561 delete m_edEditor;
562 }
563 VP1Msg::messageDebug("deleting the tab manager");
564 delete m_tabmanager;
565 VP1Msg::messageDebug("deleting the channel manager");
566 delete m_channelmanager;
567 VP1Msg::messageDebug("deleting the events");
568 delete m_availEvents;
569
571 VP1Msg::messageDebug("deleting the streamupdater");
572 m_streamMenuUpdater->quit();
573 m_streamMenuUpdater->deleteLater();
574 }
575
576 VP1Msg::messageDebug("deleting the mutex");
577 delete m_mutex;
578
579 VP1Msg::messageDebug("deleting the view");
580}
static void messageDebug(const QString &)
Definition VP1Msg.cxx:39

Member Function Documentation

◆ addChannelIconsToComboBox()

void VP1MainWindow::addChannelIconsToComboBox ( QComboBox * cb,
const bool & isbasenames )
protected

Definition at line 646 of file VP1MainWindow.cxx.

646 {
647 int n= cb->count();
648 for (int i = 0; i<n; ++i) {
649 QString icontext = m_channelmanager->getIconLocation(cb->itemText(i), isbasenames);
650 if (!icontext.isEmpty())
651 cb->setItemIcon ( i, QIcon(icontext) );
652 }
653}

◆ addEventFile

void VP1MainWindow::addEventFile ( )
protectedslot

Definition at line 1901 of file VP1MainWindow.cxx.

1902{
1903 QString newEventFile = QFileDialog::getOpenFileName(NULL
1904 ,tr("Open Event File")
1906 ,tr("All files (*.*)"));
1907 if(newEventFile.isEmpty()) return;
1908 if(VP1FileUtilities::fileExistsAndReadable(newEventFile.toStdString())) {
1909 m_userRequestedFiles.append(newEventFile);
1910 addToMessageBox(newEventFile + " will be appended to the list of input files");
1911 }
1912 else
1913 QMessageBox::critical(0, newEventFile + " either does not exist or is not readable",
1914 newEventFile + " either does not exist or is not readable",
1915 QMessageBox::Ok,QMessageBox::Ok);
1916}
static bool fileExistsAndReadable(const std::string &)
void addToMessageBox(const QString &, const QString &extrastyleopts="", const QString &title="", const QString &titleextrastyleopts="")
QStringList m_userRequestedFiles

◆ addToMessageBox

void VP1MainWindow::addToMessageBox ( const QString & m,
const QString & extrastyleopts = "",
const QString & title = "",
const QString & titleextrastyleopts = "" )
slot

Definition at line 1042 of file VP1MainWindow.cxx.

1044{
1045
1046 if (title.isEmpty())
1047 std::cout<<VP1Msg::prefix_msg()<<": "<<m.toStdString()<<std::endl;
1048 else
1049 std::cout<<VP1Msg::prefix_msg()<<": "<<title.toStdString() << ": " <<m.toStdString()<<std::endl;
1050
1051
1052 QString titlepart = ( title.isEmpty() ? "" : ( titleextrastyleopts.isEmpty() ? title
1053 : "<span style=\"font-style:italic;"+titleextrastyleopts+";\">["+title+"]</span> "));
1054
1055 textBrowser_channelmessages->append(titlepart
1056 + ( extrastyleopts.isEmpty() ? m
1057 : "<span style=\"font-style:italic;"+extrastyleopts+";\">"+m+"</span>"));
1058 textBrowser_channelmessages->verticalScrollBar()->setSliderPosition(textBrowser_channelmessages->verticalScrollBar()->maximum());
1059}
static const char * prefix_msg()
Definition VP1Msg.h:56

◆ availableFiles()

QMap< QString, QString > VP1MainWindow::availableFiles ( const QString & extension,
const QString & pathvar,
const QString & instareasubdir,
const QString & extradirenvvar,
bool currentdir = false ) const
protected

Definition at line 743 of file VP1MainWindow.cxx.

748{
749
750 qDebug() << "VP1MainWindow::availableFiles()";
751 qDebug() << "extension:" << extension << "pathvar:" << pathvar << "instareasubdir:" << instareasubdir << "extradirenvvar:" << extradirenvvar << "currentdir:" << currentdir;
752
753
754 //Add directories from extradirenvvar (e.g. $VP1PLUGINPATH)
755 QStringList vp1pluginpath =
756 extradirenvvar.isEmpty() ?
757 QStringList() :
758 QString(::getenv(extradirenvvar.toStdString().c_str())) .
759#if QTCORE_VERSION >= 0x050E00
760 split(":",Qt::SkipEmptyParts);
761#else
762 split(":",QString::SkipEmptyParts);
763#endif
764 if(VP1Msg::debug()){
765 qDebug() << "extradirenvvar:" << extradirenvvar;
766 qDebug() << "vp1pluginpath:" << vp1pluginpath;
767 }
768
769 #ifdef BUILDVP1LIGHT
770 //Add dir from Expert Settings
771 if(VP1QtUtils::expertSettingValue("expert","ExpertSettings/VP1PLUGINPATH")==""){
772 vp1pluginpath<<QCoreApplication::applicationDirPath()+"/../lib";
773 } else{
774 vp1pluginpath<<VP1QtUtils::expertSettingValue("expert","ExpertSettings/VP1PLUGINPATH");
775 }
776 #endif
777
778 //Currentdir:
779 if (currentdir) {
780 vp1pluginpath<<QDir::currentPath();
781 if (QDir::currentPath()!=VP1Settings::defaultFileSelectDirectory())
783 }
784
785 //Add directories from pathvar (looking in subdir instareasubdir):
786 QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
787 VP1Msg::messageDebug("This is the 'pathvar' variable: " + pathvar);
788 QString path = env.value(pathvar);
789 VP1Msg::messageDebug("Add directories from 'pathvar' variable: " + path);
790
791 if (!path.isEmpty()) {
792#if QTCORE_VERSION >= 0x050E00
793 VP1Msg::messageDebug("We're using Qt5...");
794 QStringList tmp = path.split(":",Qt::SkipEmptyParts);//This 'tmp' is for SLC3 compilation.
795#else
796 VP1Msg::messageDebug("We're using Qt older than 5...");
797 QStringList tmp = path.split(":",QString::SkipEmptyParts);//This 'tmp' is for SLC3 compilation.
798#endif
799 for (const QString& dir : tmp) {
800 vp1pluginpath << ( instareasubdir.isEmpty() ? dir : dir+QDir::separator()+instareasubdir );
801 }
802 }
803
804 // Remove duplicates
805 int nDuplicatesRemoved = vp1pluginpath.removeDuplicates();
806 VP1Msg::messageDebug("Removed '" + QString::number(nDuplicatesRemoved) + "' duplicate paths.");
807
808 // Remove all nonexisting directories:
809 QStringList validPluginPaths;
810 validPluginPaths.reserve(vp1pluginpath.size());
811 for (const QString& plugindir : vp1pluginpath) {
812 VP1Msg::messageDebug("plugindir: '" + plugindir + "'");
813 QFileInfo fi(plugindir);
814
815 if (fi.exists() && fi.isDir()) {
816 validPluginPaths << plugindir;
817 } else {
818 VP1Msg::messageDebug("Removed non-valid path: '" + plugindir + "'");
819 }
820 }
821 vp1pluginpath = validPluginPaths;
822
823
824 //Find all files with required extension in the directories (in case of duplicates - the ones appearing first are used):
825 QMap<QString,QString> plugins2fullpath;
826 for (const QString& plugindir : vp1pluginpath) {
827 QStringList plugins = QDir(plugindir).entryList((QStringList()<<("*"+extension)),QDir::CaseSensitive | QDir::Files | QDir::Readable,QDir::Name);
828 for (QString plugin : plugins) {
829 plugin = QFileInfo(plugin).fileName();
830 if (!plugins2fullpath.contains(plugin)) {
831 QString fullpath = plugindir+QDir::separator()+plugin;
832 plugins2fullpath[plugin]=fullpath;
833 }
834 }
835 }
836 return plugins2fullpath;
837}
if(pathvar)
const char * pathvar
static bool debug()
Definition VP1Msg.h:32
static QString expertSettingValue(const QString &type, const QString &name)
std::vector< std::string > split(const std::string &s, const std::string &t=":")
Definition hcg.cxx:179
std::string getenv(const std::string &variableName)
get an environment variable
path
python interpreter configuration --------------------------------------—
Definition athena.py:130

◆ availablePluginFiles()

QMap< QString, QString > VP1MainWindow::availablePluginFiles ( ) const
protected

Definition at line 840 of file VP1MainWindow.cxx.

841{
842VP1Msg::messageDebug("VP1MainWindow::availablePluginFiles()");
843
844#ifdef __APPLE__
845 QString sharedlibsuffix = "dylib";
846#else
847 QString sharedlibsuffix = "so";
848#endif
849
850 return availableFiles( "."+sharedlibsuffix, "LD_LIBRARY_PATH", "vp1plugins", "VP1PLUGINPATH" );
851
852}
QMap< QString, QString > availableFiles(const QString &extension, const QString &pathvar, const QString &instareasubdir, const QString &extradirenvvar, bool currentdir=false) const

◆ changeFontSize

void VP1MainWindow::changeFontSize ( int goal)
slot

Definition at line 1642 of file VP1MainWindow.cxx.

1643{
1644 QFont newfont = m_defaultfont;
1645 QSettings s(m_settingsfile,QSettings::IniFormat);
1646 if (m_defaultfont_pointsize<0.0) {
1647 //pixels
1648 assert(m_defaultfont_pixelsize+goal>0);
1649 if (m_defaultfont_pixelsize+goal<=0)
1650 return;
1651 if (m_defaultfont_pixelsize+goal>200)
1652 return;
1653 newfont.setPixelSize(m_defaultfont_pixelsize+goal);
1654 s.setValue("font/pixelsize_diff",goal);
1655 } else {
1656 //pointsize
1657 double fact = (goal+100.0)/100.0;
1658 if (fact<0.01||fact>50)
1659 return;
1660 double newpointsize=m_defaultfont_pointsize*fact;
1661 if (newpointsize<0)
1662 return;
1663 newfont.setPointSizeF(newpointsize);
1664 s.setValue("font/pointsize_relativepercent",goal);
1665 }
1666 QApplication::setFont(newfont);
1667}

◆ changeFontSizeActionTriggered

void VP1MainWindow::changeFontSizeActionTriggered ( )
protectedslot

Definition at line 1627 of file VP1MainWindow.cxx.

1628{
1629 QAction * act = static_cast<QAction*>(sender());
1630 assert(act);
1631 if (!act)
1632 return;
1633 bool ok;
1634 int goal = act->data().toInt(&ok);
1635 assert(ok);
1636 if (!ok)
1637 return;
1638 changeFontSize(goal);
1639}

◆ changeStyleActionTriggered

void VP1MainWindow::changeStyleActionTriggered ( )
protectedslot

Definition at line 1611 of file VP1MainWindow.cxx.

1612{
1613 QAction * act = static_cast<QAction*>(sender());
1614 assert(act);
1615 if (!act)
1616 return;
1617 assert(QStyleFactory::keys().contains(act->text()));
1618 if (!QStyleFactory::keys().contains(act->text()))
1619 return;
1620 QApplication::setStyle(QStyleFactory::create(act->text()));
1621 QSettings s(m_settingsfile,QSettings::IniFormat);
1622 s.setValue("style/defaultstyle",act->text());
1623
1624}
bool contains(const std::string &s, const std::string &regx)
does a string contain the substring
Definition hcg.cxx:116

◆ channelAddToMessageBox

void VP1MainWindow::channelAddToMessageBox ( const QString & m)
slot

Definition at line 1077 of file VP1MainWindow.cxx.

1078{
1079 IVP1ChannelWidget*cw = static_cast<IVP1ChannelWidget*>(sender());
1080 if (!cw) {
1081 addToMessageBox("VP1MainWindow::channelAddToMessageBox Error: Only prints channelwidget messages!");
1082 return;
1083 }
1084 addToMessageBox(m,"color:#000000", cw->unique_name(),"color:#0000ff");
1085}
const QString unique_name() const

◆ channelManager()

VP1ChannelManager * VP1MainWindow::channelManager ( ) const
inline

Definition at line 145 of file VP1MainWindow.h.

145{ return m_channelmanager; }

◆ closeEvent()

void VP1MainWindow::closeEvent ( QCloseEvent * event)
protected

Definition at line 955 of file VP1MainWindow.cxx.

956{
957 VP1Msg::messageDebug("VP1MainWindow::closeEvent()");
958
959 bool checkEnableAskOnClose;
960 #if defined BUILDVP1LIGHT
961 checkEnableAskOnClose = VP1QtUtils::expertSettingIsSet("general","ExpertSettings/VP1_ENABLE_ASK_ON_CLOSE");
962 #else
963 checkEnableAskOnClose = VP1QtUtils::environmentVariableIsOn("VP1_ENABLE_ASK_ON_CLOSE");
964 #endif
965
966 if (checkEnableAskOnClose) {
967 int ret = QMessageBox::warning(this,
968 "Close VP1?",
969 "You are about to close VP1 and end the job.\nProceed?",
970 QMessageBox::Ok| QMessageBox::Cancel,
971 QMessageBox::Cancel );
972 if (ret!=QMessageBox::Ok) {
973 event->ignore();
974 return;
975 }
976 m_userRequestedExit = true;
977 }
978
979 hide();
980
981 VP1Msg::messageDebug("calling tabmanager->setSelectedDockWidget(0)...");
982 m_tabmanager->setSelectedDockWidget(0);
983 VP1Msg::messageDebug("tabmanager->setSelectedDockWidget(0) called.");
984
985 m_mustquit=true; // this will inform VP1Alg that we want to quit VP1 (then we'll quit the Athena algorithm)
986 VP1Msg::messageDebug("calling qApp->quit()...");
987 qApp->quit();
988}

◆ finishedIncomingDialog

void VP1MainWindow::finishedIncomingDialog ( )
protectedslot

Definition at line 1458 of file VP1MainWindow.cxx.

1459{
1461 if (!m_requestqueue.empty())
1462 QTimer::singleShot(0, this, SLOT(processEnqueuedRequests()));
1463}
QQueue< VP1ExternalRequest > m_requestqueue
void processEnqueuedRequests()

◆ getAllChannelsIntoSnapshots

void VP1MainWindow::getAllChannelsIntoSnapshots ( QList< QPixmap > & list,
QStringList & listNames )
slot

Definition at line 1144 of file VP1MainWindow.cxx.

1145{
1146 VP1Msg::messageDebug("VP1MainWindow::getAllChannelsIntoSnapshots()");
1147
1148// int nTabs = m_tabmanager->nTabs();
1149 QList<IVP1ChannelWidget*> allTabs = m_tabmanager->allChannels();
1150
1151 if (allTabs.isEmpty()) {
1152 VP1Msg::message("WARNING - No tabs to save.");
1153 return;
1154 }
1155
1156 int nT = 0;
1157
1158 // loop over all tabs/channels
1159 for(IVP1ChannelWidget* widg : allTabs) {
1160
1161 // increase tab number
1162 ++nT;
1163
1164 // get channel name (e.g. Geometry, 3DCocktail)
1165 QString channelname = m_tabmanager->channelToTab(widg);
1166 channelname.replace(' ','_');
1167 VP1Msg::messageDebug("tab: " + channelname);
1168
1169 // DEBUG MSGS
1170 // get channel info, only for debug
1171 //QString info = widg->information();
1172 //VP1Msg::messageDebug("channel info: " + info);
1173
1174
1175 QPixmap snap = getSingleChannelCustomSnapshot(widg);
1176
1177 list << snap;
1178 listNames << channelname;
1179
1180 }
1181
1182 VP1Msg::messageVerbose(QString::number(nT)+" tabs/channels saved in the QList.");
1183
1184}
QPixmap getSingleChannelCustomSnapshot(IVP1ChannelWidget *tab, int width=0)
static void messageVerbose(const QString &)
Definition VP1Msg.cxx:84
static void message(const QString &, IVP1System *sys=0)
Definition VP1Msg.cxx:30
list(name, path='/')
Definition histSizes.py:38

◆ getEventNumber()

unsigned long long VP1MainWindow::getEventNumber ( )
inline

Definition at line 151 of file VP1MainWindow.h.

151{ return m_eventnumber; }

◆ getEventTimestamp()

int VP1MainWindow::getEventTimestamp ( )
inline

Definition at line 152 of file VP1MainWindow.h.

152{ return m_timestamp; }
unsigned m_timestamp

◆ getRunNumber()

int VP1MainWindow::getRunNumber ( )
inline

Definition at line 150 of file VP1MainWindow.h.

150{ return m_runnumber; }

◆ getSingleChannelCustomSnapshot [1/2]

QPixmap VP1MainWindow::getSingleChannelCustomSnapshot ( const QString & tabName,
int width = 0 )
slot

Definition at line 1217 of file VP1MainWindow.cxx.

1218{
1219 QList<IVP1ChannelWidget*> allTabs = m_tabmanager->allChannels();
1220
1221 if (allTabs.isEmpty()) {
1222 VP1Msg::message("WARNING - No tabs to get snapshots from.");
1223 }
1224
1225 // loop over all tabs/channels
1226 for(IVP1ChannelWidget* widg : allTabs) {
1227
1228 // get channel name (e.g. Geometry, 3DCocktail)
1229 QString channelname = m_tabmanager->channelToTab(widg);
1230 channelname.replace(' ','_');
1231
1232 if (channelname == tabName) {
1233 VP1Msg::messageDebug("found tab: " + channelname);
1234
1235 if (width)
1237 else
1238 return getSingleChannelCustomSnapshot(widg);
1239
1240 }
1241 }
1242 return QPixmap();
1243}
const double width

◆ getSingleChannelCustomSnapshot [2/2]

QPixmap VP1MainWindow::getSingleChannelCustomSnapshot ( IVP1ChannelWidget * tab,
int width = 0 )
slot

Definition at line 1187 of file VP1MainWindow.cxx.

1188{
1189 VP1Msg::messageDebug("VP1MainWindow::getSingleChannelCustomSnapshot()");
1190
1191 std::cout << "tab: " << tab << std::endl;
1192
1193 // save the anti-aliasing status, set by the user
1194 bool antialias_original = tab->isAntiAliasing();
1195
1196 // for the final event display images we want the anti-aliasing turned ON,
1197 tab->setAntiAliasing(true);
1198
1199 // get the snapshot
1200 QPixmap snap;
1201 if (width)
1202 snap = tab->getSnapshot(true, width); // 'true' means 'transparent background'
1203 else
1204 snap = tab->getSnapshot(true); // 'true' means 'transparent background'
1205
1206 if (snap.isNull()) {
1207 VP1Msg::message("ERROR! - No snapshot produced!");
1208 return QPixmap();
1209 }
1210
1211 // go back to the original anti-aliasing status, set by the user for the tab
1212 tab->setAntiAliasing(antialias_original);
1213
1214 return snap;
1215}
virtual QPixmap getSnapshot(bool transp=false, int width=0, bool batch=false)
virtual bool setAntiAliasing(bool aa)
virtual bool isAntiAliasing()

◆ goToNextEvent

void VP1MainWindow::goToNextEvent ( )
slot

Definition at line 915 of file VP1MainWindow.cxx.

915 {
916 #if defined BUILDVP1LIGHT
917 std::cout << "goToNextEvent: \n"
918 << "m_scheduler->getEvtNr()+2: " << m_scheduler->getEvtNr()+2
919 << "\nm_scheduler->getTotEvtNr(): " << m_scheduler->getTotEvtNr() << std::endl;
920 if ( m_scheduler->getEvtNr()+2 < m_scheduler->getTotEvtNr() ) {
921 std::cout << "First case" << std::endl;
922 m_scheduler->setEvtNr(m_scheduler->getEvtNr()+1);
923 nextEvent();
924 qApp->quit();
925 }
926 else if( m_scheduler->getEvtNr()+2 == m_scheduler->getTotEvtNr() ) {
927 std::cout << "Second case" << std::endl;
928 m_scheduler->setEvtNr(m_scheduler->getEvtNr()+1);
929 nextEvent();
930 qApp->quit();
931 }
932 #else
933 nextEvent();
934 qApp->quit();
935 #endif
936}

◆ help_openAbout

void VP1MainWindow::help_openAbout ( )
protectedslot

Definition at line 493 of file VP1MainWindow.cxx.

493 {
494 /*
495 * open the online help
496 */
497 VP1Msg::messageDebug("VP1MainWindow::help_openAbout()");
498 // we use here the default system browser
499 QDesktopServices::openUrl(QUrl("https://atlas-vp1.web.cern.ch/atlas-vp1/doc_new/about_vp1/CREDITS.html"));
500 return;
501}

◆ help_openUserGuide

void VP1MainWindow::help_openUserGuide ( )
protectedslot

Definition at line 456 of file VP1MainWindow.cxx.

456 {
457 /*
458 * Open the online help from a web url location
459 * with the default system web browser
460 */
461 VP1Msg::messageDebug("VP1MainWindow::help_openUserGuide()");
462 // we use here the default system browser
463 QDesktopServices::openUrl(QUrl("http://atlas-vp1.web.cern.ch/atlas-vp1/doc/"));
464 return;
465}

◆ help_openUserSupport

void VP1MainWindow::help_openUserSupport ( )
protectedslot

Definition at line 468 of file VP1MainWindow.cxx.

468 {
469 /*
470 * Open the online page with links to the JIRA issue collectors
471 * with the default system web browser
472 */
473 VP1Msg::messageDebug("VP1MainWindow::help_openUserSupport()");
474 // we use here the default system browser
475 QDesktopServices::openUrl(QUrl("http://atlas-vp1.web.cern.ch/atlas-vp1/vp1_users_support/"));
476 return;
477}

◆ help_openVP1WebSite

void VP1MainWindow::help_openVP1WebSite ( )
protectedslot

Definition at line 480 of file VP1MainWindow.cxx.

480 {
481 /*
482 * Open the online help from a web url location
483 * with the default system web browser
484 */
485 VP1Msg::messageDebug("VP1MainWindow::help_openVP1WebSite()");
486 // we use here the default system browser
487 QDesktopServices::openUrl(QUrl("http://atlas-vp1.web.cern.ch/atlas-vp1/"));
488 return;
489}

◆ helperAddToMessageBox

void VP1MainWindow::helperAddToMessageBox ( const QString & m)
slot

Definition at line 1088 of file VP1MainWindow.cxx.

1089{
1090 addToMessageBox(m);
1091}

◆ inputDirectoryActionTriggered

void VP1MainWindow::inputDirectoryActionTriggered ( )
protectedslot

Definition at line 1871 of file VP1MainWindow.cxx.

1872{
1873 QAction * act = dynamic_cast<QAction*>(sender());
1874 if (!act)
1875 return;
1876 VP1AvailEvtsLocalDir* availLocal = dynamic_cast<VP1AvailEvtsLocalDir*>(m_availEvents);
1877 if (!availLocal)
1878 return;
1879 QString inputdir(act->data().toString());
1880 QFileInfo fi(inputdir);
1881 if (fi.exists()&&fi.isDir()) {
1882 availLocal->setSourceDir(inputdir);
1883 std::cout<<VP1Msg::prefix_msg()<<": "
1884 <<"VP1Message: inputdirectory changed to "
1885 <<availLocal->currentSourceDir().toStdString()<<std::endl;
1886 m_currentStream = QDir(availLocal->currentSourceDir()).dirName();
1887 }
1888
1889
1890}
void setSourceDir(const QString &)

◆ launch3DstereoEditor

void VP1MainWindow::launch3DstereoEditor ( )
protectedslot

Definition at line 448 of file VP1MainWindow.cxx.

449{
450 VP1Msg::messageDebug("VP1MainWindow::launch3DstereoEditor()");
451 m_tabmanager->launchStereoEditorCurrentTab();
452
453}

◆ listenOnTcp()

void VP1MainWindow::listenOnTcp ( )
protected

Definition at line 1448 of file VP1MainWindow.cxx.

1449{
1450 QString err;
1451 if (!m_tcpserver.listen(err)) {
1452 qDebug("%s", err.toStdString().c_str());
1453 }
1454}

◆ loadConfigurationFromFile

void VP1MainWindow::loadConfigurationFromFile ( const QString & file)
slot

Definition at line 1435 of file VP1MainWindow.cxx.

1435 {
1436 m_tabmanager->loadConfigurationFromFile(file,availablePluginFiles());
1437}
QMap< QString, QString > availablePluginFiles() const
TFile * file

◆ loadPluginFile

void VP1MainWindow::loadPluginFile ( const QString & filename)
slot

Definition at line 600 of file VP1MainWindow.cxx.

601{
602 VP1Msg::messageDebug("loadPluginFile()");
603
604 QString err = m_channelmanager->loadPluginFile(filename);
605 if (!err.isEmpty()) {
606 QMessageBox::critical(0, "Error - could not load plugin file: "+filename,
607 "Could not load plugin file: "
608 +filename+"\n\nReason: "+err,QMessageBox::Ok,QMessageBox::Ok);
609 VP1Msg::message("Could not load plugin file: "+filename+"\n\nReason: "+err);
610 }
611 //Fixme: Error message here is hardcoded to be the same as in loadPluginFile method!!
612}

◆ makeAllChannelsEventDisplay

void VP1MainWindow::makeAllChannelsEventDisplay ( )
slot

Definition at line 1114 of file VP1MainWindow.cxx.

1115{
1116 VP1Msg::messageVerbose("VP1MainWindow::makeAllChannelsEventDisplay()");
1117
1118 QList<QPixmap> list;
1119 QStringList listNames;
1120 QList<unsigned long long> listRunEventNumberTimestamp;
1121
1122 getAllChannelsIntoSnapshots(list, listNames);
1123
1124 listRunEventNumberTimestamp << m_runnumber;
1125 listRunEventNumberTimestamp << m_eventnumber;
1126 listRunEventNumberTimestamp << m_timestamp;
1127
1128 // create a new editor window
1129 m_edEditor = new VP1EventDisplayEditor(this, listRunEventNumberTimestamp);
1130
1131 m_edEditor->addPixmapList(list, listNames);
1132
1133 // pass the lists of all tabs and their names to the editor
1134 m_edEditor->setTabsList( listNames);
1135
1136 m_edEditor->show();
1137
1138}
void getAllChannelsIntoSnapshots(QList< QPixmap > &list, QStringList &listNames)

◆ mustQuit()

bool VP1MainWindow::mustQuit ( ) const

Definition at line 583 of file VP1MainWindow.cxx.

583 {
584 return m_mustquit;
585}

◆ nextEvent()

void VP1MainWindow::nextEvent ( )

Definition at line 900 of file VP1MainWindow.cxx.

900 {
901 m_betweenevents=true;
902 if (m_availEvents) {
903 QList<VP1EventFile> evts = m_availEvents->freshEvents();
904 if (evts.empty()) {
905 addToMessageBox("ERROR: Going to next event, but one is not available!");
906 m_scheduler->setNextRequestedEventFile("");
907 } else {
908 m_scheduler->setNextRequestedEventFile(evts.front().fileName());
909 }
910 }
912}

◆ okToProceedToNextEvent()

bool VP1MainWindow::okToProceedToNextEvent ( ) const

Definition at line 893 of file VP1MainWindow.cxx.

894{
895 return ! (m_betweenevents || (m_availEvents&&m_availEvents->freshEvents().isEmpty()));
896}

◆ pluginDialogClosed

void VP1MainWindow::pluginDialogClosed ( )
slot

Definition at line 855 of file VP1MainWindow.cxx.

855 {
856 if (!m_plugindialog)
857 return;
858
859 int res = m_plugindialog->result();
860 QString filename = m_plugindialog->unloadfile();
861 disconnect(m_plugindialog,SIGNAL(finished(int)),this,SLOT(pluginDialogClosed()));
862 m_plugindialog->deleteLater();
863 m_plugindialog = 0;
864
865 if (res!=QDialog::Accepted||filename.isEmpty())
866 return;
867
868 QStringList bns = m_channelmanager->channelsInPluginFile(filename);
869
870 for (const QString& bn : bns) {
871 while(m_channelmanager->basename2UniqueNames(bn).count()>0)
872 m_tabmanager->removeChannel(m_channelmanager->basename2UniqueNames(bn).value(0));
873 }
874
876 QTimer::singleShot(0, this, SLOT(unloadPlugin_continue()));
877
878}
std::pair< std::vector< unsigned int >, bool > res
void unloadPlugin_continue()
QStringList m_currentunloadpluginfiles
void pluginDialogClosed()

◆ postInitUpdates

void VP1MainWindow::postInitUpdates ( )
protectedslot

Definition at line 505 of file VP1MainWindow.cxx.

505 {
506
507 //Make sure that the splitters give maximum space for the tab area.
508
509 int sum1 = splitter_tabwidget_messagebox->sizes().at(0) + splitter_tabwidget_messagebox->sizes().at(1);
510 QList<int> sizes1; sizes1 << sum1 << 0;
511 splitter_tabwidget_messagebox->setSizes ( sizes1 );
512 int bottom = 1;
513 while (splitter_tabwidget_messagebox->sizes().at(1)==0&&bottom<50000) {
514 QList<int> sizes2; sizes2 << sum1-bottom << bottom;
515 splitter_tabwidget_messagebox->setSizes ( sizes2 );
516 ++bottom;
517 }
518
519 int sum2 = splitter_leftright->sizes().at(0) + splitter_leftright->sizes().at(1);
520 int left = 300;
521 QList<int> sizes3; sizes3 << left << sum2-left;
522 splitter_leftright->setSizes ( sizes3 );
523 while (splitter_leftright->sizes().at(0)==0&&left<50000) {
524 QList<int> sizes4; sizes4 << left << sum2-left;
525 splitter_leftright->setSizes ( sizes4 );
526 ++left;
527 }
528
529 int prefwidths = std::max<int>(left,widget_controlsContainer->sizeHint().width());
530 prefwidths = std::max<int>(prefwidths,groupBox_channelcontrols->sizeHint().width());
531 prefwidths = std::max<int>(prefwidths,groupBox_cruise->sizeHint().width());
532 prefwidths = std::max<int>(prefwidths,groupBox_event->sizeHint().width());
533 prefwidths = std::max<int>(prefwidths,stackedWidget_customcontrols->sizeHint().width());
534 widget_controlsContainer->setMaximumWidth(50+prefwidths);
535 // int h1(textBrowser_intro1->viewport()->sizeHint().height());
536 // textBrowser_intro1->setMaximumHeight(h1+2);
537 if (m_availEvents)
538 m_availEvents->init();
540}

◆ processEnqueuedRequests

void VP1MainWindow::processEnqueuedRequests ( )
protectedslot

Definition at line 1467 of file VP1MainWindow.cxx.

1468{
1469 if (!m_requestqueue.empty())
1471}

◆ quickSetupTriggered

void VP1MainWindow::quickSetupTriggered ( )
protectedslot

Definition at line 1679 of file VP1MainWindow.cxx.

1680{
1681 VP1Msg::messageVerbose("VP1MainWindow::quickSetupTriggered()");
1682
1683 QSettings settings("ATLAS", "VP1Light");
1684
1685 QString plugfile, channelname, tabname;
1686
1687 if (sender()==pushButton_quicksetup_geometrystudies||sender()==action_quicklaunch_Geometry_studies) {
1688
1689 //Open geometry database selection dialog for VP1Light
1690#ifdef BUILDVP1LIGHT
1691 if(settings.value("db/dbByEnv").toString().isEmpty()){
1692 VP1GeoDBSelection dbSelection;
1693 dbSelection.exec();
1694 if(!dbSelection.result())
1695 return;
1696 }
1697#endif // BUILDVP1LIGHT
1698
1699 plugfile="libVP1GeometryPlugin.so";
1700 channelname="Geometry";
1701 tabname = "Geometry";
1702 } else if (sender()==pushButton_quicksetup_trackingstudies||sender()==action_quicklaunch_Tracking_studies) {
1703 plugfile="libVP1TrackPlugin.so";
1704 channelname="Tracking";
1705 tabname = "Tracking";
1706 } else if (sender()==pushButton_quicksetup_calostudies||sender()==action_quicklaunch_Calo_studies) {
1707 plugfile="libVP1CaloPlugin.so";
1708 channelname="Calo Cells";
1709 tabname = "Calorimeter";
1710 } else if (sender()==action_quicklaunch_Storegate_browser) {
1711 plugfile="libVP1BanksPlugin.so";
1712 channelname="Banks";
1713 tabname = "StoreGate";
1714 } else if (sender()==pushButton_quicksetup_3dcocktail||sender()==action_quicklaunch_3dcocktail) {
1715#ifndef BUILDVP1LIGHT
1716 plugfile="libVP13DCocktailPlugin.so";
1717 channelname="3DCocktail";
1718 tabname = "3D Cocktail";
1719#else
1720 //Open Geometry DB and AOD file selection dialog for VP1Light
1721 if(settings.value("aod/aodByEnv").toString().isEmpty()){
1722 VP1AODSelection aodSelection;
1723 aodSelection.exec();
1724 if(!aodSelection.result())
1725 return;
1726 }
1727 if(settings.value("db/dbByEnv").toString().isEmpty()){
1728 VP1GeoDBSelection dbSelection;
1729 dbSelection.exec();
1730 if(!dbSelection.result())
1731 return;
1732 }
1733 m_scheduler->loadEvent();
1734
1735 pushButton_eventselect->setEnabled(true);
1736 plugfile="libVP1LightPlugin.so";
1737 channelname="VP1Light";
1738 tabname = "Geometry/AOD";
1739#endif // BUILDVP1LIGHT
1740 } else if (sender()==action_quicklaunch_trackcalo_commis) {
1741 plugfile="libVP13DCocktailPlugin.so";
1742 channelname="TrackCalo";
1743 tabname = "Track/Calo";
1744 } else if (sender()==pushButton_quicksetup_analysisstudies||sender()==action_quicklaunch_analysisstudies) {
1745
1746 //Open AOD file selection dialog for VP1Light
1747#ifdef BUILDVP1LIGHT
1748 if(settings.value("aod/aodByEnv").toString().isEmpty()){
1749 VP1AODSelection aodSelection;
1750 aodSelection.exec();
1751 if(!aodSelection.result())
1752 return;
1753 }
1754 m_scheduler->loadEvent();
1755 pushButton_eventselect->setEnabled(true);
1756#endif // BUILDVP1LIGHT
1757
1758 plugfile="libVP1AODPlugin.so";
1759 channelname="AOD";
1760 tabname = "Analysis";
1761 } else {
1762 addToMessageBox("quickSetupTriggered() Error: Unknown sender");
1763 return;
1764 }
1765
1766#ifdef __APPLE__
1767 if (plugfile.endsWith(".so"))
1768 plugfile = plugfile.left(plugfile.count()-3)+".dylib";
1769#endif
1770
1771
1772 //Check that the plugin is available:
1773 QMap<QString,QString> plugins2fullpath = availablePluginFiles();
1774 if(VP1Msg::debug()){
1775 qDebug() << "plugins2fullpath: " << plugins2fullpath;
1776 }
1777
1778 if (!plugins2fullpath.contains(plugfile)) {
1779 QMessageBox::critical(0, "Error - could not locate plugin file: "+plugfile,
1780 "could not locate plugin file: "
1781 +plugfile,QMessageBox::Ok,QMessageBox::Ok);
1782 return;
1783 }
1784 QString plugfile_fullpath = plugins2fullpath[plugfile];
1785
1786
1787 //Load plugin
1788 if (!m_channelmanager->currentPluginFiles().contains(plugfile_fullpath)) {
1789 QString err = m_channelmanager->loadPluginFile(plugfile_fullpath);
1790 if (!err.isEmpty()||!m_channelmanager->currentPluginFiles().contains(plugfile_fullpath)) {
1791 QMessageBox::critical(0, "Error - could not load plugin file: "+plugfile_fullpath,//Fixme: Error message here is hardcoded to be the same as in loadPluginFile method!!
1792 "Could not load plugin file: "
1793 +plugfile_fullpath+"\n\nReason: "+err,QMessageBox::Ok,QMessageBox::Ok);
1794 return;
1795 }
1796 }
1797
1798
1799 //Check that plugin contains necessary channel:
1800 if (!m_channelmanager->channelsInPluginFile(plugfile_fullpath).contains(channelname)) {
1801 QMessageBox::critical(0, "Error - did not find necessary channel: "+channelname,
1802 "Could not find channel: "+channelname+" in loaded plugin "+plugfile_fullpath,
1803 QMessageBox::Ok,QMessageBox::Ok);
1804 return;
1805 }
1806
1807 bool save = updatesEnabled();
1808 setUpdatesEnabled(false);
1809
1810
1811 //Add tab:
1812 QString newtabname = m_tabmanager->suggestNewTabName(tabname);
1813 m_tabmanager->addNewTab(newtabname);
1814 if (!m_tabmanager->hasTab(newtabname)) {
1815 QMessageBox::critical(0, "Error - could not create tab: "+newtabname,
1816 "Could not create tab: "+newtabname,
1817 QMessageBox::Ok,QMessageBox::Ok);
1818 setUpdatesEnabled(save);
1819 return;
1820 }
1821
1822
1823 //Finally, add channel:
1824
1825 if (!m_tabmanager->addChannelToTab( channelname, newtabname )) {
1826 QMessageBox::critical(0, "Error - problems launching channel: "+channelname,
1827 "Problems launching channel: "+channelname,
1828 QMessageBox::Ok,QMessageBox::Ok);
1829 setUpdatesEnabled(save);
1830 return;
1831 }
1832
1833
1834 m_tabmanager->showTab(newtabname);
1835
1836
1837 setUpdatesEnabled(save);
1838}
save(self, fileName="./columbo.out")
Definition checkTP.py:176

◆ receivedExternalRequest

void VP1MainWindow::receivedExternalRequest ( VP1ExternalRequest request)
protectedslot

Definition at line 1474 of file VP1MainWindow.cxx.

1475{
1477 return;
1478 if (m_messages_blockedsenders.contains(request.sender()))
1479 return;
1480 if (m_messages_blockedexactmessages.contains(request))
1481 return;
1483 //Fixme: store TIME of incoming request (to show the user).
1484 if (m_requestqueue.count()<999) {
1485 m_requestqueue.enqueue(request);
1486 m_currentincomingdialog->updatependinginfo();
1487 }
1488 return;
1489 }
1490 VP1IncomingMessageDialog * md = new VP1IncomingMessageDialog(request,&m_requestqueue,&m_blockallmessages,
1494 connect(md,SIGNAL(finished(int)),this,SLOT(finishedIncomingDialog()));
1495 m_tabmanager->dropOutOfFullScreen();
1496 md->show();
1497}
const QString & sender() const
void finishedIncomingDialog()
QList< VP1ExternalRequest > m_messages_blockedexactmessages
QList< QString > m_messages_blockedsenders

◆ replaceConfigurationFile

void VP1MainWindow::replaceConfigurationFile ( const QString & file)
slot

Definition at line 1440 of file VP1MainWindow.cxx.

1441{
1442 VP1Msg::messageDebug("VP1MainWindow::replaceConfigurationFile() : " + file);
1443 m_tabmanager->removeAllTabs();
1444 m_tabmanager->loadConfigurationFromFile(file,availablePluginFiles());
1445}

◆ request_addEmptyTab

void VP1MainWindow::request_addEmptyTab ( )
slot

Definition at line 615 of file VP1MainWindow.cxx.

615 {
616 bool ok;
617 QString newtabname = QInputDialog::getText( 0, "New Tab Name","New tab name:",
618 QLineEdit::Normal, m_tabmanager->suggestNewTabName("My Tab"), &ok );
619 if (!ok||newtabname.isEmpty())
620 return;
621 m_tabmanager->addNewTab(newtabname);
622}

◆ request_channelInformation

void VP1MainWindow::request_channelInformation ( )
slot

Definition at line 1094 of file VP1MainWindow.cxx.

1094 {
1095 if(!m_tabmanager->selectedChannelWidget())
1096 return;
1097
1098 QString out = "Information about channel: "+m_tabmanager->selectedChannelWidget()->name() + "\n\n";
1099 out += "Contact: "+m_tabmanager->selectedChannelWidget()->contact_info()+"\n";
1100 out += "Information: "+m_tabmanager->selectedChannelWidget()->information()+"\n";
1101 out += "Systems:\n\n";
1102 std::set<IVP1System *>::iterator itsys, itsysE = m_tabmanager->selectedChannelWidget()->systems().end();
1103 for (itsys = m_tabmanager->selectedChannelWidget()->systems().begin();itsys!=itsysE;++itsys) {
1104 out += " ==> System "+(*itsys)->name()+"\n";
1105 out += " Contact: "+(*itsys)->contact_info()+"\n";
1106 out += " Information: "+(*itsys)->information()+"\n";
1107 out += "\n";
1108 }
1109
1110 QMessageBox::information(0, "Information about channel: "+m_tabmanager->selectedChannelWidget()->name(),Qt::convertFromPlainText(out),QMessageBox::Ok,QMessageBox::Ok);
1111}

◆ request_cruisemodechange

void VP1MainWindow::request_cruisemodechange ( )
slot

Definition at line 1500 of file VP1MainWindow.cxx.

1501{
1502 if (pushButton_cruise->isChecked()) {
1503 if (radioButton_cruise_event->isChecked()) {
1505 groupBox_cruise->setTitle("Cruise Mode [event]");
1506 } else if (radioButton_cruise_tab->isChecked()) {
1508 groupBox_cruise->setTitle("Cruise Mode [tab]");
1509 } else if (radioButton_cruise_both->isChecked()) {
1511 groupBox_cruise->setTitle("Cruise Mode [event && tab]");
1512 } else { assert(0); }
1513 } else {
1515 groupBox_cruise->setTitle("Cruise Mode [off]");
1516 }
1517}

◆ request_loadConfig

void VP1MainWindow::request_loadConfig ( )
slot

Definition at line 712 of file VP1MainWindow.cxx.

713{
714 QString filename = QFileDialog::getOpenFileName(this, "Select configuration file to load",
716 "VP1 configuration files (*.vp1)",0,QFileDialog::DontResolveSymlinks);
717 if(filename.isEmpty())
718 return;
719 m_tabmanager->loadConfigurationFromFile(filename,availablePluginFiles());
721}
QString m_currentconfigfile

◆ request_loadPlugin

void VP1MainWindow::request_loadPlugin ( )
slot

Definition at line 724 of file VP1MainWindow.cxx.

725{
726#ifdef __APPLE__
727 QString sharedlibsuffix = "dylib";
728#else
729 QString sharedlibsuffix = "so";
730#endif
731 qDebug() << "VP1MainWindow::request_loadPlugin()"<<m_currentloadpluginpath;
732
733 QString filename = QFileDialog::getOpenFileName(this, "Select plugin file to load",
735 "VP1 plugin files (*VP1*."+sharedlibsuffix+")",0,QFileDialog::DontResolveSymlinks);
736 if(filename.isEmpty())
737 return;
738 m_currentloadpluginpath = QFileInfo(filename).dir().absolutePath();
739 loadPluginFile(filename);
740}
void loadPluginFile(const QString &filename)

◆ request_printChannel

void VP1MainWindow::request_printChannel ( )
slot

Definition at line 1415 of file VP1MainWindow.cxx.

1415 {
1416 if(!m_tabmanager->selectedChannelWidget())
1417 return;
1418
1419 //The following will paint the widget onto a paper and bring up the print dialog:
1420 QPrinter printer;
1421 QPrintDialog dialog(&printer, this);
1422 if (dialog.exec() == QDialog::Accepted) {
1423 QPixmap pm = m_tabmanager->selectedChannelWidget()->getSnapshot();
1424 if (pm.isNull())
1425 return;
1426 QPainter painter;
1427 painter.begin(&printer);
1428 painter.drawPixmap(0,0,pm);
1429 painter.end();
1430 }
1431}

◆ request_saveasConfig

void VP1MainWindow::request_saveasConfig ( )
slot

Definition at line 686 of file VP1MainWindow.cxx.

686 {
687
688 QString filename = QFileDialog::getSaveFileName(this, "Select configuration file to save",
690 "VP1 Configuration files (*.vp1)",0,QFileDialog::DontResolveSymlinks);
691 if(filename.isEmpty())
692 return;
693
694 if (!filename.endsWith(".vp1"))
695 filename += ".vp1";
696
697 m_tabmanager->saveConfigurationToFile(filename,false/*Since the filedialog already asks*/);
699}

◆ request_saveChannelSnapshot

QString VP1MainWindow::request_saveChannelSnapshot ( const QString & xLabel = "")
slot

Definition at line 1360 of file VP1MainWindow.cxx.

1361{
1362
1363 VP1Msg::messageDebug("VP1MainWindow::request_saveChannelSnapshot()");
1364
1365 if(!m_tabmanager->selectedChannelWidget()) {
1366 return QString();
1367 }
1368
1369 QString guess;
1370 QString chnlname = m_tabmanager->selectedChannelWidget()->name().toLower();
1371 chnlname.replace(' ','_');
1372
1373 QString base=m_currentsaveimagepath+QDir::separator()+"vp1_"+chnlname
1374 +"_run"+QString::number(m_runnumber)+"_evt"+QString::number(m_eventnumber)
1375 + QString(m_timestamp>0 ? "_"+QDateTime::fromTime_t(m_timestamp).toString(Qt::ISODate).replace(':','-') : "");
1376
1377
1378 // check for existing files
1379 guess=base;
1380 int i(2);
1381 while (QFile::exists(guess+".png")) {
1382 guess=base+"_"+QString::number(i++);
1383 }
1384 guess+=".png";
1385
1386
1387 // adding the extra label xLabel, if provided
1388 if (!xLabel.isEmpty()) {
1389 guess += "_" + xLabel;
1390 }
1391
1392
1393 QString filename = QFileDialog::getSaveFileName(0, "Select target image file", guess,
1394 "Image (*.png *.bmp)",
1395 0,QFileDialog::DontResolveSymlinks);
1396 if(filename.isEmpty())
1397 return QString();
1398
1399 m_currentsaveimagepath = QFileInfo(filename).dir().absolutePath ();
1400
1401 if (!(filename.endsWith(".png",Qt::CaseInsensitive)||filename.endsWith(".bmp",Qt::CaseInsensitive)))
1402 filename += ".png";
1403
1404 VP1Msg::messageVerbose("calling snapshot");
1405 QPixmap pm = m_tabmanager->selectedChannelWidget()->getSnapshot();
1406
1407 if (pm.isNull())
1408 return QString();
1409
1410 pm.save(filename);
1411 return filename;
1412}
std::string toString(const float number)
Pipe a number to a string.
std::string replace(std::string s, const std::string &s2, const std::string &s3)
Definition hcg.cxx:312
std::string base
Definition hcg.cxx:83

◆ request_saveConfig

void VP1MainWindow::request_saveConfig ( )
slot

Definition at line 702 of file VP1MainWindow.cxx.

703{
704 if (m_currentconfigfile.isEmpty()) {
706 return;
707 }
708 m_tabmanager->saveConfigurationToFile(m_currentconfigfile,false);
709}

◆ saveAllCurrentChannels

void VP1MainWindow::saveAllCurrentChannels ( )
slot

Definition at line 1246 of file VP1MainWindow.cxx.

1247{
1248 VP1Msg::messageDebug("VP1MainWindow::saveAllCurrentChannels()");
1249
1250 int nTabs = m_tabmanager->nTabs();
1251
1252 VP1Msg::messageDebug("# of tabs: " + QString::number(nTabs));
1253
1254 QList<IVP1ChannelWidget*> allTabs = m_tabmanager->allChannels();
1255
1256 if (allTabs.isEmpty()) {
1257 VP1Msg::message("WARNING - No tabs to save.");
1258 return;
1259 }
1260
1261
1262// QString guess;
1263// QString chnlname = m_tabmanager->selectedChannelWidget()->name().toLower();
1264// chnlname.replace(' ','_');
1265
1266 QString base=m_currentsaveimagepath+QDir::separator()+"vp1"
1267 + "_run"+QString::number(m_runnumber)+"_evt"+QString::number(m_eventnumber)
1268 + QString(m_timestamp>0 ? "_"+QDateTime::fromTime_t(m_timestamp).toString(Qt::ISODate).replace(':','-') : "");
1269
1270
1271 // check for existing files
1272 int i(2);
1273 while (QFile::exists(base+".png")) {
1274 base = base+"_"+QString::number(i++);
1275 }
1276
1277 // let the user choose the base filename
1278 QString filename = QFileDialog::getSaveFileName(0, "Select target image file", base,
1279 "Image (*.png *.bmp)",
1280 0,QFileDialog::DontResolveSymlinks);
1281 if(filename.isEmpty()) {
1282 VP1Msg::message("WARNING - No filename selected.");
1283 return;
1284 }
1285
1286 m_currentsaveimagepath = QFileInfo(filename).dir().absolutePath ();
1287
1288
1289 QStringList tab_save_files;
1290
1291 int nT = 0;
1292 for(IVP1ChannelWidget* widg : allTabs) {
1293
1294 // increase tab number
1295 ++nT;
1296
1297 // get channel name (e.g. Geometry, 3DCocktail)
1298 QString channelname = widg->name().toLower();
1299 channelname.replace(' ','_');
1300 VP1Msg::messageDebug("tab: " + channelname);
1301
1302// // get channel info, only for debug
1303// QString info = widg->information();
1304// VP1Msg::messageDebug("channel info: " + info);
1305
1306 QPixmap snap = widg->getSnapshot();
1307 if (snap.isNull()) {
1308 VP1Msg::message("ERROR! - No snapshot produced!");
1309 return;
1310 }
1311
1312 QString tabfilename = filename + "_" + QString::number(nT) + "_" + channelname + ".png";
1313
1314 if (!(tabfilename.endsWith(".png",Qt::CaseInsensitive)||tabfilename.endsWith(".bmp",Qt::CaseInsensitive)))
1315 tabfilename += ".png";
1316
1317
1318 snap.save(tabfilename);
1319
1320 tab_save_files << tabfilename;
1321 }
1322
1323 VP1Msg::message("Tabs saved as: " + tab_save_files.join(" - "));
1324
1325
1326 QMessageBox::information(this, tr("Snapshots saved."),
1327 "All tabs have been saved as snapshots in the following files:\n\n"+tab_save_files.join("\n"),
1328 QMessageBox::Ok,
1329 QMessageBox::Ok);
1330
1331
1332// // TODO: test to create a multilayered PSD or TIFF file
1333// // but doesn't work with the ImageMagick version shipped with SLC5...
1334// // So I give it up now...
1335// QProcess *proc = new QProcess();
1336// QString program = "convert";
1337// QStringList arguments;
1338// arguments = tab_save_files;
1339// arguments << " " + m_currentsaveimagepath + QDir::separator() + "out.psd";
1340// VP1Msg::messageDebug("running: " + program + " " + arguments.join(" "));
1341//
1342// // start the process
1343// proc->start(program, arguments );
1344//
1345// if (!proc->waitForStarted())
1346// return;
1347//
1348// if (!proc->waitForFinished())
1349// return;
1350
1351}

◆ selectedChannelChanged

void VP1MainWindow::selectedChannelChanged ( IVP1ChannelWidget * cw)
slot

Definition at line 656 of file VP1MainWindow.cxx.

657{
658 VP1Msg::messageDebug("VP1MainWindow::selectedChannelChanged()");
659
660 //Controls box:
661 if (cw) {
662 groupBox_channelcontrols->setTitle("Controls: "+cw->unique_name());
663 groupBox_channelcontrols->setEnabled(true);
664 QWidget* controller = m_channelmanager->getController(cw);
665 if (!controller) {
666 stackedWidget_customcontrols->setCurrentWidget(m_dummyemptycontroller);
667 } else {
668 if (stackedWidget_customcontrols->indexOf(controller)==-1)
669 stackedWidget_customcontrols->addWidget(controller);
670 stackedWidget_customcontrols->setCurrentWidget(controller);
671 }
672 } else {
673 groupBox_channelcontrols->setTitle("Controls: no channel selected");
674 groupBox_channelcontrols->setEnabled(false);
675 stackedWidget_customcontrols->setCurrentWidget(m_dummyemptycontroller);
676 }
677
678 // FIXME: enabling menubar again. It's part of a quickfix, described here: https://its.cern.ch/jira/browse/ATLASVPONE-120
679 menubar->setEnabled(true);
680
681 // FIXME: enabling menubar again. It's part of a quickfix, described here: https://its.cern.ch/jira/browse/ATLASVPONE-120
682 menubar->setEnabled(true);
683}

◆ setRunEvtNumber()

void VP1MainWindow::setRunEvtNumber ( const int & runnumber,
const unsigned long long & eventnumber,
const unsigned & triggerType = 0,
const unsigned & time = 0,
const bool & printmessage = true )

Definition at line 991 of file VP1MainWindow.cxx.

991 {
992
993 m_scheduler->setNextRequestedEventFile("");
994 const bool sameasold(m_runnumber==r&&m_eventnumber==e);
995
999
1000 m_betweenevents = false;
1001 if (m_availEvents)
1002 m_availEvents->setCurrentEvent(r,e);
1003
1004 for(IVP1ChannelWidget* channel : m_tabmanager->allChannels()) {
1005 channel->setRunEvtNumber(r,e);
1006 channel->setEvtTimestamp(time);
1007 }
1008
1009 if(printmessage) {
1010 qulonglong evNumber = m_eventnumber;
1011 QString evtstr = "run# "+QString::number(m_runnumber)+", event# "+QString::number(evNumber)+(sameasold?" (reused)":"");
1012 QString trighex = triggerType > 0 ? "0x"+QString::number(triggerType, 16).toUpper().rightJustified(sizeof(triggerType),'0') : "";
1013 QString expandedevtstr = evtstr
1014 + QString(trighex.isEmpty()?QString(""):", triggerType: "+trighex)
1015 + QString(time>0 ? ", time: "+eventTimeUTC(time) : "")
1016 + QString(m_currentStream.isEmpty()?"":", "+m_currentStream);
1017
1018 #ifdef BUILDVP1LIGHT
1019 setWindowTitle("VP1Light ["+expandedevtstr+"]");
1020 #else
1021 setWindowTitle("VP1 (Virtual Point 1) ["+expandedevtstr+"]");
1022 #endif // BUILDVP1LIGHT
1023
1024 groupBox_event->setTitle("Event [loaded]");
1025 QString eventDetails =
1026 "Run: " + QString::number(m_runnumber) +
1027 "\nEvent: " + QString::number(evNumber);
1028 if (time > 0) {
1029 eventDetails +=
1030 "\nTime UTC: " + eventTimeUTC(time) +
1031 "\nTime Europe/Zurich (CERN): " + eventTimeCERN(time);
1032 }
1033 label_run_event->setText(eventDetails);
1034
1035 addToMessageBox("New event: "+expandedevtstr,"color:#ff0000");
1036
1037 }
1039}
int r
Definition globals.cxx:22
time(flags, cells_name, *args, **kw)

◆ setupStatusBar()

void VP1MainWindow::setupStatusBar ( )
protected

Definition at line 543 of file VP1MainWindow.cxx.

543 {
544 progressbar = new QProgressBar();
545 progressbar->setMinimum(0);
546 progressbar->reset();
547 progressbar->setOrientation(Qt::Horizontal);
548 statusBar()->addPermanentWidget(progressbar);
549 m_statusbarlabel = new QLabel();
550 //Turn off ugly box around items in statusbar:
551 statusBar()->setStyleSheet("QStatusBar::item { border-width: 0 }");
552 statusBar()->addPermanentWidget(m_statusbarlabel);
553 progressbar->hide();
554}
QLabel * m_statusbarlabel
QProgressBar * progressbar

◆ showMenu_loadConfFile

void VP1MainWindow::showMenu_loadConfFile ( )
protectedslot

Definition at line 1567 of file VP1MainWindow.cxx.

1568{
1569 m_menu_loadConfFile->clear();
1570
1571 QMap<QString,QString> conffile2fullpath = availableFiles( ".vp1", "DATAPATH", "", "VP1CONFIGFILEPATH", true );
1572
1573 #ifndef BUILDVP1LIGHT
1574 if (conffile2fullpath.empty()) {
1575 m_menu_loadConfFile->addAction("No .vp1 config files found")->setEnabled(false);
1576 return;
1577 }
1578
1579 QStringList filelist(conffile2fullpath.keys());
1580 filelist.sort();
1581
1582 for(const QString& file : filelist) {
1583 QAction * act = m_menu_loadConfFile->addAction(file);
1584 assert(conffile2fullpath.contains(file));
1585 QString fullpath = conffile2fullpath[file];
1586 act->setData(fullpath);
1587 act->setStatusTip(fullpath);
1588 connect(act,SIGNAL(triggered(bool)),this,SLOT(showMenu_loadConfFileItemSelected()));
1589 }
1590 #endif
1591
1592 m_menu_loadConfFile->addSeparator();
1593 QAction * act_browse = m_menu_loadConfFile->addAction("&Browse...");
1594 act_browse->setStatusTip("Browse filesystem for .vp1 config file");
1595 connect(act_browse,SIGNAL(triggered(bool)),this,SLOT(request_loadConfig()));
1596
1597}
void showMenu_loadConfFileItemSelected()
void request_loadConfig()
filelist
print ("Checking files %s..." % fullfile)
Definition envutil.py:133

◆ showMenu_loadConfFileItemSelected

void VP1MainWindow::showMenu_loadConfFileItemSelected ( )
protectedslot

Definition at line 1601 of file VP1MainWindow.cxx.

1602{
1603 QAction * act = static_cast<QAction*>(sender());
1604 assert(act);
1605 if (!act)
1606 return;
1607 loadConfigurationFromFile(act->data().toString());
1608}
void loadConfigurationFromFile(const QString &file)

◆ showMenu_loadPlugin

void VP1MainWindow::showMenu_loadPlugin ( )
protectedslot

Definition at line 1520 of file VP1MainWindow.cxx.

1521{
1522 m_menu_loadPlugin->clear();
1523
1524 QMap<QString,QString> plugins2fullpath = availablePluginFiles();
1525
1526 if (plugins2fullpath.empty()) {
1527 m_menu_loadPlugin->addAction("No plugins found")->setEnabled(false);
1528 return;
1529 }
1530
1531 QStringList pluglist(plugins2fullpath.keys());
1532 pluglist.sort();
1533
1534 QStringList currentpluginfiles = m_channelmanager->currentPluginFiles();
1535 for(const QString& plug : pluglist) {
1536 QAction * act = m_menu_loadPlugin->addAction(plug);
1537 assert(plugins2fullpath.contains(plug));
1538 QString fullpath = plugins2fullpath[plug];
1539 if (currentpluginfiles.contains(fullpath)) {
1540 act->setEnabled(false);
1541 } else {
1542 act->setData(fullpath);
1543 act->setStatusTip(fullpath);
1544 connect(act,SIGNAL(triggered(bool)),this,SLOT(showMenu_loadPluginItemSelected()));
1545 }
1546 }
1547
1548 m_menu_loadPlugin->addSeparator();
1549 QAction * act_browse = m_menu_loadPlugin->addAction("&Browse...");
1550 act_browse->setStatusTip("Browse filesystem for VP1 plugin files");
1551 connect(act_browse,SIGNAL(triggered(bool)),this,SLOT(request_loadPlugin()));
1552
1553}
void request_loadPlugin()
void showMenu_loadPluginItemSelected()

◆ showMenu_loadPluginItemSelected

void VP1MainWindow::showMenu_loadPluginItemSelected ( )
protectedslot

Definition at line 1556 of file VP1MainWindow.cxx.

1557{
1558 QAction * act = static_cast<QAction*>(sender());
1559 assert(act);
1560 if (!act)
1561 return;
1562 loadPluginFile(act->data().toString());
1563}

◆ systemAddToMessageBox

void VP1MainWindow::systemAddToMessageBox ( const QString & m)
slot

Definition at line 1062 of file VP1MainWindow.cxx.

1063{
1064 IVP1System*sys = static_cast<IVP1System*>(sender());
1065 if (!sys) {
1066 addToMessageBox("VP1MainWindow::systemAddToMessageBox Error: Only prints system messages!");
1067 return;
1068 }
1069 if (!sys->channel()) {
1070 addToMessageBox("VP1MainWindow::systemAddToMessageBox Error: System does not know its channel!");
1071 return;
1072 }
1073 addToMessageBox( m, "color:#000000",sys->channel()->unique_name()+"/"+sys->name(),"color:#0000ff" );
1074}

◆ tabListChanged

void VP1MainWindow::tabListChanged ( const QStringList & l)
slot

Definition at line 625 of file VP1MainWindow.cxx.

625 {
627 if (l.count()) {
628 m_actionSave_current_tabs->setEnabled(true);
629 groupBox_cruise->setEnabled(true);
630 } else {
631 m_actionSave_current_tabs->setEnabled(false);
632 groupBox_cruise->setEnabled(false);
633 }
634 if (l.count()>1) {
635 radioButton_cruise_tab->setEnabled(true);
636 radioButton_cruise_both->setEnabled(true);
637 } else {
638 if (radioButton_cruise_tab->isChecked()||radioButton_cruise_both->isChecked())
639 radioButton_cruise_event->setChecked(true);
640 radioButton_cruise_tab->setEnabled(false);
641 radioButton_cruise_both->setEnabled(false);
642 }
643}
l
Printing final latex table to .tex output file.

◆ tabManager()

VP1TabManager * VP1MainWindow::tabManager ( ) const
inline

Definition at line 146 of file VP1MainWindow.h.

146{ return m_tabmanager; }

◆ unloadPlugin_continue

void VP1MainWindow::unloadPlugin_continue ( )
slot

Definition at line 881 of file VP1MainWindow.cxx.

882{
883 for (const QString& filename : m_currentunloadpluginfiles) {
884 bool success = m_channelmanager->unloadPluginFile(filename);
885 if (!success)
886 QMessageBox::critical(0, "Error - problems unloading plugin file: "+filename,
887 "Problems encountered while attempting to unload plugin file: "+filename,QMessageBox::Ok,QMessageBox::Ok);
888 }
890}

◆ updateCentralStackWidget

void VP1MainWindow::updateCentralStackWidget ( )
protectedslot

Definition at line 1671 of file VP1MainWindow.cxx.

1672{
1673 QWidget * targetpage = tabWidget_central->count() ? page_tabwidget : page_instructions;
1674 if (stackedWidget_central->currentWidget() != targetpage)
1675 stackedWidget_central->setCurrentWidget(targetpage);
1676}

◆ updateEventControls

void VP1MainWindow::updateEventControls ( )
protectedslot

Definition at line 1841 of file VP1MainWindow.cxx.

1842{
1843 pushButton_nextevent->setEnabled(okToProceedToNextEvent());
1844 #if defined BUILDVP1LIGHT
1845 pushButton_previousevent->setEnabled(okToProceedToNextEvent());
1846 #endif
1847}
bool okToProceedToNextEvent() const

◆ updateInputDirectoriesStatus

void VP1MainWindow::updateInputDirectoriesStatus ( )
protectedslot

Definition at line 1850 of file VP1MainWindow.cxx.

1851{
1852 if(!m_mutex->tryLock()) return;
1853
1854 QFont f;
1855 QFont fb;
1856 fb.setBold(true);
1857
1858 for (QAction * act : m_inputdiractions) {
1859 VP1DirStatusData& dirstatus = m_inputdirstatuses[act];
1860 QString inputdir(act->data().toString());
1861 QString dirname = QDir(inputdir).dirName();
1862 act->setEnabled(dirstatus.enabled);
1863 act->setFont(dirstatus.bold?fb:f);
1864 act->setText(dirname+" ["+dirstatus.dirStatus+"]");
1865 }
1866
1867 m_mutex->unlock();
1868}

◆ updateTcpIcon

void VP1MainWindow::updateTcpIcon ( )
protectedslot

Definition at line 589 of file VP1MainWindow.cxx.

590{
591 bool l = m_tcpserver.isListening();
592 m_statusbarlabel->setPixmap(QIcon(l?":/vp1/icons/icons/network_64x64.png":":/vp1/icons/icons/network_disconnect_64x64.png")
593 .pixmap(progressbar->height(),progressbar->height(),QIcon::Normal,QIcon::On));
594 m_statusbarlabel->setToolTip(l?"Listening on port "+QString::number(m_tcpserver.port())+" for incoming messsages"
595 :"VP1 is presently NOT listening for incoming messages");
596
597}

◆ userRequestedExit()

bool VP1MainWindow::userRequestedExit ( )
inline

Definition at line 148 of file VP1MainWindow.h.

148{ return m_userRequestedExit; }

◆ userRequestedFiles()

QStringList VP1MainWindow::userRequestedFiles ( )

Definition at line 1893 of file VP1MainWindow.cxx.

1894{
1895 QStringList returnval(m_userRequestedFiles);
1896 m_userRequestedFiles.clear();
1897 return returnval;
1898}

Member Data Documentation

◆ m_action_addEventFile

QAction* VP1MainWindow::m_action_addEventFile
protected

Definition at line 232 of file VP1MainWindow.h.

◆ m_action_infoAboutLoadedPlugins

QAction* VP1MainWindow::m_action_infoAboutLoadedPlugins
protected

Definition at line 224 of file VP1MainWindow.h.

◆ m_action_openAbout

QAction* VP1MainWindow::m_action_openAbout
protected

Definition at line 236 of file VP1MainWindow.h.

◆ m_action_openUsersGuide

QAction* VP1MainWindow::m_action_openUsersGuide
protected

Definition at line 233 of file VP1MainWindow.h.

◆ m_action_openUsersSupport

QAction* VP1MainWindow::m_action_openUsersSupport
protected

Definition at line 234 of file VP1MainWindow.h.

◆ m_action_openVP1Site

QAction* VP1MainWindow::m_action_openVP1Site
protected

Definition at line 235 of file VP1MainWindow.h.

◆ m_actionAdd_empty_tab

QAction* VP1MainWindow::m_actionAdd_empty_tab
protected

Definition at line 229 of file VP1MainWindow.h.

◆ m_actionEnableExpertSettings

QAction* VP1MainWindow::m_actionEnableExpertSettings
protected

Definition at line 230 of file VP1MainWindow.h.

◆ m_actionSave_current_tabs

QAction* VP1MainWindow::m_actionSave_current_tabs
protected

Definition at line 231 of file VP1MainWindow.h.

◆ m_availEvents

VP1AvailEvents* VP1MainWindow::m_availEvents
protected

Definition at line 168 of file VP1MainWindow.h.

◆ m_betweenevents

bool VP1MainWindow::m_betweenevents
protected

Definition at line 161 of file VP1MainWindow.h.

◆ m_blockallmessages

bool VP1MainWindow::m_blockallmessages
protected

Definition at line 175 of file VP1MainWindow.h.

◆ m_channelmanager

VP1ChannelManager* VP1MainWindow::m_channelmanager
protected

Definition at line 155 of file VP1MainWindow.h.

◆ m_currentconfigfile

QString VP1MainWindow::m_currentconfigfile
protected

Definition at line 157 of file VP1MainWindow.h.

◆ m_currentincomingdialog

VP1IncomingMessageDialog* VP1MainWindow::m_currentincomingdialog
protected

Definition at line 173 of file VP1MainWindow.h.

◆ m_currentloadpluginpath

QString VP1MainWindow::m_currentloadpluginpath
protected

Definition at line 241 of file VP1MainWindow.h.

◆ m_currentsaveimagepath

QString VP1MainWindow::m_currentsaveimagepath
protected

Definition at line 240 of file VP1MainWindow.h.

◆ m_currentStream

QString VP1MainWindow::m_currentStream
protected

Definition at line 242 of file VP1MainWindow.h.

◆ m_currentunloadpluginfiles

QStringList VP1MainWindow::m_currentunloadpluginfiles
protected

Definition at line 181 of file VP1MainWindow.h.

◆ m_defaultfont

QFont VP1MainWindow::m_defaultfont
protected

Definition at line 245 of file VP1MainWindow.h.

◆ m_defaultfont_pixelsize

int VP1MainWindow::m_defaultfont_pixelsize
protected

Definition at line 247 of file VP1MainWindow.h.

◆ m_defaultfont_pointsize

double VP1MainWindow::m_defaultfont_pointsize
protected

Definition at line 246 of file VP1MainWindow.h.

◆ m_dummyemptycontroller

QWidget* VP1MainWindow::m_dummyemptycontroller
protected

Definition at line 166 of file VP1MainWindow.h.

◆ m_edEditor

VP1EventDisplayEditor* VP1MainWindow::m_edEditor
protected

Definition at line 265 of file VP1MainWindow.h.

◆ m_eventnumber

unsigned long long VP1MainWindow::m_eventnumber
protected

Definition at line 159 of file VP1MainWindow.h.

◆ m_inputdiractions

QList<QAction*> VP1MainWindow::m_inputdiractions
protected

Definition at line 238 of file VP1MainWindow.h.

◆ m_inputdirstatuses

VP1DirStatuses VP1MainWindow::m_inputdirstatuses
protected

Definition at line 239 of file VP1MainWindow.h.

◆ m_menu_changeFontSize

QMenu* VP1MainWindow::m_menu_changeFontSize
protected

Definition at line 228 of file VP1MainWindow.h.

◆ m_menu_changeStyle

QMenu* VP1MainWindow::m_menu_changeStyle
protected

Definition at line 227 of file VP1MainWindow.h.

◆ m_menu_loadConfFile

QMenu* VP1MainWindow::m_menu_loadConfFile
protected

Definition at line 226 of file VP1MainWindow.h.

◆ m_menu_loadPlugin

QMenu* VP1MainWindow::m_menu_loadPlugin
protected

Definition at line 225 of file VP1MainWindow.h.

◆ m_messages_blockedexactmessages

QList<VP1ExternalRequest> VP1MainWindow::m_messages_blockedexactmessages
protected

Definition at line 177 of file VP1MainWindow.h.

◆ m_messages_blockedsenders

QList<QString> VP1MainWindow::m_messages_blockedsenders
protected

Definition at line 176 of file VP1MainWindow.h.

◆ m_mustquit

bool VP1MainWindow::m_mustquit
protected

Definition at line 164 of file VP1MainWindow.h.

◆ m_mutex

QMutex* VP1MainWindow::m_mutex
protected

Definition at line 255 of file VP1MainWindow.h.

◆ m_plugindialog

VP1PluginDialog* VP1MainWindow::m_plugindialog
protected

Definition at line 182 of file VP1MainWindow.h.

◆ m_requestqueue

QQueue<VP1ExternalRequest> VP1MainWindow::m_requestqueue
protected

Definition at line 174 of file VP1MainWindow.h.

◆ m_runnumber

int VP1MainWindow::m_runnumber
protected

Definition at line 158 of file VP1MainWindow.h.

◆ m_scheduler

VP1ExecutionScheduler* VP1MainWindow::m_scheduler
protected

Definition at line 167 of file VP1MainWindow.h.

◆ m_settingsfile

const QString VP1MainWindow::m_settingsfile
protected

Definition at line 248 of file VP1MainWindow.h.

◆ m_statusbarlabel

QLabel* VP1MainWindow::m_statusbarlabel
protected

Definition at line 185 of file VP1MainWindow.h.

◆ m_streamMenuUpdater

VP1StreamMenuUpdater* VP1MainWindow::m_streamMenuUpdater
protected

Definition at line 254 of file VP1MainWindow.h.

◆ m_tabmanager

VP1TabManager* VP1MainWindow::m_tabmanager
protected

Definition at line 156 of file VP1MainWindow.h.

◆ m_tcpserver

VP1TcpServer VP1MainWindow::m_tcpserver
protected

Definition at line 170 of file VP1MainWindow.h.

◆ m_timestamp

unsigned VP1MainWindow::m_timestamp
protected

Definition at line 160 of file VP1MainWindow.h.

◆ m_userRequestedExit

bool VP1MainWindow::m_userRequestedExit
protected

Definition at line 250 of file VP1MainWindow.h.

◆ m_userRequestedFiles

QStringList VP1MainWindow::m_userRequestedFiles
protected

Definition at line 252 of file VP1MainWindow.h.

◆ progressbar

QProgressBar* VP1MainWindow::progressbar

Definition at line 195 of file VP1MainWindow.h.


The documentation for this class was generated from the following files: