|
|
@ -6,7 +6,8 @@ using namespace iflytop; |
|
|
|
using namespace app_transmit_disinfection; |
|
|
|
using namespace transmit_disfection_protocol; |
|
|
|
|
|
|
|
#define CAN_MASTER TransmitDisinfectionCanMaster::ins()
|
|
|
|
#define CAN_MASTER TransmitDisinfectionCanMaster::ins()
|
|
|
|
#define CAN_MASTER_COM CAN_MASTER->getCanProtocolCom()
|
|
|
|
|
|
|
|
static void readBoardInfo(int deviceId) { |
|
|
|
ack_read_board_info_data_t ack = CAN_MASTER->readboardinfo(deviceId); |
|
|
@ -71,6 +72,13 @@ void TabBuilder::buildBoardBasicCtrl(const char *tabname, int boardid) { // |
|
|
|
box->newSubButton("使能上报", [this, boardid](int argn, const char **args) { CAN_MASTER->enableReport(boardid, 1); }); |
|
|
|
box->newSubButton("失能上报", [this, boardid](int argn, const char **args) { CAN_MASTER->enableReport(boardid, 0); }); |
|
|
|
box->newSubButtonEnd(); |
|
|
|
box->newSubButton("使能周期日志", [this, boardid](int argn, const char **args) { //
|
|
|
|
CAN_MASTER_COM->callcmd1(boardid, kfn_enable_period_log, 1); |
|
|
|
}); |
|
|
|
box->newSubButton("失能周期日志", [this, boardid](int argn, const char **args) { //
|
|
|
|
CAN_MASTER_COM->callcmd1(boardid, kfn_enable_period_log, 0); |
|
|
|
}); |
|
|
|
box->newSubButtonEnd(); |
|
|
|
box->newSubButton("复位板卡", [this, boardid](int argn, const char **args) { CAN_MASTER->resetBoard(boardid); }); |
|
|
|
|
|
|
|
} else { |
|
|
@ -214,52 +222,99 @@ void TabBuilder::buildWaterSensorTab(const char *tabname, int boardid) { |
|
|
|
void TabBuilder::buildBlowerTab(const char *tabname, int boardid) { |
|
|
|
ZQVTabPage *tab = getTab(tabname); |
|
|
|
ZQFunctionListBox *box = new ZQFunctionListBox(tab, "风机", 4); |
|
|
|
box->newSubButton("风机打开", [this, boardid](int argn, const char **args) { CAN_MASTER->blowerCtrl(boardid, 1); }); |
|
|
|
box->newSubButton("风机关闭", [this, boardid](int argn, const char **args) { CAN_MASTER->blowerCtrl(boardid, 0); }); |
|
|
|
box->newSubButtonEnd(); |
|
|
|
box->newSubButton("风机安全阀打开", [this, boardid](int argn, const char **args) { CAN_MASTER->blowerCtrlSafeValve(boardid, 1); }); |
|
|
|
box->newSubButton("风机安全阀关闭", [this, boardid](int argn, const char **args) { CAN_MASTER->blowerCtrlSafeValve(boardid, 0); }); |
|
|
|
box->newSubButtonEnd(); |
|
|
|
box->newSubButton("风机读取电流", [this, boardid](int argn, const char **args) { |
|
|
|
int val = CAN_MASTER->blowerReadEI(boardid); |
|
|
|
ISHOW("val:%d", val); |
|
|
|
|
|
|
|
box->newFunc("风机打开(0->100)", {"val"}, [this, boardid](int argn, const char **args) { //
|
|
|
|
// CAN_MASTER->extChSelectorSetCh(boardid, atoi(args[0]));
|
|
|
|
CAN_MASTER->blowerCtrl(boardid, atoi(args[0])); |
|
|
|
// CAN_MASTER->blowerCtrl(boardid, 1);
|
|
|
|
}); |
|
|
|
// box->newSubButton("风机读取电流ADC", [this, boardid](int argn, const char **args) {
|
|
|
|
// int val = CAN_MASTER->blowerReadEIAdcRaw(boardid);
|
|
|
|
// ISHOW("val:%d", val);
|
|
|
|
// });
|
|
|
|
|
|
|
|
|
|
|
|
// box->newSubButton("风机打开", [this, boardid](int argn, const char **args) { CAN_MASTER->blowerCtrl(boardid, 1); });
|
|
|
|
box->newSubButton("风机关闭", [this, boardid](int argn, const char **args) { CAN_MASTER->blowerCtrl(boardid, 0); }); |
|
|
|
box->newSubButtonEnd(); |
|
|
|
// box->newSubButton("风机是否错误", [this, boardid](int argn, const char **args) {
|
|
|
|
// bool val = CAN_MASTER->blowerReadElectricIsError(boardid);
|
|
|
|
// ISHOW("val:%d", val);
|
|
|
|
// });
|
|
|
|
box->newSubButton("风机是否打开", [this, boardid](int argn, const char **args) { |
|
|
|
bool val = CAN_MASTER->blowserIsOpen(boardid); |
|
|
|
ISHOW("val:%d", val); |
|
|
|
box->newSubButton("风机读取状态与类型", [this, boardid](int argn, const char **args) { |
|
|
|
// kNotSet,
|
|
|
|
// kIOBlower,
|
|
|
|
// kHighPowerUartBlower,
|
|
|
|
// kMiniPwmBlower,
|
|
|
|
int32_t type; |
|
|
|
int16_t state[10] = {0}; |
|
|
|
int32_t stateNum = 0; |
|
|
|
type = CAN_MASTER_COM->callcmd0(boardid, kfn_blower_read_type, DEFUALT_OVERTIME)->getContent(0); |
|
|
|
auto receipt = CAN_MASTER_COM->callcmd0(boardid, kfn_blower_read_state, DEFUALT_OVERTIME); |
|
|
|
for (int i = 0; i < receipt->getContent16Num(); i++) { |
|
|
|
state[i] = receipt->getContent16(i); |
|
|
|
} |
|
|
|
|
|
|
|
switch (type) { |
|
|
|
case 1: |
|
|
|
ISHOW("type:IOBlower"); |
|
|
|
ISHOW("state[0] powerVal : %d", state[0]); |
|
|
|
ISHOW("state[1] blowserI : %d", state[1]); |
|
|
|
|
|
|
|
break; |
|
|
|
case 2: |
|
|
|
ISHOW("type:HighPowerUartBlower"); |
|
|
|
ISHOW("state[0] powerVal : %d", state[0]); |
|
|
|
ISHOW("state[1] coolingFanI : %d", state[1]); |
|
|
|
ISHOW("state[2] ecode : %d", state[2]); |
|
|
|
break; |
|
|
|
case 3: |
|
|
|
ISHOW("type:MiniPwmBlower"); |
|
|
|
ISHOW("state[0] powerVal : %d", state[0]); |
|
|
|
ISHOW("state[1] maxCnt : %d", (uint16_t)state[1]); |
|
|
|
break; |
|
|
|
default: |
|
|
|
ISHOW("type:Unknown(%d)", type); |
|
|
|
for (size_t i = 0; i < receipt->getContent16Num(); i++) { |
|
|
|
ISHOW("state[%d] : %d", i, state[i]); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
void TabBuilder::buildAirCompressorTab(const char *tabname, int boardid) { |
|
|
|
ZQVTabPage *tab = getTab(tabname); |
|
|
|
ZQFunctionListBox *box = new ZQFunctionListBox(tab, "空压机", 4); |
|
|
|
box->newSubButton("空压机打开", [this, boardid](int argn, const char **args) { CAN_MASTER->airCompressorCtrl(boardid, 1); }); |
|
|
|
// box->newSubButton("空压机打开", [this, boardid](int argn, const char **args) { CAN_MASTER->airCompressorCtrl(boardid, 1); });
|
|
|
|
|
|
|
|
box->newFunc("空压机打开(0->100)", {"val"}, [this, boardid](int argn, const char **args) { //
|
|
|
|
// CAN_MASTER->extChSelectorSetCh(boardid, atoi(args[0]));
|
|
|
|
CAN_MASTER->airCompressorCtrl(boardid, atoi(args[0])); |
|
|
|
// CAN_MASTER->blowerCtrl(boardid, 1);
|
|
|
|
}); |
|
|
|
|
|
|
|
box->newSubButton("空压机关闭", [this, boardid](int argn, const char **args) { CAN_MASTER->airCompressorCtrl(boardid, 0); }); |
|
|
|
box->newSubButtonEnd(); |
|
|
|
// box->newFunc("空压机安全阀控制", {"valve_state"}, [this, boardid](int argn, const char **args) { CAN_MASTER->airCompressorCtrlSafeValve(boardid, atoi(args[0])); });
|
|
|
|
box->newSubButton("空压机安全阀打开", [this, boardid](int argn, const char **args) { CAN_MASTER->airCompressorCtrlSafeValve(boardid, 1); }); |
|
|
|
box->newSubButton("空压机安全阀关闭", [this, boardid](int argn, const char **args) { CAN_MASTER->airCompressorCtrlSafeValve(boardid, 0); }); |
|
|
|
box->newSubButtonEnd(); |
|
|
|
box->newFunc("空压机读取电流", {}, [this, boardid](int argn, const char **args) { |
|
|
|
int val = CAN_MASTER->airCompressorReadEI(boardid); |
|
|
|
ISHOW("val:%d", val); |
|
|
|
}); |
|
|
|
// box->newFunc("空压机读取电流ADC", {}, [this, boardid](int argn, const char **args) {
|
|
|
|
// int val = CAN_MASTER->airCompressorReadEIAdcRaw(boardid);
|
|
|
|
// ISHOW("val:%d", val);
|
|
|
|
// });
|
|
|
|
box->newFunc("空压机是否打开", {}, [this, boardid](int argn, const char **args) { |
|
|
|
bool val = CAN_MASTER->airCompressorIsOpen(boardid); |
|
|
|
ISHOW("val:%d", val); |
|
|
|
box->newSubButton("空压机读取状态", [this, boardid](int argn, const char **args) { |
|
|
|
int32_t type; |
|
|
|
int16_t state[10] = {0}; |
|
|
|
int32_t stateNum = 0; |
|
|
|
type = CAN_MASTER_COM->callcmd0(boardid, kfn_air_compressor_read_type, DEFUALT_OVERTIME)->getContent(0); |
|
|
|
auto receipt = CAN_MASTER_COM->callcmd0(boardid, kfn_air_compressor_read_state, DEFUALT_OVERTIME); |
|
|
|
for (int i = 0; i < receipt->getContent16Num(); i++) { |
|
|
|
state[i] = receipt->getContent16(i); |
|
|
|
} |
|
|
|
|
|
|
|
switch (type) { |
|
|
|
case 1: |
|
|
|
ISHOW("type:IO-AireCompressor"); |
|
|
|
ISHOW("state[0] powerVal : %d", state[0]); |
|
|
|
ISHOW("state[1] acI : %d", state[1]); |
|
|
|
|
|
|
|
break; |
|
|
|
case 2: |
|
|
|
ISHOW("type:MiniPwmAirPump"); |
|
|
|
ISHOW("state[0] powerVal : %d", state[0]); |
|
|
|
ISHOW("state[1] fbCnt : %d", (uint16_t)state[1]); |
|
|
|
break; |
|
|
|
default: |
|
|
|
ISHOW("type:Unknown(%d)", type); |
|
|
|
for (size_t i = 0; i < receipt->getContent16Num(); i++) { |
|
|
|
ISHOW("state[%d] : %d", i, state[i]); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|