终端一体化运控平台
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.
 
 
 

125 lines
3.5 KiB

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using Microsoft.Toolkit.Mvvm.ComponentModel;
  7. using System.Collections.ObjectModel;
  8. namespace BPASmartClient.ViewModel.Model
  9. {
  10. /// <summary>
  11. /// 店铺设备
  12. /// </summary>
  13. public class DeviceConfigModel : ObservableObject
  14. {
  15. /// <summary>
  16. /// 店铺名称
  17. /// </summary>
  18. public string ShopName { get { return _mShopName; } set { _mShopName = value; OnPropertyChanged(); } }
  19. private string _mShopName = string.Empty;
  20. /// <summary>
  21. /// 店铺ID
  22. /// </summary>
  23. public string ShopId { get { return _mShopId; } set { _mShopId = value; OnPropertyChanged(); } }
  24. private string _mShopId = string.Empty;
  25. /// <summary>
  26. /// 设备集合
  27. /// </summary>
  28. public ObservableCollection<DeviceModel> deviceModels = new ObservableCollection<DeviceModel>();
  29. }
  30. /// <summary>
  31. /// 启动模块
  32. /// </summary>
  33. public class DeviceModel : ObservableObject
  34. {
  35. /// <summary>
  36. /// 设备名称
  37. /// </summary>
  38. public string DeviceName { get { return _mDeviceName; } set { _mDeviceName = value; OnPropertyChanged(); } }
  39. private string _mDeviceName = string.Empty;
  40. /// <summary>
  41. /// 启动设备模块
  42. /// </summary>
  43. public string DeviceModule { get { return _mDeviceModule; } set { _mDeviceModule = value; OnPropertyChanged(); } }
  44. private string _mDeviceModule = string.Empty;
  45. /// <summary>
  46. /// 设备ID
  47. /// </summary>
  48. public string DeviceId { get { return _mDeviceId; } set { _mDeviceId = value; OnPropertyChanged(); } }
  49. private string _mDeviceId = string.Empty;
  50. /// <summary>
  51. /// 通讯模块
  52. /// </summary>
  53. public ObservableCollection<CommunicationModel> communicationDevcies = new ObservableCollection<CommunicationModel>();
  54. }
  55. /// <summary>
  56. /// 通讯模块
  57. /// </summary>
  58. public class CommunicationModel : ObservableObject
  59. {
  60. /// <summary>
  61. /// 通讯启动模块
  62. /// </summary>
  63. public string CommunicationModule { get { return _mCommunicationModule; } set { _mCommunicationModule = value; OnPropertyChanged(); } }
  64. private string _mCommunicationModule = string.Empty;
  65. }
  66. /// <summary>
  67. /// 通讯参数
  68. /// </summary>
  69. public class CommunicationPar : ObservableObject
  70. {
  71. public CommunicationParType communicationType { get { return _mcommunicationType; } set { _mcommunicationType = value; OnPropertyChanged(); } }
  72. private CommunicationParType _mcommunicationType;
  73. public string CommunicationValue { get { return _mCommunicationValue; } set { _mCommunicationValue = value; OnPropertyChanged(); } }
  74. private string _mCommunicationValue = string.Empty;
  75. }
  76. public enum CommunicationParType
  77. {
  78. /// <summary>
  79. /// IP地址
  80. /// </summary>
  81. IPAddress,
  82. /// <summary>
  83. /// 端口号
  84. /// </summary>
  85. Port,
  86. /// <summary>
  87. /// 串口端口号
  88. /// </summary>
  89. SerialPort,
  90. /// <summary>
  91. /// 波特率
  92. /// </summary>
  93. BaudRate,
  94. /// <summary>
  95. /// 数据位
  96. /// </summary>
  97. DataBits,
  98. /// <summary>
  99. /// 停止位
  100. /// </summary>
  101. StopBits,
  102. /// <summary>
  103. /// 校验位
  104. /// </summary>
  105. Parity,
  106. }
  107. }