Compare commits

..

2 Commits

Author SHA1 Message Date
Trevor Payne
f7f9b4e02f feature: Add re-registration of feedbacks if there is a failure 2023-03-30 16:58:33 -05:00
Trevor Payne
7d38122ee0 feat: add check for cisco feedback registrations and logging if they are in error
feat: log errors only, do not try to self-heal
2023-03-30 16:31:50 -05:00
29 changed files with 1379 additions and 1540 deletions

View File

@@ -0,0 +1,37 @@
name: Add bugs to bugs project
on:
issues:
types:
- opened
- labeled
jobs:
check-secret:
runs-on: ubuntu-latest
outputs:
my-key: ${{ steps.my-key.outputs.defined }}
steps:
- id: my-key
if: "${{ env.MY_KEY != '' }}"
run: echo "::set-output name=defined::true"
env:
MY_KEY: ${{ secrets.PROJECT_URL }}
throw-error:
name: Check
runs-on: ubuntu-latest
needs: [check-secret]
if: needs.check-secret.outputs.my-key != 'true'
steps:
- run: echo "The Project URL Repo Secret is empty"
add-to-project:
name: Add issue to project
runs-on: ubuntu-latest
needs: [check-secret]
if: needs.check-secret.outputs.my-key == 'true'
steps:
- uses: actions/add-to-project@main
with:
project-url: ${{ secrets.PROJECT_URL }}
github-token: ${{ secrets.GH_PROJECTS_PASSWORD }}

View File

@@ -93,28 +93,27 @@ namespace PepperDash.Essentials
CrestronConsole.AddNewConsoleCommand(s => CrestronConsole.AddNewConsoleCommand(s =>
{ {
foreach (var tl in TieLineCollection.Default) foreach (var tl in TieLineCollection.Default)
CrestronConsole.ConsoleCommandResponse(" {0}{1}", tl, CrestronEnvironment.NewLine); CrestronConsole.ConsoleCommandResponse(" {0}\r\n", tl);
}, },
"listtielines", "Prints out all tie lines", ConsoleAccessLevelEnum.AccessOperator); "listtielines", "Prints out all tie lines", ConsoleAccessLevelEnum.AccessOperator);
CrestronConsole.AddNewConsoleCommand(s => CrestronConsole.AddNewConsoleCommand(s =>
{ {
CrestronConsole.ConsoleCommandResponse CrestronConsole.ConsoleCommandResponse
("Current running configuration. This is the merged system and template configuration" + CrestronEnvironment.NewLine); ("Current running configuration. This is the merged system and template configuration");
CrestronConsole.ConsoleCommandResponse(Newtonsoft.Json.JsonConvert.SerializeObject CrestronConsole.ConsoleCommandResponse(Newtonsoft.Json.JsonConvert.SerializeObject
(ConfigReader.ConfigObject, Newtonsoft.Json.Formatting.Indented)); (ConfigReader.ConfigObject, Newtonsoft.Json.Formatting.Indented));
}, "showconfig", "Shows the current running merged config", ConsoleAccessLevelEnum.AccessOperator); }, "showconfig", "Shows the current running merged config", ConsoleAccessLevelEnum.AccessOperator);
CrestronConsole.AddNewConsoleCommand(s => CrestronConsole.AddNewConsoleCommand(s =>
CrestronConsole.ConsoleCommandResponse( CrestronConsole.ConsoleCommandResponse(
"This system can be found at the following URLs:{2}" + "This system can be found at the following URLs:\r\n" +
"System URL: {0}{2}" + "System URL: {0}\r\n" +
"Template URL: {1}{2}", "Template URL: {1}",
ConfigReader.ConfigObject.SystemUrl, ConfigReader.ConfigObject.SystemUrl,
ConfigReader.ConfigObject.TemplateUrl, ConfigReader.ConfigObject.TemplateUrl),
CrestronEnvironment.NewLine), "portalinfo",
"portalinfo", "Shows portal URLS from configuration",
"Shows portal URLS from configuration",
ConsoleAccessLevelEnum.AccessOperator); ConsoleAccessLevelEnum.AccessOperator);

View File

