did some testing with custom hardware

This commit is contained in:
2026-02-01 18:42:44 +01:00
parent b289eb7cf2
commit 9104e5f616
11 changed files with 39 additions and 16 deletions
+5
View File
@@ -168,3 +168,8 @@ void UI_item::can_send(uint32_t id, uint8_t dlc, std::array<uint8_t, 8> payload)
UNUSED(dlc);
UNUSED(payload);
};
void UI_item::can_clear()
{
}
+1
View File
@@ -51,6 +51,7 @@ class UI_item : public QObject
virtual void set_selected(std::string selected);
virtual void set_value(double value);
virtual void can_send(uint32_t id, uint8_t dlc, std::array<uint8_t, 8> payload);
virtual void can_clear();
signals:
void value_changed();
+8 -2
View File
@@ -24,13 +24,13 @@ UI_can::UI_can(const json &j, QObject *parent) : UI_item(UI_CAN_TYPE, parent)
from_json(j);
}
void UI_can::add_send_message(QCanBusFrame& msg)
void UI_can::add_send_message(QCanBusFrame msg)
{
m_can_send_messages.push_back(msg);
emit value_changed();
}
void UI_can::add_received_message(QCanBusFrame& msg)
void UI_can::add_received_message(QCanBusFrame msg)
{
m_can_received_messages.push_back(msg);
emit value_changed();
@@ -48,6 +48,12 @@ void UI_can::clear_receive_buffer()
emit value_changed();
}
void UI_can::can_clear()
{
clear_send_buffer();
clear_receive_buffer();
}
void UI_can::from_json(const json &j)
{
UI_item::from_json(j);
+3 -2
View File
@@ -12,8 +12,8 @@ class UI_can : public UI_item
UI_can(Color fg_color, Color bg_color, QObject *parent = nullptr);
UI_can(const json &j, QObject *parent = nullptr);
void add_send_message(QCanBusFrame& msg);
void add_received_message(QCanBusFrame& msg);
void add_send_message(QCanBusFrame msg);
void add_received_message(QCanBusFrame msg);
void clear_send_buffer();
void clear_receive_buffer();
@@ -21,6 +21,7 @@ class UI_can : public UI_item
json to_json(size_t id) const override;
void can_send(uint32_t id, uint8_t dlc, std::array<uint8_t, 8> payload) override;
void can_clear() override;
signals:
void on_send(QCanBusFrame msg);
private: