|
|
@ -4,8 +4,27 @@ using namespace iflytop; |
|
|
|
using namespace std; |
|
|
|
using namespace core; |
|
|
|
|
|
|
|
void ExtSettingMgrService::initVal(shared_ptr<MsgProcessContext> cxt, ProjectTypeEnum projType, int year, int month, int day, int index) { DeviceExtSettingV2Dao::ins()->initVal(projType, year, month, day, index); } |
|
|
|
void ExtSettingMgrService::initVal(shared_ptr<MsgProcessContext> cxt, ProjectTypeEnum projType, string deviceId) { DeviceExtSettingV2Dao::ins()->initVal(projType, deviceId); } |
|
|
|
void ExtSettingMgrService::initVal1(shared_ptr<MsgProcessContext> cxt, ProjectTypeEnum projType, int year, int month, int day, int index) { DeviceExtSettingV2Dao::ins()->initVal(projType, year, month, day, index); } |
|
|
|
void ExtSettingMgrService::initVal2(shared_ptr<MsgProcessContext> cxt, string deviceId) { |
|
|
|
int deviceTypeLen = deviceId.length() - 9; |
|
|
|
if (deviceTypeLen < 6) { |
|
|
|
cxt->rely["error"] = fmt::format("设备ID格式错误,设备ID长度{}<15", deviceId.length()); |
|
|
|
return; |
|
|
|
} |
|
|
|
string deviceType = deviceId.substr(0, deviceTypeLen); |
|
|
|
ProjectTypeEnum dtype = ProjectTypeEnum(deviceType); |
|
|
|
if (dtype.getId() == ProjectTypeEnum::kunkown) { |
|
|
|
cxt->rely["error"] = fmt::format("设备ID格式错误,不支持的设备类型:{}", deviceType); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
int year = stoi(deviceId.substr(deviceTypeLen, 2)); |
|
|
|
int month = stoi(deviceId.substr(deviceTypeLen + 2, 2)); |
|
|
|
int day = stoi(deviceId.substr(deviceTypeLen + 4, 2)); |
|
|
|
int index = stoi(deviceId.substr(deviceTypeLen + 6, 3)); |
|
|
|
|
|
|
|
DeviceExtSettingV2Dao::ins()->initVal(dtype, deviceId); |
|
|
|
} |
|
|
|
|
|
|
|
void ExtSettingMgrService::getSetting(shared_ptr<MsgProcessContext> cxt) { cxt->rely = DeviceExtSettingV2Dao::ins()->getSetting(); } |
|
|
|
void ExtSettingMgrService::getSettingCH(shared_ptr<MsgProcessContext> cxt) { cxt->rely = DeviceExtSettingV2Dao::ins()->getSettingCH(); } |
|
|
@ -32,8 +51,13 @@ void ExtSettingMgrService::rebootDevice(shared_ptr<MsgProcessContext> cxt) { sys |
|
|
|
void ExtSettingMgrService::restartProgram(shared_ptr<MsgProcessContext> cxt) { system("systemctl restart zapp &"); } |
|
|
|
|
|
|
|
void ExtSettingMgrService::initialize() { |
|
|
|
REG_EXTFN(initVal, void(ProjectTypeEnum, int, int, int, int), projType, year, month, day, index); |
|
|
|
REG_EXTFN(initVal, void(ProjectTypeEnum, string), projType, deviceId); |
|
|
|
REG_CLASS("设备扩展配置"); |
|
|
|
|
|
|
|
REG_EXTFN(initVal1, void(ProjectTypeEnum, int, int, int, int), projType, year, month, day, index); |
|
|
|
REG_EXTFN_VOID_DISPNAME(initVal1, "初始化设备"); |
|
|
|
|
|
|
|
REG_EXTFN(initVal2, void(string), deviceId); |
|
|
|
REG_EXTFN_VOID_DISPNAME(initVal2, "初始化设备"); |
|
|
|
|
|
|
|
REG_EXTFN_VOID(getSetting, json()); |
|
|
|
REG_EXTFN_VOID_DISPNAME(getSetting, "获取设备扩展设置"); |
|
|
@ -42,52 +66,52 @@ void ExtSettingMgrService::initialize() { |
|
|
|
REG_EXTFN_VOID_DISPNAME(getSettingCH, "获取设备扩展设置(中文)"); |
|
|
|
|
|
|
|
REG_EXTFN(setCanIF, void(string), val); |
|
|
|
REG_EXTFN_DISPNAME(setCanIF, "CAN接口", "val"); |
|
|
|
REG_EXTFN_DISPNAME(setCanIF, "设置CAN接口", "val"); |
|
|
|
|
|
|
|
REG_EXTFN(setCanBitrate, void(int), val); |
|
|
|
REG_EXTFN_DISPNAME(setCanBitrate, "CAN波特率", "val"); |
|
|
|
REG_EXTFN_DISPNAME(setCanBitrate, "设置CAN波特率", "val"); |
|
|
|
|
|
|
|
REG_EXTFN(setPrinterUartPath, void(string), val); |
|
|
|
REG_EXTFN_DISPNAME(setPrinterUartPath, "打印机串口路径", "val"); |
|
|
|
REG_EXTFN_DISPNAME(setPrinterUartPath, "设置打印机串口路径", "val"); |
|
|
|
|
|
|
|
REG_EXTFN(setH2o2SensorExpireTimeMonth, void(int), val); |
|
|
|
REG_EXTFN_DISPNAME(setH2o2SensorExpireTimeMonth, "H2O2传感器过期时间(月)", "val"); |
|
|
|
REG_EXTFN_DISPNAME(setH2o2SensorExpireTimeMonth, "设置H2O2传感器过期时间(月)", "val"); |
|
|
|
|
|
|
|
REG_EXTFN(setH2o2Sensorh2o2MinVal, void(int), val); |
|
|
|
REG_EXTFN_DISPNAME(setH2o2Sensorh2o2MinVal, "H2O2传感器最小值", "val"); |
|
|
|
REG_EXTFN_DISPNAME(setH2o2Sensorh2o2MinVal, "设置H2O2传感器最小值", "val"); |
|
|
|
|
|
|
|
REG_EXTFN(setSensorPreheartTimeS, void(int), val); |
|
|
|
REG_EXTFN_DISPNAME(setSensorPreheartTimeS, "传感器预热时间(秒)", "val"); |
|
|
|
REG_EXTFN_DISPNAME(setSensorPreheartTimeS, "设置传感器预热时间(秒)", "val"); |
|
|
|
|
|
|
|
REG_EXTFN(setExtWiredSensorNum, void(int), val); |
|
|
|
REG_EXTFN_DISPNAME(setExtWiredSensorNum, "外部有线探头数量", "val"); |
|
|
|
REG_EXTFN_DISPNAME(setExtWiredSensorNum, "设置外部有线探头数量", "val"); |
|
|
|
|
|
|
|
REG_EXTFN(setEmptyThePipeLineTimeS, void(int), val); |
|
|
|
REG_EXTFN_DISPNAME(setEmptyThePipeLineTimeS, "排空加液管道时间(秒)", "val"); |
|
|
|
REG_EXTFN_DISPNAME(setEmptyThePipeLineTimeS, "设置排空加液管道时间(秒)", "val"); |
|
|
|
|
|
|
|
REG_EXTFN(setEmptyingLiquidStorageTankCondtionG, void(int), val); |
|
|
|
REG_EXTFN_DISPNAME(setEmptyingLiquidStorageTankCondtionG, "排空液体储存罐阈值(G)", "val"); |
|
|
|
REG_EXTFN_DISPNAME(setEmptyingLiquidStorageTankCondtionG, "设置排空液体阈值(g)", "val"); |
|
|
|
|
|
|
|
REG_EXTFN(setLeakTestInflationTimeMs, void(int), val); |
|
|
|
REG_EXTFN_DISPNAME(setLeakTestInflationTimeMs, "泄漏测试充气时间(毫秒)", "val"); |
|
|
|
REG_EXTFN_DISPNAME(setLeakTestInflationTimeMs, "设置泄漏测试充气时间(毫秒)", "val"); |
|
|
|
|
|
|
|
REG_EXTFN(setLeakTestStabilizationTimeS, void(int), val); |
|
|
|
REG_EXTFN_DISPNAME(setLeakTestStabilizationTimeS, "泄漏测试稳定时间(秒)", "val"); |
|
|
|
REG_EXTFN_DISPNAME(setLeakTestStabilizationTimeS, "设置泄漏测试稳定时间(秒)", "val"); |
|
|
|
|
|
|
|
REG_EXTFN(setDisinfectantBucketCapacity, void(int), val); |
|
|
|
REG_EXTFN_DISPNAME(setDisinfectantBucketCapacity, "消毒液桶体积", "val"); |
|
|
|
REG_EXTFN_DISPNAME(setDisinfectantBucketCapacity, "设置消毒液桶体积", "val"); |
|
|
|
|
|
|
|
REG_EXTFN(setUserBehaviorRecordDbMaxRecords, void(int), val); |
|
|
|
REG_EXTFN_DISPNAME(setUserBehaviorRecordDbMaxRecords, "用户行为记录数据库最大记录数", "val"); |
|
|
|
REG_EXTFN_DISPNAME(setUserBehaviorRecordDbMaxRecords, "设置用户行为最大记录数", "val"); |
|
|
|
|
|
|
|
REG_EXTFN(setGpmToSpeedRadio, void(float), val); |
|
|
|
REG_EXTFN_DISPNAME(setGpmToSpeedRadio, "GPM转速比率", "val"); |
|
|
|
REG_EXTFN_DISPNAME(setGpmToSpeedRadio, "设置GPM转速比率", "val"); |
|
|
|
|
|
|
|
REG_EXTFN(setSprayLineEmptyTimeS, void(int), val); |
|
|
|
REG_EXTFN_DISPNAME(setSprayLineEmptyTimeS, "喷液管道排空时间(秒)", "val"); |
|
|
|
REG_EXTFN_DISPNAME(setSprayLineEmptyTimeS, "设置喷液管道排空时间(秒)", "val"); |
|
|
|
|
|
|
|
REG_EXTFN(setSprayLineEmptyVelRPM, void(int), val); |
|
|
|
REG_EXTFN_DISPNAME(setSprayLineEmptyVelRPM, "喷液管道排空速度(RPM)", "val"); |
|
|
|
REG_EXTFN_DISPNAME(setSprayLineEmptyVelRPM, "设置喷液管道排空速度(RPM)", "val"); |
|
|
|
|
|
|
|
REG_EXTFN_VOID(rebootDevice, void(void)); |
|
|
|
REG_EXTFN_VOID_DISPNAME(rebootDevice, "重启设备"); |
|
|
|