mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-01-15 21:44:54 +00:00
Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
89db680986 | ||
|
|
11a01c707c | ||
|
|
db08b1fcd9 | ||
|
|
9c0440e8f0 | ||
|
|
2173116664 | ||
|
|
419d956a8d | ||
|
|
f44bde2d83 | ||
|
|
6c7bc1a24e | ||
|
|
af62bf86a5 | ||
|
|
905c40dc0a | ||
|
|
492d8f8203 | ||
|
|
dd7408dbf1 | ||
|
|
52c387081c | ||
|
|
0eb6411dd9 |
@@ -103,11 +103,14 @@ namespace PepperDash.Essentials.Bridges
|
||||
(device as DisplayBase).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
||||
continue;
|
||||
}
|
||||
else if (device is DmChassisController)
|
||||
{
|
||||
else if (device is DmChassisController) {
|
||||
(device as DmChassisController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
||||
continue;
|
||||
}
|
||||
else if (device is DmBladeChassisController) {
|
||||
(device as DmBladeChassisController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
||||
continue;
|
||||
}
|
||||
else if (device is DmpsRoutingController)
|
||||
{
|
||||
(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"));
|
||||
|
||||
var chassis = dmChassis.Chassis as DmMDMnxn;
|
||||
|
||||
dmChassis.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
|
||||
|
||||
trilist.SetUShortSigAction(joinMap.SystemId, new Action<ushort>(o => dmChassis.Chassis.SystemId.UShortValue = o));
|
||||
trilist.SetSigTrueAction(joinMap.SystemId, new Action(() => dmChassis.Chassis.ApplySystemId()));
|
||||
trilist.SetUShortSigAction(joinMap.SystemId, new Action<ushort>(o => chassis.SystemId.UShortValue = o));
|
||||
trilist.SetSigTrueAction(joinMap.SystemId, new Action(() => chassis.ApplySystemId()));
|
||||
|
||||
dmChassis.SystemIdFeebdack.LinkInputSig(trilist.UShortInput[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.Cotija;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace PepperDash.Essentials
|
||||
{
|
||||
public class ControlSystem : CrestronControlSystem
|
||||
@@ -359,21 +361,7 @@ namespace PepperDash.Essentials
|
||||
|
||||
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
|
||||
DeviceManager.AddDevice(new PepperDash.Essentials.Core.Monitoring.SystemMonitorController("systemMonitor"));
|
||||
@@ -390,7 +378,26 @@ namespace PepperDash.Essentials
|
||||
if (devConf.Type.ToLower() != Global.ControlSystem.ControllerPrompt.ToLower())
|
||||
Debug.Console(0,
|
||||
"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;
|
||||
}
|
||||
|
||||
@@ -121,6 +121,8 @@
|
||||
<Compile Include="Bridges\BridgeFactory.cs" />
|
||||
<Compile Include="Bridges\CameraControllerBridge.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\DmpsRoutingControllerBridge.cs" />
|
||||
<Compile Include="Bridges\DisplayControllerBridge.cs" />
|
||||
|
||||
@@ -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()
|
||||
{
|
||||
|
||||
|
||||
// Set input and output names from config
|
||||
if (InputNames != null)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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
|
||||
Dmps.DMInputChange += new DMInputEventHandler(Dmps_DMInputChange);
|
||||
@@ -213,10 +223,10 @@ namespace PepperDash.Essentials.DM
|
||||
{
|
||||
var inputCard = card as DMInput;
|
||||
|
||||
Debug.Console(1, this, "Adding Input Card Number {0} Type: {1}", inputCard.Number, inputCard.CardInputOutputType.ToString());
|
||||
|
||||
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; });
|
||||
|
||||
if (inputCard.VideoDetectedFeedback != null)
|
||||
@@ -226,23 +236,28 @@ namespace PepperDash.Essentials.DM
|
||||
return inputCard.VideoDetectedFeedback.BoolValue;
|
||||
});
|
||||
}
|
||||
|
||||
InputNameFeedbacks[inputCard.Number] = new StringFeedback(() =>
|
||||
{
|
||||
if (inputCard.NameFeedback != null && !string.IsNullOrEmpty(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
|
||||
{
|
||||
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 "";
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
var hdmiInputCard = inputCard as Card.Dmps3HdmiInput;
|
||||
var hdmiInputCard = inputCard as Card.Dmps3HdmiInputWithoutAnalogAudio;
|
||||
|
||||
var cecPort = hdmiInputCard.HdmiInputPort;
|
||||
|
||||
@@ -272,8 +287,6 @@ namespace PepperDash.Essentials.DM
|
||||
}
|
||||
else if (inputCard is Card.Dmps3HdmiVgaInput)
|
||||
{
|
||||
// TODO: Build a virtual TX device and assign the ports to it
|
||||
|
||||
var hdmiVgaInputCard = inputCard as Card.Dmps3HdmiVgaInput;
|
||||
|
||||
DmpsInternalVirtualHdmiVgaInputController inputCardController = new DmpsInternalVirtualHdmiVgaInputController(Key +
|
||||
@@ -285,8 +298,6 @@ namespace PepperDash.Essentials.DM
|
||||
}
|
||||
else if (inputCard is Card.Dmps3HdmiVgaBncInput)
|
||||
{
|
||||
// TODO: Build a virtual TX device and assign the ports to it
|
||||
|
||||
var hdmiVgaBncInputCard = inputCard as Card.Dmps3HdmiVgaBncInput;
|
||||
|
||||
DmpsInternalVirtualHdmiVgaBncInputController inputCardController = new DmpsInternalVirtualHdmiVgaBncInputController(Key +
|
||||
@@ -309,8 +320,6 @@ namespace PepperDash.Essentials.DM
|
||||
{
|
||||
var airMediaInputCard = inputCard as Card.Dmps3AirMediaInput;
|
||||
|
||||
|
||||
|
||||
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;
|
||||
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
|
||||
if ((sigType | eRoutingSignalType.Video) == eRoutingSignalType.Video)
|
||||
{
|
||||
|
||||
//SystemControl.VideoEnter.BoolValue = true;
|
||||
if (outCard != null && outCard.VideoOut != null)
|
||||
if (outCard != null)
|
||||
outCard.VideoOut = inCard;
|
||||
}
|
||||
|
||||
if ((sigType | eRoutingSignalType.Audio) == eRoutingSignalType.Audio)
|
||||
{
|
||||
if (outCard != null && outCard.AudioOut != null)
|
||||
if (outCard != null)
|
||||
outCard.AudioOut = inCard;
|
||||
}
|
||||
|
||||
if ((sigType | eRoutingSignalType.UsbOutput) == eRoutingSignalType.UsbOutput)
|
||||
{
|
||||
if (outCard != null && outCard.USBRoutedTo != null)
|
||||
if (outCard != null)
|
||||
outCard.USBRoutedTo = inCard;
|
||||
}
|
||||
|
||||
if ((sigType | eRoutingSignalType.UsbInput) == eRoutingSignalType.UsbInput)
|
||||
{
|
||||
if (inCard != null && inCard.USBRoutedTo != null)
|
||||
if (inCard != null)
|
||||
inCard.USBRoutedTo = outCard;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Console(1, this, "Unable to execute route from input {0} to output {1}. Input card not available", inputSelector, outputSelector);
|
||||
}
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// Debug.Console(1, this, "Unable to execute route from input {0} to output {1}. Input card not available", inputSelector, outputSelector);
|
||||
//}
|
||||
|
||||
}
|
||||
else
|
||||
|
||||
@@ -1,97 +1,99 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharp.CrestronIO;
|
||||
using Crestron.SimplSharpPro;
|
||||
using Crestron.SimplSharpPro.DM;
|
||||
using Crestron.SimplSharpPro.DM.AirMedia;
|
||||
using Crestron.SimplSharpPro.UI;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.Config;
|
||||
using PepperDash.Essentials.DM.AirMedia;
|
||||
using PepperDash.Essentials.DM.Endpoints.DGEs;
|
||||
|
||||
namespace PepperDash.Essentials.DM
|
||||
{
|
||||
public class DeviceFactory
|
||||
{
|
||||
public static IKeyed GetDevice(DeviceConfig dc)
|
||||
{
|
||||
var key = dc.Key;
|
||||
var name = dc.Name;
|
||||
var type = dc.Type;
|
||||
var properties = dc.Properties;
|
||||
|
||||
var typeName = dc.Type.ToLower();
|
||||
|
||||
if (typeName.StartsWith("am"))
|
||||
{
|
||||
var props = JsonConvert.DeserializeObject<AirMediaPropertiesConfig>(properties.ToString());
|
||||
AmX00 amDevice = null;
|
||||
if (typeName == "am200")
|
||||
amDevice = new Crestron.SimplSharpPro.DM.AirMedia.Am200(props.Control.IpIdInt, Global.ControlSystem);
|
||||
else if(typeName == "am300")
|
||||
amDevice = new Crestron.SimplSharpPro.DM.AirMedia.Am300(props.Control.IpIdInt, Global.ControlSystem);
|
||||
|
||||
return new AirMediaController(key, name, amDevice, dc, props);
|
||||
}
|
||||
else if (typeName.StartsWith("dmmd8x") || typeName.StartsWith("dmmd16x") || typeName.StartsWith("dmmd32x"))
|
||||
{
|
||||
var props = JsonConvert.DeserializeObject
|
||||
<PepperDash.Essentials.DM.Config.DMChassisPropertiesConfig>(properties.ToString());
|
||||
return PepperDash.Essentials.DM.DmChassisController.
|
||||
GetDmChassisController(key, name, type, props);
|
||||
}
|
||||
// Hand off to DmTxHelper class
|
||||
else if (typeName.StartsWith("dmtx"))
|
||||
{
|
||||
var props = JsonConvert.DeserializeObject
|
||||
<PepperDash.Essentials.DM.Config.DmTxPropertiesConfig>(properties.ToString());
|
||||
return PepperDash.Essentials.DM.DmTxHelper.GetDmTxController(key, name, type, props);
|
||||
}
|
||||
|
||||
// Hand off to DmRmcHelper class
|
||||
else if (typeName.StartsWith("dmrmc"))
|
||||
{
|
||||
var props = JsonConvert.DeserializeObject
|
||||
<PepperDash.Essentials.DM.Config.DmRmcPropertiesConfig>(properties.ToString());
|
||||
return PepperDash.Essentials.DM.DmRmcHelper.GetDmRmcController(key, name, type, props);
|
||||
}
|
||||
|
||||
else if (typeName.Equals("hdmd4x14ke"))
|
||||
{
|
||||
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("hdmd400ce") || typeName.Equals("hdmd300ce") || typeName.Equals("hdmd200ce") || typeName.Equals("hdmd200c1ge"))
|
||||
{
|
||||
var props = JsonConvert.DeserializeObject
|
||||
<PepperDash.Essentials.DM.HdMdxxxCEPropertiesConfig>(properties.ToString());
|
||||
|
||||
if (typeName.Equals("hdmd400ce"))
|
||||
return new PepperDash.Essentials.DM.HdMdxxxCEController(key, name,
|
||||
new HdMd400CE(props.Control.IpIdInt, props.Control.TcpSshProperties.Address, Global.ControlSystem));
|
||||
else if (typeName.Equals("hdmd300ce"))
|
||||
return new PepperDash.Essentials.DM.HdMdxxxCEController(key, name,
|
||||
new HdMd300CE(props.Control.IpIdInt, props.Control.TcpSshProperties.Address, Global.ControlSystem));
|
||||
else if (typeName.Equals("hdmd200ce"))
|
||||
return new PepperDash.Essentials.DM.HdMdxxxCEController(key, name,
|
||||
new HdMd200CE(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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharp.CrestronIO;
|
||||
using Crestron.SimplSharpPro;
|
||||
using Crestron.SimplSharpPro.DM;
|
||||
using Crestron.SimplSharpPro.DM.AirMedia;
|
||||
using Crestron.SimplSharpPro.UI;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.Config;
|
||||
using PepperDash.Essentials.DM.AirMedia;
|
||||
using PepperDash.Essentials.DM.Endpoints.DGEs;
|
||||
|
||||
namespace PepperDash.Essentials.DM
|
||||
{
|
||||
public class DeviceFactory
|
||||
{
|
||||
public static IKeyed GetDevice(DeviceConfig dc)
|
||||
{
|
||||
var key = dc.Key;
|
||||
var name = dc.Name;
|
||||
var type = dc.Type;
|
||||
var properties = dc.Properties;
|
||||
|
||||
var typeName = dc.Type.ToLower();
|
||||
|
||||
if (typeName.StartsWith("am"))
|
||||
{
|
||||
var props = JsonConvert.DeserializeObject<AirMediaPropertiesConfig>(properties.ToString());
|
||||
AmX00 amDevice = null;
|
||||
if (typeName == "am200")
|
||||
amDevice = new Crestron.SimplSharpPro.DM.AirMedia.Am200(props.Control.IpIdInt, Global.ControlSystem);
|
||||
else if(typeName == "am300")
|
||||
amDevice = new Crestron.SimplSharpPro.DM.AirMedia.Am300(props.Control.IpIdInt, Global.ControlSystem);
|
||||
|
||||
return new AirMediaController(key, name, amDevice, dc, props);
|
||||
}
|
||||
else if (typeName.StartsWith("dmmd8x") || typeName.StartsWith("dmmd16x") || typeName.StartsWith("dmmd32x"))
|
||||
{
|
||||
var props = JsonConvert.DeserializeObject
|
||||
<PepperDash.Essentials.DM.Config.DMChassisPropertiesConfig>(properties.ToString());
|
||||
return PepperDash.Essentials.DM.DmChassisController.
|
||||
GetDmChassisController(key, name, type, props);
|
||||
}
|
||||
else if (typeName.StartsWith("dmmd128x") || typeName.StartsWith("dmmd64x")) {
|
||||
var props = JsonConvert.DeserializeObject
|
||||
<PepperDash.Essentials.DM.Config.DMChassisPropertiesConfig>(properties.ToString());
|
||||
return PepperDash.Essentials.DM.DmBladeChassisController.
|
||||
GetDmChassisController(key, name, type, props);
|
||||
}
|
||||
// Hand off to DmTxHelper class
|
||||
else if (typeName.StartsWith("dmtx")) {
|
||||
var props = JsonConvert.DeserializeObject
|
||||
<PepperDash.Essentials.DM.Config.DmTxPropertiesConfig>(properties.ToString());
|
||||
return PepperDash.Essentials.DM.DmTxHelper.GetDmTxController(key, name, type, props);
|
||||
}
|
||||
|
||||
// Hand off to DmRmcHelper class
|
||||
else if (typeName.StartsWith("dmrmc")) {
|
||||
var props = JsonConvert.DeserializeObject
|
||||
<PepperDash.Essentials.DM.Config.DmRmcPropertiesConfig>(properties.ToString());
|
||||
return PepperDash.Essentials.DM.DmRmcHelper.GetDmRmcController(key, name, type, props);
|
||||
}
|
||||
|
||||
else if (typeName.Equals("hdmd4x14ke")) {
|
||||
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("hdmd400ce") || typeName.Equals("hdmd300ce") || typeName.Equals("hdmd200ce") || typeName.Equals("hdmd200c1ge")) {
|
||||
var props = JsonConvert.DeserializeObject
|
||||
<PepperDash.Essentials.DM.HdMdxxxCEPropertiesConfig>(properties.ToString());
|
||||
|
||||
if (typeName.Equals("hdmd400ce"))
|
||||
return new PepperDash.Essentials.DM.HdMdxxxCEController(key, name,
|
||||
new HdMd400CE(props.Control.IpIdInt, props.Control.TcpSshProperties.Address, Global.ControlSystem));
|
||||
else if (typeName.Equals("hdmd300ce"))
|
||||
return new PepperDash.Essentials.DM.HdMdxxxCEController(key, name,
|
||||
new HdMd300CE(props.Control.IpIdInt, props.Control.TcpSshProperties.Address, Global.ControlSystem));
|
||||
else if (typeName.Equals("hdmd200ce"))
|
||||
return new PepperDash.Essentials.DM.HdMdxxxCEController(key, name,
|
||||
new HdMd200CE(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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,256 +1,257 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
using Crestron.SimplSharpPro.DM;
|
||||
using Crestron.SimplSharpPro.DM.Endpoints;
|
||||
using Crestron.SimplSharpPro.DM.Endpoints.Receivers;
|
||||
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.DM.Config;
|
||||
|
||||
namespace PepperDash.Essentials.DM
|
||||
{
|
||||
public abstract class DmRmcControllerBase : CrestronGenericBaseDevice
|
||||
{
|
||||
public virtual StringFeedback VideoOutputResolutionFeedback { get; protected set; }
|
||||
public virtual StringFeedback EdidManufacturerFeedback { get; protected set; }
|
||||
public virtual StringFeedback EdidNameFeedback { get; protected set; }
|
||||
public virtual StringFeedback EdidPreferredTimingFeedback { get; protected set; }
|
||||
public virtual StringFeedback EdidSerialNumberFeedback { get; protected set; }
|
||||
|
||||
public DmRmcControllerBase(string key, string name, EndpointReceiverBase device)
|
||||
: base(key, name, device)
|
||||
{
|
||||
// if wired to a chassis, skip registration step in base class
|
||||
if (device.DMOutput != null)
|
||||
{
|
||||
this.PreventRegistration = true;
|
||||
}
|
||||
AddToFeedbackList(VideoOutputResolutionFeedback, EdidManufacturerFeedback, EdidSerialNumberFeedback, EdidNameFeedback, EdidPreferredTimingFeedback);
|
||||
}
|
||||
}
|
||||
|
||||
public abstract class DmHdBaseTControllerBase : CrestronGenericBaseDevice
|
||||
{
|
||||
public HDBaseTBase Rmc { get; protected set; }
|
||||
|
||||
/// <summary>
|
||||
/// Make a Crestron RMC and put it in here
|
||||
/// </summary>
|
||||
public DmHdBaseTControllerBase(string key, string name, HDBaseTBase rmc)
|
||||
: base(key, name, rmc)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public class DmRmcHelper
|
||||
{
|
||||
/// <summary>
|
||||
/// A factory method for various DmTxControllers
|
||||
/// </summary>
|
||||
/// <param name="key"></param>
|
||||
/// <param name="name"></param>
|
||||
/// <param name="props"></param>
|
||||
/// <returns></returns>
|
||||
public static CrestronGenericBaseDevice GetDmRmcController(string key, string name, string typeName, DmRmcPropertiesConfig props)
|
||||
{
|
||||
// switch on type name... later...
|
||||
|
||||
typeName = typeName.ToLower();
|
||||
uint ipid = props.Control.IpIdInt; // Convert.ToUInt16(props.Id, 16);
|
||||
|
||||
|
||||
|
||||
// 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
|
||||
// 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
|
||||
// output number from the tie line and use that to plug it in.
|
||||
// Example of chassis-connected:
|
||||
//{
|
||||
// "sourceKey": "dmMd8x8-1",
|
||||
// "sourcePort": "anyOut2",
|
||||
// "destinationKey": "dmRmc100C-2",
|
||||
// "destinationPort": "DmIn"
|
||||
//}
|
||||
|
||||
// Tx -> RMC link:
|
||||
//{
|
||||
// "sourceKey": "dmTx201C-1",
|
||||
// "sourcePort": "DmOut",
|
||||
// "destinationKey": "dmRmc100C-2",
|
||||
// "destinationPort": "DmIn"
|
||||
//}
|
||||
|
||||
var tlc = TieLineCollection.Default;
|
||||
// grab the tie line that has this key as
|
||||
// THIS DOESN'T WORK BECAUSE THE RMC THAT WE NEED (THIS) HASN'T BEEN MADE
|
||||
// YET AND THUS WILL NOT HAVE A TIE LINE...
|
||||
var inputTieLine = tlc.FirstOrDefault(t =>
|
||||
{
|
||||
var d = t.DestinationPort.ParentDevice;
|
||||
return d.Key.Equals(key, StringComparison.OrdinalIgnoreCase)
|
||||
&& d is DmChassisController;
|
||||
});
|
||||
|
||||
var pKey = props.ParentDeviceKey.ToLower();
|
||||
|
||||
|
||||
|
||||
|
||||
// Non-DM-chassis endpoints
|
||||
if (pKey == "processor")
|
||||
{
|
||||
// Catch constructor failures, mainly dues to IPID
|
||||
try
|
||||
{
|
||||
if (typeName.StartsWith("dmrmc100c"))
|
||||
return new DmRmcX100CController(key, name, new DmRmc100C(ipid, Global.ControlSystem));
|
||||
if (typeName.StartsWith("dmrmc100s"))
|
||||
return new DmRmc100SController(key, name, new DmRmc100S(ipid, Global.ControlSystem));
|
||||
if (typeName.StartsWith("dmrmc4k100c"))
|
||||
return new DmRmcX100CController(key, name, new DmRmc4k100C(ipid, Global.ControlSystem));
|
||||
if (typeName.StartsWith("dmrmc4kz100c"))
|
||||
return new DmRmcX100CController(key, name, new DmRmc4kz100C(ipid, Global.ControlSystem));
|
||||
if (typeName.StartsWith("dmrmc150s"))
|
||||
return new DmRmc150SController(key, name, new DmRmc150S(ipid, Global.ControlSystem));
|
||||
if (typeName.StartsWith("dmrmc200c"))
|
||||
return new DmRmc200CController(key, name, new DmRmc200C(ipid, Global.ControlSystem));
|
||||
if (typeName.StartsWith("dmrmc200s"))
|
||||
return new DmRmc200SController(key, name, new DmRmc200S(ipid, Global.ControlSystem));
|
||||
if (typeName.StartsWith("dmrmc200s2"))
|
||||
return new DmRmc200S2Controller(key, name, new DmRmc200S2(ipid, Global.ControlSystem));
|
||||
if (typeName.StartsWith("dmrmcscalerc"))
|
||||
return new DmRmcScalerCController(key, name, new DmRmcScalerC(ipid, Global.ControlSystem));
|
||||
if (typeName.StartsWith("dmrmcscalers"))
|
||||
return new DmRmcScalerSController(key, name, new DmRmcScalerS(ipid, Global.ControlSystem));
|
||||
if (typeName.StartsWith("dmrmcscalers2"))
|
||||
return new DmRmcScalerS2Controller(key, name, new DmRmcScalerS2(ipid, Global.ControlSystem));
|
||||
if (typeName.StartsWith("dmrmc4kscalerc"))
|
||||
return new DmRmc4kScalerCController(key, name, new DmRmc4kScalerC(ipid, Global.ControlSystem));
|
||||
if (typeName.StartsWith("dmrmc4kscalercdsp"))
|
||||
return new DmRmc4kScalerCDspController(key, name, new DmRmc4kScalerCDsp(ipid, Global.ControlSystem));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
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);
|
||||
}
|
||||
// Endpoints attached to DM Chassis
|
||||
else
|
||||
{
|
||||
var parentDev = DeviceManager.GetDeviceForKey(pKey);
|
||||
if (!(parentDev is DmChassisController))
|
||||
{
|
||||
Debug.Console(0, "Cannot create DM device '{0}'. '{1}' is not a DM Chassis.",
|
||||
key, pKey);
|
||||
return null;
|
||||
}
|
||||
|
||||
var chassis = (parentDev as DmChassisController).Chassis;
|
||||
var num = props.ParentOutputNumber;
|
||||
if (num <= 0 || num > chassis.NumberOfOutputs)
|
||||
{
|
||||
Debug.Console(0, "Cannot create DM device '{0}'. Output number '{1}' is out of range",
|
||||
key, num);
|
||||
return null;
|
||||
}
|
||||
else
|
||||
{
|
||||
var controller = (parentDev as DmChassisController);
|
||||
controller.RxDictionary.Add(num, key);
|
||||
}
|
||||
// Catch constructor failures, mainly dues to IPID
|
||||
try
|
||||
{
|
||||
|
||||
// Must use different constructor for CPU3 chassis types. No IPID
|
||||
if (chassis is DmMd8x8Cpu3 || chassis is DmMd16x16Cpu3 ||
|
||||
chassis is DmMd32x32Cpu3 || chassis is DmMd8x8Cpu3rps ||
|
||||
chassis is DmMd16x16Cpu3rps || chassis is DmMd32x32Cpu3rps)
|
||||
{
|
||||
if (typeName.StartsWith("hdbasetrx"))
|
||||
return new HDBaseTRxController(key, name, new HDRx3CB(chassis.Outputs[num]));
|
||||
if (typeName.StartsWith("dmrmc4k100c1g"))
|
||||
return new DmRmc4k100C1GController(key, name, new DmRmc4K100C1G(chassis.Outputs[num]));
|
||||
if (typeName.StartsWith("dmrmc100c"))
|
||||
return new DmRmcX100CController(key, name, new DmRmc100C(chassis.Outputs[num]));
|
||||
if (typeName.StartsWith("dmrmc100s"))
|
||||
return new DmRmc100SController(key, name, new DmRmc100S(chassis.Outputs[num]));
|
||||
if (typeName.StartsWith("dmrmc4k100c"))
|
||||
return new DmRmcX100CController(key, name, new DmRmc4k100C(chassis.Outputs[num]));
|
||||
if (typeName.StartsWith("dmrmc4kz100c"))
|
||||
return new DmRmcX100CController(key, name, new DmRmc4kz100C(chassis.Outputs[num]));
|
||||
if (typeName.StartsWith("dmrmc150s"))
|
||||
return new DmRmc150SController(key, name, new DmRmc150S(chassis.Outputs[num]));
|
||||
if (typeName.StartsWith("dmrmc200c"))
|
||||
return new DmRmc200CController(key, name, new DmRmc200C(chassis.Outputs[num]));
|
||||
if (typeName.StartsWith("dmrmc200s"))
|
||||
return new DmRmc200SController(key, name, new DmRmc200S(chassis.Outputs[num]));
|
||||
if (typeName.StartsWith("dmrmc200s2"))
|
||||
return new DmRmc200S2Controller(key, name, new DmRmc200S2(chassis.Outputs[num]));
|
||||
if (typeName.StartsWith("dmrmcscalerc"))
|
||||
return new DmRmcScalerCController(key, name, new DmRmcScalerC(chassis.Outputs[num]));
|
||||
if (typeName.StartsWith("dmrmcscalers"))
|
||||
return new DmRmcScalerSController(key, name, new DmRmcScalerS(chassis.Outputs[num]));
|
||||
if (typeName.StartsWith("dmrmcscalers2"))
|
||||
return new DmRmcScalerS2Controller(key, name, new DmRmcScalerS2(chassis.Outputs[num]));
|
||||
if (typeName.StartsWith("dmrmc4kscalerc"))
|
||||
return new DmRmc4kScalerCController(key, name, new DmRmc4kScalerC(chassis.Outputs[num]));
|
||||
if (typeName.StartsWith("dmrmc4kscalercdsp"))
|
||||
return new DmRmc4kScalerCDspController(key, name, new DmRmc4kScalerCDsp(chassis.Outputs[num]));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (typeName.StartsWith("hdbasetrx"))
|
||||
return new HDBaseTRxController(key, name, new HDRx3CB(ipid, chassis.Outputs[num]));
|
||||
if (typeName.StartsWith("dmrmc4k100c1g"))
|
||||
return new DmRmc4k100C1GController(key, name, new DmRmc4K100C1G(ipid, chassis.Outputs[num]));
|
||||
if (typeName.StartsWith("dmrmc100c"))
|
||||
return new DmRmcX100CController(key, name, new DmRmc100C(ipid, chassis.Outputs[num]));
|
||||
if (typeName.StartsWith("dmrmc100s"))
|
||||
return new DmRmc100SController(key, name, new DmRmc100S(ipid, chassis.Outputs[num]));
|
||||
if (typeName.StartsWith("dmrmc4k100c"))
|
||||
return new DmRmcX100CController(key, name, new DmRmc4k100C(ipid, chassis.Outputs[num]));
|
||||
if (typeName.StartsWith("dmrmc4kz100c"))
|
||||
return new DmRmcX100CController(key, name, new DmRmc4kz100C(ipid, chassis.Outputs[num]));
|
||||
if (typeName.StartsWith("dmrmc150s"))
|
||||
return new DmRmc150SController(key, name, new DmRmc150S(ipid, chassis.Outputs[num]));
|
||||
if (typeName.StartsWith("dmrmc200c"))
|
||||
return new DmRmc200CController(key, name, new DmRmc200C(ipid, chassis.Outputs[num]));
|
||||
if (typeName.StartsWith("dmrmc200s"))
|
||||
return new DmRmc200SController(key, name, new DmRmc200S(ipid, chassis.Outputs[num]));
|
||||
if (typeName.StartsWith("dmrmc200s2"))
|
||||
return new DmRmc200S2Controller(key, name, new DmRmc200S2(ipid, chassis.Outputs[num]));
|
||||
if (typeName.StartsWith("dmrmcscalerc"))
|
||||
return new DmRmcScalerCController(key, name, new DmRmcScalerC(ipid, chassis.Outputs[num]));
|
||||
if (typeName.StartsWith("dmrmcscalers"))
|
||||
return new DmRmcScalerSController(key, name, new DmRmcScalerS(ipid, chassis.Outputs[num]));
|
||||
if (typeName.StartsWith("dmrmcscalers2"))
|
||||
return new DmRmcScalerS2Controller(key, name, new DmRmcScalerS2(ipid, chassis.Outputs[num]));
|
||||
if (typeName.StartsWith("dmrmc4kscalerc"))
|
||||
return new DmRmc4kScalerCController(key, name, new DmRmc4kScalerC(ipid, chassis.Outputs[num]));
|
||||
if (typeName.StartsWith("dmrmc4kscalercdsp"))
|
||||
return new DmRmc4kScalerCDspController(key, name, new DmRmc4kScalerCDsp(ipid, chassis.Outputs[num]));
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.Console(0, "[{0}] WARNING: Cannot create DM-RMC device: {1}", key, e.Message);
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
using Crestron.SimplSharpPro.DM;
|
||||
using Crestron.SimplSharpPro.DM.Endpoints;
|
||||
using Crestron.SimplSharpPro.DM.Endpoints.Receivers;
|
||||
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.DM.Config;
|
||||
|
||||
namespace PepperDash.Essentials.DM
|
||||
{
|
||||
public abstract class DmRmcControllerBase : CrestronGenericBaseDevice
|
||||
{
|
||||
public virtual StringFeedback VideoOutputResolutionFeedback { get; protected set; }
|
||||
public virtual StringFeedback EdidManufacturerFeedback { get; protected set; }
|
||||
public virtual StringFeedback EdidNameFeedback { get; protected set; }
|
||||
public virtual StringFeedback EdidPreferredTimingFeedback { get; protected set; }
|
||||
public virtual StringFeedback EdidSerialNumberFeedback { get; protected set; }
|
||||
|
||||
public DmRmcControllerBase(string key, string name, EndpointReceiverBase device)
|
||||
: base(key, name, device)
|
||||
{
|
||||
// if wired to a chassis, skip registration step in base class
|
||||
if (device.DMOutput != null)
|
||||
{
|
||||
this.PreventRegistration = true;
|
||||
}
|
||||
AddToFeedbackList(VideoOutputResolutionFeedback, EdidManufacturerFeedback, EdidSerialNumberFeedback, EdidNameFeedback, EdidPreferredTimingFeedback);
|
||||
}
|
||||
}
|
||||
|
||||
public abstract class DmHdBaseTControllerBase : CrestronGenericBaseDevice
|
||||
{
|
||||
public HDBaseTBase Rmc { get; protected set; }
|
||||
|
||||
/// <summary>
|
||||
/// Make a Crestron RMC and put it in here
|
||||
/// </summary>
|
||||
public DmHdBaseTControllerBase(string key, string name, HDBaseTBase rmc)
|
||||
: base(key, name, rmc)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public class DmRmcHelper
|
||||
{
|
||||
/// <summary>
|
||||
/// A factory method for various DmTxControllers
|
||||
/// </summary>
|
||||
/// <param name="key"></param>
|
||||
/// <param name="name"></param>
|
||||
/// <param name="props"></param>
|
||||
/// <returns></returns>
|
||||
public static CrestronGenericBaseDevice GetDmRmcController(string key, string name, string typeName, DmRmcPropertiesConfig props)
|
||||
{
|
||||
// switch on type name... later...
|
||||
|
||||
typeName = typeName.ToLower();
|
||||
uint ipid = props.Control.IpIdInt; // Convert.ToUInt16(props.Id, 16);
|
||||
|
||||
|
||||
|
||||
// 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
|
||||
// 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
|
||||
// output number from the tie line and use that to plug it in.
|
||||
// Example of chassis-connected:
|
||||
//{
|
||||
// "sourceKey": "dmMd8x8-1",
|
||||
// "sourcePort": "anyOut2",
|
||||
// "destinationKey": "dmRmc100C-2",
|
||||
// "destinationPort": "DmIn"
|
||||
//}
|
||||
|
||||
// Tx -> RMC link:
|
||||
//{
|
||||
// "sourceKey": "dmTx201C-1",
|
||||
// "sourcePort": "DmOut",
|
||||
// "destinationKey": "dmRmc100C-2",
|
||||
// "destinationPort": "DmIn"
|
||||
//}
|
||||
|
||||
var tlc = TieLineCollection.Default;
|
||||
// grab the tie line that has this key as
|
||||
// THIS DOESN'T WORK BECAUSE THE RMC THAT WE NEED (THIS) HASN'T BEEN MADE
|
||||
// YET AND THUS WILL NOT HAVE A TIE LINE...
|
||||
var inputTieLine = tlc.FirstOrDefault(t =>
|
||||
{
|
||||
var d = t.DestinationPort.ParentDevice;
|
||||
return d.Key.Equals(key, StringComparison.OrdinalIgnoreCase)
|
||||
&& d is DmChassisController;
|
||||
});
|
||||
|
||||
var pKey = props.ParentDeviceKey.ToLower();
|
||||
|
||||
|
||||
|
||||
|
||||
// Non-DM-chassis endpoints
|
||||
if (pKey == "processor")
|
||||
{
|
||||
// Catch constructor failures, mainly dues to IPID
|
||||
try
|
||||
{
|
||||
if (typeName.StartsWith("dmrmc100c"))
|
||||
return new DmRmcX100CController(key, name, new DmRmc100C(ipid, Global.ControlSystem));
|
||||
if (typeName.StartsWith("dmrmc100s"))
|
||||
return new DmRmc100SController(key, name, new DmRmc100S(ipid, Global.ControlSystem));
|
||||
if (typeName.StartsWith("dmrmc4k100c"))
|
||||
return new DmRmcX100CController(key, name, new DmRmc4k100C(ipid, Global.ControlSystem));
|
||||
if (typeName.StartsWith("dmrmc4kz100c"))
|
||||
return new DmRmcX100CController(key, name, new DmRmc4kz100C(ipid, Global.ControlSystem));
|
||||
if (typeName.StartsWith("dmrmc150s"))
|
||||
return new DmRmc150SController(key, name, new DmRmc150S(ipid, Global.ControlSystem));
|
||||
if (typeName.StartsWith("dmrmc200c"))
|
||||
return new DmRmc200CController(key, name, new DmRmc200C(ipid, Global.ControlSystem));
|
||||
if (typeName.StartsWith("dmrmc200s"))
|
||||
return new DmRmc200SController(key, name, new DmRmc200S(ipid, Global.ControlSystem));
|
||||
if (typeName.StartsWith("dmrmc200s2"))
|
||||
return new DmRmc200S2Controller(key, name, new DmRmc200S2(ipid, Global.ControlSystem));
|
||||
if (typeName.StartsWith("dmrmcscalerc"))
|
||||
return new DmRmcScalerCController(key, name, new DmRmcScalerC(ipid, Global.ControlSystem));
|
||||
if (typeName.StartsWith("dmrmcscalers"))
|
||||
return new DmRmcScalerSController(key, name, new DmRmcScalerS(ipid, Global.ControlSystem));
|
||||
if (typeName.StartsWith("dmrmcscalers2"))
|
||||
return new DmRmcScalerS2Controller(key, name, new DmRmcScalerS2(ipid, Global.ControlSystem));
|
||||
if (typeName.StartsWith("dmrmc4kscalerc"))
|
||||
return new DmRmc4kScalerCController(key, name, new DmRmc4kScalerC(ipid, Global.ControlSystem));
|
||||
if (typeName.StartsWith("dmrmc4kscalercdsp"))
|
||||
return new DmRmc4kScalerCDspController(key, name, new DmRmc4kScalerCDsp(ipid, Global.ControlSystem));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
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);
|
||||
}
|
||||
// Endpoints attached to DM Chassis
|
||||
else
|
||||
{
|
||||
var parentDev = DeviceManager.GetDeviceForKey(pKey);
|
||||
if (!(parentDev is IDmSwitch))
|
||||
{
|
||||
Debug.Console(0, "Cannot create DM device '{0}'. '{1}' is not a DM Chassis.",
|
||||
key, pKey);
|
||||
return null;
|
||||
}
|
||||
|
||||
var chassis = (parentDev as IDmSwitch).Chassis;
|
||||
var num = props.ParentOutputNumber;
|
||||
if (num <= 0 || num > chassis.NumberOfOutputs)
|
||||
{
|
||||
Debug.Console(0, "Cannot create DM device '{0}'. Output number '{1}' is out of range",
|
||||
key, num);
|
||||
return null;
|
||||
}
|
||||
else
|
||||
{
|
||||
var controller = (parentDev as IDmSwitch);
|
||||
controller.RxDictionary.Add(num, key);
|
||||
}
|
||||
// Catch constructor failures, mainly dues to IPID
|
||||
try
|
||||
{
|
||||
|
||||
// Must use different constructor for CPU3 chassis types. No IPID
|
||||
if (chassis is DmMd8x8Cpu3 || chassis is DmMd16x16Cpu3 ||
|
||||
chassis is DmMd32x32Cpu3 || chassis is DmMd8x8Cpu3rps ||
|
||||
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("dmrmc4k100c1g"))
|
||||
return new DmRmc4k100C1GController(key, name, new DmRmc4K100C1G(chassis.Outputs[num]));
|
||||
if (typeName.StartsWith("dmrmc100c"))
|
||||
return new DmRmcX100CController(key, name, new DmRmc100C(chassis.Outputs[num]));
|
||||
if (typeName.StartsWith("dmrmc100s"))
|
||||
return new DmRmc100SController(key, name, new DmRmc100S(chassis.Outputs[num]));
|
||||
if (typeName.StartsWith("dmrmc4k100c"))
|
||||
return new DmRmcX100CController(key, name, new DmRmc4k100C(chassis.Outputs[num]));
|
||||
if (typeName.StartsWith("dmrmc4kz100c"))
|
||||
return new DmRmcX100CController(key, name, new DmRmc4kz100C(chassis.Outputs[num]));
|
||||
if (typeName.StartsWith("dmrmc150s"))
|
||||
return new DmRmc150SController(key, name, new DmRmc150S(chassis.Outputs[num]));
|
||||
if (typeName.StartsWith("dmrmc200c"))
|
||||
return new DmRmc200CController(key, name, new DmRmc200C(chassis.Outputs[num]));
|
||||
if (typeName.StartsWith("dmrmc200s"))
|
||||
return new DmRmc200SController(key, name, new DmRmc200S(chassis.Outputs[num]));
|
||||
if (typeName.StartsWith("dmrmc200s2"))
|
||||
return new DmRmc200S2Controller(key, name, new DmRmc200S2(chassis.Outputs[num]));
|
||||
if (typeName.StartsWith("dmrmcscalerc"))
|
||||
return new DmRmcScalerCController(key, name, new DmRmcScalerC(chassis.Outputs[num]));
|
||||
if (typeName.StartsWith("dmrmcscalers"))
|
||||
return new DmRmcScalerSController(key, name, new DmRmcScalerS(chassis.Outputs[num]));
|
||||
if (typeName.StartsWith("dmrmcscalers2"))
|
||||
return new DmRmcScalerS2Controller(key, name, new DmRmcScalerS2(chassis.Outputs[num]));
|
||||
if (typeName.StartsWith("dmrmc4kscalerc"))
|
||||
return new DmRmc4kScalerCController(key, name, new DmRmc4kScalerC(chassis.Outputs[num]));
|
||||
if (typeName.StartsWith("dmrmc4kscalercdsp"))
|
||||
return new DmRmc4kScalerCDspController(key, name, new DmRmc4kScalerCDsp(chassis.Outputs[num]));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (typeName.StartsWith("hdbasetrx"))
|
||||
return new HDBaseTRxController(key, name, new HDRx3CB(ipid, chassis.Outputs[num]));
|
||||
if (typeName.StartsWith("dmrmc4k100c1g"))
|
||||
return new DmRmc4k100C1GController(key, name, new DmRmc4K100C1G(ipid, chassis.Outputs[num]));
|
||||
if (typeName.StartsWith("dmrmc100c"))
|
||||
return new DmRmcX100CController(key, name, new DmRmc100C(ipid, chassis.Outputs[num]));
|
||||
if (typeName.StartsWith("dmrmc100s"))
|
||||
return new DmRmc100SController(key, name, new DmRmc100S(ipid, chassis.Outputs[num]));
|
||||
if (typeName.StartsWith("dmrmc4k100c"))
|
||||
return new DmRmcX100CController(key, name, new DmRmc4k100C(ipid, chassis.Outputs[num]));
|
||||
if (typeName.StartsWith("dmrmc4kz100c"))
|
||||
return new DmRmcX100CController(key, name, new DmRmc4kz100C(ipid, chassis.Outputs[num]));
|
||||
if (typeName.StartsWith("dmrmc150s"))
|
||||
return new DmRmc150SController(key, name, new DmRmc150S(ipid, chassis.Outputs[num]));
|
||||
if (typeName.StartsWith("dmrmc200c"))
|
||||
return new DmRmc200CController(key, name, new DmRmc200C(ipid, chassis.Outputs[num]));
|
||||
if (typeName.StartsWith("dmrmc200s"))
|
||||
return new DmRmc200SController(key, name, new DmRmc200S(ipid, chassis.Outputs[num]));
|
||||
if (typeName.StartsWith("dmrmc200s2"))
|
||||
return new DmRmc200S2Controller(key, name, new DmRmc200S2(ipid, chassis.Outputs[num]));
|
||||
if (typeName.StartsWith("dmrmcscalerc"))
|
||||
return new DmRmcScalerCController(key, name, new DmRmcScalerC(ipid, chassis.Outputs[num]));
|
||||
if (typeName.StartsWith("dmrmcscalers"))
|
||||
return new DmRmcScalerSController(key, name, new DmRmcScalerS(ipid, chassis.Outputs[num]));
|
||||
if (typeName.StartsWith("dmrmcscalers2"))
|
||||
return new DmRmcScalerS2Controller(key, name, new DmRmcScalerS2(ipid, chassis.Outputs[num]));
|
||||
if (typeName.StartsWith("dmrmc4kscalerc"))
|
||||
return new DmRmc4kScalerCController(key, name, new DmRmc4kScalerC(ipid, chassis.Outputs[num]));
|
||||
if (typeName.StartsWith("dmrmc4kscalercdsp"))
|
||||
return new DmRmc4kScalerCDspController(key, name, new DmRmc4kScalerCDsp(ipid, chassis.Outputs[num]));
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.Console(0, "[{0}] WARNING: Cannot create DM-RMC device: {1}", key, e.Message);
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,181 +1,182 @@
|
||||
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.Endpoints;
|
||||
using Crestron.SimplSharpPro.DM.Endpoints.Transmitters;
|
||||
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.DM.Config;
|
||||
|
||||
namespace PepperDash.Essentials.DM
|
||||
{
|
||||
public class DmTxHelper
|
||||
{
|
||||
/// <summary>
|
||||
/// A factory method for various DmTxControllers
|
||||
/// </summary>
|
||||
/// <param name="key"></param>
|
||||
/// <param name="name"></param>
|
||||
/// <param name="props"></param>
|
||||
/// <returns></returns>
|
||||
public static BasicDmTxControllerBase GetDmTxController(string key, string name, string typeName, DmTxPropertiesConfig props)
|
||||
{
|
||||
// switch on type name... later...
|
||||
|
||||
typeName = typeName.ToLower();
|
||||
//uint ipid = Convert.ToUInt16(props.Id, 16);
|
||||
var ipid = props.Control.IpIdInt;
|
||||
var pKey = props.ParentDeviceKey.ToLower();
|
||||
|
||||
if (pKey == "processor")
|
||||
{
|
||||
// Catch constructor failures, mainly dues to IPID
|
||||
try
|
||||
{
|
||||
if(typeName.StartsWith("dmtx200"))
|
||||
return new DmTx200Controller(key, name, new DmTx200C2G(ipid, Global.ControlSystem));
|
||||
if (typeName.StartsWith("dmtx201"))
|
||||
return new DmTx201XController(key, name, new DmTx201S(ipid, Global.ControlSystem));
|
||||
if (typeName.StartsWith("dmtx4k202"))
|
||||
return new DmTx4k202CController(key, name, new DmTx4k202C(ipid, Global.ControlSystem));
|
||||
if (typeName.StartsWith("dmtx4kz202"))
|
||||
return new DmTx4k202CController(key, name, new DmTx4kz202C(ipid, Global.ControlSystem));
|
||||
if (typeName.StartsWith("dmtx4k302"))
|
||||
return new DmTx4k302CController(key, name, new DmTx4k302C(ipid, Global.ControlSystem));
|
||||
if (typeName.StartsWith("dmtx4kz302"))
|
||||
return new DmTx4kz302CController(key, name, new DmTx4kz302C(ipid, Global.ControlSystem));
|
||||
if (typeName.StartsWith("dmtx401"))
|
||||
return new DmTx401CController(key, name, new DmTx401C(ipid, Global.ControlSystem));
|
||||
Debug.Console(0, "{1} WARNING: Cannot create DM-TX of type: '{0}'", typeName, key);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.Console(0, "[{0}] WARNING: Cannot create DM-TX device: {1}", key, e);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var parentDev = DeviceManager.GetDeviceForKey(pKey);
|
||||
if (!(parentDev is DmChassisController))
|
||||
{
|
||||
Debug.Console(0, "Cannot create DM device '{0}'. '{1}' is not a DM Chassis.",
|
||||
key, pKey);
|
||||
return null;
|
||||
}
|
||||
|
||||
// Get the Crestron chassis and link stuff up
|
||||
var switchDev = parentDev as DmChassisController;
|
||||
var chassis = switchDev.Chassis;
|
||||
|
||||
var num = props.ParentInputNumber;
|
||||
if (num <= 0 || num > chassis.NumberOfInputs)
|
||||
{
|
||||
Debug.Console(0, "Cannot create DM device '{0}'. Input number '{1}' is out of range",
|
||||
key, num);
|
||||
return null;
|
||||
}
|
||||
else
|
||||
{
|
||||
var controller = (parentDev as DmChassisController);
|
||||
controller.TxDictionary.Add(num, key);
|
||||
}
|
||||
|
||||
// Catch constructor failures, mainly dues to IPID
|
||||
try
|
||||
{
|
||||
// Must use different constructor for CPU3 chassis types. No IPID
|
||||
if (chassis is DmMd8x8Cpu3 || chassis is DmMd16x16Cpu3 ||
|
||||
chassis is DmMd32x32Cpu3 || chassis is DmMd8x8Cpu3rps ||
|
||||
chassis is DmMd16x16Cpu3rps || chassis is DmMd32x32Cpu3rps)
|
||||
{
|
||||
if (typeName.StartsWith("dmtx200"))
|
||||
return new DmTx200Controller(key, name, new DmTx200C2G(chassis.Inputs[num]));
|
||||
if (typeName.StartsWith("dmtx201"))
|
||||
return new DmTx201XController(key, name, new DmTx201C(chassis.Inputs[num]));
|
||||
if (typeName.StartsWith("dmtx4k100"))
|
||||
return new DmTx4k100Controller(key, name, new DmTx4K100C1G(chassis.Inputs[num]));
|
||||
if (typeName.StartsWith("dmtx4k202"))
|
||||
return new DmTx4k202CController(key, name, new DmTx4k202C(chassis.Inputs[num]));
|
||||
if (typeName.StartsWith("dmtx4kz202"))
|
||||
return new DmTx4k202CController(key, name, new DmTx4kz202C(chassis.Inputs[num]));
|
||||
if (typeName.StartsWith("dmtx4k302"))
|
||||
return new DmTx4k302CController(key, name, new DmTx4k302C(chassis.Inputs[num]));
|
||||
if (typeName.StartsWith("dmtx4kz302"))
|
||||
return new DmTx4kz302CController(key, name, new DmTx4kz302C(chassis.Inputs[num]));
|
||||
if (typeName.StartsWith("dmtx401"))
|
||||
return new DmTx401CController(key, name, new DmTx401C(chassis.Inputs[num]));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (typeName.StartsWith("dmtx200"))
|
||||
return new DmTx200Controller(key, name, new DmTx200C2G(ipid, chassis.Inputs[num]));
|
||||
if (typeName.StartsWith("dmtx201"))
|
||||
return new DmTx201XController(key, name, new DmTx201C(ipid, chassis.Inputs[num]));
|
||||
if (typeName.StartsWith("dmtx4k100"))
|
||||
return new DmTx4k100Controller(key, name, new DmTx4K100C1G(ipid, chassis.Inputs[num]));
|
||||
if (typeName.StartsWith("dmtx4k202"))
|
||||
return new DmTx4k202CController(key, name, new DmTx4k202C(ipid, chassis.Inputs[num]));
|
||||
if (typeName.StartsWith("dmtx4kz202"))
|
||||
return new DmTx4k202CController(key, name, new DmTx4kz202C(ipid, chassis.Inputs[num]));
|
||||
if (typeName.StartsWith("dmtx4k302"))
|
||||
return new DmTx4k302CController(key, name, new DmTx4k302C(ipid, chassis.Inputs[num]));
|
||||
if (typeName.StartsWith("dmtx4kz302"))
|
||||
return new DmTx4kz302CController(key, name, new DmTx4kz302C(ipid, chassis.Inputs[num]));
|
||||
if (typeName.StartsWith("dmtx401"))
|
||||
return new DmTx401CController(key, name, new DmTx401C(ipid, chassis.Inputs[num]));
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.Console(0, "[{0}] WARNING: Cannot create DM-TX device: {1}", key, e);
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public abstract class BasicDmTxControllerBase : CrestronGenericBaseDevice
|
||||
{
|
||||
public BasicDmTxControllerBase(string key, string name, GenericBase hardware)
|
||||
: base(key, name, hardware)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public abstract class DmTxControllerBase : BasicDmTxControllerBase
|
||||
{
|
||||
public virtual void SetPortHdcpCapability(eHdcpCapabilityType hdcpMode, uint port) { }
|
||||
public virtual eHdcpCapabilityType HdcpSupportCapability { 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)
|
||||
{
|
||||
// if wired to a chassis, skip registration step in base class
|
||||
if (hardware.DMInput != null)
|
||||
{
|
||||
this.PreventRegistration = true;
|
||||
}
|
||||
AddToFeedbackList(ActiveVideoInputFeedback);
|
||||
}
|
||||
}
|
||||
//public enum ePdtHdcpSupport
|
||||
//{
|
||||
// HdcpOff = 0,
|
||||
// Hdcp1 = 1,
|
||||
// Hdcp2 = 2,
|
||||
// Hdcp2_2= 3,
|
||||
// Auto = 99
|
||||
//}
|
||||
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.Endpoints;
|
||||
using Crestron.SimplSharpPro.DM.Endpoints.Transmitters;
|
||||
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.DM.Config;
|
||||
|
||||
namespace PepperDash.Essentials.DM
|
||||
{
|
||||
public class DmTxHelper
|
||||
{
|
||||
/// <summary>
|
||||
/// A factory method for various DmTxControllers
|
||||
/// </summary>
|
||||
/// <param name="key"></param>
|
||||
/// <param name="name"></param>
|
||||
/// <param name="props"></param>
|
||||
/// <returns></returns>
|
||||
public static BasicDmTxControllerBase GetDmTxController(string key, string name, string typeName, DmTxPropertiesConfig props)
|
||||
{
|
||||
// switch on type name... later...
|
||||
|
||||
typeName = typeName.ToLower();
|
||||
//uint ipid = Convert.ToUInt16(props.Id, 16);
|
||||
var ipid = props.Control.IpIdInt;
|
||||
var pKey = props.ParentDeviceKey.ToLower();
|
||||
|
||||
if (pKey == "processor")
|
||||
{
|
||||
// Catch constructor failures, mainly dues to IPID
|
||||
try
|
||||
{
|
||||
if(typeName.StartsWith("dmtx200"))
|
||||
return new DmTx200Controller(key, name, new DmTx200C2G(ipid, Global.ControlSystem));
|
||||
if (typeName.StartsWith("dmtx201"))
|
||||
return new DmTx201XController(key, name, new DmTx201S(ipid, Global.ControlSystem));
|
||||
if (typeName.StartsWith("dmtx4k202"))
|
||||
return new DmTx4k202CController(key, name, new DmTx4k202C(ipid, Global.ControlSystem));
|
||||
if (typeName.StartsWith("dmtx4kz202"))
|
||||
return new DmTx4k202CController(key, name, new DmTx4kz202C(ipid, Global.ControlSystem));
|
||||
if (typeName.StartsWith("dmtx4k302"))
|
||||
return new DmTx4k302CController(key, name, new DmTx4k302C(ipid, Global.ControlSystem));
|
||||
if (typeName.StartsWith("dmtx4kz302"))
|
||||
return new DmTx4kz302CController(key, name, new DmTx4kz302C(ipid, Global.ControlSystem));
|
||||
if (typeName.StartsWith("dmtx401"))
|
||||
return new DmTx401CController(key, name, new DmTx401C(ipid, Global.ControlSystem));
|
||||
Debug.Console(0, "{1} WARNING: Cannot create DM-TX of type: '{0}'", typeName, key);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.Console(0, "[{0}] WARNING: Cannot create DM-TX device: {1}", key, e);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var parentDev = DeviceManager.GetDeviceForKey(pKey);
|
||||
if (!(parentDev is IDmSwitch))
|
||||
{
|
||||
Debug.Console(0, "Cannot create DM device '{0}'. '{1}' is not a DM Chassis.",
|
||||
key, pKey);
|
||||
return null;
|
||||
}
|
||||
|
||||
// Get the Crestron chassis and link stuff up
|
||||
var switchDev = (parentDev as IDmSwitch);
|
||||
var chassis = switchDev.Chassis;
|
||||
|
||||
var num = props.ParentInputNumber;
|
||||
if (num <= 0 || num > chassis.NumberOfInputs)
|
||||
{
|
||||
Debug.Console(0, "Cannot create DM device '{0}'. Input number '{1}' is out of range",
|
||||
key, num);
|
||||
return null;
|
||||
}
|
||||
else
|
||||
{
|
||||
var controller = (parentDev as IDmSwitch);
|
||||
controller.TxDictionary.Add(num, key);
|
||||
}
|
||||
|
||||
// Catch constructor failures, mainly dues to IPID
|
||||
try
|
||||
{
|
||||
// Must use different constructor for CPU3 chassis types. No IPID
|
||||
if (chassis is DmMd8x8Cpu3 || chassis is DmMd16x16Cpu3 ||
|
||||
chassis is DmMd32x32Cpu3 || chassis is DmMd8x8Cpu3rps ||
|
||||
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("dmtx201"))
|
||||
return new DmTx201XController(key, name, new DmTx201C(chassis.Inputs[num]));
|
||||
if (typeName.StartsWith("dmtx4k100"))
|
||||
return new DmTx4k100Controller(key, name, new DmTx4K100C1G(chassis.Inputs[num]));
|
||||
if (typeName.StartsWith("dmtx4k202"))
|
||||
return new DmTx4k202CController(key, name, new DmTx4k202C(chassis.Inputs[num]));
|
||||
if (typeName.StartsWith("dmtx4kz202"))
|
||||
return new DmTx4k202CController(key, name, new DmTx4kz202C(chassis.Inputs[num]));
|
||||
if (typeName.StartsWith("dmtx4k302"))
|
||||
return new DmTx4k302CController(key, name, new DmTx4k302C(chassis.Inputs[num]));
|
||||
if (typeName.StartsWith("dmtx4kz302"))
|
||||
return new DmTx4kz302CController(key, name, new DmTx4kz302C(chassis.Inputs[num]));
|
||||
if (typeName.StartsWith("dmtx401"))
|
||||
return new DmTx401CController(key, name, new DmTx401C(chassis.Inputs[num]));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (typeName.StartsWith("dmtx200"))
|
||||
return new DmTx200Controller(key, name, new DmTx200C2G(ipid, chassis.Inputs[num]));
|
||||
if (typeName.StartsWith("dmtx201"))
|
||||
return new DmTx201XController(key, name, new DmTx201C(ipid, chassis.Inputs[num]));
|
||||
if (typeName.StartsWith("dmtx4k100"))
|
||||
return new DmTx4k100Controller(key, name, new DmTx4K100C1G(ipid, chassis.Inputs[num]));
|
||||
if (typeName.StartsWith("dmtx4k202"))
|
||||
return new DmTx4k202CController(key, name, new DmTx4k202C(ipid, chassis.Inputs[num]));
|
||||
if (typeName.StartsWith("dmtx4kz202"))
|
||||
return new DmTx4k202CController(key, name, new DmTx4kz202C(ipid, chassis.Inputs[num]));
|
||||
if (typeName.StartsWith("dmtx4k302"))
|
||||
return new DmTx4k302CController(key, name, new DmTx4k302C(ipid, chassis.Inputs[num]));
|
||||
if (typeName.StartsWith("dmtx4kz302"))
|
||||
return new DmTx4kz302CController(key, name, new DmTx4kz302C(ipid, chassis.Inputs[num]));
|
||||
if (typeName.StartsWith("dmtx401"))
|
||||
return new DmTx401CController(key, name, new DmTx401C(ipid, chassis.Inputs[num]));
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.Console(0, "[{0}] WARNING: Cannot create DM-TX device: {1}", key, e);
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public abstract class BasicDmTxControllerBase : CrestronGenericBaseDevice
|
||||
{
|
||||
public BasicDmTxControllerBase(string key, string name, GenericBase hardware)
|
||||
: base(key, name, hardware)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public abstract class DmTxControllerBase : BasicDmTxControllerBase
|
||||
{
|
||||
public virtual void SetPortHdcpCapability(eHdcpCapabilityType hdcpMode, uint port) { }
|
||||
public virtual eHdcpCapabilityType HdcpSupportCapability { 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)
|
||||
{
|
||||
// if wired to a chassis, skip registration step in base class
|
||||
if (hardware.DMInput != null)
|
||||
{
|
||||
this.PreventRegistration = true;
|
||||
}
|
||||
AddToFeedbackList(ActiveVideoInputFeedback);
|
||||
}
|
||||
}
|
||||
//public enum ePdtHdcpSupport
|
||||
//{
|
||||
// HdcpOff = 0,
|
||||
// Hdcp1 = 1,
|
||||
// Hdcp2 = 2,
|
||||
// Hdcp2_2= 3,
|
||||
// Auto = 99
|
||||
//}
|
||||
}
|
||||
@@ -95,12 +95,14 @@
|
||||
<Compile Include="Cards REMOVE\DmcC4kInputCard.cs" />
|
||||
<Compile Include="Cards REMOVE\DmcHD4kInputCard.cs" />
|
||||
<Compile Include="Cards REMOVE\DmInputCardBase.cs" />
|
||||
<Compile Include="Chassis\DmBladeChassisController.cs" />
|
||||
<Compile Include="Chassis\DmCardAudioOutput.cs" />
|
||||
<Compile Include="Chassis\DmChassisController.cs" />
|
||||
<Compile Include="Chassis\DmpsAudioOutputController.cs" />
|
||||
<Compile Include="Chassis\DmpsInternalVirtualDmTxController.cs" />
|
||||
<Compile Include="Chassis\DmpsRoutingController.cs" />
|
||||
<Compile Include="Chassis\HdMdNxM4kEController.cs" />
|
||||
<Compile Include="IDmSwitch.cs" />
|
||||
<Compile Include="Config\DmpsRoutingConfig.cs" />
|
||||
<Compile Include="Config\DmRmcConfig.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; }
|
||||
}
|
||||
}
|
||||
@@ -30,6 +30,8 @@ namespace PepperDash.Essentials.Devices.Common.Occupancy
|
||||
public GlsOdtOccupancySensorController(string key, string name, GlsOdtCCn sensor)
|
||||
: base(key, name, sensor)
|
||||
{
|
||||
OccSensor = sensor;
|
||||
|
||||
AndWhenVacatedFeedback = new BoolFeedback(() => OccSensor.AndWhenVacatedFeedback.BoolValue);
|
||||
|
||||
OrWhenVacatedFeedback = new BoolFeedback(() => OccSensor.OrWhenVacatedFeedback.BoolValue);
|
||||
|
||||
@@ -4,4 +4,4 @@
|
||||
[assembly: AssemblyCompany("PepperDash Technology Corp")]
|
||||
[assembly: AssemblyProduct("Essentials_Devices_Common")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2019")]
|
||||
[assembly: AssemblyVersion("1.3.*")]
|
||||
[assembly: AssemblyVersion("1.4.*")]
|
||||
Reference in New Issue
Block a user