GasPanelViewModel.cs 56 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406
  1. using Aitex.Core.Common.DeviceData;
  2. using Aitex.Core.RT.Log;
  3. using Aitex.Core.UI.ControlDataContext;
  4. using Aitex.Core.UI.MVVM;
  5. using Aitex.Core.Util;
  6. using FurnaceGasPanelUI.Models;
  7. using MECF.Framework.Common.DataCenter;
  8. using MECF.Framework.Common.OperationCenter;
  9. using MECF.Framework.UI.Core.Control;
  10. using MECF.Framework.UI.Core.ExtendedControls;
  11. using OpenSEMI.ClientBase;
  12. using System;
  13. using System.Collections.Generic;
  14. using System.Linq;
  15. using System.Windows;
  16. using System.Windows.Input;
  17. namespace FurnaceGasPanelUI.Views.Maintenances.TiN
  18. {
  19. public class GasPanelViewModel : ThermalGasPanelUIViewModelBase
  20. {
  21. public ICommand CmdSetMfcFlow { get; set; }
  22. public ICommand CmdSetMfmFlow { get; set; }
  23. public bool _ismanagerPermission = true;
  24. public Window WinOwner { get; set; }
  25. public bool IsManagerPermission
  26. {
  27. get
  28. {
  29. return _ismanagerPermission;
  30. }
  31. set
  32. {
  33. _ismanagerPermission = value;
  34. NotifyOfPropertyChange("IsManagerPermission");
  35. }
  36. }
  37. private bool _isRecipeEdit = false;
  38. private string backGroundStr = "#FFB0D1F1";
  39. public bool ManualEnable { get; set; } = true;
  40. public string ManualEnableColor
  41. {
  42. get
  43. {
  44. if (ManualEnable)
  45. {
  46. return "Green";
  47. }
  48. return backGroundStr;
  49. }
  50. }
  51. public void SwichManualEnable()
  52. {
  53. ManualEnable = true;
  54. }
  55. public void SwichMonitor()
  56. {
  57. ManualEnable = false;
  58. }
  59. public void SwichRecipe()
  60. {
  61. IsRecipeEdit = true;
  62. }
  63. public bool MonitorChecked { get; set; } = true;
  64. public bool ManualChecked { get; set; } = false;
  65. public bool IsRecipeEdit
  66. {
  67. get
  68. {
  69. return _isRecipeEdit;
  70. }
  71. set
  72. {
  73. _isRecipeEdit = value;
  74. NotifyOfPropertyChange("IsRecipeEdit");
  75. }
  76. }
  77. public bool EditTrue { get; set; } = false;
  78. [Subscription("PM1.SensorRecipeOK")]
  79. public AITSensorData SensorRecipeOK { get; set; }
  80. [Subscription("PM1.SensorPROCManualOK")]
  81. public AITSensorData SensorPROCManualOK { get; set; }
  82. [Subscription("System.VentValve.DeviceData")]
  83. public AITValveData VentValveData { get; set; }
  84. [Subscription("System.PumpValve.DeviceData")]
  85. public AITValveData PumpValveData { get; set; }
  86. [Subscription("PM1.SensorTubeATMPressure.DeviceData")]
  87. public AITSensorData SensorTubeATMPressure { get; set; }
  88. [Subscription("System.TubePressure.DeviceData")]
  89. public AITPressureMeterData TubePressureData { get; set; }
  90. [Subscription("PM1.SensorVAC1.Value")]
  91. public bool VAC1 { get; set; }
  92. [Subscription("PM1.SensorVAC2.Value")]
  93. public bool VAC2 { get; set; }
  94. [Subscription("PM1.SensorVAC3.Value")]
  95. public bool VAC3 { get; set; }
  96. [Subscription("PM1.SensorVAC4.Value")]
  97. public bool VAC4 { get; set; }
  98. [Subscription("PM1.SensorVAC5.Value")]
  99. public bool VAC5 { get; set; }
  100. [Subscription("PM1.SensorVAC6.Value")]
  101. public bool VAC6 { get; set; }
  102. [Subscription("PM1.SensorVAC7.Value")]
  103. public bool VAC7 { get; set; }
  104. [Subscription("PM1.SensorVAC8.Value")]
  105. public bool VAC8 { get; set; }
  106. [Subscription("PM1.SensorPS13LStatus.Value")]
  107. public bool VACATM { get; set; }
  108. [Subscription("PM1.SensorVACDEPOOK.Value")]
  109. public bool DEPOOK { get; set; }
  110. [Subscription("PM1.SensorVACHFOK.Value")]
  111. public bool HFClnOK { get; set; }
  112. [Subscription("PM1.SensorVACF2OK.Value")]
  113. public bool F2ClnOK { get; set; }
  114. #region Valves
  115. [Subscription("PM1.ValveAV1.DeviceData")] public AITValveData ValveAV1 { get; set; }
  116. [Subscription("PM1.ValveAV2.DeviceData")] public AITValveData ValveAV2 { get; set; }
  117. [Subscription("PM1.ValveAV3.DeviceData")] public AITValveData ValveAV3 { get; set; }
  118. [Subscription("PM1.ValveAV4.DeviceData")] public AITValveData ValveAV4 { get; set; }
  119. [Subscription("PM1.ValveAV5.DeviceData")] public AITValveData ValveAV5 { get; set; }
  120. [Subscription("PM1.ValveAV6.DeviceData")] public AITValveData ValveAV6 { get; set; }
  121. [Subscription("PM1.ValveAV7.DeviceData")] public AITValveData ValveAV7 { get; set; }
  122. [Subscription("PM1.ValveAV8.DeviceData")] public AITValveData ValveAV8 { get; set; }
  123. [Subscription("PM1.ValveAV9.DeviceData")] public AITValveData ValveAV9 { get; set; }
  124. [Subscription("PM1.ValveAV10.DeviceData")] public AITValveData ValveAV10 { get; set; }
  125. [Subscription("PM1.ValveAV11.DeviceData")] public AITValveData ValveAV11 { get; set; }
  126. [Subscription("PM1.ValveAV12.DeviceData")] public AITValveData ValveAV12 { get; set; }
  127. [Subscription("PM1.ValveAV13.DeviceData")] public AITValveData ValveAV13 { get; set; }
  128. [Subscription("PM1.ValveAV14.DeviceData")] public AITValveData ValveAV14 { get; set; }
  129. [Subscription("PM1.ValveAV15.DeviceData")] public AITValveData ValveAV15 { get; set; }
  130. [Subscription("PM1.ValveAV16.DeviceData")] public AITValveData ValveAV16 { get; set; }
  131. [Subscription("PM1.ValveAV17.DeviceData")] public AITValveData ValveAV17 { get; set; }
  132. [Subscription("PM1.ValveAV18.DeviceData")] public AITValveData ValveAV18 { get; set; }
  133. [Subscription("PM1.ValveAV19.DeviceData")] public AITValveData ValveAV19 { get; set; }
  134. [Subscription("PM1.ValveAV20.DeviceData")] public AITValveData ValveAV20 { get; set; }
  135. [Subscription("PM1.ValveAV21.DeviceData")] public AITValveData ValveAV21 { get; set; }
  136. [Subscription("PM1.ValveAV22.DeviceData")] public AITValveData ValveAV22 { get; set; }
  137. [Subscription("PM1.ValveAV23.DeviceData")] public AITValveData ValveAV23 { get; set; }
  138. [Subscription("PM1.ValveAV24.DeviceData")] public AITValveData ValveAV24 { get; set; }
  139. [Subscription("PM1.ValveAV25.DeviceData")] public AITValveData ValveAV25 { get; set; }
  140. [Subscription("PM1.ValveAV26.DeviceData")] public AITValveData ValveAV26 { get; set; }
  141. [Subscription("PM1.ValveAV27.DeviceData")] public AITValveData ValveAV27 { get; set; }
  142. [Subscription("PM1.ValveAV28.DeviceData")] public AITValveData ValveAV28 { get; set; }
  143. [Subscription("PM1.ValveAV29.DeviceData")] public AITValveData ValveAV29 { get; set; }
  144. [Subscription("PM1.ValveAV30.DeviceData")] public AITValveData ValveAV30 { get; set; }
  145. [Subscription("PM1.ValveAV31.DeviceData")] public AITValveData ValveAV31 { get; set; }
  146. [Subscription("PM1.ValveAV32.DeviceData")] public AITValveData ValveAV32 { get; set; }
  147. [Subscription("PM1.ValveAV33.DeviceData")] public AITValveData ValveAV33 { get; set; }
  148. [Subscription("PM1.ValveAV34.DeviceData")] public AITValveData ValveAV34 { get; set; }
  149. [Subscription("PM1.ValveAV35.DeviceData")] public AITValveData ValveAV35 { get; set; }
  150. [Subscription("PM1.ValveAV36.DeviceData")] public AITValveData ValveAV36 { get; set; }
  151. [Subscription("PM1.ValveAV37.DeviceData")] public AITValveData ValveAV37 { get; set; }
  152. [Subscription("PM1.ValveAV38.DeviceData")] public AITValveData ValveAV38 { get; set; }
  153. [Subscription("PM1.ValveAV39.DeviceData")] public AITValveData ValveAV39 { get; set; }
  154. [Subscription("PM1.ValveAV40.DeviceData")] public AITValveData ValveAV40 { get; set; }
  155. [Subscription("PM1.ValveAV41.DeviceData")] public AITValveData ValveAV41 { get; set; }
  156. [Subscription("PM1.ValveAV42.DeviceData")] public AITValveData ValveAV42 { get; set; }
  157. [Subscription("PM1.ValveAV43.DeviceData")] public AITValveData ValveAV43 { get; set; }
  158. [Subscription("PM1.ValveAV44.DeviceData")] public AITValveData ValveAV44 { get; set; }
  159. [Subscription("PM1.ValveAV45.DeviceData")] public AITValveData ValveAV45 { get; set; }
  160. [Subscription("PM1.ValveAV46.DeviceData")] public AITValveData ValveAV46 { get; set; }
  161. [Subscription("PM1.ValveAV47.DeviceData")] public AITValveData ValveAV47 { get; set; }
  162. [Subscription("PM1.ValveAV48.DeviceData")] public AITValveData ValveAV48 { get; set; }
  163. [Subscription("PM1.ValveAV49.DeviceData")] public AITValveData ValveAV49 { get; set; }
  164. [Subscription("PM1.ValveAV50.DeviceData")] public AITValveData ValveAV50 { get; set; }
  165. [Subscription("PM1.ValveAV51.DeviceData")] public AITValveData ValveAV51 { get; set; }
  166. [Subscription("PM1.ValveAV52.DeviceData")] public AITValveData ValveAV52 { get; set; }
  167. [Subscription("PM1.ValveAV53.DeviceData")] public AITValveData ValveAV53 { get; set; }
  168. [Subscription("PM1.ValveAV54.DeviceData")] public AITValveData ValveAV54 { get; set; }
  169. [Subscription("PM1.ValveAV55.DeviceData")] public AITValveData ValveAV55 { get; set; }
  170. [Subscription("PM1.ValveAV56.DeviceData")] public AITValveData ValveAV56 { get; set; }
  171. [Subscription("PM1.ValveAV57.DeviceData")] public AITValveData ValveAV57 { get; set; }
  172. [Subscription("PM1.ValveAV58.DeviceData")] public AITValveData ValveAV58 { get; set; }
  173. [Subscription("PM1.ValveAV59.DeviceData")] public AITValveData ValveAV59 { get; set; }
  174. [Subscription("PM1.ValveAV60.DeviceData")] public AITValveData ValveAV60 { get; set; }
  175. [Subscription("PM1.ValveAV61.DeviceData")] public AITValveData ValveAV61 { get; set; }
  176. [Subscription("PM1.ValveAV62.DeviceData")] public AITValveData ValveAV62 { get; set; }
  177. [Subscription("PM1.ValveAV65.DeviceData")] public AITValveData ValveAV65 { get; set; }
  178. [Subscription("PM1.ValveAV66.DeviceData")] public AITValveData ValveAV66 { get; set; }
  179. [Subscription("PM1.ValveAV67.DeviceData")] public AITValveData ValveAV67 { get; set; }
  180. [Subscription("PM1.ValveAV68.DeviceData")] public AITValveData ValveAV68 { get; set; }
  181. [Subscription("PM1.ValveAV69.DeviceData")] public AITValveData ValveAV69 { get; set; }
  182. [Subscription("PM1.ValveAV70.DeviceData")] public AITValveData ValveAV70 { get; set; }
  183. [Subscription("PM1.APC.ModeFeedback")]
  184. public int APCModeFeedback { get; set; }
  185. [Subscription("PM1.ValveAV71.DeviceData")] public AITValveData ValveAV71Data { get; set; }
  186. public AITValveData ValveAV71
  187. {
  188. get
  189. {
  190. return new AITValveData()
  191. {
  192. DeviceName = ValveAV71Data.DeviceName,
  193. DisplayName = ValveAV71Data.DisplayName,
  194. UniqueName = ValveAV71Data.UniqueName,
  195. DefaultValue = ValveAV71Data.DefaultValue,
  196. SetPoint = ValveAV71Data.SetPoint,
  197. Feedback = APCModeFeedback != 5,
  198. VirtualFeedback = ValveAV71Data.VirtualFeedback
  199. };
  200. }
  201. }
  202. [Subscription("PM1.ValveAV72.DeviceData")] public AITValveData ValveAV72 { get; set; }
  203. [Subscription("PM1.ValveAV73.DeviceData")] public AITValveData ValveAV73 { get; set; }
  204. [Subscription("PM1.ValveAV74.DeviceData")] public AITValveData ValveAV74 { get; set; }
  205. [Subscription("PM1.ValveAV75.DeviceData")] public AITValveData ValveAV75 { get; set; }
  206. [Subscription("PM1.ValveAV76.DeviceData")] public AITValveData ValveAV76 { get; set; }
  207. [Subscription("PM1.ValveAV77.DeviceData")] public AITValveData ValveAV77 { get; set; }
  208. [Subscription("PM1.ValveAV78.DeviceData")] public AITValveData ValveAV78 { get; set; }
  209. [Subscription("PM1.ValveAV79.DeviceData")] public AITValveData ValveAV79 { get; set; }
  210. [Subscription("PM1.ValveAV80.DeviceData")] public AITValveData ValveAV80 { get; set; }
  211. [Subscription("PM1.ValveAV81.DeviceData")] public AITValveData ValveAV81 { get; set; }
  212. [Subscription("PM1.ValveAV82.DeviceData")] public AITValveData ValveAV82 { get; set; }
  213. [Subscription("PM1.ValveAV83.DeviceData")] public AITValveData ValveAV83 { get; set; }
  214. [Subscription("PM1.ValveAV84.DeviceData")] public AITValveData ValveAV84 { get; set; }
  215. [Subscription("PM1.ValveAV85.DeviceData")] public AITValveData ValveAV85 { get; set; }
  216. [Subscription("PM1.ValveAV86.DeviceData")] public AITValveData ValveAV86 { get; set; }
  217. [Subscription("PM1.ValveAV87.DeviceData")] public AITValveData ValveAV87 { get; set; }
  218. [Subscription("PM1.ValveAV88.DeviceData")] public AITValveData ValveAV88 { get; set; }
  219. [Subscription("PM1.ValveAV89.DeviceData")] public AITValveData ValveAV89 { get; set; }
  220. [Subscription("PM1.ValveAV90.DeviceData")] public AITValveData ValveAV90 { get; set; }
  221. [Subscription("PM1.ValveAV91.DeviceData")] public AITValveData ValveAV91 { get; set; }
  222. [Subscription("PM1.ValveAV92.DeviceData")] public AITValveData ValveAV92 { get; set; }
  223. [Subscription("PM1.ValveAV93.DeviceData")] public AITValveData ValveAV93 { get; set; }
  224. [Subscription("PM1.ValveAV94.DeviceData")] public AITValveData ValveAV94 { get; set; }
  225. [Subscription("PM1.ValveAV95.DeviceData")] public AITValveData ValveAV95 { get; set; }
  226. [Subscription("PM1.ValveAV96.DeviceData")] public AITValveData ValveAV96 { get; set; }
  227. [Subscription("PM1.ValveAV97.DeviceData")] public AITValveData ValveAV97 { get; set; }
  228. [Subscription("PM1.ValveAV98.DeviceData")] public AITValveData ValveAV98 { get; set; }
  229. [Subscription("PM1.ValveAV99.DeviceData")] public AITValveData ValveAV99 { get; set; }
  230. [Subscription("PM1.ValveAV100.DeviceData")] public AITValveData ValveAV100 { get; set; }
  231. [Subscription("PM1.ValveAV101.DeviceData")] public AITValveData ValveAV101 { get; set; }
  232. [Subscription("PM1.ValveAV102.DeviceData")] public AITValveData ValveAV102 { get; set; }
  233. [Subscription("PM1.ValveAV103.DeviceData")] public AITValveData ValveAV103 { get; set; }
  234. [Subscription("PM1.ValveAV104.DeviceData")] public AITValveData ValveAV104 { get; set; }
  235. [Subscription("PM1.ValveAV105.DeviceData")] public AITValveData ValveAV105 { get; set; }
  236. [Subscription("PM1.ValveAV106.DeviceData")] public AITValveData ValveAV106 { get; set; }
  237. [Subscription("PM1.ValveAV107.DeviceData")] public AITValveData ValveAV107 { get; set; }
  238. [Subscription("PM1.ValveAV108.DeviceData")] public AITValveData ValveAV108 { get; set; }
  239. [Subscription("PM1.ValveAV109.DeviceData")] public AITValveData ValveAV109 { get; set; }
  240. [Subscription("PM1.ValveAV110.DeviceData")] public AITValveData ValveAV110 { get; set; }
  241. [Subscription("PM1.ValveAV111.DeviceData")] public AITValveData ValveAV111 { get; set; }
  242. [Subscription("PM1.ValveAV112.DeviceData")] public AITValveData ValveAV112 { get; set; }
  243. [Subscription("PM1.ValveAV113.DeviceData")] public AITValveData ValveAV113 { get; set; }
  244. [Subscription("PM1.ValveAV114.DeviceData")] public AITValveData ValveAV114 { get; set; }
  245. [Subscription("PM1.ValveAV115.DeviceData")] public AITValveData ValveAV115 { get; set; }
  246. [Subscription("PM1.ValveAV116.DeviceData")] public AITValveData ValveAV116 { get; set; }
  247. [Subscription("PM1.ValveAV117.DeviceData")] public AITValveData ValveAV117 { get; set; }
  248. [Subscription("PM1.ValveAV118.DeviceData")] public AITValveData ValveAV118 { get; set; }
  249. [Subscription("PM1.ValveAV119.DeviceData")] public AITValveData ValveAV119 { get; set; }
  250. [Subscription("PM1.ValveAV120.DeviceData")] public AITValveData ValveAV120 { get; set; }
  251. [Subscription("PM1.ValveAV121.DeviceData")] public AITValveData ValveAV121 { get; set; }
  252. [Subscription("PM1.ValveAV122.DeviceData")] public AITValveData ValveAV122 { get; set; }
  253. [Subscription("PM1.ValveAV123.DeviceData")] public AITValveData ValveAV123 { get; set; }
  254. [Subscription("PM1.ValveAV124.DeviceData")] public AITValveData ValveAV124 { get; set; }
  255. [Subscription("PM1.ValveAV125.DeviceData")] public AITValveData ValveAV125 { get; set; }
  256. [Subscription("PM1.ValveAV126.DeviceData")] public AITValveData ValveAV126 { get; set; }
  257. [Subscription("PM1.ValveAV127.DeviceData")] public AITValveData ValveAV127 { get; set; }
  258. [Subscription("PM1.ValveAV128.DeviceData")] public AITValveData ValveAV128 { get; set; }
  259. [Subscription("PM1.ValveAV129.DeviceData")] public AITValveData ValveAV129 { get; set; }
  260. [Subscription("PM1.ValveAV130.DeviceData")] public AITValveData ValveAV130 { get; set; }
  261. [Subscription("PM1.ValveAV131.DeviceData")] public AITValveData ValveAV131 { get; set; }
  262. [Subscription("PM1.ValveAV132.DeviceData")] public AITValveData ValveAV132 { get; set; }
  263. [Subscription("PM1.ValveAV133.DeviceData")] public AITValveData ValveAV133 { get; set; }
  264. [Subscription("PM1.ValveAV134.DeviceData")] public AITValveData ValveAV134 { get; set; }
  265. [Subscription("PM1.ValveAV135.DeviceData")] public AITValveData ValveAV135 { get; set; }
  266. [Subscription("PM1.ValveAV136.DeviceData")] public AITValveData ValveAV136 { get; set; }
  267. [Subscription("PM1.ValveAV91.DeviceData")]
  268. public AITValveData ValveDPR { get; set; }
  269. public string ValveDPRBrush
  270. {
  271. get
  272. {
  273. if (ValveDPR != null && ValveDPR.Feedback)
  274. {
  275. return "Green";
  276. }
  277. return backGroundStr;
  278. }
  279. }
  280. [Subscription("PM1.ValveBlowerPowerOn.DeviceData")]
  281. public AITValveData ValveBWR { get; set; }
  282. public string ValveBWRBrush
  283. {
  284. get
  285. {
  286. if (ValveBWR != null && ValveBWR.Feedback)
  287. {
  288. return "Green";
  289. }
  290. return backGroundStr;
  291. }
  292. }
  293. [Subscription("PM1.IsCEXHOn")]
  294. public bool IsCEXHOn { get; set; }
  295. public string CEXHBrush
  296. {
  297. get
  298. {
  299. if (IsCEXHOn)
  300. {
  301. return "Green";
  302. }
  303. return backGroundStr;
  304. }
  305. }
  306. [Subscription("PM1.IsF2ClnOn")]
  307. public bool IsF2ClnOn { get; set; }
  308. public string F2ClnBrush
  309. {
  310. get
  311. {
  312. if (IsF2ClnOn)
  313. {
  314. return "Green";
  315. }
  316. return backGroundStr;
  317. }
  318. }
  319. [Subscription("PM1.IsHFClnOn")]
  320. public bool IsHFClnOn { get; set; }
  321. public string HFClnBrush
  322. {
  323. get
  324. {
  325. if (IsHFClnOn)
  326. {
  327. return "Green";
  328. }
  329. return backGroundStr;
  330. }
  331. }
  332. [Subscription("PM1.IsDEPOOn")]
  333. public bool IsDEPOOn { get; set; }
  334. public string DEPOBrush
  335. {
  336. get
  337. {
  338. if (IsDEPOOn)
  339. {
  340. return "Green";
  341. }
  342. return backGroundStr;
  343. }
  344. }
  345. [Subscription("PM1.HTR1Enable")]
  346. public bool IsHTR1Enable { get; set; }
  347. public string HTR1Brush
  348. {
  349. get
  350. {
  351. if (IsHTR1Enable)
  352. {
  353. return "Green";
  354. }
  355. return backGroundStr;
  356. }
  357. }
  358. [Subscription("PM1.HTR2Enable")]
  359. public bool IsHTR2Enable { get; set; }
  360. public string HTR2Brush
  361. {
  362. get
  363. {
  364. if (IsHTR2Enable)
  365. {
  366. return "Green";
  367. }
  368. return backGroundStr;
  369. }
  370. }
  371. [Subscription("PM1.HTR3Enable")]
  372. public bool IsHTR3Enable { get; set; }
  373. public string HTR3Brush
  374. {
  375. get
  376. {
  377. if (IsHTR3Enable)
  378. {
  379. return "Green";
  380. }
  381. return backGroundStr;
  382. }
  383. }
  384. [Subscription("PM1.AUCPump.DeviceData")]
  385. public AITValveData AUCPump { get; set; }
  386. public string AUCPumpBrush
  387. {
  388. get
  389. {
  390. if (AUCPump != null && AUCPump.Feedback)
  391. {
  392. return "Green";
  393. }
  394. return backGroundStr;
  395. }
  396. }
  397. [Subscription("PM1.BothPump.DeviceData")]
  398. public AITValveData BothPump { get; set; }
  399. public string BothPumpBrush
  400. {
  401. get
  402. {
  403. if (BothPump != null && BothPump.Feedback)
  404. {
  405. return "Green";
  406. }
  407. return backGroundStr;
  408. }
  409. }
  410. [Subscription("PM1.AGVPump.DeviceData")]
  411. public AITValveData AGVPump { get; set; }
  412. public string AGVPumpBrush
  413. {
  414. get
  415. {
  416. if (AGVPump != null && AGVPump.Feedback)
  417. {
  418. return "Green";
  419. }
  420. return backGroundStr;
  421. }
  422. }
  423. #endregion
  424. #region MFCs
  425. [Subscription("PM1.MFC1.DeviceData")]
  426. public AITMfcData MFC1Data { get; set; }
  427. [Subscription("PM1.MFC2.DeviceData")]
  428. public AITMfcData MFC2Data { get; set; }
  429. [Subscription("PM1.MFC3.DeviceData")]
  430. public AITMfcData MFC3Data { get; set; }
  431. [Subscription("PM1.MFC4.DeviceData")]
  432. public AITMfcData MFC4Data { get; set; }
  433. [Subscription("PM1.MFC5.DeviceData")]
  434. public AITMfcData MFC5Data { get; set; }
  435. [Subscription("PM1.MFC6.DeviceData")]
  436. public AITMfcData MFC6Data { get; set; }
  437. [Subscription("PM1.MFC7.DeviceData")]
  438. public AITMfcData MFC7Data { get; set; }
  439. [Subscription("PM1.MFC8.DeviceData")]
  440. public AITMfcData MFC8Data { get; set; }
  441. [Subscription("PM1.MFC9.DeviceData")]
  442. public AITMfcData MFC9Data { get; set; }
  443. [Subscription("PM1.MFC10.DeviceData")]
  444. public AITMfcData MFC10Data { get; set; }
  445. [Subscription("PM1.MFC11.DeviceData")]
  446. public AITMfcData MFC11Data { get; set; }
  447. [Subscription("PM1.MFC12.DeviceData")]
  448. public AITMfcData MFC12Data { get; set; }
  449. [Subscription("PM1.MFC13.DeviceData")]
  450. public AITMfcData MFC13Data { get; set; }
  451. [Subscription("PM1.MFC16.DeviceData")]
  452. public AITMfcData MFC16Data { get; set; }
  453. [Subscription("PM1.MFC17.DeviceData")]
  454. public AITMfcData MFC17Data { get; set; }
  455. [Subscription("PM1.MFC31.DeviceData")]
  456. public AITMfcData MFC31Data { get; set; }
  457. [Subscription("PM1.MFC32.DeviceData")]
  458. public AITMfcData MFC32Data { get; set; }
  459. #endregion
  460. [Subscription("PM1.MFM6.DeviceData")]
  461. public AITWaterFlowMeterData MFM6Flow { get; set; }
  462. [Subscription("PM1.MFM7.DeviceData")]
  463. public AITWaterFlowMeterData MFM7Flow { get; set; }
  464. [Subscription("PM1.MFM8.DeviceData")]
  465. public AITWaterFlowMeterData MFM8Flow { get; set; }
  466. [Subscription("PM1.MFM9.DeviceData")]
  467. public AITWaterFlowMeterData MFM9Flow { get; set; }
  468. [Subscription("PM1.MFM11.DeviceData")]
  469. public AITWaterFlowMeterData MFM11Flow { get; set; }
  470. [Subscription("PM1.MFM12.DeviceData")]
  471. public AITWaterFlowMeterData MFM12Flow { get; set; }
  472. [Subscription("PM1.MFM13.DeviceData")]
  473. public AITWaterFlowMeterData MFM13Flow { get; set; }
  474. [Subscription("PM1.MFM16.DeviceData")]
  475. public AITWaterFlowMeterData MFM16Flow { get; set; }
  476. [Subscription("PM1.RfPower.IsPowerOn")]
  477. public bool IsPowerOn { get; set; }
  478. [Subscription("PM1.RfPower.PowerSetPoint")]
  479. public float PowerSetPoint { get; set; }
  480. [Subscription("PM1.RfPower.ForwardPower")]
  481. public float ForwardPower { get; set; }
  482. [Subscription("PM1.RfMatch.Capacitance1PositionFeedBack")]
  483. public float Capacitance1PositionFeedBack { get; set; }
  484. [Subscription("PM1.RfMatch.Capacitance2PositionFeedBack")]
  485. public float Capacitance2PositionFeedBack { get; set; }
  486. [Subscription("PM1.RfMatch.VppFeedBack")]
  487. public float VppFeedBack { get; set; }
  488. public ICommand CmdSetValve { get; set; }
  489. private GasPanelStateType _selectedGasStateType = GasPanelStateType.Monitor;
  490. public GasPanelStateType SelectedGasStateType
  491. {
  492. get
  493. {
  494. return _selectedGasStateType;
  495. }
  496. set
  497. {
  498. _selectedGasStateType = value;
  499. NotifyOfPropertyChange(nameof(SelectedGasStateType));
  500. }
  501. }
  502. public AnalogDeviceDataItem MFC1
  503. {
  504. get
  505. {
  506. return new AnalogDeviceDataItem
  507. {
  508. Type = "MFC",
  509. DeviceName = MFC1Data.UniqueName,
  510. DeviceId = MFC1Data.DeviceSchematicId,
  511. DisplayName = MFC1Data.DisplayName,
  512. Scale = MFC1Data.Scale,
  513. Unit = MFC1Data.Unit,
  514. FeedBack = MFC1Data.FeedBack,
  515. SetPoint = MFC1Data.SetPoint,
  516. VirtualFeedBack = MFC1Data.VirtualFeedBack
  517. };
  518. }
  519. }
  520. public AnalogDeviceDataItem MFC2
  521. {
  522. get
  523. {
  524. return new AnalogDeviceDataItem
  525. {
  526. Type = "MFC",
  527. DeviceName = MFC2Data.UniqueName,
  528. DeviceId = MFC2Data.DeviceSchematicId,
  529. DisplayName = MFC2Data.DisplayName,
  530. Scale = MFC2Data.Scale,
  531. Unit = MFC2Data.Unit,
  532. FeedBack = MFC2Data.FeedBack,
  533. SetPoint = MFC2Data.SetPoint,
  534. VirtualFeedBack = MFC2Data.VirtualFeedBack
  535. };
  536. }
  537. }
  538. public AnalogDeviceDataItem MFC3
  539. {
  540. get
  541. {
  542. return new AnalogDeviceDataItem
  543. {
  544. Type = "MFC",
  545. DeviceName = MFC3Data.UniqueName,
  546. DeviceId = MFC3Data.DeviceSchematicId,
  547. DisplayName = MFC3Data.DisplayName,
  548. Scale = MFC3Data.Scale,
  549. Unit = MFC3Data.Unit,
  550. FeedBack = MFC3Data.FeedBack,
  551. SetPoint = MFC3Data.SetPoint,
  552. VirtualFeedBack = MFC3Data.VirtualFeedBack
  553. };
  554. }
  555. }
  556. public AnalogDeviceDataItem MFC4
  557. {
  558. get
  559. {
  560. return new AnalogDeviceDataItem
  561. {
  562. Type = "MFC",
  563. DeviceName = MFC4Data.UniqueName,
  564. DeviceId = MFC4Data.DeviceSchematicId,
  565. DisplayName = MFC4Data.DisplayName,
  566. Scale = MFC4Data.Scale,
  567. Unit = MFC4Data.Unit,
  568. FeedBack = MFC4Data.FeedBack,
  569. SetPoint = MFC4Data.SetPoint,
  570. VirtualFeedBack = MFC4Data.VirtualFeedBack
  571. };
  572. }
  573. }
  574. public AnalogDeviceDataItem MFC5
  575. {
  576. get
  577. {
  578. return new AnalogDeviceDataItem
  579. {
  580. Type = "MFC",
  581. DeviceName = MFC5Data.UniqueName,
  582. DeviceId = MFC5Data.DeviceSchematicId,
  583. DisplayName = MFC5Data.DisplayName,
  584. Scale = MFC5Data.Scale,
  585. Unit = MFC5Data.Unit,
  586. FeedBack = MFC5Data.FeedBack,
  587. SetPoint = MFC5Data.SetPoint,
  588. VirtualFeedBack = MFC5Data.VirtualFeedBack
  589. };
  590. }
  591. }
  592. public AnalogDeviceDataItem MFC6
  593. {
  594. get
  595. {
  596. return new AnalogDeviceDataItem
  597. {
  598. Type = "MFC",
  599. DeviceName = MFC6Data.UniqueName,
  600. DeviceId = MFC6Data.DeviceSchematicId,
  601. DisplayName = MFC6Data.DisplayName,
  602. Scale = MFC6Data.Scale,
  603. Unit = MFC6Data.Unit,
  604. FeedBack = MFC6Data.FeedBack,
  605. SetPoint = MFC6Data.SetPoint,
  606. VirtualFeedBack = MFC6Data.VirtualFeedBack
  607. };
  608. }
  609. }
  610. public AnalogDeviceDataItem MFC7
  611. {
  612. get
  613. {
  614. return new AnalogDeviceDataItem
  615. {
  616. Type = "MFC",
  617. DeviceName = MFC7Data.UniqueName,
  618. DeviceId = MFC7Data.DeviceSchematicId,
  619. DisplayName = MFC7Data.DisplayName,
  620. Scale = MFC7Data.Scale,
  621. Unit = MFC7Data.Unit,
  622. FeedBack = MFC7Data.FeedBack,
  623. SetPoint = MFC7Data.SetPoint,
  624. VirtualFeedBack = MFC7Data.VirtualFeedBack
  625. };
  626. }
  627. }
  628. public AnalogDeviceDataItem MFC8
  629. {
  630. get
  631. {
  632. return new AnalogDeviceDataItem
  633. {
  634. Type = "MFC",
  635. DeviceName = MFC8Data.UniqueName,
  636. DeviceId = MFC8Data.DeviceSchematicId,
  637. DisplayName = MFC8Data.DisplayName,
  638. Scale = MFC8Data.Scale,
  639. Unit = MFC8Data.Unit,
  640. FeedBack = MFC8Data.FeedBack,
  641. SetPoint = MFC8Data.SetPoint,
  642. VirtualFeedBack = MFC8Data.VirtualFeedBack
  643. };
  644. }
  645. }
  646. public AnalogDeviceDataItem MFC9
  647. {
  648. get
  649. {
  650. return new AnalogDeviceDataItem
  651. {
  652. Type = "MFC",
  653. DeviceName = MFC9Data.UniqueName,
  654. DeviceId = MFC9Data.DeviceSchematicId,
  655. DisplayName = MFC9Data.DisplayName,
  656. Scale = MFC9Data.Scale,
  657. Unit = MFC9Data.Unit,
  658. FeedBack = MFC9Data.FeedBack,
  659. SetPoint = MFC9Data.SetPoint,
  660. VirtualFeedBack = MFC9Data.VirtualFeedBack
  661. };
  662. }
  663. }
  664. public AnalogDeviceDataItem MFC10
  665. {
  666. get
  667. {
  668. return new AnalogDeviceDataItem
  669. {
  670. Type = "MFC",
  671. DeviceName = MFC10Data.UniqueName,
  672. DeviceId = MFC10Data.DeviceSchematicId,
  673. DisplayName = MFC10Data.DisplayName,
  674. Scale = MFC10Data.Scale,
  675. Unit = MFC10Data.Unit,
  676. FeedBack = MFC10Data.FeedBack,
  677. SetPoint = MFC10Data.SetPoint,
  678. VirtualFeedBack = MFC10Data.VirtualFeedBack
  679. };
  680. }
  681. }
  682. public AnalogDeviceDataItem MFC11
  683. {
  684. get
  685. {
  686. return new AnalogDeviceDataItem
  687. {
  688. Type = "MFC",
  689. DeviceName = MFC11Data.UniqueName,
  690. DeviceId = MFC11Data.DeviceSchematicId,
  691. DisplayName = MFC11Data.DisplayName,
  692. Scale = MFC11Data.Scale,
  693. Unit = MFC11Data.Unit,
  694. FeedBack = MFC11Data.FeedBack,
  695. SetPoint = MFC11Data.SetPoint,
  696. VirtualFeedBack = MFC11Data.VirtualFeedBack
  697. };
  698. }
  699. }
  700. public AnalogDeviceDataItem MFC12
  701. {
  702. get
  703. {
  704. return new AnalogDeviceDataItem
  705. {
  706. Type = "MFC",
  707. DeviceName = MFC12Data.UniqueName,
  708. DeviceId = MFC12Data.DeviceSchematicId,
  709. DisplayName = MFC12Data.DisplayName,
  710. Scale = MFC12Data.Scale,
  711. Unit = MFC12Data.Unit,
  712. FeedBack = MFC12Data.FeedBack,
  713. SetPoint = MFC12Data.SetPoint,
  714. VirtualFeedBack = MFC12Data.VirtualFeedBack
  715. };
  716. }
  717. }
  718. public AnalogDeviceDataItem MFC13
  719. {
  720. get
  721. {
  722. return new AnalogDeviceDataItem
  723. {
  724. Type = "MFC",
  725. DeviceName = MFC13Data.UniqueName,
  726. DeviceId = MFC13Data.DeviceSchematicId,
  727. DisplayName = MFC13Data.DisplayName,
  728. Scale = MFC13Data.Scale,
  729. Unit = MFC13Data.Unit,
  730. FeedBack = MFC13Data.FeedBack,
  731. SetPoint = MFC13Data.SetPoint,
  732. VirtualFeedBack = MFC13Data.VirtualFeedBack
  733. };
  734. }
  735. }
  736. public AnalogDeviceDataItem MFC16
  737. {
  738. get
  739. {
  740. return new AnalogDeviceDataItem
  741. {
  742. Type = "MFC",
  743. DeviceName = MFC16Data.UniqueName,
  744. DeviceId = MFC16Data.DeviceSchematicId,
  745. DisplayName = MFC16Data.DisplayName,
  746. Scale = MFC16Data.Scale,
  747. Unit = MFC16Data.Unit,
  748. FeedBack = MFC16Data.FeedBack,
  749. SetPoint = MFC16Data.SetPoint,
  750. VirtualFeedBack = MFC16Data.VirtualFeedBack
  751. };
  752. }
  753. }
  754. public AnalogDeviceDataItem MFC17
  755. {
  756. get
  757. {
  758. return new AnalogDeviceDataItem
  759. {
  760. Type = "MFC",
  761. DeviceName = MFC17Data.UniqueName,
  762. DeviceId = MFC17Data.DeviceSchematicId,
  763. DisplayName = MFC17Data.DisplayName,
  764. Scale = MFC17Data.Scale,
  765. Unit = MFC17Data.Unit,
  766. FeedBack = MFC17Data.FeedBack,
  767. SetPoint = MFC17Data.SetPoint,
  768. VirtualFeedBack = MFC17Data.VirtualFeedBack
  769. };
  770. }
  771. }
  772. public AnalogDeviceDataItem MFC31
  773. {
  774. get
  775. {
  776. return new AnalogDeviceDataItem
  777. {
  778. Type = "MFC",
  779. DeviceName = MFC31Data.UniqueName,
  780. DeviceId = MFC31Data.DeviceSchematicId,
  781. DisplayName = MFC31Data.DisplayName,
  782. Scale = MFC31Data.Scale,
  783. Unit = MFC31Data.Unit,
  784. FeedBack = MFC31Data.FeedBack,
  785. SetPoint = MFC31Data.SetPoint,
  786. VirtualFeedBack = MFC31Data.VirtualFeedBack
  787. };
  788. }
  789. }
  790. public AnalogDeviceDataItem MFC32
  791. {
  792. get
  793. {
  794. return new AnalogDeviceDataItem
  795. {
  796. Type = "MFC",
  797. DeviceName = MFC32Data.UniqueName,
  798. DeviceId = MFC32Data.DeviceSchematicId,
  799. DisplayName = MFC32Data.DisplayName,
  800. Scale = MFC32Data.Scale,
  801. Unit = MFC32Data.Unit,
  802. FeedBack = MFC32Data.FeedBack,
  803. SetPoint = MFC32Data.SetPoint,
  804. VirtualFeedBack = MFC32Data.VirtualFeedBack
  805. };
  806. }
  807. }
  808. public AnalogDeviceDataItem MFM6
  809. {
  810. get
  811. {
  812. return new AnalogDeviceDataItem
  813. {
  814. Type = "MFM",
  815. DeviceName = MFM6Flow.DisplayName,
  816. DeviceId = MFM6Flow.DeviceSchematicId,
  817. DisplayName = MFM6Flow.DisplayName,
  818. Scale = MFM6Flow.Scale,
  819. Unit = MFM6Flow.Unit,
  820. FeedBack = MFM6Flow.FeedBack,
  821. SetPoint = MFM6Flow.SetPoint,
  822. };
  823. }
  824. }
  825. public AnalogDeviceDataItem MFM7
  826. {
  827. get
  828. {
  829. return new AnalogDeviceDataItem
  830. {
  831. Type = "MFM",
  832. DeviceName = MFM7Flow.DisplayName,
  833. DeviceId = MFM7Flow.DeviceSchematicId,
  834. DisplayName = MFM7Flow.DisplayName,
  835. Scale = MFM7Flow.Scale,
  836. Unit = MFM7Flow.Unit,
  837. FeedBack = MFM7Flow.FeedBack,
  838. SetPoint = MFM7Flow.SetPoint,
  839. };
  840. }
  841. }
  842. public AnalogDeviceDataItem MFM8
  843. {
  844. get
  845. {
  846. return new AnalogDeviceDataItem
  847. {
  848. Type = "MFM",
  849. DeviceName = MFM8Flow.DisplayName,
  850. DeviceId = MFM8Flow.DeviceSchematicId,
  851. DisplayName = MFM8Flow.DisplayName,
  852. Scale = MFM8Flow.Scale,
  853. Unit = MFM8Flow.Unit,
  854. FeedBack = MFM8Flow.FeedBack,
  855. SetPoint = MFM8Flow.SetPoint,
  856. };
  857. }
  858. }
  859. public AnalogDeviceDataItem MFM9
  860. {
  861. get
  862. {
  863. return new AnalogDeviceDataItem
  864. {
  865. Type = "MFM",
  866. DeviceName = MFM9Flow.DisplayName,
  867. DeviceId = MFM9Flow.DeviceSchematicId,
  868. DisplayName = MFM9Flow.DisplayName,
  869. Scale = MFM9Flow.Scale,
  870. Unit = MFM9Flow.Unit,
  871. FeedBack = MFM9Flow.FeedBack,
  872. SetPoint = MFM9Flow.SetPoint,
  873. };
  874. }
  875. }
  876. public AnalogDeviceDataItem MFM11
  877. {
  878. get
  879. {
  880. return new AnalogDeviceDataItem
  881. {
  882. Type = "MFM",
  883. DeviceName = MFM11Flow.DisplayName,
  884. DeviceId = MFM11Flow.DeviceSchematicId,
  885. DisplayName = MFM11Flow.DisplayName,
  886. Scale = MFM11Flow.Scale,
  887. Unit = MFM11Flow.Unit,
  888. FeedBack = MFM11Flow.FeedBack,
  889. SetPoint = MFM11Flow.SetPoint,
  890. };
  891. }
  892. }
  893. public AnalogDeviceDataItem MFM12
  894. {
  895. get
  896. {
  897. return new AnalogDeviceDataItem
  898. {
  899. Type = "MFM",
  900. DeviceName = MFM12Flow.DisplayName,
  901. DeviceId = MFM12Flow.DeviceSchematicId,
  902. DisplayName = MFM12Flow.DisplayName,
  903. Scale = MFM12Flow.Scale,
  904. Unit = MFM12Flow.Unit,
  905. FeedBack = MFM12Flow.FeedBack,
  906. SetPoint = MFM12Flow.SetPoint,
  907. };
  908. }
  909. }
  910. public AnalogDeviceDataItem MFM13
  911. {
  912. get
  913. {
  914. return new AnalogDeviceDataItem
  915. {
  916. Type = "MFM",
  917. DeviceName = MFM13Flow.DisplayName,
  918. DeviceId = MFM13Flow.DeviceSchematicId,
  919. DisplayName = MFM13Flow.DisplayName,
  920. Scale = MFM13Flow.Scale,
  921. Unit = MFM13Flow.Unit,
  922. FeedBack = MFM13Flow.FeedBack,
  923. SetPoint = MFM13Flow.SetPoint,
  924. };
  925. }
  926. }
  927. public AnalogDeviceDataItem MFM16
  928. {
  929. get
  930. {
  931. return new AnalogDeviceDataItem
  932. {
  933. Type = "MFM",
  934. DeviceName = MFM16Flow.DisplayName,
  935. DeviceId = MFM16Flow.DeviceSchematicId,
  936. DisplayName = MFM16Flow.DisplayName,
  937. Scale = MFM16Flow.Scale,
  938. Unit = MFM16Flow.Unit,
  939. FeedBack = MFM16Flow.FeedBack,
  940. SetPoint = MFM16Flow.SetPoint,
  941. };
  942. }
  943. }
  944. public string IsRfPowerOn
  945. {
  946. get
  947. {
  948. return IsPowerOn ? "On" : "Off";
  949. }
  950. }
  951. private bool _manualCheckSelect = false;
  952. private bool _manualCheck = true;
  953. public bool ManualCheck
  954. {
  955. get => _manualCheck;
  956. set
  957. {
  958. _manualCheck = value;
  959. NotifyOfPropertyChange(nameof(ManualCheck));
  960. }
  961. }
  962. private bool _manualCheckHide;
  963. public bool ManumalCheckHide
  964. {
  965. get => _manualCheckHide;
  966. set
  967. {
  968. _manualCheckHide = value;
  969. NotifyOfPropertyChange(nameof(ManumalCheckHide));
  970. }
  971. }
  972. public bool ValveTrue { get; set; } = true;
  973. public bool ValveFalse { get; set; } = false;
  974. private bool _enablePLCPointControl = false;
  975. public bool EnablePLCPointControl
  976. {
  977. get => _enablePLCPointControl;
  978. set
  979. {
  980. _enablePLCPointControl = value;
  981. NotifyOfPropertyChange(nameof(EnablePLCPointControl));
  982. }
  983. }
  984. public GasPanelViewModel()
  985. {
  986. CmdSetMfcFlow = new DelegateCommand<object>(PerformCmdSetMfcFlow);
  987. CmdSetMfmFlow = new DelegateCommand<object>(PerformCmdSetMfmFlow);
  988. }
  989. public void SelectedGasStateTypeCmd(string cmd)
  990. {
  991. switch (cmd)
  992. {
  993. case "Manual":
  994. SelectedGasStateType = GasPanelStateType.Manual;
  995. ManualEnable = true;
  996. break;
  997. case "Monitor":
  998. SelectedGasStateType = GasPanelStateType.Monitor;
  999. ManualEnable = true;
  1000. break;
  1001. case "Recipe":
  1002. SelectedGasStateType = GasPanelStateType.Recipe;
  1003. ManualEnable = false;
  1004. break;
  1005. default:
  1006. break;
  1007. }
  1008. }
  1009. protected override void OnActivate()
  1010. {
  1011. base.OnActivate();
  1012. // EnableServiceControl = (bool)QueryDataClient.Instance.Service.GetConfig("System.IsServiceControlMode");
  1013. // IsMfcNRInstalled = (bool)QueryDataClient.Instance.Service.GetConfig("PM1.MFC.MfcNR.IsMFCInstalled");
  1014. }
  1015. public void SetEditClick()
  1016. {
  1017. IsRecipeEdit = true;
  1018. // EnableServiceControl = false;
  1019. }
  1020. protected override void OnDeactivate(bool close)
  1021. {
  1022. base.OnDeactivate(close);
  1023. //IsManagerPermission = false;
  1024. }
  1025. public void SetManual()
  1026. {
  1027. if (!_manualCheckSelect)
  1028. {
  1029. _manualCheckSelect = !_manualCheckSelect;
  1030. IsManagerPermission = true;
  1031. EnablePLCPointControl = false;
  1032. }
  1033. else
  1034. {
  1035. IsManagerPermission = true;
  1036. ManualCheck = false;
  1037. ManumalCheckHide = true;
  1038. _manualCheckSelect = !_manualCheckSelect;
  1039. EnablePLCPointControl = true;
  1040. }
  1041. }
  1042. public void OpenAll()
  1043. {
  1044. if (!VentValveData.IsOpen)
  1045. InvokeClient.Instance.Service.DoOperation($"{VentValveData.UniqueName}.{AITValveOperation.GVTurnValve}", true);
  1046. if (!PumpValveData.IsOpen)
  1047. InvokeClient.Instance.Service.DoOperation($"{PumpValveData.UniqueName}.{AITValveOperation.GVTurnValve}", true);
  1048. }
  1049. public void CloseAll()
  1050. {
  1051. if (PumpValveData.IsOpen)
  1052. InvokeClient.Instance.Service.DoOperation($"{PumpValveData.UniqueName}.{AITValveOperation.GVTurnValve}", false);
  1053. if (VentValveData.IsOpen)
  1054. InvokeClient.Instance.Service.DoOperation($"{VentValveData.UniqueName}.{AITValveOperation.GVTurnValve}", false);
  1055. }
  1056. private void PerformCmdSetMfcFlow(object param)
  1057. {
  1058. object[] args = (object[])param; //0:devicename, 1:operation, 2:args
  1059. if (args.Length == 3)
  1060. {
  1061. InvokeClient.Instance.Service.DoOperation($"{args[0]}.{args[1]}", args[2]);
  1062. }
  1063. }
  1064. private void PerformCmdSetMfmFlow(object param)
  1065. {
  1066. //object[] args = (object[])param; //0:devicename, 1:operation, 2:args
  1067. //if (args.Length == 3)
  1068. //{
  1069. // InvokeClient.Instance.Service.DoOperation($"PM1.{args[0]}.{args[1]}", args[2]);
  1070. //}
  1071. }
  1072. bool isSensorRecipeOK = false;
  1073. Dictionary<string, object> oldresult;
  1074. private Dictionary<string, object> ClearNotChangedValue(Dictionary<string, object> result)
  1075. {
  1076. Dictionary<string, object> temp = result;
  1077. if (oldresult == null)
  1078. {
  1079. oldresult = result;
  1080. }
  1081. else
  1082. {
  1083. try
  1084. {
  1085. List<string> strkeys = new List<string>();
  1086. foreach (var key in result.Keys)
  1087. {
  1088. if (_subscribedKeys.Contains(key) && oldresult.ContainsKey(key) && result.ContainsKey(key))
  1089. {
  1090. if (result[key].GetType() == typeof(AITValveData) && (((AITValveData)oldresult[key]).Feedback != ((AITValveData)result[key]).Feedback
  1091. || ((AITValveData)oldresult[key]).VirtualFeedback != ((AITValveData)result[key]).VirtualFeedback))
  1092. {
  1093. strkeys.Add(key);
  1094. }
  1095. else if (result[key].GetType() == typeof(AITSensorData) && ((AITSensorData)oldresult[key]).Value != ((AITSensorData)result[key]).Value)
  1096. {
  1097. strkeys.Add(key);
  1098. }
  1099. else if (result[key].GetType() == typeof(AITMfcData) && (((AITMfcData)oldresult[key]).FeedBack != ((AITMfcData)result[key]).FeedBack ||
  1100. ((AITMfcData)oldresult[key]).VirtualFeedBack != ((AITMfcData)result[key]).VirtualFeedBack))
  1101. {
  1102. strkeys.Add(key);
  1103. }
  1104. else if (result[key].GetType() == typeof(float) && (float)oldresult[key] == (float)result[key])
  1105. {
  1106. strkeys.Add(key);
  1107. }
  1108. else if (result[key].GetType() == typeof(int) && (int)oldresult[key] == (int)result[key])
  1109. {
  1110. strkeys.Add(key);
  1111. }
  1112. else if (result[key].GetType() == typeof(bool) && (bool)oldresult[key] == (bool)result[key])
  1113. {
  1114. strkeys.Add(key);
  1115. }
  1116. }
  1117. }
  1118. for (int i = 0; i < strkeys.Count; i++)
  1119. {
  1120. temp.Remove(strkeys[i]);
  1121. }
  1122. }
  1123. catch (Exception ex)
  1124. {
  1125. LOG.Error("由RT返回的数据更新失败" + "ClearNotChangedValue", ex);
  1126. }
  1127. }
  1128. return temp;
  1129. }
  1130. protected override void Poll()
  1131. {
  1132. if (_subscribedKeys.Count > 0)
  1133. {
  1134. Dictionary<string, object> result = QueryDataClient.Instance.Service.PollData(_subscribedKeys);
  1135. Dictionary<string, object> Tempresult = new Dictionary<string, object>(result);
  1136. if (SelectedGasStateType != GasPanelStateType.Monitor)
  1137. {
  1138. result = ClearNotChangedValue(result);
  1139. }
  1140. oldresult = Tempresult;
  1141. if (result == null)
  1142. {
  1143. LOG.Error("获取RT数据失败");
  1144. return;
  1145. }
  1146. if (result.Count != _subscribedKeys.Count)
  1147. {
  1148. string unknowKeys = string.Empty;
  1149. foreach (string key in _subscribedKeys)
  1150. {
  1151. if (!result.ContainsKey(key))
  1152. {
  1153. unknowKeys += key + "\r\n";
  1154. }
  1155. }
  1156. }
  1157. InvokeBeforeUpdateProperty(result);
  1158. UpdateValue(result);
  1159. Application.Current?.Dispatcher.Invoke(new Action(() =>
  1160. {
  1161. if (result.Count != 0)
  1162. {
  1163. InvokePropertyChanged();
  1164. }
  1165. InvokeAfterUpdateProperty(result);
  1166. }));
  1167. }
  1168. }
  1169. protected override void InvokeBeforeUpdateProperty(Dictionary<string, object> data)
  1170. {
  1171. base.InvokeBeforeUpdateProperty(data);
  1172. }
  1173. protected override void InvokeAfterUpdateProperty(Dictionary<string, object> data)
  1174. {
  1175. base.InvokeAfterUpdateProperty(data);
  1176. if (SensorRecipeOK != null && SensorRecipeOK.Value)
  1177. {
  1178. if (isSensorRecipeOK != SensorRecipeOK.Value)
  1179. {
  1180. _manualCheckSelect = false;
  1181. IsManagerPermission = true;
  1182. IsRecipeEdit = true;
  1183. // EnableServiceControl = false;
  1184. }
  1185. isSensorRecipeOK = SensorRecipeOK.Value;
  1186. }
  1187. }
  1188. public void SwichValue(string name)
  1189. {
  1190. if (SelectedGasStateType == GasPanelStateType.Monitor || SelectedGasStateType == GasPanelStateType.Recipe) return;
  1191. var dialog = new SwitchValueDialog { };
  1192. dialog.IsOpen = true;
  1193. switch (name.ToUpper())
  1194. {
  1195. case "BWR":
  1196. dialog.IsOpen = ValveBWR.Feedback;
  1197. break;
  1198. case "DPR":
  1199. dialog.IsOpen = ValveDPR.Feedback;
  1200. break;
  1201. case "CEXH":
  1202. dialog.IsOpen = IsCEXHOn;
  1203. break;
  1204. case "F2":
  1205. dialog.IsOpen = IsF2ClnOn;
  1206. break;
  1207. case "HF":
  1208. dialog.IsOpen = IsHFClnOn;
  1209. break;
  1210. case "DEPO":
  1211. dialog.IsOpen = IsDEPOOn;
  1212. break;
  1213. }
  1214. dialog.Owner = WinOwner;
  1215. dialog.Topmost = true;
  1216. dialog.WindowStartupLocation = WindowStartupLocation.CenterScreen;
  1217. dialog.DeviceName = $"Swich {name}";
  1218. dialog.ShowDialog();
  1219. if ((bool)dialog.IsSave)
  1220. {
  1221. switch (name.ToUpper())
  1222. {
  1223. case "BWR":
  1224. InvokeClient.Instance.Service.DoOperation($"{ValveBWR.UniqueName}.{AITValveOperation.GVTurnValve}", dialog.IsOpen);
  1225. break;
  1226. case "DPR":
  1227. InvokeClient.Instance.Service.DoOperation($"{ValveDPR.UniqueName}.{AITValveOperation.GVTurnValve}", dialog.IsOpen);
  1228. break;
  1229. case "CEXH":
  1230. InvokeClient.Instance.Service.DoOperation($"PM1.SetCEXHEnable", dialog.IsOpen);
  1231. break;
  1232. case "F2":
  1233. InvokeClient.Instance.Service.DoOperation($"PM1.SetF2ClnEnable", dialog.IsOpen);
  1234. break;
  1235. case "HF":
  1236. InvokeClient.Instance.Service.DoOperation($"PM1.SetHFClnEnable", dialog.IsOpen);
  1237. break;
  1238. case "DEPO":
  1239. InvokeClient.Instance.Service.DoOperation($"PM1.SetDEPOEnable", dialog.IsOpen);
  1240. break;
  1241. }
  1242. }
  1243. }
  1244. public void SetEnable(string name)
  1245. {
  1246. if (SelectedGasStateType == GasPanelStateType.Monitor || SelectedGasStateType == GasPanelStateType.Recipe) return;
  1247. var dialog = new SwitchValueDialog2 { };
  1248. dialog.IsOpen = true;
  1249. switch (name.ToUpper())
  1250. {
  1251. case "HTR1":
  1252. dialog.IsOpen = IsHTR1Enable;
  1253. break;
  1254. case "HTR2":
  1255. dialog.IsOpen = IsHTR2Enable;
  1256. break;
  1257. case "HTR3":
  1258. dialog.IsOpen = IsHTR3Enable;
  1259. break;
  1260. }
  1261. dialog.Owner = WinOwner;
  1262. dialog.Topmost = true;
  1263. dialog.WindowStartupLocation = WindowStartupLocation.CenterScreen;
  1264. dialog.DeviceName = $"Swich {name}";
  1265. dialog.ShowDialog();
  1266. if ((bool)dialog.IsSave)
  1267. {
  1268. switch (name.ToUpper())
  1269. {
  1270. case "HTR1":
  1271. InvokeClient.Instance.Service.DoOperation($"PM1.SetHTR1Enable", dialog.IsOpen);
  1272. break;
  1273. case "HTR2":
  1274. InvokeClient.Instance.Service.DoOperation($"PM1.SetHTR2Enable", dialog.IsOpen);
  1275. break;
  1276. case "HTR3":
  1277. InvokeClient.Instance.Service.DoOperation($"PM1.SetHTR3Enable", dialog.IsOpen);
  1278. break;
  1279. }
  1280. }
  1281. }
  1282. public void SelectPump(string _pumpname)
  1283. {
  1284. if (SelectedGasStateType == GasPanelStateType.Monitor || SelectedGasStateType == GasPanelStateType.Recipe) return;
  1285. if (!DialogBox.Confirm($"Are you sure change {_pumpname} status?"))
  1286. return;
  1287. if (_pumpname == "AUC")
  1288. {
  1289. InvokeClient.Instance.Service.DoOperation($"{AUCPump.UniqueName}.{AITValveOperation.GVTurnValve}", !AUCPump.Feedback);
  1290. }
  1291. if (_pumpname == "AGV")
  1292. {
  1293. InvokeClient.Instance.Service.DoOperation($"{AGVPump.UniqueName}.{AITValveOperation.GVTurnValve}", !AGVPump.Feedback);
  1294. }
  1295. if (_pumpname == "Both")
  1296. {
  1297. InvokeClient.Instance.Service.DoOperation($"{BothPump.UniqueName}.{AITValveOperation.GVTurnValve}", !BothPump.Feedback);
  1298. }
  1299. }
  1300. }
  1301. }