StateTask.cs 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. using Aitex.Core.RT.Device;
  2. using Aitex.Core.RT.Device.Unit;
  3. using Aitex.Sorter.Common;
  4. using Efem;
  5. using MECF.Framework.Common.Equipment;
  6. using MECF.Framework.Common.SubstrateTrackings;
  7. using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.LoadPorts;
  8. using System;
  9. namespace EFEM.RT.Tasks
  10. {
  11. public class QueryStateTask : CheckImp, ITask
  12. {
  13. public QueryStateTask()
  14. {
  15. }
  16. public bool Execute(out string result, params string[] args)
  17. {
  18. string device = DeviceName.System;
  19. if (!(args[0] == "VER" || args[0] == "TRACK"))
  20. {
  21. result = PARAM_NG;
  22. return false;
  23. }
  24. if (!Check<NoReadyPolicy>(device, out result))
  25. {
  26. return false;
  27. }
  28. if (!Check<MaintenancePolicy>(device, out result))
  29. {
  30. return false;
  31. }
  32. ///todo
  33. return true;
  34. }
  35. public bool? Monitor(out string result, params string[] args)
  36. {
  37. result = string.Empty;
  38. if(args.Length < 1)
  39. {
  40. return false;
  41. }
  42. if(args[0] == "VER")
  43. {
  44. string version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();
  45. DateTime now = DateTime.Now;
  46. result = string.Format("{0}({1}-{2}-{3})", version, now.Year, now.Month, now.Day);
  47. return true;
  48. }
  49. else if(args[0] == "TRACK")
  50. {
  51. //000/111 upperArmWafer, lowerArmWafer, alignerWafer coolingwafer
  52. result += (WaferManager.Instance.CheckHasWafer(ModuleName.Robot, 1) ? "1" : "0");
  53. result += (WaferManager.Instance.CheckHasWafer(ModuleName.Robot, 0) ? "1" : "0");
  54. result += (WaferManager.Instance.CheckHasWafer(ModuleName.Aligner1, 0) ? "1" : "0");
  55. result += (WaferManager.Instance.CheckHasWafer(ModuleName.Aligner2, 0) ? "1" : "0");
  56. result += (WaferManager.Instance.CheckHasWafer(ModuleName.CoolingBuffer1, 0) ? "1" : "0");
  57. result += (WaferManager.Instance.CheckHasWafer(ModuleName.CoolingBuffer2, 0) ? "1" : "0");
  58. return true;
  59. }
  60. return true;
  61. }
  62. }
  63. }