@@ -165,7 +165,7 @@ namespace PepperDash.Essentials.Core.Bridges
Debug.Console(1, this, "Linking Device: '{0}'", device.Key); Debug.Console(1, this, "Linking Device: '{0}'", device.Key);
if (!typeof(IBridgeAdvanced).IsAssignableFrom(device.GetType().GetCType())) if (!typeof (IBridgeAdvanced).IsAssignableFrom(device.GetType().GetCType()))
{ {
Debug.Console(0, this, Debug.ErrorLogLevel.Notice, Debug.Console(0, this, Debug.ErrorLogLevel.Notice,
"{0} is not compatible with this bridge type. Please use 'eiscapi' instead, or updae the device.", "{0} is not compatible with this bridge type. Please use 'eiscapi' instead, or updae the device.",
@@ -409,7 +409,7 @@ namespace PepperDash.Essentials.Core.Bridges
public List<ApiDevicePropertiesConfig> Devices { get; set; } public List<ApiDevicePropertiesConfig> Devices { get; set; }
[JsonProperty("rooms")] [JsonProperty("rooms")]
public List<ApiRoomPropertiesConfig> Rooms { get; set; } public List<ApiRoomPropertiesConfig> Rooms { get; set; }
public class ApiDevicePropertiesConfig public class ApiDevicePropertiesConfig
@@ -442,7 +442,7 @@ namespace PepperDash.Essentials.Core.Bridges
{ {
public EiscApiAdvancedFactory() public EiscApiAdvancedFactory()
{ {
TypeNames = new List<string> { "eiscapiadv", "eiscapiadvanced", "eiscapiadvancedserver", "eiscapiadvancedclient", "vceiscapiadv", "vceiscapiadvanced" }; TypeNames = new List<string> { "eiscapiadv", "eiscapiadvanced", "eiscapiadvancedserver", "eiscapiadvancedclient", "vceiscapiadv", "vceiscapiadvanced" };
} }
public override EssentialsDevice BuildDevice(DeviceConfig dc) public override EssentialsDevice BuildDevice(DeviceConfig dc)
@@ -457,34 +457,34 @@ namespace PepperDash.Essentials.Core.Bridges
{ {
case "eiscapiadv": case "eiscapiadv":
case "eiscapiadvanced": case "eiscapiadvanced":
{ {
eisc = new ThreeSeriesTcpIpEthernetIntersystemCommunications(controlProperties.IpIdInt, eisc = new ThreeSeriesTcpIpEthernetIntersystemCommunications(controlProperties.IpIdInt,
controlProperties.TcpSshProperties.Address, Global.ControlSystem); controlProperties.TcpSshProperties.Address, Global.ControlSystem);
break; break;
} }
case "eiscapiadvancedserver": case "eiscapiadvancedserver":
{ {
eisc = new EISCServer(controlProperties.IpIdInt, Global.ControlSystem); eisc = new EISCServer(controlProperties.IpIdInt, Global.ControlSystem);
break; break;
} }
case "eiscapiadvancedclient": case "eiscapiadvancedclient":
{ {
eisc = new EISCClient(controlProperties.IpIdInt, controlProperties.TcpSshProperties.Address, Global.ControlSystem); eisc = new EISCClient(controlProperties.IpIdInt, controlProperties.TcpSshProperties.Address, Global.ControlSystem);
break; break;
} }
case "vceiscapiadv": case "vceiscapiadv":
case "vceiscapiadvanced": case "vceiscapiadvanced":
{
if (string.IsNullOrEmpty(controlProperties.RoomId))
{ {
if (string.IsNullOrEmpty(controlProperties.RoomId)) Debug.Console(0, Debug.ErrorLogLevel.Error, "Unable to build VC-4 EISC Client for device {0}. Room ID is missing or empty", dc.Key);
{ eisc = null;
Debug.Console(0, Debug.ErrorLogLevel.Error, "Unable to build VC-4 EISC Client for device {0}. Room ID is missing or empty", dc.Key);
eisc = null;
break;
}
eisc = new VirtualControlEISCClient(controlProperties.IpIdInt, controlProperties.RoomId,
Global.ControlSystem);
break; break;
} }
eisc = new VirtualControlEISCClient(controlProperties.IpIdInt, controlProperties.RoomId,
Global.ControlSystem);
break;
}
default: default:
eisc = null; eisc = null;
break; break;

View File

@@ -36,28 +36,6 @@ namespace PepperDash.Essentials.Core.Bridges
public JoinDataComplete AudioVideoSource = new JoinDataComplete(new JoinData { JoinNumber = 1, JoinSpan = 1 }, public JoinDataComplete AudioVideoSource = new JoinDataComplete(new JoinData { JoinNumber = 1, JoinSpan = 1 },
new JoinMetadata { Description = "DM RMC Audio Video Source Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog }); new JoinMetadata { Description = "DM RMC Audio Video Source Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
[JoinName("HdcpSupportCapability")]
public JoinDataComplete HdcpSupportCapability = new JoinDataComplete(new JoinData { JoinNumber = 2, JoinSpan = 1 },
new JoinMetadata { Description = "DM RMC HDCP Support Capability", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Analog });
[JoinName("Port1HdcpState")]
public JoinDataComplete Port1HdcpState = new JoinDataComplete(new JoinData { JoinNumber = 3, JoinSpan = 1 },
new JoinMetadata { Description = "DM RMC Port 1 (DM) HDCP State Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
[JoinName("Port2HdcpState")]
public JoinDataComplete Port2HdcpState = new JoinDataComplete(new JoinData { JoinNumber = 4, JoinSpan = 1 },
new JoinMetadata { Description = "DM TX Port 2 (HDMI) HDCP State Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
[JoinName("HdmiInputSync")]
public JoinDataComplete HdmiInputSync = new JoinDataComplete(new JoinData { JoinNumber = 2, JoinSpan = 1 },
new JoinMetadata { Description = "DM RMC HDMI Input Sync", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
[JoinName("HdcpInputPortCount")]
public JoinDataComplete HdcpInputPortCount = new JoinDataComplete(new JoinData { JoinNumber = 5, JoinSpan = 1 },
new JoinMetadata { Description = "Number of Input Ports that support HDCP", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Analog });
/// <summary> /// <summary>
/// Constructor to use when instantiating this Join Map without inheriting from it /// Constructor to use when instantiating this Join Map without inheriting from it
/// </summary> /// </summary>
@@ -72,8 +50,7 @@ namespace PepperDash.Essentials.Core.Bridges
/// </summary> /// </summary>
/// <param name="joinStart">Join this join map will start at</param> /// <param name="joinStart">Join this join map will start at</param>
/// <param name="type">Type of the child join map</param> /// <param name="type">Type of the child join map</param>
protected DmRmcControllerJoinMap(uint joinStart, Type type) protected DmRmcControllerJoinMap(uint joinStart, Type type) : base(joinStart, type)
: base(joinStart, type)
{ {
} }
} }

View File

@@ -68,11 +68,6 @@ namespace PepperDash.Essentials.Core.Bridges
public JoinDataComplete Port3HdcpState = new JoinDataComplete(new JoinData { JoinNumber = 8, JoinSpan = 1 }, public JoinDataComplete Port3HdcpState = new JoinDataComplete(new JoinData { JoinNumber = 8, JoinSpan = 1 },
new JoinMetadata { Description = "DM TX Port 3 HDCP State Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog }); new JoinMetadata { Description = "DM TX Port 3 HDCP State Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
[JoinName("HdcpInputPortCount")]
public JoinDataComplete HdcpInputPortCount = new JoinDataComplete(new JoinData { JoinNumber = 9, JoinSpan = 1 },
new JoinMetadata { Description = "Number of Input Ports that support HDCP", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Analog });
/// <summary> /// <summary>
/// Constructor to use when instantiating this Join Map without inheriting from it /// Constructor to use when instantiating this Join Map without inheriting from it
@@ -88,8 +83,7 @@ namespace PepperDash.Essentials.Core.Bridges
/// </summary> /// </summary>
/// <param name="joinStart">Join this join map will start at</param> /// <param name="joinStart">Join this join map will start at</param>
/// <param name="type">Type of the child join map</param> /// <param name="type">Type of the child join map</param>
protected DmTxControllerJoinMap(uint joinStart, Type type) protected DmTxControllerJoinMap(uint joinStart, Type type) : base(joinStart, type)
: base(joinStart, type)
{ {
} }
} }

View File

@@ -379,28 +379,28 @@ namespace PepperDash.Essentials.Core
/// Prints a list of routing inputs and outputs by device key. /// Prints a list of routing inputs and outputs by device key.
/// </summary> /// </summary>
/// <param name="s">Device key from which to report data</param> /// <param name="s">Device key from which to report data</param>
public static void GetRoutingPorts(string s) public static void GetRoutingPorts(string s)
{ {
var device = GetDeviceForKey(s); var device = GetDeviceForKey(s);
if (device == null) return; if (device == null) return;
var inputPorts = ((device as IRoutingInputs) != null) ? (device as IRoutingInputs).InputPorts : null; var inputPorts = ((device as IRoutingInputs) != null) ? (device as IRoutingInputs).InputPorts : null;
var outputPorts = ((device as IRoutingOutputs) != null) ? (device as IRoutingOutputs).OutputPorts : null; var outputPorts = ((device as IRoutingOutputs) != null) ? (device as IRoutingOutputs).OutputPorts : null;
if (inputPorts != null) if (inputPorts != null)
{ {
CrestronConsole.ConsoleCommandResponse("Device {0} has {1} Input Ports:{2}", s, inputPorts.Count, CrestronEnvironment.NewLine); CrestronConsole.ConsoleCommandResponse("Device {0} has {1} Input Ports:", s, inputPorts.Count);
foreach (var routingInputPort in inputPorts) foreach (var routingInputPort in inputPorts)
{ {
CrestronConsole.ConsoleCommandResponse("{0}{1}", routingInputPort.Key, CrestronEnvironment.NewLine); CrestronConsole.ConsoleCommandResponse("{0}", routingInputPort.Key);
} }
} }
if (outputPorts == null) return; if (outputPorts == null) return;
CrestronConsole.ConsoleCommandResponse("Device {0} has {1} Output Ports:{2}", s, outputPorts.Count, CrestronEnvironment.NewLine); CrestronConsole.ConsoleCommandResponse("Device {0} has {1} Output Ports:", s, outputPorts.Count);
foreach (var routingOutputPort in outputPorts) foreach (var routingOutputPort in outputPorts)
{ {
CrestronConsole.ConsoleCommandResponse("{0}{1}", routingOutputPort.Key, CrestronEnvironment.NewLine); CrestronConsole.ConsoleCommandResponse("{0}", routingOutputPort.Key);
} }
} }
/// <summary> /// <summary>
/// Attempts to set the debug level of a device /// Attempts to set the debug level of a device

View File

@@ -1,5 +1,4 @@
using System; using System.Collections.Generic;
using System.Collections.Generic;
using Crestron.SimplSharp; using Crestron.SimplSharp;
using PepperDash.Core; using PepperDash.Core;
using PepperDash.Essentials.Core; using PepperDash.Essentials.Core;
@@ -9,7 +8,6 @@ namespace PepperDash_Essentials_Core.Devices
/// <summary> /// <summary>
/// Interface for any device that is able to control it'spower and has a configurable reboot time /// Interface for any device that is able to control it'spower and has a configurable reboot time
/// </summary> /// </summary>
[Obsolete("PepperDash_Essentials_Core.Devices is Deprecated - use PepperDash.Essentials.Core")]
public interface IHasPowerCycle : IKeyName, IHasPowerControlWithFeedback public interface IHasPowerCycle : IKeyName, IHasPowerControlWithFeedback
{ {
/// <summary> /// <summary>
@@ -26,7 +24,6 @@ namespace PepperDash_Essentials_Core.Devices
/// <summary> /// <summary>
/// Interface for any device that contains a collection of IHasPowerReboot Devices /// Interface for any device that contains a collection of IHasPowerReboot Devices
/// </summary> /// </summary>
[Obsolete("PepperDash_Essentials_Core.Devices is Deprecated - use PepperDash.Essentials.Core")]
public interface IHasControlledPowerOutlets : IKeyName public interface IHasControlledPowerOutlets : IKeyName
{ {
/// <summary> /// <summary>

View File

@@ -1,87 +0,0 @@
using Crestron.SimplSharp;
using PepperDash.Core;
namespace PepperDash.Essentials.Core
{
/// <summary>
/// Interface for any device that has a battery that can be monitored
/// </summary>
public interface IHasBatteryStats : IKeyName
{
int BatteryPercentage { get; }
int BatteryCautionThresholdPercentage { get; }
int BatteryWarningThresholdPercentage { get; }
BoolFeedback BatteryIsWarningFeedback { get; }
BoolFeedback BatteryIsCautionFeedback { get; }
BoolFeedback BatteryIsOkFeedback { get; }
IntFeedback BatteryPercentageFeedback { get; }
}
/// <summary>
/// Interface for any device that has a battery that can be monitored and the ability to charge and discharge
/// </summary>
public interface IHasBatteryCharging : IHasBatteryStats
{
BoolFeedback BatteryIsCharging { get; }
}
/// <summary>
/// Interface for any device that has multiple batteries that can be monitored
/// </summary>
public interface IHasBatteries : IKeyName
{
ReadOnlyDictionary<string, IHasBatteryStats> Batteries { get; }
}
public interface IHasBatteryStatsExtended : IHasBatteryStats
{
int InputVoltage { get; }
int OutputVoltage { get; }
int InptuCurrent { get; }
int OutputCurrent { get; }
IntFeedback InputVoltageFeedback { get; }
IntFeedback OutputVoltageFeedback { get; }
IntFeedback InputCurrentFeedback { get; }
IntFeedback OutputCurrentFeedback { get; }
}
/// <summary>
/// Interface for any device that is able to control its power, has a configurable reboot time, and has batteries that can be monitored
/// </summary>
public interface IHasPowerCycleWithBattery : IHasPowerCycle, IHasBatteryStats
{
}
/// <summary>
/// Interface for any device that is able to control it's power and has a configurable reboot time
/// </summary>
public interface IHasPowerCycle : IKeyName, IHasPowerControlWithFeedback
{
/// <summary>
/// Delay between power off and power on for reboot
/// </summary>
int PowerCycleTimeMs { get; }
/// <summary>
/// Reboot outlet
/// </summary>
void PowerCycle();
}
/// <summary>
/// Interface for any device that contains a collection of IHasPowerReboot Devices
/// </summary>
public interface IHasControlledPowerOutlets : IKeyName
{
/// <summary>
/// Collection of IPduOutlets
/// </summary>
ReadOnlyDictionary<int, IHasPowerCycle> PduOutlets { get; }
}
}

View File

@@ -2,7 +2,6 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.ComponentModel;
using Crestron.SimplSharp; using Crestron.SimplSharp;
namespace PepperDash.Essentials.Core namespace PepperDash.Essentials.Core
@@ -21,109 +20,5 @@ namespace PepperDash.Essentials.Core
{ {
return string.IsNullOrEmpty(s) ? newString : s; return string.IsNullOrEmpty(s) ? newString : s;
} }
/// <summary>
/// Formats string to meet specified parameters
/// </summary>
/// <param name="inputString">string to be formatted</param>
/// <param name="outputStringLength">length of output string</param>
/// <param name="padCharacter">character to pad string with to reach desired output length</param>
/// <param name="justification">Justification of input string with regards to the overall string</param>
/// <param name="separateInput">If true, seperate input string from pad characters with a single space</param>
/// <returns></returns>
public static string AutoPadAndJustify(this string inputString, int outputStringLength, char padCharacter,
AutoPadJustification justification, bool separateInput)
{
var returnString = inputString;
var justifiedAndSeparateLength = (
separateInput
? (justification == AutoPadJustification.Center ? 2 : 1)
: 0);
if (outputStringLength <= inputString.Length + justifiedAndSeparateLength) return returnString;
var fillLength = outputStringLength - inputString.Length - justifiedAndSeparateLength;
switch (justification)
{
case (AutoPadJustification.Left):
{
returnString =
inputString +
new string(' ', separateInput ? 1 : 0) +
new string(padCharacter, fillLength);
break;
}
case (AutoPadJustification.Right):
{
returnString =
new string(padCharacter, fillLength) +
new string(' ', separateInput ? 1 : 0) +
inputString;
break;
}
case (AutoPadJustification.Center):
{
var halfFill = fillLength / 2;
returnString =
new string(padCharacter, halfFill + (fillLength % 2)) +
new string(' ', separateInput ? 1 : 0) +
inputString +
new string(' ', separateInput ? 1 : 0) +
new string(padCharacter, halfFill);
break;
}
}
return returnString;
}
/// <summary>
/// Formats string to meet specified parameters
/// </summary>
/// <param name="inputString">string to be formatted</param>
/// <param name="options">String formatting options</param>
/// <returns></returns>
public static string AutoPadAndJustify(this string inputString, AutoPadJustificationOptions options)
{
if (options == null)
return inputString;
var outputStringLength = options.OutputStringLength;
var padCharacter = options.PadCharacter;
var justification = options.Justification;
var separateInput = options.SeparateInput;
return AutoPadAndJustify(inputString, outputStringLength, padCharacter, justification,
separateInput);
}
}
public enum AutoPadJustification
{
Center,
Left,
Right
}
/// <summary>
/// Options for setting AutoPadJustification
/// </summary>
public class AutoPadJustificationOptions
{
/// <summary>
/// Text Justification for the string, relative to the length
/// </summary>
public AutoPadJustification Justification { get; set; }
/// <summary>
/// If true, separate input string from pad characters by a single ' ' character
/// </summary>
public bool SeparateInput { get; set; }
/// <summary>
/// Pad character to be inserted
/// </summary>
public char PadCharacter { get; set; }
/// <summary>
/// Total length of the output string
/// </summary>
public int OutputStringLength { get; set; }
} }
} }

View File

@@ -175,8 +175,8 @@ namespace PepperDash.Essentials.Core
/// <param name="filter"></param> /// <param name="filter"></param>
public static void GetDeviceFactoryTypes(string filter) public static void GetDeviceFactoryTypes(string filter)
{ {
var types = !string.IsNullOrEmpty(filter) var types = !string.IsNullOrEmpty(filter)
? FactoryMethods.Where(k => k.Key.Contains(filter)).ToDictionary(k => k.Key, k => k.Value) ? FactoryMethods.Where(k => k.Key.Contains(filter)).ToDictionary(k => k.Key, k => k.Value)
: FactoryMethods; : FactoryMethods;
CrestronConsole.ConsoleCommandResponse("Device Types:"); CrestronConsole.ConsoleCommandResponse("Device Types:");
@@ -186,12 +186,12 @@ namespace PepperDash.Essentials.Core
var description = type.Value.Description; var description = type.Value.Description;
var cType = "Not Specified by Plugin"; var cType = "Not Specified by Plugin";
if (type.Value.CType != null) if(type.Value.CType != null)
{ {
cType = type.Value.CType.FullName; cType = type.Value.CType.FullName;
} }
CrestronConsole.ConsoleCommandResponse( CrestronConsole.ConsoleCommandResponse(
@"Type: '{0}' @"Type: '{0}'
CType: '{1}' CType: '{1}'
Description: {2}", type.Key, cType, description); Description: {2}", type.Key, cType, description);

View File

@@ -21,37 +21,35 @@ namespace PepperDash.Essentials.Core
/// </summary> /// </summary>
/// <param name="fileName"></param> /// <param name="fileName"></param>
/// <returns></returns> /// <returns></returns>
public static FileInfo[] GetFiles(string fileName) public static FileInfo[] GetFiles(string fileName)
{ {
string fullFilePath = Global.FilePathPrefix + fileName; DirectoryInfo dirInfo = new DirectoryInfo(Path.GetDirectoryName(fileName));
DirectoryInfo dirInfo = new DirectoryInfo(Path.GetDirectoryName(fullFilePath)); var files = dirInfo.GetFiles(Path.GetFileName(fileName));
var files = dirInfo.GetFiles(Path.GetFileName(fullFilePath)); Debug.Console(0, "FileIO found: {0}, {1}", files.Count(), fileName);
Debug.Console(0, "FileIO found: {0}, {1}", files.Count(), fullFilePath); if (files.Count() > 0)
if (files.Count() > 0) {
{ return files;
return files; }
} else
else {
{ return null;
return null; }
} }
}
public static FileInfo GetFile(string fileName) public static FileInfo GetFile(string fileName)
{ {
string fullFilePath = Global.FilePathPrefix + fileName; DirectoryInfo dirInfo = new DirectoryInfo(Path.GetDirectoryName(fileName));
DirectoryInfo dirInfo = new DirectoryInfo(Path.GetDirectoryName(fullFilePath)); var files = dirInfo.GetFiles(Path.GetFileName(fileName));
var files = dirInfo.GetFiles(Path.GetFileName(fullFilePath)); Debug.Console(0, "FileIO found: {0}, {1}", files.Count(), fileName);
Debug.Console(0, "FileIO found: {0}, {1}", files.Count(), fullFilePath); if (files.Count() > 0)
if (files.Count() > 0) {
{ return files.FirstOrDefault();
return files.FirstOrDefault(); }
} else
else {
{ return null;
return null; }
} }
}
/// <summary> /// <summary>
@@ -83,7 +81,7 @@ namespace PepperDash.Essentials.Core
{ {
if (fileLock.TryEnter()) if (fileLock.TryEnter())
{ {
DirectoryInfo dirInfo = new DirectoryInfo(file.DirectoryName); DirectoryInfo dirInfo = new DirectoryInfo(file.Name);
Debug.Console(2, "FileIO Getting Data {0}", file.FullName); Debug.Console(2, "FileIO Getting Data {0}", file.FullName);
if (File.Exists(file.FullName)) if (File.Exists(file.FullName))
@@ -204,7 +202,7 @@ namespace PepperDash.Essentials.Core
public static void WriteDataToFile(string data, string filePath) public static void WriteDataToFile(string data, string filePath)
{ {
Thread _WriteFileThread; Thread _WriteFileThread;
_WriteFileThread = new Thread((O) => _WriteFileMethod(data, Global.FilePathPrefix + "/" + filePath), null, Thread.eThreadStartOptions.CreateSuspended); _WriteFileThread = new Thread((O) => _WriteFileMethod(data, filePath), null, Thread.eThreadStartOptions.CreateSuspended);
_WriteFileThread.Priority = Thread.eThreadPriority.LowestPriority; _WriteFileThread.Priority = Thread.eThreadPriority.LowestPriority;
_WriteFileThread.Start(); _WriteFileThread.Start();
Debug.Console(0, Debug.ErrorLogLevel.Notice, "New WriteFile Thread"); Debug.Console(0, Debug.ErrorLogLevel.Notice, "New WriteFile Thread");
@@ -219,8 +217,7 @@ namespace PepperDash.Essentials.Core
{ {
if (fileLock.TryEnter()) if (fileLock.TryEnter())
{ {
using (StreamWriter sw = new StreamWriter(filePath))
using (StreamWriter sw = new StreamWriter(filePath))
{ {
sw.Write(data); sw.Write(data);
sw.Flush(); sw.Flush();

View File

@@ -200,7 +200,6 @@
<Compile Include="Crestron IO\Relay\GenericRelayDevice.cs" /> <Compile Include="Crestron IO\Relay\GenericRelayDevice.cs" />
<Compile Include="Crestron IO\Relay\ISwitchedOutput.cs" /> <Compile Include="Crestron IO\Relay\ISwitchedOutput.cs" />
<Compile Include="Crestron IO\StatusSign\StatusSignController.cs" /> <Compile Include="Crestron IO\StatusSign\StatusSignController.cs" />
<Compile Include="Devices\PowerInterfaces.cs" />
<Compile Include="Web\RequestHandlers\AppDebugRequestHandler.cs" /> <Compile Include="Web\RequestHandlers\AppDebugRequestHandler.cs" />
<Compile Include="Web\RequestHandlers\GetFeedbacksForDeviceRequestHandler.cs" /> <Compile Include="Web\RequestHandlers\GetFeedbacksForDeviceRequestHandler.cs" />
<Compile Include="Web\EssentialsWebApiHelpers.cs" /> <Compile Include="Web\EssentialsWebApiHelpers.cs" />

View File

@@ -195,12 +195,13 @@ namespace PepperDash.Essentials
public static void ReportAssemblyVersions(string command) public static void ReportAssemblyVersions(string command)
{ {
CrestronConsole.ConsoleCommandResponse("Loaded Assemblies:" + CrestronEnvironment.NewLine); CrestronConsole.ConsoleCommandResponse("Loaded Assemblies:");
foreach (var assembly in LoadedAssemblies) foreach (var assembly in LoadedAssemblies)
{ {
CrestronConsole.ConsoleCommandResponse("{0} Version: {1}" + CrestronEnvironment.NewLine, assembly.Name, assembly.Version); CrestronConsole.ConsoleCommandResponse("{0} Version: {1}", assembly.Name, assembly.Version);
} }
} }
/// <summary> /// <summary>
/// Moves any .dll assemblies not already loaded from the plugins folder to loadedPlugins folder /// Moves any .dll assemblies not already loaded from the plugins folder to loadedPlugins folder
/// </summary> /// </summary>

View File

@@ -22,7 +22,7 @@ namespace PepperDash.Essentials.DM
/// Builds a controller for basic DM-RMCs with Com and IR ports and no control functions /// Builds a controller for basic DM-RMCs with Com and IR ports and no control functions
/// ///
/// </summary> /// </summary>
public class DmBladeChassisController : CrestronGenericBridgeableBaseDevice, IDmSwitchWithEndpointOnlineFeedback, IRoutingNumericWithFeedback public class DmBladeChassisController : CrestronGenericBridgeableBaseDevice, IDmSwitch, IRoutingNumericWithFeedback
{ {
private const string NonePortKey = "inputCard0--None"; private const string NonePortKey = "inputCard0--None";

View File

@@ -23,7 +23,7 @@ namespace PepperDash.Essentials.DM
/// ///
/// </summary> /// </summary>
[Description("Wrapper class for all DM-MD chassis variants from 8x8 to 32x32")] [Description("Wrapper class for all DM-MD chassis variants from 8x8 to 32x32")]
public class DmChassisController : CrestronGenericBridgeableBaseDevice, IDmSwitchWithEndpointOnlineFeedback, IRoutingNumericWithFeedback public class DmChassisController : CrestronGenericBridgeableBaseDevice, IDmSwitch, IRoutingNumericWithFeedback
{ {
private const string NonePortKey = "inputCard0--None"; private const string NonePortKey = "inputCard0--None";
public DMChassisPropertiesConfig PropertiesConfig { get; set; } public DMChassisPropertiesConfig PropertiesConfig { get; set; }

View File

@@ -0,0 +1,259 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Sockets;
using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.UI;
using Crestron.SimplSharpPro.DM;
using Newtonsoft.Json;
using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Bridges;
using PepperDash.Essentials.Core.Config;
using Crestron.SimplSharpPro.DeviceSupport;
using PepperDash.Essentials.Core.DeviceInfo;
namespace PepperDash.Essentials.DM.Endpoints.DGEs
{
public class DgeBaseController : CrestronGenericBridgeableBaseDevice, IComPorts, IIROutputPorts, IHasBasicTriListWithSmartObject, ICec, IDeviceInfoProvider, IDgeRoutingWithFeedback
{
private const int CtpPort = 41795;
private readonly Dge100 _dge;
public RoutingInputPort HdmiIn { get; protected set; }
public RoutingInputPort ProjectViewIn { get; protected set; }
public RoutingOutputPort HdmiOut { get; protected set; }
protected readonly ushort DmInputJoin;
protected readonly ushort HdmiInputJoin;
protected readonly ushort ProjectViewJoin;
private int SwitchValue;
public RoutingPortCollection<RoutingInputPort> InputPorts
{
get;
private set;
}
public RoutingPortCollection<RoutingOutputPort> OutputPorts
{
get;
private set;
}
private readonly TsxCcsUcCodec100EthernetReservedSigs _dgeEthernetInfo;
public BasicTriListWithSmartObject Panel { get { return _dge; } }
private DeviceConfig _dc;
CrestronDgePropertiesConfig PropertiesConfig;
public DgeBaseController(string key, string name, Dge100 device, DeviceConfig dc, CrestronDgePropertiesConfig props)
:base(key, name, device)
{
_dge = device;
_dc = dc;
PropertiesConfig = props;
DmInputJoin = (ushort)PropertiesConfig.DmInputJoin;
HdmiInputJoin = (ushort)PropertiesConfig.HdmiInputJoin;
ProjectViewJoin = (ushort)PropertiesConfig.ProjectViewVirtualInputJoin;
// Set Ports for CEC
HdmiOut = new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.AudioVideo,
eRoutingPortConnectionType.Hdmi, null, this);
HdmiOut.Port = _dge.HdmiOut;
OutputPorts = new RoutingPortCollection<RoutingOutputPort> { HdmiOut };
_dgeEthernetInfo = _dge.ExtenderEthernetReservedSigs;
//_dgeEthernetInfo.DeviceExtenderSigChange += (extender, args) => UpdateDeviceInfo();
_dgeEthernetInfo.Use();
DeviceInfo = new DeviceInfo();
AudioVideoSourceNumericFeedback = new IntFeedback(() => SwitchValue);
_dge.OnlineStatusChange += (currentDevice, args) => { if (args.DeviceOnLine) UpdateDeviceInfo(); };
_dge.SigChange += TrilistChange;
}
public virtual void TrilistChange(BasicTriList currentDevice, SigEventArgs args)
{
}
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
{
}
#region IComPorts Members
public CrestronCollection<ComPort> ComPorts
{
get { return _dge.ComPorts; }
}
public int NumberOfComPorts
{
get { return _dge.NumberOfComPorts; }
}
#endregion
#region IIROutputPorts Members
public CrestronCollection<IROutputPort> IROutputPorts
{
get { return _dge.IROutputPorts; }
}
public int NumberOfIROutputPorts
{
get { return _dge.NumberOfIROutputPorts; }
}
#endregion
#region ICec Members
public Cec StreamCec { get { return _dge.HdmiOut.StreamCec; } }
#endregion
#region Implementation of IDeviceInfoProvider
public DeviceInfo DeviceInfo { get; private set; }
public event DeviceInfoChangeHandler DeviceInfoChanged;
public void UpdateDeviceInfo()
{
DeviceInfo.IpAddress = _dgeEthernetInfo.IpAddressFeedback.StringValue;
DeviceInfo.MacAddress = _dgeEthernetInfo.MacAddressFeedback.StringValue;
GetFirmwareAndSerialInfo();
OnDeviceInfoChange();
}
private void GetFirmwareAndSerialInfo()
{
if (String.IsNullOrEmpty(_dgeEthernetInfo.IpAddressFeedback.StringValue))
{
Debug.Console(1, this, "IP Address information not yet received. No device is online");
return;
}
var tcpClient = new GenericTcpIpClient("", _dgeEthernetInfo.IpAddressFeedback.StringValue, CtpPort, 1024) { AutoReconnect = false };
var gather = new CommunicationGather(tcpClient, "\r\n\r\n");
tcpClient.ConnectionChange += (sender, args) =>
{
if (!args.Client.IsConnected)
{
return;
}
args.Client.SendText("ver\r\n");
};
gather.LineReceived += (sender, args) =>
{
try
{
Debug.Console(1, this, "{0}", args.Text);
if (args.Text.ToLower().Contains("host"))
{
DeviceInfo.HostName = args.Text.Split(':')[1].Trim();
Debug.Console(1, this, "hostname: {0}", DeviceInfo.HostName);
tcpClient.Disconnect();
return;
}
if (!args.Text.Contains('['))
{
return;
}
var splitResponse = args.Text.Split('[');
foreach (string t in splitResponse)
{
Debug.Console(1, this, "{0}", t);
}
DeviceInfo.SerialNumber = splitResponse[1].Split(' ')[4].Replace("#", "");
DeviceInfo.FirmwareVersion = splitResponse[1].Split(' ')[0];
Debug.Console(1, this, "Firmware: {0} SerialNumber: {1}", DeviceInfo.FirmwareVersion,
DeviceInfo.SerialNumber);
tcpClient.SendText("host\r\n");
}
catch (Exception ex)
{
Debug.Console(0, this, "Exception getting data: {0}", ex.Message);
Debug.Console(0, this, "response: {0}", args.Text);
}
};
tcpClient.Connect();
}
private void OnDeviceInfoChange()
{
var handler = DeviceInfoChanged;
if (handler == null) return;
handler(this, new DeviceInfoEventArgs(DeviceInfo));
}
#endregion
#region IDgeRouting Members
public IntFeedback AudioVideoSourceNumericFeedback { get; set; }
#endregion
#region IRoutingNumeric Members
public void ExecuteNumericSwitch(ushort input, ushort output, eRoutingSignalType type)
{
throw new NotImplementedException();
}
#endregion
#region IRouting Members
public void ExecuteSwitch(object inputSelector, object outputSelector, eRoutingSignalType signalType)
{
throw new NotImplementedException();
}
#endregion
}
}

View File

@@ -1,91 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro.DM;
using Crestron.SimplSharpPro.DM.Endpoints;
using PepperDash.Essentials.Core;
namespace PepperDash_Essentials_DM
{
public interface IHasDmInHdcpSet
{
void SetDmInHdcpState(eHdcpCapabilityType hdcpState);
}
public interface IHasDmInHdcpGet
{
IntFeedback DmInHdcpStateFeedback { get; }
}
public interface IHasDmInHdcp : IHasDmInHdcpGet, IHasDmInHdcpSet
{
eHdcpCapabilityType DmInHdcpCapability { get; }
}
public interface IHasHdmiInHdcpSet
{
void SetHdmiInHdcpState(eHdcpCapabilityType hdcpState);
}
public interface IHasHdmiInHdcpGet
{
IntFeedback HdmiInHdcpStateFeedback { get; }
}
public interface IHasHdmiInHdcp : IHasHdmiInHdcpGet, IHasHdmiInHdcpSet
{
eHdcpCapabilityType HdmiInHdcpCapability { get; }
}
public interface IHasHdmiIn1HdcpSet
{
void SetHdmiIn1HdcpState(eHdcpCapabilityType hdcpState);
}
public interface IHasHdmiIn1HdcpGet
{
IntFeedback HdmiIn1HdcpStateFeedback { get; }
}
public interface IHasHdmiIn1Hdcp : IHasHdmiIn1HdcpGet, IHasHdmiIn1HdcpSet
{
eHdcpCapabilityType HdmiIn1HdcpCapability { get; }
}
public interface IHasHdmiIn2HdcpSet
{
void SetHdmiIn2HdcpState(eHdcpCapabilityType hdcpState);
}
public interface IHasHdmiIn2HdcpGet
{
IntFeedback HdmiInIn2HdcpStateFeedback { get; }
}
public interface IHasHdmi2InHdcp : IHasHdmiIn2HdcpGet, IHasHdmiIn2HdcpSet
{
eHdcpCapabilityType Hdmi2InHdcpCapability { get; }
}
public interface IHasDisplayPortInHdcpGet
{
IntFeedback DisplayPortInHdcpStateFeedback { get; }
}
public interface IHasDisplayPortInHdcpSet
{
void SetDisplayPortInHdcpState(eHdcpCapabilityType hdcpState);
}
public interface IHasDisplayPortInHdcp : IHasDisplayPortInHdcpGet, IHasDisplayPortInHdcpSet
{
eHdcpCapabilityType DisplayPortInHdcpCapability { get; }
}
}

View File

@@ -1,220 +1,196 @@
using Crestron.SimplSharpPro; using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.DeviceSupport; using Crestron.SimplSharpPro.DeviceSupport;
using Crestron.SimplSharpPro.DM; using Crestron.SimplSharpPro.DM;
using Crestron.SimplSharpPro.DM.Endpoints; using Crestron.SimplSharpPro.DM.Endpoints;
using Crestron.SimplSharpPro.DM.Endpoints.Receivers; using Crestron.SimplSharpPro.DM.Endpoints.Receivers;
using PepperDash.Core; using PepperDash.Core;
using PepperDash.Essentials.Core; using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Bridges; using PepperDash.Essentials.Core.Bridges;
using PepperDash_Essentials_DM;
namespace PepperDash.Essentials.DM
namespace PepperDash.Essentials.DM {
{ /// <summary>
/// <summary> /// Builds a controller for basic DM-RMCs with Com and IR ports and no control functions
/// Builds a controller for basic DM-RMCs with Com and IR ports and no control functions ///
/// /// </summary>
/// </summary>
[Description("Wrapper Class for DM-RMC-4K-SCALER-C")] [Description("Wrapper Class for DM-RMC-4K-SCALER-C")]
public class DmRmc4kScalerCController : DmRmcControllerBase, IRoutingInputsOutputs, IBasicVolumeWithFeedback, public class DmRmc4kScalerCController : DmRmcControllerBase, IRoutingInputsOutputs, IBasicVolumeWithFeedback,
IIROutputPorts, IComPorts, ICec, IRelayPorts, IHasDmInHdcp IIROutputPorts, IComPorts, ICec, IRelayPorts
{ {
private readonly DmRmc4kScalerC _rmc; private readonly DmRmc4kScalerC _rmc;
public RoutingInputPort DmIn { get; private set; } public RoutingInputPort DmIn { get; private set; }
public RoutingOutputPort HdmiOut { get; private set; } public RoutingOutputPort HdmiOut { get; private set; }
public RoutingOutputPort BalancedAudioOut { get; private set; } public RoutingOutputPort BalancedAudioOut { get; private set; }
public RoutingPortCollection<RoutingInputPort> InputPorts { get; private set; } public RoutingPortCollection<RoutingInputPort> InputPorts { get; private set; }
public RoutingPortCollection<RoutingOutputPort> OutputPorts { get; private set; } public RoutingPortCollection<RoutingOutputPort> OutputPorts { get; private set; }
public EndpointDmInputStreamWithCec DmInput { get; private set; } /// <summary>
/// Make a Crestron RMC and put it in here
public IntFeedback DmInHdcpStateFeedback { get; private set; } /// </summary>
public DmRmc4kScalerCController(string key, string name, DmRmc4kScalerC rmc)
: base(key, name, rmc)
{
/// <summary> _rmc = rmc;
/// Make a Crestron RMC and put it in here
/// </summary> DmIn = new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.AudioVideo,
public DmRmc4kScalerCController(string key, string name, DmRmc4kScalerC rmc) eRoutingPortConnectionType.DmCat, 0, this);
: base(key, name, rmc) HdmiOut = new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.AudioVideo,
{ eRoutingPortConnectionType.Hdmi, null, this);
_rmc = rmc; BalancedAudioOut = new RoutingOutputPort(DmPortName.BalancedAudioOut, eRoutingSignalType.Audio,
eRoutingPortConnectionType.LineAudio, null, this);
DmIn = new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.AudioVideo,
eRoutingPortConnectionType.DmCat, 0, this); MuteFeedback = new BoolFeedback(() => false);
HdmiOut = new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.AudioVideo,
eRoutingPortConnectionType.Hdmi, null, this); VolumeLevelFeedback = new IntFeedback("MainVolumeLevelFeedback", () =>
BalancedAudioOut = new RoutingOutputPort(DmPortName.BalancedAudioOut, eRoutingSignalType.Audio, rmc.AudioOutput.VolumeFeedback.UShortValue);
eRoutingPortConnectionType.LineAudio, null, this);
EdidManufacturerFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.Manufacturer.StringValue);
MuteFeedback = new BoolFeedback(() => false); EdidNameFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.Name.StringValue);
EdidPreferredTimingFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.PreferredTiming.StringValue);
VolumeLevelFeedback = new IntFeedback("MainVolumeLevelFeedback", () => EdidSerialNumberFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.SerialNumber.StringValue);
rmc.AudioOutput.VolumeFeedback.UShortValue);
InputPorts = new RoutingPortCollection<RoutingInputPort> {DmIn};
EdidManufacturerFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.Manufacturer.StringValue); OutputPorts = new RoutingPortCollection<RoutingOutputPort> {HdmiOut, BalancedAudioOut};
EdidNameFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.Name.StringValue);
EdidPreferredTimingFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.PreferredTiming.StringValue); VideoOutputResolutionFeedback = new StringFeedback(() => _rmc.HdmiOutput.GetVideoResolutionString());
EdidSerialNumberFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.SerialNumber.StringValue);
_rmc.HdmiOutput.OutputStreamChange += HdmiOutput_OutputStreamChange;
InputPorts = new RoutingPortCollection<RoutingInputPort> { DmIn }; _rmc.HdmiOutput.ConnectedDevice.DeviceInformationChange += ConnectedDevice_DeviceInformationChange;
OutputPorts = new RoutingPortCollection<RoutingOutputPort> { HdmiOut, BalancedAudioOut };
// Set Ports for CEC
VideoOutputResolutionFeedback = new StringFeedback(() => _rmc.HdmiOutput.GetVideoResolutionString()); HdmiOut.Port = _rmc.HdmiOutput;
DmInHdcpStateFeedback = new IntFeedback("DmInHdcpCapability", }
() => (int)_rmc.DmInput.HdcpCapabilityFeedback);
void HdmiOutput_OutputStreamChange(EndpointOutputStream outputStream, EndpointOutputStreamEventArgs args)
AddToFeedbackList(DmInHdcpStateFeedback); {
if (args.EventId == EndpointOutputStreamEventIds.HorizontalResolutionFeedbackEventId || args.EventId == EndpointOutputStreamEventIds.VerticalResolutionFeedbackEventId ||
args.EventId == EndpointOutputStreamEventIds.FramesPerSecondFeedbackEventId)
_rmc.HdmiOutput.OutputStreamChange += HdmiOutput_OutputStreamChange; {
_rmc.HdmiOutput.ConnectedDevice.DeviceInformationChange += ConnectedDevice_DeviceInformationChange; VideoOutputResolutionFeedback.FireUpdate();
}
// Set Ports for CEC }
HdmiOut.Port = _rmc.HdmiOutput;
} void ConnectedDevice_DeviceInformationChange(ConnectedDeviceInformation connectedDevice, ConnectedDeviceEventArgs args)
{
void HdmiOutput_OutputStreamChange(EndpointOutputStream outputStream, EndpointOutputStreamEventArgs args) switch (args.EventId)
{ {
if (args.EventId == EndpointOutputStreamEventIds.HorizontalResolutionFeedbackEventId || args.EventId == EndpointOutputStreamEventIds.VerticalResolutionFeedbackEventId || case ConnectedDeviceEventIds.ManufacturerEventId:
args.EventId == EndpointOutputStreamEventIds.FramesPerSecondFeedbackEventId) EdidManufacturerFeedback.FireUpdate();
{ break;
VideoOutputResolutionFeedback.FireUpdate(); case ConnectedDeviceEventIds.NameEventId:
} EdidNameFeedback.FireUpdate();
} break;
case ConnectedDeviceEventIds.PreferredTimingEventId:
void ConnectedDevice_DeviceInformationChange(ConnectedDeviceInformation connectedDevice, ConnectedDeviceEventArgs args) EdidPreferredTimingFeedback.FireUpdate();
{ break;
switch (args.EventId) case ConnectedDeviceEventIds.SerialNumberEventId:
{ EdidSerialNumberFeedback.FireUpdate();
case ConnectedDeviceEventIds.ManufacturerEventId: break;
EdidManufacturerFeedback.FireUpdate(); }
break; }
case ConnectedDeviceEventIds.NameEventId:
EdidNameFeedback.FireUpdate(); public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
break; {
case ConnectedDeviceEventIds.PreferredTimingEventId: LinkDmRmcToApi(this, trilist, joinStart, joinMapKey, bridge);
EdidPreferredTimingFeedback.FireUpdate(); }
break;
case ConnectedDeviceEventIds.SerialNumberEventId: #region IIROutputPorts Members
EdidSerialNumberFeedback.FireUpdate(); public CrestronCollection<IROutputPort> IROutputPorts { get { return _rmc.IROutputPorts; } }
break; public int NumberOfIROutputPorts { get { return _rmc.NumberOfIROutputPorts; } }
} #endregion
}
#region IComPorts Members
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge) public CrestronCollection<ComPort> ComPorts { get { return _rmc.ComPorts; } }
{ public int NumberOfComPorts { get { return _rmc.NumberOfComPorts; } }
LinkDmRmcToApi(this, trilist, joinStart, joinMapKey, bridge); #endregion
}
#region ICec Members
#region IIROutputPorts Members /// <summary>
public CrestronCollection<IROutputPort> IROutputPorts { get { return _rmc.IROutputPorts; } } /// Gets the CEC stream directly from the HDMI port.
public int NumberOfIROutputPorts { get { return _rmc.NumberOfIROutputPorts; } } /// </summary>
#endregion public Cec StreamCec { get { return _rmc.HdmiOutput.StreamCec; } }
#endregion
#region IComPorts Members
public CrestronCollection<ComPort> ComPorts { get { return _rmc.ComPorts; } } #region IRelayPorts Members
public int NumberOfComPorts { get { return _rmc.NumberOfComPorts; } }
#endregion public int NumberOfRelayPorts
{
#region ICec Members get { return _rmc.NumberOfRelayPorts; }
/// <summary> }
/// Gets the CEC stream directly from the HDMI port.
/// </summary> public CrestronCollection<Relay> RelayPorts
public Cec StreamCec { get { return _rmc.HdmiOutput.StreamCec; } } {
#endregion get { return _rmc.RelayPorts; }
}
#region IRelayPorts Members
#endregion
public int NumberOfRelayPorts
{ #region IBasicVolumeWithFeedback Members
get { return _rmc.NumberOfRelayPorts; }
} public BoolFeedback MuteFeedback
{
public CrestronCollection<Relay> RelayPorts get;
{ private set;
get { return _rmc.RelayPorts; } }
}
/// <summary>
#endregion /// Not implemented
/// </summary>
#region IBasicVolumeWithFeedback Members public void MuteOff()
{
public BoolFeedback MuteFeedback Debug.Console(2, this, "DM Endpoint {0} does not have a mute function", Key);
{ }
get;
private set; /// <summary>
} /// Not implemented
/// </summary>
/// <summary> public void MuteOn()
/// Not implemented {
/// </summary> Debug.Console(2, this, "DM Endpoint {0} does not have a mute function", Key);
public void MuteOff() }
{
Debug.Console(2, this, "DM Endpoint {0} does not have a mute function", Key); public void SetVolume(ushort level)
} {
_rmc.AudioOutput.Volume.UShortValue = level;
/// <summary> }
/// Not implemented
/// </summary> public IntFeedback VolumeLevelFeedback
public void MuteOn() {
{ get;
Debug.Console(2, this, "DM Endpoint {0} does not have a mute function", Key); private set;
} }
public void SetVolume(ushort level) #endregion
{
_rmc.AudioOutput.Volume.UShortValue = level; #region IBasicVolumeControls Members
}
/// <summary>
public IntFeedback VolumeLevelFeedback /// Not implemented
{ /// </summary>
get; public void MuteToggle()
private set; {
} Debug.Console(2, this, "DM Endpoint {0} does not have a mute function", Key);
}
#endregion
public void VolumeDown(bool pressRelease)
#region IBasicVolumeControls Members {
if (pressRelease)
/// <summary> SigHelper.RampTimeScaled(_rmc.AudioOutput.Volume, 0, 4000);
/// Not implemented else
/// </summary> _rmc.AudioOutput.Volume.StopRamp();
public void MuteToggle() }
{
Debug.Console(2, this, "DM Endpoint {0} does not have a mute function", Key); public void VolumeUp(bool pressRelease)
} {
if (pressRelease)
public void VolumeDown(bool pressRelease) SigHelper.RampTimeScaled(_rmc.AudioOutput.Volume, 65535, 4000);
{ else
if (pressRelease) _rmc.AudioOutput.Volume.StopRamp();
SigHelper.RampTimeScaled(_rmc.AudioOutput.Volume, 0, 4000); }
else
_rmc.AudioOutput.Volume.StopRamp(); #endregion
} }
public void VolumeUp(bool pressRelease)
{
if (pressRelease)
SigHelper.RampTimeScaled(_rmc.AudioOutput.Volume, 65535, 4000);
else
_rmc.AudioOutput.Volume.StopRamp();
}
#endregion
public eHdcpCapabilityType DmInHdcpCapability
{
get { return eHdcpCapabilityType.Hdcp2_2Support; }
}
public void SetDmInHdcpState(eHdcpCapabilityType hdcpState)
{
if (_rmc == null) return;
_rmc.DmInput.HdcpCapability = hdcpState;
}
}
} }

View File

@@ -5,9 +5,8 @@ using Crestron.SimplSharpPro.DM.Endpoints;
using Crestron.SimplSharpPro.DM.Endpoints.Receivers; using Crestron.SimplSharpPro.DM.Endpoints.Receivers;
using PepperDash.Core; using PepperDash.Core;
using PepperDash.Essentials.Core; using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Bridges; using PepperDash.Essentials.Core.Bridges;
using PepperDash_Essentials_DM;
namespace PepperDash.Essentials.DM namespace PepperDash.Essentials.DM
{ {
/// <summary> /// <summary>
@@ -16,7 +15,7 @@ namespace PepperDash.Essentials.DM
/// </summary> /// </summary>
[Description("Wrapper Class for DM-RMC-4K-SCALER-C-DSP")] [Description("Wrapper Class for DM-RMC-4K-SCALER-C-DSP")]
public class DmRmc4kScalerCDspController : DmRmcControllerBase, IRoutingInputsOutputs, IBasicVolumeWithFeedback, public class DmRmc4kScalerCDspController : DmRmcControllerBase, IRoutingInputsOutputs, IBasicVolumeWithFeedback,
IIROutputPorts, IComPorts, ICec, IRelayPorts, IHasDmInHdcp IIROutputPorts, IComPorts, ICec, IRelayPorts
{ {
private readonly DmRmc4kScalerCDsp _rmc; private readonly DmRmc4kScalerCDsp _rmc;
@@ -26,12 +25,7 @@ namespace PepperDash.Essentials.DM
public RoutingPortCollection<RoutingInputPort> InputPorts { get; private set; } public RoutingPortCollection<RoutingInputPort> InputPorts { get; private set; }
public RoutingPortCollection<RoutingOutputPort> OutputPorts { get; private set; } public RoutingPortCollection<RoutingOutputPort> OutputPorts { get; private set; }
public EndpointDmInputStreamWithCec DmInput { get; private set; }
public IntFeedback DmInHdcpStateFeedback { get; private set; }
/// <summary> /// <summary>
/// Make a Crestron RMC and put it in here /// Make a Crestron RMC and put it in here
@@ -57,13 +51,7 @@ namespace PepperDash.Essentials.DM
EdidPreferredTimingFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.PreferredTiming.StringValue); EdidPreferredTimingFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.PreferredTiming.StringValue);
EdidSerialNumberFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.SerialNumber.StringValue); EdidSerialNumberFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.SerialNumber.StringValue);
VideoOutputResolutionFeedback = new StringFeedback(() => _rmc.HdmiOutput.GetVideoResolutionString()); VideoOutputResolutionFeedback = new StringFeedback(() => _rmc.HdmiOutput.GetVideoResolutionString());
DmInHdcpStateFeedback = new IntFeedback("DmInHdcpCapability",
() => (int) _rmc.DmInput.HdcpCapabilityFeedback);
AddToFeedbackList(DmInHdcpStateFeedback);
InputPorts = new RoutingPortCollection<RoutingInputPort> {DmIn}; InputPorts = new RoutingPortCollection<RoutingInputPort> {DmIn};
OutputPorts = new RoutingPortCollection<RoutingOutputPort> {HdmiOut, BalancedAudioOut}; OutputPorts = new RoutingPortCollection<RoutingOutputPort> {HdmiOut, BalancedAudioOut};
@@ -202,18 +190,6 @@ namespace PepperDash.Essentials.DM
_rmc.AudioOutput.Volume.StopRamp(); _rmc.AudioOutput.Volume.StopRamp();
} }
#endregion #endregion
public eHdcpCapabilityType DmInHdcpCapability
{
get { return eHdcpCapabilityType.Hdcp2_2Support; }
}
public void SetDmInHdcpState(eHdcpCapabilityType hdcpState)
{
if (_rmc == null) return;
_rmc.DmInput.HdcpCapability = hdcpState;
}
} }
} }

View File

@@ -9,13 +9,12 @@ using Crestron.SimplSharpPro.DM.Endpoints.Receivers;
using PepperDash.Essentials.Core; using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Bridges; using PepperDash.Essentials.Core.Bridges;
using PepperDash.Core; using PepperDash.Core;
using PepperDash_Essentials_DM;
namespace PepperDash.Essentials.DM namespace PepperDash.Essentials.DM
{ {
[Description("Wrapper Class for DM-RMC-4K-Z-SCALER-C")] [Description("Wrapper Class for DM-RMC-4K-Z-SCALER-C")]
public class DmRmc4kZScalerCController : DmRmcControllerBase, IRmcRoutingWithFeedback, public class DmRmc4kZScalerCController : DmRmcControllerBase, IRmcRoutingWithFeedback,
IIROutputPorts, IComPorts, ICec, IRelayPorts, IHasDmInHdcp, IHasHdmiInHdcp IIROutputPorts, IComPorts, ICec, IRelayPorts
{ {
private readonly DmRmc4kzScalerC _rmc; private readonly DmRmc4kzScalerC _rmc;
@@ -23,13 +22,6 @@ namespace PepperDash.Essentials.DM
public RoutingInputPort HdmiIn { get; private set; } public RoutingInputPort HdmiIn { get; private set; }
public RoutingOutputPort HdmiOut { get; private set; } public RoutingOutputPort HdmiOut { get; private set; }
public IntFeedback DmInHdcpStateFeedback { get; private set; }
public IntFeedback HdmiInHdcpStateFeedback { get; private set; }
public BoolFeedback HdmiVideoSyncFeedback { get; private set; }
/// <summary> /// <summary>
/// The value of the current video source for the HDMI output on the receiver /// The value of the current video source for the HDMI output on the receiver
/// </summary> /// </summary>
@@ -50,13 +42,13 @@ namespace PepperDash.Essentials.DM
{ {
var newEvent = NumericSwitchChange; var newEvent = NumericSwitchChange;
if (newEvent != null) newEvent(this, e); if (newEvent != null) newEvent(this, e);
} }
public DmRmc4kZScalerCController(string key, string name, DmRmc4kzScalerC rmc) public DmRmc4kZScalerCController(string key, string name, DmRmc4kzScalerC rmc)
: base(key, name, rmc) : base(key, name, rmc)
{ {
_rmc = rmc; _rmc = rmc;
DmIn = new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.AudioVideo, DmIn = new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.AudioVideo,
eRoutingPortConnectionType.DmCat, 0, this) eRoutingPortConnectionType.DmCat, 0, this)
{ {
@@ -70,16 +62,6 @@ namespace PepperDash.Essentials.DM
HdmiOut = new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.AudioVideo, HdmiOut = new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.AudioVideo,
eRoutingPortConnectionType.Hdmi, null, this); eRoutingPortConnectionType.Hdmi, null, this);
HdmiInHdcpStateFeedback = new IntFeedback("HdmiInHdcpCapability",
() => (int)_rmc.HdmiIn.HdcpCapabilityFeedback);
DmInHdcpStateFeedback = new IntFeedback("DmInHdcpCapability",
() => (int)_rmc.DmInput.HdcpCapabilityFeedback);
HdmiVideoSyncFeedback = new BoolFeedback("HdmiInVideoSync",
() => _rmc.HdmiIn.SyncDetectedFeedback.BoolValue);
AddToFeedbackList(HdmiInHdcpStateFeedback, DmInHdcpStateFeedback, HdmiVideoSyncFeedback);
EdidManufacturerFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.Manufacturer.StringValue); EdidManufacturerFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.Manufacturer.StringValue);
EdidNameFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.Name.StringValue); EdidNameFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.Name.StringValue);
EdidPreferredTimingFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.PreferredTiming.StringValue); EdidPreferredTimingFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.PreferredTiming.StringValue);
@@ -87,13 +69,11 @@ namespace PepperDash.Essentials.DM
VideoOutputResolutionFeedback = new StringFeedback(() => _rmc.HdmiOutput.GetVideoResolutionString()); VideoOutputResolutionFeedback = new StringFeedback(() => _rmc.HdmiOutput.GetVideoResolutionString());
InputPorts = new RoutingPortCollection<RoutingInputPort> { DmIn, HdmiIn }; InputPorts = new RoutingPortCollection<RoutingInputPort> {DmIn, HdmiIn};
OutputPorts = new RoutingPortCollection<RoutingOutputPort> { HdmiOut }; OutputPorts = new RoutingPortCollection<RoutingOutputPort> {HdmiOut};
_rmc.HdmiOutput.OutputStreamChange += HdmiOutput_OutputStreamChange; _rmc.HdmiOutput.OutputStreamChange += HdmiOutput_OutputStreamChange;
_rmc.HdmiOutput.ConnectedDevice.DeviceInformationChange += ConnectedDevice_DeviceInformationChange; _rmc.HdmiOutput.ConnectedDevice.DeviceInformationChange += ConnectedDevice_DeviceInformationChange;
_rmc.HdmiIn.InputStreamChange += InputStreamChangeEvent;
_rmc.DmInput.InputStreamChange += InputStreamChangeEvent;
_rmc.OnlineStatusChange += _rmc_OnlineStatusChange; _rmc.OnlineStatusChange += _rmc_OnlineStatusChange;
@@ -103,20 +83,6 @@ namespace PepperDash.Essentials.DM
AudioVideoSourceNumericFeedback = new IntFeedback(() => (ushort)(_rmc.SelectedSourceFeedback)); AudioVideoSourceNumericFeedback = new IntFeedback(() => (ushort)(_rmc.SelectedSourceFeedback));
} }
void InputStreamChangeEvent(EndpointInputStream inputStream, EndpointInputStreamEventArgs args)
{
switch (args.EventId)
{
case EndpointInputStreamEventIds.HdcpCapabilityFeedbackEventId:
if (inputStream == _rmc.HdmiIn) HdmiInHdcpStateFeedback.FireUpdate();
if (inputStream == _rmc.DmInput) DmInHdcpStateFeedback.FireUpdate();
break;
case EndpointInputStreamEventIds.SyncDetectedFeedbackEventId:
if (inputStream == _rmc.HdmiIn) HdmiVideoSyncFeedback.FireUpdate();
break;
}
}
private void _rmc_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args) private void _rmc_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args)
{ {
AudioVideoSourceNumericFeedback.FireUpdate(); AudioVideoSourceNumericFeedback.FireUpdate();
@@ -215,31 +181,5 @@ namespace PepperDash.Essentials.DM
} }
#endregion #endregion
public eHdcpCapabilityType DmInHdcpCapability
{
get { return eHdcpCapabilityType.Hdcp2_2Support; }
}
public void SetDmInHdcpState(eHdcpCapabilityType hdcpState)
{
if (_rmc == null) return;
_rmc.DmInput.HdcpCapability = hdcpState;
}
public eHdcpCapabilityType HdmiInHdcpCapability
{
get { return eHdcpCapabilityType.Hdcp2_2Support; }
}
public void SetHdmiInHdcpState(eHdcpCapabilityType hdcpState)
{
if (_rmc == null) return;
_rmc.HdmiIn.HdcpCapability = hdcpState;
}
} }
} }

View File

@@ -1,6 +1,5 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using Crestron.SimplSharpPro.DeviceSupport; using Crestron.SimplSharpPro.DeviceSupport;
using Crestron.SimplSharpPro.DM; using Crestron.SimplSharpPro.DM;
using Crestron.SimplSharpPro.DM.Cards; using Crestron.SimplSharpPro.DM.Cards;
@@ -12,12 +11,11 @@ using PepperDash.Essentials.Core.Bridges;
using PepperDash.Essentials.Core.DeviceInfo; using PepperDash.Essentials.Core.DeviceInfo;
using PepperDash.Essentials.DM.Config; using PepperDash.Essentials.DM.Config;
using PepperDash.Essentials.Core.Config; using PepperDash.Essentials.Core.Config;
using PepperDash_Essentials_DM;
namespace PepperDash.Essentials.DM namespace PepperDash.Essentials.DM
{ {
[Description("Wrapper class for all DM-RMC variants")] [Description("Wrapper class for all DM-RMC variants")]
public abstract class DmRmcControllerBase : CrestronGenericBridgeableBaseDevice, IDeviceInfoProvider public abstract class DmRmcControllerBase : CrestronGenericBridgeableBaseDevice, IDeviceInfoProvider
{ {
private const int CtpPort = 41795; private const int CtpPort = 41795;
private readonly EndpointReceiverBase _rmc; //kept here just in case. Only property or method on this class that's not device-specific is the DMOutput that it's attached to. private readonly EndpointReceiverBase _rmc; //kept here just in case. Only property or method on this class that's not device-specific is the DMOutput that it's attached to.
@@ -29,15 +27,15 @@ namespace PepperDash.Essentials.DM
public StringFeedback EdidSerialNumberFeedback { get; protected set; } public StringFeedback EdidSerialNumberFeedback { get; protected set; }
protected DmRmcControllerBase(string key, string name, EndpointReceiverBase device) protected DmRmcControllerBase(string key, string name, EndpointReceiverBase device)
: base(key, name, device) : base(key, name, device)
{ {
_rmc = device; _rmc = device;
// if wired to a chassis, skip registration step in base class // if wired to a chassis, skip registration step in base class
PreventRegistration = _rmc.DMOutput != null; PreventRegistration = _rmc.DMOutput != null;
AddToFeedbackList(VideoOutputResolutionFeedback, EdidManufacturerFeedback, EdidSerialNumberFeedback, EdidNameFeedback, EdidPreferredTimingFeedback); AddToFeedbackList(VideoOutputResolutionFeedback, EdidManufacturerFeedback, EdidSerialNumberFeedback, EdidNameFeedback, EdidPreferredTimingFeedback);
DeviceInfo = new DeviceInfo(); DeviceInfo = new DeviceInfo();
IsOnline.OutputChange += (currentDevice, args) => { if (args.BoolValue) UpdateDeviceInfo(); }; IsOnline.OutputChange += (currentDevice, args) => { if (args.BoolValue) UpdateDeviceInfo(); };
@@ -75,80 +73,19 @@ namespace PepperDash.Essentials.DM
rmc.EdidPreferredTimingFeedback.LinkInputSig(trilist.StringInput[joinMap.EdidPrefferedTiming.JoinNumber]); rmc.EdidPreferredTimingFeedback.LinkInputSig(trilist.StringInput[joinMap.EdidPrefferedTiming.JoinNumber]);
if (rmc.EdidSerialNumberFeedback != null) if (rmc.EdidSerialNumberFeedback != null)
rmc.EdidSerialNumberFeedback.LinkInputSig(trilist.StringInput[joinMap.EdidSerialNumber.JoinNumber]); rmc.EdidSerialNumberFeedback.LinkInputSig(trilist.StringInput[joinMap.EdidSerialNumber.JoinNumber]);
//If the device is an DM-RMC-4K-Z-SCALER-C //If the device is an DM-RMC-4K-Z-SCALER-C
var routing = rmc as IRoutingInputsOutputs; var routing = rmc as IRmcRouting;
trilist.UShortInput[joinMap.HdcpInputPortCount.JoinNumber].UShortValue = (ushort)(routing == null
? 1
: routing.InputPorts.Count);
if (routing == null) if (routing == null)
{ {
return; return;
} }
var hdcpCapability = eHdcpCapabilityType.HdcpSupportOff;
if (routing.InputPorts[DmPortName.HdmiIn] != null)
{
var hdmiInHdcp = routing as IHasHdmiInHdcp;
if (hdmiInHdcp != null)
{
if (rmc.Feedbacks["HdmiInHdcpCapability"] != null)
{
var intFeedback = rmc.Feedbacks["HdmiInHdcpCapability"] as IntFeedback;
if (intFeedback != null)
intFeedback.LinkInputSig(trilist.UShortInput[joinMap.Port1HdcpState.JoinNumber]);
}
if (rmc.Feedbacks["HdmiInVideoSync"] != null)
{
var boolFeedback = rmc.Feedbacks["HdmiInVideoSync"] as BoolFeedback;
if (boolFeedback != null)
boolFeedback.LinkInputSig(trilist.BooleanInput[joinMap.HdmiInputSync.JoinNumber]);
}
hdcpCapability = hdmiInHdcp.HdmiInHdcpCapability > hdcpCapability
? hdmiInHdcp.HdmiInHdcpCapability
: hdcpCapability;
trilist.SetUShortSigAction(joinMap.Port1HdcpState.JoinNumber, a => hdmiInHdcp.SetHdmiInHdcpState((eHdcpCapabilityType)a)); if (routing.AudioVideoSourceNumericFeedback != null)
} routing.AudioVideoSourceNumericFeedback.LinkInputSig(trilist.UShortInput[joinMap.AudioVideoSource.JoinNumber]);
}
if (routing.InputPorts[DmPortName.DmIn] != null)
{
var dmInHdcp = rmc as IHasDmInHdcp;
if (dmInHdcp != null) trilist.SetUShortSigAction(joinMap.AudioVideoSource.JoinNumber, a => routing.ExecuteNumericSwitch(a, 1, eRoutingSignalType.AudioVideo));
{
if (rmc.Feedbacks["DmInHdcpCapability"] != null)
{
var intFeedback = rmc.Feedbacks["DmInHdcpCapability"] as IntFeedback;
if (intFeedback != null)
intFeedback.LinkInputSig(trilist.UShortInput[joinMap.Port2HdcpState.JoinNumber]);
}
hdcpCapability = dmInHdcp.DmInHdcpCapability > hdcpCapability
? dmInHdcp.DmInHdcpCapability
: hdcpCapability;
trilist.SetUShortSigAction(joinMap.Port2HdcpState.JoinNumber, a => dmInHdcp.SetDmInHdcpState((eHdcpCapabilityType)a));
}
}
trilist.UShortInput[joinMap.HdcpSupportCapability.JoinNumber].UShortValue = (ushort)hdcpCapability;
trilist.UShortInput[joinMap.HdcpInputPortCount.JoinNumber].UShortValue = (ushort)routing.InputPorts.Count;
var routingWithFeedback = routing as IRmcRouting;
if (routingWithFeedback == null) return;
if (routingWithFeedback.AudioVideoSourceNumericFeedback != null)
routingWithFeedback.AudioVideoSourceNumericFeedback.LinkInputSig(
trilist.UShortInput[joinMap.AudioVideoSource.JoinNumber]);
trilist.SetUShortSigAction(joinMap.AudioVideoSource.JoinNumber,
a => routingWithFeedback.ExecuteNumericSwitch(a, 1, eRoutingSignalType.AudioVideo));
} }
#region Implementation of IDeviceInfoProvider #region Implementation of IDeviceInfoProvider
@@ -206,13 +143,13 @@ namespace PepperDash.Essentials.DM
return; return;
} }
if (args.Text.ToLower().Contains("host")) if (args.Text.ToLower().Contains("host"))
{ {
DeviceInfo.HostName = args.Text.Split(':')[1].Trim(); DeviceInfo.HostName = args.Text.Split(':')[1].Trim();
tcpClient.SendText("maca\r\n"); tcpClient.SendText("maca\r\n");
return; return;
} }
@@ -265,17 +202,17 @@ namespace PepperDash.Essentials.DM
} }
} }
public class DmRmcHelper public class DmRmcHelper
{ {
private static readonly Dictionary<string, Func<string, string, uint, CrestronGenericBaseDevice>> ProcessorFactoryDict; private static readonly Dictionary<string, Func<string, string, uint, CrestronGenericBaseDevice>> ProcessorFactoryDict;
private static readonly Dictionary<string, Func<string, string, DMOutput, CrestronGenericBaseDevice>> ChassisCpu3Dict; private static readonly Dictionary<string, Func<string, string, DMOutput, CrestronGenericBaseDevice>> ChassisCpu3Dict;
private static readonly Dictionary<string, Func<string, string, uint, DMOutput, CrestronGenericBaseDevice>> private static readonly Dictionary<string, Func<string, string, uint, DMOutput, CrestronGenericBaseDevice>>
ChassisDict; ChassisDict;
static DmRmcHelper() static DmRmcHelper()
{ {
ProcessorFactoryDict = new Dictionary<string, Func<string, string, uint, CrestronGenericBaseDevice>> ProcessorFactoryDict = new Dictionary<string, Func<string, string, uint, CrestronGenericBaseDevice>>
{ {
{"dmrmc100c", (k, n, i) => new DmRmcX100CController(k, n, new DmRmc100C(i, Global.ControlSystem))}, {"dmrmc100c", (k, n, i) => new DmRmcX100CController(k, n, new DmRmc100C(i, Global.ControlSystem))},
{"dmrmc100s", (k, n, i) => new DmRmc100SController(k, n, new DmRmc100S(i, Global.ControlSystem))}, {"dmrmc100s", (k, n, i) => new DmRmc100SController(k, n, new DmRmc100S(i, Global.ControlSystem))},
@@ -369,34 +306,34 @@ namespace PepperDash.Essentials.DM
{"dmrmc4k100c1g", (k,n,i,d) => new DmRmc4k100C1GController(k,n, new DmRmc4K100C1G(i, d))} {"dmrmc4k100c1g", (k,n,i,d) => new DmRmc4k100C1GController(k,n, new DmRmc4K100C1G(i, d))}
}; };
} }
/// <summary> /// <summary>
/// A factory method for various DmRmcControllers /// A factory method for various DmRmcControllers
/// </summary> /// </summary>
/// <param name="key">device key. Used to uniquely identify device</param> /// <param name="key">device key. Used to uniquely identify device</param>
/// <param name="name">device name</param> /// <param name="name">device name</param>
/// <param name="typeName">device type name. Used to retrived the correct device</param> /// <param name="typeName">device type name. Used to retrived the correct device</param>
/// <param name="props">Config from config file</param> /// <param name="props">Config from config file</param>
/// <returns></returns> /// <returns></returns>
public static CrestronGenericBaseDevice GetDmRmcController(string key, string name, string typeName, DmRmcPropertiesConfig props) public static CrestronGenericBaseDevice GetDmRmcController(string key, string name, string typeName, DmRmcPropertiesConfig props)
{ {
typeName = typeName.ToLower(); typeName = typeName.ToLower();
var ipid = props.Control.IpIdInt; var ipid = props.Control.IpIdInt;
var pKey = props.ParentDeviceKey.ToLower(); var pKey = props.ParentDeviceKey.ToLower();
// Non-DM-chassis endpoints // Non-DM-chassis endpoints
return pKey == "processor" ? GetDmRmcControllerForProcessor(key, name, typeName, ipid) : GetDmRmcControllerForChassis(key, name, typeName, props, pKey, ipid); return pKey == "processor" ? GetDmRmcControllerForProcessor(key, name, typeName, ipid) : GetDmRmcControllerForChassis(key, name, typeName, props, pKey, ipid);
} }
private static CrestronGenericBaseDevice GetDmRmcControllerForChassis(string key, string name, string typeName, private static CrestronGenericBaseDevice GetDmRmcControllerForChassis(string key, string name, string typeName,
DmRmcPropertiesConfig props, string pKey, uint ipid) DmRmcPropertiesConfig props, string pKey, uint ipid)
{ {
var parentDev = DeviceManager.GetDeviceForKey(pKey); var parentDev = DeviceManager.GetDeviceForKey(pKey);
CrestronGenericBaseDevice rx; CrestronGenericBaseDevice rx;
bool useChassisForOfflineFeedback = false; bool useChassisForOfflineFeedback = false;
if (parentDev is DmpsRoutingController) if (parentDev is DmpsRoutingController)
{ {
var dmps = parentDev as DmpsRoutingController; var dmps = parentDev as DmpsRoutingController;
//Check that the input is within range of this chassis' possible inputs //Check that the input is within range of this chassis' possible inputs
var num = props.ParentOutputNumber; var num = props.ParentOutputNumber;
@@ -411,9 +348,9 @@ namespace PepperDash.Essentials.DM
if (Global.ControlSystemIsDmps4kType) if (Global.ControlSystemIsDmps4kType)
{ {
rx = GetDmRmcControllerForDmps4k(key, name, typeName, dmps, props.ParentOutputNumber); rx = GetDmRmcControllerForDmps4k(key, name, typeName, dmps, props.ParentOutputNumber);
useChassisForOfflineFeedback = true; useChassisForOfflineFeedback = true;
} }
else else
{ {
rx = GetDmRmcControllerForDmps(key, name, typeName, ipid, dmps, props.ParentOutputNumber); rx = GetDmRmcControllerForDmps(key, name, typeName, ipid, dmps, props.ParentOutputNumber);
if (typeName == "hdbasetrx" || typeName == "dmrmc4k100c1g") if (typeName == "hdbasetrx" || typeName == "dmrmc4k100c1g")
@@ -435,10 +372,10 @@ namespace PepperDash.Essentials.DM
}; };
} }
return rx; return rx;
} }
else if (parentDev is IDmSwitchWithEndpointOnlineFeedback) else if (parentDev is DmChassisController)
{ {
var controller = parentDev as IDmSwitchWithEndpointOnlineFeedback; var controller = parentDev as DmChassisController;
var chassis = controller.Chassis; var chassis = controller.Chassis;
var num = props.ParentOutputNumber; var num = props.ParentOutputNumber;
Debug.Console(1, "Creating DM Chassis device '{0}'. Output number '{1}'.", key, num); Debug.Console(1, "Creating DM Chassis device '{0}'. Output number '{1}'.", key, num);
@@ -448,7 +385,7 @@ namespace PepperDash.Essentials.DM
Debug.Console(0, "Cannot create DM device '{0}'. Output number '{1}' is out of range", Debug.Console(0, "Cannot create DM device '{0}'. Output number '{1}' is out of range",
key, num); key, num);
return null; return null;
} }
controller.RxDictionary.Add(num, key); controller.RxDictionary.Add(num, key);
// Catch constructor failures, mainly dues to IPID // Catch constructor failures, mainly dues to IPID
try try
@@ -497,31 +434,31 @@ namespace PepperDash.Essentials.DM
key, pKey); key, pKey);
return null; return null;
} }
} }
private static CrestronGenericBaseDevice GetDmRmcControllerForCpu2Chassis(string key, string name, string typeName, private static CrestronGenericBaseDevice GetDmRmcControllerForCpu2Chassis(string key, string name, string typeName,
uint ipid, Switch chassis, uint num, IKeyed parentDev) uint ipid, Switch chassis, uint num, IKeyed parentDev)
{ {
Func<string, string, uint, DMOutput, CrestronGenericBaseDevice> handler; Func<string, string, uint, DMOutput, CrestronGenericBaseDevice> handler;
if (ChassisDict.TryGetValue(typeName.ToLower(), out handler)) if (ChassisDict.TryGetValue(typeName.ToLower(), out handler))
{ {
return handler(key, name, ipid, chassis.Outputs[num]); return handler(key, name, ipid, chassis.Outputs[num]);
} }
Debug.Console(0, "Cannot create DM-RMC of type '{0}' with parent device {1}", typeName, parentDev.Key); Debug.Console(0, "Cannot create DM-RMC of type '{0}' with parent device {1}", typeName, parentDev.Key);
return null; return null;
} }
private static CrestronGenericBaseDevice GetDmRmcControllerForCpu3Chassis(string key, string name, string typeName, private static CrestronGenericBaseDevice GetDmRmcControllerForCpu3Chassis(string key, string name, string typeName,
Switch chassis, uint num, IKeyed parentDev) Switch chassis, uint num, IKeyed parentDev)
{ {
Func<string, string, DMOutput, CrestronGenericBaseDevice> cpu3Handler; Func<string, string, DMOutput, CrestronGenericBaseDevice> cpu3Handler;
if (ChassisCpu3Dict.TryGetValue(typeName.ToLower(), out cpu3Handler)) if (ChassisCpu3Dict.TryGetValue(typeName.ToLower(), out cpu3Handler))
{ {
return cpu3Handler(key, name, chassis.Outputs[num]); return cpu3Handler(key, name, chassis.Outputs[num]);
} }
Debug.Console(0, "Cannot create DM-RMC of type '{0}' with parent device {1}", typeName, parentDev.Key); Debug.Console(0, "Cannot create DM-RMC of type '{0}' with parent device {1}", typeName, parentDev.Key);
return null; return null;
} }
private static CrestronGenericBaseDevice GetDmRmcControllerForDmps(string key, string name, string typeName, private static CrestronGenericBaseDevice GetDmRmcControllerForDmps(string key, string name, string typeName,
uint ipid, DmpsRoutingController controller, uint num) uint ipid, DmpsRoutingController controller, uint num)
@@ -545,49 +482,49 @@ namespace PepperDash.Essentials.DM
return null; return null;
} }
private static CrestronGenericBaseDevice GetDmRmcControllerForDmps4k(string key, string name, string typeName, private static CrestronGenericBaseDevice GetDmRmcControllerForDmps4k(string key, string name, string typeName,
DmpsRoutingController controller, uint num) DmpsRoutingController controller, uint num)
{ {
Func<string, string, DMOutput, CrestronGenericBaseDevice> dmps4kHandler; Func<string, string, DMOutput, CrestronGenericBaseDevice> dmps4kHandler;
if (ChassisCpu3Dict.TryGetValue(typeName.ToLower(), out dmps4kHandler)) if (ChassisCpu3Dict.TryGetValue(typeName.ToLower(), out dmps4kHandler))
{ {
var output = controller.Dmps.SwitcherOutputs[num] as DMOutput; var output = controller.Dmps.SwitcherOutputs[num] as DMOutput;
if (output != null) if (output != null)
{ {
return dmps4kHandler(key, name, output); return dmps4kHandler(key, name, output);
} }
Debug.Console(0, Debug.ErrorLogLevel.Error, Debug.Console(0, Debug.ErrorLogLevel.Error,
"Cannot attach DM-RMC of type '{0}' to output {1} on DMPS-4K chassis. Output is not a DM Output.", "Cannot attach DM-RMC of type '{0}' to output {1} on DMPS-4K chassis. Output is not a DM Output.",
typeName, num); typeName, num);
return null; return null;
} }
Debug.Console(0, Debug.ErrorLogLevel.Error, "Cannot create DM-RMC of type '{0}' to output {1} on DMPS-4K chassis", typeName, num); Debug.Console(0, Debug.ErrorLogLevel.Error, "Cannot create DM-RMC of type '{0}' to output {1} on DMPS-4K chassis", typeName, num);
return null; return null;
} }
private static CrestronGenericBaseDevice GetDmRmcControllerForProcessor(string key, string name, string typeName, uint ipid) private static CrestronGenericBaseDevice GetDmRmcControllerForProcessor(string key, string name, string typeName, uint ipid)
{ {
try try
{ {
Func<string, string, uint, CrestronGenericBaseDevice> handler; Func<string, string, uint, CrestronGenericBaseDevice> handler;
if (ProcessorFactoryDict.TryGetValue(typeName.ToLower(), out handler)) if (ProcessorFactoryDict.TryGetValue(typeName.ToLower(), out handler))
{ {
return handler(key, name, ipid); return handler(key, name, ipid);
} }
Debug.Console(0, "Cannot create DM-RMC of type: '{0}'", typeName); Debug.Console(0, "Cannot create DM-RMC of type: '{0}'", typeName);
return null;
}
catch (Exception e)
{
Debug.Console(0, "[{0}] WARNING: Cannot create DM-RMC device: {1}", key, e.Message);
return null; return null;
} }
catch (Exception e) }
{ }
Debug.Console(0, "[{0}] WARNING: Cannot create DM-RMC device: {1}", key, e.Message);
return null;
}
}
}
public class DmRmcControllerFactory : EssentialsDeviceFactory<DmRmcControllerBase> public class DmRmcControllerFactory : EssentialsDeviceFactory<DmRmcControllerBase>
{ {
@@ -607,7 +544,7 @@ namespace PepperDash.Essentials.DM
var props = JsonConvert.DeserializeObject var props = JsonConvert.DeserializeObject
<DmRmcPropertiesConfig>(dc.Properties.ToString()); <DmRmcPropertiesConfig>(dc.Properties.ToString());
return DmRmcHelper.GetDmRmcController(dc.Key, dc.Name, type, props); return DmRmcHelper.GetDmRmcController(dc.Key, dc.Name, type, props);
} }
} }

