mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-13 19:54:59 +00:00
fix(wip): adds Debug.Console() statements to identify keys per input; adds ICec interface, pending implementation
This commit is contained in:
@@ -17,7 +17,7 @@ using PepperDash_Essentials_DM.Config;
|
|||||||
namespace PepperDash_Essentials_DM.Chassis
|
namespace PepperDash_Essentials_DM.Chassis
|
||||||
{
|
{
|
||||||
[Description("Wrapper class for all HdPsXxx switchers")]
|
[Description("Wrapper class for all HdPsXxx switchers")]
|
||||||
public class HdPsXxxController : CrestronGenericBridgeableBaseDevice, IRoutingNumericWithFeedback, IHasFeedback
|
public class HdPsXxxController : CrestronGenericBridgeableBaseDevice, IRoutingNumericWithFeedback, ICec, IHasHdmiInHdcp, IHasFeedback
|
||||||
{
|
{
|
||||||
|
|
||||||
private readonly HdPsXxx _chassis;
|
private readonly HdPsXxx _chassis;
|
||||||
@@ -75,15 +75,7 @@ namespace PepperDash_Essentials_DM.Chassis
|
|||||||
VideoOutputRouteFeedbacks = new FeedbackCollection<IntFeedback>();
|
VideoOutputRouteFeedbacks = new FeedbackCollection<IntFeedback>();
|
||||||
|
|
||||||
if (_chassis.NumberOfOutputs == 1)
|
if (_chassis.NumberOfOutputs == 1)
|
||||||
{
|
|
||||||
//if (_chassis is HdPs401)
|
|
||||||
// _chassis401 = _chassis as HdPs401;
|
|
||||||
//if (_chassis is HdPs621)
|
|
||||||
// _chassis621 = _chassis as HdPs621;
|
|
||||||
|
|
||||||
AutoRouteFeedback = new BoolFeedback(() => _chassis.PriorityRouteOnFeedback.BoolValue);
|
AutoRouteFeedback = new BoolFeedback(() => _chassis.PriorityRouteOnFeedback.BoolValue);
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
InputNames = props.Inputs;
|
InputNames = props.Inputs;
|
||||||
SetupInputs(InputNames);
|
SetupInputs(InputNames);
|
||||||
@@ -91,7 +83,7 @@ namespace PepperDash_Essentials_DM.Chassis
|
|||||||
OutputNames = props.Outputs;
|
OutputNames = props.Outputs;
|
||||||
SetupOutputs(OutputNames);
|
SetupOutputs(OutputNames);
|
||||||
|
|
||||||
AddPostActivationAction(AddFeedbackCollecitons);
|
//AddPostActivationAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
// input setup
|
// input setup
|
||||||
@@ -107,6 +99,20 @@ namespace PepperDash_Essentials_DM.Chassis
|
|||||||
Debug.Console(1, this, "props.Input[{0}]: {1}", kvp.Key, kvp.Value);
|
Debug.Console(1, this, "props.Input[{0}]: {1}", kvp.Key, kvp.Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO [ ] testing
|
||||||
|
var hdmiKeys = _chassis.HdmiInputs.Keys;
|
||||||
|
foreach (var key in hdmiKeys)
|
||||||
|
{
|
||||||
|
Debug.Console(0, this, "HDMI Input key-'{0}'", key);
|
||||||
|
}
|
||||||
|
|
||||||
|
var dmKeys = _chassis.DmLiteInputs.Keys;
|
||||||
|
foreach (var key in dmKeys)
|
||||||
|
{
|
||||||
|
Debug.Console(0, this, "DM Input key-'{0}'", key);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
foreach (var item in _chassis.HdmiInputs)
|
foreach (var item in _chassis.HdmiInputs)
|
||||||
{
|
{
|
||||||
var input = item;
|
var input = item;
|
||||||
@@ -123,7 +129,7 @@ namespace PepperDash_Essentials_DM.Chassis
|
|||||||
|
|
||||||
InputHdcpEnableFeedback.Add(new BoolFeedback(name, () => input.InputPort.HdcpSupportOnFeedback.BoolValue));
|
InputHdcpEnableFeedback.Add(new BoolFeedback(name, () => input.InputPort.HdcpSupportOnFeedback.BoolValue));
|
||||||
|
|
||||||
VideoInputSyncFeedbacks.Add(new BoolFeedback(name, () => input.VideoDetectedFeedback.BoolValue));
|
VideoInputSyncFeedbacks.Add(new BoolFeedback(name, () => input.VideoDetectedFeedback.BoolValue));
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (var item in _chassis.DmLiteInputs)
|
foreach (var item in _chassis.DmLiteInputs)
|
||||||
@@ -164,9 +170,17 @@ namespace PepperDash_Essentials_DM.Chassis
|
|||||||
Debug.Console(1, this, "props.Output[{0}]: {1}", kvp.Key, kvp.Value);
|
Debug.Console(1, this, "props.Output[{0}]: {1}", kvp.Key, kvp.Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// TODO [ ] testing
|
||||||
|
var keys = _chassis.HdmiDmLiteOutputs.Keys;
|
||||||
|
foreach (var key in keys)
|
||||||
|
{
|
||||||
|
Debug.Console(0, this, "HdmiDmLite Output key-'{0}'", key);
|
||||||
|
}
|
||||||
|
|
||||||
foreach (var item in _chassis.HdmiDmLiteOutputs)
|
foreach (var item in _chassis.HdmiDmLiteOutputs)
|
||||||
{
|
{
|
||||||
var output = item;
|
var output = item;
|
||||||
var index = item.Number;
|
var index = item.Number;
|
||||||
|
|
||||||
var name = string.IsNullOrEmpty(OutputNames[index]) ? string.Format("Output {0}", index) : OutputNames[index];
|
var name = string.IsNullOrEmpty(OutputNames[index]) ? string.Format("Output {0}", index) : OutputNames[index];
|
||||||
@@ -182,7 +196,7 @@ namespace PepperDash_Essentials_DM.Chassis
|
|||||||
|
|
||||||
VideoOutputRouteFeedbacks.Add(new IntFeedback(name, () => output.VideoOutFeedback == null ? 0 : (int)output.VideoOutFeedback.Number));
|
VideoOutputRouteFeedbacks.Add(new IntFeedback(name, () => output.VideoOutFeedback == null ? 0 : (int)output.VideoOutFeedback.Number));
|
||||||
}
|
}
|
||||||
|
|
||||||
_chassis.DMOutputChange += _chassis_OutputChange;
|
_chassis.DMOutputChange += _chassis_OutputChange;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -268,7 +282,7 @@ namespace PepperDash_Essentials_DM.Chassis
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Executes a device switch using objects
|
/// Executes a device switch using objects
|
||||||
@@ -455,115 +469,7 @@ namespace PepperDash_Essentials_DM.Chassis
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
#region FeedbacksAndFeedbackCollections
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Add feedback collection arrays to feedback collections
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="feedbackCollections">BoolFeedback[] arrays</param>
|
|
||||||
public void AddCollectionsToList(params FeedbackCollection<BoolFeedback>[] feedbackCollections)
|
|
||||||
{
|
|
||||||
foreach (var item in feedbackCollections.SelectMany(feedbackCollection => feedbackCollections))
|
|
||||||
{
|
|
||||||
AddCollectionsToList(item);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Add feedback colleciton arrays to feedback collections
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="feedbackCollections">IntFeedback[] arrays</param>
|
|
||||||
public void AddCollectionsToList(params FeedbackCollection<IntFeedback>[] feedbackCollections)
|
|
||||||
{
|
|
||||||
foreach (var item in feedbackCollections.SelectMany(feedbackCollection => feedbackCollections))
|
|
||||||
{
|
|
||||||
AddCollectionsToList(item);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Add feedback colleciton arrays to feedback collections
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="feedbackCollections">StringFeedback[] arrays</param>
|
|
||||||
public void AddCollectionsToList(params FeedbackCollection<StringFeedback>[] feedbackCollections)
|
|
||||||
{
|
|
||||||
foreach (var item in feedbackCollections.SelectMany(feedbackCollection => feedbackCollections))
|
|
||||||
{
|
|
||||||
AddCollectionsToList(item);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Adds feedback colleciton to feedback collections
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="feedbackCollection">BoolFeedback</param>
|
|
||||||
public void AddCollectionToList(FeedbackCollection<BoolFeedback> feedbackCollection)
|
|
||||||
{
|
|
||||||
foreach (var item in feedbackCollection.Where(item => item != null))
|
|
||||||
{
|
|
||||||
AddFeedbackToList(item);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Adds feedback colleciton to feedback collections
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="feedbackCollection">IntFeedback</param>
|
|
||||||
public void AddCollectionToList(FeedbackCollection<IntFeedback> feedbackCollection)
|
|
||||||
{
|
|
||||||
foreach (var item in feedbackCollection.Where(item => item != null))
|
|
||||||
{
|
|
||||||
AddFeedbackToList(item);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Adds feedback colleciton to feedback collections
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="feedbackCollection">StringFeedback</param>
|
|
||||||
public void AddCollectionToList(FeedbackCollection<StringFeedback> feedbackCollection)
|
|
||||||
{
|
|
||||||
foreach (var item in feedbackCollection.Where(item => item != null))
|
|
||||||
{
|
|
||||||
AddFeedbackToList(item);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Adds individual feedbacks to feedback collection
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="fb">Feedback</param>
|
|
||||||
public void AddFeedbackToList(PepperDash.Essentials.Core.Feedback fb)
|
|
||||||
{
|
|
||||||
if (fb == null || Feedbacks.Contains(fb)) return;
|
|
||||||
|
|
||||||
Feedbacks.Add(fb);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Adds provided feedbacks to feedback collection list
|
|
||||||
/// </summary>
|
|
||||||
public void AddFeedbackCollecitons()
|
|
||||||
{
|
|
||||||
//AddFeedbackToList(DeviceNameFeedback);
|
|
||||||
//AddCollectionsToList(VideoInputSyncFeedbacks, InputHdcpEnableFeedback);
|
|
||||||
//AddCollectionsToList(VideoOutputRouteFeedbacks);
|
|
||||||
//AddCollectionsToList(InputNameFeedbacks, OutputNameFeedbacks, OutputRouteNameFeedback);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
|
|
||||||
#region Factory
|
#region Factory
|
||||||
@@ -621,5 +527,17 @@ namespace PepperDash_Essentials_DM.Chassis
|
|||||||
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
// TODO [ ] Implement CEC control
|
||||||
|
// return _chassis.HdmiDmLiteOutputs[0].DmLiteOutput.DmLiteOutputPort.StreamCec;
|
||||||
|
public Cec StreamCec { get; private set; }
|
||||||
|
|
||||||
|
public IntFeedback HdmiInHdcpStateFeedback { get; private set; }
|
||||||
|
public void SetHdmiInHdcpState(eHdcpCapabilityType hdcpState)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
public eHdcpCapabilityType HdmiInHdcpCapability { get; private set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user