ATLAS Offline Software
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
IVP13DStandardChannelWidget::Imp Class Reference
Collaboration diagram for IVP13DStandardChannelWidget::Imp:

Public Member Functions

void updateSystemState (QCheckBox *)
 
void setupSplitter (QWidget *rightwidget)
 
void autoSnapshot ()
 
void restoreFromState_v7 (QDataStream &state)
 

Public Attributes

IVP13DStandardChannelWidgetchannel
 
bool detectorViewButtons
 
SoSeparator * root
 
VP1ExaminerViewerviewer
 
bool need_initial_viewall
 
QMap< IVP13DSystem *, SoSeparator * > system2rootNodes
 
QMap< QCheckBox *, IVP1System * > checkbox2system
 
QList< IVP1System * > systemsAllowedControllers
 
QList< IVP13DSystem * > systemsAllowedExtraDisplayWidgets
 
QList< QPair< IVP1System *, bool > > system2switchable
 
QMap< IVP1System *, bool > system2startdisabled
 
QList< IVP13DSystem * > systemsAllowedCameraList
 
Ui::VP13DStandardChannelSnapShotGroupBox uisnapshot
 
QMap< IVP1System *, QWidget * > sys2tabpage
 
VP1TabWidgettabwidget
 
QSplitter * extradisplaywidget_splitter
 

Static Public Attributes

static const int min3dx = 150
 
static const int min3dy = 180
 

Detailed Description

Definition at line 46 of file IVP13DStandardChannelWidget.cxx.

Member Function Documentation

◆ autoSnapshot()

void IVP13DStandardChannelWidget::Imp::autoSnapshot ( )

Definition at line 291 of file IVP13DStandardChannelWidget.cxx.

292 {
293  VP1Msg::messageVerbose("IVP13DStandardChannelWidget::Imp::autoSnapshot()");
294 
295  int runnumber(0);
296  unsigned long long eventnumber(0);
297  channel->getRunEvtNumber(runnumber,eventnumber);
298 
299  #if defined BUILDVP1LIGHT
300  QString snapshotDirName = VP1QtUtils::expertSettingValue("general","ExpertSettings/VP1_SCREENSHOTS_DIR");
301  #else
302  QString snapshotDirName = VP1QtUtils::environmentVariableValue("VP1_SCREENSHOTS_DIR");
303  #endif
304 
305  QFileInfo snapshotDir(snapshotDirName);
306  if(!snapshotDir.exists()||!snapshotDir.isDir()||!snapshotDir.isReadable()||!snapshotDir.isWritable()) {
307  channel->message("The directory for storing VP1 snapshots "+snapshotDirName+" either does not exist or is not writable");
308  return;
309  }
310 
311  QString guess;
312  QString chnlname = channel->name().toLower();
313  chnlname.replace(' ','_');
314  QString base=snapshotDirName+QDir::separator()+"vp1_"+chnlname+"_run"+QString::number(runnumber)+"_evt"+QString::number(eventnumber);
315  guess=base;
316  int i(2);
317  while (QFile::exists(guess+".png")) {
318  guess=base+"_"+QString::number(i++);
319  }
320  guess+=".png";
321 
322  QPixmap pm = channel->getSnapshot();
323  if (pm.isNull()) {
324  VP1Msg::messageVerbose("pm==NULL, return...");
325  return;
326  }
327  pm.save(guess);
328 }

◆ restoreFromState_v7()

void IVP13DStandardChannelWidget::Imp::restoreFromState_v7 ( QDataStream &  state)

Definition at line 906 of file IVP13DStandardChannelWidget.cxx.

