mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-11-02 10:51:57 +00:00
feat(eink): Nodes map uses the room - names, trail, waypoints, side pane with the flow legend, a scale bar
- Every e-ink build: the nodes' names beside their dots, placed where they cover no other name, dot or mark; the trail dotted and the waypoints. - 4.2" and 4.26": the map on the left 3/5, beside it the selected node (distance and direction, type, last heard, path, a compass rose) and, with Flow on, a legend counting each kind over the last minute; the kinds are told apart by their dashes (gfx::Dash). - E-ink scale: a framed bar, half filled, ticks at the ends, the distance over its middle. The OLED map is unchanged. - The distance shows with the position set in Privacy too. - Sim: sim_trail() lays a trail and two waypoints. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -446,6 +446,20 @@ void UITask::simNodes() {
|
||||
setCurrScreen(nearby_screen);
|
||||
}
|
||||
|
||||
// Sim tests: a walked trail ending at the GPS fix of simNodes(), and two
|
||||
// waypoints beside it, for the maps.
|
||||
void UITask::simTrail() {
|
||||
TrailStore& tr = _core->trail.store();
|
||||
const uint32_t now = rtc_clock.getCurrentTime();
|
||||
for (int i = 0; i <= 12; i++) {
|
||||
const float f = (12 - i) / 12.0f;
|
||||
tr.addPoint((int32_t)((50.0614f - 0.010f * f + 0.002f * (i % 3)) * 1e6f),
|
||||
(int32_t)((19.9372f - 0.018f * f * f) * 1e6f), now - (12 - i) * 60, 1);
|
||||
}
|
||||
waypoints().add((int32_t)(50.0560f * 1e6f), (int32_t)(19.9250f * 1e6f), now, "Car");
|
||||
waypoints().add((int32_t)(50.0680f * 1e6f), (int32_t)(19.9600f * 1e6f), now, "Hut");
|
||||
}
|
||||
|
||||
void UITask::simDisplay(bool on) {
|
||||
if (!_display) return;
|
||||
if (on) _display->turnOn(); else _display->turnOff();
|
||||
@@ -928,6 +942,10 @@ extern "C" EMSCRIPTEN_KEEPALIVE void sim_nodes() {
|
||||
if (g_sim_ui_task_for_js) g_sim_ui_task_for_js->simNodes();
|
||||
}
|
||||
|
||||
extern "C" EMSCRIPTEN_KEEPALIVE void sim_trail() {
|
||||
if (g_sim_ui_task_for_js) g_sim_ui_task_for_js->simTrail();
|
||||
}
|
||||
|
||||
// Sim tests: the display off (0) or on (1), as the auto-off and a key press do.
|
||||
extern "C" EMSCRIPTEN_KEEPALIVE void sim_display(int on) {
|
||||
if (g_sim_ui_task_for_js) g_sim_ui_task_for_js->simDisplay(on != 0);
|
||||
|
||||
Reference in New Issue
Block a user