diff --git a/.env b/.env
index c4ae906..fe3f0dd 100644
--- a/.env
+++ b/.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/
\ No newline at end of file
+# VITE_BASE_WS1_URL=ws://127.0.0.1:19001/
+# VITE_BASE_WS2_URL=ws://127.0.0.1:19002/
\ No newline at end of file
diff --git a/src/components/SealTest.vue b/src/components/SealTest.vue
index 0f3b25e..6358b90 100644
--- a/src/components/SealTest.vue
+++ b/src/components/SealTest.vue
@@ -32,6 +32,18 @@
:src="StopTest"
alt=""
/>
+
+
@@ -85,11 +97,15 @@ import {
airInletProportionalValve_getStateJSON,
} from '@/mock/command'
import { useSealStore, useTestStore, useWebSocketStore } from '@/store'
+import { storeToRefs } from 'pinia'
const sealStore = useSealStore()
const testStore = useTestStore()
const websocketStore = useWebSocketStore()
+const { airInletProportionalInitVal, airOutletProportionalInitVal } =
+ storeToRefs(sealStore)
+
const sealCharts = ref(null)
const sealOptions = ref({
series: [
@@ -222,7 +238,10 @@ const wait = async ms => {
await new Promise(resolve => setTimeout(resolve, ms))
}
-const newStartTest = flag => {
+const sleepVal1 = ref(1000)
+const sleepVal2 = ref(5000)
+
+const newStartTest = async flag => {
if (flag == 1) {
// 开始测试
// 启动计时器
@@ -239,7 +258,7 @@ const newStartTest = flag => {
// 空压机打开
websocketStore.sendCommandMsg(airCompressor_setStateJSON([1]))
// 等待1s
- wait(1000)
+ await wait(sleepVal1.value)
// 空压机关闭
websocketStore.sendCommandMsg(airCompressor_setStateJSON([0]))
// 空压机电子阀1关闭 空压机电子阀2关闭
@@ -248,7 +267,7 @@ const newStartTest = flag => {
// 空压机选通阀切换到通道1 (入气口)
websocketStore.sendCommandMsg(airCompressorChannelSelectJSON([1]))
// 等待5s
- wait(5000)
+ await wait(sleepVal2.value)
// 记录当前压力数值作为初始压力值
websocketStore.sendCommandMsg(airCompressorGetPressureDirectJSON)
}
@@ -267,12 +286,12 @@ const newStartTest = flag => {
// 数值为刚开始记录的数值
websocketStore.sendCommandMsg(
AirInletProportionalValve_setStateJSON([
- sealStore.airInletProportionalInitVal,
+ airInletProportionalInitVal.value[0],
]),
)
websocketStore.sendCommandMsg(
AirOutletProportionalValve_setStateJSON([
- sealStore.airOutletProportionalInitVal,
+ airOutletProportionalInitVal.value[0],
]),
)
// 停止计时器
diff --git a/src/components/Test.vue b/src/components/Test.vue
index 6fe9e6e..819f425 100644
--- a/src/components/Test.vue
+++ b/src/components/Test.vue
@@ -194,31 +194,44 @@
-