/********************************************************
*                                                                                                            
* 文 件 名： ConfigDataReadManage.c   
* 版权说明： 北京交控科技有限公司 
* 创建时间： 
* 作    者： 
* 功能描述： 联锁读配置文件函数 
* 修改记录：   
*
********************************************************/ 

#include "ConfigDataReadManage.h"



extern TransmitRelationDataStruct TransmitRelaDataStru[TRANSMIT_OBJECT_SUM_MAX];
extern UINT16 TransmitRelaDataCurSum; /*通信关系配置数据当前总数*/
extern CiTransmitStruct ciTransmitStruct[CI_SUM_MAX];	/* 相连联锁设备接口 */
extern EaConfigStru g_szEaConfig[EA_CFG_SUM_MAX];
extern UINT16 g_eaConfigNum;

extern AxisSectionConfigDataStruct g_szEaAcConfig[AXIS_SECTION_SUM_MAX]; /* 全线计轴区段 */
extern UINT16 g_eaAcConfigNum;

INT16 trackCheckRes = -1;
INT16 g_ret = -1;


/*
 功能描述：	配置数据结构体统一初始化函数
 参数说明：	无
 返回值  ：	0u,初始化失败；1u初始化成功
 *cgh-合并CID-2539-6：
*/
UINT8 InitAllStaticDataStr(void)
{
	UINT8 chRtn = 0u;

	/*进路配置数据结构体*/
	chRtn = CommonMemSet(RouteConfigDataStru, (UINT32)(ROUTE_SUM_MAX * sizeof(RouteConfigDataStruct)), 0u, (UINT32)(ROUTE_SUM_MAX * sizeof(RouteConfigDataStruct)));

	/*全自动折返数据配置结构体*/
	chRtn &= CommonMemSet(AllAutoReturnConfigDataStru, (UINT32)(ALL_AUTO_RETURN_SUM_MAX * sizeof(AllAutoReturnConfigDataStruct)), 0u, (UINT32)(ALL_AUTO_RETURN_SUM_MAX * sizeof(AllAutoReturnConfigDataStruct)));

	/*自动折返数据配置结构体*/
	chRtn &= CommonMemSet(AutoReturnConfigDataStru, (UINT32)(AUTO_RETURN_SUM_MAX * sizeof(AutoReturnConfigDataStruct)), 0u, (UINT32)(AUTO_RETURN_SUM_MAX * sizeof(AutoReturnConfigDataStruct)));

	/*自动进路数据配置结构体*/
	chRtn &= CommonMemSet(AutoRouteConfigDataStru, (UINT32)(AUTO_ROUTE_SUM_MAX * sizeof(AutoRouteConfigDataStruct)), 0u, (UINT32)(AUTO_ROUTE_SUM_MAX * sizeof(AutoRouteConfigDataStruct)));

	/*组合自动进路数据配置结构体*/
	chRtn &= CommonMemSet(GroupAutoRouteConfigDataStru, (UINT32)(GROUP_AUTO_ROUTE_SUM_MAX * sizeof(GroupAutoRouteConfigDataStruct)), 0u, (UINT32)(GROUP_AUTO_ROUTE_SUM_MAX * sizeof(GroupAutoRouteConfigDataStruct)));

	/*存储各CI使用的电子地图版本*/
	chRtn &= CommonMemSet(gEmapCiConfigStrus, (UINT32)(CI_SUM_MAX * sizeof(EmapCiConfigStru)), 0u, (UINT32)(CI_SUM_MAX * sizeof(EmapCiConfigStru)));

	/*ESB数据配置结构体*/
	chRtn &= CommonMemSet(EsbConfigDataStru, (UINT32)(ESB_SUM_MAX * sizeof(EsbConfigDataStruct)), 0u, (UINT32)(ESB_SUM_MAX * sizeof(EsbConfigDataStruct)));

	/*防淹门数据配置结构体*/
	chRtn &= CommonMemSet(FloodGateConfigDataStru, (UINT32)(FLOOD_GATE_SUM_MAX * sizeof(FloodGateConfigDataStruct)), 0u, (UINT32)(FLOOD_GATE_SUM_MAX * sizeof(FloodGateConfigDataStruct)));

	/*车库门数据配置结构体*/
	chRtn &= CommonMemSet(GaragedoorConfigDataStru, (UINT32)(GARAGE_DOOR_SUM_MAX * sizeof(GaragedoorConfigDataStruct)), 0u, (UINT32)(GARAGE_DOOR_SUM_MAX * sizeof(GaragedoorConfigDataStruct)));

	/*指示器数据配置结构体*/
	chRtn &= CommonMemSet(IndicatorConfigDataStru, (UINT32)(INDICATOR_SUM_MAX * sizeof(IndicatorConfigDataStruct)), 0u, (UINT32)(INDICATOR_SUM_MAX * sizeof(IndicatorConfigDataStruct)));

	/*侵限区段数据结构体数组*/
	chRtn &= CommonMemSet(InvSecConfigDataStru, (UINT32)(INVA_SECT_N_COND_SWIT_SUM_MAX * sizeof(InvSecConfigDataStruct)), 0u, (UINT32)(INVA_SECT_N_COND_SWIT_SUM_MAX * sizeof(InvSecConfigDataStruct)));

	/*各CI站到ATS码位配置数据*/
	chRtn &= CommonMemSet(CiToAtsMaskConfigDataStru, (UINT32)(CI_TO_ATS_MASK_SUM_MAX * sizeof(MaskConfigDataStruct)), 0u, (UINT32)(CI_TO_ATS_MASK_SUM_MAX * sizeof(MaskConfigDataStruct)));

	/*各CI站到ZC码位配置数据*/
	chRtn &= CommonMemSet(CiToZcMaskConfigDataStru, (UINT32)(CI_TO_ZC_MASK_SUM_MAX * sizeof(MaskConfigDataStruct)), 0u, (UINT32)(CI_TO_ZC_MASK_SUM_MAX * sizeof(MaskConfigDataStruct)));

	/*各ZC站到CI码位配置数据*/
	chRtn &= CommonMemSet(ZcToCiMaskConfigDataStru, (UINT32)(ZC_TO_CI_MASK_SUM_MAX * sizeof(MaskConfigDataStruct)), 0u, (UINT32)(ZC_TO_CI_MASK_SUM_MAX * sizeof(MaskConfigDataStruct)));

	/*各CI到LEU码位配置数据*/
	chRtn &= CommonMemSet(CiToLeuMaskConfigDataStru, (UINT32)(CI_TO_LEU_MASK_SUM_MAX * sizeof(MaskConfigDataStruct)), 0u, (UINT32)(CI_TO_LEU_MASK_SUM_MAX * sizeof(MaskConfigDataStruct)));

	/*非进路数据结构体数组*/
	chRtn &= CommonMemSet(NonRouteConfigDataStruArr, (UINT32)(NONROUTE_ID_NUM_MAX * sizeof(NonRouteConfigDataStruct)), 0u, (UINT32)(NONROUTE_ID_NUM_MAX * sizeof(NonRouteConfigDataStruct)));

	/*OVERLAP数据配置结构体*/
	chRtn &= CommonMemSet(OverlapConfigDataStru, (UINT32)(OVERLAP_SUM_MAX * sizeof(OverlapConfigDataStruct)), 0u, (UINT32)(OVERLAP_SUM_MAX * sizeof(OverlapConfigDataStruct)));

	/*站台门控制器数据配置结构体*/
	chRtn &= CommonMemSet(PscConfigDataStru, (UINT32)(PSC_SUM_MAX * sizeof(PscConfigDataStruct)), 0u, (UINT32)(PSC_SUM_MAX * sizeof(PscConfigDataStruct)));

	/*屏蔽门数据配置结构体*/
	chRtn &= CommonMemSet(PsdConfigDataStru, (UINT32)(PSD_SUM_MAX * sizeof(PsdConfigDataStruct)), 0u, (UINT32)(PSD_SUM_MAX * sizeof(PsdConfigDataStruct)));

	/*继电器配置数据结构体数组*/
	chRtn &= CommonMemSet(RelayConfigDataStru, (UINT32)(RELAY_SUM_MAX * sizeof(RelayConfigDataStruct)), 0u, (UINT32)(RELAY_SUM_MAX * sizeof(RelayConfigDataStruct)));

	/*反向进路数据配置结构体*/
	chRtn &= CommonMemSet(ReverseRouteConfigDataStru, (UINT32)(ROUTE_SUM_MAX * sizeof(ReverseRouteConfigDataStruct)), 0u, (UINT32)(ROUTE_SUM_MAX * sizeof(ReverseRouteConfigDataStruct)));

	/*长调进路配置数据结构体*/
	chRtn &= CommonMemSet(LongRouteConfigDataStru, (UINT32)(ROUTE_LONG_SUM_MAX * sizeof(LongRouteConfigDataStruct)), 0u, (UINT32)(ROUTE_LONG_SUM_MAX * sizeof(LongRouteConfigDataStruct)));

	/*计轴区段配置数据结构体*/
	chRtn &= CommonMemSet(AxisSectionConfigDataStru, (UINT32)(AXIS_SECTION_SUM_MAX * sizeof(AxisSectionConfigDataStruct)), 0u, (UINT32)(AXIS_SECTION_SUM_MAX * sizeof(AxisSectionConfigDataStruct)));

	/*逻辑区段配置数据结构体*/
	chRtn &= CommonMemSet(LogicSectionConfigDataStru, (UINT32)(LOGIC_SECTION_SUM_MAX * sizeof(LogicSectionConfigDataStruct)), 0u, (UINT32)(LOGIC_SECTION_SUM_MAX * sizeof(LogicSectionConfigDataStruct)));

	/*物理区段数据配置结构体*/
	chRtn &= CommonMemSet(PhysicalSectionConfigDataStru, (UINT32)(PHYSICAL_SECTION_SUM_MAX * sizeof(PhysicalSectionConfigDataStruct)), 0u, (UINT32)(PHYSICAL_SECTION_SUM_MAX * sizeof(PhysicalSectionConfigDataStruct)));

	/*信号机数据配置结构体*/
	chRtn &= CommonMemSet(SignalConfigDataStru, (UINT32)(SIGNAL_SUM_MAX * sizeof(SignalConfigDataStruct)), 0u, (UINT32)(SIGNAL_SUM_MAX * sizeof(SignalConfigDataStruct)));

	/* SPKS配置数据结构体 */
	chRtn &= CommonMemSet(spksDataConfigBuff, (UINT32)(SPKS_SUM_MAX * sizeof(SpksDataConfigStruct)), 0u, (UINT32)(SPKS_SUM_MAX * sizeof(SpksDataConfigStruct)));

	/* 门禁配置数据结构体 */
	chRtn &= CommonMemSet(MjDataConfigBuff, (UINT32)(MJ_SUM_MAX * sizeof(MJDataConfigStruct)), 0u, (UINT32)(MJ_SUM_MAX * sizeof(MJDataConfigStruct)));

	/*道岔数据配置结构体*/
	chRtn &= CommonMemSet(SwitchConfigDataStru, (UINT32)(SWITCH_SUM_MAX * sizeof(SwitchConfigDataStruct)), 0u, (UINT32)(SWITCH_SUM_MAX * sizeof(SwitchConfigDataStruct)));

	/*洗车机数据配置结构体*/
	chRtn &= CommonMemSet(WashMachineConfigDataStru, (UINT32)(WASHMACHINE_SUM_MAX * sizeof(WashMachineConfigDataStruct)), 0u, (UINT32)(WASHMACHINE_SUM_MAX * sizeof(WashMachineConfigDataStruct)));

	/*声光报警器配置数据结构体*/
	chRtn &= CommonMemSet(SGBJConfigDataStru, (UINT32)(SGBJ_SUM_MAX * sizeof(SGBJConfigDataStruct)), 0u, (UINT32)(SGBJ_SUM_MAX * sizeof(SGBJConfigDataStruct)));

	return chRtn;
}