View File

@@ -1,42 +1,42 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using Crestron.SimplSharp; using Crestron.SimplSharp;
using Crestron.SimplSharpPro; using Crestron.SimplSharpPro;
//using Crestron.SimplSharpPro.DeviceSupport; //using Crestron.SimplSharpPro.DeviceSupport;
using Crestron.SimplSharpPro.DeviceSupport; using Crestron.SimplSharpPro.DeviceSupport;
using Crestron.SimplSharpPro.DM; using Crestron.SimplSharpPro.DM;
using Crestron.SimplSharpPro.DM.Endpoints; using Crestron.SimplSharpPro.DM.Endpoints;
using Crestron.SimplSharpPro.DM.Endpoints.Transmitters; using Crestron.SimplSharpPro.DM.Endpoints.Transmitters;
using PepperDash.Core; using PepperDash.Core;
using PepperDash.Essentials.Core; using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Bridges; using PepperDash.Essentials.Core.Bridges;
using PepperDash.Essentials.DM.Config; using PepperDash.Essentials.DM.Config;
namespace PepperDash.Essentials.DM namespace PepperDash.Essentials.DM
{ {
using eVst = Crestron.SimplSharpPro.DeviceSupport.eX02VideoSourceType; using eVst = Crestron.SimplSharpPro.DeviceSupport.eX02VideoSourceType;
using eAst = Crestron.SimplSharpPro.DeviceSupport.eX02AudioSourceType; using eAst = Crestron.SimplSharpPro.DeviceSupport.eX02AudioSourceType;
[Description("Wrapper class for DM-TX-4K-202-C")] [Description("Wrapper class for DM-TX-4K-202-C")]
public class DmTx4k202CController : DmTxControllerBase, ITxRoutingWithFeedback, IHasFeedback, public class DmTx4k202CController : DmTxControllerBase, ITxRoutingWithFeedback, IHasFeedback,
IIROutputPorts, IComPorts IIROutputPorts, IComPorts
{ {
public DmTx4k202C Tx { get; private set; } public DmTx4k202C Tx { get; private set; }
public RoutingInputPortWithVideoStatuses HdmiIn1 { get; private set; } public RoutingInputPortWithVideoStatuses HdmiIn1 { get; private set; }
public RoutingInputPortWithVideoStatuses HdmiIn2 { get; private set; } public RoutingInputPortWithVideoStatuses HdmiIn2 { get; private set; }
public RoutingOutputPort DmOut { get; private set; } public RoutingOutputPort DmOut { get; private set; }
public RoutingOutputPort HdmiLoopOut { get; private set; } public RoutingOutputPort HdmiLoopOut { get; private set; }
public override StringFeedback ActiveVideoInputFeedback { get; protected set; } public override StringFeedback ActiveVideoInputFeedback { get; protected set; }
public IntFeedback VideoSourceNumericFeedback { get; protected set; } public IntFeedback VideoSourceNumericFeedback { get; protected set; }
public IntFeedback AudioSourceNumericFeedback { get; protected set; } public IntFeedback AudioSourceNumericFeedback { get; protected set; }
public IntFeedback HdmiIn1HdcpCapabilityFeedback { get; protected set; } public IntFeedback HdmiIn1HdcpCapabilityFeedback { get; protected set; }
public IntFeedback HdmiIn2HdcpCapabilityFeedback { get; protected set; } public IntFeedback HdmiIn2HdcpCapabilityFeedback { get; protected set; }
public BoolFeedback Hdmi1VideoSyncFeedback { get; protected set; } public BoolFeedback Hdmi1VideoSyncFeedback { get; protected set; }
public BoolFeedback Hdmi2VideoSyncFeedback { get; protected set; } public BoolFeedback Hdmi2VideoSyncFeedback { get; protected set; }
//IroutingNumericEvent //IroutingNumericEvent
@@ -50,50 +50,50 @@ namespace PepperDash.Essentials.DM
{ {
var newEvent = NumericSwitchChange; var newEvent = NumericSwitchChange;
if (newEvent != null) newEvent(this, e); if (newEvent != null) newEvent(this, e);
} }
//public override IntFeedback HdcpSupportAllFeedback { get; protected set; } //public override IntFeedback HdcpSupportAllFeedback { get; protected set; }
//public override ushort HdcpSupportCapability { get; protected set; } //public override ushort HdcpSupportCapability { get; protected set; }
/// <summary> /// <summary>
/// Helps get the "real" inputs, including when in Auto /// Helps get the "real" inputs, including when in Auto
/// </summary> /// </summary>
public Crestron.SimplSharpPro.DeviceSupport.eX02VideoSourceType ActualActiveVideoInput public Crestron.SimplSharpPro.DeviceSupport.eX02VideoSourceType ActualActiveVideoInput
{ {
get get
{ {
if (Tx.VideoSourceFeedback != eVst.Auto) if (Tx.VideoSourceFeedback != eVst.Auto)
return Tx.VideoSourceFeedback; return Tx.VideoSourceFeedback;
else // auto else // auto
{ {
if (Tx.HdmiInputs[1].SyncDetectedFeedback.BoolValue) if (Tx.HdmiInputs[1].SyncDetectedFeedback.BoolValue)
return eVst.Hdmi1; return eVst.Hdmi1;
else if (Tx.HdmiInputs[2].SyncDetectedFeedback.BoolValue) else if (Tx.HdmiInputs[2].SyncDetectedFeedback.BoolValue)
return eVst.Hdmi2; return eVst.Hdmi2;
else else
return eVst.AllDisabled; return eVst.AllDisabled;
} }
} }
} }
public RoutingPortCollection<RoutingInputPort> InputPorts public RoutingPortCollection<RoutingInputPort> InputPorts
{ {
get get
{ {
return new RoutingPortCollection<RoutingInputPort> return new RoutingPortCollection<RoutingInputPort>
{ {
HdmiIn1, HdmiIn1,
HdmiIn2, HdmiIn2,
AnyVideoInput AnyVideoInput
}; };
} }
} }
public RoutingPortCollection<RoutingOutputPort> OutputPorts public RoutingPortCollection<RoutingOutputPort> OutputPorts
{ {
get get
{ {
return new RoutingPortCollection<RoutingOutputPort> { DmOut, HdmiLoopOut }; return new RoutingPortCollection<RoutingOutputPort> { DmOut, HdmiLoopOut };
} }
} }
public DmTx4k202CController(string key, string name, DmTx4k202C tx, bool preventRegistration) public DmTx4k202CController(string key, string name, DmTx4k202C tx, bool preventRegistration)
@@ -127,23 +127,28 @@ namespace PepperDash.Essentials.DM
Tx.OnlineStatusChange += Tx_OnlineStatusChange; Tx.OnlineStatusChange += Tx_OnlineStatusChange;
VideoSourceNumericFeedback = new IntFeedback(() => (int)Tx.VideoSourceFeedback); VideoSourceNumericFeedback = new IntFeedback(() => (int) Tx.VideoSourceFeedback);
AudioSourceNumericFeedback = new IntFeedback(() => (int)Tx.AudioSourceFeedback); AudioSourceNumericFeedback = new IntFeedback(() => (int) Tx.AudioSourceFeedback);
HdmiIn1HdcpCapabilityFeedback = new IntFeedback("HdmiIn1HdcpCapability", HdmiIn1HdcpCapabilityFeedback = new IntFeedback("HdmiIn1HdcpCapability",
() => (int)tx.HdmiInputs[1].HdcpCapabilityFeedback); () => (int) tx.HdmiInputs[1].HdcpCapabilityFeedback);
HdmiIn2HdcpCapabilityFeedback = new IntFeedback("HdmiIn2HdcpCapability", HdmiIn2HdcpCapabilityFeedback = new IntFeedback("HdmiIn2HdcpCapability",
() => (int)tx.HdmiInputs[2].HdcpCapabilityFeedback); () => (int) tx.HdmiInputs[2].HdcpCapabilityFeedback);
HdcpStateFeedback =
new IntFeedback(
() =>
tx.HdmiInputs[1].HdcpCapabilityFeedback > tx.HdmiInputs[2].HdcpCapabilityFeedback
? (int) tx.HdmiInputs[1].HdcpCapabilityFeedback
: (int) tx.HdmiInputs[2].HdcpCapabilityFeedback);
HdcpSupportCapability = eHdcpCapabilityType.Hdcp2_2Support; HdcpSupportCapability = eHdcpCapabilityType.Hdcp2_2Support;
HdcpStateFeedback = new IntFeedback(() => (int)HdcpSupportCapability); Hdmi1VideoSyncFeedback = new BoolFeedback(() => (bool) tx.HdmiInputs[1].SyncDetectedFeedback.BoolValue);
Hdmi1VideoSyncFeedback = new BoolFeedback(() => (bool)tx.HdmiInputs[1].SyncDetectedFeedback.BoolValue); Hdmi2VideoSyncFeedback = new BoolFeedback(() => (bool) tx.HdmiInputs[2].SyncDetectedFeedback.BoolValue);
Hdmi2VideoSyncFeedback = new BoolFeedback(() => (bool)tx.HdmiInputs[2].SyncDetectedFeedback.BoolValue);
var combinedFuncs = new VideoStatusFuncsWrapper var combinedFuncs = new VideoStatusFuncsWrapper
{ {
@@ -205,120 +210,120 @@ namespace PepperDash.Essentials.DM
public override bool CustomActivate() public override bool CustomActivate()
{ {
// Link up all of these damned events to the various RoutingPorts via a helper handler // Link up all of these damned events to the various RoutingPorts via a helper handler
Tx.HdmiInputs[1].InputStreamChange += (o, a) => FowardInputStreamChange(HdmiIn1, a.EventId); Tx.HdmiInputs[1].InputStreamChange += (o, a) => FowardInputStreamChange(HdmiIn1, a.EventId);
Tx.HdmiInputs[1].VideoAttributes.AttributeChange += (o, a) => ForwardVideoAttributeChange(HdmiIn1, a.EventId); Tx.HdmiInputs[1].VideoAttributes.AttributeChange += (o, a) => ForwardVideoAttributeChange(HdmiIn1, a.EventId);
Tx.HdmiInputs[2].InputStreamChange += (o, a) => FowardInputStreamChange(HdmiIn2, a.EventId); Tx.HdmiInputs[2].InputStreamChange += (o, a) => FowardInputStreamChange(HdmiIn2, a.EventId);
Tx.HdmiInputs[2].VideoAttributes.AttributeChange += (o, a) => ForwardVideoAttributeChange(HdmiIn2, a.EventId); Tx.HdmiInputs[2].VideoAttributes.AttributeChange += (o, a) => ForwardVideoAttributeChange(HdmiIn2, a.EventId);
// Base does register and sets up comm monitoring. // Base does register and sets up comm monitoring.
return base.CustomActivate(); return base.CustomActivate();
} }
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge) public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
{ {
var joinMap = GetDmTxJoinMap(joinStart, joinMapKey); var joinMap = GetDmTxJoinMap(joinStart, joinMapKey);
if (Hdmi1VideoSyncFeedback != null) if (Hdmi1VideoSyncFeedback != null)
{ {
Hdmi1VideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.Input1VideoSyncStatus.JoinNumber]); Hdmi1VideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.Input1VideoSyncStatus.JoinNumber]);
} }
if (Hdmi2VideoSyncFeedback != null) if (Hdmi2VideoSyncFeedback != null)
{ {
Hdmi2VideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.Input2VideoSyncStatus.JoinNumber]); Hdmi2VideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.Input2VideoSyncStatus.JoinNumber]);
} }
LinkDmTxToApi(this, trilist, joinMap, bridge); LinkDmTxToApi(this, trilist, joinMap, bridge);
} }
public void ExecuteNumericSwitch(ushort input, ushort output, eRoutingSignalType type) public void ExecuteNumericSwitch(ushort input, ushort output, eRoutingSignalType type)
{ {
Debug.Console(2, this, "Executing Numeric Switch to input {0}.", input); Debug.Console(2, this, "Executing Numeric Switch to input {0}.", input);
switch (type) switch (type)
{ {
case eRoutingSignalType.Video: case eRoutingSignalType.Video:
switch (input) switch (input)
{ {
case 0: case 0:
{ {
ExecuteSwitch(eVst.Auto, null, type); ExecuteSwitch(eVst.Auto, null, type);
break; break;
} }
case 1: case 1:
{ {
ExecuteSwitch(HdmiIn1.Selector, null, type); ExecuteSwitch(HdmiIn1.Selector, null, type);
break; break;
} }
case 2: case 2:
{ {
ExecuteSwitch(HdmiIn2.Selector, null, type); ExecuteSwitch(HdmiIn2.Selector, null, type);
break; break;
} }
case 3: case 3:
{ {
ExecuteSwitch(eVst.AllDisabled, null, type); ExecuteSwitch(eVst.AllDisabled, null, type);
break; break;
} }
} }
break; break;
case eRoutingSignalType.Audio: case eRoutingSignalType.Audio:
switch (input) switch (input)
{ {
case 0: case 0:
{ {
ExecuteSwitch(eAst.Auto, null, type); ExecuteSwitch(eAst.Auto, null, type);
break; break;
} }
case 1: case 1:
{ {
ExecuteSwitch(eAst.Hdmi1, null, type); ExecuteSwitch(eAst.Hdmi1, null, type);
break; break;
} }
case 2: case 2:
{ {
ExecuteSwitch(eAst.Hdmi2, null, type); ExecuteSwitch(eAst.Hdmi2, null, type);
break; break;
} }
case 3: case 3:
{ {
ExecuteSwitch(eAst.AllDisabled, null, type); ExecuteSwitch(eAst.AllDisabled, null, type);
break; break;
} }
} }
break; break;
} }
} }
public void ExecuteSwitch(object inputSelector, object outputSelector, eRoutingSignalType signalType) public void ExecuteSwitch(object inputSelector, object outputSelector, eRoutingSignalType signalType)
{ {
if ((signalType | eRoutingSignalType.Video) == eRoutingSignalType.Video) if ((signalType | eRoutingSignalType.Video) == eRoutingSignalType.Video)
Tx.VideoSource = (eVst)inputSelector; Tx.VideoSource = (eVst)inputSelector;
if ((signalType | eRoutingSignalType.Audio) == eRoutingSignalType.Audio) if ((signalType | eRoutingSignalType.Audio) == eRoutingSignalType.Audio)
Tx.AudioSource = (eAst)inputSelector; Tx.AudioSource = (eAst)inputSelector;
} }
void InputStreamChangeEvent(EndpointInputStream inputStream, EndpointInputStreamEventArgs args) void InputStreamChangeEvent(EndpointInputStream inputStream, EndpointInputStreamEventArgs args)
{ {
Debug.Console(2, "{0} event {1} stream {2}", this.Tx.ToString(), inputStream.ToString(), args.EventId.ToString()); Debug.Console(2, "{0} event {1} stream {2}", this.Tx.ToString(), inputStream.ToString(), args.EventId.ToString());
switch (args.EventId) switch (args.EventId)
{ {
case EndpointInputStreamEventIds.HdcpSupportOffFeedbackEventId: case EndpointInputStreamEventIds.HdcpSupportOffFeedbackEventId:
case EndpointInputStreamEventIds.HdcpSupportOnFeedbackEventId: case EndpointInputStreamEventIds.HdcpSupportOnFeedbackEventId:
case EndpointInputStreamEventIds.HdcpCapabilityFeedbackEventId: case EndpointInputStreamEventIds.HdcpCapabilityFeedbackEventId:
if (inputStream == Tx.HdmiInputs[1]) HdmiIn1HdcpCapabilityFeedback.FireUpdate(); if (inputStream == Tx.HdmiInputs[1]) HdmiIn1HdcpCapabilityFeedback.FireUpdate();
if (inputStream == Tx.HdmiInputs[2]) HdmiIn2HdcpCapabilityFeedback.FireUpdate(); if (inputStream == Tx.HdmiInputs[2]) HdmiIn2HdcpCapabilityFeedback.FireUpdate();
HdcpStateFeedback.FireUpdate(); HdcpStateFeedback.FireUpdate();
break; break;
case EndpointInputStreamEventIds.SyncDetectedFeedbackEventId: case EndpointInputStreamEventIds.SyncDetectedFeedbackEventId:
if (inputStream == Tx.HdmiInputs[1]) Hdmi1VideoSyncFeedback.FireUpdate(); if (inputStream == Tx.HdmiInputs[1]) Hdmi1VideoSyncFeedback.FireUpdate();
if (inputStream == Tx.HdmiInputs[2]) Hdmi2VideoSyncFeedback.FireUpdate(); if (inputStream == Tx.HdmiInputs[2]) Hdmi2VideoSyncFeedback.FireUpdate();
break; break;
} }
} }
void Tx_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args) void Tx_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args)
@@ -356,62 +361,62 @@ namespace PepperDash.Essentials.DM
OnSwitchChange(new RoutingNumericEventArgs(1, AudioSourceNumericFeedback.UShortValue, OutputPorts.First(), localInputAudioPort, eRoutingSignalType.Audio)); OnSwitchChange(new RoutingNumericEventArgs(1, AudioSourceNumericFeedback.UShortValue, OutputPorts.First(), localInputAudioPort, eRoutingSignalType.Audio));
break; break;
} }
} }
/// <summary> /// <summary>
/// Relays the input stream change to the appropriate RoutingInputPort. /// Relays the input stream change to the appropriate RoutingInputPort.
/// </summary> /// </summary>
void FowardInputStreamChange(RoutingInputPortWithVideoStatuses inputPort, int eventId) void FowardInputStreamChange(RoutingInputPortWithVideoStatuses inputPort, int eventId)
{ {
if (eventId != EndpointInputStreamEventIds.SyncDetectedFeedbackEventId) if (eventId != EndpointInputStreamEventIds.SyncDetectedFeedbackEventId)
{ {
return; return;
} }
inputPort.VideoStatus.VideoSyncFeedback.FireUpdate(); inputPort.VideoStatus.VideoSyncFeedback.FireUpdate();
AnyVideoInput.VideoStatus.VideoSyncFeedback.FireUpdate(); AnyVideoInput.VideoStatus.VideoSyncFeedback.FireUpdate();
} }
/// <summary> /// <summary>
/// Relays the VideoAttributes change to a RoutingInputPort /// Relays the VideoAttributes change to a RoutingInputPort
/// </summary> /// </summary>
void ForwardVideoAttributeChange(RoutingInputPortWithVideoStatuses inputPort, int eventId) void ForwardVideoAttributeChange(RoutingInputPortWithVideoStatuses inputPort, int eventId)
{ {
//// LOCATION: Crestron.SimplSharpPro.DM.VideoAttributeEventIds //// LOCATION: Crestron.SimplSharpPro.DM.VideoAttributeEventIds
//Debug.Console(2, this, "VideoAttributes_AttributeChange event id={0} from {1}", //Debug.Console(2, this, "VideoAttributes_AttributeChange event id={0} from {1}",
// args.EventId, (sender as VideoAttributesEnhanced).Owner.GetType()); // args.EventId, (sender as VideoAttributesEnhanced).Owner.GetType());
switch (eventId) switch (eventId)
{ {
case VideoAttributeEventIds.HdcpActiveFeedbackEventId: case VideoAttributeEventIds.HdcpActiveFeedbackEventId:
inputPort.VideoStatus.HdcpActiveFeedback.FireUpdate(); inputPort.VideoStatus.HdcpActiveFeedback.FireUpdate();
AnyVideoInput.VideoStatus.HdcpActiveFeedback.FireUpdate(); AnyVideoInput.VideoStatus.HdcpActiveFeedback.FireUpdate();
break; break;
case VideoAttributeEventIds.HdcpStateFeedbackEventId: case VideoAttributeEventIds.HdcpStateFeedbackEventId:
inputPort.VideoStatus.HdcpStateFeedback.FireUpdate(); inputPort.VideoStatus.HdcpStateFeedback.FireUpdate();
AnyVideoInput.VideoStatus.HdcpStateFeedback.FireUpdate(); AnyVideoInput.VideoStatus.HdcpStateFeedback.FireUpdate();
break; break;
case VideoAttributeEventIds.HorizontalResolutionFeedbackEventId: case VideoAttributeEventIds.HorizontalResolutionFeedbackEventId:
case VideoAttributeEventIds.VerticalResolutionFeedbackEventId: case VideoAttributeEventIds.VerticalResolutionFeedbackEventId:
inputPort.VideoStatus.VideoResolutionFeedback.FireUpdate(); inputPort.VideoStatus.VideoResolutionFeedback.FireUpdate();
AnyVideoInput.VideoStatus.VideoResolutionFeedback.FireUpdate(); AnyVideoInput.VideoStatus.VideoResolutionFeedback.FireUpdate();
break; break;
case VideoAttributeEventIds.FramesPerSecondFeedbackEventId: case VideoAttributeEventIds.FramesPerSecondFeedbackEventId:
inputPort.VideoStatus.VideoResolutionFeedback.FireUpdate(); inputPort.VideoStatus.VideoResolutionFeedback.FireUpdate();
AnyVideoInput.VideoStatus.VideoResolutionFeedback.FireUpdate(); AnyVideoInput.VideoStatus.VideoResolutionFeedback.FireUpdate();
break; break;
} }
} }
#region IIROutputPorts Members #region IIROutputPorts Members
public CrestronCollection<IROutputPort> IROutputPorts { get { return Tx.IROutputPorts; } } public CrestronCollection<IROutputPort> IROutputPorts { get { return Tx.IROutputPorts; } }
public int NumberOfIROutputPorts { get { return Tx.NumberOfIROutputPorts; } } public int NumberOfIROutputPorts { get { return Tx.NumberOfIROutputPorts; } }
#endregion #endregion
#region IComPorts Members #region IComPorts Members
public CrestronCollection<ComPort> ComPorts { get { return Tx.ComPorts; } } public CrestronCollection<ComPort> ComPorts { get { return Tx.ComPorts; } }
public int NumberOfComPorts { get { return Tx.NumberOfComPorts; } } public int NumberOfComPorts { get { return Tx.NumberOfComPorts; } }
#endregion #endregion
} }
} }

View File

@@ -17,22 +17,22 @@ using PepperDash.Essentials.DM.Config;
namespace PepperDash.Essentials.DM namespace PepperDash.Essentials.DM
{ {
using eVst = Crestron.SimplSharpPro.DeviceSupport.eX02VideoSourceType; using eVst = Crestron.SimplSharpPro.DeviceSupport.eX02VideoSourceType;
using eAst = Crestron.SimplSharpPro.DeviceSupport.eX02AudioSourceType; using eAst = Crestron.SimplSharpPro.DeviceSupport.eX02AudioSourceType;
[Description("Wrapper class for DM-TX-4K-302-C")] [Description("Wrapper class for DM-TX-4K-302-C")]
public class DmTx4k302CController : DmTxControllerBase, ITxRoutingWithFeedback, IHasFeedback, public class DmTx4k302CController : DmTxControllerBase, ITxRoutingWithFeedback, IHasFeedback,
IIROutputPorts, IComPorts, IHasFreeRun, IVgaBrightnessContrastControls IIROutputPorts, IComPorts, IHasFreeRun, IVgaBrightnessContrastControls
{ {
public DmTx4k302C Tx { get; private set; } public DmTx4k302C Tx { get; private set; }
public RoutingInputPortWithVideoStatuses HdmiIn1 { get; private set; } public RoutingInputPortWithVideoStatuses HdmiIn1 { get; private set; }
public RoutingInputPortWithVideoStatuses HdmiIn2 { get; private set; } public RoutingInputPortWithVideoStatuses HdmiIn2 { get; private set; }
public RoutingInputPortWithVideoStatuses VgaIn { get; private set; } public RoutingInputPortWithVideoStatuses VgaIn { get; private set; }
public RoutingOutputPort DmOut { get; private set; } public RoutingOutputPort DmOut { get; private set; }
public RoutingOutputPort HdmiLoopOut { get; private set; } public RoutingOutputPort HdmiLoopOut { get; private set; }
public override StringFeedback ActiveVideoInputFeedback { get; protected set; } public override StringFeedback ActiveVideoInputFeedback { get; protected set; }
public IntFeedback VideoSourceNumericFeedback { get; protected set; } public IntFeedback VideoSourceNumericFeedback { get; protected set; }
public IntFeedback AudioSourceNumericFeedback { get; protected set; } public IntFeedback AudioSourceNumericFeedback { get; protected set; }
public IntFeedback HdmiIn1HdcpCapabilityFeedback { get; protected set; } public IntFeedback HdmiIn1HdcpCapabilityFeedback { get; protected set; }
@@ -60,78 +60,78 @@ namespace PepperDash.Essentials.DM
} }
/// <summary> /// <summary>
/// Helps get the "real" inputs, including when in Auto /// Helps get the "real" inputs, including when in Auto
/// </summary> /// </summary>
public Crestron.SimplSharpPro.DeviceSupport.eX02VideoSourceType ActualActiveVideoInput public Crestron.SimplSharpPro.DeviceSupport.eX02VideoSourceType ActualActiveVideoInput
{ {
get get
{ {
if (Tx.VideoSourceFeedback != eVst.Auto) if (Tx.VideoSourceFeedback != eVst.Auto)
return Tx.VideoSourceFeedback; return Tx.VideoSourceFeedback;
else // auto else // auto
{ {
if (Tx.HdmiInputs[1].SyncDetectedFeedback.BoolValue) if (Tx.HdmiInputs[1].SyncDetectedFeedback.BoolValue)
return eVst.Hdmi1; return eVst.Hdmi1;
else if (Tx.HdmiInputs[2].SyncDetectedFeedback.BoolValue) else if (Tx.HdmiInputs[2].SyncDetectedFeedback.BoolValue)
return eVst.Hdmi2; return eVst.Hdmi2;
else if (Tx.VgaInput.SyncDetectedFeedback.BoolValue) else if (Tx.VgaInput.SyncDetectedFeedback.BoolValue)
return eVst.Vga; return eVst.Vga;
else else
return eVst.AllDisabled; return eVst.AllDisabled;
} }
} }
} }
public RoutingPortCollection<RoutingInputPort> InputPorts public RoutingPortCollection<RoutingInputPort> InputPorts
{ {
get get
{ {
return new RoutingPortCollection<RoutingInputPort> return new RoutingPortCollection<RoutingInputPort>
{ {
HdmiIn1, HdmiIn1,
HdmiIn2, HdmiIn2,
VgaIn, VgaIn,
AnyVideoInput AnyVideoInput
}; };
} }
} }
public RoutingPortCollection<RoutingOutputPort> OutputPorts public RoutingPortCollection<RoutingOutputPort> OutputPorts
{ {
get get
{ {
return new RoutingPortCollection<RoutingOutputPort> { DmOut, HdmiLoopOut }; return new RoutingPortCollection<RoutingOutputPort> { DmOut, HdmiLoopOut };
} }
} }
public DmTx4k302CController(string key, string name, DmTx4k302C tx, bool preventRegistration) public DmTx4k302CController(string key, string name, DmTx4k302C tx, bool preventRegistration)
: base(key, name, tx) : base(key, name, tx)
{ {
Tx = tx; Tx = tx;
PreventRegistration = preventRegistration; PreventRegistration = preventRegistration;
HdmiIn1 = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn1, HdmiIn1 = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn1,
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, eVst.Hdmi1, this, eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, eVst.Hdmi1, this,
VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInputs[1])) VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInputs[1]))
{ {
FeedbackMatchObject = eVst.Hdmi1 FeedbackMatchObject = eVst.Hdmi1
}; };
HdmiIn2 = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn2, HdmiIn2 = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn2,
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, eVst.Hdmi2, this, eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, eVst.Hdmi2, this,
VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInputs[2])) VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInputs[2]))
{ {
FeedbackMatchObject = eVst.Hdmi2 FeedbackMatchObject = eVst.Hdmi2
}; };
VgaIn = new RoutingInputPortWithVideoStatuses(DmPortName.VgaIn, VgaIn = new RoutingInputPortWithVideoStatuses(DmPortName.VgaIn,
eRoutingSignalType.Video, eRoutingPortConnectionType.Vga, eVst.Vga, this, eRoutingSignalType.Video, eRoutingPortConnectionType.Vga, eVst.Vga, this,
VideoStatusHelper.GetVgaInputStatusFuncs(tx.VgaInput)) VideoStatusHelper.GetVgaInputStatusFuncs(tx.VgaInput))
{ {
FeedbackMatchObject = eVst.Vga FeedbackMatchObject = eVst.Vga
}; };
ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput", ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput",
() => ActualActiveVideoInput.ToString()); () => ActualActiveVideoInput.ToString());
Tx.HdmiInputs[1].InputStreamChange += InputStreamChangeEvent; Tx.HdmiInputs[1].InputStreamChange += InputStreamChangeEvent;
Tx.HdmiInputs[2].InputStreamChange += InputStreamChangeEvent; Tx.HdmiInputs[2].InputStreamChange += InputStreamChangeEvent;
Tx.VgaInput.InputStreamChange += VgaInputOnInputStreamChange; Tx.VgaInput.InputStreamChange += VgaInputOnInputStreamChange;
Tx.BaseEvent += Tx_BaseEvent; Tx.BaseEvent += Tx_BaseEvent;
@@ -145,9 +145,14 @@ namespace PepperDash.Essentials.DM
HdmiIn2HdcpCapabilityFeedback = new IntFeedback("HdmiIn2HdcpCapability", () => (int)tx.HdmiInputs[2].HdcpCapabilityFeedback); HdmiIn2HdcpCapabilityFeedback = new IntFeedback("HdmiIn2HdcpCapability", () => (int)tx.HdmiInputs[2].HdcpCapabilityFeedback);
HdcpSupportCapability = eHdcpCapabilityType.Hdcp2_2Support; HdcpStateFeedback =
new IntFeedback(
() =>
tx.HdmiInputs[1].HdcpCapabilityFeedback > tx.HdmiInputs[2].HdcpCapabilityFeedback
? (int)tx.HdmiInputs[1].HdcpCapabilityFeedback
: (int)tx.HdmiInputs[2].HdcpCapabilityFeedback);
HdcpStateFeedback = new IntFeedback(() => (int)HdcpSupportCapability); HdcpSupportCapability = eHdcpCapabilityType.Hdcp2_2Support;
Hdmi1VideoSyncFeedback = new BoolFeedback(() => (bool)tx.HdmiInputs[1].SyncDetectedFeedback.BoolValue); Hdmi1VideoSyncFeedback = new BoolFeedback(() => (bool)tx.HdmiInputs[1].SyncDetectedFeedback.BoolValue);
@@ -163,46 +168,46 @@ namespace PepperDash.Essentials.DM
tx.VgaInput.VideoControls.ControlChange += new Crestron.SimplSharpPro.DeviceSupport.GenericEventHandler(VideoControls_ControlChange); tx.VgaInput.VideoControls.ControlChange += new Crestron.SimplSharpPro.DeviceSupport.GenericEventHandler(VideoControls_ControlChange);
var combinedFuncs = new VideoStatusFuncsWrapper var combinedFuncs = new VideoStatusFuncsWrapper
{ {
HdcpActiveFeedbackFunc = () => HdcpActiveFeedbackFunc = () =>
(ActualActiveVideoInput == eVst.Hdmi1 (ActualActiveVideoInput == eVst.Hdmi1
&& tx.HdmiInputs[1].VideoAttributes.HdcpActiveFeedback.BoolValue) && tx.HdmiInputs[1].VideoAttributes.HdcpActiveFeedback.BoolValue)
|| (ActualActiveVideoInput == eVst.Hdmi2 || (ActualActiveVideoInput == eVst.Hdmi2
&& tx.HdmiInputs[2].VideoAttributes.HdcpActiveFeedback.BoolValue), && tx.HdmiInputs[2].VideoAttributes.HdcpActiveFeedback.BoolValue),
HdcpStateFeedbackFunc = () => HdcpStateFeedbackFunc = () =>
{ {
if (ActualActiveVideoInput == eVst.Hdmi1) if (ActualActiveVideoInput == eVst.Hdmi1)
return tx.HdmiInputs[1].VideoAttributes.HdcpStateFeedback.ToString(); return tx.HdmiInputs[1].VideoAttributes.HdcpStateFeedback.ToString();
return ActualActiveVideoInput == eVst.Hdmi2 ? tx.HdmiInputs[2].VideoAttributes.HdcpStateFeedback.ToString() : ""; return ActualActiveVideoInput == eVst.Hdmi2 ? tx.HdmiInputs[2].VideoAttributes.HdcpStateFeedback.ToString() : "";
}, },
VideoResolutionFeedbackFunc = () => VideoResolutionFeedbackFunc = () =>
{ {
if (ActualActiveVideoInput == eVst.Hdmi1) if (ActualActiveVideoInput == eVst.Hdmi1)
return tx.HdmiInputs[1].VideoAttributes.GetVideoResolutionString(); return tx.HdmiInputs[1].VideoAttributes.GetVideoResolutionString();
if (ActualActiveVideoInput == eVst.Hdmi2) if (ActualActiveVideoInput == eVst.Hdmi2)
return tx.HdmiInputs[2].VideoAttributes.GetVideoResolutionString(); return tx.HdmiInputs[2].VideoAttributes.GetVideoResolutionString();
return ActualActiveVideoInput == eVst.Vga ? tx.VgaInput.VideoAttributes.GetVideoResolutionString() : ""; return ActualActiveVideoInput == eVst.Vga ? tx.VgaInput.VideoAttributes.GetVideoResolutionString() : "";
}, },
VideoSyncFeedbackFunc = () => VideoSyncFeedbackFunc = () =>
(ActualActiveVideoInput == eVst.Hdmi1 (ActualActiveVideoInput == eVst.Hdmi1
&& tx.HdmiInputs[1].SyncDetectedFeedback.BoolValue) && tx.HdmiInputs[1].SyncDetectedFeedback.BoolValue)
|| (ActualActiveVideoInput == eVst.Hdmi2 || (ActualActiveVideoInput == eVst.Hdmi2
&& tx.HdmiInputs[2].SyncDetectedFeedback.BoolValue) && tx.HdmiInputs[2].SyncDetectedFeedback.BoolValue)
|| (ActualActiveVideoInput == eVst.Vga || (ActualActiveVideoInput == eVst.Vga
&& tx.VgaInput.SyncDetectedFeedback.BoolValue) && tx.VgaInput.SyncDetectedFeedback.BoolValue)
};
}; AnyVideoInput = new RoutingInputPortWithVideoStatuses(DmPortName.AnyVideoIn,
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.None, 0, this, combinedFuncs);
AnyVideoInput = new RoutingInputPortWithVideoStatuses(DmPortName.AnyVideoIn, DmOut = new RoutingOutputPort(DmPortName.DmOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.None, 0, this, combinedFuncs); eRoutingPortConnectionType.DmCat, null, this);
HdmiLoopOut = new RoutingOutputPort(DmPortName.HdmiLoopOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
DmOut = new RoutingOutputPort(DmPortName.DmOut, eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, null, this);
eRoutingPortConnectionType.DmCat, null, this);
HdmiLoopOut = new RoutingOutputPort(DmPortName.HdmiLoopOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
eRoutingPortConnectionType.Hdmi, null, this);
AddToFeedbackList(ActiveVideoInputFeedback, VideoSourceNumericFeedback, AudioSourceNumericFeedback, AddToFeedbackList(ActiveVideoInputFeedback, VideoSourceNumericFeedback, AudioSourceNumericFeedback,
@@ -216,7 +221,7 @@ namespace PepperDash.Essentials.DM
HdmiIn2.Port = Tx.HdmiInputs[2]; HdmiIn2.Port = Tx.HdmiInputs[2];
HdmiLoopOut.Port = Tx.HdmiOutput; HdmiLoopOut.Port = Tx.HdmiOutput;
DmOut.Port = Tx.DmOutput; DmOut.Port = Tx.DmOutput;
} }
void VgaInputOnInputStreamChange(EndpointInputStream inputStream, EndpointInputStreamEventArgs args) void VgaInputOnInputStreamChange(EndpointInputStream inputStream, EndpointInputStreamEventArgs args)
{ {
@@ -249,21 +254,21 @@ namespace PepperDash.Essentials.DM
public override bool CustomActivate() public override bool CustomActivate()
{ {
// Link up all of these damned events to the various RoutingPorts via a helper handler // Link up all of these damned events to the various RoutingPorts via a helper handler
Tx.HdmiInputs[1].InputStreamChange += (o, a) => FowardInputStreamChange(HdmiIn1, a.EventId); Tx.HdmiInputs[1].InputStreamChange += (o, a) => FowardInputStreamChange(HdmiIn1, a.EventId);
Tx.HdmiInputs[1].VideoAttributes.AttributeChange += (o, a) => ForwardVideoAttributeChange(HdmiIn1, a.EventId); Tx.HdmiInputs[1].VideoAttributes.AttributeChange += (o, a) => ForwardVideoAttributeChange(HdmiIn1, a.EventId);
Tx.HdmiInputs[2].InputStreamChange += (o, a) => FowardInputStreamChange(HdmiIn2, a.EventId); Tx.HdmiInputs[2].InputStreamChange += (o, a) => FowardInputStreamChange(HdmiIn2, a.EventId);
Tx.HdmiInputs[2].VideoAttributes.AttributeChange += (o, a) => ForwardVideoAttributeChange(HdmiIn2, a.EventId); Tx.HdmiInputs[2].VideoAttributes.AttributeChange += (o, a) => ForwardVideoAttributeChange(HdmiIn2, a.EventId);
Tx.VgaInput.InputStreamChange += (o, a) => FowardInputStreamChange(VgaIn, a.EventId); Tx.VgaInput.InputStreamChange += (o, a) => FowardInputStreamChange(VgaIn, a.EventId);
Tx.VgaInput.VideoAttributes.AttributeChange += (o, a) => ForwardVideoAttributeChange(VgaIn, a.EventId); Tx.VgaInput.VideoAttributes.AttributeChange += (o, a) => ForwardVideoAttributeChange(VgaIn, a.EventId);
// Base does register and sets up comm monitoring. // Base does register and sets up comm monitoring.
return base.CustomActivate(); return base.CustomActivate();
} }
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge) public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
{ {
@@ -324,60 +329,60 @@ namespace PepperDash.Essentials.DM
switch (input) switch (input)
{ {
case 0: case 0:
{ {
ExecuteSwitch(eVst.Auto, null, type); ExecuteSwitch(eVst.Auto, null, type);
break; break;
} }
case 1: case 1:
{ {
ExecuteSwitch(HdmiIn1.Selector, null, type); ExecuteSwitch(HdmiIn1.Selector, null, type);
break; break;
} }
case 2: case 2:
{ {
ExecuteSwitch(HdmiIn2.Selector, null, type); ExecuteSwitch(HdmiIn2.Selector, null, type);
break; break;
} }
case 3: case 3:
{ {
ExecuteSwitch(VgaIn.Selector, null, type); ExecuteSwitch(VgaIn.Selector, null, type);
break; break;
} }
case 4: case 4:
{ {
ExecuteSwitch(eVst.AllDisabled, null, type); ExecuteSwitch(eVst.AllDisabled, null, type);
break; break;
} }
} }
break; break;
case eRoutingSignalType.Audio: case eRoutingSignalType.Audio:
switch (input) switch (input)
{ {
case 0: case 0:
{ {
ExecuteSwitch(eAst.Auto, null, type); ExecuteSwitch(eAst.Auto, null, type);
break; break;
} }
case 1: case 1:
{ {
ExecuteSwitch(eAst.Hdmi1, null, type); ExecuteSwitch(eAst.Hdmi1, null, type);
break; break;
} }
case 2: case 2:
{ {
ExecuteSwitch(eAst.Hdmi2, null, type); ExecuteSwitch(eAst.Hdmi2, null, type);
break; break;
} }
case 3: case 3:
{ {
ExecuteSwitch(eAst.AudioIn, null, type); ExecuteSwitch(eAst.AudioIn, null, type);
break; break;
} }
case 4: case 4:
{ {
ExecuteSwitch(eAst.AllDisabled, null, type); ExecuteSwitch(eAst.AllDisabled, null, type);
break; break;
} }
} }
break; break;
} }
@@ -448,54 +453,54 @@ namespace PepperDash.Essentials.DM
} }
/// <summary> /// <summary>
/// Relays the input stream change to the appropriate RoutingInputPort. /// Relays the input stream change to the appropriate RoutingInputPort.
/// </summary> /// </summary>
void FowardInputStreamChange(RoutingInputPortWithVideoStatuses inputPort, int eventId) void FowardInputStreamChange(RoutingInputPortWithVideoStatuses inputPort, int eventId)
{ {
if (eventId != EndpointInputStreamEventIds.SyncDetectedFeedbackEventId) return; if (eventId != EndpointInputStreamEventIds.SyncDetectedFeedbackEventId) return;
inputPort.VideoStatus.VideoSyncFeedback.FireUpdate(); inputPort.VideoStatus.VideoSyncFeedback.FireUpdate();
AnyVideoInput.VideoStatus.VideoSyncFeedback.FireUpdate(); AnyVideoInput.VideoStatus.VideoSyncFeedback.FireUpdate();
} }
/// <summary> /// <summary>
/// Relays the VideoAttributes change to a RoutingInputPort /// Relays the VideoAttributes change to a RoutingInputPort
/// </summary> /// </summary>
void ForwardVideoAttributeChange(RoutingInputPortWithVideoStatuses inputPort, int eventId) void ForwardVideoAttributeChange(RoutingInputPortWithVideoStatuses inputPort, int eventId)
{ {
//// LOCATION: Crestron.SimplSharpPro.DM.VideoAttributeEventIds //// LOCATION: Crestron.SimplSharpPro.DM.VideoAttributeEventIds
//Debug.Console(2, this, "VideoAttributes_AttributeChange event id={0} from {1}", //Debug.Console(2, this, "VideoAttributes_AttributeChange event id={0} from {1}",
// args.EventId, (sender as VideoAttributesEnhanced).Owner.GetType()); // args.EventId, (sender as VideoAttributesEnhanced).Owner.GetType());
switch (eventId) switch (eventId)
{ {
case VideoAttributeEventIds.HdcpActiveFeedbackEventId: case VideoAttributeEventIds.HdcpActiveFeedbackEventId:
inputPort.VideoStatus.HdcpActiveFeedback.FireUpdate(); inputPort.VideoStatus.HdcpActiveFeedback.FireUpdate();
AnyVideoInput.VideoStatus.HdcpActiveFeedback.FireUpdate(); AnyVideoInput.VideoStatus.HdcpActiveFeedback.FireUpdate();
break; break;
case VideoAttributeEventIds.HdcpStateFeedbackEventId: case VideoAttributeEventIds.HdcpStateFeedbackEventId:
inputPort.VideoStatus.HdcpStateFeedback.FireUpdate(); inputPort.VideoStatus.HdcpStateFeedback.FireUpdate();
AnyVideoInput.VideoStatus.HdcpStateFeedback.FireUpdate(); AnyVideoInput.VideoStatus.HdcpStateFeedback.FireUpdate();
break; break;
case VideoAttributeEventIds.HorizontalResolutionFeedbackEventId: case VideoAttributeEventIds.HorizontalResolutionFeedbackEventId:
case VideoAttributeEventIds.VerticalResolutionFeedbackEventId: case VideoAttributeEventIds.VerticalResolutionFeedbackEventId:
inputPort.VideoStatus.VideoResolutionFeedback.FireUpdate(); inputPort.VideoStatus.VideoResolutionFeedback.FireUpdate();
AnyVideoInput.VideoStatus.VideoResolutionFeedback.FireUpdate(); AnyVideoInput.VideoStatus.VideoResolutionFeedback.FireUpdate();
break; break;
case VideoAttributeEventIds.FramesPerSecondFeedbackEventId: case VideoAttributeEventIds.FramesPerSecondFeedbackEventId:
inputPort.VideoStatus.VideoResolutionFeedback.FireUpdate(); inputPort.VideoStatus.VideoResolutionFeedback.FireUpdate();
AnyVideoInput.VideoStatus.VideoResolutionFeedback.FireUpdate(); AnyVideoInput.VideoStatus.VideoResolutionFeedback.FireUpdate();
break; break;
} }
} }
#region IIROutputPorts Members #region IIROutputPorts Members
public CrestronCollection<IROutputPort> IROutputPorts { get { return Tx.IROutputPorts; } } public CrestronCollection<IROutputPort> IROutputPorts { get { return Tx.IROutputPorts; } }
public int NumberOfIROutputPorts { get { return Tx.NumberOfIROutputPorts; } } public int NumberOfIROutputPorts { get { return Tx.NumberOfIROutputPorts; } }
#endregion #endregion
#region IComPorts Members #region IComPorts Members
public CrestronCollection<ComPort> ComPorts { get { return Tx.ComPorts; } } public CrestronCollection<ComPort> ComPorts { get { return Tx.ComPorts; } }
public int NumberOfComPorts { get { return Tx.NumberOfComPorts; } } public int NumberOfComPorts { get { return Tx.NumberOfComPorts; } }
#endregion #endregion
} }
} }

