void ALCBaselineModellingView::setFunction(IFunction_const_sptr func) { if (!func) { m_ui.function->clear(); } else { size_t nParams = func->nParams(); for (size_t i = 0; i < nParams; i++) { QString name = QString::fromStdString(func->parameterName(i)); double value = func->getParameter(i); double error = func->getError(i); m_ui.function->setParameter(name, value); m_ui.function->setParamError(name, error); } } }
void ALCPeakFittingView::setFunction(const IFunction_const_sptr &newFunction) { if (newFunction) { size_t nParams = newFunction->nParams(); for (size_t i = 0; i < nParams; i++) { QString name = QString::fromStdString(newFunction->parameterName(i)); double value = newFunction->getParameter(i); double error = newFunction->getError(i); m_ui.peaks->setParameter(name, value); m_ui.peaks->setParamError(name, error); } } else { m_ui.peaks->clear(); } }