mirror of
https://github.com/Sani7/remote-ui.git
synced 2026-10-26 21:51:13 +01:00
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:
@@ -50,6 +50,16 @@ void UI_plot::add_value(double x, double y)
|
||||
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()
|
||||
{
|
||||
m_x_vals.clear();
|
||||
|
||||
@@ -15,6 +15,8 @@ class UI_plot : public UI_item
|
||||
std::string y_label() const;
|
||||
void add_value(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 from_json(const json &j) override;
|
||||
|
||||
Reference in New Issue
Block a user