终端一体化运控平台
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 

69 строки
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.DosingSystem.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. }