/********************************************************
*                                                                                                            
* 文 件 名： ErrorDefine.h   
* 版权说明： 北京交控科技有限公司 
* 创建时间： 2012-04-11
* 作    者： 联锁组
* 功能描述： 错误数据定义头文件  
* 函数包括：
* 使用注意：
* 修改记录：   
*
********************************************************/ 
#ifndef _ERROR_DEFINE_H_
#define _ERROR_DEFINE_H_

#include "../System/CiSystemDefine.h"


/*一周期错误数据总数最大值*/
#define ERROR_DATA_SUM_MAX                   ((UINT16)100)       /*定义错误数据总数最大值*/

/* 双版本接口函数编码用于区别不同函数的故障码 */
#define EFUNC_NO_ERROR                ((UINT8)0x00)    /* 函数返回成功 */

/*正线联锁逻辑检查*/
#define EFUNC_ROUTE_LEVEL             ((UINT8)0x01)    /* RouteLevelConfirmLogicProcess */
#define EFUNC_SET_BLOC_T_ROUTE        ((UINT8)0x02)    /* SetBlocLTrainRouteLogicProcess */
#define EFUNC_SET_CBTC_T_ROUTE        ((UINT8)0x03)    /* SetCbtcLTrainRouteLogicProcess */
#define EFUNC_SET_BLOC_R_ROUTE        ((UINT8)0x04)    /* SetBlocReturnRouteLogicProcess */
#define EFUNC_SET_CBTC_R_ROUTE        ((UINT8)0x05)    /* SetCbtcReturnRouteLogicProcess */
#define EFUNC_LOCK_LEAD_ROUTE         ((UINT8)0x06)    /* LockLeadRouteLogicProcess */
#define EFUNC_LOCK_BLOC_T_ROUTE       ((UINT8)0x07)    /* LockBlocLTrainRouteLogicProcess */
#define EFUNC_LOCK_CBTC_T_ROUTE       ((UINT8)0x08)    /* LockCbtcLTrainRouteLogicProcess */
#define EFUNC_LOCK_BLOC_R_ROUTE       ((UINT8)0x09)    /* LockBlocReturnRouteLogicProcess */
#define EFUNC_LOCK_CBTC_R_ROUTE       ((UINT8)0x0a)    /* LockCbtcReturnRouteLogicProcess */
#define EFUNC_LOCK_OVER_LAP           ((UINT8)0x0b)    /* LockRouteOverlapLogicProcess */
#define EFUNC_OPEN_BLOC_T_SIGNAL      ((UINT8)0x0c)    /* OpenBlocLTrainRouteLogicProcess */
#define EFUNC_KEEP_BLOC_T_SIGNAL      ((UINT8)0x0d)    /* KeepBlocLTrainRouteLogicProcess */
#define EFUNC_OPEN_CBTC_T_SIGNAL      ((UINT8)0x0e)    /* OpenCbtcLTrainRouteLogicProcess */
#define EFUNC_KEEP_CBTC_T_SIGNAL      ((UINT8)0x0f)    /* KeepCbtcLTrainRouteLogicProcess */
#define EFUNC_OPEN_BLOC_R_SIGNAL      ((UINT8)0x10)    /* OpenBlocReturnRouteLogicProcess */
#define EFUNC_KEEP_BLOC_R_SIGNAL      ((UINT8)0x11)    /* KeepBlocReturnRouteLogicProcess */
#define EFUNC_OPEN_CBTC_R_SIGNAL      ((UINT8)0x12)    /* OpenCbtcReturnRouteLogicProcess */
#define EFUNC_KEEP_CBTC_R_SIGNAL      ((UINT8)0x13)    /* KeepCbtcReturnRouteLogicProcess */
#define EFUNC_OPEN_LEAD_SIGNAL        ((UINT8)0x14)    /* OpenLeadRouteLogicProcess */
#define EFUNC_KEEP_LEAD_SIGNAL        ((UINT8)0x15)    /* KeepLeadRouteLogicProcess */
#define EFUNC_UNLOCK_1ST_SECTION      ((UINT8)0x16)    /* RouteFirstSecAutoUnlockProcess */
#define EFUNC_UNLOCK_OTHERS_SECTION   ((UINT8)0x17)    /* RouteOtherSectionAutoLockLogicProcess */
#define EFUNC_DLOCK_SECTION           ((UINT8)0x18)    /* PhySectionDelayUnlockProcess */
#define EFUNC_UNLOCK_OVER_LAP         ((UINT8)0x19)    /* UnlockRouteOverlapLogicProcess */
#define EFUNC_CANCLE_ROUTE            ((UINT8)0x1a)    /* RouteCancelLogicProcess */
#define EFUNC_CHECK_SECTION_USE       ((UINT8)0x1b)    /* RoutePhySectionUseLogicProcess */
#define EFUNC_UNLOCK_FAULT_SECTION    ((UINT8)0x1c)    /* PhySecFaultUnlockLogicProcess */
#define EFUNC_SET_SWITCH_POS          ((UINT8)0x1d)    /* SetSwitchPositionProcess */
#define EFUNC_SET_SWITCH_DLOCK        ((UINT8)0x1e)    /* SetSwitchDLockLogicProcess */
#define EFUNC_CANCEL_SWITCH_DLOCK     ((UINT8)0x1f)    /* CancelSwitchDLockProcess */
#define EFUNC_SET_SWITCH_FLOCK        ((UINT8)0x20)    /* SetSwitchFLockProcess */
#define EFUNC_CANCEL_SWITCH_FLOCK     ((UINT8)0x21)    /* CancelSwitchFLockProcess */
#define EFUNC_SET_SIGNAL_FLOCK        ((UINT8)0x22)    /* SetSignalFLockLogicProcess */
#define EFUNC_CANCEL_SIGNAL_FLOCK     ((UINT8)0x23)    /* CancelSignalFLockLogicProcess */
#define EFUNC_FORCE_SET_SWITCH_POS    ((UINT8)0x24)    /* ForceSetSwitchPosLogicProcess */
#define EFUNC_SET_REVERSE_T_ROUTE     ((UINT8)0x25)	  /* SetRevrLTrainRouteLogicProcess */
#define EFUNC_SET_REVERSE_R_ROUTE     ((UINT8)0x26)	  /* SetReverseRtnRouteLogicProcess*/
#define EFUNC_CHECK_ROUTE_ZRJ         ((UINT8)0x27)    /* CheckRouteZongRenJieFeasibility 检查进路总人解的可行性*/
#define EFUNC_CHECK_OPEN_CT_ROUTE_ERR_ZX ((UINT8)0x28)
#define EFUNC_CHECK_OPEN_UT_ROUTE_ERR_ZX ((UINT8)0x29)
#define EFUNC_CHECK_OPEN_CT_RETURN_ERR_ZX ((UINT8)0x2a)
#define EFUNC_CHECK_OPEN_UT_RETURN_ERR_ZX ((UINT8)0x2b)
#define EFUNC_KEEP_CT_SIGNAL_ERR_ZX ((UINT8)0x2c)
#define EFUNC_KEEP_UT_SIGNAL_ERR_ZX ((UINT8)0x2d)
#define EFUNC_KEEP_CT_RETURN_SIG_ERR_ZX ((UINT8)0x2e)
#define EFUNC_KEEP_UT_RETURN_SIG_ERR_ZX ((UINT8)0x2f)
#define EFUNC_LOCK_HLHT_LOC_OVLP           ((UINT8)0x30)    /*LockLocalOvlpCheckHlht */
#define EFUNC_LOCK_HLHT_REM_OVLP           ((UINT8)0x31)    /*LockOthCiOvlpCheckHlht */
#define EFUNC_CHECK_LEAD_ROUTE_ZRJ         ((UINT8)0x32)    
#define EFUNC_SET_SECTION_FLOCK            ((UINT8)0x33)   /*区段封锁，当区段封锁后取消自动属性，2018.10.23*/


