Merge branch 'csm-skip-button-fix' into 'v3'

Ensure CSM calibration pane updates from Skip to Next on successful calibration.

Closes #822

See merge request openflexure/openflexure-microscope-server!649
This commit is contained in:
Joe Knapper 2026-07-08 09:30:30 +00:00
commit d0c1b4191d

View file

@ -17,7 +17,7 @@
@update:task-status="taskStatus = $event" @update:task-status="taskStatus = $event"
@update:log="log = $event" @update:log="log = $event"
@task-started="$emit('prevent-navigation', true)" @task-started="$emit('prevent-navigation', true)"
@finished="$emit('prevent-navigation', false)" @finished="csmFinished"
/> />
</div> </div>
</template> </template>
@ -52,10 +52,26 @@ export default {
}, },
methods: { methods: {
/**
* Check if camera stage mapping is calibrated and emit the result to awaiting-user.
*
* "awaiting-user" is used to signal that the user should perform an action before
* continuing. In practice it changes the next button to "skip".
*/
async checkCalibrationState() { async checkCalibrationState() {
const needsCal = await this.readThingProperty("camera_stage_mapping", "calibration_required"); const needsCal = await this.readThingProperty("camera_stage_mapping", "calibration_required");
this.$emit("awaiting-user", needsCal); this.$emit("awaiting-user", needsCal);
}, },
/**
* Runs whenever CSM finishes. It re-enables navigation and checks calibration state.
*
* This happens if the action is cancelled, errors, or completes successfully as it
* is triggered by `finished`.
*/
async csmFinished() {
this.$emit("prevent-navigation", false);
await this.checkCalibrationState();
},
}, },
}; };
</script> </script>