aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio
diff options
context:
space:
mode:
authorVictoria Plitt <Victoria.Plitt@twine-s.com>2020-01-08 13:53:48 +0200
committerVictoria Plitt <Victoria.Plitt@twine-s.com>2020-01-08 13:53:48 +0200
commit5a06b997b7ef29c566bad2bc65f927e9443c3888 (patch)
tree7c332325fc01f82b68855bf31636830085ba6954 /Software/Visual_Studio
parent7f05564656644b9af0500657a689c12805aee732 (diff)
downloadTango-5a06b997b7ef29c566bad2bc65f927e9443c3888.tar.gz
Tango-5a06b997b7ef29c566bad2bc65f927e9443c3888.zip
Implemented maintenance mid-tank graphics.
Implemented session file logger.
Diffstat (limited to 'Software/Visual_Studio')
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Converters/LiquidTypeToBrushConverter.cs52
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Converters/MidTankLevelToElementHeightConverter.cs6
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/cl-full.pngbin0 -> 3454 bytes
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/cone-empty.pngbin0 -> 2174 bytes
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/cone-full.pngbin0 -> 1752 bytes
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/l-full.pngbin0 -> 19717 bytes
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/lubricant2.pngbin0 -> 194234 bytes
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Tango.PPC.Maintenance.csproj12
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/MaintenanceView.xaml113
-rw-r--r--Software/Visual_Studio/Tango.BL/Entities/LiquidType.cs8
-rw-r--r--Software/Visual_Studio/Tango.Logging/SessionFileLogger.cs103
-rw-r--r--Software/Visual_Studio/Tango.Logging/Tango.Logging.csproj1
-rw-r--r--Software/Visual_Studio/Tango.UnitTesting/Logging/SessionLoging_TST.cs38
-rw-r--r--Software/Visual_Studio/Tango.UnitTesting/Tango.UnitTesting.csproj3
14 files changed, 277 insertions, 59 deletions
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Converters/LiquidTypeToBrushConverter.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Converters/LiquidTypeToBrushConverter.cs
new file mode 100644
index 000000000..c7e828148
--- /dev/null
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Converters/LiquidTypeToBrushConverter.cs
@@ -0,0 +1,52 @@
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Data;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using Tango.BL.Entities;
+using Tango.SharedUI.Helpers;
+
+namespace Tango.PPC.Maintenance.Converters
+{
+ public class LiquidTypeToBrushConverter : IValueConverter
+ {
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ if (value is LiquidType)
+ {
+ LiquidType type = value as LiquidType;
+ if (type.Type == BL.Enumerations.LiquidTypes.Lubricant)
+ {
+ ImageBrush lubricantBrush = new ImageBrush() { Stretch = Stretch.None, TileMode = TileMode.Tile, ViewportUnits = BrushMappingMode.Absolute };
+ lubricantBrush.ImageSource = ResourceHelper.GetImageFromResources(@"Images/lubricant2.png");
+ lubricantBrush.Viewport = new System.Windows.Rect(lubricantBrush.ImageSource.Width/3, lubricantBrush.ImageSource.Height/3, lubricantBrush.ImageSource.Width, lubricantBrush.ImageSource.Height);
+ return lubricantBrush;
+ }
+ if (type.Type == BL.Enumerations.LiquidTypes.Cleaner)
+ {
+ ImageBrush cleanerBrush = new ImageBrush(){ Stretch = Stretch.None, TileMode = TileMode.Tile, ViewportUnits = BrushMappingMode.Absolute };
+ cleanerBrush.ImageSource = ResourceHelper.GetImageFromResources(@"Images/cl-full.png");
+ cleanerBrush.Viewport = new System.Windows.Rect(5, 5, cleanerBrush.ImageSource.Width, cleanerBrush.ImageSource.Height);
+ return cleanerBrush;
+ }
+ else
+ {
+ return new SolidColorBrush(type.LiquidTypeColor); ;
+ }
+ }
+ return null;
+
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ throw new NotImplementedException();
+ }
+
+ }
+}
+
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Converters/MidTankLevelToElementHeightConverter.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Converters/MidTankLevelToElementHeightConverter.cs
index 5cf3f535c..94d1ed8b8 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Converters/MidTankLevelToElementHeightConverter.cs
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Converters/MidTankLevelToElementHeightConverter.cs
@@ -16,9 +16,9 @@ namespace Tango.PPC.Maintenance.Converters
try
{
double parentActualHeight = (double)values[0];
- double midTankLevel = (double)values[1];
-
- return (midTankLevel / MachineOperator.MAX_MIDTANK_LITERS) * parentActualHeight;
+ double midTankLevel = Math.Min((double)values[1], MachineOperator.MAX_MIDTANK_LITERS);
+ //var test = (parentActualHeight - (midTankLevel / MachineOperator.MAX_MIDTANK_LITERS) * parentActualHeight);
+ return (parentActualHeight - (midTankLevel / MachineOperator.MAX_MIDTANK_LITERS) * parentActualHeight);
}
catch
{
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/cl-full.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/cl-full.png
new file mode 100644
index 000000000..5aaea8e6c
--- /dev/null
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/cl-full.png
Binary files differ
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/cone-empty.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/cone-empty.png
new file mode 100644
index 000000000..d65b8f793
--- /dev/null
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/cone-empty.png
Binary files differ
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/cone-full.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/cone-full.png
new file mode 100644
index 000000000..c42abf56e
--- /dev/null
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/cone-full.png
Binary files differ
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/l-full.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/l-full.png
new file mode 100644
index 000000000..2607f4a26
--- /dev/null
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/l-full.png
Binary files differ
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/lubricant2.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/lubricant2.png
new file mode 100644
index 000000000..554c16305
--- /dev/null
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/lubricant2.png
Binary files differ
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Tango.PPC.Maintenance.csproj b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Tango.PPC.Maintenance.csproj
index a43fc2dc3..3f9f7c7b9 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Tango.PPC.Maintenance.csproj
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Tango.PPC.Maintenance.csproj
@@ -102,6 +102,7 @@
<Compile Include="..\..\..\Versioning\GlobalVersionInfo.cs">
<Link>GlobalVersionInfo.cs</Link>
</Compile>
+ <Compile Include="Converters\LiquidTypeToBrushConverter.cs" />
<Compile Include="Converters\MidTankLevelToElementHeightConverter.cs" />
<Compile Include="Converters\StringToFirstLetterConverter.cs" />
<Compile Include="GuideBase.cs" />
@@ -255,10 +256,19 @@
<Resource Include="Images\temperature-red.png" />
<Resource Include="Images\temperature-yellow.png" />
</ItemGroup>
+ <ItemGroup>
+ <Resource Include="Images\lubricant2.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <Resource Include="Images\cl-full.png" />
+ <Resource Include="Images\cone-empty.png" />
+ <Resource Include="Images\cone-full.png" />
+ <Resource Include="Images\l-full.png" />
+ </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<ProjectExtensions>
<VisualStudio>
- <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" />
+ <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" />
</VisualStudio>
</ProjectExtensions>
</Project> \ No newline at end of file
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/MaintenanceView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/MaintenanceView.xaml
index c843daffc..e71a1827e 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/MaintenanceView.xaml
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/MaintenanceView.xaml
@@ -15,6 +15,7 @@
<localConverters:StringToFirstLetterConverter x:Key="StringToFirstLetterConverter" />
<localConverters:MidTankLevelToElementHeightConverter x:Key="MidTankLevelToElementHeightConverter" />
+ <localConverters:LiquidTypeToBrushConverter x:Key="LiquidTypeToBrushConverter" />
<Style TargetType="FrameworkElement" x:Key="Level1Container">
<Setter Property="Margin" Value="20 15 60 15"></Setter>
@@ -25,6 +26,61 @@
<Style TargetType="FrameworkElement" x:Key="Level2ContainerExtraMargin">
<Setter Property="Margin" Value="80 40 60 0"></Setter>
</Style>
+
+ <DataTemplate x:Key="LiquidBox">
+ <DockPanel>
+ <TextBlock DockPanel.Dock="Top" Text="{Binding IDSPack.LiquidType.Name,Converter={StaticResource StringToFirstLetterConverter}}" HorizontalAlignment="Center"></TextBlock>
+ <Grid MaxWidth="30" Margin="5 0">
+ <touch:TouchIcon Icon="MapMarkerSolid" Width="20" Height="20" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0 0 0 10" Foreground ="{Binding Path=IDSPack.LiquidType, Converter={StaticResource LiquidTypeToBrushConverter}}">
+ <touch:TouchIcon.Style>
+ <Style TargetType="touch:TouchIcon">
+ <Setter Property="Visibility" Value="Hidden"></Setter>
+ <Style.Triggers>
+ <DataTrigger Binding="{Binding IsLow}" Value="True">
+ <Setter Property="Visibility" Value="Visible"></Setter>
+ </DataTrigger>
+ <DataTrigger Binding="{Binding IsEmpty}" Value="True">
+ <DataTrigger.EnterActions>
+ <BeginStoryboard Name="blinkDrop">
+ <Storyboard>
+ <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Duration="00:00:01" RepeatBehavior="Forever">
+ <DiscreteDoubleKeyFrame KeyTime="00:00:00" Value="1" />
+ <DiscreteDoubleKeyFrame KeyTime="00:00:0.5" Value="0" />
+ </DoubleAnimationUsingKeyFrames>
+ </Storyboard>
+ </BeginStoryboard>
+ </DataTrigger.EnterActions>
+ <DataTrigger.ExitActions>
+ <RemoveStoryboard BeginStoryboardName="blinkDrop" />
+ </DataTrigger.ExitActions>
+ </DataTrigger>
+ </Style.Triggers>
+ </Style>
+ </touch:TouchIcon.Style>
+ </touch:TouchIcon>
+ <Border BorderThickness="1" BorderBrush="{StaticResource TangoLightBorderBrush}" CornerRadius="3" ClipToBounds="True" x:Name="pathBorder">
+ <Canvas Width="30" >
+ <Path Panel.ZIndex="1" VerticalAlignment="Bottom" ClipToBounds="True" MinHeight="2" Data="M0,0 C2,0 8.9,-1.1705073 11.3,-4.6 14.5,-7.7 15.5,-8 18.7,-10.8 21.7,-13.16 23.3,-14.5 28,-15.6 28,-13.7 28,80 28,100 L0,100 z" Height="90" Width="29" Stretch="Fill"
+ Canvas.Left="0" Fill="{Binding Path=IDSPack.LiquidType, Converter={StaticResource LiquidTypeToBrushConverter}}" Margin="0 -14 0 0" >
+
+ <Path.Style>
+ <Style>
+ <Setter Property="Canvas.Top" >
+ <Setter.Value>
+ <MultiBinding Converter="{StaticResource MidTankLevelToElementHeightConverter}">
+ <Binding ElementName="pathBorder" Path="ActualHeight" />
+ <Binding Path="Level" />
+ </MultiBinding>
+ </Setter.Value>
+ </Setter>
+ </Style>
+ </Path.Style>
+ </Path>
+ </Canvas>
+ </Border>
+ </Grid>
+ </DockPanel>
+ </DataTemplate>
</UserControl.Resources>
<Grid Background="{StaticResource TangoMidBackgroundBrush}" IsEnabled="{Binding IsFree}">
@@ -88,67 +144,16 @@
</StackPanel>
<Grid Grid.Column="1" Margin="0 0 0 10">
- <ItemsControl ItemsSource="{Binding MidTankLevels}">
+ <ItemsControl ItemsSource="{Binding MidTankLevels}" ItemTemplate="{StaticResource LiquidBox}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<UniformGrid Rows="1" IsItemsHost="True"></UniformGrid>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
- <ItemsControl.ItemTemplate>
- <DataTemplate>
- <DockPanel>
- <TextBlock DockPanel.Dock="Top" Text="{Binding IDSPack.LiquidType.Name,Converter={StaticResource StringToFirstLetterConverter}}" HorizontalAlignment="Center"></TextBlock>
-
- <Grid MaxWidth="30" Margin="5 0">
- <touch:TouchIcon Icon="MapMarkerSolid" Width="20" Height="20" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0 0 0 10">
- <touch:TouchIcon.Foreground>
- <SolidColorBrush Color="{Binding IDSPack.LiquidType.LiquidTypeColor}" />
- </touch:TouchIcon.Foreground>
- <touch:TouchIcon.Style>
- <Style TargetType="touch:TouchIcon">
- <Setter Property="Visibility" Value="Hidden"></Setter>
- <Style.Triggers>
- <DataTrigger Binding="{Binding IsLow}" Value="True">
- <Setter Property="Visibility" Value="Visible"></Setter>
- </DataTrigger>
- <DataTrigger Binding="{Binding IsEmpty}" Value="True">
- <DataTrigger.EnterActions>
- <BeginStoryboard Name="blinkDrop">
- <Storyboard>
- <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Duration="00:00:01" RepeatBehavior="Forever">
- <DiscreteDoubleKeyFrame KeyTime="00:00:00" Value="1" />
- <DiscreteDoubleKeyFrame KeyTime="00:00:0.5" Value="0" />
- </DoubleAnimationUsingKeyFrames>
- </Storyboard>
- </BeginStoryboard>
- </DataTrigger.EnterActions>
- <DataTrigger.ExitActions>
- <RemoveStoryboard BeginStoryboardName="blinkDrop" />
- </DataTrigger.ExitActions>
- </DataTrigger>
- </Style.Triggers>
- </Style>
- </touch:TouchIcon.Style>
- </touch:TouchIcon>
- <Border BorderThickness="1" BorderBrush="{StaticResource TangoLightBorderBrush}" CornerRadius="3">
- <Border CornerRadius="3" VerticalAlignment="Bottom" MinHeight="2">
- <Border.Background>
- <SolidColorBrush Color="{Binding IDSPack.LiquidType.LiquidTypeColor}" />
- </Border.Background>
- <Border.Height>
- <MultiBinding Converter="{StaticResource MidTankLevelToElementHeightConverter}">
- <Binding RelativeSource="{RelativeSource AncestorType=Border}" Path="ActualHeight" />
- <Binding Path="Level" />
- </MultiBinding>
- </Border.Height>
- </Border>
- </Border>
- </Grid>
- </DockPanel>
- </DataTemplate>
- </ItemsControl.ItemTemplate>
</ItemsControl>
</Grid>
+
+ <Image Grid.Column="2" VerticalAlignment="Center" HorizontalAlignment="Center" Source="../Images/cone-full.png" Margin="30"></Image>
<TextBlock Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}">Temperature</TextBlock>
<TextBlock Grid.Column="1" Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}">Inks</TextBlock>
diff --git a/Software/Visual_Studio/Tango.BL/Entities/LiquidType.cs b/Software/Visual_Studio/Tango.BL/Entities/LiquidType.cs
index 60fdc6707..ce09d72ac 100644
--- a/Software/Visual_Studio/Tango.BL/Entities/LiquidType.cs
+++ b/Software/Visual_Studio/Tango.BL/Entities/LiquidType.cs
@@ -6,6 +6,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Media;
+using Tango.BL.Enumerations;
namespace Tango.BL.Entities
{
@@ -24,6 +25,13 @@ namespace Tango.BL.Entities
get { return Core.Helpers.ColorHelper.IntegerToColor(Color); }
}
+ [NotMapped]
+ [JsonIgnore]
+ public LiquidTypes Type
+ {
+ get { return (LiquidTypes)Code; }
+ }
+
/// <summary>
/// Initializes a new instance of the <see cref="LiquidType" /> class.
/// </summary>
diff --git a/Software/Visual_Studio/Tango.Logging/SessionFileLogger.cs b/Software/Visual_Studio/Tango.Logging/SessionFileLogger.cs
new file mode 100644
index 000000000..f3c23ca25
--- /dev/null
+++ b/Software/Visual_Studio/Tango.Logging/SessionFileLogger.cs
@@ -0,0 +1,103 @@
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Tango.Logging
+{
+ public class SessionFileLogger : ILogger
+ {
+ private bool _inInSession;
+
+ public const string FILE_SESSION_EXTENSION = "_session";
+
+ public static String DefaultLogsFolder { get; private set; }
+
+ public bool Enabled { get; set; }
+
+ public String Folder { get; private set; }
+
+ public String LogFile { get; private set; }
+
+ public String Tag { get; private set; }
+
+ static SessionFileLogger()
+ {
+ DefaultLogsFolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Twine", "Tango", "Logs", Path.GetFileNameWithoutExtension(AppDomain.CurrentDomain.FriendlyName), "session");
+ }
+
+ public SessionFileLogger(String folder, String tag)
+ {
+ Folder = folder;
+ Tag = tag;
+ Directory.CreateDirectory(Folder);
+ Enabled = true;
+ }
+
+ public SessionFileLogger() : this(DefaultLogsFolder, Path.GetFileNameWithoutExtension(AppDomain.CurrentDomain.FriendlyName))
+ {
+
+ }
+
+ public void CreateSession()
+ {
+ RemoveOldLogFile();
+ LogFile = CreateLogFileName();
+ _inInSession = true;
+ }
+
+ public void EndSession()
+ {
+ _inInSession = false;
+ }
+
+ private String CreateLogFileName()
+ {
+ return Path.Combine(Folder, string.Format("{1}-{0:dd-MM-yyyy_HH-mm-ss}{2}.log", DateTime.Now, Tag, FILE_SESSION_EXTENSION));
+ }
+
+ private void RemoveOldLogFile()
+ {
+ try
+ {
+ if (Directory.Exists(Folder))
+ {
+ string[] fileEntries = Directory.GetFiles(Folder, "*.log");
+ foreach (string fileName in fileEntries)
+ {
+ try
+ {
+ File.Delete(fileName);
+ }
+ catch (Exception ex)
+ {
+ Debug.WriteLine(ex);
+ }
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ Debug.WriteLine(ex);
+ }
+ }
+
+ public void OnLog(LogItemBase output)
+ {
+ if (_inInSession)
+ {
+ try
+ {
+ File.AppendAllText(LogFile, output.ToString() + Environment.NewLine);
+ }
+ catch
+ {
+ Debug.WriteLine("Error Writing To Session Log File!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
+ }
+ }
+ }
+ }
+}
diff --git a/Software/Visual_Studio/Tango.Logging/Tango.Logging.csproj b/Software/Visual_Studio/Tango.Logging/Tango.Logging.csproj
index 311579625..e2e2b1edd 100644
--- a/Software/Visual_Studio/Tango.Logging/Tango.Logging.csproj
+++ b/Software/Visual_Studio/Tango.Logging/Tango.Logging.csproj
@@ -69,6 +69,7 @@
<Compile Include="LogFile.cs" />
<Compile Include="ProducerConsumerQueue.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="SessionFileLogger.cs" />
<Compile Include="SimpleStringLogger.cs" />
<Compile Include="VSOutputLogger.cs" />
</ItemGroup>
diff --git a/Software/Visual_Studio/Tango.UnitTesting/Logging/SessionLoging_TST.cs b/Software/Visual_Studio/Tango.UnitTesting/Logging/SessionLoging_TST.cs
new file mode 100644
index 000000000..873fcca57
--- /dev/null
+++ b/Software/Visual_Studio/Tango.UnitTesting/Logging/SessionLoging_TST.cs
@@ -0,0 +1,38 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+using Tango.Logging;
+
+namespace Tango.UnitTesting.Logging
+{
+ [TestClass]
+ [TestCategory("Logging")]
+ public class SessionLoging_TST
+ {
+ [TestMethod]
+ public void Create_Session_File_Logger()
+ {
+ SessionFileLogger sessionlogger = new SessionFileLogger();
+ LogManager.Default.RegisterLogger(sessionlogger);
+ sessionlogger.CreateSession();
+ var manager = LogManager.Default;
+
+ manager.Log($"This is a test 1");
+ Thread.Sleep(300);
+ SessionFileLogger slogger = LogManager.Default.RegisteredLoggers.FirstOrDefault(x => x.GetType() == typeof(SessionFileLogger)) as SessionFileLogger;
+ string[] fileEntries = Directory.GetFiles(slogger.Folder, "*.log");
+ Assert.AreEqual(1, fileEntries.Count());
+
+ sessionlogger.CreateSession();
+ manager.Log($"This is a test 2");
+ Thread.Sleep(300);
+ fileEntries = Directory.GetFiles(slogger.Folder, "*.log");
+ Assert.AreEqual(1, fileEntries.Count());
+ }
+ }
+}
diff --git a/Software/Visual_Studio/Tango.UnitTesting/Tango.UnitTesting.csproj b/Software/Visual_Studio/Tango.UnitTesting/Tango.UnitTesting.csproj
index 05daac6c7..01e639a75 100644
--- a/Software/Visual_Studio/Tango.UnitTesting/Tango.UnitTesting.csproj
+++ b/Software/Visual_Studio/Tango.UnitTesting/Tango.UnitTesting.csproj
@@ -140,6 +140,7 @@
<Compile Include="BL\HardwareConfiguration_TST.cs" />
<Compile Include="Integration\JobDescriptionFile_TST.cs" />
<Compile Include="Logging\Parsing_TST.cs" />
+ <Compile Include="Logging\SessionLoging_TST.cs" />
<Compile Include="MachineService\PPC_Controller_TST.cs" />
<Compile Include="MachineStudio\MachineStudio_TST.cs" />
<Compile Include="Pulse\Pulse_TST.cs" />
@@ -309,7 +310,7 @@
<Import Project="..\packages\System.Data.SQLite.Core.1.0.108.0\build\net46\System.Data.SQLite.Core.targets" Condition="Exists('..\packages\System.Data.SQLite.Core.1.0.108.0\build\net46\System.Data.SQLite.Core.targets')" />
<ProjectExtensions>
<VisualStudio>
- <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" />
+ <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" />
</VisualStudio>
</ProjectExtensions>
</Project> \ No newline at end of file