示例#1
0
 public void OnFDRUpdate(FDP2.FDR updated)
 {
     if (FDP2.GetFDRIndex(updated.Callsign) == -1)//removed
     {
         updated.PropertyChanged -= FDR_PropertyChanged;
         vStripsConnector.RemoveFDR(updated);
     }
     else
     {
         updated.PropertyChanged -= FDR_PropertyChanged;
         updated.PropertyChanged += FDR_PropertyChanged;
     }
 }
示例#2
0
 /// This is called each time a flight data record is updated
 /// Here we are updating the eastbound callsigns dictionary with each flight data record
 public void OnFDRUpdate(FDP2.FDR updated)
 {
     if (FDP2.GetFDRIndex(updated.Callsign) == -1) //FDR was removed (that's what triggered the update)
     {
         eastboundCallsigns.TryRemove(updated.Callsign, out _);
     }
     else
     {
         if (updated.ParsedRoute.Count > 1)
         {
             //calculate track from first route point to last (Departure point to destination point)
             var    rte  = updated.ParsedRoute;
             double trk  = Conversions.CalculateTrack(rte.First().Intersection.LatLong, rte.Last().Intersection.LatLong);
             bool   east = trk >= 0 && trk < 180;
             eastboundCallsigns.AddOrUpdate(updated.Callsign, east, (c, e) => east);
         }
     }
 }
示例#3
0
        public void OnRadarTrackUpdate(RDP.RadarTrack updated)
        {
            // Prevents some errors while the coupling ocours.
            if (updated.CoupledFDR == null)
            {
                return;
            }

            // Validate if the callsign still exist. Otherwise remove from the Dict.
            if (FDP2.GetFDRIndex(updated.CoupledFDR.Callsign) == -1)
            {
                ssrCodeValues.TryRemove(updated.CoupledFDR.Callsign, out _);
            }
            else
            {
                bool codeValidity = this.isSSRCodeValid(updated.CoupledFDR, updated.ActualAircraft);
                ssrCodeValues.AddOrUpdate(updated.CoupledFDR.Callsign, codeValidity, (k, v) => codeValidity);
            }
        }
        public void OnFDRUpdate(FDP2.FDR updated)
        {
            if (FDP2.GetFDRIndex(updated.Callsign) == -1)
            {
                pbnValues.TryRemove(updated.Callsign, out _);
            }
            else
            {
                Match pbn   = Regex.Match(updated.Remarks, @"PBN\/\w+\s");
                bool  rnp10 = Regex.IsMatch(pbn.Value, @"A\d");
                bool  rnp5  = Regex.IsMatch(pbn.Value, @"B\d");
                bool  rnp4  = Regex.IsMatch(pbn.Value, @"L\d");
                bool  rnp2  = updated.Remarks.Contains("NAV/RNP2") || updated.Remarks.Contains("NAV/GLS RNP2");

                // TODO: Find a better way
                char cap = 'P';
                if (rnp2 && (rnp10 || rnp4))
                {
                    cap = '\0';
                }
                else if (rnp2)
                {
                    cap = '\0';
                }
                else if (rnp4)
                {
                    cap = '\0';
                }
                else if (rnp5)
                {
                    cap = '\0';
                }
                else if (rnp10)
                {
                    cap = '\0';
                }

                pbnValues.AddOrUpdate(updated.Callsign, cap, (k, v) => cap);
            }
        }