2024-05-31

This commit is contained in:
2584532475@qq.com committed 2024-05-31 16:57:54 +08:00
1 parent f8591b8b99
commit 4a963bd78c
27 files changed
+2956 -229

No files matched your search

+59 -23
View File
@@ -3,13 +3,20 @@
#include <stdint.h>
#define SLUICE_COUTN 1// 当前处理几口闸
#define WATER_COUTN 6// 当前接入n个流量计
#define SUBTOPIC_COUNT 1 // 订阅topic 数量
#define SLUCIE_EXEC_COUNT 20// 闸门异常时间
#define VERSION "V2.0.1"
#define VERSION "KRH-1.0.16"
// #define AI_AOVERSION "KRH-1.0.16"
//AIAO
@@ -20,7 +27,7 @@ typedef struct StrIndex_t
{
char str[10];
int index;
}StrIndex_t;
} StrIndex_t;
// 巴歇尔槽流量计
@@ -33,7 +40,7 @@ typedef struct ParShallInfo_t
double maxLeve;
double minFlow;
double maxFlow;
}ParShallInfo_t;
} ParShallInfo_t;
@@ -41,13 +48,13 @@ typedef struct LeveInfo_t
{
uint16_t Y[100]; // 水位
uint16_t Key[100]; // 流量
}LeveInfo_t;
} LeveInfo_t;
// 水位流量关系表数据
typedef struct WaterLeveInfo_t
{
uint16_t X[100]; // 单位 mm
LeveInfo_t Key[100];
}WaterLeveInfo_t;
} WaterLeveInfo_t;
@@ -78,18 +85,37 @@ typedef struct SysData_t
int fileSize; // 文件大小
} SysData_t;
typedef struct SOFTRTC_t
{
uint8_t year;
uint8_t month;
uint8_t day;
uint8_t hour;
uint8_t minutes;
uint8_t second;
} SOFTRTC_t;
// 水量参数
typedef struct InclinometerData_t
{
uint8_t dir; // 方向
uint32_t data;// 数据
} InclinometerData_t;
// 测斜数据
typedef struct WaterData_t
{
int64_t ttWater; // 累计流量 单位 m3
int32_t thisFlow; // 瞬时流量 单位 m3
int32_t thisLevel; // 水位
int32_t thisSpeed; // 流速
int64_t ttWater; // 累计流量 单位 m3
int32_t thisFlow; // 瞬时流量 单位 m3
int32_t thisLevel; // 水位
int32_t thisSpeed; // 流速
int32_t thisPress; // 压力
int32_t thisTemp; // 温度
int retry ; // 重试次数
} WaterData_t;
@@ -98,7 +124,7 @@ typedef enum Ctrl_Mode_t
{
CTRL_FOPEN = 0,
CTRL_ZOPEN = 1
}Ctrl_Mode_t;
} Ctrl_Mode_t;
typedef enum MotorType_t
@@ -106,11 +132,13 @@ typedef enum MotorType_t
MT_MG_1000, // 米格1000
MT_QH_V100, // 强华 1.0 版本
MT_QH_V200, // 强华 2.0 版本
MT_ZS_V100, // 中盛 4-20 ma
MT_ZS_V100, // 中盛 4-20 ma
MT_JZ_V200, // 金志 4-20 ma
MT_DY_V100, // 大禹锥型阀
MT_KG_V100, // 开关量模块
MT_KR_V100, // 徐州正天闸位计
MT_ASC_A3, // A3驱动器
MT_ASC_WS, // 金昌无刷电机
} MotorType_t;
typedef enum S4851Type_t
@@ -118,6 +146,7 @@ typedef enum S4851Type_t
ST_MG_1000, // 米格1000
ST_QH_V100, // 强华 1.0 版本
ST_QH_V200, // 强华 2.0 版本
ST_ZS_V100, // 中盛4-20ma
ST_AT_V100, // 奥图编码器
ST_DY_V100, // 大禹锥形阀
ST_KG_V100, // 开关量模块
@@ -129,9 +158,10 @@ typedef enum S4852Type_t
ST_RDS_600, // rds600 雷达流速一体机
ST_TDS_300, // tds300 超声波流量计
ST_HT_V100, // 华天液位计
ST_ZK_JSZK, // 精水中科多普勒
ST_ZK_JSZK, // 精水中科多普勒
ST_DJX_100, // 丁家峡闸门 读取开度
ST_RDS_300, // 雷达流量计
ST_MI_600, // 鹦鸽嘴测斜仪
} S4852Type_t;
@@ -140,7 +170,7 @@ typedef enum SOFTFLOWType_t
NONE,
WATER,
PARSHALL//
}SOFTFLOWType_t;
} SOFTFLOWType_t;
@@ -151,8 +181,9 @@ typedef enum SiteType_t
SiteSee, // 渗流渗压站
SiteColl, // 采集站
SiteServer, // 串口服务器
SiteLevel // 水位站
}SiteType_t;
SiteLevel, // 水位站
SiteSkew // 测斜仪
} SiteType_t;
typedef enum DownDataType_t
@@ -167,7 +198,8 @@ typedef enum DownDataType_t
DownReboot = 7, // 重启
DownConfig = 8, // 修改参数
DownRead = 9, // 读取参数
}DownDataType_t;
DownFact = 10, // 读取参数
} DownDataType_t;
@@ -178,36 +210,40 @@ typedef struct TypeIndexMail_t
{
uint16_t Type;
uint16_t index;
}TypeIndexMail_t;
} TypeIndexMail_t;
extern SluiceData_t SluiceData[SLUICE_COUTN];
extern WaterData_t WaterData[WATER_COUTN];
extern InclinometerData_t IncData[6];
extern SysData_t SysData;
extern const WaterLeveInfo_t LeveInfo;
extern const ParShallInfo_t ParShallTale[];
extern SOFTRTC_t g_SoftRtc;
int cMotorGetType (char * str);
int c4851GetType(char * str);
int c4851GetType (char * str);
int c4852GetType(char * str);
int c4852GetType (char * str);
int cU485GetType(char *str);
int cU485GetType (char *str);
// 读取控制模式
int cCtrlGetType(char * str);
int cCtrlGetType (char * str);
int cDownType2Index(char * str);
int cDownType2Index (char * str);
int cSiteType2Index(char * str);
int cSiteType2Index (char * str);
void *GetVersion (void);
#endif