/*
* 功能描述：	读入联锁配置文件
* 参数说明：	无
* 返回值  ：	0u,读入成功
*				1,配置数据赋值失败
*               2,查询函数初始化失败
*               3,配置数据整理失败
*               4,联锁ID错误
*               5,相邻联锁发送给本联锁配置数据整理失败
*/
UINT8 ReadConfigureData(void)
{
	UINT8 rtnVal = 0u;
	UINT8 virCINum =0u;
	UINT8 virCIid = 0u;
	UINT8 i = 0u;
	INT16 indicatorNum = 0; 
	UINT8 initAllRet = 0u;
	UINT8 includeVirFlag= 0u;
	UINT8 retValue = 0u;
	UINT8 CiPattern = 0u;
	UINT8 chInitAllStaticDataStrRtn = 0u;
	UINT8 RtnTemp = 0u;


	
	initAllRet = InitAll((const)DataPath);
    if (LocalCiId == 0u)
    {
#ifdef PLATFORM_2OO2
        
		(void)printf("LocalCiId Error\n");
        debug_infor_printf((const)"LocalCiId Error\n");
#endif
        rtnVal =  4u;
    }

    /*初始化查询函数*/
    else if (1u != initAllRet)
    {
#ifdef PLATFORM_2OO2
        
		(void)printf("InitAll Error\n");
        debug_infor_printf((const)"InitAll Error\n");
#endif
        /*读入查询函数失败*/
        rtnVal = 2u;
    }
	else
	{
		/*静态数据结构体初始化*/
		chInitAllStaticDataStrRtn = InitAllStaticDataStr();
		if (1u == chInitAllStaticDataStrRtn)
		{/*cgh-合并CID-2539-6：*/
			if (0u == rtnVal)
			{
				/*传递参数为结构体地址，返回值为该数据结构体个数*/
				RelayCurSum = ReadRelayConfigData(LocalCiId, RelayConfigDataStru);                              /*读继电器配置数据返回RelayCurSum下雷同*/
				if (-1 == RelayCurSum)
				{
					rtnVal = 7u;/*读取继电器失败*/
					debug_infor_printf((const)"ReadRelayConfigData fail.");
				}
				else
				{
					; /*不处理*/
				}
			}
			else
			{
				; /*不处理*/
			}
			if (0u == rtnVal)
			{
				SignalCurSum = ReadSignalConfigData(LocalCiId, SignalConfigDataStru);                           /*读信号机配置数据*/
				if (-1 == SignalCurSum)
				{
					rtnVal = 8u;/*读取信号机数据失败*/
					debug_infor_printf((const)"ReadSignalConfigData fail.");
				}
				else
				{
					; /*不处理*/
				}
			}
			else
			{
				; /*不处理*/
			}
			if (0u == rtnVal)
			{
				WashMachineCurSum = ReadWashMachineConfigData(LocalCiId, WashMachineConfigDataStru);            /*读取洗车机配置数据*/
			}
			else
			{
				; /*不处理*/
			}
			if (0u == rtnVal)
			{
				SwitchCurSum = ReadSwitchConfigData(LocalCiId, SwitchConfigDataStru);                           /*读道岔配置数据*/
				if (-1 == SwitchCurSum)
				{
					rtnVal = 9u;/*读取道岔数据失败*/
					debug_infor_printf((const)"ReadSwitchConfigData fail.");
				}
				else
				{
					; /*不处理*/
				}
			}
			else
			{
				; /*不处理*/
			}
			if (0u == rtnVal)
			{
				PhysicalSectionCurSum = ReadPhySicalSectionConfigData(LocalCiId, PhysicalSectionConfigDataStru);/*读物理区段配置数据*/
				if (-1 == PhysicalSectionCurSum)
				{
					rtnVal = 10u;/*读取物理区段数据失败*/
					debug_infor_printf((const)"ReadPhySicalSectionConfigData fail.");
				}
				else
				{
					; /*不处理*/
				}
			}
			else
			{
				; /*不处理*/
			}

			if (0u == rtnVal)
			{
				AxisSectionCurSum = ReadAxisSectionConfigData(LocalCiId, AxisSectionConfigDataStru, &g_eaAcConfigNum, g_szEaAcConfig);            /*读计轴区段配置数据*/
				if (-1 == AxisSectionCurSum)
				{
					rtnVal = 11u;/*读取计轴区段数据失败*/
					debug_infor_printf((const)"ReadAxisSectionConfigData fail.");
				}
				else
				{
					; /*不处理*/
				}
			}
			else
			{
				; /*不处理*/
			}

			if (0u == rtnVal)
			{
				trackCheckRes = ReadTrackSectionConfigData(PhysicalSectionConfigDataStru);/*读取轨道区段配置*/
				if (-1 == trackCheckRes)
				{
					rtnVal = 25u;/*读取轨道区段配置数据失败*/
					debug_infor_printf((const)"ReadTrackSectionConfigData fail.");
				}
				else
				{
					; /*不处理*/
				}
			}
			else
			{
				; /*不处理*/
			}

			if (0u == rtnVal)
			{
				LogicSectionCurSum = ReadLogicSectionConfigData(LocalCiId, LogicSectionConfigDataStru);         /*读逻辑区段配置数据*/
				if (-1 == LogicSectionCurSum)
				{
					rtnVal = 12u;/*读取逻辑区段数据失败*/
					debug_infor_printf((const)"ReadLogicSectionConfigData fail.");
				}
				else
				{
					; /*不处理*/
				}
			}
			else
			{
				; /*不处理*/
			}

			if (0u == rtnVal)
			{
				EsbCurSum = ReadEsbConfigData(LocalCiId, EsbConfigDataStru);                                    /*读紧急停车按钮配置数据*/
				if (-1 == EsbCurSum)
				{
					rtnVal = 13u;/*读取紧急停车按钮配置数据失败*/
					debug_infor_printf((const)"ReadEsbConfigData fail.");
				}
				else
				{
					; /*不处理*/
				}
			}
			else
			{
				; /*不处理*/
			}

			if (0u == rtnVal)
			{
				PsdCurSum = ReadPsdConfigData(LocalCiId, PsdConfigDataStru);                                    /*读屏蔽门配置数据*/
				if (-1 == PsdCurSum)
				{
					rtnVal = 14u;/*读取psd配置数据失败*/
					debug_infor_printf((const)"ReadPsdConfigData fail.");
				}
				else
				{
					; /*不处理*/
				}
			}
			else
			{
				; /*不处理*/
			}

			if (0u == rtnVal)
			{
				RouteCurSum = ReadRouteConfigData(LocalCiId, RouteConfigDataStru);                              /*读进路配置数据*/
				if (-1 == RouteCurSum)
				{
					rtnVal = 15u;/*读取进路配置数据失败*/
					debug_infor_printf((const)"ReadRouteConfigData fail.");
				}
				else
				{
					; /*不处理*/
				}
			}
			else
			{
				; /*不处理*/
			}

			if (0u == rtnVal)
			{
				AutoRouteCurSum = ReadAutoRouteConfigData(LocalCiId, AutoRouteConfigDataStru);                  /*读自动通过进路配置数据*/
				if (-1 == AutoRouteCurSum)
				{
					rtnVal = 16u;/*读取自动通过进路配置数据失败*/
					debug_infor_printf((const)"ReadAutoRouteConfigData fail.");
				}
				else
				{
					; /*不处理*/
				}
			}
			else
			{
				; /*不处理*/
			}

			if (0u == rtnVal)
			{
				AutoReturnCurSum = ReadAutoReturnConfigData(LocalCiId, AutoReturnConfigDataStru);               /*读自动折返进路配置数据*/
				if (-1 == AutoReturnCurSum)
				{
					rtnVal = 17u;/*读取自动折返进路配置数据失败*/
					debug_infor_printf((const)"ReadAutoReturnConfigData fail.");
				}
				else
				{
					; /*不处理*/
				}
			}
			else
			{
				; /*不处理*/
			}

			if (0u == rtnVal)
			{
				ReverseRouteCurSum = ReadReverseRouteConfigData(LocalCiId, ReverseRouteConfigDataStru);         /*读反向进路配置数据*/
				if (-1 == ReverseRouteCurSum)
				{
					rtnVal = 18u;/*读取反向折返进路配置数据失败*/
					debug_infor_printf((const)"ReadReverseRouteConfigData fail.");
				}
				else
				{
					; /*不处理*/
				}
			}
			else
			{
				; /*不处理*/
			}

			if (0u == rtnVal)
			{
				LongRouteCurSum = ReadLongRouteConfigData(LongRouteConfigDataStru);                             /*读长调进路配置数据*/
				if (-1 == LongRouteCurSum)
				{
					rtnVal = 19u;/*读取长调进路配置数据失败*/
					debug_infor_printf((const)"ReadLongRouteConfigData fail.");
				}
				else
				{
					; /*不处理*/
				}
			}
			else
			{
				; /*不处理*/
			}

			if (0u == rtnVal)
			{
				includeVirFlag = GetCiFunctionSwitchConfig(FUNC_INCLUDEVIRCI_FLAG);
				if (FUNC_SWITCH_ON == includeVirFlag)
				{
					virCINum = GetVirtualCINum();
					for (i = 0u; i < virCINum; i++)
					{
						virCIid = GetVirtualCIid(i);

						indicatorNum = ReadIndicatorConfigData_Vir(LocalCiId, virCIid, g_VirtualCIStructData.virtualCi[i].IndicatorConfigData);

						if (0 > indicatorNum)
						{
							rtnVal = 20u;/*读取指示灯报警灯配置数据失败*/
							debug_infor_printf((const)"ReadIndicatorConfigData_Vir fail.");
						}
						else
						{
							SetVirCIIndicatorConfigDataNum(virCIid, (UINT8)indicatorNum);
						}

					}
				}
				else
				{
					IndicatorCurSum = ReadIndicatorConfigData(LocalCiId, IndicatorConfigDataStru);                  /*读指示灯报警灯配置数据*/
					if (-1 == IndicatorCurSum)
					{
						rtnVal = 20u;/*读取指示灯报警灯配置数据失败*/
						debug_infor_printf((const)"ReadIndicatorConfigData fail.");
					}
				}
			}
			else
			{
				; /*不处理*/
			}

			if (0u == rtnVal)
			{
				OverlapCurSum = ReadOverlapConfigData(LocalCiId, OverlapConfigDataStru);                        /*读保护区段配置数据*/
				if (-1 == OverlapCurSum)
				{
					rtnVal = 21u;/*读保护区段配置数据失败*/
					debug_infor_printf((const)"ReadOverlapConfigData fail.");
				}
				else
				{
					; /*不处理*/
				}
			}
			else
			{
				; /*不处理*/
			}

			if (0u == rtnVal)
			{
				g_ret = ReadCutoffPointConfigData(LocalCiId, g_szCfpConfig);
				if (-1 == g_ret)
				{
					rtnVal = 27u;/*读保护区段配置数据失败*/
					debug_infor_printf((const)"ReadCutoffPointConfigData fail.");
				}
				else if (0 < g_ret)
				{
					gCfpConfigSum = (UINT16)g_ret;
				}
				else
				{
					/*无操作*/
				}
			}
			else
			{
				; /*不处理*/
			}

			if (0u == rtnVal)
			{
				g_ret = ReadReverseCutConfigData(LocalCiId, gstReverseCutCfgData);
				if (-1 == g_ret)
				{
					rtnVal = 28u;/*读保护区段配置数据失败*/
					debug_infor_printf((const)"ReadReverseCutConfigData fail.");
				}
				else if (0 < g_ret)
				{
					gReverseCutCfgSum = g_ret;
				}
				else
				{
					/*无操作*/
				}
			}
			else
			{
				; /*不处理*/
			}
			if (0u == rtnVal)
			{
				TransmitRelaDataCurSum = ReadTransmitRelationConfigData(LocalCiId, TransmitRelaDataStru);       /*读通信关系配置数据*/
			}
			else
			{
				; /*不处理*/
			}

			if (0u == rtnVal)
			{
				CiToAtsMaskCurSum = ReadCiToAtsMaskConfigData(LocalCiId, CiToAtsMaskConfigDataStru);            /*读CI-ATS配置数据*/
			}
			else
			{
				; /*不处理*/
			}

			if (0u == rtnVal)
			{
				CiToZcMaskCurSum = ReadCiToZcMaskConfigData(LocalCiId, CiToZcMaskConfigDataStru);               /*读CI-ZC配置数据*/
			}
			else
			{
				; /*不处理*/
			}

			if (0u == rtnVal)
			{
				ZcToCiMaskCurSum = ReadZcToCiMaskConfigData(LocalCiId, ZcToCiMaskConfigDataStru);               /*读ZC-CI配置数据*/
			}
			else
			{
				; /*不处理*/
			}
			if (0u == rtnVal)
			{
				CiToLeuMaskCurSum = ReadCiToLeuMaskConfigData(LocalCiId, CiToLeuMaskConfigDataStru);            /*读CI-LEU配置数据*/
			}
			else
			{
				; /*不处理*/
			}

			if (0u == rtnVal)
			{
				AllAutoReturnCurSum = ReadAllAutoReturnConfigData(LocalCiId, AllAutoReturnConfigDataStru);      /*读全自动折返进路配置数据*/
				if (-1 == AllAutoReturnCurSum)
				{
					rtnVal = 22u;/*读全自动折返进路配置数据失败*/
					debug_infor_printf((const)"ReadAllAutoReturnConfigData fail.");
				}
				else
				{
					; /*不处理*/
				}
			}
			else
			{
				; /*不处理*/
			}
			if (0u == rtnVal)
			{
				GaragedoorCurSum = ReadGaragedoorConfigData(LocalCiId, GaragedoorConfigDataStru);               /*读车库门配置数据*/
				if (-1 == GaragedoorCurSum)
				{
					rtnVal = 23u;/*读车库门配置数据失败*/
					debug_infor_printf((const)"ReadGaragedoorConfigData fail.");
				}
				else
				{
					; /*不处理*/
				}
			}
			else
			{
				; /*不处理*/
			}
			if (0u == rtnVal)
			{
				spksSum = ReadSpksConfigData(LocalCiId, spksDataConfigBuff);		                                /* SPKS 配置数据 */
				if (-1 == spksSum)
				{
					rtnVal = 24u;/*读SPKS 配置数据失败*/
					debug_infor_printf((const)"ReadSpksConfigData fail.");
				}

				else
				{
					; /*不处理*/
				}
			}
			else
			{
				; /*不处理*/
			}
			if (0u == rtnVal)
			{
				ciTransNum = ReadCiTransConfigData(LocalCiId, ciTransmitStruct);	                                /* 相连联锁配置数据读取 */
			}
			else
			{
				; /*不处理*/
			}
			if (0u == rtnVal)
			{
				
				gmjSum = ReadMJConfigData(LocalCiId, MjDataConfigBuff);                                           /*读门禁配置数据*/
				if (-1 == gmjSum)
				{
					rtnVal = 37u;/*读门禁配置数据失败*/
					debug_infor_printf((const)"Read MenjinData fail.");
				}
				else
				{
					; /*不处理*/
				}
			}
			else
			{
				; /*不处理*/
			}


			if (0u == rtnVal)
			{
				InvSecSum = ReadInvaSectionConfigData(LocalCiId, InvSecConfigDataStru);							/*读侵入区段配置数据*/
				if (-1 == InvSecSum)
				{
					rtnVal = 6u;
					debug_infor_printf((const)"ReadConfigureData errcode =%d, invSec exceed Index", rtnVal);
				}
				else
				{
					; /*不处理*/
				}
			}
			else
			{
				; /*不处理*/
			}

			if (0u == rtnVal)
			{/*读取防掩门的配置数据*/
				FloodGateCurSum = ReadFloodGateConfigData(LocalCiId, FloodGateConfigDataStru);
				if (-1 == FloodGateCurSum)
				{
					rtnVal = 25u;
					debug_infor_printf((const)"ReadConfigureData errcode =%d, floodGate exceed Index", rtnVal);
				}
				else
				{
					; /*不处理*/
				}
			}
			else
			{
				; /*不处理*/
			}


			if (0u == rtnVal)
			{
				PscCurSum = ReadPscConfigData(LocalCiId, PscConfigDataStru);                                    /*读站台门控制器配置数据*/
				if (-1 == PscCurSum)
				{
					rtnVal = 26u;/*读取psc配置数据失败*/
					debug_infor_printf((const)"ReadPscConfigData fail.");
				}
				else
				{
					; /*不处理*/
				}
			}
			else
			{
				; /*不处理*/
			}

			if (0u == rtnVal)
			{
				gNonReturnCurSum = ReadNonReturnConfigData(LocalCiId, NonReturnConfigDataStru);                                    /*读站台门控制器配置数据*/
				if (-1 == gNonReturnCurSum)
				{
					rtnVal = 27u;/*读取无人折返配置数据失败*/
					debug_infor_printf((const)"ReadNonReturnConfigData fail.");
				}
				else
				{
					; /*不处理*/
				}
			}
			else
			{
				; /*不处理*/
			}
			if (0u == rtnVal)
			{
				DiffLineDevSum = ReadDiffLineDevConfigData(LocalCiId, &DiffLineDevData);

				ReadEmapCiConfig(gEmapCiConfigStrus);/*读取各CI的电子地图校验版本配置数据*/

				RtnTemp = ReadVirtualDevicesInit(PsdConfigDataStru, EsbConfigDataStru, spksDataConfigBuff, RelayConfigDataStru, IndicatorConfigDataStru);/*计算设备虚拟属性*/					/*读虚拟设备表*/
				if (0u == RtnTemp)
				{
					rtnVal = 1u;
					debug_infor_printf((const)"VirtualDevicesInit Error\n");
				}
				else
				{
					;	/*继续执行*/
				}
#if 0u
				/*读联锁功能配置数据*/
				if (ReadCiFuncSwitchConfigData(&CiFuncSwitConfStru) != 1)
				{
					/*无联锁功能配置数据*/
				}
#endif

				/*读非进路调车配置数据*/
				NonRouteCurSum = ReadNonRouteConfigData(NonRouteConfigDataStruArr);
			}
			else
			{
				; /*不处理*/
			}

			/*读声光报警器配置数据*/
			if (0u == rtnVal)
			{
				SGBJCurSum = ReadSGBJConfigData(LocalCiId, SGBJConfigDataStru);
				if (-1 == SGBJCurSum)
				{
					rtnVal = 38U;  /*读取声光报警器配置数据失败*/
					debug_infor_printf((const)"ReadSGBJConfigData fail.");
				}
				else
				{
					; /*不处理*/
				}
			}
			else
			{
				; /*不处理*/
			}

			if (0u == rtnVal)
			{
				/*读系统参数配置数据*/
				if (0u == ReadSystemParamConfDataNew(LocalCiId, &SystemParameterStruNew))
				{
#ifdef PLATFORM_2OO2

					(void)printf("SystemParameterConfigData Error\n");
					debug_infor_printf((const)"SystemParameterConfigData Error\n");
#endif
					rtnVal = 1u;
				}
				else
				{
					/*读应急盘继电器数据*/
					JkjRelayId = ReadJkjRelayId(LocalCiId);

					/*释放查询函数申请的动态空间*/
					FreeMem();

					if (1u == DeviceDataManage())
					{/*整理数据失败*/
#ifdef PLATFORM_2OO2

						(void)printf("DeviceDataManage Error\n");

#endif
						rtnVal = 3u;
					}
					else if (1u == NeibourToLocalDevConfDataManage(LocalCiId))
					{/*整理相邻联锁发送给本联锁的数据失败*/
#ifdef PLATFORM_2OO2

						(void)printf("NeibourToLocalDeviceDataManage Error\n");
						debug_infor_printf((const)"NeibourToLocalDeviceDataManage Error\n");
#endif
						rtnVal = 5u;

					}
					else
					{/*整理数据成功*/
						rtnVal = 0u;
					}
				}
			}
			else
			{
				; /*不处理*/
			}

			if (0u == rtnVal)
			{/*读取信号机驱采类型对应开放颜色配置*/
				g_ret = ReadSignalDrvTypeOpenColorCfg();
				if (-1 == g_ret)
				{
					rtnVal = 30u;
					debug_infor_printf((const)"ReadSignalDrvTypeOpenColorConfig errcode =%d, floodGate exceed Index", rtnVal);
				}
				else
				{
					rtnVal = 0u;
				}
			}
			else
			{
				; /*不处理*/
			}
			if (0u == rtnVal)
			{/*读取组合自动进路表数据*/
				g_ret = ReadGroupAutoRouteConfigData(GroupAutoRouteConfigDataStru);
				if (-1 == g_ret)
				{
					rtnVal = 31u;
					debug_infor_printf((const)"ReadGroupAutoRouteConfigData errcode =%d, GroupAutoRoute", rtnVal);
				}
				else
				{
					rtnVal = 0u;
				}
			}
			else
			{
				; /*不处理*/
			}
			if (0u == rtnVal)
			{
				g_ret = ReadZhaochaCheckConfigData();
				if (-1 == g_ret)
				{
					rtnVal = 32u;
					debug_infor_printf((const)"ReadZhaochaCheckConfigData errcode =%d, ZhaochaCheckConfigData", rtnVal);
				}
				else
				{
					rtnVal = 0u;
				}
			}
			else
			{
				; /*不处理*/
			}

			/* 新增link配置数据读取 2022.02.28 */
			if (0u == rtnVal)
			{
				/*读取LINK配置数据*/
				g_ret = ReadLinkConfigData(g_szLinkConfigData);
				if (-1 == g_ret)
				{
					rtnVal = 33u;
					debug_infor_printf((const)"ReadLinkConfigData errcode =%d, ReadLinkConfigData", rtnVal);
				}
				else
				{
					g_linkNum = (UINT16)g_ret;
				}
			}
			else
			{
				; /*不处理*/
			}

			if (0u == rtnVal)
			{
				/*读取防护区域配置数据*/
				g_ret = ReadEaConfigData(g_szEaConfig);
				if (-1 == g_ret)
				{
					rtnVal = 40u;
					debug_infor_printf((const)"ReadEaConfigData errcode =%d, ReadEaConfigData", rtnVal);
				}
				else
				{
					g_eaConfigNum = (UINT16)g_ret;
				}
			}
			else
			{
				; /*不处理*/
			}

			/* 新增计轴器配置数据读取 2022.03.11 */
			if (0u == rtnVal)
			{
				/*读取计轴器配置数据*/
				g_ret = ReadAxisConfigData(g_szAxisData);
				if (-1 == g_ret)
				{
					rtnVal = 36u;
					debug_infor_printf((const)"ReadAxisConfigData errcode =%d, ReadAxisConfigData", rtnVal);
				}
				else
				{
					g_axisNum = (UINT16)g_ret;
				}
			}
			else
			{
				; /*不处理*/
			}

			if (0u == rtnVal)
			{
				/*检查ZC配置数目*/
				g_ret = (INT16)CheckCiHaveZcSumErr(LocalCiId);
				if (1 < g_ret)
				{
					rtnVal = 34u;
					debug_infor_printf((const)"CheckCiHaveZcSumErr errcode =%d, CheckCiHaveZcSumErr", rtnVal);
				}
			}
			else
			{
				; /*不处理*/
			}

			CiPattern = GetLocalCiPattern();

			/*全电子联锁*/
			if (CI_PATTERN_FULL_ELECTRONIC == CiPattern)
			{
				if (0u == rtnVal)
				{
					retValue = OcConnectConfigDataStructInit();

					if (CI_SUCCESS == retValue)
					{
						/*读取联络线数据*/
						g_ret = OcConnectConfigDataToDevStruct(SignalConfigDataStru, PhysicalSectionConfigDataStru, SwitchConfigDataStru, OcConnetDataCfgStru, RelayConfigDataStru);
						if (-1 == g_ret)
						{
							rtnVal = 35u;
							debug_infor_printf((const)"OcConnectConfigDataToDevStruct errcode =%d, OcConnectConfigDataToDevStruct", rtnVal);
						}
					}
					else
					{
						rtnVal = 35u;
						debug_infor_printf((const)"OcConnectConfigDataStructInit errcode =%d, OcConnectConfigDataStructInit", rtnVal);
					}
				}
				else
				{
					; /*不处理*/
				}
			}
			else
			{
				; /*不处理*/
			}

			if (0u == rtnVal)
			{
				/*从CI配置表读取主体信号机与复示信号机关系表*/
				g_ret = (INT16)ReadSigWithFushiSigRelatData((const)DataPath);

				if (0 == g_ret)
				{
					debug_infor_printf((const)"ReadSigWithFushiSigRelatData fail.\r\n");
					rtnVal = 35u;
				}
			}

			if (0u == rtnVal)
			{
				/*从CI配置表读取总SPKS管辖各SPKS关系表*/
				g_ret = (INT16)ReadTotalSpksWithSpksRelatData((const)DataPath);

				if (0 == g_ret)
				{
					debug_infor_printf((const)"ReadTotalSpksWithSpksRelatData fail.\r\n");
					rtnVal = 36u;
				}
				else
				{
					; /*不处理*/
				}
			}
			else
			{
				; /*不处理*/
			}

			if (0u == rtnVal)
			{
				/*读取整理物理区段Arb检查范围*/
				g_ret = (INT16)PhySectionNearConfigDataManage();
				if (0 == g_ret)
				{
					debug_infor_printf((const)"PhySectionNearConfigDataManage Error\n");
					rtnVal = 41u;
				}
				else
				{
					; /*不处理*/
				}
			}
			else
			{
				; /*不处理*/
			}

			if (0U == rtnVal)
			{
				/*读取物理区段在计轴中的索引*/
				g_ret = (INT16)ReadPhySecIndexInAxle(LocalCiId, PhysicalSectionConfigDataStru);
				if (0 == g_ret)
				{
					debug_infor_printf((const)"ReadPhySecIndexInAxle Error\n");
					rtnVal = 42u;
				}
				else
				{
					; /*不处理*/
				}
			}
			else
			{
				; /*不处理*/
			}
		}
		else
		{
		/*静态数据结构体初始化失败*/
#ifdef PLATFORM_2OO2

			(void)printf("InitAllStaticDataStr Error\n");
		debug_infor_printf((const)"InitAllStaticDataStr Error\n");
#endif
		rtnVal = 2u;
		}


	}

	return rtnVal;
}


