예제 #1
0
        //获取:目标状态与状况
        public static ADS_MessageInfo GetTargetState(byte[] ADSData)
        {
            ADS_MessageInfo info = new ADS_MessageInfo();

            try
            {
                info.SubType = (int)(ADSData[4]);

                if (info.SubType == 0)
                {
                    info.ICAO = (uint)((ADSData[0] & 0xFF) << 16 | (ADSData[1] & 0xFF) << 8 | (ADSData[2] & 0xFF));
                    info.Type = (int)(ADSData[3]);
                    info.AtmosphereDataSource = ADS_DicMessage.GetAtmosphereDataSource((int)(ADSData[5]));
                    info.HeightType           = ADS_DicMessage.GetHeightType((int)(ADSData[6]));
                    info.HeightProperty       = ADS_DicMessage.GetHeightProperty((int)ADSData[8]);
                    info.AtmosphereMode       = ADS_DicMessage.GetAtmosphereLevelMode((int)ADSData[9]);
                    info.TargetHeight         = ADS_DicMessage.GetTargetHeight((UInt16)((ADSData[10] & 0xFF) | (ADSData[11] & 0xFF) << 8));
                    info.LevelDataSource      = ADS_DicMessage.GetLevelDataSource((int)ADSData[12]);
                    info.TargetDirection      = (int)((ADSData[13] & 0xFF) | (ADSData[14] & 0xFF) << 8);
                    info.TargetDirectionFlag  = ADS_DicMessage.GetTargetDirectionFlag((int)ADSData[15]);
                    info.LevelMode            = ADS_DicMessage.GetAtmosphereLevelMode((int)ADSData[16]);
                    info.PropertyCode         = ADS_DicMessage.GetPropertyCode((int)ADSData[21]);
                    info.EmergencyCode        = ADS_DicMessage.GetEmergencyCode((int)ADSData[22]);
                }
            }
            catch (System.Exception ex)
            {
                // ErrorRecord.ProcessError(ex.ToString());
            }
            return(info);
        }
예제 #2
0
        //获取:扩展间歇震荡飞机状况消息
        public static ADS_MessageInfo GetPauseAirCondition(byte[] ADSData)
        {
            ADS_MessageInfo info = new ADS_MessageInfo();

            try
            {
                info.SubType = (int)(ADSData[4]);

                if (info.SubType == 1)
                {
                    info.ICAO          = (uint)((ADSData[0] & 0xFF) << 16 | (ADSData[1] & 0xFF) << 8 | (ADSData[2] & 0xFF));
                    info.Type          = (int)(ADSData[3]);
                    info.EmergencyCode = ADS_DicMessage.GetEmergencyCode((int)(ADSData[5]));
                }
            }
            catch (System.Exception ex)
            {
                // ErrorRecord.ProcessError(ex.ToString());
            }
            return(info);
        }