mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-16 13:15:03 +00:00
Updated DmpsRoutingController and DmpsRoutingControllerJoinMap; Minor Edits to DmpsRoutingController to accomodate new joinmap span property
This commit is contained in:
@@ -7,121 +7,51 @@ using PepperDash.Essentials.Core;
|
|||||||
|
|
||||||
namespace PepperDash.Essentials.Core.Bridges
|
namespace PepperDash.Essentials.Core.Bridges
|
||||||
{
|
{
|
||||||
public class DmpsRoutingControllerJoinMap : JoinMapBase
|
public class DmpsRoutingControllerJoinMap : JoinMapBaseAdvanced
|
||||||
{
|
{
|
||||||
#region Digitals
|
[JoinName("VideoSyncStatus")]
|
||||||
/// <summary>
|
public JoinDataComplete VideoSyncStatus = new JoinDataComplete(new JoinData() { JoinNumber = 101, JoinSpan = 32 },
|
||||||
/// Range reports video sync feedback for each input
|
new JoinMetadata() { Label = "DM Input Video Sync", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||||
/// </summary>
|
|
||||||
public uint VideoSyncStatus { get; set; }
|
|
||||||
/// <summary>
|
|
||||||
/// Range reports high if corresponding input's endpoint is online
|
|
||||||
/// </summary>
|
|
||||||
public uint InputEndpointOnline { get; set; }
|
|
||||||
/// <summary>
|
|
||||||
/// Range reports high if corresponding output's endpoint is online
|
|
||||||
/// </summary>
|
|
||||||
public uint OutputEndpointOnline { get; set; }
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
|
[JoinName("InputEndpointOnline")]
|
||||||
|
public JoinDataComplete InputEndpointOnline = new JoinDataComplete(new JoinData() { JoinNumber = 501, JoinSpan = 32 },
|
||||||
|
new JoinMetadata() { Label = "DM Chassis Input Endpoint Online", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
#region Analogs
|
[JoinName("OutputEndpointOnline")]
|
||||||
/// <summary>
|
public JoinDataComplete OutputEndpointOnline = new JoinDataComplete(new JoinData() { JoinNumber = 701, JoinSpan = 32 },
|
||||||
/// Range sets and reports the current video source for the corresponding output
|
new JoinMetadata() { Label = "DM Chassis Output Endpoint Online", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||||
/// </summary>
|
|
||||||
public uint OutputVideo { get; set; }
|
|
||||||
/// <summary>
|
|
||||||
/// Range sets and reports the current audio source for the corresponding output
|
|
||||||
/// </summary>
|
|
||||||
public uint OutputAudio { get; set; }
|
|
||||||
/// <summary>
|
|
||||||
/// Range sets and reports the current Usb source for the corresponding output
|
|
||||||
/// </summary>
|
|
||||||
//public uint OutputUsb { get; set; }
|
|
||||||
///// <summary>
|
|
||||||
///// Range sets and reports the current Usb source for the corresponding input
|
|
||||||
///// </summary>
|
|
||||||
//public uint InputUsb { get; set; }
|
|
||||||
///// <summary>
|
|
||||||
///// Range sets and reports the current HDCP state for the corresponding input card
|
|
||||||
///// </summary>
|
|
||||||
//public uint HdcpSupportState { get; set; }
|
|
||||||
///// <summary>
|
|
||||||
///// Range reports the highest supported HDCP state level for the corresponding input card
|
|
||||||
///// </summary>
|
|
||||||
//public uint HdcpSupportCapability { get; set; }
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region Serials
|
[JoinName("OutputVideo")]
|
||||||
/// <summary>
|
public JoinDataComplete OutputVideo = new JoinDataComplete(new JoinData() { JoinNumber = 101, JoinSpan = 32 },
|
||||||
/// Range sets and reports the name for the corresponding input card
|
new JoinMetadata() { Label = "DM Chassis Output Video Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
|
||||||
/// </summary>
|
|
||||||
public uint InputNames { get; set; }
|
|
||||||
/// <summary>
|
|
||||||
/// Range sets and reports the name for the corresponding output card
|
|
||||||
/// </summary>
|
|
||||||
public uint OutputNames { get; set; }
|
|
||||||
/// <summary>
|
|
||||||
/// Range reports the name of the current video source for the corresponding output card
|
|
||||||
/// </summary>
|
|
||||||
public uint OutputCurrentVideoInputNames { get; set; }
|
|
||||||
/// <summary>
|
|
||||||
/// Range reports the name of the current audio source for the corresponding output card
|
|
||||||
/// </summary>
|
|
||||||
public uint OutputCurrentAudioInputNames { get; set; }
|
|
||||||
/// <summary>
|
|
||||||
/// Range reports the current input resolution for each corresponding input card
|
|
||||||
/// </summary>
|
|
||||||
public uint InputCurrentResolution { get; set; }
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
|
[JoinName("OutputAudio")]
|
||||||
|
public JoinDataComplete OutputAudio = new JoinDataComplete(new JoinData() { JoinNumber = 301, JoinSpan = 32 },
|
||||||
|
new JoinMetadata() { Label = "DM Chassis Output Audio Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
|
||||||
|
|
||||||
public DmpsRoutingControllerJoinMap()
|
[JoinName("InputNames")]
|
||||||
|
public JoinDataComplete InputNames = new JoinDataComplete(new JoinData() { JoinNumber = 101, JoinSpan = 32 },
|
||||||
|
new JoinMetadata() { Label = "DM Chassis Input Name", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
|
||||||
|
|
||||||
|
[JoinName("OutputNames")]
|
||||||
|
public JoinDataComplete OutputNames = new JoinDataComplete(new JoinData() { JoinNumber = 301, JoinSpan = 32 },
|
||||||
|
new JoinMetadata() { Label = "DM Chassis Output Name", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
|
||||||
|
|
||||||
|
[JoinName("OutputCurrentVideoInputNames")]
|
||||||
|
public JoinDataComplete OutputCurrentVideoInputNames = new JoinDataComplete(new JoinData() { JoinNumber = 2001, JoinSpan = 32 },
|
||||||
|
new JoinMetadata() { Label = "DM Chassis Video Output Currently Routed Video Input Name", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
|
||||||
|
|
||||||
|
[JoinName("OutputCurrentAudioInputNames")]
|
||||||
|
public JoinDataComplete OutputCurrentAudioInputNames = new JoinDataComplete(new JoinData() { JoinNumber = 2201, JoinSpan = 32 },
|
||||||
|
new JoinMetadata() { Label = "DM Chassis Audio Output Currently Routed Video Input Name", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
|
||||||
|
|
||||||
|
[JoinName("InputCurrentResolution")]
|
||||||
|
public JoinDataComplete InputCurrentResolution = new JoinDataComplete(new JoinData() { JoinNumber = 2401, JoinSpan = 32 },
|
||||||
|
new JoinMetadata() { Label = "DM Chassis Input Current Resolution", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
|
||||||
|
|
||||||
|
public DmpsRoutingControllerJoinMap(uint joinStart)
|
||||||
|
: base(joinStart, typeof(DmpsRoutingControllerJoinMap))
|
||||||
{
|
{
|
||||||
//Digital
|
|
||||||
VideoSyncStatus = 100; //101-299
|
|
||||||
InputEndpointOnline = 500; //501-699
|
|
||||||
OutputEndpointOnline = 700; //701-899
|
|
||||||
|
|
||||||
//Analog
|
|
||||||
OutputVideo = 100; //101-299
|
|
||||||
OutputAudio = 300; //301-499
|
|
||||||
//OutputUsb = 500; //501-699
|
|
||||||
//InputUsb = 700; //701-899
|
|
||||||
VideoSyncStatus = 100; //101-299
|
|
||||||
//HdcpSupportState = 1000; //1001-1199
|
|
||||||
//HdcpSupportCapability = 1200; //1201-1399
|
|
||||||
|
|
||||||
|
|
||||||
//Serial
|
|
||||||
InputNames = 100; //101-299
|
|
||||||
OutputNames = 300; //301-499
|
|
||||||
OutputCurrentVideoInputNames = 2000; //2001-2199
|
|
||||||
OutputCurrentAudioInputNames = 2200; //2201-2399
|
|
||||||
InputCurrentResolution = 2400; // 2401-2599
|
|
||||||
InputEndpointOnline = 500; //501-699
|
|
||||||
OutputEndpointOnline = 700; //701-899
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void OffsetJoinNumbers(uint joinStart)
|
|
||||||
{
|
|
||||||
var joinOffset = joinStart - 1;
|
|
||||||
|
|
||||||
OutputVideo = OutputVideo + joinOffset;
|
|
||||||
OutputAudio = OutputAudio + joinOffset;
|
|
||||||
//OutputUsb = OutputUsb + joinOffset;
|
|
||||||
//InputUsb = InputUsb + joinOffset;
|
|
||||||
VideoSyncStatus = VideoSyncStatus + joinOffset;
|
|
||||||
InputNames = InputNames + joinOffset;
|
|
||||||
OutputNames = OutputNames + joinOffset;
|
|
||||||
OutputCurrentVideoInputNames = OutputCurrentVideoInputNames + joinOffset;
|
|
||||||
OutputCurrentAudioInputNames = OutputCurrentAudioInputNames + joinOffset;
|
|
||||||
InputCurrentResolution = InputCurrentResolution + joinOffset;
|
|
||||||
InputEndpointOnline = InputEndpointOnline + joinOffset;
|
|
||||||
OutputEndpointOnline = OutputEndpointOnline + joinOffset;
|
|
||||||
//HdcpSupportState = HdcpSupportState + joinOffset;
|
|
||||||
//HdcpSupportCapability = HdcpSupportCapability + joinOffset;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -156,15 +156,13 @@ namespace PepperDash.Essentials.DM
|
|||||||
|
|
||||||
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
||||||
{
|
{
|
||||||
var joinMap = new DmpsRoutingControllerJoinMap();
|
var joinMap = new DmpsRoutingControllerJoinMap(joinStart);
|
||||||
|
|
||||||
var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
|
var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(joinMapSerialized))
|
if (!string.IsNullOrEmpty(joinMapSerialized))
|
||||||
joinMap = JsonConvert.DeserializeObject<DmpsRoutingControllerJoinMap>(joinMapSerialized);
|
joinMap = JsonConvert.DeserializeObject<DmpsRoutingControllerJoinMap>(joinMapSerialized);
|
||||||
|
|
||||||
joinMap.OffsetJoinNumbers(joinStart);
|
|
||||||
|
|
||||||
Debug.Console(1, this, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
Debug.Console(1, this, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
||||||
|
|
||||||
// Link up outputs
|
// Link up outputs
|
||||||
@@ -173,6 +171,7 @@ namespace PepperDash.Essentials.DM
|
|||||||
Debug.Console(2, this, "Linking Input Card {0}", i);
|
Debug.Console(2, this, "Linking Input Card {0}", i);
|
||||||
|
|
||||||
var ioSlot = i;
|
var ioSlot = i;
|
||||||
|
var ioSlotJoin = ioSlot - 1;
|
||||||
|
|
||||||
//if (TxDictionary.ContainsKey(ioSlot))
|
//if (TxDictionary.ContainsKey(ioSlot))
|
||||||
//{
|
//{
|
||||||
@@ -191,12 +190,12 @@ namespace PepperDash.Essentials.DM
|
|||||||
//}
|
//}
|
||||||
|
|
||||||
if (VideoInputSyncFeedbacks[ioSlot] != null)
|
if (VideoInputSyncFeedbacks[ioSlot] != null)
|
||||||
VideoInputSyncFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.VideoSyncStatus + ioSlot]);
|
VideoInputSyncFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.VideoSyncStatus.JoinNumber + ioSlotJoin]);
|
||||||
|
|
||||||
if (InputNameFeedbacks[ioSlot] != null)
|
if (InputNameFeedbacks[ioSlot] != null)
|
||||||
InputNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.InputNames + ioSlot]);
|
InputNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.InputNames.JoinNumber + ioSlotJoin]);
|
||||||
|
|
||||||
trilist.SetStringSigAction(joinMap.InputNames + ioSlot, new Action<string>(s =>
|
trilist.SetStringSigAction(joinMap.InputNames.JoinNumber + ioSlotJoin, new Action<string>(s =>
|
||||||
{
|
{
|
||||||
var inputCard = Dmps.SwitcherInputs[ioSlot] as DMInput;
|
var inputCard = Dmps.SwitcherInputs[ioSlot] as DMInput;
|
||||||
|
|
||||||
@@ -210,7 +209,7 @@ namespace PepperDash.Essentials.DM
|
|||||||
|
|
||||||
|
|
||||||
if (InputEndpointOnlineFeedbacks[ioSlot] != null)
|
if (InputEndpointOnlineFeedbacks[ioSlot] != null)
|
||||||
InputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.InputEndpointOnline + ioSlot]);
|
InputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.InputEndpointOnline.JoinNumber + ioSlotJoin]);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (uint i = 1; i <= Dmps.NumberOfSwitcherOutputs; i++)
|
for (uint i = 1; i <= Dmps.NumberOfSwitcherOutputs; i++)
|
||||||
@@ -218,11 +217,13 @@ namespace PepperDash.Essentials.DM
|
|||||||
Debug.Console(2, this, "Linking Output Card {0}", i);
|
Debug.Console(2, this, "Linking Output Card {0}", i);
|
||||||
|
|
||||||
var ioSlot = i;
|
var ioSlot = i;
|
||||||
// Control
|
var ioSlotJoin = ioSlot - 1;
|
||||||
trilist.SetUShortSigAction(joinMap.OutputVideo + ioSlot, o => ExecuteSwitch(o, ioSlot, eRoutingSignalType.Video));
|
|
||||||
trilist.SetUShortSigAction(joinMap.OutputAudio + ioSlot, o => ExecuteSwitch(o, ioSlot, eRoutingSignalType.Audio));
|
|
||||||
|
|
||||||
trilist.SetStringSigAction(joinMap.OutputNames + ioSlot, s =>
|
// Control
|
||||||
|
trilist.SetUShortSigAction(joinMap.OutputVideo.JoinNumber + ioSlotJoin, o => ExecuteSwitch(o, ioSlot, eRoutingSignalType.Video));
|
||||||
|
trilist.SetUShortSigAction(joinMap.OutputAudio.JoinNumber + ioSlotJoin, o => ExecuteSwitch(o, ioSlot, eRoutingSignalType.Audio));
|
||||||
|
|
||||||
|
trilist.SetStringSigAction(joinMap.OutputNames.JoinNumber + ioSlotJoin, s =>
|
||||||
{
|
{
|
||||||
var outputCard = Dmps.SwitcherOutputs[ioSlot] as DMOutput;
|
var outputCard = Dmps.SwitcherOutputs[ioSlot] as DMOutput;
|
||||||
|
|
||||||
@@ -249,17 +250,17 @@ namespace PepperDash.Essentials.DM
|
|||||||
|
|
||||||
// Feedback
|
// Feedback
|
||||||
if (VideoOutputFeedbacks[ioSlot] != null)
|
if (VideoOutputFeedbacks[ioSlot] != null)
|
||||||
VideoOutputFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.OutputVideo + ioSlot]);
|
VideoOutputFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.OutputVideo.JoinNumber + ioSlotJoin]);
|
||||||
if (AudioOutputFeedbacks[ioSlot] != null)
|
if (AudioOutputFeedbacks[ioSlot] != null)
|
||||||
AudioOutputFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.OutputAudio + ioSlot]);
|
AudioOutputFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.OutputAudio.JoinNumber + ioSlotJoin]);
|
||||||
if (OutputNameFeedbacks[ioSlot] != null)
|
if (OutputNameFeedbacks[ioSlot] != null)
|
||||||
OutputNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputNames + ioSlot]);
|
OutputNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputNames.JoinNumber + ioSlotJoin]);
|
||||||
if (OutputVideoRouteNameFeedbacks[ioSlot] != null)
|
if (OutputVideoRouteNameFeedbacks[ioSlot] != null)
|
||||||
OutputVideoRouteNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputCurrentVideoInputNames + ioSlot]);
|
OutputVideoRouteNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputCurrentVideoInputNames.JoinNumber + ioSlotJoin]);
|
||||||
if (OutputAudioRouteNameFeedbacks[ioSlot] != null)
|
if (OutputAudioRouteNameFeedbacks[ioSlot] != null)
|
||||||
OutputAudioRouteNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputCurrentAudioInputNames + ioSlot]);
|
OutputAudioRouteNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputCurrentAudioInputNames.JoinNumber + ioSlotJoin]);
|
||||||
if (OutputEndpointOnlineFeedbacks[ioSlot] != null)
|
if (OutputEndpointOnlineFeedbacks[ioSlot] != null)
|
||||||
OutputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.OutputEndpointOnline + ioSlot]);
|
OutputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.OutputEndpointOnline.JoinNumber + ioSlotJoin]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user