using System.Collections.Generic;
using XP.Hardware.MotionControl.Abstractions.Enums;
namespace XP.Hardware.MotionControl.Config
{
///
/// 运动控制配置实体 | Motion Control Configuration Entity
/// 包含所有轴、安全门、几何原点和运行参数的配置 | Contains all axis, safety door, geometry origin and runtime parameter configurations
///
public class MotionControlConfig
{
/// 直线轴配置字典 | Linear axis configurations
public Dictionary LinearAxes { get; set; } = new();
/// 旋转轴配置字典 | Rotary axis configurations
public Dictionary RotaryAxes { get; set; } = new();
/// 几何原点配置 | Geometry origin configuration
public GeometryConfig Geometry { get; set; } = new();
/// 轮询周期(ms)| Polling interval (ms)
public int PollingInterval { get; set; } = 100;
/// 默认速度| Default velocity
public int DefaultVelocity { get; set; } = 100;
}
///
/// 直线轴配置 | Linear Axis Configuration
/// 每个直线轴包含运动范围、原点偏移 | Each linear axis contains motion range, origin offset
///
public class LinearAxisConfig
{
/// 最小位置(mm)| Minimum position (mm)
public double Min { get; set; }
/// 最大位置(mm)| Maximum position (mm)
public double Max { get; set; }
/// 原点偏移(mm)| Origin offset (mm)
public double Origin { get; set; }
}
///
/// 旋转轴配置 | Rotary Axis Configuration
/// 每个旋转轴包含角度范围、原点偏移、启用标志 | Each rotary axis contains angle range, origin offset, enabled flag
///
public class RotaryAxisConfig
{
/// 最小角度(度)| Minimum angle (degrees)
public double Min { get; set; }
/// 最大角度(度)| Maximum angle (degrees)
public double Max { get; set; }
/// 原点偏移(度)| Origin offset (degrees)
public double Origin { get; set; }
/// 是否启用 | Is enabled
public bool Enabled { get; set; } = true;
}
///
/// 几何原点配置 | Geometry Origin Configuration
/// 包含射线源、探测器和旋转中心的原点参数 | Contains origin parameters for source, detector and rotation center
///
public class GeometryConfig
{
/// 射线源Z轴原点偏移(mm)| Source Z origin offset (mm)
public double SourceZOrigin { get; set; }
/// 探测器Z轴原点偏移(mm)| Detector Z origin offset (mm)
public double DetectorZOrigin { get; set; }
/// 旋转中心绝对Z坐标(mm,固定值)| Stage rotation center absolute Z (mm, fixed)
public double StageRotationCenterZ { get; set; }
///
/// 探测器摆动旋转中心(Pivot)相对于 DetectorZ 绝对坐标的 Z 方向偏移(mm)
/// Detector swing pivot Z offset relative to DetectorZ absolute coordinate (mm)
/// 正值表示 Pivot 在 DetectorZ_abs 下方(朝向射线源方向)| Positive means Pivot is below DetectorZ_abs (toward source)
///
public double SwingPivotOffset { get; set; }
///
/// 探测器摆动半径(mm):Pivot 到探测器感光面中心的距离
/// Detector swing radius (mm): distance from Pivot to detector active area center
/// 当值为 0 时退化为无摆动模型 | When 0, degrades to non-swing model
///
public double SwingRadius { get; set; }
}
}