LoadPortServerModule.cs 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. using Aitex.Core.RT.Device;
  2. using Aitex.Core.RT.SCCore;
  3. using Aitex.Sorter.Common;
  4. using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.LoadPorts.LoadPortBase;
  5. using System;
  6. using System.Collections.Generic;
  7. using System.Linq;
  8. using System.Text;
  9. using System.Threading.Tasks;
  10. namespace athosRT.Devices.EFEM
  11. {
  12. public class LoadPortServerModule : IServerModule, IData, IFunction
  13. {
  14. protected LoadPortBaseDevice _loadport = (LoadPortBaseDevice)null;
  15. public bool IsLinkOk => this._loadport != null;
  16. public bool Busy => this._loadport.IsBusy;
  17. public bool Error => this._loadport.IsError;
  18. public FoupDockState DockState => this._loadport.DockState;
  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 string Name { get; set; }
  24. public string SlotMap => this._loadport.SlotMap;
  25. public LoadPortBaseDevice GetDevice() => this._loadport;
  26. public LoadPortServerModule(string name)
  27. {
  28. this.Name = name;
  29. this._loadport = DEVICE.GetDevice<LoadPortBaseDevice>(name);
  30. }
  31. public bool Init(out string reason) => this._loadport.Home(out reason);
  32. public bool Home(out string reason) => this._loadport.Home(out reason);
  33. public bool Lock(out string reason) => this._loadport.Clamp(out reason);
  34. public bool Unlock(out string reason) => this._loadport.Unclamp(out reason);
  35. public bool Dock(out string reason) => this._loadport.Dock(out reason);
  36. public bool Undock(out string reason) => this._loadport.Undock(out reason);
  37. public bool OpenDoor(out string reason) => this._loadport.OpenDoor(out reason);
  38. public bool CloseDoor(out string reason) => this._loadport.CloseDoor(out reason);
  39. public bool Open(out string reason) => this._loadport.Load(out reason);
  40. public bool Read(out string reason)
  41. {
  42. reason = (string)null;
  43. return this._loadport.ReadCarrierID();
  44. }
  45. public bool Write(string cid, out string reason)
  46. {
  47. reason = (string)null;
  48. return SC.GetValue<bool>("System.OnlyLotId") ? this._loadport.WriteCarrierIDByIndex(cid) : this._loadport.WriteCarrierID(cid);
  49. }
  50. public bool Close(out string reason) => this._loadport.Unload(out reason);
  51. public bool QueryWaferMap(out string reason) => this._loadport.QueryWaferMap(out reason);
  52. }
  53. }