906  {
907 
908  VP1Msg::messageVerbose("IVP13DStandardChannelWidget::Imp::restoreFromState_v7");
909 
910  /*
911  * --- VARIABLES TO BE RESTORED ---
912  */
913  //Switch systems on/off:
914  QMap<QString, bool> sysname2turnedon;
915  //Splitter:
916  QByteArray splitstate;
917  //Viewer settings:
918  QByteArray ba_viewer;
919  // Snapshot parameters:
920  bool transp, widthfixed, as_shown;
921  bool locked_ratio;
922  qint32 width, height;
923  // image format presets
924  bool isUsingPresets;
925  bool is720p;
926  bool is1080p;
927  bool is4K;
928  bool is8K;
929  // Active tab
930  QString tabname;
931 
932 
933  /*
934  * ------- GET STATE -------
935  */
936  // 'version' restored already
937  // 'basestate' restored already
938  state >> sysname2turnedon;
939  state >> splitstate;
940  state >> ba_viewer;
941  state >> transp;
942  state >> widthfixed;
943  state >> as_shown;
944  state >> locked_ratio;
945  state >> width;
946  state >> height;
947  state >> isUsingPresets;
948  state >> is720p;
949  state >> is1080p;
950  state >> is4K;
951  state >> is8K;
952  state >> tabname;
953  // -------------------------
954 
955 
956 
957 
958  /*
959  * --- RESTORE VARIABLES ---
960  */
961 
962  //Switch systems on/off:
963  QMap<QCheckBox*,IVP1System*>::const_iterator it = checkbox2system.constBegin();
964  while (it != checkbox2system.constEnd()) {
965  if (sysname2turnedon.contains(it.key()->text())) {
966  if (sysname2turnedon[it.key()->text()]!=it.key()->isChecked())
967  it.key()->setChecked(sysname2turnedon[it.key()->text()]);
968  } else {
969  channel->message("Warning: Config data does not contain information about switched state of subsystem '"+it.key()->text()+"'");
970  }
971  ++it;
972  }
973 
974 
975  //Splitter:
977  extradisplaywidget_splitter->restoreState(splitstate);
978 
979  //Viewer settings:
980  viewer->restoreFromState(ba_viewer);//Fixme: reset camera???
981  need_initial_viewall = false;
982 
983 
984  // Snapshot parameters - Set Width and Height
985  uisnapshot.checkBox_transp->setChecked(transp);
986  uisnapshot.checkBox_as_shown->setChecked(as_shown);
987  if (widthfixed) {
988  uisnapshot.radioButton_width->setChecked(true);
989  uisnapshot.radioButton_height->setChecked(false);
990  } else {
991  uisnapshot.radioButton_width->setChecked(false);
992  uisnapshot.radioButton_height->setChecked(true);
993  }
994  if (!as_shown) {
995  uisnapshot.spinBox_width->setValue(width);
996  uisnapshot.spinBox_height->setValue(height);
997  }
998 
999  // image format presets
1000  if (isUsingPresets)
1001  uisnapshot.groupBox_imagePresets->setChecked(true);
1002  if (is720p)
1003  uisnapshot.radioButton_720p->setChecked(true);
1004  else if (is1080p)
1005  uisnapshot.radioButton_1080p->setChecked(true);
1006  else if (is4K)
1007  uisnapshot.radioButton_4K->setChecked(true);
1008  else if (is8K)
1009  uisnapshot.radioButton_8K->setChecked(true);
1010 
1011 
1012  // Set active tab
1013  if (tabwidget) {
1014  for (int i = 0; i < tabwidget->count(); ++i) {
1015  if (tabwidget->tabText(i) == tabname) {
1016  tabwidget->setCurrentIndex(i);
1017  break;
1018  }
1019  }
1020  }
1021 }

◆ setupSplitter()

void IVP13DStandardChannelWidget::Imp::setupSplitter ( QWidget *  rightwidget)

Definition at line 272 of file IVP13DStandardChannelWidget.cxx.

273 {
274  QVBoxLayout * vboxLayout = new QVBoxLayout(channel);
275  vboxLayout->setContentsMargins(0, 0, 0, 0);
276  extradisplaywidget_splitter = new QSplitter(channel);
277  extradisplaywidget_splitter->setObjectName("3DchannelSplitter");
278  extradisplaywidget_splitter->setOrientation(Qt::Horizontal);
279  QWidget * widget_viewer = new QWidget(extradisplaywidget_splitter);
280  widget_viewer->setObjectName("widget_viewer");
281  extradisplaywidget_splitter->addWidget(widget_viewer);
282  rightwidget->setParent(extradisplaywidget_splitter);
283  extradisplaywidget_splitter->addWidget(rightwidget);
284  vboxLayout->addWidget(extradisplaywidget_splitter);
285  viewer = new VP1ExaminerViewer(widget_viewer);
286  widget_viewer->setMinimumSize(min3dx,min3dy);
287  connect(extradisplaywidget_splitter,SIGNAL(splitterMoved (int,int)),channel,SLOT(updateSnapshotDim()));
288 }

◆ updateSystemState()

void IVP13DStandardChannelWidget::Imp::updateSystemState ( QCheckBox *  cb)

Definition at line 376 of file IVP13DStandardChannelWidget.cxx.

377 {
378 
379  assert(checkbox2system.contains(cb));
380  IVP13DSystem*sys = static_cast<IVP13DSystem*>(checkbox2system.value(cb)); assert(sys);
381 
382  assert(system2rootNodes.contains(sys));
383  SoSeparator * sysroot = system2rootNodes.value(sys);
384  int ichild = root->findChild(sysroot);
385  if (cb->isChecked()) {
386  channel->turnOn(sys);
387  if (ichild==-1)
388  root->addChild(sysroot);
389  sysroot->unref();
390  if (tabwidget&&sys2tabpage.contains(sys)) {
391  int sysindex = systemsAllowedControllers.indexOf(sys);
392  if (sysindex>=0) {
393  IVP1System*nextsystem(0);
394  for (int i=sysindex+1;i<systemsAllowedControllers.count();++i) {
395  //Loop through latter systems with controllers in order and
396  //find the first of those which currently has an active
397  //controller:
398  IVP1System* testsys = systemsAllowedControllers.at(i);
399  if (sys2tabpage.contains(testsys)&&tabwidget->indexOf(sys2tabpage[testsys])>-1) {
400  nextsystem=testsys;
401  break;
402  }
403  }
404  //put before tab of "nextsystem" (or at the end if no nextsystem):
405  int index = (nextsystem?tabwidget->indexOf(sys2tabpage[nextsystem]):99999);
406  tabwidget->insertTab(index,sys2tabpage[sys],sys->name());
407  int index2 = tabwidget->indexOf(sys2tabpage[sys]);
408  if (index2!=-1) {
409  tabwidget->setTabEnabled(index2,true);
410  }
411  }
412  }
413  } else {
414  //Fixme: if system being turned off has selections, we should deselect!!
415  channel->turnOff(sys,false);
416  assert(ichild!=-1);
417  sysroot->ref();
418  root->removeChild(ichild);
419  if (tabwidget&&sys2tabpage.contains(sys)) {
420  int index = tabwidget->indexOf(sys2tabpage[sys]);
421  if (index!=-1) {
422  tabwidget->setTabEnabled(index,false);
424  }
425  }
426  }
427 }

Member Data Documentation

◆ channel

IVP13DStandardChannelWidget* IVP13DStandardChannelWidget::Imp::channel

Definition at line 48 of file IVP13DStandardChannelWidget.cxx.

◆ checkbox2system

QMap<QCheckBox*,IVP1System*> IVP13DStandardChannelWidget::Imp::checkbox2system

Definition at line 55 of file IVP13DStandardChannelWidget.cxx.

◆ detectorViewButtons

bool IVP13DStandardChannelWidget::Imp::detectorViewButtons

Definition at line 49 of file IVP13DStandardChannelWidget.cxx.

◆ extradisplaywidget_splitter

QSplitter* IVP13DStandardChannelWidget::Imp::extradisplaywidget_splitter

Definition at line 77 of file IVP13DStandardChannelWidget.cxx.

◆ min3dx

const int IVP13DStandardChannelWidget::Imp::min3dx = 150
static

