Mantid
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
MantidQt::MantidWidgets::FitScriptGeneratorPresenter Class Reference

#include <FitScriptGeneratorPresenter.h>

Inheritance diagram for MantidQt::MantidWidgets::FitScriptGeneratorPresenter:
MantidQt::MantidWidgets::IFitScriptGeneratorPresenter

Public Member Functions

 FitScriptGeneratorPresenter (IFitScriptGeneratorView *view, IFitScriptGeneratorModel *model, QStringList const &workspaceNames=QStringList(), double startX=0.0, double endX=0.0)
 
void notifyPresenter (ViewEvent const &event, FittingMode fittingMode) override
 
void notifyPresenter (ViewEvent const &event, std::string const &arg1="", std::string const &arg2="") override
 
void notifyPresenter (ViewEvent const &event, std::vector< std::string > const &vec) override
 
void openFitScriptGenerator () override
 
void setGlobalParameters (std::vector< GlobalParameter > const &globalParameters) override
 
void setGlobalTies (std::vector< GlobalTie > const &globalTies) override
 
 ~FitScriptGeneratorPresenter () override
 
- Public Member Functions inherited from MantidQt::MantidWidgets::IFitScriptGeneratorPresenter
virtual void notifyPresenter (ViewEvent const &event, FittingMode fittingMode)=0
 
virtual void notifyPresenter (ViewEvent const &event, std::string const &arg1="", std::string const &arg2="")=0
 
virtual void notifyPresenter (ViewEvent const &event, std::vector< std::string > const &vec)=0
 
virtual void openFitScriptGenerator ()=0
 
virtual void setGlobalParameters (std::vector< MantidQt::MantidWidgets::GlobalParameter > const &globalParameters)=0
 
virtual void setGlobalTies (std::vector< MantidQt::MantidWidgets::GlobalTie > const &globalTies)=0
 
virtual ~IFitScriptGeneratorPresenter ()=default
 

Private Member Functions

void addFunction (std::string const &workspaceName, WorkspaceIndex workspaceIndex, std::string const &function)
 
void addWorkspace (Mantid::API::MatrixWorkspace_const_sptr const &workspace, double startX, double endX)
 
void addWorkspace (Mantid::API::MatrixWorkspace_const_sptr const &workspace, WorkspaceIndex workspaceIndex, double startX, double endX)
 
void addWorkspace (std::string const &workspaceName, double startX, double endX)
 
void addWorkspace (std::string const &workspaceName, WorkspaceIndex workspaceIndex, double startX, double endX)
 
void addWorkspaces (std::vector< Mantid::API::MatrixWorkspace_const_sptr > const &workspaces, std::vector< WorkspaceIndex > const &workspaceIndices)
 
void checkForWarningMessages ()
 
std::tuple< std::string, std::string > convertFunctionIndexOfParameterTie (std::string const &workspaceName, WorkspaceIndex workspaceIndex, std::string const &parameter, std::string const &tie) const
 
template<typename Generator >
void generateFitScript (Generator &&func) const
 
void generateScriptToClipboard () const
 
void generateScriptToFile () const
 
std::vector< FitDomainIndexgetDomainsWithLocalParameter (std::string const &parameter) const
 
std::vector< FitDomainIndexgetRowIndices () const
 
void handleAddDomainAccepted ()
 
void handleAddDomainClicked ()
 
void handleADSClearEvent ()
 
void handleADSDeleteEvent (std::string const &workspaceName)
 
void handleADSRenameEvent (std::string const &workspaceName, std::string const &newName)
 
void handleAttributeChanged (std::string const &attribute)
 
void handleEditLocalParameterClicked (std::string const &parameter)
 
void handleEditLocalParameterFinished ()
 
void handleEndXChanged ()
 
void handleFittingModeChanged (FittingMode fittingMode)
 
void handleFunctionAdded (std::string const &function)
 
void handleFunctionRemoved (std::string const &function)
 
void handleFunctionReplaced (std::string const &function)
 
void handleGenerateScriptToClipboardClicked ()
 
void handleGenerateScriptToFileClicked ()
 
void handleGlobalParametersChanged (std::vector< std::string > const &globalParameters)
 
void handleOutputBaseNameChanged (std::string const &outputBaseName)
 
void handleParameterChanged (std::string const &parameter)
 
void handleParameterConstraintChanged (std::string const &functionIndex, std::string const &constraint)
 
void handleParameterConstraintRemoved (std::string const &parameter)
 
