diff options
| author | Victoria Plitt <Victoria.Plitt@twine-s.com> | 2023-03-30 19:41:54 +0300 |
|---|---|---|
| committer | Victoria Plitt <Victoria.Plitt@twine-s.com> | 2023-03-30 19:41:54 +0300 |
| commit | 3dcf3242705a7522617d4b5f7ca4d9b918e48ca5 (patch) | |
| tree | 29e6083fbe1f9778e14e9641bffcb7d4765e8b39 /Software/Visual_Studio/PPC/Tango.PPC.UI/Converters | |
| parent | c61d12100372054de07f6201c27c7755c7be35e8 (diff) | |
| download | Tango-3dcf3242705a7522617d4b5f7ca4d9b918e48ca5.tar.gz Tango-3dcf3242705a7522617d4b5f7ca4d9b918e48ca5.zip | |
Eureka PPC. GoToJob, Notifications, LengthWothSpool.
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/Converters')
| -rw-r--r-- | Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/LengthToWeightConverter.cs | 4 | ||||
| -rw-r--r-- | Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/LengthWithSpoolsConverter.cs | 33 |
2 files changed, 35 insertions, 2 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/LengthToWeightConverter.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/LengthToWeightConverter.cs index 32ba01ad2..d7e70b881 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/LengthToWeightConverter.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/LengthToWeightConverter.cs @@ -17,8 +17,8 @@ namespace Tango.PPC.UI.Converters { double length = System.Convert.ToDouble(values[0]); double coef = System.Convert.ToDouble(values[1]); - var weight = ((double)length * coef) / (1000 * 1000);//(kg) - + double spools = System.Convert.ToDouble(values[3]); + var weight = ((double)length * spools * coef) / (1000 * 1000);//(kg) return weight; } catch diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/LengthWithSpoolsConverter.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/LengthWithSpoolsConverter.cs new file mode 100644 index 000000000..48e9bce7b --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/LengthWithSpoolsConverter.cs @@ -0,0 +1,33 @@ +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; + +namespace Tango.PPC.UI.Converters +{ + public class LengthWithSpoolsConverter : IMultiValueConverter + { + public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) + { + try + { + double length = System.Convert.ToDouble(values[0]); + double spools = System.Convert.ToDouble(values[1]); + return length * spools; + } + catch + { + return 0d; + } + } + + public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} |
