DeviceInfo.cs 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  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 bool _saveCsv;
  65. /// <summary>
  66. /// 是否保存CSV文件,默认不保存
  67. /// </summary>
  68. public bool SaveCsv { get => _saveCsv; set => SetProperty(ref _saveCsv, value); }
  69. private bool _saveCsvPPID;
  70. /// <summary>
  71. /// 是否保存CSV文件的PPID,默认不保存
  72. /// </summary>
  73. public bool SaveCsvPPID { get => _saveCsvPPID; set => SetProperty(ref _saveCsvPPID, value); }
  74. private string _saveCsvPath;
  75. /// <summary>
  76. /// 保存的CSV文件路径
  77. /// </summary>
  78. public string SaveCsvPath { get => _saveCsvPath; set => SetProperty(ref _saveCsvPath, value); }
  79. private bool _enableDoubleMes;
  80. /// <summary>
  81. /// 是否启用两次产品编号MES获取,默认不启用
  82. /// </summary>
  83. public bool EnableDoubleMes { get => _enableDoubleMes; set => SetProperty(ref _enableDoubleMes, value); }
  84. private CTQ_Data _dataInfo = new CTQ_Data();
  85. public CTQ_Data DataInfo
  86. {
  87. get { return _dataInfo; }
  88. set { SetProperty(ref _dataInfo, value); }
  89. }
  90. private string _LogUrl;
  91. /// <summary>
  92. /// log的url
  93. /// </summary>
  94. public string LogUrl { get => _LogUrl; set => SetProperty(ref _LogUrl, value); }
  95. private string _ApiKey;
  96. /// <summary>
  97. /// ApiKey
  98. /// </summary>
  99. public string ApiKey { get => _ApiKey; set => SetProperty(ref _ApiKey, value); }
  100. public DeviceInfo()
  101. {
  102. DeviceNo = 0;
  103. Line = string.Empty;
  104. Station = string.Empty;
  105. FixtureId = string.Empty;
  106. F = string.Empty;
  107. comp = string.Empty;
  108. MesUrl = string.Empty;
  109. LogUrl = string.Empty;
  110. ApiKey = string.Empty;
  111. EnableMES = false;
  112. SaveCsvPPID = true;
  113. }
  114. public DeviceInfo Copy()
  115. {
  116. return new DeviceInfo
  117. {
  118. DeviceNo = this.DeviceNo,
  119. DeviceName = this.DeviceName,
  120. DeviceDesc = this.DeviceDesc,
  121. Line = this.Line,
  122. Station = this.Station,
  123. FixtureId = this.FixtureId,
  124. F = this.F,
  125. comp = this.comp,
  126. MesUrl = this.MesUrl,
  127. EnableMES = this.EnableMES,
  128. SaveCsv = this.SaveCsv,
  129. SaveCsvPath = this.SaveCsvPath,
  130. EnableDoubleMes = this.EnableDoubleMes,
  131. DataInfo = this.DataInfo.Copy(),
  132. LogUrl = this.LogUrl,
  133. ApiKey = this.ApiKey,
  134. };
  135. }
  136. }
  137. }