#define	EFUNC_SIGNAL_RELAY_TO_DEVICE			((UINT8)0x34)		/*SignalRelayToDeviceStateProc*/

#define EFUNC_ZC_CI_MaskDataProcess				((UINT8)0x35)		/*ZC到CI码位处理*/

#define EFUNC_LockAxisSecProc					((UINT8)0x36)		/*计轴区段跳跃锁闭检查*/
#define EFUNC_RouteFirstXuanPaiManage			((UINT8)0x37U)		/*正线-进路初选*/
#define EFUNC_CommonRouteXuanPaiDeal			((UINT8)0x38U)		/*车辆段-进路选排*/
#define EFUNC_PartialRouteFirstXuanPaiManage	((UINT8)0x91U)		/*进路部分路径初选*/
#define EFUNC_DynamicRouteProc					((UINT8)0x92U)		/*SetDynamicRouteProc*/
#define EFUNC_LEAD_ROUTE_FIRST_XUANPAI			((UINT8)0x3eU)		/*LeadRouteFirstXuanPaiManage*/

#define EFUNC_KEEPROUTESECTIONERRCHECK        ((UINT8)0x39U)    /*KeepCbtcRouteSectionErrCheck*/
#define EFUNC_OPENROUTESECTIONERRCHECK        ((UINT8)0x3aU)    /*KeepCbtcRouteSectionErrCheck*/

#define EFUNC_SET_AUTOROUTE        ((UINT8)0x3bU)    /*SetAutoRouteLogicManage*/
#define EFUNC_SET_AUTORETURN        ((UINT8)0x3cU)    /*SetAutoReturnLogicManage*/
#define EFUNC_SET_ALLAUTORETURN        ((UINT8)0x3dU)    /*SetAllAutoReturnLogicManage*/

#define  EFUNC_PARSE_TMC2CI_DATA					    ((UINT8)0x3f)	/*函数：ParseTmcToTiocDataFrame*/
#define  EFUNC_PACK_CI2VOBC_DATA					((UINT8)0x40)	/*函数：PackCiToVobcData*/
#define  EFUNC_PARSE_ATS2CI_DATA					((UINT8)0x41)	/*函数：ProcessAtsOrXianDiToCiData*/
#define  EFUNC_PARSE_VOBC2CI_DATA                   ((UINT8)0x42)    /*函数：ParseVobcToCiDataFrameHLHT  */
#define  EFUNC_PARSE_ZC2CI_DATA                     ((UINT8)0x43)    /*函数：ParseZcToCiDataFrame  */
#define  EFUNC_PARSE_CI2CI_DATA                     ((UINT8)0x44)    /*函数：ParseCiToCiDataFrameHLHT  */

#define EFUNC_CHECK_SWITCH_USING					((UINT8)0x45)	/*函数：CheckRouteContainSwitchUsingState检查道岔征用*/
#define EFUNC_CROSS_CI_AUTOROUTE_FLOCK_DEV			((UINT8)0x46) /*函数：CrossCiAutoRouteFLockDevProc 跨集中区自动进路封锁设备处理*/
#define EFUNC_CHECK_GROUP_AUTO_ROUTE                ((UINT8)0x47) /*函数:SetGroupAutoRouteLogicManage 检查自动组合进路包含的自动进路是否满足条件*/
#define EFUNC_UPDATE_ZHAOCHA_CHECK      			((UINT8)0x48) /*函数：UpdateZhaoChaCheckZhaoChaDrive 照查检查联锁条件驱动照查继电器*/
#define EFUNC_CHECKORDERWHETHERDO      			((UINT8)0x49) /*函数：CheckOrderWhetherDoing 检查命令是否执行*/
#define EFUNC_ROUTE_FIRST_LOG_UNLOCK                ((UINT8)0x50) /*函数：RouteFirstLogSecAutoUnlockProcess进路第一逻辑区段自动解锁检查*/
#define EFUNC_SWITCHTESTLOGIC      			((UINT8)0x80U) /*函数：SetSwitchTestLogicManage道岔定反位测试*/
#define EFUNC_OVERLAP_VALIDMASK_CHECK				((UINT8)0x4A)	/*函数：OverlapValidMaskCheck 计算保护区段有效码位检查*/
#define EFUNC_ROUTE_LOCK_DRIVE_SWITCH        ((UINT8)0xD2)		/*RouteLockDriveSwitch 锁闭道岔*/

/*车辆段联锁逻辑检查*/
#define EFUNC_SET_LEAD_ROUTE_CHECK          ((UINT8)0x4B)    /*办理引导进路检查*/    
#define EFUNC_CLD_SET_L_TRAIN_ROUTE         ((UINT8)0x51)    /*办理列车进路*/    
#define EFUNC_CLD_SET_D_TRAIN_ROUTE         ((UINT8)0x52)    /*办理调车进路*/    
#define EFUNC_CLD_SET_LEAD_ROUTE            ((UINT8)0x53)    /*办理引导进路*/    
#define EFUNC_CLD_SET_D_LONG_ROUTE          ((UINT8)0x54)    /*办理长调进路*/    
#define EFUNC_CLD_LOCK_L_TRAIN_ROUTE        ((UINT8)0x55)    /*锁闭列车进路*/    
#define EFUNC_CLD_LOCK_D_TRAIN_ROUTE        ((UINT8)0x56)    /*锁闭调车进路*/    
#define EFUNC_CLD_LOCK_LEAD_ROUTE           ((UINT8)0x57)    /*锁闭引导进路*/    
#define EFUNC_CLD_LOCK_D_LONG_ROUTE         ((UINT8)0x58)    /*锁闭长调进路*/    
#define EFUNC_CLD_OPEN_L_TRAIN_ROUTE        ((UINT8)0x59)    /*开放列车进路信号*/
#define EFUNC_CLD_OPEN_D_TRAIN_ROUTE        ((UINT8)0x5a)    /*开放调车进路信号*/
#define EFUNC_CLD_OPEN_LEAD_ROUTE           ((UINT8)0x5b)    /*开放引导进路信号*/
#define EFUNC_CLD_KEEP_L_TRAIN_ROUTE        ((UINT8)0x5c)    /*保持列车进路信号*/
#define EFUNC_CLD_KEEP_D_TRAIN_ROUTE        ((UINT8)0x5d)    /*保持调车进路信号*/
#define EFUNC_CLD_KEEP_LEAD_ROUTE           ((UINT8)0x5e)    /*保持引导进路信号*/
#define EFUNC_CLD_SET_NONROUTE              ((UINT8)0x5f)    /*办理非进路*/      
#define EFUNC_CLD_LOCK_NONROUTE             ((UINT8)0x60)    /*锁闭非进路*/      
#define EFUNC_CLD_OPEN_NONROUTE             ((UINT8)0x61)    /*开放非进路*/      
#define EFUNC_CLD_KEEP_NONROUTE             ((UINT8)0x62)    /*保持非进路*/
#define EFUNC_CLD_CANCEL_NONROUTE           ((UINT8)0x64)    /*取消非进路*/
#define EFUNC_CLD_FAULT_CANCEL_NONROUTE     ((UINT8)0x65)    /*故障取消非进路*/
#define EFUNC_CLD_CANCEL_D_TRAIN_ROUTE      ((UINT8)0x66)    /*取消进路调车*/
#define EFUNC_CLD_CLOSE_GARAGEDOOR          ((UINT8)0x67)    /*关闭车库门*/
#define EFUNC_CLD_CHECK_GARAGEDOOR_CLOSE          ((UINT8)0xc9)    /*车库门关闭条件检查（RC模式下）*/
#define EFUNC_CHECK_OPEN_L_ERR_CLD        ((UINT8)0x69) /*OpenLTrainRouteErrP*/
#define EFUNC_CHECK_OPEN_D_ERR_CLD        ((UINT8)0x6a)
#define EFUNC_KEEP_L_ERR_CLD        ((UINT8)0x6b)
#define EFUNC_KEEP_D_ERR_CLD        ((UINT8)0x6c)
#define EFUNC_KEEP_D_SEC_ERR_CHECK_CLD ((UINT8)0x6d)
#define EFUNC_OPEN_D_SEC_ERR_CHECK_CLD ((UINT8)0x6e)

#define EFUNC_CLD_OpenCommRouteSigProc		((UINT8)0x6f)	/*OpenCommRouteSigProc*/
#define EFUNC_ZX_ProcessAtsOrXianDiToCiData		((UINT8)0x70) /*ProcessAtsOrXianDiToCiData*/

#define EFUNC_FloodGateDeviceToRelayStateProc	((UINT8)0x71) /*FloodGateDeviceToRelayStateProc*/

