/************************************************************************
*
* 文件名   ：  dquCILSStruInit.c
* 版权说明 ：  北京交控科技有限公司 
* 版本号   ：  1.0
* 创建时间 ：  2011.12.27
* 作者     ：  研发中心软件部
* 功能描述 ：   联锁结构体定义处理过程
* 使用注意 ： 
* 修改记录 ：  
*
************************************************************************/
#include "dquCILSStruInit.h"
#include "dquCILSStru.h"
#include "DebugPrintInterface.h"

/*********定义全局的联锁信息数据变量*******/
LSDataStruct LSData;
LSDataStructLen LSDataLen;
/***************************/



/*********************************************
*函数功能：填充长进路表数据结构体数组
*参数说明：LSDataName指针          
*返回值：0，失败；1，成功
*********************************************/
UINT8 InitLS_LongRouteStru(CHAR* LSDataName)
{
	UINT8 funcRtn;
	LS_LongRouteStru* pLsLongRouteStr;   /*临时长进路变量*/
	UINT8* pDataAddr;         /*数据地址*/
	UINT32 DataSize;          /*数据大小（字节数）*/
	UINT16 j = 0u;
	UINT8 rtnValue = 0u;

	/*已经初始化了，不用老是调用执行过程*/
	if(LSData.pLSLongRouteStr != NULL)
	{
		rtnValue = 1u;
		return rtnValue;
	}
	/*读取 默认行车序列  数据*/
	   funcRtn = dquGetConfigData(LSDataName,LS_DATA_TYPE,LONG_ROUTE_DATA_ID,&pDataAddr,&DataSize);
	   if(funcRtn == 0u)
	   {
		   /*函数调用失败*/
		   rtnValue = 0u;
			return rtnValue;
	   } 	
		/*求得个数*/
	   if(DataSize%LONG_ROUTE_DATA_LEN != 0u)
	   {   
		   debug_infor_printf((const)"\nCI_LS_DATA,LONG_ROUTE len %d not equal to fs",LONG_ROUTE_DATA_LEN);
		   DebugPrintAppError(ERROR_fs_columns_len_not_equal_to_ci_software,CI_DEVICE_TYPE_FS_TABLE,(LS_DATA_TYPE<<8)+LONG_ROUTE_DATA_ID,PRINT_ONCE);
		   rtnValue = 0u;
			return rtnValue;
	   }			

	   LSDataLen.LSLongRouteStrLen = (UINT16)(DataSize/LONG_ROUTE_DATA_LEN);

		if(DataSize<LONG_ROUTE_DATA_LEN)
	   {
		   LSData.pLSLongRouteStr = (LS_LongRouteStru *) MyNew ((UINT32)sizeof(LS_LongRouteStru) );
		   rtnValue = 1u;
		   return rtnValue;
	   }
	   else
	   {
		   /*继续执行*/
	   }


		/*动态申请空间*/
		LSData.pLSLongRouteStr = (LS_LongRouteStru  *) MyNew ((UINT32)(sizeof(LS_LongRouteStru) * LSDataLen.LSLongRouteStrLen));
		/*动态申请空间失败*/
        if(NULL == LSData.pLSLongRouteStr)
        {
            /*将数组长度清0，防护数组访问越界*/
            LSDataLen.LSLongRouteStrLen = 0u;
            
            rtnValue = 0u;
            return rtnValue;
        }
		else
		{
			/*内存先设为无效*/
			(void)memset(LSData.pLSLongRouteStr, 0x00,sizeof(LS_LongRouteStru) * LSDataLen.LSLongRouteStrLen);
		}
		
		/*解析数据到 默认行车序列 结构体数组 */  
		rtnValue = 1u;
		for(j=0u;j<LSDataLen.LSLongRouteStrLen;j++)
		{
			pLsLongRouteStr = LSData.pLSLongRouteStr + j;
			
			/*填充数据结构体*/
			rtnValue &=  LS_LongRouteStruFromChar(pDataAddr,pLsLongRouteStr);
			pDataAddr += LONG_ROUTE_DATA_LEN;

		}

	return rtnValue;
}


/*********************************************
*函数功能：填充自动进路表数据结构体数组
*参数说明：LSDataName指针          
*返回值：0，失败；1，成功
*********************************************/
UINT8 InitLS_AutoRouteStru(CHAR* LSDataName)
{
	UINT8 funcRtn;
	LS_AutoRouteStru* pLsAutoRouteStr;   /*临时长进路变量*/
	UINT8* pDataAddr;         /*数据地址*/
	UINT32 DataSize;          /*数据大小（字节数）*/
	UINT16 j;
	UINT8 rtnValue = 0u;

	/*已经初始化了，不用老是调用执行过程*/
	if(LSData.pLSAutoRouteStr != NULL)
	{
		rtnValue = 1u;
		return rtnValue;
	}
	/*读取 默认行车序列  数据*/
	   funcRtn = dquGetConfigData(LSDataName,LS_DATA_TYPE,AUTO_ROUTE_DATA_ID,&pDataAddr,&DataSize);
	   if(funcRtn == 0u)
	   {
		   /*函数调用失败*/
		   rtnValue = 0u;
			return rtnValue;
	   } 	
		/*求得个数*/
	   if(DataSize%AUTO_ROUTE_DATA_LEN != 0u)
	   {   
		   debug_infor_printf((const)"\nCI_LS_DATA,AUTO_ROUTE len %d not equal to fs",AUTO_ROUTE_DATA_LEN);
		   DebugPrintAppError(ERROR_fs_columns_len_not_equal_to_ci_software,CI_DEVICE_TYPE_FS_TABLE,(LS_DATA_TYPE<<8)+AUTO_ROUTE_DATA_ID,PRINT_ONCE);
		   rtnValue = 0u;
			return rtnValue;
	   }			

	   LSDataLen.LSAutoRouteStrLen = (UINT16)(DataSize/AUTO_ROUTE_DATA_LEN);

		if(DataSize<AUTO_ROUTE_DATA_LEN)
	   {
		   LSData.pLSAutoRouteStr = (LS_AutoRouteStru *) MyNew ((UINT32)(sizeof(LS_AutoRouteStru)) );
		   rtnValue = 1u;
		   return rtnValue;
	   }
	   else
	   {
		   /*继续执行*/
	   }


		/*动态申请空间*/
		LSData.pLSAutoRouteStr = (LS_AutoRouteStru  *) MyNew ((UINT32)(sizeof(LS_AutoRouteStru) * LSDataLen.LSAutoRouteStrLen));
		/*动态申请空间失败*/
		if(NULL == LSData.pLSAutoRouteStr)
		{
            /*将数组长度清0，防护数组访问越界*/
            LSDataLen.LSAutoRouteStrLen = 0u;
            
            rtnValue = 0u;
            return rtnValue;
		}
		else
		{
			/*内存先设为无效*/
			(void)memset(LSData.pLSAutoRouteStr, 0x00,sizeof(LS_AutoRouteStru) * LSDataLen.LSAutoRouteStrLen);
		}
		
		/*解析数据到 默认行车序列 结构体数组 */  
		rtnValue = 1u;
		for(j=0u;j<LSDataLen.LSAutoRouteStrLen;j++)
		{
			pLsAutoRouteStr = LSData.pLSAutoRouteStr + j;
			
			/*填充数据结构体*/
			rtnValue &= LS_AutoRouteStruFromChar(pDataAddr,pLsAutoRouteStr);
			pDataAddr += AUTO_ROUTE_DATA_LEN;

		}

	return rtnValue;
}

/*********************************************
*函数功能：填充自动折返进路表数据结构体数组
*参数说明：LSDataName指针          
*返回值：0，失败；1，成功
*********************************************/
UINT8 InitLS_AutoRtnRouteStru(CHAR* LSDataName)
{
	UINT8 funcRtn;
	LS_AutoRtnRouteStru* pLsAutoRtnRouteStr;   /*临时长进路变量*/
	UINT8* pDataAddr;         /*数据地址*/
	UINT32 DataSize;          /*数据大小（字节数）*/
	UINT16 j;
	UINT8 rtnValue = 0u;

	/*已经初始化了，不用老是调用执行过程*/
	if(LSData.pLSAutoRtnRouteStr != NULL)
	{
		rtnValue = 1u;
		return rtnValue;
	}
	/*读取 默认行车序列  数据*/
	   funcRtn = dquGetConfigData(LSDataName,LS_DATA_TYPE,AUTO_RTN_ROUTE_DATA_ID,&pDataAddr,&DataSize);
	   if(funcRtn == 0u)
	   {
		   /*函数调用失败*/
		   rtnValue = 0u;
			return rtnValue;
	   } 	
		/*求得个数*/
	   if(DataSize%AUTO_RTN_ROUTE_DATA_LEN != 0u)
	   {   
		   debug_infor_printf((const)"\nCI_LS_DATA,AUTO_RTN_ROUTE len %d not equal to fs",AUTO_RTN_ROUTE_DATA_LEN);
		   DebugPrintAppError(ERROR_fs_columns_len_not_equal_to_ci_software,CI_DEVICE_TYPE_FS_TABLE,(LS_DATA_TYPE<<8)+AUTO_RTN_ROUTE_DATA_ID,PRINT_ONCE);
		   rtnValue = 0u;
			return rtnValue;
	   }			

	   LSDataLen.LSAutoRtnRouteStrLen = (UINT16)(DataSize/AUTO_RTN_ROUTE_DATA_LEN);

		if(DataSize<AUTO_RTN_ROUTE_DATA_LEN)
	   {
		   LSData.pLSAutoRtnRouteStr = (LS_AutoRtnRouteStru *) MyNew ((UINT32)(sizeof(LS_AutoRtnRouteStru)));
		   rtnValue = 1u;
		   return rtnValue;
	   }
	   else
	   {
		   /*继续执行*/
	   }


		/*动态申请空间*/
		LSData.pLSAutoRtnRouteStr = (LS_AutoRtnRouteStru  *) MyNew ((UINT32)(sizeof(LS_AutoRtnRouteStru) * LSDataLen.LSAutoRtnRouteStrLen));
		/*动态申请空间失败*/
		if(NULL == LSData.pLSAutoRtnRouteStr)
		{
            /*将数组长度清0，防护数组访问越界*/
            LSDataLen.LSAutoRtnRouteStrLen = 0u;
            
            rtnValue = 0u;
            return rtnValue;
		}
		else
		{
			/*内存先设为无效*/
			(void)memset(LSData.pLSAutoRtnRouteStr, 0x00,sizeof(LS_AutoRtnRouteStru) * LSDataLen.LSAutoRtnRouteStrLen);
		}
		
		/*解析数据到 默认行车序列 结构体数组 */  
		rtnValue = 1u;
		for(j=0u;j<LSDataLen.LSAutoRtnRouteStrLen;j++)
		{
			pLsAutoRtnRouteStr = LSData.pLSAutoRtnRouteStr + j;
			
			/*填充数据结构体*/
			rtnValue &= LS_AutoRtnRouteStruFromChar(pDataAddr,pLsAutoRtnRouteStr);
			pDataAddr += AUTO_RTN_ROUTE_DATA_LEN;

		}

	return rtnValue;
}

