debugOutputItemInfo[index++] = {index, "CAT1_UPDATA"};
debugOutputItemInfo[index++] = {index, "cwm_runtime_log"};
+
+ //gps状态日志
+ debugOutputItemInfo[index++] = {index, "gps_status_log"};
usedLen = index;
std::string result = logModel->get_system_mem_info();
return result;
}
+ //获取gps状态日志
+ std::string DebugOutputViewEventListener::get_gps_status_log()
+ {
+ std::ostringstream result;
+ result << "gps_status:\n"; // 添加标题
+
+ auto logModel = SystemLogModel::GetInstance();
+ const auto &gps_logs = logModel->get_gps_status_log();
+
+ // 遍历日志并拼接到结果字符串
+ for (const auto &log : gps_logs) {
+ if(log.type == gps_status_type::GPS_SUCCESS)
+ {
+ result << "成功\n";
+ }
+ else if(log.type == gps_status_type::GPS_FAILED)
+ {
+ result << "失败\n";
+ }
+ std::string timestr;
+ if (log.timestamp == 0) {
+ timestr = "--"; // 默认值
+ } else {
+ timestr = formatTime(log.timestamp);
+ }
+ result << "[" << timestr << "] "<< "\n";
+ }
+ return result.str();
+ }
std::string DebugOutputViewEventListener::get_nextday_log()
{
std::ostringstream result;
}
}
break;
+ case 22:
+ str = get_gps_status_log();
+ break;
default:
str = "--";
break;