using Opc.Ua; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using TeamAAS_VP.Enums; using TeamAAS_VP.Models; using TeamAAS_VP.Models.Robot; using TeamAAS_VP.Models.Product; using TouchSocket.Sockets; namespace TeamAAS_VP.Interfaces { public interface IRobot : IDisposable { #region 基础信息 /// /// 客户端 /// TcpClient TcpClient { get; } /// /// 服务器 /// TcpService TcpService { get; } /// /// 机器人ID /// Guid Id { get; set; } string Name { get; set; } /// /// 机器人编号 /// int RobotNo { get; set; } /// /// 机器人端口 /// int RobotPort { get; } /// /// 机器人IP地址 /// string RobotIp { get; } /// /// 机器人通讯方式 /// TCPConnectType ConnectType { get; } /// /// 结束符 /// Terminator Terminator { get; } /// /// 通讯数据编码 /// DataEncoding DataEncoding { get; } RobotBrand Brand { get; } event Action ConnectedEvent; event Action DisconnectedEvent; event Action ReceivedEvent; event Action SendEvent; bool CanExecute { get; } int SelectedTool { get; } /// /// 进入调试模式 /// /// bool EnterDebugMode { get; set; } //当前位置 RPoint CurrentPosition { get; } /// /// Z轴的安全高度 /// double SafeZ { 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); /// /// PTP速度 /// /// /// bool Speed(int value); /// /// PTP速度 /// /// /// Task SpeedAsync(int value); /// /// PTP加减速度 /// /// /// bool Accel(int value); /// /// PTP加减速度 /// /// /// Task AccelAsync(int value); /// /// CP速度 /// /// /// bool Speeds(double value); /// /// CP速度 /// /// /// Task SpeedsAsync(double value); /// /// CP加减速度 /// /// /// bool Accels(double value); /// /// CP加减速度 /// /// /// Task AccelsAsync(double value); /// /// 整体运行速度比例 /// /// /// bool Speedfactor(int value); /// /// 整体运行速度比例 /// /// /// Task SpeedfactorAsync(int value); /// /// 功率 /// /// /// bool Power(bool state); /// /// 功率 /// /// /// Task PowerAsync(bool state); /// /// 用于在当前位置~指定位置之间以 PTP 动作移动机械臂 /// /// /// bool Go(RPoint position); /// /// 用于在当前位置~指定位置之间以 PTP 动作移动机械臂 /// /// /// Task GoAsync(RPoint position); /// /// 用于在当前位置~指定位置之间以直线动作移动机械臂。 /// /// /// bool Move(RPoint position); /// /// 用于在当前位置~指定位置之间以直线动作移动机械臂。 /// /// /// Task MoveAsync(RPoint position); /// /// 用于通过门控运动(首先垂直上升,然后水平移动,最后垂直下降的门型动作)使机械臂从当前位置向指定位置进行 PTP 动作。 /// /// /// /// bool Jump(RPoint position,double? LimZ); /// /// 用于通过门控运动(首先垂直上升,然后水平移动,最后垂直下降的门型动作)使机械臂从当前位置向指定位置进行 PTP 动作。 /// /// /// /// 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); /// /// 校准移动机器人 /// /// /// /// 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); /// /// 发送并接收数据 /// /// /// string SendAndReceive(ITcpSessionClient client,string send); /// /// 发送并接收数据 /// /// /// Task SendAndReceiveAsync(ITcpSessionClient client,string send); /// /// 发送数据 /// /// void Send(string send); /// /// 发送数据 /// /// /// Task SendAsync(string send); /// /// 发送数据 /// /// void Send(ITcpSessionClient client, string send); /// /// 发送数据 /// /// /// Task SendAsync(ITcpSessionClient client, string send); Encoding GetEncoding(); #endregion } }