diff options
| author | Avi Levkovich <avi@twine-s.com> | 2020-07-14 11:29:04 +0300 |
|---|---|---|
| committer | Avi Levkovich <avi@twine-s.com> | 2020-07-14 11:29:04 +0300 |
| commit | 38dc30f3a8fe7fe2cde7eb42cb72034e184bff07 (patch) | |
| tree | 08c94683cef5597a2b8fd3ab0f24b726a5cce41c /Software/Visual_Studio/PPC/Modules | |
| parent | b623c6e78500795ad42ea7b694a309510fac3600 (diff) | |
| parent | bab76eb6e2eb3d130c5802cea08fd405c599c17b (diff) | |
| download | Tango-38dc30f3a8fe7fe2cde7eb42cb72034e184bff07.tar.gz Tango-38dc30f3a8fe7fe2cde7eb42cb72034e184bff07.zip | |
Merge branch 'master' of https://twinetfs.visualstudio.com/_git/Tango
Diffstat (limited to 'Software/Visual_Studio/PPC/Modules')
4 files changed, 45 insertions, 10 deletions
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Converters/LiquidTypeToShortNameConverter.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Converters/LiquidTypeToShortNameConverter.cs new file mode 100644 index 000000000..15041bf17 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/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; + +namespace Tango.PPC.Maintenance.Converters +{ + class LiquidTypeToShortNameConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + if (value is LiquidType) + { + LiquidType type = value as LiquidType; + switch (type.Type) + { + case BL.Enumerations.LiquidTypes.Cleaner: + return "CL"; + case BL.Enumerations.LiquidTypes.TransparentInk: + return "TI"; + case BL.Enumerations.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/PPC/Modules/Tango.PPC.Maintenance/Converters/StringToFirstLetterConverter.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Converters/StringToFirstLetterConverter.cs index 5418b5cf5..0922af78d 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Converters/StringToFirstLetterConverter.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Converters/StringToFirstLetterConverter.cs @@ -14,14 +14,6 @@ namespace Tango.PPC.Maintenance.Converters { if (value != null && value.ToString().Length > 1) { - if (value.ToString() == "Cleaner") - return "CL"; - else if (value.ToString() == "Transparent Ink") - return "TI"; - else if(value.ToString() == "Black") - { - return "K"; - } return value.ToString().First().ToString(); } else 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 7e5c52725..70939e4ae 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 @@ -118,6 +118,7 @@ <Compile Include="Commands\ResetThreadLoadingCommand.cs" /> <Compile Include="Controls\StateTouchButton.cs" /> <Compile Include="Converters\LiquidTypeToBrushConverter.cs" /> + <Compile Include="Converters\LiquidTypeToShortNameConverter.cs" /> <Compile Include="Converters\MidTankLevelToElementHeightConverter.cs" /> <Compile Include="Converters\StringToFirstLetterConverter.cs" /> <Compile Include="Dialogs\HeadCleaningView.xaml.cs"> @@ -293,7 +294,7 @@ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <ProjectExtensions> <VisualStudio> - <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" /> + <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" /> </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 2216c47d8..d51f0eb38 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 @@ -18,6 +18,7 @@ <localConverters:StringToFirstLetterConverter x:Key="StringToFirstLetterConverter" /> <localConverters:MidTankLevelToElementHeightConverter x:Key="MidTankLevelToElementHeightConverter" /> <localConverters:LiquidTypeToBrushConverter x:Key="LiquidTypeToBrushConverter" /> + <localConverters:LiquidTypeToShortNameConverter x:Key="LiquidTypeToShortNameConverter"/> <Style TargetType="FrameworkElement" x:Key="Level1Container"> <Setter Property="Margin" Value="20 15 60 15"></Setter> @@ -31,7 +32,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="20" Margin="1 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> |
