mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-10-21 04:52:02 +00:00
feat(ui-lvgl): navigation map, clock tools, settings pages, radio
- Home > Map is the navigation map: waypoints (list, add at GPS / by coordinates / long-press spot), live shares, trail recording + tools (save, load, GPX export, track back), live share controls, target bar with ETA; the nodes map opens from Nearby. - Map: smooth panning (no decode during a drag, idle read-ahead, cached coarser stand-ins), overzoom limited to 2 levels, resumable downloads, map credit behind a "©" and in Settings > About; target ring and trail computed in double. - Home in swipeable pages; Clock (alarm, timer, stopwatch, ring card). - Settings rendered from the Core schema (display & power with a brightness slider, messages & contacts, trail / live share / alerts), GPS switch, Radio screen; low-battery shutdown. - WioTrackerL2Display: honour the 0-4 brightness level. - docs: L2 hardware checklist, ui-core notes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -32,14 +32,23 @@ public:
|
||||
bool isViewingChannel(uint8_t channel_idx) override;
|
||||
bool isViewingDM(const uint8_t* pub_key) override;
|
||||
void onViewedHistoryGrew(bool channel) override { (void)channel; _thread_dirty = true; }
|
||||
void botSetGPS(bool on) override;
|
||||
|
||||
// ── Navigation (called from LVGL event callbacks) ────────────────────────
|
||||
void showHome();
|
||||
void setHomePage(int page);
|
||||
void showChats();
|
||||
void showContacts();
|
||||
void showSettings();
|
||||
void showSchemaSettings(int page);
|
||||
void pruneContacts();
|
||||
void setBrightnessPct(uint8_t pct, bool save);
|
||||
void applyDisplayPrefs() override;
|
||||
void setSchemaValue(int idx, int v);
|
||||
void showNearby();
|
||||
void showMap();
|
||||
void showMap(); // in its current mode
|
||||
void openMap(bool nav); // Nodes map (false) or Navigation map (true)
|
||||
void mapLongPress(int x, int y);
|
||||
void mapZoom(int delta);
|
||||
void mapCenterOnMe();
|
||||
void mapPan(int dx, int dy);
|
||||
@@ -48,7 +57,27 @@ public:
|
||||
void mapDownloadClose();
|
||||
void mapDownloadStart();
|
||||
void mapDownloadStop();
|
||||
void mapDownloadResume();
|
||||
void mapDownloadDiscard();
|
||||
void mapDownloadZmax(int delta);
|
||||
// Navigation map (NavMap.h)
|
||||
void navTargetsPopup();
|
||||
void navClosePopup();
|
||||
void navPick(int code);
|
||||
void navWaypointMenu(int idx);
|
||||
void navWaypointAction(uint8_t act);
|
||||
void navRenameDone(bool ok);
|
||||
void navMarkHere();
|
||||
void navAveragingCancel();
|
||||
void navToNode(const uint8_t* key, int32_t lat, int32_t lon, const char* name);
|
||||
void navToolsPopup();
|
||||
void navToolAction(uint8_t act);
|
||||
void navSetShareTarget(int sel);
|
||||
void navWaypointsPopup();
|
||||
void navCoordsPopup();
|
||||
void navCoordsDone(bool ok);
|
||||
void shareToMessage(const char* text);
|
||||
void messageLocationAction(int idx, bool save);
|
||||
void showWifi(bool from_map);
|
||||
void wifiScan();
|
||||
void wifiPick(int idx);
|
||||
@@ -69,22 +98,37 @@ public:
|
||||
void sendFromCompose();
|
||||
void setKeyboardVisible(bool show);
|
||||
void showToast(const char* text, uint32_t ms = 2500);
|
||||
// Clock tools (ClockScreen.h)
|
||||
void showClock();
|
||||
void clockTab(int tab);
|
||||
void clockAction(uint8_t act);
|
||||
void setAlarm(int which, int v);
|
||||
void dismissRing();
|
||||
// Settings > Radio (RadioScreen.h)
|
||||
void showRadio();
|
||||
void radioSet(int which, int v);
|
||||
void radioFreqPopup();
|
||||
void radioFreqDone(bool ok);
|
||||
void setGps(bool on);
|
||||
bool ensureGps(); // true with a fix; else turns GPS on / says it's waiting
|
||||
|
||||
// Kept for main.cpp's sim hooks (ui-new API).
|
||||
void openContactDM(const ContactInfo& ci) { openDM(ci.id.pub_key); }
|
||||
void openAdminFor(const ContactInfo& ci, bool from_picker) { (void)ci; (void)from_picker; }
|
||||
|
||||
private:
|
||||
enum Screen : uint8_t { SCR_HOME, SCR_CHATS, SCR_CONTACTS, SCR_THREAD, SCR_SETTINGS, SCR_NEARBY, SCR_NODE, SCR_MAP, SCR_WIFI };
|
||||
enum Screen : uint8_t { SCR_HOME, SCR_CHATS, SCR_CONTACTS, SCR_THREAD, SCR_SETTINGS, SCR_NEARBY, SCR_NODE, SCR_MAP, SCR_WIFI, SCR_SETTINGS_NAV, SCR_CLOCK, SCR_RADIO };
|
||||
|
||||
void buildStatusBar();
|
||||
void refreshStatusBar();
|
||||
lv_obj_t* newScreen(const char* title, bool with_back);
|
||||
void buildHome();
|
||||
void refreshHome();
|
||||
void homeSwipePoll();
|
||||
void buildChats();
|
||||
void buildContacts();
|
||||
void buildSettings();
|
||||
void buildSchemaSettings();
|
||||
void buildNearby();
|
||||
void refreshNearbyList();
|
||||
uint32_t nearbySignature() const;
|
||||
@@ -94,6 +138,27 @@ private:
|
||||
void layoutMap();
|
||||
void mapLoop();
|
||||
void rebuildMapMarkers();
|
||||
void rebuildNodeMarkers();
|
||||
void addMapMark(uint8_t kind, int idx, int32_t lat_e6, int32_t lon_e6, uint32_t col, const char* text);
|
||||
void mapPointToLatLon(int x, int y, int32_t& lat_e6, int32_t& lon_e6) const;
|
||||
double mapCenterBias() const;
|
||||
void buildNavLayers();
|
||||
void buildNavControls(lv_obj_t* body);
|
||||
void rebuildNavMarkers();
|
||||
void layoutNav();
|
||||
void refreshNavBar();
|
||||
void navFrameTarget();
|
||||
void navSetTarget(uint8_t kind, const uint8_t* key, int32_t lat, int32_t lon, const char* name);
|
||||
lv_obj_t* navPopupPanel(const char* title, bool full);
|
||||
void navRenamePopup(int idx);
|
||||
void navAddWaypoint(int32_t lat, int32_t lon);
|
||||
void navDropAt(int x, int y);
|
||||
void navSpotPopup(int32_t lat, int32_t lon);
|
||||
void refreshNavTools();
|
||||
void navPollAveraging();
|
||||
void navPollTrackBack();
|
||||
bool navCurrentTarget(int32_t& lat, int32_t& lon, char* name, int n, bool& person, bool& set);
|
||||
bool exportTrailGpx(char* name_out, size_t n);
|
||||
void mapDownloadTick();
|
||||
void refreshDownloadPopup();
|
||||
void buildWifi();
|
||||
@@ -103,11 +168,19 @@ private:
|
||||
void buildThread();
|
||||
void refreshThread();
|
||||
uint32_t threadSignature() const;
|
||||
void buildClock();
|
||||
void buildRadio();
|
||||
void radioCloseFreq();
|
||||
bool radioPopupOpen() const;
|
||||
void refreshClock();
|
||||
void showRing(const char* text);
|
||||
void hideRing();
|
||||
void drainCoreEvents();
|
||||
void onMessageArrived(const UiEvent& ev);
|
||||
void wake();
|
||||
void sleep();
|
||||
uint32_t autoOffMillis() const;
|
||||
void checkLowBattery();
|
||||
|
||||
DisplayDriver* _display = nullptr;
|
||||
SensorManager* _sensors = nullptr;
|
||||
@@ -118,6 +191,13 @@ private:
|
||||
bool _asleep = false;
|
||||
uint32_t _next_status_ms = 0;
|
||||
uint32_t _next_thread_check_ms = 0;
|
||||
uint32_t _next_trackback_ms = 0;
|
||||
uint32_t _next_clock_ms = 0;
|
||||
uint8_t _settings_page = 0; // settings::Page shown in SCR_SETTINGS_NAV
|
||||
uint32_t _prune_armed_ms = 0;
|
||||
uint16_t _batt_mv = 0; // smoothed, for the low-battery shutdown
|
||||
uint32_t _next_batt_ms = 0;
|
||||
lv_obj_t* _prune_lbl = nullptr;
|
||||
|
||||
// Open conversation (SCR_THREAD)
|
||||
bool _thread_is_channel = false;
|
||||
@@ -129,6 +209,7 @@ private:
|
||||
// Widgets
|
||||
lv_obj_t* _status_time = nullptr;
|
||||
lv_obj_t* _status_icons = nullptr;
|
||||
lv_obj_t* _status_gps = nullptr;
|
||||
lv_obj_t* _toast = nullptr;
|
||||
lv_timer_t* _toast_timer = nullptr;
|
||||
lv_obj_t* _home_clock = nullptr;
|
||||
@@ -181,9 +262,36 @@ private:
|
||||
lv_obj_t* _dl_info = nullptr;
|
||||
lv_obj_t* _dl_zoom_lbl = nullptr;
|
||||
lv_obj_t* _dl_start_lbl = nullptr;
|
||||
lv_obj_t* _dl_job_row = nullptr; // "Unfinished ... Resume" in the popup
|
||||
lv_obj_t* _dl_job_lbl = nullptr;
|
||||
int _dl_zmax = 0;
|
||||
uint8_t _dl_last_state = 0;
|
||||
|
||||
// Navigation map (SCR_MAP with _map_nav)
|
||||
bool _map_nav = false;
|
||||
uint32_t _next_nav_bar_ms = 0;
|
||||
lv_obj_t* _nav_bar = nullptr; // target bar along the bottom
|
||||
lv_obj_t* _nav_title = nullptr;
|
||||
lv_obj_t* _nav_info = nullptr;
|
||||
lv_obj_t* _nav_clear = nullptr;
|
||||
lv_obj_t* _nav_overlay = nullptr; // target list / waypoint menu / rename
|
||||
lv_obj_t* _nav_ta = nullptr;
|
||||
lv_obj_t* _nav_kb = nullptr;
|
||||
lv_obj_t* _nav_del_lbl = nullptr;
|
||||
uint32_t _nav_del_armed_ms = 0;
|
||||
int _nav_wp = -1; // waypoint the menu / rename is about
|
||||
lv_obj_t* _nav_rec = nullptr; // "REC 1.2 km LIVE 58m" pill
|
||||
lv_obj_t* _nav_avg_pill = nullptr; // GPS averaging progress (tap: cancel)
|
||||
lv_obj_t* _nav_trail_lbl = nullptr; // tools panel
|
||||
lv_obj_t* _nav_trail_btn = nullptr;
|
||||
lv_obj_t* _nav_reset_lbl = nullptr;
|
||||
lv_obj_t* _nav_share_lbl = nullptr;
|
||||
lv_obj_t* _nav_share_btn = nullptr;
|
||||
lv_obj_t* _nav_tb_btn = nullptr;
|
||||
uint32_t _nav_reset_armed_ms = 0;
|
||||
int32_t _nav_spot_lat = 0, _nav_spot_lon = 0; // the spot a long-press picked
|
||||
char _share_text[96] = ""; // waiting for a conversation to be picked (shareToMessage)
|
||||
|
||||
// WiFi settings (SCR_WIFI)
|
||||
bool _wifi_from_map = false;
|
||||
bool _wifi_scanning = false;
|
||||
|
||||
Reference in New Issue
Block a user