diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/DeviceJsonApi.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/DeviceJsonApi.cs
index c7bc7c68..51d5882f 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/DeviceJsonApi.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/DeviceJsonApi.cs
@@ -83,13 +83,13 @@ namespace PepperDash.Essentials.Core
///
public static object GetPropertyByName(string deviceObjectPath, string propertyName)
{
- var obj = FindObjectOnPath(deviceObjectPath);
- if(obj == null)
+ var dev = FindObjectOnPath(deviceObjectPath);
+ if(dev == null)
return "{ \"error\":\"No Device\"}";
+
+ object prop = dev.GetType().GetCType().GetProperty(propertyName).GetValue(dev, null);
- CType t = obj.GetType();
-
- var prop = t.GetProperty(propertyName);
+ // var prop = t.GetProperty(propertyName);
if (prop != null)
{
return prop;
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/DeviceManager.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/DeviceManager.cs
index 0e4efa10..55bc523a 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/DeviceManager.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/DeviceManager.cs
@@ -360,9 +360,9 @@ namespace PepperDash.Essentials.Core
{
var device = GetDeviceForKey(s);
- if (device == null) return;
- var inputPorts = (device as IRoutingInputsOutputs).InputPorts;
- var outputPorts = (device as IRoutingInputsOutputs).OutputPorts;
+ if (device == null) return;
+ var inputPorts = ((device as IRoutingInputs) != null) ? (device as IRoutingInputs).InputPorts : null;
+ var outputPorts = ((device as IRoutingOutputs) != null) ? (device as IRoutingOutputs).OutputPorts : null;
if (inputPorts != null)
{
Debug.Console(0, "Device {0} has {1} Input Ports:", s, inputPorts.Count);
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Interfaces/ILogStrings.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Interfaces/ILogStrings.cs
new file mode 100644
index 00000000..92557319
--- /dev/null
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Interfaces/ILogStrings.cs
@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Crestron.SimplSharp;
+using PepperDash.Core;
+
+namespace PepperDash.Essentials.Core.Interfaces
+{
+ public interface ILogStrings : IKeyed
+ {
+ ///
+ /// Defines a class that is capable of logging a string
+ ///
+ void SendToLog(IKeyed device, string logMessage);
+ }
+}
\ No newline at end of file
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Interfaces/ILogStringsWithLevel.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Interfaces/ILogStringsWithLevel.cs
new file mode 100644
index 00000000..c43c4e6c
--- /dev/null
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Interfaces/ILogStringsWithLevel.cs
@@ -0,0 +1,18 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Crestron.SimplSharp;
+using PepperDash.Core;
+
+namespace PepperDash.Essentials.Core.Interfaces
+{
+ public interface ILogStringsWithLevel : IKeyed
+ {
+ ///
+ /// Defines a class that is capable of logging a string with an int level
+ ///
+ void SendToLog(IKeyed device, Debug.ErrorLogLevel level,string logMessage);
+ }
+
+}
\ No newline at end of file
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.csproj b/essentials-framework/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.csproj
index e97d30f7..6a15ce84 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.csproj
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.csproj
@@ -225,6 +225,8 @@
+
+
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Queues/GenericQueue.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Queues/GenericQueue.cs
index 1f27fe1e..5ca8a793 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Queues/GenericQueue.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Queues/GenericQueue.cs
@@ -15,23 +15,36 @@ namespace PepperDash_Essentials_Core.Queues
protected readonly Thread _worker;
protected readonly CEvent _waitHandle = new CEvent();
- private readonly bool _delayEnabled;
- private readonly int _delayTime;
+ private bool _delayEnabled;
+ private int _delayTime;
///
/// If the instance has been disposed.
///
public bool Disposed { get; private set; }
+ ///
+ /// Constructor with no thread priority
+ ///
+ ///
+ public GenericQueue(string key)
+ : this(key, Thread.eThreadPriority.NotSet)
+ {
+
+ }
+
///
/// Constructor for generic queue with no pacing
///
/// Key
- public GenericQueue(string key)
+ public GenericQueue(string key, Thread.eThreadPriority priority)
{
_key = key;
- _queue = new CrestronQueue();
- _worker = new Thread(ProcessQueue, null, Thread.eThreadStartOptions.Running);
+ _queue = new CrestronQueue(25);
+ _worker = new Thread(ProcessQueue, null, Thread.eThreadStartOptions.Running)
+ {
+ Priority = priority
+ };
CrestronEnvironment.ProgramStatusEventHandler += programEvent =>
{
@@ -49,11 +62,28 @@ namespace PepperDash_Essentials_Core.Queues
/// Pacing in ms between actions
public GenericQueue(string key, int pacing)
: this(key)
+ {
+ SetDelayValues(pacing);
+ }
+
+ ///
+ /// Constructor with pacing and priority
+ ///
+ ///
+ ///
+ ///
+ public GenericQueue(string key, int pacing, Thread.eThreadPriority priority)
+ : this(key, priority)
+ {
+ SetDelayValues(pacing);
+ }
+
+ private void SetDelayValues(int pacing)
{
_delayEnabled = pacing > 0;
_delayTime = pacing;
}
-
+
///
/// Thread callback
///
@@ -83,7 +113,7 @@ namespace PepperDash_Essentials_Core.Queues
}
catch (Exception ex)
{
- Debug.ConsoleWithLog(0, this, "Caught an exception in the Queue {0}\r{1}\r{2}", ex.Message, ex.InnerException, ex.StackTrace);
+ Debug.Console(0, this, Debug.ErrorLogLevel.Error, "Caught an exception in the Queue {0}\r{1}\r{2}", ex.Message, ex.InnerException, ex.StackTrace);
}
}
else _waitHandle.Wait();
diff --git a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/DmTxHelpers.cs b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/DmTxHelpers.cs
index fd80ac1f..4d8e41f6 100644
--- a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/DmTxHelpers.cs
+++ b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/DmTxHelpers.cs
@@ -122,7 +122,9 @@ namespace PepperDash.Essentials.DM
return new DmTx4kz302CController(key, name, new DmTx4kz302C(chassis.Inputs[num]));
if (typeName.StartsWith("dmtx401"))
return new DmTx401CController(key, name, new DmTx401C(chassis.Inputs[num]));
- }
+ if (typeName.StartsWith("hdbasettx"))
+ return new HDBaseTTxController(key, name, new HDTx3CB(chassis.Inputs[num]));
+ }
else
{
if (typeName.StartsWith("dmtx200"))
@@ -145,7 +147,9 @@ namespace PepperDash.Essentials.DM
return new DmTx4kz302CController(key, name, new DmTx4kz302C(ipid, chassis.Inputs[num]));
if (typeName.StartsWith("dmtx401"))
return new DmTx401CController(key, name, new DmTx401C(ipid, chassis.Inputs[num]));
- }
+ if (typeName.StartsWith("hdbasettx"))
+ return new HDBaseTTxController(key, name, new HDTx3CB(ipid, chassis.Inputs[num]));
+ }
}
catch (Exception e)
{
@@ -355,7 +359,7 @@ namespace PepperDash.Essentials.DM
public DmTxControllerFactory()
{
TypeNames = new List() { "dmtx200c", "dmtx201c", "dmtx201s", "dmtx4k100c", "dmtx4k202c", "dmtx4kz202c", "dmtx4k302c", "dmtx4kz302c",
- "dmtx401c", "dmtx401s", "dmtx4k100c1g", "dmtx4kz100c1g" };
+ "dmtx401c", "dmtx401s", "dmtx4k100c1g", "dmtx4kz100c1g", "hdbasettx" };
}
public override EssentialsDevice BuildDevice(DeviceConfig dc)
diff --git a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/HDBaseTTxController.cs b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/HDBaseTTxController.cs
new file mode 100644
index 00000000..800da2a9
--- /dev/null
+++ b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/HDBaseTTxController.cs
@@ -0,0 +1,113 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Crestron.SimplSharp;
+using Crestron.SimplSharpPro;
+using Crestron.SimplSharpPro.DeviceSupport;
+using Crestron.SimplSharpPro.DM.Endpoints.Transmitters;
+using Newtonsoft.Json;
+
+using PepperDash.Core;
+using PepperDash.Essentials.Core;
+using PepperDash.Essentials.Core.Bridges;
+
+namespace PepperDash.Essentials.DM
+{
+ ///
+ /// Controller class for suitable for HDBaseT transmitters
+ ///
+ [Description("Wrapper Class for HDBaseT devices based on HDTx3CB class")]
+ public class HDBaseTTxController: BasicDmTxControllerBase, IRoutingInputsOutputs, IComPorts
+ {
+ public RoutingInputPort HdmiIn { get; private set; }
+ public RoutingOutputPort DmOut { get; private set; }
+
+ public HDBaseTTxController(string key, string name, HDTx3CB tx)
+ : base(key, name, tx)
+ {
+ HdmiIn = new RoutingInputPort(DmPortName.HdmiIn1, eRoutingSignalType.Audio | eRoutingSignalType.Video,
+ eRoutingPortConnectionType.Hdmi, null, this) { Port = tx };
+
+ DmOut = new RoutingOutputPort(DmPortName.DmOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
+ eRoutingPortConnectionType.DmCat, null, this);
+
+ InputPorts = new RoutingPortCollection { HdmiIn };
+ OutputPorts = new RoutingPortCollection { DmOut };
+ }
+
+ #region IRoutingInputs Members
+
+ public RoutingPortCollection InputPorts { get; private set; }
+
+ #endregion
+
+ #region IRoutingOutputs Members
+
+ public RoutingPortCollection OutputPorts { get; private set; }
+
+ #endregion
+
+ #region IComPorts Members
+
+ public CrestronCollection ComPorts { get { return (Hardware as HDTx3CB).ComPorts; } }
+ public int NumberOfComPorts { get { return (Hardware as HDTx3CB).NumberOfComPorts; } }
+
+ #endregion
+
+ #region CrestronBridgeableBaseDevice abstract overrides
+
+ public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
+ {
+ var joinMap = new HDBaseTTxControllerJoinMap(joinStart);
+
+ var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
+
+ if (!string.IsNullOrEmpty(joinMapSerialized))
+ joinMap = JsonConvert.DeserializeObject(joinMapSerialized);
+
+
+ if (bridge != null)
+ {
+ bridge.AddJoinMap(Key, joinMap);
+ }
+ else
+ {
+ Debug.Console(0, this, "Please update config to use 'eiscapiadvanced' to get all join map features for this device.");
+ }
+
+ Debug.Console(1, this, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
+
+ this.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline.JoinNumber]);
+
+ }
+
+ #endregion
+ }
+
+ public class HDBaseTTxControllerJoinMap : JoinMapBaseAdvanced
+ {
+ [JoinName("IsOnline")]
+ public JoinDataComplete IsOnline = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 1,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "HDBaseT device online feedback",
+ JoinCapabilities = eJoinCapabilities.ToSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ ///
+ /// Plugin device BridgeJoinMap constructor
+ ///
+ /// This will be the join it starts on the EISC bridge
+ public HDBaseTTxControllerJoinMap(uint joinStart)
+ : base(joinStart, typeof(HDBaseTTxControllerJoinMap))
+ {
+ }
+ }
+}
\ No newline at end of file
diff --git a/essentials-framework/Essentials DM/Essentials_DM/PepperDash_Essentials_DM.csproj b/essentials-framework/Essentials DM/Essentials_DM/PepperDash_Essentials_DM.csproj
index 69045ea5..63b20c98 100644
--- a/essentials-framework/Essentials DM/Essentials_DM/PepperDash_Essentials_DM.csproj
+++ b/essentials-framework/Essentials DM/Essentials_DM/PepperDash_Essentials_DM.csproj
@@ -65,12 +65,12 @@
False
- ..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpCustomAttributesInterface.dll
+ ..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpCustomAttributesInterface.dll
False
False
- ..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpHelperInterface.dll
+ ..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpHelperInterface.dll
False
@@ -79,7 +79,7 @@
False
- ..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpPro.exe
+ ..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpPro.exe
False
@@ -108,6 +108,7 @@
+
diff --git a/essentials-framework/Essentials Devices Common/Essentials Devices Common/Essentials Devices Common.csproj b/essentials-framework/Essentials Devices Common/Essentials Devices Common/Essentials Devices Common.csproj
index 54d37613..bfee822e 100644
--- a/essentials-framework/Essentials Devices Common/Essentials Devices Common/Essentials Devices Common.csproj
+++ b/essentials-framework/Essentials Devices Common/Essentials Devices Common/Essentials Devices Common.csproj
@@ -69,12 +69,12 @@
False
- ..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpCustomAttributesInterface.dll
+ ..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpCustomAttributesInterface.dll
False
False
- ..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpHelperInterface.dll
+ ..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpHelperInterface.dll
False
@@ -83,7 +83,7 @@
False
- ..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpPro.exe
+ ..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpPro.exe
False