-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #36389 from robertapplin/0-refactor-by-removing-in…
…dividual-analysis-tab-classes Remove old Data analysis tab classes
- v6.12.20250306.2035
- v6.12.20250304.2007
- v6.12.20250303.2021
- v6.12.0
- v6.11.0.5
- v6.11.0.5rc1
- v6.11.0.4
- v6.11.0.4rc1
- v6.11.0.3
- v6.11.0.3rc2
- v6.11.0.3rc1
- v6.11.0.2
- v6.11.0.2rc2
- v6.11.0.2rc1
- v6.11.0.1
- v6.11.0.1rc1
- v6.11.0
- v6.10.0.2rc1
- v6.10.0.1
- v6.10.0.1rc3
- v6.10.0.1rc2
- v6.10.0.1rc1
- v6.10.0
- v6.9.1.1
- v6.9.1.1rc1
- v6.9.1
- v6.9.0.1rc2
- v6.9.0.1rc1
- v6.9.0
Showing
58 changed files
with
832 additions
and
1,074 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 72 additions & 0 deletions
72
qt/scientific_interfaces/Inelastic/Analysis/DataAnalysisTabFactory.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
// Mantid Repository : https://github.com/mantidproject/mantid | ||
// | ||
// Copyright © 2023 ISIS Rutherford Appleton Laboratory UKRI, | ||
// NScD Oak Ridge National Laboratory, European Spallation Source, | ||
// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS | ||
// SPDX - License - Identifier: GPL - 3.0 + | ||
#include "DataAnalysisTabFactory.h" | ||
|
||
#include "ConvFitDataPresenter.h" | ||
#include "FitTabConstants.h" | ||
#include "FqFitDataPresenter.h" | ||
#include "FqFitModel.h" | ||
#include "FunctionBrowser/ConvFunctionModel.h" | ||
#include "FunctionBrowser/ConvTemplateBrowser.h" | ||
#include "FunctionBrowser/FqFunctionModel.h" | ||
#include "FunctionBrowser/IqtFunctionModel.h" | ||
#include "FunctionBrowser/IqtTemplateBrowser.h" | ||
#include "FunctionBrowser/MSDFunctionModel.h" | ||
#include "IndirectDataAnalysisTab.h" | ||
#include "IndirectFitDataPresenter.h" | ||
#include "IqtFitModel.h" | ||
#include "MSDFitModel.h" | ||
|
||
namespace MantidQt::CustomInterfaces::IDA { | ||
|
||
DataAnalysisTabFactory::DataAnalysisTabFactory(QTabWidget *tabWidget) : m_tabWidget(tabWidget) {} | ||
|
||
IndirectDataAnalysisTab *DataAnalysisTabFactory::makeMSDFitTab(int const index) const { | ||
auto tab = new IndirectDataAnalysisTab(MSDFit::TAB_NAME, MSDFit::HAS_RESOLUTION, m_tabWidget->widget(index)); | ||
tab->setupFittingModel<MSDFitModel>(); | ||
tab->setupFitPropertyBrowser<SingleFunctionTemplateBrowser, MSDFunctionModel>(MSDFit::HIDDEN_PROPS); | ||
tab->setupFitDataView<IndirectFitDataView>(); | ||
tab->setupOutputOptionsPresenter(); | ||
tab->setUpFitDataPresenter<IndirectFitDataPresenter>(); | ||
tab->setupPlotView(); | ||
return tab; | ||
} | ||
|
||
IndirectDataAnalysisTab *DataAnalysisTabFactory::makeIqtFitTab(int const index) const { | ||
auto tab = new IndirectDataAnalysisTab(IqtFit::TAB_NAME, IqtFit::HAS_RESOLUTION, m_tabWidget->widget(index)); | ||
tab->setupFittingModel<IqtFitModel>(); | ||
tab->setupFitPropertyBrowser<IqtTemplateBrowser, IqtFunctionModel>(IqtFit::HIDDEN_PROPS); | ||
tab->setupFitDataView<IndirectFitDataView>(); | ||
tab->setupOutputOptionsPresenter(true); | ||
tab->setUpFitDataPresenter<IndirectFitDataPresenter>(); | ||
tab->setupPlotView(); | ||
return tab; | ||
} | ||
|
||
IndirectDataAnalysisTab *DataAnalysisTabFactory::makeConvFitTab(int const index) const { | ||
auto tab = new IndirectDataAnalysisTab(ConvFit::TAB_NAME, ConvFit::HAS_RESOLUTION, m_tabWidget->widget(index)); | ||
tab->setupFittingModel<ConvFitModel>(); | ||
tab->setupFitPropertyBrowser<ConvTemplateBrowser, ConvFunctionModel>(ConvFit::HIDDEN_PROPS, true); | ||
tab->setupFitDataView<ConvFitDataView>(); | ||
tab->setupOutputOptionsPresenter(true); | ||
tab->setUpFitDataPresenter<ConvFitDataPresenter>(); | ||
tab->setupPlotView(); | ||
return tab; | ||
} | ||
|
||
IndirectDataAnalysisTab *DataAnalysisTabFactory::makeFqFitTab(int const index) const { | ||
auto tab = new IndirectDataAnalysisTab(FqFit::TAB_NAME, FqFit::HAS_RESOLUTION, m_tabWidget->widget(index)); | ||
tab->setupFittingModel<FqFitModel>(); | ||
tab->setupFitPropertyBrowser<SingleFunctionTemplateBrowser, FqFunctionModel>(FqFit::HIDDEN_PROPS); | ||
tab->setupFitDataView<FqFitDataView>(); | ||
tab->setupOutputOptionsPresenter(); | ||
tab->setUpFitDataPresenter<FqFitDataPresenter>(); | ||
tab->setupPlotView(FqFit::X_BOUNDS); | ||
return tab; | ||
} | ||
|
||
} // namespace MantidQt::CustomInterfaces::IDA |
27 changes: 27 additions & 0 deletions
27
qt/scientific_interfaces/Inelastic/Analysis/DataAnalysisTabFactory.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Mantid Repository : https://github.com/mantidproject/mantid | ||
// | ||
// Copyright © 2023 ISIS Rutherford Appleton Laboratory UKRI, | ||
// NScD Oak Ridge National Laboratory, European Spallation Source, | ||
// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS | ||
// SPDX - License - Identifier: GPL - 3.0 + | ||
#pragma once | ||
|
||
#include <QTabWidget> | ||
|
||
namespace MantidQt::CustomInterfaces::IDA { | ||
|
||
class IndirectDataAnalysisTab; | ||
|
||
class DataAnalysisTabFactory { | ||
public: | ||
explicit DataAnalysisTabFactory(QTabWidget *tabWidget); | ||
IndirectDataAnalysisTab *makeMSDFitTab(int const index) const; | ||
IndirectDataAnalysisTab *makeIqtFitTab(int const index) const; | ||
IndirectDataAnalysisTab *makeConvFitTab(int const index) const; | ||
IndirectDataAnalysisTab *makeFqFitTab(int const index) const; | ||
|
||
private: | ||
QTabWidget *m_tabWidget; | ||
}; | ||
|
||
} // namespace MantidQt::CustomInterfaces::IDA |
54 changes: 0 additions & 54 deletions
54
qt/scientific_interfaces/Inelastic/Analysis/FQFitConstants.h
This file was deleted.
Oops, something went wrong.
118 changes: 118 additions & 0 deletions
118
qt/scientific_interfaces/Inelastic/Analysis/FitTabConstants.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
// Mantid Repository : https://github.com/mantidproject/mantid | ||
// | ||
// Copyright © 2023 ISIS Rutherford Appleton Laboratory UKRI, | ||
// NScD Oak Ridge National Laboratory, European Spallation Source, | ||
// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS | ||
// SPDX - License - Identifier: GPL - 3.0 + | ||
#pragma once | ||
|
||
#include <map> | ||
#include <string> | ||
#include <unordered_map> | ||
|
||
namespace MantidQt::CustomInterfaces::IDA { | ||
|
||
static const auto FUNCTION_STRINGS = | ||
std::unordered_map<std::string, std::string>({{"ExpDecay", "E"}, | ||
{"StretchExp", "S"}, | ||
{"Lorentzian", "L"}, | ||
{"StretchedExpFT", "SFT"}, | ||
{"TeixeiraWater", "TxWater"}, | ||
{"TeixeiraWaterSQE", "TxWater"}, | ||
{"FickDiffusionSQE", "FickDiff"}, | ||
{"ChudleyElliotSQE", "ChudElliot"}, | ||
{"HallRoss", "HallRoss"}, | ||
{"HallRossSQE", "HallRoss"}, | ||
{"DiffRotDiscreteCircle", "DC"}, | ||
{"ElasticDiffRotDiscreteCircle", "EDC"}, | ||
{"InelasticDiffRotDiscreteCircle", "IDC"}, | ||
{"DiffSphere", "DS"}, | ||
{"ElasticDiffSphere", "EDS"}, | ||
{"InelasticDiffSphere", "IDS"}, | ||
{"IsoRotDiff", "IRD"}, | ||
{"ElasticIsoRotDiff", "EIRD"}, | ||
{"InelasticIsoRotDiff", "IIRD"}, | ||
{"MsdGauss", "Gauss"}, | ||
{"MsdPeters", "Peters"}, | ||
{"MsdYi", "Yi"}, | ||
{"FickDiffusion", "FickDiffusion"}, | ||
{"ChudleyElliot", "ChudleyElliot"}, | ||
{"EISFDiffCylinder", "EISFDiffCylinder"}, | ||
{"EISFDiffSphere", "EISFDiffSphere"}, | ||
{"EISFDiffSphereAlkyl", "EISFDiffSphereAlkyl"}}); | ||
|
||
namespace MSDFit { | ||
static const auto TAB_NAME = "MSDFit"; | ||
static const auto HAS_RESOLUTION = false; | ||
static const auto HIDDEN_PROPS = | ||
std::vector<std::string>({"CreateOutput", "LogValue", "PassWSIndexToFunction", "ConvolveMembers", | ||
"OutputCompositeMembers", "OutputWorkspace", "Output", "PeakRadius", "PlotParameter"}); | ||
|
||
static const auto ALL_FITS = | ||
std::map<std::string, std::string>({{"None", ""}, | ||
{"Gauss", "name=MsdGauss,Height=1,Msd=0.05,constraints=(Height>0, Msd>0)"}, | ||
{"Peters", "name=MsdPeters,Height=1,Msd=0.05,Beta=1,constraints=(Height>0, " | ||
"Msd>0, Beta>0)"}, | ||
{"Yi", "name=MsdYi,Height=1,Msd=0.05,Sigma=1,constraints=(Height>0, Msd>0, " | ||
"Sigma>0)"}}); | ||
} // namespace MSDFit | ||
|
||
namespace IqtFit { | ||
static const auto TAB_NAME = "IqtFit"; | ||
static const auto HAS_RESOLUTION = false; | ||
static const auto HIDDEN_PROPS = | ||
std::vector<std::string>({"CreateOutput", "LogValue", "PassWSIndexToFunction", "ConvolveMembers", | ||
"OutputCompositeMembers", "OutputWorkspace", "Output", "PeakRadius", "PlotParameter"}); | ||
} // namespace IqtFit | ||
|
||
namespace ConvFit { | ||
static const auto TAB_NAME = "ConvFit"; | ||
static const auto HAS_RESOLUTION = true; | ||
static const auto HIDDEN_PROPS = std::vector<std::string>( | ||
{"CreateOutput", "LogValue", "PassWSIndexToFunction", "OutputWorkspace", "Output", "PeakRadius", "PlotParameter"}); | ||
|
||
} // namespace ConvFit | ||
|
||
namespace FqFit { | ||
static const auto TAB_NAME = "FQFit"; | ||
static const auto HAS_RESOLUTION = false; | ||
static const auto HIDDEN_PROPS = | ||
std::vector<std::string>({"CreateOutput", "LogValue", "PassWSIndexToFunction", "ConvolveMembers", | ||
"OutputCompositeMembers", "OutputWorkspace", "Output", "PeakRadius", "PlotParameter"}); | ||
static const auto X_BOUNDS = std::pair<double, double>{0.0, 2.0}; | ||
|
||
enum class DataType { | ||
WIDTH, | ||
EISF, | ||
ALL, | ||
}; | ||
|
||
static const auto WIDTH_FITS = std::map<std::string, std::string>( | ||
{{"None", ""}, | ||
{"ChudleyElliot", "name=ChudleyElliot, Tau=1, L=1.5, constraints=(Tau>0, L>0)"}, | ||
{"HallRoss", "name=Hallross, Tau=1, L=0.2, constraints=(Tau>0, L>0)"}, | ||
{"FickDiffusion", "name=FickDiffusion, D=1, constraints=(D>0)"}, | ||
{"TeixeiraWater", "name=TeixeiraWater, Tau=1, L=1.5, constraints=(Tau>0, L>0)"}}); | ||
|
||
static const auto EISF_FITS = std::map<std::string, std::string>( | ||
{{"None", ""}, | ||
{"EISFDiffCylinder", "name=EISFDiffCylinder, A=1, R=1, L=2, constraints=(A>0, R>0, L>0)"}, | ||
{"EISFDiffSphere", "name=EISFDiffSphere, A=1, R=1, constraints=(A>0, R>0)"}, | ||
{"EISFDiffSphereAlkyl", "name=EISFDiffSphereAlkyl, A=1, Rmin=1, Rmax=2, constraints=(A>0, Rmin>0, Rmax>0)"}}); | ||
|
||
static const auto ALL_FITS = std::map<std::string, std::string>( | ||
{{"None", ""}, | ||
{"ChudleyElliot", "name=ChudleyElliot, Tau=1, L=1.5, constraints=(Tau>0, L>0)"}, | ||
{"HallRoss", "name=Hallross, Tau=1, L=0.2, constraints=(Tau>0, L>0)"}, | ||
{"FickDiffusion", "name=FickDiffusion, D=1, constraints=(D>0)"}, | ||
{"TeixeiraWater", "name=TeixeiraWater, Tau=1, L=1.5, constraints=(Tau>0, L>0)"}, | ||
{"EISFDiffCylinder", "name=EISFDiffCylinder, A=1, R=1, L=2, constraints=(A>0, R>0, L>0)"}, | ||
{"EISFDiffSphere", "name=EISFDiffSphere, A=1, R=1, constraints=(A>0, R>0)"}, | ||
{"EISFDiffSphereAlkyl", "name=EISFDiffSphereAlkyl, A=1, Rmin=1, Rmax=2, constraints=(A>0, Rmin>0, Rmax>0)"}}); | ||
|
||
static const std::unordered_map<DataType, std::map<std::string, std::string>> availableFits{ | ||
{{DataType::WIDTH, WIDTH_FITS}, {DataType::EISF, EISF_FITS}, {DataType::ALL, ALL_FITS}}}; | ||
|
||
} // namespace FqFit | ||
|
||
} // namespace MantidQt::CustomInterfaces::IDA |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.