Definition at line 70 of file IVP13DStandardChannelWidget.cxx.

◆ min3dy

const int IVP13DStandardChannelWidget::Imp::min3dy = 180
static

Definition at line 71 of file IVP13DStandardChannelWidget.cxx.

◆ need_initial_viewall

bool IVP13DStandardChannelWidget::Imp::need_initial_viewall

Definition at line 52 of file IVP13DStandardChannelWidget.cxx.

◆ root

SoSeparator* IVP13DStandardChannelWidget::Imp::root

Definition at line 50 of file IVP13DStandardChannelWidget.cxx.

◆ sys2tabpage

QMap<IVP1System*,QWidget*> IVP13DStandardChannelWidget::Imp::sys2tabpage

Definition at line 74 of file IVP13DStandardChannelWidget.cxx.

◆ system2rootNodes

QMap<IVP13DSystem*,SoSeparator*> IVP13DStandardChannelWidget::Imp::system2rootNodes

Definition at line 53 of file IVP13DStandardChannelWidget.cxx.

◆ system2startdisabled

QMap<IVP1System*,bool> IVP13DStandardChannelWidget::Imp::system2startdisabled

Definition at line 59 of file IVP13DStandardChannelWidget.cxx.

◆ system2switchable

QList<QPair<IVP1System*,bool> > IVP13DStandardChannelWidget::Imp::system2switchable

Definition at line 58 of file IVP13DStandardChannelWidget.cxx.

◆ systemsAllowedCameraList

QList<IVP13DSystem*> IVP13DStandardChannelWidget::Imp::systemsAllowedCameraList

Definition at line 60 of file IVP13DStandardChannelWidget.cxx.

◆ systemsAllowedControllers

QList<IVP1System*> IVP13DStandardChannelWidget::Imp::systemsAllowedControllers

Definition at line 56 of file IVP13DStandardChannelWidget.cxx.

◆ systemsAllowedExtraDisplayWidgets

QList<IVP13DSystem*> IVP13DStandardChannelWidget::Imp::systemsAllowedExtraDisplayWidgets

Definition at line 57 of file IVP13DStandardChannelWidget.cxx.

◆ tabwidget

VP1TabWidget* IVP13DStandardChannelWidget::Imp::tabwidget

Definition at line 75 of file IVP13DStandardChannelWidget.cxx.

◆ uisnapshot

Ui::VP13DStandardChannelSnapShotGroupBox IVP13DStandardChannelWidget::Imp::uisnapshot

Definition at line 64 of file IVP13DStandardChannelWidget.cxx.

◆ viewer

VP1ExaminerViewer* IVP13DStandardChannelWidget::Imp::viewer

Definition at line 51 of file IVP13DStandardChannelWidget.cxx.


