Add an error when the connection for the end calibration request fails (#1840)

This commit is contained in:
Gold856
2025-08-08 16:06:08 -04:00
committed by GitHub
parent 3ac509b40d
commit 22490b8c38
3 changed files with 18 additions and 2 deletions

View File

@@ -182,8 +182,10 @@ const startCalibration = () => {
const showCalibEndDialog = ref(false);
const calibCanceled = ref(false);
const calibSuccess = ref<boolean | undefined>(undefined);
const calibEndpointFail = ref(false);
const endCalibration = () => {
calibSuccess.value = undefined;
calibEndpointFail.value = false;
if (!useStateStore().calibrationData.hasEnoughImages) {
calibCanceled.value = true;
@@ -196,7 +198,13 @@ const endCalibration = () => {
.then(() => {
calibSuccess.value = true;
})
.catch(() => {
.catch((e) => {
if (e.response) {
// Server returned a status code
} else if (e.request) {
// Something went wrong. Unsure if calibration actually worked
calibEndpointFail.value = true;
}
calibSuccess.value = false;
})
.finally(() => {
@@ -525,6 +533,13 @@ const setSelectedVideoFormat = (format: VideoFormat) => {
}}!
</v-card-text>
</template>
<template v-else-if="calibEndpointFail">
<v-icon color="gray" size="70"> mdi-help-circle-outline </v-icon>
<v-card-text
>Unable to determine if calibration was successful. Refresh this page and manually check if calibration
was successful.</v-card-text
>
</template>
<template v-else>
<v-icon color="red" size="70"> mdi-close </v-icon>
<v-card-text>

View File

@@ -210,7 +210,7 @@ public class Calibrate3dPipeline
broadcastState();
}
private void broadcastState() {
public void broadcastState() {
var state =
SerializationUtils.objectToHashMap(
new UICalibrationData(

View File

@@ -395,6 +395,7 @@ public class VisionModule {
settings.cameraAutoExposure = true;
setPipeline(PipelineManager.CAL_3D_INDEX);
pipelineManager.calibration3dPipeline.broadcastState();
}
public void saveInputSnapshot() {