Skip to content

Commit

Permalink
Support reading enabled state without auto state
Browse files Browse the repository at this point in the history
  • Loading branch information
jwbonner committed Oct 19, 2024
1 parent b91df2e commit af7e183
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/shared/log/LogUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,13 @@ export function getAutonomousData(log: Log): LogValueSetBoolean | null {
export function getRobotStateRanges(log: Log): { start: number; end?: number; mode: "disabled" | "auto" | "teleop" }[] {
let enabledData = getEnabledData(log);
let autoData = getAutonomousData(log);
if (!enabledData || !autoData) return [];
if (enabledData === null) return [];
if (autoData === null) {
autoData = {
timestamps: [],
values: []
};
}

// Combine enabled and auto data
let allTimestamps = [...enabledData.timestamps, ...autoData.timestamps];
Expand Down

0 comments on commit af7e183

Please sign in to comment.