mirror of
https://github.com/Sani7/remote-ui.git
synced 2026-10-26 21:51:13 +01:00
Add doxygen documentation to client ui
This commit is contained in:
@@ -6,13 +6,41 @@ class Better_Radiobutton : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a new Better_Radiobutton object
|
||||
*
|
||||
* @param parent A pointer to the parent widget
|
||||
*/
|
||||
explicit Better_Radiobutton(QWidget *parent = nullptr);
|
||||
explicit Better_Radiobutton(std::vector<QString> names, QWidget *partent = nullptr);
|
||||
/**
|
||||
* @brief Construct a new Better_Radiobutton object
|
||||
*
|
||||
* @param names A list of names for the radiobuttons
|
||||
* @param parent A pointer to the parent widget
|
||||
*/
|
||||
explicit Better_Radiobutton(std::vector<QString> names, QWidget *parent = nullptr);
|
||||
|
||||
/**
|
||||
* @brief Add a radiobutton to the group
|
||||
*
|
||||
* @param name The name of the radiobutton
|
||||
*/
|
||||
void add_radiobutton(QString name);
|
||||
|
||||
/**
|
||||
* @brief Get the name of the currently checked radiobutton
|
||||
*
|
||||
* @return QString The name of the checked radiobutton
|
||||
*/
|
||||
QString isChecked() const;
|
||||
|
||||
signals:
|
||||
/**
|
||||
* @brief Emitted when a radiobutton is toggled
|
||||
*
|
||||
* @param name The name of the radiobutton
|
||||
* @param checked Whether the radiobutton is checked
|
||||
*/
|
||||
void toggled(QString name, bool checked);
|
||||
|
||||
private:
|
||||
|
||||
@@ -12,15 +12,62 @@ class Can_Transceive : public QWidget
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a new Can_Transceive object
|
||||
*
|
||||
* @param parent A pointer to the parent widget
|
||||
*/
|
||||
explicit Can_Transceive(QWidget *parent = nullptr);
|
||||
/**
|
||||
* @brief Destroy the Can_Transceive object
|
||||
*
|
||||
*/
|
||||
~Can_Transceive();
|
||||
|
||||
/**
|
||||
* @brief This function enables or disables the CAN data input fields based on the selected DLC
|
||||
*
|
||||
*/
|
||||
void enable_can_send_data();
|
||||
|
||||
/**
|
||||
* @brief Clear the CAN message lists
|
||||
*
|
||||
*/
|
||||
void clear();
|
||||
|
||||
/**
|
||||
* @brief Add a sent CAN message to the send list
|
||||
*
|
||||
* @param id The CAN message ID
|
||||
* @param dlc The Data Length Code
|
||||
* @param payload The CAN message payload
|
||||
*/
|
||||
void add_send_item(uint32_t id, uint8_t dlc, std::array<uint8_t, 8> payload);
|
||||
|
||||
/**
|
||||
* @brief Add a received CAN message to the receive list
|
||||
*
|
||||
* @param id The CAN message ID
|
||||
* @param dlc The Data Length Code
|
||||
* @param payload The CAN message payload
|
||||
*/
|
||||
void add_receive_item(uint32_t id, uint8_t dlc, std::array<uint8_t, 8> payload);
|
||||
|
||||
signals:
|
||||
/**
|
||||
* @brief Emitted when a CAN message is to be sent
|
||||
*
|
||||
* @param id The CAN message ID
|
||||
* @param dlc The Data Length Code
|
||||
* @param payload The CAN message payload
|
||||
*/
|
||||
void send_can_message(uint32_t id, uint8_t dlc, std::array<uint8_t, 8> payload);
|
||||
|
||||
/**
|
||||
* @brief Emitted when the CAN message lists are to be cleared
|
||||
*
|
||||
*/
|
||||
void can_clear();
|
||||
|
||||
private:
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
#include "hex_spinbox.hpp"
|
||||
|
||||
HexSpinBox::HexSpinBox(QWidget *parent, bool showPrefix, const QString &format) : QSpinBox(parent), format(format)
|
||||
HexSpinBox::HexSpinBox(QWidget *parent) : HexSpinBox(false, QStringLiteral("%X"), parent)
|
||||
{
|
||||
}
|
||||
|
||||
HexSpinBox::HexSpinBox(bool showPrefix, const QString &format, QWidget *parent) : QSpinBox(parent), format(format)
|
||||
{
|
||||
// Validates hex strings up to 8 chars with or w/out leading "0x" prefix.
|
||||
// For arbitrary prefix/suffix, the regex could be built dynamically
|
||||
|
||||
@@ -11,10 +11,34 @@ class HexSpinBox : public QSpinBox
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
HexSpinBox(QWidget *parent = nullptr, bool showPrefix = false, const QString &format = QStringLiteral("%X"));
|
||||
/**
|
||||
* @brief Construct a new Hex Spin Box object
|
||||
*
|
||||
* @param parent The parent QWidget
|
||||
*/
|
||||
explicit HexSpinBox(QWidget *parent = nullptr);
|
||||
/**
|
||||
* @brief Construct a new Hex Spin Box object
|
||||
*
|
||||
* @param showPrefix Whether to show the "0x" prefix
|
||||
* @param format The printf-style format string to use for displaying the value
|
||||
* @param parent The parent QWidget
|
||||
*/
|
||||
HexSpinBox(bool showPrefix = false, const QString &format = QStringLiteral("%X"), QWidget *parent = nullptr);
|
||||
|
||||
public slots:
|
||||
/**
|
||||
* @brief Set the Show Prefix object
|
||||
*
|
||||
* @param show True to show the "0x" prefix, false to hide it
|
||||
*/
|
||||
void setShowPrefix(bool show);
|
||||
|
||||
/**
|
||||
* @brief Set the Format object
|
||||
*
|
||||
* @param text The printf-style format string to use for displaying the value
|
||||
*/
|
||||
void setFormat(const QString &text);
|
||||
|
||||
protected:
|
||||
|
||||
@@ -5,12 +5,46 @@ class Led : public QPushButton
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a new Led object
|
||||
*
|
||||
* @param parent The parent widget
|
||||
*/
|
||||
explicit Led(QWidget *parent = nullptr);
|
||||
|
||||
/**
|
||||
* @brief Construct a new Led object
|
||||
*
|
||||
* @param text The text to display on the button
|
||||
* @param parent The parent widget
|
||||
*/
|
||||
explicit Led(const QString &text, QWidget *parent = nullptr);
|
||||
|
||||
/**
|
||||
* @brief Construct a new Led object
|
||||
*
|
||||
* @param icon The icon to display on the button
|
||||
* @param text The text to display on the button
|
||||
* @param parent The parent widget
|
||||
*/
|
||||
Led(const QIcon &icon, const QString &text, QWidget *parent = nullptr);
|
||||
~Led();
|
||||
|
||||
private:
|
||||
/**
|
||||
* @brief Check if the widget is read-only
|
||||
*
|
||||
* @param widget The widget to check
|
||||
* @return true If the widget is read-only
|
||||
* @return false If the widget is not read-only
|
||||
*/
|
||||
bool is_read_only(QWidget *widget);
|
||||
|
||||
/**
|
||||
* @brief Set the read-only state of the widget
|
||||
*
|
||||
* @param widget The widget to set
|
||||
* @param read_only The read-only state to set
|
||||
*/
|
||||
void set_read_only(QWidget *widget, bool read_only);
|
||||
};
|
||||
|
||||
@@ -8,7 +8,18 @@ class Plot_wrapper : public QwtPlot
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a new Plot_wrapper object
|
||||
*
|
||||
* @param parent The parent QWidget
|
||||
*/
|
||||
Plot_wrapper(QWidget *parent = nullptr);
|
||||
|
||||
/**
|
||||
* @brief Get the curve associated with the plot
|
||||
*
|
||||
* @return QwtPlotCurve*
|
||||
*/
|
||||
QwtPlotCurve *curve() const;
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user