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.
54 lines
1.8 KiB
C
54 lines
1.8 KiB
C
#ifndef __PD_STORAGE_H_
|
|
#define __PD_STORAGE_H_
|
|
|
|
/* Includes ------------------------------------------------------------------*/
|
|
|
|
/* Define --------------------------------------------------------------------*/
|
|
#define STORAGE_DATA_FIFO "STORAGE_DATA_FIFO"
|
|
|
|
/* Exported types ------------------------------------------------------------*/
|
|
/*本地存储类型*/
|
|
typedef enum
|
|
{
|
|
STORAGE_TYPE_EVENT = 1,
|
|
STORAGE_TYPE_TREND,
|
|
STORAGE_TYPE_ALARM,
|
|
STORAGE_TYPE_RUNSTATUS,
|
|
STORAGE_TYPE_FIXEDTIMERPRPS
|
|
}LOCAL_STORAGE_TYPE_E;
|
|
|
|
/* */
|
|
typedef struct
|
|
{
|
|
int32_t storage_fifo_id; // 存储FIFO ID
|
|
pthread_mutex_t mutex;
|
|
} storage_t;
|
|
|
|
typedef struct {
|
|
uint32_t type;
|
|
void *data;
|
|
} pd_storage_msg_t;
|
|
|
|
typedef struct {
|
|
uint16_t event_cnt[PD_DAU_SUM][PD_DAU_PORT_SUM]; //事件文件已存储数
|
|
uint16_t trend_cnt; //趋势文件已存储数
|
|
uint16_t fixedtimePRPS_cnt; //定时PRPS文件已存储数
|
|
uint32_t event_max_utc[PD_DAU_SUM][PD_DAU_PORT_SUM];
|
|
uint32_t event_min_utc[PD_DAU_SUM][PD_DAU_PORT_SUM];
|
|
uint32_t trend_max_utc;
|
|
uint32_t trend_min_utc;
|
|
uint32_t fixedtimePRPS_max_utc;
|
|
uint32_t fixedtimePRPS_min_utc;
|
|
uint32_t utc_base[PD_DAU_SUM][PD_DAU_PORT_SUM]; //事件文件存储频繁判断基准值
|
|
uint32_t limit_cnt[PD_DAU_SUM][PD_DAU_PORT_SUM]; //事件文件存储频繁判断个数
|
|
} storage_arg_t;
|
|
|
|
/* Exported macro ------------------------------------------------------------*/
|
|
|
|
/* Extern global variables ---------------------------------------------------*/
|
|
extern storage_t storage;
|
|
/* Extern functions ----------------------------------------------------------*/
|
|
extern int32_t localstorage_handle_init(void);
|
|
|
|
#endif
|
|
/************************ (C) COPYRIGHT LandPower ***** END OF FILE ****************/ |