From d74c5de65130c1fe03db44394a65b9dc3cb96c64 Mon Sep 17 00:00:00 2001 From: Jason DeVito Date: Fri, 8 Sep 2023 10:51:19 -0500 Subject: [PATCH] wip: updates to HdPsXxx class while test implementation to resolve exceptions --- .../Chassis/HdPsXxxController.cs | 28 ++++++++++++++++--- .../Config/HdPsXxxPropertiesConfig.cs | 14 +++++++++- 2 files changed, 37 insertions(+), 5 deletions(-) diff --git a/essentials-framework/Essentials DM/Essentials_DM/Chassis/HdPsXxxController.cs b/essentials-framework/Essentials DM/Essentials_DM/Chassis/HdPsXxxController.cs index 499dd865..d923949e 100644 --- a/essentials-framework/Essentials DM/Essentials_DM/Chassis/HdPsXxxController.cs +++ b/essentials-framework/Essentials DM/Essentials_DM/Chassis/HdPsXxxController.cs @@ -63,15 +63,17 @@ namespace PepperDash_Essentials_DM.Chassis return; } - InputPorts = new RoutingPortCollection(); - InputNames = new Dictionary(); + InputPorts = new RoutingPortCollection(); InputNameFeedbacks = new FeedbackCollection(); InputHdcpEnableFeedback = new FeedbackCollection(); + InputNames = new Dictionary(); + //InputNames = props.Inputs; OutputPorts = new RoutingPortCollection(); - OutputNames = new Dictionary(); OutputNameFeedbacks = new FeedbackCollection(); OutputRouteNameFeedback = new FeedbackCollection(); + OutputNames = new Dictionary(); + //OutputNames = props.Outputs; VideoInputSyncFeedbacks = new FeedbackCollection(); VideoOutputRouteFeedbacks = new FeedbackCollection(); @@ -95,6 +97,15 @@ namespace PepperDash_Essentials_DM.Chassis // input setup private void SetupInputs(Dictionary dict) { + if (dict == null) + { + Debug.Console(1, this, "Failed to setup inputs, properties are null"); + return; + } + foreach (var kvp in dict) + { + Debug.Console(1, this, "props.Input[{0}]: {1}", kvp.Key, kvp.Value); + } InputNames = dict; for (uint i = 1; i <= _chassis.NumberOfInputs; i++) @@ -129,6 +140,15 @@ namespace PepperDash_Essentials_DM.Chassis // output setup private void SetupOutputs(Dictionary dict) { + if (dict == null) + { + Debug.Console(1, this, "Failed to setup outputs, properties are null"); + return; + } + foreach (var kvp in dict) + { + Debug.Console(1, this, "props.Output[{0}]: {1}", kvp.Key, kvp.Value); + } OutputNames = dict; for (uint i = 1; i <= _chassis.NumberOfOutputs; i++) @@ -602,7 +622,7 @@ namespace PepperDash_Essentials_DM.Chassis var type = dc.Type.ToLower(); var control = props.Control; var ipid = control.IpIdInt; - var address = control.TcpSshProperties.Address; + //var address = control.TcpSshProperties.Address; switch (type) { diff --git a/essentials-framework/Essentials DM/Essentials_DM/Config/HdPsXxxPropertiesConfig.cs b/essentials-framework/Essentials DM/Essentials_DM/Config/HdPsXxxPropertiesConfig.cs index b521facf..c02fc511 100644 --- a/essentials-framework/Essentials DM/Essentials_DM/Config/HdPsXxxPropertiesConfig.cs +++ b/essentials-framework/Essentials DM/Essentials_DM/Config/HdPsXxxPropertiesConfig.cs @@ -1,6 +1,7 @@ using System.Collections.Generic; using Newtonsoft.Json; using PepperDash.Core; +using PepperDash.Essentials.DM.Config; namespace PepperDash_Essentials_DM.Config { @@ -10,9 +11,20 @@ namespace PepperDash_Essentials_DM.Config public ControlPropertiesConfig Control { get; set; } [JsonProperty("inputs")] + //public Dictionary Inputs { get; set; } public Dictionary Inputs { get; set; } [JsonProperty("outputs")] - public Dictionary Outputs { get; set; } + //public Dictionary Outputs { get; set; } + public Dictionary Outputs { get; set; } + + public HdPsXxxPropertiesConfig() + { + //Inputs = new Dictionary(); + //Outputs = new Dictionary(); + + Inputs = new Dictionary(); + Outputs = new Dictionary(); + } } } \ No newline at end of file