Browse Source

update

moveToEndTestVersion
zhaohe 11 months ago
parent
commit
a01b07c070
  1. 2
      app_protocols/transmit_disfection_protocol
  2. 41
      usrc/app/dmapp.cpp

2
app_protocols/transmit_disfection_protocol

@ -1 +1 @@
Subproject commit 6fb781e6b5fe8f4f44c7046b30cbee47512f5bd9
Subproject commit 9135659ab41af623d10c691646501d313f927c14

41
usrc/app/dmapp.cpp

@ -133,29 +133,40 @@ void DisinfectionApp::initialize() {
/***********************************************************************************************************************
* *
***********************************************************************************************************************/
// kAirLeakTestMode_disinfection
// kAirLeakTestMode_inflation
// kAirLeakTestMode_leakTest
if (PORT::isLiquidCtrlBoard() && (PORT::isPipeDM())) {
static ZGPIO airTightnessTestChGpio;
static ZGPIO eValve0;
static ZGPIO eValve1;
static bool state = false;
static air_leak_test_mode_t airLeakTestMode = kAirLeakTestMode_disinfection;
static ZGPIO airTightnessTestChGpio;
static ZGPIO eValve0;
static ZGPIO eValve1;
airTightnessTestChGpio.initAsOutput(PD14, kxs_gpio_nopull, true, false);
eValve0.initAsOutput(PD15, kxs_gpio_nopull, false, true);
eValve1.initAsOutput(PC6, kxs_gpio_nopull, false, true);
REG_LAMADA_FN(kfn_air_leak_detect_test_set_mode, [&](ProcessContext* cxt) {
if (GET_PARAM(0) == 1) {
airTightnessTestChGpio.write(1); // 内管路,气密性测试
eValve0.write(0);
eValve1.write(0); // 电磁阀闭合
state = true;
} else {
REG_LAMADA_FN(kfn_air_leak_test_set_mode, [&](ProcessContext* cxt) {
if (GET_PARAM(0) == kAirLeakTestMode_disinfection) {
airTightnessTestChGpio.write(1); // 内管路
eValve0.write(1); // 电磁阀打开
eValve1.write(1); // 电磁阀打开
} else if (GET_PARAM(0) == kAirLeakTestMode_inflation) {
airTightnessTestChGpio.write(0); // 连接空气
eValve0.write(1);
eValve1.write(1); // 电磁阀打开
state = false;
eValve0.write(1); // 电磁阀打开
eValve1.write(1); // 电磁阀打开
} else if (GET_PARAM(0) == kAirLeakTestMode_leakTest) {
airTightnessTestChGpio.write(1); // 内管路
eValve0.write(0); // 电磁阀闭合
eValve1.write(0); // 电磁阀闭合
}
airLeakTestMode = (air_leak_test_mode_t)GET_PARAM(0);
zcanbus_send_ack(cxt->packet, NULL, 0);
});
REG_LAMADA_FN(kfn_air_tightness_test_get_mode, [&](ProcessContext* cxt) { zcanbus_send_ack(cxt->packet, state); });
REG_LAMADA_FN(kfn_air_leak_test_get_mode, [&](ProcessContext* cxt) {
int32_t mode = airLeakTestMode;
zcanbus_send_ack(cxt->packet, mode);
});
}
}

Loading…
Cancel
Save