终端一体化运控平台
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

69 lines
2.0 KiB

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