aboutsummaryrefslogtreecommitdiffstats
path: root/Software
diff options
context:
space:
mode:
authorRoy Ben Shabat <Roy.mail.net@gmail.com>2025-06-19 01:54:33 +0300
committerRoy Ben Shabat <Roy.mail.net@gmail.com>2025-06-19 01:54:33 +0300
commitd100f0eab0fa25c861cbae2ced60afc5dfa8da6b (patch)
treec9f5f37b59528def11fab39476ce451627a8e869 /Software
parent238beb908fc205fd30b97894095b8f1c1a4fb50b (diff)
downloadTango-d100f0eab0fa25c861cbae2ced60afc5dfa8da6b.tar.gz
Tango-d100f0eab0fa25c861cbae2ced60afc5dfa8da6b.zip
Job Failed Event Impl.
Diffstat (limited to 'Software')
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/Converters/MachineEventToMachineTypeConverter.cs43
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/Converters/MachineEventToViewConverter.cs2
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/EventsViews/GeneralView.xaml23
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/EventsViews/JobEventView.xaml33
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/EventsViews/JobFailedEventView.xaml61
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/EventsViews/JobFailedEventView.xaml.cs28
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/EventsViews/ThreadBreakView.xaml25
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/Images/machine_small_X4.pngbin0 -> 21958 bytes
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/Tango.PPC.Events.csproj11
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/EventLogging/DefaultEventLogger.cs14
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/EventLogging/IEventLogger.cs2
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest2
-rw-r--r--Software/Visual_Studio/Tango.BL/Entities/MachinesEvent.cs4
13 files changed, 230 insertions, 18 deletions
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/Converters/MachineEventToMachineTypeConverter.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/Converters/MachineEventToMachineTypeConverter.cs
new file mode 100644
index 000000000..c1d2bcc0e
--- /dev/null
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/Converters/MachineEventToMachineTypeConverter.cs
@@ -0,0 +1,43 @@
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Data;
+using Tango.BL.Entities;
+using Tango.BL.Enumerations;
+using Tango.Core.DI;
+using Tango.PPC.Common.Build;
+
+namespace Tango.PPC.Events.Converters
+{
+ public class MachineEventToMachineTypeConverter : IValueConverter
+ {
+ private static MachineTypes? _machineType = null;
+
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ if (_machineType == null)
+ {
+ IBuildProvider buildProvider = TangoIOC.Default.GetInstance<IBuildProvider>();
+
+ if (buildProvider != null)
+ {
+ _machineType = buildProvider.MachineType;
+ }
+ else
+ {
+ return MachineTypes.TS1800;
+ }
+ }
+
+ return _machineType.Value;
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ throw new NotImplementedException();
+ }
+ }
+}
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/Converters/MachineEventToViewConverter.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/Converters/MachineEventToViewConverter.cs
index 5198498a3..6ed2b13d0 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/Converters/MachineEventToViewConverter.cs
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/Converters/MachineEventToViewConverter.cs
@@ -22,7 +22,7 @@ namespace Tango.PPC.Events.Converters
_eventViews.Add(EventTypes.JOB_STARTED, typeof(JobEventView));
_eventViews.Add(EventTypes.JOB_ABORTED, typeof(JobEventView));
_eventViews.Add(EventTypes.JOB_COMPLETED, typeof(JobEventView));
- _eventViews.Add(EventTypes.JOB_FAILED, typeof(JobEventView));
+ _eventViews.Add(EventTypes.JOB_FAILED, typeof(JobFailedEventView));
//Thread Break
_eventViews.Add(EventTypes.THREAD_BREAK, typeof(ThreadBreakView));
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/EventsViews/GeneralView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/EventsViews/GeneralView.xaml
index 3610a2850..2b3435734 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/EventsViews/GeneralView.xaml
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/EventsViews/GeneralView.xaml
@@ -4,12 +4,33 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:entities="clr-namespace:Tango.BL.Entities;assembly=Tango.BL"
+ xmlns:converters="clr-namespace:Tango.PPC.Events.Converters"
xmlns:local="clr-namespace:Tango.PPC.Events.EventsViews"
mc:Ignorable="d"
d:DesignHeight="220" d:DesignWidth="750" d:DataContext="{d:DesignInstance Type=entities:MachinesEvent, IsDesignTimeCreatable=False}">
+ <UserControl.Resources>
+ <converters:MachineEventToMachineTypeConverter x:Key="MachineEventToMachineTypeConverter" />
+ </UserControl.Resources>
<Grid Background="{StaticResource TangoPrimaryBackgroundBrush}">
<DockPanel>
- <Image Stretch="None" Margin="20" DockPanel.Dock="Right" Source="../Images/machine_small.png" RenderOptions.BitmapScalingMode="Fant" />
+ <Image Margin="20" Stretch="None" DockPanel.Dock="Right" RenderOptions.BitmapScalingMode="Fant">
+ <Image.Style>
+ <Style TargetType="Image">
+ <Setter Property="Source" Value="../Images/machine_small.png"></Setter>
+ <Style.Triggers>
+ <DataTrigger Binding="{Binding Converter={StaticResource MachineEventToMachineTypeConverter}}" Value="TS1800">
+ <Setter Property="Source" Value="../Images/machine_small.png"></Setter>
+ </DataTrigger>
+ <DataTrigger Binding="{Binding Converter={StaticResource MachineEventToMachineTypeConverter}}" Value="Eureka">
+ <Setter Property="Source" Value="../Images/machine_small_X4.png"></Setter>
+ </DataTrigger>
+ <DataTrigger Binding="{Binding Converter={StaticResource MachineEventToMachineTypeConverter}}" Value="X1">
+ <Setter Property="Source" Value="../Images/machine_small_X4.png"></Setter>
+ </DataTrigger>
+ </Style.Triggers>
+ </Style>
+ </Image.Style>
+ </Image>
<DockPanel Margin="35 20 20 20">
<TextBlock FontSize="{StaticResource TangoTitleFontSize}" FontWeight="SemiBold" DockPanel.Dock="Top" Text="{Binding EventType,Converter={StaticResource EventTypeTitleConverter},FallbackValue='Unknown Event'}"></TextBlock>
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/EventsViews/JobEventView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/EventsViews/JobEventView.xaml
index d283b08d3..69a2d56f4 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/EventsViews/JobEventView.xaml
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/EventsViews/JobEventView.xaml
@@ -4,22 +4,39 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:entities="clr-namespace:Tango.BL.Entities;assembly=Tango.BL"
+ xmlns:converters="clr-namespace:Tango.PPC.Events.Converters"
xmlns:local="clr-namespace:Tango.PPC.Events.EventsViews"
mc:Ignorable="d"
d:DesignHeight="220" d:DesignWidth="750" d:DataContext="{d:DesignInstance Type=entities:MachinesEvent, IsDesignTimeCreatable=False}">
+ <UserControl.Resources>
+ <converters:MachineEventToMachineTypeConverter x:Key="MachineEventToMachineTypeConverter" />
+ </UserControl.Resources>
+
<Grid Background="{StaticResource TangoPrimaryBackgroundBrush}">
<DockPanel>
- <Image Stretch="None" Margin="20" DockPanel.Dock="Right" Source="../Images/machine_small.png" RenderOptions.BitmapScalingMode="Fant" />
+ <Image Margin="20" Stretch="None" DockPanel.Dock="Right" RenderOptions.BitmapScalingMode="Fant">
+ <Image.Style>
+ <Style TargetType="Image">
+ <Setter Property="Source" Value="../Images/machine_small.png"></Setter>
+ <Style.Triggers>
+ <DataTrigger Binding="{Binding Converter={StaticResource MachineEventToMachineTypeConverter}}" Value="TS1800">
+ <Setter Property="Source" Value="../Images/machine_small.png"></Setter>
+ </DataTrigger>
+ <DataTrigger Binding="{Binding Converter={StaticResource MachineEventToMachineTypeConverter}}" Value="Eureka">
+ <Setter Property="Source" Value="../Images/machine_small_X4.png"></Setter>
+ </DataTrigger>
+ <DataTrigger Binding="{Binding Converter={StaticResource MachineEventToMachineTypeConverter}}" Value="X1">
+ <Setter Property="Source" Value="../Images/machine_small_X4.png"></Setter>
+ </DataTrigger>
+ </Style.Triggers>
+ </Style>
+ </Image.Style>
+ </Image>
<DockPanel Margin="35 20 20 20">
- <TextBlock FontSize="{StaticResource TangoTitleFontSize}" FontWeight="SemiBold" DockPanel.Dock="Top" Text="{Binding EventType.Title,FallbackValue='Unknown Event'}"></TextBlock>
+ <TextBlock FontSize="{StaticResource TangoTitleFontSize}" FontWeight="SemiBold" DockPanel.Dock="Top" Text="{Binding EventType.Description,FallbackValue='No Description'}"></TextBlock>
<StackPanel Margin="0 30 0 0">
- <TextBlock TextWrapping="Wrap" FontWeight="SemiBold" Text="{Binding EventType.Description,FallbackValue='No Description'}"></TextBlock>
- <Rectangle Margin="0 5 0 10" StrokeThickness="2" Stroke="{StaticResource TangoDividerBrush}" />
-
- <TextBlock Text="{Binding Description}" TextWrapping="Wrap">
-
- </TextBlock>
+ <TextBlock TextWrapping="Wrap" FontWeight="SemiBold" Text="{Binding Description,FallbackValue='No Description'}"></TextBlock>
</StackPanel>
</DockPanel>
</DockPanel>
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/EventsViews/JobFailedEventView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/EventsViews/JobFailedEventView.xaml
new file mode 100644
index 000000000..710e6b4da
--- /dev/null
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/EventsViews/JobFailedEventView.xaml
@@ -0,0 +1,61 @@
+<UserControl x:Class="Tango.PPC.Events.EventsViews.JobFailedEventView"
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:entities="clr-namespace:Tango.BL.Entities;assembly=Tango.BL"
+ xmlns:converters="clr-namespace:Tango.PPC.Events.Converters"
+ xmlns:local="clr-namespace:Tango.PPC.Events.EventsViews"
+ mc:Ignorable="d"
+ d:DesignHeight="220" d:DesignWidth="750" d:DataContext="{d:DesignInstance Type=entities:MachinesEvent, IsDesignTimeCreatable=False}">
+ <UserControl.Resources>
+ <converters:MachineEventToMachineTypeConverter x:Key="MachineEventToMachineTypeConverter" />
+ </UserControl.Resources>
+
+ <Grid Background="{StaticResource TangoPrimaryBackgroundBrush}">
+ <DockPanel>
+ <Image Margin="20" Stretch="None" DockPanel.Dock="Right" RenderOptions.BitmapScalingMode="Fant">
+ <Image.Style>
+ <Style TargetType="Image">
+ <Setter Property="Source" Value="../Images/machine_small.png"></Setter>
+ <Style.Triggers>
+ <DataTrigger Binding="{Binding Converter={StaticResource MachineEventToMachineTypeConverter}}" Value="TS1800">
+ <Setter Property="Source" Value="../Images/machine_small.png"></Setter>
+ </DataTrigger>
+ <DataTrigger Binding="{Binding Converter={StaticResource MachineEventToMachineTypeConverter}}" Value="Eureka">
+ <Setter Property="Source" Value="../Images/machine_small_X4.png"></Setter>
+ </DataTrigger>
+ <DataTrigger Binding="{Binding Converter={StaticResource MachineEventToMachineTypeConverter}}" Value="X1">
+ <Setter Property="Source" Value="../Images/machine_small_X4.png"></Setter>
+ </DataTrigger>
+ </Style.Triggers>
+ </Style>
+ </Image.Style>
+ </Image>
+ <DockPanel Margin="35 20 20 20">
+ <TextBlock FontSize="{StaticResource TangoTitleFontSize}" FontWeight="SemiBold" DockPanel.Dock="Top" Text="{Binding EventType.Description,FallbackValue='No Description'}"></TextBlock>
+
+ <StackPanel Margin="0 30 0 0">
+ <TextBlock TextWrapping="Wrap" FontWeight="SemiBold" Text="{Binding Description,FallbackValue='No Description'}"></TextBlock>
+
+ <StackPanel Visibility="{Binding RelatedEventType,Converter={StaticResource IsNullToVisibilityConverter}}">
+ <Rectangle Margin="0 5 0 10" StrokeThickness="2" Stroke="{StaticResource TangoDividerBrush}" />
+
+ <TextBlock Text="More Information" TextWrapping="Wrap" FontWeight="Bold"></TextBlock>
+
+ <TextBlock><Run Text="{Binding RelatedEventType.Title}"></Run> <Run> (</Run>#<Run Text="{Binding RelatedEventType.Code}"></Run><Run>)</Run></TextBlock>
+ <TextBlock Margin="0 2 0 0" Text="{Binding RelatedEventType.Description}"></TextBlock>
+
+ <ItemsControl ItemsSource="{Binding RelatedEventType.Guidance,Converter={StaticResource StringToLinesConverter}}">
+ <ItemsControl.ItemTemplate>
+ <DataTemplate>
+ <TextBlock Margin="0 10 0 0" Text="{Binding}" TextWrapping="Wrap"></TextBlock>
+ </DataTemplate>
+ </ItemsControl.ItemTemplate>
+ </ItemsControl>
+ </StackPanel>
+ </StackPanel>
+ </DockPanel>
+ </DockPanel>
+ </Grid>
+</UserControl>
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/EventsViews/JobFailedEventView.xaml.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/EventsViews/JobFailedEventView.xaml.cs
new file mode 100644
index 000000000..faac1576d
--- /dev/null
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/EventsViews/JobFailedEventView.xaml.cs
@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace Tango.PPC.Events.EventsViews
+{
+ /// <summary>
+ /// Interaction logic for JobEventView.xaml
+ /// </summary>
+ public partial class JobFailedEventView : UserControl
+ {
+ public JobFailedEventView()
+ {
+ InitializeComponent();
+ }
+ }
+}
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/EventsViews/ThreadBreakView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/EventsViews/ThreadBreakView.xaml
index 71c4ced07..e1316ddc3 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/EventsViews/ThreadBreakView.xaml
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/EventsViews/ThreadBreakView.xaml
@@ -5,12 +5,35 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch"
xmlns:entities="clr-namespace:Tango.BL.Entities;assembly=Tango.BL"
+ xmlns:converters="clr-namespace:Tango.PPC.Events.Converters"
xmlns:local="clr-namespace:Tango.PPC.Events.EventsViews"
mc:Ignorable="d"
d:DesignHeight="220" d:DesignWidth="750" d:DataContext="{d:DesignInstance Type=entities:MachinesEvent, IsDesignTimeCreatable=False}">
+
+ <UserControl.Resources>
+ <converters:MachineEventToMachineTypeConverter x:Key="MachineEventToMachineTypeConverter" />
+ </UserControl.Resources>
+
<Grid Background="{StaticResource TangoPrimaryBackgroundBrush}">
<DockPanel>
- <Image Stretch="None" Margin="20" DockPanel.Dock="Right" Source="../Images/machine_small.png" RenderOptions.BitmapScalingMode="Fant" />
+ <Image Margin="20" Stretch="None" DockPanel.Dock="Right" RenderOptions.BitmapScalingMode="Fant">
+ <Image.Style>
+ <Style TargetType="Image">
+ <Setter Property="Source" Value="../Images/machine_small.png"></Setter>
+ <Style.Triggers>
+ <DataTrigger Binding="{Binding Converter={StaticResource MachineEventToMachineTypeConverter}}" Value="TS1800">
+ <Setter Property="Source" Value="../Images/machine_small.png"></Setter>
+ </DataTrigger>
+ <DataTrigger Binding="{Binding Converter={StaticResource MachineEventToMachineTypeConverter}}" Value="Eureka">
+ <Setter Property="Source" Value="../Images/machine_small_X4.png"></Setter>
+ </DataTrigger>
+ <DataTrigger Binding="{Binding Converter={StaticResource MachineEventToMachineTypeConverter}}" Value="X1">
+ <Setter Property="Source" Value="../Images/machine_small_X4.png"></Setter>
+ </DataTrigger>
+ </Style.Triggers>
+ </Style>
+ </Image.Style>
+ </Image>
<DockPanel Margin="35 20 20 20">
<TextBlock FontSize="{StaticResource TangoTitleFontSize}" FontWeight="SemiBold" DockPanel.Dock="Top" Text="{Binding EventType.Title,FallbackValue='Unknown Event'}"></TextBlock>
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/Images/machine_small_X4.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/Images/machine_small_X4.png
new file mode 100644
index 000000000..a2e881ddf
--- /dev/null
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/Images/machine_small_X4.png
Binary files differ
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/Tango.PPC.Events.csproj b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/Tango.PPC.Events.csproj
index 540c33e1c..d82ad3cce 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/Tango.PPC.Events.csproj
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/Tango.PPC.Events.csproj
@@ -72,6 +72,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
+ <Page Include="EventsViews\JobFailedEventView.xaml">
+ <Generator>MSBuild:Compile</Generator>
+ <SubType>Designer</SubType>
+ </Page>
<Page Include="EventsViews\JobEventView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@@ -97,12 +101,16 @@
<Compile Include="..\..\..\Versioning\GlobalVersionInfo.cs">
<Link>GlobalVersionInfo.cs</Link>
</Compile>
+ <Compile Include="Converters\MachineEventToMachineTypeConverter.cs" />
<Compile Include="Converters\MachineEventToViewConverter.cs" />
<Compile Include="Enumerations\EventsSource.cs" />
<Compile Include="EventsModule.cs" />
<Compile Include="EventsViews\GeneralView.xaml.cs">
<DependentUpon>GeneralView.xaml</DependentUpon>
</Compile>
+ <Compile Include="EventsViews\JobFailedEventView.xaml.cs">
+ <DependentUpon>JobFailedEventView.xaml</DependentUpon>
+ </Compile>
<Compile Include="EventsViews\JobEventView.xaml.cs">
<DependentUpon>JobEventView.xaml</DependentUpon>
</Compile>
@@ -191,6 +199,9 @@
<ItemGroup>
<Resource Include="Images\machine_small.png" />
</ItemGroup>
+ <ItemGroup>
+ <Resource Include="Images\machine_small_X4.png" />
+ </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<ProjectExtensions>
<VisualStudio>
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 4e00474f4..59c56ed42 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/EventLogging/DefaultEventLogger.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/EventLogging/DefaultEventLogger.cs
@@ -155,18 +155,17 @@ namespace Tango.PPC.Common.EventLogging
/// <param name="e">The <see cref="PrintingFailedEventArgs"/> instance containing the event data.</param>
private void MachineOperator_PrintingFailed(object sender, PrintingFailedEventArgs e)
{
- String eventInfo = String.Empty;
+ EventTypes? relatedEventType = null;
if (e.Exception is Transport.ResponseErrorException responseError)
{
if (responseError.Container.EventCode > 0)
{
- EventTypes evType = (EventTypes)responseError.Container.EventCode;
- eventInfo = "\n#" + responseError.Container.EventCode + " " + evType.ToDescription();
+ relatedEventType = (EventTypes)responseError.Container.EventCode;
}
}
- Log(EventTypes.JOB_FAILED, e.Exception.Message + eventInfo);
+ Log(EventTypes.JOB_FAILED, e.Exception.Message, relatedEventType);
}
/// <summary>
@@ -330,7 +329,7 @@ namespace Tango.PPC.Common.EventLogging
/// </summary>
/// <param name="eventType">Type of the event.</param>
/// <param name="message">The message.</param>
- public void Log(EventTypes eventType, string message)
+ public void Log(EventTypes eventType, string message, EventTypes? relatedEventType = null)
{
Init();
@@ -340,6 +339,11 @@ namespace Tango.PPC.Common.EventLogging
machineEvent.EventType = _eventTypesGuids[eventType];
machineEvent.EventTypeGuid = machineEvent.EventType.Guid;
+ if (relatedEventType != null)
+ {
+ machineEvent.RelatedEventType = _eventTypesGuids[relatedEventType.Value];
+ }
+
Log(machineEvent);
}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/EventLogging/IEventLogger.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/EventLogging/IEventLogger.cs
index 81cce927d..a39f36cc1 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/EventLogging/IEventLogger.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/EventLogging/IEventLogger.cs
@@ -36,7 +36,7 @@ namespace Tango.PPC.Common.EventLogging
/// </summary>
/// <param name="eventType">Type of the event.</param>
/// <param name="message">The message.</param>
- void Log(EventTypes eventType, String message);
+ void Log(EventTypes eventType, String message, EventTypes? relatedEventType = null);
/// <summary>
/// Logs the specified hardware event.
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest b/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest
index d72e75011..efc5f8179 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest
@@ -16,7 +16,7 @@
Remove this element if your application requires this virtualization for backwards
compatibility.
-->
- <requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
+ <!--<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />-->
</requestedPrivileges>
</security>
</trustInfo>
diff --git a/Software/Visual_Studio/Tango.BL/Entities/MachinesEvent.cs b/Software/Visual_Studio/Tango.BL/Entities/MachinesEvent.cs
index 4572fe5ae..081fe01f1 100644
--- a/Software/Visual_Studio/Tango.BL/Entities/MachinesEvent.cs
+++ b/Software/Visual_Studio/Tango.BL/Entities/MachinesEvent.cs
@@ -108,6 +108,10 @@ namespace Tango.BL.Entities
set { _eventUser = value; RaisePropertyChangedAuto(); }
}
+ [JsonIgnore]
+ [NotMapped]
+ public EventType RelatedEventType { get; set; }
+
protected override void OnUserChanged(User user)
{
base.OnUserChanged(user);