Adds accessors for plot data vectors

Adds const get methods to retrieve the x and y values stored in the plot data vectors, enabling external components to read the data displayed on the plot.
This commit is contained in:
2026-02-14 14:32:21 +01:00
parent f9c9636f95
commit a6f004725d
2 changed files with 12 additions and 0 deletions
+10
View File
@@ -50,6 +50,16 @@ void UI_plot::add_value(double x, double y)
emit ui_changed(); emit ui_changed();
} }
const std::vector<double> &UI_plot::x_vals() const
{
return m_x_vals;
}
const std::vector<double> &UI_plot::y_vals() const
{
return m_y_vals;
}
void UI_plot::clean_vals() void UI_plot::clean_vals()
{ {
m_x_vals.clear(); m_x_vals.clear();
+2
View File
@@ -15,6 +15,8 @@ class UI_plot : public UI_item
std::string y_label() const; std::string y_label() const;
void add_value(double y); void add_value(double y);
void add_value(double x, double y); void add_value(double x, double y);
const std::vector<double> &x_vals() const;
const std::vector<double> &y_vals() const;
void clean_vals(); void clean_vals();
void from_json(const json &j) override; void from_json(const json &j) override;