some housekeeping

This commit is contained in:
2026-08-11 12:51:19 +02:00
parent 839ea1490a
commit 47f2766bb8
2 changed files with 29 additions and 10 deletions
+17 -1
View File
@@ -63,15 +63,31 @@ config VECTOR_FOLLOW_TRACK_RATE
This option will turn the vector from line into curve. This option will turn the vector from line into curve.
This is of course be more computationaly expensive. This is of course be more computationaly expensive.
config AIRCRAFT_RHOMBUS_RADIUS
int "Radius of rhombus or aircraft icon"
range 0 65535
default 8
config CHARACTER_SPACING config CHARACTER_SPACING
int "Spacing between character in pixels" int "Spacing between character in pixels"
range 1 255 range 0 255
default 1 default 1
config X_TEXT_OFFSET
int "X offset of text from aircraft"
range 0 65535
default 10
config NO_CALLSIGN_IDENTIFICATION config NO_CALLSIGN_IDENTIFICATION
string "Callsign used for aircraft with unknown callsign" string "Callsign used for aircraft with unknown callsign"
default "UNK" default "UNK"
config EXTRA_INFO
bool "Enable extra information on top of the screen"
default 1
help
Show information like number of tracked aircraft on top of the screen
comment "Receiver configuration" comment "Receiver configuration"
config FALLBACK_LAT config FALLBACK_LAT
+12 -9
View File
@@ -94,6 +94,11 @@ int main() {
nlohmann::json aircraft = net::http_get_json( nlohmann::json aircraft = net::http_get_json(
std::format("{}/aircraft.json", CONFIG_BASE_URL)); std::format("{}/aircraft.json", CONFIG_BASE_URL));
if (aircraft != nullptr) { if (aircraft != nullptr) {
#ifdef CONFIG_EXTRA_INFO
font::puts(
std::format("Tracking {} aircraft", aircraft["aircraft"].size()),
0, 0, {0xff, 0xff, 0xff});
#endif
for (nlohmann::json &craft : aircraft["aircraft"]) { for (nlohmann::json &craft : aircraft["aircraft"]) {
uint32_t altitude; uint32_t altitude;
@@ -194,7 +199,7 @@ int main() {
0.0f, static_cast<float>(UINT16_MAX)), 0.0f, static_cast<float>(UINT16_MAX)),
color); color);
#endif #endif
draw::rhombus(x_center, y_center, 8 /*TODO: remove magic*/, draw::rhombus(x_center, y_center, CONFIG_AIRCRAFT_RHOMBUS_RADIUS,
color); color);
{ {
@@ -207,8 +212,9 @@ int main() {
callsign = CONFIG_NO_CALLSIGN_IDENTIFICATION; callsign = CONFIG_NO_CALLSIGN_IDENTIFICATION;
} }
// print some info // print some info
font::puts(callsign, x_center + 10 /*TODO: remove magic*/, font::puts(callsign, x_center + CONFIG_X_TEXT_OFFSET,
y_center, color); y_center - (FONT_HEIGHT + CONFIG_CHARACTER_SPACING),
color);
font::puts(std::to_string(static_cast<uint16_t>( font::puts(std::to_string(static_cast<uint16_t>(
#ifdef CONFIG_METRIC #ifdef CONFIG_METRIC
speed speed
@@ -217,13 +223,10 @@ int main() {
#endif #endif
)) + )) +
SPEED_UNIT, SPEED_UNIT,
x_center + 10 /*TODO: remove magic*/, x_center + CONFIG_X_TEXT_OFFSET, y_center, color);
y_center + FONT_HEIGHT + CONFIG_CHARACTER_SPACING,
color);
font::puts(std::to_string(altitude) + ALTITUDE_UNIT, font::puts(std::to_string(altitude) + ALTITUDE_UNIT,
x_center + 10 /*TODO: remove magic*/, x_center + CONFIG_X_TEXT_OFFSET,
y_center + y_center + (FONT_HEIGHT + CONFIG_CHARACTER_SPACING),
(FONT_HEIGHT + CONFIG_CHARACTER_SPACING) * 2,
color); color);
} }
} catch (...) { } catch (...) {