/*
* 功能描述：	整理读入的设备配置数据
* 参数说明：	无
* 返回值  ：	0u,整理成功
*				>0u,整理失败
*/
UINT8 DeviceDataManage(void)
{
	UINT8 rtValue = 0u;
	UINT8 includeVirFlag= GetCiFunctionSwitchConfig(FUNC_INCLUDEVIRCI_FLAG);
	UINT8 reval = CI_ERROR;
    /*整理继电器数据*/
    if (CI_ERROR == RelayConfigDataManage())
    {
        rtValue = 1u;
    }

    /*整理信号机数据*/
    else if (CI_ERROR == SignalConfigDataManage())
    {
        rtValue = 1u;
    }

    /*整理道岔数据*/
    else if (CI_ERROR == SwitchConfigDataManage())
    {
        rtValue = 1u;
    }

    /*整理计轴区段数据*/
    else if (CI_ERROR == AxisSectionConfigDataManage())
    {
        rtValue = 1u;
    }

    /*整理逻辑区段数据*/
    else if (CI_ERROR == LogicSectionConfigDataManage())
    {
        rtValue = 1u;
    }

    /*整理物理区段数据*/
    else if (CI_ERROR == PhySectionConfigDataManage())
    {
        rtValue = 1u;
    }

    /*整理进路数据*/
    else if (CI_ERROR == RouteConfigDataManage())
    {
        rtValue = 1u;
    }

    /*整理自动折返进路数据*/
    else if (CI_ERROR == AutoReturnConfigDataManage())
    {
        rtValue = 1u;
    }

	/*整理反向进路数据*/
	else if(CI_ERROR == ReverseRouteConfigDataManage())
	{
		rtValue =  1u;
	}
    /*整理自动进路数据*/
    else if (CI_ERROR == AutoRouteConfigDataManage())
    {
        rtValue = 1u;
    }

    /*整理保护区段组数据*/
    else if (CI_ERROR == OverlapConfigDataManage())
    {
        rtValue = 1u;
    }

    /*整理Esb数据*/
    else if (CI_ERROR == EsbConfigDataManage())
    {
        rtValue = 1u;
    }

    /*整理Psd数据*/
    else if (CI_ERROR == PsdConfigDataManage())
    {
        rtValue = 1u;
    }
	/*整理门禁数据*/
	else if (CI_ERROR == MjConfigDataManage())
	{
		rtValue = 1u;
	}


    /*整理指示灯数据*/
    /*整理全自动折返进路数据*/
    else if (CI_ERROR == AllAutoReturnConfigDataManage())
    {
        rtValue = 1u;
    }
	/*整理长调进路数据*/
	else if (CI_ERROR == LongRouteConfigDataManage())
	{
		rtValue = 1u;
	}
	/*整理车库门数据*/
    else if (CI_ERROR == GaragedoorConfigDataManage())
    {
        rtValue = 1u;
    }
	/*整理SPKS数据*/
	else if (CI_ERROR == SpksConfigDataManage())
	{
		rtValue = 1u;
	}
	/*整理洗车机数据*/
	else if(CI_ERROR == WashMachineConfigDataManage())
	{
		rtValue = 1u;
	}
	/*整理防淹门数据*/
	else if (CI_ERROR == FloodGateConfigDataManage())
	{
		rtValue = 1u;
	}
	else if(CI_ERROR == SetInvSecAndConSwiBufInd())
	{
		rtValue = 1u;
	}
	else
	{
		rtValue = 0u;
	}
	if(FUNC_SWITCH_ON == includeVirFlag)
	{
		reval = InitVirCIlocalCiIndicatorIdBuf();
		if(CI_ERROR == reval)
		{
			rtValue = 1u;
		}
	}
	else
	{
		reval = IndicatorConfigDataManage();
		if(CI_ERROR == reval)
		{
			rtValue = 1u;
		}
	}

	if (0U == rtValue)
	{
		reval = CutoffPointConfigDataManage();
		if (CI_ERROR == reval)
		{
			rtValue = 1u;
		}
	}

	if (0U == rtValue)
	{
		reval = ReverseCutConfigDataManage();
		if (CI_ERROR == reval)
		{
			rtValue = 1u;
		}
	}

	if (0U == rtValue)
	{
		reval = SGBJConfigDataManage();
		if (CI_ERROR == reval)
		{
			rtValue = 1u;
		}
	}

    return rtValue;
}
/*
* 功能描述： 获取指定自动进路ID和其他抵触自动进路数组
* 参数说明： UINT16 autoRouteRouteId指定自动进路ID   
*					UINT8 routeType 进路类型
* 返回值  ： CI_ERROR失败 CI_SUCCESS成功       
*/
UINT8 SetautoRouteOpposedRoute(UINT16 autoRouteRouteId,UINT8 routeType)
{
	UINT16 ii = 0u;
	UINT16 jj = 0u;			/*游标*/
	UINT16 kk = 0u;			/*游标*/
	UINT8 indexA = 0u;		/*索引*/
	UINT8 indexB = 0u;		/*索引*/
	UINT8 indexC = 0u;		/*索引*/
	UINT8 indexD = 0u;		/*索引*/
	UINT8 indexE = 0u;		/*索引*/
	UINT8 indexF = 0u;		/*索引*/
	UINT8 indexG = 0u;		/*索引*/
	UINT8 indexH = 0u;		/*索引*/
	UINT8 indexI = 0u;		/*索引*/

	UINT16 autoRouteSum = 0u;							/*自动通过进路总数*/
	UINT16 autoReturnSum = 0u;						/*自动折返进路总数*/
	UINT16 allAutoReturnSum = 0u;						/*全自动折返进路总数*/
	UINT16 otherAutoRouteId = 0u;					/*其他自动通过进路ID*/
	
	UINT8 returnValue = CI_ERROR;
	autoRouteSum = GetAutoRouteRouteCurSum();/*自动进路数目*/
	autoReturnSum = GetAutoReturnRouteCurSum();/*自动折返进路数目*/
    allAutoReturnSum = GetAllAutoReturnRouteCurSum();/*全自动折返进路数目*/
	if ((AUTO_ROUTE_SUM_MAX <= autoRouteSum) || (AUTO_RETURN_SUM_MAX<=autoReturnSum )
		||(ALL_AUTO_RETURN_SUM_MAX <= allAutoReturnSum))
	{/*配置数据总数错误*/
		returnValue = CI_ERROR;
	}
	else
	{
		switch (routeType)
		{
			case ROUTE_AUTOROUTE_NORMAL:
				for (jj = 0u; jj < autoRouteSum; jj++)
				{/*遍历除本自动进路外的其他自动进路*/
				
					otherAutoRouteId = GetAutoRouteRouteId(jj);/*获取配置文件中该索引下的自动通过进路ID*/
				
					if (autoRouteRouteId == otherAutoRouteId)
					{/*除去本进路*/
					} 
					else
					{
						/*判定是否冲突*/
						if (CI_SUCCESS == AutoRouteIsOpposed(autoRouteRouteId,ROUTE_AUTOROUTE_NORMAL,otherAutoRouteId,ROUTE_AUTOROUTE_NORMAL))
						{
							AutoRouteConfigDataStru[autoRouteRouteId].AutoRouteOpposedRouteIdBuf[indexA++] = otherAutoRouteId;
						}

					}

				}
				for (kk = 0u; kk < autoReturnSum; kk++)
				{/*遍历自动折返进路*/
				
					otherAutoRouteId = GetAutoReturnRouteId(kk);/*获取配置文件中该索引下的自动通过进路ID*/
				
					/*判定是否冲突*/
					if (CI_SUCCESS == AutoRouteIsOpposed(autoRouteRouteId,ROUTE_AUTOROUTE_NORMAL,otherAutoRouteId,ROUTE_AUTOROUTE_RETURN))
					{
						AutoRouteConfigDataStru[autoRouteRouteId].AutoRouteOpposedReturnIdBuf[indexB++] = otherAutoRouteId;
					}
				}

				for (ii = 0u; ii < allAutoReturnSum; ii++)
				{/*遍历全自动折返进路*/
					
					otherAutoRouteId = GetAllAutoReturnRouteId(ii);/*获取配置文件中该索引下的全自动折返进路ID*/
					
					/*判定是否冲突*/
					if (CI_SUCCESS == AutoRouteIsOpposed(autoRouteRouteId,ROUTE_AUTOROUTE_NORMAL,otherAutoRouteId,ROUTE_ALLAUTOROUTE_RETURN))
					{
						AutoRouteConfigDataStru[autoRouteRouteId].AutoRouteOpposedAllReturnIdBuf[indexC++] = otherAutoRouteId;
					}					
				}

				AutoRouteConfigDataStru[autoRouteRouteId].AutoRouteOpposedRouteIdSum = indexA;
				AutoRouteConfigDataStru[autoRouteRouteId].AutoRouteOpposedReturnIdSum = indexB;
				AutoRouteConfigDataStru[autoRouteRouteId].AutoRouteOpposedAllReturnIdSum = indexC;
				break;
			case ROUTE_AUTOROUTE_RETURN:
				for (jj = 0u; jj < autoRouteSum; jj++)
				{/*遍历自动通过进路*/
				
					otherAutoRouteId = GetAutoRouteRouteId(jj);/*获取配置文件中该索引下的自动折返进路ID*/
				
					/*判定是否冲突*/
					if (CI_SUCCESS == AutoRouteIsOpposed(autoRouteRouteId,ROUTE_AUTOROUTE_RETURN,otherAutoRouteId,ROUTE_AUTOROUTE_NORMAL))
					{/*自动折返进路和自动进路抵触*/
						AutoReturnConfigDataStru[autoRouteRouteId].AutoReturnOpposedRouteIdBuf[indexD++] = otherAutoRouteId;
					}

				}
				for (kk = 0u; kk < autoReturnSum; kk++)
				{/*遍历除本自动折返进路外的其他自动折返进路*/
				
					otherAutoRouteId = GetAutoReturnRouteId(kk);/*获取配置文件中该索引下的自动通过进路ID*/
				
					if (autoRouteRouteId == otherAutoRouteId)
					{/*除去本进路*/
					} 
					else
					{
						/*判定是否冲突*/
						if (CI_SUCCESS == AutoRouteIsOpposed(autoRouteRouteId,ROUTE_AUTOROUTE_RETURN,otherAutoRouteId,ROUTE_AUTOROUTE_RETURN))
						{/*自动折返进路和自动折返进路抵触*/
							AutoReturnConfigDataStru[autoRouteRouteId].AutoReturnOpposedReturnIdBuf[indexE++] = otherAutoRouteId;
						}
					}
				}

				for (ii = 0u; ii < allAutoReturnSum; ii++)
				{/*遍历全自动折返进路*/
					
					otherAutoRouteId = GetAllAutoReturnRouteId(ii);/*获取配置文件中该索引下的全自动折返进路ID*/
					
					/*判定是否冲突*/
					if (CI_SUCCESS == AutoRouteIsOpposed(autoRouteRouteId,ROUTE_AUTOROUTE_RETURN,otherAutoRouteId,ROUTE_ALLAUTOROUTE_RETURN))
					{
						AutoReturnConfigDataStru[autoRouteRouteId].AutoReturnOpposedAllReturnIdBuf[indexF++] = otherAutoRouteId;
					}					
				}
				AutoReturnConfigDataStru[autoRouteRouteId].AutoReturnOpposedRouteIdSum = indexD;
				AutoReturnConfigDataStru[autoRouteRouteId].AutoReturnOpposedReturnIdSum = indexE;
				AutoReturnConfigDataStru[autoRouteRouteId].AutoReturnOpposedAllReturnIdSum = indexF;

				break;
			case ROUTE_ALLAUTOROUTE_RETURN:
				for (jj = 0u; jj < autoRouteSum; jj++)
				{/*遍历自动通过进路*/
					
					otherAutoRouteId = GetAutoRouteRouteId(jj);/*获取配置文件中该索引下的自动通过进路ID*/
					
					/*判定是否冲突*/
					if (CI_SUCCESS == AutoRouteIsOpposed(autoRouteRouteId,ROUTE_ALLAUTOROUTE_RETURN,otherAutoRouteId,ROUTE_AUTOROUTE_NORMAL))
					{/*自动通过进路和全自动进路抵触*/
						AllAutoReturnConfigDataStru[autoRouteRouteId].AllAutoReturnOpposedRouteIdBuf[indexG++] = otherAutoRouteId;
					}					
				}
				for (kk = 0u; kk < autoReturnSum; kk++)
				{/*遍历自动折返进路*/
					
					otherAutoRouteId = GetAutoReturnRouteId(kk);/*获取配置文件中该索引下的自动折返进路ID*/
					
					/*判定是否冲突*/
					if (CI_SUCCESS == AutoRouteIsOpposed(autoRouteRouteId,ROUTE_ALLAUTOROUTE_RETURN,otherAutoRouteId,ROUTE_AUTOROUTE_RETURN))
					{
						AllAutoReturnConfigDataStru[autoRouteRouteId].AllAutoReturnOpposedReturnIdBuf[indexH++] = otherAutoRouteId;
					}					
				}
				
				for (ii = 0u; ii < allAutoReturnSum; ii++)
				{/*遍历除本全自动折返进路外的其他全自动折返进路*/
					
					otherAutoRouteId = GetAllAutoReturnRouteId(ii);/*获取配置文件中该索引下的全自动折返进路ID*/
					
					if (autoRouteRouteId == otherAutoRouteId)
					{/*除去本进路*/
					} 
					else
					{
						/*判定是否冲突*/
						if (CI_SUCCESS == AutoRouteIsOpposed(autoRouteRouteId,ROUTE_ALLAUTOROUTE_RETURN,otherAutoRouteId,ROUTE_ALLAUTOROUTE_RETURN))
						{
							AllAutoReturnConfigDataStru[autoRouteRouteId].AllAutoReturnOpposedAllRtnIdBuf[indexI++] = otherAutoRouteId;
						}						
					}					
				}

				AllAutoReturnConfigDataStru[autoRouteRouteId].AllAutoReturnOpposedRouteIdSum = indexG;
				AllAutoReturnConfigDataStru[autoRouteRouteId].AllAutoReturnOpposedReturnIdSum = indexH;
				AllAutoReturnConfigDataStru[autoRouteRouteId].AllAutoReturnOpposedAllRtnIdSum = indexI;
				break;
			default:
				/*无自动属性或者自动属性错误 不处理*/
				break;
		}
		returnValue = CI_SUCCESS;
	}
	return returnValue;
}

