mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-14 20:24:57 +00:00
Merge branch 'feature/ecs-1198' into feature/ecs-1194
This commit is contained in:
@@ -0,0 +1,12 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using Crestron.SimplSharp;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.AppServer.Messengers
|
||||||
|
{
|
||||||
|
public class CameraBaseMessenger
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -103,11 +103,14 @@ namespace PepperDash.Essentials.Bridges
|
|||||||
(device as DisplayBase).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
(device as DisplayBase).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else if (device is DmChassisController)
|
else if (device is DmChassisController) {
|
||||||
{
|
|
||||||
(device as DmChassisController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
(device as DmChassisController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
else if (device is DmBladeChassisController) {
|
||||||
|
(device as DmBladeChassisController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
else if (device is DmpsRoutingController)
|
else if (device is DmpsRoutingController)
|
||||||
{
|
{
|
||||||
(device as DmpsRoutingController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
(device as DmpsRoutingController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
||||||
|
|||||||
222
PepperDashEssentials/Bridges/DmBladeChassisControllerBridge.cs
Normal file
222
PepperDashEssentials/Bridges/DmBladeChassisControllerBridge.cs
Normal file
@@ -0,0 +1,222 @@
|
|||||||
|
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.Transmitters;
|
||||||
|
|
||||||
|
using PepperDash.Core;
|
||||||
|
using PepperDash.Essentials.Core;
|
||||||
|
using PepperDash.Essentials.DM;
|
||||||
|
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Bridges {
|
||||||
|
public static class DmBladeChassisControllerApiExtentions {
|
||||||
|
public static void LinkToApi(this DmBladeChassisController dmChassis, BasicTriList trilist, uint joinStart, string joinMapKey) {
|
||||||
|
DmBladeChassisControllerJoinMap joinMap = new DmBladeChassisControllerJoinMap();
|
||||||
|
|
||||||
|
var joinMapSerialized = JoinMapHelper.GetJoinMapForDevice(joinMapKey);
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(joinMapSerialized))
|
||||||
|
joinMap = JsonConvert.DeserializeObject<DmBladeChassisControllerJoinMap>(joinMapSerialized);
|
||||||
|
|
||||||
|
|
||||||
|
joinMap.OffsetJoinNumbers(joinStart);
|
||||||
|
|
||||||
|
Debug.Console(1, dmChassis, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
||||||
|
|
||||||
|
var chassis = dmChassis.Chassis as BladeSwitch;
|
||||||
|
|
||||||
|
dmChassis.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
|
||||||
|
|
||||||
|
|
||||||
|
// Link up outputs
|
||||||
|
for (uint i = 1; i <= dmChassis.Chassis.NumberOfOutputs; i++) {
|
||||||
|
var ioSlot = i;
|
||||||
|
|
||||||
|
// Control
|
||||||
|
trilist.SetUShortSigAction(joinMap.OutputVideo + ioSlot, new Action<ushort>(o => dmChassis.ExecuteSwitch(o, ioSlot, eRoutingSignalType.Video)));
|
||||||
|
|
||||||
|
if (dmChassis.TxDictionary.ContainsKey(ioSlot)) {
|
||||||
|
Debug.Console(2, "Creating Tx Feedbacks {0}", ioSlot);
|
||||||
|
var txKey = dmChassis.TxDictionary[ioSlot];
|
||||||
|
var basicTxDevice = DeviceManager.GetDeviceForKey(txKey) as BasicDmTxControllerBase;
|
||||||
|
|
||||||
|
var advancedTxDevice = basicTxDevice as DmTxControllerBase;
|
||||||
|
|
||||||
|
if (dmChassis.Chassis is DmMd128x128 || dmChassis.Chassis is DmMd64x64) {
|
||||||
|
dmChassis.InputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.InputEndpointOnline + ioSlot]);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (advancedTxDevice != null) {
|
||||||
|
advancedTxDevice.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.InputEndpointOnline + ioSlot]);
|
||||||
|
Debug.Console(2, "Linking Tx Online Feedback from Advanced Transmitter at input {0}", ioSlot);
|
||||||
|
}
|
||||||
|
else if (dmChassis.InputEndpointOnlineFeedbacks[ioSlot] != null) {
|
||||||
|
Debug.Console(2, "Linking Tx Online Feedback from Input Card {0}", ioSlot);
|
||||||
|
dmChassis.InputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.InputEndpointOnline + ioSlot]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (basicTxDevice != null && advancedTxDevice == null)
|
||||||
|
trilist.BooleanInput[joinMap.TxAdvancedIsPresent + ioSlot].BoolValue = true;
|
||||||
|
|
||||||
|
if (advancedTxDevice != null) {
|
||||||
|
advancedTxDevice.AnyVideoInput.VideoStatus.VideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.VideoSyncStatus + ioSlot]);
|
||||||
|
}
|
||||||
|
else if (advancedTxDevice == null || basicTxDevice != null) {
|
||||||
|
Debug.Console(1, "Setting up actions and feedbacks on input card {0}", ioSlot);
|
||||||
|
dmChassis.VideoInputSyncFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.VideoSyncStatus + ioSlot]);
|
||||||
|
|
||||||
|
var inputPort = dmChassis.InputPorts[string.Format("inputCard{0}--hdmiIn", ioSlot)];
|
||||||
|
if (inputPort != null) {
|
||||||
|
Debug.Console(1, "Port value for input card {0} is set", ioSlot);
|
||||||
|
var port = inputPort.Port;
|
||||||
|
|
||||||
|
if (port != null) {
|
||||||
|
if (port is HdmiInputWithCEC) {
|
||||||
|
Debug.Console(1, "Port is HdmiInputWithCec");
|
||||||
|
|
||||||
|
var hdmiInPortWCec = port as HdmiInputWithCEC;
|
||||||
|
|
||||||
|
if (hdmiInPortWCec.HdcpSupportedLevel != eHdcpSupportedLevel.Unknown) {
|
||||||
|
SetHdcpStateAction(true, hdmiInPortWCec, joinMap.HdcpSupportState + ioSlot, trilist);
|
||||||
|
}
|
||||||
|
|
||||||
|
dmChassis.InputCardHdcpCapabilityFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.HdcpSupportState + ioSlot]);
|
||||||
|
|
||||||
|
if (dmChassis.InputCardHdcpCapabilityTypes.ContainsKey(ioSlot))
|
||||||
|
trilist.UShortInput[joinMap.HdcpSupportCapability + ioSlot].UShortValue = (ushort)dmChassis.InputCardHdcpCapabilityTypes[ioSlot];
|
||||||
|
else
|
||||||
|
trilist.UShortInput[joinMap.HdcpSupportCapability + ioSlot].UShortValue = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
inputPort = dmChassis.InputPorts[string.Format("inputCard{0}--dmIn", ioSlot)];
|
||||||
|
|
||||||
|
if (inputPort != null) {
|
||||||
|
var port = inputPort.Port;
|
||||||
|
|
||||||
|
if (port is DMInputPortWithCec) {
|
||||||
|
Debug.Console(1, "Port is DMInputPortWithCec");
|
||||||
|
|
||||||
|
var dmInPortWCec = port as DMInputPortWithCec;
|
||||||
|
|
||||||
|
if (dmInPortWCec != null) {
|
||||||
|
SetHdcpStateAction(dmChassis.PropertiesConfig.InputSlotSupportsHdcp2[ioSlot], dmInPortWCec, joinMap.HdcpSupportState + ioSlot, trilist);
|
||||||
|
}
|
||||||
|
|
||||||
|
dmChassis.InputCardHdcpCapabilityFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.HdcpSupportState + ioSlot]);
|
||||||
|
|
||||||
|
if (dmChassis.InputCardHdcpCapabilityTypes.ContainsKey(ioSlot))
|
||||||
|
trilist.UShortInput[joinMap.HdcpSupportCapability + ioSlot].UShortValue = (ushort)dmChassis.InputCardHdcpCapabilityTypes[ioSlot];
|
||||||
|
else
|
||||||
|
trilist.UShortInput[joinMap.HdcpSupportCapability + ioSlot].UShortValue = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
dmChassis.VideoInputSyncFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.VideoSyncStatus + ioSlot]);
|
||||||
|
|
||||||
|
var inputPort = dmChassis.InputPorts[string.Format("inputCard{0}--hdmiIn", ioSlot)];
|
||||||
|
if (inputPort != null) {
|
||||||
|
var hdmiPort = inputPort.Port as EndpointHdmiInput;
|
||||||
|
|
||||||
|
if (hdmiPort != null) {
|
||||||
|
SetHdcpStateAction(true, hdmiPort, joinMap.HdcpSupportState + ioSlot, trilist);
|
||||||
|
dmChassis.InputCardHdcpCapabilityFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.HdcpSupportState + ioSlot]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (dmChassis.RxDictionary.ContainsKey(ioSlot)) {
|
||||||
|
Debug.Console(2, "Creating Rx Feedbacks {0}", ioSlot);
|
||||||
|
//var rxKey = dmChassis.RxDictionary[ioSlot];
|
||||||
|
//var rxDevice = DeviceManager.GetDeviceForKey(rxKey) as DmRmcControllerBase;
|
||||||
|
//var hdBaseTDevice = DeviceManager.GetDeviceForKey(rxKey) as DmHdBaseTControllerBase;
|
||||||
|
//if (hdBaseTDevice != null) {
|
||||||
|
dmChassis.OutputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.OutputEndpointOnline + ioSlot]);
|
||||||
|
//}
|
||||||
|
//else if (rxDevice != null) {
|
||||||
|
// rxDevice.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.OutputEndpointOnline + ioSlot]);
|
||||||
|
//}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Feedback
|
||||||
|
dmChassis.VideoOutputFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.OutputVideo + ioSlot]);
|
||||||
|
|
||||||
|
|
||||||
|
dmChassis.OutputNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputNames + ioSlot]);
|
||||||
|
dmChassis.InputNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.InputNames + ioSlot]);
|
||||||
|
dmChassis.OutputVideoRouteNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputCurrentVideoInputNames + ioSlot]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void SetHdcpStateAction(bool hdcpTypeSimple, HdmiInputWithCEC port, uint join, BasicTriList trilist) {
|
||||||
|
if (hdcpTypeSimple) {
|
||||||
|
trilist.SetUShortSigAction(join,
|
||||||
|
new Action<ushort>(s => {
|
||||||
|
if (s == 0) {
|
||||||
|
port.HdcpSupportOff();
|
||||||
|
}
|
||||||
|
else if (s > 0) {
|
||||||
|
port.HdcpSupportOn();
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
trilist.SetUShortSigAction(join,
|
||||||
|
new Action<ushort>(u => {
|
||||||
|
port.HdcpReceiveCapability = (eHdcpCapabilityType)u;
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void SetHdcpStateAction(bool hdcpTypeSimple, EndpointHdmiInput port, uint join, BasicTriList trilist) {
|
||||||
|
if (hdcpTypeSimple) {
|
||||||
|
trilist.SetUShortSigAction(join,
|
||||||
|
new Action<ushort>(s => {
|
||||||
|
if (s == 0) {
|
||||||
|
port.HdcpSupportOff();
|
||||||
|
}
|
||||||
|
else if (s > 0) {
|
||||||
|
port.HdcpSupportOn();
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
trilist.SetUShortSigAction(join,
|
||||||
|
new Action<ushort>(u => {
|
||||||
|
port.HdcpCapability = (eHdcpCapabilityType)u;
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void SetHdcpStateAction(bool supportsHdcp2, DMInputPortWithCec port, uint join, BasicTriList trilist) {
|
||||||
|
if (!supportsHdcp2) {
|
||||||
|
trilist.SetUShortSigAction(join,
|
||||||
|
new Action<ushort>(s => {
|
||||||
|
if (s == 0) {
|
||||||
|
port.HdcpSupportOff();
|
||||||
|
}
|
||||||
|
else if (s > 0) {
|
||||||
|
port.HdcpSupportOn();
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
trilist.SetUShortSigAction(join,
|
||||||
|
new Action<ushort>(u => {
|
||||||
|
port.HdcpReceiveCapability = (eHdcpCapabilityType)u;
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -32,10 +32,12 @@ namespace PepperDash.Essentials.Bridges
|
|||||||
|
|
||||||
Debug.Console(1, dmChassis, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
Debug.Console(1, dmChassis, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
||||||
|
|
||||||
|
var chassis = dmChassis.Chassis as DmMDMnxn;
|
||||||
|
|
||||||
dmChassis.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
|
dmChassis.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
|
||||||
|
|
||||||
trilist.SetUShortSigAction(joinMap.SystemId, new Action<ushort>(o => dmChassis.Chassis.SystemId.UShortValue = o));
|
trilist.SetUShortSigAction(joinMap.SystemId, new Action<ushort>(o => chassis.SystemId.UShortValue = o));
|
||||||
trilist.SetSigTrueAction(joinMap.SystemId, new Action(() => dmChassis.Chassis.ApplySystemId()));
|
trilist.SetSigTrueAction(joinMap.SystemId, new Action(() => chassis.ApplySystemId()));
|
||||||
|
|
||||||
dmChassis.SystemIdFeebdack.LinkInputSig(trilist.UShortInput[joinMap.SystemId]);
|
dmChassis.SystemIdFeebdack.LinkInputSig(trilist.UShortInput[joinMap.SystemId]);
|
||||||
dmChassis.SystemIdBusyFeedback.LinkInputSig(trilist.BooleanInput[joinMap.SystemId]);
|
dmChassis.SystemIdBusyFeedback.LinkInputSig(trilist.BooleanInput[joinMap.SystemId]);
|
||||||
|
|||||||
@@ -0,0 +1,109 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using Crestron.SimplSharp;
|
||||||
|
using PepperDash.Essentials.Core;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Bridges {
|
||||||
|
public class DmBladeChassisControllerJoinMap : JoinMapBase {
|
||||||
|
#region Digital/Analogs
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Digitals
|
||||||
|
/// <summary>
|
||||||
|
/// High when device is online
|
||||||
|
/// </summary>
|
||||||
|
public uint IsOnline { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// Range reports video sync feedback for each input
|
||||||
|
/// </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; }
|
||||||
|
/// <summary>
|
||||||
|
/// Range reports high if corresponding input's transmitter supports bridging as a separate device for detailed AV switching, HDCP control, etc.
|
||||||
|
/// </summary>
|
||||||
|
public uint TxAdvancedIsPresent { get; set; } // indicates that there is an attached transmitter that should be bridged to be interacted with
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Analogs
|
||||||
|
/// <summary>
|
||||||
|
/// Range sets and reports the current video source for the corresponding output
|
||||||
|
/// </summary>
|
||||||
|
public uint OutputVideo { 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
|
||||||
|
/// <summary>
|
||||||
|
/// Range sets and reports the name for the corresponding input card
|
||||||
|
/// </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 current input resolution for each corresponding input card
|
||||||
|
/// </summary>
|
||||||
|
public uint InputCurrentResolution { get; set; }
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
public DmBladeChassisControllerJoinMap() {
|
||||||
|
//Digital/Analog
|
||||||
|
|
||||||
|
//Digital
|
||||||
|
IsOnline = 11;
|
||||||
|
VideoSyncStatus = 100; //101-299
|
||||||
|
InputEndpointOnline = 500; //501-699
|
||||||
|
OutputEndpointOnline = 700; //701-899
|
||||||
|
TxAdvancedIsPresent = 1000; //1001-1199
|
||||||
|
|
||||||
|
//Analog
|
||||||
|
OutputVideo = 100; //101-299
|
||||||
|
HdcpSupportState = 1000; //1001-1199
|
||||||
|
HdcpSupportCapability = 1200; //1201-1399
|
||||||
|
|
||||||
|
|
||||||
|
//Serial
|
||||||
|
InputNames = 100; //101-299
|
||||||
|
OutputNames = 300; //301-499
|
||||||
|
OutputCurrentVideoInputNames = 2000; //2001-2199
|
||||||
|
InputCurrentResolution = 2400; // 2401-2599
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void OffsetJoinNumbers(uint joinStart) {
|
||||||
|
var joinOffset = joinStart - 1;
|
||||||
|
|
||||||
|
IsOnline = IsOnline + joinOffset;
|
||||||
|
OutputVideo = OutputVideo + joinOffset;
|
||||||
|
VideoSyncStatus = VideoSyncStatus + joinOffset;
|
||||||
|
InputNames = InputNames + joinOffset;
|
||||||
|
OutputNames = OutputNames + joinOffset;
|
||||||
|
OutputCurrentVideoInputNames = OutputCurrentVideoInputNames + joinOffset;
|
||||||
|
InputCurrentResolution = InputCurrentResolution + joinOffset;
|
||||||
|
InputEndpointOnline = InputEndpointOnline + joinOffset;
|
||||||
|
OutputEndpointOnline = OutputEndpointOnline + joinOffset;
|
||||||
|
HdcpSupportState = HdcpSupportState + joinOffset;
|
||||||
|
HdcpSupportCapability = HdcpSupportCapability + joinOffset;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -17,6 +17,8 @@ using PepperDash.Essentials.Fusion;
|
|||||||
using PepperDash.Essentials.Room.Config;
|
using PepperDash.Essentials.Room.Config;
|
||||||
using PepperDash.Essentials.Room.MobileControl;
|
using PepperDash.Essentials.Room.MobileControl;
|
||||||
|
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace PepperDash.Essentials
|
namespace PepperDash.Essentials
|
||||||
{
|
{
|
||||||
public class ControlSystem : CrestronControlSystem
|
public class ControlSystem : CrestronControlSystem
|
||||||
@@ -372,21 +374,7 @@ namespace PepperDash.Essentials
|
|||||||
|
|
||||||
DeviceManager.AddDevice(new PepperDash.Essentials.Core.Devices.CrestronProcessor("processor"));
|
DeviceManager.AddDevice(new PepperDash.Essentials.Core.Devices.CrestronProcessor("processor"));
|
||||||
|
|
||||||
// Check if the processor is a DMPS model
|
|
||||||
if (this.ControllerPrompt.IndexOf("dmps", StringComparison.OrdinalIgnoreCase) > -1)
|
|
||||||
{
|
|
||||||
Debug.Console(2, "Adding DmpsRoutingController for {0} to Device Manager.", this.ControllerPrompt);
|
|
||||||
|
|
||||||
var dmpsRoutingController = DmpsRoutingController.GetDmpsRoutingController("processor-avRouting", this.ControllerPrompt, new DM.Config.DmpsRoutingPropertiesConfig());
|
|
||||||
|
|
||||||
DeviceManager.AddDevice(dmpsRoutingController);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Debug.Console(2, "************Processor is not DMPS type***************");
|
|
||||||
}
|
|
||||||
|
|
||||||
// Add global System Monitor device
|
// Add global System Monitor device
|
||||||
DeviceManager.AddDevice(new PepperDash.Essentials.Core.Monitoring.SystemMonitorController("systemMonitor"));
|
DeviceManager.AddDevice(new PepperDash.Essentials.Core.Monitoring.SystemMonitorController("systemMonitor"));
|
||||||
@@ -403,7 +391,26 @@ namespace PepperDash.Essentials
|
|||||||
if (devConf.Type.ToLower() != Global.ControlSystem.ControllerPrompt.ToLower())
|
if (devConf.Type.ToLower() != Global.ControlSystem.ControllerPrompt.ToLower())
|
||||||
Debug.Console(0,
|
Debug.Console(0,
|
||||||
"WARNING: Config file defines processor type as '{0}' but actual processor is '{1}'! Some ports may not be available",
|
"WARNING: Config file defines processor type as '{0}' but actual processor is '{1}'! Some ports may not be available",
|
||||||
devConf.Type.ToUpper(), Global.ControlSystem.ControllerPrompt.ToUpper());
|
devConf.Type.ToUpper(), Global.ControlSystem.ControllerPrompt.ToUpper());
|
||||||
|
|
||||||
|
// Check if the processor is a DMPS model
|
||||||
|
if (this.ControllerPrompt.IndexOf("dmps", StringComparison.OrdinalIgnoreCase) > -1)
|
||||||
|
{
|
||||||
|
Debug.Console(2, "Adding DmpsRoutingController for {0} to Device Manager.", this.ControllerPrompt);
|
||||||
|
|
||||||
|
var propertiesConfig = JsonConvert.DeserializeObject<DM.Config.DmpsRoutingPropertiesConfig>(devConf.Properties.ToString());
|
||||||
|
|
||||||
|
if(propertiesConfig == null)
|
||||||
|
propertiesConfig = new DM.Config.DmpsRoutingPropertiesConfig();
|
||||||
|
|
||||||
|
var dmpsRoutingController = DmpsRoutingController.GetDmpsRoutingController("processor-avRouting", this.ControllerPrompt, propertiesConfig);
|
||||||
|
|
||||||
|
DeviceManager.AddDevice(dmpsRoutingController);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Debug.Console(2, "************Processor is not DMPS type***************");
|
||||||
|
}
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -122,6 +122,8 @@
|
|||||||
<Compile Include="Bridges\BridgeFactory.cs" />
|
<Compile Include="Bridges\BridgeFactory.cs" />
|
||||||
<Compile Include="Bridges\CameraControllerBridge.cs" />
|
<Compile Include="Bridges\CameraControllerBridge.cs" />
|
||||||
<Compile Include="Bridges\AirMediaControllerBridge.cs" />
|
<Compile Include="Bridges\AirMediaControllerBridge.cs" />
|
||||||
|
<Compile Include="Bridges\DmBladeChassisControllerBridge.cs" />
|
||||||
|
<Compile Include="Bridges\JoinMaps\DmBladeChassisControllerJoinMap.cs" />
|
||||||
<Compile Include="Bridges\DmpsAudioOutputControllerBridge.cs" />
|
<Compile Include="Bridges\DmpsAudioOutputControllerBridge.cs" />
|
||||||
<Compile Include="Bridges\DmpsRoutingControllerBridge.cs" />
|
<Compile Include="Bridges\DmpsRoutingControllerBridge.cs" />
|
||||||
<Compile Include="Bridges\DisplayControllerBridge.cs" />
|
<Compile Include="Bridges\DisplayControllerBridge.cs" />
|
||||||
|
|||||||
@@ -0,0 +1,39 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using Crestron.SimplSharp;
|
||||||
|
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Core.Presets
|
||||||
|
{
|
||||||
|
public class PresetBase
|
||||||
|
{
|
||||||
|
[JsonProperty("id")]
|
||||||
|
public int ID { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// Used to store the name of the preset
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("description")]
|
||||||
|
public string Description { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// Indicates if the preset is defined(stored) in the codec
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("defined")]
|
||||||
|
public bool Defined { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// Indicates if the preset has the capability to be defined
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("isDefinable")]
|
||||||
|
public bool IsDefinable { get; set; }
|
||||||
|
|
||||||
|
public PresetBase(int id, string description, bool def, bool isDef)
|
||||||
|
{
|
||||||
|
ID = id;
|
||||||
|
Description = description;
|
||||||
|
Defined = def;
|
||||||
|
IsDefinable = isDef;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,586 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using Crestron.SimplSharp;
|
||||||
|
using Crestron.SimplSharpPro;
|
||||||
|
using Crestron.SimplSharpPro.DM;
|
||||||
|
using Crestron.SimplSharpPro.DM.Cards;
|
||||||
|
using Crestron.SimplSharpPro.DM.Blades;
|
||||||
|
using Crestron.SimplSharpPro.DM.Endpoints;
|
||||||
|
using Crestron.SimplSharpPro.DM.Endpoints.Receivers;
|
||||||
|
|
||||||
|
using PepperDash.Core;
|
||||||
|
using PepperDash.Essentials.Core;
|
||||||
|
|
||||||
|
using PepperDash.Essentials.DM.Config;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.DM {
|
||||||
|
/// <summary>
|
||||||
|
/// Builds a controller for basic DM-RMCs with Com and IR ports and no control functions
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public class DmBladeChassisController : CrestronGenericBaseDevice, IDmSwitch, IRoutingInputsOutputs, IRouting, IHasFeedback {
|
||||||
|
public DMChassisPropertiesConfig PropertiesConfig { get; set; }
|
||||||
|
|
||||||
|
public Switch Chassis { get; private set; }
|
||||||
|
|
||||||
|
// Feedbacks for EssentialDM
|
||||||
|
public Dictionary<uint, IntFeedback> VideoOutputFeedbacks { get; private set; }
|
||||||
|
public Dictionary<uint, IntFeedback> AudioOutputFeedbacks { get; private set; }
|
||||||
|
public Dictionary<uint, BoolFeedback> VideoInputSyncFeedbacks { get; private set; }
|
||||||
|
public Dictionary<uint, BoolFeedback> InputEndpointOnlineFeedbacks { get; private set; }
|
||||||
|
public Dictionary<uint, BoolFeedback> OutputEndpointOnlineFeedbacks { get; private set; }
|
||||||
|
public Dictionary<uint, StringFeedback> InputNameFeedbacks { get; private set; }
|
||||||
|
public Dictionary<uint, StringFeedback> OutputNameFeedbacks { get; private set; }
|
||||||
|
public Dictionary<uint, StringFeedback> OutputVideoRouteNameFeedbacks { get; private set; }
|
||||||
|
public Dictionary<uint, StringFeedback> OutputAudioRouteNameFeedbacks { get; private set; }
|
||||||
|
public Dictionary<uint, IntFeedback> UsbOutputRoutedToFeebacks { get; private set; }
|
||||||
|
public Dictionary<uint, IntFeedback> UsbInputRoutedToFeebacks { get; private set; }
|
||||||
|
|
||||||
|
public IntFeedback SystemIdFeebdack { get; private set; }
|
||||||
|
public BoolFeedback SystemIdBusyFeedback { get; private set; }
|
||||||
|
|
||||||
|
|
||||||
|
public Dictionary<uint, IntFeedback> InputCardHdcpCapabilityFeedbacks { get; private set; }
|
||||||
|
|
||||||
|
public Dictionary<uint, eHdcpCapabilityType> InputCardHdcpCapabilityTypes { get; private set; }
|
||||||
|
|
||||||
|
|
||||||
|
// Need a couple Lists of generic Backplane ports
|
||||||
|
public RoutingPortCollection<RoutingInputPort> InputPorts { get; private set; }
|
||||||
|
public RoutingPortCollection<RoutingOutputPort> OutputPorts { get; private set; }
|
||||||
|
|
||||||
|
public Dictionary<uint, string> TxDictionary { get; set; }
|
||||||
|
public Dictionary<uint, string> RxDictionary { get; set; }
|
||||||
|
|
||||||
|
//public Dictionary<uint, DmInputCardControllerBase> InputCards { get; private set; }
|
||||||
|
//public Dictionary<uint, DmSingleOutputCardControllerBase> OutputCards { get; private set; }
|
||||||
|
|
||||||
|
public Dictionary<uint, string> InputNames { get; set; }
|
||||||
|
public Dictionary<uint, string> OutputNames { get; set; }
|
||||||
|
public Dictionary<uint, DmCardAudioOutputController> VolumeControls { get; private set; }
|
||||||
|
|
||||||
|
public const int RouteOffTime = 500;
|
||||||
|
Dictionary<PortNumberType, CTimer> RouteOffTimers = new Dictionary<PortNumberType, CTimer>();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Factory method to create a new chassis controller from config data. Limited to 8x8 right now
|
||||||
|
/// </summary>
|
||||||
|
public static DmBladeChassisController GetDmChassisController(string key, string name,
|
||||||
|
string type, DMChassisPropertiesConfig properties) {
|
||||||
|
try {
|
||||||
|
type = type.ToLower();
|
||||||
|
uint ipid = properties.Control.IpIdInt;
|
||||||
|
|
||||||
|
BladeSwitch chassis = null;
|
||||||
|
if (type == "dmmd64x64") { chassis = new DmMd64x64(ipid, Global.ControlSystem); }
|
||||||
|
else if (type == "dmmd128x128") { chassis = new DmMd128x128(ipid, Global.ControlSystem); }
|
||||||
|
|
||||||
|
|
||||||
|
if (chassis == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
var controller = new DmBladeChassisController(key, name, chassis);
|
||||||
|
// add the cards and port names
|
||||||
|
foreach (var kvp in properties.InputSlots)
|
||||||
|
controller.AddInputBlade(kvp.Value, kvp.Key);
|
||||||
|
foreach (var kvp in properties.OutputSlots) {
|
||||||
|
controller.AddOutputBlade(kvp.Value, kvp.Key);
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (var kvp in properties.VolumeControls) {
|
||||||
|
// get the card
|
||||||
|
// check it for an audio-compatible type
|
||||||
|
// make a something-something that will make it work
|
||||||
|
// retire to mountain village
|
||||||
|
var outNum = kvp.Key;
|
||||||
|
|
||||||
|
var card = controller.Chassis.Outputs[outNum].Card;
|
||||||
|
Audio.Output audio = null;
|
||||||
|
if (card is DmHdmi4kOutputBladeCard)
|
||||||
|
audio = (card as DmHdmi4kOutputBladeCard).Hdmi4kOutput.Audio;
|
||||||
|
if (audio == null)
|
||||||
|
continue;
|
||||||
|
// wire up the audio to something here...
|
||||||
|
controller.AddVolumeControl(outNum, audio);
|
||||||
|
}
|
||||||
|
|
||||||
|
controller.InputNames = properties.InputNames;
|
||||||
|
controller.OutputNames = properties.OutputNames;
|
||||||
|
controller.PropertiesConfig = properties;
|
||||||
|
return controller;
|
||||||
|
}
|
||||||
|
catch (System.Exception e) {
|
||||||
|
Debug.Console(0, "Error creating DM chassis:\r{0}", e);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="key"></param>
|
||||||
|
/// <param name="name"></param>
|
||||||
|
/// <param name="chassis"></param>
|
||||||
|
public DmBladeChassisController(string key, string name, BladeSwitch chassis)
|
||||||
|
: base(key, name, chassis) {
|
||||||
|
Chassis = chassis;
|
||||||
|
InputPorts = new RoutingPortCollection<RoutingInputPort>();
|
||||||
|
OutputPorts = new RoutingPortCollection<RoutingOutputPort>();
|
||||||
|
VolumeControls = new Dictionary<uint, DmCardAudioOutputController>();
|
||||||
|
TxDictionary = new Dictionary<uint, string>();
|
||||||
|
RxDictionary = new Dictionary<uint, string>();
|
||||||
|
IsOnline.OutputChange += new EventHandler<FeedbackEventArgs>(IsOnline_OutputChange);
|
||||||
|
Chassis.DMInputChange += new DMInputEventHandler(Chassis_DMInputChange);
|
||||||
|
Chassis.DMOutputChange += new DMOutputEventHandler(Chassis_DMOutputChange);
|
||||||
|
VideoOutputFeedbacks = new Dictionary<uint, IntFeedback>();
|
||||||
|
UsbOutputRoutedToFeebacks = new Dictionary<uint, IntFeedback>();
|
||||||
|
UsbInputRoutedToFeebacks = new Dictionary<uint, IntFeedback>();
|
||||||
|
VideoInputSyncFeedbacks = new Dictionary<uint, BoolFeedback>();
|
||||||
|
InputNameFeedbacks = new Dictionary<uint, StringFeedback>();
|
||||||
|
OutputNameFeedbacks = new Dictionary<uint, StringFeedback>();
|
||||||
|
OutputVideoRouteNameFeedbacks = new Dictionary<uint, StringFeedback>();
|
||||||
|
OutputAudioRouteNameFeedbacks = new Dictionary<uint, StringFeedback>();
|
||||||
|
InputEndpointOnlineFeedbacks = new Dictionary<uint, BoolFeedback>();
|
||||||
|
OutputEndpointOnlineFeedbacks = new Dictionary<uint, BoolFeedback>();
|
||||||
|
|
||||||
|
InputCardHdcpCapabilityFeedbacks = new Dictionary<uint, IntFeedback>();
|
||||||
|
InputCardHdcpCapabilityTypes = new Dictionary<uint, eHdcpCapabilityType>();
|
||||||
|
|
||||||
|
for (uint x = 1; x <= Chassis.NumberOfOutputs; x++) {
|
||||||
|
var tempX = x;
|
||||||
|
|
||||||
|
if (Chassis.Outputs[tempX] != null) {
|
||||||
|
VideoOutputFeedbacks[tempX] = new IntFeedback(() => {
|
||||||
|
if (Chassis.Outputs[tempX].VideoOutFeedback != null) { return (ushort)Chassis.Outputs[tempX].VideoOutFeedback.Number; }
|
||||||
|
else { return 0; };
|
||||||
|
});
|
||||||
|
|
||||||
|
OutputNameFeedbacks[tempX] = new StringFeedback(() => {
|
||||||
|
if (Chassis.Outputs[tempX].NameFeedback != null) {
|
||||||
|
return Chassis.Outputs[tempX].NameFeedback.StringValue;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
});
|
||||||
|
OutputVideoRouteNameFeedbacks[tempX] = new StringFeedback(() => {
|
||||||
|
if (Chassis.Outputs[tempX].VideoOutFeedback != null) {
|
||||||
|
return Chassis.Outputs[tempX].VideoOutFeedback.NameFeedback.StringValue;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
OutputEndpointOnlineFeedbacks[tempX] = new BoolFeedback(() => {
|
||||||
|
//if (Chassis.Outputs[tempX].Endpoint != null)
|
||||||
|
// return Chassis.Outputs[tempX].Endpoint.IsOnline;
|
||||||
|
//else
|
||||||
|
return Chassis.Outputs[tempX].EndpointOnlineFeedback;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Chassis.Inputs[tempX] != null) {
|
||||||
|
UsbInputRoutedToFeebacks[tempX] = new IntFeedback(() => {
|
||||||
|
if (Chassis.Inputs[tempX].USBRoutedToFeedback != null) { return (ushort)Chassis.Inputs[tempX].USBRoutedToFeedback.Number; }
|
||||||
|
else { return 0; };
|
||||||
|
});
|
||||||
|
VideoInputSyncFeedbacks[tempX] = new BoolFeedback(() => {
|
||||||
|
if (Chassis.Inputs[tempX].VideoDetectedFeedback != null)
|
||||||
|
return Chassis.Inputs[tempX].VideoDetectedFeedback.BoolValue;
|
||||||
|
else
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
InputNameFeedbacks[tempX] = new StringFeedback(() => {
|
||||||
|
if (Chassis.Inputs[tempX].NameFeedback != null) {
|
||||||
|
return Chassis.Inputs[tempX].NameFeedback.StringValue;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
InputEndpointOnlineFeedbacks[tempX] = new BoolFeedback(() => {
|
||||||
|
return Chassis.Inputs[tempX].EndpointOnlineFeedback;
|
||||||
|
});
|
||||||
|
|
||||||
|
InputCardHdcpCapabilityFeedbacks[tempX] = new IntFeedback(() => {
|
||||||
|
var inputCard = Chassis.Inputs[tempX];
|
||||||
|
|
||||||
|
if (inputCard.Card is DmHdmi4kInputBladeCard) {
|
||||||
|
InputCardHdcpCapabilityTypes[tempX] = eHdcpCapabilityType.Hdcp2_2Support;
|
||||||
|
|
||||||
|
if ((inputCard.Card as DmHdmi4kInputBladeCard).Hdmi4kInput.HdcpSupportOnFeedback.BoolValue)
|
||||||
|
return 1;
|
||||||
|
else
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (inputCard.Card is DmC4kInputBladeCard) {
|
||||||
|
InputCardHdcpCapabilityTypes[tempX] = eHdcpCapabilityType.Hdcp2_2Support;
|
||||||
|
|
||||||
|
if ((inputCard.Card as DmC4kInputBladeCard).DmInput.HdcpCapabilityFeedback.Equals(eHdcpCapabilityType.HdcpSupportOff))
|
||||||
|
return 0;
|
||||||
|
else
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
else
|
||||||
|
return 0;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="type"></param>
|
||||||
|
/// <param name="number"></param>
|
||||||
|
public void AddInputBlade(string type, uint number) {
|
||||||
|
Debug.Console(2, this, "Adding input blade '{0}', slot {1}", type, number);
|
||||||
|
|
||||||
|
type = type.ToLower();
|
||||||
|
|
||||||
|
if (type == "dmb4kihd") {
|
||||||
|
var inputBlade = new Dmb4kIHd(number, this.Chassis);
|
||||||
|
foreach (var item in inputBlade.Inputs) {
|
||||||
|
var card = (item.Card as DmHdmi4kInputBladeCard).Hdmi4kInput;
|
||||||
|
var cecPort = card as ICec;
|
||||||
|
AddHdmiInBladePorts(item.Number, cecPort);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
else if (type == "dmb4kihddnt") {
|
||||||
|
var inputBlade = new Dmb4kIHd(number, this.Chassis);
|
||||||
|
foreach (var item in inputBlade.Inputs) {
|
||||||
|
var card = (item.Card as DmHdmi4kInputBladeCard).Hdmi4kInput;
|
||||||
|
var cecPort = card as ICec;
|
||||||
|
AddHdmiInBladePorts(item.Number, cecPort);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
else if (type == "dmb4kic") {
|
||||||
|
var inputBlade = new Dmb4kIC(number, this.Chassis);
|
||||||
|
foreach (var item in inputBlade.Inputs) {
|
||||||
|
AddDmInBladePorts(item.Number);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
else if (type == "dmbis") {
|
||||||
|
var inputBlade = new DmbIS(number, this.Chassis);
|
||||||
|
foreach (var item in inputBlade.Inputs) {
|
||||||
|
AddDmInMmFiberPorts(item.Number);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (type == "dmbis2") {
|
||||||
|
var inputBlade = new DmbIS2(number, this.Chassis);
|
||||||
|
foreach (var item in inputBlade.Inputs) {
|
||||||
|
AddDmInSmFiberPorts(item.Number);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void AddHdmiInBladePorts(uint number, ICec cecPort) {
|
||||||
|
AddInputPortWithDebug(number, "hdmiIn", eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.DmCat, cecPort);
|
||||||
|
}
|
||||||
|
|
||||||
|
void AddDmInBladePorts(uint number) {
|
||||||
|
AddInputPortWithDebug(number, "dmCIn", eRoutingSignalType.Video, eRoutingPortConnectionType.DmCat);
|
||||||
|
}
|
||||||
|
|
||||||
|
void AddDmInMmFiberPorts(uint number) {
|
||||||
|
AddInputPortWithDebug(number, "dmMmIn", eRoutingSignalType.Video, eRoutingPortConnectionType.DmMmFiber);
|
||||||
|
}
|
||||||
|
|
||||||
|
void AddDmInSmFiberPorts(uint number) {
|
||||||
|
AddInputPortWithDebug(number, "dmSmIn", eRoutingSignalType.Video, eRoutingPortConnectionType.DmSmFiber);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="type"></param>
|
||||||
|
/// <param name="number"></param>
|
||||||
|
public void AddOutputBlade(string type, uint number) {
|
||||||
|
type = type.ToLower();
|
||||||
|
|
||||||
|
Debug.Console(2, this, "Adding output blade '{0}', slot {1}", type, number);
|
||||||
|
if (type == "dmb4kohd") {
|
||||||
|
var outputBlade = new Dmb4KOHD(number, Chassis);
|
||||||
|
foreach (var item in outputBlade.Outputs) {
|
||||||
|
AddHdmiOutBladePorts(item.Number);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
else if (type == "dmb4kohddnt") {
|
||||||
|
var outputBlade = new Dmb4KOHD(number, Chassis);
|
||||||
|
foreach (var item in outputBlade.Outputs) {
|
||||||
|
AddHdmiOutBladePorts(item.Number);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
else if (type == "dmb4koc") {
|
||||||
|
var outputBlade = new Dmb4KOC(number, Chassis);
|
||||||
|
foreach (var item in outputBlade.Outputs) {
|
||||||
|
AddDmOutBladePorts(item.Number);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (type == "dmb4koc") {
|
||||||
|
var outputBlade = new Dmb4KOC(number, Chassis);
|
||||||
|
foreach (var item in outputBlade.Outputs) {
|
||||||
|
AddDmOutBladePorts(item.Number);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (type == "dmbos") {
|
||||||
|
var outputBlade = new DmbOS(number, Chassis);
|
||||||
|
foreach (var item in outputBlade.Outputs) {
|
||||||
|
AddDmOutMmFiberBladePorts(item.Number);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (type == "dmbos2") {
|
||||||
|
var outputBlade = new DmbOS2(number, Chassis);
|
||||||
|
foreach (var item in outputBlade.Outputs) {
|
||||||
|
AddDmOutSmFiberBladePorts(item.Number);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void AddHdmiOutBladePorts(uint number) {
|
||||||
|
AddOutputPortWithDebug(String.Format("outputBlade{0}", (number / 8 > 0 ? 1 : number / 8)), String.Format("hdmiOut{0}", number) , eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, number);
|
||||||
|
}
|
||||||
|
|
||||||
|
void AddDmOutBladePorts(uint number) {
|
||||||
|
AddOutputPortWithDebug(String.Format("outputBlade{0}", (number / 8 > 0 ? 1 : number / 8)), String.Format("dmOut{0}", number), eRoutingSignalType.Video, eRoutingPortConnectionType.DmCat, number);
|
||||||
|
}
|
||||||
|
|
||||||
|
void AddDmOutMmFiberBladePorts(uint number) {
|
||||||
|
AddOutputPortWithDebug(String.Format("outputBlade{0}", (number / 8 > 0 ? 1 : number / 8)), String.Format("dmOut{0}", number), eRoutingSignalType.Video, eRoutingPortConnectionType.DmMmFiber, number);
|
||||||
|
}
|
||||||
|
|
||||||
|
void AddDmOutSmFiberBladePorts(uint number) {
|
||||||
|
AddOutputPortWithDebug(String.Format("outputBlade{0}", (number / 8 > 0 ? 1 : number / 8)), String.Format("dmOut{0}", number), eRoutingSignalType.Video, eRoutingPortConnectionType.DmSmFiber, number);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Adds InputPort
|
||||||
|
/// </summary>
|
||||||
|
void AddInputPortWithDebug(uint cardNum, string portName, eRoutingSignalType sigType, eRoutingPortConnectionType portType) {
|
||||||
|
var portKey = string.Format("inputCard{0}--{1}", cardNum, portName);
|
||||||
|
Debug.Console(2, this, "Adding input port '{0}'", portKey);
|
||||||
|
var inputPort = new RoutingInputPort(portKey, sigType, portType, cardNum, this);
|
||||||
|
|
||||||
|
InputPorts.Add(inputPort);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Adds InputPort and sets Port as ICec object
|
||||||
|
/// </summary>
|
||||||
|
void AddInputPortWithDebug(uint cardNum, string portName, eRoutingSignalType sigType, eRoutingPortConnectionType portType, ICec cecPort) {
|
||||||
|
var portKey = string.Format("inputCard{0}--{1}", cardNum, portName);
|
||||||
|
Debug.Console(2, this, "Adding input port '{0}'", portKey);
|
||||||
|
var inputPort = new RoutingInputPort(portKey, sigType, portType, cardNum, this);
|
||||||
|
|
||||||
|
if (inputPort != null) {
|
||||||
|
if (cecPort != null)
|
||||||
|
inputPort.Port = cecPort;
|
||||||
|
|
||||||
|
InputPorts.Add(inputPort);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
Debug.Console(2, this, "inputPort is null");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Adds OutputPort
|
||||||
|
/// </summary>
|
||||||
|
void AddOutputPortWithDebug(string cardName, string portName, eRoutingSignalType sigType, eRoutingPortConnectionType portType, object selector) {
|
||||||
|
var portKey = string.Format("{0}--{1}", cardName, portName);
|
||||||
|
Debug.Console(2, this, "Adding output port '{0}'", portKey);
|
||||||
|
OutputPorts.Add(new RoutingOutputPort(portKey, sigType, portType, selector, this));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
void AddVolumeControl(uint number, Audio.Output audio) {
|
||||||
|
VolumeControls.Add(number, new DmCardAudioOutputController(audio));
|
||||||
|
}
|
||||||
|
|
||||||
|
//public void SetInputHdcpSupport(uint input, ePdtHdcpSupport hdcpSetting)
|
||||||
|
//{
|
||||||
|
|
||||||
|
//}
|
||||||
|
|
||||||
|
|
||||||
|
void Chassis_DMInputChange(Switch device, DMInputEventArgs args) {
|
||||||
|
|
||||||
|
switch (args.EventId) {
|
||||||
|
case DMInputEventIds.EndpointOnlineEventId: {
|
||||||
|
Debug.Console(2, this, "DM Input EndpointOnlineEventId for input: {0}. State: {1}", args.Number, device.Inputs[args.Number].EndpointOnlineFeedback);
|
||||||
|
InputEndpointOnlineFeedbacks[args.Number].FireUpdate();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case DMInputEventIds.OnlineFeedbackEventId: {
|
||||||
|
Debug.Console(2, this, "DM Input OnlineFeedbackEventId for input: {0}. State: {1}", args.Number, device.Inputs[args.Number].EndpointOnlineFeedback);
|
||||||
|
InputEndpointOnlineFeedbacks[args.Number].FireUpdate();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case DMInputEventIds.VideoDetectedEventId: {
|
||||||
|
Debug.Console(2, this, "DM Input {0} VideoDetectedEventId", args.Number);
|
||||||
|
VideoInputSyncFeedbacks[args.Number].FireUpdate();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case DMInputEventIds.InputNameEventId: {
|
||||||
|
Debug.Console(2, this, "DM Input {0} NameFeedbackEventId", args.Number);
|
||||||
|
InputNameFeedbacks[args.Number].FireUpdate();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case DMInputEventIds.HdcpCapabilityFeedbackEventId: {
|
||||||
|
Debug.Console(2, this, "DM Input {0} HdcpCapabilityFeedbackEventId", args.Number);
|
||||||
|
InputCardHdcpCapabilityFeedbacks[args.Number].FireUpdate();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default: {
|
||||||
|
Debug.Console(2, this, "DMInputChange fired for Input {0} with Unhandled EventId: {1}", args.Number, args.EventId);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
void Chassis_DMOutputChange(Switch device, DMOutputEventArgs args)
|
||||||
|
{
|
||||||
|
var output = args.Number;
|
||||||
|
|
||||||
|
switch (args.EventId) {
|
||||||
|
case DMOutputEventIds.VolumeEventId: {
|
||||||
|
if (VolumeControls.ContainsKey(output)) {
|
||||||
|
VolumeControls[args.Number].VolumeEventFromChassis();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case DMOutputEventIds.EndpointOnlineEventId: {
|
||||||
|
Debug.Console(2, this, "Output {0} DMOutputEventIds.EndpointOnlineEventId fired. EndpointOnlineFeedback State: {1}", args.Number, Chassis.Outputs[output].EndpointOnlineFeedback);
|
||||||
|
if(Chassis.Outputs[output].Endpoint != null)
|
||||||
|
Debug.Console(2, this, "Output {0} DMOutputEventIds.EndpointOnlineEventId fired. Endpoint.IsOnline State: {1}", args.Number, Chassis.Outputs[output].Endpoint.IsOnline);
|
||||||
|
|
||||||
|
OutputEndpointOnlineFeedbacks[output].FireUpdate();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case DMOutputEventIds.OnlineFeedbackEventId: {
|
||||||
|
Debug.Console(2, this, "Output {0} DMInputEventIds.OnlineFeedbackEventId fired. State: {1}", args.Number, Chassis.Outputs[output].EndpointOnlineFeedback);
|
||||||
|
OutputEndpointOnlineFeedbacks[output].FireUpdate();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case DMOutputEventIds.VideoOutEventId: {
|
||||||
|
if (Chassis.Outputs[output].VideoOutFeedback != null) {
|
||||||
|
Debug.Console(2, this, "DMSwitchVideo:{0} Routed Input:{1} Output:{2}'", this.Name, Chassis.Outputs[output].VideoOutFeedback.Number, output);
|
||||||
|
}
|
||||||
|
if (VideoOutputFeedbacks.ContainsKey(output)) {
|
||||||
|
VideoOutputFeedbacks[output].FireUpdate();
|
||||||
|
|
||||||
|
}
|
||||||
|
if (OutputVideoRouteNameFeedbacks.ContainsKey(output)) {
|
||||||
|
OutputVideoRouteNameFeedbacks[output].FireUpdate();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case DMOutputEventIds.OutputNameEventId: {
|
||||||
|
Debug.Console(2, this, "DM Output {0} NameFeedbackEventId", output);
|
||||||
|
OutputNameFeedbacks[output].FireUpdate();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default: {
|
||||||
|
Debug.Console(2, this, "DMOutputChange fired for Output {0} with Unhandled EventId: {1}", args.Number, args.EventId);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="pnt"></param>
|
||||||
|
void StartOffTimer(PortNumberType pnt) {
|
||||||
|
if (RouteOffTimers.ContainsKey(pnt))
|
||||||
|
return;
|
||||||
|
RouteOffTimers[pnt] = new CTimer(o => {
|
||||||
|
ExecuteSwitch(0, pnt.Number, pnt.Type);
|
||||||
|
}, RouteOffTime);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Send out sigs when coming online
|
||||||
|
void IsOnline_OutputChange(object sender, EventArgs e) {
|
||||||
|
if (IsOnline.BoolValue) {
|
||||||
|
Chassis.EnableUSBBreakaway.BoolValue = true;
|
||||||
|
|
||||||
|
if (InputNames != null)
|
||||||
|
foreach (var kvp in InputNames)
|
||||||
|
Chassis.Inputs[kvp.Key].Name.StringValue = kvp.Value;
|
||||||
|
if (OutputNames != null)
|
||||||
|
foreach (var kvp in OutputNames)
|
||||||
|
Chassis.Outputs[kvp.Key].Name.StringValue = kvp.Value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#region IRouting Members
|
||||||
|
|
||||||
|
public void ExecuteSwitch(object inputSelector, object outputSelector, eRoutingSignalType sigType) {
|
||||||
|
Debug.Console(2, this, "Making an awesome DM route from {0} to {1} {2}", inputSelector, outputSelector, sigType);
|
||||||
|
|
||||||
|
var input = Convert.ToUInt32(inputSelector); // Cast can sometimes fail
|
||||||
|
var output = Convert.ToUInt32(outputSelector);
|
||||||
|
// Check to see if there's an off timer waiting on this and if so, cancel
|
||||||
|
var key = new PortNumberType(output, sigType);
|
||||||
|
if (input == 0) {
|
||||||
|
StartOffTimer(key);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (RouteOffTimers.ContainsKey(key)) {
|
||||||
|
Debug.Console(2, this, "{0} cancelling route off due to new source", output);
|
||||||
|
RouteOffTimers[key].Stop();
|
||||||
|
RouteOffTimers.Remove(key);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
var inCard = input == 0 ? null : Chassis.Inputs[input];
|
||||||
|
var outCard = input == 0 ? null : Chassis.Outputs[output];
|
||||||
|
|
||||||
|
// NOTE THAT BITWISE COMPARISONS - TO CATCH ALL ROUTING TYPES
|
||||||
|
if ((sigType | eRoutingSignalType.Video) == eRoutingSignalType.Video) {
|
||||||
|
Chassis.VideoEnter.BoolValue = true;
|
||||||
|
Chassis.Outputs[output].VideoOut = inCard;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
public struct PortNumberType {
|
||||||
|
public uint Number { get; private set; }
|
||||||
|
public eRoutingSignalType Type { get; private set; }
|
||||||
|
|
||||||
|
public PortNumberType(uint number, eRoutingSignalType type)
|
||||||
|
: this() {
|
||||||
|
Number = number;
|
||||||
|
Type = type;
|
||||||
|
}
|
||||||
|
}*/
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -116,15 +116,25 @@ namespace PepperDash.Essentials.DM
|
|||||||
|
|
||||||
public override bool CustomActivate()
|
public override bool CustomActivate()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
// Set input and output names from config
|
// Set input and output names from config
|
||||||
if (InputNames != null)
|
if (InputNames != null)
|
||||||
|
{
|
||||||
foreach (var kvp in InputNames)
|
foreach (var kvp in InputNames)
|
||||||
(Dmps.SwitcherInputs[kvp.Key] as DMInput).Name.StringValue = kvp.Value;
|
{
|
||||||
|
var input = (Dmps.SwitcherInputs[kvp.Key] as DMInput);
|
||||||
|
if (input != null)
|
||||||
|
input.Name.StringValue = kvp.Value;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (OutputNames != null)
|
if (OutputNames != null)
|
||||||
|
{
|
||||||
foreach (var kvp in OutputNames)
|
foreach (var kvp in OutputNames)
|
||||||
(Dmps.SwitcherOutputs[kvp.Key] as Card.Dmps3OutputBase).Name.StringValue = kvp.Value;
|
{
|
||||||
|
var output = (Dmps.SwitcherOutputs[kvp.Key] as DMOutput);
|
||||||
|
if (output != null)
|
||||||
|
output.Name.StringValue = kvp.Value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Subscribe to events
|
// Subscribe to events
|
||||||
Dmps.DMInputChange += new DMInputEventHandler(Dmps_DMInputChange);
|
Dmps.DMInputChange += new DMInputEventHandler(Dmps_DMInputChange);
|
||||||
@@ -213,10 +223,10 @@ namespace PepperDash.Essentials.DM
|
|||||||
{
|
{
|
||||||
var inputCard = card as DMInput;
|
var inputCard = card as DMInput;
|
||||||
|
|
||||||
Debug.Console(1, this, "Adding Input Card Number {0} Type: {1}", inputCard.Number, inputCard.CardInputOutputType.ToString());
|
|
||||||
|
|
||||||
if (inputCard != null)
|
if (inputCard != null)
|
||||||
{
|
{
|
||||||
|
Debug.Console(1, this, "Adding Input Card Number {0} Type: {1}", inputCard.Number, inputCard.CardInputOutputType.ToString());
|
||||||
|
|
||||||
InputEndpointOnlineFeedbacks[inputCard.Number] = new BoolFeedback(() => { return inputCard.EndpointOnlineFeedback; });
|
InputEndpointOnlineFeedbacks[inputCard.Number] = new BoolFeedback(() => { return inputCard.EndpointOnlineFeedback; });
|
||||||
|
|
||||||
if (inputCard.VideoDetectedFeedback != null)
|
if (inputCard.VideoDetectedFeedback != null)
|
||||||
@@ -226,23 +236,28 @@ namespace PepperDash.Essentials.DM
|
|||||||
return inputCard.VideoDetectedFeedback.BoolValue;
|
return inputCard.VideoDetectedFeedback.BoolValue;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
InputNameFeedbacks[inputCard.Number] = new StringFeedback(() =>
|
InputNameFeedbacks[inputCard.Number] = new StringFeedback(() =>
|
||||||
{
|
{
|
||||||
if (inputCard.NameFeedback != null && !string.IsNullOrEmpty(inputCard.NameFeedback.StringValue))
|
if (inputCard.NameFeedback != null && !string.IsNullOrEmpty(inputCard.NameFeedback.StringValue))
|
||||||
{
|
{
|
||||||
Debug.Console(2, this, "Input Card {0} Name: {1}", inputCard.Number, inputCard.NameFeedback.StringValue);
|
Debug.Console(2, this, "Input Card {0} Name: {1}", inputCard.Number, inputCard.NameFeedback.StringValue);
|
||||||
return inputCard.NameFeedback.StringValue;
|
return inputCard.NameFeedback.StringValue;
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Debug.Console(2, this, "Input Card {0} Name is null", inputCard.Number, inputCard.NameFeedback.StringValue);
|
Debug.Console(2, this, "Input Card {0} Name is null", inputCard.Number);
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
|
||||||
|
|
||||||
AddInputCard(inputCard.Number, inputCard);
|
AddInputCard(inputCard.Number, inputCard);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Debug.Console(2, this, "***********Input Card of type {0} is cannot be cast as DMInput*************", card.CardInputOutputType);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -255,7 +270,7 @@ namespace PepperDash.Essentials.DM
|
|||||||
{
|
{
|
||||||
if (inputCard is Card.Dmps3HdmiInputWithoutAnalogAudio)
|
if (inputCard is Card.Dmps3HdmiInputWithoutAnalogAudio)
|
||||||
{
|
{
|
||||||
var hdmiInputCard = inputCard as Card.Dmps3HdmiInput;
|
var hdmiInputCard = inputCard as Card.Dmps3HdmiInputWithoutAnalogAudio;
|
||||||
|
|
||||||
var cecPort = hdmiInputCard.HdmiInputPort;
|
var cecPort = hdmiInputCard.HdmiInputPort;
|
||||||
|
|
||||||
@@ -272,8 +287,6 @@ namespace PepperDash.Essentials.DM
|
|||||||
}
|
}
|
||||||
else if (inputCard is Card.Dmps3HdmiVgaInput)
|
else if (inputCard is Card.Dmps3HdmiVgaInput)
|
||||||
{
|
{
|
||||||
// TODO: Build a virtual TX device and assign the ports to it
|
|
||||||
|
|
||||||
var hdmiVgaInputCard = inputCard as Card.Dmps3HdmiVgaInput;
|
var hdmiVgaInputCard = inputCard as Card.Dmps3HdmiVgaInput;
|
||||||
|
|
||||||
DmpsInternalVirtualHdmiVgaInputController inputCardController = new DmpsInternalVirtualHdmiVgaInputController(Key +
|
DmpsInternalVirtualHdmiVgaInputController inputCardController = new DmpsInternalVirtualHdmiVgaInputController(Key +
|
||||||
@@ -285,8 +298,6 @@ namespace PepperDash.Essentials.DM
|
|||||||
}
|
}
|
||||||
else if (inputCard is Card.Dmps3HdmiVgaBncInput)
|
else if (inputCard is Card.Dmps3HdmiVgaBncInput)
|
||||||
{
|
{
|
||||||
// TODO: Build a virtual TX device and assign the ports to it
|
|
||||||
|
|
||||||
var hdmiVgaBncInputCard = inputCard as Card.Dmps3HdmiVgaBncInput;
|
var hdmiVgaBncInputCard = inputCard as Card.Dmps3HdmiVgaBncInput;
|
||||||
|
|
||||||
DmpsInternalVirtualHdmiVgaBncInputController inputCardController = new DmpsInternalVirtualHdmiVgaBncInputController(Key +
|
DmpsInternalVirtualHdmiVgaBncInputController inputCardController = new DmpsInternalVirtualHdmiVgaBncInputController(Key +
|
||||||
@@ -309,8 +320,6 @@ namespace PepperDash.Essentials.DM
|
|||||||
{
|
{
|
||||||
var airMediaInputCard = inputCard as Card.Dmps3AirMediaInput;
|
var airMediaInputCard = inputCard as Card.Dmps3AirMediaInput;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
AddInputPortWithDebug(number, string.Format("AirMediaIn{0}", number), eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Streaming);
|
AddInputPortWithDebug(number, string.Format("AirMediaIn{0}", number), eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Streaming);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -630,41 +639,41 @@ namespace PepperDash.Essentials.DM
|
|||||||
}
|
}
|
||||||
|
|
||||||
DMInput inCard = input == 0 ? null : Dmps.SwitcherInputs[input] as DMInput;
|
DMInput inCard = input == 0 ? null : Dmps.SwitcherInputs[input] as DMInput;
|
||||||
Card.Dmps3OutputBase outCard = output == 0 ? null : Dmps.SwitcherOutputs[output] as Card.Dmps3OutputBase;
|
DMOutput outCard = output == 0 ? null : Dmps.SwitcherOutputs[output] as DMOutput;
|
||||||
|
|
||||||
if (inCard != null)
|
//if (inCard != null)
|
||||||
{
|
//{
|
||||||
// NOTE THAT BITWISE COMPARISONS - TO CATCH ALL ROUTING TYPES
|
// NOTE THAT BITWISE COMPARISONS - TO CATCH ALL ROUTING TYPES
|
||||||
if ((sigType | eRoutingSignalType.Video) == eRoutingSignalType.Video)
|
if ((sigType | eRoutingSignalType.Video) == eRoutingSignalType.Video)
|
||||||
{
|
{
|
||||||
|
|
||||||
//SystemControl.VideoEnter.BoolValue = true;
|
//SystemControl.VideoEnter.BoolValue = true;
|
||||||
if (outCard != null && outCard.VideoOut != null)
|
if (outCard != null)
|
||||||
outCard.VideoOut = inCard;
|
outCard.VideoOut = inCard;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((sigType | eRoutingSignalType.Audio) == eRoutingSignalType.Audio)
|
if ((sigType | eRoutingSignalType.Audio) == eRoutingSignalType.Audio)
|
||||||
{
|
{
|
||||||
if (outCard != null && outCard.AudioOut != null)
|
if (outCard != null)
|
||||||
outCard.AudioOut = inCard;
|
outCard.AudioOut = inCard;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((sigType | eRoutingSignalType.UsbOutput) == eRoutingSignalType.UsbOutput)
|
if ((sigType | eRoutingSignalType.UsbOutput) == eRoutingSignalType.UsbOutput)
|
||||||
{
|
{
|
||||||
if (outCard != null && outCard.USBRoutedTo != null)
|
if (outCard != null)
|
||||||
outCard.USBRoutedTo = inCard;
|
outCard.USBRoutedTo = inCard;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((sigType | eRoutingSignalType.UsbInput) == eRoutingSignalType.UsbInput)
|
if ((sigType | eRoutingSignalType.UsbInput) == eRoutingSignalType.UsbInput)
|
||||||
{
|
{
|
||||||
if (inCard != null && inCard.USBRoutedTo != null)
|
if (inCard != null)
|
||||||
inCard.USBRoutedTo = outCard;
|
inCard.USBRoutedTo = outCard;
|
||||||
}
|
}
|
||||||
}
|
//}
|
||||||
else
|
//else
|
||||||
{
|
//{
|
||||||
Debug.Console(1, this, "Unable to execute route from input {0} to output {1}. Input card not available", inputSelector, outputSelector);
|
// Debug.Console(1, this, "Unable to execute route from input {0} to output {1}. Input card not available", inputSelector, outputSelector);
|
||||||
}
|
//}
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -1,97 +1,99 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
using Crestron.SimplSharp.CrestronIO;
|
using Crestron.SimplSharp.CrestronIO;
|
||||||
using Crestron.SimplSharpPro;
|
using Crestron.SimplSharpPro;
|
||||||
using Crestron.SimplSharpPro.DM;
|
using Crestron.SimplSharpPro.DM;
|
||||||
using Crestron.SimplSharpPro.DM.AirMedia;
|
using Crestron.SimplSharpPro.DM.AirMedia;
|
||||||
using Crestron.SimplSharpPro.UI;
|
using Crestron.SimplSharpPro.UI;
|
||||||
|
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
using PepperDash.Essentials.Core.Config;
|
using PepperDash.Essentials.Core.Config;
|
||||||
using PepperDash.Essentials.DM.AirMedia;
|
using PepperDash.Essentials.DM.AirMedia;
|
||||||
using PepperDash.Essentials.DM.Endpoints.DGEs;
|
using PepperDash.Essentials.DM.Endpoints.DGEs;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.DM
|
namespace PepperDash.Essentials.DM
|
||||||
{
|
{
|
||||||
public class DeviceFactory
|
public class DeviceFactory
|
||||||
{
|
{
|
||||||
public static IKeyed GetDevice(DeviceConfig dc)
|
public static IKeyed GetDevice(DeviceConfig dc)
|
||||||
{
|
{
|
||||||
var key = dc.Key;
|
var key = dc.Key;
|
||||||
var name = dc.Name;
|
var name = dc.Name;
|
||||||
var type = dc.Type;
|
var type = dc.Type;
|
||||||
var properties = dc.Properties;
|
var properties = dc.Properties;
|
||||||
|
|
||||||
var typeName = dc.Type.ToLower();
|
var typeName = dc.Type.ToLower();
|
||||||
|
|
||||||
if (typeName.StartsWith("am"))
|
if (typeName.StartsWith("am"))
|
||||||
{
|
{
|
||||||
var props = JsonConvert.DeserializeObject<AirMediaPropertiesConfig>(properties.ToString());
|
var props = JsonConvert.DeserializeObject<AirMediaPropertiesConfig>(properties.ToString());
|
||||||
AmX00 amDevice = null;
|
AmX00 amDevice = null;
|
||||||
if (typeName == "am200")
|
if (typeName == "am200")
|
||||||
amDevice = new Crestron.SimplSharpPro.DM.AirMedia.Am200(props.Control.IpIdInt, Global.ControlSystem);
|
amDevice = new Crestron.SimplSharpPro.DM.AirMedia.Am200(props.Control.IpIdInt, Global.ControlSystem);
|
||||||
else if(typeName == "am300")
|
else if(typeName == "am300")
|
||||||
amDevice = new Crestron.SimplSharpPro.DM.AirMedia.Am300(props.Control.IpIdInt, Global.ControlSystem);
|
amDevice = new Crestron.SimplSharpPro.DM.AirMedia.Am300(props.Control.IpIdInt, Global.ControlSystem);
|
||||||
|
|
||||||
return new AirMediaController(key, name, amDevice, dc, props);
|
return new AirMediaController(key, name, amDevice, dc, props);
|
||||||
}
|
}
|
||||||
else if (typeName.StartsWith("dmmd8x") || typeName.StartsWith("dmmd16x") || typeName.StartsWith("dmmd32x"))
|
else if (typeName.StartsWith("dmmd8x") || typeName.StartsWith("dmmd16x") || typeName.StartsWith("dmmd32x"))
|
||||||
{
|
{
|
||||||
var props = JsonConvert.DeserializeObject
|
var props = JsonConvert.DeserializeObject
|
||||||
<PepperDash.Essentials.DM.Config.DMChassisPropertiesConfig>(properties.ToString());
|
<PepperDash.Essentials.DM.Config.DMChassisPropertiesConfig>(properties.ToString());
|
||||||
return PepperDash.Essentials.DM.DmChassisController.
|
return PepperDash.Essentials.DM.DmChassisController.
|
||||||
GetDmChassisController(key, name, type, props);
|
GetDmChassisController(key, name, type, props);
|
||||||
}
|
}
|
||||||
// Hand off to DmTxHelper class
|
else if (typeName.StartsWith("dmmd128x") || typeName.StartsWith("dmmd64x")) {
|
||||||
else if (typeName.StartsWith("dmtx"))
|
var props = JsonConvert.DeserializeObject
|
||||||
{
|
<PepperDash.Essentials.DM.Config.DMChassisPropertiesConfig>(properties.ToString());
|
||||||
var props = JsonConvert.DeserializeObject
|
return PepperDash.Essentials.DM.DmBladeChassisController.
|
||||||
<PepperDash.Essentials.DM.Config.DmTxPropertiesConfig>(properties.ToString());
|
GetDmChassisController(key, name, type, props);
|
||||||
return PepperDash.Essentials.DM.DmTxHelper.GetDmTxController(key, name, type, props);
|
}
|
||||||
}
|
// Hand off to DmTxHelper class
|
||||||
|
else if (typeName.StartsWith("dmtx")) {
|
||||||
// Hand off to DmRmcHelper class
|
var props = JsonConvert.DeserializeObject
|
||||||
else if (typeName.StartsWith("dmrmc"))
|
<PepperDash.Essentials.DM.Config.DmTxPropertiesConfig>(properties.ToString());
|
||||||
{
|
return PepperDash.Essentials.DM.DmTxHelper.GetDmTxController(key, name, type, props);
|
||||||
var props = JsonConvert.DeserializeObject
|
}
|
||||||
<PepperDash.Essentials.DM.Config.DmRmcPropertiesConfig>(properties.ToString());
|
|
||||||
return PepperDash.Essentials.DM.DmRmcHelper.GetDmRmcController(key, name, type, props);
|
// Hand off to DmRmcHelper class
|
||||||
}
|
else if (typeName.StartsWith("dmrmc")) {
|
||||||
|
var props = JsonConvert.DeserializeObject
|
||||||
else if (typeName.Equals("hdmd4x14ke"))
|
<PepperDash.Essentials.DM.Config.DmRmcPropertiesConfig>(properties.ToString());
|
||||||
{
|
return PepperDash.Essentials.DM.DmRmcHelper.GetDmRmcController(key, name, type, props);
|
||||||
var props = JsonConvert.DeserializeObject
|
}
|
||||||
<PepperDash.Essentials.DM.Config.HdMdNxM4kEPropertiesConfig>(properties.ToString());
|
|
||||||
return PepperDash.Essentials.DM.Chassis.HdMdNxM4kEController.GetController(key, name, type, props);
|
else if (typeName.Equals("hdmd4x14ke")) {
|
||||||
}
|
var props = JsonConvert.DeserializeObject
|
||||||
|
<PepperDash.Essentials.DM.Config.HdMdNxM4kEPropertiesConfig>(properties.ToString());
|
||||||
else if (typeName.Equals("hdmd400ce") || typeName.Equals("hdmd300ce") || typeName.Equals("hdmd200ce") || typeName.Equals("hdmd200c1ge"))
|
return PepperDash.Essentials.DM.Chassis.HdMdNxM4kEController.GetController(key, name, type, props);
|
||||||
{
|
}
|
||||||
var props = JsonConvert.DeserializeObject
|
|
||||||
<PepperDash.Essentials.DM.HdMdxxxCEPropertiesConfig>(properties.ToString());
|
else if (typeName.Equals("hdmd400ce") || typeName.Equals("hdmd300ce") || typeName.Equals("hdmd200ce") || typeName.Equals("hdmd200c1ge")) {
|
||||||
|
var props = JsonConvert.DeserializeObject
|
||||||
if (typeName.Equals("hdmd400ce"))
|
<PepperDash.Essentials.DM.HdMdxxxCEPropertiesConfig>(properties.ToString());
|
||||||
return new PepperDash.Essentials.DM.HdMdxxxCEController(key, name,
|
|
||||||
new HdMd400CE(props.Control.IpIdInt, props.Control.TcpSshProperties.Address, Global.ControlSystem));
|
if (typeName.Equals("hdmd400ce"))
|
||||||
else if (typeName.Equals("hdmd300ce"))
|
return new PepperDash.Essentials.DM.HdMdxxxCEController(key, name,
|
||||||
return new PepperDash.Essentials.DM.HdMdxxxCEController(key, name,
|
new HdMd400CE(props.Control.IpIdInt, props.Control.TcpSshProperties.Address, Global.ControlSystem));
|
||||||
new HdMd300CE(props.Control.IpIdInt, props.Control.TcpSshProperties.Address, Global.ControlSystem));
|
else if (typeName.Equals("hdmd300ce"))
|
||||||
else if (typeName.Equals("hdmd200ce"))
|
return new PepperDash.Essentials.DM.HdMdxxxCEController(key, name,
|
||||||
return new PepperDash.Essentials.DM.HdMdxxxCEController(key, name,
|
new HdMd300CE(props.Control.IpIdInt, props.Control.TcpSshProperties.Address, Global.ControlSystem));
|
||||||
new HdMd200CE(props.Control.IpIdInt, props.Control.TcpSshProperties.Address, Global.ControlSystem));
|
else if (typeName.Equals("hdmd200ce"))
|
||||||
else if (typeName.Equals("hdmd200c1ge"))
|
return new PepperDash.Essentials.DM.HdMdxxxCEController(key, name,
|
||||||
return new PepperDash.Essentials.DM.HdMdxxxCEController(key, name,
|
new HdMd200CE(props.Control.IpIdInt, props.Control.TcpSshProperties.Address, Global.ControlSystem));
|
||||||
new HdMd200C1GE(props.Control.IpIdInt, props.Control.TcpSshProperties.Address, Global.ControlSystem));
|
else if (typeName.Equals("hdmd200c1ge"))
|
||||||
}
|
return new PepperDash.Essentials.DM.HdMdxxxCEController(key, name,
|
||||||
|
new HdMd200C1GE(props.Control.IpIdInt, props.Control.TcpSshProperties.Address, Global.ControlSystem));
|
||||||
return null;
|
}
|
||||||
}
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,256 +1,257 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
using Crestron.SimplSharpPro;
|
using Crestron.SimplSharpPro;
|
||||||
using Crestron.SimplSharpPro.DeviceSupport;
|
using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
using Crestron.SimplSharpPro.DM;
|
using Crestron.SimplSharpPro.DM;
|
||||||
using Crestron.SimplSharpPro.DM.Endpoints;
|
using Crestron.SimplSharpPro.DM.Endpoints;
|
||||||
using Crestron.SimplSharpPro.DM.Endpoints.Receivers;
|
using Crestron.SimplSharpPro.DM.Endpoints.Receivers;
|
||||||
|
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
using PepperDash.Essentials.DM.Config;
|
using PepperDash.Essentials.DM.Config;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.DM
|
namespace PepperDash.Essentials.DM
|
||||||
{
|
{
|
||||||
public abstract class DmRmcControllerBase : CrestronGenericBaseDevice
|
public abstract class DmRmcControllerBase : CrestronGenericBaseDevice
|
||||||
{
|
{
|
||||||
public virtual StringFeedback VideoOutputResolutionFeedback { get; protected set; }
|
public virtual StringFeedback VideoOutputResolutionFeedback { get; protected set; }
|
||||||
public virtual StringFeedback EdidManufacturerFeedback { get; protected set; }
|
public virtual StringFeedback EdidManufacturerFeedback { get; protected set; }
|
||||||
public virtual StringFeedback EdidNameFeedback { get; protected set; }
|
public virtual StringFeedback EdidNameFeedback { get; protected set; }
|
||||||
public virtual StringFeedback EdidPreferredTimingFeedback { get; protected set; }
|
public virtual StringFeedback EdidPreferredTimingFeedback { get; protected set; }
|
||||||
public virtual StringFeedback EdidSerialNumberFeedback { get; protected set; }
|
public virtual StringFeedback EdidSerialNumberFeedback { get; protected set; }
|
||||||
|
|
||||||
public DmRmcControllerBase(string key, string name, EndpointReceiverBase device)
|
public DmRmcControllerBase(string key, string name, EndpointReceiverBase device)
|
||||||
: base(key, name, device)
|
: base(key, name, device)
|
||||||
{
|
{
|
||||||
// if wired to a chassis, skip registration step in base class
|
// if wired to a chassis, skip registration step in base class
|
||||||
if (device.DMOutput != null)
|
if (device.DMOutput != null)
|
||||||
{
|
{
|
||||||
this.PreventRegistration = true;
|
this.PreventRegistration = true;
|
||||||
}
|
}
|
||||||
AddToFeedbackList(VideoOutputResolutionFeedback, EdidManufacturerFeedback, EdidSerialNumberFeedback, EdidNameFeedback, EdidPreferredTimingFeedback);
|
AddToFeedbackList(VideoOutputResolutionFeedback, EdidManufacturerFeedback, EdidSerialNumberFeedback, EdidNameFeedback, EdidPreferredTimingFeedback);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract class DmHdBaseTControllerBase : CrestronGenericBaseDevice
|
public abstract class DmHdBaseTControllerBase : CrestronGenericBaseDevice
|
||||||
{
|
{
|
||||||
public HDBaseTBase Rmc { get; protected set; }
|
public HDBaseTBase Rmc { get; protected set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Make a Crestron RMC and put it in here
|
/// Make a Crestron RMC and put it in here
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public DmHdBaseTControllerBase(string key, string name, HDBaseTBase rmc)
|
public DmHdBaseTControllerBase(string key, string name, HDBaseTBase rmc)
|
||||||
: base(key, name, rmc)
|
: base(key, name, rmc)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class DmRmcHelper
|
public class DmRmcHelper
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A factory method for various DmTxControllers
|
/// A factory method for various DmTxControllers
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="key"></param>
|
/// <param name="key"></param>
|
||||||
/// <param name="name"></param>
|
/// <param name="name"></param>
|
||||||
/// <param name="props"></param>
|
/// <param name="props"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static CrestronGenericBaseDevice GetDmRmcController(string key, string name, string typeName, DmRmcPropertiesConfig props)
|
public static CrestronGenericBaseDevice GetDmRmcController(string key, string name, string typeName, DmRmcPropertiesConfig props)
|
||||||
{
|
{
|
||||||
// switch on type name... later...
|
// switch on type name... later...
|
||||||
|
|
||||||
typeName = typeName.ToLower();
|
typeName = typeName.ToLower();
|
||||||
uint ipid = props.Control.IpIdInt; // Convert.ToUInt16(props.Id, 16);
|
uint ipid = props.Control.IpIdInt; // Convert.ToUInt16(props.Id, 16);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// right here, we need to grab the tie line that associates this
|
// right here, we need to grab the tie line that associates this
|
||||||
// RMC with a chassis or processor. If the RMC input's tie line is not
|
// RMC with a chassis or processor. If the RMC input's tie line is not
|
||||||
// connected to a chassis, then it's parent is the processor.
|
// connected to a chassis, then it's parent is the processor.
|
||||||
// If the RMC is connected to a chassis, then we need to grab the
|
// If the RMC is connected to a chassis, then we need to grab the
|
||||||
// output number from the tie line and use that to plug it in.
|
// output number from the tie line and use that to plug it in.
|
||||||
// Example of chassis-connected:
|
// Example of chassis-connected:
|
||||||
//{
|
//{
|
||||||
// "sourceKey": "dmMd8x8-1",
|
// "sourceKey": "dmMd8x8-1",
|
||||||
// "sourcePort": "anyOut2",
|
// "sourcePort": "anyOut2",
|
||||||
// "destinationKey": "dmRmc100C-2",
|
// "destinationKey": "dmRmc100C-2",
|
||||||
// "destinationPort": "DmIn"
|
// "destinationPort": "DmIn"
|
||||||
//}
|
//}
|
||||||
|
|
||||||
// Tx -> RMC link:
|
// Tx -> RMC link:
|
||||||
//{
|
//{
|
||||||
// "sourceKey": "dmTx201C-1",
|
// "sourceKey": "dmTx201C-1",
|
||||||
// "sourcePort": "DmOut",
|
// "sourcePort": "DmOut",
|
||||||
// "destinationKey": "dmRmc100C-2",
|
// "destinationKey": "dmRmc100C-2",
|
||||||
// "destinationPort": "DmIn"
|
// "destinationPort": "DmIn"
|
||||||
//}
|
//}
|
||||||
|
|
||||||
var tlc = TieLineCollection.Default;
|
var tlc = TieLineCollection.Default;
|
||||||
// grab the tie line that has this key as
|
// grab the tie line that has this key as
|
||||||
// THIS DOESN'T WORK BECAUSE THE RMC THAT WE NEED (THIS) HASN'T BEEN MADE
|
// THIS DOESN'T WORK BECAUSE THE RMC THAT WE NEED (THIS) HASN'T BEEN MADE
|
||||||
// YET AND THUS WILL NOT HAVE A TIE LINE...
|
// YET AND THUS WILL NOT HAVE A TIE LINE...
|
||||||
var inputTieLine = tlc.FirstOrDefault(t =>
|
var inputTieLine = tlc.FirstOrDefault(t =>
|
||||||
{
|
{
|
||||||
var d = t.DestinationPort.ParentDevice;
|
var d = t.DestinationPort.ParentDevice;
|
||||||
return d.Key.Equals(key, StringComparison.OrdinalIgnoreCase)
|
return d.Key.Equals(key, StringComparison.OrdinalIgnoreCase)
|
||||||
&& d is DmChassisController;
|
&& d is DmChassisController;
|
||||||
});
|
});
|
||||||
|
|
||||||
var pKey = props.ParentDeviceKey.ToLower();
|
var pKey = props.ParentDeviceKey.ToLower();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Non-DM-chassis endpoints
|
// Non-DM-chassis endpoints
|
||||||
if (pKey == "processor")
|
if (pKey == "processor")
|
||||||
{
|
{
|
||||||
// Catch constructor failures, mainly dues to IPID
|
// Catch constructor failures, mainly dues to IPID
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (typeName.StartsWith("dmrmc100c"))
|
if (typeName.StartsWith("dmrmc100c"))
|
||||||
return new DmRmcX100CController(key, name, new DmRmc100C(ipid, Global.ControlSystem));
|
return new DmRmcX100CController(key, name, new DmRmc100C(ipid, Global.ControlSystem));
|
||||||
if (typeName.StartsWith("dmrmc100s"))
|
if (typeName.StartsWith("dmrmc100s"))
|
||||||
return new DmRmc100SController(key, name, new DmRmc100S(ipid, Global.ControlSystem));
|
return new DmRmc100SController(key, name, new DmRmc100S(ipid, Global.ControlSystem));
|
||||||
if (typeName.StartsWith("dmrmc4k100c"))
|
if (typeName.StartsWith("dmrmc4k100c"))
|
||||||
return new DmRmcX100CController(key, name, new DmRmc4k100C(ipid, Global.ControlSystem));
|
return new DmRmcX100CController(key, name, new DmRmc4k100C(ipid, Global.ControlSystem));
|
||||||
if (typeName.StartsWith("dmrmc4kz100c"))
|
if (typeName.StartsWith("dmrmc4kz100c"))
|
||||||
return new DmRmcX100CController(key, name, new DmRmc4kz100C(ipid, Global.ControlSystem));
|
return new DmRmcX100CController(key, name, new DmRmc4kz100C(ipid, Global.ControlSystem));
|
||||||
if (typeName.StartsWith("dmrmc150s"))
|
if (typeName.StartsWith("dmrmc150s"))
|
||||||
return new DmRmc150SController(key, name, new DmRmc150S(ipid, Global.ControlSystem));
|
return new DmRmc150SController(key, name, new DmRmc150S(ipid, Global.ControlSystem));
|
||||||
if (typeName.StartsWith("dmrmc200c"))
|
if (typeName.StartsWith("dmrmc200c"))
|
||||||
return new DmRmc200CController(key, name, new DmRmc200C(ipid, Global.ControlSystem));
|
return new DmRmc200CController(key, name, new DmRmc200C(ipid, Global.ControlSystem));
|
||||||
if (typeName.StartsWith("dmrmc200s"))
|
if (typeName.StartsWith("dmrmc200s"))
|
||||||
return new DmRmc200SController(key, name, new DmRmc200S(ipid, Global.ControlSystem));
|
return new DmRmc200SController(key, name, new DmRmc200S(ipid, Global.ControlSystem));
|
||||||
if (typeName.StartsWith("dmrmc200s2"))
|
if (typeName.StartsWith("dmrmc200s2"))
|
||||||
return new DmRmc200S2Controller(key, name, new DmRmc200S2(ipid, Global.ControlSystem));
|
return new DmRmc200S2Controller(key, name, new DmRmc200S2(ipid, Global.ControlSystem));
|
||||||
if (typeName.StartsWith("dmrmcscalerc"))
|
if (typeName.StartsWith("dmrmcscalerc"))
|
||||||
return new DmRmcScalerCController(key, name, new DmRmcScalerC(ipid, Global.ControlSystem));
|
return new DmRmcScalerCController(key, name, new DmRmcScalerC(ipid, Global.ControlSystem));
|
||||||
if (typeName.StartsWith("dmrmcscalers"))
|
if (typeName.StartsWith("dmrmcscalers"))
|
||||||
return new DmRmcScalerSController(key, name, new DmRmcScalerS(ipid, Global.ControlSystem));
|
return new DmRmcScalerSController(key, name, new DmRmcScalerS(ipid, Global.ControlSystem));
|
||||||
if (typeName.StartsWith("dmrmcscalers2"))
|
if (typeName.StartsWith("dmrmcscalers2"))
|
||||||
return new DmRmcScalerS2Controller(key, name, new DmRmcScalerS2(ipid, Global.ControlSystem));
|
return new DmRmcScalerS2Controller(key, name, new DmRmcScalerS2(ipid, Global.ControlSystem));
|
||||||
if (typeName.StartsWith("dmrmc4kscalerc"))
|
if (typeName.StartsWith("dmrmc4kscalerc"))
|
||||||
return new DmRmc4kScalerCController(key, name, new DmRmc4kScalerC(ipid, Global.ControlSystem));
|
return new DmRmc4kScalerCController(key, name, new DmRmc4kScalerC(ipid, Global.ControlSystem));
|
||||||
if (typeName.StartsWith("dmrmc4kscalercdsp"))
|
if (typeName.StartsWith("dmrmc4kscalercdsp"))
|
||||||
return new DmRmc4kScalerCDspController(key, name, new DmRmc4kScalerCDsp(ipid, Global.ControlSystem));
|
return new DmRmc4kScalerCDspController(key, name, new DmRmc4kScalerCDsp(ipid, Global.ControlSystem));
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
Debug.Console(0, "[{0}] WARNING: Cannot create DM-RMC device: {1}", key, e.Message);
|
Debug.Console(0, "[{0}] WARNING: Cannot create DM-RMC device: {1}", key, e.Message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Debug.Console(0, "Cannot create DM-RMC of type: '{0}'", typeName);
|
Debug.Console(0, "Cannot create DM-RMC of type: '{0}'", typeName);
|
||||||
}
|
}
|
||||||
// Endpoints attached to DM Chassis
|
// Endpoints attached to DM Chassis
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var parentDev = DeviceManager.GetDeviceForKey(pKey);
|
var parentDev = DeviceManager.GetDeviceForKey(pKey);
|
||||||
if (!(parentDev is DmChassisController))
|
if (!(parentDev is IDmSwitch))
|
||||||
{
|
{
|
||||||
Debug.Console(0, "Cannot create DM device '{0}'. '{1}' is not a DM Chassis.",
|
Debug.Console(0, "Cannot create DM device '{0}'. '{1}' is not a DM Chassis.",
|
||||||
key, pKey);
|
key, pKey);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
var chassis = (parentDev as DmChassisController).Chassis;
|
var chassis = (parentDev as IDmSwitch).Chassis;
|
||||||
var num = props.ParentOutputNumber;
|
var num = props.ParentOutputNumber;
|
||||||
if (num <= 0 || num > chassis.NumberOfOutputs)
|
if (num <= 0 || num > chassis.NumberOfOutputs)
|
||||||
{
|
{
|
||||||
Debug.Console(0, "Cannot create DM device '{0}'. Output number '{1}' is out of range",
|
Debug.Console(0, "Cannot create DM device '{0}'. Output number '{1}' is out of range",
|
||||||
key, num);
|
key, num);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var controller = (parentDev as DmChassisController);
|
var controller = (parentDev as IDmSwitch);
|
||||||
controller.RxDictionary.Add(num, key);
|
controller.RxDictionary.Add(num, key);
|
||||||
}
|
}
|
||||||
// Catch constructor failures, mainly dues to IPID
|
// Catch constructor failures, mainly dues to IPID
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
||||||
// Must use different constructor for CPU3 chassis types. No IPID
|
// Must use different constructor for CPU3 chassis types. No IPID
|
||||||
if (chassis is DmMd8x8Cpu3 || chassis is DmMd16x16Cpu3 ||
|
if (chassis is DmMd8x8Cpu3 || chassis is DmMd16x16Cpu3 ||
|
||||||
chassis is DmMd32x32Cpu3 || chassis is DmMd8x8Cpu3rps ||
|
chassis is DmMd32x32Cpu3 || chassis is DmMd8x8Cpu3rps ||
|
||||||
chassis is DmMd16x16Cpu3rps || chassis is DmMd32x32Cpu3rps)
|
chassis is DmMd16x16Cpu3rps || chassis is DmMd32x32Cpu3rps ||
|
||||||
{
|
chassis is DmMd128x128 || chassis is DmMd64x64)
|
||||||
if (typeName.StartsWith("hdbasetrx"))
|
{
|
||||||
return new HDBaseTRxController(key, name, new HDRx3CB(chassis.Outputs[num]));
|
if (typeName.StartsWith("hdbasetrx"))
|
||||||
if (typeName.StartsWith("dmrmc4k100c1g"))
|
return new HDBaseTRxController(key, name, new HDRx3CB(chassis.Outputs[num]));
|
||||||
return new DmRmc4k100C1GController(key, name, new DmRmc4K100C1G(chassis.Outputs[num]));
|
if (typeName.StartsWith("dmrmc4k100c1g"))
|
||||||
if (typeName.StartsWith("dmrmc100c"))
|
return new DmRmc4k100C1GController(key, name, new DmRmc4K100C1G(chassis.Outputs[num]));
|
||||||
return new DmRmcX100CController(key, name, new DmRmc100C(chassis.Outputs[num]));
|
if (typeName.StartsWith("dmrmc100c"))
|
||||||
if (typeName.StartsWith("dmrmc100s"))
|
return new DmRmcX100CController(key, name, new DmRmc100C(chassis.Outputs[num]));
|
||||||
return new DmRmc100SController(key, name, new DmRmc100S(chassis.Outputs[num]));
|
if (typeName.StartsWith("dmrmc100s"))
|
||||||
if (typeName.StartsWith("dmrmc4k100c"))
|
return new DmRmc100SController(key, name, new DmRmc100S(chassis.Outputs[num]));
|
||||||
return new DmRmcX100CController(key, name, new DmRmc4k100C(chassis.Outputs[num]));
|
if (typeName.StartsWith("dmrmc4k100c"))
|
||||||
if (typeName.StartsWith("dmrmc4kz100c"))
|
return new DmRmcX100CController(key, name, new DmRmc4k100C(chassis.Outputs[num]));
|
||||||
return new DmRmcX100CController(key, name, new DmRmc4kz100C(chassis.Outputs[num]));
|
if (typeName.StartsWith("dmrmc4kz100c"))
|
||||||
if (typeName.StartsWith("dmrmc150s"))
|
return new DmRmcX100CController(key, name, new DmRmc4kz100C(chassis.Outputs[num]));
|
||||||
return new DmRmc150SController(key, name, new DmRmc150S(chassis.Outputs[num]));
|
if (typeName.StartsWith("dmrmc150s"))
|
||||||
if (typeName.StartsWith("dmrmc200c"))
|
return new DmRmc150SController(key, name, new DmRmc150S(chassis.Outputs[num]));
|
||||||
return new DmRmc200CController(key, name, new DmRmc200C(chassis.Outputs[num]));
|
if (typeName.StartsWith("dmrmc200c"))
|
||||||
if (typeName.StartsWith("dmrmc200s"))
|
return new DmRmc200CController(key, name, new DmRmc200C(chassis.Outputs[num]));
|
||||||
return new DmRmc200SController(key, name, new DmRmc200S(chassis.Outputs[num]));
|
if (typeName.StartsWith("dmrmc200s"))
|
||||||
if (typeName.StartsWith("dmrmc200s2"))
|
return new DmRmc200SController(key, name, new DmRmc200S(chassis.Outputs[num]));
|
||||||
return new DmRmc200S2Controller(key, name, new DmRmc200S2(chassis.Outputs[num]));
|
if (typeName.StartsWith("dmrmc200s2"))
|
||||||
if (typeName.StartsWith("dmrmcscalerc"))
|
return new DmRmc200S2Controller(key, name, new DmRmc200S2(chassis.Outputs[num]));
|
||||||
return new DmRmcScalerCController(key, name, new DmRmcScalerC(chassis.Outputs[num]));
|
if (typeName.StartsWith("dmrmcscalerc"))
|
||||||
if (typeName.StartsWith("dmrmcscalers"))
|
return new DmRmcScalerCController(key, name, new DmRmcScalerC(chassis.Outputs[num]));
|
||||||
return new DmRmcScalerSController(key, name, new DmRmcScalerS(chassis.Outputs[num]));
|
if (typeName.StartsWith("dmrmcscalers"))
|
||||||
if (typeName.StartsWith("dmrmcscalers2"))
|
return new DmRmcScalerSController(key, name, new DmRmcScalerS(chassis.Outputs[num]));
|
||||||
return new DmRmcScalerS2Controller(key, name, new DmRmcScalerS2(chassis.Outputs[num]));
|
if (typeName.StartsWith("dmrmcscalers2"))
|
||||||
if (typeName.StartsWith("dmrmc4kscalerc"))
|
return new DmRmcScalerS2Controller(key, name, new DmRmcScalerS2(chassis.Outputs[num]));
|
||||||
return new DmRmc4kScalerCController(key, name, new DmRmc4kScalerC(chassis.Outputs[num]));
|
if (typeName.StartsWith("dmrmc4kscalerc"))
|
||||||
if (typeName.StartsWith("dmrmc4kscalercdsp"))
|
return new DmRmc4kScalerCController(key, name, new DmRmc4kScalerC(chassis.Outputs[num]));
|
||||||
return new DmRmc4kScalerCDspController(key, name, new DmRmc4kScalerCDsp(chassis.Outputs[num]));
|
if (typeName.StartsWith("dmrmc4kscalercdsp"))
|
||||||
}
|
return new DmRmc4kScalerCDspController(key, name, new DmRmc4kScalerCDsp(chassis.Outputs[num]));
|
||||||
else
|
}
|
||||||
{
|
else
|
||||||
if (typeName.StartsWith("hdbasetrx"))
|
{
|
||||||
return new HDBaseTRxController(key, name, new HDRx3CB(ipid, chassis.Outputs[num]));
|
if (typeName.StartsWith("hdbasetrx"))
|
||||||
if (typeName.StartsWith("dmrmc4k100c1g"))
|
return new HDBaseTRxController(key, name, new HDRx3CB(ipid, chassis.Outputs[num]));
|
||||||
return new DmRmc4k100C1GController(key, name, new DmRmc4K100C1G(ipid, chassis.Outputs[num]));
|
if (typeName.StartsWith("dmrmc4k100c1g"))
|
||||||
if (typeName.StartsWith("dmrmc100c"))
|
return new DmRmc4k100C1GController(key, name, new DmRmc4K100C1G(ipid, chassis.Outputs[num]));
|
||||||
return new DmRmcX100CController(key, name, new DmRmc100C(ipid, chassis.Outputs[num]));
|
if (typeName.StartsWith("dmrmc100c"))
|
||||||
if (typeName.StartsWith("dmrmc100s"))
|
return new DmRmcX100CController(key, name, new DmRmc100C(ipid, chassis.Outputs[num]));
|
||||||
return new DmRmc100SController(key, name, new DmRmc100S(ipid, chassis.Outputs[num]));
|
if (typeName.StartsWith("dmrmc100s"))
|
||||||
if (typeName.StartsWith("dmrmc4k100c"))
|
return new DmRmc100SController(key, name, new DmRmc100S(ipid, chassis.Outputs[num]));
|
||||||
return new DmRmcX100CController(key, name, new DmRmc4k100C(ipid, chassis.Outputs[num]));
|
if (typeName.StartsWith("dmrmc4k100c"))
|
||||||
if (typeName.StartsWith("dmrmc4kz100c"))
|
return new DmRmcX100CController(key, name, new DmRmc4k100C(ipid, chassis.Outputs[num]));
|
||||||
return new DmRmcX100CController(key, name, new DmRmc4kz100C(ipid, chassis.Outputs[num]));
|
if (typeName.StartsWith("dmrmc4kz100c"))
|
||||||
if (typeName.StartsWith("dmrmc150s"))
|
return new DmRmcX100CController(key, name, new DmRmc4kz100C(ipid, chassis.Outputs[num]));
|
||||||
return new DmRmc150SController(key, name, new DmRmc150S(ipid, chassis.Outputs[num]));
|
if (typeName.StartsWith("dmrmc150s"))
|
||||||
if (typeName.StartsWith("dmrmc200c"))
|
return new DmRmc150SController(key, name, new DmRmc150S(ipid, chassis.Outputs[num]));
|
||||||
return new DmRmc200CController(key, name, new DmRmc200C(ipid, chassis.Outputs[num]));
|
if (typeName.StartsWith("dmrmc200c"))
|
||||||
if (typeName.StartsWith("dmrmc200s"))
|
return new DmRmc200CController(key, name, new DmRmc200C(ipid, chassis.Outputs[num]));
|
||||||
return new DmRmc200SController(key, name, new DmRmc200S(ipid, chassis.Outputs[num]));
|
if (typeName.StartsWith("dmrmc200s"))
|
||||||
if (typeName.StartsWith("dmrmc200s2"))
|
return new DmRmc200SController(key, name, new DmRmc200S(ipid, chassis.Outputs[num]));
|
||||||
return new DmRmc200S2Controller(key, name, new DmRmc200S2(ipid, chassis.Outputs[num]));
|
if (typeName.StartsWith("dmrmc200s2"))
|
||||||
if (typeName.StartsWith("dmrmcscalerc"))
|
return new DmRmc200S2Controller(key, name, new DmRmc200S2(ipid, chassis.Outputs[num]));
|
||||||
return new DmRmcScalerCController(key, name, new DmRmcScalerC(ipid, chassis.Outputs[num]));
|
if (typeName.StartsWith("dmrmcscalerc"))
|
||||||
if (typeName.StartsWith("dmrmcscalers"))
|
return new DmRmcScalerCController(key, name, new DmRmcScalerC(ipid, chassis.Outputs[num]));
|
||||||
return new DmRmcScalerSController(key, name, new DmRmcScalerS(ipid, chassis.Outputs[num]));
|
if (typeName.StartsWith("dmrmcscalers"))
|
||||||
if (typeName.StartsWith("dmrmcscalers2"))
|
return new DmRmcScalerSController(key, name, new DmRmcScalerS(ipid, chassis.Outputs[num]));
|
||||||
return new DmRmcScalerS2Controller(key, name, new DmRmcScalerS2(ipid, chassis.Outputs[num]));
|
if (typeName.StartsWith("dmrmcscalers2"))
|
||||||
if (typeName.StartsWith("dmrmc4kscalerc"))
|
return new DmRmcScalerS2Controller(key, name, new DmRmcScalerS2(ipid, chassis.Outputs[num]));
|
||||||
return new DmRmc4kScalerCController(key, name, new DmRmc4kScalerC(ipid, chassis.Outputs[num]));
|
if (typeName.StartsWith("dmrmc4kscalerc"))
|
||||||
if (typeName.StartsWith("dmrmc4kscalercdsp"))
|
return new DmRmc4kScalerCController(key, name, new DmRmc4kScalerC(ipid, chassis.Outputs[num]));
|
||||||
return new DmRmc4kScalerCDspController(key, name, new DmRmc4kScalerCDsp(ipid, chassis.Outputs[num]));
|
if (typeName.StartsWith("dmrmc4kscalercdsp"))
|
||||||
}
|
return new DmRmc4kScalerCDspController(key, name, new DmRmc4kScalerCDsp(ipid, chassis.Outputs[num]));
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
}
|
||||||
{
|
catch (Exception e)
|
||||||
Debug.Console(0, "[{0}] WARNING: Cannot create DM-RMC device: {1}", key, e.Message);
|
{
|
||||||
}
|
Debug.Console(0, "[{0}] WARNING: Cannot create DM-RMC device: {1}", key, e.Message);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return null;
|
|
||||||
}
|
return null;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,181 +1,182 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
using Crestron.SimplSharpPro;
|
using Crestron.SimplSharpPro;
|
||||||
using Crestron.SimplSharpPro.DM;
|
using Crestron.SimplSharpPro.DM;
|
||||||
using Crestron.SimplSharpPro.DM.Endpoints;
|
using Crestron.SimplSharpPro.DM.Endpoints;
|
||||||
using Crestron.SimplSharpPro.DM.Endpoints.Transmitters;
|
using Crestron.SimplSharpPro.DM.Endpoints.Transmitters;
|
||||||
|
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
using PepperDash.Essentials.DM.Config;
|
using PepperDash.Essentials.DM.Config;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.DM
|
namespace PepperDash.Essentials.DM
|
||||||
{
|
{
|
||||||
public class DmTxHelper
|
public class DmTxHelper
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A factory method for various DmTxControllers
|
/// A factory method for various DmTxControllers
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="key"></param>
|
/// <param name="key"></param>
|
||||||
/// <param name="name"></param>
|
/// <param name="name"></param>
|
||||||
/// <param name="props"></param>
|
/// <param name="props"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static BasicDmTxControllerBase GetDmTxController(string key, string name, string typeName, DmTxPropertiesConfig props)
|
public static BasicDmTxControllerBase GetDmTxController(string key, string name, string typeName, DmTxPropertiesConfig props)
|
||||||
{
|
{
|
||||||
// switch on type name... later...
|
// switch on type name... later...
|
||||||
|
|
||||||
typeName = typeName.ToLower();
|
typeName = typeName.ToLower();
|
||||||
//uint ipid = Convert.ToUInt16(props.Id, 16);
|
//uint ipid = Convert.ToUInt16(props.Id, 16);
|
||||||
var ipid = props.Control.IpIdInt;
|
var ipid = props.Control.IpIdInt;
|
||||||
var pKey = props.ParentDeviceKey.ToLower();
|
var pKey = props.ParentDeviceKey.ToLower();
|
||||||
|
|
||||||
if (pKey == "processor")
|
if (pKey == "processor")
|
||||||
{
|
{
|
||||||
// Catch constructor failures, mainly dues to IPID
|
// Catch constructor failures, mainly dues to IPID
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if(typeName.StartsWith("dmtx200"))
|
if(typeName.StartsWith("dmtx200"))
|
||||||
return new DmTx200Controller(key, name, new DmTx200C2G(ipid, Global.ControlSystem));
|
return new DmTx200Controller(key, name, new DmTx200C2G(ipid, Global.ControlSystem));
|
||||||
if (typeName.StartsWith("dmtx201"))
|
if (typeName.StartsWith("dmtx201"))
|
||||||
return new DmTx201XController(key, name, new DmTx201S(ipid, Global.ControlSystem));
|
return new DmTx201XController(key, name, new DmTx201S(ipid, Global.ControlSystem));
|
||||||
if (typeName.StartsWith("dmtx4k202"))
|
if (typeName.StartsWith("dmtx4k202"))
|
||||||
return new DmTx4k202CController(key, name, new DmTx4k202C(ipid, Global.ControlSystem));
|
return new DmTx4k202CController(key, name, new DmTx4k202C(ipid, Global.ControlSystem));
|
||||||
if (typeName.StartsWith("dmtx4kz202"))
|
if (typeName.StartsWith("dmtx4kz202"))
|
||||||
return new DmTx4k202CController(key, name, new DmTx4kz202C(ipid, Global.ControlSystem));
|
return new DmTx4k202CController(key, name, new DmTx4kz202C(ipid, Global.ControlSystem));
|
||||||
if (typeName.StartsWith("dmtx4k302"))
|
if (typeName.StartsWith("dmtx4k302"))
|
||||||
return new DmTx4k302CController(key, name, new DmTx4k302C(ipid, Global.ControlSystem));
|
return new DmTx4k302CController(key, name, new DmTx4k302C(ipid, Global.ControlSystem));
|
||||||
if (typeName.StartsWith("dmtx4kz302"))
|
if (typeName.StartsWith("dmtx4kz302"))
|
||||||
return new DmTx4kz302CController(key, name, new DmTx4kz302C(ipid, Global.ControlSystem));
|
return new DmTx4kz302CController(key, name, new DmTx4kz302C(ipid, Global.ControlSystem));
|
||||||
if (typeName.StartsWith("dmtx401"))
|
if (typeName.StartsWith("dmtx401"))
|
||||||
return new DmTx401CController(key, name, new DmTx401C(ipid, Global.ControlSystem));
|
return new DmTx401CController(key, name, new DmTx401C(ipid, Global.ControlSystem));
|
||||||
Debug.Console(0, "{1} WARNING: Cannot create DM-TX of type: '{0}'", typeName, key);
|
Debug.Console(0, "{1} WARNING: Cannot create DM-TX of type: '{0}'", typeName, key);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
Debug.Console(0, "[{0}] WARNING: Cannot create DM-TX device: {1}", key, e);
|
Debug.Console(0, "[{0}] WARNING: Cannot create DM-TX device: {1}", key, e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var parentDev = DeviceManager.GetDeviceForKey(pKey);
|
var parentDev = DeviceManager.GetDeviceForKey(pKey);
|
||||||
if (!(parentDev is DmChassisController))
|
if (!(parentDev is IDmSwitch))
|
||||||
{
|
{
|
||||||
Debug.Console(0, "Cannot create DM device '{0}'. '{1}' is not a DM Chassis.",
|
Debug.Console(0, "Cannot create DM device '{0}'. '{1}' is not a DM Chassis.",
|
||||||
key, pKey);
|
key, pKey);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the Crestron chassis and link stuff up
|
// Get the Crestron chassis and link stuff up
|
||||||
var switchDev = parentDev as DmChassisController;
|
var switchDev = (parentDev as IDmSwitch);
|
||||||
var chassis = switchDev.Chassis;
|
var chassis = switchDev.Chassis;
|
||||||
|
|
||||||
var num = props.ParentInputNumber;
|
var num = props.ParentInputNumber;
|
||||||
if (num <= 0 || num > chassis.NumberOfInputs)
|
if (num <= 0 || num > chassis.NumberOfInputs)
|
||||||
{
|
{
|
||||||
Debug.Console(0, "Cannot create DM device '{0}'. Input number '{1}' is out of range",
|
Debug.Console(0, "Cannot create DM device '{0}'. Input number '{1}' is out of range",
|
||||||
key, num);
|
key, num);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var controller = (parentDev as DmChassisController);
|
var controller = (parentDev as IDmSwitch);
|
||||||
controller.TxDictionary.Add(num, key);
|
controller.TxDictionary.Add(num, key);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Catch constructor failures, mainly dues to IPID
|
// Catch constructor failures, mainly dues to IPID
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// Must use different constructor for CPU3 chassis types. No IPID
|
// Must use different constructor for CPU3 chassis types. No IPID
|
||||||
if (chassis is DmMd8x8Cpu3 || chassis is DmMd16x16Cpu3 ||
|
if (chassis is DmMd8x8Cpu3 || chassis is DmMd16x16Cpu3 ||
|
||||||
chassis is DmMd32x32Cpu3 || chassis is DmMd8x8Cpu3rps ||
|
chassis is DmMd32x32Cpu3 || chassis is DmMd8x8Cpu3rps ||
|
||||||
chassis is DmMd16x16Cpu3rps || chassis is DmMd32x32Cpu3rps)
|
chassis is DmMd16x16Cpu3rps || chassis is DmMd32x32Cpu3rps||
|
||||||
{
|
chassis is DmMd128x128 || chassis is DmMd64x64)
|
||||||
if (typeName.StartsWith("dmtx200"))
|
{
|
||||||
return new DmTx200Controller(key, name, new DmTx200C2G(chassis.Inputs[num]));
|
if (typeName.StartsWith("dmtx200"))
|
||||||
if (typeName.StartsWith("dmtx201"))
|
return new DmTx200Controller(key, name, new DmTx200C2G(chassis.Inputs[num]));
|
||||||
return new DmTx201XController(key, name, new DmTx201C(chassis.Inputs[num]));
|
if (typeName.StartsWith("dmtx201"))
|
||||||
if (typeName.StartsWith("dmtx4k100"))
|
return new DmTx201XController(key, name, new DmTx201C(chassis.Inputs[num]));
|
||||||
return new DmTx4k100Controller(key, name, new DmTx4K100C1G(chassis.Inputs[num]));
|
if (typeName.StartsWith("dmtx4k100"))
|
||||||
if (typeName.StartsWith("dmtx4k202"))
|
return new DmTx4k100Controller(key, name, new DmTx4K100C1G(chassis.Inputs[num]));
|
||||||
return new DmTx4k202CController(key, name, new DmTx4k202C(chassis.Inputs[num]));
|
if (typeName.StartsWith("dmtx4k202"))
|
||||||
if (typeName.StartsWith("dmtx4kz202"))
|
return new DmTx4k202CController(key, name, new DmTx4k202C(chassis.Inputs[num]));
|
||||||
return new DmTx4k202CController(key, name, new DmTx4kz202C(chassis.Inputs[num]));
|
if (typeName.StartsWith("dmtx4kz202"))
|
||||||
if (typeName.StartsWith("dmtx4k302"))
|
return new DmTx4k202CController(key, name, new DmTx4kz202C(chassis.Inputs[num]));
|
||||||
return new DmTx4k302CController(key, name, new DmTx4k302C(chassis.Inputs[num]));
|
if (typeName.StartsWith("dmtx4k302"))
|
||||||
if (typeName.StartsWith("dmtx4kz302"))
|
return new DmTx4k302CController(key, name, new DmTx4k302C(chassis.Inputs[num]));
|
||||||
return new DmTx4kz302CController(key, name, new DmTx4kz302C(chassis.Inputs[num]));
|
if (typeName.StartsWith("dmtx4kz302"))
|
||||||
if (typeName.StartsWith("dmtx401"))
|
return new DmTx4kz302CController(key, name, new DmTx4kz302C(chassis.Inputs[num]));
|
||||||
return new DmTx401CController(key, name, new DmTx401C(chassis.Inputs[num]));
|
if (typeName.StartsWith("dmtx401"))
|
||||||
}
|
return new DmTx401CController(key, name, new DmTx401C(chassis.Inputs[num]));
|
||||||
else
|
}
|
||||||
{
|
else
|
||||||
if (typeName.StartsWith("dmtx200"))
|
{
|
||||||
return new DmTx200Controller(key, name, new DmTx200C2G(ipid, chassis.Inputs[num]));
|
if (typeName.StartsWith("dmtx200"))
|
||||||
if (typeName.StartsWith("dmtx201"))
|
return new DmTx200Controller(key, name, new DmTx200C2G(ipid, chassis.Inputs[num]));
|
||||||
return new DmTx201XController(key, name, new DmTx201C(ipid, chassis.Inputs[num]));
|
if (typeName.StartsWith("dmtx201"))
|
||||||
if (typeName.StartsWith("dmtx4k100"))
|
return new DmTx201XController(key, name, new DmTx201C(ipid, chassis.Inputs[num]));
|
||||||
return new DmTx4k100Controller(key, name, new DmTx4K100C1G(ipid, chassis.Inputs[num]));
|
if (typeName.StartsWith("dmtx4k100"))
|
||||||
if (typeName.StartsWith("dmtx4k202"))
|
return new DmTx4k100Controller(key, name, new DmTx4K100C1G(ipid, chassis.Inputs[num]));
|
||||||
return new DmTx4k202CController(key, name, new DmTx4k202C(ipid, chassis.Inputs[num]));
|
if (typeName.StartsWith("dmtx4k202"))
|
||||||
if (typeName.StartsWith("dmtx4kz202"))
|
return new DmTx4k202CController(key, name, new DmTx4k202C(ipid, chassis.Inputs[num]));
|
||||||
return new DmTx4k202CController(key, name, new DmTx4kz202C(ipid, chassis.Inputs[num]));
|
if (typeName.StartsWith("dmtx4kz202"))
|
||||||
if (typeName.StartsWith("dmtx4k302"))
|
return new DmTx4k202CController(key, name, new DmTx4kz202C(ipid, chassis.Inputs[num]));
|
||||||
return new DmTx4k302CController(key, name, new DmTx4k302C(ipid, chassis.Inputs[num]));
|
if (typeName.StartsWith("dmtx4k302"))
|
||||||
if (typeName.StartsWith("dmtx4kz302"))
|
return new DmTx4k302CController(key, name, new DmTx4k302C(ipid, chassis.Inputs[num]));
|
||||||
return new DmTx4kz302CController(key, name, new DmTx4kz302C(ipid, chassis.Inputs[num]));
|
if (typeName.StartsWith("dmtx4kz302"))
|
||||||
if (typeName.StartsWith("dmtx401"))
|
return new DmTx4kz302CController(key, name, new DmTx4kz302C(ipid, chassis.Inputs[num]));
|
||||||
return new DmTx401CController(key, name, new DmTx401C(ipid, chassis.Inputs[num]));
|
if (typeName.StartsWith("dmtx401"))
|
||||||
}
|
return new DmTx401CController(key, name, new DmTx401C(ipid, chassis.Inputs[num]));
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
}
|
||||||
{
|
catch (Exception e)
|
||||||
Debug.Console(0, "[{0}] WARNING: Cannot create DM-TX device: {1}", key, e);
|
{
|
||||||
}
|
Debug.Console(0, "[{0}] WARNING: Cannot create DM-TX device: {1}", key, e);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return null;
|
|
||||||
}
|
return null;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
public abstract class BasicDmTxControllerBase : CrestronGenericBaseDevice
|
|
||||||
{
|
public abstract class BasicDmTxControllerBase : CrestronGenericBaseDevice
|
||||||
public BasicDmTxControllerBase(string key, string name, GenericBase hardware)
|
{
|
||||||
: base(key, name, hardware)
|
public BasicDmTxControllerBase(string key, string name, GenericBase hardware)
|
||||||
{
|
: base(key, name, hardware)
|
||||||
|
{
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
/// <summary>
|
|
||||||
///
|
/// <summary>
|
||||||
/// </summary>
|
///
|
||||||
public abstract class DmTxControllerBase : BasicDmTxControllerBase
|
/// </summary>
|
||||||
{
|
public abstract class DmTxControllerBase : BasicDmTxControllerBase
|
||||||
public virtual void SetPortHdcpCapability(eHdcpCapabilityType hdcpMode, uint port) { }
|
{
|
||||||
public virtual eHdcpCapabilityType HdcpSupportCapability { get; protected set; }
|
public virtual void SetPortHdcpCapability(eHdcpCapabilityType hdcpMode, uint port) { }
|
||||||
public abstract StringFeedback ActiveVideoInputFeedback { get; protected set; }
|
public virtual eHdcpCapabilityType HdcpSupportCapability { get; protected set; }
|
||||||
public RoutingInputPortWithVideoStatuses AnyVideoInput { get; protected set; }
|
public abstract StringFeedback ActiveVideoInputFeedback { get; protected set; }
|
||||||
|
public RoutingInputPortWithVideoStatuses AnyVideoInput { get; protected set; }
|
||||||
public DmTxControllerBase(string key, string name, EndpointTransmitterBase hardware)
|
|
||||||
: base(key, name, hardware)
|
public DmTxControllerBase(string key, string name, EndpointTransmitterBase hardware)
|
||||||
{
|
: base(key, name, hardware)
|
||||||
// if wired to a chassis, skip registration step in base class
|
{
|
||||||
if (hardware.DMInput != null)
|
// if wired to a chassis, skip registration step in base class
|
||||||
{
|
if (hardware.DMInput != null)
|
||||||
this.PreventRegistration = true;
|
{
|
||||||
}
|
this.PreventRegistration = true;
|
||||||
AddToFeedbackList(ActiveVideoInputFeedback);
|
}
|
||||||
}
|
AddToFeedbackList(ActiveVideoInputFeedback);
|
||||||
}
|
}
|
||||||
//public enum ePdtHdcpSupport
|
}
|
||||||
//{
|
//public enum ePdtHdcpSupport
|
||||||
// HdcpOff = 0,
|
//{
|
||||||
// Hdcp1 = 1,
|
// HdcpOff = 0,
|
||||||
// Hdcp2 = 2,
|
// Hdcp1 = 1,
|
||||||
// Hdcp2_2= 3,
|
// Hdcp2 = 2,
|
||||||
// Auto = 99
|
// Hdcp2_2= 3,
|
||||||
//}
|
// Auto = 99
|
||||||
|
//}
|
||||||
}
|
}
|
||||||
@@ -95,12 +95,14 @@
|
|||||||
<Compile Include="Cards REMOVE\DmcC4kInputCard.cs" />
|
<Compile Include="Cards REMOVE\DmcC4kInputCard.cs" />
|
||||||
<Compile Include="Cards REMOVE\DmcHD4kInputCard.cs" />
|
<Compile Include="Cards REMOVE\DmcHD4kInputCard.cs" />
|
||||||
<Compile Include="Cards REMOVE\DmInputCardBase.cs" />
|
<Compile Include="Cards REMOVE\DmInputCardBase.cs" />
|
||||||
|
<Compile Include="Chassis\DmBladeChassisController.cs" />
|
||||||
<Compile Include="Chassis\DmCardAudioOutput.cs" />
|
<Compile Include="Chassis\DmCardAudioOutput.cs" />
|
||||||
<Compile Include="Chassis\DmChassisController.cs" />
|
<Compile Include="Chassis\DmChassisController.cs" />
|
||||||
<Compile Include="Chassis\DmpsAudioOutputController.cs" />
|
<Compile Include="Chassis\DmpsAudioOutputController.cs" />
|
||||||
<Compile Include="Chassis\DmpsInternalVirtualDmTxController.cs" />
|
<Compile Include="Chassis\DmpsInternalVirtualDmTxController.cs" />
|
||||||
<Compile Include="Chassis\DmpsRoutingController.cs" />
|
<Compile Include="Chassis\DmpsRoutingController.cs" />
|
||||||
<Compile Include="Chassis\HdMdNxM4kEController.cs" />
|
<Compile Include="Chassis\HdMdNxM4kEController.cs" />
|
||||||
|
<Compile Include="IDmSwitch.cs" />
|
||||||
<Compile Include="Config\DmpsRoutingConfig.cs" />
|
<Compile Include="Config\DmpsRoutingConfig.cs" />
|
||||||
<Compile Include="Config\DmRmcConfig.cs" />
|
<Compile Include="Config\DmRmcConfig.cs" />
|
||||||
<Compile Include="Config\DmTxConfig.cs" />
|
<Compile Include="Config\DmTxConfig.cs" />
|
||||||
|
|||||||
@@ -0,0 +1,25 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using Crestron.SimplSharp;
|
||||||
|
using Crestron.SimplSharpPro;
|
||||||
|
using Crestron.SimplSharpPro.DM;
|
||||||
|
using Crestron.SimplSharpPro.DM.Cards;
|
||||||
|
using Crestron.SimplSharpPro.DM.Endpoints;
|
||||||
|
using Crestron.SimplSharpPro.DM.Endpoints.Receivers;
|
||||||
|
|
||||||
|
using PepperDash.Core;
|
||||||
|
using PepperDash.Essentials.Core;
|
||||||
|
//using PepperDash.Essentials.DM.Cards;
|
||||||
|
|
||||||
|
using PepperDash.Essentials.DM.Config;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.DM {
|
||||||
|
public interface IDmSwitch {
|
||||||
|
Switch Chassis { get; }
|
||||||
|
|
||||||
|
Dictionary<uint, string> TxDictionary { get; }
|
||||||
|
Dictionary<uint, string> RxDictionary { get; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using Crestron.SimplSharp;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Devices.Common.Cameras
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Describes a camera with preset functionality
|
||||||
|
/// </summary>
|
||||||
|
public interface IHasCameraPresets
|
||||||
|
{
|
||||||
|
event EventHandler<EventArgs> PresetsListHasChanged;
|
||||||
|
|
||||||
|
List<CameraPreset> Presets { get; }
|
||||||
|
|
||||||
|
void PresetSelect(int preset);
|
||||||
|
|
||||||
|
void PresetStore(int preset, string description);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -30,6 +30,8 @@ namespace PepperDash.Essentials.Devices.Common.Occupancy
|
|||||||
public GlsOdtOccupancySensorController(string key, string name, GlsOdtCCn sensor)
|
public GlsOdtOccupancySensorController(string key, string name, GlsOdtCCn sensor)
|
||||||
: base(key, name, sensor)
|
: base(key, name, sensor)
|
||||||
{
|
{
|
||||||
|
OccSensor = sensor;
|
||||||
|
|
||||||
AndWhenVacatedFeedback = new BoolFeedback(() => OccSensor.AndWhenVacatedFeedback.BoolValue);
|
AndWhenVacatedFeedback = new BoolFeedback(() => OccSensor.AndWhenVacatedFeedback.BoolValue);
|
||||||
|
|
||||||
OrWhenVacatedFeedback = new BoolFeedback(() => OccSensor.OrWhenVacatedFeedback.BoolValue);
|
OrWhenVacatedFeedback = new BoolFeedback(() => OccSensor.OrWhenVacatedFeedback.BoolValue);
|
||||||
|
|||||||
@@ -4,4 +4,4 @@
|
|||||||
[assembly: AssemblyCompany("PepperDash Technology Corp")]
|
[assembly: AssemblyCompany("PepperDash Technology Corp")]
|
||||||
[assembly: AssemblyProduct("Essentials_Devices_Common")]
|
[assembly: AssemblyProduct("Essentials_Devices_Common")]
|
||||||
[assembly: AssemblyCopyright("Copyright © 2019")]
|
[assembly: AssemblyCopyright("Copyright © 2019")]
|
||||||
[assembly: AssemblyVersion("1.3.*")]
|
[assembly: AssemblyVersion("1.4.*")]
|
||||||
Reference in New Issue
Block a user