Browse Source

开始冲入空气时关闭两个阀门

master
maochaoying 2 years ago
parent
commit
f4838fbcc3
  1. 7
      src/components/SealTest.vue
  2. 36
      src/components/Test.vue
  3. 5
      src/store/modules/test.js
  4. 4
      src/store/modules/websocket.js

7
src/components/SealTest.vue

@ -98,6 +98,8 @@ import {
someAirSwitchJSON,
airCompressor_setStateJSON,
airCompressor_channelCtrlJSON,
AirInletProportionalValve_setStateJSON,
AirOutletProportionalValve_setStateJSON,
} from '@/mock/command'
import { useSealStore, useTestStore, useWebSocketStore } from '@/store'
@ -243,6 +245,11 @@ const changeAirStatus = flag => {
}
} else {
if (!testStore.airCompressor) {
//
websocketStore.sendCommandMsg(AirInletProportionalValve_setStateJSON([0]))
websocketStore.sendCommandMsg(
AirOutletProportionalValve_setStateJSON([0]),
)
websocketStore.sendCommandMsg(airCompressor_setStateJSON([1]))
testStore.updateAirCompressor(true)
}

36
src/components/Test.vue

@ -189,6 +189,31 @@
</div>
</div>
</div>
<div class="common_set switch_wrap">
<p class="title">空压机通道</p>
<div class="btn_wrap">
<div
:class="
testStore.airCompressorChannel
? 'open style-btn mg'
: 'close style-btn mg'
"
@click="changeChannel(1)"
>
打开
</div>
<div
:class="
!testStore.airCompressorChannel
? 'open style-btn'
: 'close style-btn'
"
@click="changeChannel(2)"
>
关闭
</div>
</div>
</div>
<div class="common_set update_wrap">
<p class="title">水浸1</p>
<p class="num">{{ testStore.waterImmersionSensor1 ? '有水' : '没水' }}</p>
@ -273,6 +298,7 @@ import {
import {
someAirSwitchJSON,
liquidpumpctrlJSON,
airCompressor_channelCtrlJSON,
getStateJSON,
addLiquidCtrlJSON,
test_replenishingFluidsPumpCtrJSON,
@ -513,6 +539,16 @@ const changeDraughtStatus = flag => {
}
}
}
const changeChannel = flag => {
if (flag == 1) {
websocketStore.sendCommandMsg(airCompressor_channelCtrlJSON([1]))
testStore.updateAirCompressorChannel(true)
} else {
websocketStore.sendCommandMsg(airCompressor_channelCtrlJSON([0]))
testStore.updateAirCompressorChannel(false)
}
}
</script>
<style lang="scss" scoped>

5
src/store/modules/test.js

@ -10,6 +10,8 @@ export const useTestStore = defineStore({
sprayPeristalticPump: false,
// 空压机开关
airCompressor: false,
// 空压机通道开关
airCompressorChannel: false,
// 风机开关
draughtFan: false,
// 加热
@ -25,6 +27,9 @@ export const useTestStore = defineStore({
},
// actions
actions: {
updateAirCompressorChannel(airCompressorChannel) {
this.airCompressorChannel = airCompressorChannel
},
updateWaterImmersionSensor1(waterImmersionSensor1) {
this.waterImmersionSensor1 = waterImmersionSensor1
},

4
src/store/modules/websocket.js

@ -93,6 +93,10 @@ export const useWebSocketStore = defineStore({
AirInletProportionalValve,
AirOutletProportionalValve,
} = sensor_data
const { channelState } = airCompressor || {}
testStore.updateAirCompressorChannel(
channelState == 0 ? false : true,
)
const { nowlog, targetlog } = disinfectionState || {}
deviceStore.updateTargetLog(targetlog)
// 必须开始的时候才改变log 否则不懂

Loading…
Cancel
Save