|
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. | |
| void | disconnectObservers () |
| De-subscribes this object from the Poco NotificationCentre. | |
| const QStringList & | getSuffixes () const |
| const QString & | getValidatingAlgorithm () const |
| const QStringList & | getWorkspaceTypes () const |
| bool | isConnected () const |
| bool | isOptional () const |
| bool | isSorted () const |
| bool | isValid () const |
| WorkspaceSelector & | operator= (const WorkspaceSelector &)=delete |
| 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 (const WorkspaceSelector &)=delete | |
| WorkspaceSelector (QWidget *parent=nullptr, bool init=true) | |
| Default Constructor. | |
| ~WorkspaceSelector () override | |
| Destructor. | |
Protected Member Functions | |
| void | dragEnterEvent (QDragEnterEvent *) override |
| Called when an item is dragged onto a control. | |
| void | dropEvent (QDropEvent *) override |
| Called when an item is dropped. | |
| void | focusInEvent (QFocusEvent *) override |
| Called when there is an interaction with the widget. | |
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 34 of file WorkspaceSelector.cpp.
References connectObservers().
|
override |
Destructor.
Destructor for WorkspaceSelector De-subscribes this object from the Poco NotificationCentre.
Definition at line 55 of file WorkspaceSelector.cpp.
References disconnectObservers().
|
delete |
|
private |
Definition at line 274 of file WorkspaceSelector.cpp.
References group, hasValidNumberOfBins(), hasValidSuffix(), m_algorithm, m_algPropName, m_showGroups, m_workspaceTypes, and name.
Referenced by handleAddEvent(), handleRenameEvent(), handleReplaceEvent(), and refresh().
| void WorkspaceSelector::connectObservers | ( | ) |
Subscribes this object to the Poco NotificationCentre.
Definition at line 75 of file WorkspaceSelector.cpp.
References 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 60 of file WorkspaceSelector.cpp.
References 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 373 of file WorkspaceSelector.cpp.
References m_adsMutex.
|
overrideprotected |
Called when an item is dropped.
| de | :: the drop event data package |
Definition at line 352 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 386 of file WorkspaceSelector.cpp.
References focussed().
|
signal |
Referenced by focusInEvent().
| const QStringList & WorkspaceSelector::getSuffixes | ( | ) | const |
Definition at line 144 of file WorkspaceSelector.cpp.
References m_suffix.
| const QString & WorkspaceSelector::getValidatingAlgorithm | ( | ) | const |
Definition at line 159 of file WorkspaceSelector.cpp.
References m_algName.
| const QStringList & WorkspaceSelector::getWorkspaceTypes | ( | ) | const |
Definition at line 87 of file WorkspaceSelector.cpp.
References m_workspaceTypes.
|
private |
Definition at line 184 of file WorkspaceSelector.cpp.
References addItem(), checkEligibility(), isSorted(), m_adsMutex, name, and showHiddenWorkspaces().
|
private |
Definition at line 212 of file WorkspaceSelector.cpp.
References addItem(), emptied(), m_adsMutex, and m_optional.
|
private |
Definition at line 200 of file WorkspaceSelector.cpp.
References emptied(), index, m_adsMutex, name, and removeItem().
|
private |
Definition at line 220 of file WorkspaceSelector.cpp.
References addItem(), checkEligibility(), index, isSorted(), m_adsMutex, name, and removeItem().
|
private |
Definition at line 250 of file WorkspaceSelector.cpp.
References addItem(), checkEligibility(), index, isSorted(), m_adsMutex, name, and removeItem().
|
private |
Definition at line 310 of file WorkspaceSelector.cpp.
References m_binLimits, and workspace.
Referenced by checkEligibility().
|
private |
Definition at line 296 of file WorkspaceSelector.cpp.
References m_suffix, and name.
Referenced by checkEligibility().
| bool WorkspaceSelector::isConnected | ( | ) | const |
Definition at line 142 of file WorkspaceSelector.cpp.
References m_connected.
| bool WorkspaceSelector::isOptional | ( | ) | const |
Definition at line 122 of file WorkspaceSelector.cpp.
References m_optional.
| bool WorkspaceSelector::isSorted | ( | ) | const |
Definition at line 132 of file WorkspaceSelector.cpp.
References m_sorted.
Referenced by handleAddEvent(), handleRenameEvent(), handleReplaceEvent(), and refresh().
| bool WorkspaceSelector::isValid | ( | ) | const |
Definition at line 120 of file WorkspaceSelector.cpp.
|
delete |
| void WorkspaceSelector::refresh | ( | ) |
Definition at line 322 of file WorkspaceSelector.cpp.
References addItem(), checkEligibility(), Mantid::Kernel::Include, isSorted(), m_adsMutex, m_optional, name, showHiddenWorkspaces(), and Mantid::Kernel::Sorted.
Referenced by connectObservers(), setOptional(), setSorted(), setSuffixes(), setValidatingAlgorithm(), setWorkspaceTypes(), showHiddenWorkspaces(), and showWorkspaceGroups().
| void WorkspaceSelector::setLowerBinLimit | ( | int | numberOfBins | ) |
Definition at line 155 of file WorkspaceSelector.cpp.
References m_binLimits.
| void WorkspaceSelector::setOptional | ( | bool | optional | ) |
Definition at line 124 of file WorkspaceSelector.cpp.
References m_init, m_optional, and refresh().
| void WorkspaceSelector::setSorted | ( | bool | sorted | ) |
Definition at line 134 of file WorkspaceSelector.cpp.
| void WorkspaceSelector::setSuffixes | ( | const QStringList & | suffix | ) |
Definition at line 146 of file WorkspaceSelector.cpp.
| void WorkspaceSelector::setUpperBinLimit | ( | int | numberOfBins | ) |
Definition at line 157 of file WorkspaceSelector.cpp.
References m_binLimits.
| void WorkspaceSelector::setValidatingAlgorithm | ( | const QString & | algName | ) |
Definition at line 161 of file WorkspaceSelector.cpp.
References Mantid::Kernel::Direction::Input, m_algName, m_algorithm, m_algPropName, m_init, and refresh().
| void WorkspaceSelector::setWorkspaceTypes | ( | const QStringList & | types | ) |
Definition at line 89 of file WorkspaceSelector.cpp.
References m_init, m_workspaceTypes, and refresh().
| bool WorkspaceSelector::showHiddenWorkspaces | ( | ) | const |
Definition at line 98 of file WorkspaceSelector.cpp.
References m_showHidden.
Referenced by handleAddEvent(), and refresh().
| void WorkspaceSelector::showHiddenWorkspaces | ( | bool | show | ) |
Definition at line 100 of file WorkspaceSelector.cpp.
References m_init, m_showHidden, and refresh().
| bool WorkspaceSelector::showWorkspaceGroups | ( | ) | const |
Definition at line 109 of file WorkspaceSelector.cpp.
References m_showGroups.
| void WorkspaceSelector::showWorkspaceGroups | ( | bool | show | ) |
Definition at line 111 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 118 of file WorkspaceSelector.h.
Referenced by connectObservers(), and disconnectObservers().
|
private |
Definition at line 147 of file WorkspaceSelector.h.
Referenced by dragEnterEvent(), dropEvent(), handleAddEvent(), handleClearEvent(), handleRemEvent(), handleRenameEvent(), handleReplaceEvent(), and refresh().
|
private |
Definition at line 140 of file WorkspaceSelector.h.
Referenced by getValidatingAlgorithm(), and setValidatingAlgorithm().
|
private |
Definition at line 144 of file WorkspaceSelector.h.
Referenced by checkEligibility(), and setValidatingAlgorithm().
|
private |
Definition at line 141 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 138 of file WorkspaceSelector.h.
Referenced by hasValidNumberOfBins(), setLowerBinLimit(), and setUpperBinLimit().
|
private |
Definition at line 120 of file WorkspaceSelector.h.
Referenced by connectObservers(), and disconnectObservers().
|
private |
Definition at line 125 of file WorkspaceSelector.h.
Referenced by connectObservers(), disconnectObservers(), and isConnected().
|
private |
Definition at line 124 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 134 of file WorkspaceSelector.h.
Referenced by handleClearEvent(), isOptional(), refresh(), and setOptional().
|
private |
Definition at line 119 of file WorkspaceSelector.h.
Referenced by connectObservers(), and disconnectObservers().
|
private |
Definition at line 121 of file WorkspaceSelector.h.
Referenced by connectObservers(), and disconnectObservers().
|
private |
Definition at line 122 of file WorkspaceSelector.h.
Referenced by connectObservers(), and disconnectObservers().
|
private |
Definition at line 132 of file WorkspaceSelector.h.
Referenced by checkEligibility(), showWorkspaceGroups(), and showWorkspaceGroups().
|
private |
Whether to show "hidden" workspaces.
Definition at line 130 of file WorkspaceSelector.h.
Referenced by showHiddenWorkspaces(), and showHiddenWorkspaces().
|
private |
Whetherthe combobox model should be kept sorted.
Definition at line 136 of file WorkspaceSelector.h.
Referenced by isSorted(), and setSorted().
|
private |
Definition at line 139 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 128 of file WorkspaceSelector.h.
Referenced by checkEligibility(), getWorkspaceTypes(), and setWorkspaceTypes().
|
readwrite |
Definition at line 56 of file WorkspaceSelector.h.
|
readwrite |
Definition at line 53 of file WorkspaceSelector.h.
|
readwrite |
Definition at line 52 of file WorkspaceSelector.h.
|
readwrite |
Definition at line 51 of file WorkspaceSelector.h.
|
readwrite |
Definition at line 54 of file WorkspaceSelector.h.
|
readwrite |
Definition at line 55 of file WorkspaceSelector.h.
|
readwrite |
Definition at line 50 of file WorkspaceSelector.h.