/*
* 功能描述： 判定指定ID的两条自动进路是否抵触
* 参数说明： UINT16 autoRouteRouteId指定自动进路ID   
			 UINT16 otherAutoRouteId另一自动进路ID
* 返回值  ： CI_ERROR: 不抵触
*			 CI_SUCCESS: 抵触      
*/
UINT8 AutoRouteIsOpposed(UINT16 autoRouteId,UINT8 routeType,UINT16 otherAutoRouteId,UINT8 otherRouteType)
{
	UINT16 kk = 0u;		/*游标*/
	UINT16 qq = 0u;		/*游标*/
	UINT16 nn = 0u;		/*游标*/

	UINT8 routeSum = 0u;              /*自动进路包含进路数目 (配置字段)*/
    UINT16 *routeIdBuf = NULL;    /*自动进路进路ID数组 (配置字段)*/
	UINT8 otherRouteSum = 0u;              /*另一自动进路包含进路数目 (配置字段)*/
    UINT16 *otherRouteIdBuf = NULL;   /*另一自动进路进路ID数组 (配置字段)*/
	UINT8 opposeRouteSum = 0u;
	UINT16 *opposeRouteBuf = NULL; 	/*相抵触的基本进路数组*/
	UINT8 returnValue = CI_ERROR;
	if ((routeType == ROUTE_AUTOROUTE_NORMAL) && (otherRouteType == ROUTE_AUTOROUTE_NORMAL))
	{
		routeSum = GetAutoRouteIncludeRouteSum(autoRouteId);/*该进路所包含进路数目*/
		routeIdBuf = GetAutoRouteIncludeRouteBuf(autoRouteId);/*获取该自动进路对应的基本进路*/
		
		otherRouteSum = GetAutoRouteIncludeRouteSum(otherAutoRouteId);/*另一进路包含进路数目*/
		otherRouteIdBuf = GetAutoRouteIncludeRouteBuf(otherAutoRouteId);/*获取该自动进路对应的基本进路*/
	} 
	else if ((routeType == ROUTE_AUTOROUTE_NORMAL) && (otherRouteType == ROUTE_AUTOROUTE_RETURN))
	{
		routeSum = GetAutoRouteIncludeRouteSum(autoRouteId);/*该进路所包含进路数目*/
		routeIdBuf = GetAutoRouteIncludeRouteBuf(autoRouteId);/*获取该自动进路对应的基本进路*/
		
		otherRouteSum = GetAutoReturnIncludeRouteSum(otherAutoRouteId);/*另一折返进路所包含进路数目*/
		otherRouteIdBuf = GetAutoReturnIncludeRouteBuf(otherAutoRouteId);/*获取该自动折返进路对应的基本进路*/
	} 
	else if ((routeType == ROUTE_AUTOROUTE_NORMAL) && (otherRouteType == ROUTE_ALLAUTOROUTE_RETURN))
	{
		routeSum = GetAutoRouteIncludeRouteSum(autoRouteId);/*该进路所包含进路数目*/
		routeIdBuf = GetAutoRouteIncludeRouteBuf(autoRouteId);/*获取该全自动进路对应的基本进路*/
		otherRouteSum = GetAllAutoReturnIncludeRouteSum(otherAutoRouteId);/*另一全自动折返进路所包含进路数目*/
		otherRouteIdBuf = GetAllAutoReturnIncludeRouteBuf(otherAutoRouteId);/*获取该全自动折返进路对应的基本进路*/
	} 
	else if ((routeType == ROUTE_AUTOROUTE_RETURN) && (otherRouteType == ROUTE_AUTOROUTE_NORMAL))
	{
		routeSum = GetAutoReturnIncludeRouteSum(autoRouteId);/*该折返进路所包含进路数目*/
		routeIdBuf = GetAutoReturnIncludeRouteBuf(autoRouteId);/*获取该自动折返进路对应的基本进路*/
		
		otherRouteSum = GetAutoRouteIncludeRouteSum(otherAutoRouteId);/*另一进路所包含进路数目*/
		otherRouteIdBuf = GetAutoRouteIncludeRouteBuf(otherAutoRouteId);/*获取该自动进路对应的基本进路*/
	}
	else if ((routeType == ROUTE_AUTOROUTE_RETURN) && (otherRouteType == ROUTE_AUTOROUTE_RETURN))
	{
		routeSum = GetAutoReturnIncludeRouteSum(autoRouteId);/*该折返进路所包含进路数目*/
		routeIdBuf = GetAutoReturnIncludeRouteBuf(autoRouteId);/*获取该自动折返进路对应的基本进路*/
		
		otherRouteSum = GetAutoReturnIncludeRouteSum(otherAutoRouteId);/*另一折返进路所包含进路数目*/
		otherRouteIdBuf = GetAutoReturnIncludeRouteBuf(otherAutoRouteId);/*获取该自动折返进路对应的基本进路*/
	}
	else if ((routeType == ROUTE_AUTOROUTE_RETURN) && (otherRouteType == ROUTE_ALLAUTOROUTE_RETURN))
	{
		routeSum = GetAutoReturnIncludeRouteSum(autoRouteId);/*该折返进路所包含进路数目*/
		routeIdBuf = GetAutoReturnIncludeRouteBuf(autoRouteId);/*获取该自动折返进路对应的基本进路*/
		otherRouteSum = GetAllAutoReturnIncludeRouteSum(otherAutoRouteId);/*另一全自动折返进路所包含进路数目*/
		otherRouteIdBuf = GetAllAutoReturnIncludeRouteBuf(otherAutoRouteId);/*获取该全自动折返进路对应的基本进路*/
	}
	else if ((routeType == ROUTE_ALLAUTOROUTE_RETURN) && (otherRouteType == ROUTE_ALLAUTOROUTE_RETURN))
	{
		routeSum = GetAllAutoReturnIncludeRouteSum(autoRouteId);/*该全自动折返进路所包含进路数目*/
		routeIdBuf = GetAllAutoReturnIncludeRouteBuf(autoRouteId);/*获取该全自动自动折返进路对应的基本进路*/
		otherRouteSum = GetAllAutoReturnIncludeRouteSum(otherAutoRouteId);/*另一全自动折返进路所包含进路数目*/
		otherRouteIdBuf = GetAllAutoReturnIncludeRouteBuf(otherAutoRouteId);/*获取该全自动折返进路对应的基本进路*/
	}
	else if ((routeType == ROUTE_ALLAUTOROUTE_RETURN) && (otherRouteType == ROUTE_AUTOROUTE_RETURN))
	{
		routeSum = GetAllAutoReturnIncludeRouteSum(autoRouteId);/*该全自动折返进路所包含进路数目*/
		routeIdBuf = GetAllAutoReturnIncludeRouteBuf(autoRouteId);/*获取该全自动自动折返进路对应的基本进路*/
		otherRouteSum = GetAutoReturnIncludeRouteSum(otherAutoRouteId);/*另一自动折返进路所包含进路数目*/
		otherRouteIdBuf = GetAutoReturnIncludeRouteBuf(otherAutoRouteId);/*获取该自动折返进路对应的基本进路*/
	}
	else if ((routeType == ROUTE_ALLAUTOROUTE_RETURN) && (otherRouteType == ROUTE_AUTOROUTE_NORMAL))
	{
		routeSum = GetAllAutoReturnIncludeRouteSum(autoRouteId);/*该全自动折返进路所包含进路数目*/
		routeIdBuf = GetAllAutoReturnIncludeRouteBuf(autoRouteId);/*获取该全自动自动折返进路对应的基本进路*/
		otherRouteSum = GetAutoRouteIncludeRouteSum(otherAutoRouteId);/*另一自动通过进路所包含进路数目*/
		otherRouteIdBuf = GetAutoRouteIncludeRouteBuf(otherAutoRouteId);/*获取该自动通过进路对应的基本进路*/
	}
	else
	{
		/*不处理*/
	}

	for (kk = 0u; kk < routeSum; kk++)
	{/*遍历指定ID自动进路基本进路*/

		for (qq = 0u; qq < otherRouteSum; qq++)
		{/*遍历另一自动进路基本进路*/
			if (routeIdBuf[kk] == otherRouteIdBuf[qq])
			{/*判定另一自动进路是否有相同基本进路*/
				returnValue = CI_SUCCESS;/*有相同，抵触*/
				break;
			} 
			else
			{
				/*不相同*/
				opposeRouteSum = GetRouteOpposedRouteIdSum(otherRouteIdBuf[qq]);
				opposeRouteBuf = GetRouteOpposedRouteIdBuf(otherRouteIdBuf[qq]);/*获取该基本进路抵触进路*/
				for (nn = 0u; nn < opposeRouteSum; nn++)
				{
					
					if (routeIdBuf[kk] == opposeRouteBuf[nn])
					{
						returnValue = CI_SUCCESS;/*该进路在不相同进路的抵触进路之中，抵触*/
						break;
					} 
				}
			}
			if (CI_SUCCESS == returnValue)
			{/*抵触则停止查找，节省遍历时间*/
				break;
			}
		}
		if (CI_SUCCESS == returnValue)
		{/*抵触则停止查找，节省遍历时间*/
			break;
		}
	}

	return returnValue;
}
/*
* 功能描述：	整理读入的相邻联锁计轴区段数据
* 参数说明：	AxisSectionConfigDataStruct* AxisSectionConfigStru,  计轴区段结构体
				UINT16 physecSum,     相邻联锁相邻联锁发给本联锁的物理区段数量
				const UINT16 *physecIdBuff,   相邻联锁发给本联锁的物理区段ID
				UINT8 DataNum     本联锁集中区计轴区段
*               DataNum  本联锁计轴区段数量
* 返回值  ：	
*/
UINT8 AddExtendAxisSecIdDataManage(AxisSectionConfigDataStruct* AxisSectionConfigStru, UINT16 physecSum,const UINT16 *physecIdBuff)
{
	UINT16  ii = 0u;
	UINT8 jj = 0u;
	UINT16 ll = 0u;
	UINT16 mm = 0U;
	UINT8 retVal = 1u;
	UINT16  index = 0u;  /*数组下标*/
	UINT8 axisSecSum = 0u;
	UINT16* pAxisSecIdBuf = NULL;
	UINT8 cFuncRet = CI_ERROR;
	for(ii = 0u;ii< physecSum;ii++)
	{  /*获取相邻联锁所包含的计轴区段信息，并将相邻联锁的计轴区段ID添加到本联锁结构体中*/
		axisSecSum = GetPAxisSectionSum(physecIdBuff[ii]);
		pAxisSecIdBuf = GetPAxisSectionIdBuf(physecIdBuff[ii]);
		if ((0u == axisSecSum) || (NULL == pAxisSecIdBuf))
		{
			retVal = 0u;  /*数据有问题*/
		} 
		else
		{
			index = totalAxisNum;
			totalAxisNum += axisSecSum;
			for (jj = 0u; jj < axisSecSum; jj++)
			{
				for (ll=0u;ll< AXIS_SECTION_SUM_MAX;ll++)
				{
					if (pAxisSecIdBuf[jj] == dquCICfgDtStr.AxisSctCfgDtStr[ll].AxisSectionId)
					{
						AxisSectionConfigStru[pAxisSecIdBuf[jj]] = dquCICfgDtStr.AxisSctCfgDtStr[ll];
						LocalCiAxisSectionIdBuf[index + jj] = dquCICfgDtStr.AxisSctCfgDtStr[ll].AxisSectionId;

						/*初始化共管区域的联络件、入口计轴和存车线属性*/
						AxisSectionConfigStru[pAxisSecIdBuf[jj]].chLinkLine = AXIS_SEC_LINK_LINE_NO;
						AxisSectionConfigStru[pAxisSecIdBuf[jj]].chEntrance = AXIS_SEC_ENTRANCE_NO;
						AxisSectionConfigStru[pAxisSecIdBuf[jj]].chStorageLineProperty = AXIS_SEC_STORAGE_LINE_NO;
						for (mm = 0U; mm < dquCICfgDtStr.wLinkLineCfgDtLen; mm++)
						{
							if (pAxisSecIdBuf[jj] == dquCICfgDtStr.LinkLineCfgDtStr[mm].wAxisSecId)
							{

								if (0x55U == dquCICfgDtStr.LinkLineCfgDtStr[mm].cLinkLineType)
								{
									/* 联络线 */
									AxisSectionConfigStru[pAxisSecIdBuf[jj]].chLinkLine = AXIS_SEC_LINK_LINE_YES;
								}
								else
								{
									/*不处理*/
								}

								if (0x55U == dquCICfgDtStr.LinkLineCfgDtStr[mm].cInType)
								{
									/* 入口 */
									AxisSectionConfigStru[pAxisSecIdBuf[jj]].chEntrance = AXIS_SEC_ENTRANCE_YES;
									debug_infor_printf((const)"AddExtendAxisSecIdDataManage: AC[%d] Init Entrance", pAxisSecIdBuf[jj]);
								}
								else
								{
									/*非本控区计轴区段，不再判断相邻计轴区段的存车线属性*/
								}

								if (0x55U == dquCICfgDtStr.LinkLineCfgDtStr[mm].cStorageLineType)
								{
									/* 存车线属性 */
									AxisSectionConfigStru[pAxisSecIdBuf[jj]].chStorageLineProperty = AXIS_SEC_STORAGE_LINE_YES;
								}
								else
								{
									/*不处理*/
								}
								break;
							}
							else
							{
								;
							}
						}

						break;
					}
				}

				cFuncRet = EnsureAxleBorderAtrr(pAxisSecIdBuf[jj]);
				if (CI_SUCCESS == cFuncRet)
				{
					AxisSectionConfigStru[pAxisSecIdBuf[jj]].cBorderAttr = AXIS_BORDER_AXLE_YES;
				}
				else
				{
					AxisSectionConfigStru[pAxisSecIdBuf[jj]].cBorderAttr = AXIS_BORDER_AXLE_NO;
				}
			}
		}

	}
	if (totalAxisNum >= AXIS_SECTION_SUM_MAX)
	{
		retVal = 0u;
	}
	return retVal;
}

 

