AlignerFactory.cs 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. using Aitex.Core.RT.SCCore;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using Aitex.Sorter.Common;
  8. using MECF.Framework.Common.Equipment;
  9. using Aitex.Core.RT.Device;
  10. namespace MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Robot.NX100.AL
  11. {
  12. public class HandlerFactory : IAlignerHandlerFactory
  13. {
  14. private TokenGenerator _tokener = new TokenGenerator("Aligner.AlignerCommunicationToken");
  15. private IDevice _device = null;
  16. public HandlerFactory(IDevice device)
  17. {
  18. _device = device;
  19. }
  20. public IHandler Init()
  21. {
  22. return new handler<AlInitHandler>(_device, ref _tokener);
  23. }
  24. public IHandler Home()
  25. {
  26. return new handler<AlHomeHandler>(_device, ref _tokener);
  27. }
  28. public IHandler Event()
  29. {
  30. return new handler<RbEventHandler>(_device, ref _tokener, true);
  31. }
  32. public IHandler Grip(Hand hand)
  33. {
  34. return new handler<AlGripHandler>(_device, ref _tokener, hand, true);
  35. }
  36. public IHandler Release(Hand hand)
  37. {
  38. return new handler<AlGripHandler>(_device, ref _tokener, hand, false);
  39. }
  40. public IHandler QueryState()
  41. {
  42. return new handler<ALQueryStateHandler>(_device, ref _tokener);
  43. }
  44. public IHandler Clear()
  45. {
  46. return new handler<AlClearErrorHandler>(_device, ref _tokener);
  47. }
  48. public IHandler Stop()
  49. {
  50. return new handler<AlStopHandler>(_device, ref _tokener);
  51. }
  52. public IHandler Align(double angle)
  53. {
  54. return new handler<AlAlignHandler>(_device, ref _tokener, angle);
  55. }
  56. public IHandler LiftUp()
  57. {
  58. return new handler<ALLiftHandler>(_device, ref _tokener, true);
  59. }
  60. public IHandler LiftDown()
  61. {
  62. return new handler<ALLiftHandler>(_device, ref _tokener, false);
  63. }
  64. }
  65. }