ParameterManager.cs 86 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988
  1. using Aitex.Common.Util;
  2. using Aitex.Core.UI.MVVM;
  3. using MECF.Framework.Common.DataCenter;
  4. using MECF.Framework.Common.OperationCenter;
  5. using System;
  6. using System.Collections;
  7. using System.Collections.Generic;
  8. using System.Collections.ObjectModel;
  9. using System.Data;
  10. using System.IO;
  11. using System.Reflection;
  12. using System.Text;
  13. using System.Windows;
  14. using System.Xml;
  15. using System.Linq;
  16. using System.Xml.Schema;
  17. using System.Xml.Serialization;
  18. using Aitex.Core.RT.SCCore;
  19. using System.Threading.Tasks;
  20. using System.Windows.Documents;
  21. namespace MECF.Framework.Common.Utilities
  22. {
  23. //单选属性
  24. [Serializable]
  25. public class SelectionProperty : ViewModelBase
  26. {
  27. private string _Name;
  28. [XmlAttribute("Name")]
  29. public string Name
  30. {
  31. get { return _Name; }
  32. set { _Name = value; this.InvokePropertyChanged(nameof(Name)); }
  33. }
  34. private string _Display;
  35. [XmlAttribute("Display")]
  36. public string Display
  37. {
  38. get
  39. {
  40. return string.IsNullOrEmpty(_Display) ? Name : _Display;
  41. }
  42. set
  43. {
  44. _Display = value;
  45. this.InvokePropertyChanged(nameof(Display));
  46. }
  47. }
  48. private string _CurrentValue;
  49. [XmlAttribute("CurrentValue")]
  50. public string CurrentValue
  51. {
  52. get { return _CurrentValue; }
  53. set { _CurrentValue = value; this.InvokePropertyChanged(nameof(CurrentValue)); }
  54. }
  55. private ObservableCollection<string> _Values = new ObservableCollection<string>();
  56. [XmlArray("Values")]
  57. [XmlArrayItem("string")]
  58. public ObservableCollection<string> Values
  59. {
  60. get { return _Values; }
  61. set { _Values = value; this.InvokePropertyChanged(nameof(Values)); }
  62. }
  63. }
  64. public class ParameterManager
  65. {
  66. //private static string _ConfigPathName = @"c:\Furnace\Parameter.txt";
  67. //private static string _ConfigPathName = PathManager.GetCfgDir().Replace("UI", "RT") + "Parameter.xml";
  68. private static volatile Parameter instance;
  69. private static object locker = new Object();
  70. private static string _blockNumber = "4Block";
  71. public static string BlockNumber
  72. {
  73. get => _blockNumber;
  74. set
  75. {
  76. _blockNumber = value;
  77. }
  78. }
  79. //public static bool IsInitialize { get; set; } = false;
  80. private static bool _isInitialize;
  81. public static bool IsInitialize
  82. {
  83. get => _isInitialize;
  84. set
  85. {
  86. _isInitialize = value;
  87. }
  88. }
  89. public static List<SCConfigItem> ConfigItemList { get; set; }
  90. public static void InitializeBlock()
  91. {
  92. if (ConfigItemList == null || ConfigItemList.Count == 0)
  93. {
  94. ConfigItemList = QueryDataClient.Instance.Service.GetConfigItemList();
  95. }
  96. int[] blockNumbers = new int[] { 6, 30, 30, 6 };
  97. switch (instance.NumberOfBlocks)
  98. {
  99. case 2:
  100. blockNumbers = new int[] { 6, 30 };
  101. break;
  102. case 3:
  103. blockNumbers = new int[] { 6, 30, 6 };
  104. break;
  105. case 4:
  106. blockNumbers = new int[] { 6, 30, 30, 6 };
  107. break;
  108. default:
  109. break;
  110. }
  111. for (int i = 0; i < instance.NumberOfBlocks; i++)
  112. {
  113. ParameterManager.Instance.Blocks[i].Modules.Clear();
  114. for (int j = 0; j < blockNumbers[i]; j++)
  115. {
  116. ParameterManager.Instance.Blocks[i].Modules.Add(CreateDeviceModule(i + 1, j));
  117. }
  118. ParameterManager.Instance.Blocks[i].UseModuleNumber = ParameterManager.Instance.Blocks[i].Modules.ToList().Where(x => x.NameList.CurrentValue != "Reserved").Count() - 1;
  119. }
  120. CreateDispense();
  121. // CreateDispenseDrainDefault();
  122. }
  123. //private static string GetPropertyStr()
  124. //{
  125. // string retstr = "System.SetUp.4Block.Block";
  126. // switch (ParameterManager.Instance.NumberOfBlocks)
  127. // {
  128. // case 2:
  129. // retstr = "System.SetUp.2Block.Block";
  130. // break;
  131. // case 3:
  132. // retstr = "System.SetUp.3Block.Block";
  133. // break;
  134. // case 4:
  135. // retstr = "System.SetUp.4Block.Block";
  136. // break;
  137. // default:
  138. // break;
  139. // }
  140. // return retstr;
  141. //}
  142. /// <summary>
  143. /// 需要特别注意3block的block3==4block的block4
  144. /// </summary>
  145. /// <param name="noId"></param>
  146. /// <returns></returns>
  147. private static DeviceModule CreateDeviceModule(int blockId, int moduleId)
  148. {
  149. string propertyStr = "System.SetUp.Block";// GetPropertyStr();
  150. string noId = $"{blockId}.{moduleId}";
  151. if (instance.NumberOfBlocks == 3 && blockId == 3)
  152. {
  153. noId = $"{blockId + 1}.{moduleId}";
  154. }
  155. var moduleName = (string)QueryDataClient.Instance.Service.GetConfig(($"{propertyStr}{noId}.Name"));
  156. string parameter = ConfigItemList.Where(x => x.PathName == ($"{propertyStr}{noId}.Name")).FirstOrDefault()?.Parameter;
  157. DeviceModule deviceModule = new DeviceModule($"{blockId}-{moduleId}", moduleId.ToString(), moduleName);
  158. deviceModule.NameList.CurrentValue = moduleName;
  159. deviceModule.ParameterName = moduleName;
  160. if (parameter != null && parameter != "")
  161. {
  162. var listStr = parameter.Split(';');
  163. foreach (var item in listStr)
  164. {
  165. deviceModule.NameList.Values.Add(item);
  166. }
  167. }
  168. //SetSCToModule(ref deviceModule);
  169. return deviceModule;
  170. }
  171. public Dictionary<string, string> GetScValue(string root)
  172. {
  173. Dictionary<string, string> result = new Dictionary<string, string>();
  174. for (int i = 0; i < instance.NumberOfBlocks; i++)
  175. {
  176. foreach (var block in Instance.Blocks)
  177. {
  178. block.GetScValue($"{root}Block{block.ID}.");
  179. }
  180. }
  181. //result[$"{root}.StartSlot"] = StartSlot.ToString();
  182. //for (int i = 0; i < 6; i++)
  183. //{
  184. // //result.Join()
  185. // //ArmAxisList.Add(new ArmAxis());
  186. //}
  187. return result;
  188. }
  189. //private static void SetSCToModule(ref DeviceModule deviceModule)
  190. //{
  191. // string propertyStr = GetPropertyStr();
  192. // deviceModule.Name = deviceModule.NameList.CurrentValue;
  193. // foreach (var item in typeof(DeviceModule).GetProperties())
  194. // {
  195. // if (item.Name == "ID" || item.Name == "Name" || item.Name == "ModuleID" || item.Name == "ParentID") continue;
  196. // var scPath = $"{propertyStr}{deviceModule.ModuleID.Replace("-", ".")}.{item.Name}";
  197. // if (item.PropertyType == typeof(string))
  198. // {
  199. // item.SetValue(deviceModule, (string)QueryDataClient.Instance.Service.GetConfig(scPath));
  200. // }
  201. // else if (item.PropertyType == typeof(SelectionProperty))
  202. // {
  203. // var SelectionProperty = new SelectionProperty();
  204. // SelectionProperty.CurrentValue = (string)QueryDataClient.Instance.Service.GetConfig(scPath);
  205. // string strparameter = ConfigItemList.Where(x => x.PathName == scPath).FirstOrDefault()?.Parameter;
  206. // if (strparameter != null && strparameter != "")
  207. // {
  208. // var strList = strparameter.Split(';').ToList();
  209. // strList.ForEach(x => SelectionProperty.Values.Add(x));
  210. // }
  211. // item.SetValue(deviceModule, SelectionProperty);
  212. // }
  213. // else if (item.PropertyType == typeof(double))
  214. // {
  215. // item.SetValue(deviceModule, (double)QueryDataClient.Instance.Service.GetConfig(scPath));
  216. // }
  217. // else if (item.PropertyType == typeof(int))
  218. // {
  219. // var getValue = QueryDataClient.Instance.Service.GetConfig(scPath);
  220. // if (getValue != null)
  221. // item.SetValue(deviceModule, (int)QueryDataClient.Instance.Service.GetConfig(scPath));
  222. // }
  223. // else if (item.PropertyType == typeof(SpinerModule))
  224. // {
  225. // if (IsSpinModule(deviceModule.Name))
  226. // {
  227. // SpinerModule spinerModule = new SpinerModule();
  228. // var spinerModuleStr = $"{propertyStr}{deviceModule.ModuleID.Replace("-", ".")}.";
  229. // spinerModule.ArmCount = ((int)QueryDataClient.Instance.Service.GetConfig($"{spinerModuleStr}ArmCount")).ToString();
  230. // spinerModule.ShakeArmNo = ((int)QueryDataClient.Instance.Service.GetConfig($"{spinerModuleStr}ShakeArmNo")).ToString();
  231. // spinerModule.UpperLimitSpinRotationSpeed = ((int)QueryDataClient.Instance.Service.GetConfig($"{spinerModuleStr}UpperLimitSpinSpeed")).ToString();
  232. // spinerModule.UpperLimitAccelerationSpeed = ((int)QueryDataClient.Instance.Service.GetConfig($"{spinerModuleStr}UpperLimitAcceleration")).ToString();
  233. // spinerModule.SpinOffSpeed = ((int)QueryDataClient.Instance.Service.GetConfig($"{spinerModuleStr}SpinOutSpeed")).ToString();
  234. // spinerModule.SpinOffTime = ((int)QueryDataClient.Instance.Service.GetConfig($"{spinerModuleStr}SpinOutTime")).ToString();
  235. // NozzleChanger nozzleChanger = new NozzleChanger();
  236. // nozzleChanger.IsNozzleChangerEnable = (string)QueryDataClient.Instance.Service.GetConfig($"{spinerModuleStr}NozzleChanger");
  237. // nozzleChanger.MotorPulseRate = ((double)QueryDataClient.Instance.Service.GetConfig($"{spinerModuleStr}NozzleChangerMotorPulseRate")).ToString();
  238. // nozzleChanger.MaxSpeed = ((int)QueryDataClient.Instance.Service.GetConfig($"{spinerModuleStr}NozzleChangerMaxSpeed")).ToString();
  239. // nozzleChanger.SetNozzleChangerDataList((string)QueryDataClient.Instance.Service.GetConfig($"{spinerModuleStr}NozzleChangerData"));
  240. // spinerModule.NozzleChanger = nozzleChanger;
  241. // NozzleArmInformat nozzleArmInformat1 = new NozzleArmInformat();
  242. // nozzleArmInformat1.IsNozzleArmEnable = (string)QueryDataClient.Instance.Service.GetConfig($"{spinerModuleStr}NozzleArm1");
  243. // nozzleArmInformat1.ArmDriveFormat = (string)QueryDataClient.Instance.Service.GetConfig($"{spinerModuleStr}NozzleArm1ArmFormat");
  244. // nozzleArmInformat1.NozzleForm = (string)QueryDataClient.Instance.Service.GetConfig($"{spinerModuleStr}NozzleArm1Format");
  245. // nozzleArmInformat1.MotorPulsesRate = ((double)QueryDataClient.Instance.Service.GetConfig($"{spinerModuleStr}NozzleArm1MotorPulseRate")).ToString();
  246. // nozzleArmInformat1.StartPosition = ((double)QueryDataClient.Instance.Service.GetConfig($"{spinerModuleStr}NozzleArm1StartPosition")).ToString();
  247. // nozzleArmInformat1.EndPosition = ((double)QueryDataClient.Instance.Service.GetConfig($"{spinerModuleStr}NozzleArm1EndPosition")).ToString();
  248. // nozzleArmInformat1.StartCupPosition = ((double)QueryDataClient.Instance.Service.GetConfig($"{spinerModuleStr}NozzleArm1StartCupPosition")).ToString();
  249. // nozzleArmInformat1.EndCupPosition = ((double)QueryDataClient.Instance.Service.GetConfig($"{spinerModuleStr}NozzleArm1EndCupPosition")).ToString();
  250. // nozzleArmInformat1.Home = new TransferArmRecipePositionData((string)QueryDataClient.Instance.Service.GetConfig($"{spinerModuleStr}NozzleArm1RcpHome"));
  251. // nozzleArmInformat1.DmyDisp = new TransferArmRecipePositionData((string)QueryDataClient.Instance.Service.GetConfig($"{spinerModuleStr}NozzleArm1RcpDmyDisp"));
  252. // nozzleArmInformat1.Standby1 = new TransferArmRecipePositionData((string)QueryDataClient.Instance.Service.GetConfig($"{spinerModuleStr}NozzleArm1RcpStandby1"));
  253. // nozzleArmInformat1.Standby2 = new TransferArmRecipePositionData((string)QueryDataClient.Instance.Service.GetConfig($"{spinerModuleStr}NozzleArm1RcpStandby2"));
  254. // nozzleArmInformat1.Begin = new TransferArmRecipePositionData((string)QueryDataClient.Instance.Service.GetConfig($"{spinerModuleStr}NozzleArm1RcpBegin"));
  255. // nozzleArmInformat1.Center = new TransferArmRecipePositionData((string)QueryDataClient.Instance.Service.GetConfig($"{spinerModuleStr}NozzleArm1RcpCenter"));
  256. // nozzleArmInformat1.End = new TransferArmRecipePositionData((string)QueryDataClient.Instance.Service.GetConfig($"{spinerModuleStr}NozzleArm1RcpEnd"));
  257. // nozzleArmInformat1.Dispense1 = new TransferArmRecipePositionData((string)QueryDataClient.Instance.Service.GetConfig($"{spinerModuleStr}NozzleArm1RcpDispense1"));
  258. // nozzleArmInformat1.Dispense2 = new TransferArmRecipePositionData((string)QueryDataClient.Instance.Service.GetConfig($"{spinerModuleStr}NozzleArm1RcpDispense2"));
  259. // nozzleArmInformat1.Dispense3 = new TransferArmRecipePositionData((string)QueryDataClient.Instance.Service.GetConfig($"{spinerModuleStr}NozzleArm1RcpDispense3"));
  260. // nozzleArmInformat1.Dispense4 = new TransferArmRecipePositionData((string)QueryDataClient.Instance.Service.GetConfig($"{spinerModuleStr}NozzleArm1RcpDispense4"));
  261. // nozzleArmInformat1.Dispense5 = new TransferArmRecipePositionData((string)QueryDataClient.Instance.Service.GetConfig($"{spinerModuleStr}NozzleArm1RcpDispense5"));
  262. // NozzleArmInformat nozzleArmInformat2 = new NozzleArmInformat();
  263. // nozzleArmInformat2.IsNozzleArmEnable = (string)QueryDataClient.Instance.Service.GetConfig($"{spinerModuleStr}NozzleArm2");
  264. // nozzleArmInformat2.ArmDriveFormat = (string)QueryDataClient.Instance.Service.GetConfig($"{spinerModuleStr}NozzleArm2ArmFormat");
  265. // nozzleArmInformat2.NozzleForm = (string)QueryDataClient.Instance.Service.GetConfig($"{spinerModuleStr}NozzleArm2Format");
  266. // nozzleArmInformat2.MotorPulsesRate = ((double)QueryDataClient.Instance.Service.GetConfig($"{spinerModuleStr}NozzleArm2MotorPulseRate")).ToString();
  267. // nozzleArmInformat2.StartPosition = ((double)QueryDataClient.Instance.Service.GetConfig($"{spinerModuleStr}NozzleArm2StartPosition")).ToString();
  268. // nozzleArmInformat2.EndPosition = ((double)QueryDataClient.Instance.Service.GetConfig($"{spinerModuleStr}NozzleArm2EndPosition")).ToString();
  269. // nozzleArmInformat2.StartCupPosition = ((double)QueryDataClient.Instance.Service.GetConfig($"{spinerModuleStr}NozzleArm2StartCupPosition")).ToString();
  270. // nozzleArmInformat2.EndCupPosition = ((double)QueryDataClient.Instance.Service.GetConfig($"{spinerModuleStr}NozzleArm2EndCupPosition")).ToString();
  271. // nozzleArmInformat2.Home = new TransferArmRecipePositionData((string)QueryDataClient.Instance.Service.GetConfig($"{spinerModuleStr}NozzleArm2RcpHome"));
  272. // nozzleArmInformat2.DmyDisp = new TransferArmRecipePositionData((string)QueryDataClient.Instance.Service.GetConfig($"{spinerModuleStr}NozzleArm2RcpDmyDisp"));
  273. // nozzleArmInformat2.Standby1 = new TransferArmRecipePositionData((string)QueryDataClient.Instance.Service.GetConfig($"{spinerModuleStr}NozzleArm2RcpStandby1"));
  274. // nozzleArmInformat2.Standby2 = new TransferArmRecipePositionData((string)QueryDataClient.Instance.Service.GetConfig($"{spinerModuleStr}NozzleArm2RcpStandby2"));
  275. // nozzleArmInformat2.Begin = new TransferArmRecipePositionData((string)QueryDataClient.Instance.Service.GetConfig($"{spinerModuleStr}NozzleArm2RcpBegin"));
  276. // nozzleArmInformat2.Center = new TransferArmRecipePositionData((string)QueryDataClient.Instance.Service.GetConfig($"{spinerModuleStr}NozzleArm2RcpCenter"));
  277. // nozzleArmInformat2.End = new TransferArmRecipePositionData((string)QueryDataClient.Instance.Service.GetConfig($"{spinerModuleStr}NozzleArm2RcpEnd"));
  278. // nozzleArmInformat2.Dispense1 = new TransferArmRecipePositionData((string)QueryDataClient.Instance.Service.GetConfig($"{spinerModuleStr}NozzleArm2RcpDispense1"));
  279. // nozzleArmInformat2.Dispense2 = new TransferArmRecipePositionData((string)QueryDataClient.Instance.Service.GetConfig($"{spinerModuleStr}NozzleArm2RcpDispense2"));
  280. // nozzleArmInformat2.Dispense3 = new TransferArmRecipePositionData((string)QueryDataClient.Instance.Service.GetConfig($"{spinerModuleStr}NozzleArm2RcpDispense3"));
  281. // nozzleArmInformat2.Dispense4 = new TransferArmRecipePositionData((string)QueryDataClient.Instance.Service.GetConfig($"{spinerModuleStr}NozzleArm2RcpDispense4"));
  282. // nozzleArmInformat2.Dispense5 = new TransferArmRecipePositionData((string)QueryDataClient.Instance.Service.GetConfig($"{spinerModuleStr}NozzleArm2RcpDispense5"));
  283. // NozzleArmInformat nozzleArmInformat3 = new NozzleArmInformat();
  284. // nozzleArmInformat3.IsNozzleArmEnable = (string)QueryDataClient.Instance.Service.GetConfig($"{spinerModuleStr}NozzleArm3");
  285. // nozzleArmInformat3.ArmDriveFormat = (string)QueryDataClient.Instance.Service.GetConfig($"{spinerModuleStr}NozzleArm3ArmFormat");
  286. // nozzleArmInformat3.NozzleForm = (string)QueryDataClient.Instance.Service.GetConfig($"{spinerModuleStr}NozzleArm3Format");
  287. // nozzleArmInformat3.MotorPulsesRate = ((double)QueryDataClient.Instance.Service.GetConfig($"{spinerModuleStr}NozzleArm3MotorPulseRate")).ToString();
  288. // nozzleArmInformat3.StartPosition = ((double)QueryDataClient.Instance.Service.GetConfig($"{spinerModuleStr}NozzleArm3StartPosition")).ToString();
  289. // nozzleArmInformat3.EndPosition = ((double)QueryDataClient.Instance.Service.GetConfig($"{spinerModuleStr}NozzleArm3EndPosition")).ToString();
  290. // nozzleArmInformat3.StartCupPosition = ((double)QueryDataClient.Instance.Service.GetConfig($"{spinerModuleStr}NozzleArm3StartCupPosition")).ToString();
  291. // nozzleArmInformat3.EndCupPosition = ((double)QueryDataClient.Instance.Service.GetConfig($"{spinerModuleStr}NozzleArm3EndCupPosition")).ToString();
  292. // nozzleArmInformat3.Home = new TransferArmRecipePositionData((string)QueryDataClient.Instance.Service.GetConfig($"{spinerModuleStr}NozzleArm3RcpHome"));
  293. // nozzleArmInformat3.DmyDisp = new TransferArmRecipePositionData((string)QueryDataClient.Instance.Service.GetConfig($"{spinerModuleStr}NozzleArm3RcpDmyDisp"));
  294. // nozzleArmInformat3.Standby1 = new TransferArmRecipePositionData((string)QueryDataClient.Instance.Service.GetConfig($"{spinerModuleStr}NozzleArm3RcpStandby1"));
  295. // nozzleArmInformat3.Standby2 = new TransferArmRecipePositionData((string)QueryDataClient.Instance.Service.GetConfig($"{spinerModuleStr}NozzleArm3RcpStandby2"));
  296. // nozzleArmInformat3.Begin = new TransferArmRecipePositionData((string)QueryDataClient.Instance.Service.GetConfig($"{spinerModuleStr}NozzleArm3RcpBegin"));
  297. // nozzleArmInformat3.Center = new TransferArmRecipePositionData((string)QueryDataClient.Instance.Service.GetConfig($"{spinerModuleStr}NozzleArm3RcpCenter"));
  298. // nozzleArmInformat3.End = new TransferArmRecipePositionData((string)QueryDataClient.Instance.Service.GetConfig($"{spinerModuleStr}NozzleArm3RcpEnd"));
  299. // nozzleArmInformat3.Dispense1 = new TransferArmRecipePositionData((string)QueryDataClient.Instance.Service.GetConfig($"{spinerModuleStr}NozzleArm3RcpDispense1"));
  300. // nozzleArmInformat3.Dispense2 = new TransferArmRecipePositionData((string)QueryDataClient.Instance.Service.GetConfig($"{spinerModuleStr}NozzleArm3RcpDispense2"));
  301. // nozzleArmInformat3.Dispense3 = new TransferArmRecipePositionData((string)QueryDataClient.Instance.Service.GetConfig($"{spinerModuleStr}NozzleArm3RcpDispense3"));
  302. // nozzleArmInformat3.Dispense4 = new TransferArmRecipePositionData((string)QueryDataClient.Instance.Service.GetConfig($"{spinerModuleStr}NozzleArm3RcpDispense4"));
  303. // nozzleArmInformat3.Dispense5 = new TransferArmRecipePositionData((string)QueryDataClient.Instance.Service.GetConfig($"{spinerModuleStr}NozzleArm3RcpDispense5"));
  304. // spinerModule.NozzleArmInformat1 = nozzleArmInformat1;
  305. // spinerModule.NozzleArmInformat2 = nozzleArmInformat2;
  306. // item.SetValue(deviceModule, spinerModule);
  307. // }
  308. // }
  309. // }
  310. // var transferArmstr = (string)QueryDataClient.Instance.Service.GetConfig(($"{propertyStr}{deviceModule.ModuleID.Replace("-", "_")}_TransferArm").Replace('_', '.'));
  311. // if (transferArmstr != null && transferArmstr != "")
  312. // {
  313. // int index = int.Parse(deviceModule.ModuleID.Split('-')[0]) - 1;
  314. // ParameterManager.Instance.Blocks[index].TransferArmAccessModules = GetArmAccessModule(transferArmstr);
  315. // }
  316. //}
  317. public static ObservableCollection<string> GetArmAccessModule(string str)
  318. {
  319. ObservableCollection<string> strList = new ObservableCollection<string>();
  320. if (BlockNumber == "3Block")
  321. {
  322. if (str.Contains("4-"))
  323. {
  324. str = str.Replace("4-", "3-");
  325. }
  326. }
  327. var strlist = str.Split(';');
  328. foreach (var item in strlist)
  329. {
  330. strList.Add(item);
  331. }
  332. return strList;
  333. }
  334. public static string[] COTDispenseNozzleStrs = new string[] { "Resist1", "Resist2" , "Resist3","Resist4", "Resist5", "Resist6", "Resist7", "Resist8",
  335. "RRC1","RRC2","Test1","Test2","E.B.R.1","E.B.R.2","R1 Filter Air Vent","R2 Filter Air Vent","R3 Filter Air Vent","R4 Filter Air Vent",
  336. "TANK Press","","Back Rinse1","Back Rinse2","Solvent Bath","","Auto Damper","Back Rinse1+2","Drain Case Clean","EXH Duct Clean"};
  337. public static string[] DEVDispenseNozzleStrs = new string[] { "DEV Solution1", "DEV Solution2" , "DEV Solution3", "DEV Solution4", "", "", "",
  338. "DEV Nozzle1 Air Vent","DEV Nozzle2 Air Vent","","","Rinse1","Rinse2","Filter1 Vent","Filter2 Vent","Filter3 Vent","Filter4 Vent",
  339. "Tank Press","AD Promoter","Back Rinse1","Water Shield","Exhaust","Auto Damper","N2 Blow","Nozzle1 Rinse","Nozzle2 Rinse",
  340. "PDD Nozzle1","PDD Nozzle2","N2 Splay(DEV)","N3 Splay(Rinse)","Bypass"};
  341. public static string[] ADHDispenseNozzleStrs = new string[] { "HMDS" };
  342. public static void CreateDispense()
  343. {
  344. ParameterManager.Instance.SpinerDeviceModule.Clear();
  345. if (ParameterManager.Instance.Blocks[1] != null)
  346. {
  347. ParameterManager.Instance.Blocks[1].Modules.ToList().ForEach(x =>
  348. {
  349. if (IsSpinModule(x.Name)) ParameterManager.Instance.SpinerDeviceModule.Add(x);
  350. });
  351. ParameterManager.Instance.Blocks[1].Modules.ToList().ForEach(x =>
  352. {
  353. if (IsSpinModule(x.Name) || IsADHModule(x.Name)) ParameterManager.Instance.DispenseDeviceModule.Add(x);
  354. });
  355. }
  356. if (ParameterManager.Instance.NumberOfBlocks > 2 && ParameterManager.Instance.Blocks[2] != null)
  357. {
  358. ParameterManager.Instance.Blocks[2].Modules.ToList().ForEach(x =>
  359. {
  360. if (IsSpinModule(x.Name)) ParameterManager.Instance.SpinerDeviceModule.Add(x);
  361. });
  362. ParameterManager.Instance.Blocks[2].Modules.ToList().ForEach(x =>
  363. {
  364. if (IsSpinModule(x.Name) || IsADHModule(x.Name)) ParameterManager.Instance.DispenseDeviceModule.Add(x);
  365. });
  366. }
  367. }
  368. //private static void CreateDispenseDrainDefault()
  369. //{
  370. // ParameterManager.Instance.ModuleDispenseConfigList = new Dictionary<string, Dictionary<string, DispenseConfig>>();
  371. // for (int i = 0; i < ParameterManager.Instance.DispenseDeviceModule.Count; i++)
  372. // {
  373. // string strFileDispense = QueryDataClient.Instance.Service.GetConfigFileDispenseByModule(ParameterManager.Instance.DispenseDeviceModule[i].ID);
  374. // Dictionary<string, DispenseConfig> dispenseConfigList = new Dictionary<string, DispenseConfig>();
  375. // if (strFileDispense != null)
  376. // {
  377. // string[] listDispense = strFileDispense.Split(new string[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries);
  378. // Dictionary<string, string> dictDispense = new Dictionary<string, string>();
  379. // for (int x = 0; x < listDispense.Length; x++)
  380. // {
  381. // string[] sigDispense = listDispense[x].Split(':');
  382. // dictDispense.Add(sigDispense[0], sigDispense[1]);
  383. // }
  384. // switch (ParameterManager.Instance.DispenseDeviceModule[i].Name)
  385. // {
  386. // case "COT":
  387. // for (int j = 0; j < COTDispenseNozzleStrs.Length; j++)
  388. // {
  389. // if (COTDispenseNozzleStrs[j] != "")
  390. // {
  391. // dispenseConfigList.Add(COTDispenseNozzleStrs[j], new DispenseConfig(dictDispense[COTDispenseNozzleStrs[j]]));
  392. // }
  393. // }
  394. // break;
  395. // case "DEV":
  396. // for (int j = 0; j < DEVDispenseNozzleStrs.Length; j++)
  397. // {
  398. // if (DEVDispenseNozzleStrs[j] != "")
  399. // {
  400. // dispenseConfigList.Add(DEVDispenseNozzleStrs[j], new DispenseConfig(dictDispense[DEVDispenseNozzleStrs[j]]));
  401. // }
  402. // }
  403. // break;
  404. // default:
  405. // break;
  406. // }
  407. // }
  408. // else
  409. // {
  410. // switch (ParameterManager.Instance.DispenseDeviceModule[i].Name)
  411. // {
  412. // case "COT":
  413. // for (int j = 0; j < COTDispenseNozzleStrs.Length; j++)
  414. // {
  415. // if (COTDispenseNozzleStrs[j] != "")
  416. // {
  417. // dispenseConfigList.Add(COTDispenseNozzleStrs[j], new DispenseConfig());
  418. // }
  419. // }
  420. // break;
  421. // case "DEV":
  422. // for (int j = 0; j < DEVDispenseNozzleStrs.Length; j++)
  423. // {
  424. // if (DEVDispenseNozzleStrs[j] != "")
  425. // {
  426. // dispenseConfigList.Add(DEVDispenseNozzleStrs[j], new DispenseConfig());
  427. // }
  428. // }
  429. // break;
  430. // default:
  431. // break;
  432. // }
  433. // }
  434. // ParameterManager.Instance.ModuleDispenseConfigList.Add(ParameterManager.Instance.DispenseDeviceModule[i].ID, dispenseConfigList);
  435. // }
  436. //}
  437. public static bool IsSpinModule(string moduleName)
  438. {
  439. bool isSpin = false;
  440. string[] spinMdules = new string[] { "COT", "BCT", "TCT", "DEV", "NTD" };
  441. if (spinMdules.Contains(moduleName))
  442. {
  443. isSpin = true;
  444. }
  445. return isSpin;
  446. }
  447. public static bool IsADHModule(string moduleName)
  448. {
  449. bool ret = false;
  450. string[] spinMdules = new string[] { "ADH" };
  451. if (spinMdules.Contains(moduleName))
  452. {
  453. ret = true;
  454. }
  455. return ret;
  456. }
  457. public static Parameter Instance
  458. {
  459. get
  460. {
  461. lock (locker)
  462. {
  463. if (instance == null)
  464. {
  465. instance = new Parameter(BlockNumber);
  466. InitializeBlock();
  467. }
  468. return instance;
  469. }
  470. }
  471. }
  472. public static void SaveParameter(object pa)
  473. {
  474. //StreamWriter stream = null;
  475. //try
  476. //{
  477. // stream = new StreamWriter(_ConfigPathName);
  478. // XmlSerializer xmlSerializer = new XmlSerializer(typeof(Parameter));
  479. // xmlSerializer.Serialize(stream, pa);
  480. // stream.Flush();
  481. //}
  482. //finally
  483. //{
  484. // if (stream != null)
  485. // {
  486. // stream.Close();
  487. // stream.Dispose();
  488. // }
  489. //}
  490. }
  491. //private static object GetParameter()
  492. //{
  493. //StreamReader stream = null;
  494. //try
  495. //{
  496. // stream = new StreamReader(_ConfigPathName);
  497. // XmlSerializer xmlSerializer1 = new XmlSerializer(typeof(Parameter));
  498. // var pa = xmlSerializer1.Deserialize(stream);
  499. // return pa;
  500. //}
  501. //finally
  502. //{
  503. // if (stream != null)
  504. // {
  505. // stream.Close();
  506. // stream.Dispose();
  507. // }
  508. //}
  509. //}
  510. }
  511. [Serializable]
  512. public class Parameter
  513. {
  514. public Parameter() { InitParameter(); }
  515. public Dictionary<string, Dictionary<string, DispenseConfig>> ModuleDispenseConfigList { get; set; } = new Dictionary<string, Dictionary<string, DispenseConfig>>();
  516. public ObservableCollection<DeviceModule> SpinerDeviceModule { get; set; } = new ObservableCollection<DeviceModule>();
  517. public ObservableCollection<DeviceModule> DispenseDeviceModule { get; set; } = new ObservableCollection<DeviceModule>();
  518. public Parameter(string blockNumber)
  519. {
  520. _NumberOfBlocks = BlockStrToInt(blockNumber);
  521. CreateBlocks();
  522. InitParameter();
  523. }
  524. private static int BlockStrToInt(string blockNumber)
  525. {
  526. var number = 4;
  527. switch (blockNumber)
  528. {
  529. case "4Block":
  530. number = 4;
  531. break;
  532. case "3Block":
  533. number = 3;
  534. break;
  535. case "2Block":
  536. number = 2;
  537. break;
  538. default:
  539. break;
  540. }
  541. return number;
  542. }
  543. [XmlArray("Blocks")]
  544. [XmlArrayItem("DeviceBlock")]
  545. public ObservableCollection<DeviceBlock> Blocks { get; set; } = new ObservableCollection<DeviceBlock>();
  546. private int _NumberOfBlocks;
  547. [XmlAttribute("_NumberOfBlocks")]
  548. public int NumberOfBlocks
  549. {
  550. get { return _NumberOfBlocks; }
  551. set
  552. {
  553. if (value < 1 || value > 4) throw new Exception("value should between 1 and 4");
  554. if (_NumberOfBlocks != value)
  555. {
  556. _NumberOfBlocks = value;
  557. CreateBlocks();
  558. InitParameter();
  559. }
  560. }
  561. }
  562. public void CreateBlocks()
  563. {
  564. Blocks.Clear();
  565. switch (NumberOfBlocks)
  566. {
  567. case 2:
  568. Blocks.Add(new DeviceBlock(1) { Name = "CSB" });
  569. Blocks.Add(new DeviceBlock(2) { Name = "PRB1" });
  570. break;
  571. case 3:
  572. Blocks.Add(new DeviceBlock(1) { Name = "CSB" });
  573. Blocks.Add(new DeviceBlock(2) { Name = "PRB1" });
  574. Blocks.Add(new DeviceBlock(3) { Name = "IFB" });
  575. break;
  576. case 4:
  577. Blocks.Add(new DeviceBlock(1) { Name = "CSB" });
  578. Blocks.Add(new DeviceBlock(2) { Name = "PRB1" });
  579. Blocks.Add(new DeviceBlock(3) { Name = "PRB2" });
  580. Blocks.Add(new DeviceBlock(4) { Name = "IFB" });
  581. break;
  582. default:
  583. break;
  584. }
  585. }
  586. public void InitParameter()
  587. {
  588. GetMonitorEditData();
  589. //NumberOfBlocks = 1;
  590. //InitSystemParameter();
  591. //InitTransferOutOrInOrder();
  592. GetDataCollection();
  593. }
  594. private void GetMonitorEditData()
  595. {
  596. string strFileMonitorEdit = (string)QueryDataClient.Instance.Service.GetConfig("System.SetUp.MonitorEdit");
  597. if (strFileMonitorEdit != null && strFileMonitorEdit != "")
  598. {
  599. MonitorData.Clear();
  600. string[] listMonitorEdit = strFileMonitorEdit.Split(new string[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries);
  601. for (int i = 0; i < listMonitorEdit.Length; i++)
  602. {
  603. MonitorData.Add(new MonitorEditData(listMonitorEdit[i]));
  604. }
  605. }
  606. }
  607. private void GetDataCollection()
  608. {
  609. DataCollection.Clear();
  610. DataCollection.Add(new DataCollecion()
  611. {
  612. MouleName = "Coater",
  613. MeasureData = new ObservableCollection<string>(new List<string>() { "Spin rotation speed", "Solvent bath flow" })
  614. });
  615. }
  616. //public void SaveMonitorEditData()
  617. //{
  618. // if (MonitorData != null && MonitorData.Count > 0)
  619. // {
  620. // InvokeClient.Instance.Service.DoOperation("SetConfig", new object[] { "Save", "MonitorEdit", MonitorEdittDataToString(MonitorData) });
  621. // }
  622. //}
  623. //private string MonitorEdittDataToString(ObservableCollection<MonitorEditData> monitorData)
  624. //{
  625. // StringBuilder stringBuilder = new StringBuilder();
  626. // foreach (var item in monitorData)
  627. // {
  628. // stringBuilder.AppendLine($"{item.ToString()}");
  629. // }
  630. // return stringBuilder.ToString();
  631. //}
  632. [XmlArray("SystemParameter")]
  633. [XmlArrayItem("SelectionProperty")]
  634. public ObservableCollection<SelectionProperty> SystemParameter { get; set; } = new ObservableCollection<SelectionProperty>();
  635. //public void InitSystemParameter()
  636. //{
  637. // SystemParameter.Add(new SelectionProperty() { Name = "WaferExistInRCV", Values = { "OK", "Cancel" }, CurrentValue = "OK" });
  638. // SystemParameter.Add(new SelectionProperty() { Name = "DesignationOfLotEndForJob", Values = { "All Lot", "Last Lot" }, CurrentValue = "All Lot" });
  639. // SystemParameter.Add(new SelectionProperty() { Name = "DefaultScreenForRunButton", Values = { "Lot Start", "Job Start", "Wafer Flow Recipe Registrtation" }, CurrentValue = "Lot Start" });
  640. // SystemParameter.Add(new SelectionProperty() { Name = "CupWashingAlarm", Values = { "Valid", "Invalid" }, CurrentValue = "Valid" });
  641. // SystemParameter.Add(new SelectionProperty() { Name = "EISInitializeCondition", Values = { "Unconditionally", "ConfigrmARMSignal" }, CurrentValue = "Unconditionally" });
  642. //}
  643. [XmlArray("TransferOutOrInOrder")]
  644. [XmlArrayItem("SelectionProperty")]
  645. public ObservableCollection<SelectionProperty> TransferOutOrInOrder { get; set; } = new ObservableCollection<SelectionProperty>();
  646. //private void InitTransferOutOrInOrder()
  647. //{
  648. // TransferOutOrInOrder.Add(new SelectionProperty() { Name = "Sender-TransferOutOrder", Values = { "Top", "Bottom" }, CurrentValue = "" });
  649. // TransferOutOrInOrder.Add(new SelectionProperty() { Name = "Reciver-TransferInOrder", Values = { "Top", "Bottom", "Slot Correspondence" }, CurrentValue = "" });
  650. // TransferOutOrInOrder.Add(new SelectionProperty() { Name = "UniCass-TransferOutOrder", Values = { "Top", "Bottom" }, CurrentValue = "" });
  651. // TransferOutOrInOrder.Add(new SelectionProperty() { Name = "PickUp-TransferInOrder", Values = { "Top", "Bottom" }, CurrentValue = "" });
  652. // TransferOutOrInOrder.Add(new SelectionProperty() { Name = "Reject-TransferInOrder", Values = { "Top", "Bottom" }, CurrentValue = "" });
  653. //}
  654. public ObservableCollection<MonitorEditData> MonitorData { get; set; } = new ObservableCollection<MonitorEditData>();
  655. public ObservableCollection<DataCollecion> DataCollection { get; set; } = new ObservableCollection<DataCollecion>();
  656. public Dictionary<string, object> GetScValue(string root)
  657. {
  658. Dictionary<string, object> result = new Dictionary<string, object>();
  659. foreach (var item in Blocks)
  660. {
  661. if (NumberOfBlocks == 3 && item.ID == "3")
  662. {
  663. result.AddRange(item.GetScValue($"{root}Block4."));
  664. }
  665. else
  666. {
  667. result.AddRange(item.GetScValue($"{root}Block{item.ID}."));
  668. }
  669. }
  670. foreach (var item in Blocks)
  671. {
  672. item.UseModuleNumber = item.Modules.ToList().Where(x => x.NameList.CurrentValue != "Reserved").Count() - 1;
  673. }
  674. return result;
  675. }
  676. }
  677. [Serializable]
  678. public class DeviceBlock
  679. {
  680. [XmlElement("ID")]
  681. public string ID { get; set; }
  682. [XmlElement("Name")]
  683. public string Name { get; set; }
  684. [XmlElement("BlockID")]
  685. public SelectionProperty BlockID { get; set; } = new SelectionProperty() { Name = "BlockID", Values = { "Cassette Block", "Proccess Block", "Interface Block" }, CurrentValue = "" };
  686. public ObservableCollection<string> ModuleIDs { get; set; } = new ObservableCollection<string>();
  687. public ObservableCollection<string> TransferArmCanAccessModules { get; set; } = new ObservableCollection<string>();
  688. public ObservableCollection<string> TransferArmAccessModules { get; set; } = new ObservableCollection<string>();
  689. //public ModuleArm ModuleArm { get; set; }
  690. [XmlArray("Modules")]
  691. [XmlArrayItem("DeviceModule")]
  692. public ObservableCollection<DeviceModule> Modules { get; set; } = new ObservableCollection<DeviceModule>();
  693. private int _NumberOfModules;
  694. [XmlAttribute("_NumberOfModules")]
  695. public int NumberOfModules
  696. {
  697. get { return _NumberOfModules; }
  698. set
  699. {
  700. if (value < 0 || value > 32) throw new Exception("value should between 0 and 32");
  701. _NumberOfModules = value;
  702. // SetModules();
  703. }
  704. }
  705. public int UseModuleNumber { get; set; }
  706. //private void SetModules()
  707. //{
  708. // int count = NumberOfModules - Modules.Count;
  709. // if (count > 0)
  710. // {
  711. // for (int i = 0; i < count; i++)
  712. // {
  713. // string id = (Modules.Count + 1).ToString();
  714. // Modules.Add(new DeviceModule(id, BlockID.CurrentValue));
  715. // }
  716. // }
  717. // else if (count < 0)
  718. // {
  719. // for (int i = 0; i < (-count); i++)
  720. // {
  721. // Modules.RemoveAt(Modules.Count - 1);
  722. // }
  723. // }
  724. //}
  725. public DeviceBlock()
  726. {
  727. }
  728. public DeviceBlock(int id)
  729. {
  730. ID = id.ToString();
  731. }
  732. public ArmPosition AccessHomePosition { get; set; } = new ArmPosition();
  733. public ArmPosition WaferCheckPosition { get; set; } = new ArmPosition();
  734. public Dictionary<string, object> GetScValue(string root)
  735. {
  736. Dictionary<string, object> result = new Dictionary<string, object>();
  737. foreach (var item in Modules)
  738. {
  739. result.AddRange(item.GetScValue($"{root}{item.ModuleID}."));
  740. }
  741. result.AddRange(AccessHomePosition.GetScValue($"{root}AccessHomePosition."));
  742. result.AddRange(WaferCheckPosition.GetScValue($"{root}WaferCheckPosition."));
  743. return result;
  744. }
  745. }
  746. [Serializable]
  747. public class DeviceModule
  748. {
  749. [XmlElement("ID")]
  750. public string ID { get; set; }
  751. [XmlElement("Name")]
  752. public string Name { get; set; }
  753. public string ParentID { get; set; }
  754. [XmlAttribute("ModuleID")]
  755. public string ModuleID { get; set; }
  756. [XmlAttribute("ParameterName")]
  757. public string ParameterName { get; set; }
  758. public SelectionProperty NameList { get; set; } = new SelectionProperty() { Name = "NameList", Values = { }, CurrentValue = "CPL" };
  759. public SelectionProperty SYNEXC { get; set; } = new SelectionProperty() { Name = "SYNCEXC", Values = { "Invalid", "1-2", "2-3", "1-2&2-3" }, CurrentValue = "" };
  760. [XmlAttribute("MateriCount")]
  761. public int MaterialCount { get; set; }
  762. [XmlAttribute("StartSlot")]
  763. public int StartSlot { get; set; }
  764. public SelectionProperty AGVConnect { get; set; } = new SelectionProperty() { Name = "AGVConnect", Values = { "Connect", "Disconnect" } };
  765. public SpinerModule ModuleSpiner { get; set; } = new SpinerModule();
  766. public ObservableCollection<SelectionProperty> TransferArmPosition { get; set; } = new ObservableCollection<SelectionProperty>();
  767. public ObservableCollection<ArmAxis> ArmAxisList { get; set; } = new ObservableCollection<ArmAxis>();
  768. public SelectionProperty MappingType { get; set; } = new SelectionProperty() { Name = "Arm Up", Values = { "Arm Up", "Arm Receive", "Cassette Down" } };
  769. public int WaferThickness { get; set; }
  770. public int PositiveTolerance { get; set; }
  771. public int NegativeTolerance { get; set; }
  772. public int FirstSlotposition { get; set; }
  773. public SelectionProperty SlotEditingType { get; set; } = new SelectionProperty() { Name = "Fix", Values = { "Fix", "Option" } };
  774. public int SlotPitch { get; set; }
  775. public int MappingStartPosition { get; set; }
  776. public int mappingEndPosition { get; set; }
  777. public int SlotNo { get; set; }
  778. public TransferArmPosition ParameterTransferArmPosition { get; set; } = new TransferArmPosition();
  779. public MonitorEditData MonitorEidtData { get; set; }
  780. public DeviceModule() { }
  781. public DeviceModule(string id, string moduleID, string name)
  782. {
  783. ID = id;
  784. ModuleID = moduleID;
  785. Name = name;
  786. for (int i = 0; i < 6; i++)
  787. {
  788. ArmAxisList.Add(new ArmAxis());
  789. }
  790. //NameList.CurrentValue = name;
  791. }
  792. public void Save()
  793. {
  794. }
  795. public Dictionary<string, object> GetScValue(string root)
  796. {
  797. Dictionary<string, object> result = new Dictionary<string, object>();
  798. result[$"{root}Name"] = NameList.CurrentValue;
  799. result[$"{root}SYNEXC"] = SYNEXC.CurrentValue;
  800. result[$"{root}MaterialCount"] = MaterialCount;
  801. result[$"{root}StartSlot"] = StartSlot;
  802. result[$"{root}AGVConnect"] = AGVConnect.CurrentValue;
  803. if (ModuleID == "0" && ArmAxisList != null && ArmAxisList.Count == 6)
  804. {
  805. result.AddRange(ArmAxisList[0].GetScValue($"{root}X1axis."));
  806. result.AddRange(ArmAxisList[1].GetScValue($"{root}X2axis."));
  807. result.AddRange(ArmAxisList[2].GetScValue($"{root}X3axis."));
  808. result.AddRange(ArmAxisList[3].GetScValue($"{root}Yaxis."));
  809. result.AddRange(ArmAxisList[4].GetScValue($"{root}Zaxis."));
  810. result.AddRange(ArmAxisList[5].GetScValue($"{root}Raxis."));
  811. }
  812. if (ParameterManager.IsSpinModule(Name))
  813. {
  814. result.AddRange(ModuleSpiner.GetScValue(root));
  815. }
  816. if (ModuleID != "0")
  817. {
  818. result.AddRange(ParameterTransferArmPosition.GetScValue($"{root}TransferArmPosition."));
  819. }
  820. if (NameList.CurrentValue == "COT" || NameList.CurrentValue == "DEV" || NameList.CurrentValue == "ADH")
  821. {
  822. result[$"{root}DispenseConfig"] = DispenseConfigListToString(ParameterManager.Instance.ModuleDispenseConfigList[ID]);
  823. }
  824. return result;
  825. }
  826. private string DispenseConfigListToString(Dictionary<string, DispenseConfig> dispenseConfigList)
  827. {
  828. StringBuilder stringBuilder = new StringBuilder();
  829. foreach (var item in dispenseConfigList.Keys)
  830. {
  831. stringBuilder.AppendLine($"{item}:{dispenseConfigList[item].ToString()}");
  832. }
  833. return stringBuilder.ToString();
  834. }
  835. }
  836. public class ArmAxis
  837. {
  838. public int SpeedInitial { get; set; }
  839. public int SpeedMovementbetweenmod { get; set; }
  840. public int SpeedReceive { get; set; }
  841. public int SpeedSend { get; set; }
  842. public int SpeedMapping { get; set; }
  843. public int SpeedMaintenance { get; set; }
  844. public int SpeedInching { get; set; }
  845. public string MultiMovementbetweenmod { get; set; }
  846. public double PassMovementbetweenmod { get; set; }
  847. public double PassReceive { get; set; }
  848. public double PassSpeedSend { get; set; }
  849. public double PassSpeedMapping { get; set; }
  850. public Dictionary<string, object> GetScValue(string root)
  851. {
  852. Dictionary<string, object> result = new Dictionary<string, object>();
  853. result[$"{root}SpeedInitial"] = SpeedInitial;
  854. result[$"{root}SpeedMovementbetweenmod"] = SpeedMovementbetweenmod;
  855. result[$"{root}SpeedReceive"] = SpeedReceive;
  856. result[$"{root}SpeedSend"] = SpeedSend;
  857. result[$"{root}SpeedMapping"] = SpeedMapping;
  858. result[$"{root}SpeedMaintenance"] = SpeedMaintenance;
  859. result[$"{root}SpeedInching"] = SpeedInching;
  860. result[$"{root}MultiMovementbetweenmod"] = MultiMovementbetweenmod;
  861. result[$"{root}PassMovementbetweenmod"] = PassMovementbetweenmod;
  862. result[$"{root}PassReceive"] = PassReceive;
  863. result[$"{root}PassSpeedSend"] = PassSpeedSend;
  864. result[$"{root}PassSpeedMapping"] = PassSpeedMapping;
  865. return result;
  866. }
  867. }
  868. public class ModuleArm
  869. {
  870. //public DataTable TransferArmControlData { get; set; } = new DataTable("TransferArmControlData");
  871. //public ObservableCollection<TransferArmInteraction> TransferArmInteraction { get; set; } = new ObservableCollection<TransferArmInteraction>();
  872. }
  873. public class SpinerModule
  874. {
  875. public string ArmCount { get; set; }
  876. public string ShakeArmNo { get; set; }
  877. //public string RinseNozzleSpec { get; set; }
  878. public string UpperLimitSpinSpeed { get; set; }
  879. public string UpperLimitAcceleration { get; set; }
  880. public string SpinOutSpeed { get; set; }
  881. public string SpinOutTime { get; set; }
  882. public string Unit { get; set; }
  883. public NozzleChanger NozzleChanger { get; set; } = new NozzleChanger();
  884. public NozzleArmInformat NozzleArmInformat1 { get; set; } = new NozzleArmInformat();
  885. public NozzleArmInformat NozzleArmInformat2 { get; set; } = new NozzleArmInformat();
  886. public Dictionary<string, object> GetScValue(string root)
  887. {
  888. Dictionary<string, object> result = new Dictionary<string, object>();
  889. result[$"{root}ArmCount"] = ArmCount;
  890. result[$"{root}ShakeArmNo"] = ShakeArmNo;
  891. result[$"{root}UpperLimitSpinSpeed"] = UpperLimitSpinSpeed;
  892. result[$"{root}UpperLimitAcceleration"] = UpperLimitAcceleration;
  893. result[$"{root}SpinOutSpeed"] = SpinOutSpeed;
  894. result[$"{root}SpinOutTime"] = SpinOutTime;
  895. // result[$"{root}Unit"] = Unit;
  896. result.AddRange(NozzleChanger.GetScValue($"{root}NozzleChanger."));
  897. result.AddRange(NozzleArmInformat1.GetScValue($"{root}NozzleArmInformat1."));
  898. result.AddRange(NozzleArmInformat2.GetScValue($"{root}NozzleArmInformat2."));
  899. return result;
  900. }
  901. }
  902. public class NozzleChanger : ICloneable
  903. {
  904. public string IsNozzleChangerEnable { get; set; }
  905. public string MotorPulseRate { get; set; }
  906. public string MaxSpeed { get; set; }
  907. public void SetNozzleChangerDataList(string value)
  908. {
  909. NozzleChangerData.Clear();
  910. var strList = value.Split(';');
  911. for (int i = 0; i < strList.Length; i++)
  912. {
  913. var NozzleChangerStrList = strList[i].Split(',');
  914. NozzleChangerData.Add(new NozzleChangerData()
  915. {
  916. ID = (i + 1).ToString(),
  917. IsNozzleChangerEnable = NozzleChangerStrList[0],
  918. Position = NozzleChangerStrList[1],
  919. NozzleSensorNo = NozzleChangerStrList[2],
  920. NozzleOffSet = NozzleChangerStrList[3]
  921. });
  922. }
  923. }
  924. public string NozzleChangerDataToString()
  925. {
  926. StringBuilder stringBuilder = new StringBuilder();
  927. foreach (var item in NozzleChangerData)
  928. {
  929. stringBuilder.Append(item.ToString());
  930. stringBuilder.Append(";");
  931. }
  932. if (stringBuilder.Length > 0) stringBuilder.Remove(stringBuilder.Length - 1, 1);
  933. return stringBuilder.ToString();
  934. }
  935. public object Clone()
  936. {
  937. return this.MemberwiseClone();
  938. }
  939. public object DeepClone()
  940. {
  941. return new NozzleChanger()
  942. {
  943. IsNozzleChangerEnable = this.IsNozzleChangerEnable,
  944. MotorPulseRate = this.MotorPulseRate,
  945. MaxSpeed = this.MaxSpeed,
  946. NozzleChangerData = new ObservableCollection<NozzleChangerData>(this.NozzleChangerData.Select(x => x.DeepClone()).Cast<NozzleChangerData>())
  947. };
  948. }
  949. public ObservableCollection<NozzleChangerData> NozzleChangerData { get; set; } = new ObservableCollection<NozzleChangerData>();
  950. public Dictionary<string, object> GetScValue(string root)
  951. {
  952. Dictionary<string, object> result = new Dictionary<string, object>();
  953. result[$"{root}IsNozzleChangerEnable"] = IsNozzleChangerEnable;
  954. result[$"{root}MotorPulseRate"] = MotorPulseRate;
  955. result[$"{root}MaxSpeed"] = MaxSpeed;
  956. result[$"{root}Data"] = NozzleChangerDataToString();
  957. return result;
  958. }
  959. }
  960. public class NozzleChangerData : ICloneable
  961. {
  962. public string ID { get; set; }
  963. public string IsNozzleChangerEnable { get; set; }
  964. public string Position { get; set; }
  965. public string NozzleSensorNo { get; set; }
  966. public string NozzleOffSet { get; set; }
  967. public object Clone()
  968. {
  969. return this.MemberwiseClone();
  970. }
  971. public object DeepClone()
  972. {
  973. return new NozzleChangerData()
  974. {
  975. ID = this.ID,
  976. IsNozzleChangerEnable = this.IsNozzleChangerEnable,
  977. Position = this.Position,
  978. NozzleSensorNo = this.NozzleSensorNo,
  979. NozzleOffSet = this.NozzleOffSet
  980. };
  981. }
  982. public override string ToString()
  983. {
  984. string rst = $"{IsNozzleChangerEnable},{Position},{NozzleSensorNo},{NozzleOffSet}";
  985. return rst.ToString();
  986. }
  987. }
  988. public class NozzleArmInformat : ICloneable
  989. {
  990. public string IsNozzleArmEnable { get; set; }
  991. public string ArmDriveFormat { get; set; }
  992. public string NozzleForm { get; set; }
  993. public string MotorPulsesRate { get; set; }
  994. public string StartPosition { get; set; }
  995. public string EndPosition { get; set; }
  996. public string StartCupPosition { get; set; }
  997. public string EndCupPosition { get; set; }
  998. public TransferArmRecipePositionData Home { get; set; }
  999. public TransferArmRecipePositionData DmyDisp { get; set; }
  1000. public TransferArmRecipePositionData Standby1 { get; set; }
  1001. public TransferArmRecipePositionData Standby2 { get; set; }
  1002. public TransferArmRecipePositionData Begin { get; set; }
  1003. public TransferArmRecipePositionData Center { get; set; }
  1004. public TransferArmRecipePositionData End { get; set; }
  1005. public TransferArmRecipePositionData Dispense1 { get; set; }
  1006. public TransferArmRecipePositionData Dispense2 { get; set; }
  1007. public TransferArmRecipePositionData Dispense3 { get; set; }
  1008. public TransferArmRecipePositionData Dispense4 { get; set; }
  1009. public TransferArmRecipePositionData Dispense5 { get; set; }
  1010. public Dictionary<string, object> GetScValue(string root)
  1011. {
  1012. Dictionary<string, object> result = new Dictionary<string, object>();
  1013. result[$"{root}IsNozzleArmEnable"] = IsNozzleArmEnable;
  1014. result[$"{root}ArmDriveFormat"] = ArmDriveFormat;
  1015. result[$"{root}NozzleForm"] = NozzleForm;
  1016. result[$"{root}MotorPulsesRate"] = MotorPulsesRate;
  1017. result[$"{root}StartPosition"] = double.Parse(StartPosition).ToString("f2");
  1018. result[$"{root}EndPosition"] = double.Parse(EndPosition).ToString("f2");
  1019. result[$"{root}StartCupPosition"] = double.Parse(StartCupPosition).ToString("f2");
  1020. result[$"{root}EndCupPosition"] = double.Parse(EndCupPosition).ToString("f2");
  1021. if (Home != null) result[$"{root}Home"] = Home.ToString();
  1022. if (DmyDisp != null) result[$"{root}DmyDisp"] = DmyDisp.ToString();
  1023. if (Standby1 != null) result[$"{root}Standby1"] = Standby1.ToString();
  1024. if (Standby2 != null) result[$"{root}Standby2"] = Standby2.ToString();
  1025. if (Begin != null) result[$"{root}Begin"] = Begin.ToString();
  1026. if (Center != null) result[$"{root}Center"] = Center.ToString();
  1027. if (End != null) result[$"{root}End"] = End.ToString();
  1028. if (Dispense1 != null) result[$"{root}Dispense1"] = Dispense1.ToString();
  1029. if (Dispense2 != null) result[$"{root}Dispense2"] = Dispense2.ToString();
  1030. if (Dispense3 != null) result[$"{root}Dispense3"] = Dispense3.ToString();
  1031. if (Dispense4 != null) result[$"{root}Dispense4"] = Dispense4.ToString();
  1032. if (Dispense5 != null) result[$"{root}Dispense5"] = Dispense5.ToString();
  1033. return result;
  1034. }
  1035. public object Clone()
  1036. {
  1037. return this.MemberwiseClone();
  1038. }
  1039. public object DeepClone()
  1040. {
  1041. return new NozzleArmInformat()
  1042. {
  1043. IsNozzleArmEnable = this.IsNozzleArmEnable,
  1044. ArmDriveFormat = this.ArmDriveFormat,
  1045. NozzleForm = this.NozzleForm,
  1046. MotorPulsesRate = this.MotorPulsesRate,
  1047. StartPosition = this.StartPosition,
  1048. EndPosition = this.EndPosition,
  1049. StartCupPosition = this.StartCupPosition,
  1050. EndCupPosition = this.EndCupPosition,
  1051. Home = (TransferArmRecipePositionData)this.Home.Clone(),
  1052. DmyDisp = (TransferArmRecipePositionData)this.DmyDisp.Clone(),
  1053. Standby1 = (TransferArmRecipePositionData)this.Standby1.Clone(),
  1054. Standby2 = (TransferArmRecipePositionData)this.Standby2.Clone(),
  1055. Begin = (TransferArmRecipePositionData)this.Begin.Clone(),
  1056. Center = (TransferArmRecipePositionData)this.Center.Clone(),
  1057. End = (TransferArmRecipePositionData)this.End.Clone(),
  1058. Dispense1 = (TransferArmRecipePositionData)this.Dispense1.Clone(),
  1059. Dispense2 = (TransferArmRecipePositionData)this.Dispense2.Clone(),
  1060. Dispense3 = (TransferArmRecipePositionData)this.Dispense3.Clone(),
  1061. Dispense4 = (TransferArmRecipePositionData)this.Dispense4.Clone(),
  1062. Dispense5 = (TransferArmRecipePositionData)this.Dispense5.Clone(),
  1063. };
  1064. }
  1065. }
  1066. public class TransferArmInteraction
  1067. {
  1068. public string AxisName { get; set; }
  1069. public ObservableCollection<TransferArmInteractionData> TransferArmInteractionData { get; set; } = new ObservableCollection<TransferArmInteractionData>();
  1070. }
  1071. public class TransferArmInteractionData
  1072. {
  1073. public string TranserAxisName { get; set; }
  1074. public string From { get; set; }
  1075. public string To { get; set; }
  1076. }
  1077. public class TransferArmRecipePositionData : ICloneable
  1078. {
  1079. public TransferArmRecipePositionData()
  1080. { }
  1081. public TransferArmRecipePositionData(string value)
  1082. {
  1083. if (!(value == null || value == ""))
  1084. {
  1085. var strList = value.Split(';');
  1086. Acceleration = double.Parse(strList[0]).ToString("f2");
  1087. Deceleration = double.Parse(strList[1]).ToString("f2");
  1088. TopSpeed = double.Parse(strList[2]).ToString("f2");
  1089. Position = double.Parse(strList[3]).ToString("f2");
  1090. HeightPositionSelection = strList[4];
  1091. var offsetList = strList[5].Split(',');
  1092. Nozzle1Offset = double.Parse(offsetList[0]).ToString("f2");
  1093. Nozzle2Offset = double.Parse(offsetList[1]).ToString("f2");
  1094. Nozzle3Offset = double.Parse(offsetList[2]).ToString("f2");
  1095. Nozzle4Offset = double.Parse(offsetList[3]).ToString("f2");
  1096. Nozzle5Offset = double.Parse(offsetList[4]).ToString("f2");
  1097. Nozzle6Offset = double.Parse(offsetList[5]).ToString("f2");
  1098. Nozzle7Offset = double.Parse(offsetList[6]).ToString("f2");
  1099. Nozzle8Offset = double.Parse(offsetList[7]).ToString("f2");
  1100. }
  1101. }
  1102. public string Acceleration { get; set; }
  1103. public string Deceleration { get; set; }
  1104. public string TopSpeed { get; set; }
  1105. public string Position { get; set; }
  1106. public string HeightPositionSelection { get; set; }
  1107. public string Nozzle1Offset { get; set; }
  1108. public string Nozzle2Offset { get; set; }
  1109. public string Nozzle3Offset { get; set; }
  1110. public string Nozzle4Offset { get; set; }
  1111. public string Nozzle5Offset { get; set; }
  1112. public string Nozzle6Offset { get; set; }
  1113. public string Nozzle7Offset { get; set; }
  1114. public string Nozzle8Offset { get; set; }
  1115. public string Units { get; set; }
  1116. public override string ToString()
  1117. {
  1118. string rtn = $"{Acceleration};{Deceleration};{TopSpeed};{Position};{HeightPositionSelection};" +
  1119. $"{Nozzle1Offset},{Nozzle2Offset},{Nozzle3Offset},{Nozzle4Offset}," +
  1120. $"{Nozzle5Offset},{Nozzle6Offset},{Nozzle7Offset},{Nozzle8Offset}";
  1121. return rtn.ToString();
  1122. }
  1123. public object Clone()
  1124. {
  1125. return this.MemberwiseClone();
  1126. }
  1127. }
  1128. public class DispenseConfig
  1129. {
  1130. public string Name { get; set; }
  1131. public bool IsChecked { get; set; }
  1132. public string DummyDispense { get; set; }
  1133. public string DispenseMechanismName { get; set; }
  1134. public string DispenseMechanismData { get; set; }
  1135. public string FlowAmountSensor { get; set; }
  1136. public FlowPumpData FlowPumpData { get; set; } = new FlowPumpData();
  1137. public FlowSensorData FlowSensorData { get; set; } = new FlowSensorData();
  1138. public string AutoSupplySystemSupply { get; set; }
  1139. public AutoSupplySystem AutoSupplySystem { get; set; } = new AutoSupplySystem();
  1140. public string AutoSupplySystemDrain { get; set; }
  1141. public DispenseDrainData DispenseDrain { get; set; } = new DispenseDrainData();
  1142. public DispenseConfig(string value)
  1143. {
  1144. CreateDispenseConfig(value);
  1145. }
  1146. public DispenseConfig()
  1147. {
  1148. CreateDispenseConfig("");
  1149. }
  1150. public void CreateDispenseConfig(string value)
  1151. {
  1152. if (value == null || value == "")
  1153. {
  1154. this.IsChecked = false;
  1155. this.DummyDispense = "Yes";
  1156. this.FlowAmountSensor = "-";
  1157. this.DispenseMechanismName = "No Conn";
  1158. this.AutoSupplySystemSupply = "-";
  1159. this.AutoSupplySystemDrain = "-";
  1160. this.FlowPumpData = new FlowPumpData();
  1161. this.FlowSensorData = new FlowSensorData();
  1162. }
  1163. else
  1164. {
  1165. string[] listStr = value.Split(',');
  1166. if (listStr.Length == 12)
  1167. {
  1168. Name = listStr[0];
  1169. IsChecked = bool.Parse(listStr[1]);
  1170. DummyDispense = listStr[2];
  1171. DispenseMechanismName = listStr[3];
  1172. DispenseMechanismData = listStr[4];
  1173. FlowAmountSensor = listStr[5];
  1174. FlowPumpData = new FlowPumpData(listStr[6]);
  1175. FlowSensorData = new FlowSensorData(listStr[7]);
  1176. AutoSupplySystemSupply = listStr[8];
  1177. //AutoSupplySystem = new AutoSupplySystem(listStr[9]);
  1178. if (listStr[10] == "Drain pump")
  1179. {
  1180. AutoSupplySystemDrain = "Drain Pump";
  1181. }
  1182. else
  1183. {
  1184. AutoSupplySystemDrain = listStr[10];
  1185. }
  1186. //DispenseDrain = new DispenseDrainData(listStr[11]);
  1187. }
  1188. else
  1189. {
  1190. Name = listStr[0];
  1191. IsChecked = bool.Parse(listStr[1]);
  1192. DummyDispense = listStr[2];
  1193. DispenseMechanismName = listStr[3];
  1194. DispenseMechanismData = listStr[4];
  1195. FlowAmountSensor = listStr[5];
  1196. FlowPumpData = new FlowPumpData(listStr[6]);
  1197. FlowSensorData = new FlowSensorData(listStr[7]);
  1198. AutoSupplySystemSupply = listStr[8];
  1199. if (listStr[9] == "Drain pump")
  1200. {
  1201. AutoSupplySystemDrain = "Drain Pump";
  1202. }
  1203. else
  1204. {
  1205. AutoSupplySystemDrain = listStr[9];
  1206. }
  1207. // DispenseDrain = new DispenseDrainData(listStr[10]);
  1208. }
  1209. }
  1210. }
  1211. public override string ToString()
  1212. {
  1213. string[] rtn = new string[]
  1214. {
  1215. Name,
  1216. IsChecked.ToString(),
  1217. DummyDispense,
  1218. DispenseMechanismName,
  1219. DispenseMechanismData,
  1220. FlowAmountSensor,
  1221. FlowPumpData.ToString(),
  1222. FlowSensorData.ToString(),
  1223. AutoSupplySystemSupply,
  1224. // AutoSupplySystem.ToString(),
  1225. AutoSupplySystemDrain
  1226. // , DispenseDrain.ToString()
  1227. };
  1228. return String.Join(",", rtn);
  1229. }
  1230. }
  1231. public class FlowPumpData : ICloneable
  1232. {
  1233. public string PumpCapacity { get; set; }
  1234. public string PassOperation { get; set; }
  1235. public string PluseCount { get; set; }
  1236. public string SpareReload { get; set; }
  1237. public string DispenseWorkControlMethod { get; set; }
  1238. public string AlarmValue { get; set; }
  1239. public string StopValue { get; set; }
  1240. public string Calibration { get; set; }
  1241. public FlowPumpData()
  1242. {
  1243. PumpCapacity = "8.0";
  1244. PassOperation = "Off";
  1245. PluseCount = "0";
  1246. SpareReload = "0";
  1247. DispenseWorkControlMethod = "Total Dispense Count";
  1248. AlarmValue = "1000";
  1249. StopValue = "1000";
  1250. Calibration = "1.00";
  1251. }
  1252. public FlowPumpData(string value)
  1253. {
  1254. var rtn = value.Split('/');
  1255. PumpCapacity = rtn[0];
  1256. PassOperation = rtn[1];
  1257. PluseCount = rtn[2];
  1258. SpareReload = rtn[3];
  1259. DispenseWorkControlMethod = rtn[4];
  1260. AlarmValue = rtn[5];
  1261. StopValue = rtn[6];
  1262. Calibration = rtn[7];
  1263. }
  1264. public override string ToString()
  1265. {
  1266. string[] strList = new string[]
  1267. {
  1268. PumpCapacity,PassOperation,PluseCount,SpareReload,DispenseWorkControlMethod,
  1269. AlarmValue,StopValue,Calibration
  1270. };
  1271. return String.Join("/", strList);
  1272. }
  1273. public object Clone()
  1274. {
  1275. return this.MemberwiseClone();
  1276. }
  1277. public object DeepClone()
  1278. {
  1279. return new FlowPumpData()
  1280. {
  1281. PumpCapacity = this.PumpCapacity,
  1282. PassOperation = this.PassOperation,
  1283. PluseCount = this.PassOperation,
  1284. SpareReload = this.SpareReload,
  1285. DispenseWorkControlMethod = this.DispenseWorkControlMethod,
  1286. AlarmValue = this.AlarmValue,
  1287. StopValue = this.StopValue,
  1288. Calibration = this.Calibration
  1289. };
  1290. }
  1291. }
  1292. public class FlowSensorData : ICloneable
  1293. {
  1294. public string LiquidType { get; set; }
  1295. public string SamplingCompleteDelayTime { get; set; }
  1296. public string CheckTiming { get; set; }
  1297. public string DummyDispenseFlowMonitoring { get; set; }
  1298. public string HMDSValue { get; set; }
  1299. public string Calibration { get; set; }
  1300. public string AlarmRangeUpper { get; set; }
  1301. public string AlarmRangeLower { get; set; }
  1302. public string StopRangeUpper { get; set; }
  1303. public string StopRangeLower { get; set; }
  1304. public string DispenseTime { get; set; }
  1305. public string N2Time { get; set; }
  1306. public string N2Value { get; set; }
  1307. public FlowSensorData()
  1308. {
  1309. LiquidType = "Solution";
  1310. SamplingCompleteDelayTime = "1.0";
  1311. CheckTiming = "None";
  1312. DummyDispenseFlowMonitoring = "Yes";
  1313. HMDSValue = "0";
  1314. Calibration = "1.00";
  1315. AlarmRangeUpper = "50.00";
  1316. AlarmRangeLower = "50.00";
  1317. StopRangeUpper = "50.00";
  1318. StopRangeLower = "50.00";
  1319. DispenseTime = "5.0";
  1320. N2Time = "10.0";
  1321. N2Value = "10";
  1322. }
  1323. public FlowSensorData(string value)
  1324. {
  1325. var rtn = value.Split('/');
  1326. LiquidType = rtn[0];
  1327. SamplingCompleteDelayTime = double.Parse(rtn[1]).ToString("F1");
  1328. CheckTiming = rtn[2];
  1329. DummyDispenseFlowMonitoring = rtn[3];
  1330. HMDSValue = rtn[4];
  1331. Calibration = rtn[5];
  1332. AlarmRangeUpper = rtn[6];
  1333. AlarmRangeLower = rtn[7];
  1334. StopRangeUpper = rtn[8];
  1335. StopRangeLower = rtn[9];
  1336. if (rtn.Length > 10)
  1337. {
  1338. DispenseTime = double.Parse(rtn[10]).ToString("F1"); ;
  1339. N2Time = double.Parse(rtn[11]).ToString("F1"); ;
  1340. }
  1341. else
  1342. {
  1343. DispenseTime = "5.0";
  1344. N2Time = "10.0";
  1345. }
  1346. if (rtn.Length > 12)
  1347. {
  1348. N2Value = double.Parse(rtn[12]).ToString("F1"); ;
  1349. }
  1350. else
  1351. {
  1352. N2Value = "10";
  1353. }
  1354. }
  1355. public override string ToString()
  1356. {
  1357. string[] strList = new string[]
  1358. {
  1359. LiquidType,SamplingCompleteDelayTime,CheckTiming,DummyDispenseFlowMonitoring,
  1360. HMDSValue,Calibration,AlarmRangeUpper,AlarmRangeLower,StopRangeUpper,StopRangeLower,DispenseTime,N2Time,N2Value
  1361. };
  1362. return String.Join("/", strList);
  1363. }
  1364. public object Clone()
  1365. {
  1366. return this.MemberwiseClone();
  1367. }
  1368. public object DeepClone()
  1369. {
  1370. return new FlowSensorData()
  1371. {
  1372. LiquidType = this.LiquidType,
  1373. SamplingCompleteDelayTime = this.SamplingCompleteDelayTime,
  1374. CheckTiming = this.CheckTiming,
  1375. DummyDispenseFlowMonitoring = this.DummyDispenseFlowMonitoring,
  1376. HMDSValue = this.HMDSValue,
  1377. Calibration = this.Calibration,
  1378. AlarmRangeUpper = this.AlarmRangeUpper,
  1379. AlarmRangeLower = this.AlarmRangeLower,
  1380. StopRangeUpper = this.StopRangeUpper,
  1381. StopRangeLower = this.StopRangeLower,
  1382. DispenseTime = this.DispenseTime,
  1383. N2Time = this.N2Time,
  1384. N2Value = this.N2Value
  1385. };
  1386. }
  1387. }
  1388. public class AutoSupplySystem : ICloneable
  1389. {
  1390. public string Name { get; set; }
  1391. public string Mode { get; set; }
  1392. public string LiquidSupplySource { get; set; }
  1393. public string SupplyTime { get; set; }
  1394. public string VacuumTime { get; set; }
  1395. public string WaitingTime { get; set; }
  1396. public string SupplyDelayTime { get; set; }
  1397. public string PurgeTime { get; set; }
  1398. public string LERecoverTime { get; set; }
  1399. public string LESensor { get; set; }
  1400. public string BubblingTime { get; set; }
  1401. public string DrainTime { get; set; }
  1402. public AutoSupplySystem()
  1403. {
  1404. Name = "Solvent(1)";
  1405. Mode = "Auto";
  1406. LiquidSupplySource = "Invalid";
  1407. SupplyTime = "1.0";
  1408. VacuumTime = "0.0";
  1409. WaitingTime = "0.0";
  1410. SupplyDelayTime = "0.0";
  1411. PurgeTime = "99";
  1412. LERecoverTime = "0.0";
  1413. LESensor = "0";
  1414. BubblingTime = "0.0";
  1415. DrainTime = "0.0";
  1416. }
  1417. public AutoSupplySystem(string value)
  1418. {
  1419. var rtn = value.Split('/');
  1420. Name = rtn[0];
  1421. Mode = rtn[1];
  1422. LiquidSupplySource = rtn[2];
  1423. SupplyTime = double.Parse(rtn[3]).ToString("F1");
  1424. VacuumTime = double.Parse(rtn[4]).ToString("F1");
  1425. WaitingTime = double.Parse(rtn[5]).ToString("F1");
  1426. SupplyDelayTime = double.Parse(rtn[6]).ToString("F1");
  1427. PurgeTime = double.Parse(rtn[7]).ToString("F1");
  1428. LERecoverTime = double.Parse(rtn[8]).ToString("F1");
  1429. LESensor = rtn[9];
  1430. BubblingTime = double.Parse(rtn[10]).ToString("F1");
  1431. DrainTime = double.Parse(rtn[11]).ToString("F1");
  1432. }
  1433. public override string ToString()
  1434. {
  1435. string[] strList = new string[]
  1436. {
  1437. Name,Mode,LiquidSupplySource,SupplyTime,VacuumTime,WaitingTime,SupplyDelayTime,
  1438. PurgeTime,LERecoverTime,LESensor,BubblingTime,DrainTime
  1439. };
  1440. return String.Join("/", strList);
  1441. }
  1442. public object Clone()
  1443. {
  1444. return this.MemberwiseClone();
  1445. }
  1446. public object DeepClone()
  1447. {
  1448. return new AutoSupplySystem()
  1449. {
  1450. Name = this.Name,
  1451. Mode = this.Mode,
  1452. LiquidSupplySource = this.LiquidSupplySource,
  1453. SupplyTime = this.SupplyTime,
  1454. VacuumTime = this.VacuumTime,
  1455. WaitingTime = this.WaitingTime,
  1456. SupplyDelayTime = this.SupplyDelayTime,
  1457. PurgeTime = this.PurgeTime,
  1458. LERecoverTime = this.LERecoverTime,
  1459. LESensor = this.LESensor,
  1460. BubblingTime = this.BubblingTime,
  1461. DrainTime = this.DrainTime,
  1462. };
  1463. }
  1464. public Dictionary<string, object> GetScValue(string root)
  1465. {
  1466. Dictionary<string, object> keyValuePairs = new Dictionary<string, object>();
  1467. keyValuePairs.Add($"{root}Mode", Mode);
  1468. keyValuePairs.Add($"{root}LiquidSupplySource", LiquidSupplySource);
  1469. keyValuePairs.Add($"{root}SupplyTime", SupplyTime);
  1470. keyValuePairs.Add($"{root}VacuumTime", VacuumTime);
  1471. keyValuePairs.Add($"{root}WaitingTime", WaitingTime);
  1472. keyValuePairs.Add($"{root}SupplyDelayTime", SupplyDelayTime);
  1473. keyValuePairs.Add($"{root}PurgeTime", PurgeTime);
  1474. keyValuePairs.Add($"{root}LERecoverTime", LERecoverTime);
  1475. keyValuePairs.Add($"{root}LESensor", LESensor);
  1476. keyValuePairs.Add($"{root}BubblingTime", BubblingTime);
  1477. keyValuePairs.Add($"{root}DrainTime", DrainTime);
  1478. return keyValuePairs;
  1479. }
  1480. }
  1481. public class DispenseDrainData : ICloneable
  1482. {
  1483. public string Name { get; set; }
  1484. public string AutoDrainMode { get; set; }
  1485. public string LiquidSupplySource { get; set; }
  1486. public string DrainingTime { get; set; }
  1487. public DispenseDrainData()
  1488. {
  1489. Name = "NMP";
  1490. AutoDrainMode = "Auto";
  1491. LiquidSupplySource = "Invalid";
  1492. DrainingTime = "60.0";
  1493. }
  1494. public DispenseDrainData(string value)
  1495. {
  1496. var rtn = value.Split('/');
  1497. Name = rtn[0];
  1498. AutoDrainMode = rtn[1];
  1499. LiquidSupplySource = rtn[2];
  1500. DrainingTime = double.Parse(rtn[3]).ToString("F1");
  1501. }
  1502. public override string ToString()
  1503. {
  1504. string[] strList = new string[]
  1505. {
  1506. Name,AutoDrainMode,LiquidSupplySource,DrainingTime
  1507. };
  1508. return String.Join("/", strList);
  1509. }
  1510. public object Clone()
  1511. {
  1512. return this.MemberwiseClone();
  1513. }
  1514. public object DeepClone()
  1515. {
  1516. return new DispenseDrainData()
  1517. {
  1518. Name = this.Name,
  1519. AutoDrainMode = this.AutoDrainMode,
  1520. LiquidSupplySource = this.LiquidSupplySource,
  1521. DrainingTime = this.DrainingTime
  1522. };
  1523. }
  1524. public Dictionary<string, object> GetScValue(string root)
  1525. {
  1526. Dictionary<string, object> keyValuePairs = new Dictionary<string, object>();
  1527. keyValuePairs.Add($"{root}Name", Name);
  1528. keyValuePairs.Add($"{root}AutoDrainMode", AutoDrainMode);
  1529. keyValuePairs.Add($"{root}LiquidSupplySource", LiquidSupplySource);
  1530. keyValuePairs.Add($"{root}DrainingTime", DrainingTime);
  1531. return keyValuePairs;
  1532. }
  1533. }
  1534. public class MonitorEditData : ICloneable
  1535. {
  1536. public string IsValid { get; set; }
  1537. public string Module { get; set; }
  1538. public string MeasDateName { get; set; }
  1539. public string RecipeName { get; set; }
  1540. public string TempControlForm { get; set; }
  1541. public string ControllerName { get; set; }
  1542. public string Node { get; set; }
  1543. public string PortNo { get; set; }
  1544. public string ChannelNo { get; set; }
  1545. public string TunForm { get; set; }
  1546. public string TunDestNode { get; set; }
  1547. public string TunDestSensorID { get; set; }
  1548. public string ControlForm { get; set; }
  1549. public string InitialData { get; set; }
  1550. public string OverTemp { get; set; }
  1551. public string SettlingDetermineTime { get; set; }
  1552. public string SettlingTimeOut { get; set; }
  1553. public string UsePointOffset { get; set; }
  1554. public string StartMonitorForm { get; set; }
  1555. public string StartInvalidTime { get; set; }
  1556. public string ProcessMonitorForm { get; set; }
  1557. public string ProcessDeterminationTime { get; set; }
  1558. public string ProcessValue { get; set; }
  1559. public string PIDSetForm { get; set; }
  1560. public string PIDPParam { get; set; }
  1561. public string PIDIParam { get; set; }
  1562. public string PIDDParam { get; set; }
  1563. public string OffsetSetForm { get; set; }
  1564. public string OffsetVal { get; set; }
  1565. public string AConstantSetForm { get; set; }
  1566. public string AConstantVal { get; set; }
  1567. public string RangeMinimum { get; set; }
  1568. public string RangeMaximum { get; set; }
  1569. public string UsePointCtrlSettleTime { get; set; }
  1570. public string UsePointCtrlSourceBand { get; set; }
  1571. public string UsePointCtrlLearnBand { get; set; }
  1572. public string UsePointUseBand { get; set; }
  1573. public MonitorEditData()
  1574. {
  1575. CreateMonitorEditData();
  1576. }
  1577. public MonitorEditData(string data)
  1578. {
  1579. CreateMonitorEditData(data);
  1580. }
  1581. private void CreateMonitorEditData()
  1582. {
  1583. CreateMonitorEditData("");
  1584. }
  1585. private void CreateMonitorEditData(string data)
  1586. {
  1587. if (data == "")
  1588. {
  1589. IsValid = "Valid";
  1590. Module = "";
  1591. MeasDateName = "Cup Temperature";
  1592. RecipeName = "Local";
  1593. TempControlForm = "Temp Control ON";
  1594. ControllerName = "THC Controller";
  1595. PortNo = "8";
  1596. ChannelNo = "0";
  1597. TunForm = "No Sync";
  1598. TunDestNode = "";
  1599. TunDestSensorID = "2";
  1600. ControlForm = "Standard";
  1601. InitialData = "23.00";
  1602. OverTemp = "180.00";
  1603. SettlingDetermineTime = "5.0";
  1604. SettlingTimeOut = "600.0";
  1605. UsePointOffset = "0.00";
  1606. StartMonitorForm = "Normal";
  1607. StartInvalidTime = "0.0";
  1608. ProcessMonitorForm = "Monitor";
  1609. ProcessDeterminationTime = "0.0";
  1610. ProcessValue = "0.0";
  1611. PIDSetForm = "Manual Setting";
  1612. PIDPParam = "1.00";
  1613. PIDIParam = "25.00";
  1614. PIDDParam = "5.00";
  1615. OffsetSetForm = "Set";
  1616. OffsetVal = "0.00";
  1617. AConstantSetForm = "Set";
  1618. AConstantVal = "0.00";
  1619. RangeMinimum = "50.0";
  1620. RangeMaximum = "200.0";
  1621. UsePointCtrlSettleTime = "0.0";
  1622. UsePointCtrlSourceBand = "0.00";
  1623. UsePointCtrlLearnBand = "0.00";
  1624. UsePointUseBand = "0.00";
  1625. }
  1626. else
  1627. {
  1628. int index = 0;
  1629. var rtn = data.Split('/');
  1630. IsValid = rtn[index++];
  1631. Module = rtn[index++];
  1632. MeasDateName = rtn[index++];
  1633. RecipeName = rtn[index++];
  1634. TempControlForm = rtn[index++];
  1635. ControllerName = rtn[index++];
  1636. if (ControllerName == "TCH Controller") ControllerName = "THC Controller";
  1637. PortNo = rtn[index++];
  1638. ChannelNo = rtn[index++];
  1639. TunForm = rtn[index++];
  1640. TunDestNode = rtn[index++];
  1641. TunDestSensorID = rtn[index++];
  1642. ControlForm = rtn[index++];
  1643. InitialData = rtn[index++];
  1644. OverTemp = rtn[index++];
  1645. SettlingDetermineTime = rtn[index++];
  1646. SettlingTimeOut = rtn[index++];
  1647. UsePointOffset = rtn[index++];
  1648. StartMonitorForm = rtn[index++];
  1649. StartInvalidTime = rtn[index++];
  1650. ProcessMonitorForm = rtn[index++];
  1651. ProcessDeterminationTime = rtn[index++];
  1652. ProcessValue = rtn[index++];
  1653. PIDSetForm = rtn[index++];
  1654. PIDPParam = rtn[index++];
  1655. PIDIParam = rtn[index++];
  1656. PIDDParam = rtn[index++];
  1657. OffsetSetForm = rtn[index++];
  1658. OffsetVal = rtn[index++];
  1659. AConstantSetForm = rtn[index++];
  1660. AConstantVal = rtn[index++];
  1661. RangeMinimum = rtn[index++];
  1662. RangeMaximum = rtn[index++];
  1663. UsePointCtrlSettleTime = rtn[index++];
  1664. UsePointCtrlSourceBand = rtn[index++];
  1665. UsePointCtrlLearnBand = rtn[index++];
  1666. UsePointUseBand = rtn[index++];
  1667. }
  1668. }
  1669. public override string ToString()
  1670. {
  1671. string[] strList = new string[]
  1672. {
  1673. IsValid,Module,MeasDateName,RecipeName,TempControlForm, ControllerName,PortNo,ChannelNo,TunForm,TunDestNode,TunDestSensorID,ControlForm,
  1674. InitialData,OverTemp,SettlingDetermineTime,SettlingTimeOut,UsePointOffset,StartMonitorForm,StartInvalidTime,ProcessMonitorForm,
  1675. ProcessDeterminationTime,ProcessValue,PIDSetForm, PIDPParam,PIDIParam,PIDDParam,OffsetSetForm,OffsetVal,AConstantSetForm,
  1676. AConstantVal,RangeMinimum,RangeMaximum,UsePointCtrlSettleTime,UsePointCtrlSourceBand,UsePointCtrlLearnBand,UsePointUseBand
  1677. };
  1678. return String.Join("/", strList);
  1679. }
  1680. public object Clone()
  1681. {
  1682. return this.MemberwiseClone();
  1683. }
  1684. }
  1685. public class DataCollecion
  1686. {
  1687. public string MouleName { get; set; }
  1688. public ObservableCollection<string> MeasureData { get; set; } = new ObservableCollection<string>();
  1689. }
  1690. public class SystemParameter
  1691. {
  1692. public string WaferExistInRCV { get; set; }
  1693. public string AutomaticRegistrationEditor { get; set; }
  1694. public string DesignationOfLotEnd { get; set; }
  1695. public string DefaultScreenForRunButton { get; set; }
  1696. public string CupWashingAlarm { get; set; }
  1697. public string EISInitializeCondition { get; set; }
  1698. }
  1699. public class TransferArmPosition
  1700. {
  1701. public string TransferMode { get; set; }
  1702. public double StartOffset { get; set; }
  1703. public double EndOffset { get; set; }
  1704. public int SlowSpeedRate { get; set; }
  1705. public TransferArmPosition()
  1706. {
  1707. PincetteList.Clear();
  1708. PincetteList.Add("pincette1", new Pincette());
  1709. PincetteList.Add("pincette2", new Pincette());
  1710. PincetteList.Add("pincette3", new Pincette());
  1711. }
  1712. public Dictionary<string, Pincette> PincetteList { get; set; } = new Dictionary<string, Pincette>();
  1713. public Dictionary<string, object> GetScValue(string root)
  1714. {
  1715. Dictionary<string, object> result = new Dictionary<string, object>();
  1716. result[$"{root}Zaxis.TransferMode"] = TransferMode;
  1717. result[$"{root}Zaxis.StartOffset"] = StartOffset;
  1718. result[$"{root}Zaxis.EndOffset"] = EndOffset;
  1719. result[$"{root}Zaxis.SlowSpeedRate"] = SlowSpeedRate;
  1720. result.AddRange(PincetteList["pincette1"].GetScValue($"{root}pincette1."));
  1721. result.AddRange(PincetteList["pincette2"].GetScValue($"{root}pincette2."));
  1722. result.AddRange(PincetteList["pincette3"].GetScValue($"{root}pincette3."));
  1723. return result;
  1724. }
  1725. }
  1726. public class Pincette
  1727. {
  1728. public double XaxisReceive { get; set; }
  1729. public double XaxisSend { get; set; }
  1730. public double YaxisReceive { get; set; }
  1731. public double YaxisSend { get; set; }
  1732. public double ZaxisReceive { get; set; }
  1733. public double ZaxisSend { get; set; }
  1734. public double RaxisReceive { get; set; }
  1735. public double RaxisSend { get; set; }
  1736. public double StrokeZaxisReceive { get; set; }
  1737. public double StrokeZaxisSend { get; set; }
  1738. public int ZaxisReceivePer { get; set; }
  1739. public int ZaxisSendPer { get; set; }
  1740. public Dictionary<string, object> GetScValue(string root)
  1741. {
  1742. Dictionary<string, object> result = new Dictionary<string, object>();
  1743. result[$"{root}XaxisReceive"] = XaxisReceive;
  1744. result[$"{root}XaxisSend"] = XaxisSend;
  1745. result[$"{root}YaxisReceive"] = YaxisReceive;
  1746. result[$"{root}YaxisSend"] = YaxisSend;
  1747. result[$"{root}ZaxisReceive"] = ZaxisReceive;
  1748. result[$"{root}ZaxisSend"] = ZaxisSend;
  1749. result[$"{root}RaxisReceive"] = RaxisReceive;
  1750. result[$"{root}RaxisSend"] = RaxisSend;
  1751. result[$"{root}StrokeZaxisReceive"] = StrokeZaxisReceive;
  1752. result[$"{root}StrokeZaxisSend"] = StrokeZaxisSend;
  1753. result[$"{root}ZaxisReceivePer"] = ZaxisReceivePer;
  1754. result[$"{root}ZaxisSendPer"] = ZaxisSendPer;
  1755. return result;
  1756. }
  1757. }
  1758. public class ArmPosition
  1759. {
  1760. public int X1 { get; set; }
  1761. public int X2 { get; set; }
  1762. public int X3 { get; set; }
  1763. public Dictionary<string, object> GetScValue(string root)
  1764. {
  1765. Dictionary<string, object> result = new Dictionary<string, object>();
  1766. result.Add($"{root}X1", X1);
  1767. result.Add($"{root}X2", X2);
  1768. result.Add($"{root}X3", X3);
  1769. return result;
  1770. }
  1771. }
  1772. }