/*******************************************************************************
版权所有：	
版本号：    1.00 
文件名：    set.c 
生成日期：  2008.8.16    
作者：      
功能说明：定值结构和定值修改
    
修改日志：  
日志1：           
修改者：    
修改日期：
修改内容：
修改原因：
****************************************************************************/
#include "head.h"
#ifdef CPU_FUXI
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
// #include "shm_comm_packet.h"
#include "shmem.h"
#else
#include "uart_user.h"
#include <linux/kmod.h>
#endif

#define MAX_3(x,y,z) (x>y?(x>z?x:z):(y>z?y:z))
#define MIN_3(x,y,z) (((x>y?y:x)>z)?z:(x>y?y:x))

#define MIN_2(x,y)	(x>y?y:x)

u8	g_creat_set_file = 0;
u16 g_crc_set_desc;
u16 g_crc_set_data;

TSECTIONINFO tSecInfo;//定值信息(包括定值区号及有效定值区)

RUN_PARA   tRunPara;
TSET tRunSet[2];              //运行定值缓冲区
TSET tBakSet;
TSET *pRunSet=&tRunSet[0];
bool bRunSetModify;
uint32_t g_debugnet_ip, g_debugnet_mask,g_debugnet_gate;//调试网口IP,MASK,GATE等网络参数
WORD m_runsection=0;

SET_PARAID tParaID[MAX_SET_NUMBER];
int ParaIDNum;
#ifdef YPARA_LINK
SET_PARA_VAL tPara_val[MAX_SET_NUMBER];
#endif

bool gb_yx_ac=false;

const char *SetUints[]=  //单位符号定义，对应定值
{
	"",  					//0 无单位
	"V", 
	"A",  					// 
	"s",  					//4
	"天",  					//4
	"％", 	
	"°", 		
	"W",  	
	"Var",  					//4
	"H",
	"时",
	"kV",
	"ms",
	"分",
	"Hz",
	"％Un",
	"Hz/s",
	"V/s",
	
};

BH_SET_GROUP SetGroups[]=  //单位符号定义，对应定值
{
			
	{SETGROUP_TYPE_BY			,0 ,		0,				GROUP_SET_BY,		"备用定值", 		"备用",				},				
	{SETGROUP_TYPE_BH			,1 ,		SET_HYB_BH, 	GROUP_SET_BHTT,		"保护定值", 		"保护控制字",		},			
	{SETGROUP_TYPE_BH			,1 ,		SET_HYB_BH, 	GROUP_SET_BHDZ,		"保护定值", 		"保护定值", 			},

#ifdef FUN_JDXX
    {SETGROUP_TYPE_BH			,1 ,		0,				GROUP_SET_JDXX, 	"保护定值", 		"接地选线", 			},
#endif

#if defined GD_AREA_ECZD_2020  || defined GD_AREA_HEYUAN_2021
	{SETGROUP_TYPE_BH			,1 ,		SET_HYB_BH, 	GROUP_SET_BHYB, 	"保护定值", 		"保护软压板",	},		
#endif

	{SETGROUP_TYPE_BH			,1 ,		SET_HYB_BH, 	GROUP_SET_FSX,		"保护定值", 		"反时限",				},	

#ifdef GD_AREA_ECZD_2020
	{SETGROUP_TYPE_TQ			,1 ,		SET_HYB_TQ,		GROUP_SET_TQHZ,		"保护定值", 		"同期合闸", 			},			
	{SETGROUP_TYPE_JL			,1 ,		SET_HYB_JL,		GROUP_SET_DYJL,		"保护定值", 		"电压解列", 			},	
	{SETGROUP_TYPE_JL			,1 ,		SET_HYB_JL,		GROUP_SET_PLJL,		"保护定值", 		"频率解列", 			},	
#elif defined GD_AREA_PANYU_TEST//广东番禺测试安自功能在所有模式下显示
	{SETGROUP_TYPE_AZ			,1 ,		0,				GROUP_SET_TQHZ,		"保护定值", 		"同期合闸", 			},			
	{SETGROUP_TYPE_AZ			,1 ,		0,				GROUP_SET_DYJL,		"保护定值", 		"电压解列", 			},	
	{SETGROUP_TYPE_AZ			,1 ,		0,				GROUP_SET_PLJL,		"保护定值", 		"频率解列", 			},	
#else
	{SETGROUP_TYPE_AZ			,1 ,		SET_HYB_BH,		GROUP_SET_TQHZ,		"保护定值", 		"同期合闸", 			},			
	{SETGROUP_TYPE_AZ			,1 ,		SET_HYB_BH,		GROUP_SET_DYJL,		"保护定值", 		"电压解列", 			},	
	{SETGROUP_TYPE_AZ			,1 ,		SET_HYB_BH,		GROUP_SET_PLJL,		"保护定值", 		"频率解列", 			},	
#endif
#ifdef FUNC_SEL_MODE_FA
	{SETGROUP_TYPE_BH			,1 ,		0,				GROUP_SET_FA_SEL,	"保护定值", 		"FA功能选择控制字", 			},	
#endif
#ifdef	GD_AREA_HEYUAN//河源要求名称显示不一致
	{SETGROUP_TYPE_BH			,1 ,		SET_HYB_FA, 	GROUP_SET_FATT,		"保护定值", 		"馈线自动化控制字", 	},			
	{SETGROUP_TYPE_BH			,1 ,		SET_HYB_FA, 	GROUP_SET_FADZ,		"保护定值", 		"馈线自动化定值",		},			
#else
	{SETGROUP_TYPE_BH			,1 ,		SET_HYB_FA, 	GROUP_SET_FATT,		"保护定值", 		"电压电流型控制字", 	},			
	{SETGROUP_TYPE_BH			,1 ,		SET_HYB_FA, 	GROUP_SET_FADZ,		"保护定值", 		"电压电流型定值",		},			
#endif
#if defined GD_AREA_ECZD_2020 ||defined GD_AREA_HEYUAN_2021
	{SETGROUP_TYPE_BH			,1 ,		SET_HYB_FA, 	GROUP_SET_FAYB, 	"保护定值", 		"电压电流型软压板",		},			
#endif


#if defined GD_AREA_HEYUAN_KL || (defined GD_AREA_CHAOZHOUFENGXI && !defined GD_AREA_ECZD_2020)//科陆河源要求智能分布式要在FA模式下显示
	{SETGROUP_TYPE_BH			,1 ,		SET_HYB_FA,		GROUP_SET_GOOSETT,	"保护定值", 		"分布式控制字", 	},			
	{SETGROUP_TYPE_BH			,1 ,		SET_HYB_FA,		GROUP_SET_GOOSEDZ,	"保护定值", 		"分布式FA定值", 	},
#else
	{SETGROUP_TYPE_BH			,1 ,		SET_HYB_GOOSE,	GROUP_SET_GOOSETT,	"保护定值", 		"分布式控制字",	},			
	{SETGROUP_TYPE_BH			,1 ,		SET_HYB_GOOSE,	GROUP_SET_GOOSEDZ,	"保护定值", 		"分布式FA定值",	},
#endif

#ifdef	CUSTOMIZE_BZT //备自投
	{SETGROUP_TYPE_BH			,1 ,		SET_HYB_BH, 	GROUP_SET_BZT,		"保护定值", 		"备自投",				},	
#endif

#ifdef GD_AREA_PANYU_TEST//广东番禺测试软压板在保护模式下显示
	{SETGROUP_TYPE_BH			,1 ,		SET_HYB_BH,		GROUP_SET_YB,					"保护定值", 		"软压板",				},				
#else
	{SETGROUP_TYPE_BH			,1 ,		0, 				GROUP_SET_YB,					"保护定值", 		"软压板",				},				
#endif
	{SETGROUP_TYPE_BH			,1 ,		0,				GROUP_SET_SWSET,	"保护定值", 		"辅助定值", 			},

#ifdef BH_FA_INONE_SW
	{SETGROUP_TYPE_BH 		,1 ,		0,				GROUP_SET_MODE, 	"保护定值", 		"控制字",			},
	{SETGROUP_TYPE_BH 		,1 ,		0,				GROUP_SET_SOFT, 	"保护定值", 		"软压板",			},
#endif
#ifdef FUNC_DRIVE_JY
	{SETGROUP_TYPE_BH			,1 ,		0,				GROUP_SET_DRIVE,	"保护定值", 		"传动功能", 	},
#endif

#if defined GD_AREA_ECZD_2020 && !defined GD_AREA_ECZD_SHAOGUAN_2021 //2020二次指导意见 2020-9-13
	{SETGROUP_TYPE_PUB			,1 ,		0,				GROUP_SET_SCT,		"公共定值", 		"定值区", 			},
#endif
	{SETGROUP_TYPE_PUB			,1 ,		0,				GROUP_SET_EQPPARA,	"公共定值", 		"设备参数", 		},

	{SETGROUP_TYPE_PUB			,1 ,		0,				GROUP_SET_PUBSET,	"公共定值", 		"电压参数", 			},
	{SETGROUP_TYPE_PUB			, 1,		0,				GROUP_SET_FDL,		"公共定值", 		"非电量",					},
	{SETGROUP_TYPE_PUB			, 1,		0,				GROUP_SET_STANDBY,		"公共定值", 		"备用定值",					},
	{SETGROUP_TYPE_PUB			, 1,		0,				GROUP_SET_OTHERS_PUB,	"公共定值", 		"其它",			},

	{SETGROUP_TYPE_PARA 		,1 ,		0,				GROUP_PARA_PROTOCAL,"装置参数", 		"规约参数", 			},
	{SETGROUP_TYPE_PARA 		,1 ,		0,				GROUP_PARA_LINK,	"装置参数", 		"104子站通信",		},
	{SETGROUP_TYPE_PARA 		,1 ,		0,				GROUP_PARA_SERIAL,	"装置参数", 		"串行口通信",			},
	{SETGROUP_TYPE_PARA 		,1 ,		0,				GROUP_PARA_ETHERNET,"装置参数", 		"以太网参数",			},
	{SETGROUP_TYPE_PARA 		,1 ,		0,				GROUP_PARA_TIME,	"装置参数", 		"对时参数", 					},
	{SETGROUP_TYPE_PARA 		,1 ,		0,				GROUP_PARA_BATTERY,	"装置参数", 		"电池管理", 			},
	{SETGROUP_TYPE_PARA 		,1 ,		0,				GROUP_PARA_RMT,		"装置参数", 		"远动参数", 			},
	{SETGROUP_TYPE_PARA 		,1 ,		0,				GROUP_PARA_OTHERS,	"装置参数", 		"辅助参数", 	},
#ifdef FUN_FUXI_ESAM
	{SETGROUP_TYPE_PARA 		,1 ,		0,				GROUP_PARA_S1,		"装置参数", 		"南网加密配置", 	},
#endif
#ifdef METERING_ENERGY
	{SETGROUP_TYPE_PARA 		,1 ,		0,				GROUP_PARA_HISFILE,	"装置参数", 		"历史文件", 	},
#endif

	{SETGROUP_TYPE_CSTSET		,1 ,		0,				GROUP_CSTSET_PROTECT,"内部定值", 			"保护逻辑", 	},
	{SETGROUP_TYPE_CSTSET		,1 ,		0,				GROUP_CSTSET_CALC,	"内部定值", 			"计算功能", 	},
	{SETGROUP_TYPE_CSTSET		,1 ,		0,				GROUP_CSTSET_COMM,	"内部定值", 			"通信功能", 	},
	{SETGROUP_TYPE_CSTSET		,1 ,		0,				GROUP_CSTSET_FA,	"内部定值", 			"FA功能",			},
	{SETGROUP_TYPE_CSTSET		,1 ,		0,				GROUP_CSTSET_RECORD,"内部定值", 			"录波功能", 	},
	{SETGROUP_TYPE_CSTSET		,1 ,		0,				GROUP_CSTSET_OTHERS,"内部定值", 			"辅助定值", 	},
	
};

//保护投退列表
const  SET_LIST TTList[]=
{
	{"退 出", 0 ,},
	{"投 入", 1 ,},	
};
#define TTListNum	sizeof(TTList)/sizeof(SET_LIST)

const  SET_LIST LinkList[]=
{
	{"串口1", 0 ,},
	{"串口2", 1 ,},
	{"串口3", 2 ,},
	{"串口4", 3 ,},
	{"串口5", 4 ,},
	{"串口6", 5 ,},
	{"网口1", 6 ,},
	{"网口2", 7 ,},
};
#define LinkListNum	sizeof(LinkList)/sizeof(SET_LIST)


//装置类型类表
const  SET_LIST EQUList[]=
{
	{"测控装置", 0 ,},
	{"管理机装置", 1 ,},	
};
#define EQUListNum	sizeof(EQUList)/sizeof(SET_LIST)

//电压输入方式
const  SET_LIST VOLTYPEList[]=
{
	{"电源电压 ", 0 ,},
	{"测量电压 ", 1 ,},	
	{"测量+电源", 2 ,},	
};
#define VOLTYPEListNum	sizeof(VOLTYPEList)/sizeof(SET_LIST)

const  SET_LIST DISPMODEList[]=
{
	{"二次值", 0,},
	{"一次值", 1,},	
};
#define DISPMODEListNum	sizeof(DISPMODEList)/sizeof(SET_LIST)

// 系统接地方式
const  SET_LIST JDTYPE[]=
{
	{"中性点不接地  ", 0 ,},
	{"经消弧线圈接地", 1,},	
	{"经小电阻接地  ", 2,},	
	{"经高阻接地  ", 3,},		
};
#define JDTYPENum	sizeof(JDTYPE)/sizeof(SET_LIST)

const  SET_LIST XDLQDList[]=
{
	{"零序电压", 0,},
	{"零序电流", 1,},	
};
#define XDLQDListNum	sizeof(XDLQDList)/sizeof(SET_LIST)

#ifdef GD_TEST_2021
//告警合闸投退列表
const  SET_LIST GJHZList[]=
{
	{"退 出", 0,},	
	{"告 警", 1,},	
	{"合 闸", 2,},	
};
#define GJTZListNum	sizeof(GJHZList)/sizeof(SET_LIST)
#endif

//告警跳闸投退列表
const  SET_LIST TZList[]=
{
	{"告 警", 0,},	
	{"跳 闸", 1 ,},	
};
#define TZListNum	sizeof(TZList)/sizeof(SET_LIST)
//告警跳闸投退列表
const  SET_LIST HZList[]=
{
	{"合 闸", 0 ,},	
	{"告 警", 1,},	
};
#define HZListNum	sizeof(HZList)/sizeof(SET_LIST)

//跳闸检出投退列表
#ifdef GD_AREA_SHANTOU
const  SET_LIST TZCKList[]=
{	
	{"告 警", 0,},	
	{"跳 闸", 1,},	
	{"退 出", 2,},
};
#else
const  SET_LIST TZCKList[]=
{
	{"退 出", 0 ,},
	{"告 警", 1,},	
	{"跳 闸", 2 ,},	
};
#endif
#define TZCKListNum	sizeof(TZCKList)/sizeof(SET_LIST)

//告警跳闸投退列表
const  SET_LIST TZGJList[]=
{
	{"退 出       ", 0 ,},
	{"跳 闸       ", 1 ,},	
	{"告 警       ", 2,},	
	{"告 警+跳闸", 3,},	
};
#define TZGJListNum	sizeof(TZGJList)/sizeof(SET_LIST)

const  SET_LIST FSXList[]=
{
	{"一般反时限", RVS_STD ,},
	{"非常反时限", RVS_VERY ,},	
	{"极端反时限", RVS_EXT ,},	

};
#define FSXListNum	sizeof(FSXList)/sizeof(SET_LIST)

const  SET_LIST CHZList[]=
{
	{"一次重合闸", 1 ,},
	{"二次重合闸", 2 ,},	
	{"三次重合闸", 3 ,},	

};
#define CHZListNum	sizeof(CHZList)/sizeof(SET_LIST)

const  SET_LIST CHJSList[]=
{
	{"后加速", 0 ,},
	{"前加速", 1 ,},	
};
#define CHJSListNum	sizeof(CHJSList)/sizeof(SET_LIST)

const  SET_LIST KGFunList[]=
{
#if (defined GD_AREA_ECZD_2020) || (defined GD_AREA_SHANWEI) ||defined GD_AREA_HEYUAN_2021_2021
	{"联络", 0 ,},  
	{"分段", 1,},
#else
	{"无效", 0,},
	{"分段", LINE_TYPE_FD,},
	{"联络", LINE_TYPE_LL ,},	 //
#endif	
};
#define KGFunListNum	sizeof(KGFunList)/sizeof(SET_LIST)

const  SET_LIST KGFun1List[]=
{
	{"分段联络", 0 ,},
	{"分界    ", 1 ,},	
};
#define KGFun1ListNum	sizeof(KGFun1List)/sizeof(SET_LIST)

#ifdef	CUSTOMIZE_BZT //备自投
const  SET_LIST BZTFSList[]=
{
	{"分段", 0 ,},
	{"进线", 1 ,},	
	{"互投", 2 ,},
	//{"单进线", 3 ,},
	{"自复", 3 ,},
};
#define BZTFSListNum	sizeof(BZTFSList)/sizeof(SET_LIST)
#endif

const  SET_LIST HHFunList[]=
{
	{"退出    ", 0 ,},
	{"合环闭锁", 1 ,},	
	{"同期合闸", 2 ,},	
};
#define HHFunListNum	sizeof(HHFunList)/sizeof(SET_LIST)

const  SET_LIST BaudList[]=  // 波特率列表
{
	{"600  ",600 ,},
	{"1200 ",1200 ,},
	{"2400 ",2400 ,},
	{"4800 ",4800 ,},
	{"9600 ",9600 ,},
	{"19200",19200,},
	{"38400",38400,},
	{"57600",57600,},
	{"115200",115200,},
};
#define BaudListNum	sizeof(BaudList)/sizeof(SET_LIST)

const  SET_LIST ParityList[]=  //校验位列表
{
	{"偶校验",PARITY_EVEN,},
	{"奇校验",PARITY_ODD ,},
	{"无校验",PARITY_NONE_1,},
};
#define ParityListNum	sizeof(ParityList)/sizeof(SET_LIST)

const  SET_LIST ProtocolList[]=  // 规约类型列表
{
	{"子站非平衡101", 		PROTOCOL_101 ,},
	{"子站平衡式101", 		PROTOCOL_101_PH,},
	{"IEC104       ", 		PROTOCOL_104 ,},
	{"主站非平衡101", 		PROTOCOL_101_M ,},
	{"主站平衡式101", 		PROTOCOL_101_PH_M,},
	{"主站MODBUS   ", 	PROTOCOL_MODBUS,},
	{"状态板       ", 		PROTOCOL_FAULT,},
	{"面板         ", 		PROTOCOL_HMI,},
	{"数显仪表     ", 		PROTOCOL_SXYB,},
	{"维护规约     ", 		PROTOCOL_MAINTAIN,},	
	{"GPS模块      ", 		PROTOCOL_GPS,},
	{"蓝牙加密模块  ", 		PROTOCOL_AUTHOR_BL,},
	{"其它应用     ", 		PROTOCOL_IDLE,}, // 本应用程序完全不初始化、不使用。供其它程序(例如通讯子站，内部GPRS等)使用	
#ifdef BATTERY_WITH_COMM
	#ifdef FUNC_SEL_BAT_MODULE
	{"兴通力规约   ",		PROTOCOL_POWER_MOD,},
	{"中电规约     ",		PROTOCOL_PWRM,},
	#else
	{"电源模块规约",		 PROTOCOL_POWER_MOD,},
	#endif
#endif
	{"     无      ", 	PROTOCOL_NULL,},
#ifdef FUNC_ENCRY_IN_ONE_SERIAL
	{"纬德多隧道   ", 	PROTOCOL_WED_ENC,},
#endif
};
#define ProtocolListNum	sizeof(ProtocolList)/sizeof(SET_LIST)

const  SET_LIST TimeList[]=  //对时方式
{
	{"网络对时     ",0,},
	{"B码对时      ",1 ,},
	{"B码对时(带年)",2 ,},
	{"秒脉冲对时   ",3 ,},
	{"1588对时     ",4 ,},
};
#define TimeListNum sizeof(TimeList)/sizeof(SET_LIST)

const  SET_LIST TimeListSelect[]=  //标准化对时方式选择
{
	{"全方式对时	",0,},
	{"仅卫星对时	",1 ,},
	{"仅主站对时	",2 ,},
	{"仅时间同步装置",3 ,},
};
#define TimeListSelectNum sizeof(TimeListSelect)/sizeof(SET_LIST)

const  SET_LIST PTTypeList[]=  //对时方式
{
	{"单  点",0,},
	{"双  点",1 ,},
	{"单双点",2 ,},
	
};
#define  PTTypeListNum sizeof(PTTypeList)/sizeof(SET_LIST)

const  SET_LIST YCTypeList[]=  //遥测类型
{
	{"规一化值",0,},
	{"标度化值",1 ,},
	{"浮点数值",2 ,},
};
#define  YCTypeListNum sizeof(YCTypeList)/sizeof(SET_LIST)

const  SET_LIST YCTypeDead[]=  //遥测死区类型
{
	{"额定值",0,},
	{"当前值",1 ,},
};
#define  YCTypeDeadNum sizeof(YCTypeDead)/sizeof(SET_LIST)

const  SET_LIST IEC101AddrList[]=  // 101规约地址个数
{
	{"单字节",0,},
	{"双字节",1 ,},
};
#define IEC101AddrListNum sizeof(IEC101AddrList)/sizeof(SET_LIST) 

// 字节个数
const SET_LIST AddrNumList[]=
{
    {"两字节", 0,},
    {"三字节", 1,},
};
#define AddrNumListNum (sizeof(AddrNumList) / sizeof(SET_LIST))

const  SET_LIST Net_Eth_List[]=  //网卡地址列表
{
	{"网口1",0,},
	{"网口2",1,},
	{"网口3",2,},
};
#define Net_Eth_ListNum  sizeof(Net_Eth_List)/sizeof(SET_LIST) 

const  SET_LIST WFList[]=  //录波文件格式
{
	{"ASCII",0,},
	{"BINARY",1,},
};
#define WFListNum  sizeof(WFList)/sizeof(SET_LIST) 

const SET_LIST FA_List[]=
{
	{"自适应综合型  ",0,},
	{"电压时间型    ",1,},
	{"电压电流时间型",2,},
};
#define FA_ListNum sizeof(FA_List)/sizeof(SET_LIST) 

//加密功能投退列表
const  SET_LIST JMList[]=
{
	{"退    出",    0,},
	{"软件加密", 1,},	
	{"芯片加密", 2,},	
};
#define JMListNum	sizeof(JMList)/sizeof(SET_LIST)
#ifdef FIX_PARAM_FORMAT
const  SET_LIST TULF8List[]=
{
	{"G B K ",    0,},
	{"Utf-8 ", 1,},	
	{"UNICODE", 2,},	
};
#define TULF8ListNum	sizeof(TULF8List)/sizeof(SET_LIST)
#endif

//加密功能投退列表
const  SET_LIST T104ServerList[]=
{
	{"服务器",    0,},
	{"客户端", 1,},	
};
#define T104ServerListNum	sizeof(T104ServerList)/sizeof(SET_LIST)

const  SET_LIST HisFileFormatList[]=
{
	{"msg格式",    0,},
	{"xml格式", 1,},	
};
#define HisFileFormatListNum	sizeof(HisFileFormatList)/sizeof(SET_LIST)

//电压选择功能投退列表
const  SET_LIST TVolSelList[]=
{
	{"Uab1",    PUB_AC_UAB1,},
	{"Ubc1",    PUB_AC_UBC1,},
	{"Uca1",    PUB_AC_UCA1,},
	{"Uab2",    PUB_AC_UAB2,},
	{"Ubc2",    PUB_AC_UBC2,},
	{"Uca2",    PUB_AC_UCA2,},
	{"Us1 ",      PUB_AC_US1,},
	{"Us2 ",     PUB_AC_US2,},	
	{"U01 ",      PUB_AC_U01,},
	{"U02 ",     PUB_AC_U02,},	
#ifdef FUN_JDXX
	{"Ua1 ",	PUB_AC_UA1,},
	{"Ua2 ",	PUB_AC_UA2,},
#endif
};
#define TVolSelListNum	sizeof(TVolSelList)/sizeof(SET_LIST)

#ifdef	CUSTOMIZE_BZT //备自投
const  SET_LIST TISelList[]=
{
	{"BIA", SW_AC_IA},
	{"BIB", SW_AC_IB},
	{"BIC", SW_AC_IC},
	{"CIA", SW_AC_CIA},
	{"CIB", SW_AC_CIB},
	{"CIC", SW_AC_CIC},	
};
#define TISelListNum	sizeof(TISelList)/sizeof(SET_LIST)
#endif

const  SET_LIST TGooseKG[]=
{
#ifdef GD_AREA_ECZD_2020
    /*#ifdef GD_AREA_ZHONGSHAN_2020
	{"首 开 关", 0,},	
	{"分段开关",	1,},
	{"支线开关", 2,},	
	{"联络开关", 3,},
	#else*/
	{"其  他", 0,},
	{"首开关", 1,},	
	{"末开关",    2,},
	//#endif
#else
	{"首 开 关", 0,},	
	{"分段开关",	1,},
	{"支线开关", 2,},	
	{"联络开关", 3,},
#endif
};
#define TGooseKGNum	sizeof(TGooseKG)/sizeof(SET_LIST)

const  SET_LIST TGooseKGWZTYPE[]=
{
	{"主环开关", 0,},	
	{"支线开关",    1,},
};
#define TGooseKGWZTYPENum	sizeof(TGooseKGWZTYPE)/sizeof(SET_LIST)

const  SET_LIST TGooseFA[]=
{
	{"速动型",    0,},
	{"缓动型", 1,},	
};
#define TGooseFANum	sizeof(TGooseFA)/sizeof(SET_LIST)

const  SET_LIST THHTYPE[]=
{
	{"开环",    0,},
	{"闭环", 1,},	
};
#define THHTYPENum	sizeof(THHTYPE)/sizeof(SET_LIST)

const  SET_LIST TPT_Type[]=
{
    {"单相PT  ", 0,},
    {"VV接线PT", 1,},
    {"YY接线PT", 2,},
};
#define TPT_TypeNum	sizeof(TPT_Type)/sizeof(SET_LIST)

const  SET_LIST PUList[]=
{
	{"UAB2",    0,},
	{"UBC2",    1,},
	{"UCA2", 	2,},	
};
#define TPT_UNum	sizeof(PUList)/sizeof(SET_LIST)

const  SET_LIST TFA_Type[]=
{
	{"无效      ",    0,},
	{"不依赖通信",    1,},
	{"依赖通信  ", 2,},	
};
#define TFA_TypeNum	sizeof(TFA_Type)/sizeof(SET_LIST)

const  SET_LIST GOOSE_NET_List[]=
{
	{"NORMAL", 0,},
	{"H S R ", 1,},	
	{"P R P ", 2,},	
};
#define GOOSE_NET_ListNum	sizeof(GOOSE_NET_List)/sizeof(SET_LIST)

#ifdef GD_TEST_2021
	const SET_LIST TFGKEY_Type[]=
	{
		{"复归",    0,},
		{"解锁",    1,},
		{"复位",    2,},	
	};
	#define TFGKEY_TYPE_TOTAL	sizeof(TFGKEY_Type)/sizeof(SET_LIST)
#endif

const  SET_LIST UYY_List[]=
{
    {"三相电压最小值",        0,},
    {"三相电压最大值", 1,},
};
#define UYY_ListNum	sizeof(UYY_List)/sizeof(SET_LIST)

//电度列表
#ifdef  METERING_ENERGY
const  SET_LIST DDList[]=
{
	{"硬件", 0 ,},
	{"软件", 1 ,},	
};
#define DDListNum	sizeof(DDList)/sizeof(SET_LIST)

const  SET_LIST JLFSList[]=
{
	{"三相四线", 0 ,},
	{"三相三线", 1 ,},	
};
#define JLFSListNum	sizeof(JLFSList)/sizeof(SET_LIST)

const  SET_LIST WGFSList[]=
{
	{"标准", 0 ,},	
	{"贵州", 1 ,},
};
#define WGFSListNum	sizeof(WGFSList)/sizeof(SET_LIST)
#endif

#ifdef FUNC_GOOSE_FA_ADD
const  SET_LIST GTZList[]=
{
	{"退 出     ", 0,},	
	{"经过FA跳闸", 1,},	
	{"直接跳闸  ", 2,},	
};
#define GTZListNum	sizeof(GTZList)/sizeof(SET_LIST)

const  SET_LIST GHZList[]=
{
	{"无 效       ", 0,},	
	{"变电站重合闸", 1,},	
	{"FA合闸      ", 2,},	
};
#define GHZListNum	sizeof(GHZList)/sizeof(SET_LIST)

const  SET_LIST GQDList[]=
{
	{"无 效           ", 0,},	
	{"过流启动        ", 1,},	
	{"变电站开关跳启动", 2,},	
	{"变电站加速跳启动", 2,},	
};
#define GQDListNum	sizeof(GQDList)/sizeof(SET_LIST)

const  SET_LIST GCHZList[]=
{
	{"无 效   ", 0,},	
	{"一次重合", 1,},	
	{"二次重合", 2,},	
};
#define GCHZListNum	sizeof(GCHZList)/sizeof(SET_LIST)
#endif
#ifdef FUNC_SEL_MODE_FA
const  SET_LIST SelFAList[]=
{
	{"退出智能分布", 0,},	
	{"投入智能分布", 1,},	
};
#define SelFAListNum	sizeof(SelFAList)/sizeof(SET_LIST)
#endif


// 小电流突变启动方式
const  SET_LIST TBLTYPE[]=
{
	{"小电流突变", 0 ,},
	{"电压突变", 1,},		
};
#define TBLTYPENum	sizeof(TBLTYPE)/sizeof(SET_LIST)

// 小信号滤波方式
const  SET_LIST FilterTYPE[]=
{
	{"三点线性", 0,},
	{"小波矩阵", 1,},	
	{"小波卷积", 2,},		
};
#define FilterTYPENum	sizeof(FilterTYPE)/sizeof(SET_LIST)

// 小波类型		优化选低维度，高维度运算量大
const  SET_LIST WaveletTYPE[]=
{
	{"haar", 0,},
	{"db2", 1,},	
	{"db3", 2,},	
	{"db4", 3,},	
	{"sym2", 4,},	
	{"sym3", 5,},	
	{"sym4", 6,},	
	{"coif1", 7,},	
	{"coif2", 8,},	
	{"coif3", 9,},	
	{"coif4", 10,},
};
#define WaveletTYPENum	sizeof(WaveletTYPE)/sizeof(SET_LIST)

int g_goose_net_type=0;

/**********************************************************************
公共定值
***********************************************************************/
const  TSETTABLE tPubSetTable[]=                                               	 // min 	 max 		     default....parID
{
#ifdef GD_AREA_ECZD_2020 //2020二次指导意见 2020-9-9
	#ifndef GD_AREA_ECZD_SHAOGUAN_2021
		{SETTYPE_LABEL, SET_NULL,	"定值区", 					0 , 		0,				0 , 	0,			0,				GROUP_SET_SCT,0X0000, NULL_R},
		#ifdef GD_AREA_ECZD_MAOMING
			{SETTYPE_UINT,	   SET_NULL,	  "当前定值区号", 				0.0,		SEC_NUMBER-1,				0,		0,			0,				GROUP_SET_SCT,0x5001, UINT_R},
			{SETTYPE_UINT,     SET_NULL,      "待召唤定值区号",     0.0,        SEC_NUMBER-1,      0,      0,          0,              GROUP_SET_SCT,0x0000, UINT_R},
		  	{SETTYPE_UINT,     SET_NULL,      "待执行定值区号",     0.0,        SEC_NUMBER-1,      0,      0,          0,              GROUP_SET_SCT,0x0000, UINT_R},
	  	#else
		  	{SETTYPE_UINT,	SET_NULL,	"定值区号", 				0.0,		SEC_NUMBER-1,				0,		0,			0,				GROUP_SET_SCT,0x5001, UINT_R},
	  	#endif
  	#endif
	
	{SETTYPE_LABEL, SET_NULL,	"设备参数", 					0 , 		0,				0 , 	0,			0,				GROUP_SET_EQPPARA,0X0000, NULL_R},
	#ifdef GD_AREA_ECZD_SHAOGUAN_2021
		{SETTYPE_UINT,	SET_NULL,	"定值区号", 				0.0,		SEC_NUMBER-1,		1,		0,		0,			GROUP_SET_EQPPARA,0x5001, UINT_R},
		{SETTYPE_F, 	SET_A,		"保护CT额定一次值",		0.0,		2000.0, 		600.0,	0,			0,				GROUP_SET_EQPPARA,0x5002, FLOAT_R},	
		{SETTYPE_F, 	SET_A,		"保护CT额定二次值",		0.0,		10.0,			5.0 ,		0,			0,				GROUP_SET_EQPPARA,0x5003, FLOAT_R},
	#else
		{SETTYPE_F, 	SET_A,		"CT额定一次值",		0.0,		2000.0, 		600.0,	0,			0,				GROUP_SET_EQPPARA,0x5002, FLOAT_R},	
		{SETTYPE_F, 	SET_A,		"CT额定二次值",		0.0,		10.0,			5.0 ,		0,			0,				GROUP_SET_EQPPARA,0x5003, FLOAT_R},
	#endif
	{SETTYPE_F, 	SET_A,		"零序CT额定一次值",		0.0,		2000.0, 		100.0,	0,			0,				GROUP_SET_EQPPARA,0x5004, FLOAT_R},
	{SETTYPE_F, 	SET_A,		"零序CT额定二次值",		0.0,		10.0,			5.0 ,		0,			0,				GROUP_SET_EQPPARA,0x5005, FLOAT_R},
	{SETTYPE_F, 	SET_A,		"测量CT额定一次值",		0.0,		2000.0, 		600.0,	0,			0,				GROUP_SET_EQPPARA,0x5006, FLOAT_R},
	{SETTYPE_F, 	SET_A,		"测量CT额定二次值",		0.0,		10.0,			5.0 ,		0,			0,				GROUP_SET_EQPPARA,0x5007, FLOAT_R},
#else
    {SETTYPE_LABEL, SET_NULL,   "设备参数",                     0 ,         0,              0 ,     0,          0,              GROUP_SET_EQPPARA,0X0000, NULL_R},
    #if defined GD_AREA_MEIZHOU_FTU || defined GD_AREA_MEIZHOU_2021
	    {SETTYPE_UINT,  SET_NULL,   "定值区号",                 0.0,        0.0,                0,      0,          0,              GROUP_SET_EQPPARA,0x5001, UINT_R},
	#elif defined GD_AREA_HEYUAN_2021
		{SETTYPE_UINT,  SET_NULL,   "定值区号",             1.0,        SEC_NUMBER-1,                1,      0,          0,              GROUP_SET_EQPPARA,0x5001, UINT_R},
	#else
	    {SETTYPE_UINT,  SET_NULL,   "定值区号",                 0.0,        4.0,                0,      0,          0,              GROUP_SET_EQPPARA,0x5001, UINT_R},
	#endif
	#if defined GD_AREA_HEYUAN_2021 
		{SETTYPE_F,     SET_A,      "CT额定一次值",     0.0,        2000.0,         600.0,  0,          0,              GROUP_SET_EQPPARA,0x5002, FLOAT_R},
		{SETTYPE_F,     SET_A,      "CT额定二次值",     0.0,        10.0,           5.0 ,       0,          0,              GROUP_SET_EQPPARA,0x5003, FLOAT_R},
	#else
	    {SETTYPE_F,     SET_A,      "保护CT额定一次值",     0.0,        2000.0,         600.0,  0,          0,              GROUP_SET_EQPPARA,0x5002, FLOAT_R},
	    {SETTYPE_F,     SET_A,      "保护CT额定二次值",     0.0,        10.0,           5.0 ,       0,          0,              GROUP_SET_EQPPARA,0x5003, FLOAT_R},
	#endif
    #ifdef GD_AREA_MAIN_2020
	    {SETTYPE_F,     SET_A,      "零序CT额定一次值",     0.0,        2000.0,         100.0,   0,          0,              GROUP_SET_EQPPARA,0x5004, FLOAT_R},
	    {SETTYPE_F,     SET_A,      "零序CT额定二次值",     0.0,        10.0,           5.0 ,       0,          0,              GROUP_SET_EQPPARA,0x5005, FLOAT_R},
    #else
	    {SETTYPE_F,     SET_A,      "零序CT额定一次值",     0.0,        2000.0,         20.0,   0,          0,              GROUP_SET_EQPPARA,0x5004, FLOAT_R},
	    {SETTYPE_F,     SET_A,      "零序CT额定二次值",     0.0,        10.0,           1.0 ,       0,          0,              GROUP_SET_EQPPARA,0x5005, FLOAT_R},
    #endif
    {SETTYPE_F,     SET_A,      "测量CT额定一次值",     0.0,        2000.0,         600.0,  0,          0,              GROUP_SET_EQPPARA,0x5006, FLOAT_R},
    {SETTYPE_F,     SET_A,      "测量CT额定二次值",     0.0,        10.0,           5.0 ,       0,          0,              GROUP_SET_EQPPARA,0x5007, FLOAT_R},
#endif

#ifdef GD_AREA_ECZD_2020//2020二次指导意见增加开关公共控制字&压板
    {SETTYPE_F,		SET_U,		"电源侧(母线侧)PT额定二次值",	0.0,		300.0,			100.0,	0,			0,				GROUP_SET_EQPPARA,0x5008, FLOAT_R},
    {SETTYPE_F,		SET_U,		"负荷侧(线路侧)PT额定二次值", 	0.0, 		300.0,			100.0 ,	0,			0,				GROUP_SET_EQPPARA,0x5009, FLOAT_R},

	{SETTYPE_LABEL, SET_NULL,	"软压板", 					0 , 		0,				0 , 	0,			0,				GROUP_SET_PUBYB,0x0000, NULL_R},
	#ifdef GD_AREA_ZHONGSHAN_2020
		{SETTYPE_LIST,	SET_NULL,	"远方修改功能",		0 , 		TTListNum-1,		1,		TTList, 	TTListNum,		GROUP_SET_PUBYB,0x5025, BOOL_R},
	#elif !defined GD_AREA_ECZD_MAOMING && !defined BH_FA_INONE_SW
		{SETTYPE_LIST,	SET_NULL,	"远方投入软压板",		0 , 		TTListNum-1,		1,		TTList, 	TTListNum,		GROUP_SET_PUBYB,0x5025, BOOL_R},
	#endif
	#ifdef FUNC_DRIVE
		{SETTYPE_LIST,	SET_NULL,	"开关传动投入",	0 , 		TTListNum-1,		0,		TTList, 	TTListNum,		GROUP_SET_PUBYB,0X0000, BOOL_R},
		{SETTYPE_F, 	SET_S,		"传动延时合闸时间", 			0.0,		999.0,			10,   0,			0,		GROUP_SET_PUBYB,0X0000, FLOAT_R},
		{SETTYPE_F, 	SET_S,		"传动延时分闸时间", 			0.0,		999.0,			0,	  0,			0,		GROUP_SET_PUBYB,0X0000, FLOAT_R},
		{SETTYPE_F, 	SET_S,		"结束传动时间",			0.0,		999.0,			15, 	  0,			0,		GROUP_SET_PUBYB,0X0000, FLOAT_R},
		{SETTYPE_F, 	SET_S,		"合闸结束传动时间", 			0.0,		999.0,			0.3,	  0,			0,		GROUP_SET_PUBYB,0X0000, FLOAT_R},
	#endif
	{SETTYPE_LIST,	SET_NULL,	"停用保护及FA功能", 	0 , 		TTListNum-1,		1,		TTList, 	TTListNum,		GROUP_SET_PUBYB,0x5025, BOOL_R},
	#if defined GD_AREA_ZHONGSHAN_2020
		{SETTYPE_LIST,	SET_NULL,	"电流型功能投入",	0 , 		TTListNum-1,		1,		TTList, 	TTListNum,		GROUP_SET_PUBYB,0x5025, BOOL_R},
		{SETTYPE_LIST,	SET_NULL,	"电压电流型功能投入", 	0 , 		TTListNum-1,		1,		TTList, 	TTListNum,		GROUP_SET_PUBYB,0x5025, BOOL_R},
		{SETTYPE_LIST,	SET_NULL,	"智能分布式投入", 	0 , 		TTListNum-1,		1,		TTList, 	TTListNum,		GROUP_SET_PUBYB,0x5025, BOOL_R},
	#endif
    {SETTYPE_LIST,	SET_NULL,	"同期合闸功能", 	0 , 		TTListNum-1,		1,		TTList, 	TTListNum,		GROUP_SET_PUBYB,0x5025, BOOL_R},		
    {SETTYPE_LIST,	SET_NULL,	"自动解列功能", 	0 , 		TTListNum-1,		1,		TTList, 	TTListNum,		GROUP_SET_PUBYB,0x5025, BOOL_R},	
	
	#ifdef YF_TQ_JL_TY_PUBLIC
        {SETTYPE_LIST,	SET_NULL,	"远方整定投入软压板",			0 ,  	  TTListNum-1,		1,			 TTList,		 TTListNum, 			GROUP_SET_PUBYB,0X0000, BOOL_R},
	#endif	

	#ifdef GD_AREA_ECZD_FOS_2021
		{SETTYPE_LIST,	SET_NULL,	"保护投入软压板",		0 , 		TTListNum-1,		1,		TTList, 	TTListNum,		GROUP_SET_PUBYB,0x5023, BOOL_R},
	#else
		{SETTYPE_LIST,	SET_NULL,	"保护出口投入软压板",		0 , 		TTListNum-1,		1,		TTList, 	TTListNum,		GROUP_SET_PUBYB,0x5023, BOOL_R},
	#endif
	#if !defined GD_AREA_ZHONGSHAN_2020 && !defined BH_FA_INONE_SW
		{SETTYPE_LIST,	SET_NULL,	"常规保护软压板",		0 , 		TTListNum-1,		1,		TTList, 	TTListNum,		GROUP_SET_PUBYB,0x0000, BOOL_R},
		{SETTYPE_LIST,	SET_NULL,	"常规FA软压板",		0 , 		TTListNum-1,		1,		TTList, 	TTListNum,		GROUP_SET_PUBYB,0x0000, BOOL_R},
		{SETTYPE_LIST,	SET_NULL,	"智能分布式FA软压板",		0 , 		TTListNum-1,		1,		TTList, 	TTListNum,		GROUP_SET_PUBYB,0x0000, BOOL_R},
	#endif
#elif defined  GD_AREA_ZHONGSHAN 
	{SETTYPE_F,		SET_U,		"母线侧PT额定二次值",	0.0,		300.0,			100.0,	0,			0,				GROUP_SET_EQPPARA,0x5008, FLOAT_R},
	{SETTYPE_F,		SET_U,		"线路侧PT额定二次值", 	0.0, 		300.0,			100.0 ,	0,			0,				GROUP_SET_EQPPARA,0x5009, FLOAT_R},
	//中山局扩展	
	{SETTYPE_LIST,	SET_NULL,	"线路侧PT接线方式", 		1 , 		TPT_TypeNum-1,	1,		TPT_Type,	TPT_TypeNum,	GROUP_SET_EQPPARA,0x500A, UINT_R},
	{SETTYPE_LIST,	SET_NULL,	"控制回路断线检测", 				0 , 		TTListNum-1,		0,		TTList,		TTListNum,		GROUP_SET_EQPPARA,0x0000, BOOL_R},
#elif defined GD_AREA_ZHUHAI_FTU
	{SETTYPE_F,		SET_U,		"电源侧PT额定二次值",	0.0,		300.0,			100.0,	0,			0,				GROUP_SET_EQPPARA,0x5008, FLOAT_R},
	{SETTYPE_F,		SET_U,		"负荷侧PT额定二次值", 	0.0, 		300.0,			100.0 ,	0,			0,				GROUP_SET_EQPPARA,0x5009, FLOAT_R},
#elif defined GD_AREA_ZHUHAI || defined GD_AREA_JIEYANG  
	{SETTYPE_F,		SET_U,		"母线侧PT额定二次值",	0.0,		300.0,			100.0,	0,			0,				GROUP_SET_EQPPARA,0x5008, FLOAT_R},
	{SETTYPE_F,		SET_U,		"线路侧PT额定二次值", 	0.0, 		300.0,			100.0 ,	0,			0,				GROUP_SET_EQPPARA,0x5009, FLOAT_R},
#elif defined  GD_AREA_ZHUHAI_V2
	{SETTYPE_F, 	SET_U,		"电缆侧PT额定二次值",	0.0,		300.0,			100.0,	0,			0,				GROUP_SET_EQPPARA,0x5008, FLOAT_R},
	{SETTYPE_F, 	SET_U,		"母线侧PT额定二次值",	0.0,		300.0,			100.0 , 0,			0,				GROUP_SET_EQPPARA,0x5009, FLOAT_R},
#elif defined  GD_AREA_HEYUAN_2021
	{SETTYPE_F, 	SET_U,		"电源侧PT额定二次值",	0.0,		1000.0,			220.0,	0,			0,				GROUP_SET_EQPPARA,0x5008, FLOAT_R},
	{SETTYPE_F, 	SET_U,		"负荷侧PT额定二次值",	0.0,		1000.0,			220.0 , 0,			0,				GROUP_SET_EQPPARA,0x5009, FLOAT_R},
#else	
	{SETTYPE_F,		SET_U,		"电源侧PT额定二次值",	0.0,		300.0,			100.0,	0,			0,				GROUP_SET_EQPPARA,0x5008, FLOAT_R},
	{SETTYPE_F,		SET_U,		"负荷侧PT额定二次值", 	0.0, 		300.0,			100.0,	0,			0,				GROUP_SET_EQPPARA,0x5009, FLOAT_R},	
#endif
	{SETTYPE_LIST,	SET_NULL,	"A侧PT接线方式", 	   1, 		   TPT_TypeNum-1,	1,		TPT_Type,	TPT_TypeNum,	GROUP_SET_EQPPARA,0x0000, UINT_R},
	{SETTYPE_LIST,	SET_NULL,	"B侧PT接线方式", 	   1, 		   TPT_TypeNum-1,	1,		TPT_Type,	TPT_TypeNum,	GROUP_SET_EQPPARA,0x0000, UINT_R},

	{SETTYPE_LABEL,	SET_NULL,	"电压参数", 					0 , 		0,				0 ,		0,			0,				GROUP_SET_PUBSET,0x0000, NULL_R},
	{SETTYPE_LIST,	SET_NULL,	"过电压投退", 				0 , 		TTListNum-1,		0,		TTList,		TTListNum,		GROUP_SET_PUBSET,0x0000, BOOL_R},
	{SETTYPE_F,		SET_U,		"过电压定值",				10.0 , 	440.0,			110.0 ,	0,			0,				GROUP_SET_PUBSET,0x0000, FLOAT_R},
	{SETTYPE_F,		SET_S,		"过电压时间", 				0.0 , 	10000.0,			600.0 ,	0,			0,				GROUP_SET_PUBSET,0x0000, FLOAT_R},
	{SETTYPE_LIST,	SET_NULL,	"低电压投退", 				0 , 		TTListNum-1,		0,		TTList,		TTListNum,		GROUP_SET_PUBSET,0x0000, BOOL_R},
	{SETTYPE_F,		SET_U,		"低电压定值",				10.0 , 	440.0,			90.0 ,	0,			0,				GROUP_SET_PUBSET,0x0000, FLOAT_R},
	{SETTYPE_F,		SET_S,		"低电压时间", 				0.0 , 	10000.0,			600.0 ,	0,			0,				GROUP_SET_PUBSET,0x0000, FLOAT_R},
	{SETTYPE_F,		SET_U,		"零序电压额定值", 		0.0, 		220.0,			100.0 ,	0,			0,				GROUP_SET_PUBSET,0x0000, FLOAT_R},
	{SETTYPE_LIST,	SET_NULL,	"线路有压投退",			0 , 		TTListNum-1,		0,	  TTList,	TTListNum,		GROUP_SET_PUBSET,0x0000, BOOL_R},
	{SETTYPE_F, 	SET_U,		"有压定值", 			10.0 ,		100.0,			85.0 ,	  0,			0,			GROUP_SET_PUBSET,0x0000, FLOAT_R},
	{SETTYPE_F, 	SET_S,		"有压时间", 			0.0,		100.0,			  0.1,	  0,			0,			GROUP_SET_PUBSET,0x0000, FLOAT_R},
	{SETTYPE_LIST,	SET_NULL,	"线路无压投退",			0 , 		TTListNum-1,		0,	  TTList,	TTListNum,		GROUP_SET_PUBSET,0x0000, BOOL_R},
	{SETTYPE_F, 	SET_U,		"无压定值", 			10.0 ,		100.0,			65.0 ,	  0,			0,			GROUP_SET_PUBSET,0x0000, FLOAT_R},
	{SETTYPE_F, 	SET_S,		"无压时间", 			0.0,		100.0,			  0.1,	  0,			0,			GROUP_SET_PUBSET,0x0000, FLOAT_R},

#ifdef	CUSTOMIZE_BZT //备自投
	{SETTYPE_LIST,	SET_NULL,	"失压分闸投退",	0 , 		TTListNum-1,		0,		TTList, 	TTListNum,	GROUP_SET_PUBSET,0x0000, BOOL_R},
	{SETTYPE_F, 	SET_U,		"失压分闸定值",	0.0 ,	220.0,			66.0 ,	0,			0,			GROUP_SET_PUBSET,0x0000, FLOAT_R},
	{SETTYPE_F, 	SET_S,		"失压分闸时间",	0.0 ,	99,			0.1 ,	0,			0,			GROUP_SET_PUBSET,0x0000, FLOAT_R},
#endif
	{SETTYPE_LIST,	SET_NULL,	"直流电压1告警投退",	0 , 			TTListNum-1,		0,		TTList, TTListNum,	GROUP_SET_PUBSET,0x0000, BOOL_R},
	{SETTYPE_F, 	SET_U,		"直流电压1告警定值",		10.0 ,		60.0,			20.0 ,	0,			0,			GROUP_SET_PUBSET,0x0000, FLOAT_R},
	{SETTYPE_F, 	SET_S,		"直流电压1告警时间",	0.1 ,			100.0,			100.0 , 0,			0,			GROUP_SET_PUBSET,0x0000, FLOAT_R},
	{SETTYPE_LIST,	SET_NULL,	"直流电压2告警投退",	0 , 			TTListNum-1,		0,		TTList, TTListNum,	GROUP_SET_PUBSET,0x0000, BOOL_R},
	{SETTYPE_F, 	SET_U,		"直流电压2告警定值",		10.0 ,		60.0,			20.0 ,	0,			0,			GROUP_SET_PUBSET,0x0000, FLOAT_R},
	{SETTYPE_F, 	SET_S,		"直流电压2告警时间",	0.1 ,			100.0,			100.0 , 0,			0,			GROUP_SET_PUBSET,0x0000, FLOAT_R},

	{SETTYPE_LABEL,	SET_NULL,	"非电量保护", 		0 , 		0,				       0 ,		0,			0,				GROUP_SET_FDL,0x0000, NULL_R},
#ifdef GD_AREA_SHANTOU
	{SETTYPE_LIST,	SET_NULL,	"非电量1保护", 		0 , 		TZCKListNum-1,		TZCKListNum-1,		TZCKList,		TZCKListNum,		GROUP_SET_FDL,0x0000, UINT_R},
	{SETTYPE_LIST,	SET_NULL,	"非电量2保护", 		0 , 		TZCKListNum-1,		TZCKListNum-1,		TZCKList,		TZCKListNum,		GROUP_SET_FDL,0x0000, UINT_R},
	{SETTYPE_LIST,	SET_NULL,	"非电量3保护", 		0 , 		TZCKListNum-1,		TZCKListNum-1,		TZCKList,		TZCKListNum,		GROUP_SET_FDL,0x0000, UINT_R},
	{SETTYPE_LIST,	SET_NULL,	"非电量4保护", 		0 , 		TZCKListNum-1,		TZCKListNum-1,		TZCKList,		TZCKListNum,		GROUP_SET_FDL,0x0000, UINT_R},
	{SETTYPE_LIST,	SET_NULL,	"非电量5保护", 		0 , 		TZCKListNum-1,		TZCKListNum-1,		TZCKList,		TZCKListNum,		GROUP_SET_FDL,0x0000, UINT_R},
	{SETTYPE_LIST,	SET_NULL,	"非电量6保护", 		0 , 		TZCKListNum-1,		TZCKListNum-1,		TZCKList,		TZCKListNum,		GROUP_SET_FDL,0x0000, UINT_R},
	{SETTYPE_LIST,	SET_NULL,	"非电量7保护", 		0 , 		TZCKListNum-1,		TZCKListNum-1,		TZCKList,		TZCKListNum,		GROUP_SET_FDL,0x0000, UINT_R},
	{SETTYPE_LIST,	SET_NULL,	"非电量8保护", 		0 , 		TZCKListNum-1,		TZCKListNum-1,		TZCKList,		TZCKListNum,		GROUP_SET_FDL,0x0000, UINT_R},
#else
	{SETTYPE_LIST,	SET_NULL,	"非电量1保护", 		0 , 		TZCKListNum-1,		0,		TZCKList,		TZCKListNum,		GROUP_SET_FDL,0x0000, UINT_R},
	{SETTYPE_LIST,	SET_NULL,	"非电量2保护", 		0 , 		TZCKListNum-1,		0,		TZCKList,		TZCKListNum,		GROUP_SET_FDL,0x0000, UINT_R},
	{SETTYPE_LIST,	SET_NULL,	"非电量3保护", 		0 , 		TZCKListNum-1,		0,		TZCKList,		TZCKListNum,		GROUP_SET_FDL,0x0000, UINT_R},
	{SETTYPE_LIST,	SET_NULL,	"非电量4保护", 		0 , 		TZCKListNum-1,		0,		TZCKList,		TZCKListNum,		GROUP_SET_FDL,0x0000, UINT_R},
	{SETTYPE_LIST,	SET_NULL,	"非电量5保护", 		0 , 		TZCKListNum-1,		0,		TZCKList,		TZCKListNum,		GROUP_SET_FDL,0x0000, UINT_R},
	{SETTYPE_LIST,	SET_NULL,	"非电量6保护", 		0 , 		TZCKListNum-1,		0,		TZCKList,		TZCKListNum,		GROUP_SET_FDL,0x0000, UINT_R},
	{SETTYPE_LIST,	SET_NULL,	"非电量7保护", 		0 , 		TZCKListNum-1,		0,		TZCKList,		TZCKListNum,		GROUP_SET_FDL,0x0000, UINT_R},
	{SETTYPE_LIST,	SET_NULL,	"非电量8保护", 		0 , 		TZCKListNum-1,		0,		TZCKList,		TZCKListNum,		GROUP_SET_FDL,0x0000, UINT_R},
#endif
	{SETTYPE_F,		SET_S,		"非电量1时间", 		0.0 , 	100.0,			1.0 ,		0,			0,				GROUP_SET_FDL,0x0000, FLOAT_R},
	{SETTYPE_F,		SET_S,		"非电量2时间", 		0.0 , 	100.0,			1.0 ,		0,			0,				GROUP_SET_FDL,0x0000, FLOAT_R},
	{SETTYPE_F,		SET_S,		"非电量3时间", 		0.0 , 	100.0,			1.0 ,		0,			0,				GROUP_SET_FDL,0x0000, FLOAT_R},
	{SETTYPE_F,		SET_S,		"非电量4时间", 		0.0 , 	100.0,			1.0 ,		0,			0,				GROUP_SET_FDL,0x0000, FLOAT_R},
	{SETTYPE_F,		SET_S,		"非电量5时间", 		0.0 , 	100.0,			1.0 ,		0,			0,				GROUP_SET_FDL,0x0000, FLOAT_R},
	{SETTYPE_F,		SET_S,		"非电量6时间", 		0.0 , 	100.0,			1.0 ,		0,			0,				GROUP_SET_FDL,0x0000, FLOAT_R},
	{SETTYPE_F,		SET_S,		"非电量7时间", 		0.0 , 	100.0,			1.0 ,		0,			0,				GROUP_SET_FDL,0x0000, FLOAT_R},
	{SETTYPE_F,		SET_S,		"非电量8时间", 		0.0 , 	100.0,			1.0 ,		0,			0,				GROUP_SET_FDL,0x0000, FLOAT_R},

	{SETTYPE_LABEL,	SET_NULL,	"其它",             0,      0,				    0 ,		0,			0,			    GROUP_SET_OTHERS_PUB, 	0X0000, NULL_R},
	{SETTYPE_LIST,	SET_NULL,	"经高阻接地方式",   0,      TTListNum-1,        1,		TTList,     TTListNum,	    GROUP_SET_OTHERS_PUB, 	0X0000, NULL_R},
	{SETTYPE_LIST,	SET_NULL,	"小电流突变方式",   0,      TBLTYPENum-1,	    0,		TBLTYPE,    TBLTYPENum,	    GROUP_SET_OTHERS_PUB, 	0X0000, NULL_R},
	{SETTYPE_LIST,	SET_NULL,	"信号滤波方式",     0,      FilterTYPENum-1,    2,		FilterTYPE, FilterTYPENum,	GROUP_SET_OTHERS_PUB, 	0X0000, NULL_R},
	{SETTYPE_LIST,	SET_NULL,	"小波类型",         0,      WaveletTYPENum-1,   0,		WaveletTYPE,WaveletTYPENum,	GROUP_SET_OTHERS_PUB, 	0X0000, NULL_R},
	{SETTYPE_UINT,	SET_NULL,	"小波卷积阶数", 	1,      4,				    2,		0,			 0,			    GROUP_SET_OTHERS_PUB, 	0X0000, NULL_R},
	{SETTYPE_LIST,	SET_NULL,	"H 变换", 		   0,       TTListNum-1,	    0,		TTList,     TTListNum,	    GROUP_SET_OTHERS_PUB, 	0X0000, NULL_R},

	{SETTYPE_LABEL,	SET_NULL,	"备用定值",				0, 		0,		0 ,		0,		0,			GROUP_SET_STANDBY,0x0000, NULL_R},
	#ifdef VOLT_ADAPTIVE_FACTOR
		{SETTYPE_LIST,	SET_NULL,	"自适应电压系数",			0,TTListNum-1,	0 ,	TTList,	TTListNum,		GROUP_SET_STANDBY,0x0000, BOOL_R},
	#else
		{SETTYPE_UINT,	SET_NULL,	"备用1",				0,   	0,		0 ,		0,		0,			GROUP_SET_STANDBY,0x0000, UINT_R},
	#endif
#ifdef FUNC_SET_FA_JS
	{SETTYPE_F,		SET_S,		"FA合闸解锁时间",				0,   	10,		0.05 ,		0,		0,			GROUP_SET_STANDBY,0x0000, FLOAT_R},
#else
	{SETTYPE_UINT,	SET_NULL,	"备用2",				0,   	0,		0 ,		0,		0,			GROUP_SET_STANDBY,0x0000, UINT_R},
#endif
	{SETTYPE_F,	SET_S,	"同期合闸判断返回时间",				0,   	999.0,		10.0,		0,		0,			GROUP_SET_STANDBY,0x0000, FLOAT_R},
	{SETTYPE_UINT,	SET_NULL,	"备用4",				0,   	0,		0 ,		0,		0,			GROUP_SET_STANDBY,0x0000, UINT_R},
	{SETTYPE_UINT,	SET_NULL,	"备用5",				0,   	0,		0 ,		0,		0,			GROUP_SET_STANDBY,0x0000, UINT_R},
	{SETTYPE_UINT,	SET_NULL,	"备用6",				0,   	0,		0 ,		0,		0,			GROUP_SET_STANDBY,0x0000, UINT_R},
	{SETTYPE_UINT,	SET_NULL,	"备用7",				0,   	0,		0 ,		0,		0,			GROUP_SET_STANDBY,0x0000, UINT_R},
	{SETTYPE_UINT,	SET_NULL,	"备用8",				0,   	0,		0 ,		0,		0,			GROUP_SET_STANDBY,0x0000, UINT_R},
	{SETTYPE_UINT,	SET_NULL,	"备用9",				0,   	0,		0 ,		0,		0,			GROUP_SET_STANDBY,0x0000, UINT_R},
	{SETTYPE_UINT,	SET_NULL,	"备用10",				0,   	0,		0 ,		0,		0,			GROUP_SET_STANDBY,0x0000, UINT_R},
	{SETTYPE_UINT,	SET_NULL,	"备用11",				0,   	0,		0 ,		0,		0,			GROUP_SET_STANDBY,0x0000, UINT_R},
	{SETTYPE_UINT,	SET_NULL,	"备用12",				0,   	0,		0 ,		0,		0,			GROUP_SET_STANDBY,0x0000, UINT_R},
	{SETTYPE_UINT,	SET_NULL,	"备用13",				0,   	0,		0 ,		0,		0,			GROUP_SET_STANDBY,0x0000, UINT_R},
	{SETTYPE_UINT,	SET_NULL,	"备用14",				0,   	0,		0 ,		0,		0,			GROUP_SET_STANDBY,0x0000, UINT_R},
	{SETTYPE_UINT,	SET_NULL,	"备用15",				0,   	0,		0 ,		0,		0,			GROUP_SET_STANDBY,0x0000, UINT_R},
	{SETTYPE_UINT,	SET_NULL,	"备用16",				0,   	0,		0 ,		0,		0,			GROUP_SET_STANDBY,0x0000, UINT_R},
	{SETTYPE_UINT,	SET_NULL,	"备用17",				0,   	0,		0 ,		0,		0,			GROUP_SET_STANDBY,0x0000, UINT_R},
	{SETTYPE_UINT,	SET_NULL,	"备用18",				0,   	0,		0 ,		0,		0,			GROUP_SET_STANDBY,0x0000, UINT_R},
	{SETTYPE_UINT,	SET_NULL,	"备用19",				0,   	0,		0 ,		0,		0,			GROUP_SET_STANDBY,0x0000, UINT_R},
	{SETTYPE_UINT,	SET_NULL,	"备用20",				0,   	0,		0 ,		0,		0,			GROUP_SET_STANDBY,0x0000, UINT_R},
	{SETTYPE_UINT,	SET_NULL,	"备用21",				0,   	0,		0 ,		0,		0,			GROUP_SET_STANDBY,0x0000, UINT_R},
	{SETTYPE_UINT,	SET_NULL,	"备用22",				0,   	0,		0 ,		0,		0,			GROUP_SET_STANDBY,0x0000, UINT_R},
	{SETTYPE_UINT,	SET_NULL,	"备用23",				0,   	0,		0 ,		0,		0,			GROUP_SET_STANDBY,0x0000, UINT_R},
	{SETTYPE_UINT,	SET_NULL,	"备用24",				0,   	0,		0 ,		0,		0,			GROUP_SET_STANDBY,0x0000, UINT_R},
	{SETTYPE_UINT,	SET_NULL,	"备用25",				0,   	0,		0 ,		0,		0,			GROUP_SET_STANDBY,0x0000, UINT_R},
	{SETTYPE_UINT,	SET_NULL,	"备用26",				0,   	0,		0 ,		0,		0,			GROUP_SET_STANDBY,0x0000, UINT_R},
	{SETTYPE_UINT,	SET_NULL,	"备用27",				0,   	0,		0 ,		0,		0,			GROUP_SET_STANDBY,0x0000, UINT_R},
	{SETTYPE_UINT,	SET_NULL,	"备用28",				0,   	0,		0 ,		0,		0,			GROUP_SET_STANDBY,0x0000, UINT_R},
	{SETTYPE_UINT,	SET_NULL,	"备用29",				0,   	0,		0 ,		0,		0,			GROUP_SET_STANDBY,0x0000, UINT_R},
	{SETTYPE_UINT,	SET_NULL,	"备用30",				0,   	0,		0 ,		0,		0,			GROUP_SET_STANDBY,0x0000, UINT_R},
	{SETTYPE_UINT,	SET_NULL,	"备用31",				0,   	0,		0 ,		0,		0,			GROUP_SET_STANDBY,0x0000, UINT_R},
	{SETTYPE_UINT,	SET_NULL,	"备用32",				0,   	0,		0 ,		0,		0,			GROUP_SET_STANDBY,0x0000, UINT_R},
	{SETTYPE_UINT,	SET_NULL,	"备用33",				0,   	0,		0 ,		0,		0,			GROUP_SET_STANDBY,0x0000, UINT_R},
	{SETTYPE_UINT,	SET_NULL,	"备用34",				0,   	0,		0 ,		0,		0,			GROUP_SET_STANDBY,0x0000, UINT_R},
	{SETTYPE_UINT,	SET_NULL,	"备用35",				0,   	0,		0 ,		0,		0,			GROUP_SET_STANDBY,0x0000, UINT_R},
	{SETTYPE_UINT,	SET_NULL,	"备用36",				0,   	0,		0 ,		0,		0,			GROUP_SET_STANDBY,0x0000, UINT_R},
	{SETTYPE_UINT,	SET_NULL,	"备用37",				0,   	0,		0 ,		0,		0,			GROUP_SET_STANDBY,0x0000, UINT_R},
	{SETTYPE_UINT,	SET_NULL,	"备用38",				0,   	0,		0 ,		0,		0,			GROUP_SET_STANDBY,0x0000, UINT_R},
	{SETTYPE_UINT,	SET_NULL,	"备用39",				0,   	0,		0 ,		0,		0,			GROUP_SET_STANDBY,0x0000, UINT_R},
	{SETTYPE_UINT,	SET_NULL,	"备用40",				0,   	0,		0 ,		0,		0,			GROUP_SET_STANDBY,0x0000, UINT_R},
};
const int PUB_SET_NUMBER  = sizeof( tPubSetTable ) / sizeof(tPubSetTable[0]);  // 定值数目

/**********************************************************************
保护定值参数
***********************************************************************/
const  TSETTABLE tSwSetTable[]=                                               		 // min 	 max 		     default
{
	
	{SETTYPE_LABEL,	SET_NULL,	"保护控制字", 				0 , 		0,				0 ,		0,			0,				GROUP_SET_BHTT,0X0000, NULL_R},
#if defined GD_AREA_ZHUHAI || defined GD_AREA_ZHUHAI_FTU || defined GD_AREA_CHAOZHOU || defined GD_AREA_MEIZHOU_FTU || defined GD_AREA_ZHONGSHAN_FTU ||defined GD_AREA_HEYUAN_KL || defined  GD_AREA_JIEYANG_FTU
	{SETTYPE_LIST,	SET_NULL,	"过流Ⅰ段投入",			0 , 		TZGJListNum-1,		0,		TZGJList, 	TZGJListNum,		GROUP_SET_BHTT,0X500B, UINT_R},
	{SETTYPE_LIST,	SET_NULL,	"过流Ⅱ段投入",			0 , 		TZGJListNum-1,		0,		TZGJList, 	TZGJListNum,		GROUP_SET_BHTT,0X500C, UINT_R},
#elif defined GD_AREA_SHANTOU
	{SETTYPE_LIST,	SET_NULL,	"过流Ⅰ段投入",			0 , 		TZCKListNum-1,		TZCKListNum-1,		TZCKList,	TZCKListNum,		GROUP_SET_BHTT,0X500B, UINT_R},
	{SETTYPE_LIST,	SET_NULL,	"过流Ⅱ段投入",			0 , 		TZCKListNum-1,		TZCKListNum-1,		TZCKList,	TZCKListNum,		GROUP_SET_BHTT,0X500C, UINT_R},
#elif defined GD_AREA_ZHUHAI_V2 || defined GD_AREA_MAIN_2020 || defined GD_AREA_ECZD_2020  //珠海局要求告警+跳闸两个选项     广东标准2020要求告警+跳闸两个选项
    {SETTYPE_LIST,	SET_NULL,	"过流Ⅰ段投入", 			0 , 		TZListNum-1,		0,		TZList,		TZListNum,		GROUP_SET_BHTT,0X500B, BOOL_R},
    {SETTYPE_LIST,	SET_NULL,	"过流Ⅱ段投入", 			0 , 		TZListNum-1,		0,		TZList,		TZListNum,		GROUP_SET_BHTT,0X500C, BOOL_R},
#elif defined GD_AREA_GUANGZHOU_FTU
	{SETTYPE_LIST,	SET_NULL,	"过流Ⅰ段投入",			0 , 		TZCKListNum-1,		0,		TZCKList,	TZCKListNum,		GROUP_SET_BHTT,0X0000, UINT_R},
	{SETTYPE_LIST,	SET_NULL,	"过流Ⅱ段投入",			0 , 		TZCKListNum-1,		0,		TZCKList,	TZCKListNum,		GROUP_SET_BHTT,0X0000, UINT_R},
#else
	{SETTYPE_LIST,	SET_NULL,	"过流Ⅰ段投入", 			0 , 		TTListNum-1,		0,		TTList,		TTListNum,		GROUP_SET_BHTT,0X500B, BOOL_R},
	{SETTYPE_LIST,	SET_NULL,	"过流Ⅱ段投入", 			0 , 		TTListNum-1,		0,		TTList,		TTListNum,		GROUP_SET_BHTT,0X500C, BOOL_R},
#endif

#if defined GD_AREA_ZHUHAI || defined GD_AREA_ZHUHAI_FTU || defined GD_AREA_CHAOZHOU || defined GD_AREA_MEIZHOU_FTU || defined GD_AREA_ZHONGSHAN_FTU ||defined GD_AREA_HEYUAN_KL || defined  GD_AREA_JIEYANG_FTU
    {SETTYPE_LIST,	SET_NULL,	"过流Ⅲ段投入", 			0 , 		TZGJListNum-1,		0,		TZGJList,	TZGJListNum,		GROUP_SET_BHTT,0X0000, UINT_R},
#elif defined GD_AREA_ECZD_SHAOGUAN_2021
    {SETTYPE_LIST,	SET_NULL,	"过流Ⅲ段投入", 			0 , 		TZListNum-1,		0,		TZList,	TZListNum,		GROUP_SET_BHTT,0X0000, BOOL_R},	
#else
    {SETTYPE_LIST,	SET_NULL,	"过流Ⅲ段投入", 			0 , 		TTListNum-1,		0,		TTList,		TTListNum,		GROUP_SET_BHTT,0X0000, BOOL_R},
#endif

#ifdef GD_AREA_ECZD_SHAOGUAN_2021
    {SETTYPE_LIST,	SET_NULL,	"过负荷告警",				0 , 		TTListNum-1,		0,		TTList, 	TTListNum,		GROUP_SET_BHTT,0X0000, BOOL_R},
#endif
	{SETTYPE_LIST,	SET_NULL,	"过流Ⅰ段投方向", 		0 , 		TTListNum-1,		0,		TTList,		TTListNum,		GROUP_SET_BHTT,0X500D, BOOL_R},
	{SETTYPE_LIST,	SET_NULL,	"过流Ⅱ段投方向", 		0 , 		TTListNum-1,		0,		TTList,		TTListNum,		GROUP_SET_BHTT,0X500E, BOOL_R},		
    {SETTYPE_LIST,	SET_NULL,	"过流Ⅲ段投方向", 		0 , 		TTListNum-1,		0,		TTList,		TTListNum,		GROUP_SET_BHTT,0X0000, BOOL_R},
	{SETTYPE_LIST,	SET_NULL,	"PT断线检测投入", 			0 , 		TTListNum-1,		0,		TTList,		TTListNum,		GROUP_SET_BHTT,0X500F, BOOL_R},
#ifdef GD_AREA_ECZD_SHAOGUAN_2021
	{SETTYPE_LIST,	SET_NULL,	"控制回路断线告警",			0 , 		TTListNum-1,		0,		TTList, 	TTListNum,		GROUP_SET_BHTT,0X0000, BOOL_R},
#endif

#if defined GD_AREA_ZHUHAI || defined GD_AREA_ZHUHAI_FTU || defined GD_AREA_CHAOZHOU || defined GD_AREA_MEIZHOU_FTU || defined GD_AREA_ZHONGSHAN_FTU ||defined GD_AREA_HEYUAN_KL || defined  GD_AREA_JIEYANG_FTU
	{SETTYPE_LIST,	SET_NULL,	"零序过流Ⅰ段投入", 		0 , 		TZGJListNum-1,		0,		TZGJList, 	TZGJListNum,		GROUP_SET_BHTT,0X5010, UINT_R},
	{SETTYPE_LIST,	SET_NULL,	"零序过流Ⅱ段投入", 0 , 				TZGJListNum-1,		0,		TZGJList, 	TZGJListNum,		GROUP_SET_BHTT,0X5011, UINT_R},
#elif defined GD_AREA_SHANTOU
	{SETTYPE_LIST,	SET_NULL,	"零序过流Ⅰ段投入", 		0 , 		TZCKListNum-1,		TZCKListNum-1,		TZCKList,		TZCKListNum,		GROUP_SET_BHTT,0X5010, UINT_R},
	{SETTYPE_LIST,	SET_NULL,	"零序过流Ⅱ段投入", 0 , 				TZCKListNum-1,		TZCKListNum-1,		TZCKList,		TZCKListNum,		GROUP_SET_BHTT,0X5011, UINT_R},
#elif defined GD_AREA_GUANGZHOU_FTU
	{SETTYPE_LIST,	SET_NULL,	"零序过流Ⅰ段投入", 		0 , 		TZCKListNum-1,		0,		TZCKList,		TZCKListNum,		GROUP_SET_BHTT,0X0000, UINT_R},
	{SETTYPE_LIST,	SET_NULL,	"零序过流Ⅱ段投入", 0 , 				TZCKListNum-1,		0,		TZCKList,		TZCKListNum,		GROUP_SET_BHTT,0X0000, UINT_R},
#else
	{SETTYPE_LIST,	SET_NULL,	"零序过流Ⅰ段投入", 		0 , 		TZListNum-1,		0,		TZList,		TZListNum,		GROUP_SET_BHTT,0X5010, BOOL_R},
	{SETTYPE_LIST,	SET_NULL,	"零序过流Ⅱ段投入", 0 , 				TZListNum-1,		0,		TZList,		TZListNum,		GROUP_SET_BHTT,0X5011, BOOL_R},
#endif

#ifdef DISP_SET_LX3 
	#ifdef GD_TEST_2021
		{SETTYPE_LIST,	SET_NULL,	"零序过流Ⅲ段投入", 0 , 				TZGJListNum-1,		0,		TZGJList, 	TZGJListNum,		GROUP_SET_BHTT,0X0000, UINT_R},
	#else
		{SETTYPE_LIST,	SET_NULL,	"零序过流Ⅲ段投入", 0 , 				TZListNum-1,		0,		TZList, 	TZListNum,		GROUP_SET_BHTT,0X0000, BOOL_R},
	#endif	
#endif

#if defined GD_AREA_MAIN_2020 || defined GD_AREA_ECZD_2020 //广东标准2020要求增加零序过电压保护和后加速保护
	#if defined GD_AREA_ECZD_YUNFU_2021_2021
		{SETTYPE_LIST,	SET_NULL,	"零序过电压保护",			0 , 	TZCKListNum-1,	    0,		TZCKList,	TZCKListNum,		GROUP_SET_BHTT,0, UINT_R},
	#else
		{SETTYPE_LIST,	SET_NULL,	"零序过电压保护",			0 , 		TTListNum-1,	    0,		TTList,		TTListNum,		GROUP_SET_BHTT,0, BOOL_R},
	#endif
    {SETTYPE_LIST,	SET_NULL,	"后加速保护投入",			0 , 		TTListNum-1,		0,		TTList, 	TTListNum,		GROUP_SET_BHTT,0, BOOL_R},
#else
	{SETTYPE_LIST,	SET_NULL,	"零序电压保护",			0 , 		TZCKListNum-1,	    0,		TZCKList,	TZCKListNum,		GROUP_SET_BHTT,0, UINT_R},
	{SETTYPE_LIST,	SET_NULL,	"后加速投入",			0 , 		TTListNum-1,		0,		TTList, 	TTListNum,		GROUP_SET_BHTT,0, BOOL_R},
#endif

	{SETTYPE_LIST,	SET_NULL,	"涌流识别投入", 			0 , 		TTListNum-1,		0,		TTList,		TTListNum,		GROUP_SET_BHTT,0X5012, BOOL_R},
	{SETTYPE_LIST,	SET_NULL,	"非遮断电流投入",			0 , 		TTListNum-1,		0,		TTList, 	TTListNum,		GROUP_SET_BHTT,0X5012, BOOL_R},
	{SETTYPE_LIST,	SET_NULL,	"相间过流重合闸投入", 		0 , 		TTListNum-1,		0,		TTList,		TTListNum,		GROUP_SET_BHTT,0X5013, BOOL_R},
	{SETTYPE_LIST,	SET_NULL,	"零序过流重合闸投入", 		0 , 		TTListNum-1,		0,		TTList,		TTListNum,		GROUP_SET_BHTT,0X5014, BOOL_R},
	{SETTYPE_LIST,	SET_NULL,	"一次重合闸投入", 		0 , 		TTListNum-1,		0,		TTList,		TTListNum,		GROUP_SET_BHTT,0X5013, BOOL_R},
	{SETTYPE_LIST,	SET_NULL,	"二次重合闸投入", 		0 , 		TTListNum-1,		0,		TTList,		TTListNum,		GROUP_SET_BHTT,0X5014, BOOL_R},
#ifdef DISP_SET_CH_T3
	{SETTYPE_LIST,	SET_NULL,	"三次重合闸投入", 		0 , 		TTListNum-1,		0,		TTList,		TTListNum,		GROUP_SET_BHTT,0X0000, BOOL_R},
#endif

	{SETTYPE_LIST,	SET_NULL,	"重合闸检同期", 			0 , 		TTListNum-1,		0,		TTList,		TTListNum,		GROUP_SET_BHTT,0X5015, BOOL_R},
#ifdef CHZ_JWY_LM
	{SETTYPE_LIST,	SET_NULL,	"母线无压线路有压", 		0 , 		TTListNum-1,		0,		TTList,		TTListNum,		GROUP_SET_BHTT,0x0000, BOOL_R},
	{SETTYPE_LIST,	SET_NULL,	"线路无压母线有压", 		0 , 		TTListNum-1,		0,		TTList,		TTListNum,		GROUP_SET_BHTT,0x0000, BOOL_R},
#else
	{SETTYPE_LIST,	SET_NULL,	"重合闸检无压", 			0 , 		TTListNum-1,		0,		TTList,		TTListNum,		GROUP_SET_BHTT,0X5016, BOOL_R},
#endif

#ifdef GD_TEST_2021
	{SETTYPE_LIST,	SET_NULL,	"偷跳启动重合", 			0 , 		TTListNum-1,		0,		TTList,		TTListNum,		GROUP_SET_BHTT,0x0000, BOOL_R},
#endif

#ifdef	XDL_ZT //小电流接地
    {SETTYPE_LIST,	SET_NULL,	"小电流接地告警",	0 , 	TTListNum-1,	0,		TTList, TTListNum,		GROUP_SET_BHTT,0X0000, BOOL_R},
    {SETTYPE_LIST,	SET_NULL,	"小电流接地出口",	0 , 	TTListNum-1,	0,		TTList, TTListNum,		GROUP_SET_BHTT,0X0000, BOOL_R},
#endif

    {SETTYPE_LIST,	SET_NULL,	"大电流闭锁重合闸投入",			0 , 		TTListNum-1,		0,		TTList, 	TTListNum,		GROUP_SET_BHTT,0X5016, BOOL_R},

	{SETTYPE_LABEL,	SET_NULL,	"保护定值", 					0 , 		0,				0 ,		0,			0,				GROUP_SET_BHDZ,0X0000, NULL_R},
#ifdef 	GD_AREA_ECZD_SHAOGUAN_2021
	{SETTYPE_F, 	SET_A,		"过流Ⅰ段定值",			0.0 ,	600.0,			100.0 , 0,			0,				GROUP_SET_BHDZ,0X5017, FLOAT_R},	
	{SETTYPE_F, 	SET_S,		"过流Ⅰ段时间",			0.0 ,	600.0,			100.0 , 0,			0,				GROUP_SET_BHDZ,0X0000, FLOAT_R},
	{SETTYPE_F, 	SET_A,		"过流Ⅱ段定值",			0.0 ,	600.0,			100.0 , 0,			0,				GROUP_SET_BHDZ,0X5019, FLOAT_R},	
	{SETTYPE_F, 	SET_S,		"过流Ⅱ段时间",			0.0 ,	600.0,			100.0 , 0,			0,				GROUP_SET_BHDZ,0X0000, FLOAT_R},	
    {SETTYPE_F, 	SET_A,		"过流Ⅲ段定值",			0.0 ,	600.0,			100.0 , 0,			0,				GROUP_SET_BHDZ,0X0000, FLOAT_R},	
    {SETTYPE_F, 	SET_S,		"过流Ⅲ段时间",			0.0 ,	600.0,			100.0 , 0,			0,				GROUP_SET_BHDZ,0X0000, FLOAT_R},
#else
    {SETTYPE_F, 	SET_A,		"过流Ⅰ段定值",			0.0 ,	100.0,			100.0 , 0,			0,				GROUP_SET_BHDZ,0X5017, FLOAT_R},	
	#if defined GD_AREA_HEYUAN_2021
		{SETTYPE_F, 	SET_S,		"过流Ⅰ段时间",			0.0 ,	100.0,			100.0 , 0,			0,				GROUP_SET_BHDZ,0X0000, FLOAT_R},
	#else
		{SETTYPE_F, 	SET_S,		"过流Ⅰ段时间",			0.0 ,	99.0,			99.0 ,	0,			0,				GROUP_SET_BHDZ,0X5018, FLOAT_R},
	#endif
		{SETTYPE_F, 	SET_A,		"过流Ⅱ段定值",			0.0 ,	100.0,			100.0 , 0,			0,				GROUP_SET_BHDZ,0X5019, FLOAT_R},	
	#if defined GD_AREA_HEYUAN_2021
		{SETTYPE_F, 	SET_S,		"过流Ⅱ段时间",			0.0 ,	100.0,			100.0 , 0,			0,				GROUP_SET_BHDZ,0X0000, FLOAT_R},
	#else
		{SETTYPE_F, 	SET_S,		"过流Ⅱ段时间",			0.0 ,	99.0,			99.0 ,	0,			0,				GROUP_SET_BHDZ,0X501A, FLOAT_R},
	#endif
    {SETTYPE_F, 	SET_A,		"过流Ⅲ段定值",			0.0 ,	100.0,			100.0 , 0,			0,				GROUP_SET_BHDZ,0X0000, FLOAT_R},	
    #ifdef GD_AREA_HEYUAN_2021
        {SETTYPE_F, 	SET_S,		"过流Ⅲ段时间",			0.0 ,	100.0,			100.0 , 0,			0,				GROUP_SET_BHDZ,0X0000, FLOAT_R},
    #else
        {SETTYPE_F, 	SET_S,		"过流Ⅲ段时间",			0.0 ,	99.0,			99.0 ,	0,			0,				GROUP_SET_BHDZ,0X0000, FLOAT_R},
    #endif
#endif

#ifdef GD_AREA_ECZD_SHAOGUAN_2021
    {SETTYPE_F,		SET_A,		"过负荷定值", 			0.1 , 	10.0,			5.0 ,		0,			0,				GROUP_SET_BHDZ,0X0000, FLOAT_R},
	{SETTYPE_F,		SET_S,		"过负荷定时",			0.0 , 	10000.0,			3600 ,	0,			0,				GROUP_SET_BHDZ,0X0000, FLOAT_R},
#endif

#if defined GD_AREA_HEYUAN_2021
	{SETTYPE_F,		SET_A,		"零序Ⅰ段定值",		0.0 , 	100.0,			100.0 ,	0,			0,				GROUP_SET_BHDZ,0X501B, FLOAT_R},	
	{SETTYPE_F,		SET_S,		"零序Ⅰ段时间",		0.0 , 	1800.0,			1800.0 ,	0,			0,				GROUP_SET_BHDZ,0X501C, FLOAT_R},
	{SETTYPE_F,		SET_A,		"零序Ⅱ段定值",		0.0 , 	100.0,			100.0 ,	0,			0,				GROUP_SET_BHDZ,0X501D, FLOAT_R},	
	{SETTYPE_F,		SET_S,		"零序Ⅱ段时间",		0.0 , 	1800.0,			1800.0 ,	0,			0,				GROUP_SET_BHDZ,0X501E, FLOAT_R},
	#ifdef DISP_SET_LX3	
		{SETTYPE_F,		SET_A,		"零序Ⅲ段定值",		0.0 , 	100.0,			100.0 ,	0,			0,				GROUP_SET_BHDZ,0X0000, FLOAT_R},	
		{SETTYPE_F,		SET_S,		"零序Ⅲ段时间",		0.0 , 	1800.0,			1800.0 ,	0,			0,				GROUP_SET_BHDZ,0X0000, FLOAT_R},
	#endif
	{SETTYPE_F,		SET_U,		"零序过电压定值",		0.0 , 	100.0,			100.0 ,	0,			0,				GROUP_SET_BHDZ,0, FLOAT_R},	//
	{SETTYPE_F,		SET_S,		"零序过电压时间",		0.0 , 	100.0,			100.0 ,	0,			0,				GROUP_SET_BHDZ,0, FLOAT_R},
	{SETTYPE_F, 	SET_A,		"后加速过流定值",	0.0 ,	100.0,			0 , 0,			0,			GROUP_SET_BHDZ,0, FLOAT_R},
	{SETTYPE_F, 	SET_S,		"后加速过流时间",	0.0 ,	100.0,			0 ,	0,			0,			GROUP_SET_BHDZ,0, FLOAT_R},
	{SETTYPE_F, 	SET_A,		"后加速零流定值",	0.0,		100.0,		0 ,	0,			0,			GROUP_SET_BHDZ,0, FLOAT_R},
	{SETTYPE_F, 	SET_S,		"后加速零流时间",	0.0 ,	100.0,			0.1 ,	0,			0,			GROUP_SET_BHDZ,0, FLOAT_R},
#elif defined GD_AREA_ECZD_SHAOGUAN_2021
	{SETTYPE_F, 	SET_A,		"零序过流Ⅰ段定值", 	0.0 ,	600.0,			100.0 , 0,			0,				GROUP_SET_BHDZ,0X501B, FLOAT_R},	
	{SETTYPE_F, 	SET_S,		"零序过流Ⅰ段时间", 	0.0 ,	1800.0, 		1800.0 ,	0,			0,				GROUP_SET_BHDZ,0X501C, FLOAT_R},
	{SETTYPE_F, 	SET_A,		"零序过流Ⅱ段定值", 	0.0 ,	600.0,			100.0 , 0,			0,				GROUP_SET_BHDZ,0X501D, FLOAT_R},	
	{SETTYPE_F, 	SET_S,		"零序过流Ⅱ段时间", 	0.0 ,	1800.0, 		1800.0 ,	0,			0,				GROUP_SET_BHDZ,0X501E, FLOAT_R},
	#ifdef DISP_SET_LX3	
		{SETTYPE_F, 	SET_A,		"零序过流Ⅲ段定值", 	0.0 ,	600.0,			100.0 , 0,			0,				GROUP_SET_BHDZ,0X0000, FLOAT_R},	
		{SETTYPE_F, 	SET_S,		"零序过流Ⅲ段时间", 	0.0 ,	1800.0, 		1800.0 ,	0,			0,				GROUP_SET_BHDZ,0X0000, FLOAT_R},
	#endif
	{SETTYPE_F, 	SET_U,		"零序过电压保护定值",		0.0 ,	100.0,			100.0 , 0,			0,				GROUP_SET_BHDZ,0, FLOAT_R}, //
	{SETTYPE_F, 	SET_S,		"零序过电压保护时间",		0.0 ,	600.0,			99.0 ,	0,			0,				GROUP_SET_BHDZ,0, FLOAT_R},
	{SETTYPE_F, 	SET_A,		"后加速过流保护定值",	0.0 ,	600.0,			0 , 0,			0,			GROUP_SET_BHDZ,0, FLOAT_R},
	{SETTYPE_F, 	SET_S,		"后加速过流保护时间",	0.0 ,	600.0,			0 , 0,			0,			GROUP_SET_BHDZ,0, FLOAT_R},
	{SETTYPE_F, 	SET_A,		"后加速零序电流保护定值",	0.0,		600.0,		0 , 0,			0,			GROUP_SET_BHDZ,0, FLOAT_R},
	{SETTYPE_F, 	SET_S,		"后加速零序电流保护时间",	0.0 ,	600.0,			0.1 ,	0,			0,			GROUP_SET_BHDZ,0, FLOAT_R},
#else
	{SETTYPE_F,		SET_A,		"零序过流Ⅰ段定值",		0.0 , 	100.0,			100.0 ,	0,			0,				GROUP_SET_BHDZ,0X501B, FLOAT_R},	
	{SETTYPE_F,		SET_S,		"零序过流Ⅰ段时间",		0.0 , 	1800.0,			1800.0 ,	0,			0,				GROUP_SET_BHDZ,0X501C, FLOAT_R},
	{SETTYPE_F,		SET_A,		"零序过流Ⅱ段定值",		0.0 , 	100.0,			100.0 ,	0,			0,				GROUP_SET_BHDZ,0X501D, FLOAT_R},	
	{SETTYPE_F,		SET_S,		"零序过流Ⅱ段时间",		0.0 , 	1800.0,			1800.0 ,	0,			0,				GROUP_SET_BHDZ,0X501E, FLOAT_R},
	#ifdef DISP_SET_LX3	
		{SETTYPE_F,		SET_A,		"零序过流Ⅲ段定值",		0.0 , 	100.0,			100.0 ,	0,			0,				GROUP_SET_BHDZ,0X0000, FLOAT_R},	
		{SETTYPE_F,		SET_S,		"零序过流Ⅲ段时间",		0.0 , 	1800.0,			1800.0 ,	0,			0,				GROUP_SET_BHDZ,0X0000, FLOAT_R},
	#endif
		{SETTYPE_F,		SET_U,		"零序过电压保护定值",		0.0 , 	100.0,			100.0 ,	0,			0,				GROUP_SET_BHDZ,0, FLOAT_R},
		{SETTYPE_F,		SET_S,		"零序过电压保护时间",		0.0 , 	99.0,			99.0 ,	0,			0,				GROUP_SET_BHDZ,0, FLOAT_R},
		{SETTYPE_F, 	SET_A,		"后加速过流保护定值",	0.0 ,	100.0,			0 , 0,			0,			GROUP_SET_BHDZ,0, FLOAT_R},
		{SETTYPE_F, 	SET_S,		"后加速过流保护时间",	0.0 ,	99.0,			0 ,	0,			0,			GROUP_SET_BHDZ,0, FLOAT_R},
		{SETTYPE_F, 	SET_A,		"后加速零序电流保护定值",	0.0,		100.0,		0 ,	0,			0,			GROUP_SET_BHDZ,0, FLOAT_R},
		{SETTYPE_F, 	SET_S,		"后加速零序电流保护时间",	0.0 ,	99.0,			0.1 ,	0,			0,			GROUP_SET_BHDZ,0, FLOAT_R},
#endif

#ifdef INRUSH_CURRENT_IN_DECIMALS
	{SETTYPE_F,		SET_NULL,	"涌流识别定值",			0.0 , 	1.00,			0.15 ,	0,			0,				GROUP_SET_BHDZ,0X501F, FLOAT_R},	
#else
	{SETTYPE_F,		SET_PER,	"涌流识别定值",			0.0 , 	100.0,			15.0 ,	0,			0,				GROUP_SET_BHDZ,0X501F, FLOAT_R},	
#endif
	{SETTYPE_F, 	SET_A,		"非遮断电流定值",			0.0 ,	100.0,			5.0 , 0,			0,				GROUP_SET_BHDZ,0X5017, FLOAT_R}, 

#ifdef FUNC_CHZ_CHARGE_TIME
	{SETTYPE_F, 	SET_S,		"重合闸充电时间",	0.0 ,	300.0,			15.0 ,	0,		0,			GROUP_SET_BHDZ,0X0000, FLOAT_R},
#endif

#ifdef GD_AREA_ECZD_SHAOGUAN_2021
	{SETTYPE_F, 	SET_S,		"一次重合闸时间",		0.0 ,	600.0,			15.0 ,		0,			0,				GROUP_SET_BHDZ,0X5020, FLOAT_R},
	{SETTYPE_F, 	SET_S,		"二次重合闸闭锁时间",		0.0 ,	600.0,			0.0 ,		0,			0,				GROUP_SET_BHDZ,0X5021, FLOAT_R},
	{SETTYPE_F, 	SET_S,		"二次重合闸时间",		0.0 ,	600.0,			3.0 ,		0,			0,				GROUP_SET_BHDZ,0X5022, FLOAT_R},
	#ifdef DISP_SET_CH_T3
		{SETTYPE_F, 	SET_S,		"三次重合闸时间",		0.0 ,	600.0,			3.0 ,		0,			0,				GROUP_SET_BHDZ,0X0000, FLOAT_R},
	#endif
#else
	{SETTYPE_F, 	SET_S,		"一次重合闸时间",		0.0 ,	300.0,			3.0 ,		0,			0,				GROUP_SET_BHDZ,0X5020, FLOAT_R},
	#ifdef GD_AREA_HEYUAN_2021
		{SETTYPE_F, 	SET_S,		"重合闸闭锁时间",		0.0 ,	300.0,			0.0 ,		0,			0,				GROUP_SET_BHDZ,0X5021, FLOAT_R},
	#else
		{SETTYPE_F, 	SET_S,		"二次重合闸闭锁时间",		0.0 ,	300.0,			0.0 ,		0,			0,				GROUP_SET_BHDZ,0X5021, FLOAT_R},
	#endif
	{SETTYPE_F, 	SET_S,		"二次重合闸时间",		0.0 ,	300.0,			3.0 ,		0,			0,				GROUP_SET_BHDZ,0X5022, FLOAT_R},
	#ifdef DISP_SET_CH_T3
		{SETTYPE_F, 	SET_S,		"三次重合闸时间",		0.0 ,	300.0,			3.0 ,		0,			0,				GROUP_SET_BHDZ,0X0000, FLOAT_R},
	#endif
#endif

//扩展
#ifdef DISP_CHZOKCHR_2_SW
    #ifdef GD_TEST_2021
        {SETTYPE_F, 		SET_S,		"重合充电时间",	0.0 ,	300.0,			15.0 ,	0,		0,			GROUP_SET_BHDZ,0X0000, FLOAT_R},
    #else
        {SETTYPE_F, 		SET_S,		"重合充电时间",	1.0 ,	300.0,			15.0 ,	0,		0,			GROUP_SET_BHDZ,0X0000, FLOAT_R},
    #endif	
    #if defined GD_AREA_HUIZHOU_DAYAWAN || defined GD_TEST_2021
        {SETTYPE_F, 		SET_S,		"重合闸确认时间", 	0 ,	999.0,			180.0 ,	0,		0,			GROUP_SET_BHDZ,0X0000, FLOAT_R},
    #else
        {SETTYPE_F, 		SET_S,		"重合闸确认时间", 	0.3 ,	999.0,			180.0 ,	0,		0,			GROUP_SET_BHDZ,0X0000, FLOAT_R},
    #endif
#endif

#ifdef	XDL_ZT //小电流接地
    {SETTYPE_LIST,	SET_NULL,	"小电流启动类型",0 , 			XDLQDListNum-1, 1,		XDLQDList,	XDLQDListNum,	GROUP_SET_BHDZ,0X0000, UINT_R},
    {SETTYPE_F, 	SET_A,		"小电流暂态电流",	0.0 ,	100.0,			100.0 , 0,			0,			GROUP_SET_BHDZ,0X0000, FLOAT_R},	
#endif

    {SETTYPE_F,		SET_A,	"大电流闭锁重合闸定值",			0.0 , 	100.0,			15.0 ,	0,			0,				GROUP_SET_BHDZ,0X501F, FLOAT_R},	

#ifdef FUN_JDXX
    {SETTYPE_LABEL, SET_NULL,	"小电流接地辅助定值",			0,		0,					0,		0,			   0,				GROUP_SET_JDXX,0X0000, NULL_R},
    {SETTYPE_LIST,	SET_NULL,	"接地选线告警投退",             0,		TTListNum-1,	    0,		TTList, 	    TTListNum,		GROUP_SET_JDXX,0X0000, BOOL_R},
    {SETTYPE_LIST,	SET_NULL,	"接地选线跳闸投退",             0,		TTListNum-1,	    0,		TTList, 		TTListNum,		GROUP_SET_JDXX,0X0000, BOOL_R},
    {SETTYPE_LIST,	SET_NULL,	"接地选相投退",				0 , 	TTListNum-1,		0,		TTList, 		TTListNum,		GROUP_SET_JDXX,0X0000, BOOL_R},
    {SETTYPE_LIST,	SET_NULL,	"零序功率方向投退", 			0 , 	TTListNum-1,		0,		TTList, 		TTListNum,		GROUP_SET_JDXX,0X0000, BOOL_R},
    {SETTYPE_F, 	SET_A,		"接地电流零漂值",				0,		0.1,				0.001,	0,				0,				GROUP_SET_JDXX,0X0000, FLOAT_R}, 
    {SETTYPE_F, 	SET_A,		"启动值",					0,		1.8,				0.005,	0,				0,				GROUP_SET_JDXX,0X0000, FLOAT_R}, 
    {SETTYPE_UINT,	SET_NULL,	"启动点数", 				1,		32, 				2 , 	0,				0,				GROUP_SET_JDXX,0X0000, UINT_R},
    {SETTYPE_UINT,	SET_NULL,	"确认点数", 				1,		32, 				4 , 	0,				0,				GROUP_SET_JDXX,0X0000, UINT_R},
    {SETTYPE_UINT,	SET_NULL,	"采样点数", 				1,		128,				16 ,	0,				0,				GROUP_SET_JDXX,0X0000, UINT_R},
    {SETTYPE_LIST,	SET_NULL,	"参考电压选择",				0,		TVolSelListNum-1,	8,		TVolSelList,	TVolSelListNum, GROUP_SET_JDXX,0X0000, UINT_R},
    {SETTYPE_F, 	SET_U,		"参考电压启动值",				0.01,	220,				0.1 ,	0,				0,				GROUP_SET_JDXX,0X0000, FLOAT_R},
    {SETTYPE_F, 	SET_U,		"接地零序电压定值", 			0.0 ,	100.0,				1.0,	0,				0,				GROUP_SET_JDXX,0X0000, FLOAT_R},
    {SETTYPE_F, 	SET_S,		"接地选线动作时间",         	 0,		1000,		        0 ,	    0,				0,				GROUP_SET_JDXX,0X0000, FLOAT_R},
    {SETTYPE_F, 	SET_S,		"接地选线告警时间",	            0,		1000,			    0 ,	    0,				0,				GROUP_SET_JDXX,0X0000, FLOAT_R},
#endif

#ifdef GD_AREA_HEYUAN_2021
	{SETTYPE_LABEL,	SET_NULL,	"保护软压板", 					0 , 		0,				0 ,		0,			0,	GROUP_SET_BHYB,0X0000, NULL_R},
	{SETTYPE_LIST,	SET_NULL,	"重合闸软压板",	0 , 		TTListNum-1,		1,		TTList,		TTListNum,		GROUP_SET_BHYB,0X5024, BOOL_R},
#else
	#ifdef GD_AREA_ECZD_2020	
		{SETTYPE_LABEL,	SET_NULL,	"保护软压板", 					0 , 		0,				0 ,		0,			0,	GROUP_SET_BHYB,0X0000, NULL_R},
		#ifdef GD_AREA_ECZD_MAOMING
			{SETTYPE_LIST,	SET_NULL,	"远方整定投入软压板",	0 , 		TTListNum-1,		0,		TTList,		TTListNum,		GROUP_SET_BHYB,0X5024, BOOL_R},
		#endif
		{SETTYPE_LIST,	SET_NULL,	"重合闸投入软压板",	0 , 		TTListNum-1,		0,		TTList,		TTListNum,		GROUP_SET_BHYB,0X5024, BOOL_R},
	#endif
#endif

	{SETTYPE_LABEL,	SET_NULL,	"反时限保护", 					0 , 		0,				0 ,		0,			0,				GROUP_SET_FSX,0X0000, NULL_R},
	{SETTYPE_LIST,	SET_NULL,	"反时限投退", 		0 , 	TTListNum-1,	0,		TTList,	TTListNum,		GROUP_SET_FSX	,0X0000, BOOL_R},
	{SETTYPE_F,		SET_A,		"反时限基准值", 		0.3 , 	10.0,			5.0 ,	0,		0,				GROUP_SET_FSX	,0X0000, FLOAT_R},
	{SETTYPE_F,		SET_S,		"反时限时间",		0.005 , 120.0,			120.0 ,	0,		0,				GROUP_SET_FSX	,0X0000, FLOAT_R},
	{SETTYPE_LIST,	SET_NULL,	"反时限曲线", 		0 , 	FSXListNum-1,	0,		FSXList,FSXListNum,		GROUP_SET_FSX	,0X0000, UINT_R},
	
	{SETTYPE_LABEL,	SET_NULL,	"同期合闸", 					0 , 		0,				0 ,		0,			0,				GROUP_SET_TQHZ,0X0000, NULL_R},
#if defined GD_AREA_ECZD_2020
    {SETTYPE_LIST,	SET_NULL,	"同期合闸控制字",			0 , 		TTListNum-1,		0,		TTList, 	TTListNum,		GROUP_SET_TQHZ,0X0000, BOOL_R},
    {SETTYPE_F, 	SET_PERUN,	"同期允许电压差",				0.0 ,	50.0,			25.0 ,	0,			0,				GROUP_SET_TQHZ,0X0000, FLOAT_R},
	{SETTYPE_F, 	SET_ANG,	"同期允许相角差",				0.0 ,	50.0,			30.0 ,	0,			0,				GROUP_SET_TQHZ,0X0000, FLOAT_R},
	{SETTYPE_F, 	SET_HZ, 	"同期允许频率差",				0.0 ,	5.0,				2.0 ,		0,			0,				GROUP_SET_TQHZ,0X0000, FLOAT_R},
#else
	#ifdef GD_AREA_HEYUAN_2021
		{SETTYPE_LIST,	SET_NULL,	"同期合闸控制字", 			0 , 		TTListNum-1,		0,		TTList,		TTListNum,		GROUP_SET_TQHZ,0X0000, BOOL_R},
		{SETTYPE_F,		SET_PERUN,	"同期允许电压差", 				0.0 , 	50.0,			20.0 ,	0,			0,				GROUP_SET_TQHZ,0X0000, FLOAT_R},
		{SETTYPE_F,		SET_ANG,	"同期允许相角差", 				0.0 , 	50.0,			30.0 ,	0,			0,				GROUP_SET_TQHZ,0X0000, FLOAT_R},
		{SETTYPE_F,		SET_HZ,		"同期允许频率差", 				0.0 , 	5.0,				2.0 ,		0,			0,				GROUP_SET_TQHZ,0X0000, FLOAT_R},
	#else
		{SETTYPE_LIST,	SET_NULL,	"同期合闸功能控制字", 			0 , 		TTListNum-1,		0,		TTList,		TTListNum,		GROUP_SET_TQHZ,0X0000, BOOL_R},
		{SETTYPE_F,		SET_PERUN,	"同期合闸允许电压差", 				0.0 , 	50.0,			25.0 ,	0,			0,				GROUP_SET_TQHZ,0X0000, FLOAT_R},
		{SETTYPE_F,		SET_ANG,	"同期合闸允许相角差", 				0.0 , 	50.0,			30.0 ,	0,			0,				GROUP_SET_TQHZ,0X0000, FLOAT_R},
		{SETTYPE_F,		SET_HZ,		"同期合闸允许频率差", 				0.0 , 	5.0,				2.0 ,		0,			0,				GROUP_SET_TQHZ,0X0000, FLOAT_R},
	#endif
#endif

	{SETTYPE_LABEL,	SET_NULL,	"电压解列", 					0 , 		0,				0 ,		0,			0,				GROUP_SET_DYJL,0X0000, NULL_R},
#if defined GD_AREA_ECZD_MAOMING
	{SETTYPE_LIST,	SET_NULL,	"电压越限解列Ku",			0 , 		TTListNum-1,		0,		TTList, 	TTListNum,		GROUP_SET_DYJL,0X0000, BOOL_R},
#else
	{SETTYPE_LIST,	SET_NULL,	"电压越限解列控制字Ku", 			0 , 		TTListNum-1,		0,		TTList,		TTListNum,		GROUP_SET_DYJL,0X0000, BOOL_R},
#endif

	{SETTYPE_F, 	SET_PERUN,	"电压过低解列ULL",			0.0 ,	50.0,			50.0 ,	0,			0,				GROUP_SET_DYJL,0X0000, FLOAT_R},
	{SETTYPE_F, 	SET_S,		"电压过低延时TULL",			0.0 ,	999.0,			1.0 ,	0,			0,				GROUP_SET_DYJL,0X0000, FLOAT_R},
#if defined GD_AREA_ECZD_MAOMING
	{SETTYPE_F,		SET_PERUN,	"低电压解列UL", 			51.0 , 	99.0,			80.0 ,	0,			0,				GROUP_SET_DYJL,0X0000, FLOAT_R},
	{SETTYPE_F,		SET_S,		"低电压延时TUL",			0.0 , 	999.0,			95.0 ,	0,			0,				GROUP_SET_DYJL,0X0000, FLOAT_R},
	{SETTYPE_F,		SET_PERUN,	"高电压解列UH", 			101.0 , 	134.0,			120.0 ,	0,			0,				GROUP_SET_DYJL,0X0000, FLOAT_R},
	{SETTYPE_F,		SET_S,		"高电压延时TUH",			0.0 , 	999.0,			2.0 ,	       0,		 	0,				GROUP_SET_DYJL,0X0000, FLOAT_R},
#elif defined GD_AREA_FOS_2021
	{SETTYPE_F, 	SET_PERUN,	"低电压解列UL",			51.0 ,	85.0,			80.0 ,	0,			0,				GROUP_SET_DYJL,0X0000, FLOAT_R},
	{SETTYPE_F, 	SET_S,		"低电压解列延时TUL", 		0.0 ,	999.0,			95.0 ,	0,			0,				GROUP_SET_DYJL,0X0000, FLOAT_R},
	{SETTYPE_F, 	SET_PERUN,	"高电压解列UH",			110.0 , 	134.0,			120.0 , 0,			0,				GROUP_SET_DYJL,0X0000, FLOAT_R},
	{SETTYPE_F, 	SET_S,		"高电压解列延时TUH", 		0.0 ,	999.0,			2.0 ,		   0,			0,				GROUP_SET_DYJL,0X0000, FLOAT_R},
#elif defined GD_AREA_ECZD_SHAOGUAN_2021
	{SETTYPE_F, 	SET_PERUN,	"低电压解列UL",			51.0 ,	99.0,			80.0 ,	0,			0,				GROUP_SET_DYJL,0X0000, FLOAT_R},
	{SETTYPE_F, 	SET_S,		"低电压解列延时TUL", 		0.0 ,	6000.0, 		95.0 ,	0,			0,				GROUP_SET_DYJL,0X0000, FLOAT_R},
	{SETTYPE_F, 	SET_PERUN,	"高电压解列UH",			101.0 , 	134.0,			120.0 , 0,			0,				GROUP_SET_DYJL,0X0000, FLOAT_R},
	{SETTYPE_F, 	SET_S,		"高电压解列延时TUH", 		0.0 ,	6000.0, 		2.0 ,		   0,			0,				GROUP_SET_DYJL,0X0000, FLOAT_R},
#else
	{SETTYPE_F,		SET_PERUN,	"低电压解列UL", 			51.0 , 	99.0,			80.0 ,	0,			0,				GROUP_SET_DYJL,0X0000, FLOAT_R},
	{SETTYPE_F,		SET_S,		"低电压解列延时TUL",			0.0 , 	999.0,			95.0 ,	0,			0,				GROUP_SET_DYJL,0X0000, FLOAT_R},
	{SETTYPE_F,		SET_PERUN,	"高电压解列UH", 			101.0 , 	134.0,			120.0 ,	0,			0,				GROUP_SET_DYJL,0X0000, FLOAT_R},
	{SETTYPE_F,		SET_S,		"高电压解列延时TUH",			0.0 , 	999.0,			2.0 ,	       0,		 	0,				GROUP_SET_DYJL,0X0000, FLOAT_R},	
#endif

	{SETTYPE_LIST,	SET_NULL,	"滑差闭锁低压投入", 			0 , 		TTListNum-1,		0,		TTList, 	TTListNum,		GROUP_SET_DYJL,0X0000, BOOL_R},
	{SETTYPE_F,		SET_U_S,	"滑差闭锁低压定值",			10.0 , 	220.0,			70.0 ,	       0,		 	0,				GROUP_SET_DYJL,0X0000, FLOAT_R},

	{SETTYPE_LABEL,	SET_NULL,	"频率解列", 					0 , 		0,				0 ,		0,			0,				GROUP_SET_PLJL,0X0000, NULL_R},
#if defined GD_AREA_ECZD_MAOMING
	{SETTYPE_LIST,	SET_NULL,	"频率越限解列Kf",			0 , 		TTListNum-1,		0,		TTList, 	TTListNum,		GROUP_SET_PLJL,0X0000, BOOL_R},
#else
	{SETTYPE_LIST,	SET_NULL,	"频率越限解列控制字Kf", 			0 , 		TTListNum-1,		0,		TTList,		TTListNum,		GROUP_SET_PLJL,0X0000, BOOL_R},
#endif

#ifdef GD_AREA_ECZD_MAOMING
	{SETTYPE_F, 	SET_HZ, 	"低频解列fL",			47.1 ,	49.9,			47.6 ,	0,			0,				GROUP_SET_PLJL,0X0000, FLOAT_R},
	{SETTYPE_F, 	SET_S,		"低频延时TfL",			0.0 ,	999.0,			2.0 ,		   0,			0,				GROUP_SET_PLJL,0X0000, FLOAT_R},
	{SETTYPE_F, 	SET_HZ, 	"高频解列fH",			50.1 ,	55.0,			51.0 ,	0,			0,				GROUP_SET_PLJL,0X0000, FLOAT_R},
	{SETTYPE_F, 	SET_S,		"高频延时TfH",			0.0 ,	999.0,			2.0 ,		  0,			0,				GROUP_SET_PLJL,0X0000, FLOAT_R},
#else
	{SETTYPE_F,		SET_HZ,		"低频解列fL", 			47.1 , 	49.9,			47.6 ,	0,			0,				GROUP_SET_PLJL,0X0000, FLOAT_R},
	{SETTYPE_F,		SET_S,		"低频解列延时TfL",			0.0 , 	999.0,			2.0 ,	       0,			0,				GROUP_SET_PLJL,0X0000, FLOAT_R},
	#ifdef GD_AREA_HEYUAN_2021
		{SETTYPE_F,		SET_HZ,		"高频解列fH", 			50.0 , 	55.0,			51.0 ,	0,			0,				GROUP_SET_PLJL,0X0000, FLOAT_R},
	#else
		{SETTYPE_F,		SET_HZ,		"高频解列fH", 			50.1 , 	55.0,			51.0 ,	0,			0,				GROUP_SET_PLJL,0X0000, FLOAT_R},
	#endif
	{SETTYPE_F,		SET_S,		"高频解列延时TfH",			0.0 , 	999.0,			2.0 ,	      0,			0,				GROUP_SET_PLJL,0X0000, FLOAT_R},
#endif

	{SETTYPE_LIST,	SET_NULL,	"滑差闭锁低频投入", 			0 , 		TTListNum-1,		0,		TTList, 	TTListNum,		GROUP_SET_PLJL,0X0000, BOOL_R},
	{SETTYPE_F,		SET_HZ_S,	"滑差闭锁低频定值",			1.0 , 	50.0,			8.0 ,	       0,		 	0,				GROUP_SET_PLJL,0X0000, FLOAT_R},

#ifdef FUNC_SEL_MODE_FA
	{SETTYPE_LABEL, SET_NULL,	"馈线自动化类功能选择控制字", 			0 , 		0,				0 , 	0,			0,				GROUP_SET_FA_SEL,0X0000, NULL_R},
	{SETTYPE_LIST,	SET_NULL,	"功能选择", 			0 , 		SelFAListNum-1,	1,		SelFAList,	SelFAListNum,	GROUP_SET_FA_SEL,0x500B, UINT_R},
#endif

#ifdef	GD_AREA_HEYUAN
	{SETTYPE_LABEL,	SET_NULL,	"馈线自动化控制字", 			0 , 		0,				0 ,		0,			0,				GROUP_SET_FATT,0X0000, NULL_R},
#else
	{SETTYPE_LABEL,	SET_NULL,	"电压电流型控制字", 			0 , 		0,				0 ,		0,			0,				GROUP_SET_FATT,0X0000, NULL_R},
#endif

#ifdef GD_AREA_ECZD_2020 //2020二次指导意见 2020-9-8
    {SETTYPE_LIST,	SET_NULL,	"通信模式", 			1 , 		TFA_TypeNum-1,	1,		TFA_Type,	TFA_TypeNum,	GROUP_SET_FATT,0x500B, UINT_R},
    {SETTYPE_LIST,	SET_NULL,	"分段/联络模式", 			0 , 		KGFunListNum-1,	1,		KGFunList,	KGFunListNum,	GROUP_SET_FATT,0x500C, UINT_R},

    {SETTYPE_LIST,	SET_NULL,	"母线侧得电延时合闸",		0 , 		TTListNum-1,		0,		TTList, 	TTListNum,		GROUP_SET_FATT,0x500D, BOOL_R},
    {SETTYPE_LIST,	SET_NULL,	"线路侧得电延时合闸",		0 , 		TTListNum-1,		0,		TTList, 	TTListNum,		GROUP_SET_FATT,0x500E, BOOL_R},
    {SETTYPE_LIST,	SET_NULL,	"母线侧失电延时合闸",		0 , 		TTListNum-1,		0,		TTList, 	TTListNum,		GROUP_SET_FATT,0x500F, BOOL_R},
    {SETTYPE_LIST,	SET_NULL,	"线路侧失电延时合闸",		0 , 		TTListNum-1,		0,		TTList, 	TTListNum,		GROUP_SET_FATT,0x5010, BOOL_R},
	{SETTYPE_LIST,	SET_NULL,	"失电延时分闸", 			0 , 		TTListNum-1,		0,		TTList,		TTListNum,		GROUP_SET_FATT,0x5012, BOOL_R},
	{SETTYPE_LIST,	SET_NULL,	"合到故障电流判据", 		0 , 		TTListNum-1,		0,		TTList,		TTListNum,		GROUP_SET_FATT,0x5013, BOOL_R},
	{SETTYPE_LIST,	SET_NULL,	"合到故障快速分闸", 		0 , 		TTListNum-1,		0,		TTList,		TTListNum,		GROUP_SET_FATT,0x5014, BOOL_R},

	{SETTYPE_LIST,	SET_NULL,	"合闸成功闭锁失压分", 	0 , 		TTListNum-1,		0,		TTList,		TTListNum,		GROUP_SET_FATT,0x5015, BOOL_R},	
	#ifdef FUNC_FA_GL_TT
		{SETTYPE_LIST,	SET_NULL,	"相间故障电流I段投入", 	0 , 		TTListNum-1,		0,		TTList, 	TTListNum,		GROUP_SET_FATT,0x0000, BOOL_R},
		{SETTYPE_LIST,	SET_NULL,	"相间故障电流II段投入",	0 , 		TTListNum-1,		0,		TTList, 	TTListNum,		GROUP_SET_FATT,0x0000, BOOL_R},
	#endif
	{SETTYPE_LIST,	SET_NULL,	"相间过流告警投入", 	0 , 		TTListNum-1,		0,		TTList, 	TTListNum,		GROUP_SET_FATT,0x5015, BOOL_R},
	{SETTYPE_LIST,	SET_NULL,	"接地告警投入",	0 , 		TTListNum-1,		0,		TTList, 	TTListNum,		GROUP_SET_FATT,0x5015, BOOL_R},

	{SETTYPE_LIST,	SET_NULL,	"合到零压保护",			0 , 		TZCKListNum-1,	0,		TZCKList,	TZCKListNum,		GROUP_SET_FATT,0x5018, UINT_R},
	{SETTYPE_LIST,	SET_NULL,	"非遮断电流保护",		0 , 		TTListNum-1,		0,		TTList, 	TTListNum,		GROUP_SET_FATT,0x5019, BOOL_R},
	{SETTYPE_LIST,	SET_NULL,	"PT断线告警",			0 , 		TTListNum-1,		0,		TTList, 	TTListNum,		GROUP_SET_FATT,0x501A, BOOL_R},
	#ifdef GD_AREA_ECZD_SHAOGUAN_2021
		{SETTYPE_LIST,	SET_NULL,	"控制回路断线告警",			0 , 		TTListNum-1,		0,		TTList, 	TTListNum,		GROUP_SET_FATT,0X0000, BOOL_R},
	#endif
	{SETTYPE_LIST,	SET_NULL,	"多次失压分闸闭锁", 		0 , 		TTListNum-1,	0,		TTList, TTListNum,GROUP_SET_FATT,0x0000, BOOL_R},
    {SETTYPE_LIST,	SET_NULL,	"涌流识别投入", 			0 , 		TTListNum-1,		0,		TTList,		TTListNum,		GROUP_SET_FATT,0, BOOL_R},
	//扩展
	{SETTYPE_LIST,	SET_NULL,	"残压闭锁", 			0 , 		TTListNum-1,		1,		TTList,		TTListNum,		GROUP_SET_FATT,0, BOOL_R},	
	#ifdef GD_AREA_ZHONGSHAN_2020
		{SETTYPE_LIST,	SET_NULL,	"合到故障主动跳闸", 		0 , 		TTListNum-1,		1,		TTList,		TTListNum,		GROUP_SET_FATT,0, BOOL_R},	
	#endif
#else //非2020二次指导意见 2020-9-8
	#if defined GD_AREA_ZHUHAI_V2 
		{SETTYPE_LIST,	SET_NULL,	"不依赖通信/依赖通信模式", 			1 , 		TFA_TypeNum-1,	1,		TFA_Type,	TFA_TypeNum,	GROUP_SET_FATT,0x500B, UINT_R},
	#else
		{SETTYPE_LIST,	SET_NULL,	"通信模式", 			1 , 		TFA_TypeNum-1,	1,		TFA_Type,	TFA_TypeNum,	GROUP_SET_FATT,0x500B, UINT_R},
	#endif
	#ifndef GD_AREA_HEYUAN_2021
		#if defined GD_AREA_SHANWEI_2021
		{SETTYPE_LIST,	SET_NULL,	"分段/联络模式", 			0 , 		KGFunListNum-1,	1,		KGFunList,	KGFunListNum,	GROUP_SET_FATT,0x500C, UINT_R},
		#else
		{SETTYPE_LIST,	SET_NULL,	"分段/联络模式", 			1 , 		KGFunListNum-1,	1,		KGFunList,	KGFunListNum,	GROUP_SET_FATT,0x500C, UINT_R},
		#endif
	#endif
	#if defined GD_AREA_ZHONGSHAN || defined GD_AREA_ZHUHAI || defined GD_AREA_JIEYANG || defined GD_AREA_JIEYANG_2021 || defined GD_AREA_HEYUAN_2021
		{SETTYPE_LIST,	SET_NULL,	"母线侧得电延时合闸",		0 , 		TTListNum-1,		0,		TTList, 	TTListNum,		GROUP_SET_FATT,0x500D, BOOL_R},
		{SETTYPE_LIST,	SET_NULL,	"线路侧得电延时合闸",		0 , 		TTListNum-1,		0,		TTList, 	TTListNum,		GROUP_SET_FATT,0x500E, BOOL_R},
		{SETTYPE_LIST,	SET_NULL,	"母线侧失电延时合闸",		0 , 		TTListNum-1,		0,		TTList, 	TTListNum,		GROUP_SET_FATT,0x500F, BOOL_R},
		{SETTYPE_LIST,	SET_NULL,	"线路侧失电延时合闸",		0 , 		TTListNum-1,		0,		TTList, 	TTListNum,		GROUP_SET_FATT,0x5010, BOOL_R},
	#elif defined  GD_AREA_ZHUHAI_V2
		{SETTYPE_LIST,	SET_NULL,	"电缆侧得电延时合闸",		0 , 		TTListNum-1,		0,		TTList, 	TTListNum,		GROUP_SET_FATT,0x500D, BOOL_R},
		{SETTYPE_LIST,	SET_NULL,	"母线侧得电延时合闸",		0 , 		TTListNum-1,		0,		TTList, 	TTListNum,		GROUP_SET_FATT,0x500E, BOOL_R},
		{SETTYPE_LIST,	SET_NULL,	"电缆侧失电延时合闸",		0 , 		TTListNum-1,		0,		TTList, 	TTListNum,		GROUP_SET_FATT,0x500F, BOOL_R},
		{SETTYPE_LIST,	SET_NULL,	"母线侧失电延时合闸",		0 , 		TTListNum-1,		0,		TTList, 	TTListNum,		GROUP_SET_FATT,0x5010, BOOL_R},
	#elif defined GD_AREA_ZHUHAI_FTU
		{SETTYPE_LIST,	SET_NULL,	"电源侧得电延时合闸",		0 , 		TTListNum-1,		0,		TTList, 	TTListNum,		GROUP_SET_FATT,0x500D, BOOL_R},
		{SETTYPE_LIST,	SET_NULL,	"负荷侧得电延时合闸",		0 , 		TTListNum-1,		0,		TTList, 	TTListNum,		GROUP_SET_FATT,0x500E, BOOL_R},
		{SETTYPE_LIST,	SET_NULL,	"电源侧失电延时合闸",		0 , 		TTListNum-1,		0,		TTList, 	TTListNum,		GROUP_SET_FATT,0x500F, BOOL_R},
		{SETTYPE_LIST,	SET_NULL,	"负荷侧失电延时合闸",		0 , 		TTListNum-1,		0,		TTList, 	TTListNum,		GROUP_SET_FATT,0x5010, BOOL_R},
	#else	
		{SETTYPE_LIST,	SET_NULL,	"A侧得电延时合闸", 		0 , 		TTListNum-1,		0,		TTList,		TTListNum,		GROUP_SET_FATT,0x500D, BOOL_R},
		{SETTYPE_LIST,	SET_NULL,	"B侧得电延时合闸", 		0 , 		TTListNum-1,		0,		TTList,		TTListNum,		GROUP_SET_FATT,0x500E, BOOL_R},
		#ifdef GD_TEST_2021
			{SETTYPE_LIST,	SET_NULL,	"A侧失电延时选择", 		0 , 		GJTZListNum-1,		0,		GJHZList,		GJTZListNum,		GROUP_SET_FATT,0x500F, UINT_R},
			{SETTYPE_LIST,	SET_NULL,	"B侧失电延时选择", 		0 , 		GJTZListNum-1,		0,		GJHZList,		GJTZListNum,		GROUP_SET_FATT,0x5010, UINT_R},
		#else
			{SETTYPE_LIST,	SET_NULL,	"A侧失电延时合闸", 		0 , 		TTListNum-1,		0,		TTList,		TTListNum,		GROUP_SET_FATT,0x500F, BOOL_R},
			{SETTYPE_LIST,	SET_NULL,	"B侧失电延时合闸", 		0 , 		TTListNum-1,		0,		TTList,		TTListNum,		GROUP_SET_FATT,0x5010, BOOL_R},
		#endif
	#endif
		{SETTYPE_LIST,	SET_NULL,	"合到故障闭锁合闸", 		0 , 		TTListNum-1,		1,		TTList,		TTListNum,		GROUP_SET_FATT,0, BOOL_R},
		{SETTYPE_LIST,	SET_NULL,	"失电延时分闸", 			0 , 		TTListNum-1,		0,		TTList,		TTListNum,		GROUP_SET_FATT,0x5012, BOOL_R},
		{SETTYPE_LIST,	SET_NULL,	"合到故障电流判据", 		0 , 		TTListNum-1,		0,		TTList,		TTListNum,		GROUP_SET_FATT,0x5013, BOOL_R},
		{SETTYPE_LIST,	SET_NULL,	"合到故障快速分闸", 		0 , 		TTListNum-1,		0,		TTList,		TTListNum,		GROUP_SET_FATT,0x5014, BOOL_R},
		{SETTYPE_LIST,	SET_NULL,	"合闸成功闭锁失压分", 	0 , 		TTListNum-1,		0,		TTList,		TTListNum,		GROUP_SET_FATT,0x5015, BOOL_R},		
    {SETTYPE_LIST,	SET_NULL,	"残压闭锁", 			0 , 		TTListNum-1,		1,		TTList,		TTListNum,		GROUP_SET_FATT,0, BOOL_R},	
    #if defined GD_AREA_MAIN_2020 && !defined GD_AREA_HEYUAN_2021
        {SETTYPE_LIST,  SET_NULL,   "涌流识别",             0 ,         TTListNum-1,        0,      TTList,     TTListNum,      GROUP_SET_FATT,0, BOOL_R},
    #else
        {SETTYPE_LIST,  SET_NULL,   "涌流识别投入",             0 ,         TTListNum-1,        0,      TTList,     TTListNum,      GROUP_SET_FATT,0, BOOL_R},
    #endif
    #ifdef GD_AREA_HEYUAN_2021
        {SETTYPE_LIST,  SET_NULL,   "合到零压保护",         0 ,         TZCKListNum-1,  0,      TZCKList,   TZCKListNum,        GROUP_SET_FATT,0x5018, UINT_R},
    #else
    {SETTYPE_LIST,  SET_NULL,   "零序电压保护",         0 ,         TZCKListNum-1,  0,      TZCKList,   TZCKListNum,        GROUP_SET_FATT,0x5018, UINT_R},
    #endif
    {SETTYPE_LIST,  SET_NULL,   "非遮断电流保护",       0 ,         TTListNum-1,        0,      TTList,     TTListNum,      GROUP_SET_FATT,0x5019, BOOL_R},
    {SETTYPE_LIST,  SET_NULL,   "PT断线告警",           0 ,         TTListNum-1,        0,      TTList,     TTListNum,      GROUP_SET_FATT,0x501A, BOOL_R},
    //广东新标准
    {SETTYPE_LIST,  SET_NULL,   "相间过流告警投入",     0 ,         TTListNum-1,        0,      TTList,     TTListNum,      GROUP_SET_FATT,0x5015, BOOL_R},
    {SETTYPE_LIST,  SET_NULL,   "接地告警投入", 0 ,         TTListNum-1,        0,      TTList,     TTListNum,      GROUP_SET_FATT,0x5015, BOOL_R},
    {SETTYPE_LIST,  SET_NULL,   "双侧有压闭锁合闸",     0 ,         TTListNum-1,        1,      TTList,     TTListNum,      GROUP_SET_FATT,0x5015, BOOL_R},
    {SETTYPE_LIST,  SET_NULL,   "手动/遥控分闸闭锁得电合",  0 ,         TTListNum-1,        1,      TTList,     TTListNum,      GROUP_SET_FATT,0x5015, BOOL_R},
    #ifdef GD_AREA_MAIN_2020
	    {SETTYPE_LIST,  SET_NULL,   "手合无压分闸", 0 ,         TTListNum-1,        0,      TTList,     TTListNum,      GROUP_SET_FATT,0x5015, BOOL_R},
    #else
	    {SETTYPE_LIST,    SET_NULL,   "手合无压分闸", 0 ,         TTListNum-1,        1,      TTList,     TTListNum,      GROUP_SET_FATT,0x5015, BOOL_R},
    #endif
    {SETTYPE_LIST,  SET_NULL,   "连续分闸闭锁投退",         0 ,         TTListNum-1,    0,      TTList, TTListNum,GROUP_SET_FATT,0x0000, BOOL_R},
	#ifdef	FA_OC_COUNT
		{SETTYPE_LIST,	SET_NULL,	"过流脉冲计数投退", 		0 , 		TTListNum-1,	0,		TTList, TTListNum,GROUP_SET_FATT,0x0000, BOOL_R},
	#endif
#endif

#ifdef	GD_AREA_HEYUAN
	{SETTYPE_LABEL,	SET_NULL,	"馈线自动化定值", 				0 , 		0,				0 ,		0,			0,				GROUP_SET_FADZ,0X0000, NULL_R},
#else
	{SETTYPE_LABEL,	SET_NULL,	"电压电流型定值", 				0 , 		0,				0 ,		0,			0,				GROUP_SET_FADZ,0X0000, NULL_R},
#endif

#ifdef GD_AREA_ECZD_2020
	{SETTYPE_F, 	SET_PERUN,	"有压定值", 					0.0 ,	100.0,			80.0 ,	0,			0,				GROUP_SET_FADZ,0x501B, FLOAT_R},
	{SETTYPE_F, 	SET_S,		"有压定值时间",			0.0 ,	99.0,			0.1 ,		0,			0,				GROUP_SET_FADZ,0x501C, FLOAT_R},
	{SETTYPE_F, 	SET_PERUN,	"失压定值", 					0.0 ,	100.0,			20.0 ,	0,			0,				GROUP_SET_FADZ,0x501D, FLOAT_R},
	{SETTYPE_F, 	SET_S,		"失压定值时间",			0.0 ,	99.0,			0.1 ,		0,			0,				GROUP_SET_FADZ,0x501E, FLOAT_R},
	{SETTYPE_F, 	SET_S,		"得电合闸延时(X时限)",  0 , 		999,				7 , 	0,			0,				GROUP_SET_FADZ,0x501F, FLOAT_R},
	#if defined GD_AREA_ECZD_SHAOGUAN_2021
		{SETTYPE_F, 	SET_S,		"故障检测时限(Y时限)",						0 , 		999,				5 , 	0,			0,				GROUP_SET_FADZ,0x5020, FLOAT_R},
	#else
		{SETTYPE_F, 	SET_S,		"故障检测时限(Y时限)",						0 , 		99, 			5 , 	0,			0,				GROUP_SET_FADZ,0x5020, FLOAT_R},
	#endif
    {SETTYPE_F, 	SET_S,		"失压合闸延时(XL时限)", 					0 , 		999,				7 , 	0,			0,				GROUP_SET_FADZ,0x5021, FLOAT_R},
	#ifdef GD_AREA_ZHONGSHAN_2020
		{SETTYPE_F, 	SET_S,		"联络充电时限(YL时限)", 					0 , 		99, 			6 , 	0,			0,				GROUP_SET_FADZ,0x5020, FLOAT_R},
	#endif
	#if defined GD_AREA_ECZD_SHAOGUAN_2021
		{SETTYPE_F, 	SET_S,		"失电分闸延时(Z时限)",			0 , 		999,				3.5 ,		0,			0,				GROUP_SET_FADZ,0x5022, FLOAT_R},
	#else
		{SETTYPE_F, 	SET_S,		"失电分闸延时(Z时限)",			0 , 		99, 			3.5 ,		0,			0,				GROUP_SET_FADZ,0x5022, FLOAT_R},
	#endif
		{SETTYPE_F, 	SET_S,		"闭锁分闸复归时间", 			0 , 600,				300 ,	0,			0,				GROUP_SET_FADZ,0x5023, FLOAT_R},

	#ifdef GD_AREA_ECZD_SHAOGUAN_2021
		{SETTYPE_F, 	SET_A,		"相间故障电流I段定值", 	0.0 ,	600.0,			100.0 , 	0,			0,				GROUP_SET_FADZ,0x5024, FLOAT_R},
		{SETTYPE_F, 	SET_S,		"相间故障电流I段时间", 		0 , 		600,		99 ,		0,			0,				GROUP_SET_FADZ,0x5026, FLOAT_R}, 
		{SETTYPE_F, 	SET_A,		"相间故障电流II段定值",		0.0 ,	600.0,			100.0 , 	0,			0,				GROUP_SET_FADZ,0x5025, FLOAT_R},
		{SETTYPE_F, 	SET_S,		"相间故障电流II段时间",		0 , 		600,		99 ,		0,			0,				GROUP_SET_FADZ,0x5026, FLOAT_R}, 
		{SETTYPE_F, 	SET_A,		"接地故障电流定值", 	0.0 ,	600.0,			100,		0,			0,				GROUP_SET_FADZ,0x5025, FLOAT_R},
		{SETTYPE_F, 	SET_S,		"接地故障时间定值", 		0 , 		600,			99 ,		0,			0,				GROUP_SET_FADZ,0x0000, FLOAT_R},
		{SETTYPE_F, 	SET_U,		"复合电压低电压定值",			0.0 ,	600.0,			20.0 ,	0,			0,				GROUP_SET_FADZ,0x0000, FLOAT_R},
		{SETTYPE_F, 	SET_U,		"复合电压负序电压定值",			0.0 ,	600.0,			20.0 ,	0,			0,				GROUP_SET_FADZ,0x0000, FLOAT_R},
		{SETTYPE_F, 	SET_A,		"相间过流告警电流I段定值",		0.0 ,	600.0,			100.0 , 	0,			0,				GROUP_SET_FADZ,0x5024, FLOAT_R},
		{SETTYPE_F, 	SET_S,		"相间过流告警I段时间", 		0 , 		600,			99 ,		0,			0,				GROUP_SET_FADZ,0x5026, FLOAT_R},
		{SETTYPE_F, 	SET_A,		"接地告警电流定值", 	0.0 ,	600.0,			100.0 , 	0,			0,				GROUP_SET_FADZ,0x5025, FLOAT_R},
		{SETTYPE_F, 	SET_S,		"接地告警时间定值", 		0 , 		600,				99 ,		0,			0,				GROUP_SET_FADZ,0x0000, FLOAT_R},
		{SETTYPE_F, 	SET_U,		"零序电压保护电压定值",			0.0 ,	1000.0, 		20.0 ,	0,			0,				GROUP_SET_FADZ,0x0000, FLOAT_R},
		{SETTYPE_F, 	SET_S,		"零序电压保护时间定值",			0.0 ,	600.0,			0.6 ,		0,			0,				GROUP_SET_FADZ,0X0000, FLOAT_R},
		{SETTYPE_F, 	SET_A,		"无流定值", 	0.0 ,	600.0,			0.04 ,	0,			0,				GROUP_SET_FADZ,0x5025, FLOAT_R},
		{SETTYPE_F, 	SET_A,		"非遮断电流值",			0.0 ,	600.0,			5 , 	0,			0,				GROUP_SET_FADZ,0x5027, FLOAT_R},	
	#else
        {SETTYPE_F, 	SET_A,		"相间故障电流I段定值", 	0.0 ,	100.0,			100.0 , 	0,			0,				GROUP_SET_FADZ,0x5024, FLOAT_R},
        {SETTYPE_F, 	SET_S,		"相间故障电流I段时间", 		0 , 		99, 		99 ,		0,			0,				GROUP_SET_FADZ,0x5026, FLOAT_R}, 
        {SETTYPE_F, 	SET_A,		"相间故障电流II段定值",		0.0 ,	100.0,			100.0 , 	0,			0,				GROUP_SET_FADZ,0x5025, FLOAT_R},
        {SETTYPE_F, 	SET_S,		"相间故障电流II段时间",		0 , 		99, 		99 ,		0,			0,				GROUP_SET_FADZ,0x5026, FLOAT_R}, 
        {SETTYPE_F, 	SET_A,		"接地故障电流定值", 	0.0 ,	100.0,			100,		0,			0,				GROUP_SET_FADZ,0x5025, FLOAT_R},
        {SETTYPE_F, 	SET_S,		"接地故障时间定值", 		0 , 		99, 			99 ,		0,			0,				GROUP_SET_FADZ,0x0000, FLOAT_R},
        {SETTYPE_F, 	SET_U,		"复合电压低电压定值",			0.0 ,	100.0,			20.0 ,	0,			0,				GROUP_SET_FADZ,0x0000, FLOAT_R},
        {SETTYPE_F, 	SET_U,		"复合电压负序电压定值",			0.0 ,	100.0,			20.0 ,	0,			0,				GROUP_SET_FADZ,0x0000, FLOAT_R},
        {SETTYPE_F, 	SET_A,		"相间过流告警电流定值",		0.0 ,	100.0,			100.0 , 	0,			0,				GROUP_SET_FADZ,0x5024, FLOAT_R},
        {SETTYPE_F, 	SET_S,		"相间过流告警时间定值",			0 , 		99, 			99 ,		0,			0,				GROUP_SET_FADZ,0x5026, FLOAT_R},
        {SETTYPE_F, 	SET_A,		"接地告警电流定值", 	0.0 ,	100.0,			100.0 , 	0,			0,				GROUP_SET_FADZ,0x5025, FLOAT_R},
        {SETTYPE_F, 	SET_S,		"接地告警时间定值", 		0 , 		99, 			99 ,		0,			0,				GROUP_SET_FADZ,0x0000, FLOAT_R},
		#ifdef GD_AREA_ZHONGSHAN_2020
			{SETTYPE_F, 	SET_U,		"合到零压保护电压定值",			0.0 ,	100.0,			20.0 ,	0,			0,				GROUP_SET_FADZ,0x0000, FLOAT_R},
			{SETTYPE_F, 	SET_S,		"合到零压保护时间定值",			0.0 ,	99.0,			0.6 ,		0,			0,				GROUP_SET_FADZ,0X0000, FLOAT_R},
		#else
			#if defined GD_AREA_ECZD_2020 || defined GD_AREA_ECZD_MAOMING
				#ifdef GD_AREA_ECZD_CHAOZHOU_2022
					{SETTYPE_F, 	SET_U,		"合到零压保护电压定值",			0.0 ,	1000.0, 		20.0 ,	0,			0,				GROUP_SET_FADZ,0x0000, FLOAT_R},
				#else
					{SETTYPE_F, 	SET_U,		"零序电压保护电压定值",			0.0 ,	1000.0, 		20.0 ,	0,			0,				GROUP_SET_FADZ,0x0000, FLOAT_R},
				#endif
			#else
				{SETTYPE_F, 	SET_U,		"零序电压保护电压定值",			0.0 ,	100.0,			20.0 ,	0,			0,				GROUP_SET_FADZ,0x0000, FLOAT_R},
			#endif
			
			#ifdef GD_AREA_ECZD_CHAOZHOU_2022
				{SETTYPE_F, 	SET_S,		"合到零压保护时间定值",			0.0 ,	99.0,			0.6 ,		0,			0,				GROUP_SET_FADZ,0X0000, FLOAT_R},
			#else
				{SETTYPE_F, 	SET_S,		"零序电压保护时间定值",			0.0 ,	99.0,			0.6 ,		0,			0,				GROUP_SET_FADZ,0X0000, FLOAT_R},
			#endif
		#endif
		
		{SETTYPE_F, 	SET_A,		"无流定值", 	0.0 ,	100.0,			0.05 ,	0,			0,				GROUP_SET_FADZ,0x5025, FLOAT_R},
		{SETTYPE_F, 	SET_A,		"非遮断电流值",			0.0 ,	100.0,			5 , 	0,			0,				GROUP_SET_FADZ,0x5027, FLOAT_R},
	#endif
	
	#ifdef INRUSH_CURRENT_IN_DECIMALS
        {SETTYPE_F, 	SET_NULL,	"涌流识别定值",			0.0 ,	1.00,			0.15 ,		0,			0,				GROUP_SET_FADZ,0x0000, FLOAT_R},
	#else
        {SETTYPE_F, 	SET_PER,	"涌流识别定值",			0.0 ,	100.0,			15 ,		0,			0,				GROUP_SET_FADZ,0x0000, FLOAT_R},
	#endif
	#if defined GD_AREA_ZHONGSHAN_2020 || defined GD_AREA_ECZD_MAOMING
		{SETTYPE_F, 	SET_S,		"快速跳闸延时",			0 , 		99, 			99 ,		0,			0,				GROUP_SET_FADZ,0x5026, FLOAT_R},
	#endif
	{SETTYPE_UINT,	SET_NULL,	"多次失压分闸闭锁次数",		1,		5,				3 , 0,		0,			GROUP_SET_FADZ,0x0000, UINT_R},
	{SETTYPE_F, 	SET_S,		"多次失压分闸闭锁时间",		0.1 ,	65536.0,			300.0 , 	0,			0,			GROUP_SET_FADZ,0x0000, FLOAT_R},

	{SETTYPE_LABEL, SET_NULL,	"电压电流型软压板", 			0 , 		0,				0 , 	0,			0,				GROUP_SET_FAYB,0X0000, NULL_R},
	#ifdef GD_AREA_ECZD_MAOMING
		{SETTYPE_LIST,	SET_NULL,	"远方整定投入软压板",	0 , 		TTListNum-1,		0,		TTList, 	TTListNum,		GROUP_SET_FAYB,0X5024, BOOL_R},
	#endif
	{SETTYPE_LIST,	SET_NULL,	"分段/联络模式软压板", 		0 , 		KGFunListNum-1, 1,		KGFunList,	KGFunListNum,	GROUP_SET_FAYB,0x500C, BOOL_R},
#else	//非2020指导意见 2020-9-8
	{SETTYPE_F,		SET_PERUN,	"有压定值", 					0.0 , 	100.0,			80.0 ,	0,			0,				GROUP_SET_FADZ,0x501B, FLOAT_R},
	{SETTYPE_F,		SET_S,		"有压定值时间",			0.0 , 	99.0,			0.1 ,		0,			0,				GROUP_SET_FADZ,0x501C, FLOAT_R},
	{SETTYPE_F,		SET_PERUN,	"失压定值", 					0.0 , 	100.0,			20.0 ,	0,			0,				GROUP_SET_FADZ,0x501D, FLOAT_R},
	{SETTYPE_F,		SET_S,		"失压定值时间",			0.0 , 	99.0,			0.1 ,		0,			0,				GROUP_SET_FADZ,0x501E, FLOAT_R},
	{SETTYPE_F,		SET_S,		"得电合闸延时(X时限)",						0 , 		999,				7 ,		0,			0,				GROUP_SET_FADZ,0x501F, FLOAT_R},
	#ifdef GD_AREA_HEYUAN_2021
		{SETTYPE_F,		SET_S,		"故障检测时限(Y时限)",						0 , 		300,			5 ,		0,			0,				GROUP_SET_FADZ,0x5020, FLOAT_R},
	#else
	{SETTYPE_F,		SET_S,		"故障检测时限(Y时限)",						0 , 		99,				5 ,		0,			0,				GROUP_SET_FADZ,0x5020, FLOAT_R},
	#endif
	{SETTYPE_F,		SET_S,		"失压合闸延时(XL时限)",						0 , 		999,				7 ,		0,			0,				GROUP_SET_FADZ,0x5021, FLOAT_R},
	#ifdef GD_AREA_HEYUAN_2021
		{SETTYPE_F,		SET_S,		"失电分闸延时(Z时限)",			0 , 		300,			3.5 ,		0,			0,				GROUP_SET_FADZ,0x5022, FLOAT_R},
	#else
	{SETTYPE_F,		SET_S,		"失电分闸延时(Z时限)",			0 , 		99,				3.5 ,		0,			0,				GROUP_SET_FADZ,0x5022, FLOAT_R},
	#endif
    {SETTYPE_F, 	SET_S,		"合闸成功闭锁失压分延时", 	0 , 		600,				300 ,	0,			0,				GROUP_SET_FADZ,0x5023, FLOAT_R},//FOS
	#ifdef GD_AREA_MAIN_2020
	    {SETTYPE_F, 	SET_A,		"相间故障电流定值", 	0.0 ,	100.0,			100.0 , 	0,			0,				GROUP_SET_FADZ,0x5024, FLOAT_R},
	    {SETTYPE_F,     SET_A,      "接地故障电流定值",     0.0 ,    100.0,          100.0 ,     0,          0,              GROUP_SET_FADZ,0x5025, FLOAT_R},

	    {SETTYPE_F, 	SET_A,		"相间故障电流II段定值",	 0.0 ,	 100.0, 		 100.0 ,	 0, 		 0, 			 GROUP_SET_FADZ,0x5025, FLOAT_R},
	    {SETTYPE_F,     SET_S,      "相间故障电流I段时间",      0 ,         99,         0 ,        0,          0,              GROUP_SET_FADZ,0x5026, FLOAT_R},
	    {SETTYPE_F,     SET_S,      "相间故障电流II段时间",         0 ,         99,        0 ,        0,          0,              GROUP_SET_FADZ,0x5026, FLOAT_R},
	    {SETTYPE_F,     SET_S,      "接地故障电流时间",         0 , 99,             0 ,        0,          0,              GROUP_SET_FADZ,0x5026, FLOAT_R},
	#else
		#ifdef GD_AREA_CHAOZHOU  //潮州局要求合后电流两段处理       
		    {SETTYPE_F,     SET_A,      "相间电流I段定值",      0.0 ,   100.0,          100.0 ,     0,          0,              GROUP_SET_FADZ,0x5024, FLOAT_R},
		    {SETTYPE_F,     SET_A,      "相间电流II段定值",     0.0 ,   100.0,          100.0 ,     0,          0,              GROUP_SET_FADZ,0x5025, FLOAT_R},
		#elif defined GD_AREA_SHANTOU  //汕头局要求合后电流两段处理(I+t)
		    {SETTYPE_F,     SET_A,      "相间故障电流I段定值",      0.0 ,   100.0,          100.0 ,     0,          0,              GROUP_SET_FADZ,0x5024, FLOAT_R},
		    {SETTYPE_F,     SET_S,      "相间故障电流I段时间",      0 ,         99,         99 ,        0,          0,              GROUP_SET_FADZ,0x5026, FLOAT_R},
		    {SETTYPE_F,     SET_A,      "相间故障电流II段定值",     0.0 ,   100.0,          100.0 ,     0,          0,              GROUP_SET_FADZ,0x5025, FLOAT_R},
		    {SETTYPE_F,     SET_S,      "相间故障电流II段时间",         0 ,         99,         99 ,        0,          0,              GROUP_SET_FADZ,0x5026, FLOAT_R},
		    {SETTYPE_F,     SET_A,      "相间故障电流定值",     0.0 ,   100.0,          100.0 ,     0,          0,              GROUP_SET_FADZ,0x5024, FLOAT_R},
		    {SETTYPE_F,     SET_A,      "接地故障电流定值",     0.0 ,   100.0,          100.0 ,     0,          0,              GROUP_SET_FADZ,0x5025, FLOAT_R},
		#ifdef GD_AREA_SHANTOU
		    {SETTYPE_F,     SET_S,      "接地故障电流时间",         0 , 99,             99 ,        0,          0,              GROUP_SET_FADZ,0x5026, FLOAT_R},
		#endif
	    #endif
	#endif
	#ifdef GD_AREA_HEYUAN_2021
		{SETTYPE_F,		SET_U,		"合到零压保护电压", 			0.0 , 	220.0,			20.0 ,	0,			0,				GROUP_SET_FADZ,0x0000, FLOAT_R},
		{SETTYPE_F,		SET_S,		"合到零压保护时间",			0.0 , 	100.0,			0.6 ,		0,			0,				GROUP_SET_FADZ,0X0000, FLOAT_R},
	#else
	{SETTYPE_F,		SET_U,		"零序过压定值", 			0.0 , 	100.0,			20.0 ,	0,			0,				GROUP_SET_FADZ,0x0000, FLOAT_R},
	{SETTYPE_F,		SET_S,		"零序过压时间",			0.0 , 	99.0,			0.6 ,		0,			0,				GROUP_SET_FADZ,0X0000, FLOAT_R},
	#endif
    {SETTYPE_F, 	SET_A,		"相间过流告警电流定值",		0.0 ,	100.0,			100.0 , 	0,			0,				GROUP_SET_FADZ,0x5024, FLOAT_R},
    {SETTYPE_F, 	SET_S,		"相间过流告警时间定值",			0 , 		99, 			99 ,		0,			0,				GROUP_SET_FADZ,0x5026, FLOAT_R},
    {SETTYPE_F, 	SET_A,		"接地告警电流定值", 	0.0 ,	100.0,			100.0 , 	0,			0,				GROUP_SET_FADZ,0x5025, FLOAT_R},
    {SETTYPE_F, 	SET_S,		"接地告警时间定值", 		0 , 		99, 			99 ,		0,			0,				GROUP_SET_FADZ,0x0000, FLOAT_R},
    {SETTYPE_F, 	SET_A,		"无流定值", 	0.0 ,	100.0,			0.05 ,	0,			0,				GROUP_SET_FADZ,0x5025, FLOAT_R},

    {SETTYPE_F, 	SET_S,		"快速跳闸延时",			0 , 		99, 			99 ,		0,			0,				GROUP_SET_FADZ,0x5026, FLOAT_R},
    {SETTYPE_F, 	SET_A,		"非遮断电流值",			0.0 ,	100.0,			5 , 	0,			0,				GROUP_SET_FADZ,0x5027, FLOAT_R},
    #ifdef INRUSH_CURRENT_IN_DECIMALS
        {SETTYPE_F,		SET_NULL,	"涌流识别定值",			0.0 , 	1.00,			0.15 ,		0,			0,				GROUP_SET_FADZ,0x0000, FLOAT_R},
    #else
        {SETTYPE_F, 	SET_PER,	"涌流识别定值",			0.0 ,	100.0,			15 ,		0,			0,				GROUP_SET_FADZ,0x0000, FLOAT_R},
    #endif
	{SETTYPE_UINT,	SET_NULL,	"连续分闸次数",		1,		5,				3 , 0,		0,			GROUP_SET_FADZ,0x0000, UINT_R},
	{SETTYPE_F, 	SET_S,		"连续分闸时间",		0.1 ,	65536.0,			300.0 , 	0,			0,			GROUP_SET_FADZ,0x0000, FLOAT_R},
	#ifdef	FA_OC_COUNT
		{SETTYPE_UINT,	SET_NULL,	"过流脉冲次数",		1,		1000,				3 , 0,		0,			GROUP_SET_FADZ,0x0000, UINT_R},
		{SETTYPE_F, 	SET_S,		"过流脉冲复归时间",		0.1 ,	65536.0,			300.0 , 	0,			0,			GROUP_SET_FADZ,0x0000, FLOAT_R},
	#endif
	#ifdef GD_AREA_HEYUAN_2021
		{SETTYPE_LABEL, SET_NULL,   "馈线自动化软压板",           0 ,         0,              0 ,     0,          0,              GROUP_SET_FAYB,0X0000, NULL_R},
		{SETTYPE_LIST,	SET_NULL,	"分段/联络模式软压板", 			0 , 		KGFunListNum-1,	0,		KGFunList,	KGFunListNum,	GROUP_SET_FAYB,0x500C, BOOL_R},
	#endif
#endif

#if defined GD_AREA_ECZD_2020 || defined GD_AREA_MAIN_2020
    {SETTYPE_LABEL, SET_NULL,   "分布式FA控制字",           0 ,         0,              0 ,     0,          0,              GROUP_SET_GOOSETT,0X0000, NULL_R},
    {SETTYPE_LIST,  SET_NULL,   "缓动型FA方式",     0 ,         TGooseFANum-1,  0,      TGooseFA,   TGooseFANum,    GROUP_SET_GOOSETT,0X0000, BOOL_R},
    {SETTYPE_LIST,  SET_NULL,   "首开关失压跳闸保护投入",       0 ,         TTListNum-1,        0,      TTList,     TTListNum,      GROUP_SET_GOOSETT,0X0000, BOOL_R},
    {SETTYPE_LIST,  SET_NULL,   "本节点供电恢复保护投入",       0 ,         TTListNum-1,        0,      TTList,     TTListNum,      GROUP_SET_GOOSETT,0X0000, BOOL_R},
	#ifdef FUNC_GOOSE_FA_ADD
		{SETTYPE_LIST,  SET_NULL,   "投入过流I段保护",       0 ,         GTZListNum-1,        0,      GTZList,     GTZListNum,      GROUP_SET_GOOSETT,0X0000, BOOL_R},
		{SETTYPE_LIST,	SET_NULL,	"投入过流II段保护",	   0 ,		   GTZListNum-1, 	   0,	   GTZList,	   GTZListNum,	   GROUP_SET_GOOSETT,0X0000, BOOL_R},
		{SETTYPE_LIST,	SET_NULL,	"投入重合闸",	   0 ,		   TTListNum-1, 	   0,	   TTList,	   TTListNum,	   GROUP_SET_GOOSETT,0X0000, BOOL_R},
		{SETTYPE_LIST,	SET_NULL,	"重合闸次数",	   1 ,		   GCHZListNum-1, 	   1,	   GCHZList,	   GCHZListNum,	   GROUP_SET_GOOSETT,0X0000, BOOL_R},
		{SETTYPE_LIST,	SET_NULL,	"智能分布式FA启动条件",	1 ,		   GQDListNum-1, 	   1,	   GQDList,	   GQDListNum,	   GROUP_SET_GOOSETT,0X0000, BOOL_R},
		{SETTYPE_LIST,	SET_NULL,	"故障上游恢复合闸方式",	1 ,		   GHZListNum-1, 	   1,	   GHZList,	   GHZListNum,	   GROUP_SET_GOOSETT,0X0000, BOOL_R},
	#endif

    {SETTYPE_LABEL, SET_NULL,   "分布式FA定值",             0 ,         0,              0 ,     0,          0,              GROUP_SET_GOOSEDZ,0X0000, NULL_R},
    //#ifdef GD_AREA_ZHONGSHAN_2020
	#if defined GD_AREA_ZHONGSHAN_2020 || defined GD_AREA_MAIN_2020 
	    {SETTYPE_F,     SET_A,      "故障切除相电流I段",    0.05 ,  100.0,          50.0 ,  0,          0,              GROUP_SET_GOOSEDZ,0X0000, FLOAT_R},
	    {SETTYPE_F,     SET_S,      "相电流I段跳闸延时",            0.0 ,   100.0,          100.0 , 0,          0,              GROUP_SET_GOOSEDZ,0X0000, FLOAT_R},
	    {SETTYPE_F,     SET_A,      "故障切除相电流II段",   0.05 ,  100.0,          50.0 ,  0,          0,              GROUP_SET_GOOSEDZ,0X0000, FLOAT_R},
	    {SETTYPE_F,     SET_S,      "相电流II段跳闸延时",           0.0 ,   100.0,          100.0 , 0,          0,              GROUP_SET_GOOSEDZ,0X0000, FLOAT_R},
	    {SETTYPE_F,     SET_A,      "故障切除零序电流",     0.05 ,  100.0,          50.0 ,  0,          0,              GROUP_SET_GOOSEDZ,0X0000, FLOAT_R},
	    {SETTYPE_F,     SET_S,      "零序电流跳闸延时",         0.0 ,   100.0,          100.0 , 0,          0,              GROUP_SET_GOOSEDZ,0X0000, FLOAT_R},
	    {SETTYPE_F,     SET_S,      "故障点下游开关隔离时间",           0.00 ,  100.0,          0.1 ,       0,          0,              GROUP_SET_GOOSEDZ,0X0000, FLOAT_R},
	    {SETTYPE_F,     SET_S,      "首开关失压跳闸时限",   0.01 ,  100.0,          1.0 ,       0,          0,          GROUP_SET_GOOSEDZ,0X0000, FLOAT_R},
	    #ifdef GD_AREA_ECZD_CHAOZHOU_2022
		    {SETTYPE_F,     SET_S,      "供电恢复时限",         0.01 ,  100.0,          5.0 ,       0,          0,              GROUP_SET_GOOSEDZ,0X0000, FLOAT_R},
		    {SETTYPE_LIST,  SET_NULL,   "本接点开关类型",       0 ,         TGooseKGNum-1,  1,      TGooseKG,   TGooseKGNum,    GROUP_SET_GOOSEDZ,0X0000, UINT_R},
	    #else
		    {SETTYPE_F,     SET_S,      "恢复供电时限",         0.01 ,  100.0,          5.0 ,       0,          0,              GROUP_SET_GOOSEDZ,0X0000, FLOAT_R},
	    {SETTYPE_LIST,  SET_NULL,   "本节点开关类型",       0 ,         TGooseKGNum-1,  1,      TGooseKG,   TGooseKGNum,    GROUP_SET_GOOSEDZ,0X0000, UINT_R},
		#endif
	    {SETTYPE_LIST,  SET_NULL,   "开关位置类型",     0 ,         TGooseKGWZTYPENum-1,    1,      TGooseKGWZTYPE, TGooseKGWZTYPENum,  GROUP_SET_GOOSEDZ,0X0000, UINT_R},
	#elif defined GD_AREA_ECZD_2020
		{SETTYPE_F,     SET_A,  	"故障切除相电流定值",   0.05 ,  100.0,          50.0 ,  0,          0,              GROUP_SET_GOOSEDZ,0X0000, FLOAT_R},
	    {SETTYPE_F,     SET_A,      "故障切除零序定值",     0.05 ,  100.0,          50.0 ,  0,          0,              GROUP_SET_GOOSEDZ,0X0000, FLOAT_R},
	    {SETTYPE_F,     SET_S,      "故障跳闸时限",         0.01 ,   100.0,          100.0 , 0,          0,              GROUP_SET_GOOSEDZ,0X0000, FLOAT_R},
	    {SETTYPE_F, 	SET_S,		"首开关失压跳闸时限", 	0.01 ,	100.0,			1.0 ,		0,			0,			GROUP_SET_GOOSEDZ,0X0000, FLOAT_R},
	    {SETTYPE_F, 	SET_S,		"供电恢复时限", 			0.01 ,	100.0,			5.0 ,		0,			0,				GROUP_SET_GOOSEDZ,0X0000, FLOAT_R},
	    {SETTYPE_LIST,	SET_NULL,	"本接点开关类型", 		0 , 		TGooseKGNum-1,	1,		TGooseKG, 	TGooseKGNum,	GROUP_SET_GOOSEDZ,0X0000, UINT_R},
	#else
	    {SETTYPE_F,         SET_A,  "故障切除相电流",   0.05 ,  100.0,          50.0 ,  0,          0,              GROUP_SET_GOOSEDZ,0X0000, FLOAT_R},
	    {SETTYPE_F,     SET_A,      "故障切除零序电流",     0.05 ,  100.0,          50.0 ,  0,          0,              GROUP_SET_GOOSEDZ,0X0000, FLOAT_R},
	    {SETTYPE_F,     SET_S,      "故障跳闸时限",         0.0 ,   100.0,          100.0 , 0,          0,              GROUP_SET_GOOSEDZ,0X0000, FLOAT_R},
	#endif
	#ifdef FUNC_GOOSE_FA_ADD
		{SETTYPE_F, 	SET_A,		"过流I段保护定值",		0.0 ,	100.0,			50.0 ,	0,			0,				GROUP_SET_GOOSEDZ,0X0000, FLOAT_R},
		{SETTYPE_F, 	SET_S,		"过流I段保护时间",			0.0 ,	99.0,			99.0 , 0,			0,				GROUP_SET_GOOSEDZ,0X0000, FLOAT_R},
		{SETTYPE_F, 	SET_A,		"过流II段保护定值",		0.0 ,	100.0,			50.0 ,	0,			0,				GROUP_SET_GOOSEDZ,0X0000, FLOAT_R},
		{SETTYPE_F, 	SET_S,		"过流II段保护时间",			0.0 ,	99.0,			99.0 , 0,			0,				GROUP_SET_GOOSEDZ,0X0000, FLOAT_R},
		{SETTYPE_F, 	SET_S,		"一次重合闸时间", 		0.0 ,	199.0,			15.0 , 0,			0,				GROUP_SET_GOOSEDZ,0X0000, FLOAT_R},
		{SETTYPE_F, 	SET_S,		"二次重合闸时间", 		0.0 ,	199.0,			180.0 , 0,			0,				GROUP_SET_GOOSEDZ,0X0000, FLOAT_R},
		{SETTYPE_F, 	SET_S,		"FA通讯超时重发间隔",		   0.00 ,  99.0,		   99 ,	   0,		   0,			   GROUP_SET_GOOSEDZ,0X0000, FLOAT_R},
		{SETTYPE_F, 	SET_S,		"最大故障信号传输延时",		   0.00 ,  99.0,		   99 ,    0,		   0,			   GROUP_SET_GOOSEDZ,0X0000, FLOAT_R},
	#endif
#else
	{SETTYPE_LABEL,	SET_NULL,	"分布式FA控制字", 			0 , 		0,				0 ,		0,			0,				GROUP_SET_GOOSETT,0X0000, NULL_R},
	{SETTYPE_LIST,	SET_NULL,	"分布式FA功能", 			0 , 		TTListNum-1,		0,		TTList,		TTListNum,		GROUP_SET_GOOSETT,0X0000, BOOL_R},
	{SETTYPE_LIST,	SET_NULL,	"首开关失压分闸", 		0 , 		TTListNum-1,		0,		TTList,		TTListNum,		GROUP_SET_GOOSETT,0X0000, BOOL_R},
	{SETTYPE_LIST,	SET_NULL,	"本节点供电恢复", 		0 , 		TTListNum-1,		0,		TTList,		TTListNum,		GROUP_SET_GOOSETT,0X0000, BOOL_R},
	{SETTYPE_LIST,	SET_NULL,	"智能分布式动作类型", 	0 , 		TGooseFANum-1,	0,		TGooseFA, 	TGooseFANum,	GROUP_SET_GOOSETT,0X0000, BOOL_R},
	{SETTYPE_LIST,	SET_NULL,	"本节点开关类型", 		0 , 		TGooseKGNum-1,	1,		TGooseKG, 	TGooseKGNum,	GROUP_SET_GOOSETT,0X0000, UINT_R},
	{SETTYPE_LIST,	SET_NULL,	"组网方式", 					0 , 		THHTYPENum-1,	0,		THHTYPE,		THHTYPENum,		GROUP_SET_GOOSETT,0X0000, UINT_R},
	{SETTYPE_LIST,	SET_NULL,	"母线故障跳末开关", 		0 , 		TTListNum-1,		1,		TTList,		TTListNum,		GROUP_SET_GOOSETT,0X0000, BOOL_R},
	{SETTYPE_LIST,	SET_NULL,	"涌流识别", 					0 , 		TTListNum-1,		0,		TTList,		TTListNum,		GROUP_SET_GOOSETT,0X0000, BOOL_R},
	#ifdef GOOSE_NETTYPE_SET 
		{SETTYPE_LIST,	SET_NULL,	"goose网络类型", 		0 , GOOSE_NET_ListNum-1,	0,	GOOSE_NET_List,	GOOSE_NET_ListNum,	GROUP_CSTSET_OTHERS,0X0000, UINT_R},
    #endif
	
	{SETTYPE_LABEL,	SET_NULL,	"分布式FA定值", 			0 , 		0,				0 ,		0,			0,				GROUP_SET_GOOSEDZ,0X0000, NULL_R},
	#ifdef GD_AREA_ZHONGSHAN 
		{SETTYPE_F,		SET_A,		"故障切除相电流I段",	0.05 , 	100.0,			50.0 ,	0,			0,				GROUP_SET_GOOSEDZ,0X0000, FLOAT_R},	
		{SETTYPE_F,		SET_S,		"相电流I段跳闸延时",			0.0 , 	100.0,			100.0 ,	0,			0,				GROUP_SET_GOOSEDZ,0X0000, FLOAT_R},
		{SETTYPE_F,		SET_A,		"故障切除相电流II段",	0.05 , 	100.0,			50.0 ,	0,			0,				GROUP_SET_GOOSEDZ,0X0000, FLOAT_R},	
		{SETTYPE_F,		SET_S,		"相电流II段跳闸延时",			0.0 , 	100.0,			100.0 ,	0,			0,				GROUP_SET_GOOSEDZ,0X0000, FLOAT_R},
		{SETTYPE_F,		SET_A,		"故障切除零序电流",		0.05 , 	100.0,			50.0 ,	0,			0,				GROUP_SET_GOOSEDZ,0X0000, FLOAT_R},	
		{SETTYPE_F,		SET_S,		"零序电流跳闸延时",			0.0 , 	100.0,			100.0 ,	0,			0,				GROUP_SET_GOOSEDZ,0X0000, FLOAT_R},
	#else
		{SETTYPE_F, 		SET_A,		"故障切除相电流",	0.05 ,	100.0,			50.0 ,	0,			0,				GROUP_SET_GOOSEDZ,0X0000, FLOAT_R},	
		{SETTYPE_F,		SET_A,		"故障切除零序电流",		0.05 , 	100.0,			50.0 ,	0,			0,				GROUP_SET_GOOSEDZ,0X0000, FLOAT_R},	
		{SETTYPE_F,		SET_S,		"相电流跳闸延时",			0.0 , 	100.0,			100.0 ,	0,			0,				GROUP_SET_GOOSEDZ,0X0000, FLOAT_R},
		{SETTYPE_F,		SET_S,		"零序电流跳闸延时",			0.0 , 	100.0,			100.0 ,	0,			0,				GROUP_SET_GOOSEDZ,0X0000, FLOAT_R},
	#endif
	{SETTYPE_F, 		SET_S,		"首开关失压分闸延时", 	0.01 ,	100.0,			1.0 ,		0,			0,			GROUP_SET_GOOSEDZ,0X0000, FLOAT_R},
	{SETTYPE_F, 		SET_S,		"恢复供电时间", 			0.01 ,	100.0,			5.0 ,		0,			0,				GROUP_SET_GOOSEDZ,0X0000, FLOAT_R},
	{SETTYPE_F, 		SET_S,		"故障隔离时间", 			0.00 ,	100.0,			0.1 ,		0,			0,				GROUP_SET_GOOSEDZ,0X0000, FLOAT_R},
	#ifdef INRUSH_CURRENT_IN_DECIMALS
		{SETTYPE_F,		SET_NULL,		"涌流识别定值",			0.0 , 	1.00,			0.15 ,		0,			0,				GROUP_SET_GOOSEDZ,0x0000, FLOAT_R},
	#else
		{SETTYPE_F,		SET_PER,		"涌流识别定值",			0.0 , 	100.0,			15 ,		0,			0,				GROUP_SET_GOOSEDZ,0X0000, FLOAT_R},
	#endif
#endif

#ifdef	CUSTOMIZE_BZT //备自投
	{SETTYPE_LABEL, SET_NULL,	"备自投",	0 , 		0,				0 , 	0,			0,			GROUP_SET_BZT,0X0000, NULL_R},
	{SETTYPE_LIST,	SET_NULL,	"备自投投退	", 		0 , 		TTListNum-1,	0,		TTList,	TTListNum,		GROUP_SET_BZT,0X0000, BOOL_R},
	{SETTYPE_LIST,	SET_NULL,	"备自投方式	",		0 , 		BZTFSListNum-1,	0,		BZTFSList, BZTFSListNum,		GROUP_SET_BZT,0X0000, UINT_R},
	{SETTYPE_F, 	SET_S,	    "备自投跳闸时间",		0.01 ,		15.0,			10.0,	0,			0,			GROUP_SET_BZT,0X0000, FLOAT_R},
	{SETTYPE_F, 	SET_S,	    "备自投合闸时间",		0.01 ,		15.0,			10.0,	0,			0,			GROUP_SET_BZT,0X0000, FLOAT_R},
	{SETTYPE_F, 	SET_S,		"备自投充电时间",		1.0 ,		20.0,			5.0,	0,			0,			GROUP_SET_BZT,0X0000, FLOAT_R},
	{SETTYPE_F,		SET_U,	"备自投有压定值", 					0.0 , 	440.0,			100 ,	0,			0,				GROUP_SET_BZT,0X0000, FLOAT_R},
	{SETTYPE_F,		SET_U,	"备自投失压定值", 					0.0 , 	440.0,			40 ,	0,			0,				GROUP_SET_BZT,0X0000, FLOAT_R},
	{SETTYPE_F,		SET_A,	"备自投无流定值", 					0.0 , 	5.0,			0.1 ,	0,			0,				GROUP_SET_BZT,0X0000, FLOAT_R},
#endif
	
#ifndef GD_AREA_ECZD_2020 //2020二次指导意见将各种模式软压板分开显示 2020-9-8
	{SETTYPE_LABEL,	SET_NULL,	"装置软压板", 			0 , 		0,				0 ,		0,			0,				GROUP_SET_YB,0X0000, NULL_R},
	#ifdef	GD_AREA_FOS		//佛山显示启用重合闸软压板
		{SETTYPE_LIST,	SET_NULL,	"远方整定投入软压板",		0 , 		TTListNum-1,		1,		TTList,		TTListNum,		GROUP_SET_YB,0X5025, BOOL_R},
		{SETTYPE_LIST,	SET_NULL,	"重合闸投入软压板",	0 , 		TTListNum-1,		0,		TTList,		TTListNum,		GROUP_SET_YB,0X5024, BOOL_R},
		{SETTYPE_LIST,	SET_NULL,	"保护投入软压板",		0 , 		TTListNum-1,		1,		TTList,		TTListNum,		GROUP_SET_YB,0X5023, BOOL_R},
		{SETTYPE_LIST,	SET_NULL,	"保护功能投入软压板",	0 , 		TTListNum-1,		1,		TTList,		TTListNum,		GROUP_SET_YB,0X5026, BOOL_R},		
	#elif defined GD_AREA_ZHONGSHAN
		{SETTYPE_LIST,	SET_NULL,	"停用重合闸软压板", 0 , 		TTListNum-1,		0,		TTList, 	TTListNum,		GROUP_SET_YB,0X5024, BOOL_R},	
		{SETTYPE_LIST,	SET_NULL,	"远方修改定值软压板",		0 , 		TTListNum-1,		1,		TTList,		TTListNum,		GROUP_SET_YB,0X5025, BOOL_R},
		{SETTYPE_LIST,	SET_NULL,	"智能分布式软压板",		0 , 		TTListNum-1,		1,		TTList,		TTListNum,		GROUP_SET_YB,0X5025, BOOL_R},
		{SETTYPE_LIST,	SET_NULL,	"电压电流型软压板", 	0 , 		TTListNum-1,		1,		TTList, 	TTListNum,		GROUP_SET_YB,0X5025, BOOL_R},
		{SETTYPE_LIST,	SET_NULL,	"电流型软压板", 	0 , 		TTListNum-1,		1,		TTList, 	TTListNum,		GROUP_SET_YB,0X5025, BOOL_R},
		//中山局扩展
		{SETTYPE_LIST,	SET_NULL,	"保护出口投入软压板",		0 , 		TTListNum-1,		1,		TTList, 	TTListNum,		GROUP_SET_YB,0X5023, BOOL_R},
		{SETTYPE_LIST,	SET_NULL,	"保护投入软压板",	0 , 		TTListNum-1,		1,		TTList, 	TTListNum,		GROUP_SET_YB,0X5026, BOOL_R},		
	#elif defined GD_AREA_ZHUHAI_V2
		{SETTYPE_LIST,	SET_NULL,	"远方修改定值软压板",		0 , 		TTListNum-1,		1,		TTList,		TTListNum,		GROUP_SET_YB,0X5025, BOOL_R},
		{SETTYPE_LIST,	SET_NULL,	"停用重合闸软压板", 0 , 		TTListNum-1,		0,		TTList, 	TTListNum,		GROUP_SET_YB,0X5024, BOOL_R},	
		{SETTYPE_LIST,	SET_NULL,	"常规继电保护投入软压板", 	0 , 		TTListNum-1,		1,		TTList, 	TTListNum,		GROUP_SET_YB,0X5025, BOOL_R},	
		{SETTYPE_LIST,	SET_NULL,	"馈线自动化投入软压板", 	0 , 		TTListNum-1,		1,		TTList, 	TTListNum,		GROUP_SET_YB,0X5025, BOOL_R},
		{SETTYPE_LIST,	SET_NULL,	"智能分布式软压板",		0 , 		TTListNum-1,		1,		TTList,		TTListNum,		GROUP_SET_YB,0X5025, BOOL_R},
		//中山局扩展
		{SETTYPE_LIST,	SET_NULL,	"保护出口投入软压板",		0 , 		TTListNum-1,		1,		TTList, 	TTListNum,		GROUP_SET_YB,0X5023, BOOL_R},
		{SETTYPE_LIST,	SET_NULL,	"保护投入软压板",	0 , 		TTListNum-1,		1,		TTList, 	TTListNum,		GROUP_SET_YB,0X5026, BOOL_R},		
	#elif defined GD_AREA_SHAOGUAN	
		{SETTYPE_LIST,	SET_NULL,	"远方投入软压板",		0 , 		TTListNum-1,		1,		TTList, 	TTListNum,		GROUP_SET_YB,0X5025, BOOL_R},
		{SETTYPE_LIST,	SET_NULL,	"功能总投入软压板",	0 , 		TTListNum-1,		1,		TTList, 	TTListNum,		GROUP_SET_YB,0X5026, BOOL_R},		
		{SETTYPE_LIST,	SET_NULL,	"保护出口投入软压板",		0 , 		TTListNum-1,		1,		TTList, 	TTListNum,		GROUP_SET_YB,0X5023, BOOL_R},
		{SETTYPE_LIST,	SET_NULL,	"保护功能投入",	0 , 		TTListNum-1,		1,		TTList, 	TTListNum,		GROUP_SET_YB,0X5025, BOOL_R},
		{SETTYPE_LIST,	SET_NULL,	"停用重合闸软压板", 0 , 		TTListNum-1,		0,		TTList, 	TTListNum,		GROUP_SET_YB,0X5024, BOOL_R},
		{SETTYPE_LIST,	SET_NULL,	"馈线自动化功能投入",	0 , 		TTListNum-1,		1,		TTList, 	TTListNum,		GROUP_SET_YB,0X5025, BOOL_R},
		{SETTYPE_LIST,	SET_NULL,	"智能分布式功能投入",		0 , 		TTListNum-1,		1,		TTList,		TTListNum,		GROUP_SET_YB,0X5025, BOOL_R},
	#else	
		#ifdef GD_AREA_FOS_2021
			{SETTYPE_LIST,	SET_NULL,	"远方整定投入软压板",		0 , 		TTListNum-1,		1,		TTList,		TTListNum,		GROUP_SET_YB,0X5025, BOOL_R},
		#else
			{SETTYPE_LIST,	SET_NULL,	"远方投入软压板",		0 , 		TTListNum-1,		1,		TTList,		TTListNum,		GROUP_SET_YB,0X5025, BOOL_R},
		#endif
        #ifdef GD_AREA_MAIN_2020  //广东标准2020要求重合闸投入软压板   和停用FA和保护软压板
            {SETTYPE_LIST,  SET_NULL,   "停用保护及FA功能软压板",   0 ,         TTListNum-1,        0,      TTList,     TTListNum,      GROUP_SET_YB,0X5026, BOOL_R},
            #ifndef GD_AREA_HEYUAN_2021
            {SETTYPE_LIST,  SET_NULL,   "重合闸投入软压板", 0 ,         TTListNum-1,        1,      TTList,     TTListNum,      GROUP_SET_YB,0X5024, BOOL_R},
            #endif
        #else
            {SETTYPE_LIST,  SET_NULL,   "保护投入软压板",   0 ,         TTListNum-1,        1,      TTList,     TTListNum,      GROUP_SET_YB,0X5026, BOOL_R},
            {SETTYPE_LIST,  SET_NULL,   "停用重合闸软压板", 0 ,         TTListNum-1,        0,      TTList,     TTListNum,      GROUP_SET_YB,0X5024, BOOL_R},
        #endif
		#ifdef GD_AREA_FOS_2021
			{SETTYPE_LIST,  SET_NULL,   "保护投入软压板",       0 ,         TTListNum-1,        1,      TTList,     TTListNum,      GROUP_SET_YB,0X5023, BOOL_R},
		#else
		    {SETTYPE_LIST,  SET_NULL,   "保护出口投入软压板",       0 ,         TTListNum-1,        1,      TTList,     TTListNum,      GROUP_SET_YB,0X5023, BOOL_R},
		#endif
        {SETTYPE_LIST,  SET_NULL,   "同期合闸软压板", 0 ,         TTListNum-1,       0,      TTList,     TTListNum,      GROUP_SET_YB,0X5025, BOOL_R},
		#if defined BHFAGS_YB_YK && !defined BH_FA_INONE_SW
			#ifdef GD_TEST_2021
				{SETTYPE_LIST,  SET_NULL,   "常规继电保护投入软压板",   0 ,         TTListNum-1,        0,      TTList,     TTListNum,      GROUP_SET_YB,0X5025, BOOL_R},
				{SETTYPE_LIST,  SET_NULL,   "馈线自动化投入软压板",     0 ,         TTListNum-1,        0,      TTList,     TTListNum,      GROUP_SET_YB,0X5025, BOOL_R},
				{SETTYPE_LIST,  SET_NULL,   "智能分布式软压板",    	    0 ,         TTListNum-1,        0,      TTList,     TTListNum,      GROUP_SET_YB,0X5025, BOOL_R},
			#else
				{SETTYPE_LIST,  SET_NULL,   "常规继电保护投入软压板",   0 ,         TTListNum-1,        1,      TTList,     TTListNum,      GROUP_SET_YB,0X5025, BOOL_R},
				{SETTYPE_LIST,  SET_NULL,   "馈线自动化投入软压板",     0 ,         TTListNum-1,        1,      TTList,     TTListNum,      GROUP_SET_YB,0X5025, BOOL_R},
				{SETTYPE_LIST,  SET_NULL,   "智能分布式软压板",     0 ,         TTListNum-1,        1,      TTList,     TTListNum,      GROUP_SET_YB,0X5025, BOOL_R},
			#endif	
		#endif
		#ifdef JZS_FUNCTION
		    {SETTYPE_LIST,  SET_NULL,   "集中式压板",       0 ,         TTListNum-1,        0,      TTList,     TTListNum,      GROUP_SET_YB,0X5025, BOOL_R},
		#endif
		#ifdef YK_SOFT_YB
		    {SETTYPE_LIST,  SET_NULL,   "遥控软压板",       0 ,         TTListNum-1,        1,      TTList,     TTListNum,      GROUP_SET_YB,0X5025, BOOL_R},
		#endif
		#ifdef GD_AREA_MAIN_2020       //广东标准2020增加自动解列软压板
            {SETTYPE_LIST,  SET_NULL,   "自动解列软压板",     0 ,         TTListNum-1,        0,      TTList,     TTListNum,      GROUP_SET_YB,0X5025, BOOL_R},
		#endif
	#endif
#endif //2020二次指导意见将各种模式软压板分开显示 2020-9-8

	{SETTYPE_LABEL,	SET_NULL,	"辅助定值", 					0 , 		0,				0 ,		0,			0,				GROUP_SET_SWSET,0X0000, NULL_R}, //保护定值公共
#ifdef DISP_SET_DLYX
	//{SETTYPE_LABEL, SET_NULL, "电流越限", 				0 , 		0,					0,		0,			0,				GROUP_SET_DLYX,0X0000, NULL_R}, 	
	{SETTYPE_LIST,	SET_NULL,	"电流重载投入",				0 , 		TTListNum-1,		0,		TTList, 	TTListNum,		GROUP_SET_SWSET,0X0000, BOOL_R},
	{SETTYPE_F, 	SET_A,		"电流重载定值",				0.0 ,		100.0,			  100.0,	0,			0,				GROUP_SET_SWSET,0X0000, FLOAT_R},
	{SETTYPE_F, 	SET_S,		"电流重载时间",				0.0 ,		10000.0,		  3600, 	0,			0,				GROUP_SET_SWSET,0X0000, FLOAT_R},
	{SETTYPE_LIST,	SET_NULL,	"电流过载投入",				0 , 		TTListNum-1,		0,		TTList, 	TTListNum,		GROUP_SET_SWSET,0X0000, BOOL_R},
	{SETTYPE_F, 	SET_A,		"电流过载定值",				0.0 ,		100.0,			  100.0,	0,			0,				GROUP_SET_SWSET,0X0000, FLOAT_R},
	{SETTYPE_F, 	SET_S,		"电流过载时间",				0.0 ,		1800.0, 		  180.0,	0,			0,				GROUP_SET_SWSET,0X0000, FLOAT_R},
	{SETTYPE_LIST,	SET_NULL,	"负荷越上限投入",				0 , 		TTListNum-1,		0,		TTList, 	TTListNum,		GROUP_SET_SWSET,0X0000, BOOL_R},
	{SETTYPE_F, 	SET_A,		"负荷越上限定值",				0.0 ,		10.0,				5.0,	0,			0,				GROUP_SET_SWSET,0X0000, FLOAT_R},
	{SETTYPE_F, 	SET_S,		"负荷越上限时间",				0.0 ,		10000.0,		   3600,	0,			0,				GROUP_SET_SWSET,0X0000, FLOAT_R},
	{SETTYPE_LIST,	SET_NULL,	"零序电流越限投退", 			0 , 		TTListNum-1,		0,		TTList, 	TTListNum,		GROUP_SET_SWSET,0X0000, BOOL_R},
	{SETTYPE_F, 	SET_A,		"零序电流越限定值", 			0.1 ,		10.0,				5.0,	0,			0,				GROUP_SET_SWSET,0X0000, FLOAT_R},
	{SETTYPE_F, 	SET_S,		"零序电流越限时间", 			0.0 ,		10000.0,			3600 ,	0,			0,				GROUP_SET_SWSET,0X0000, FLOAT_R},	
#else
	#if !defined GD_AREA_ECZD_SHAOGUAN_2021 
		{SETTYPE_LIST,	SET_NULL,	"电流越限投退", 			0 , 		TTListNum-1,		0,		TTList,		TTListNum,		GROUP_SET_SWSET,0X0000, BOOL_R},	
		{SETTYPE_F,		SET_A,		"电流越限定值", 			0.1 , 	10.0,			5.0 ,		0,			0,				GROUP_SET_SWSET,0X0000, FLOAT_R},
		{SETTYPE_F,		SET_S,		"电流越限时间",			0.0 , 	10000.0,			3600 ,	0,			0,				GROUP_SET_SWSET,0X0000, FLOAT_R},
    #endif
	{SETTYPE_LIST,	SET_NULL,	"零序电流越限投退", 		0 , 		TTListNum-1,		0,		TTList, 	TTListNum,		GROUP_SET_SWSET,0X0000, BOOL_R},
	{SETTYPE_F, 	SET_A,		"零序电流越限定值", 		0.1 ,	10.0,			5.0 ,		0,			0,				GROUP_SET_SWSET,0X0000, FLOAT_R},
	{SETTYPE_F, 	SET_S,		"零序电流越限时间", 	0.0 ,	10000.0,			3600 ,	0,			0,				GROUP_SET_SWSET,0X0000, FLOAT_R},
#endif

	{SETTYPE_LIST,	SET_NULL,	"功率取反投退", 			0 , 		TTListNum-1,		0,		TTList, 		TTListNum,		GROUP_SET_SWSET,0X0000, BOOL_R},
	{SETTYPE_LIST,	SET_NULL,	"保护方向取反投退", 		0 , 		TTListNum-1,		0,		TTList, 		TTListNum,		GROUP_SET_SWSET,0X0000, BOOL_R},
	{SETTYPE_LIST,	SET_NULL,	"未储能告警", 				0 , 		TTListNum-1,		0,		TTList,		TTListNum,		GROUP_SET_SWSET,0X0000, BOOL_R},
#if !defined GD_AREA_ZHONGSHAN && !defined GD_AREA_ECZD_SHAOGUAN_2021
	#ifdef GD_AREA_ECZD_2020//默认投入控制
		{SETTYPE_LIST,	SET_NULL,	"控制回路检查", 			0 , 		TTListNum-1,		1,		TTList,		TTListNum,		GROUP_SET_SWSET,0X0000, BOOL_R},
	#else
		{SETTYPE_LIST,	SET_NULL,	"控制回路检查",			0 , 		TTListNum-1,		0,		TTList, 	TTListNum,		GROUP_SET_SWSET,0X0000, BOOL_R},
	#endif	
#endif

#ifdef GD_AREA_MAIN_2020
    {SETTYPE_LIST,	SET_NULL,	"气压低闭锁分合闸", 		0 , 		TTListNum-1,		1,		TTList, 		TTListNum,		GROUP_SET_SWSET,0X0000, BOOL_R},
#else
    {SETTYPE_LIST,  SET_NULL,   "气压低闭锁分合闸",         0 ,         TTListNum-1,        1,      TTList,         TTListNum,      GROUP_SET_SWSET,0X0000, BOOL_R},
#endif

#ifdef FUN_JDXX
    {SETTYPE_LIST,	SET_NULL,	"系统接地方式", 	0 , 		JDTYPENum-1,	0,	JDTYPE,		JDTYPENum,	GROUP_SET_SWSET, 0X0000, UINT_R},
#endif

#ifdef  CUSTOMIZE_BZT //备自投
    {SETTYPE_LIST,  SET_NULL,   "备自投母线电压1",      0 ,         TVolSelListNum-1,       0,      TVolSelList,        TVolSelListNum, GROUP_SET_SWSET, UINT_R},
    {SETTYPE_LIST,  SET_NULL,   "备自投母线电压2",      0 ,         TVolSelListNum-1,       3,      TVolSelList,        TVolSelListNum, GROUP_SET_SWSET, UINT_R},
    {SETTYPE_LIST,  SET_NULL,   "备自投1#进线电压",     0 ,         TVolSelListNum-1,       0,      TVolSelList,        TVolSelListNum, GROUP_SET_SWSET, UINT_R},
    {SETTYPE_LIST,  SET_NULL,   "备自投2#进线电压",     0 ,         TVolSelListNum-1,       3,      TVolSelList,        TVolSelListNum, GROUP_SET_SWSET, UINT_R},
    {SETTYPE_LIST,  SET_NULL,   "备自投1#进线电流",     0 ,         TISelListNum-1,     0,      TISelList,      TISelListNum,   GROUP_SET_SWSET, UINT_R},
    {SETTYPE_LIST,  SET_NULL,   "备自投2#进线电流",     0 ,         TISelListNum-1,     0,      TISelList,      TISelListNum, GROUP_SET_SWSET, UINT_R},
#endif

#ifdef GD_AREA_MAIN_2020
    {SETTYPE_LIST,	SET_NULL,	"PT1断线检查投退",			  0 ,		  TTListNum-1,		  1,	  TTList,	  TTListNum,	  GROUP_SET_SWSET,0X0000, BOOL_R},
    {SETTYPE_LIST,	SET_NULL,	"PT2断线检查投退",			  0 ,		  TTListNum-1,		  1,	  TTList,	  TTListNum,	  GROUP_SET_SWSET,0X0000, BOOL_R},
#endif

#if defined BH_FA_INONE_SW && !defined YF_TQ_JL_TY_PUBLIC
	{SETTYPE_LABEL, SET_NULL,	"控制字", 			0 , 				0,		0,				  0,				 0,				GROUP_SET_MODE,0X0000, NULL_R},
	{SETTYPE_LIST,  SET_NULL,   "同期合闸",			0 ,       TTListNum-1,      1,     		 TTList,     	 TTListNum,      		GROUP_SET_MODE,0X0000, BOOL_R},
	{SETTYPE_LIST,  SET_NULL,   "自动解列",			0 ,       TTListNum-1,      1,      	 TTList,     	 TTListNum,      		GROUP_SET_MODE,0X0000, BOOL_R},
	{SETTYPE_LABEL, SET_NULL,	"软压板", 			0 , 				0,		0,				  0,				 0,				GROUP_SET_SOFT,0X0000, NULL_R},
	#ifdef GD_AREA_HEYUAN_2021
		{SETTYPE_LIST,	SET_NULL,	"远方定值整定投入",			0 ,  	  TTListNum-1,		1,			 TTList,		 TTListNum, 			GROUP_SET_SOFT,0X0000, BOOL_R},
	#elif defined GD_AREA_ECZD_CHAOZHOU_2022
		{SETTYPE_LIST,	SET_NULL,	"远方修改功能", 		0 , 	  TTListNum-1,		1,			 TTList,		 TTListNum, 			GROUP_SET_SOFT,0X0000, BOOL_R},
	#else
	{SETTYPE_LIST,	SET_NULL,	"远方投入",			0 ,  	  TTListNum-1,		1,			 TTList,		 TTListNum, 			GROUP_SET_SOFT,0X0000, BOOL_R},
	#endif
#endif

#ifdef FUNC_DRIVE_JY
	{SETTYPE_LABEL, SET_NULL,	"传动功能", 			  0.0,	0.0,			0.0 ,	0,		0,			GROUP_SET_DRIVE,0X0000, NULL_R},
	{SETTYPE_LIST,	SET_NULL,	"开关传动投入",			  0,	TTListNum-1,	0,		TTList, TTListNum,	GROUP_SET_DRIVE,0X0000, BOOL_R},
	{SETTYPE_F, 	SET_U,		"传动模拟电源侧电压",	0.0,		220.0,			0.0 , 	0,		0,			GROUP_SET_DRIVE,0X0000, FLOAT_R},
	{SETTYPE_F, 	SET_U,		"传动模拟负荷侧电压",	0.0,		220.0,			0.0 , 	0,		0,			GROUP_SET_DRIVE,0X0000, FLOAT_R},
	{SETTYPE_F, 	SET_U,		"传动模拟零序电压", 		0.0,	220.0,			25.0 , 	0,		0,			GROUP_SET_DRIVE,0X0000, FLOAT_R},
	{SETTYPE_F, 	SET_A,		"传动模拟电流",			  0.0,	100.0,			10.0 , 	0,		0,			GROUP_SET_DRIVE,0X0000, FLOAT_R},
	{SETTYPE_F, 	SET_A,		"传动模拟零流",			  0.0,	100.0,			10.0 , 	0,		0,			GROUP_SET_DRIVE,0X0000, FLOAT_R},
	{SETTYPE_F, 	SET_S,		"传动电源侧电压时间",	0.0,		100.0,			6.0,	0,		0,			GROUP_SET_DRIVE,0X0000, FLOAT_R},
	{SETTYPE_F, 	SET_S,		"传动负荷侧电压时间",	0.0,		100.0,			6.0,	0,		0,			GROUP_SET_DRIVE,0X0000, FLOAT_R},
	{SETTYPE_F, 	SET_S,		"传动零压时间",			  0.0,	100.0,			1.0,	0,		0,			GROUP_SET_DRIVE,0X0000, FLOAT_R},
	{SETTYPE_F, 	SET_S,		"传动过流时间",			  0.0,	100.0,			0.2,	0,		0,			GROUP_SET_DRIVE,0X0000, FLOAT_R},
	{SETTYPE_F, 	SET_S,		"传动零流时间",			  0.0,	100.0,			0.2,	0,		0,			GROUP_SET_DRIVE,0X0000, FLOAT_R},
	{SETTYPE_F, 	SET_S,		"再次传动时间",			  0.0,	100.0,			10.0,	0,		0,			GROUP_SET_DRIVE,0X0000, FLOAT_R},
#endif

};
const int SW_SET_NUMBER  = sizeof( tSwSetTable ) / sizeof(tSwSetTable[0]);  // 定值数目
const int SET_NUMBER  = ((sizeof(tSwSetTable) / sizeof(tSwSetTable[0]))*SWITCH_NUM_MAX+sizeof(tPubSetTable) / sizeof(tPubSetTable[0]));



// 内部定值
const  TSETTABLE tCstSetTable[]=   	// min       max        default
{
	{SETTYPE_LABEL,	SET_NULL,	"保护功能", 			0 , 	0,				0 ,		0,		0,			GROUP_CSTSET_PROTECT,0x0000, NULL_R},
#ifdef XDL_ZT
	{SETTYPE_F, 	SET_U,		"小电流零压1定值",	0.0,	220.0,			220.0 , 0,		0,			GROUP_CSTSET_PROTECT,0x0000, FLOAT_R},
	{SETTYPE_F, 	SET_S,		"小电流零压1时间",	0.0,	100.0,			0.04,	0,		0,			GROUP_CSTSET_PROTECT,0x0000, FLOAT_R},
	{SETTYPE_F, 	SET_U,		"小电流零压2定值",	0.0,	220.0,			220.0 , 0,		0,			GROUP_CSTSET_PROTECT,0x0000, FLOAT_R},
	{SETTYPE_F, 	SET_S,		"小电流零压2时间",	0.0,	100.0,			0.04,	0,		0,			GROUP_CSTSET_PROTECT,0x0000, FLOAT_R},
#endif

	{SETTYPE_F,		SET_NULL,	"幅值加速滤波系数", 0.0 , 	65536.0,		1.2 ,	0,		0,			GROUP_CSTSET_PROTECT,0x0000, FLOAT_R},
	{SETTYPE_F,		SET_A,		"突变量定值", 		0.01 , 	25.0,			2.0 ,	0,		0,			GROUP_CSTSET_PROTECT,0x0000, FLOAT_R},
	{SETTYPE_F,		SET_A,		"无流定值", 		0.0 , 	5.0,			0.1 ,	0,		0,			GROUP_CSTSET_PROTECT,0x0000, FLOAT_R},
	{SETTYPE_F,		SET_S,		"整组复归时间",		0.2 , 	60.0,			5.0 ,	0,		0,			GROUP_CSTSET_PROTECT,0x0000, FLOAT_R},
	{SETTYPE_F,     SET_S,		"跳闸失败时间", 	0.05 ,	10.0,			0.15 ,	0,		0,			GROUP_CSTSET_PROTECT,0x0000, FLOAT_R},
	{SETTYPE_F,     SET_S,		"合闸失败时间", 	0.05 ,	10.0,			2.0 ,	0,		0,			GROUP_CSTSET_PROTECT,0x0000, FLOAT_R},
#ifndef DISP_CHZOKCHR_2_SW
	#ifndef FUNC_CHZ_CHARGE_TIME
		{SETTYPE_F, 		SET_S,		"二次重合充电时间", 	15.0 ,	300.0,			180.0 ,	0,		0,			GROUP_CSTSET_PROTECT,0x0000, FLOAT_R},
	#endif
		{SETTYPE_F, 		SET_S,		"重合确认时间", 	0.3 ,	999.0,			180.0 ,	0,		0,	GROUP_CSTSET_PROTECT,0x0000, FLOAT_R},		
#endif

#ifdef FUN_CHZ_TOPEN 
	{SETTYPE_F, 		SET_S,		"重合闸开放时间",			 0.3 , 3600,	300 ,	0,		0,			GROUP_CSTSET_PROTECT,0x0000, FLOAT_R},
#endif	

	{SETTYPE_LIST,	SET_NULL,	"零压闭锁零流", 	0 , 	TTListNum-1,	0 ,		TTList,	TTListNum,	GROUP_CSTSET_PROTECT,0x0000, BOOL_R},
	{SETTYPE_LIST,	SET_NULL,	"低压闭锁过流", 	0 , 	TTListNum-1,	0 ,		TTList,	TTListNum,	GROUP_CSTSET_PROTECT,0x0000, BOOL_R},
	{SETTYPE_F, 		SET_U,		"零压闭锁定值", 	1.0 ,	100.0,			20.0 ,	0,		0,			GROUP_CSTSET_PROTECT,0x0000, FLOAT_R},
	{SETTYPE_F, 		SET_U,		"低压闭锁定值", 	10.0 ,220.0,			80.0 ,	0,		0,			GROUP_CSTSET_PROTECT,0x0000, FLOAT_R},
	{SETTYPE_LIST,	SET_NULL,	"低频滑差闭锁投退", 	0 , 	TTListNum-1,	0 ,		TTList,	TTListNum,	GROUP_CSTSET_PROTECT,0x0000, BOOL_R},
	{SETTYPE_F, 	SET_HZ_S,	"低频减载滑差", 	   	0.3 , 	10.0  , 	0.3  ,	0,		0,			GROUP_CSTSET_PROTECT,0x0000, FLOAT_R},
#ifdef GD_AREA_ECZD_MEIZHOU_2021
	{SETTYPE_LIST,	SET_NULL,	"解列闭锁重合闸",	0 , 	TTListNum-1,	1,		TTList, TTListNum,	GROUP_CSTSET_PROTECT,0x0000, BOOL_R},
	{SETTYPE_LIST,	SET_NULL,	"解列后启动重合闸判频率",	0 , 	TTListNum-1,	0,		TTList, TTListNum,	GROUP_CSTSET_PROTECT,0x0000, BOOL_R},
	{SETTYPE_LIST,	SET_NULL,	"解列后启动重合闸判电压",	0 , 	TTListNum-1,	0,		TTList, TTListNum,	GROUP_CSTSET_PROTECT,0x0000, BOOL_R},
#endif
	
	{SETTYPE_LABEL,	SET_NULL,	"计算功能", 			0 , 	0,				0 ,		0,		0,			GROUP_CSTSET_CALC,0x0000, NULL_R},
	{SETTYPE_LIST,	SET_NULL,	"频率跟踪投退", 	0 , 	TTListNum-1,	0,		TTList,	TTListNum,	GROUP_CSTSET_CALC,0x0000, BOOL_R},
	{SETTYPE_UINT,	SET_NULL,	"谐波计算次数",		1,		15,				13 ,	0,		0,			GROUP_CSTSET_CALC,0x0000, UINT_R},
	{SETTYPE_F,		SET_NULL,	"谐波校正系数", 	0.0 , 	1.0,			0.01,	0,		0,			GROUP_CSTSET_CALC,0x0000, BOOL_R},
	{SETTYPE_5INT,	SET_NULL,	"交流温漂(ppm)",	-100.0,	100.0,			0.0 ,	0,		0,			GROUP_CSTSET_CALC,0x0000, INT_R},
	{SETTYPE_5INT,	SET_NULL,	"直流温漂(ppm)",	-10000.0,10000.0,		0.0 ,	0,		0,			GROUP_CSTSET_CALC,0x0000, INT_R},
	{SETTYPE_LIST,	SET_NULL,	"归零值投退", 		0 , 	TTListNum-1,	1,		TTList,	TTListNum,	GROUP_CSTSET_CALC,0x0000, BOOL_R},
	{SETTYPE_LIST,	SET_NULL,	"零序电压自产", 	0 , 	TTListNum-1,	0,		TTList,	TTListNum,	GROUP_CSTSET_CALC,0x0000, BOOL_R},
	
	{SETTYPE_LABEL,	SET_NULL,	"通讯功能", 			0 , 	0,				0 ,		0,		0,			GROUP_CSTSET_COMM,0x0000, NULL_R},
	{SETTYPE_5INT,	SET_S,		"101子站重发",		0 , 	3600,			20 ,	0,		0,			GROUP_CSTSET_COMM,0x0000, UINT_R},
	{SETTYPE_5INT,	SET_S,		"101通道时间",		0 , 	3600,			600 ,	0,		0,			GROUP_CSTSET_COMM,0x0000, UINT_R},	
	{SETTYPE_LIST,	SET_NULL,	"101初始化原因03", 	0 , 	TTListNum-1,	0,		TTList,	TTListNum,	GROUP_CSTSET_COMM,0x0000, BOOL_R},
	{SETTYPE_LIST,	SET_NULL,	"104序号检查", 		0 , 	TTListNum-1,	1,		TTList,	TTListNum,	GROUP_CSTSET_COMM,0x0000, BOOL_R},
	{SETTYPE_LIST,	SET_NULL,	"101FCB检查", 	0 , 	TTListNum-1,	1,		TTList,	TTListNum,	GROUP_CSTSET_COMM,0x0000, BOOL_R},	
	{SETTYPE_LIST,	SET_NULL,	"点号连续上送", 	0 , 	TTListNum-1,	1,		TTList,	TTListNum,	GROUP_CSTSET_COMM,0x0000, BOOL_R},	
	{SETTYPE_LIST,	SET_NULL,	"加密功能", 		0 , 	JMListNum-1,	0,		JMList,	JMListNum,	GROUP_CSTSET_COMM,0x0000, UINT_R},
	{SETTYPE_LIST,	SET_NULL,	"远动测试模式", 	0 , 	TTListNum-1,	0,		TTList,	TTListNum,	GROUP_CSTSET_COMM,0x0000, BOOL_R},
	{SETTYPE_LIST,	SET_NULL,	"SOE通讯续传", 	 	0 , 	TTListNum-1,	0,		TTList,	TTListNum,	GROUP_CSTSET_COMM,0x0000, BOOL_R},
	{SETTYPE_LIST,	SET_NULL,	"SOE上电续传", 	 	0 , 	TTListNum-1,	0,		TTList,	TTListNum,	GROUP_CSTSET_COMM,0x0000, BOOL_R},
#ifdef FIX_PARAM_FORMAT
	{SETTYPE_LIST,	SET_NULL,	"固定参数上送格式", 			0 , TULF8ListNum-1, 	1,			TULF8List,	TULF8ListNum,GROUP_CSTSET_COMM, 0x0000,	UTINY_R},
#endif

	{SETTYPE_LIST,	SET_NULL,	"装置类型", 	 	0 , 	EQUListNum-1,	0,	EQUList,	EQUListNum,	GROUP_CSTSET_COMM,0x0000, BOOL_R},
	{SETTYPE_F,		SET_NULL,	"遥测滤波系数",		0, 		1.0,			0.01,	0,		0,			GROUP_CSTSET_COMM,0x0000, FLOAT_R},

	{SETTYPE_LABEL,	SET_NULL,	"馈线自动化",		0 , 	0,				0 ,		0,		0,			GROUP_CSTSET_FA,0x0000, NULL_R},
	{SETTYPE_LIST,	SET_NULL,	"瞬压板投退", 			0 , 	TTListNum-1,	0 ,		TTList,	TTListNum,	GROUP_CSTSET_FA,0x0000, BOOL_R},	
	{SETTYPE_F,		SET_S,		"FA充电时间",			0.0 , 	100.0,		15 ,	0,		0,			GROUP_CSTSET_FA,0x0000, FLOAT_R},
	{SETTYPE_F,		SET_S,		"FA隔离放电时间",			1.0 , 	100.0,		60 ,	0,		0,	GROUP_CSTSET_FA,0x0000, FLOAT_R},
	{SETTYPE_F,		SET_S,		"FA恢复放电时间",			1.0 , 	100.0,		15 ,	0,		0,	GROUP_CSTSET_FA,0x0000, FLOAT_R},
	{SETTYPE_F,		SET_S,		"FA禁止转发时间 ",			1.0 , 	100.0,		15 ,	0,		0,	GROUP_CSTSET_FA,0x0000, FLOAT_R},
	{SETTYPE_F,		SET_S,		"FA发送展宽时间",			0.1 , 	100.0,		0.3 ,	0,		0,	GROUP_CSTSET_FA,0x0000, FLOAT_R},
	{SETTYPE_F,		SET_S,		"goose判断时间",			0.01 , 	0.1,		0.040 ,	0,		0,	GROUP_CSTSET_FA,0x0000, FLOAT_R},
	{SETTYPE_LIST,	SET_NULL,	"负荷开关goose发布", 	0 , 	TTListNum-1,	0,		TTList,	TTListNum,	GROUP_CSTSET_FA,0x0000, BOOL_R},
	{SETTYPE_LIST,	SET_NULL,	"goose发布在故障确认后",	0 , 	TTListNum-1,	0 , 	TTList, TTListNum,	GROUP_CSTSET_FA,0x0000, BOOL_R},
	{SETTYPE_F,		SET_S,		"短时失压闭锁时间",		0.00 , 	10.0,		0.0 ,	0,		0,	GROUP_CSTSET_FA,0x0000, FLOAT_R},
	{SETTYPE_F, 	SET_S,		"单侧来电解锁时间", 	0.00 ,	10.0,		6.0 ,	0,		0,	GROUP_CSTSET_FA,0x0000, FLOAT_R},
	{SETTYPE_LIST,	SET_NULL,	"FA闭锁合闸禁止遥合", 	0 , 	TTListNum-1,	0,		TTList,	TTListNum,	GROUP_CSTSET_FA,0x0000, BOOL_R},
#ifdef FA_PL_PJ
	{SETTYPE_LIST,	SET_NULL,	"有压判频率",	0 , 	TTListNum-1,	0,		TTList, TTListNum,	GROUP_CSTSET_FA,0x0000, BOOL_R},
#endif

	{SETTYPE_LIST,	SET_NULL,	"有压判据", 0 , 	UYY_ListNum-1,	0,		UYY_List, UYY_ListNum,	GROUP_CSTSET_FA,0x0000, UINT_R},
	
	{SETTYPE_LABEL,	SET_NULL,	"录波功能", 			0 , 	0,				0 ,		0,		0,			GROUP_CSTSET_RECORD,0x0000, NULL_R},
	{SETTYPE_LIST,	SET_NULL,	"文件格式", 		0 , 	WFListNum-1,	1 ,		WFList,	WFListNum,	GROUP_CSTSET_RECORD,0x0000, UINT_R},
	{SETTYPE_LIST,	SET_NULL,	"过流故障启动", 	0 , 	TTListNum-1,	0 ,		TTList,	TTListNum,	GROUP_CSTSET_RECORD,0x0000, BOOL_R},
	{SETTYPE_LIST,	SET_NULL,	"线路失压启动", 	0 , 	TTListNum-1,	0 ,		TTList,	TTListNum,	GROUP_CSTSET_RECORD,0x0000, BOOL_R},
	{SETTYPE_LIST,	SET_NULL,	"零序电压启动", 	0 , 	TTListNum-1,	0 ,		TTList,	TTListNum,	GROUP_CSTSET_RECORD,0x0000, BOOL_R},
	{SETTYPE_LIST,	SET_NULL,	"零序过流启动", 	0 , 	TTListNum-1,	0 ,		TTList,	TTListNum,	GROUP_CSTSET_RECORD,0x0000, BOOL_R},
	{SETTYPE_LIST,	SET_NULL,	"零流突变启动", 	0 , 	TTListNum-1,	0 ,		TTList,	TTListNum,	GROUP_CSTSET_RECORD,0x0000, BOOL_R},
	{SETTYPE_LIST,	SET_NULL,	"重合闸启动", 		0 , 	TTListNum-1,	0 ,		TTList,	TTListNum,	GROUP_CSTSET_RECORD,0x0000, BOOL_R},
#ifdef FUN_JDXX
	{SETTYPE_LIST,	SET_NULL,	"小电流接地启动",		0 , 	TTListNum-1,	1 , 	TTList, TTListNum,	GROUP_CSTSET_RECORD,0x0000, BOOL_R},
#endif

	{SETTYPE_LABEL,	SET_NULL,	"辅助定值", 			0 , 	0,				0 ,		0,		0,			GROUP_CSTSET_OTHERS,0x0000, NULL_R},
	{SETTYPE_UINT,	SET_S,		"未储能时间",		1 , 	30,				20 ,	0,		0,			GROUP_CSTSET_OTHERS,0x0000, UINT_R},
	{SETTYPE_UINT,	SET_S,		"失电闭锁遥信时间",	0 , 	65535,			0 ,		0,		0,			GROUP_CSTSET_OTHERS,0x0000, UINT_R},
	{SETTYPE_F,		SET_HOUR,	"电池充满维持", 	0, 		100.0,			0.5,	0,		0,			GROUP_CSTSET_OTHERS,0x0000, FLOAT_R},
	{SETTYPE_LIST,	SET_NULL,	"记录文件投退", 	0 , 	TTListNum-1,	0,		TTList,	TTListNum,	GROUP_CSTSET_OTHERS,0x0000, BOOL_R},
	{SETTYPE_LIST,	SET_NULL,	"记录文件格式",		 0 , 	HisFileFormatListNum-1,	0,		HisFileFormatList,	HisFileFormatListNum,	GROUP_CSTSET_OTHERS,0x0000,UTINY_R},
#ifdef GD_TEST_2021
	{SETTYPE_LIST, SET_NULL,    "复归按键复用功能选择",0,  TFGKEY_TYPE_TOTAL-1, 1,   TFGKEY_Type,TFGKEY_TYPE_TOTAL,GROUP_CSTSET_OTHERS,0x0000, UINT_R},
	{SETTYPE_UINT, SET_S,       "复归按键复用功能防抖时间", 0,        60,        3,    0,      0,          GROUP_CSTSET_OTHERS,0x0000, UINT_R},
#else
	{SETTYPE_LIST,	SET_NULL,	"复归按钮解锁", 	0 , 	TTListNum-1,	0,		TTList,	TTListNum,	GROUP_CSTSET_OTHERS,0x0000, BOOL_R},
#endif	

	{SETTYPE_LIST,	SET_NULL,	"远动参数有效", 	0 , 	TTListNum-1,	0,		TTList,	TTListNum,	GROUP_CSTSET_OTHERS,0x0000, BOOL_R},
	{SETTYPE_LIST,	SET_NULL,	"现场运行模式",	0 , 	TTListNum-1,	0,		TTList,	TTListNum,	GROUP_CSTSET_OTHERS,0x0000, BOOL_R},
	{SETTYPE_LIST,	SET_NULL,	"101文件传输确认帧",	0 , 	TTListNum-1,	1,		TTList,	TTListNum,	GROUP_CSTSET_OTHERS,0x0000, BOOL_R},
	{SETTYPE_UINT,	SET_NULL,	"测量差值",	              0,   2000,		0 ,	0,		0,			GROUP_CSTSET_OTHERS,0x0000, UINT_R},
#ifdef GD_AREA_MAIN_2020
    {SETTYPE_F, 	SET_U,		"直流电压定值", 0,   150, 	  48 ,	  0,	  0,		  GROUP_CSTSET_OTHERS,0x0000, FLOAT_R},
#else
    {SETTYPE_F,     SET_U,      "直流电压定值", 0,   150,       48 ,    0,      0,          GROUP_CSTSET_OTHERS,0x0000, FLOAT_R},
#endif

	{SETTYPE_UINT,	SET_NULL,	"直流通道数",	1, 2,		1 , 0,		0,			GROUP_CSTSET_OTHERS,0x0000, UINT_R},
#ifdef GD_AREA_ZHUHAI_V2 	
	{SETTYPE_LIST,	SET_NULL,	"母线侧电压选择",	0 , 	TPT_UNum-1,	0,		PUList,	TPT_UNum,	GROUP_CSTSET_OTHERS,0x0000, UINT_R},
#else
	{SETTYPE_LIST,	SET_NULL,	"负荷侧电压选择",	0 , 	TPT_UNum-1,	0,		PUList,	TPT_UNum,	GROUP_CSTSET_OTHERS,0x0000, UINT_R},
#endif

	{SETTYPE_LIST,	SET_NULL,	"液晶遥测数据显示", 		0 , DISPMODEListNum-1,	0,	DISPMODEList,	DISPMODEListNum,    GROUP_CSTSET_OTHERS,0x0000, UINT_R},
    {SETTYPE_LIST,	SET_NULL,	"故障事件遥信地址长度",	0 , 	AddrNumListNum-1,	0,	AddrNumList,    AddrNumListNum,     GROUP_CSTSET_OTHERS,0x0000, BOOL_R},
#ifdef YC_QUANTITY
	{SETTYPE_UINT,	SET_NULL,	"每间隔遥参数量",	1, 999,		50 , 0,		0,			GROUP_CSTSET_OTHERS,0x0000, UINT_R},
#endif

#ifdef METERING_ENERGY
	{SETTYPE_LIST,	SET_NULL,	"电度计算方式",	0 ,		  DDListNum-1,	DDListNum-1,		  DDList, 	  DDListNum, 	GROUP_CSTSET_OTHERS,0x0000, UINT_R},	
	{SETTYPE_LIST,	SET_NULL,	"计量接线方式",	0 , 	JLFSListNum-1,			  0,		JLFSList,	JLFSListNum,	GROUP_CSTSET_OTHERS,0x0000, UINT_R},
	{SETTYPE_LIST,	SET_NULL,	"无功电能算法",	0 , 	WGFSListNum-1,			  0,		WGFSList,	WGFSListNum,	GROUP_CSTSET_OTHERS,0x0000, UINT_R},
#endif
	{SETTYPE_LIST,	SET_NULL,	"SOE遥测系数投退",			0 , 	TTListNum-1,		1,		TTList, 	TTListNum,	GROUP_CSTSET_OTHERS,0X0000, BOOL_R},
	{SETTYPE_LIST,	SET_NULL,	"遥测总死区有效投退",			0 , 	TTListNum-1,		1,		TTList, 	TTListNum,	GROUP_CSTSET_OTHERS,0X0000, BOOL_R},
}
;
const int CSTSET_NUMBER = (sizeof(tCstSetTable)/sizeof(tCstSetTable[0]));

/**********************************************************************
装置参数
***********************************************************************/
const  TSETTABLE tEquipParaTable[]=     			// min 	max 			default
{
	{SETTYPE_LABEL,	SET_NULL,	"规约参数", 		0 , 	0,					0 ,		0,				0,				GROUP_PARA_PROTOCAL,0x0000, NULL_R},
	{SETTYPE_5INT,	SET_NULL,	"装置地址", 		1 , 	65535,				1 ,		0,				0,				GROUP_PARA_PROTOCAL,0x0000, UINT_R},
	{SETTYPE_LIST,	SET_NULL,	"遥信报文类型", 	0 , 	PTTypeListNum-1,	0 ,		PTTypeList,		PTTypeListNum,	GROUP_PARA_PROTOCAL,0x0000, UINT_R},
	{SETTYPE_LIST,	SET_NULL,	"遥控报文类型", 	0 , 	PTTypeListNum-1,	2 ,		PTTypeList,		PTTypeListNum,	GROUP_PARA_PROTOCAL,0x0000, UINT_R},
	{SETTYPE_LIST,	SET_NULL,	"遥测报文类型", 	0 , 	YCTypeListNum-1,	2 ,		YCTypeList,		YCTypeListNum,	GROUP_PARA_PROTOCAL,0x0000, UINT_R},
	{SETTYPE_F,		SET_S,		"遥测发送间隔", 	0, 		3600,				0.4 ,	0,				0,				GROUP_PARA_PROTOCAL,0x0000, FLOAT_R},
	{SETTYPE_LIST,	SET_NULL,	"遥测自动上送", 	0 , 	TTListNum-1,		1,		TTList,			TTListNum,		GROUP_PARA_PROTOCAL,0x0000, BOOL_R},
	{SETTYPE_LIST,	SET_NULL,	"遥测上传死区类型", 	0 , 	YCTypeDeadNum-1,		0,	YCTypeDead,		YCTypeDeadNum,		GROUP_PARA_PROTOCAL,0x0000, BOOL_R},
	{SETTYPE_LIST,	SET_NULL,	"COS自动上送", 	0 , 	TTListNum-1,		1,		TTList,			TTListNum,		GROUP_PARA_PROTOCAL,0x0000, BOOL_R},
	{SETTYPE_LIST,	SET_NULL,	"事件参数上送", 	0 , 	TTListNum-1,		0,		TTList,			TTListNum,		GROUP_PARA_PROTOCAL,0x0000, BOOL_R},
	{SETTYPE_5INT,	SET_S,		"遥控超时时间",		10 , 	3600,				300 ,	0,				0,				GROUP_PARA_PROTOCAL,0x0000, UINT_R},
	{SETTYPE_LIST,	SET_NULL,	"101链路地址", 		0 , 	IEC101AddrListNum-1,1 ,		IEC101AddrList,	IEC101AddrListNum,GROUP_PARA_PROTOCAL,0x0000, BOOL_R},
	{SETTYPE_LIST,	SET_NULL,	"101应用地址", 		0 , 	IEC101AddrListNum-1,1 ,		IEC101AddrList,	IEC101AddrListNum,GROUP_PARA_PROTOCAL,0x0000, BOOL_R},
	{SETTYPE_LIST,	SET_NULL,	"101传送原因", 		0 , 	IEC101AddrListNum-1,1 ,		IEC101AddrList,	IEC101AddrListNum,GROUP_PARA_PROTOCAL,0x0000, BOOL_R},
	{SETTYPE_LIST,	SET_NULL,	"104规约模式", 	0 , 	T104ServerListNum-1,		0,		T104ServerList,			T104ServerListNum,		GROUP_PARA_PROTOCAL,0x0000, BOOL_R},
	{SETTYPE_5INT,	SET_NULL,	"104规约端口", 	0, 	65535,				2404 ,	0,				0,				GROUP_PARA_PROTOCAL,0x0000, UINT_R},
	{SETTYPE_5INT,	SET_S,		"104确认超时",		1 , 	65535,				30 ,	0,				0,				GROUP_PARA_PROTOCAL,0x0000, UINT_R},
	{SETTYPE_5INT,	SET_S,		"104测试超时",		1 , 	65535,				30 ,	0,				0,				GROUP_PARA_PROTOCAL,0x0000, UINT_R},
	{SETTYPE_5INT,	SET_NULL,	"104 K值",			0 , 	48,					12 ,	0,				0,				GROUP_PARA_PROTOCAL,0x0000, UINT_R},
	{SETTYPE_5INT,	SET_NULL,	"104 W值",			0 , 	48,					8 ,		0,				0,				GROUP_PARA_PROTOCAL,0x0000, UINT_R},
	{SETTYPE_IP,	SET_NULL,	"104主站1 IP", 		0 , 	0xffffffff,			0 ,	(void *)0x00000000,	0,				GROUP_PARA_PROTOCAL,0x0000, STR_R},
	{SETTYPE_IP,	SET_NULL,	"104主站2 IP", 		0 , 	0xffffffff,			0 ,	(void *)0x00000000,	0,				GROUP_PARA_PROTOCAL,0x0000, STR_R},
	{SETTYPE_IP,	SET_NULL,	"104主站3 IP", 		0 , 	0xffffffff,			0 ,	(void *)0x00000000,	0,				GROUP_PARA_PROTOCAL,0x0000, STR_R},
	{SETTYPE_IP,	SET_NULL,	"104主站4 IP", 		0 , 	0xffffffff,			0 ,	(void *)0x00000000,	0,				GROUP_PARA_PROTOCAL,0x0000, STR_R},

	{SETTYPE_LABEL,	SET_NULL,	"104子站通信", 		0 , 	0,					0 ,		0,				0,				GROUP_PARA_LINK,0x0000, NULL_R},
	{SETTYPE_IP,	SET_NULL,	"104子站1 IP", 		0 , 	0xffffffff,			0 ,	(void *)0x00000000,	0,				GROUP_PARA_LINK,0x0000, STR_R},
	{SETTYPE_IP,	SET_NULL,	"104子站2 IP", 		0 , 	0xffffffff,			0 ,	(void *)0x00000000,	0,				GROUP_PARA_LINK,0x0000, STR_R},
	{SETTYPE_IP,	SET_NULL,	"104子站3 IP", 		0 , 	0xffffffff,			0 ,	(void *)0x00000000,	0,				GROUP_PARA_LINK,0x0000, STR_R},
	{SETTYPE_IP,	SET_NULL,	"104子站4 IP", 		0 , 	0xffffffff,			0 ,	(void *)0x00000000,	0,				GROUP_PARA_LINK,0x0000, STR_R},
	{SETTYPE_IP,	SET_NULL,	"104子站5 IP", 		0 , 	0xffffffff,			0 ,	(void *)0x00000000,	0,				GROUP_PARA_LINK,0x0000, STR_R},
	{SETTYPE_IP,	SET_NULL,	"104子站6 IP", 		0 , 	0xffffffff,			0 ,	(void *)0x00000000,	0,				GROUP_PARA_LINK,0x0000, STR_R},
	{SETTYPE_IP,	SET_NULL,	"104子站7 IP", 		0 , 	0xffffffff,			0 ,	(void *)0x00000000,	0,				GROUP_PARA_LINK,0x0000, STR_R},
	{SETTYPE_IP,	SET_NULL,	"104子站8 IP", 		0 , 	0xffffffff,			0 ,	(void *)0x00000000,	0,				GROUP_PARA_LINK,0x0000, STR_R},
	
	{SETTYPE_LABEL,	SET_NULL,	"串行口通道", 		0 , 	0,					0 ,		0,				0,				GROUP_PARA_SERIAL,0x0000, NULL_R},
	{SETTYPE_LIST,	SET_NULL,	"485口1规约", 		0 , 	ProtocolListNum-1,	0 ,		ProtocolList,	ProtocolListNum,GROUP_PARA_SERIAL,0x0000, UINT_R},
	{SETTYPE_LIST,	SET_NULL,	"485口1波特率", 	0 , 	BaudListNum-1,		7 ,		BaudList,		BaudListNum,	GROUP_PARA_SERIAL,0x0000, UINT_R},
	{SETTYPE_LIST,	SET_NULL,	"485口1校验", 		0 , 	ParityListNum-1,	0 ,		ParityList,		ParityListNum,	GROUP_PARA_SERIAL,0x0000, UINT_R},
	{SETTYPE_LIST,	SET_NULL,	"485口2规约", 		0 , 	ProtocolListNum-1,	0 ,		ProtocolList,	ProtocolListNum,GROUP_PARA_SERIAL,0x0000, UINT_R},
	{SETTYPE_LIST,	SET_NULL,	"485口2波特率", 	0 , 	BaudListNum-1,		7 ,		BaudList,		BaudListNum,	GROUP_PARA_SERIAL,0x0000, UINT_R},
	{SETTYPE_LIST,	SET_NULL,	"485口2校验", 		0 , 	ParityListNum-1,	0 ,		ParityList,		ParityListNum,	GROUP_PARA_SERIAL,0x0000, UINT_R},
	{SETTYPE_LIST,	SET_NULL,	"232口1规约", 		0 , 	ProtocolListNum-1,	0 ,		ProtocolList,	ProtocolListNum,GROUP_PARA_SERIAL,0x0000, UINT_R},
	{SETTYPE_LIST,	SET_NULL,	"232口1波特率", 		0 , 	BaudListNum-1,		7 ,		BaudList,		BaudListNum,	GROUP_PARA_SERIAL,0x0000, UINT_R},
	{SETTYPE_LIST,	SET_NULL,	"232口1校验方式", 	0 , 	ParityListNum-1,	0 ,		ParityList,		ParityListNum,	GROUP_PARA_SERIAL,0x0000, UINT_R},
	{SETTYPE_LIST,	SET_NULL,	"232口2规约", 		0 , 	ProtocolListNum-1,	0 ,		ProtocolList,	ProtocolListNum,GROUP_PARA_SERIAL,0x0000, UINT_R},
	{SETTYPE_LIST,	SET_NULL,	"232口2波特率", 		0 , 	BaudListNum-1,		7 ,		BaudList,		BaudListNum,	GROUP_PARA_SERIAL,0x0000, UINT_R},
	{SETTYPE_LIST,	SET_NULL,	"232口2校验方式", 	0 , 	ParityListNum-1,	0 ,		ParityList,		ParityListNum,	GROUP_PARA_SERIAL,0x0000, UINT_R},
	{SETTYPE_LIST,	SET_NULL,	"GPS串口5规约", 	0 , 	ProtocolListNum-1,	10 ,	ProtocolList,	ProtocolListNum,GROUP_PARA_SERIAL,0x0000, UINT_R},
	{SETTYPE_LIST,	SET_NULL,	"GPS串口5波特率", 	0 , 	BaudListNum-1,		4 ,		BaudList,		BaudListNum,	GROUP_PARA_SERIAL,0x0000, UINT_R},
	{SETTYPE_LIST,	SET_NULL,	"GPS串口5校验", 	0 , 	ParityListNum-1,	2 ,		ParityList,		ParityListNum,	GROUP_PARA_SERIAL,0x0000, UINT_R},
	{SETTYPE_LIST,	SET_NULL,	"备用串口6规约", 		0 , 	ProtocolListNum-1,	7 ,		ProtocolList,	ProtocolListNum,GROUP_PARA_SERIAL,0x0000, UINT_R},
	{SETTYPE_LIST,	SET_NULL,	"备用串口6波特率", 		0 , 	BaudListNum-1,		7 ,		BaudList,		BaudListNum,	GROUP_PARA_SERIAL,0x0000, UINT_R},
	{SETTYPE_LIST,	SET_NULL,	"备用串口6校验方式", 	0 , 	ParityListNum-1,	0 ,		ParityList,		ParityListNum,	GROUP_PARA_SERIAL,0x0000, UINT_R},
	{SETTYPE_LIST,	SET_NULL,	"备用串口7规约", 		0 , 	ProtocolListNum-1,	0 ,		ProtocolList,	ProtocolListNum,GROUP_PARA_SERIAL,0x0000, UINT_R},
	{SETTYPE_LIST,	SET_NULL,	"备用串口7波特率", 	0 , 	BaudListNum-1,		7 ,		BaudList,		BaudListNum,	GROUP_PARA_SERIAL,0x0000, UINT_R},
	{SETTYPE_LIST,	SET_NULL,	"备用串口7校验", 		0 , 	ParityListNum-1,	0 ,		ParityList,		ParityListNum,	GROUP_PARA_SERIAL,0x0000, UINT_R},	
#ifdef FUN_FUXI_ESAM
	{SETTYPE_LIST,	SET_NULL,	"南网加密规约",		0 , 	ProtocolListNum-1,	2 , 	ProtocolList,	ProtocolListNum,GROUP_PARA_SERIAL,0x0000, UINT_R},
	{SETTYPE_LIST,	SET_NULL,	"南网加密波特率", 	0 ,		  	BaudListNum-1,		7 , 	BaudList,		BaudListNum,	GROUP_PARA_SERIAL,0x0000, UINT_R},
	{SETTYPE_LIST,	SET_NULL,	"南网加密校验",		0 , 	ParityListNum-1,	0 , 	ParityList, 	ParityListNum,	GROUP_PARA_SERIAL,0x0000, UINT_R},	
#endif

	{SETTYPE_LABEL,	SET_NULL,	"以太网通道", 		0 , 	0,					0 ,		0,				0,				GROUP_PARA_ETHERNET,0x0000, NULL_R},
    {SETTYPE_LIST,	SET_NULL,	"1#_网络", 			0 , 	Net_Eth_ListNum-1,	0 ,		Net_Eth_List,	Net_Eth_ListNum,GROUP_PARA_ETHERNET,0x0000, UINT_R},
    {SETTYPE_IP,	SET_NULL,	"1#IP地址", 		0 , 	0xffffffff,			0 ,	(void *)0xc0a80164,	0,				GROUP_PARA_ETHERNET,0x0000, STR_R}, // IP 192.168.1.100
    {SETTYPE_IP,	SET_NULL,	"1#子网掩码", 		0 , 	0xffffffff,			0 ,	(void *)0xffffff00,	0,				GROUP_PARA_ETHERNET,0x0000, STR_R}, // 255.255.255.0
    {SETTYPE_IP,	SET_NULL,	"1#目标网络", 		0 , 	0xffffffff,			0 ,	(void *)0x00000000,	0,				GROUP_PARA_ETHERNET,0x0000, STR_R}, // 192.168.64.240	
    {SETTYPE_IP,	SET_NULL,	"1#目标掩码", 		0 , 	0xffffffff,			0 ,	(void *)0x00000000,	0,				GROUP_PARA_ETHERNET,0x0000, STR_R}, // 0.0.0.0	
    {SETTYPE_IP,	SET_NULL,	"1#网关", 			0 , 	0xffffffff,			0 ,	(void *)0x00000000,	0,				GROUP_PARA_ETHERNET,0x0000, STR_R}, // 192.168.64.240	
    {SETTYPE_LIST,	SET_NULL,	"2#_网络", 			0 , 	Net_Eth_ListNum-1,	1 ,		Net_Eth_List,	Net_Eth_ListNum,GROUP_PARA_ETHERNET,0x0000, UINT_R},
    {SETTYPE_IP,	SET_NULL,	"2#IP地址", 		0 , 	0xffffffff,			0 ,	(void *)0xc0a80264,	0,				GROUP_PARA_ETHERNET,0x0000, STR_R},// IP 192.168.2.100
    {SETTYPE_IP,	SET_NULL,	"2#子网掩码", 		0 , 	0xffffffff,			0 ,	(void *)0xffffff00,	0,				GROUP_PARA_ETHERNET,0x0000, STR_R},// 255.255.255.0
    {SETTYPE_IP,	SET_NULL,	"2#目标网络", 		0 , 	0xffffffff,			0 ,	(void *)0x00000000,	0,				GROUP_PARA_ETHERNET,0x0000, STR_R}, // IP 192.168.2.100	
    {SETTYPE_IP,	SET_NULL,	"2#目标掩码", 		0 , 	0xffffffff,			0 ,	(void *)0x00000000,	0,				GROUP_PARA_ETHERNET,0x0000, STR_R}, // 0.0.0.0	
    {SETTYPE_IP,	SET_NULL,	"2#网关", 			0 , 	0xffffffff,			0 ,	(void *)0x00000000,	0,				GROUP_PARA_ETHERNET,0x0000, STR_R}, // 192.168.2.100	
    {SETTYPE_LIST,  SET_NULL,   "3#_网络",          0 ,     Net_Eth_ListNum-1,  2 , Net_Eth_List,   Net_Eth_ListNum,   GROUP_PARA_ETHERNET,0x0000, UINT_R},
    {SETTYPE_IP,    SET_NULL,   "3#IP地址",         0 ,     0xffffffff,         0 , (void *)0xc0a80364, 0,              GROUP_PARA_ETHERNET,0x0000, STR_R},// IP 192.168.3.100
    {SETTYPE_IP,    SET_NULL,   "3#子网掩码",       0 ,     0xffffffff,         0 , (void *)0xffffff00, 0,              GROUP_PARA_ETHERNET,0x0000, STR_R},// 255.255.255.0
    {SETTYPE_IP,    SET_NULL,   "3#目标网络",       0 ,     0xffffffff,         0 , (void *)0x00000000, 0,              GROUP_PARA_ETHERNET,0x0000, STR_R}, // IP 192.168.3.100
    {SETTYPE_IP,    SET_NULL,   "3#目标掩码",       0 ,     0xffffffff,         0 , (void *)0x00000000, 0,              GROUP_PARA_ETHERNET,0x0000, STR_R}, // 0.0.0.0
    {SETTYPE_IP,    SET_NULL,   "3#网关",          0 ,     0xffffffff,         0 , (void *)0x00000000, 0,              GROUP_PARA_ETHERNET,0x0000, STR_R}, // 192.168.3.100
    {SETTYPE_LIST,  SET_NULL,   "4#_网络",         0 ,     Net_Eth_ListNum-1,  2 , Net_Eth_List,   Net_Eth_ListNum,    GROUP_PARA_ETHERNET,0x0000, UINT_R},
    {SETTYPE_IP,    SET_NULL,   "4#IP地址",        0 ,     0xffffffff,         0 , (void *)0xc0a840f0, 0,              GROUP_PARA_ETHERNET,0x0000, STR_R},// IP 192.168.4.100
    {SETTYPE_IP,    SET_NULL,   "4#子网掩码",       0 ,     0xffffffff,         0 , (void *)0xffffff00, 0,              GROUP_PARA_ETHERNET,0x0000, STR_R},// 255.255.255.0
    {SETTYPE_IP,    SET_NULL,   "4#目标网络",       0 ,     0xffffffff,         0 , (void *)0x00000000, 0,              GROUP_PARA_ETHERNET,0x0000, STR_R}, // 192.168.3.100
    {SETTYPE_IP,    SET_NULL,   "4#目标掩码",       0 ,     0xffffffff,         0 , (void *)0x00000000, 0,              GROUP_PARA_ETHERNET,0x0000, STR_R}, // 0.0.0.0
    {SETTYPE_IP,    SET_NULL,   "4#网关",           0 ,     0xffffffff,         0 , (void *)0x00000000, 0,              GROUP_PARA_ETHERNET,0x0000, STR_R}, // 192.168.3.254
	{SETTYPE_IP,	SET_NULL,	"默认网关", 		0 , 	0xffffffff,			0 ,	(void *)0xc0a840fe,	0,				GROUP_PARA_ETHERNET,0x0000, STR_R},// 192.168.64.254
	
	{SETTYPE_LABEL,	SET_NULL,	"对时", 			0 , 	0,					0 ,		0,				0,				GROUP_PARA_TIME,0x0000, NULL_R},
	{SETTYPE_LIST,	SET_NULL,	"对时方式", 		0 , 	TimeListNum-1,		0 ,		TimeList,		TimeListNum,	GROUP_PARA_TIME,0x0000, UINT_R},
	{SETTYPE_LIST,	SET_NULL,	"标准化对时方式", 	0 , 	TimeListSelectNum-1,0 ,		TimeListSelect,	TimeListSelectNum,	GROUP_PARA_TIME},
	{SETTYPE_4INT,	SET_S,		"卫星对时间隔",		1 , 	300,				1,		0,				0,				GROUP_PARA_TIME},
	{SETTYPE_4INT,	SET_MIN,	"对时切换时长",		1 , 	6000,				60,		0,				0,				GROUP_PARA_TIME},
	{SETTYPE_IP,	SET_NULL,	"SNTP服务器IP", 	0 , 	0xffffffff,			0 ,	(void *)0x00000000,	0,				GROUP_PARA_TIME,0x0000, STR_R},
	{SETTYPE_5INT,	SET_S,		"SNTP对时间隔",		10 , 	1024,				64,		0,				0,				GROUP_PARA_TIME,0x0000, UINT_R},
	
	{SETTYPE_LABEL,	SET_NULL,	"电池管理", 		0 , 	0,					0 ,		0,				0,				GROUP_PARA_BATTERY,0x0000, NULL_R},
	{SETTYPE_YMD,	SET_NULL,	"活化启动时间", 	0, 		0xffffffff,			0,		0,				0,				GROUP_PARA_BATTERY,0x0000, ULONG_R},
	{SETTYPE_UINT,	SET_HOUR,	"电池活化时刻", 	0, 		23,					0,		0,				0,				GROUP_PARA_BATTERY,0x0000, UINT_R},
	{SETTYPE_UINT,	SET_D,		"电池活化周期", 	0, 		360,				0 ,		0,				0,				GROUP_PARA_BATTERY,0x0000, UINT_R},
	{SETTYPE_F,		SET_HOUR,	"电池告警阀值", 	1.0, 	100.0,				6.0,	0,				0,				GROUP_PARA_BATTERY,0x0000, FLOAT_R},

	{SETTYPE_LABEL,	SET_NULL,	"远动参数", 		0 , 	0,					0 ,		0,				0,				GROUP_PARA_RMT,0x0000, NULL_R},
	
#ifdef  PARAM_DEAD_PER
    {SETTYPE_F,		SET_PER,	"遥测死区",			0.0 , 	100.0,				1.0 ,	0,				0,				GROUP_PARA_RMT,0x0000,	FLOAT_R},
#else
    {SETTYPE_F, 	SET_NULL,	"遥测死区", 		0.0 ,	0.3,				0.01 ,	0,				0,				GROUP_PARA_RMT,0x0000,	FLOAT_R},
#endif
#ifdef GD_AREA_MAIN_2020
    {SETTYPE_F,		SET_NULL,	"电流死区",			0.0 , 	0.3,				0.01 ,	0,				0,				GROUP_PARA_RMT,0x0000,	FLOAT_R},
    {SETTYPE_F,		SET_NULL,	"交流电压死区",		0.0 , 	0.3,				0.01 ,	0,				0,				GROUP_PARA_RMT,0x0000,	FLOAT_R},
    {SETTYPE_F,		SET_NULL,	"直流电压死区",		0.0 , 	0.3,				0.01 ,	0,				0,				GROUP_PARA_RMT,0x0000,	FLOAT_R},
    {SETTYPE_F,		SET_NULL,	"功率死区",			0.0 , 	0.3,				0.01 ,	0,				0,				GROUP_PARA_RMT,0x0000,	FLOAT_R},
    {SETTYPE_F,		SET_NULL,	"频率死区",			0.0 , 	0.3,				0.05 ,	0,				0,				GROUP_PARA_RMT,0x0000,	FLOAT_R},
    {SETTYPE_F,		SET_NULL,	"功率因数死区",		0.0 , 	0.3,				0.01 ,	0,				0,				GROUP_PARA_RMT,0x0000,	FLOAT_R},
#else
    #ifndef  PARAM_DEAD_PER
    {SETTYPE_F,		SET_PER,	"电流死区",			0.0 , 	0.3,				0.01 ,	0,				0,				GROUP_PARA_RMT,0x0000,	FLOAT_R},
    {SETTYPE_F,		SET_PER,	"交流电压死区",		0.0 , 	0.3,				0.01 ,	0,				0,				GROUP_PARA_RMT,0x0000,	FLOAT_R},
    {SETTYPE_F,		SET_PER,	"直流电压死区",		0.0 , 	0.3,				0.01 ,	0,				0,				GROUP_PARA_RMT,0x0000,	FLOAT_R},
    {SETTYPE_F,		SET_PER,	"功率死区",			0.0 , 	0.3,				0.01 ,	0,				0,				GROUP_PARA_RMT,0x0000,	FLOAT_R},
    {SETTYPE_F,		SET_PER,	"频率死区",			0.0 , 	0.3,				0.05 ,	0,				0,				GROUP_PARA_RMT,0x0000,	FLOAT_R},
    {SETTYPE_F,		SET_PER,	"功率因数死区",		0.0 , 	0.3,				0.01 ,	0,				0,				GROUP_PARA_RMT,0x0000,	FLOAT_R},
    #else
    {SETTYPE_F,		SET_PER,	"电流死区",			0.0 , 	100.0,				1.0 ,	0,				0,				GROUP_PARA_RMT,0x0000,	FLOAT_R},
    {SETTYPE_F,		SET_PER,	"交流电压死区",		0.0 , 	100.0,				1.0 ,	0,				0,				GROUP_PARA_RMT,0x0000,	FLOAT_R},
    {SETTYPE_F,		SET_PER,	"直流电压死区",		0.0 , 	100.0,				1.0 ,	0,				0,				GROUP_PARA_RMT,0x0000,	FLOAT_R},
    {SETTYPE_F,		SET_PER,	"功率死区",			0.0 , 	100.0,				1.0 ,	0,				0,				GROUP_PARA_RMT,0x0000,	FLOAT_R},
    {SETTYPE_F,		SET_PER,	"频率死区",			0.0 , 	100.0,				1.0 ,	0,				0,				GROUP_PARA_RMT,0x0000,	FLOAT_R},
    {SETTYPE_F,		SET_PER,	"功率因数死区",		0.0 , 	100.0,				1.0 ,	0,				0,				GROUP_PARA_RMT,0x0000,	FLOAT_R},
    #endif
#endif
	{SETTYPE_LINT,	SET_MS,		"遥信防抖时间",		0.0 , 	60000.0,			20.0 ,	0,				0,				GROUP_PARA_RMT,0x0000,	FLOAT_R},
	{SETTYPE_LINT,	SET_MS,		"分闸脉冲",			0.0 , 	50000.0,			200.0 ,	0,				0,				GROUP_PARA_RMT,0x0000,	FLOAT_R},
	{SETTYPE_LINT,	SET_MS,		"合闸脉冲",			0.0 , 	50000.0,			200.0 ,	0,				0,				GROUP_PARA_RMT,0x0000,	FLOAT_R},
	{SETTYPE_F,		SET_U,		"电压零漂",			0.0 , 	20.0,				5 ,	    0,				0,				GROUP_PARA_RMT,0x0000,	FLOAT_R},
#ifdef GD_TEST_2021
	{SETTYPE_F,		SET_A,		"相电流零漂",		0.0 , 	1.0,				0.25 ,	0,				0,				GROUP_PARA_RMT,0x0000,	FLOAT_R},
	{SETTYPE_F,		SET_A,		"零序电流零漂",		 0.0 , 	1.0,				0.04 ,	0,				0,				GROUP_PARA_RMT,0x0000,	FLOAT_R},
#else
	{SETTYPE_F,		SET_A,		"电流零漂",		   0.0 , 	1.0,				0.005 ,	0,				0,				GROUP_PARA_RMT,0x0000,	FLOAT_R},
#endif
#ifdef CPU_FUXI
	{SETTYPE_F, 	SET_U,		"直流电压零漂",			0.0 ,	20.0,				1 , 	0,				0,				GROUP_PARA_RMT,0x0000,FLOAT_R},
#endif

    {SETTYPE_LABEL, SET_NULL,   "其它",             0 ,     0,                  0 ,     0,              0,              GROUP_PARA_OTHERS,0x0000, NULL_R},
    {SETTYPE_LINT,  SET_MS,     "合分闸脉冲",           0.0 ,   50000.0,            200.0 , 0,              0,              GROUP_PARA_OTHERS,0x0000, FLOAT_R},
    {SETTYPE_LIST,  SET_NULL,   "信号自动复归投退", 0 ,     TTListNum-1,        1,      TTList,         TTListNum,      GROUP_PARA_OTHERS,0x0000, BOOL_R},
#ifdef GD_AREA_MAIN_2020
    {SETTYPE_5INT,  SET_MIN,        "信号自动复归时间", 0,      3000,           2880,   0,              0,              GROUP_PARA_OTHERS,0x0000, FLOAT_R},
#else
    {SETTYPE_5INT,    SET_MIN,        "信号自动复归时间", 0,      3000,               2880,    0,              0,              GROUP_PARA_OTHERS,0x0000, FLOAT_R},
#endif

#ifdef YX_RESET_TIME
	{SETTYPE_F,	SET_S,		"故障遥信保持时间", 0,		6000,				5,	0,				0,				GROUP_PARA_OTHERS,0x0000, FLOAT_R},
#endif

	{SETTYPE_5INT,	SET_S,		"液晶背光时间", 	0, 		65535,				180 ,	0,				0,				GROUP_PARA_OTHERS,0x0000, UINT_R},
	{SETTYPE_LIST,	SET_NULL,	"级联状态监测", 0 , 	LinkListNum-1,		1,		LinkList,			LinkListNum,		GROUP_PARA_OTHERS,0x0000, UINT_R},
#if (defined GD_AREA_ZHONGSHAN || defined GD_AREA_ZHONGSHAN_2020) && !defined GD_AREA_ZHONGSHAN_FTU
	{SETTYPE_UINT,	SET_NULL,	"GOOSE通信ID", 		1 , 	32,				1 , 	0,				0,				GROUP_PARA_OTHERS,0x0000, FLOAT_R},
	{SETTYPE_F, 		SET_S,		"GOOSE通信T1", 		0.0 ,	100.0,			6.0 ,	0,		0,	GROUP_PARA_OTHERS,0x0000, FLOAT_R},		
	{SETTYPE_F, 		SET_S,		"GOOSE通信T2", 		0.0 ,	100.0,			3.0 ,	0,		0,	GROUP_PARA_OTHERS,0x0000, FLOAT_R},		
#endif

#ifdef RCD_STRAN_M_EN
	{SETTYPE_LIST,	SET_NULL,	"级联录波主站使能", 0 , 			TTListNum-1,		0,		TTList, TTListNum,		GROUP_PARA_OTHERS,0x0000, BOOL_R},
#endif

#ifdef YPARA_LINK_S_EN
	{SETTYPE_LIST,	SET_NULL,	"子站参数变化通知", 0 , TTListNum-1,		0,		TTList, 		TTListNum,		GROUP_PARA_OTHERS, 0x0000,BOOL_R},
#endif

#ifdef FUN_FUXI_ESAM
	{SETTYPE_LABEL,	SET_NULL,	"南网加密配置(重新配置需重启)", 				0 , 	0,			0 ,					0,			0,			GROUP_PARA_S1,0x0000, NULL_R},	
	{SETTYPE_LIST,	SET_NULL,	"加密工作模式", 	0 , 	T104ServerListNum-1,		0,		T104ServerList,			T104ServerListNum,		GROUP_PARA_S1,0x0000, BOOL_R},
	{SETTYPE_5INT,	SET_NULL,	"加密监听端口",			 	0, 			65535,		 2404 ,					0,			0,			GROUP_PARA_S1,0x0000, UINT_R},
	
	{SETTYPE_IP,	SET_NULL,	"NAT", 					0 , 	0xffffffff,			0 ,	(void *)0x00000000,			0,			GROUP_PARA_S1,0x0000, STR_R}, // 192.168.1.100
	{SETTYPE_IP,	SET_NULL,	"加密IP地址", 				0 , 	0xffffffff,			0 ,	(void *)0xc0a80296,			0,			GROUP_PARA_S1,0x0000, STR_R}, // 192.168.1.100
	{SETTYPE_IP,	SET_NULL,	"加密掩码", 				0 , 	0xffffffff,			0 ,	(void *)0xffffff00,			0,			GROUP_PARA_S1,0x0000, STR_R}, // 255.255.255.0
	{SETTYPE_IP,	SET_NULL,	"加密网关", 				0 , 	0xffffffff,			0 ,	(void *)0xc0a80201,			0,			GROUP_PARA_S1,0x0000, STR_R}, // 192.168.1.1
	{SETTYPE_IP,	SET_NULL,	"远端IP地址", 				0 , 	0xffffffff,			0 ,	(void *)0xac100001,			0,			GROUP_PARA_S1,0x0000, STR_R}, // 192.168.0.2
	{SETTYPE_IP,	SET_NULL,	"远端掩码", 				0 , 	0xffffffff,			0 ,	(void *)0xffffff00,			0,			GROUP_PARA_S1,0x0000, STR_R}, // 255.255.255.0
	{SETTYPE_IP,	SET_NULL,	"远端网关", 				0 , 	0xffffffff,			0 ,	(void *)0xac100014,			0,			GROUP_PARA_S1,0x0000, STR_R}, // 192.168.0.1
#endif

#ifdef METERING_ENERGY
	{SETTYPE_LABEL, SET_NULL,	"历史文件", 			0 , 			   0,	   0 , 			 0,					0,		GROUP_PARA_HISFILE,0x0000, NULL_R},
	//{SETTYPE_LIST,	SET_NULL,	"记录文件投退",		0 , 	TTListNum-1,		0,		TTList, 		TTListNum,		GROUP_PARA_HISFILE,0x0000, NULL_R},
	{SETTYPE_UINT,	SET_MIN,	"遥测定点间隔时间", 5 , 					60.0,	15.0 ,			 0,					0,		GROUP_PARA_HISFILE,0x0000, UINT_R},
	{SETTYPE_LIST,	SET_NULL,	"线损文件投退",   		0 , 	 TTListNum-1,		0,		TTList, 		TTListNum,		GROUP_PARA_HISFILE,0x0000, BOOL_R},
	{SETTYPE_UINT,	SET_NULL,	"开关ID", 			1 ,				16.0,	 1.0 ,			 0,					0,		GROUP_PARA_HISFILE,0x0000, UINT_R},
	{SETTYPE_UINT,	SET_MIN,	"线损定点间隔时间", 5 ,						60.0,	15.0 ,			 0,					0,		GROUP_PARA_HISFILE,0x0000, UINT_R},
	{SETTYPE_UINT,	SET_D,		"考核日冻结日",			 1,				28.0,	 1.0 ,			 0,					0,		GROUP_PARA_HISFILE,0x0000, UINT_R},
	{SETTYPE_UINT,	SET_HOUR,	"考核日冻结小时",			0 , 			23.0,	   0 , 			 0,					0,		GROUP_PARA_HISFILE,0x0000, UINT_R},
#endif
};
const int EQUIP_PARA_NUMBER  = sizeof( tEquipParaTable ) / sizeof(tEquipParaTable[0]);

// 时间设置
const  TSETTABLE tTimeTable[]=   	// min       max        default
{
	{SETTYPE_UINT,	SET_NULL,	"年", 	0, 	99,			15 ,	0,		0,		0},
	{SETTYPE_UINT,	SET_NULL,	"月", 	1, 	12,			1 ,		0,		0,		0},
	{SETTYPE_UINT,	SET_NULL,	"日", 	1, 	31,			1 ,		0,		0,		0},
	{SETTYPE_UINT,	SET_NULL,	"时", 	0, 	24,			8 ,		0,		0,		0},
	{SETTYPE_UINT,	SET_NULL,	"分", 	0, 	59,			8 ,		0,		0,		0},
	{SETTYPE_UINT,	SET_NULL,	"秒", 	0, 	59,			8 ,		0,		0,		0},
};	
const int TIME_SET_NUMBER  = sizeof( tTimeTable ) / sizeof(tTimeTable[0]);

// 密码设置
const  TSETTABLE tCodeTable[]=   	// min       max        default
{
	{SETTYPE_4INT,	SET_NULL,	"用户密码", 	0, 	9999,			0 ,	0,		0,		0},
};	
const int CODE_SET_NUMBER  = sizeof( tCodeTable ) / sizeof(tCodeTable[0]);

// 输入密码
const  TSETTABLE tPasswordTable[]=   	// min       max        default
{
	{SETTYPE_4INT,	SET_NULL,	"输入密码", 	0, 	9999,			0 ,	0,		0,		0},
};	

const  TRMTSETTABLE tRmtsettable[]=         //
{
	
	{0x8223,		BOOL_R,		RMT_GRP_SWSET,		0,		0,},   		//	首端FTU投入",			
	
};
const int RMT_SET_TABLE_NUMBER  = sizeof( tRmtsettable ) / sizeof(tRmtsettable[0]);

const  TFIXEDSETTABLE tfixedsettable[]=         //
{
#ifdef GD_AREA_ECZD_MAOMING
	{FIXED_SET_EQU,		0x8001,	STR_R,	"D30",						"终端类型",},
	{FIXED_SET_SYS,		0x8002,	STR_R,	"Linux 2.6.29.1",			"操作系统",},
	{FIXED_SET_MAU,		0x50A2,	STR_R,	"",							"  制造商",},
	{FIXED_SET_HVR,		0x50A4,	STR_R,	"HV01.02",					"硬件版本",},
	{FIXED_SET_SVR,		0x50A5,	STR_R,	"",							"软件版本",},
	{FIXED_SET_CRC,		0x8006,	USHORT_R,"",						"软件校验",},
	{FIXED_SET_COM,		0x50A6,	STR_R,	"101-2016,104-2016",		"通信规约",},
	{FIXED_SET_TPE,		0x50A3,	STR_R,	"DFTU-8000",				"出厂型号",},
	{FIXED_SET_ID,		0x50A1,	STR_R,	"",							"终端ID号",},
#elif defined GD_AREA_ZHONGSHAN || defined GD_AREA_ZHONGSHAN_2020 || defined GD_AREA_ZHONGSHAN_2020_ZC
	{FIXED_SET_EQU, 	0x8001, STR_R,	"D30",						"终端类型",},
	{FIXED_SET_SYS, 	0x8002, STR_R,	"Linux 2.6.29.1",			"操作系统",},
	{FIXED_SET_MAU, 	0x5077, STR_R,	"", 						"  制造商",},
	{FIXED_SET_HVR, 	0x5079, STR_R,	"HV01.02",					"硬件版本",},
	{FIXED_SET_SVR, 	0x507A, STR_R,	"", 						"软件版本",},
	{FIXED_SET_CRC, 	0x8006, USHORT_R,"",						"软件校验",},
	{FIXED_SET_COM, 	0x507B, STR_R,	"101-2016,104-2016",		"通信规约",},
	{FIXED_SET_TPE, 	0x5078, STR_R,	"DFTU-8000",				"出厂型号",},
	{FIXED_SET_ID,		0x5076, STR_R,	"", 						"终端ID号",},
#else
	{FIXED_SET_EQU,		0x8001,	STR_R,	"D30",						"终端类型",},
	{FIXED_SET_SYS,		0x8002,	STR_R,	"Linux 2.6.29.1",			"操作系统",},
	{FIXED_SET_MAU,		0x8003,	STR_R,	"",							"  制造商",},
	{FIXED_SET_HVR,		0x8004,	STR_R,	"HV01.02",					"硬件版本",},
	{FIXED_SET_SVR,		0x8005,	STR_R,	"",							"软件版本",},
	{FIXED_SET_CRC,		0x8006,	USHORT_R,"",						"软件校验",},
	{FIXED_SET_COM,		0x8007,	STR_R,	"101-2016,104-2016",		"通信规约",},
	{FIXED_SET_TPE,		0x8008,	STR_R,	"DFTU-8000",				"出厂型号",},
	{FIXED_SET_ID,		0x8009,	STR_R,	"",							"终端ID号",},
#endif
	{FIXED_SET_MAC1,	0x800A,	STR_R,	"",							"网卡1MAC",},
	{FIXED_SET_MAC2,	0x800B,	STR_R,	"",							"网卡2MAC",},
	{FIXED_SET_PTRATE,	0x800C, STR_R,	"100", 						"PT变比",},
	{FIXED_SET_CTRATE,	0x800D, STR_R,	"120", 						"CT变比",},
	{FIXED_SET_CPT,		0x800E, STR_R,	"", 						"编译时间",},
};

const int FIXEDSET_TABLE_NUMBER	= sizeof( tfixedsettable ) / sizeof(tfixedsettable[0]);

const CSTVAL_FORWARD_TABLE tCstValForwardTable[] = 
{//以下元素排序时需按分组排序：装置参数、公共定值、保护定值、内部定值
#if defined GD_AREA_NAME	//举例
	// 装置参数
	{SETGROUP_TYPE_PARA,  PARA_ADDR,				0x5001},	//装置地址
	{SETGROUP_TYPE_PARA,  PARA_DEAD_I,				0x5002},	//电流死区
	{SETGROUP_TYPE_PARA,  PARA_DEAD_U,				0x5003},	//交流电压死区
	{SETGROUP_TYPE_PARA,  PARA_DEAD_P,				0x5004},	//功率死区
	{SETGROUP_TYPE_PARA,  PARA_DEAD_COS,			0x5005},	//功率因数死区
	{SETGROUP_TYPE_PARA,  PARA_YXFD,				0x5006},	//遥信防抖时间
	{SETGROUP_TYPE_PARA,  PARA_BAT_INTERVAL,		0x5007},	//电池活化间隔
		
	// 公共定值 
	{SETGROUP_TYPE_PUB,  SET_SECTION,				0x5008},	//定值区
	{SETGROUP_TYPE_PUB,  SET_BHCT1_A,				0x5009},	//保护CT额定值1次
	{SETGROUP_TYPE_PUB,  SET_BHCT2_A,				0x500A},	//保护CT额定值2次
	{SETGROUP_TYPE_PUB,  SET_I0CT1_A,				0x500B},	//零序CT额定值1次 
	{SETGROUP_TYPE_PUB,  SET_I0CT2_A,				0x500C},	//零序CT额定值2次 
	
	// 保护定值 
	{SETGROUP_TYPE_BH,	  SET_EDIT_PAR_YB,			0x5010},	// 远方修改投入
	{SETGROUP_TYPE_BH,	  SET_GL1_TT,				0x5012},	// 过流1投入
	{SETGROUP_TYPE_BH,	  SET_GL2_TT,				0x5013},	// 过流2投入	
	{SETGROUP_TYPE_BH,	  SET_BH_PTDX,				0x5014},	// PT断线检查	
	{SETGROUP_TYPE_BH,	  SET_LX1_TT,				0x5015},	// 零序1投入
	{SETGROUP_TYPE_BH,	  SET_BH_XBBS_TT,			0x5016},	// 涌流闭锁投入
	{SETGROUP_TYPE_BH,	  SET_CH1_TT,				0x5017},	// 一次重合闸投入
	{SETGROUP_TYPE_BH,	  SET_DLYX_TT,				0x5018},	// 过负荷告警投入	
#endif
};

struct THREE_REMOTE g_three_remote_func[]=
{
	{KEYWORD_YX,"遥信","<交流>","可配置成交流遥信",get_yx_ac},
//示例：
	//{KEYWORD_YC,"遥测","<**>","****",void},
	//{KEYWORD_YK,"遥控","<**>","****",void},
};
const int REMOTE_NUM = (sizeof(g_three_remote_func)/sizeof(g_three_remote_func[0]));

// 得到一个固定参数的值
int set_get_fixed_arg(int index,char *buf,int len)
{
	RMT_FIXED_TABLE tfixedset;	
	int i;
	 
	iec_init_fixedset(&g_t104[0],&tfixedset,true);  // 获取固定定值
	
	// 检查参数
	if(index < 0 || index >=RMT_FIXED_SET_NUM) //FIXEDSET_TABLE_NUMBER)
	{
		return -1;
	}
	if(buf==NULL || len < 32)
	{
		return -2;
	}

	memset(buf,0,len);

	len--;
	for(i=0;i<RMT_FIXED_SET_NUM;i++)
	{
		if(index == tfixedset.set[i].type)
		{
			switch(index)
			{
				case FIXED_SET_CRC: // 软件校验。
					sprintf(buf,"%04x",(tfixedset.set[i].str[0]+(tfixedset.set[i].str[1]<<8)));		
				break;
				case FIXED_SET_MAC1: 
				case FIXED_SET_MAC2: 
					sprintf(buf,"%02x-%02x-%02x-%02x-%02x-%02x",tfixedset.set[i].str[0],tfixedset.set[i].str[1],tfixedset.set[i].str[2],tfixedset.set[i].str[3],tfixedset.set[i].str[4],tfixedset.set[i].str[5]);
				break;
				default:
					strncpy(buf,tfixedset.set[i].str,len);
				break;
			}

			return 0;
	
			
		}
		
	}


	return -3;
}

// 得到固定参数字符串，维护工具接口用
#define FIXED_ARGS_NUM		6
int set_get_fixed_args_sz(int index,char *buf,int len)
{
	int i,len_line,len_all,num;
	char sz[64],arg[64];

	len_all = 0;
	num = 0;
	for(i=index*FIXED_ARGS_NUM;i<FIXEDSET_TABLE_NUMBER&&num<FIXED_ARGS_NUM;i++,num++)
	{
		set_get_fixed_arg(tfixedsettable[i].index,arg,64);
		len_line = sprintf(sz,"%s[%04x]:%s\r\n",tfixedsettable[i].name,tfixedsettable[i].di,arg);;
		
		strncpy(buf+len_all,sz,len-len_all);

		len_all += len_line;
		if(len_all >= len)
		{
			buf[len- 1] =0;
			return len;
		}
		
	}

	// 删除最后的回车换行
	if(len_all > 2)
	{
		len_all -= 2;
	}
	buf[len_all] =0;
	return len_all+1;
}



/*********************eep操作通用函数:包含装置型号及CRC信息*******************/

/**************************************************************************
函数名称：SaveEppData
函数版本：1.00 
作者：   
创建日期：2008.8.20    
函数功能说明：在EEP中，保存信息，附加了装置类型及校验码
输入参数：
输出参数：无
返回值： 成功时返回1，否则，0
函数扇入清单：
***************************************************************************/
bool SaveEppData(DWORD wAddr,void *pdat ,WORD num )
{
	EQUIP_INF tInf;
	tInf.wType=EQUIP_TYPE;  //装置类型
	tInf.wVerH=SOFT_VERH; //版本号
	tInf.wVerL=SOFT_VERL;
	tInf.wCrc=CrcStr((BYTE *)pdat, num);
	tInf.wdescCrc = g_crc_set_desc;

	if(e2prom_write(wAddr,(BYTE *)pdat,num)!=0) // 保存信息
	{
		return false;
	}
	if(e2prom_write((wAddr+num),(BYTE *)&tInf,sizeof(EQUIP_INF))!=0) // 保存校验信息，包括校验码
	{
		return false;
	}
	
	return true;
}


/**************************************************************************
函数名称：ReadEppData
函数版本：1.00 
作者：   
创建日期：2008.8.20    
函数功能说明：读EEP中保存信息，并进行装置类型及校验码的校验
输入参数：
输出参数：无
返回值： 成功时返回1，否则，0
函数扇入清单：
***************************************************************************/
bool ReadEppData(DWORD wAddr,void *pdat ,WORD num )
{
	EQUIP_INF tInf;
	WORD crc;
	e2prom_read(wAddr,(BYTE *)pdat,num);
	e2prom_read((wAddr+num),(BYTE *)&tInf,sizeof(EQUIP_INF));
	if(tInf.wType!=EQUIP_TYPE)  //不是本装置
	{
		return false;
	}
	if (tInf.wdescCrc != g_crc_set_desc)
	{
		//return false;
	}
	crc=CrcStr((BYTE *)pdat,num);
	if(crc!=tInf.wCrc)
	{
		return false;
	}
	return true;    	
}

/******************下面是关于定值区及定值读取及校验的操作********************************/




/**********************************************************
函数名称：ReadSet
函数版本：1.00 
作者：   
创建日期：2008.8.20    
函数功能说明：从指定定值区setno读取定值到pf中,并进行CRC-16校验
输入参数：BYTE setno指定定值区
输出参数：无
返回值： 成功时返回1，否则，0
函数扇入清单：
************************************************************/
bool ReadSet(WORD setno,void *pbuf)
{
	float *pf=(float*)pbuf;
	if(setno>=SEC_NUMBER)
	{
	    rt_printf("定值区号异常section=%d",setno);
	    return false;
	}
	
	if(!ReadPara((void*)pf,EEP_PUB_ADDR+setno*PUB_SETSIZE,PUB_SET_NUMBER,&tPubSetTable[0]))
	{
		return false;		
	}

	if(!ReadPara((void*)&pf[PUB_SET_NUMBER],EEP_SET_ADDR+setno*SETSIZE,SW_SET_NUMBER,&tSwSetTable[0]))
	{
		return false;		
	}
	
    return true;
}
/**************************************************************************
函数名称：SaveSet
函数版本：1.00 
作者：   
创建日期：2008.8.20    
函数功能说明：从指定定值区setno读取定值到pf中,并进行CRC-16校验
输入参数：BYTE setno指定定值区
输出参数：无
返回值： 成功时返回1，否则，0
函数扇入清单：
***************************************************************************/
bool SaveSet(WORD setno,void *pf)
{
	float *pff=(float*)pf;
	bool ret1=false,ret2=false;
	if(setno>=SEC_NUMBER)
	{
	    rt_printf("定值区号异常section=%d",setno);
	    return false;
	}

	ret1=SavePara((void *)pff,EEP_PUB_ADDR+setno*PUB_SETSIZE,PUB_SET_NUMBER,&tPubSetTable[0]);
	ret2=SavePara((void *)&pff[PUB_SET_NUMBER],(EEP_SET_ADDR+setno*SETSIZE),SW_SET_NUMBER,&tSwSetTable[0]);
	
	if (ret1||ret2)
	{
		g_creat_set_file |= 0x01;
	}
	return (ret1||ret2);
}


/**************************************************************************
函数名称：CheckRunSet
函数版本：1.00 
作者：   
创建日期：2008.8.20    
函数功能说明：检查运行定值
              检查运行定值指针的正确性
              检查当前运行的定值的值是否与备份的定值的信息互为反码
            
输入参数：
其他输入:
输出参数：
返回值： true 检查的内容均正常 false 检查的内容至少有一项不正常 
函数扇入清单：
***************************************************************************/
bool CheckRunSet(void)
{
	BYTE*pBak = (BYTE *)&tBakSet;
	BYTE *pRun= (BYTE *)pRunSet;
	int i = sizeof(struct TSET);
	for(; i>0; i--)
	{
		if((BYTE)*pRun!=(BYTE)(~*pBak))
		{
			return false;
		}
		pRun++;
		pBak++;
	}
	return true;
}
/**************************************************************************
函数名称：GetSetNormal
函数版本：1.00 
作者：   
创建日期：2008.8.20    
函数功能说明：转换定值，将定值转为运行程序可使用的值，目的为了减少代码

            
输入参数：fk为转换的系数
其他输入:
输出参数：
返回值： 
函数扇入清单：
***************************************************************************/

static DWORD GetSetNormal(float ff,float fk)
{
	DWORD ret;
	ret=(DWORD)rt_round((ff*fk));
	return ret;
}

/**************************************************************************
函数名称：GetSetSQR
函数版本：1.00 
作者：   
创建日期：2008.8.20    
函数功能说明：转换定值，将定值转为运行程序可使用的平方值,  目的为了减少代码

            
输入参数：fk为转换的系数
其他输入:
输出参数：
返回值： 
函数扇入清单：
***************************************************************************/

DWORD GetSetSQR(float ff,float fk)
{

	DWORD ret; 
	float fv; 
	fv = ff*fk; 
	if(fv>=65536.0) 
	{  
		ret =  ((DWORD)65536*65535); 
	} 
	else 
	{  
		ret = (DWORD)rt_round((ff*fk)*(ff*fk)); 
	} 
	return ret;
}

/**************************************************************************
函数名称：GetSetTIME
函数版本：1.00 
作者：   
创建日期：2008.8.20    
函数功能说明：转换时间定值，将时间转为系统的定时tick值 目的为了减少代码

            
输入参数：
其他输入:
输出参数：
返回值： 
函数扇入清单：
***************************************************************************/

static DWORD GetSetTIME(float ff)
{
	DWORD ret;
	ret=(DWORD)(0.5+ff*SAM_FREQUENCY);
	return ret;
}

void fresh_set_soe(WORD soe_no,bool bY,bool bFirst,int sw)
{
	WORD code=soe_no+EV_SW_NUM*sw;			
	if(bFirst)
	{
		if(bY)  // 开出压板状态更新到事件记录中
		{
			soe_ev_set(code,1);
		}
		else
		{
			soe_ev_set(code,0);
		}
	
	}
	else
	{
		if(bY)  // 开出压板状态更新到事件记录中
		{
			if(!soe_check(code))
			{
				soe_record_ev(code,1,0,0,0);
			}
		}
		else
		{
			if(soe_check(code))
			{
				soe_record_ev(code,0,0,0,0);
			}
		}
	}
}


#define SW_AC_SET_NUM  (SW_AC_IN_SET_END-SW_AC_IN_SET_BEGIN+1)
const short sw_ac_set_index[SW_AC_SET_NUM]=
{
	SET_GL1_I,
	SET_GL1_T,
	SET_GL2_I,
	SET_GL2_T,
	SET_LX1_I,
	SET_LX1_T,	
	SET_LX1_TT,
	SET_CH_T1,
	SET_CH_T2,
	SET_FA_X_T,
	SET_FA_Y_T,	
	SET_SL_TT,	
};

void fresh_sw_ac_set(	SET_VALUE *psetbuf,int sw)
{
	int i;
	int index;
	for(i=0;i<SW_AC_SET_NUM;i++)
	{
		index=sw_ac_set_index[i];	
		
		//针对佛山供电局遥测中的定值部分（零序一段、二段）和遥参不对应，特殊处理
		if((index == SET_LX1_TT)||(index == SET_LX2_TT))
		{
			if(psetbuf[index+sw*SW_SET_NUMBER].ff==0)
			{
				g_sw[sw].ac_in[SW_AC_IN_SET_BEGIN+i]=2*Q16_BASE;
			}
			else
			{
				g_sw[sw].ac_in[SW_AC_IN_SET_BEGIN+i]=psetbuf[index+sw*SW_SET_NUMBER].ff*Q16_BASE;
			}	
		}
		else
		{
			g_sw[sw].ac_in[SW_AC_IN_SET_BEGIN+i]=psetbuf[index+sw*SW_SET_NUMBER].ff*Q16_BASE;
		}
		

		//if(index==SET_SL_TT)  // 联络分段模式，1为分段 2为联络，定值中为 0和1
		//{
		//	g_sw[sw].ac_in[SW_AC_IN_SET_BEGIN+i]+=Q16_BASE;
		//}
	}
}

/**************************************************************************
函数名称：get_yx_ac
创建日期：2021.11
函数功能说明：获取开入通道配置"<交流>"关键字以确定是否配置为交流遥信
输入参数：无
输出参数：无
返回值： s_bYX_AC
***************************************************************************/
void get_yx_ac(u8 index, u32 type)
{
	gb_yx_ac = true;
}

/**************************************************************************
函数名称：MakeRunSet
函数版本：1.00 
作者：   
创建日期：2008.8.18   
函数功能说明：将psetbuf中保存的定值转换为运行定值
输入参数：
输出参数：无
返回值： 成功时返回1，否则，0
函数扇入清单：
***************************************************************************/
extern  const qs08 g_e_k[];
bool MakeRunSet(bool bFirst)
{
	TSET *ptSet;
	SET_VALUE *psetbuf=m_SetBuf;
	float fKI,fKI0,fKU[PUB_AC_NUM],fIn,fUn,fU0;  // 电流电压系数及额定电流值
	int sw,i;
	bool bRet;
#ifdef CPU_FUXI
	SHM_FREQ_TR_T freq_tr;
#endif	
#ifdef	CUSTOMIZE_BZT //备自投	
	int dw = 0;
#endif	

#ifdef GD_TEST_2021
	BYTE mode_total;
#endif

	bRet=true;
	// 检查定值个数
	if(SET_NUMBER > MAX_SET_NUMBER)
	{
		rt_printf("SET_NUMBER(%d) > MAX_SET_NUMBER(%d).\r\n",SET_NUMBER,MAX_SET_NUMBER);
		rt_err_set(ERR_CODE_SET,0);
		return false;
	}
	
	if(pRunSet==(&tRunSet[0]))  //运行定值缓冲区切换
	{
		ptSet=&tRunSet[1];
	}
	else
	{
		ptSet=&tRunSet[0];
	}

	for(i = 0;i<PUB_AC_NUM;i++)
	{
		ptSet->dKU[i] = sw_v_m2_factor_k(i);				//电压互感器系数
		fKU[i]  = (float)ptSet->dKU[i]/256.0;		
	}

	 /*读取内部定值*/
	if(!ReadPara((void*)psetbuf,EEP_CSTSET_ADDR,CSTSET_NUMBER,&tCstSetTable[0]))
	{
		rt_err_set(ERR_CODE_SET_IN,0);
		GetDefPara((void*)psetbuf,CSTSET_NUMBER,&tCstSetTable[0]);
	}
	else
	{
		rt_err_clr(ERR_CODE_SET_IN,0);
	}
	// 幅值加速滤波系数
	ptSet->fFZLBXS = psetbuf[CSTSET_FZLBXS].ff;
#ifdef XDL_ZT
	// 小电流接地零压定值，有效值非瞬时值
	ptSet->dU_xdl_u0[0] 	= GetSetSQR(psetbuf[CSTSET_XDL_U0_U1].ff,fKU[PUB_AC_U01]);
	ptSet->dU_xdl_u0_fh[0]	= _Mul_Div_U(ptSet->dU_xdl_u0[0],96, 100);		//0.96=0.98*0.98
	ptSet->dU_xdl_u0_zt[0]	= GetSetNormal(psetbuf[CSTSET_XDL_U0_U1].ff,1/(g_ui[PUB_AC_U01].e_factor0)); 	
	ptSet->dT_xdl_u0[0]		= GetSetTIME(psetbuf[CSTSET_XDL_U0_T1].ff);
	
	ptSet->dU_xdl_u0[1] 	= GetSetSQR(psetbuf[CSTSET_XDL_U0_U2].ff,fKU[PUB_AC_U02]);
	ptSet->dU_xdl_u0_fh[1]	= _Mul_Div_U(ptSet->dU_xdl_u0[1],96, 100);		//0.96=0.98*0.98
	ptSet->dU_xdl_u0_zt[1]	= GetSetNormal(psetbuf[CSTSET_XDL_U0_U2].ff,1/(g_ui[PUB_AC_U02].e_factor0)); 	
	ptSet->dT_xdl_u0[1]		= GetSetTIME(psetbuf[CSTSET_XDL_U0_T2].ff);

	ptSet->dU_xdl_22V[0]	= GetSetNormal(20,1/(g_ui[PUB_AC_U01].e_factor0)); 	
	ptSet->dU_xdl_22V[1]	= GetSetNormal(20,1/(g_ui[PUB_AC_U02].e_factor0)); 	
#endif	
	for(sw=0;sw<SWITCH_NUM_MAX;sw++)
	{
		int ui_begin;
		ui_begin = UI_SW_INDEX_BEGIN(sw);
		fKI  = (float)(g_ui[ui_begin + SW_AC_IA].m2_factor_k)/256.0; 
		fIn  = (float)(g_ui[ui_begin + SW_AC_IA].m2_factor_k)/256.0;  
		fKI0= (float)(g_ui[ui_begin + SW_AC_I0].m2_factor_k)/256.0;	
		ptSet->dTBLValue[sw]	=GetSetNormal(psetbuf[CSTSET_TBLQD].ff,fIn); 		// 突变量
		ptSet->dIWL_SQR[sw]	=GetSetSQR(psetbuf[CSTSET_IWL].ff,fIn); 
		
		#ifndef DISP_CHZOKCHR_2_SW		
			ptSet->tSwSet[sw].dT_chz_ok = GetSetTIME(psetbuf[CSTSET_CHZ_OK].ff);//GetSetTIME(180); //重合闸确认时间，默认180秒
		#endif
		#ifdef FUN_CHZ_TOPEN 
		ptSet->tSwSet[sw].dT_chz_Topen = GetSetTIME(psetbuf[CSTSET_CHZ_OPEN].ff);//GetSetTIME(180); //重合闸开放时间，默认300秒
		#endif
 	}
  	ptSet->dT_ZZFG		=GetSetTIME(psetbuf[CSTSET_TZZ].ff); 						// 整组复归时间定值
  	ptSet->dT_TZSB		=GetSetTIME(psetbuf[CSTSET_TZSB].ff); 						// 跳闸失败时间
  	ptSet->dT_HZSB		=GetSetTIME(psetbuf[CSTSET_HZSB].ff); 
	ptSet->bTT_FREQ		=((WORD)psetbuf[CSTSET_FREQ].ff==1 )?true:false; 			// 频率跟踪投退	
#ifdef CPU_FUXI
	if(ptSet->bTT_FREQ)
		freq_tr.enable_flag = 0x55;
	else
		freq_tr.enable_flag = 0;

	write_freq_tr((uint8_t *)&freq_tr);
#endif	
	#ifndef DISP_CHZOKCHR_2_SW
		#ifndef FUNC_CHZ_CHARGE_TIME
		ptSet->dT_chzcd_2=GetSetTIME(psetbuf[CSTSET_CHZCD_2].ff); 
		#endif
	#endif

	ptSet->bTT_U0BS = ((WORD)psetbuf[CSTSET_U0BS_TT].ff==1 )?true:false; 		// 
	ptSet->bTT_DDYBS = ((WORD)psetbuf[CSTSET_DDYBS_TT].ff==1 )?true:false; 		// 
	ptSet->dU_U0BS=GetSetSQR(psetbuf[CSTSET_U0BS_U].ff,fKU[PUB_AC_U01]);	 //零压闭锁定值
	ptSet->dU_DDYBS=GetSetSQR(psetbuf[CSTSET_DDYBS_U].ff,fKU[PUB_AC_UAB1]);	 //零压闭锁定值
	ptSet->bKG2_DP_DELTAF = ((WORD)psetbuf[CSTSET_DP_DELTAF_TT].ff==1 )?true:false;
	ptSet->dDP_DELTAF	=GetSetNormal(psetbuf[CSTSET_DP_DELTAF].ff,65536); //滑差，扩大了65536倍

#ifdef GD_AREA_ECZD_MEIZHOU_2021
	ptSet->bTT_JLlockCHZ = ((WORD)psetbuf[CSSET_JL_LOCK_CHZ].ff==1 )?true:false;	//解列闭锁重合闸
	ptSet->bTT_StartCHZ_judgeFreq = ((WORD)psetbuf[CSSET_START_CHZ_JUDGE_FREQ].ff==1 )?true:false;	//解列后启动重合闸判频率
	ptSet->bTT_StartCHZ_judgeVolt = ((WORD)psetbuf[CSSET_START_CHZ_JUDGE_VOLT].ff==1 )?true:false;	//解列后启动重合闸判电压
#endif

	{
		int ui_begin;
		ui_begin = UI_SW_INDEX_BEGIN(0);
		fKI  = (float)(g_ui[ui_begin + SW_AC_IA].m2_factor_k)/256.0; 
		fKI0= (float)(g_ui[ui_begin + SW_AC_I0].m2_factor_k)/256.0;	
		     			
 	}

	// 谐波
	{
		int i;
		float f;
		g_harmonic_num 		= (int)psetbuf[CSSET_HARMONIC_NUM].ff;
		f = psetbuf[CSSET_HARMONIC_FACTOR].ff/(CFG_ADC_DOTS_PER_PERIOD/2 - 2);
		for(i=1;i<(CFG_ADC_DOTS_PER_PERIOD/2); i++)
		{
			g_harmonic_factor[i] = 1.0 + f*(i-1);
		}

	}
	// 模拟量温度校正系数
	ptSet->f_temp_factor_ac = psetbuf[CSSET_TEMP_FACTOR_AC].ff;
	ptSet->f_temp_factor_dc = psetbuf[CSSET_TEMP_FACTOR_DC].ff;
	ptSet->bTT_RET_ZERO = ((WORD)psetbuf[CSTSET_RET_ZERO].ff==1 )?true:false; 		// 归零值投退	
 	ptSet->bTT_U0ZC= ((WORD)psetbuf[CSTSET_U0ZC_TT].ff==1 )?true:false; 		// 归零值投退	

 	ptSet->dT101Resend	= (DWORD)(psetbuf[CSSET_101RESEND_T].ff);      			// 101规约通道检查时间
	ptSet->dT101Check=(DWORD)(psetbuf[CSSET_IEC101].ff);							// 101规约通道检查时间	xj 2015.5.8
	ptSet->bTT_101Cot03	=((WORD)psetbuf[CSSET_101_COT03].ff==1 )?true:false;   		// 平衡101初始化结束传输原因03
	ptSet->bTT_104ChkAck=((WORD)psetbuf[CSSET_104_CHECK_ACK].ff==1 )?true:false;   	// 104检查确认序号
	ptSet->bTT_101FCB=((WORD)psetbuf[CSSET_101FCB].ff==1 )?true:false;   	// 101规约FCB不判断
	ptSet->bDIContinue	=((WORD)psetbuf[CSSET_DI_CONTINUE].ff==1 )?true:false;   	//  连续点号上送
	ptSet->bTT_SM2		=((WORD)psetbuf[CSSET_SM2_TT].ff==1 )?true:false;   		// 规约软件加密
	ptSet->bTT_ESAM		=((WORD)psetbuf[CSSET_SM2_TT].ff==2 )?true:false;   		// 规约硬件加密
	ptSet->bTT_RmtTest	=((WORD)psetbuf[CSSET_RMTTEST_TT].ff==1 )?true:false;   	// 远动测试模式
	ptSet->bTT_SoeResumeComm =((WORD)psetbuf[CSSET_SOE_RESUME_COMM].ff==1 )?true:false;   	// SOE通讯续传，通讯重连时上送未确认的SOE
	ptSet->bTT_SoeResumePower=((WORD)psetbuf[CSSET_SOE_RESUME_POWER].ff==1 )?true:false;   	// SOE上电续传
	ptSet->wEquTypeDFTU = ((WORD)psetbuf[CSSET_EQU_TYPE].ff==0 )?true:false;
	ptSet->f_yc_filter_factor = psetbuf[CSSET_YC_FILTER_FACTOR].ff;
#ifdef FIX_PARAM_FORMAT
	ptSet->bTT_Utf8=((WORD)psetbuf[CSSET_SET_ULF8].ff==1 )?true:false;		 
	ptSet->bTT_Unicode=((WORD)psetbuf[CSSET_SET_ULF8].ff==2 )?true:false;		 
#endif
	ptSet->wEquTypeManager = ((WORD)psetbuf[CSSET_EQU_TYPE].ff==1 )?true:false;
	ptSet->dGroupYxSize	=0;   					// 组召遥信分组大小
	ptSet->dGroupYcSize	=0;   					// 组召遥测分组大小

	// 瞬压检出
	ptSet->bTT_SY_Board=((WORD)psetbuf[CSTSET_SYBOARD_TT].ff==1 )?true:false;  			// 零压闭锁零流
	//ptSet->dT_XCY =	GetSetTIME(0.05);  //残压检出时间默认50毫秒
#ifdef GD_AREA_ECZD_2020//25V/30ms	
	ptSet->dT_XCY = GetSetTIME(0.02);  //残压检出时间默认20毫秒
#else
	ptSet->dT_XCY = GetSetTIME(0.03);  //残压检出时间默认30毫秒
#endif
	//goose 内部定值
	ptSet->dT_cd	=GetSetTIME(psetbuf[CSTSET_GOOSE_CD_T].ff);      				
	ptSet->dT_glfd	=GetSetTIME(psetbuf[CSTSET_GOOSE_GLFD_T].ff);      			
	ptSet->dT_llfd	=GetSetTIME(psetbuf[CSTSET_GOOSE_LLFD_T].ff);      			
	ptSet->dT_frobit	=GetSetTIME(psetbuf[CSTSET_GOOSE_FORBIT_T].ff);      		
	ptSet->dT_sendext	=GetSetTIME(psetbuf[CSTSET_GOOSE_SENDEXT_T].ff);      	
	ptSet->dT_goosecheck	=GetSetTIME(psetbuf[CSTSET_GOOSE_CHECK_T].ff);      	
	ptSet->bTT_fhkg_pub	=((WORD)psetbuf[CSTSET_GOOSE_FHKG_PUB].ff==1 )?true:false;   		// 负荷开关发送goose投退
	ptSet->dT_bs_lost	=GetSetTIME(psetbuf[CSTSET_SHORT_BS_LOST_T].ff);  
	ptSet->dT_ldjs =GetSetTIME(psetbuf[CSTSET_SHORT_LDJS_T].ff); 
	ptSet->bTT_bs_ykon	= ((WORD)psetbuf[CSTSET_BS_YKON_TT].ff==1 )?true:false; 
	ptSet->bTT_goose_send_after = (((WORD)psetbuf[CSTSET_GOOSE_SEND_FAULT].ff==1 )?true:false); // 
	// 录波
	g_wave_filetype = (int)psetbuf[CSTSET_WAVE_FILETYPE].ff; //录波文件格式
	g_rcd_type_enable[RECORD_TYPE_SD]	= 1;
	g_rcd_type_enable[RECORD_TYPE_QD] 	= 1;
	g_rcd_type_enable[RECORD_TYPE_GLGZ] = ((WORD)psetbuf[CSTSET_WAVE_GLGZ].ff==1 )?true:false;	
	g_rcd_type_enable[RECORD_TYPE_XLSY] = ((WORD)psetbuf[CSTSET_WAVE_XLSY].ff==1 )?true:false; 
	g_rcd_type_enable[RECORD_TYPE_LXDY] = ((WORD)psetbuf[CSTSET_WAVE_LXDY].ff==1 )?true:false; 
	g_rcd_type_enable[RECORD_TYPE_LXGL] = ((WORD)psetbuf[CSTSET_WAVE_LXGL].ff==1 )?true:false;
	g_rcd_type_enable[RECORD_TYPE_LLTB] = ((WORD)psetbuf[CSTSET_WAVE_LLTB].ff==1 )?true:false;  
	g_rcd_type_enable[RECORD_TYPE_CHZ]  = ((WORD)psetbuf[CSTSET_WAVE_CHZ].ff==1 )?true:false;  
#if defined FUN_JDXX ||defined XDL_ZT
	g_rcd_type_enable[RECORD_TYPE_XDLJD]  = ((WORD)psetbuf[SET_WAVE_XDLJD].ff==1 )?true:false;
#endif

	ptSet->dWCN_T		=GetSetTIME(psetbuf[CSTSET_WCNALARM_T].ff);      			// 未储能告警时间
	ptSet->dSDYX_T		=GetSetTIME(psetbuf[CSTSET_SD_YX_T].ff);      				// 失电闭锁遥信时间
	ptSet->bat_chargeok_time = psetbuf[CSTSET_CHARGEOK_TIME].ff;

	ptSet->bTT_HistoryFile = (((WORD)psetbuf[CSSET_HS_FILE_TT].ff==1 )?true:false); // 历史记录投退
	ptSet->wHSFileFormat =(WORD)psetbuf[CSSET_HS_FILE_FORMAT].ff;
	ptSet->bTT_MsgFile = (ptSet->wHSFileFormat==0 )?true:false; 
	ptSet->bTT_XmlFile = (ptSet->wHSFileFormat==1 )?true:false; 

	if(pRunSet->bTT_HistoryFile!=ptSet->bTT_HistoryFile)
	{
		histrory_file_set = true;
		
	}

	if(pRunSet->wHSFileFormat!=ptSet->wHSFileFormat)
	{
		b_hisfile_format = true;

	}
	
#ifdef GD_TEST_2021
	ptSet->resReuseFuncSelect = (BYTE)psetbuf[CSSET_RST_REUSE_FUNC].ff;
	ptSet->resReuseFuncFilterTime = (WORD)psetbuf[CSSET_RST_REUSE_FILTER_TIME].ff;
#else
	ptSet->bTT_RstUnlock= (((WORD)psetbuf[CSSET_RST_UNLOCK_TT].ff==1 )?true:false); // 复归按钮可解锁闭锁信号
#endif	
	ptSet->bTT_LogPrintf = (((WORD)psetbuf[CSSET_LOG_PRINTF_TT].ff==1 )?true:false); 
	ptSet->bTT_101Transsure= (((WORD)psetbuf[CSSET_101_TRANSSURE_TT].ff==1 )?true:false); 
	ptSet->dSmoothZero=(DWORD)(psetbuf[CSSET_ZERO].ff);							// 零漂值 
	ptSet->dwZL	=(DWORD)(psetbuf[CSSET_ZL].ff*65536);		      			// 直流判断
	ptSet->bTT_faultparaDKY= (((WORD)psetbuf[CSSET_FAULT_PARA_DKY].ff==1 )?true:false); 
	// 远动参数有效
	ptSet->bTT_RmtPara = (((WORD)psetbuf[CSSET_RMT_PARA_TT].ff==1 )?true:false); 

	if((WORD)psetbuf[CSSET_PT2_VOL].ff==1 )
		ptSet->pt2vol = PUB_AC_UBC2;
	else if((WORD)psetbuf[CSSET_PT2_VOL].ff==2 )
		ptSet->pt2vol = PUB_AC_UCA2;
	else
		ptSet->pt2vol	= PUB_AC_UAB2; 		

	ptSet->bTT_ShowOne = ((WORD)psetbuf[CSSET_DISP_ONE_TWO].ff==1 )?true:false; 
	ptSet->dDc_num =	(DWORD)(psetbuf[CSSET_SET_DC_NUM].ff);		// 直流通道数量 

	{//ptSet->bYX_AC：未投入定值时，以通道配置的判断为准；投入定值时，以定值为准
		ptSet->bYX_AC = gb_yx_ac;
	}

#ifdef YC_QUANTITY
	ptSet->dYC_num = (DWORD)(psetbuf[CSSET_YC_NUM].ff);		//每间隔遥参数量
#endif

#ifdef FA_PL_PJ
	ptSet->bTT_judgeFreq = ((WORD)psetbuf[CSSET_JUDGE_FREQ].ff==1 )?true:false; 	//有压判频率投退
#endif

	ptSet->bTT_UYYmin = ((WORD)psetbuf[CSSET_U_PJ].ff==0 )?true:false; 	//电压判据，取三相最小值时标志为1

#ifdef METERING_ENERGY	
	ptSet->dd_calc_mode  = (((WORD)psetbuf[CSSET_DD_CALC_MODE].ff==1 )?true:false); // 电度计算方式
	ptSet->wJLJX = (WORD)psetbuf[CSSET_JLJX].ff;
	ptSet->wWGFS = (WORD)psetbuf[CSSET_WGFS].ff;
#endif

	ptSet->bTT_EV_YCRate=((WORD)psetbuf[CSSET_SET_EV_YC_RATE].ff==1 )?true:false;
	ptSet->bTT_YC_DeadZone_All=((WORD)psetbuf[CSSET_SET_YC_DEAD_ZONE_ALL].ff==1 )?true:false;
	ptSet->bTT_CheckPhase=false;		//相序检查
	ptSet->bTT_CTYC=true;		//CT异常检查

#ifdef PUB_SET_SECTION	

	 /*先读取定值区0的公共定值*/
	if(!ReadPara((void*)psetbuf,EEP_PUB_ADDR,PUB_SET_NUMBER,&tPubSetTable[0]))
	{
		rt_err_set(ERR_CODE_SET_PUB,0);
		GetDefPara((void*)psetbuf,PUB_SET_NUMBER,&tPubSetTable[0]);
		rt_printf("%s(a):m_runsection=%d\r\n",__func__,m_runsection);
	}
	else
	{
		rt_err_clr(ERR_CODE_SET_PUB,0);
	}
	// 公共定值
	ptSet->section=(u8)psetbuf[SET_SECTION].ff;  			// 定值区

	 /*读取公共定值*/
	if(!ReadPara((void*)psetbuf,EEP_PUB_ADDR+ptSet->section*PUB_SETSIZE,PUB_SET_NUMBER,&tPubSetTable[0]))
	{
		rt_err_set(ERR_CODE_SET_PUB,0);
		GetDefPara((void*)psetbuf,PUB_SET_NUMBER,&tPubSetTable[0]);
		rt_printf("%s(b):m_runsection=%d\r\n",__func__,m_runsection);
	}
	else
	{
		rt_err_clr(ERR_CODE_SET_PUB,0);
	}

#else	
	 /*读取公共定值*/
	if(!ReadPara((void*)psetbuf,EEP_PUB_ADDR,PUB_SET_NUMBER,&tPubSetTable[0]))
	{
		rt_err_set(ERR_CODE_SET_PUB,0);
		GetDefPara((void*)psetbuf,PUB_SET_NUMBER,&tPubSetTable[0]);
	}
	else
	{
		rt_err_clr(ERR_CODE_SET_PUB,0);
	}
	// 公共定值
	ptSet->section=(u8)psetbuf[SET_SECTION].ff;  			// 定值区
#endif
	
	
	ptSet->ct_one=(u32)psetbuf[SET_BHCT1_A].ff;  			//保护CT一次值
	ptSet->ct_two=(u32)psetbuf[SET_BHCT2_A].ff;  			//保护CT一次值
	ptSet->ct0_one=(u32)psetbuf[SET_I0CT1_A].ff;  			//零序CT一次值
	ptSet->ct0_two=(u32)psetbuf[SET_I0CT2_A].ff;  			//零序CT一次值
	ptSet->ctm_one=(u32)psetbuf[SET_CLCT1_A].ff;  			//测量CT一次值
	ptSet->ctm_two=(u32)psetbuf[SET_CLCT2_A].ff;  			//测量CT一次值

	ptSet->pt1_two=(u32)psetbuf[SET_PT1_U].ff;  			//电源侧PT二次值
	ptSet->pt2_two=(u32)psetbuf[SET_PT2_U].ff;  			//负荷侧PT二次值
	ptSet->pt_3U0=(u32)psetbuf[SET_3U0_U].ff;  			    //零序电压额定值
	ptSet->a_side_pt_type=(u8)psetbuf[SET_PPT_TYPE].ff;     // A侧PT接线方式
	ptSet->b_side_pt_type=(u8)psetbuf[SET_LPT_TYPE].ff;     // B侧PT接线方式

	ptSet->pt_rate = 10;//10KV,一次值单位为KV

	for(i=0;i<8;i++)
	{
    #ifdef GD_AREA_SHANTOU
		ptSet->bTT_FDLGj[i] = ((WORD)psetbuf[SET_FDL1_TT+i].ff==0 )?true:false; 		// 
		ptSet->bTT_FDLTz[i] = ((WORD)psetbuf[SET_FDL1_TT+i].ff==1 )?true:false; 		// 
	#else
		ptSet->bTT_FDLGj[i] = ((WORD)psetbuf[SET_FDL1_TT+i].ff==1 )?true:false; 		// 
		ptSet->bTT_FDLTz[i] = ((WORD)psetbuf[SET_FDL1_TT+i].ff==2 )?true:false; 		// 
	#endif
		ptSet->dTFDL[i]=GetSetTIME(psetbuf[SET_FDL1_T+i].ff);  	// 
	}

#ifdef VOLT_ADAPTIVE_FACTOR
	ptSet->bTT_AdaptiveFactor = (((WORD)psetbuf[CSSET_BY1].ff==1)?true:false);	//投退自适应电压系数
#endif
#ifdef FUNC_SET_FA_JS
	ptSet->dT_FA_JS = GetSetTIME(psetbuf[CSSET_BY2].ff);	//FA合闸解锁时间
#endif
	ptSet->dT_tq_fh = GetSetTIME(psetbuf[CSSET_BY3].ff);//同期判断返回时间

	fUn=ptSet->pt1_two;  //额定电压
	fU0=ptSet->pt_3U0;  //额定零序电压

#ifdef FUNC_DRIVE
	ptSet->bTT_DRIVE = ((WORD)psetbuf[SET_DRIVE].ff==1)?true:false;	//不停电传动功能软压板
	fresh_set_soe(EV_DRIVE,ptSet->bTT_DRIVE,bFirst,0);
		for(sw=0;sw<SWITCH_NUM_MAX;sw++)
		{
			ptSet->tSwSet[sw].dT_Drive_hz    = GetSetTIME(psetbuf[SET_DRIVE_HZ_T].ff);
			ptSet->tSwSet[sw].dT_Drive_fz    = GetSetTIME(psetbuf[SET_DRIVE_FZ_T].ff);
			ptSet->tSwSet[sw].dT_fz_end    = GetSetTIME(psetbuf[SET_FZ_END_T].ff);
			ptSet->tSwSet[sw].dT_hz_end    = GetSetTIME(psetbuf[SET_HZ_END_T].ff);
		}
#endif

#if defined GD_AREA_ZHONGSHAN ||defined GD_AREA_ECZD_2020 || defined GD_AREA_ZHONGSHAN_2020//中山局将此定值放至公共定值
	for(sw=0;sw<SWITCH_NUM_MAX;sw++)
	{
		ptSet->tSwSet[sw].bTT_KZHL	   = (((WORD)psetbuf[SET_TT_KZHL].ff==1 )?true:false);//&ptSet->bFUN_TWCN;	//控制回路			
		#ifdef YF_TQ_JL_TY_PUBLIC
			ptSet->tSwSet[sw].bTT_BH_ALL_YB=(((WORD)psetbuf[SET_STOP_ALL].ff==0 )?true:false);	//停用压板
		#endif
	}
	
	#if defined GD_AREA_ECZD_2020 || defined GD_AREA_ZHONGSHAN_2020
		//软压板状态处理
		//ptSet->bTT_EDIT_YB = true;
		//ptSet->bTT_KZ_YB = true;
		ptSet->bTT_BH_YB= true;
		ptSet->bTT_SOFT_YK_YB = true;
		ptSet->bTT_SOFT_JZS_YB = false;
        ptSet->bTT_BH_YB=((WORD)psetbuf[SET_BH_YB].ff==0 )?true:false;
		#ifdef GD_AREA_ECZD_SHAOGUAN_2021
			fresh_set_soe(EV_TY_SOFT_YB,!ptSet->bTT_BH_YB,bFirst,0);
		#endif
		
		#ifdef defined GD_AREA_ZHONGSHAN_2020 || (defined GD_AREA_ECZD_2020 && !defined BH_FA_INONE_SW)
			ptSet->bTT_SOFT_BH_YB = ((WORD)psetbuf[SET_BH_YBTT].ff==1 )?true:false;
			ptSet->bTT_SOFT_FA_YB = ((WORD)psetbuf[SET_FA_YBTT].ff==1 )?true:false;
			ptSet->bTT_SOFT_GOOSE_YB = ((WORD)psetbuf[SET_GOOSE_YBTT].ff==1 )?true:false;
		#else
			#ifndef BH_FA_INONE_SW
			ptSet->bTT_SOFT_GOOSE_YB = true;
			ptSet->bTT_SOFT_FA_YB = true;
			ptSet->bTT_SOFT_BH_YB = true;
			#endif
		#endif
		#ifdef GD_AREA_ECZD_CHAOZHOU_2022
			ptSet->bTT_SOFT_BH_YB_PUB = ((WORD)psetbuf[SET_BH_YBTT].ff==1 )?true:false;
			ptSet->bTT_SOFT_FA_YB_PUB = ((WORD)psetbuf[SET_FA_YBTT].ff==1 )?true:false;
			ptSet->bTT_SOFT_GOOSE_YB_PUB = ((WORD)psetbuf[SET_GOOSE_YBTT].ff==1 )?true:false;
		#endif
		#if !defined GD_AREA_ECZD_MAOMING && !defined BH_FA_INONE_SW
			ptSet->bTT_EDIT_YB=((WORD)psetbuf[SET_EDIT_PAR_YB].ff==1 )?true:false;
		#endif
		ptSet->bTT_KZ_YB=((WORD)psetbuf[SET_KZ_OUT_YB].ff==1 )?true:false; 
        #ifdef YF_TQ_JL_TY_PUBLIC
            ptSet->bTT_TQ_YB =((WORD)psetbuf[SET_TQ_YB].ff==1 )?true:false;  //同期合闸软压板
        #else
            #ifdef FUNC_TQ_JL_PUBLIC
            ptSet->bTT_TQ_YB =((((WORD)psetbuf[SET_TQ_YB].ff==1 )?true:false) && (((WORD)psetbuf[SET_TQ_YB_PUB].ff==1 )?true:false));	 //！！！解列压板
            #else
            ptSet->bTT_TQ_YB =((WORD)psetbuf[SET_TQ_YB].ff==1 )?true:false;	 //同期合闸软压板
            #endif
        #endif
            
        #ifdef GD_AREA_ECZD_SHAOGUAN_2021
            fresh_set_soe(EV_TQ_SOFT_YB,!ptSet->bTT_TQ_YB,bFirst,0);
        #endif

        #ifdef YF_TQ_JL_TY_PUBLIC
            ptSet->bTT_JL_YB =((WORD)psetbuf[SET_JL_YB].ff==1 )?true:false;  //解列压板
        #else
            #ifdef FUNC_TQ_JL_PUBLIC
            ptSet->bTT_JL_YB =((((WORD)psetbuf[SET_JL_YB].ff==0 )?true:false) && (((WORD)psetbuf[SET_JL_YB_PUB].ff==1 )?true:false));	 //！！！解列压板(停用)
            #else
            ptSet->bTT_JL_YB =((WORD)psetbuf[SET_JL_YB].ff==0 )?true:false;	 //！！！解列压板(停用)
            #endif
        #endif
        #ifdef GD_AREA_ECZD_SHAOGUAN_2021
            fresh_set_soe(EV_JL_SOFT_YB,!ptSet->bTT_JL_YB,bFirst,0);
        #endif

		#ifdef YF_TQ_JL_TY_PUBLIC
			ptSet->bTT_EDIT_YB = ((WORD)psetbuf[SET_YF].ff==1 )?true:false; 							//远方投退软压板
		#endif

	#endif
#endif
	
	
	for(i=0;i<VOL_NUMBER;i++)
	{
		VOL_SET  *pvol=&ptSet->tVolSet[i];		//电压定值 含 过电压、低电压、电源有压，电源无压 U0告警
		
		float fKU1;

		if(i == VOL_GDY_Uab1||i == VOL_DDY_Uab1)
	  	{
	  		fKU1 = fKU[PUB_AC_UAB1];
	  	}
		else if(i == VOL_GDY_Ubc1||i == VOL_DDY_Ubc1)
		{
			fKU1 = fKU[PUB_AC_UBC1];
		}
		else if(i == VOL_GDY_Uca1||i == VOL_DDY_Uca1)
		{
			fKU1 = fKU[PUB_AC_UCA1];
		}
		else if(i == VOL_GDY_Uab2||i == VOL_DDY_Uab2)
	  	{
	  		fKU1 = fKU[PUB_AC_UAB2];
	  	}
		else if(i == VOL_GDY_Ubc2||i == VOL_DDY_Ubc2)
		{
			fKU1 = fKU[PUB_AC_UBC2];
		}
		else if(i == VOL_GDY_Uca2||i == VOL_DDY_Uca2)
		{
			fKU1 = fKU[PUB_AC_UCA2];
		}
	#ifdef GD_TEST_2021  // 计算PT1、PT2定值
		else if(i == VOL_YY_POW1 || i == VOL_WY_POW1 ){
			fKU1 = fKU[PUB_AC_US1];
		}else if(i == VOL_YY_POW2 || i == VOL_WY_POW2){
			fKU1 = fKU[PUB_AC_US2];
		}
	#endif	
		else
		{
			fKU1 = 0;
		}
		//线路电压鉴别
		if(i==VOL_YY_POW1||i==VOL_YY_POW2)
		  {	
			pvol->dUVol	= GetSetSQR(psetbuf[SET_YY_U].ff,fKU1);
			pvol->dUVol_fh = _Mul_Div_U(pvol->dUVol,96, 100);		//0.96=0.98*0.98
			pvol->dTVol=GetSetTIME(psetbuf[SET_YY_T].ff);
			pvol->bTT=((((WORD)psetbuf[SET_YY_TT].ff)==1)?true:false);	
		}

		if(i==VOL_WY_POW1||i==VOL_WY_POW2)
		  {	
			pvol->dUVol	= GetSetSQR(psetbuf[SET_WY_U].ff,fKU1);	
			pvol->dUVol_fh = _Mul_Div_U(pvol->dUVol,104, 100);		//  1.04=1.02*1.02
			pvol->dTVol=GetSetTIME(psetbuf[SET_YY_T].ff);
			pvol->bTT=((((WORD)psetbuf[SET_WY_TT].ff)==1)?true:false);	
		}
		//电压越限
		if(i==VOL_GDY_Uab1||i==VOL_GDY_Ubc1||i==VOL_GDY_Uca1
		  ||i==VOL_GDY_Uab2||i==VOL_GDY_Ubc2||i==VOL_GDY_Uca2)
		  {	
			pvol->dUVol	= GetSetSQR(psetbuf[SET_GDY_U].ff,fKU1);	
			pvol->dUVol_fh = _Mul_Div_U(pvol->dUVol,		96, 100);		//0.96=0.98*0.98
			pvol->dTVol=GetSetTIME(psetbuf[SET_GDY_T].ff);
			pvol->bTT=((((WORD)psetbuf[SET_GDY_TT].ff)==1)?true:false);	
		}

		if(i==VOL_DDY_Uab1||i==VOL_DDY_Ubc1||i==VOL_DDY_Uca1
		  ||i==VOL_DDY_Uab2||i==VOL_DDY_Ubc2||i==VOL_DDY_Uca2)
		  {	
			pvol->dUVol	= GetSetSQR(psetbuf[SET_DDY_U].ff,fKU1);	
			pvol->dUVol_fh = _Mul_Div_U(pvol->dUVol,		104, 100);		//  1.04=1.02*1.02
			pvol->dTVol=GetSetTIME(psetbuf[SET_DDY_T].ff);
			pvol->bTT=((((WORD)psetbuf[SET_DDY_TT].ff)==1)?true:false);	
		}
		if(i==VOL_DDY_DC1)
		{
		  pvol->dUVol = (DWORD)(psetbuf[SET_DC1GJ_U].ff*Q16_BASE);
		  pvol->dUVol_fh = pvol->dUVol*98/100; 
		  pvol->dTVol=GetSetTIME(psetbuf[SET_DC1GJ_T].ff);
		  pvol->bTT=((((WORD)psetbuf[SET_DC1GJ_TT].ff)==1)?true:false);   
		}
		  
		if(i==VOL_DDY_DC2)
		{
		  pvol->dUVol = (DWORD)(psetbuf[SET_DC2GJ_U].ff*Q16_BASE);
		  pvol->dUVol_fh = pvol->dUVol*98/100; 
		  pvol->dTVol=GetSetTIME(psetbuf[SET_DC2GJ_T].ff);
		  pvol->bTT=((((WORD)psetbuf[SET_DC2GJ_TT].ff)==1)?true:false);   
		}
	}
#ifdef	CUSTOMIZE_BZT //备自投	
	ptSet->tVolLostSet.dUVol	= GetSetSQR(psetbuf[SET_LOST_U].ff, fKU[PUB_AC_UAB1]);	
	ptSet->tVolLostSet.dUVol_fh = _Mul_Div_U(ptSet->tVolLostSet.dUVol, 96, 100);		//0.96=0.98*0.98
	ptSet->tVolLostSet.dTVol    = GetSetTIME(psetbuf[SET_LOST_T].ff);
	ptSet->tVolLostSet.bTT		= ((((WORD)psetbuf[SET_LOST_TT].ff)==1)?true:false);	
#endif	
	ptSet->wZDJG = 15;  //定点保存数据间隔，默认15秒
	ptSet->wDDJG =15;

#ifdef FUN_JDXX // 接地选线定值:系统接地方式
	tJDXX_val[0].jd_type = ((WORD)psetbuf[SET_JDTYPE].ff);			//系统接地方式
#endif

	//if(bFirst)
		m_runsection=ptSet->section;	 //第一次初始化，取公共定值终端运行区为整定区

	 /*读取开关定值*/
	if(!ReadPara((void*)psetbuf,EEP_SET_ADDR+m_runsection*SETSIZE,SW_SET_NUMBER,&tSwSetTable[0]))
	{
		rt_err_set(ERR_CODE_SET,0);
		GetDefPara((void*)psetbuf,SW_SET_NUMBER,&tSwSetTable[0]);
	}
	else
	{
		rt_err_clr(ERR_CODE_SET,0);
	}	

	
	//开关定值
	for(sw=0;sw<SWITCH_NUM_MAX;sw++)
	{
		int ui_begin;
		OC_SET *poc;
		ui_begin = UI_SW_INDEX_BEGIN(sw);
		fKI=(float)(g_ui[ui_begin + SW_AC_IA].m2_factor_k)/256.0; 	
		fKI0= (float)(g_ui[ui_begin + SW_AC_I0].m2_factor_k)/256.0;	

		fresh_sw_ac_set(psetbuf,sw);  //将定值刷新到测量值中

		// 过流类定值
		{
			poc= &ptSet->tSwSet[sw].toc[BH_GL1];
#if defined GD_AREA_ZHUHAI || defined GD_AREA_ZHUHAI_FTU || defined GD_AREA_CHAOZHOU	|| defined GD_AREA_MEIZHOU_FTU || defined GD_AREA_ZHONGSHAN_FTU ||defined GD_AREA_HEYUAN_KL || defined  GD_AREA_JIEYANG_FTU
			poc->bTz=(((WORD)psetbuf[SET_GL1_TT+sw*SW_SET_NUMBER ].ff==1 )?true:false)||(((WORD)psetbuf[SET_GL1_TT+sw*SW_SET_NUMBER ].ff==3 )?true:false); 
			poc->bGj= (((WORD)psetbuf[SET_GL1_TT+sw*SW_SET_NUMBER ].ff==2 )?true:false)||(((WORD)psetbuf[SET_GL1_TT+sw*SW_SET_NUMBER ].ff==3 )?true:false);
#elif defined GD_AREA_ZHUHAI_V2||defined GD_AREA_FOS_CHANCHENG || defined GD_AREA_MAIN_2020//珠海局要求告警+跳闸两个选项
			poc->bTz=(((WORD)psetbuf[SET_GL1_TT+sw*SW_SET_NUMBER ].ff==1 )?true:false);
			poc->bGj=(((WORD)psetbuf[SET_GL1_TT+sw*SW_SET_NUMBER ].ff==0 )?true:false);
#elif defined GD_AREA_SHANTOU
			poc->bTz=(((WORD)psetbuf[SET_GL1_TT+sw*SW_SET_NUMBER ].ff==1 )?true:false); 
			poc->bGj= (((WORD)psetbuf[SET_GL1_TT+sw*SW_SET_NUMBER ].ff==1 )?true:false)||(((WORD)psetbuf[SET_GL1_TT+sw*SW_SET_NUMBER ].ff==0 )?true:false);
#elif defined GD_AREA_ECZD_2020
			poc->bTz=(((WORD)psetbuf[SET_GL1_TT+sw*SW_SET_NUMBER ].ff==1 )?true:false); 
			poc->bGj=(((WORD)psetbuf[SET_GL1_TT+sw*SW_SET_NUMBER ].ff==0 )?true:false);
#elif defined GD_AREA_GUANGZHOU_FTU
			poc->bTz=(((WORD)psetbuf[SET_GL1_TT+sw*SW_SET_NUMBER ].ff==2 )?true:false); 
			poc->bGj= (((WORD)psetbuf[SET_GL1_TT+sw*SW_SET_NUMBER ].ff==2 )?true:false)||(((WORD)psetbuf[SET_GL1_TT+sw*SW_SET_NUMBER ].ff==1 )?true:false);
#else
			poc->bTz=(((WORD)psetbuf[SET_GL1_TT+sw*SW_SET_NUMBER ].ff==1 )?true:false);
			poc->bGj= (((WORD)psetbuf[SET_GL1_TT+sw*SW_SET_NUMBER ].ff==1 )?true:false);
#endif
			poc->bDir=(((WORD)psetbuf[SET_GL1_DIR+sw*SW_SET_NUMBER ].ff==1 )?true:false);
			poc->dT=GetSetTIME(psetbuf[SET_GL1_T+sw*SW_SET_NUMBER ].ff);
		#ifdef OCI_XB_0MS
			ptSet->tSwSet[sw].bTT_bh_xbbs=(((WORD)psetbuf[SET_BH_XBBS_TT+sw*SW_SET_NUMBER ].ff==1 )?true:false);// 谐波闭锁
			if((psetbuf[SET_GL1_T+sw*SW_SET_NUMBER].ff == 0) && (ptSet->tSwSet[sw].bTT_bh_xbbs))
			{
				poc->dT = GetSetTIME(0.026);
			}
		#endif
		
			poc->dI=GetSetSQR(psetbuf[SET_GL1_I+sw*SW_SET_NUMBER ].ff,fKI);		     			
			poc->dI_fh= _Mul_Div_U(poc->dI,	96, 100);		//0.96=0.98*0.98;        		//过流定值返回值

			poc = &ptSet->tSwSet[sw].toc[BH_GL2];
#if defined GD_AREA_ZHUHAI || defined GD_AREA_ZHUHAI_FTU || defined GD_AREA_CHAOZHOU	|| defined GD_AREA_MEIZHOU_FTU || defined GD_AREA_ZHONGSHAN_FTU ||defined GD_AREA_HEYUAN_KL || defined  GD_AREA_JIEYANG_FTU
			poc->bTz=(((WORD)psetbuf[SET_GL2_TT+sw*SW_SET_NUMBER ].ff==1 )?true:false)||(((WORD)psetbuf[SET_GL2_TT+sw*SW_SET_NUMBER ].ff==3 )?true:false);
			poc->bGj=(((WORD)psetbuf[SET_GL2_TT+sw*SW_SET_NUMBER ].ff==2 )?true:false)||(((WORD)psetbuf[SET_GL2_TT+sw*SW_SET_NUMBER ].ff==3 )?true:false);
#elif defined GD_AREA_ZHUHAI_V2||defined GD_AREA_FOS_CHANCHENG||defined GD_AREA_MAIN_2020//珠海局要求告警+跳闸两个选项
			poc->bTz=(((WORD)psetbuf[SET_GL2_TT+sw*SW_SET_NUMBER ].ff==1 )?true:false);
			poc->bGj=(((WORD)psetbuf[SET_GL2_TT+sw*SW_SET_NUMBER ].ff==0 )?true:false);
#elif defined GD_AREA_SHANTOU//广东标准2020要求告警+跳闸两个选项 跳闸包含跳闸和告警
			poc->bTz=(((WORD)psetbuf[SET_GL2_TT+sw*SW_SET_NUMBER ].ff==1 )?true:false); 
			poc->bGj= (((WORD)psetbuf[SET_GL2_TT+sw*SW_SET_NUMBER ].ff==1 )?true:false)||(((WORD)psetbuf[SET_GL2_TT+sw*SW_SET_NUMBER ].ff==0 )?true:false);
#elif defined GD_AREA_ECZD_2020//广东标准2020要求告警+跳闸两个选项 跳闸包含跳闸和告警
			poc->bTz=(((WORD)psetbuf[SET_GL2_TT+sw*SW_SET_NUMBER ].ff==1 )?true:false); 
			poc->bGj=(((WORD)psetbuf[SET_GL2_TT+sw*SW_SET_NUMBER ].ff==0 )?true:false);
#elif defined GD_AREA_GUANGZHOU_FTU
			poc->bTz=(((WORD)psetbuf[SET_GL2_TT+sw*SW_SET_NUMBER ].ff==2 )?true:false); 
			poc->bGj= (((WORD)psetbuf[SET_GL2_TT+sw*SW_SET_NUMBER ].ff==2 )?true:false)||(((WORD)psetbuf[SET_GL2_TT+sw*SW_SET_NUMBER ].ff==1 )?true:false);
#else
			poc->bTz=(((WORD)psetbuf[SET_GL2_TT+sw*SW_SET_NUMBER ].ff==1 )?true:false);		
			poc->bGj=(((WORD)psetbuf[SET_GL2_TT+sw*SW_SET_NUMBER ].ff==1 )?true:false);
#endif			
			poc->bDir=(((WORD)psetbuf[SET_GL2_DIR+sw*SW_SET_NUMBER ].ff==1 )?true:false); 			
			poc->dT=GetSetTIME(psetbuf[SET_GL2_T+sw*SW_SET_NUMBER ].ff);
			poc->dI=GetSetSQR(psetbuf[SET_GL2_I+sw*SW_SET_NUMBER ].ff,fKI);		     			
			poc->dI_fh= _Mul_Div_U(poc->dI,	96, 100);		//0.96=0.98*0.98;        		//过流2定值返回值

			poc = &ptSet->tSwSet[sw].toc[BH_DLBS];
			poc->bGj=(((WORD)psetbuf[SET_BH_DLBS_TT+sw*SW_SET_NUMBER ].ff==1 )?true:false); 
			poc->bTz=(((WORD)psetbuf[SET_BH_DLBS_TT+sw*SW_SET_NUMBER ].ff==1 )?true:false); 	
			poc->dI=GetSetSQR(psetbuf[SET_BH_DLBS_I+sw*SW_SET_NUMBER ].ff,fKI); 					
			poc->dI_fh= _Mul_Div_U(poc->dI, 96, 100); // 返回值

			poc = &ptSet->tSwSet[sw].toc[BH_GL3];
			poc->bTz  = false;
			poc->bGj  = false;
			poc->bDir = false;

		#if defined GD_AREA_ZHUHAI || defined GD_AREA_ZHUHAI_FTU || defined GD_AREA_CHAOZHOU || defined GD_AREA_MEIZHOU_FTU || defined GD_AREA_ZHONGSHAN_FTU ||defined GD_AREA_HEYUAN_KL || defined  GD_AREA_JIEYANG_FTU
			poc->bTz=(((WORD)psetbuf[SET_GL3_TT+sw*SW_SET_NUMBER ].ff==1 )?true:false)||(((WORD)psetbuf[SET_GL3_TT+sw*SW_SET_NUMBER ].ff==3 )?true:false); 
			poc->bGj=(((WORD)psetbuf[SET_GL3_TT+sw*SW_SET_NUMBER ].ff==2 )?true:false)||(((WORD)psetbuf[SET_GL3_TT+sw*SW_SET_NUMBER ].ff==3 )?true:false);	
		#elif defined GD_AREA_ECZD_SHAOGUAN_2021
		    poc->bTz=(((WORD)psetbuf[SET_GL3_TT+sw*SW_SET_NUMBER ].ff==1 )?true:false); 
			poc->bGj=(((WORD)psetbuf[SET_GL3_TT+sw*SW_SET_NUMBER ].ff==0 )?true:false);
		#else
			poc->bTz=(((WORD)psetbuf[SET_GL3_TT+sw*SW_SET_NUMBER ].ff==1 )?true:false); 
			poc->bGj=(((WORD)psetbuf[SET_GL3_TT+sw*SW_SET_NUMBER ].ff==1 )?true:false);
		#endif
			poc->bDir=(((WORD)psetbuf[SET_GL3_DIR+sw*SW_SET_NUMBER ].ff==1 )?true:false); 
		
			poc->dT=GetSetTIME(psetbuf[SET_GL3_T+sw*SW_SET_NUMBER ].ff);
			poc->dI=GetSetSQR(psetbuf[SET_GL3_I+sw*SW_SET_NUMBER ].ff,fKI);		     			
			poc->dI_fh= _Mul_Div_U(poc->dI,	96, 100);		//0.96=0.98*0.98;        		//过流2定值返回值

			poc = &ptSet->tSwSet[sw].toc[BH_GLJS];			//后加速，固定为过流1段定值
			poc->bTz=(((WORD)psetbuf[SET_GLJS_TT+sw*SW_SET_NUMBER ].ff==1 )?true:false); 
			poc->bDir=false;
			poc->bGj=false;
			poc->dT=GetSetTIME(psetbuf[SET_GLJS_T+sw*SW_SET_NUMBER ].ff);
			if(GetSetSQR(psetbuf[SET_GLJS_I+sw*SW_SET_NUMBER ].ff,fKI))
				poc->dI=GetSetSQR(psetbuf[SET_GLJS_I+sw*SW_SET_NUMBER ].ff,fKI);
			else
				poc->dI=GetSetSQR(psetbuf[SET_GL1_I+sw*SW_SET_NUMBER ].ff,fKI);
			
			poc->dI_fh= _Mul_Div_U(poc->dI,	96, 100);		//0.96=0.98*0.98;    
#ifdef DISP_SET_DLYX
			poc = &ptSet->tSwSet[sw].toc[BH_OVI_ZZ];
			poc->bGj=(((WORD)psetbuf[SET_DLZZ_TT+sw*SW_SET_NUMBER ].ff==1 )?true:false); 
			poc->bDir=false;
			poc->bTz=false;
			poc->dT=GetSetTIME(psetbuf[SET_DLZZ_T+sw*SW_SET_NUMBER ].ff);
			poc->dI=GetSetSQR(psetbuf[SET_DLZZ_I+sw*SW_SET_NUMBER ].ff,fKI);						
			poc->dI_fh= _Mul_Div_U(poc->dI, 96, 100);		//0.96=0.98*0.98;				//过流2定值返回值

			poc = &ptSet->tSwSet[sw].toc[BH_OVI_GZ];
			poc->bGj=(((WORD)psetbuf[SET_DLGZ_TT+sw*SW_SET_NUMBER ].ff==1 )?true:false); 
			poc->bDir=false;
			poc->bTz=false;
			poc->dT=GetSetTIME(psetbuf[SET_DLGZ_T+sw*SW_SET_NUMBER ].ff);
			poc->dI=GetSetSQR(psetbuf[SET_DLGZ_I+sw*SW_SET_NUMBER ].ff,fKI);		     			
			poc->dI_fh= _Mul_Div_U(poc->dI,	96, 100);		//0.96=0.98*0.98;        		//过流2定值返回值
#endif

			poc = &ptSet->tSwSet[sw].toc[BH_OVI];
			poc->bGj=(((WORD)psetbuf[SET_DLYX_TT+sw*SW_SET_NUMBER ].ff==1 )?true:false); 
			poc->bDir=false;
			poc->bTz=false;
			poc->dT=GetSetTIME(psetbuf[SET_DLYX_T+sw*SW_SET_NUMBER ].ff);
			poc->dI=GetSetSQR(psetbuf[SET_DLYX_I+sw*SW_SET_NUMBER ].ff,fKI);		     			
			poc->dI_fh= _Mul_Div_U(poc->dI,	96, 100);		//0.96=0.98*0.98;        		//过流2定值返回值

			poc= &ptSet->tSwSet[sw].toc[BH_LX1];
#if defined GD_AREA_ZHUHAI || defined GD_AREA_ZHUHAI_FTU || defined GD_AREA_CHAOZHOU || defined GD_AREA_MEIZHOU_FTU  || defined GD_AREA_ZHONGSHAN_FTU ||defined GD_AREA_HEYUAN_KL || defined  GD_AREA_JIEYANG_FTU
			poc->bTz=(((WORD)psetbuf[SET_LX1_TT+sw*SW_SET_NUMBER ].ff==1 )?true:false)||(((WORD)psetbuf[SET_LX1_TT+sw*SW_SET_NUMBER ].ff==3 )?true:false); 
			poc->bGj=(((WORD)psetbuf[SET_LX1_TT+sw*SW_SET_NUMBER ].ff==2 )?true:false)||(((WORD)psetbuf[SET_LX1_TT+sw*SW_SET_NUMBER ].ff==3 )?true:false); 
#elif defined GD_AREA_SHANTOU
			poc->bTz=(((WORD)psetbuf[SET_LX1_TT+sw*SW_SET_NUMBER ].ff==1 )?true:false); 
			poc->bGj= (((WORD)psetbuf[SET_LX1_TT+sw*SW_SET_NUMBER ].ff==1 )?true:false)||(((WORD)psetbuf[SET_LX1_TT+sw*SW_SET_NUMBER ].ff==0 )?true:false);
#elif defined GD_AREA_GUANGZHOU_FTU
			poc->bTz=(((WORD)psetbuf[SET_LX1_TT+sw*SW_SET_NUMBER ].ff==2 )?true:false); 
			poc->bGj= (((WORD)psetbuf[SET_LX1_TT+sw*SW_SET_NUMBER ].ff==2 )?true:false)||(((WORD)psetbuf[SET_LX1_TT+sw*SW_SET_NUMBER ].ff==1 )?true:false);
#else			
			poc->bTz=(((WORD)psetbuf[SET_LX1_TT+sw*SW_SET_NUMBER ].ff==1 )?true:false); 
			poc->bGj=(((WORD)psetbuf[SET_LX1_TT+sw*SW_SET_NUMBER ].ff==0 )?true:false); 
#endif	
			poc->bDir=false;
			poc->dT=GetSetTIME(psetbuf[SET_LX1_T+sw*SW_SET_NUMBER ].ff);
			poc->dI=GetSetSQR(psetbuf[SET_LX1_I+sw*SW_SET_NUMBER ].ff,fKI0);		     			
			poc->dI_fh= _Mul_Div_U(poc->dI,	96, 100);		//0.96=0.98*0.98;        
			
			poc= &ptSet->tSwSet[sw].toc[BH_LX2];
#if defined GD_AREA_ZHUHAI || defined GD_AREA_ZHUHAI_FTU || defined GD_AREA_CHAOZHOU || defined GD_AREA_MEIZHOU_FTU || defined GD_AREA_ZHONGSHAN_FTU ||defined GD_AREA_HEYUAN_KL || defined  GD_AREA_JIEYANG_FTU
			poc->bTz=(((WORD)psetbuf[SET_LX2_TT+sw*SW_SET_NUMBER ].ff==1 )?true:false)||(((WORD)psetbuf[SET_LX2_TT+sw*SW_SET_NUMBER ].ff==3 )?true:false); 
			poc->bGj=(((WORD)psetbuf[SET_LX2_TT+sw*SW_SET_NUMBER ].ff==2 )?true:false)||(((WORD)psetbuf[SET_LX2_TT+sw*SW_SET_NUMBER ].ff==3 )?true:false);  
#elif defined GD_AREA_SHANTOU
			poc->bTz=(((WORD)psetbuf[SET_LX2_TT+sw*SW_SET_NUMBER ].ff==1 )?true:false); 
			poc->bGj= (((WORD)psetbuf[SET_LX2_TT+sw*SW_SET_NUMBER ].ff==1 )?true:false)||(((WORD)psetbuf[SET_LX2_TT+sw*SW_SET_NUMBER ].ff==0 )?true:false);
#elif defined GD_AREA_GUANGZHOU_FTU
			poc->bTz=(((WORD)psetbuf[SET_LX2_TT+sw*SW_SET_NUMBER ].ff==2 )?true:false); 
			poc->bGj= (((WORD)psetbuf[SET_LX2_TT+sw*SW_SET_NUMBER ].ff==2 )?true:false)||(((WORD)psetbuf[SET_LX2_TT+sw*SW_SET_NUMBER ].ff==1 )?true:false);
#else
			poc->bTz=(((WORD)psetbuf[SET_LX2_TT+sw*SW_SET_NUMBER ].ff==1 )?true:false); 
			poc->bGj=(((WORD)psetbuf[SET_LX2_TT+sw*SW_SET_NUMBER ].ff==0 )?true:false);  
#endif	 
			poc->bDir=false;
			poc->dT=GetSetTIME(psetbuf[SET_LX2_T+sw*SW_SET_NUMBER ].ff);
			poc->dI=GetSetSQR(psetbuf[SET_LX2_I+sw*SW_SET_NUMBER ].ff,fKI0);		     			
			poc->dI_fh= _Mul_Div_U(poc->dI,	96, 100);		//0.96=0.98*0.98;        		
#ifdef DISP_SET_LX3	
			poc= &ptSet->tSwSet[sw].toc[BH_LX3];
		#ifdef GD_TEST_2021
			poc->bTz = (((WORD)psetbuf[SET_LX3_TT+sw*SW_SET_NUMBER ].ff==1 )?true:false)||(((WORD)psetbuf[SET_LX3_TT+sw*SW_SET_NUMBER ].ff==3 )?true:false); 
			poc->bGj = (((WORD)psetbuf[SET_LX3_TT+sw*SW_SET_NUMBER ].ff==2 )?true:false)||(((WORD)psetbuf[SET_LX3_TT+sw*SW_SET_NUMBER ].ff==3 )?true:false);  
		#else	
			poc->bTz=(((WORD)psetbuf[SET_LX3_TT+sw*SW_SET_NUMBER ].ff==1 )?true:false); 
			poc->bGj=(((WORD)psetbuf[SET_LX3_TT+sw*SW_SET_NUMBER ].ff==0 )?true:false);  
		#endif
			poc->bDir=false;
			poc->dT=GetSetTIME(psetbuf[SET_LX3_T+sw*SW_SET_NUMBER ].ff);
			poc->dI=GetSetSQR(psetbuf[SET_LX3_I+sw*SW_SET_NUMBER ].ff,fKI0);		     			
			poc->dI_fh= _Mul_Div_U(poc->dI,	96, 100);		//0.96=0.98*0.98;   
#endif

			poc = &ptSet->tSwSet[sw].toc[BH_LXJS];
            poc->bTz=(((WORD)psetbuf[SET_GLJS_TT+sw*SW_SET_NUMBER ].ff==1 )?true:false); 
			poc->bGj=false;
			poc->bDir=false;
			poc->dT=GetSetTIME(psetbuf[SET_LXJS_T+sw*SW_SET_NUMBER ].ff);
			if(GetSetSQR(psetbuf[SET_LXJS_I+sw*SW_SET_NUMBER ].ff,fKI0))
				poc->dI=GetSetSQR(psetbuf[SET_LXJS_I+sw*SW_SET_NUMBER ].ff,fKI0);
			else
				poc->dI=GetSetSQR(psetbuf[SET_LX1_I+sw*SW_SET_NUMBER ].ff,fKI0);
			poc->dI_fh= _Mul_Div_U(poc->dI,	96, 100);		//0.96=0.98*0.98;  

			poc = &ptSet->tSwSet[sw].toc[BH_OVI0];
			poc->bGj=(((WORD)psetbuf[SET_LXYX_TT+sw*SW_SET_NUMBER ].ff==1 )?true:false); 
			poc->bDir=false;
			poc->bTz=false;
			poc->dT=GetSetTIME(psetbuf[SET_LXYX_T+sw*SW_SET_NUMBER ].ff);
			poc->dI=GetSetSQR(psetbuf[SET_LXYX_I+sw*SW_SET_NUMBER ].ff,fKI0);		     			
			poc->dI_fh= _Mul_Div_U(poc->dI,	96, 100);		//0.96=0.98*0.98;        		//过流2定值返回值

			}
		//智能分布式定值
		{
			GOC_SET *poc = &ptSet->tSwSet[sw].tGocSet;	
			poc->bKg_mainloop=false;

            //#ifdef GD_AREA_ECZD_2020
#if defined GD_AREA_ECZD_2020 || defined GD_AREA_MAIN_2020
            poc->bTT_gooseFA=true; // 默认智能分布式投入
            ptSet->tSwSet[sw].bTT_goose_xbbs    = false;
            poc->bTT_DIR=false; // 合环运行

            poc->bFA_slow=(((WORD)psetbuf[SET_GOOSE_FA_TYPE+sw*SW_SET_NUMBER ].ff==1 )?true:false);   // 速动/缓动
//#if defined GD_AREA_ZHONGSHAN || defined GD_AREA_ZHONGSHAN_2020   //中山要求联络开关固定
//#if defined GD_AREA_ZHONGSHAN || defined GD_AREA_ZHONGSHAN_2020 || defined GD_AREA_MAIN_2020  //中山要求联络开关固定
#if defined GD_AREA_ZHONGSHAN || defined GD_AREA_MAIN_2020  //中山要求联络开关固定
            poc->bsw_sd=(((WORD)psetbuf[SET_GOOSE_FTU_TYPE+sw*SW_SET_NUMBER ].ff==0 )?true:false);    // 首端
            poc->bsw_fz=(((WORD)psetbuf[SET_GOOSE_FTU_TYPE+sw*SW_SET_NUMBER ].ff==2 )?true:false);    // 末端
            poc->bsw_ll=(((WORD)psetbuf[SET_GOOSE_FTU_TYPE+sw*SW_SET_NUMBER ].ff==3 )?true:false);    // 联络
#else
			poc->bsw_sd=(((WORD)psetbuf[SET_GOOSE_FTU_TYPE+sw*SW_SET_NUMBER ].ff==1 )?true:false);	  // 首端
			poc->bsw_fz=(((WORD)psetbuf[SET_GOOSE_FTU_TYPE+sw*SW_SET_NUMBER ].ff==2 )?true:false);	  // 末端			
			poc->bsw_ll=false;	  // 非中山局，联络开关不固定
#endif
			
			poc->dIgl=GetSetSQR(psetbuf[SET_GOOSET_GL_I+sw*SW_SET_NUMBER ].ff,fKI);		     			//过流定值
			poc->dIgl_fh= _Mul_Div_U(poc->dIgl,	96, 100);		//0.96=0.98*0.98;        		        //过流定值返回值
			poc->dTgl=GetSetTIME(psetbuf[SET_GOOSET_GL_T+sw*SW_SET_NUMBER ].ff);

			

			poc->dIlx=GetSetSQR(psetbuf[SET_GOOSET_LX_I+sw*SW_SET_NUMBER ].ff,fKI0);		     		//零序定值
			poc->dIlx_fh= _Mul_Div_U(poc->dIlx,	96, 100);		//0.96=0.98*0.98;        		        //零序定值返回值
			poc->dTlx=GetSetTIME(psetbuf[SET_GOOSET_GL_T+sw*SW_SET_NUMBER ].ff);	//2020指导意见默认只有一个时限,共用 "故障跳闸时限"

            //#ifdef GD_AREA_ZHONGSHAN_2020
#if defined GD_AREA_ZHONGSHAN_2020 || defined GD_AREA_MAIN_2020
            poc->dIgl2=GetSetSQR(psetbuf[SET_GOOSET_GL2_I+sw*SW_SET_NUMBER ].ff,fKI);                   //过流2定值
            poc->dIgl2_fh= _Mul_Div_U(poc->dIgl2,   96, 100);       //0.96=0.98*0.98;                   //过流2定值返回值
            poc->dTgl2=GetSetTIME(psetbuf[SET_GOOSET_GL2_T+sw*SW_SET_NUMBER ].ff);
            poc->dTlx=GetSetTIME(psetbuf[SET_GOOSET_LX_T+sw*SW_SET_NUMBER ].ff);            //中山分开零序延时
            poc->bKg_mainloop=(((WORD)psetbuf[SET_GOOSE_KG_TYPE+sw*SW_SET_NUMBER ].ff==0 )?true:false); // 主环开关
            poc->dTgzgl=GetSetTIME(psetbuf[SET_GOOSET_GZGL_T+sw*SW_SET_NUMBER ].ff);  //故障隔离时间
#endif

			poc->dTsdlost=GetSetTIME(psetbuf[SET_GOOSET_SDLOST_T+sw*SW_SET_NUMBER ].ff);                //首端失压时间
			poc->bTT_sdlost=(((WORD)psetbuf[SET_GOOSE_SDLOSTVOL_TT+sw*SW_SET_NUMBER ].ff==1 )?true:false); // 首端失压分闸

		 	poc->bTT_ll=(((WORD)psetbuf[SET_GOOSE_LL_TT+sw*SW_SET_NUMBER ].ff==1 )?true:false); // 联络合闸
			poc->dTll=GetSetTIME(psetbuf[SET_GOOSET_LL_T+sw*SW_SET_NUMBER ].ff);  //联络合闸时间
			// poc->bTT_DIR=(((WORD)psetbuf[SET_GOOSET_DIR_TT+sw*SW_SET_NUMBER ].ff==1 )?true:false); // 合环运行
			// poc->bTT_mxTfz=(((WORD)psetbuf[SET_GOOSET_MXTFZ_TT+sw*SW_SET_NUMBER ].ff==1 )?true:false); // 母线故障跳分支

			
		#else
			 poc->bTT_gooseFA=(((WORD)psetbuf[SET_GOOSE_FA_TT+sw*SW_SET_NUMBER ].ff==1 )?true:false); // 智能分布式投退
			 poc->bFA_slow=(((WORD)psetbuf[SET_GOOSE_FA_TYPE+sw*SW_SET_NUMBER ].ff==1 )?true:false);   // 速动/缓动
			 poc->bsw_sd=(((WORD)psetbuf[SET_GOOSE_FTU_TYPE+sw*SW_SET_NUMBER ].ff==0 )?true:false);    // 首端
			 poc->bsw_fz=(((WORD)psetbuf[SET_GOOSE_FTU_TYPE+sw*SW_SET_NUMBER ].ff==2 )?true:false);    // 末端
			 poc->bsw_ll=(((WORD)psetbuf[SET_GOOSE_FTU_TYPE+sw*SW_SET_NUMBER ].ff==3 )?true:false);    // 联络			 

			poc->dIgl=GetSetSQR(psetbuf[SET_GOOSET_GL_I+sw*SW_SET_NUMBER ].ff,fKI);		     			//过流定值
			poc->dIgl_fh= _Mul_Div_U(poc->dIgl,	96, 100);		//0.96=0.98*0.98;        		        //过流定值返回值
			poc->dTgl=GetSetTIME(psetbuf[SET_GOOSET_GL_T+sw*SW_SET_NUMBER ].ff);
			#ifdef GD_AREA_ZHONGSHAN 
				poc->dIgl2=GetSetSQR(psetbuf[SET_GOOSET_GL2_I+sw*SW_SET_NUMBER ].ff,fKI);		     		//过流2定值
				poc->dIgl2_fh= _Mul_Div_U(poc->dIgl2,	96, 100);		//0.96=0.98*0.98;        		    //过流2定值返回值
				poc->dTgl2=GetSetTIME(psetbuf[SET_GOOSET_GL2_T+sw*SW_SET_NUMBER ].ff);
			#endif		


			poc->dIlx=GetSetSQR(psetbuf[SET_GOOSET_LX_I+sw*SW_SET_NUMBER ].ff,fKI0);		     		//零序定值
			poc->dIlx_fh= _Mul_Div_U(poc->dIlx,	96, 100);		//0.96=0.98*0.98;        		        //零序定值返回值
			poc->dTlx=GetSetTIME(psetbuf[SET_GOOSET_LX_T+sw*SW_SET_NUMBER ].ff);

			poc->dTsdlost=GetSetTIME(psetbuf[SET_GOOSET_SDLOST_T+sw*SW_SET_NUMBER ].ff);                //首端失压时间
			 poc->bTT_sdlost=(((WORD)psetbuf[SET_GOOSE_SDLOSTVOL_TT+sw*SW_SET_NUMBER ].ff==1 )?true:false); // 首端失压分闸

			poc->dTgzgl=GetSetTIME(psetbuf[SET_GOOSET_GZGL_T+sw*SW_SET_NUMBER ].ff);  //故障隔离时间
		 	poc->bTT_ll=(((WORD)psetbuf[SET_GOOSE_LL_TT+sw*SW_SET_NUMBER ].ff==1 )?true:false); // 联络合闸
			poc->dTll=GetSetTIME(psetbuf[SET_GOOSET_LL_T+sw*SW_SET_NUMBER ].ff);  //联络合闸时间
			 poc->bTT_DIR=(((WORD)psetbuf[SET_GOOSET_DIR_TT+sw*SW_SET_NUMBER ].ff==1 )?true:false); // 合环运行
			 poc->bTT_mxTfz=(((WORD)psetbuf[SET_GOOSET_MXTFZ_TT+sw*SW_SET_NUMBER ].ff==1 )?true:false); // 母线故障跳分支

			ptSet->tSwSet[sw].d_goose_xbcoe=GetSetSQR(psetbuf[SET_GOOSE_XBCOE+sw*SW_SET_NUMBER ].ff/100,256);		
			ptSet->tSwSet[sw].bTT_goose_xbbs	= ((DWORD)psetbuf[SET_GOOSE_XBBS_TT+sw*SW_SET_NUMBER ].ff==1)?true:false; 

			#ifdef GOOSE_NETTYPE_SET 
				g_goose_net_type=(WORD)psetbuf[SET_GOOSE_NET_TYPE].ff;
            #endif

		#endif
		}

		// 重合闸
		{
			bool bch1,bch2,bch3;
			bch1	=(((WORD)psetbuf[SET_CH1_TT+sw*SW_SET_NUMBER ].ff==1 )?true:false); // 一次重合闸
			bch2	=(((WORD)psetbuf[SET_CH2_TT+sw*SW_SET_NUMBER ].ff==1 )?true:false);// 二次重合闸
			bch3	=false;
		#ifdef DISP_SET_CH_T3
			bch3	=(((WORD)psetbuf[SET_CH3_TT+sw*SW_SET_NUMBER ].ff==1 )?true:false);// 多次重合闸
		#endif
			ptSet->tSwSet[sw].bTT_CHZ=bch1||bch2||bch3;
			ptSet->tSwSet[sw].bTT_chz_tq=(((WORD)psetbuf[SET_CH_TQ+sw*SW_SET_NUMBER ].ff==1 )?true:false);// 同期重合闸
		#ifdef CHZ_JWY_LM
			ptSet->tSwSet[sw].bTT_chz_mwy=(((WORD)psetbuf[SET_CH_MWY+sw*SW_SET_NUMBER].ff==1 )?true:false); // 检母线无压
			ptSet->tSwSet[sw].bTT_chz_lwy=(((WORD)psetbuf[SET_CH_XWY+sw*SW_SET_NUMBER].ff==1 )?true:false); // 检线路无压	
		#else	
			ptSet->tSwSet[sw].bTT_chz_wy=(((WORD)psetbuf[SET_CH_WY+sw*SW_SET_NUMBER].ff==1 )?true:false);//无压重合闸
		#endif	

		#ifdef GD_TEST_2021
			ptSet->tSwSet[sw].bTT_TTCH_TT = (((WORD)psetbuf[SET_TTCH_TT+sw*SW_SET_NUMBER].ff==1)?true:false); // 偷跳启动重合
		#endif	

			ptSet->tSwSet[sw].dT_chz[0]	= GetSetTIME(psetbuf[SET_CH_T1+sw*SW_SET_NUMBER ].ff);
			ptSet->tSwSet[sw].dT_chz[1]	= GetSetTIME(psetbuf[SET_CH_T2+sw*SW_SET_NUMBER ].ff);
			ptSet->tSwSet[sw].dT_chz[2] =0;
			ptSet->tSwSet[sw].dT_ch_gl_tt  = (((WORD)psetbuf[SET_CH_GL_TT+sw*SW_SET_NUMBER ].ff==1 )?true:false);
			ptSet->tSwSet[sw].dT_ch_jd_tt  = (((WORD)psetbuf[SET_CH_JD_TT+sw*SW_SET_NUMBER ].ff==1 )?true:false);

		#ifdef DISP_SET_CH_T3
			ptSet->tSwSet[sw].dT_chz[2]	= GetSetTIME(psetbuf[SET_CH_T3+sw*SW_SET_NUMBER ].ff);
		#endif
		#ifdef DISP_CHZOKCHR_2_SW
			ptSet->tSwSet[sw].dT_chz_cd	= GetSetTIME(psetbuf[SET_CHZCD_2+sw*SW_SET_NUMBER].ff);
			ptSet->tSwSet[sw].dT_chz_ok	= GetSetTIME(psetbuf[SET_CHZ_OK+sw*SW_SET_NUMBER].ff);
		#else
			#ifdef FUNC_CHZ_CHARGE_TIME
				ptSet->tSwSet[sw].dT_chz_cd	= GetSetTIME(psetbuf[SET_CHZCD+sw*SW_SET_NUMBER].ff);	//重合闸充电时间
			#else
			    ptSet->tSwSet[sw].dT_chz_cd=(bch2||bch3)?ptSet->dT_chzcd_2:T_1s*15;   // 投一次重合闸，充电时间15秒，投二次重合闸，充电180秒
		    #endif
		#endif
		
			ptSet->tSwSet[sw].dT_chz_bs	= GetSetTIME(psetbuf[SET_CHBS_T+sw*SW_SET_NUMBER ].ff);
			#ifdef GD_AREA_HUIZHOU_DAYAWAN //大亚湾在重合确认时间为0的时候，强制设置为充电时间 2020-9-16 
				if(ptSet->tSwSet[sw].dT_chz_ok==0)
					ptSet->tSwSet[sw].dT_chz_ok =ptSet->tSwSet[sw].dT_chz_cd;
			#else
				ptSet->tSwSet[sw].dT_chz_ok	= (bch2||bch3)?ptSet->tSwSet[sw].dT_chz_ok:T_1s*15;//只投一次重合闸的时候，重合闸确认时间强制为15S 2020-7-25
			#endif
			if(bch3)ptSet->tSwSet[sw].d_chz_times=3;
			else if(bch2)ptSet->tSwSet[sw].d_chz_times=2;
			else ptSet->tSwSet[sw].d_chz_times=1;
						
			 ptSet->tSwSet[sw].dU_chz_deltaU=GetSetNormal(0.2*fUn,fKU[PUB_AC_UAB1]);	 // 0.2 倍的额定值
			 ptSet->tSwSet[sw].dA_chz_deltaAng=GetSetNormal(30,65536);	 // 30度压差
			 ptSet->tSwSet[sw].dU_chz_wy=GetSetSQR(0.4*fUn,fKU[PUB_AC_UAB1]);	 // 0.4 倍的额定值
		#ifdef FUNC_TQ_YY
			 ptSet->tSwSet[sw].dU_chz_yy=GetSetSQR(0.8*fUn,fKU[PUB_AC_UAB1]);	 // 0.8 倍的额定值
		#else
			 ptSet->tSwSet[sw].dU_chz_yy=GetSetSQR(0.5*fUn,fKU[PUB_AC_UAB1]);	 // 0.5 倍的额定值
		#endif
		}

		//反时限定值
		{
			ptSet->tSwSet[sw].bTT_FSX=(((WORD)psetbuf[SET_FSX_TT+sw*SW_SET_NUMBER ].ff==1 )?true:false);// 反时限投退
			ptSet->tSwSet[sw].dIglfsx	=GetSetNormal(psetbuf[SET_FSX_I+sw*SW_SET_NUMBER].ff,fKI);   //反时限基准值
			ptSet->tSwSet[sw].dTglfsx	= GetSetTIME(psetbuf[SET_FSX_Tp+sw*SW_SET_NUMBER].ff);
			ptSet->tSwSet[sw].wFsxType	=(WORD)psetbuf[SET_FSX_TYPE+sw*SW_SET_NUMBER].ff;
			ptSet->tSwSet[sw].dIglfsx098 = _Mul_Div_U(ptSet->tSwSet[sw].dIglfsx,  96, 100);			//反时限过流*0.96		
			ptSet->tSwSet[sw].dIglfsx105 = _Mul_Div_U(ptSet->tSwSet[sw].dIglfsx,  105,100);			//反时限过流*1.05*1.05	
			ptSet->tSwSet[sw].dRVS_MIN_T	=GetSetTIME(0.025);        //反时限最短时间
			ptSet->tSwSet[sw].dRVS_MAX_T	=GetSetTIME(9999);        //反时限最长时间
		
		}

#ifdef INRUSH_CURRENT_IN_DECIMALS
		ptSet->tSwSet[sw].d_bh_xbcoe=GetSetSQR(psetbuf[SET_BH_XBCOE+sw*SW_SET_NUMBER ].ff,256);	
#else
	#if defined CPU_AM335X
		if(psetbuf[SET_BH_XBCOE+sw*SW_SET_NUMBER ].ff <= 1)
		{
			ptSet->tSwSet[sw].d_bh_xbcoe=GetSetSQR(psetbuf[SET_BH_XBCOE+sw*SW_SET_NUMBER ].ff/100,256); 
		}
		else
		{
			ptSet->tSwSet[sw].d_bh_xbcoe=GetSetSQR((psetbuf[SET_BH_XBCOE+sw*SW_SET_NUMBER ].ff/100-0.01),256);
		}
	#elif defined CPU_FUXI
		if(psetbuf[SET_BH_XBCOE+sw*SW_SET_NUMBER ].ff <= 1)
		{
			ptSet->tSwSet[sw].d_bh_xbcoe=GetSetSQR(psetbuf[SET_BH_XBCOE+sw*SW_SET_NUMBER ].ff/100,256);	
		}
		else
		{
			ptSet->tSwSet[sw].d_bh_xbcoe=GetSetSQR((psetbuf[SET_BH_XBCOE+sw*SW_SET_NUMBER ].ff/100-0.01),256);	
		}	
	#else
		ptSet->tSwSet[sw].d_bh_xbcoe=GetSetSQR(psetbuf[SET_BH_XBCOE+sw*SW_SET_NUMBER ].ff/100,256);	
	#endif
#endif
        ptSet->tSwSet[sw].bTT_bh_ptdx=(((WORD)psetbuf[SET_BH_PTDX+sw*SW_SET_NUMBER ].ff==1 )?true:false);// PT断线检查
        ptSet->tSwSet[sw].bTT_bh_xbbs=(((WORD)psetbuf[SET_BH_XBBS_TT+sw*SW_SET_NUMBER ].ff==1 )?true:false);// 谐波闭锁
        //同期
        {
            ptSet->tSwSet[sw].dU_tq_deltaU  = GetSetNormal(psetbuf[SET_TQ_U+sw*SW_SET_NUMBER ].ff*fUn/100,fKU[PUB_AC_UAB1]);
            ptSet->tSwSet[sw].dA_tq_delatA  = GetSetNormal(psetbuf[SET_TQ_ANG+sw*SW_SET_NUMBER ].ff,65536);
            ptSet->tSwSet[sw].dF_tq_deltaF  = GetSetNormal(psetbuf[SET_TQ_F+sw*SW_SET_NUMBER ].ff,65536);
            ptSet->tSwSet[sw].dT_tq     = GetSetTIME(1.0);//同期默认时间1秒
        }
        //电压解列
        {
            ptSet->tSwSet[sw].bTT_jl_dy=(((WORD)psetbuf[SET_VOLJL_TT+sw*SW_SET_NUMBER ].ff==1 )?true:false);
            ptSet->tSwSet[sw].dT_jl_gddy        = GetSetTIME(psetbuf[SET_GDYJL_T+sw*SW_SET_NUMBER ].ff); //过低电压
            ptSet->tSwSet[sw].dT_jl_ddy     = GetSetTIME(psetbuf[SET_DYJL_T+sw*SW_SET_NUMBER ].ff);//低电压
            ptSet->tSwSet[sw].dT_jl_gdy     = GetSetTIME(psetbuf[SET_GYJL_T+sw*SW_SET_NUMBER ].ff);//高电压
            ptSet->tSwSet[sw].dT_jl_ggdy        = GetSetTIME(0.2); //过高电压

			ptSet->tSwSet[sw].dU_jl_gdy=GetSetSQR(psetbuf[SET_GYJL_U+sw*SW_SET_NUMBER ].ff*fUn/100,fKU[PUB_AC_UAB1]);	 // 0.4 倍的额定值
			ptSet->tSwSet[sw].dU_jl_ddy=GetSetSQR(psetbuf[SET_DYJL_U+sw*SW_SET_NUMBER ].ff*fUn/100,fKU[PUB_AC_UAB1]);	 // 0.4 倍的额定值

			ptSet->tSwSet[sw].dU_jl_ggdy=GetSetSQR(1.35*fUn,fKU[PUB_AC_UAB1]);	 // 1.35 倍的额定值
			ptSet->tSwSet[sw].dU_jl_gddy=GetSetSQR(psetbuf[SET_GDYJL_U+sw*SW_SET_NUMBER ].ff*fUn/100,fKU[PUB_AC_UAB1]);	 // 0.5 倍的额定值
			ptSet->tSwSet[sw].dU_jl_gddy_fh= _Mul_Div_U(ptSet->tSwSet[sw].dU_jl_gddy,	104,100);	// 1.02的返回值
			ptSet->tSwSet[sw].dU_jl_ddy_fh= _Mul_Div_U(ptSet->tSwSet[sw].dU_jl_ddy,	104,100);	// 1.02的返回值
			
			ptSet->tSwSet[sw].dU_jl_gdy_fh= _Mul_Div_U(ptSet->tSwSet[sw].dU_jl_gdy,	96,100);	// 0.98的返回值
			ptSet->tSwSet[sw].dU_jl_ggdy_fh= _Mul_Div_U(ptSet->tSwSet[sw].dU_jl_ggdy,	96,100);	// 0.98的返回值			

		#ifdef GD_AREA_ECZD_MEIZHOU_2021
			ptSet->tSwSet[sw].dU_reclose_gdy_fh = _Mul_Div_U(ptSet->tSwSet[sw].dU_jl_gdy,	104,100);	// 1.04的高电压解列值为返回值
			ptSet->tSwSet[sw].dU_reclose_ddy_fh = _Mul_Div_U(ptSet->tSwSet[sw].dU_jl_ddy,	96,100);	// 0.96的低电压解列值为返回值
		#endif
		}
		//频率解列
		{
			ptSet->tSwSet[sw].bTT_jl_hz=(((WORD)psetbuf[SET_PLJL_TT+sw*SW_SET_NUMBER ].ff==1 )?true:false);
			ptSet->tSwSet[sw].dT_jl_ghz		= GetSetTIME(psetbuf[SET_GPJL_T+sw*SW_SET_NUMBER ].ff);
			ptSet->tSwSet[sw].dT_jl_dhz		= GetSetTIME(psetbuf[SET_DPJL_T+sw*SW_SET_NUMBER ].ff);
			ptSet->tSwSet[sw].dT_jl_lowhz		= GetSetTIME(0.2); //频率过低
			ptSet->tSwSet[sw].dU_jl_ghz=GetSetNormal(psetbuf[SET_GPJL_HZ+sw*SW_SET_NUMBER ].ff,65536);
			ptSet->tSwSet[sw].dU_jl_dhz=GetSetNormal(psetbuf[SET_DPJL_HZ+sw*SW_SET_NUMBER ].ff,65536);
			ptSet->tSwSet[sw].dU_jl_lowhz=GetSetNormal(47.0,65536);
			ptSet->tSwSet[sw].dU_jl_dhz_fh= ptSet->tSwSet[sw].dU_jl_dhz+1310;	// 返回值小 0.02
			ptSet->tSwSet[sw].dU_jl_lowhz_fh= ptSet->tSwSet[sw].dU_jl_lowhz+1310;	// 0.98的返回值			
			ptSet->tSwSet[sw].dU_jl_ghz_fh=ptSet->tSwSet[sw].dU_jl_ghz-1310;	// 0.98的返回值

			#ifdef GD_AREA_ZHUHAI_V2
			if(ptSet->tSwSet[sw].dT_jl_ghz>T_40ms && ptSet->tSwSet[sw].dT_jl_ghz<T_1s*2)  ptSet->tSwSet[sw].dT_jl_ghz-=(T_25ms+T_10ms);
			if(ptSet->tSwSet[sw].dT_jl_dhz>T_40ms && ptSet->tSwSet[sw].dT_jl_dhz<T_1s*2)  ptSet->tSwSet[sw].dT_jl_dhz-=(T_25ms+T_10ms);
			if(ptSet->tSwSet[sw].dT_jl_lowhz>T_40ms && ptSet->tSwSet[sw].dT_jl_lowhz<T_1s*2)  ptSet->tSwSet[sw].dT_jl_lowhz-=(T_25ms+T_10ms);
			#endif
		}
		ptSet->tSwSet[sw].bTT_hcbs_dy=(((WORD)psetbuf[SET_DYJL_HCBS_TT+sw*SW_SET_NUMBER ].ff==1 )?true:false); //电压滑差投退
		ptSet->tSwSet[sw].bTT_hcbs_hz=(((WORD)psetbuf[SET_DPJL_HCBS_TT+sw*SW_SET_NUMBER ].ff==1 )?true:false); //频率滑差投退
		ptSet->tSwSet[sw].dhcbs_hz=GetSetNormal(psetbuf[SET_DPJL_HCBS_HZ+sw*SW_SET_NUMBER ].ff,65536);   // 频率滑差定值
		ptSet->tSwSet[sw].dhcbs_u=GetSetNormal(psetbuf[SET_DYJL_HCBS_U+sw*SW_SET_NUMBER ].ff,fKU[PUB_AC_UAB1]);  // 电压滑差定值
		
#ifdef XDL_ZT
		//小电流接地
		ptSet->tSwSet[sw].bTT_xdlgj =(((WORD)psetbuf[SET_XDLGJ_TT+sw*SW_SET_NUMBER].ff==1 )?true:false);  
		ptSet->tSwSet[sw].bTT_xdltz =(((WORD)psetbuf[SET_XDLTZ_TT+sw*SW_SET_NUMBER].ff==1 )?true:false);  
		if(ptSet->tSwSet[sw].bTT_xdlgj || ptSet->tSwSet[sw].bTT_xdltz)
		{
			ptSet->tSwSet[sw].bTT_xdlqd =(((WORD)psetbuf[SET_XDLQD_TT+sw*SW_SET_NUMBER].ff==1 )?true:false);  
			ptSet->bTT_xdl=true;
		}
		else
		{
			ptSet->tSwSet[sw].bTT_xdlqd = -1;  
		}
		if(g_ui[UI_SW_INDEX(sw,SW_AC_I0)].chn_index == CFG_ADC_CHANNEL_ZERO)
		{
			ptSet->tSwSet[sw].dI_xdl_zt = -1;
		}
		else
		{
			// 定值由峰值改为有效值
		//			ptSet->tSwSet[sw].dI_xdl_zt = GetSetNormal(psetbuf[SET_XDL_I+sw*SW_SET_NUMBER].ff,1/(g_ui[UI_SW_INDEX(sw,SW_AC_I0)].e_factor0*1.4142));
			ptSet->tSwSet[sw].dI_xdl_zt = GetSetNormal(psetbuf[SET_XDL_I+sw*SW_SET_NUMBER].ff,1/(g_ui[UI_SW_INDEX(sw,SW_AC_I0)].e_factor0));
			ptSet->tSwSet[sw].dI_xdl_300ma = GetSetNormal(0.2,1/(g_ui[UI_SW_INDEX(sw,SW_AC_I0)].e_factor0));						// 200毫安，电流定值
		}
		ptSet->tSwSet[sw].dI_xdl	= GetSetSQR(psetbuf[SET_XDL_I+sw*SW_SET_NUMBER].ff,fKI0);						//过流定值
		ptSet->tSwSet[sw].dI_xdl_fh = _Mul_Div_U(ptSet->tSwSet[sw].dI_xdl,	96, 100);			
#endif

		ptSet->tSwSet[sw].bTT_IBSCHZ = (((WORD)psetbuf[SET_CH_DLBS_TT+sw*SW_SET_NUMBER ].ff==1 )?true:false);
		ptSet->tSwSet[sw].dIBSCHZ = GetSetSQR(psetbuf[SET_CH_DLBS_I+sw*SW_SET_NUMBER].ff,fKI);			

        // 配网自动化功能
        {
		#ifdef GD_AREA_ECZD_MAOMING
			ptSet->bTT_EDIT_YB=((WORD)psetbuf[SET_EDIT_PAR_YB1+sw*SW_SET_NUMBER ].ff==1 )?true:false || ((WORD)psetbuf[SET_EDIT_PAR_YB2+sw*SW_SET_NUMBER ].ff==1 )?true:false;
		#endif
            ptSet->tSwSet[sw].bTT_fa_poweron    = ((DWORD)psetbuf[SET_P_YY_TT+sw*SW_SET_NUMBER ].ff==1)?true:false;
            ptSet->tSwSet[sw].bTT_fa_lineon     = ((DWORD)psetbuf[SET_L_YY_TT+sw*SW_SET_NUMBER ].ff==1)?true:false;
		#ifdef GD_TEST_2021
			ptSet->tSwSet[sw].bTT_fa_poweroff   = (BYTE)psetbuf[SET_P_WY_TT+sw*SW_SET_NUMBER ].ff;
            ptSet->tSwSet[sw].bTT_fa_lineoff    = (BYTE)psetbuf[SET_L_WY_TT+sw*SW_SET_NUMBER ].ff;
		#else	
            ptSet->tSwSet[sw].bTT_fa_poweroff   = ((DWORD)psetbuf[SET_P_WY_TT+sw*SW_SET_NUMBER ].ff==1)?true:false;
            ptSet->tSwSet[sw].bTT_fa_lineoff    = ((DWORD)psetbuf[SET_L_WY_TT+sw*SW_SET_NUMBER ].ff==1)?true:false;
		#endif
            ptSet->tSwSet[sw].bTT_fa_Lostfz= ((DWORD)psetbuf[SET_LOSTFZ_TT+sw*SW_SET_NUMBER ].ff==1)?true:false;
            ptSet->tSwSet[sw].bTT_fa_Icheck = ((DWORD)psetbuf[SET_GZCHECK_TT+sw*SW_SET_NUMBER ].ff==1)?true:false;
#ifdef GD_AREA_ZHONGSHAN_2020
            //ptSet->tSwSet[sw].bTT_fa_gzTz = ((DWORD)psetbuf[SET_GZAT_TT+sw*SW_SET_NUMBER ].ff==1)?true:false;
            ptSet->tSwSet[sw].bTT_fa_gzTz   = ((DWORD)psetbuf[SET_GZTZ_TT+sw*SW_SET_NUMBER ].ff==1)?true:false;
            ptSet->tSwSet[sw].bTT_fa_hjs    = ((DWORD)psetbuf[SET_GZTZ_TT+sw*SW_SET_NUMBER ].ff==1)?true:false;
#else
            ptSet->tSwSet[sw].bTT_fa_gzTz   = (((DWORD)psetbuf[SET_GZTZ_TT+sw*SW_SET_NUMBER ].ff==1)?true:false)
											#ifdef FUNC_FA_GL_TT
												&& ((((WORD)psetbuf[SET_FA_GL1_TZ_TT+sw*SW_SET_NUMBER ].ff==1 )?true:false) || (((WORD)psetbuf[SET_FA_GL2_TZ_TT+sw*SW_SET_NUMBER ].ff==1 )?true:false))
											#endif
            									;
#endif
#ifdef GD_AREA_ECZD_2020 //2020-9-8
            //ptSet->tSwSet[sw].bTT_fa_scyy_bs = true;    //默认双侧有压禁止合闸
            ptSet->tSwSet[sw].bTT_fa_scyy_bs = false;	//联络双侧有压闭锁自动合闸但不闭锁遥控合闸、电动合闸、手动合闸
        /*#ifdef GD_AREA_ZHONGSHAN_2020
            ptSet->tSwSet[sw].bTT_fa_scyy_bs = false;
		#endif*/
            ptSet->tSwSet[sw].bTT_fa_sfbs = true;       //默认手分闭锁
            ptSet->tSwSet[sw].bTT_fa_gzbshz = true;     //默认合后故障闭锁合闸
            ptSet->tSwSet[sw].bTT_fa_shbs = false;      //默认手合无压，闭锁分闸
            ptSet->tSwSet[sw].bTT_FA    = true;         //默认投入就地FA功能
            ptSet->tSwSet[sw].bTT_fa_LL = ((DWORD)psetbuf[SET_SL_TT+sw*SW_SET_NUMBER ].ff==0)?true:false;
#else
            ptSet->tSwSet[sw].bTT_fa_scyy_bs = ((DWORD)psetbuf[SET_SCYY_BSHZ+sw*SW_SET_NUMBER ].ff==1)?true:false;
            ptSet->tSwSet[sw].bTT_fa_sfbs = ((DWORD)psetbuf[SET_SF_BSHZ+sw*SW_SET_NUMBER ].ff==1)?true:false;
            ptSet->tSwSet[sw].bTT_fa_gzbshz = ((DWORD)psetbuf[SET_GZBSHZ_TT+sw*SW_SET_NUMBER ].ff==1)?true:false;
            ptSet->tSwSet[sw].bTT_fa_shbs = ((DWORD)psetbuf[SET_SH_BSFZ+sw*SW_SET_NUMBER ].ff==1)?true:false;
            ptSet->tSwSet[sw].bTT_fa_LL         = ((DWORD)psetbuf[SET_SL_TT+sw*SW_SET_NUMBER ].ff==2)?true:false;
            ptSet->tSwSet[sw].bTT_FA            = ((DWORD)psetbuf[SET_FA_TT+sw*SW_SET_NUMBER ].ff==1)?true:false;
#endif
#if defined GD_AREA_SHANWEI || defined GD_AREA_HEYUAN_2021_2021
			 ptSet->tSwSet[sw].bTT_fa_LL = ((DWORD)psetbuf[SET_SL_TT+sw*SW_SET_NUMBER ].ff==0)?true:false;
#endif
 			ptSet->tSwSet[sw].bTT_fa_gl2 = ((DWORD)psetbuf[SET_FA_GL2_TT+sw*SW_SET_NUMBER ].ff==1)?true:false;
            ptSet->tSwSet[sw].bTT_fa_lx2 = ((DWORD)psetbuf[SET_FA_LX2_TT+sw*SW_SET_NUMBER ].ff==1)?true:false;
            ptSet->tSwSet[sw].bTT_fa_bsTz       = ((DWORD)psetbuf[SET_BSTZ_TT+sw*SW_SET_NUMBER ].ff==1)?true:false;
            ptSet->tSwSet[sw].bTT_fa_cybs       = ((DWORD)psetbuf[SET_CYBS_TT+sw*SW_SET_NUMBER ].ff==1)?true:false;
            ptSet->tSwSet[sw].bTT_fa_xbbs   = ((DWORD)psetbuf[SET_FA_XBBS_TT+sw*SW_SET_NUMBER ].ff==1)?true:false;
#ifdef GD_AREA_SHANTOU
            ptSet->tSwSet[sw].bTT_fa_U0Tz   = ((DWORD)psetbuf[SET_U0TZ_TT+sw*SW_SET_NUMBER ].ff==1)?true:false;
            ptSet->tSwSet[sw].bTT_fa_U0Gj   = ((DWORD)psetbuf[SET_U0TZ_TT+sw*SW_SET_NUMBER ].ff==0)?true:false;
#else
            ptSet->tSwSet[sw].bTT_fa_U0Tz   = ((DWORD)psetbuf[SET_U0TZ_TT+sw*SW_SET_NUMBER ].ff==2)?true:false;
            ptSet->tSwSet[sw].bTT_fa_U0Gj   = ((DWORD)psetbuf[SET_U0TZ_TT+sw*SW_SET_NUMBER ].ff==1)?true:false;
#endif
            ptSet->tSwSet[sw].bTT_fa_ptdx   = ((DWORD)psetbuf[SET_FA_PTDX+sw*SW_SET_NUMBER ].ff==1)?true:false;
            ptSet->tSwSet[sw].bTT_hzbs      = (((DWORD)psetbuf[SET_HZBS_TT+sw*SW_SET_NUMBER].ff==1 )?true:false);
            ptSet->tSwSet[sw].dU_fa_YY  =GetSetSQR(psetbuf[SET_FA_YY_U+sw*SW_SET_NUMBER ].ff*fUn/100,fKU[PUB_AC_UAB1]);  // 0.4 倍的额定值
            ptSet->tSwSet[sw].dU_fa_WY  =GetSetSQR(psetbuf[SET_FA_WY_U+sw*SW_SET_NUMBER ].ff*fUn/100,fKU[PUB_AC_UAB1]);  // 0.4 倍的额定值
            ptSet->tSwSet[sw].dU_fa_YY_fh   = _Mul_Div_U(ptSet->tSwSet[sw].dU_fa_YY,    96,100);    // 0.98的返回值
            ptSet->tSwSet[sw].dU_fa_WY_fh   = _Mul_Div_U(ptSet->tSwSet[sw].dU_fa_WY,    104,100);   // 1.02的返回值
            ptSet->tSwSet[sw].dT_fa_YY  = GetSetTIME(psetbuf[SET_FA_YY_T+sw*SW_SET_NUMBER ].ff);
            ptSet->tSwSet[sw].dT_fa_WY  = GetSetTIME(psetbuf[SET_FA_WY_T+sw*SW_SET_NUMBER ].ff);
            //ptSet->tSwSet[sw].dT_fa_YY    = GetSetTIME(0.025);//有压延时默认25ms
            //ptSet->tSwSet[sw].dT_fa_WY  = GetSetTIME(0.025);//无压延时默认25ms

            //FA负荷侧pt变比生效
            ptSet->tSwSet[sw].dU_fa_YY2 =GetSetSQR(psetbuf[SET_FA_YY_U+sw*SW_SET_NUMBER ].ff*ptSet->pt2_two/100,fKU[PUB_AC_UAB2]);   // 0.4 倍的额定值
            ptSet->tSwSet[sw].dU_fa_WY2 =GetSetSQR(psetbuf[SET_FA_WY_U+sw*SW_SET_NUMBER ].ff*ptSet->pt2_two/100,fKU[PUB_AC_UAB2]);   // 0.4 倍的额定值
            ptSet->tSwSet[sw].dU_fa_YY2_fh  = _Mul_Div_U(ptSet->tSwSet[sw].dU_fa_YY2,   96,100);    // 0.98的返回值
            ptSet->tSwSet[sw].dU_fa_WY2_fh  = _Mul_Div_U(ptSet->tSwSet[sw].dU_fa_WY2,   104,100);   // 1.02的返回值

            ptSet->tSwSet[sw].dT_X      = GetSetTIME(psetbuf[SET_FA_X_T+sw*SW_SET_NUMBER ].ff);
            ptSet->tSwSet[sw].dT_Y      = GetSetTIME(psetbuf[SET_FA_Y_T+sw*SW_SET_NUMBER ].ff);
#ifdef GD_AREA_ZHONGSHAN_2020
            ptSet->tSwSet[sw].dT_LL_CD  = GetSetTIME(psetbuf[SET_FA_LL_CD_T+sw*SW_SET_NUMBER ].ff);
#endif
            ptSet->tSwSet[sw].dT_XL     = GetSetTIME(psetbuf[SET_FA_XL_T+sw*SW_SET_NUMBER ].ff);
            ptSet->tSwSet[sw].dT_Z      = GetSetTIME(psetbuf[SET_FA_Z_T+sw*SW_SET_NUMBER ].ff);
            ptSet->tSwSet[sw].dT_fa_bsTz    = GetSetTIME(psetbuf[SET_FA_BSTZ_T+sw*SW_SET_NUMBER ].ff);

#ifdef	FA_OC_COUNT
			ptSet->tSwSet[sw].bTT_fa_oc_count  = (((DWORD)psetbuf[SET_FA_OC_COUNT_TT+sw*SW_SET_NUMBER].ff==1 )?true:false);
			ptSet->tSwSet[sw].fa_oc_count_m =((DWORD)psetbuf[SET_FA_OC_COUNT_M+sw*SW_SET_NUMBER].ff);
			ptSet->tSwSet[sw].fa_oc_conut_time = GetSetTIME(psetbuf[SET_FA_OC_COUNT_T+sw*SW_SET_NUMBER ].ff);// ((WORD)psetbuf[SET_FA_OC_COUNT_T+sw*SW_SET_NUMBER].ff);
			if(ptSet->tSwSet[sw].fa_oc_count_m==0||ptSet->tSwSet[sw].fa_oc_conut_time==0)
				ptSet->tSwSet[sw].bTT_fa_oc_count = FALSE;
#endif

#ifdef INRUSH_CURRENT_IN_DECIMALS
		ptSet->tSwSet[sw].d_fa_xbcoe=GetSetSQR(psetbuf[SET_FA_XBCOE+sw*SW_SET_NUMBER ].ff,256);	
#else
	#if defined CPU_FUXI
		if(psetbuf[SET_BH_XBCOE+sw*SW_SET_NUMBER ].ff <= 1)
		{
			ptSet->tSwSet[sw].d_bh_xbcoe=GetSetSQR(psetbuf[SET_BH_XBCOE+sw*SW_SET_NUMBER ].ff/100,256);	
		}
		else
		{
			ptSet->tSwSet[sw].d_bh_xbcoe=GetSetSQR((psetbuf[SET_BH_XBCOE+sw*SW_SET_NUMBER ].ff/100-0.01),256);	
		}	
	#else
		ptSet->tSwSet[sw].d_fa_xbcoe=GetSetSQR(psetbuf[SET_FA_XBCOE+sw*SW_SET_NUMBER ].ff/100,256);	
	#endif		
#endif
			//ptSet->tSwSet[sw].dU_OverU0	=GetSetSQR(0.2*fU0,fKU[PUB_AC_U01]);	 //合后零压,固定为额定值20%
			//ptSet->tSwSet[sw].dT_OverU0	= GetSetTIME(0.6);//合后零压时间,固定为 0.6s
			ptSet->tSwSet[sw].dU_OverU0	=GetSetSQR(psetbuf[SET_FA_U0_U+sw*SW_SET_NUMBER ].ff,fKU[PUB_AC_U01]);	 //
			ptSet->tSwSet[sw].dU_OverU0_fh= _Mul_Div_U(ptSet->tSwSet[sw].dU_OverU0,	96, 100);		//0.96=0.98*0.98;        		
			ptSet->tSwSet[sw].dT_OverU0	= GetSetTIME(psetbuf[SET_FA_U0_T+sw*SW_SET_NUMBER ].ff);
		#if defined GD_AREA_ECZD_2020
			ptSet->tSwSet[sw].dU_UF		=GetSetSQR(0.20*fUn,fKU[PUB_AC_UAB1]);	 //瞬压定值固定取20%额定值
			ptSet->tSwSet[sw].dU_UF2		=GetSetSQR(0.20*ptSet->pt2_two,fKU[PUB_AC_UAB2]);	 //瞬压定值固定取20%额定值
		#else
			ptSet->tSwSet[sw].dU_UF 	=GetSetSQR(0.25*fUn,fKU[PUB_AC_UAB1]);	 //瞬压定值固定取25%额定值
			ptSet->tSwSet[sw].dU_UF2		=GetSetSQR(0.25*ptSet->pt2_two,fKU[PUB_AC_UAB2]);	 //瞬压定值固定取25%额定值
		#endif
			ptSet->tSwSet[sw].hzbstimes =((DWORD)psetbuf[SET_HZBS_TIMES+sw*SW_SET_NUMBER].ff);//psetbuf[SET_HZBS_TIMES+sw*SW_SET_NUMBER].ff)
			ptSet->tSwSet[sw].dT_hzbs   = GetSetTIME(psetbuf[SET_HZBS_T+sw*SW_SET_NUMBER].ff);
			ptSet->tSwSet[sw].dT_wldz	=GetSetSQR(psetbuf[SET_FA_WLDZ].ff,fIn); 
				
			poc= &ptSet->tSwSet[sw].toc[FA_GL];//相间故障
		//#ifdef GD_AREA_ZHONGSHAN_2020
			//poc->bTz=(((WORD)psetbuf[SET_GZAT_TT+sw*SW_SET_NUMBER ].ff==1 )?true:false); 
		//#else
			poc->bTz=((((WORD)psetbuf[SET_GZTZ_TT+sw*SW_SET_NUMBER ].ff==1 )?true:false)
					#ifdef FUNC_FA_GL_TT
						&& (((WORD)psetbuf[SET_FA_GL1_TZ_TT+sw*SW_SET_NUMBER ].ff==1 )?true:false)
					#endif
						);
		//#endif
			poc->bDir=false;
			poc->bGj=false;
			#if defined GD_AREA_SHANTOU || defined GD_AREA_MAIN_2020 //汕头局要求合后电流两段处理(I+t) 广东标准2020与汕头局保持一致
				poc->dT=GetSetTIME(psetbuf[SET_FA_GLI_T+sw*SW_SET_NUMBER ].ff)+GetSetTIME(psetbuf[SET_FA_GZTZ_T+sw*SW_SET_NUMBER ].ff);
			#elif defined GD_AREA_ECZD_2020
				poc->dT=GetSetTIME(psetbuf[SET_FA_GLI_T+sw*SW_SET_NUMBER ].ff);
			#else
				poc->dT=GetSetTIME(psetbuf[SET_FA_GZTZ_T+sw*SW_SET_NUMBER ].ff);
			#endif			
			if(poc->dT<T_FA_TZ_MIN_TIME) poc->dT= T_FA_TZ_MIN_TIME;//不小于20ms
			poc->dI=GetSetSQR(psetbuf[SET_FA_GL_I+sw*SW_SET_NUMBER ].ff,fKI);
			poc->dI_fh= _Mul_Div_U(poc->dI,	96, 100);		//0.96=0.98*0.98;        		//返回值

			poc= &ptSet->tSwSet[sw].toc[FA_GL_II];//相间II段故障
		//#ifdef GD_AREA_ZHONGSHAN_2020
			//poc->bTz=(((WORD)psetbuf[SET_GZAT_TT+sw*SW_SET_NUMBER ].ff==1 )?true:false); 
		//#else
			poc->bTz=((((WORD)psetbuf[SET_GZTZ_TT+sw*SW_SET_NUMBER ].ff==1 )?true:false)
					#ifdef FUNC_FA_GL_TT
						&& (((WORD)psetbuf[SET_FA_GL2_TZ_TT+sw*SW_SET_NUMBER ].ff==1 )?true:false)
					#endif
						);
		//#endif
			poc->bDir=false;
			poc->bGj=false;
		#if defined GD_AREA_SHANTOU || defined GD_AREA_MAIN_2020 //汕头局要求合后电流两段处理(I+t) 广东标准2020与汕头局保持一致
			poc->dT=GetSetTIME(psetbuf[SET_FA_GLII_T+sw*SW_SET_NUMBER ].ff)+GetSetTIME(psetbuf[SET_FA_GZTZ_T+sw*SW_SET_NUMBER ].ff);
		#elif defined GD_AREA_ECZD_2020 
			 #ifdef GD_AREA_ZHONGSHAN_2020
				if(ptSet->tSwSet[sw].bTT_fa_hjs)
				{
					poc->dT=GetSetTIME(psetbuf[SET_FA_GZTZ_T+sw*SW_SET_NUMBER ].ff);
				}
				else
				{
					poc->dT=GetSetTIME(psetbuf[SET_FA_GLII_T+sw*SW_SET_NUMBER ].ff);
				}
				ptSet->tSwSet[sw].dT_fa_ocing= GetSetTIME(psetbuf[SET_FA_GLII_T+sw*SW_SET_NUMBER ].ff);
			#else
				poc->dT=GetSetTIME(psetbuf[SET_FA_GLII_T+sw*SW_SET_NUMBER ].ff);
			#endif			
		#else
			poc->dT=GetSetTIME(psetbuf[SET_FA_GZTZ_T+sw*SW_SET_NUMBER ].ff);
		#endif 
			if(poc->dT<T_FA_TZ_MIN_TIME) poc->dT= T_FA_TZ_MIN_TIME;//不小于20ms
		#if defined GD_AREA_CHAOZHOU || defined GD_AREA_SHANTOU || defined GD_AREA_ECZD_2020 || defined GD_AREA_MAIN_2020 //潮州局要求合后电流两段处理   
			poc->dI=GetSetSQR(psetbuf[SET_FA_GL_II+sw*SW_SET_NUMBER ].ff,fKI);
		#else
			poc->bTz=false; 
			poc->bDir=false;
			poc->bGj=false;
			poc->dI=false;
		#endif
			poc->dI_fh= _Mul_Div_U(poc->dI,	96, 100);		//0.96=0.98*0.98;        		//返回值
			
			poc= &ptSet->tSwSet[sw].toc[FA_GL2];//相间告警
			poc->bTz=false; 
			poc->bDir=false;
			poc->bGj=(((WORD)psetbuf[SET_FA_GL2_TT+sw*SW_SET_NUMBER ].ff==1 )?true:false);
			poc->dT=GetSetTIME(psetbuf[SET_FA_GL2_T+sw*SW_SET_NUMBER ].ff);
			poc->dI=GetSetSQR(psetbuf[SET_FA_GL2_I+sw*SW_SET_NUMBER ].ff,fKI);		     			
			poc->dI_fh= _Mul_Div_U(poc->dI,	96, 100);		//0.96=0.98*0.98;        		//返回值
		#ifdef GD_AREA_ECZD_2020
			poc->dU=GetSetSQR(psetbuf[SET_FA_FHDDY+sw*SW_SET_NUMBER ].ff*fUn/100,fKU[PUB_AC_UAB1]);                 //低电压定值
			poc->dU_fh= _Mul_Div_U(poc->dU,	104, 100);		        		//返回值
			poc->dU2=GetSetSQR(psetbuf[SET_FA_FHFDY+sw*SW_SET_NUMBER ].ff*fUn/100,fKU[PUB_AC_UAB1]);                //负序电压值
			poc->dU2_fh= _Mul_Div_U(poc->dU2,	96, 100);	
        #endif
			
			poc= &ptSet->tSwSet[sw].toc[FA_DLBS];
			poc->bTz=(((WORD)psetbuf[SET_DLBS_TT+sw*SW_SET_NUMBER ].ff==1 )?true:false); 
			poc->bDir=false;
			poc->bGj=false;
			poc->dT=GetSetTIME(0.00);	// 大电流闭锁0毫秒
			poc->dI=GetSetSQR(psetbuf[SET_FA_DLBS_I+sw*SW_SET_NUMBER ].ff,fKI);		     			
			poc->dI_fh= _Mul_Div_U(poc->dI,	96, 100);		//0.96=0.98*0.98;        		//返回值

			poc= &ptSet->tSwSet[sw].toc[FA_LX];//零序故障
		//#ifdef GD_AREA_ZHONGSHAN_2020
			//poc->bTz=(((WORD)psetbuf[SET_GZAT_TT+sw*SW_SET_NUMBER ].ff==1 )?true:false); 
		//#else
			poc->bTz=(((WORD)psetbuf[SET_GZTZ_TT+sw*SW_SET_NUMBER ].ff==1 )?true:false); 
		//#endif
			poc->bDir=false;
			poc->bGj=false;
		#if defined GD_AREA_HEYUAN_2021//惠州局要求快速分闸延时相间跟接地延时分开	
			poc->dT=GetSetTIME(psetbuf[SET_FA_GZTZ_T2+sw*SW_SET_NUMBER ].ff);
		#elif  defined GD_AREA_SHANTOU || defined GD_AREA_MAIN_2020 //汕头局要求合后电流两段处理(I+t) 广东标准2020与汕头局保持一致
			poc->dT=GetSetTIME(psetbuf[SET_FA_LX_T+sw*SW_SET_NUMBER ].ff) + GetSetTIME(psetbuf[SET_FA_GZTZ_T+sw*SW_SET_NUMBER ].ff);
		#elif defined GD_AREA_ECZD_2020
		    #ifdef GD_AREA_ZHONGSHAN_2020
				if(ptSet->tSwSet[sw].bTT_fa_hjs)
				{
					poc->dT=GetSetTIME(psetbuf[SET_FA_GZTZ_T+sw*SW_SET_NUMBER ].ff);
				}
				else
				{
					poc->dT=GetSetTIME(psetbuf[SET_FA_LX_T+sw*SW_SET_NUMBER ].ff);
				}	
				ptSet->tSwSet[sw].dT_fa_lxing= GetSetTIME(psetbuf[SET_FA_LX_T+sw*SW_SET_NUMBER ].ff);
			#else
				poc->dT=GetSetTIME(psetbuf[SET_FA_LX_T+sw*SW_SET_NUMBER ].ff);
			#endif
		#else
			poc->dT=GetSetTIME(psetbuf[SET_FA_GZTZ_T+sw*SW_SET_NUMBER ].ff);
		#endif
			if(poc->dT<T_FA_TZ_MIN_TIME) poc->dT= T_FA_TZ_MIN_TIME;//不小于20ms
			poc->dI=GetSetSQR(psetbuf[SET_FA_LX_I+sw*SW_SET_NUMBER ].ff,fKI0);	
			poc->dI_fh= _Mul_Div_U(poc->dI,	96, 100);		//0.96=0.98*0.98;        		//返回值
			
			poc= &ptSet->tSwSet[sw].toc[FA_LX2];//零序告警
			poc->bTz=false;
			poc->bDir=false;
			poc->bGj=(((WORD)psetbuf[SET_FA_LX2_TT+sw*SW_SET_NUMBER ].ff==1 )?true:false); ;
			poc->dT=GetSetTIME(psetbuf[SET_FA_LX2_T+sw*SW_SET_NUMBER ].ff);
			poc->dI=GetSetSQR(psetbuf[SET_FA_LX2_I+sw*SW_SET_NUMBER ].ff,fKI0);		     			
			poc->dI_fh= _Mul_Div_U(poc->dI,	96, 100);		//0.96=0.98*0.98;        		//返回值
		}	

		//零序过电压投入
		{
        #if defined GD_AREA_MAIN_2020 || defined GD_AREA_ECZD_2020  // be modified by Jack.Liu on 2020/07/23--14:4:47
        	#if defined GD_AREA_ECZD_YUNFU_2021_2021
        		ptSet->tSwSet[sw].bTT_3U0Tz = (((WORD)psetbuf[SET_3U0_TT+sw*SW_SET_NUMBER ].ff==2 )?true:false);
		    	ptSet->tSwSet[sw].bTT_3U0Gj = (((WORD)psetbuf[SET_3U0_TT+sw*SW_SET_NUMBER ].ff==1 )?true:false);
		    #else
				ptSet->tSwSet[sw].bTT_3U0Tz = (((WORD)psetbuf[SET_3U0_TT+sw*SW_SET_NUMBER ].ff==1 )?true:false);
				#if defined GD_AREA_HEYUAN_2021 || defined GD_AREA_ECZD_CHAOZHOU_2021 || defined GD_AREA_ECZD_SHAOGUAN_2021
					ptSet->tSwSet[sw].bTT_3U0Gj = (((WORD)psetbuf[SET_3U0_TT+sw*SW_SET_NUMBER ].ff==0 )?true:false);
				#else
					ptSet->tSwSet[sw].bTT_3U0Gj = 0;		
				#endif
			#endif
        #else
		    ptSet->tSwSet[sw].bTT_3U0Tz = (((WORD)psetbuf[SET_3U0_TT+sw*SW_SET_NUMBER ].ff==2 )?true:false);
		    ptSet->tSwSet[sw].bTT_3U0Gj = (((WORD)psetbuf[SET_3U0_TT+sw*SW_SET_NUMBER ].ff==1 )?true:false);
        #endif

		#ifdef GD_AREA_CHAOZHOUFENGXI
			ptSet->tSwSet[sw].bTT_3U0Gj = true;//潮州要求零序电压退出的时候告警
		#endif
			ptSet->tSwSet[sw].dBHOverU0	= GetSetSQR(psetbuf[SET_U0_U+sw*SW_SET_NUMBER].ff,fKU[PUB_AC_U01]);	
			ptSet->tSwSet[sw].dBHOverU0_fh = _Mul_Div_U(ptSet->tSwSet[sw].dBHOverU0,96, 100);		//0.96=0.98*0.98
			ptSet->tSwSet[sw].dBHTOverU0 = GetSetTIME(psetbuf[SET_U0_T+sw*SW_SET_NUMBER ].ff);
		}
	#if defined GD_AREA_ECZD_2020 || defined GD_AREA_ZHONGSHAN_2020 //2020二次指导意见软压板放到公共 2020-9-9
		//软压板状态处理
		ptSet->bTT_CHZ_YB=((WORD)psetbuf[SET_CHZ_YB+sw*SW_SET_NUMBER ].ff==1 )?true:false;	 //重合闸投入软压板 	
		#ifdef GD_AREA_ECZD_SHAOGUAN_2021
			fresh_set_soe(EV_CHZ_SOFT_YB,ptSet->bTT_CHZ_YB,bFirst,0);
		#endif
	#else
		{ 	
			//软压板状态处理
			ptSet->bTT_SOFT_GOOSE_YB = true;
			ptSet->bTT_SOFT_FA_YB = true;
			ptSet->bTT_SOFT_BH_YB = true;
			ptSet->bTT_EDIT_YB = true;
			ptSet->bTT_KZ_YB = true;
			ptSet->bTT_SOFT_YK_YB = true;
			ptSet->bTT_SOFT_JZS_YB = false;
            ptSet->bTT_BH_YB= true;
            ptSet->bTT_TQ_YB=true;
            ptSet->bTT_JL_YB =true;
			//装置软压板配置			
			ptSet->bTT_EDIT_YB=((WORD)psetbuf[SET_EDIT_PAR_YB+sw*SW_SET_NUMBER ].ff==1 )?true:false;
#ifdef GD_AREA_MAIN_2020
            ptSet->bTT_BH_YB=((WORD)psetbuf[SET_BH_YB].ff==0 )?true:false;   //！！！！停用保护功能总压板
#else
            ptSet->bTT_BH_YB=((WORD)psetbuf[SET_BH_YB].ff==1 )?true:false;
#endif
            ptSet->bTT_KZ_YB=((WORD)psetbuf[SET_KZ_OUT_YB+sw*SW_SET_NUMBER ].ff==1 )?true:false;

#if defined GD_AREA_FOS || defined GD_AREA_MAIN_2020 || defined GD_AREA_FOS_2021
            ptSet->bTT_CHZ_YB=((WORD)psetbuf[SET_CHZ_YB+sw*SW_SET_NUMBER ].ff==1 )?true:false;   //重合闸投入软压板
#else
            ptSet->bTT_CHZ_YB=((WORD)psetbuf[SET_CHZ_YB+sw*SW_SET_NUMBER ].ff==0 )?true:false;   //停用重合闸压板
#endif

            ptSet->bTT_TQ_YB =((WORD)psetbuf[SET_TQ_YB+sw*SW_SET_NUMBER ].ff==1 )?true:false;	 //同期合闸软压板

			#if (defined BHFAGS_YB_YK || defined GD_AREA_ZHONGSHAN || defined GD_AREA_ZHUHAI_V2 || defined GD_AREA_SHAOGUAN) && !defined BH_FA_INONE_SW
				#ifdef GD_TEST_2021
					mode_total = (BYTE)(psetbuf[SET_BH_YBTT+sw*SW_SET_NUMBER ].ff + psetbuf[SET_FA_YBTT+sw*SW_SET_NUMBER ].ff + psetbuf[SET_GOOSE_YBTT+sw*SW_SET_NUMBER ].ff);
					if(mode_total > 1){ 	 // 当前只允许一种功能模式投入运行
						ptSet->bTT_SOFT_BH_YB = false;
						ptSet->bTT_SOFT_FA_YB = false;
						ptSet->bTT_SOFT_GOOSE_YB = false;
					}else{
						ptSet->bTT_SOFT_BH_YB = ((WORD)psetbuf[SET_BH_YBTT+sw*SW_SET_NUMBER ].ff==1 )?true:false;
						ptSet->bTT_SOFT_FA_YB = ((WORD)psetbuf[SET_FA_YBTT+sw*SW_SET_NUMBER ].ff==1 )?true:false;				
						ptSet->bTT_SOFT_GOOSE_YB = ((WORD)psetbuf[SET_GOOSE_YBTT+sw*SW_SET_NUMBER ].ff==1 )?true:false; 
					}
				#else
					//EV_GOOSE_YBTT/EV_FA_YBTT/EV_BH_YBTT:关联硬压板等,实时refresh SOE
					ptSet->bTT_SOFT_BH_YB = ((WORD)psetbuf[SET_BH_YBTT+sw*SW_SET_NUMBER ].ff==1 )?true:false;
					ptSet->bTT_SOFT_FA_YB = ((WORD)psetbuf[SET_FA_YBTT+sw*SW_SET_NUMBER ].ff==1 )?true:false;				
					ptSet->bTT_SOFT_GOOSE_YB = ((WORD)psetbuf[SET_GOOSE_YBTT+sw*SW_SET_NUMBER ].ff==1 )?true:false; 
				#endif
			#endif

            ptSet->bTT_SOFT_JZS_YB = ((WORD)psetbuf[SET_MODE_JZS_TT+sw*SW_SET_NUMBER ].ff==1 )?true:false; 
			
			#ifdef YK_SOFT_YB //遥控压板
				ptSet->bTT_SOFT_YK_YB = ((WORD)psetbuf[SET_YK_YBTT+sw*SW_SET_NUMBER ].ff==1 )?true:false;
			#endif
			
#ifdef GD_AREA_MAIN_2020
			ptSet->bTT_JL_YB =((WORD)psetbuf[SET_JL_YB].ff== 1) ? true:false;  // 
#endif

        }
#endif

#ifdef GD_AREA_ZHONGSHAN_2020  //中山智能分布式手合故障处理
	ptSet->tSwSet[sw].tGocSet.tOc[FAG_GL1]=ptSet->tSwSet[sw].toc[FA_GL]; //使用相间故障1段定值
	ptSet->tSwSet[sw].tGocSet.tOc[FAG_GL2]=ptSet->tSwSet[sw].toc[FA_GL2]; //使用相间故障2段定值
	ptSet->tSwSet[sw].tGocSet.tOc[FAG_LX]=ptSet->tSwSet[sw].toc[FA_LX]; //使用FA零序定值
#endif
	
#ifdef	CUSTOMIZE_BZT //备自投		
		

		ptSet->tSwSet[sw].bBZT_TT = ((WORD)psetbuf[SET_BZT_TT+sw*SW_SET_NUMBER].ff==1 )?true:false;
		ptSet->tSwSet[sw].bFD = ((WORD)psetbuf[SET_BZT_FS+sw*SW_SET_NUMBER].ff==0 )?true:false; 
		ptSet->tSwSet[sw].bJX = ((WORD)psetbuf[SET_BZT_FS+sw*SW_SET_NUMBER].ff==1 )?true:false;		
		ptSet->tSwSet[sw].bAUTO   = ((WORD)psetbuf[SET_BZT_FS+sw*SW_SET_NUMBER].ff==2 )?true:false;
	//	ptSet->tSwSet[sw].bDJX   = ((WORD)psetbuf[SET_BZT_FS+sw*SW_SET_NUMBER].ff==3 )?true:false;
		ptSet->tSwSet[sw].bZF   = ((WORD)psetbuf[SET_BZT_FS+sw*SW_SET_NUMBER].ff==3 )?true:false;
		
		//ptSet->tSwSet[sw].bZF 		= ((WORD)psetbuf[SET_BZF_TT+sw*SW_SET_NUMBER].ff==1 )?true:false; 
		ptSet->tSwSet[sw].dT_BTTZ 	 	 = GetSetTIME(psetbuf[SET_BZTT_T+sw*SW_SET_NUMBER].ff); 
		ptSet->tSwSet[sw].dT_BTHZ 	 	 = GetSetTIME(psetbuf[SET_BZTH_T+sw*SW_SET_NUMBER].ff); 
		ptSet->tSwSet[sw].dT_BTCD 	 	 = GetSetTIME(psetbuf[SET_TCD+sw*SW_SET_NUMBER].ff);
#endif		
		//其他定值
		{
			ptSet->tSwSet[sw].bTT_Current_Inv 	=((WORD)psetbuf[SET_CURRENT_INV_TT+sw*SW_SET_NUMBER ].ff==1 )?true:false;   
			ptSet->tSwSet[sw].bTT_DIR_Inv 	=((WORD)psetbuf[SET_DIR_INV_TT+sw*SW_SET_NUMBER ].ff==1 )?true:false;   
			ptSet->tSwSet[sw].bTT_WCN		=(((WORD)psetbuf[SET_TT_TWCN+sw*SW_SET_NUMBER ].ff==1 )?true:false);//&ptSet->bFUN_TWCN;	//弹簧未储能
#ifndef GD_AREA_ZHONGSHAN
	#ifdef GD_AREA_ECZD_SHAOGUAN_2021
			ptSet->tSwSet[sw].bTT_KZHL		=(((WORD)psetbuf[SET_TT_KZHL+sw*SW_SET_NUMBER ].ff==1 )?true:false) || (((WORD)psetbuf[SET_TT_KZHL1+sw*SW_SET_NUMBER ].ff==1 )?true:false);		//控制回路
	#else
			ptSet->tSwSet[sw].bTT_KZHL		=(((WORD)psetbuf[SET_TT_KZHL+sw*SW_SET_NUMBER ].ff==1 )?true:false);//&ptSet->bFUN_TWCN;	//控制回路
	#endif
#endif
			ptSet->tSwSet[sw].bTT_QYD_BS 		=((WORD)psetbuf[SET_QYD_BS_TT+sw*SW_SET_NUMBER ].ff==1 )?true:false;   
			ptSet->tSwSet[sw].bTT_Power_v2	= false;
#ifdef	CUSTOMIZE_BZT //备自投

			// 母线pt1电压电压选择
			dw = (int)(psetbuf[SET_BZT_MX_PT1+sw*SW_SET_NUMBER].ff);	

			
			ptSet->tSwSet[sw].bzt_mx_pt1 = (u8)tSwSetTable[SET_BZT_MX_PT1].list[dw].dat;  	
			// 母线pt2电压电压选择
			dw = (int)(psetbuf[SET_BZT_MX_PT2+sw*SW_SET_NUMBER].ff);			
			ptSet->tSwSet[sw].bzt_mx_pt2 = (u8)tSwSetTable[SET_BZT_MX_PT2].list[dw].dat;  	
			// 进线1pt电压
			dw = (int)(psetbuf[SET_BZT_DL1_PT+sw*SW_SET_NUMBER].ff);			
			ptSet->tSwSet[sw].bzt_dl1_pt = (u8)tSwSetTable[SET_BZT_DL1_PT].list[dw].dat;  	
			// 进线2pt电压
			dw = (int)(psetbuf[SET_BZT_DL2_PT+sw*SW_SET_NUMBER].ff);			
			ptSet->tSwSet[sw].bzt_dl2_pt = (u8)tSwSetTable[SET_BZT_DL2_PT].list[dw].dat;  	
			// 进线1pt电流
			dw = (int)(psetbuf[SET_BZT_DL1_I+sw*SW_SET_NUMBER].ff);			
			ptSet->tSwSet[sw].bzt_dl1_ct = (u8)tSwSetTable[SET_BZT_DL1_I].list[dw].dat;
			// 进线2pt电流
			dw = (int)(psetbuf[SET_BZT_DL2_I+sw*SW_SET_NUMBER].ff);			
			ptSet->tSwSet[sw].bzt_dl2_ct = (u8)tSwSetTable[SET_BZT_DL2_I].list[dw].dat; 

			ptSet->tSwSet[sw].dJX1UPower = GetSetSQR(psetbuf[SET_POWERON_U+sw*SW_SET_NUMBER ].ff, fKU[ptSet->tSwSet[sw].bzt_dl1_pt]);// 备自投进线1有压定值
			ptSet->tSwSet[sw].dJX2UPower = GetSetSQR(psetbuf[SET_POWERON_U+sw*SW_SET_NUMBER ].ff, fKU[ptSet->tSwSet[sw].bzt_dl2_pt]);// 备自投进线2有压定值
			ptSet->tSwSet[sw].dMX1UPower  = GetSetSQR(psetbuf[SET_POWERON_U+sw*SW_SET_NUMBER ].ff, fKU[ptSet->tSwSet[sw].bzt_mx_pt1]);// 备自投母线1有压定值
			ptSet->tSwSet[sw].dMX2UPower  = GetSetSQR(psetbuf[SET_POWERON_U+sw*SW_SET_NUMBER ].ff, fKU[ptSet->tSwSet[sw].bzt_mx_pt2]);// 备自投母线2有压定值

			ptSet->tSwSet[sw].dJX1UPower_fh = _Mul_Div_U(ptSet->tSwSet[sw].dJX1UPower, 96, 100);
			ptSet->tSwSet[sw].dJX2UPower_fh = _Mul_Div_U(ptSet->tSwSet[sw].dJX2UPower, 96, 100);
			ptSet->tSwSet[sw].dMX1UPower_fh = _Mul_Div_U(ptSet->tSwSet[sw].dMX1UPower, 96, 100);
			ptSet->tSwSet[sw].dMX2UPower_fh = _Mul_Div_U(ptSet->tSwSet[sw].dMX2UPower, 96, 100);

			ptSet->tSwSet[sw].dJX1UPowerLost = GetSetSQR(psetbuf[SET_POWEROFF_U+sw*SW_SET_NUMBER ].ff, fKU[ptSet->tSwSet[sw].bzt_dl1_pt]);// 备自投进线1无压定值
			ptSet->tSwSet[sw].dJX2UPowerLost = GetSetSQR(psetbuf[SET_POWEROFF_U+sw*SW_SET_NUMBER ].ff, fKU[ptSet->tSwSet[sw].bzt_dl1_pt]);// 备自投进线2无压定值
			ptSet->tSwSet[sw].dMX1UPowerLost = GetSetSQR(psetbuf[SET_POWEROFF_U+sw*SW_SET_NUMBER ].ff, fKU[ptSet->tSwSet[sw].bzt_dl1_pt]);// 备自投母线1无压定值
			ptSet->tSwSet[sw].dMX2UPowerLost = GetSetSQR(psetbuf[SET_POWEROFF_U+sw*SW_SET_NUMBER ].ff, fKU[ptSet->tSwSet[sw].bzt_dl1_pt]);// 备自投母线2无压定值

			ptSet->tSwSet[sw].dJX1UPowerLost_fh = _Mul_Div_U(ptSet->tSwSet[sw].dJX1UPowerLost, 104, 100);
			ptSet->tSwSet[sw].dJX2UPowerLost_fh = _Mul_Div_U(ptSet->tSwSet[sw].dJX2UPowerLost, 104, 100);
			ptSet->tSwSet[sw].dMX1UPowerLost_fh = _Mul_Div_U(ptSet->tSwSet[sw].dMX1UPowerLost, 104, 100);
			ptSet->tSwSet[sw].dMX2UPowerLost_fh = _Mul_Div_U(ptSet->tSwSet[sw].dMX2UPowerLost, 104, 100);
			poc->dI=GetSetSQR(psetbuf[SET_GL1_I+sw*SW_SET_NUMBER ].ff,fKI);		     			
						
			ptSet->tSwSet[sw].dwl    = GetSetSQR(psetbuf[SET_BZT_WL+sw*SW_SET_NUMBER ].ff,fKI);	
			ptSet->tSwSet[sw].dwl_fh = _Mul_Div_U(ptSet->tSwSet[sw].dwl, 96, 100);		//0.96=0.98*0.98; 	
#endif
		}


#ifdef GD_AREA_MAIN_2020
			ptSet->tSwSet[sw].bTT_PT1_ll_check	 =((WORD)psetbuf[SET_PT1_LL_CHECK_TT+sw*SW_SET_NUMBER ].ff==1 )?true:false;
			ptSet->tSwSet[sw].bTT_PT2_ll_check	 =((WORD)psetbuf[SET_PT2_LL_CHECK_TT+sw*SW_SET_NUMBER ].ff==1 )?true:false;
#endif

	#if defined BH_FA_INONE_SW
		//功能模块配置项目表
		{
        ptSet->bTT_SOFT_BH_YB = ((WORD)psetbuf[SET_BHFA+sw*SW_SET_NUMBER].ff==0 )?true:false;
        ptSet->bTT_SOFT_FA_YB = ((WORD)psetbuf[SET_BHFA+sw*SW_SET_NUMBER].ff==1 )?true:false;
        ptSet->bTT_SOFT_GOOSE_YB = ((WORD)psetbuf[SET_BHFA+sw*SW_SET_NUMBER].ff==2 )?true:false;
		#ifdef GD_AREA_ECZD_CHAOZHOU_2022
			ptSet->bTT_SOFT_BH_YB = ptSet->bTT_SOFT_BH_YB_PUB && ptSet->bTT_SOFT_BH_YB;
			ptSet->bTT_SOFT_FA_YB = ptSet->bTT_SOFT_FA_YB_PUB &&  ptSet->bTT_SOFT_FA_YB;
			ptSet->bTT_SOFT_GOOSE_YB = ptSet->bTT_SOFT_GOOSE_YB_PUB && ptSet->bTT_SOFT_GOOSE_YB;
		#endif
			ptSet->bTT_TQ_YB =((((WORD)psetbuf[SET_TQ_HZ+sw*SW_SET_NUMBER].ff==1 )?true:false) && ptSet->bTT_TQ_YB);	 //检同期压板
			ptSet->bTT_JL_YB =((((WORD)psetbuf[SET_AUTO_JL+sw*SW_SET_NUMBER].ff==1 )?true:false) && ptSet->bTT_JL_YB);	 //解列压板
			ptSet->tSwSet[sw].bTT_jl_dy = (ptSet->tSwSet[sw].bTT_jl_dy && ptSet->bTT_JL_YB);
			ptSet->tSwSet[sw].bTT_jl_hz = (ptSet->tSwSet[sw].bTT_jl_hz && ptSet->bTT_JL_YB);
			ptSet->bTT_BH_YB=((((WORD)psetbuf[SET_STOP_ALL+sw*SW_SET_NUMBER].ff==0 )?true:false) &&  ptSet->bTT_BH_YB);	 //保护功能总压板
			ptSet->bTT_EDIT_YB = ((WORD)psetbuf[SET_YF+sw*SW_SET_NUMBER].ff==1 )?true:false;								//远方投退软压板
		}
	#endif

	#ifdef FUN_JDXX 
		{// 接地选线定值
			JDXX_SET *poc = &tJDXX_val[sw];
			poc->bTT_jdxx_gj=(((WORD)psetbuf[SET_JDXXGJ_TT+sw*SW_SET_NUMBER].ff==1 )?true:false);				// 投退字
			poc->bTT_jdxx_tz=(((WORD)psetbuf[SET_JDXXTZ_TT+sw*SW_SET_NUMBER].ff==1 )?true:false);				// 投退字
			poc->bTT_jdxx=poc->bTT_jdxx_gj||poc->bTT_jdxx_tz;
			poc->bTT_jdxx_cph= (((WORD)psetbuf[SET_JDXX_CPH_TT+sw*SW_SET_NUMBER].ff==1 )?true:false);			//选相投退字
			poc->bTT_jdxx=poc->bTT_jdxx_gj||poc->bTT_jdxx_tz; 
			poc->bTT_jdxx_p0dir= (((WORD)psetbuf[SET_JDXX_P0_TT+sw*SW_SET_NUMBER].ff==1 )?true:false);			//零序功率方向投退字

		#ifdef SW_AC_I0S_SAMPLE
			if(g_ui[UI_SW_INDEX(sw,SW_AC_I0s)].chn_index!=CFG_ADC_CHANNEL_ZERO)
			{
				poc->jd_zero=(short)(psetbuf[SET_JDXX_ZERO+sw*SW_SET_NUMBER].ff*g_ui[UI_SW_INDEX(sw,SW_AC_I0s)].m2_factor_k/256.0+0.5); // 高精度零序零漂值 码值
				poc->jd_qdval=(short)(psetbuf[SET_JDXX_QD+sw*SW_SET_NUMBER].ff*g_ui[UI_SW_INDEX(sw,SW_AC_I0s)].m2_factor_k/256.0+0.5);	  //高精度零序启动值,转为电流对应的码值
				poc->jd_qdval2=GetSetSQR(psetbuf[SET_JDXX_QD+sw*SW_SET_NUMBER].ff,g_ui[UI_SW_INDEX(sw,SW_AC_I0s)].m2_factor_k/256.0); 
				poc->jd_ov_val=(short)(0.5*g_ui[UI_SW_INDEX(sw,SW_AC_I0s)].m2_factor_k/256.0+0.5);	  //高精度零序 1.9A满偏，采用1.7A作为满偏定值
				poc->jd_ov_val2=GetSetSQR(0.3,g_ui[UI_SW_INDEX(sw,SW_AC_I0)].m2_factor_k/256.0);
				poc->i0_chan=UI_SW_INDEX(sw,SW_AC_I0s);
			}
			else
		#endif
			{
				poc->jd_zero=(short)(psetbuf[SET_JDXX_ZERO+sw*SW_SET_NUMBER].ff*g_ui[UI_SW_INDEX(sw,SW_AC_I0)].m2_factor_k/256.0+0.5); // 高精度零序零漂值 码值
				poc->jd_qdval=(short)(psetbuf[SET_JDXX_QD+sw*SW_SET_NUMBER].ff*g_ui[UI_SW_INDEX(sw,SW_AC_I0)].m2_factor_k/256.0+0.5);	  //高精度零序启动值,转为电流对应的码值
				poc->jd_qdval2=GetSetSQR(psetbuf[SET_JDXX_QD+sw*SW_SET_NUMBER].ff,g_ui[UI_SW_INDEX(sw,SW_AC_I0)].m2_factor_k/256.0); 
				poc->i0_chan=UI_SW_INDEX(sw,SW_AC_I0);
			}
		  
			poc->jd_qdPoints=(WORD)psetbuf[SET_JDXX_QDPOINTS+sw*SW_SET_NUMBER].ff;
			poc->jd_surePoints=(WORD)psetbuf[SET_JDXX_SUREPOINTS+sw*SW_SET_NUMBER].ff;
			poc->jd_faultPoints=(WORD)psetbuf[SET_JDXX_FAULTPOINTS+sw*SW_SET_NUMBER].ff; 
			poc->jd_voltype=tSwSetTable[SET_JDXX_VOLTYPE].list[(WORD)psetbuf[SET_JDXX_VOLTYPE+sw*SW_SET_NUMBER].ff].dat;
			poc->jd_volzero=(WORD)(psetbuf[SET_JDXX_VOLZERO+sw*SW_SET_NUMBER].ff*g_ui[poc->jd_voltype].m2_factor_k/256.0+0.5);				
			poc->jd_U0gl=GetSetSQR(psetbuf[SET_JDXX_U0+sw*SW_SET_NUMBER].ff,g_ui[poc->jd_voltype].m2_factor_k/256.0);
			poc->jd_U0gl_fh = _Mul_Div_U(poc->jd_U0gl,	96, 100);
			poc->jd_trip_time=GetSetTIME(psetbuf[SET_JDXX_TRIP_TIME+sw*SW_SET_NUMBER].ff);
			poc->jd_alarm_time=GetSetTIME(psetbuf[SET_JDXX_GJ_TIME+sw*SW_SET_NUMBER].ff);
		}
	#endif

	#ifdef FUNC_DRIVE_JY
		ptSet->tSwSet[sw].bTT_drive = ((WORD)psetbuf[SET_DRIVE+sw*SW_SET_NUMBER].ff==1)?true:false; //不停电传动功能软压板
		
		ptSet->tSwSet[sw].dU_drive_ua1 = (psetbuf[SET_UA1+sw*SW_SET_NUMBER].ff);
		ptSet->tSwSet[sw].dU_drive_ua2 = (psetbuf[SET_UA2+sw*SW_SET_NUMBER].ff);
		ptSet->tSwSet[sw].dU_drive_u0 = (psetbuf[SET_U0+sw*SW_SET_NUMBER].ff);
		
		ptSet->tSwSet[sw].dU_drive_i = (psetbuf[SET_I+sw*SW_SET_NUMBER].ff);
		ptSet->tSwSet[sw].dU_drive_i0 = (psetbuf[SET_I0+sw*SW_SET_NUMBER].ff);
		
		ptSet->tSwSet[sw].dT_drive_ua1 = GetSetTIME(psetbuf[SET_DRIVE_UA1_T+sw*SW_SET_NUMBER].ff);
		ptSet->tSwSet[sw].dT_drive_ua2 = GetSetTIME(psetbuf[SET_DRIVE_UA2_T+sw*SW_SET_NUMBER].ff);
		ptSet->tSwSet[sw].dT_drive_u0 = GetSetTIME(psetbuf[SET_DRIVE_U0_T+sw*SW_SET_NUMBER].ff);
		ptSet->tSwSet[sw].dT_drive_i = GetSetTIME(psetbuf[SET_DRIVE_I_T+sw*SW_SET_NUMBER].ff);
		ptSet->tSwSet[sw].dT_drive_i0 = GetSetTIME(psetbuf[SET_DRIVE_I0_T+sw*SW_SET_NUMBER].ff);
		ptSet->tSwSet[sw].dT_drive_again = GetSetTIME(psetbuf[SET_DRIVE_AGAIN_T+sw*SW_SET_NUMBER].ff);
	#endif

    }
    // 无压定值为0.3倍的电压值
    ptSet->dU02V_SQR    =(DWORD)rt_round((0.8*fKU[PUB_AC_U01])*(0.8*fKU[PUB_AC_U01]));  // 16电压
#if 0
    ptSet->dVOL10V_SQR  =(DWORD)rt_round((10.0*fKU[PUB_AC_UAB1])*(16.0*fKU[PUB_AC_UAB1]));  // 16电压
    ptSet->dVOL16V_SQR  =(DWORD)rt_round((16.0*fKU[PUB_AC_UAB1])*(16.0*fKU[PUB_AC_UAB1]));  // 16电压
    ptSet->dVOL50V_SQR  =(DWORD)rt_round((50.0*fKU[PUB_AC_UAB1])*(50.0*fKU[PUB_AC_UAB1]));  // 70电压
    ptSet->dVOL90V_SQR  =(DWORD)rt_round((90.0*fKU[PUB_AC_UAB1])*(90.0*fKU[PUB_AC_UAB1]));  // 64电压
    ptSet->dVOL70V_SQR  =(DWORD)rt_round((70.0*fKU[PUB_AC_UAB1])*(70.0*fKU[PUB_AC_UAB1]));  // 64电压
#else
    ptSet->dVOL10V_SQR  =(DWORD)rt_round((0.1*fUn*fKU[PUB_AC_UAB1])*(0.1*fUn*fKU[PUB_AC_UAB1]));    // 10电压
    ptSet->dVOL16V_SQR  =(DWORD)rt_round((0.16*fUn*fKU[PUB_AC_UAB1])*(0.16*fUn*fKU[PUB_AC_UAB1]));  // 16电压
    ptSet->dVOL50V_SQR  =(DWORD)rt_round((0.5*fUn*fKU[PUB_AC_UAB1])*(0.5*fUn*fKU[PUB_AC_UAB1]));    // 70电压
    ptSet->dVOL90V_SQR  =(DWORD)rt_round((0.9*fUn*fKU[PUB_AC_UAB1])*(0.9*fUn*fKU[PUB_AC_UAB1]));    // 64电压
    ptSet->dVOL70V_SQR  =(DWORD)rt_round((0.7*fUn*fKU[PUB_AC_UAB1])*(0.7*fUn*fKU[PUB_AC_UAB1]));    // 64电压

#endif
	//转换当前运行定值的镜象，做定值有效性检查时用
	{
		BYTE *pBak = (BYTE *)&tBakSet;
		BYTE *pRun = (BYTE *)ptSet;
		int i = sizeof(struct TSET);
		for(; i>0; i--)
		{
			*pBak++=~*pRun++;
		}
	}
	pRunSet=ptSet;	// 将运行定值切换

	bRunSetModify=true;	

	if((histrory_file_set && pRunSet->bTT_HistoryFile)||b_hisfile_format)
	{
		hf_init();
		init_hs_file(b_hisfile_format && !bFirst);
	}
	else
	{
		for(i=0;i<HS_FILE_NUM;i++)
		{
			p_his_file[i] = pRunSet->bTT_MsgFile?(char*)history_file_name[i][0]:(char*)history_file_name[i][1];
		}
	}

	m_runsection=pRunSet->section;

	create_set_data_txt();	
	return bRet;
}
/******************************************************************************
函数名称：	print_EquipParaTable
函数版本：	01.01
创建作者：	 
创建日期：	 
函数说明：	打印装置参数.
参数说明：	
			
返回值：  	成功返回0，失败返回负数
修改记录：	
*/
int print_EquipParaTable(void)
{
	SET_VALUE *psetbuf=m_SetBuf;
	TSETTABLE *pTable;
	DWORD dat,dw;
	int i;

	if(!ReadPara((void*)psetbuf,EEP_EQUIP_PARA_ADDR,EQUIP_PARA_NUMBER,&tEquipParaTable[0]))
	{
		rt_printf("读取装置参数发生错误!\r\n");
		return -1;
	}
	rt_printf("装置参数:\r\n");
	rt_printf("序号\t名称\t\t\t\t当前值\r\n");
	for(i=0;i<PARA_NUM;i++)
	{
		pTable = (TSETTABLE *)&tEquipParaTable[i];
		dat = (DWORD) psetbuf[i].ff;
		rt_printf("%d\t%-20s\t\t", i+1, pTable->szName);


		switch(pTable->wType)
		{
			case SETTYPE_F:
				rt_printf("%f", psetbuf[i].ff);
				break;
			case SETTYPE_UINT:   //16进制显示  控制字
				rt_printf("%d", dat);
				break;
			case SETTYPE_4INT:   //10进制显示  4位
				rt_printf("%d", dat);
				break;
			case SETTYPE_5INT:   //10进制显示  5位
				rt_printf("%d", dat);
				break;
			case SETTYPE_LINT:   //16进制显示  控制字
				rt_printf("%d", dat);
				break;
			case SETTYPE_LIST:   //列表选择 
				{
					dw = (WORD)(psetbuf[i].ff);					//通信规约
					rt_printf("%s", tEquipParaTable[i].list[dw].str);
				}
				break;
			case SETTYPE_IP:
				{
					dat = (DWORD) psetbuf[i].tt;
					rt_printf("%d.%d.%d.%d", (dat>>24)&0xFF, (dat>>16)&0xFF, (dat>>8)&0xFF, (dat>>0)&0xFF);	
				}
				break;
			case SETTYPE_YMD:
				{
					struct timespec ts;
					struct rtc_time_t tTime;

					memset(&ts, 0, sizeof(ts));
					memset(&tTime, 0, sizeof(tTime));

						// 年月日
					ts.tv_sec = (long)psetbuf[i].tt;	
					timespec_to_rtc(ts,&tTime,1);
					rt_printf("%04d-%02d-%02d", 2000+tTime.year, tTime.month, tTime.day);	

				}
				break;
			case SETTYPE_HMS:
					{
					struct timespec ts;
					struct rtc_time_t tTime;
					extern int timespec_to_rtchms(struct timespec ts, struct rtc_time_t * p_rtc,int is_round);

					memset(&ts, 0, sizeof(ts));
					memset(&tTime, 0, sizeof(tTime));

						// 年月日
					ts.tv_sec = (long)psetbuf[i].tt;	
					timespec_to_rtchms(ts,&tTime,1);
					rt_printf("%02d:%02d:%02d", tTime.hour, tTime.min, tTime.ms%1000);	
					
				}			
				break;
			
		}

		rt_printf("\r\n");
		
	}
	return 0;
}
/******************下面是关于装置参数读取及校验的操作********************************/
/******************************************************************************
函数名称：	string_to_ip
函数版本：	01.01
创建作者：	xxxxxx
创建日期：	2015-01-07
函数说明：	字符串IP转整形IP.
参数说明：	
						s:字符串IP
返回值：  	整形IP。
修改记录：	
*/
static uint32_t string_to_ip(char *s)
{
	uint32_t addr;
	char *e;
	int i;

	if (s == NULL)
		return(0);

    for (addr=0, i=0; i<4; ++i)
    {
        uint32_t val = s ? simple_strtoul(s, &e, 10) : 0;
        addr <<= 8;
        addr |= (val & 0xFF);
        if (s)
        {
            s = (*e) ? e+1 : e;
        }
    }

	return (htonl(addr));
}

/******************************************************************************
函数名称：	notify_sock_close
函数版本：	01.01
创建作者：	xxxxxx
创建日期：	2015-02-28
函数说明：	通知相关socket要关闭.
参数说明：	
						bFirstInit:是否第一次初始化.true表示是第一次.false表示不是第一次.	
返回值：  	无。
修改记录：	
*/
static void notify_sock_close(bool bFirstInit)
{
	int i = 0;	
	RUN_PARA *pRunPara=&tRunPara;
	
	//for(i=0;i<g_net_num;i++)
	for(i=0;i<CFG_ETH_MAX_LOGIC;i++)
	{
		//已经修改网络参数
		if(pRunPara->tNetPara[i].bInit)
		{
			//非第一次
			if(!bFirstInit )
			{
				net_maintain_set_sock_closing(i);	
				net_debug_set_sock_closing(i);	
				net_104_set_sock_closing(i);	

			}
		} 
		else
		{
			if(pRunPara->sock_104_flag && (!bFirstInit))
			{
				net_104_set_sock_closing(i);		
			}
		}
		
		
	}
	
}

/******************************************************************************
函数名称：	get_ethcnt
函数版本：	01.01
创建作者：	xxxxxx
创建日期：	2016-03-29
函数说明：	获取在序号no之前有多少个eth_id
参数说明：	
			no:tRunPara.tNetPara数组下标
			eth_id: 以太网卡序号(从0开始)
返回值：  	无。
修改记录：	
*/
int  get_ethcnt(int no, int eth_id)
{
	int ret = 0;
	int i;

	for(i=0;i<no;i++)
	{
		if((int)tRunPara.tNetPara[i].ethid==eth_id) 	
		{
			ret++;
		}
	}

	return ret;
}
enum
{
	RMT_DEAD_I=0,
	RMT_DEAD_U,
	RMT_DEAD_ZL,
	RMT_DEAD_PQ,
	RMT_DEAD_F,
	RMT_DEAD_COS,	
	RMT_DEAD_NUM
};

int get_rmtparatype(u8 sw,u8 index)
{
	u8 unit;
	index-=1;
	if(sw==0)
	{
		unit=g_pub_ac_desc[index].unit;
	}
	else
	{
		unit=g_sw_ac_desc[index].unit;
	}
	if(unit==UNIT_V100  ||unit==UNIT_V220 ||unit==UNIT_V001)   return RMT_DEAD_U;
	else if(unit==UNIT_A5  ||unit==UNIT_A1 ||unit==UNIT_BIA||unit==UNIT_I0A)   return RMT_DEAD_I;
	else if(unit==UNIT_W ||unit==UNIT_Var||unit==UNIT_kW ||unit==UNIT_kVar)   return RMT_DEAD_PQ;
	else if(unit==UNIT_Hz)   return RMT_DEAD_F;
	else if(unit==UNIT_COS)   return RMT_DEAD_COS;
	else if(unit==UNIT_V050)   return RMT_DEAD_ZL;
	return -1;
}

void GetDefDebugNetPara(void)
{
	SET_VALUE *psetbuf=m_SetBuf;
	

	if(g_debugnet_ip > 0)
	{
		psetbuf[PARA_IP_NET1+(CFG_ETH_MAX_LOGIC-1)*6].tt =g_debugnet_ip;
	}
	if(g_debugnet_mask > 0)
	{
		psetbuf[PARA_MA_NET1+(CFG_ETH_MAX_LOGIC-1)*6].tt =g_debugnet_mask;
	}
	if(g_debugnet_gate > 0)
	{
		psetbuf[PARA_GATE_NET].tt =g_debugnet_gate;
	}

	
}
#if (1)
void eth0_debug_ip_setup(void)//设置网口1虚拟网络IP地址
{
	char *argv[] = {"/sbin/ifconfig", "eth0:3", "192.168.64.240", NULL};
	char *envp[] = { NULL };

	call_usermodehelper(argv[0], argv, envp, UMH_WAIT_PROC);
}
#endif
void MakeRunPara(bool bFirstInit, bool bUboot)
{
	int i;
	SET_VALUE *psetbuf=m_SetBuf;
	RUN_PARA *pRunPara=&tRunPara;
	DWORD dat,dw;
	u8 hmi_protocol = 0;
	u8 fault_protocol = 0;
	u8 protocol[CFG_UART_NUM_MAX] = {0};

	int debug_port = 0;
	char * acteth;
	uint32_t ip,mask,gate;
	unsigned int serverip = 0;
	int tm  = 0;
#ifdef 	SNTP_FUNC	
	extern int sntp_setpara(unsigned int serverip, int tm);
#endif

#ifdef METERING_ENERGY
	bool b_ll_file;
#endif

	#ifdef GD_TEST_2021  // 将电流零漂分开成相电流零漂和零序电流零漂
		s32 phase_i_zero,zero_i_zero;
	#endif

	if(!ReadPara((void*)psetbuf,EEP_EQUIP_PARA_ADDR,EQUIP_PARA_NUMBER,&tEquipParaTable[0]))
	{
		rt_err_set(ERR_CODE_EQU_PARA,0);
		GetDefPara((void*)psetbuf,EQUIP_PARA_NUMBER,&tEquipParaTable[0]);		
	}
	else
	{
		rt_err_clr(ERR_CODE_EQU_PARA,0);
	}

	for(i=0;i<CFG_UART_NUM_MAX;i++)
	{
		dw = (WORD)(psetbuf[PARA_PROTOCOL_S1+i*3].ff);					//通信规约
		dat = (WORD)tEquipParaTable[PARA_PROTOCOL_S1+i*3].list[dw].dat;
		if(pRunPara->tUartPara[i].wProtocol!=dat)
		{
			pRunPara->tUartPara[i].wProtocol=dat;
			pRunPara->tUartPara[i].bInit=true;
		}

		dw = (WORD)(psetbuf[PARA_BAUD_S1+i*3].ff);					// 波特率
		dat = (DWORD)tEquipParaTable[PARA_BAUD_S1+i*3].list[dw].dat;
		if(pRunPara->tUartPara[i].dBaud!=dat)
		{
			pRunPara->tUartPara[i].dBaud=dat;
			pRunPara->tUartPara[i].bInit=true;
		}
		
		dw = (WORD)(psetbuf[PARA_PARITY_S1+i*3].ff);					// 校验位
		dat = (WORD)tEquipParaTable[PARA_PARITY_S1+i*3].list[dw].dat;
		if(pRunPara->tUartPara[i].wParity!=dat)
		{
			pRunPara->tUartPara[i].wParity=dat;
			pRunPara->tUartPara[i].bInit=true;
		}
		pRunPara->tUartPara[i].b101PH=((((WORD)(psetbuf[PARA_PROTOCOL_S1+i*3].ff))==PROTOCOL_101_PH)
								||(((WORD)(psetbuf[PARA_PROTOCOL_S1+i*3].ff))==PROTOCOL_MAINTAIN))?true:false;		// 101为平衡式
		if(bFirstInit)pRunPara->tUartPara[i].bInit=true;		//第一次初始化，置通道初始化标志

		if(pRunPara->tUartPara[i].wProtocol == PROTOCOL_HMI)
		{
			protocol[hmi_protocol] = i;
			hmi_protocol++;
		}
		if(pRunPara->tUartPara[i].wProtocol == PROTOCOL_FAULT)
		{
			fault_protocol++;
		}
	}

	// 判断是否有多个串口配置为面板或状态板
	if (hmi_protocol > 1)
	{
		for(i=0; i<hmi_protocol; i++)
		{
			if (UART_CHANNEL[protocol[hmi_protocol]] != CFG_UART_HMI)
			{
				// 有多个时，除RS232_3外，都配置为平衡101
				pRunPara->tUartPara[protocol[hmi_protocol]].wProtocol = 1;
			}
		}
		rt_printf("面板配置超限制 \n");
	}
	if (fault_protocol > 1)
	{
		rt_err_set(ERR_CODE_FAULT_BOARD,0);
	}
	else
	{
		rt_err_clr(ERR_CODE_FAULT_BOARD,0);
	}
	//从环境变量得到调试网口
	acteth = env_get_info(ENV_ETHACT);
	if(acteth != NULL)
	{
		if(strcmp(acteth,"FEC0") == 0)
		{
			debug_port = 0;	
		}
		else if(strcmp(acteth,"FEC1") == 0)
		{
			debug_port = 1;	
		}
		else if(strcmp(acteth,"DM9000") == 0)
		{
			debug_port = 2;	
		} 
		else 
		{			
			debug_port = 2;					
		}
	}
	else 
	{	
		debug_port = 2;
	}

	//从环境变量得到IP地址
	ip = string_to_ip(env_get_info(ENV_IPADDR));
	Swap_32(&ip);

	//从环境变量得到MASK
	mask = string_to_ip(env_get_info(ENV_NETMASK));
	Swap_32(&mask);

	//从环境变量得到默认网关
	gate = string_to_ip(env_get_info(ENV_GATEWAYIP));
	Swap_32(&gate);

	for(i=0;i<CFG_ETH_MAX_LOGIC;i++)
	{	
		pRunPara->tNetPara[i].changed = 0; //清零
		
		dat = (DWORD)(psetbuf[PARA_NET1+i*6].ff); //物理网卡序号
		if(pRunPara->tNetPara[i].ethid!=dat)
		{
			pRunPara->tNetPara[i].ethid=dat;
			pRunPara->tNetPara[i].bInit=true;
			if(!bUboot)
			{
				//网口已经改变,标志需要将网口写到UBOOT中
				pRunPara->tNetPara[i].changed |= 1 << 6;
			}			
		}
		
		
		dat= (DWORD)(psetbuf[PARA_IP_NET1+i*6].tt);	
		if(pRunPara->tNetPara[i].wIp!=dat)
		{
			pRunPara->tNetPara[i].wIp=dat;
			pRunPara->tNetPara[i].bInit=true;
			if(!bUboot)
			{
				//IP已经改变,标志需要将IP写到UBOOT中
				pRunPara->tNetPara[i].changed |= 1 << 0;
			}
			
		}	 
	
		dat= (DWORD)(psetbuf[PARA_GATE_NET].tt);					
		if(pRunPara->tNetPara[i].wGate!=dat)
		{
			pRunPara->tNetPara[i].wGate=dat;
			pRunPara->tNetPara[i].bInit=true;
	
			if(!bUboot)
			{
				//网关已经改变,标志需要将网关写到UBOOT中
				pRunPara->tNetPara[i].changed |= 1 << 1;
			}
		}		
		dat= (DWORD)(psetbuf[PARA_MA_NET1+i*6].tt);		
		if(pRunPara->tNetPara[i].wMask!=dat)
		{
			pRunPara->tNetPara[i].wMask=dat;
			pRunPara->tNetPara[i].bInit=true;
			if(!bUboot)
			{
				//MASK已经改变,标志需要将MASK写到UBOOT中
				pRunPara->tNetPara[i].changed |= 1 << 2;
			}
		}		

		//网段
		dat= (DWORD)(psetbuf[PARA_ROUTE_NET1+i*6].tt);		
		if(pRunPara->tNetPara[i].wRouteNet!=dat)
		{
			pRunPara->tNetPara[i].wRouteNet=dat;
			pRunPara->tNetPara[i].bInit=true;
			if(!bUboot)
			{
				//MASK已经改变,标志需要将MASK写到UBOOT中
				pRunPara->tNetPara[i].changed |= 1 << 3;
			}
		}	

		//网段掩码
		dat= (DWORD)(psetbuf[PARA_ROUTE_NETMASK1+i*6].tt);		
		if(pRunPara->tNetPara[i].wRouteNetMask!=dat)
		{
			pRunPara->tNetPara[i].wRouteNetMask=dat;
			pRunPara->tNetPara[i].bInit=true;
			if(!bUboot)
			{
				//MASK已经改变,标志需要将MASK写到UBOOT中
				pRunPara->tNetPara[i].changed |= 1 << 4;
			}
		}


		//网关
		dat= (DWORD)(psetbuf[PARA_ROUTE_GATE1+i*6].tt);		
		if(pRunPara->tNetPara[i].wRouteGate!=dat)
		{
			pRunPara->tNetPara[i].wRouteGate=dat;
			pRunPara->tNetPara[i].bInit=true;
			if(!bUboot)
			{
				//MASK已经改变,标志需要将MASK写到UBOOT中
				pRunPara->tNetPara[i].changed |= 1 << 5;
			}
		}


        if(bFirstInit)
        {
            pRunPara->tNetPara[i].bInit=true; //第一次初始化，置通道初始化标志
#if (1) //第一次初始化网络号和索引号默认同步
            pRunPara->tNetPara[i].old_ethid=pRunPara->tNetPara[i].ethid;
            pRunPara->tNetPara[i].old_index=pRunPara->tNetPara[i].index;
#endif
        }

#ifndef CPU_FUXI
        //如果是调式网口并且是第一次初始化(包括恢复出厂设置)
        //if((debug_port==i) && bUboot)
        if(((CFG_ETH_MAX_LOGIC-1)==i) && bUboot)
        {
            uint32_t value = 0;
            int bflag = 0;

#ifndef  (0)
            value = pRunPara->tNetPara[i].ethid;
            //UBOOT的ethact与e2prom.bin中保存的不一致
            if(debug_port != value)
            {
                pRunPara->tNetPara[i].ethid=debug_port;
                //pRunPara->tNetPara[i].bInit = false;
                psetbuf[PARA_NET1+i*6].ff = debug_port;
                bflag = 1;
            }
#endif
            value=pRunPara->tNetPara[i].wIp;
            //UBOOT的IP与e2prom.bin中保存的IP不一致
            if(ip != value)
            {
                pRunPara->tNetPara[i].wIp= ip;
                //pRunPara->tNetPara[i].bInit = false;
                psetbuf[PARA_IP_NET1+i*6].tt =ip;
                bflag = 1;

			}	
			value=pRunPara->tNetPara[i].wGate;
			//UBOOT的网关与e2prom.bin中保存的网关不一致
			if(gate != value)
			{
				pRunPara->tNetPara[i].wGate = gate ;
				//pRunPara->tNetPara[i].bInit = false;
				psetbuf[PARA_GATE_NET].tt = gate;
				bflag = 1;
			}			
			value=pRunPara->tNetPara[i].wMask;
			//UBOOT的MASK与e2prom.bin中保存的MASK不一致
			if((mask != value) && (value != 0))
			{
				pRunPara->tNetPara[i].wMask =mask;
				//pRunPara->tNetPara[i].bInit = false;
				psetbuf[PARA_MA_NET1+i*6].tt = mask;
				bflag = 1;
			}				
			
			if(bflag)
			{
				//如果是恢复出厂设置，这个要注意。在恢复出厂设置时,m_SetBuf[PARA_IP_NET1+(CFG_ETH_MAX_LOGIC-1)*6].tt
				//等这样的值已经被恢复默认值。这个默认值可能不是我们修改后的值，所以需要改变，才能确保正确
				GetDefDebugNetPara();			
				//将UBOOT中的IP, 网关, MASK写到e2prom.bin
				SavePara((void *)m_SetBuf,EEP_EQUIP_PARA_ADDR,EQUIP_PARA_NUMBER,&tEquipParaTable[0]);
			}
			
						
		}
#endif

	}

#if (1)
	eth0_debug_ip_setup();
#endif

	//保存调试网口的IP,子网掩码
	g_debugnet_ip = psetbuf[PARA_IP_NET1+(CFG_ETH_MAX_LOGIC-1)*6].tt;
	g_debugnet_mask = psetbuf[PARA_MA_NET1+(CFG_ETH_MAX_LOGIC-1)*6].tt;
	g_debugnet_gate= psetbuf[PARA_GATE_NET].tt;
	
	// 如果端口和主站IP有修改，需重新初始化104连接。
	pRunPara->sock_104_flag = false;
	
	//104端口判断
	dat= (WORD)psetbuf[PARA_104_PORT].ff; //104协议端口号
	if(pRunPara->w104Port != dat)
	{
		pRunPara->sock_104_flag=true;		
	}

	//104主站IP1地址改变
	dat = (DWORD)(psetbuf[PARA_IP_104MASTER1].tt);		
	if(pRunPara->ip104Master1!=dat)
	{
		//104 socket需重新初始化
		pRunPara->sock_104_flag=true;		
	}

	//104主站IP2地址改变
	dat = (DWORD)(psetbuf[PARA_IP_104MASTER2].tt);
	if(pRunPara->ip104Master2 != dat)
	{
		//104 socket需重新初始化
		pRunPara->sock_104_flag=true;	
	}	

	//104主站IP3地址改变
	dat = (DWORD)(psetbuf[PARA_IP_104MASTER3].tt);		
	if(pRunPara->ip104Master3!=dat)
	{
		//104 socket需重新初始化
		pRunPara->sock_104_flag=true;		
	}
	
	//104主站IP4地址改变
	dat = (DWORD)(psetbuf[PARA_IP_104MASTER4].tt);		
	if(pRunPara->ip104Master4!=dat)
	{
		//104 socket需重新初始化
		pRunPara->sock_104_flag=true;		
	}

	
	pRunPara->byAddr=(WORD)psetbuf[PARA_ADDR].ff;					//装置地址	
	pRunPara->fYcTime=psetbuf[PARA_YCTIME].ff;						// 遥测主动发送间隔
	pRunPara->dYKTime=GetSetTIME(psetbuf[PARA_YK_TIME].ff);	 		// 遥控超时
	pRunPara->dSM2Time=(DWORD)rt_round(psetbuf[PARA_YK_TIME].ff);	// 加密遥控超时
	dido_qd_set_keeptime(pRunPara->dSM2Time*USTIMER_SEC);				// 以遥控超时作为启动继电器超时

	if(sizeof(SYSTEM_DATA)==EEP_SYSTEM_DATA_SIZE)
		ReadSysData(&pRunPara->sysData);
	else
		rt_printf("SYSTEM_DATA define error!\r\n ");
	pRunPara->wPassword=ReadPassword(); 							//装置密码

	pRunPara->bGPS=(((WORD)(psetbuf[PARA_TIMETYPE].ff))==1)?true:false;		//对时方式，默认是网络对时

	pRunPara->set_time_mode=(WORD)(psetbuf[PARA_TIMETYPE_STANDER].ff);		//标准化对时方式选择
	// 全方式对时或者仅卫星对时都使能卫星同步
	pRunPara->bGPS_sync_enable=(pRunPara->set_time_mode==0||pRunPara->set_time_mode==1)?true:false;
	pRunPara->GPS_sync_time=(WORD)(psetbuf[PARA_GPS_INTERVAL].ff); 			//卫星对时时间隔
	pRunPara->GPS_switch_delay=(WORD)(psetbuf[PARA_CHANGETIME].ff); 		//无卫星信号对时切换延时

#ifndef CPU_FUXI	
	clk_mode_set((int)(psetbuf[PARA_TIMETYPE].ff));
#endif
	pRunPara->bDPI=(((WORD)(psetbuf[PARA_YXTYPE].ff))==1)?true:false;		//遥信双点上送
	pRunPara->bSDPI=(((WORD)(psetbuf[PARA_YXTYPE].ff))==2)?true:false;		//遥信单双点上送
	pRunPara->YKtype = rt_round(psetbuf[PARA_YKTYPE].ff);					// 遥控类型
	pRunPara->bYcBDH=(((WORD)(psetbuf[PARA_YCTYPE].ff))==1)?true:false;		//遥测标度化值上送
	pRunPara->bYcFloat=(((WORD)(psetbuf[PARA_YCTYPE].ff))==2)?true:false;		//遥测浮点数上送
	
	pRunPara->b101Addr2Byte=(((WORD)(psetbuf[PARA_101LINKADDR].ff))==1)?true:false;		// 101为双字节地址
	pRunPara->b101App2Byte=(((WORD)(psetbuf[PARA_101APPADDR].ff))==1)?true:false;		// 101应用单元
	pRunPara->b101Cot2Byte=(((WORD)(psetbuf[PARA_101COT].ff))==1)?true:false;		// 101为双字节地址

	pRunPara->bAutoSendYc=(((WORD)(psetbuf[PARA_YCAUTO].ff))==1)?true:false;		// 遥测自动上送
	pRunPara->bDeadType=(((WORD)(psetbuf[PARA_YC_DEAD_TYPE].ff))==0)?true:false;	//规约死区上传类型
	pRunPara->bAutoCos=(((WORD)(psetbuf[PARA_COSAUTO].ff))==1)?true:false;		// COS自动上送
	pRunPara->bEvPara=(((WORD)(psetbuf[PARA_EVPARA].ff))==1)?true:false;		// 事件参数上送
	
	pRunPara->dTRstT=GetSetTIME(psetbuf[PARA_RSTTIME].ff*60);
	pRunPara->bAutoRst=(((WORD)(psetbuf[PARA_RST_TT].ff))==1)?true:false;		// 自动复归投退	
#ifdef	RCD_STRAN_M_EN
	pRunPara->b_lb_master = (((WORD)(psetbuf[PARA_LB_MASTER_TT].ff))==1)?true:false;	// 级联录波主站使能投退
#endif
#ifdef YPARA_LINK_S_EN
	pRunPara->b_ypar_slave = (((WORD)(psetbuf[PARA_YPAR_CHG_TT].ff))==1)?true:false;	// 参数变化通知使能
#endif
	dat = (DWORD)rt_round(psetbuf[PARA_BATBEGIN_YMD].tt) + (DWORD)rt_round(psetbuf[PARA_BATBEGIN_HMS].ff*3600);

#ifdef YX_RESET_TIME
	pRunPara->dTEventRst=GetSetTIME(psetbuf[PARA_EVTRSTTIME].ff);
	pRunPara->fT_LBXH_RST= psetbuf[PARA_EVTRSTTIME].ff;
#endif
	if(pRunPara->dTBatBegin != dat)
	{
		pRunPara->dTBatBegin = dat;
		bat_begin_time();		// 修改电池活化启动时间
	}
	pRunPara->dTBatInterval=(DWORD)rt_round(psetbuf[PARA_BAT_INTERVAL].ff*24*3600);		//小时数

	pRunPara->bat_alarm = psetbuf[PARA_BAT_ALARM].ff;


	fresh_set_soe(EV_TT_BAT,(pRunPara->dTBatInterval>0?true:false), bFirstInit,0);	
	

	pRunPara->dLightTime=GetSetTIME(psetbuf[PARA_LHTTIME].ff);					//背光时间默认1分钟
	pRunPara->dMainTime=GetSetTIME(psetbuf[PARA_LHTTIME].ff);						//返回时间默认3分钟
	pRunPara->dLinkStateCh = (WORD)(psetbuf[PARA_LINK_STATE].ff);		// 级联状态通道	
	pRunPara->w104Port     = (WORD)psetbuf[PARA_104_PORT].ff;			// 104协议端口号
	pRunPara->w104AckTime  = (WORD)psetbuf[PARA_104_ACK_TIME].ff;		// 104确认超时	
	pRunPara->w104TestTime = (WORD)psetbuf[PARA_104_TEST_TIME].ff;		// 104测试超时
	pRunPara->w104K 	   = (WORD)psetbuf[PARA_104_K].ff*2;			// 104 K值
	pRunPara->w104W 	   = (WORD)psetbuf[PARA_104_W].ff*2;			// 104 W值
	pRunPara->ip104Master1 = (DWORD)(psetbuf[PARA_IP_104MASTER1].tt);	// 104主站IP1
	pRunPara->ip104Master2 = (DWORD)(psetbuf[PARA_IP_104MASTER2].tt);	// 104主站IP2
	pRunPara->ip104Master3 = (DWORD)(psetbuf[PARA_IP_104MASTER3].tt);	// 104主站IP3
	pRunPara->ip104Master4 = (DWORD)(psetbuf[PARA_IP_104MASTER4].tt);	// 104主站IP4
	pRunPara->b104Client=(((WORD)(psetbuf[PARA_104_Client].ff))==1)?true:false;		// 104是客户端还是服务器端
	pRunPara->ip104Master[0]=pRunPara->ip104Master1;
	pRunPara->ip104Master[1]=pRunPara->ip104Master2;
	pRunPara->ip104Master[2]=pRunPara->ip104Master3;
	pRunPara->ip104Master[3]=pRunPara->ip104Master4;
	for(i=0; i<CFG_LINK_104_NUM; i++)
	{
		pRunPara->ip104Link[i] = (DWORD)(psetbuf[PARA_IP_104LINK1+i].tt);// 104级联IP
	}

#ifdef METERING_ENERGY
	b_ll_file = (((WORD)psetbuf[PARA_LL_FILE_TT].ff==1 )?true:false);
	if(b_ll_file!=pRunPara->bTT_LLFile)
	{
		ll_file_set = true;
		pRunPara->bTT_LLFile =b_ll_file;
		
	}

	pRunPara->wZDJG = (WORD)psetbuf[PARA_YC_JG_T].ff;//定点保存数据间隔，默认15秒
	pRunPara->wSWID = (WORD)psetbuf[PARA_LL_SW_ID].ff;
	pRunPara->wDDJG = (WORD)psetbuf[PARA_LL_JG_T].ff;
	pRunPara->wMonday = (WORD)psetbuf[PARA_LL_MONTHD_DAY].ff;
	pRunPara->wMonhour = (WORD)psetbuf[PARA_LL_MONTHD_HOUR].ff;

	/*if(histrory_file_set&&pRunPara->bTT_HistoryFile)
	{
		hf_init();
		init_hs_file();
	}*/

	if(ll_file_set&&pRunPara->bTT_LLFile)
	{
		ll_init();
		init_ll_file();
	}
#endif
	/************零漂处理*******************/
	{
		s32 uzero;
	#ifndef GD_TEST_2021
		s32 izero;
	#endif
	
		uzero = (s32)(psetbuf[PARA_U_ZERO].ff*65536);	// 电压零漂
	#ifdef GD_TEST_2021  // 将电流零漂分开成相电流零漂和零序电流零漂
		phase_i_zero = (s32)(psetbuf[PARA_PHASE_I_ZERO].ff*65536);
		zero_i_zero = (s32)(psetbuf[PARA_ZERO_I_ZERO].ff*65536);
	#else
		izero= (s32)(psetbuf[PARA_I_ZERO].ff*65536);	// 电流零漂
	#endif	
		for(i=0;i<UNIT_NUM;i++)
		{
			if(i==UNIT_V100||i==UNIT_V220)
			{
				g_unit[i].zero=uzero;
			}

		#ifdef GD_TEST_2021
			if(i==UNIT_A1 || i==UNIT_A5 || i==UNIT_BIA){
				g_unit[i].zero = phase_i_zero;
			}else if(i == UNIT_I0A){
				g_unit[i].zero = zero_i_zero;	
			}
		#else
			if(i==UNIT_A1||i==UNIT_A5||i==UNIT_BIA)
			{
				g_unit[i].zero=izero;
			}	
		#endif		
		}
	}
#ifdef CPU_FUXI
	pRunPara->wDC_ZERO = psetbuf[PARA_DC_ZERO].ff;
#endif	
	pRunPara->wFAFZT= (DWORD)rt_round(psetbuf[PARA_FZPULSE].ff);
	pRunPara->wFAHZT= (DWORD)rt_round(psetbuf[PARA_HZPULSE].ff);
#if (defined GD_AREA_ZHONGSHAN || defined GD_AREA_ZHONGSHAN_2020) && !defined GD_AREA_ZHONGSHAN_FTU
	pRunPara->gse_id= (WORD)rt_round(psetbuf[PARA_GOOSE_ID].ff)-1;
	pRunPara->gse_T1=GetSetTIME(psetbuf[PARA_GOOSE_T1].ff);
	pRunPara->gse_T2=GetSetTIME(psetbuf[PARA_GOOSE_T2].ff);
#endif

#ifdef FUN_FUXI_ESAM
	pRunPara->s1_mode=(((WORD)(psetbuf[PARA_S1_MODE].ff))==1)?true:false;		// 
	pRunPara->s1_port		= (WORD) (psetbuf[PARA_S1_PORT].ff);			// 104协议端口号	
	pRunPara->s1_nat		= (DWORD)(psetbuf[PARA_S1_NAT].tt);			// 加密芯片IP
	pRunPara->s1_ip			= (DWORD)(psetbuf[PARA_S1_IP].tt);			// 加密芯片IP
	pRunPara->s1_mask		= (DWORD)(psetbuf[PARA_S1_MASK].tt);		// 掩码
	pRunPara->s1_gate 		= (DWORD)(psetbuf[PARA_S1_GATE].tt);		// 网关
	pRunPara->s1_far_ip		= (DWORD)(psetbuf[PARA_S1_FAR_IP].tt);		// 远端IP
	pRunPara->s1_far_mask 	= (DWORD)(psetbuf[PARA_S1_FAR_MASK].tt);	// 掩码
	pRunPara->s1_far_gate 	= (DWORD)(psetbuf[PARA_S1_FAR_GATE].tt);	// 网关
#endif

	/**远动参数处理，死区及跳合闸脉宽，需更新到配置文件中************************/
	if(pRunSet->bTT_RmtPara)
	{
		//"电流死区",		0.0 , 	0.3,			0.01 ,	0,			0,			GROUP_PARA_RMT},
		//"交流电压死区",	0.0 , 	0.3,			0.01 ,	0,			0,			GROUP_PARA_RMT},
		//"直流电压死区",	0.0 , 	0.3,			0.01 ,	0,			0,			GROUP_PARA_RMT},
		//"功率死区",		0.0 , 	0.3,			0.01 ,	0,			0,			GROUP_PARA_RMT},
		//"频率死区",		0.0 , 	0.3,			0.05 ,	0,			0,			GROUP_PARA_RMT},
		//"功率因数死区",	0.0 , 	0.3,			0.01 ,	0,			0,			GROUP_PARA_RMT},
		//遥信防抖时间",	10.0 , 	60000.0,		10.0 ,	0,			0,			GROUP_PARA_RMT},
		//分闸脉冲",		10.0 , 	50000.0,		500.0 ,	0,			0,			GROUP_PARA_RMT},
		//合闸脉冲",		10.0 , 	50000.0,		500.0 ,	0,			0,			GROUP_PARA_RMT},
		int i;
		qs16 deadval[RMT_DEAD_NUM];
	
		if(pRunSet->bTT_YC_DeadZone_All)
		{
			deadval[RMT_DEAD_I]=deadval[RMT_DEAD_U]=deadval[RMT_DEAD_ZL]=\
			deadval[RMT_DEAD_PQ]=deadval[RMT_DEAD_F]=deadval[RMT_DEAD_COS]=\
				(qs16)(psetbuf[PARA_DEAD_ZONE_ALL].ff*65536);	  // 遥测死区
		}
		else
		{
			deadval[RMT_DEAD_I] = (qs16)(psetbuf[PARA_DEAD_I].ff*65536);	  // 电流死区
			deadval[RMT_DEAD_U] = (qs16)(psetbuf[PARA_DEAD_U].ff*65536);	  // 电压死区
			deadval[RMT_DEAD_ZL] = (qs16)(psetbuf[PARA_DEAD_ZL].ff*65536);	  // 直流死区
			deadval[RMT_DEAD_PQ] = (qs16)(psetbuf[PARA_DEAD_P].ff*65536);	  // 功率死区
			deadval[RMT_DEAD_F] = (qs16)(psetbuf[PARA_DEAD_F].ff*65536);	  // 频率死区
			deadval[RMT_DEAD_COS] = (qs16)(psetbuf[PARA_DEAD_COS].ff*65536);	  //功率因数死区
		}
	
		for(i=0;i<g_table_head->ac_num;i++)  // 将定值死区更新到点表数据中
		{
			int type;
			type=get_rmtparatype(g_ac_table[i].owner,g_ac_table[i].indexno);
			if(type>=0&&type<RMT_DEAD_NUM)
			{
			#ifndef PARAM_DEAD_PER
				g_ac_table[i].dead_value=deadval[type]*100;
			#else
				g_ac_table[i].dead_value=deadval[type];
			#endif
			}
		}
		
		{
			int bChanged = 0;
			
			dw = (DWORD)rt_round(psetbuf[PARA_YXFD].ff);
			if(dw != pRunPara->wYXFD)
			{
				pRunPara->wYXFD = dw;
				bChanged = 1;
			}
			dw = (DWORD)rt_round(psetbuf[PARA_FZPULSE].ff);
			if(dw != pRunPara->wFZMC)
			{
				pRunPara->wFZMC = dw;
				bChanged = 1;
			}
			dw = (DWORD)rt_round(psetbuf[PARA_HZPULSE].ff);
			if(dw != pRunPara->wHZMC)
			{
				pRunPara->wHZMC = dw;
				bChanged = 1;
			}

			// 如果不是第一次初始化，且子板参数有变化，复位子板
			if( bFirstInit == 0 && bChanged)
			{
#if defined(BSP_CAN_ENABLE)
				// 复位所有子板
				can_app_reset(0);
#endif
			}

			// 如果是第一次初始化，或子板参数有变化，复位子板
			if( bFirstInit  || bChanged)
			{
				extern int equ_config_di_yd(void);
				extern int equ_config_do_yd(void);
				equ_config_di_yd();
				equ_config_do_yd();
			}
		}
	}	

	//通知socket关闭	
	notify_sock_close(bFirstInit);

	IEC_CommInit() ;        // 串口参数修改外部通信重新初始化 
	Net_Init();   
	tm = (int)(psetbuf[PARA_SNTP_SYNC_TM].ff);
	serverip= (DWORD)(psetbuf[PARA_IP_SNTP].tt);	 
	//设置SNTP同步对时参数
#ifdef 	SNTP_FUNC	
	sntp_setpara(serverip, tm);
#endif

	bRunSetModify=true;
	create_set_data_txt();
}


/***************************************************
函数名称：ReadSysPara
函数版本：1.00 
作者：   
创建日期：2008.8.20    
函数功能说明：读取参数到pf中,并进行CRC-16校验
输入参数：
输出参数：无
返回值： 成功时返回1，否则，0
函数扇入清单：
***************************************************/
bool ReadPara(void *pbuf,DWORD wAddr,WORD num,const  TSETTABLE *pTable)
{
	int i;
	bool ret;
	float *pf=(float*)pbuf;
	ret=ReadEppData(wAddr, (void *) pbuf, (num*4));
	if(!ret)
	{
		return false;
	}	
	for(i=0;i<num;i++)
	{
		if((pTable[i].wType==SETTYPE_IP)
			|| (pTable[i].wType==SETTYPE_YMD)
			|| (pTable[i].wType==SETTYPE_HMS))
		{
			continue; //IP地址方式，不判断最大最小值
		}
		if(CheckFloatSet(&pf[i],pTable[i].fMax,pTable[i].fMin)>0)return false;
	}	
	return true;
}


/**************************************************************************
函数名称：SaveSysPara
函数版本：1.00 
作者：   
创建日期：2008.8.20    
函数功能说明：保存测控参数到EEP中,
输入参数：
输出参数：无
返回值： 成功时返回1，否则，0
函数扇入清单：
***************************************************************************/
bool SavePara(void *pbuf,DWORD wAddr,WORD num,const  TSETTABLE *pTable)
{
	int i;
	bool ret;
	float *pf=(float*)pbuf;
	u8 buf[128];
	
	for(i=0;i<num;i++)
	{
		if((pTable[i].wType==SETTYPE_IP)
			|| (pTable[i].wType==SETTYPE_YMD)
			|| (pTable[i].wType==SETTYPE_HMS))
		{
			continue; //IP地址方式，不判断最大最小值
		}
		if(CheckFloatSet(&pf[i],pTable[i].fMax,pTable[i].fMin)>0)
		{
			sprintf(buf,"%s越限(%f)\r\n",pTable[i].szName, pf[i]);
			rt_printf(buf); 		
			log_str_time(LOG_OPERATE,buf,0,0);	
			return false;
		}
	}	
#ifdef FUN_SET_CHANGE_SOE
		para_change_check_soe(pf, wAddr, num,pTable);	//判断定值变化，上送soe
#endif	

	ret=SaveEppData(wAddr, (void *) pbuf, (num*4));
	if (ret)
	{
		g_creat_set_file |= 0x02;
	}
	return ret;
}


/**************************************************************************
函数名称：GetDefSysPara
函数版本：1.00 
作者：   
创建日期：2008.8.20    
函数功能说明：获得默认定值
输入参数：
输出参数：无
返回值： 
函数扇入清单：
***************************************************************************/
void GetDefPara(float *pbuf, WORD num,const  TSETTABLE *pTable)
{
	int i;
	for(i=0;i<num;i++)
	{
		if((pTable[i].wType==SETTYPE_IP) // 数据类型为IP地址，默认值从pTable[i].list中获取
			|| (pTable[i].wType==SETTYPE_YMD)
			|| (pTable[i].wType==SETTYPE_HMS))
		{
			*((DWORD *)pbuf++)=(DWORD)pTable[i].list;	
		}
		else
		{
			*pbuf++=pTable[i].fDef;
		}	

	}	
}




void GetDefSet(float *pbuf)
{
	int i,sw;	
	for(i=0;i<PUB_SET_NUMBER;i++)		//公共定值
	{
		*pbuf++=tPubSetTable[i].fDef;
	}	

	for(sw=0;sw<SWITCH_NUM_MAX;sw++)	//线路定值
	{
		for(i=0;i<SW_SET_NUMBER;i++)
		{
			*pbuf++=tSwSetTable[i].fDef;
		}	
	}
}
bool ReadSysData(SYSTEM_DATA *st)
{
	WORD crc;
	e2prom_read(EEP_SYSTEM_DATA_START,(BYTE *)st,EEP_SYSTEM_DATA_SIZE);
	crc=Modbus_CRC16(((BYTE*)st)+2,EEP_SYSTEM_DATA_SIZE-4);
	if( st->wCrc !=crc)//数据不合法
	{
		memset((char *)st,0,EEP_SYSTEM_DATA_SIZE);
		st->bWriteFlag=TRUE;
		//初始化以下数据区，防止跟初始数据一致造成数据未刷新
		sprintf(m_TzCount,"%d",tRunPara.sysData.wSwTzCount);
		sprintf(m_HzCount,"%d",tRunPara.sysData.wSwHzCount);
	}
	return TRUE;
}
bool WriteSysData(SYSTEM_DATA *st)
{
	if(st->bWriteLock)//简易多线程写数据互锁处理
	{
		//rt_printf("bWriteLock....\r\n");
		return FALSE;
	}
	st->bWriteLock=TRUE;
	st->wCrc=Modbus_CRC16(((BYTE*)st)+2,EEP_SYSTEM_DATA_SIZE-4);
	if(e2prom_write(EEP_SYSTEM_DATA_START,(BYTE *)st,EEP_SYSTEM_DATA_SIZE)!=0)
		;//return false;

	st->bWriteFlag=FALSE;
	st->bWriteLock=FALSE;
//	rt_printf("WriteSysData OK...\r\n");
	return TRUE;	
}

/******************下面是关于密码读取及校验的操作********************************/

/*****************************************************************************
函数名称：ReadPassword
函数版本：1.00 
作者：   
创建日期：2008.8.18   
函数功能说明：读密码，若校验错误，则返回默认密码
输入参数：
输出参数：无
返回值： 成功时返回1，否则，0
函数扇入清单：
*********************************************************************************/
WORD ReadPassword(void)
{
	BYTE pass1[12];
	WORD crc1,crc2;
	e2prom_read(EEP_PASSWORD_ADDR,(BYTE *)pass1,10);
	crc2=Modbus_CRC16((BYTE*)pass1,PASSWORD_LEN);
	e2prom_read(EEP_PASSWORD_ADDR+PASSWORD_LEN,(BYTE *)&crc1,2);	
	if(crc1==crc2)
	{
		memcpy(tRunPara.wPasswordstr,pass1,PASSWORD_LEN);
		tRunPara.wPasswordstr[PASSWORD_LEN]='\0';
#ifdef PASSWORD_4_STR
		tRunPara.wPasswordstr[4]='\0';
#endif	
	}
	else
	{
#ifdef PASSWORD_4_STR
		strcpy(tRunPara.wPasswordstr,INIT_PASSWORD_STR_4);
#else 
		strcpy(tRunPara.wPasswordstr,INIT_PASSWORD_STR);
#endif	
	
	}
	// 二级密码读取
	e2prom_read(EEP_PASSWORD2_ADDR,(BYTE *)pass1,10);
	crc2=Modbus_CRC16((BYTE*)pass1,PASSWORD_LEN);
	e2prom_read(EEP_PASSWORD2_ADDR+PASSWORD_LEN,(BYTE *)&crc1,2);	
	if(crc1==crc2)
	{
		memcpy(tRunPara.wPasswordstr2,pass1,PASSWORD_LEN);
		tRunPara.wPasswordstr2[PASSWORD_LEN]='\0';
#ifdef PASSWORD_4_STR
		tRunPara.wPasswordstr2[4]='\0';
#endif	
	}
	else
	{
#ifdef PASSWORD_4_STR
		strcpy(tRunPara.wPasswordstr2,INIT_PASSWORD_STR_4);
#else 
		strcpy(tRunPara.wPasswordstr2,INIT_PASSWORD_STR);
#endif	
	
	}	
	return INIT_PASSWORD;  //返回初始密码
}

/***********************************
函数名称：SavePassword
函数版本：1.00 
作者：   
创建日期：2008.8.18   
函数功能说明：保存密码到eep中
输入参数：
输出参数：无
返回值： 成功时返回1，否则，0
函数扇入清单：
***************************************/
bool SavePassword(BYTE *str)
{
	WORD crc;
	if(e2prom_write(EEP_PASSWORD_ADDR,(BYTE *)str,PASSWORD_LEN)!=0)return false;
	crc=Modbus_CRC16((BYTE*)str,PASSWORD_LEN);
	if(e2prom_write(EEP_PASSWORD_ADDR+PASSWORD_LEN,(BYTE *)&crc,2)!=0)return false;
    	return true;
}

bool SavePassword2(BYTE *str)
{
	WORD crc;
	if(e2prom_write(EEP_PASSWORD2_ADDR,(BYTE *)str,PASSWORD_LEN)!=0)return false;
	crc=Modbus_CRC16((BYTE*)str,PASSWORD_LEN);
	if(e2prom_write(EEP_PASSWORD2_ADDR+PASSWORD_LEN,(BYTE *)&crc,2)!=0)return false;
    	return true;
}

/******************下面是关于电压合格率读取及校验的操作********************************/

struct U_QUA
{
	u32  run_time[2]; 
	u32  ok_time[2];  
	u16 crc;
};

/*****************************************************************************
函数名称：ReadUqua
函数版本：1.00 
作者：   
创建日期：2008.8.18   
函数功能说明：读密码，若校验错误，则返回默认密码
输入参数：
输出参数：无
返回值： 成功时返回1，否则，0
函数扇入清单：
*********************************************************************************/
void ReadUqua(void)
{
	struct U_QUA uq;
	u16 crc;
	e2prom_read(EEP_UEUQ_ADDR,(BYTE *)&uq,sizeof(uq));
	crc=Modbus_CRC16((BYTE*)&uq,16);
	if(crc==uq.crc)
	{
		g_sw_pub.vol_qua_ok_time[0]=uq.ok_time[0];
		g_sw_pub.vol_qua_run_time[0]=uq.run_time[0];
		g_sw_pub.vol_qua_ok_time[1]=uq.ok_time[1];
		g_sw_pub.vol_qua_run_time[1]=uq.run_time[1];
	}	
}

/***********************************
函数名称：SaveUqua
函数版本：1.00 
作者：   
创建日期：2008.8.18   
函数功能说明：保存密码到eep中
输入参数：
输出参数：无
返回值： 成功时返回1，否则，0
函数扇入清单：
***************************************/
void SaveUqua(bool clr)
{
	struct U_QUA uq;
	if(!clr)
	{
		uq.ok_time[0]=g_sw_pub.vol_qua_ok_time[0];
		uq.run_time[0]=g_sw_pub.vol_qua_run_time[0];
		uq.ok_time[1]=g_sw_pub.vol_qua_ok_time[1];
		uq.run_time[1]=g_sw_pub.vol_qua_run_time[1];
	}	
	else
	{
		uq.ok_time[0]=0;
		uq.run_time[0]=0;
		uq.ok_time[1]=0;
		uq.run_time[1]=0;
		g_sw_pub.bclearqua=true;
	}	
	uq.crc=Modbus_CRC16((BYTE*)&uq,16);
	e2prom_write(EEP_UEUQ_ADDR,(BYTE *)&uq,sizeof(uq));
}



// 逻辑网络索引
int set_get_network_id_from_socket(SOCKET s)
{
	struct sockaddr_in local_addr;
	unsigned int len = sizeof(local_addr);
	int i;
	
	rt_getsockname(s, (struct sockaddr *)&local_addr,  &len);		
	
	for(i=0;i<CFG_ETH_MAX_LOGIC;i++)
	{

		if(tRunPara.tNetPara[i].wIp == local_addr.sin_addr.s_addr)
		{
			return i;

		}
	}	

	return -1;
}


/****************以下是远方修改定值及程序更新相关代码************/

// sunxi 2011-09-20
// 得到定值列表索引

#include "m.h"
#include "m_set.h"
struct _list_item
{
	const  SET_LIST * 	list;
	int					num;
};

struct _list_item g_list_all[] = 
{
	{TTList,sizeof(TTList)/sizeof(SET_LIST),},
#ifdef GD_TEST_2021
	{GJHZList,sizeof(GJHZList)/sizeof(SET_LIST),},
#endif
	{TZList,sizeof(TZList)/sizeof(SET_LIST),},
	{FSXList,sizeof(FSXList)/sizeof(SET_LIST),},
	{CHZList,sizeof(CHZList)/sizeof(SET_LIST),},
	{CHJSList,sizeof(CHJSList)/sizeof(SET_LIST),},
	{BaudList,sizeof(BaudList)/sizeof(SET_LIST),},
	{ParityList,sizeof(ParityList)/sizeof(SET_LIST),},
	{ProtocolList,sizeof(ProtocolList)/sizeof(SET_LIST),},
	{KGFunList,sizeof(KGFunList)/sizeof(SET_LIST),},
	{TimeList,sizeof(TimeList)/sizeof(SET_LIST),},
	{PTTypeList,sizeof(PTTypeList)/sizeof(SET_LIST),},
	{YCTypeList,sizeof(YCTypeList)/sizeof(SET_LIST),},	
	{IEC101AddrList,sizeof(IEC101AddrList)/sizeof(SET_LIST),},
	{AddrNumList,sizeof(AddrNumList)/sizeof(SET_LIST),},
	{TZCKList,sizeof(TZCKList)/sizeof(SET_LIST),},
	{TZGJList,sizeof(TZGJList)/sizeof(SET_LIST),},	
	{HHFunList,sizeof(HHFunList)/sizeof(SET_LIST),},	
	{Net_Eth_List,sizeof(Net_Eth_List)/sizeof(SET_LIST),},	
	{FA_List,sizeof(FA_List)/sizeof(SET_LIST),},	
	{WFList,sizeof(WFList)/sizeof(SET_LIST),},	
	{JMList,sizeof(JMList)/sizeof(SET_LIST),},	
	{JDTYPE,sizeof(JDTYPE)/sizeof(SET_LIST),},	
	{XDLQDList,sizeof(XDLQDList)/sizeof(SET_LIST),},	
	{KGFun1List,sizeof(KGFun1List)/sizeof(SET_LIST),},	
	{T104ServerList,sizeof(T104ServerList)/sizeof(SET_LIST),},	
	{TVolSelList,sizeof(TVolSelList)/sizeof(SET_LIST),},		
	{HZList,sizeof(HZList)/sizeof(SET_LIST),},
	{TGooseKG,sizeof(TGooseKG)/sizeof(SET_LIST),},	
	{TGooseFA,sizeof(TGooseFA)/sizeof(SET_LIST),},	
	{THHTYPE,sizeof(THHTYPE)/sizeof(SET_LIST),},		
	{TFA_Type,sizeof(TFA_Type)/sizeof(SET_LIST),},	
	{TPT_Type,sizeof(TPT_Type)/sizeof(SET_LIST),},	
	{EQUList,sizeof(EQUList)/sizeof(SET_LIST),},	
	{YCTypeDead,sizeof(YCTypeDead)/sizeof(SET_LIST),},	
	{PUList,sizeof(PUList)/sizeof(SET_LIST),},
	{LinkList,sizeof(LinkList)/sizeof(SET_LIST),},
 	{DISPMODEList,sizeof(DISPMODEList)/sizeof(SET_LIST),},
 	{GOOSE_NET_List,sizeof(GOOSE_NET_List)/sizeof(SET_LIST),}, 
	{TGooseKGWZTYPE,sizeof(TGooseKGWZTYPE)/sizeof(SET_LIST),},	
#ifdef	CUSTOMIZE_BZT //备自投
    {BZTFSList,sizeof(BZTFSList)/sizeof(SET_LIST),},
    {TISelList,sizeof(TISelList)/sizeof(SET_LIST),},
#endif
#ifdef GD_TEST_2021
	{TFGKEY_Type,sizeof(TFGKEY_Type)/sizeof(SET_LIST),},
#endif
	{UYY_List,sizeof(UYY_List)/sizeof(SET_LIST),},
#ifdef  METERING_ENERGY
	{DDList,sizeof(DDList)/sizeof(SET_LIST),},
	{JLFSList,sizeof(JLFSList)/sizeof(SET_LIST),},
	{WGFSList,sizeof(WGFSList)/sizeof(SET_LIST),},
#endif
	{HisFileFormatList,sizeof(HisFileFormatList)/sizeof(SET_LIST),},
#ifdef	FIX_PARAM_FORMAT
	{TULF8List,sizeof(TULF8List)/sizeof(SET_LIST),},
#endif
#ifdef FUNC_GOOSE_FA_ADD
	{GTZList,sizeof(GTZList)/sizeof(SET_LIST),},
	{GHZList,sizeof(GHZList)/sizeof(SET_LIST),},
	{GQDList,sizeof(GQDList)/sizeof(SET_LIST),},
	{GCHZList,sizeof(GCHZList)/sizeof(SET_LIST),},
#endif
#ifdef FUNC_SEL_MODE_FA
	{SelFAList,sizeof(SelFAList)/sizeof(SET_LIST),},
#endif
	{TimeListSelect,sizeof(TimeListSelect)/sizeof(SET_LIST),},
};
#define LIST_ALL_NUM 	(sizeof(g_list_all)/sizeof(struct _list_item))

int set_get_list_index(const SET_LIST * p_list)
{
	int i;
	
	for(i=0; i<LIST_ALL_NUM; i++)
	{
		if(p_list == g_list_all[i].list)
		{
			return i;
		}
	}
	
	return -1;
}

#define SET_FILE_VERSION	0X01010102	//定值文件版本

struct set_file_head_data  g_fh_data;
struct file_contrast		setdesc_contrast;

int set_create_desc_file(void)
{
	unsigned int i,j,len,num,file_length;
	char *p;
	loff_t pos;
	
	struct file * 			pfile;
	struct set_file_head_desc	fh;
	struct set_item			set_item;
	struct list_item		list_item;
	struct list_sum_item	list_sum_item;
	struct unit_item		unit_item;

// 写文件头
	// 配置文件头
	memset(&fh,0,sizeof(fh));
	fh.cfh.signature = SIG_SET_DESC_FILE;
	fh.cfh.version = SET_FILE_VERSION;
	fh.equ_sw_num = SWITCH_NUM_MAX; // 增加开关数量，这样工具能够正确识别数据文件的大小

	// 外部定值
	fh.set_extpub_addr = FILE_ADDR_ALGIN(sizeof(fh));
	fh.set_extpub_num = PUB_SET_NUMBER;

	fh.set_extsw_addr = FILE_ADDR_ALGIN(fh.set_extpub_addr + fh.set_extpub_num * sizeof(struct set_item));
	fh.set_extsw_num = SW_SET_NUMBER;

	// 内部定值
	fh.set_int_addr = FILE_ADDR_ALGIN(fh.set_extsw_addr + fh.set_extsw_num * sizeof(struct set_item));
	fh.set_int_num = CSTSET_NUMBER;

	// 装置参数
	fh.set_arg_addr = FILE_ADDR_ALGIN(fh.set_int_addr + fh.set_int_num * sizeof(struct set_item));
	fh.set_arg_num = EQUIP_PARA_NUMBER;

	// 列表结构
	fh.list_addr = FILE_ADDR_ALGIN(fh.set_arg_addr + fh.set_arg_num * sizeof(struct set_item));
	fh.list_num=0;
	for(i=0; i<LIST_ALL_NUM; i++)
	{
		fh.list_num += g_list_all[i].num;
	}

	// 列表结构描述总表
	fh.list_sum_addr = FILE_ADDR_ALGIN(fh.list_addr + fh.list_num * sizeof(struct list_item));
	fh.list_sum_num = LIST_ALL_NUM;

	// 单位表
	fh.unit_addr = FILE_ADDR_ALGIN(fh.list_sum_addr + fh.list_sum_num * sizeof(struct list_sum_item));
	fh.unit_num = sizeof(SetUints)/sizeof(char *);

	// 得到文件长度
	file_length = FILE_ADDR_ALGIN(fh.unit_addr + fh.unit_num * sizeof(struct unit_item));

	// 分配并初始化空间
	p = rt_malloc(file_length + 2); //加crc长度
	if(!p)
	{
		return -1;

	}
	memset(p,0,file_length);
	
	// 写入文件头
	memcpy(p,(char *)&fh,sizeof(fh));
	
// 写外部定值
	for(i=0; i<fh.set_extpub_num;i++)
	{
		set_item.type = tPubSetTable[i].wType;
		set_item.unit = tPubSetTable[i].wUnit;
		len = strlen(tPubSetTable[i].szName);
		if(len >= MOD_NAME_LEN - 1)
		{
			rt_free(p);
			return -3;
		}
		memset(set_item.name,0,sizeof(set_item.name));
		memcpy(set_item.name,tPubSetTable[i].szName,len);
		set_item.max = tPubSetTable[i].fMax;
		set_item.min = tPubSetTable[i].fMin;
		set_item.def = tPubSetTable[i].fDef;
		set_item.list_index = set_get_list_index(tPubSetTable[i].list);
		set_item.group = tPubSetTable[i].group;

		memcpy(p + fh.set_extpub_addr + i*sizeof(set_item),(char *)&set_item,sizeof(set_item));		
	}

	for(i=0; i<fh.set_extsw_num;i++)
	{
		set_item.type = tSwSetTable[i].wType;
		set_item.unit = tSwSetTable[i].wUnit;
		len = strlen(tSwSetTable[i].szName);
		if(len >= MOD_NAME_LEN - 1)
		{
			rt_free(p);
			return -3;
		}
		memset(set_item.name,0,sizeof(set_item.name));
		memcpy(set_item.name,tSwSetTable[i].szName,len);
		
	#ifdef BH_FA_INONE_SW
		if(0 == strcmp(tSwSetTable[i].szName,"保护/FA"))
		{//模式压板列表值最小值为0,最大值为2,维护工具上需显示最小值为1,最大值为3
			set_item.max = (tSwSetTable[i].fMax + (float)1);
			set_item.min = (tSwSetTable[i].fMin + (float)1);
		}
		else
	#endif
		{
			set_item.max = tSwSetTable[i].fMax;
			set_item.min = tSwSetTable[i].fMin;
		}
		set_item.def = tSwSetTable[i].fDef;
		set_item.list_index = set_get_list_index(tSwSetTable[i].list);
		set_item.group = tSwSetTable[i].group;

		memcpy(p + fh.set_extsw_addr + i*sizeof(set_item),(char *)&set_item,sizeof(set_item));		
	}


// 写内部定值
	for(i=0; i<fh.set_int_num;i++)
	{
		set_item.type = tCstSetTable[i].wType;
		set_item.unit = tCstSetTable[i].wUnit;
		len = strlen(tCstSetTable[i].szName);
		if(len >= MOD_NAME_LEN - 1)
		{
			rt_free(p);
			return -4;
		}
		memset(set_item.name,0,sizeof(set_item.name));
		memcpy(set_item.name,tCstSetTable[i].szName,len);
		set_item.max = tCstSetTable[i].fMax;
		set_item.min = tCstSetTable[i].fMin;
		set_item.def = tCstSetTable[i].fDef;
		set_item.list_index = set_get_list_index(tCstSetTable[i].list);
		set_item.group = tCstSetTable[i].group;

		memcpy(p + fh.set_int_addr + i*sizeof(set_item),(char *)&set_item,sizeof(set_item));		
	}

// 写装置参数
	for(i=0; i<fh.set_arg_num;i++)
	{
		set_item.type = tEquipParaTable[i].wType;
		set_item.unit = tEquipParaTable[i].wUnit;
		len = strlen(tEquipParaTable[i].szName);
		if(len >= MOD_NAME_LEN - 1)
		{
			rt_free(p);
			return -5;
		}
		memset(set_item.name,0,sizeof(set_item.name));
		memcpy(set_item.name,tEquipParaTable[i].szName,len);
		set_item.max = tEquipParaTable[i].fMax;
		set_item.min = tEquipParaTable[i].fMin;
		if((tEquipParaTable[i].wType == SETTYPE_IP)
			|| (tEquipParaTable[i].wType == SETTYPE_YMD)
			|| (tEquipParaTable[i].wType == SETTYPE_HMS))
		{
			memcpy(&set_item.def,&tEquipParaTable[i].list,4);
		}
		else
		{
			set_item.def = tEquipParaTable[i].fDef;
		}
		set_item.list_index = set_get_list_index(tEquipParaTable[i].list);
		set_item.group = tEquipParaTable[i].group;

		memcpy(p + fh.set_arg_addr + i*sizeof(set_item),(char *)&set_item,sizeof(set_item));		
	}

// 写列表结构
	num = 0;
	for(i=0; i<fh.list_sum_num; i++)
	{
		for(j=0; j<g_list_all[i].num; j++)
		{
			list_item.value = g_list_all[i].list[j].dat;
			len = strlen(g_list_all[i].list[j].str);
			if(len >= MOD_NAME_LEN - 1)
			{
				rt_free(p);
				return -6;
			}
			memset(list_item.name,0,sizeof(list_item.name));
			memcpy(list_item.name,g_list_all[i].list[j].str,len);	

			memcpy(p + fh.list_addr+ num*sizeof(list_item),(char *)&list_item,sizeof(list_item));	
			num++;
		}
	}

// 写列表结构描述总表
	num = 0;
	for(i=0; i<fh.list_sum_num; i++)
	{
		list_sum_item.index = num;
		list_sum_item.num = g_list_all[i].num;
		
		memcpy(p + fh.list_sum_addr + i*sizeof(list_sum_item),(char *)&list_sum_item,sizeof(list_sum_item));
		
		num += list_sum_item.num;
	}


// 写单位表
	for(i=0; i<fh.unit_num; i++)
	{
		len = strlen(SetUints[i]);
		if(len >= MOD_NAME_LEN - 1)
		{
			rt_free(p);
			return -7;
		}
		memset(unit_item.unit,0,sizeof(unit_item.unit));
		memcpy(unit_item.unit,SetUints[i],len);	

		memcpy(p + fh.unit_addr+ i*sizeof(unit_item),(char *)&unit_item,sizeof(unit_item));	
	}


// 创建描述文件
	pfile = rt_file_open("/tmp/"FILE_NAME_SET_DESC,O_CREAT|O_RDWR|O_TRUNC,0);
	if(IS_ERR(pfile))
	{
		return -8;
	}

	// 计算CRC
	g_crc_set_desc = CrcStr(p,file_length);
	memcpy(p+file_length,&g_crc_set_desc,2);
	
	pos = 0;
	rt_file_write(pfile,p,file_length+2,&pos);

	rt_file_close(pfile,0);

	setdesc_contrast.version = fh.cfh.version;
	setdesc_contrast.signature = fh.cfh.signature;
	setdesc_contrast.length = file_length + 2;
	setdesc_contrast.crc = g_crc_set_desc;

	rt_free(p);
	return 0;
}

/*****************************************************************************
函数名称：read_prjname
函数版本：1.00 
作者：   
创建日期：2013.10.14   
函数功能说明：
输入参数：
输出参数：无
返回值： 成功时返回1，否则，0
函数扇入清单：
*********************************************************************************/
int read_prjname(s8 *name)
{
	if (e2prom_read(EEP_PRJNAME_ADDR,name,64) != 0)
		return false;
	else 
		return true;
}
/***********************************
函数名称：write_prjname
函数版本：1.00 
作者：   

创建日期：2013.10.14  
函数功能说明：
输入参数：
输出参数：无
返回值： 成功时返回1，否则，0
函数扇入清单：
***************************************/
int write_prjname(s8 *name)
{
	if(e2prom_write(EEP_PRJNAME_ADDR, name, 64)!=0)
		return false;
	else
		return true;
}

// 建立数据文件
int set_create_data_file(void)
{
	unsigned int addr,file_length;
	char *p;
	loff_t pos;
	
	struct file * 			pfile;

	
// 写文件头
	memset(&g_fh_data,0,sizeof(g_fh_data));
	g_fh_data.cfh.signature = SIG_SET_DATA_FILE;
	g_fh_data.cfh.version = SET_FILE_VERSION;
	g_fh_data.desc_signature = setdesc_contrast.signature;
	g_fh_data.desc_version = setdesc_contrast.version;
	g_fh_data.desc_length= setdesc_contrast.length;
	g_fh_data.desc_crc = setdesc_contrast.crc;
	read_prjname(g_fh_data.prj_name);
	g_fh_data.equ_sw_num = SWITCH_NUM_MAX;
	
	// 外部定值
	g_fh_data.set_extpub_addr = FILE_ADDR_ALGIN(sizeof(g_fh_data));
	g_fh_data.set_extpub_num = PUB_SET_NUMBER;

	addr = g_fh_data.set_extpub_addr + g_fh_data.set_extpub_num * 4;
	g_fh_data.set_extsw_addr = addr;
	g_fh_data.set_extsw_num = SW_SET_NUMBER*SWITCH_NUM_MAX;

	// 内部定值
	addr = g_fh_data.set_extsw_addr + g_fh_data.set_extsw_num * 4;
	addr += (g_fh_data.set_extpub_num + g_fh_data.set_extsw_num + 7)/8;
	g_fh_data.set_int_addr = FILE_ADDR_ALGIN(addr);
	g_fh_data.set_int_num = CSTSET_NUMBER;

	// 装置参数
	addr = g_fh_data.set_int_addr + g_fh_data.set_int_num * 4;
	addr += (g_fh_data.set_int_num + 7)/8;
	g_fh_data.set_arg_addr = FILE_ADDR_ALGIN(addr);
	g_fh_data.set_arg_num = EQUIP_PARA_NUMBER;

	// 得到文件长度
	addr = g_fh_data.set_arg_addr + g_fh_data.set_arg_num * 4;
	addr += (g_fh_data.set_arg_num + 7)/8;
	file_length = FILE_ADDR_ALGIN(addr);

	// 分配并初始化空间
	p = rt_malloc(file_length + 2); //加crc长度
	if(!p)
	{
		return -1;
	}
	memset(p,0,file_length);
	
	// 写入文件头
	memcpy(p,(char *)&g_fh_data,sizeof(g_fh_data));
	
// 写外部定值
	if(!ReadSet(m_runsection,(void *)(p + g_fh_data.set_extpub_addr)))  // 读当前定值无效
	{
		GetDefSet((float*)(p + g_fh_data.set_extpub_addr));
	}

// 写内部定值
	if(!ReadPara((void*)(p + g_fh_data.set_int_addr),EEP_CSTSET_ADDR,CSTSET_NUMBER,&tCstSetTable[0]))
	{
		GetDefPara((float*)(p + g_fh_data.set_int_addr),CSTSET_NUMBER,&tCstSetTable[0]);
	}

// 写装置参数
	if(!ReadPara((void*)(p + g_fh_data.set_arg_addr),EEP_EQUIP_PARA_ADDR,EQUIP_PARA_NUMBER,&tEquipParaTable[0]))
	{
		GetDefPara((float*)(p + g_fh_data.set_arg_addr),EQUIP_PARA_NUMBER,&tEquipParaTable[0]);
	}

// 创建数据文件
	pfile = rt_file_open("/tmp/set_data.bin",O_CREAT|O_RDWR|O_TRUNC,0);
	if(IS_ERR(pfile))
	{
		rt_free(p);
		return -8;
	}

	// 计算CRC
	g_crc_set_data = CrcStr(p,file_length);
	memcpy(p+file_length,&g_crc_set_data,2);
	
	pos = 0;
	rt_file_write(pfile,p,file_length+2,&pos);

	rt_file_close(pfile,0);

	rt_free(p);
	
	
	return 0;
}


int set_save_data_file(s32 index)
{
	unsigned char *change_field,*local_data;
	unsigned int i,addr,file_length, len;
	unsigned short crc;
	int ret;
	u8 updata_flag[3] = {0};
	int setdata_err=0;
	struct set_file_head_data  fh_data;

	u8 *buf;
	char file_name[64];

	struct file * pfile;
	loff_t pos;

	local_data = 0;
	
	sprintf(file_name,"%s%s",g_file_item[index].file_dir,g_file_item[index].file_name);

	// 打开文件
	pfile = rt_file_open(file_name,O_RDONLY ,0);

	if(IS_ERR(pfile))
	{
		return -1;
	}

	// 得到文件长度
	len = rt_file_getfile_size(pfile);
	if(len <= 0)
	{
		rt_file_close(pfile,0);
		return -11;
	}
	
	// 分配内存
	buf = rt_malloc(len);
	if((buf) == NULL)
	{
		rt_file_close(pfile,0);
		return -2;
	}
	
	// 读出内容
	pos = 0;
	if(rt_file_read(pfile,buf,len,&pos) != len)
	{
		rt_file_close(pfile,0);
		rt_free(buf);
		return -3;
	}
	// 关闭文件
	rt_file_close(pfile,0);
	
	// 检查CRC
	crc = CrcStr(buf,len - 2);
	if(crc != *(u16*)(buf+len-2))
	{
		rt_free(buf);
		return -4;
	}
	
	// 配置文件头
	memcpy(&fh_data,buf,sizeof(fh_data));
	
	// 检查文件签名
	if(fh_data.cfh.signature != SIG_SET_DATA_FILE)
	{
		rt_free(buf);
		return -6;
	}


	//比对定值描述文件
	if ((fh_data.desc_version != setdesc_contrast.version)
	|| (fh_data.desc_signature != setdesc_contrast.signature)
	|| (fh_data.desc_length != setdesc_contrast.length)
	|| (fh_data.desc_crc != setdesc_contrast.crc))
	{
		rt_free(buf);
		return -7;
	}	
	
	// 得到文件长度
	file_length = fh_data.set_arg_addr + fh_data.set_arg_num * 4;
	file_length += (fh_data.set_arg_num + 7)/8;
	file_length = FILE_ADDR_ALGIN(file_length);
	file_length += 2; //CRC 长度
	if(len != file_length)
	{
		rt_free(buf);
		return -8;
	}

	// 分配内存，用来保存本地定值参数值
	local_data = rt_malloc(len);
	if(local_data == NULL)
	{
		rt_free(buf); // sunxi 20180719
		return -9;
	}

	// 读取外部定值
	if(!ReadSet(m_runsection,local_data+fh_data.set_extpub_addr))
	{
		GetDefSet((void*)(local_data+fh_data.set_extpub_addr));
		updata_flag[0] = true;
		setdata_err |= 0x01;
	}

	// 读取内部定值
	if(!ReadPara((void*)(local_data+fh_data.set_int_addr),EEP_CSTSET_ADDR,CSTSET_NUMBER,&tCstSetTable[0]))
	{
		GetDefPara((void*)(local_data+fh_data.set_int_addr),CSTSET_NUMBER,&tCstSetTable[0]);
		updata_flag[1] = true;
		setdata_err |= 0x02;
	}

	// 读取装置参数
	if(!ReadPara((void*)(local_data+fh_data.set_arg_addr),EEP_EQUIP_PARA_ADDR,EQUIP_PARA_NUMBER,&tEquipParaTable[0]))
	{
		GetDefPara((void*)(local_data+fh_data.set_arg_addr),EQUIP_PARA_NUMBER,&tEquipParaTable[0]);	
		updata_flag[2] = true;
		setdata_err |= 0x04;
	}

	// 合并外部定值
	change_field = buf + fh_data.set_extpub_addr + fh_data.set_extpub_num * 4 + fh_data.set_extsw_num * 4;
	for(i=0; i<fh_data.set_extpub_num + fh_data.set_extsw_num; i++)
	{
		if((change_field[i/8] & (1<<(i%8))) == 0)
		{
			// 使用本地数据
			addr =  fh_data.set_extpub_addr + i * 4;
			memcpy(buf +addr,local_data + addr,4);
		}
		else
		{
			updata_flag[0] = true;
		}
	}

	// 合并内部定值
	change_field = buf + fh_data.set_int_addr + fh_data.set_int_num * 4;
	for(i=0; i<fh_data.set_int_num; i++)
	{
		if((change_field[i/8] & (1<<(i%8))) == 0)
		{
			// 使用本地数据
			addr =  fh_data.set_int_addr + i * 4;
			memcpy(buf +addr,local_data + addr,4);
		}
		else
		{
			updata_flag[1] = true;
		}
	}

	// 合并装置参数
	change_field = buf + fh_data.set_arg_addr + fh_data.set_arg_num * 4;
	for(i=0; i<fh_data.set_arg_num; i++)
	{
		if((change_field[i/8] & (1<<(i%8))) == 0)
		{
			// 使用本地数据
			addr =  fh_data.set_arg_addr + i * 4;
			memcpy(buf +addr,local_data + addr,4);
		}
		else
		{
			updata_flag[2] = true;
		}
	}
 	
	// 保存外部定值
	if (updata_flag[0])
	{
		if(SaveSet(m_runsection,(void *)(buf+fh_data.set_extpub_addr)))
		{
			soe_record_opt(EV_SET_OK,0);
			MakeRunSet(false); 
			rt_err_clr(ERR_CODE_SET,0);
		}
		else
		{
			setdata_err |= 0x10;
		}
	}

	// 保存内部定值
	if (updata_flag[1])
	{
		if(SavePara((void *)(buf+fh_data.set_int_addr),EEP_CSTSET_ADDR,CSTSET_NUMBER,&tCstSetTable[0]))
		{
			soe_record_opt(EV_CSTSET_OK,0);  // 内部定值整定成功
			MakeRunSet(false); // 将当前运行定值区转换为运行定值区
			rt_err_clr(ERR_CODE_SET_IN,0);
		}
		else
		{
			setdata_err |= 0x20;
		}
	}

	// 保存装置参数
	if (updata_flag[2])
	{
		if(SavePara((void *)(buf+fh_data.set_arg_addr),EEP_EQUIP_PARA_ADDR,EQUIP_PARA_NUMBER,&tEquipParaTable[0]))
		{
			soe_record_opt(EV_EQUPARA_OK,0);
			MakeRunPara(false, false); 
			rt_err_clr(ERR_CODE_EQU_PARA,0);
		}
		else
		{
			setdata_err |= 0x40;
		}
	}
#ifdef YPARA_LINK_S
	set_para_flag();
#endif

	write_prjname(fh_data.prj_name);

	if (setdata_err)
	{
		ret = setdata_err;
	}
	else
	{
		ret = 0;
	}
//RET:
	if(local_data)
	{
		rt_free(local_data);
	}
	rt_free(buf); // sunxi 20180719

	return ret;
}

void create_set_file(void)
{
	if (g_creat_set_file)
	{
		set_create_data_file();
		g_creat_set_file = 0;
	}
}

/******************************************************************************
函数名称：	mmd_get_set_dip_index()
函数版本：	01.01
创建作者：	xxxxxx
创建日期：	2014-12-16
函数说明：	开关类型刷新定值显示
参数说明：	set_type: 1 装置参数，2 保护定值，3 内部定值
返回值：  	成功返回0.
修改记录：	
*/

struct set_disp_index  g_set_disp;// 挑选后的保护定值

void  mmd_get_set_dip_index(const TSETTABLE *pTable,int num)
{
	int i;
	g_set_disp.num=0;

	for (i=0; i<num; i++)
	{
		if (pTable[i].wType != SETTYPE_LABEL) 
		{
			g_set_disp.no[g_set_disp.num] = i;
			g_set_disp.num++;
		}		
	}
}

void get_set_value(char *str,const TSETTABLE *pTable,float value)
{
	WORD type=pTable->wType;
	DWORD wDat;
	wDat=(DWORD)value;
	if(type==SETTYPE_F)
	{
		sprintf(str,"%.3f",value);
	}
	else if(type==SETTYPE_LIST)
	{
		sprintf(str,"%s",pTable->list[wDat].str);

	}
	else if(type==SETTYPE_UINT||type==SETTYPE_5INT||type==SETTYPE_LINT||type==SETTYPE_4INT)
	{
		sprintf(str,"%d",wDat);
	}
	else if(type==SETTYPE_IP)
	{
		
		sprintf(str,"%d.%d.%d.%d",(u8)(wDat>>24),(u8)(wDat>>16),(u8)(wDat>>8),(u8)(wDat>>0));
	}
	else if(type==SETTYPE_YMD)
	{
		sprintf(str,"%d年%d月%d日",2000+(u8)(wDat>>16),(u8)(wDat>>8),(u8)(wDat>>0));
	}
	else if(type==SETTYPE_HMS)
	{
		sprintf(str,"%d:%d:%d秒",(u8)(wDat>>16),(u8)(wDat>>8),(u8)(wDat>>0));
	}
	else
	{
		strcpy(str,"非法值");
	}


}
void creatListString(void)
{
	int i,j;
	loff_t pos;
	char tmpstr[256];
	struct file * pfile;
	char *p=tmpstr;
	pfile = rt_file_open("/tmp/typeDefine.csv",O_CREAT|O_RDWR|O_TRUNC,0);
	if(IS_ERR(pfile))
	{
		return ;
	}	
	pos = 0;
	sprintf(p,"List序号,0,1,2,3,4,5,6,7,8,9,10,11,12 \r\n");
	rt_file_write(pfile,p,strlen(p),&pos);
	for(i=0; i<LIST_ALL_NUM; i++)
	{
		sprintf(p,"%d,",i+1);
		for(j=0;j<g_list_all[i].num;j++)
		{
			strcat(p,g_list_all[i].list[j].str);
			strcat(p,",");
		}
		strcat(p,"\r\n");
		rt_file_write(pfile,p,strlen(p),&pos);	
	}
	
	rt_file_close(pfile,0);
}
extern void creatModifyFile(void);
void create_set_data_txt(void) //生成txt格式的定值文件，保存在tmp文件下
{
	struct file * pfile;
	loff_t pos;
	char tmpstr[128];
	char valstr[24];
	char *p=tmpstr;
	int i;
	u8 setgroup[GROUP_NUM];

	creatModifyFile();
	creatListString();
	return;
// 创建描述文件
	pfile = rt_file_open("/tmp/setdata_file.txt",O_CREAT|O_RDWR|O_TRUNC,0);
	if(IS_ERR(pfile))
	{
		return ;
	}	
	pos = 0;

	if(!ReadEppData(EEP_SETGROUP_ADDR,setgroup,GROUP_NUM))
	{
		GetDefSetGroup(setgroup);
	}	

	
	
	/*读取压板定值*/
	if(!ReadPara((void*)m_SetBuf,EEP_PUB_ADDR+PUB_SETSIZE*m_runsection,PUB_SET_NUMBER,&tPubSetTable[0]))
	{
		GetDefPara((void*)m_SetBuf,PUB_SET_NUMBER,&tPubSetTable[0]);
	}


	
	for(i=0;i<PUB_SET_NUMBER;i++)
	{
		if((tPubSetTable[i].group==0||setgroup[tPubSetTable[i].group-1]))  // 定值分类组为0 或显示定制为1
		{
			if(tPubSetTable[i].wType==SETTYPE_LABEL)
			{
				sprintf(p,"%s:\r\n",tPubSetTable[i].szName);
			}
			else
			{
				get_set_value(valstr,&tPubSetTable[i],m_SetBuf[i].ff);
				sprintf(p,"    %-20.20s%-10.10s%s\r\n",tPubSetTable[i].szName,valstr,SetUints[tPubSetTable[i].wUnit]);
			}
			rt_file_write(pfile,p,strlen(p),&pos);
		}
	}	
	if(!ReadPara((void*)m_SetBuf,EEP_SET_ADDR+SETSIZE*m_runsection,SW_SET_NUMBER,&tSwSetTable[0]))
	{
		GetDefPara((void*)m_SetBuf,SW_SET_NUMBER,&tSwSetTable[0]);
	}
	for(i=0;i<SW_SET_NUMBER;i++)
	{
		if((tSwSetTable[i].group==0||setgroup[tSwSetTable[i].group-1]))  // 定值分类组为0 或显示定制为1
		{
			if(tSwSetTable[i].wType==SETTYPE_LABEL)
			{
				sprintf(p,"%s:\r\n",tSwSetTable[i].szName);
			}
			else
			{
				get_set_value(valstr,&tSwSetTable[i],m_SetBuf[i].ff);			
				sprintf(p,"    %-20.20s%-10.10s%s\r\n",tSwSetTable[i].szName,valstr,SetUints[tSwSetTable[i].wUnit]);
			}
			rt_file_write(pfile,p,strlen(p),&pos);
		}
	}
	
	rt_file_close(pfile,0);

}


/************************************************************************
函数名称：getTypeBeginIndexAndEndIndex
函数版本：V0.01
作   者：
创建日期：2021.08.05
形参说明：type：定值类型(公共、装置、开关、内部)
		 *p_begin_no：存放在缓存区开始索引号的地址
		 *p_end_no：存放在缓存区结束索引号的地址
函数说明：获取这种类型的定值在缓存区的起始索引号和结束索引号
返 回 值：true：获取成功 false：获取失败
************************************************************************/
static bool getTypeBeginIndexAndEndIndex(const BYTE type,int *p_begin_no,int *p_end_no)
{
	int i;
	int arr_total;
	bool b_bg = false,b_eg = false;

	arr_total = sizeof(tCstValForwardTable)/sizeof(CSTVAL_FORWARD_TABLE);

	if(!arr_total)
		return false;

	for(i=0; i<arr_total; i++){
		if(tCstValForwardTable[i].valType == type && !b_bg){
			*p_begin_no = i;
			b_bg = true;
			continue;
		}
		if(tCstValForwardTable[i].valType != type && b_bg){
			*p_end_no = i;
			b_eg = true;
			break;
		}
	}

	if(!b_bg)
		return false;

	if(b_bg && !b_eg){   
		*p_end_no = i;
	}

	return true;
}


/************************************************************************
函数名称：GetCstValForwardAddr
函数版本：V0.01
作   者：
创建日期：2021.08.05
形参说明：type：定值类型(公共、装置、开关、内部)
		 index：定值索引号
函数说明：获取定值转发地址
返 回 值：定值转发地址 		0：表示获取失败
************************************************************************/
WORD GetCstValForwardAddr(const BYTE type,const int index)
{
	int i;
	WORD addr=0;
	int begin_no=0,end_no=0;

	if(!getTypeBeginIndexAndEndIndex(type,&begin_no,&end_no))
		return 0;

	for(i=begin_no; i<end_no; i++){
		if(tCstValForwardTable[i].arrIndex != index)
			continue;

		addr = tCstValForwardTable[i].forwardAddr;
		break;
	}

	return addr;
}






//========================== 本文件结束 =============================
