mirror of
https://github.com/Sani7/remote-ui.git
synced 2026-10-27 06:01:14 +01:00
Add can ui element
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
#pragma once
|
||||
|
||||
#include "UI_item.hpp"
|
||||
#include <ctime>
|
||||
#include <chrono>
|
||||
#include "CAN_interface.hpp"
|
||||
|
||||
#define UI_CAN_TYPE std::string("UI_can")
|
||||
|
||||
class UI_can : public UI_item
|
||||
{
|
||||
public:
|
||||
UI_can(std::string id, std::string text, Color fg_color, Color bg_color,
|
||||
std::function<void(can_message_t msg)> on_send = nullptr);
|
||||
UI_can(const json &j);
|
||||
|
||||
void add_can_message(can_message_t msg);
|
||||
|
||||
void from_json(const json &j) override;
|
||||
json to_json() const override;
|
||||
|
||||
void can_send(can_message_t msg) override;
|
||||
|
||||
private:
|
||||
std::function<void(can_message_t msg)> m_on_can_send = nullptr;
|
||||
std::vector<can_message_t> m_can_messages;
|
||||
};
|
||||
Reference in New Issue
Block a user