From c9927ff85b1404d8e93a6a311eacc949e4c3913e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20S=C3=A1nchez-Gallego?= Date: Wed, 18 Sep 2024 21:06:11 -0700 Subject: [PATCH] Report if valve closed due to timeout --- app/fills/[[...pk]]/tables.tsx | 4 ++++ app/fills/[[...pk]]/types.ts | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/app/fills/[[...pk]]/tables.tsx b/app/fills/[[...pk]]/tables.tsx index 1fe9820..de80e19 100644 --- a/app/fills/[[...pk]]/tables.tsx +++ b/app/fills/[[...pk]]/tables.tsx @@ -70,6 +70,7 @@ export function OpenTimesTable(props: { valve_times: ValveTimesType | null }) { open_time: string | null; close_time: string | null; elapsed: string | null; + timeout: string | null; }[] = []; for (const cam of ['purge', 'b1', 'r1', 'z1', 'b2', 'r2', 'z2', 'b3', 'r3', 'z3']) { @@ -85,6 +86,7 @@ export function OpenTimesTable(props: { valve_times: ValveTimesType | null }) { open_time: toTime(open_time), close_time: toTime(close_time), elapsed: elapsed.toFixed(1), + timeout: props.valve_times[cam].timed_out ? 'Y' : '', }); } } @@ -96,6 +98,7 @@ export function OpenTimesTable(props: { valve_times: ValveTimesType | null }) { {element.open_time} {element.close_time} {element.elapsed} + {element.timeout} )); @@ -116,6 +119,7 @@ export function OpenTimesTable(props: { valve_times: ValveTimesType | null }) { Open Close Elapsed (s) + Timeout? {rows} diff --git a/app/fills/[[...pk]]/types.ts b/app/fills/[[...pk]]/types.ts index de6ba6c..ad41a7b 100644 --- a/app/fills/[[...pk]]/types.ts +++ b/app/fills/[[...pk]]/types.ts @@ -8,7 +8,11 @@ export type FillListType = Map; export type ValveTimesType = { - [key: string]: { open_time: string | null; close_time: string | null }; + [key: string]: { + open_time: string | null; + close_time: string | null; + timed_out: boolean | null; + }; }; export type FillMetadataType = {