Browse Source

ceshi

master
maochaoying 2 years ago
parent
commit
34331335fb
  1. 8
      .env
  2. 32
      src/components/SealTest.vue
  3. 36
      src/mock/command.js
  4. 56
      src/pages/Home.vue
  5. 2
      src/store/modules/websocket.js

8
.env

@ -1,5 +1,5 @@
# VITE_BASE_WS1_URL=ws://192.168.8.10:19001/
# VITE_BASE_WS2_URL=ws://192.168.8.10:19002/
VITE_BASE_WS1_URL=ws://192.168.8.10:19001/
VITE_BASE_WS2_URL=ws://192.168.8.10:19002/
VITE_BASE_WS1_URL=ws://127.0.0.1:19001/
VITE_BASE_WS2_URL=ws://127.0.0.1:19002/
# VITE_BASE_WS1_URL=ws://127.0.0.1:19001/
# VITE_BASE_WS2_URL=ws://127.0.0.1:19002/

32
src/components/SealTest.vue

@ -94,7 +94,11 @@ import TestIcon from '@/assets/img/seal/test.png'
import StartTest from '@/assets/img/seal/starttest.png' import StartTest from '@/assets/img/seal/starttest.png'
import StopTest from '@/assets/img/seal/stoptest.png' import StopTest from '@/assets/img/seal/stoptest.png'
import StopAir from '@/assets/img/seal/stop.png' import StopAir from '@/assets/img/seal/stop.png'
import { someAirSwitchJSON } from '@/mock/command'
import {
someAirSwitchJSON,
airCompressor_setStateJSON,
airCompressor_channelCtrlJSON,
} from '@/mock/command'
import { useSealStore, useTestStore, useWebSocketStore } from '@/store' import { useSealStore, useTestStore, useWebSocketStore } from '@/store'
const sealStore = useSealStore() const sealStore = useSealStore()
@ -220,6 +224,8 @@ const stopTimer = () => {
n_min.value = 0 n_min.value = 0
n_hour.value = 0 n_hour.value = 0
sealStore.updateIsStartTest(false) sealStore.updateIsStartTest(false)
//
websocketStore.sendCommandMsg(airCompressor_channelCtrlJSON([1]))
} }
const timerFunc = () => { const timerFunc = () => {
@ -231,17 +237,15 @@ const timerFunc = () => {
const changeAirStatus = flag => { const changeAirStatus = flag => {
if (flag == 1) { if (flag == 1) {
if (!testStore.airCompressor) {
websocketStore.sendCommandMsg(someAirSwitchJSON(0, 1))
websocketStore.sendCommandMsg(someAirSwitchJSON(1, 1))
testStore.updateAirCompressor(true)
}
} else {
if (testStore.airCompressor) { if (testStore.airCompressor) {
websocketStore.sendCommandMsg(someAirSwitchJSON(0, 0))
websocketStore.sendCommandMsg(someAirSwitchJSON(1, 0))
websocketStore.sendCommandMsg(airCompressor_setStateJSON([0]))
testStore.updateAirCompressor(false) testStore.updateAirCompressor(false)
} }
} else {
if (!testStore.airCompressor) {
websocketStore.sendCommandMsg(airCompressor_setStateJSON([1]))
testStore.updateAirCompressor(true)
}
} }
} }
@ -251,11 +255,11 @@ const handleStartTest = flag => {
// getStatecurrentAirPressure // getStatecurrentAirPressure
// //
timerFunc() timerFunc()
//
//
// websocketStore.sendCommandMsg(someAirSwitchJSON(0, 0))
// websocketStore.sendCommandMsg(someAirSwitchJSON(1, 0))
// testStore.updateAirCompressor(false)
//
websocketStore.sendCommandMsg(airCompressor_channelCtrlJSON([0]))
//
websocketStore.sendCommandMsg(airCompressor_setStateJSON([0]))
testStore.updateAirCompressor(false)
sealStore.updateOldAirPressure(sealStore.currentAirPressure) sealStore.updateOldAirPressure(sealStore.currentAirPressure)
sealStore.updateIsStartTest(true) sealStore.updateIsStartTest(true)
} }

36
src/mock/command.js

@ -318,3 +318,39 @@ export const getDetailInfoById = id => {
disinfectionLogName: id, disinfectionLogName: id,
} }
} }
// 新空压机接口
export const airCompressor_setStateJSON = params => {
return {
command: 'DeviceIOControlService.airCompressor_setState',
messageId: 'airCompressor_setState',
params,
}
}
// 空压机通道
export const airCompressor_channelCtrlJSON = params => {
return {
command: 'DeviceIOControlService.airCompressor_channelCtrl',
messageId: 'airCompressor_channelCtrl',
params,
}
}
// 空气阀入口
export const AirInletProportionalValve_setStateJSON = params => {
return {
command: 'DeviceIOControlService.AirInletProportionalValve_setState',
messageId: 'AirInletProportionalValve_setState',
params,
}
}
// 空气阀出口
export const AirOutletProportionalValve_setStateJSON = params => {
return {
command: 'DeviceIOControlService.AirOutletProportionalValve_setState',
messageId: 'AirOutletProportionalValve_setState',
params,
}
}

56
src/pages/Home.vue
File diff suppressed because it is too large
View File

2
src/store/modules/websocket.js

@ -90,6 +90,8 @@ export const useWebSocketStore = defineStore({
sprinklerPumpRPM, sprinklerPumpRPM,
sprinklerPumpGPM, sprinklerPumpGPM,
pressure, pressure,
AirInletProportionalValve,
AirOutletProportionalValve,
} = sensor_data } = sensor_data
const { nowlog, targetlog } = disinfectionState || {} const { nowlog, targetlog } = disinfectionState || {}
deviceStore.updateTargetLog(targetlog) deviceStore.updateTargetLog(targetlog)

Loading…
Cancel
Save