终端一体化运控平台
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 

48 行
1.8 KiB

  1. using BPASmartClient.Business;
  2. using BPASmartClient.Device;
  3. using BPASmartClient.EventBus;
  4. using BPASmartClient.Helper;
  5. using BPASmartClient.Message;
  6. using BPASmartClient.Model;
  7. using BPASmartClient.Model.乐白机器人;
  8. using BPASmartClient.Model.冰淇淋.Enum;
  9. using BPASmartClient.Model.单片机;
  10. using BPASmartClient.Model.单片机.Enum;
  11. using BPASmartClient.Model.咖啡机.Enum;
  12. using Microsoft.Toolkit.Mvvm.ComponentModel;
  13. using Microsoft.Toolkit.Mvvm.Input;
  14. using System;
  15. using System.Collections.Generic;
  16. using System.Collections.ObjectModel;
  17. using System.Linq;
  18. using System.Threading;
  19. namespace BPASmartClient.MorkTSingle.ViewModel;
  20. public class DebugViewModel : ObservableObject
  21. {
  22. public RelayCommand SimOrderMakeCoffee { get; set; }
  23. /// <summary>
  24. /// 设备ID
  25. /// </summary>
  26. public int DeviceId { get; set; }
  27. /// <summary>
  28. /// 设备数据
  29. /// </summary>
  30. public ObservableCollection<VariableMonitor> variableMonitors { get; set; }
  31. public List<string> Coffees { get; set; } = new List<string>();
  32. public string SimOrderCoffeeList { get { return _simOrderCoffeeList; } set { _simOrderCoffeeList = value; OnPropertyChanged(); } }
  33. public string _simOrderCoffeeList { get; set; }
  34. public DebugViewModel()
  35. {
  36. foreach (KLMDrinkFaultType code in Enum.GetValues(typeof(KLMDrinkFaultType)))
  37. {
  38. Coffees.Add(code.ToString());
  39. }
  40. SimOrderCoffeeList = Coffees[0];
  41. SimOrderMakeCoffee = new RelayCommand(() =>
  42. {
  43. new MorkTSimOrder() {KLMDrinkFaultCode = (KLMDrinkFaultType)Enum.Parse(typeof(KLMDrinkFaultType), SimOrderCoffeeList) }.Publish();
  44. });
  45. }
  46. }