2026-05-09 11:23:45 +08:00
|
|
|
|
#pragma once
|
|
|
|
|
|
/**
|
|
|
|
|
|
* @file gb_item_memory.h
|
|
|
|
|
|
* @brief 全局共享内存电文解析程序
|
|
|
|
|
|
* @author Cat (null.null.null@qq.com)
|
|
|
|
|
|
* @version 0.1
|
|
|
|
|
|
* @date 2021-10-08
|
|
|
|
|
|
*
|
|
|
|
|
|
* Copyright: Baosight Co. Ltd.
|
|
|
|
|
|
* DO NOT COPY/USE WITHOUT PERMISSION
|
|
|
|
|
|
*
|
|
|
|
|
|
*/
|
|
|
|
|
|
#include <eqpalg/define/public.h>
|
|
|
|
|
|
#include <glob/BinaryTele.h>
|
|
|
|
|
|
#include <log4cplus/LOG.h>
|
|
|
|
|
|
#include <zlib/MemVar.h>
|
|
|
|
|
|
#include <zlib/zoneDef.h>
|
|
|
|
|
|
#include <array>
|
|
|
|
|
|
#include <numeric>
|
|
|
|
|
|
#include <shared_mutex>
|
|
|
|
|
|
#include <string>
|
|
|
|
|
|
#include <unordered_map>
|
|
|
|
|
|
#include <zlib/MemFix.hpp>
|
|
|
|
|
|
#include <zlib/MemTable.hpp>
|
|
|
|
|
|
/**
|
|
|
|
|
|
* @brief 全局内存单例实例
|
|
|
|
|
|
* 从共享内存中获取电文对应的数值信息
|
|
|
|
|
|
*/
|
|
|
|
|
|
struct GlobaltemSharedMemory {
|
|
|
|
|
|
friend class AlgorithmManager;
|
|
|
|
|
|
friend class EqpAlgICEI;
|
|
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
public:
|
|
|
|
|
|
// GlobaltemSharedMemory() = default;
|
|
|
|
|
|
GlobaltemSharedMemory();
|
|
|
|
|
|
~GlobaltemSharedMemory() = default;
|
|
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
/**
|
|
|
|
|
|
* @brief 获得指定tag点名的数据
|
|
|
|
|
|
* @param tag_name tag点名(需要加机组号前缀)
|
|
|
|
|
|
* @return double
|
|
|
|
|
|
*/
|
|
|
|
|
|
double operator[](std::string tag_name);
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* @brief Get the data size object
|
|
|
|
|
|
* @return int
|
|
|
|
|
|
*/
|
|
|
|
|
|
int get_data_size();
|
|
|
|
|
|
|
|
|
|
|
|
private:
|
2026-05-09 13:30:09 +08:00
|
|
|
|
static int instanceCount;
|
2026-05-09 11:23:45 +08:00
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
static int get_instanceCount();
|
|
|
|
|
|
std::string get_data_json();
|
|
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
/**
|
|
|
|
|
|
* @brief 缓存数据,并且会增加机组号信息
|
|
|
|
|
|
* @return int
|
|
|
|
|
|
*/
|
|
|
|
|
|
int cache_data();
|
|
|
|
|
|
|
|
|
|
|
|
BinaryTele binary_tele{CMemVar::Const()->event_eis_start, "T_LOV_FDAAITEM"};
|
|
|
|
|
|
map<int, CMemFix<PLC_DATA>*> m_mapfix;
|
2026-05-09 13:30:09 +08:00
|
|
|
|
size_t data_size_ = 0;
|
|
|
|
|
|
std::unique_ptr<LOG> logger_;
|
2026-05-09 11:23:45 +08:00
|
|
|
|
};
|