Browse Source

测试界面喷液泵转速数值修改时不执行实际转速调整,由正转反转打开关闭执行

master
sige 1 year ago
parent
commit
7cd24a8444
  1. 154
      src/components/Test.vue
  2. 15
      src/store/modules/test.js

154
src/components/Test.vue

@ -5,29 +5,29 @@
<p class="title">喷液泵</p>
<div class="num">
<my-input type="number" class="add_liquid_input"
v-model:value="sprayLiquidPumpGPMValue"
@done="actionSprayLiquidPumpGPMValueChange"
v-model:value="testStore.sprayLiquidPumpGPM"
></my-input>
<p>g/min</p>
</div>
<div class="btn_wrap" style="margin-left:10px;">
<div
:class="sprayLiquidPumpGPMValue >= 0 ? 'open style-btn mg' : 'close style-btn mg'"
@click="actionSprayLiquidPumpGPMValueChange('forward')"
:class="'forward' === testStore.sprayLiquidPumpRotation ? 'open style-btn mg' : 'close style-btn mg'"
@click="actionSprayLiquidPumpRotationChange('forward')"
>正转</div>
<div
:class="sprayLiquidPumpGPMValue < 0 ? 'open style-btn' : 'close style-btn'"
@click="actionSprayLiquidPumpGPMValueChange('backward')"
:class="'backward' === testStore.sprayLiquidPumpRotation ? 'open style-btn' : 'close style-btn'"
@click="actionSprayLiquidPumpRotationChange('backward')"
>反转</div>
</div>
<div class="btn_wrap" style="margin-left:10px;">
<div
:class="sprayLiquidPumpGPMValue != 0 ? 'open style-btn mg' : 'close style-btn mg'"
@click="actionSprayLiquidPumpGPMValueChange('start')"
:class="testStore.sprayLiquidPumpEnable ? 'open style-btn mg' : 'close style-btn mg'"
@click="actionSprayLiquidPumpEnableChange(true)"
>打开</div>
<div
:class="sprayLiquidPumpGPMValue == 0 ? 'open style-btn' : 'close style-btn'"
@click="actionSprayLiquidPumpGPMValueChange('stop')"
:class="!testStore.sprayLiquidPumpEnable ? 'open style-btn' : 'close style-btn'"
@click="actionSprayLiquidPumpEnableChange(false)"
>关闭</div>
</div>
</div>
@ -49,20 +49,17 @@
<div class="common_set switch_wrap">
<p class="title"> 风机</p>
<div class="num">
<my-input type="number" class="add_liquid_input"
v-model:value="miniPwmBlowerCtrlValue"
@done="actionMiniPwmBlowerCtrl"
></my-input>
<my-input type="number" class="add_liquid_input" v-model:value="testStore.miniPwmBlowerCtrl" />
<p>%</p>
</div>
<div class="btn_wrap">
<div class="style-btn"
:class="50 < miniPwmBlowerCtrl ? 'open mg' : 'close style-btn mg'"
@click="actionMiniPwmBlowerCtrl(50)"
:class="testStore.miniPwmBlowerCtrlEnable ? 'open mg' : 'close style-btn mg'"
@click="actionMiniPwmBlowerCtrlEnableChange(true)"
>打开</div>
<div
:class="0 == miniPwmBlowerCtrl ? 'open style-btn ' : 'close style-btn'"
@click="actionMiniPwmBlowerCtrl(0)"
:class="!testStore.miniPwmBlowerCtrlEnable ? 'open style-btn ' : 'close style-btn'"
@click="actionMiniPwmBlowerCtrlEnableChange(false)"
>关闭</div>
</div>
</div>
@ -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) {

15
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,
// 加热器

Loading…
Cancel
Save