The documentation for this class was generated from the following file:
base
std::string base
Definition: hcg.cxx:78
VP1TabWidget::tabText
QString tabText(int) const
Definition: VP1TabWidget.cxx:291
IVP13DStandardChannelWidget::Imp::extradisplaywidget_splitter
QSplitter * extradisplaywidget_splitter
Definition: IVP13DStandardChannelWidget.cxx:77
index
Definition: index.py:1
IVP13DStandardChannelWidget::updateSnapshotDim
void updateSnapshotDim()
Definition: IVP13DStandardChannelWidget.cxx:538
IVP13DStandardChannelWidget::Imp::need_initial_viewall
bool need_initial_viewall
Definition: IVP13DStandardChannelWidget.cxx:52
fillPileUpNoiseLumi.connect
string connect
Definition: fillPileUpNoiseLumi.py:70
IVP13DStandardChannelWidget::Imp::sys2tabpage
QMap< IVP1System *, QWidget * > sys2tabpage
Definition: IVP13DStandardChannelWidget.cxx:74
skel.it
it
Definition: skel.GENtoEVGEN.py:396
VP1QtUtils::expertSettingValue
static QString expertSettingValue(const QString &type, const QString &name)
Definition: VP1QtUtils.cxx:43
IVP13DStandardChannelWidget::Imp::uisnapshot
Ui::VP13DStandardChannelSnapShotGroupBox uisnapshot
Definition: IVP13DStandardChannelWidget.cxx:64
IVP1ChannelWidget::turnOff
void turnOff(IVP1System *, const bool &immediateErase=true)
Definition: IVP1ChannelWidget.cxx:246
mapkey::sys
@ sys
Definition: TElectronEfficiencyCorrectionTool.cxx:42
VP1QtUtils::environmentVariableValue
static QString environmentVariableValue(const QString &name)
Definition: VP1QtUtils.cxx:117
IVP13DStandardChannelWidget::Imp::system2rootNodes
QMap< IVP13DSystem *, SoSeparator * > system2rootNodes
Definition: IVP13DStandardChannelWidget.cxx:53
IVP13DStandardChannelWidget::Imp::root
SoSeparator * root
Definition: IVP13DStandardChannelWidget.cxx:50
IVP1System
Definition: IVP1System.h:36
lumiFormat.i
int i
Definition: lumiFormat.py:85
VP1ExaminerViewer::restoreFromState
virtual void restoreFromState(QByteArray)
Definition: VP1ExaminerViewer.cxx:764
VP1TabWidget::removeTab
virtual void removeTab(int index)
Definition: VP1TabWidget.cxx:473
IVP1ChannelWidget::message
void message(QString)
DeMoScan.runnumber
runnumber
Definition: DeMoScan.py:266
IVP13DStandardChannelWidget::Imp::viewer
VP1ExaminerViewer * viewer
Definition: IVP13DStandardChannelWidget.cxx:51
IVP13DStandardChannelWidget::Imp::checkbox2system
QMap< QCheckBox *, IVP1System * > checkbox2system
Definition: IVP13DStandardChannelWidget.cxx:55
IVP1ChannelWidget::state
State state() const
Definition: IVP1ChannelWidget.cxx:102
Trk::index2
@ index2
Definition: BoundarySurfaceFace.h:49
python.selection.number
number
Definition: selection.py:20
IVP13DStandardChannelWidget::Imp::channel
IVP13DStandardChannelWidget * channel
Definition: IVP13DStandardChannelWidget.cxx:48
VP1Msg::messageVerbose
static void messageVerbose(const QString &)
Definition: VP1Msg.cxx:84
IVP1ChannelWidget::getRunEvtNumber
void getRunEvtNumber(int &runnumber, unsigned long long &eventnumber)
Definition: IVP1ChannelWidget.cxx:255
Base_Fragment.width
width
Definition: Sherpa_i/share/common/Base_Fragment.py:59
IVP13DStandardChannelWidget::Imp::tabwidget
VP1TabWidget * tabwidget
Definition: IVP13DStandardChannelWidget.cxx:75
IVP13DSystem
Definition: IVP13DSystem.h:31
IVP1ChannelWidget::name
const QString & name() const
Definition: IVP1ChannelWidget.cxx:180
python.dummyaccess.exists
def exists(filename)
Definition: dummyaccess.py:9
IVP13DStandardChannelWidget::Imp::min3dx
static const int min3dx
Definition: IVP13DStandardChannelWidget.cxx:70
IVP1ChannelWidget::turnOn
void turnOn(IVP1System *)
Definition: IVP1ChannelWidget.cxx:237
IVP13DStandardChannelWidget::getSnapshot
virtual QPixmap getSnapshot(bool transp=false, int width=0, bool batch=false)
Definition: IVP13DStandardChannelWidget.cxx:443
IVP13DStandardChannelWidget::Imp::systemsAllowedControllers
QList< IVP1System * > systemsAllowedControllers
Definition: IVP13DStandardChannelWidget.cxx:56
VP1ExaminerViewer
Definition: VP1ExaminerViewer.h:30
IVP13DStandardChannelWidget::Imp::min3dy
static const int min3dy
Definition: IVP13DStandardChannelWidget.cxx:71