DeviceInfo.cs 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. using Prism.Mvvm;
  2. using System;
  3. using System.Windows;
  4. namespace TeamAAS_VP.Models
  5. {
  6. /// <summary>
  7. /// 设备信息配置,用于保存线别/站点/机台以及 MES 上传设置。
  8. /// </summary>
  9. public class DeviceInfo : BindableBase
  10. {
  11. private int _deviceNo;
  12. /// <summary>
  13. /// 设备编号,从0开始
  14. /// </summary>
  15. public int DeviceNo { get => _deviceNo; set => SetProperty(ref _deviceNo, value); }
  16. private string _deviceName;
  17. /// <summary>
  18. /// 设备名称
  19. /// </summary>
  20. public string DeviceName { get => _deviceName; set => SetProperty(ref _deviceName, value); }
  21. private string _deviceDesc;
  22. /// <summary>
  23. /// 设备描述
  24. /// </summary>
  25. public string DeviceDesc { get => _deviceDesc; set => SetProperty(ref _deviceDesc, value); }
  26. private string _line;
  27. /// <summary>
  28. /// 当前作业的线别
  29. /// </summary>
  30. public string Line { get => _line; set => SetProperty(ref _line, value); }
  31. private string _station;
  32. /// <summary>
  33. /// 当前作业的站点
  34. /// </summary>
  35. public string Station { get => _station; set => SetProperty(ref _station, value); }
  36. private string _fixtureId;
  37. /// <summary>
  38. /// 当前作业的机台编号
  39. /// </summary>
  40. public string FixtureId { get => _fixtureId; set => SetProperty(ref _fixtureId, value); }
  41. private bool _enableMes;
  42. /// <summary>
  43. /// 是否启用 MES 通讯功能
  44. /// </summary>
  45. public bool EnableMES { get => _enableMes; set => SetProperty(ref _enableMes, value); }
  46. private string _mesUrl;
  47. /// <summary>
  48. /// URL
  49. /// </summary>
  50. public string MesUrl { get => _mesUrl; set => SetProperty(ref _mesUrl, value); }
  51. private string _f;
  52. /// <summary>
  53. /// 全局function参数,传模块,组装站PQC检测组装的传PTL
  54. /// f=PTL
  55. /// </summary>
  56. public string F { get => _f; set => SetProperty(ref _f, value); }
  57. private string _comp;
  58. /// <summary>
  59. /// 此参数只有包装站是必传,其他组装站不用传,格式是部件名:部件编码,多个时用英文逗号隔开
  60. /// comp=battery1:B00012345,battery2:B00022355
  61. /// </summary>
  62. public string comp { get => _comp; set => SetProperty(ref _comp, value); }
  63. private string _XnSN;
  64. /// <summary>
  65. /// 虚拟SN
  66. ///
  67. /// </summary>
  68. public string XnSN { get => _XnSN; set => SetProperty(ref _XnSN, value); }
  69. private bool _saveCsv;
  70. /// <summary>
  71. /// 是否保存CSV文件,默认不保存
  72. /// </summary>
  73. public bool SaveCsv { get => _saveCsv; set => SetProperty(ref _saveCsv, value); }
  74. private bool _saveCsvPPID;
  75. /// <summary>
  76. /// 是否保存CSV文件的PPID,默认不保存
  77. /// </summary>
  78. public bool SaveCsvPPID { get => _saveCsvPPID; set => SetProperty(ref _saveCsvPPID, value); }
  79. private bool _SaveCsvkeyData;
  80. /// <summary>
  81. /// 是否保存键盘相邻键差值,默认不保存
  82. /// </summary>
  83. public bool SaveCsvkeyData { get => _SaveCsvkeyData; set => SetProperty(ref _SaveCsvkeyData, value); }
  84. private string _saveCsvPath;
  85. /// <summary>
  86. /// 保存的CSV文件路径
  87. /// </summary>
  88. public string SaveCsvPath { get => _saveCsvPath; set => SetProperty(ref _saveCsvPath, value); }
  89. private bool _enableDoubleMes;
  90. /// <summary>
  91. /// 是否启用两次产品编号MES获取,默认不启用
  92. /// </summary>
  93. public bool EnableDoubleMes { get => _enableDoubleMes; set => SetProperty(ref _enableDoubleMes, value); }
  94. private CTQ_Data _dataInfo = new CTQ_Data();
  95. public CTQ_Data DataInfo
  96. {
  97. get { return _dataInfo; }
  98. set { SetProperty(ref _dataInfo, value); }
  99. }
  100. private string _LogUrl;
  101. /// <summary>
  102. /// log的url
  103. /// </summary>
  104. public string LogUrl { get => _LogUrl; set => SetProperty(ref _LogUrl, value); }
  105. private string _ApiKey;
  106. /// <summary>
  107. /// ApiKey
  108. /// </summary>
  109. public string ApiKey { get => _ApiKey; set => SetProperty(ref _ApiKey, value); }
  110. public DeviceInfo()
  111. {
  112. DeviceNo = 0;
  113. Line = string.Empty;
  114. Station = string.Empty;
  115. FixtureId = string.Empty;
  116. F = string.Empty;
  117. comp = string.Empty;
  118. MesUrl = string.Empty;
  119. LogUrl = string.Empty;
  120. ApiKey = string.Empty;
  121. EnableMES = false;
  122. XnSN = string.Empty;
  123. }
  124. public DeviceInfo Copy()
  125. {
  126. return new DeviceInfo
  127. {
  128. DeviceNo = this.DeviceNo,
  129. DeviceName = this.DeviceName,
  130. DeviceDesc = this.DeviceDesc,
  131. Line = this.Line,
  132. Station = this.Station,
  133. FixtureId = this.FixtureId,
  134. F = this.F,
  135. comp = this.comp,
  136. MesUrl = this.MesUrl,
  137. EnableMES = this.EnableMES,
  138. XnSN=this.XnSN,
  139. SaveCsv = this.SaveCsv,
  140. SaveCsvPath = this.SaveCsvPath,
  141. EnableDoubleMes = this.EnableDoubleMes,
  142. LogUrl = this.LogUrl,
  143. ApiKey= this.ApiKey,
  144. DataInfo = this.DataInfo.Copy()
  145. };
  146. }
  147. }
  148. }