DeviceData.cs 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. using System.Collections.ObjectModel;
  2. using System.Net.NetworkInformation;
  3. using CommunityToolkit.Mvvm.ComponentModel;
  4. using GeneralData;
  5. using UICommon.DataType;
  6. namespace GlobalData;
  7. public partial class DeviceData_VM : ObservableObject
  8. {
  9. public Guid DeviceId { get; set; }
  10. [ObservableProperty]
  11. private DeviceModel _DeviceModel;
  12. [ObservableProperty]
  13. private string? _DeviceStatus;
  14. [ObservableProperty]
  15. public ObservableDictionary<string, object> _OtherInfo = [];
  16. [ObservableProperty]
  17. private RecipeInfo_VM? _RecipeInfo;
  18. [ObservableProperty]
  19. private ObservableCollection<Alarm_VM>? _Alarms;
  20. partial void OnAlarmsChanged(ObservableCollection<Alarm_VM>? value)
  21. {
  22. if (this.Alarms is null)
  23. return;
  24. this.Alarms.CollectionChanged -= Alarms_CollectionChanged;
  25. this.Alarms.CollectionChanged += Alarms_CollectionChanged;
  26. }
  27. private void Alarms_CollectionChanged(object? sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
  28. {
  29. if (sender is not ObservableCollection<Alarm_VM> value)
  30. {
  31. this.AlarmCount = 0;
  32. return;
  33. }
  34. this.AlarmCount = value.Count;
  35. }
  36. [ObservableProperty]
  37. private int _AlarmCount;
  38. }
  39. public enum PMCMode
  40. {
  41. Undefined,
  42. Running
  43. }
  44. public enum DeviceStatus
  45. {
  46. Init = 0,
  47. Initializing,
  48. Idle,
  49. Transfer,
  50. AutoRunning,
  51. AutoIdel = 5,
  52. ReturnAllWafer,
  53. Error,
  54. Loading,
  55. Unloading,
  56. ChargeProcessDischarging = 10,
  57. LoadProcessStockering,
  58. LoadProcessUnloading,
  59. ReutrnWafer
  60. }
  61. public enum TubeStatus
  62. {
  63. NotInstall,
  64. NotConnected,
  65. Init,
  66. Idle,
  67. Homing,
  68. OpenSlitValve,
  69. CloseSlitValve,
  70. Error,
  71. PrepareTransfer,
  72. PostTransfer,
  73. PreProcess,
  74. PostProcess,
  75. Process,
  76. LeakCheck,
  77. MFCCali,
  78. Pauded,
  79. InTransfer
  80. }
  81. public enum RecipeType
  82. {
  83. Undefined,
  84. PorcessRecipe,
  85. SubRecipe,
  86. AlarmRecipe,
  87. AbortRecipe,
  88. ResetRecipe,
  89. IdleRecipe,
  90. LayoutRecipe,
  91. JobRecipe
  92. }
  93. public partial class Alarm_VM : ObservableObject
  94. {
  95. public Guid DeviceId { get; set; }
  96. [ObservableProperty]
  97. private string? _AlarmCode;
  98. [ObservableProperty]
  99. private DateTime _AlarmTime;
  100. [ObservableProperty]
  101. private string? _AlarmName;
  102. }
  103. public partial class RecipeInfo_VM : ObservableObject
  104. {
  105. public Guid DeviceId { get; set; }
  106. //[ObservableProperty]
  107. //private RecipeType _RecipeType;
  108. //[ObservableProperty]
  109. //private string? _PJobID;
  110. //[ObservableProperty]
  111. //private string? _CJboID;
  112. [ObservableProperty]
  113. public ObservableDictionary<string, object> _RecipeInfo = [];
  114. [ObservableProperty]
  115. private string? _CurrentStepName;
  116. [ObservableProperty]
  117. private string? _NextStepName;
  118. [ObservableProperty]
  119. private int? _CurrentStepRemainTime;
  120. [ObservableProperty]
  121. private int? _CurrentStepTotalTime;
  122. [ObservableProperty]
  123. private int? _TotalTime;
  124. [ObservableProperty]
  125. private int? _TotalRemainTime;
  126. }