增加调试页面

This commit is contained in:
zjk
2025-05-21 13:15:31 +08:00
parent af8e7a1ed1
commit 3e38fca181
6 changed files with 523 additions and 1 deletions
+1 -1
View File
@@ -114,7 +114,7 @@ class PowerManger : public AppCastingMOOSApp
//=============================过程函数======================================
void initControlCmd();
private:
public:
// CMOOSThread m_FsmThread;
LowerCommManager* m_lowerCommManager;
UpperCommManager* m_upperCommManager;
+43
View File
@@ -17,6 +17,9 @@ UpperCommManager::UpperCommManager(PowerManger* pm) : m_pm(pm) {
bool UpperCommManager::processUpperMsg(const string& key, const string& strJson) {
if (key == m_sysStateMsg.key)
{
#ifdef _DEBUG
m_sysStateMsg_st_debug = std::make_pair(key, strJson);
#endif
m_pm->m_msCmd = m_sysStateMsg.getMasterControlCmd(key, strJson);
MasterCommandEvent event;
PowerManagerFsm::dispatch(event);
@@ -25,6 +28,9 @@ bool UpperCommManager::processUpperMsg(const string& key, const string& strJson)
// 设备状态处理
else if(key == m_equStateMsg.key_cmd)
{
#ifdef _DEBUG
m_equStateMsg_cmd_debug = std::make_pair(key, strJson);
#endif
m_pm->m_MSDriverCmd = m_equStateMsg.getEquipmentCmd(key, strJson);
vector<DriverCommand> devCmdExt = m_pm->m_driver.loadDriverIdFromJson(strJson);
if (devCmdExt.empty())
@@ -42,6 +48,9 @@ bool UpperCommManager::processUpperMsg(const string& key, const string& strJson)
// 次级配电状态处理
else if(key == m_secdistStateMsg.key_fb)
{
#ifdef _DEBUG
m_secdistStateMsg_fb_debug = std::make_pair(key, strJson);
#endif
m_secdistStateMsg.parseMsg(strJson, m_pm->m_subDisSysState);
//debug 接受到次级配电状态,自动更新到设备状态
//TODO:自动更新到设备状态
@@ -51,11 +60,17 @@ bool UpperCommManager::processUpperMsg(const string& key, const string& strJson)
// 深度获取
else if(key == m_depthMsg.key)
{
#ifdef _DEBUG
m_depthMsg_st_debug = std::make_pair(key, strJson);
#endif
m_pm->m_depth = m_depthMsg.getDepth(key, strJson);
return true;
}
else if(key == m_taskStartMsg.key)
{
#ifdef _DEBUG
m_taskStartMsg_st_debug = std::make_pair(key, strJson);
#endif
m_pm->m_missionState = m_taskStartMsg.getMission(key, strJson);
TaskStartEvent event;
event.type = m_pm->m_missionState.type;
@@ -66,18 +81,27 @@ bool UpperCommManager::processUpperMsg(const string& key, const string& strJson)
}
else if(key == m_setOpModeMsg.key)
{
#ifdef _DEBUG
m_setOpModeMsg_st_debug = std::make_pair(key, strJson);
#endif
m_pm->m_msCmd.modCMD = m_setOpModeMsg.getSetOpMode(key, strJson);
MasterCommandEvent event;
PowerManagerFsm::dispatch(event);
return true;
} else if(key == m_setOpConditionMsg.key)
{
#ifdef _DEBUG
m_setOpConditionMsg_st_debug = std::make_pair(key, strJson);
#endif
m_pm->m_msCmd.workCMD = m_setOpConditionMsg.getSetOpCondition(key, strJson);
MasterCommandEvent event;
PowerManagerFsm::dispatch(event);
}
else if(key == m_setPMSysMsg.key)
{
#ifdef _DEBUG
m_setPMSysMsg_st_debug = std::make_pair(key, strJson);
#endif
m_pm->m_msCmd.powerCMD = m_setPMSysMsg.getSetPMSys(key, strJson);
MasterCommandEvent event;
PowerManagerFsm::dispatch(event);
@@ -85,6 +109,9 @@ bool UpperCommManager::processUpperMsg(const string& key, const string& strJson)
}
else if(key == m_setDevSwitchMsg.key)
{
#ifdef _DEBUG
m_setDevSwitchMsg_st_debug = std::make_pair(key, strJson);
#endif
DeviceSwitchCmd cmd;
cmd = m_setDevSwitchMsg.getSetDevSwitch(key, strJson);
if (cmd.id < 0) {
@@ -102,6 +129,9 @@ bool UpperCommManager::processUpperMsg(const string& key, const string& strJson)
}
else if(key == m_taskStopMsg.key)
{
#ifdef _DEBUG
m_taskStopMsg_st_debug = std::make_pair(key, strJson);
#endif
bool stop = m_taskStopMsg.getTaskStop(key, strJson);
if (stop) {
LOG_F(INFO, "task stop success");
@@ -128,6 +158,11 @@ void UpperCommManager::processPeriodicTasks() {
m_pm->sendNotification(m_secdistStateMsg.key_cmd, strJson);
//发送仪表电状态
m_pm->sendNotification(m_equInsStateMsg.key,m_equInsStateMsg.buildMsg(m_pm->m_subDisSysState));
#ifdef _DEBUG
m_equInsStateMsg_fb_degub = std::make_pair(m_equInsStateMsg.key,m_equInsStateMsg.buildMsg(m_pm->m_subDisSysState));
m_secdistStateMsg_cmd_debug = std::make_pair(m_secdistStateMsg.key_cmd,strJson);
m_equStateMsg_fb_debug = std::make_pair(m_equStateMsg.key_cmd,m_equStateMsg.buildMsg(m_pm->m_currentDriverState));
#endif
}
void UpperCommManager::buildSystemReport() {
@@ -147,4 +182,12 @@ void UpperCommManager::buildSystemReport() {
m_pm->sendNotification(m_liBatStateMsg.key, m_liBatStateMsg.buildMsg(*(m_pm->m_systemData)));
m_pm->sendNotification(m_disSysStateMsg.key, m_disSysStateMsg.buildMsg(*(m_pm->m_systemData),m_pm->m_currentDisBreakerState));
m_pm->sendNotification(m_currentStateMsg.key, m_currentStateMsg.buildMsg(m_pm->m_pmCurrentState));
#ifdef _DEBUG
m_pmStateMsg_fb_debug = std::make_pair(m_pmStateMsg.key, m_pmStateMsg.buildMsg());
m_fcsStateMsg_st_debug = std::make_pair(m_fcsStateMsg.key, m_fcsStateMsg.buildMsg(*(m_pm->m_systemData)));
m_liBatStateMsg_st_debug = std::make_pair(m_liBatStateMsg.key, m_liBatStateMsg.buildMsg(*(m_pm->m_systemData)));
m_disSysStateMsg_st_debug = std::make_pair(m_disSysStateMsg.key, m_disSysStateMsg.buildMsg(*(m_pm->m_systemData),m_pm->m_currentDisBreakerState));
m_currentStateMsg_st_debug = std::make_pair(m_currentStateMsg.key, m_currentStateMsg.buildMsg(m_pm->m_pmCurrentState));
#endif
}
+25
View File
@@ -26,6 +26,8 @@
#include "upmsg/uPower_equState.h"
#include "upmsg/uPower_sysState.h"
#define _DEBUG
using namespace std;
#define VAR_TO_STR(var) #var
//控制消息
@@ -84,6 +86,29 @@ private:
MSControlCmd m_msCmd;
Driver m_driver;
#ifdef _DEBUG
public:
std::pair<string, string> m_equInsStateMsg_fb_degub;
std::pair<string, string> m_secdistStateMsg_cmd_debug;
std::pair<string, string> m_secdistStateMsg_fb_debug;
std::pair<string, string> m_equStateMsg_cmd_debug;
std::pair<string, string> m_equStateMsg_fb_debug;
std::pair<string, string> m_disSysStateMsg_st_debug;
std::pair<string, string> m_currentStateMsg_st_debug;
std::pair<string, string> m_pmStateMsg_fb_debug;
std::pair<string, string> m_fcsStateMsg_st_debug;
std::pair<string, string> m_liBatStateMsg_st_debug;
std::pair<string, string> m_depthMsg_st_debug;
std::pair<string, string> m_setOpConditionMsg_st_debug;
std::pair<string, string> m_setOpModeMsg_st_debug;
std::pair<string, string> m_taskStartMsg_st_debug;
std::pair<string, string> m_taskStopMsg_st_debug;
std::pair<string, string> m_setDevSwitchMsg_st_debug;
std::pair<string, string> m_setPMSysMsg_st_debug;
std::pair<string, string> m_sysStateMsg_st_debug;
#endif
// bool parseControlCmdFromJson(MSControlCmd &cmd, const std::string &strJson);
};
+385
View File
@@ -0,0 +1,385 @@
#ifndef HTTP_SERVER_DEBUGPAGE_H
#define HTTP_SERVER_DEBUGPAGE_H
#include <string>
const std::string DEBUGPAGE_HTML = R"(
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Power Manager - 调试页面</title>
<link rel="stylesheet" href="/static/style.css">
<style>
:root {
--primary-color: #2563eb;
--primary-hover: #1d4ed8;
--bg-color: #f8fafc;
--sidebar-width: 60px;
--sidebar-expanded: 220px;
--header-height: 36px;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
background-color: var(--bg-color);
color: #1a1a1a;
}
.container {
display: grid;
grid-template-areas:
"sidebar main-content";
grid-template-columns: var(--sidebar-width) 1fr;
grid-template-rows: 1fr;
min-height: 100vh;
gap: 0;
}
.header {
grid-area: unset;
background: white;
padding: 0 0.5rem;
display: flex;
align-items: center;
justify-content: space-between;
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
position: fixed;
top: 0;
right: 0;
left: var(--sidebar-width);
height: var(--header-height);
z-index: 10;
}
.header h1 {
font-size: 1.25rem;
font-weight: 600;
color: #1a1a1a;
}
.sidebar {
grid-area: sidebar;
background: white;
width: var(--sidebar-width);
height: 100vh;
position: fixed;
left: 0;
top: 0;
padding: 0.5rem 0.25rem;
transition: width 0.3s ease;
box-shadow: 1px 0 3px rgba(0, 0, 0, 0.1);
z-index: 20;
}
.sidebar:hover {
width: var(--sidebar-expanded);
}
.sidebar-menu {
display: flex;
flex-direction: column;
gap: 0.5rem;
}
.sidebar-button {
display: flex;
align-items: center;
padding: 0.5rem 0.75rem;
border-radius: 0.375rem;
color: #4b5563;
text-decoration: none;
transition: all 0.2s ease;
white-space: nowrap;
overflow: hidden;
}
.sidebar-button:hover {
background: var(--bg-color);
color: var(--primary-color);
}
.sidebar-icon {
min-width: 1.5rem;
margin-right: 1rem;
font-size: 1.25rem;
}
.main-content {
grid-area: main-content;
padding: 1px;
margin-top: var(--header-height);
}
.status-bar {
position: fixed;
top: 4px;
right: 8px;
background: white;
padding: 4px 8px;
border-radius: 4px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
display: flex;
gap: 8px;
z-index: 15;
}
.status-info {
display: flex;
align-items: center;
gap: 8px;
color: #4b5563;
font-size: 0.875rem;
}
.debug-panel {
background: white;
border-radius: 4px;
padding: 16px;
margin: 16px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.panel-title {
font-size: 1.25rem;
font-weight: 600;
color: #1a1a1a;
margin-bottom: 16px;
padding-bottom: 8px;
border-bottom: 1px solid #e5e7eb;
}
.debug-section {
margin-bottom: 24px;
}
.section-title {
font-size: 1rem;
font-weight: 600;
color: #1a1a1a;
margin-bottom: 8px;
}
.data-table {
width: 100%;
border-collapse: collapse;
}
.data-table th, .data-table td {
padding: 8px 12px;
border: 1px solid #e5e7eb;
text-align: left;
}
.data-table th {
background-color: #f3f4f6;
}
.raw-data {
font-family: monospace;
white-space: pre-wrap;
background-color: #f3f4f6;
padding: 12px;
border-radius: 4px;
max-height: 300px;
overflow: auto;
}
@media (max-width: 768px) {
.container {
grid-template-columns: 1fr;
grid-template-areas:
"header"
"main-content";
}
.sidebar {
transform: translateX(-100%);
}
.header {
left: 0;
}
}
</style>
</head>
<body>
<div class="container">
<div class="sidebar">
<div class="sidebar-menu">
<a href="/" class="sidebar-button">
<span class="sidebar-icon">🏠</span>
<span>系统主页</span>
</a>
<a href="/debug" class="sidebar-button">
<span class="sidebar-icon">🐞</span>
<span>调试页面</span>
</a>
</div>
</div>
<div class="header">
<h1>Power Manager - 调试页面</h1>
<div class="status-bar">
<div class="status-info">
<span id="wsStatus">🔴 WebSocket: 未连接</span>
</div>
</div>
</div>
<div class="main-content">
<div class="debug-panel">
<div class="panel-title">系统调试信息</div>
<div class="debug-section">
<div class="section-title">订阅消息</div>
<table class="data-table">
<thead>
<tr>
<th>消息名称</th>
<th>消息内容</th>
</tr>
</thead>
<tbody id="subscribeDataTable">
<!-- 订阅消息将通过JavaScript动态填充 -->
</tbody>
</table>
</div>
<div class="debug-section">
<div class="section-title">发布消息</div>
<table class="data-table">
<thead>
<tr>
<th>消息名称</th>
<th>消息内容</th>
</tr>
</thead>
<tbody id="publishDataTable">
<!-- 发布消息将通过JavaScript动态填充 -->
</tbody>
</table>
</div>
<div class="debug-section">
<div class="section-title">原始数据</div>
<div class="raw-data" id="rawData">
等待数据...
</div>
</div>
</div>
</div>
</div>
<script>
let ws = null;
function initWebSocket() {
ws = new WebSocket('ws://' + window.location.host + '/ws/debug');
ws.onopen = () => {
console.log('WebSocket调试连接已建立');
updateStatus('🟢 WebSocket: 已连接');
};
ws.onmessage = (event) => {
try {
const data = JSON.parse(event.data);
console.log('收到调试数据:', data);
document.getElementById('rawData').textContent = JSON.stringify(data, null, 2);
// 更新订阅消息表格
const subscribeTable = document.getElementById('subscribeDataTable');
subscribeTable.innerHTML = '';
if (data.debug) {
const subscribeMessages = [
'm_secdistStateMsg_fb_debug',
'm_equStateMsg_cmd_debug',
'm_depthMsg_st_debug',
'm_setOpConditionMsg_st_debug',
'm_setOpModeMsg_st_debug',
'm_taskStartMsg_st_debug',
'm_taskStopMsg_st_debug',
'm_setDevSwitchMsg_st_debug',
'm_setPMSysMsg_st_debug',
'm_sysStateMsg_st_debug'
];
subscribeMessages.forEach(msg => {
if (data.debug[msg]) {
addDebugRow(subscribeTable, data.debug[msg]);
}
});
}
// 更新发布消息表格
const publishTable = document.getElementById('publishDataTable');
publishTable.innerHTML = '';
if (data.debug) {
const publishMessages = [
'm_equInsStateMsg_fb_degub',
'm_secdistStateMsg_cmd_debug',
'm_equStateMsg_fb_debug',
'm_disSysStateMsg_st_debug',
'm_currentStateMsg_st_debug',
'm_pmStateMsg_fb_debug',
'm_fcsStateMsg_st_debug',
'm_liBatStateMsg_st_debug'
];
publishMessages.forEach(msg => {
if (data.debug[msg]) {
addDebugRow(publishTable, data.debug[msg]);
}
});
}
} catch (e) {
console.error('解析调试数据出错:', e);
document.getElementById('rawData').textContent = '解析错误: ' + e.message + '\n\n原始数据:\n' + event.data;
}
};
ws.onclose = () => {
console.log('WebSocket调试连接已关闭');
updateStatus('🔴 WebSocket: 已断开');
setTimeout(initWebSocket, 5000);
};
ws.onerror = (error) => {
console.error('WebSocket调试错误:', error);
updateStatus('⚠️ WebSocket: 错误');
};
}
function updateStatus(status) {
document.getElementById('wsStatus').textContent = status;
}
function addDebugRow(table, msgObj) {
const row = document.createElement('tr');
const nameCell = document.createElement('td');
nameCell.textContent = msgObj.name || '未知消息';
row.appendChild(nameCell);
const valueCell = document.createElement('td');
valueCell.textContent = msgObj.content || '无内容';
row.appendChild(valueCell);
table.appendChild(row);
}
window.addEventListener('load', initWebSocket);
</script>
</body>
</html>
)";
#endif // HTTP_SERVER_DEBUGPAGE_H
@@ -9,6 +9,7 @@
#include "data.h"
#include "logpage.h"
#include "testpage.h"
#include "degubpage.h"
using json = Json::Value;
@@ -86,6 +87,14 @@ void HttpServer::handleWebSocketEvent(struct mg_connection* c, int ev, void* ev_
// 返回测试页面HTML
mg_http_reply(c, 200, "Content-Type: text/html; charset=utf-8\r\n", TESTPAGE_HTML.c_str());
}
} else if (mg_match(hm->uri, mg_str("/debug"), NULL)) {
// 返回调试页面HTML
mg_http_reply(c, 200, "Content-Type: text/html; charset=utf-8\r\n", DEBUGPAGE_HTML.c_str());
} else if (mg_match(hm->uri, mg_str("/ws/debug"), NULL)) {
// 升级到调试WebSocket连接
LOG_F(INFO, "Upgrading to Debug WebSocket: id=%lu fd=%d", c->id, c->fd);
mg_ws_upgrade(c, hm, nullptr);
LOG_F(INFO, "Debug WebSocket upgrade completed: id=%lu fd=%d", c->id, c->fd);
} else if (mg_match(hm->uri, mg_str("/moosdb_test"), NULL)) {
if (mg_strcmp(hm->method, mg_str("POST")) == 0) {
// 解析JSON请求
@@ -555,6 +564,65 @@ void HttpServer::pushSystemData() {
j["moosdb"]["lastIterateCount"] = Json::Value(m_powerManger->GetPublicIterateCount());
j["moosdb"]["serverHost"] = Json::Value(m_powerManger->GetServerHost());
j["moosdb"]["serverPort"] = Json::Value(m_powerManger->GetServerPort());
// degub
#ifdef _DEBUG
//订阅消息
j["debug"]["m_secdistStateMsg_fb_debug"]["name"] = Json::Value(m_powerManger->m_upperCommManager->m_secdistStateMsg_fb_debug.first);
j["debug"]["m_secdistStateMsg_fb_debug"]["content"] = Json::Value(m_powerManger->m_upperCommManager->m_secdistStateMsg_fb_debug.second);
j["debug"]["m_equStateMsg_cmd_debug"]["name"] = Json::Value(m_powerManger->m_upperCommManager->m_equStateMsg_cmd_debug.first);
j["debug"]["m_equStateMsg_cmd_debug"]["content"] = Json::Value(m_powerManger->m_upperCommManager->m_equStateMsg_cmd_debug.second);
j["debug"]["m_depthMsg_st_debug"]["name"] = Json::Value(m_powerManger->m_upperCommManager->m_depthMsg_st_debug.first);
j["debug"]["m_depthMsg_st_debug"]["content"] = Json::Value(m_powerManger->m_upperCommManager->m_depthMsg_st_debug.second);
j["debug"]["m_setOpConditionMsg_st_debug"]["name"] = Json::Value(m_powerManger->m_upperCommManager->m_setOpConditionMsg_st_debug.first);
j["debug"]["m_setOpConditionMsg_st_debug"]["content"] = Json::Value(m_powerManger->m_upperCommManager->m_setOpConditionMsg_st_debug.second);
j["debug"]["m_setOpModeMsg_st_debug"]["name"] = Json::Value(m_powerManger->m_upperCommManager->m_setOpModeMsg_st_debug.first);
j["debug"]["m_setOpModeMsg_st_debug"]["content"] = Json::Value(m_powerManger->m_upperCommManager->m_setOpModeMsg_st_debug.second);
j["debug"]["m_taskStartMsg_st_debug"]["name"] = Json::Value(m_powerManger->m_upperCommManager->m_taskStartMsg_st_debug.first);
j["debug"]["m_taskStartMsg_st_debug"]["content"] = Json::Value(m_powerManger->m_upperCommManager->m_taskStartMsg_st_debug.second);
j["debug"]["m_taskStopMsg_st_debug"]["name"] = Json::Value(m_powerManger->m_upperCommManager->m_taskStopMsg_st_debug.first);
j["debug"]["m_taskStopMsg_st_debug"]["content"] = Json::Value(m_powerManger->m_upperCommManager->m_taskStopMsg_st_debug.second);
j["debug"]["m_setDevSwitchMsg_st_debug"]["name"] = Json::Value(m_powerManger->m_upperCommManager->m_setDevSwitchMsg_st_debug.first);
j["debug"]["m_setDevSwitchMsg_st_debug"]["content"] = Json::Value(m_powerManger->m_upperCommManager->m_setDevSwitchMsg_st_debug.second);
j["debug"]["m_setPMSysMsg_st_debug"]["name"] = Json::Value(m_powerManger->m_upperCommManager->m_setPMSysMsg_st_debug.first);
j["debug"]["m_setPMSysMsg_st_debug"]["content"] = Json::Value(m_powerManger->m_upperCommManager->m_setPMSysMsg_st_debug.second);
j["debug"]["m_sysStateMsg_st_debug"]["name"] = Json::Value(m_powerManger->m_upperCommManager->m_sysStateMsg_st_debug.first);
j["debug"]["m_sysStateMsg_st_debug"]["content"] = Json::Value(m_powerManger->m_upperCommManager->m_sysStateMsg_st_debug.second);
//发布消息
j["debug"]["m_equInsStateMsg_fb_degub"]["name"] = Json::Value(m_powerManger->m_upperCommManager->m_equInsStateMsg_fb_degub.first);
j["debug"]["m_equInsStateMsg_fb_degub"]["content"] = Json::Value(m_powerManger->m_upperCommManager->m_equInsStateMsg_fb_degub.second);
j["debug"]["m_secdistStateMsg_cmd_debug"]["name"] = Json::Value(m_powerManger->m_upperCommManager->m_secdistStateMsg_cmd_debug.first);
j["debug"]["m_secdistStateMsg_cmd_debug"]["content"] = Json::Value(m_powerManger->m_upperCommManager->m_secdistStateMsg_cmd_debug.second);
j["debug"]["m_equStateMsg_fb_debug"]["name"] = Json::Value(m_powerManger->m_upperCommManager->m_equStateMsg_fb_debug.first);
j["debug"]["m_equStateMsg_fb_debug"]["content"] = Json::Value(m_powerManger->m_upperCommManager->m_equStateMsg_fb_debug.second);
j["debug"]["m_disSysStateMsg_st_debug"]["name"] = Json::Value(m_powerManger->m_upperCommManager->m_disSysStateMsg_st_debug.first);
j["debug"]["m_disSysStateMsg_st_debug"]["content"] = Json::Value(m_powerManger->m_upperCommManager->m_disSysStateMsg_st_debug.second);
j["debug"]["m_currentStateMsg_st_debug"]["name"] = Json::Value(m_powerManger->m_upperCommManager->m_currentStateMsg_st_debug.first);
j["debug"]["m_currentStateMsg_st_debug"]["content"] = Json::Value(m_powerManger->m_upperCommManager->m_currentStateMsg_st_debug.second);
j["debug"]["m_pmStateMsg_fb_debug"]["name"] = Json::Value(m_powerManger->m_upperCommManager->m_pmStateMsg_fb_debug.first);
j["debug"]["m_pmStateMsg_fb_debug"]["content"] = Json::Value(m_powerManger->m_upperCommManager->m_pmStateMsg_fb_debug.second);
j["debug"]["m_fcsStateMsg_st_debug"]["name"] = Json::Value(m_powerManger->m_upperCommManager->m_fcsStateMsg_st_debug.first);
j["debug"]["m_fcsStateMsg_st_debug"]["content"] = Json::Value(m_powerManger->m_upperCommManager->m_fcsStateMsg_st_debug.second);
j["debug"]["m_liBatStateMsg_st_debug"]["name"] = Json::Value(m_powerManger->m_upperCommManager->m_liBatStateMsg_st_debug.first);
j["debug"]["m_liBatStateMsg_st_debug"]["content"] = Json::Value(m_powerManger->m_upperCommManager->m_liBatStateMsg_st_debug.second);
#endif
// 时间戳
j["timestamp"] = Json::Value((Json::UInt64)(std::chrono::duration_cast<std::chrono::milliseconds>(
std::chrono::system_clock::now().time_since_epoch()).count()));
+1
View File
@@ -144,6 +144,7 @@ public:
// MOOSD 状态
bool moosd_status;
//配电系统状态
//动力母线状态
struct POWER_BUS_STATUS
{