Remove custom error for background. Do not allow check if background is not set.

This commit is contained in:
Julian Stirling 2025-07-27 20:46:37 +01:00
parent 7f4b4ed1f3
commit d376eee5d5
2 changed files with 23 additions and 9 deletions

View file

@ -18,6 +18,7 @@
<div>
<button
type="button"
:disabled="isDisabled"
:hidden="taskStarted"
class="uk-button uk-width-1-1"
:class="[buttonPrimary ? 'uk-button-primary' : 'uk-button-default']"
@ -132,7 +133,12 @@ export default {
type: Boolean,
required: false,
default: false
}
},
isDisabled: {
type: Boolean,
required: false,
default: false
},
},
data: function() {

View file

@ -17,6 +17,7 @@
:can-terminate="false"
:poll-interval="0.1"
@response="alertBackgroundSet"
@error="modalError"
/>
</div>
<div class="uk-margin">
@ -25,10 +26,11 @@
thing="camera"
action="image_is_sample"
submit-label="Check Current Image"
:isDisabled="!backgroundDetectorStatus.ready"
:can-terminate="false"
:poll-interval="0.1"
@response="alertImageLabel"
@error="backgroundDetectError"
@error="modalError"
/>
</div>
</div>
@ -40,7 +42,13 @@ import ActionButton from "../../labThingsComponents/actionButton.vue";
export default {
components: {
ActionButton
ActionButton,
},
data() {
return {
backgroundDetectorStatus: undefined,
};
},
methods: {
@ -50,13 +58,13 @@ export default {
alertImageLabel(r) {
let label = r.output[0] ? "sample" : "background";
this.modalNotify(`Current image is ${label} (${r.output[1]})`);
},
backgroundDetectError() {
this.modalError(
"Background detection failed, most likely you need to set a background image." +
" There may be more information in the log."
);
}
},
async created() {
this.backgroundDetectorStatus = await this.readThingProperty(
"camera",
"background_detector_status"
);
}
};
</script>