/*********************************************
*函数功能：读取信号机驱采类型颜色配置
*参数说明：void
*返回值：-1，读取失败
		 0u，读取成功
*********************************************/
INT8 ReadSignalDrvTypeOpenColorCfg(void)
{
	INT8 rtnValue = -1;

	UINT8 funcRtn = 0u;
	UINT8* pDataAddr = NULL;         /*数据地址*/
	UINT32 DataSize = 0u;          /*数据大小（字节数）*/
	UINT16 j = 0u;
	UINT8 blockOpenColorNum = 0u;
	UINT32 excelId = 0u; /*excel id*/
	UINT32 sheetId = 0u; /*sheet id*/
	UINT32 rowLen = 0u; /*行长度*/
	UINT8 localCiPattern = 0u; /*本CI模式*/

	localCiPattern = GetLocalCiPattern();
	if (CI_PATTERN_TRADITIONAL == localCiPattern)
	{
		excelId = CI_DATA_TYPE;
		sheetId = RELAY_DRVCOLL_SIGNAL_OPEN_COLOR_ID;
		rowLen = LEN_RELAY_DRVCOLL_SIGNAL_OPEN_COLOR_ID;
	}
	else
	{
		excelId = OC_DATA_TYPE;
		sheetId = OC_RELAY_DRVCOLL_SIGNAL_OPEN_COLOR_ID;
		rowLen = OC_LEN_RELAY_DRVCOLL_SIGNAL_OPEN_COLOR_ID;
	}

	/*读取 继电器  数据*/
	funcRtn = dquGetConfigData((const)DataPath, excelId, sheetId,&pDataAddr,&DataSize);
	if(funcRtn == 0u)
	{
		/*函数调用失败*/
		rtnValue = -1;
	} 	
	else
	{/*函数调用成功*/
		rtnValue = 0;
	}

	if (0 == rtnValue)
	{
		/*求得个数*/
		if(DataSize% rowLen != 0u)
		{   
			rtnValue = -1;
			debug_infor_printf((const)"\nCI_RELAY_DATA,RELAY_DRVCOLL_SIGNAL_OPEN_COLOR_ID,len %d not equal to fs", rowLen);
			DebugPrintAppError(ERROR_fs_columns_len_not_equal_to_ci_software,CI_DEVICE_TYPE_FS_TABLE,(excelId <<8)+ sheetId,PRINT_ONCE);
		}		
	}

	if (0 == rtnValue)
	{
		SignalTypeNum = (UINT16)(DataSize/ rowLen);
		/*内存先设为无效*/
		(void)memset(SignalTypeOpenColorConfigStru, 0x00,sizeof(SignalDrvTypeOpenColorConfig) * SIGNAL_MAX_DRVCOLL_TYPE_NUM);

		/*解析数据到 信号机类型后备开放颜色配置结构体数组 */  
		for(j=0u;j<SignalTypeNum;j++)
		{
			if (j >= SIGNAL_MAX_DRVCOLL_TYPE_NUM)
			{
				rtnValue = -1;
				break;
			}

			SignalTypeOpenColorConfigStru[j].SignalId = dquCiShortFromChar(pDataAddr);
			pDataAddr +=2;
			SignalTypeOpenColorConfigStru[j].BlockOpenColorValue[0u] = (UINT8)dquCiShortFromChar(pDataAddr);
			pDataAddr +=2;
			SignalTypeOpenColorConfigStru[j].BlockOpenColorValue[1] = (UINT8)dquCiShortFromChar(pDataAddr);
			pDataAddr +=2;
			SignalTypeOpenColorConfigStru[j].BlockOpenColorValue[2] = (UINT8)dquCiShortFromChar(pDataAddr);
			pDataAddr +=2;

		}

	}
	
	return rtnValue;
}

