Skip to content
Snippets Groups Projects
Commit 6ac531f1 authored by Matthew Andrew's avatar Matthew Andrew
Browse files

Added all fit types to multiple input Re #28077

Multiple input can be either width or EISF data. Therefore in line with the old functionality  in this mode the full range of fitting functions are enabled.
parent 0722870f
No related branches found
No related tags found
No related merge requests found
......@@ -10,6 +10,7 @@
enum DataType {
WIDTH,
EISF,
ALL,
};
class IFQFitObserver {
......
......@@ -25,8 +25,14 @@ QStringList widthFits = QStringList(
QStringList eisfFits = QStringList(
{"None", "EISFDiffCylinder", "EISFDiffSphere", "EISFDiffSphereAlkyl"});
std::unordered_map<DataType, QStringList> dataTypeFitTypeMap(
{{DataType::WIDTH, widthFits}, {DataType::EISF, eisfFits}});
QStringList combinedFits = QStringList(
{"None", "ChudleyElliot", "HallRoss", "FickDiffusion", "TeixeiraWater",
"EISFDiffCylinder", "EISFDiffSphere", "EISFDiffSphereAlkyl"});
std::unordered_map<DataType, QStringList>
dataTypeFitTypeMap({{DataType::WIDTH, widthFits},
{DataType::EISF, eisfFits},
{DataType::ALL, combinedFits}});
FQFunctionModel::FQFunctionModel() {
for (auto functionName : widthFits + eisfFits) {
......
......@@ -25,9 +25,9 @@ JumpFitDataPresenter::JumpFitDataPresenter(
m_lbParameterType(lbParameterType), m_lbParameter(lbParameter),
m_jumpModel(model) {
connect(view, SIGNAL(singleDataViewSelected()), this,
SLOT(showParameterComboBoxes()));
SLOT(handleSingleInputSelected()));
connect(view, SIGNAL(multipleDataViewSelected()), this,
SLOT(hideParameterComboBoxes()));
SLOT(handleMultipleInputSelected()));
connect(this, SIGNAL(requestedAddWorkspaceDialog()), this,
SLOT(updateActiveDataIndex()));
......@@ -54,6 +54,23 @@ void JumpFitDataPresenter::handleSampleLoaded(const QString &workspaceName) {
emit updateAvailableFitTypes();
}
void JumpFitDataPresenter::handleMultipleInputSelected() {
hideParameterComboBoxes();
m_notifier.notify(
[](IFQFitObserver &obs) { obs.updateDataType(DataType::ALL); });
}
void JumpFitDataPresenter::handleSingleInputSelected() {
showParameterComboBoxes();
m_dataIndex = TableDatasetIndex{0};
std::string currentText = m_cbParameterType->currentText().toStdString();
auto dataType = m_cbParameterType->currentText() == QString("Width")
? DataType::WIDTH
: DataType::EISF;
m_notifier.notify(
[&dataType](IFQFitObserver &obs) { obs.updateDataType(dataType); });
}
void JumpFitDataPresenter::hideParameterComboBoxes() {
m_cbParameter->hide();
m_cbParameterType->hide();
......@@ -66,7 +83,6 @@ void JumpFitDataPresenter::showParameterComboBoxes() {
m_cbParameterType->show();
m_lbParameter->show();
m_lbParameterType->show();
m_dataIndex = TableDatasetIndex{0};
}
void JumpFitDataPresenter::setActiveParameterType(const std::string &type) {
......
......@@ -47,6 +47,8 @@ private slots:
void setSingleModelSpectrum(int index);
void handleParameterTypeChanged(const QString &parameter);
void handleSpectrumSelectionChanged(int parameterIndex);
void handleMultipleInputSelected();
void handleSingleInputSelected();
signals:
void spectrumChanged(WorkspaceIndex);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment