ATLAS Offline Software
Loading...
Searching...
No Matches
VP1ChannelManager::Imp Class Reference
Collaboration diagram for VP1ChannelManager::Imp:

Public Member Functions

void emit_basename_availableChannelListChanged ()
void emit_basename_availableUnusedChannelListChanged ()
IVP1ChannelWidgetconstructChannel (const 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 ( const 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()]=std::move(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}
virtual Type type() const =0
virtual void init()=0
const QString & name() const
std::map< QString, std::pair< QStringList, IVP1ChannelWidgetFactory * > > pluginfile_2_basenamesAndFactory
QString channelTypeToIconLocation(const IVP1ChannelWidget::Type &type) const
std::map< IVP1ChannelWidget *, QWidget * > channel_2_controller
QMap< QString, QString > basename2iconlocation
std::map< QString, QString > basename_2_pluginfile
bool first
Definition DeMoScan.py:534

◆ 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 }
493 channelmanager->availableChannelListChanged(l);
494
495}
VP1ChannelManager * channelmanager
l
Printing final latex table to .tex output file.

◆ 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
519 channelmanager->availableUnusedChannelListChanged(l);
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: