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

Public Member Functions

void emit_basename_availableChannelListChanged ()
 
void emit_basename_availableUnusedChannelListChanged ()
 
IVP1ChannelWidgetconstructChannel (QString channelbasename, QString &err, bool init=true)
 
QString channelTypeToIconLocation (const IVP1ChannelWidget::Type &type) const
 

Public Attributes

VP1ChannelManagerchannelmanager
 
VP1ExecutionSchedulerscheduler
 
VP1MainWindowmainwindow
 
std::map< QString, std::set< IVP1ChannelWidget * > > basename_2_channels
 
std::map< QString, IVP1ChannelWidget * > uniquename_2_channel
 
std::map< QString, std::pair< QStringList, IVP1ChannelWidgetFactory * > > pluginfile_2_basenamesAndFactory
 
std::map< QString, QString > basename_2_pluginfile
 
std::map< QString, QPluginLoader * > pluginfile_2_pluginloader
 
QList< QObject * > additionalOwnedObjects
 
std::map< IVP1ChannelWidget *, QWidget * > channel_2_controller
 
QMap< QString, QString > basename2iconlocation
 

Detailed Description

Definition at line 73 of file VP1ChannelManager.cxx.

Member Function Documentation

◆ channelTypeToIconLocation()

QString VP1ChannelManager::Imp::channelTypeToIconLocation ( const IVP1ChannelWidget::Type type) const

Definition at line 570 of file VP1ChannelManager.cxx.

571 {
572  if (type==IVP1ChannelWidget::THREEDIMENSIONAL) return ":/vp1/icons/icons/3d_32x32.png";
573  if (type==IVP1ChannelWidget::TWODIMENSIONAL) return ":/vp1/icons/icons/kivio_32x32.png";//Fixme: Better icon.
574  if (type==IVP1ChannelWidget::NUMBERS) return ":/vp1/icons/icons/kcalc_32x32.png";
575  if (type==IVP1ChannelWidget::HISTOGRAM) return ":/vp1/icons/icons/kchart_32x32.png";
576  if (type==IVP1ChannelWidget::UNKNOWN) return ":/vp1/icons/icons/help_32x32.png";
577  return "";
578 }

◆ constructChannel()

IVP1ChannelWidget * VP1ChannelManager::Imp::constructChannel ( QString  channelbasename,
QString &  err,
bool  init = true 
)

Definition at line 365 of file VP1ChannelManager.cxx.

365  {
366  if (basename_2_pluginfile.find(channelbasename)==basename_2_pluginfile.end()) {
367  err = "Did not find plugin providing channel named '"+channelbasename+"'";
368  return 0;
369  }
370  QString plf = basename_2_pluginfile[channelbasename];
371  //sanity:
372  assert(pluginfile_2_basenamesAndFactory.find(plf)!=pluginfile_2_basenamesAndFactory.end()&&"This should never happen!");
373  assert(pluginfile_2_basenamesAndFactory[plf].first.contains(channelbasename)&&"This should never happen!");
374  IVP1ChannelWidget * cw = pluginfile_2_basenamesAndFactory[plf].second->getChannelWidget(channelbasename);
375  if (!cw) {
376  err = "Plugin file '"+plf+"' did not provide channel navp1 '"+channelbasename+"' despite advertising this capability!";
377  return 0;
378  } else {
379  err="";
380  }
381 
382  if (channelbasename!=cw->name()) {
383  err = "Actual basename of channel widget constructed by factory is not the one requested: '"+cw->name()
384  +"' vs. '"+channelbasename+"'. This is most likely due to a mistake in the plugin!!";
385  delete cw;
386  return 0;
387  }
388 
389  //Cache the icon associated with this channel for future use (and override if there is already a cache):
390  QString icontext = channelTypeToIconLocation(cw->type());
391  basename2iconlocation[cw->name()]=icontext;
392 
393  if (init)
394  cw->init();
395 
396  //Sanity: should not have controller registered:
397  assert(channel_2_controller.find(cw)==channel_2_controller.end());
398 
399  return cw;
400 }

◆ emit_basename_availableChannelListChanged()

void VP1ChannelManager::Imp::emit_basename_availableChannelListChanged ( )

Definition at line 485 of file VP1ChannelManager.cxx.

485  {
486  QStringList l;
487 
488  std::map<QString,QString>::const_iterator it = basename_2_pluginfile.begin();
489  std::map<QString,QString>::const_iterator itE = basename_2_pluginfile.end();
490  for (;it!=itE;++it) {
491  l << it->first;
492  }
494 
495 }

◆ emit_basename_availableUnusedChannelListChanged()

void VP1ChannelManager::Imp::emit_basename_availableUnusedChannelListChanged ( )

Definition at line 509 of file VP1ChannelManager.cxx.

509  {
510  QStringList l;
511 
512  std::map<QString,QString>::const_iterator it = basename_2_pluginfile.begin();
513  std::map<QString,QString>::const_iterator itE = basename_2_pluginfile.end();
514  for (;it!=itE;++it) {
515  if (channelmanager->nActive(it->first)==0)
516  l << it->first;
517  }
518 
520 }

