| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- using System;
- using System.Collections.Generic;
- namespace TeamAAS.Global.Devices
- {
- /// <summary>轴状态快照(流程/状态栏批量读取用)。</summary>
- public sealed class AxisStatus
- {
- public int Index { get; set; }
- public string Name { get; set; }
- public double Position { get; set; }
- public double Velocity { get; set; }
- public bool IsMoving { get; set; }
- public bool IsHomed { get; set; }
- public bool IsEnabled { get; set; }
- public bool PositiveLimit { get; set; }
- public bool NegativeLimit { get; set; }
- public bool Alarm { get; set; }
- }
- /// <summary>
- /// 运动控制卡统一契约:索引式 API(流程层)+ 轴对象(调试层)+ 插补/IO。
- /// 品牌适配器(仿真/雷赛/汇川 IMC60G 等)实现本接口后注册进 MotionManager。
- /// </summary>
- public interface IMotionCard : IConnectableDevice
- {
- int AxisCount { get; }
- // --- 流程层:索引 API ---
- bool SetEnable(int axis, bool enable);
- bool Home(int axis, int mode = 0);
- bool IsHomed(int axis);
- bool MoveAbsolute(int axis, double position, double velocity);
- bool MoveRelative(int axis, double distance, double velocity);
- bool JogStart(int axis, int direction, double velocity);
- bool JogStop(int axis);
- /// <summary>平滑停止(axis=-1 表示全部轴)。</summary>
- bool Stop(int axis = -1);
- AxisStatus GetAxisStatus(int axis);
- List<AxisStatus> GetAllAxisStatus();
- // --- 调试层:轴对象 ---
- IAxis GetAxis(int axisNo);
- IList<IAxis> GetAxes();
- // --- 多轴协同 ---
- bool MoveLinear(double[] targetPositions, double velocity);
- bool MoveArc(double[] centerPoint, double[] targetPositions, double velocity);
- /// <summary>急停全部轴。</summary>
- bool EmergencyStop();
- // --- 板载 IO ---
- bool ReadDI(int portIndex);
- bool WriteDO(int portIndex, bool value);
- event EventHandler<MotionConnectionStateChangedEventArgs> ConnectionStateChanged;
- event EventHandler<MotionErrorEventArgs> ErrorOccurred;
- }
- /// <summary>
- /// IO 卡(如 GR20T-ECT-1616ETN)统一契约。
- /// </summary>
- public interface IIOCard : IConnectableDevice
- {
- int InputCount { get; }
- int OutputCount { get; }
- bool[] ReadAllInputs();
- bool[] ReadAllOutputs();
- bool WriteOutput(int index, bool value);
- bool WriteOutputs(bool[] values);
- }
- }
|