Fixed arrival time.

This commit is contained in:
2026-05-19 08:37:30 +01:00
parent e758edd45a
commit cef6faa05f
6 changed files with 15 additions and 9 deletions
+5 -2
View File
@@ -38,12 +38,15 @@ impl Screen<'_> {
pub fn update_information(&mut self, display_data: &DisplayData) {
self.do_clear();
// TODO: Add header
let num_arrivals: i32 = min(if display_data.status.is_some() {LINE_COUNT - 1} else {LINE_COUNT}, display_data.lines.len().try_into().unwrap());
for line in 0..num_arrivals {
// Compose a line of text with all the information
let entry = display_data.lines.get(line as usize).unwrap();
let line: u32 = line.try_into().unwrap();
let due_in_mins = (entry.due_in / 60) as i32;
let line: u32 = (line + 1).try_into().unwrap();
let due_in_mins = entry.due_in as i32;
let arrival_color: Color = self.color_for(due_in_mins);
self.color = COLOR_LCD_AMBER;