/*********************************************
*函数功能：照查继电器联锁条件检查结构体数组
*参数说明：无          
*返回值：-1，失败；0，成功
*********************************************/
INT8 ReadZhaochaCheckConfigData(void)
{
	UINT8 funcRtn = 0u;
	UINT8* pDataAddr = NULL;         /*数据地址*/
	UINT32 DataSize = 0u;          /*数据大小（字节数）*/
	UINT16 i = 0u;
	UINT16 j = 0u;
	UINT16 realRowCount = 0u; /*实际表数据的行数*/
	UINT16 realRowLen = 0u; /*实际表数据的一行的长度*/
	UINT8 CheckType;             /*检查类型*/
	UINT8 DevType;      		 /* 设备类型 (配置字段)*/
	UINT16 DevId;
	INT8 rtnValue = -1;


	/*读取 默认行车序列  数据*/
	funcRtn = dquGetConfigDataNew((const)DataPath, CI_DATA_TYPE, RELAY_ZHAOCHA_CI_CHECK_ID,&pDataAddr,&DataSize,&realRowCount);
	if(0u == funcRtn)
	{
		/*函数调用失败*/
		rtnValue = 0;
		debug_infor_printf((const)"\nRELAY_ZHAOCHA_CI_CHECK_ID NO IN FS\n");
	}
	else
	{
		rtnValue = 0;
		if((0u != DataSize) && (0u != realRowCount))
		{
			if(0u != (DataSize % realRowCount))
			{   
				debug_infor_printf((const)"\n CI_DATA_TYPE,RELAY_ZHAOCHA_CI_CHECK_ID len %d %d not equal to fs\n",DataSize,realRowCount);
				DebugPrintAppError(ERROR_fs_columns_len_not_equal_to_ci_software,CI_DEVICE_TYPE_FS_TABLE,((UINT32)CI_DATA_TYPE<<8u)+RELAY_ZHAOCHA_CI_CHECK_ID,PRINT_ONCE);
				rtnValue = -1;
			}	
			else
			{					
				/*数据实际一行的数据字节长度*/
				realRowLen = (UINT16)DataSize / realRowCount;
				/*内存先设为无效*/
				(void)memset(ZhaochaCheckConfigDataStru, 0x00,sizeof(ZhaochaCheckConfigDataStruct) *realRowCount);
				/*填写表数量*/
				CiCheckZhaoChaRelayNum = realRowCount;

				for(i = 0u; i < realRowCount; i++)
				{
					if(ZHAOCHA_CHECK_SUM_MAX > i)
					{
						ZhaochaCheckConfigDataStru[i].ZhaochaRelayId = dquCiShortFromChar(pDataAddr);
						pDataAddr += 2;
						for(j = 0u; j < ZHAOCHA_CHECK_TYPE_SUN_MAX; j++)
						{
							CheckType = *(pDataAddr);
							pDataAddr += 1;
							DevType = *(pDataAddr);
							pDataAddr += 1;
							DevId = dquCiShortFromChar(pDataAddr);
							pDataAddr += 2;

							/*填写检查数量*/
							if((UINT8_MAX != CheckType) && (0u != CheckType) &&(UINT8_MAX != DevType) && (0u != DevType)
								&&(UINT16_MAX != DevId) && (0u != DevId))
							{
								/*合法值*/
								ZhaochaCheckConfigDataStru[i].ZhaochaCheckTypeBuf[ZhaochaCheckConfigDataStru[i].ZhaochaCheckSum].CheckType = CheckType;
								ZhaochaCheckConfigDataStru[i].ZhaochaCheckTypeBuf[ZhaochaCheckConfigDataStru[i].ZhaochaCheckSum].DevType = DevType;
								ZhaochaCheckConfigDataStru[i].ZhaochaCheckTypeBuf[ZhaochaCheckConfigDataStru[i].ZhaochaCheckSum].DevId = DevId;
								ZhaochaCheckConfigDataStru[i].ZhaochaCheckSum++;
							}
							else
							{
							    /*无操作*/
							}
						}

					}
					else
					{
					   /*无操作*/
					}
				}

			}

		}
		else
		{
			/*不做处理*/
		}
	}
	return rtnValue;
}

/*
*函数功能：判断本联锁的ZC数目
*参数说明：ciId联锁ID，  
*返回值：通信关系数
*/
UINT8 CheckCiHaveZcSumErr(const UINT8 ciId)
{
	/*变量初始化*/
	UINT16 i = 0u;
	UINT8 retValue = CI_ERROR;

	for(i = 0u; i < TRANSMIT_OBJECT_SUM_MAX; i++)
	{
		/*本联锁*/
		if(ciId == TransmitRelaDataStru[i].CiId)
		{
			/*找到ZC数目*/
			if(CI_SYSTEM_TYPE_ZC == TransmitRelaDataStru[i].SystemType)
			{
				retValue = TransmitRelaDataStru[i].DeviceSum;
				break;
			}
		}
	}
	return(retValue);
}

