task_plan/README.md

58 lines
2.0 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# ETMS — Event & Task Management System (C++ Core Component)
## 概述
ETMS事件与任务管理系统是战场任务规划系统BTPS的核心组件实现从战场临机事件感知到作战任务草案生成的全流程支持。本工程为 ETMS 的 C++ 核心库,提供事件模型、任务模板模型、知识库版本管理、事件状态机以及任务请求组装等基础能力。
## 工程结构
```
.
├── CMakeLists.txt # CMake 构建配置
├── README.md # 本文件
├── include/
│ └── app.hpp # 公开 API 头文件(事件、模板、版本、状态机、请求组装)
├── src/
│ ├── app.cpp # 核心逻辑实现
│ └── main.cpp # 命令行入口
└── tests/
└── basic_test.cpp # 单元测试(使用 assert
```
## 构建与运行
### 前提
- CMake ≥ 3.14
- 支持 C++17 的编译器GCC 8+, Clang 7+, MSVC 2019+
### 步骤
```bash
# 1. 进入工程目录
cd codegen-runs/codegen_d0add3470891422097f0b7fb8558b115
# 2. 配置 & 构建
cmake -B build
cmake --build build
# 3. 运行主程序
./build/etms
# 4. 运行单元测试
./build/etms_test
# 或
cmake --build build --target check
```
## 核心模块
| 模块 | 文件 | 说明 |
|----------------|-------------------|------------------------------------|
| 事件模型 | `app.hpp` | `Event` 结构体,对应 t_event 表 |
| 任务模板模型 | `app.hpp` | `TaskTemplate` 结构体,对应 t_task_template 表 |
| 知识库版本 | `app.hpp` | `KbVersion` 结构体,对应 t_kb_version 表 |
| 事件状态机 | `app.hpp` | `EventStatus` 枚举与状态流转逻辑 |
| 任务请求组装 | `app.hpp` / `.cpp`| 生成任务请求报文的辅助函数 |
| 运行时演示 | `main.cpp` | 演示全流程(事件接收→展示→模板选择→请求组装) |