update
This commit is contained in:
Binary file not shown.
@@ -187,9 +187,9 @@ void draw_connection_icon(Canvas* canvas, int x, int y, const std::string& statu
|
||||
}
|
||||
}
|
||||
} else if (status == "booting") {
|
||||
icon_color = rgb_matrix::Color(255, 165, 0); // Orange
|
||||
// Draw a simple but visible rotating indicator for booting
|
||||
int frame = animation_frame % 4; // Faster rotation (4 states instead of 12)
|
||||
icon_color = rgb_matrix::Color(255, 255, 0); // Changed from orange to yellow
|
||||
// Draw a simple but visible rotating indicator for booting - EVEN FASTER rotation
|
||||
int frame = (animation_frame / 2) % 2; // Much faster rotation - update every 2 frames
|
||||
|
||||
// Draw a rotating cross/plus pattern
|
||||
int center_x = x + 10;
|
||||
@@ -204,15 +204,14 @@ void draw_connection_icon(Canvas* canvas, int x, int y, const std::string& statu
|
||||
}
|
||||
}
|
||||
|
||||
// Draw rotating lines based on frame
|
||||
if (frame == 0 || frame == 2) {
|
||||
// Draw rotating lines based on frame - faster animation
|
||||
if (frame == 0) {
|
||||
// Vertical line
|
||||
for (int i = -6; i <= 6; i++) {
|
||||
canvas->SetPixel(center_x, center_y + i, icon_color.r, icon_color.g, icon_color.b);
|
||||
canvas->SetPixel(center_x + 1, center_y + i, icon_color.r, icon_color.g, icon_color.b);
|
||||
}
|
||||
}
|
||||
if (frame == 1 || frame == 3) {
|
||||
} else { // frame == 1
|
||||
// Horizontal line
|
||||
for (int i = -6; i <= 6; i++) {
|
||||
canvas->SetPixel(center_x + i, center_y, icon_color.r, icon_color.g, icon_color.b);
|
||||
@@ -297,8 +296,10 @@ void draw_4g_screen(Canvas* canvas, const std::string& network_status, int signa
|
||||
}
|
||||
}
|
||||
|
||||
// Draw signal bars anyway
|
||||
draw_signal_bars(canvas, 55, 30, signal_quality);
|
||||
// Only draw signal bars if connected
|
||||
if (network_status == "connected") {
|
||||
draw_signal_bars(canvas, 55, 30, signal_quality);
|
||||
}
|
||||
|
||||
std::cout << "Using fallback display (no fonts)" << std::endl;
|
||||
return;
|
||||
@@ -314,8 +315,7 @@ void draw_4g_screen(Canvas* canvas, const std::string& network_status, int signa
|
||||
int status_y = 25;
|
||||
rgb_matrix::DrawText(canvas, value_font, 2, status_y, white, &bg_color, "Status:", 0);
|
||||
|
||||
// Draw connection icon
|
||||
draw_connection_icon(canvas, 40, status_y - 15, network_status);
|
||||
// Don't draw connection icon - removed for cleaner text-only display
|
||||
|
||||
// Draw status text
|
||||
rgb_matrix::Color status_color;
|
||||
@@ -327,7 +327,7 @@ void draw_4g_screen(Canvas* canvas, const std::string& network_status, int signa
|
||||
} else if (network_status == "connecting") {
|
||||
status_color = rgb_matrix::Color(255, 255, 0); // Yellow
|
||||
} else if (network_status == "booting") {
|
||||
status_color = rgb_matrix::Color(255, 165, 0); // Orange
|
||||
status_color = rgb_matrix::Color(255, 255, 0); // Changed from orange to yellow
|
||||
status_text = "BOOTING";
|
||||
} else if (network_status == "disconnected" || network_status == "error") {
|
||||
status_color = rgb_matrix::Color(255, 0, 0); // Red
|
||||
@@ -336,10 +336,10 @@ void draw_4g_screen(Canvas* canvas, const std::string& network_status, int signa
|
||||
status_text = "UNKNOWN";
|
||||
}
|
||||
|
||||
rgb_matrix::DrawText(canvas, value_font, 65, status_y, status_color, &bg_color, status_text.c_str(), 0);
|
||||
rgb_matrix::DrawText(canvas, value_font, 45, status_y, status_color, &bg_color, status_text.c_str(), 0);
|
||||
|
||||
// Only show signal section if NOT in booting mode
|
||||
if (network_status != "booting") {
|
||||
// Only show signal section if connected (NOT for booting, disconnected, or error)
|
||||
if (network_status == "connected") {
|
||||
// Draw signal strength section
|
||||
int signal_y = 45;
|
||||
rgb_matrix::DrawText(canvas, value_font, 2, signal_y, white, &bg_color, "Signal:", 0);
|
||||
@@ -383,16 +383,30 @@ void draw_4g_screen(Canvas* canvas, const std::string& network_status, int signa
|
||||
rgb_matrix::DrawText(canvas, small_font, 70, signal_y - 3, rgb_matrix::Color(128, 128, 128), &bg_color, "NO DATA", 0);
|
||||
}
|
||||
} else {
|
||||
// Clear the signal area completely when booting
|
||||
// Clear the signal area completely for all non-connected states
|
||||
for (int clear_x = 0; clear_x < 128; clear_x++) {
|
||||
for (int clear_y = 35; clear_y < 55; clear_y++) {
|
||||
canvas->SetPixel(clear_x, clear_y, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
// Show booting message instead of signal info
|
||||
int boot_msg_y = 45;
|
||||
rgb_matrix::DrawText(canvas, value_font, 15, boot_msg_y, rgb_matrix::Color(255, 165, 0), &bg_color, "Initializing modem...", 0);
|
||||
// Show appropriate message based on status
|
||||
int msg_y = 45;
|
||||
int msg_y_second_line = 55;
|
||||
|
||||
if (network_status == "booting") {
|
||||
rgb_matrix::DrawText(canvas, value_font, 2, msg_y, rgb_matrix::Color(255, 255, 0), &bg_color, "Initializing modem...", 0);
|
||||
} else if (network_status == "disconnected") {
|
||||
rgb_matrix::DrawText(canvas, value_font, 20, msg_y, rgb_matrix::Color(255, 0, 0), &bg_color, "Connection lost", 0);
|
||||
rgb_matrix::DrawText(canvas, value_font, 20, msg_y_second_line, rgb_matrix::Color(255, 0, 0), &bg_color, " try reconnect", 0);
|
||||
|
||||
} else if (network_status == "error") {
|
||||
rgb_matrix::DrawText(canvas, value_font, 25, msg_y, rgb_matrix::Color(255, 0, 0), &bg_color, "Modem error", 0);
|
||||
rgb_matrix::DrawText(canvas, value_font, 20, msg_y_second_line, rgb_matrix::Color(255, 0, 0), &bg_color, " try reconnect", 0);
|
||||
|
||||
} else if (network_status == "connecting") {
|
||||
rgb_matrix::DrawText(canvas, value_font, 20, msg_y, rgb_matrix::Color(255, 255, 0), &bg_color, "Connecting...", 0);
|
||||
}
|
||||
}
|
||||
|
||||
// Draw timestamp
|
||||
|
||||
Reference in New Issue
Block a user