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; } /// /// 连接事件(clientId, sender, data) /// event Action ConnectedEvent; /// /// 断开事件(clientId, sender, data) /// event Action DisconnectedEvent; /// /// 接收数据事件(clientId, sender, data) /// event Action ReceivedEvent; /// /// 发送数据事件(clientId, sender, data) /// event Action 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 ResetAsync(); bool Motor(bool state); Task MotorAsync(bool state); bool Speed(int value); Task SpeedAsync(int value); bool Accel(int value); Task AccelAsync(int value); bool Speeds(double value); Task SpeedsAsync(double value); bool Accels(double value); Task AccelsAsync(double value); bool Speedfactor(int value); Task SpeedfactorAsync(int value); bool Power(bool state); Task PowerAsync(bool state); bool Go(RPoint position); Task GoAsync(RPoint position); bool Move(RPoint position); Task MoveAsync(RPoint position); bool Jump(RPoint position, double? LimZ); Task JumpAsync(RPoint position, double? LimZ); bool Jog(string axis, double distance); Task JogAsync(string axis, double distance); bool Joint(int joint, double distance); Task JointAsync(int joint, double distance); RPoint GetRobotPos(); Task GetRobotPosAsync(); bool SFree(); Task SFreeAsync(); bool SLock(); Task SLockAsync(); bool CalibParame(PickInfo Pick, int Speed, int Accel, bool Power, int WaitSuction, int WaitBlow); Task CalibParameAsync(PickInfo Pick, int Speed, int Accel, bool Power, int WaitSuction, int WaitBlow); List GetNodesValue(); bool CalibMotion(RPoint position, double? LimZ); Task CalibMotionAsync(RPoint position, double? LimZ); bool CalibOutIO(bool state); Task CalibOutIOAsync(bool state); bool SetTool(int index, double x, double y); Task SetToolAsync(int index, double x, double y); bool SelectTool(int index); Task SelectToolAsync(int index); #endregion #region 数据发送接收 string SendAndReceive(string send); Task SendAndReceiveAsync(string send); void Send(string send); Task SendAsync(string send); Encoding GetEncoding(); #endregion } }