fix: Support multiple MPC4 touchscreen slot types in ctor

Updated Mpc4TouchpanelController constructor to assign _touchpanel from the first available slot among MPC4x102, MPC4x201, MPC4x301, or MPC4x302 touchscreen slots, improving compatibility with various MPC4 touchscreen models.
This commit is contained in:
Nick Genovese 2026-08-12 14:17:50 -04:00
parent 31fd665594
commit 8c56623641

View file

@ -28,7 +28,22 @@ namespace PepperDash.Essentials.Core.Touchpanels
public Mpc4TouchpanelController(string key, string name, CrestronControlSystem processor, Dictionary<string, KeypadButton> buttons)
: base(key, name)
{
_touchpanel = processor.ControllerTouchScreenSlotDevice as MPC3Basic;
if (processor.MPC4x102TouchscreenSlot != null)
{
_touchpanel = processor.MPC4x102TouchscreenSlot;
}
else if (processor.MPC4x201TouchscreenSlot != null)
{
_touchpanel = processor.MPC4x201TouchscreenSlot;
}
else if (processor.MPC4x301TouchscreenSlot != null)
{
_touchpanel = processor.MPC4x301TouchscreenSlot;
}
else if (processor.MPC4x302TouchscreenSlot != null)
{
_touchpanel = processor.MPC4x302TouchscreenSlot;
}
if (_touchpanel == null)
{