diff --git a/PepperDashEssentials/ControlSystem.cs b/PepperDashEssentials/ControlSystem.cs index a88d932b..5b8579f5 100644 --- a/PepperDashEssentials/ControlSystem.cs +++ b/PepperDashEssentials/ControlSystem.cs @@ -428,11 +428,30 @@ namespace PepperDash.Essentials DeviceManager.AddDevice(dmpsRoutingController); } + else if (this.ControllerPrompt.IndexOf("mpc3", StringComparison.OrdinalIgnoreCase) > -1) + { + Debug.Console(2, "MPC3 processor type detected. Adding Mpc3TouchpanelController."); + + var butToken = devConf.Properties["buttons"]; + if (butToken != null) + { + var buttons = butToken.ToObject>(); + var tpController = new Essentials.Core.Touchpanels.Mpc3TouchpanelController(devConf.Key, devConf.Name, Global.ControlSystem, buttons); + DeviceManager.AddDevice(tpController); + } + else + { + Debug.Console(0, Debug.ErrorLogLevel.Error, "Error: Unable to deserialize buttons collection for device: {0}", devConf.Key); + } + + } else { Debug.Console(2, "************Processor is not DMPS type***************"); } + + continue; } diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Factory/DeviceFactory.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Factory/DeviceFactory.cs index 45779dd9..c07bc010 100644 --- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Factory/DeviceFactory.cs +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Factory/DeviceFactory.cs @@ -83,21 +83,6 @@ namespace PepperDash.Essentials.Core return new C2nRthsController(key, name, new C2nRths(cresnetId, Global.ControlSystem)); } - if (typeName.StartsWith("mpc3")) - { - var butToken = dc.Properties["buttons"]; - if (butToken != null) - { - var buttons = butToken.ToObject>(); - return new Mpc3TouchpanelController(key, name, Global.ControlSystem, buttons); - } - else - { - Debug.Console(0, Debug.ErrorLogLevel.Error, "Error: Unable to deserialize buttons collection for device: {0}", key); - } - } - - return null; }