mirror of
https://github.com/Sani7/remote-ui.git
synced 2026-10-27 06:01:14 +01:00
did some testing with custom hardware
This commit is contained in:
@@ -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()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user