Skip to content

Commit

Permalink
(Mostly) allow reloading during calibration (#1593)
Browse files Browse the repository at this point in the history
  • Loading branch information
mcm001 authored Nov 26, 2024
1 parent 163b5c9 commit 7e9da41
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions photon-client/src/components/cameras/CameraCalibrationCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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;
}
Expand All @@ -192,7 +197,8 @@ const endCalibration = () => {
calibSuccess.value = false;
})
.finally(() => {
isCalibrating.value = false;
// isCalibrating.value = false;
// backend deals with this for us
});
};
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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>
Expand Down

0 comments on commit 7e9da41

Please sign in to comment.