CFEL - ASG Software Suite
2.5.0
CASS
|
singleton class to manage the available data sources More...
#include <data_source_manager.h>
Signals | |
void | sourceChanged (QString newSource) |
signal when a new source was chosen More... | |
Static Public Member Functions | |
static DataSourceManager * | instance () |
generate an instance of this, if not already existent More... | |
static DataSource * | source (const QString &sourcename=QString()) |
retrieve an available source More... | |
static QString | currentSourceName () |
return the current source name More... | |
static QStringList | sourceNames () |
retrieve the names of all current active sources More... | |
static void | setMenu (QMenu *menu) |
set the Menu where the data sources will be displayed in More... | |
static void | addSource (const QString &sourcename, DataSource *source, bool setActive=true) |
add a data source More... | |
Private Member Functions | |
DataSourceManager () | |
constructor More... | |
DataSourceManager (const DataSourceManager &) | |
copy constructor More... | |
DataSourceManager & | operator= (const DataSourceManager &) |
self assignment More... | |
Private Attributes | |
QMap< QString, DataSource * > | _sources |
container for all data sources More... | |
QMenu * | _sourceMenu |
the source menu More... | |
QActionGroup * | _actionGroup |
the action group where the menue items will be grouped More... | |
QSignalMapper * | _mapper |
mapper for the signals of the signal group More... | |
Static Private Attributes | |
static DataSourceManager * | _instance |
an instane of this More... | |
Additional Inherited Members | |
![]() | |
QObject (QObject *parent=0) | |
blockSignals (bool block) | |
childEvent (QChildEvent *event) | |
children () | |
connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type=Qt::AutoConnection) | |
connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type=Qt::AutoConnection) | |
connectNotify (const char *signal) | |
customEvent (QEvent *event) | |
deleteLater () | |
destroyed (QObject *obj=0) | |
disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method) | |
disconnect (const char *signal=0, const QObject *receiver=0, const char *method=0) | |
disconnect (const QObject *receiver, const char *method=0) | |
disconnectNotify (const char *signal) | |
dumpObjectInfo () | |
dumpObjectTree () | |
dynamicPropertyNames () | |
event (QEvent *e) | |
eventFilter (QObject *watched, QEvent *event) | |
findChild (const QString &name=QString() | |
findChildren (const QString &name=QString() | |
findChildren (const QRegExp ®Exp) | |
inherits (const char *className) | |
installEventFilter (QObject *filterObj) | |
isWidgetType () | |
killTimer (int id) | |
metaObject () | |
moveToThread (QThread *targetThread) | |
parent () | |
property (const char *name) | |
receivers (const char *signal) | |
removeEventFilter (QObject *obj) | |
sender () | |
setParent (QObject *parent) | |
setProperty (const char *name, const QVariant &value) | |
signalsBlocked () | |
startTimer (int interval) | |
thread () | |
timerEvent (QTimerEvent *event) | |
tr (const char *sourceText, const char *disambiguation=0, int n=-1) | |
trUtf8 (const char *sourceText, const char *disambiguation=0, int n=-1) | |
staticMetaObject | |
singleton class to manage the available data sources
Definition at line 28 of file data_source_manager.h.
|
private |
|
private |
copy constructor
|
static |
add a data source
the added source will be set as the current active source
sourcename | the name of the data source that should be added |
source | the data source that should be added |
setActive | Set added source as the current active one and emit the signal that a new source has been |
Definition at line 79 of file data_source_manager.cpp.
References _actionGroup, _mapper, _sourceMenu, _sources, QMenu::addAction(), QActionGroup::addAction(), QObject::connect(), instance(), map, QSignalMapper::setMapping(), source(), and sourceChanged().
Referenced by jocassview::JoCASSViewer::JoCASSViewer(), jocassview::OneDViewer::on_add_graph_triggered(), and jocassview::JoCASSViewer::openFile().
|
static |
return the current source name
Definition at line 56 of file data_source_manager.cpp.
References _actionGroup, QActionGroup::checkedAction(), and instance().
Referenced by jocassview::OneDViewer::on_add_graph_triggered(), source(), and jocassview::JoCASSViewer::updateViewers().
|
static |
generate an instance of this, if not already existent
Definition at line 36 of file data_source_manager.cpp.
References _instance, and DataSourceManager().
Referenced by addSource(), currentSourceName(), jocassview::JoCASSViewer::JoCASSViewer(), setMenu(), source(), and sourceNames().
|
private |
self assignment
|
static |
set the Menu where the data sources will be displayed in
menu | the menu that displays the available data sources |
Definition at line 70 of file data_source_manager.cpp.
References _actionGroup, _mapper, _sourceMenu, QObject::connect(), instance(), and sourceChanged().
Referenced by jocassview::JoCASSViewer::JoCASSViewer().
|
static |
retrieve an available source
if no name of the source is given the current active one will be returned If no are available or the requested doesn't exist a 0 pointer will be returned
sourcename | the name of the requested source |
Definition at line 46 of file data_source_manager.cpp.
References _sources, currentSourceName(), instance(), and QString::isEmpty().
Referenced by addSource(), jocassview::JoCASSViewer::broadcastDarkcalCommand(), jocassview::JoCASSViewer::broadcastGaincalCommand(), jocassview::JoCASSViewer::changeServerAddress(), jocassview::JoCASSViewer::clearHistogram(), jocassview::OneDViewer::on_add_graph_triggered(), jocassview::JoCASSViewer::refreshDisplayableItemsList(), jocassview::JoCASSViewer::sendCustomCommand(), and jocassview::JoCASSViewer::updateViewers().
|
signal |
signal when a new source was chosen
newSource | the name of the new source |
Referenced by addSource(), and setMenu().
|
static |
retrieve the names of all current active sources
Definition at line 65 of file data_source_manager.cpp.
References _sources, and instance().
Referenced by jocassview::OneDViewer::on_add_graph_triggered().
|
private |
the action group where the menue items will be grouped
Definition at line 107 of file data_source_manager.h.
Referenced by addSource(), currentSourceName(), and setMenu().
|
staticprivate |
|
private |
mapper for the signals of the signal group
Definition at line 110 of file data_source_manager.h.
Referenced by addSource(), and setMenu().
|
private |
the source menu
Definition at line 104 of file data_source_manager.h.
Referenced by addSource(), and setMenu().
|
private |
container for all data sources
Definition at line 101 of file data_source_manager.h.
Referenced by addSource(), source(), and sourceNames().