void handleParameterTieChanged (std::string const &parameter, std::string const &tie)
 
void handleRemoveDomainClicked ()
 
void handleSelectionChanged ()
 
void handleStartXChanged ()
 
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 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
 
template<typename Function , typename... Args>
void invokeFunctionForDomain (FitDomainIndex domainIndex, Function &&func, Args... arguments)
 
void removeDomains (std::vector< FitDomainIndex > const &domainIndices)
 
void removeFunction (std::string const &workspaceName, WorkspaceIndex workspaceIndex, std::string const &function)
 
void removeParameterConstraint (std::string const &workspaceName, WorkspaceIndex workspaceIndex, std::string const &parameter)
 
void setFunction (std::string const &workspaceName, WorkspaceIndex workspaceIndex, std::string const &function)
 
void setLocalParameterDataForDomain (FitDomainIndex domainIndex, std::string const &parameter, double value, bool fix, std::string const &tie, std::string const &constraint)
 
void setWorkspaces (QStringList const &workspaceNames, double startX, double endX)
 
void updateAttributeValue (std::string const &workspaceName, WorkspaceIndex workspaceIndex, std::string const &fullAttribute, Mantid::API::IFunction::Attribute const &newValue)
 
void updateEndX (std::string const &workspaceName, WorkspaceIndex workspaceIndex, double endX)
 
void updateFunctionInViewFromModel (FitDomainIndex domainIndex)
 
template<typename UpdateFunction , typename... Args>
void updateFunctionsInModel (UpdateFunction &&updateFunction, Args... arguments)
 
template<typename UpdateFunction >
void updateFunctionStructure (UpdateFunction &&updateFunction, std::string const &function)
 
void updateParameterConstraint (std::string const &workspaceName, WorkspaceIndex workspaceIndex, std::string const &functionIndex, std::string const &constraint)
 
void updateParameterTie (std::string const &workspaceName, WorkspaceIndex workspaceIndex, std::string const &parameter, std::string const &tie)
 
void updateParameterValue (std::string const &workspaceName, WorkspaceIndex workspaceIndex, std::string const &parameter, double newValue)
 
void updateStartX (std::string const &workspaceName, WorkspaceIndex workspaceIndex, double startX)
 
template<typename GetX , typename UpdateX >
void updateXLimitForDomain (GetX &&getX, UpdateX &&updateX)
 

Private Attributes

IFitScriptGeneratorModelm_model
 
IFitScriptGeneratorViewm_view
 
std::vector< std::string > m_warnings
 

Detailed Description

Definition at line 30 of file FitScriptGeneratorPresenter.h.

Constructor & Destructor Documentation

◆ FitScriptGeneratorPresenter()

MantidQt::MantidWidgets::FitScriptGeneratorPresenter::FitScriptGeneratorPresenter ( IFitScriptGeneratorView view,
IFitScriptGeneratorModel model,
QStringList const &  workspaceNames = QStringList(),
double  startX = 0.0,
double  endX = 0.0 
)

◆ ~FitScriptGeneratorPresenter()

MantidQt::MantidWidgets::FitScriptGeneratorPresenter::~FitScriptGeneratorPresenter ( )
overridedefault

Member Function Documentation

◆ addFunction()

void MantidQt::MantidWidgets::FitScriptGeneratorPresenter::addFunction ( std::string const &  workspaceName,
WorkspaceIndex  workspaceIndex,
std::string const &  function 
)
private

◆ addWorkspace() [1/4]

void MantidQt::MantidWidgets::FitScriptGeneratorPresenter::addWorkspace ( Mantid::API::MatrixWorkspace_const_sptr const &  workspace,
double  startX,
double  endX 
)
private

Definition at line 297 of file FitScriptGeneratorPresenter.cpp.

References addWorkspace(), index, and workspace.

◆ addWorkspace() [2/4]

void MantidQt::MantidWidgets::FitScriptGeneratorPresenter::addWorkspace ( Mantid::API::MatrixWorkspace_const_sptr const &  workspace,
WorkspaceIndex  workspaceIndex,
double  startX,
double  endX 
)
private

Definition at line 303 of file FitScriptGeneratorPresenter.cpp.

References addWorkspace(), and workspace.

◆ addWorkspace() [3/4]

void MantidQt::MantidWidgets::FitScriptGeneratorPresenter::addWorkspace ( std::string const &  workspaceName,
double  startX,
double  endX 
)
private

