diff options
| author | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-09-06 11:53:43 +0300 |
|---|---|---|
| committer | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-09-06 11:53:43 +0300 |
| commit | d503f7f5ebedf2d1ed1bb87adccceacad1d16280 (patch) | |
| tree | 5247a3aeebdca676f64eaf3bf7707b787fb11421 /Software/Visual_Studio | |
| parent | e59116021192eaaa3d5f497f2b461749844616ef (diff) | |
| download | Tango-d503f7f5ebedf2d1ed1bb87adccceacad1d16280.tar.gz Tango-d503f7f5ebedf2d1ed1bb87adccceacad1d16280.zip | |
Events definitions rev 25.
Added new events group "Jobs".
Insights jobs events.
Diffstat (limited to 'Software/Visual_Studio')
16 files changed, 165 insertions, 18 deletions
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 Binary files differnew file mode 100644 index 000000000..f3d11f875 --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Insights/Images/job_aborted.png 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 Binary files differnew file mode 100644 index 000000000..f3aacd423 --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Insights/Images/job_completed.png 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 Binary files differnew file mode 100644 index 000000000..9e93d0f4e --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Insights/Images/job_failed.png 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 Binary files differnew file mode 100644 index 000000000..542c5b620 --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Insights/Images/job_started.png 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 Binary files differnew file mode 100644 index 000000000..5ee968cf6 --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Insights/Images/yarn.png 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 @@ <ItemGroup> <Resource Include="Images\excel.png" /> </ItemGroup> + <ItemGroup> + <Resource Include="Images\job_started.png" /> + </ItemGroup> + <ItemGroup> + <Resource Include="Images\job_aborted.png" /> + <Resource Include="Images\job_completed.png" /> + <Resource Include="Images\job_failed.png" /> + </ItemGroup> + <ItemGroup> + <Resource Include="Images\yarn.png" /> + </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="..\..\..\packages\MaterialDesignThemes.3.0.1\build\MaterialDesignThemes.targets" Condition="Exists('..\..\..\packages\MaterialDesignThemes.3.0.1\build\MaterialDesignThemes.targets')" /> <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> 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 @@ <converters:EventTypeInAnnotationsConfigurationConverter x:Key="EventTypeInAnnotationsConfigurationConverter" /> + <DataTemplate x:Key="InsightEventJobsTemplate" DataType="{x:Type commonInsights:InsightsReadyEvent}"> + <Border Tag="{Binding DataContext,RelativeSource={RelativeSource AncestorType=views:InsightsView}}" IsHitTestVisible="True"> + <Border.Visibility> + <MultiBinding Converter="{StaticResource EventTypeInAnnotationsConfigurationConverter}"> + <Binding RelativeSource="{RelativeSource AncestorType=views:InsightsView}" Path="DataContext.AnnotationsConfiguration" /> + <Binding Path="EventType" /> + </MultiBinding> + </Border.Visibility> + <Border.ToolTip> + <StackPanel> + <TextBlock TextWrapping="Wrap"> + <Run>Code:</Run> + <Run>#</Run><Run Text="{Binding EventType.Code}"></Run> + <LineBreak/> + <Run>Time:</Run> + <Run Text="{Binding Time,Converter={StaticResource DateTimeUtcToLocalDateTime},StringFormat='MM/dd/yyyy hh:mm:ss'}"></Run> + <LineBreak/> + <Run Text="{Binding EventType.TechnicalDescription}"></Run> + </TextBlock> + <StackPanel Margin="0 5 0 0" Visibility="{Binding HasDescription,Converter={StaticResource BooleanToVisibilityConverter}}"> + <TextBlock Foreground="{StaticResource FSE_ErrorBrush}">Error</TextBlock> + <Rectangle Margin="0 2 0 0" HorizontalAlignment="Stretch" VerticalAlignment="Top" StrokeThickness="1" Stroke="{StaticResource FSE_PrimaryForegroundBrush}" StrokeDashArray="5" /> + <TextBlock Text="{Binding Description}" TextWrapping="Wrap" MaxWidth="400" Margin="0 5 0 0"></TextBlock> + </StackPanel> + </StackPanel> + </Border.ToolTip> + <Border.Style> + <Style TargetType="Border"> + <Setter Property="ContextMenu"> + <Setter.Value> + <ContextMenu> + <MenuItem ToolTip="Locate related application logs using the Application module" Header="Peek Application Logs" Command="{Binding PlacementTarget.Tag.PeekApplicationLogsCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=ContextMenu}}" CommandParameter="{Binding}"> + <MenuItem.Icon> + <material:PackIcon Kind="Application" /> + </MenuItem.Icon> + </MenuItem> + <MenuItem ToolTip="Locate related firmware logs using the Firmware module" Header="Peek Firmware Logs" Command="{Binding PlacementTarget.Tag.PeekFirmwareLogsCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=ContextMenu}}" CommandParameter="{Binding}"> + <MenuItem.Icon> + <material:PackIcon Kind="Chip" /> + </MenuItem.Icon> + </MenuItem> + </ContextMenu> + </Setter.Value> + </Setter> + <Style.Triggers> + <EventTrigger RoutedEvent="PreviewMouseRightButtonUp"> + <EventTrigger.Actions> + <BeginStoryboard> + <Storyboard> + <BooleanAnimationUsingKeyFrames Storyboard.TargetProperty="ContextMenu.IsOpen"> + <DiscreteBooleanKeyFrame KeyTime="0:0:0" Value="True"/> + </BooleanAnimationUsingKeyFrames> + </Storyboard> + </BeginStoryboard> + </EventTrigger.Actions> + </EventTrigger> + </Style.Triggers> + </Style> + </Border.Style> + <DockPanel> + <Image Panel.ZIndex="100" Height="32" Width="32" RenderOptions.BitmapScalingMode="Fant" VerticalAlignment="Center"> + <Image.Style> + <Style TargetType="Image"> + <Setter Property="Source" Value="../Images/job_started.png"></Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding EventType.Type}" Value="JOB_STARTED"> + <Setter Property="Source" Value="../Images/job_started.png"></Setter> + </DataTrigger> + <DataTrigger Binding="{Binding EventType.Type}" Value="JOB_COMPLETED"> + <Setter Property="Source" Value="../Images/job_completed.png"></Setter> + </DataTrigger> + <DataTrigger Binding="{Binding EventType.Type}" Value="JOB_FAILED"> + <Setter Property="Source" Value="../Images/job_failed.png"></Setter> + </DataTrigger> + <DataTrigger Binding="{Binding EventType.Type}" Value="JOB_ABORTED"> + <Setter Property="Source" Value="../Images/job_aborted.png"></Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </Image.Style> + </Image> + <Border Margin="-30 0 0 0" BorderThickness="1" CornerRadius="3" Padding="30 5 10 5" VerticalAlignment="Center"> + <Border.Style> + <Style TargetType="Border"> + <Setter Property="Background" Value="{StaticResource FSE_PrimaryBackgroundDarkBrush}"></Setter> + <Setter Property="BorderBrush" Value="{StaticResource FSE_GrayBrush}"></Setter> + <Style.Triggers> + <Trigger Property="IsMouseOver" Value="True"> + <Setter Property="Background" Value="{StaticResource FSE_PrimaryBackgroundLightBrush}"></Setter> + </Trigger> + </Style.Triggers> + </Style> + </Border.Style> + <TextBlock VerticalAlignment="Center" Margin="5 0 0 0" Text="{Binding JobDescription}" Foreground="{StaticResource FSE_PrimaryForegroundBrush}"></TextBlock> + </Border> + </DockPanel> + </Border> + </DataTemplate> + + <DataTemplate x:Key="InsightEventTemplate" DataType="{x:Type commonInsights:InsightsReadyEvent}"> - <Border Tag="{Binding DataContext,RelativeSource={RelativeSource AncestorType=views:InsightsView}}" Padding="10 5" IsHitTestVisible="True" BorderThickness="1" CornerRadius="3" BorderBrush="{StaticResource FSE_PrimaryBackgroundLightBrush}"> + <Border Tag="{Binding DataContext,RelativeSource={RelativeSource AncestorType=views:InsightsView}}" IsHitTestVisible="True" BorderThickness="1" CornerRadius="3" Padding="10 5" > <Border.Visibility> <MultiBinding Converter="{StaticResource EventTypeInAnnotationsConfigurationConverter}"> <Binding RelativeSource="{RelativeSource AncestorType=views:InsightsView}" Path="DataContext.AnnotationsConfiguration" /> @@ -42,6 +142,7 @@ <Border.Style> <Style TargetType="Border"> <Setter Property="Background" Value="{StaticResource FSE_PrimaryBackgroundDarkBrush}"></Setter> + <Setter Property="BorderBrush" Value="{StaticResource FSE_PrimaryBackgroundLightBrush}"></Setter> <Setter Property="ContextMenu"> <Setter.Value> <ContextMenu> @@ -102,7 +203,7 @@ </Style> </material:PackIcon.Style> </material:PackIcon> - <TextBlock VerticalAlignment="Center" Margin="5 0 0 0" Text="{Binding EventType.Name}" Foreground="{StaticResource FSE_PrimaryForegroundBrush}"></TextBlock> + <TextBlock VerticalAlignment="Center" Margin="5 0 0 0" Text="{Binding EventType.Name}" Foreground="{StaticResource FSE_GrayBrush}"></TextBlock> </DockPanel> </Border> </DataTemplate> @@ -241,7 +342,6 @@ </Border.Style> <StackPanel> <Image Source="../Images/bug_report.png" Stretch="Uniform" HorizontalAlignment="Center" RenderOptions.BitmapScalingMode="Fant" Width="48" /> - <TextBlock Foreground="{StaticResource FSE_ErrorBrush}" FontWeight="SemiBold">Bug Report</TextBlock> </StackPanel> </Border> </DataTemplate> 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<InsightsChart> _lastSelectedForDetection; private List<TechMonitors> _defaultChartForAnomalies = new List<TechMonitors>() { - //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<InsightReadyBase>() .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<EventTypeGroups>(new ObservableCollection<EventTypeGroups>() { + 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 @@ </Grid> <!--Charts Labels--> - <ItemsControl ItemsSource="{Binding VisibleCharts}" Margin="0 0 0 0"> + <ItemsControl ItemsSource="{Binding VisibleCharts}" Margin="0 0 0 0" Visibility="{Binding InsightsPackageAvailable,Converter={StaticResource BooleanToVisibilityConverter}}"> <ItemsControl.ItemsPanel> <ItemsPanelTemplate> <UniformGrid IsItemsHost="True" Columns="1" /> 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 Binary files differnew file mode 100644 index 000000000..23fd49f27 --- /dev/null +++ b/Software/Visual_Studio/Resources/Tango alarm events handling chart_Rev25.xlsx 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 @@ <Link>Tango alarm events handling chart_Rev24.xlsx</Link> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </None> + <None Include="..\..\Resources\Tango alarm events handling chart_Rev25.xlsx"> + <Link>Tango alarm events handling chart_Rev25.xlsx</Link> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </None> <None Include="App.config" /> <None Include="packages.config" /> <None Include="Events.xlsx"> |
