|
|
@ -20,22 +20,16 @@ |
|
|
|
</div> |
|
|
|
<img |
|
|
|
class="air_img" |
|
|
|
:src="DisStart" |
|
|
|
alt="" |
|
|
|
v-if="sealStore.isStartTest" |
|
|
|
/> |
|
|
|
<img |
|
|
|
class="air_img" |
|
|
|
v-if="!sealStore.isStartTest && !testStore.airCompressor" |
|
|
|
@click="changeAirStatus(2)" |
|
|
|
:src="StartAir" |
|
|
|
v-if="!sealStore.isStartTest" |
|
|
|
@click="newStartTest(1)" |
|
|
|
:src="StartTest" |
|
|
|
alt="" |
|
|
|
/> |
|
|
|
<img |
|
|
|
class="air_img" |
|
|
|
@click="changeAirStatus(1)" |
|
|
|
v-if="!sealStore.isStartTest && testStore.airCompressor" |
|
|
|
:src="StopAir" |
|
|
|
@click="newStartTest(2)" |
|
|
|
v-if="sealStore.isStartTest" |
|
|
|
:src="StopTest" |
|
|
|
alt="" |
|
|
|
/> |
|
|
|
</div> |
|
|
@ -65,20 +59,6 @@ |
|
|
|
}} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<img |
|
|
|
:src="StartTest" |
|
|
|
v-if="!sealStore.isStartTest" |
|
|
|
class="test_png" |
|
|
|
@click="handleStartTest('1')" |
|
|
|
alt="" |
|
|
|
/> |
|
|
|
<img |
|
|
|
@click="handleStartTest('2')" |
|
|
|
:src="StopTest" |
|
|
|
v-else |
|
|
|
class="test_png" |
|
|
|
alt="" |
|
|
|
/> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -88,18 +68,21 @@ |
|
|
|
import * as echarts from 'echarts' |
|
|
|
import { ref, onMounted, onBeforeUnmount, watch } from 'vue' |
|
|
|
import SealPng from '@/assets/img/seal/seal.png' |
|
|
|
import StartAir from '@/assets/img/seal/start.png' |
|
|
|
import DisStart from '@/assets/img/seal/dis_start.png' |
|
|
|
import TestIcon from '@/assets/img/seal/test.png' |
|
|
|
import StartTest from '@/assets/img/seal/starttest.png' |
|
|
|
import StopTest from '@/assets/img/seal/stoptest.png' |
|
|
|
import StopAir from '@/assets/img/seal/stop.png' |
|
|
|
import { |
|
|
|
someAirSwitchJSON, |
|
|
|
airCompressor_setStateJSON, |
|
|
|
airCompressor_channelCtrlJSON, |
|
|
|
AirInletProportionalValve_setStateJSON, |
|
|
|
AirOutletProportionalValve_setStateJSON, |
|
|
|
airCompressorGetPressureDirectJSON, |
|
|
|
airCompressorSetValve1JSON, |
|
|
|
airCompressorSetValve2JSON, |
|
|
|
airCompressorChannelSelectJSON, |
|
|
|
AirOutletProportionalValve_getStateJSON, |
|
|
|
airInletProportionalValve_getStateJSON, |
|
|
|
} from '@/mock/command' |
|
|
|
import { useSealStore, useTestStore, useWebSocketStore } from '@/store' |
|
|
|
|
|
|
@ -226,8 +209,6 @@ const stopTimer = () => { |
|
|
|
n_min.value = 0 |
|
|
|
n_hour.value = 0 |
|
|
|
sealStore.updateIsStartTest(false) |
|
|
|
// 结束测试时打开空压机通道 |
|
|
|
websocketStore.sendCommandMsg(airCompressor_channelCtrlJSON([1])) |
|
|
|
} |
|
|
|
|
|
|
|
const timerFunc = () => { |
|
|
@ -237,48 +218,64 @@ const timerFunc = () => { |
|
|
|
}, 1000) |
|
|
|
} |
|
|
|
|
|
|
|
const changeAirStatus = flag => { |
|
|
|
if (flag == 1) { |
|
|
|
if (testStore.airCompressor) { |
|
|
|
// 空压机通道打开 空压机关闭 比例阀关闭 |
|
|
|
websocketStore.sendCommandMsg(airCompressor_channelCtrlJSON([1])) |
|
|
|
websocketStore.sendCommandMsg(airCompressor_setStateJSON([0])) |
|
|
|
websocketStore.sendCommandMsg(AirInletProportionalValve_setStateJSON([0])) |
|
|
|
websocketStore.sendCommandMsg( |
|
|
|
AirOutletProportionalValve_setStateJSON([0]), |
|
|
|
) |
|
|
|
testStore.updateAirCompressor(false) |
|
|
|
} |
|
|
|
} else { |
|
|
|
if (!testStore.airCompressor) { |
|
|
|
// 空压机通道关闭 空压机打开 比例阀关闭 |
|
|
|
websocketStore.sendCommandMsg(AirInletProportionalValve_setStateJSON([0])) |
|
|
|
websocketStore.sendCommandMsg( |
|
|
|
AirOutletProportionalValve_setStateJSON([0]), |
|
|
|
) |
|
|
|
websocketStore.sendCommandMsg(airCompressor_channelCtrlJSON([0])) |
|
|
|
websocketStore.sendCommandMsg(airCompressor_setStateJSON([1])) |
|
|
|
testStore.updateAirCompressor(true) |
|
|
|
} |
|
|
|
} |
|
|
|
const wait = async ms => { |
|
|
|
await new Promise(resolve => setTimeout(resolve, ms)) |
|
|
|
} |
|
|
|
|
|
|
|
const handleStartTest = flag => { |
|
|
|
if (flag == '1') { |
|
|
|
// 改变测试前oldAirPressure为测试前气压值 |
|
|
|
// 也就是将getState中获取的当前值currentAirPressure赋予 |
|
|
|
// 开始测试需要记录时间 |
|
|
|
const newStartTest = flag => { |
|
|
|
if (flag == 1) { |
|
|
|
// 开始测试 |
|
|
|
// 启动计时器 |
|
|
|
timerFunc() |
|
|
|
// 空压机通道打开 空压机关闭 比例阀关闭 记录当前气压 |
|
|
|
websocketStore.sendCommandMsg(airCompressor_channelCtrlJSON([1])) |
|
|
|
sealStore.updateIsStartTest(true) |
|
|
|
// 空压机选通阀切换到通道2(空气) |
|
|
|
websocketStore.sendCommandMsg(airCompressorChannelSelectJSON([2])) |
|
|
|
// 空压机电子阀1打开 空压机电子阀2打开 |
|
|
|
websocketStore.sendCommandMsg(airCompressorSetValve1JSON([1])) |
|
|
|
websocketStore.sendCommandMsg(airCompressorSetValve2JSON([1])) |
|
|
|
// 风机入口比例阀闭合 风机出口比例阀闭合 |
|
|
|
websocketStore.sendCommandMsg(AirInletProportionalValve_setStateJSON([0])) |
|
|
|
websocketStore.sendCommandMsg(AirOutletProportionalValve_setStateJSON([0])) |
|
|
|
// 空压机打开 |
|
|
|
websocketStore.sendCommandMsg(airCompressor_setStateJSON([1])) |
|
|
|
// 等待1s |
|
|
|
wait(1000) |
|
|
|
// 空压机关闭 |
|
|
|
websocketStore.sendCommandMsg(airCompressor_setStateJSON([0])) |
|
|
|
testStore.updateAirCompressor(false) |
|
|
|
sealStore.updateOldAirPressure(sealStore.currentAirPressure) |
|
|
|
sealStore.updateIsStartTest(true) |
|
|
|
// 空压机电子阀1关闭 空压机电子阀2关闭 |
|
|
|
websocketStore.sendCommandMsg(airCompressorSetValve1JSON([0])) |
|
|
|
websocketStore.sendCommandMsg(airCompressorSetValve2JSON([0])) |
|
|
|
// 空压机选通阀切换到通道1 (入气口) |
|
|
|
websocketStore.sendCommandMsg(airCompressorChannelSelectJSON([1])) |
|
|
|
// 等待5s |
|
|
|
wait(5000) |
|
|
|
// 记录当前压力数值作为初始压力值 |
|
|
|
websocketStore.sendCommandMsg(airCompressorGetPressureDirectJSON) |
|
|
|
} |
|
|
|
if (flag == '2') { |
|
|
|
if (flag == 2) { |
|
|
|
// 停止测试 |
|
|
|
/** |
|
|
|
* 空压机电子阀1打开 |
|
|
|
* 空压机电子阀2打开 |
|
|
|
* 空压机选通阀切换到通道1 |
|
|
|
* 风机入口比例阀恢复 |
|
|
|
* 风机出口比例阀恢复 |
|
|
|
*/ |
|
|
|
websocketStore.sendCommandMsg(airCompressorSetValve1JSON([1])) |
|
|
|
websocketStore.sendCommandMsg(airCompressorSetValve2JSON([1])) |
|
|
|
websocketStore.sendCommandMsg(airCompressorChannelSelectJSON([1])) |
|
|
|
// 数值为刚开始记录的数值 |
|
|
|
websocketStore.sendCommandMsg( |
|
|
|
AirInletProportionalValve_setStateJSON([ |
|
|
|
sealStore.airInletProportionalInitVal, |
|
|
|
]), |
|
|
|
) |
|
|
|
websocketStore.sendCommandMsg( |
|
|
|
AirOutletProportionalValve_setStateJSON([ |
|
|
|
sealStore.airOutletProportionalInitVal, |
|
|
|
]), |
|
|
|
) |
|
|
|
// 停止计时器 |
|
|
|
stopTimer() |
|
|
|
} |
|
|
|
} |
|
|
@ -291,6 +288,7 @@ onBeforeUnmount(() => { |
|
|
|
clearInterval(timerStart.value) |
|
|
|
}) |
|
|
|
onMounted(() => { |
|
|
|
// 需要记录当前的风机入口出口比例阀数值 |
|
|
|
sealCharts.value = echarts.init(document.getElementById('seal_echarts')) |
|
|
|
sealCharts.value.setOption(sealOptions.value) |
|
|
|
timer.value = setInterval(() => { |
|
|
@ -360,6 +358,8 @@ onMounted(() => { |
|
|
|
], |
|
|
|
}) |
|
|
|
}, 1000) |
|
|
|
websocketStore.sendCommandMsg(airInletProportionalValve_getStateJSON) |
|
|
|
websocketStore.sendCommandMsg(AirOutletProportionalValve_getStateJSON) |
|
|
|
}) |
|
|
|
</script> |
|
|
|
|
|
|
@ -513,7 +513,7 @@ onMounted(() => { |
|
|
|
padding: 20px; |
|
|
|
.emp_box { |
|
|
|
width: 300px; |
|
|
|
height: 162px; |
|
|
|
height: 198px; |
|
|
|
border-radius: 12px; |
|
|
|
background: #fff; |
|
|
|
margin-bottom: 20px; |
|
|
|