更新:1、增加日志模块,将标准输出信息写入到日志文件;
2、将RadarPara中DATA_RATE_TAS的单位由Hz改为s; 3、修复TAS_Ctrl::tas_beam_output函数中给Tracking_beam->TAS_track_index赋值错误的问题; Signed-off-by: waiwaylee <waiwaylee@foxmail.com>
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
#ifndef RDP_LOG_H
|
||||
#define RDP_LOG_H
|
||||
#pragma once
|
||||
/*************************************日志输出模块*******************************************/
|
||||
// 功能:
|
||||
// 1) rdp_log::Init():按 parameters.h 中 RDP_LOG_ENABLE 宏开关决定是否将 std::cout
|
||||
// 重定向到日志文件(RDP_LOG_DIR 目录,文件名按当前日期+时间自动生成)。
|
||||
// 开关关闭(注释掉 RDP_LOG_ENABLE)时不做重定向,日志仍输出到标准输出。
|
||||
// 2) rdp_log::Shutdown():恢复 std::cout 原始缓冲区(回到控制台)并关闭日志文件。
|
||||
// 3) RDP_LOG 宏:日志输出宏,在每条日志前自动附加 [时间戳][代码文件:行号] 信息,
|
||||
// 随后输出到 std::cout(若开关开启则随 cout 一并写入日志文件)。
|
||||
// 用法示例:
|
||||
// RDP_LOG << "目标批号:" << track_index << std::endl;
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
namespace rdp_log
|
||||
{
|
||||
bool Init(); //初始化日志输出(由 Data_Process_Factory::GetB() 调用)
|
||||
void Shutdown(); //恢复 std::cout 并关闭日志文件(由 Data_Process_Factory::Destroy() 调用)
|
||||
std::string prefix(const char *file, int line); //生成 "[时间戳][文件名:行号] " 前缀字符串
|
||||
}
|
||||
|
||||
//日志输出宏:自动附加 时间戳、代码文件、代码行号 后输出到标准输出(std::cout)
|
||||
#define RDP_LOG std::cout << rdp_log::prefix(__FILE__, __LINE__)
|
||||
|
||||
#endif // RDP_LOG_H
|
||||
Reference in New Issue
Block a user