#define EFUNC_LeadzLockSignalOpenRouteCheck		((UINT8)0x93)	/*LeadzLockSignalOpenRouteCheck*/

#define EFUNC_SetCiCiRelayInterfaceConfirmFlag	((UINT8)0x72) /*设置CI与CI继电接口确认状态*/
#define EFUNC_SET_SEC_RESET_LOGIC_MANAGE ((UINT8)0x73) /*SetSectionResetLogicManage 计轴复位命令逻辑管理*/
#define EFUNC_PHYSEC_RESET_TO_RELAY_STATE_PROC ((UINT8)0x74) /*PhySecResetToRelayStateProc 更新区段计轴复位继电器状态*/
#define EFUNC_SETCIPSCPLCONFIRMFLAG  ((UINT8)0x75)  /*SetCiPscPlConfirmFlag设置PSC旁路*/
#define EFUNC_SETNEARCIPSCPLFLAG  ((UINT8)0x76)  /*SetNearCiPscPlFlag设置邻站PSC旁路*/

#define EFUNC_RouteYuXianOpenManage	((UINT8)0x77) /*EFUNC_RouteYuXianOpenManage正线信号机预先开放*/
#define EFUNC_RouteNearOpenManage	((UINT8)0x78) /*EFUNC_RouteNearOpenManage正线信号机接近开放*/
#define EFUNC_RouteYuXianOpenDeal	((UINT8)0x79) /*EFUNC_RouteYuXianOpenDeal车辆段信号机预先开放*/
#define EFUNC_RouteNearOpenDeal		((UINT8)0x7a) /*EFUNC_RouteNearOpenDeal车辆段信号机接近开放*/
#define EFUNC_RouteLockVainCheak		((UINT8)0x7bU) /*进路锁闭侵线检查，在选排道岔到位之后检查侵线，场段和正线用同一个ID*/
#define EFUNC_LOGIC_RES_APP_CHECK	((UINT8)0x80) /*逻辑区段资源可用性检查*/
#define EFUNC_SET_HALF_ROUTE_LOGIC	((UINT8)0x81) /*EFUNC_SetHalfTrainRouteLogicProcess办理部分路径处理*/
#define EFUNC_LOCK_HALF_ROUTE_LOGIC	((UINT8)0x82) /*EFUNC_LockRouteHalfLogicProcess锁闭部分路径处理*/
#define EFUNC_LOCK_DYNAMIC_ROUTE_LOGIC	((UINT8)0x83) /*EFUNC_LockDynamicRouteProc锁闭动态进路条件判断*/
#define EFUNC_UNLOCK_FAULT_LOGSEC    ((UINT8)0x84)    /* LogSecFaultUnlockLogicProcess */
#define EFUNC_CHECK_HALFROUTE_USEING       ((UINT8)0xc8)    /* HalfRoutePhySecUseLogicProcess 部分路径未征用检查*/
#define EFUNC_OVERLAP_RES_APP_CHECK	((UINT8)0xca) /*保护区段资源可用性检查*/

#define EFUNC_SetAtsLockOverlapHaveRouteId  (UINT8)0x7cU  /*锁闭保护区段带进路ID函数*/
#define EFUNC_SetAtsExpectLockOverlapIdProc  (UINT8)0x7dU  /*锁闭保护区段带不带进路ID*/

/*逻辑进路区故解相关报警函数*/
#define EFUNC_PHYSEC_FAULT_BELONG_ROUTE   ((UINT8)0x90)    /* PhySecFaultUnlockRouteCheck */
#define EFUNC_LOGSEC_FAULT_FIRST_SECLOCK   ((UINT8)0x91)    /* LogicSecFaultUnlockLogicManage */
#define EFUNC_LOGSEC_LAST_SECLOCK     ((UINT8)0x92)    /* CheckLogRouteLogSecLastSecLock */

#define EFUNC_ROUTE_ZHONGTUZHEFAN_UNLOCK     ((UINT8)0x94)    /* CheckRouteZhefanJiesuo */
#define EFUNC_PART_ROUTE_CMD_PROC            ((UINT8)0x95)	  /*RoutePartApplyLogicManage(正线/试车线部分进路命令处理)*/
#define EFUNC_PART_ROUTE_CMD_PROC_CLD        ((UINT8)0x96)	  /*RoutePartApplyLogicManageCLD（场段部分进路命令处理）*/

