aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Converters
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Converters')
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Converters/LiquidTypeToBrushConverter.cs74
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Converters/LiquidTypeToShortNameConverter.cs41
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Converters/MidTankLevelToElementHeightConverter.cs34
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Converters/StringToFirstLetterConverter.cs30
4 files changed, 0 insertions, 179 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
deleted file mode 100644
index c33efdca6..000000000
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Converters/LiquidTypeToBrushConverter.cs
+++ /dev/null
@@ -1,74 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Globalization;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Windows;
-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;
- switch (type.Type)
- {
- case BL.Enumerations.LiquidTypes.Lubricant:
- {
-
- ImageBrush lubricantBrush = new ImageBrush() { Stretch = Stretch.None, TileMode = TileMode.Tile, ViewportUnits = BrushMappingMode.Absolute };
-
- BitmapSource bit_source = ResourceHelper.GetImageFromResources(@"Images/lubricant2.png");
- var targetBitmap = new WriteableBitmap(new TransformedBitmap(bit_source, new ScaleTransform(0.2, 0.2)));
- lubricantBrush.ImageSource = targetBitmap;
- lubricantBrush.Viewport = new System.Windows.Rect(2, 2, targetBitmap.Width, targetBitmap.Height);
- return lubricantBrush;
- }
- case BL.Enumerations.LiquidTypes.Cleaner:
- {
- ImageBrush cleanerBrush = new ImageBrush() { Stretch = Stretch.None, TileMode = TileMode.Tile, ViewportUnits = BrushMappingMode.Absolute };
- BitmapSource bit_source = ResourceHelper.GetImageFromResources(@"Images/cl-full.png");
- var targetBitmap = new WriteableBitmap(new TransformedBitmap(bit_source, new ScaleTransform(0.3, 0.3)));
-
- cleanerBrush.ImageSource = targetBitmap;
- cleanerBrush.Viewport = new System.Windows.Rect(0, 0, targetBitmap.Width, targetBitmap.Height);
- return cleanerBrush;
- }
- case BL.Enumerations.LiquidTypes.Yellow:
- {
- return new SolidColorBrush(Color.FromRgb(232, 225, 12));
- }
- case BL.Enumerations.LiquidTypes.Cyan:
- {
- return new SolidColorBrush(Color.FromRgb(22, 98, 235));
- }
- case BL.Enumerations.LiquidTypes.Magenta:
- {
- return new SolidColorBrush(Color.FromRgb(237, 0, 140));
- }
- }
-
-
- 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/LiquidTypeToShortNameConverter.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Converters/LiquidTypeToShortNameConverter.cs
deleted file mode 100644
index 15041bf17..000000000
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Converters/LiquidTypeToShortNameConverter.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-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/MidTankLevelToElementHeightConverter.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Converters/MidTankLevelToElementHeightConverter.cs
deleted file mode 100644
index 94d1ed8b8..000000000
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Converters/MidTankLevelToElementHeightConverter.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-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.Integration.Operation;
-
-namespace Tango.PPC.Maintenance.Converters
-{
- public class MidTankLevelToElementHeightConverter : IMultiValueConverter
- {
- public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
- {
- try
- {
- double parentActualHeight = (double)values[0];
- 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
- {
- return 0d;
- }
- }
-
- public object[] ConvertBack(object value, Type[] targetTypes, 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
deleted file mode 100644
index 0922af78d..000000000
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Converters/StringToFirstLetterConverter.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Globalization;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Windows.Data;
-
-namespace Tango.PPC.Maintenance.Converters
-{
- public class StringToFirstLetterConverter : IValueConverter
- {
- public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
- {
- if (value != null && value.ToString().Length > 1)
- {
- return value.ToString().First().ToString();
- }
- else
- {
- return value;
- }
- }
-
- public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
- {
- throw new NotImplementedException();
- }
- }
-}