private void ApplyAdsbSurfacePosition(DateTime messageReceivedUtc, AdsbMessage adsbMessage, TrackedAircraft trackedAircraft, BaseStationMessage baseStationMessage) { baseStationMessage.OnGround = true; baseStationMessage.GroundSpeed = (float?)adsbMessage.SurfacePosition.GroundSpeed; baseStationMessage.Track = (float?)adsbMessage.SurfacePosition.GroundTrack; if(adsbMessage.SurfacePosition.IsReversing) { if(baseStationMessage.Supplementary == null) baseStationMessage.Supplementary = new BaseStationSupplementaryMessage(); baseStationMessage.Supplementary.SpeedType = SpeedType.GroundSpeedReversing; } if(adsbMessage.SurfacePosition.CompactPosition != null) { trackedAircraft.RecordMessage(messageReceivedUtc, adsbMessage.SurfacePosition.CompactPosition); DecodePosition(baseStationMessage, trackedAircraft, adsbMessage.SurfacePosition.GroundSpeed); } }
private void ApplyAdsbAirbornePosition(DateTime messageReceivedUtc, AdsbMessage adsbMessage, TrackedAircraft trackedAircraft, BaseStationMessage baseStationMessage) { if(adsbMessage.AirbornePosition.BarometricAltitude != null) baseStationMessage.Altitude = adsbMessage.AirbornePosition.BarometricAltitude; else if(adsbMessage.AirbornePosition.GeometricAltitude != null) { baseStationMessage.Altitude = adsbMessage.AirbornePosition.GeometricAltitude; if(baseStationMessage.Supplementary == null) baseStationMessage.Supplementary = new BaseStationSupplementaryMessage(); baseStationMessage.Supplementary.AltitudeIsGeometric = true; } if(adsbMessage.AirbornePosition.CompactPosition != null) { trackedAircraft.RecordMessage(messageReceivedUtc, adsbMessage.AirbornePosition.CompactPosition); DecodePosition(baseStationMessage, trackedAircraft, null); } baseStationMessage.SquawkHasChanged = adsbMessage.AirbornePosition.SurveillanceStatus == SurveillanceStatus.TemporaryAlert; baseStationMessage.IdentActive = adsbMessage.AirbornePosition.SurveillanceStatus == SurveillanceStatus.SpecialPositionIdentification; }