/*逻辑进路相关报警函数*/
#define EFUNC_LogRouteOpenManage	((UINT8)0xC1)	/*EFUNC_LogRouteOpenManage逻辑进路信号开放处理*/
#define EFUNC_SetLogRouteCheckProcess	((UINT8)0xC2)	/*SetLogRouteCheckProcess办理逻辑进路条件检查*/
#define EFUNC_LockLogRouteCheckProcess	((UINT8)0xC3)	/*LockLogRouteCheckProcess锁闭逻辑进路条件检查*/
#define EFUNC_KeepLogRouteSignalProcess	((UINT8)0xC4)	/*KeepLogRouteSignalProcess保持开放逻辑进路信号条件检查*/
#define EFUNC_OpenLogRouteSignalProcess	((UINT8)0xC5)	/*LogRouteSignalProcess开放逻辑进路信号条件检查*/
#define EFUNC_LOGROUTE_LOGIC_RES_APP_CHECK	((UINT8)0xC6)	/*逻辑进路逻辑区段资源可用性检查*/
#define EFUNC_LogRoureUsingStateCheck	((UINT8)0xC7)	/*LogRoutePhySecUseLogicProcess*/
/*其他函数*/
#define EFUNC_LOGIC_MANAGE_SYETEM           ((UINT8)0xF0)    /* Logicmanage.c中导致宕机异常 */
#define EFUNC_CHECK_ROUTE_SEC_FLOCK         ((UINT8)0xF1)    /* RouteSecFlockVainCheck */
#define EFUNC_CHECK_OLAP_SEC_FLOCK          ((UINT8)0xF2)    /* RouteOverlapSecFlockVainCheck */
#define EFUNC_CHECK_FORCE_SWITCH_MOVE       ((UINT8)0xF3)    /* GetSwitchForceMoveValidState */
#define EFUNC_CHECK_SWITCH_MOVE             ((UINT8)0xF4)    /* GetSwitchMoveValidState */
#define EFUNC_CHECK_SWITCHPOS_MOVEVALID     ((UINT8)0xF5)    /* RouteSwitchPosAndMoveValidCheck */
#define EFUNC_CHECK_NON_SWITCH_MOVE         ((UINT8)0xF6)    /* NonRouteSwitchPosMovValCheck */
#define EFUNC_CHECK_LABOUR_CANCEL_VALID     ((UINT8)0xF7)    /*CancleLinShiXianSuManage*/
#define EFUNC_LEAD_ROUTE_MANAGE_ERROR         ((UINT8)0xF8)    /* SetLeadRouteLogicManage */

#define EFUNC_SET_AIRSHAFT_ERROR           ((UINT8)0xFC)    /* SetCommonRouteLogicManage办理风井进路失败 */

#define EFUNC_LEU_CI_COMM_FAULT	            ((UINT8)0xF9)    /*LEU-CI通信故障*/
#define EFUNC_PLAT_OVER			            ((UINT8)0xFA)    /*宕机*/
#define EFUNC_ROUTE_ZRJ_DEAL                ((UINT8)0xFD)	/*RouteZongRenJieProc总人解进路处理*/	
#define EFUNC_SWITCH_DRIVE_OUTTIME				((UINT8)0xFB)    /*锁闭保护区段时检查道岔驱动超时*/
#define EFUNC_PHYSEC_RESET_PROC		    	((UINT8)0xFE)    /*更新区段计轴复位继电器状态驱动超时计轴总复位继电器混线*/

#define EFUNC_SIGNAL_LEAD_OPEN_LOCK			((UINT8)0xD0)		/*引导总锁下重开引导信号LeadzLockNewOpenManage*/

#define EFUNC_FIRSTLEAVE_LOGSEC_CHECK        ((UINT8)0xD1)		/*离去逻辑区段检查RouteLeaveLogSecCheck*/

#define EFUNC_OVERLAP_ZHAOCHA_CHECK          ((UINT8)0xD3)		/*保护区段照查条件检查*/


/*************************************************分界线******************************************************************************/
/*************************************************分界线******************************************************************************/

/* 故障类型*/
/* 进路故障类型编码 (UINT8)0x01-(UINT8)0x2f */
/* 设备类型 CI_DEVICE_TYPE_ROUTE */                   
#define ETYPE_ROUTE_LEVEL           ((UINT8)0x01)    /*进路监督级别*/
#define ETYPE_ROUTE_TYPE            ((UINT8)0x02)    /*进路类型*/
#define ETYPE_ROUTE_STATE           ((UINT8)0x03)    /*进路状态*/
#define ETYPE_ROUTE_LEAD_PROPERTY   ((UINT8)0x04)    /*进路引导*/
#define ETYPE_ROUTE_CANCEL          ((UINT8)0x05)    /*进路取消*/
#define ETYPE_ROUTE_OVERLAP_UNLOCK  ((UINT8)0x06)    /*Overlap未锁闭*/
#define ETYPE_ROUTE_OVERLAP_OCCUPY  ((UINT8)0x07)    /*Overlap占用*/
#define ETYPE_ROUTE_FLYING_TRAIN    ((UINT8)0x08)    /*进路飞车*/
#define ETYPE_RETURN_ROUTE_STATE    ((UINT8)0x09)    /*折返进路状态*/
#define ETYPE_ROUTE_FIRST_XUANPAI_OVERTIME	((UINT8)0x0a)    /*进路初选排超时*/
#define ETYPE_ROUTE_APPLY_SWITCH_CHECK	((UINT8)0x0b)    /*进路办理道岔状态检查*/
#define ETYPE_ROUTE_XUANPAI_OVERTIME ((UINT8)0x10)    /*进路选排超时*/
#define ETYPE_GROUP_AUTO_ROUTE_STATE ((UINT8)0x16)    /*组合自动进路*/
#define ETYPE_ROUTE_APPLY_SWITCH_MOVE ((UINT8)0xA4)    /*进路道岔单操中*/


#define ETYPE_COMM_WITH_VOBC		((UINT8)0x11)	/*与VOBC通信*/
#define ETYPE_COMM_WITH_ZC		    ((UINT8)0x12)	/*与ZC通信*/
#define ETYPE_COMM_WITH_CI		    ((UINT8)0x13)	/*与CI通信*/

#define ETYPE_COMM_WITH_NEIGHBOUR_CI		    ((UINT8)0x14)	/*与相邻CI通信*/
#define ETYPE_COMM_WITH_PSC                     ((UINT8)0x15) /*CI与PSC通信*/

#define ETYPE_COMM_WITH_TMC		    ((UINT8)0x17)	/*与TMC通信*/

