DeviceData.cs 3.0 KB

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