108 #if defined BUILDVP1LIGHT
114 if (!checkShowAllCruiseAndEventControls) {
115 pushButton_eventseek->setVisible(
false);
116 groupBox_cruise->setVisible(
false);
126 QMenu* menu_file =
new QMenu(menubar);
127 menu_file->setObjectName(
"menu_file");
128 menu_file->setTitle(
"&File");
129 menubar->addAction(menu_file->menuAction());
135 #ifndef BUILDVP1LIGHT
136 pushButton_previousevent->setVisible(
false);
137 pushButton_eventselect->setVisible(
false);
139 pushButton_eventselect->setVisible(
true);
140 pushButton_eventselect->setText(
"Event: 0/0");
141 pushButton_eventselect->setEnabled(
false);
142 pushButton_previousevent->setEnabled(
false);
146 pushButton_quicksetup_trackingstudies->setEnabled(
false);
147 pushButton_quicksetup_trackingstudies->setToolTip(
"Not available in VP1Light");
148 pushButton_quicksetup_calostudies->setEnabled(
false);
149 pushButton_quicksetup_calostudies->setToolTip(
"Not available in VP1Light");
150 action_quicklaunch_Tracking_studies->setEnabled(
false);
151 action_quicklaunch_Tracking_studies->setToolTip(
"Not available in VP1Light");
152 action_quicklaunch_Calo_studies->setEnabled(
false);
153 action_quicklaunch_Calo_studies->setToolTip(
"Not available in VP1Light");
154 action_quicklaunch_Storegate_browser->setEnabled(
false);
155 action_quicklaunch_Storegate_browser->setToolTip(
"Not available in VP1Light");
156 action_quicklaunch_trackcalo_commis->setEnabled(
false);
157 action_quicklaunch_trackcalo_commis->setToolTip(
"Not available in VP1Light");
166 QStringList inputdirs;
170 if (availLocal&&!inputdirs.isEmpty()) {
173 if (currentdir.endsWith(
"/"))
176 QMenu * menu_inputdir =
new QMenu(menubar);
177 menu_inputdir->setObjectName(
"menu_inputdir");
178 menu_inputdir->setTitle(
"&Stream");
180 menubar->addAction(menu_inputdir->menuAction());
182 QActionGroup * inputdir_actiongroup =
new QActionGroup(menu_inputdir);
183 QAction*action_inputdir_current(0);
184 for (QString inputdir : inputdirs) {
185 if (inputdir.endsWith(
"/"))
187 QString
dirname = QDir(inputdir).dirName();
188 QAction * action_inputdir =
new QAction(
this);
189 action_inputdir->setObjectName(
"action_inputdir_"+
dirname);
190 action_inputdir->setData(inputdir);
191 action_inputdir->setStatusTip(
"Get input files from: "+inputdir);
192 action_inputdir->setCheckable(
true);
194 if (currentdir==inputdir)
195 action_inputdir_current = action_inputdir;
196 menu_inputdir->addAction(action_inputdir);
197 inputdir_actiongroup->addAction(action_inputdir);
201 if (action_inputdir_current) {
202 action_inputdir_current->blockSignals(
true);
203 action_inputdir_current->setChecked(
true);
204 action_inputdir_current->blockSignals(
false);
218 QTimer *timer =
new QTimer(
this);
233 for (
int i=0;i<stackedWidget_central->count();++i)
234 stackedWidget_central->widget(i)->layout()->setContentsMargins(0,0,0,0);
237 frame_instructions->setFrameShape(QFrame::StyledPanel);
240 #ifndef BUILDVP1LIGHT
241 connect(pushButton_quicksetup_3dcocktail,SIGNAL(clicked()),
this,SLOT(
quickSetupTriggered()));
243 connect(pushButton_quicksetup_3dcocktail,SIGNAL(clicked()),
this,SLOT(
quickSetupTriggered()));
245 connect(pushButton_quicksetup_trackingstudies,SIGNAL(clicked()),
this,SLOT(
quickSetupTriggered()));
246 connect(pushButton_quicksetup_calostudies,SIGNAL(clicked()),
this,SLOT(
quickSetupTriggered()));
247 connect(pushButton_quicksetup_geometrystudies,SIGNAL(clicked()),
this,SLOT(
quickSetupTriggered()));
248 connect(pushButton_quicksetup_analysisstudies,SIGNAL(clicked()),
this,SLOT(
quickSetupTriggered()));
270 connect(pushButton_channelfullscreen,SIGNAL(clicked()),
m_tabmanager,SLOT(showCurrentChannelFullScreen()));
278 connect(action_quicklaunch_Tracking_studies,SIGNAL(triggered(
bool)),
this,SLOT(
quickSetupTriggered()));
279 connect(action_quicklaunch_Calo_studies,SIGNAL(triggered(
bool)),
this,SLOT(
quickSetupTriggered()));
280 connect(action_quicklaunch_Geometry_studies,SIGNAL(triggered(
bool)),
this,SLOT(
quickSetupTriggered()));
281 connect(action_quicklaunch_analysisstudies,SIGNAL(triggered(
bool)),
this,SLOT(
quickSetupTriggered()));
282 connect(action_quicklaunch_Storegate_browser,SIGNAL(triggered(
bool)),
this,SLOT(
quickSetupTriggered()));
283 connect(action_quicklaunch_3dcocktail,SIGNAL(triggered(
bool)),
this,SLOT(
quickSetupTriggered()));
284 connect(action_quicklaunch_trackcalo_commis,SIGNAL(triggered(
bool)),
this,SLOT(
quickSetupTriggered()));
285 connect(action_exit_VP1,SIGNAL(triggered(
bool)),
this,SLOT(close()));
291 menuConfiguration->addSeparator();
301 QActionGroup * styleGroup =
new QActionGroup(
this);
302 QAction * laststyleact(0);
303 bool foundplastique=
false;
305 QString defaultstyle=s.value(
"style/defaultstyle",
"Fusion").toString();
306 for (QString style : QStyleFactory::keys() ) {
308 act->setStatusTip(
"Change application style to "+style);
310 act->setCheckable(
true);
311 styleGroup->addAction(act);
313 if (act->text()==defaultstyle) {
314 act->setChecked(
true);
315 QApplication::setStyle(QStyleFactory::create(act->text()));
319 if (!foundplastique) {
320 laststyleact->setChecked(
true);
321 QApplication::setStyle(QStyleFactory::create(laststyleact->text()));
326 savedgoal = s.value(
"font/pixelsize_diff", 0).toInt();
328 savedgoal = s.value(
"font/pointsize_relativepercent", 0).toInt();
331 QList<int> fontoptions;
333 fontoptions <<15<<10<<+5<<+3<<+2<<+1<<0<<-1<<-2<<-3<<-5<<-10<<-20<<-30;
335 fontoptions <<150<<100<<50<<30<<20<<10<<5<<0<<-5<<-10<<-20<<-30<<-50;
337 QActionGroup * fontGroup =
new QActionGroup(
this);
338 bool foundsavedgoal(
false);
339 QAction * normalfontact(0);
340 for (
int fontopt : fontoptions) {
343 QString text = (fontopt==0?
"normal": (fontopt>0?
"+":
"")+QString::number(fontopt)+(
m_defaultfont_pointsize < 0.0?
" pixels" :
"%"));
345 act->setStatusTip(
"Change overall font size of application to "+text);
346 act->setData(fontopt);
347 act->setCheckable(
true);
348 fontGroup->addAction(act);
352 if (savedgoal==fontopt) {
353 act->setChecked(
true);
358 if (!foundsavedgoal) {
359 normalfontact->setChecked(
true);
365 menuConfiguration->addSeparator();
373 menuConfiguration->addSeparator();
380 connect(pushButton_nextevent,SIGNAL(clicked()),
this,SLOT(
goToNextEvent()));
382 connect(pushButton_previousevent,SIGNAL(clicked()),
this,SLOT(goToPreviousEvent()));
383 connect(pushButton_eventselect,SIGNAL(clicked()),
this,SLOT(chooseEvent()));
403 QMenu* menu_help =
new QMenu(menubar);
404 menu_help->setObjectName(
"menu_help");
405 menu_help->setTitle(
"&Help");
406 menubar->addAction(menu_help->menuAction());
410 menu_help->addSeparator();
423 #ifndef BUILDVP1LIGHT
424 menubar->setEnabled(
false);
490 int sum1 = splitter_tabwidget_messagebox->sizes().at(0) + splitter_tabwidget_messagebox->sizes().at(1);
491 QList<int> sizes1; sizes1 << sum1 << 0;
492 splitter_tabwidget_messagebox->setSizes ( sizes1 );
494 while (splitter_tabwidget_messagebox->sizes().at(1)==0&&bottom<50000) {
495 QList<int> sizes2; sizes2 << sum1-bottom << bottom;
496 splitter_tabwidget_messagebox->setSizes ( sizes2 );
500 int sum2 = splitter_leftright->sizes().at(0) + splitter_leftright->sizes().at(1);
502 QList<int> sizes3; sizes3 << left << sum2-left;
503 splitter_leftright->setSizes ( sizes3 );
504 while (splitter_leftright->sizes().at(0)==0&&left<50000) {
505 QList<int> sizes4; sizes4 << left << sum2-left;
506 splitter_leftright->setSizes ( sizes4 );
510 int prefwidths = std::max<int>(left,widget_controlsContainer->sizeHint().width());
511 prefwidths = std::max<int>(prefwidths,groupBox_channelcontrols->sizeHint().width());
512 prefwidths = std::max<int>(prefwidths,groupBox_cruise->sizeHint().width());
513 prefwidths = std::max<int>(prefwidths,groupBox_event->sizeHint().width());
514 prefwidths = std::max<int>(prefwidths,stackedWidget_customcontrols->sizeHint().width());
515 widget_controlsContainer->setMaximumWidth(50+prefwidths);
725 const QString& pathvar,
726 const QString& instareasubdir,
727 const QString& extradirenvvar,
728 bool currentdir )
const
731 qDebug() <<
"VP1MainWindow::availableFiles()";
732 qDebug() <<
"extension:" << extension <<
"pathvar:" << pathvar <<
"instareasubdir:" << instareasubdir <<
"extradirenvvar:" << extradirenvvar <<
"currentdir:" << currentdir;
736 QStringList vp1pluginpath =
737 extradirenvvar.isEmpty() ?
739 QString(::getenv(extradirenvvar.toStdString().c_str())) .
740#
if QTCORE_VERSION >= 0x050E00
741 split(
":",Qt::SkipEmptyParts);
743 split(
":",QString::SkipEmptyParts);
746 qDebug() <<
"extradirenvvar:" << extradirenvvar;
747 qDebug() <<
"vp1pluginpath:" << vp1pluginpath;
753 vp1pluginpath<<QCoreApplication::applicationDirPath()+
"/../lib";
761 vp1pluginpath<<QDir::currentPath();
767 QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
769 QString path = env.value(pathvar);
772 if (!path.isEmpty()) {
773#if QTCORE_VERSION >= 0x050E00
775 QStringList tmp = path.split(
":",Qt::SkipEmptyParts);
778 QStringList tmp = path.split(
":",QString::SkipEmptyParts);
780 for (
const QString& dir : tmp) {
781 vp1pluginpath << ( instareasubdir.isEmpty() ? dir : dir+QDir::separator()+instareasubdir );
786 int nDuplicatesRemoved = vp1pluginpath.removeDuplicates();
791 for (
const auto& plugindir : vp1pluginpath) {
793 QFileInfo fi(plugindir);
794 if (!fi.exists()||!fi.isDir()) {
796 if (vp1pluginpath.contains(plugindir)) {
797 vp1pluginpath.removeAt(idx);
801 VP1Msg::messageDebug(
"plugindir not present; perhaps, it has been removed already. Skipping it...");
808 QMap<QString,QString> plugins2fullpath;
809 for (
const QString& plugindir : vp1pluginpath) {
810 QStringList plugins = QDir(plugindir).entryList((QStringList()<<(
"*"+extension)),QDir::CaseSensitive | QDir::Files | QDir::Readable,QDir::Name);
811 for (QString plugin : plugins) {
812 plugin = QFileInfo(plugin).fileName();
813 if (!plugins2fullpath.contains(plugin)) {
814 QString fullpath = plugindir+QDir::separator()+plugin;
815 plugins2fullpath[plugin]=fullpath;
819 return plugins2fullpath;
1658 QSettings settings(
"ATLAS",
"VP1Light");
1660 QString plugfile, channelname, tabname;
1662 if (sender()==pushButton_quicksetup_geometrystudies||sender()==action_quicklaunch_Geometry_studies) {
1666 if(settings.value(
"db/dbByEnv").toString().isEmpty()){
1669 if(!dbSelection.result())
1674 plugfile=
"libVP1GeometryPlugin.so";
1675 channelname=
"Geometry";
1676 tabname =
"Geometry";
1677 }
else if (sender()==pushButton_quicksetup_trackingstudies||sender()==action_quicklaunch_Tracking_studies) {
1678 plugfile=
"libVP1TrackPlugin.so";
1679 channelname=
"Tracking";
1680 tabname =
"Tracking";
1681 }
else if (sender()==pushButton_quicksetup_calostudies||sender()==action_quicklaunch_Calo_studies) {
1682 plugfile=
"libVP1CaloPlugin.so";
1683 channelname=
"Calo Cells";
1684 tabname =
"Calorimeter";
1685 }
else if (sender()==action_quicklaunch_Storegate_browser) {
1686 plugfile=
"libVP1BanksPlugin.so";
1687 channelname=
"Banks";
1688 tabname =
"StoreGate";
1689 }
else if (sender()==pushButton_quicksetup_3dcocktail||sender()==action_quicklaunch_3dcocktail) {
1690#ifndef BUILDVP1LIGHT
1691 plugfile=
"libVP13DCocktailPlugin.so";
1692 channelname=
"3DCocktail";
1693 tabname =
"3D Cocktail";
1696 if(settings.value(
"aod/aodByEnv").toString().isEmpty()){
1698 aodSelection.exec();
1699 if(!aodSelection.result())
1702 if(settings.value(
"db/dbByEnv").toString().isEmpty()){
1705 if(!dbSelection.result())
1710 pushButton_eventselect->setEnabled(
true);
1711 plugfile=
"libVP1LightPlugin.so";
1712 channelname=
"VP1Light";
1713 tabname =
"Geometry/AOD";
1715 }
else if (sender()==action_quicklaunch_trackcalo_commis) {
1716 plugfile=
"libVP13DCocktailPlugin.so";
1717 channelname=
"TrackCalo";
1718 tabname =
"Track/Calo";
1719 }
else if (sender()==pushButton_quicksetup_analysisstudies||sender()==action_quicklaunch_analysisstudies) {
1723 if(settings.value(
"aod/aodByEnv").toString().isEmpty()){
1725 aodSelection.exec();
1726 if(!aodSelection.result())
1730 pushButton_eventselect->setEnabled(
true);
1733 plugfile=
"libVP1AODPlugin.so";
1735 tabname =
"Analysis";
1742 if (plugfile.endsWith(
".so"))
1743 plugfile = plugfile.left(plugfile.count()-3)+
".dylib";
1750 qDebug() <<
"plugins2fullpath: " << plugins2fullpath;
1753 if (!plugins2fullpath.contains(plugfile)) {
1754 QMessageBox::critical(0,
"Error - could not locate plugin file: "+plugfile,
1755 "could not locate plugin file: "
1756 +plugfile,QMessageBox::Ok,QMessageBox::Ok);
1759 QString plugfile_fullpath = plugins2fullpath[plugfile];
1765 if (!err.isEmpty()||!
m_channelmanager->currentPluginFiles().contains(plugfile_fullpath)) {
1766 QMessageBox::critical(0,
"Error - could not load plugin file: "+plugfile_fullpath,
1767 "Could not load plugin file: "
1768 +plugfile_fullpath+
"\n\nReason: "+err,QMessageBox::Ok,QMessageBox::Ok);
1775 if (!
m_channelmanager->channelsInPluginFile(plugfile_fullpath).contains(channelname)) {
1776 QMessageBox::critical(0,
"Error - did not find necessary channel: "+channelname,
1777 "Could not find channel: "+channelname+
" in loaded plugin "+plugfile_fullpath,
1778 QMessageBox::Ok,QMessageBox::Ok);
1782 bool save = updatesEnabled();
1783 setUpdatesEnabled(
false);
1787 QString newtabname =
m_tabmanager->suggestNewTabName(tabname);
1790 QMessageBox::critical(0,
"Error - could not create tab: "+newtabname,
1791 "Could not create tab: "+newtabname,
1792 QMessageBox::Ok,QMessageBox::Ok);
1793 setUpdatesEnabled(save);
1800 if (!
m_tabmanager->addChannelToTab( channelname, newtabname )) {
1801 QMessageBox::critical(0,
"Error - problems launching channel: "+channelname,
1802 "Problems launching channel: "+channelname,
1803 QMessageBox::Ok,QMessageBox::Ok);
1804 setUpdatesEnabled(save);
1812 setUpdatesEnabled(save);
void setRunEvtNumber(const int &runnumber, const unsigned long long &eventnumber, const unsigned &triggerType=0, const unsigned &time=0, const bool &printmessage=true)
QMap< QString, QString > availableFiles(const QString &extension, const QString &pathvar, const QString &instareasubdir, const QString &extradirenvvar, bool currentdir=false) const