using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using TeamAAS.Motion.Models; using static TeamAAS.Motion.Events.CardAxisEventArgs; namespace TeamAAS.Motion.Interfaces { public interface IMotionControl { // --- 1. 属性 (Properties) --- /// 控制卡是否已连接 bool IsConnected { get; } /// 控制卡名称/型号 string CardName { get; } /// 控制卡支持的最大轴数 int MaxAxisCount { get; } // --- 2. 方法 (Methods) --- // 2.1 设备生命周期管理 /// 连接控制卡 /// 连接字符串,如IP地址"192.168.1.100"或设备索引号"0"[reference:5] /// 是否连接成功 bool Connect(string connectionString); /// 断开与控制卡的连接 void Disconnect(); // 2.2 获取轴对象 /// 根据轴号获取轴控制接口 IAxis GetAxis(int axisNo); /// 获取所有轴的控制接口列表 IList GetAxes(); // 2.3 高级运动功能(多轴协同) /// 执行多轴直线插补运动[reference:6] void MoveLinear(double[] targetPositions, double velocity); /// 执行多轴圆弧插补运动[reference:7] void MoveArc(double[] centerPoint, double[] targetPositions, double velocity); /// 停止所有轴的运动(急停) void EmergencyStop(); // 2.4 通用I/O操作 /// 读取数字量输入 bool ReadDI(int portIndex); /// 写入数字量输出 void WriteDO(int portIndex, bool value); // --- 3. 事件 (Events) --- /// 控制卡连接状态发生变化时触发 event EventHandler ConnectionStateChanged; /// 控制卡发生错误时触发 event EventHandler ErrorOccurred; } }