Mantid
|
This class defines a widget for selecting a workspace present in the AnalysisDataService. More...
#include <WorkspaceSelector.h>
Signals | |
void | emptied () |
void | focussed () |
Public Member Functions | |
void | connectObservers () |
Subscribes this object to the Poco NotificationCentre. More... | |
void | disconnectObservers () |
De-subscribes this object from the Poco NotificationCentre. More... | |
QStringList | getSuffixes () const |
QString | getValidatingAlgorithm () const |
QStringList | getWorkspaceTypes () const |
bool | isConnected () const |
bool | isOptional () const |
bool | isSorted () const |
bool | isValid () const |
void | refresh () |
void | setLowerBinLimit (int numberOfBins) |
void | setOptional (bool optional) |
void | setSorted (bool sorted) |
void | setSuffixes (const QStringList &suffix) |
void | setUpperBinLimit (int numberOfBins) |
void | setValidatingAlgorithm (const QString &algName) |
void | setWorkspaceTypes (const QStringList &types) |
bool | showHiddenWorkspaces () const |
void | showHiddenWorkspaces (bool show) |
bool | showWorkspaceGroups () const |
void | showWorkspaceGroups (bool show) |
WorkspaceSelector (QWidget *parent=nullptr, bool init=true) | |
Default Constructor. More... | |
~WorkspaceSelector () override | |
Destructor. More... | |
Protected Member Functions | |
void | dragEnterEvent (QDragEnterEvent *) override |
Called when an item is dragged onto a control. More... | |
void | dropEvent (QDropEvent *) override |
Called when an item is dropped. More... | |
void | focusInEvent (QFocusEvent *) override |
Called when there is an interaction with the widget. More... | |
Properties | |
QString | Algorithm |
bool | Optional |
bool | ShowGroups |
bool | ShowHidden |
bool | Sorted |
QStringList | Suffix |
QStringList | WorkspaceTypes |
Private Member Functions | |
bool | checkEligibility (const QString &name, const Mantid::API::Workspace_sptr &object) const |
void | handleAddEvent (Mantid::API::WorkspaceAddNotification_ptr pNf) |
void | handleClearEvent (Mantid::API::ClearADSNotification_ptr pNf) |
void | handleRemEvent (Mantid::API::WorkspacePostDeleteNotification_ptr pNf) |
void | handleRenameEvent (Mantid::API::WorkspaceRenameNotification_ptr pNf) |
void | handleReplaceEvent (Mantid::API::WorkspaceAfterReplaceNotification_ptr pNf) |
bool | hasValidNumberOfBins (const Mantid::API::Workspace_sptr &object) const |
bool | hasValidSuffix (const QString &name) const |
Friends | |
class | DataSelector |
This class defines a widget for selecting a workspace present in the AnalysisDataService.
Subscribes to the WorkspaceAddNotification and WorkspaceDeleteNotification from the ADS.
Types of workspace to show can be restricted in several ways:
By listing allowed WorkspaceIDs to show (Workspace2D, TableWorkspace, etc) By deciding whether or not to show "hidden" workspaces (identified with a double underscore at the start of the workspace name By providing a suffix that the workspace name must have By giving the name of an algorithm, each workspace will be validated as an input to the workspaces first input WorkspaceProperty
Definition at line 47 of file WorkspaceSelector.h.
WorkspaceSelector::WorkspaceSelector | ( | QWidget * | parent = nullptr , |
bool | init = true |
||
) |
Default Constructor.
Default constructor.
parent | :: A widget to act as this widget's parent (default = NULL) |
init | :: If true then the widget will make calls to the framework (default = true) |
Definition at line 35 of file WorkspaceSelector.cpp.
References connectObservers().
|
override |
Destructor.
Destructor for WorkspaceSelector De-subscribes this object from the Poco NotificationCentre.
Definition at line 56 of file WorkspaceSelector.cpp.
References disconnectObservers().
|
private |
Definition at line 275 of file WorkspaceSelector.cpp.
References hasValidNumberOfBins(), hasValidSuffix(), m_algorithm, m_algPropName, m_showGroups, and m_workspaceTypes.
Referenced by handleAddEvent(), handleRenameEvent(), handleReplaceEvent(), and refresh().
void WorkspaceSelector::connectObservers | ( | ) |
Subscribes this object to the Poco NotificationCentre.
Definition at line 76 of file WorkspaceSelector.cpp.
References Mantid::Kernel::SingletonHolder< T >::Instance(), m_addObserver, m_clearObserver, m_connected, m_init, m_remObserver, m_renameObserver, m_replaceObserver, Mantid::Kernel::DataService< T >::notificationCenter, and refresh().
Referenced by WorkspaceSelector().
void WorkspaceSelector::disconnectObservers | ( | ) |
De-subscribes this object from the Poco NotificationCentre.
Definition at line 61 of file WorkspaceSelector.cpp.
References Mantid::Kernel::SingletonHolder< T >::Instance(), m_addObserver, m_clearObserver, m_connected, m_init, m_remObserver, m_renameObserver, and m_replaceObserver.
Referenced by ~WorkspaceSelector().
|
overrideprotected |
Called when an item is dragged onto a control.
de | :: the drag event data package |
Definition at line 374 of file WorkspaceSelector.cpp.
References m_adsMutex.
|
overrideprotected |
Called when an item is dropped.
de | :: the drop event data package |
Definition at line 353 of file WorkspaceSelector.cpp.
References index, and m_adsMutex.
|
signal |
Referenced by handleClearEvent(), and handleRemEvent().
|
overrideprotected |
Called when there is an interaction with the widget.
Definition at line 387 of file WorkspaceSelector.cpp.
References focussed().
|
signal |
Referenced by focusInEvent().
QStringList WorkspaceSelector::getSuffixes | ( | ) | const |
Definition at line 145 of file WorkspaceSelector.cpp.
References m_suffix.
QString WorkspaceSelector::getValidatingAlgorithm | ( | ) | const |
Definition at line 160 of file WorkspaceSelector.cpp.
References m_algName.
QStringList WorkspaceSelector::getWorkspaceTypes | ( | ) | const |
Definition at line 88 of file WorkspaceSelector.cpp.
References m_workspaceTypes.
|
private |
Definition at line 185 of file WorkspaceSelector.cpp.
References addItem(), checkEligibility(), Mantid::Kernel::SingletonHolder< T >::Instance(), isSorted(), m_adsMutex, and showHiddenWorkspaces().
|
private |
Definition at line 213 of file WorkspaceSelector.cpp.
References addItem(), emptied(), m_adsMutex, and m_optional.
|
private |
Definition at line 201 of file WorkspaceSelector.cpp.
References emptied(), index, m_adsMutex, and removeItem().
|
private |
Definition at line 221 of file WorkspaceSelector.cpp.
References addItem(), checkEligibility(), index, Mantid::Kernel::SingletonHolder< T >::Instance(), isSorted(), m_adsMutex, and removeItem().
|
private |
Definition at line 251 of file WorkspaceSelector.cpp.
References addItem(), checkEligibility(), index, Mantid::Kernel::SingletonHolder< T >::Instance(), isSorted(), m_adsMutex, and removeItem().
|
private |
Definition at line 311 of file WorkspaceSelector.cpp.
References m_binLimits, and workspace.
Referenced by checkEligibility().
|
private |
Definition at line 297 of file WorkspaceSelector.cpp.
References m_suffix.
Referenced by checkEligibility().
bool WorkspaceSelector::isConnected | ( | ) | const |
Definition at line 143 of file WorkspaceSelector.cpp.
References m_connected.
bool WorkspaceSelector::isOptional | ( | ) | const |
Definition at line 123 of file WorkspaceSelector.cpp.
References m_optional.
bool WorkspaceSelector::isSorted | ( | ) | const |
Definition at line 133 of file WorkspaceSelector.cpp.
References m_sorted.
Referenced by handleAddEvent(), handleRenameEvent(), handleReplaceEvent(), and refresh().
bool WorkspaceSelector::isValid | ( | ) | const |
Definition at line 121 of file WorkspaceSelector.cpp.
void WorkspaceSelector::refresh | ( | ) |
Definition at line 323 of file WorkspaceSelector.cpp.
References addItem(), checkEligibility(), Mantid::Kernel::Include, Mantid::Kernel::SingletonHolder< T >::Instance(), isSorted(), m_adsMutex, m_optional, showHiddenWorkspaces(), and Mantid::Kernel::Sorted.
Referenced by connectObservers(), setOptional(), setSorted(), setSuffixes(), setValidatingAlgorithm(), setWorkspaceTypes(), showHiddenWorkspaces(), and showWorkspaceGroups().
void WorkspaceSelector::setLowerBinLimit | ( | int | numberOfBins | ) |
Definition at line 156 of file WorkspaceSelector.cpp.
References m_binLimits.
void WorkspaceSelector::setOptional | ( | bool | optional | ) |
Definition at line 125 of file WorkspaceSelector.cpp.
References m_init, m_optional, and refresh().
void WorkspaceSelector::setSorted | ( | bool | sorted | ) |
Definition at line 135 of file WorkspaceSelector.cpp.
void WorkspaceSelector::setSuffixes | ( | const QStringList & | suffix | ) |
Definition at line 147 of file WorkspaceSelector.cpp.
void WorkspaceSelector::setUpperBinLimit | ( | int | numberOfBins | ) |
Definition at line 158 of file WorkspaceSelector.cpp.
References m_binLimits.
void WorkspaceSelector::setValidatingAlgorithm | ( | const QString & | algName | ) |
Definition at line 162 of file WorkspaceSelector.cpp.
References Mantid::Kernel::Direction::Input, Mantid::Kernel::SingletonHolder< T >::Instance(), m_algName, m_algorithm, m_algPropName, m_init, and refresh().
void WorkspaceSelector::setWorkspaceTypes | ( | const QStringList & | types | ) |
Definition at line 90 of file WorkspaceSelector.cpp.
References m_init, m_workspaceTypes, and refresh().
bool WorkspaceSelector::showHiddenWorkspaces | ( | ) | const |
Definition at line 99 of file WorkspaceSelector.cpp.
References m_showHidden.
Referenced by handleAddEvent(), and refresh().
void WorkspaceSelector::showHiddenWorkspaces | ( | bool | show | ) |
Definition at line 101 of file WorkspaceSelector.cpp.
References m_init, m_showHidden, and refresh().
bool WorkspaceSelector::showWorkspaceGroups | ( | ) | const |
Definition at line 110 of file WorkspaceSelector.cpp.
References m_showGroups.
void WorkspaceSelector::showWorkspaceGroups | ( | bool | show | ) |
Definition at line 112 of file WorkspaceSelector.cpp.
References m_init, m_showGroups, and refresh().
|
friend |
Definition at line 57 of file WorkspaceSelector.h.
|
private |
Poco Observers for ADS Notifications.
Definition at line 114 of file WorkspaceSelector.h.
Referenced by connectObservers(), and disconnectObservers().
|
private |
Definition at line 143 of file WorkspaceSelector.h.
Referenced by dragEnterEvent(), dropEvent(), handleAddEvent(), handleClearEvent(), handleRemEvent(), handleRenameEvent(), handleReplaceEvent(), and refresh().
|
private |
Definition at line 136 of file WorkspaceSelector.h.
Referenced by getValidatingAlgorithm(), and setValidatingAlgorithm().
|
private |
Definition at line 140 of file WorkspaceSelector.h.
Referenced by checkEligibility(), and setValidatingAlgorithm().
|
private |
Definition at line 137 of file WorkspaceSelector.h.
Referenced by checkEligibility(), and setValidatingAlgorithm().
|
private |
Allows you to put limits on the size of the workspace i.e. number of bins.
Definition at line 134 of file WorkspaceSelector.h.
Referenced by hasValidNumberOfBins(), setLowerBinLimit(), and setUpperBinLimit().
|
private |
Definition at line 116 of file WorkspaceSelector.h.
Referenced by connectObservers(), and disconnectObservers().
|
private |
Definition at line 121 of file WorkspaceSelector.h.
Referenced by connectObservers(), disconnectObservers(), and isConnected().
|
private |
Definition at line 120 of file WorkspaceSelector.h.
Referenced by connectObservers(), disconnectObservers(), setOptional(), setSorted(), setSuffixes(), setValidatingAlgorithm(), setWorkspaceTypes(), showHiddenWorkspaces(), and showWorkspaceGroups().
|
private |
Whether to add an extra empty entry to the combobox.
Definition at line 130 of file WorkspaceSelector.h.
Referenced by handleClearEvent(), isOptional(), refresh(), and setOptional().
|
private |
Definition at line 115 of file WorkspaceSelector.h.
Referenced by connectObservers(), and disconnectObservers().
|
private |
Definition at line 117 of file WorkspaceSelector.h.
Referenced by connectObservers(), and disconnectObservers().
|
private |
Definition at line 118 of file WorkspaceSelector.h.
Referenced by connectObservers(), and disconnectObservers().
|
private |
Definition at line 128 of file WorkspaceSelector.h.
Referenced by checkEligibility(), and showWorkspaceGroups().
|
private |
Whether to show "hidden" workspaces.
Definition at line 126 of file WorkspaceSelector.h.
Referenced by showHiddenWorkspaces().
|
private |
Whetherthe combobox model should be kept sorted.
Definition at line 132 of file WorkspaceSelector.h.
Referenced by isSorted(), and setSorted().
|
private |
Definition at line 135 of file WorkspaceSelector.h.
Referenced by getSuffixes(), hasValidSuffix(), and setSuffixes().
|
private |
A list of workspace types that should be shown in the ComboBox.
Definition at line 124 of file WorkspaceSelector.h.
Referenced by checkEligibility(), getWorkspaceTypes(), and setWorkspaceTypes().
|
readwrite |
Definition at line 47 of file WorkspaceSelector.h.
|
readwrite |
Definition at line 47 of file WorkspaceSelector.h.
|
readwrite |
Definition at line 47 of file WorkspaceSelector.h.
|
readwrite |
Definition at line 47 of file WorkspaceSelector.h.
|
readwrite |
Definition at line 47 of file WorkspaceSelector.h.
|
readwrite |
Definition at line 47 of file WorkspaceSelector.h.
|
readwrite |
Definition at line 47 of file WorkspaceSelector.h.