From b7f97dc146cf1069e16b7fb6b0705743eda63b24 Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Thu, 20 Feb 2020 15:32:49 -0700 Subject: [PATCH] Adds new joins to DmTxControllerJoinMap and associated bridge --- .../Bridges/DmTxControllerBridge.cs | 20 +++++++++++++++++-- .../Bridges/JoinMaps/DmTxControllerJoinMap.cs | 20 +++++++++++++++++++ .../Timers/CountdownTimer.cs | 12 +++++++---- .../Transmitters/DmTx201CController.cs | 8 ++++++++ 4 files changed, 54 insertions(+), 6 deletions(-) diff --git a/PepperDashEssentials/Bridges/DmTxControllerBridge.cs b/PepperDashEssentials/Bridges/DmTxControllerBridge.cs index 2017acb4..91f8c6d7 100644 --- a/PepperDashEssentials/Bridges/DmTxControllerBridge.cs +++ b/PepperDashEssentials/Bridges/DmTxControllerBridge.cs @@ -57,7 +57,7 @@ namespace PepperDash.Essentials.Bridges trilist.UShortInput[joinMap.HdcpSupportCapability].UShortValue = (ushort)tx.HdcpSupportCapability; - if(txR.InputPorts[DmPortName.HdmiIn] != null) + if (txR.InputPorts[DmPortName.HdmiIn] != null) { var inputPort = txR.InputPorts[DmPortName.HdmiIn]; @@ -71,7 +71,7 @@ namespace PepperDash.Essentials.Bridges SetHdcpCapabilityAction(hdcpTypeSimple, port, joinMap.Port1HdcpState, trilist); } } - + if (txR.InputPorts[DmPortName.HdmiIn1] != null) { var inputPort = txR.InputPorts[DmPortName.HdmiIn1]; @@ -103,6 +103,22 @@ namespace PepperDash.Essentials.Bridges } } + + var txFreeRun = tx as IHasFreeRun; + if (txFreeRun != null) + { + txFreeRun.FreeRunEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.FreeRunEnabled]); + trilist.SetBoolSigAction(joinMap.FreeRunEnabled, new Action(b => txFreeRun.SetFreeRunEnabled(b))); + } + + var txVga = tx as IVgaBrightnessContrastControls; + { + txVga.VgaBrightnessFeedback.LinkInputSig(trilist.UShortInput[joinMap.VgaBrightness]); + txVga.VgaContrastFeedback.LinkInputSig(trilist.UShortInput[joinMap.VgaContrast]); + + trilist.SetUShortSigAction(joinMap.VgaBrightness, new Action(u => txVga.SetVgaBrightness(u))); + trilist.SetUShortSigAction(joinMap.VgaContrast, new Action(u => txVga.SetVgaContrast(u))); + } } static void SetHdcpCapabilityAction(bool hdcpTypeSimple, EndpointHdmiInput port, uint join, BasicTriList trilist) diff --git a/PepperDashEssentials/Bridges/JoinMaps/DmTxControllerJoinMap.cs b/PepperDashEssentials/Bridges/JoinMaps/DmTxControllerJoinMap.cs index e68e5ad2..ff673cab 100644 --- a/PepperDashEssentials/Bridges/JoinMaps/DmTxControllerJoinMap.cs +++ b/PepperDashEssentials/Bridges/JoinMaps/DmTxControllerJoinMap.cs @@ -18,6 +18,10 @@ namespace PepperDash.Essentials.Bridges /// High when video sync is detected /// public uint VideoSyncStatus { get; set; } + /// + /// + /// + public uint FreeRunEnabled { get; set; } #endregion #region Analogs @@ -41,6 +45,16 @@ namespace PepperDash.Essentials.Bridges /// Sets and reports the current HDCP state for the corresponding input port /// public uint Port2HdcpState { get; set; } + + /// + /// Sets and reports the current VGA Brightness level + /// + public uint VgaBrightness { get; set; } + + /// + /// Sets and reports the current VGA Contrast level + /// + public uint VgaContrast { get; set; } #endregion #region Serials @@ -56,6 +70,7 @@ namespace PepperDash.Essentials.Bridges // Digital IsOnline = 1; VideoSyncStatus = 2; + FreeRunEnabled = 3; // Serial CurrentInputResolution = 1; // Analog @@ -64,6 +79,8 @@ namespace PepperDash.Essentials.Bridges HdcpSupportCapability = 3; Port1HdcpState = 4; Port2HdcpState = 5; + VgaBrightness = 6; + VgaContrast = 7; } public override void OffsetJoinNumbers(uint joinStart) @@ -72,12 +89,15 @@ namespace PepperDash.Essentials.Bridges IsOnline = IsOnline + joinOffset; VideoSyncStatus = VideoSyncStatus + joinOffset; + FreeRunEnabled = FreeRunEnabled + joinOffset; CurrentInputResolution = CurrentInputResolution + joinOffset; VideoInput = VideoInput + joinOffset; AudioInput = AudioInput + joinOffset; HdcpSupportCapability = HdcpSupportCapability + joinOffset; Port1HdcpState = Port1HdcpState + joinOffset; Port2HdcpState = Port2HdcpState + joinOffset; + VgaBrightness = VgaBrightness + joinOffset; + VgaContrast = VgaContrast + joinOffset; } } } \ No newline at end of file diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Timers/CountdownTimer.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Timers/CountdownTimer.cs index a8da97e4..4878a206 100644 --- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Timers/CountdownTimer.cs +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Timers/CountdownTimer.cs @@ -23,6 +23,10 @@ namespace PepperDash.Essentials.Core public StringFeedback TimeRemainingFeedback { get; private set; } public bool CountsDown { get; set; } + + /// + /// The number of seconds to countdown + /// public int SecondsToCount { get; set; } public DateTime StartTime { get; private set; } @@ -31,7 +35,7 @@ namespace PepperDash.Essentials.Core CTimer SecondTimer; /// - /// + /// Constructor /// /// public SecondsCountdownTimer(string key) @@ -61,7 +65,7 @@ namespace PepperDash.Essentials.Core } /// - /// + /// Starts the Timer /// public void Start() { @@ -82,7 +86,7 @@ namespace PepperDash.Essentials.Core } /// - /// + /// Restarts the timer /// public void Reset() { @@ -91,7 +95,7 @@ namespace PepperDash.Essentials.Core } /// - /// + /// Cancels the timer (without triggering it to finish) /// public void Cancel() { diff --git a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/DmTx201CController.cs b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/DmTx201CController.cs index c5811263..37ee38b3 100644 --- a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/DmTx201CController.cs +++ b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/DmTx201CController.cs @@ -234,11 +234,19 @@ namespace PepperDash.Essentials.DM } } + /// + /// Sets the VGA brightness level + /// + /// public void SetVgaBrightness(ushort level) { Tx.VgaInput.VideoControls.Brightness.UShortValue = level; } + /// + /// Sets the VGA contrast level + /// + /// public void SetVgaContrast(ushort level) { Tx.VgaInput.VideoControls.Contrast.UShortValue = level;