虚拟模式下 跳过联锁(Interlock)检查,因为虚拟模式没有真实安全门信

This commit is contained in:
zhengxuan.zhang
2026-05-21 17:15:27 +08:00
parent 43d0e7fa89
commit de4a7121db
5 changed files with 27 additions and 12 deletions
@@ -69,17 +69,19 @@ namespace XP.Hardware.MotionControl.Module
// Initialize LocalizationHelper to use ILocalizationService for string lookup (supports Fallback Chain)
LocalizationHelper.Initialize(localizationService);
// 仅在非虚拟模式下启动 PLC 状态轮询 | Only start PLC polling when not in simulated mode
// 启动状态轮询(虚拟模式和 PLC 模式均需要,用于驱动 UI 位置更新事件)
// Start status polling (needed for both simulated and PLC modes to drive UI position update events)
var motionService = containerProvider.Resolve<IMotionControlService>();
motionService.StartPolling();
var motionSystem = containerProvider.Resolve<IMotionSystem>();
if (motionSystem is not SimulatedMotionSystem)
if (motionSystem is SimulatedMotionSystem)
{
var motionService = containerProvider.Resolve<IMotionControlService>();
motionService.StartPolling();
System.Console.WriteLine("[MotionControlModule] PLC 轮询已启动 | PLC polling started");
System.Console.WriteLine("[MotionControlModule] [Simulated] 轮询已启动(虚拟模式)| Polling started (simulated mode)");
}
else
{
System.Console.WriteLine("[MotionControlModule] [Simulated] 跳过 PLC 轮询 | Skipping PLC polling (simulated mode)");
System.Console.WriteLine("[MotionControlModule] PLC 轮询已启动 | PLC polling started");
}
System.Console.WriteLine("[MotionControlModule] 模块已初始化 | Module initialized");