task_plan_execute_2/include/distribution_monitor.hpp

87 lines
2.7 KiB
C++
Raw Permalink Normal View History

2026-06-17 04:58:09 +00:00
#ifndef TPS_DISTRIBUTION_MONITOR_HPP
#define TPS_DISTRIBUTION_MONITOR_HPP
#include "app.hpp"
#include <string>
#include <vector>
// ============================================================
// 方案分发与状态监控模块SU-07 方案分发单元 & SU-08 状态监控单元)
// ============================================================
/**
*
*
*/
class DistributionMonitor {
public:
DistributionMonitor() = default;
~DistributionMonitor() = default;
/**
*
*
* @requirement(name="方案驱动分发与状态响应", id="SRS-F-06-001")
* ACK信号
*
*
* @param planId ID
* @param assetType "卫星" / "无人机" / "雷达"
* @return
*/
DistributionLog distributePlan(const std::string& planId,
const std::string& assetType);
/**
* ACK
*
* @param logId ID
* @param ackCode "ACK" / "NACK"
*/
void receiveAck(uint64_t logId, const std::string& ackCode);
/**
*
*
* @requirement(name="驱动状态监控与异常信息展示", id="SRS-F-06-002")
*
*
*
* @param rawData
* @param source
* @return
*/
StatusLog receiveTelemetry(const std::string& rawData,
const std::string& source);
/**
*
*
* @param statusCode
* @return true
*/
bool triggerAlarm(const std::string& statusCode);
/**
*
*/
std::vector<DistributionLog> getDistributionLogs() const;
/**
*
*/
std::vector<StatusLog> getStatusLogs() const;
private:
std::vector<DistributionLog> distLogs_; ///< 分发日志
std::vector<StatusLog> statusLogs_; ///< 状态日志
uint64_t nextLogId_{1}; ///< 自增日志ID
/**
*
*/
bool sendToAsset(const std::string& planId, const std::string& assetType);
};
#endif // TPS_DISTRIBUTION_MONITOR_HPP