From 25693c7071ab655fe3f63cba826c1bbc6b7cd7b5 Mon Sep 17 00:00:00 2001 From: Nick Genovese Date: Wed, 12 Aug 2026 14:40:54 -0400 Subject: [PATCH] fix: Add debug logs for touchscreen slot selection in controller Improved logging to indicate which touchscreen slot is used during Mpc4TouchpanelController initialization. Updated error log to report processor.TouchscreenType for clearer diagnostics. --- .../Touchpanels/Mpc4Touchpanel.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/PepperDash.Essentials.Core/Touchpanels/Mpc4Touchpanel.cs b/src/PepperDash.Essentials.Core/Touchpanels/Mpc4Touchpanel.cs index 85a7b987..5de2f69a 100644 --- a/src/PepperDash.Essentials.Core/Touchpanels/Mpc4Touchpanel.cs +++ b/src/PepperDash.Essentials.Core/Touchpanels/Mpc4Touchpanel.cs @@ -30,24 +30,33 @@ namespace PepperDash.Essentials.Core.Touchpanels { if (processor.MPC4x102TouchscreenSlot != null) { + Debug.LogMessage(LogEventLevel.Information, this, "Using MPC4x102TouchscreenSlot"); _touchpanel = processor.MPC4x102TouchscreenSlot; } else if (processor.MPC4x201TouchscreenSlot != null) { + Debug.LogMessage(LogEventLevel.Information, this, "Using MPC4x201TouchscreenSlot"); _touchpanel = processor.MPC4x201TouchscreenSlot; } else if (processor.MPC4x301TouchscreenSlot != null) { + Debug.LogMessage(LogEventLevel.Information, this, "Using MPC4x301TouchscreenSlot"); _touchpanel = processor.MPC4x301TouchscreenSlot; } else if (processor.MPC4x302TouchscreenSlot != null) { + Debug.LogMessage(LogEventLevel.Information, this, "Using MPC4x302TouchscreenSlot"); _touchpanel = processor.MPC4x302TouchscreenSlot; } + else + { + Debug.LogMessage(LogEventLevel.Information, this, "Using ControllerTouchScreenSlotDevice"); + _touchpanel = processor.ControllerTouchScreenSlotDevice as MPC3Basic; + } if (_touchpanel == null) { - Debug.LogMessage(LogEventLevel.Error, this, "Failed to construct MPC4 Touchpanel Controller with key {0}, check configuration, processor is type: {1}", key, processor.ControllerTouchScreenSlotDevice?.GetType().FullName ?? "null"); + Debug.LogMessage(LogEventLevel.Error, this, "Failed to construct MPC4 Touchpanel Controller with key {0}, check configuration, processor is type: {1}", key, processor.TouchscreenType); return; }