JetEfemRobot.cs 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Xml;
  4. using Aitex.Core.RT.DataCenter;
  5. using Aitex.Core.RT.Device;
  6. using Aitex.Core.RT.Event;
  7. using Aitex.Core.RT.Log;
  8. using Aitex.Core.RT.SCCore;
  9. using Aitex.Sorter.Common;
  10. using MECF.Framework.Common.CommonData;
  11. using MECF.Framework.Common.Equipment;
  12. using MECF.Framework.Common.SubstrateTrackings;
  13. using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Efems.Rorzes;
  14. using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Robots;
  15. using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Robots.RobotBase;
  16. namespace JetEfemLib.Efems
  17. {
  18. public class JetEfemRobot : RobotBaseDevice, IEfemRobotCallback
  19. {
  20. private ModuleName _module;
  21. private string _efemName;
  22. private IRorzeEfemController _efem;
  23. public string Address { get; }
  24. public bool IsConnected { get; }
  25. public string EFEMGripStateBlade1
  26. {
  27. get;
  28. set;
  29. }
  30. public string EFEMGripStateBlade2
  31. {
  32. get;
  33. set;
  34. }
  35. //EfemRobotHomeRoutine _homeRoutine;
  36. public JetEfemRobot(string module, XmlElement node, string ioModule = "") : base("EfemRobot", "EfemRobot")
  37. {
  38. var attrModule = node.GetAttribute("module");
  39. base.Module = string.IsNullOrEmpty(attrModule) ? module : attrModule;
  40. base.Name = node.GetAttribute("id");
  41. _efemName = node.GetAttribute("efem");
  42. _module = ModuleHelper.Converter(Module);
  43. }
  44. public JetEfemRobot(string module, string name, string efemName) : base("EfemRobot", "EfemRobot")
  45. {
  46. _efemName = efemName;
  47. _module = ModuleHelper.Converter(module);
  48. }
  49. public bool Connect()
  50. {
  51. return true;
  52. }
  53. public bool Disconnect()
  54. {
  55. return true;
  56. }
  57. protected override bool Init()
  58. {
  59. if (_efem == null && !string.IsNullOrEmpty(_efemName))
  60. {
  61. _efem = DEVICE.GetDevice<RorzeEfem>(_efemName);
  62. _efem.SetRobotCallback(ModuleHelper.Converter(Module), this);
  63. }
  64. RorzeEfemHandler.ParameterModuleMap = new Dictionary<string, ModuleName>()
  65. {
  66. {"SYSTEM", ModuleName.System},
  67. {"System", ModuleName.System},
  68. {"ROB", ModuleName.EfemRobot},
  69. {"P1", ModuleName.LP1},
  70. {"P2", ModuleName.LP2},
  71. {"P3", ModuleName.LP3},
  72. {"P4", ModuleName.LP4},
  73. {"LLA", ModuleName.LLA},
  74. {"LLB", ModuleName.LLB},
  75. //{"BF1", ModuleName.Buffer},
  76. //{"ALIGN", ModuleName.Aligner},
  77. {"ALIGN3", ModuleName.Aligner1},
  78. {"ALIGN4", ModuleName.Aligner2},
  79. {"ALIGN", ModuleName.Cooling1},
  80. {"ALIGN2", ModuleName.Cooling2},
  81. };
  82. DATA.Subscribe($"{Module}1.WaferSize", () => WaferManager.Instance.GetWaferSize(_module, 0).ToString());
  83. DATA.Subscribe($"{Module}2.WaferSize", () => WaferManager.Instance.GetWaferSize(_module, 1).ToString());
  84. DATA.Subscribe("EfemRobot.GripStateBlade1", () => EFEMGripStateBlade1);
  85. DATA.Subscribe("EfemRobot.GripStateBlade2", () => EFEMGripStateBlade2);
  86. IsOnline = true;
  87. return true;
  88. }
  89. protected override bool fClear(object[] param)
  90. {
  91. return true;
  92. }
  93. protected override bool fStartReadData(object[] param)
  94. {
  95. ModuleName tempmodule = (ModuleName)Enum.Parse(typeof(ModuleName), param[0].ToString());
  96. _efem.QueryMapResult(tempmodule.ToString(), out string reason);
  97. return true;
  98. }
  99. protected override bool fStartSetParameters(object[] param)
  100. {
  101. return true;
  102. }
  103. protected override bool fStartTransferWafer(object[] param)
  104. {
  105. return true;
  106. }
  107. protected override bool fStartUnGrip(object[] param)
  108. {
  109. RobotArmEnum arm = (RobotArmEnum)param[0];
  110. if (!_efem.RobotGrip((Hand)(int)arm, false, out string reason))
  111. {
  112. EV.PostAlarmLog(Module, $"EFEMRobot can not UnGrip " + reason);
  113. return false;
  114. }
  115. if (arm == RobotArmEnum.Lower)
  116. {
  117. EFEMGripStateBlade1 = "OFF";
  118. }
  119. if (arm == RobotArmEnum.Upper)
  120. {
  121. EFEMGripStateBlade2 = "OFF";
  122. }
  123. return true;
  124. }
  125. protected override bool fStartGrip(object[] param)
  126. {
  127. RobotArmEnum arm = (RobotArmEnum)param[0];
  128. if (!_efem.RobotGrip((Hand)(int)arm , true , out string reason))
  129. {
  130. EV.PostAlarmLog(Module, $"EFEMRobot can not Grip " + reason);
  131. return false;
  132. }
  133. if(arm== RobotArmEnum.Lower)
  134. {
  135. EFEMGripStateBlade1 = "ON";
  136. }
  137. if (arm == RobotArmEnum.Upper)
  138. {
  139. EFEMGripStateBlade2 = "ON";
  140. }
  141. return true;
  142. }
  143. protected override bool fStartGoTo(object[] param)
  144. {
  145. RobotArmEnum arm = (RobotArmEnum)param[0];
  146. ModuleName module = (ModuleName)Enum.Parse(typeof(ModuleName), param[1].ToString());
  147. int slot = int.Parse(param[2].ToString());
  148. if (WaferManager.Instance.CheckHasWafer(ModuleName.EfemRobot, arm == RobotArmEnum.Lower ? 0 : 1))
  149. {
  150. if (!_efem.MoveToReadyPut(module, slot, arm == RobotArmEnum.Lower ? Hand.Blade1 : Hand.Blade2, out string reason))
  151. {
  152. EV.PostAlarmLog(Module, $"Can not move to {module} slot {slot + 1}, " + reason);
  153. return false;
  154. }
  155. }
  156. else
  157. {
  158. if (!_efem.MoveToReadyGet(module, slot, arm == RobotArmEnum.Lower ? Hand.Blade1 : Hand.Blade2, out string reason))
  159. {
  160. EV.PostAlarmLog(Module, $"Can not move to {module} slot {slot + 1}, " + reason);
  161. return false;
  162. }
  163. }
  164. CmdRobotArm = arm;
  165. CmdTarget = module;
  166. CmdTargetSlot = slot;
  167. MoveInfo = new RobotMoveInfo()
  168. {
  169. Action = RobotAction.Moving,
  170. ArmTarget = CmdRobotArm == RobotArmEnum.Lower ? RobotArm.ArmA : RobotArm.ArmB,
  171. BladeTarget = BuildBladeTarget(),
  172. };
  173. return true;
  174. }
  175. protected override bool fGoToComplete(object[] param)
  176. {
  177. MoveInfo = new RobotMoveInfo()
  178. {
  179. Action = RobotAction.Moving,
  180. ArmTarget = CmdRobotArm == RobotArmEnum.Lower ? RobotArm.ArmA : RobotArm.ArmB,
  181. BladeTarget = BuildBladeTarget(),
  182. };
  183. return base.fGoToComplete(param);
  184. }
  185. protected override bool fStartMapWafer(object[] param)
  186. {
  187. ModuleName tempmodule = (ModuleName)Enum.Parse(typeof(ModuleName), param[0].ToString());
  188. int thicknessIndex = int.Parse(param[1].ToString());
  189. CmdRobotArm = RobotArmEnum.Lower;
  190. CmdTarget = tempmodule;
  191. CmdTargetSlot = 0;
  192. MoveInfo = new RobotMoveInfo()
  193. {
  194. Action = RobotAction.Moving,
  195. ArmTarget = CmdRobotArm == RobotArmEnum.Lower ? RobotArm.ArmA : RobotArm.ArmB,
  196. BladeTarget = BuildBladeTarget(),
  197. };
  198. RorzeEfem efem = _efem as RorzeEfem;
  199. efem.MapCarrier(tempmodule.ToString(), out string _, out string reason);
  200. return true;
  201. }
  202. protected override bool fMapComplete(object[] param)
  203. {
  204. MoveInfo = new RobotMoveInfo()
  205. {
  206. Action = RobotAction.Moving,
  207. ArmTarget = CmdRobotArm == RobotArmEnum.Lower ? RobotArm.ArmA : RobotArm.ArmB,
  208. BladeTarget = BuildBladeTarget(),
  209. };
  210. return base.fMapComplete(param);
  211. }
  212. protected override bool fStartSwapWafer(object[] param)
  213. {
  214. return true;
  215. }
  216. private static Dictionary<ModuleName, ModuleName> _mapLL = new Dictionary<ModuleName, ModuleName>()
  217. {
  218. {ModuleName.LLA, ModuleName.LLB},
  219. {ModuleName.LLB, ModuleName.LLA }
  220. };
  221. private static Dictionary<int, int> _slotToFloor = new Dictionary<int, int>() {
  222. {0,0 },
  223. {2,1 },
  224. {4,2 },
  225. {6,3 }
  226. };
  227. protected override bool fStartPlaceWafer(object[] param)
  228. {
  229. RobotArmEnum arm = (RobotArmEnum)param[0];
  230. ModuleName module = (ModuleName)Enum.Parse(typeof(ModuleName), param[1].ToString());
  231. int slot = ((int[])param[2])[0];//int.Parse(param[2].ToString());
  232. if (!CheckEnablePlace(module, slot, arm, out string reason))
  233. {
  234. EV.PostAlarmLog(Module, $"Can not place wafer to {module} slot {slot + 1}, " + reason);
  235. return false;
  236. }
  237. CmdRobotArm = arm;
  238. CmdTarget = module;
  239. CmdTargetSlot = slot;
  240. if (SC.IsDoubleFork)
  241. {
  242. if (ModuleHelper.IsLoadLock(module))
  243. {
  244. module = ModuleName.LLA;
  245. if ((slot % 2) > 0)
  246. {
  247. module = ModuleName.LLB;
  248. slot = slot - 1;
  249. }
  250. slot = _slotToFloor[slot];
  251. if ((ModuleName)Enum.Parse(typeof(ModuleName), param[1].ToString()) == ModuleName.LLB) slot = slot + 4;
  252. }
  253. }
  254. if (!_efem.PutWafer(module, slot, (Hand)(int)arm, out reason))
  255. {
  256. EV.PostAlarmLog(Module, $"Can not place wafer to {module} slot {slot + 1}, " + reason);
  257. return false;
  258. }
  259. MoveInfo = new RobotMoveInfo()
  260. {
  261. Action = RobotAction.Placing,
  262. ArmTarget = CmdRobotArm == RobotArmEnum.Lower ? RobotArm.ArmA : RobotArm.ArmB,
  263. BladeTarget = BuildBladeTarget(),
  264. };
  265. return true;
  266. }
  267. private bool CheckEnablePlace(ModuleName module, int slot, RobotArmEnum arm, out string reason)
  268. {
  269. if (arm == RobotArmEnum.Both)
  270. {
  271. if (!WaferManager.Instance.CheckNoWafer(module, slot) && !WaferManager.Instance.CheckNoWafer(module, slot + 1))
  272. {
  273. reason = "target has wafer";
  274. return false;
  275. }
  276. if (!WaferManager.Instance.CheckHasWafer(ModuleName.EfemRobot, 0) && !WaferManager.Instance.CheckHasWafer(ModuleName.EfemRobot, 1))
  277. {
  278. reason = "robot arm has no wafer";
  279. return false;
  280. }
  281. }
  282. else
  283. {
  284. if (!WaferManager.Instance.CheckNoWafer(module, slot))
  285. {
  286. reason = "target has wafer";
  287. return false;
  288. }
  289. if (!WaferManager.Instance.CheckHasWafer(ModuleName.EfemRobot, (int)arm))
  290. {
  291. reason = "robot arm has no wafer";
  292. return false;
  293. }
  294. }
  295. reason = string.Empty;
  296. return true;
  297. }
  298. protected override bool fPlaceComplete(object[] param)
  299. {
  300. if (CmdRobotArm == RobotArmEnum.Both)
  301. {
  302. WaferManager.Instance.WaferMoved(ModuleHelper.Converter(Module), (int)Hand.Blade1, CmdTarget, CmdTargetSlot);
  303. WaferManager.Instance.WaferMoved(ModuleHelper.Converter(Module), (int)Hand.Blade2, CmdTarget, CmdTargetSlot + 1);
  304. }
  305. else
  306. {
  307. WaferManager.Instance.WaferMoved(ModuleHelper.Converter(Module), (int)CmdRobotArm, CmdTarget, CmdTargetSlot);
  308. }
  309. MoveInfo = new RobotMoveInfo()
  310. {
  311. Action = RobotAction.Moving,
  312. ArmTarget = CmdRobotArm == RobotArmEnum.Lower ? RobotArm.ArmA : RobotArm.ArmB,
  313. BladeTarget = BuildBladeTarget(),
  314. };
  315. return base.fPlaceComplete(param);
  316. }
  317. private string BuildBladeTarget()
  318. {
  319. return (CmdRobotArm == RobotArmEnum.Upper ? "ArmB" : "ArmA") + "." + CmdTarget;
  320. }
  321. protected override bool fStartPickWafer(object[] param)
  322. {
  323. RobotArmEnum arm = (RobotArmEnum)param[0];
  324. ModuleName module = (ModuleName)Enum.Parse(typeof(ModuleName), param[1].ToString());
  325. int slot = ((int[])param[2])[0];//int.Parse(param[2].ToString());
  326. if (!CheckEnablePick(module, slot, arm, out string reason))
  327. {
  328. EV.PostAlarmLog(Module, $"Can not pick wafer from {module} slot {slot + 1}, " + reason);
  329. return false;
  330. }
  331. CmdRobotArm = arm;
  332. CmdTarget = module;
  333. CmdTargetSlot = slot;
  334. if (SC.IsDoubleFork)
  335. {
  336. if (ModuleHelper.IsLoadLock(module))
  337. {
  338. module = ModuleName.LLA;
  339. if ((slot % 2) > 0)
  340. {
  341. module = ModuleName.LLB;
  342. slot = slot - 1;
  343. }
  344. slot = _slotToFloor[slot];
  345. if ((ModuleName)Enum.Parse(typeof(ModuleName), param[1].ToString()) == ModuleName.LLB) slot = slot + 4;
  346. }
  347. }
  348. if (!_efem.GetWafer(module, slot, (Hand)(int)arm, out reason))
  349. {
  350. EV.PostAlarmLog(Module, $"Can not pick wafer from {module} slot {slot + 1}, " + reason);
  351. return false;
  352. }
  353. MoveInfo = new RobotMoveInfo()
  354. {
  355. Action = RobotAction.Picking,
  356. ArmTarget = CmdRobotArm == RobotArmEnum.Lower ? RobotArm.ArmA : RobotArm.ArmB,
  357. BladeTarget = BuildBladeTarget(),
  358. };
  359. return true;
  360. }
  361. private bool CheckEnablePick(ModuleName module, int slot, RobotArmEnum arm, out string reason)
  362. {
  363. if (arm == RobotArmEnum.Both)
  364. {
  365. if (!WaferManager.Instance.CheckHasWafer(module, slot) && !WaferManager.Instance.CheckHasWafer(module, slot + 1))
  366. {
  367. reason = "source has no wafer";
  368. return false;
  369. }
  370. if (!WaferManager.Instance.CheckNoWafer(ModuleName.EfemRobot, 0) && !WaferManager.Instance.CheckNoWafer(ModuleName.EfemRobot, 1))
  371. {
  372. reason = "robot arm has wafer";
  373. return false;
  374. }
  375. }
  376. else
  377. {
  378. if (!WaferManager.Instance.CheckHasWafer(module, slot))
  379. {
  380. reason = "source has no wafer";
  381. return false;
  382. }
  383. if (!WaferManager.Instance.CheckNoWafer(ModuleName.EfemRobot, (int)arm))
  384. {
  385. reason = "robot arm has wafer";
  386. return false;
  387. }
  388. }
  389. reason = string.Empty;
  390. return true;
  391. }
  392. protected override bool fPickComplete(object[] param)
  393. {
  394. if (CmdRobotArm == RobotArmEnum.Both)
  395. {
  396. WaferManager.Instance.WaferMoved(CmdTarget, CmdTargetSlot, ModuleHelper.Converter(Module), (int)Hand.Blade1);
  397. WaferManager.Instance.WaferMoved(CmdTarget, CmdTargetSlot + 1, ModuleHelper.Converter(Module), (int)Hand.Blade2);
  398. }
  399. else
  400. {
  401. WaferManager.Instance.WaferMoved(CmdTarget, CmdTargetSlot, ModuleHelper.Converter(Module), (int)CmdRobotArm);
  402. }
  403. MoveInfo = new RobotMoveInfo()
  404. {
  405. Action = RobotAction.Moving,
  406. ArmTarget = CmdRobotArm == RobotArmEnum.Lower ? RobotArm.ArmA : RobotArm.ArmB,
  407. BladeTarget = BuildBladeTarget(),
  408. };
  409. return base.fPickComplete(param);
  410. }
  411. protected override bool fResetToReady(object[] param)
  412. {
  413. return true;
  414. }
  415. protected override bool fReset(object[] param)
  416. {
  417. return true;
  418. }
  419. #region Init/Home
  420. public bool Home(out string reason)
  421. {
  422. if (!CheckToPostMessage((int)RobotMsg.StartInit))
  423. {
  424. reason = $"Can not home at {(RobotStateEnum)fsm.State} state";
  425. return false;
  426. }
  427. reason = string.Empty;
  428. return true;
  429. }
  430. protected override bool fStartInit(object[] param)
  431. {
  432. CmdRobotArm = RobotArmEnum.Lower;
  433. CmdTarget = ModuleName.System;
  434. CmdTargetSlot = 0;
  435. MoveInfo = new RobotMoveInfo()
  436. {
  437. Action = RobotAction.Retracting,
  438. ArmTarget = CmdRobotArm == RobotArmEnum.Lower ? RobotArm.ArmA : RobotArm.ArmB,
  439. BladeTarget = BuildBladeTarget(),
  440. };
  441. return true;
  442. }
  443. protected override bool fInitComplete(object[] param)
  444. {
  445. return base.fInitComplete(param);
  446. }
  447. protected override bool fMonitorInit(object[] param)
  448. {
  449. IsBusy = false;
  450. return true;
  451. }
  452. protected override bool fMonitorReadData(object[] param)
  453. {
  454. return base.fMonitorReadData(param);
  455. }
  456. #endregion
  457. public override bool HomeAllAxes(out string reason)
  458. {
  459. if (!_efem.HomeAllAxes(out reason))
  460. return false;
  461. IsBusy = true;
  462. return true;
  463. }
  464. protected override bool fError(object[] param)
  465. {
  466. string errorInfo = param[0].ToString();
  467. if (param.Length > 0)
  468. EV.PostAlarmLog(Module, errorInfo);
  469. if (fsm.State == (int)RobotStateEnum.Initializing)
  470. {
  471. }
  472. else if (fsm.State == (int)RobotStateEnum.Picking)
  473. {
  474. if(ModuleHelper.IsEfemRobot(Module) || ModuleHelper.IsEfem(ModuleHelper.Converter(Module)))
  475. EV.PostAlarmLog(ModuleName.EFEM.ToString(), errorInfo);
  476. bool waferGot = errorInfo.Contains("|WAFER");
  477. if (waferGot)
  478. {
  479. if (CmdRobotArm == RobotArmEnum.Both)
  480. {
  481. WaferManager.Instance.WaferMoved(CmdTarget, CmdTargetSlot, ModuleHelper.Converter(Module), (int)Hand.Blade1);
  482. WaferManager.Instance.WaferMoved(CmdTarget, CmdTargetSlot + 1, ModuleHelper.Converter(Module), (int)Hand.Blade2);
  483. }
  484. else
  485. {
  486. WaferManager.Instance.WaferMoved(CmdTarget, CmdTargetSlot, ModuleHelper.Converter(Module), (int)CmdRobotArm);
  487. }
  488. }
  489. }
  490. else if (fsm.State == (int)RobotStateEnum.Placing)
  491. {
  492. if (ModuleHelper.IsEfemRobot(Module) || ModuleHelper.IsEfem(ModuleHelper.Converter(Module)))
  493. EV.PostAlarmLog(ModuleName.EFEM.ToString(), errorInfo);
  494. bool waferPut = errorInfo.Contains("|NONWAF");
  495. if (waferPut)
  496. {
  497. if (CmdRobotArm == RobotArmEnum.Both)
  498. {
  499. WaferManager.Instance.WaferMoved(ModuleHelper.Converter(Module), (int)Hand.Blade1, CmdTarget, CmdTargetSlot);
  500. WaferManager.Instance.WaferMoved(ModuleHelper.Converter(Module), (int)Hand.Blade2, CmdTarget, CmdTargetSlot + 1);
  501. }
  502. else
  503. {
  504. WaferManager.Instance.WaferMoved(ModuleHelper.Converter(Module), (int)CmdRobotArm, CmdTarget, CmdTargetSlot);
  505. }
  506. }
  507. }
  508. MoveInfo = new RobotMoveInfo()
  509. {
  510. Action = RobotAction.Moving,
  511. ArmTarget = CmdRobotArm == RobotArmEnum.Lower ? RobotArm.ArmA : RobotArm.ArmB,
  512. BladeTarget = BuildBladeTarget(),
  513. };
  514. return true;
  515. }
  516. protected override bool fStartExtendForPick(object[] param)
  517. {
  518. return true;
  519. }
  520. protected override bool fStartExtendForPlace(object[] param)
  521. {
  522. return true;
  523. }
  524. protected override bool fStartRetractFromPick(object[] param)
  525. {
  526. return true;
  527. }
  528. protected override bool fStartRetractFromPlace(object[] param)
  529. {
  530. return true;
  531. }
  532. public override RobotArmWaferStateEnum GetWaferState(RobotArmEnum arm)
  533. {
  534. return RobotArmWaferStateEnum.Unknown;
  535. }
  536. public bool Pick(ModuleName target, Hand blade, int targetSlot, out string reason)
  537. {
  538. reason = string.Empty;
  539. return base.Pick((RobotArmEnum)(int)blade, target.ToString(), new int[] { targetSlot });
  540. }
  541. public bool Place(ModuleName target, Hand blade, int targetSlot, out string reason)
  542. {
  543. reason = string.Empty;
  544. return base.Place((RobotArmEnum)(int)blade, target.ToString(), new int[] { targetSlot });
  545. }
  546. public bool PickAndPlace(ModuleName pickTarget, Hand pickHand, int pickSlot, ModuleName placeTarget, Hand placeHand,
  547. int placeSlot, out string reason)
  548. {
  549. reason = string.Empty;
  550. return false;
  551. }
  552. public bool Goto(ModuleName target, Hand blade, int targetSlot, out string reason)
  553. {
  554. reason = string.Empty;
  555. return base.GoTo((RobotArmEnum)(int)blade, target.ToString(), targetSlot, RobotPostionEnum.PickReady);
  556. }
  557. public bool Map(ModuleName target, int thicknessIndex, out string reason)
  558. {
  559. reason = string.Empty;
  560. return base.WaferMapping(target, thicknessIndex);
  561. }
  562. public void NoteFailed(string error)
  563. {
  564. IsBusy = false;
  565. PostMsg(RobotMsg.ERROR, error);
  566. }
  567. public void NoteComplete()
  568. {
  569. if (fsm.State == (int)RobotStateEnum.Initializing)
  570. {
  571. IsBusy = false;
  572. return;
  573. }
  574. if (fsm.State == (int)RobotStateEnum.Mapping)
  575. {
  576. IsBusy = false;
  577. PostMsg(RobotMsg.ReadData, CmdTarget);
  578. }
  579. else
  580. {
  581. IsBusy = false;
  582. PostMsg(RobotMsg.ActionDone);
  583. }
  584. }
  585. public void NoteCancel(string error)
  586. {
  587. if (fsm.State == (int)RobotStateEnum.Initializing)
  588. {
  589. PostMsg(RobotMsg.ERROR, error);
  590. IsBusy = false;
  591. return;
  592. }
  593. IsBusy = false;
  594. PostMsg(RobotMsg.ERROR, error);
  595. }
  596. }
  597. }