diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/JoinMaps/JoinMapBase.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/JoinMaps/JoinMapBase.cs
index 31616a6d..8d50596e 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/JoinMaps/JoinMapBase.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/JoinMaps/JoinMapBase.cs
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
-using System.Linq;
+using System.Linq;
+using System.Runtime.InteropServices;
using Crestron.SimplSharp.Reflection;
using PepperDash.Core;
@@ -363,8 +364,12 @@ namespace PepperDash.Essentials.Core
///
/// A label for the join to better describe it's usage
///
- [JsonProperty("label")]
- public string Label { get; set; }
+ [Obsolete]
+ [JsonProperty("label")]
+ public string Label { get { return Description; } set { Description = value; } }
+
+ [JsonProperty("description")]
+ public string Description { get; set; }
///
/// Signal type(s)
///
@@ -454,11 +459,13 @@ namespace PepperDash.Essentials.Core
name = attribute.Name;
Debug.Console(2, "JoinName Attribute value: {0}", name);
return name;
- }
- }
+ }
+ }
+
+
[AttributeUsage(AttributeTargets.All)]
- public class JoinNameAttribute : Attribute
+ public class JoinNameAttribute : CAttribute
{
private string _Name;
@@ -472,5 +479,5 @@ namespace PepperDash.Essentials.Core
{
get { return _Name; }
}
- }
+ }
}
\ No newline at end of file
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Remotes/Hrxx0WirelessRemoteController.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Remotes/Hrxx0WirelessRemoteController.cs
index c5f6d82c..cee8b3eb 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Remotes/Hrxx0WirelessRemoteController.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Remotes/Hrxx0WirelessRemoteController.cs
@@ -149,7 +149,7 @@ namespace PepperDash.Essentials.Core
}
#endregion
- public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, PepperDash.Essentials.Core.Bridges.EiscApiAdvanced bridge)
+ public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
{
var joinMap = new Hrxxx0WirelessRemoteControllerJoinMap(joinStart);
@@ -161,33 +161,39 @@ namespace PepperDash.Essentials.Core
bridge.AddJoinMap(Key, joinMap);
//List ExcludedKeys = new List();
-
-
-
- foreach (Feedback feedback in Feedbacks)
+ foreach (var feedback in Feedbacks)
{
- Feedback myFeedback = feedback;
+ var myFeedback = feedback;
- var join = joinMap.Joins.FirstOrDefault(x => x.Value.Metadata.Label.Equals(myFeedback.Key, StringComparison.InvariantCultureIgnoreCase)).Value;
+ var joinData =
+ joinMap.Joins.FirstOrDefault(
+ x =>
+ x.Key.Equals(myFeedback.Key, StringComparison.InvariantCultureIgnoreCase));
- if (join == null) continue;
+ if (string.IsNullOrEmpty((joinData.Key))) continue;
+
+ var name = joinData.Key;
+ var join = joinData.Value;
if (join.Metadata.JoinType == eJoinType.Digital)
{
- Debug.Console(0, this, "Linking Bool Feedback '{0}' to join {1}", join.Metadata.Label, join.JoinNumber);
- BoolFeedback someFeedback = myFeedback as BoolFeedback;
+ Debug.Console(0, this, "Linking Bool Feedback '{0}' to join {1}", name, join.JoinNumber);
+ var someFeedback = myFeedback as BoolFeedback;
+ if(someFeedback == null) continue;
someFeedback.LinkInputSig(trilist.BooleanInput[join.JoinNumber]);
}
if (join.Metadata.JoinType == eJoinType.Analog)
{
- Debug.Console(0, this, "Linking Analog Feedback '{0}' to join {1}", join.Metadata.Label, join.JoinNumber);
- IntFeedback someFeedback = myFeedback as IntFeedback;
+ Debug.Console(0, this, "Linking Analog Feedback '{0}' to join {1}", name, join.JoinNumber);
+ var someFeedback = myFeedback as IntFeedback;
+ if (someFeedback == null) continue;
someFeedback.LinkInputSig(trilist.UShortInput[join.JoinNumber]);
}
if (join.Metadata.JoinType == eJoinType.Serial)
{
- Debug.Console(0, this, "Linking Serial Feedback '{0}' to join {1}", join.Metadata.Label, join.JoinNumber);
- StringFeedback someFeedback = myFeedback as StringFeedback;
+ Debug.Console(0, this, "Linking Serial Feedback '{0}' to join {1}", name, join.JoinNumber);
+ var someFeedback = myFeedback as StringFeedback;
+ if (someFeedback == null) continue;
someFeedback.LinkInputSig(trilist.StringInput[join.JoinNumber]);
}
}
@@ -201,13 +207,19 @@ namespace PepperDash.Essentials.Core
for (uint i = 1; i <= _remote.Button.Count; i++)
{
Debug.Console(2, this, "Attempting to link join index {0}", i);
- var join = joinMap.Joins.FirstOrDefault(o => o.Value.Metadata.Label.Equals(_remote.Button[i].Name.ToString(), StringComparison.InvariantCultureIgnoreCase)).Value;
- if (join == null)
- {
- Debug.Console(2, this, "Join '{0}' is null", i);
- continue;
- }
- Debug.Console(2, this, "Setting User Object for '{0}'", join.Metadata.Label);
+ var index = i;
+ var joinData =
+ joinMap.Joins.FirstOrDefault(
+ o =>
+ o.Key.Equals(_remote.Button[index].Name.ToString(),
+ StringComparison.InvariantCultureIgnoreCase));
+
+ if (string.IsNullOrEmpty((joinData.Key))) continue;
+
+ var join = joinData.Value;
+ var name = joinData.Key;
+
+ Debug.Console(2, this, "Setting User Object for '{0}'", name);
if (join.Metadata.JoinType == eJoinType.Digital)
{
_remote.Button[i].SetButtonAction((b) => trilist.BooleanInput[join.JoinNumber].BoolValue = b);
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Routing/RoutingInterfaces.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Routing/RoutingInterfaces.cs
index 3b288290..2c7d5b17 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Routing/RoutingInterfaces.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Routing/RoutingInterfaces.cs
@@ -80,24 +80,26 @@ namespace PepperDash.Essentials.Core
///
public interface IRouting : IRoutingInputsOutputs
{
- //void ClearRoute(object outputSelector);
void ExecuteSwitch(object inputSelector, object outputSelector, eRoutingSignalType signalType);
- }
-
- public interface ITxRouting : IRouting
+ }
+
+ public interface IRoutingNumeric : IRouting
+ {
+ void ExecuteNumericSwitch(ushort input, ushort output, eRoutingSignalType type);
+ }
+
+ public interface ITxRouting : IRoutingNumeric
{
IntFeedback VideoSourceNumericFeedback { get; }
IntFeedback AudioSourceNumericFeedback { get; }
- void ExecuteNumericSwitch(ushort input, ushort output, eRoutingSignalType type);
}
///
/// Defines a receiver that has internal routing (DM-RMC-4K-Z-SCALER-C)
///
- public interface IRmcRouting : IRouting
+ public interface IRmcRouting : IRoutingNumeric
{
IntFeedback AudioVideoSourceNumericFeedback { get; }
- void ExecuteNumericSwitch(ushort input, ushort output, eRoutingSignalType type);
}
///
diff --git a/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmBladeChassisController.cs b/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmBladeChassisController.cs
index 5e9c3151..3094c7fd 100644
--- a/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmBladeChassisController.cs
+++ b/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmBladeChassisController.cs
@@ -21,7 +21,8 @@ namespace PepperDash.Essentials.DM {
/// Builds a controller for basic DM-RMCs with Com and IR ports and no control functions
///
///
- public class DmBladeChassisController : CrestronGenericBridgeableBaseDevice, IDmSwitch, IRoutingInputsOutputs, IRouting, IHasFeedback {
+ public class DmBladeChassisController : CrestronGenericBridgeableBaseDevice, IDmSwitch, IRoutingNumeric
+ {
public DMChassisPropertiesConfig PropertiesConfig { get; set; }
public Switch Chassis { get; private set; }
@@ -563,14 +564,23 @@ namespace PepperDash.Essentials.DM {
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;
- }
+ if ((sigType | eRoutingSignalType.Video) != eRoutingSignalType.Video) return;
+ Chassis.VideoEnter.BoolValue = true;
+ Chassis.Outputs[output].VideoOut = inCard;
}
#endregion
+ #region IRoutingNumeric Members
+
+ public void ExecuteNumericSwitch(ushort inputSelector, ushort outputSelector, eRoutingSignalType sigType)
+ {
+ ExecuteSwitch(inputSelector, outputSelector, sigType);
+ }
+
+ #endregion
+
+
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
{
var joinMap = new DmBladeChassisControllerJoinMap(joinStart);
@@ -808,6 +818,7 @@ namespace PepperDash.Essentials.DM {
});
}
}
+
}
/*
diff --git a/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmChassisController.cs b/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmChassisController.cs
index b0d4682d..2d9a847f 100644
--- a/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmChassisController.cs
+++ b/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmChassisController.cs
@@ -21,7 +21,7 @@ namespace PepperDash.Essentials.DM
///
///
[Description("Wrapper class for all DM-MD chassis variants from 8x8 to 32x32")]
- public class DmChassisController : CrestronGenericBridgeableBaseDevice, IDmSwitch, IRoutingInputsOutputs, IRouting, IHasFeedback
+ public class DmChassisController : CrestronGenericBridgeableBaseDevice, IDmSwitch, IRoutingNumeric
{
public DMChassisPropertiesConfig PropertiesConfig { get; set; }
@@ -1094,6 +1094,15 @@ namespace PepperDash.Essentials.DM
}
#endregion
+ #region IRoutingNumeric Members
+
+ public void ExecuteNumericSwitch(ushort inputSelector, ushort outputSelector, eRoutingSignalType sigType)
+ {
+ ExecuteSwitch(inputSelector, outputSelector, sigType);
+ }
+
+ #endregion
+
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
{
var joinMap = new DmChassisControllerJoinMap(joinStart);
diff --git a/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmpsRoutingController.cs b/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmpsRoutingController.cs
index 7d8ba747..32352b49 100644
--- a/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmpsRoutingController.cs
+++ b/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmpsRoutingController.cs
@@ -18,8 +18,8 @@ using PepperDash.Essentials.DM.Config;
using Feedback = PepperDash.Essentials.Core.Feedback;
namespace PepperDash.Essentials.DM
-{
- public class DmpsRoutingController : EssentialsBridgeableDevice, IRouting, IHasFeedback
+{
+ public class DmpsRoutingController : EssentialsBridgeableDevice, IRoutingNumeric, IHasFeedback
{
public CrestronControlSystem Dmps { get; set; }
public ISystemControl SystemControl { get; private set; }
@@ -661,8 +661,6 @@ namespace PepperDash.Essentials.DM
}
}
}
- ///
- ///
void Dmps_DMOutputChange(Switch device, DMOutputEventArgs args)
{
Debug.Console(2, this, "DMOutputChange Output: {0} EventId: {1}", args.Number, args.EventId.ToString());
@@ -724,10 +722,7 @@ namespace PepperDash.Essentials.DM
{
if (RouteOffTimers.ContainsKey(pnt))
return;
- RouteOffTimers[pnt] = new CTimer(o =>
- {
- ExecuteSwitch(0, pnt.Number, pnt.Type);
- }, RouteOffTime);
+ RouteOffTimers[pnt] = new CTimer(o => ExecuteSwitch(0, pnt.Number, pnt.Type), RouteOffTime);
}
#region IRouting Members
@@ -809,6 +804,15 @@ namespace PepperDash.Essentials.DM
}
}
- #endregion
+ #endregion
+
+ #region IRoutingNumeric Members
+
+ public void ExecuteNumericSwitch(ushort inputSelector, ushort outputSelector, eRoutingSignalType sigType)
+ {
+ ExecuteSwitch(inputSelector, outputSelector, sigType);
+ }
+
+ #endregion
}
}
\ No newline at end of file
diff --git a/essentials-framework/Essentials DM/Essentials_DM/Chassis/HdMdNxM4kEBridgeableController.cs b/essentials-framework/Essentials DM/Essentials_DM/Chassis/HdMdNxM4kEBridgeableController.cs
index 87cc72cf..47f4c572 100644
--- a/essentials-framework/Essentials DM/Essentials_DM/Chassis/HdMdNxM4kEBridgeableController.cs
+++ b/essentials-framework/Essentials DM/Essentials_DM/Chassis/HdMdNxM4kEBridgeableController.cs
@@ -16,7 +16,7 @@ using PepperDash.Essentials.Core.Config;
namespace PepperDash.Essentials.DM.Chassis
{
[Description("Wrapper class for all HdMdNxM4E switchers")]
- public class HdMdNxM4kEBridgeableController : CrestronGenericBridgeableBaseDevice, IRoutingInputsOutputs, IRouting, IHasFeedback
+ public class HdMdNxM4kEBridgeableController : CrestronGenericBridgeableBaseDevice, IRoutingInputsOutputs, IRoutingNumeric, IHasFeedback
{
private HdMdNxM _Chassis;
private HdMd4x14kE _Chassis4x1;
@@ -240,6 +240,15 @@ namespace PepperDash.Essentials.DM.Chassis
#endregion
+ #region IRoutingNumeric Members
+
+ public void ExecuteNumericSwitch(ushort inputSelector, ushort outputSelector, eRoutingSignalType signalType)
+ {
+ ExecuteSwitch(inputSelector, outputSelector, signalType);
+ }
+
+ #endregion
+
#endregion
#region Bridge Linking
@@ -389,6 +398,8 @@ namespace PepperDash.Essentials.DM.Chassis
}
#endregion
-
+
+
+
}
}
\ No newline at end of file