|
|
@ -235,6 +235,9 @@ void MainWindow::processException(const zexception &e) { // |
|
|
|
} |
|
|
|
int32_t MainWindow::getDeviceId() { return PublicState_DeviceIDVal; } |
|
|
|
|
|
|
|
/***********************************************************************************************************************
|
|
|
|
* 泵机控制接口 * |
|
|
|
***********************************************************************************************************************/ |
|
|
|
void MainWindow::constructPumpControlUI(ZQFunctionListBox *box, int targetDeviceId) { |
|
|
|
// ZQFunctionListBox *box = new ZQFunctionListBox(tab, "泵机指令", 4);
|
|
|
|
|
|
|
@ -269,11 +272,10 @@ void MainWindow::constructPumpControlUI(ZQFunctionListBox *box, int targetDevice |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
/***********************************************************************************************************************
|
|
|
|
* 通用操作接口页面 * |
|
|
|
***********************************************************************************************************************/ |
|
|
|
void MainWindow::constructCommonOperationTab() { |
|
|
|
/***********************************************************************************************************************
|
|
|
|
* 模块操作 * |
|
|
|
***********************************************************************************************************************/ |
|
|
|
|
|
|
|
ZQVTabPage *tab = new ZQVTabPage(ui->buttonTabWidget, "通用接口"); |
|
|
|
// static
|
|
|
|
{ |
|
|
@ -316,32 +318,74 @@ void MainWindow::constructCommonOperationTab() { |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/***********************************************************************************************************************
|
|
|
|
* 消毒拉杆箱界面 * |
|
|
|
***********************************************************************************************************************/ |
|
|
|
void MainWindow::constructDrawBarDisinfectionBoxTab() { //
|
|
|
|
|
|
|
|
ZQVTabPage *tab = new ZQVTabPage(ui->buttonTabWidget, "消毒拉杆箱"); |
|
|
|
|
|
|
|
{ |
|
|
|
ZQFunctionListBox *box = new ZQFunctionListBox(tab, "MINI功率控制板", 4); |
|
|
|
constructPumpControlUI(box, kFixBoardId_LiquidCtrl); |
|
|
|
// 喷液MINI真空泵
|
|
|
|
box->newFunc("喷液MINI真空泵控制", {"onoff"}, [this](int argn, const char **args) { //
|
|
|
|
IflytopCanbusMaster::ins()->sl_mini_ac_ctrl(kFixBoardId_LiquidCtrl, atoi(args[0])); |
|
|
|
}); |
|
|
|
// 气密性测试MINI真空泵
|
|
|
|
box->newFunc("气密性测试MINI真空泵", {"onoff"}, [this](int argn, const char **args) { //
|
|
|
|
IflytopCanbusMaster::ins()->atta_mini_air_compressor_ctrl(kFixBoardId_LiquidCtrl, atoi(args[0])); |
|
|
|
}); |
|
|
|
// 压力传感器总线
|
|
|
|
box->newFunc("压力传感器总线-读数据", {"subid"}, [this](int argn, const char **args) { //
|
|
|
|
int32_t val = IflytopCanbusMaster::ins()->pressure_sensor_bus_read_data( //
|
|
|
|
kFixBoardId_LiquidCtrl, atoi(args[0])); |
|
|
|
ZQUI::ins()->ishow("val:%d", val); |
|
|
|
}); |
|
|
|
box->newFunc("压力传感器总线-设置上报周期", {"periodms"}, [this](int argn, const char **args) { //
|
|
|
|
IflytopCanbusMaster::ins()->pressure_sensor_bus_set_report_period_ms( //
|
|
|
|
kFixBoardId_LiquidCtrl, atoi(args[0])); |
|
|
|
}); |
|
|
|
ZQFunctionListBox *minpowerboard_box = new ZQFunctionListBox(tab, "液路板", 4); |
|
|
|
{ |
|
|
|
/**
|
|
|
|
* @brief 泵机控制接口 |
|
|
|
*/ |
|
|
|
constructPumpControlUI(minpowerboard_box, kFixBoardId_LiquidCtrl); |
|
|
|
} |
|
|
|
{ |
|
|
|
// 喷液MINI真空泵
|
|
|
|
minpowerboard_box->newFunc("喷液MINI真空泵控制", {"onoff"}, [this](int argn, const char **args) { //
|
|
|
|
IflytopCanbusMaster::ins()->sl_mini_ac_ctrl(kFixBoardId_LiquidCtrl, atoi(args[0])); |
|
|
|
}); |
|
|
|
// 气密性测试MINI真空泵
|
|
|
|
minpowerboard_box->newFunc("气密性测试MINI真空泵", {"onoff"}, [this](int argn, const char **args) { //
|
|
|
|
IflytopCanbusMaster::ins()->atta_mini_air_compressor_ctrl(kFixBoardId_LiquidCtrl, atoi(args[0])); |
|
|
|
}); |
|
|
|
// 压力传感器总线
|
|
|
|
minpowerboard_box->newFunc("压力传感器总线-读数据", {"subid"}, [this](int argn, const char **args) { //
|
|
|
|
int32_t val = IflytopCanbusMaster::ins()->pressure_sensor_bus_read_data( //
|
|
|
|
kFixBoardId_LiquidCtrl, atoi(args[0])); |
|
|
|
ZQUI::ins()->ishow("val:%d", val); |
|
|
|
}); |
|
|
|
minpowerboard_box->newFunc("压力传感器总线-设置上报周期", {"periodms"}, [this](int argn, const char **args) { //
|
|
|
|
IflytopCanbusMaster::ins()->pressure_sensor_bus_set_report_period_ms( //
|
|
|
|
kFixBoardId_LiquidCtrl, atoi(args[0])); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
void MainWindow::construct_largeSpaceDisinfectionTab() { |
|
|
|
//
|
|
|
|
|
|
|
|
int targetId = kFixBoardId_LiquidCtrl; |
|
|
|
|
|
|
|
ZQVTabPage *tab = new ZQVTabPage(ui->buttonTabWidget, "大空间消毒机"); |
|
|
|
|
|
|
|
{ |
|
|
|
ZQFunctionListBox *minpowerboard_box = new ZQFunctionListBox(tab, "液路板", 4); |
|
|
|
|
|
|
|
constructPumpControlUI(minpowerboard_box, targetId); // 泵机控制接口
|
|
|
|
minpowerboard_box->newFunc("压力传感器总线-读数据", {"subid"}, //
|
|
|
|
[this, targetId](int argn, const char **args) { |
|
|
|
int32_t val = IflytopCanbusMaster::ins()->pressure_sensor_bus_read_data(targetId, atoi(args[0])); |
|
|
|
ZQUI::ins()->ishow("val:%d", val); |
|
|
|
}); |
|
|
|
minpowerboard_box->newFunc("压力传感器总线-设置上报周期", {"periodms"}, //
|
|
|
|
[this, targetId](int argn, const char **args) { IflytopCanbusMaster::ins()->pressure_sensor_bus_set_report_period_ms(targetId, atoi(args[0])); }); |
|
|
|
minpowerboard_box->newFunc("报警灯控制", {"r", "g", "b", "w"}, //
|
|
|
|
[this, targetId](int argn, const char **args) { IflytopCanbusMaster::ins()->triple_warning_light_ctl(targetId, atoi(args[0]), atoi(args[1]), atoi(args[2]), atoi(args[3])); }); |
|
|
|
minpowerboard_box->newFunc("读取-蒸发桶水浸传感器-状态", {}, //
|
|
|
|
[this, targetId](int argn, const char **args) { |
|
|
|
int state = IflytopCanbusMaster::ins()->evaporation_bin_water_sensor_read_state(targetId); |
|
|
|
ZQUI::ins()->ishow("state:%d", state); |
|
|
|
}); |
|
|
|
minpowerboard_box->newFunc("读取-设备底部水浸传感器-状态", {}, //
|
|
|
|
[this, targetId](int argn, const char **args) { |
|
|
|
int state = IflytopCanbusMaster::ins()->device_bottom_water_sensor_read_state(targetId); |
|
|
|
ZQUI::ins()->ishow("state:%d", state); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -349,6 +393,7 @@ void MainWindow::constructAppUI() { |
|
|
|
//
|
|
|
|
constructCommonOperationTab(); |
|
|
|
constructDrawBarDisinfectionBoxTab(); |
|
|
|
construct_largeSpaceDisinfectionTab(); |
|
|
|
} |
|
|
|
|
|
|
|
void MainWindow::processReportPacket(packet_type_t type, uint8_t from, uint8_t to, uint8_t *hex, uint32_t hexlen) { |
|
|
@ -359,14 +404,15 @@ void MainWindow::processReportPacket(packet_type_t type, uint8_t from, uint8_t t |
|
|
|
|
|
|
|
if (frame->function_id == kreport_heatpacket_pong) { |
|
|
|
report_heatpacket_data_t *ack = (report_heatpacket_data_t *)frame->params; |
|
|
|
ZQUI::ins()->rshow("[Heat ][FROM:%03d] HeatIndex:%x ToardType:%s flag:%x", //
|
|
|
|
from, ack->heartIndex, BoardTypeToString(ack->boardType), ack->flag); |
|
|
|
|
|
|
|
} else if (frame->function_id == kreport_exception_error) { |
|
|
|
ZQUI::ins()->rshow("[Heat ][FROM:%03d] HeatIndex:%x ToardType:%s flag:%x", from, ack->heartIndex, BoardTypeToString(ack->boardType), ack->flag); |
|
|
|
} |
|
|
|
//
|
|
|
|
else if (frame->function_id == kreport_exception_error) { |
|
|
|
report_exeception_data_t *ack = (report_exeception_data_t *)frame->params; |
|
|
|
ZQUI::ins()->eshow("[Exception][FROM:%03d] subid:%x ecode:%s", //
|
|
|
|
from, ack->subid, ErrorCodeToString(ack->ecode)); |
|
|
|
} else if (frame->function_id == kreport_pressure_data) { |
|
|
|
ZQUI::ins()->eshow("[Exception][FROM:%03d] subid:%x ecode:%s", from, ack->subid, ErrorCodeToString(ack->ecode)); |
|
|
|
} |
|
|
|
//
|
|
|
|
else if (frame->function_id == kreport_pressure_data) { |
|
|
|
report_pressure_data_t *ack = (report_pressure_data_t *)frame->params; |
|
|
|
QString info; |
|
|
|
info.append(fmt("[Pressure][FROM:%03d](%d)", from, ack->sensorDataNum)); |
|
|
@ -375,6 +421,24 @@ void MainWindow::processReportPacket(packet_type_t type, uint8_t from, uint8_t t |
|
|
|
} |
|
|
|
ZQUI::ins()->rshow(info.toStdString().c_str()); |
|
|
|
} |
|
|
|
//
|
|
|
|
else if (frame->function_id == kreport_h2o2_sensor_data) { |
|
|
|
report_h2o2_data_t *ack = (report_h2o2_data_t *)frame->params; |
|
|
|
QString info; |
|
|
|
info.append(fmt("[H2O2 ][FROM:%03d] suid:%d,err:%d h2o2:%d (x10ppm),humid:%d (x10),temp:%d (x10),saturation:%d (x10)", //
|
|
|
|
from, ack->subid, ack->sensor_error, ack->h2o2, ack->humid, ack->temp, ack->saturation)); |
|
|
|
ZQUI::ins()->rshow(info.toStdString().c_str()); |
|
|
|
} |
|
|
|
//
|
|
|
|
else if (frame->function_id == kreport_evaporation_bin_water_sensor) { |
|
|
|
report_water_sensor_state_t *ack = (report_water_sensor_state_t *)frame->params; |
|
|
|
ZQUI::ins()->rshow("[蒸发仓内水浸][FROM:%03d] (%d)", from, ack->state); |
|
|
|
} |
|
|
|
//
|
|
|
|
else if (frame->function_id == kreport_device_bottom_water_sensor) { |
|
|
|
report_water_sensor_state_t *ack = (report_water_sensor_state_t *)frame->params; |
|
|
|
ZQUI::ins()->rshow("[设备底部水浸][FROM:%03d] (%d)", from, ack->state); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
void MainWindow::on_PublicState_ConfirmKey_clicked() { PublicState_DeviceIDVal = ui->PublicState_DeviceID->toPlainText().toInt(); } |
|
|
|