/* 信号机故障类型编码 (UINT8)0x21-(UINT8)0x3f */
/* 设备类型 CI_DEVICE_TYPE_SIGNAL */
#define ETYPE_SIG_START_OPEN_STATE  ((UINT8)0x21)    /*始端信号机开放状态（开放/关闭）*/
#define ETYPE_SIG_FLOCK_STATE       ((UINT8)0x22)    /*信号机封锁状态(未封锁/封锁)*/
#define ETYPE_SIG_ENEMY_STATE       ((UINT8)0x23)    /*敌对信号机开放状态（开放/关闭）*/
#define ETYPE_SIG_NEED_CLOSE_STATE  ((UINT8)0x24)    /*进路需关闭信号机开放状态（开放/关闭）*/
#define ETYPE_SIG_NEED_OPEN_STATE   ((UINT8)0x25)    /*进路需开放信号机开放状态（开放/关闭）*/
#define ETYPE_SIG_ONE_OPEN_STATE    ((UINT8)0x26)    /*进路不同时开放信号机开放状态（开放/关闭）*/
#define ETYPE_SIG_CLOSE_OVER_TIME   ((UINT8)0x27)    /*信号机关闭超时*/
#define ETYPE_SIG_OPEN_OVERTIME     ((UINT8)0x28)    /*开放信号超时*/
#define ETYPE_SIG_RETURN_DS_STATE   ((UINT8)0x29)    /*折返信号机断丝*/
#define ETYPE_SIG_RETURN_OPENED_STATE ((UINT8)0x30)  /*折返信号机是否开放过*/
#define ETYPE_SIG_PRO_SEC_VALID     ((UINT8)0x31)    /*信号机保护区段有效性*/
#define	ETYPE_SIG_LIGHT_EXTINCT		((UINT8)0x32)	/*信号机强制点灯状态*/
#define	ETYPE_SIG_YDROUTE_SEARCH_ERR ((UINT8)0x7f)	/*以本信号机的引导进路查找*/
#define ETYPE_SIG_LEAD_ALL_LOCK	 ((UINT8)0x3F)	  /*引导进路信号开放条件不满足，全站已办理引导总锁*/

/*设置自动属性*/
#define ETYPE_AUTO_ROUTE_FLAG			 ((UINT8)0x33)        /* 设置自动通过进路属性 */
#define ETYPE_AUTO_RETURN_FLAG			 ((UINT8)0x34)        /* 设置自动折返属性 */
#define ETYPE_ALL_AUTO_RETURN_FLAG       ((UINT8)0x35)        /* 设置全自动折返属性 */
#define ETYPE_AUTO_TRAGGER_FLAG          ((UINT8)0x36)        /* 设置自动触发属性 */

#define ETYPE_SIG_ENDSIGNAL_DS			((UINT8)0x37)	/*终端信号机断丝*/

#define	ETYPE_SIG_CROSS		((UINT8)0x38)	/*信号机跨压*/

#define	ETYPE_PHY_MUTY_AXISSEC_JUMPLOCK_APPLY		((UINT8)0x39)	/*同一物理区段多计轴区段申请跳跃锁闭*/

#define ETYPE_JUMP_LOCK_DIAOCE_ROUTE_LOCK			((UINT8)0x3a)	/*跳跃锁闭区段被调车进路锁闭*/

/* 物理区段故障类型编码 (UINT8)0x41-(UINT8)0x5f */
/* 设备类型 CI_DEVICE_TYPE_PHYSEC */
#define ETYPE_PS_MERGY_OCU_STATE    ((UINT8)0x41)    /*物理区段融合后状态(空闲/占用)*/
#define ETYPE_PS_LOCK_STATE         ((UINT8)0x42)    /*物理区段锁闭状态*/
#define ETYPE_PS_INTRU_OCU_STATE    ((UINT8)0x43)    /*侵限区段融合后状态占用或锁闭或封锁*/
#define ETYPE_PS_RUNLOCK_ERROR      ((UINT8)0x44)    /*折返解锁异常*/
#define ETYPE_PS_AUNLOCK_ERROR      ((UINT8)0x45)    /*自动解锁异常*/
#define ETYPE_PS_USE_STATE          ((UINT8)0x46)    /*物理区段征用状态*/
#define ETYPE_PS_FLOCK_STATE        ((UINT8)0x47)    /*物理区段封锁*/
#define ETYPE_PS_UNFLOCK_STATE      ((UINT8)0x50)    /*物理区段未封锁*/
#define ETYPE_PS_ZHAOCHA_CHECK      ((UINT8)0x48)    /*物理区段照查检查*/
#define ETYPE_PS_JUMP_LOCK          ((UINT8)0x49)    /*物理区段跳跃锁闭*/
#define ETYPE_PS_INSTRU		         ((UINT8)0x4a)    /*物理区段侵限*/
#define ETYPE_PS_NO_UT_CT_OCU_STATE ((UINT8)0x4b)    /*物理区段车占用状态(无车/UT/CT)*/
#define ETYPE_PS_STOPSTEADY_STATE    ((UINT8)0x4cU)  /*物理区段停稳状态*/
#define ETYPE_PS_LJJL_NAMAL_BUT_LOGEXCEPT ((UINT8)0x4d)   /*逻辑进路物理区段正常锁闭但逻辑区段逻辑异常锁闭*/
#define ETYPE_PS_LJJL_PHYJL_ALL_NAMAL ((UINT8)0x4E)   /*逻辑进路和物理区段锁闭所属进路同时正常锁闭*/
#define ETYPE_PS_NONROUTE_SET          ((UINT8)0x4F)    /*物理区段所属非进路已办理*/      
/*保护区段类型*/
#define ETYPE_OVERLAP_LABORUNLOCK_FAIL    ((UINT8)0x51U)  /*保护区段人工锁闭条件不满足*/
#define ETYPE_OVERLAP_RES_CHECK_FAIL    ((UINT8)0x52U)  /*保护区段资源检查条件不满足*/

