aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio
diff options
context:
space:
mode:
authorRoy Ben Shabat <Roy.mail.net@gmail.com>2020-09-04 15:09:55 +0300
committerRoy Ben Shabat <Roy.mail.net@gmail.com>2020-09-04 15:09:55 +0300
commita68e224066b0c39bafb811be86ea736418db59df (patch)
tree85ca37a034ae1f7d65c7a22c5029cb6de7e17ad5 /Software/Visual_Studio
parent8b37029055458931f7e46f9d959803a86c3223b9 (diff)
downloadTango-a68e224066b0c39bafb811be86ea736418db59df.tar.gz
Tango-a68e224066b0c39bafb811be86ea736418db59df.zip
Fixed issue with Mid Tanks levels naming convention.
Diffstat (limited to 'Software/Visual_Studio')
-rw-r--r--Software/Visual_Studio/FSE/Tango.FSE.Common/Converters/LiquidTypeToShortNameConverter.cs41
-rw-r--r--Software/Visual_Studio/FSE/Tango.FSE.Common/Resources/Converters.xaml1
-rw-r--r--Software/Visual_Studio/FSE/Tango.FSE.Common/Tango.FSE.Common.csproj1
-rw-r--r--Software/Visual_Studio/FSE/Tango.FSE.UI/Tiles/MidTankLevels/MidTankLevelsTileView.xaml6
4 files changed, 46 insertions, 3 deletions
diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/Converters/LiquidTypeToShortNameConverter.cs b/Software/Visual_Studio/FSE/Tango.FSE.Common/Converters/LiquidTypeToShortNameConverter.cs
new file mode 100644
index 000000000..8d783ae69
--- /dev/null
+++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/Converters/LiquidTypeToShortNameConverter.cs
@@ -0,0 +1,41 @@
+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;
+
+namespace Tango.FSE.Common.Converters
+{
+ public class LiquidTypeToShortNameConverter : IValueConverter
+ {
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ if (value is LiquidType type)
+ {
+ switch (type.Type)
+ {
+ case LiquidTypes.Cleaner:
+ return "CL";
+ case LiquidTypes.TransparentInk:
+ return "TI";
+ case LiquidTypes.Black:
+ return "K";
+ }
+ return type.Name.First().ToString();
+ }
+ else
+ {
+ return value;
+ }
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ throw new NotImplementedException();
+ }
+ }
+}
diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/Resources/Converters.xaml b/Software/Visual_Studio/FSE/Tango.FSE.Common/Resources/Converters.xaml
index 83481a9d7..dcc60e62c 100644
--- a/Software/Visual_Studio/FSE/Tango.FSE.Common/Resources/Converters.xaml
+++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/Resources/Converters.xaml
@@ -46,4 +46,5 @@
<localConverters:FilePathToIconConverter x:Key="FilePathToIconConverter" />
<converters:BooleanToYesNoConverter x:Key="BooleanToYesNoConverter" />
<converters:GenericMessageProtocolToStringConverter x:Key="GenericMessageProtocolToStringConverter" />
+ <localConverters:LiquidTypeToShortNameConverter x:Key="LiquidTypeToShortNameConverter" />
</ResourceDictionary> \ No newline at end of file
diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/Tango.FSE.Common.csproj b/Software/Visual_Studio/FSE/Tango.FSE.Common/Tango.FSE.Common.csproj
index 27112f654..9c67d0902 100644
--- a/Software/Visual_Studio/FSE/Tango.FSE.Common/Tango.FSE.Common.csproj
+++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/Tango.FSE.Common.csproj
@@ -184,6 +184,7 @@
<Compile Include="Converters\DoubleToChartValuesConverter.cs" />
<Compile Include="Converters\FilePathToIconConverter.cs" />
<Compile Include="Converters\JobProgressToPositionConverter.cs" />
+ <Compile Include="Converters\LiquidTypeToShortNameConverter.cs" />
<Compile Include="Converters\TimeSpanHumanizeConverter.cs" />
<Compile Include="Core\FSEProgress.cs" />
<Compile Include="DashboardTile.cs" />
diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Tiles/MidTankLevels/MidTankLevelsTileView.xaml b/Software/Visual_Studio/FSE/Tango.FSE.UI/Tiles/MidTankLevels/MidTankLevelsTileView.xaml
index fa3a5f853..e2b7f69b2 100644
--- a/Software/Visual_Studio/FSE/Tango.FSE.UI/Tiles/MidTankLevels/MidTankLevelsTileView.xaml
+++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Tiles/MidTankLevels/MidTankLevelsTileView.xaml
@@ -17,7 +17,7 @@
<DataTemplate x:Key="LiquidBox">
<DockPanel>
- <TextBlock DockPanel.Dock="Top" Text="{Binding IDSPack.LiquidType.Name,Converter={StaticResource StringToFirstLetterConverter}}" HorizontalAlignment="Center"></TextBlock>
+ <TextBlock DockPanel.Dock="Top" Text="{Binding IDSPack.LiquidType,Converter={StaticResource LiquidTypeToShortNameConverter}}" HorizontalAlignment="Center"></TextBlock>
<Grid MaxWidth="50" Margin="5 0" ToolTip="{Binding IDSPack.LiquidType.Name}" Background="Transparent">
<material:PackIcon Kind="MapMarker" Width="20" Height="20" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0 0 0 10" Foreground ="{Binding Path=IDSPack.LiquidType, Converter={StaticResource LiquidTypeToBrushConverter}}">
<material:PackIcon.Style>
@@ -47,8 +47,8 @@
</material:PackIcon.Style>
</material:PackIcon>
<Border BorderThickness="1" Background="{StaticResource FSE_PrimaryBackgroundDarkBrush}" BorderBrush="{StaticResource FSE_BorderBrush}" CornerRadius="3" ClipToBounds="True" x:Name="pathBorder">
- <Canvas Width="50" ClipToBounds="True">
- <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="135" Width="46" Stretch="Fill"
+ <Canvas ClipToBounds="True" Margin="1 1 1 1">
+ <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="135" Width="38" Stretch="Fill"
Canvas.Left="0" Fill="{Binding Path=IDSPack.LiquidType, Converter={StaticResource LiquidTypeToBrushConverter}}" Margin="0 -14 0 0" >
<Path.Style>