28 QStringList tooltips = QStringList() <<
"Fixed at given value"
29 <<
"Limited in the range [min, max]"
30 <<
"Limited at lower bound [min, inf]"
31 <<
"Limited at upper bound [-inf, max]"
32 <<
"No limits imposed to parameter value";
45 const double range_factor = 0.5;
96 dr = 1.0 * range_factor;
98 dr = std::abs(
value) * range_factor;
101 double min =
value - dr;
102 double max =
value + dr;
143 throw GUIHelpers::Error(
"FitParameterItem::attLimits() -> Error. Unknown limit type");
261 QVector<FitParameterItem*> result;
277 ASSERT(parameterContainer);
282 for (
int i = 0; i < fitPars.size(); ++i) {
284 if (link_list.empty())
286 for (
auto linkItem : link_list) {
290 if (itemInTuningTree)
304 if (!fitPar->isValid()) {
305 std::stringstream ss;
306 ss <<
"FitParameterContainerItem::createParameters(): invalid starting value "
307 "or (min, max) range in fitting parameter par"
309 std::string message = ss.str();
314 QString
name = QString(
"par%1").arg(
index);
#define ASSERT(condition)
Defines class ComboProperty.
Defines FitParameterItems family of classes.
Defines class GUIHelpers functions.
Defines ModelPath namespace.
Defines classes for ParameterTreeItems.
Defines class Parameters.
Attributes and limits of a fit parameter, and coupling between these properties.
static AttLimits lowerLimited(double bound_value)
static AttLimits limitless()
static AttLimits upperLimited(double bound_value)
static AttLimits limited(double left_bound_value, double right_bound_value)
Custom property to define list of string values with multiple selections.
void setValue(const QString &name)
void setToolTips(const QStringList &tooltips)
FitParameterItem * fitParameterItem(const QString &link)
returns FitParameterItem for given link (path in model)
mumufit::Parameters createParameters() const
static const QString T_FIT_PARAMETERS
FitParameterContainerItem()
QVector< FitParameterItem * > fitParameterItems()
void setValuesInParameterContainer(const QVector< double > &values, class ParameterContainerItem *parameterContainer)
Propagate values to the corresponding parameter tree items of parameterContainer.
The FitParameterItem class represents a fit parameter in GUI.
static const QString P_MAX
static const QString T_LINK
void setLimitEnabled(const QString &name, bool enabled)
Set limit property with given name to the enabled state.
bool isUpperLimited() const
static const QString P_TYPE
void onTypeChange()
Enables/disables min, max properties on FitParameterItem's type.
bool isLowerLimited() const
static const QString P_MIN
void initMinMaxValues(const RealLimits &limits)
Inits P_MIN and P_MAX taking into account current value and external limits.
QString parameterType() const
AttLimits attLimits() const
Constructs Limits correspodning to current GUI settings.
static const QString P_START_VALUE
static const QString P_DOMAIN
static const QString P_LINK
void setOnPropertyChange(std::function< void(QString)> f, const void *caller=0)
The ParameterContainerItem is a top item to hold all ParameterItem, represents an entry point to para...
The ParameterItem class represent a tuning value in a parameter tuning tree.
void propagateValueToLink(double newValue)
Sets current value to the original PropertyItem of MultiLayerItem/InstrumentItem.
Limits for a real fit parameter.
static RealLimits limitless()
Creates an object withoud bounds (default)
bool hasUpperLimit() const
if has upper limit
double upperLimit() const
Returns upper limit.
double lowerLimit() const
Returns lower limit.
bool hasLowerLimit() const
if has lower limit
bool isTag(const QString &name) const
Returns true if tag is available.
SessionItem * addProperty(const QString &name, const QVariant &variant)
Add new property item and register new tag.
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.
QVector< SessionItem * > getItems(const QString &tag="") const
Returns vector of all items of given tag.
QVariant value() const
Get value.
SessionItem & setEditorType(const QString &editorType)
QVariant getItemValue(const QString &tag) const
Directly access value of item under given tag.
ModelMapper * mapper()
Returns the current model mapper of this item. Creates new one if necessary.
void setDefaultTag(const QString &tag)
Set default tag.
T * item(const QString &tag) const
void setItemValue(const QString &tag, const QVariant &variant)
Directly set value of item under given tag.
void setEditable(bool enabled)
RealLimits limits() const
void setEnabled(bool enabled)
QModelIndex index() const
Returns model index of this item.
SessionItem * getItem(const QString &tag="", int row=0) const
Returns item in given row of given tag.
SessionItem & setLimits(const RealLimits &value)
A fittable parameter with value, error, step, and limits.
A collection of fit parameters.
void add(const Parameter &par)
SessionItem * getItemFromPath(const QString &relPath, const SessionItem *parent)
returns an item from relative path wrt to given parent
QString const & name(EShape k)