DeviceInfo.cs 4.9 KB

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