summaryrefslogtreecommitdiff
path: root/Data/Program.cs
diff options
context:
space:
mode:
authorhurter2011-08-31 16:25:05 +0000
committerhurter2011-08-31 16:25:05 +0000
commit42dc1d36235292786322d28340a81c6cb3fd46c0 (patch)
tree6f4ef0d4ad672c54500d9457af90fc599ac9b299 /Data/Program.cs
parent5aa429a3e7e9f610f5b2dd8f8e2a865ecfd25ea3 (diff)
downloadamilis-42dc1d36235292786322d28340a81c6cb3fd46c0.zip
amilis-42dc1d36235292786322d28340a81c6cb3fd46c0.tar.gz
amilis-42dc1d36235292786322d28340a81c6cb3fd46c0.tar.bz2
amilis-42dc1d36235292786322d28340a81c6cb3fd46c0.tar.xz
Diffstat (limited to 'Data/Program.cs')
-rw-r--r--Data/Program.cs73
1 files changed, 73 insertions, 0 deletions
diff --git a/Data/Program.cs b/Data/Program.cs
new file mode 100644
index 0000000..0b7b3cc
--- /dev/null
+++ b/Data/Program.cs
@@ -0,0 +1,73 @@
+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<string, List<AircraftPosition>> listOfAircrafts)
+ {
+ count++;
+ Console.WriteLine("Vue updatee pour la " + count + "ème fois");
+ if ((count % 100) == 0)
+ {
+ Console.WriteLine("Hour : " + app.getHour() + ":" + app.getMinute() + ":" + app.getSecond());
+ }
+ }
+ }
+}