Skip to content
Snippets Groups Projects
Commit fc2aa50f authored by Mikhail Svechnikov's avatar Mikhail Svechnikov
Browse files

FitParameterItem: add limits

parent b13b15cf
No related branches found
No related tags found
1 merge request!1120GUI: FitParameterModel and fit items are refactored
......@@ -320,14 +320,14 @@ FitComboItem::FitComboItem(const ComboProperty& combo, QObject *parent)
{
}
ComboProperty FitComboItem::combo()
ComboProperty FitComboItem::combo() const
{
return m_combo;
}
void FitComboItem::setCombo(const ComboProperty &c)
void FitComboItem::setCombo(const ComboProperty &combo)
{
m_combo = c;
m_combo = combo;
}
//------------------------------------------------------------------------------------------------
......@@ -335,6 +335,7 @@ void FitComboItem::setCombo(const ComboProperty &c)
FitDoubleItem::FitDoubleItem(QObject *parent)
: QObject(parent)
, m_value(0.0)
, m_limits(RealLimits::limitless())
{
}
......@@ -344,14 +345,24 @@ FitDoubleItem::FitDoubleItem(double value, QObject *parent)
{
}
double FitDoubleItem::value()
double FitDoubleItem::value() const
{
return m_value;
}
void FitDoubleItem::setValue(double v)
void FitDoubleItem::setValue(double value)
{
m_value = v;
m_value = value;
}
RealLimits FitDoubleItem::limits() const
{
return m_limits;
}
SessionItem &FitDoubleItem::setLimits(const RealLimits &limits)
{
m_limits = limits;
}
//------------------------------------------------------------------------------------------------
......@@ -368,12 +379,12 @@ FitEditableDoubleItem::FitEditableDoubleItem(double value, bool isEnabled, QObje
{
}
bool FitEditableDoubleItem::isEnabled()
bool FitEditableDoubleItem::isEnabled() const
{
return m_isEnabled;
}
void FitEditableDoubleItem::setEnabled(bool b)
void FitEditableDoubleItem::setEnabled(bool enabled)
{
m_isEnabled = b;
m_isEnabled = enabled;
}
......@@ -27,8 +27,8 @@ public:
FitComboItem(QObject* parent = nullptr);
FitComboItem(const ComboProperty& combo, QObject* parent = nullptr);
ComboProperty combo();
void setCombo(const ComboProperty& c);
ComboProperty combo() const;
void setCombo(const ComboProperty& combo);
private:
ComboProperty m_combo;
......@@ -40,11 +40,15 @@ public:
FitDoubleItem(QObject* parent = nullptr);
FitDoubleItem(double value, QObject* parent = nullptr);
double value();
void setValue(double v);
double value() const;
void setValue(double value);
RealLimits limits() const;
SessionItem& setLimits(const RealLimits& limits);
private:
double m_value;
RealLimits m_limits;
};
//! Holds double values which can be enabled or disabled.
......@@ -53,8 +57,8 @@ public:
FitEditableDoubleItem(QObject* parent = nullptr);
FitEditableDoubleItem(double value, bool isEnabled, QObject* parent = nullptr);
bool isEnabled();
void setEnabled(bool b);
bool isEnabled() const;
void setEnabled(bool enabled);
private:
bool m_isEnabled;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment