mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-08-31 10:58:28 +00:00
fix: Simplify touchscreen slot selection logic
Replaced switch statement for touchscreen type selection with a single cast assignment to MPC3Basic. This streamlines initialization and removes explicit handling for each touchscreen type. Error logging is retained for failed casts.
This commit is contained in:
parent
d713d65c7a
commit
31fd665594
1 changed files with 1 additions and 22 deletions
|
|
@ -28,28 +28,7 @@ namespace PepperDash.Essentials.Core.Touchpanels
|
|||
public Mpc4TouchpanelController(string key, string name, CrestronControlSystem processor, Dictionary<string, KeypadButton> buttons)
|
||||
: base(key, name)
|
||||
{
|
||||
switch (processor.TouchscreenType)
|
||||
{
|
||||
case eTouchscreenType.MPC4x102:
|
||||
_touchpanel = processor.MPC4x102TouchscreenSlot;
|
||||
break;
|
||||
|
||||
case eTouchscreenType.MPC4x201:
|
||||
_touchpanel = processor.MPC4x201TouchscreenSlot;
|
||||
break;
|
||||
|
||||
case eTouchscreenType.MPC4x301:
|
||||
_touchpanel = processor.MPC4x301TouchscreenSlot;
|
||||
break;
|
||||
|
||||
case eTouchscreenType.MPC4x302:
|
||||
_touchpanel = processor.MPC4x302TouchscreenSlot;
|
||||
break;
|
||||
|
||||
default:
|
||||
Debug.LogMessage(LogEventLevel.Error, this, "Unsupported touchpanel type '{0}' for MPC4 Touch Controller", processor.TouchscreenType);
|
||||
break;
|
||||
}
|
||||
_touchpanel = processor.ControllerTouchScreenSlotDevice as MPC3Basic;
|
||||
|
||||
if (_touchpanel == null)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue