#ifndef _SYS_CONFIG_H_
#define	_SYS_CONFIG_H_


/**************************************************************************************
功能：基线硬件版本选择
说明：方壳表基线硬件版本0X14
      圆壳表基线硬件版本0X18
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000*/
#define HARDWARE_VERSION    0x14  //方壳
//#define HARDWARE_VERSION    0x18    //圆壳

/**************************************************************************************
功能：流量模型选择
说明：
22222222222222222222222222222222222222222222222222222222222222222222222222222222222222*/


//-------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------
/*当前不用的表型汇总---开始*/

/*改善型*/
//#define DN15_BRASS_40KPA_GP30_32768	1 
//#define DN20_BRASS_40KPA_GP30_32768	1
/*BM*/
//#define BM_DN15_BRASS_63KPA_GP30_32768	1 
//#define BM_DN20_BRASS_63KPA_GP30_32768	1
//#define BM_DN25_BRASS_63KPA_GP30_32768	1
//#define BM_DN32_BRASS_63KPA_GP30_32768	1
//#define BM_DN40_BRASS_63KPA_GP30_32768	1 

/*反算型*/
//#define WDFS_DN15_BRASS_40KPA_GP30_32768		1 
//#define WDFS_DN20_BRASS_40KPA_GP30_32768		1

/*误差曲线型*/
//#define LLGS_WDFS_DN15_BRASS_40KPA_GP30_32768	1 
//#define LLGS_WDFS_DN20_BRASS_40KPA_GP30_32768	1 
//#define LLGS_DN25_BRASS_40KPA_GP30_32768	1

/*当前不用的表型汇总----结束*/
//-------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------


//海外目前应用的表型
/*欧标--长款 换能器 方*/
//#define MID_DN15_BRASS_63KPA_GP30_32768	1// 长款换能器欧版保存15
//#define MID_DN20_BRASS_63KPA_GP30_32768	1// 长款换能器欧版保存20

/*PF--不添加反向计量 25~40口径*/ 
//#define PF_DN25_BRASS_63KPA_GP30_32768	1// 长款换能器欧版保存25
//#define PF_DN32_BRASS_63KPA_GP30_32768	1// 长款换能器欧版保存32
//#define PF_DN40_BRASS_63KPA_GP30_32768    1// 长款换能器欧版保存40

/*欧标--短款 换能器 方壳*/
//#define EN_DN15_BRASS_63KPA_GP30_32768	    1// 短款换能器欧版保存15
//#define EN_DN20_BRASS_63KPA_GP30_32768	1// 短款换能器欧版保存20

/*误差曲线型*/
//#define LLGS_DN15_BRASS_40KPA_GP30_32768	1
//#define LLGS_DN20_BRASS_40KPA_GP30_32768	1
//#define DN25_BRASS_40KPA_GP30_32768	1
//#define DN32_BRASS_63KPA_GP30_32768	1
//#define DN40_BRASS_63KPA_GP30_32768	1

//DN25~40灌胶改善选择开关(开启后,温度传感器使用热敏电阻)
//#define DN25_40_GJGS  1
/*圆壳表管段流量传感器
ROUND_LLGS:常规表计
ROUND_LLGS_WDFS：反算表计
ROUND_LLGS_XFZ：小封装换能器表计
*/
//#define ROUND_LLGS_DN15_BRASS_40KPA_GP30_32768	1 
//#define ROUND_LLGS_DN20_BRASS_40KPA_GP30_32768	1
//#define ROUND_LLGS_WDFS_DN15_BRASS_40KPA_GP30_32768	1 
//#define ROUND_LLGS_WDFS_DN20_BRASS_40KPA_GP30_32768	1 
//#define ROUND_LLGS_XFZ_DN15_BRASS_40KPA_GP30_32768    1  // 此程序已配置成小封装塑壳表，后续建完模需要增加表型
//#define ROUND_LLGS_XFZ_DN20_BRASS_40KPA_GP30_32768    1


//#define Buxiugang_LLGS_WDFS_DN15_BXG_40KPA_GP30_32768	1 
//#define Buxiugang_LLGS_WDFS_DN20_BXG_40KPA_GP30_32768	1 
#define Plastic_LLGS_WDFS_DN15_PALSTIC_40KPA_GP30_32768	1 

/**************************************************************************************
功能：阀控选择
说明：选择是否使用阀控功能
33333333333333333333333333333333333333333333333333333333333333333333333333333333333333*/
#define VALVE    
//#define NO_VALVE    

/**************************************************************************************
功能：通信规约的选择
说明：选择客户定制规约
44444444444444444444444444444444444444444444444444444444444444444444444444444444444444*/
//选择上报规约
#define PRODUCT_SS  1 //深水
//#define PRODUCT_JS    1 //江水 
//#define PRODUCT_SHTCP   1 //商河TCP
//#define PRODUCT_SY      1 //沈阳
//#define PRODUCT_WHYW    1 //武汉易维（孝感订单）
//#define PRODUCT_GS  1 //广水

//#define PRODUCT_BLE_SS  1
/**************************************************************************************
功能：通信模组的选择
说明：选择使用的通信模组
55555555555555555555555555555555555555555555555555555555555555555555555555555555555555*/
#define NB_MODULE_BC25  1
//#define MODULE_ML302_TCP  1
////*#define NB_MODULE_E7025 1*/
//#define NB_MODULE_MN316 1
//#define NB_MODULE_BC28 1
//#define MODULE_ML307A_TCP  1

//#define MODULE_BLE_USED  1
/**************************************************************************************
功能：选择是否使用IC卡
说明：目前只有ML302 4G有阀水表使用IC卡功能
66666666666666666666666666666666666666666666666666666666666666666666666666666666666666*/
//#define CARD_USED   1

/**************************************************************************************
功能：上报流程选择
说明：使用UPLOAD_MODE_1上报流程的规约：深水、江水、商河、沈阳、武汉易维
77777777777777777777777777777777777777777777777777777777777777777777777777777777777777*/
#define UPLOAD_MODE_1  1
//#define UPLOAD_MODE_2  1
//#define UPLOAD_MODE_3  1

/**************************************************************************************
功能：时钟频率配置
说明：
88888888888888888888888888888888888888888888888888888888888888888888888888888888888888*/
#define STM32_SYSCLK	4000000	

#if (HARDWARE_VERSION==0x14)
#if (MODULE_BLE_USED||NB_MODULE_BC28)
#define GP30_XTL 1 
#elif (NB_MODULE_BC25&&(Plastic_LLGS_WDFS_DN15_PALSTIC_40KPA_GP30_32768||Buxiugang_LLGS_WDFS_DN15_BXG_40KPA_GP30_32768||Buxiugang_LLGS_WDFS_DN20_BXG_40KPA_GP30_32768))
#define GP30_XTL 1 
#endif 
#endif
/****************************************************************************************/
/*********************************以下为自动配置项,不需要修改****************************/
/****************************************************************************************/

/**************************根据模组、温度反算、流量模型自动配置使用的硬件版本************/
#ifdef NB_MODULE_BC25
	#define HARD_MODULE_TYPE  0x00 
#elif NB_MODULE_E7025
	#define HARD_MODULE_TYPE  0x20  
#elif NB_MODULE_MN316
	#define HARD_MODULE_TYPE  0x40
#elif MODULE_ML302_TCP
	#define HARD_MODULE_TYPE  0x60 
#elif NB_MODULE_BC28
	#define HARD_MODULE_TYPE  0x80 
#elif MODULE_ML307A_TCP
	#define HARD_MODULE_TYPE  0xA0 
#elif MODULE_BLE_USED
	#define HARD_MODULE_TYPE  0xC0 
#endif

/**************************根据选择的表计类型自动配置圆壳还是方壳*******************/
//#if (HARDWARE_VERSION==0x18)
//#define ROUND_TYPE_METER    1//圆壳表2022-04-20
//#elif (HARDWARE_VERSION==0x14)
//#define RECTANGLE_TYPE_METER    1//方壳表2022-04-20
//#endif

/**************************************************************************************
功能：温度传感器配置
说明：选择使用哪一种温度传感器 (IC、热敏)
9999999999999999999999999999999999999999999999999999999999999999999999999999999999999*/
#if ROUND_LLGS_DN15_BRASS_40KPA_GP30_32768	|| ROUND_LLGS_DN20_BRASS_40KPA_GP30_32768 || ROUND_LLGS_XFZ_DN15_BRASS_40KPA_GP30_32768 || ROUND_LLGS_XFZ_DN20_BRASS_40KPA_GP30_32768  
#define  TEMP_RM   1//热敏
#endif 

#if DN25_40_GJGS
#define  TEMP_RM   1//热敏
#endif

#if  DN20_BRASS_40KPA_GP30_32768 || WDFS_DN20_BRASS_40KPA_GP30_32768 
//孙村第三台活塞台子与传统台子台差问题修正
#define Test_bench_difference_modify        1
#define TEST_BENCH_coefficient              1.005   //活塞台子校准系数（累积量）
#endif

//20211204
#if PF_DN15_BRASS_63KPA_GP30_32768 || PF_DN20_BRASS_63KPA_GP30_32768 || PF_DN25_BRASS_63KPA_GP30_32768 || PF_DN32_BRASS_63KPA_GP30_32768 || PF_DN40_BRASS_63KPA_GP30_32768 
#define PF_TYPE_METER  1
#endif

#if EN_DN15_BRASS_63KPA_GP30_32768 || EN_DN20_BRASS_63KPA_GP30_32768
#define EN_TYPE_METER 1
#endif

#if MID_DN15_BRASS_63KPA_GP30_32768  || MID_DN20_BRASS_63KPA_GP30_32768  
#define MID_TYPE_METER 1
#endif

// 每个型号 整一个表型 
#if PF_TYPE_METER || BM_DN15_BRASS_63KPA_GP30_32768   || BM_DN20_BRASS_63KPA_GP30_32768   || BM_DN25_BRASS_63KPA_GP30_32768 	|| BM_DN32_BRASS_63KPA_GP30_32768 || BM_DN40_BRASS_63KPA_GP30_32768 \
	||MID_TYPE_METER || EN_TYPE_METER  
	
	
#define  OVERSEAS_TYPE_METER  1    //海外 
#else 
#define  DOMESTIC_TYPE_METER  1    //国内 
#endif 

/*使用大滤波 2022-01-10*/
//#if LLGS_DN15_BRASS_40KPA_GP30_32768||LLGS_DN20_BRASS_40KPA_GP30_32768 ||PF_TYPE_METER || EN_TYPE_METER || ROUND_TYPE_METER || MID_TYPE_METER || DN25_BRASS_40KPA_GP30_32768 || DN32_BRASS_63KPA_GP30_32768||DN40_BRASS_63KPA_GP30_32768 || LLGS_HYBRID_DN15_BRASS_40KPA_GP30_32768 || LLGS_HYBRID_DN20_BRASS_40KPA_GP30_32768

#define EN_LARGE_FILITER  	1 
//#else
//#define EN_SMALL_FILITER  	1
//#endif

#if PF_DN32_BRASS_63KPA_GP30_32768 || PF_DN40_BRASS_63KPA_GP30_32768  || PF_DN25_BRASS_63KPA_GP30_32768 || DN25_BRASS_40KPA_GP30_32768 || DN32_BRASS_63KPA_GP30_32768 || DN40_BRASS_63KPA_GP30_32768
#define ERROR_MODIFY_CRUVE_FOR_SMALL_FLOW  1//小流量分段标志
#endif

