From 5fc93ca2515759495af92fd004a0bbfc4cd5b3ab Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Mon, 16 Dec 2019 14:44:34 -0700 Subject: [PATCH] Fixed to DGE to allow use of Com ports via EfS bridge. Updates PD.Core version --- PepperDashEssentials/Factory/UiDeviceFactory.cs | 8 +++++++- .../UI/EssentialsTouchpanelController.cs | 13 +++++++++---- .../Essentials_DM/Endpoints/DGEs/DgeController.cs | 2 ++ 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/PepperDashEssentials/Factory/UiDeviceFactory.cs b/PepperDashEssentials/Factory/UiDeviceFactory.cs index e1b00caa..6176b6d1 100644 --- a/PepperDashEssentials/Factory/UiDeviceFactory.cs +++ b/PepperDashEssentials/Factory/UiDeviceFactory.cs @@ -38,7 +38,13 @@ namespace PepperDash.Essentials else if (typeName == "dmdge200c") dgeDevice = new DmDge200C(comm.IpIdInt, Global.ControlSystem); - var dgeController = new DgeController(config.Key, config.Name, dgeDevice, config, props); + if (dgeDevice == null) + { + Debug.Console(1, "Unable to create DGE device"); + return null; + } + + var dgeController = new DgeController(config.Key + "-comPorts", config.Name, dgeDevice, config, props); DeviceManager.AddDevice(dgeController); diff --git a/PepperDashEssentials/UI/EssentialsTouchpanelController.cs b/PepperDashEssentials/UI/EssentialsTouchpanelController.cs index 678355e3..11f720a3 100644 --- a/PepperDashEssentials/UI/EssentialsTouchpanelController.cs +++ b/PepperDashEssentials/UI/EssentialsTouchpanelController.cs @@ -30,12 +30,17 @@ namespace PepperDash.Essentials tsw.SigChange += Panel_SigChange; } - public EssentialsTouchpanelController(string key, string name, Dge100 panel, string projectName, string sgdPath) + public EssentialsTouchpanelController(string key, string name, Dge100 dge, string projectName, string sgdPath) : base(key, name) { - Panel = panel; - panel.LoadSmartObjects(sgdPath); - panel.SigChange += Panel_SigChange; + Panel = dge; + + if (!string.IsNullOrEmpty(sgdPath)) + dge.LoadSmartObjects(sgdPath); + else + Debug.Console(1, this, "No SGD file path defined"); + + dge.SigChange += Panel_SigChange; } /// diff --git a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/DGEs/DgeController.cs b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/DGEs/DgeController.cs index f8cf0938..0fc00323 100644 --- a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/DGEs/DgeController.cs +++ b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/DGEs/DgeController.cs @@ -28,6 +28,8 @@ namespace PepperDash.Essentials.DM.Endpoints.DGEs public DgeController(string key, string name, Dge100 device, DeviceConfig dc, CrestronTouchpanelPropertiesConfig props) :base(key, name, device) { + DigitalGraphicsEngine = device; + DeviceConfig = dc; PropertiesConfig = props;