/*********************************************
*函数功能：填充反向进路表数据结构体数组
*参数说明：LSDataName指针          
*返回值：0，失败；1，成功
*********************************************/
UINT8 InitLS_ReverseRouteStru(CHAR* LSDataName)
{
	UINT8 funcRtn;
	LS_ReverseRouteStru* pLsReverseRouteStr = NULL;   /*临时反向进路变量*/
	UINT8* pDataAddr = NULL;         /*数据地址*/
	UINT32 DataSize = 0u;             /*数据大小（字节数）*/
	UINT16 j;
	UINT8 rtnValue = 0u;

	
	if(NULL != LSData.pLSReverseRouteStr)
	{/*已经初始化了，不用重复进行初始化*/
		rtnValue = 1u;
	}
	else
	{
		
		/*读取反向进路表数据到指定内存*/
		funcRtn = dquGetConfigData(LSDataName,LS_DATA_TYPE,REVERSE_ROUTE_DATA_ID,&pDataAddr,&DataSize);
		if(1u == funcRtn)
		{
		    rtnValue = 1u;
		}
		else
		{
			/*函数调用失败,直接返回*/
			rtnValue = 0u;
		} 	
		
		
		if(1u == rtnValue)
		{	/*求得个数*/
			if(0u != DataSize % REVERSE_ROUTE_DATA_LEN)
			{   /*数据不合法，直接返回*/
				debug_infor_printf((const)"\nCI_LS_DATA,REVERSE_ROUTE len %d not equal to fs",REVERSE_ROUTE_DATA_LEN);
				DebugPrintAppError(ERROR_fs_columns_len_not_equal_to_ci_software,CI_DEVICE_TYPE_FS_TABLE,(LS_DATA_TYPE<<8)+REVERSE_ROUTE_DATA_ID,PRINT_ONCE);
				rtnValue = 0u;
			}		
			else
			{
			}	
		}
		else
		{
		}
		
		if(1u == rtnValue)
		{
			/*获取结点个数*/
			LSDataLen.LSReverseRouteStrLen = (UINT16)(DataSize / REVERSE_ROUTE_DATA_LEN);

			if(REVERSE_ROUTE_DATA_LEN > DataSize)
			{/*反向进路表中不足一行数据:无需检查，直接返回成功*/
			   LSData.pLSReverseRouteStr = (LS_ReverseRouteStru *) MyNew((UINT32)(sizeof(LS_ReverseRouteStru)));
			}
			else
			{
				/*动态申请空间*/
				LSData.pLSReverseRouteStr = (LS_ReverseRouteStru  *) MyNew((UINT32)(sizeof(LS_ReverseRouteStru) * LSDataLen.LSReverseRouteStrLen));
				/*动态申请空间失败*/
				if(NULL == LSData.pLSReverseRouteStr)
				{
					/*申请空间失败，将数组长度清0，防护数组访问越界，直接返回失败*/
					LSDataLen.LSReverseRouteStrLen = 0u;
					
					rtnValue = 0u;
				}
				else
				{
					/*内存先设为无效*/
					(void)memset(LSData.pLSReverseRouteStr, 0x00,sizeof(LS_ReverseRouteStru) * LSDataLen.LSReverseRouteStrLen);
				}
				
				if(1u == rtnValue)
				{
					/*解析数据到反向进路结构体数组 */  
					for(j = 0u;j < LSDataLen.LSReverseRouteStrLen;j++)
					{
						pLsReverseRouteStr = LSData.pLSReverseRouteStr + j;
						
						/*填充数据结构体*/
						rtnValue &= LS_ReverseRouteStruFromChar(pDataAddr,pLsReverseRouteStr);
						pDataAddr += REVERSE_ROUTE_DATA_LEN;

					}	
				}
				else
				{
				}
			}
		}
		else
		{
		}
		

	}
	return rtnValue;
}



/*********************************************
*函数功能：填充非进路调车数据结构体数组
*参数说明：LSDataName指针          
*返回值：0，失败；1，成功
*********************************************/
UINT8 InitLS_NoRouteDcStru(CHAR* LSDataName)
{
	UINT8 funcRtn;
	LS_NoRouteDcStru* pNoRouteDcStr;   /*临时变量*/
	UINT8* pDataAddr;         /*数据地址*/
	UINT32 DataSize;          /*数据大小（字节数）*/
	UINT16 j;
	UINT8 rtnValue = 0u;

	/*已经初始化了，不用老是调用执行过程*/
	if(LSData.pLSNoRouteDcStr != NULL)
	{
		rtnValue = 1u;
		return rtnValue;
	}
	/*读取 默认行车序列  数据*/
	   funcRtn = dquGetConfigData(LSDataName,LS_DATA_TYPE,NO_ROUTE_DATA_ID,&pDataAddr,&DataSize);
	   if(funcRtn == 0u)
	   {
		   /*函数调用失败*/
		   rtnValue = 0u;
			return rtnValue;
	   } 	
		/*求得个数*/
	   if(DataSize%NO_ROUTE_DATA_LEN != 0u)
	   {   
		   debug_infor_printf((const)"\nCI_LS_DATA,NO_ROUTE len %d not equal to fs",NO_ROUTE_DATA_LEN);
		   DebugPrintAppError(ERROR_fs_columns_len_not_equal_to_ci_software,CI_DEVICE_TYPE_FS_TABLE,(LS_DATA_TYPE<<8)+NO_ROUTE_DATA_ID,PRINT_ONCE);
		   rtnValue = 0u;
			return rtnValue;
	   }			

	   LSDataLen.LSNoRouteDcStrLen = (UINT16)(DataSize/NO_ROUTE_DATA_LEN);

		if(DataSize<NO_ROUTE_DATA_LEN)
	   {
		   LSData.pLSNoRouteDcStr = (LS_NoRouteDcStru *) MyNew ((UINT32)(sizeof(LS_NoRouteDcStru)));
		   rtnValue = 1u;
		   return rtnValue;
	   }
	   else
	   {
		   /*继续执行*/
	   }


		/*动态申请空间*/
		LSData.pLSNoRouteDcStr = (LS_NoRouteDcStru  *) MyNew ((UINT32)(sizeof(LS_NoRouteDcStru) * LSDataLen.LSNoRouteDcStrLen));
		/*动态申请空间失败*/
		if(NULL == LSData.pLSNoRouteDcStr)
		{
            /*将数组长度清0，防护数组访问越界*/
            LSDataLen.LSNoRouteDcStrLen = 0u;
            
            rtnValue = 0u;
            return rtnValue;
		}
		else
		{
			/*内存先设为无效*/
			(void)memset(LSData.pLSNoRouteDcStr, 0x00,sizeof(LS_NoRouteDcStru) * LSDataLen.LSNoRouteDcStrLen);
		}
		
		/*解析数据到 默认行车序列 结构体数组 */  
		rtnValue = 1u;
		for(j=0u;j<LSDataLen.LSNoRouteDcStrLen;j++)
		{
			pNoRouteDcStr = LSData.pLSNoRouteDcStr + j;
			
			/*填充数据结构体*/
			rtnValue &= LS_NoRouteDcStruFromChar(pDataAddr,pNoRouteDcStr);
			pDataAddr += NO_ROUTE_DATA_LEN;

		}

	return rtnValue;
}


/*********************************************
*函数功能：填充物理区段及检查类型表数据结构体数组
*参数说明：LSDataName指针          
*返回值：0，失败；1，成功
*********************************************/
UINT8 InitLS_RoutePhyAndCheckStaStru(CHAR* LSDataName)
{
	UINT8 funcRtn;
	LS_RoutePhyAndCheckStateStruct* pRoutePhyChkStateStr;   /*临时变量*/
	UINT8* pDataAddr;         /*数据地址*/
	UINT32 DataSize;          /*数据大小（字节数）*/
	UINT16 j;
	UINT8 rtnValue = 0u;

	/*已经初始化了，不用老是调用执行过程*/
	if(LSData.pLSPhyAndChkStaStr != NULL)
	{
		rtnValue = 1u;
		return rtnValue;
	}
	/*读取 默认行车序列  数据*/
	   funcRtn = dquGetConfigData(LSDataName,LS_DATA_TYPE,PHY_SGMT_CHECK_STATE_DATA_ID,&pDataAddr,&DataSize);
	   if(funcRtn == 0u)
	   {
		   /*函数调用失败*/
		   rtnValue = 0u;
			return rtnValue;
	   } 	
		/*求得个数*/
	   if(DataSize%PHY_SGMT_CHECK_STATE_DATA_LEN != 0u)
	   {   
		   debug_infor_printf((const)"\nCI_LS_DATA,PHY_SGMT_CHECK_STATE len %d not equal to fs",PHY_SGMT_CHECK_STATE_DATA_LEN);
		   DebugPrintAppError(ERROR_fs_columns_len_not_equal_to_ci_software,CI_DEVICE_TYPE_FS_TABLE,(LS_DATA_TYPE<<8)+PHY_SGMT_CHECK_STATE_DATA_ID,PRINT_ONCE);
		   rtnValue = 0u;
			return rtnValue;
	   }			

	   LSDataLen.LSPhyAndChkStaStrLen = (UINT16)(DataSize/PHY_SGMT_CHECK_STATE_DATA_LEN);

		if(DataSize<PHY_SGMT_CHECK_STATE_DATA_LEN)
	   {
		   LSData.pLSPhyAndChkStaStr = (LS_RoutePhyAndCheckStateStruct *) MyNew ((UINT32)(sizeof(LS_RoutePhyAndCheckStateStruct)) );
		   rtnValue = 1u;
		   return rtnValue;
	   }
	   else
	   {
		   /*继续执行*/
	   }


		/*动态申请空间*/
		LSData.pLSPhyAndChkStaStr = (LS_RoutePhyAndCheckStateStruct  *) MyNew ((UINT32)(sizeof(LS_RoutePhyAndCheckStateStruct) * LSDataLen.LSPhyAndChkStaStrLen));
		/*动态申请空间失败*/
		if(NULL == LSData.pLSPhyAndChkStaStr)
		{
            /*将数组长度清0，防护数组访问越界*/
            LSDataLen.LSPhyAndChkStaStrLen = 0u;
            
            rtnValue = 0u;
            return rtnValue;
		}
		else
		{
			/*内存先设为无效*/
			(void)memset(LSData.pLSPhyAndChkStaStr, 0x00,sizeof(LS_RoutePhyAndCheckStateStruct) * LSDataLen.LSPhyAndChkStaStrLen);
		}
		
		/*解析数据到 默认行车序列 结构体数组 */  
		rtnValue = 1u;
		for(j=0u;j<LSDataLen.LSPhyAndChkStaStrLen;j++)
		{
			pRoutePhyChkStateStr = LSData.pLSPhyAndChkStaStr + j;
			
			/*填充数据结构体*/
			rtnValue &=LS_RoutePhyCheckStaStruFromChar(pDataAddr,pRoutePhyChkStateStr);
			pDataAddr += PHY_SGMT_CHECK_STATE_DATA_LEN;

		}

	return rtnValue;
}


/*********************************************
*函数功能：填充防护道岔表数据结构体数组
*参数说明：LSDataName指针          
*返回值：0，失败；1，成功
*********************************************/
UINT8 InitLS_FHDaoChaStru(CHAR* LSDataName)
{
	UINT8 funcRtn;
	LS_FHDaoChaStruct* pFHDaoChaStr;   /*临时变量*/
	UINT8* pDataAddr;         /*数据地址*/
	UINT32 DataSize;          /*数据大小（字节数）*/
	UINT16 j;
	UINT8 rtnValue = 0u;

	/*已经初始化了，不用老是调用执行过程*/
	if(LSData.pLSFHDaoChaStr != NULL)
	{
		rtnValue = 1u;
		return rtnValue;
	}
	/*读取 默认行车序列  数据*/
	   funcRtn = dquGetConfigData(LSDataName,LS_DATA_TYPE,FHDC_POINT_DATA_ID,&pDataAddr,&DataSize);
	   if(funcRtn == 0u)
	   {
		   /*函数调用失败*/
		   rtnValue = 0u;
			return rtnValue;
	   } 	
		/*求得个数*/
	   if(DataSize%FHDC_POINT_DATA_LEN != 0u)
	   {   
		   debug_infor_printf((const)"\nCI_LS_DATA,FHDC_GROUP len %d not equal to fs",FHDC_POINT_DATA_LEN);
		   DebugPrintAppError(ERROR_fs_columns_len_not_equal_to_ci_software,CI_DEVICE_TYPE_FS_TABLE,(LS_DATA_TYPE<<8)+FHDC_POINT_DATA_ID,PRINT_ONCE);
		   rtnValue = 0u;
			return rtnValue;
	   }			

	   LSDataLen.LSFHDaoChaStrLen = (UINT16)(DataSize/FHDC_POINT_DATA_LEN);

		if(DataSize<FHDC_POINT_DATA_LEN)
	   {
		   LSData.pLSFHDaoChaStr = (LS_FHDaoChaStruct *) MyNew ((UINT32)(sizeof(LS_FHDaoChaStruct)));
		   rtnValue = 1u;
		   return rtnValue;
	   }
	   else
	   {
		   /*继续执行*/
	   }


		/*动态申请空间*/
		LSData.pLSFHDaoChaStr = (LS_FHDaoChaStruct  *) MyNew ((UINT32)(sizeof(LS_FHDaoChaStruct) * LSDataLen.LSFHDaoChaStrLen));
		/*动态申请空间失败*/
		if(NULL == LSData.pLSFHDaoChaStr)
		{
            /*将数组长度清0，防护数组访问越界*/
            LSDataLen.LSFHDaoChaStrLen = 0u;
            
            rtnValue = 0u;
            return rtnValue;
		}
		else
		{
			/*内存先设为无效*/
			(void)memset(LSData.pLSFHDaoChaStr, 0x00,sizeof(LS_FHDaoChaStruct) * LSDataLen.LSFHDaoChaStrLen);
		}
		
		/*解析数据到 默认行车序列 结构体数组 */  
		rtnValue = 1u;
		for(j=0u;j<LSDataLen.LSFHDaoChaStrLen;j++)
		{
			pFHDaoChaStr = LSData.pLSFHDaoChaStr + j;
			
			/*填充数据结构体*/
			rtnValue &= LS_FHDaoChaStruFromChar (pDataAddr,pFHDaoChaStr);
			pDataAddr += FHDC_POINT_DATA_LEN;

		}

	return rtnValue;
}