/*
* 功能描述： 将联络线接口继电器配置表数据初始化到对应设备
* 参数说明： SignalConfigDataStruct* pSignalCfgData 信号机结构体
*            PhysicalSectionConfigDataStruct* pPhyCfgData 物理区段结构体
*            SwitchConfigDataStruct* pSwitchCfgData 道岔结构体
*            OcConnetDataCfgStruct* pConnectCfgData 联络线数据结构体
*			 RelayConfigDataStruct* pRelayCfgData	继电器结构体
* 返回值  ： 0，成功；-1，失败
* NOTE：集成bug YF0083-224		      
*/
INT8 OcConnectConfigDataToDevStruct(SignalConfigDataStruct* pSignalCfgData, PhysicalSectionConfigDataStruct* pPhyCfgData, SwitchConfigDataStruct* pSwitchCfgData, OcConnetDataCfgStruct* pConnectCfgData, RelayConfigDataStruct* pRelayCfgData)
{
	/*变量初始化*/
	UINT16 i = 0u;
	UINT16 j = 0u;
	UINT16 k = 0u;
	UINT16 m = 0U;
	INT8 retValue = -1;

	if ((NULL != pSignalCfgData) && (NULL != pPhyCfgData) && (NULL != pSwitchCfgData) && ((NULL != pConnectCfgData)))
	{
		retValue = 0;
		for (i = 0u; i < OcConnetDataDevNum; i++)
		{
			if (CI_DEVICE_TYPE_SIGNAL == pConnectCfgData[i].DevType)
			{
				/*初始化信号机数据*/
				for (j = 0u; j < SIGNAL_SUM_MAX; j++)
				{
					if ((pSignalCfgData[j].SignalId == pConnectCfgData[i].DevId) && (0u != pSignalCfgData[j].SignalId))
					{
						pSignalCfgData[j].SignalIsThisLine = pConnectCfgData[i].DevIsThisLine;
						/*LXJ*/
						for (k = 0u; k < OC_LIAISON_RELAY_SUM_MAX; k++)
						{
							if (SIGNAL_LXJ_TYPE == pConnectCfgData[i].OcConnetRelayDataBuf[k].RelayType)
							{
								pSignalCfgData[j].LxRelayId = pConnectCfgData[i].OcConnetRelayDataBuf[k].RelayId;
								pSignalCfgData[j].LxDrvRelayId = pConnectCfgData[i].OcConnetRelayDataBuf[k].DrvRelayId;
							}
							else if (SIGNAL_YXJ_TYPE == pConnectCfgData[i].OcConnetRelayDataBuf[k].RelayType)
							{
								pSignalCfgData[j].YxRelayId = pConnectCfgData[i].OcConnetRelayDataBuf[k].RelayId;
								pSignalCfgData[j].YxDrvRelayId = pConnectCfgData[i].OcConnetRelayDataBuf[k].DrvRelayId;
							}
							else if (SIGNAL_DXJ_TYPE == pConnectCfgData[i].OcConnetRelayDataBuf[k].RelayType)
							{
								pSignalCfgData[j].DxRelayId = pConnectCfgData[i].OcConnetRelayDataBuf[k].RelayId;
								pSignalCfgData[j].DxDrvRelayId = pConnectCfgData[i].OcConnetRelayDataBuf[k].DrvRelayId;
							}
							else
							{
								; /*不处理*/
							}
						}
						break;
					}
				}
			}
			/*初始化物理区段数据*/
			else if (CI_DEVICE_TYPE_PHYSEC == pConnectCfgData[i].DevType)
			{
				for (j = 0u; j < PHYSICAL_SECTION_SUM_MAX; j++)
				{
					if ((pPhyCfgData[j].PhysicalSectionId == pConnectCfgData[i].DevId) && (0u != pPhyCfgData[j].PhysicalSectionId))
					{
						pPhyCfgData[j].PhyIsThisLine = pConnectCfgData[i].DevIsThisLine;

						for (k = 0u; k < OC_LIAISON_RELAY_SUM_MAX; k++)
						{
							/*GJ*/
							if (PHY_GJ_TYPE == pConnectCfgData[i].OcConnetRelayDataBuf[k].RelayType)
							{
								pPhyCfgData[j].GdRelayId = pConnectCfgData[i].OcConnetRelayDataBuf[k].RelayId;
								pPhyCfgData[j].GdDrvRelayId = pConnectCfgData[i].OcConnetRelayDataBuf[k].DrvRelayId;
							}
						}
						break;
					}
				}
			}
			/*初始化道岔数据*/
			else if (CI_DEVICE_TYPE_SWITCH == pConnectCfgData[i].DevType)
			{
				for (j = 0u; j < SWITCH_SUM_MAX; j++)
				{
					if ((pSwitchCfgData[j].SwitchId == pConnectCfgData[i].DevId) && (0u != pSwitchCfgData[j].SwitchId))
					{
						pSwitchCfgData[j].SwitchIsThisLine = pConnectCfgData[i].DevIsThisLine;
						for (k = 0u; k < OC_LIAISON_RELAY_SUM_MAX; k++)
						{
							/*DBJ*/
							if (SWITCH_DBJ_TYPE == pConnectCfgData[i].OcConnetRelayDataBuf[k].RelayType)
							{
								pSwitchCfgData[j].DbRelayId = pConnectCfgData[i].OcConnetRelayDataBuf[k].RelayId;
								pSwitchCfgData[j].DbDrvRelayId = pConnectCfgData[i].OcConnetRelayDataBuf[k].DrvRelayId;
							}
							/*FBJ*/
							else if (SWITCH_FBJ_TYPE == pConnectCfgData[i].OcConnetRelayDataBuf[k].RelayType)
							{
								pSwitchCfgData[j].FbRelayId = pConnectCfgData[i].OcConnetRelayDataBuf[k].RelayId;
								pSwitchCfgData[j].FbDrvRelayId = pConnectCfgData[i].OcConnetRelayDataBuf[k].DrvRelayId;
							}
							/*DSJ*/
							else if (SWITCH_DSJ_TYPE == pConnectCfgData[i].OcConnetRelayDataBuf[k].RelayType)
							{
								pSwitchCfgData[j].DsRelayId = pConnectCfgData[i].OcConnetRelayDataBuf[k].RelayId;
								pSwitchCfgData[j].DsDrvRelayId = pConnectCfgData[i].OcConnetRelayDataBuf[k].DrvRelayId;
							}
							/*DSQJ*/
							else if (SWITCH_DSQJ_TYPE == pConnectCfgData[i].OcConnetRelayDataBuf[k].RelayType)
							{
								pSwitchCfgData[j].DsQRelayId = pConnectCfgData[i].OcConnetRelayDataBuf[k].RelayId;
								pSwitchCfgData[j].DsDrvQRelayId = pConnectCfgData[i].OcConnetRelayDataBuf[k].DrvRelayId;
							}
							/*DSHJ*/
							else if (SWITCH_DSHJ_TYPE == pConnectCfgData[i].OcConnetRelayDataBuf[k].RelayType)
							{
								pSwitchCfgData[j].DsHRelayId = pConnectCfgData[i].OcConnetRelayDataBuf[k].RelayId;
								pSwitchCfgData[j].DsDrvHRelayId = pConnectCfgData[i].OcConnetRelayDataBuf[k].DrvRelayId;
							}
							/*PYPASS*/
							else if (SWITCH_BYPASSJ_TYPE == pConnectCfgData[i].OcConnetRelayDataBuf[k].RelayType)
							{
								pSwitchCfgData[j].ByPassRelayId = pConnectCfgData[i].OcConnetRelayDataBuf[k].RelayId;
							}
							else
							{
								/*不做处理*/
							}

						}

						break;
					}
				}
			}
			/*初始化照查数据*/
			else if (CI_DEVICE_TYPE_ZHAOCHA == pConnectCfgData[i].DevType)
			{
				for (k = 0u; k < OC_LIAISON_RELAY_SUM_MAX; k++)
				{
					if (CHECK_ZCJ_TYPE == pConnectCfgData[i].OcConnetRelayDataBuf[k].RelayType)
					{
						for (j = 0U; j < RELAY_SUM_MAX; j++)
						{
							/*当出现联络线接口继电器驱动和采集继电器配置了相同的时候，不做驱动合并到采集继电器上的处理,合并必须为本线路，非本线路只有采集*/
							if ((pRelayCfgData[j].RelayId == pConnectCfgData[i].OcConnetRelayDataBuf[k].RelayId)
								&& (0U != pRelayCfgData[j].RelayId)
								&& (pConnectCfgData[i].OcConnetRelayDataBuf[k].RelayId != pConnectCfgData[i].OcConnetRelayDataBuf[k].DrvRelayId)
								&& (DEV_IS_THIS_LINE_YES == pConnectCfgData[i].DevIsThisLine))
							{
								if (0U != pConnectCfgData[i].OcConnetRelayDataBuf[k].DrvRelayId)
								{
									for (m = 0U; m < RELAY_SUM_MAX; m++)
									{
										if (pRelayCfgData[m].RelayId == pConnectCfgData[i].OcConnetRelayDataBuf[k].DrvRelayId)
										{
											pRelayCfgData[j].BelongDrvOcId = pRelayCfgData[m].BelongDrvOcId;
											pRelayCfgData[j].DrvAddrA = pRelayCfgData[m].DrvAddrA;
											pRelayCfgData[j].DrvPosA = pRelayCfgData[m].DrvPosA;
											pRelayCfgData[j].DrvAddrB = pRelayCfgData[m].DrvAddrB;
											pRelayCfgData[j].DrvPosB = pRelayCfgData[m].DrvPosB;
											pRelayCfgData[m].RelayId = 0U;
											pRelayCfgData[m].BelongOcId = 0U;
											pRelayCfgData[m].BelongDrvOcId = 0U;
											pRelayCfgData[m].DrvAddrA = 0U;
											pRelayCfgData[m].DrvAddrB = 0U;
											pRelayCfgData[m].DrvPosA = 0U;
											pRelayCfgData[m].DrvPosB = 0U;
											break;
										}
									}
								}
							}
						}
					}
				}
			}
			else
			{
				/*其他不处理*/
			}
		}
	}
	else
	{
		/*返回失败*/
		retValue = -1;
	}
	return(retValue);
}


/*********************************************
*函数功能：初始化OC 联络线接口继电器配置表数据
*参数说明：void
*返回值：1，成功；0，失败
*********************************************/
UINT8 OcConnectConfigDataStructInit(void)
{
	UINT8 funcRtn = 0u;
	UINT8* pDataAddr = NULL;         /*数据地址*/
	UINT32 DataSize = 0u;          /*数据大小（字节数）*/
	UINT16 i = 0u;
	UINT16 j = 0u;
	UINT16 realRowCount = 0u; /*实际表数据的行数*/
	UINT8 rtnValue = 0u;


	/*读取数据*/
	/*读取 默认行车序列  数据*/
	funcRtn = dquGetConfigDataNew((const)DataPath, OC_DATA_TYPE, OC_LIAISON_RELAY_ID,&pDataAddr,&DataSize,&realRowCount);
	if(0u == funcRtn)
	{
		/*函数调用失败*/
		rtnValue = 1u;
		debug_infor_printf((const)"\nOC_LIAISON_RELAY_ID NO IN FS\n");
	}
	else
	{
		rtnValue = 1u;
		/*数据正常*/
		if((0u != DataSize) && (0u != realRowCount))
		{
			if(0u != (DataSize % realRowCount))
			{   
				debug_infor_printf((const)"\n OC_DATA_TYPE,OC_LIAISON_RELAY_ID len %d %d not equal to fs\n",DataSize,realRowCount);
				DebugPrintAppError(ERROR_fs_columns_len_not_equal_to_ci_software,CI_DEVICE_TYPE_FS_TABLE,((UINT32)CI_DATA_TYPE<<8)+OC_LIAISON_RELAY_ID,PRINT_ONCE);
				rtnValue = 0u;
			}
			else
			{
				/*填写设备数量*/
				OcConnetDataDevNum = realRowCount;
				/*内存先设为无效*/
				(void)memset(OcConnetDataCfgStru, 0x00,sizeof(OcConnetDataCfgStruct) *OC_LIAISON_DEV_SUM_MAX);

				for(i = 0u; i < realRowCount; i++)
				{
					if(OC_LIAISON_DEV_SUM_MAX > i)
					{
						OcConnetDataCfgStru[i].DevType = *(pDataAddr);
						pDataAddr += 1;
						OcConnetDataCfgStru[i].DevId = dquCiShortFromChar(pDataAddr);
						pDataAddr += 2;
						for(j = 0u; j < OC_LIAISON_RELAY_SUM_MAX; j++)
						{
							OcConnetDataCfgStru[i].OcConnetRelayDataBuf[j].RelayType = *(pDataAddr);
							pDataAddr += 1;
							OcConnetDataCfgStru[i].OcConnetRelayDataBuf[j].RelayId = dquCiShortFromChar(pDataAddr);
							pDataAddr += 2;
							OcConnetDataCfgStru[i].OcConnetRelayDataBuf[j].DrvRelayId = dquCiShortFromChar(pDataAddr);
							pDataAddr += 2;
						}
						OcConnetDataCfgStru[i].DevIsThisLine = *(pDataAddr);
						pDataAddr += 1;
					}
					else
					{
					   /*无操作*/
					}
				}
			}
		}
		else
		{
			/*不做处理*/
		}
	}
	return(rtnValue);
}

