From e71a25733bceb28f8a683fe0d3ab9aa6ba508cea Mon Sep 17 00:00:00 2001 From: Julian Stirling Date: Tue, 4 Nov 2025 20:05:27 +0000 Subject: [PATCH 1/3] Fix CSM settings from erroring CSM settings was erroring due to reading properties that don't exist and calculating using nulls. --- .../CSMCalibrationSettings.vue | 33 +++++++++++-------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/webapp/src/components/tabContentComponents/settingsComponents/CSMSettingsComponents/CSMCalibrationSettings.vue b/webapp/src/components/tabContentComponents/settingsComponents/CSMSettingsComponents/CSMCalibrationSettings.vue index fc3359c4..953473c4 100644 --- a/webapp/src/components/tabContentComponents/settingsComponents/CSMSettingsComponents/CSMCalibrationSettings.vue +++ b/webapp/src/components/tabContentComponents/settingsComponents/CSMSettingsComponents/CSMCalibrationSettings.vue @@ -104,20 +104,25 @@ export default { "camera_stage_mapping", "image_to_stage_displacement_matrix", ); - this.csmResolution = await this.readThingProperty("camera_stage_mapping", "image_resolution"); - let streamResolution = await this.readThingProperty("camera", "stream_resolution"); - csmMatrix[0][0] = Number(csmMatrix[0][0].toFixed(3)); - csmMatrix[0][1] = Number(csmMatrix[0][1].toFixed(3)); - csmMatrix[1][0] = Number(csmMatrix[1][0].toFixed(3)); - csmMatrix[1][1] = Number(csmMatrix[1][1].toFixed(3)); - this.csmMatrix = csmMatrix; - this.csmRatio = Number((Math.abs(csmMatrix[1][0]) + Math.abs(csmMatrix[0][1])) / 2).toFixed( - 3, - ); - this.csmFOV = [ - Number(((streamResolution[0] ** 2 * this.csmRatio) / this.csmResolution[1]).toFixed(0)), - Number(((streamResolution[1] ** 2 * this.csmRatio) / this.csmResolution[0]).toFixed(0)), - ]; + if (csmMatrix) { + this.csmResolution = await this.readThingProperty( + "camera_stage_mapping", + "image_resolution", + ); + csmMatrix[0][0] = Number(csmMatrix[0][0].toFixed(3)); + csmMatrix[0][1] = Number(csmMatrix[0][1].toFixed(3)); + csmMatrix[1][0] = Number(csmMatrix[1][0].toFixed(3)); + csmMatrix[1][1] = Number(csmMatrix[1][1].toFixed(3)); + this.csmMatrix = csmMatrix; + this.csmRatio = Number((Math.abs(csmMatrix[1][0]) + Math.abs(csmMatrix[0][1])) / 2).toFixed( + 3, + ); + // Note [1] then [0] as CSM reports resolution as (y, x) + this.csmFOV = [ + Number((this.csmResolution[1] * this.csmRatio).toFixed(0)), + Number((this.csmResolution[0] * this.csmRatio).toFixed(0)), + ]; + } }, onRecalibrateResponse: function () { this.modalNotify("Finished stage-to-camera calibration."); From e1172248b0370ba3191349eddd38f15e12f6701e Mon Sep 17 00:00:00 2001 From: Julian Stirling Date: Tue, 4 Nov 2025 20:13:46 +0000 Subject: [PATCH 2/3] Camera stage mapping step in wizard says skip until complete. --- .../serverSpecifiedActionButton.vue | 19 ++++++++++++++++++- .../calibrationWizardTask.vue | 13 ++++++++++++- .../csmSteps/runCsmStep.vue | 16 +++++++++++++++- .../CSMCalibrationSettings.vue | 3 ++- 4 files changed, 47 insertions(+), 4 deletions(-) diff --git a/webapp/src/components/labThingsComponents/serverSpecifiedActionButton.vue b/webapp/src/components/labThingsComponents/serverSpecifiedActionButton.vue index d855092b..a49d3a0a 100644 --- a/webapp/src/components/labThingsComponents/serverSpecifiedActionButton.vue +++ b/webapp/src/components/labThingsComponents/serverSpecifiedActionButton.vue @@ -11,6 +11,7 @@ :modal-progress="actionData.modal_progress" @response="actionResponse" @error="modalError" + @finished="actionFinished" /> @@ -33,11 +34,27 @@ export default { }, methods: { - actionResponse: function () { + /** + * Runs when the ActionButton's action completes successfully. + * + * It is used to send success notifications. It also forwards the response to the + * parent. + */ + actionResponse: function (response) { if (this.actionData.notify_on_success) { this.modalNotify(this.actionData.success_message); + this.$emit("response", response); } }, + /** + * Runs when the ActionButton's action finishes in any way (error, cancel, + * completion). + * + * This forwards the event to the parent + */ + actionFinished: function () { + this.$emit("finished"); + }, }, }; diff --git a/webapp/src/components/modalComponents/calibrationWizardComponents/calibrationWizardTask.vue b/webapp/src/components/modalComponents/calibrationWizardComponents/calibrationWizardTask.vue index 57151b7b..f2345223 100644 --- a/webapp/src/components/modalComponents/calibrationWizardComponents/calibrationWizardTask.vue +++ b/webapp/src/components/modalComponents/calibrationWizardComponents/calibrationWizardTask.vue @@ -27,6 +27,7 @@ gets very confusing. v-if="currentStep" :key="stepIndex" v-bind="currentStep.props" + @awaiting-user="handleAwaitingUser" />