예제 #1
0
파일: Plugin.cs 프로젝트: vishalishere/vrs
        /// <summary>
        /// Refreshes the Mode-S countries on tracked aircraft that don't have them.
        /// </summary>
        private void RefreshMissingModeSCountries()
        {
            lock (_SyncLock) {
                if (_Session != null)
                {
                    var standingDataManager = Factory.Singleton.Resolve <IStandingDataManager>().Singleton;

                    foreach (var flightRecord in _FlightMap.Values)
                    {
                        var codeBlock = standingDataManager.FindCodeBlock(flightRecord.Aircraft.ModeS);
                        if (codeBlock != null && codeBlock.Country != flightRecord.Aircraft.ModeSCountry)
                        {
                            flightRecord.Aircraft.ModeSCountry = codeBlock.Country;
                            _Database.UpdateAircraftModeSCountry(flightRecord.Aircraft.AircraftID, flightRecord.Aircraft.ModeSCountry);
                        }
                    }
                }
            }
        }