SatDump 2.0.0-alpha-520736c72
Loading...
Searching...
No Matches
testremote.h
1#pragma once
2
3#include "base/remote_handler.h"
4#include "imgui/imgui.h"
5#include "imgui/imgui_internal.h"
6
7namespace satdump
8{
9 namespace handlers
10 {
11 class TestRemoteHandlerHandler : public RemoteHandlerHandler
12 {
13 private:
14 double val;
15
16 protected:
17 bool mustUpdate = true;
18 void handle_stream_data(std::string id, uint8_t *data, size_t size)
19 {
20 if (id == "upd")
21 mustUpdate = true;
22 }
23
24 public:
25 TestRemoteHandlerHandler(std::shared_ptr<RemoteHandlerBackend> bkd) : RemoteHandlerHandler(bkd) {}
26 ~TestRemoteHandlerHandler() {}
27
28 // The Rest
29 void drawMenu()
30 {
31 if (mustUpdate)
32 {
33 ImGui::ClearActiveID();
34
35 val = bkd->get_cfg("val");
36
37 mustUpdate = false;
38 }
39
40 if (ImGui::InputDouble("Val", &val))
41 bkd->set_cfg("val", val);
42 }
43 void drawContents(ImVec2 win_size) {}
44
45 std::string getName() { return "RemoteHandleTest"; }
46
47 std::string getID() { return "remote_test_handler"; }
48 };
49 } // namespace handlers
50} // namespace satdump
std::string getName()
Get this handler's readable name.
Definition testremote.h:45
void drawMenu()
Render explorer menu left sidebar.
Definition testremote.h:29
void drawContents(ImVec2 win_size)
Render explorer contents (center/left)
Definition testremote.h:43