/*********************************************
*函数功能：填充带动道岔组表数据结构体数组
*参数说明：LSDataName指针          
*返回值：0，失败；1，成功
*********************************************/
UINT8 InitLS_DrivedSwitchGroupStru(CHAR* LSDataName)
{
	UINT8 funcRtn = 0u;
	LS_RouteDrivedSwitchGroupStruct* pTempDrivedSwitchGroupStru = NULL;   /*临时变量*/
	UINT8* pDataAddr = NULL;		  /*数据地址*/
	UINT32 DataSize = 0u;		  /*数据大小（字节数）*/
	UINT16 j = 0u;
	UINT8 rtnValue = 0u;

	/*已经初始化了，不用老是调用执行过程*/
	if(LSData.pLSAssocSwitchGroupStru != NULL)
	{
		rtnValue = 1u;
	}
	if (0u == rtnValue)
	{
		/*读取进路带动道岔组数据*/
		funcRtn = dquGetConfigData(LSDataName, LS_DATA_TYPE, DRV_SWI_GRP_POINT_DATA_ID, &pDataAddr, &DataSize);

		if(0u == funcRtn)
		{
			/*函数调用失败*/
			rtnValue = 0u;
		}
		else
		{

			/*求得个数*/
			if(DataSize % DRV_SWI_GRP_POINT_DATA_LEN != 0u)
			{   
				debug_infor_printf((const)"\nCI_LS_DATA,DRV_SWI_GRP_POINT len %d not equal to fs",DRV_SWI_GRP_POINT_DATA_LEN);
				DebugPrintAppError(ERROR_fs_columns_len_not_equal_to_ci_software,CI_DEVICE_TYPE_FS_TABLE,(LS_DATA_TYPE<<8u)+DRV_SWI_GRP_POINT_DATA_ID,PRINT_ONCE);
				rtnValue = 0u;
			}
			else
			{
				LSDataLen.LSAssocSwitchGroupStruLen = (UINT16)(DataSize/DRV_SWI_GRP_POINT_DATA_LEN);

				if(DataSize < DRV_SWI_GRP_POINT_DATA_LEN)
				{
					LSData.pLSAssocSwitchGroupStru = (LS_RouteDrivedSwitchGroupStruct *) MyNew ((UINT32)(sizeof(LS_RouteDrivedSwitchGroupStruct)));
					rtnValue = 1u;
				}
				else
				{
					/*动态申请空间*/
					LSData.pLSAssocSwitchGroupStru = (LS_RouteDrivedSwitchGroupStruct *) MyNew ((UINT32)(sizeof(LS_RouteDrivedSwitchGroupStruct) * LSDataLen.LSAssocSwitchGroupStruLen));
					/*动态申请空间失败*/
					if(NULL == LSData.pLSAssocSwitchGroupStru)
					{
						/*将数组长度清0，防护数组访问越界*/
						LSDataLen.LSAssocSwitchGroupStruLen = 0u;

						rtnValue = 0u;
					}
					else
					{
						rtnValue = 1u;
						/*内存先设为无效*/
						(void) memset(LSData.pLSAssocSwitchGroupStru, 0x00, sizeof(LS_RouteDrivedSwitchGroupStruct) * LSDataLen.LSAssocSwitchGroupStruLen);

						/*解析数据到 默认行车序列 结构体数组 */  
						for(j = 0u; j < LSDataLen.LSAssocSwitchGroupStruLen; j++)
						{
							pTempDrivedSwitchGroupStru = LSData.pLSAssocSwitchGroupStru + j;

							/*填充数据结构体*/
							rtnValue &= LS_DrvSwiGrpStruFromChar(pDataAddr, pTempDrivedSwitchGroupStru);
							pDataAddr += DRV_SWI_GRP_POINT_DATA_LEN;

						}

					}
				}
			}
		}
	}

	return rtnValue;
}


/*********************************************
*函数功能：填充敌对信号表数据结构体数组
*参数说明：LSDataName指针          
*返回值：0，失败；1，成功
*********************************************/
UINT8 InitLS_DDXHStru(CHAR* LSDataName)
{
	UINT8 funcRtn;
	LS_DDXHStruct* pDDXHStr;   /*临时变量*/
	UINT8* pDataAddr;         /*数据地址*/
	UINT32 DataSize;          /*数据大小（字节数）*/
	UINT16 j;
	UINT8 rtnValue = 0u;

	/*已经初始化了，不用老是调用执行过程*/
	if(LSData.pLSDDXHStr != NULL)
	{
		rtnValue = 1u;
		return rtnValue;
	}
	/*读取 默认行车序列  数据*/
	   funcRtn = dquGetConfigData(LSDataName,LS_DATA_TYPE,DDXH_DATA_ID,&pDataAddr,&DataSize);
	   if(funcRtn == 0u)
	   {
		   /*函数调用失败*/
		   rtnValue = 0u;
			return rtnValue;
	   } 	
		/*求得个数*/
	   if(DataSize%DDXH_DATA_LEN != 0u)
	   {   
		   debug_infor_printf((const)"\nCI_LS_DATA,DDXH len %d not equal to fs",DDXH_DATA_LEN);
		   DebugPrintAppError(ERROR_fs_columns_len_not_equal_to_ci_software,CI_DEVICE_TYPE_FS_TABLE,(LS_DATA_TYPE<<8)+DDXH_DATA_ID,PRINT_ONCE);
		   rtnValue = 0u;
			return rtnValue;
	   }			

	   LSDataLen.LSDDXHStrLen = (UINT16)(DataSize/DDXH_DATA_LEN);

		if(DataSize<DDXH_DATA_LEN)
	   {
		   LSData.pLSDDXHStr = (LS_DDXHStruct *) MyNew ((UINT32)(sizeof(LS_DDXHStruct)));
		   rtnValue = 1u;
		   return rtnValue;
	   }
	   else
	   {
		   /*继续执行*/
	   }


		/*动态申请空间*/
		LSData.pLSDDXHStr = (LS_DDXHStruct  *) MyNew ((UINT32)(sizeof(LS_DDXHStruct) * LSDataLen.LSDDXHStrLen));
		/*动态申请空间失败*/
		if(NULL == LSData.pLSDDXHStr)
		{
            /*将数组长度清0，防护数组访问越界*/
            LSDataLen.LSDDXHStrLen = 0u;
            
            rtnValue = 0u;
            return rtnValue;
		}
		else
		{
			/*内存先设为无效*/
			(void)memset(LSData.pLSDDXHStr, 0x00,sizeof(LS_DDXHStruct) * LSDataLen.LSDDXHStrLen);
		}
		
		/*解析数据到 默认行车序列 结构体数组 */  
		rtnValue = 1u;
		for(j=0u;j<LSDataLen.LSDDXHStrLen;j++)
		{
			pDDXHStr = LSData.pLSDDXHStr + j;
			
			/*填充数据结构体*/
			rtnValue &= LS_DDXHStruFromChar (pDataAddr,pDDXHStr);
			pDataAddr += DDXH_DATA_LEN;

		}

	return rtnValue;
}

/*********************************************
*函数功能：填充联锁敌对信号机组数据
*参数说明：LSDataName指针          
*返回值：0，失败；1，成功
*********************************************/
UINT8 InitLS_DDXHZStru(CHAR* LSDataName)
{
	UINT8 funcRtn;
	LS_DDXHZStruct* pDDXHZStr;   /*临时变量*/
	UINT8* pDataAddr;         /*数据地址*/
	UINT32 DataSize;          /*数据大小（字节数）*/
	UINT16 j;
	UINT8 rtnValue = 0u;
	if(LSData.pLSDDXHZStru != NULL)
	{
		rtnValue = 1u;
		return rtnValue;
	}
	   funcRtn = dquGetConfigData(LSDataName,LS_DATA_TYPE,DDXHZ_DATA_ID,&pDataAddr,&DataSize);
	   if(funcRtn == 0u)
	   {
		   rtnValue = 0u;
			return rtnValue;
	   } 	
	   if(DataSize%DDXHZ_DATA_LEN != 0u)
	   {   
		   debug_infor_printf((const)"\nCI_LS_DATA,DDXHZ len %d not equal to fs",DDXHZ_DATA_LEN);
		   DebugPrintAppError(ERROR_fs_columns_len_not_equal_to_ci_software,CI_DEVICE_TYPE_FS_TABLE,(LS_DATA_TYPE<<8)+DDXHZ_DATA_ID,PRINT_ONCE);
		   rtnValue = 0u;
			return rtnValue;
	   }

	   LSDataLen.LSDDXHZStrLen = (UINT16)(DataSize/DDXHZ_DATA_LEN);
		if(DataSize<DDXHZ_DATA_LEN)
	   {
		   LSData.pLSDDXHZStru = (LS_DDXHZStruct *) MyNew ((UINT32)sizeof(LS_DDXHZStruct) );
		   rtnValue = 1u;
		   return rtnValue;
	   }
	   else
	   {
	   }

		LSData.pLSDDXHZStru = (LS_DDXHZStruct  *) MyNew ((UINT32)(sizeof(LS_DDXHZStruct) * LSDataLen.LSDDXHZStrLen));
		if(NULL == LSData.pLSDDXHZStru)
		{
            /*将数组长度清0，防护数组访问越界*/
            LSDataLen.LSDDXHZStrLen = 0u;
            
            rtnValue = 0u;
            return rtnValue;
		}
		else
		{
			(void)memset(LSData.pLSDDXHZStru, 0x00,sizeof(LS_DDXHZStruct) * LSDataLen.LSDDXHZStrLen);
		}
		rtnValue = 1u;
		for(j=0u;j<LSDataLen.LSDDXHZStrLen;j++)
		{
			pDDXHZStr = LSData.pLSDDXHZStru + j;
			rtnValue &= LS_DDXHZStruFromChar (pDataAddr,pDDXHZStr);
			pDataAddr += DDXHZ_DATA_LEN;
		}
	return rtnValue;
}

/*********************************************
*函数功能：填充信号机组表数据结构体数组
*参数说明：LSDataName指针          
*返回值：0，失败；1，成功
*********************************************/
UINT8 InitLS_SignalStruct(CHAR* LSDataName)
{
	UINT8 funcRtn;
	LS_SignalStruct* pSignalStr;   /*临时变量*/
	UINT8* pDataAddr;         /*数据地址*/
	UINT32 DataSize;          /*数据大小（字节数）*/
	UINT16 j;
	UINT8 rtnValue = 0u;

	/*已经初始化了，不用老是调用执行过程*/
	if(LSData.pLSSignalStr != NULL)
	{
		rtnValue = 1u;
		return rtnValue;
	}
	/*读取 默认行车序列  数据*/
	   funcRtn = dquGetConfigData(LSDataName,LS_DATA_TYPE,SIGNAL_DATA_ID,&pDataAddr,&DataSize);
	   if(funcRtn == 0u)
	   {
		   /*函数调用失败*/
		   rtnValue = 0u;
			return rtnValue;
	   } 	
		/*求得个数*/
	   if(DataSize%SIGNAL_DATA_LEN != 0u)
	   {   
		   debug_infor_printf((const)"\nCI_LS_DATA,SIGNAL len %d not equal to fs",SIGNAL_DATA_LEN);
		   DebugPrintAppError(ERROR_fs_columns_len_not_equal_to_ci_software,CI_DEVICE_TYPE_FS_TABLE,(LS_DATA_TYPE<<8)+SIGNAL_DATA_ID,PRINT_ONCE);
		   rtnValue = 0u;
			return rtnValue;
	   }			

	   LSDataLen.LSSignalStrLen = (UINT16)(DataSize/SIGNAL_DATA_LEN);

		if(DataSize<SIGNAL_DATA_LEN)
	   {
		   LSData.pLSSignalStr = (LS_SignalStruct *) MyNew ((UINT32)(sizeof(LS_SignalStruct)));
		   rtnValue = 1u;
		   return rtnValue;
	   }
	   else
	   {
		   /*继续执行*/
	   }

		/*动态申请空间*/
		LSData.pLSSignalStr = (LS_SignalStruct  *) MyNew ((UINT32)(sizeof(LS_SignalStruct) * LSDataLen.LSSignalStrLen));
		/*动态申请空间失败*/
		if(NULL == LSData.pLSSignalStr)
		{
            /*将数组长度清0，防护数组访问越界*/
            LSDataLen.LSSignalStrLen = 0u;
            
            rtnValue = 0u;
            return rtnValue;
		}
		else
		{
			/*内存先设为无效*/
			(void)memset(LSData.pLSSignalStr, 0x00,sizeof(LS_SignalStruct) * LSDataLen.LSSignalStrLen);
		}
		
		/*解析数据到 默认行车序列 结构体数组 */  
		rtnValue = 1u;
		for(j=0u;j<LSDataLen.LSSignalStrLen;j++)
		{
			pSignalStr = LSData.pLSSignalStr + j;
			
			/*填充数据结构体*/
			rtnValue &= LS_SignalStruFromChar (pDataAddr,pSignalStr);
			pDataAddr += SIGNAL_DATA_LEN;

		}

	return rtnValue;
}


