DeviceInfo.cs 5.5 KB

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