private void OnFixtureUpdate(IFixtureOverviewDelta fixture) { if (fixture == null) { return; } FixtureDetails details = new FixtureDetails { Id = fixture.Id }; // ListenerOverview is not suitable to use here.... // we have to get the FixtureOverview to have all data var overview = Supervisor.GetFixtureOverview(fixture.Id); FillFixtureOverview(details, overview); if (fixture.ListenerOverview != null) { details.IsDeleted = fixture.ListenerOverview.IsDeleted.GetValueOrDefault(); details.IsOver = fixture.ListenerOverview.IsOver.GetValueOrDefault(); } if (fixture.FeedUpdate != null) { FixtureProcessingEntry entry = new FixtureProcessingEntry(); FillProcessingEntry(entry, fixture.FeedUpdate); details.AddProcessingEntry(entry); } Supervisor.Service.StreamingService.OnFixtureUpdate(details); if (fixture.LastError != null && fixture.LastError.IsErrored) { ProcessingEntryError error = new ProcessingEntryError { FixtureId = fixture.Id, FixtureDescription = overview.Name, Sequence = fixture.LastError.Sequence }; FillProcessingEntryError(error, fixture.LastError); Supervisor.Service.StreamingService.OnError(error); } }
private void OnFixtureUpdate(IFixtureOverviewDelta fixture) { if (fixture == null) return; FixtureDetails details = new FixtureDetails {Id = fixture.Id}; // ListenerOverview is not suitable to use here.... // we have to get the FixtureOverview to have all data var overview = Supervisor.GetFixtureOverview(fixture.Id); FillFixtureOverview(details, overview); if (fixture.ListenerOverview != null) { details.IsDeleted = fixture.ListenerOverview.IsDeleted.GetValueOrDefault(); details.IsOver = fixture.ListenerOverview.IsOver.GetValueOrDefault(); } if(fixture.FeedUpdate != null) { FixtureProcessingEntry entry = new FixtureProcessingEntry(); FillProcessingEntry(entry, fixture.FeedUpdate); details.AddProcessingEntry(entry); } Supervisor.Service.StreamingService.OnFixtureUpdate(details); if(fixture.LastError != null && fixture.LastError.IsErrored) { ProcessingEntryError error = new ProcessingEntryError { FixtureId = fixture.Id, FixtureDescription = overview.Name, Sequence = fixture.LastError.Sequence }; FillProcessingEntryError(error, fixture.LastError); Supervisor.Service.StreamingService.OnError(error); } }