42 lines
800 B
C
42 lines
800 B
C
|
#pragma once
|
||
|
|
||
|
#include "XNMonitorServer_global.h"
|
||
|
#include <map>
|
||
|
#include <mutex>
|
||
|
#include "TypeDefine.h"
|
||
|
#include "TopicManager.h"
|
||
|
#include "../XNCore/XNIDL/XNSimStatusPubSubTypes.hpp"
|
||
|
|
||
|
class XNMONITORSERVER_EXPORT ModelInfoMonitor
|
||
|
{
|
||
|
public:
|
||
|
explicit ModelInfoMonitor() {}
|
||
|
virtual ~ModelInfoMonitor();
|
||
|
|
||
|
public:
|
||
|
std::string Initialize();
|
||
|
|
||
|
std::string GetAllModelInfo();
|
||
|
|
||
|
private:
|
||
|
/**
|
||
|
* @brief 模型状态监听
|
||
|
* @param status 模型状态
|
||
|
*/
|
||
|
void ModelStatusListener(const XNSim::XNSimStatus::XNModelStatus &status);
|
||
|
|
||
|
private:
|
||
|
/**
|
||
|
* @brief 互斥锁
|
||
|
*/
|
||
|
std::mutex m_ModelStatusMutex;
|
||
|
/**
|
||
|
* @brief 模型状态
|
||
|
*/
|
||
|
std::map<uint32_t, XNSim::XNSimStatus::XNModelStatus> m_ModelStatus;
|
||
|
/**
|
||
|
* @brief 模型周期计数
|
||
|
*/
|
||
|
std::map<uint32_t, uint64_t> m_ModelCycleCount;
|
||
|
};
|