| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180 |
- using System;
- using System.Collections.Generic;
- using System.Text;
- using System.Threading.Tasks;
- using TeamAAS.Robot.Enums;
- using TeamAAS.Robot.Models;
- using TeamAAS.Robot.Models.Robot;
- using TeamAAS.Communication.Enums;
- namespace TeamAAS.Robot.Interfaces
- {
- public interface IRobot : IDisposable
- {
- #region 基础信息
- Guid Id { get; set; }
- string Name { get; set; }
- int RobotNo { get; set; }
- int RobotPort { get; }
- string RobotIp { get; }
- TCPConnectType ConnectType { get; }
- Terminator Terminator { get; }
- DataEncoding DataEncoding { get; }
- RobotBrand Brand { get; }
- /// <summary>
- /// 连接事件(clientId, sender, data)
- /// </summary>
- event Action<Guid, object, byte[]> ConnectedEvent;
- /// <summary>
- /// 断开事件(clientId, sender, data)
- /// </summary>
- event Action<Guid, object, byte[]> DisconnectedEvent;
- /// <summary>
- /// 接收数据事件(clientId, sender, data)
- /// </summary>
- event Action<Guid, object, byte[]> ReceivedEvent;
- /// <summary>
- /// 发送数据事件(clientId, sender, data)
- /// </summary>
- event Action<Guid, object, string> SendEvent;
- bool CanExecute { get; }
- int SelectedTool { get; }
- bool EnterDebugMode { get; set; }
- #endregion
- #region 连接通讯
- bool IsConnected { get; }
- int Timeout { get; set; }
- void Connect();
- Task ConnectAsync();
- void Disconnect();
- #endregion
- #region 控制
- bool Reset();
- Task<bool> ResetAsync();
- bool Motor(bool state);
- Task<bool> MotorAsync(bool state);
- bool Speed(int value);
- Task<bool> SpeedAsync(int value);
- bool Accel(int value);
- Task<bool> AccelAsync(int value);
- bool Speeds(double value);
- Task<bool> SpeedsAsync(double value);
- bool Accels(double value);
- Task<bool> AccelsAsync(double value);
- bool Speedfactor(int value);
- Task<bool> SpeedfactorAsync(int value);
- bool Power(bool state);
- Task<bool> PowerAsync(bool state);
- bool Go(RPoint position);
- Task<bool> GoAsync(RPoint position);
- bool Move(RPoint position);
- Task<bool> MoveAsync(RPoint position);
- bool Jump(RPoint position, double? LimZ);
- Task<bool> JumpAsync(RPoint position, double? LimZ);
- bool Jog(string axis, double distance);
- Task<bool> JogAsync(string axis, double distance);
- bool Joint(int joint, double distance);
- Task<bool> JointAsync(int joint, double distance);
- RPoint GetRobotPos();
- Task<RPoint> GetRobotPosAsync();
- bool SFree();
- Task<bool> SFreeAsync();
- bool SLock();
- Task<bool> SLockAsync();
- bool CalibParame(PickInfo Pick, int Speed, int Accel, bool Power, int WaitSuction, int WaitBlow);
- Task<bool> CalibParameAsync(PickInfo Pick, int Speed, int Accel, bool Power, int WaitSuction, int WaitBlow);
- List<object> GetNodesValue();
- bool CalibMotion(RPoint position, double? LimZ);
- Task<bool> CalibMotionAsync(RPoint position, double? LimZ);
- bool CalibOutIO(bool state);
- Task<bool> CalibOutIOAsync(bool state);
- bool SetTool(int index, double x, double y);
- Task<bool> SetToolAsync(int index, double x, double y);
- bool SelectTool(int index);
- Task<bool> SelectToolAsync(int index);
- #endregion
- #region 数据发送接收
- string SendAndReceive(string send);
- Task<string> SendAndReceiveAsync(string send);
- void Send(string send);
- Task SendAsync(string send);
- Encoding GetEncoding();
- #endregion
- }
- }
|