|
@ -9,9 +9,9 @@ |
|
|
#include "service/disinfection_printer_service.hpp"
|
|
|
#include "service/disinfection_printer_service.hpp"
|
|
|
//
|
|
|
//
|
|
|
#include "api/cmds/device_alert_dectector_service_cmd_impl.hpp"
|
|
|
#include "api/cmds/device_alert_dectector_service_cmd_impl.hpp"
|
|
|
|
|
|
#include "api/cmds/device_info_cmd_impl.hpp"
|
|
|
#include "service/device_alert_dectector_service.hpp"
|
|
|
#include "service/device_alert_dectector_service.hpp"
|
|
|
#include "service/light_ctrl_service.hpp"
|
|
|
#include "service/light_ctrl_service.hpp"
|
|
|
#include "api/cmds/device_info_cmd_impl.hpp"
|
|
|
|
|
|
//
|
|
|
//
|
|
|
|
|
|
|
|
|
#include "version.hpp"
|
|
|
#include "version.hpp"
|
|
@ -91,9 +91,22 @@ void MainControlService::initialize() { |
|
|
BUILD_AND_REG_SERRVICE(IflytopFrontEndService); |
|
|
BUILD_AND_REG_SERRVICE(IflytopFrontEndService); |
|
|
GET_SERVICE(IflytopFrontEndService)->initialize("0.0.0.0"); |
|
|
GET_SERVICE(IflytopFrontEndService)->initialize("0.0.0.0"); |
|
|
GET_SERVICE(IflytopFrontEndService)->onMessage.connect([this](weak_ptr<WebSocket> webSocket, json& cmd, json& receipt) { |
|
|
GET_SERVICE(IflytopFrontEndService)->onMessage.connect([this](weak_ptr<WebSocket> webSocket, json& cmd, json& receipt) { |
|
|
string cmdstr = cmd["command"]; |
|
|
|
|
|
bool disabledump = false; |
|
|
|
|
|
if (cmdstr == "getState") disabledump = true; |
|
|
|
|
|
|
|
|
string cmdstr = cmd["command"]; |
|
|
|
|
|
bool disabledump = false; |
|
|
|
|
|
static json getStateReceipt; |
|
|
|
|
|
static bool getStateReceiptIsReady = false; |
|
|
|
|
|
static zsteady_tp lastcallGetState_tp; |
|
|
|
|
|
|
|
|
|
|
|
if (cmdstr == "getState") { |
|
|
|
|
|
if (getStateReceiptIsReady && zsteady_clock().elapsedTimeMs(lastcallGetState_tp) < 1500) { |
|
|
|
|
|
receipt = getStateReceipt; |
|
|
|
|
|
receipt["messageId"] = cmd["messageId"]; |
|
|
|
|
|
receipt["state"]["isLogin"] = m_deviceStateService->isLogin(); |
|
|
|
|
|
receipt["state"]["loginuser"] = m_deviceStateService->getLoginUid(); |
|
|
|
|
|
receipt["state"]["permissionLevel"] = m_deviceStateService->getLoginPermissionLevel(); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
if (cmdstr == "DBDBTestPage__heaterCtrlSafeValve") disabledump = true; |
|
|
if (cmdstr == "DBDBTestPage__heaterCtrlSafeValve") disabledump = true; |
|
|
if (cmdstr == "DBDBTestPage__heaterReadElectricCurrent") disabledump = true; |
|
|
if (cmdstr == "DBDBTestPage__heaterReadElectricCurrent") disabledump = true; |
|
|
if (cmdstr == "DBDBTestPage__readPressureSensor") disabledump = true; |
|
|
if (cmdstr == "DBDBTestPage__readPressureSensor") disabledump = true; |
|
@ -103,10 +116,21 @@ void MainControlService::initialize() { |
|
|
if (cmdstr == "DeviceIOControlService.airCompressor_getValve1") disabledump = true; |
|
|
if (cmdstr == "DeviceIOControlService.airCompressor_getValve1") disabledump = true; |
|
|
if (cmdstr == "DeviceIOControlService.airCompressor_getValve2") disabledump = true; |
|
|
if (cmdstr == "DeviceIOControlService.airCompressor_getValve2") disabledump = true; |
|
|
|
|
|
|
|
|
|
|
|
if (!disabledump) { |
|
|
|
|
|
logger->info("rx:{}", cmd.dump()); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if (!disabledump) logger->info("rx:{}", cmd.dump()); |
|
|
|
|
|
|
|
|
// else {
|
|
|
|
|
|
// logger->debug("rx:{}", cmd.dump());
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
m_frontMsgProcesser->processMsg(cmd, receipt); |
|
|
m_frontMsgProcesser->processMsg(cmd, receipt); |
|
|
|
|
|
|
|
|
|
|
|
if (cmdstr == "getState") { |
|
|
|
|
|
getStateReceipt = receipt; |
|
|
|
|
|
getStateReceiptIsReady = true; |
|
|
|
|
|
lastcallGetState_tp = zsteady_clock().now(); |
|
|
|
|
|
} |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
/*******************************************************************************
|
|
|
/*******************************************************************************
|
|
|