Пример #1
0
        private void ReceiverOnTransponderDataReady(object sender, RawTransponderDataEventArgs e)
        {
            airplaneList.Clear();
            foreach (var data in e.TransponderData)
            {
                string[] plane  = data.Split(';');
                string   tag    = plane[0];
                int      xCord  = Int32.Parse(plane[1]);
                int      yCord  = Int32.Parse(plane[2]);
                int      alti   = Int32.Parse(plane[3]);
                string   format = "yyyyMMddHHmmssfff";
                DateTime time   = DateTime.ParseExact(plane[4], format, CultureInfo.InvariantCulture);

                //Create new plane from decoder.
                Airplane airplane = new Airplane(tag, xCord, yCord, alti, time);

                //Add current Airplane to list of Airplanes.
                airplaneList.Add(airplane);

                printer.PrintAirplaneWithSpeedAndDirection(airplane, calc, space);
            }
            calc.NewPositions(airplaneList);
            seperation.updateCondition(airplaneList);
        }