DeviceInfo.cs 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  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 bool _enableXY;
  47. /// <summary>
  48. /// 是否启用锁螺丝XY超限 通讯功能,默认不启用
  49. /// </summary>
  50. public bool EnableXY { get => _enableXY; set => SetProperty(ref _enableXY, value); }
  51. private string _mesUrl;
  52. /// <summary>
  53. /// URL
  54. /// </summary>
  55. public string MesUrl { get => _mesUrl; set => SetProperty(ref _mesUrl, value); }
  56. private string _LogUrl;
  57. /// <summary>
  58. /// log的url
  59. /// </summary>
  60. public string LogUrl { get => _LogUrl; set => SetProperty(ref _LogUrl, value); }
  61. private string _ApiKey;
  62. /// <summary>
  63. /// ApiKey
  64. /// </summary>
  65. public string ApiKey { get => _ApiKey; set => SetProperty(ref _ApiKey, value); }
  66. private string _f;
  67. /// <summary>
  68. /// 全局function参数,传模块,组装站PQC检测组装的传PTL
  69. /// f=PTL
  70. /// </summary>
  71. public string F { get => _f; set => SetProperty(ref _f, value); }
  72. private string _comp;
  73. /// <summary>
  74. /// 此参数只有包装站是必传,其他组装站不用传,格式是部件名:部件编码,多个时用英文逗号隔开
  75. /// comp=battery1:B00012345,battery2:B00022355
  76. /// </summary>
  77. public string comp { get => _comp; set => SetProperty(ref _comp, value); }
  78. private bool _saveCsv;
  79. /// <summary>
  80. /// 是否保存CSV文件,默认不保存
  81. /// </summary>
  82. public bool SaveCsv { get => _saveCsv; set => SetProperty(ref _saveCsv, value); }
  83. private bool _saveCsvPPID;
  84. /// <summary>
  85. /// 是否保存CSV文件的PPID,默认不保存
  86. /// </summary>
  87. public bool SaveCsvPPID { get => _saveCsvPPID; set => SetProperty(ref _saveCsvPPID, value); }
  88. private string _saveCsvPath;
  89. /// <summary>
  90. /// 保存的CSV文件路径
  91. /// </summary>
  92. public string SaveCsvPath { get => _saveCsvPath; set => SetProperty(ref _saveCsvPath, value); }
  93. //private bool _enableDoubleMes;
  94. ///// <summary>
  95. ///// 是否启用两次产品编号MES获取,默认不启用
  96. ///// </summary>
  97. //public bool EnableDoubleMes { get => _enableDoubleMes; set => SetProperty(ref _enableDoubleMes, value); }
  98. private CTQ_Data _dataInfo = new CTQ_Data();
  99. public CTQ_Data DataInfo
  100. {
  101. get { return _dataInfo; }
  102. set { SetProperty(ref _dataInfo, value); }
  103. }
  104. public DeviceInfo()
  105. {
  106. DeviceNo = 0;
  107. Line = string.Empty;
  108. Station = string.Empty;
  109. FixtureId = string.Empty;
  110. F = string.Empty;
  111. comp = string.Empty;
  112. MesUrl = string.Empty;
  113. LogUrl = string.Empty;
  114. ApiKey = string.Empty;
  115. EnableMES = false;
  116. EnableXY = false;
  117. SaveCsvPPID = true;
  118. }
  119. public DeviceInfo Copy()
  120. {
  121. return new DeviceInfo
  122. {
  123. DeviceNo = this.DeviceNo,
  124. DeviceName = this.DeviceName,
  125. DeviceDesc = this.DeviceDesc,
  126. Line = this.Line,
  127. Station = this.Station,
  128. FixtureId = this.FixtureId,
  129. F = this.F,
  130. comp = this.comp,
  131. MesUrl = this.MesUrl,
  132. EnableMES = this.EnableMES,
  133. EnableXY = this.EnableXY,
  134. SaveCsv = this.SaveCsv,
  135. SaveCsvPath = this.SaveCsvPath,
  136. //EnableDoubleMes = this.EnableDoubleMes,
  137. DataInfo = this.DataInfo.Copy(),
  138. LogUrl = this.LogUrl,
  139. ApiKey = this.ApiKey,
  140. };
  141. }
  142. }
  143. }