SCValue.cs 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Reflection;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using MECF.Framework.Common.DataCenter;
  8. using System.Xml.Serialization;
  9. using System.Windows.Documents;
  10. using System.Xml.Linq;
  11. namespace MECF.Framework.UI.Core.View.Common
  12. {
  13. public class SCValue
  14. {
  15. public Block4Config System_SetUp_4Block { get; set; }
  16. private Dictionary<string, Tuple<object, PropertyInfo>> _fieldMap =
  17. new Dictionary<string, Tuple<object, PropertyInfo>>();
  18. public SCValue()
  19. {
  20. System_SetUp_4Block = new Block4Config();
  21. }
  22. public List<string> GetKeys()
  23. {
  24. return _fieldMap.Keys.ToList();
  25. }
  26. public void SetKeys()
  27. {
  28. _fieldMap.Clear();
  29. Dictionary<string, object> items = new Dictionary<string, object>();
  30. PropertyInfo[] property = typeof(SCValue).GetProperties();
  31. foreach (PropertyInfo fiGroup in property)
  32. {
  33. object objGroup = fiGroup.GetValue(this, null);
  34. foreach (PropertyInfo fiItem in objGroup.GetType().GetProperties())
  35. {
  36. var type=fiItem.PropertyType;
  37. foreach (PropertyInfo moduleItem in fiItem.PropertyType.GetProperties())
  38. {
  39. string name = String.Format("{0}_{1}_{2}", fiGroup.Name, fiItem.Name, moduleItem.Name.Replace("Module", ""));
  40. if (_fieldMap.Keys.Contains(name))
  41. {
  42. _fieldMap[name] = Tuple.Create((object)type, moduleItem);
  43. }
  44. else
  45. {
  46. _fieldMap.Add(name, Tuple.Create((object)type, moduleItem));
  47. }
  48. }
  49. }
  50. }
  51. }
  52. public void AddKey(string key)
  53. {
  54. PropertyInfo[] property = typeof(SCValue).GetProperties();
  55. foreach (PropertyInfo fiGroup in property)
  56. {
  57. object objGroup = fiGroup.GetValue(this, null);
  58. foreach (PropertyInfo fiItem in objGroup.GetType().GetProperties())
  59. {
  60. string name = String.Format("{0}_{1}", fiGroup.Name, fiItem.Name);
  61. if (key == name)
  62. {
  63. _fieldMap[name] = Tuple.Create(objGroup, fiItem);
  64. return;
  65. }
  66. }
  67. }
  68. }
  69. public void RetrieveAll()
  70. {
  71. SetKeys();
  72. }
  73. public void Update(Dictionary<string, object> result)
  74. {
  75. if (result == null)
  76. return;
  77. foreach (KeyValuePair<string, object> item in result)
  78. {
  79. if (_fieldMap.ContainsKey(item.Key))
  80. {
  81. _fieldMap[item.Key].Item2.SetValue(_fieldMap[item.Key].Item1, item.Value, null);
  82. }
  83. }
  84. }
  85. public void Update(string key, string value)
  86. {
  87. if (!_fieldMap.ContainsKey(key))
  88. return;
  89. if (_fieldMap[key].Item2.PropertyType == typeof(double))
  90. {
  91. _fieldMap[key].Item2.SetValue(_fieldMap[key].Item1, Convert.ToDouble(value), null);
  92. }
  93. else if (_fieldMap[key].Item2.PropertyType == typeof(int))
  94. {
  95. _fieldMap[key].Item2.SetValue(_fieldMap[key].Item1, Convert.ToInt32(value), null);
  96. }
  97. else if (_fieldMap[key].Item2.PropertyType == typeof(string))
  98. {
  99. _fieldMap[key].Item2.SetValue(_fieldMap[key].Item1, value, null);
  100. }
  101. else if (_fieldMap[key].Item2.PropertyType == typeof(bool))
  102. {
  103. _fieldMap[key].Item2.SetValue(_fieldMap[key].Item1, Convert.ToBoolean(value), null);
  104. }
  105. }
  106. public Dictionary<string, object> GetValue()
  107. {
  108. Dictionary<string, object> result = new Dictionary<string, object>();
  109. foreach (var item in _fieldMap)
  110. {
  111. result[item.Key] = item.Value.Item2.GetValue(item.Value.Item1, null);
  112. }
  113. return result;
  114. }
  115. public class Block4Config
  116. {
  117. public CSB Block1 { get; set; }
  118. public PRB Block2 { get; set; }
  119. public PRB Block3 { get; set; }
  120. public IFB Block4 { get; set; }
  121. }
  122. public class Block3Config
  123. {
  124. public CSB Block1 { get; set; }
  125. public PRB Block2 { get; set; }
  126. public IFB Block4 { get; set; }
  127. }
  128. public class Block2Config
  129. {
  130. public CSB Block1 { get; set; }
  131. public PRB Block2 { get; set; }
  132. }
  133. public class CSB
  134. {
  135. public ArmModule Module0 { get; set; }
  136. public UNCModule Module1 { get; set; }
  137. public UNCModule Module2 { get; set; }
  138. public UNCModule Module3 { get; set; }
  139. public UNCModule Module4 { get; set; }
  140. }
  141. public class PRB
  142. {
  143. public ArmModule Module0 { get; set; }
  144. public COTAndDEVMoudle Module1 { get; set; }
  145. public COTAndDEVMoudle Module2 { get; set; }
  146. public COTAndDEVMoudle Module3 { get; set; }
  147. public COTAndDEVMoudle Module4 { get; set; }
  148. public CPLOrADHModule Module5 { get; set; }
  149. public CPLOrADHModule Module6 { get; set; }
  150. public CPLOrADHModule Module7 { get; set; }
  151. public CPLOrADHModule Module8 { get; set; }
  152. public CPLOrADHModule Module9 { get; set; }
  153. public CPLOrADHModule Module10 { get; set; }
  154. public CPLOrADHModule Module11 { get; set; }
  155. public CPLOrADHModule Module12 { get; set; }
  156. public CPLOrADHModule Module13 { get; set; }
  157. public CPLOrADHModule Module14 { get; set; }
  158. public CPLOrADHModule Module15 { get; set; }
  159. public CPLOrADHModule Module16 { get; set; }
  160. public CPLOrADHModule Module17 { get; set; }
  161. public CPLOrADHModule Module18 { get; set; }
  162. public CPLOrADHModule Module19 { get; set; }
  163. public CPLOrADHModule Module20 { get; set; }
  164. public CPLOrADHModule Module21 { get; set; }
  165. public CPLOrADHModule Module22 { get; set; }
  166. public CPLOrADHModule Module23 { get; set; }
  167. public CPLOrADHModule Module24 { get; set; }
  168. public CPLOrADHModule Module25 { get; set; }
  169. public CPLOrADHModule Module26 { get; set; }
  170. public CPLOrADHModule Module27 { get; set; }
  171. public CPLOrADHModule Module28 { get; set; }
  172. public CPLOrADHModule Module29 { get; set; }
  173. }
  174. public class IFB
  175. {
  176. public ArmModule Module0 { get; set; }
  177. public IFBMoudle Module1 { get; set; }
  178. public IFBMoudle Module2 { get; set; }
  179. public IFBMoudle Module3 { get; set; }
  180. public IFBMoudle Module4 { get; set; }
  181. public IFBMoudle Module5 { get; set; }
  182. }
  183. public class ArmModule : ModuleBase
  184. {
  185. public string TransferArm { get; set; }
  186. public ArmAxis X1axis { get; set; }
  187. public ArmAxis X2axis { get; set; }
  188. public ArmAxis X3axis { get; set; }
  189. public ArmAxis Yaxis { get; set; }
  190. public ArmAxis Zaxis { get; set; }
  191. public ArmAxis Raxis { get; set; }
  192. }
  193. public class UNCModule : ModuleBase
  194. {
  195. public string MappingType { get; set; }
  196. public int WaferThickness { get; set; }
  197. public int PositiveTolerance { get; set; }
  198. public int NegativeTolerance { get; set; }
  199. public int FirstSlotposition { get; set; }
  200. public string SlotEditingType { get; set; }
  201. public int SlotPitch { get; set; }
  202. public int MappingStartPosition { get; set; }
  203. public int MappingEndPosition { get; set; }
  204. public int SlotNo { get; set; }
  205. public TransferArmPosition TransferArmPosition { get; set; }
  206. }
  207. public class CPLOrADHModule : ModuleBase
  208. {
  209. public string ControlForm { get; set; }
  210. public double InitialData { get; set; }
  211. public double OverTemp { get; set; }
  212. public double SettlingDetermineTime { get; set; }
  213. public double SettlingTimeOut { get; set; }
  214. public double UsePointOffset { get; set; }
  215. public string BandStartMonitorForm { get; set; }
  216. public string BandInvalidTime { get; set; }
  217. public string BandProcessMonitorForm { get; set; }
  218. public string BandDeterminationTime { get; set; }
  219. public string BandProcessValue { get; set; }
  220. public string BandProcessPIDSetFormat { get; set; }
  221. public string BandProcessPIDP { get; set; }
  222. public string BandProcessPIDI { get; set; }
  223. public string BandProcessPIDD { get; set; }
  224. public string BandProcessOffset { get; set; }
  225. public string BandProcessOffsetValue { get; set; }
  226. public string AConstant { get; set; }
  227. public string SetValue { get; set; }
  228. public string RangeValueMin { get; set; }
  229. public string RangeValueMax { get; set; }
  230. public TransferArmPosition TransferArmPosition { get; set; }
  231. }
  232. public class COTAndDEVMoudle : ModuleBase
  233. {
  234. public int ArmCount { get; set; }
  235. public int ShakeArmNo { get; set; }
  236. public int UpperLimitSpinSpeed { get; set; }
  237. public int UpperLimitAcceleration { get; set; }
  238. public int SpinOffSpeed { get; set; }
  239. public int SpinOffTime { get; set; }
  240. public NozzleChanger NozzleChanger { get; set; }
  241. public NozzleArmInformat NozzleArmInformat1 { get; set; }
  242. public NozzleArmInformat NozzleArmInformat2 { get; set; }
  243. public TransferArmPosition TransferArmPosition { get; set; }
  244. }
  245. public class IFBMoudle : ModuleBase
  246. {
  247. public TransferArmPosition TransferArmPosition { get; set; }
  248. }
  249. public class NozzleChanger
  250. {
  251. public string IsNozzleChangerEnable { get; set; }
  252. public double MotorPulseRate { get; set; }
  253. public int MaxSpeed { get; set; }
  254. public string Data { get; set; }
  255. }
  256. public class NozzleArmInformat
  257. {
  258. public string IsNozzleArmEnable { get; set; }
  259. public string ArmDriveFormat { get; set; }
  260. public string NozzleForm { get; set; }
  261. public double MotorPulsesRate { get; set; }
  262. public double StartPosition { get; set; }
  263. public double EndPosition { get; set; }
  264. public double StartCupPosition { get; set; }
  265. public double EndCupPosition { get; set; }
  266. public string Home { get; set; }
  267. public string DmyDisp { get; set; }
  268. public string Standby1 { get; set; }
  269. public string Standby2 { get; set; }
  270. public string Begin { get; set; }
  271. public string Center { get; set; }
  272. public string End { get; set; }
  273. public string Dispense1 { get; set; }
  274. public string Dispense2 { get; set; }
  275. public string Dispense3 { get; set; }
  276. public string Dispense4 { get; set; }
  277. public string Dispense5 { get; set; }
  278. }
  279. public class TransferArmPosition
  280. {
  281. public Zaxis Zaxis { get; set; }
  282. public Pincette pincette1 { get; set; }
  283. public Pincette pincette2 { get; set; }
  284. public Pincette pincette3 { get; set; }
  285. }
  286. public class Zaxis
  287. {
  288. public string TransferMode { get; set; }
  289. public int StartOffset { get; set; }
  290. public int EndOffset { get; set; }
  291. public int SlowSpeedRate { get; set; }
  292. }
  293. public class Pincette
  294. {
  295. public int XaxisReceive { get; set; }
  296. public int XaxisSend { get; set; }
  297. public int YaxisReceive { get; set; }
  298. public int YaxisSend { get; set; }
  299. public int ZaxisReceive { get; set; }
  300. public int ZaxisSend { get; set; }
  301. public int RaxisReceive { get; set; }
  302. public int RaxisSend { get; set; }
  303. public int StrokeZaxisReceive { get; set; }
  304. public int StrokeZaxisSend { get; set; }
  305. public int ZaxisReceivePer { get; set; }
  306. public int ZaxisSendPer { get; set; }
  307. }
  308. public class ModuleBase
  309. {
  310. public string Name { get; set; }
  311. public string SYNEXC { get; set; }
  312. public int MaterialCount { get; set; }
  313. public int StartSlot { get; set; }
  314. public string AGVConnect { get; set; }
  315. }
  316. public class ArmAxis
  317. {
  318. public int SpeedInitial { get; set; }
  319. public int SpeedMovementbetweenmod { get; set; }
  320. public int SpeedReceive { get; set; }
  321. public int SpeedSend { get; set; }
  322. public int SpeedMapping { get; set; }
  323. public int SpeedMaintenance { get; set; }
  324. public int SpeedInching { get; set; }
  325. public string MultiMovementbetweenmod { get; set; }
  326. public int PassMovementbetweenmod { get; set; }
  327. public int PassReceive { get; set; }
  328. public int PassSpeedSend { get; set; }
  329. public int PassSpeedMapping { get; set; }
  330. }
  331. public class TransferConfigValue
  332. {
  333. public double InitAllTimeout { get; set; }
  334. public double MotorPushBarInAcceleration { get; set; }
  335. public double MotorPushBarInDeceleration { get; set; }
  336. public double MotorPushBarInStartFrequency { get; set; }
  337. public double MotorPushBarInDefaultServoSpeed { get; set; }
  338. public double MotorPushBarInDefaultManualSpeed { get; set; }
  339. public double MotorPushBarInServoOnTimeout { get; set; }
  340. public double MotorPushBarInMoveTimeout { get; set; }
  341. public double MotorPushBarInStopTimeout { get; set; }
  342. public double MotorPushBarInResetAlarmTimeout { get; set; }
  343. public double MotorPushBarInHomeTimeout { get; set; }
  344. public double MotorLoadStationInAcceleration { get; set; }
  345. public double MotorLoadStationInDeceleration { get; set; }
  346. public double MotorLoadStationInStartFrequency { get; set; }
  347. public double MotorLoadStationInDefaultServoSpeed { get; set; }
  348. public double MotorLoadStationInDefaultManualSpeed { get; set; }
  349. public double MotorLoadStationInServoOnTimeout { get; set; }
  350. public double MotorLoadStationInMoveTimeout { get; set; }
  351. public double MotorLoadStationInStopTimeout { get; set; }
  352. public double MotorLoadStationInResetAlarmTimeout { get; set; }
  353. public double MotorLoadStationInHomeTimeout { get; set; }
  354. public double MotorPushBarChamberAcceleration { get; set; }
  355. public double MotorPushBarChamberDeceleration { get; set; }
  356. public double MotorPushBarChamberStartFrequency { get; set; }
  357. public double MotorPushBarChamberDefaultServoSpeed { get; set; }
  358. public double MotorPushBarChamberDefaultManualSpeed { get; set; }
  359. public double MotorPushBarChamberServoOnTimeout { get; set; }
  360. public double MotorPushBarChamberMoveTimeout { get; set; }
  361. public double MotorPushBarChamberStopTimeout { get; set; }
  362. public double MotorPushBarChamberResetAlarmTimeout { get; set; }
  363. public double MotorPushBarChamberHomeTimeout { get; set; }
  364. public double MotorLoadStationOutAcceleration { get; set; }
  365. public double MotorLoadStationOutDeceleration { get; set; }
  366. public double MotorLoadStationOutStartFrequency { get; set; }
  367. public double MotorLoadStationOutDefaultServoSpeed { get; set; }
  368. public double MotorLoadStationOutDefaultManualSpeed { get; set; }
  369. public double MotorLoadStationOutServoOnTimeout { get; set; }
  370. public double MotorLoadStationOutMoveTimeout { get; set; }
  371. public double MotorLoadStationOutStopTimeout { get; set; }
  372. public double MotorLoadStationOutResetAlarmTimeout { get; set; }
  373. public double MotorLoadStationOutHomeTimeout { get; set; }
  374. }
  375. }
  376. }