AlignerServerModule.cs 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. using Aitex.Core.RT.Device;
  2. using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Robot;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. namespace athosRT.Devices.EFEM
  9. {
  10. public class AlignerServerModule : IServerModule, IData, IFunction
  11. {
  12. private double _angle = 0.0;
  13. protected Aligner _aligner = (Aligner)null;
  14. public bool IsLinkOk => this._aligner != null && this._aligner.Communication;
  15. public bool Busy => this._aligner.Busy;
  16. public bool Moving => this._aligner.Moving;
  17. public bool Error => this._aligner.Error;
  18. public string Name { get; set; }
  19. public bool Disabled { get; set; }
  20. public bool Initialized { get; set; }
  21. public bool OriginSearched { get; set; }
  22. public bool InUsed { get; set; }
  23. public Aligner GetDevice() => this._aligner;
  24. public AlignerServerModule(string name)
  25. {
  26. this.Name = name;
  27. this._aligner = DEVICE.GetDevice<Aligner>("Aligner");
  28. }
  29. public bool Init(out string reason) => this._aligner.Init(out reason);
  30. public bool Home(out string reason) => this._aligner.Home(out reason);
  31. public bool Align(out string reason) => this._aligner.Align(this._angle, out reason);
  32. public bool SetAlign(string target, out string reason)
  33. {
  34. reason = string.Empty;
  35. if (target.StartsWith("P1"))
  36. this._angle = 0.0;
  37. else if (target.StartsWith("P2"))
  38. this._angle = 0.0;
  39. else if (target.StartsWith("P3"))
  40. this._angle = 0.0;
  41. else if (target.StartsWith("P4"))
  42. this._angle = 0.0;
  43. else if (target.StartsWith("LLA"))
  44. this._angle = 0.0;
  45. else if (target.StartsWith("LLB"))
  46. {
  47. this._angle = 0.0;
  48. }
  49. else
  50. {
  51. target = target.Replace("D", "");
  52. if (!double.TryParse(target, out this._angle))
  53. return false;
  54. }
  55. return true;
  56. }
  57. }
  58. }