/*********************************************
*函数功能：获取静态数据
*参数说明：UINT32* pConfigDataAdderBuf 静态数据存放地址,UINT16 pConfigDataLenBuf 静态数据长度存放地址,UINT16 wBufMaxLen数组容量
*返回值：静态数据数量
*********************************************/
UINT16 GetTiocDeviceConfigData(UINT32* pConfigDataAddrBuf,UINT16* pConfigDataLenBuf,UINT16 wBufMaxLen)
{
	UINT16 wRetSum = 0u;
	UINT16 wTmpConfigDataSum = 0u;
	UINT16 wTmpLen = 0u;

	if ((NULL != pConfigDataAddrBuf) && (NULL != pConfigDataLenBuf) && (0u != wBufMaxLen) && (UINT16_MAX != wBufMaxLen))
	{
		/* 前节点A系板卡 */
		wTmpLen = wTmpConfigDataSum + 1u;
		
		pConfigDataAddrBuf[wTmpConfigDataSum] = BoardConfigForeNodeA;
		pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)(sizeof(BoardConfigStruct) * BOARD_MAX_ADDR);
		wTmpConfigDataSum++;
		
		

		/* 前节点B系板卡 */
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = BoardConfigForeNodeB;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)(sizeof(BoardConfigStruct) * BOARD_MAX_ADDR);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}

		/* 后节点A系板卡 */
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = BoardConfigBackNodeA;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)(sizeof(BoardConfigStruct) * BOARD_MAX_ADDR);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}

		/* 后节点B系板卡 */
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = BoardConfigBackNodeB;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)(sizeof(BoardConfigStruct) * BOARD_MAX_ADDR);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}

		/* 继电器配置数据 */
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = RelayConfigDataStru;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)(sizeof(RelayConfigDataStruct) * RELAY_SUM_MAX);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}

		/* 继电器ID数组 */
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = LocalCiRelayIdBuf;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)(sizeof(UINT16) * RELAY_SUM_MAX);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}

		/* 继电器数量 */
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = &RelayCurSum;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)sizeof(INT16);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}

		/* 信号机配置数据 */
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = SignalConfigDataStru;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)(sizeof(SignalConfigDataStruct) * SIGNAL_SUM_MAX);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}


		/* 信号机ID数组 */
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = LocalCiSignalIdBuf;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)(sizeof(UINT16) * SIGNAL_SUM_MAX);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}

		/* 信号机数量 */
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = &SignalCurSum;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)(sizeof(INT16));
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}

		/* 洗车机数据 */
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = WashMachineConfigDataStru;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)(sizeof(WashMachineConfigDataStruct) * WASHMACHINE_SUM_MAX);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}

		/* 洗车机ID数组 */
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = LocalCiWashMachineIdBuf;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)(sizeof(UINT16) * WASHMACHINE_SUM_MAX);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}

		/* 洗车机数量 */
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = &WashMachineCurSum;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)sizeof(UINT16);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}

		/* 道岔数据 */
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = SwitchConfigDataStru;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)(sizeof(SwitchConfigDataStruct) * SWITCH_SUM_MAX);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}

		/* 道岔ID数组 */
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = LocalCiSwitchIdBuf;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)(sizeof(UINT16) * SWITCH_SUM_MAX);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}

		/* 道岔数量 */
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = &SwitchCurSum;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)sizeof(INT16);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}

		/* 物理区段数据 */
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = PhysicalSectionConfigDataStru;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)(sizeof(PhysicalSectionConfigDataStruct) * PHYSICAL_SECTION_SUM_MAX);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}

		/* 物理区段Id数组 */
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = LocalCiPhysicalSectionIdBuf;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)(sizeof(UINT16) * PHYSICAL_SECTION_SUM_MAX);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}

		/* 物理区段数量*/
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = &PhysicalSectionCurSum;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)sizeof(INT16);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}

		/* 计轴区段数据*/
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = AxisSectionConfigDataStru;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)(sizeof(AxisSectionConfigDataStruct) * AXIS_SECTION_SUM_MAX);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}

		/* 计轴区段数组*/
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = LocalCiAxisSectionIdBuf;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)(sizeof(UINT16) * AXIS_SECTION_SUM_MAX);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}

		/* 计轴区段数量*/
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = &AxisSectionCurSum;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)sizeof(INT16);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}
		

		/* 逻辑区段数据*/
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = LogicSectionConfigDataStru;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)(sizeof(LogicSectionConfigDataStruct) * LOGIC_SECTION_SUM_MAX);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}

		/* 逻辑区段ID数组*/
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = LocalCiLogicSectionIdBuf;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)(sizeof(UINT16) * LOGIC_SECTION_SUM_MAX);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}

		/* 逻辑区段数量*/
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = &LogicSectionCurSum;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)sizeof(INT16);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}

		/* 保护区段数据*/
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = OverlapConfigDataStru;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)(sizeof(OverlapConfigDataStruct) * OVERLAP_SUM_MAX);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}

		/* 保护区段ID数组*/
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = LocalCiOverlapIdBuf;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)(sizeof(UINT16) * OVERLAP_SUM_MAX);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}

		/* 保护区段数量*/
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = &OverlapCurSum;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)sizeof(INT16);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}


		/* 屏蔽门数据*/
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = PsdConfigDataStru;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)(sizeof(PsdConfigDataStruct) * PSD_SUM_MAX);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}

		/* 屏蔽门ID数组*/
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = LocalCiPsdIdBuf;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)(sizeof(UINT16) * PSD_SUM_MAX);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}

		/* 屏蔽门数量*/
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = &PsdCurSum;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)sizeof(INT16);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}

		/* 紧急停车按钮数据*/
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = EsbConfigDataStru;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)(sizeof(EsbConfigDataStruct) * ESB_SUM_MAX);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}

		/* 紧急停车按钮ID数组*/
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = LocalCiEsbIdBuf;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)(sizeof(UINT16) * ESB_SUM_MAX);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}

		/* 紧急停车按钮数量*/
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = &EsbCurSum;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)sizeof(INT16);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}

		/* 非进路数量*/
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = &NonRouteCurSum;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)sizeof(UINT16);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}

		/* 非进路数据*/
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = NonRouteConfigDataStruArr;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)(sizeof(NonRouteConfigDataStruct) * NONROUTE_ID_NUM_MAX);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}

		/* 进路数据*/
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = RouteConfigDataStru;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)(sizeof(RouteConfigDataStruct) * ROUTE_SUM_MAX);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}

		/* 进路ID数组*/
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = LocalCiRouteIdBuf;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)(sizeof(UINT16) * ROUTE_SUM_MAX);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}

		/* 进路数量*/
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = &RouteCurSum;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)sizeof(INT16);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}

		/* 自动折返进路数据*/
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = AutoReturnConfigDataStru;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)(sizeof(AutoReturnConfigDataStruct)*AUTO_RETURN_SUM_MAX);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}

		/* 自动折返进路ID数组*/
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = LocalCiAutoReturnIdBuf;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)(sizeof(UINT16)*AUTO_RETURN_SUM_MAX);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}

		/* 自动折返进路数量*/
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = &AutoReturnCurSum;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)sizeof(INT16);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}

		/* 自动进路数据*/
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = AutoRouteConfigDataStru;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)(sizeof(AutoRouteConfigDataStruct) * AUTO_ROUTE_SUM_MAX);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}

		/* 自动进路ID数组*/
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = LocalCiAutoRouteIdBuf;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)(sizeof(UINT16) * AUTO_ROUTE_SUM_MAX);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}

		/* 自动进路数量*/
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = &AutoRouteCurSum;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)sizeof(INT16);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}

		/* 反向进路数据*/
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = ReverseRouteConfigDataStru;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)(sizeof(ReverseRouteConfigDataStruct) * ROUTE_SUM_MAX);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}

		/* 反向进路ID数组*/
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = LocalCiReverseRouteIdBuf;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)(sizeof(UINT16) * REVERSE_ROUTE_SUM_MAX);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}

		/* 反向进路数量*/
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = &ReverseRouteCurSum;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)sizeof(INT16);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}

		/* 长调进路数据*/
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = LongRouteConfigDataStru;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)(sizeof(LongRouteConfigDataStruct) * ROUTE_LONG_SUM_MAX);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}

		/* 长调进路当前总数*/
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = &LongRouteCurSum;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)sizeof(INT16);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}

		/* 通信关系数据*/
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = TransmitRelaDataStru;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)(sizeof(TransmitRelationDataStruct) * TRANSMIT_OBJECT_SUM_MAX);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}

		/* 通信关系数量*/
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = &TransmitRelaDataCurSum;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)sizeof(UINT16);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}

		/* 指示灯数据*/
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = IndicatorConfigDataStru;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)(sizeof(IndicatorConfigDataStruct) * INDICATOR_SUM_MAX);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}

		/* 指示灯个数*/
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = &IndicatorCurSum;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)sizeof(INT16);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}

		/* 自动折返进路数据*/
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = AllAutoReturnConfigDataStru;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)(sizeof(AllAutoReturnConfigDataStruct) * ALL_AUTO_RETURN_SUM_MAX);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}

		/* 自动折返进路ID数组*/
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = LocalCiAllAutoReturnIdBuf;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)(sizeof(UINT16) * ALL_AUTO_RETURN_SUM_MAX);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}

		/* 自动折返进路数量*/
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = &AllAutoReturnCurSum;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)sizeof(INT16);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}

		/* 车库门数据*/
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = GaragedoorConfigDataStru;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)(GARAGE_DOOR_SUM_MAX * sizeof(GaragedoorConfigDataStruct));
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}

		/* 车库门ID数组*/
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = LocalCiGaragedoorIdBuf;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)(GARAGE_DOOR_SUM_MAX * sizeof(UINT16));
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}

		/*车库门数量*/
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = &GaragedoorCurSum;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)sizeof(INT16);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}

		/*SPKS数据*/
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = spksDataConfigBuff;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)(sizeof(SpksDataConfigStruct) * SPKS_SUM_MAX);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}

		/*SPKS数组*/
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = spksDataConfigIdxBuff;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)(sizeof(UINT16) * SPKS_SUM_MAX);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}

		/*SPKS数量*/
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = &spksSum;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)sizeof(INT16);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}

		/*站台门控制系统数据*/
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = PscConfigDataStru;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)(sizeof(PscConfigDataStruct) * PSC_SUM_MAX);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}

		/*站台门控制系统数量*/
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = &PscCurSum;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)sizeof(INT16);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}

		/*防淹门数据*/
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = FloodGateConfigDataStru;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)(sizeof(FloodGateConfigDataStruct) * FLOOD_GATE_SUM_MAX);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}

		/*防淹门ID数组*/
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = LocalCiFloodGateIdBuf;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)(sizeof(UINT16) * FLOOD_GATE_SUM_MAX);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}

		/*防淹门数量*/
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = &FloodGateCurSum;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)sizeof(INT16);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}

		/*分界点数据*/
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = g_szCfpConfig;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)(sizeof(CfpConfigStru) * CUTOFF_POINT_SUM_MAX);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}


		/*分界点ID数组*/
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = gszCfpId;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)(sizeof(UINT16) * CUTOFF_POINT_SUM_MAX);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}

		/*分界点数量*/
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = &gCfpConfigSum;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)(sizeof(UINT16));
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}

		/*倒切数据*/
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = gstReverseCutCfgData;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)(sizeof(ReverseCutCfgDataStru) * REVERSE_CUT_SUM_MAX);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}


		/*倒切设备ID数组*/
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = gReverseCutCfgIdBuf;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)(sizeof(UINT16) * REVERSE_CUT_SUM_MAX);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}

		/*倒切设备数量*/
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = &gReverseCutCfgSum;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)sizeof(UINT16);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}

		/*码位数据*/
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = CiToAtsMaskConfigDataStru;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)(sizeof(MaskConfigDataStruct) * CI_TO_ATS_MASK_SUM_MAX);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}

		/*码位数量*/
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = &CiToAtsMaskCurSum;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)sizeof(UINT16);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}

		/*码位数据*/
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = CiToLeuMaskConfigDataStru;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)(sizeof(MaskConfigDataStruct) * CI_TO_LEU_MASK_SUM_MAX);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}

		/*码位数量*/
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = &CiToLeuMaskCurSum;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)sizeof(UINT16);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}

		/* 应急盘数据 */
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = &JkjRelayId;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)sizeof(UINT16);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}


		/* 联锁间接口 */
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = ciTransmitStruct;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)(sizeof(CiTransmitStruct) * CI_SUM_MAX);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}

		/* 联锁个数 */
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = &ciTransNum;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)sizeof(UINT16);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}

		/* 侵限区段数据 */
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = InvSecConfigDataStru;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)(sizeof(InvSecConfigDataStruct) * INVA_SECT_N_COND_SWIT_SUM_MAX);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}

		/* 侵限区段数量 */
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = &InvSecSum;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)sizeof(INT16);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}

		/* 其他线路设备数据 */
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = &DiffLineDevData;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)sizeof(DiffLineDevStruct);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}

		/* 设备数量 */
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = &DiffLineDevSum;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)sizeof(UINT16);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}

		/* 计轴总数 */
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = &totalAxisNum;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)sizeof(UINT16);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}

		/* 系统参数 */
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = &SystemParameterStruNew;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)sizeof(SystemParameterStructNew);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}

		/* 配置的信号机类型数量 */
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = &SignalTypeNum;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)sizeof(UINT16);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}

		/* 信号机类型后备开放颜色配置结构体 */
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = SignalTypeOpenColorConfigStru;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)(sizeof(SignalDrvTypeOpenColorConfig) * SIGNAL_MAX_DRVCOLL_TYPE_NUM);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}

		/* 定义组合自动进路数据配置结构体 */
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = GroupAutoRouteConfigDataStru;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)(sizeof(GroupAutoRouteConfigDataStruct) * GROUP_AUTO_ROUTE_SUM_MAX);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}

		/* 照查数据 */
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = ZhaochaCheckConfigDataStru;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)(sizeof(ZhaochaCheckConfigDataStruct) * ZHAOCHA_CHECK_SUM_MAX);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}

		/* link数据 */
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = g_szLinkConfigData;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)(sizeof(LinkDataConfigStru) * LINK_SUM_MAX);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}

		/* link数量 */
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = &g_linkNum;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)sizeof(UINT16);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}

		/* 计轴数据 */
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = g_szAxisData;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)(sizeof(AxisConfigStru) * AXIS_NUM_MAX);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}

		/* 计轴数量 */
		wTmpLen = wTmpConfigDataSum + 1u;
		if (wBufMaxLen >= wTmpLen)
		{
			pConfigDataAddrBuf[wTmpConfigDataSum] = &g_axisNum;
			pConfigDataLenBuf[wTmpConfigDataSum] = (UINT16)sizeof(UINT16);
			wTmpConfigDataSum++;
		}
		else
		{
			/* 无处理 */
		}

		wRetSum = wTmpConfigDataSum;
	}
	else
	{
		;/* 无处理 */
	}


	return wRetSum;
}

/*********************************************
*函数功能：读取指定CI与指定设备通信关系配置数据
*参数说明：const UINT8 chCiId 联锁ID
*	       const UINT8 chSystemType 设备类型
*	       UINT8 szDeviceIdBuf[TRANSMIT_OBJECT_DEVICE_SUM_MAX] 输出的设备ID
*返回值：通信关系数
* by cgh 20250605
*********************************************/
UINT8 ReadCiTransmitSpecifyDevData(const UINT8 chCiId, const UINT8 chSystemType, UINT8 szDeviceIdBuf[TRANSMIT_OBJECT_DEVICE_SUM_MAX])
{
	UINT16 ii = 0U;
	UINT8 chReval = 0U;

	if ((0U != chCiId) && (NULL != szDeviceIdBuf))
	{
		for (ii = 0U; ii < dquCICfgDtStr.TrsmtRlsDtStrLen; ii++)
		{
			if ((chCiId == dquCICfgDtStr.TrsmtRlsDtStr[ii].CiId) && (chSystemType == dquCICfgDtStr.TrsmtRlsDtStr[ii].SystemType))
			{
				chReval = dquCICfgDtStr.TrsmtRlsDtStr[ii].DeviceSum;
				(void)CommonMemCpy((void*)(szDeviceIdBuf), (UINT32)(sizeof(UINT8) * TRANSMIT_OBJECT_DEVICE_SUM_MAX), (const void*)(dquCICfgDtStr.TrsmtRlsDtStr[ii].DeviceIdBuf), (UINT32)(sizeof(UINT8) * TRANSMIT_OBJECT_DEVICE_SUM_MAX));
			}
			else
			{
				;
			}
		}
	}
	else
	{
		chReval = UINT8_MAX;
	}

	return chReval;
}