using System; using System.Collections.Generic; using System.Linq; using System.Text; using IvyBus; namespace Data { class Program { private const string ivy_domain = "127.255.255.255:2010"; static void Main(string[] args) { IvyControl TheIvyBus = new IvyControl(); // // TheIvyBus // TheIvyBus.AppName = "AppDatabase"; TheIvyBus.Culture = new System.Globalization.CultureInfo("en-US"); TheIvyBus.ivy.Start(ivy_domain); //TheIvyDomain.DomainChanged += new EventHandler(TheIvyDomain_DomainChanged); AppDatabase database = new AppDatabase(TheIvyBus); database.addAircraftView(new ConsoleAircraftView(database)); /** Console.WriteLine("Affichage de la liste des beacons : "); Beacon[] beacons = database.getBeacons(); foreach (Beacon b in beacons) { Console.WriteLine(b.Code + " : " + b.Lat + " " + b.Lon); } Console.WriteLine("\n\nAffichage des secteurs : "); Sector[] sectors = database.getSectors(); foreach (Sector s in sectors) { Console.WriteLine(s.Name); } Console.WriteLine("\n\nAffichage des Routes : "); Route[] routes = database.getRoutes(); foreach (Route r in routes) { Console.WriteLine(r.B1 + " -> " + r.B2); } * */ } } class ConsoleAircraftView : IAircraftView { private int count; private AppDatabase app; public ConsoleAircraftView(AppDatabase app) { count = 0; this.app = app; } public void updateView(Dictionary> listOfAircrafts) { count++; Console.WriteLine("Vue updatee pour la " + count + "ème fois"); if ((count % 100) == 0) { Console.WriteLine("Hour : " + app.getHour() + ":" + app.getMinute() + ":" + app.getSecond()); } } } }