mirror of
https://github.com/Sani7/remote-ui.git
synced 2026-10-26 21:51:13 +01:00
change Event can_clear to clear
make this a bit more general, that it can be used for more then only can
This commit is contained in:
+1
-1
@@ -50,7 +50,7 @@ void UI_can::clear_receive_buffer()
|
||||
emit ui_changed();
|
||||
}
|
||||
|
||||
void UI_can::can_clear()
|
||||
void UI_can::clear()
|
||||
{
|
||||
clear_send_buffer();
|
||||
clear_receive_buffer();
|
||||
|
||||
+1
-1
@@ -31,7 +31,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;
|
||||
void clear() override;
|
||||
signals:
|
||||
void send(QCanBusFrame msg);
|
||||
|
||||
|
||||
+1
-1
@@ -168,7 +168,7 @@ void UI_item::can_send(uint32_t id, uint8_t dlc, std::array<uint8_t, 8> payload)
|
||||
UNUSED(payload);
|
||||
};
|
||||
|
||||
void UI_item::can_clear()
|
||||
void UI_item::clear()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -46,7 +46,7 @@ class UI_item : public QObject
|
||||
virtual void set_selected(size_t 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();
|
||||
virtual void clear();
|
||||
|
||||
signals:
|
||||
void ui_changed();
|
||||
|
||||
@@ -1059,5 +1059,5 @@ void Simulator_base::setup_can_ui(QWidget *item, size_t index)
|
||||
m_web_socket->send_event(Web_socket_wrapper::Event::can_send, index, id, dlc, payload);
|
||||
});
|
||||
connect(can, &Can_Transceive::can_clear, this,
|
||||
[=, this] { m_web_socket->send_event(Web_socket_wrapper::Event::can_clear, index); });
|
||||
[=, this] { m_web_socket->send_event(Web_socket_wrapper::Event::clear, index); });
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ void Web_socket_wrapper::send_event(Event e, size_t id)
|
||||
switch (e)
|
||||
{
|
||||
case Event::clicked:
|
||||
case Event::can_clear:
|
||||
case Event::clear:
|
||||
j["event"]["id"] = id;
|
||||
m_web_socket->sendTextMessage(QString(j.dump().data()));
|
||||
break;
|
||||
|
||||
@@ -27,7 +27,7 @@ class Web_socket_wrapper : public QObject
|
||||
text_changed,
|
||||
selected,
|
||||
can_send,
|
||||
can_clear,
|
||||
clear,
|
||||
ui_changed,
|
||||
end,
|
||||
begin = 0
|
||||
|
||||
@@ -120,9 +120,9 @@ void Simulators::event_handler(json event)
|
||||
(std::array<uint8_t, 8>)event.at("payload"));
|
||||
break;
|
||||
}
|
||||
case Event::can_clear: {
|
||||
case Event::clear: {
|
||||
SPDLOG_DEBUG("Event {}: {}", type, (size_t)event.at("id"));
|
||||
invoke_active_simulator()->get_UI_item(event.at("id"))->can_clear();
|
||||
invoke_active_simulator()->get_UI_item(event.at("id"))->clear();
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
|
||||
@@ -39,7 +39,7 @@ class Simulators : public QObject
|
||||
text_changed,
|
||||
selected,
|
||||
can_send,
|
||||
can_clear,
|
||||
clear,
|
||||
ui_changed,
|
||||
end,
|
||||
begin = 0
|
||||
|
||||
Reference in New Issue
Block a user