Member Data Documentation

◆ additionalOwnedObjects

QList<QObject*> VP1ChannelManager::Imp::additionalOwnedObjects

Definition at line 90 of file VP1ChannelManager.cxx.

◆ basename2iconlocation

QMap<QString,QString> VP1ChannelManager::Imp::basename2iconlocation

Definition at line 95 of file VP1ChannelManager.cxx.

◆ basename_2_channels

std::map<QString,std::set<IVP1ChannelWidget*> > VP1ChannelManager::Imp::basename_2_channels

Definition at line 82 of file VP1ChannelManager.cxx.

◆ basename_2_pluginfile

std::map<QString,QString> VP1ChannelManager::Imp::basename_2_pluginfile

Definition at line 87 of file VP1ChannelManager.cxx.

◆ channel_2_controller

std::map<IVP1ChannelWidget*,QWidget*> VP1ChannelManager::Imp::channel_2_controller

Definition at line 94 of file VP1ChannelManager.cxx.

◆ channelmanager

VP1ChannelManager* VP1ChannelManager::Imp::channelmanager

Definition at line 77 of file VP1ChannelManager.cxx.

◆ mainwindow

VP1MainWindow* VP1ChannelManager::Imp::mainwindow

Definition at line 79 of file VP1ChannelManager.cxx.

◆ pluginfile_2_basenamesAndFactory

std::map<QString,std::pair<QStringList,IVP1ChannelWidgetFactory *> > VP1ChannelManager::Imp::pluginfile_2_basenamesAndFactory

Definition at line 86 of file VP1ChannelManager.cxx.

◆ pluginfile_2_pluginloader

std::map<QString,QPluginLoader*> VP1ChannelManager::Imp::pluginfile_2_pluginloader

Definition at line 88 of file VP1ChannelManager.cxx.

◆ scheduler

VP1ExecutionScheduler* VP1ChannelManager::Imp::scheduler

Definition at line 78 of file VP1ChannelManager.cxx.

◆ uniquename_2_channel

std::map<QString,IVP1ChannelWidget*> VP1ChannelManager::Imp::uniquename_2_channel

Definition at line 83 of file VP1ChannelManager.cxx.


The documentation for this class was generated from the following file:
IVP1ChannelWidget::TWODIMENSIONAL
@ TWODIMENSIONAL
Definition: IVP1ChannelWidget.h:46
skel.it
it
Definition: skel.GENtoEVGEN.py:423
VP1ChannelManager::nActive
unsigned nActive(QString channelbasename) const
Definition: VP1ChannelManager.cxx:446
VP1ChannelManager::Imp::channel_2_controller
std::map< IVP1ChannelWidget *, QWidget * > channel_2_controller
Definition: VP1ChannelManager.cxx:94
IVP1ChannelWidget::type
virtual Type type() const =0
IVP1ChannelWidget::NUMBERS
@ NUMBERS
Definition: IVP1ChannelWidget.h:46
UploadAMITag.l
list l
Definition: UploadAMITag.larcaf.py:158
IVP1ChannelWidget::HISTOGRAM
@ HISTOGRAM
Definition: IVP1ChannelWidget.h:46
VP1ChannelManager::Imp::basename_2_pluginfile
std::map< QString, QString > basename_2_pluginfile
Definition: VP1ChannelManager.cxx:87
TruthTest.itE
itE
Definition: TruthTest.py:25
VP1ChannelManager::Imp::channelmanager
VP1ChannelManager * channelmanager
Definition: VP1ChannelManager.cxx:77
VP1ChannelManager::Imp::channelTypeToIconLocation
QString channelTypeToIconLocation(const IVP1ChannelWidget::Type &type) const
Definition: VP1ChannelManager.cxx:570
VP1ChannelManager::availableChannelListChanged
void availableChannelListChanged(QStringList)
IVP1ChannelWidget::UNKNOWN
@ UNKNOWN
Definition: IVP1ChannelWidget.h:46
dqt_zlumi_pandas.err
err
Definition: dqt_zlumi_pandas.py:193
IVP1ChannelWidget::init
virtual void init()=0
VP1ChannelManager::Imp::pluginfile_2_basenamesAndFactory
std::map< QString, std::pair< QStringList, IVP1ChannelWidgetFactory * > > pluginfile_2_basenamesAndFactory
Definition: VP1ChannelManager.cxx:86
IVP1ChannelWidget
Definition: IVP1ChannelWidget.h:34
VP1ChannelManager::availableUnusedChannelListChanged
void availableUnusedChannelListChanged(QStringList)
python.PyKernel.init
def init(v_theApp, v_rootStream=None)
Definition: PyKernel.py:45
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
DeMoScan.first
bool first
Definition: DeMoScan.py:534
VP1ChannelManager::Imp::basename2iconlocation
QMap< QString, QString > basename2iconlocation
Definition: VP1ChannelManager.cxx:95
IVP1ChannelWidget::name
const QString & name() const
Definition: IVP1ChannelWidget.cxx:180
IVP1ChannelWidget::THREEDIMENSIONAL
@ THREEDIMENSIONAL
Definition: IVP1ChannelWidget.h:46