View File

@@ -121,7 +121,7 @@ namespace PepperDash.Essentials.DM
Tx.HdmiInputs[1].InputStreamChange += InputStreamChangeEvent; Tx.HdmiInputs[1].InputStreamChange += InputStreamChangeEvent;
Tx.HdmiInputs[2].InputStreamChange += InputStreamChangeEvent; Tx.HdmiInputs[2].InputStreamChange += InputStreamChangeEvent;
Tx.DisplayPortInput.InputStreamChange += InputStreamChangeEvent; Tx.DisplayPortInput.InputStreamChange += DisplayPortInputStreamChange;
Tx.BaseEvent += Tx_BaseEvent; Tx.BaseEvent += Tx_BaseEvent;
Tx.OnlineStatusChange += Tx_OnlineStatusChange; Tx.OnlineStatusChange += Tx_OnlineStatusChange;
@@ -131,10 +131,11 @@ namespace PepperDash.Essentials.DM
HdmiIn1HdcpCapabilityFeedback = new IntFeedback("HdmiIn1HdcpCapability", () => (int)tx.HdmiInputs[1].HdcpCapabilityFeedback); HdmiIn1HdcpCapabilityFeedback = new IntFeedback("HdmiIn1HdcpCapability", () => (int)tx.HdmiInputs[1].HdcpCapabilityFeedback);
HdmiIn2HdcpCapabilityFeedback = new IntFeedback("HdmiIn2HdcpCapability", () => (int)tx.HdmiInputs[2].HdcpCapabilityFeedback); HdmiIn2HdcpCapabilityFeedback = new IntFeedback("HdmiIn2HdcpCapability", () => (int)tx.HdmiInputs[2].HdcpCapabilityFeedback);
DisplayPortInHdcpCapabilityFeedback = new IntFeedback("DisplayPortInHdcpCapability",
() => (int)tx.DisplayPortInput.HdcpCapabilityFeedback);
DisplayPortInHdcpCapabilityFeedback = new IntFeedback("DisplayPortHdcpCapability",
() => (int) tx.DisplayPortInput.HdcpCapabilityFeedback);
/* /*
HdcpStateFeedback = HdcpStateFeedback =
new IntFeedback( new IntFeedback(
@@ -145,18 +146,13 @@ namespace PepperDash.Essentials.DM
*/ */
//yeah this is gross - but it's the quickest way to do this... //yeah this is gross - but it's the quickest way to do this...
/*
HdcpStateFeedback = new IntFeedback(() => { HdcpStateFeedback = new IntFeedback(() => {
var states = new[] {(int) tx.DisplayPortInput.HdcpCapabilityFeedback, (int) tx.HdmiInputs[1].HdcpCapabilityFeedback, (int) tx.HdmiInputs[2].HdcpCapabilityFeedback}; var states = new[] {(int) tx.DisplayPortInput.HdcpCapabilityFeedback, (int) tx.HdmiInputs[1].HdcpCapabilityFeedback, (int) tx.HdmiInputs[2].HdcpCapabilityFeedback};
return states.Max(); return states.Max();
}); });
*/
HdcpSupportCapability = eHdcpCapabilityType.Hdcp2_2Support; HdcpSupportCapability = eHdcpCapabilityType.Hdcp2_2Support;
// I feel like we have had this as a misnomer for so long, that it really needed to be fixed
// All we were doing was reporting the best of the current statuses - not the actual capability of the device.
HdcpStateFeedback = new IntFeedback(() => (int)HdcpSupportCapability);
Hdmi1VideoSyncFeedback = new BoolFeedback(() => (bool)tx.HdmiInputs[1].SyncDetectedFeedback.BoolValue); Hdmi1VideoSyncFeedback = new BoolFeedback(() => (bool)tx.HdmiInputs[1].SyncDetectedFeedback.BoolValue);
@@ -170,19 +166,13 @@ namespace PepperDash.Essentials.DM
(ActualActiveVideoInput == eVst.Hdmi1 (ActualActiveVideoInput == eVst.Hdmi1
&& tx.HdmiInputs[1].VideoAttributes.HdcpActiveFeedback.BoolValue) && tx.HdmiInputs[1].VideoAttributes.HdcpActiveFeedback.BoolValue)
|| (ActualActiveVideoInput == eVst.Hdmi2 || (ActualActiveVideoInput == eVst.Hdmi2
&& tx.HdmiInputs[2].VideoAttributes.HdcpActiveFeedback.BoolValue) && tx.HdmiInputs[2].VideoAttributes.HdcpActiveFeedback.BoolValue),
|| (ActualActiveVideoInput == eVst.DisplayPort
&& tx.DisplayPortInput.VideoAttributes.HdcpActiveFeedback.BoolValue),
HdcpStateFeedbackFunc = () => HdcpStateFeedbackFunc = () =>
{ {
if (ActualActiveVideoInput == eVst.Hdmi1) if (ActualActiveVideoInput == eVst.Hdmi1)
return tx.HdmiInputs[1].VideoAttributes.HdcpStateFeedback.ToString(); return tx.HdmiInputs[1].VideoAttributes.HdcpStateFeedback.ToString();
if (ActualActiveVideoInput == eVst.Hdmi2) return ActualActiveVideoInput == eVst.Hdmi2 ? tx.HdmiInputs[2].VideoAttributes.HdcpStateFeedback.ToString() : "";
return tx.HdmiInputs[2].VideoAttributes.HdcpStateFeedback.ToString();
return ActualActiveVideoInput == eVst.DisplayPort
? tx.DisplayPortInput.VideoAttributes.HdcpStateFeedback.ToString()
: "";
}, },
VideoResolutionFeedbackFunc = () => VideoResolutionFeedbackFunc = () =>
@@ -191,8 +181,6 @@ namespace PepperDash.Essentials.DM
return tx.HdmiInputs[1].VideoAttributes.GetVideoResolutionString(); return tx.HdmiInputs[1].VideoAttributes.GetVideoResolutionString();
if (ActualActiveVideoInput == eVst.Hdmi2) if (ActualActiveVideoInput == eVst.Hdmi2)
return tx.HdmiInputs[2].VideoAttributes.GetVideoResolutionString(); return tx.HdmiInputs[2].VideoAttributes.GetVideoResolutionString();
if (ActualActiveVideoInput == eVst.DisplayPort)
return tx.DisplayPortInput.VideoAttributes.GetVideoResolutionString();
return ActualActiveVideoInput == eVst.Vga ? tx.DisplayPortInput.VideoAttributes.GetVideoResolutionString() : ""; return ActualActiveVideoInput == eVst.Vga ? tx.DisplayPortInput.VideoAttributes.GetVideoResolutionString() : "";
}, },
VideoSyncFeedbackFunc = () => VideoSyncFeedbackFunc = () =>
@@ -200,8 +188,6 @@ namespace PepperDash.Essentials.DM
&& tx.HdmiInputs[1].SyncDetectedFeedback.BoolValue) && tx.HdmiInputs[1].SyncDetectedFeedback.BoolValue)
|| (ActualActiveVideoInput == eVst.Hdmi2 || (ActualActiveVideoInput == eVst.Hdmi2
&& tx.HdmiInputs[2].SyncDetectedFeedback.BoolValue) && tx.HdmiInputs[2].SyncDetectedFeedback.BoolValue)
|| (ActualActiveVideoInput == eVst.DisplayPort
&& tx.DisplayPortInput.SyncDetectedFeedback.BoolValue)
|| (ActualActiveVideoInput == eVst.Vga || (ActualActiveVideoInput == eVst.Vga
&& tx.DisplayPortInput.SyncDetectedFeedback.BoolValue) && tx.DisplayPortInput.SyncDetectedFeedback.BoolValue)
@@ -220,15 +206,28 @@ namespace PepperDash.Essentials.DM
AnyVideoInput.VideoStatus.HasVideoStatusFeedback, AnyVideoInput.VideoStatus.HdcpActiveFeedback, AnyVideoInput.VideoStatus.HasVideoStatusFeedback, AnyVideoInput.VideoStatus.HdcpActiveFeedback,
AnyVideoInput.VideoStatus.HdcpStateFeedback, AnyVideoInput.VideoStatus.VideoResolutionFeedback, AnyVideoInput.VideoStatus.HdcpStateFeedback, AnyVideoInput.VideoStatus.VideoResolutionFeedback,
AnyVideoInput.VideoStatus.VideoSyncFeedback, HdmiIn1HdcpCapabilityFeedback, HdmiIn2HdcpCapabilityFeedback, AnyVideoInput.VideoStatus.VideoSyncFeedback, HdmiIn1HdcpCapabilityFeedback, HdmiIn2HdcpCapabilityFeedback,
Hdmi1VideoSyncFeedback, Hdmi2VideoSyncFeedback, DisplayPortVideoSyncFeedback, DisplayPortInHdcpCapabilityFeedback); Hdmi1VideoSyncFeedback, Hdmi2VideoSyncFeedback, DisplayPortVideoSyncFeedback);
// Set Ports for CEC
HdmiIn1.Port = Tx.HdmiInputs[1]; HdmiIn1.Port = Tx.HdmiInputs[1];
HdmiIn2.Port = Tx.HdmiInputs[2]; HdmiIn2.Port = Tx.HdmiInputs[2];
DisplayPortIn.Port = Tx.DisplayPortInput;
HdmiLoopOut.Port = Tx.HdmiOutput; HdmiLoopOut.Port = Tx.HdmiOutput;
DmOut.Port = Tx.DmOutput; DmOut.Port = Tx.DmOutput;
} }
void DisplayPortInputStreamChange(EndpointInputStream inputStream, EndpointInputStreamEventArgs args)
{
Debug.Console(2, "{0} event {1} stream {2}", Tx.ToString(), inputStream.ToString(), args.EventId.ToString());
switch (args.EventId)
{
case EndpointInputStreamEventIds.SyncDetectedFeedbackEventId:
DisplayPortVideoSyncFeedback.FireUpdate();
break;
}
}
public override bool CustomActivate() public override bool CustomActivate()
{ {
@@ -270,41 +269,41 @@ namespace PepperDash.Essentials.DM
{ {
Debug.Console(2, this, "Executing Numeric Switch to input {0}.", input); Debug.Console(2, this, "Executing Numeric Switch to input {0}.", input);
switch (input) switch (input)
{ {
case 0: case 0:
{ {
ExecuteSwitch(eVst.Auto, null, type); ExecuteSwitch(eVst.Auto, null, type);
break; break;
} }
case 1: case 1:
{ {
ExecuteSwitch(HdmiIn1.Selector, null, type); ExecuteSwitch(HdmiIn1.Selector, null, type);
break; break;
} }
case 2: case 2:
{ {
ExecuteSwitch(HdmiIn2.Selector, null, type); ExecuteSwitch(HdmiIn2.Selector, null, type);
break; break;
} }
case 3: case 3:
{ {
ExecuteSwitch(DisplayPortIn.Selector, null, type); ExecuteSwitch(DisplayPortIn.Selector, null, type);
break; break;
} }
case 4: case 4:
{ {
ExecuteSwitch(eVst.AllDisabled, null, type); ExecuteSwitch(eVst.AllDisabled, null, type);
break; break;
} }
default: default:
{ {
Debug.Console(2, this, "Unable to execute numeric switch to input {0}", input); Debug.Console(2, this, "Unable to execute numeric switch to input {0}", input);
break; break;
} }
} }
} }
@@ -340,17 +339,11 @@ namespace PepperDash.Essentials.DM
case EndpointInputStreamEventIds.HdcpCapabilityFeedbackEventId: case EndpointInputStreamEventIds.HdcpCapabilityFeedbackEventId:
if (inputStream == Tx.HdmiInputs[1]) HdmiIn1HdcpCapabilityFeedback.FireUpdate(); if (inputStream == Tx.HdmiInputs[1]) HdmiIn1HdcpCapabilityFeedback.FireUpdate();
if (inputStream == Tx.HdmiInputs[2]) HdmiIn2HdcpCapabilityFeedback.FireUpdate(); if (inputStream == Tx.HdmiInputs[2]) HdmiIn2HdcpCapabilityFeedback.FireUpdate();
if (inputStream == Tx.DisplayPortInput) DisplayPortInHdcpCapabilityFeedback.FireUpdate();
Debug.Console(2, this, "DisplayPortHDCP Mode Trigger = {0}",
DisplayPortInHdcpCapabilityFeedback.IntValue);
HdcpStateFeedback.FireUpdate(); HdcpStateFeedback.FireUpdate();
break; break;
case EndpointInputStreamEventIds.SyncDetectedFeedbackEventId: case EndpointInputStreamEventIds.SyncDetectedFeedbackEventId:
if (inputStream == Tx.HdmiInputs[1]) Hdmi1VideoSyncFeedback.FireUpdate(); if (inputStream == Tx.HdmiInputs[1]) Hdmi1VideoSyncFeedback.FireUpdate();
if (inputStream == Tx.HdmiInputs[2]) Hdmi2VideoSyncFeedback.FireUpdate(); if (inputStream == Tx.HdmiInputs[2]) Hdmi2VideoSyncFeedback.FireUpdate();
if (inputStream == Tx.DisplayPortInput) DisplayPortVideoSyncFeedback.FireUpdate();
break; break;
} }
} }
@@ -431,7 +424,7 @@ namespace PepperDash.Essentials.DM
AnyVideoInput.VideoStatus.VideoResolutionFeedback.FireUpdate(); AnyVideoInput.VideoStatus.VideoResolutionFeedback.FireUpdate();
break; break;
} }
} }
#region IIROutputPorts Members #region IIROutputPorts Members
public CrestronCollection<IROutputPort> IROutputPorts { get { return Tx.IROutputPorts; } } public CrestronCollection<IROutputPort> IROutputPorts { get { return Tx.IROutputPorts; } }

