EquipmentManager.cs 67 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835
  1. using System;
  2. using System.Collections.Generic;
  3. using System.IO;
  4. using System.Linq;
  5. using System.Threading.Tasks;
  6. using System.Windows.Media;
  7. using System.Xml;
  8. using Aitex.Common.Util;
  9. using Aitex.Core.Common;
  10. using Aitex.Core.RT.DataCenter;
  11. using Aitex.Core.RT.Device;
  12. using Aitex.Core.RT.Event;
  13. using Aitex.Core.RT.Fsm;
  14. using Aitex.Core.RT.Log;
  15. using Aitex.Core.RT.OperationCenter;
  16. using Aitex.Core.RT.RecipeCenter;
  17. using Aitex.Core.RT.Routine;
  18. using Aitex.Core.RT.SCCore;
  19. using Aitex.Core.Util;
  20. using Aitex.Core.Utilities;
  21. using FurnaceRT.Devices;
  22. using FurnaceRT.Equipments.CarrierRobots;
  23. using FurnaceRT.Equipments.FIMSs;
  24. using FurnaceRT.Equipments.Jobs;
  25. using FurnaceRT.Equipments.LPs;
  26. using FurnaceRT.Equipments.PMs;
  27. using FurnaceRT.Equipments.PMs.RecipeExecutions;
  28. using FurnaceRT.Equipments.Schedulers;
  29. using FurnaceRT.Equipments.Stockers;
  30. using FurnaceRT.Equipments.WaferRobots;
  31. using FurnaceRT.Instances;
  32. using MECF.Framework.Common.Alarms;
  33. using MECF.Framework.Common.DataCenter;
  34. using MECF.Framework.Common.Device.Bases;
  35. using MECF.Framework.Common.Equipment;
  36. using MECF.Framework.Common.Jobs;
  37. using MECF.Framework.Common.SCCore;
  38. using MECF.Framework.Common.SubstrateTrackings;
  39. using MECF.Framework.FA.Core.FAControl;
  40. using MECF.Framework.RT.Core.Applications;
  41. using MECF.Framework.RT.Core.IoProviders;
  42. using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.PMs;
  43. using AutoTransfer = FurnaceRT.Equipments.Jobs.AutoTransfer;
  44. using ReturnAllWafer = FurnaceRT.Equipments.Jobs.ReturnAllWafer;
  45. namespace FurnaceRT.Equipments.Systems
  46. {
  47. public enum RtState
  48. {
  49. Init,
  50. Initializing,
  51. Idle,
  52. Transfer,
  53. AutoRunning,
  54. AutoIdle,
  55. ReturnAllWafer,
  56. Error,
  57. Loading,
  58. Unloading,
  59. ChargeProcessDischarging,
  60. LoadProcessStockering,
  61. LoadProcessUnloading,
  62. ReturnWafer,
  63. }
  64. public enum TransferJobState
  65. {
  66. Idle,
  67. Error,
  68. Loading,
  69. Unloading,
  70. }
  71. public enum ProcessJobState
  72. {
  73. Idle,
  74. Error,
  75. Charging,
  76. Processing,
  77. Cooling,
  78. Discharging,
  79. }
  80. public partial class EquipmentManager : FsmDevice
  81. {
  82. public enum MSG
  83. {
  84. MoveWafer,
  85. ReturnAllWafer,
  86. Stop,
  87. HOME,
  88. RESET,
  89. ABORT,
  90. ERROR,
  91. ToInit,
  92. SetAutoMode,
  93. SetManualMode,
  94. FAJobCommand,
  95. CreateJob,
  96. PauseJob,
  97. ResumeJob,
  98. StartJob,
  99. StopJob,
  100. AbortJob,
  101. JobAutoStart,
  102. JobDone,
  103. ModuleError,
  104. Map,
  105. Load,
  106. Unload,
  107. ChargeProcessDischarge,
  108. LoadProcessStocker,
  109. LoadProcessUnload,
  110. CancelUnloadingJob,
  111. ToUnloading,
  112. ToLoading,
  113. CreateTransferJob,
  114. AbortTransferJob,
  115. }
  116. public Dictionary<ModuleName, ModuleFsmDevice> Modules { get; set; }
  117. public bool IsAutoMode
  118. {
  119. get
  120. {
  121. return FsmState == (int)RtState.AutoRunning || FsmState == (int)RtState.AutoIdle;
  122. }
  123. }
  124. public bool IsReturnWafer
  125. {
  126. get
  127. {
  128. return FsmState == (int)RtState.ReturnAllWafer || FsmState == (int)RtState.ReturnWafer;
  129. }
  130. }
  131. public bool IsInit
  132. {
  133. get { return FsmState == (int)RtState.Init; }
  134. }
  135. public bool IsIdle
  136. {
  137. get { return FsmState == (int)RtState.Idle; }
  138. }
  139. public bool IsAlarm
  140. {
  141. get { return FsmState == (int)RtState.Error; }
  142. }
  143. public bool IsRunning
  144. {
  145. get
  146. {
  147. return !IsAlarm && !IsIdle && !IsInit && (FsmState != (int)RtState.AutoIdle);
  148. }
  149. }
  150. public bool IsReturnWaferMode
  151. {
  152. get
  153. {
  154. return FsmState == (int)RtState.ReturnAllWafer || FsmState == (int)RtState.ReturnWafer;
  155. }
  156. }
  157. public bool IsAlarmConditionBuzzerOn { get; set; }
  158. public TransferJobState TransferJobStatus { get; set; } = TransferJobState.Idle;
  159. public ProcessJobState ProcessJobStatus { get; set; } = ProcessJobState.Idle;
  160. public object JsonConvert { get; private set; }
  161. private bool _isInited;
  162. protected IRoutine _manualTransfer;
  163. private AutoTransfer _auto = null;
  164. private TransferJob _transferJob = null;
  165. protected IRoutine _homeAll;
  166. protected IRoutine _returnAll;
  167. private string _batchType;
  168. private string _processJob;
  169. private string _processRecipe;
  170. private DeviceTimer _coolTimer = new DeviceTimer();
  171. private int _cycledCount = 0;
  172. private int _jobMSG = 0;
  173. private object[] _jobParas;
  174. private object _locker = new object();
  175. private List<string> _modules;
  176. private PeriodicJob _cycleJob;
  177. private RD_TRIG _plcConnectTrig = new RD_TRIG();
  178. public List<ModuleName> StockerNameForFATJob = new List<ModuleName>();
  179. public EquipmentManager()
  180. {
  181. Module = "System";
  182. Name = "System";
  183. Modules = new Dictionary<ModuleName, ModuleFsmDevice>();
  184. _modules = new List<string>() { "System" };
  185. }
  186. public override bool Initialize()
  187. {
  188. InitDevices();
  189. InitModules();
  190. EnumLoop<RtState>.ForEach((item) =>
  191. {
  192. MapState((int)item, item.ToString());
  193. });
  194. EnumLoop<MSG>.ForEach((item) =>
  195. {
  196. MapMessage((int)item, item.ToString());
  197. });
  198. EnableFsm(50, RtState.Init);
  199. BuildTransitionTable();
  200. SubscribeDataVariable();
  201. SubscribeOperation();
  202. InitRoutine();
  203. InitAlarmDefine();
  204. _auto = new AutoTransfer();
  205. _transferJob = new TransferJob();
  206. _cycleJob = new PeriodicJob(100, OnCycleTimer, Name, true);
  207. Singleton<EventManager>.Instance.OnAlarmEvent += Instance_OnAlarmEvent;
  208. return true;
  209. }
  210. protected void BuildModules(params ModuleFsmDevice[] modules)
  211. {
  212. if (modules != null && modules.Length > 0)
  213. {
  214. foreach (var moduleFsmDevice in modules)
  215. {
  216. Modules[ModuleHelper.Converter(moduleFsmDevice.Module)] = moduleFsmDevice;
  217. }
  218. foreach (var modulesKey in Modules.Keys)
  219. {
  220. _modules.Add(modulesKey.ToString());
  221. }
  222. foreach (var modulesValue in Modules.Values)
  223. {
  224. modulesValue.Initialize();
  225. }
  226. }
  227. }
  228. protected virtual void InitRoutine()
  229. {
  230. _homeAll = new HomeAll();
  231. _returnAll = new ReturnAllWafer();
  232. _dbCallback = new SchedulerDBCallback();
  233. }
  234. //private PeriodicJob _job1;
  235. //Stopwatch _sw = new Stopwatch();
  236. //private bool OnJob1()
  237. //{
  238. // _sw.Restart();
  239. // BufferModule buffer = Modules[ModuleName.Buffer] as BufferModule;
  240. // if (!buffer.CheckToPostMessage(BufferModule.MSG.InTransfer))
  241. // {
  242. // System.Diagnostics.Trace.Assert(false)
  243. // System.Diagnostics.Trace.WriteLine("fail to in transfer");
  244. // }
  245. // if (buffer.IsIdle)
  246. // {
  247. // System.Diagnostics.Trace.Assert(false);
  248. // System.Diagnostics.Trace.WriteLine("!!!==========>IsIdle");
  249. // }
  250. // //System.Diagnostics.Trace.Assert(buffer.IsIdle, $"in {buffer.StringFsmStatus}");
  251. // while (buffer.IsIdle)
  252. // {
  253. // Thread.Sleep(5);
  254. // }
  255. // //buffer.NoteTransferStop(ModuleName.EfemRobot, Hand.Blade1, 0, EnumTransferType.Place);
  256. // //Thread.Sleep(15);
  257. // if (!buffer.CheckToPostMessage(BufferModule.MSG.TransferComplete))
  258. // {
  259. // System.Diagnostics.Trace.Assert(false);
  260. // System.Diagnostics.Trace.WriteLine("fail to complete");
  261. // }
  262. // //if (!buffer.IsIdle)
  263. // //{
  264. // // System.Diagnostics.Trace.WriteLine("not idle");
  265. // //}
  266. // System.Diagnostics.Trace.WriteLine($" === {_sw.ElapsedMilliseconds}");
  267. // while (!buffer.IsIdle)
  268. // {
  269. // Thread.Sleep(5);
  270. // }
  271. // return true;
  272. //}
  273. private void BuildTransitionTable()
  274. {
  275. //Init sequence
  276. Transition(RtState.Init, MSG.HOME, FsmStartHome, RtState.Initializing);
  277. Transition(RtState.Idle, MSG.HOME, FsmStartHome, RtState.Initializing);
  278. Transition(RtState.Error, MSG.HOME, FsmStartHome, RtState.Initializing);
  279. Transition(RtState.Error, MSG.ToInit, null, RtState.Init);
  280. Transition(RtState.Initializing, FSM_MSG.TIMER, FsmMonitorHome, RtState.Idle);
  281. Transition(RtState.Initializing, MSG.ERROR, fError, RtState.Error);
  282. Transition(RtState.Initializing, MSG.ABORT, FsmAbort, RtState.Init);
  283. //Reset
  284. AnyStateTransition(MSG.ERROR, fError, RtState.Error);
  285. AnyStateTransition((int)FSM_MSG.ALARM, fError, (int)RtState.Error);
  286. Transition(RtState.Error, MSG.RESET, fStartReset, RtState.Idle);
  287. Transition(RtState.Init, MSG.RESET, fStartReset, RtState.Init);
  288. Transition(RtState.Idle, MSG.RESET, fStartReset, RtState.Idle);
  289. Transition(RtState.AutoIdle, MSG.RESET, fStartReset, RtState.AutoIdle);
  290. Transition(RtState.AutoRunning, MSG.RESET, fStartReset, RtState.AutoRunning);
  291. Transition(RtState.ReturnWafer, MSG.RESET, fStartReset, RtState.ReturnWafer);
  292. //Auto/manual sequence
  293. Transition(RtState.Idle, MSG.SetAutoMode, fStartAutoTransfer, RtState.AutoIdle);
  294. Transition(RtState.AutoRunning, FSM_MSG.TIMER, fAutoTransfer, RtState.AutoRunning);
  295. Transition(RtState.AutoRunning, MSG.JobAutoStart, FsmJobAutoStart, RtState.Idle);
  296. Transition(RtState.AutoRunning, MSG.ABORT, FsmAbort, RtState.Idle);
  297. Transition(RtState.AutoRunning, MSG.JobDone, null, RtState.AutoIdle);
  298. Transition(RtState.Idle, MSG.CreateJob, FsmCreateJob, RtState.AutoRunning);
  299. Transition(RtState.Idle, MSG.LoadProcessUnload, FsmStartLoadProcessUnload, RtState.AutoRunning);
  300. Transition(RtState.Idle, MSG.LoadProcessStocker, FsmStartLoadProcessStocker, RtState.AutoRunning);
  301. Transition(RtState.AutoRunning, MSG.FAJobCommand, FsmFAJobCommand, RtState.AutoRunning);
  302. Transition(RtState.AutoRunning, MSG.CreateJob, FsmCreateJob, RtState.AutoRunning);
  303. Transition(RtState.AutoRunning, MSG.StartJob, FsmStartJob, RtState.AutoRunning);
  304. Transition(RtState.AutoRunning, MSG.PauseJob, FsmPauseJob, RtState.AutoRunning);
  305. Transition(RtState.AutoRunning, MSG.ResumeJob, FsmResumeJob, RtState.AutoRunning);
  306. Transition(RtState.AutoRunning, MSG.StopJob, FsmStopJob, RtState.AutoRunning);
  307. Transition(RtState.AutoRunning, MSG.AbortJob, FsmAbortJob, RtState.AutoRunning);
  308. Transition(RtState.AutoRunning, MSG.ModuleError, FsmModuleError, RtState.AutoRunning);
  309. Transition(RtState.AutoRunning, MSG.Load, FsmStartLoad, RtState.AutoRunning);
  310. Transition(RtState.AutoRunning, MSG.Unload, FsmStartUnload, RtState.AutoRunning);
  311. Transition(RtState.Idle, MSG.CreateTransferJob, FsmCreateTransferJob, RtState.AutoRunning);
  312. Transition(RtState.AutoRunning, MSG.CreateTransferJob, FsmCreateTransferJob, RtState.AutoRunning);
  313. Transition(RtState.AutoRunning, MSG.AbortTransferJob, FsmAbortTransferJob, RtState.AutoRunning);
  314. Transition(RtState.AutoRunning, MSG.CancelUnloadingJob, FsmCancelUnloadingJob, RtState.AutoRunning);
  315. Transition(RtState.AutoRunning, MSG.LoadProcessUnload, FsmStartLoadProcessUnload, RtState.AutoRunning);
  316. Transition(RtState.AutoRunning, MSG.LoadProcessStocker, FsmStartLoadProcessStocker, RtState.AutoRunning);
  317. Transition(RtState.AutoIdle, MSG.FAJobCommand, FsmFAJobCommand, RtState.AutoRunning);
  318. Transition(RtState.AutoIdle, FSM_MSG.TIMER, FsmMonitorAutoIdle, RtState.AutoIdle);
  319. Transition(RtState.AutoIdle, MSG.SetManualMode, FsmStartSetManualMode, RtState.Idle);
  320. Transition(RtState.AutoIdle, MSG.CreateJob, FsmCreateJob, RtState.AutoRunning);
  321. Transition(RtState.AutoIdle, MSG.StartJob, FsmStartJob, RtState.AutoRunning);
  322. Transition(RtState.AutoIdle, MSG.ABORT, FsmAbort, RtState.Idle);
  323. Transition(RtState.AutoIdle, MSG.AbortJob, FsmAbortJob, RtState.AutoIdle);
  324. Transition(RtState.AutoIdle, MSG.Load, FsmStartLoad, RtState.AutoIdle);
  325. Transition(RtState.AutoIdle, MSG.Unload, FsmStartUnload, RtState.AutoIdle);
  326. Transition(RtState.AutoIdle, MSG.CreateTransferJob, FsmCreateTransferJob, RtState.AutoRunning);
  327. Transition(RtState.AutoIdle, MSG.AbortTransferJob, FsmAbortTransferJob, RtState.AutoIdle);
  328. Transition(RtState.AutoIdle, MSG.LoadProcessUnload, FsmStartLoadProcessUnload, RtState.AutoRunning);
  329. Transition(RtState.AutoIdle, MSG.LoadProcessStocker, FsmStartLoadProcessStocker, RtState.AutoRunning);
  330. EnterExitTransition<RtState, FSM_MSG>(RtState.AutoRunning, null, FSM_MSG.NONE, fExitAutoTransfer);
  331. //return all wafer
  332. //Transition(RtState.Idle, MSG.ReturnAllWafer, FsmStartReturnAllWafer, RtState.ReturnAllWafer);
  333. //Transition(RtState.ReturnAllWafer, FSM_MSG.TIMER, FsmMonitorReturnAllWafer, RtState.Idle);
  334. //Transition(RtState.ReturnAllWafer, MSG.ABORT, FsmAbortReturnAllWafer, RtState.Idle);
  335. //Return wafer
  336. Transition(RtState.Idle, MSG.ReturnAllWafer, FsmStartReturnWafer, RtState.ReturnWafer);
  337. Transition(RtState.AutoIdle, MSG.ReturnAllWafer, FsmStartReturnWafer, RtState.ReturnWafer);
  338. Transition(RtState.ReturnWafer, FSM_MSG.TIMER, FsmMonitorReturnWafer, RtState.Idle);
  339. Transition(RtState.ReturnWafer, MSG.ABORT, FsmAbort, RtState.Idle);
  340. //Transfer sequence
  341. Transition(RtState.Idle, MSG.MoveWafer, fStartTransfer, RtState.Transfer);
  342. Transition(RtState.Transfer, FSM_MSG.TIMER, fTransfer, RtState.Idle);
  343. EnterExitTransition<RtState, FSM_MSG>(RtState.Transfer, null, FSM_MSG.NONE, fExitTransfer);
  344. Transition(RtState.Transfer, MSG.ABORT, FsmAbort, RtState.Idle);
  345. }
  346. void SubscribeDataVariable()
  347. {
  348. DATA.Subscribe("System.FFUKeyDict", () => GetDeviceKeyDict(DeviceName.IoFFUNameKey), SubscriptionAttribute.FLAG.IgnoreSaveDB);
  349. DATA.Subscribe("System.NameKeyDict", () => GetALLDeviceKeyDict(), SubscriptionAttribute.FLAG.IgnoreSaveDB);
  350. DATA.Subscribe("Rt.Status", () => StringFsmStatus);
  351. DATA.Subscribe("System.IsInitialized", () => _isInited);
  352. DATA.Subscribe("System.IsIdle", () => IsIdle || IsInit || (FsmState == (int)RtState.AutoIdle));
  353. DATA.Subscribe("System.IsAlarm", () => IsAlarm);
  354. DATA.Subscribe("System.IsBusy", () => IsRunning);
  355. DATA.Subscribe("System.IsAutoRunning", () => IsRunning);
  356. DATA.Subscribe("System.IsAlarmConditionBuzzerOn", () => IsAlarmConditionBuzzerOn);
  357. DATA.Subscribe("System.Modules", () => _modules);
  358. }
  359. List<string> GetDeviceKeyDict(string key)
  360. {
  361. List<string> result = null;
  362. if (SC.GetStringValue("System.SetUp.ToolType") != "ELK") return null;
  363. GetXmlElement("DeviceModelPM", key, ref result);
  364. return result;
  365. }
  366. Dictionary<string,List<string>> GetALLDeviceKeyDict()
  367. {
  368. return GetXmlElement("DeviceModelPM");
  369. }
  370. public void GetXmlElement(string fileName,string type, ref List<string> result, bool isSystem = false)
  371. {
  372. result = new List<string>();
  373. XmlDocument xmlDoc = new XmlDocument();
  374. var cfDirPath = PathManager.GetCfgDir();
  375. var path = cfDirPath + $"IO\\{SC.GetStringValue("System.SetUp.ToolType")}\\{fileName}.xml";
  376. if (!File.Exists(path)) return;
  377. xmlDoc.Load(path);
  378. XmlNode node = xmlDoc.SelectSingleNode("DeviceModelDefine");
  379. foreach (XmlNode item in node.ChildNodes)
  380. {
  381. if (item.NodeType != XmlNodeType.Element) continue;
  382. var element = item as XmlElement;
  383. var classType = element.GetAttribute("classType");
  384. if (classType == null) continue;
  385. classType = classType.Split('.').LastOrDefault();
  386. if (classType ==type)
  387. {
  388. foreach (XmlNode children in item.ChildNodes)
  389. {
  390. if (children is XmlElement childElement)
  391. {
  392. if (result.Contains(childElement.GetAttribute("id"))) continue;
  393. var key = isSystem ? $"System.{childElement.GetAttribute("id")}.DeviceData" : $"PM1.{childElement.GetAttribute("id")}.DeviceData";
  394. result.Add(key);
  395. }
  396. }
  397. }
  398. }
  399. }
  400. public Dictionary<string,List<string>> GetXmlElement(string fileName, bool isSystem = false)
  401. {
  402. Dictionary<string, List<string>> result = new Dictionary<string, List<string>>();
  403. XmlDocument xmlDoc = new XmlDocument();
  404. var cfDirPath = PathManager.GetCfgDir();
  405. var path = cfDirPath + $"IO\\{SC.GetStringValue("System.SetUp.ToolType")}\\{fileName}.xml";
  406. if (!File.Exists(path)) return result;
  407. xmlDoc.Load(path);
  408. XmlNode node = xmlDoc.SelectSingleNode("DeviceModelDefine");
  409. foreach (XmlNode item in node.ChildNodes)
  410. {
  411. if (item.NodeType != XmlNodeType.Element) continue;
  412. var element = item as XmlElement;
  413. var classType = element.GetAttribute("classType");
  414. if (classType == null) continue;
  415. classType = classType.Split('.').LastOrDefault();
  416. result[classType] = new List<string>();
  417. foreach (XmlNode children in item.ChildNodes)
  418. {
  419. if (children.Name != classType) continue;//类型限定一致
  420. if (children is XmlElement childElement)
  421. {
  422. if (result[classType].Contains(childElement.GetAttribute("id"))) continue;
  423. var key = isSystem ? $"System.{childElement.GetAttribute("id")}.DeviceData" : $"PM1.{childElement.GetAttribute("id")}.DeviceData";
  424. result[classType].Add(key);
  425. }
  426. }
  427. }
  428. return result;
  429. }
  430. void SubscribeOperation()
  431. {
  432. OP.Subscribe("CreateWafer", InvokeCreateWafer);
  433. OP.Subscribe("System.UpdateWafer", InvokeUpdateWafer);
  434. OP.Subscribe("CreateWaferFromTo", InvokeCreateWaferFromTo);
  435. OP.Subscribe("DeleteWafer", InvokeDeleteWafer);
  436. OP.Subscribe("DeleteWaferFromTo", InvokeDeleteWaferFromTo);
  437. OP.Subscribe("CreateCassetteWafer", InvokeCreateCassetteWafer);
  438. OP.Subscribe("DeleteCassetteWafer", InvokeDeleteCassetteWafer);
  439. OP.Subscribe("System.CreateCarrier", InvokeCreateCarrier);
  440. OP.Subscribe("System.DeleteCarrier", InvokeDeleteCarrier);
  441. OP.Subscribe("System.SetLotID", InvokeSetLotID);
  442. OP.Subscribe("System.DeleteAllWafer", InvokeDeleteAllWafer);
  443. OP.Subscribe("System.DeleteAllCarrier", InvokeDeleteAllCarrier);
  444. OP.Subscribe("ReturnWafer", InvokeReturnWafer);
  445. OP.Subscribe("System.SignalTower.SwitchOffBuzzer", InvokeSwitchOffBuzzer);
  446. OP.Subscribe("System.ReturnAllWafer", (string cmd, object[] args) =>
  447. {
  448. return CheckToPostMessage((int)MSG.ReturnAllWafer);
  449. });
  450. OP.Subscribe("System.MoveWafer", (string cmd, object[] args) =>
  451. {
  452. if (!Enum.TryParse((string)args[0], out ModuleName source))
  453. {
  454. EV.PostWarningLog(Name, $"Parameter source {(string)args[0]} not valid");
  455. return false;
  456. }
  457. if (!Enum.TryParse((string)args[2], out ModuleName destination))
  458. {
  459. EV.PostWarningLog(Name, $"Parameter destination {(string)args[1]} not valid");
  460. return false;
  461. }
  462. if (args.Length > 8)
  463. {
  464. return CheckToPostMessage((int)MSG.MoveWafer, source, (int)args[1], destination, (int)args[3],
  465. (bool)args[4], (int)args[5], (bool)args[6], (int)args[7]);
  466. }
  467. else if (args.Length > 5)
  468. {
  469. return CheckToPostMessage((int)MSG.MoveWafer, source, (int)args[1], destination, (int)args[3], (bool)args[4]);
  470. }
  471. return CheckToPostMessage((int)MSG.MoveWafer, source, (int)args[1], destination, (int)args[3]);
  472. });
  473. OP.Subscribe("System.HomeAll", (string cmd, object[] args) =>
  474. {
  475. return CheckToPostMessage((int)MSG.HOME);
  476. });
  477. OP.Subscribe("System.Abort", (string cmd, object[] args) =>
  478. {
  479. return CheckToPostMessage((int)MSG.ABORT);
  480. });
  481. OP.Subscribe("System.Reset", (string cmd, object[] args) =>
  482. {
  483. return CheckToPostMessage((int)MSG.RESET);
  484. });
  485. OP.Subscribe("System.SetAutoMode", (string cmd, object[] args) =>
  486. {
  487. return CheckToPostMessage((int)MSG.SetAutoMode);
  488. });
  489. OP.Subscribe("System.SetManualMode", (string cmd, object[] args) =>
  490. {
  491. return CheckToPostMessage((int)MSG.SetManualMode);
  492. });
  493. OP.Subscribe("System.CreateJob", (string cmd, object[] args) =>
  494. {
  495. return CheckToPostMessage((int)MSG.CreateJob, args[0]);
  496. });
  497. OP.Subscribe("System.StartJob", (string cmd, object[] args) =>
  498. {
  499. return CheckToPostMessage((int)MSG.StartJob, args[0]);
  500. });
  501. OP.Subscribe("System.PauseJob", (string cmd, object[] args) =>
  502. {
  503. return CheckToPostMessage((int)MSG.PauseJob, args[0]);
  504. });
  505. OP.Subscribe("System.ResumeJob", (string cmd, object[] args) =>
  506. {
  507. return CheckToPostMessage((int)MSG.ResumeJob, args[0]);
  508. });
  509. OP.Subscribe("System.StopJob", (string cmd, object[] args) =>
  510. {
  511. return CheckToPostMessage((int)MSG.StopJob, args[0]);
  512. });
  513. OP.Subscribe("System.AbortJob", (string cmd, object[] args) =>
  514. {
  515. return CheckToPostMessage((int)MSG.AbortJob, args[0]);
  516. });
  517. OP.Subscribe("System.CoolingSkip", (string cmd, object[] args) =>
  518. {
  519. CoolingSkip();
  520. return true;
  521. });
  522. OP.Subscribe("System.ShutDown", InvokeShutDown);
  523. OP.Subscribe($"System.Load", (string cmd, object[] args) => CheckToPostJobMessage((int)MSG.CreateTransferJob, args));
  524. OP.Subscribe($"System.Unload", (string cmd, object[] args) => CheckToPostJobMessage((int)MSG.CreateTransferJob, args));
  525. OP.Subscribe($"System.ChargeProcessDischarge", (string cmd, object[] args) => CheckToPostJobMessage((int)MSG.CreateJob, args));
  526. OP.Subscribe($"System.LoadProcessUnload", (string cmd, object[] args) => CheckToPostJobMessage((int)MSG.LoadProcessUnload, args));
  527. OP.Subscribe($"System.LoadProcessStocker", (string cmd, object[] args) => CheckToPostJobMessage((int)MSG.LoadProcessStocker, args));
  528. OP.Subscribe($"System.MonitorLoad", (string cmd, object[] args) => CheckToPostJobMessage((int)MSG.CreateTransferJob, args));
  529. OP.Subscribe($"System.MonitorUnload", (string cmd, object[] args) => CheckToPostJobMessage((int)MSG.CreateTransferJob, args));
  530. OP.Subscribe($"System.SDLoad", (string cmd, object[] args) => CheckToPostJobMessage((int)MSG.CreateTransferJob, args));
  531. OP.Subscribe($"System.SDUnload", (string cmd, object[] args) => CheckToPostJobMessage((int)MSG.CreateTransferJob, args));
  532. OP.Subscribe($"{Module}.AlarmAction", (string cmd, object[] args) =>
  533. {
  534. Enum.TryParse(args[0].ToString(), out AlarmAction alarmAction);
  535. if (alarmAction == AlarmAction.ClearAll)
  536. {
  537. CheckToPostMessage((int)MSG.RESET);
  538. return true;
  539. }
  540. string eventName = null;
  541. if (args.Length > 1)
  542. eventName = args[1].ToString();
  543. if (eventName != null)
  544. {
  545. EV.ClearAlarmEvent(eventName);
  546. var item = _triggeredAlarmList.FirstOrDefault(x => x.EventEnum == eventName);
  547. if (item != null)
  548. {
  549. item.Reset();
  550. _triggeredAlarmList.Remove(item);
  551. }
  552. if (item != null)
  553. {
  554. switch (alarmAction)
  555. {
  556. case AlarmAction.Retry:
  557. {
  558. CheckToPostMessage((int)item.RetryMessage, item.RetryMessageParas);
  559. }
  560. break;
  561. case AlarmAction.Abort:
  562. {
  563. CheckToPostMessage((int)MSG.ABORT);
  564. }
  565. break;
  566. case AlarmAction.Clear:
  567. {
  568. int alarmCount = 0;
  569. var alarms = EV.GetAlarmEvent();
  570. foreach (var alarm in alarms)
  571. {
  572. if (alarm.Level == EventLevel.Alarm && alarm.Source == Name)
  573. alarmCount++;
  574. }
  575. if (alarmCount == 0)
  576. CheckToPostMessage((int)MSG.RESET);
  577. }
  578. break;
  579. case AlarmAction.Continue:
  580. {
  581. int alarmCount = 0;
  582. var alarms = EV.GetAlarmEvent();
  583. foreach (var alarm in alarms)
  584. {
  585. if (alarm.Level == EventLevel.Alarm && alarm.Source == Name)
  586. alarmCount++;
  587. }
  588. if (alarmCount == 0)
  589. CheckToPostMessage((int)MSG.RESET);
  590. }
  591. break;
  592. }
  593. }
  594. }
  595. return true;
  596. });
  597. }
  598. private void Instance_OnAlarmEvent(EventItem item)
  599. {
  600. if (item != null && item.Level == EventLevel.Alarm && (item.Source == Name || item.Source == Module))
  601. {
  602. DEVICE.GetDevice<SignalTowerBase>("System.SignalTower")?.Reset();
  603. LOG.Write($"{item.Source} {item.EventEnum} {item.Description}\n");
  604. PostMsg(MSG.ERROR);
  605. }
  606. }
  607. #region Init
  608. private bool FsmStartHome(object[] objs)
  609. {
  610. _isInited = false;
  611. return _homeAll.Start() == Result.RUN;
  612. }
  613. private bool FsmMonitorHome(object[] objs)
  614. {
  615. Result ret = _homeAll.Monitor();
  616. if (ret == Result.DONE)
  617. {
  618. _isInited = true;
  619. return true;
  620. }
  621. if (ret == Result.FAIL)
  622. {
  623. PostMsg(MSG.ERROR);
  624. }
  625. return false;
  626. }
  627. private bool fError(object[] objs)
  628. {
  629. if (FsmState == (int)RtState.Transfer)
  630. {
  631. }
  632. return true;
  633. }
  634. #endregion
  635. #region job
  636. private bool FsmStartLoad(object[] param)
  637. {
  638. if (_transferJob.CreateJob(param) != Result.RUN)
  639. {
  640. return false;
  641. }
  642. return true;
  643. }
  644. private bool FsmStartUnload(object[] param)
  645. {
  646. if (_transferJob.CreateJob(param) != Result.RUN)
  647. {
  648. return false;
  649. }
  650. return true;
  651. }
  652. private bool FsmStartLoadProcessStocker(object[] param)
  653. {
  654. var paramDic = (Dictionary<string, object>)param[0];
  655. if (paramDic == null)
  656. {
  657. LoadProcessStockerStartFailedWarning.Set("Parameter not valid");
  658. return false;
  659. }
  660. paramDic["TransferType"] = "Loading";
  661. param[0] = paramDic;
  662. if (_transferJob.CreateJob(param) != Result.RUN)
  663. {
  664. return false;
  665. }
  666. if (_auto.CreateJob(param) != Result.RUN)
  667. {
  668. return false;
  669. }
  670. return true;
  671. }
  672. private bool FsmStartLoadProcessUnload(object[] param)
  673. {
  674. var paramDic = (Dictionary<string, object>)param[0];
  675. if (paramDic == null)
  676. {
  677. LoadProcessUnloadStartFailedWarning.Set("Parameter not valid");
  678. return false;
  679. }
  680. paramDic["TransferType"] = "Loading";
  681. param[0] = paramDic;
  682. if (_transferJob.CreateJob(param) != Result.RUN)
  683. {
  684. return false;
  685. }
  686. if (_auto.CreateJob(param) != Result.RUN)
  687. {
  688. return false;
  689. }
  690. paramDic["TransferType"] = "Unloading";
  691. param[0] = paramDic;
  692. if (_transferJob.CreateJob(param) != Result.RUN)
  693. {
  694. return false;
  695. }
  696. return true;
  697. }
  698. #endregion
  699. #region AutoTransfer
  700. private bool FsmMonitorAutoIdle(object[] param)
  701. {
  702. Result ret = _transferJob.Monitor();
  703. _auto.Monitor();
  704. if (!_auto.CheckAllJobDone() || !_transferJob.CheckAllJobDone())
  705. {
  706. return false;
  707. }
  708. return ret == Result.DONE;
  709. }
  710. private bool FsmStartSetManualMode(object[] objs)
  711. {
  712. if (_auto.HasJobRunning)
  713. {
  714. EV.PostWarningLog("System", "Can not change to manual mode, abort running job first");
  715. return false;
  716. }
  717. return true;
  718. }
  719. private bool fStartAutoTransfer(object[] objs)
  720. {
  721. Result ret = _auto.Start(objs);
  722. return ret == Result.RUN;
  723. }
  724. private bool fAutoTransfer(object[] objs)
  725. {
  726. Result ret = _transferJob.Monitor();
  727. _auto.Monitor();
  728. if (_auto.CheckAllJobDone() && _transferJob.CheckAllJobDone())
  729. {
  730. if (!CheckToPostMessage((int)MSG.JobDone))
  731. return false;
  732. }
  733. return ret == Result.DONE;
  734. }
  735. private bool fExitAutoTransfer(object[] objs)
  736. {
  737. _auto.Clear();
  738. _transferJob.Clear();
  739. return true;
  740. }
  741. private bool fAbortAutoTransfer(object[] objs)
  742. {
  743. _auto.Clear();
  744. _transferJob.Clear();
  745. return true;
  746. }
  747. #endregion
  748. #region return all wafer
  749. private bool FsmAbortReturnAllWafer(object[] param)
  750. {
  751. return true;
  752. }
  753. private bool FsmMonitorReturnAllWafer(object[] param)
  754. {
  755. return _returnAll.Monitor() == Result.DONE;
  756. }
  757. private bool FsmStartReturnAllWafer(object[] param)
  758. {
  759. return _returnAll.Start() == Result.RUN;
  760. }
  761. #endregion
  762. #region Transfer
  763. private bool fStartTransfer(object[] objs)
  764. {
  765. Result ret = _manualTransfer.Start(objs);
  766. if (ret == Result.FAIL || ret == Result.DONE)
  767. return false;
  768. return ret == Result.RUN;
  769. }
  770. private bool fTransfer(object[] objs)
  771. {
  772. Result ret = _manualTransfer.Monitor();
  773. if (ret == Result.FAIL)
  774. {
  775. PostMsg(MSG.ERROR);
  776. return false;
  777. }
  778. return ret == Result.DONE;
  779. }
  780. private bool fExitTransfer(object[] objs)
  781. {
  782. return true;
  783. }
  784. private bool fAbortTransfer(object[] objs)
  785. {
  786. return true;
  787. }
  788. #endregion
  789. #region reset
  790. private bool fStartReset(object[] objs)
  791. {
  792. EV.ClearAlarmEvent();
  793. Singleton<DeviceEntity>.Instance.PostMsg(DeviceEntity.MSG.RESET);
  794. IoProviderManager.Instance.Reset();
  795. foreach (var modulesValue in Modules.Values)
  796. {
  797. modulesValue.Reset();
  798. }
  799. _triggeredAlarmList.ForEach(x => x.Reset());
  800. _triggeredAlarmList.Clear();
  801. if (FsmState == (int)RtState.Error)
  802. {
  803. if (!_isInited)
  804. {
  805. PostMsg(MSG.ToInit);
  806. return false;
  807. }
  808. return true;
  809. }
  810. return false;
  811. }
  812. #endregion
  813. private bool FsmCreateJob(object[] param)
  814. {
  815. if (FsmState != (int)RtState.AutoRunning && CarrierManager.Instance.CheckHasCarrier(ModuleName.CarrierRobot, 0))
  816. {
  817. EV.PostWarningLog("System", $"FOUP robot already has a FOUP, create job failed");
  818. return false;
  819. }
  820. _auto.CreateJob((Dictionary<string, object>)param[0]);
  821. return true;
  822. }
  823. private bool FsmAbortJob(object[] param)
  824. {
  825. _auto.AbortJob((string)param[0]);
  826. return true;
  827. }
  828. private bool FsmStopJob(object[] param)
  829. {
  830. _auto.StopJob((string)param[0]);
  831. Singleton<FAJobController>.Instance.CJAbort((string)param[0]);
  832. //CheckToPostMessage((int)MSG.StopJob);//
  833. return true;
  834. }
  835. private bool FsmResumeJob(object[] param)
  836. {
  837. _auto.ResumeJob((string)param[0]);
  838. return true;
  839. }
  840. private bool FsmPauseJob(object[] param)
  841. {
  842. _auto.PauseJob((string)param[0]);
  843. return true;
  844. }
  845. private bool FsmStartJob(object[] param)
  846. {
  847. return _auto.StartJob((string)param[0]);
  848. }
  849. private bool FsmCreateTransferJob(object[] param)
  850. {
  851. if (FsmState != (int)RtState.AutoRunning && CarrierManager.Instance.CheckHasCarrier(ModuleName.CarrierRobot, 0))
  852. {
  853. EV.PostWarningLog("System", $"FOUP robot already has a FOUP, create job failed");
  854. return false;
  855. }
  856. _transferJob.CreateJob(param);
  857. return true;
  858. }
  859. private bool FsmAbortTransferJob(object[] param)
  860. {
  861. _transferJob.AbortJob((string)param[0]);
  862. return true;
  863. }
  864. private bool FsmCancelUnloadingJob(object[] param)
  865. {
  866. _transferJob.CancelUnloadingJob((string)param[0], (string)param[1]);
  867. return true;
  868. }
  869. private bool FsmJobAutoStart(object[] param)
  870. {
  871. _auto.PauseJob((string)param[0]);
  872. _auto.Clear();
  873. return true;
  874. }
  875. private bool FsmAbort(object[] param)
  876. {
  877. if (FsmState == (int)RtState.Transfer)
  878. {
  879. // _manualTransfer.Clear();
  880. }
  881. if (FsmState == (int)RtState.ChargeProcessDischarging || FsmState == (int)RtState.LoadProcessStockering || FsmState == (int)RtState.LoadProcessUnloading)
  882. {
  883. _auto.PjUpdated();
  884. _auto.PjFinished("Job Abort");
  885. }
  886. if (FsmState == (int)RtState.AutoRunning)
  887. {
  888. _auto.Clear();
  889. }
  890. if (FsmState == (int)RtState.Initializing)
  891. {
  892. _homeAll.Abort();
  893. }
  894. return true;
  895. }
  896. private bool FsmModuleError(object[] param)
  897. {
  898. //_auto.ModuleError((string)param[0]);
  899. return true;
  900. }
  901. private bool FsmStartReturnWafer(object[] objs)
  902. {
  903. Result ret = _returnAll.Start();
  904. if (ret == Result.FAIL)
  905. {
  906. PostMsg(MSG.ERROR);
  907. return false;
  908. }
  909. return ret == Result.RUN;
  910. }
  911. private bool FsmMonitorReturnWafer(object[] objs)
  912. {
  913. Result ret = _returnAll.Monitor();
  914. if (ret == Result.FAIL)
  915. {
  916. PostMsg(MSG.ERROR);
  917. return false;
  918. }
  919. if (ret == Result.DONE)
  920. {
  921. _batchType = "";
  922. _processJob = "";
  923. _processRecipe = "";
  924. (Modules[ModuleName.CarrierRobot] as CarrierRobotModule).Home(out _);
  925. (Modules[ModuleName.WaferRobot] as WaferRobotModule).Home(out _);
  926. }
  927. return ret == Result.DONE;
  928. }
  929. private bool InvokeSwitchOffBuzzer(string arg1, object[] args)
  930. {
  931. DEVICE.GetDevice<SignalTowerBase>("System.SignalTower")?.SwitchOffBuzzer(true);
  932. IsAlarmConditionBuzzerOn = false;
  933. return true;
  934. }
  935. private bool InvokeReturnWafer(string arg1, object[] args)
  936. {
  937. ModuleName target = ModuleHelper.Converter(args[0].ToString());
  938. int slot = (int)args[1];
  939. if (ModuleHelper.IsLoadPort(target))
  940. {
  941. EV.PostInfoLog("System", string.Format("Wafer already at LoadPort {0} {1}, return operation is not valid", target.ToString(), slot + 1));
  942. return false;
  943. }
  944. if (!WaferManager.Instance.IsWaferSlotLocationValid(target, slot))
  945. {
  946. EV.PostWarningLog("System", string.Format("Invalid position,{0},{1}", target.ToString(), slot.ToString()));
  947. return false;
  948. }
  949. WaferInfo wafer = WaferManager.Instance.GetWafer(target, slot);
  950. if (wafer.IsEmpty)
  951. {
  952. EV.PostInfoLog("System", string.Format("No wafer at {0} {1}, return operation is not valid", target.ToString(), slot + 1));
  953. return false;
  954. }
  955. return CheckToPostMessage((int)MSG.MoveWafer,
  956. target, slot,
  957. (ModuleName)wafer.OriginStation, wafer.OriginSlot,
  958. false, 0, false, 0);
  959. }
  960. private bool InvokeDeleteAllWafer(string arg1, object[] args)
  961. {
  962. foreach (var item in Modules.Values)
  963. {
  964. if ((item as PMModule) != null || (item as WaferRobotModule) != null)
  965. {
  966. var wafers = WaferManager.Instance.GetWafers(ModuleHelper.Converter(item.Module));
  967. for (int i = 0; i < wafers.Length; i++)
  968. {
  969. if (!wafers[i].IsEmpty)
  970. WaferManager.Instance.DeleteWafer(ModuleHelper.Converter(item.Module), i);
  971. }
  972. }
  973. }
  974. return true;
  975. }
  976. private bool InvokeDeleteAllCarrier(string arg1, object[] args)
  977. {
  978. foreach (var item in Modules.Values)
  979. {
  980. if ((item as LoadPortModule) != null || (item as StockerModule) != null || (item as FIMSModule) != null || (item as CarrierRobotModule) != null)
  981. {
  982. if (CarrierManager.Instance.HasCarrier(item.Module.ToString()))
  983. {
  984. CarrierManager.Instance.DeleteCarrier(item.Module.ToString());
  985. var wafers = WaferManager.Instance.GetWafers(ModuleHelper.Converter(item.Module));
  986. for (int i = 0; i < wafers.Length; i++)
  987. {
  988. if (!wafers[i].IsEmpty)
  989. WaferManager.Instance.DeleteWafer(ModuleHelper.Converter(item.Module), i);
  990. }
  991. }
  992. }
  993. }
  994. return true;
  995. }
  996. private bool InvokeDeleteWaferFromTo(string arg1, object[] args)
  997. {
  998. ModuleName chamber = ModuleHelper.Converter(args[0].ToString());
  999. int slotFrom = (int)args[1];
  1000. int slotTo = (int)args[2];
  1001. for (int slot = slotTo - 1; slot >= slotFrom - 1; slot--)
  1002. {
  1003. if (WaferManager.Instance.IsWaferSlotLocationValid(chamber, slot))
  1004. {
  1005. if (WaferManager.Instance.CheckHasWafer(chamber, slot))
  1006. {
  1007. WaferManager.Instance.DeleteWafer(chamber, slot);
  1008. EV.PostMessage(ModuleName.System.ToString(), EventEnum.WaferDelete, chamber.ToString(), slot + 1);
  1009. }
  1010. else
  1011. {
  1012. EV.PostInfoLog("System", string.Format("No wafer at {0} {1}, delete not valid", chamber.ToString(), slot + 1));
  1013. }
  1014. }
  1015. else
  1016. {
  1017. DeleteWaferFailedWarning.Set(string.Format("Invalid position,{0},{1}", chamber.ToString(), slot.ToString()));
  1018. return false;
  1019. }
  1020. }
  1021. var carrier = CarrierManager.Instance.GetCarrier(chamber);
  1022. if (carrier != null)
  1023. {
  1024. CarrierManager.Instance.UpdateWaferIn(chamber, 0, false);
  1025. }
  1026. var wafers = WaferManager.Instance.GetWafers(chamber);
  1027. if (wafers != null && carrier != null)
  1028. {
  1029. foreach (var wafer in wafers)
  1030. {
  1031. if (wafer != null && !wafer.IsEmpty)
  1032. {
  1033. CarrierManager.Instance.UpdateWaferIn(chamber, 0, true);
  1034. break;
  1035. }
  1036. }
  1037. }
  1038. return true;
  1039. }
  1040. private bool InvokeDeleteWafer(string arg1, object[] args)
  1041. {
  1042. ModuleName chamber = ModuleHelper.Converter(args[0].ToString());
  1043. int slot = (int)args[1];
  1044. if (WaferManager.Instance.IsWaferSlotLocationValid(chamber, slot))
  1045. {
  1046. if (WaferManager.Instance.CheckHasWafer(chamber, slot))
  1047. {
  1048. WaferManager.Instance.DeleteWafer(chamber, slot);
  1049. EV.PostMessage(ModuleName.System.ToString(), EventEnum.WaferDelete, chamber.ToString(), slot + 1);
  1050. }
  1051. else
  1052. {
  1053. EV.PostInfoLog("System", string.Format("No wafer at {0} {1}, delete not valid", chamber.ToString(), slot + 1));
  1054. }
  1055. }
  1056. else
  1057. {
  1058. DeleteWaferFailedWarning.Set(string.Format("Invalid position,{0},{1}", chamber.ToString(), slot.ToString()));
  1059. return false;
  1060. }
  1061. var carrier = CarrierManager.Instance.GetCarrier(chamber);
  1062. if (carrier != null)
  1063. {
  1064. CarrierManager.Instance.UpdateWaferIn(chamber, 0, false);
  1065. }
  1066. var wafers = WaferManager.Instance.GetWafers(chamber);
  1067. if (wafers != null && carrier != null)
  1068. {
  1069. foreach (var wafer in wafers)
  1070. {
  1071. if (wafer != null && !wafer.IsEmpty)
  1072. {
  1073. CarrierManager.Instance.UpdateWaferIn(chamber, 0, true);
  1074. break;
  1075. }
  1076. }
  1077. }
  1078. return true;
  1079. }
  1080. private bool InvokeCreateWaferFromTo(string arg1, object[] args)
  1081. {
  1082. ModuleName chamber = ModuleHelper.Converter(args[0].ToString());
  1083. ModuleName originChamber = chamber;
  1084. int slotFrom = (int)args[1];
  1085. int slotTo = (int)args[2];
  1086. int originSlot = 1;
  1087. WaferStatus state = WaferStatus.Normal;
  1088. WaferType waferTye = WaferType.None;
  1089. var strs = (string[])args[3];
  1090. Enum.TryParse(strs[0].ToString(), out waferTye);
  1091. originChamber = ModuleHelper.Converter(strs[1].ToString());
  1092. originSlot = int.Parse(strs[2]);
  1093. for (int slot = slotTo - 1; slot >= slotFrom - 1; slot--)
  1094. {
  1095. if (WaferManager.Instance.IsWaferSlotLocationValid(chamber, slot))
  1096. {
  1097. if (WaferManager.Instance.CheckHasWafer(chamber, slot))
  1098. {
  1099. EV.PostInfoLog("System", string.Format("{0} slot {1} already has wafer.create wafer is not valid", chamber, slot + 1));
  1100. }
  1101. else
  1102. {
  1103. if (originChamber == chamber && WaferManager.Instance.CreateWafer(chamber, slot, state, waferTye) != null)
  1104. {
  1105. EV.PostMessage(ModuleName.System.ToString(), EventEnum.WaferCreate, chamber.ToString(), slot + 1, state.ToString());
  1106. }
  1107. else if (originChamber != chamber && WaferManager.Instance.CreateWafer(chamber, slot, originChamber, originSlot, state, waferTye) != null)
  1108. {
  1109. EV.PostMessage(ModuleName.System.ToString(), EventEnum.WaferCreate, chamber.ToString(), slot + 1, state.ToString());
  1110. }
  1111. }
  1112. }
  1113. else
  1114. {
  1115. EV.PostWarningLog("System", string.Format("Invalid position,{0},{1}", chamber.ToString(), slot.ToString()));
  1116. return false;
  1117. }
  1118. }
  1119. var carrier = CarrierManager.Instance.GetCarrier(chamber);
  1120. if (carrier != null)
  1121. {
  1122. CarrierManager.Instance.UpdateWaferIn(chamber, 0, true);
  1123. }
  1124. return true;
  1125. }
  1126. private bool InvokeCreateWafer(string arg1, object[] args)
  1127. {
  1128. ModuleName chamber = ModuleHelper.Converter(args[0].ToString());
  1129. ModuleName originChamber = chamber;
  1130. int slot = (int)args[1];
  1131. int originSlot = 1;
  1132. WaferStatus state = WaferStatus.Normal;
  1133. WaferType waferTye = WaferType.None;
  1134. if (args.Length > 2)
  1135. Enum.TryParse(args[2].ToString(), out waferTye);
  1136. if (args.Length > 3)
  1137. originChamber = ModuleHelper.Converter(args[3].ToString());
  1138. if (args.Length > 4)
  1139. originSlot = (int)args[4];
  1140. if (ModuleHelper.IsLoadPort(chamber))
  1141. {
  1142. //var lp = Modules[chamber] as LoadPortModule;
  1143. //if (lp.LPDevice.CassetteState != LoadportCassetteState.Normal)
  1144. //{
  1145. // EV.PostWarningLog("System", $"Can not create wafer at {chamber}.{slot + 1}, Cassette not placed.");
  1146. // return false;
  1147. //}
  1148. }
  1149. if (WaferManager.Instance.IsWaferSlotLocationValid(chamber, slot))
  1150. {
  1151. if (WaferManager.Instance.CheckHasWafer(chamber, slot))
  1152. {
  1153. EV.PostInfoLog("System", string.Format("{0} slot {1} already has wafer.create wafer is not valid", chamber, slot + 1));
  1154. }
  1155. else
  1156. {
  1157. if (originChamber == chamber && WaferManager.Instance.CreateWafer(chamber, slot, state, waferTye) != null)
  1158. {
  1159. EV.PostMessage(ModuleName.System.ToString(), EventEnum.WaferCreate, chamber.ToString(), slot + 1, state.ToString());
  1160. }
  1161. else if (originChamber != chamber && WaferManager.Instance.CreateWafer(chamber, slot, originChamber, originSlot, state, waferTye) != null)
  1162. {
  1163. EV.PostMessage(ModuleName.System.ToString(), EventEnum.WaferCreate, chamber.ToString(), slot + 1, state.ToString());
  1164. }
  1165. }
  1166. }
  1167. else
  1168. {
  1169. EV.PostWarningLog("System", string.Format("Invalid position,{0},{1}", chamber.ToString(), slot.ToString()));
  1170. return false;
  1171. }
  1172. var carrier = CarrierManager.Instance.GetCarrier(chamber);
  1173. if (carrier != null)
  1174. {
  1175. CarrierManager.Instance.UpdateWaferIn(chamber, 0, true);
  1176. }
  1177. return true;
  1178. }
  1179. private bool InvokeUpdateWafer(string arg1, params object[] args)
  1180. {
  1181. if (args == null || args.Length == 0) return false;
  1182. ModuleName chamber = ModuleHelper.Converter(args[0].ToString());
  1183. var carrier = CarrierManager.Instance.GetCarrier(chamber);
  1184. if (carrier == null || carrier.IsEmpty)
  1185. {
  1186. EV.PostInfoLog(Module, $"{chamber} update wafer fail for carrier not exist.");
  1187. return false;
  1188. }
  1189. if (args.Length > 3 && !carrier.CarrierType.ToString().Equals(CarrierType.None.ToString()) && !carrier.CarrierType.ToString().Equals(args[2].ToString()))
  1190. {
  1191. EV.PostInfoLog(Module, $"{chamber} type mismatch!");
  1192. return false;
  1193. }
  1194. int slot = 0;
  1195. if (args.Length > 1)
  1196. {
  1197. int.TryParse(args[1].ToString(), out slot);
  1198. slot = slot - 1;
  1199. }
  1200. WaferType waferTye = WaferType.None;
  1201. if (args.Length > 2)
  1202. {
  1203. Enum.TryParse(args[2].ToString(), out waferTye);
  1204. }
  1205. float useCount = 0, useThick = 0, UseTime = 0;
  1206. if (args.Length > 3)
  1207. {
  1208. float.TryParse(args[3].ToString(), out useCount);
  1209. }
  1210. if (args.Length > 4)
  1211. {
  1212. float.TryParse(args[4].ToString(), out useThick);
  1213. }
  1214. if (args.Length > 5)
  1215. {
  1216. float.TryParse(args[5].ToString(), out UseTime);
  1217. }
  1218. if (WaferManager.Instance.IsWaferSlotLocationValid(chamber, slot))
  1219. {
  1220. if (WaferManager.Instance.CheckHasWafer(chamber, slot))
  1221. {
  1222. WaferManager.Instance.UpdateWaferStatistics(chamber, slot, useCount, useThick, UseTime);
  1223. (Singleton<EquipmentManager>.Instance.Modules[ModuleName.PM1] as PMModule).UpdateSEDWafer(WaferManager.Instance.GetAllWafers());
  1224. }
  1225. }
  1226. if (carrier != null)
  1227. {
  1228. CarrierManager.Instance.UpdateWaferIn(chamber, 0, true);
  1229. }
  1230. return true;
  1231. }
  1232. private bool InvokeCreateCassetteWafer(string arg1, object[] args)
  1233. {
  1234. ModuleName chamber = ModuleHelper.Converter(args[0].ToString());
  1235. var carrier = CarrierManager.Instance.GetCarrier(chamber);
  1236. if (carrier == null || carrier.IsEmpty)
  1237. {
  1238. EV.PostInfoLog(Module, $"{chamber} create wafer fail for carrier not exist.");
  1239. return false;
  1240. }
  1241. if (args.Length > 3 && !carrier.CarrierType.ToString().Equals(CarrierType.None.ToString()) && !carrier.CarrierType.ToString().Equals(args[3].ToString()))
  1242. {
  1243. EV.PostInfoLog(Module, $"{chamber} type mismatch!");
  1244. return false;
  1245. }
  1246. int slotFrom = (int)args[1];
  1247. int slotTo = (int)args[2];
  1248. WaferStatus state = WaferStatus.Normal;
  1249. WaferType waferTye = WaferType.None;
  1250. if (args.Length > 3)
  1251. Enum.TryParse(args[3].ToString(), out waferTye);
  1252. for (int slot = slotTo - 1; slot >= slotFrom - 1; slot--)
  1253. {
  1254. if (WaferManager.Instance.IsWaferSlotLocationValid(chamber, slot))
  1255. {
  1256. if (WaferManager.Instance.CheckHasWafer(chamber, slot))
  1257. {
  1258. EV.PostInfoLog(Module, string.Format("{0} slot {1} already has wafer.", chamber, slot + 1));
  1259. continue;
  1260. }
  1261. else if (WaferManager.Instance.CreateWafer(chamber, slot, state, waferTye) == null)
  1262. {
  1263. CreateWaferFailedWarning.Set(string.Format($"Create slot {slot + 1} wafer failed."));
  1264. return false;
  1265. }
  1266. }
  1267. else
  1268. {
  1269. CreateWaferFailedWarning.Set(string.Format("Invalid slot,{0},{1}", chamber.ToString(), (slot + 1).ToString()));
  1270. return false;
  1271. }
  1272. }
  1273. if (carrier != null)
  1274. {
  1275. CarrierManager.Instance.UpdateWaferIn(chamber, 0, true);
  1276. }
  1277. EV.PostInfoLog(Module, $"Create wafer from {slotFrom} to {slotTo} successed.");
  1278. return true;
  1279. }
  1280. private bool InvokeDeleteCassetteWafer(string arg1, object[] args)
  1281. {
  1282. ModuleName chamber = ModuleHelper.Converter(args[0].ToString());
  1283. int slotFrom = (int)args[1];
  1284. int slotTo = (int)args[2];
  1285. if (WaferManager.Instance.IsWaferSlotLocationValid(chamber, slotFrom - 1) && WaferManager.Instance.IsWaferSlotLocationValid(chamber, slotTo - 1))
  1286. {
  1287. WaferManager.Instance.DeleteWafer(chamber, slotFrom - 1, slotTo - slotFrom + 1);
  1288. }
  1289. else
  1290. {
  1291. DeleteWaferFailedWarning.Set(string.Format($"Invalid slot,{chamber} slot from {slotFrom}, slot to {slotTo}"));
  1292. return false;
  1293. }
  1294. var carrier = CarrierManager.Instance.GetCarrier(chamber);
  1295. if (carrier != null)
  1296. {
  1297. CarrierManager.Instance.UpdateWaferIn(chamber, 0, false);
  1298. }
  1299. var wafers = WaferManager.Instance.GetWafers(chamber);
  1300. if (wafers != null && carrier != null)
  1301. {
  1302. foreach (var wafer in wafers)
  1303. {
  1304. if (wafer != null && !wafer.IsEmpty)
  1305. {
  1306. CarrierManager.Instance.UpdateWaferIn(chamber, 0, true);
  1307. break;
  1308. }
  1309. }
  1310. }
  1311. EV.PostInfoLog(Module, $"Delete wafer from {slotFrom} to {slotTo} successed.");
  1312. return true;
  1313. }
  1314. private CarrierType GetStockerType(string name)
  1315. {
  1316. var result = CarrierType.SD;
  1317. var scName = name.Contains("LP") ? $"{name}Type" : $"{name}WaferType";
  1318. string configType = SC.GetStringValue($"System.Stocker.{scName}");
  1319. if (string.IsNullOrEmpty(configType))
  1320. {
  1321. return result;
  1322. }
  1323. result = configType.StartsWith(CarrierType.P.ToString()) ? CarrierType.P : (CarrierType)Enum.Parse(typeof(CarrierType), configType);
  1324. return result;
  1325. }
  1326. public bool InvokeCreateCarrier(string arg1, object[] args)
  1327. {
  1328. ModuleName chamber = ModuleHelper.Converter(args[0].ToString());
  1329. int slot = (int)args[1];
  1330. CarrierType carrierTye = GetStockerType(chamber.ToString());
  1331. if (args.Length > 2)
  1332. {
  1333. var inputType = args[2].ToString();
  1334. if (!carrierTye.ToString().Equals(CarrierType.None.ToString()) && !carrierTye.ToString().Equals(inputType))
  1335. {
  1336. EV.PostInfoLog(Module, $"{chamber} type mismatch!");
  1337. return false;
  1338. }
  1339. Enum.TryParse(args[2].ToString(), out carrierTye);
  1340. }
  1341. if (CarrierManager.Instance.HasCarrier(args[0].ToString(), slot))
  1342. {
  1343. EV.PostInfoLog("System", $"{chamber} already has carrier.create is not valid");
  1344. }
  1345. else
  1346. {
  1347. CarrierManager.Instance.CreateCarrier(args[0].ToString(), carrierTye, args[0].ToString());
  1348. EV.PostInfoLog("System", $"{chamber} create carrier");
  1349. }
  1350. var wafers = WaferManager.Instance.GetWafers(chamber);
  1351. if (wafers != null)
  1352. {
  1353. foreach (var wafer in wafers)
  1354. {
  1355. if (wafer != null && !wafer.IsEmpty)
  1356. {
  1357. CarrierManager.Instance.UpdateWaferIn(chamber, 0, true);
  1358. break;
  1359. }
  1360. }
  1361. }
  1362. return true;
  1363. }
  1364. private bool InvokeDeleteCarrier(string arg1, object[] args)
  1365. {
  1366. ModuleName chamber = ModuleHelper.Converter(args[0].ToString());
  1367. if (CarrierManager.Instance.HasCarrier(chamber.ToString()))
  1368. {
  1369. CarrierManager.Instance.DeleteCarrier(chamber.ToString());
  1370. EV.PostInfoLog("System", $"Carrier deleted from {chamber}");
  1371. var wafers = WaferManager.Instance.GetWafers(chamber);
  1372. for (int i = 0; i < wafers.Length; i++)
  1373. {
  1374. if (!wafers[i].IsEmpty)
  1375. WaferManager.Instance.DeleteWafer(chamber, i);
  1376. }
  1377. }
  1378. else
  1379. {
  1380. EV.PostInfoLog("System", string.Format("No carrier at {0}, delete not valid", chamber.ToString()));
  1381. }
  1382. return true;
  1383. }
  1384. private bool InvokeSetLotID(string arg1, object[] args)
  1385. {
  1386. ModuleName chamber = ModuleHelper.Converter(args[0].ToString());
  1387. List<string> lotIdLst = new List<string>();
  1388. foreach (var module in Modules.Keys)
  1389. {
  1390. if ((Modules[module] as StockerModule) == null)
  1391. continue;
  1392. if (CarrierManager.Instance.HasCarrier(module.ToString()))
  1393. {
  1394. lotIdLst.Add(CarrierManager.Instance.GetCarrier(module.ToString()).CarrierId);
  1395. }
  1396. }
  1397. if (lotIdLst.Any(x => x == args[1].ToString()))
  1398. {
  1399. SetLotIDFailedWarning.Set($"Carrier ID={args[1]} of {chamber} is already exist");
  1400. return false;
  1401. }
  1402. if (CarrierManager.Instance.HasCarrier(chamber.ToString()))
  1403. {
  1404. CarrierManager.Instance.UpdateCarrierId(chamber.ToString(), args[1].ToString());
  1405. EV.PostInfoLog("System", $"Carrier {chamber} update carrier ID {args[1]}");
  1406. }
  1407. else
  1408. {
  1409. EV.PostInfoLog("System", string.Format("No carrier at {0}, update carrier ID not valid", chamber.ToString()));
  1410. }
  1411. return true;
  1412. }
  1413. private bool InvokeShutDown(string arg1, object[] arg2)
  1414. {
  1415. if (IsAlarm || IsIdle || IsInit)
  1416. {
  1417. EV.PostWarningLog(Module, $"System start shut down");
  1418. EV.PostKickoutMessage("ShutDown");
  1419. RtApplication.Instance.Terminate();
  1420. return true;
  1421. }
  1422. EV.PostWarningLog(Module, $"System in {StringFsmStatus} mode, can not shut down");
  1423. return false;
  1424. }
  1425. private void OnModuleError(string module)
  1426. {
  1427. if (FsmState == (int)RtState.AutoRunning)
  1428. {
  1429. ModuleName mod = ModuleHelper.Converter(module);
  1430. PostMsg(MSG.ModuleError, module);
  1431. }
  1432. }
  1433. public override void Monitor()
  1434. {
  1435. base.Monitor();
  1436. }
  1437. private bool CheckPWaferBatch(ModuleName module, string batch)
  1438. {
  1439. string stockerWaferType = batch == "A" ? "P1" : "P2";
  1440. return SC.GetStringValue($"System.Stocker.{module}WaferType") == stockerWaferType;
  1441. }
  1442. private bool CheckMWaferBatch(ModuleName module, string batch)
  1443. {
  1444. string stockerWaferType = batch == "A" ? "M1" : "M2";
  1445. return SC.GetStringValue($"System.Stocker.{module}WaferType") == stockerWaferType;
  1446. }
  1447. private bool CheckJobPause()
  1448. {
  1449. return _pauseTrig.R;
  1450. }
  1451. private bool CheckToPostJobMessage(int msg, params object[] args)
  1452. {
  1453. _cycledCount = 0;
  1454. //只有LoadProcessUnload和ChargeProcessDischarge有cycle模式
  1455. if (SC.GetValue<bool>("System.IsCycleMode") && (msg == (int)MSG.LoadProcessUnload || msg == (int)MSG.ChargeProcessDischarge))
  1456. {
  1457. lock (_locker)
  1458. {
  1459. _jobMSG = msg;
  1460. _jobParas = args;
  1461. }
  1462. }
  1463. else
  1464. {
  1465. lock (_locker)
  1466. {
  1467. _jobMSG = 0;
  1468. _jobParas = null;
  1469. }
  1470. }
  1471. return CheckToPostMessage(msg, args);
  1472. }
  1473. private bool OnCycleTimer()
  1474. {
  1475. fMonitorFAJob();
  1476. if (!SC.GetValue<bool>("System.IsSimulatorMode"))
  1477. {
  1478. //_plcConnectTrig.CLK = !(IoProviderManager.Instance.Providers[0] as AdsPlcAdapter).IsPlcConnected;
  1479. //if (_plcConnectTrig.R)
  1480. //{
  1481. // PLCDisconnectAlarm.Set();
  1482. //}
  1483. //if (_plcConnectTrig.T)
  1484. //{
  1485. // EV.ClearAlarmEvent(PLCDisconnectAlarm.Id);
  1486. // PLCDisconnectAlarm.Reset();
  1487. // PLCConnectRecoveryWarning.Set();
  1488. //}
  1489. }
  1490. _cassetteRobotModule.Monitor();
  1491. _waferRobotModule.Monitor();
  1492. _lp1Module.Monitor();
  1493. _lp2Module.Monitor();
  1494. _lp3Module.Monitor();
  1495. _lp4Module.Monitor();
  1496. _fims1Module.Monitor();
  1497. _fims2Module.Monitor();
  1498. _boatModule.Monitor();
  1499. foreach (var module in Modules.Keys)
  1500. {
  1501. if (!(Modules[module] is StockerModule))
  1502. continue;
  1503. Modules[module].Monitor();
  1504. }
  1505. return true;
  1506. }
  1507. public List<ProcessJobInfo> GetProcessJobInfo()
  1508. {
  1509. return _auto.LstProcessJobs;
  1510. }
  1511. public List<Tuple<string, string, List<int>>> GetProcessingStockers()
  1512. {
  1513. return _auto.GetProcessingStockers();
  1514. }
  1515. public List<Tuple<string, string, List<int>>> GetAllPJStockers()
  1516. {
  1517. return _auto.GetAllPJStockers();
  1518. }
  1519. public List<CarrierPara> GetTransferJobStockers()
  1520. {
  1521. return _transferJob.GetTransferJobStockers();
  1522. }
  1523. public void ResetTask(ModuleName module)
  1524. {
  1525. _auto.ResetTask(module);
  1526. _transferJob.ResetTask(module);
  1527. (_returnAll as ReturnAllWafer).ResetTask(module);
  1528. }
  1529. private void CoolingSkip()
  1530. {
  1531. _auto.CoolingSkip();
  1532. }
  1533. public void SetVisibility(CarrierInfo carrierInfo, bool setValue, string moduleName = null)
  1534. {
  1535. if (carrierInfo == null)
  1536. {
  1537. return;
  1538. }
  1539. carrierInfo.UIExitFoup = setValue;
  1540. carrierInfo.UICarrierColorVisibility = setValue;
  1541. carrierInfo.UICarrierStatusVisibility = setValue;
  1542. carrierInfo.UICarrierTypeVisibility = setValue;
  1543. carrierInfo.UICarrierWaferCountVisibility = setValue;
  1544. }
  1545. public void SetUIWaferCount(CarrierInfo carrierInfo, ModuleName name, out WaferInfo[] wafers)
  1546. {
  1547. wafers = WaferManager.Instance.GetWafers(name);
  1548. if (carrierInfo == null)
  1549. {
  1550. return;
  1551. }
  1552. var count = wafers == null ? 0 : wafers.Count(a => !a.IsEmpty);
  1553. carrierInfo.UICarrierWaferCount = $"({count})";
  1554. }
  1555. public string GetActivePjStatus()
  1556. {
  1557. return _auto.GetFirstPJStatus();
  1558. }
  1559. #region FA
  1560. private bool FsmFAJobCommand(object[] param)
  1561. {
  1562. switch ((string)param[0])
  1563. {
  1564. case "CreateProcessJob":
  1565. _auto.CreateProcessJob(out var pj, (Dictionary<string, object>)param[1]);
  1566. break;
  1567. case "CreateControlJob":
  1568. _auto.CreateControlJob((string)param[1], (List<string>)param[2], out var cj);
  1569. //_auto.StartJob((string)param[1]);
  1570. //CheckToPostMessage((int)MSG.StartJob, (string)param[1]);
  1571. break;
  1572. }
  1573. return true;
  1574. }
  1575. #endregion
  1576. }
  1577. }