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 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
int "Spacing between character in pixels"
range 1 255
range 0 255
default 1
config X_TEXT_OFFSET
int "X offset of text from aircraft"
range 0 65535
default 10
config NO_CALLSIGN_IDENTIFICATION
string "Callsign used for aircraft with unknown callsign"
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"
config FALLBACK_LAT
+12 -9
View File
@@ -94,6 +94,11 @@ int main() {
nlohmann::json aircraft = net::http_get_json(
std::format("{}/aircraft.json", CONFIG_BASE_URL));
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"]) {
uint32_t altitude;
@@ -194,7 +199,7 @@ int main() {
0.0f, static_cast<float>(UINT16_MAX)),
color);
#endif
draw::rhombus(x_center, y_center, 8 /*TODO: remove magic*/,
draw::rhombus(x_center, y_center, CONFIG_AIRCRAFT_RHOMBUS_RADIUS,
color);
{
@@ -207,8 +212,9 @@ int main() {
callsign = CONFIG_NO_CALLSIGN_IDENTIFICATION;
}
// print some info
font::puts(callsign, x_center + 10 /*TODO: remove magic*/,
y_center, color);
font::puts(callsign, x_center + CONFIG_X_TEXT_OFFSET,
y_center - (FONT_HEIGHT + CONFIG_CHARACTER_SPACING),
color);
font::puts(std::to_string(static_cast<uint16_t>(
#ifdef CONFIG_METRIC
speed
@@ -217,13 +223,10 @@ int main() {
#endif
)) +
SPEED_UNIT,
x_center + 10 /*TODO: remove magic*/,
y_center + FONT_HEIGHT + CONFIG_CHARACTER_SPACING,
color);
x_center + CONFIG_X_TEXT_OFFSET, y_center, color);
font::puts(std::to_string(altitude) + ALTITUDE_UNIT,
x_center + 10 /*TODO: remove magic*/,
y_center +
(FONT_HEIGHT + CONFIG_CHARACTER_SPACING) * 2,
x_center + CONFIG_X_TEXT_OFFSET,
y_center + (FONT_HEIGHT + CONFIG_CHARACTER_SPACING),
color);
}
} catch (...) {