View File

@@ -1,6 +1,8 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro; using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.DeviceSupport; using Crestron.SimplSharpPro.DeviceSupport;
using Crestron.SimplSharpPro.DM; using Crestron.SimplSharpPro.DM;
@@ -16,8 +18,8 @@ using PepperDash.Essentials.Core.Config;
namespace PepperDash.Essentials.DM namespace PepperDash.Essentials.DM
{ {
public class DmTxHelper public class DmTxHelper
{ {
public static BasicDmTxControllerBase GetDmTxForChassisWithoutIpId(string key, string name, string typeName, DMInput dmInput) public static BasicDmTxControllerBase GetDmTxForChassisWithoutIpId(string key, string name, string typeName, DMInput dmInput)
{ {
@@ -42,7 +44,7 @@ namespace PepperDash.Essentials.DM
if (typeName.StartsWith("dmtx401")) if (typeName.StartsWith("dmtx401"))
return new DmTx401CController(key, name, new DmTx401C(dmInput), true); return new DmTx401CController(key, name, new DmTx401C(dmInput), true);
if (typeName.StartsWith("hdbasettx")) if (typeName.StartsWith("hdbasettx"))
return new HDBaseTTxController(key, name, new HDTx3CB(dmInput)); new HDBaseTTxController(key, name, new HDTx3CB(dmInput));
return null; return null;
} }
@@ -75,32 +77,31 @@ namespace PepperDash.Essentials.DM
return null; return null;
} }
/// <summary> /// <summary>
/// A factory method for various DmTxControllers /// A factory method for various DmTxControllers
/// </summary> /// </summary>
/// <param name="key"></param> /// <param name="key"></param>
/// <param name="name"></param> /// <param name="name"></param>
/// <param name="props"></param> /// <param name="props"></param>
/// <param name="typeName"></param> /// <returns></returns>
/// <returns></returns>
public static BasicDmTxControllerBase GetDmTxController(string key, string name, string typeName, DmTxPropertiesConfig props) public static BasicDmTxControllerBase GetDmTxController(string key, string name, string typeName, DmTxPropertiesConfig props)
{ {
// switch on type name... later... // switch on type name... later...
typeName = typeName.ToLower(); typeName = typeName.ToLower();
//uint ipid = Convert.ToUInt16(props.Id, 16); //uint ipid = Convert.ToUInt16(props.Id, 16);
var ipid = props.Control.IpIdInt; var ipid = props.Control.IpIdInt;
var pKey = props.ParentDeviceKey.ToLower(); var pKey = props.ParentDeviceKey.ToLower();
if (pKey == "processor") if (pKey == "processor")
{ {
// Catch constructor failures, mainly dues to IPID // Catch constructor failures, mainly dues to IPID
try try
{ {
if (typeName.StartsWith("dmtx200")) if(typeName.StartsWith("dmtx200"))
return new DmTx200Controller(key, name, new DmTx200C2G(ipid, Global.ControlSystem), false); return new DmTx200Controller(key, name, new DmTx200C2G(ipid, Global.ControlSystem), false);
if (typeName.StartsWith("dmtx201c")) if (typeName.StartsWith("dmtx201c"))
return new DmTx201CController(key, name, new DmTx201C(ipid, Global.ControlSystem), false); return new DmTx201CController(key, name, new DmTx201C(ipid, Global.ControlSystem), false);
if (typeName.StartsWith("dmtx201s")) if (typeName.StartsWith("dmtx201s"))
return new DmTx201SController(key, name, new DmTx201S(ipid, Global.ControlSystem), false); return new DmTx201SController(key, name, new DmTx201S(ipid, Global.ControlSystem), false);
if (typeName.StartsWith("dmtx4k202")) if (typeName.StartsWith("dmtx4k202"))
@@ -111,36 +112,36 @@ namespace PepperDash.Essentials.DM
return new DmTx4k302CController(key, name, new DmTx4k302C(ipid, Global.ControlSystem), false); return new DmTx4k302CController(key, name, new DmTx4k302C(ipid, Global.ControlSystem), false);
if (typeName.StartsWith("dmtx4kz302")) if (typeName.StartsWith("dmtx4kz302"))
return new DmTx4kz302CController(key, name, new DmTx4kz302C(ipid, Global.ControlSystem), false); return new DmTx4kz302CController(key, name, new DmTx4kz302C(ipid, Global.ControlSystem), false);
if (typeName.StartsWith("dmtx401")) if (typeName.StartsWith("dmtx401"))
return new DmTx401CController(key, name, new DmTx401C(ipid, Global.ControlSystem), false); return new DmTx401CController(key, name, new DmTx401C(ipid, Global.ControlSystem), false);
Debug.Console(0, "{1} WARNING: Cannot create DM-TX of type: '{0}'", typeName, key); Debug.Console(0, "{1} WARNING: Cannot create DM-TX of type: '{0}'", typeName, key);
} }
catch (Exception e) catch (Exception e)
{ {
Debug.Console(0, "[{0}] WARNING: Cannot create DM-TX device: {1}", key, e); Debug.Console(0, "[{0}] WARNING: Cannot create DM-TX device: {1}", key, e);
} }
return null; return null;
} }
var parentDev = DeviceManager.GetDeviceForKey(pKey); var parentDev = DeviceManager.GetDeviceForKey(pKey);
DMInput dmInput; DMInput dmInput;
BasicDmTxControllerBase tx; BasicDmTxControllerBase tx;
bool useChassisForOfflineFeedback = false; bool useChassisForOfflineFeedback = false;
if (parentDev is IDmSwitchWithEndpointOnlineFeedback) if (parentDev is DmChassisController)
{ {
// Get the Crestron chassis and link stuff up // Get the Crestron chassis and link stuff up
var switchDev = (parentDev as IDmSwitchWithEndpointOnlineFeedback); var switchDev = (parentDev as DmChassisController);
var chassis = switchDev.Chassis; var chassis = switchDev.Chassis;
//Check that the input is within range of this chassis' possible inputs //Check that the input is within range of this chassis' possible inputs
var num = props.ParentInputNumber; var num = props.ParentInputNumber;
if (num <= 0 || num > chassis.NumberOfInputs) if (num <= 0 || num > chassis.NumberOfInputs)
{ {
Debug.Console(0, "Cannot create DM device '{0}'. Input number '{1}' is out of range", Debug.Console(0, "Cannot create DM device '{0}'. Input number '{1}' is out of range",
key, num); key, num);
return null; return null;
} }
switchDev.TxDictionary.Add(num, key); switchDev.TxDictionary.Add(num, key);
dmInput = chassis.Inputs[num]; dmInput = chassis.Inputs[num];
@@ -163,7 +164,7 @@ namespace PepperDash.Essentials.DM
if (typeName == "hdbasettx" || typeName == "dmtx4k100c1g") if (typeName == "hdbasettx" || typeName == "dmtx4k100c1g")
{ {
useChassisForOfflineFeedback = true; useChassisForOfflineFeedback = true;
} }
} }
if (useChassisForOfflineFeedback) if (useChassisForOfflineFeedback)
{ {
@@ -179,8 +180,7 @@ namespace PepperDash.Essentials.DM
return null; return null;
} }
} }
else if(parentDev is DmpsRoutingController)
if (parentDev is DmpsRoutingController)
{ {
// Get the DMPS chassis and link stuff up // Get the DMPS chassis and link stuff up
var dmpsDev = (parentDev as DmpsRoutingController); var dmpsDev = (parentDev as DmpsRoutingController);
@@ -209,7 +209,7 @@ namespace PepperDash.Essentials.DM
try try
{ {
if (Global.ControlSystemIsDmps4kType) if(Global.ControlSystemIsDmps4kType)
{ {
tx = GetDmTxForChassisWithoutIpId(key, name, typeName, dmInput); tx = GetDmTxForChassisWithoutIpId(key, name, typeName, dmInput);
useChassisForOfflineFeedback = true; useChassisForOfflineFeedback = true;
@@ -220,7 +220,7 @@ namespace PepperDash.Essentials.DM
if (typeName == "hdbasettx" || typeName == "dmtx4k100c1g") if (typeName == "hdbasettx" || typeName == "dmtx4k100c1g")
{ {
useChassisForOfflineFeedback = true; useChassisForOfflineFeedback = true;
} }
} }
if (useChassisForOfflineFeedback) if (useChassisForOfflineFeedback)
{ {
@@ -234,13 +234,16 @@ namespace PepperDash.Essentials.DM
{ {
Debug.Console(0, "[{0}] WARNING: Cannot create DM-TX device for dmps: {1}", key, e); Debug.Console(0, "[{0}] WARNING: Cannot create DM-TX device for dmps: {1}", key, e);
return null; return null;
} }
} }
Debug.Console(0, "Cannot create DM device '{0}'. '{1}' is not a processor, DM Chassis or DMPS.", key, pKey); else
return null; {
} Debug.Console(0, "Cannot create DM device '{0}'. '{1}' is not a processor, DM Chassis or DMPS.", key, pKey);
} return null;
}
}
}
public abstract class BasicDmTxControllerBase : CrestronGenericBridgeableBaseDevice public abstract class BasicDmTxControllerBase : CrestronGenericBridgeableBaseDevice
{ {
@@ -251,21 +254,21 @@ namespace PepperDash.Essentials.DM
} }
} }
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
[Description("Wrapper class for all DM-TX variants")] [Description("Wrapper class for all DM-TX variants")]
public abstract class DmTxControllerBase : BasicDmTxControllerBase public abstract class DmTxControllerBase : BasicDmTxControllerBase
{ {
public virtual void SetPortHdcpCapability(eHdcpCapabilityType hdcpMode, uint port) { } public virtual void SetPortHdcpCapability(eHdcpCapabilityType hdcpMode, uint port) { }
public virtual eHdcpCapabilityType HdcpSupportCapability { get; protected set; } public virtual eHdcpCapabilityType HdcpSupportCapability { get; protected set; }
public abstract StringFeedback ActiveVideoInputFeedback { get; protected set; } public abstract StringFeedback ActiveVideoInputFeedback { get; protected set; }
public RoutingInputPortWithVideoStatuses AnyVideoInput { get; protected set; } public RoutingInputPortWithVideoStatuses AnyVideoInput { get; protected set; }
public IntFeedback HdcpStateFeedback { get; protected set; } public IntFeedback HdcpStateFeedback { get; protected set; }
protected DmTxControllerBase(string key, string name, EndpointTransmitterBase hardware) protected DmTxControllerBase(string key, string name, EndpointTransmitterBase hardware)
: base(key, name, hardware) : base(key, name, hardware)
{ {
AddToFeedbackList(ActiveVideoInputFeedback); AddToFeedbackList(ActiveVideoInputFeedback);
IsOnline.OutputChange += (currentDevice, args) => IsOnline.OutputChange += (currentDevice, args) =>
@@ -276,12 +279,11 @@ namespace PepperDash.Essentials.DM
feedback.FireUpdate(); feedback.FireUpdate();
} }
}; };
} }
protected DmTxControllerBase(string key, string name, DmHDBasedTEndPoint hardware) protected DmTxControllerBase(string key, string name, DmHDBasedTEndPoint hardware) : base(key, name, hardware)
: base(key, name, hardware) {
{ }
}
protected DmTxControllerJoinMap GetDmTxJoinMap(uint joinStart, string joinMapKey) protected DmTxControllerJoinMap GetDmTxJoinMap(uint joinStart, string joinMapKey)
{ {
@@ -295,8 +297,8 @@ namespace PepperDash.Essentials.DM
return joinMap; return joinMap;
} }
protected void LinkDmTxToApi(DmTxControllerBase tx, BasicTriList trilist, DmTxControllerJoinMap joinMap, EiscApiAdvanced bridge) protected void LinkDmTxToApi(DmTxControllerBase tx, BasicTriList trilist, DmTxControllerJoinMap joinMap, EiscApiAdvanced bridge)
{ {
if (bridge != null) if (bridge != null)
{ {
bridge.AddJoinMap(Key, joinMap); bridge.AddJoinMap(Key, joinMap);
@@ -306,7 +308,7 @@ namespace PepperDash.Essentials.DM
Debug.Console(0, this, "Please update config to use 'eiscapiadvanced' to get all join map features for this device."); Debug.Console(0, this, "Please update config to use 'eiscapiadvanced' to get all join map features for this device.");
} }
Debug.Console(1, tx, "Linking to Trilist '{0}'", trilist.ID.ToString("X")); Debug.Console(1, tx, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
tx.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline.JoinNumber]); tx.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline.JoinNumber]);
tx.AnyVideoInput.VideoStatus.VideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.VideoSyncStatus.JoinNumber]); tx.AnyVideoInput.VideoStatus.VideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.VideoSyncStatus.JoinNumber]);
@@ -333,6 +335,8 @@ namespace PepperDash.Essentials.DM
txR.VideoSourceNumericFeedback.LinkInputSig(trilist.UShortInput[joinMap.VideoInput.JoinNumber]); txR.VideoSourceNumericFeedback.LinkInputSig(trilist.UShortInput[joinMap.VideoInput.JoinNumber]);
txR.AudioSourceNumericFeedback.LinkInputSig(trilist.UShortInput[joinMap.AudioInput.JoinNumber]); txR.AudioSourceNumericFeedback.LinkInputSig(trilist.UShortInput[joinMap.AudioInput.JoinNumber]);
trilist.UShortInput[joinMap.HdcpSupportCapability.JoinNumber].UShortValue = (ushort)tx.HdcpSupportCapability;
if (txR.InputPorts[DmPortName.HdmiIn] != null) if (txR.InputPorts[DmPortName.HdmiIn] != null)
{ {
var inputPort = txR.InputPorts[DmPortName.HdmiIn]; var inputPort = txR.InputPorts[DmPortName.HdmiIn];
@@ -379,7 +383,7 @@ namespace PepperDash.Essentials.DM
{ {
var intFeedback = tx.Feedbacks["HdmiIn2HdcpCapability"] as IntFeedback; var intFeedback = tx.Feedbacks["HdmiIn2HdcpCapability"] as IntFeedback;
if (intFeedback != null) if (intFeedback != null)
intFeedback.LinkInputSig(trilist.UShortInput[joinMap.Port2HdcpState.JoinNumber]); intFeedback.LinkInputSig(trilist.UShortInput[joinMap.Port1HdcpState.JoinNumber]);
} }
if (inputPort.ConnectionType == eRoutingPortConnectionType.Hdmi && inputPort.Port != null) if (inputPort.ConnectionType == eRoutingPortConnectionType.Hdmi && inputPort.Port != null)
@@ -396,34 +400,20 @@ namespace PepperDash.Essentials.DM
if (tx.Feedbacks["DisplayPortInHdcpCapability"] != null) if (tx.Feedbacks["DisplayPortInHdcpCapability"] != null)
{ {
var intFeedback = tx.Feedbacks["DisplayPortInHdcpCapability"] as IntFeedback; var intFeedback = tx.Feedbacks["DisplayPortInHdcpCapability"] as IntFeedback;
if (intFeedback != null) if (intFeedback != null)
intFeedback.LinkInputSig(trilist.UShortInput[joinMap.Port3HdcpState.JoinNumber]); intFeedback.LinkInputSig(trilist.UShortInput[joinMap.Port3HdcpState.JoinNumber]);
if (inputPort.ConnectionType == eRoutingPortConnectionType.DisplayPort && inputPort.Port != null)
{
var port = inputPort.Port as EndpointDisplayPortInput;
SetHdcpCapabilityAction(port, joinMap.Port3HdcpState.JoinNumber, trilist);
}
} }
if (inputPort.ConnectionType == eRoutingPortConnectionType.Hdmi && inputPort.Port != null)
{
var port = inputPort.Port as EndpointDisplayPortInput;
SetHdcpCapabilityAction(hdcpTypeSimple, port, joinMap.Port3HdcpState.JoinNumber, trilist);
}
} }
var hdcpInputPortCount =
(ushort)
txR.InputPorts.Where(
x => (x.Type == eRoutingSignalType.Video) || (x.Type == eRoutingSignalType.AudioVideo))
.Where(
x =>
(x.ConnectionType == eRoutingPortConnectionType.DmCat) ||
(x.ConnectionType == eRoutingPortConnectionType.Hdmi) ||
(x.ConnectionType == eRoutingPortConnectionType.DisplayPort))
.ToList().Count();
trilist.SetUshort(joinMap.HdcpInputPortCount.JoinNumber, hdcpInputPortCount);
} }
var txFreeRun = tx as IHasFreeRun; var txFreeRun = tx as IHasFreeRun;
@@ -463,7 +453,7 @@ namespace PepperDash.Essentials.DM
}); });
} }
else else
{ {
trilist.SetUShortSigAction(join, trilist.SetUShortSigAction(join,
s => s =>
{ {
@@ -472,39 +462,27 @@ namespace PepperDash.Essentials.DM
} }
} }
private void SetHdcpCapabilityAction(EndpointDisplayPortInput port, uint join, private void SetHdcpCapabilityAction(bool hdcpTypeSimple, EndpointDisplayPortInput port, uint join,
BasicTriList trilist) BasicTriList trilist)
{ {
trilist.SetUShortSigAction(join,
s =>
{
Debug.Console(0, this, "Trying to set HDCP to {0} on port {1}", s, port.ToString());
port.HdcpCapability = (eHdcpCapabilityType) s;
});
}
}
trilist.SetUShortSigAction(join,
s =>
{
port.HdcpCapability = (eHdcpCapabilityType) s;
});
}
}
public class DmTxControllerFactory : EssentialsDeviceFactory<DmTxControllerBase> public class DmTxControllerFactory : EssentialsDeviceFactory<DmTxControllerBase>
{ {
public DmTxControllerFactory() public DmTxControllerFactory()
{ {
TypeNames = new List<string> TypeNames = new List<string>() { "dmtx200c", "dmtx201c", "dmtx201s", "dmtx4k100c", "dmtx4k202c", "dmtx4kz202c", "dmtx4k302c", "dmtx4kz302c",
{ "dmtx401c", "dmtx401s", "dmtx4k100c1g", "dmtx4kz100c1g", "hdbasettx" };
"dmtx200c",
"dmtx201c",
"dmtx201s",
"dmtx4k100c",
"dmtx4k202c",
"dmtx4kz202c",
"dmtx4k302c",
"dmtx4kz302c",
"dmtx401c",
"dmtx401s",
"dmtx4k100c1g",
"dmtx4kz100c1g",
"hdbasettx"
};
} }
public override EssentialsDevice BuildDevice(DeviceConfig dc) public override EssentialsDevice BuildDevice(DeviceConfig dc)
@@ -514,8 +492,8 @@ namespace PepperDash.Essentials.DM
Debug.Console(1, "Factory Attempting to create new DM-TX Device"); Debug.Console(1, "Factory Attempting to create new DM-TX Device");
var props = JsonConvert.DeserializeObject var props = JsonConvert.DeserializeObject
<DmTxPropertiesConfig>(dc.Properties.ToString()); <PepperDash.Essentials.DM.Config.DmTxPropertiesConfig>(dc.Properties.ToString());
return DmTxHelper.GetDmTxController(dc.Key, dc.Name, type, props); return PepperDash.Essentials.DM.DmTxHelper.GetDmTxController(dc.Key, dc.Name, type, props);
} }
} }

