Skip to content

Commit

Permalink
Simulation support: renamed our add[Ode|Nla]SolverProperty() method t…
Browse files Browse the repository at this point in the history
…o set[Ode|Nla]SolverProperty() (#2178).

No idea why it was called add[Ode|Nla]SolverProperty() in the first place, but what we are doing is setting and not adding, so...
  • Loading branch information
agarny committed Dec 9, 2019
1 parent ba56f3c commit 09a4f7c
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/misc/furtherinitialize.cpp.inl
Expand Up @@ -124,7 +124,7 @@ QString Simulation::furtherInitialize() const
}
#else

mData->addNlaSolverProperty(id, value);
mData->setNlaSolverProperty(id, value);
#endif
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/misc/initializesolver.cpp.inl
Expand Up @@ -110,7 +110,7 @@ QString Simulation::initializeSolver(const libsedml::SedListOfAlgorithmParameter
}
#else

mData->addOdeSolverProperty(solverInterface->id(parameterKisaoId),
mData->setOdeSolverProperty(solverInterface->id(parameterKisaoId),
QString::fromStdString(sedmlAlgorithmParameter->getValue()));
#endif
}
Expand Down
Expand Up @@ -363,7 +363,7 @@ void SimulationExperimentViewInformationSolversWidget::initialize(SimulationSupp
// the value of list properties as a string rather than an
// index...

pSimulation->data()->addNlaSolverProperty(property->id(),
pSimulation->data()->setNlaSolverProperty(property->id(),
property->variantValue(false),
false);
}
Expand Down
Expand Up @@ -2450,7 +2450,7 @@ void SimulationExperimentViewSimulationWidget::updateSolversProperties(Core::Pro
// retrieve the value of list properties as a string
// rather than an index...

mSimulation->data()->addOdeSolverProperty(property->id(),
mSimulation->data()->setOdeSolverProperty(property->id(),
property->variantValue(false));

needOdeSolverGuiUpdate = true;
Expand Down Expand Up @@ -2489,7 +2489,7 @@ void SimulationExperimentViewSimulationWidget::updateSolversProperties(Core::Pro
// retrieve the value of list properties as a string
// rather than an index...

mSimulation->data()->addNlaSolverProperty(property->id(),
mSimulation->data()->setNlaSolverProperty(property->id(),
property->variantValue(false),
pResetNlaSolver);

Expand Down
8 changes: 4 additions & 4 deletions src/plugins/support/SimulationSupport/src/simulation.cpp
Expand Up @@ -403,10 +403,10 @@ Solver::Solver::Properties SimulationData::odeSolverProperties() const

//==============================================================================

void SimulationData::addOdeSolverProperty(const QString &pName,
void SimulationData::setOdeSolverProperty(const QString &pName,
const QVariant &pValue)
{
// Add an ODE solver property
// Set an ODE solver property

if (mSimulation->runtime() != nullptr) {
mOdeSolverProperties.insert(pName, pValue);
Expand Down Expand Up @@ -472,10 +472,10 @@ Solver::Solver::Properties SimulationData::nlaSolverProperties() const

//==============================================================================

void SimulationData::addNlaSolverProperty(const QString &pName,
void SimulationData::setNlaSolverProperty(const QString &pName,
const QVariant &pValue, bool pReset)
{
// Add an NLA solver property
// Set an NLA solver property

if (( mSimulation->runtime() != nullptr)
&& mSimulation->runtime()->needNlaSolver()) {
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/support/SimulationSupport/src/simulation.h
Expand Up @@ -234,8 +234,8 @@ public slots:
Solver::Solver::Properties odeSolverProperties() const;
Solver::Solver::Properties nlaSolverProperties() const;

void addOdeSolverProperty(const QString &pName, const QVariant &pValue);
void addNlaSolverProperty(const QString &pName, const QVariant &pValue,
void setOdeSolverProperty(const QString &pName, const QVariant &pValue);
void setNlaSolverProperty(const QString &pName, const QVariant &pValue,
bool pReset = true);

void reset(bool pInitialize = true, bool pAll = true);
Expand Down
Expand Up @@ -63,7 +63,7 @@ static void setOdeSolver(SimulationData *pSimulationData,
for (const auto &solverInterfaceProperty : solverInterface->solverProperties()) {
// Set each ODE solver property to their default value

pSimulationData->addOdeSolverProperty(solverInterfaceProperty.id(), solverInterfaceProperty.defaultValue());
pSimulationData->setOdeSolverProperty(solverInterfaceProperty.id(), solverInterfaceProperty.defaultValue());
}

return;
Expand All @@ -90,7 +90,7 @@ static void setNlaSolver(SimulationData *pSimulationData,
for (const auto &solverInterfaceProperty : solverInterface->solverProperties()) {
// Set each NLA solver property to their default value

pSimulationData->addNlaSolverProperty(solverInterfaceProperty.id(), solverInterfaceProperty.defaultValue());
pSimulationData->setNlaSolverProperty(solverInterfaceProperty.id(), solverInterfaceProperty.defaultValue());
}

return;
Expand Down

0 comments on commit 09a4f7c

Please sign in to comment.