增加扫描模式配置参数功能

This commit is contained in:
TianSong
2026-04-22 15:16:43 +08:00
parent faf58b2768
commit 14b027b44f
12 changed files with 920 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
using XP.Scan.Attributes;
namespace XP.Scan.Models
{
/// <summary>
/// 校正配置 | Correction configuration
/// 对应 INI [Correction_Config] Section
/// </summary>
[IniSection("Correction_Config")]
public class CorrectionConfig
{
/// <summary>探测器水平偏移 (mm) | Detector horizontal offset (mm)</summary>
[IniKey("Detector_Horizontal_Offset")]
public double DetectorHorizontalOffset { get; set; }
/// <summary>探测器旋转偏移 (°) | Detector rotation offset (°)</summary>
[IniKey("Detector_Rotation_Offset")]
public double DetectorRotationOffset { get; set; }
}
}
+84
View File
@@ -0,0 +1,84 @@
using XP.Scan.Attributes;
namespace XP.Scan.Models
{
/// <summary>
/// 探测器配置 | Detector configuration
/// 对应 INI [Detector] Section
/// </summary>
[IniSection("Detector")]
public class DetectorConfig
{
/// <summary>帧合并数 | Average frames</summary>
[IniKey("Det_Avg_Frames")]
public int DetAvgFrames { get; set; } = 1;
/// <summary>Binning 模式 | Binning mode</summary>
[IniKey("Det_Binning")]
public string DetBinning { get; set; } = "1*1";
/// <summary>帧率 | Frame rate</summary>
[IniKey("Det_Frame_rate")]
public int DetFrameRate { get; set; } = 2;
/// <summary>增益 (PGA) | Gain (PGA)</summary>
[IniKey("Det_PGA")]
public int DetPGA { get; set; } = 6;
/// <summary>ROI 高度 | ROI height</summary>
[IniKey("Image_ROI_Height")]
public int ImageROIHeight { get; set; }
/// <summary>ROI 宽度 | ROI width</summary>
[IniKey("Image_ROI_Width")]
public int ImageROIWidth { get; set; }
/// <summary>ROI X 起始 | ROI X start</summary>
[IniKey("Image_ROI_xStart")]
public int ImageROIxStart { get; set; }
/// <summary>ROI X 结束 | ROI X end</summary>
[IniKey("Image_ROI_xEnd")]
public int ImageROIxEnd { get; set; }
/// <summary>ROI Y 起始 | ROI Y start</summary>
[IniKey("Image_ROI_yStart")]
public int ImageROIyStart { get; set; }
/// <summary>ROI Y 结束 | ROI Y end</summary>
[IniKey("Image_ROI_yEnd")]
public int ImageROIyEnd { get; set; }
/// <summary>ROI Z 起始 | ROI Z start</summary>
[IniKey("Image_ROI_zStart")]
public int ImageROIzStart { get; set; }
/// <summary>ROI Z 结束 | ROI Z end</summary>
[IniKey("Image_ROI_zEnd")]
public int ImageROIzEnd { get; set; }
/// <summary>图像高度 | Image height</summary>
[IniKey("Image_Size_Height")]
public int ImageSizeHeight { get; set; }
/// <summary>图像宽度 | Image width</summary>
[IniKey("Image_Size_Width")]
public int ImageSizeWidth { get; set; }
/// <summary>物理尺寸 X (mm) | Physical size X (mm)</summary>
[IniKey("Physical_Size_X")]
public double PhysicalSizeX { get; set; }
/// <summary>物理尺寸 Y (mm) | Physical size Y (mm)</summary>
[IniKey("Physical_Size_Y")]
public double PhysicalSizeY { get; set; }
/// <summary>像素尺寸 X (mm) | Pixel size X (mm)</summary>
[IniKey("Pixel_X")]
public double PixelX { get; set; }
/// <summary>像素尺寸 Y (mm) | Pixel size Y (mm)</summary>
[IniKey("Pixel_Y")]
public double PixelY { get; set; }
}
}
+40
View File
@@ -0,0 +1,40 @@
using XP.Scan.Attributes;
namespace XP.Scan.Models
{
/// <summary>
/// 运动控制配置 | Motion control configuration
/// 对应 INI [Move_Control] Section
/// </summary>
[IniSection("Move_Control")]
public class MoveControlConfig
{
/// <summary>探测器 X 位置 (mm) | Detector X position (mm)</summary>
[IniKey("DetX")]
public double DetX { get; set; }
/// <summary>探测器 Y 位置 (mm) | Detector Y position (mm)</summary>
[IniKey("DetY")]
public double DetY { get; set; }
/// <summary>探测器 Z 位置 (mm) | Detector Z position (mm)</summary>
[IniKey("DetZ")]
public double DetZ { get; set; }
/// <summary>旋转台角度 (°) | Rotation angle (°)</summary>
[IniKey("Rotation")]
public double Rotation { get; set; }
/// <summary>样品台 X 位置 (mm),即 SOD | Stage X position (mm), i.e. SOD</summary>
[IniKey("X")]
public double X { get; set; }
/// <summary>射线源 Z 位置 (mm) | X-Ray source Z position (mm)</summary>
[IniKey("XRAYZ")]
public double XRAYZ { get; set; }
/// <summary>样品台 Y 位置 (mm) | Stage Y position (mm)</summary>
[IniKey("Y")]
public double Y { get; set; }
}
}
+36
View File
@@ -0,0 +1,36 @@
using XP.Scan.Attributes;
namespace XP.Scan.Models
{
/// <summary>
/// 项目信息 | Project information
/// 对应 INI [Project_Information] Section
/// </summary>
[IniSection("Project_Information")]
public class ProjectInfo
{
/// <summary>图像保存路径 | Image save path</summary>
[IniKey("fileSave")]
public string FileSave { get; set; } = string.Empty;
/// <summary>滤波片1 | Filter 1</summary>
[IniKey("filter1")]
public string Filter1 { get; set; } = "None";
/// <summary>滤波片2 | Filter 2</summary>
[IniKey("filter2")]
public string Filter2 { get; set; } = "None";
/// <summary>项目名称 | Project name</summary>
[IniKey("Project")]
public string Project { get; set; } = string.Empty;
/// <summary>样品编号 | Sample number</summary>
[IniKey("SampleNo")]
public string SampleNo { get; set; } = string.Empty;
/// <summary>扫描模式名称 | Scan mode name</summary>
[IniKey("ScanMode")]
public string ScanMode { get; set; } = "QuickScan";
}
}
+27
View File
@@ -0,0 +1,27 @@
namespace XP.Scan.Models
{
/// <summary>
/// 扫描配置数据(顶层聚合,对应完整 INI 文件)
/// Scan configuration data (top-level aggregate, corresponds to complete INI file)
/// </summary>
public class ScanConfigData
{
/// <summary>项目信息 → [Project_Information]</summary>
public ProjectInfo ProjectInfo { get; set; } = new();
/// <summary>射线源配置 → [XRay]</summary>
public XRayConfig XRay { get; set; } = new();
/// <summary>探测器配置 → [Detector]</summary>
public DetectorConfig Detector { get; set; } = new();
/// <summary>运动控制配置 → [Move_Control]</summary>
public MoveControlConfig MoveControl { get; set; } = new();
/// <summary>扫描配置 → [Scan_Config]</summary>
public ScanSettings ScanSettings { get; set; } = new();
/// <summary>校正配置 → [Correction_Config]</summary>
public CorrectionConfig Correction { get; set; } = new();
}
}
+32
View File
@@ -0,0 +1,32 @@
using XP.Scan.Attributes;
namespace XP.Scan.Models
{
/// <summary>
/// 扫描配置 | Scan configuration
/// 对应 INI [Scan_Config] Section
/// </summary>
[IniSection("Scan_Config")]
public class ScanSettings
{
/// <summary>采集张数 | Number of acquisitions</summary>
[IniKey("AcquiresNums")]
public int AcquiresNums { get; set; }
/// <summary>旋转角度 (°) | Rotation degree (°)</summary>
[IniKey("RotateDegree")]
public double RotateDegree { get; set; }
/// <summary>扫描模式描述 | Scan mode description</summary>
[IniKey("ScanMode")]
public string ScanMode { get; set; } = string.Empty;
/// <summary>SDD — 射线源到探测器距离 (mm) | Source to detector distance (mm)</summary>
[IniKey("SDD")]
public double SDD { get; set; }
/// <summary>SOD — 射线源到样品距离 (mm) | Source to object distance (mm)</summary>
[IniKey("SOD")]
public double SOD { get; set; }
}
}
+24
View File
@@ -0,0 +1,24 @@
using XP.Scan.Attributes;
namespace XP.Scan.Models
{
/// <summary>
/// 射线源配置 | X-Ray source configuration
/// 对应 INI [XRay] Section
/// </summary>
[IniSection("XRay")]
public class XRayConfig
{
/// <summary>管电流 (μA) | Tube current (μA)</summary>
[IniKey("Current_uA")]
public int CurrentUA { get; set; }
/// <summary>焦点尺寸 | Focus size</summary>
[IniKey("Focus")]
public string Focus { get; set; } = string.Empty;
/// <summary>管电压 (kV) | Tube voltage (kV)</summary>
[IniKey("Voltage_kV")]
public int VoltageKV { get; set; }
}
}