Esempio n. 1
0
        public void Listen()
        {
            // Uncomment for debugging UI
            //Events = GetEventMocks();

            // Comment out the following two lines for testing event mocks instead of real data from server, only for UI debugging
            var consumer = Task.Run(() =>
            {
                foreach (var sensorStatus in _sensorStatusQ.GetConsumingEnumerable())
                {
                    CreateEvent(sensorStatus);
                    EventsCollectionChanged?.Invoke(this, new EventsChangedEventArgs(_events));
                }
            });

            _sensorServer.StartServer(Rate.Challenging);
            _sensorServer.OnSensorStatusEvent += SensorServer_OnSensorStatusEvent;
            StartEventsTimer();
        }
Esempio n. 2
0
 public void RemoveEvent(Event @event)
 {
     _events.Remove(@event);
     EventsCollectionChanged?.Invoke(this, new EventsChangedEventArgs(_events));
 }
Esempio n. 3
0
 public void Reset()
 {
     _events.Clear();
     EventsCollectionChanged?.Invoke(this, new EventsChangedEventArgs(_events));
 }