/* 道岔类型编码 (UINT8)0x61-(UINT8)0x7f */
/* 设备类型 CI_DEVICE_TYPE_SWITCH */
#define ETYPE_SWT_YLOCK_STATE       	((UINT8)0x61)    /*道岔引导总锁状态*/
#define ETYPE_SWT_FLOCK_STATE       	((UINT8)0x62)    /*道岔封锁状态*/
#define ETYPE_SWT_LOCK_STATUS         	((UINT8)0x63)    /*道岔锁闭状态*/
#define ETYPE_SWT_POSTION_STATE     	((UINT8)0x64)    /*道岔位置*/
#define ETYPE_SWT_MOVE_INVALID      	((UINT8)0x65)    /*道岔不可动*/
#define ETYPE_SWT_MOVE_OVERTIME     	((UINT8)0x66)    /*道岔动作锁闭超时*/
#define ETYPE_SWT_USE_STATE     		((UINT8)0x6aU)    /*道岔征用*/
#define ETYPE_SWT_MOVE_STATE     		((UINT8)0x6bU)    /*道岔搬动状态*/
#define ETYPE_SWT_MOVE_CHECK_RESULT     ((UINT8)0x6cU)    /*道岔可动性检查结果*/

/* 继电器故障类型编码 (UINT8)0x81-(UINT8)0x8f */
/* 设备类型 CI_DEVICE_TYPE_RELAY */
#define ETYPE_THAT_ZHAOCHA          ((UINT8)0x81)    /*对端照查继电器*/
#define ETYPE_THIS_ZHAOCHA          ((UINT8)0x85)    /*本端照查继电器*/
#define ETYPE_CANCLE_ZHAOCHA        ((UINT8)0x82)    /*取消照查继电器*/
#define ETYPE_ZHAOCHA_ROUTE_OVERTIME        ((UINT8)0x83)    /*进路照查超时*/
#define ETYPE_JKJ_WORK						((UINT8)0x84)    /*应急盘有效*/
#define ETYPE_ZHAOCHA_OVERLAP_OVERTIME      ((UINT8)0x86)    /*保护区段照查超时*/

/* 其他联锁条件检查相关故障类型编码 (UINT8)0x91-(UINT8)0x9f */        
/* 设备类型 
    CI_DEVICE_TYPE_PLATFORM
    CI_DEVICE_TYPE_ESB
    CI_DEVICE_TYPE_PSD
*/
#define ETYPE_ESB_VALID             ((UINT8)0x91)    /*紧急按钮有效*/
#define ETYPE_PSD_CLOSE_NO          ((UINT8)0x92)    /*屏蔽门未关闭*/                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
#define ETYPE_PSD_MUTUALLOCK        ((UINT8)0x93)    /*屏蔽门互锁*/
#define ETYPE_PLAT_DETAIN           ((UINT8)0x94)    /*站台扣车*/
#define ETYPE_WASH_MACHINE_UNVALID	((UINT8)0x95)	/* 洗车机未就绪 */
#define ETYPE_OTHER_GARAGEDOOR_OPEN_NO	((UINT8)0x96)	/* 车库门未打开 */
#define ETYPE_OTHER_SIGNAL_OPEN_CHECK	((UINT8)0x97)	/* 关联信号开放失败 */	
#define ETYPE_OTHER_SIGNAL_CHECK	((UINT8)0x98)	/* 信号机其他联锁条件失败 */	
#define ETYPE_OTHER_SWITCH_POSITION_ERROR	((UINT8)0x99)	/* 道岔不在指定位置 */
#define ETYPE_SPKS_STATE_UP           	((UINT8)0x9A)	/* SPKS按钮按下 */
#define ETYPE_GARAGEDOOR_STATE_MODE_LOCAL          	((UINT8)0x9B)	/* 车库门控制模式为本地 */
#define ETYPE_GARAGEDOOR_FAULT          	((UINT8)0x9C)	/* 车库门故障*/

#define ETYPE_GARDOOR_NOT_RECV_ZC_GMXK      ((UINT8)0x9D)	/* 车库门关闭未收到ZC回复的允许关闭许可*/
#define ETYPE_GARAGEDOOR_PANGLU            ((UINT8)0x80)    /*车库门为旁路状态*/
#define ETYPE_GARAGEDOOR_DRIVE_INVALID     ((UINT8)0x81)    /*车库门当前已在驱动位置，驱动无效*/


#define ETYPE_PHYSEC_OCCUPY                 ((UINT8)0x9E)     /*物理区段占用则不允许开放信号，2018.9.19新机场新需求*/
#define ETYPE_OTHER_WASH_LINE_NOT_ALLOW     ((UINT8)0x9F)     /*洗车线洗车同意继电器XTJ未吸起，经过洗车线的进路不允许开放信号*/
#define ETYPE_OTHER_DOWNWASH_NOT_ALLOW_PASS ((UINT8)0x90)     /*洗车同意通过按钮未按下，经过洗车线的进路不允许开放信号*/
#define ETYPE_OTHER_ROUTE_CHECK ((UINT8)0x70)     /*进路其他联锁需开放进路检查失败*/


