You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
iec104/include/HTGlobal.h

129 lines
5.5 KiB
C++

/****************************************************************************
** File name : HTGolbal.h
** Description : global variable define
** Create date : 2018.09.01
** Auther by : Liuyx
** Version info : V1.0.01
** Copyright (C) 2002-2018 xi'an huatek, Inc Co., Ltd
** Update record:
** DATE AUTHER DESC
** -------------------------------------------------------------------------
** 2018.09.01 Liuyx first build
****************************************************************************/
#pragma warning (disable:4786)
#ifndef __HT_GLOBAL_H
#define __HT_GLOBAL_H
#include "HTType.h"
#include "HTConst.h"
#include "HTMutex.h"
#include "HTPublic.h"
#include "HTLogger.h"
#include "HTConfig.h"
#include "HTDatabase.h"
#include "HTDataStruct.h"
#include "HTHP104Table.h"
#include "HTMemCacheData.h"
#include "HTInitUtils.h"
#include "HTCP56Time.h"
#include "HTError.h"
#include "HTTcpSocket.h"
#include "HTIEC104.h"
#include "HTThread.h"
#include "HTImageBusi.h"
#include "HTOpencvImg.h"
#include "HTTestOpencv.h"
#include "HTUnit.h"
#include "HTVersion.h"
#include <list>
#include <map>
#include <vector>
#include <iostream>
#define _HT_OPENCV_APP // 图片分析处理程序
#define _HT_IEC104_APP // IEC104通讯程序
#define _DEF_HMF_VOLTAGE // 黑麋峰高压侧电流计算
#define _DEF_DB_CHANGERATE // 启用偏差率入库功能,否则以设定的间隔时间入库
using namespace std;
//#define _CRT_SECURE_NO_WARNINGS 1
extern int g_Running;
extern TConfig g_TConfig;
extern TTcpSocket g_Tcp;
extern ST_IEC104_CTRL g_IecCtrl; // socket linker info and status
extern mutex g_IecCtrl_mutex; // socket linker on mutex
extern map<string, ST_BYQWORK_STATUS> g_map_work; // 主变工作状态缓存
extern mutex g_map_work_mutex; // 主变工作状态缓存队列锁
//extern map<string,ST_BYQ_CACHE> g_map_byq; // 变压器缓存数据
extern map<string, ST_BYQ_RUN_STATE_THRESHOLD> g_map_thres_byq; // 变压器缓存数据
extern mutex g_map_byq_mutex; // 变压器缓存数据信息队列锁
//extern map<string,ST_GIS_CACHE> g_map_gis; // GIS缓存数据
//extern mutex g_map_gis_mutex; // GIS缓存数据信息队列锁
extern multimap<string, ST_DEV_RELATION> g_map_relation; // 主设备与外挂设备关系
extern mutex g_map_relation_mutex; // GIS缓存数据信息队列锁
//extern map<string, ST_GIS_IEC104_DATA> g_map_gis_104; // GIS最近一次104上传数据缓存
//extern mutex g_map_gis_104_mutex;
//extern map<string, ST_BLQ_CACHE> g_map_blq; // BLQ缓存数据
//extern mutex g_map_blq_mutex; // BLQ缓存数据信息队列锁
extern map<unsigned int, ST_IECPOINT_TABLE> g_map_iec; // 104报文解析缓存数据
extern mutex g_map_iec_mutex; // 104报文解析缓存数据信息队列锁
extern map<unsigned int, IEC_DEVICE> g_map_devices; // 104报文解析缓存数据
extern map<unsigned int, IEC_POINT> g_map_iec_new; // 104报文解析缓存数据
extern map<unsigned int, CACHED_DEV_DATA> g_map_dev_data; // 104点表报文解析缓存数据
extern mutex g_map_iec_mutex_new; // 104报文解析缓存数据信息队列锁
extern map<unsigned int, ST_SADR_MATCH> g_map_sadr; // 点表匹配关系
extern mutex g_map_sadr_mutex;
extern map<string, ST_IMG_THRESHOLD> g_map_img_thres; // 图片识别阈值
extern mutex g_map_img_thres_mutex;
//extern list<ST_LIST_MONITOR> g_list_monitor; // 监控消息数据队列
//extern mutex g_list_monitor_mutex;
extern map<string, ST_DEVICE_TIME_STAT> g_map_dev_time_stat;
extern mutex g_map_dev_time_stat_mutex;
extern map<unsigned int, ST_BREAK_EQM_CODE> g_map_gis_state; // 断路器状态位与电流电压关系匹配表
extern mutex g_map_gis_state_mutex;
extern int g_seqno; // 与MEC之间交换的流水号
extern mutex g_seq_mutex; // 流水号
extern pthread_t thread_handle_monitor; // 监控线程句柄
extern pthread_t thread_handle_parse; // 104报文解析线程
//extern pthread_t thread_handle_setdb; // 入库线程
//extern pthread_t thread_handle_getdata; // 数据提取线程
extern pthread_t thread_handle_timer; // 应答线程
extern pthread_t thread_handle_client; // 客户端链接线程
extern pthread_t thread_handle_warning; // 报警处理及入库线程句柄
extern pthread_t thread_handle_origin; // 原始数据如何线程句柄
extern pthread_t thread_handle_origin_new; // 原始数据如何线程句柄
extern pthread_t thread_handle_busi_data; // 业务数据如何线程句柄
extern pthread_t thread_handle_pingce; // IEC104评测数据入库线程句柄
extern pthread_t thread_handle_gishold; // 断路器断开数据入库线程句柄
extern pthread_t thread_handle_active; // 心跳线程
extern pthread_t thread_handle_linkmgr; // 链路管理线程
extern pthread_t thread_handle_recv; // 链路管理线程
extern pthread_t thread_handle_cache; // 内存同步线程句柄
extern pthread_t thread_handle_opecvimg; // 图片识别线程句柄
#endif // end __HT_GLOBAL_H