More consitent use of mixins for interaactiong with thing descriptions
This commit is contained in:
parent
40b3d993ee
commit
1ba1a3082b
9 changed files with 45 additions and 29 deletions
|
|
@ -78,13 +78,11 @@ export default {
|
|||
const calibrateableThings = Object.keys(this.availableCalibrationTasks);
|
||||
|
||||
for (const name of calibrateableThings) {
|
||||
try {
|
||||
if (this.thingPropertyAvailable(name, "calibration_required")) {
|
||||
const thingNeedsCal = await this.readThingProperty(name, "calibration_required");
|
||||
if (thingNeedsCal) {
|
||||
needsCalibration.push(name);
|
||||
}
|
||||
} catch (e) {
|
||||
console.error(`${name}: missing calibration_required property`, e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -34,18 +34,16 @@
|
|||
<div class="uk-margin-small-bottom">
|
||||
<b>Camera:</b>
|
||||
<br />
|
||||
<div v-if="'camera' in things">
|
||||
{{ things.camera.title }}
|
||||
<div>
|
||||
{{ cameraType }}
|
||||
</div>
|
||||
<div v-else class="uk-text-danger"><b>No camera configured</b></div>
|
||||
</div>
|
||||
<div>
|
||||
<div v-if="stageType">
|
||||
<b>Stage:</b>
|
||||
<br />
|
||||
<div v-if="'stage' in things">
|
||||
{{ things.stage.title }}
|
||||
<div>
|
||||
{{ stageType }}
|
||||
</div>
|
||||
<div v-else class="uk-text-danger"><b>No stage configured</b></div>
|
||||
</div>
|
||||
|
||||
<hr />
|
||||
|
|
@ -71,8 +69,12 @@ export default {
|
|||
},
|
||||
|
||||
computed: {
|
||||
things: function () {
|
||||
return this.$store.getters["wot/thingDescriptions"];
|
||||
cameraType() {
|
||||
// No need to check as the microscope won't start up without a camera defined
|
||||
return this.thingDescription("camera").title;
|
||||
},
|
||||
stageType() {
|
||||
return this.thingAvailable("stage") ? this.thingDescription("stage").title : undefined;
|
||||
},
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
</p>
|
||||
<div class="buttons-container">
|
||||
<button
|
||||
v-show="'shutdown' in things.system.actions"
|
||||
v-show="shutdownAvailable"
|
||||
class="uk-button uk-button-primary uk-width-1-3 shutdown-button"
|
||||
@click="systemRequest('shutdown')"
|
||||
>
|
||||
|
|
@ -42,8 +42,8 @@ export default {
|
|||
},
|
||||
|
||||
computed: {
|
||||
things: function () {
|
||||
return this.$store.getters["wot/thingDescriptions"];
|
||||
shutdownAvailable() {
|
||||
return this.thingActionAvailable("system", "shutdown");
|
||||
},
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -119,12 +119,7 @@ export default {
|
|||
|
||||
computed: {
|
||||
scansUri() {
|
||||
return this.$store.getters["wot/thingPropertyUrl"](
|
||||
"smart_scan",
|
||||
"scans",
|
||||
"readproperty",
|
||||
true,
|
||||
);
|
||||
return this.thingPropertyUrl("smart_scan", "scans");
|
||||
},
|
||||
scansEmpty() {
|
||||
return this.scans.length == 0;
|
||||
|
|
|
|||
|
|
@ -69,10 +69,10 @@ export default {
|
|||
|
||||
computed: {
|
||||
actions() {
|
||||
return this.$store.getters["wot/thingDescription"]("camera_stage_mapping").actions;
|
||||
return this.thingDescription("camera_stage_mapping").actions;
|
||||
},
|
||||
properties() {
|
||||
return this.$store.getters["wot/thingDescription"]("camera_stage_mapping").properties;
|
||||
return this.thingDescription("camera_stage_mapping").properties;
|
||||
},
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ export default {
|
|||
|
||||
computed: {
|
||||
actions() {
|
||||
return this.$store.getters["wot/thingDescription"]("camera").actions;
|
||||
return this.thingDescription("camera").actions;
|
||||
},
|
||||
},
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue