diff --git a/src/components/Test.vue b/src/components/Test.vue
index 3ec70d7..000a6aa 100644
--- a/src/components/Test.vue
+++ b/src/components/Test.vue
@@ -5,29 +5,29 @@
喷液泵
@@ -49,20 +49,17 @@
@@ -229,32 +226,39 @@ function actionSetExtChannelActiveName( name ) {
}
// 风机控制
-function actionMiniPwmBlowerCtrl(power=null) {
- if ( null === power ) {
- power = miniPwmBlowerCtrlValue.value;
+function actionMiniPwmBlowerCtrlEnableChange( enable ) {
+ testStore.miniPwmBlowerCtrlEnable = enable;
+ if ( !enable ) {
+ websocketStore.call('DBDBTestPage__miniPwmBlowerCtrl',{power100:0});
+ return ;
}
- miniPwmBlowerCtrlValue.value = power;
- testStore.miniPwmBlowerCtrl = power;
+ let power = testStore.miniPwmBlowerCtrl;
websocketStore.call('DBDBTestPage__miniPwmBlowerCtrl',{power100:power});
}
-// 喷液泵GPM值变化
-function actionSprayLiquidPumpGPMValueChange( action=null ) {
- let value = sprayLiquidPumpGPMValue.value;
- if ( null === action ) {
- // nothing to do here
- } if ( 'start' === action ) {
- value = 20;
- } else if ( 'stop' === action ) {
- value = 0;
- } else if ( 'forward' === action ) {
- value = value > 0 ? value : value * -1;
- } else if ( 'backward' === action ) {
- value = value < 0 ? value : value * -1;
+// 喷液泵旋转方向变化
+function actionSprayLiquidPumpRotationChange( rotation ) {
+ testStore.sprayLiquidPumpRotation = rotation;
+ testStore.sprayLiquidPumpEnable = true;
+ let value = testStore.sprayLiquidPumpGPM;
+ if ( 'backward' === rotation ) {
+ value = value * -1;
}
+ websocketStore.call('DBDBTestPage__sprayLiquidPump_run',{gpm:value});
+}
- sprayLiquidPumpGPMValue.value = value;
- testStore.sprayLiquidPumpGPM = sprayLiquidPumpGPMValue.value;
+// 喷液泵启用变化
+function actionSprayLiquidPumpEnableChange( enable ) {
+ testStore.sprayLiquidPumpEnable = enable;
+ if ( !enable ) {
+ websocketStore.call('DBDBTestPage__sprayLiquidPump_run',{gpm:0});
+ return ;
+ }
+
+ let value = testStore.sprayLiquidPumpGPM;
+ if ( 'backward' === testStore.sprayLiquidPumpRotation ) {
+ value = value * -1;
+ }
websocketStore.call('DBDBTestPage__sprayLiquidPump_run',{gpm:value});
}
@@ -337,80 +341,6 @@ const handleInput = (value, index) => {
}
}
-const setAddLiquidConfig = flag => {
- if (flag == 1) {
- websocketStore.sendCommandMsg(
- // 正传
- test_replenishingFluidsPumpCtrJSON(1, 300),
- )
- showSuccessToast('设置成功')
- return
- } else if (flag == 2) {
- websocketStore.sendCommandMsg(
- sprayLiquidPump_open_for_testJSON(1, addLiquidVal2.value),
- )
- showSuccessToast('设置成功')
- return
- } else if (flag == 3) {
- // 关闭
- websocketStore.sendCommandMsg(test_replenishingFluidsPumpCtrJSON(0, 0))
- showSuccessToast('关闭加液蠕动泵成功')
- return
- } else if (flag == 5) {
- // 反转
- websocketStore.sendCommandMsg(test_replenishingFluidsPumpCtrJSON(-1, 300))
- showSuccessToast('设置成功')
- } else if (flag == 6) {
- websocketStore.sendCommandMsg(
- sprayLiquidPump_open_for_testJSON(-1, addLiquidVal2.value),
- )
- showSuccessToast('设置成功')
- } else {
- websocketStore.sendCommandMsg(
- sprayLiquidPump_open_for_testJSON(0, addLiquidVal2.value),
- )
- showSuccessToast('关闭注射蠕动泵成功')
- return
- }
-}
-
-const handleUpdate = () => {
- websocketStore.sendCommandMsg(getStateJSON)
-}
-
-const changeFeedingStatus = flag => {
- if (flag == 1) {
- if (!testStore.feedingPeristalticPumpStatus) {
- // 发送打开指令
- websocketStore.sendCommandMsg(
- liquidpumpctrlJSON(1, settingStore.addLiquidConfigVal),
- )
- testStore.updateFeedingPeristalticPumpStatus(true)
- }
- } else {
- if (testStore.feedingPeristalticPumpStatus) {
- websocketStore.sendCommandMsg(liquidpumpctrlJSON(1, 0))
- testStore.updateFeedingPeristalticPumpStatus(false)
- }
- }
-}
-
-const changeSprayStatus = flag => {
- if (flag == 1) {
- if (!testStore.sprayPeristalticPump) {
- websocketStore.sendCommandMsg(
- liquidpumpctrlJSON(2, settingStore.sprayLiquidConfigVal),
- )
- testStore.updateSprayPeristalticPump(true)
- }
- } else {
- if (testStore.sprayPeristalticPump) {
- websocketStore.sendCommandMsg(liquidpumpctrlJSON(2, 0))
- testStore.updateSprayPeristalticPump(false)
- }
- }
-}
-
const changeHeatingStatus = flag => {
if (flag == 1) {
if (!testStore.heatingStrip) {
diff --git a/src/store/modules/test.js b/src/store/modules/test.js
index 82f0859..1fe208d 100644
--- a/src/store/modules/test.js
+++ b/src/store/modules/test.js
@@ -24,13 +24,20 @@ export const useTestStore = defineStore({
waterImmersionSensor1: false,
waterImmersionSensor2: false,
+ // 喷液泵
+ sprayLiquidPumpGPM : 0,
+ // 喷液泵方向
+ sprayLiquidPumpRotation : 'forward',
+ // 喷液泵使能
+ sprayLiquidPumpEnable : false,
- // -外部通道控制
- extChannelActiveName : '',
// 风机控制
miniPwmBlowerCtrl : 0,
- // 喷液泵
- sprayLiquidPumpGPM : 0,
+ // 风机使能
+ miniPwmBlowerCtrlEnable : false,
+
+ // -外部通道控制
+ extChannelActiveName : '',
// 气密性空压机
airCompressorPowerCtrl : 0,
// 加热器