16 #include "Base/Util/Assert.h"
17 #include "Fit/Param/Parameters.h"
33 ASSERT(parameterItem);
39 fitPar->setStartValue(parameterItem->
valueOfLink());
45 const QString& fitParName)
49 if (fitPar->displayName() == fitParName) {
61 if (
item->links().contains(link))
82 result.append(
item->displayName());
89 fitParItem->removeLink(parameterItem->
link());
102 ASSERT(parameterContainer);
104 QVector<FitParameterItem*> fitPars = items<FitParameterItem>(
T_FIT_PARAMETERS);
107 for (
int i = 0; i < fitPars.size(); ++i) {
108 auto link_list = fitPars[i]->linkItems();
109 if (link_list.empty())
112 if (
auto* itemInTuningTree = parameterContainer->
findParameterItem(linkItem->link()))
113 itemInTuningTree->propagateValueToLink(values[
index]);
121 mumufit::Parameters result;
125 if (!fitPar->isValid()) {
127 QString(
"FitParameterContainerItem::createParameters(): invalid starting value "
128 "or (min, max) range in fitting parameter par %1")
131 double startValue = fitPar->startValue();
132 AttLimits
limits = fitPar->attLimits();
133 QString
name = QString(
"par%1").arg(
index);
134 result.add(mumufit::Parameter(
name.toStdString(), startValue,
limits));
Defines class FitParameterContainerItem.
Defines class FitParameterItem.
Defines class FitParameterLinkItem.
Defines classes for ParameterTreeItems.
Defines class SessionModel.
static constexpr auto T_FIT_PARAMETERS
QStringList fitParameterNames() const
Returns list of fit parameter display names.
FitParameterItem * fitParameterItem(const QString &link) const
get the fit parameter item whose link matches the given link.
mumufit::Parameters createParameters() const
void removeLink(const ParameterItem *parameterItem)
void createFitParameter(ParameterItem *parameterItem)
Creates fit parameter from given ParameterItem, sets starting value to the value of ParameterItem,...
FitParameterContainerItem()
void setValuesInParameterContainer(const QVector< double > &values, class ParameterContainerItem *parameterContainer)
Propagate values to the corresponding parameter tree items of parameterContainer.
QVector< FitParameterItem * > fitParameterItems() const
void addToFitParameter(ParameterItem *parameterItem, const QString &fitParName)
Adds given parameterItem to the existing fit parameter with display name fitParName....
FitParameterItems is a collection of items to define fit parameters in GUI.
static constexpr auto M_TYPE
The FitParameterLinkItem class holds a link to ParameterItem in tuning tree.
The ParameterContainerItem is a top item to hold all ParameterItem, represents an entry point to para...
ParameterItem * findParameterItem(const QString &link) const
The ParameterItem class represent a tuning value in a parameter tuning tree.
QString titleForFitItem() const
double valueOfLink() const
QString link() const
Unique string to identify this ParameterItem.
RealLimits limitsOfLink() const
Base class for a GUI data item.
bool registerTag(const QString &name, int min=0, int max=-1, QStringList modelTypes={})
Add new tag to this item with given name, min, max and types. max = -1 -> unlimited,...
void setDisplayName(const QString &display_name)
Set display name.
void setDefaultTag(const QString &tag)
Set default tag.
SessionModel * model() const
Returns model of this item.
T * item(const QString &tag) const
RealLimits limits() const
QModelIndex index() const
Returns model index of this item.
T * insertItem(SessionItem *parent=nullptr, int row=-1, QString tag="")
QString const & name(EShape k)