Skip to content

Commit

Permalink
Analysis: add fallback to controlboard if no accel is configured
Browse files Browse the repository at this point in the history
  • Loading branch information
miklschmidt committed Dec 27, 2024
1 parent ae5ada3 commit feb9121
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/app/analysis/analysis.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,9 @@ export const Analysis = () => {
() => toolheads.some((th) => th.getYAccelerometerName() === 'beacon' || th.getXAccelerometerName() === 'beacon'),
[toolheads],
);
const [adxl, setAdxl] = useState<MacroRecordingSettings['accelerometer']>(toolheads[0].getYAccelerometerName());
const [adxl, setAdxl] = useState<MacroRecordingSettings['accelerometer']>(
toolheads[0].getYAccelerometerName() ?? 'controlboard',
);
const {
isChartEnabled,
isLoading,
Expand Down
2 changes: 1 addition & 1 deletion src/app/analysis/realtime-analysis-chart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export const useRealtimeAnalysisChart = (
const [isLoading, setIsLoading] = useState(false);
const toolheads = useToolheads();
const controlBoard = useRecoilValue(ControlboardState);
const adxl = accelerometer ?? toolheads[0].getYAccelerometerName();
const adxl = accelerometer ?? toolheads[0].getYAccelerometerName() ?? 'controlboard';
const adxlHardwareName =
(adxl === 'controlboard'
? controlBoard?.name
Expand Down

0 comments on commit feb9121

Please sign in to comment.