以硬件库层面运动硬件轴定义为准,同步修改appstate, 包括CNC 节点属性面板和 XP导出
This commit is contained in:
@@ -30,6 +30,8 @@ namespace XplorePlane.Tests.Services
|
||||
private readonly Mock<ILinearAxis> _mockSourceZ;
|
||||
private readonly Mock<ILinearAxis> _mockDetectorZ;
|
||||
private readonly Mock<IRotaryAxis> _mockDetectorSwing;
|
||||
private readonly Mock<IRotaryAxis> _mockStageRotation;
|
||||
private readonly Mock<IRotaryAxis> _mockFixtureRotation;
|
||||
private readonly Mock<ILoggerService> _mockLogger;
|
||||
private readonly EventAggregator _eventAggregator;
|
||||
private readonly ITestOutputHelper _output;
|
||||
@@ -51,6 +53,8 @@ namespace XplorePlane.Tests.Services
|
||||
_mockSourceZ = CreateLinearAxis(AxisId.SourceZ, 0);
|
||||
_mockDetectorZ = CreateLinearAxis(AxisId.DetectorZ, 0);
|
||||
_mockDetectorSwing = CreateRotaryAxis(RotaryAxisId.DetectorSwing, 0);
|
||||
_mockStageRotation = CreateRotaryAxis(RotaryAxisId.StageRotation, 0);
|
||||
_mockFixtureRotation = CreateRotaryAxis(RotaryAxisId.FixtureRotation, 0);
|
||||
_mockLogger = new Mock<ILoggerService>();
|
||||
_eventAggregator = new EventAggregator();
|
||||
|
||||
@@ -59,6 +63,8 @@ namespace XplorePlane.Tests.Services
|
||||
_mockMotionSystem.Setup(x => x.GetLinearAxis(AxisId.SourceZ)).Returns(_mockSourceZ.Object);
|
||||
_mockMotionSystem.Setup(x => x.GetLinearAxis(AxisId.DetectorZ)).Returns(_mockDetectorZ.Object);
|
||||
_mockMotionSystem.Setup(x => x.GetRotaryAxis(RotaryAxisId.DetectorSwing)).Returns(_mockDetectorSwing.Object);
|
||||
_mockMotionSystem.Setup(x => x.GetRotaryAxis(RotaryAxisId.StageRotation)).Returns(_mockStageRotation.Object);
|
||||
_mockMotionSystem.Setup(x => x.GetRotaryAxis(RotaryAxisId.FixtureRotation)).Returns(_mockFixtureRotation.Object);
|
||||
|
||||
_mockMotionControlService
|
||||
.Setup(x => x.GetCurrentGeometry())
|
||||
@@ -82,12 +88,12 @@ namespace XplorePlane.Tests.Services
|
||||
[Fact]
|
||||
public void DefaultState_MotionState_IsHardwareSnapshot()
|
||||
{
|
||||
Assert.Equal(0, _service.MotionState.XM);
|
||||
Assert.Equal(0, _service.MotionState.YM);
|
||||
Assert.Equal(0, _service.MotionState.ZT);
|
||||
Assert.Equal(0, _service.MotionState.ZD);
|
||||
Assert.Equal(0, _service.MotionState.TiltD);
|
||||
Assert.Equal(0, _service.MotionState.Dist);
|
||||
Assert.Equal(0, _service.MotionState.StageX);
|
||||
Assert.Equal(0, _service.MotionState.StageY);
|
||||
Assert.Equal(0, _service.MotionState.SourceZ);
|
||||
Assert.Equal(0, _service.MotionState.DetectorZ);
|
||||
Assert.Equal(0, _service.MotionState.DetectorSwing);
|
||||
Assert.Equal(0, _service.MotionState.FDD);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -174,12 +180,12 @@ namespace XplorePlane.Tests.Services
|
||||
_eventAggregator.GetEvent<GeometryUpdatedEvent>()
|
||||
.Publish(new GeometryData(100, 222.2, 2.22));
|
||||
|
||||
Assert.Equal(12.5, _service.MotionState.XM);
|
||||
Assert.Equal(34.5, _service.MotionState.YM);
|
||||
Assert.Equal(56.5, _service.MotionState.ZT);
|
||||
Assert.Equal(78.5, _service.MotionState.ZD);
|
||||
Assert.Equal(9.5, _service.MotionState.TiltD);
|
||||
Assert.Equal(222.2, _service.MotionState.Dist);
|
||||
Assert.Equal(12.5, _service.MotionState.StageX);
|
||||
Assert.Equal(34.5, _service.MotionState.StageY);
|
||||
Assert.Equal(56.5, _service.MotionState.SourceZ);
|
||||
Assert.Equal(78.5, _service.MotionState.DetectorZ);
|
||||
Assert.Equal(9.5, _service.MotionState.DetectorSwing);
|
||||
Assert.Equal(222.2, _service.MotionState.FDD);
|
||||
}
|
||||
|
||||
private static Mock<ILinearAxis> CreateLinearAxis(AxisId axisId, double position)
|
||||
|
||||
@@ -96,7 +96,7 @@ namespace XplorePlane.Tests.Services
|
||||
var pipeline = new PipelineModel { Name = "TestPipeline" };
|
||||
|
||||
var step = _service.RecordCurrentStep(recipe, pipeline);
|
||||
_output.WriteLine($"RecordCurrentStep: StepIndex={step.StepIndex}, MotionState.XM={step.MotionState.XM}, RaySource.Voltage={step.RaySourceState.Voltage}, Detector.Resolution={step.DetectorState.Resolution}, Pipeline={step.Pipeline.Name}");
|
||||
_output.WriteLine($"RecordCurrentStep: StepIndex={step.StepIndex}, MotionState.StageX={step.MotionState.StageX}, RaySource.Voltage={step.RaySourceState.Voltage}, Detector.Resolution={step.DetectorState.Resolution}, Pipeline={step.Pipeline.Name}");
|
||||
|
||||
Assert.Equal(0, step.StepIndex);
|
||||
Assert.Same(motionState, step.MotionState);
|
||||
@@ -138,4 +138,4 @@ namespace XplorePlane.Tests.Services
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user