终端一体化运控平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

65 lines
1.8 KiB

  1. using System;
  2. using System.Globalization;
  3. using System.Windows.Data;
  4. namespace BPASmartClient.Academy.Converter
  5. {
  6. public class RunStatusConvert : IValueConverter
  7. {
  8. public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
  9. {
  10. if (value is ushort tempValue)
  11. {
  12. if (tempValue == 1) return "等待配料";
  13. if (tempValue == 2) return "配料中";
  14. if (tempValue == 3) return "配料完成";
  15. }
  16. return "等待配料";
  17. }
  18. public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
  19. {
  20. throw new NotImplementedException();
  21. }
  22. }
  23. public class EnbleConvert : IValueConverter
  24. {
  25. public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
  26. {
  27. if (value is ushort tempValue)
  28. {
  29. if (tempValue == 0) return true;
  30. if (tempValue == 1) return false;
  31. }
  32. return true;
  33. }
  34. public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
  35. {
  36. throw new NotImplementedException();
  37. }
  38. }
  39. public class IntToSourceConvert : IValueConverter
  40. {
  41. public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
  42. {
  43. if (value is ushort tempValue)
  44. {
  45. if (tempValue == 0) return "本地原料";
  46. if (tempValue == 1) return "设备原料";
  47. }
  48. return "未知";
  49. }
  50. public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
  51. {
  52. throw new NotImplementedException();
  53. }
  54. }
  55. }