SCValue.cs 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Reflection;
  5. using System.Windows.Documents;
  6. using System.Xml.Serialization;
  7. namespace Aitex.Core.RT.SCCore
  8. {
  9. public class SCValue
  10. {
  11. public SystemConfigValue System { get; set; }
  12. public BarcodeConfigValue BarcodeConfig { get; set; }
  13. public RfConfigValue RfConfig { get; set; }
  14. public GasLineConfigValue GasLineConfig { get; set; }
  15. public VaporLineConfigValue VaporLineConfig { get; set; }
  16. public PressureControlConfigValue PressureControlConfig { get; set; }
  17. public ProcessConfigValue ProcessConfig{ get; set; }
  18. public CoolingConfigValue CoolingConfig{ get; set; }
  19. public TransferConfigValue TransferConfig { get; set; }
  20. private Dictionary<string, Tuple<object, PropertyInfo>> _fieldMap =
  21. new Dictionary<string, Tuple<object, PropertyInfo>>();
  22. public SCValue()
  23. {
  24. System = new SystemConfigValue();
  25. BarcodeConfig = new BarcodeConfigValue();
  26. RfConfig = new RfConfigValue();
  27. GasLineConfig = new GasLineConfigValue();
  28. VaporLineConfig = new VaporLineConfigValue();
  29. PressureControlConfig = new PressureControlConfigValue();
  30. ProcessConfig = new ProcessConfigValue();
  31. CoolingConfig = new CoolingConfigValue();
  32. TransferConfig = new TransferConfigValue();
  33. }
  34. public List<string> GetKeys()
  35. {
  36. return _fieldMap.Keys.ToList();
  37. }
  38. public void SetKeys(List<string> keys)
  39. {
  40. _fieldMap.Clear();
  41. Dictionary<string, object> items = new Dictionary<string, object>();
  42. PropertyInfo[] property = typeof(SCValue).GetProperties();
  43. foreach (PropertyInfo fiGroup in property)
  44. {
  45. object objGroup = fiGroup.GetValue(this, null);
  46. foreach (PropertyInfo fiItem in objGroup.GetType().GetProperties())
  47. {
  48. string name = String.Format("{0}_{1}", fiGroup.Name, fiItem.Name);
  49. if (keys.Contains(name))
  50. {
  51. _fieldMap[name] = Tuple.Create(objGroup, fiItem);
  52. }
  53. }
  54. }
  55. }
  56. public void AddKey(string key)
  57. {
  58. PropertyInfo[] property = typeof(SCValue).GetProperties();
  59. foreach (PropertyInfo fiGroup in property)
  60. {
  61. object objGroup = fiGroup.GetValue(this, null);
  62. foreach (PropertyInfo fiItem in objGroup.GetType().GetProperties())
  63. {
  64. string name = String.Format("{0}_{1}", fiGroup.Name, fiItem.Name);
  65. if (key == name)
  66. {
  67. _fieldMap[name] = Tuple.Create(objGroup, fiItem);
  68. return;
  69. }
  70. }
  71. }
  72. }
  73. public void RetrieveAll()
  74. {
  75. List<string> keys = new List<string>();
  76. FieldInfo[] datas = typeof(SCName).GetFields();
  77. foreach (FieldInfo fi in datas)
  78. {
  79. keys.Add(fi.Name);
  80. }
  81. SetKeys(keys);
  82. }
  83. public void Update(Dictionary<string, object> result)
  84. {
  85. if (result == null)
  86. return;
  87. foreach (KeyValuePair<string, object> item in result)
  88. {
  89. if (_fieldMap.ContainsKey(item.Key))
  90. {
  91. _fieldMap[item.Key].Item2.SetValue(_fieldMap[item.Key].Item1, item.Value, null);
  92. }
  93. }
  94. }
  95. public void Update(string key, string value)
  96. {
  97. if (!_fieldMap.ContainsKey(key))
  98. return;
  99. if (_fieldMap[key].Item2.PropertyType == typeof(double))
  100. {
  101. _fieldMap[key].Item2.SetValue(_fieldMap[key].Item1, Convert.ToDouble(value), null);
  102. }else if (_fieldMap[key].Item2.PropertyType == typeof(int))
  103. {
  104. _fieldMap[key].Item2.SetValue(_fieldMap[key].Item1, Convert.ToInt32(value), null);
  105. }else if (_fieldMap[key].Item2.PropertyType == typeof(string))
  106. {
  107. _fieldMap[key].Item2.SetValue(_fieldMap[key].Item1, value, null);
  108. }else if (_fieldMap[key].Item2.PropertyType == typeof(bool))
  109. {
  110. _fieldMap[key].Item2.SetValue(_fieldMap[key].Item1, Convert.ToBoolean(value), null);
  111. }
  112. }
  113. public Dictionary<string, object> GetValue()
  114. {
  115. Dictionary<string, object> result = new Dictionary<string, object>();
  116. foreach (var item in _fieldMap)
  117. {
  118. result[item.Key] = item.Value.Item2.GetValue(item.Value.Item1, null);
  119. }
  120. return result;
  121. }
  122. public class TransferConfigValue
  123. {
  124. public double InitAllTimeout { get; set; }
  125. public double MotorPushBarInAcceleration { get; set; }
  126. public double MotorPushBarInDeceleration { get; set; }
  127. public double MotorPushBarInStartFrequency { get; set; }
  128. public double MotorPushBarInDefaultServoSpeed { get; set; }
  129. public double MotorPushBarInDefaultManualSpeed { get; set; }
  130. public double MotorPushBarInServoOnTimeout { get; set; }
  131. public double MotorPushBarInMoveTimeout { get; set; }
  132. public double MotorPushBarInStopTimeout { get; set; }
  133. public double MotorPushBarInResetAlarmTimeout { get; set; }
  134. public double MotorPushBarInHomeTimeout { get; set; }
  135. public double MotorLoadStationInAcceleration { get; set; }
  136. public double MotorLoadStationInDeceleration { get; set; }
  137. public double MotorLoadStationInStartFrequency { get; set; }
  138. public double MotorLoadStationInDefaultServoSpeed { get; set; }
  139. public double MotorLoadStationInDefaultManualSpeed { get; set; }
  140. public double MotorLoadStationInServoOnTimeout { get; set; }
  141. public double MotorLoadStationInMoveTimeout { get; set; }
  142. public double MotorLoadStationInStopTimeout { get; set; }
  143. public double MotorLoadStationInResetAlarmTimeout { get; set; }
  144. public double MotorLoadStationInHomeTimeout { get; set; }
  145. public double MotorPushBarChamberAcceleration { get; set; }
  146. public double MotorPushBarChamberDeceleration { get; set; }
  147. public double MotorPushBarChamberStartFrequency { get; set; }
  148. public double MotorPushBarChamberDefaultServoSpeed { get; set; }
  149. public double MotorPushBarChamberDefaultManualSpeed { get; set; }
  150. public double MotorPushBarChamberServoOnTimeout { get; set; }
  151. public double MotorPushBarChamberMoveTimeout { get; set; }
  152. public double MotorPushBarChamberStopTimeout { get; set; }
  153. public double MotorPushBarChamberResetAlarmTimeout { get; set; }
  154. public double MotorPushBarChamberHomeTimeout { get; set; }
  155. public double MotorLoadStationOutAcceleration { get; set; }
  156. public double MotorLoadStationOutDeceleration { get; set; }
  157. public double MotorLoadStationOutStartFrequency { get; set; }
  158. public double MotorLoadStationOutDefaultServoSpeed { get; set; }
  159. public double MotorLoadStationOutDefaultManualSpeed { get; set; }
  160. public double MotorLoadStationOutServoOnTimeout { get; set; }
  161. public double MotorLoadStationOutMoveTimeout { get; set; }
  162. public double MotorLoadStationOutStopTimeout { get; set; }
  163. public double MotorLoadStationOutResetAlarmTimeout { get; set; }
  164. public double MotorLoadStationOutHomeTimeout { get; set; }
  165. }
  166. public class CoolingConfigValue
  167. {
  168. public bool EnableElectrodeTcLeftAsControlTc { get; set; }
  169. public double ElectrodeTcDifferenceMaxValue { get; set; }
  170. public double ElectrodeCriticalTemperatureManualProcess { get; set; }
  171. public double RfCoolingValveMaxOpenTime { get; set; }
  172. public double PumpCoolingValveMaxOpenTime { get; set; }
  173. public double ElectrodeOverTemperatureTime { get; set; }
  174. public double ElectrodeCoolingWaterOpenTime { get; set; }
  175. public double WaterFlowPumpMinValue{ get; set; }
  176. public double WaterFlowPumpMaxValue { get; set; }
  177. public double WaterFlowPumpOutOfToleranceWarningTime{ get; set; }
  178. public double WaterFlowPumpOutOfToleranceAlarmTime{ get; set; }
  179. public double WaterFlowRfMinValue{ get; set; }
  180. public double WaterFlowRfMaxValue{ get; set; }
  181. public double WaterFlowRfOutOfToleranceWarningTime{ get; set; }
  182. public double WaterFlowRfOutOfToleranceAlarmTime { get; set; }
  183. public double WaterTemperatureInletMinValue{ get; set; }
  184. public double WaterTemperatureInletMaxValue{ get; set; }
  185. public double WaterTemperatureInletOutOfToleranceWarningTime{ get; set; }
  186. public double WaterTemperatureInletOutOfToleranceAlarmTime{ get; set; }
  187. }
  188. public class ProcessConfigValue
  189. {
  190. public double ChamberPressureMaxValue { get; set; }
  191. public double PurgePumpTimeLimit { get; set; }
  192. public double PurgeVentTimeLimit { get; set; }
  193. public double PurgePumpStableTime { get; set; }
  194. public double PurgeVentStableTime { get; set; }
  195. public double PurgePumpPressure { get; set; }
  196. public double PurgeVentPressure { get; set; }
  197. public double PurgeCycleCount { get; set; }
  198. public double PurgeVentTime { get; set; }
  199. public double ElectrodeTemperatureAlarmRange { get; set; }
  200. public double ElectrodeTemperatureAlarmTime { get; set; }
  201. public double ElectrodeTemperatureCriticalDefault { get; set; }
  202. }
  203. public class PressureControlConfigValue
  204. {
  205. public bool IsIndependentControl { get; set; }
  206. public bool EnableBoosterPump { get; set; }
  207. public bool EnableBoosterPumpFrequency { get; set; }
  208. public bool EnableDryPump { get; set; }
  209. public bool EnableThrottleValve { get; set; }
  210. public double ChamberPressureGaugePrecision { get; set; }
  211. public bool PumpEnableN2Pressure { get; set; }
  212. public double PumpN2PressureMinValue { get; set; }
  213. public double PumpN2PressureMaxValue { get; set; }
  214. public double PumpN2PressureOutOfToleranceWarningTime { get; set; }
  215. public double PumpN2PressureOutOfToleranceAlarmTime { get; set; }
  216. public bool PumpEnableWaterFlow { get; set; }
  217. public double PumpWaterFlowMinValue { get; set; }
  218. public double PumpWaterFlowMaxValue { get; set; }
  219. public double PumpWaterFlowOutOfToleranceWarningTime { get; set; }
  220. public double PumpWaterFlowOutOfToleranceAlarmTime { get; set; }
  221. public double PumpN2PurgeMaxTimeWhenPumpOff { get; set; }
  222. public double MinVacuumGaugePressureAfterVent { get; set; }
  223. public double AtmPressure { get; set; }
  224. }
  225. public class VaporLineConfigValue
  226. {
  227. public string Vapor1Name { get; set; }
  228. public bool Vapor1Enable { get; set; }
  229. public bool Vapor1EnableMfc { get; set; }
  230. public double Vapor1MfcN2Scale { get; set; }
  231. public double Vapor1MfcScaleFactor { get; set; }
  232. public bool Vapor1MfcEnableAlarm { get; set; }
  233. public double Vapor1MfcAlarmRange { get; set; }
  234. public double Vapor1MfcAlarmTime { get; set; }
  235. public double Vapor1MfcDefaultSetPoint { get; set; }
  236. public string Vapor2Name{ get; set; }
  237. public bool Vapor2Enable { get; set; }
  238. public bool Vapor2EnableMfc { get; set; }
  239. public double Vapor2MfcN2Scale { get; set; }
  240. public double Vapor2MfcScaleFactor { get; set; }
  241. public bool Vapor2MfcEnableAlarm { get; set; }
  242. public double Vapor2MfcAlarmRange { get; set; }
  243. public double Vapor2MfcAlarmTime { get; set; }
  244. public double Vapor2MfcDefaultSetPoint { get; set; }
  245. public string Vapor3Name{ get; set; }
  246. public bool Vapor3Enable { get; set; }
  247. public bool Vapor3EnableMfc { get; set; }
  248. public double Vapor3MfcN2Scale { get; set; }
  249. public double Vapor3MfcScaleFactor { get; set; }
  250. public bool Vapor3MfcEnableAlarm { get; set; }
  251. public double Vapor3MfcAlarmRange { get; set; }
  252. public double Vapor3MfcAlarmTime { get; set; }
  253. public double Vapor3MfcDefaultSetPoint { get; set; }
  254. }
  255. public class GasLineConfigValue
  256. {
  257. public string Gas1Name{ get; set; }
  258. public bool Gas1Enable { get; set; }
  259. public double Gas1MfcN2Scale { get; set; }
  260. public double Gas1MfcScaleFactor { get; set; }
  261. public bool Gas1MfcEnableAlarm { get; set; }
  262. public double Gas1MfcAlarmRange { get; set; }
  263. public double Gas1MfcAlarmTime { get; set; }
  264. public double Gas1MfcDefaultSetPoint { get; set; }
  265. public double Gas1PressureMinValue { get; set; }
  266. public double Gas1PressureMaxValue { get; set; }
  267. public double Gas1PressureWarningTime { get; set; }
  268. public double Gas1PressureAlarmTime { get; set; }
  269. public double Gas1MfcFlowRegulationFactor { get; set; }
  270. public string Gas2Name{ get; set; }
  271. public bool Gas2Enable { get; set; }
  272. public double Gas2MfcN2Scale { get; set; }
  273. public double Gas2MfcScaleFactor { get; set; }
  274. public bool Gas2MfcEnableAlarm { get; set; }
  275. public double Gas2MfcAlarmRange { get; set; }
  276. public double Gas2MfcAlarmTime { get; set; }
  277. public double Gas2MfcDefaultSetPoint { get; set; }
  278. public double Gas2PressureMinValue { get; set; }
  279. public double Gas2PressureMaxValue { get; set; }
  280. public double Gas2PressureWarningTime { get; set; }
  281. public double Gas2PressureAlarmTime { get; set; }
  282. public double Gas2MfcFlowRegulationFactor { get; set; }
  283. public string Gas3Name{ get; set; }
  284. public bool Gas3Enable { get; set; }
  285. public double Gas3MfcN2Scale { get; set; }
  286. public double Gas3MfcScaleFactor { get; set; }
  287. public bool Gas3MfcEnableAlarm { get; set; }
  288. public double Gas3MfcAlarmRange { get; set; }
  289. public double Gas3MfcAlarmTime { get; set; }
  290. public double Gas3MfcDefaultSetPoint { get; set; }
  291. public double Gas3PressureMinValue { get; set; }
  292. public double Gas3PressureMaxValue { get; set; }
  293. public double Gas3PressureWarningTime { get; set; }
  294. public double Gas3PressureAlarmTime { get; set; }
  295. public double Gas3MfcFlowRegulationFactor { get; set; }
  296. public string Gas4Name{ get; set; }
  297. public bool Gas4Enable { get; set; }
  298. public double Gas4MfcN2Scale { get; set; }
  299. public double Gas4MfcScaleFactor { get; set; }
  300. public bool Gas4MfcEnableAlarm { get; set; }
  301. public double Gas4MfcAlarmRange { get; set; }
  302. public double Gas4MfcAlarmTime { get; set; }
  303. public double Gas4MfcDefaultSetPoint { get; set; }
  304. public double Gas4PressureMinValue { get; set; }
  305. public double Gas4PressureMaxValue { get; set; }
  306. public double Gas4PressureWarningTime { get; set; }
  307. public double Gas4PressureAlarmTime { get; set; }
  308. public double Gas4MfcFlowRegulationFactor { get; set; }
  309. public string Gas5Name{ get; set; }
  310. public bool Gas5Enable { get; set; }
  311. public double Gas5MfcN2Scale { get; set; }
  312. public double Gas5MfcScaleFactor { get; set; }
  313. public bool Gas5MfcEnableAlarm { get; set; }
  314. public double Gas5MfcAlarmRange { get; set; }
  315. public double Gas5MfcAlarmTime { get; set; }
  316. public double Gas5MfcDefaultSetPoint { get; set; }
  317. public double Gas5PressureMinValue { get; set; }
  318. public double Gas5PressureMaxValue { get; set; }
  319. public double Gas5PressureWarningTime { get; set; }
  320. public double Gas5PressureAlarmTime { get; set; }
  321. public double Gas5MfcFlowRegulationFactor { get; set; }
  322. public double CdaPressureMinValue { get; set; }
  323. public double CdaPressureMaxValue { get; set; }
  324. public double CdaPressureWarningTime { get; set; }
  325. public double CdaPressureAlarmTime { get; set; }
  326. public double N2PressureMinValue { get; set; }
  327. public double N2PressureMaxValue { get; set; }
  328. public double N2PressureWarningTime { get; set; }
  329. public double N2PressureAlarmTime { get; set; }
  330. }
  331. public class RfConfigValue
  332. {
  333. public bool EnablePulsingFunction { get; set; }
  334. public bool EnableReflectPower { get; set; }
  335. public bool EnableC1C2Position { get; set; }
  336. public bool EnableVoltageCurrent { get; set; }
  337. public double PowerRange { get; set; }
  338. public double Coefficient { get; set; }
  339. public double PowerRegulationFactor { get; set; }
  340. }
  341. public class SystemConfigValue
  342. {
  343. public bool IsEnableLocalPlc { get; set; }
  344. public bool IsEnableRemotePlc { get; set; }
  345. public int TimeLimitForOpenCloseSlitVavle { get; set; }
  346. public int TimeLimitOfOpenGasVavle { get; set; }
  347. public int TimeLimitOfCloseGasValve { get; set; }
  348. public bool IsSimulatorMode { get; set; }
  349. public bool IsAtmCycleMode { get; set; }
  350. public bool IsCheckSafeInterlockBeforeAutoRun { get; set; }
  351. public double PumpBasePressure { get; set; }
  352. public double PumpTimeLimit { get; set; }
  353. public double VentTime { get; set; }
  354. public double VentTimeLimit { get; set; }
  355. public double GasFlowPressureAlarmTime { get; set; }
  356. public double GasFlowPressureAlarmRange { get; set; }
  357. public double RfPowerAlarmRange { get; set; }
  358. public double RfPowerAlarmTime { get; set; }
  359. public double RfReflectPowerAlarmRange { get; set; }
  360. public double RfReflectPowerAlarmTime { get; set; }
  361. public int Language { get; set; }
  362. public int MatchMode { get; set; }
  363. public int RfMatchModeDuringProcess { get; set; }
  364. public double MatchPositionC1 { get; set; }
  365. public double MatchPositionC2 { get; set; }
  366. public bool IsMatchPresetMode { get; set; }
  367. public string RfOnTimeLastPMTime{ get; set; }
  368. public double RfOnTimeFromLastPM { get; set; }
  369. public double RfOnTimeTotal { get; set; }
  370. public double RfOnTimePMInterval { get; set; }
  371. public bool RfOnTimeEnableAlarm { get; set; }
  372. public string PumpOnTimeLastPMTime{ get; set; }
  373. public double PumpOnTimeFromLastPM { get; set; }
  374. public double PumpOnTimeTotal { get; set; }
  375. public double PumpOnTimePMInterval { get; set; }
  376. public bool PumpOnTimeEnableAlarm { get; set; }
  377. public double BoostPumpPressureSetPointMaxValue { get; set; }
  378. public double BuzzerBlinkingTime { get; set; }
  379. public bool IsTestMode { get; set; }
  380. public bool EnableFa { get; set; }
  381. public string FaLocalIPAddress { get; set; }
  382. }
  383. public class BarcodeConfigValue
  384. {
  385. public bool EnableBarcode { get; set; }
  386. public bool EnableSelectRecipeInAutoRun { get; set; }
  387. public int MinLotInputBarcodeLength { get; set; }
  388. public int MaxLotInputBarcodeLength { get; set; }
  389. public int MaxLotBarcodeCount { get; set; }
  390. public int MinRecipeInputBarcodeLength { get; set; }
  391. public int MaxRecipeInputBarcodeLength { get; set; }
  392. public int MaxRecipeBarcodeCount { get; set; }
  393. }
  394. }
  395. }