mirror of
https://github.com/Sani7/remote-ui.git
synced 2026-10-26 21:51:13 +01:00
Renames signals for consistency
Updates signal names across UI components (checkbox, textbox, and CAN) to use more consistent and descriptive names, improving code readability and maintainability. The 'on_change' and 'on_send' signals are renamed to 'changed' and 'send' respectively.
This commit is contained in:
+1
-1
@@ -108,5 +108,5 @@ void UI_can::can_send(uint32_t id, uint8_t dlc, std::array<uint8_t, 8> payload)
|
|||||||
frame.setFrameId(id);
|
frame.setFrameId(id);
|
||||||
frame.setPayload(QByteArray::fromRawData((const char *)(payload.data()), dlc));
|
frame.setPayload(QByteArray::fromRawData((const char *)(payload.data()), dlc));
|
||||||
|
|
||||||
emit on_send(frame);
|
emit send(frame);
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -33,7 +33,7 @@ class UI_can : public UI_item
|
|||||||
void can_send(uint32_t id, uint8_t dlc, std::array<uint8_t, 8> payload) override;
|
void can_send(uint32_t id, uint8_t dlc, std::array<uint8_t, 8> payload) override;
|
||||||
void can_clear() override;
|
void can_clear() override;
|
||||||
signals:
|
signals:
|
||||||
void on_send(QCanBusFrame msg);
|
void send(QCanBusFrame msg);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::vector<CanFrame> m_can_send_messages;
|
std::vector<CanFrame> m_can_send_messages;
|
||||||
|
|||||||
+2
-2
@@ -18,14 +18,14 @@ void UI_checkbox::click()
|
|||||||
{
|
{
|
||||||
m_checked = !m_checked;
|
m_checked = !m_checked;
|
||||||
emit ui_changed();
|
emit ui_changed();
|
||||||
emit on_change(m_checked);
|
emit changed(m_checked);
|
||||||
}
|
}
|
||||||
|
|
||||||
void UI_checkbox::set_state(bool state)
|
void UI_checkbox::set_state(bool state)
|
||||||
{
|
{
|
||||||
m_checked = state;
|
m_checked = state;
|
||||||
emit ui_changed();
|
emit ui_changed();
|
||||||
emit on_change(m_checked);
|
emit changed(m_checked);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool UI_checkbox::state() const
|
bool UI_checkbox::state() const
|
||||||
|
|||||||
+1
-1
@@ -19,7 +19,7 @@ class UI_checkbox : public UI_item
|
|||||||
json to_json(size_t id) const override;
|
json to_json(size_t id) const override;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void on_change(bool);
|
void changed(bool);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool m_checked;
|
bool m_checked;
|
||||||
|
|||||||
+1
-1
@@ -16,7 +16,7 @@ void UI_textbox::set_text(std::string text)
|
|||||||
return;
|
return;
|
||||||
m_text = text;
|
m_text = text;
|
||||||
emit ui_changed();
|
emit ui_changed();
|
||||||
emit on_change(m_text);
|
emit changed(m_text);
|
||||||
}
|
}
|
||||||
|
|
||||||
void UI_textbox::set_hint(std::string hint)
|
void UI_textbox::set_hint(std::string hint)
|
||||||
|
|||||||
+1
-1
@@ -19,7 +19,7 @@ class UI_textbox : public UI_item
|
|||||||
void from_json(const json &j) override;
|
void from_json(const json &j) override;
|
||||||
json to_json(size_t id) const override;
|
json to_json(size_t id) const override;
|
||||||
signals:
|
signals:
|
||||||
void on_change(std::string text);
|
void changed(std::string text);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::string m_hint;
|
std::string m_hint;
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ Can_Debugger::Can_Debugger(Communication *com, QObject *parent)
|
|||||||
{
|
{
|
||||||
PUSH_UI_ITEM(m_can_ui);
|
PUSH_UI_ITEM(m_can_ui);
|
||||||
|
|
||||||
connect(&m_can_ui, &UI_can::on_send, this, [=, this](QCanBusFrame frame) { m_wrapper->send_can_message(frame); });
|
connect(&m_can_ui, &UI_can::send, this, [=, this](QCanBusFrame frame) { m_wrapper->send_can_message(frame); });
|
||||||
}
|
}
|
||||||
|
|
||||||
void Can_Debugger::timer()
|
void Can_Debugger::timer()
|
||||||
|
|||||||
Reference in New Issue
Block a user