From af12a81c007d3ab336d45f9ac9d45282b20cfdd6 Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Mon, 24 Jun 2019 15:16:20 -0600 Subject: [PATCH] Updates DisplayControllerBridge to support BasicIrDisplay types, adds Samsung IR driver file, updates SetupFileSystem in ControlSystem.cs to build plugin folder --- IR Drivers/samsung_un_series.ir | Bin 0 -> 5264 bytes .../Bridges/DisplayControllerBridge.cs | 56 +++++++++++------- PepperDashEssentials/ControlSystem.cs | 4 ++ PepperDashEssentials/Factory/DeviceFactory.cs | 14 ++--- .../Properties/AssemblyInfo.cs | 2 +- essentials-framework | 2 +- 6 files changed, 48 insertions(+), 30 deletions(-) create mode 100644 IR Drivers/samsung_un_series.ir diff --git a/IR Drivers/samsung_un_series.ir b/IR Drivers/samsung_un_series.ir new file mode 100644 index 0000000000000000000000000000000000000000..cd6401d01a2ba910c38d5742fd93ea7418377a63 GIT binary patch literal 5264 zcma);druoj6vgj8yu0QVa55z1g&`rlLcsR$hJdlx*kF6juI-TggkiSH|c6UeSZ4&m#63H_vfeS z^OLuy>DTYxsMYB==ibkmrObLJll&z*d3*l;?DPI#TlI8A?dEUx??&4GquI9qG>nr! zO~Wu}O>@RFr)_&YVW%B?!nG&IjNujY-Kz1~nmM>`?rj*aH_Z=Q=C|8s`nfT&W2AS@ z{ylS~V%P^p;?QuahFdedx{(ZwzJ}3%WDJCc71{HNkA`75A5Ej#_C8uhx!7!{{&HJq zU!A@CaMrEg{cRXvf(14tzyTLLNJ1a7>OOSyq**vTXZ^dg%a)Qg-uL_ctEV9C0}SaR-2 zv8`m>6qc-av*P={+VvLItS6}E+|l-aUUl8Zl1>vDEc#gNr9vT*sWqcSwy5mo8l9-}%C}{%=q|s^mxG{hrPb)u$M(#j0eigRFI!v#Qdn zEnD>!D_FG}Yu3@a6)suPg87d$zJSS5y0ts-J^bL#$y6#ejIWD|OZC>z)Uc2y%Meam zAc>5{Gg_8}ly*u;n`L5Ob&+_Vvb~g6c9criy&mGHzqzEgoV7xGH8r)z^D2k#P z2$qSvu^k1Kw^5!!V`PuQP~L8{Oq>~|fC&nDhh@l69JkJ3tQSUO$SE};@3PDl31Wr3 z$1>PR(_;|oOUU~?qe4JW_|{oJ;2CVB_Ac{~WzZREppwFc9A_EaJ#NQ^V$v*wBJnpV z3OUgWgS~{Qhste|WyqOg(4b}>v5Xc#q{}?!nM+$l2|2|wIst7?dwX(?ng7(^U<6Q& zUP4Y^WB&hlo2(I`A41MtV?Lpy^FkrYLCD$O80@Cl@Ltcc49;;iZz1P-=86W=LOx{~ zI!l^F%L%!_G8e<6h%zbUGnUb}!lIC?EJJf(253?} zgK2DOuGu`fi!MHAk zgnZ62sDe;;C?R)vhWZtQgQ>TWyDUQoN!Gedz6a*N$qBi~GI|i2hYSi?U>QBT9tzh& z7I}uErno5uA$^unTkE9B8Q#$n%jg8I>g@AOe4>Km g8Qfia>oP|ygPUt_T_$811T>^W5HjMKYmk6{0Z7h+(EtDd literal 0 HcmV?d00001 diff --git a/PepperDashEssentials/Bridges/DisplayControllerBridge.cs b/PepperDashEssentials/Bridges/DisplayControllerBridge.cs index 1bf73c46..ba4da8d0 100644 --- a/PepperDashEssentials/Bridges/DisplayControllerBridge.cs +++ b/PepperDashEssentials/Bridges/DisplayControllerBridge.cs @@ -18,10 +18,9 @@ namespace PepperDash.Essentials.Bridges public static int InputNumber; public static IntFeedback InputNumberFeedback; public static List InputKeys = new List(); - public static void LinkToApi(this PepperDash.Essentials.Core.TwoWayDisplayBase displayDevice, BasicTriList trilist, uint joinStart, string joinMapKey) + public static void LinkToApi(this PepperDash.Essentials.Core.DisplayBase displayDevice, BasicTriList trilist, uint joinStart, string joinMapKey) { - JoinMap = JoinMapHelper.GetJoinMapForDevice(joinMapKey) as DisplayControllerJoinMap; _TriList = trilist; @@ -31,17 +30,31 @@ namespace PepperDash.Essentials.Bridges } JoinMap.OffsetJoinNumbers(joinStart); + Debug.Console(1, "Linking to Trilist '{0}'", _TriList.ID.ToString("X")); Debug.Console(0, "Linking to Bridge Type {0}", displayDevice.GetType().Name.ToString()); - _TriList.StringInput[JoinMap.Name].StringValue = displayDevice.GetType().Name.ToString(); - - InputNumberFeedback = new IntFeedback(() => { return InputNumber; }); - InputNumberFeedback.LinkInputSig(_TriList.UShortInput[JoinMap.InputSelect]); - var commMonitor = displayDevice as ICommunicationMonitor; - commMonitor.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[JoinMap.IsOnline]); + _TriList.StringInput[JoinMap.Name].StringValue = displayDevice.GetType().Name.ToString(); - // Poewer Off + var commMonitor = displayDevice as ICommunicationMonitor; + if (commMonitor != null) + { + commMonitor.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[JoinMap.IsOnline]); + } + + // Two way feedbacks + var twoWayDisplay = displayDevice as PepperDash.Essentials.Core.TwoWayDisplayBase; + if (twoWayDisplay != null) + { + trilist.SetBool(JoinMap.IsTwoWayDisplay, true); + + twoWayDisplay.CurrentInputFeedback.OutputChange += new EventHandler(CurrentInputFeedback_OutputChange); + + InputNumberFeedback = new IntFeedback(() => { return InputNumber; }); + InputNumberFeedback.LinkInputSig(_TriList.UShortInput[JoinMap.InputSelect]); + } + + // Power Off trilist.SetSigTrueAction(JoinMap.PowerOff, () => { InputNumber = 102; @@ -73,7 +86,6 @@ namespace PepperDash.Essentials.Bridges count++; } - displayDevice.CurrentInputFeedback.OutputChange += new EventHandler(CurrentInputFeedback_OutputChange); trilist.SetUShortSigAction(JoinMap.InputSelect, (a) => { if (a == 0) @@ -91,7 +103,8 @@ namespace PepperDash.Essentials.Bridges displayDevice.PowerToggle(); } - InputNumberFeedback.FireUpdate(); + if (displayDevice is PepperDash.Essentials.Core.TwoWayDisplayBase) + InputNumberFeedback.FireUpdate(); }); @@ -134,10 +147,9 @@ namespace PepperDash.Essentials.Bridges public uint PowerOff { get; set; } public uint InputSelect { get; set; } public uint PowerOn { get; set; } + public uint IsTwoWayDisplay { get; set; } public uint SelectScene { get; set; } - public uint LightingSceneOffset { get; set; } public uint ButtonVisibilityOffset { get; set; } - public uint IntegrationIdSet { get; set; } public DisplayControllerJoinMap() { @@ -145,15 +157,17 @@ namespace PepperDash.Essentials.Bridges IsOnline = 50; PowerOff = 1; PowerOn = 2; - InputSelect = 4; - IntegrationIdSet = 1; - LightingSceneOffset = 10; + IsTwoWayDisplay = 3; ButtonVisibilityOffset = 40; - Name = 1; - InputNamesOffset = 10; - InputSelectOffset = 4; + InputSelectOffset = 4; + // Analog - } + InputSelect = 4; + + // Serial + Name = 1; + InputNamesOffset = 10; + } public override void OffsetJoinNumbers(uint joinStart) { @@ -162,8 +176,8 @@ namespace PepperDash.Essentials.Bridges IsOnline = IsOnline + joinOffset; PowerOff = PowerOff + joinOffset; PowerOn = PowerOn + joinOffset; + IsTwoWayDisplay = IsTwoWayDisplay + joinOffset; SelectScene = SelectScene + joinOffset; - LightingSceneOffset = LightingSceneOffset + joinOffset; ButtonVisibilityOffset = ButtonVisibilityOffset + joinOffset; Name = Name + joinOffset; InputNamesOffset = InputNamesOffset + joinOffset; diff --git a/PepperDashEssentials/ControlSystem.cs b/PepperDashEssentials/ControlSystem.cs index 9069bef4..25d1c431 100644 --- a/PepperDashEssentials/ControlSystem.cs +++ b/PepperDashEssentials/ControlSystem.cs @@ -248,6 +248,10 @@ namespace PepperDash.Essentials if (!Directory.Exists(sgdDir)) Directory.Create(sgdDir); + var pluginDir = Global.FilePathPrefix + "plugins"; + if (!Directory.Exists(pluginDir)) + Directory.Create(pluginDir); + return configExists; } diff --git a/PepperDashEssentials/Factory/DeviceFactory.cs b/PepperDashEssentials/Factory/DeviceFactory.cs index 86612747..8e83fb9d 100644 --- a/PepperDashEssentials/Factory/DeviceFactory.cs +++ b/PepperDashEssentials/Factory/DeviceFactory.cs @@ -43,13 +43,13 @@ namespace PepperDash.Essentials return new Device(key, name); } - // MOVE into something else??? - else if (typeName == "basicirdisplay") - { - var ir = IRPortHelper.GetIrPort(properties); - if (ir != null) - return new BasicIrDisplay(key, name, ir.Port, ir.FileName); - } + //// MOVE into something else??? + //else if (typeName == "basicirdisplay") + //{ + // var ir = IRPortHelper.GetIrPort(properties); + // if (ir != null) + // return new BasicIrDisplay(key, name, ir.Port, ir.FileName); + //} else if (typeName == "commmock") { diff --git a/PepperDashEssentials/Properties/AssemblyInfo.cs b/PepperDashEssentials/Properties/AssemblyInfo.cs index f5bdcfd9..55f4a128 100644 --- a/PepperDashEssentials/Properties/AssemblyInfo.cs +++ b/PepperDashEssentials/Properties/AssemblyInfo.cs @@ -4,5 +4,5 @@ [assembly: AssemblyCompany("PepperDash Technology Corp")] [assembly: AssemblyProduct("PepperDashEssentials")] [assembly: AssemblyCopyright("Copyright © PepperDash Technology Corp 2018")] -[assembly: AssemblyVersion("1.4.9.*")] +[assembly: AssemblyVersion("1.4.10.*")] diff --git a/essentials-framework b/essentials-framework index 433f71da..1675b98b 160000 --- a/essentials-framework +++ b/essentials-framework @@ -1 +1 @@ -Subproject commit 433f71da3e8381834ba3c9207622fae16f639ba9 +Subproject commit 1675b98b87a37a915081fff64e79cdc062147588