16 #include "Base/Util/Assert.h"
25 QStringList tooltips = QStringList() <<
"Fixed at given value"
26 <<
"Limited in the range [min, max]"
27 <<
"Limited at lower bound [min, inf]"
28 <<
"Limited at upper bound [-inf, max]"
29 <<
"No limits imposed to parameter value";
42 const double range_factor = 0.5;
77 dr = 1.0 * range_factor;
79 dr = std::abs(
value) * range_factor;
81 double min =
value - dr;
82 double max =
value + dr;
103 return AttLimits::fixed();
111 return AttLimits::limitless();
180 newLink->setLink(link);
185 return items<FitParameterLinkItem>(
T_LINK);
192 links << linkItem->link();
199 if (linkItem->link() == link)
200 model()->removeRow(linkItem->index().row(), linkItem->index().parent());
251 ASSERT(propertyItem);
Defines class ComboProperty.
Defines class FitParameterItem.
Defines class FitParameterLinkItem.
Defines class SessionModel.
Custom property to define list of string values with multiple selections. Intended for QVariant.
void setValue(const QString &name)
void setToolTips(const QStringList &tooltips)
SessionItem * minimumItem() const
void setMaximum(double maximum)
SessionItem * maximumItem() const
QVector< FitParameterLinkItem * > linkItems() const
void setLimitEnabled(const QString &name, bool enabled)
Set limit property with given name to the enabled state.
bool isUpperLimited() const
void setStartValue(double start_value)
SessionItem * typeItem() const
void removeLink(const QString &link)
QStringList links() const
static constexpr auto T_LINK
void onTypeChange()
Enables/disables min, max properties on FitParameterItem's type.
static constexpr auto P_MIN
static constexpr auto P_START_VALUE
bool isLowerLimited() const
double startValue() const
void setMinimum(double minimum)
void initMinMaxValues(const RealLimits &limits)
Inits P_MIN and P_MAX taking into account current value and external limits.
QString parameterType() const
SessionItem * startValueItem() const
static constexpr auto P_MAX
void addLink(const QString &title, const QString &link)
AttLimits attLimits() const
Constructs Limits correspodning to current GUI settings.
static constexpr auto P_TYPE
The FitParameterLinkItem class holds a link to ParameterItem in tuning tree.
void setTitle(const QString &title)
static constexpr auto M_TYPE
void setOnPropertyChange(std::function< void(QString)> f, const void *caller=nullptr)
Base class for a GUI data item.
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. name is the tag name and the display name....
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,...
QVariant value() const
Get value.
QVariant getItemValue(const QString &tag) const
Directly access value of item under given tag.
void setItemValue(const QString &tag, const QVariant &variant) const
Directly set 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.
SessionModel * model() const
Returns model of this item.
void setEditable(bool enabled)
RealLimits limits() const
void setEnabled(bool enabled)
Flags accessors.
SessionItem * getItem(const QString &tag="", int row=0) const
Returns item in given row of given tag.
SessionItem & setLimits(const RealLimits &value)
T * insertItem(SessionItem *parent=nullptr, int row=-1, QString tag="")
QString const & name(EShape k)