◆ addWorkspace() [4/4]

void MantidQt::MantidWidgets::FitScriptGeneratorPresenter::addWorkspace ( std::string const &  workspaceName,
WorkspaceIndex  workspaceIndex,
double  startX,
double  endX 
)
private

◆ addWorkspaces()

void MantidQt::MantidWidgets::FitScriptGeneratorPresenter::addWorkspaces ( std::vector< Mantid::API::MatrixWorkspace_const_sptr > const &  workspaces,
std::vector< WorkspaceIndex > const &  workspaceIndices 
)
private

◆ checkForWarningMessages()

void MantidQt::MantidWidgets::FitScriptGeneratorPresenter::checkForWarningMessages ( )
private

◆ convertFunctionIndexOfParameterTie()

std::tuple< std::string, std::string > MantidQt::MantidWidgets::FitScriptGeneratorPresenter::convertFunctionIndexOfParameterTie ( std::string const &  workspaceName,
WorkspaceIndex  workspaceIndex,
std::string const &  parameter,
std::string const &  tie 
) const
private

◆ generateFitScript()

template<typename Generator >
void MantidQt::MantidWidgets::FitScriptGeneratorPresenter::generateFitScript ( Generator &&  func) const
private

◆ generateScriptToClipboard()

void MantidQt::MantidWidgets::FitScriptGeneratorPresenter::generateScriptToClipboard ( ) const
private

◆ generateScriptToFile()

void MantidQt::MantidWidgets::FitScriptGeneratorPresenter::generateScriptToFile ( ) const
private

◆ getDomainsWithLocalParameter()

std::vector< FitDomainIndex > MantidQt::MantidWidgets::FitScriptGeneratorPresenter::getDomainsWithLocalParameter ( std::string const &  parameter) const
private

◆ getRowIndices()

std::vector< FitDomainIndex > MantidQt::MantidWidgets::FitScriptGeneratorPresenter::getRowIndices ( ) const
private

◆ handleAddDomainAccepted()

void MantidQt::MantidWidgets::FitScriptGeneratorPresenter::handleAddDomainAccepted ( )
private

◆ handleAddDomainClicked()

void MantidQt::MantidWidgets::FitScriptGeneratorPresenter::handleAddDomainClicked ( )
private

◆ handleADSClearEvent()

void MantidQt::MantidWidgets::FitScriptGeneratorPresenter::handleADSClearEvent ( )
private

◆ handleADSDeleteEvent()

void MantidQt::MantidWidgets::FitScriptGeneratorPresenter::handleADSDeleteEvent ( std::string const &  workspaceName)
private

◆ handleADSRenameEvent()

void MantidQt::MantidWidgets::FitScriptGeneratorPresenter::handleADSRenameEvent ( std::string const &  workspaceName,
std::string const &  newName 
)
private

◆ handleAttributeChanged()

void MantidQt::MantidWidgets::FitScriptGeneratorPresenter::handleAttributeChanged ( std::string const &  attribute)
private

◆ handleEditLocalParameterClicked()

void MantidQt::MantidWidgets::FitScriptGeneratorPresenter::handleEditLocalParameterClicked ( std::string const &  parameter)
private

◆ handleEditLocalParameterFinished()

void MantidQt::MantidWidgets::FitScriptGeneratorPresenter::handleEditLocalParameterFinished ( )
private

◆ handleEndXChanged()

void MantidQt::MantidWidgets::FitScriptGeneratorPresenter::handleEndXChanged ( )
private

◆ handleFittingModeChanged()

void MantidQt::MantidWidgets::FitScriptGeneratorPresenter::handleFittingModeChanged ( FittingMode  fittingMode)
private

◆ handleFunctionAdded()

void MantidQt::MantidWidgets::FitScriptGeneratorPresenter::handleFunctionAdded ( std::string const &  function)
private

Definition at line 181 of file FitScriptGeneratorPresenter.cpp.

References addFunction(), and updateFunctionStructure().

Referenced by notifyPresenter().

◆ handleFunctionRemoved()

void MantidQt::MantidWidgets::FitScriptGeneratorPresenter::handleFunctionRemoved ( std::string const &  function)
private

Definition at line 177 of file FitScriptGeneratorPresenter.cpp.

References removeFunction(), and updateFunctionStructure().

Referenced by notifyPresenter().

◆ handleFunctionReplaced()

void MantidQt::MantidWidgets::FitScriptGeneratorPresenter::handleFunctionReplaced ( std::string const &  function)
private

