123456789101112131415161718192021222324252627 |
- using System;
- using System.Windows.Data;
- namespace CyberX8_MainPages.Converters
- {
- public class MFCErrorConverters : IMultiValueConverter
- {
- public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)
- {
- float setPoint = (float)(values[0]);
- float calculate = (float)(values[1]);
- if (calculate == 0)
- {
- return "0";
- }
- float deviation = (Math.Abs(calculate) - Math.Abs(setPoint)) / Math.Abs(setPoint) * 100;
-
- return deviation.ToString();
- }
- public object[] ConvertBack(object value, Type[] targetTypes, object parameter, System.Globalization.CultureInfo culture)
- {
- throw new NotImplementedException();
- }
- }
- }
|