//反算是否开关
#if WDFS_DN15_BRASS_40KPA_GP30_32768 || WDFS_DN20_BRASS_40KPA_GP30_32768 || LLGS_WDFS_DN15_BRASS_40KPA_GP30_32768 || LLGS_WDFS_DN20_BRASS_40KPA_GP30_32768 || ROUND_LLGS_WDFS_DN15_BRASS_40KPA_GP30_32768 || ROUND_LLGS_WDFS_DN20_BRASS_40KPA_GP30_32768 \
|| Buxiugang_LLGS_WDFS_DN15_BXG_40KPA_GP30_32768||Buxiugang_LLGS_WDFS_DN20_BXG_40KPA_GP30_32768 || Plastic_LLGS_WDFS_DN15_PALSTIC_40KPA_GP30_32768
#define WENDU_FANSUAN_OPEN                  1
#endif

// #if LLGS_DN15_BRASS_40KPA_GP30_32768 || LLGS_DN20_BRASS_40KPA_GP30_32768 || LLGS_DN25_BRASS_40KPA_GP30_32768 || LLGS_WDFS_DN15_BRASS_40KPA_GP30_32768 || LLGS_WDFS_DN20_BRASS_40KPA_GP30_32768 || PF_TYPE_METER || EN_TYPE_METER || ROUND_TYPE_METER || MID_TYPE_METER  \
//||DN25_BRASS_40KPA_GP30_32768 ||DN32_BRASS_63KPA_GP30_32768||DN40_BRASS_63KPA_GP30_32768 || LLGS_HYBRID_DN15_BRASS_40KPA_GP30_32768 || LLGS_HYBRID_DN20_BRASS_40KPA_GP30_32768
#define LILUNGONGSHI_MODLE_WATER_METER    1 
//#endif



#if WENDU_FANSUAN_OPEN  //温度反算
	#define HARDWARE_VERSION_USE_1    (HARDWARE_VERSION|HARD_MODULE_TYPE|0x02)
#else
	#define HARDWARE_VERSION_USE_1    (HARDWARE_VERSION|HARD_MODULE_TYPE)
#endif

#if LILUNGONGSHI_MODLE_WATER_METER   //理论公式
	#if defined(VALVE)
		#if defined(TEMP_RM)
			#define HARDWARE_VERSION_USED    ((HARDWARE_VERSION_USE_1|HARD_MODULE_TYPE|0x01)-0x10)//阀控灌胶改善(插片结构)
		#else
			#define HARDWARE_VERSION_USED    (HARDWARE_VERSION_USE_1|HARD_MODULE_TYPE|0x01)
		#endif
	#else
		#if defined(TEMP_RM)
			#define HARDWARE_VERSION_USED    ((HARDWARE_VERSION_USE_1|HARD_MODULE_TYPE|0x01)-0x10)
		#else
			#define HARDWARE_VERSION_USED    (HARDWARE_VERSION_USE_1|HARD_MODULE_TYPE|0x01)
		#endif
	#endif	
#else
	#define HARDWARE_VERSION_USED    (HARDWARE_VERSION_USE_1|HARD_MODULE_TYPE)
#endif

#if PRODUCT_SS
	#if Buxiugang_LLGS_WDFS_DN15_BXG_40KPA_GP30_32768  || Buxiugang_LLGS_WDFS_DN20_BXG_40KPA_GP30_32768
		#define PROGRAME_VERSION    (0xB7280000|HARDWARE_VERSION_USED)  //软件版本号
	#else
		#define PROGRAME_VERSION    (0xB2280000|HARDWARE_VERSION_USED)  //软件版本号
	#endif
#elif PRODUCT_JS
	#define PROGRAME_VERSION    (0xC2270000|HARDWARE_VERSION_USED)  //软件版本号
#elif PRODUCT_SHTCP
	#define PROGRAME_VERSION    (0xD2270000|HARDWARE_VERSION_USED)  //软件版本号
#elif PRODUCT_SY
	#define PROGRAME_VERSION    (0xF2270000|HARDWARE_VERSION_USED)  //软件版本号 (定义为E?)
