Removed some debug print statements

This commit is contained in:
Trevor Payne
2019-11-18 15:12:55 -06:00
parent 0eb6411dd9
commit 52c387081c
2 changed files with 179 additions and 187 deletions

View File

@@ -150,12 +150,10 @@ namespace PepperDash.Essentials.DM {
InputCardHdcpCapabilityFeedbacks = new Dictionary<uint, IntFeedback>(); InputCardHdcpCapabilityFeedbacks = new Dictionary<uint, IntFeedback>();
InputCardHdcpCapabilityTypes = new Dictionary<uint, eHdcpCapabilityType>(); InputCardHdcpCapabilityTypes = new Dictionary<uint, eHdcpCapabilityType>();
CrestronConsole.PrintLine("GotHere 1");
for (uint x = 1; x <= Chassis.NumberOfOutputs; x++) { for (uint x = 1; x <= Chassis.NumberOfOutputs; x++) {
var tempX = x; var tempX = x;
if (Chassis.Outputs[tempX] != null) { if (Chassis.Outputs[tempX] != null) {
CrestronConsole.PrintLine("GotHere 2");
VideoOutputFeedbacks[tempX] = new IntFeedback(() => { VideoOutputFeedbacks[tempX] = new IntFeedback(() => {
if (Chassis.Outputs[tempX].VideoOutFeedback != null) { return (ushort)Chassis.Outputs[tempX].VideoOutFeedback.Number; } if (Chassis.Outputs[tempX].VideoOutFeedback != null) { return (ushort)Chassis.Outputs[tempX].VideoOutFeedback.Number; }
else { return 0; }; else { return 0; };
@@ -163,7 +161,6 @@ namespace PepperDash.Essentials.DM {
OutputNameFeedbacks[tempX] = new StringFeedback(() => { OutputNameFeedbacks[tempX] = new StringFeedback(() => {
if (Chassis.Outputs[tempX].NameFeedback != null) { if (Chassis.Outputs[tempX].NameFeedback != null) {
CrestronConsole.PrintLine("GotHere 3");
return Chassis.Outputs[tempX].NameFeedback.StringValue; return Chassis.Outputs[tempX].NameFeedback.StringValue;
} }
else { else {
@@ -172,7 +169,6 @@ namespace PepperDash.Essentials.DM {
}); });
OutputVideoRouteNameFeedbacks[tempX] = new StringFeedback(() => { OutputVideoRouteNameFeedbacks[tempX] = new StringFeedback(() => {
if (Chassis.Outputs[tempX].VideoOutFeedback != null) { if (Chassis.Outputs[tempX].VideoOutFeedback != null) {
CrestronConsole.PrintLine("GotHere 4");
return Chassis.Outputs[tempX].VideoOutFeedback.NameFeedback.StringValue; return Chassis.Outputs[tempX].VideoOutFeedback.NameFeedback.StringValue;
} }
else { else {
@@ -188,19 +184,16 @@ namespace PepperDash.Essentials.DM {
if (Chassis.Inputs[tempX] != null) { if (Chassis.Inputs[tempX] != null) {
UsbInputRoutedToFeebacks[tempX] = new IntFeedback(() => { UsbInputRoutedToFeebacks[tempX] = new IntFeedback(() => {
CrestronConsole.PrintLine("GotHere 6");
if (Chassis.Inputs[tempX].USBRoutedToFeedback != null) { return (ushort)Chassis.Inputs[tempX].USBRoutedToFeedback.Number; } if (Chassis.Inputs[tempX].USBRoutedToFeedback != null) { return (ushort)Chassis.Inputs[tempX].USBRoutedToFeedback.Number; }
else { return 0; }; else { return 0; };
}); });
VideoInputSyncFeedbacks[tempX] = new BoolFeedback(() => { VideoInputSyncFeedbacks[tempX] = new BoolFeedback(() => {
CrestronConsole.PrintLine("GotHere 7");
if (Chassis.Inputs[tempX].VideoDetectedFeedback != null) if (Chassis.Inputs[tempX].VideoDetectedFeedback != null)
return Chassis.Inputs[tempX].VideoDetectedFeedback.BoolValue; return Chassis.Inputs[tempX].VideoDetectedFeedback.BoolValue;
else else
return false; return false;
}); });
InputNameFeedbacks[tempX] = new StringFeedback(() => { InputNameFeedbacks[tempX] = new StringFeedback(() => {
CrestronConsole.PrintLine("GotHere 8");
if (Chassis.Inputs[tempX].NameFeedback != null) { if (Chassis.Inputs[tempX].NameFeedback != null) {
return Chassis.Inputs[tempX].NameFeedback.StringValue; return Chassis.Inputs[tempX].NameFeedback.StringValue;
} }
@@ -210,7 +203,6 @@ namespace PepperDash.Essentials.DM {
}); });
InputEndpointOnlineFeedbacks[tempX] = new BoolFeedback(() => { InputEndpointOnlineFeedbacks[tempX] = new BoolFeedback(() => {
CrestronConsole.PrintLine("GotHere 9");
return Chassis.Inputs[tempX].EndpointOnlineFeedback; return Chassis.Inputs[tempX].EndpointOnlineFeedback;
}); });

View File

@@ -1,182 +1,182 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using Crestron.SimplSharp; using Crestron.SimplSharp;
using Crestron.SimplSharpPro; using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.DM; using Crestron.SimplSharpPro.DM;
using Crestron.SimplSharpPro.DM.Endpoints; using Crestron.SimplSharpPro.DM.Endpoints;
using Crestron.SimplSharpPro.DM.Endpoints.Transmitters; using Crestron.SimplSharpPro.DM.Endpoints.Transmitters;
using PepperDash.Core; using PepperDash.Core;
using PepperDash.Essentials.Core; using PepperDash.Essentials.Core;
using PepperDash.Essentials.DM.Config; using PepperDash.Essentials.DM.Config;
namespace PepperDash.Essentials.DM namespace PepperDash.Essentials.DM
{ {
public class DmTxHelper public class DmTxHelper
{ {
/// <summary> /// <summary>
/// A factory method for various DmTxControllers /// A factory method for various DmTxControllers
/// </summary> /// </summary>
/// <param name="key"></param> /// <param name="key"></param>
/// <param name="name"></param> /// <param name="name"></param>
/// <param name="props"></param> /// <param name="props"></param>
/// <returns></returns> /// <returns></returns>
public static BasicDmTxControllerBase GetDmTxController(string key, string name, string typeName, DmTxPropertiesConfig props) public static BasicDmTxControllerBase GetDmTxController(string key, string name, string typeName, DmTxPropertiesConfig props)
{ {
// switch on type name... later... // switch on type name... later...
typeName = typeName.ToLower(); typeName = typeName.ToLower();
//uint ipid = Convert.ToUInt16(props.Id, 16); //uint ipid = Convert.ToUInt16(props.Id, 16);
var ipid = props.Control.IpIdInt; var ipid = props.Control.IpIdInt;
var pKey = props.ParentDeviceKey.ToLower(); var pKey = props.ParentDeviceKey.ToLower();
if (pKey == "processor") if (pKey == "processor")
{ {
// Catch constructor failures, mainly dues to IPID // Catch constructor failures, mainly dues to IPID
try try
{ {
if(typeName.StartsWith("dmtx200")) if(typeName.StartsWith("dmtx200"))
return new DmTx200Controller(key, name, new DmTx200C2G(ipid, Global.ControlSystem)); return new DmTx200Controller(key, name, new DmTx200C2G(ipid, Global.ControlSystem));
if (typeName.StartsWith("dmtx201")) if (typeName.StartsWith("dmtx201"))
return new DmTx201XController(key, name, new DmTx201S(ipid, Global.ControlSystem)); return new DmTx201XController(key, name, new DmTx201S(ipid, Global.ControlSystem));
if (typeName.StartsWith("dmtx4k202")) if (typeName.StartsWith("dmtx4k202"))
return new DmTx4k202CController(key, name, new DmTx4k202C(ipid, Global.ControlSystem)); return new DmTx4k202CController(key, name, new DmTx4k202C(ipid, Global.ControlSystem));
if (typeName.StartsWith("dmtx4kz202")) if (typeName.StartsWith("dmtx4kz202"))
return new DmTx4k202CController(key, name, new DmTx4kz202C(ipid, Global.ControlSystem)); return new DmTx4k202CController(key, name, new DmTx4kz202C(ipid, Global.ControlSystem));
if (typeName.StartsWith("dmtx4k302")) if (typeName.StartsWith("dmtx4k302"))
return new DmTx4k302CController(key, name, new DmTx4k302C(ipid, Global.ControlSystem)); return new DmTx4k302CController(key, name, new DmTx4k302C(ipid, Global.ControlSystem));
if (typeName.StartsWith("dmtx4kz302")) if (typeName.StartsWith("dmtx4kz302"))
return new DmTx4kz302CController(key, name, new DmTx4kz302C(ipid, Global.ControlSystem)); return new DmTx4kz302CController(key, name, new DmTx4kz302C(ipid, Global.ControlSystem));
if (typeName.StartsWith("dmtx401")) if (typeName.StartsWith("dmtx401"))
return new DmTx401CController(key, name, new DmTx401C(ipid, Global.ControlSystem)); return new DmTx401CController(key, name, new DmTx401C(ipid, Global.ControlSystem));
Debug.Console(0, "{1} WARNING: Cannot create DM-TX of type: '{0}'", typeName, key); Debug.Console(0, "{1} WARNING: Cannot create DM-TX of type: '{0}'", typeName, key);
} }
catch (Exception e) catch (Exception e)
{ {
Debug.Console(0, "[{0}] WARNING: Cannot create DM-TX device: {1}", key, e); Debug.Console(0, "[{0}] WARNING: Cannot create DM-TX device: {1}", key, e);
} }
} }
else else
{ {
var parentDev = DeviceManager.GetDeviceForKey(pKey); var parentDev = DeviceManager.GetDeviceForKey(pKey);
if (!(parentDev is IDmSwitch)) if (!(parentDev is IDmSwitch))
{ {
Debug.Console(0, "Cannot create DM device '{0}'. '{1}' is not a DM Chassis.", Debug.Console(0, "Cannot create DM device '{0}'. '{1}' is not a DM Chassis.",
key, pKey); key, pKey);
return null; return null;
} }
// Get the Crestron chassis and link stuff up // Get the Crestron chassis and link stuff up
var switchDev = (parentDev as IDmSwitch); var switchDev = (parentDev as IDmSwitch);
var chassis = switchDev.Chassis; var chassis = switchDev.Chassis;
var num = props.ParentInputNumber; var num = props.ParentInputNumber;
if (num <= 0 || num > chassis.NumberOfInputs) if (num <= 0 || num > chassis.NumberOfInputs)
{ {
Debug.Console(0, "Cannot create DM device '{0}'. Input number '{1}' is out of range", Debug.Console(0, "Cannot create DM device '{0}'. Input number '{1}' is out of range",
key, num); key, num);
return null; return null;
} }
else else
{ {
var controller = (parentDev as IDmSwitch); var controller = (parentDev as IDmSwitch);
controller.TxDictionary.Add(num, key); controller.TxDictionary.Add(num, key);
} }
// Catch constructor failures, mainly dues to IPID // Catch constructor failures, mainly dues to IPID
try try
{ {
// Must use different constructor for CPU3 chassis types. No IPID // Must use different constructor for CPU3 chassis types. No IPID
if (chassis is DmMd8x8Cpu3 || chassis is DmMd16x16Cpu3 || if (chassis is DmMd8x8Cpu3 || chassis is DmMd16x16Cpu3 ||
chassis is DmMd32x32Cpu3 || chassis is DmMd8x8Cpu3rps || chassis is DmMd32x32Cpu3 || chassis is DmMd8x8Cpu3rps ||
chassis is DmMd16x16Cpu3rps || chassis is DmMd32x32Cpu3rps|| chassis is DmMd16x16Cpu3rps || chassis is DmMd32x32Cpu3rps||
chassis is DmMd128x128 || chassis is DmMd64x64) chassis is DmMd128x128 || chassis is DmMd64x64)
{ {
if (typeName.StartsWith("dmtx200")) if (typeName.StartsWith("dmtx200"))
return new DmTx200Controller(key, name, new DmTx200C2G(chassis.Inputs[num])); return new DmTx200Controller(key, name, new DmTx200C2G(chassis.Inputs[num]));
if (typeName.StartsWith("dmtx201")) if (typeName.StartsWith("dmtx201"))
return new DmTx201XController(key, name, new DmTx201C(chassis.Inputs[num])); return new DmTx201XController(key, name, new DmTx201C(chassis.Inputs[num]));
if (typeName.StartsWith("dmtx4k100")) if (typeName.StartsWith("dmtx4k100"))
return new DmTx4k100Controller(key, name, new DmTx4K100C1G(chassis.Inputs[num])); return new DmTx4k100Controller(key, name, new DmTx4K100C1G(chassis.Inputs[num]));
if (typeName.StartsWith("dmtx4k202")) if (typeName.StartsWith("dmtx4k202"))
return new DmTx4k202CController(key, name, new DmTx4k202C(chassis.Inputs[num])); return new DmTx4k202CController(key, name, new DmTx4k202C(chassis.Inputs[num]));
if (typeName.StartsWith("dmtx4kz202")) if (typeName.StartsWith("dmtx4kz202"))
return new DmTx4k202CController(key, name, new DmTx4kz202C(chassis.Inputs[num])); return new DmTx4k202CController(key, name, new DmTx4kz202C(chassis.Inputs[num]));
if (typeName.StartsWith("dmtx4k302")) if (typeName.StartsWith("dmtx4k302"))
return new DmTx4k302CController(key, name, new DmTx4k302C(chassis.Inputs[num])); return new DmTx4k302CController(key, name, new DmTx4k302C(chassis.Inputs[num]));
if (typeName.StartsWith("dmtx4kz302")) if (typeName.StartsWith("dmtx4kz302"))
return new DmTx4kz302CController(key, name, new DmTx4kz302C(chassis.Inputs[num])); return new DmTx4kz302CController(key, name, new DmTx4kz302C(chassis.Inputs[num]));
if (typeName.StartsWith("dmtx401")) if (typeName.StartsWith("dmtx401"))
return new DmTx401CController(key, name, new DmTx401C(chassis.Inputs[num])); return new DmTx401CController(key, name, new DmTx401C(chassis.Inputs[num]));
} }
else else
{ {
if (typeName.StartsWith("dmtx200")) if (typeName.StartsWith("dmtx200"))
return new DmTx200Controller(key, name, new DmTx200C2G(ipid, chassis.Inputs[num])); return new DmTx200Controller(key, name, new DmTx200C2G(ipid, chassis.Inputs[num]));
if (typeName.StartsWith("dmtx201")) if (typeName.StartsWith("dmtx201"))
return new DmTx201XController(key, name, new DmTx201C(ipid, chassis.Inputs[num])); return new DmTx201XController(key, name, new DmTx201C(ipid, chassis.Inputs[num]));
if (typeName.StartsWith("dmtx4k100")) if (typeName.StartsWith("dmtx4k100"))
return new DmTx4k100Controller(key, name, new DmTx4K100C1G(ipid, chassis.Inputs[num])); return new DmTx4k100Controller(key, name, new DmTx4K100C1G(ipid, chassis.Inputs[num]));
if (typeName.StartsWith("dmtx4k202")) if (typeName.StartsWith("dmtx4k202"))
return new DmTx4k202CController(key, name, new DmTx4k202C(ipid, chassis.Inputs[num])); return new DmTx4k202CController(key, name, new DmTx4k202C(ipid, chassis.Inputs[num]));
if (typeName.StartsWith("dmtx4kz202")) if (typeName.StartsWith("dmtx4kz202"))
return new DmTx4k202CController(key, name, new DmTx4kz202C(ipid, chassis.Inputs[num])); return new DmTx4k202CController(key, name, new DmTx4kz202C(ipid, chassis.Inputs[num]));
if (typeName.StartsWith("dmtx4k302")) if (typeName.StartsWith("dmtx4k302"))
return new DmTx4k302CController(key, name, new DmTx4k302C(ipid, chassis.Inputs[num])); return new DmTx4k302CController(key, name, new DmTx4k302C(ipid, chassis.Inputs[num]));
if (typeName.StartsWith("dmtx4kz302")) if (typeName.StartsWith("dmtx4kz302"))
return new DmTx4kz302CController(key, name, new DmTx4kz302C(ipid, chassis.Inputs[num])); return new DmTx4kz302CController(key, name, new DmTx4kz302C(ipid, chassis.Inputs[num]));
if (typeName.StartsWith("dmtx401")) if (typeName.StartsWith("dmtx401"))
return new DmTx401CController(key, name, new DmTx401C(ipid, chassis.Inputs[num])); return new DmTx401CController(key, name, new DmTx401C(ipid, chassis.Inputs[num]));
} }
} }
catch (Exception e) catch (Exception e)
{ {
Debug.Console(0, "[{0}] WARNING: Cannot create DM-TX device: {1}", key, e); Debug.Console(0, "[{0}] WARNING: Cannot create DM-TX device: {1}", key, e);
} }
} }
return null; return null;
} }
} }
public abstract class BasicDmTxControllerBase : CrestronGenericBaseDevice public abstract class BasicDmTxControllerBase : CrestronGenericBaseDevice
{ {
public BasicDmTxControllerBase(string key, string name, GenericBase hardware) public BasicDmTxControllerBase(string key, string name, GenericBase hardware)
: base(key, name, hardware) : base(key, name, hardware)
{ {
} }
} }
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
public abstract class DmTxControllerBase : BasicDmTxControllerBase public abstract class DmTxControllerBase : BasicDmTxControllerBase
{ {
public virtual void SetPortHdcpCapability(eHdcpCapabilityType hdcpMode, uint port) { } public virtual void SetPortHdcpCapability(eHdcpCapabilityType hdcpMode, uint port) { }
public virtual eHdcpCapabilityType HdcpSupportCapability { get; protected set; } public virtual eHdcpCapabilityType HdcpSupportCapability { get; protected set; }
public abstract StringFeedback ActiveVideoInputFeedback { get; protected set; } public abstract StringFeedback ActiveVideoInputFeedback { get; protected set; }
public RoutingInputPortWithVideoStatuses AnyVideoInput { get; protected set; } public RoutingInputPortWithVideoStatuses AnyVideoInput { get; protected set; }
public DmTxControllerBase(string key, string name, EndpointTransmitterBase hardware) public DmTxControllerBase(string key, string name, EndpointTransmitterBase hardware)
: base(key, name, hardware) : base(key, name, hardware)
{ {
// if wired to a chassis, skip registration step in base class // if wired to a chassis, skip registration step in base class
if (hardware.DMInput != null) if (hardware.DMInput != null)
{ {
this.PreventRegistration = true; this.PreventRegistration = true;
} }
AddToFeedbackList(ActiveVideoInputFeedback); AddToFeedbackList(ActiveVideoInputFeedback);
} }
} }
//public enum ePdtHdcpSupport //public enum ePdtHdcpSupport
//{ //{
// HdcpOff = 0, // HdcpOff = 0,
// Hdcp1 = 1, // Hdcp1 = 1,
// Hdcp2 = 2, // Hdcp2 = 2,
// Hdcp2_2= 3, // Hdcp2_2= 3,
// Auto = 99 // Auto = 99
//} //}
} }