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

2 роки тому
2 роки тому
2 роки тому
2 роки тому
2 роки тому
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. using Microsoft.Toolkit.Mvvm.ComponentModel;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Collections.ObjectModel;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. namespace BPASmartClient.Model
  9. {
  10. /// <summary>
  11. /// 店铺设备
  12. /// </summary>
  13. public class DeviceConfigModelJson : 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 { get; set; } = 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. public string DeviceNamespace { get; set; }
  46. public string Id { get { return _mId; } set { _mId = value; OnPropertyChanged(); } }
  47. private string _mId = string.Empty;
  48. /// <summary>
  49. /// 设备ID
  50. /// </summary>
  51. public string DeviceId { get { return _mDeviceId; } set { _mDeviceId = value; OnPropertyChanged(); } }
  52. private string _mDeviceId = string.Empty;
  53. /// <summary>
  54. /// 通讯模块
  55. /// </summary>
  56. public ObservableCollection<CommunicationModel> communicationDevcies { get; set; } = new ObservableCollection<CommunicationModel>();
  57. }
  58. /// <summary>
  59. /// 通讯模块
  60. /// </summary>
  61. public class CommunicationModel : ObservableObject
  62. {
  63. /// <summary>
  64. /// 通讯启动模块
  65. /// </summary>
  66. public string CommunicationModule { get { return _mCommunicationModule; } set { _mCommunicationModule = value; OnPropertyChanged(); } }
  67. private string _mCommunicationModule = string.Empty;
  68. public string CommunicationNamespace { get; set; }
  69. public string CommunicationName { get { return _mCommunicationName; } set { _mCommunicationName = value; OnPropertyChanged(); } }
  70. private string _mCommunicationName = string.Empty;
  71. public string DeviceModelId { get { return _mDeviceModelId; } set { _mDeviceModelId = value; OnPropertyChanged(); } }
  72. private string _mDeviceModelId = string.Empty;
  73. public CommunicationPar communicationPar { get { return _mcommunicationPar; } set { _mcommunicationPar = value; OnPropertyChanged(); } }
  74. private CommunicationPar _mcommunicationPar = new CommunicationPar();
  75. public ObservableCollection<Variable> variables { get; set; } = new ObservableCollection<Variable>();
  76. }
  77. /// <summary>
  78. /// 通讯参数
  79. /// </summary>
  80. public class CommunicationPar : ObservableObject
  81. {
  82. /// <summary>
  83. /// 选择网口通讯
  84. /// </summary>
  85. public bool IsNetworkPort { get { return _mIsNetworkPort; } set { _mIsNetworkPort = value; OnPropertyChanged(); } }
  86. private bool _mIsNetworkPort = false;
  87. /// <summary>
  88. /// 选择串口通讯
  89. /// </summary>
  90. public bool IsSerialPort { get { return _mIsSerialPort; } set { _mIsSerialPort = value; OnPropertyChanged(); } }
  91. private bool _mIsSerialPort = true;
  92. /// <summary>
  93. /// IP地址
  94. /// </summary>
  95. public string IPAddress { get { return _mIPAddress; } set { _mIPAddress = value; OnPropertyChanged(); } }
  96. private string _mIPAddress;
  97. /// <summary>
  98. /// IP 端口号
  99. /// </summary>
  100. public int IPPort { get { return _mIPPort; } set { _mIPPort = value; OnPropertyChanged(); } }
  101. private int _mIPPort;
  102. /// <summary>
  103. /// ip 串口 站号
  104. /// </summary>
  105. public int StationNo { get { return _mStationNo; } set { _mStationNo = value; OnPropertyChanged(); } }
  106. private int _mStationNo;
  107. /// <summary>
  108. /// 串口单口号
  109. /// </summary>
  110. public string SerialPort { get { return _mSerialPort; } set { _mSerialPort = value; OnPropertyChanged(); } }
  111. private string _mSerialPort;
  112. /// <summary>
  113. /// 波特率
  114. /// </summary>
  115. public int BaudRate { get { return _mBaudRate; } set { _mBaudRate = value; OnPropertyChanged(); } }
  116. private int _mBaudRate;
  117. /// <summary>
  118. /// 数据位
  119. /// </summary>
  120. public int DataBits { get { return _mDataBits; } set { _mDataBits = value; OnPropertyChanged(); } }
  121. private int _mDataBits = 8;
  122. /// <summary>
  123. /// 停止位
  124. /// </summary>
  125. public string StopBits { get { return _mStopBits; } set { _mStopBits = value; OnPropertyChanged(); } }
  126. private string _mStopBits = "1";
  127. /// <summary>
  128. /// 校验位
  129. /// </summary>
  130. public string Parity { get { return _mParity; } set { _mParity = value; OnPropertyChanged(); } }
  131. private string _mParity;
  132. //public ObservableCollection<Variable> variables { get; set; } = new ObservableCollection<Variable>();
  133. }
  134. public class Variable : ObservableObject
  135. {
  136. public int Id { get { return _mId; } set { _mId = value; OnPropertyChanged(); } }
  137. private int _mId;
  138. public string Address { get { return _mAddress; } set { _mAddress = value; OnPropertyChanged(); } }
  139. private string _mAddress;
  140. public int ReadLeng { get { return _mReadLeng; } set { _mReadLeng = value; OnPropertyChanged(); } }
  141. private int _mReadLeng;
  142. }
  143. }