#elif PRODUCT_WHYW
	#define PROGRAME_VERSION    (0x12270000|HARDWARE_VERSION_USED)  //软件版本号 (定义为E?)
#elif PRODUCT_GS
	#define PROGRAME_VERSION    (0x22270000|HARDWARE_VERSION_USED)  //软件版本号
#elif PRODUCT_BLE_SS
	#if Buxiugang_LLGS_WDFS_DN15_BXG_40KPA_GP30_32768  || Buxiugang_LLGS_WDFS_DN20_BXG_40KPA_GP30_32768
		#define PROGRAME_VERSION    (0x37260000|HARDWARE_VERSION_USED)  //软件版本号
	#else
		#define PROGRAME_VERSION    (0x32260000|HARDWARE_VERSION_USED)  //软件版本号
	#endif
#endif
/***************************标记表类型和口径****************************************/

/**************************根据选择的模组型号自动配置包含的头文件*******************/
#if NB_MODULE_E7025
	#include "nb_driver_e7025.h"
	#include "nb_uart_driver_e7025.h"
#elif NB_MODULE_BC25
	#include "nb_driver_bc25.h"
	#include "nb_uart_driver_bc25.h"
#elif NB_MODULE_MN316
	#include "nb_uart_driver_mn316.h"
	#include "nb_driver_mn316.h"
#elif NB_MODULE_BC28
	#include "nb_driver_bc28.h"
	#include "nb_uart_driver_bc28.h"
#elif MODULE_ML302_TCP
	#include "nb_driver_ml302.h"
	#include "nb_uart_driver_ml302.h"
#elif MODULE_ML307A_TCP
	#include "nb_driver_ml307a.h"
	#include "nb_uart_driver_ml307a.h"
#elif MODULE_BLE_USED
	#include "ble14531_uart_driver.h"
	#include "ble14531_driver.h"
#endif
/**************************根据选择的规约类型自动配置包含的头文件*******************/
#if PRODUCT_SS
#include "UWater_frame_func_ReplyNB.h"
#include "UWater_frame_func_ReplyWT.h"
#include "UWater_frame_func_ReplyShenShui.h"
#include "UWater_QZ_Store_App.h"
#elif PRODUCT_JS
#include "UWater_frame_func_ReplyNB.h"
#include "UWater_frame_func_ReplyWT.h"
#include "UWater_JX_Store_App.h" 
#include "UWater_frame_func_ReplyJiangShui.h"
#elif PRODUCT_SHTCP
#include "UWater_frame_func_ReplyNB.h"
#include "UWater_frame_func_ReplyWT.h"
#include "UWater_frame_func_ReplyShangHe.h"
#include "UWater_QZ_Store_App.h"
#elif PRODUCT_SY
#include "UWater_frame_func_ReplyNB.h"
#include "UWater_frame_func_ReplyWT.h"
#include "UWater_frame_func_ReplySYNB.h"
#include "UWater_QZ_Store_App.h"
#include "UWater_SY_Store_App.h"
#elif PRODUCT_WHYW
#include "UWater_frame_func_ReplyNB.h"
#include "UWater_frame_func_ReplyWT.h"
#include "UWater_frame_func_ReplyWuHanYW.h"
#include "UWater_QZ_Store_App.h"
#elif PRODUCT_GS
#include "UWater_frame_func_ReplyNB.h"
#include "UWater_frame_func_ReplyWT.h"
#include "UWater_frame_func_ReplyGuangShui.h"
#include "UWater_QZ_Store_App.h"
#elif PRODUCT_BLE_SS
#include "UWater_frame_func_ReplyNB.h"
#include "UWater_frame_func_ReplyWT.h"
#include "UWater_frame_func_ReplyBLE.h"
#include "UWater_QZ_Store_App.h"
#endif

#if CARD_USED
#include "UWater_card_5557_driver.h"
#include "UWater_card_5557_app.h"
#endif




#endif


