Mantid
|
MuonFitDataSelector : Selects runs, groups, periods for fit. More...
#include <MuonFitDataSelector.h>
Public Slots | |
void | checkForMultiGroupPeriodSelection () |
Called when group/period box selection changes. More... | |
void | fitTypeChanged (bool state) |
Called when fit type changed. More... | |
void | setEndTime (double end) override |
Set end time for fit. More... | |
void | setEndTimeQuietly (double end) override |
Set end time without sending a signal. More... | |
void | setStartTime (double start) override |
Set start time for fit. More... | |
void | setStartTimeQuietly (double start) override |
Set start time without sending a signal. More... | |
void | setWorkspaceDetails (const QString &runNumbers, const QString &instName, const boost::optional< QString > &filePath) override |
Set starting run number, instrument and (optionally) file path. More... | |
void | updateNormalizationFromDropDown (int) |
void | userChangedRuns () |
Called when user changes runs. More... | |
Signals | |
void | dataPropertiesChanged () |
Edited the start or end fields. More... | |
void | datasetIndexChanged (int index) |
Dataset index changed. More... | |
void | nameChanged (QString name) |
void | simulLabelChanged () |
Simultaneous fit label changed. More... | |
void | workspaceChanged () |
Changed the workspace. More... | |
Signals inherited from MantidQt::API::MantidWidget | |
void | runAsPythonScript (const QString &code, bool) |
Public Member Functions | |
bool | askUserWhetherToOverwrite () override |
Ask user whether to overwrite label or not. More... | |
QStringList | getChosenGroups () const override |
Get names of chosen groups. More... | |
int | getDatasetIndex () const override |
Get index of selected dataset. More... | |
QString | getDatasetName () const override |
Get name of selected dataset. More... | |
double | getEndTime () const override |
Get selected end time. More... | |
QStringList | getFilenames () const override |
Get selected filenames. More... | |
IMuonFitDataSelector::FitType | getFitType () const override |
Get type of fit. More... | |
QString | getInstrumentName () const override |
Get instrument name. More... | |
QStringList | getPeriodSelections () const override |
Get selected periods. More... | |
QString | getRuns () const override |
Get selected run numbers. More... | |
QString | getSimultaneousFitLabel () const override |
Get label for simultaneous fit. More... | |
double | getStartTime () const override |
Get selected start time. More... | |
QVariant | getUserInput () const override |
Get user input through a common interface. More... | |
MuonFitDataSelector (QWidget *parent) | |
Basic constructor. More... | |
MuonFitDataSelector (QWidget *parent, int runNumber, const QString &instName) | |
Constructor with more options. More... | |
void | setDatasetNames (const QStringList &datasetNames) override |
Set names of datasets for selection. More... | |
void | setGroupsSelected (const QStringList &groups) |
Set chosen group/period. More... | |
void | setPeriodsSelected (const QStringList &periods) |
void | setSimultaneousFitLabel (const QString &label) override |
Set label for simultaneous fit. More... | |
void | setUserInput (const QVariant &value) override |
Set user input through a common interface. More... | |
virtual QVariant | getUserInput () const |
Returns a QVariant containing what the widget classes as user input so that input can be returned through a common interface. More... | |
virtual void | setUserInput (const QVariant &value) |
Sets a value on a mantid widget through a common interface. More... | |
Public Member Functions inherited from MantidQt::MantidWidgets::IMuonFitDataSelector | |
virtual bool | askUserWhetherToOverwrite ()=0 |
virtual QStringList | getChosenGroups () const =0 |
virtual int | getDatasetIndex () const =0 |
virtual QString | getDatasetName () const =0 |
virtual double | getEndTime () const =0 |
virtual QStringList | getFilenames () const =0 |
virtual FitType | getFitType () const =0 |
virtual QString | getInstrumentName () const =0 |
virtual QStringList | getPeriodSelections () const =0 |
virtual QString | getRuns () const =0 |
virtual QString | getSimultaneousFitLabel () const =0 |
virtual double | getStartTime () const =0 |
virtual void | setDatasetNames (const QStringList &datasetNames)=0 |
virtual void | setEndTime (double end)=0 |
virtual void | setEndTimeQuietly (double end)=0 |
virtual void | setSimultaneousFitLabel (const QString &label)=0 |
virtual void | setStartTime (double start)=0 |
virtual void | setStartTimeQuietly (double start)=0 |
virtual void | setWorkspaceDetails (const QString &runNumbers, const QString &instName, const boost::optional< QString > &filePath)=0 |
virtual | ~IMuonFitDataSelector ()=default |
Private Slots | |
void | setNextDataset () |
Change dataset to next one. More... | |
void | setPreviousDataset () |
Change dataset to previous one. More... | |
void | unsetBusyState () |
Set normal cursor and enable input. More... | |
Private Member Functions | |
void | setBusyState () |
Set busy cursor and disable input. More... | |
void | setDefaultValues () |
Set default values in some input controls. More... | |
void | setFitType (IMuonFitDataSelector::FitType type) |
Set type for fit. More... | |
void | setUpConnections () |
Set up connections for signals/slots. More... | |
Private Attributes | |
QStringList | m_chosenGroups |
QStringList | m_chosenPeriods |
double | m_endX |
bool | m_multiFit |
double | m_startX |
Ui::MuonFitDataSelector | m_ui |
Member - user interface. More... | |
Additional Inherited Members | |
Public Types inherited from MantidQt::MantidWidgets::IMuonFitDataSelector | |
enum class | FitType { Single , CoAdd , Simultaneous } |
Protected Member Functions inherited from MantidQt::API::MantidWidget | |
MantidWidget (QWidget *parent=nullptr) | |
Default constructor. More... | |
QString | runPythonCode (const QString &code, bool no_output=false) |
Run python code that is passed to it and, optionally, return anything it wrote to standard output as a string. More... | |
MuonFitDataSelector : Selects runs, groups, periods for fit.
Widget to select data to fit for MuonAnalysis
Implements IMuonFitDataSelector
Definition at line 25 of file MuonFitDataSelector.h.
|
explicit |
Basic constructor.
parent | :: [input] Parent dialog for the widget |
Definition at line 25 of file MuonFitDataSelector.cpp.
References m_multiFit, m_ui, MantidQt::API::FileFinderWidget::None, setDefaultValues(), and setUpConnections().
MantidQt::MantidWidgets::MuonFitDataSelector::MuonFitDataSelector | ( | QWidget * | parent, |
int | runNumber, | ||
const QString & | instName | ||
) |
Constructor with more options.
Constructor for the widget.
parent | :: [input] Parent dialog for the widget |
runNumber | :: [input] Run number of initial workspace |
instName | :: [input] Name of instrument from initial workspace |
Definition at line 42 of file MuonFitDataSelector.cpp.
References m_multiFit, and setWorkspaceDetails().
|
overridevirtual |
Ask user whether to overwrite label or not.
Ask the user whether to overwrite the fit results with the current label, if those results already exist.
Raises a messagebox with a yes/no choice.
Implements MantidQt::MantidWidgets::IMuonFitDataSelector.
Definition at line 439 of file MuonFitDataSelector.cpp.
References getSimultaneousFitLabel().
|
slot |
Called when group/period box selection changes.
Enable the "Label" textbox if multiple groups or periods are selected.
Called when groups/periods selection changes.
Definition at line 357 of file MuonFitDataSelector.cpp.
References getFitType(), m_chosenGroups, m_chosenPeriods, m_ui, and MantidQt::MantidWidgets::IMuonFitDataSelector::Simultaneous.
Referenced by setFitType(), and setUpConnections().
|
signal |
Edited the start or end fields.
Referenced by setEndTime(), and setStartTime().
|
signal |
Dataset index changed.
Referenced by setUpConnections().
|
slot |
Called when fit type changed.
Emit a signal.
state | :: [input] Unused. |
Definition at line 77 of file MuonFitDataSelector.cpp.
References workspaceChanged().
Referenced by setUpConnections().
|
overridevirtual |
Get names of chosen groups.
Returns a list of the selected groups (checked boxes)
Implements MantidQt::MantidWidgets::IMuonFitDataSelector.
Definition at line 204 of file MuonFitDataSelector.cpp.
References m_chosenGroups.
Referenced by getUserInput().
|
overridevirtual |
Get index of selected dataset.
Return index of currently selected dataset.
Implements MantidQt::MantidWidgets::IMuonFitDataSelector.
Definition at line 366 of file MuonFitDataSelector.cpp.
References m_ui.
|
overridevirtual |
Get name of selected dataset.
Return name of currently selected dataset.
Implements MantidQt::MantidWidgets::IMuonFitDataSelector.
Definition at line 372 of file MuonFitDataSelector.cpp.
References m_ui.
|
overridevirtual |
Get selected end time.
Get the user's supplied end time (default 10)
Implements MantidQt::MantidWidgets::IMuonFitDataSelector.
Definition at line 127 of file MuonFitDataSelector.cpp.
References m_endX.
Referenced by getUserInput().
|
overridevirtual |
Get selected filenames.
Get the filenames of the supplied run numbers.
Implements MantidQt::MantidWidgets::IMuonFitDataSelector.
Definition at line 148 of file MuonFitDataSelector.cpp.
References m_ui.
|
overridevirtual |
Get type of fit.
Returns the selected fit type.
Implements MantidQt::MantidWidgets::IMuonFitDataSelector.
Definition at line 259 of file MuonFitDataSelector.cpp.
References MantidQt::MantidWidgets::IMuonFitDataSelector::CoAdd, m_chosenGroups, m_chosenPeriods, m_multiFit, m_ui, MantidQt::MantidWidgets::IMuonFitDataSelector::Simultaneous, and MantidQt::MantidWidgets::IMuonFitDataSelector::Single.
Referenced by checkForMultiGroupPeriodSelection().
|
overridevirtual |
Get instrument name.
Return the instrument name currently set as the override for the data selector.
Implements MantidQt::MantidWidgets::IMuonFitDataSelector.
Definition at line 296 of file MuonFitDataSelector.cpp.
References m_ui.
|
overridevirtual |
Get selected periods.
Returns a list of periods and combinations chosen in UI.
Implements MantidQt::MantidWidgets::IMuonFitDataSelector.
Definition at line 198 of file MuonFitDataSelector.cpp.
References m_chosenPeriods.
Referenced by getUserInput().
|
overridevirtual |
Get selected run numbers.
Return the runs entered by the user.
Implements MantidQt::MantidWidgets::IMuonFitDataSelector.
Definition at line 302 of file MuonFitDataSelector.cpp.
References m_ui.
Referenced by getUserInput(), and userChangedRuns().
|
overridevirtual |
Get label for simultaneous fit.
Get text entered as the simultaneous fit label.
Implements MantidQt::MantidWidgets::IMuonFitDataSelector.
Definition at line 332 of file MuonFitDataSelector.cpp.
References m_ui.
Referenced by askUserWhetherToOverwrite().
|
overridevirtual |
Get selected start time.
Get the user's supplied start time (default 0)
Implements MantidQt::MantidWidgets::IMuonFitDataSelector.
Definition at line 103 of file MuonFitDataSelector.cpp.
References m_startX.
Referenced by getUserInput().
|
overridevirtual |
Get user input through a common interface.
Gets user input in the form of a QVariant.
This is implemented as the "standard" way of getting input from a MantidWidget. In practice it is probably easier to get the input using other methods.
The returned QVariant is a QVariantMap of (parameter, value) pairs.
Reimplemented from MantidQt::API::MantidWidget.
Definition at line 216 of file MuonFitDataSelector.cpp.
References getChosenGroups(), getEndTime(), getPeriodSelections(), getRuns(), and getStartTime().
|
signal |
Referenced by updateNormalizationFromDropDown().
|
private |
Set busy cursor and disable input.
Sets busy cursor and disables input while file search in progress.
Connects up slot to reset busy state when search done.
Definition at line 323 of file MuonFitDataSelector.cpp.
References m_ui, and unsetBusyState().
Referenced by setWorkspaceDetails().
|
overridevirtual |
Set names of datasets for selection.
Replaces list of dataset names with the supplied list.
datasetNames | :: [input] List of names to use |
Implements MantidQt::MantidWidgets::IMuonFitDataSelector.
Definition at line 378 of file MuonFitDataSelector.cpp.
|
private |
Set default values in some input controls.
Set default values in some input controls Defaults copy those previously used in muon fit property browser.
Definition at line 188 of file MuonFitDataSelector.cpp.
References m_ui, setEndTime(), setStartTime(), and simulLabelChanged().
Referenced by MuonFitDataSelector().
|
overrideslot |
Set end time for fit.
Set the end time in the UI, and send signal.
end | :: [input] End time in microseconds |
Definition at line 139 of file MuonFitDataSelector.cpp.
References dataPropertiesChanged(), and setEndTimeQuietly().
Referenced by setDefaultValues(), and setUserInput().
|
overrideslot |
Set end time without sending a signal.
Set the end time in the UI WITHOUT sending signal.
end | :: [input] End time in microseconds |
Definition at line 133 of file MuonFitDataSelector.cpp.
References m_endX.
Referenced by setEndTime().
|
private |
Set type for fit.
Sets the fit type.
If single, disables radio buttons. Otherwise, enables buttons and selects the correct one.
type | :: [input] Fit type to set (from enum) |
Definition at line 280 of file MuonFitDataSelector.cpp.
References checkForMultiGroupPeriodSelection(), MantidQt::MantidWidgets::IMuonFitDataSelector::CoAdd, m_multiFit, m_ui, MantidQt::MantidWidgets::IMuonFitDataSelector::Simultaneous, and MantidQt::MantidWidgets::IMuonFitDataSelector::Single.
Referenced by setWorkspaceDetails(), and userChangedRuns().
|
inline |
Set chosen group/period.
Definition at line 49 of file MuonFitDataSelector.h.
|
privateslot |
Change dataset to next one.
Called when "next dataset" is clicked.
Changes combobox to next dataset, which will raise an event. If there is no next dataset, does nothing.
Definition at line 426 of file MuonFitDataSelector.cpp.
Referenced by setUpConnections().
|
inline |
Definition at line 50 of file MuonFitDataSelector.h.
|
privateslot |
Change dataset to previous one.
Called when "previous dataset" is clicked.
Changes combobox to previous dataset, which will raise an event. If there is no previous dataset, does nothing.
Definition at line 414 of file MuonFitDataSelector.cpp.
Referenced by setUpConnections().
|
overridevirtual |
Set label for simultaneous fit.
Set text of simultaneous fit label.
label | :: [input] Text to set as label |
Implements MantidQt::MantidWidgets::IMuonFitDataSelector.
Definition at line 338 of file MuonFitDataSelector.cpp.
|
overrideslot |
Set start time for fit.
Set the start time in the UI, and send signal.
start | :: [input] Start time in microseconds |
Definition at line 118 of file MuonFitDataSelector.cpp.
References dataPropertiesChanged(), and setStartTimeQuietly().
Referenced by setDefaultValues(), and setUserInput().
|
overrideslot |
Set start time without sending a signal.
Set the start time in the UI WITHOUT sending signal.
start | :: [input] Start time in microseconds |
Definition at line 112 of file MuonFitDataSelector.cpp.
References m_startX.
Referenced by setStartTime().
|
private |
Set up connections for signals/slots.
Connect signals from UI elements to re-emit a signal that "user has changed something".
Definition at line 62 of file MuonFitDataSelector.cpp.
References checkForMultiGroupPeriodSelection(), datasetIndexChanged(), fitTypeChanged(), m_ui, setNextDataset(), setPreviousDataset(), simulLabelChanged(), updateNormalizationFromDropDown(), userChangedRuns(), and workspaceChanged().
Referenced by MuonFitDataSelector().
|
overridevirtual |
Set user input through a common interface.
Sets user input in the form of a QVariant.
This is implemented as the "standard" way of setting input in a MantidWidget. In practice it is probably easier to set the input using other methods.
This function doesn't support setting runs, groups or periods.
The input QVariant is a QVariantMap of (parameter, value) pairs.
value | :: [input] QVariant containing a QVariantMap |
Reimplemented from MantidQt::API::MantidWidget.
Definition at line 239 of file MuonFitDataSelector.cpp.
References setEndTime(), setStartTime(), and value.
|
overrideslot |
Set starting run number, instrument and (optionally) file path.
Set up run finder with initial run number and instrument.
runNumbers | :: [input] Run numbers from loaded workspace |
instName | :: [input] Instrument name from loaded workspace |
filePath | :: [input] Optional path to the data file - this is important in the case of "load current run" when the file may have a special name like MUSRauto_E.tmp |
Definition at line 158 of file MuonFitDataSelector.cpp.
References MantidQt::MantidWidgets::IMuonFitDataSelector::CoAdd, m_ui, setBusyState(), setFitType(), and MantidQt::MantidWidgets::IMuonFitDataSelector::Single.
Referenced by MuonFitDataSelector().
|
signal |
Simultaneous fit label changed.
Referenced by setDefaultValues(), and setUpConnections().
|
privateslot |
Set normal cursor and enable input.
Slot: called when file finding finished.
Resets the cursor for this widget back to the normal, non-busy state.
Definition at line 314 of file MuonFitDataSelector.cpp.
References m_ui, and unsetBusyState().
Referenced by setBusyState(), and unsetBusyState().
|
slot |
Definition at line 400 of file MuonFitDataSelector.cpp.
References m_ui, and nameChanged().
Referenced by setUpConnections().
|
slot |
Called when user changes runs.
Slot: called when user edits runs box.
Check for single run and enable/disable radio buttons, and emit signal that runs have changed.
Definition at line 87 of file MuonFitDataSelector.cpp.
References getRuns(), m_multiFit, setFitType(), MantidQt::MantidWidgets::IMuonFitDataSelector::Single, and workspaceChanged().
Referenced by setUpConnections().
|
signal |
Changed the workspace.
Referenced by fitTypeChanged(), setUpConnections(), and userChangedRuns().
|
private |
Definition at line 115 of file MuonFitDataSelector.h.
Referenced by checkForMultiGroupPeriodSelection(), getChosenGroups(), and getFitType().
|
private |
Definition at line 116 of file MuonFitDataSelector.h.
Referenced by checkForMultiGroupPeriodSelection(), getFitType(), and getPeriodSelections().
|
private |
Definition at line 114 of file MuonFitDataSelector.h.
Referenced by getEndTime(), and setEndTimeQuietly().
|
private |
Definition at line 117 of file MuonFitDataSelector.h.
Referenced by getFitType(), MuonFitDataSelector(), setFitType(), and userChangedRuns().
|
private |
Definition at line 113 of file MuonFitDataSelector.h.
Referenced by getStartTime(), and setStartTimeQuietly().
|
private |
Member - user interface.
Definition at line 112 of file MuonFitDataSelector.h.
Referenced by checkForMultiGroupPeriodSelection(), getDatasetIndex(), getDatasetName(), getFilenames(), getFitType(), getInstrumentName(), getRuns(), getSimultaneousFitLabel(), MuonFitDataSelector(), setBusyState(), setDatasetNames(), setDefaultValues(), setFitType(), setNextDataset(), setPreviousDataset(), setSimultaneousFitLabel(), setUpConnections(), setWorkspaceDetails(), unsetBusyState(), and updateNormalizationFromDropDown().