Skip to content

Commit

Permalink
Report if valve closed due to timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
albireox committed Sep 19, 2024
1 parent 065b941 commit c9927ff
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions app/fills/[[...pk]]/tables.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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']) {
Expand All @@ -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' : '',
});
}
}
Expand All @@ -96,6 +98,7 @@ export function OpenTimesTable(props: { valve_times: ValveTimesType | null }) {
<Table.Td>{element.open_time}</Table.Td>
<Table.Td>{element.close_time}</Table.Td>
<Table.Td ta="right">{element.elapsed}</Table.Td>
<Table.Td ta="center">{element.timeout}</Table.Td>
</Table.Tr>
));

Expand All @@ -116,6 +119,7 @@ export function OpenTimesTable(props: { valve_times: ValveTimesType | null }) {
<Table.Th>Open</Table.Th>
<Table.Th>Close</Table.Th>
<Table.Th ta="right">Elapsed (s)</Table.Th>
<Table.Th ta="center">Timeout?</Table.Th>
</Table.Tr>
</Table.Thead>
<Table.Tbody>{rows}</Table.Tbody>
Expand Down
6 changes: 5 additions & 1 deletion app/fills/[[...pk]]/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@
export type FillListType = Map<number, string>;

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 = {
Expand Down

0 comments on commit c9927ff

Please sign in to comment.