using System; using System.Collections.Generic; using System.Linq; using System.Text; using IvyBus; namespace Data { public class Horloge { private IvyBus.IvyControl TheIvyBus; private int hour, minute, second; public Horloge(IvyBus.IvyControl TheIvyBus) { this.TheIvyBus = TheIvyBus; hour = 0; minute = 0; second = 0; TheIvyBus.ivy.BindMsg(@"^ClockEvent Time=([0-9]+):([0-9]+):([0-9]+) Rate=.* Bs=.*", UpdateClock, null); } public int getHour() { return this.hour; } public int getMinute() { return this.minute; } public int getSecond() { return this.second; } private void UpdateClock(object sender, IvyMessageEventArgs e) { int new_hour = Int32.Parse(e[0]); int new_minute = Int32.Parse(e[1]); int new_second = Int32.Parse(e[2]); hour = new_hour; minute = new_minute; second = new_second; } } }