/*********************************************
*函数功能：填充侵限区段及条件道岔表数据结构体数组
*参数说明：LSDataName指针          
*返回值：0，失败；1，成功
*********************************************/
UINT8 InitLS_IntrudePhySectionStruct(CHAR* LSDataName)
{
	UINT8 funcRtn;
	LS_IntrudePhySectionStruct* pInterPhySecStr;   /*临时变量*/
	UINT8* pDataAddr;         /*数据地址*/
	UINT32 DataSize;          /*数据大小（字节数）*/
	UINT16 j;
	UINT8 rtnValue = 0u;

	/*已经初始化了，不用老是调用执行过程*/
	if(LSData.pLSIntruPhySecStr != NULL)
	{
		rtnValue = 1u;
	}
	else
	{
		/*读取 默认行车序列  数据*/
		funcRtn = dquGetConfigData(LSDataName, LS_DATA_TYPE, INTRU_PHYSEC_DATA_ID, &pDataAddr, &DataSize);
		if (funcRtn == 0u)
		{
			/*函数调用失败*/
			rtnValue = 0u;
		}
		else
		{
			/*求得个数*/
			if (DataSize % INTRU_PHYSEC_LEN != 0u)
			{
				debug_infor_printf((const)"\nCI_LS_DATA,INTRU_PHYSICAL len %d not equal to fs", INTRU_PHYSEC_LEN);
				DebugPrintAppError(ERROR_fs_columns_len_not_equal_to_ci_software, CI_DEVICE_TYPE_FS_TABLE, (LS_DATA_TYPE << 8) + INTRU_PHYSEC_DATA_ID, PRINT_ONCE);
				rtnValue = 0u;
			}
			else
			{
				LSDataLen.LSIntruPhySecStrLen = (UINT16)(DataSize / INTRU_PHYSEC_LEN);
				if (DataSize < INTRU_PHYSEC_LEN)
				{
					LSData.pLSIntruPhySecStr = (LS_IntrudePhySectionStruct*)MyNew((UINT32)sizeof(LS_IntrudePhySectionStruct));
					rtnValue = 1U;
				}
				else
				{
					/*继续执行*/
					/*动态申请空间*/
					LSData.pLSIntruPhySecStr = (LS_IntrudePhySectionStruct*)MyNew((UINT32)(sizeof(LS_IntrudePhySectionStruct) * LSDataLen.LSIntruPhySecStrLen));
					/*动态申请空间失败*/
					if (NULL == LSData.pLSIntruPhySecStr)
					{
						/*将数组长度清0，防护数组访问越界*/
						LSDataLen.LSIntruPhySecStrLen = 0u;
						rtnValue = 0u;
					}
					else
					{
						/*内存先设为无效*/
						(void)memset(LSData.pLSIntruPhySecStr, 0x00, sizeof(LS_IntrudePhySectionStruct) * LSDataLen.LSIntruPhySecStrLen);
						/*解析数据到 默认行车序列 结构体数组 */
						for (j = 0u; j < LSDataLen.LSIntruPhySecStrLen; j++)
						{
							pInterPhySecStr = LSData.pLSIntruPhySecStr + j;

							/*填充数据结构体*/
							rtnValue = LS_IntrudePhySecStruFromChar(pDataAddr, pInterPhySecStr);
							if (0U == rtnValue)
							{
								break;
							}
							else
							{
								pDataAddr += INTRU_PHYSEC_LEN;
							}	
						}
					}
				}
			}
		}	
	}
	return rtnValue;
}


/*********************************************
*函数功能：采用互相侵限表填充侵限区段及条件道岔表数据结构体数组
*参数说明：UINT16 logSecSum 逻辑区段总数
*        DSU_LOGIC_SGMT_STRU* pLogicSgmt 逻辑区段数据结构体
*返回值：0，失败；1，成功
*********************************************/
UINT8 InitLS_InvEachPhySectionStruct(UINT16 logSecSum,DSU_LOGIC_SGMT_STRU* pLogicSgmt)
{
	UINT8 funcRtn;
	LS_IntrudePhySectionStruct* pInterPhySecStr;   /*临时变量*/
	UINT32 DataSize;          /*数据大小（字节数）*/
	UINT16 j = 0U;
	UINT16 i = 0U;
	UINT16 k = 0U;
	UINT8 rtnValue = 0u;
	UINT16 dataSum = 0U;
	UINT16 tmpSwitchNum = 0U;

	/*已经初始化了，不用老是调用执行过程*/
	if (LSData.pLSIntruPhySecStr != NULL)
	{
		rtnValue = 1u;
	}
	else
	{
		if ((0U == logSecSum) && (NULL == pLogicSgmt))
		{
			/*填充失败*/
			rtnValue = 0u;
		}
		else
		{
			LSDataLen.LSIntruPhySecStrLen = LSDataLen.LSLgcInvEachLen * 4U;

			/*动态申请空间*/
			LSData.pLSIntruPhySecStr = (LS_IntrudePhySectionStruct*)MyNew((UINT32)(sizeof(LS_IntrudePhySectionStruct) * (LSDataLen.LSIntruPhySecStrLen+1)));

			/*动态申请空间失败*/
			if (NULL == LSData.pLSIntruPhySecStr)
			{
				/*将数组长度清0，防护数组访问越界*/
				LSDataLen.LSIntruPhySecStrLen = 0u;
				rtnValue = 0u;
			}
			else
			{
				/*内存先设为无效*/
				(void)memset(LSData.pLSIntruPhySecStr, 0x00, sizeof(LS_IntrudePhySectionStruct) * (LSDataLen.LSIntruPhySecStrLen+1));

				/*解析互相侵限数据到 侵限区段及条件道岔表 */
				for (i = 0u; i < LSDataLen.LSLgcInvEachLen; i++)
				{
					/*将逻辑区段1侵限条件信息添加进结构体*/
					LSData.pLSIntruPhySecStr[dataSum].belongLogSecId = LSData.pLSLgcInvEachStru[i].wLogSecId1;
					LSData.pLSIntruPhySecStr[dataSum].belongPhySecId = 0U;
					LSData.pLSIntruPhySecStr[dataSum].wCondSwitLockDir = LSData.pLSLgcInvEachStru[i].wLogSec1_CheckDir;
					LSData.pLSIntruPhySecStr[dataSum].wId = dataSum+1U;
					/*在所有逻辑区段中查询*/
					for (j = 0u; j < logSecSum; j++)
					{
						if (pLogicSgmt[j].wId == LSData.pLSLgcInvEachStru[i].wLogSecId2)
						{
							LSData.pLSIntruPhySecStr[dataSum].wIntrudePhySecId = pLogicSgmt[j].wRelatPhySecId;
							LSData.pLSIntruPhySecStr[dataSum + 1].wIntrudePhySecId = pLogicSgmt[j].wRelatPhySecId;

							for (k = 0; k < pLogicSgmt[j].chSwitchNum; k++)
							{
								LSData.pLSIntruPhySecStr[dataSum].wPointId[k] = pLogicSgmt[j].wSwitchId[k];
								LSData.pLSIntruPhySecStr[dataSum].wPointSta[k] = pLogicSgmt[j].chSwitchPosition[k];

								/*物理区段P1侵限条件需包含L1+L2的所有道岔状态,此处添加L2包含的道岔*/
								LSData.pLSIntruPhySecStr[dataSum+1].wPointId[k] = pLogicSgmt[j].wSwitchId[k];
								LSData.pLSIntruPhySecStr[dataSum+1].wPointSta[k] = pLogicSgmt[j].chSwitchPosition[k];
							}
							tmpSwitchNum = k;
							break;
						}
					}
					dataSum++;


					/*将逻辑区段1所属物理区段1的侵限条件信息添加进结构体*/
					LSData.pLSIntruPhySecStr[dataSum].belongLogSecId = 0U;
					LSData.pLSIntruPhySecStr[dataSum].wCondSwitLockDir = LSData.pLSLgcInvEachStru[i].wLogSec1_CheckDir;
					LSData.pLSIntruPhySecStr[dataSum].wId = dataSum+1U;
					/*在所有逻辑区段中查询*/
					for (j = 0u; j < logSecSum; j++)
					{
						if (pLogicSgmt[j].wId == LSData.pLSLgcInvEachStru[i].wLogSecId1)
						{
							LSData.pLSIntruPhySecStr[dataSum].belongPhySecId = pLogicSgmt[j].wRelatPhySecId;
							/*物理区段P1侵限条件需包含L1+L2的所有道岔状态,此处添加L2包含的道岔*/
							for (k = 0; k < pLogicSgmt[j].chSwitchNum; k++)
							{
								LSData.pLSIntruPhySecStr[dataSum].wPointId[tmpSwitchNum + k] = pLogicSgmt[j].wSwitchId[k];
								LSData.pLSIntruPhySecStr[dataSum].wPointSta[tmpSwitchNum + k] = pLogicSgmt[j].chSwitchPosition[k];
							}
						}
					}
					dataSum++;


					/*将逻辑区段2侵限条件信息添加进结构体*/
					LSData.pLSIntruPhySecStr[dataSum].belongLogSecId = LSData.pLSLgcInvEachStru[i].wLogSecId2;
					LSData.pLSIntruPhySecStr[dataSum].belongPhySecId = 0U;
					LSData.pLSIntruPhySecStr[dataSum].wCondSwitLockDir = LSData.pLSLgcInvEachStru[i].wLogSec2_CheckDir;
					LSData.pLSIntruPhySecStr[dataSum].wId = dataSum+1U;
					/*在所有逻辑区段中查询*/
					for (j = 0u; j < logSecSum; j++)
					{
						if (pLogicSgmt[j].wId == LSData.pLSLgcInvEachStru[i].wLogSecId1)
						{
							LSData.pLSIntruPhySecStr[dataSum].wIntrudePhySecId = pLogicSgmt[j].wRelatPhySecId;
							LSData.pLSIntruPhySecStr[dataSum + 1].wIntrudePhySecId = pLogicSgmt[j].wRelatPhySecId;

							for (k = 0; k < pLogicSgmt[j].chSwitchNum; k++)
							{
								LSData.pLSIntruPhySecStr[dataSum].wPointId[k] = pLogicSgmt[j].wSwitchId[k];
								LSData.pLSIntruPhySecStr[dataSum].wPointSta[k] = pLogicSgmt[j].chSwitchPosition[k];

								/*物理区段P2侵限条件需包含L1+L2的所有道岔状态,此处添加L1包含的道岔*/
								LSData.pLSIntruPhySecStr[dataSum + 1U].wPointId[k] = pLogicSgmt[j].wSwitchId[k];
								LSData.pLSIntruPhySecStr[dataSum + 1U].wPointSta[k] = pLogicSgmt[j].chSwitchPosition[k];
							}
							tmpSwitchNum = k;
							break;
						}
					}
					dataSum++;


					/*将逻辑区段2所属物理区段2的侵限条件信息添加进结构体*/
					LSData.pLSIntruPhySecStr[dataSum].belongLogSecId = 0U;
					LSData.pLSIntruPhySecStr[dataSum].wCondSwitLockDir = LSData.pLSLgcInvEachStru[i].wLogSec2_CheckDir;
					LSData.pLSIntruPhySecStr[dataSum].wId = dataSum+1U;
					/*在所有逻辑区段中查询*/
					for (j = 0u; j < logSecSum; j++)
					{
						if (pLogicSgmt[j].wId == LSData.pLSLgcInvEachStru[i].wLogSecId2)
						{
							LSData.pLSIntruPhySecStr[dataSum].belongPhySecId = pLogicSgmt[j].wRelatPhySecId;
							/*物理区段P1侵限条件需包含L1+L2的所有道岔状态,此处添加L2包含的道岔*/
							for (k = 0; k < pLogicSgmt[j].chSwitchNum; k++)
							{
								LSData.pLSIntruPhySecStr[dataSum].wPointId[tmpSwitchNum + k] = pLogicSgmt[j].wSwitchId[k];
								LSData.pLSIntruPhySecStr[dataSum].wPointSta[tmpSwitchNum + k] = pLogicSgmt[j].chSwitchPosition[k];
							}
						}
					}
					dataSum++;
				}

				/*在日志中打印侵限区段及道岔表*/
				for ( i = 0U; i < dataSum; i++)
				{
					debug_infor_printf((const)"[InvSecandSwitch] wID:%d, InvSecID:%d, belongLogSec:%d, belongPhySec:%d, Dir:%d, SwitchID:%d-%d-%d-%d-%d-%d, SwitchState:%d-%d-%d-%d-%d-%d\n", LSData.pLSIntruPhySecStr[i].wId, LSData.pLSIntruPhySecStr[i].wIntrudePhySecId,LSData.pLSIntruPhySecStr[i].belongLogSecId, LSData.pLSIntruPhySecStr[i].belongPhySecId, LSData.pLSIntruPhySecStr[i].wCondSwitLockDir,
						LSData.pLSIntruPhySecStr[i].wPointId[0], LSData.pLSIntruPhySecStr[i].wPointId[1], LSData.pLSIntruPhySecStr[i].wPointId[2], LSData.pLSIntruPhySecStr[i].wPointId[3], LSData.pLSIntruPhySecStr[i].wPointId[4], LSData.pLSIntruPhySecStr[i].wPointId[5],
						LSData.pLSIntruPhySecStr[i].wPointSta[0], LSData.pLSIntruPhySecStr[i].wPointSta[1], LSData.pLSIntruPhySecStr[i].wPointSta[2], LSData.pLSIntruPhySecStr[i].wPointSta[3], LSData.pLSIntruPhySecStr[i].wPointSta[4], LSData.pLSIntruPhySecStr[i].wPointSta[5]);
				}

				rtnValue = 1u;
			}
		}
	}
	return rtnValue;
}

