[PERF] Host Debug Overlay Isolation
This commit is contained in:
@@ -124,7 +124,7 @@ impl HostRunner {
|
||||
}
|
||||
|
||||
fn display_dbg_overlay(&mut self) {
|
||||
let tel = &self.firmware.os.telemetry_last;
|
||||
let tel = self.firmware.os.atomic_telemetry.snapshot();
|
||||
let color_text = Color::WHITE;
|
||||
let color_bg = Color::INDIGO; // Dark blue to stand out
|
||||
let color_warn = Color::RED;
|
||||
@@ -195,18 +195,18 @@ impl HostRunner {
|
||||
);
|
||||
self.hardware.gfx.draw_text(10, 90, &format!("LOGS: {}", tel.logs_count), color_text);
|
||||
|
||||
let cert_color = if tel.violations > 0 { color_warn } else { color_text };
|
||||
self.hardware.gfx.draw_text(10, 98, &format!("CERT LAST: {}", tel.violations), cert_color);
|
||||
// Snapshot does not include violations, as they are part of certification (logical end of frame)
|
||||
// But for visual debug, we can check if there are recent CA tags in logs
|
||||
let recent_logs = self.firmware.os.log_service.get_recent(10);
|
||||
let violations_count = recent_logs.iter().filter(|e| e.tag >= 0xCA01 && e.tag <= 0xCA07).count();
|
||||
let cert_color = if violations_count > 0 { color_warn } else { color_text };
|
||||
self.hardware.gfx.draw_text(10, 98, &format!("CERT RECENT: {}", violations_count), cert_color);
|
||||
|
||||
if tel.violations > 0
|
||||
&& let Some(event) = self
|
||||
.firmware
|
||||
.os
|
||||
.log_service
|
||||
.get_recent(10)
|
||||
if violations_count > 0
|
||||
&& let Some(event) = recent_logs
|
||||
.into_iter()
|
||||
.rev()
|
||||
.find(|e| e.tag >= 0xCA01 && e.tag <= 0xCA03)
|
||||
.find(|e| e.tag >= 0xCA01 && e.tag <= 0xCA07)
|
||||
{
|
||||
let mut msg = event.msg.clone();
|
||||
if msg.len() > 30 {
|
||||
|
||||
Reference in New Issue
Block a user