Definition at line 185 of file FitScriptGeneratorPresenter.cpp.

References setFunction(), and updateFunctionStructure().

Referenced by notifyPresenter().

◆ handleGenerateScriptToClipboardClicked()

void MantidQt::MantidWidgets::FitScriptGeneratorPresenter::handleGenerateScriptToClipboardClicked ( )
private

Definition at line 262 of file FitScriptGeneratorPresenter.cpp.

References generateFitScript(), and generateScriptToClipboard().

Referenced by notifyPresenter().

◆ handleGenerateScriptToFileClicked()

void MantidQt::MantidWidgets::FitScriptGeneratorPresenter::handleGenerateScriptToFileClicked ( )
private

Definition at line 258 of file FitScriptGeneratorPresenter.cpp.

References generateFitScript(), and generateScriptToFile().

Referenced by notifyPresenter().

◆ handleGlobalParametersChanged()

void MantidQt::MantidWidgets::FitScriptGeneratorPresenter::handleGlobalParametersChanged ( std::vector< std::string > const &  globalParameters)
private

◆ handleOutputBaseNameChanged()

void MantidQt::MantidWidgets::FitScriptGeneratorPresenter::handleOutputBaseNameChanged ( std::string const &  outputBaseName)
private

◆ handleParameterChanged()

void MantidQt::MantidWidgets::FitScriptGeneratorPresenter::handleParameterChanged ( std::string const &  parameter)
private

◆ handleParameterConstraintChanged()

void MantidQt::MantidWidgets::FitScriptGeneratorPresenter::handleParameterConstraintChanged ( std::string const &  functionIndex,
std::string const &  constraint 
)
private

◆ handleParameterConstraintRemoved()

void MantidQt::MantidWidgets::FitScriptGeneratorPresenter::handleParameterConstraintRemoved ( std::string const &  parameter)
private

◆ handleParameterTieChanged()

void MantidQt::MantidWidgets::FitScriptGeneratorPresenter::handleParameterTieChanged ( std::string const &  parameter,
std::string const &  tie 
)
private

◆ handleRemoveDomainClicked()

void MantidQt::MantidWidgets::FitScriptGeneratorPresenter::handleRemoveDomainClicked ( )
private

◆ handleSelectionChanged()

void MantidQt::MantidWidgets::FitScriptGeneratorPresenter::handleSelectionChanged ( )
private

◆ handleStartXChanged()

void MantidQt::MantidWidgets::FitScriptGeneratorPresenter::handleStartXChanged ( )
private

◆ insertLocalParameterData()

void MantidQt::MantidWidgets::FitScriptGeneratorPresenter::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
private

◆ insertLocalParameterDataForDomain()

void MantidQt::MantidWidgets::FitScriptGeneratorPresenter::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
private

◆ invokeFunctionForDomain()

template<typename Function , typename... Args>
void MantidQt::MantidWidgets::FitScriptGeneratorPresenter::invokeFunctionForDomain ( FitDomainIndex  domainIndex,
Function &&  func,
Args...  arguments 
)
private

◆ notifyPresenter() [1/3]

void MantidQt::MantidWidgets::FitScriptGeneratorPresenter::notifyPresenter ( ViewEvent const &  event,
FittingMode  fittingMode 
)
overridevirtual

◆ notifyPresenter() [2/3]

void MantidQt::MantidWidgets::FitScriptGeneratorPresenter::notifyPresenter ( ViewEvent const &  event,
std::string const &  arg1 = "",
std::string const &  arg2 = "" 
)
overridevirtual

◆ notifyPresenter() [3/3]

void MantidQt::MantidWidgets::FitScriptGeneratorPresenter::notifyPresenter ( ViewEvent const &  event,
std::vector< std::string > const &  vec 
)
overridevirtual

◆ openFitScriptGenerator()

void MantidQt::MantidWidgets::FitScriptGeneratorPresenter::openFitScriptGenerator ( )
overridevirtual

◆ removeDomains()

void MantidQt::MantidWidgets::FitScriptGeneratorPresenter::removeDomains ( std::vector< FitDomainIndex > const &  domainIndices)
private

◆ removeFunction()

void MantidQt::MantidWidgets::FitScriptGeneratorPresenter::removeFunction ( std::string const &  workspaceName,
WorkspaceIndex  workspaceIndex,
std::string const &  function 
)
private

◆ removeParameterConstraint()

