23namespace MantidWidgets {
25class IFitScriptGeneratorModel;
26class IFitScriptGeneratorView;
27struct GlobalParameter;
33 QStringList
const &workspaceNames = QStringList(),
double startX = 0.0,
37 void notifyPresenter(
ViewEvent const &event, [[maybe_unused]] std::string
const &arg1 =
"",
38 [[maybe_unused]] std::string
const &arg2 =
"")
override;
39 void notifyPresenter(
ViewEvent const &event, std::vector<std::string>
const &vec)
override;
42 void openFitScriptGenerator()
override;
44 void setGlobalTies(std::vector<GlobalTie>
const &globalTies)
override;
45 void setGlobalParameters(std::vector<GlobalParameter>
const &globalParameters)
override;
48 void handleADSDeleteEvent(std::string
const &workspaceName);
49 void handleADSClearEvent();
50 void handleADSRenameEvent(std::string
const &workspaceName, std::string
const &newName);
51 void handleRemoveDomainClicked();
52 void handleAddDomainClicked();
53 void handleAddDomainAccepted();
54 void handleSelectionChanged();
55 void handleStartXChanged();
56 void handleEndXChanged();
57 void handleFunctionRemoved(std::string
const &function);
58 void handleFunctionAdded(std::string
const &function);
59 void handleFunctionReplaced(std::string
const &function);
60 void handleParameterChanged(std::string
const ¶meter);
61 void handleAttributeChanged(std::string
const &attribute);
62 void handleParameterTieChanged(std::string
const ¶meter, std::string
const &tie);
63 void handleParameterConstraintRemoved(std::string
const ¶meter);
64 void handleParameterConstraintChanged(std::string
const &functionIndex, std::string
const &constraint);
65 void handleGlobalParametersChanged(std::vector<std::string>
const &globalParameters);
66 void handleEditLocalParameterClicked(std::string
const ¶meter);
67 void handleEditLocalParameterFinished();
68 void handleOutputBaseNameChanged(std::string
const &outputBaseName);
69 void handleFittingModeChanged(
FittingMode fittingMode);
70 void handleGenerateScriptToFileClicked();
71 void handleGenerateScriptToClipboardClicked();
73 void setWorkspaces(QStringList
const &workspaceNames,
double startX,
double endX);
74 void addWorkspaces(std::vector<Mantid::API::MatrixWorkspace_const_sptr>
const &workspaces,
75 std::vector<WorkspaceIndex>
const &workspaceIndices);
76 void addWorkspace(std::string
const &workspaceName,
double startX,
double endX);
79 double startX,
double endX);
82 void removeDomains(std::vector<FitDomainIndex>
const &domainIndices);
84 void updateStartX(std::string
const &workspaceName,
WorkspaceIndex workspaceIndex,
double startX);
85 void updateEndX(std::string
const &workspaceName,
WorkspaceIndex workspaceIndex,
double endX);
87 void updateParameterValue(std::string
const &workspaceName,
WorkspaceIndex workspaceIndex,
88 std::string
const ¶meter,
double newValue);
89 void updateAttributeValue(std::string
const &workspaceName,
WorkspaceIndex workspaceIndex,
92 void updateParameterTie(std::string
const &workspaceName,
WorkspaceIndex workspaceIndex, std::string
const ¶meter,
93 std::string
const &tie);
95 void removeParameterConstraint(std::string
const &workspaceName,
WorkspaceIndex workspaceIndex,
96 std::string
const ¶meter);
97 void updateParameterConstraint(std::string
const &workspaceName,
WorkspaceIndex workspaceIndex,
98 std::string
const &functionIndex, std::string
const &constraint);
100 void removeFunction(std::string
const &workspaceName,
WorkspaceIndex workspaceIndex, std::string
const &function);
101 void addFunction(std::string
const &workspaceName,
WorkspaceIndex workspaceIndex, std::string
const &function);
102 void setFunction(std::string
const &workspaceName,
WorkspaceIndex workspaceIndex, std::string
const &function);
106 template <
typename GetX,
typename UpdateX>
void updateXLimitForDomain(GetX &&getX, UpdateX &&updateX);
108 template <
typename UpdateFunction>
109 void updateFunctionStructure(UpdateFunction &&updateFunction, std::string
const &function);
111 template <
typename UpdateFunction,
typename... Args>
112 void updateFunctionsInModel(UpdateFunction &&updateFunction, Args... arguments);
114 template <
typename Function,
typename... Args>
115 void invokeFunctionForDomain(
FitDomainIndex domainIndex, Function &&func, Args... arguments);
117 [[nodiscard]] std::vector<FitDomainIndex> getRowIndices()
const;
119 void insertLocalParameterData(std::string
const ¶meter, std::vector<std::string> &workspaceNames,
120 std::vector<std::string> &domainNames, std::vector<double> &values,
121 std::vector<bool> &fixes, std::vector<std::string> &ties,
122 std::vector<std::string> &constraints)
const;
123 void insertLocalParameterDataForDomain(
FitDomainIndex domainIndex, std::string
const ¶meter,
124 std::vector<std::string> &workspaceNames,
125 std::vector<std::string> &domainNames, std::vector<double> &values,
126 std::vector<bool> &fixes, std::vector<std::string> &ties,
127 std::vector<std::string> &constraints)
const;
129 void setLocalParameterDataForDomain(
FitDomainIndex domainIndex, std::string
const ¶meter,
double value,
bool fix,
130 std::string
const &tie, std::string
const &constraint);
132 std::vector<FitDomainIndex> getDomainsWithLocalParameter(std::string
const ¶meter)
const;
134 std::tuple<std::string, std::string> convertFunctionIndexOfParameterTie(std::string
const &workspaceName,
136 std::string
const ¶meter,
137 std::string
const &tie)
const;
139 void checkForWarningMessages();
141 template <
typename Generator>
void generateFitScript(Generator &&func)
const;
142 void generateScriptToFile()
const;
143 void generateScriptToClipboard()
const;
#define EXPORT_OPT_MANTIDQT_COMMON
double value
The value of the point.
IPeaksWorkspace_sptr workspace
void addWorkspace(WorkspaceGroup &self, const boost::python::object &pyobj)
Attribute is a non-fitting parameter.
The AlgorithmProgressDialogPresenter keeps track of the running algorithms and displays a progress ba...
std::shared_ptr< const MatrixWorkspace > MatrixWorkspace_const_sptr
shared pointer to the matrix workspace base class (const version)