mirror of
https://github.com/meshtastic/firmware.git
synced 2025-09-24 10:19:19 +00:00
BaseUI Updates (#7787)
* Account for low resolution wide screen OLEDs * Allow picking of Device Role and new Display Formatter for Device Role * Add remainder of client roles to display formatter * Don't update the role unless you pick a value * Mascots are fun * Fix warnings during compile time * Improve some menus * Mascots need to work everywhere * Update Chirpy image * Fix Trunk * Update protobufs * Add date to Clock screen * Analog clocks love dates too * Finalize date moves for analog clock
This commit is contained in:
parent
a1cf305336
commit
8264d4d65e
@ -190,6 +190,7 @@ void drawDigitalClockFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int1
|
|||||||
const char *titleStr = "";
|
const char *titleStr = "";
|
||||||
// === Header ===
|
// === Header ===
|
||||||
graphics::drawCommonHeader(display, x, y, titleStr, true, true);
|
graphics::drawCommonHeader(display, x, y, titleStr, true, true);
|
||||||
|
int line = 0;
|
||||||
|
|
||||||
#ifdef T_WATCH_S3
|
#ifdef T_WATCH_S3
|
||||||
if (nimbleBluetooth && nimbleBluetooth->isConnected()) {
|
if (nimbleBluetooth && nimbleBluetooth->isConnected()) {
|
||||||
@ -323,6 +324,7 @@ void drawAnalogClockFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16
|
|||||||
const char *titleStr = "";
|
const char *titleStr = "";
|
||||||
// === Header ===
|
// === Header ===
|
||||||
graphics::drawCommonHeader(display, x, y, titleStr, true, true);
|
graphics::drawCommonHeader(display, x, y, titleStr, true, true);
|
||||||
|
int line = 0;
|
||||||
|
|
||||||
#ifdef T_WATCH_S3
|
#ifdef T_WATCH_S3
|
||||||
if (nimbleBluetooth && nimbleBluetooth->isConnected()) {
|
if (nimbleBluetooth && nimbleBluetooth->isConnected()) {
|
||||||
|
@ -1055,6 +1055,45 @@ void UIRenderer::drawCompassAndLocationScreen(OLEDDisplay *display, OLEDDisplayU
|
|||||||
snprintf(latStr, sizeof(latStr), "Lat:%.5f", geoCoord.getLatitude() * 1e-7);
|
snprintf(latStr, sizeof(latStr), "Lat:%.5f", geoCoord.getLatitude() * 1e-7);
|
||||||
display->drawString(x, getTextPositions(display)[line++] + 2, latStr);
|
display->drawString(x, getTextPositions(display)[line++] + 2, latStr);
|
||||||
#else
|
#else
|
||||||
|
snprintf(latStr, sizeof(latStr), " Lat: %.5f", geoCoord.getLatitude() * 1e-7);
|
||||||
|
// === Second Row: Last GPS Fix ===
|
||||||
|
if (gpsStatus->getLastFixMillis() > 0) {
|
||||||
|
uint32_t delta = (millis() - gpsStatus->getLastFixMillis()) / 1000; // seconds since last fix
|
||||||
|
uint32_t days = delta / 86400;
|
||||||
|
uint32_t hours = (delta % 86400) / 3600;
|
||||||
|
uint32_t mins = (delta % 3600) / 60;
|
||||||
|
uint32_t secs = delta % 60;
|
||||||
|
|
||||||
|
char buf[32];
|
||||||
|
#if defined(USE_EINK)
|
||||||
|
// E-Ink: skip seconds, show only days/hours/mins
|
||||||
|
if (days > 0) {
|
||||||
|
snprintf(buf, sizeof(buf), " Last: %ud %uh", days, hours);
|
||||||
|
} else if (hours > 0) {
|
||||||
|
snprintf(buf, sizeof(buf), " Last: %uh %um", hours, mins);
|
||||||
|
} else {
|
||||||
|
snprintf(buf, sizeof(buf), " Last: %um", mins);
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
// Non E-Ink: include seconds where useful
|
||||||
|
if (days > 0) {
|
||||||
|
snprintf(buf, sizeof(buf), "Last: %ud %uh", days, hours);
|
||||||
|
} else if (hours > 0) {
|
||||||
|
snprintf(buf, sizeof(buf), "Last: %uh %um", hours, mins);
|
||||||
|
} else if (mins > 0) {
|
||||||
|
snprintf(buf, sizeof(buf), "Last: %um %us", mins, secs);
|
||||||
|
} else {
|
||||||
|
snprintf(buf, sizeof(buf), "Last: %us", secs);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
display->drawString(0, getTextPositions(display)[line++], buf);
|
||||||
|
} else {
|
||||||
|
display->drawString(0, getTextPositions(display)[line++], "Last: ?");
|
||||||
|
}
|
||||||
|
|
||||||
|
// === Third Row: Latitude ===
|
||||||
|
char latStr[32];
|
||||||
snprintf(latStr, sizeof(latStr), "Lat: %.5f", geoCoord.getLatitude() * 1e-7);
|
snprintf(latStr, sizeof(latStr), "Lat: %.5f", geoCoord.getLatitude() * 1e-7);
|
||||||
display->drawString(x, getTextPositions(display)[line++], latStr);
|
display->drawString(x, getTextPositions(display)[line++], latStr);
|
||||||
#endif
|
#endif
|
||||||
@ -1065,6 +1104,7 @@ void UIRenderer::drawCompassAndLocationScreen(OLEDDisplay *display, OLEDDisplayU
|
|||||||
snprintf(lonStr, sizeof(lonStr), "Lon:%.3f", geoCoord.getLongitude() * 1e-7);
|
snprintf(lonStr, sizeof(lonStr), "Lon:%.3f", geoCoord.getLongitude() * 1e-7);
|
||||||
display->drawString(x, getTextPositions(display)[line++] + 4, lonStr);
|
display->drawString(x, getTextPositions(display)[line++] + 4, lonStr);
|
||||||
#else
|
#else
|
||||||
|
snprintf(lonStr, sizeof(lonStr), " Lon: %.5f", geoCoord.getLongitude() * 1e-7);
|
||||||
snprintf(lonStr, sizeof(lonStr), "Lon: %.5f", geoCoord.getLongitude() * 1e-7);
|
snprintf(lonStr, sizeof(lonStr), "Lon: %.5f", geoCoord.getLongitude() * 1e-7);
|
||||||
display->drawString(x, getTextPositions(display)[line++], lonStr);
|
display->drawString(x, getTextPositions(display)[line++], lonStr);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user