|
|
@ -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); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|