b ui plot

forgot emitting the value changed signal
This commit is contained in:
2026-02-14 14:31:03 +01:00
parent 4371b711a5
commit 1b449cd867
+10
View File
@@ -18,6 +18,8 @@ UI_plot::UI_plot(const json &j, QObject *parent) : UI_item{UI_PLOT_TYPE, parent}
void UI_plot::set_x_label(std::string name) void UI_plot::set_x_label(std::string name)
{ {
m_x_label = name; m_x_label = name;
emit value_changed();
} }
std::string UI_plot::x_label() const std::string UI_plot::x_label() const
@@ -28,6 +30,8 @@ std::string UI_plot::x_label() const
void UI_plot::set_y_label(std::string name) void UI_plot::set_y_label(std::string name)
{ {
m_y_label = name; m_y_label = name;
emit value_changed();
} }
std::string UI_plot::y_label() const std::string UI_plot::y_label() const
@@ -39,18 +43,24 @@ void UI_plot::add_value(double y)
{ {
m_x_vals.push_back((double)m_x_vals.size()); m_x_vals.push_back((double)m_x_vals.size());
m_y_vals.push_back(y); m_y_vals.push_back(y);
emit value_changed();
} }
void UI_plot::add_value(double x, double y) void UI_plot::add_value(double x, double y)
{ {
m_x_vals.push_back(x); m_x_vals.push_back(x);
m_y_vals.push_back(y); m_y_vals.push_back(y);
emit value_changed();
} }
void UI_plot::clean_vals() void UI_plot::clean_vals()
{ {
m_x_vals.clear(); m_x_vals.clear();
m_y_vals.clear(); m_y_vals.clear();
emit value_changed();
} }
void UI_plot::from_json(const json &j) void UI_plot::from_json(const json &j)