View File

@@ -16,17 +16,10 @@ using PepperDash.Essentials.Core;
using PepperDash.Essentials.DM.Config; using PepperDash.Essentials.DM.Config;
namespace PepperDash.Essentials.DM { namespace PepperDash.Essentials.DM {
public interface IDmSwitch public interface IDmSwitch {
{
Switch Chassis { get; } Switch Chassis { get; }
Dictionary<uint, string> TxDictionary { get; } Dictionary<uint, string> TxDictionary { get; }
Dictionary<uint, string> RxDictionary { get; } Dictionary<uint, string> RxDictionary { get; }
} }
public interface IDmSwitchWithEndpointOnlineFeedback : IDmSwitch
{
Dictionary<uint, BoolFeedback> InputEndpointOnlineFeedbacks { get; }
Dictionary<uint, BoolFeedback> OutputEndpointOnlineFeedbacks { get; }
}
} }

View File

@@ -105,7 +105,6 @@
<Compile Include="Chassis\HdMdNxM4kEBridgeableController.cs" /> <Compile Include="Chassis\HdMdNxM4kEBridgeableController.cs" />
<Compile Include="Chassis\HdMdNxM4kEController.cs" /> <Compile Include="Chassis\HdMdNxM4kEController.cs" />
<Compile Include="Config\InputPropertiesConfig.cs" /> <Compile Include="Config\InputPropertiesConfig.cs" />
<Compile Include="Endpoints\EndpointInterfaces.cs" />
<Compile Include="Endpoints\DGEs\DgeJoinMap.cs" /> <Compile Include="Endpoints\DGEs\DgeJoinMap.cs" />
<Compile Include="Endpoints\DGEs\DmDge200CController.cs" /> <Compile Include="Endpoints\DGEs\DmDge200CController.cs" />
<Compile Include="Endpoints\Receivers\DmRmc4kZ100CController.cs" /> <Compile Include="Endpoints\Receivers\DmRmc4kZ100CController.cs" />

View File

@@ -40,6 +40,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
private CTimer _brandingTimer; private CTimer _brandingTimer;
private CTimer _registrationCheckTimer;
public CommunicationGather PortGather { get; private set; } public CommunicationGather PortGather { get; private set; }
public StatusMonitorBase CommunicationMonitor { get; private set; } public StatusMonitorBase CommunicationMonitor { get; private set; }
@@ -262,6 +264,10 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
private StringBuilder _jsonMessage; private StringBuilder _jsonMessage;
private StringBuilder _feedbackListMessage;
private bool _feedbackListMessageIncoming;
private bool _jsonFeedbackMessageIsIncoming; private bool _jsonFeedbackMessageIsIncoming;
public bool CommDebuggingIsOn; public bool CommDebuggingIsOn;
@@ -702,6 +708,8 @@ ConnectorID: {2}"
// Fire the ready event // Fire the ready event
SetIsReady(); SetIsReady();
_registrationCheckTimer = new CTimer(EnqueueCommand, "xFeedback list", 90000, 90000);
} }
public void SetCommDebug(string s) public void SetCommDebug(string s)
@@ -778,6 +786,29 @@ ConnectorID: {2}"
return; return;
} }
if (!args.Text.StartsWith("/") && _feedbackListMessage != null)
{
_feedbackListMessageIncoming = false;
var feedbackListString = _feedbackListMessage.ToString();
_feedbackListMessage = null;
ProcessFeedbackList(feedbackListString);
}
if (args.Text.StartsWith("/"))
{
_feedbackListMessageIncoming = true;
if(_feedbackListMessage == null) _feedbackListMessage = new StringBuilder();
}
if (_feedbackListMessageIncoming && _feedbackListMessage != null)
{
_feedbackListMessage.Append(args.Text);
return;
}
if (args.Text == "{" + Delimiter) // Check for the beginning of a new JSON message if (args.Text == "{" + Delimiter) // Check for the beginning of a new JSON message
{ {
_jsonFeedbackMessageIsIncoming = true; _jsonFeedbackMessageIsIncoming = true;
@@ -846,6 +877,19 @@ ConnectorID: {2}"
} }
} }
private void ProcessFeedbackList(string data)
{
Debug.Console(1, this, "Feedback List : ");
Debug.Console(1, this, data);
if (data.Split('\n').Count() == _cliFeedbackRegistrationExpression.Split('\n').Count()) return;
Debug.Console(0, this, "Codec Feedback Registrations Lost - Registering Feedbacks");
ErrorLog.Error(String.Format("[{0}] :: Codec Feedback Registrations Lost - Registering Feedbacks", Key));
//var updateRegistrationString = "xFeedback deregisterall" + Delimiter + _cliFeedbackRegistrationExpression;
EnqueueCommand(_cliFeedbackRegistrationExpression);
}
/// <summary> /// <summary>
/// Enqueues a command to be sent to the codec. /// Enqueues a command to be sent to the codec.
/// </summary> /// </summary>
@@ -854,6 +898,12 @@ ConnectorID: {2}"
{ {
_syncState.AddCommandToQueue(command); _syncState.AddCommandToQueue(command);
} }
private void EnqueueCommand(object cmd)
{
var command = cmd as string;
if (String.IsNullOrEmpty(command)) return;
_syncState.AddCommandToQueue(command);
}
/// <summary> /// <summary>
/// Appends the delimiter and send the command to the codec. /// Appends the delimiter and send the command to the codec.
@@ -869,6 +919,16 @@ ConnectorID: {2}"
Communication.SendText(command + Delimiter); Communication.SendText(command + Delimiter);
} }
public void SendText(object cmd)
{
var command = cmd as string;
if (String.IsNullOrEmpty(command)) return;
if (CommDebuggingIsOn)
Debug.Console(1, this, "Sending: '{0}'", ComTextHelper.GetDebugText(command + Delimiter));
Communication.SendText(command + Delimiter);
}
void DeserializeResponse(string response) void DeserializeResponse(string response)
{ {
try try

View File

@@ -1,3 +1,3 @@
<packages> <packages>
<package id="PepperDashCore" version="1.2.1" targetFramework="net35" allowedVersions="[1.0,2.0)"/> <package id="PepperDashCore" version="1.2.0" targetFramework="net35" allowedVersions="[1.0,2.0)"/>
</packages> </packages>