From 8a1e772f025eaf3bfdf17905d9e33c460993e559 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Mon, 1 Jul 2019 17:56:49 +0300 Subject: Many bug fixes !!! --- .../PPC/Modules/Tango.PPC.Events/ViewModels/MainViewVM.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/ViewModels') diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/ViewModels/MainViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/ViewModels/MainViewVM.cs index 997ea70d5..d2a730cd7 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/ViewModels/MainViewVM.cs @@ -97,7 +97,7 @@ namespace Tango.PPC.Events.ViewModels using (var db = ObservablesContext.CreateDefault()) { var last_week = DateTime.UtcNow.AddDays(-7); - HistoryEvents = (await db.MachinesEvents.Where(x => x.MachineGuid == MachineProvider.Machine.Guid && x.DateTime > last_week).Take(100).Include(x => x.EventType).Where(x => (EventTypeNotificationTimes)x.EventType.EventNotificationTime != EventTypeNotificationTimes.None).ToListAsync()).OrderByDescending(x => x.DateTime).ToObservableCollection(); + HistoryEvents = (await db.MachinesEvents.Where(x => x.MachineGuid == MachineProvider.Machine.Guid && x.DateTime > last_week).Take(100).Include(x => x.EventType).Where(x => (EventTypeNotificationTimes)x.EventType.EventNotificationTime != EventTypeNotificationTimes.None || x.EventType.Code == (int)EventTypes.JOB_FAILED || x.EventType.Code == (int)EventTypes.JOB_STARTED || x.EventType.Code == (int)EventTypes.JOB_COMPLETED || x.EventType.Code == (int)EventTypes.JOB_ABORTED).ToListAsync()).OrderByDescending(x => x.DateTime).ToObservableCollection(); } MachineProvider.MachineOperator.StatusChanged += MachineOperator_StatusChanged; @@ -160,6 +160,10 @@ namespace Tango.PPC.Events.ViewModels _notifications.Add(new KeyValuePair(ev.EventType.Type, notificationItem)); } + else if (ev.IsJobProgressEvent()) + { + HistoryEvents.Insert(0, ev); + } }); } -- cgit v1.3.1