From 410ffd2f194addd487dcf64853b1b40e082760b4 Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Wed, 26 Jun 2019 12:56:53 -0600 Subject: [PATCH] Assembly Version incremented to 1.4.11. Fixes issues with DisplayControllerBridge join mapping. Adds volume controls and ensures all input selection joins start at joinstart + 10. --- .../Bridges/DisplayControllerBridge.cs | 61 +++++++++++++++---- .../Properties/AssemblyInfo.cs | 2 +- essentials-framework | 2 +- 3 files changed, 50 insertions(+), 15 deletions(-) diff --git a/PepperDashEssentials/Bridges/DisplayControllerBridge.cs b/PepperDashEssentials/Bridges/DisplayControllerBridge.cs index b787b2d7..594e888d 100644 --- a/PepperDashEssentials/Bridges/DisplayControllerBridge.cs +++ b/PepperDashEssentials/Bridges/DisplayControllerBridge.cs @@ -84,10 +84,12 @@ namespace PepperDash.Essentials.Bridges InputKeys.Add(input.Key.ToString()); var tempKey = InputKeys.ElementAt(count - 1); trilist.SetSigTrueAction((ushort)(JoinMap.InputSelectOffset + count), () => { displayDevice.ExecuteSwitch(displayDevice.InputPorts[tempKey].Selector); }); + Debug.Console(2, displayDevice, "Setting Input Select Action on Digital Join {0} to Input: {1}", JoinMap.InputSelectOffset + count, displayDevice.InputPorts[tempKey].Key.ToString()); trilist.StringInput[(ushort)(JoinMap.InputNamesOffset + count)].StringValue = input.Key.ToString(); count++; } + Debug.Console(2, displayDevice, "Setting Input Select Action on Analog Join {0}", JoinMap.InputSelect); trilist.SetUShortSigAction(JoinMap.InputSelect, (a) => { if (a == 0) @@ -105,11 +107,25 @@ namespace PepperDash.Essentials.Bridges displayDevice.PowerToggle(); } - if (displayDevice is PepperDash.Essentials.Core.TwoWayDisplayBase) + if (twoWayDisplay != null) InputNumberFeedback.FireUpdate(); }); - + + var volumeDisplay = displayDevice as IBasicVolumeControls; + if (volumeDisplay != null) + { + trilist.SetBoolSigAction(JoinMap.VolumeUp, (b) => volumeDisplay.VolumeUp(b)); + trilist.SetBoolSigAction(JoinMap.VolumeDown, (b) => volumeDisplay.VolumeDown(b)); + trilist.SetSigTrueAction(JoinMap.VolumeMute, () => volumeDisplay.MuteToggle()); + + var volumeDisplayWithFeedback = volumeDisplay as IBasicVolumeWithFeedback; + if(volumeDisplayWithFeedback != null) + { + volumeDisplayWithFeedback.VolumeLevelFeedback.LinkInputSig(trilist.UShortInput[JoinMap.VolumeLevelFB]); + volumeDisplayWithFeedback.MuteFeedback.LinkInputSig(trilist.BooleanInput[JoinMap.VolumeMute]); + } + } } static void CurrentInputFeedback_OutputChange(object sender, FeedbackEventArgs e) @@ -142,16 +158,25 @@ namespace PepperDash.Essentials.Bridges } public class DisplayControllerJoinMap : JoinMapBase { - public uint Name { get; set; } - public uint InputNamesOffset { get; set; } - public uint InputSelectOffset { get; set; } - public uint IsOnline { get; set; } - public uint PowerOff { get; set; } - public uint InputSelect { get; set; } - public uint PowerOn { get; set; } + // Digital + public uint PowerOff { get; set; } + public uint PowerOn { get; set; } public uint IsTwoWayDisplay { get; set; } - public uint SelectScene { get; set; } + public uint VolumeUp { get; set; } + public uint VolumeDown { get; set; } + public uint VolumeMute { get; set; } + public uint InputSelectOffset { get; set; } public uint ButtonVisibilityOffset { get; set; } + public uint IsOnline { get; set; } + + // Analog + public uint InputSelect { get; set; } + public uint VolumeLevelFB { get; set; } + + // Serial + public uint Name { get; set; } + public uint InputNamesOffset { get; set; } + public DisplayControllerJoinMap() { @@ -160,11 +185,16 @@ namespace PepperDash.Essentials.Bridges PowerOff = 1; PowerOn = 2; IsTwoWayDisplay = 3; + VolumeUp = 5; + VolumeDown = 6; + VolumeMute = 7; + ButtonVisibilityOffset = 40; - InputSelectOffset = 4; + InputSelectOffset = 10; // Analog - InputSelect = 4; + InputSelect = 11; + VolumeLevelFB = 5; // Serial Name = 1; @@ -179,12 +209,17 @@ namespace PepperDash.Essentials.Bridges PowerOff = PowerOff + joinOffset; PowerOn = PowerOn + joinOffset; IsTwoWayDisplay = IsTwoWayDisplay + joinOffset; - SelectScene = SelectScene + joinOffset; ButtonVisibilityOffset = ButtonVisibilityOffset + joinOffset; Name = Name + joinOffset; InputNamesOffset = InputNamesOffset + joinOffset; InputSelectOffset = InputSelectOffset + joinOffset; + InputSelect = InputSelect + joinOffset; + + VolumeUp = VolumeUp + joinOffset; + VolumeDown = VolumeDown + joinOffset; + VolumeMute = VolumeMute + joinOffset; + VolumeLevelFB = VolumeLevelFB + joinOffset; } } } \ No newline at end of file diff --git a/PepperDashEssentials/Properties/AssemblyInfo.cs b/PepperDashEssentials/Properties/AssemblyInfo.cs index 55f4a128..34c10cd4 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.10.*")] +[assembly: AssemblyVersion("1.4.11.*")] diff --git a/essentials-framework b/essentials-framework index 1675b98b..d8825f38 160000 --- a/essentials-framework +++ b/essentials-framework @@ -1 +1 @@ -Subproject commit 1675b98b87a37a915081fff64e79cdc062147588 +Subproject commit d8825f385faacd6316b0c1af57707079e13a7d36