mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-08-31 10:58:28 +00:00
fix: Refine touchpanel device selection and logging
Improve logic to check for MPC3Basic type using pattern matching. Update debug and error messages to report actual device type. Clarify conditional structure for better readability.
This commit is contained in:
parent
25693c7071
commit
83bf40491b
1 changed files with 6 additions and 7 deletions
|
|
@ -48,15 +48,14 @@ namespace PepperDash.Essentials.Core.Touchpanels
|
|||
Debug.LogMessage(LogEventLevel.Information, this, "Using MPC4x302TouchscreenSlot");
|
||||
_touchpanel = processor.MPC4x302TouchscreenSlot;
|
||||
}
|
||||
else if (processor.ControllerTouchScreenSlotDevice != null && processor.ControllerTouchScreenSlotDevice is MPC3Basic mpc)
|
||||
{
|
||||
Debug.LogMessage(LogEventLevel.Information, this, "Using ControllerTouchScreenSlotDevice:{0}", processor.ControllerTouchScreenSlotDevice.GetType().Name);
|
||||
_touchpanel = mpc;
|
||||
}
|
||||
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.TouchscreenType);
|
||||
Debug.LogMessage(LogEventLevel.Error, this, "Failed to find MPC4 Touchpanel Controller with key {0}, check configuration, processor is type: {1}", key, processor.ControllerTouchScreenSlotDevice?.GetType().Name ?? "unknown");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue