Let prettier change a load of things because new prettier has new rules :(
This commit is contained in:
parent
a05156407b
commit
1601bdd123
44 changed files with 218 additions and 262 deletions
|
|
@ -7,9 +7,7 @@
|
|||
<input v-model="reloadWhenOverridingOrigin" class="uk-input uk-checkbox" type="checkbox" />
|
||||
Reload web app with new origin
|
||||
</label>
|
||||
<button class="uk-button uk-button-default uk-margin-small">
|
||||
Apply
|
||||
</button>
|
||||
<button class="uk-button uk-button-default uk-margin-small">Apply</button>
|
||||
</form>
|
||||
</div>
|
||||
</template>
|
||||
|
|
@ -21,7 +19,7 @@ export default {
|
|||
|
||||
components: {},
|
||||
|
||||
data: function() {
|
||||
data: function () {
|
||||
return {
|
||||
newOrigin: this.$store.state.overrideOrigin,
|
||||
reloadWhenOverridingOrigin: true,
|
||||
|
|
@ -29,7 +27,7 @@ export default {
|
|||
},
|
||||
|
||||
methods: {
|
||||
overrideAPIHost: function(event) {
|
||||
overrideAPIHost: function (event) {
|
||||
// Save the origin override, so that if we reload the web app, you can easily
|
||||
this.$store.commit("changeOverrideOrigin", this.newOrigin);
|
||||
|
||||
|
|
|
|||
|
|
@ -50,9 +50,7 @@
|
|||
|
||||
<hr />
|
||||
</div>
|
||||
<div v-else-if="$store.state.waiting">
|
||||
Loading...
|
||||
</div>
|
||||
<div v-else-if="$store.state.waiting">Loading...</div>
|
||||
<div v-else-if="$store.state.error"><b>Error:</b> {{ $store.state.error }}</div>
|
||||
<div v-else>No active connection</div>
|
||||
</div>
|
||||
|
|
@ -65,7 +63,7 @@ export default {
|
|||
name: "StatusPane",
|
||||
components: { ActionButton },
|
||||
|
||||
data: function() {
|
||||
data: function () {
|
||||
return {
|
||||
version: undefined,
|
||||
version_source: undefined,
|
||||
|
|
@ -73,7 +71,7 @@ export default {
|
|||
},
|
||||
|
||||
computed: {
|
||||
things: function() {
|
||||
things: function () {
|
||||
return this.$store.getters["wot/thingDescriptions"];
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -89,18 +89,18 @@ export default {
|
|||
let label = r.output[0] ? "sample" : "background";
|
||||
this.modalNotify(`Current image is ${label} (${r.output[1]})`);
|
||||
},
|
||||
readSettings: async function() {
|
||||
readSettings: async function () {
|
||||
this.backgroundDetectorStatus = await this.readThingProperty(
|
||||
"camera",
|
||||
"background_detector_status",
|
||||
);
|
||||
},
|
||||
writeSettings: async function(requestedValue) {
|
||||
writeSettings: async function (requestedValue) {
|
||||
await this.invokeAction("camera", "update_detector_settings", { data: requestedValue });
|
||||
this.animate = true;
|
||||
this.readSettings();
|
||||
},
|
||||
resetAnimate: function() {
|
||||
resetAnimate: function () {
|
||||
this.animate = false;
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -139,9 +139,7 @@
|
|||
</div>
|
||||
<div v-else class="uk-text-warning">
|
||||
<p>Stage positioning is disabled since no stage is connected.</p>
|
||||
<p>
|
||||
Please check all data and power connections to your motor controller board.
|
||||
</p>
|
||||
<p>Please check all data and power connections to your motor controller board.</p>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
|
@ -160,7 +158,7 @@ export default {
|
|||
syncPropertyButton,
|
||||
},
|
||||
|
||||
data: function() {
|
||||
data: function () {
|
||||
return {
|
||||
setPosition: null,
|
||||
isAutofocusing: 0,
|
||||
|
|
@ -178,13 +176,13 @@ export default {
|
|||
invert() {
|
||||
return this.$store.state.navigationInvert;
|
||||
},
|
||||
baseUri: function() {
|
||||
baseUri: function () {
|
||||
return this.$store.getters.baseUri;
|
||||
},
|
||||
positionStatusUri: function() {
|
||||
positionStatusUri: function () {
|
||||
return `${this.baseUri}/stage/position`;
|
||||
},
|
||||
moveInImageCoordinatesUri: function() {
|
||||
moveInImageCoordinatesUri: function () {
|
||||
return this.thingActionUrl("camera_stage_mapping", "move_in_image_coordinates");
|
||||
},
|
||||
},
|
||||
|
|
@ -235,7 +233,7 @@ export default {
|
|||
|
||||
methods: {
|
||||
timeout(ms) {
|
||||
return new Promise(resolve => setTimeout(resolve, ms));
|
||||
return new Promise((resolve) => setTimeout(resolve, ms));
|
||||
},
|
||||
async move(x, y, z, absolute) {
|
||||
// Move the stage, by updating the controls and starting a move task
|
||||
|
|
@ -260,7 +258,7 @@ export default {
|
|||
async startMoveTask() {
|
||||
await this.$refs.moveButton.startTask();
|
||||
},
|
||||
moveInImageCoordinatesRequest: function(x, y) {
|
||||
moveInImageCoordinatesRequest: function (x, y) {
|
||||
// If not movement-locked
|
||||
if (!this.moveLock) {
|
||||
// Lock move requests
|
||||
|
|
@ -281,7 +279,7 @@ export default {
|
|||
.then(() => {
|
||||
this.updatePosition(); // Update the position in text boxes
|
||||
})
|
||||
.catch(error => {
|
||||
.catch((error) => {
|
||||
this.modalError(error); // Let mixin handle error
|
||||
})
|
||||
.then(() => {
|
||||
|
|
@ -294,7 +292,7 @@ export default {
|
|||
this.setPosition = await this.readThingProperty("stage", "position");
|
||||
},
|
||||
|
||||
handleCaptureResponse: async function(response) {
|
||||
handleCaptureResponse: async function (response) {
|
||||
// Retrieve the captured image and save it
|
||||
let imageUri = response.output.href;
|
||||
if (!imageUri) {
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ export default {
|
|||
EndpointButton,
|
||||
},
|
||||
|
||||
data: function() {
|
||||
data: function () {
|
||||
return {
|
||||
maxitems: 20,
|
||||
page: 1,
|
||||
|
|
@ -103,11 +103,11 @@ export default {
|
|||
},
|
||||
|
||||
computed: {
|
||||
filteredLevels: function() {
|
||||
filteredLevels: function () {
|
||||
let cutoffIndex = this.allLevels.indexOf(this.filterLevel);
|
||||
return this.allLevels.slice(cutoffIndex, -1);
|
||||
},
|
||||
filteredItems: function() {
|
||||
filteredItems: function () {
|
||||
var items = [];
|
||||
for (var item of this.logs) {
|
||||
// Add to capture list if matched
|
||||
|
|
@ -118,17 +118,17 @@ export default {
|
|||
|
||||
return items;
|
||||
},
|
||||
logURI: function() {
|
||||
logURI: function () {
|
||||
return `${this.$store.getters.baseUri}/log/`;
|
||||
},
|
||||
logFileURI: function() {
|
||||
logFileURI: function () {
|
||||
return `${this.$store.getters.baseUri}/logfile/`;
|
||||
},
|
||||
pagedItems: function() {
|
||||
pagedItems: function () {
|
||||
let startIndex = (this.page - 1) * this.maxitems;
|
||||
return this.filteredItems.slice(startIndex, startIndex + this.maxitems);
|
||||
},
|
||||
numberOfPages: function() {
|
||||
numberOfPages: function () {
|
||||
return Math.floor(this.filteredItems.length / this.maxitems);
|
||||
},
|
||||
},
|
||||
|
|
@ -190,12 +190,12 @@ export default {
|
|||
}
|
||||
this.logs = logs.reverse(); // Display in reverse chronological order
|
||||
},
|
||||
formatDateTime: function(isoDateTimeString) {
|
||||
formatDateTime: function (isoDateTimeString) {
|
||||
isoDateTimeString = isoDateTimeString.replace(",", ".");
|
||||
let date = new Date(isoDateTimeString);
|
||||
return date.toLocaleDateString() + " " + date.toLocaleTimeString();
|
||||
},
|
||||
escapeText: function(unsafeText) {
|
||||
escapeText: function (unsafeText) {
|
||||
let div = document.createElement("div");
|
||||
div.innerText = unsafeText;
|
||||
return div.innerHTML;
|
||||
|
|
|
|||
|
|
@ -35,14 +35,14 @@ export default {
|
|||
|
||||
components: {},
|
||||
|
||||
data: function() {
|
||||
data: function () {
|
||||
return {
|
||||
isRaspberrypi: undefined,
|
||||
};
|
||||
},
|
||||
|
||||
computed: {
|
||||
things: function() {
|
||||
things: function () {
|
||||
return this.$store.getters["wot/thingDescriptions"];
|
||||
},
|
||||
},
|
||||
|
|
@ -52,7 +52,7 @@ export default {
|
|||
},
|
||||
|
||||
methods: {
|
||||
systemRequest: function(action) {
|
||||
systemRequest: function (action) {
|
||||
let message = "";
|
||||
if (action == "reboot") {
|
||||
message = "Restart microscope?";
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ export default {
|
|||
},
|
||||
},
|
||||
|
||||
data: function() {
|
||||
data: function () {
|
||||
return {
|
||||
osdViewer: null,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -35,9 +35,7 @@
|
|||
button-label="Download JPEG"
|
||||
/>
|
||||
</div>
|
||||
<button class="uk-button uk-button-default uk-width-1-1" @click="deleteScan">
|
||||
Delete
|
||||
</button>
|
||||
<button class="uk-button uk-button-default uk-width-1-1" @click="deleteScan">Delete</button>
|
||||
<action-button
|
||||
v-if="scanData.can_stitch | (scanData.stitch_available & !scanData.dzi)"
|
||||
submit-label="Stitch Images"
|
||||
|
|
@ -121,14 +119,8 @@ export default {
|
|||
let yyyy = d.getFullYear();
|
||||
let mm = d.getMonth() + 1;
|
||||
let dd = d.getDate();
|
||||
let HH = d
|
||||
.getHours()
|
||||
.toString()
|
||||
.padStart(2, "0");
|
||||
let MM = d
|
||||
.getMinutes()
|
||||
.toString()
|
||||
.padStart(2, "0");
|
||||
let HH = d.getHours().toString().padStart(2, "0");
|
||||
let MM = d.getMinutes().toString().padStart(2, "0");
|
||||
return `${HH}:${MM} ${dd}/${mm}/${yyyy}`;
|
||||
},
|
||||
formatDuration(duration) {
|
||||
|
|
|
|||
|
|
@ -18,9 +18,7 @@
|
|||
:button-primary="false"
|
||||
:modal-progress="true"
|
||||
:requires-confirmation="true"
|
||||
:confirmation-message="
|
||||
'<h3>Stitch all unstitched scans?</h3><br>Depending on the number and size of scans, this may be slow, and your microscope should not be used during the stitching.'
|
||||
"
|
||||
:confirmation-message="'<h3>Stitch all unstitched scans?</h3><br>Depending on the number and size of scans, this may be slow, and your microscope should not be used during the stitching.'"
|
||||
@error="modalError"
|
||||
/>
|
||||
</div>
|
||||
|
|
@ -62,9 +60,7 @@
|
|||
<div class="gallery-grid uk-grid-match" uk-grid>
|
||||
<div v-if="scansEmpty">
|
||||
<h2>No scans available</h2>
|
||||
<p>
|
||||
There are no scans available to show.
|
||||
</p>
|
||||
<p>There are no scans available to show.</p>
|
||||
</div>
|
||||
<div v-for="scanData in paginatedScans" :key="scanData.id">
|
||||
<scan-card
|
||||
|
|
@ -110,7 +106,7 @@ export default {
|
|||
name: "ScanListContent",
|
||||
components: { actionButton, scanCard, ScanViewerModal },
|
||||
|
||||
data: function() {
|
||||
data: function () {
|
||||
return {
|
||||
scans: [],
|
||||
ongoing: null,
|
||||
|
|
@ -162,13 +158,13 @@ export default {
|
|||
});
|
||||
},
|
||||
|
||||
created: function() {
|
||||
created: function () {
|
||||
// Watch for host 'ready', then update status
|
||||
this.unwatchStoreFunction = this.$store.watch(
|
||||
(state, getters) => {
|
||||
return getters.ready;
|
||||
},
|
||||
ready => {
|
||||
(ready) => {
|
||||
if (ready) {
|
||||
// If the connection is now ready, update capture list
|
||||
this.updateScans();
|
||||
|
|
@ -205,7 +201,7 @@ export default {
|
|||
if (!scans | (scans.length == 0)) {
|
||||
this.scans = scans;
|
||||
}
|
||||
scans.forEach(scan => {
|
||||
scans.forEach((scan) => {
|
||||
scan.can_stitch = !scan.stitch_available && scan.number_of_images > 3;
|
||||
});
|
||||
scans.sort((a, b) => {
|
||||
|
|
|
|||
|
|
@ -6,9 +6,7 @@
|
|||
:button-primary="true"
|
||||
:can-terminate="true"
|
||||
:requires-confirmation="true"
|
||||
:confirmation-message="
|
||||
'Start recalibration of the stage to the camera? This may take a while, and the microscope will be locked during this time.'
|
||||
"
|
||||
:confirmation-message="'Start recalibration of the stage to the camera? This may take a while, and the microscope will be locked during this time.'"
|
||||
thing="camera_stage_mapping"
|
||||
action="calibrate_xy"
|
||||
:submit-label="'Auto-Calibrate Using Camera'"
|
||||
|
|
@ -26,9 +24,9 @@
|
|||
>
|
||||
Download Calibration Data
|
||||
</button>
|
||||
<div v-if="csmMatrix != 'undefined'" style="margin:10px;">
|
||||
<details
|
||||
><summary>Calibration Details</summary>
|
||||
<div v-if="csmMatrix != 'undefined'" style="margin: 10px">
|
||||
<details>
|
||||
<summary>Calibration Details</summary>
|
||||
<strong>CSM calculated for images with a resolution of {{ csmResolution }}</strong>
|
||||
<ul>
|
||||
<li>
|
||||
|
|
@ -84,7 +82,7 @@ export default {
|
|||
this.updateDisplayedCSM();
|
||||
}
|
||||
},
|
||||
getCalibrationData: async function() {
|
||||
getCalibrationData: async function () {
|
||||
try {
|
||||
let data = await this.readThingProperty("camera_stage_mapping", "last_calibration");
|
||||
if (data == {}) {
|
||||
|
|
@ -101,7 +99,7 @@ export default {
|
|||
this.modalError(error); // Let mixin handle error
|
||||
}
|
||||
},
|
||||
updateDisplayedCSM: async function() {
|
||||
updateDisplayedCSM: async function () {
|
||||
let csmMatrix = await this.readThingProperty(
|
||||
"camera_stage_mapping",
|
||||
"image_to_stage_displacement_matrix",
|
||||
|
|
@ -121,7 +119,7 @@ export default {
|
|||
Number(((streamResolution[1] ** 2 * this.csmRatio) / this.csmResolution[0]).toFixed(0)),
|
||||
];
|
||||
},
|
||||
onRecalibrateResponse: function() {
|
||||
onRecalibrateResponse: function () {
|
||||
this.modalNotify("Finished stage-to-camera calibration.");
|
||||
this.updateDisplayedCSM();
|
||||
},
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
export default {
|
||||
name: "AppSettings",
|
||||
|
||||
data: function() {
|
||||
data: function () {
|
||||
return {};
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ export default {
|
|||
},
|
||||
|
||||
computed: {
|
||||
cameraUri: function() {
|
||||
cameraUri: function () {
|
||||
return `${this.$store.getters.baseUri}/camera/`;
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -4,16 +4,12 @@
|
|||
<div>
|
||||
<div class="uk-margin">
|
||||
<p>Your z motor is currently {{ z_inverted }} inverted.</p>
|
||||
<p>
|
||||
We expect that moving in +z:
|
||||
</p>
|
||||
<p>We expect that moving in +z:</p>
|
||||
<ul>
|
||||
<li>Moves your objective up, towards the sample and illumination</li>
|
||||
<li>Turns the exposed z gear anti-clockwise (when viewed from above)</li>
|
||||
</ul>
|
||||
<p>
|
||||
If this is not the case, click the button below to switch.
|
||||
</p>
|
||||
<p>If this is not the case, click the button below to switch.</p>
|
||||
<div class="uk-margin">
|
||||
<div class="uk-margin">
|
||||
<action-button
|
||||
|
|
@ -41,14 +37,14 @@ export default {
|
|||
ActionButton,
|
||||
},
|
||||
|
||||
data: function() {
|
||||
data: function () {
|
||||
return {
|
||||
z_inverted: "",
|
||||
};
|
||||
},
|
||||
|
||||
computed: {
|
||||
stageType: function() {
|
||||
stageType: function () {
|
||||
return this.thingDescription("stage").title;
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -6,9 +6,7 @@
|
|||
><input v-model="disableStream" class="uk-checkbox" type="checkbox" /> Disable Web
|
||||
Stream</label
|
||||
>
|
||||
<p class="uk-margin-small">
|
||||
This will disable the embedded web stream of the camera.
|
||||
</p>
|
||||
<p class="uk-margin-small">This will disable the embedded web stream of the camera.</p>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
|
@ -18,7 +16,7 @@
|
|||
export default {
|
||||
name: "StreamSettings",
|
||||
|
||||
data: function() {
|
||||
data: function () {
|
||||
return {};
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@ export default {
|
|||
calibrationWizard,
|
||||
},
|
||||
|
||||
data: function() {
|
||||
data: function () {
|
||||
return {
|
||||
selected: "display",
|
||||
currentTab: "display",
|
||||
|
|
@ -131,12 +131,12 @@ export default {
|
|||
},
|
||||
|
||||
methods: {
|
||||
setTab: function(event, tab) {
|
||||
setTab: function (event, tab) {
|
||||
if (!(this.currentTab == tab)) {
|
||||
this.currentTab = tab;
|
||||
}
|
||||
},
|
||||
startModals: function() {
|
||||
startModals: function () {
|
||||
this.$refs.calibrationWizard.force_show();
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1,7 +1,5 @@
|
|||
<template>
|
||||
<div v-if="!backendOK" class="uk-alert-danger">
|
||||
No scan back-end found.
|
||||
</div>
|
||||
<div v-if="!backendOK" class="uk-alert-danger">No scan back-end found.</div>
|
||||
<!-- Grid managing tab content -->
|
||||
<div v-else uk-grid class="uk-height-1-1 uk-margin-remove uk-padding-remove">
|
||||
<div class="control-component uk-padding-small">
|
||||
|
|
@ -101,9 +99,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<div v-show="scanning">
|
||||
<h2 v-if="displayImageOnRight" style="text-align: center;">
|
||||
Live stitching preview
|
||||
</h2>
|
||||
<h2 v-if="displayImageOnRight" style="text-align: center">Live stitching preview</h2>
|
||||
<mini-stream-display v-if="displayImageOnRight" />
|
||||
<action-log-display id="log-display" :log="log" :task-status="taskStatus" />
|
||||
<action-progress-bar :progress="progress" :task-status="taskStatus" />
|
||||
|
|
@ -199,7 +195,7 @@ export default {
|
|||
},
|
||||
|
||||
methods: {
|
||||
onScanError: function(error) {
|
||||
onScanError: function (error) {
|
||||
this.scanRunning = false;
|
||||
this.modalError(error);
|
||||
},
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@
|
|||
export default {
|
||||
name: "StreamDisplay",
|
||||
|
||||
data: function() {
|
||||
data: function () {
|
||||
return {
|
||||
isVisible: false,
|
||||
displaySize: [0, 0],
|
||||
|
|
@ -49,14 +49,14 @@ export default {
|
|||
},
|
||||
|
||||
computed: {
|
||||
streamEnabled: function() {
|
||||
streamEnabled: function () {
|
||||
return this.$store.getters.ready && !this.$store.state.disableStream;
|
||||
},
|
||||
thisStreamOpen: function() {
|
||||
thisStreamOpen: function () {
|
||||
// Only a single MJPEG connection should be open at a time
|
||||
return !(this.displaySize[0] == 0) && !(this.displaySize[1] == 0);
|
||||
},
|
||||
streamImgUri: function() {
|
||||
streamImgUri: function () {
|
||||
return `${this.$store.getters.baseUri}/camera/mjpeg_stream`;
|
||||
},
|
||||
},
|
||||
|
|
@ -77,11 +77,11 @@ export default {
|
|||
this.sizeObserver.observe(streamDisplayElement);
|
||||
},
|
||||
|
||||
created: function() {
|
||||
created: function () {
|
||||
// Do nothing: preview stream now runs all the time
|
||||
},
|
||||
|
||||
beforeDestroy: function() {
|
||||
beforeDestroy: function () {
|
||||
// Remove global signal listener to change the GPU preview state
|
||||
this.$root.$off("globalTogglePreview");
|
||||
// Remove global signal listener to flash the stream element
|
||||
|
|
@ -96,18 +96,18 @@ export default {
|
|||
visibilityChanged(isVisible) {
|
||||
this.isVisible = isVisible;
|
||||
},
|
||||
flashStream: function() {
|
||||
flashStream: function () {
|
||||
// Run an animation that flashes the stream (for capture feedback)
|
||||
let element = this.$refs.streamDisplay;
|
||||
element.classList.remove("uk-animation-fade");
|
||||
element.offsetHeight; /* trigger reflow */
|
||||
element.classList.add("uk-animation-fade");
|
||||
setTimeout(function() {
|
||||
setTimeout(function () {
|
||||
element.classList.remove("uk-animation-fade");
|
||||
}, 800);
|
||||
},
|
||||
|
||||
clickMonitor: function(event) {
|
||||
clickMonitor: function (event) {
|
||||
// Calculate steps from event coordinates
|
||||
let xCoordinate = event.offsetX;
|
||||
let yCoordinate = event.offsetY;
|
||||
|
|
@ -129,13 +129,13 @@ export default {
|
|||
this.$root.$emit("globalMoveInImageCoordinatesEvent", -xRelative, -yRelative);
|
||||
},
|
||||
|
||||
handleResize: function() {
|
||||
handleResize: function () {
|
||||
// Only fires resize event after no resize in 500ms (prevents resize event spam)
|
||||
clearTimeout(this.resizeTimeoutId);
|
||||
this.resizeTimeoutId = setTimeout(this.handleDoneResize, 250);
|
||||
},
|
||||
|
||||
handleDoneResize: function() {
|
||||
handleDoneResize: function () {
|
||||
// Recalculate size
|
||||
|
||||
this.recalculateSize();
|
||||
|
|
@ -151,7 +151,7 @@ export default {
|
|||
}
|
||||
},
|
||||
|
||||
recalculateSize: function() {
|
||||
recalculateSize: function () {
|
||||
// Calculate stream size
|
||||
let element = this.$refs.streamDisplay.parentNode;
|
||||
let bound = element.getBoundingClientRect();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue