Mantid
Loading...
Searching...
No Matches
FitScriptGeneratorPresenter.cpp
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2020 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
11
13#include "MantidAPI/IFunction.h"
15
16#include <algorithm>
17#include <iterator>
18#include <sstream>
19#include <stdexcept>
20
21using namespace Mantid::API;
22
24
26 QStringList const &workspaceNames, double startX, double endX)
27 : m_warnings(), m_view(view), m_model(model) {
30 setWorkspaces(workspaceNames, startX, endX);
31}
32
34
35void FitScriptGeneratorPresenter::notifyPresenter(ViewEvent const &event, [[maybe_unused]] std::string const &arg1,
36 [[maybe_unused]] std::string const &arg2) {
37 switch (event) {
38 case ViewEvent::ADSDeleteEvent:
40 return;
41 case ViewEvent::ADSClearEvent:
43 return;
44 case ViewEvent::ADSRenameEvent:
45 handleADSRenameEvent(arg1, arg2);
46 return;
47 case ViewEvent::RemoveDomainClicked:
49 return;
50 case ViewEvent::AddDomainClicked:
52 return;
53 case ViewEvent::AddDomainAccepted:
55 return;
56 case ViewEvent::StartXChanged:
58 return;
59 case ViewEvent::EndXChanged:
61 return;
62 case ViewEvent::SelectionChanged:
64 return;
65 case ViewEvent::FunctionRemoved:
67 return;
68 case ViewEvent::FunctionAdded:
70 return;
71 case ViewEvent::FunctionReplaced:
73 return;
74 case ViewEvent::ParameterChanged:
76 return;
77 case ViewEvent::AttributeChanged:
79 return;
80 case ViewEvent::ParameterTieChanged:
81 handleParameterTieChanged(arg1, arg2);
82 return;
83 case ViewEvent::ParameterConstraintRemoved:
85 return;
86 case ViewEvent::ParameterConstraintChanged:
88 return;
89 case ViewEvent::EditLocalParameterClicked:
91 return;
92 case ViewEvent::EditLocalParameterFinished:
94 return;
95 case ViewEvent::OutputBaseNameChanged:
97 return;
98 case ViewEvent::GenerateScriptToFileClicked:
100 return;
101 case ViewEvent::GenerateScriptToClipboardClicked:
103 return;
104 default:
105 throw std::runtime_error("Failed to notify the FitScriptGeneratorPresenter.");
106 }
107}
108
109void FitScriptGeneratorPresenter::notifyPresenter(ViewEvent const &event, std::vector<std::string> const &vec) {
110 switch (event) {
111 case ViewEvent::GlobalParametersChanged:
113 return;
114 default:
115 throw std::runtime_error("Failed to notify the FitScriptGeneratorPresenter.");
116 }
117}
118
120 switch (event) {
121 case ViewEvent::FittingModeChanged:
122 handleFittingModeChanged(fittingMode);
123 return;
124 default:
125 throw std::runtime_error("Failed to notify the FitScriptGeneratorPresenter.");
126 }
127}
128
130
131void FitScriptGeneratorPresenter::handleADSDeleteEvent(std::string const &workspaceName) {
132 auto const differentWsName = [&](FitDomainIndex index) { return m_view->workspaceName(index) != workspaceName; };
133
134 auto workspaceRows = m_view->allRows();
135 workspaceRows.erase(std::remove_if(workspaceRows.begin(), workspaceRows.end(), differentWsName), workspaceRows.end());
136
137 removeDomains(workspaceRows);
138}
139
141
142void FitScriptGeneratorPresenter::handleADSRenameEvent(std::string const &workspaceName, std::string const &newName) {
143 m_model->renameWorkspace(workspaceName, newName);
144 m_view->renameWorkspace(workspaceName, newName);
145}
146
148
150
152 auto const workspaces = m_view->getDialogWorkspaces();
153 auto const workspaceIndices = m_view->getDialogWorkspaceIndices();
154
155 if (!workspaces.empty() && !workspaceIndices.empty())
156 addWorkspaces(workspaces, workspaceIndices);
157}
158
161
162 if (m_view->hasLoadedData()) {
164 } else {
166 }
167}
168
171}
172
175}
176
177void FitScriptGeneratorPresenter::handleFunctionRemoved(std::string const &function) {
179}
180
181void FitScriptGeneratorPresenter::handleFunctionAdded(std::string const &function) {
183}
184
187}
188
189void FitScriptGeneratorPresenter::handleParameterChanged(std::string const &parameter) {
191 m_view->parameterValue(parameter));
193}
194
195void FitScriptGeneratorPresenter::handleAttributeChanged(std::string const &attribute) {
197 m_view->attributeValue(attribute));
198}
199
200void FitScriptGeneratorPresenter::handleParameterTieChanged(std::string const &parameter, std::string const &tie) {
202
206}
207
211}
212
214 std::string const &constraint) {
217}
218
219void FitScriptGeneratorPresenter::handleGlobalParametersChanged(std::vector<std::string> const &globalParameters) {
220 try {
221 m_model->setGlobalParameters(globalParameters);
222 } catch (std::invalid_argument const &ex) {
223 m_view->displayWarning(ex.what());
224 }
226}
227
229 std::vector<std::string> workspaceNames, domainNames, ties, constraints;
230 std::vector<double> values;
231 std::vector<bool> fixes;
232 insertLocalParameterData(parameter, workspaceNames, domainNames, values, fixes, ties, constraints);
233
234 m_view->openEditLocalParameterDialog(m_model->getAdjustedFunctionIndex(parameter), workspaceNames, domainNames,
235 values, fixes, ties, constraints);
236}
237
239 auto const [parameter, values, fixes, ties, constraints] = m_view->getEditLocalParameterResults();
240
241 auto const domainIndices = getDomainsWithLocalParameter(parameter);
242 for (auto i = 0u; i < values.size(); ++i) {
243 setLocalParameterDataForDomain(domainIndices[i], parameter, values[i], fixes[i], ties[i], constraints[i]);
244 }
245
247}
248
249void FitScriptGeneratorPresenter::handleOutputBaseNameChanged(std::string const &outputBaseName) {
250 m_model->setOutputBaseName(outputBaseName);
251}
252
254 m_model->setFittingMode(fittingMode);
256}
257
260}
261
264}
265
266void FitScriptGeneratorPresenter::setGlobalTies(std::vector<GlobalTie> const &globalTies) {
267 m_view->setGlobalTies(globalTies);
268}
269
270void FitScriptGeneratorPresenter::setGlobalParameters(std::vector<GlobalParameter> const &globalParameters) {
271 m_view->setGlobalParameters(globalParameters);
272}
273
274void FitScriptGeneratorPresenter::setWorkspaces(QStringList const &workspaceNames, double startX, double endX) {
275 for (auto const &workspaceName : workspaceNames)
276 addWorkspace(workspaceName.toStdString(), startX, endX);
278}
279
280void FitScriptGeneratorPresenter::addWorkspaces(std::vector<MatrixWorkspace_const_sptr> const &workspaces,
281 std::vector<WorkspaceIndex> const &workspaceIndices) {
282 for (auto const &workspace : workspaces) {
283 for (auto const &workspaceIndex : workspaceIndices) {
284 auto const xData = workspace->x(workspaceIndex.value);
285 addWorkspace(workspace, workspaceIndex, xData.front(), xData.back());
286 }
287 }
289}
290
291void FitScriptGeneratorPresenter::addWorkspace(std::string const &workspaceName, double startX, double endX) {
292 auto &ads = AnalysisDataService::Instance();
293 if (ads.doesExist(workspaceName))
294 addWorkspace(ads.retrieveWS<MatrixWorkspace>(workspaceName), startX, endX);
295}
296
298 double endX) {
299 for (auto index = 0u; index < workspace->getNumberHistograms(); ++index)
301}
302
304 WorkspaceIndex workspaceIndex, double startX, double endX) {
305 addWorkspace(workspace->getName(), workspaceIndex, startX, endX);
306}
307
308void FitScriptGeneratorPresenter::addWorkspace(std::string const &workspaceName, WorkspaceIndex workspaceIndex,
309 double startX, double endX) {
310 try {
311 m_model->addWorkspaceDomain(workspaceName, workspaceIndex, startX, endX);
312 m_view->addWorkspaceDomain(workspaceName, workspaceIndex, startX, endX);
313 } catch (std::invalid_argument const &ex) {
314 m_warnings.emplace_back(ex.what());
315 }
316}
317
318void FitScriptGeneratorPresenter::removeDomains(std::vector<FitDomainIndex> const &domainIndices) {
319 for (auto const &index : domainIndices) {
322 }
323
325}
326
327void FitScriptGeneratorPresenter::updateStartX(std::string const &workspaceName, WorkspaceIndex workspaceIndex,
328 double startX) {
329 if (!m_model->updateStartX(workspaceName, workspaceIndex, startX)) {
331 m_view->displayWarning("The StartX provided must be within the x limits of "
332 "its workspace, and less than the EndX.");
333 }
334}
335
336void FitScriptGeneratorPresenter::updateEndX(std::string const &workspaceName, WorkspaceIndex workspaceIndex,
337 double endX) {
338 if (!m_model->updateEndX(workspaceName, workspaceIndex, endX)) {
340 m_view->displayWarning("The EndX provided must be within the x limits of "
341 "its workspace, and greater than the StartX.");
342 }
343}
344
345void FitScriptGeneratorPresenter::updateParameterValue(std::string const &workspaceName, WorkspaceIndex workspaceIndex,
346 std::string const &parameter, double newValue) {
347 auto const equivalentParameter =
348 m_model->getEquivalentFunctionIndexForDomain(workspaceName, workspaceIndex, parameter);
349 m_model->updateParameterValue(workspaceName, workspaceIndex, equivalentParameter, newValue);
350}
351
352void FitScriptGeneratorPresenter::updateAttributeValue(std::string const &workspaceName, WorkspaceIndex workspaceIndex,
353 std::string const &fullAttribute,
354 IFunction::Attribute const &newValue) {
355 m_model->updateAttributeValue(workspaceName, workspaceIndex, fullAttribute, newValue);
356}
357
358void FitScriptGeneratorPresenter::updateParameterTie(std::string const &workspaceName, WorkspaceIndex workspaceIndex,
359 std::string const &parameter, std::string const &tie) {
360 try {
361 auto const [equivalentParameter, equivalentTie] =
362 convertFunctionIndexOfParameterTie(workspaceName, workspaceIndex, parameter, tie);
363 m_model->updateParameterTie(workspaceName, workspaceIndex, equivalentParameter, equivalentTie);
364 } catch (std::invalid_argument const &ex) {
365 m_warnings.emplace_back(ex.what());
366 }
367}
368
369void FitScriptGeneratorPresenter::removeParameterConstraint(std::string const &workspaceName,
370 WorkspaceIndex workspaceIndex,
371 std::string const &parameter) {
372 m_model->removeParameterConstraint(workspaceName, workspaceIndex, parameter);
373}
374
375void FitScriptGeneratorPresenter::updateParameterConstraint(std::string const &workspaceName,
376 WorkspaceIndex workspaceIndex,
377 std::string const &functionIndex,
378 std::string const &constraint) {
379 auto const equivalentFunctionIndex =
380 m_model->getEquivalentFunctionIndexForDomain(workspaceName, workspaceIndex, functionIndex);
381 m_model->updateParameterConstraint(workspaceName, workspaceIndex, equivalentFunctionIndex, constraint);
382}
383
384void FitScriptGeneratorPresenter::removeFunction(std::string const &workspaceName, WorkspaceIndex workspaceIndex,
385 std::string const &function) {
386 m_model->removeFunction(workspaceName, workspaceIndex, function);
387}
388
389void FitScriptGeneratorPresenter::addFunction(std::string const &workspaceName, WorkspaceIndex workspaceIndex,
390 std::string const &function) {
391 m_model->addFunction(workspaceName, workspaceIndex, function);
392}
393
394void FitScriptGeneratorPresenter::setFunction(std::string const &workspaceName, WorkspaceIndex workspaceIndex,
395 std::string const &function) {
396 m_model->setFunction(workspaceName, workspaceIndex, function);
397}
398
400 auto const workspaceName = m_view->workspaceName(domainIndex);
401 auto const workspaceIndex = m_view->workspaceIndex(domainIndex);
402 m_view->setFunction(m_model->getFunction(workspaceName, workspaceIndex));
404}
405
406template <typename GetX, typename UpdateX>
407void FitScriptGeneratorPresenter::updateXLimitForDomain(GetX &&getX, UpdateX &&updateX) {
408 if (m_view->hasLoadedData()) {
409 auto const domainIndex = m_view->currentRow();
410 auto const newValue = std::invoke(std::forward<GetX>(getX), m_view, domainIndex);
411 invokeFunctionForDomain(domainIndex, updateX, newValue);
412 }
413}
414
415template <typename UpdateFunction>
416void FitScriptGeneratorPresenter::updateFunctionStructure(UpdateFunction &&updateFunction,
417 std::string const &function) {
418 if (m_view->hasLoadedData()) {
419 updateFunctionsInModel(updateFunction, function);
420 } else {
421 m_view->displayWarning("Data needs to be loaded using Add Workspace.");
423 }
424}
425
426template <typename UpdateFunction, typename... Args>
427void FitScriptGeneratorPresenter::updateFunctionsInModel(UpdateFunction &&updateFunction, Args... arguments) {
428 for (auto const &rowIndex : getRowIndices()) {
429 invokeFunctionForDomain(rowIndex, updateFunction, arguments...);
430 }
431}
432
433template <typename Function, typename... Args>
435 Args... arguments) {
436 auto const workspaceName = m_view->workspaceName(domainIndex);
437 auto const workspaceIndex = m_view->workspaceIndex(domainIndex);
438
439 std::invoke(std::forward<Function>(func), this, workspaceName, workspaceIndex, arguments...);
440}
441
442std::vector<FitDomainIndex> FitScriptGeneratorPresenter::getRowIndices() const {
444}
445
447 std::vector<std::string> &workspaceNames,
448 std::vector<std::string> &domainNames,
449 std::vector<double> &values, std::vector<bool> &fixes,
450 std::vector<std::string> &ties,
451 std::vector<std::string> &constraints) const {
452 auto domainIndices = m_view->allRows();
453 std::reverse(domainIndices.begin(), domainIndices.end());
454 for (auto const domainIndex : domainIndices) {
455 insertLocalParameterDataForDomain(domainIndex, parameter, workspaceNames, domainNames, values, fixes, ties,
456 constraints);
457 }
458}
459
461 FitDomainIndex domainIndex, std::string const &parameter, std::vector<std::string> &workspaceNames,
462 std::vector<std::string> &domainNames, std::vector<double> &values, std::vector<bool> &fixes,
463 std::vector<std::string> &ties, std::vector<std::string> &constraints) const {
464 if (m_model->hasParameter(domainIndex, parameter)) {
465 workspaceNames.emplace_back(m_view->workspaceName(domainIndex));
466 domainNames.emplace_back(m_model->getDomainName(domainIndex));
467 values.emplace_back(m_model->getParameterValue(domainIndex, parameter));
468 fixes.emplace_back(m_model->isParameterFixed(domainIndex, parameter));
469 ties.emplace_back(m_model->getParameterTie(domainIndex, parameter));
470 constraints.emplace_back(m_model->getParameterConstraint(domainIndex, parameter));
471 }
472}
473
475 std::string const &parameter, double value, bool fix,
476 std::string const &tie,
477 std::string const &constraint) {
478 auto const fullParameter = m_model->getFullParameter(domainIndex, parameter);
479
480 if (m_model->hasParameter(domainIndex, fullParameter)) {
481 m_model->setParameterValue(domainIndex, fullParameter, value);
482 m_model->setParameterTie(domainIndex, fullParameter, tie);
483 m_model->setParameterConstraint(domainIndex, fullParameter, constraint);
484
485 if (tie.empty())
486 m_model->setParameterFixed(domainIndex, fullParameter, fix);
487 }
488}
489
490std::vector<FitDomainIndex>
492 auto const doesNotHaveParameter = [&](FitDomainIndex domainIndex) {
493 return !m_model->hasParameter(domainIndex, m_model->getFullParameter(domainIndex, parameter));
494 };
495
496 auto domainIndices = m_view->allRows();
497 domainIndices.erase(std::remove_if(domainIndices.begin(), domainIndices.end(), doesNotHaveParameter),
498 domainIndices.end());
499 std::reverse(domainIndices.begin(), domainIndices.end());
500 return domainIndices;
501}
502
504 std::string const &workspaceName, WorkspaceIndex workspaceIndex, std::string const &parameter,
505 std::string const &tie) const {
506 auto const equivalentParameter =
507 m_model->getEquivalentFunctionIndexForDomain(workspaceName, workspaceIndex, parameter);
508 auto const equivalentTie = m_model->getEquivalentParameterTieForDomain(workspaceName, workspaceIndex, parameter, tie);
509 return {equivalentParameter, equivalentTie};
510}
511
513 if (!m_warnings.empty()) {
514 std::stringstream ss;
515 std::copy(m_warnings.cbegin(), m_warnings.cend(), std::ostream_iterator<std::string>(ss, "\n"));
516 m_view->displayWarning(ss.str());
517 m_warnings.clear();
518 }
519}
520
521template <typename Generator> void FitScriptGeneratorPresenter::generateFitScript(Generator &&func) const {
522 auto const [valid, message] = m_model->isValid();
523
524 if (!message.empty())
525 m_view->displayWarning(message);
526
527 if (valid)
528 std::invoke(std::forward<Generator>(func), this);
529}
530
532 auto const filepath = m_view->filepath();
533 if (!filepath.empty()) {
535 m_view->setSuccessText("Successfully generated fit script to file '" + filepath + "'");
536 }
537}
538
540 auto const scriptText = m_model->generatePythonFitScript(m_view->fitOptions());
541 if (!scriptText.empty()) {
542 m_view->saveTextToClipboard(scriptText);
543 m_view->setSuccessText("Successfully generated fit script to clipboard");
544 }
545}
546
547} // namespace MantidQt::MantidWidgets
double value
The value of the point.
Definition: FitMW.cpp:51
IPeaksWorkspace_sptr workspace
Definition: IndexPeaks.cpp:114
std::map< DeltaEMode::Type, std::string > index
Definition: DeltaEMode.cpp:19
void updateFunctionsInModel(UpdateFunction &&updateFunction, Args... arguments)
void setFunction(std::string const &workspaceName, WorkspaceIndex workspaceIndex, std::string const &function)
std::tuple< std::string, std::string > convertFunctionIndexOfParameterTie(std::string const &workspaceName, WorkspaceIndex workspaceIndex, std::string const &parameter, std::string const &tie) const
void setGlobalTies(std::vector< GlobalTie > const &globalTies) override
void updateAttributeValue(std::string const &workspaceName, WorkspaceIndex workspaceIndex, std::string const &fullAttribute, Mantid::API::IFunction::Attribute const &newValue)
void notifyPresenter(ViewEvent const &event, std::string const &arg1="", std::string const &arg2="") override
void handleGlobalParametersChanged(std::vector< std::string > const &globalParameters)
void handleADSRenameEvent(std::string const &workspaceName, std::string const &newName)
void addWorkspace(std::string const &workspaceName, double startX, double endX)
void removeDomains(std::vector< FitDomainIndex > const &domainIndices)
void updateFunctionStructure(UpdateFunction &&updateFunction, std::string const &function)
void handleOutputBaseNameChanged(std::string const &outputBaseName)
void invokeFunctionForDomain(FitDomainIndex domainIndex, Function &&func, Args... arguments)
void setWorkspaces(QStringList const &workspaceNames, double startX, double endX)
void updateParameterConstraint(std::string const &workspaceName, WorkspaceIndex workspaceIndex, std::string const &functionIndex, std::string const &constraint)
void handleParameterTieChanged(std::string const &parameter, std::string const &tie)
void updateParameterTie(std::string const &workspaceName, WorkspaceIndex workspaceIndex, std::string const &parameter, std::string const &tie)
void insertLocalParameterData(std::string const &parameter, std::vector< std::string > &workspaceNames, std::vector< std::string > &domainNames, std::vector< double > &values, std::vector< bool > &fixes, std::vector< std::string > &ties, std::vector< std::string > &constraints) const
void handleParameterConstraintChanged(std::string const &functionIndex, std::string const &constraint)
void removeParameterConstraint(std::string const &workspaceName, WorkspaceIndex workspaceIndex, std::string const &parameter)
void setLocalParameterDataForDomain(FitDomainIndex domainIndex, std::string const &parameter, double value, bool fix, std::string const &tie, std::string const &constraint)
void addWorkspaces(std::vector< Mantid::API::MatrixWorkspace_const_sptr > const &workspaces, std::vector< WorkspaceIndex > const &workspaceIndices)
void addFunction(std::string const &workspaceName, WorkspaceIndex workspaceIndex, std::string const &function)
void setGlobalParameters(std::vector< GlobalParameter > const &globalParameters) override
void updateStartX(std::string const &workspaceName, WorkspaceIndex workspaceIndex, double startX)
void updateEndX(std::string const &workspaceName, WorkspaceIndex workspaceIndex, double endX)
void updateParameterValue(std::string const &workspaceName, WorkspaceIndex workspaceIndex, std::string const &parameter, double newValue)
std::vector< FitDomainIndex > getDomainsWithLocalParameter(std::string const &parameter) const
void insertLocalParameterDataForDomain(FitDomainIndex domainIndex, std::string const &parameter, std::vector< std::string > &workspaceNames, std::vector< std::string > &domainNames, std::vector< double > &values, std::vector< bool > &fixes, std::vector< std::string > &ties, std::vector< std::string > &constraints) const
void removeFunction(std::string const &workspaceName, WorkspaceIndex workspaceIndex, std::string const &function)
FitScriptGeneratorPresenter(IFitScriptGeneratorView *view, IFitScriptGeneratorModel *model, QStringList const &workspaceNames=QStringList(), double startX=0.0, double endX=0.0)
virtual void removeFunction(std::string const &workspaceName, WorkspaceIndex workspaceIndex, std::string const &function)=0
virtual void updateParameterTie(std::string const &workspaceName, WorkspaceIndex workspaceIndex, std::string const &fullParameter, std::string const &tie)=0
virtual void addFunction(std::string const &workspaceName, WorkspaceIndex workspaceIndex, std::string const &function)=0
virtual void updateAttributeValue(std::string const &workspaceName, WorkspaceIndex workspaceIndex, std::string const &fullAttribute, Mantid::API::IFunction::Attribute const &newValue)=0
virtual void setParameterTie(FitDomainIndex domainIndex, std::string const &fullParameter, std::string const &tie)=0
virtual std::vector< GlobalParameter > getGlobalParameters() const =0
virtual bool updateStartX(std::string const &workspaceName, WorkspaceIndex workspaceIndex, double startX)=0
virtual void removeParameterConstraint(std::string const &workspaceName, WorkspaceIndex workspaceIndex, std::string const &fullParameter)=0
virtual void updateParameterConstraint(std::string const &workspaceName, WorkspaceIndex workspaceIndex, std::string const &functionIndex, std::string const &constraint)=0
virtual void addWorkspaceDomain(std::string const &workspaceName, WorkspaceIndex workspaceIndex, double startX, double endX)=0
virtual std::string getEquivalentFunctionIndexForDomain(std::string const &workspaceName, WorkspaceIndex workspaceIndex, std::string const &functionIndex) const =0
virtual std::string getParameterConstraint(FitDomainIndex domainIndex, std::string const &fullParameter) const =0
virtual std::string getEquivalentParameterTieForDomain(std::string const &workspaceName, WorkspaceIndex workspaceIndex, std::string const &fullParameter, std::string const &fullTie) const =0
virtual void setFittingMode(FittingMode fittingMode)=0
virtual void subscribePresenter(IFitScriptGeneratorPresenter *presenter)=0
virtual std::vector< GlobalTie > getGlobalTies() const =0
virtual std::string generatePythonFitScript(std::tuple< std::string, std::string, std::string, std::string, std::string, bool > const &fitOptions, std::string const &filepath="")=0
virtual bool hasParameter(FitDomainIndex domainIndex, std::string const &fullParameter) const =0
virtual std::string getParameterTie(FitDomainIndex domainIndex, std::string const &fullParameter) const =0
virtual std::string getFullParameter(FitDomainIndex domainIndex, std::string const &parameter) const =0
virtual void renameWorkspace(std::string const &workspaceName, std::string const &newName)=0
virtual void updateParameterValue(std::string const &workspaceName, WorkspaceIndex workspaceIndex, std::string const &fullParameter, double newValue)=0
virtual std::string getAdjustedFunctionIndex(std::string const &parameter) const =0
virtual void removeDomain(FitDomainIndex domainIndex)=0
virtual std::tuple< bool, std::string > isValid() const =0
virtual std::string getDomainName(FitDomainIndex domainIndex) const =0
virtual void setGlobalParameters(std::vector< std::string > const &parameters)=0
virtual void setOutputBaseName(std::string const &outputBaseName)=0
virtual bool updateEndX(std::string const &workspaceName, WorkspaceIndex workspaceIndex, double endX)=0
virtual Mantid::API::IFunction_sptr getFunction(std::string const &workspaceName, WorkspaceIndex workspaceIndex) const =0
virtual void setParameterFixed(FitDomainIndex domainIndex, std::string const &fullParameter, bool fix)=0
virtual void setParameterConstraint(FitDomainIndex domainIndex, std::string const &fullParameter, std::string const &constraint)=0
virtual void setParameterValue(FitDomainIndex domainIndex, std::string const &fullParameter, double value)=0
virtual void setFunction(std::string const &workspaceName, WorkspaceIndex workspaceIndex, std::string const &function)=0
virtual double getParameterValue(FitDomainIndex domainIndex, std::string const &fullParameter) const =0
virtual bool isParameterFixed(FitDomainIndex domainIndex, std::string const &fullParameter) const =0
virtual std::vector< FitDomainIndex > allRows() const =0
virtual void subscribePresenter(IFitScriptGeneratorPresenter *presenter)=0
virtual void renameWorkspace(std::string const &workspaceName, std::string const &newName)=0
virtual void setSimultaneousMode(bool simultaneousMode)=0
virtual void setGlobalTies(std::vector< GlobalTie > const &globalTies)=0
virtual std::vector< FitDomainIndex > selectedRows() const =0
virtual Mantid::API::IFunction::Attribute attributeValue(std::string const &attribute) const =0
virtual std::tuple< std::string, std::string, std::string, std::string, std::string, bool > fitOptions() const =0
virtual void setSuccessText(std::string const &text)=0
virtual void removeDomain(FitDomainIndex domainIndex)=0
virtual std::vector< Mantid::API::MatrixWorkspace_const_sptr > getDialogWorkspaces()=0
virtual std::string workspaceName(FitDomainIndex index) const =0
virtual void addWorkspaceDomain(std::string const &workspaceName, WorkspaceIndex workspaceIndex, double startX, double endX)=0
virtual FitDomainIndex currentRow() const =0
virtual std::string filepath() const =0
virtual void openEditLocalParameterDialog(std::string const &parameter, std::vector< std::string > const &workspaceNames, std::vector< std::string > const &domainNames, std::vector< double > const &values, std::vector< bool > const &fixes, std::vector< std::string > const &ties, std::vector< std::string > const &constraints)=0
virtual void setGlobalParameters(std::vector< GlobalParameter > const &globalParameter)=0
virtual double endX(FitDomainIndex index) const =0
virtual double startX(FitDomainIndex index) const =0
virtual void displayWarning(std::string const &message)=0
virtual std::tuple< std::string, std::vector< double >, std::vector< bool >, std::vector< std::string >, std::vector< std::string > > getEditLocalParameterResults() const =0
virtual void setFunction(Mantid::API::IFunction_sptr const &function) const =0
virtual std::vector< WorkspaceIndex > getDialogWorkspaceIndices() const =0
virtual WorkspaceIndex workspaceIndex(FitDomainIndex index) const =0
virtual void saveTextToClipboard(std::string const &text) const =0
virtual double parameterValue(std::string const &parameter) const =0
Attribute is a non-fitting parameter.
Definition: IFunction.h:282
Base MatrixWorkspace Abstract Class.
static T & Instance()
Return a reference to the Singleton instance, creating it if it does not already exist Creation is do...
std::shared_ptr< const MatrixWorkspace > MatrixWorkspace_const_sptr
shared pointer to the matrix workspace base class (const version)
A struct to impliment strongly typed integers, without implicit conversion.
Definition: IndexTypes.h:24