diff --git a/CHANGELOG.rst b/CHANGELOG.rst index d5ba3ad..ef0fdea 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -8,6 +8,7 @@ Changelog for Stingray Controller Added: ^^^^^^ - Handling for new firmware error reporting +- Stim waiting state to add spinner to stim start/stop button 0.3.0 (unreleased) diff --git a/ui/components/status/StatusBar.vue b/ui/components/status/StatusBar.vue index 5d557b7..37a3af5 100644 --- a/ui/components/status/StatusBar.vue +++ b/ui/components/status/StatusBar.vue @@ -260,7 +260,11 @@ export default { }, stimStatus: function (newStatus) { // only let stim messages through if system is in idle ready state - if (this.statusUuid === SYSTEM_STATUS.IDLE_READY_STATE) this.setStimSpecificStatus(newStatus); + if (this.statusUuid === SYSTEM_STATUS.IDLE_READY_STATE) { + if (newStatus === STIM_STATUS.WAITING) newStatus = this.stimPlayState ? "Stopping..." : "Starting..."; + + this.setStimSpecificStatus(newStatus); + } }, confirmationRequest: async function () { const stimOpsInProgress = diff --git a/ui/components/stimulation/StimulationStudioControls.vue b/ui/components/stimulation/StimulationStudioControls.vue index 8913d64..52719ce 100644 --- a/ui/components/stimulation/StimulationStudioControls.vue +++ b/ui/components/stimulation/StimulationStudioControls.vue @@ -25,19 +25,19 @@
- - - -
-
- - - + {{ + playState ? stopStimLabel : startStimLabel + }} + + + +
@@ -96,7 +96,7 @@ - + @@ -274,7 +274,12 @@ export default { opacity: this.disabled ? 0.5 : 1, }; }, + isStimInWaiting: function () { + return this.stimStatus === STIM_STATUS.WAITING; + }, isStartStopButtonEnabled: function () { + if (this.isStimInWaiting) return false; + if (!this.playState) { // if starting stim make sure initial magnetometer calibration has been completed and // no additional calibrations are running, stim checks have completed, there are no short or @@ -396,6 +401,8 @@ export default { async handlePlayStop(e) { e.preventDefault(); if (this.isStartStopButtonEnabled) { + this.$store.commit("stimulation/setStimStatus", STIM_STATUS.WAITING); + if (this.playState) { this.$store.dispatch(`stimulation/stopStimulation`); clearTimeout(this.stim24hrTimer); // clear 24 hour timer for next stimulation @@ -490,7 +497,7 @@ body { grid-template-columns: repeat(25%, 4); align-items: center; justify-items: center; - padding: 5px; + padding: 2px; } .span__stimulation-controls-play-stop-button--disabled { @@ -571,11 +578,11 @@ body { width: 20px; } -.span__spinner { +.span__config-check-spinner { position: absolute; font-size: 34px; - right: 17.5px; - bottom: 15px; + left: 5px; + top: 0px; width: 45px; color: #fff; padding-left: 5px; @@ -640,6 +647,17 @@ body { fill: none; } +.span__start-stop-spinner { + position: absolute; + font-size: 20px; + right: 2px; + bottom: 3px; + color: #fff; + padding-left: 5px; + background-color: #000; + opacity: 0.75; +} + #user-input-prompt-message, #open-circuit-warning, #stim-24hr-warning, diff --git a/ui/components/stimulation/StimulationStudioCreateAndEdit.vue b/ui/components/stimulation/StimulationStudioCreateAndEdit.vue index 6be6b77..9e20ad9 100644 --- a/ui/components/stimulation/StimulationStudioCreateAndEdit.vue +++ b/ui/components/stimulation/StimulationStudioCreateAndEdit.vue @@ -80,10 +80,13 @@ export default { }; }, computed: { - ...mapState("stimulation", ["protocolList", "editMode"]), + ...mapState("stimulation", ["protocolList", "editMode", "selectedWells"]), editModeStatus: function () { return this.editMode.status; }, + noWellsSelected: function () { + return this.selectedWells.length === 0; + }, }, watch: { protocolList: function (newList, oldList) { @@ -113,7 +116,11 @@ export default { this.$emit("handle-selection-change", selectedProtocol); }, disableSelectionBtn(idx) { - return this.disableEdits || (this.selectedProtocolIdx === 0 && idx === 0); + return ( + this.disableEdits || + (this.selectedProtocolIdx === 0 && idx === 0) || + (this.noWellsSelected && idx === 0) + ); }, handleClick(idx) { if (this.disableSelectionBtn(idx)) { diff --git a/ui/store/modules/stimulation/enums.js b/ui/store/modules/stimulation/enums.js index efcff5b..36b9f8e 100644 --- a/ui/store/modules/stimulation/enums.js +++ b/ui/store/modules/stimulation/enums.js @@ -9,6 +9,8 @@ export const STIM_STATUS = { READY: "Ready", // stim play states STIM_ACTIVE: "Stimulating...", + // used to show spinner in stim controls over play/stop button + WAITING: "", // error SHORT_CIRCUIT_ERROR: "Short Circuit Error",