/*********************************************
*函数功能：填充逻辑区段关联联络线设备条件检查结构体数组
*参数说明：LSDataName指针
*返回值：0，失败；1，成功
*********************************************/
UINT8 InitLS_ContactConfigDataStruct(CHAR* LSDataName)
{
	UINT8 funcRtn;
	LS_ContactLineStruct* contactLineStr;   /*临时变量*/
	UINT8* pDataAddr;         /*数据地址*/
	UINT32 DataSize;          /*数据大小（字节数）*/
	UINT16 j;
	UINT8 rtnValue = 0u;

	/*已经初始化了，不用老是调用执行过程*/
	if (LSData.pLSContactLineStr != NULL)
	{
		rtnValue = 1u;
	}
	else
	{
		/*读取 默认行车序列  数据*/
		funcRtn = dquGetConfigData(LSDataName, LS_DATA_TYPE, CONTACT_CONFIG_CI_DATA_ID, &pDataAddr, &DataSize);
		if (funcRtn == 0u)
		{
			/*函数调用失败*/
			rtnValue = 0u;
		}
		else
		{
			/*求得个数*/
			if (DataSize % CONTACT_DATA_LEN != 0u)
			{
				debug_infor_printf((const)"\nCI_LS_DATA,INTRU_PHYSICAL len %d not equal to fs", CONTACT_DATA_LEN);
				DebugPrintAppError(ERROR_fs_columns_len_not_equal_to_ci_software, CI_DEVICE_TYPE_FS_TABLE, (LS_DATA_TYPE << 8) + CONTACT_CONFIG_CI_DATA_ID, PRINT_ONCE);
				rtnValue = 0u;
			}
			else
			{
				LSDataLen.LSContactStruLen = (UINT16)(DataSize / CONTACT_DATA_LEN);
				if (DataSize < CONTACT_DATA_LEN)
				{
					LSData.pLSContactLineStr = (LS_ContactLineStruct*)MyNew((UINT32)(sizeof(LS_ContactLineStruct)));
					rtnValue = 1U;
				}
				else
				{
					/*继续执行*/
					/*动态申请空间*/
					LSData.pLSContactLineStr = (LS_ContactLineStruct*)MyNew((UINT32)(sizeof(LS_ContactLineStruct) * LSDataLen.LSContactStruLen));
					/*动态申请空间失败*/
					if (NULL == LSData.pLSContactLineStr)
					{
						/*将数组长度清0，防护数组访问越界*/
						LSDataLen.LSContactStruLen = 0u;
						rtnValue = 0u;
					}
					else
					{
						/*内存先设为无效*/
						(void)memset(LSData.pLSContactLineStr, 0x00, sizeof(LS_ContactLineStruct) * LSDataLen.LSContactStruLen);
						/*解析数据到 默认行车序列 结构体数组 */
						for (j = 0u; j < LSDataLen.LSContactStruLen; j++)
						{
							contactLineStr = LSData.pLSContactLineStr + j;

							/*填充数据结构体*/
							rtnValue = LS_ContactCfgDtStruFromChar(pDataAddr, contactLineStr);
							if (0U == rtnValue)
							{
								break;
							}
							else
							{
								pDataAddr += CONTACT_DATA_LEN;
							}
						}
					}
				}
			}
		}
	}
	return rtnValue;
}

/*********************************************
*函数功能：填充其他联锁据结构体数组
*参数说明：LSDataName指针          
*返回值：0，失败；1，成功
*********************************************/
UINT8 InitLS_OtherCIStruct(CHAR* LSDataName)
{
	UINT8 funcRtn;
	LS_OtherCIStruct* pOtherCiStr;   /*临时变量*/
	UINT8* pDataAddr;         /*数据地址*/
	UINT32 DataSize;          /*数据大小（字节数）*/
	UINT16 j;
	UINT8 rtnValue = 0u;

	/*已经初始化了，不用老是调用执行过程*/
	if(LSData.pLSOterCiStr != NULL)
	{
		rtnValue = 1u;
		return rtnValue;
	}
	/*读取 默认行车序列  数据*/
	   funcRtn = dquGetConfigData(LSDataName,LS_DATA_TYPE,OTHER_CI_DATA_ID,&pDataAddr,&DataSize);
	   if(funcRtn == 0u)
	   {
		   /*函数调用失败*/
		   rtnValue = 0u;
			return rtnValue;
	   } 	
		/*求得个数*/
	   if(DataSize%OTHER_CI_DATA_LEN != 0u)
	   {   
		   debug_infor_printf((const)"\nCI_LS_DATA,OTHER_CI len %d not equal to fs",OTHER_CI_DATA_LEN);
		   DebugPrintAppError(ERROR_fs_columns_len_not_equal_to_ci_software,CI_DEVICE_TYPE_FS_TABLE,(LS_DATA_TYPE<<8)+OTHER_CI_DATA_ID,PRINT_ONCE);
		   rtnValue = 0u;
			return rtnValue;
	   }			

	   LSDataLen.LSOterCiStrLen = (UINT16)(DataSize/OTHER_CI_DATA_LEN);

		if(DataSize<OTHER_CI_DATA_LEN)
	   {
		   LSData.pLSOterCiStr = (LS_OtherCIStruct *) MyNew ((UINT32)(sizeof(LS_OtherCIStruct)));
		   rtnValue = 1u;
		   return rtnValue;
	   }
	   else
	   {
		   /*继续执行*/
	   }

		/*动态申请空间*/
		LSData.pLSOterCiStr = (LS_OtherCIStruct  *) MyNew ((UINT32)(sizeof(LS_OtherCIStruct) * LSDataLen.LSOterCiStrLen));
		/*动态申请空间失败*/
		if(NULL == LSData.pLSOterCiStr)
		{
            /*将数组长度清0，防护数组访问越界*/
            LSDataLen.LSOterCiStrLen = 0u;
            
            rtnValue = 0u;
            return rtnValue;
		}
		else
		{
			/*内存先设为无效*/
			(void)memset(LSData.pLSOterCiStr, 0x00,sizeof(LS_OtherCIStruct) * LSDataLen.LSOterCiStrLen);
		}
		
		/*解析数据到 默认行车序列 结构体数组 */  
		rtnValue = 1u;
		for(j=0u;j<LSDataLen.LSOterCiStrLen;j++)
		{
			pOtherCiStr = LSData.pLSOterCiStr + j;
			
			/*填充数据结构体*/
			rtnValue &= LS_OtherCIStruFromChar (pDataAddr,pOtherCiStr);
			pDataAddr += OTHER_CI_DATA_LEN;

		}

	return rtnValue;
}

/*********************************************
*函数功能：填充联锁表-进路数据结构体数组
*参数说明：LSDataName指针          
*返回值：0，失败；1，成功
*********************************************/
UINT8 InitLS_RouteStruct(CHAR* LSDataName)
{
	UINT8 funcRtn;
	LS_RouteStruct* pRouteStr;   /*临时变量*/
	UINT8* pDataAddr;         /*数据地址*/
	UINT32 DataSize;          /*数据大小（字节数）*/
	UINT16 j;
	UINT8 rtnValue = 0u;

	/*已经初始化了，不用老是调用执行过程*/
	if(LSData.pLSRouteStr != NULL)
	{
		rtnValue = 1u;
		return rtnValue;
	}
	/*读取 默认行车序列  数据*/
	   funcRtn = dquGetConfigData(LSDataName,LS_DATA_TYPE,ROUTE_DATA_ID,&pDataAddr,&DataSize);
	   if(funcRtn == 0u)
	   {
		   /*函数调用失败*/
		   rtnValue = 0u;
			return rtnValue;
	   } 	
		/*求得个数*/
	   if(DataSize%ROUTE_DATA_LEN != 0u)
	   {   
		   debug_infor_printf((const)"\nCI_CI_DATA,ROUTE_DATA len %d not equal to fs",ROUTE_DATA_LEN);
		   DebugPrintAppError(ERROR_fs_columns_len_not_equal_to_ci_software,CI_DEVICE_TYPE_FS_TABLE,(LS_DATA_TYPE<<8)+ROUTE_DATA_ID,PRINT_ONCE);
		   rtnValue = 0u;
			return rtnValue;
	   }			

	   LSDataLen.LSRouteStrLen = (UINT16)(DataSize/ROUTE_DATA_LEN);

		if(DataSize<ROUTE_DATA_LEN)
	   {
		   LSData.pLSRouteStr = (LS_RouteStruct *) MyNew ((UINT32)sizeof(LS_RouteStruct) );
		   rtnValue = 1u;
		   return rtnValue;
	   }
	   else
	   {
		   /*继续执行*/
	   }

		/*动态申请空间*/
		LSData.pLSRouteStr = (LS_RouteStruct  *) MyNew ((UINT32)(sizeof(LS_RouteStruct) * LSDataLen.LSRouteStrLen));
		/*动态申请空间失败*/
		if(NULL == LSData.pLSRouteStr)
		{
            /*将数组长度清0，防护数组访问越界*/
            LSDataLen.LSRouteStrLen = 0u;
            
            rtnValue = 0u;
            return rtnValue;
		}
		else
		{
			/*内存先设为无效*/
			(void)memset(LSData.pLSRouteStr, 0x00,sizeof(LS_RouteStruct) * LSDataLen.LSRouteStrLen);
		}
		
		/*解析数据到 默认行车序列 结构体数组 */  
		rtnValue = 1u;
		for(j=0u;j<LSDataLen.LSRouteStrLen;j++)
		{
			pRouteStr = LSData.pLSRouteStr + j;
			
			/*填充数据结构体*/
			rtnValue &= LS_RouteStruFromChar (pDataAddr,pRouteStr);
			pDataAddr += ROUTE_DATA_LEN;

		}

	return rtnValue;
}

/*********************************************
*函数功能：填充全自动折返进路表数据结构体数组
*参数说明：LSDataName指针          
*返回值：0，失败；1，成功
*********************************************/
UINT8 InitLS_AllAutoRtnRouteStru(CHAR *LSDataName)
{
	UINT8 funcRtn;
	LS_AllAutoRtnRouteStru* pLsAllAutoRtnRouteStr =NULL;   /*临时长进路变量*/
	UINT8* pDataAddr = NULL;         /*数据地址*/
	UINT32 DataSize = 0u;          /*数据大小（字节数）*/
	UINT16 j = 0u;
	UINT8 rtnValue = 0u;
	
	/*已经初始化了，不用老是调用执行过程*/
	if(LSData.pLSAllAutoRtnRouteStr != NULL)
	{
		rtnValue = 1u;
	}
	else
	{
    	/*读取 默认行车序列  数据*/
	   funcRtn = dquGetConfigData(LSDataName,LS_DATA_TYPE,ALLAUTO_RTN_ROUTE_DATA_ID,&pDataAddr,&DataSize);
	   if(funcRtn == 0u)
	   {
		   /*函数调用失败*/
		   rtnValue = 0u;
	   }
	   else
	   {
		   /*求得个数*/
		   if(DataSize%ALLAUTO_RTN_ROUTE_DATA_LEN != 0u)
		   {   
			   debug_infor_printf((const)"\nCI_LS_DATA,ALLAUTO_RTN_ROUTE len %d not equal to fs",ALLAUTO_RTN_ROUTE_DATA_LEN);
			   DebugPrintAppError(ERROR_fs_columns_len_not_equal_to_ci_software,CI_DEVICE_TYPE_FS_TABLE,(LS_DATA_TYPE<<8)+ALLAUTO_RTN_ROUTE_DATA_ID,PRINT_ONCE);
			   rtnValue = 0u;
		   }
		   else
		   {

			   LSDataLen.LSAllAutoRtnRouteStrLen = (UINT16)(DataSize/ALLAUTO_RTN_ROUTE_DATA_LEN);
			   
			   if(DataSize<ALLAUTO_RTN_ROUTE_DATA_LEN)
			   {
				   LSData.pLSAllAutoRtnRouteStr = (LS_AllAutoRtnRouteStru *) MyNew ((UINT32)sizeof(LS_AllAutoRtnRouteStru));
				   rtnValue = 1u;
			   }
			   else
			   {
				   
				   /*动态申请空间*/
				   LSData.pLSAllAutoRtnRouteStr = (LS_AllAutoRtnRouteStru  *) MyNew ((UINT32)(sizeof(LS_AllAutoRtnRouteStru) * LSDataLen.LSAllAutoRtnRouteStrLen));
				   /*动态申请空间失败*/
				   if(NULL == LSData.pLSAllAutoRtnRouteStr)
				   {
					   /*将数组长度清0，防护数组访问越界*/
					   LSDataLen.LSAllAutoRtnRouteStrLen = 0u;
					   
					   rtnValue = 0u;
				   }
				   else
				   {
					   /*内存先设为无效*/
					   (void)memset(LSData.pLSAllAutoRtnRouteStr, 0x00,sizeof(LS_AllAutoRtnRouteStru) * LSDataLen.LSAllAutoRtnRouteStrLen);
					   
					   /*解析数据到 默认行车序列 结构体数组 */  
					   rtnValue = 1u;
					   for(j=0u;j<LSDataLen.LSAllAutoRtnRouteStrLen;j++)
					   {
						   pLsAllAutoRtnRouteStr = LSData.pLSAllAutoRtnRouteStr + j;
						   
						   /*填充数据结构体*/
						   rtnValue &= LS_AllAutoRtnRouteStruFromChar(pDataAddr,pLsAllAutoRtnRouteStr);
						   pDataAddr += ALLAUTO_RTN_ROUTE_DATA_LEN;
						   
					   }

					}
				}
			}
		}
	}

	return rtnValue;
}

/*********************************************
*函数功能：填充保护区段锁闭条件表数据结构体数组
*参数说明：LSDataName指针          
*返回值：0，失败；1，成功
*********************************************/
UINT8 InitLS_OverlapLockCondStru(CHAR *LSDataName)
{
	UINT8 funcRtn = 0u;
	LS_OveralpLockCondStru* pTempLSProtSecLockCondStru = NULL;   /*临时长进路变量*/
	UINT8* pDataAddr = NULL;         /*数据地址*/
	UINT32 DataSize = 0u;          /*数据大小（字节数）*/
	UINT32 rowLen = 0u;				/*读到的行数*/
	UINT16 realRowLen = 0U;			/*实际表一行的长度*/
	UINT16 j = 0u;
	UINT8 rtnValue = 0u;
	
	/*已经初始化了，不用老是调用执行过程*/
	if(LSData.pLSOverlapLockCondStru != NULL)
	{
		rtnValue = 1u;
	}
	else
	{
    	/*读取保护区段锁闭条件数据*/
	   funcRtn = dquGetConfigDataNew(LSDataName, LS_DATA_TYPE, OVERLAP_LOCK_COND_DATA_ID, &pDataAddr, &DataSize, &rowLen);

	   if(funcRtn == 0u)
	   {
		   /*函数调用失败*/
		   rtnValue = 0u;
	   }
	   else
	   {
		   /*求得个数*/
		   if ((0U != DataSize) && (0U != rowLen))
		   {
			   if (0U != DataSize % rowLen)
			   {
				   debug_infor_printf((const)"\nCI_LS_DATA,OVERLAP_LOCK_COND len %d not equal to fs", PHYSICAL_INTRU_DATA_LEN);
				   DebugPrintAppError(ERROR_fs_columns_len_not_equal_to_ci_software, CI_DEVICE_TYPE_FS_TABLE, (LS_DATA_TYPE << 8) + OVERLAP_LOCK_COND_DATA_ID, PRINT_ONCE);
				   rtnValue = 0u;
			   }
			   else
			   {
				   realRowLen = (UINT16)(DataSize / rowLen);
				   LSDataLen.LSOverlapLockCondStruLen = (UINT16)rowLen;

				   if (DataSize < realRowLen)
				   {
					   rtnValue = 0U;
				   }
				   else
				   {
					   /*动态申请空间*/
					   LSData.pLSOverlapLockCondStru = (LS_OveralpLockCondStru*)MyNew((UINT32)(sizeof(LS_OveralpLockCondStru) * LSDataLen.LSOverlapLockCondStruLen));
					   /*动态申请空间失败*/
					   if (NULL == LSData.pLSOverlapLockCondStru)
					   {
						   /*将数组长度清0，防护数组访问越界*/
						   LSDataLen.LSOverlapLockCondStruLen = 0u;

						   rtnValue = 0u;
					   }
					   else
					   {
						   /*内存先设为无效*/
						   (void)memset(LSData.pLSOverlapLockCondStru, 0x00, sizeof(LS_OveralpLockCondStru) * LSDataLen.LSOverlapLockCondStruLen);

						   /*解析数据到 默认行车序列 结构体数组 */
						   rtnValue = 1u;
						   for (j = 0u; j < LSDataLen.LSOverlapLockCondStruLen; j++)
						   {
							   pTempLSProtSecLockCondStru = LSData.pLSOverlapLockCondStru + j;

							   /*填充数据结构体*/
							   rtnValue &= LS_OverlapLockCondStruFromChar(pDataAddr, pTempLSProtSecLockCondStru);

							   pDataAddr += realRowLen;
						   }

					   }
				   }
			   }
		   }
		   else
		   {
			   rtnValue = 1U;
		   }
		  
		}
	}

	return rtnValue;
}

/* zt 删除单轨相关代码 2022-02-15 */


/*********************************************
*函数功能：物理区段侵限区段及跳跃锁闭条件表数组
*参数说明：LSDataName指针          
*返回值：0，失败；1，成功
*********************************************/
UINT8 InitLS_PhySectionIntrudeStru(CHAR* LSDataName)
{
	UINT8 funcRtn = 0u;
	LS_PhySectionIntrudeStruct* pLSPhyIntruPhySecStru = NULL;   /*临时变量*/
	UINT8* pDataAddr = NULL;         /*数据地址*/
	UINT32 DataSize = 0u;          /*数据大小（字节数）*/
	UINT16 struInx = 0u;
	UINT8 rtnValue = 0u;

	/*已经初始化了，不用老是调用执行过程*/
	if(LSData.pLSPhyIntruPhySecStru != NULL)
	{
		rtnValue = 1u;
		return rtnValue;
	}

	/*读取 默认行车序列  数据*/
	funcRtn = dquGetConfigData(LSDataName, LS_DATA_TYPE, PHYSICAL_INTRU_DATA_ID, &pDataAddr, &DataSize);

	if(0u == funcRtn)
	{
		/*函数调用失败*/
		rtnValue = 0u;
		return rtnValue;
	} 	
	/*求得个数*/
	if(0u != (DataSize % PHYSICAL_INTRU_DATA_LEN))
	{
		debug_infor_printf((const)"\nCI_LS_DATA,PHYSICAL_JUMP_LOCK len %d not equal to fs",PHYSICAL_INTRU_DATA_LEN);
		DebugPrintAppError(ERROR_fs_columns_len_not_equal_to_ci_software,CI_DEVICE_TYPE_FS_TABLE,(LS_DATA_TYPE<<8u)+PHYSICAL_INTRU_DATA_ID,PRINT_ONCE);
		rtnValue = 0u;
		return rtnValue;
	}			

	LSDataLen.LS_PhySectionIntrudeStruLen = (UINT16)(DataSize / PHYSICAL_INTRU_DATA_LEN);

	if(PHYSICAL_INTRU_DATA_LEN > DataSize)
	{
		LSData.pLSPhyIntruPhySecStru = (LS_PhySectionIntrudeStruct *)MyNew((UINT32)sizeof(LS_PhySectionIntrudeStruct));
		rtnValue = 1u;
		return rtnValue;
	}
	else
	{
		/*继续执行*/
	}

	/*动态申请空间*/
	LSData.pLSPhyIntruPhySecStru = (LS_PhySectionIntrudeStruct *)MyNew((UINT32)(sizeof(LS_PhySectionIntrudeStruct) * LSDataLen.LS_PhySectionIntrudeStruLen));
	/*动态申请空间失败*/
	if(NULL == LSData.pLSPhyIntruPhySecStru)
	{
		/*将数组长度清0，防护数组访问越界*/
		LSDataLen.LS_PhySectionIntrudeStruLen = 0u;

		rtnValue = 0u;

		return rtnValue;
	}
	else
	{
		/*内存先设为无效*/
		(void)memset(LSData.pLSPhyIntruPhySecStru, 0x00, sizeof(LS_PhySectionIntrudeStruct) * LSDataLen.LS_PhySectionIntrudeStruLen);
	}

	/*解析数据到 默认行车序列 结构体数组 */  
	rtnValue = 1u;
	for(struInx = 0u; struInx < LSDataLen.LS_PhySectionIntrudeStruLen; struInx++)
	{
		pLSPhyIntruPhySecStru = LSData.pLSPhyIntruPhySecStru + struInx;

		/*填充数据结构体*/
		rtnValue &= LS_PhySecIntrudeStruFromChar(pDataAddr, pLSPhyIntruPhySecStru);

		pDataAddr += PHYSICAL_INTRU_DATA_LEN;
	}


	return rtnValue;
}


/*********************************************
*函数功能：填充联锁表-防护道岔与主体道岔对应关系表结构体数组
*参数说明：LSDataName指针          
*返回值：0，失败；1，成功
*********************************************/
UINT8 InitLS_ProSwitchHostMapStru(CHAR* LSDataName)
{
	UINT8 funcRtn;
	LS_ProSwitchHostSwitchMapStruct* pProHostSwitchMapStr = NULL;   /*临时变量*/
	UINT8* pDataAddr = NULL;         /*数据地址*/
	UINT16 index = 0u;	/*数据索引*/
	UINT32 DataSize = 0u;          /*数据大小（字节数）*/
	UINT16 j = 0u;
	UINT8 rtnValue = 0u;
	UINT8 hasInited = 0u;/*是否已经初始化*/

	/*已经初始化了，不用老是调用执行过程*/
	if(LSData.pLSProSwitchHostSwitchMapStru != NULL)
	{
		hasInited = 1u;
		rtnValue = 1u;
	}
	else
	{
		hasInited = 0u;
	}

	if (0u == hasInited)
	{/*未初始化过*/
		if (NULL == LSDataName)
		{
			rtnValue = 0u;
		}
		else
		{
			rtnValue = 1u;
		}
		if (1u == rtnValue)
		{
			/*读取 防护道岔与主体道岔对应关系表  数据*/
			funcRtn = dquGetConfigData(LSDataName,LS_DATA_TYPE,PROSWITCH_HOSTSWITCH_MAP_ID,&pDataAddr,&DataSize);
			if(funcRtn == 0u)
			{
				/*函数调用失败*/
				rtnValue = 0u;
			}
			else
			{
				rtnValue = 1u;
			}
		}


		if (1u == rtnValue)
		{
			/*求得个数*/
			if((DataSize%PROSWITCH_HOSTSWITCH_MAP_LEN) != 0u)
			{   
				debug_infor_printf((const)"\nCI_CI_DATA,PROSWITCH_HOSTSWITCH_DATA len %d not equal to fs",PROSWITCH_HOSTSWITCH_MAP_LEN);
				DebugPrintAppError(ERROR_fs_columns_len_not_equal_to_ci_software,CI_DEVICE_TYPE_FS_TABLE,(UINT32)((LS_DATA_TYPE<<8)+PROSWITCH_HOSTSWITCH_MAP_ID),PRINT_ONCE);
				rtnValue = 0u;
			}	
		}

		if (1u == rtnValue)
		{
			LSDataLen.LS_ProSwitchHostSwitchMapStruLen = (UINT16)(DataSize/PROSWITCH_HOSTSWITCH_MAP_LEN);

			if(DataSize<PROSWITCH_HOSTSWITCH_MAP_LEN)
			{
				LSData.pLSProSwitchHostSwitchMapStru = (LS_ProSwitchHostSwitchMapStruct *) MyNew ((UINT32)sizeof(LS_ProSwitchHostSwitchMapStruct) );
				rtnValue = 1u;
			}
			else
			{
				/*继续执行*/
				/*动态申请空间*/
				LSData.pLSProSwitchHostSwitchMapStru = (LS_ProSwitchHostSwitchMapStruct  *) MyNew ((UINT32)(sizeof(LS_ProSwitchHostSwitchMapStruct) * LSDataLen.LS_ProSwitchHostSwitchMapStruLen));
				/*动态申请空间失败*/
				if(NULL == LSData.pLSProSwitchHostSwitchMapStru)
				{
					/*将数组长度清0，防护数组访问越界*/
					LSDataLen.LS_ProSwitchHostSwitchMapStruLen = 0u;

					rtnValue = 0u;
				}
				else
				{
					/*内存先设为无效*/
					(void)memset((void *)LSData.pLSProSwitchHostSwitchMapStru, 0,sizeof(LS_ProSwitchHostSwitchMapStruct) * LSDataLen.LS_ProSwitchHostSwitchMapStruLen);
				}

				/*解析数据到 防护道岔与主体道岔对应关系表 结构体数组 */  
				for(j=0u;j<LSDataLen.LS_ProSwitchHostSwitchMapStruLen;j++)
				{
					pProHostSwitchMapStr = &LSData.pLSProSwitchHostSwitchMapStru[j];

					/*填充数据结构体*/
					rtnValue &= LS_ProSwitchHostSwStruFromChar((UINT8*)(&pDataAddr[index]),pProHostSwitchMapStr);
					
					index += PROSWITCH_HOSTSWITCH_MAP_LEN;
				}
			}


		}
		
	}


	return rtnValue;
}


