From d503f7f5ebedf2d1ed1bb87adccceacad1d16280 Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Sun, 6 Sep 2020 11:53:43 +0300 Subject: Events definitions rev 25. Added new events group "Jobs". Insights jobs events. --- .../Config/AnnotationsConfiguration.cs | 2 +- .../Tango.FSE.Insights/Images/job_aborted.png | Bin 0 -> 4553 bytes .../Tango.FSE.Insights/Images/job_completed.png | Bin 0 -> 3553 bytes .../Tango.FSE.Insights/Images/job_failed.png | Bin 0 -> 3543 bytes .../Tango.FSE.Insights/Images/job_started.png | Bin 0 -> 4279 bytes .../FSE/Modules/Tango.FSE.Insights/Images/yarn.png | Bin 0 -> 3878 bytes .../Tango.FSE.Insights/Tango.FSE.Insights.csproj | 11 +++ .../Modules/Tango.FSE.Insights/Themes/Generic.xaml | 106 ++++++++++++++++++++- .../ViewModels/InsightsViewVM.cs | 49 ++++++++-- .../Tango.FSE.Insights/Views/InsightsView.xaml | 2 +- .../Insights/InsightsReadyEvent.cs | 1 + .../EventLogging/DefaultEventLogger.cs | 2 +- .../Tango alarm events handling chart_Rev25.xlsx | Bin 0 -> 65793 bytes .../Tango.BL/Enumerations/EventTypeGroups.cs | 4 +- .../Tango.EventsTypesGenerator/Program.cs | 2 +- .../Tango.EventsTypesGenerator.csproj | 4 + 16 files changed, 165 insertions(+), 18 deletions(-) create mode 100644 Software/Visual_Studio/FSE/Modules/Tango.FSE.Insights/Images/job_aborted.png create mode 100644 Software/Visual_Studio/FSE/Modules/Tango.FSE.Insights/Images/job_completed.png create mode 100644 Software/Visual_Studio/FSE/Modules/Tango.FSE.Insights/Images/job_failed.png create mode 100644 Software/Visual_Studio/FSE/Modules/Tango.FSE.Insights/Images/job_started.png create mode 100644 Software/Visual_Studio/FSE/Modules/Tango.FSE.Insights/Images/yarn.png create mode 100644 Software/Visual_Studio/Resources/Tango alarm events handling chart_Rev25.xlsx (limited to 'Software/Visual_Studio') diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Insights/Config/AnnotationsConfiguration.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Insights/Config/AnnotationsConfiguration.cs index 5d38f8a3b..8c18bc371 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Insights/Config/AnnotationsConfiguration.cs +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Insights/Config/AnnotationsConfiguration.cs @@ -76,9 +76,9 @@ namespace Tango.FSE.Insights.Config config.EventsCategories.Add(EventTypeCategories.Critical); config.EventsCategories.Add(EventTypeCategories.Error); - config.EventsCategories.Add(EventTypeCategories.Warning); config.EventsCategories.Add(EventTypeCategories.Info); + config.EventsGroups.Add(EventTypeGroups.Jobs); config.EventsGroups.Add(EventTypeGroups.Application); config.EventsGroups.Add(EventTypeGroups.Dispensers); config.EventsGroups.Add(EventTypeGroups.Dryer); diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Insights/Images/job_aborted.png b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Insights/Images/job_aborted.png new file mode 100644 index 000000000..f3d11f875 Binary files /dev/null and b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Insights/Images/job_aborted.png differ diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Insights/Images/job_completed.png b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Insights/Images/job_completed.png new file mode 100644 index 000000000..f3aacd423 Binary files /dev/null and b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Insights/Images/job_completed.png differ diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Insights/Images/job_failed.png b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Insights/Images/job_failed.png new file mode 100644 index 000000000..9e93d0f4e Binary files /dev/null and b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Insights/Images/job_failed.png differ diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Insights/Images/job_started.png b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Insights/Images/job_started.png new file mode 100644 index 000000000..542c5b620 Binary files /dev/null and b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Insights/Images/job_started.png differ diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Insights/Images/yarn.png b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Insights/Images/yarn.png new file mode 100644 index 000000000..5ee968cf6 Binary files /dev/null and b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Insights/Images/yarn.png differ diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Insights/Tango.FSE.Insights.csproj b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Insights/Tango.FSE.Insights.csproj index 1599d484a..5c31b8c29 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Insights/Tango.FSE.Insights.csproj +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Insights/Tango.FSE.Insights.csproj @@ -339,6 +339,17 @@ + + + + + + + + + + + diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Insights/Themes/Generic.xaml b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Insights/Themes/Generic.xaml index bee8bdd53..8b0d3fa48 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Insights/Themes/Generic.xaml +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Insights/Themes/Generic.xaml @@ -13,8 +13,108 @@ + + + + + + + + + + + + Code: + # + + Time: + + + + + + Error + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -42,6 +142,7 @@ - + @@ -241,7 +342,6 @@ - Bug Report diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Insights/ViewModels/InsightsViewVM.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Insights/ViewModels/InsightsViewVM.cs index cb41974e1..efc4c349f 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Insights/ViewModels/InsightsViewVM.cs +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Insights/ViewModels/InsightsViewVM.cs @@ -45,12 +45,12 @@ namespace Tango.FSE.Insights.ViewModels private List _lastSelectedForDetection; private List _defaultChartForAnomalies = new List() { - //TechMonitors.IncomingVoltage, - //TechMonitors.ChillerTemperature, - //TechMonitors.OverallTemperature, - //TechMonitors.GasSensor, - //TechMonitors.BlowerVoltage, - //TechMonitors.HeadZone1Temperature + //TechMonitors.IncomingVoltage, + //TechMonitors.ChillerTemperature, + //TechMonitors.OverallTemperature, + //TechMonitors.GasSensor, + //TechMonitors.BlowerVoltage, + //TechMonitors.HeadZone1Temperature }; #region Properties @@ -299,9 +299,8 @@ namespace Tango.FSE.Insights.ViewModels LogManager.Log($"Error loading insights chart '{chart.Name}'. Could not find property on InsightsMonitors.", LogCategory.Error); } - InitMonitorsView(); - Charts.Where(x => ModuleSettings.VisibleMonitors.Contains(x.TechMonitor)).ToList().ForEach(x => x.IsVisible = true); + InitMonitorsView(); _chartsLoaded = true; } @@ -514,6 +513,8 @@ namespace Tango.FSE.Insights.ViewModels var y = 0.05; + int jobCounter = 0; + foreach (var insight in package.Events.Cast() .Concat(package.Statuses) .Concat(package.Bugs) @@ -529,7 +530,33 @@ namespace Tango.FSE.Insights.ViewModels if (insight is InsightsReadyEvent ev) { annotation.Content = ev; - annotation.ContentTemplate = Application.Current.Resources["InsightEventTemplate"] as DataTemplate; + + if (ev.EventType.Group == EventTypeGroups.Jobs) + { + Panel.SetZIndex(annotation, 5); + + switch (ev.EventType.Type) + { + case EventTypes.JOB_STARTED: + ev.JobDescription = $"Job #{++jobCounter} Started"; + break; + case EventTypes.JOB_COMPLETED: + ev.JobDescription = $"Job #{jobCounter} Completed"; + break; + case EventTypes.JOB_FAILED: + ev.JobDescription = $"Job #{jobCounter} Failed"; + break; + case EventTypes.JOB_ABORTED: + ev.JobDescription = $"Job #{jobCounter} Aborted"; + break; + } + + annotation.ContentTemplate = Application.Current.Resources["InsightEventJobsTemplate"] as DataTemplate; + } + else + { + annotation.ContentTemplate = Application.Current.Resources["InsightEventTemplate"] as DataTemplate; + } } else if (insight is InsightsReadyStatus status) { @@ -897,13 +924,14 @@ namespace Tango.FSE.Insights.ViewModels { if (!IsSettingsBarOpened) { - Charts = Charts.OrderByAlphaNumeric(x => x.Description).OrderByDescending(x => x.IsVisible).ToObservableCollection(); InitMonitorsView(); } } private void InitMonitorsView() { + Charts = Charts.OrderByAlphaNumeric(x => x.Description).OrderByDescending(x => x.IsVisible).ToObservableCollection(); + _monitorsView = CollectionViewSource.GetDefaultView(Charts); _monitorsView.Filter = (x) => { @@ -986,6 +1014,7 @@ namespace Tango.FSE.Insights.ViewModels SelectedEventsGroups = new SelectedObjectCollection(new ObservableCollection() { + EventTypeGroups.Jobs, EventTypeGroups.Application, EventTypeGroups.Dispensers, EventTypeGroups.Dryer, diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Insights/Views/InsightsView.xaml b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Insights/Views/InsightsView.xaml index c020282a6..ed51c85ec 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Insights/Views/InsightsView.xaml +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Insights/Views/InsightsView.xaml @@ -180,7 +180,7 @@ - + diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/Insights/InsightsReadyEvent.cs b/Software/Visual_Studio/FSE/Tango.FSE.Common/Insights/InsightsReadyEvent.cs index 8c71c2dbf..30241f270 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.Common/Insights/InsightsReadyEvent.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/Insights/InsightsReadyEvent.cs @@ -11,6 +11,7 @@ namespace Tango.FSE.Common.Insights { public EventType EventType { get; set; } public String Description { get; set; } + public String JobDescription { get; set; } public bool HasDescription { diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/EventLogging/DefaultEventLogger.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/EventLogging/DefaultEventLogger.cs index f002a5ab9..970532d43 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/EventLogging/DefaultEventLogger.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/EventLogging/DefaultEventLogger.cs @@ -286,7 +286,7 @@ namespace Tango.PPC.Common.EventLogging if (!_currentEvents.Exists(x => x.Type == machineEvent.Type)) { - if (machineEvent.Group != EventTypeGroups.Application && machineEvent.Group != EventTypeGroups.Transport) + if (machineEvent.Group != EventTypeGroups.Application && machineEvent.Group != EventTypeGroups.Transport && machineEvent.Group != EventTypeGroups.Jobs) { _currentEvents.Add(machineEvent); } diff --git a/Software/Visual_Studio/Resources/Tango alarm events handling chart_Rev25.xlsx b/Software/Visual_Studio/Resources/Tango alarm events handling chart_Rev25.xlsx new file mode 100644 index 000000000..23fd49f27 Binary files /dev/null and b/Software/Visual_Studio/Resources/Tango alarm events handling chart_Rev25.xlsx differ diff --git a/Software/Visual_Studio/Tango.BL/Enumerations/EventTypeGroups.cs b/Software/Visual_Studio/Tango.BL/Enumerations/EventTypeGroups.cs index e6fc435d1..5ff1766d9 100644 --- a/Software/Visual_Studio/Tango.BL/Enumerations/EventTypeGroups.cs +++ b/Software/Visual_Studio/Tango.BL/Enumerations/EventTypeGroups.cs @@ -41,6 +41,8 @@ namespace Tango.BL.Enumerations [Description("Application")] Application = 10, [Description("Transport")] - Transport = 11 + Transport = 11, + [Description("Jobs")] + Jobs = 12 } } diff --git a/Software/Visual_Studio/Utilities/Tango.EventsTypesGenerator/Program.cs b/Software/Visual_Studio/Utilities/Tango.EventsTypesGenerator/Program.cs index 07f94d9b7..ef2e67909 100644 --- a/Software/Visual_Studio/Utilities/Tango.EventsTypesGenerator/Program.cs +++ b/Software/Visual_Studio/Utilities/Tango.EventsTypesGenerator/Program.cs @@ -16,7 +16,7 @@ namespace Tango.EventsTypesGenerator { class Program { - private static string EVENTS_FILE = "Tango alarm events handling chart_Rev24.xlsx"; + private static string EVENTS_FILE = "Tango alarm events handling chart_Rev25.xlsx"; private class ExcelEventType { diff --git a/Software/Visual_Studio/Utilities/Tango.EventsTypesGenerator/Tango.EventsTypesGenerator.csproj b/Software/Visual_Studio/Utilities/Tango.EventsTypesGenerator/Tango.EventsTypesGenerator.csproj index d5949ec18..9bb8729dc 100644 --- a/Software/Visual_Studio/Utilities/Tango.EventsTypesGenerator/Tango.EventsTypesGenerator.csproj +++ b/Software/Visual_Studio/Utilities/Tango.EventsTypesGenerator/Tango.EventsTypesGenerator.csproj @@ -84,6 +84,10 @@ Tango alarm events handling chart_Rev24.xlsx PreserveNewest + + Tango alarm events handling chart_Rev25.xlsx + PreserveNewest + -- cgit v1.3.1