IRobot.cs 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. using System.Threading.Tasks;
  5. using TeamAAS.Robot.Enums;
  6. using TeamAAS.Robot.Models;
  7. using TeamAAS.Robot.Models.Robot;
  8. using TeamAAS.Communication.Enums;
  9. namespace TeamAAS.Robot.Interfaces
  10. {
  11. public interface IRobot : IDisposable
  12. {
  13. #region 基础信息
  14. Guid Id { get; set; }
  15. string Name { get; set; }
  16. int RobotNo { get; set; }
  17. int RobotPort { get; }
  18. string RobotIp { get; }
  19. TCPConnectType ConnectType { get; }
  20. Terminator Terminator { get; }
  21. DataEncoding DataEncoding { get; }
  22. RobotBrand Brand { get; }
  23. /// <summary>
  24. /// 连接事件(clientId, sender, data)
  25. /// </summary>
  26. event Action<Guid, object, byte[]> ConnectedEvent;
  27. /// <summary>
  28. /// 断开事件(clientId, sender, data)
  29. /// </summary>
  30. event Action<Guid, object, byte[]> DisconnectedEvent;
  31. /// <summary>
  32. /// 接收数据事件(clientId, sender, data)
  33. /// </summary>
  34. event Action<Guid, object, byte[]> ReceivedEvent;
  35. /// <summary>
  36. /// 发送数据事件(clientId, sender, data)
  37. /// </summary>
  38. event Action<Guid, object, string> SendEvent;
  39. bool CanExecute { get; }
  40. int SelectedTool { get; }
  41. bool EnterDebugMode { get; set; }
  42. #endregion
  43. #region 连接通讯
  44. bool IsConnected { get; }
  45. int Timeout { get; set; }
  46. void Connect();
  47. Task ConnectAsync();
  48. void Disconnect();
  49. #endregion
  50. #region 控制
  51. bool Reset();
  52. Task<bool> ResetAsync();
  53. bool Motor(bool state);
  54. Task<bool> MotorAsync(bool state);
  55. bool Speed(int value);
  56. Task<bool> SpeedAsync(int value);
  57. bool Accel(int value);
  58. Task<bool> AccelAsync(int value);
  59. bool Speeds(double value);
  60. Task<bool> SpeedsAsync(double value);
  61. bool Accels(double value);
  62. Task<bool> AccelsAsync(double value);
  63. bool Speedfactor(int value);
  64. Task<bool> SpeedfactorAsync(int value);
  65. bool Power(bool state);
  66. Task<bool> PowerAsync(bool state);
  67. bool Go(RPoint position);
  68. Task<bool> GoAsync(RPoint position);
  69. bool Move(RPoint position);
  70. Task<bool> MoveAsync(RPoint position);
  71. bool Jump(RPoint position, double? LimZ);
  72. Task<bool> JumpAsync(RPoint position, double? LimZ);
  73. bool Jog(string axis, double distance);
  74. Task<bool> JogAsync(string axis, double distance);
  75. bool Joint(int joint, double distance);
  76. Task<bool> JointAsync(int joint, double distance);
  77. RPoint GetRobotPos();
  78. Task<RPoint> GetRobotPosAsync();
  79. bool SFree();
  80. Task<bool> SFreeAsync();
  81. bool SLock();
  82. Task<bool> SLockAsync();
  83. bool CalibParame(PickInfo Pick, int Speed, int Accel, bool Power, int WaitSuction, int WaitBlow);
  84. Task<bool> CalibParameAsync(PickInfo Pick, int Speed, int Accel, bool Power, int WaitSuction, int WaitBlow);
  85. List<object> GetNodesValue();
  86. bool CalibMotion(RPoint position, double? LimZ);
  87. Task<bool> CalibMotionAsync(RPoint position, double? LimZ);
  88. bool CalibOutIO(bool state);
  89. Task<bool> CalibOutIOAsync(bool state);
  90. bool SetTool(int index, double x, double y);
  91. Task<bool> SetToolAsync(int index, double x, double y);
  92. bool SelectTool(int index);
  93. Task<bool> SelectToolAsync(int index);
  94. #endregion
  95. #region 数据发送接收
  96. string SendAndReceive(string send);
  97. Task<string> SendAndReceiveAsync(string send);
  98. void Send(string send);
  99. Task SendAsync(string send);
  100. Encoding GetEncoding();
  101. #endregion
  102. }
  103. }