mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-16 05:05:00 +00:00
Tested working onsite with Trevor Payne
This commit is contained in:
@@ -141,6 +141,11 @@ namespace PepperDash.Essentials.Bridges
|
|||||||
{
|
{
|
||||||
(device as IBridge).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
(device as IBridge).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
else if (device is HdMdxxxCEController)
|
||||||
|
{
|
||||||
|
(device as HdMdxxxCEController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
//else if (device is LightingBase)
|
//else if (device is LightingBase)
|
||||||
//{
|
//{
|
||||||
|
|||||||
172
PepperDashEssentials/Bridges/HdMdxxxCEControllerBridge.cs
Normal file
172
PepperDashEssentials/Bridges/HdMdxxxCEControllerBridge.cs
Normal file
@@ -0,0 +1,172 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using Crestron.SimplSharp;
|
||||||
|
using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
|
using Crestron.SimplSharpPro.DM;
|
||||||
|
using Crestron.SimplSharpPro.DM.Endpoints;
|
||||||
|
using Crestron.SimplSharpPro.DM.Endpoints.Receivers;
|
||||||
|
|
||||||
|
using PepperDash.Core;
|
||||||
|
using PepperDash.Essentials.Core;
|
||||||
|
using PepperDash.Essentials.DM;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Bridges
|
||||||
|
{
|
||||||
|
public static class HdMdxxxCEControllerApiExtensions
|
||||||
|
{
|
||||||
|
public static void LinkToApi(this HdMdxxxCEController hdMdPair, BasicTriList trilist, uint joinStart, string joinMapKey)
|
||||||
|
{
|
||||||
|
var joinMap = JoinMapHelper.GetJoinMapForDevice(joinMapKey) as HdMdxxxCEControllerJoinMap;
|
||||||
|
|
||||||
|
if (joinMap == null)
|
||||||
|
joinMap = new HdMdxxxCEControllerJoinMap();
|
||||||
|
|
||||||
|
joinMap.OffsetJoinNumbers(joinStart);
|
||||||
|
|
||||||
|
Debug.Console(1, hdMdPair, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
||||||
|
|
||||||
|
hdMdPair.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
|
||||||
|
hdMdPair.RemoteEndDetectedFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RemoteEndDetected]);
|
||||||
|
|
||||||
|
trilist.SetSigTrueAction(joinMap.AutoRouteOn, new Action(() => hdMdPair.AutoRouteOn()));
|
||||||
|
hdMdPair.AutoRouteOnFeedback.LinkInputSig(trilist.BooleanInput[joinMap.AutoRouteOn]);
|
||||||
|
trilist.SetSigTrueAction(joinMap.AutoRouteOff, new Action(() => hdMdPair.AutoRouteOff()));
|
||||||
|
hdMdPair.AutoRouteOnFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.AutoRouteOff]);
|
||||||
|
|
||||||
|
trilist.SetSigTrueAction(joinMap.PriorityRoutingOn, new Action(() => hdMdPair.PriorityRouteOn()));
|
||||||
|
hdMdPair.PriorityRoutingOnFeedback.LinkInputSig(trilist.BooleanInput[joinMap.PriorityRoutingOn]);
|
||||||
|
trilist.SetSigTrueAction(joinMap.PriorityRoutingOff, new Action(() => hdMdPair.PriorityRouteOff()));
|
||||||
|
hdMdPair.PriorityRoutingOnFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.PriorityRoutingOff]);
|
||||||
|
|
||||||
|
trilist.SetSigTrueAction(joinMap.InputOnScreenDisplayEnabled, new Action(() => hdMdPair.OnScreenDisplayEnable()));
|
||||||
|
hdMdPair.InputOnScreenDisplayEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.InputOnScreenDisplayEnabled]);
|
||||||
|
trilist.SetSigTrueAction(joinMap.AutoRouteOff, new Action(() => hdMdPair.OnScreenDisplayDisable()));
|
||||||
|
hdMdPair.InputOnScreenDisplayEnabledFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.InputOnScreenDisplayDisabled]);
|
||||||
|
|
||||||
|
trilist.SetUShortSigAction(joinMap.VideoSource, new Action<ushort>((i) => hdMdPair.ExecuteSwitch(i, null, eRoutingSignalType.Video | eRoutingSignalType.Audio)));
|
||||||
|
hdMdPair.VideoSourceFeedback.LinkInputSig(trilist.UShortInput[joinMap.VideoSource]);
|
||||||
|
|
||||||
|
trilist.UShortInput[joinMap.SourceCount].UShortValue = (ushort)hdMdPair.InputPorts.Count;
|
||||||
|
|
||||||
|
foreach (var input in hdMdPair.InputPorts)
|
||||||
|
{
|
||||||
|
var number = Convert.ToUInt16(input.Selector);
|
||||||
|
hdMdPair.SyncDetectedFeedbacks[number].LinkInputSig(trilist.BooleanInput[joinMap.SyncDetected + number]);
|
||||||
|
trilist.StringInput[joinMap.SourceNames + number].StringValue = input.Key;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class HdMdxxxCEControllerJoinMap : JoinMapBase
|
||||||
|
{
|
||||||
|
#region Digitals
|
||||||
|
/// <summary>
|
||||||
|
/// High when the pair is online
|
||||||
|
/// </summary>
|
||||||
|
public uint IsOnline { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// High when the remote end device is online
|
||||||
|
/// </summary>
|
||||||
|
public uint RemoteEndDetected { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sets Auto Route On and provides feedback
|
||||||
|
/// </summary>
|
||||||
|
public uint AutoRouteOn { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sets Auto Route Off and provides feedback
|
||||||
|
/// </summary>
|
||||||
|
public uint AutoRouteOff { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sets Priority Routing On and provides feedback
|
||||||
|
/// </summary>
|
||||||
|
public uint PriorityRoutingOn { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sets Priority Routing Off and provides feedback
|
||||||
|
/// </summary>
|
||||||
|
public uint PriorityRoutingOff { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Enables OSD and provides feedback
|
||||||
|
/// </summary>
|
||||||
|
public uint InputOnScreenDisplayEnabled { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Disables OSD and provides feedback
|
||||||
|
/// </summary>
|
||||||
|
public uint InputOnScreenDisplayDisabled { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Provides Video Sync Detected feedback for each input
|
||||||
|
/// </summary>
|
||||||
|
public uint SyncDetected { get; set; }
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Analogs
|
||||||
|
/// <summary>
|
||||||
|
/// Sets the video source for the receiver's HDMI out and provides feedback
|
||||||
|
/// </summary>
|
||||||
|
public uint VideoSource { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Indicates the number of sources supported by the Tx/Rx pair
|
||||||
|
/// </summary>
|
||||||
|
public uint SourceCount { get; set; }
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Serials
|
||||||
|
/// <summary>
|
||||||
|
/// Indicates the name of each input port
|
||||||
|
/// </summary>
|
||||||
|
public uint SourceNames { get; set; }
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
public HdMdxxxCEControllerJoinMap()
|
||||||
|
{
|
||||||
|
//Digital
|
||||||
|
IsOnline = 1;
|
||||||
|
RemoteEndDetected = 2;
|
||||||
|
AutoRouteOn = 3;
|
||||||
|
AutoRouteOff = 4;
|
||||||
|
PriorityRoutingOn = 5;
|
||||||
|
PriorityRoutingOff = 6;
|
||||||
|
InputOnScreenDisplayEnabled = 7;
|
||||||
|
InputOnScreenDisplayDisabled = 8;
|
||||||
|
SyncDetected = 10; // 11-15
|
||||||
|
|
||||||
|
//Analog
|
||||||
|
VideoSource = 1;
|
||||||
|
SourceCount = 2;
|
||||||
|
|
||||||
|
//Serials
|
||||||
|
SourceNames = 10; // 11-15
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void OffsetJoinNumbers(uint joinStart)
|
||||||
|
{
|
||||||
|
var joinOffset = joinStart - 1;
|
||||||
|
|
||||||
|
IsOnline = IsOnline + joinOffset;
|
||||||
|
RemoteEndDetected = RemoteEndDetected + joinOffset;
|
||||||
|
AutoRouteOn = AutoRouteOn + joinOffset;
|
||||||
|
AutoRouteOff = AutoRouteOff + joinOffset;
|
||||||
|
PriorityRoutingOn = PriorityRoutingOn + joinOffset;
|
||||||
|
PriorityRoutingOff = PriorityRoutingOff + joinOffset;
|
||||||
|
InputOnScreenDisplayEnabled = InputOnScreenDisplayEnabled + joinOffset;
|
||||||
|
InputOnScreenDisplayDisabled = InputOnScreenDisplayDisabled + joinOffset;
|
||||||
|
SyncDetected = SyncDetected + joinOffset;
|
||||||
|
|
||||||
|
VideoSource = VideoSource + joinOffset;
|
||||||
|
SourceCount = SourceCount + joinOffset;
|
||||||
|
|
||||||
|
SourceNames = SourceNames + joinOffset;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -129,6 +129,7 @@
|
|||||||
<Compile Include="Bridges\DmTxControllerBridge.cs" />
|
<Compile Include="Bridges\DmTxControllerBridge.cs" />
|
||||||
<Compile Include="Bridges\GenericLightingBridge.cs" />
|
<Compile Include="Bridges\GenericLightingBridge.cs" />
|
||||||
<Compile Include="Bridges\GenericRelayDeviceBridge.cs" />
|
<Compile Include="Bridges\GenericRelayDeviceBridge.cs" />
|
||||||
|
<Compile Include="Bridges\HdMdxxxCEControllerBridge.cs" />
|
||||||
<Compile Include="Bridges\IBasicCommunicationBridge.cs" />
|
<Compile Include="Bridges\IBasicCommunicationBridge.cs" />
|
||||||
<Compile Include="Bridges\DmRmcControllerBridge.cs" />
|
<Compile Include="Bridges\DmRmcControllerBridge.cs" />
|
||||||
<Compile Include="Bridges\IBridge.cs" />
|
<Compile Include="Bridges\IBridge.cs" />
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ namespace PepperDash.Essentials.DM
|
|||||||
return PepperDash.Essentials.DM.Chassis.HdMdNxM4kEController.GetController(key, name, type, props);
|
return PepperDash.Essentials.DM.Chassis.HdMdNxM4kEController.GetController(key, name, type, props);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (typeName.Equals("hdmd400ce") || typeName.Equals("hdmd300ce") || typeName.Equals("hdmd200ce"))
|
else if (typeName.Equals("hdmd400ce") || typeName.Equals("hdmd300ce") || typeName.Equals("hdmd200ce") || typeName.Equals("hdmd200c1ge"))
|
||||||
{
|
{
|
||||||
var props = JsonConvert.DeserializeObject
|
var props = JsonConvert.DeserializeObject
|
||||||
<PepperDash.Essentials.DM.HdMdxxxCEPropertiesConfig>(properties.ToString());
|
<PepperDash.Essentials.DM.HdMdxxxCEPropertiesConfig>(properties.ToString());
|
||||||
|
|||||||
@@ -16,13 +16,13 @@ namespace PepperDash.Essentials.DM
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represent both a transmitter and receiver pair of the HD-MD-400-C-E / HD-MD-300-C-E / HD-MD-200-C-E kits
|
/// Represent both a transmitter and receiver pair of the HD-MD-400-C-E / HD-MD-300-C-E / HD-MD-200-C-E kits
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class HdMdxxxCEController : CrestronGenericBaseDevice, IRouting //, IComPorts
|
public class HdMdxxxCEController : CrestronGenericBaseDevice, IRouting//, IComPorts
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// DmLite Ports
|
///// DmLite Ports
|
||||||
/// </summary>
|
///// </summary>
|
||||||
public RoutingOutputPort ToRx { get; private set; }
|
//public RoutingOutputPort ToRx { get; private set; }
|
||||||
public RoutingInputPort FromTx { get; private set; }
|
//public RoutingInputPort FromTx { get; private set; }
|
||||||
|
|
||||||
public RoutingOutputPort HdmiOut { get; private set; }
|
public RoutingOutputPort HdmiOut { get; private set; }
|
||||||
|
|
||||||
@@ -30,16 +30,34 @@ namespace PepperDash.Essentials.DM
|
|||||||
|
|
||||||
public RoutingPortCollection<RoutingInputPort> InputPorts { get; private set; }
|
public RoutingPortCollection<RoutingInputPort> InputPorts { get; private set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The value of the current video source for the HDMI output on the receiver
|
||||||
|
/// </summary>
|
||||||
public IntFeedback VideoSourceFeedback { get; private set; }
|
public IntFeedback VideoSourceFeedback { get; private set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Indicates if Auto Route is on on the transmitter
|
||||||
|
/// </summary>
|
||||||
public BoolFeedback AutoRouteOnFeedback { get; private set; }
|
public BoolFeedback AutoRouteOnFeedback { get; private set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Indicates if Priority Routing is on on the transmitter
|
||||||
|
/// </summary>
|
||||||
public BoolFeedback PriorityRoutingOnFeedback { get; private set; }
|
public BoolFeedback PriorityRoutingOnFeedback { get; private set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// INdicates if the On Screen Display is enabled
|
||||||
|
/// </summary>
|
||||||
public BoolFeedback InputOnScreenDisplayEnabledFeedback { get; private set; }
|
public BoolFeedback InputOnScreenDisplayEnabledFeedback { get; private set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Indicates if video sync is detected on each of the inputs
|
||||||
|
/// </summary>
|
||||||
public Dictionary<uint, BoolFeedback> SyncDetectedFeedbacks { get; private set; }
|
public Dictionary<uint, BoolFeedback> SyncDetectedFeedbacks { get; private set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Indicates if the remote end device is detected
|
||||||
|
/// </summary>
|
||||||
public BoolFeedback RemoteEndDetectedFeedback { get; private set; }
|
public BoolFeedback RemoteEndDetectedFeedback { get; private set; }
|
||||||
|
|
||||||
public RoutingPortCollection<RoutingOutputPort> OutputPorts
|
public RoutingPortCollection<RoutingOutputPort> OutputPorts
|
||||||
@@ -63,6 +81,8 @@ namespace PepperDash.Essentials.DM
|
|||||||
|
|
||||||
InputPorts = new RoutingPortCollection<RoutingInputPort>();
|
InputPorts = new RoutingPortCollection<RoutingInputPort>();
|
||||||
|
|
||||||
|
SyncDetectedFeedbacks = new Dictionary<uint, BoolFeedback>();
|
||||||
|
|
||||||
// Add the HDMI input port on the receiver
|
// Add the HDMI input port on the receiver
|
||||||
InputPorts.Add(new RoutingInputPort(DmPortName.Hdmi, eRoutingSignalType.Audio | eRoutingSignalType.Video,
|
InputPorts.Add(new RoutingInputPort(DmPortName.Hdmi, eRoutingSignalType.Audio | eRoutingSignalType.Video,
|
||||||
eRoutingPortConnectionType.Hdmi, 1, this));
|
eRoutingPortConnectionType.Hdmi, 1, this));
|
||||||
@@ -110,16 +130,17 @@ namespace PepperDash.Essentials.DM
|
|||||||
InputPorts[DmPortName.HdmiIn].Port = TxRxPair.HdmiInputs[1];
|
InputPorts[DmPortName.HdmiIn].Port = TxRxPair.HdmiInputs[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//ToRx = new RoutingOutputPort(DmPortName.ToTx, eRoutingSignalType.Audio | eRoutingSignalType.Video,
|
||||||
|
// eRoutingPortConnectionType.DmCat, null, this);
|
||||||
|
|
||||||
ToRx = new RoutingOutputPort(DmPortName.ToTx, eRoutingSignalType.Audio | eRoutingSignalType.Video,
|
//FromTx = new RoutingInputPort(DmPortName.FromTx, eRoutingSignalType.Audio | eRoutingSignalType.Video,
|
||||||
eRoutingPortConnectionType.DmCat, null, this);
|
// eRoutingPortConnectionType.DmCat, null, this);
|
||||||
|
|
||||||
FromTx = new RoutingInputPort(DmPortName.FromTx, eRoutingSignalType.Audio | eRoutingSignalType.Video,
|
|
||||||
eRoutingPortConnectionType.DmCat, null, this);
|
|
||||||
|
|
||||||
HdmiOut = new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
|
HdmiOut = new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
|
||||||
eRoutingPortConnectionType.Hdmi, null, this);
|
eRoutingPortConnectionType.Hdmi, null, this);
|
||||||
|
|
||||||
|
OutputPorts[DmPortName.HdmiOut].Port = TxRxPair.HdmiOutputs[1];
|
||||||
|
|
||||||
TxRxPair.DMInputChange += new DMInputEventHandler(TxRxPair_DMInputChange);
|
TxRxPair.DMInputChange += new DMInputEventHandler(TxRxPair_DMInputChange);
|
||||||
TxRxPair.DMOutputChange += new DMOutputEventHandler(TxRxPair_DMOutputChange);
|
TxRxPair.DMOutputChange += new DMOutputEventHandler(TxRxPair_DMOutputChange);
|
||||||
TxRxPair.DMSystemChange += new DMSystemEventHandler(TxRxPair_DMSystemChange);
|
TxRxPair.DMSystemChange += new DMSystemEventHandler(TxRxPair_DMSystemChange);
|
||||||
@@ -183,7 +204,11 @@ namespace PepperDash.Essentials.DM
|
|||||||
|
|
||||||
public void ExecuteSwitch(object inputSelector, object outputSelector, eRoutingSignalType signalType)
|
public void ExecuteSwitch(object inputSelector, object outputSelector, eRoutingSignalType signalType)
|
||||||
{
|
{
|
||||||
TxRxPair.HdmiOutputs[1].VideoOut = TxRxPair.Inputs[(uint)inputSelector];
|
var number = Convert.ToUInt32(inputSelector); // Cast can sometimes fail
|
||||||
|
|
||||||
|
var input = number == 0 ? null : TxRxPair.Inputs[number];
|
||||||
|
|
||||||
|
TxRxPair.HdmiOutputs[1].VideoOut = input;
|
||||||
}
|
}
|
||||||
|
|
||||||
// This device has a different class for com ports which will make it hard to implement IComPorts....
|
// This device has a different class for com ports which will make it hard to implement IComPorts....
|
||||||
|
|||||||
@@ -113,7 +113,7 @@
|
|||||||
<Compile Include="Endpoints\NVX\DmNvxControllerBase.cs" />
|
<Compile Include="Endpoints\NVX\DmNvxControllerBase.cs" />
|
||||||
<Compile Include="Endpoints\DGEs\DgeController.cs" />
|
<Compile Include="Endpoints\DGEs\DgeController.cs" />
|
||||||
<Compile Include="Endpoints\DGEs\DgePropertiesConfig.cs" />
|
<Compile Include="Endpoints\DGEs\DgePropertiesConfig.cs" />
|
||||||
<Compile Include="DmLite\DmMdxxxCEController.cs" />
|
<Compile Include="DmLite\HdMdxxxCEController.cs" />
|
||||||
<Compile Include="Endpoints\Receivers\DmHdBaseTEndpointController.cs" />
|
<Compile Include="Endpoints\Receivers\DmHdBaseTEndpointController.cs" />
|
||||||
<Compile Include="Endpoints\Receivers\DmRmc100SController.cs" />
|
<Compile Include="Endpoints\Receivers\DmRmc100SController.cs" />
|
||||||
<Compile Include="Endpoints\Receivers\DmRmc150SController.cs" />
|
<Compile Include="Endpoints\Receivers\DmRmc150SController.cs" />
|
||||||
|
|||||||
Reference in New Issue
Block a user