运动控制:新增射线源与探测器 Z 轴联动移动功能,支持同步位移控制,新增实体摇杆实现 PLC 摇杆状态监控和事件发布,IMotionSystem 接口新增 Joystick 属性,更新文档说明联动功能使用方法。

This commit is contained in:
QI Mingxuan
2026-05-09 11:30:05 +08:00
parent fa8ad29862
commit f4a2856b92
11 changed files with 910 additions and 39 deletions
@@ -131,6 +131,9 @@ namespace XP.Hardware.MotionControl.Services
var oldDoorStatus = _motionSystem.SafetyDoor.Status;
var oldInterlocked = _motionSystem.SafetyDoor.IsInterlocked;
// 缓存旧的摇杆状态 | Cache old joystick status
var oldJoystickActive = _motionSystem.Joystick.IsJoystickActive;
// 更新所有轴和门状态 | Update all axis and door status
_motionSystem.UpdateAllStatus();
@@ -185,6 +188,15 @@ namespace XP.Hardware.MotionControl.Services
_logger.Info("门联锁状态变化:{IsInterlocked} | Door interlock status changed: {IsInterlocked}",
_motionSystem.SafetyDoor.IsInterlocked);
}
// 检测实体摇杆状态变化 | Detect physical joystick status changes
if (oldJoystickActive != _motionSystem.Joystick.IsJoystickActive)
{
_eventAggregator.GetEvent<JoystickActiveEvent>()
.Publish(_motionSystem.Joystick.IsJoystickActive);
_logger.Info("实体摇杆状态变化:{IsJoystickActive} | Physical joystick status changed: {IsJoystickActive}",
_motionSystem.Joystick.IsJoystickActive);
}
// 轮询成功,重置错误计数 | Poll succeeded, reset error count
_pollErrorCount = 0;
}