/*********************************************
*函数功能：填充组合自动进路表数据结构体数组
*参数说明：LSDataName指针          
*返回值：0，失败；1，成功
*********************************************/
UINT8 InitLS_GroupAutoRouteStru(CHAR* LSDataName)
{
	UINT8 funcRtn = 0u;
	LS_GroupAutoRouteStru* pLsGroupAutoRouteStr = NULL;   /*临时组合自动进路变量*/
	UINT8* pDataAddr = NULL;         /*数据地址*/
	UINT32 DataSize = 0u;          /*数据大小（字节数）*/
	UINT16 i = 0u;
	UINT16 realRowCount = 0u; /*实际表数据的行数*/
	UINT16 realRowLen = 0u; /*实际表数据的一行的长度*/
	UINT8 rtnValue = 0u;

	/*已经初始化了，不用老是调用执行过程*/
	if(NULL != LSData.pLSGroupAutoRouteStru)
	{
		rtnValue = 1u;
	}
	else
	{
		rtnValue = 1u;
		/*读取 默认行车序列  数据*/
		funcRtn = dquGetConfigDataNew(LSDataName, LS_DATA_TYPE, GROUP_AUTO_ROUTE_DATA_ID,&pDataAddr,&DataSize,&realRowCount);
		if(0u == funcRtn)
		{
			/*函数调用失败*/
			rtnValue = 1u;
			debug_infor_printf((const)"\nGROUP_AUTO_ROUTE_DATA_ID NO IN FS\n");
		}
		else
		{		
			if((0u != DataSize) && (0u != realRowCount))
			{
				if(0u != (DataSize % realRowCount))
				{   
					debug_infor_printf((const)"\nCI_LS_DATA,GROUP_AUTO_ROUTE 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,(LS_DATA_TYPE<<8)+GROUP_AUTO_ROUTE_DATA_ID,PRINT_ONCE);
					rtnValue = 0u;
				}	
				else
				{					
					/*数据实际一行的数据字节长度*/
					realRowLen = (UINT16)(DataSize / realRowCount);
					LSDataLen.LSGroupAutoRouteStruLen = realRowCount;				
					/*动态申请空间*/
					LSData.pLSGroupAutoRouteStru = (LS_GroupAutoRouteStru *) MyNew ((UINT32)(sizeof(LS_GroupAutoRouteStru) * LSDataLen.LSGroupAutoRouteStruLen));
					/*动态申请空间失败*/
					if(NULL == LSData.pLSGroupAutoRouteStru)
					{
						LSDataLen.LSGroupAutoRouteStruLen = 0u;
						rtnValue = 0u;
					}
					else
					{
						/*内存先设为无效*/
						(void)memset(LSData.pLSGroupAutoRouteStru, 0x00,sizeof(LS_GroupAutoRouteStru) * LSDataLen.LSGroupAutoRouteStruLen);

						/*解析数据到 默认行车序列 结构体数组 */  
						for(i=0u;i<LSDataLen.LSGroupAutoRouteStruLen;i++)
						{
							pLsGroupAutoRouteStr = LSData.pLSGroupAutoRouteStru + i;

							/*填充数据结构体*/
							rtnValue &=LS_GroupAutoRtnRouteStruFrmChar(pDataAddr,pLsGroupAutoRouteStr);
							pDataAddr += realRowLen;

						}
					}
				}

			}
			else
			{
				debug_infor_printf((const)"\nGROUP_AUTO_ROUTE_DATA_ERR  DataSize %d  realRowCount %d\n ",DataSize,realRowCount);
			}

		}
	}
	return rtnValue;
}

/*********************************************
*函数功能：填充逻辑区段侵限数据结构体数组
*参数说明：LSDataName指针
*返回值：0，失败；1，成功
*********************************************/
UINT8 InitLS_LogicSecIntruStru(CHAR* LSDataName)
{
	UINT8 funcRtn = 0u;
	LS_LgcSectionIntrudeStruct* pLsLgcIntruStr = NULL;   /*临时组合自动进路变量*/
	UINT8* pDataAddr = NULL;         /*数据地址*/
	UINT32 DataSize = 0u;          /*数据大小（字节数）*/
	UINT16 i = 0u;
	UINT16 realRowCount = 0u; /*实际表数据的行数*/
	UINT16 realRowLen = 0u; /*实际表数据的一行的长度*/
	UINT8 rtnValue = 0u;

	/*已经初始化了，不用老是调用执行过程*/
	if (NULL != LSData.pLSLgcIntruSecStru)
	{
		rtnValue = 1u;
	}
	else
	{
		rtnValue = 1u;
		/*读取 默认行车序列  数据*/
		funcRtn = dquGetConfigDataNew(LSDataName, LS_DATA_TYPE, LOGIC_SEC_INTRU_DATA_ID, &pDataAddr, &DataSize, &realRowCount);
		if (0u == funcRtn)
		{
			/*函数调用失败*/
			rtnValue = 1u;
			debug_infor_printf((const)"\nLGC_INTRU_TABLE NO IN FS\n");
		}
		else
		{
			if ((0u != DataSize) && (0u != realRowCount))
			{
				if (0u != (DataSize % realRowCount))
				{
					debug_infor_printf((const)"\nTIOC_LS_DATA,LGC_INTRU_TABLE 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, (LS_DATA_TYPE << 8) + GROUP_AUTO_ROUTE_DATA_ID, PRINT_ONCE);
					rtnValue = 0u;
				}
				else
				{
					/*数据实际一行的数据字节长度*/
					realRowLen = (UINT16)(DataSize / realRowCount);
					LSDataLen.LSLgcSecIntruStruLen = realRowCount;
					/*动态申请空间*/
					LSData.pLSLgcIntruSecStru = (LS_LgcSectionIntrudeStruct *)MyNew((UINT32)(sizeof(LS_LgcSectionIntrudeStruct) * LSDataLen.LSLgcSecIntruStruLen));
					/*动态申请空间失败*/
					if (NULL == LSData.pLSLgcIntruSecStru)
					{
						LSDataLen.LSLgcSecIntruStruLen = 0u;
						rtnValue = 0u;
					}
					else
					{
						/*内存先设为无效*/
						(void)memset(LSData.pLSLgcIntruSecStru, 0x00, sizeof(LS_LgcSectionIntrudeStruct) * LSDataLen.LSLgcSecIntruStruLen);

						/*解析数据到 默认行车序列 结构体数组 */
						for (i = 0u; i<LSDataLen.LSLgcSecIntruStruLen; i++)
						{
							pLsLgcIntruStr = LSData.pLSLgcIntruSecStru + i;

							/*填充数据结构体*/
							rtnValue &=LS_LgcSecIntrudeStruFromChar(pDataAddr, pLsLgcIntruStr);
							pDataAddr += realRowLen;

						}
					}
				}

			}
			else
			{
				debug_infor_printf((const)"\nGROUP_AUTO_ROUTE_DATA_ERR  DataSize %d  realRowCount %d\n ", DataSize, realRowCount);
			}

		}
	}
	return rtnValue;
}


/*********************************************
*函数功能：填充逻辑区段互相侵限数据结构体数组
*参数说明：LSDataName指针
*返回值：0，失败；1，成功
*********************************************/
UINT8 InitLS_LogSecIntruStru_Each(CHAR* LSDataName)
{
	UINT8 funcRtn = 0u;
	LS_EachLgcIntrudeStruct* pLsLgcInvEachStr = NULL;   /*临时侵限变量*/
	UINT8* pDataAddr = NULL;         /*数据地址*/
	UINT32 DataSize = 0u;          /*数据大小（字节数）*/
	UINT16 i = 0u;
	UINT16 realRowCount = 0u; /*实际表数据的行数*/
	UINT16 realRowLen = 0u; /*实际表数据的一行的长度*/
	UINT8 rtnValue = 0u;

	/*已经初始化了，不用老是调用执行过程*/
	if (NULL != LSData.pLSLgcInvEachStru)
	{
		rtnValue = 1u;
	}
	else
	{
		rtnValue = 1u;
		/*读取 默认行车序列  数据*/
		funcRtn = dquGetConfigDataNew(LSDataName, LS_DATA_TYPE, LOGIC_SEC_EACHINTRU_DATA_ID, &pDataAddr, &DataSize, &realRowCount);
		if (0u == funcRtn)
		{
			/*函数调用失败*/
			rtnValue = 1u;
			debug_infor_printf((const)"\nLGC_EACHOTHER_INTRU_TABLE NO IN FS\n");
		}
		else
		{
			if ((0u != DataSize) && (0u != realRowCount))
			{
				if (0u != (DataSize % realRowCount))
				{
					debug_infor_printf((const)"\nTIOC_LS_DATA,nLGC_EACHOTHER_INTRU_TABLE 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, (LS_DATA_TYPE << 8) + LOGIC_SEC_EACHINTRU_DATA_ID, PRINT_ONCE);
					rtnValue = 0u;
				}
				else
				{
					/*数据实际一行的数据字节长度*/
					realRowLen = (UINT16)(DataSize / realRowCount);
					LSDataLen.LSLgcInvEachLen = realRowCount;
					/*动态申请空间*/
					LSData.pLSLgcInvEachStru = (LS_EachLgcIntrudeStruct*)MyNew((UINT32)(sizeof(LS_EachLgcIntrudeStruct) * LSDataLen.LSLgcInvEachLen));
					/*动态申请空间失败*/
					if (NULL == LSData.pLSLgcInvEachStru)
					{
						LSDataLen.LSLgcInvEachLen = 0u;
						rtnValue = 0u;
					}
					else
					{
						/*内存先设为无效*/
						(void)memset(LSData.pLSLgcInvEachStru, 0x00, sizeof(LS_EachLgcIntrudeStruct) * LSDataLen.LSLgcInvEachLen);

						/*解析数据到 默认行车序列 结构体数组 */
						for (i = 0u; i < LSDataLen.LSLgcInvEachLen; i++)
						{
							pLsLgcInvEachStr = LSData.pLSLgcInvEachStru + i;

							/*填充数据结构体*/
							rtnValue &= LS_LgcSecInvEachStruFromChar(pDataAddr, pLsLgcInvEachStr);
							pDataAddr += realRowLen;

						}
					}
				}

			}
			else
			{
				debug_infor_printf((const)"\nLGC_EACHOTHER_INTRU_TABLE  DataSize %d  realRowCount %d\n ", DataSize, realRowCount);
			}

		}
	}
	return rtnValue;
}


/*********************************************
*函数功能：填充逻辑区段侧防数据结构体数组
*参数说明：LSDataName指针
*返回值：0，失败；1，成功
*********************************************/
UINT8 InitLS_LogicLtrlDfncStru(CHAR* LSDataName)
{
	UINT8 funcRtn = 0u;
	LS_LgcSecLrtlDfncStruct* pLsLgcLrtlDfncStr = NULL;   /*临时组合自动进路变量*/
	UINT8* pDataAddr = NULL;         /*数据地址*/
	UINT32 DataSize = 0u;          /*数据大小（字节数）*/
	UINT16 i = 0u;
	UINT16 realRowCount = 0u; /*实际表数据的行数*/
	UINT16 realRowLen = 0u; /*实际表数据的一行的长度*/
	UINT8 rtnValue = 0u;

	/*已经初始化了，不用老是调用执行过程*/
	if (NULL != LSData.pLSLgcLrtlDfncStru)
	{
		rtnValue = 1u;
	}
	else
	{
		rtnValue = 1u;
		/*读取 逻辑区段侧防条件标  数据*/
		funcRtn = dquGetConfigDataNew(LSDataName, LS_DATA_TYPE, LOGIC_SEC_LTRL_DFNC_ID, &pDataAddr, &DataSize, &realRowCount);
		if (0u == funcRtn)
		{
			/*函数调用失败*/
			rtnValue = 1u;
			debug_infor_printf((const)"\nLGC_LATERAL_DENFENCE_TABLE NO IN FS\n");
		}
		else
		{
			if ((0u != DataSize) && (0u != realRowCount))
			{
				if (0u != (DataSize % realRowCount))
				{
					debug_infor_printf((const)"\nTIOC_LS_DATA,LGC_LATERAL_DENFENCE_TABLE 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, (LS_DATA_TYPE << 8) + LOGIC_SEC_LTRL_DFNC_ID, PRINT_ONCE);
					rtnValue = 0u;
				}
				else
				{
					/*数据实际一行的数据字节长度*/
					realRowLen = (UINT16)(DataSize / realRowCount);
					LSDataLen.LSLgcSecLtrlDfncStruLen = realRowCount;
					/*动态申请空间*/
					LSData.pLSLgcLrtlDfncStru = (LS_LgcSecLrtlDfncStruct *)MyNew((UINT32)(sizeof(LS_LgcSecLrtlDfncStruct) * LSDataLen.LSLgcSecLtrlDfncStruLen));
					/*动态申请空间失败*/
					if (NULL == LSData.pLSLgcLrtlDfncStru)
					{
						LSDataLen.LSLgcSecLtrlDfncStruLen = 0u;
						rtnValue = 0u;
					}
					else
					{
						/*内存先设为无效*/
						(void)memset(LSData.pLSLgcLrtlDfncStru, 0x00, sizeof(LS_LgcSecLrtlDfncStruct) * LSDataLen.LSLgcSecLtrlDfncStruLen);

						/*解析数据到 默认行车序列 结构体数组 */
						for (i = 0u; i<LSDataLen.LSLgcSecLtrlDfncStruLen; i++)
						{
							pLsLgcLrtlDfncStr = LSData.pLSLgcLrtlDfncStru + i;

							/*填充数据结构体*/
							rtnValue &= LS_LgcSecLrtlDfncStruFromChar(pDataAddr, pLsLgcLrtlDfncStr);
							pDataAddr += realRowLen;

						}
					}
				}

			}
			else
			{
				debug_infor_printf((const)"\nLGC_LATERAL_DENFENCE_TABLE_ERR  DataSize %d  realRowCount %d\n ", DataSize, realRowCount);
			}

		}
	}
	return rtnValue;
}

/*********************************************
* 函数功能：填充声光报警器数据结构体数组
* 参数说明：LSDataName指针
* 返回值：0，失败；1，成功
* 成都三线新需求：增加声光报警器——2023.09.22 by LQ
*********************************************/
UINT8 InitLS_SGBJStru(CHAR* LSDataName)
{
	UINT8 funcRtn = 0U;
	LS_SGBJStruct* pSGBJStr = NULL;   /*临时声光报警结构体变量*/
	UINT8* pDataAddr = NULL;         /*数据地址*/
	UINT32 DataSize = 0U;          /*数据大小（字节数）*/
	UINT16 i = 0U;
	UINT16 realRowCount = 0U; /*实际表数据的行数*/
	UINT16 realRowLen = 0U;   /*实际表数据的一行的长度*/
	UINT8 rtnValue = 0U;

	/*已经初始化了，不用老是调用执行过程*/
	if (NULL != LSData.pLSSGBJStru)
	{
		rtnValue = 1U;
	}
	else
	{
		rtnValue = 1U;

		/*读取声光报警器表数据*/
		funcRtn = dquGetConfigDataNew(LSDataName, LS_DATA_TYPE, SGBJ_CI_DATA_ID, &pDataAddr, &DataSize, &realRowCount);

		if (0U == funcRtn)
		{
			/*函数调用失败*/
			rtnValue = 0U;
			debug_infor_printf((const)"\nLS_SGBJSTRU_TABLE NO IN FS\n");
		}
		else
		{
			if ((0U != DataSize) && (0U != realRowCount))
			{
				if (0U != (DataSize % realRowCount))
				{
					debug_infor_printf((const)"\nTIOC_LS_DATA,LS_SGBJSTRU_TABLE 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, (LS_DATA_TYPE << 8U) + SGBJ_CI_DATA_ID, PRINT_ONCE);
					rtnValue = 0U;
				}
				else
				{
					/*数据实际一行的数据字节长度*/
					realRowLen = (UINT16)(DataSize / realRowCount);
					LSDataLen.LSSGBJStruLen = realRowCount;

					/*动态申请空间*/
					LSData.pLSSGBJStru = (LS_SGBJStruct*)MyNew((UINT32)(sizeof(LS_SGBJStruct) * LSDataLen.LSSGBJStruLen));
					if (NULL == LSData.pLSSGBJStru)
					{
						LSDataLen.LSSGBJStruLen = 0U;  /*动态申请空间失败，返回0*/
						rtnValue = 0U;
					}
					else
					{
						/*内存先设为无效*/
						(void)memset(LSData.pLSSGBJStru, 0x00, sizeof(LS_SGBJStruct) * LSDataLen.LSSGBJStruLen);

						/*解析数据到 默认行车序列 结构体数组 */
						for (i = 0U; i < LSDataLen.LSSGBJStruLen; i++)
						{
							pSGBJStr = LSData.pLSSGBJStru + i;

							/*填充数据结构体*/
							rtnValue = LS_SGBJStruFromChar(pDataAddr, pSGBJStr);
							pDataAddr += realRowLen;

							if (0U == rtnValue)
							{
								debug_infor_printf((const)"\nRead LS_SGBJSTRU_TABLE Error: Error RowCount %d\n ", (i + 1U));
								break;
							}
							else
							{
								/*继续读取*/
							}
						}
					}
				}
			}
			else
			{
				debug_infor_printf((const)"\nLS_SGBJSTRU_TABLE_ERR  DataSize %d  realRowCount %d\n ", DataSize, realRowCount);
			}

		}
	}
	return rtnValue;
}

/*********************************************
* 函数功能：转换轨进路折返信号机id结构体数组
* 参数说明：LSDataName指针
* 返回值：0，失败；1，成功
* 处理折返信号机外方区段无岔且解锁场景  创建：2024.07.25 by fan
*********************************************/
UINT8 InitLS_TransRouteRtnDataStruct(CHAR* LSDataName)
{
	UINT8 funcRtn = 0U;
	LS_TransRouteZFSigStruct* pTransRouteZFSigStr = NULL;   /*临时转换轨进路折返信号机结构体变量*/
	UINT8* pDataAddr = NULL;         /*数据地址*/
	UINT32 DataSize = 0U;          /*数据大小（字节数）*/
	UINT16 i = 0U;
	UINT16 realRowCount = 0U; /*实际表数据的行数*/
	UINT16 realRowLen = 0U;   /*实际表数据的一行的长度*/
	UINT8 rtnValue = 0U;

	/*已经初始化了，不用老是调用执行过程*/
	if (NULL != LSData.pLSTransRouteZFSigStru)
	{
		rtnValue = 1U;
	}
	else
	{
		rtnValue = 1U;
		/*读取转换轨进路折返信号机表数据*/
		funcRtn = dquGetConfigDataNew(LSDataName, LS_DATA_TYPE, TRANSROUTE_ZHEFANSIG_ID, &pDataAddr, &DataSize, &realRowCount);

		if (0U == funcRtn)
		{
			/*函数调用失败*/
			rtnValue = 0U;
			debug_infor_printf((const)"\n LS_TransRouteZFSignal NO IN FS\n");
		}
		else
		{
			if ((0U != DataSize) && (0U != realRowCount))
			{
				if (0U != (DataSize % realRowCount))
				{
					debug_infor_printf((const)"\nTIOC_LS_DATA,LS_TransRouteZFSignal_TABLE 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, (LS_DATA_TYPE << 8U) + TRANSROUTE_ZHEFANSIG_ID, PRINT_ONCE);
					rtnValue = 0U;
				}
				else
				{
					/*数据实际一行的数据字节长度*/
					realRowLen = (UINT16)(DataSize / realRowCount);
					LSDataLen.LSTransRouteZFSigStruLen = realRowCount;

					/*动态申请空间*/
					LSData.pLSTransRouteZFSigStru = (LS_TransRouteZFSigStruct*)MyNew((UINT32)(sizeof(LS_TransRouteZFSigStruct) * LSDataLen.LSTransRouteZFSigStruLen));
					if (NULL == LSData.pLSTransRouteZFSigStru)
					{
						LSDataLen.LSTransRouteZFSigStruLen = 0U;  /*动态申请空间失败，返回0*/
						rtnValue = 0U;
					}
					else
					{
						/*内存先设为无效*/
						(void)memset(LSData.pLSTransRouteZFSigStru, 0x00, sizeof(LS_TransRouteZFSigStruct) * LSDataLen.LSTransRouteZFSigStruLen);

						/*解析数据到转换轨进路折返信号机id结构体数组 */
						for (i = 0U; i < LSDataLen.LSTransRouteZFSigStruLen; i++)
						{
							pTransRouteZFSigStr = LSData.pLSTransRouteZFSigStru + i;

							/*填充数据结构体*/
							rtnValue = LS_TransZFSigFromChar(pDataAddr, pTransRouteZFSigStr);
							pDataAddr += realRowLen;

							if (0U == rtnValue)
							{
								debug_infor_printf((const)"\nRead LS_TransRouteZFSignal_TABLE Error: Error RowCount %d\n ", (i + 1U));
								break;
							}
							else
							{
								/*继续读取*/
							}
						}
					}
				}
			}
			else
			{
				debug_infor_printf((const)"\LS_TransRouteZFSignal_TABLE_ERR  DataSize %d  realRowCount %d\n ", DataSize, realRowCount);
			}
		}
	}
	return rtnValue;
}
/*********************************************
*函数功能：填充风井进路进路检查表数据结构体数组
*参数说明：LSDataName指针
*返回值：0，失败；1，成功
* 创建：2026.03.04 by yx
*********************************************/
UINT8 InitLS_AirShaftRouteStru(CHAR* LSDataName)
{
	UINT8 funcRtn = 0u;
	LS_AirShaftStruct* pAirShaftRouteStr = NULL;   /*临时风井进路检查表结构体变量*/
	UINT8* pDataAddr = NULL;         /*数据地址*/
	UINT32 DataSize = 0u;          /*数据大小（字节数）*/
	UINT16 i = 0u;
	UINT16 realRowCount = 0u; /*实际表数据的行数*/
	UINT16 realRowLen = 0u; /*实际表数据的一行的长度*/
	UINT8 rtnValue = 0u;

	/*已经初始化了，不用老是调用执行过程*/
	if (NULL != LSData.pLSAirShaftRouteStru)
	{
		rtnValue = 1u;
	}
	else
	{
		rtnValue = 1u;
		/*读取配置数据*/
		funcRtn = dquGetConfigDataNew(LSDataName, LS_DATA_TYPE, AIR_SHAFT_DATA_ID, &pDataAddr, &DataSize, &realRowCount);
		if (0u == funcRtn)
		{
			/*函数调用失败*/
			rtnValue = 0u;
			debug_infor_printf((const)"\nAIR_SHAFT_DATA_ID NO IN FS\n");
		}
		else
		{
			if ((0u != DataSize) && (0u != realRowCount))
			{
				if (0u != (DataSize % realRowCount))
				{
					debug_infor_printf((const)"\nTIOC_LS_DATA,LS_AirShaft_TABLE 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, (LS_DATA_TYPE << 8) + AIR_SHAFT_DATA_ID, PRINT_ONCE);
					rtnValue = 0u;
				}
				else
				{
					/*数据实际一行的数据字节长度*/
					realRowLen = (UINT16)(DataSize / realRowCount);
					LSDataLen.LSAirShaftRouteStruLen = realRowCount;
					/*动态申请空间*/
					LSData.pLSAirShaftRouteStru = (LS_AirShaftStruct*)MyNew((UINT32)(sizeof(LS_AirShaftStruct) * LSDataLen.LSAirShaftRouteStruLen));
					/*动态申请空间失败*/
					if (NULL == LSData.pLSAirShaftRouteStru)
					{
						LSDataLen.LSAirShaftRouteStruLen = 0u;
						rtnValue = 0u;
					}
					else
					{
						/*内存先设为无效*/
						(void)CommonMemSet((void*)LSData.pLSAirShaftRouteStru, (UINT32)sizeof(LS_AirShaftStruct) * LSDataLen.LSAirShaftRouteStruLen, 0U, (UINT32)sizeof(LS_AirShaftStruct) * LSDataLen.LSAirShaftRouteStruLen);
						/*解析数据到 默认行车序列 结构体数组 */
						for (i = 0u; i < LSDataLen.LSAirShaftRouteStruLen; i++)
						{
							pAirShaftRouteStr = LSData.pLSAirShaftRouteStru + i;

							/*填充数据结构体*/
							rtnValue &= LS_AirShaftStruFromChar(pDataAddr, pAirShaftRouteStr);
							if (CI_ERROR == rtnValue)
							{
								rtnValue = 0u;
								break;
							}
							pDataAddr += realRowLen;

						}
					}
				}

			}
			else
			{
				debug_infor_printf((const)"\nAIR_SHAFT_ROUTE_DATA_ERR  DataSize %d  realRowCount %d\n ", DataSize, realRowCount);
			}

		}
	}
	return rtnValue;
}