将Feature/XP.Common和Feature/XP.Hardware分支合并至Develop/XP.forHardwareAndCommon,完善XPapp注册和相关硬件类库通用类库功能。

This commit is contained in:
QI Mingxuan
2026-04-16 17:31:13 +08:00
parent 6ec4c3ddaa
commit 2bd6e566c3
581 changed files with 74600 additions and 222 deletions
@@ -0,0 +1,92 @@
using System.Collections.Generic;
using XP.Hardware.MotionControl.Abstractions.Enums;
namespace XP.Hardware.MotionControl.Config
{
/// <summary>
/// 运动控制配置实体 | Motion Control Configuration Entity
/// 包含所有轴、安全门、几何原点和运行参数的配置 | Contains all axis, safety door, geometry origin and runtime parameter configurations
/// </summary>
public class MotionControlConfig
{
/// <summary>直线轴配置字典 | Linear axis configurations</summary>
public Dictionary<AxisId, LinearAxisConfig> LinearAxes { get; set; } = new();
/// <summary>旋转轴配置字典 | Rotary axis configurations</summary>
public Dictionary<RotaryAxisId, RotaryAxisConfig> RotaryAxes { get; set; } = new();
/// <summary>几何原点配置 | Geometry origin configuration</summary>
public GeometryConfig Geometry { get; set; } = new();
/// <summary>轮询周期(ms| Polling interval (ms)</summary>
public int PollingInterval { get; set; } = 100;
/// <summary>默认速度| Default velocity</summary>
public int DefaultVelocity { get; set; } = 100;
}
/// <summary>
/// 直线轴配置 | Linear Axis Configuration
/// 每个直线轴包含运动范围、原点偏移 | Each linear axis contains motion range, origin offset
/// </summary>
public class LinearAxisConfig
{
/// <summary>最小位置(mm| Minimum position (mm)</summary>
public double Min { get; set; }
/// <summary>最大位置(mm| Maximum position (mm)</summary>
public double Max { get; set; }
/// <summary>原点偏移(mm| Origin offset (mm)</summary>
public double Origin { get; set; }
}
/// <summary>
/// 旋转轴配置 | Rotary Axis Configuration
/// 每个旋转轴包含角度范围、原点偏移、启用标志 | Each rotary axis contains angle range, origin offset, enabled flag
/// </summary>
public class RotaryAxisConfig
{
/// <summary>最小角度(度)| Minimum angle (degrees)</summary>
public double Min { get; set; }
/// <summary>最大角度(度)| Maximum angle (degrees)</summary>
public double Max { get; set; }
/// <summary>原点偏移(度)| Origin offset (degrees)</summary>
public double Origin { get; set; }
/// <summary>是否启用 | Is enabled</summary>
public bool Enabled { get; set; } = true;
}
/// <summary>
/// 几何原点配置 | Geometry Origin Configuration
/// 包含射线源、探测器和旋转中心的原点参数 | Contains origin parameters for source, detector and rotation center
/// </summary>
public class GeometryConfig
{
/// <summary>射线源Z轴原点偏移(mm| Source Z origin offset (mm)</summary>
public double SourceZOrigin { get; set; }
/// <summary>探测器Z轴原点偏移(mm| Detector Z origin offset (mm)</summary>
public double DetectorZOrigin { get; set; }
/// <summary>旋转中心绝对Z坐标(mm,固定值)| Stage rotation center absolute Z (mm, fixed)</summary>
public double StageRotationCenterZ { get; set; }
/// <summary>
/// 探测器摆动旋转中心(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)
/// </summary>
public double SwingPivotOffset { get; set; }
/// <summary>
/// 探测器摆动半径(mm):Pivot 到探测器感光面中心的距离
/// Detector swing radius (mm): distance from Pivot to detector active area center
/// 当值为 0 时退化为无摆动模型 | When 0, degrades to non-swing model
/// </summary>
public double SwingRadius { get; set; }
}
}