修复乱码

This commit is contained in:
zhengxuan.zhang
2026-05-06 17:23:51 +08:00
parent aeef1feee3
commit 3a3ea5b5c9
3 changed files with 26 additions and 28 deletions
@@ -25,7 +25,7 @@ namespace XplorePlane.Tests.ViewModels
{
public class CncEditorViewModelTests
{
// 鈹€鈹€ Helpers 鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€
// ── Helpers ──────────────────────────────────────────────────────────────────
private static CncEditorViewModel CreateVm(
Mock<ICncExecutionService> mockExecSvc = null,
@@ -50,7 +50,7 @@ namespace XplorePlane.Tests.ViewModels
DateTime.UtcNow, DateTime.UtcNow,
new List<CncNode>
{
new ReferencePointNode(Guid.NewGuid(), 0, "鍙傝€冪偣_0", 0, 0, 0, 0, 0, 0, false, 0, 0)
new ReferencePointNode(Guid.NewGuid(), 0, "参考点_0", 0, 0, 0, 0, 0, 0, false, 0, 0)
}.AsReadOnly()));
mockCncProgramSvc
@@ -121,9 +121,9 @@ namespace XplorePlane.Tests.ViewModels
return new CncProgram(Guid.NewGuid(), "TestProgram", DateTime.UtcNow, DateTime.UtcNow, nodes);
}
// 鈹€鈹€ Property 1: 杩愯/鍋滄鎸夐挳鐘舵€佷簰鏂?鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€
// ── Property 1: 运行/停止按钮状态互斥 ──────────────────────────────────────────
// Feature: cnc-run-execution, Property 1: 杩愯/鍋滄鎸夐挳鐘舵€佷簰鏂?
// Feature: cnc-run-execution, Property 1: 运行/停止按钮状态互斥
// Validates: Requirements 1.1, 1.3, 1.4
[Property(MaxTest = 100)]
public Property RunStop_Commands_AreMutuallyExclusive()
@@ -168,9 +168,9 @@ namespace XplorePlane.Tests.ViewModels
});
}
// 鈹€鈹€ Property 2: 鎵ц瀹屾垚鍚庣姸鎬侀噸缃?鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€
// ── Property 2: 执行完成后状态重置 ──────────────────────────────────────────────
// Feature: cnc-run-execution, Property 2: 鎵ц瀹屾垚鍚庣姸鎬侀噸缃?
// Feature: cnc-run-execution, Property 2: 执行完成后状态重置
// Validates: Requirements 1.7, 6.5
[Property(MaxTest = 100)]
public Property AfterExecution_IsRunningFalse_AllNodesIdle()
@@ -219,9 +219,9 @@ namespace XplorePlane.Tests.ViewModels
});
}
// 鈹€鈹€ Property 12: 鎵ц涓紪杈戝懡浠ゅ叏閮ㄧ鐢?鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€
// ── Property 12: 执行中编辑命令全部禁用 ──────────────────────────────────────────
// Feature: cnc-run-execution, Property 12: 鎵ц涓紪杈戝懡浠ゅ叏閮ㄧ鐢?
// Feature: cnc-run-execution, Property 12: 执行中编辑命令全部禁用
// Validates: Requirements 6.7
[Property(MaxTest = 100)]
public Property WhileRunning_AllEditCommands_AreDisabled()
+6 -6
View File
@@ -47,12 +47,12 @@ namespace XplorePlane.Models
Guid Id,
int Index,
string Name,
[property: JsonPropertyName("XM")] double StageX,
[property: JsonPropertyName("YM")] double StageY,
[property: JsonPropertyName("ZT")] double SourceZ,
[property: JsonPropertyName("ZD")] double DetectorZ,
[property: JsonPropertyName("TiltD")] double DetectorSwing,
[property: JsonPropertyName("Dist")] double FDD,
double StageX,
double StageY,
double SourceZ,
double DetectorZ,
double DetectorSwing,
double FDD,
bool IsRayOn,
double Voltage,
double Current,
+12 -14
View File
@@ -1,5 +1,4 @@
using System;
using System.Text.Json.Serialization;
namespace XplorePlane.Models
{
@@ -27,21 +26,20 @@ namespace XplorePlane.Models
/// <summary>
/// 运动控制状态(不可变)。
/// 统一的运动与几何快照,与运动硬件模型对齐。
/// 保留旧版 JSON 字段名以保持向后兼容性。
/// </summary>
public record MotionState(
[property: JsonPropertyName("XM")] double StageX, // X 轴位置(μm
[property: JsonPropertyName("YM")] double StageY, // Y 轴位置(μm
[property: JsonPropertyName("ZT")] double SourceZ, // Z 上轴位置(μm
[property: JsonPropertyName("ZD")] double DetectorZ, // Z 下轴位置(μm
[property: JsonPropertyName("TiltD")] double DetectorSwing, // 探测器摆角(°)
[property: JsonPropertyName("Dist")] double FDD, // 焦点-探测器距离(μm
[property: JsonPropertyName("XMSpeed")] double StageXSpeed, // X 轴速度(μm/s
[property: JsonPropertyName("YMSpeed")] double StageYSpeed, // Y 轴速度(μm/s
[property: JsonPropertyName("ZTSpeed")] double SourceZSpeed, // Z 上轴速度(μm/s
[property: JsonPropertyName("ZDSpeed")] double DetectorZSpeed, // Z 下轴速度(μm/s
[property: JsonPropertyName("TiltDSpeed")] double DetectorSwingSpeed, // 探测器摆角速度(°/s
[property: JsonPropertyName("DistSpeed")] double FDDSpeed, // 焦点-探测器距离速度(μm/s
double StageX, // X 轴位置(μm
double StageY, // Y 轴位置(μm
double SourceZ, // Z 上轴位置(μm
double DetectorZ, // Z 下轴位置(μm
double DetectorSwing, // 探测器摆角(°)
double FDD, // 焦点-探测器距离(μm
double StageXSpeed, // X 轴速度(μm/s
double StageYSpeed, // Y 轴速度(μm/s
double SourceZSpeed, // Z 上轴速度(μm/s
double DetectorZSpeed, // Z 下轴速度(μm/s
double DetectorSwingSpeed, // 探测器摆角速度(°/s
double FDDSpeed, // 焦点-探测器距离速度(μm/s
double StageRotation = 0, // 载台旋转角度(°)
double FixtureRotation = 0, // 夹具旋转角度(°)
double FOD = 0, // 焦点-物体距离(μm