mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-04-15 13:36:48 +00:00
Merge remote-tracking branch 'origin/development' into feature/implement-IStreamDebugging-on-ComPortController
This commit is contained in:
commit
c475155546
84 changed files with 4039 additions and 2229 deletions
6
.github/workflows/docker.yml
vendored
6
.github/workflows/docker.yml
vendored
|
|
@ -52,6 +52,12 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
Write-Output ${{ env.VERSION }}
|
Write-Output ${{ env.VERSION }}
|
||||||
./.github/scripts/UpdateAssemblyVersion.ps1 ${{ env.VERSION }}
|
./.github/scripts/UpdateAssemblyVersion.ps1 ${{ env.VERSION }}
|
||||||
|
# Login to Docker
|
||||||
|
- name: Login to Docker
|
||||||
|
uses: azure/docker-login@v1
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKER_TOKEN }}
|
||||||
# Build the solutions in the docker image
|
# Build the solutions in the docker image
|
||||||
- name: Build Solution
|
- name: Build Solution
|
||||||
shell: powershell
|
shell: powershell
|
||||||
|
|
|
||||||
6
.github/workflows/master.yml
vendored
6
.github/workflows/master.yml
vendored
|
|
@ -44,6 +44,12 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
Write-Output ${{ env.VERSION }}
|
Write-Output ${{ env.VERSION }}
|
||||||
./.github/scripts/UpdateAssemblyVersion.ps1 ${{ env.VERSION }}
|
./.github/scripts/UpdateAssemblyVersion.ps1 ${{ env.VERSION }}
|
||||||
|
# Login to Docker
|
||||||
|
- name: Login to Docker
|
||||||
|
uses: azure/docker-login@v1
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKER_TOKEN }}
|
||||||
# Build the solutions in the docker image
|
# Build the solutions in the docker image
|
||||||
- name: Build Solution
|
- name: Build Solution
|
||||||
shell: powershell
|
shell: powershell
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ using System.Collections.Generic;
|
||||||
using Crestron.SimplSharpPro;
|
using Crestron.SimplSharpPro;
|
||||||
using Crestron.SimplSharpPro.EthernetCommunication;
|
using Crestron.SimplSharpPro.EthernetCommunication;
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Bridges;
|
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
using PepperDash.Essentials.Core.Bridges;
|
using PepperDash.Essentials.Core.Bridges;
|
||||||
using PepperDash.Essentials.Core.Config;
|
using PepperDash.Essentials.Core.Config;
|
||||||
|
|
@ -15,15 +14,11 @@ namespace PepperDash.Essentials.Bridges
|
||||||
{
|
{
|
||||||
public EiscApiPropertiesConfig PropertiesConfig { get; private set; }
|
public EiscApiPropertiesConfig PropertiesConfig { get; private set; }
|
||||||
|
|
||||||
protected Dictionary<string, JoinMapBaseAdvanced> JoinMaps { get; private set; }
|
|
||||||
|
|
||||||
public ThreeSeriesTcpIpEthernetIntersystemCommunications Eisc { get; private set; }
|
public ThreeSeriesTcpIpEthernetIntersystemCommunications Eisc { get; private set; }
|
||||||
|
|
||||||
public EiscApi(DeviceConfig dc) :
|
public EiscApi(DeviceConfig dc) :
|
||||||
base(dc.Key)
|
base(dc.Key)
|
||||||
{
|
{
|
||||||
JoinMaps = new Dictionary<string, JoinMapBaseAdvanced>();
|
|
||||||
|
|
||||||
PropertiesConfig = dc.Properties.ToObject<EiscApiPropertiesConfig>();
|
PropertiesConfig = dc.Properties.ToObject<EiscApiPropertiesConfig>();
|
||||||
//PropertiesConfig = JsonConvert.DeserializeObject<EiscApiPropertiesConfig>(dc.Properties.ToString());
|
//PropertiesConfig = JsonConvert.DeserializeObject<EiscApiPropertiesConfig>(dc.Properties.ToString());
|
||||||
|
|
||||||
|
|
@ -70,59 +65,9 @@ namespace PepperDash.Essentials.Bridges
|
||||||
}
|
}
|
||||||
Debug.Console(1, this, "Devices Linked.");
|
Debug.Console(1, this, "Devices Linked.");
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Adds a join map
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="deviceKey"></param>
|
|
||||||
/// <param name="joinMap"></param>
|
|
||||||
public void AddJoinMap(string deviceKey, JoinMapBaseAdvanced joinMap)
|
|
||||||
{
|
|
||||||
if (!JoinMaps.ContainsKey(deviceKey))
|
|
||||||
{
|
|
||||||
JoinMaps.Add(deviceKey, joinMap);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Debug.Console(2, this, "Unable to add join map with key '{0}'. Key already exists in JoinMaps dictionary", deviceKey);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Prints all the join maps on this bridge
|
|
||||||
/// </summary>
|
|
||||||
public void PrintJoinMaps()
|
|
||||||
{
|
|
||||||
Debug.Console(0, this, "Join Maps for EISC IPID: {0}", Eisc.ID.ToString("X"));
|
|
||||||
|
|
||||||
foreach (var joinMap in JoinMaps)
|
|
||||||
{
|
|
||||||
Debug.Console(0, "Join map for device '{0}':", joinMap.Key);
|
|
||||||
joinMap.Value.PrintJoinMapInfo();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Prints the join map for a device by key
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="deviceKey"></param>
|
|
||||||
public void PrintJoinMapForDevice(string deviceKey)
|
|
||||||
{
|
|
||||||
var joinMap = JoinMaps[deviceKey];
|
|
||||||
|
|
||||||
if (joinMap == null)
|
|
||||||
{
|
|
||||||
Debug.Console(0, this, "Unable to find joinMap for device with key: '{0}'", deviceKey);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Debug.Console(0, "Join map for device '{0}' on EISC '{1}':", deviceKey, Key);
|
|
||||||
joinMap.PrintJoinMapInfo();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Used for debugging to trigger an action based on a join number and type
|
/// Used for debugging to trigger an action based on a join number and type
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -194,7 +139,7 @@ namespace PepperDash.Essentials.Bridges
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (Debug.Level >= 1)
|
if (Debug.Level >= 1)
|
||||||
Debug.Console(1, this, "EiscApiAdvanced change: {0} {1}={2}", args.Sig.Type, args.Sig.Number, args.Sig.StringValue);
|
Debug.Console(1, this, "EiscApi change: {0} {1}={2}", args.Sig.Type, args.Sig.Number, args.Sig.StringValue);
|
||||||
var uo = args.Sig.UserObject;
|
var uo = args.Sig.UserObject;
|
||||||
|
|
||||||
if (uo == null) return;
|
if (uo == null) return;
|
||||||
|
|
|
||||||
|
|
@ -555,7 +555,7 @@ namespace PepperDash.Essentials
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
bool DoRoute(SourceRouteListItem route, SourceListItem sourceItem, string sourceItemKey)
|
bool DoRoute(SourceRouteListItem route, SourceListItem sourceItem, string sourceItemKey)
|
||||||
{
|
{
|
||||||
IRoutingSinkNoSwitching dest = null;
|
IRoutingSink dest = null;
|
||||||
|
|
||||||
if (route.DestinationKey.Equals("$defaultaudio", StringComparison.OrdinalIgnoreCase))
|
if (route.DestinationKey.Equals("$defaultaudio", StringComparison.OrdinalIgnoreCase))
|
||||||
dest = DefaultAudioDevice as IRoutingSinkNoSwitching;
|
dest = DefaultAudioDevice as IRoutingSinkNoSwitching;
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,7 @@ namespace PepperDash.Essentials
|
||||||
public EssentialsHuddleRoomPropertiesConfig PropertiesConfig { get; private set; }
|
public EssentialsHuddleRoomPropertiesConfig PropertiesConfig { get; private set; }
|
||||||
|
|
||||||
public IRoutingSinkWithSwitching DefaultDisplay { get; private set; }
|
public IRoutingSinkWithSwitching DefaultDisplay { get; private set; }
|
||||||
public IRoutingSinkNoSwitching DefaultAudioDevice { get; private set; }
|
public IRoutingSink DefaultAudioDevice { get; private set; }
|
||||||
public IBasicVolumeControls DefaultVolumeControls { get; private set; }
|
public IBasicVolumeControls DefaultVolumeControls { get; private set; }
|
||||||
|
|
||||||
public bool ExcludeFromGlobalFunctions { get; set; }
|
public bool ExcludeFromGlobalFunctions { get; set; }
|
||||||
|
|
@ -471,14 +471,14 @@ namespace PepperDash.Essentials
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
bool DoRoute(SourceRouteListItem route)
|
bool DoRoute(SourceRouteListItem route)
|
||||||
{
|
{
|
||||||
IRoutingSinkNoSwitching dest = null;
|
IRoutingSink dest = null;
|
||||||
|
|
||||||
if (route.DestinationKey.Equals("$defaultaudio", StringComparison.OrdinalIgnoreCase))
|
if (route.DestinationKey.Equals("$defaultaudio", StringComparison.OrdinalIgnoreCase))
|
||||||
dest = DefaultAudioDevice;
|
dest = DefaultAudioDevice;
|
||||||
else if (route.DestinationKey.Equals("$defaultDisplay", StringComparison.OrdinalIgnoreCase))
|
else if (route.DestinationKey.Equals("$defaultDisplay", StringComparison.OrdinalIgnoreCase))
|
||||||
dest = DefaultDisplay;
|
dest = DefaultDisplay;
|
||||||
else
|
else
|
||||||
dest = DeviceManager.GetDeviceForKey(route.DestinationKey) as IRoutingSinkNoSwitching;
|
dest = DeviceManager.GetDeviceForKey(route.DestinationKey) as IRoutingSink;
|
||||||
|
|
||||||
if (dest == null)
|
if (dest == null)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -590,7 +590,7 @@ namespace PepperDash.Essentials
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
bool DoRoute(SourceRouteListItem route)
|
bool DoRoute(SourceRouteListItem route)
|
||||||
{
|
{
|
||||||
IRoutingSinkNoSwitching dest = null;
|
IRoutingSink dest = null;
|
||||||
|
|
||||||
if (route.DestinationKey.Equals("$defaultaudio", StringComparison.OrdinalIgnoreCase))
|
if (route.DestinationKey.Equals("$defaultaudio", StringComparison.OrdinalIgnoreCase))
|
||||||
dest = DefaultAudioDevice as IRoutingSinkNoSwitching;
|
dest = DefaultAudioDevice as IRoutingSinkNoSwitching;
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,25 @@ namespace PepperDash.Essentials.Core.Bridges
|
||||||
{
|
{
|
||||||
public class DmChassisControllerJoinMap : JoinMapBaseAdvanced
|
public class DmChassisControllerJoinMap : JoinMapBaseAdvanced
|
||||||
{
|
{
|
||||||
|
[JoinName("EnableAudioBreakaway")]
|
||||||
|
public JoinDataComplete EnableAudioBreakaway = new JoinDataComplete(
|
||||||
|
new JoinData {JoinNumber = 4, JoinSpan = 1},
|
||||||
|
new JoinMetadata
|
||||||
|
{
|
||||||
|
Label = "DM Chassis enable audio breakaway routing",
|
||||||
|
JoinCapabilities = eJoinCapabilities.ToSIMPL,
|
||||||
|
JoinType = eJoinType.Digital
|
||||||
|
});
|
||||||
|
|
||||||
|
[JoinName("EnableUsbBreakaway")]
|
||||||
|
public JoinDataComplete EnableUsbBreakaway = new JoinDataComplete(
|
||||||
|
new JoinData { JoinNumber = 5, JoinSpan = 1 },
|
||||||
|
new JoinMetadata
|
||||||
|
{
|
||||||
|
Label = "DM Chassis enable USB breakaway routing",
|
||||||
|
JoinCapabilities = eJoinCapabilities.ToSIMPL,
|
||||||
|
JoinType = eJoinType.Digital
|
||||||
|
});
|
||||||
|
|
||||||
[JoinName("SystemId")]
|
[JoinName("SystemId")]
|
||||||
public JoinDataComplete SystemId = new JoinDataComplete(new JoinData() { JoinNumber = 10, JoinSpan = 1 },
|
public JoinDataComplete SystemId = new JoinDataComplete(new JoinData() { JoinNumber = 10, JoinSpan = 1 },
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,57 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using Crestron.SimplSharp;
|
||||||
|
using PepperDash.Essentials.Core;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Core.Bridges
|
||||||
|
{
|
||||||
|
public class HdMdNxM4kEControllerJoinMap : JoinMapBaseAdvanced
|
||||||
|
{
|
||||||
|
[JoinName("Name")]
|
||||||
|
public JoinDataComplete Name = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 },
|
||||||
|
new JoinMetadata() { Label = "Device Name", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
|
||||||
|
|
||||||
|
[JoinName("EnableAutoRoute")]
|
||||||
|
public JoinDataComplete EnableAutoRoute = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 },
|
||||||
|
new JoinMetadata() { Label = "Enable Automatic Routing on 4x1 Switchers", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
[JoinName("InputName")]
|
||||||
|
public JoinDataComplete InputName = new JoinDataComplete(new JoinData() { JoinNumber = 2, JoinSpan = 8 },
|
||||||
|
new JoinMetadata() { Label = "Device Input Name", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
|
||||||
|
|
||||||
|
[JoinName("InputSync")]
|
||||||
|
public JoinDataComplete InputSync = new JoinDataComplete(new JoinData() { JoinNumber = 2, JoinSpan = 8 },
|
||||||
|
new JoinMetadata() { Label = "Device Input Sync", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
[JoinName("OutputName")]
|
||||||
|
public JoinDataComplete OutputName = new JoinDataComplete(new JoinData() { JoinNumber = 11, JoinSpan = 2 },
|
||||||
|
new JoinMetadata() { Label = "Device Output Name", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
|
||||||
|
|
||||||
|
[JoinName("OutputRoute")]
|
||||||
|
public JoinDataComplete OutputRoute = new JoinDataComplete(new JoinData() { JoinNumber = 11, JoinSpan = 2 },
|
||||||
|
new JoinMetadata() { Label = "Device Output Route Set/Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
|
||||||
|
|
||||||
|
[JoinName("OutputRoutedName")]
|
||||||
|
public JoinDataComplete OutputRoutedName = new JoinDataComplete(new JoinData() { JoinNumber = 16, JoinSpan = 2 },
|
||||||
|
new JoinMetadata() { Label = "Device Output Route Name", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
|
||||||
|
|
||||||
|
[JoinName("EnableInputHdcp")]
|
||||||
|
public JoinDataComplete EnableInputHdcp = new JoinDataComplete(new JoinData() { JoinNumber = 11, JoinSpan = 8 },
|
||||||
|
new JoinMetadata() { Label = "Device Enable Input Hdcp", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
[JoinName("DisableInputHdcp")]
|
||||||
|
public JoinDataComplete DisableInputHdcp = new JoinDataComplete(new JoinData() { JoinNumber = 21, JoinSpan = 8 },
|
||||||
|
new JoinMetadata() { Label = "Device Disnable Input Hdcp", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
[JoinName("IsOnline")]
|
||||||
|
public JoinDataComplete IsOnline = new JoinDataComplete(new JoinData() { JoinNumber = 30, JoinSpan = 1 },
|
||||||
|
new JoinMetadata() { Label = "Device Onlne", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
public HdMdNxM4kEControllerJoinMap(uint joinStart)
|
||||||
|
: base(joinStart, typeof(HdMdNxM4kEControllerJoinMap))
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,238 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using Crestron.SimplSharp;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Core.Bridges
|
||||||
|
{
|
||||||
|
public class Hrxxx0WirelessRemoteControllerJoinMap : JoinMapBaseAdvanced
|
||||||
|
{
|
||||||
|
[JoinName("Power")]
|
||||||
|
public JoinDataComplete Power = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 },
|
||||||
|
new JoinMetadata() { Label = "Power", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
[JoinName("Menu")]
|
||||||
|
public JoinDataComplete Menu = new JoinDataComplete(new JoinData() { JoinNumber = 2, JoinSpan = 1 },
|
||||||
|
new JoinMetadata() { Label = "Menu", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
[JoinName("Guide")]
|
||||||
|
public JoinDataComplete Guide = new JoinDataComplete(new JoinData() { JoinNumber = 3, JoinSpan = 1 },
|
||||||
|
new JoinMetadata() { Label = "Guide", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
[JoinName("Info")]
|
||||||
|
public JoinDataComplete Info = new JoinDataComplete(new JoinData() { JoinNumber = 4, JoinSpan = 1 },
|
||||||
|
new JoinMetadata() { Label = "Info", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
[JoinName("VolumeUp")]
|
||||||
|
public JoinDataComplete VolumeUp = new JoinDataComplete(new JoinData() { JoinNumber = 5, JoinSpan = 1 },
|
||||||
|
new JoinMetadata() { Label = "VolumeUp", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
[JoinName("VolumeDown")]
|
||||||
|
public JoinDataComplete VolumeDown = new JoinDataComplete(new JoinData() { JoinNumber = 6, JoinSpan = 1 },
|
||||||
|
new JoinMetadata() { Label = "VolumeDown", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
[JoinName("DialPadUp")]
|
||||||
|
public JoinDataComplete DialPadUp = new JoinDataComplete(new JoinData() { JoinNumber = 7, JoinSpan = 1 },
|
||||||
|
new JoinMetadata() { Label = "DialPadUp", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
[JoinName("DialPadDown")]
|
||||||
|
public JoinDataComplete DialPadDown = new JoinDataComplete(new JoinData() { JoinNumber = 8, JoinSpan = 1 },
|
||||||
|
new JoinMetadata() { Label = "DialPadDown", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
[JoinName("DialPadLeft")]
|
||||||
|
public JoinDataComplete DialPadLeft = new JoinDataComplete(new JoinData() { JoinNumber = 9, JoinSpan = 1 },
|
||||||
|
new JoinMetadata() { Label = "DialPadLeft", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
[JoinName("DialPadRight")]
|
||||||
|
public JoinDataComplete DialPadRight = new JoinDataComplete(new JoinData() { JoinNumber = 10, JoinSpan = 1 },
|
||||||
|
new JoinMetadata() { Label = "DialPadRight", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
[JoinName("DialPadSelect")]
|
||||||
|
public JoinDataComplete DialPadSelect = new JoinDataComplete(new JoinData() { JoinNumber = 11, JoinSpan = 1 },
|
||||||
|
new JoinMetadata() { Label = "DialPadSelect", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
[JoinName("ChannelUp")]
|
||||||
|
public JoinDataComplete ChannelUp = new JoinDataComplete(new JoinData() { JoinNumber = 12, JoinSpan = 1 },
|
||||||
|
new JoinMetadata() { Label = "ChannelUp", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
[JoinName("ChannelDown")]
|
||||||
|
public JoinDataComplete ChannelDown = new JoinDataComplete(new JoinData() { JoinNumber = 13, JoinSpan = 1 },
|
||||||
|
new JoinMetadata() { Label = "ChannelDown", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
[JoinName("Mute")]
|
||||||
|
public JoinDataComplete Mute = new JoinDataComplete(new JoinData() { JoinNumber = 14, JoinSpan = 1 },
|
||||||
|
new JoinMetadata() { Label = "Mute", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
[JoinName("Exit")]
|
||||||
|
public JoinDataComplete Exit = new JoinDataComplete(new JoinData() { JoinNumber = 15, JoinSpan = 1 },
|
||||||
|
new JoinMetadata() { Label = "Exit", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
[JoinName("Last")]
|
||||||
|
public JoinDataComplete Last = new JoinDataComplete(new JoinData() { JoinNumber = 16, JoinSpan = 1 },
|
||||||
|
new JoinMetadata() { Label = "Last", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
[JoinName("Play")]
|
||||||
|
public JoinDataComplete Play = new JoinDataComplete(new JoinData() { JoinNumber = 17, JoinSpan = 1 },
|
||||||
|
new JoinMetadata() { Label = "Play", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
[JoinName("Pause")]
|
||||||
|
public JoinDataComplete Pause = new JoinDataComplete(new JoinData() { JoinNumber = 18, JoinSpan = 1 },
|
||||||
|
new JoinMetadata() { Label = "Pause", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
[JoinName("Rewind")]
|
||||||
|
public JoinDataComplete Rewind = new JoinDataComplete(new JoinData() { JoinNumber = 19, JoinSpan = 1 },
|
||||||
|
new JoinMetadata() { Label = "Rewind", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
[JoinName("FastForward")]
|
||||||
|
public JoinDataComplete FastForward = new JoinDataComplete(new JoinData() { JoinNumber = 20, JoinSpan = 1 },
|
||||||
|
new JoinMetadata() { Label = "FastForward", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
[JoinName("PreviousTrack")]
|
||||||
|
public JoinDataComplete PreviousTrack = new JoinDataComplete(new JoinData() { JoinNumber = 21, JoinSpan = 1 },
|
||||||
|
new JoinMetadata() { Label = "PreviousTrack", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
[JoinName("NextTrack")]
|
||||||
|
public JoinDataComplete NextTrack = new JoinDataComplete(new JoinData() { JoinNumber = 22, JoinSpan = 1 },
|
||||||
|
new JoinMetadata() { Label = "NextTrack", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
[JoinName("Stop")]
|
||||||
|
public JoinDataComplete Stop = new JoinDataComplete(new JoinData() { JoinNumber = 23, JoinSpan = 1 },
|
||||||
|
new JoinMetadata() { Label = "Stop", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
[JoinName("Record")]
|
||||||
|
public JoinDataComplete Record = new JoinDataComplete(new JoinData() { JoinNumber = 24, JoinSpan = 1 },
|
||||||
|
new JoinMetadata() { Label = "Record", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
[JoinName("Dvr")]
|
||||||
|
public JoinDataComplete Dvr = new JoinDataComplete(new JoinData() { JoinNumber = 25, JoinSpan = 1 },
|
||||||
|
new JoinMetadata() { Label = "Dvr", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
[JoinName("Keypad1")]
|
||||||
|
public JoinDataComplete Keypad1 = new JoinDataComplete(new JoinData() { JoinNumber = 26, JoinSpan = 1 },
|
||||||
|
new JoinMetadata() { Label = "Keypad1", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
[JoinName("Keypad2Abc")]
|
||||||
|
public JoinDataComplete Keypad2 = new JoinDataComplete(new JoinData() { JoinNumber = 27, JoinSpan = 1 },
|
||||||
|
new JoinMetadata() { Label = "Keypad2Abc", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
[JoinName("Keypad3Def")]
|
||||||
|
public JoinDataComplete Keypad3Def = new JoinDataComplete(new JoinData() { JoinNumber = 28, JoinSpan = 1 },
|
||||||
|
new JoinMetadata() { Label = "Keypad3Def", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
[JoinName("Keypad4Ghi")]
|
||||||
|
public JoinDataComplete Keypad4Ghi = new JoinDataComplete(new JoinData() { JoinNumber = 29, JoinSpan = 1 },
|
||||||
|
new JoinMetadata() { Label = "Keypad4Ghi", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
[JoinName("Keypad5Jkl")]
|
||||||
|
public JoinDataComplete Keypad5Jkl = new JoinDataComplete(new JoinData() { JoinNumber = 30, JoinSpan = 1 },
|
||||||
|
new JoinMetadata() { Label = "Keypad5Jkl", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
[JoinName("Keypad6Mno")]
|
||||||
|
public JoinDataComplete Keypad6Mno = new JoinDataComplete(new JoinData() { JoinNumber = 31, JoinSpan = 1 },
|
||||||
|
new JoinMetadata() { Label = "Keypad6Mno", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
[JoinName("Keypad7Pqrs")]
|
||||||
|
public JoinDataComplete Keypad7Pqrs = new JoinDataComplete(new JoinData() { JoinNumber = 32, JoinSpan = 1 },
|
||||||
|
new JoinMetadata() { Label = "Keypad7Pqrs", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
[JoinName("Keypad8Tuv")]
|
||||||
|
public JoinDataComplete Keypad8Tuv = new JoinDataComplete(new JoinData() { JoinNumber = 33, JoinSpan = 1 },
|
||||||
|
new JoinMetadata() { Label = "Keypad8Tuv", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
[JoinName("Keypad9Wxyz")]
|
||||||
|
public JoinDataComplete Keypad9Wxyz = new JoinDataComplete(new JoinData() { JoinNumber = 34, JoinSpan = 1 },
|
||||||
|
new JoinMetadata() { Label = "Keypad9Wxyz", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
[JoinName("Keypad0")]
|
||||||
|
public JoinDataComplete Keypad0 = new JoinDataComplete(new JoinData() { JoinNumber = 35, JoinSpan = 1 },
|
||||||
|
new JoinMetadata() { Label = "Keypad0", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
[JoinName("Clear")]
|
||||||
|
public JoinDataComplete Clear = new JoinDataComplete(new JoinData() { JoinNumber = 36, JoinSpan = 1 },
|
||||||
|
new JoinMetadata() { Label = "Clear", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
[JoinName("Enter")]
|
||||||
|
public JoinDataComplete Enter = new JoinDataComplete(new JoinData() { JoinNumber = 37, JoinSpan = 1 },
|
||||||
|
new JoinMetadata() { Label = "Enter", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
[JoinName("Red")]
|
||||||
|
public JoinDataComplete Red = new JoinDataComplete(new JoinData() { JoinNumber = 38, JoinSpan = 1 },
|
||||||
|
new JoinMetadata() { Label = "Red", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
[JoinName("Green")]
|
||||||
|
public JoinDataComplete Green = new JoinDataComplete(new JoinData() { JoinNumber = 39, JoinSpan = 1 },
|
||||||
|
new JoinMetadata() { Label = "Green", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
[JoinName("Yellow")]
|
||||||
|
public JoinDataComplete Yellow = new JoinDataComplete(new JoinData() { JoinNumber = 40, JoinSpan = 1 },
|
||||||
|
new JoinMetadata() { Label = "Yellow", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
[JoinName("Blue")]
|
||||||
|
public JoinDataComplete Blue = new JoinDataComplete(new JoinData() { JoinNumber = 41, JoinSpan = 1 },
|
||||||
|
new JoinMetadata() { Label = "Blue", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
[JoinName("Custom1")]
|
||||||
|
public JoinDataComplete Custom1 = new JoinDataComplete(new JoinData() { JoinNumber = 42, JoinSpan = 1 },
|
||||||
|
new JoinMetadata() { Label = "Custom1", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
[JoinName("Custom2")]
|
||||||
|
public JoinDataComplete Custom2 = new JoinDataComplete(new JoinData() { JoinNumber = 43, JoinSpan = 1 },
|
||||||
|
new JoinMetadata() { Label = "Custom2", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
[JoinName("Custom3")]
|
||||||
|
public JoinDataComplete Custom3 = new JoinDataComplete(new JoinData() { JoinNumber = 44, JoinSpan = 1 },
|
||||||
|
new JoinMetadata() { Label = "Custom3", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
[JoinName("Custom4")]
|
||||||
|
public JoinDataComplete Custom4 = new JoinDataComplete(new JoinData() { JoinNumber = 45, JoinSpan = 1 },
|
||||||
|
new JoinMetadata() { Label = "Custom4", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
[JoinName("Custom5")]
|
||||||
|
public JoinDataComplete Custom5 = new JoinDataComplete(new JoinData() { JoinNumber = 46, JoinSpan = 1 },
|
||||||
|
new JoinMetadata() { Label = "Custom5", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
[JoinName("Custom6")]
|
||||||
|
public JoinDataComplete Custom6 = new JoinDataComplete(new JoinData() { JoinNumber = 47, JoinSpan = 1 },
|
||||||
|
new JoinMetadata() { Label = "Custom6", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
[JoinName("Custom7")]
|
||||||
|
public JoinDataComplete Custom7 = new JoinDataComplete(new JoinData() { JoinNumber = 48, JoinSpan = 1 },
|
||||||
|
new JoinMetadata() { Label = "Custom7", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
[JoinName("Custom8")]
|
||||||
|
public JoinDataComplete Custom8 = new JoinDataComplete(new JoinData() { JoinNumber = 49, JoinSpan = 1 },
|
||||||
|
new JoinMetadata() { Label = "Custom8", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
[JoinName("Custom9")]
|
||||||
|
public JoinDataComplete Custom9 = new JoinDataComplete(new JoinData() { JoinNumber = 50, JoinSpan = 1 },
|
||||||
|
new JoinMetadata() { Label = "Custom9", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
[JoinName("Fav")]
|
||||||
|
public JoinDataComplete Fav = new JoinDataComplete(new JoinData() { JoinNumber = 51, JoinSpan = 1 },
|
||||||
|
new JoinMetadata() { Label = "Fav", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
[JoinName("Home")]
|
||||||
|
public JoinDataComplete Home = new JoinDataComplete(new JoinData() { JoinNumber = 52, JoinSpan = 1 },
|
||||||
|
new JoinMetadata() { Label = "Home", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
[JoinName("BatteryLow")]
|
||||||
|
public JoinDataComplete BatteryLow = new JoinDataComplete(new JoinData() { JoinNumber = 53, JoinSpan = 1 },
|
||||||
|
new JoinMetadata() { Label = "BatteryLow", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
[JoinName("BatteryCritical")]
|
||||||
|
public JoinDataComplete BatteryCritical = new JoinDataComplete(new JoinData() { JoinNumber = 54, JoinSpan = 1 },
|
||||||
|
new JoinMetadata() { Label = "BatteryCritical", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
[JoinName("BatteryVoltage")]
|
||||||
|
public JoinDataComplete BatteryVoltage = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 },
|
||||||
|
new JoinMetadata() { Label = "BatteryVoltage", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Analog });
|
||||||
|
|
||||||
|
public Hrxxx0WirelessRemoteControllerJoinMap(uint joinStart)
|
||||||
|
: base(joinStart, typeof(Hrxxx0WirelessRemoteControllerJoinMap))
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -185,6 +185,26 @@ namespace PepperDash.Essentials.Core
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public string InfinetId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Attepmts to provide uiont conversion of string InifinetId
|
||||||
|
/// </summary>
|
||||||
|
public uint InfinetIdInt
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
return Convert.ToUInt32(InfinetId, 16);
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
throw new FormatException(string.Format("ERROR:Unable to conver Infinet ID: {0} to hex. Error:\n{1}", InfinetId));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class IrControlSpec
|
public class IrControlSpec
|
||||||
|
|
@ -96,7 +96,7 @@ namespace PepperDash.Essentials.Core
|
||||||
trilist.SetStringSigAction(joinMap.SetPortConfig.JoinNumber, SetPortConfig);
|
trilist.SetStringSigAction(joinMap.SetPortConfig.JoinNumber, SetPortConfig);
|
||||||
|
|
||||||
|
|
||||||
var sComm = this as ISocketStatus;
|
var sComm = CommPort as ISocketStatus;
|
||||||
if (sComm == null) return;
|
if (sComm == null) return;
|
||||||
sComm.ConnectionChange += (s, a) =>
|
sComm.ConnectionChange += (s, a) =>
|
||||||
{
|
{
|
||||||
|
|
@ -0,0 +1,235 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using Crestron.SimplSharp;
|
||||||
|
using Crestron.SimplSharp.CrestronIO;
|
||||||
|
using Crestron.SimplSharpPro;
|
||||||
|
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using PepperDash.Core;
|
||||||
|
using PepperDash.Essentials.Core.Config;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Core
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public static class IRPortHelper
|
||||||
|
{
|
||||||
|
public static string IrDriverPathPrefix
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return Global.FilePathPrefix + "IR" + Global.DirectorySeparator;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Finds either the ControlSystem or a device controller that contains IR ports and
|
||||||
|
/// returns a port from the hardware device
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="propsToken"></param>
|
||||||
|
/// <returns>IrPortConfig object. The port and or filename will be empty/null
|
||||||
|
/// if valid values don't exist on config</returns>
|
||||||
|
public static IrOutPortConfig GetIrPort(JToken propsToken)
|
||||||
|
{
|
||||||
|
var control = propsToken["control"];
|
||||||
|
if (control == null)
|
||||||
|
return null;
|
||||||
|
if (control["method"].Value<string>() != "ir")
|
||||||
|
{
|
||||||
|
Debug.Console(0, "IRPortHelper called with non-IR properties");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
var port = new IrOutPortConfig();
|
||||||
|
|
||||||
|
var portDevKey = control.Value<string>("controlPortDevKey");
|
||||||
|
var portNum = control.Value<uint>("controlPortNumber");
|
||||||
|
if (portDevKey == null || portNum == 0)
|
||||||
|
{
|
||||||
|
Debug.Console(1, "WARNING: Properties is missing port device or port number");
|
||||||
|
return port;
|
||||||
|
}
|
||||||
|
|
||||||
|
IIROutputPorts irDev = null;
|
||||||
|
if (portDevKey.Equals("controlSystem", StringComparison.OrdinalIgnoreCase)
|
||||||
|
|| portDevKey.Equals("processor", StringComparison.OrdinalIgnoreCase))
|
||||||
|
irDev = Global.ControlSystem;
|
||||||
|
else
|
||||||
|
irDev = DeviceManager.GetDeviceForKey(portDevKey) as IIROutputPorts;
|
||||||
|
|
||||||
|
if (irDev == null)
|
||||||
|
{
|
||||||
|
Debug.Console(1, "[Config] Error, device with IR ports '{0}' not found", portDevKey);
|
||||||
|
return port;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (portNum <= irDev.NumberOfIROutputPorts) // success!
|
||||||
|
{
|
||||||
|
var file = IrDriverPathPrefix + control["irFile"].Value<string>();
|
||||||
|
port.Port = irDev.IROutputPorts[portNum];
|
||||||
|
port.FileName = file;
|
||||||
|
return port; // new IrOutPortConfig { Port = irDev.IROutputPorts[portNum], FileName = file };
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Debug.Console(1, "[Config] Error, device '{0}' IR port {1} out of range",
|
||||||
|
portDevKey, portNum);
|
||||||
|
return port;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static IROutputPort GetIrOutputPort(DeviceConfig dc)
|
||||||
|
{
|
||||||
|
var irControllerKey = dc.Key + "-ir";
|
||||||
|
if (dc.Properties == null)
|
||||||
|
{
|
||||||
|
Debug.Console(0, "[{0}] WARNING: Device config does not include properties. IR will not function.", dc.Key);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
var control = dc.Properties["control"];
|
||||||
|
if (control == null)
|
||||||
|
{
|
||||||
|
Debug.Console(0,
|
||||||
|
"WARNING: Device config does not include control properties. IR will not function for {0}", dc.Key);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
var portDevKey = control.Value<string>("controlPortDevKey");
|
||||||
|
var portNum = control.Value<uint>("controlPortNumber");
|
||||||
|
IIROutputPorts irDev = null;
|
||||||
|
|
||||||
|
if (portDevKey == null)
|
||||||
|
{
|
||||||
|
Debug.Console(0, "WARNING: control properties is missing ir device for {0}", dc.Key);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (portNum == 0)
|
||||||
|
{
|
||||||
|
Debug.Console(0, "WARNING: control properties is missing ir port number for {0}", dc.Key);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (portDevKey.Equals("controlSystem", StringComparison.OrdinalIgnoreCase)
|
||||||
|
|| portDevKey.Equals("processor", StringComparison.OrdinalIgnoreCase))
|
||||||
|
irDev = Global.ControlSystem;
|
||||||
|
else
|
||||||
|
irDev = DeviceManager.GetDeviceForKey(portDevKey) as IIROutputPorts;
|
||||||
|
|
||||||
|
if (irDev == null)
|
||||||
|
{
|
||||||
|
Debug.Console(0, "WARNING: device with IR ports '{0}' not found", portDevKey);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
if (portNum >= irDev.NumberOfIROutputPorts)
|
||||||
|
{
|
||||||
|
Debug.Console(0, "WARNING: device '{0}' IR port {1} out of range",
|
||||||
|
portDevKey, portNum);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
var port = irDev.IROutputPorts[portNum];
|
||||||
|
|
||||||
|
port.LoadIRDriver(Global.FilePathPrefix + "IR" + Global.DirectorySeparator + control["irFile"].Value<string>());
|
||||||
|
|
||||||
|
return port;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static IrOutputPortController GetIrOutputPortController(DeviceConfig config)
|
||||||
|
{
|
||||||
|
Debug.Console(1, "Attempting to create new Ir Port Controller");
|
||||||
|
|
||||||
|
if (config == null)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
var irDevice = new IrOutputPortController(config.Key, GetIrOutputPort, config);
|
||||||
|
|
||||||
|
return irDevice;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
/// <summary>
|
||||||
|
/// Returns a ready-to-go IrOutputPortController from a DeviceConfig object.
|
||||||
|
/// </summary>
|
||||||
|
public static IrOutputPortController GetIrOutputPortController(DeviceConfig devConf)
|
||||||
|
{
|
||||||
|
var irControllerKey = devConf.Key + "-ir";
|
||||||
|
if (devConf.Properties == null)
|
||||||
|
{
|
||||||
|
Debug.Console(0, "[{0}] WARNING: Device config does not include properties. IR will not function.", devConf.Key);
|
||||||
|
return new IrOutputPortController(irControllerKey, null, "");
|
||||||
|
}
|
||||||
|
|
||||||
|
var control = devConf.Properties["control"];
|
||||||
|
if (control == null)
|
||||||
|
{
|
||||||
|
var c = new IrOutputPortController(irControllerKey, null, "");
|
||||||
|
Debug.Console(0, c, "WARNING: Device config does not include control properties. IR will not function");
|
||||||
|
return c;
|
||||||
|
}
|
||||||
|
|
||||||
|
var portDevKey = control.Value<string>("controlPortDevKey");
|
||||||
|
var portNum = control.Value<uint>("controlPortNumber");
|
||||||
|
IIROutputPorts irDev = null;
|
||||||
|
|
||||||
|
if (portDevKey == null)
|
||||||
|
{
|
||||||
|
var c = new IrOutputPortController(irControllerKey, null, "");
|
||||||
|
Debug.Console(0, c, "WARNING: control properties is missing ir device");
|
||||||
|
return c;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (portNum == 0)
|
||||||
|
{
|
||||||
|
var c = new IrOutputPortController(irControllerKey, null, "");
|
||||||
|
Debug.Console(0, c, "WARNING: control properties is missing ir port number");
|
||||||
|
return c;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (portDevKey.Equals("controlSystem", StringComparison.OrdinalIgnoreCase)
|
||||||
|
|| portDevKey.Equals("processor", StringComparison.OrdinalIgnoreCase))
|
||||||
|
irDev = Global.ControlSystem;
|
||||||
|
else
|
||||||
|
irDev = DeviceManager.GetDeviceForKey(portDevKey) as IIROutputPorts;
|
||||||
|
|
||||||
|
if (irDev == null)
|
||||||
|
{
|
||||||
|
var c = new IrOutputPortController(irControllerKey, null, "");
|
||||||
|
Debug.Console(0, c, "WARNING: device with IR ports '{0}' not found", portDevKey);
|
||||||
|
return c;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (portNum <= irDev.NumberOfIROutputPorts) // success!
|
||||||
|
return new IrOutputPortController(irControllerKey, irDev.IROutputPorts[portNum],
|
||||||
|
IrDriverPathPrefix + control["irFile"].Value<string>());
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var c = new IrOutputPortController(irControllerKey, null, "");
|
||||||
|
Debug.Console(0, c, "WARNING: device '{0}' IR port {1} out of range",
|
||||||
|
portDevKey, portNum);
|
||||||
|
return c;
|
||||||
|
}
|
||||||
|
}*/
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Wrapper to help in IR port creation
|
||||||
|
/// </summary>
|
||||||
|
public class IrOutPortConfig
|
||||||
|
{
|
||||||
|
public IROutputPort Port { get; set; }
|
||||||
|
public string FileName { get; set; }
|
||||||
|
|
||||||
|
public IrOutPortConfig()
|
||||||
|
{
|
||||||
|
FileName = "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,105 +0,0 @@
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using Crestron.SimplSharp;
|
|
||||||
using Crestron.SimplSharpPro;
|
|
||||||
|
|
||||||
using Newtonsoft.Json;
|
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Core
|
|
||||||
{
|
|
||||||
public class ComPortController : Device, IBasicCommunication
|
|
||||||
{
|
|
||||||
public event EventHandler<GenericCommMethodReceiveBytesArgs> BytesReceived;
|
|
||||||
public event EventHandler<GenericCommMethodReceiveTextArgs> TextReceived;
|
|
||||||
|
|
||||||
ComPort Port;
|
|
||||||
ComPort.ComPortSpec Spec;
|
|
||||||
|
|
||||||
public ComPortController(string key, IComPorts ComDevice, uint comPortNum, ComPort.ComPortSpec spec)
|
|
||||||
: base(key)
|
|
||||||
{
|
|
||||||
Port = ComDevice.ComPorts[comPortNum];
|
|
||||||
Spec = spec;
|
|
||||||
|
|
||||||
Debug.Console(2, "Creating com port '{0}'", key);
|
|
||||||
Debug.Console(2, "Com port spec:\r{0}", JsonConvert.SerializeObject(spec));
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Creates a ComPort if the parameters are correct. Returns and logs errors if not
|
|
||||||
/// </summary>
|
|
||||||
public static ComPortController GetComPortController(string key,
|
|
||||||
IComPorts comDevice, uint comPortNum, ComPort.ComPortSpec spec)
|
|
||||||
{
|
|
||||||
Debug.Console(1, "Creating com port '{0}'", key);
|
|
||||||
if (comDevice == null)
|
|
||||||
throw new ArgumentNullException("comDevice");
|
|
||||||
if (string.IsNullOrEmpty(key))
|
|
||||||
throw new ArgumentNullException("key");
|
|
||||||
if (comPortNum > comDevice.NumberOfComPorts)
|
|
||||||
{
|
|
||||||
Debug.Console(0, "[{0}] Com port {1} out of range on {2}",
|
|
||||||
key, comPortNum, comDevice.GetType().Name);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
var port = new ComPortController(key, comDevice, comPortNum, spec);
|
|
||||||
return port;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Registers port and sends ComSpec
|
|
||||||
/// </summary>
|
|
||||||
/// <returns>false if either register or comspec fails</returns>
|
|
||||||
public override bool CustomActivate()
|
|
||||||
{
|
|
||||||
var result = Port.Register();
|
|
||||||
if (result != eDeviceRegistrationUnRegistrationResponse.Success)
|
|
||||||
{
|
|
||||||
Debug.Console(0, this, "Cannot register Com port: {0}", result);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
var specResult = Port.SetComPortSpec(Spec);
|
|
||||||
if (specResult != 0)
|
|
||||||
{
|
|
||||||
Debug.Console(0, this, "Cannot set comspec");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
Port.SerialDataReceived += new ComPortDataReceivedEvent(Port_SerialDataReceived);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Port_SerialDataReceived(ComPort ReceivingComPort, ComPortSerialDataEventArgs args)
|
|
||||||
{
|
|
||||||
if (BytesReceived != null)
|
|
||||||
{
|
|
||||||
var bytes = Encoding.GetEncoding(28591).GetBytes(args.SerialData);
|
|
||||||
BytesReceived(this, new GenericCommMethodReceiveBytesArgs(bytes));
|
|
||||||
}
|
|
||||||
if(TextReceived != null)
|
|
||||||
TextReceived(this, new GenericCommMethodReceiveTextArgs(args.SerialData));
|
|
||||||
}
|
|
||||||
|
|
||||||
public override bool Deactivate()
|
|
||||||
{
|
|
||||||
return Port.UnRegister() == eDeviceRegistrationUnRegistrationResponse.Success;
|
|
||||||
}
|
|
||||||
|
|
||||||
#region IBasicCommunication Members
|
|
||||||
|
|
||||||
public void SendText(string text)
|
|
||||||
{
|
|
||||||
Port.Send(text);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void SendBytes(byte[] bytes)
|
|
||||||
{
|
|
||||||
|
|
||||||
var text = Encoding.GetEncoding(28591).GetString(bytes, 0, bytes.Length);
|
|
||||||
Port.Send(text);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,160 +0,0 @@
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using Crestron.SimplSharp;
|
|
||||||
using Crestron.SimplSharp.CrestronIO;
|
|
||||||
using Crestron.SimplSharpPro;
|
|
||||||
|
|
||||||
using Newtonsoft.Json;
|
|
||||||
using Newtonsoft.Json.Linq;
|
|
||||||
using PepperDash.Core;
|
|
||||||
using PepperDash.Essentials.Core.Config;
|
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Core
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
public static class IRPortHelper
|
|
||||||
{
|
|
||||||
public static string IrDriverPathPrefix
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return Global.FilePathPrefix + "IR" + Global.DirectorySeparator;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Finds either the ControlSystem or a device controller that contains IR ports and
|
|
||||||
/// returns a port from the hardware device
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="propsToken"></param>
|
|
||||||
/// <returns>IrPortConfig object. The port and or filename will be empty/null
|
|
||||||
/// if valid values don't exist on config</returns>
|
|
||||||
public static IrOutPortConfig GetIrPort(JToken propsToken)
|
|
||||||
{
|
|
||||||
var control = propsToken["control"];
|
|
||||||
if (control == null)
|
|
||||||
return null;
|
|
||||||
if (control["method"].Value<string>() != "ir")
|
|
||||||
{
|
|
||||||
Debug.Console(0, "IRPortHelper called with non-IR properties");
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
var port = new IrOutPortConfig();
|
|
||||||
|
|
||||||
var portDevKey = control.Value<string>("controlPortDevKey");
|
|
||||||
var portNum = control.Value<uint>("controlPortNumber");
|
|
||||||
if (portDevKey == null || portNum == 0)
|
|
||||||
{
|
|
||||||
Debug.Console(1, "WARNING: Properties is missing port device or port number");
|
|
||||||
return port;
|
|
||||||
}
|
|
||||||
|
|
||||||
IIROutputPorts irDev = null;
|
|
||||||
if (portDevKey.Equals("controlSystem", StringComparison.OrdinalIgnoreCase)
|
|
||||||
|| portDevKey.Equals("processor", StringComparison.OrdinalIgnoreCase))
|
|
||||||
irDev = Global.ControlSystem;
|
|
||||||
else
|
|
||||||
irDev = DeviceManager.GetDeviceForKey(portDevKey) as IIROutputPorts;
|
|
||||||
|
|
||||||
if (irDev == null)
|
|
||||||
{
|
|
||||||
Debug.Console(1, "[Config] Error, device with IR ports '{0}' not found", portDevKey);
|
|
||||||
return port;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (portNum <= irDev.NumberOfIROutputPorts) // success!
|
|
||||||
{
|
|
||||||
var file = IrDriverPathPrefix + control["irFile"].Value<string>();
|
|
||||||
port.Port = irDev.IROutputPorts[portNum];
|
|
||||||
port.FileName = file;
|
|
||||||
return port; // new IrOutPortConfig { Port = irDev.IROutputPorts[portNum], FileName = file };
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Debug.Console(1, "[Config] Error, device '{0}' IR port {1} out of range",
|
|
||||||
portDevKey, portNum);
|
|
||||||
return port;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Returns a ready-to-go IrOutputPortController from a DeviceConfig object.
|
|
||||||
/// </summary>
|
|
||||||
public static IrOutputPortController GetIrOutputPortController(DeviceConfig devConf)
|
|
||||||
{
|
|
||||||
var irControllerKey = devConf.Key + "-ir";
|
|
||||||
if (devConf.Properties == null)
|
|
||||||
{
|
|
||||||
Debug.Console(0, "[{0}] WARNING: Device config does not include properties. IR will not function.", devConf.Key);
|
|
||||||
return new IrOutputPortController(irControllerKey, null, "");
|
|
||||||
}
|
|
||||||
|
|
||||||
var control = devConf.Properties["control"];
|
|
||||||
if (control == null)
|
|
||||||
{
|
|
||||||
var c = new IrOutputPortController(irControllerKey, null, "");
|
|
||||||
Debug.Console(0, c, "WARNING: Device config does not include control properties. IR will not function");
|
|
||||||
return c;
|
|
||||||
}
|
|
||||||
|
|
||||||
var portDevKey = control.Value<string>("controlPortDevKey");
|
|
||||||
var portNum = control.Value<uint>("controlPortNumber");
|
|
||||||
IIROutputPorts irDev = null;
|
|
||||||
|
|
||||||
if (portDevKey == null)
|
|
||||||
{
|
|
||||||
var c = new IrOutputPortController(irControllerKey, null, "");
|
|
||||||
Debug.Console(0, c, "WARNING: control properties is missing ir device");
|
|
||||||
return c;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (portNum == 0)
|
|
||||||
{
|
|
||||||
var c = new IrOutputPortController(irControllerKey, null, "");
|
|
||||||
Debug.Console(0, c, "WARNING: control properties is missing ir port number");
|
|
||||||
return c;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (portDevKey.Equals("controlSystem", StringComparison.OrdinalIgnoreCase)
|
|
||||||
|| portDevKey.Equals("processor", StringComparison.OrdinalIgnoreCase))
|
|
||||||
irDev = Global.ControlSystem;
|
|
||||||
else
|
|
||||||
irDev = DeviceManager.GetDeviceForKey(portDevKey) as IIROutputPorts;
|
|
||||||
|
|
||||||
if (irDev == null)
|
|
||||||
{
|
|
||||||
var c = new IrOutputPortController(irControllerKey, null, "");
|
|
||||||
Debug.Console(0, c, "WARNING: device with IR ports '{0}' not found", portDevKey);
|
|
||||||
return c;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (portNum <= irDev.NumberOfIROutputPorts) // success!
|
|
||||||
return new IrOutputPortController(irControllerKey, irDev.IROutputPorts[portNum],
|
|
||||||
IrDriverPathPrefix + control["irFile"].Value<string>());
|
|
||||||
else
|
|
||||||
{
|
|
||||||
var c = new IrOutputPortController(irControllerKey, null, "");
|
|
||||||
Debug.Console(0, c, "WARNING: device '{0}' IR port {1} out of range",
|
|
||||||
portDevKey, portNum);
|
|
||||||
return c;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Wrapper to help in IR port creation
|
|
||||||
/// </summary>
|
|
||||||
public class IrOutPortConfig
|
|
||||||
{
|
|
||||||
public IROutputPort Port { get; set; }
|
|
||||||
public string FileName { get; set; }
|
|
||||||
|
|
||||||
public IrOutPortConfig()
|
|
||||||
{
|
|
||||||
FileName = "";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -13,6 +13,7 @@ using PepperDash.Essentials.Core.Config;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Core.CrestronIO
|
namespace PepperDash.Essentials.Core.CrestronIO
|
||||||
{
|
{
|
||||||
|
[Description("Wrapper class for Digital Input")]
|
||||||
public class GenericDigitalInputDevice : EssentialsBridgeableDevice, IDigitalInput
|
public class GenericDigitalInputDevice : EssentialsBridgeableDevice, IDigitalInput
|
||||||
{
|
{
|
||||||
public DigitalInput InputPort { get; private set; }
|
public DigitalInput InputPort { get; private set; }
|
||||||
|
|
@ -27,22 +28,77 @@ namespace PepperDash.Essentials.Core.CrestronIO
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public GenericDigitalInputDevice(string key, DigitalInput inputPort):
|
|
||||||
base(key)
|
|
||||||
{
|
|
||||||
InputStateFeedback = new BoolFeedback(InputStateFeedbackFunc);
|
|
||||||
|
|
||||||
InputPort = inputPort;
|
public GenericDigitalInputDevice(string key, string name, Func<IOPortConfig, DigitalInput> postActivationFunc,
|
||||||
|
IOPortConfig config)
|
||||||
|
: base(key, name)
|
||||||
|
{
|
||||||
|
|
||||||
|
AddPostActivationAction(() =>
|
||||||
|
{
|
||||||
|
InputPort = postActivationFunc(config);
|
||||||
|
|
||||||
|
InputPort.Register();
|
||||||
|
|
||||||
InputPort.StateChange += InputPort_StateChange;
|
InputPort.StateChange += InputPort_StateChange;
|
||||||
|
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#region Events
|
||||||
|
|
||||||
void InputPort_StateChange(DigitalInput digitalInput, DigitalInputEventArgs args)
|
void InputPort_StateChange(DigitalInput digitalInput, DigitalInputEventArgs args)
|
||||||
{
|
{
|
||||||
InputStateFeedback.FireUpdate();
|
InputStateFeedback.FireUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region PreActivate
|
||||||
|
|
||||||
|
private static DigitalInput GetDigitalInput(IOPortConfig dc)
|
||||||
|
{
|
||||||
|
IDigitalInputPorts ioPortDevice;
|
||||||
|
|
||||||
|
if (dc.PortDeviceKey.Equals("processor"))
|
||||||
|
{
|
||||||
|
if (!Global.ControlSystem.SupportsDigitalInput)
|
||||||
|
{
|
||||||
|
Debug.Console(0, "GetDigitalInput: Processor does not support Digital Inputs");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
ioPortDevice = Global.ControlSystem;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var ioPortDev = DeviceManager.GetDeviceForKey(dc.PortDeviceKey) as IDigitalInputPorts;
|
||||||
|
if (ioPortDev == null)
|
||||||
|
{
|
||||||
|
Debug.Console(0, "GetDigitalInput: Device {0} is not a valid device", dc.PortDeviceKey);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
ioPortDevice = ioPortDev;
|
||||||
|
}
|
||||||
|
if (ioPortDevice == null)
|
||||||
|
{
|
||||||
|
Debug.Console(0, "GetDigitalInput: Device '0' is not a valid IRelayPorts Device", dc.PortDeviceKey);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (dc.PortNumber > ioPortDevice.NumberOfDigitalInputPorts)
|
||||||
|
{
|
||||||
|
Debug.Console(0, "GetDigitalInput: Device {0} does not contain a port {1}", dc.PortDeviceKey, dc.PortNumber);
|
||||||
|
}
|
||||||
|
|
||||||
|
return ioPortDevice.DigitalInputPorts[dc.PortNumber];
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Bridge Linking
|
||||||
|
|
||||||
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 = new IDigitalInputJoinMap(joinStart);
|
var joinMap = new IDigitalInputJoinMap(joinStart);
|
||||||
|
|
@ -67,7 +123,10 @@ namespace PepperDash.Essentials.Core.CrestronIO
|
||||||
Debug.Console(1, this, "Error: {0}", e);
|
Debug.Console(1, this, "Error: {0}", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Factory
|
||||||
|
|
||||||
public class GenericDigitalInputDeviceFactory : EssentialsDeviceFactory<GenericDigitalInputDevice>
|
public class GenericDigitalInputDeviceFactory : EssentialsDeviceFactory<GenericDigitalInputDevice>
|
||||||
{
|
{
|
||||||
|
|
@ -78,85 +137,21 @@ namespace PepperDash.Essentials.Core.CrestronIO
|
||||||
|
|
||||||
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||||
{
|
{
|
||||||
Debug.Console(1, "Factory Attempting to create new Digtal Input Device");
|
Debug.Console(1, "Factory Attempting to create new Generic Relay Device");
|
||||||
|
|
||||||
var props = JsonConvert.DeserializeObject<IOPortConfig>(dc.Properties.ToString());
|
var props = JsonConvert.DeserializeObject<IOPortConfig>(dc.Properties.ToString());
|
||||||
|
|
||||||
IDigitalInputPorts portDevice;
|
if (props == null) return null;
|
||||||
|
|
||||||
if (props.PortDeviceKey == "processor")
|
var portDevice = new GenericDigitalInputDevice(dc.Key, dc.Name, GetDigitalInput, props);
|
||||||
portDevice = Global.ControlSystem as IDigitalInputPorts;
|
|
||||||
else
|
|
||||||
portDevice = DeviceManager.GetDeviceForKey(props.PortDeviceKey) as IDigitalInputPorts;
|
|
||||||
|
|
||||||
if (portDevice == null)
|
return portDevice;
|
||||||
Debug.Console(0, "ERROR: Unable to add digital input device with key '{0}'. Port Device does not support digital inputs", dc.Key);
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
var cs = (portDevice as CrestronControlSystem);
|
|
||||||
if (cs == null)
|
|
||||||
{
|
|
||||||
Debug.Console(0, "ERROR: Port device for [{0}] is not control system", props.PortDeviceKey);
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cs.SupportsVersiport)
|
#endregion
|
||||||
{
|
|
||||||
Debug.Console(1, "Attempting to add Digital Input device to Versiport port '{0}'", props.PortNumber);
|
|
||||||
|
|
||||||
if (props.PortNumber > cs.NumberOfVersiPorts)
|
|
||||||
{
|
|
||||||
Debug.Console(0, "WARNING: Cannot add Vesiport {0} on {1}. Out of range",
|
|
||||||
props.PortNumber, props.PortDeviceKey);
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Versiport vp = cs.VersiPorts[props.PortNumber];
|
|
||||||
|
|
||||||
if (!vp.Registered)
|
|
||||||
{
|
|
||||||
var regSuccess = vp.Register();
|
|
||||||
if (regSuccess == eDeviceRegistrationUnRegistrationResponse.Success)
|
|
||||||
{
|
|
||||||
Debug.Console(1, "Successfully Created Digital Input Device on Versiport");
|
|
||||||
return new GenericVersiportDigitalInputDevice(dc.Key, vp, props);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Debug.Console(0, "WARNING: Attempt to register versiport {0} on device with key '{1}' failed: {2}",
|
|
||||||
props.PortNumber, props.PortDeviceKey, regSuccess);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (cs.SupportsDigitalInput)
|
|
||||||
{
|
|
||||||
Debug.Console(1, "Attempting to add Digital Input device to Digital Input port '{0}'", props.PortNumber);
|
|
||||||
|
|
||||||
if (props.PortNumber > cs.NumberOfDigitalInputPorts)
|
|
||||||
{
|
|
||||||
Debug.Console(0, "WARNING: Cannot register DIO port {0} on {1}. Out of range",
|
|
||||||
props.PortNumber, props.PortDeviceKey);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
DigitalInput digitalInput = cs.DigitalInputPorts[props.PortNumber];
|
|
||||||
|
|
||||||
if (!digitalInput.Registered)
|
|
||||||
{
|
|
||||||
if (digitalInput.Register() == eDeviceRegistrationUnRegistrationResponse.Success)
|
|
||||||
{
|
|
||||||
Debug.Console(1, "Successfully Created Digital Input Device on Digital Input");
|
|
||||||
return new GenericDigitalInputDevice(dc.Key, digitalInput);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
Debug.Console(0, "WARNING: Attempt to register digital input {0} on device with key '{1}' failed.",
|
|
||||||
props.PortNumber, props.PortDeviceKey);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -15,13 +15,15 @@ namespace PepperDash.Essentials.Core.CrestronIO
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents a generic device controlled by relays
|
/// Represents a generic device controlled by relays
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[Description("Wrapper class for a Relay")]
|
||||||
public class GenericRelayDevice : EssentialsBridgeableDevice, ISwitchedOutput
|
public class GenericRelayDevice : EssentialsBridgeableDevice, ISwitchedOutput
|
||||||
{
|
{
|
||||||
public Relay RelayOutput { get; private set; }
|
public Relay RelayOutput { get; private set; }
|
||||||
|
|
||||||
public BoolFeedback OutputIsOnFeedback { get; private set; }
|
public BoolFeedback OutputIsOnFeedback { get; private set; }
|
||||||
|
|
||||||
public GenericRelayDevice(string key, Relay relay):
|
//Maintained for compatibility with PepperDash.Essentials.Core.Devices.CrestronProcessor
|
||||||
|
public GenericRelayDevice(string key, Relay relay) :
|
||||||
base(key)
|
base(key)
|
||||||
{
|
{
|
||||||
OutputIsOnFeedback = new BoolFeedback(new Func<bool>(() => RelayOutput.State));
|
OutputIsOnFeedback = new BoolFeedback(new Func<bool>(() => RelayOutput.State));
|
||||||
|
|
@ -32,11 +34,75 @@ namespace PepperDash.Essentials.Core.CrestronIO
|
||||||
RelayOutput.StateChange += new RelayEventHandler(RelayOutput_StateChange);
|
RelayOutput.StateChange += new RelayEventHandler(RelayOutput_StateChange);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public GenericRelayDevice(string key, string name, Func<IOPortConfig, Relay> postActivationFunc,
|
||||||
|
IOPortConfig config)
|
||||||
|
: base(key, name)
|
||||||
|
{
|
||||||
|
|
||||||
|
AddPostActivationAction(() =>
|
||||||
|
{
|
||||||
|
RelayOutput = postActivationFunc(config);
|
||||||
|
|
||||||
|
RelayOutput.Register();
|
||||||
|
|
||||||
|
RelayOutput.StateChange += RelayOutput_StateChange;
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
#region PreActivate
|
||||||
|
|
||||||
|
private static Relay GetRelay(IOPortConfig dc)
|
||||||
|
{
|
||||||
|
|
||||||
|
IRelayPorts relayDevice;
|
||||||
|
|
||||||
|
if(dc.PortDeviceKey.Equals("processor"))
|
||||||
|
{
|
||||||
|
if (!Global.ControlSystem.SupportsRelay)
|
||||||
|
{
|
||||||
|
Debug.Console(0, "GetRelayDevice: Processor does not support relays");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
relayDevice = Global.ControlSystem;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var relayDev = DeviceManager.GetDeviceForKey(dc.PortDeviceKey) as IRelayPorts;
|
||||||
|
if (relayDev == null)
|
||||||
|
{
|
||||||
|
Debug.Console(0, "GetRelayDevice: Device {0} is not a valid device", dc.PortDeviceKey);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
relayDevice = relayDev;
|
||||||
|
}
|
||||||
|
if (relayDevice == null)
|
||||||
|
{
|
||||||
|
Debug.Console(0, "GetRelayDevice: Device '0' is not a valid IRelayPorts Device", dc.PortDeviceKey);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (dc.PortNumber > relayDevice.NumberOfRelayPorts)
|
||||||
|
{
|
||||||
|
Debug.Console(0, "GetRelayDevice: Device {0} does not contain a port {1}", dc.PortDeviceKey, dc.PortNumber);
|
||||||
|
}
|
||||||
|
|
||||||
|
return relayDevice.RelayPorts[dc.PortNumber];
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Events
|
||||||
|
|
||||||
void RelayOutput_StateChange(Relay relay, RelayEventArgs args)
|
void RelayOutput_StateChange(Relay relay, RelayEventArgs args)
|
||||||
{
|
{
|
||||||
OutputIsOnFeedback.FireUpdate();
|
OutputIsOnFeedback.FireUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Methods
|
||||||
|
|
||||||
public void OpenRelay()
|
public void OpenRelay()
|
||||||
{
|
{
|
||||||
RelayOutput.State = false;
|
RelayOutput.State = false;
|
||||||
|
|
@ -55,6 +121,8 @@ namespace PepperDash.Essentials.Core.CrestronIO
|
||||||
CloseRelay();
|
CloseRelay();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
#region ISwitchedOutput Members
|
#region ISwitchedOutput Members
|
||||||
|
|
||||||
void ISwitchedOutput.On()
|
void ISwitchedOutput.On()
|
||||||
|
|
@ -69,6 +137,8 @@ namespace PepperDash.Essentials.Core.CrestronIO
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region Bridge Linking
|
||||||
|
|
||||||
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 = new GenericRelayControllerJoinMap(joinStart);
|
var joinMap = new GenericRelayControllerJoinMap(joinStart);
|
||||||
|
|
@ -100,7 +170,10 @@ namespace PepperDash.Essentials.Core.CrestronIO
|
||||||
|
|
||||||
OutputIsOnFeedback.LinkInputSig(trilist.BooleanInput[joinMap.Relay.JoinNumber]);
|
OutputIsOnFeedback.LinkInputSig(trilist.BooleanInput[joinMap.Relay.JoinNumber]);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Factory
|
||||||
|
|
||||||
public class GenericRelayDeviceFactory : EssentialsDeviceFactory<GenericRelayDevice>
|
public class GenericRelayDeviceFactory : EssentialsDeviceFactory<GenericRelayDevice>
|
||||||
{
|
{
|
||||||
|
|
@ -114,10 +187,15 @@ namespace PepperDash.Essentials.Core.CrestronIO
|
||||||
Debug.Console(1, "Factory Attempting to create new Generic Relay Device");
|
Debug.Console(1, "Factory Attempting to create new Generic Relay Device");
|
||||||
|
|
||||||
var props = JsonConvert.DeserializeObject<IOPortConfig>(dc.Properties.ToString());
|
var props = JsonConvert.DeserializeObject<IOPortConfig>(dc.Properties.ToString());
|
||||||
var key = dc.Key;
|
|
||||||
|
|
||||||
IRelayPorts portDevice;
|
if (props == null) return null;
|
||||||
|
|
||||||
|
var portDevice = new GenericRelayDevice(dc.Key, dc.Name, GetRelay, props);
|
||||||
|
|
||||||
|
return portDevice;
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
if (props.PortDeviceKey == "processor")
|
if (props.PortDeviceKey == "processor")
|
||||||
portDevice = Global.ControlSystem as IRelayPorts;
|
portDevice = Global.ControlSystem as IRelayPorts;
|
||||||
else
|
else
|
||||||
|
|
@ -165,10 +243,15 @@ namespace PepperDash.Essentials.Core.CrestronIO
|
||||||
|
|
||||||
// Future: Check if portDevice is 3-series card or other non control system that supports versiports
|
// Future: Check if portDevice is 3-series card or other non control system that supports versiports
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
return null;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -53,7 +53,7 @@ namespace PepperDash.Essentials.Core
|
||||||
|
|
||||||
public ConfigSnippetAttribute(string configSnippet)
|
public ConfigSnippetAttribute(string configSnippet)
|
||||||
{
|
{
|
||||||
Debug.Console(2, "Setting Description {0}", configSnippet);
|
Debug.Console(2, "Setting Config Snippet {0}", configSnippet);
|
||||||
_ConfigSnippet = configSnippet;
|
_ConfigSnippet = configSnippet;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -83,8 +83,9 @@ namespace PepperDash.Essentials.Core
|
||||||
foreach (var typeName in TypeNames)
|
foreach (var typeName in TypeNames)
|
||||||
{
|
{
|
||||||
Debug.Console(2, "Getting Description Attribute from class: '{0}'", typeof(T).FullName);
|
Debug.Console(2, "Getting Description Attribute from class: '{0}'", typeof(T).FullName);
|
||||||
var attributes = typeof(T).GetCustomAttributes(typeof(DescriptionAttribute), true) as DescriptionAttribute[];
|
var descriptionAttribute = typeof(T).GetCustomAttributes(typeof(DescriptionAttribute), true) as DescriptionAttribute[];
|
||||||
string description = attributes[0].Description;
|
string description = descriptionAttribute[0].Description;
|
||||||
|
var snippetAttribute = typeof(T).GetCustomAttributes(typeof(ConfigSnippetAttribute), true) as ConfigSnippetAttribute[];
|
||||||
DeviceFactory.AddFactoryForType(typeName.ToLower(), description, typeof(T), BuildDevice);
|
DeviceFactory.AddFactoryForType(typeName.ToLower(), description, typeof(T), BuildDevice);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,9 @@ using System.Linq;
|
||||||
using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
using Crestron.SimplSharpPro;
|
using Crestron.SimplSharpPro;
|
||||||
using Crestron.SimplSharpPro.DeviceSupport;
|
using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using PepperDash.Essentials.Core.Config;
|
||||||
|
|
||||||
|
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
|
|
||||||
|
|
@ -39,6 +42,18 @@ namespace PepperDash.Essentials.Core
|
||||||
LoadDriver(irDriverFilepath);
|
LoadDriver(irDriverFilepath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public IrOutputPortController(string key, Func<DeviceConfig, IROutputPort> postActivationFunc,
|
||||||
|
DeviceConfig config)
|
||||||
|
: base(key)
|
||||||
|
{
|
||||||
|
AddPostActivationAction(() =>
|
||||||
|
{
|
||||||
|
IrPort = postActivationFunc(config);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Loads the IR driver at path
|
/// Loads the IR driver at path
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -119,6 +134,5 @@ namespace PepperDash.Essentials.Core
|
||||||
Debug.Console(2, this, "Device {0}: IR Driver {1} does not contain command {2}",
|
Debug.Console(2, this, "Device {0}: IR Driver {1} does not contain command {2}",
|
||||||
Key, IrPort.IRDriverFileNameByIRDriverId(IrPortUid), command);
|
Key, IrPort.IRDriverFileNameByIRDriverId(IrPortUid), command);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -14,6 +14,7 @@ using PepperDash.Essentials.Core.Routing;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Core
|
namespace PepperDash.Essentials.Core
|
||||||
{
|
{
|
||||||
|
[Description("Wrapper class for a Basic IR Display")]
|
||||||
public class BasicIrDisplay : DisplayBase, IBasicVolumeControls, IBridgeAdvanced
|
public class BasicIrDisplay : DisplayBase, IBasicVolumeControls, IBridgeAdvanced
|
||||||
{
|
{
|
||||||
public IrOutputPortController IrPort { get; private set; }
|
public IrOutputPortController IrPort { get; private set; }
|
||||||
|
|
|
||||||
|
|
@ -107,6 +107,8 @@ namespace PepperDash.Essentials.Core.Fusion
|
||||||
|
|
||||||
public long PushNotificationTimeout = 5000;
|
public long PushNotificationTimeout = 5000;
|
||||||
|
|
||||||
|
private const string RemoteOccupancyXml = "<Occupancy><Type>Local</Type><State>{0}</State></Occupancy>";
|
||||||
|
|
||||||
protected Dictionary<int, FusionAsset> FusionStaticAssets;
|
protected Dictionary<int, FusionAsset> FusionStaticAssets;
|
||||||
|
|
||||||
// For use with local occ sensor devices which will relay to Fusion the current occupancy status
|
// For use with local occ sensor devices which will relay to Fusion the current occupancy status
|
||||||
|
|
@ -117,6 +119,9 @@ namespace PepperDash.Essentials.Core.Fusion
|
||||||
|
|
||||||
public BoolFeedback RoomIsOccupiedFeedback { get; private set; }
|
public BoolFeedback RoomIsOccupiedFeedback { get; private set; }
|
||||||
|
|
||||||
|
private string _roomOccupancyRemoteString;
|
||||||
|
public StringFeedback RoomOccupancyRemoteStringFeedback { get; private set; }
|
||||||
|
|
||||||
protected Func<bool> RoomIsOccupiedFeedbackFunc
|
protected Func<bool> RoomIsOccupiedFeedbackFunc
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
|
@ -1368,10 +1373,20 @@ namespace PepperDash.Essentials.Core.Fusion
|
||||||
//occSensorShutdownMinutes.OutputSig.UserObject(new Action(ushort)(b => Room.OccupancyObj.SetShutdownMinutes(b));
|
//occSensorShutdownMinutes.OutputSig.UserObject(new Action(ushort)(b => Room.OccupancyObj.SetShutdownMinutes(b));
|
||||||
|
|
||||||
|
|
||||||
|
RoomOccupancyRemoteStringFeedback = new StringFeedback(() => _roomOccupancyRemoteString);
|
||||||
Room.RoomOccupancy.RoomIsOccupiedFeedback.LinkInputSig(occSensorAsset.RoomOccupied.InputSig);
|
Room.RoomOccupancy.RoomIsOccupiedFeedback.LinkInputSig(occSensorAsset.RoomOccupied.InputSig);
|
||||||
|
Room.RoomOccupancy.RoomIsOccupiedFeedback.OutputChange += RoomIsOccupiedFeedback_OutputChange;
|
||||||
|
RoomOccupancyRemoteStringFeedback.LinkInputSig(occSensorAsset.RoomOccupancyInfo.InputSig);
|
||||||
|
|
||||||
//}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RoomIsOccupiedFeedback_OutputChange(object sender, FeedbackEventArgs e)
|
||||||
|
{
|
||||||
|
_roomOccupancyRemoteString = String.Format(RemoteOccupancyXml, e.BoolValue ? "Occupied" : "Unoccupied");
|
||||||
|
RoomOccupancyRemoteStringFeedback.FireUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Helper to get the number from the end of a device's key string
|
/// Helper to get the number from the end of a device's key string
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,139 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using Crestron.SimplSharp;
|
||||||
|
using Crestron.SimplSharpPro;
|
||||||
|
using Crestron.SimplSharpPro.Gateways;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
|
|
||||||
|
using PepperDash.Core;
|
||||||
|
using PepperDash.Essentials.Core;
|
||||||
|
using PepperDash.Essentials.Core.Config;
|
||||||
|
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Core
|
||||||
|
{
|
||||||
|
[Description("Wrapper class for Crestron Infinet-EX Gateways")]
|
||||||
|
public class CenRfgwController : CrestronGenericBaseDevice
|
||||||
|
{
|
||||||
|
private GatewayBase _Gateway;
|
||||||
|
public GatewayBase GateWay { get { return _Gateway; } }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Constructor for the on-board gateway
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="key"></param>
|
||||||
|
/// <param name="name"></param>
|
||||||
|
public CenRfgwController(string key, string name, GatewayBase gateway) :
|
||||||
|
base(key, name, gateway)
|
||||||
|
{
|
||||||
|
_Gateway = gateway;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static CenRfgwController GetNewExGatewayController(string key, string name, ushort ipId, ushort cresnetId, string gatewayType)
|
||||||
|
{
|
||||||
|
eExGatewayType type = (eExGatewayType)Enum.Parse(typeof(eExGatewayType), gatewayType, true);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var cs = Global.ControlSystem;
|
||||||
|
|
||||||
|
GatewayBase gw = null;
|
||||||
|
switch (type)
|
||||||
|
{
|
||||||
|
case eExGatewayType.Ethernet:
|
||||||
|
gw = new CenRfgwEx(ipId, cs);
|
||||||
|
break;
|
||||||
|
case eExGatewayType.EthernetShared:
|
||||||
|
gw = new CenRfgwExEthernetSharable(ipId, cs);
|
||||||
|
break;
|
||||||
|
case eExGatewayType.Cresnet:
|
||||||
|
gw = new CenRfgwExCresnet(cresnetId, cs);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return new CenRfgwController(key, name, gw);
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
Debug.Console(0, "ERROR: Cannot create EX Gateway, id {0}, type {1}", type == eExGatewayType.Cresnet ? cresnetId : ipId, gatewayType);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public static CenRfgwController GetNewErGatewayController(string key, string name, ushort ipId, ushort cresnetId, string gatewayType)
|
||||||
|
{
|
||||||
|
eExGatewayType type = (eExGatewayType)Enum.Parse(typeof(eExGatewayType), gatewayType, true);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var cs = Global.ControlSystem;
|
||||||
|
|
||||||
|
GatewayBase gw = null;
|
||||||
|
switch (type)
|
||||||
|
{
|
||||||
|
case eExGatewayType.Ethernet:
|
||||||
|
gw = new CenErfgwPoe(ipId, cs);
|
||||||
|
break;
|
||||||
|
case eExGatewayType.EthernetShared:
|
||||||
|
gw = new CenErfgwPoeEthernetSharable(ipId, cs);
|
||||||
|
break;
|
||||||
|
case eExGatewayType.Cresnet:
|
||||||
|
gw = new CenErfgwPoeCresnet(cresnetId, cs);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return new CenRfgwController(key, name, gw);
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
Debug.Console(0, "ERROR: Cannot create ER Gateway, id {0}, type {1}", type== eExGatewayType.Cresnet ? cresnetId : ipId, gatewayType);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public enum eExGatewayType
|
||||||
|
{
|
||||||
|
Ethernet, EthernetShared, Cresnet
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#region Factory
|
||||||
|
public class CenRfgwControllerFactory : EssentialsDeviceFactory<CenRfgwController>
|
||||||
|
{
|
||||||
|
public CenRfgwControllerFactory()
|
||||||
|
{
|
||||||
|
TypeNames = new List<string>() { "cenrfgwex", "cenerfgwpoe" };
|
||||||
|
}
|
||||||
|
|
||||||
|
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||||
|
{
|
||||||
|
|
||||||
|
Debug.Console(1, "Factory Attempting to create new CEN-GWEXER Device");
|
||||||
|
|
||||||
|
var props = JsonConvert.DeserializeObject<EssentialsRfGatewayConfig>(dc.Properties.ToString());
|
||||||
|
|
||||||
|
var type = dc.Type.ToLower();
|
||||||
|
var control = props.Control;
|
||||||
|
var ipid = control.IpIdInt;
|
||||||
|
var cresnetId = control.CresnetIdInt;
|
||||||
|
var gatewayType = props.GatewayType;
|
||||||
|
|
||||||
|
switch (type)
|
||||||
|
{
|
||||||
|
case ("cenrfgwex"):
|
||||||
|
return CenRfgwController.GetNewExGatewayController(dc.Key, dc.Name,
|
||||||
|
(ushort)ipid, (ushort)cresnetId, gatewayType);
|
||||||
|
case ("cenerfgwpoe"):
|
||||||
|
return CenRfgwController.GetNewErGatewayController(dc.Key, dc.Name,
|
||||||
|
(ushort)ipid, (ushort)cresnetId, gatewayType);
|
||||||
|
default:
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using Crestron.SimplSharp;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using PepperDash.Core;
|
||||||
|
using PepperDash.Essentials.Core.Config;
|
||||||
|
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Core
|
||||||
|
{
|
||||||
|
public class EssentialsRfGatewayConfig
|
||||||
|
{
|
||||||
|
[JsonProperty("control")]
|
||||||
|
public EssentialsControlPropertiesConfig Control { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("gatewayType")]
|
||||||
|
public string GatewayType { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
using Crestron.SimplSharp.Reflection;
|
using Crestron.SimplSharp.Reflection;
|
||||||
|
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
|
|
@ -27,6 +28,16 @@ namespace PepperDash.Essentials.Core
|
||||||
return joinMap;
|
return joinMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Attempts to get the serialized join map from config
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="joinMapKey"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static string GetJoinMapForDevice(string joinMapKey)
|
||||||
|
{
|
||||||
|
return GetSerializedJoinMapForDevice(joinMapKey);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Attempts to find a custom join map by key and returns it deserialized if found
|
/// Attempts to find a custom join map by key and returns it deserialized if found
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -337,6 +348,8 @@ namespace PepperDash.Essentials.Core
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class JoinMetadata
|
public class JoinMetadata
|
||||||
{
|
{
|
||||||
|
private string _description;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Join number (based on join offset value)
|
/// Join number (based on join offset value)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -351,10 +364,17 @@ namespace PepperDash.Essentials.Core
|
||||||
public uint JoinSpan { get; set; }
|
public uint JoinSpan { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A label for the join to better describe it's usage
|
/// A label for the join to better describe its usage
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[Obsolete("Use Description instead")]
|
||||||
[JsonProperty("label")]
|
[JsonProperty("label")]
|
||||||
public string Label { get; set; }
|
public string Label { get { return _description; } set { _description = value; } }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// A description for the join to better describe its usage
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("description")]
|
||||||
|
public string Description { get { return _description; } set { _description = value; } }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Signal type(s)
|
/// Signal type(s)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -447,8 +467,10 @@ namespace PepperDash.Essentials.Core
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
[AttributeUsage(AttributeTargets.All)]
|
[AttributeUsage(AttributeTargets.All)]
|
||||||
public class JoinNameAttribute : Attribute
|
public class JoinNameAttribute : CAttribute
|
||||||
{
|
{
|
||||||
private string _Name;
|
private string _Name;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -62,6 +62,10 @@
|
||||||
<SpecificVersion>False</SpecificVersion>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
<HintPath>..\..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.Fusion.dll</HintPath>
|
<HintPath>..\..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.Fusion.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
<Reference Include="Crestron.SimplSharpPro.Gateways, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||||
|
<SpecificVersion>False</SpecificVersion>
|
||||||
|
<HintPath>..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.Gateways.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
<Reference Include="Crestron.SimplSharpPro.GeneralIO, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
<Reference Include="Crestron.SimplSharpPro.GeneralIO, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||||
<SpecificVersion>False</SpecificVersion>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.GeneralIO.dll</HintPath>
|
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.GeneralIO.dll</HintPath>
|
||||||
|
|
@ -129,15 +133,23 @@
|
||||||
<Compile Include="Bridges\JoinMaps\GenericLightingJoinMap.cs" />
|
<Compile Include="Bridges\JoinMaps\GenericLightingJoinMap.cs" />
|
||||||
<Compile Include="Bridges\JoinMaps\GenericRelayControllerJoinMap.cs" />
|
<Compile Include="Bridges\JoinMaps\GenericRelayControllerJoinMap.cs" />
|
||||||
<Compile Include="Bridges\JoinMaps\GlsOccupancySensorBaseJoinMap.cs" />
|
<Compile Include="Bridges\JoinMaps\GlsOccupancySensorBaseJoinMap.cs" />
|
||||||
|
<Compile Include="Bridges\JoinMaps\HdMdNxM4kEControllerJoinMap.cs" />
|
||||||
<Compile Include="Bridges\JoinMaps\HdMdxxxCEControllerJoinMap.cs" />
|
<Compile Include="Bridges\JoinMaps\HdMdxxxCEControllerJoinMap.cs" />
|
||||||
|
<Compile Include="Bridges\JoinMaps\Hrxxx0WirelessRemoteControllerJoinMap.cs" />
|
||||||
<Compile Include="Bridges\JoinMaps\IBasicCommunicationJoinMap.cs" />
|
<Compile Include="Bridges\JoinMaps\IBasicCommunicationJoinMap.cs" />
|
||||||
<Compile Include="Bridges\JoinMaps\IDigitalInputJoinMap.cs" />
|
<Compile Include="Bridges\JoinMaps\IDigitalInputJoinMap.cs" />
|
||||||
<Compile Include="Bridges\JoinMaps\SetTopBoxControllerJoinMap.cs" />
|
<Compile Include="Bridges\JoinMaps\SetTopBoxControllerJoinMap.cs" />
|
||||||
<Compile Include="Bridges\JoinMaps\StatusSignControllerJoinMap.cs" />
|
<Compile Include="Bridges\JoinMaps\StatusSignControllerJoinMap.cs" />
|
||||||
<Compile Include="Bridges\JoinMaps\SystemMonitorJoinMap.cs" />
|
<Compile Include="Bridges\JoinMaps\SystemMonitorJoinMap.cs" />
|
||||||
<Compile Include="Config\Comm and IR\CecPortController.cs" />
|
<Compile Include="Comm and IR\CecPortController.cs" />
|
||||||
<Compile Include="Config\Comm and IR\GenericComm.cs" />
|
<Compile Include="Comm and IR\CommFactory.cs" />
|
||||||
<Compile Include="Config\Comm and IR\GenericHttpClient.cs" />
|
<Compile Include="Comm and IR\CommunicationExtras.cs" />
|
||||||
|
<Compile Include="Comm and IR\ComPortController.cs" />
|
||||||
|
<Compile Include="Comm and IR\ComSpecJsonConverter.cs" />
|
||||||
|
<Compile Include="Comm and IR\ConsoleCommMockDevice.cs" />
|
||||||
|
<Compile Include="Comm and IR\GenericComm.cs" />
|
||||||
|
<Compile Include="Comm and IR\GenericHttpClient.cs" />
|
||||||
|
<Compile Include="Comm and IR\IRPortHelper.cs" />
|
||||||
<Compile Include="Config\Essentials\ConfigUpdater.cs" />
|
<Compile Include="Config\Essentials\ConfigUpdater.cs" />
|
||||||
<Compile Include="Config\Essentials\ConfigReader.cs" />
|
<Compile Include="Config\Essentials\ConfigReader.cs" />
|
||||||
<Compile Include="Config\Essentials\ConfigWriter.cs" />
|
<Compile Include="Config\Essentials\ConfigWriter.cs" />
|
||||||
|
|
@ -176,6 +188,8 @@
|
||||||
<Compile Include="Fusion\FusionEventHandlers.cs" />
|
<Compile Include="Fusion\FusionEventHandlers.cs" />
|
||||||
<Compile Include="Fusion\FusionProcessorQueries.cs" />
|
<Compile Include="Fusion\FusionProcessorQueries.cs" />
|
||||||
<Compile Include="Fusion\FusionRviDataClasses.cs" />
|
<Compile Include="Fusion\FusionRviDataClasses.cs" />
|
||||||
|
<Compile Include="Gateways\CenRfgwController.cs" />
|
||||||
|
<Compile Include="Gateways\EssentialsRfGatewayConfig.cs" />
|
||||||
<Compile Include="Global\JobTimer.cs" />
|
<Compile Include="Global\JobTimer.cs" />
|
||||||
<Compile Include="Global\Scheduler.cs" />
|
<Compile Include="Global\Scheduler.cs" />
|
||||||
<Compile Include="JoinMaps\JoinMapBase.cs" />
|
<Compile Include="JoinMaps\JoinMapBase.cs" />
|
||||||
|
|
@ -188,11 +202,6 @@
|
||||||
<Compile Include="Presets\PresetBase.cs" />
|
<Compile Include="Presets\PresetBase.cs" />
|
||||||
<Compile Include="Plugins\IPluginDeviceFactory.cs" />
|
<Compile Include="Plugins\IPluginDeviceFactory.cs" />
|
||||||
<Compile Include="Ramps and Increments\ActionIncrementer.cs" />
|
<Compile Include="Ramps and Increments\ActionIncrementer.cs" />
|
||||||
<Compile Include="Config\Comm and IR\CommFactory.cs" />
|
|
||||||
<Compile Include="Config\Comm and IR\CommunicationExtras.cs" />
|
|
||||||
<Compile Include="Config\Comm and IR\ComSpecJsonConverter.cs" />
|
|
||||||
<Compile Include="Config\Comm and IR\ConsoleCommMockDevice.cs" />
|
|
||||||
<Compile Include="Config\Comm and IR\IRPortHelper.cs" />
|
|
||||||
<Compile Include="Config\BasicConfig.cs" />
|
<Compile Include="Config\BasicConfig.cs" />
|
||||||
<Compile Include="Config\ConfigPropertiesHelpers.cs" />
|
<Compile Include="Config\ConfigPropertiesHelpers.cs" />
|
||||||
<Compile Include="Config\InfoConfig.cs" />
|
<Compile Include="Config\InfoConfig.cs" />
|
||||||
|
|
@ -221,6 +230,9 @@
|
||||||
<Compile Include="Feedbacks\BoolFeedbackOneShot.cs" />
|
<Compile Include="Feedbacks\BoolFeedbackOneShot.cs" />
|
||||||
<Compile Include="Ramps and Increments\NumericalHelpers.cs" />
|
<Compile Include="Ramps and Increments\NumericalHelpers.cs" />
|
||||||
<Compile Include="Ramps and Increments\UshortSigIncrementer.cs" />
|
<Compile Include="Ramps and Increments\UshortSigIncrementer.cs" />
|
||||||
|
<Compile Include="Remotes\ButtonExtensions.cs" />
|
||||||
|
<Compile Include="Remotes\CrestronRemotePropertiesConfig.cs" />
|
||||||
|
<Compile Include="Remotes\Hrxx0WirelessRemoteController.cs" />
|
||||||
<Compile Include="Room\Behaviours\RoomOnToDefaultSourceWhenOccupied.cs" />
|
<Compile Include="Room\Behaviours\RoomOnToDefaultSourceWhenOccupied.cs" />
|
||||||
<Compile Include="Room\EssentialsRoomBase.cs" />
|
<Compile Include="Room\EssentialsRoomBase.cs" />
|
||||||
<Compile Include="Room\Interfaces.cs" />
|
<Compile Include="Room\Interfaces.cs" />
|
||||||
|
|
@ -276,7 +288,6 @@
|
||||||
<Compile Include="UI PageManagers\PageManager.cs" />
|
<Compile Include="UI PageManagers\PageManager.cs" />
|
||||||
<Compile Include="UI PageManagers\SetTopBoxTwoPanelPageManager.cs" />
|
<Compile Include="UI PageManagers\SetTopBoxTwoPanelPageManager.cs" />
|
||||||
<Compile Include="VideoStatus\VideoStatusOutputs.cs" />
|
<Compile Include="VideoStatus\VideoStatusOutputs.cs" />
|
||||||
<Compile Include="Config\Comm and IR\ComPortController.cs" />
|
|
||||||
<Compile Include="Crestron\CrestronGenericBaseDevice.cs" />
|
<Compile Include="Crestron\CrestronGenericBaseDevice.cs" />
|
||||||
<Compile Include="DeviceControlsParentInterfaces\IPresentationSource.cs" />
|
<Compile Include="DeviceControlsParentInterfaces\IPresentationSource.cs" />
|
||||||
<Compile Include="Devices\DeviceManager.cs" />
|
<Compile Include="Devices\DeviceManager.cs" />
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,47 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
using Crestron.SimplSharp;
|
||||||
|
using Crestron.SimplSharpPro;
|
||||||
|
using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
|
|
||||||
|
using PepperDash.Core;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Core
|
||||||
|
{
|
||||||
|
public static class ButtonExtensions
|
||||||
|
{
|
||||||
|
public static Button SetButtonAction(this Button button, Action<bool> a)
|
||||||
|
{
|
||||||
|
button.UserObject = a;
|
||||||
|
return button;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Button SetButtonAction(this CrestronCollection<Button> bc, uint sigNum, Action<bool> a)
|
||||||
|
{
|
||||||
|
return bc[sigNum].SetButtonAction(a);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static bool GetBool(this CrestronCollection<Button> bc, uint sigNum)
|
||||||
|
{
|
||||||
|
return bc[sigNum].State == eButtonState.Pressed ? true : false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Button SetButtonPressedAction(this CrestronCollection<Button> bc, uint sigNum, Action a)
|
||||||
|
{
|
||||||
|
return bc[sigNum].SetButtonAction(b => { if (b) a(); });
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Button SetButtonReleasedAction(this CrestronCollection<Button> bc, uint sigNum, Action a)
|
||||||
|
{
|
||||||
|
return bc[sigNum].SetButtonAction(b => { if (!b) a(); });
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Button SetButtonFalseAction(this Button button, Action a)
|
||||||
|
{
|
||||||
|
return button.SetButtonAction(b => { if (!b) a(); });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,17 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Converters;
|
||||||
|
using PepperDash.Core;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Core
|
||||||
|
{
|
||||||
|
public class CrestronRemotePropertiesConfig
|
||||||
|
{
|
||||||
|
[JsonProperty("control")]
|
||||||
|
public EssentialsControlPropertiesConfig Control { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("gatewayDeviceKey")]
|
||||||
|
public string GatewayDeviceKey { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,245 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using Crestron.SimplSharp;
|
||||||
|
using Crestron.SimplSharpPro;
|
||||||
|
using Crestron.SimplSharpPro.Gateways;
|
||||||
|
using Crestron.SimplSharpPro.Remotes;
|
||||||
|
using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
|
using Crestron.SimplSharp.Reflection;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
|
|
||||||
|
using PepperDash.Core;
|
||||||
|
using PepperDash.Essentials.Core;
|
||||||
|
using PepperDash.Essentials.Core.Config;
|
||||||
|
using PepperDash.Essentials.Core.Bridges;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Core
|
||||||
|
{
|
||||||
|
[Description("Wrapper class for all HR-Series remotes")]
|
||||||
|
public class Hrxx0WirelessRemoteController : EssentialsBridgeableDevice, IHasFeedback
|
||||||
|
{
|
||||||
|
private Hr1x0WirelessRemoteBase _remote;
|
||||||
|
|
||||||
|
public FeedbackCollection<Feedback> Feedbacks { get; set; }
|
||||||
|
|
||||||
|
public CrestronCollection<Button> Buttons { get { return _remote.Button; } }
|
||||||
|
|
||||||
|
public Hrxx0WirelessRemoteController(string key, Func<DeviceConfig, Hr1x0WirelessRemoteBase> preActivationFunc,
|
||||||
|
DeviceConfig config)
|
||||||
|
: base(key, config.Name)
|
||||||
|
{
|
||||||
|
Feedbacks = new FeedbackCollection<Feedback>();
|
||||||
|
|
||||||
|
AddPreActivationAction(() =>
|
||||||
|
{
|
||||||
|
_remote = preActivationFunc(config);
|
||||||
|
|
||||||
|
_remote.ButtonStateChange += new ButtonEventHandler(_remote_ButtonStateChange);
|
||||||
|
|
||||||
|
Feedbacks.Add(new BoolFeedback("BatteryCritical", () => _remote.BatteryCriticalFeedback.BoolValue));
|
||||||
|
Feedbacks.Add(new BoolFeedback("BatteryLow", () => _remote.BatteryLowFeedback.BoolValue));
|
||||||
|
Feedbacks.Add(new IntFeedback("BatteryVoltage", () => _remote.BatteryVoltageFeedback.UShortValue));
|
||||||
|
|
||||||
|
_remote.BaseEvent += new BaseEventHandler(_remote_BaseEvent);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
void _remote_BaseEvent(GenericBase device, BaseEventArgs args)
|
||||||
|
{
|
||||||
|
if(args.EventId == Hr1x0EventIds.BatteryCriticalFeedbackEventId)
|
||||||
|
Feedbacks["BatteryCritical"].FireUpdate();
|
||||||
|
if(args.EventId == Hr1x0EventIds.BatteryLowFeedbackEventId)
|
||||||
|
Feedbacks["BatteryLow"].FireUpdate();
|
||||||
|
if(args.EventId == Hr1x0EventIds.BatteryVoltageFeedbackEventId)
|
||||||
|
Feedbacks["BatteryVoltage"].FireUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
|
void _remote_ButtonStateChange(GenericBase device, ButtonEventArgs args)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var handler = args.Button.UserObject;
|
||||||
|
|
||||||
|
if (handler == null) return;
|
||||||
|
|
||||||
|
Debug.Console(1, this, "Executing Action: {0}", handler.ToString());
|
||||||
|
|
||||||
|
if (handler is Action<bool>)
|
||||||
|
{
|
||||||
|
(handler as Action<bool>)(args.Button.State == eButtonState.Pressed ? true : false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Debug.Console(2, this, "Error in ButtonStateChange handler: {0}", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#region Preactivation
|
||||||
|
|
||||||
|
private static Hr1x0WirelessRemoteBase GetHr1x0WirelessRemote(DeviceConfig config)
|
||||||
|
{
|
||||||
|
var props = JsonConvert.DeserializeObject<CrestronRemotePropertiesConfig>(config.Properties.ToString());
|
||||||
|
|
||||||
|
var type = config.Type;
|
||||||
|
var rfId = (uint)props.Control.InfinetIdInt;
|
||||||
|
|
||||||
|
GatewayBase gateway;
|
||||||
|
|
||||||
|
if (props.GatewayDeviceKey == "processor")
|
||||||
|
{
|
||||||
|
gateway = Global.ControlSystem.ControllerRFGatewayDevice;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var gatewayDev = DeviceManager.GetDeviceForKey(props.GatewayDeviceKey) as CenRfgwController;
|
||||||
|
if (gatewayDev == null)
|
||||||
|
{
|
||||||
|
Debug.Console(0, "GetHr1x0WirelessRemote: Device '{0}' is not a valid device", props.GatewayDeviceKey);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
Debug.Console(0, "GetHr1x0WirelessRemote: Device '{0}' is a valid device", props.GatewayDeviceKey);
|
||||||
|
gateway = gatewayDev.GateWay;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (gateway == null)
|
||||||
|
{
|
||||||
|
Debug.Console(0, "GetHr1x0WirelessRemote: Device '{0}' is not a valid gateway", props.GatewayDeviceKey);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (type)
|
||||||
|
{
|
||||||
|
case ("hr100"):
|
||||||
|
return new Hr100(rfId, gateway);
|
||||||
|
case ("hr150"):
|
||||||
|
return new Hr150(rfId, gateway);
|
||||||
|
case ("hr310"):
|
||||||
|
return new Hr310(rfId, gateway);
|
||||||
|
default:
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void gateway_BaseEvent(GenericBase device, BaseEventArgs args)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Factory
|
||||||
|
public class Hrxx0WirelessRemoteControllerFactory : EssentialsDeviceFactory<Hrxx0WirelessRemoteController>
|
||||||
|
{
|
||||||
|
public Hrxx0WirelessRemoteControllerFactory()
|
||||||
|
{
|
||||||
|
TypeNames = new List<string>() { "hr100", "hr150", "hr310" };
|
||||||
|
}
|
||||||
|
|
||||||
|
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||||
|
{
|
||||||
|
Debug.Console(1, "Factory Attempting to create new HR-x00 Remote Device");
|
||||||
|
|
||||||
|
return new Hrxx0WirelessRemoteController(dc.Key, GetHr1x0WirelessRemote, dc);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
||||||
|
{
|
||||||
|
var joinMap = new Hrxxx0WirelessRemoteControllerJoinMap(joinStart);
|
||||||
|
|
||||||
|
var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(joinMapSerialized))
|
||||||
|
joinMap = JsonConvert.DeserializeObject<Hrxxx0WirelessRemoteControllerJoinMap>(joinMapSerialized);
|
||||||
|
|
||||||
|
bridge.AddJoinMap(Key, joinMap);
|
||||||
|
|
||||||
|
//List<string> ExcludedKeys = new List<string>();
|
||||||
|
foreach (var feedback in Feedbacks)
|
||||||
|
{
|
||||||
|
var myFeedback = feedback;
|
||||||
|
|
||||||
|
var joinData =
|
||||||
|
joinMap.Joins.FirstOrDefault(
|
||||||
|
x =>
|
||||||
|
x.Key.Equals(myFeedback.Key, StringComparison.InvariantCultureIgnoreCase));
|
||||||
|
|
||||||
|
if (string.IsNullOrEmpty((joinData.Key))) continue;
|
||||||
|
|
||||||
|
var name = joinData.Key;
|
||||||
|
var join = joinData.Value;
|
||||||
|
|
||||||
|
if (join.Metadata.JoinType == eJoinType.Digital)
|
||||||
|
{
|
||||||
|
Debug.Console(0, this, "Linking Bool Feedback '{0}' to join {1}", name, join.JoinNumber);
|
||||||
|
var someFeedback = myFeedback as BoolFeedback;
|
||||||
|
if(someFeedback == null) continue;
|
||||||
|
someFeedback.LinkInputSig(trilist.BooleanInput[join.JoinNumber]);
|
||||||
|
}
|
||||||
|
if (join.Metadata.JoinType == eJoinType.Analog)
|
||||||
|
{
|
||||||
|
Debug.Console(0, this, "Linking Analog Feedback '{0}' to join {1}", name, join.JoinNumber);
|
||||||
|
var someFeedback = myFeedback as IntFeedback;
|
||||||
|
if (someFeedback == null) continue;
|
||||||
|
someFeedback.LinkInputSig(trilist.UShortInput[join.JoinNumber]);
|
||||||
|
}
|
||||||
|
if (join.Metadata.JoinType == eJoinType.Serial)
|
||||||
|
{
|
||||||
|
Debug.Console(0, this, "Linking Serial Feedback '{0}' to join {1}", name, join.JoinNumber);
|
||||||
|
var someFeedback = myFeedback as StringFeedback;
|
||||||
|
if (someFeedback == null) continue;
|
||||||
|
someFeedback.LinkInputSig(trilist.StringInput[join.JoinNumber]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//var newJoinKeys = joinMap.Joins.Keys.Except(ExcludedKeys).ToList();
|
||||||
|
|
||||||
|
//var newJoinMap = newJoinKeys.Where(k => joinMap.Joins.ContainsKey(k)).Select(k => joinMap.Joins[k]);
|
||||||
|
|
||||||
|
|
||||||
|
Debug.Console(2, this, "There are {0} remote buttons", _remote.Button.Count);
|
||||||
|
for (uint i = 1; i <= _remote.Button.Count; i++)
|
||||||
|
{
|
||||||
|
Debug.Console(2, this, "Attempting to link join index {0}", i);
|
||||||
|
var index = i;
|
||||||
|
var joinData =
|
||||||
|
joinMap.Joins.FirstOrDefault(
|
||||||
|
o =>
|
||||||
|
o.Key.Equals(_remote.Button[index].Name.ToString(),
|
||||||
|
StringComparison.InvariantCultureIgnoreCase));
|
||||||
|
|
||||||
|
if (string.IsNullOrEmpty((joinData.Key))) continue;
|
||||||
|
|
||||||
|
var join = joinData.Value;
|
||||||
|
var name = joinData.Key;
|
||||||
|
|
||||||
|
Debug.Console(2, this, "Setting User Object for '{0}'", name);
|
||||||
|
if (join.Metadata.JoinType == eJoinType.Digital)
|
||||||
|
{
|
||||||
|
_remote.Button[i].SetButtonAction((b) => trilist.BooleanInput[join.JoinNumber].BoolValue = b);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
trilist.OnlineStatusChange += (d, args) =>
|
||||||
|
{
|
||||||
|
if (!args.DeviceOnLine) return;
|
||||||
|
|
||||||
|
foreach (var feedback in Feedbacks)
|
||||||
|
{
|
||||||
|
feedback.FireUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
}
|
||||||
|
public void SetTrilistBool(BasicTriList trilist, uint join, bool b)
|
||||||
|
{
|
||||||
|
trilist.BooleanInput[join].BoolValue = b;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -22,7 +22,7 @@ namespace PepperDash.Essentials.Core
|
||||||
/// and then attempts a new Route and if sucessful, stores that RouteDescriptor
|
/// and then attempts a new Route and if sucessful, stores that RouteDescriptor
|
||||||
/// in RouteDescriptorCollection.DefaultCollection
|
/// in RouteDescriptorCollection.DefaultCollection
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static void ReleaseAndMakeRoute(this IRoutingInputs destination, IRoutingOutputs source, eRoutingSignalType signalType)
|
public static void ReleaseAndMakeRoute(this IRoutingSink destination, IRoutingOutputs source, eRoutingSignalType signalType)
|
||||||
{
|
{
|
||||||
destination.ReleaseRoute();
|
destination.ReleaseRoute();
|
||||||
|
|
||||||
|
|
@ -39,7 +39,7 @@ namespace PepperDash.Essentials.Core
|
||||||
/// RouteDescriptorCollection.DefaultCollection
|
/// RouteDescriptorCollection.DefaultCollection
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="destination"></param>
|
/// <param name="destination"></param>
|
||||||
public static void ReleaseRoute(this IRoutingInputs destination)
|
public static void ReleaseRoute(this IRoutingSink destination)
|
||||||
{
|
{
|
||||||
var current = RouteDescriptorCollection.DefaultCollection.RemoveRouteDescriptor(destination);
|
var current = RouteDescriptorCollection.DefaultCollection.RemoveRouteDescriptor(destination);
|
||||||
if (current != null)
|
if (current != null)
|
||||||
|
|
@ -56,7 +56,7 @@ namespace PepperDash.Essentials.Core
|
||||||
/// of an audio/video route are discovered a route descriptor is returned. If no route is
|
/// of an audio/video route are discovered a route descriptor is returned. If no route is
|
||||||
/// discovered, then null is returned
|
/// discovered, then null is returned
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static RouteDescriptor GetRouteToSource(this IRoutingInputs destination, IRoutingOutputs source, eRoutingSignalType signalType)
|
public static RouteDescriptor GetRouteToSource(this IRoutingSink destination, IRoutingOutputs source, eRoutingSignalType signalType)
|
||||||
{
|
{
|
||||||
var routeDescr = new RouteDescriptor(source, destination, signalType);
|
var routeDescr = new RouteDescriptor(source, destination, signalType);
|
||||||
// if it's a single signal type, find the route
|
// if it's a single signal type, find the route
|
||||||
|
|
@ -265,8 +265,14 @@ namespace PepperDash.Essentials.Core
|
||||||
foreach (var route in Routes)
|
foreach (var route in Routes)
|
||||||
{
|
{
|
||||||
Debug.Console(2, "ExecuteRoutes: {0}", route.ToString());
|
Debug.Console(2, "ExecuteRoutes: {0}", route.ToString());
|
||||||
if (route.SwitchingDevice is IRoutingSinkWithSwitching)
|
if (route.SwitchingDevice is IRoutingSink)
|
||||||
(route.SwitchingDevice as IRoutingSinkWithSwitching).ExecuteSwitch(route.InputPort.Selector);
|
{
|
||||||
|
var device = route.SwitchingDevice as IRoutingSinkWithSwitching;
|
||||||
|
if (device == null)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
device.ExecuteSwitch(route.InputPort.Selector);
|
||||||
|
}
|
||||||
else if (route.SwitchingDevice is IRouting)
|
else if (route.SwitchingDevice is IRouting)
|
||||||
{
|
{
|
||||||
(route.SwitchingDevice as IRouting).ExecuteSwitch(route.InputPort.Selector, route.OutputPort.Selector, SignalType);
|
(route.SwitchingDevice as IRouting).ExecuteSwitch(route.InputPort.Selector, route.OutputPort.Selector, SignalType);
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,16 @@ namespace PepperDash.Essentials.Core
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// For fixed-source endpoint devices
|
/// For fixed-source endpoint devices
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IRoutingSinkNoSwitching : IRoutingInputs, IHasCurrentSourceInfoChange
|
public interface IRoutingSink : IRoutingInputs, IHasCurrentSourceInfoChange
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// For fixed-source endpoint devices
|
||||||
|
/// </summary>
|
||||||
|
[Obsolete]
|
||||||
|
public interface IRoutingSinkNoSwitching : IRoutingSink
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -59,7 +68,7 @@ namespace PepperDash.Essentials.Core
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Endpoint device like a display, that selects inputs
|
/// Endpoint device like a display, that selects inputs
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IRoutingSinkWithSwitching : IRoutingSinkNoSwitching, IHasCurrentSourceInfoChange
|
public interface IRoutingSinkWithSwitching : IRoutingSink
|
||||||
{
|
{
|
||||||
//void ClearRoute();
|
//void ClearRoute();
|
||||||
void ExecuteSwitch(object inputSelector);
|
void ExecuteSwitch(object inputSelector);
|
||||||
|
|
@ -80,24 +89,26 @@ namespace PepperDash.Essentials.Core
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IRouting : IRoutingInputsOutputs
|
public interface IRouting : IRoutingInputsOutputs
|
||||||
{
|
{
|
||||||
//void ClearRoute(object outputSelector);
|
|
||||||
void ExecuteSwitch(object inputSelector, object outputSelector, eRoutingSignalType signalType);
|
void ExecuteSwitch(object inputSelector, object outputSelector, eRoutingSignalType signalType);
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface ITxRouting : IRouting
|
public interface IRoutingNumeric : IRouting
|
||||||
|
{
|
||||||
|
void ExecuteNumericSwitch(ushort input, ushort output, eRoutingSignalType type);
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface ITxRouting : IRoutingNumeric
|
||||||
{
|
{
|
||||||
IntFeedback VideoSourceNumericFeedback { get; }
|
IntFeedback VideoSourceNumericFeedback { get; }
|
||||||
IntFeedback AudioSourceNumericFeedback { get; }
|
IntFeedback AudioSourceNumericFeedback { get; }
|
||||||
void ExecuteNumericSwitch(ushort input, ushort output, eRoutingSignalType type);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Defines a receiver that has internal routing (DM-RMC-4K-Z-SCALER-C)
|
/// Defines a receiver that has internal routing (DM-RMC-4K-Z-SCALER-C)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IRmcRouting : IRouting
|
public interface IRmcRouting : IRoutingNumeric
|
||||||
{
|
{
|
||||||
IntFeedback AudioVideoSourceNumericFeedback { get; }
|
IntFeedback AudioVideoSourceNumericFeedback { get; }
|
||||||
void ExecuteNumericSwitch(ushort input, ushort output, eRoutingSignalType type);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,8 @@ using PepperDash.Essentials.Core.Config;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.DM.AirMedia
|
namespace PepperDash.Essentials.DM.AirMedia
|
||||||
{
|
{
|
||||||
public class AirMediaController : CrestronGenericBridgeableBaseDevice, IRoutingInputsOutputs, IIROutputPorts, IComPorts
|
[Description("Wrapper class for an AM-200 or AM-300")]
|
||||||
|
public class AirMediaController : CrestronGenericBridgeableBaseDevice, IRoutingNumeric, IIROutputPorts, IComPorts
|
||||||
{
|
{
|
||||||
public AmX00 AirMedia { get; private set; }
|
public AmX00 AirMedia { get; private set; }
|
||||||
|
|
||||||
|
|
@ -40,7 +41,7 @@ namespace PepperDash.Essentials.DM.AirMedia
|
||||||
public BoolFeedback AutomaticInputRoutingEnabledFeedback { get; private set; }
|
public BoolFeedback AutomaticInputRoutingEnabledFeedback { get; private set; }
|
||||||
|
|
||||||
public AirMediaController(string key, string name, AmX00 device, DeviceConfig dc, AirMediaPropertiesConfig props)
|
public AirMediaController(string key, string name, AmX00 device, DeviceConfig dc, AirMediaPropertiesConfig props)
|
||||||
:base(key, name, device)
|
: base(key, name, device)
|
||||||
{
|
{
|
||||||
AirMedia = device;
|
AirMedia = device;
|
||||||
|
|
||||||
|
|
@ -51,27 +52,30 @@ namespace PepperDash.Essentials.DM.AirMedia
|
||||||
InputPorts = new RoutingPortCollection<RoutingInputPort>();
|
InputPorts = new RoutingPortCollection<RoutingInputPort>();
|
||||||
OutputPorts = new RoutingPortCollection<RoutingOutputPort>();
|
OutputPorts = new RoutingPortCollection<RoutingOutputPort>();
|
||||||
|
|
||||||
InputPorts.Add(new RoutingInputPort(DmPortName.Osd, eRoutingSignalType.Audio | eRoutingSignalType.Video,
|
InputPorts.Add(new RoutingInputPort(DmPortName.Osd, eRoutingSignalType.AudioVideo,
|
||||||
eRoutingPortConnectionType.None, new Action(SelectPinPointUxLandingPage), this));
|
eRoutingPortConnectionType.None, new Action(SelectPinPointUxLandingPage), this));
|
||||||
|
|
||||||
InputPorts.Add(new RoutingInputPort(DmPortName.AirMediaIn, eRoutingSignalType.Audio | eRoutingSignalType.Video,
|
InputPorts.Add(new RoutingInputPort(DmPortName.AirMediaIn, eRoutingSignalType.AudioVideo,
|
||||||
eRoutingPortConnectionType.Streaming, new Action(SelectAirMedia), this));
|
eRoutingPortConnectionType.Streaming, new Action(SelectAirMedia), this));
|
||||||
|
|
||||||
InputPorts.Add(new RoutingInputPort(DmPortName.HdmiIn, eRoutingSignalType.Audio | eRoutingSignalType.Video,
|
InputPorts.Add(new RoutingInputPort(DmPortName.HdmiIn, eRoutingSignalType.AudioVideo,
|
||||||
eRoutingPortConnectionType.Hdmi, new Action(SelectHdmiIn), this));
|
eRoutingPortConnectionType.Hdmi, new Action(SelectHdmiIn), this));
|
||||||
|
|
||||||
InputPorts.Add(new RoutingInputPort(DmPortName.AirBoardIn, eRoutingSignalType.Video,
|
InputPorts.Add(new RoutingInputPort(DmPortName.AirBoardIn, eRoutingSignalType.AudioVideo,
|
||||||
eRoutingPortConnectionType.None, new Action(SelectAirboardIn), this));
|
eRoutingPortConnectionType.None, new Action(SelectAirboardIn), this));
|
||||||
|
|
||||||
if (AirMedia is Am300)
|
if (AirMedia is Am300)
|
||||||
{
|
{
|
||||||
InputPorts.Add(new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.Audio | eRoutingSignalType.Video,
|
InputPorts.Add(new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.AudioVideo,
|
||||||
eRoutingPortConnectionType.DmCat, new Action(SelectDmIn), this));
|
eRoutingPortConnectionType.DmCat, new Action(SelectDmIn), this));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
OutputPorts.Add(new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.AudioVideo,
|
||||||
|
eRoutingPortConnectionType.Hdmi, null, this));
|
||||||
|
|
||||||
AirMedia.AirMedia.AirMediaChange += new Crestron.SimplSharpPro.DeviceSupport.GenericEventHandler(AirMedia_AirMediaChange);
|
AirMedia.AirMedia.AirMediaChange += new Crestron.SimplSharpPro.DeviceSupport.GenericEventHandler(AirMedia_AirMediaChange);
|
||||||
|
|
||||||
IsInSessionFeedback = new BoolFeedback( new Func<bool>(() => AirMedia.AirMedia.StatusFeedback.UShortValue == 0 ));
|
IsInSessionFeedback = new BoolFeedback(new Func<bool>(() => AirMedia.AirMedia.StatusFeedback.UShortValue == 0));
|
||||||
ErrorFeedback = new IntFeedback(new Func<int>(() => AirMedia.AirMedia.ErrorFeedback.UShortValue));
|
ErrorFeedback = new IntFeedback(new Func<int>(() => AirMedia.AirMedia.ErrorFeedback.UShortValue));
|
||||||
NumberOfUsersConnectedFeedback = new IntFeedback(new Func<int>(() => AirMedia.AirMedia.NumberOfUsersConnectedFeedback.UShortValue));
|
NumberOfUsersConnectedFeedback = new IntFeedback(new Func<int>(() => AirMedia.AirMedia.NumberOfUsersConnectedFeedback.UShortValue));
|
||||||
LoginCodeFeedback = new IntFeedback(new Func<int>(() => AirMedia.AirMedia.LoginCodeFeedback.UShortValue));
|
LoginCodeFeedback = new IntFeedback(new Func<int>(() => AirMedia.AirMedia.LoginCodeFeedback.UShortValue));
|
||||||
|
|
@ -202,7 +206,7 @@ namespace PepperDash.Essentials.DM.AirMedia
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void SelectDmIn()
|
public void SelectDmIn()
|
||||||
{
|
{
|
||||||
AirMedia.DisplayControl.VideoOut = AmX00DisplayControl.eAirMediaX00VideoSource.HDMI;
|
AirMedia.DisplayControl.VideoOut = AmX00DisplayControl.eAirMediaX00VideoSource.DM;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -210,7 +214,7 @@ namespace PepperDash.Essentials.DM.AirMedia
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void SelectHdmiIn()
|
public void SelectHdmiIn()
|
||||||
{
|
{
|
||||||
AirMedia.DisplayControl.VideoOut = AmX00DisplayControl.eAirMediaX00VideoSource.DM;
|
AirMedia.DisplayControl.VideoOut = AmX00DisplayControl.eAirMediaX00VideoSource.HDMI;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SelectAirboardIn()
|
public void SelectAirboardIn()
|
||||||
|
|
@ -259,6 +263,33 @@ namespace PepperDash.Essentials.DM.AirMedia
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#region IRoutingNumeric Members
|
||||||
|
|
||||||
|
public void ExecuteNumericSwitch(ushort input, ushort output, eRoutingSignalType signalType)
|
||||||
|
{
|
||||||
|
if ((signalType & eRoutingSignalType.Video) != eRoutingSignalType.Video) return;
|
||||||
|
if (!Enum.IsDefined(typeof (AmX00DisplayControl.eAirMediaX00VideoSource), input))
|
||||||
|
{
|
||||||
|
Debug.Console(2, this, "Invalid Video Source Index : {0}", input);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
AirMedia.DisplayControl.VideoOut = (AmX00DisplayControl.eAirMediaX00VideoSource) input;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region IRouting Members
|
||||||
|
|
||||||
|
public void ExecuteSwitch(object inputSelector, object outputSelector, eRoutingSignalType signalType)
|
||||||
|
{
|
||||||
|
Debug.Console(2, this, "Input Selector = {0}", inputSelector.ToString());
|
||||||
|
var handler = inputSelector as Action;
|
||||||
|
if (handler == null) return;
|
||||||
|
handler();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
public class AirMediaControllerFactory : EssentialsDeviceFactory<AirMediaController>
|
public class AirMediaControllerFactory : EssentialsDeviceFactory<AirMediaController>
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,8 @@ 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, IDmSwitch, IRoutingInputsOutputs, IRouting, IHasFeedback {
|
public class DmBladeChassisController : CrestronGenericBridgeableBaseDevice, IDmSwitch, IRoutingNumeric
|
||||||
|
{
|
||||||
public DMChassisPropertiesConfig PropertiesConfig { get; set; }
|
public DMChassisPropertiesConfig PropertiesConfig { get; set; }
|
||||||
|
|
||||||
public Switch Chassis { get; private set; }
|
public Switch Chassis { get; private set; }
|
||||||
|
|
@ -563,14 +564,23 @@ namespace PepperDash.Essentials.DM {
|
||||||
var outCard = input == 0 ? null : Chassis.Outputs[output];
|
var outCard = input == 0 ? null : Chassis.Outputs[output];
|
||||||
|
|
||||||
// NOTE THAT BITWISE COMPARISONS - TO CATCH ALL ROUTING TYPES
|
// NOTE THAT BITWISE COMPARISONS - TO CATCH ALL ROUTING TYPES
|
||||||
if ((sigType | eRoutingSignalType.Video) == eRoutingSignalType.Video) {
|
if ((sigType | eRoutingSignalType.Video) != eRoutingSignalType.Video) return;
|
||||||
Chassis.VideoEnter.BoolValue = true;
|
Chassis.VideoEnter.BoolValue = true;
|
||||||
Chassis.Outputs[output].VideoOut = inCard;
|
Chassis.Outputs[output].VideoOut = inCard;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region IRoutingNumeric Members
|
||||||
|
|
||||||
|
public void ExecuteNumericSwitch(ushort inputSelector, ushort outputSelector, eRoutingSignalType sigType)
|
||||||
|
{
|
||||||
|
ExecuteSwitch(inputSelector, outputSelector, sigType);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
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 = new DmBladeChassisControllerJoinMap(joinStart);
|
var joinMap = new DmBladeChassisControllerJoinMap(joinStart);
|
||||||
|
|
@ -808,6 +818,7 @@ namespace PepperDash.Essentials.DM {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
|
using Crestron.SimplSharpPro;
|
||||||
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;
|
||||||
|
|
@ -20,7 +21,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, IDmSwitch, IRoutingInputsOutputs, IRouting, IHasFeedback
|
public class DmChassisController : CrestronGenericBridgeableBaseDevice, IDmSwitch, IRoutingNumeric
|
||||||
{
|
{
|
||||||
public DMChassisPropertiesConfig PropertiesConfig { get; set; }
|
public DMChassisPropertiesConfig PropertiesConfig { get; set; }
|
||||||
|
|
||||||
|
|
@ -42,6 +43,8 @@ namespace PepperDash.Essentials.DM
|
||||||
|
|
||||||
public IntFeedback SystemIdFeebdack { get; private set; }
|
public IntFeedback SystemIdFeebdack { get; private set; }
|
||||||
public BoolFeedback SystemIdBusyFeedback { get; private set; }
|
public BoolFeedback SystemIdBusyFeedback { get; private set; }
|
||||||
|
public BoolFeedback EnableAudioBreakawayFeedback { get; private set; }
|
||||||
|
public BoolFeedback EnableUsbBreakawayFeedback { get; private set; }
|
||||||
|
|
||||||
public Dictionary<uint, IntFeedback> InputCardHdcpCapabilityFeedbacks { get; private set; }
|
public Dictionary<uint, IntFeedback> InputCardHdcpCapabilityFeedbacks { get; private set; }
|
||||||
|
|
||||||
|
|
@ -210,6 +213,11 @@ namespace PepperDash.Essentials.DM
|
||||||
|
|
||||||
SystemIdFeebdack = new IntFeedback(() => { return (Chassis as DmMDMnxn).SystemIdFeedback.UShortValue; });
|
SystemIdFeebdack = new IntFeedback(() => { return (Chassis as DmMDMnxn).SystemIdFeedback.UShortValue; });
|
||||||
SystemIdBusyFeedback = new BoolFeedback(() => { return (Chassis as DmMDMnxn).SystemIdBusy.BoolValue; });
|
SystemIdBusyFeedback = new BoolFeedback(() => { return (Chassis as DmMDMnxn).SystemIdBusy.BoolValue; });
|
||||||
|
EnableAudioBreakawayFeedback =
|
||||||
|
new BoolFeedback(() => (Chassis as DmMDMnxn).EnableAudioBreakawayFeedback.BoolValue);
|
||||||
|
EnableUsbBreakawayFeedback =
|
||||||
|
new BoolFeedback(() => (Chassis as DmMDMnxn).EnableUSBBreakawayFeedback.BoolValue);
|
||||||
|
|
||||||
InputCardHdcpCapabilityFeedbacks = new Dictionary<uint, IntFeedback>();
|
InputCardHdcpCapabilityFeedbacks = new Dictionary<uint, IntFeedback>();
|
||||||
InputCardHdcpCapabilityTypes = new Dictionary<uint, eHdcpCapabilityType>();
|
InputCardHdcpCapabilityTypes = new Dictionary<uint, eHdcpCapabilityType>();
|
||||||
|
|
||||||
|
|
@ -376,6 +384,11 @@ namespace PepperDash.Essentials.DM
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void ChassisOnBaseEvent(GenericBase device, BaseEventArgs args)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -768,6 +781,20 @@ namespace PepperDash.Essentials.DM
|
||||||
SystemIdBusyFeedback.FireUpdate();
|
SystemIdBusyFeedback.FireUpdate();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case DMSystemEventIds.AudioBreakawayEventId:
|
||||||
|
{
|
||||||
|
Debug.Console(2, this, "AudioBreakaway Event: value: {0}",
|
||||||
|
(Chassis as DmMDMnxn).EnableAudioBreakawayFeedback.BoolValue);
|
||||||
|
EnableAudioBreakawayFeedback.FireUpdate();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case DMSystemEventIds.USBBreakawayEventId:
|
||||||
|
{
|
||||||
|
Debug.Console(2, this, "USBBreakaway Event: value: {0}",
|
||||||
|
(Chassis as DmMDMnxn).EnableUSBBreakawayFeedback.BoolValue);
|
||||||
|
EnableUsbBreakawayFeedback.FireUpdate();
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -927,6 +954,10 @@ namespace PepperDash.Essentials.DM
|
||||||
(Chassis as DmMDMnxn).EnableAudioBreakaway.BoolValue = true;
|
(Chassis as DmMDMnxn).EnableAudioBreakaway.BoolValue = true;
|
||||||
(Chassis as DmMDMnxn).EnableUSBBreakaway.BoolValue = true;
|
(Chassis as DmMDMnxn).EnableUSBBreakaway.BoolValue = true;
|
||||||
|
|
||||||
|
|
||||||
|
EnableAudioBreakawayFeedback.FireUpdate();
|
||||||
|
EnableUsbBreakawayFeedback.FireUpdate();
|
||||||
|
|
||||||
if (InputNames != null)
|
if (InputNames != null)
|
||||||
foreach (var kvp in InputNames)
|
foreach (var kvp in InputNames)
|
||||||
Chassis.Inputs[kvp.Key].Name.StringValue = kvp.Value;
|
Chassis.Inputs[kvp.Key].Name.StringValue = kvp.Value;
|
||||||
|
|
@ -944,6 +975,10 @@ namespace PepperDash.Essentials.DM
|
||||||
var input = Convert.ToUInt32(inputSelector); // Cast can sometimes fail
|
var input = Convert.ToUInt32(inputSelector); // Cast can sometimes fail
|
||||||
var output = Convert.ToUInt32(outputSelector);
|
var output = Convert.ToUInt32(outputSelector);
|
||||||
|
|
||||||
|
var chassisSize = (uint) Chassis.NumberOfInputs; //need this to determine USB routing values 8x8 -> 1-8 is inputs 1-8, 17-24 is outputs 1-8
|
||||||
|
//16x16 1-16 is inputs 1-16, 17-32 is outputs 1-16
|
||||||
|
//32x32 1-32 is inputs 1-32, 33-64 is outputs 1-32
|
||||||
|
|
||||||
// Check to see if there's an off timer waiting on this and if so, cancel
|
// Check to see if there's an off timer waiting on this and if so, cancel
|
||||||
var key = new PortNumberType(output, sigType);
|
var key = new PortNumberType(output, sigType);
|
||||||
if (input == 0)
|
if (input == 0)
|
||||||
|
|
@ -964,34 +999,110 @@ namespace PepperDash.Essentials.DM
|
||||||
var outCard = input == 0 ? null : Chassis.Outputs[output];
|
var outCard = input == 0 ? null : Chassis.Outputs[output];
|
||||||
|
|
||||||
// NOTE THAT BITWISE COMPARISONS - TO CATCH ALL ROUTING TYPES
|
// NOTE THAT BITWISE COMPARISONS - TO CATCH ALL ROUTING TYPES
|
||||||
if ((sigType | eRoutingSignalType.Video) == eRoutingSignalType.Video)
|
if ((sigType & eRoutingSignalType.Video) == eRoutingSignalType.Video)
|
||||||
{
|
{
|
||||||
Chassis.VideoEnter.BoolValue = true;
|
Chassis.VideoEnter.BoolValue = true;
|
||||||
Chassis.Outputs[output].VideoOut = inCard;
|
Chassis.Outputs[output].VideoOut = inCard;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((sigType | eRoutingSignalType.Audio) == eRoutingSignalType.Audio)
|
if ((sigType & eRoutingSignalType.Audio) == eRoutingSignalType.Audio)
|
||||||
{
|
{
|
||||||
(Chassis as DmMDMnxn).AudioEnter.BoolValue = true;
|
(Chassis as DmMDMnxn).AudioEnter.BoolValue = true;
|
||||||
Chassis.Outputs[output].AudioOut = inCard;
|
Chassis.Outputs[output].AudioOut = inCard;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((sigType | eRoutingSignalType.UsbOutput) == eRoutingSignalType.UsbOutput)
|
if ((sigType & eRoutingSignalType.UsbOutput) == eRoutingSignalType.UsbOutput)
|
||||||
{
|
{
|
||||||
|
//using base here because USB can be routed between 2 output cards or 2 input cards
|
||||||
|
DMInputOutputBase dmCard;
|
||||||
|
|
||||||
|
Debug.Console(2, this, "Executing USB Output switch.\r\n in:{0} output: {1}", input, output);
|
||||||
|
|
||||||
|
if (input > chassisSize)
|
||||||
|
{
|
||||||
|
//wanting to route an output to an output. Subtract chassis size and get output, unless it's 8x8
|
||||||
|
//need this to determine USB routing values
|
||||||
|
//8x8 -> 1-8 is inputs 1-8, 17-24 is outputs 1-8
|
||||||
|
//16x16 1-16 is inputs 1-16, 17-32 is outputs 1-16
|
||||||
|
//32x32 1-32 is inputs 1-32, 33-64 is outputs 1-32
|
||||||
|
uint outputIndex;
|
||||||
|
|
||||||
|
if (chassisSize == 8)
|
||||||
|
{
|
||||||
|
outputIndex = input - 16;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
outputIndex = input - chassisSize;
|
||||||
|
}
|
||||||
|
dmCard = Chassis.Outputs[outputIndex];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dmCard = inCard;
|
||||||
|
}
|
||||||
Chassis.USBEnter.BoolValue = true;
|
Chassis.USBEnter.BoolValue = true;
|
||||||
if (Chassis.Outputs[output] != null)
|
if (Chassis.Outputs[output] != null)
|
||||||
Chassis.Outputs[output].USBRoutedTo = inCard;
|
{
|
||||||
|
Debug.Console(2, this, "Routing USB for input {0} to {1}", Chassis.Outputs[input], dmCard);
|
||||||
|
Chassis.Outputs[output].USBRoutedTo = dmCard;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((sigType | eRoutingSignalType.UsbInput) == eRoutingSignalType.UsbInput)
|
if ((sigType & eRoutingSignalType.UsbInput) == eRoutingSignalType.UsbInput)
|
||||||
{
|
{
|
||||||
|
//using base here because USB can be routed between 2 output cards or 2 input cards
|
||||||
|
DMInputOutputBase dmCard;
|
||||||
|
|
||||||
|
Debug.Console(2, this, "Executing USB Input switch.\r\n in:{0} output: {1}", input, output);
|
||||||
|
|
||||||
|
if (output > chassisSize)
|
||||||
|
{
|
||||||
|
//wanting to route an input to an output. Subtract chassis size and get output, unless it's 8x8
|
||||||
|
//need this to determine USB routing values
|
||||||
|
//8x8 -> 1-8 is inputs 1-8, 17-24 is outputs 1-8
|
||||||
|
//16x16 1-16 is inputs 1-16, 17-32 is outputs 1-16
|
||||||
|
//32x32 1-32 is inputs 1-32, 33-64 is outputs 1-32
|
||||||
|
uint outputIndex;
|
||||||
|
|
||||||
|
if (chassisSize == 8)
|
||||||
|
{
|
||||||
|
outputIndex = input - 16;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
outputIndex = input - chassisSize;
|
||||||
|
}
|
||||||
|
dmCard = Chassis.Outputs[outputIndex];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dmCard = Chassis.Inputs[input];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Chassis.USBEnter.BoolValue = true;
|
Chassis.USBEnter.BoolValue = true;
|
||||||
if (Chassis.Inputs[input] != null)
|
|
||||||
Chassis.Inputs[input].USBRoutedTo = outCard;
|
if (Chassis.Inputs[output] == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Debug.Console(2, this, "Routing USB for input {0} to {1}", Chassis.Inputs[output], dmCard);
|
||||||
|
Chassis.Inputs[output].USBRoutedTo = dmCard;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region IRoutingNumeric Members
|
||||||
|
|
||||||
|
public void ExecuteNumericSwitch(ushort inputSelector, ushort outputSelector, eRoutingSignalType sigType)
|
||||||
|
{
|
||||||
|
ExecuteSwitch(inputSelector, outputSelector, sigType);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
||||||
{
|
{
|
||||||
var joinMap = new DmChassisControllerJoinMap(joinStart);
|
var joinMap = new DmChassisControllerJoinMap(joinStart);
|
||||||
|
|
@ -1023,6 +1134,19 @@ namespace PepperDash.Essentials.DM
|
||||||
SystemIdFeebdack.LinkInputSig(trilist.UShortInput[joinMap.SystemId.JoinNumber]);
|
SystemIdFeebdack.LinkInputSig(trilist.UShortInput[joinMap.SystemId.JoinNumber]);
|
||||||
SystemIdBusyFeedback.LinkInputSig(trilist.BooleanInput[joinMap.SystemId.JoinNumber]);
|
SystemIdBusyFeedback.LinkInputSig(trilist.BooleanInput[joinMap.SystemId.JoinNumber]);
|
||||||
|
|
||||||
|
EnableAudioBreakawayFeedback.LinkInputSig(trilist.BooleanInput[joinMap.EnableAudioBreakaway.JoinNumber]);
|
||||||
|
EnableUsbBreakawayFeedback.LinkInputSig(trilist.BooleanInput[joinMap.EnableUsbBreakaway.JoinNumber]);
|
||||||
|
|
||||||
|
trilist.OnlineStatusChange += (o, a) =>
|
||||||
|
{
|
||||||
|
if (!a.DeviceOnLine) return;
|
||||||
|
|
||||||
|
EnableAudioBreakawayFeedback.FireUpdate();
|
||||||
|
EnableUsbBreakawayFeedback.FireUpdate();
|
||||||
|
SystemIdBusyFeedback.FireUpdate();
|
||||||
|
SystemIdFeebdack.FireUpdate();
|
||||||
|
};
|
||||||
|
|
||||||
// Link up outputs
|
// Link up outputs
|
||||||
for (uint i = 1; i <= Chassis.NumberOfOutputs; i++)
|
for (uint i = 1; i <= Chassis.NumberOfOutputs; i++)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ using Feedback = PepperDash.Essentials.Core.Feedback;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.DM
|
namespace PepperDash.Essentials.DM
|
||||||
{
|
{
|
||||||
public class DmpsRoutingController : EssentialsBridgeableDevice, IRouting, IHasFeedback
|
public class DmpsRoutingController : EssentialsBridgeableDevice, IRoutingNumeric, IHasFeedback
|
||||||
{
|
{
|
||||||
public CrestronControlSystem Dmps { get; set; }
|
public CrestronControlSystem Dmps { get; set; }
|
||||||
public ISystemControl SystemControl { get; private set; }
|
public ISystemControl SystemControl { get; private set; }
|
||||||
|
|
@ -661,8 +661,6 @@ namespace PepperDash.Essentials.DM
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
void Dmps_DMOutputChange(Switch device, DMOutputEventArgs args)
|
void Dmps_DMOutputChange(Switch device, DMOutputEventArgs args)
|
||||||
{
|
{
|
||||||
Debug.Console(2, this, "DMOutputChange Output: {0} EventId: {1}", args.Number, args.EventId.ToString());
|
Debug.Console(2, this, "DMOutputChange Output: {0} EventId: {1}", args.Number, args.EventId.ToString());
|
||||||
|
|
@ -724,10 +722,7 @@ namespace PepperDash.Essentials.DM
|
||||||
{
|
{
|
||||||
if (RouteOffTimers.ContainsKey(pnt))
|
if (RouteOffTimers.ContainsKey(pnt))
|
||||||
return;
|
return;
|
||||||
RouteOffTimers[pnt] = new CTimer(o =>
|
RouteOffTimers[pnt] = new CTimer(o => ExecuteSwitch(0, pnt.Number, pnt.Type), RouteOffTime);
|
||||||
{
|
|
||||||
ExecuteSwitch(0, pnt.Number, pnt.Type);
|
|
||||||
}, RouteOffTime);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#region IRouting Members
|
#region IRouting Members
|
||||||
|
|
@ -810,5 +805,14 @@ namespace PepperDash.Essentials.DM
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region IRoutingNumeric Members
|
||||||
|
|
||||||
|
public void ExecuteNumericSwitch(ushort inputSelector, ushort outputSelector, eRoutingSignalType sigType)
|
||||||
|
{
|
||||||
|
ExecuteSwitch(inputSelector, outputSelector, sigType);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -0,0 +1,406 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Crestron.SimplSharp;
|
||||||
|
using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
|
using Crestron.SimplSharpPro.DM;
|
||||||
|
|
||||||
|
using PepperDash.Core;
|
||||||
|
using PepperDash.Essentials.Core;
|
||||||
|
using PepperDash.Essentials.DM.Config;
|
||||||
|
using PepperDash.Essentials.Core.Bridges;
|
||||||
|
using PepperDash.Essentials.Core.Config;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.DM.Chassis
|
||||||
|
{
|
||||||
|
[Description("Wrapper class for all HdMdNxM4E switchers")]
|
||||||
|
public class HdMdNxM4kEBridgeableController : CrestronGenericBridgeableBaseDevice, IRoutingInputsOutputs, IRoutingNumeric, IHasFeedback
|
||||||
|
{
|
||||||
|
private HdMdNxM _Chassis;
|
||||||
|
private HdMd4x14kE _Chassis4x1;
|
||||||
|
|
||||||
|
public Dictionary<uint, string> InputNames { get; set; }
|
||||||
|
public Dictionary<uint, string> OutputNames { get; set; }
|
||||||
|
|
||||||
|
public RoutingPortCollection<RoutingInputPort> InputPorts { get; private set; }
|
||||||
|
public RoutingPortCollection<RoutingOutputPort> OutputPorts { get; private set; }
|
||||||
|
|
||||||
|
public FeedbackCollection<BoolFeedback> VideoInputSyncFeedbacks { get; private set; }
|
||||||
|
public FeedbackCollection<IntFeedback> VideoOutputRouteFeedbacks { get; private set; }
|
||||||
|
public FeedbackCollection<StringFeedback> InputNameFeedbacks { get; private set; }
|
||||||
|
public FeedbackCollection<StringFeedback> OutputNameFeedbacks { get; private set; }
|
||||||
|
public FeedbackCollection<StringFeedback> OutputRouteNameFeedbacks { get; private set; }
|
||||||
|
public FeedbackCollection<BoolFeedback> InputHdcpEnableFeedback { get; private set; }
|
||||||
|
public FeedbackCollection<StringFeedback> DeviceNameFeedback { get; private set; }
|
||||||
|
public FeedbackCollection<BoolFeedback> AutoRouteFeedback { get; private set; }
|
||||||
|
|
||||||
|
#region Constructor
|
||||||
|
|
||||||
|
public HdMdNxM4kEBridgeableController(string key, string name, HdMdNxM chassis,
|
||||||
|
HdMdNxM4kEBridgeablePropertiesConfig props)
|
||||||
|
: base(key, name, chassis)
|
||||||
|
{
|
||||||
|
_Chassis = chassis;
|
||||||
|
var _props = props;
|
||||||
|
|
||||||
|
InputNames = props.Inputs;
|
||||||
|
OutputNames = props.Outputs;
|
||||||
|
|
||||||
|
VideoInputSyncFeedbacks = new FeedbackCollection<BoolFeedback>();
|
||||||
|
VideoOutputRouteFeedbacks = new FeedbackCollection<IntFeedback>();
|
||||||
|
InputNameFeedbacks = new FeedbackCollection<StringFeedback>();
|
||||||
|
OutputNameFeedbacks = new FeedbackCollection<StringFeedback>();
|
||||||
|
OutputRouteNameFeedbacks = new FeedbackCollection<StringFeedback>();
|
||||||
|
InputHdcpEnableFeedback = new FeedbackCollection<BoolFeedback>();
|
||||||
|
DeviceNameFeedback = new FeedbackCollection<StringFeedback>();
|
||||||
|
AutoRouteFeedback = new FeedbackCollection<BoolFeedback>();
|
||||||
|
|
||||||
|
InputPorts = new RoutingPortCollection<RoutingInputPort>();
|
||||||
|
OutputPorts = new RoutingPortCollection<RoutingOutputPort>();
|
||||||
|
|
||||||
|
DeviceNameFeedback.Add(new StringFeedback(this.Name, () => this.Name));
|
||||||
|
|
||||||
|
if (_Chassis.NumberOfInputs == 1)
|
||||||
|
{
|
||||||
|
_Chassis4x1 = _Chassis as HdMd4x14kE;
|
||||||
|
AutoRouteFeedback.Add(new BoolFeedback(this.Name + "-" + InputNames[1], () => _Chassis4x1.AutoModeOnFeedback.BoolValue));
|
||||||
|
}
|
||||||
|
|
||||||
|
for (uint i = 1; i <= _Chassis.NumberOfInputs; i++)
|
||||||
|
{
|
||||||
|
var inputName = InputNames[i];
|
||||||
|
_Chassis.Inputs[i].Name.StringValue = inputName;
|
||||||
|
|
||||||
|
InputPorts.Add(new RoutingInputPort(inputName, eRoutingSignalType.AudioVideo,
|
||||||
|
eRoutingPortConnectionType.Hdmi, i, this));
|
||||||
|
VideoInputSyncFeedbacks.Add(new BoolFeedback(inputName, () => _Chassis.Inputs[i].VideoDetectedFeedback.BoolValue));
|
||||||
|
InputNameFeedbacks.Add(new StringFeedback(inputName, () => _Chassis.Inputs[i].Name.StringValue));
|
||||||
|
InputHdcpEnableFeedback.Add(new BoolFeedback(inputName, () => _Chassis.HdmiInputs[i].HdmiInputPort.HdcpSupportOnFeedback.BoolValue));
|
||||||
|
}
|
||||||
|
|
||||||
|
for (uint i = 1; i <= _Chassis.NumberOfOutputs; i++)
|
||||||
|
{
|
||||||
|
var outputName = OutputNames[i];
|
||||||
|
_Chassis.Outputs[i].Name.StringValue = outputName;
|
||||||
|
|
||||||
|
OutputPorts.Add(new RoutingOutputPort(outputName, eRoutingSignalType.AudioVideo,
|
||||||
|
eRoutingPortConnectionType.Hdmi, i, this));
|
||||||
|
VideoOutputRouteFeedbacks.Add(new IntFeedback(outputName, () => (int)_Chassis.Outputs[i].VideoOutFeedback.Number));
|
||||||
|
OutputNameFeedbacks.Add(new StringFeedback(outputName, () => _Chassis.Outputs[i].Name.StringValue));
|
||||||
|
OutputRouteNameFeedbacks.Add(new StringFeedback(outputName, () => _Chassis.Outputs[i].VideoOutFeedback.NameFeedback.StringValue));
|
||||||
|
}
|
||||||
|
|
||||||
|
_Chassis.DMInputChange += new DMInputEventHandler(Chassis_DMInputChange);
|
||||||
|
_Chassis.DMOutputChange += new DMOutputEventHandler(Chassis_DMOutputChange);
|
||||||
|
|
||||||
|
AddPostActivationAction(AddFeedbackCollections);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Methods
|
||||||
|
|
||||||
|
public void EnableHdcp(uint port)
|
||||||
|
{
|
||||||
|
if (port > _Chassis.NumberOfInputs) return;
|
||||||
|
if (port <= 0) return;
|
||||||
|
|
||||||
|
_Chassis.HdmiInputs[port].HdmiInputPort.HdcpSupportOn();
|
||||||
|
InputHdcpEnableFeedback[InputNames[port]].FireUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void DisableHdcp(uint port)
|
||||||
|
{
|
||||||
|
if (port > _Chassis.NumberOfInputs) return;
|
||||||
|
if (port <= 0) return;
|
||||||
|
|
||||||
|
_Chassis.HdmiInputs[port].HdmiInputPort.HdcpSupportOff();
|
||||||
|
InputHdcpEnableFeedback[InputNames[port]].FireUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void EnableAutoRoute()
|
||||||
|
{
|
||||||
|
if (_Chassis.NumberOfInputs != 1) return;
|
||||||
|
|
||||||
|
if (_Chassis4x1 == null) return;
|
||||||
|
|
||||||
|
_Chassis4x1.AutoModeOn();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void DisableAutoRoute()
|
||||||
|
{
|
||||||
|
if (_Chassis.NumberOfInputs != 1) return;
|
||||||
|
|
||||||
|
if (_Chassis4x1 == null) return;
|
||||||
|
|
||||||
|
_Chassis4x1.AutoModeOff();
|
||||||
|
}
|
||||||
|
|
||||||
|
#region PostActivate
|
||||||
|
|
||||||
|
public void AddFeedbackCollections()
|
||||||
|
{
|
||||||
|
AddCollectionsToList(VideoInputSyncFeedbacks, InputHdcpEnableFeedback);
|
||||||
|
AddCollectionsToList(VideoOutputRouteFeedbacks);
|
||||||
|
AddCollectionsToList(InputNameFeedbacks, OutputNameFeedbacks, OutputRouteNameFeedbacks, DeviceNameFeedback);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region FeedbackCollection Methods
|
||||||
|
|
||||||
|
//Add arrays of collections
|
||||||
|
public void AddCollectionsToList(params FeedbackCollection<BoolFeedback>[] newFbs)
|
||||||
|
{
|
||||||
|
foreach (FeedbackCollection<BoolFeedback> fbCollection in newFbs)
|
||||||
|
{
|
||||||
|
foreach (var item in newFbs)
|
||||||
|
{
|
||||||
|
AddCollectionToList(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public void AddCollectionsToList(params FeedbackCollection<IntFeedback>[] newFbs)
|
||||||
|
{
|
||||||
|
foreach (FeedbackCollection<IntFeedback> fbCollection in newFbs)
|
||||||
|
{
|
||||||
|
foreach (var item in newFbs)
|
||||||
|
{
|
||||||
|
AddCollectionToList(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void AddCollectionsToList(params FeedbackCollection<StringFeedback>[] newFbs)
|
||||||
|
{
|
||||||
|
foreach (FeedbackCollection<StringFeedback> fbCollection in newFbs)
|
||||||
|
{
|
||||||
|
foreach (var item in newFbs)
|
||||||
|
{
|
||||||
|
AddCollectionToList(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//Add Collections
|
||||||
|
public void AddCollectionToList(FeedbackCollection<BoolFeedback> newFbs)
|
||||||
|
{
|
||||||
|
foreach (var f in newFbs)
|
||||||
|
{
|
||||||
|
if (f == null) continue;
|
||||||
|
|
||||||
|
AddFeedbackToList(f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void AddCollectionToList(FeedbackCollection<IntFeedback> newFbs)
|
||||||
|
{
|
||||||
|
foreach (var f in newFbs)
|
||||||
|
{
|
||||||
|
if (f == null) continue;
|
||||||
|
|
||||||
|
AddFeedbackToList(f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void AddCollectionToList(FeedbackCollection<StringFeedback> newFbs)
|
||||||
|
{
|
||||||
|
foreach (var f in newFbs)
|
||||||
|
{
|
||||||
|
if (f == null) continue;
|
||||||
|
|
||||||
|
AddFeedbackToList(f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//Add Individual Feedbacks
|
||||||
|
public void AddFeedbackToList(PepperDash.Essentials.Core.Feedback newFb)
|
||||||
|
{
|
||||||
|
if (newFb == null) return;
|
||||||
|
|
||||||
|
if (!Feedbacks.Contains(newFb))
|
||||||
|
{
|
||||||
|
Feedbacks.Add(newFb);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region IRouting Members
|
||||||
|
|
||||||
|
public void ExecuteSwitch(object inputSelector, object outputSelector, eRoutingSignalType signalType)
|
||||||
|
{
|
||||||
|
// Try to make switch only when necessary. The unit appears to toggle when already selected.
|
||||||
|
var current = _Chassis.HdmiOutputs[(uint)outputSelector].VideoOut;
|
||||||
|
if (current != _Chassis.HdmiInputs[(uint)inputSelector])
|
||||||
|
_Chassis.HdmiOutputs[(uint)outputSelector].VideoOut = _Chassis.HdmiInputs[(uint)inputSelector];
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region IRoutingNumeric Members
|
||||||
|
|
||||||
|
public void ExecuteNumericSwitch(ushort inputSelector, ushort outputSelector, eRoutingSignalType signalType)
|
||||||
|
{
|
||||||
|
ExecuteSwitch(inputSelector, outputSelector, signalType);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Bridge Linking
|
||||||
|
|
||||||
|
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
||||||
|
{
|
||||||
|
var joinMap = new HdMdNxM4kEControllerJoinMap(joinStart);
|
||||||
|
|
||||||
|
var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(joinMapSerialized))
|
||||||
|
joinMap = JsonConvert.DeserializeObject<HdMdNxM4kEControllerJoinMap>(joinMapSerialized);
|
||||||
|
|
||||||
|
bridge.AddJoinMap(Key, joinMap);
|
||||||
|
|
||||||
|
IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline.JoinNumber]);
|
||||||
|
DeviceNameFeedback[this.Name].LinkInputSig(trilist.StringInput[joinMap.Name.JoinNumber]);
|
||||||
|
|
||||||
|
if (_Chassis4x1 != null)
|
||||||
|
{
|
||||||
|
trilist.SetSigTrueAction(joinMap.EnableAutoRoute.JoinNumber, () => _Chassis4x1.AutoModeOn());
|
||||||
|
trilist.SetSigFalseAction(joinMap.EnableAutoRoute.JoinNumber, () => _Chassis4x1.AutoModeOff());
|
||||||
|
AutoRouteFeedback[this.Name + "-" + InputNames[1]].LinkInputSig(trilist.BooleanInput[joinMap.EnableAutoRoute.JoinNumber]);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (uint i = 1; i <= _Chassis.NumberOfInputs; i++)
|
||||||
|
{
|
||||||
|
var joinIndex = i - 1;
|
||||||
|
//Digital
|
||||||
|
VideoInputSyncFeedbacks[InputNames[i]].LinkInputSig(trilist.BooleanInput[joinMap.InputSync.JoinNumber + joinIndex]);
|
||||||
|
InputHdcpEnableFeedback[InputNames[i]].LinkInputSig(trilist.BooleanInput[joinMap.EnableInputHdcp.JoinNumber + joinIndex]);
|
||||||
|
InputHdcpEnableFeedback[InputNames[i]].LinkComplementInputSig(trilist.BooleanInput[joinMap.DisableInputHdcp.JoinNumber + joinIndex]);
|
||||||
|
trilist.SetSigTrueAction(joinMap.EnableInputHdcp.JoinNumber + joinIndex, () => EnableHdcp(i));
|
||||||
|
trilist.SetSigTrueAction(joinMap.DisableInputHdcp.JoinNumber + joinIndex, () => DisableHdcp(i));
|
||||||
|
|
||||||
|
//Serial
|
||||||
|
InputNameFeedbacks[InputNames[i]].LinkInputSig(trilist.StringInput[joinMap.InputName.JoinNumber + joinIndex]);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (uint i = 1; i <= _Chassis.NumberOfOutputs; i++)
|
||||||
|
{
|
||||||
|
var joinIndex = i - 1;
|
||||||
|
//Analog
|
||||||
|
VideoOutputRouteFeedbacks[OutputNames[i]].LinkInputSig(trilist.UShortInput[joinMap.OutputRoute.JoinNumber + joinIndex]);
|
||||||
|
trilist.SetUShortSigAction(joinMap.OutputRoute.JoinNumber + joinIndex, (a) => ExecuteSwitch(a, i, eRoutingSignalType.AudioVideo));
|
||||||
|
|
||||||
|
//Serial
|
||||||
|
OutputNameFeedbacks[OutputNames[i]].LinkInputSig(trilist.StringInput[joinMap.OutputName.JoinNumber + joinIndex]);
|
||||||
|
OutputRouteNameFeedbacks[OutputNames[i]].LinkInputSig(trilist.StringInput[joinMap.OutputRoutedName.JoinNumber + joinIndex]);
|
||||||
|
}
|
||||||
|
|
||||||
|
_Chassis.OnlineStatusChange += new Crestron.SimplSharpPro.OnlineStatusChangeEventHandler(Chassis_OnlineStatusChange);
|
||||||
|
|
||||||
|
trilist.OnlineStatusChange += new Crestron.SimplSharpPro.OnlineStatusChangeEventHandler((d, args) =>
|
||||||
|
{
|
||||||
|
if (args.DeviceOnLine)
|
||||||
|
{
|
||||||
|
foreach (var feedback in Feedbacks)
|
||||||
|
{
|
||||||
|
feedback.FireUpdate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Events
|
||||||
|
|
||||||
|
void Chassis_OnlineStatusChange(Crestron.SimplSharpPro.GenericBase currentDevice, Crestron.SimplSharpPro.OnlineOfflineEventArgs args)
|
||||||
|
{
|
||||||
|
if (args.DeviceOnLine)
|
||||||
|
{
|
||||||
|
for (uint i = 1; i <= _Chassis.NumberOfInputs; i++)
|
||||||
|
{
|
||||||
|
_Chassis.Inputs[i].Name.StringValue = InputNames[i];
|
||||||
|
}
|
||||||
|
for (uint i = 1; i <= _Chassis.NumberOfOutputs; i++)
|
||||||
|
{
|
||||||
|
_Chassis.Outputs[i].Name.StringValue = OutputNames[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (var feedback in Feedbacks)
|
||||||
|
{
|
||||||
|
feedback.FireUpdate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void Chassis_DMOutputChange(Switch device, DMOutputEventArgs args)
|
||||||
|
{
|
||||||
|
if (args.EventId == DMOutputEventIds.VideoOutEventId)
|
||||||
|
{
|
||||||
|
foreach (var item in VideoOutputRouteFeedbacks)
|
||||||
|
{
|
||||||
|
item.FireUpdate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Chassis_DMInputChange(Switch device, DMInputEventArgs args)
|
||||||
|
{
|
||||||
|
if (args.EventId == DMInputEventIds.VideoDetectedEventId)
|
||||||
|
{
|
||||||
|
foreach (var item in VideoInputSyncFeedbacks)
|
||||||
|
{
|
||||||
|
item.FireUpdate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Factory
|
||||||
|
|
||||||
|
public class HdMdNxM4kEControllerFactory : EssentialsDeviceFactory<HdMdNxM4kEBridgeableController>
|
||||||
|
{
|
||||||
|
public HdMdNxM4kEControllerFactory()
|
||||||
|
{
|
||||||
|
TypeNames = new List<string>() { "hdmd4x14ke-bridgeable", "hdmd4x24ke", "hdmd6x24ke" };
|
||||||
|
}
|
||||||
|
|
||||||
|
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||||
|
{
|
||||||
|
Debug.Console(1, "Factory Attempting to create new HD-MD-NxM-4K-E Device");
|
||||||
|
|
||||||
|
var props = JsonConvert.DeserializeObject<HdMdNxM4kEBridgeablePropertiesConfig>(dc.Properties.ToString());
|
||||||
|
|
||||||
|
var type = dc.Type.ToLower();
|
||||||
|
var control = props.Control;
|
||||||
|
var ipid = control.IpIdInt;
|
||||||
|
var address = control.TcpSshProperties.Address;
|
||||||
|
|
||||||
|
switch (type)
|
||||||
|
{
|
||||||
|
case ("hdmd4x14ke-bridgeable"):
|
||||||
|
return new HdMdNxM4kEBridgeableController(dc.Key, dc.Name, new HdMd4x14kE(ipid, address, Global.ControlSystem), props);
|
||||||
|
case ("hdmd4x24ke"):
|
||||||
|
return new HdMdNxM4kEBridgeableController(dc.Key, dc.Name, new HdMd4x24kE(ipid, address, Global.ControlSystem), props);
|
||||||
|
case ("hdmd6x24ke"):
|
||||||
|
return new HdMdNxM4kEBridgeableController(dc.Key, dc.Name, new HdMd6x24kE(ipid, address, Global.ControlSystem), props);
|
||||||
|
default:
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -83,7 +83,7 @@ namespace PepperDash.Essentials.DM.Chassis
|
||||||
{
|
{
|
||||||
// Try to make switch only when necessary. The unit appears to toggle when already selected.
|
// Try to make switch only when necessary. The unit appears to toggle when already selected.
|
||||||
var current = Chassis.HdmiOutputs[1].VideoOut;
|
var current = Chassis.HdmiOutputs[1].VideoOut;
|
||||||
if(current != Chassis.HdmiInputs[(uint)inputSelector])
|
if (current != Chassis.HdmiInputs[(uint)inputSelector])
|
||||||
Chassis.HdmiOutputs[1].VideoOut = Chassis.HdmiInputs[(uint)inputSelector];
|
Chassis.HdmiOutputs[1].VideoOut = Chassis.HdmiInputs[(uint)inputSelector];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -110,6 +110,9 @@ namespace PepperDash.Essentials.DM.Chassis
|
||||||
type = type.ToLower();
|
type = type.ToLower();
|
||||||
if (type == "hdmd4x14ke")
|
if (type == "hdmd4x14ke")
|
||||||
{
|
{
|
||||||
|
Debug.Console(0, @"The 'hdmd4x14ke' device is not an Essentials Bridgeable device.
|
||||||
|
If an essentials Bridgeable Device is required, use the 'hdmd4x14ke-bridgeable' type");
|
||||||
|
|
||||||
var chassis = new HdMd4x14kE(ipid, address, Global.ControlSystem);
|
var chassis = new HdMd4x14kE(ipid, address, Global.ControlSystem);
|
||||||
return new HdMdNxM4kEController(key, name, chassis, properties);
|
return new HdMdNxM4kEController(key, name, chassis, properties);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,4 +20,16 @@ namespace PepperDash.Essentials.DM.Config
|
||||||
[JsonProperty("inputs")]
|
[JsonProperty("inputs")]
|
||||||
public Dictionary<string, InputPropertiesConfig> Inputs { get; set; }
|
public Dictionary<string, InputPropertiesConfig> Inputs { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class HdMdNxM4kEBridgeablePropertiesConfig
|
||||||
|
{
|
||||||
|
[JsonProperty("control")]
|
||||||
|
public ControlPropertiesConfig Control { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("inputs")]
|
||||||
|
public Dictionary<uint, string> Inputs { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("outputs")]
|
||||||
|
public Dictionary<uint, string> Outputs { get; set; }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
using System;
|
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
|
||||||
|
|
@ -18,9 +18,7 @@ using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.DM.Endpoints.DGEs
|
namespace PepperDash.Essentials.DM.Endpoints.DGEs
|
||||||
{
|
{
|
||||||
/// <summary>
|
[Description("Wrapper class for DGE-100")]
|
||||||
/// Wrapper class for DGE-100 and DM-DGE-200-C
|
|
||||||
/// </summary>
|
|
||||||
public class Dge100Controller : CrestronGenericBaseDevice, IComPorts, IIROutputPorts, IHasBasicTriListWithSmartObject, ICec
|
public class Dge100Controller : CrestronGenericBaseDevice, IComPorts, IIROutputPorts, IHasBasicTriListWithSmartObject, ICec
|
||||||
{
|
{
|
||||||
private readonly Dge100 _dge;
|
private readonly Dge100 _dge;
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@ namespace PepperDash.Essentials.DM.Endpoints.DGEs
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Wrapper class for DGE-100 and DM-DGE-200-C
|
/// Wrapper class for DGE-100 and DM-DGE-200-C
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[Description("Wrapper class for DM-DGE-200-C")]
|
||||||
public class DmDge200CController : Dge100Controller, IRoutingInputsOutputs
|
public class DmDge200CController : Dge100Controller, IRoutingInputsOutputs
|
||||||
{
|
{
|
||||||
private readonly DmDge200C _dge;
|
private readonly DmDge200C _dge;
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,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>
|
||||||
|
[Description("Wrapper Class for DM-RMC-100-S")]
|
||||||
public class DmRmc100SController : DmRmcControllerBase, IRoutingInputsOutputs,
|
public class DmRmc100SController : DmRmcControllerBase, IRoutingInputsOutputs,
|
||||||
IIROutputPorts, IComPorts, ICec
|
IIROutputPorts, IComPorts, ICec
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,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>
|
||||||
|
[Description("Wrapper Class for DM-RMC-150-S")]
|
||||||
public class DmRmc150SController : DmRmcControllerBase, IRoutingInputsOutputs,
|
public class DmRmc150SController : DmRmcControllerBase, IRoutingInputsOutputs,
|
||||||
IIROutputPorts, IComPorts, ICec
|
IIROutputPorts, IComPorts, ICec
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,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>
|
||||||
|
[Description("Wrapper Class for DM-RMC-200-C")]
|
||||||
public class DmRmc200CController : DmRmcControllerBase, IRoutingInputsOutputs,
|
public class DmRmc200CController : DmRmcControllerBase, IRoutingInputsOutputs,
|
||||||
IIROutputPorts, IComPorts, ICec
|
IIROutputPorts, IComPorts, ICec
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,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>
|
||||||
|
[Description("Wrapper Class for DM-RMC-200-S2")]
|
||||||
public class DmRmc200S2Controller : DmRmcControllerBase, IRoutingInputsOutputs,
|
public class DmRmc200S2Controller : DmRmcControllerBase, IRoutingInputsOutputs,
|
||||||
IIROutputPorts, IComPorts, ICec
|
IIROutputPorts, IComPorts, ICec
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,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>
|
||||||
|
[Description("Wrapper Class for DM-RMC-200-S")]
|
||||||
public class DmRmc200SController : DmRmcControllerBase, IRoutingInputsOutputs,
|
public class DmRmc200SController : DmRmcControllerBase, IRoutingInputsOutputs,
|
||||||
IIROutputPorts, IComPorts, ICec
|
IIROutputPorts, IComPorts, ICec
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,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>
|
||||||
|
[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
|
IIROutputPorts, IComPorts, ICec, IRelayPorts
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,8 @@ using PepperDash.Essentials.Core;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.DM
|
namespace PepperDash.Essentials.DM
|
||||||
{
|
{
|
||||||
|
|
||||||
|
[Description("Wrapper Class for DM-RMC-4K-100-C-1G")]
|
||||||
public class DmRmc4k100C1GController : DmHdBaseTControllerBase, IRoutingInputsOutputs,
|
public class DmRmc4k100C1GController : DmHdBaseTControllerBase, IRoutingInputsOutputs,
|
||||||
IIROutputPorts, IComPorts, ICec
|
IIROutputPorts, IComPorts, ICec
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,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>
|
||||||
|
[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
|
IIROutputPorts, IComPorts, ICec, IRelayPorts
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ using PepperDash.Essentials.Core.Bridges;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.DM
|
namespace PepperDash.Essentials.DM
|
||||||
{
|
{
|
||||||
|
[Description("Wrapper Class for DM-RMC-4K-Z-100-C")]
|
||||||
public class DmRmc4kZ100CController : DmRmcX100CController
|
public class DmRmc4kZ100CController : DmRmcX100CController
|
||||||
{
|
{
|
||||||
private readonly DmRmc4kz100C _rmc;
|
private readonly DmRmc4kz100C _rmc;
|
||||||
|
|
@ -23,18 +24,31 @@ namespace PepperDash.Essentials.DM
|
||||||
EdidSerialNumberFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.SerialNumber.StringValue);
|
EdidSerialNumberFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.SerialNumber.StringValue);
|
||||||
|
|
||||||
_rmc.HdmiOutput.OutputStreamChange += HdmiOutput_OutputStreamChange;
|
_rmc.HdmiOutput.OutputStreamChange += HdmiOutput_OutputStreamChange;
|
||||||
_rmc.HdmiOutput.ConnectedDevice.DeviceInformationChange += ConnectedDevice_DeviceInformationChange;
|
|
||||||
|
//removed to prevent NullReferenceException
|
||||||
|
//_rmc.HdmiOutput.ConnectedDevice.DeviceInformationChange += ConnectedDevice_DeviceInformationChange;
|
||||||
}
|
}
|
||||||
|
|
||||||
void HdmiOutput_OutputStreamChange(EndpointOutputStream outputStream, EndpointOutputStreamEventArgs args)
|
void HdmiOutput_OutputStreamChange(EndpointOutputStream outputStream, EndpointOutputStreamEventArgs args)
|
||||||
{
|
{
|
||||||
if (args.EventId == EndpointOutputStreamEventIds.HorizontalResolutionFeedbackEventId || args.EventId == EndpointOutputStreamEventIds.VerticalResolutionFeedbackEventId ||
|
switch (args.EventId)
|
||||||
args.EventId == EndpointOutputStreamEventIds.FramesPerSecondFeedbackEventId)
|
|
||||||
{
|
{
|
||||||
|
case EndpointOutputStreamEventIds.FramesPerSecondFeedbackEventId:
|
||||||
|
case EndpointOutputStreamEventIds.VerticalResolutionFeedbackEventId:
|
||||||
|
case EndpointOutputStreamEventIds.HorizontalResolutionFeedbackEventId:
|
||||||
VideoOutputResolutionFeedback.FireUpdate();
|
VideoOutputResolutionFeedback.FireUpdate();
|
||||||
|
break;
|
||||||
|
case EndpointOutputStreamEventIds.HotplugDetectedEventId:
|
||||||
|
if (_rmc.HdmiOutput.ConnectedDevice == null) return;
|
||||||
|
EdidManufacturerFeedback.FireUpdate();
|
||||||
|
EdidNameFeedback.FireUpdate();
|
||||||
|
EdidPreferredTimingFeedback.FireUpdate();
|
||||||
|
EdidSerialNumberFeedback.FireUpdate();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
void ConnectedDevice_DeviceInformationChange(ConnectedDeviceInformation connectedDevice, ConnectedDeviceEventArgs args)
|
void ConnectedDevice_DeviceInformationChange(ConnectedDeviceInformation connectedDevice, ConnectedDeviceEventArgs args)
|
||||||
{
|
{
|
||||||
switch (args.EventId)
|
switch (args.EventId)
|
||||||
|
|
@ -52,7 +66,7 @@ namespace PepperDash.Essentials.DM
|
||||||
EdidSerialNumberFeedback.FireUpdate();
|
EdidSerialNumberFeedback.FireUpdate();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
|
|
||||||
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ using PepperDash.Core;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.DM
|
namespace PepperDash.Essentials.DM
|
||||||
{
|
{
|
||||||
|
[Description("Wrapper Class for DM-RMC-4K-Z-SCALER-C")]
|
||||||
public class DmRmc4kZScalerCController : DmRmcControllerBase, IRmcRouting,
|
public class DmRmc4kZScalerCController : DmRmcControllerBase, IRmcRouting,
|
||||||
IIROutputPorts, IComPorts, ICec
|
IIROutputPorts, IComPorts, ICec
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -307,7 +307,7 @@ namespace PepperDash.Essentials.DM
|
||||||
TypeNames = new List<string>
|
TypeNames = new List<string>
|
||||||
{ "hdbasetrx", "dmrmc4k100c1g", "dmrmc100c", "dmrmc100s", "dmrmc4k100c", "dmrmc150s",
|
{ "hdbasetrx", "dmrmc4k100c1g", "dmrmc100c", "dmrmc100s", "dmrmc4k100c", "dmrmc150s",
|
||||||
"dmrmc200c", "dmrmc200s", "dmrmc200s2", "dmrmcscalerc", "dmrmcscalers", "dmrmcscalers2", "dmrmc4kscalerc", "dmrmc4kscalercdsp",
|
"dmrmc200c", "dmrmc200s", "dmrmc200s2", "dmrmcscalerc", "dmrmcscalers", "dmrmcscalers2", "dmrmc4kscalerc", "dmrmc4kscalercdsp",
|
||||||
"dmrmc4kz100c", "dmrmckzscalerc" };
|
"dmrmc4kz100c", "dmrmc4kzscalerc" };
|
||||||
}
|
}
|
||||||
|
|
||||||
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,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>
|
||||||
|
[Description("Wrapper Class for DM-RMC-SCALER-C")]
|
||||||
public class DmRmcScalerCController : DmRmcControllerBase, IRoutingInputsOutputs,
|
public class DmRmcScalerCController : DmRmcControllerBase, IRoutingInputsOutputs,
|
||||||
IIROutputPorts, IComPorts, ICec
|
IIROutputPorts, IComPorts, ICec
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,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>
|
||||||
|
[Description("Wrapper Class for DM-RMC-SCALER-S2")]
|
||||||
public class DmRmcScalerS2Controller : DmRmcControllerBase, IRoutingInputsOutputs,
|
public class DmRmcScalerS2Controller : DmRmcControllerBase, IRoutingInputsOutputs,
|
||||||
IIROutputPorts, IComPorts, ICec
|
IIROutputPorts, IComPorts, ICec
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,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>
|
||||||
|
[Description("Wrapper Class for DM-RMC-SCALER-S")]
|
||||||
public class DmRmcScalerSController : DmRmcControllerBase, IRoutingInputsOutputs,
|
public class DmRmcScalerSController : DmRmcControllerBase, IRoutingInputsOutputs,
|
||||||
IIROutputPorts, IComPorts, ICec
|
IIROutputPorts, IComPorts, ICec
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ namespace PepperDash.Essentials.DM
|
||||||
/// Builds a controller for basic DM-RMCs (both 4K and non-4K) with Com and IR ports and no control functions
|
/// Builds a controller for basic DM-RMCs (both 4K and non-4K) with Com and IR ports and no control functions
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[Description("Wrapper Class for DM-RMC-4K-100-C & DM-RMC-100-C")]
|
||||||
public class DmRmcX100CController : DmRmcControllerBase, IRoutingInputsOutputs,
|
public class DmRmcX100CController : DmRmcControllerBase, IRoutingInputsOutputs,
|
||||||
IIROutputPorts, IComPorts, ICec
|
IIROutputPorts, IComPorts, ICec
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,4 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
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;
|
||||||
|
|
@ -12,7 +8,6 @@ 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;
|
|
||||||
|
|
||||||
namespace PepperDash.Essentials.DM
|
namespace PepperDash.Essentials.DM
|
||||||
{
|
{
|
||||||
|
|
@ -21,7 +16,8 @@ namespace PepperDash.Essentials.DM
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Controller class for all DM-TX-201C/S/F transmitters
|
/// Controller class for all DM-TX-201C/S/F transmitters
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class DmTx200Controller : DmTxControllerBase, ITxRouting, IHasFeedback, IHasFreeRun, IVgaBrightnessContrastControls
|
[Description("Wrapper class for DM-TX-200-C")]
|
||||||
|
public class DmTx200Controller : DmTxControllerBase, ITxRouting, IHasFreeRun, IVgaBrightnessContrastControls
|
||||||
{
|
{
|
||||||
public DmTx200C2G Tx { get; private set; }
|
public DmTx200C2G Tx { get; private set; }
|
||||||
|
|
||||||
|
|
@ -52,15 +48,10 @@ namespace PepperDash.Essentials.DM
|
||||||
Tx.VideoSourceFeedback == DmTx200Base.eSourceSelection.Analog ||
|
Tx.VideoSourceFeedback == DmTx200Base.eSourceSelection.Analog ||
|
||||||
Tx.VideoSourceFeedback == DmTx200Base.eSourceSelection.Disable)
|
Tx.VideoSourceFeedback == DmTx200Base.eSourceSelection.Disable)
|
||||||
return Tx.VideoSourceFeedback;
|
return Tx.VideoSourceFeedback;
|
||||||
else // auto
|
|
||||||
{
|
|
||||||
if (Tx.HdmiInput.SyncDetectedFeedback.BoolValue)
|
if (Tx.HdmiInput.SyncDetectedFeedback.BoolValue)
|
||||||
return DmTx200Base.eSourceSelection.Digital;
|
return DmTx200Base.eSourceSelection.Digital;
|
||||||
else if (Tx.VgaInput.SyncDetectedFeedback.BoolValue)
|
|
||||||
return DmTx200Base.eSourceSelection.Analog;
|
return Tx.VgaInput.SyncDetectedFeedback.BoolValue ? DmTx200Base.eSourceSelection.Analog : DmTx200Base.eSourceSelection.Disable;
|
||||||
else
|
|
||||||
return DmTx200Base.eSourceSelection.Disable;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -106,45 +97,28 @@ namespace PepperDash.Essentials.DM
|
||||||
ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput",
|
ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput",
|
||||||
() => ActualActiveVideoInput.ToString());
|
() => ActualActiveVideoInput.ToString());
|
||||||
|
|
||||||
Tx.HdmiInput.InputStreamChange += new EndpointInputStreamChangeEventHandler(InputStreamChangeEvent);
|
Tx.HdmiInput.InputStreamChange += InputStreamChangeEvent;
|
||||||
|
Tx.VgaInput.InputStreamChange += VgaInputOnInputStreamChange;
|
||||||
Tx.BaseEvent += Tx_BaseEvent;
|
Tx.BaseEvent += Tx_BaseEvent;
|
||||||
Tx.OnlineStatusChange += new OnlineStatusChangeEventHandler(Tx_OnlineStatusChange);
|
Tx.OnlineStatusChange += Tx_OnlineStatusChange;
|
||||||
|
|
||||||
VideoSourceNumericFeedback = new IntFeedback(() =>
|
VideoSourceNumericFeedback = new IntFeedback(() => (int)Tx.VideoSourceFeedback);
|
||||||
{
|
AudioSourceNumericFeedback = new IntFeedback(() => (int)Tx.AudioSourceFeedback);
|
||||||
return (int)Tx.VideoSourceFeedback;
|
|
||||||
});
|
|
||||||
AudioSourceNumericFeedback = new IntFeedback(() =>
|
|
||||||
{
|
|
||||||
return (int)Tx.AudioSourceFeedback;
|
|
||||||
});
|
|
||||||
|
|
||||||
HdmiInHdcpCapabilityFeedback = new IntFeedback("HdmiInHdcpCapability", () =>
|
HdmiInHdcpCapabilityFeedback = new IntFeedback("HdmiInHdcpCapability", () => tx.HdmiInput.HdcpSupportOnFeedback.BoolValue ? 1 : 0);
|
||||||
{
|
|
||||||
if (tx.HdmiInput.HdcpSupportOnFeedback.BoolValue)
|
|
||||||
return 1;
|
|
||||||
else
|
|
||||||
return 0;
|
|
||||||
});
|
|
||||||
|
|
||||||
HdcpSupportCapability = eHdcpCapabilityType.HdcpAutoSupport;
|
HdcpSupportCapability = eHdcpCapabilityType.HdcpAutoSupport;
|
||||||
|
|
||||||
HdmiVideoSyncFeedback = new BoolFeedback(() =>
|
HdmiVideoSyncFeedback = new BoolFeedback(() => tx.HdmiInput.SyncDetectedFeedback.BoolValue);
|
||||||
{
|
|
||||||
return (bool)tx.HdmiInput.SyncDetectedFeedback.BoolValue;
|
|
||||||
});
|
|
||||||
|
|
||||||
VgaVideoSyncFeedback = new BoolFeedback(() =>
|
VgaVideoSyncFeedback = new BoolFeedback(() => tx.VgaInput.SyncDetectedFeedback.BoolValue);
|
||||||
{
|
|
||||||
return (bool)tx.VgaInput.SyncDetectedFeedback.BoolValue;
|
|
||||||
});
|
|
||||||
|
|
||||||
FreeRunEnabledFeedback = new BoolFeedback(() => tx.VgaInput.FreeRunFeedback == eDmFreeRunSetting.Enabled);
|
FreeRunEnabledFeedback = new BoolFeedback(() => tx.VgaInput.FreeRunFeedback == eDmFreeRunSetting.Enabled);
|
||||||
|
|
||||||
VgaBrightnessFeedback = new IntFeedback(() => tx.VgaInput.VideoControls.BrightnessFeedback.UShortValue);
|
VgaBrightnessFeedback = new IntFeedback(() => tx.VgaInput.VideoControls.BrightnessFeedback.UShortValue);
|
||||||
VgaContrastFeedback = new IntFeedback(() => tx.VgaInput.VideoControls.ContrastFeedback.UShortValue);
|
VgaContrastFeedback = new IntFeedback(() => tx.VgaInput.VideoControls.ContrastFeedback.UShortValue);
|
||||||
|
|
||||||
tx.VgaInput.VideoControls.ControlChange += new Crestron.SimplSharpPro.DeviceSupport.GenericEventHandler(VideoControls_ControlChange);
|
tx.VgaInput.VideoControls.ControlChange += VideoControls_ControlChange;
|
||||||
|
|
||||||
|
|
||||||
var combinedFuncs = new VideoStatusFuncsWrapper
|
var combinedFuncs = new VideoStatusFuncsWrapper
|
||||||
|
|
@ -153,20 +127,13 @@ namespace PepperDash.Essentials.DM
|
||||||
(ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital
|
(ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital
|
||||||
&& tx.HdmiInput.VideoAttributes.HdcpActiveFeedback.BoolValue),
|
&& tx.HdmiInput.VideoAttributes.HdcpActiveFeedback.BoolValue),
|
||||||
|
|
||||||
HdcpStateFeedbackFunc = () =>
|
HdcpStateFeedbackFunc = () => ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital ? tx.HdmiInput.VideoAttributes.HdcpStateFeedback.ToString() : "",
|
||||||
{
|
|
||||||
if (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital)
|
|
||||||
return tx.HdmiInput.VideoAttributes.HdcpStateFeedback.ToString();
|
|
||||||
return "";
|
|
||||||
},
|
|
||||||
|
|
||||||
VideoResolutionFeedbackFunc = () =>
|
VideoResolutionFeedbackFunc = () =>
|
||||||
{
|
{
|
||||||
if (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital)
|
if (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital)
|
||||||
return tx.HdmiInput.VideoAttributes.GetVideoResolutionString();
|
return tx.HdmiInput.VideoAttributes.GetVideoResolutionString();
|
||||||
if (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Analog)
|
return ActualActiveVideoInput == DmTx200Base.eSourceSelection.Analog ? tx.VgaInput.VideoAttributes.GetVideoResolutionString() : "";
|
||||||
return tx.VgaInput.VideoAttributes.GetVideoResolutionString();
|
|
||||||
return "";
|
|
||||||
},
|
},
|
||||||
VideoSyncFeedbackFunc = () =>
|
VideoSyncFeedbackFunc = () =>
|
||||||
(ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital
|
(ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital
|
||||||
|
|
@ -181,7 +148,8 @@ namespace PepperDash.Essentials.DM
|
||||||
AnyVideoInput = new RoutingInputPortWithVideoStatuses(DmPortName.AnyVideoIn,
|
AnyVideoInput = new RoutingInputPortWithVideoStatuses(DmPortName.AnyVideoIn,
|
||||||
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.None, 0, this, combinedFuncs);
|
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.None, 0, this, combinedFuncs);
|
||||||
|
|
||||||
DmOutput = new RoutingOutputPort(DmPortName.DmOut, eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.DmCat, null, this);
|
DmOutput = new RoutingOutputPort(DmPortName.DmOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
|
||||||
|
eRoutingPortConnectionType.DmCat, null, this);
|
||||||
|
|
||||||
AddToFeedbackList(ActiveVideoInputFeedback, VideoSourceNumericFeedback, AudioSourceNumericFeedback,
|
AddToFeedbackList(ActiveVideoInputFeedback, VideoSourceNumericFeedback, AudioSourceNumericFeedback,
|
||||||
AnyVideoInput.VideoStatus.HasVideoStatusFeedback, AnyVideoInput.VideoStatus.HdcpActiveFeedback,
|
AnyVideoInput.VideoStatus.HasVideoStatusFeedback, AnyVideoInput.VideoStatus.HdcpActiveFeedback,
|
||||||
|
|
@ -195,18 +163,32 @@ namespace PepperDash.Essentials.DM
|
||||||
DmOutput.Port = Tx.DmOutput;
|
DmOutput.Port = Tx.DmOutput;
|
||||||
}
|
}
|
||||||
|
|
||||||
void VideoControls_ControlChange(object sender, Crestron.SimplSharpPro.DeviceSupport.GenericEventArgs args)
|
private void VgaInputOnInputStreamChange(EndpointInputStream inputStream, EndpointInputStreamEventArgs args)
|
||||||
|
{
|
||||||
|
switch (args.EventId)
|
||||||
|
{
|
||||||
|
case EndpointInputStreamEventIds.FreeRunFeedbackEventId:
|
||||||
|
FreeRunEnabledFeedback.FireUpdate();
|
||||||
|
break;
|
||||||
|
case EndpointInputStreamEventIds.SyncDetectedFeedbackEventId:
|
||||||
|
VgaVideoSyncFeedback.FireUpdate();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void VideoControls_ControlChange(object sender, GenericEventArgs args)
|
||||||
{
|
{
|
||||||
var id = args.EventId;
|
var id = args.EventId;
|
||||||
Debug.Console(2, this, "EventId {0}", args.EventId);
|
Debug.Console(2, this, "EventId {0}", args.EventId);
|
||||||
|
|
||||||
if (id == VideoControlsEventIds.BrightnessFeedbackEventId)
|
switch (id)
|
||||||
{
|
{
|
||||||
|
case VideoControlsEventIds.BrightnessFeedbackEventId:
|
||||||
VgaBrightnessFeedback.FireUpdate();
|
VgaBrightnessFeedback.FireUpdate();
|
||||||
}
|
break;
|
||||||
else if (id == VideoControlsEventIds.ContrastFeedbackEventId)
|
case VideoControlsEventIds.ContrastFeedbackEventId:
|
||||||
{
|
|
||||||
VgaContrastFeedback.FireUpdate();
|
VgaContrastFeedback.FireUpdate();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -233,7 +215,7 @@ namespace PepperDash.Essentials.DM
|
||||||
|
|
||||||
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
||||||
{
|
{
|
||||||
DmTxControllerJoinMap joinMap = GetDmTxJoinMap(joinStart, joinMapKey);
|
var joinMap = GetDmTxJoinMap(joinStart, joinMapKey);
|
||||||
|
|
||||||
if (HdmiVideoSyncFeedback != null)
|
if (HdmiVideoSyncFeedback != null)
|
||||||
{
|
{
|
||||||
|
|
@ -253,14 +235,7 @@ namespace PepperDash.Essentials.DM
|
||||||
/// <param name="enable"></param>
|
/// <param name="enable"></param>
|
||||||
public void SetFreeRunEnabled(bool enable)
|
public void SetFreeRunEnabled(bool enable)
|
||||||
{
|
{
|
||||||
if (enable)
|
Tx.VgaInput.FreeRun = enable ? eDmFreeRunSetting.Enabled : eDmFreeRunSetting.Disabled;
|
||||||
{
|
|
||||||
Tx.VgaInput.FreeRun = eDmFreeRunSetting.Enabled;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Tx.VgaInput.FreeRun = eDmFreeRunSetting.Disabled;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -323,32 +298,35 @@ namespace PepperDash.Essentials.DM
|
||||||
var id = args.EventId;
|
var id = args.EventId;
|
||||||
Debug.Console(2, this, "EventId {0}", args.EventId);
|
Debug.Console(2, this, "EventId {0}", args.EventId);
|
||||||
|
|
||||||
if (id == EndpointTransmitterBase.VideoSourceFeedbackEventId)
|
switch (id)
|
||||||
{
|
{
|
||||||
|
case EndpointTransmitterBase.VideoSourceFeedbackEventId:
|
||||||
Debug.Console(2, this, " Video Source: {0}", Tx.VideoSourceFeedback);
|
Debug.Console(2, this, " Video Source: {0}", Tx.VideoSourceFeedback);
|
||||||
VideoSourceNumericFeedback.FireUpdate();
|
VideoSourceNumericFeedback.FireUpdate();
|
||||||
ActiveVideoInputFeedback.FireUpdate();
|
ActiveVideoInputFeedback.FireUpdate();
|
||||||
}
|
break;
|
||||||
|
case EndpointTransmitterBase.AudioSourceFeedbackEventId:
|
||||||
// ------------------------------ incomplete -----------------------------------------
|
|
||||||
else if (id == EndpointTransmitterBase.AudioSourceFeedbackEventId)
|
|
||||||
{
|
|
||||||
Debug.Console(2, this, " Audio Source: {0}", Tx.AudioSourceFeedback);
|
Debug.Console(2, this, " Audio Source: {0}", Tx.AudioSourceFeedback);
|
||||||
AudioSourceNumericFeedback.FireUpdate();
|
AudioSourceNumericFeedback.FireUpdate();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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}", Tx.ToString(), inputStream.ToString(), args.EventId.ToString());
|
||||||
|
|
||||||
if (args.EventId == EndpointInputStreamEventIds.HdcpSupportOffFeedbackEventId)
|
switch (args.EventId)
|
||||||
{
|
{
|
||||||
|
case EndpointInputStreamEventIds.HdcpSupportOffFeedbackEventId:
|
||||||
HdmiInHdcpCapabilityFeedback.FireUpdate();
|
HdmiInHdcpCapabilityFeedback.FireUpdate();
|
||||||
}
|
break;
|
||||||
else if (args.EventId == EndpointInputStreamEventIds.HdcpSupportOnFeedbackEventId)
|
case EndpointInputStreamEventIds.HdcpSupportOnFeedbackEventId:
|
||||||
{
|
|
||||||
HdmiInHdcpCapabilityFeedback.FireUpdate();
|
HdmiInHdcpCapabilityFeedback.FireUpdate();
|
||||||
|
break;
|
||||||
|
case EndpointInputStreamEventIds.SyncDetectedFeedbackEventId:
|
||||||
|
HdmiVideoSyncFeedback.FireUpdate();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -357,12 +335,13 @@ namespace PepperDash.Essentials.DM
|
||||||
/// </summary>
|
/// </summary>
|
||||||
void FowardInputStreamChange(RoutingInputPortWithVideoStatuses inputPort, int eventId)
|
void FowardInputStreamChange(RoutingInputPortWithVideoStatuses inputPort, int eventId)
|
||||||
{
|
{
|
||||||
if (eventId == EndpointInputStreamEventIds.SyncDetectedFeedbackEventId)
|
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
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,4 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
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;
|
||||||
|
|
@ -12,18 +8,16 @@ 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;
|
|
||||||
|
|
||||||
namespace PepperDash.Essentials.DM
|
namespace PepperDash.Essentials.DM
|
||||||
{
|
{
|
||||||
// using eVst = Crestron.SimplSharpPro.DeviceSupport.eX02VideoSourceType;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Controller class for all DM-TX-201C/S/F transmitters
|
/// Controller class for all DM-TX-201C/S/F transmitters
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class DmTx201CController : DmTxControllerBase, ITxRouting, IHasFeedback, IHasFreeRun, IVgaBrightnessContrastControls
|
[Description("Wrapper class for DM-TX-201-C")]
|
||||||
|
public class DmTx201CController : DmTxControllerBase, ITxRouting, IHasFreeRun, IVgaBrightnessContrastControls
|
||||||
{
|
{
|
||||||
public DmTx201C Tx { get; private set; } // uses the 201S class as it is the base class for the 201C
|
public DmTx201C Tx { get; private set; }
|
||||||
|
|
||||||
public RoutingInputPortWithVideoStatuses HdmiInput { get; private set; }
|
public RoutingInputPortWithVideoStatuses HdmiInput { get; private set; }
|
||||||
public RoutingInputPortWithVideoStatuses VgaInput { get; private set; }
|
public RoutingInputPortWithVideoStatuses VgaInput { get; private set; }
|
||||||
|
|
@ -107,43 +101,29 @@ namespace PepperDash.Essentials.DM
|
||||||
ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput",
|
ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput",
|
||||||
() => ActualActiveVideoInput.ToString());
|
() => ActualActiveVideoInput.ToString());
|
||||||
|
|
||||||
Tx.HdmiInput.InputStreamChange += new EndpointInputStreamChangeEventHandler(InputStreamChangeEvent);
|
Tx.HdmiInput.InputStreamChange += InputStreamChangeEvent;
|
||||||
|
Tx.VgaInput.InputStreamChange += VgaInputOnInputStreamChange;
|
||||||
Tx.BaseEvent += Tx_BaseEvent;
|
Tx.BaseEvent += Tx_BaseEvent;
|
||||||
Tx.OnlineStatusChange += new OnlineStatusChangeEventHandler(Tx_OnlineStatusChange);
|
Tx.OnlineStatusChange += new OnlineStatusChangeEventHandler(Tx_OnlineStatusChange);
|
||||||
|
|
||||||
VideoSourceNumericFeedback = new IntFeedback(() =>
|
VideoSourceNumericFeedback = new IntFeedback(() => (int)Tx.VideoSourceFeedback);
|
||||||
{
|
|
||||||
return (int)Tx.VideoSourceFeedback;
|
AudioSourceNumericFeedback = new IntFeedback(() => (int)Tx.AudioSourceFeedback);
|
||||||
});
|
|
||||||
AudioSourceNumericFeedback = new IntFeedback(() =>
|
|
||||||
{
|
|
||||||
return (int)Tx.AudioSourceFeedback;
|
|
||||||
});
|
|
||||||
|
|
||||||
HdmiInHdcpCapabilityFeedback = new IntFeedback("HdmiInHdcpCapability", () =>
|
HdmiInHdcpCapabilityFeedback = new IntFeedback("HdmiInHdcpCapability", () =>
|
||||||
{
|
(tx.HdmiInput.HdcpSupportOnFeedback.BoolValue ? 1 : 0));
|
||||||
if (tx.HdmiInput.HdcpSupportOnFeedback.BoolValue)
|
|
||||||
return 1;
|
|
||||||
else
|
|
||||||
return 0;
|
|
||||||
});
|
|
||||||
|
|
||||||
HdmiVideoSyncFeedback = new BoolFeedback(() =>
|
HdmiVideoSyncFeedback = new BoolFeedback(() => (bool)tx.HdmiInput.SyncDetectedFeedback.BoolValue);
|
||||||
{
|
|
||||||
return (bool)tx.HdmiInput.SyncDetectedFeedback.BoolValue;
|
|
||||||
});
|
|
||||||
|
|
||||||
VgaVideoSyncFeedback = new BoolFeedback(() =>
|
VgaVideoSyncFeedback = new BoolFeedback(() => (bool)tx.VgaInput.SyncDetectedFeedback.BoolValue);
|
||||||
{
|
|
||||||
return (bool)tx.VgaInput.SyncDetectedFeedback.BoolValue;
|
|
||||||
});
|
|
||||||
|
|
||||||
FreeRunEnabledFeedback = new BoolFeedback(() => tx.VgaInput.FreeRunFeedback == eDmFreeRunSetting.Enabled);
|
FreeRunEnabledFeedback = new BoolFeedback(() => tx.VgaInput.FreeRunFeedback == eDmFreeRunSetting.Enabled);
|
||||||
|
|
||||||
VgaBrightnessFeedback = new IntFeedback(() => tx.VgaInput.VideoControls.BrightnessFeedback.UShortValue);
|
VgaBrightnessFeedback = new IntFeedback(() => tx.VgaInput.VideoControls.BrightnessFeedback.UShortValue);
|
||||||
|
|
||||||
VgaContrastFeedback = new IntFeedback(() => tx.VgaInput.VideoControls.ContrastFeedback.UShortValue);
|
VgaContrastFeedback = new IntFeedback(() => tx.VgaInput.VideoControls.ContrastFeedback.UShortValue);
|
||||||
|
|
||||||
tx.VgaInput.VideoControls.ControlChange += new Crestron.SimplSharpPro.DeviceSupport.GenericEventHandler(VideoControls_ControlChange);
|
tx.VgaInput.VideoControls.ControlChange += VideoControls_ControlChange;
|
||||||
|
|
||||||
HdcpSupportCapability = eHdcpCapabilityType.HdcpAutoSupport;
|
HdcpSupportCapability = eHdcpCapabilityType.HdcpAutoSupport;
|
||||||
|
|
||||||
|
|
@ -153,21 +133,17 @@ namespace PepperDash.Essentials.DM
|
||||||
(ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital
|
(ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital
|
||||||
&& tx.HdmiInput.VideoAttributes.HdcpActiveFeedback.BoolValue),
|
&& tx.HdmiInput.VideoAttributes.HdcpActiveFeedback.BoolValue),
|
||||||
|
|
||||||
HdcpStateFeedbackFunc = () =>
|
HdcpStateFeedbackFunc = () => ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital ?
|
||||||
{
|
tx.HdmiInput.VideoAttributes.HdcpStateFeedback.ToString() : "",
|
||||||
if (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital)
|
|
||||||
return tx.HdmiInput.VideoAttributes.HdcpStateFeedback.ToString();
|
|
||||||
return "";
|
|
||||||
},
|
|
||||||
|
|
||||||
VideoResolutionFeedbackFunc = () =>
|
VideoResolutionFeedbackFunc = () =>
|
||||||
{
|
{
|
||||||
if (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital)
|
if (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital)
|
||||||
return tx.HdmiInput.VideoAttributes.GetVideoResolutionString();
|
return tx.HdmiInput.VideoAttributes.GetVideoResolutionString();
|
||||||
if (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Analog)
|
return ActualActiveVideoInput == DmTx200Base.eSourceSelection.Analog ?
|
||||||
return tx.VgaInput.VideoAttributes.GetVideoResolutionString();
|
tx.VgaInput.VideoAttributes.GetVideoResolutionString() : "";
|
||||||
return "";
|
|
||||||
},
|
},
|
||||||
|
|
||||||
VideoSyncFeedbackFunc = () =>
|
VideoSyncFeedbackFunc = () =>
|
||||||
(ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital
|
(ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital
|
||||||
&& tx.HdmiInput.SyncDetectedFeedback.BoolValue)
|
&& tx.HdmiInput.SyncDetectedFeedback.BoolValue)
|
||||||
|
|
@ -203,13 +179,14 @@ namespace PepperDash.Essentials.DM
|
||||||
var id = args.EventId;
|
var id = args.EventId;
|
||||||
Debug.Console(2, this, "EventId {0}", args.EventId);
|
Debug.Console(2, this, "EventId {0}", args.EventId);
|
||||||
|
|
||||||
if (id == VideoControlsEventIds.BrightnessFeedbackEventId)
|
switch (id)
|
||||||
{
|
{
|
||||||
|
case VideoControlsEventIds.BrightnessFeedbackEventId:
|
||||||
VgaBrightnessFeedback.FireUpdate();
|
VgaBrightnessFeedback.FireUpdate();
|
||||||
}
|
break;
|
||||||
else if (id == VideoControlsEventIds.ContrastFeedbackEventId)
|
case VideoControlsEventIds.ContrastFeedbackEventId:
|
||||||
{
|
|
||||||
VgaContrastFeedback.FireUpdate();
|
VgaContrastFeedback.FireUpdate();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -221,6 +198,19 @@ namespace PepperDash.Essentials.DM
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void VgaInputOnInputStreamChange(EndpointInputStream inputStream, EndpointInputStreamEventArgs args)
|
||||||
|
{
|
||||||
|
switch (args.EventId)
|
||||||
|
{
|
||||||
|
case EndpointInputStreamEventIds.FreeRunFeedbackEventId:
|
||||||
|
FreeRunEnabledFeedback.FireUpdate();
|
||||||
|
break;
|
||||||
|
case EndpointInputStreamEventIds.SyncDetectedFeedbackEventId:
|
||||||
|
VgaVideoSyncFeedback.FireUpdate();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public override bool CustomActivate()
|
public override bool CustomActivate()
|
||||||
{
|
{
|
||||||
Tx.HdmiInput.InputStreamChange += (o, a) => FowardInputStreamChange(HdmiInput, a.EventId);
|
Tx.HdmiInput.InputStreamChange += (o, a) => FowardInputStreamChange(HdmiInput, a.EventId);
|
||||||
|
|
@ -235,7 +225,7 @@ namespace PepperDash.Essentials.DM
|
||||||
|
|
||||||
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
||||||
{
|
{
|
||||||
DmTxControllerJoinMap joinMap = GetDmTxJoinMap(joinStart, joinMapKey);
|
var joinMap = GetDmTxJoinMap(joinStart, joinMapKey);
|
||||||
|
|
||||||
if (HdmiVideoSyncFeedback != null)
|
if (HdmiVideoSyncFeedback != null)
|
||||||
{
|
{
|
||||||
|
|
@ -255,14 +245,7 @@ namespace PepperDash.Essentials.DM
|
||||||
/// <param name="enable"></param>
|
/// <param name="enable"></param>
|
||||||
public void SetFreeRunEnabled(bool enable)
|
public void SetFreeRunEnabled(bool enable)
|
||||||
{
|
{
|
||||||
if (enable)
|
Tx.VgaInput.FreeRun = enable ? eDmFreeRunSetting.Enabled : eDmFreeRunSetting.Disabled;
|
||||||
{
|
|
||||||
Tx.VgaInput.FreeRun = eDmFreeRunSetting.Enabled;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Tx.VgaInput.FreeRun = eDmFreeRunSetting.Disabled;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -331,38 +314,38 @@ namespace PepperDash.Essentials.DM
|
||||||
var id = args.EventId;
|
var id = args.EventId;
|
||||||
Debug.Console(2, this, "EventId {0}", args.EventId);
|
Debug.Console(2, this, "EventId {0}", args.EventId);
|
||||||
|
|
||||||
if (id == EndpointTransmitterBase.VideoSourceFeedbackEventId)
|
switch (id)
|
||||||
{
|
{
|
||||||
|
case EndpointTransmitterBase.VideoSourceFeedbackEventId:
|
||||||
Debug.Console(2, this, " Video Source: {0}", Tx.VideoSourceFeedback);
|
Debug.Console(2, this, " Video Source: {0}", Tx.VideoSourceFeedback);
|
||||||
|
ActiveVideoInputFeedback.FireUpdate();
|
||||||
VideoSourceNumericFeedback.FireUpdate();
|
VideoSourceNumericFeedback.FireUpdate();
|
||||||
ActiveVideoInputFeedback.FireUpdate();
|
ActiveVideoInputFeedback.FireUpdate();
|
||||||
}
|
break;
|
||||||
|
case EndpointTransmitterBase.AudioSourceFeedbackEventId:
|
||||||
// ------------------------------ incomplete -----------------------------------------
|
Debug.Console(2, this, " Audio Source : {0}", Tx.AudioSourceFeedback);
|
||||||
else if (id == EndpointTransmitterBase.AudioSourceFeedbackEventId)
|
|
||||||
{
|
|
||||||
Debug.Console(2, this, " Audio Source: {0}", Tx.AudioSourceFeedback);
|
|
||||||
AudioSourceNumericFeedback.FireUpdate();
|
AudioSourceNumericFeedback.FireUpdate();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
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}", Tx.ToString(), inputStream.ToString(), args.EventId.ToString());
|
||||||
|
|
||||||
if (args.EventId == EndpointInputStreamEventIds.HdcpSupportOffFeedbackEventId)
|
switch (args.EventId)
|
||||||
{
|
{
|
||||||
|
case EndpointInputStreamEventIds.HdcpSupportOffFeedbackEventId:
|
||||||
HdmiInHdcpCapabilityFeedback.FireUpdate();
|
HdmiInHdcpCapabilityFeedback.FireUpdate();
|
||||||
}
|
break;
|
||||||
else if (args.EventId == EndpointInputStreamEventIds.HdcpSupportOnFeedbackEventId)
|
case EndpointInputStreamEventIds.HdcpSupportOnFeedbackEventId:
|
||||||
{
|
|
||||||
HdmiInHdcpCapabilityFeedback.FireUpdate();
|
HdmiInHdcpCapabilityFeedback.FireUpdate();
|
||||||
|
break;
|
||||||
|
case EndpointInputStreamEventIds.SyncDetectedFeedbackEventId:
|
||||||
|
HdmiVideoSyncFeedback.FireUpdate();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
else if (args.EventId == EndpointInputStreamEventIds.FreeRunFeedbackEventId)
|
|
||||||
{
|
|
||||||
FreeRunEnabledFeedback.FireUpdate();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -370,12 +353,13 @@ namespace PepperDash.Essentials.DM
|
||||||
/// </summary>
|
/// </summary>
|
||||||
void FowardInputStreamChange(RoutingInputPortWithVideoStatuses inputPort, int eventId)
|
void FowardInputStreamChange(RoutingInputPortWithVideoStatuses inputPort, int eventId)
|
||||||
{
|
{
|
||||||
if (eventId == EndpointInputStreamEventIds.SyncDetectedFeedbackEventId)
|
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
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,4 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
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;
|
||||||
|
|
@ -12,18 +8,16 @@ 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;
|
|
||||||
|
|
||||||
namespace PepperDash.Essentials.DM
|
namespace PepperDash.Essentials.DM
|
||||||
{
|
{
|
||||||
// using eVst = Crestron.SimplSharpPro.DeviceSupport.eX02VideoSourceType;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Controller class for all DM-TX-201C/S/F transmitters
|
/// Controller class for all DM-TX-201S/F transmitters
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class DmTx201SController : DmTxControllerBase, ITxRouting, IHasFeedback, IHasFreeRun, IVgaBrightnessContrastControls
|
[Description("Wrapper class for DM-TX-201-S/F")]
|
||||||
|
public class DmTx201SController : DmTxControllerBase, ITxRouting, IHasFreeRun, IVgaBrightnessContrastControls
|
||||||
{
|
{
|
||||||
public DmTx201S Tx { get; private set; } // uses the 201S class as it is the base class for the 201C
|
public DmTx201S Tx { get; private set; }
|
||||||
|
|
||||||
public RoutingInputPortWithVideoStatuses HdmiInput { get; private set; }
|
public RoutingInputPortWithVideoStatuses HdmiInput { get; private set; }
|
||||||
public RoutingInputPortWithVideoStatuses VgaInput { get; private set; }
|
public RoutingInputPortWithVideoStatuses VgaInput { get; private set; }
|
||||||
|
|
@ -107,43 +101,29 @@ namespace PepperDash.Essentials.DM
|
||||||
ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput",
|
ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput",
|
||||||
() => ActualActiveVideoInput.ToString());
|
() => ActualActiveVideoInput.ToString());
|
||||||
|
|
||||||
Tx.HdmiInput.InputStreamChange += new EndpointInputStreamChangeEventHandler(InputStreamChangeEvent);
|
Tx.HdmiInput.InputStreamChange += InputStreamChangeEvent;
|
||||||
|
Tx.VgaInput.InputStreamChange += VgaInputOnInputStreamChange;
|
||||||
Tx.BaseEvent += Tx_BaseEvent;
|
Tx.BaseEvent += Tx_BaseEvent;
|
||||||
Tx.OnlineStatusChange += new OnlineStatusChangeEventHandler(Tx_OnlineStatusChange);
|
Tx.OnlineStatusChange += new OnlineStatusChangeEventHandler(Tx_OnlineStatusChange);
|
||||||
|
|
||||||
VideoSourceNumericFeedback = new IntFeedback(() =>
|
VideoSourceNumericFeedback = new IntFeedback(() => (int)Tx.VideoSourceFeedback);
|
||||||
{
|
|
||||||
return (int)Tx.VideoSourceFeedback;
|
AudioSourceNumericFeedback = new IntFeedback(() => (int)Tx.AudioSourceFeedback);
|
||||||
});
|
|
||||||
AudioSourceNumericFeedback = new IntFeedback(() =>
|
|
||||||
{
|
|
||||||
return (int)Tx.AudioSourceFeedback;
|
|
||||||
});
|
|
||||||
|
|
||||||
HdmiInHdcpCapabilityFeedback = new IntFeedback("HdmiInHdcpCapability", () =>
|
HdmiInHdcpCapabilityFeedback = new IntFeedback("HdmiInHdcpCapability", () =>
|
||||||
{
|
(tx.HdmiInput.HdcpSupportOnFeedback.BoolValue ? 1 : 0));
|
||||||
if (tx.HdmiInput.HdcpSupportOnFeedback.BoolValue)
|
|
||||||
return 1;
|
|
||||||
else
|
|
||||||
return 0;
|
|
||||||
});
|
|
||||||
|
|
||||||
HdmiVideoSyncFeedback = new BoolFeedback(() =>
|
HdmiVideoSyncFeedback = new BoolFeedback(() => (bool)tx.HdmiInput.SyncDetectedFeedback.BoolValue);
|
||||||
{
|
|
||||||
return (bool)tx.HdmiInput.SyncDetectedFeedback.BoolValue;
|
|
||||||
});
|
|
||||||
|
|
||||||
VgaVideoSyncFeedback = new BoolFeedback(() =>
|
VgaVideoSyncFeedback = new BoolFeedback(() => (bool)tx.VgaInput.SyncDetectedFeedback.BoolValue);
|
||||||
{
|
|
||||||
return (bool)tx.VgaInput.SyncDetectedFeedback.BoolValue;
|
|
||||||
});
|
|
||||||
|
|
||||||
FreeRunEnabledFeedback = new BoolFeedback(() => tx.VgaInput.FreeRunFeedback == eDmFreeRunSetting.Enabled);
|
FreeRunEnabledFeedback = new BoolFeedback(() => tx.VgaInput.FreeRunFeedback == eDmFreeRunSetting.Enabled);
|
||||||
|
|
||||||
VgaBrightnessFeedback = new IntFeedback(() => tx.VgaInput.VideoControls.BrightnessFeedback.UShortValue);
|
VgaBrightnessFeedback = new IntFeedback(() => tx.VgaInput.VideoControls.BrightnessFeedback.UShortValue);
|
||||||
|
|
||||||
VgaContrastFeedback = new IntFeedback(() => tx.VgaInput.VideoControls.ContrastFeedback.UShortValue);
|
VgaContrastFeedback = new IntFeedback(() => tx.VgaInput.VideoControls.ContrastFeedback.UShortValue);
|
||||||
|
|
||||||
tx.VgaInput.VideoControls.ControlChange += new Crestron.SimplSharpPro.DeviceSupport.GenericEventHandler(VideoControls_ControlChange);
|
tx.VgaInput.VideoControls.ControlChange += VideoControls_ControlChange;
|
||||||
|
|
||||||
HdcpSupportCapability = eHdcpCapabilityType.HdcpAutoSupport;
|
HdcpSupportCapability = eHdcpCapabilityType.HdcpAutoSupport;
|
||||||
|
|
||||||
|
|
@ -153,21 +133,17 @@ namespace PepperDash.Essentials.DM
|
||||||
(ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital
|
(ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital
|
||||||
&& tx.HdmiInput.VideoAttributes.HdcpActiveFeedback.BoolValue),
|
&& tx.HdmiInput.VideoAttributes.HdcpActiveFeedback.BoolValue),
|
||||||
|
|
||||||
HdcpStateFeedbackFunc = () =>
|
HdcpStateFeedbackFunc = () => ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital ?
|
||||||
{
|
tx.HdmiInput.VideoAttributes.HdcpStateFeedback.ToString() : "",
|
||||||
if (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital)
|
|
||||||
return tx.HdmiInput.VideoAttributes.HdcpStateFeedback.ToString();
|
|
||||||
return "";
|
|
||||||
},
|
|
||||||
|
|
||||||
VideoResolutionFeedbackFunc = () =>
|
VideoResolutionFeedbackFunc = () =>
|
||||||
{
|
{
|
||||||
if (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital)
|
if (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital)
|
||||||
return tx.HdmiInput.VideoAttributes.GetVideoResolutionString();
|
return tx.HdmiInput.VideoAttributes.GetVideoResolutionString();
|
||||||
if (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Analog)
|
return ActualActiveVideoInput == DmTx200Base.eSourceSelection.Analog ?
|
||||||
return tx.VgaInput.VideoAttributes.GetVideoResolutionString();
|
tx.VgaInput.VideoAttributes.GetVideoResolutionString() : "";
|
||||||
return "";
|
|
||||||
},
|
},
|
||||||
|
|
||||||
VideoSyncFeedbackFunc = () =>
|
VideoSyncFeedbackFunc = () =>
|
||||||
(ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital
|
(ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital
|
||||||
&& tx.HdmiInput.SyncDetectedFeedback.BoolValue)
|
&& tx.HdmiInput.SyncDetectedFeedback.BoolValue)
|
||||||
|
|
@ -203,13 +179,14 @@ namespace PepperDash.Essentials.DM
|
||||||
var id = args.EventId;
|
var id = args.EventId;
|
||||||
Debug.Console(2, this, "EventId {0}", args.EventId);
|
Debug.Console(2, this, "EventId {0}", args.EventId);
|
||||||
|
|
||||||
if (id == VideoControlsEventIds.BrightnessFeedbackEventId)
|
switch (id)
|
||||||
{
|
{
|
||||||
|
case VideoControlsEventIds.BrightnessFeedbackEventId:
|
||||||
VgaBrightnessFeedback.FireUpdate();
|
VgaBrightnessFeedback.FireUpdate();
|
||||||
}
|
break;
|
||||||
else if (id == VideoControlsEventIds.ContrastFeedbackEventId)
|
case VideoControlsEventIds.ContrastFeedbackEventId:
|
||||||
{
|
|
||||||
VgaContrastFeedback.FireUpdate();
|
VgaContrastFeedback.FireUpdate();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -221,6 +198,19 @@ namespace PepperDash.Essentials.DM
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void VgaInputOnInputStreamChange(EndpointInputStream inputStream, EndpointInputStreamEventArgs args)
|
||||||
|
{
|
||||||
|
switch (args.EventId)
|
||||||
|
{
|
||||||
|
case EndpointInputStreamEventIds.FreeRunFeedbackEventId:
|
||||||
|
FreeRunEnabledFeedback.FireUpdate();
|
||||||
|
break;
|
||||||
|
case EndpointInputStreamEventIds.SyncDetectedFeedbackEventId:
|
||||||
|
VgaVideoSyncFeedback.FireUpdate();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public override bool CustomActivate()
|
public override bool CustomActivate()
|
||||||
{
|
{
|
||||||
Tx.HdmiInput.InputStreamChange += (o, a) => FowardInputStreamChange(HdmiInput, a.EventId);
|
Tx.HdmiInput.InputStreamChange += (o, a) => FowardInputStreamChange(HdmiInput, a.EventId);
|
||||||
|
|
@ -235,7 +225,7 @@ namespace PepperDash.Essentials.DM
|
||||||
|
|
||||||
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
||||||
{
|
{
|
||||||
DmTxControllerJoinMap joinMap = GetDmTxJoinMap(joinStart, joinMapKey);
|
var joinMap = GetDmTxJoinMap(joinStart, joinMapKey);
|
||||||
|
|
||||||
if (HdmiVideoSyncFeedback != null)
|
if (HdmiVideoSyncFeedback != null)
|
||||||
{
|
{
|
||||||
|
|
@ -255,14 +245,7 @@ namespace PepperDash.Essentials.DM
|
||||||
/// <param name="enable"></param>
|
/// <param name="enable"></param>
|
||||||
public void SetFreeRunEnabled(bool enable)
|
public void SetFreeRunEnabled(bool enable)
|
||||||
{
|
{
|
||||||
if (enable)
|
Tx.VgaInput.FreeRun = enable ? eDmFreeRunSetting.Enabled : eDmFreeRunSetting.Disabled;
|
||||||
{
|
|
||||||
Tx.VgaInput.FreeRun = eDmFreeRunSetting.Enabled;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Tx.VgaInput.FreeRun = eDmFreeRunSetting.Disabled;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -331,38 +314,38 @@ namespace PepperDash.Essentials.DM
|
||||||
var id = args.EventId;
|
var id = args.EventId;
|
||||||
Debug.Console(2, this, "EventId {0}", args.EventId);
|
Debug.Console(2, this, "EventId {0}", args.EventId);
|
||||||
|
|
||||||
if (id == EndpointTransmitterBase.VideoSourceFeedbackEventId)
|
switch (id)
|
||||||
{
|
{
|
||||||
|
case EndpointTransmitterBase.VideoSourceFeedbackEventId:
|
||||||
Debug.Console(2, this, " Video Source: {0}", Tx.VideoSourceFeedback);
|
Debug.Console(2, this, " Video Source: {0}", Tx.VideoSourceFeedback);
|
||||||
|
ActiveVideoInputFeedback.FireUpdate();
|
||||||
VideoSourceNumericFeedback.FireUpdate();
|
VideoSourceNumericFeedback.FireUpdate();
|
||||||
ActiveVideoInputFeedback.FireUpdate();
|
ActiveVideoInputFeedback.FireUpdate();
|
||||||
}
|
break;
|
||||||
|
case EndpointTransmitterBase.AudioSourceFeedbackEventId:
|
||||||
// ------------------------------ incomplete -----------------------------------------
|
Debug.Console(2, this, " Audio Source : {0}", Tx.AudioSourceFeedback);
|
||||||
else if (id == EndpointTransmitterBase.AudioSourceFeedbackEventId)
|
|
||||||
{
|
|
||||||
Debug.Console(2, this, " Audio Source: {0}", Tx.AudioSourceFeedback);
|
|
||||||
AudioSourceNumericFeedback.FireUpdate();
|
AudioSourceNumericFeedback.FireUpdate();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
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}", Tx.ToString(), inputStream.ToString(), args.EventId.ToString());
|
||||||
|
|
||||||
if (args.EventId == EndpointInputStreamEventIds.HdcpSupportOffFeedbackEventId)
|
switch (args.EventId)
|
||||||
{
|
{
|
||||||
|
case EndpointInputStreamEventIds.HdcpSupportOffFeedbackEventId:
|
||||||
HdmiInHdcpCapabilityFeedback.FireUpdate();
|
HdmiInHdcpCapabilityFeedback.FireUpdate();
|
||||||
}
|
break;
|
||||||
else if (args.EventId == EndpointInputStreamEventIds.HdcpSupportOnFeedbackEventId)
|
case EndpointInputStreamEventIds.HdcpSupportOnFeedbackEventId:
|
||||||
{
|
|
||||||
HdmiInHdcpCapabilityFeedback.FireUpdate();
|
HdmiInHdcpCapabilityFeedback.FireUpdate();
|
||||||
|
break;
|
||||||
|
case EndpointInputStreamEventIds.SyncDetectedFeedbackEventId:
|
||||||
|
HdmiVideoSyncFeedback.FireUpdate();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
else if (args.EventId == EndpointInputStreamEventIds.FreeRunFeedbackEventId)
|
|
||||||
{
|
|
||||||
FreeRunEnabledFeedback.FireUpdate();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -370,12 +353,13 @@ namespace PepperDash.Essentials.DM
|
||||||
/// </summary>
|
/// </summary>
|
||||||
void FowardInputStreamChange(RoutingInputPortWithVideoStatuses inputPort, int eventId)
|
void FowardInputStreamChange(RoutingInputPortWithVideoStatuses inputPort, int eventId)
|
||||||
{
|
{
|
||||||
if (eventId == EndpointInputStreamEventIds.SyncDetectedFeedbackEventId)
|
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
|
||||||
|
|
|
||||||
|
|
@ -19,12 +19,11 @@ namespace PepperDash.Essentials.DM
|
||||||
{
|
{
|
||||||
using eVst = DmTx401C.eSourceSelection;
|
using eVst = DmTx401C.eSourceSelection;
|
||||||
|
|
||||||
public class DmTx401CController : DmTxControllerBase, ITxRouting, IHasFeedback, IIROutputPorts, IComPorts, IHasFreeRun, IVgaBrightnessContrastControls
|
[Description("Wrapper class for DM-TX-401-C")]
|
||||||
|
public class DmTx401CController : DmTxControllerBase, ITxRouting, IIROutputPorts, IComPorts, IHasFreeRun, IVgaBrightnessContrastControls
|
||||||
{
|
{
|
||||||
public DmTx401C Tx { get; private set; }
|
public DmTx401C Tx { get; private set; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public RoutingInputPortWithVideoStatuses HdmiIn { get; private set; }
|
public RoutingInputPortWithVideoStatuses HdmiIn { get; private set; }
|
||||||
public RoutingInputPortWithVideoStatuses DisplayPortIn { get; private set; }
|
public RoutingInputPortWithVideoStatuses DisplayPortIn { get; private set; }
|
||||||
public RoutingInputPortWithVideoStatuses VgaIn { get; private set; }
|
public RoutingInputPortWithVideoStatuses VgaIn { get; private set; }
|
||||||
|
|
@ -116,51 +115,36 @@ namespace PepperDash.Essentials.DM
|
||||||
eRoutingSignalType.Video, eRoutingPortConnectionType.Composite, eVst.Composite, this,
|
eRoutingSignalType.Video, eRoutingPortConnectionType.Composite, eVst.Composite, this,
|
||||||
VideoStatusHelper.GetVgaInputStatusFuncs(tx.VgaInput));
|
VideoStatusHelper.GetVgaInputStatusFuncs(tx.VgaInput));
|
||||||
|
|
||||||
|
Tx.HdmiInput.InputStreamChange += HdmiInputStreamChangeEvent;
|
||||||
|
Tx.DisplayPortInput.InputStreamChange += DisplayPortInputStreamChangeEvent;
|
||||||
Tx.BaseEvent += Tx_BaseEvent;
|
Tx.BaseEvent += Tx_BaseEvent;
|
||||||
|
Tx.VgaInput.InputStreamChange += VgaInputOnInputStreamChange;
|
||||||
|
tx.VgaInput.VideoControls.ControlChange += VideoControls_ControlChange;
|
||||||
|
|
||||||
|
|
||||||
ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput",
|
ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput",
|
||||||
() => ActualVideoInput.ToString());
|
() => ActualVideoInput.ToString());
|
||||||
|
|
||||||
VideoSourceNumericFeedback = new IntFeedback(() =>
|
VideoSourceNumericFeedback = new IntFeedback(() => (int)Tx.VideoSourceFeedback);
|
||||||
{
|
|
||||||
return (int)Tx.VideoSourceFeedback;
|
|
||||||
});
|
|
||||||
AudioSourceNumericFeedback = new IntFeedback(() =>
|
|
||||||
{
|
|
||||||
return (int)Tx.AudioSourceFeedback;
|
|
||||||
});
|
|
||||||
|
|
||||||
HdmiInHdcpCapabilityFeedback = new IntFeedback("HdmiInHdcpCapability", () =>
|
AudioSourceNumericFeedback = new IntFeedback(() => (int)Tx.AudioSourceFeedback);
|
||||||
{
|
|
||||||
if (tx.HdmiInput.HdcpSupportOnFeedback.BoolValue)
|
HdmiInHdcpCapabilityFeedback = new IntFeedback("HdmiInHdcpCapability", () => tx.HdmiInput.HdcpSupportOnFeedback.BoolValue ? 1 : 0);
|
||||||
return 1;
|
|
||||||
else
|
|
||||||
return 0;
|
|
||||||
});
|
|
||||||
|
|
||||||
HdcpSupportCapability = eHdcpCapabilityType.HdcpAutoSupport;
|
HdcpSupportCapability = eHdcpCapabilityType.HdcpAutoSupport;
|
||||||
|
|
||||||
DisplayPortVideoSyncFeedback = new BoolFeedback("DisplayPortVideoSync", () =>
|
DisplayPortVideoSyncFeedback = new BoolFeedback("DisplayPortVideoSync", () => (bool)tx.DisplayPortInput.SyncDetectedFeedback.BoolValue);
|
||||||
{
|
|
||||||
return (bool)tx.DisplayPortInput.SyncDetectedFeedback.BoolValue;
|
|
||||||
});
|
|
||||||
|
|
||||||
HdmiVideoSyncFeedback = new BoolFeedback(() =>
|
HdmiVideoSyncFeedback = new BoolFeedback(() => (bool)tx.HdmiInput.SyncDetectedFeedback.BoolValue);
|
||||||
{
|
|
||||||
return (bool)tx.HdmiInput.SyncDetectedFeedback.BoolValue;
|
|
||||||
});
|
|
||||||
|
|
||||||
VgaVideoSyncFeedback = new BoolFeedback(() =>
|
VgaVideoSyncFeedback = new BoolFeedback(() => (bool)tx.VgaInput.SyncDetectedFeedback.BoolValue);
|
||||||
{
|
|
||||||
return (bool)tx.VgaInput.SyncDetectedFeedback.BoolValue;
|
|
||||||
});
|
|
||||||
|
|
||||||
FreeRunEnabledFeedback = new BoolFeedback(() => tx.VgaInput.FreeRunFeedback == eDmFreeRunSetting.Enabled);
|
FreeRunEnabledFeedback = new BoolFeedback(() => tx.VgaInput.FreeRunFeedback == eDmFreeRunSetting.Enabled);
|
||||||
|
|
||||||
VgaBrightnessFeedback = new IntFeedback(() => tx.VgaInput.VideoControls.BrightnessFeedback.UShortValue);
|
VgaBrightnessFeedback = new IntFeedback(() => tx.VgaInput.VideoControls.BrightnessFeedback.UShortValue);
|
||||||
|
|
||||||
VgaContrastFeedback = new IntFeedback(() => tx.VgaInput.VideoControls.ContrastFeedback.UShortValue);
|
VgaContrastFeedback = new IntFeedback(() => tx.VgaInput.VideoControls.ContrastFeedback.UShortValue);
|
||||||
|
|
||||||
tx.VgaInput.VideoControls.ControlChange += new Crestron.SimplSharpPro.DeviceSupport.GenericEventHandler(VideoControls_ControlChange);
|
|
||||||
|
|
||||||
var combinedFuncs = new VideoStatusFuncsWrapper
|
var combinedFuncs = new VideoStatusFuncsWrapper
|
||||||
{
|
{
|
||||||
|
|
@ -238,7 +222,7 @@ namespace PepperDash.Essentials.DM
|
||||||
|
|
||||||
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
||||||
{
|
{
|
||||||
DmTxControllerJoinMap joinMap = GetDmTxJoinMap(joinStart, joinMapKey);
|
var joinMap = GetDmTxJoinMap(joinStart, joinMapKey);
|
||||||
|
|
||||||
if (HdmiVideoSyncFeedback != null)
|
if (HdmiVideoSyncFeedback != null)
|
||||||
{
|
{
|
||||||
|
|
@ -303,33 +287,35 @@ namespace PepperDash.Essentials.DM
|
||||||
void Tx_BaseEvent(GenericBase device, BaseEventArgs args)
|
void Tx_BaseEvent(GenericBase device, BaseEventArgs args)
|
||||||
{
|
{
|
||||||
var id = args.EventId;
|
var id = args.EventId;
|
||||||
if (id == EndpointTransmitterBase.VideoSourceFeedbackEventId)
|
Debug.Console(2, this, "EventId {0}", args.EventId);
|
||||||
|
|
||||||
|
switch (id)
|
||||||
{
|
{
|
||||||
|
case EndpointTransmitterBase.VideoSourceFeedbackEventId:
|
||||||
Debug.Console(2, this, " Video Source: {0}", Tx.VideoSourceFeedback);
|
Debug.Console(2, this, " Video Source: {0}", Tx.VideoSourceFeedback);
|
||||||
VideoSourceNumericFeedback.FireUpdate();
|
VideoSourceNumericFeedback.FireUpdate();
|
||||||
ActiveVideoInputFeedback.FireUpdate();
|
ActiveVideoInputFeedback.FireUpdate();
|
||||||
}
|
break;
|
||||||
|
case EndpointTransmitterBase.AudioSourceFeedbackEventId:
|
||||||
// ------------------------------ incomplete -----------------------------------------
|
|
||||||
else if (id == EndpointTransmitterBase.AudioSourceFeedbackEventId)
|
|
||||||
{
|
|
||||||
Debug.Console(2, this, " Audio Source: {0}", Tx.AudioSourceFeedback);
|
Debug.Console(2, this, " Audio Source: {0}", Tx.AudioSourceFeedback);
|
||||||
AudioSourceNumericFeedback.FireUpdate();
|
AudioSourceNumericFeedback.FireUpdate();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void VideoControls_ControlChange(object sender, Crestron.SimplSharpPro.DeviceSupport.GenericEventArgs args)
|
void VideoControls_ControlChange(object sender, GenericEventArgs args)
|
||||||
{
|
{
|
||||||
var id = args.EventId;
|
var id = args.EventId;
|
||||||
Debug.Console(2, this, "EventId {0}", args.EventId);
|
Debug.Console(2, this, "EventId {0}", args.EventId);
|
||||||
|
|
||||||
if (id == VideoControlsEventIds.BrightnessFeedbackEventId)
|
switch (id)
|
||||||
{
|
{
|
||||||
|
case VideoControlsEventIds.BrightnessFeedbackEventId:
|
||||||
VgaBrightnessFeedback.FireUpdate();
|
VgaBrightnessFeedback.FireUpdate();
|
||||||
}
|
break;
|
||||||
else if (id == VideoControlsEventIds.ContrastFeedbackEventId)
|
case VideoControlsEventIds.ContrastFeedbackEventId:
|
||||||
{
|
|
||||||
VgaContrastFeedback.FireUpdate();
|
VgaContrastFeedback.FireUpdate();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -339,14 +325,7 @@ namespace PepperDash.Essentials.DM
|
||||||
/// <param name="enable"></param>
|
/// <param name="enable"></param>
|
||||||
public void SetFreeRunEnabled(bool enable)
|
public void SetFreeRunEnabled(bool enable)
|
||||||
{
|
{
|
||||||
if (enable)
|
Tx.VgaInput.FreeRun = enable ? eDmFreeRunSetting.Enabled : eDmFreeRunSetting.Disabled;
|
||||||
{
|
|
||||||
Tx.VgaInput.FreeRun = eDmFreeRunSetting.Enabled;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Tx.VgaInput.FreeRun = eDmFreeRunSetting.Disabled;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -372,12 +351,13 @@ namespace PepperDash.Essentials.DM
|
||||||
/// </summary>
|
/// </summary>
|
||||||
void FowardInputStreamChange(RoutingInputPortWithVideoStatuses inputPort, int eventId)
|
void FowardInputStreamChange(RoutingInputPortWithVideoStatuses inputPort, int eventId)
|
||||||
{
|
{
|
||||||
if (eventId == EndpointInputStreamEventIds.SyncDetectedFeedbackEventId)
|
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
|
||||||
|
|
@ -409,6 +389,50 @@ namespace PepperDash.Essentials.DM
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void HdmiInputStreamChangeEvent(EndpointInputStream inputStream, EndpointInputStreamEventArgs args)
|
||||||
|
{
|
||||||
|
Debug.Console(2, "{0} event {1} stream {2}", Tx.ToString(), inputStream.ToString(), args.EventId.ToString());
|
||||||
|
|
||||||
|
switch (args.EventId)
|
||||||
|
{
|
||||||
|
case EndpointInputStreamEventIds.HdcpSupportOffFeedbackEventId:
|
||||||
|
HdmiInHdcpCapabilityFeedback.FireUpdate();
|
||||||
|
break;
|
||||||
|
case EndpointInputStreamEventIds.HdcpSupportOnFeedbackEventId:
|
||||||
|
HdmiInHdcpCapabilityFeedback.FireUpdate();
|
||||||
|
break;
|
||||||
|
case EndpointInputStreamEventIds.SyncDetectedFeedbackEventId:
|
||||||
|
HdmiVideoSyncFeedback.FireUpdate();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void DisplayPortInputStreamChangeEvent(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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void VgaInputOnInputStreamChange(EndpointInputStream inputStream, EndpointInputStreamEventArgs args)
|
||||||
|
{
|
||||||
|
switch (args.EventId)
|
||||||
|
{
|
||||||
|
case EndpointInputStreamEventIds.FreeRunFeedbackEventId:
|
||||||
|
FreeRunEnabledFeedback.FireUpdate();
|
||||||
|
break;
|
||||||
|
case EndpointInputStreamEventIds.SyncDetectedFeedbackEventId:
|
||||||
|
VgaVideoSyncFeedback.FireUpdate();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#region IIROutputPorts Members
|
#region IIROutputPorts Members
|
||||||
public CrestronCollection<IROutputPort> IROutputPorts { get { return Tx.IROutputPorts; } }
|
public CrestronCollection<IROutputPort> IROutputPorts { get { return Tx.IROutputPorts; } }
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ namespace PepperDash.Essentials.DM
|
||||||
using eVst = eX02VideoSourceType;
|
using eVst = eX02VideoSourceType;
|
||||||
using eAst = eX02AudioSourceType;
|
using eAst = eX02AudioSourceType;
|
||||||
|
|
||||||
|
[Description("Wrapper class for DM-TX-4K-100-C-1G")]
|
||||||
public class DmTx4k100Controller : DmTxControllerBase, IRoutingInputsOutputs,
|
public class DmTx4k100Controller : DmTxControllerBase, IRoutingInputsOutputs,
|
||||||
IIROutputPorts, IComPorts, ICec
|
IIROutputPorts, IComPorts, ICec
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -20,10 +20,11 @@ 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")]
|
||||||
public class DmTx4k202CController : DmTxControllerBase, ITxRouting, IHasFeedback,
|
public class DmTx4k202CController : DmTxControllerBase, ITxRouting, IHasFeedback,
|
||||||
IIROutputPorts, IComPorts
|
IIROutputPorts, IComPorts
|
||||||
{
|
{
|
||||||
public DmTx4kX02CBase 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; }
|
||||||
|
|
@ -80,7 +81,7 @@ namespace PepperDash.Essentials.DM
|
||||||
return new RoutingPortCollection<RoutingOutputPort> { DmOut, HdmiLoopOut };
|
return new RoutingPortCollection<RoutingOutputPort> { DmOut, HdmiLoopOut };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public DmTx4k202CController(string key, string name, DmTx4kX02CBase tx)
|
public DmTx4k202CController(string key, string name, DmTx4k202C tx)
|
||||||
: base(key, name, tx)
|
: base(key, name, tx)
|
||||||
{
|
{
|
||||||
Tx = tx;
|
Tx = tx;
|
||||||
|
|
@ -98,38 +99,22 @@ 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.BaseEvent += Tx_BaseEvent;
|
Tx.BaseEvent += Tx_BaseEvent;
|
||||||
|
|
||||||
VideoSourceNumericFeedback = new IntFeedback(() =>
|
VideoSourceNumericFeedback = new IntFeedback(() => (int)Tx.VideoSourceFeedback);
|
||||||
{
|
|
||||||
return (int)Tx.VideoSourceFeedback;
|
|
||||||
});
|
|
||||||
AudioSourceNumericFeedback = new IntFeedback(() =>
|
|
||||||
{
|
|
||||||
return (int)Tx.AudioSourceFeedback;
|
|
||||||
});
|
|
||||||
|
|
||||||
HdmiIn1HdcpCapabilityFeedback = new IntFeedback("HdmiIn1HdcpCapability", () =>
|
AudioSourceNumericFeedback = new IntFeedback(() => (int)Tx.AudioSourceFeedback);
|
||||||
{
|
|
||||||
return (int)tx.HdmiInputs[1].HdcpCapabilityFeedback;
|
|
||||||
});
|
|
||||||
|
|
||||||
HdmiIn2HdcpCapabilityFeedback = new IntFeedback("HdmiIn2HdcpCapability", () =>
|
HdmiIn1HdcpCapabilityFeedback = new IntFeedback("HdmiIn1HdcpCapability", () => (int)tx.HdmiInputs[1].HdcpCapabilityFeedback);
|
||||||
{
|
|
||||||
return (int)tx.HdmiInputs[2].HdcpCapabilityFeedback;
|
HdmiIn2HdcpCapabilityFeedback = new IntFeedback("HdmiIn2HdcpCapability", () => (int)tx.HdmiInputs[2].HdcpCapabilityFeedback);
|
||||||
});
|
|
||||||
|
|
||||||
HdcpSupportCapability = eHdcpCapabilityType.Hdcp2_2Support;
|
HdcpSupportCapability = eHdcpCapabilityType.Hdcp2_2Support;
|
||||||
|
|
||||||
Hdmi1VideoSyncFeedback = new BoolFeedback(() =>
|
Hdmi1VideoSyncFeedback = new BoolFeedback(() => (bool)tx.HdmiInputs[1].SyncDetectedFeedback.BoolValue);
|
||||||
{
|
|
||||||
return (bool)tx.HdmiInputs[1].SyncDetectedFeedback.BoolValue;
|
|
||||||
});
|
|
||||||
|
|
||||||
Hdmi2VideoSyncFeedback = new BoolFeedback(() =>
|
Hdmi2VideoSyncFeedback = new BoolFeedback(() => (bool)tx.HdmiInputs[2].SyncDetectedFeedback.BoolValue);
|
||||||
{
|
|
||||||
return (bool)tx.HdmiInputs[2].SyncDetectedFeedback.BoolValue;
|
|
||||||
});
|
|
||||||
|
|
||||||
var combinedFuncs = new VideoStatusFuncsWrapper
|
var combinedFuncs = new VideoStatusFuncsWrapper
|
||||||
{
|
{
|
||||||
|
|
@ -203,7 +188,7 @@ namespace PepperDash.Essentials.DM
|
||||||
|
|
||||||
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
||||||
{
|
{
|
||||||
DmTxControllerJoinMap joinMap = GetDmTxJoinMap(joinStart, joinMapKey);
|
var joinMap = GetDmTxJoinMap(joinStart, joinMapKey);
|
||||||
|
|
||||||
if (Hdmi1VideoSyncFeedback != null)
|
if (Hdmi1VideoSyncFeedback != null)
|
||||||
{
|
{
|
||||||
|
|
@ -221,8 +206,9 @@ 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);
|
||||||
|
|
||||||
if (type == eRoutingSignalType.Video)
|
switch (type)
|
||||||
{
|
{
|
||||||
|
case eRoutingSignalType.Video:
|
||||||
switch (input)
|
switch (input)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
|
|
@ -246,9 +232,8 @@ namespace PepperDash.Essentials.DM
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
break;
|
||||||
else if (type == eRoutingSignalType.Audio)
|
case eRoutingSignalType.Audio:
|
||||||
{
|
|
||||||
switch (input)
|
switch (input)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
|
|
@ -272,6 +257,7 @@ namespace PepperDash.Essentials.DM
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -287,37 +273,40 @@ namespace PepperDash.Essentials.DM
|
||||||
{
|
{
|
||||||
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());
|
||||||
|
|
||||||
if (args.EventId == EndpointInputStreamEventIds.HdcpSupportOffFeedbackEventId)
|
switch (args.EventId)
|
||||||
{
|
{
|
||||||
if (inputStream == Tx.HdmiInputs[1])
|
case EndpointInputStreamEventIds.HdcpSupportOffFeedbackEventId:
|
||||||
HdmiIn1HdcpCapabilityFeedback.FireUpdate();
|
if (inputStream == Tx.HdmiInputs[1]) HdmiIn1HdcpCapabilityFeedback.FireUpdate();
|
||||||
else if (inputStream == Tx.HdmiInputs[2])
|
if (inputStream == Tx.HdmiInputs[2]) HdmiIn2HdcpCapabilityFeedback.FireUpdate();
|
||||||
HdmiIn2HdcpCapabilityFeedback.FireUpdate();
|
break;
|
||||||
}
|
case EndpointInputStreamEventIds.HdcpSupportOnFeedbackEventId:
|
||||||
else if (args.EventId == EndpointInputStreamEventIds.HdcpSupportOnFeedbackEventId)
|
if (inputStream == Tx.HdmiInputs[1]) HdmiIn1HdcpCapabilityFeedback.FireUpdate();
|
||||||
{
|
if (inputStream == Tx.HdmiInputs[2]) HdmiIn2HdcpCapabilityFeedback.FireUpdate();
|
||||||
if (inputStream == Tx.HdmiInputs[1])
|
break;
|
||||||
HdmiIn1HdcpCapabilityFeedback.FireUpdate();
|
case EndpointInputStreamEventIds.SyncDetectedFeedbackEventId:
|
||||||
else if (inputStream == Tx.HdmiInputs[2])
|
if (inputStream == Tx.HdmiInputs[1]) Hdmi1VideoSyncFeedback.FireUpdate();
|
||||||
HdmiIn2HdcpCapabilityFeedback.FireUpdate();
|
if (inputStream == Tx.HdmiInputs[2]) Hdmi2VideoSyncFeedback.FireUpdate();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Tx_BaseEvent(GenericBase device, BaseEventArgs args)
|
void Tx_BaseEvent(GenericBase device, BaseEventArgs args)
|
||||||
{
|
{
|
||||||
var id = args.EventId;
|
var id = args.EventId;
|
||||||
if (id == EndpointTransmitterBase.VideoSourceFeedbackEventId)
|
Debug.Console(2, this, "EventId {0}", args.EventId);
|
||||||
|
|
||||||
|
switch (id)
|
||||||
{
|
{
|
||||||
|
case EndpointTransmitterBase.VideoSourceFeedbackEventId:
|
||||||
Debug.Console(2, this, " Video Source: {0}", Tx.VideoSourceFeedback);
|
Debug.Console(2, this, " Video Source: {0}", Tx.VideoSourceFeedback);
|
||||||
|
ActiveVideoInputFeedback.FireUpdate();
|
||||||
VideoSourceNumericFeedback.FireUpdate();
|
VideoSourceNumericFeedback.FireUpdate();
|
||||||
ActiveVideoInputFeedback.FireUpdate();
|
ActiveVideoInputFeedback.FireUpdate();
|
||||||
}
|
break;
|
||||||
|
case EndpointTransmitterBase.AudioSourceFeedbackEventId:
|
||||||
// ------------------------------ incomplete -----------------------------------------
|
Debug.Console(2, this, " Audio Source : {0}", Tx.AudioSourceFeedback);
|
||||||
else if (id == EndpointTransmitterBase.AudioSourceFeedbackEventId)
|
|
||||||
{
|
|
||||||
Debug.Console(2, this, " Audio Source: {0}", Tx.AudioSourceFeedback);
|
|
||||||
AudioSourceNumericFeedback.FireUpdate();
|
AudioSourceNumericFeedback.FireUpdate();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -326,12 +315,13 @@ namespace PepperDash.Essentials.DM
|
||||||
/// </summary>
|
/// </summary>
|
||||||
void FowardInputStreamChange(RoutingInputPortWithVideoStatuses inputPort, int eventId)
|
void FowardInputStreamChange(RoutingInputPortWithVideoStatuses inputPort, int eventId)
|
||||||
{
|
{
|
||||||
if (eventId == EndpointInputStreamEventIds.SyncDetectedFeedbackEventId)
|
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
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@ 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")]
|
||||||
public class DmTx4k302CController : DmTxControllerBase, ITxRouting, IHasFeedback,
|
public class DmTx4k302CController : DmTxControllerBase, ITxRouting, IHasFeedback,
|
||||||
IIROutputPorts, IComPorts, IHasFreeRun, IVgaBrightnessContrastControls
|
IIROutputPorts, IComPorts, IHasFreeRun, IVgaBrightnessContrastControls
|
||||||
{
|
{
|
||||||
|
|
@ -106,43 +107,23 @@ 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.VgaInput.InputStreamChange += VgaInputOnInputStreamChange;
|
||||||
Tx.BaseEvent += Tx_BaseEvent;
|
Tx.BaseEvent += Tx_BaseEvent;
|
||||||
|
|
||||||
VideoSourceNumericFeedback = new IntFeedback(() =>
|
VideoSourceNumericFeedback = new IntFeedback(() => (int)Tx.VideoSourceFeedback);
|
||||||
{
|
AudioSourceNumericFeedback = new IntFeedback(() => (int)Tx.AudioSourceFeedback);
|
||||||
return (int)Tx.VideoSourceFeedback;
|
|
||||||
});
|
|
||||||
AudioSourceNumericFeedback = new IntFeedback(() =>
|
|
||||||
{
|
|
||||||
return (int)Tx.AudioSourceFeedback;
|
|
||||||
});
|
|
||||||
|
|
||||||
HdmiIn1HdcpCapabilityFeedback = new IntFeedback("HdmiIn1HdcpCapability", () =>
|
HdmiIn1HdcpCapabilityFeedback = new IntFeedback("HdmiIn1HdcpCapability", () => (int)tx.HdmiInputs[1].HdcpCapabilityFeedback);
|
||||||
{
|
|
||||||
return (int)tx.HdmiInputs[1].HdcpCapabilityFeedback;
|
|
||||||
});
|
|
||||||
|
|
||||||
HdmiIn2HdcpCapabilityFeedback = new IntFeedback("HdmiIn2HdcpCapability", () =>
|
HdmiIn2HdcpCapabilityFeedback = new IntFeedback("HdmiIn2HdcpCapability", () => (int)tx.HdmiInputs[2].HdcpCapabilityFeedback);
|
||||||
{
|
|
||||||
return (int)tx.HdmiInputs[2].HdcpCapabilityFeedback;
|
|
||||||
});
|
|
||||||
|
|
||||||
HdcpSupportCapability = eHdcpCapabilityType.Hdcp2_2Support;
|
HdcpSupportCapability = eHdcpCapabilityType.Hdcp2_2Support;
|
||||||
|
|
||||||
Hdmi1VideoSyncFeedback = new BoolFeedback(() =>
|
Hdmi1VideoSyncFeedback = new BoolFeedback(() => (bool)tx.HdmiInputs[1].SyncDetectedFeedback.BoolValue);
|
||||||
{
|
|
||||||
return (bool)tx.HdmiInputs[1].SyncDetectedFeedback.BoolValue;
|
|
||||||
});
|
|
||||||
|
|
||||||
Hdmi2VideoSyncFeedback = new BoolFeedback(() =>
|
Hdmi2VideoSyncFeedback = new BoolFeedback(() => (bool)tx.HdmiInputs[2].SyncDetectedFeedback.BoolValue);
|
||||||
{
|
|
||||||
return (bool)tx.HdmiInputs[2].SyncDetectedFeedback.BoolValue;
|
|
||||||
});
|
|
||||||
|
|
||||||
VgaVideoSyncFeedback = new BoolFeedback(() =>
|
VgaVideoSyncFeedback = new BoolFeedback(() => (bool)tx.VgaInput.SyncDetectedFeedback.BoolValue);
|
||||||
{
|
|
||||||
return (bool)tx.VgaInput.SyncDetectedFeedback.BoolValue;
|
|
||||||
});
|
|
||||||
|
|
||||||
FreeRunEnabledFeedback = new BoolFeedback(() => tx.VgaInput.FreeRunFeedback == eDmFreeRunSetting.Enabled);
|
FreeRunEnabledFeedback = new BoolFeedback(() => tx.VgaInput.FreeRunFeedback == eDmFreeRunSetting.Enabled);
|
||||||
|
|
||||||
|
|
@ -164,9 +145,7 @@ namespace PepperDash.Essentials.DM
|
||||||
{
|
{
|
||||||
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 "";
|
|
||||||
},
|
},
|
||||||
|
|
||||||
VideoResolutionFeedbackFunc = () =>
|
VideoResolutionFeedbackFunc = () =>
|
||||||
|
|
@ -175,9 +154,7 @@ 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.Vga)
|
return ActualActiveVideoInput == eVst.Vga ? tx.VgaInput.VideoAttributes.GetVideoResolutionString() : "";
|
||||||
return tx.VgaInput.VideoAttributes.GetVideoResolutionString();
|
|
||||||
return "";
|
|
||||||
},
|
},
|
||||||
VideoSyncFeedbackFunc = () =>
|
VideoSyncFeedbackFunc = () =>
|
||||||
(ActualActiveVideoInput == eVst.Hdmi1
|
(ActualActiveVideoInput == eVst.Hdmi1
|
||||||
|
|
@ -211,18 +188,32 @@ namespace PepperDash.Essentials.DM
|
||||||
DmOut.Port = Tx.DmOutput;
|
DmOut.Port = Tx.DmOutput;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void VgaInputOnInputStreamChange(EndpointInputStream inputStream, EndpointInputStreamEventArgs args)
|
||||||
|
{
|
||||||
|
switch (args.EventId)
|
||||||
|
{
|
||||||
|
case EndpointInputStreamEventIds.FreeRunFeedbackEventId:
|
||||||
|
FreeRunEnabledFeedback.FireUpdate();
|
||||||
|
break;
|
||||||
|
case EndpointInputStreamEventIds.SyncDetectedFeedbackEventId:
|
||||||
|
VgaVideoSyncFeedback.FireUpdate();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void VideoControls_ControlChange(object sender, Crestron.SimplSharpPro.DeviceSupport.GenericEventArgs args)
|
void VideoControls_ControlChange(object sender, Crestron.SimplSharpPro.DeviceSupport.GenericEventArgs args)
|
||||||
{
|
{
|
||||||
var id = args.EventId;
|
var id = args.EventId;
|
||||||
Debug.Console(2, this, "EventId {0}", args.EventId);
|
Debug.Console(2, this, "EventId {0}", args.EventId);
|
||||||
|
|
||||||
if (id == VideoControlsEventIds.BrightnessFeedbackEventId)
|
switch (id)
|
||||||
{
|
{
|
||||||
|
case VideoControlsEventIds.BrightnessFeedbackEventId:
|
||||||
VgaBrightnessFeedback.FireUpdate();
|
VgaBrightnessFeedback.FireUpdate();
|
||||||
}
|
break;
|
||||||
else if (id == VideoControlsEventIds.ContrastFeedbackEventId)
|
case VideoControlsEventIds.ContrastFeedbackEventId:
|
||||||
{
|
|
||||||
VgaContrastFeedback.FireUpdate();
|
VgaContrastFeedback.FireUpdate();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -246,7 +237,7 @@ namespace PepperDash.Essentials.DM
|
||||||
|
|
||||||
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
||||||
{
|
{
|
||||||
DmTxControllerJoinMap joinMap = GetDmTxJoinMap(joinStart, joinMapKey);
|
var joinMap = GetDmTxJoinMap(joinStart, joinMapKey);
|
||||||
|
|
||||||
if (Hdmi1VideoSyncFeedback != null)
|
if (Hdmi1VideoSyncFeedback != null)
|
||||||
{
|
{
|
||||||
|
|
@ -270,14 +261,7 @@ namespace PepperDash.Essentials.DM
|
||||||
/// <param name="enable"></param>
|
/// <param name="enable"></param>
|
||||||
public void SetFreeRunEnabled(bool enable)
|
public void SetFreeRunEnabled(bool enable)
|
||||||
{
|
{
|
||||||
if (enable)
|
Tx.VgaInput.FreeRun = enable ? eDmFreeRunSetting.Enabled : eDmFreeRunSetting.Disabled;
|
||||||
{
|
|
||||||
Tx.VgaInput.FreeRun = eDmFreeRunSetting.Enabled;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Tx.VgaInput.FreeRun = eDmFreeRunSetting.Disabled;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -304,8 +288,9 @@ 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);
|
||||||
|
|
||||||
if (type == eRoutingSignalType.Video)
|
switch (type)
|
||||||
{
|
{
|
||||||
|
case eRoutingSignalType.Video:
|
||||||
switch (input)
|
switch (input)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
|
|
@ -334,9 +319,8 @@ namespace PepperDash.Essentials.DM
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
break;
|
||||||
else if (type == eRoutingSignalType.Audio)
|
case eRoutingSignalType.Audio:
|
||||||
{
|
|
||||||
switch (input)
|
switch (input)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
|
|
@ -365,6 +349,7 @@ namespace PepperDash.Essentials.DM
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -380,37 +365,37 @@ namespace PepperDash.Essentials.DM
|
||||||
{
|
{
|
||||||
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());
|
||||||
|
|
||||||
if (args.EventId == EndpointInputStreamEventIds.HdcpSupportOffFeedbackEventId)
|
switch (args.EventId)
|
||||||
{
|
{
|
||||||
if (inputStream == Tx.HdmiInputs[1])
|
case EndpointInputStreamEventIds.HdcpSupportOffFeedbackEventId:
|
||||||
HdmiIn1HdcpCapabilityFeedback.FireUpdate();
|
if (inputStream == Tx.HdmiInputs[1]) HdmiIn1HdcpCapabilityFeedback.FireUpdate();
|
||||||
else if (inputStream == Tx.HdmiInputs[2])
|
if (inputStream == Tx.HdmiInputs[2]) HdmiIn2HdcpCapabilityFeedback.FireUpdate();
|
||||||
HdmiIn2HdcpCapabilityFeedback.FireUpdate();
|
break;
|
||||||
}
|
case EndpointInputStreamEventIds.HdcpSupportOnFeedbackEventId:
|
||||||
else if (args.EventId == EndpointInputStreamEventIds.HdcpSupportOnFeedbackEventId)
|
if (inputStream == Tx.HdmiInputs[1]) HdmiIn1HdcpCapabilityFeedback.FireUpdate();
|
||||||
{
|
if (inputStream == Tx.HdmiInputs[2]) HdmiIn2HdcpCapabilityFeedback.FireUpdate();
|
||||||
if (inputStream == Tx.HdmiInputs[1])
|
break;
|
||||||
HdmiIn1HdcpCapabilityFeedback.FireUpdate();
|
case EndpointInputStreamEventIds.SyncDetectedFeedbackEventId:
|
||||||
else if (inputStream == Tx.HdmiInputs[2])
|
if (inputStream == Tx.HdmiInputs[1]) Hdmi1VideoSyncFeedback.FireUpdate();
|
||||||
HdmiIn2HdcpCapabilityFeedback.FireUpdate();
|
if (inputStream == Tx.HdmiInputs[2]) Hdmi2VideoSyncFeedback.FireUpdate();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Tx_BaseEvent(GenericBase device, BaseEventArgs args)
|
void Tx_BaseEvent(GenericBase device, BaseEventArgs args)
|
||||||
{
|
{
|
||||||
var id = args.EventId;
|
var id = args.EventId;
|
||||||
if (id == EndpointTransmitterBase.VideoSourceFeedbackEventId)
|
switch (id)
|
||||||
{
|
{
|
||||||
|
case EndpointTransmitterBase.VideoSourceFeedbackEventId:
|
||||||
Debug.Console(2, this, " Video Source: {0}", Tx.VideoSourceFeedback);
|
Debug.Console(2, this, " Video Source: {0}", Tx.VideoSourceFeedback);
|
||||||
VideoSourceNumericFeedback.FireUpdate();
|
VideoSourceNumericFeedback.FireUpdate();
|
||||||
ActiveVideoInputFeedback.FireUpdate();
|
ActiveVideoInputFeedback.FireUpdate();
|
||||||
}
|
break;
|
||||||
|
case EndpointTransmitterBase.AudioSourceFeedbackEventId:
|
||||||
// ------------------------------ incomplete -----------------------------------------
|
|
||||||
else if (id == EndpointTransmitterBase.AudioSourceFeedbackEventId)
|
|
||||||
{
|
|
||||||
Debug.Console(2, this, " Audio Source: {0}", Tx.AudioSourceFeedback);
|
Debug.Console(2, this, " Audio Source: {0}", Tx.AudioSourceFeedback);
|
||||||
AudioSourceNumericFeedback.FireUpdate();
|
AudioSourceNumericFeedback.FireUpdate();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -419,12 +404,10 @@ namespace PepperDash.Essentials.DM
|
||||||
/// </summary>
|
/// </summary>
|
||||||
void FowardInputStreamChange(RoutingInputPortWithVideoStatuses inputPort, int eventId)
|
void FowardInputStreamChange(RoutingInputPortWithVideoStatuses inputPort, int eventId)
|
||||||
{
|
{
|
||||||
if (eventId == EndpointInputStreamEventIds.SyncDetectedFeedbackEventId)
|
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
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@ namespace PepperDash.Essentials.DM
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Controller class for all DM-TX-201C/S/F transmitters
|
/// Controller class for all DM-TX-201C/S/F transmitters
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[Description("Wrapper class for DM-TX-4K-Z-100-C")]
|
||||||
public class DmTx4kz100Controller : DmTxControllerBase, IRoutingInputsOutputs, IHasFeedback,
|
public class DmTx4kz100Controller : DmTxControllerBase, IRoutingInputsOutputs, IHasFeedback,
|
||||||
IIROutputPorts, IComPorts, ICec
|
IIROutputPorts, IComPorts, ICec
|
||||||
{
|
{
|
||||||
|
|
@ -93,9 +94,9 @@ namespace PepperDash.Essentials.DM
|
||||||
ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput",
|
ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput",
|
||||||
() => ActualActiveVideoInput.ToString());
|
() => ActualActiveVideoInput.ToString());
|
||||||
|
|
||||||
Tx.HdmiInput.InputStreamChange += new EndpointInputStreamChangeEventHandler(InputStreamChangeEvent);
|
Tx.HdmiInput.InputStreamChange += InputStreamChangeEvent;
|
||||||
Tx.BaseEvent += Tx_BaseEvent;
|
Tx.BaseEvent += Tx_BaseEvent;
|
||||||
Tx.OnlineStatusChange += new OnlineStatusChangeEventHandler(Tx_OnlineStatusChange);
|
Tx.OnlineStatusChange += Tx_OnlineStatusChange;
|
||||||
|
|
||||||
|
|
||||||
HdmiInHdcpCapabilityFeedback = new IntFeedback("HdmiInHdcpCapability", () =>
|
HdmiInHdcpCapabilityFeedback = new IntFeedback("HdmiInHdcpCapability", () =>
|
||||||
|
|
@ -108,10 +109,7 @@ namespace PepperDash.Essentials.DM
|
||||||
|
|
||||||
HdcpSupportCapability = eHdcpCapabilityType.HdcpAutoSupport;
|
HdcpSupportCapability = eHdcpCapabilityType.HdcpAutoSupport;
|
||||||
|
|
||||||
HdmiVideoSyncFeedback = new BoolFeedback(() =>
|
HdmiVideoSyncFeedback = new BoolFeedback(() => (bool)tx.HdmiInput.SyncDetectedFeedback.BoolValue);
|
||||||
{
|
|
||||||
return (bool)tx.HdmiInput.SyncDetectedFeedback.BoolValue;
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
var combinedFuncs = new VideoStatusFuncsWrapper
|
var combinedFuncs = new VideoStatusFuncsWrapper
|
||||||
|
|
@ -120,20 +118,13 @@ namespace PepperDash.Essentials.DM
|
||||||
(ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital
|
(ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital
|
||||||
&& tx.HdmiInput.VideoAttributes.HdcpActiveFeedback.BoolValue),
|
&& tx.HdmiInput.VideoAttributes.HdcpActiveFeedback.BoolValue),
|
||||||
|
|
||||||
HdcpStateFeedbackFunc = () =>
|
HdcpStateFeedbackFunc = () => ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital ? tx.HdmiInput.VideoAttributes.HdcpStateFeedback.ToString() : "",
|
||||||
{
|
|
||||||
if (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital)
|
|
||||||
return tx.HdmiInput.VideoAttributes.HdcpStateFeedback.ToString();
|
|
||||||
return "";
|
|
||||||
},
|
|
||||||
|
|
||||||
VideoResolutionFeedbackFunc = () =>
|
VideoResolutionFeedbackFunc = () =>
|
||||||
{
|
{
|
||||||
if (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital)
|
if (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital)
|
||||||
return tx.HdmiInput.VideoAttributes.GetVideoResolutionString();
|
return tx.HdmiInput.VideoAttributes.GetVideoResolutionString();
|
||||||
if (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Analog)
|
return ActualActiveVideoInput == DmTx200Base.eSourceSelection.Analog ? tx.VgaInput.VideoAttributes.GetVideoResolutionString() : "";
|
||||||
return tx.VgaInput.VideoAttributes.GetVideoResolutionString();
|
|
||||||
return "";
|
|
||||||
},
|
},
|
||||||
VideoSyncFeedbackFunc = () =>
|
VideoSyncFeedbackFunc = () =>
|
||||||
(ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital
|
(ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital
|
||||||
|
|
@ -180,7 +171,7 @@ namespace PepperDash.Essentials.DM
|
||||||
|
|
||||||
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
||||||
{
|
{
|
||||||
DmTxControllerJoinMap joinMap = GetDmTxJoinMap(joinStart, joinMapKey);
|
var joinMap = GetDmTxJoinMap(joinStart, joinMapKey);
|
||||||
|
|
||||||
if (HdmiVideoSyncFeedback != null)
|
if (HdmiVideoSyncFeedback != null)
|
||||||
{
|
{
|
||||||
|
|
@ -196,14 +187,7 @@ namespace PepperDash.Essentials.DM
|
||||||
/// <param name="enable"></param>
|
/// <param name="enable"></param>
|
||||||
public void SetFreeRunEnabled(bool enable)
|
public void SetFreeRunEnabled(bool enable)
|
||||||
{
|
{
|
||||||
if (enable)
|
Tx.VgaInput.FreeRun = enable ? eDmFreeRunSetting.Enabled : eDmFreeRunSetting.Disabled;
|
||||||
{
|
|
||||||
Tx.VgaInput.FreeRun = eDmFreeRunSetting.Enabled;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Tx.VgaInput.FreeRun = eDmFreeRunSetting.Disabled;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -230,16 +214,15 @@ namespace PepperDash.Essentials.DM
|
||||||
var id = args.EventId;
|
var id = args.EventId;
|
||||||
Debug.Console(2, this, "EventId {0}", args.EventId);
|
Debug.Console(2, this, "EventId {0}", args.EventId);
|
||||||
|
|
||||||
if (id == EndpointTransmitterBase.VideoSourceFeedbackEventId)
|
switch (id)
|
||||||
{
|
{
|
||||||
|
case EndpointTransmitterBase.VideoSourceFeedbackEventId:
|
||||||
Debug.Console(2, this, " Video Source: {0}", Tx.VideoSourceFeedback);
|
Debug.Console(2, this, " Video Source: {0}", Tx.VideoSourceFeedback);
|
||||||
ActiveVideoInputFeedback.FireUpdate();
|
ActiveVideoInputFeedback.FireUpdate();
|
||||||
}
|
break;
|
||||||
|
case EndpointTransmitterBase.AudioSourceFeedbackEventId:
|
||||||
// ------------------------------ incomplete -----------------------------------------
|
|
||||||
else if (id == EndpointTransmitterBase.AudioSourceFeedbackEventId)
|
|
||||||
{
|
|
||||||
Debug.Console(2, this, " Audio Source: {0}", Tx.AudioSourceFeedback);
|
Debug.Console(2, this, " Audio Source: {0}", Tx.AudioSourceFeedback);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -247,13 +230,17 @@ namespace PepperDash.Essentials.DM
|
||||||
{
|
{
|
||||||
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());
|
||||||
|
|
||||||
if (args.EventId == EndpointInputStreamEventIds.HdcpSupportOffFeedbackEventId)
|
switch (args.EventId)
|
||||||
{
|
{
|
||||||
|
case EndpointInputStreamEventIds.HdcpSupportOffFeedbackEventId:
|
||||||
HdmiInHdcpCapabilityFeedback.FireUpdate();
|
HdmiInHdcpCapabilityFeedback.FireUpdate();
|
||||||
}
|
break;
|
||||||
else if (args.EventId == EndpointInputStreamEventIds.HdcpSupportOnFeedbackEventId)
|
case EndpointInputStreamEventIds.HdcpSupportOnFeedbackEventId:
|
||||||
{
|
|
||||||
HdmiInHdcpCapabilityFeedback.FireUpdate();
|
HdmiInHdcpCapabilityFeedback.FireUpdate();
|
||||||
|
break;
|
||||||
|
case EndpointInputStreamEventIds.SyncDetectedFeedbackEventId:
|
||||||
|
HdmiVideoSyncFeedback.FireUpdate();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -262,12 +249,10 @@ namespace PepperDash.Essentials.DM
|
||||||
/// </summary>
|
/// </summary>
|
||||||
void FowardInputStreamChange(RoutingInputPortWithVideoStatuses inputPort, int eventId)
|
void FowardInputStreamChange(RoutingInputPortWithVideoStatuses inputPort, int eventId)
|
||||||
{
|
{
|
||||||
if (eventId == EndpointInputStreamEventIds.SyncDetectedFeedbackEventId)
|
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
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,359 @@
|
||||||
|
using Crestron.SimplSharpPro;
|
||||||
|
//using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
|
using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
|
using Crestron.SimplSharpPro.DM;
|
||||||
|
using Crestron.SimplSharpPro.DM.Endpoints;
|
||||||
|
using Crestron.SimplSharpPro.DM.Endpoints.Transmitters;
|
||||||
|
|
||||||
|
using PepperDash.Core;
|
||||||
|
using PepperDash.Essentials.Core;
|
||||||
|
using PepperDash.Essentials.Core.Bridges;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.DM
|
||||||
|
{
|
||||||
|
using eVst = eX02VideoSourceType;
|
||||||
|
using eAst = eX02AudioSourceType;
|
||||||
|
|
||||||
|
public class DmTx4kz202CController : DmTxControllerBase, ITxRouting,
|
||||||
|
IIROutputPorts, IComPorts
|
||||||
|
{
|
||||||
|
public DmTx4kz202C Tx { get; private set; }
|
||||||
|
|
||||||
|
public RoutingInputPortWithVideoStatuses HdmiIn1 { get; private set; }
|
||||||
|
public RoutingInputPortWithVideoStatuses HdmiIn2 { get; private set; }
|
||||||
|
public RoutingOutputPort DmOut { get; private set; }
|
||||||
|
public RoutingOutputPort HdmiLoopOut { get; private set; }
|
||||||
|
|
||||||
|
public override StringFeedback ActiveVideoInputFeedback { get; protected set; }
|
||||||
|
public IntFeedback VideoSourceNumericFeedback { get; protected set; }
|
||||||
|
public IntFeedback AudioSourceNumericFeedback { get; protected set; }
|
||||||
|
public IntFeedback HdmiIn1HdcpCapabilityFeedback { get; protected set; }
|
||||||
|
public IntFeedback HdmiIn2HdcpCapabilityFeedback { get; protected set; }
|
||||||
|
public BoolFeedback Hdmi1VideoSyncFeedback { get; protected set; }
|
||||||
|
public BoolFeedback Hdmi2VideoSyncFeedback { get; protected set; }
|
||||||
|
|
||||||
|
//public override IntFeedback HdcpSupportAllFeedback { get; protected set; }
|
||||||
|
//public override ushort HdcpSupportCapability { get; protected set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Helps get the "real" inputs, including when in Auto
|
||||||
|
/// </summary>
|
||||||
|
public eX02VideoSourceType ActualActiveVideoInput
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (Tx.VideoSourceFeedback != eVst.Auto)
|
||||||
|
return Tx.VideoSourceFeedback;
|
||||||
|
|
||||||
|
if (Tx.HdmiInputs[1].SyncDetectedFeedback.BoolValue)
|
||||||
|
return eVst.Hdmi1;
|
||||||
|
|
||||||
|
return Tx.HdmiInputs[2].SyncDetectedFeedback.BoolValue ? eVst.Hdmi2 : eVst.AllDisabled;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public RoutingPortCollection<RoutingInputPort> InputPorts
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return new RoutingPortCollection<RoutingInputPort>
|
||||||
|
{
|
||||||
|
HdmiIn1,
|
||||||
|
HdmiIn2,
|
||||||
|
AnyVideoInput
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public RoutingPortCollection<RoutingOutputPort> OutputPorts
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return new RoutingPortCollection<RoutingOutputPort> { DmOut, HdmiLoopOut };
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public DmTx4kz202CController(string key, string name, DmTx4kz202C tx)
|
||||||
|
: base(key, name, tx)
|
||||||
|
{
|
||||||
|
Tx = tx;
|
||||||
|
|
||||||
|
HdmiIn1 = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn1,
|
||||||
|
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, eVst.Hdmi1, this,
|
||||||
|
VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInputs[1]));
|
||||||
|
HdmiIn2 = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn2,
|
||||||
|
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, eVst.Hdmi2, this,
|
||||||
|
VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInputs[2]));
|
||||||
|
ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput",
|
||||||
|
() => ActualActiveVideoInput.ToString());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Tx.HdmiInputs[1].InputStreamChange += InputStreamChangeEvent;
|
||||||
|
Tx.HdmiInputs[2].InputStreamChange += InputStreamChangeEvent;
|
||||||
|
Tx.BaseEvent += Tx_BaseEvent;
|
||||||
|
|
||||||
|
VideoSourceNumericFeedback = new IntFeedback(() => (int)Tx.VideoSourceFeedback);
|
||||||
|
|
||||||
|
//Return VideoSourceFeedback here as DM-TX-4KZ-202-C does not support audio breakaway
|
||||||
|
AudioSourceNumericFeedback = new IntFeedback(() => (int)Tx.VideoSourceFeedback);
|
||||||
|
|
||||||
|
HdmiIn1HdcpCapabilityFeedback = new IntFeedback("HdmiIn1HdcpCapability", () => (int)tx.HdmiInputs[1].HdcpCapabilityFeedback);
|
||||||
|
|
||||||
|
HdmiIn2HdcpCapabilityFeedback = new IntFeedback("HdmiIn2HdcpCapability", () => (int)tx.HdmiInputs[2].HdcpCapabilityFeedback);
|
||||||
|
|
||||||
|
HdcpSupportCapability = eHdcpCapabilityType.Hdcp2_2Support;
|
||||||
|
|
||||||
|
Hdmi1VideoSyncFeedback = new BoolFeedback(() => (bool)tx.HdmiInputs[1].SyncDetectedFeedback.BoolValue);
|
||||||
|
|
||||||
|
Hdmi2VideoSyncFeedback = new BoolFeedback(() => (bool)tx.HdmiInputs[2].SyncDetectedFeedback.BoolValue);
|
||||||
|
|
||||||
|
var combinedFuncs = new VideoStatusFuncsWrapper
|
||||||
|
{
|
||||||
|
HdcpActiveFeedbackFunc = () =>
|
||||||
|
(ActualActiveVideoInput == eVst.Hdmi1
|
||||||
|
&& tx.HdmiInputs[1].VideoAttributes.HdcpActiveFeedback.BoolValue)
|
||||||
|
|| (ActualActiveVideoInput == eVst.Hdmi2
|
||||||
|
&& tx.HdmiInputs[2].VideoAttributes.HdcpActiveFeedback.BoolValue),
|
||||||
|
|
||||||
|
HdcpStateFeedbackFunc = () =>
|
||||||
|
{
|
||||||
|
if (ActualActiveVideoInput == eVst.Hdmi1)
|
||||||
|
return tx.HdmiInputs[1].VideoAttributes.HdcpStateFeedback.ToString();
|
||||||
|
if (ActualActiveVideoInput == eVst.Hdmi2)
|
||||||
|
return tx.HdmiInputs[2].VideoAttributes.HdcpStateFeedback.ToString();
|
||||||
|
return "";
|
||||||
|
},
|
||||||
|
|
||||||
|
VideoResolutionFeedbackFunc = () =>
|
||||||
|
{
|
||||||
|
if (ActualActiveVideoInput == eVst.Hdmi1)
|
||||||
|
return tx.HdmiInputs[1].VideoAttributes.GetVideoResolutionString();
|
||||||
|
if (ActualActiveVideoInput == eVst.Hdmi2)
|
||||||
|
return tx.HdmiInputs[2].VideoAttributes.GetVideoResolutionString();
|
||||||
|
return "";
|
||||||
|
},
|
||||||
|
VideoSyncFeedbackFunc = () =>
|
||||||
|
(ActualActiveVideoInput == eVst.Hdmi1
|
||||||
|
&& tx.HdmiInputs[1].SyncDetectedFeedback.BoolValue)
|
||||||
|
|| (ActualActiveVideoInput == eVst.Hdmi2
|
||||||
|
&& tx.HdmiInputs[2].SyncDetectedFeedback.BoolValue)
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
AnyVideoInput = new RoutingInputPortWithVideoStatuses(DmPortName.AnyVideoIn,
|
||||||
|
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.None, 0, this, combinedFuncs);
|
||||||
|
|
||||||
|
DmOut = new RoutingOutputPort(DmPortName.DmOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
|
||||||
|
eRoutingPortConnectionType.DmCat, null, this);
|
||||||
|
HdmiLoopOut = new RoutingOutputPort(DmPortName.HdmiLoopOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
|
||||||
|
eRoutingPortConnectionType.Hdmi, null, this);
|
||||||
|
|
||||||
|
|
||||||
|
AddToFeedbackList(ActiveVideoInputFeedback, VideoSourceNumericFeedback, AudioSourceNumericFeedback,
|
||||||
|
AnyVideoInput.VideoStatus.HasVideoStatusFeedback, AnyVideoInput.VideoStatus.HdcpActiveFeedback,
|
||||||
|
AnyVideoInput.VideoStatus.HdcpStateFeedback, AnyVideoInput.VideoStatus.VideoResolutionFeedback,
|
||||||
|
AnyVideoInput.VideoStatus.VideoSyncFeedback, HdmiIn1HdcpCapabilityFeedback, HdmiIn2HdcpCapabilityFeedback,
|
||||||
|
Hdmi1VideoSyncFeedback, Hdmi2VideoSyncFeedback);
|
||||||
|
|
||||||
|
// Set Ports for CEC
|
||||||
|
HdmiIn1.Port = Tx.HdmiInputs[1];
|
||||||
|
HdmiIn2.Port = Tx.HdmiInputs[2];
|
||||||
|
HdmiLoopOut.Port = Tx.HdmiOutput;
|
||||||
|
DmOut.Port = Tx.DmOutput;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public override bool CustomActivate()
|
||||||
|
{
|
||||||
|
// 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].VideoAttributes.AttributeChange += (o, a) => ForwardVideoAttributeChange(HdmiIn1, a.EventId);
|
||||||
|
|
||||||
|
Tx.HdmiInputs[2].InputStreamChange += (o, a) => FowardInputStreamChange(HdmiIn2, a.EventId);
|
||||||
|
Tx.HdmiInputs[2].VideoAttributes.AttributeChange += (o, a) => ForwardVideoAttributeChange(HdmiIn2, a.EventId);
|
||||||
|
|
||||||
|
// Base does register and sets up comm monitoring.
|
||||||
|
return base.CustomActivate();
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
||||||
|
{
|
||||||
|
var joinMap = GetDmTxJoinMap(joinStart, joinMapKey);
|
||||||
|
|
||||||
|
if (Hdmi1VideoSyncFeedback != null)
|
||||||
|
{
|
||||||
|
Hdmi1VideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.Input1VideoSyncStatus.JoinNumber]);
|
||||||
|
}
|
||||||
|
if (Hdmi2VideoSyncFeedback != null)
|
||||||
|
{
|
||||||
|
Hdmi2VideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.Input2VideoSyncStatus.JoinNumber]);
|
||||||
|
}
|
||||||
|
|
||||||
|
LinkDmTxToApi(this, trilist, joinMap, bridge);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ExecuteNumericSwitch(ushort input, ushort output, eRoutingSignalType type)
|
||||||
|
{
|
||||||
|
Debug.Console(2, this, "Executing Numeric Switch to input {0}.", input);
|
||||||
|
|
||||||
|
switch (type)
|
||||||
|
{
|
||||||
|
case eRoutingSignalType.Video:
|
||||||
|
switch (input)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
{
|
||||||
|
ExecuteSwitch(eVst.Auto, null, type);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 1:
|
||||||
|
{
|
||||||
|
ExecuteSwitch(HdmiIn1.Selector, null, type);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 2:
|
||||||
|
{
|
||||||
|
ExecuteSwitch(HdmiIn2.Selector, null, type);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 3:
|
||||||
|
{
|
||||||
|
ExecuteSwitch(eVst.AllDisabled, null, type);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case eRoutingSignalType.Audio:
|
||||||
|
switch (input)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
{
|
||||||
|
ExecuteSwitch(eAst.Auto, null, type);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 1:
|
||||||
|
{
|
||||||
|
ExecuteSwitch(eAst.Hdmi1, null, type);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 2:
|
||||||
|
{
|
||||||
|
ExecuteSwitch(eAst.Hdmi2, null, type);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 3:
|
||||||
|
{
|
||||||
|
ExecuteSwitch(eAst.AllDisabled, null, type);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ExecuteSwitch(object inputSelector, object outputSelector, eRoutingSignalType signalType)
|
||||||
|
{
|
||||||
|
if ((signalType & eRoutingSignalType.Video) == eRoutingSignalType.Video)
|
||||||
|
Tx.VideoSource = (eVst)inputSelector;
|
||||||
|
if(((signalType & eRoutingSignalType.Audio) == eRoutingSignalType.Audio))
|
||||||
|
Debug.Console(2, this, "Unable to execute audio-only switch for tx {0}", Key);
|
||||||
|
}
|
||||||
|
|
||||||
|
void InputStreamChangeEvent(EndpointInputStream inputStream, EndpointInputStreamEventArgs args)
|
||||||
|
{
|
||||||
|
Debug.Console(2, "{0} event {1} stream {2}", Tx.ToString(), inputStream.ToString(), args.EventId.ToString());
|
||||||
|
|
||||||
|
switch (args.EventId)
|
||||||
|
{
|
||||||
|
case EndpointInputStreamEventIds.HdcpSupportOffFeedbackEventId:
|
||||||
|
if (inputStream == Tx.HdmiInputs[1]) HdmiIn1HdcpCapabilityFeedback.FireUpdate();
|
||||||
|
if (inputStream == Tx.HdmiInputs[2]) HdmiIn2HdcpCapabilityFeedback.FireUpdate();
|
||||||
|
break;
|
||||||
|
case EndpointInputStreamEventIds.HdcpSupportOnFeedbackEventId:
|
||||||
|
if (inputStream == Tx.HdmiInputs[1]) HdmiIn1HdcpCapabilityFeedback.FireUpdate();
|
||||||
|
if (inputStream == Tx.HdmiInputs[2]) HdmiIn2HdcpCapabilityFeedback.FireUpdate();
|
||||||
|
break;
|
||||||
|
case EndpointInputStreamEventIds.SyncDetectedFeedbackEventId:
|
||||||
|
if (inputStream == Tx.HdmiInputs[1]) Hdmi1VideoSyncFeedback.FireUpdate();
|
||||||
|
if (inputStream == Tx.HdmiInputs[2]) Hdmi2VideoSyncFeedback.FireUpdate();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Tx_BaseEvent(GenericBase device, BaseEventArgs args)
|
||||||
|
{
|
||||||
|
var id = args.EventId;
|
||||||
|
Debug.Console(2, this, "EventId {0}", args.EventId);
|
||||||
|
|
||||||
|
switch (id)
|
||||||
|
{
|
||||||
|
case EndpointTransmitterBase.VideoSourceFeedbackEventId:
|
||||||
|
Debug.Console(2, this, " Video Source: {0}", Tx.VideoSourceFeedback);
|
||||||
|
ActiveVideoInputFeedback.FireUpdate();
|
||||||
|
VideoSourceNumericFeedback.FireUpdate();
|
||||||
|
AudioSourceNumericFeedback.FireUpdate();
|
||||||
|
ActiveVideoInputFeedback.FireUpdate();
|
||||||
|
break;
|
||||||
|
case EndpointTransmitterBase.AudioSourceFeedbackEventId:
|
||||||
|
Debug.Console(2, this, " Audio Source : {0}", Tx.AudioSourceFeedback);
|
||||||
|
AudioSourceNumericFeedback.FireUpdate();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Relays the input stream change to the appropriate RoutingInputPort.
|
||||||
|
/// </summary>
|
||||||
|
void FowardInputStreamChange(RoutingInputPortWithVideoStatuses inputPort, int eventId)
|
||||||
|
{
|
||||||
|
if (eventId != EndpointInputStreamEventIds.SyncDetectedFeedbackEventId)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
inputPort.VideoStatus.VideoSyncFeedback.FireUpdate();
|
||||||
|
AnyVideoInput.VideoStatus.VideoSyncFeedback.FireUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Relays the VideoAttributes change to a RoutingInputPort
|
||||||
|
/// </summary>
|
||||||
|
void ForwardVideoAttributeChange(RoutingInputPortWithVideoStatuses inputPort, int eventId)
|
||||||
|
{
|
||||||
|
//// LOCATION: Crestron.SimplSharpPro.DM.VideoAttributeEventIds
|
||||||
|
//Debug.Console(2, this, "VideoAttributes_AttributeChange event id={0} from {1}",
|
||||||
|
// args.EventId, (sender as VideoAttributesEnhanced).Owner.GetType());
|
||||||
|
switch (eventId)
|
||||||
|
{
|
||||||
|
case VideoAttributeEventIds.HdcpActiveFeedbackEventId:
|
||||||
|
inputPort.VideoStatus.HdcpActiveFeedback.FireUpdate();
|
||||||
|
AnyVideoInput.VideoStatus.HdcpActiveFeedback.FireUpdate();
|
||||||
|
break;
|
||||||
|
case VideoAttributeEventIds.HdcpStateFeedbackEventId:
|
||||||
|
inputPort.VideoStatus.HdcpStateFeedback.FireUpdate();
|
||||||
|
AnyVideoInput.VideoStatus.HdcpStateFeedback.FireUpdate();
|
||||||
|
break;
|
||||||
|
case VideoAttributeEventIds.HorizontalResolutionFeedbackEventId:
|
||||||
|
case VideoAttributeEventIds.VerticalResolutionFeedbackEventId:
|
||||||
|
inputPort.VideoStatus.VideoResolutionFeedback.FireUpdate();
|
||||||
|
AnyVideoInput.VideoStatus.VideoResolutionFeedback.FireUpdate();
|
||||||
|
break;
|
||||||
|
case VideoAttributeEventIds.FramesPerSecondFeedbackEventId:
|
||||||
|
inputPort.VideoStatus.VideoResolutionFeedback.FireUpdate();
|
||||||
|
AnyVideoInput.VideoStatus.VideoResolutionFeedback.FireUpdate();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#region IIROutputPorts Members
|
||||||
|
public CrestronCollection<IROutputPort> IROutputPorts { get { return Tx.IROutputPorts; } }
|
||||||
|
public int NumberOfIROutputPorts { get { return Tx.NumberOfIROutputPorts; } }
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region IComPorts Members
|
||||||
|
public CrestronCollection<ComPort> ComPorts { get { return Tx.ComPorts; } }
|
||||||
|
public int NumberOfComPorts { get { return Tx.NumberOfComPorts; } }
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,9 +1,4 @@
|
||||||
using System;
|
using Crestron.SimplSharpPro;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using Crestron.SimplSharp;
|
|
||||||
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;
|
||||||
|
|
@ -13,13 +8,14 @@ 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;
|
|
||||||
|
|
||||||
namespace PepperDash.Essentials.DM
|
namespace PepperDash.Essentials.DM
|
||||||
{
|
{
|
||||||
using eVst = Crestron.SimplSharpPro.DeviceSupport.eX02VideoSourceType;
|
using eVst = eX02VideoSourceType;
|
||||||
using eAst = Crestron.SimplSharpPro.DeviceSupport.eX02AudioSourceType;
|
using eAst = eX02AudioSourceType;
|
||||||
|
|
||||||
|
|
||||||
|
[Description("Wrapper class for DM-TX-4K-Z-302-C")]
|
||||||
public class DmTx4kz302CController : DmTxControllerBase, ITxRouting, IHasFeedback,
|
public class DmTx4kz302CController : DmTxControllerBase, ITxRouting, IHasFeedback,
|
||||||
IIROutputPorts, IComPorts
|
IIROutputPorts, IComPorts
|
||||||
{
|
{
|
||||||
|
|
@ -46,23 +42,18 @@ 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 eX02VideoSourceType ActualActiveVideoInput
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
if (Tx.VideoSourceFeedback != eVst.Auto)
|
if (Tx.VideoSourceFeedback != eVst.Auto)
|
||||||
return Tx.VideoSourceFeedback;
|
return Tx.VideoSourceFeedback;
|
||||||
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)
|
if (Tx.HdmiInputs[2].SyncDetectedFeedback.BoolValue)
|
||||||
return eVst.Hdmi2;
|
return eVst.Hdmi2;
|
||||||
else if (Tx.DisplayPortInput.SyncDetectedFeedback.BoolValue)
|
|
||||||
return eVst.Vga;
|
return Tx.DisplayPortInput.SyncDetectedFeedback.BoolValue ? eVst.Vga : eVst.AllDisabled;
|
||||||
else
|
|
||||||
return eVst.AllDisabled;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public RoutingPortCollection<RoutingInputPort> InputPorts
|
public RoutingPortCollection<RoutingInputPort> InputPorts
|
||||||
|
|
@ -104,43 +95,23 @@ 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 += DisplayPortInputStreamChange;
|
||||||
Tx.BaseEvent += Tx_BaseEvent;
|
Tx.BaseEvent += Tx_BaseEvent;
|
||||||
|
|
||||||
VideoSourceNumericFeedback = new IntFeedback(() =>
|
VideoSourceNumericFeedback = new IntFeedback(() => (int)Tx.VideoSourceFeedback);
|
||||||
{
|
AudioSourceNumericFeedback = new IntFeedback(() => (int)Tx.VideoSourceFeedback);
|
||||||
return (int)Tx.VideoSourceFeedback;
|
|
||||||
});
|
|
||||||
AudioSourceNumericFeedback = new IntFeedback(() =>
|
|
||||||
{
|
|
||||||
return (int)Tx.AudioSourceFeedback;
|
|
||||||
});
|
|
||||||
|
|
||||||
HdmiIn1HdcpCapabilityFeedback = new IntFeedback("HdmiIn1HdcpCapability", () =>
|
HdmiIn1HdcpCapabilityFeedback = new IntFeedback("HdmiIn1HdcpCapability", () => (int)tx.HdmiInputs[1].HdcpCapabilityFeedback);
|
||||||
{
|
|
||||||
return (int)tx.HdmiInputs[1].HdcpCapabilityFeedback;
|
|
||||||
});
|
|
||||||
|
|
||||||
HdmiIn2HdcpCapabilityFeedback = new IntFeedback("HdmiIn2HdcpCapability", () =>
|
HdmiIn2HdcpCapabilityFeedback = new IntFeedback("HdmiIn2HdcpCapability", () => (int)tx.HdmiInputs[2].HdcpCapabilityFeedback);
|
||||||
{
|
|
||||||
return (int)tx.HdmiInputs[2].HdcpCapabilityFeedback;
|
|
||||||
});
|
|
||||||
|
|
||||||
HdcpSupportCapability = eHdcpCapabilityType.Hdcp2_2Support;
|
HdcpSupportCapability = eHdcpCapabilityType.Hdcp2_2Support;
|
||||||
|
|
||||||
Hdmi1VideoSyncFeedback = new BoolFeedback(() =>
|
Hdmi1VideoSyncFeedback = new BoolFeedback(() => (bool)tx.HdmiInputs[1].SyncDetectedFeedback.BoolValue);
|
||||||
{
|
|
||||||
return (bool)tx.HdmiInputs[1].SyncDetectedFeedback.BoolValue;
|
|
||||||
});
|
|
||||||
|
|
||||||
Hdmi2VideoSyncFeedback = new BoolFeedback(() =>
|
Hdmi2VideoSyncFeedback = new BoolFeedback(() => (bool)tx.HdmiInputs[2].SyncDetectedFeedback.BoolValue);
|
||||||
{
|
|
||||||
return (bool)tx.HdmiInputs[2].SyncDetectedFeedback.BoolValue;
|
|
||||||
});
|
|
||||||
|
|
||||||
DisplayPortVideoSyncFeedback = new BoolFeedback(() =>
|
DisplayPortVideoSyncFeedback = new BoolFeedback(() => (bool)tx.DisplayPortInput.SyncDetectedFeedback.BoolValue);
|
||||||
{
|
|
||||||
return (bool)tx.DisplayPortInput.SyncDetectedFeedback.BoolValue;
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
var combinedFuncs = new VideoStatusFuncsWrapper
|
var combinedFuncs = new VideoStatusFuncsWrapper
|
||||||
|
|
@ -155,9 +126,7 @@ namespace PepperDash.Essentials.DM
|
||||||
{
|
{
|
||||||
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 "";
|
|
||||||
},
|
},
|
||||||
|
|
||||||
VideoResolutionFeedbackFunc = () =>
|
VideoResolutionFeedbackFunc = () =>
|
||||||
|
|
@ -166,9 +135,7 @@ 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.Vga)
|
return ActualActiveVideoInput == eVst.Vga ? tx.DisplayPortInput.VideoAttributes.GetVideoResolutionString() : "";
|
||||||
return tx.DisplayPortInput.VideoAttributes.GetVideoResolutionString();
|
|
||||||
return "";
|
|
||||||
},
|
},
|
||||||
VideoSyncFeedbackFunc = () =>
|
VideoSyncFeedbackFunc = () =>
|
||||||
(ActualActiveVideoInput == eVst.Hdmi1
|
(ActualActiveVideoInput == eVst.Hdmi1
|
||||||
|
|
@ -202,6 +169,18 @@ namespace PepperDash.Essentials.DM
|
||||||
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()
|
||||||
|
|
@ -222,7 +201,7 @@ namespace PepperDash.Essentials.DM
|
||||||
|
|
||||||
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
||||||
{
|
{
|
||||||
DmTxControllerJoinMap joinMap = GetDmTxJoinMap(joinStart, joinMapKey);
|
var joinMap = GetDmTxJoinMap(joinStart, joinMapKey);
|
||||||
|
|
||||||
if (Hdmi1VideoSyncFeedback != null)
|
if (Hdmi1VideoSyncFeedback != null)
|
||||||
{
|
{
|
||||||
|
|
@ -284,44 +263,46 @@ namespace PepperDash.Essentials.DM
|
||||||
// NOTE: It's possible that this particular TX model may not like the AudioSource property being set.
|
// NOTE: It's possible that this particular TX model may not like the AudioSource property being set.
|
||||||
// The SIMPL definition only shows a single analog for AudioVideo Source
|
// The SIMPL definition only shows a single analog for AudioVideo Source
|
||||||
if ((signalType | eRoutingSignalType.Audio) == eRoutingSignalType.Audio)
|
if ((signalType | eRoutingSignalType.Audio) == eRoutingSignalType.Audio)
|
||||||
Tx.AudioSource = (eAst)inputSelector;
|
//it doesn't
|
||||||
|
Debug.Console(2, this, "Unable to execute audio-only switch for tx {0}", Key);
|
||||||
|
//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}", Tx.ToString(), inputStream.ToString(), args.EventId.ToString());
|
||||||
|
|
||||||
if (args.EventId == EndpointInputStreamEventIds.HdcpSupportOffFeedbackEventId)
|
switch (args.EventId)
|
||||||
{
|
{
|
||||||
if (inputStream == Tx.HdmiInputs[1])
|
case EndpointInputStreamEventIds.HdcpSupportOffFeedbackEventId:
|
||||||
HdmiIn1HdcpCapabilityFeedback.FireUpdate();
|
if (inputStream == Tx.HdmiInputs[1]) HdmiIn1HdcpCapabilityFeedback.FireUpdate();
|
||||||
else if (inputStream == Tx.HdmiInputs[2])
|
if (inputStream == Tx.HdmiInputs[2]) HdmiIn2HdcpCapabilityFeedback.FireUpdate();
|
||||||
HdmiIn2HdcpCapabilityFeedback.FireUpdate();
|
break;
|
||||||
}
|
case EndpointInputStreamEventIds.HdcpSupportOnFeedbackEventId:
|
||||||
else if (args.EventId == EndpointInputStreamEventIds.HdcpSupportOnFeedbackEventId)
|
if (inputStream == Tx.HdmiInputs[1]) HdmiIn1HdcpCapabilityFeedback.FireUpdate();
|
||||||
{
|
if (inputStream == Tx.HdmiInputs[2]) HdmiIn2HdcpCapabilityFeedback.FireUpdate();
|
||||||
if (inputStream == Tx.HdmiInputs[1])
|
break;
|
||||||
HdmiIn1HdcpCapabilityFeedback.FireUpdate();
|
case EndpointInputStreamEventIds.SyncDetectedFeedbackEventId:
|
||||||
else if (inputStream == Tx.HdmiInputs[2])
|
if (inputStream == Tx.HdmiInputs[1]) Hdmi1VideoSyncFeedback.FireUpdate();
|
||||||
HdmiIn2HdcpCapabilityFeedback.FireUpdate();
|
if (inputStream == Tx.HdmiInputs[2]) Hdmi2VideoSyncFeedback.FireUpdate();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Tx_BaseEvent(GenericBase device, BaseEventArgs args)
|
void Tx_BaseEvent(GenericBase device, BaseEventArgs args)
|
||||||
{
|
{
|
||||||
var id = args.EventId;
|
var id = args.EventId;
|
||||||
if (id == EndpointTransmitterBase.VideoSourceFeedbackEventId)
|
switch (id)
|
||||||
{
|
{
|
||||||
|
case EndpointTransmitterBase.VideoSourceFeedbackEventId:
|
||||||
Debug.Console(2, this, " Video Source: {0}", Tx.VideoSourceFeedback);
|
Debug.Console(2, this, " Video Source: {0}", Tx.VideoSourceFeedback);
|
||||||
VideoSourceNumericFeedback.FireUpdate();
|
VideoSourceNumericFeedback.FireUpdate();
|
||||||
ActiveVideoInputFeedback.FireUpdate();
|
ActiveVideoInputFeedback.FireUpdate();
|
||||||
}
|
break;
|
||||||
|
case EndpointTransmitterBase.AudioSourceFeedbackEventId:
|
||||||
// ------------------------------ incomplete -----------------------------------------
|
|
||||||
else if (id == EndpointTransmitterBase.AudioSourceFeedbackEventId)
|
|
||||||
{
|
|
||||||
Debug.Console(2, this, " Audio Source: {0}", Tx.AudioSourceFeedback);
|
Debug.Console(2, this, " Audio Source: {0}", Tx.AudioSourceFeedback);
|
||||||
AudioSourceNumericFeedback.FireUpdate();
|
AudioSourceNumericFeedback.FireUpdate();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -330,12 +311,10 @@ namespace PepperDash.Essentials.DM
|
||||||
/// </summary>
|
/// </summary>
|
||||||
void FowardInputStreamChange(RoutingInputPortWithVideoStatuses inputPort, int eventId)
|
void FowardInputStreamChange(RoutingInputPortWithVideoStatuses inputPort, int eventId)
|
||||||
{
|
{
|
||||||
if (eventId == EndpointInputStreamEventIds.SyncDetectedFeedbackEventId)
|
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
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ namespace PepperDash.Essentials.DM
|
||||||
if (typeName.StartsWith("dmtx4k202"))
|
if (typeName.StartsWith("dmtx4k202"))
|
||||||
return new DmTx4k202CController(key, name, new DmTx4k202C(ipid, Global.ControlSystem));
|
return new DmTx4k202CController(key, name, new DmTx4k202C(ipid, Global.ControlSystem));
|
||||||
if (typeName.StartsWith("dmtx4kz202"))
|
if (typeName.StartsWith("dmtx4kz202"))
|
||||||
return new DmTx4k202CController(key, name, new DmTx4kz202C(ipid, Global.ControlSystem));
|
return new DmTx4kz202CController(key, name, new DmTx4kz202C(ipid, Global.ControlSystem));
|
||||||
if (typeName.StartsWith("dmtx4k302"))
|
if (typeName.StartsWith("dmtx4k302"))
|
||||||
return new DmTx4k302CController(key, name, new DmTx4k302C(ipid, Global.ControlSystem));
|
return new DmTx4k302CController(key, name, new DmTx4k302C(ipid, Global.ControlSystem));
|
||||||
if (typeName.StartsWith("dmtx4kz302"))
|
if (typeName.StartsWith("dmtx4kz302"))
|
||||||
|
|
@ -115,7 +115,7 @@ namespace PepperDash.Essentials.DM
|
||||||
if (typeName.StartsWith("dmtx4k202"))
|
if (typeName.StartsWith("dmtx4k202"))
|
||||||
return new DmTx4k202CController(key, name, new DmTx4k202C(chassis.Inputs[num]));
|
return new DmTx4k202CController(key, name, new DmTx4k202C(chassis.Inputs[num]));
|
||||||
if (typeName.StartsWith("dmtx4kz202"))
|
if (typeName.StartsWith("dmtx4kz202"))
|
||||||
return new DmTx4k202CController(key, name, new DmTx4kz202C(chassis.Inputs[num]));
|
return new DmTx4kz202CController(key, name, new DmTx4kz202C(chassis.Inputs[num]));
|
||||||
if (typeName.StartsWith("dmtx4k302"))
|
if (typeName.StartsWith("dmtx4k302"))
|
||||||
return new DmTx4k302CController(key, name, new DmTx4k302C(chassis.Inputs[num]));
|
return new DmTx4k302CController(key, name, new DmTx4k302C(chassis.Inputs[num]));
|
||||||
if (typeName.StartsWith("dmtx4kz302"))
|
if (typeName.StartsWith("dmtx4kz302"))
|
||||||
|
|
@ -138,7 +138,7 @@ namespace PepperDash.Essentials.DM
|
||||||
if (typeName.StartsWith("dmtx4k202"))
|
if (typeName.StartsWith("dmtx4k202"))
|
||||||
return new DmTx4k202CController(key, name, new DmTx4k202C(ipid, chassis.Inputs[num]));
|
return new DmTx4k202CController(key, name, new DmTx4k202C(ipid, chassis.Inputs[num]));
|
||||||
if (typeName.StartsWith("dmtx4kz202"))
|
if (typeName.StartsWith("dmtx4kz202"))
|
||||||
return new DmTx4k202CController(key, name, new DmTx4kz202C(ipid, chassis.Inputs[num]));
|
return new DmTx4kz202CController(key, name, new DmTx4kz202C(ipid, chassis.Inputs[num]));
|
||||||
if (typeName.StartsWith("dmtx4k302"))
|
if (typeName.StartsWith("dmtx4k302"))
|
||||||
return new DmTx4k302CController(key, name, new DmTx4k302C(ipid, chassis.Inputs[num]));
|
return new DmTx4k302CController(key, name, new DmTx4k302C(ipid, chassis.Inputs[num]));
|
||||||
if (typeName.StartsWith("dmtx4kz302"))
|
if (typeName.StartsWith("dmtx4kz302"))
|
||||||
|
|
@ -294,7 +294,7 @@ namespace PepperDash.Essentials.DM
|
||||||
if (txFreeRun != null)
|
if (txFreeRun != null)
|
||||||
{
|
{
|
||||||
txFreeRun.FreeRunEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.FreeRunEnabled.JoinNumber]);
|
txFreeRun.FreeRunEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.FreeRunEnabled.JoinNumber]);
|
||||||
trilist.SetBoolSigAction(joinMap.FreeRunEnabled.JoinNumber, new Action<bool>(txFreeRun.SetFreeRunEnabled));
|
trilist.SetBoolSigAction(joinMap.FreeRunEnabled.JoinNumber, txFreeRun.SetFreeRunEnabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
var txVga = tx as IVgaBrightnessContrastControls;
|
var txVga = tx as IVgaBrightnessContrastControls;
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,159 @@
|
||||||
|
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<PropertyGroup>
|
||||||
|
<Configuration Condition=" '$(Configuration)' == '' ">Release</Configuration>
|
||||||
|
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||||
|
<ProductVersion>9.0.30729</ProductVersion>
|
||||||
|
<SchemaVersion>2.0</SchemaVersion>
|
||||||
|
<ProjectGuid>{9199CE8A-0C9F-4952-8672-3EED798B284F}</ProjectGuid>
|
||||||
|
<OutputType>Library</OutputType>
|
||||||
|
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||||
|
<RootNamespace>PepperDash.Essentials.DM</RootNamespace>
|
||||||
|
<AssemblyName>PepperDash_Essentials_DM</AssemblyName>
|
||||||
|
<ProjectTypeGuids>{0B4745B0-194B-4BB6-8E21-E9057CA92300};{4D628B5B-2FBC-4AA6-8C16-197242AEB884};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||||
|
<PlatformFamilyName>WindowsCE</PlatformFamilyName>
|
||||||
|
<PlatformID>E2BECB1F-8C8C-41ba-B736-9BE7D946A398</PlatformID>
|
||||||
|
<OSVersion>5.0</OSVersion>
|
||||||
|
<DeployDirSuffix>SmartDeviceProject1</DeployDirSuffix>
|
||||||
|
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||||
|
<NativePlatformName>Windows CE</NativePlatformName>
|
||||||
|
<FormFactorID>
|
||||||
|
</FormFactorID>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
|
<AllowedReferenceRelatedFileExtensions>.allowedReferenceRelatedFileExtensions</AllowedReferenceRelatedFileExtensions>
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<Optimize>false</Optimize>
|
||||||
|
<OutputPath>bin\</OutputPath>
|
||||||
|
<DefineConstants>DEBUG;TRACE;</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
<FileAlignment>512</FileAlignment>
|
||||||
|
<NoStdLib>true</NoStdLib>
|
||||||
|
<NoConfig>true</NoConfig>
|
||||||
|
<GenerateSerializationAssemblies>off</GenerateSerializationAssemblies>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||||
|
<AllowedReferenceRelatedFileExtensions>.allowedReferenceRelatedFileExtensions</AllowedReferenceRelatedFileExtensions>
|
||||||
|
<DebugType>none</DebugType>
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<OutputPath>bin\</OutputPath>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
<FileAlignment>512</FileAlignment>
|
||||||
|
<NoStdLib>true</NoStdLib>
|
||||||
|
<NoConfig>true</NoConfig>
|
||||||
|
<GenerateSerializationAssemblies>off</GenerateSerializationAssemblies>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Reference Include="Crestron.SimplSharpPro.DeviceSupport, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||||
|
<SpecificVersion>False</SpecificVersion>
|
||||||
|
<HintPath>..\..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.DeviceSupport.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Crestron.SimplSharpPro.DM, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||||
|
<SpecificVersion>False</SpecificVersion>
|
||||||
|
<HintPath>..\..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.DM.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Crestron.SimplSharpPro.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||||
|
<SpecificVersion>False</SpecificVersion>
|
||||||
|
<HintPath>..\..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.UI.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="mscorlib" />
|
||||||
|
<Reference Include="PepperDash_Core, Version=1.0.26.30384, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<SpecificVersion>False</SpecificVersion>
|
||||||
|
<HintPath>..\..\pepperdashcore-builds\PepperDash_Core.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="SimplSharpCustomAttributesInterface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||||
|
<SpecificVersion>False</SpecificVersion>
|
||||||
|
<HintPath>..\..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpCustomAttributesInterface.dll</HintPath>
|
||||||
|
<Private>False</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="SimplSharpHelperInterface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||||
|
<SpecificVersion>False</SpecificVersion>
|
||||||
|
<HintPath>..\..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpHelperInterface.dll</HintPath>
|
||||||
|
<Private>False</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="SimplSharpNewtonsoft, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||||
|
<SpecificVersion>False</SpecificVersion>
|
||||||
|
<HintPath>..\..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpNewtonsoft.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="SimplSharpPro, Version=1.5.3.17, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||||
|
<SpecificVersion>False</SpecificVersion>
|
||||||
|
<HintPath>..\..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpPro.exe</HintPath>
|
||||||
|
<Private>False</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="SimplSharpReflectionInterface, Version=1.0.5583.25238, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||||
|
<SpecificVersion>False</SpecificVersion>
|
||||||
|
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpReflectionInterface.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System" />
|
||||||
|
<Reference Include="System.Core" />
|
||||||
|
<Reference Include="System.Data" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Include="AirMedia\AirMediaPropertiesConfig.cs" />
|
||||||
|
<Compile Include="AirMedia\AirMediaController.cs" />
|
||||||
|
<Compile Include="Chassis\DmBladeChassisController.cs" />
|
||||||
|
<Compile Include="Chassis\DmCardAudioOutput.cs" />
|
||||||
|
<Compile Include="Chassis\DmChassisController.cs" />
|
||||||
|
<Compile Include="Chassis\DmpsAudioOutputController.cs" />
|
||||||
|
<Compile Include="Chassis\DmpsInternalVirtualDmTxController.cs" />
|
||||||
|
<Compile Include="Chassis\DmpsRoutingController.cs" />
|
||||||
|
<Compile Include="Chassis\HdMdNxM4kEController.cs" />
|
||||||
|
<Compile Include="Endpoints\Transmitters\TxInterfaces.cs" />
|
||||||
|
<Compile Include="IDmSwitch.cs" />
|
||||||
|
<Compile Include="Config\DmpsRoutingConfig.cs" />
|
||||||
|
<Compile Include="Config\DmRmcConfig.cs" />
|
||||||
|
<Compile Include="Config\DmTxConfig.cs" />
|
||||||
|
<Compile Include="Config\DMChassisConfig.cs" />
|
||||||
|
<Compile Include="Config\HdMdNxM4kEPropertiesConfig.cs" />
|
||||||
|
<Compile Include="Config\InputPropertiesConfig.cs" />
|
||||||
|
<Compile Include="DmPortName.cs" />
|
||||||
|
<Compile Include="Endpoints\DGEs\DgeController.cs" />
|
||||||
|
<Compile Include="Endpoints\DGEs\DgePropertiesConfig.cs" />
|
||||||
|
<Compile Include="DmLite\HdMdxxxCEController.cs" />
|
||||||
|
<Compile Include="Endpoints\Receivers\DmHdBaseTEndpointController.cs" />
|
||||||
|
<Compile Include="Endpoints\Receivers\DmRmc100SController.cs" />
|
||||||
|
<Compile Include="Endpoints\Receivers\DmRmc150SController.cs" />
|
||||||
|
<Compile Include="Endpoints\Receivers\DmRmc200CController.cs" />
|
||||||
|
<Compile Include="Endpoints\Receivers\DmRmc200S2Controller.cs" />
|
||||||
|
<Compile Include="Endpoints\Receivers\DmRmc200SController.cs" />
|
||||||
|
<Compile Include="Endpoints\Receivers\DmRmc4k100C1GController.cs" />
|
||||||
|
<Compile Include="Endpoints\Receivers\DmRmc4KScalerCController.cs" />
|
||||||
|
<Compile Include="Endpoints\Receivers\DmRmc4kScalerCDspController.cs" />
|
||||||
|
<Compile Include="Endpoints\Receivers\DmRmcScalerCController.cs" />
|
||||||
|
<Compile Include="Endpoints\Receivers\DmRmcX100CController.cs" />
|
||||||
|
<Compile Include="Endpoints\Receivers\DmRmcHelper.cs" />
|
||||||
|
<Compile Include="Endpoints\Receivers\DmRmcScalerS2Controller.cs" />
|
||||||
|
<Compile Include="Endpoints\Receivers\DmRmcScalerSController.cs" />
|
||||||
|
<Compile Include="Endpoints\Transmitters\DmTx200Controller.cs" />
|
||||||
|
<Compile Include="Endpoints\Transmitters\DmTx401CController.cs" />
|
||||||
|
<Compile Include="Endpoints\Transmitters\DmTx4k100Controller.cs" />
|
||||||
|
<Compile Include="Endpoints\Transmitters\DmTx4k202CController.cs" />
|
||||||
|
<Compile Include="Endpoints\Transmitters\DmTx4k302CController.cs" />
|
||||||
|
<Compile Include="Endpoints\Transmitters\DmTx201CController.cs" />
|
||||||
|
<Compile Include="Endpoints\Transmitters\DmTx4kz302CController.cs" />
|
||||||
|
<Compile Include="Endpoints\Transmitters\DmTxHelpers.cs" />
|
||||||
|
<Compile Include="Extensions.cs" />
|
||||||
|
<Compile Include="Config\DeviceFactory.cs" />
|
||||||
|
<Compile Include="IDmHdmiInputExtensions.cs" />
|
||||||
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
|
<Compile Include="VideoStatusHelpers.cs" />
|
||||||
|
<None Include="app.config" />
|
||||||
|
<None Include="Properties\ControlSystem.cfg" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\..\Essentials Core\PepperDashEssentialsBase\PepperDash_Essentials_Core.csproj">
|
||||||
|
<Project>{A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5}</Project>
|
||||||
|
<Name>PepperDash_Essentials_Core</Name>
|
||||||
|
</ProjectReference>
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(MSBuildBinPath)\Microsoft.CompactFramework.CSharp.targets" />
|
||||||
|
<ProjectExtensions>
|
||||||
|
<VisualStudio>
|
||||||
|
</VisualStudio>
|
||||||
|
</ProjectExtensions>
|
||||||
|
<PropertyGroup>
|
||||||
|
<PostBuildEvent>rem S# Pro preparation will execute after these operations</PostBuildEvent>
|
||||||
|
</PropertyGroup>
|
||||||
|
</Project>
|
||||||
|
|
@ -84,7 +84,7 @@
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="SimplSharpReflectionInterface, Version=1.0.5583.25238, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
<Reference Include="SimplSharpReflectionInterface, Version=1.0.5583.25238, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||||
<SpecificVersion>False</SpecificVersion>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
<HintPath>..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpReflectionInterface.dll</HintPath>
|
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpReflectionInterface.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Core" />
|
<Reference Include="System.Core" />
|
||||||
|
|
@ -99,10 +99,13 @@
|
||||||
<Compile Include="Chassis\DmpsAudioOutputController.cs" />
|
<Compile Include="Chassis\DmpsAudioOutputController.cs" />
|
||||||
<Compile Include="Chassis\DmpsInternalVirtualDmTxController.cs" />
|
<Compile Include="Chassis\DmpsInternalVirtualDmTxController.cs" />
|
||||||
<Compile Include="Chassis\DmpsRoutingController.cs" />
|
<Compile Include="Chassis\DmpsRoutingController.cs" />
|
||||||
|
<Compile Include="Chassis\HdMdNxM4kEBridgeableController.cs" />
|
||||||
<Compile Include="Chassis\HdMdNxM4kEController.cs" />
|
<Compile Include="Chassis\HdMdNxM4kEController.cs" />
|
||||||
|
<Compile Include="Config\InputPropertiesConfig.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" />
|
||||||
<Compile Include="Endpoints\Receivers\DmRmc4kZScalerCController.cs" />
|
<Compile Include="Endpoints\Receivers\DmRmc4kZScalerCController.cs" />
|
||||||
|
<Compile Include="Endpoints\Transmitters\DmTx4kz202CController.cs" />
|
||||||
<Compile Include="Endpoints\Transmitters\DmTx201SController.cs" />
|
<Compile Include="Endpoints\Transmitters\DmTx201SController.cs" />
|
||||||
<Compile Include="Endpoints\Transmitters\DmTx4kz100Controller.cs" />
|
<Compile Include="Endpoints\Transmitters\DmTx4kz100Controller.cs" />
|
||||||
<Compile Include="Endpoints\Transmitters\TxInterfaces.cs" />
|
<Compile Include="Endpoints\Transmitters\TxInterfaces.cs" />
|
||||||
|
|
@ -112,7 +115,6 @@
|
||||||
<Compile Include="Config\DmTxConfig.cs" />
|
<Compile Include="Config\DmTxConfig.cs" />
|
||||||
<Compile Include="Config\DMChassisConfig.cs" />
|
<Compile Include="Config\DMChassisConfig.cs" />
|
||||||
<Compile Include="Config\HdMdNxM4kEPropertiesConfig.cs" />
|
<Compile Include="Config\HdMdNxM4kEPropertiesConfig.cs" />
|
||||||
<Compile Include="Config\InputPropertiesConfig.cs" />
|
|
||||||
<Compile Include="DmPortName.cs" />
|
<Compile Include="DmPortName.cs" />
|
||||||
<Compile Include="Endpoints\DGEs\Dge100Controller.cs" />
|
<Compile Include="Endpoints\DGEs\Dge100Controller.cs" />
|
||||||
<Compile Include="Endpoints\DGEs\DgePropertiesConfig.cs" />
|
<Compile Include="Endpoints\DGEs\DgePropertiesConfig.cs" />
|
||||||
|
|
|
||||||
|
|
@ -1,133 +0,0 @@
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using Crestron.SimplSharp;
|
|
||||||
using Crestron.SimplSharpPro;
|
|
||||||
using Crestron.SimplSharpPro.Gateways;
|
|
||||||
|
|
||||||
using PepperDash.Core;
|
|
||||||
using PepperDash.Essentials.Core;
|
|
||||||
using PepperDash.Essentials.Core.Config;
|
|
||||||
|
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Devices.Common
|
|
||||||
{
|
|
||||||
public class CenRfgwController : CrestronGenericBaseDevice
|
|
||||||
{
|
|
||||||
public GatewayBase Gateway { get { return Hardware as GatewayBase; } }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Constructor for the on-board gateway
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="key"></param>
|
|
||||||
/// <param name="name"></param>
|
|
||||||
public CenRfgwController(string key, string name, GatewayBase gateway) :
|
|
||||||
base(key, name, gateway)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public static CenRfgwController GetNewExGatewayController(string key, string name, string id, string gatewayType)
|
|
||||||
{
|
|
||||||
uint uid;
|
|
||||||
eExGatewayType type;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
uid = Convert.ToUInt32(id, 16);
|
|
||||||
type = (eExGatewayType)Enum.Parse(typeof(eExGatewayType), gatewayType, true);
|
|
||||||
var cs = Global.ControlSystem;
|
|
||||||
|
|
||||||
GatewayBase gw = null;
|
|
||||||
switch (type)
|
|
||||||
{
|
|
||||||
case eExGatewayType.Ethernet:
|
|
||||||
gw = new CenRfgwEx(uid, cs);
|
|
||||||
break;
|
|
||||||
case eExGatewayType.EthernetShared:
|
|
||||||
gw = new CenRfgwExEthernetSharable(uid, cs);
|
|
||||||
break;
|
|
||||||
case eExGatewayType.Cresnet:
|
|
||||||
gw = new CenRfgwExCresnet(uid, cs);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return new CenRfgwController(key, name, gw);
|
|
||||||
}
|
|
||||||
catch (Exception)
|
|
||||||
{
|
|
||||||
Debug.Console(0, "ERROR: Cannot create EX Gateway, id {0}, type {1}", id, gatewayType);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public static CenRfgwController GetNewErGatewayController(string key, string name, string id, string gatewayType)
|
|
||||||
{
|
|
||||||
uint uid;
|
|
||||||
eExGatewayType type;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
uid = Convert.ToUInt32(id, 16);
|
|
||||||
type = (eExGatewayType)Enum.Parse(typeof(eExGatewayType), gatewayType, true);
|
|
||||||
var cs = Global.ControlSystem;
|
|
||||||
|
|
||||||
GatewayBase gw = null;
|
|
||||||
switch (type)
|
|
||||||
{
|
|
||||||
case eExGatewayType.Ethernet:
|
|
||||||
gw = new CenErfgwPoe(uid, cs);
|
|
||||||
break;
|
|
||||||
case eExGatewayType.EthernetShared:
|
|
||||||
gw = new CenErfgwPoeEthernetSharable(uid, cs);
|
|
||||||
break;
|
|
||||||
case eExGatewayType.Cresnet:
|
|
||||||
gw = new CenErfgwPoeCresnet(uid, cs);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return new CenRfgwController(key, name, gw);
|
|
||||||
}
|
|
||||||
catch (Exception)
|
|
||||||
{
|
|
||||||
Debug.Console(0, "ERROR: Cannot create EX Gateway, id {0}, type {1}", id, gatewayType);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets the actual Crestron EX gateway for a given key. "processor" or the key of
|
|
||||||
/// a CenRfgwExController in DeviceManager
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="key"></param>
|
|
||||||
/// <returns>Either processor GW or Gateway property of CenRfgwExController</returns>
|
|
||||||
public static GatewayBase GetExGatewayBaseForKey(string key)
|
|
||||||
{
|
|
||||||
key = key.ToLower();
|
|
||||||
if (key == "processor" && Global.ControlSystem.SupportsInternalRFGateway)
|
|
||||||
return Global.ControlSystem.ControllerRFGatewayDevice;
|
|
||||||
var gwCont = DeviceManager.GetDeviceForKey(key) as CenRfgwController;
|
|
||||||
if (gwCont != null)
|
|
||||||
return gwCont.Gateway;
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public enum eExGatewayType
|
|
||||||
{
|
|
||||||
Ethernet, EthernetShared, Cresnet
|
|
||||||
}
|
|
||||||
|
|
||||||
public class CenRfgwControllerFactory : EssentialsDeviceFactory<CenRfgwController>
|
|
||||||
{
|
|
||||||
public CenRfgwControllerFactory()
|
|
||||||
{
|
|
||||||
TypeNames = new List<string>() { "cenrfgwex", "cenerfgwpoe" };
|
|
||||||
}
|
|
||||||
|
|
||||||
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
|
||||||
{
|
|
||||||
Debug.Console(1, "Factory Attempting to create new CEN-GWEXER Device");
|
|
||||||
return CenRfgwController.GetNewExGatewayController(dc.Key, dc.Name,
|
|
||||||
dc.Properties.Value<string>("id"), dc.Properties.Value<string>("gatewayType"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -132,7 +132,6 @@
|
||||||
<Compile Include="Codec\iHasDialer.cs" />
|
<Compile Include="Codec\iHasDialer.cs" />
|
||||||
<Compile Include="Codec\iHasDirectory.cs" />
|
<Compile Include="Codec\iHasDirectory.cs" />
|
||||||
<Compile Include="Codec\iHasScheduleAwareness.cs" />
|
<Compile Include="Codec\iHasScheduleAwareness.cs" />
|
||||||
<Compile Include="Crestron\Gateways\CenRfgwController.cs" />
|
|
||||||
<Compile Include="Display\ComTcpDisplayBase.cs" />
|
<Compile Include="Display\ComTcpDisplayBase.cs" />
|
||||||
<Compile Include="Display\AvocorVTFDisplay.cs" />
|
<Compile Include="Display\AvocorVTFDisplay.cs" />
|
||||||
<Compile Include="Display\InputInterfaces.cs" />
|
<Compile Include="Display\InputInterfaces.cs" />
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@ using PepperDash.Essentials.Core.Bridges;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Devices.Common.Occupancy
|
namespace PepperDash.Essentials.Devices.Common.Occupancy
|
||||||
{
|
{
|
||||||
|
[Description("Wrapper class for CEN-ODT-C-POE")]
|
||||||
public class CenOdtOccupancySensorBaseController : CrestronGenericBridgeableBaseDevice, IOccupancyStatusProvider
|
public class CenOdtOccupancySensorBaseController : CrestronGenericBridgeableBaseDevice, IOccupancyStatusProvider
|
||||||
{
|
{
|
||||||
public CenOdtCPoe OccSensor { get; private set; }
|
public CenOdtCPoe OccSensor { get; private set; }
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@ using PepperDash.Essentials.Core.Bridges;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Devices.Common.Occupancy
|
namespace PepperDash.Essentials.Devices.Common.Occupancy
|
||||||
{
|
{
|
||||||
|
[Description("Wrapper class for Single Technology GLS Occupancy Sensors")]
|
||||||
public class GlsOccupancySensorBaseController : CrestronGenericBridgeableBaseDevice, IOccupancyStatusProvider
|
public class GlsOccupancySensorBaseController : CrestronGenericBridgeableBaseDevice, IOccupancyStatusProvider
|
||||||
{
|
{
|
||||||
public GlsOccupancySensorBase OccSensor { get; private set; }
|
public GlsOccupancySensorBase OccSensor { get; private set; }
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@ using PepperDash.Essentials.Core.Bridges;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Devices.Common.Occupancy
|
namespace PepperDash.Essentials.Devices.Common.Occupancy
|
||||||
{
|
{
|
||||||
|
[Description("Wrapper class for Dual Technology GLS Occupancy Sensors")]
|
||||||
public class GlsOdtOccupancySensorController : GlsOccupancySensorBaseController
|
public class GlsOdtOccupancySensorController : GlsOccupancySensorBaseController
|
||||||
{
|
{
|
||||||
public new GlsOdtCCn OccSensor { get; private set; }
|
public new GlsOdtCCn OccSensor { get; private set; }
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@ using PepperDash.Essentials.Core.Routing;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Devices.Common
|
namespace PepperDash.Essentials.Devices.Common
|
||||||
{
|
{
|
||||||
|
[Description("Wrapper class for an IR Set Top Box")]
|
||||||
public class IRSetTopBoxBase : EssentialsBridgeableDevice, ISetTopBoxControls, IRoutingOutputs, IUsageTracking, IPower
|
public class IRSetTopBoxBase : EssentialsBridgeableDevice, ISetTopBoxControls, IRoutingOutputs, IUsageTracking, IPower
|
||||||
{
|
{
|
||||||
public IrOutputPortController IrPort { get; private set; }
|
public IrOutputPortController IrPort { get; private set; }
|
||||||
|
|
|
||||||
|
|
@ -14,9 +14,9 @@ using PepperDash.Essentials.Core.Routing;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Devices.Common
|
namespace PepperDash.Essentials.Devices.Common
|
||||||
{
|
{
|
||||||
|
[Description("Wrapper class for an IR-Controlled AppleTV")]
|
||||||
public class AppleTV : EssentialsBridgeableDevice, IDPad, ITransport, IUiDisplayInfo, IRoutingOutputs
|
public class AppleTV : EssentialsBridgeableDevice, IDPad, ITransport, IUiDisplayInfo, IRoutingOutputs
|
||||||
{
|
{
|
||||||
|
|
||||||
public IrOutputPortController IrPort { get; private set; }
|
public IrOutputPortController IrPort { get; private set; }
|
||||||
public const string StandardDriverName = "Apple AppleTV-v2.ir";
|
public const string StandardDriverName = "Apple AppleTV-v2.ir";
|
||||||
public uint DisplayUiType { get { return DisplayUiConstants.TypeAppleTv; } }
|
public uint DisplayUiType { get { return DisplayUiConstants.TypeAppleTv; } }
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@ using PepperDash.Essentials.Core.Routing;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Devices.Common
|
namespace PepperDash.Essentials.Devices.Common
|
||||||
{
|
{
|
||||||
|
[Description("Wrapper class for an IR-Controlled Roku")]
|
||||||
public class Roku2 : EssentialsDevice, IDPad, ITransport, IUiDisplayInfo, IRoutingOutputs
|
public class Roku2 : EssentialsDevice, IDPad, ITransport, IUiDisplayInfo, IRoutingOutputs
|
||||||
{
|
{
|
||||||
[Api]
|
[Api]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue