(Mostly) allow reloading during calibration (#1593)

This commit is contained in:
Matt
2024-11-25 19:25:50 -08:00
committed by GitHub
parent 163b5c9c81
commit 7e9da4133d

View File

@@ -157,7 +157,10 @@ const downloadCalibBoard = () => {
doc.save(`calibrationTarget-${CalibrationBoardTypes[boardType.value]}.pdf`);
};
const isCalibrating = ref(false);
const isCalibrating = computed(
() => useCameraSettingsStore().currentCameraSettings.currentPipelineIndex === WebsocketPipelineType.Calib3d
);
const startCalibration = () => {
useCameraSettingsStore().startPnPCalibration({
squareSizeIn: squareSizeIn.value,
@@ -170,13 +173,15 @@ const startCalibration = () => {
});
// The Start PnP method already handles updating the backend so only a store update is required
useCameraSettingsStore().currentCameraSettings.currentPipelineIndex = WebsocketPipelineType.Calib3d;
isCalibrating.value = true;
// isCalibrating.value = true;
calibCanceled.value = false;
};
const showCalibEndDialog = ref(false);
const calibCanceled = ref(false);
const calibSuccess = ref<boolean | undefined>(undefined);
const endCalibration = () => {
calibSuccess.value = undefined;
if (!useStateStore().calibrationData.hasEnoughImages) {
calibCanceled.value = true;
}
@@ -192,7 +197,8 @@ const endCalibration = () => {
calibSuccess.value = false;
})
.finally(() => {
isCalibrating.value = false;
// isCalibrating.value = false;
// backend deals with this for us
});
};
@@ -245,6 +251,7 @@ const setSelectedVideoFormat = (format: VideoFormat) => {
<v-row style="display: flex; flex-direction: column" class="mt-4">
<v-card-subtitle v-show="!isCalibrating" class="pl-3 pa-0 ma-0"> Configure New Calibration</v-card-subtitle>
<v-form ref="form" v-model="settingsValid" class="pl-4 mb-10 pr-5">
<!-- TODO: the default videoFormatIndex is 0, but the list of unique video mode indexes might not include 0. getUniqueVideoResolutionStrings indexing is also different from the normal video mode indexing -->
<pv-select
v-model="useStateStore().calibrationData.videoFormatIndex"
label="Resolution"
@@ -492,10 +499,12 @@ const setSelectedVideoFormat = (format: VideoFormat) => {
process.</v-card-text
>
</template>
<template v-else-if="isCalibrating">
<!-- No result reported yet -->
<template v-else-if="calibSuccess === undefined">
<v-progress-circular indeterminate :size="70" :width="8" color="accent" />
<v-card-text>Camera is being calibrated. This process may take several minutes...</v-card-text>
</template>
<!-- Got positive result -->
<template v-else-if="calibSuccess">
<v-icon color="green" size="70"> mdi-check-bold </v-icon>
<v-card-text>