Browse Source

自动项目渲染

master
maochaoying 2 years ago
parent
commit
1f29347b34
  1. 24
      src/components/SealTest.vue
  2. 4
      src/store/modules/seal.js
  3. 2
      src/store/modules/websocket.js

24
src/components/SealTest.vue

@ -73,11 +73,15 @@
</div> </div>
</div> </div>
</div> </div>
<van-overlay :show="testOverlayVisible" z-index="3">
<van-overlay
:show="testOverlayVisible"
class-name="diy_overlay"
z-index="3"
>
<div class="wrapper" @click.stop> <div class="wrapper" @click.stop>
<div class="block"> <div class="block">
<van-loading /> <van-loading />
<p class="shutdown_text">正在充气...</p>
<p class="shutdown_text">密性测试中...</p>
</div> </div>
</div> </div>
</van-overlay> </van-overlay>
@ -264,16 +268,15 @@ const waitAirFinish = async () => {
}) })
} }
const sleepVal1 = ref(3)
const sleepVal2 = ref(60)
const sleepVal1 = ref(1)
const sleepVal2 = ref(20)
const newStartTest = async flag => { const newStartTest = async flag => {
if (flag == 1) { if (flag == 1) {
// //
// //
sealStore.updateShowPressure(false)
testOverlayVisible.value = true testOverlayVisible.value = true
timerFunc()
sealStore.updateIsStartTest(true)
// 2 // 2
websocketStore.sendCommandMsg(airCompressorChannelSelectJSON([2])) websocketStore.sendCommandMsg(airCompressorChannelSelectJSON([2]))
// 1 2 // 1 2
@ -298,6 +301,9 @@ const newStartTest = async flag => {
websocketStore.sendCommandMsg(airCompressorChannelSelectJSON([1])) websocketStore.sendCommandMsg(airCompressorChannelSelectJSON([1]))
// 5s // 5s
await wait(sleepVal2.value * 1000) await wait(sleepVal2.value * 1000)
sealStore.updateShowPressure(true)
timerFunc()
sealStore.updateIsStartTest(true)
testOverlayVisible.value = false testOverlayVisible.value = false
// //
websocketStore.sendCommandMsg(airCompressorGetPressureDirectJSON) websocketStore.sendCommandMsg(airCompressorGetPressureDirectJSON)
@ -311,6 +317,7 @@ const newStartTest = async flag => {
* 风机入口比例阀恢复 * 风机入口比例阀恢复
* 风机出口比例阀恢复 * 风机出口比例阀恢复
*/ */
sealStore.updateAirProportionalValveIsBusy(1) sealStore.updateAirProportionalValveIsBusy(1)
websocketStore.sendCommandMsg(airCompressorSetValve1JSON([1])) websocketStore.sendCommandMsg(airCompressorSetValve1JSON([1]))
websocketStore.sendCommandMsg(airCompressorSetValve2JSON([1])) websocketStore.sendCommandMsg(airCompressorSetValve2JSON([1]))
@ -328,6 +335,7 @@ const newStartTest = async flag => {
) )
// //
stopTimer() stopTimer()
sealStore.updateShowPressure(false)
} }
} }
@ -644,4 +652,8 @@ onMounted(() => {
white-space: nowrap; white-space: nowrap;
} }
} }
.diy_overlay {
background: rgba(0, 0, 0, 0.58);
backdrop-filter: blur(20px);
}
</style> </style>

4
src/store/modules/seal.js

@ -4,6 +4,7 @@ export const useSealStore = defineStore({
// state // state
state: () => { state: () => {
return { return {
showPressure: false,
// 0~800kPa // 0~800kPa
currentAirPressure: 0, currentAirPressure: 0,
isStartTest: false, isStartTest: false,
@ -22,6 +23,9 @@ export const useSealStore = defineStore({
}, },
// actions // actions
actions: { actions: {
updateShowPressure(showPressure) {
this.showPressure = showPressure
},
updateAirProportionalValveIsBusy(AirProportionalValveIsBusy) { updateAirProportionalValveIsBusy(AirProportionalValveIsBusy) {
this.AirProportionalValveIsBusy = AirProportionalValveIsBusy this.AirProportionalValveIsBusy = AirProportionalValveIsBusy
}, },

2
src/store/modules/websocket.js

@ -197,9 +197,11 @@ export const useWebSocketStore = defineStore({
JSON.parse(ev.data) JSON.parse(ev.data)
if (getPressureInterCode == 0) { if (getPressureInterCode == 0) {
// 值初始化 // 值初始化
// if (sealStore.showPressure) {
sealStore.updateCurrentAirPressure( sealStore.updateCurrentAirPressure(
pressureIntervalAck[0].toFixed(1) || 0, pressureIntervalAck[0].toFixed(1) || 0,
) )
// }
} }
break break
case 'AirProportionalValve_isBusy': case 'AirProportionalValve_isBusy':

Loading…
Cancel
Save