Don't invoke stitching from the front-end
Stitching is now done automatically in a sub process by the server. This is much cleaner - and all we need to do is poll for file updates. I've also styled the log display slightly better.
This commit is contained in:
parent
9a2b830ff5
commit
3de7aa2fb2
2 changed files with 12 additions and 44 deletions
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div ref="logContainer" class="log-container">
|
<div ref="logContainer" class="log-container uk-margin-left uk-margin-right uk-margin">
|
||||||
<div v-if="log">
|
<div v-if="log">
|
||||||
<div v-for="(item, index) in log" :key="`log_entry_${index}`">
|
<div v-for="(item, index) in log" :key="`log_entry_${index}`">
|
||||||
{{ item.message }}
|
{{ item.message }}
|
||||||
|
|
@ -57,5 +57,8 @@ export default {
|
||||||
position: relative;
|
position: relative;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
overflow-x: auto;
|
overflow-x: auto;
|
||||||
|
background-color: white;
|
||||||
|
padding: 0.5em;
|
||||||
|
border: 1px solid black;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -49,6 +49,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-show="scanning">
|
<div v-show="scanning">
|
||||||
|
<mini-stream-display v-if="displayImageOnRight" />
|
||||||
<action-log-display
|
<action-log-display
|
||||||
id="log-display"
|
id="log-display"
|
||||||
:log="log"
|
:log="log"
|
||||||
|
|
@ -72,17 +73,6 @@
|
||||||
Close
|
Close
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<mini-stream-display v-if="displayImageOnRight" />
|
|
||||||
<div v-show="false">
|
|
||||||
<taskSubmitter
|
|
||||||
ref="stitchFromStageSubmitter"
|
|
||||||
:submit-url="stitchFromStageUri"
|
|
||||||
submit-label="Stitch image from stage coordinates"
|
|
||||||
:submit-data="stitchPayload"
|
|
||||||
@completed="lastStitchedImage = $event.href"
|
|
||||||
@update:taskStatus="stitchFromStageStatus = $event"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="view-component uk-width-expand">
|
<div class="view-component uk-width-expand">
|
||||||
<img v-if="displayImageOnRight" :src="lastStitchedImage" id="last-stitched-image"/>
|
<img v-if="displayImageOnRight" :src="lastStitchedImage" id="last-stitched-image"/>
|
||||||
|
|
@ -120,7 +110,7 @@ export default {
|
||||||
stitchFromStageStatus: "",
|
stitchFromStageStatus: "",
|
||||||
progress: null,
|
progress: null,
|
||||||
log: [],
|
log: [],
|
||||||
lastStitchedImage: null
|
lastStitchedImage: null,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -131,35 +121,9 @@ export default {
|
||||||
smartScanUri() {
|
smartScanUri() {
|
||||||
return this.thingActionUrl("smart_scan", "sample_scan");
|
return this.thingActionUrl("smart_scan", "sample_scan");
|
||||||
},
|
},
|
||||||
stitchFromStageUri () {
|
|
||||||
return this.thingActionUrl("stitching", "stitch_scan_from_stage");
|
|
||||||
},
|
|
||||||
stitchUri () {
|
|
||||||
return this.thingActionUrl("stitching", "stitch_scan");
|
|
||||||
},
|
|
||||||
correlateUri () {
|
|
||||||
return this.thingActionUrl("stitching", "correlate_scan");
|
|
||||||
},
|
|
||||||
cancellable() {
|
cancellable() {
|
||||||
return (this.taskStatus == "running") | (this.taskStatus == "pending");
|
return (this.taskStatus == "running") | (this.taskStatus == "pending");
|
||||||
},
|
},
|
||||||
correlatePayload() {
|
|
||||||
return {
|
|
||||||
scan_name: this.lastScanName
|
|
||||||
}
|
|
||||||
},
|
|
||||||
stitchPayload() {
|
|
||||||
return {
|
|
||||||
downsample: 2,
|
|
||||||
...this.correlatePayload
|
|
||||||
}
|
|
||||||
},
|
|
||||||
stitchFromStagePayload() {
|
|
||||||
return {
|
|
||||||
downsample: 2,
|
|
||||||
...this.correlatePayload
|
|
||||||
}
|
|
||||||
},
|
|
||||||
displayImageOnRight() {
|
displayImageOnRight() {
|
||||||
return this.scanning & this.lastStitchedImage !== null;
|
return this.scanning & this.lastStitchedImage !== null;
|
||||||
}
|
}
|
||||||
|
|
@ -176,14 +140,15 @@ export default {
|
||||||
startScanning() {
|
startScanning() {
|
||||||
this.lastStitchedImage = null;
|
this.lastStitchedImage = null;
|
||||||
this.scanning = true;
|
this.scanning = true;
|
||||||
setTimeout(this.pollScan, 5000);
|
setTimeout(this.pollScan, 1000);
|
||||||
},
|
},
|
||||||
pollScan() {
|
async pollScan() {
|
||||||
if (this.cancellable) { // while the scan is running
|
if (this.cancellable) { // while the scan is running
|
||||||
if (!["pending", "running"].includes(this.stitchFromStageStatus)) {
|
let mtime = await this.readThingProperty("smart_scan", "latest_preview_stitch_time");
|
||||||
this.$refs.stitchFromStageSubmitter.startTask()
|
if (mtime !== null) {
|
||||||
|
this.lastStitchedImage = `${this.$store.getters.baseUri}/smart_scan/latest_preview_stitch.jpg?t=${mtime}`;
|
||||||
}
|
}
|
||||||
setTimeout(this.pollScan, 5000); // keep rescheduling until it's stopped
|
setTimeout(this.pollScan, 1000); // keep rescheduling until it's stopped
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue