TransporterPickUpFromRoutine.cs 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590
  1. using Aitex.Core.RT.Device;
  2. using Aitex.Core.RT.Log;
  3. using Aitex.Core.RT.Routine;
  4. using Aitex.Core.RT.SCCore;
  5. using Aitex.Core.Util;
  6. using MECF.Framework.Common.Beckhoff.Station;
  7. using MECF.Framework.Common.Equipment;
  8. using MECF.Framework.Common.Layout;
  9. using MECF.Framework.Common.Routine;
  10. using MECF.Framework.Common.Utilities;
  11. using MECF.Framework.Common.WaferHolder;
  12. using CyberX8_Core;
  13. using CyberX8_RT.Devices.AXIS;
  14. using CyberX8_RT.Devices.AXIS.CANOpen;
  15. using CyberX8_RT.Devices.Facilities;
  16. using CyberX8_RT.Devices.Loader;
  17. using CyberX8_RT.Devices.TransPorter;
  18. using CyberX8_RT.Modules.Loader;
  19. using System;
  20. using System.Collections.Generic;
  21. using System.Linq;
  22. using System.Text;
  23. using System.Threading.Tasks;
  24. using CyberX8_RT.Devices.Rinse;
  25. using CyberX8_RT.Devices.Metal;
  26. using Aitex.Core.Common;
  27. namespace CyberX8_RT.Modules.Transporter
  28. {
  29. public class TransporterPickUpFromRoutine : RoutineBase, IRoutine
  30. {
  31. private enum PickUpStep
  32. {
  33. CheckPreCondition,
  34. DropBlockLockoff,
  35. ElevatorGotoUp,
  36. ElevatorGotoUpWait,
  37. SafeMoveTo,
  38. CheckMoveToStatus,
  39. GantryPosition,
  40. GantryPoisitionWait,
  41. ElevatorPositionToCell,
  42. ElevatorPositionToCellWait,
  43. Delay,
  44. DropBlockLockOn,
  45. CalculateLiftupSpeed,
  46. PickupDelay,
  47. ElevatorPositionToUp,
  48. ElevatorPositionToUpWait,
  49. UpdateWaferShuttle,
  50. CheckWSPresent,
  51. //ReadBarcodeConfirm,
  52. End
  53. }
  54. #region 内部变量
  55. private string _cellName;
  56. private JetAxisBase _gantryAxis;
  57. private JetAxisBase _elevatorAxis;
  58. private JetAxisBase _loaderRotationAxis;
  59. private SystemFacilities _facilities;
  60. private TransporterConflictRoutine _conflictRoutine;
  61. private TransporterCommon _transporterCommon;
  62. private LoaderCommonDevice _loaderCommonDevice;
  63. ProcessLayoutCellItem _cellItem;
  64. private int _pickupTime;
  65. private int _pickupDelayTime;
  66. private int _velocity;
  67. private int _acceleration;
  68. private bool _bypassWaferHolderPresent;
  69. private int _pickMaxRetries = 2;
  70. #endregion
  71. /// <summary>
  72. /// 构造函数
  73. /// </summary>
  74. /// <param name="module"></param>
  75. public TransporterPickUpFromRoutine(string module) : base(module)
  76. {
  77. }
  78. /// <summary>
  79. /// 中止
  80. /// </summary>
  81. public void Abort()
  82. {
  83. Runner.Stop("Manual Abort");
  84. }
  85. /// <summary>
  86. /// 监控
  87. /// </summary>
  88. /// <returns></returns>
  89. public RState Monitor()
  90. {
  91. Runner.Run(PickUpStep.CheckPreCondition, CheckStartPreConfition, _delay_1ms)
  92. //1. 确认DropBlockLock是否off
  93. .Run(PickUpStep.DropBlockLockoff, DropBlockLockoff, _delay_1ms)
  94. //2. Elevator go to up
  95. .Run(PickUpStep.ElevatorGotoUp, ElevatorGotoUP, _delay_1ms)
  96. .WaitWithStopCondition(PickUpStep.ElevatorGotoUpWait, CheckElevatorPositionEndStatus, CheckElevatorPositionEndStatus)
  97. //3. other Transporter Safe Move
  98. .Run(PickUpStep.SafeMoveTo, SafeMoveTo, _delay_1ms)
  99. .WaitWithStopCondition(PickUpStep.CheckMoveToStatus, () => CommonFunction.CheckRoutineEndState(_conflictRoutine),
  100. CheckSafeMoveToStopStatus)
  101. //4. Gantry 移动到目标位置
  102. .Run(PickUpStep.GantryPosition, GantryPositionToCell, _delay_1ms)
  103. .WaitWithStopCondition(PickUpStep.GantryPoisitionWait, CheckGantryPositionStatus, CheckGantryPositionRunStop)
  104. //5. Elevator 移动至对应cell位
  105. .Run(PickUpStep.ElevatorPositionToCell, ElevatorPositionToCell, _delay_1ms)
  106. .WaitWithStopCondition(PickUpStep.ElevatorPositionToCellWait, CheckElevatorPositionEndStatus, CheckElevatorPositionStopStatus)
  107. .Delay(PickUpStep.Delay,500)
  108. //6. Drop Block Lock on,抓取WS
  109. .Run(PickUpStep.DropBlockLockOn, DropBlockLockon, _delay_1ms)
  110. //7. 确认Elevator lift speed
  111. .Run(PickUpStep.CalculateLiftupSpeed,CalculateLiftupSpeed,_delay_1ms)
  112. //8. Pickup delay
  113. .Delay(PickUpStep.PickupDelay,_pickupDelayTime * 1000)
  114. //9. Elevator goto Up
  115. .Run(PickUpStep.ElevatorPositionToUp, ElevatorGotoUP, 100)
  116. .WaitWithStopCondition(PickUpStep.ElevatorPositionToUpWait, CheckElevatorPositionEndStatus, CheckElevatorPositionStopStatus)
  117. //10. 确认Transporter的Wafer shuttle hold present信号为on
  118. .Wait(PickUpStep.CheckWSPresent, CheckWSPresent, _delay_2s)
  119. //11. Material Tracking Update
  120. .Run(PickUpStep.UpdateWaferShuttle, WaferShuttleTransfer,_delay_1ms)
  121. //12. Read Barcode 确认与Material Tracking的转移是否一致
  122. //.Run(PickUpStep.ReadBarcodeConfirm,ReadBarcode,_delay_1ms)
  123. .End(PickUpStep.End,NullFun,100);
  124. return Runner.Status;
  125. }
  126. /// <summary>
  127. /// 关闭DropBlockLock
  128. /// </summary>
  129. /// <returns></returns>
  130. private bool DropBlockLockoff()
  131. {
  132. if (_transporterCommon.TransporterData.Lock)
  133. {
  134. return _transporterCommon.UnlockOperation("", null);
  135. }
  136. return true;
  137. }
  138. /// <summary>
  139. /// 打开DropBlockLock
  140. /// </summary>
  141. /// <returns></returns>
  142. private bool DropBlockLockon()
  143. {
  144. if (!_transporterCommon.TransporterData.Lock)
  145. {
  146. return _transporterCommon.LockOperation("", null);
  147. }
  148. return true;
  149. }
  150. /// <summary>
  151. /// 安全避障移动
  152. /// </summary>
  153. /// <returns></returns>
  154. private bool SafeMoveTo()
  155. {
  156. _cellItem = ProcessLayoutManager.Instance.GetProcessLayoutCellItemByModuleName(_cellName);
  157. string stationName = _cellName;
  158. if (_cellItem != null)
  159. {
  160. if (_cellName.ToLower() != "loader" && _cellName.ToLower() != "park")
  161. {
  162. stationName = $"Cell{_cellItem.CellId}";
  163. }
  164. }
  165. else
  166. {
  167. NotifyError(eEvent.ERR_TRANSPORTER, $"{_cellName} not in layout", 0);
  168. return false;
  169. }
  170. var result = _gantryAxis.GetPositionByStation(stationName);
  171. if(result.success)
  172. {
  173. bool isPositive = false;
  174. if(_gantryAxis.MotionData.MotorPosition<result.position)
  175. {
  176. isPositive = true;
  177. }
  178. return _conflictRoutine.Start(result.position, isPositive) == RState.Running;
  179. }
  180. else
  181. {
  182. NotifyError(eEvent.ERR_TRANSPORTER, $"{_cellName} not in station list",0);
  183. return false;
  184. }
  185. }
  186. /// <summary>
  187. /// 检验安全避让异常结束状态
  188. /// </summary>
  189. /// <returns></returns>
  190. private bool CheckSafeMoveToStopStatus()
  191. {
  192. bool result = CommonFunction.CheckRoutineStopState(_conflictRoutine);
  193. if (result)
  194. {
  195. NotifyError(eEvent.ERR_TRANSPORTER, "Safe Move failed", 0);
  196. }
  197. return result;
  198. }
  199. /// <summary>
  200. /// Gantry Position To cell
  201. /// </summary>
  202. /// <returns></returns>
  203. private bool GantryPositionToCell()
  204. {
  205. _cellItem= ProcessLayoutManager.Instance.GetProcessLayoutCellItemByModuleName(_cellName);
  206. bool result = false;
  207. if (_cellItem != null)
  208. {
  209. if (_cellName.ToLower() != "loader"&&_cellName.ToLower()!="park")
  210. {
  211. result= _gantryAxis.PositionStation($"Cell{_cellItem.CellId}", false);
  212. }
  213. else
  214. {
  215. result= _gantryAxis.PositionStation(_cellName,false);
  216. }
  217. if (!result)
  218. {
  219. NotifyError(eEvent.ERR_TRANSPORTER, "gantry axis motion failed", 0);
  220. }
  221. return result;
  222. }
  223. else
  224. {
  225. NotifyError(eEvent.ERR_TRANSPORTER, $"{_cellName} not in layout", 0);
  226. return false;
  227. }
  228. }
  229. /// <summary>
  230. /// Elevator Position to cell
  231. /// </summary>
  232. /// <returns></returns>
  233. private bool ElevatorPositionToCell()
  234. {
  235. bool result = false;
  236. if( _cellItem != null )
  237. {
  238. if (_cellName.ToLower()!="loader")
  239. {
  240. result= _elevatorAxis.PositionStation($"Cell{_cellItem.CellId}", false);
  241. }
  242. else
  243. {
  244. result= _elevatorAxis.PositionStation(_cellName, false);
  245. }
  246. if (!result)
  247. {
  248. NotifyError(eEvent.ERR_TRANSPORTER, "elevator axis motion failed", 0);
  249. }
  250. return result;
  251. }
  252. else
  253. {
  254. NotifyError(eEvent.ERR_TRANSPORTER, $"{_cellName} not in layout",0);
  255. return false;
  256. }
  257. }
  258. /// <summary>
  259. /// 检验Vertical移动状态
  260. /// </summary>
  261. /// <returns></returns>
  262. private bool CheckElevatorPositionEndStatus()
  263. {
  264. return _elevatorAxis.Status == RState.End;
  265. }
  266. /// <summary>
  267. /// 检验Vertical是否还在运动
  268. /// </summary>
  269. /// <returns></returns>
  270. private bool CheckElevatorPositionStopStatus()
  271. {
  272. bool result = _elevatorAxis.Status == RState.Failed || _elevatorAxis.Status == RState.Timeout ;
  273. if (result)
  274. {
  275. NotifyError(eEvent.ERR_TRANSPORTER, "elevator axis motion failed",0);
  276. }
  277. return result;
  278. }
  279. /// <summary>
  280. /// 检验Gantry移动状态
  281. /// </summary>
  282. /// <returns></returns>
  283. private bool CheckGantryPositionStatus()
  284. {
  285. return _gantryAxis.Status == RState.End;
  286. }
  287. /// <summary>
  288. /// 检验Gantry是否还在运动
  289. /// </summary>
  290. /// <returns></returns>
  291. private bool CheckGantryPositionRunStop()
  292. {
  293. bool result= _gantryAxis.Status == RState.Failed||_gantryAxis.Status==RState.Timeout;
  294. if(result)
  295. {
  296. NotifyError(eEvent.ERR_TRANSPORTER, "Gantry Motion failed", 0);
  297. }
  298. return result;
  299. }
  300. /// <summary>
  301. /// 计算提升速度
  302. /// </summary>
  303. /// <returns></returns>
  304. private bool CalculateLiftupSpeed()
  305. {
  306. if(_pickupTime==0)
  307. {
  308. return true;
  309. }
  310. BeckhoffStationAxis stationAxis = BeckhoffStationLocationManager.Instance.GetStationAxis(Module, "Elevator", 0);
  311. Station upStation = stationAxis.Stations.Find(O => O.Name.EndsWith("UP"));
  312. Station cellStation = null;
  313. if (_cellName == "Loader")
  314. {
  315. cellStation = stationAxis.Stations.Find(O => O.Name.EndsWith("Loader"));
  316. }
  317. else
  318. {
  319. cellStation = stationAxis.Stations.Find(O => O.Name.EndsWith($"Cell{_cellItem.CellId}"));
  320. }
  321. if(upStation==null)
  322. {
  323. NotifyError(eEvent.ERR_TRANSPORTER, "UP is not in Station List",0);
  324. return false;
  325. }
  326. if(cellStation==null)
  327. {
  328. NotifyError(eEvent.ERR_TRANSPORTER, $"Cell{_cellItem.CellId} is not in Station List",0);
  329. return false;
  330. }
  331. if(!double.TryParse(cellStation.Position,out double cellStationPosition))
  332. {
  333. NotifyError(eEvent.ERR_TRANSPORTER, $"Cell{_cellItem.CellId} Station Position is invalid",0);
  334. return false;
  335. }
  336. if (!double.TryParse(upStation.Position, out double upStationPosition))
  337. {
  338. NotifyError(eEvent.ERR_TRANSPORTER, $"Cell{_cellItem.CellId} Station Position is invalid", 0);
  339. return false;
  340. }
  341. int distance =(int)Math.Round(Math.Abs(cellStationPosition - upStationPosition));
  342. double tmpVelocity = (double) distance/ _pickupTime;
  343. _velocity = _elevatorAxis.CalculateMultiplySpeedRatio(_elevatorAxis.CalculateValueMultiplyScale(tmpVelocity));
  344. double tmpAccelaration = (double)(2 * distance) / Math.Pow(_pickupTime, 2);
  345. _acceleration = _elevatorAxis.CalculateMultiplyAccelerationRatio(_elevatorAxis.CalculateValueMultiplyScale(tmpAccelaration));
  346. LOG.WriteBackgroundLog(eEvent.INFO_TRANSPORTER, Module, "adjust profile speed");
  347. return true;
  348. }
  349. /// <summary>
  350. /// Elevator运动至UP
  351. /// </summary>
  352. /// <returns></returns>
  353. private bool ElevatorGotoUP()
  354. {
  355. bool result= _elevatorAxis.PositionStation("UP", false, _velocity, _acceleration, _acceleration);
  356. if(!result)
  357. {
  358. NotifyError(eEvent.ERR_TRANSPORTER, "elevator goto up failed",0);
  359. }
  360. return result;
  361. }
  362. /// <summary>
  363. /// 更新WaferHolder移动信息
  364. /// </summary>
  365. /// <returns></returns>
  366. private bool WaferShuttleTransfer()
  367. {
  368. bool isMetal = false;
  369. DateTime lastMetalRecipeTime = DateTime.Now;
  370. if(Enum.TryParse(_cellName,out ModuleName moduleName)&&ModuleHelper.IsMetal(moduleName))
  371. {
  372. isMetal = true;
  373. WaferHolderInfo info = WaferHolderManager.Instance.GetWaferHolder(_cellName);
  374. if (info != null)
  375. {
  376. lastMetalRecipeTime = info.LastMetalRecipeCompleteTime;
  377. }
  378. }
  379. bool result= WaferHolderManager.Instance.TransferWaferHolder(Module,_cellName, Module);
  380. if (!result)
  381. {
  382. NotifyError(eEvent.ERR_TRANSPORTER, "tranfer waferHolder message failed", 0);
  383. }
  384. else
  385. {
  386. if (!Singleton<RouteManager>.Instance.IsAutoRunning)
  387. {
  388. return true;
  389. }
  390. WaferHolderInfo waferHolderInfo = WaferHolderManager.Instance.GetWaferHolder(Module);
  391. if (waferHolderInfo == null)
  392. {
  393. return true;
  394. }
  395. string strTime = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss");
  396. waferHolderInfo.SchedulerModules.Add($"{strTime} {_cellName} => {Module}");
  397. if (isMetal)
  398. {
  399. int waferShuttleSoakMaxTime = SC.GetValue<int>("Metal.WaferShuttleSoakMaxTime");
  400. double soakTime = Math.Round(DateTime.Now.Subtract(lastMetalRecipeTime).TotalMinutes,2);
  401. if (soakTime > waferShuttleSoakMaxTime)
  402. {
  403. LOG.WriteLog(eEvent.WARN_METAL, _cellName, $"time of {waferHolderInfo.Id} soak in metal is {soakTime} minute over {waferShuttleSoakMaxTime}");
  404. }
  405. else
  406. {
  407. LOG.WriteLog(eEvent.INFO_METAL, _cellName, $"time of {waferHolderInfo.Id} soak in metal is {soakTime} minute");
  408. }
  409. }
  410. }
  411. return result;
  412. }
  413. /// <summary>
  414. /// 检验WHPresent与Lock状态
  415. /// </summary>
  416. /// <returns></returns>
  417. private bool CheckWSPresent()
  418. {
  419. bool locked = _transporterCommon.TransporterData.Lock;
  420. bool whPresent= _transporterCommon.TransporterData.WSHoldPresent;
  421. bool result= locked && (whPresent||_bypassWaferHolderPresent);
  422. if (!result)
  423. {
  424. LOG.WriteLog(eEvent.INFO_TRANSPORTER, Module, "check wafer Shuttle present and locked failed");
  425. }
  426. return result;
  427. }
  428. /// <summary>
  429. /// 读取条码
  430. /// </summary>
  431. /// <returns></returns>
  432. private bool ReadBarcode()
  433. {
  434. string str=_transporterCommon.ReaderBarcode();
  435. str = str.Trim();
  436. if(!string.IsNullOrEmpty(str))
  437. {
  438. TransporterEntity transporterEntity = Singleton<RouteManager>.Instance.GetModule<TransporterEntity>(Module.ToString());
  439. if (transporterEntity == null)
  440. {
  441. return true;
  442. }
  443. WaferHolderInfo waferHolderInfo = transporterEntity.WaferHolderInfo;
  444. if (waferHolderInfo == null)
  445. {
  446. return true;
  447. }
  448. if (waferHolderInfo.Id == str)
  449. {
  450. return true;
  451. }
  452. WaferHolderManager.Instance.SwitchWaferHolderId(waferHolderInfo,Module,str);
  453. return true;
  454. }
  455. return true;
  456. }
  457. /// <summary>
  458. /// 启动
  459. /// </summary>
  460. /// <param name="objs"></param>
  461. /// <returns></returns>
  462. public RState Start(params object[] objs)
  463. {
  464. _cellName = objs[0].ToString();
  465. _elevatorAxis = DEVICE.GetDevice<JetAxisBase>($"{Module}.Elevator");;
  466. _gantryAxis = DEVICE.GetDevice<JetAxisBase>($"{Module}.Gantry");
  467. _loaderRotationAxis = DEVICE.GetDevice<JetAxisBase>($"{ModuleName.Loader1}.Rotation");
  468. _conflictRoutine = new TransporterConflictRoutine(Module);
  469. _transporterCommon = DEVICE.GetDevice<TransporterCommon>($"{Module}.Common");
  470. _loaderCommonDevice = DEVICE.GetDevice<LoaderCommonDevice>($"{ModuleName.Loader1}.Common");
  471. _bypassWaferHolderPresent = SC.GetValue<bool>("Transporter.BypassWaferHolderPresent");
  472. _velocity = 0;
  473. _acceleration = 0;
  474. _pickMaxRetries = SC.GetValue<int>("Transporter.MaxPickTries");
  475. string preConfig = SC.GetConfigPreContent(_cellName);
  476. if (SC.ContainsItem($"{preConfig}.PickTimeSeconds"))
  477. {
  478. _pickupTime = SC.GetValue<int>($"{preConfig}.PickTimeSeconds");
  479. }
  480. if (SC.ContainsItem($"{preConfig}.PickDelaySeconds"))
  481. {
  482. _pickupDelayTime = SC.GetValue<int>($"{preConfig}.PickDelaySeconds");
  483. }
  484. return Runner.Start(Module, $"PickUpFrom {_cellName}");
  485. }
  486. /// <summary>
  487. /// 启动校验条件
  488. /// </summary>
  489. /// <returns></returns>
  490. private bool CheckStartPreConfition()
  491. {
  492. //所有轴上电并Homed
  493. bool result = CheckPreCondition();
  494. if(!result)
  495. {
  496. return false;
  497. }
  498. //Transporter的Wafer shuttle hold present信号为off
  499. if (!_bypassWaferHolderPresent && _transporterCommon.TransporterData.WSHoldPresent)
  500. {
  501. NotifyError(eEvent.ERR_TRANSPORTER, $"{Module} WaferShuttleHoldPresent is on", -1);
  502. return false;
  503. }
  504. //Loader is Home
  505. if (ModuleHelper.IsInstalled(ModuleName.Loader1))
  506. {
  507. //Loader is Home
  508. LoaderEntity loaderEntity = Singleton<RouteManager>.Instance.GetModule<LoaderEntity>(ModuleName.Loader1.ToString());
  509. if (loaderEntity != null && !loaderEntity.IsHomed)
  510. {
  511. NotifyError(eEvent.ERR_TRANSPORTER, $"{ModuleName.Loader1} is not homed", -1);
  512. return false;
  513. }
  514. }
  515. //若目标Cell为Loader, 则Loader需在TRNA或TRANB位置且WaferShuttlePresent信号on
  516. if (_cellName == "Loader")
  517. {
  518. double loaderRotationPosition = _loaderRotationAxis.MotionData.MotorPosition;
  519. if (!_loaderRotationAxis.CheckPositionIsInStation(loaderRotationPosition, "TRNPA") &&
  520. !_loaderRotationAxis.CheckPositionIsInStation(loaderRotationPosition, "TRNPB"))
  521. {
  522. NotifyError(eEvent.ERR_TRANSPORTER, $"{ModuleName.Loader1} rotation axis {loaderRotationPosition} is not int TRNPA or TRNPB station",-1);
  523. return false;
  524. }
  525. if(!_loaderCommonDevice.CommonData.WaferHolderPresent)
  526. {
  527. NotifyError(eEvent.ERR_TRANSPORTER, $"{ModuleName.Loader1} WaferShuttlePresent is off", -1);
  528. return false;
  529. }
  530. }
  531. //Transporter没有WS信息
  532. if (WaferHolderManager.Instance.HasWaferHolder(Module))
  533. {
  534. NotifyError(eEvent.ERR_TRANSPORTER, $"{Module} already has wafer Shuttle", -1);
  535. return false;
  536. }
  537. //目标Cell应有WS信息
  538. if (!WaferHolderManager.Instance.HasWaferHolder(_cellName))
  539. {
  540. NotifyError(eEvent.ERR_TRANSPORTER, $"{_cellName} does not has wafer shuttle", -1);
  541. return false;
  542. }
  543. //检验Facilities
  544. //var faciltiesResult = _facilities.CheckCDA();
  545. //if (!faciltiesResult.result)
  546. //{
  547. // NotifyError(eEvent.ERR_TRANSPORTER, faciltiesResult.reason, -1);
  548. // return false;
  549. //}
  550. return true;
  551. }
  552. /// <summary>
  553. /// 检验前置条件
  554. /// </summary>
  555. /// <returns></returns>
  556. private bool CheckPreCondition()
  557. {
  558. if (!_gantryAxis.IsSwitchOn)
  559. {
  560. NotifyError(eEvent.ERR_TRANSPORTER, $"{Module} gantry axis is not switch on ", -1);
  561. return false;
  562. }
  563. if (!_gantryAxis.IsHomed)
  564. {
  565. NotifyError(eEvent.ERR_TRANSPORTER, $"{Module} gantry axis is not homed ",-1);
  566. return false;
  567. }
  568. if (!_elevatorAxis.IsSwitchOn)
  569. {
  570. NotifyError(eEvent.ERR_TRANSPORTER, $"{Module} elevator axis is not switch on ", -1);
  571. return false;
  572. }
  573. if (!_elevatorAxis.IsHomed)
  574. {
  575. NotifyError(eEvent.ERR_TRANSPORTER, $"{Module} elevator axis is not homed ",-1);
  576. return false;
  577. }
  578. return true;
  579. }
  580. }
  581. }