add none ports to DMPS & Blade chassis

This commit is contained in:
Andrew Welker
2021-02-22 10:11:57 -07:00
parent be78d17af5
commit 1990201215
2 changed files with 25 additions and 21 deletions

View File

@@ -23,6 +23,8 @@ namespace PepperDash.Essentials.DM {
/// </summary> /// </summary>
public class DmBladeChassisController : CrestronGenericBridgeableBaseDevice, IDmSwitch, IRoutingNumericWithFeedback public class DmBladeChassisController : CrestronGenericBridgeableBaseDevice, IDmSwitch, IRoutingNumericWithFeedback
{ {
private const string NonePortKey = "inputCard0--None";
public DMChassisPropertiesConfig PropertiesConfig { get; set; } public DMChassisPropertiesConfig PropertiesConfig { get; set; }
public Switch Chassis { get; private set; } public Switch Chassis { get; private set; }
@@ -112,6 +114,10 @@ namespace PepperDash.Essentials.DM {
controller.AddVolumeControl(outNum, audio); controller.AddVolumeControl(outNum, audio);
} }
controller.InputPorts.Add(new RoutingInputPort(NonePortKey, eRoutingSignalType.Video,
eRoutingPortConnectionType.None, null, controller));
controller.InputNames = properties.InputNames; controller.InputNames = properties.InputNames;
controller.OutputNames = properties.OutputNames; controller.OutputNames = properties.OutputNames;
controller.PropertiesConfig = properties; controller.PropertiesConfig = properties;

View File

@@ -21,6 +21,8 @@ namespace PepperDash.Essentials.DM
{ {
public class DmpsRoutingController : EssentialsBridgeableDevice, IRoutingNumericWithFeedback, IHasFeedback public class DmpsRoutingController : EssentialsBridgeableDevice, IRoutingNumericWithFeedback, IHasFeedback
{ {
private const string NonePortKey = "none";
public CrestronControlSystem Dmps { get; set; } public CrestronControlSystem Dmps { get; set; }
public ISystemControl SystemControl { get; private set; } public ISystemControl SystemControl { get; private set; }
@@ -75,20 +77,18 @@ namespace PepperDash.Essentials.DM
{ {
try try
{ {
var systemControl = Global.ControlSystem.SystemControl;
ISystemControl systemControl = null;
systemControl = Global.ControlSystem.SystemControl as ISystemControl;
if (systemControl == null) if (systemControl == null)
{ {
return null; return null;
} }
var controller = new DmpsRoutingController(key, name, systemControl); var controller = new DmpsRoutingController(key, name, systemControl)
{
controller.InputNames = properties.InputNames; InputNames = properties.InputNames,
controller.OutputNames = properties.OutputNames; OutputNames = properties.OutputNames
};
if (!string.IsNullOrEmpty(properties.NoRouteText)) if (!string.IsNullOrEmpty(properties.NoRouteText))
controller.NoRouteText = properties.NoRouteText; controller.NoRouteText = properties.NoRouteText;
@@ -96,9 +96,9 @@ namespace PepperDash.Essentials.DM
return controller; return controller;
} }
catch (System.Exception e) catch (Exception e)
{ {
Debug.Console(0, "Error getting DMPS Controller:\r{0}", e); Debug.Console(0, "Error getting DMPS Controller:\r\n{0}", e);
} }
return null; return null;
} }
@@ -113,6 +113,7 @@ namespace PepperDash.Essentials.DM
public DmpsRoutingController(string key, string name, ISystemControl systemControl) public DmpsRoutingController(string key, string name, ISystemControl systemControl)
: base(key, name) : base(key, name)
{ {
Dmps = Global.ControlSystem; Dmps = Global.ControlSystem;
SystemControl = systemControl; SystemControl = systemControl;
@@ -427,14 +428,11 @@ namespace PepperDash.Essentials.DM
{ {
Debug.Console(1, this, "Adding Input Card Number {0} Type: {1}", inputCard.Number, inputCard.CardInputOutputType.ToString()); Debug.Console(1, this, "Adding Input Card Number {0} Type: {1}", inputCard.Number, inputCard.CardInputOutputType.ToString());
InputEndpointOnlineFeedbacks[inputCard.Number] = new BoolFeedback(() => { return inputCard.EndpointOnlineFeedback; }); InputEndpointOnlineFeedbacks[inputCard.Number] = new BoolFeedback(() => inputCard.EndpointOnlineFeedback);
if (inputCard.VideoDetectedFeedback != null) if (inputCard.VideoDetectedFeedback != null)
{ {
VideoInputSyncFeedbacks[inputCard.Number] = new BoolFeedback(() => VideoInputSyncFeedbacks[inputCard.Number] = new BoolFeedback(() => inputCard.VideoDetectedFeedback.BoolValue);
{
return inputCard.VideoDetectedFeedback.BoolValue;
});
} }
InputNameFeedbacks[inputCard.Number] = new StringFeedback(() => InputNameFeedbacks[inputCard.Number] = new StringFeedback(() =>
@@ -443,13 +441,10 @@ namespace PepperDash.Essentials.DM
{ {
Debug.Console(2, this, "Input Card {0} Name: {1}", inputCard.Number, inputCard.NameFeedback.StringValue); Debug.Console(2, this, "Input Card {0} Name: {1}", inputCard.Number, inputCard.NameFeedback.StringValue);
return inputCard.NameFeedback.StringValue; return inputCard.NameFeedback.StringValue;
}
} Debug.Console(2, this, "Input Card {0} Name is null", inputCard.Number);
else return "";
{
Debug.Console(2, this, "Input Card {0} Name is null", inputCard.Number);
return "";
}
}); });
AddInputCard(inputCard.Number, inputCard); AddInputCard(inputCard.Number, inputCard);
@@ -459,6 +454,9 @@ namespace PepperDash.Essentials.DM
Debug.Console(2, this, "***********Input Card of type {0} is cannot be cast as DMInput*************", card.CardInputOutputType); Debug.Console(2, this, "***********Input Card of type {0} is cannot be cast as DMInput*************", card.CardInputOutputType);
} }
} }
InputPorts.Add(new RoutingInputPort(NonePortKey, eRoutingSignalType.AudioVideo,
eRoutingPortConnectionType.None, null, this));
} }
/// <summary> /// <summary>