void MantidQt::MantidWidgets::FitScriptGeneratorPresenter::removeParameterConstraint ( std::string const &  workspaceName,
WorkspaceIndex  workspaceIndex,
std::string const &  parameter 
)
private

◆ setFunction()

void MantidQt::MantidWidgets::FitScriptGeneratorPresenter::setFunction ( std::string const &  workspaceName,
WorkspaceIndex  workspaceIndex,
std::string const &  function 
)
private

◆ setGlobalParameters()

void MantidQt::MantidWidgets::FitScriptGeneratorPresenter::setGlobalParameters ( std::vector< GlobalParameter > const &  globalParameters)
overridevirtual

◆ setGlobalTies()

void MantidQt::MantidWidgets::FitScriptGeneratorPresenter::setGlobalTies ( std::vector< GlobalTie > const &  globalTies)
overridevirtual

◆ setLocalParameterDataForDomain()

void MantidQt::MantidWidgets::FitScriptGeneratorPresenter::setLocalParameterDataForDomain ( FitDomainIndex  domainIndex,
std::string const &  parameter,
double  value,
bool  fix,
std::string const &  tie,
std::string const &  constraint 
)
private

◆ setWorkspaces()

void MantidQt::MantidWidgets::FitScriptGeneratorPresenter::setWorkspaces ( QStringList const &  workspaceNames,
double  startX,
double  endX 
)
private

◆ updateAttributeValue()

void MantidQt::MantidWidgets::FitScriptGeneratorPresenter::updateAttributeValue ( std::string const &  workspaceName,
WorkspaceIndex  workspaceIndex,
std::string const &  fullAttribute,
Mantid::API::IFunction::Attribute const &  newValue 
)
private

◆ updateEndX()

void MantidQt::MantidWidgets::FitScriptGeneratorPresenter::updateEndX ( std::string const &  workspaceName,
WorkspaceIndex  workspaceIndex,
double  endX 
)
private

◆ updateFunctionInViewFromModel()

void MantidQt::MantidWidgets::FitScriptGeneratorPresenter::updateFunctionInViewFromModel ( FitDomainIndex  domainIndex)
private

◆ updateFunctionsInModel()

template<typename UpdateFunction , typename... Args>
void MantidQt::MantidWidgets::FitScriptGeneratorPresenter::updateFunctionsInModel ( UpdateFunction &&  updateFunction,
Args...  arguments 
)
private

◆ updateFunctionStructure()

template<typename UpdateFunction >
void MantidQt::MantidWidgets::FitScriptGeneratorPresenter::updateFunctionStructure ( UpdateFunction &&  updateFunction,
std::string const &  function 
)
private

◆ updateParameterConstraint()

void MantidQt::MantidWidgets::FitScriptGeneratorPresenter::updateParameterConstraint ( std::string const &  workspaceName,
WorkspaceIndex  workspaceIndex,
std::string const &  functionIndex,
std::string const &  constraint 
)
private

◆ updateParameterTie()

void MantidQt::MantidWidgets::FitScriptGeneratorPresenter::updateParameterTie ( std::string const &  workspaceName,
WorkspaceIndex  workspaceIndex,
std::string const &  parameter,
std::string const &  tie 
)
private

◆ updateParameterValue()

void MantidQt::MantidWidgets::FitScriptGeneratorPresenter::updateParameterValue ( std::string const &  workspaceName,
WorkspaceIndex  workspaceIndex,
std::string const &  parameter,
double  newValue 
)
private

◆ updateStartX()

void MantidQt::MantidWidgets::FitScriptGeneratorPresenter::updateStartX ( std::string const &  workspaceName,
WorkspaceIndex  workspaceIndex,
double  startX 
)
private

◆ updateXLimitForDomain()

template<typename GetX , typename UpdateX >
void MantidQt::MantidWidgets::FitScriptGeneratorPresenter::updateXLimitForDomain ( GetX &&  getX,
UpdateX &&  updateX 
)
private

Member Data Documentation

◆ m_model

IFitScriptGeneratorModel* MantidQt::MantidWidgets::FitScriptGeneratorPresenter::m_model
private

◆ m_view

IFitScriptGeneratorView* MantidQt::MantidWidgets::FitScriptGeneratorPresenter::m_view
private

◆ m_warnings

std::vector<std::string> MantidQt::MantidWidgets::FitScriptGeneratorPresenter::m_warnings
private

The documentation for this class was generated from the following files: