RealtimeData.cs 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. using CommunityToolkit.Mvvm.ComponentModel;
  2. using UICommon.DataType;
  3. namespace DataVM;
  4. public partial class RealtimeData : ObservableObject
  5. {
  6. public RealtimeData()
  7. {
  8. this.FakeData();
  9. }
  10. [ObservableProperty]
  11. private ObservableDictionary<string, GasDataVM>? _GasData;
  12. [ObservableProperty]
  13. private JobDataVM? _JobData1;
  14. [ObservableProperty]
  15. private JobDataVM? _JobData2;
  16. [ObservableProperty]
  17. private N2PurgeDataVM? _N2PurgeData;
  18. [ObservableProperty]
  19. private PressureDataVM? _PressureData;
  20. [ObservableProperty]
  21. private RecipeDisplayVM? _RecipeDisplay;
  22. [ObservableProperty]
  23. private ObservableDictionary<string, DataTemperatureVM>? _TempCollection;
  24. private void FakeData()
  25. {
  26. GasData = new ObservableDictionary<string, GasDataVM>
  27. {
  28. ["VG21"] = new() { Name = "VG21", Actual = 0, Set = 0, Unit = "Torr" },
  29. ["VG22"] = new() { Name = "VG22", Actual = 0, Set = 0, Unit = "Torr" },
  30. ["MFC1"] = new() { Name = "MFC1", Actual = 0, Set = 0, Unit = "SLM" },
  31. ["MFC2"] = new() { Name = "MFC2", Actual = 0, Set = 0, Unit = "SLM" },
  32. };
  33. JobData1 = new()
  34. {
  35. CJobStatus = "Executing",
  36. ID = "CJob1",
  37. JobStatus = "Charging",
  38. ScheduleEndTime = DateTime.Now.AddMinutes(12),
  39. };
  40. JobData2 = new()
  41. {
  42. ID = "CJob2",
  43. JobStatus = "Waiting",
  44. ScheduleEndTime = DateTime.Now.AddMinutes(32),
  45. };
  46. N2PurgeData = new()
  47. {
  48. N2PurgeStatus = "Undefined",
  49. O2DensityCtrlStatus = "Unknow",
  50. O2Position="LA N2",
  51. O2Denstiy = 0,
  52. O2Limit=0,
  53. N2Current = 0,
  54. N2Total = 0,
  55. };
  56. PressureData = new()
  57. {
  58. Actual = 12,
  59. Unit = "Torr",
  60. Mode = "APC Control",
  61. Command = "Idle",
  62. APC = 10
  63. };
  64. RecipeDisplay = new RecipeDisplayVM()
  65. {
  66. ProcessRecipe = "HCD-SiN COAT-N2",
  67. ProcessRemainTime = new TimeSpan(0, 1, 22),
  68. HoldTime = new TimeSpan(0, 0, 12),
  69. StepName = "92:P HEAT1",
  70. StepRemainTime = new TimeSpan(0, 0, 31),
  71. NextStep = "19:B ROT",
  72. RecipeStartTime = DateTime.Now.AddHours(-1),
  73. RecipeEndTime = DateTime.Now.AddHours(2),
  74. LoopCount = "1/3",
  75. SubRecipe = "--",
  76. ProcessProgress = 42
  77. };
  78. TempCollection = new ObservableDictionary<string, DataTemperatureVM>
  79. {
  80. ["U"] = new() { Name = "U", Temp = 0 },
  81. ["CU"] = new() { Name = "CU", Temp = 0 },
  82. ["C"] = new() { Name = "C", Temp = 0 },
  83. ["CL"] = new() { Name = "CL", Temp = 0 },
  84. ["L"] = new() { Name = "L", Temp = 0 },
  85. ["SL"] = new() { Name = "SL", Temp = 0 }
  86. };
  87. }
  88. }
  89. public partial class GasDataVM : ObservableObject
  90. {
  91. [ObservableProperty]
  92. private string? _Name;
  93. [ObservableProperty]
  94. private float _Actual;
  95. [ObservableProperty]
  96. private float _Set;
  97. [ObservableProperty]
  98. private string? _Unit;
  99. }
  100. public partial class JobDataVM : ObservableObject
  101. {
  102. [ObservableProperty]
  103. private string? _CJobStatus;
  104. [ObservableProperty]
  105. private string? _ID;
  106. [ObservableProperty]
  107. private string? _JobStatus;
  108. [ObservableProperty]
  109. private DateTime _ScheduleEndTime;
  110. }
  111. public partial class N2PurgeDataVM : ObservableObject
  112. {
  113. [ObservableProperty]
  114. private string? _N2PurgeStatus;
  115. [ObservableProperty]
  116. private string? _O2DensityCtrlStatus;
  117. [ObservableProperty]
  118. private string? _O2Position;
  119. [ObservableProperty]
  120. private float _O2Denstiy;
  121. [ObservableProperty]
  122. private float _O2Limit;
  123. [ObservableProperty]
  124. private float _N2Current;
  125. [ObservableProperty]
  126. private float _N2Total;
  127. }
  128. public partial class PressureDataVM : ObservableObject
  129. {
  130. [ObservableProperty]
  131. private float _Actual;
  132. [ObservableProperty]
  133. private string? _Unit;
  134. [ObservableProperty]
  135. private string? _Mode;
  136. [ObservableProperty]
  137. private string? _Command;
  138. [ObservableProperty]
  139. private float _APC;
  140. }
  141. public partial class RecipeDisplayVM : ObservableObject
  142. {
  143. [ObservableProperty]
  144. private string? _ProcessRecipe;
  145. [ObservableProperty]
  146. private TimeSpan? _ProcessRemainTime;
  147. [ObservableProperty]
  148. private TimeSpan? _HoldTime;
  149. [ObservableProperty]
  150. private string? _StepName;
  151. [ObservableProperty]
  152. private TimeSpan? _StepRemainTime;
  153. [ObservableProperty]
  154. private string? _NextStep;
  155. [ObservableProperty]
  156. private DateTime? _RecipeStartTime;
  157. [ObservableProperty]
  158. private DateTime? _RecipeEndTime;
  159. [ObservableProperty]
  160. private string? _LoopCount;
  161. [ObservableProperty]
  162. private string? _SubRecipe;
  163. [ObservableProperty]
  164. private float? _ProcessProgress;
  165. }
  166. public partial class DataTemperatureVM : ObservableObject
  167. {
  168. [ObservableProperty]
  169. private string? _Name;
  170. [ObservableProperty]
  171. private float _Temp;
  172. }