/*车库门相关列车故障类型*/
#define  ETYPE_GARDOOR_NOT_RECV_IVOC_GMXK    ((UINT8)0x71)   /* 车库门关闭未收到IVOC回复的允许关闭许可*/
#define  ETYPE_GDOOR_TRAIN_HEADSCREEN   ((UINT8)0x73)        /* 列车前端筛选*/
#define  ETYPE_GDOOR_TRAIN_TAILSCREEN   ((UINT8)0x74)        /* 列车后端筛选*/
#define  ETYPE_GDOOR_TRAIN_KUAYAGD      ((UINT8)0x75)        /* 列车包络跨压车库门*/



/* 计时故障 */
/* 设备类型 EFUNC_LOGIC_MANAGE_TIMEER */
#define ETYPE_TIMEER_COUNT_LEAD						((UINT8)0xA1)		/*引导信号故障倒计时*/
#define ETYPE_TIMEER_COUNT_ZONGRENJIE				((UINT8)0xA2)		/*总人解倒计时*/
#define ETYPE_TIMEER_COUNT_SECFAULT					((UINT8)0xA3)		/*区故解倒计时*/

/*防淹门故障类型编码 (UINT8)0xB0-(UINT8)0xBF*/
#define ETYPE_FLOODGATE_OPENLOCKSTATE	((UINT8)0xB0)/*防淹门开启锁闭状态*/
#define ETYPE_FLOODGATE_CLOSEREQSTATE	((UINT8)0xB1)/*防淹门关门请求状态*/
#define ETYPE_FLOODGATE_AGREECLOSESTATE	((UINT8)0xB2)/*防淹门回采同意关门状态*/
#define ETYPE_FLOODGATE_CLOSESTATE		((UINT8)0xB3)/*防淹门关门状态*/

#define ETYPE_DCTY_NOT_SATIFY		((UINT8)0xB4) /*调车同意不满足*/
#define ETYPE_DCTY_REOPEN_TIMING_BREAK	((UINT8)0xB5) /*因其它开放条件不满足，调车同意重开计时中断*/
#define ETYPE_TRAIN_TEST_OFF		((UINT8)0xB6) /*未进入试车模式，命令无效*/
#define ETYPE_DCTY_REOPEN_TIMEOUT		((UINT8)0xB7) /*进路XX等待调车同意超时*/
#define ETYPE_FLOOD_GATE_YGJ_CROSS_LINE		((UINT8)0xB8) /*防淹门YGJ混线*/

/* 逻辑区段故障类型编码 (UINT8)0xC1-(UINT8)0xCF */
/*设备类型 CI_DEVICE_TYPE_LOGICSEC*/
#define ETYPE_LOGSEC_LINSHIXIANSU_CANCLE_STATE      ((UINT8)0xC1)       /*逻辑区段临时限速人工取消*/
#define ETYPE_PSC_CONFIRM_PL_STATE                  ((UINT8)0xC2)       /*ATS取消PSC旁路确认状态*/
#define ETYPE_LOGSEC_OCC_STATE                      ((UINT8)0xC3)       /*逻辑区段占用状态（道岔搬动使用）*/
#define ETYPE_LOGSEC_LOCK_STATE                     ((UINT8)0xC4)       /*逻辑区段锁闭状态（道岔搬动使用）*/
#define ETYPE_LOGSEC_XIANSU_STATE                   ((UINT8)0xC5)       /*逻辑区段限速设置*/
#define ETYPE_LOGSEC_FIRSTLOCK_STATE                ((UINT8)0xC6)       /*逻辑区段为第一个锁闭区段检查*/
#define ETYPE_LOGSEC_CBTC_PROPERTY                  ((UINT8)0xC7)       /*逻辑区段CBTC属性检查*/

/* 系统故障 */
/* 设备类型 EFUNC_LOGIC_MANAGE_SYETEM */
#define ETYPE_SYSTEM_SIGNAL_OPEN            ((UINT8)0xF1)        /* 未驱动信号机开放 */
#define ETYPE_SYSTEM_EXCEPT                 ((UINT8)0xF2)        /* 联锁系统状态异常 */
#define ETYPE_SYSTEM_STARTLOCKE_ERROR       ((UINT8)0xF3)        /* 上电解锁异常 */
#define ETYPE_SYSTEM_REL_UPDATA_ERROR       ((UINT8)0xF4)        /* 继电器更新失败 */
#define ETYPE_SYSTEM_SIG_UPDATA_ERROR       ((UINT8)0xF5)        /* 信号机更新失败 */
#define ETYPE_SYSTEM_SEC_UPDATA_ERROR       ((UINT8)0xF6)        /* 区段更新失败 */
#define ETYPE_SYSTEM_SWT_UPDATA_ERROR       ((UINT8)0xF7)        /* 道岔更新失败 */

#define ETYPE_LEU_CI_COMM_ALL_STATE_FAULT			((UINT8)0xF8)		/*CI-LEU，某个LEU整机通信故障*/
#define ETYPE_LEU_CI_COMM_CHANNEL_SWITCH_FAULT		((UINT8)0xF9)		/*CI-LEU，某个LEU通道切换故障*/

/*故障发送级别*/
#define ESEND_LEVEL_ZERO       ((UINT8)0x00)        /* 只记录不发送 */
#define ESEND_LEVEL_ATS        ((UINT8)0x01)        /* 只发送现地和ATS */

#define ETYPE_DATA_CFG_ERR     ((UINT8)0xFA)        /*数据配置错误 */

 /*为方便SCADE修改模型，当物理区段封锁类型为命令封锁且SPKS按下时记此类型，在设置errorcode的时候再分别设置两个errorcode */
#define ETYPE_PS_FLOCK_SPKSCMD_STATE     ((UINT8)0xAFU)       



#endif
