mirror of
https://github.com/Sani7/remote-ui.git
synced 2026-10-27 06:01:14 +01:00
Update UI
This commit is contained in:
+29
-29
@@ -23,33 +23,53 @@ class UI_plot : public UI_item
|
||||
* @param y_label The label for the y-axis
|
||||
* @param parent The parent QObject
|
||||
*/
|
||||
UI_plot(std::string text, std::string x_label, std::string y_label, QObject *parent = nullptr);
|
||||
UI_plot(QString text, QString x_label, QString y_label, QObject *parent = nullptr);
|
||||
|
||||
/**
|
||||
* @brief Set the label for the x-axis
|
||||
*
|
||||
* @param name The name to set
|
||||
*/
|
||||
void set_x_label(std::string name);
|
||||
void set_x_label(QString name);
|
||||
/**
|
||||
* @brief Get the label for the x-axis
|
||||
*
|
||||
* @return std::string The x-axis label
|
||||
* @return QString The x-axis label
|
||||
*/
|
||||
std::string x_label() const &;
|
||||
QString x_label() const &;
|
||||
|
||||
/**
|
||||
* @brief Set the label for the y-axis
|
||||
*
|
||||
* @param name The name to set
|
||||
*/
|
||||
void set_y_label(std::string name);
|
||||
void set_y_label(QString name);
|
||||
/**
|
||||
* @brief Get the label for the y-axis
|
||||
*
|
||||
* @return std::string The y-axis label
|
||||
* @return QString The y-axis label
|
||||
*/
|
||||
std::string y_label() const &;
|
||||
QString y_label() const &;
|
||||
/**
|
||||
* @brief set_fg_color Set the pen color
|
||||
* @param color The color
|
||||
*/
|
||||
void set_fg_color(Color color);
|
||||
/**
|
||||
* @brief fg_color Get the pen color
|
||||
* @return The color
|
||||
*/
|
||||
Color fg_color() const&;
|
||||
/**
|
||||
* @brief set_bg_color Set the background color
|
||||
* @param color The color
|
||||
*/
|
||||
void set_bg_color(Color color);
|
||||
/**
|
||||
* @brief bg_color Get the background color
|
||||
* @return The color
|
||||
*/
|
||||
Color bg_color() const;
|
||||
|
||||
/**
|
||||
* @brief Add a value to the plot
|
||||
@@ -70,37 +90,17 @@ class UI_plot : public UI_item
|
||||
*
|
||||
* @return a list of x values and a list of y values
|
||||
*/
|
||||
const std::vector<double> &x_vals() const &;
|
||||
const QList<double> &x_vals() const &;
|
||||
/**
|
||||
* @brief Get the y values of the plot
|
||||
* This is only for testing purposes
|
||||
*
|
||||
* @return a list of y values
|
||||
*/
|
||||
const std::vector<double> &y_vals() const &;
|
||||
const QList<double> &y_vals() const &;
|
||||
/**
|
||||
* @brief Clear all values from the plot
|
||||
*
|
||||
*/
|
||||
void clean_vals();
|
||||
|
||||
/**
|
||||
* @brief Deserialize the plot from JSON
|
||||
*
|
||||
* @param j The JSON object
|
||||
*/
|
||||
void from_json(const json &j) override;
|
||||
/**
|
||||
* @brief Serialize the plot to JSON
|
||||
*
|
||||
* @param id The id of the plot
|
||||
* @return json The JSON representation of the plot
|
||||
*/
|
||||
json to_json(size_t id) const override;
|
||||
|
||||
private:
|
||||
std::vector<double> m_x_vals;
|
||||
std::vector<double> m_y_vals;
|
||||
std::string m_x_label;
|
||||
std::string m_y_label;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user