mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-06 08:16:11 +00:00
Compare commits
80 Commits
1.12.7
...
hotfix/Dis
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c53cad8119 | ||
|
|
82e8b4b203 | ||
|
|
8c3b891255 | ||
|
|
51bd95937a | ||
|
|
10fc8ee30b | ||
|
|
8da8b8c584 | ||
|
|
c7e0326b8c | ||
|
|
845978c741 | ||
|
|
ba511067d3 | ||
|
|
a9fe8bbb10 | ||
|
|
bc64ee37cb | ||
|
|
b2646f50cb | ||
|
|
465aa947cf | ||
|
|
16b78d27b9 | ||
|
|
4e56213dad | ||
|
|
668fc89eb2 | ||
|
|
e623c482a9 | ||
|
|
243c7cc3ee | ||
|
|
615598c8a6 | ||
|
|
3b25108a26 | ||
|
|
f253abd0ae | ||
|
|
e04f6d0396 | ||
|
|
eb4c7ff605 | ||
|
|
d0688cbc16 | ||
|
|
961af69aae | ||
|
|
df402ce498 | ||
|
|
e524bf358a | ||
|
|
3abd195c57 | ||
|
|
a3615d8d1b | ||
|
|
6a461a6923 | ||
|
|
77776f3258 | ||
|
|
701513d30e | ||
|
|
c9eaff6fce | ||
|
|
e8cdf3a63b | ||
|
|
f55ecdb67e | ||
|
|
cad677ae89 | ||
|
|
b057d3de18 | ||
|
|
1920d37488 | ||
|
|
e005a30383 | ||
|
|
058b3820be | ||
|
|
8a77b134e4 | ||
|
|
88f843250a | ||
|
|
772369bcd6 | ||
|
|
cef29af1ba | ||
|
|
8cc6cfafe9 | ||
|
|
89ba4627ea | ||
|
|
e05186defd | ||
|
|
83b0aec227 | ||
|
|
a3ba014c0f | ||
|
|
4919a863c3 | ||
|
|
2228bc1a1e | ||
|
|
1411add591 | ||
|
|
cbec2f2119 | ||
|
|
34d3b705fa | ||
|
|
e1d7374f1e | ||
|
|
a3346d5ef4 | ||
|
|
1c1eabcef6 | ||
|
|
12f3f519cc | ||
|
|
4dc6d5b5ac | ||
|
|
faaa2a354e | ||
|
|
087e74b207 | ||
|
|
8bb670c43b | ||
|
|
55a5cc53c9 | ||
|
|
0793a09095 | ||
|
|
15efed02a5 | ||
|
|
c68d46f971 | ||
|
|
dd2aca9aa4 | ||
|
|
705e750419 | ||
|
|
23af38aefa | ||
|
|
1bae7dc91b | ||
|
|
0c2896f9aa | ||
|
|
555944011d | ||
|
|
03d5c24dc4 | ||
|
|
f4a5d6737e | ||
|
|
b52bee5714 | ||
|
|
5de4382cd0 | ||
|
|
6414631deb | ||
|
|
3b2fa8aec5 | ||
|
|
ffa864c71b | ||
|
|
112a2b7382 |
37
.github/workflows/add-issues-to-project.yml
vendored
Normal file
37
.github/workflows/add-issues-to-project.yml
vendored
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
name: Add bugs to bugs project
|
||||||
|
|
||||||
|
on:
|
||||||
|
issues:
|
||||||
|
types:
|
||||||
|
- opened
|
||||||
|
- labeled
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
check-secret:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
my-key: ${{ steps.my-key.outputs.defined }}
|
||||||
|
steps:
|
||||||
|
- id: my-key
|
||||||
|
if: "${{ env.MY_KEY != '' }}"
|
||||||
|
run: echo "::set-output name=defined::true"
|
||||||
|
env:
|
||||||
|
MY_KEY: ${{ secrets.PROJECT_URL }}
|
||||||
|
throw-error:
|
||||||
|
name: Check
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: [check-secret]
|
||||||
|
if: needs.check-secret.outputs.my-key != 'true'
|
||||||
|
steps:
|
||||||
|
- run: echo "The Project URL Repo Secret is empty"
|
||||||
|
add-to-project:
|
||||||
|
name: Add issue to project
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: [check-secret]
|
||||||
|
if: needs.check-secret.outputs.my-key == 'true'
|
||||||
|
steps:
|
||||||
|
- uses: actions/add-to-project@main
|
||||||
|
with:
|
||||||
|
project-url: ${{ secrets.PROJECT_URL }}
|
||||||
|
github-token: ${{ secrets.GH_PROJECTS_PASSWORD }}
|
||||||
|
|
||||||
@@ -55,7 +55,7 @@ namespace PepperDash.Essentials
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// DSP format: deviceKey--levelName, biampTesira-1--master
|
// DSP/DMPS format: deviceKey--levelName, biampTesira-1--master
|
||||||
match = Regex.Match(DeviceKey, @"([-_\w]+)--(.+)");
|
match = Regex.Match(DeviceKey, @"([-_\w]+)--(.+)");
|
||||||
if (match.Success)
|
if (match.Success)
|
||||||
{
|
{
|
||||||
@@ -67,6 +67,27 @@ namespace PepperDash.Essentials
|
|||||||
if (dsp.LevelControlPoints.ContainsKey(levelTag)) // should always...
|
if (dsp.LevelControlPoints.ContainsKey(levelTag)) // should always...
|
||||||
return dsp.LevelControlPoints[levelTag];
|
return dsp.LevelControlPoints[levelTag];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var dmps = DeviceManager.GetDeviceForKey(devKey) as DmpsAudioOutputController;
|
||||||
|
if (dmps != null)
|
||||||
|
{
|
||||||
|
var levelTag = match.Groups[2].Value;
|
||||||
|
switch (levelTag)
|
||||||
|
{
|
||||||
|
case "master":
|
||||||
|
return dmps.MasterVolumeLevel;
|
||||||
|
case "source":
|
||||||
|
return dmps.SourceVolumeLevel;
|
||||||
|
case "micsmaster":
|
||||||
|
return dmps.MicsMasterVolumeLevel;
|
||||||
|
case "codec1":
|
||||||
|
return dmps.Codec1VolumeLevel;
|
||||||
|
case "codec2":
|
||||||
|
return dmps.Codec2VolumeLevel;
|
||||||
|
default:
|
||||||
|
return dmps.MasterVolumeLevel;
|
||||||
|
}
|
||||||
|
}
|
||||||
// No volume for some reason. We have failed as developers
|
// No volume for some reason. We have failed as developers
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ using PepperDash.Essentials.Core;
|
|||||||
using PepperDash.Essentials.Core.Bridges;
|
using PepperDash.Essentials.Core.Bridges;
|
||||||
using PepperDash.Essentials.Core.Config;
|
using PepperDash.Essentials.Core.Config;
|
||||||
using PepperDash.Essentials.Core.Fusion;
|
using PepperDash.Essentials.Core.Fusion;
|
||||||
|
using PepperDash.Essentials.Core.Web;
|
||||||
using PepperDash.Essentials.Devices.Common;
|
using PepperDash.Essentials.Devices.Common;
|
||||||
using PepperDash.Essentials.DM;
|
using PepperDash.Essentials.DM;
|
||||||
using PepperDash.Essentials.Fusion;
|
using PepperDash.Essentials.Fusion;
|
||||||
@@ -46,28 +47,29 @@ namespace PepperDash.Essentials
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public override void InitializeSystem()
|
public override void InitializeSystem()
|
||||||
{
|
{
|
||||||
_startTimer = new CTimer(StartSystem,StartupTime);
|
|
||||||
|
|
||||||
|
|
||||||
// If the control system is a DMPS type, we need to wait to exit this method until all devices have had time to activate
|
// If the control system is a DMPS type, we need to wait to exit this method until all devices have had time to activate
|
||||||
// to allow any HD-BaseT DM endpoints to register first.
|
// to allow any HD-BaseT DM endpoints to register first.
|
||||||
if (Global.ControlSystemIsDmpsType)
|
bool preventInitializationComplete = Global.ControlSystemIsDmpsType;
|
||||||
|
if (preventInitializationComplete)
|
||||||
{
|
{
|
||||||
Debug.Console(1, "******************* InitializeSystem() Entering **********************");
|
Debug.Console(1, "******************* InitializeSystem() Entering **********************");
|
||||||
|
_startTimer = new CTimer(StartSystem, preventInitializationComplete, StartupTime);
|
||||||
_initializeEvent = new CEvent();
|
_initializeEvent = new CEvent(true, false);
|
||||||
|
|
||||||
DeviceManager.AllDevicesRegistered += (o, a) =>
|
DeviceManager.AllDevicesRegistered += (o, a) =>
|
||||||
{
|
{
|
||||||
_initializeEvent.Set();
|
_initializeEvent.Set();
|
||||||
Debug.Console(1, "******************* InitializeSystem() Exiting **********************");
|
|
||||||
};
|
};
|
||||||
|
|
||||||
_initializeEvent.Wait(30000);
|
_initializeEvent.Wait(30000);
|
||||||
|
Debug.Console(1, "******************* InitializeSystem() Exiting **********************");
|
||||||
|
SystemMonitor.ProgramInitialization.ProgramInitializationComplete = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_startTimer = new CTimer(StartSystem, preventInitializationComplete, StartupTime);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void StartSystem(object obj)
|
private void StartSystem(object preventInitialization)
|
||||||
{
|
{
|
||||||
DeterminePlatform();
|
DeterminePlatform();
|
||||||
|
|
||||||
@@ -79,7 +81,7 @@ namespace PepperDash.Essentials
|
|||||||
|
|
||||||
CrestronConsole.AddNewConsoleCommand(PluginLoader.ReportAssemblyVersions, "reportversions", "Reports the versions of the loaded assemblies", ConsoleAccessLevelEnum.AccessOperator);
|
CrestronConsole.AddNewConsoleCommand(PluginLoader.ReportAssemblyVersions, "reportversions", "Reports the versions of the loaded assemblies", ConsoleAccessLevelEnum.AccessOperator);
|
||||||
|
|
||||||
CrestronConsole.AddNewConsoleCommand(PepperDash.Essentials.Core.DeviceFactory.GetDeviceFactoryTypes, "gettypes", "Gets the device types that can be built. Accepts a filter string.", ConsoleAccessLevelEnum.AccessOperator);
|
CrestronConsole.AddNewConsoleCommand(Core.DeviceFactory.GetDeviceFactoryTypes, "gettypes", "Gets the device types that can be built. Accepts a filter string.", ConsoleAccessLevelEnum.AccessOperator);
|
||||||
|
|
||||||
CrestronConsole.AddNewConsoleCommand(BridgeHelper.PrintJoinMap, "getjoinmap", "map(s) for bridge or device on bridge [brKey [devKey]]", ConsoleAccessLevelEnum.AccessOperator);
|
CrestronConsole.AddNewConsoleCommand(BridgeHelper.PrintJoinMap, "getjoinmap", "map(s) for bridge or device on bridge [brKey [devKey]]", ConsoleAccessLevelEnum.AccessOperator);
|
||||||
|
|
||||||
@@ -124,7 +126,10 @@ namespace PepperDash.Essentials
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
SystemMonitor.ProgramInitialization.ProgramInitializationComplete = true;
|
if (!(bool)preventInitialization)
|
||||||
|
{
|
||||||
|
SystemMonitor.ProgramInitialization.ProgramInitializationComplete = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -353,6 +358,7 @@ namespace PepperDash.Essentials
|
|||||||
|
|
||||||
// Build the processor wrapper class
|
// Build the processor wrapper class
|
||||||
DeviceManager.AddDevice(new PepperDash.Essentials.Core.Devices.CrestronProcessor("processor"));
|
DeviceManager.AddDevice(new PepperDash.Essentials.Core.Devices.CrestronProcessor("processor"));
|
||||||
|
DeviceManager.AddDevice(new EssemtialsWebApi("essentialsWebApi","Essentials Web API"));
|
||||||
|
|
||||||
// Add global System Monitor device
|
// Add global System Monitor device
|
||||||
if (CrestronEnvironment.DevicePlatform == eDevicePlatform.Appliance)
|
if (CrestronEnvironment.DevicePlatform == eDevicePlatform.Appliance)
|
||||||
|
|||||||
@@ -272,7 +272,7 @@ namespace PepperDash.Essentials
|
|||||||
{
|
{
|
||||||
Debug.Console(2, this,
|
Debug.Console(2, this,
|
||||||
@"Attempting to run action:
|
@"Attempting to run action:
|
||||||
DeviceKey: {0}
|
Key: {0}
|
||||||
MethodName: {1}
|
MethodName: {1}
|
||||||
Params: {2}"
|
Params: {2}"
|
||||||
, a.DeviceKey, a.MethodName, a.Params);
|
, a.DeviceKey, a.MethodName, a.Params);
|
||||||
|
|||||||
@@ -1,44 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using Crestron.SimplSharp;
|
|
||||||
|
|
||||||
using PepperDash.Essentials.Core;
|
|
||||||
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
|
|
||||||
using PepperDash.Essentials.Room.Config;
|
|
||||||
using PepperDash.Essentials.Core.Devices;
|
|
||||||
using PepperDash.Essentials.Devices.Common.Codec;
|
|
||||||
using PepperDash.Essentials.Devices.Common.VideoCodec;
|
|
||||||
using PepperDash.Essentials.Devices.Common.AudioCodec;
|
|
||||||
|
|
||||||
|
|
||||||
using PepperDash.Core;
|
|
||||||
|
|
||||||
namespace PepperDash.Essentials
|
|
||||||
{
|
|
||||||
public interface IEssentialsHuddleSpaceRoom : IEssentialsRoom, IHasCurrentSourceInfoChange, IRunRouteAction, IHasDefaultDisplay
|
|
||||||
{
|
|
||||||
bool ExcludeFromGlobalFunctions { get; }
|
|
||||||
|
|
||||||
void RunRouteAction(string routeKey);
|
|
||||||
|
|
||||||
EssentialsHuddleRoomPropertiesConfig PropertiesConfig { get; }
|
|
||||||
|
|
||||||
IBasicVolumeControls CurrentVolumeControls { get; }
|
|
||||||
|
|
||||||
event EventHandler<VolumeDeviceChangeEventArgs> CurrentVolumeDeviceChange;
|
|
||||||
}
|
|
||||||
|
|
||||||
public interface IEssentialsHuddleVtc1Room : IEssentialsRoom, IHasCurrentSourceInfoChange,
|
|
||||||
IHasCurrentVolumeControls, IRunRouteAction, IRunDefaultCallRoute, IHasVideoCodec, IHasAudioCodec, IHasDefaultDisplay
|
|
||||||
{
|
|
||||||
EssentialsHuddleVtc1PropertiesConfig PropertiesConfig { get; }
|
|
||||||
|
|
||||||
void RunRouteAction(string routeKey);
|
|
||||||
|
|
||||||
IHasScheduleAwareness ScheduleSource { get; }
|
|
||||||
|
|
||||||
string DefaultCodecRouteString { get; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -109,7 +109,7 @@ namespace PepperDash.Essentials.Core.Bridges
|
|||||||
{
|
{
|
||||||
public EiscApiPropertiesConfig PropertiesConfig { get; private set; }
|
public EiscApiPropertiesConfig PropertiesConfig { get; private set; }
|
||||||
|
|
||||||
protected Dictionary<string, JoinMapBaseAdvanced> JoinMaps { get; private set; }
|
public Dictionary<string, JoinMapBaseAdvanced> JoinMaps { get; private set; }
|
||||||
|
|
||||||
public BasicTriList Eisc { get; private set; }
|
public BasicTriList Eisc { get; private set; }
|
||||||
|
|
||||||
|
|||||||
@@ -64,6 +64,11 @@ namespace PepperDash.Essentials.Core.Bridges
|
|||||||
public JoinDataComplete VgaContrast = new JoinDataComplete(new JoinData { JoinNumber = 7, JoinSpan = 1 },
|
public JoinDataComplete VgaContrast = new JoinDataComplete(new JoinData { JoinNumber = 7, JoinSpan = 1 },
|
||||||
new JoinMetadata { Description = "DM TX Online", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
|
new JoinMetadata { Description = "DM TX Online", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
|
||||||
|
|
||||||
|
[JoinName("Port3HdcpState")]
|
||||||
|
public JoinDataComplete Port3HdcpState = new JoinDataComplete(new JoinData { JoinNumber = 8, JoinSpan = 1 },
|
||||||
|
new JoinMetadata { Description = "DM TX Port 3 HDCP State Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Constructor to use when instantiating this Join Map without inheriting from it
|
/// Constructor to use when instantiating this Join Map without inheriting from it
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ namespace PepperDash.Essentials.Core.Bridges
|
|||||||
[JoinName("ProgramOffsetJoin")]
|
[JoinName("ProgramOffsetJoin")]
|
||||||
public JoinDataComplete ProgramOffsetJoin = new JoinDataComplete(new JoinData { JoinNumber = 5, JoinSpan = 5 },
|
public JoinDataComplete ProgramOffsetJoin = new JoinDataComplete(new JoinData { JoinNumber = 5, JoinSpan = 5 },
|
||||||
new JoinMetadata { Description = "All Program Data is offset between slots by 5 - First Joins Start at 11", JoinCapabilities = eJoinCapabilities.None, JoinType = eJoinType.None });
|
new JoinMetadata { Description = "All Program Data is offset between slots by 5 - First Joins Start at 11", JoinCapabilities = eJoinCapabilities.None, JoinType = eJoinType.None });
|
||||||
|
|
||||||
[JoinName("ProgramStart")]
|
[JoinName("ProgramStart")]
|
||||||
public JoinDataComplete ProgramStart = new JoinDataComplete(new JoinData { JoinNumber = 11, JoinSpan = 1 },
|
public JoinDataComplete ProgramStart = new JoinDataComplete(new JoinData { JoinNumber = 11, JoinSpan = 1 },
|
||||||
new JoinMetadata { Description = "Processor Program Start / Fb", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
|
new JoinMetadata { Description = "Processor Program Start / Fb", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
|
||||||
@@ -132,6 +132,23 @@ namespace PepperDash.Essentials.Core.Bridges
|
|||||||
public JoinDataComplete DhcpStatus = new JoinDataComplete(new JoinData { JoinNumber = 86, JoinSpan = 1 },
|
public JoinDataComplete DhcpStatus = new JoinDataComplete(new JoinData { JoinNumber = 86, JoinSpan = 1 },
|
||||||
new JoinMetadata { Description = "Processor Ethernet Dhcp Status", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
|
new JoinMetadata { Description = "Processor Ethernet Dhcp Status", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
|
||||||
|
|
||||||
|
[JoinName("ProcessorRebot")]
|
||||||
|
public JoinDataComplete ProcessorReboot = new JoinDataComplete(new JoinData { JoinNumber = 1, JoinSpan = 1 },
|
||||||
|
new JoinMetadata { Description = "Reboot processor", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
[JoinName("IsAppliance")]
|
||||||
|
public JoinDataComplete IsAppliance = new JoinDataComplete(new JoinData { JoinNumber = 1, JoinSpan = 1 },
|
||||||
|
new JoinMetadata { Description = "Is appliance Fb", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
[JoinName("IsServer")]
|
||||||
|
public JoinDataComplete IsServer = new JoinDataComplete(new JoinData { JoinNumber = 2, JoinSpan = 1 },
|
||||||
|
new JoinMetadata { Description = "Is server Fb", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
[JoinName("ProgramReset")]
|
||||||
|
public JoinDataComplete ProgramReset = new JoinDataComplete(new JoinData { JoinNumber = 15, JoinSpan = 1 },
|
||||||
|
new JoinMetadata { Description = "Resets the program", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Constructor to use when instantiating this Join Map without inheriting from it
|
/// Constructor to use when instantiating this Join Map without inheriting from it
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -183,6 +183,8 @@ namespace PepperDash.Essentials.Core
|
|||||||
[JsonConverter(typeof(ComSpecJsonConverter))]
|
[JsonConverter(typeof(ComSpecJsonConverter))]
|
||||||
public ComPort.ComPortSpec ComParams { get; set; }
|
public ComPort.ComPortSpec ComParams { get; set; }
|
||||||
|
|
||||||
|
public string RoomId { get; set; }
|
||||||
|
|
||||||
public string CresnetId { get; set; }
|
public string CresnetId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -388,20 +388,18 @@ namespace PepperDash.Essentials.Core
|
|||||||
var outputPorts = ((device as IRoutingOutputs) != null) ? (device as IRoutingOutputs).OutputPorts : null;
|
var outputPorts = ((device as IRoutingOutputs) != null) ? (device as IRoutingOutputs).OutputPorts : null;
|
||||||
if (inputPorts != null)
|
if (inputPorts != null)
|
||||||
{
|
{
|
||||||
Debug.Console(0, "Device {0} has {1} Input Ports:", s, inputPorts.Count);
|
CrestronConsole.ConsoleCommandResponse("Device {0} has {1} Input Ports:", s, inputPorts.Count);
|
||||||
foreach (var routingInputPort in inputPorts)
|
foreach (var routingInputPort in inputPorts)
|
||||||
{
|
{
|
||||||
Debug.Console(0, "{0}", routingInputPort.Key);
|
CrestronConsole.ConsoleCommandResponse("{0}", routingInputPort.Key);
|
||||||
}
|
|
||||||
}
|
|
||||||
if (outputPorts != null)
|
|
||||||
{
|
|
||||||
Debug.Console(0, "Device {0} has {1} Output Ports:", s, outputPorts.Count);
|
|
||||||
foreach (var routingOutputPort in outputPorts)
|
|
||||||
{
|
|
||||||
Debug.Console(0, "{0}", routingOutputPort.Key);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (outputPorts == null) return;
|
||||||
|
CrestronConsole.ConsoleCommandResponse("Device {0} has {1} Output Ports:", s, outputPorts.Count);
|
||||||
|
foreach (var routingOutputPort in outputPorts)
|
||||||
|
{
|
||||||
|
CrestronConsole.ConsoleCommandResponse("{0}", routingOutputPort.Key);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -435,7 +433,7 @@ namespace PepperDash.Essentials.Core
|
|||||||
|
|
||||||
if (device == null)
|
if (device == null)
|
||||||
{
|
{
|
||||||
Debug.Console(0, "Unable to get device with key: {0}", deviceKey);
|
CrestronConsole.ConsoleCommandResponse("Unable to get device with key: {0}", deviceKey);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -447,7 +445,7 @@ namespace PepperDash.Essentials.Core
|
|||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
Debug.Console(0, "Unable to convert setting value. Please use off/rx/tx/both");
|
CrestronConsole.ConsoleCommandResponse("Unable to convert setting value. Please use off/rx/tx/both");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -458,18 +456,18 @@ namespace PepperDash.Essentials.Core
|
|||||||
var min = Convert.ToUInt32(timeout);
|
var min = Convert.ToUInt32(timeout);
|
||||||
|
|
||||||
device.StreamDebugging.SetDebuggingWithSpecificTimeout(debugSetting, min);
|
device.StreamDebugging.SetDebuggingWithSpecificTimeout(debugSetting, min);
|
||||||
Debug.Console(0, "Device: '{0}' debug level set to {1} for {2} minutes", deviceKey, debugSetting, min);
|
CrestronConsole.ConsoleCommandResponse("Device: '{0}' debug level set to {1} for {2} minutes", deviceKey, debugSetting, min);
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
Debug.Console(0, "Unable to convert minutes or settings value. Please use an integer value for minutes. Errro: {0}", e);
|
CrestronConsole.ConsoleCommandResponse("Unable to convert minutes or settings value. Please use an integer value for minutes. Error: {0}", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
device.StreamDebugging.SetDebuggingWithDefaultTimeout(debugSetting);
|
device.StreamDebugging.SetDebuggingWithDefaultTimeout(debugSetting);
|
||||||
Debug.Console(0, "Device: '{0}' debug level set to {1} for default time (30 minutes)", deviceKey, debugSetting);
|
CrestronConsole.ConsoleCommandResponse("Device: '{0}' debug level set to {1} for default time (30 minutes)", deviceKey, debugSetting);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -172,21 +172,14 @@ namespace PepperDash.Essentials.Core
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Prints the type names and associated metadata from the FactoryMethods collection.
|
/// Prints the type names and associated metadata from the FactoryMethods collection.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="command"></param>
|
/// <param name="filter"></param>
|
||||||
public static void GetDeviceFactoryTypes(string filter)
|
public static void GetDeviceFactoryTypes(string filter)
|
||||||
{
|
{
|
||||||
Dictionary<string, DeviceFactoryWrapper> types = new Dictionary<string, DeviceFactoryWrapper>();
|
var types = !string.IsNullOrEmpty(filter)
|
||||||
|
? FactoryMethods.Where(k => k.Key.Contains(filter)).ToDictionary(k => k.Key, k => k.Value)
|
||||||
|
: FactoryMethods;
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(filter))
|
CrestronConsole.ConsoleCommandResponse("Device Types:");
|
||||||
{
|
|
||||||
types = FactoryMethods.Where(k => k.Key.Contains(filter)).ToDictionary(k => k.Key, k => k.Value);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
types = FactoryMethods;
|
|
||||||
}
|
|
||||||
|
|
||||||
Debug.Console(0, "Device Types:");
|
|
||||||
|
|
||||||
foreach (var type in types.OrderBy(t => t.Key))
|
foreach (var type in types.OrderBy(t => t.Key))
|
||||||
{
|
{
|
||||||
@@ -198,11 +191,23 @@ namespace PepperDash.Essentials.Core
|
|||||||
cType = type.Value.CType.FullName;
|
cType = type.Value.CType.FullName;
|
||||||
}
|
}
|
||||||
|
|
||||||
Debug.Console(0,
|
CrestronConsole.ConsoleCommandResponse(
|
||||||
@"Type: '{0}'
|
@"Type: '{0}'
|
||||||
CType: '{1}'
|
CType: '{1}'
|
||||||
Description: {2}", type.Key, cType, description);
|
Description: {2}", type.Key, cType, description);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the device factory dictionary
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="filter"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static Dictionary<string, DeviceFactoryWrapper> GetDeviceFactoryDictionary(string filter)
|
||||||
|
{
|
||||||
|
return string.IsNullOrEmpty(filter)
|
||||||
|
? FactoryMethods
|
||||||
|
: FactoryMethods.Where(k => k.Key.Contains(filter)).ToDictionary(k => k.Key, k => k.Value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -21,35 +21,37 @@ namespace PepperDash.Essentials.Core
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="fileName"></param>
|
/// <param name="fileName"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static FileInfo[] GetFiles(string fileName)
|
public static FileInfo[] GetFiles(string fileName)
|
||||||
{
|
{
|
||||||
DirectoryInfo dirInfo = new DirectoryInfo(Path.GetDirectoryName(fileName));
|
string fullFilePath = Global.FilePathPrefix + fileName;
|
||||||
var files = dirInfo.GetFiles(Path.GetFileName(fileName));
|
DirectoryInfo dirInfo = new DirectoryInfo(Path.GetDirectoryName(fullFilePath));
|
||||||
Debug.Console(0, "FileIO found: {0}, {1}", files.Count(), fileName);
|
var files = dirInfo.GetFiles(Path.GetFileName(fullFilePath));
|
||||||
if (files.Count() > 0)
|
Debug.Console(0, "FileIO found: {0}, {1}", files.Count(), fullFilePath);
|
||||||
{
|
if (files.Count() > 0)
|
||||||
return files;
|
{
|
||||||
}
|
return files;
|
||||||
else
|
}
|
||||||
{
|
else
|
||||||
return null;
|
{
|
||||||
}
|
return null;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static FileInfo GetFile(string fileName)
|
public static FileInfo GetFile(string fileName)
|
||||||
{
|
{
|
||||||
DirectoryInfo dirInfo = new DirectoryInfo(Path.GetDirectoryName(fileName));
|
string fullFilePath = Global.FilePathPrefix + fileName;
|
||||||
var files = dirInfo.GetFiles(Path.GetFileName(fileName));
|
DirectoryInfo dirInfo = new DirectoryInfo(Path.GetDirectoryName(fullFilePath));
|
||||||
Debug.Console(0, "FileIO found: {0}, {1}", files.Count(), fileName);
|
var files = dirInfo.GetFiles(Path.GetFileName(fullFilePath));
|
||||||
if (files.Count() > 0)
|
Debug.Console(0, "FileIO found: {0}, {1}", files.Count(), fullFilePath);
|
||||||
{
|
if (files.Count() > 0)
|
||||||
return files.FirstOrDefault();
|
{
|
||||||
}
|
return files.FirstOrDefault();
|
||||||
else
|
}
|
||||||
{
|
else
|
||||||
return null;
|
{
|
||||||
}
|
return null;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -81,7 +83,7 @@ namespace PepperDash.Essentials.Core
|
|||||||
{
|
{
|
||||||
if (fileLock.TryEnter())
|
if (fileLock.TryEnter())
|
||||||
{
|
{
|
||||||
DirectoryInfo dirInfo = new DirectoryInfo(file.Name);
|
DirectoryInfo dirInfo = new DirectoryInfo(file.DirectoryName);
|
||||||
Debug.Console(2, "FileIO Getting Data {0}", file.FullName);
|
Debug.Console(2, "FileIO Getting Data {0}", file.FullName);
|
||||||
|
|
||||||
if (File.Exists(file.FullName))
|
if (File.Exists(file.FullName))
|
||||||
@@ -202,7 +204,7 @@ namespace PepperDash.Essentials.Core
|
|||||||
public static void WriteDataToFile(string data, string filePath)
|
public static void WriteDataToFile(string data, string filePath)
|
||||||
{
|
{
|
||||||
Thread _WriteFileThread;
|
Thread _WriteFileThread;
|
||||||
_WriteFileThread = new Thread((O) => _WriteFileMethod(data, filePath), null, Thread.eThreadStartOptions.CreateSuspended);
|
_WriteFileThread = new Thread((O) => _WriteFileMethod(data, Global.FilePathPrefix + "/" + filePath), null, Thread.eThreadStartOptions.CreateSuspended);
|
||||||
_WriteFileThread.Priority = Thread.eThreadPriority.LowestPriority;
|
_WriteFileThread.Priority = Thread.eThreadPriority.LowestPriority;
|
||||||
_WriteFileThread.Start();
|
_WriteFileThread.Start();
|
||||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "New WriteFile Thread");
|
Debug.Console(0, Debug.ErrorLogLevel.Notice, "New WriteFile Thread");
|
||||||
@@ -217,7 +219,8 @@ namespace PepperDash.Essentials.Core
|
|||||||
{
|
{
|
||||||
if (fileLock.TryEnter())
|
if (fileLock.TryEnter())
|
||||||
{
|
{
|
||||||
using (StreamWriter sw = new StreamWriter(filePath))
|
|
||||||
|
using (StreamWriter sw = new StreamWriter(filePath))
|
||||||
{
|
{
|
||||||
sw.Write(data);
|
sw.Write(data);
|
||||||
sw.Flush();
|
sw.Flush();
|
||||||
|
|||||||
@@ -1,9 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Data;
|
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Crestron.SimplSharp.Reflection;
|
using Crestron.SimplSharp.Reflection;
|
||||||
using Crestron.SimplSharp.CrestronIO;
|
using Crestron.SimplSharp.CrestronIO;
|
||||||
@@ -103,22 +101,22 @@ namespace PepperDash.Essentials.Core
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public void PrintJoinMapInfo()
|
public void PrintJoinMapInfo()
|
||||||
{
|
{
|
||||||
Debug.Console(0, "{0}:\n", GetType().Name);
|
CrestronConsole.ConsoleCommandResponse("{0}:\n", GetType().Name);
|
||||||
|
|
||||||
// Get the joins of each type and print them
|
// Get the joins of each type and print them
|
||||||
Debug.Console(0, "Digitals:");
|
CrestronConsole.ConsoleCommandResponse("Digitals:");
|
||||||
var digitals = Joins.Where(j => (j.Value.JoinType & eJoinType.Digital) == eJoinType.Digital).ToDictionary(j => j.Key, j => j.Value);
|
var digitals = Joins.Where(j => (j.Value.JoinType & eJoinType.Digital) == eJoinType.Digital).ToDictionary(j => j.Key, j => j.Value);
|
||||||
Debug.Console(2, "Found {0} Digital Joins", digitals.Count);
|
CrestronConsole.ConsoleCommandResponse("Found {0} Digital Joins", digitals.Count);
|
||||||
PrintJoinList(GetSortedJoins(digitals));
|
PrintJoinList(GetSortedJoins(digitals));
|
||||||
|
|
||||||
Debug.Console(0, "Analogs:");
|
CrestronConsole.ConsoleCommandResponse("Analogs:");
|
||||||
var analogs = Joins.Where(j => (j.Value.JoinType & eJoinType.Analog) == eJoinType.Analog).ToDictionary(j => j.Key, j => j.Value);
|
var analogs = Joins.Where(j => (j.Value.JoinType & eJoinType.Analog) == eJoinType.Analog).ToDictionary(j => j.Key, j => j.Value);
|
||||||
Debug.Console(2, "Found {0} Analog Joins", analogs.Count);
|
CrestronConsole.ConsoleCommandResponse("Found {0} Analog Joins", analogs.Count);
|
||||||
PrintJoinList(GetSortedJoins(analogs));
|
PrintJoinList(GetSortedJoins(analogs));
|
||||||
|
|
||||||
Debug.Console(0, "Serials:");
|
CrestronConsole.ConsoleCommandResponse("Serials:");
|
||||||
var serials = Joins.Where(j => (j.Value.JoinType & eJoinType.Serial) == eJoinType.Serial).ToDictionary(j => j.Key, j => j.Value);
|
var serials = Joins.Where(j => (j.Value.JoinType & eJoinType.Serial) == eJoinType.Serial).ToDictionary(j => j.Key, j => j.Value);
|
||||||
Debug.Console(2, "Found {0} Serial Joins", serials.Count);
|
CrestronConsole.ConsoleCommandResponse("Found {0} Serial Joins", serials.Count);
|
||||||
PrintJoinList(GetSortedJoins(serials));
|
PrintJoinList(GetSortedJoins(serials));
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -141,7 +139,7 @@ namespace PepperDash.Essentials.Core
|
|||||||
{
|
{
|
||||||
foreach (var join in joins)
|
foreach (var join in joins)
|
||||||
{
|
{
|
||||||
Debug.Console(0,
|
CrestronConsole.ConsoleCommandResponse(
|
||||||
@"Join Number: {0} | Label: '{1}' | JoinSpan: '{2}' | Type: '{3}' | Capabilities: '{4}'",
|
@"Join Number: {0} | Label: '{1}' | JoinSpan: '{2}' | Type: '{3}' | Capabilities: '{4}'",
|
||||||
join.Value.JoinNumber,
|
join.Value.JoinNumber,
|
||||||
join.Value.Label,
|
join.Value.Label,
|
||||||
@@ -236,25 +234,45 @@ namespace PepperDash.Essentials.Core
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public void PrintJoinMapInfo()
|
public void PrintJoinMapInfo()
|
||||||
{
|
{
|
||||||
Debug.Console(0, "{0}:\n", GetType().Name);
|
var sb = JoinmapStringBuilder();
|
||||||
|
|
||||||
|
CrestronConsole.ConsoleCommandResponse(sb.ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
private StringBuilder JoinmapStringBuilder()
|
||||||
|
{
|
||||||
|
var sb = new StringBuilder();
|
||||||
|
|
||||||
// Get the joins of each type and print them
|
// Get the joins of each type and print them
|
||||||
Debug.Console(0, "Digitals:");
|
sb.AppendLine(String.Format("# {0}", GetType().Name));
|
||||||
var digitals = Joins.Where(j => (j.Value.Metadata.JoinType & eJoinType.Digital) == eJoinType.Digital).ToDictionary(j => j.Key, j => j.Value);
|
sb.AppendLine();
|
||||||
Debug.Console(2, "Found {0} Digital Joins", digitals.Count);
|
sb.AppendLine("## Digitals");
|
||||||
PrintJoinList(GetSortedJoins(digitals));
|
sb.AppendLine();
|
||||||
|
// Get the joins of each type and print them
|
||||||
|
var digitals =
|
||||||
|
Joins.Where(j => (j.Value.Metadata.JoinType & eJoinType.Digital) == eJoinType.Digital)
|
||||||
|
.ToDictionary(j => j.Key, j => j.Value);
|
||||||
|
var digitalSb = AppendJoinList(GetSortedJoins(digitals));
|
||||||
|
digitalSb.AppendLine("## Analogs");
|
||||||
|
digitalSb.AppendLine();
|
||||||
|
|
||||||
Debug.Console(0, "Analogs:");
|
var analogs =
|
||||||
var analogs = Joins.Where(j => (j.Value.Metadata.JoinType & eJoinType.Analog) == eJoinType.Analog).ToDictionary(j => j.Key, j => j.Value);
|
Joins.Where(j => (j.Value.Metadata.JoinType & eJoinType.Analog) == eJoinType.Analog)
|
||||||
Debug.Console(2, "Found {0} Analog Joins", analogs.Count);
|
.ToDictionary(j => j.Key, j => j.Value);
|
||||||
PrintJoinList(GetSortedJoins(analogs));
|
var analogSb = AppendJoinList(GetSortedJoins(analogs));
|
||||||
|
analogSb.AppendLine("## Serials");
|
||||||
|
analogSb.AppendLine();
|
||||||
|
|
||||||
Debug.Console(0, "Serials:");
|
var serials =
|
||||||
var serials = Joins.Where(j => (j.Value.Metadata.JoinType & eJoinType.Serial) == eJoinType.Serial).ToDictionary(j => j.Key, j => j.Value);
|
Joins.Where(j => (j.Value.Metadata.JoinType & eJoinType.Serial) == eJoinType.Serial)
|
||||||
Debug.Console(2, "Found {0} Serial Joins", serials.Count);
|
.ToDictionary(j => j.Key, j => j.Value);
|
||||||
PrintJoinList(GetSortedJoins(serials));
|
var serialSb = AppendJoinList(GetSortedJoins(serials));
|
||||||
|
|
||||||
|
sb.EnsureCapacity(sb.Length + digitalSb.Length + analogSb.Length + serialSb.Length);
|
||||||
|
sb.Append(digitalSb).Append(analogSb).Append(serialSb);
|
||||||
|
return sb;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Prints the join information to console
|
/// Prints the join information to console
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -262,37 +280,11 @@ namespace PepperDash.Essentials.Core
|
|||||||
{
|
{
|
||||||
var pluginType = GetType().Name;
|
var pluginType = GetType().Name;
|
||||||
|
|
||||||
Debug.Console(0, "{0}:\n", pluginType);
|
CrestronConsole.ConsoleCommandResponse("{0}:\n", pluginType);
|
||||||
|
|
||||||
var sb = new StringBuilder();
|
|
||||||
|
|
||||||
sb.AppendLine(String.Format("# {0}", GetType().Name));
|
|
||||||
sb.AppendLine(String.Format("Generated from '{0}' on bridge '{1}'", deviceKey, bridgeKey));
|
|
||||||
sb.AppendLine();
|
|
||||||
sb.AppendLine("## Digitals");
|
|
||||||
// Get the joins of each type and print them
|
|
||||||
var digitals = Joins.Where(j => (j.Value.Metadata.JoinType & eJoinType.Digital) == eJoinType.Digital).ToDictionary(j => j.Key, j => j.Value);
|
|
||||||
Debug.Console(2, "Found {0} Digital Joins", digitals.Count);
|
|
||||||
var digitalSb = AppendJoinList(GetSortedJoins(digitals));
|
|
||||||
digitalSb.AppendLine("## Analogs");
|
|
||||||
digitalSb.AppendLine();
|
|
||||||
|
|
||||||
Debug.Console(0, "Analogs:");
|
WriteJoinmapMarkdown(JoinmapStringBuilder(), pluginType, bridgeKey, deviceKey);
|
||||||
var analogs = Joins.Where(j => (j.Value.Metadata.JoinType & eJoinType.Analog) == eJoinType.Analog).ToDictionary(j => j.Key, j => j.Value);
|
|
||||||
Debug.Console(2, "Found {0} Analog Joins", analogs.Count);
|
|
||||||
var analogSb = AppendJoinList(GetSortedJoins(analogs));
|
|
||||||
analogSb.AppendLine("## Serials");
|
|
||||||
analogSb.AppendLine();
|
|
||||||
|
|
||||||
Debug.Console(0, "Serials:");
|
|
||||||
var serials = Joins.Where(j => (j.Value.Metadata.JoinType & eJoinType.Serial) == eJoinType.Serial).ToDictionary(j => j.Key, j => j.Value);
|
|
||||||
Debug.Console(2, "Found {0} Serial Joins", serials.Count);
|
|
||||||
var serialSb = AppendJoinList(GetSortedJoins(serials));
|
|
||||||
|
|
||||||
sb.EnsureCapacity(sb.Length + digitalSb.Length + analogSb.Length + serialSb.Length);
|
|
||||||
sb.Append(digitalSb).Append(analogSb).Append(serialSb);
|
|
||||||
|
|
||||||
WriteJoinmapMarkdown(sb, pluginType, bridgeKey, deviceKey);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -303,7 +295,7 @@ namespace PepperDash.Essentials.Core
|
|||||||
using (var sw = new StreamWriter(fileName))
|
using (var sw = new StreamWriter(fileName))
|
||||||
{
|
{
|
||||||
sw.WriteLine(stringBuilder.ToString());
|
sw.WriteLine(stringBuilder.ToString());
|
||||||
Debug.Console(0, "Joinmap Readme generated and written to {0}", fileName);
|
CrestronConsole.ConsoleCommandResponse("Joinmap Readme generated and written to {0}", fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -313,7 +305,7 @@ namespace PepperDash.Essentials.Core
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="joins"></param>
|
/// <param name="joins"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
List<KeyValuePair<string, JoinDataComplete>> GetSortedJoins(Dictionary<string, JoinDataComplete> joins)
|
static List<KeyValuePair<string, JoinDataComplete>> GetSortedJoins(Dictionary<string, JoinDataComplete> joins)
|
||||||
{
|
{
|
||||||
var sortedJoins = joins.ToList();
|
var sortedJoins = joins.ToList();
|
||||||
|
|
||||||
@@ -322,20 +314,6 @@ namespace PepperDash.Essentials.Core
|
|||||||
return sortedJoins;
|
return sortedJoins;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PrintJoinList(List<KeyValuePair<string, JoinDataComplete>> joins)
|
|
||||||
{
|
|
||||||
foreach (var join in joins)
|
|
||||||
{
|
|
||||||
Debug.Console(0,
|
|
||||||
@"Join Number: {0} | JoinSpan: '{1}' | JoinName: {2} | Description: '{3}' | Type: '{4}' | Capabilities: '{5}'",
|
|
||||||
join.Value.JoinNumber,
|
|
||||||
join.Value.JoinSpan,
|
|
||||||
join.Key,
|
|
||||||
String.IsNullOrEmpty(join.Value.AttributeName) ? join.Value.Metadata.Label : join.Value.AttributeName,
|
|
||||||
join.Value.Metadata.JoinType.ToString(),
|
|
||||||
join.Value.Metadata.JoinCapabilities.ToString());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static StringBuilder AppendJoinList(List<KeyValuePair<string, JoinDataComplete>> joins)
|
static StringBuilder AppendJoinList(List<KeyValuePair<string, JoinDataComplete>> joins)
|
||||||
{
|
{
|
||||||
@@ -579,7 +557,7 @@ namespace PepperDash.Essentials.Core
|
|||||||
var errorKey = string.Empty;
|
var errorKey = string.Empty;
|
||||||
foreach (var item in dataArray)
|
foreach (var item in dataArray)
|
||||||
{
|
{
|
||||||
if (item.Value.TrimEnd() == placeholder) ;
|
if (item.Value.TrimEnd() == placeholder) continue;
|
||||||
errorKey = item.Key;
|
errorKey = item.Key;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,7 +43,20 @@ namespace PepperDash.Essentials.Core.Monitoring
|
|||||||
public StringFeedback UptimeFeedback { get; set; }
|
public StringFeedback UptimeFeedback { get; set; }
|
||||||
public StringFeedback LastStartFeedback { get; set; }
|
public StringFeedback LastStartFeedback { get; set; }
|
||||||
|
|
||||||
public SystemMonitorController(string key)
|
public BoolFeedback IsApplianceFeedback { get; protected set; }
|
||||||
|
private bool _isApplianceFb
|
||||||
|
{
|
||||||
|
get { return CrestronEnvironment.DevicePlatform == eDevicePlatform.Appliance; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public BoolFeedback IsServerFeedback { get; protected set; }
|
||||||
|
private bool _isServerFb
|
||||||
|
{
|
||||||
|
get { return CrestronEnvironment.DevicePlatform == eDevicePlatform.Server; }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public SystemMonitorController(string key)
|
||||||
: base(key)
|
: base(key)
|
||||||
{
|
{
|
||||||
Debug.Console(2, this, "Adding SystemMonitorController.");
|
Debug.Console(2, this, "Adding SystemMonitorController.");
|
||||||
@@ -63,6 +76,9 @@ namespace PepperDash.Essentials.Core.Monitoring
|
|||||||
UptimeFeedback = new StringFeedback(() => _uptime);
|
UptimeFeedback = new StringFeedback(() => _uptime);
|
||||||
LastStartFeedback = new StringFeedback(()=> _lastStart);
|
LastStartFeedback = new StringFeedback(()=> _lastStart);
|
||||||
|
|
||||||
|
IsApplianceFeedback = new BoolFeedback(() => _isApplianceFb);
|
||||||
|
IsServerFeedback = new BoolFeedback(() => _isServerFb);
|
||||||
|
|
||||||
ProgramStatusFeedbackCollection = new Dictionary<uint, ProgramStatusFeedbacks>();
|
ProgramStatusFeedbackCollection = new Dictionary<uint, ProgramStatusFeedbacks>();
|
||||||
|
|
||||||
foreach (var prog in SystemMonitor.ProgramCollection)
|
foreach (var prog in SystemMonitor.ProgramCollection)
|
||||||
@@ -123,6 +139,26 @@ namespace PepperDash.Essentials.Core.Monitoring
|
|||||||
_uptime = uptimeRaw.Substring(forIndex + 4);
|
_uptime = uptimeRaw.Substring(forIndex + 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void ProcessorReboot()
|
||||||
|
{
|
||||||
|
if (CrestronEnvironment.DevicePlatform == eDevicePlatform.Server) return;
|
||||||
|
|
||||||
|
var response = string.Empty;
|
||||||
|
CrestronConsole.SendControlSystemCommand("reboot", ref response);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void ProgramReset(uint index)
|
||||||
|
{
|
||||||
|
if (CrestronEnvironment.DevicePlatform == eDevicePlatform.Server) return;
|
||||||
|
|
||||||
|
if (index <= 0 || index > 10) return;
|
||||||
|
|
||||||
|
var cmd = string.Format("progreset -p:{0}", index);
|
||||||
|
|
||||||
|
var response = string.Empty;
|
||||||
|
CrestronConsole.SendControlSystemCommand(cmd, ref response);
|
||||||
|
}
|
||||||
|
|
||||||
private void CrestronEnvironmentOnEthernetEventHandler(EthernetEventArgs ethernetEventArgs)
|
private void CrestronEnvironmentOnEthernetEventHandler(EthernetEventArgs ethernetEventArgs)
|
||||||
{
|
{
|
||||||
if (ethernetEventArgs.EthernetEventType != eEthernetEventType.LinkUp) return;
|
if (ethernetEventArgs.EthernetEventType != eEthernetEventType.LinkUp) return;
|
||||||
@@ -185,6 +221,9 @@ namespace PepperDash.Essentials.Core.Monitoring
|
|||||||
SerialNumberFeedback.FireUpdate();
|
SerialNumberFeedback.FireUpdate();
|
||||||
ModelFeedback.FireUpdate();
|
ModelFeedback.FireUpdate();
|
||||||
|
|
||||||
|
IsApplianceFeedback.FireUpdate();
|
||||||
|
IsServerFeedback.FireUpdate();
|
||||||
|
|
||||||
OnSystemMonitorPropertiesChanged();
|
OnSystemMonitorPropertiesChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -237,6 +276,11 @@ namespace PepperDash.Essentials.Core.Monitoring
|
|||||||
UptimeFeedback.LinkInputSig(trilist.StringInput[joinMap.Uptime.JoinNumber]);
|
UptimeFeedback.LinkInputSig(trilist.StringInput[joinMap.Uptime.JoinNumber]);
|
||||||
LastStartFeedback.LinkInputSig(trilist.StringInput[joinMap.LastBoot.JoinNumber]);
|
LastStartFeedback.LinkInputSig(trilist.StringInput[joinMap.LastBoot.JoinNumber]);
|
||||||
|
|
||||||
|
trilist.SetSigHeldAction(joinMap.ProcessorReboot.JoinNumber, 10000, ProcessorReboot);
|
||||||
|
|
||||||
|
IsApplianceFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IsAppliance.JoinNumber]);
|
||||||
|
IsServerFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IsServer.JoinNumber]);
|
||||||
|
|
||||||
// iterate the program status feedback collection and map all the joins
|
// iterate the program status feedback collection and map all the joins
|
||||||
LinkProgramInfoJoins(this, trilist, joinMap);
|
LinkProgramInfoJoins(this, trilist, joinMap);
|
||||||
|
|
||||||
@@ -301,11 +345,13 @@ namespace PepperDash.Essentials.Core.Monitoring
|
|||||||
p.Value.AggregatedProgramInfoFeedback.LinkInputSig(
|
p.Value.AggregatedProgramInfoFeedback.LinkInputSig(
|
||||||
trilist.StringInput[programSlotJoinStart + joinMap.AggregatedProgramInfo.JoinNumber]);
|
trilist.StringInput[programSlotJoinStart + joinMap.AggregatedProgramInfo.JoinNumber]);
|
||||||
|
|
||||||
|
trilist.SetSigHeldAction(programSlotJoinStart + joinMap.ProgramReset.JoinNumber, 10000, () => ProgramReset(programNumber));
|
||||||
|
|
||||||
programSlotJoinStart = programSlotJoinStart + joinMap.ProgramOffsetJoin.JoinSpan;
|
programSlotJoinStart = programSlotJoinStart + joinMap.ProgramOffsetJoin.JoinSpan;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//// Sets the time zone
|
//// Sets the time zone
|
||||||
//public void SetTimeZone(int timeZone)
|
//public void SetTimeZone(int timeZone)
|
||||||
//{
|
//{
|
||||||
// SystemMonitor.TimeZoneInformation.TimeZoneNumber = timeZone;
|
// SystemMonitor.TimeZoneInformation.TimeZoneNumber = timeZone;
|
||||||
|
|||||||
@@ -92,6 +92,10 @@
|
|||||||
<HintPath>..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpCustomAttributesInterface.dll</HintPath>
|
<HintPath>..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpCustomAttributesInterface.dll</HintPath>
|
||||||
<Private>False</Private>
|
<Private>False</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
<Reference Include="SimplSharpCWSHelperInterface, Version=2.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||||
|
<SpecificVersion>False</SpecificVersion>
|
||||||
|
<HintPath>..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpCWSHelperInterface.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
<Reference Include="SimplSharpHelperInterface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
<Reference Include="SimplSharpHelperInterface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||||
<SpecificVersion>False</SpecificVersion>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
<HintPath>..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpHelperInterface.dll</HintPath>
|
<HintPath>..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpHelperInterface.dll</HintPath>
|
||||||
@@ -196,6 +200,24 @@
|
|||||||
<Compile Include="Crestron IO\Relay\GenericRelayDevice.cs" />
|
<Compile Include="Crestron IO\Relay\GenericRelayDevice.cs" />
|
||||||
<Compile Include="Crestron IO\Relay\ISwitchedOutput.cs" />
|
<Compile Include="Crestron IO\Relay\ISwitchedOutput.cs" />
|
||||||
<Compile Include="Crestron IO\StatusSign\StatusSignController.cs" />
|
<Compile Include="Crestron IO\StatusSign\StatusSignController.cs" />
|
||||||
|
<Compile Include="Web\RequestHandlers\AppDebugRequestHandler.cs" />
|
||||||
|
<Compile Include="Web\RequestHandlers\GetFeedbacksForDeviceRequestHandler.cs" />
|
||||||
|
<Compile Include="Web\EssentialsWebApiHelpers.cs" />
|
||||||
|
<Compile Include="Web\RequestHandlers\GetTypesByFilterRequestHandler.cs" />
|
||||||
|
<Compile Include="Web\RequestHandlers\GetJoinMapForDeviceKeyRequestHandler.cs" />
|
||||||
|
<Compile Include="Web\RequestHandlers\DefaultRequestHandler.cs" />
|
||||||
|
<Compile Include="Web\RequestHandlers\DevListRequestHandler.cs" />
|
||||||
|
<Compile Include="Web\RequestHandlers\DevPropsRequestHandler.cs" />
|
||||||
|
<Compile Include="Web\RequestHandlers\DevJsonRequestHandler.cs" />
|
||||||
|
<Compile Include="Web\RequestHandlers\SetDeviceStreamDebugRequestHandler.cs" />
|
||||||
|
<Compile Include="Web\RequestHandlers\DisableAllStreamDebugRequestHandler.cs" />
|
||||||
|
<Compile Include="Web\RequestHandlers\ShowConfigRequestHandler.cs" />
|
||||||
|
<Compile Include="Web\RequestHandlers\GetTypesRequestHandler.cs" />
|
||||||
|
<Compile Include="Web\RequestHandlers\GetJoinMapForBridgeKeyRequestHandler.cs" />
|
||||||
|
<Compile Include="Web\EssemtialsWebApi.cs" />
|
||||||
|
<Compile Include="Web\EssentialsWebApiFactory.cs" />
|
||||||
|
<Compile Include="Web\EssentialsWebApiPropertiesConfig.cs" />
|
||||||
|
<Compile Include="Web\RequestHandlers\ReportVersionsRequestHandler.cs" />
|
||||||
<Compile Include="Device Info\DeviceInfo.cs" />
|
<Compile Include="Device Info\DeviceInfo.cs" />
|
||||||
<Compile Include="Device Info\DeviceInfoEventArgs.cs" />
|
<Compile Include="Device Info\DeviceInfoEventArgs.cs" />
|
||||||
<Compile Include="Device Info\IDeviceInfoProvider.cs" />
|
<Compile Include="Device Info\IDeviceInfoProvider.cs" />
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
|
||||||
|
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=Crestron_0020Web_0020Server/@EntryIndexedValue">True</s:Boolean>
|
||||||
|
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=Web/@EntryIndexedValue">False</s:Boolean></wpf:ResourceDictionary>
|
||||||
@@ -194,10 +194,11 @@ namespace PepperDash.Essentials
|
|||||||
/// <param name="command"></param>
|
/// <param name="command"></param>
|
||||||
public static void ReportAssemblyVersions(string command)
|
public static void ReportAssemblyVersions(string command)
|
||||||
{
|
{
|
||||||
Debug.Console(0, "Loaded Assemblies:");
|
|
||||||
|
CrestronConsole.ConsoleCommandResponse("Loaded Assemblies:");
|
||||||
foreach (var assembly in LoadedAssemblies)
|
foreach (var assembly in LoadedAssemblies)
|
||||||
{
|
{
|
||||||
Debug.Console(0, "{0} Version: {1}", assembly.Name, assembly.Version);
|
CrestronConsole.ConsoleCommandResponse("{0} Version: {1}", assembly.Name, assembly.Version);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,224 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using Crestron.SimplSharp;
|
||||||
|
using Crestron.SimplSharp.WebScripting;
|
||||||
|
using PepperDash.Core;
|
||||||
|
using PepperDash.Core.Web;
|
||||||
|
using PepperDash.Essentials.Core.Web.RequestHandlers;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Core.Web
|
||||||
|
{
|
||||||
|
public class EssemtialsWebApi : EssentialsDevice
|
||||||
|
{
|
||||||
|
private readonly WebApiServer _server;
|
||||||
|
|
||||||
|
///<example>
|
||||||
|
/// http(s)://{ipaddress}/cws/{basePath}
|
||||||
|
/// http(s)://{ipaddress}/VirtualControl/Rooms/{roomId}/cws/{basePath}
|
||||||
|
/// </example>
|
||||||
|
private readonly string _defaultBasePath = CrestronEnvironment.DevicePlatform == eDevicePlatform.Appliance
|
||||||
|
? string.Format("/app{0:00}/api", InitialParametersClass.ApplicationNumber)
|
||||||
|
: "/api";
|
||||||
|
|
||||||
|
private const int DebugTrace = 0;
|
||||||
|
private const int DebugInfo = 1;
|
||||||
|
private const int DebugVerbose = 2;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// CWS base path
|
||||||
|
/// </summary>
|
||||||
|
public string BasePath { get; private set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Tracks if CWS is registered
|
||||||
|
/// </summary>
|
||||||
|
public bool IsRegistered
|
||||||
|
{
|
||||||
|
get { return _server.IsRegistered; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Constructor
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="key"></param>
|
||||||
|
/// <param name="name"></param>
|
||||||
|
public EssemtialsWebApi(string key, string name)
|
||||||
|
: this(key, name, null)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Constructor
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="key"></param>
|
||||||
|
/// <param name="name"></param>
|
||||||
|
/// <param name="config"></param>
|
||||||
|
public EssemtialsWebApi(string key, string name, EssentialsWebApiPropertiesConfig config)
|
||||||
|
: base(key, name)
|
||||||
|
{
|
||||||
|
Key = key;
|
||||||
|
|
||||||
|
if (config == null)
|
||||||
|
BasePath = _defaultBasePath;
|
||||||
|
else
|
||||||
|
BasePath = string.IsNullOrEmpty(config.BasePath) ? _defaultBasePath : config.BasePath;
|
||||||
|
|
||||||
|
_server = new WebApiServer(Key, Name, BasePath);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Custom activate, add routes
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public override bool CustomActivate()
|
||||||
|
{
|
||||||
|
var routes = new List<HttpCwsRoute>
|
||||||
|
{
|
||||||
|
new HttpCwsRoute("reportversions")
|
||||||
|
{
|
||||||
|
Name = "ReportVersions",
|
||||||
|
RouteHandler = new ReportVersionsRequestHandler()
|
||||||
|
},
|
||||||
|
new HttpCwsRoute("appdebug")
|
||||||
|
{
|
||||||
|
Name = "AppDebug",
|
||||||
|
RouteHandler = new AppDebugRequestHandler()
|
||||||
|
},
|
||||||
|
new HttpCwsRoute("devlist")
|
||||||
|
{
|
||||||
|
Name = "DevList",
|
||||||
|
RouteHandler = new DevListRequestHandler()
|
||||||
|
},
|
||||||
|
new HttpCwsRoute("devprops")
|
||||||
|
{
|
||||||
|
Name = "DevProps",
|
||||||
|
RouteHandler = new DevPropsRequestHandler()
|
||||||
|
},
|
||||||
|
new HttpCwsRoute("devjson")
|
||||||
|
{
|
||||||
|
Name = "DevJson",
|
||||||
|
RouteHandler = new DevJsonRequestHandler()
|
||||||
|
},
|
||||||
|
new HttpCwsRoute("setdevicestreamdebug")
|
||||||
|
{
|
||||||
|
Name = "SetDeviceStreamDebug",
|
||||||
|
RouteHandler = new SetDeviceStreamDebugRequestHandler()
|
||||||
|
},
|
||||||
|
new HttpCwsRoute("disableallstreamdebug")
|
||||||
|
{
|
||||||
|
Name = "DisableAllStreamDebug",
|
||||||
|
RouteHandler = new DisableAllStreamDebugRequestHandler()
|
||||||
|
},
|
||||||
|
new HttpCwsRoute("showconfig")
|
||||||
|
{
|
||||||
|
Name = "ShowConfig",
|
||||||
|
RouteHandler = new ShowConfigRequestHandler()
|
||||||
|
},
|
||||||
|
new HttpCwsRoute("gettypes")
|
||||||
|
{
|
||||||
|
Name = "GetTypes",
|
||||||
|
RouteHandler = new GetTypesRequestHandler()
|
||||||
|
},
|
||||||
|
new HttpCwsRoute("gettypes/{filter}")
|
||||||
|
{
|
||||||
|
Name = "GetTypesByFilter",
|
||||||
|
RouteHandler = new GetTypesByFilterRequestHandler()
|
||||||
|
},
|
||||||
|
new HttpCwsRoute("getjoinmap/{bridgeKey}")
|
||||||
|
{
|
||||||
|
Name = "GetJoinMapsForBridgeKey",
|
||||||
|
RouteHandler = new GetJoinMapForBridgeKeyRequestHandler()
|
||||||
|
},
|
||||||
|
new HttpCwsRoute("getjoinmap/{bridgeKey}/{deviceKey}")
|
||||||
|
{
|
||||||
|
Name = "GetJoinMapsForDeviceKey",
|
||||||
|
RouteHandler = new GetJoinMapForDeviceKeyRequestHandler()
|
||||||
|
},
|
||||||
|
new HttpCwsRoute("feedbacks/{deviceKey}")
|
||||||
|
{
|
||||||
|
Name = "GetFeedbacksForDeviceKey",
|
||||||
|
RouteHandler = new GetFeedbacksForDeviceRequestHandler()
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
foreach (var route in routes.Where(route => route != null))
|
||||||
|
{
|
||||||
|
var r = route;
|
||||||
|
_server.AddRoute(r);
|
||||||
|
}
|
||||||
|
|
||||||
|
return base.CustomActivate();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes the CWS class
|
||||||
|
/// </summary>
|
||||||
|
public override void Initialize()
|
||||||
|
{
|
||||||
|
// If running on an appliance
|
||||||
|
if (CrestronEnvironment.DevicePlatform == eDevicePlatform.Appliance)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
WEBSERVER [ON | OFF | TIMEOUT <VALUE IN SECONDS> | MAXSESSIONSPERUSER <Number of sessions>]
|
||||||
|
*/
|
||||||
|
var response = string.Empty;
|
||||||
|
CrestronConsole.SendControlSystemCommand("webserver", ref response);
|
||||||
|
if (response.Contains("OFF")) return;
|
||||||
|
|
||||||
|
var is4Series = eCrestronSeries.Series4 == (Global.ProcessorSeries & eCrestronSeries.Series4);
|
||||||
|
Debug.Console(DebugTrace, Debug.ErrorLogLevel.Notice, "Starting Essentials Web API on {0} Appliance", is4Series ? "4-series" : "3-series");
|
||||||
|
|
||||||
|
_server.Start();
|
||||||
|
|
||||||
|
GetPaths();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Automatically start CWS when running on a server (Linux OS, Virtual Control)
|
||||||
|
Debug.Console(DebugTrace, Debug.ErrorLogLevel.Notice, "Starting Essentials Web API on Virtual Control Server");
|
||||||
|
|
||||||
|
_server.Start();
|
||||||
|
|
||||||
|
GetPaths();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Print the available pahts
|
||||||
|
/// </summary>
|
||||||
|
/// <example>
|
||||||
|
/// http(s)://{ipaddress}/cws/{basePath}
|
||||||
|
/// http(s)://{ipaddress}/VirtualControl/Rooms/{roomId}/cws/{basePath}
|
||||||
|
/// </example>
|
||||||
|
public void GetPaths()
|
||||||
|
{
|
||||||
|
Debug.Console(DebugTrace, this, "{0}", new String('-', 50));
|
||||||
|
|
||||||
|
var currentIp = CrestronEthernetHelper.GetEthernetParameter(
|
||||||
|
CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_CURRENT_IP_ADDRESS, 0);
|
||||||
|
|
||||||
|
var hostname = CrestronEthernetHelper.GetEthernetParameter(
|
||||||
|
CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_HOSTNAME, 0);
|
||||||
|
|
||||||
|
var path = CrestronEnvironment.DevicePlatform == eDevicePlatform.Server
|
||||||
|
? string.Format("http(s)://{0}/VirtualControl/Rooms/{1}/cws{2}", hostname, InitialParametersClass.RoomId, BasePath)
|
||||||
|
: string.Format("http(s)://{0}/cws{1}", currentIp, BasePath);
|
||||||
|
|
||||||
|
Debug.Console(DebugTrace, this, "Server:{0}", path);
|
||||||
|
|
||||||
|
var routeCollection = _server.GetRouteCollection();
|
||||||
|
if (routeCollection == null)
|
||||||
|
{
|
||||||
|
Debug.Console(DebugTrace, this, "Server route collection is null");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Debug.Console(DebugTrace, this, "Configured Routes:");
|
||||||
|
foreach (var route in routeCollection)
|
||||||
|
{
|
||||||
|
Debug.Console(DebugTrace, this, "{0}: {1}/{2}", route.Name, path, route.Url);
|
||||||
|
}
|
||||||
|
Debug.Console(DebugTrace, this, "{0}", new String('-', 50));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
using PepperDash.Core;
|
||||||
|
using PepperDash.Essentials.Core.Config;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Core.Web
|
||||||
|
{
|
||||||
|
public class EssentialsWebApiFactory : EssentialsDeviceFactory<EssemtialsWebApi>
|
||||||
|
{
|
||||||
|
public EssentialsWebApiFactory()
|
||||||
|
{
|
||||||
|
TypeNames = new List<string> { "EssentialsWebApi" };
|
||||||
|
}
|
||||||
|
|
||||||
|
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||||
|
{
|
||||||
|
Debug.Console(1, "Factory Attempting to create new Essentials Web API Server");
|
||||||
|
|
||||||
|
var props = dc.Properties.ToObject<EssentialsWebApiPropertiesConfig>();
|
||||||
|
if (props != null) return new EssemtialsWebApi(dc.Key, dc.Name, props);
|
||||||
|
|
||||||
|
Debug.Console(1, "Factory failed to create new Essentials Web API Server");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,87 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using Crestron.SimplSharp.WebScripting;
|
||||||
|
using PepperDash.Core;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Core.Web
|
||||||
|
{
|
||||||
|
public class EssentialsWebApiHelpers
|
||||||
|
{
|
||||||
|
public static string GetRequestBody(HttpCwsRequest request)
|
||||||
|
{
|
||||||
|
var bytes = new Byte[request.ContentLength];
|
||||||
|
|
||||||
|
request.InputStream.Read(bytes, 0, request.ContentLength);
|
||||||
|
|
||||||
|
return Encoding.UTF8.GetString(bytes, 0, bytes.Length);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static object MapToAssemblyObject(LoadedAssembly assembly)
|
||||||
|
{
|
||||||
|
return new
|
||||||
|
{
|
||||||
|
Name = assembly.Name,
|
||||||
|
Version = assembly.Version
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
public static object MapToDeviceListObject(IKeyed device)
|
||||||
|
{
|
||||||
|
return new
|
||||||
|
{
|
||||||
|
Key = device.Key,
|
||||||
|
Name = (device is IKeyName)
|
||||||
|
? (device as IKeyName).Name
|
||||||
|
: "---"
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
public static object MapJoinToObject(string key, JoinMapBaseAdvanced join)
|
||||||
|
{
|
||||||
|
var kp = new KeyValuePair<string, JoinMapBaseAdvanced>(key, join);
|
||||||
|
|
||||||
|
return MapJoinToObject(kp);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static object MapJoinToObject(KeyValuePair<string, JoinMapBaseAdvanced> join)
|
||||||
|
{
|
||||||
|
return new
|
||||||
|
{
|
||||||
|
DeviceKey = join.Key,
|
||||||
|
Joins = join.Value.Joins.Select(j => MapJoinDataCompleteToObject(j))
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
public static object MapJoinDataCompleteToObject(KeyValuePair<string, JoinDataComplete> joinData)
|
||||||
|
{
|
||||||
|
return new
|
||||||
|
{
|
||||||
|
Signal = joinData.Key,
|
||||||
|
Description = joinData.Value.Metadata.Description,
|
||||||
|
JoinNumber = joinData.Value.JoinNumber,
|
||||||
|
JoinSpan = joinData.Value.JoinSpan,
|
||||||
|
JoinType = joinData.Value.Metadata.JoinType.ToString(),
|
||||||
|
JoinCapabilities = joinData.Value.Metadata.JoinCapabilities.ToString()
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
public static object MapDeviceTypeToObject(string key, DeviceFactoryWrapper device)
|
||||||
|
{
|
||||||
|
var kp = new KeyValuePair<string, DeviceFactoryWrapper>(key, device);
|
||||||
|
|
||||||
|
return MapDeviceTypeToObject(kp);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static object MapDeviceTypeToObject(KeyValuePair<string, DeviceFactoryWrapper> device)
|
||||||
|
{
|
||||||
|
return new
|
||||||
|
{
|
||||||
|
Type = device.Key,
|
||||||
|
Description = device.Value.Description,
|
||||||
|
CType = device.Value.CType == null ? "---": device.Value.CType.ToString()
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Core.Web
|
||||||
|
{
|
||||||
|
public class EssentialsWebApiPropertiesConfig
|
||||||
|
{
|
||||||
|
[JsonProperty("basePath")]
|
||||||
|
public string BasePath { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,82 @@
|
|||||||
|
using Crestron.SimplSharp.WebScripting;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using PepperDash.Core;
|
||||||
|
using PepperDash.Core.Web.RequestHandlers;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Core.Web.RequestHandlers
|
||||||
|
{
|
||||||
|
public class AppDebugRequestHandler : WebApiBaseRequestHandler
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Constructor
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// base(true) enables CORS support by default
|
||||||
|
/// </remarks>
|
||||||
|
public AppDebugRequestHandler()
|
||||||
|
: base(true)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Handles GET method requests
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="context"></param>
|
||||||
|
protected override void HandleGet(HttpCwsContext context)
|
||||||
|
{
|
||||||
|
var appDebug = new AppDebug { Level = Debug.Level };
|
||||||
|
|
||||||
|
var body = JsonConvert.SerializeObject(appDebug, Formatting.Indented);
|
||||||
|
|
||||||
|
context.Response.StatusCode = 200;
|
||||||
|
context.Response.StatusDescription = "OK";
|
||||||
|
context.Response.Write(body, false);
|
||||||
|
context.Response.End();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Handles POST method requests
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="context"></param>
|
||||||
|
protected override void HandlePost(HttpCwsContext context)
|
||||||
|
{
|
||||||
|
if (context.Request.ContentLength < 0)
|
||||||
|
{
|
||||||
|
context.Response.StatusCode = 400;
|
||||||
|
context.Response.StatusDescription = "Bad Request";
|
||||||
|
context.Response.End();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var data = EssentialsWebApiHelpers.GetRequestBody(context.Request);
|
||||||
|
if (string.IsNullOrEmpty(data))
|
||||||
|
{
|
||||||
|
context.Response.StatusCode = 400;
|
||||||
|
context.Response.StatusDescription = "Bad Request";
|
||||||
|
context.Response.End();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var appDebug = new AppDebug();
|
||||||
|
var requestBody = JsonConvert.DeserializeAnonymousType(data, appDebug);
|
||||||
|
|
||||||
|
Debug.SetDebugLevel(requestBody.Level);
|
||||||
|
|
||||||
|
appDebug.Level = Debug.Level;
|
||||||
|
var responseBody = JsonConvert.SerializeObject(appDebug, Formatting.Indented);
|
||||||
|
|
||||||
|
context.Response.StatusCode = 200;
|
||||||
|
context.Response.StatusDescription = "OK";
|
||||||
|
context.Response.Write(responseBody, false);
|
||||||
|
context.Response.End();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class AppDebug
|
||||||
|
{
|
||||||
|
[JsonProperty("level", NullValueHandling = NullValueHandling.Ignore)]
|
||||||
|
public int Level { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,118 @@
|
|||||||
|
using Crestron.SimplSharp.WebScripting;
|
||||||
|
using PepperDash.Core.Web.RequestHandlers;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Core.Web.RequestHandlers
|
||||||
|
{
|
||||||
|
public class DefaultRequestHandler : WebApiBaseRequestHandler
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Constructor
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// base(true) enables CORS support by default
|
||||||
|
/// </remarks>
|
||||||
|
public DefaultRequestHandler()
|
||||||
|
: base(true)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Handles CONNECT method requests
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="context"></param>
|
||||||
|
protected override void HandleConnect(HttpCwsContext context)
|
||||||
|
{
|
||||||
|
context.Response.StatusCode = 418;
|
||||||
|
context.Response.StatusDescription = "I'm a teapot";
|
||||||
|
context.Response.End();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Handles DELETE method requests
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="context"></param>
|
||||||
|
protected override void HandleDelete(HttpCwsContext context)
|
||||||
|
{
|
||||||
|
context.Response.StatusCode = 418;
|
||||||
|
context.Response.StatusDescription = "I'm a teapot";
|
||||||
|
context.Response.End();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Handles GET method requests
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="context"></param>
|
||||||
|
protected override void HandleGet(HttpCwsContext context)
|
||||||
|
{
|
||||||
|
context.Response.StatusCode = 418;
|
||||||
|
context.Response.StatusDescription = "I'm a teapot";
|
||||||
|
context.Response.End();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Handles HEAD method requests
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="context"></param>
|
||||||
|
protected override void HandleHead(HttpCwsContext context)
|
||||||
|
{
|
||||||
|
context.Response.StatusCode = 418;
|
||||||
|
context.Response.StatusDescription = "I'm a teapot";
|
||||||
|
context.Response.End();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Handles OPTIONS method requests
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="context"></param>
|
||||||
|
protected override void HandleOptions(HttpCwsContext context)
|
||||||
|
{
|
||||||
|
context.Response.StatusCode = 418;
|
||||||
|
context.Response.StatusDescription = "I'm a teapot";
|
||||||
|
context.Response.End();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Handles PATCH method requests
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="context"></param>
|
||||||
|
protected override void HandlePatch(HttpCwsContext context)
|
||||||
|
{
|
||||||
|
context.Response.StatusCode = 418;
|
||||||
|
context.Response.StatusDescription = "I'm a teapot";
|
||||||
|
context.Response.End();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Handles POST method requests
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="context"></param>
|
||||||
|
protected override void HandlePost(HttpCwsContext context)
|
||||||
|
{
|
||||||
|
context.Response.StatusCode = 418;
|
||||||
|
context.Response.StatusDescription = "I'm a teapot";
|
||||||
|
context.Response.End();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Handles PUT method requests
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="context"></param>
|
||||||
|
protected override void HandlePut(HttpCwsContext context)
|
||||||
|
{
|
||||||
|
context.Response.StatusCode = 418;
|
||||||
|
context.Response.StatusDescription = "I'm a teapot";
|
||||||
|
context.Response.End();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Handles TRACE method requests
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="context"></param>
|
||||||
|
protected override void HandleTrace(HttpCwsContext context)
|
||||||
|
{
|
||||||
|
context.Response.StatusCode = 418;
|
||||||
|
context.Response.StatusDescription = "I'm a teapot";
|
||||||
|
context.Response.End();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
using System;
|
||||||
|
using Crestron.SimplSharp.WebScripting;
|
||||||
|
using PepperDash.Core;
|
||||||
|
using PepperDash.Core.Web.RequestHandlers;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Core.Web.RequestHandlers
|
||||||
|
{
|
||||||
|
public class DevJsonRequestHandler : WebApiBaseRequestHandler
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Constructor
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// base(true) enables CORS support by default
|
||||||
|
/// </remarks>
|
||||||
|
public DevJsonRequestHandler()
|
||||||
|
: base(true)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Handles POST method requests
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="context"></param>
|
||||||
|
protected override void HandlePost(HttpCwsContext context)
|
||||||
|
{
|
||||||
|
if (context.Request.ContentLength < 0)
|
||||||
|
{
|
||||||
|
context.Response.StatusCode = 400;
|
||||||
|
context.Response.StatusDescription = "Bad Request";
|
||||||
|
context.Response.End();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var data = EssentialsWebApiHelpers.GetRequestBody(context.Request);
|
||||||
|
if (string.IsNullOrEmpty(data))
|
||||||
|
{
|
||||||
|
context.Response.StatusCode = 400;
|
||||||
|
context.Response.StatusDescription = "Bad Request";
|
||||||
|
context.Response.End();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
DeviceJsonApi.DoDeviceActionWithJson(data);
|
||||||
|
|
||||||
|
context.Response.StatusCode = 200;
|
||||||
|
context.Response.StatusDescription = "OK";
|
||||||
|
context.Response.End();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Debug.Console(1, "Exception Message: {0}", ex.Message);
|
||||||
|
Debug.Console(2, "Exception Stack Trace: {0}", ex.StackTrace);
|
||||||
|
if(ex.InnerException != null) Debug.Console(2, "Exception Inner: {0}", ex.InnerException);
|
||||||
|
|
||||||
|
context.Response.StatusCode = 400;
|
||||||
|
context.Response.StatusDescription = "Bad Request";
|
||||||
|
context.Response.End();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
using System.Linq;
|
||||||
|
using Crestron.SimplSharp.WebScripting;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using PepperDash.Core.Web.RequestHandlers;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Core.Web.RequestHandlers
|
||||||
|
{
|
||||||
|
public class DevListRequestHandler : WebApiBaseRequestHandler
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Constructor
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// base(true) enables CORS support by default
|
||||||
|
/// </remarks>
|
||||||
|
public DevListRequestHandler()
|
||||||
|
: base(true)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Handles GET method requests
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="context"></param>
|
||||||
|
protected override void HandleGet(HttpCwsContext context)
|
||||||
|
{
|
||||||
|
var allDevices = DeviceManager.AllDevices;
|
||||||
|
if (allDevices == null)
|
||||||
|
{
|
||||||
|
context.Response.StatusCode = 404;
|
||||||
|
context.Response.StatusDescription = "Not Found";
|
||||||
|
context.Response.End();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
allDevices.Sort((a, b) => System.String.Compare(a.Key, b.Key, System.StringComparison.Ordinal));
|
||||||
|
|
||||||
|
var deviceList = allDevices.Select(d => EssentialsWebApiHelpers.MapToDeviceListObject(d)).ToList();
|
||||||
|
|
||||||
|
var js = JsonConvert.SerializeObject(deviceList, Formatting.Indented);
|
||||||
|
|
||||||
|
context.Response.StatusCode = 200;
|
||||||
|
context.Response.StatusDescription = "OK";
|
||||||
|
context.Response.ContentType = "application/json";
|
||||||
|
context.Response.ContentEncoding = System.Text.Encoding.UTF8;
|
||||||
|
context.Response.Write(js, false);
|
||||||
|
context.Response.End();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,76 @@
|
|||||||
|
using System.Text;
|
||||||
|
using Crestron.SimplSharp.WebScripting;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using PepperDash.Core.Web.RequestHandlers;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Core.Web.RequestHandlers
|
||||||
|
{
|
||||||
|
public class DevPropsRequestHandler : WebApiBaseRequestHandler
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Constructor
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// base(true) enables CORS support by default
|
||||||
|
/// </remarks>
|
||||||
|
public DevPropsRequestHandler()
|
||||||
|
: base(true)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Handles POST method requests
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="context"></param>
|
||||||
|
protected override void HandlePost(HttpCwsContext context)
|
||||||
|
{
|
||||||
|
if (context.Request.ContentLength < 0)
|
||||||
|
{
|
||||||
|
context.Response.StatusCode = 400;
|
||||||
|
context.Response.StatusDescription = "Bad Request";
|
||||||
|
context.Response.End();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var data = EssentialsWebApiHelpers.GetRequestBody(context.Request);
|
||||||
|
if (string.IsNullOrEmpty(data))
|
||||||
|
{
|
||||||
|
context.Response.StatusCode = 400;
|
||||||
|
context.Response.StatusDescription = "Bad Request";
|
||||||
|
context.Response.End();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var o = new DeviceActionWrapper();
|
||||||
|
var body = JsonConvert.DeserializeAnonymousType(data, o);
|
||||||
|
|
||||||
|
if (string.IsNullOrEmpty(body.DeviceKey))
|
||||||
|
{
|
||||||
|
context.Response.StatusCode = 400;
|
||||||
|
context.Response.StatusDescription = "Bad Request";
|
||||||
|
context.Response.End();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var deviceProps = DeviceJsonApi.GetProperties(body.DeviceKey);
|
||||||
|
if (deviceProps == null || deviceProps.ToLower().Contains("no device"))
|
||||||
|
{
|
||||||
|
context.Response.StatusCode = 404;
|
||||||
|
context.Response.StatusDescription = "Not Found";
|
||||||
|
context.Response.End();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
context.Response.StatusCode = 200;
|
||||||
|
context.Response.StatusDescription = "OK";
|
||||||
|
context.Response.ContentType = "application/json";
|
||||||
|
context.Response.ContentEncoding = Encoding.UTF8;
|
||||||
|
context.Response.Write(deviceProps, false);
|
||||||
|
context.Response.End();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
using Crestron.SimplSharp.WebScripting;
|
||||||
|
using PepperDash.Core.Web.RequestHandlers;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Core.Web.RequestHandlers
|
||||||
|
{
|
||||||
|
public class DisableAllStreamDebugRequestHandler : WebApiBaseRequestHandler
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Constructor
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// base(true) enables CORS support by default
|
||||||
|
/// </remarks>
|
||||||
|
public DisableAllStreamDebugRequestHandler()
|
||||||
|
: base(true)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Handles POST method requests
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="context"></param>
|
||||||
|
protected override void HandlePost(HttpCwsContext context)
|
||||||
|
{
|
||||||
|
DeviceManager.DisableAllDeviceStreamDebugging();
|
||||||
|
|
||||||
|
context.Response.StatusCode = 200;
|
||||||
|
context.Response.StatusDescription = "OK";
|
||||||
|
context.Response.End();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,102 @@
|
|||||||
|
using System.Linq;
|
||||||
|
using Crestron.SimplSharp.WebScripting;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using PepperDash.Core.Web.RequestHandlers;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Core.Web.RequestHandlers
|
||||||
|
{
|
||||||
|
public class GetFeedbacksForDeviceRequestHandler : WebApiBaseRequestHandler
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Constructor
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// base(true) enables CORS support by default
|
||||||
|
/// </remarks>
|
||||||
|
public GetFeedbacksForDeviceRequestHandler()
|
||||||
|
: base(true)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Handles GET method requests
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="context"></param>
|
||||||
|
protected override void HandleGet(HttpCwsContext context)
|
||||||
|
{
|
||||||
|
var routeData = context.Request.RouteData;
|
||||||
|
if (routeData == null)
|
||||||
|
{
|
||||||
|
context.Response.StatusCode = 400;
|
||||||
|
context.Response.StatusDescription = "Bad Request";
|
||||||
|
context.Response.End();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
object deviceObj;
|
||||||
|
if (!routeData.Values.TryGetValue("deviceKey", out deviceObj))
|
||||||
|
{
|
||||||
|
context.Response.StatusCode = 400;
|
||||||
|
context.Response.StatusDescription = "Bad Request";
|
||||||
|
context.Response.End();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
var device = DeviceManager.GetDeviceForKey(deviceObj.ToString()) as IHasFeedback;
|
||||||
|
if (device == null)
|
||||||
|
{
|
||||||
|
context.Response.StatusCode = 404;
|
||||||
|
context.Response.StatusDescription = "Not Found";
|
||||||
|
context.Response.End();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var boolFeedback =
|
||||||
|
from feedback in device.Feedbacks.OfType<BoolFeedback>()
|
||||||
|
where !string.IsNullOrEmpty(feedback.Key)
|
||||||
|
select new
|
||||||
|
{
|
||||||
|
FeedbackKey = feedback.Key,
|
||||||
|
Value = feedback.BoolValue
|
||||||
|
};
|
||||||
|
|
||||||
|
var intFeedback =
|
||||||
|
from feedback in device.Feedbacks.OfType<IntFeedback>()
|
||||||
|
where !string.IsNullOrEmpty(feedback.Key)
|
||||||
|
select new
|
||||||
|
{
|
||||||
|
FeedbackKey = feedback.Key,
|
||||||
|
Value = feedback.IntValue
|
||||||
|
};
|
||||||
|
|
||||||
|
var stringFeedback =
|
||||||
|
from feedback in device.Feedbacks.OfType<StringFeedback>()
|
||||||
|
where !string.IsNullOrEmpty(feedback.Key)
|
||||||
|
select new
|
||||||
|
{
|
||||||
|
FeedbackKey = feedback.Key,
|
||||||
|
Value = feedback.StringValue ?? string.Empty
|
||||||
|
};
|
||||||
|
|
||||||
|
var responseObj = new
|
||||||
|
{
|
||||||
|
BoolValues = boolFeedback,
|
||||||
|
IntValues = intFeedback,
|
||||||
|
SerialValues = stringFeedback
|
||||||
|
};
|
||||||
|
|
||||||
|
var js = JsonConvert.SerializeObject(responseObj, Formatting.Indented);
|
||||||
|
|
||||||
|
context.Response.StatusCode = 200;
|
||||||
|
context.Response.StatusDescription = "OK";
|
||||||
|
context.Response.ContentType = "application/json";
|
||||||
|
context.Response.ContentEncoding = System.Text.Encoding.UTF8;
|
||||||
|
context.Response.Write(js, false);
|
||||||
|
context.Response.End();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,78 @@
|
|||||||
|
using System.Linq;
|
||||||
|
using Crestron.SimplSharp.WebScripting;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using PepperDash.Core.Web.RequestHandlers;
|
||||||
|
using PepperDash.Essentials.Core.Bridges;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Core.Web.RequestHandlers
|
||||||
|
{
|
||||||
|
public class GetJoinMapForBridgeKeyRequestHandler : WebApiBaseRequestHandler
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Constructor
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// base(true) enables CORS support by default
|
||||||
|
/// </remarks>
|
||||||
|
public GetJoinMapForBridgeKeyRequestHandler()
|
||||||
|
: base(true)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Handles GET method requests
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="context"></param>
|
||||||
|
protected override void HandleGet(HttpCwsContext context)
|
||||||
|
{
|
||||||
|
var routeData = context.Request.RouteData;
|
||||||
|
if (routeData == null)
|
||||||
|
{
|
||||||
|
context.Response.StatusCode = 400;
|
||||||
|
context.Response.StatusDescription = "Bad Request";
|
||||||
|
context.Response.End();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
object bridgeObj;
|
||||||
|
if (!routeData.Values.TryGetValue("bridgeKey", out bridgeObj))
|
||||||
|
{
|
||||||
|
context.Response.StatusCode = 400;
|
||||||
|
context.Response.StatusDescription = "Bad Request";
|
||||||
|
context.Response.End();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var bridge = DeviceManager.GetDeviceForKey(bridgeObj.ToString()) as EiscApiAdvanced;
|
||||||
|
if (bridge == null)
|
||||||
|
{
|
||||||
|
context.Response.StatusCode = 400;
|
||||||
|
context.Response.StatusDescription = "Bad Request";
|
||||||
|
context.Response.End();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var joinMap = bridge.JoinMaps.Select(j => EssentialsWebApiHelpers.MapJoinToObject(j)).ToList();
|
||||||
|
if (joinMap == null)
|
||||||
|
{
|
||||||
|
context.Response.StatusCode = 404;
|
||||||
|
context.Response.StatusDescription = "Not Found";
|
||||||
|
context.Response.End();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var js = JsonConvert.SerializeObject(joinMap, Formatting.Indented);
|
||||||
|
|
||||||
|
context.Response.StatusCode = 200;
|
||||||
|
context.Response.StatusDescription = "OK";
|
||||||
|
context.Response.ContentType = "application/json";
|
||||||
|
context.Response.ContentEncoding = System.Text.Encoding.UTF8;
|
||||||
|
context.Response.Write(js, false);
|
||||||
|
context.Response.End();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,95 @@
|
|||||||
|
using Crestron.SimplSharp.WebScripting;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using PepperDash.Core.Web.RequestHandlers;
|
||||||
|
using PepperDash.Essentials.Core.Bridges;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Core.Web.RequestHandlers
|
||||||
|
{
|
||||||
|
public class GetJoinMapForDeviceKeyRequestHandler : WebApiBaseRequestHandler
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Constructor
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// base(true) enables CORS support by default
|
||||||
|
/// </remarks>
|
||||||
|
public GetJoinMapForDeviceKeyRequestHandler()
|
||||||
|
: base(true)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Handles GET method requests
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="context"></param>
|
||||||
|
protected override void HandleGet(HttpCwsContext context)
|
||||||
|
{
|
||||||
|
var routeData = context.Request.RouteData;
|
||||||
|
if (routeData == null)
|
||||||
|
{
|
||||||
|
context.Response.StatusCode = 400;
|
||||||
|
context.Response.StatusDescription = "Bad Request";
|
||||||
|
context.Response.End();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
object bridgeObj;
|
||||||
|
if (!routeData.Values.TryGetValue("bridgeKey", out bridgeObj))
|
||||||
|
{
|
||||||
|
context.Response.StatusCode = 400;
|
||||||
|
context.Response.StatusDescription = "Bad Request";
|
||||||
|
context.Response.End();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
object deviceObj;
|
||||||
|
if (!routeData.Values.TryGetValue("deviceKey", out deviceObj))
|
||||||
|
{
|
||||||
|
context.Response.StatusCode = 400;
|
||||||
|
context.Response.StatusDescription = "Bad Request";
|
||||||
|
context.Response.End();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var bridge = DeviceManager.GetDeviceForKey(bridgeObj.ToString()) as EiscApiAdvanced;
|
||||||
|
if (bridge == null)
|
||||||
|
{
|
||||||
|
context.Response.StatusCode = 404;
|
||||||
|
context.Response.StatusDescription = "Not Found";
|
||||||
|
context.Response.End();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
JoinMapBaseAdvanced deviceJoinMap;
|
||||||
|
if (!bridge.JoinMaps.TryGetValue(deviceObj.ToString(), out deviceJoinMap))
|
||||||
|
{
|
||||||
|
context.Response.StatusCode = 500;
|
||||||
|
context.Response.StatusDescription = "Internal Server Error";
|
||||||
|
context.Response.End();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var joinMap = EssentialsWebApiHelpers.MapJoinToObject(deviceObj.ToString(), deviceJoinMap);
|
||||||
|
var js = JsonConvert.SerializeObject(joinMap, Formatting.Indented, new JsonSerializerSettings
|
||||||
|
{
|
||||||
|
ReferenceLoopHandling = ReferenceLoopHandling.Ignore,
|
||||||
|
NullValueHandling = NullValueHandling.Ignore,
|
||||||
|
MissingMemberHandling = MissingMemberHandling.Ignore,
|
||||||
|
DefaultValueHandling = DefaultValueHandling.Ignore,
|
||||||
|
TypeNameHandling = TypeNameHandling.None
|
||||||
|
});
|
||||||
|
|
||||||
|
context.Response.StatusCode = 200;
|
||||||
|
context.Response.StatusDescription = "OK";
|
||||||
|
context.Response.ContentType = "application/json";
|
||||||
|
context.Response.ContentEncoding = System.Text.Encoding.UTF8;
|
||||||
|
context.Response.Write(js, false);
|
||||||
|
context.Response.End();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,68 @@
|
|||||||
|
using System.Linq;
|
||||||
|
using Crestron.SimplSharp.WebScripting;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using PepperDash.Core.Web.RequestHandlers;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Core.Web.RequestHandlers
|
||||||
|
{
|
||||||
|
public class GetTypesByFilterRequestHandler : WebApiBaseRequestHandler
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Constructor
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// base(true) enables CORS support by default
|
||||||
|
/// </remarks>
|
||||||
|
public GetTypesByFilterRequestHandler()
|
||||||
|
: base(true)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Handles GET method requests
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="context"></param>
|
||||||
|
protected override void HandleGet(HttpCwsContext context)
|
||||||
|
{
|
||||||
|
var routeData = context.Request.RouteData;
|
||||||
|
if (routeData == null)
|
||||||
|
{
|
||||||
|
context.Response.StatusCode = 400;
|
||||||
|
context.Response.StatusDescription = "Bad Request";
|
||||||
|
context.Response.End();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
object filterObj;
|
||||||
|
if (!routeData.Values.TryGetValue("filter", out filterObj))
|
||||||
|
{
|
||||||
|
context.Response.StatusCode = 400;
|
||||||
|
context.Response.StatusDescription = "Bad Request";
|
||||||
|
context.Response.End();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var deviceFactory = DeviceFactory.GetDeviceFactoryDictionary(filterObj.ToString());
|
||||||
|
if (deviceFactory == null)
|
||||||
|
{
|
||||||
|
context.Response.StatusCode = 404;
|
||||||
|
context.Response.StatusDescription = "Not Found";
|
||||||
|
context.Response.End();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var deviceTypes = deviceFactory.Select(t => EssentialsWebApiHelpers.MapDeviceTypeToObject(t)).ToList();
|
||||||
|
var js = JsonConvert.SerializeObject(deviceTypes, Formatting.Indented);
|
||||||
|
|
||||||
|
context.Response.StatusCode = 200;
|
||||||
|
context.Response.StatusDescription = "OK";
|
||||||
|
context.Response.ContentType = "application/json";
|
||||||
|
context.Response.ContentEncoding = System.Text.Encoding.UTF8;
|
||||||
|
context.Response.Write(js, false);
|
||||||
|
context.Response.End();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
using System.Linq;
|
||||||
|
using Crestron.SimplSharp.WebScripting;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using PepperDash.Core.Web.RequestHandlers;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Core.Web.RequestHandlers
|
||||||
|
{
|
||||||
|
public class GetTypesRequestHandler : WebApiBaseRequestHandler
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Constructor
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// base(true) enables CORS support by default
|
||||||
|
/// </remarks>
|
||||||
|
public GetTypesRequestHandler()
|
||||||
|
: base(true)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Handles GET method requests
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="context"></param>
|
||||||
|
protected override void HandleGet(HttpCwsContext context)
|
||||||
|
{
|
||||||
|
var routeData = context.Request.RouteData;
|
||||||
|
if (routeData == null)
|
||||||
|
{
|
||||||
|
context.Response.StatusCode = 400;
|
||||||
|
context.Response.StatusDescription = "Bad Request";
|
||||||
|
context.Response.End();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var deviceFactory = DeviceFactory.GetDeviceFactoryDictionary(null);
|
||||||
|
if (deviceFactory == null)
|
||||||
|
{
|
||||||
|
context.Response.StatusCode = 404;
|
||||||
|
context.Response.StatusDescription = "Not Found";
|
||||||
|
context.Response.End();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var deviceTypes = deviceFactory.Select(t => EssentialsWebApiHelpers.MapDeviceTypeToObject(t)).ToList();
|
||||||
|
var js = JsonConvert.SerializeObject(deviceTypes, Formatting.Indented);
|
||||||
|
|
||||||
|
context.Response.StatusCode = 200;
|
||||||
|
context.Response.StatusDescription = "OK";
|
||||||
|
context.Response.ContentType = "application/json";
|
||||||
|
context.Response.ContentEncoding = System.Text.Encoding.UTF8;
|
||||||
|
context.Response.Write(js, false);
|
||||||
|
context.Response.End();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
using System.Linq;
|
||||||
|
using Crestron.SimplSharp.WebScripting;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using PepperDash.Core.Web.RequestHandlers;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Core.Web.RequestHandlers
|
||||||
|
{
|
||||||
|
public class ReportVersionsRequestHandler : WebApiBaseRequestHandler
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Constructor
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// base(true) enables CORS support by default
|
||||||
|
/// </remarks>
|
||||||
|
public ReportVersionsRequestHandler()
|
||||||
|
: base(true)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Handles GET method requests
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="context"></param>
|
||||||
|
protected override void HandleGet(HttpCwsContext context)
|
||||||
|
{
|
||||||
|
var loadAssemblies = PluginLoader.LoadedAssemblies;
|
||||||
|
if (loadAssemblies == null)
|
||||||
|
{
|
||||||
|
context.Response.StatusCode = 500;
|
||||||
|
context.Response.StatusDescription = "Internal Server Error";
|
||||||
|
context.Response.End();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var assemblies = loadAssemblies.Select(a => EssentialsWebApiHelpers.MapToAssemblyObject(a)).ToList();
|
||||||
|
|
||||||
|
var js = JsonConvert.SerializeObject(assemblies, Formatting.Indented);
|
||||||
|
|
||||||
|
context.Response.StatusCode = 200;
|
||||||
|
context.Response.StatusDescription = "OK";
|
||||||
|
context.Response.ContentType = "application/json";
|
||||||
|
context.Response.ContentEncoding = System.Text.Encoding.UTF8;
|
||||||
|
context.Response.Write(js, false);
|
||||||
|
context.Response.End();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,212 @@
|
|||||||
|
using System;
|
||||||
|
using Crestron.SimplSharp.WebScripting;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using PepperDash.Core;
|
||||||
|
using PepperDash.Core.Web.RequestHandlers;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Core.Web.RequestHandlers
|
||||||
|
{
|
||||||
|
public class SetDeviceStreamDebugRequestHandler : WebApiBaseRequestHandler
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Handles CONNECT method requests
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="context"></param>
|
||||||
|
protected override void HandleConnect(HttpCwsContext context)
|
||||||
|
{
|
||||||
|
context.Response.StatusCode = 501;
|
||||||
|
context.Response.StatusDescription = "Not Implemented";
|
||||||
|
context.Response.End();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Handles DELETE method requests
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="context"></param>
|
||||||
|
protected override void HandleDelete(HttpCwsContext context)
|
||||||
|
{
|
||||||
|
context.Response.StatusCode = 501;
|
||||||
|
context.Response.StatusDescription = "Not Implemented";
|
||||||
|
context.Response.End();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Handles GET method requests
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="context"></param>
|
||||||
|
protected override void HandleGet(HttpCwsContext context)
|
||||||
|
{
|
||||||
|
context.Response.StatusCode = 501;
|
||||||
|
context.Response.StatusDescription = "Not Implemented";
|
||||||
|
context.Response.End();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Handles HEAD method requests
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="context"></param>
|
||||||
|
protected override void HandleHead(HttpCwsContext context)
|
||||||
|
{
|
||||||
|
context.Response.StatusCode = 501;
|
||||||
|
context.Response.StatusDescription = "Not Implemented";
|
||||||
|
context.Response.End();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Handles OPTIONS method requests
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="context"></param>
|
||||||
|
protected override void HandleOptions(HttpCwsContext context)
|
||||||
|
{
|
||||||
|
context.Response.StatusCode = 501;
|
||||||
|
context.Response.StatusDescription = "Not Implemented";
|
||||||
|
context.Response.End();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Handles PATCH method requests
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="context"></param>
|
||||||
|
protected override void HandlePatch(HttpCwsContext context)
|
||||||
|
{
|
||||||
|
context.Response.StatusCode = 501;
|
||||||
|
context.Response.StatusDescription = "Not Implemented";
|
||||||
|
context.Response.End();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Handles POST method requests
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="context"></param>
|
||||||
|
protected override void HandlePost(HttpCwsContext context)
|
||||||
|
{
|
||||||
|
if (context.Request.ContentLength < 0)
|
||||||
|
{
|
||||||
|
context.Response.StatusCode = 400;
|
||||||
|
context.Response.StatusDescription = "Bad Request";
|
||||||
|
context.Response.End();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var data = EssentialsWebApiHelpers.GetRequestBody(context.Request);
|
||||||
|
if (data == null)
|
||||||
|
{
|
||||||
|
context.Response.StatusCode = 500;
|
||||||
|
context.Response.StatusDescription = "Internal Server Error";
|
||||||
|
context.Response.End();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var config = new SetDeviceStreamDebugConfig();
|
||||||
|
var body = JsonConvert.DeserializeAnonymousType(data, config);
|
||||||
|
if (body == null)
|
||||||
|
{
|
||||||
|
context.Response.StatusCode = 500;
|
||||||
|
context.Response.StatusDescription = "Internal Server Error";
|
||||||
|
context.Response.End();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (string.IsNullOrEmpty(body.DeviceKey) || string.IsNullOrEmpty(body.Setting))
|
||||||
|
{
|
||||||
|
context.Response.StatusCode = 400;
|
||||||
|
context.Response.StatusDescription = "Bad Request";
|
||||||
|
context.Response.End();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var device = DeviceManager.GetDeviceForKey(body.DeviceKey) as IStreamDebugging;
|
||||||
|
if (device == null)
|
||||||
|
{
|
||||||
|
context.Response.StatusCode = 404;
|
||||||
|
context.Response.StatusDescription = "Not Found";
|
||||||
|
context.Response.End();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
eStreamDebuggingSetting debugSetting;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
debugSetting = (eStreamDebuggingSetting) Enum.Parse(typeof (eStreamDebuggingSetting), body.Setting, true);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
context.Response.StatusCode = 500;
|
||||||
|
context.Response.StatusDescription = "Internal Server Error";
|
||||||
|
context.Response.End();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var mins = Convert.ToUInt32(body.Timeout);
|
||||||
|
if (mins > 0)
|
||||||
|
{
|
||||||
|
device.StreamDebugging.SetDebuggingWithSpecificTimeout(debugSetting, mins);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
device.StreamDebugging.SetDebuggingWithDefaultTimeout(debugSetting);
|
||||||
|
}
|
||||||
|
|
||||||
|
context.Response.StatusCode = 200;
|
||||||
|
context.Response.StatusDescription = "OK";
|
||||||
|
context.Response.End();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
context.Response.StatusCode = 500;
|
||||||
|
context.Response.StatusDescription = "Internal Server Error";
|
||||||
|
context.Response.End();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Handles PUT method requests
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="context"></param>
|
||||||
|
protected override void HandlePut(HttpCwsContext context)
|
||||||
|
{
|
||||||
|
context.Response.StatusCode = 501;
|
||||||
|
context.Response.StatusDescription = "Not Implemented";
|
||||||
|
context.Response.End();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Handles TRACE method requests
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="context"></param>
|
||||||
|
protected override void HandleTrace(HttpCwsContext context)
|
||||||
|
{
|
||||||
|
context.Response.StatusCode = 501;
|
||||||
|
context.Response.StatusDescription = "Not Implemented";
|
||||||
|
context.Response.End();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public class SetDeviceStreamDebugConfig
|
||||||
|
{
|
||||||
|
[JsonProperty("deviceKey", NullValueHandling = NullValueHandling.Include)]
|
||||||
|
public string DeviceKey { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("setting", NullValueHandling = NullValueHandling.Include)]
|
||||||
|
public string Setting { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("timeout")]
|
||||||
|
public int Timeout { get; set; }
|
||||||
|
|
||||||
|
public SetDeviceStreamDebugConfig()
|
||||||
|
{
|
||||||
|
DeviceKey = null;
|
||||||
|
Setting = null;
|
||||||
|
Timeout = 15;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
using Crestron.SimplSharp.WebScripting;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using PepperDash.Core.Web.RequestHandlers;
|
||||||
|
using PepperDash.Essentials.Core.Config;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Core.Web.RequestHandlers
|
||||||
|
{
|
||||||
|
public class ShowConfigRequestHandler : WebApiBaseRequestHandler
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Constructor
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// base(true) enables CORS support by default
|
||||||
|
/// </remarks>
|
||||||
|
public ShowConfigRequestHandler()
|
||||||
|
: base(true)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Handles GET method requests
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="context"></param>
|
||||||
|
protected override void HandleGet(HttpCwsContext context)
|
||||||
|
{
|
||||||
|
var config = JsonConvert.SerializeObject(ConfigReader.ConfigObject, Formatting.Indented);
|
||||||
|
|
||||||
|
context.Response.StatusCode = 200;
|
||||||
|
context.Response.StatusDescription = "OK";
|
||||||
|
context.Response.ContentType = "application/json";
|
||||||
|
context.Response.ContentEncoding = System.Text.Encoding.UTF8;
|
||||||
|
context.Response.Write(config, false);
|
||||||
|
context.Response.End();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -19,7 +19,7 @@ namespace PepperDash.Essentials.DM.AirMedia
|
|||||||
[Description("Wrapper class for an AM-200 or AM-300")]
|
[Description("Wrapper class for an AM-200 or AM-300")]
|
||||||
public class AirMediaController : CrestronGenericBridgeableBaseDevice, IRoutingNumericWithFeedback, IIROutputPorts, IComPorts
|
public class AirMediaController : CrestronGenericBridgeableBaseDevice, IRoutingNumericWithFeedback, IIROutputPorts, IComPorts
|
||||||
{
|
{
|
||||||
public AmX00 AirMedia { get; private set; }
|
public Am3x00 AirMedia { get; private set; }
|
||||||
|
|
||||||
public DeviceConfig DeviceConfig { get; private set; }
|
public DeviceConfig DeviceConfig { get; private set; }
|
||||||
|
|
||||||
@@ -44,7 +44,7 @@ namespace PepperDash.Essentials.DM.AirMedia
|
|||||||
public StringFeedback SerialNumberFeedback { get; private set; }
|
public StringFeedback SerialNumberFeedback { get; private set; }
|
||||||
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, Am3x00 device, DeviceConfig dc, AirMediaPropertiesConfig props)
|
||||||
: base(key, name, device)
|
: base(key, name, device)
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -95,24 +95,31 @@ namespace PepperDash.Essentials.DM.AirMedia
|
|||||||
|
|
||||||
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(() => AirMedia.AirMedia.StatusFeedback.UShortValue == 0);
|
||||||
ErrorFeedback = new IntFeedback(new Func<int>(() => AirMedia.AirMedia.ErrorFeedback.UShortValue));
|
ErrorFeedback = new IntFeedback(() => AirMedia.AirMedia.ErrorFeedback.UShortValue);
|
||||||
NumberOfUsersConnectedFeedback = new IntFeedback(new Func<int>(() => AirMedia.AirMedia.NumberOfUsersConnectedFeedback.UShortValue));
|
NumberOfUsersConnectedFeedback = new IntFeedback(() => AirMedia.AirMedia.NumberOfUsersConnectedFeedback.UShortValue);
|
||||||
LoginCodeFeedback = new IntFeedback(new Func<int>(() => AirMedia.AirMedia.LoginCodeFeedback.UShortValue));
|
LoginCodeFeedback = new IntFeedback(() => AirMedia.AirMedia.LoginCodeFeedback.UShortValue);
|
||||||
ConnectionAddressFeedback = new StringFeedback(new Func<string>(() => AirMedia.AirMedia.ConnectionAddressFeedback.StringValue));
|
ConnectionAddressFeedback = new StringFeedback(() => AirMedia.AirMedia.ConnectionAddressFeedback.StringValue);
|
||||||
HostnameFeedback = new StringFeedback(new Func<string>(() => AirMedia.AirMedia.HostNameFeedback.StringValue));
|
HostnameFeedback = new StringFeedback(() => AirMedia.AirMedia.HostNameFeedback.StringValue);
|
||||||
|
|
||||||
// TODO: Figure out if we can actually get the TSID/Serial
|
// TODO: Figure out if we can actually get the TSID/Serial
|
||||||
SerialNumberFeedback = new StringFeedback(new Func<string>(() => "unknown"));
|
SerialNumberFeedback = new StringFeedback(() => "unknown");
|
||||||
|
|
||||||
AirMedia.DisplayControl.DisplayControlChange += new Crestron.SimplSharpPro.DeviceSupport.GenericEventHandler(DisplayControl_DisplayControlChange);
|
AirMedia.DisplayControl.DisplayControlChange += DisplayControl_DisplayControlChange;
|
||||||
|
|
||||||
VideoOutFeedback = new IntFeedback(new Func<int>(() => Convert.ToInt16(AirMedia.DisplayControl.VideoOutFeedback)));
|
VideoOutFeedback = new IntFeedback(() => Convert.ToInt16(AirMedia.DisplayControl.VideoOutFeedback));
|
||||||
AutomaticInputRoutingEnabledFeedback = new BoolFeedback(new Func<bool>(() => AirMedia.DisplayControl.EnableAutomaticRoutingFeedback.BoolValue));
|
AutomaticInputRoutingEnabledFeedback = new BoolFeedback(() => AirMedia.DisplayControl.EnableAutomaticRoutingFeedback.BoolValue);
|
||||||
|
|
||||||
AirMedia.HdmiIn.StreamChange += new Crestron.SimplSharpPro.DeviceSupport.StreamEventHandler(HdmiIn_StreamChange);
|
// Not all AirMedia versions support HDMI In like the 3200
|
||||||
|
if (AirMedia.HdmiIn != null)
|
||||||
|
{
|
||||||
|
AirMedia.HdmiIn.StreamChange += HdmiIn_StreamChange;
|
||||||
|
HdmiVideoSyncDetectedFeedback = new BoolFeedback(() => AirMedia.HdmiIn.SyncDetectedFeedback.BoolValue);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
HdmiVideoSyncDetectedFeedback = new BoolFeedback(new Func<bool>(() => AirMedia.HdmiIn.SyncDetectedFeedback.BoolValue));
|
// Return false if the AirMedia device doesn't support HDMI Input
|
||||||
|
HdmiVideoSyncDetectedFeedback = new BoolFeedback(() => false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool CustomActivate()
|
public override bool CustomActivate()
|
||||||
@@ -122,7 +129,7 @@ namespace PepperDash.Essentials.DM.AirMedia
|
|||||||
else
|
else
|
||||||
AirMedia.DisplayControl.DisableAutomaticRouting();
|
AirMedia.DisplayControl.DisableAutomaticRouting();
|
||||||
|
|
||||||
return base.CustomActivate();
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
||||||
@@ -179,31 +186,53 @@ namespace PepperDash.Essentials.DM.AirMedia
|
|||||||
/// <param name="e">Arguments defined as IKeyName sender, output, input, and eRoutingSignalType</param>
|
/// <param name="e">Arguments defined as IKeyName sender, output, input, and eRoutingSignalType</param>
|
||||||
private void OnSwitchChange(RoutingNumericEventArgs e)
|
private void OnSwitchChange(RoutingNumericEventArgs e)
|
||||||
{
|
{
|
||||||
var newEvent = NumericSwitchChange;
|
var handler = NumericSwitchChange;
|
||||||
if (newEvent != null) newEvent(this, e);
|
|
||||||
}
|
if (handler == null) return;
|
||||||
|
|
||||||
|
handler(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void AirMedia_AirMediaChange(object sender, Crestron.SimplSharpPro.DeviceSupport.GenericEventArgs args)
|
void AirMedia_AirMediaChange(object sender, Crestron.SimplSharpPro.DeviceSupport.GenericEventArgs args)
|
||||||
{
|
{
|
||||||
if (args.EventId == AirMediaInputSlot.AirMediaStatusFeedbackEventId)
|
switch (args.EventId)
|
||||||
IsInSessionFeedback.FireUpdate();
|
{
|
||||||
else if (args.EventId == AirMediaInputSlot.AirMediaErrorFeedbackEventId)
|
case AirMediaInputSlot.AirMediaStatusFeedbackEventId:
|
||||||
ErrorFeedback.FireUpdate();
|
{
|
||||||
else if (args.EventId == AirMediaInputSlot.AirMediaNumberOfUserConnectedEventId)
|
IsInSessionFeedback.FireUpdate();
|
||||||
NumberOfUsersConnectedFeedback.FireUpdate();
|
break;
|
||||||
else if (args.EventId == AirMediaInputSlot.AirMediaLoginCodeEventId)
|
}
|
||||||
LoginCodeFeedback.FireUpdate();
|
case AirMediaInputSlot.AirMediaErrorFeedbackEventId:
|
||||||
else if (args.EventId == AirMediaInputSlot.AirMediaConnectionAddressFeedbackEventId)
|
{
|
||||||
ConnectionAddressFeedback.FireUpdate();
|
ErrorFeedback.FireUpdate();
|
||||||
else if (args.EventId == AirMediaInputSlot.AirMediaHostNameFeedbackEventId)
|
break;
|
||||||
HostnameFeedback.FireUpdate();
|
}
|
||||||
|
case AirMediaInputSlot.AirMediaNumberOfUserConnectedEventId:
|
||||||
|
{
|
||||||
|
NumberOfUsersConnectedFeedback.FireUpdate();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case AirMediaInputSlot.AirMediaLoginCodeEventId:
|
||||||
|
{
|
||||||
|
LoginCodeFeedback.FireUpdate();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case AirMediaInputSlot.AirMediaConnectionAddressFeedbackEventId:
|
||||||
|
{
|
||||||
|
ConnectionAddressFeedback.FireUpdate();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case AirMediaInputSlot.AirMediaHostNameFeedbackEventId:
|
||||||
|
{
|
||||||
|
HostnameFeedback.FireUpdate();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DisplayControl_DisplayControlChange(object sender, Crestron.SimplSharpPro.DeviceSupport.GenericEventArgs args)
|
void DisplayControl_DisplayControlChange(object sender, Crestron.SimplSharpPro.DeviceSupport.GenericEventArgs args)
|
||||||
{
|
{
|
||||||
if (args.EventId == AmX00.VideoOutFeedbackEventId)
|
|
||||||
{
|
|
||||||
VideoOutFeedback.FireUpdate();
|
VideoOutFeedback.FireUpdate();
|
||||||
|
|
||||||
var localInputPort =
|
var localInputPort =
|
||||||
@@ -211,8 +240,7 @@ namespace PepperDash.Essentials.DM.AirMedia
|
|||||||
|
|
||||||
OnSwitchChange(new RoutingNumericEventArgs(1, VideoOutFeedback.UShortValue, OutputPorts.First(),
|
OnSwitchChange(new RoutingNumericEventArgs(1, VideoOutFeedback.UShortValue, OutputPorts.First(),
|
||||||
localInputPort, eRoutingSignalType.AudioVideo));
|
localInputPort, eRoutingSignalType.AudioVideo));
|
||||||
}
|
|
||||||
else if (args.EventId == AmX00.EnableAutomaticRoutingFeedbackEventId)
|
|
||||||
AutomaticInputRoutingEnabledFeedback.FireUpdate();
|
AutomaticInputRoutingEnabledFeedback.FireUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -342,7 +370,7 @@ namespace PepperDash.Essentials.DM.AirMedia
|
|||||||
{
|
{
|
||||||
public AirMediaControllerFactory()
|
public AirMediaControllerFactory()
|
||||||
{
|
{
|
||||||
TypeNames = new List<string>() { "am200", "am300" };
|
TypeNames = new List<string>() { "am200", "am300", "am3200" };
|
||||||
}
|
}
|
||||||
|
|
||||||
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||||
@@ -351,12 +379,26 @@ namespace PepperDash.Essentials.DM.AirMedia
|
|||||||
|
|
||||||
Debug.Console(1, "Factory Attempting to create new AirMedia Device");
|
Debug.Console(1, "Factory Attempting to create new AirMedia Device");
|
||||||
|
|
||||||
var props = JsonConvert.DeserializeObject<AirMediaPropertiesConfig>(dc.Properties.ToString());
|
var props = dc.Properties.ToObject<AirMediaPropertiesConfig>();
|
||||||
AmX00 amDevice = null;
|
Am3x00 amDevice = null;
|
||||||
if (type == "am200")
|
switch (type)
|
||||||
amDevice = new Crestron.SimplSharpPro.DM.AirMedia.Am200(props.Control.IpIdInt, Global.ControlSystem);
|
{
|
||||||
else if (type == "am300")
|
case "am200" :
|
||||||
amDevice = new Crestron.SimplSharpPro.DM.AirMedia.Am300(props.Control.IpIdInt, Global.ControlSystem);
|
{
|
||||||
|
amDevice = new Am200(props.Control.IpIdInt, Global.ControlSystem);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case "am300" :
|
||||||
|
{
|
||||||
|
amDevice = new Am300(props.Control.IpIdInt, Global.ControlSystem);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case "am3200" :
|
||||||
|
{
|
||||||
|
amDevice = new Am3200(props.Control.IpIdInt, Global.ControlSystem);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return new AirMediaController(dc.Key, dc.Name, amDevice, dc, props);
|
return new AirMediaController(dc.Key, dc.Name, amDevice, dc, props);
|
||||||
|
|
||||||
|
|||||||
@@ -17,11 +17,12 @@ using PepperDash.Essentials.Core;
|
|||||||
using PepperDash.Essentials.Core.Config;
|
using PepperDash.Essentials.Core.Config;
|
||||||
using Crestron.SimplSharpPro.DeviceSupport;
|
using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
using PepperDash.Essentials.Core.DeviceInfo;
|
using PepperDash.Essentials.Core.DeviceInfo;
|
||||||
|
using PepperDash.Essentials.Core.Bridges;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.DM.Endpoints.DGEs
|
namespace PepperDash.Essentials.DM.Endpoints.DGEs
|
||||||
{
|
{
|
||||||
[Description("Wrapper class for DGE-100")]
|
[Description("Wrapper class for DGE-100")]
|
||||||
public class Dge100Controller : CrestronGenericBaseDevice, IComPorts, IIROutputPorts, IHasBasicTriListWithSmartObject, ICec, IDeviceInfoProvider
|
public class Dge100Controller : CrestronGenericBaseDevice, IComPorts, IIROutputPorts, IHasBasicTriListWithSmartObject, ICec, IDeviceInfoProvider, IBridgeAdvanced
|
||||||
{
|
{
|
||||||
private const int CtpPort = 41795;
|
private const int CtpPort = 41795;
|
||||||
private readonly Dge100 _dge;
|
private readonly Dge100 _dge;
|
||||||
@@ -30,9 +31,12 @@ namespace PepperDash.Essentials.DM.Endpoints.DGEs
|
|||||||
|
|
||||||
public BasicTriListWithSmartObject Panel { get { return _dge; } }
|
public BasicTriListWithSmartObject Panel { get { return _dge; } }
|
||||||
|
|
||||||
private DeviceConfig _dc;
|
private DeviceConfig _dc;
|
||||||
|
|
||||||
|
public VideoStatusOutputs VideoStatusFeedbacks { get; private set; }
|
||||||
|
|
||||||
|
CrestronTouchpanelPropertiesConfig PropertiesConfig;
|
||||||
|
|
||||||
CrestronTouchpanelPropertiesConfig PropertiesConfig;
|
|
||||||
|
|
||||||
public Dge100Controller(string key, string name, Dge100 device, DeviceConfig dc, CrestronTouchpanelPropertiesConfig props)
|
public Dge100Controller(string key, string name, Dge100 device, DeviceConfig dc, CrestronTouchpanelPropertiesConfig props)
|
||||||
:base(key, name, device)
|
:base(key, name, device)
|
||||||
@@ -48,8 +52,20 @@ namespace PepperDash.Essentials.DM.Endpoints.DGEs
|
|||||||
|
|
||||||
_dc = dc;
|
_dc = dc;
|
||||||
|
|
||||||
PropertiesConfig = props;
|
PropertiesConfig = props;
|
||||||
}
|
|
||||||
|
var videoStatusFuncs = new VideoStatusFuncsWrapper
|
||||||
|
{
|
||||||
|
HdcpActiveFeedbackFunc = () => _dge.HdmiIn.HdcpSupportOnFeedback.BoolValue,
|
||||||
|
VideoResolutionFeedbackFunc = () => _dge.HdmiIn.VideoAttributes.GetVideoResolutionString(),
|
||||||
|
VideoSyncFeedbackFunc = () => _dge.HdmiIn.SyncDetectedFeedback.BoolValue,
|
||||||
|
};
|
||||||
|
|
||||||
|
VideoStatusFeedbacks = new VideoStatusOutputs(videoStatusFuncs);
|
||||||
|
|
||||||
|
_dge.HdmiIn.StreamChange += (s,a) => VideoStatusFeedbacks.FireAll();
|
||||||
|
_dge.HdmiIn.VideoAttributes.AttributeChange += (o, a) => VideoStatusFeedbacks.FireAll();
|
||||||
|
}
|
||||||
|
|
||||||
#region IComPorts Members
|
#region IComPorts Members
|
||||||
|
|
||||||
@@ -187,6 +203,63 @@ namespace PepperDash.Essentials.DM.Endpoints.DGEs
|
|||||||
handler(this, new DeviceInfoEventArgs(DeviceInfo));
|
handler(this, new DeviceInfoEventArgs(DeviceInfo));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region IBridgeAdvanced Members
|
||||||
|
|
||||||
|
public void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
||||||
|
{
|
||||||
|
var joinMap = new DgeJoinMap(joinStart);
|
||||||
|
|
||||||
|
var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(joinMapSerialized))
|
||||||
|
joinMap = JsonConvert.DeserializeObject<DgeJoinMap>(joinMapSerialized);
|
||||||
|
|
||||||
|
if (bridge != null)
|
||||||
|
{
|
||||||
|
bridge.AddJoinMap(Key, joinMap);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Debug.Console(0, this, "Please update config to use 'eiscapiadvanced' to get all join map features for this device.");
|
||||||
|
}
|
||||||
|
|
||||||
|
Debug.Console(1, this, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
||||||
|
|
||||||
|
//Presses
|
||||||
|
trilist.SetSigTrueAction(joinMap.HdmiInHdcpOn.JoinNumber, () => _dge.HdmiIn.HdcpSupportOn());
|
||||||
|
trilist.SetSigTrueAction(joinMap.HdmiInHdcpOff.JoinNumber,() => _dge.HdmiIn.HdcpSupportOff());
|
||||||
|
trilist.SetSigTrueAction(joinMap.HdmiInHdcpToggle.JoinNumber, () => {
|
||||||
|
if(_dge.HdmiIn.HdcpSupportOnFeedback.BoolValue)
|
||||||
|
{
|
||||||
|
_dge.HdmiIn.HdcpSupportOff();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
_dge.HdmiIn.HdcpSupportOn();
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// Feedbacks
|
||||||
|
VideoStatusFeedbacks.HdcpActiveFeedback.LinkInputSig(trilist.BooleanInput[joinMap.HdmiInHdcpOn.JoinNumber]);
|
||||||
|
VideoStatusFeedbacks.HdcpActiveFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.HdmiInHdcpOff.JoinNumber]);
|
||||||
|
|
||||||
|
VideoStatusFeedbacks.VideoResolutionFeedback.LinkInputSig(trilist.StringInput[joinMap.CurrentInputResolution.JoinNumber]);
|
||||||
|
VideoStatusFeedbacks.VideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.SyncDetected.JoinNumber]);
|
||||||
|
|
||||||
|
IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline.JoinNumber]);
|
||||||
|
|
||||||
|
trilist.OnlineStatusChange += (o, a) =>
|
||||||
|
{
|
||||||
|
if (!a.DeviceOnLine) return;
|
||||||
|
|
||||||
|
VideoStatusFeedbacks.FireAll();
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,50 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using Crestron.SimplSharp;
|
||||||
|
using PepperDash.Essentials.Core;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.DM.Endpoints.DGEs
|
||||||
|
{
|
||||||
|
public class DgeJoinMap : JoinMapBaseAdvanced
|
||||||
|
{
|
||||||
|
[JoinName("IsOnline")]
|
||||||
|
public JoinDataComplete IsOnline = new JoinDataComplete(new JoinData { JoinNumber = 1, JoinSpan = 1 },
|
||||||
|
new JoinMetadata { Description = "DGE Online", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
[JoinName("CurrentInputResolution")]
|
||||||
|
public JoinDataComplete CurrentInputResolution = new JoinDataComplete(new JoinData { JoinNumber = 1, JoinSpan = 1 },
|
||||||
|
new JoinMetadata { Description = "DGE Current Input Resolution", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
|
||||||
|
|
||||||
|
[JoinName("SyncDetected")]
|
||||||
|
public JoinDataComplete SyncDetected = new JoinDataComplete(new JoinData { JoinNumber = 2, JoinSpan = 1 },
|
||||||
|
new JoinMetadata { Description = "DGE Sync Detected", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
[JoinName("HdmiHdcpOn")]
|
||||||
|
public JoinDataComplete HdmiInHdcpOn = new JoinDataComplete(new JoinData { JoinNumber = 3, JoinSpan = 1 },
|
||||||
|
new JoinMetadata { Description = "DGE HDMI HDCP State On", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
[JoinName("HdmiHdcpOff")]
|
||||||
|
public JoinDataComplete HdmiInHdcpOff = new JoinDataComplete(new JoinData { JoinNumber = 4, JoinSpan = 1 },
|
||||||
|
new JoinMetadata { Description = "DGE HDMI HDCP State Off", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
[JoinName("HdmiHdcpToggle")]
|
||||||
|
public JoinDataComplete HdmiInHdcpToggle = new JoinDataComplete(new JoinData { JoinNumber = 5, JoinSpan = 1 },
|
||||||
|
new JoinMetadata { Description = "DGE HDMI HDCP State Toggle", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
public DgeJoinMap(uint joinStart)
|
||||||
|
: this(joinStart, typeof(DgeJoinMap))
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Constructor to use when extending this Join map
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="joinStart">Join this join map will start at</param>
|
||||||
|
/// <param name="type">Type of the child join map</param>
|
||||||
|
protected DgeJoinMap(uint joinStart, Type type) : base(joinStart, type)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -58,37 +58,37 @@ namespace PepperDash.Essentials.DM.Endpoints.DGEs
|
|||||||
HdmiOut.Port = _dge.HdmiOut; ;
|
HdmiOut.Port = _dge.HdmiOut; ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class DmDge200CControllerFactory : EssentialsDeviceFactory<DmDge200CController>
|
|
||||||
{
|
|
||||||
public DmDge200CControllerFactory()
|
|
||||||
{
|
|
||||||
TypeNames = new List<string>() { "dmdge200c" };
|
|
||||||
}
|
|
||||||
|
|
||||||
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
|
||||||
{
|
|
||||||
var typeName = dc.Type.ToLower();
|
|
||||||
var comm = CommFactory.GetControlPropertiesConfig(dc);
|
|
||||||
var props = JsonConvert.DeserializeObject<CrestronTouchpanelPropertiesConfig>(dc.Properties.ToString());
|
|
||||||
|
|
||||||
Debug.Console(1, "Factory Attempting to create new DgeController Device");
|
|
||||||
|
|
||||||
DmDge200C dgeDevice = null;
|
|
||||||
|
|
||||||
if (typeName == "dmdge200c")
|
|
||||||
dgeDevice = new DmDge200C(comm.IpIdInt, Global.ControlSystem);
|
|
||||||
|
|
||||||
if (dgeDevice == null)
|
|
||||||
{
|
|
||||||
Debug.Console(1, "Unable to create DGE device");
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
var dgeController = new DmDge200CController(dc.Key , dc.Name, dgeDevice, dc, props);
|
|
||||||
|
|
||||||
return dgeController;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class DmDge200CControllerFactory : EssentialsDeviceFactory<DmDge200CController>
|
||||||
|
{
|
||||||
|
public DmDge200CControllerFactory()
|
||||||
|
{
|
||||||
|
TypeNames = new List<string>() { "dmdge200c" };
|
||||||
|
}
|
||||||
|
|
||||||
|
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||||
|
{
|
||||||
|
var typeName = dc.Type.ToLower();
|
||||||
|
var comm = CommFactory.GetControlPropertiesConfig(dc);
|
||||||
|
var props = JsonConvert.DeserializeObject<CrestronTouchpanelPropertiesConfig>(dc.Properties.ToString());
|
||||||
|
|
||||||
|
Debug.Console(1, "Factory Attempting to create new DgeController Device");
|
||||||
|
|
||||||
|
DmDge200C dgeDevice = null;
|
||||||
|
|
||||||
|
if (typeName == "dmdge200c")
|
||||||
|
dgeDevice = new DmDge200C(comm.IpIdInt, Global.ControlSystem);
|
||||||
|
|
||||||
|
if (dgeDevice == null)
|
||||||
|
{
|
||||||
|
Debug.Console(1, "Unable to create DGE device");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
var dgeController = new DmDge200CController(dc.Key, dc.Name, dgeDevice, dc, props);
|
||||||
|
|
||||||
|
return dgeController;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -28,6 +28,8 @@ namespace PepperDash.Essentials.DM
|
|||||||
|
|
||||||
InputPorts = new RoutingPortCollection<RoutingInputPort> {DmIn};
|
InputPorts = new RoutingPortCollection<RoutingInputPort> {DmIn};
|
||||||
OutputPorts = new RoutingPortCollection<RoutingOutputPort> {HDBaseTSink};
|
OutputPorts = new RoutingPortCollection<RoutingOutputPort> {HDBaseTSink};
|
||||||
|
PreventRegistration = true;
|
||||||
|
rmc.Register();
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
||||||
|
|||||||
@@ -1,99 +1,99 @@
|
|||||||
using Crestron.SimplSharpPro;
|
using Crestron.SimplSharpPro;
|
||||||
using Crestron.SimplSharpPro.DeviceSupport;
|
using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
using Crestron.SimplSharpPro.DM;
|
using Crestron.SimplSharpPro.DM;
|
||||||
using Crestron.SimplSharpPro.DM.Endpoints.Receivers;
|
using Crestron.SimplSharpPro.DM.Endpoints.Receivers;
|
||||||
|
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
using PepperDash.Essentials.Core.Bridges;
|
using PepperDash.Essentials.Core.Bridges;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.DM
|
namespace PepperDash.Essentials.DM
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Builds a controller for basic DM-RMCs with Com and IR ports and no control functions
|
/// Builds a controller for basic DM-RMCs with Com and IR ports and no control functions
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Description("Wrapper Class for DM-RMC-150-S")]
|
[Description("Wrapper Class for DM-RMC-150-S")]
|
||||||
public class DmRmc150SController : DmRmcControllerBase, IRoutingInputsOutputs,
|
public class DmRmc150SController : DmRmcControllerBase, IRoutingInputsOutputs,
|
||||||
IIROutputPorts, IComPorts, ICec
|
IIROutputPorts, IComPorts, ICec
|
||||||
{
|
{
|
||||||
private readonly DmRmc150S _rmc;
|
private readonly DmRmc150S _rmc;
|
||||||
|
|
||||||
public RoutingInputPort DmIn { get; private set; }
|
public RoutingInputPort DmIn { get; private set; }
|
||||||
public RoutingOutputPort HdmiOut { get; private set; }
|
public RoutingOutputPort HdmiOut { get; private set; }
|
||||||
|
|
||||||
public RoutingPortCollection<RoutingInputPort> InputPorts
|
public RoutingPortCollection<RoutingInputPort> InputPorts
|
||||||
{
|
{
|
||||||
get; private set;
|
get; private set;
|
||||||
}
|
}
|
||||||
|
|
||||||
public RoutingPortCollection<RoutingOutputPort> OutputPorts
|
public RoutingPortCollection<RoutingOutputPort> OutputPorts
|
||||||
{
|
{
|
||||||
get;
|
get;
|
||||||
private set ;
|
private set ;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Make a Crestron RMC and put it in here
|
/// Make a Crestron RMC and put it in here
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public DmRmc150SController(string key, string name, DmRmc150S rmc)
|
public DmRmc150SController(string key, string name, DmRmc150S rmc)
|
||||||
: base(key, name, rmc)
|
: base(key, name, rmc)
|
||||||
{
|
{
|
||||||
_rmc = rmc;
|
_rmc = rmc;
|
||||||
DmIn = new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.AudioVideo,
|
DmIn = new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.AudioVideo,
|
||||||
eRoutingPortConnectionType.DmCat, 0, this);
|
eRoutingPortConnectionType.DmCat, 0, this);
|
||||||
HdmiOut = new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.AudioVideo,
|
HdmiOut = new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.AudioVideo,
|
||||||
eRoutingPortConnectionType.Hdmi, null, this);
|
eRoutingPortConnectionType.Hdmi, null, this);
|
||||||
|
|
||||||
EdidManufacturerFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.Manufacturer.StringValue);
|
EdidManufacturerFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.Manufacturer.StringValue);
|
||||||
EdidNameFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.Name.StringValue);
|
EdidNameFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.Name.StringValue);
|
||||||
EdidPreferredTimingFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.PreferredTiming.StringValue);
|
EdidPreferredTimingFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.PreferredTiming.StringValue);
|
||||||
EdidSerialNumberFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.SerialNumber.StringValue);
|
EdidSerialNumberFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.SerialNumber.StringValue);
|
||||||
|
|
||||||
InputPorts = new RoutingPortCollection<RoutingInputPort> {DmIn};
|
InputPorts = new RoutingPortCollection<RoutingInputPort> {DmIn};
|
||||||
OutputPorts = new RoutingPortCollection<RoutingOutputPort> {HdmiOut};
|
OutputPorts = new RoutingPortCollection<RoutingOutputPort> {HdmiOut};
|
||||||
|
|
||||||
_rmc.HdmiOutput.ConnectedDevice.DeviceInformationChange += ConnectedDevice_DeviceInformationChange;
|
_rmc.HdmiOutput.ConnectedDevice.DeviceInformationChange += ConnectedDevice_DeviceInformationChange;
|
||||||
|
|
||||||
// Set Ports for CEC
|
// Set Ports for CEC
|
||||||
HdmiOut.Port = _rmc.HdmiOutput;
|
HdmiOut.Port = _rmc.HdmiOutput;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConnectedDevice_DeviceInformationChange(ConnectedDeviceInformation connectedDevice, ConnectedDeviceEventArgs args)
|
void ConnectedDevice_DeviceInformationChange(ConnectedDeviceInformation connectedDevice, ConnectedDeviceEventArgs args)
|
||||||
{
|
{
|
||||||
switch (args.EventId)
|
switch (args.EventId)
|
||||||
{
|
{
|
||||||
case ConnectedDeviceEventIds.ManufacturerEventId:
|
case ConnectedDeviceEventIds.ManufacturerEventId:
|
||||||
EdidManufacturerFeedback.FireUpdate();
|
EdidManufacturerFeedback.FireUpdate();
|
||||||
break;
|
break;
|
||||||
case ConnectedDeviceEventIds.NameEventId:
|
case ConnectedDeviceEventIds.NameEventId:
|
||||||
EdidNameFeedback.FireUpdate();
|
EdidNameFeedback.FireUpdate();
|
||||||
break;
|
break;
|
||||||
case ConnectedDeviceEventIds.PreferredTimingEventId:
|
case ConnectedDeviceEventIds.PreferredTimingEventId:
|
||||||
EdidPreferredTimingFeedback.FireUpdate();
|
EdidPreferredTimingFeedback.FireUpdate();
|
||||||
break;
|
break;
|
||||||
case ConnectedDeviceEventIds.SerialNumberEventId:
|
case ConnectedDeviceEventIds.SerialNumberEventId:
|
||||||
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)
|
||||||
{
|
{
|
||||||
LinkDmRmcToApi(this, trilist, joinStart, joinMapKey, bridge);
|
LinkDmRmcToApi(this, trilist, joinStart, joinMapKey, bridge);
|
||||||
}
|
}
|
||||||
|
|
||||||
#region IIROutputPorts Members
|
#region IIROutputPorts Members
|
||||||
public CrestronCollection<IROutputPort> IROutputPorts { get { return _rmc.IROutputPorts; } }
|
public CrestronCollection<IROutputPort> IROutputPorts { get { return _rmc.IROutputPorts; } }
|
||||||
public int NumberOfIROutputPorts { get { return _rmc.NumberOfIROutputPorts; } }
|
public int NumberOfIROutputPorts { get { return _rmc.NumberOfIROutputPorts; } }
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region IComPorts Members
|
#region IComPorts Members
|
||||||
public CrestronCollection<ComPort> ComPorts { get { return _rmc.ComPorts; } }
|
public CrestronCollection<ComPort> ComPorts { get { return _rmc.ComPorts; } }
|
||||||
public int NumberOfComPorts { get { return _rmc.NumberOfComPorts; } }
|
public int NumberOfComPorts { get { return _rmc.NumberOfComPorts; } }
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region ICec Members
|
#region ICec Members
|
||||||
public Cec StreamCec { get { return _rmc.HdmiOutput.StreamCec; } }
|
public Cec StreamCec { get { return _rmc.HdmiOutput.StreamCec; } }
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,111 +1,111 @@
|
|||||||
using Crestron.SimplSharpPro;
|
using Crestron.SimplSharpPro;
|
||||||
using Crestron.SimplSharpPro.DeviceSupport;
|
using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
using Crestron.SimplSharpPro.DM;
|
using Crestron.SimplSharpPro.DM;
|
||||||
using Crestron.SimplSharpPro.DM.Endpoints;
|
using Crestron.SimplSharpPro.DM.Endpoints;
|
||||||
using Crestron.SimplSharpPro.DM.Endpoints.Receivers;
|
using Crestron.SimplSharpPro.DM.Endpoints.Receivers;
|
||||||
|
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
using PepperDash.Essentials.Core.Bridges;
|
using PepperDash.Essentials.Core.Bridges;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.DM
|
namespace PepperDash.Essentials.DM
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Builds a controller for basic DM-RMCs with Com and IR ports and no control functions
|
/// Builds a controller for basic DM-RMCs with Com and IR ports and no control functions
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Description("Wrapper Class for DM-RMC-200-C")]
|
[Description("Wrapper Class for DM-RMC-200-C")]
|
||||||
public class DmRmc200CController : DmRmcControllerBase, IRoutingInputsOutputs,
|
public class DmRmc200CController : DmRmcControllerBase, IRoutingInputsOutputs,
|
||||||
IIROutputPorts, IComPorts, ICec
|
IIROutputPorts, IComPorts, ICec
|
||||||
{
|
{
|
||||||
private readonly DmRmc200C _rmc;
|
private readonly DmRmc200C _rmc;
|
||||||
|
|
||||||
public RoutingInputPort DmIn { get; private set; }
|
public RoutingInputPort DmIn { get; private set; }
|
||||||
public RoutingOutputPort HdmiOut { get; private set; }
|
public RoutingOutputPort HdmiOut { get; private set; }
|
||||||
|
|
||||||
public RoutingPortCollection<RoutingInputPort> InputPorts
|
public RoutingPortCollection<RoutingInputPort> InputPorts
|
||||||
{
|
{
|
||||||
get; private set;
|
get; private set;
|
||||||
}
|
}
|
||||||
|
|
||||||
public RoutingPortCollection<RoutingOutputPort> OutputPorts
|
public RoutingPortCollection<RoutingOutputPort> OutputPorts
|
||||||
{
|
{
|
||||||
get; private set;
|
get; private set;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Make a Crestron RMC and put it in here
|
/// Make a Crestron RMC and put it in here
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public DmRmc200CController(string key, string name, DmRmc200C rmc)
|
public DmRmc200CController(string key, string name, DmRmc200C rmc)
|
||||||
: base(key, name, rmc)
|
: base(key, name, rmc)
|
||||||
{
|
{
|
||||||
_rmc = rmc;
|
_rmc = rmc;
|
||||||
DmIn = new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.AudioVideo,
|
DmIn = new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.AudioVideo,
|
||||||
eRoutingPortConnectionType.DmCat, 0, this);
|
eRoutingPortConnectionType.DmCat, 0, this);
|
||||||
HdmiOut = new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.AudioVideo,
|
HdmiOut = new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.AudioVideo,
|
||||||
eRoutingPortConnectionType.Hdmi, null, this);
|
eRoutingPortConnectionType.Hdmi, null, this);
|
||||||
|
|
||||||
EdidManufacturerFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.Manufacturer.StringValue);
|
EdidManufacturerFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.Manufacturer.StringValue);
|
||||||
EdidNameFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.Name.StringValue);
|
EdidNameFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.Name.StringValue);
|
||||||
EdidPreferredTimingFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.PreferredTiming.StringValue);
|
EdidPreferredTimingFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.PreferredTiming.StringValue);
|
||||||
EdidSerialNumberFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.SerialNumber.StringValue);
|
EdidSerialNumberFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.SerialNumber.StringValue);
|
||||||
|
|
||||||
VideoOutputResolutionFeedback = new StringFeedback(() => _rmc.HdmiOutput.GetVideoResolutionString());
|
VideoOutputResolutionFeedback = new StringFeedback(() => _rmc.HdmiOutput.GetVideoResolutionString());
|
||||||
|
|
||||||
_rmc.HdmiOutput.OutputStreamChange += HdmiOutput_OutputStreamChange;
|
_rmc.HdmiOutput.OutputStreamChange += HdmiOutput_OutputStreamChange;
|
||||||
_rmc.HdmiOutput.ConnectedDevice.DeviceInformationChange += ConnectedDevice_DeviceInformationChange;
|
_rmc.HdmiOutput.ConnectedDevice.DeviceInformationChange += ConnectedDevice_DeviceInformationChange;
|
||||||
|
|
||||||
InputPorts = new RoutingPortCollection<RoutingInputPort> {DmIn};
|
InputPorts = new RoutingPortCollection<RoutingInputPort> {DmIn};
|
||||||
OutputPorts = new RoutingPortCollection<RoutingOutputPort> {HdmiOut};
|
OutputPorts = new RoutingPortCollection<RoutingOutputPort> {HdmiOut};
|
||||||
|
|
||||||
// Set Ports for CEC
|
// Set Ports for CEC
|
||||||
HdmiOut.Port = _rmc.HdmiOutput;
|
HdmiOut.Port = _rmc.HdmiOutput;
|
||||||
}
|
}
|
||||||
|
|
||||||
void HdmiOutput_OutputStreamChange(EndpointOutputStream outputStream, EndpointOutputStreamEventArgs args)
|
void HdmiOutput_OutputStreamChange(EndpointOutputStream outputStream, EndpointOutputStreamEventArgs args)
|
||||||
{
|
{
|
||||||
if (args.EventId == EndpointOutputStreamEventIds.HorizontalResolutionFeedbackEventId || args.EventId == EndpointOutputStreamEventIds.VerticalResolutionFeedbackEventId ||
|
if (args.EventId == EndpointOutputStreamEventIds.HorizontalResolutionFeedbackEventId || args.EventId == EndpointOutputStreamEventIds.VerticalResolutionFeedbackEventId ||
|
||||||
args.EventId == EndpointOutputStreamEventIds.FramesPerSecondFeedbackEventId)
|
args.EventId == EndpointOutputStreamEventIds.FramesPerSecondFeedbackEventId)
|
||||||
{
|
{
|
||||||
VideoOutputResolutionFeedback.FireUpdate();
|
VideoOutputResolutionFeedback.FireUpdate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConnectedDevice_DeviceInformationChange(ConnectedDeviceInformation connectedDevice, ConnectedDeviceEventArgs args)
|
void ConnectedDevice_DeviceInformationChange(ConnectedDeviceInformation connectedDevice, ConnectedDeviceEventArgs args)
|
||||||
{
|
{
|
||||||
switch (args.EventId)
|
switch (args.EventId)
|
||||||
{
|
{
|
||||||
case ConnectedDeviceEventIds.ManufacturerEventId:
|
case ConnectedDeviceEventIds.ManufacturerEventId:
|
||||||
EdidManufacturerFeedback.FireUpdate();
|
EdidManufacturerFeedback.FireUpdate();
|
||||||
break;
|
break;
|
||||||
case ConnectedDeviceEventIds.NameEventId:
|
case ConnectedDeviceEventIds.NameEventId:
|
||||||
EdidNameFeedback.FireUpdate();
|
EdidNameFeedback.FireUpdate();
|
||||||
break;
|
break;
|
||||||
case ConnectedDeviceEventIds.PreferredTimingEventId:
|
case ConnectedDeviceEventIds.PreferredTimingEventId:
|
||||||
EdidPreferredTimingFeedback.FireUpdate();
|
EdidPreferredTimingFeedback.FireUpdate();
|
||||||
break;
|
break;
|
||||||
case ConnectedDeviceEventIds.SerialNumberEventId:
|
case ConnectedDeviceEventIds.SerialNumberEventId:
|
||||||
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)
|
||||||
{
|
{
|
||||||
LinkDmRmcToApi(this, trilist, joinStart, joinMapKey, bridge);
|
LinkDmRmcToApi(this, trilist, joinStart, joinMapKey, bridge);
|
||||||
}
|
}
|
||||||
|
|
||||||
#region IIROutputPorts Members
|
#region IIROutputPorts Members
|
||||||
public CrestronCollection<IROutputPort> IROutputPorts { get { return _rmc.IROutputPorts; } }
|
public CrestronCollection<IROutputPort> IROutputPorts { get { return _rmc.IROutputPorts; } }
|
||||||
public int NumberOfIROutputPorts { get { return _rmc.NumberOfIROutputPorts; } }
|
public int NumberOfIROutputPorts { get { return _rmc.NumberOfIROutputPorts; } }
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region IComPorts Members
|
#region IComPorts Members
|
||||||
public CrestronCollection<ComPort> ComPorts { get { return _rmc.ComPorts; } }
|
public CrestronCollection<ComPort> ComPorts { get { return _rmc.ComPorts; } }
|
||||||
public int NumberOfComPorts { get { return _rmc.NumberOfComPorts; } }
|
public int NumberOfComPorts { get { return _rmc.NumberOfComPorts; } }
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region ICec Members
|
#region ICec Members
|
||||||
public Cec StreamCec { get { return _rmc.HdmiOutput.StreamCec; } }
|
public Cec StreamCec { get { return _rmc.HdmiOutput.StreamCec; } }
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -32,7 +32,9 @@ namespace PepperDash.Essentials.DM
|
|||||||
eRoutingPortConnectionType.Hdmi, null, this) {Port = _rmc};
|
eRoutingPortConnectionType.Hdmi, null, this) {Port = _rmc};
|
||||||
|
|
||||||
InputPorts = new RoutingPortCollection<RoutingInputPort> {DmIn};
|
InputPorts = new RoutingPortCollection<RoutingInputPort> {DmIn};
|
||||||
OutputPorts = new RoutingPortCollection<RoutingOutputPort> {HdmiOut};
|
OutputPorts = new RoutingPortCollection<RoutingOutputPort> {HdmiOut};
|
||||||
|
PreventRegistration = true;
|
||||||
|
rmc.Register();
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
||||||
|
|||||||
@@ -329,6 +329,9 @@ namespace PepperDash.Essentials.DM
|
|||||||
DmRmcPropertiesConfig props, string pKey, uint ipid)
|
DmRmcPropertiesConfig props, string pKey, uint ipid)
|
||||||
{
|
{
|
||||||
var parentDev = DeviceManager.GetDeviceForKey(pKey);
|
var parentDev = DeviceManager.GetDeviceForKey(pKey);
|
||||||
|
CrestronGenericBaseDevice rx;
|
||||||
|
bool useChassisForOfflineFeedback = false;
|
||||||
|
|
||||||
if (parentDev is DmpsRoutingController)
|
if (parentDev is DmpsRoutingController)
|
||||||
{
|
{
|
||||||
var dmps = parentDev as DmpsRoutingController;
|
var dmps = parentDev as DmpsRoutingController;
|
||||||
@@ -342,22 +345,33 @@ namespace PepperDash.Essentials.DM
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
// Must use different constructor for DMPS4K types. No IPID
|
// Must use different constructor for DMPS4K types. No IPID
|
||||||
if (Global.ControlSystemIsDmps4kType || typeName == "hdbasetrx" || typeName == "dmrmc4k100c1g")
|
if (Global.ControlSystemIsDmps4kType)
|
||||||
{
|
{
|
||||||
var rmc = GetDmRmcControllerForDmps4k(key, name, typeName, dmps, props.ParentOutputNumber);
|
rx = GetDmRmcControllerForDmps4k(key, name, typeName, dmps, props.ParentOutputNumber);
|
||||||
Debug.Console(0, "DM endpoint output {0} is for Dmps4k, changing online feedback to chassis", num);
|
useChassisForOfflineFeedback = true;
|
||||||
rmc.IsOnline.SetValueFunc(() => dmps.OutputEndpointOnlineFeedbacks[num].BoolValue);
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
rx = GetDmRmcControllerForDmps(key, name, typeName, ipid, dmps, props.ParentOutputNumber);
|
||||||
|
if (typeName == "hdbasetrx" || typeName == "dmrmc4k100c1g")
|
||||||
|
{
|
||||||
|
useChassisForOfflineFeedback = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (useChassisForOfflineFeedback)
|
||||||
|
{
|
||||||
|
Debug.Console(0, "DM endpoint output {0} does not have direct online feedback, changing online feedback to chassis", num);
|
||||||
|
rx.IsOnline.SetValueFunc(() => dmps.OutputEndpointOnlineFeedbacks[num].BoolValue);
|
||||||
dmps.OutputEndpointOnlineFeedbacks[num].OutputChange += (o, a) =>
|
dmps.OutputEndpointOnlineFeedbacks[num].OutputChange += (o, a) =>
|
||||||
{
|
{
|
||||||
foreach (var feedback in rmc.Feedbacks)
|
foreach (var feedback in rx.Feedbacks)
|
||||||
{
|
{
|
||||||
if (feedback != null)
|
if (feedback != null)
|
||||||
feedback.FireUpdate();
|
feedback.FireUpdate();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
return rmc;
|
|
||||||
}
|
}
|
||||||
return GetDmRmcControllerForDmps(key, name, typeName, ipid, dmps, props.ParentOutputNumber);
|
return rx;
|
||||||
}
|
}
|
||||||
else if (parentDev is DmChassisController)
|
else if (parentDev is DmChassisController)
|
||||||
{
|
{
|
||||||
@@ -380,23 +394,33 @@ namespace PepperDash.Essentials.DM
|
|||||||
if (chassis is DmMd8x8Cpu3 || chassis is DmMd16x16Cpu3 ||
|
if (chassis is DmMd8x8Cpu3 || chassis is DmMd16x16Cpu3 ||
|
||||||
chassis is DmMd32x32Cpu3 || chassis is DmMd8x8Cpu3rps ||
|
chassis is DmMd32x32Cpu3 || chassis is DmMd8x8Cpu3rps ||
|
||||||
chassis is DmMd16x16Cpu3rps || chassis is DmMd32x32Cpu3rps ||
|
chassis is DmMd16x16Cpu3rps || chassis is DmMd32x32Cpu3rps ||
|
||||||
chassis is DmMd128x128 || chassis is DmMd64x64
|
chassis is DmMd128x128 || chassis is DmMd64x64)
|
||||||
|| typeName == "hdbasetrx" || typeName == "dmrmc4k100c1g")
|
|
||||||
{
|
{
|
||||||
var rmc = GetDmRmcControllerForCpu3Chassis(key, name, typeName, chassis, num, parentDev);
|
rx = GetDmRmcControllerForCpu3Chassis(key, name, typeName, chassis, num, parentDev);
|
||||||
Debug.Console(0, "DM endpoint output {0} is for Cpu3, changing online feedback to chassis", num);
|
useChassisForOfflineFeedback = true;
|
||||||
rmc.IsOnline.SetValueFunc(() => controller.OutputEndpointOnlineFeedbacks[num].BoolValue);
|
|
||||||
controller.OutputEndpointOnlineFeedbacks[num].OutputChange += (o, a) =>
|
|
||||||
{
|
|
||||||
foreach (var feedback in rmc.Feedbacks)
|
|
||||||
{
|
|
||||||
if (feedback != null)
|
|
||||||
feedback.FireUpdate();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
return rmc;
|
|
||||||
}
|
}
|
||||||
return GetDmRmcControllerForCpu2Chassis(key, name, typeName, ipid, chassis, num, parentDev);
|
else
|
||||||
|
{
|
||||||
|
rx = GetDmRmcControllerForCpu2Chassis(key, name, typeName, ipid, chassis, num, parentDev);
|
||||||
|
if (typeName == "hdbasetrx" || typeName == "dmrmc4k100c1g")
|
||||||
|
{
|
||||||
|
useChassisForOfflineFeedback = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (useChassisForOfflineFeedback)
|
||||||
|
{
|
||||||
|
Debug.Console(0, "DM endpoint output {0} does not have direct online feedback, changing online feedback to chassis", num);
|
||||||
|
rx.IsOnline.SetValueFunc(() => controller.OutputEndpointOnlineFeedbacks[num].BoolValue);
|
||||||
|
controller.OutputEndpointOnlineFeedbacks[num].OutputChange += (o, a) =>
|
||||||
|
{
|
||||||
|
foreach (var feedback in rx.Feedbacks)
|
||||||
|
{
|
||||||
|
if (feedback != null)
|
||||||
|
feedback.FireUpdate();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return rx;
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
@@ -499,9 +523,7 @@ namespace PepperDash.Essentials.DM
|
|||||||
Debug.Console(0, "[{0}] WARNING: Cannot create DM-RMC device: {1}", key, e.Message);
|
Debug.Console(0, "[{0}] WARNING: Cannot create DM-RMC device: {1}", key, e.Message);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class DmRmcControllerFactory : EssentialsDeviceFactory<DmRmcControllerBase>
|
public class DmRmcControllerFactory : EssentialsDeviceFactory<DmRmcControllerBase>
|
||||||
|
|||||||
@@ -1,41 +1,41 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Crestron.SimplSharpPro;
|
using Crestron.SimplSharpPro;
|
||||||
using Crestron.SimplSharpPro.DeviceSupport;
|
using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
using Crestron.SimplSharpPro.DM;
|
using Crestron.SimplSharpPro.DM;
|
||||||
using Crestron.SimplSharpPro.DM.Endpoints;
|
using Crestron.SimplSharpPro.DM.Endpoints;
|
||||||
using Crestron.SimplSharpPro.DM.Endpoints.Transmitters;
|
using Crestron.SimplSharpPro.DM.Endpoints.Transmitters;
|
||||||
|
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
using PepperDash.Essentials.Core.Bridges;
|
using PepperDash.Essentials.Core.Bridges;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.DM
|
namespace PepperDash.Essentials.DM
|
||||||
{
|
{
|
||||||
// using eVst = Crestron.SimplSharpPro.DeviceSupport.eX02VideoSourceType;
|
// 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>
|
||||||
[Description("Wrapper class for DM-TX-200-C")]
|
[Description("Wrapper class for DM-TX-200-C")]
|
||||||
public class DmTx200Controller : DmTxControllerBase, ITxRoutingWithFeedback, IHasFreeRun, IVgaBrightnessContrastControls
|
public class DmTx200Controller : DmTxControllerBase, ITxRoutingWithFeedback, IHasFreeRun, IVgaBrightnessContrastControls
|
||||||
{
|
{
|
||||||
public DmTx200C2G Tx { get; private set; }
|
public DmTx200C2G 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; }
|
||||||
public RoutingOutputPort DmOutput { get; private set; }
|
public RoutingOutputPort DmOutput { get; private set; }
|
||||||
|
|
||||||
public override StringFeedback ActiveVideoInputFeedback { get; protected set; }
|
public override StringFeedback ActiveVideoInputFeedback { get; protected set; }
|
||||||
public IntFeedback VideoSourceNumericFeedback { get; protected set; }
|
public IntFeedback VideoSourceNumericFeedback { get; protected set; }
|
||||||
public IntFeedback AudioSourceNumericFeedback { get; protected set; }
|
public IntFeedback AudioSourceNumericFeedback { get; protected set; }
|
||||||
public IntFeedback HdmiInHdcpCapabilityFeedback { get; protected set; } //actually state
|
public IntFeedback HdmiInHdcpCapabilityFeedback { get; protected set; } //actually state
|
||||||
public BoolFeedback HdmiVideoSyncFeedback { get; protected set; }
|
public BoolFeedback HdmiVideoSyncFeedback { get; protected set; }
|
||||||
public BoolFeedback VgaVideoSyncFeedback { get; protected set; }
|
public BoolFeedback VgaVideoSyncFeedback { get; protected set; }
|
||||||
|
|
||||||
public BoolFeedback FreeRunEnabledFeedback { get; protected set; }
|
public BoolFeedback FreeRunEnabledFeedback { get; protected set; }
|
||||||
|
|
||||||
public IntFeedback VgaBrightnessFeedback { get; protected set; }
|
public IntFeedback VgaBrightnessFeedback { get; protected set; }
|
||||||
public IntFeedback VgaContrastFeedback { get; protected set; }
|
public IntFeedback VgaContrastFeedback { get; protected set; }
|
||||||
|
|
||||||
//IroutingNumericEvent
|
//IroutingNumericEvent
|
||||||
@@ -49,57 +49,57 @@ namespace PepperDash.Essentials.DM
|
|||||||
{
|
{
|
||||||
var newEvent = NumericSwitchChange;
|
var newEvent = NumericSwitchChange;
|
||||||
if (newEvent != null) newEvent(this, e);
|
if (newEvent != null) newEvent(this, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Helps get the "real" inputs, including when in Auto
|
/// Helps get the "real" inputs, including when in Auto
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public DmTx200Base.eSourceSelection ActualActiveVideoInput
|
public DmTx200Base.eSourceSelection ActualActiveVideoInput
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
if (Tx.VideoSourceFeedback == DmTx200Base.eSourceSelection.Digital ||
|
if (Tx.VideoSourceFeedback == DmTx200Base.eSourceSelection.Digital ||
|
||||||
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;
|
||||||
if (Tx.HdmiInput.SyncDetectedFeedback.BoolValue)
|
if (Tx.HdmiInput.SyncDetectedFeedback.BoolValue)
|
||||||
return DmTx200Base.eSourceSelection.Digital;
|
return DmTx200Base.eSourceSelection.Digital;
|
||||||
|
|
||||||
return Tx.VgaInput.SyncDetectedFeedback.BoolValue ? DmTx200Base.eSourceSelection.Analog : DmTx200Base.eSourceSelection.Disable;
|
return Tx.VgaInput.SyncDetectedFeedback.BoolValue ? DmTx200Base.eSourceSelection.Analog : DmTx200Base.eSourceSelection.Disable;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public RoutingPortCollection<RoutingInputPort> InputPorts
|
public RoutingPortCollection<RoutingInputPort> InputPorts
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return new RoutingPortCollection<RoutingInputPort>
|
return new RoutingPortCollection<RoutingInputPort>
|
||||||
{
|
{
|
||||||
HdmiInput,
|
HdmiInput,
|
||||||
VgaInput,
|
VgaInput,
|
||||||
AnyVideoInput
|
AnyVideoInput
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public RoutingPortCollection<RoutingOutputPort> OutputPorts
|
public RoutingPortCollection<RoutingOutputPort> OutputPorts
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return new RoutingPortCollection<RoutingOutputPort> { DmOutput };
|
return new RoutingPortCollection<RoutingOutputPort> { DmOutput };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="key"></param>
|
/// <param name="key"></param>
|
||||||
/// <param name="name"></param>
|
/// <param name="name"></param>
|
||||||
/// <param name="tx"></param>
|
/// <param name="tx"></param>
|
||||||
public DmTx200Controller(string key, string name, DmTx200C2G tx, bool preventRegistration)
|
public DmTx200Controller(string key, string name, DmTx200C2G tx, bool preventRegistration)
|
||||||
: base(key, name, tx)
|
: base(key, name, tx)
|
||||||
{
|
{
|
||||||
Tx = tx;
|
Tx = tx;
|
||||||
PreventRegistration = preventRegistration;
|
PreventRegistration = preventRegistration;
|
||||||
|
|
||||||
@@ -116,300 +116,300 @@ namespace PepperDash.Essentials.DM
|
|||||||
VideoStatusHelper.GetVgaInputStatusFuncs(tx.VgaInput))
|
VideoStatusHelper.GetVgaInputStatusFuncs(tx.VgaInput))
|
||||||
{
|
{
|
||||||
FeedbackMatchObject = DmTx200Base.eSourceSelection.Analog
|
FeedbackMatchObject = DmTx200Base.eSourceSelection.Analog
|
||||||
};
|
};
|
||||||
|
|
||||||
ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput",
|
ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput",
|
||||||
() => ActualActiveVideoInput.ToString());
|
() => ActualActiveVideoInput.ToString());
|
||||||
|
|
||||||
Tx.HdmiInput.InputStreamChange += InputStreamChangeEvent;
|
Tx.HdmiInput.InputStreamChange += InputStreamChangeEvent;
|
||||||
Tx.VgaInput.InputStreamChange += VgaInputOnInputStreamChange;
|
Tx.VgaInput.InputStreamChange += VgaInputOnInputStreamChange;
|
||||||
Tx.BaseEvent += Tx_BaseEvent;
|
Tx.BaseEvent += Tx_BaseEvent;
|
||||||
Tx.OnlineStatusChange += Tx_OnlineStatusChange;
|
Tx.OnlineStatusChange += Tx_OnlineStatusChange;
|
||||||
|
|
||||||
VideoSourceNumericFeedback = new IntFeedback(() => (int)Tx.VideoSourceFeedback);
|
VideoSourceNumericFeedback = new IntFeedback(() => (int)Tx.VideoSourceFeedback);
|
||||||
AudioSourceNumericFeedback = new IntFeedback(() => (int)Tx.AudioSourceFeedback);
|
AudioSourceNumericFeedback = new IntFeedback(() => (int)Tx.AudioSourceFeedback);
|
||||||
|
|
||||||
HdmiInHdcpCapabilityFeedback = new IntFeedback("HdmiInHdcpCapability", () => tx.HdmiInput.HdcpSupportOnFeedback.BoolValue ? 1 : 0);
|
HdmiInHdcpCapabilityFeedback = new IntFeedback("HdmiInHdcpCapability", () => tx.HdmiInput.HdcpSupportOnFeedback.BoolValue ? 1 : 0);
|
||||||
|
|
||||||
//setting this on the base class so that we can get it easily on the chassis.
|
//setting this on the base class so that we can get it easily on the chassis.
|
||||||
HdcpStateFeedback = HdmiInHdcpCapabilityFeedback;
|
HdcpStateFeedback = HdmiInHdcpCapabilityFeedback;
|
||||||
|
|
||||||
HdcpSupportCapability = eHdcpCapabilityType.HdcpAutoSupport;
|
HdcpSupportCapability = eHdcpCapabilityType.HdcpAutoSupport;
|
||||||
|
|
||||||
HdmiVideoSyncFeedback = new BoolFeedback(() => tx.HdmiInput.SyncDetectedFeedback.BoolValue);
|
HdmiVideoSyncFeedback = new BoolFeedback(() => tx.HdmiInput.SyncDetectedFeedback.BoolValue);
|
||||||
|
|
||||||
VgaVideoSyncFeedback = new BoolFeedback(() => tx.VgaInput.SyncDetectedFeedback.BoolValue);
|
VgaVideoSyncFeedback = new BoolFeedback(() => 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 += VideoControls_ControlChange;
|
tx.VgaInput.VideoControls.ControlChange += VideoControls_ControlChange;
|
||||||
|
|
||||||
|
|
||||||
var combinedFuncs = new VideoStatusFuncsWrapper
|
var combinedFuncs = new VideoStatusFuncsWrapper
|
||||||
{
|
{
|
||||||
HdcpActiveFeedbackFunc = () =>
|
HdcpActiveFeedbackFunc = () =>
|
||||||
(ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital
|
(ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital
|
||||||
&& tx.HdmiInput.VideoAttributes.HdcpActiveFeedback.BoolValue),
|
&& tx.HdmiInput.VideoAttributes.HdcpActiveFeedback.BoolValue),
|
||||||
|
|
||||||
HdcpStateFeedbackFunc = () => ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital ? tx.HdmiInput.VideoAttributes.HdcpStateFeedback.ToString() : "",
|
HdcpStateFeedbackFunc = () => ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital ? tx.HdmiInput.VideoAttributes.HdcpStateFeedback.ToString() : "",
|
||||||
|
|
||||||
VideoResolutionFeedbackFunc = () =>
|
VideoResolutionFeedbackFunc = () =>
|
||||||
{
|
{
|
||||||
if (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital)
|
if (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital)
|
||||||
return tx.HdmiInput.VideoAttributes.GetVideoResolutionString();
|
return tx.HdmiInput.VideoAttributes.GetVideoResolutionString();
|
||||||
return ActualActiveVideoInput == DmTx200Base.eSourceSelection.Analog ? tx.VgaInput.VideoAttributes.GetVideoResolutionString() : "";
|
return ActualActiveVideoInput == DmTx200Base.eSourceSelection.Analog ? tx.VgaInput.VideoAttributes.GetVideoResolutionString() : "";
|
||||||
},
|
},
|
||||||
VideoSyncFeedbackFunc = () =>
|
VideoSyncFeedbackFunc = () =>
|
||||||
(ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital
|
(ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital
|
||||||
&& tx.HdmiInput.SyncDetectedFeedback.BoolValue)
|
&& tx.HdmiInput.SyncDetectedFeedback.BoolValue)
|
||||||
|| (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Analog
|
|| (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Analog
|
||||||
&& tx.VgaInput.SyncDetectedFeedback.BoolValue)
|
&& tx.VgaInput.SyncDetectedFeedback.BoolValue)
|
||||||
|| (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Auto
|
|| (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Auto
|
||||||
&& (tx.VgaInput.SyncDetectedFeedback.BoolValue || tx.HdmiInput.SyncDetectedFeedback.BoolValue))
|
&& (tx.VgaInput.SyncDetectedFeedback.BoolValue || tx.HdmiInput.SyncDetectedFeedback.BoolValue))
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
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,
|
DmOutput = new RoutingOutputPort(DmPortName.DmOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
|
||||||
eRoutingPortConnectionType.DmCat, null, this);
|
eRoutingPortConnectionType.DmCat, null, this);
|
||||||
|
|
||||||
AddToFeedbackList(ActiveVideoInputFeedback, VideoSourceNumericFeedback, AudioSourceNumericFeedback,
|
AddToFeedbackList(ActiveVideoInputFeedback, VideoSourceNumericFeedback, AudioSourceNumericFeedback,
|
||||||
AnyVideoInput.VideoStatus.HasVideoStatusFeedback, AnyVideoInput.VideoStatus.HdcpActiveFeedback,
|
AnyVideoInput.VideoStatus.HasVideoStatusFeedback, AnyVideoInput.VideoStatus.HdcpActiveFeedback,
|
||||||
AnyVideoInput.VideoStatus.HdcpStateFeedback, AnyVideoInput.VideoStatus.VideoResolutionFeedback,
|
AnyVideoInput.VideoStatus.HdcpStateFeedback, AnyVideoInput.VideoStatus.VideoResolutionFeedback,
|
||||||
AnyVideoInput.VideoStatus.VideoSyncFeedback, HdmiInHdcpCapabilityFeedback, HdmiVideoSyncFeedback,
|
AnyVideoInput.VideoStatus.VideoSyncFeedback, HdmiInHdcpCapabilityFeedback, HdmiVideoSyncFeedback,
|
||||||
VgaVideoSyncFeedback);
|
VgaVideoSyncFeedback);
|
||||||
|
|
||||||
// Set Ports for CEC
|
// Set Ports for CEC
|
||||||
HdmiInput.Port = Tx.HdmiInput;
|
HdmiInput.Port = Tx.HdmiInput;
|
||||||
VgaInput.Port = Tx.VgaInput;
|
VgaInput.Port = Tx.VgaInput;
|
||||||
DmOutput.Port = Tx.DmOutput;
|
DmOutput.Port = Tx.DmOutput;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void VgaInputOnInputStreamChange(EndpointInputStream inputStream, EndpointInputStreamEventArgs args)
|
private void VgaInputOnInputStreamChange(EndpointInputStream inputStream, EndpointInputStreamEventArgs args)
|
||||||
{
|
{
|
||||||
switch (args.EventId)
|
switch (args.EventId)
|
||||||
{
|
{
|
||||||
case EndpointInputStreamEventIds.FreeRunFeedbackEventId:
|
case EndpointInputStreamEventIds.FreeRunFeedbackEventId:
|
||||||
FreeRunEnabledFeedback.FireUpdate();
|
FreeRunEnabledFeedback.FireUpdate();
|
||||||
break;
|
break;
|
||||||
case EndpointInputStreamEventIds.SyncDetectedFeedbackEventId:
|
case EndpointInputStreamEventIds.SyncDetectedFeedbackEventId:
|
||||||
VgaVideoSyncFeedback.FireUpdate();
|
VgaVideoSyncFeedback.FireUpdate();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void VideoControls_ControlChange(object sender, 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);
|
||||||
|
|
||||||
switch (id)
|
switch (id)
|
||||||
{
|
{
|
||||||
case VideoControlsEventIds.BrightnessFeedbackEventId:
|
case VideoControlsEventIds.BrightnessFeedbackEventId:
|
||||||
VgaBrightnessFeedback.FireUpdate();
|
VgaBrightnessFeedback.FireUpdate();
|
||||||
break;
|
break;
|
||||||
case VideoControlsEventIds.ContrastFeedbackEventId:
|
case VideoControlsEventIds.ContrastFeedbackEventId:
|
||||||
VgaContrastFeedback.FireUpdate();
|
VgaContrastFeedback.FireUpdate();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Tx_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args)
|
void Tx_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args)
|
||||||
{
|
{
|
||||||
var localVideoInputPort =
|
var localVideoInputPort =
|
||||||
InputPorts.FirstOrDefault(p => (DmTx200Base.eSourceSelection) p.Selector == Tx.VideoSourceFeedback);
|
InputPorts.FirstOrDefault(p => (DmTx200Base.eSourceSelection) p.Selector == Tx.VideoSourceFeedback);
|
||||||
var localAudioInputPort =
|
var localAudioInputPort =
|
||||||
InputPorts.FirstOrDefault(p => (DmTx200Base.eSourceSelection) p.Selector == Tx.AudioSourceFeedback);
|
InputPorts.FirstOrDefault(p => (DmTx200Base.eSourceSelection) p.Selector == Tx.AudioSourceFeedback);
|
||||||
|
|
||||||
|
|
||||||
ActiveVideoInputFeedback.FireUpdate();
|
ActiveVideoInputFeedback.FireUpdate();
|
||||||
VideoSourceNumericFeedback.FireUpdate();
|
VideoSourceNumericFeedback.FireUpdate();
|
||||||
AudioSourceNumericFeedback.FireUpdate();
|
AudioSourceNumericFeedback.FireUpdate();
|
||||||
OnSwitchChange(new RoutingNumericEventArgs(1, VideoSourceNumericFeedback.UShortValue, OutputPorts.First(), localVideoInputPort, eRoutingSignalType.Video));
|
OnSwitchChange(new RoutingNumericEventArgs(1, VideoSourceNumericFeedback.UShortValue, OutputPorts.First(), localVideoInputPort, eRoutingSignalType.Video));
|
||||||
OnSwitchChange(new RoutingNumericEventArgs(1, AudioSourceNumericFeedback.UShortValue, OutputPorts.First(), localAudioInputPort, eRoutingSignalType.Audio));
|
OnSwitchChange(new RoutingNumericEventArgs(1, AudioSourceNumericFeedback.UShortValue, OutputPorts.First(), localAudioInputPort, eRoutingSignalType.Audio));
|
||||||
}
|
}
|
||||||
|
|
||||||
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);
|
||||||
Tx.HdmiInput.VideoAttributes.AttributeChange += (o, a) => FireVideoAttributeChange(HdmiInput, a.EventId);
|
Tx.HdmiInput.VideoAttributes.AttributeChange += (o, a) => FireVideoAttributeChange(HdmiInput, a.EventId);
|
||||||
|
|
||||||
Tx.VgaInput.InputStreamChange += (o, a) => FowardInputStreamChange(VgaInput, a.EventId);
|
Tx.VgaInput.InputStreamChange += (o, a) => FowardInputStreamChange(VgaInput, a.EventId);
|
||||||
Tx.VgaInput.VideoAttributes.AttributeChange += (o, a) => FireVideoAttributeChange(VgaInput, a.EventId);
|
Tx.VgaInput.VideoAttributes.AttributeChange += (o, a) => FireVideoAttributeChange(VgaInput, a.EventId);
|
||||||
|
|
||||||
// Base does register and sets up comm monitoring.
|
// Base does register and sets up comm monitoring.
|
||||||
return base.CustomActivate();
|
return base.CustomActivate();
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
||||||
{
|
{
|
||||||
var joinMap = GetDmTxJoinMap(joinStart, joinMapKey);
|
var joinMap = GetDmTxJoinMap(joinStart, joinMapKey);
|
||||||
|
|
||||||
if (HdmiVideoSyncFeedback != null)
|
if (HdmiVideoSyncFeedback != null)
|
||||||
{
|
{
|
||||||
HdmiVideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.Input1VideoSyncStatus.JoinNumber]);
|
HdmiVideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.Input1VideoSyncStatus.JoinNumber]);
|
||||||
}
|
}
|
||||||
if (VgaVideoSyncFeedback != null)
|
if (VgaVideoSyncFeedback != null)
|
||||||
{
|
{
|
||||||
VgaVideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.Input2VideoSyncStatus.JoinNumber]);
|
VgaVideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.Input2VideoSyncStatus.JoinNumber]);
|
||||||
}
|
}
|
||||||
|
|
||||||
LinkDmTxToApi(this, trilist, joinMap, bridge);
|
LinkDmTxToApi(this, trilist, joinMap, bridge);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Enables or disables free run
|
/// Enables or disables free run
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="enable"></param>
|
/// <param name="enable"></param>
|
||||||
public void SetFreeRunEnabled(bool enable)
|
public void SetFreeRunEnabled(bool enable)
|
||||||
{
|
{
|
||||||
Tx.VgaInput.FreeRun = enable ? eDmFreeRunSetting.Enabled : eDmFreeRunSetting.Disabled;
|
Tx.VgaInput.FreeRun = enable ? eDmFreeRunSetting.Enabled : eDmFreeRunSetting.Disabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Sets the VGA brightness level
|
/// Sets the VGA brightness level
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="level"></param>
|
/// <param name="level"></param>
|
||||||
public void SetVgaBrightness(ushort level)
|
public void SetVgaBrightness(ushort level)
|
||||||
{
|
{
|
||||||
Tx.VgaInput.VideoControls.Brightness.UShortValue = level;
|
Tx.VgaInput.VideoControls.Brightness.UShortValue = level;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Sets the VGA contrast level
|
/// Sets the VGA contrast level
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="level"></param>
|
/// <param name="level"></param>
|
||||||
public void SetVgaContrast(ushort level)
|
public void SetVgaContrast(ushort level)
|
||||||
{
|
{
|
||||||
Tx.VgaInput.VideoControls.Contrast.UShortValue = level;
|
Tx.VgaInput.VideoControls.Contrast.UShortValue = level;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ExecuteNumericSwitch(ushort input, ushort output, eRoutingSignalType type)
|
public void ExecuteNumericSwitch(ushort input, ushort output, eRoutingSignalType type)
|
||||||
{
|
{
|
||||||
Debug.Console(2, this, "Executing Numeric Switch to input {0}.", input);
|
Debug.Console(2, this, "Executing Numeric Switch to input {0}.", input);
|
||||||
|
|
||||||
switch (input)
|
switch (input)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
{
|
{
|
||||||
ExecuteSwitch(DmTx200Base.eSourceSelection.Auto, null, type);
|
ExecuteSwitch(DmTx200Base.eSourceSelection.Auto, null, type);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 1:
|
case 1:
|
||||||
{
|
{
|
||||||
ExecuteSwitch(HdmiInput.Selector, null, type);
|
ExecuteSwitch(HdmiInput.Selector, null, type);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 2:
|
case 2:
|
||||||
{
|
{
|
||||||
ExecuteSwitch(VgaInput.Selector, null, type);
|
ExecuteSwitch(VgaInput.Selector, null, type);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 3:
|
case 3:
|
||||||
{
|
{
|
||||||
ExecuteSwitch(DmTx200Base.eSourceSelection.Disable, null, type);
|
ExecuteSwitch(DmTx200Base.eSourceSelection.Disable, null, type);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ExecuteSwitch(object inputSelector, object outputSelector, eRoutingSignalType signalType)
|
public void ExecuteSwitch(object inputSelector, object outputSelector, eRoutingSignalType signalType)
|
||||||
{
|
{
|
||||||
if ((signalType | eRoutingSignalType.Video) == eRoutingSignalType.Video)
|
if ((signalType | eRoutingSignalType.Video) == eRoutingSignalType.Video)
|
||||||
Tx.VideoSource = (DmTx200Base.eSourceSelection)inputSelector;
|
Tx.VideoSource = (DmTx200Base.eSourceSelection)inputSelector;
|
||||||
if ((signalType | eRoutingSignalType.Audio) == eRoutingSignalType.Audio)
|
if ((signalType | eRoutingSignalType.Audio) == eRoutingSignalType.Audio)
|
||||||
Tx.AudioSource = (DmTx200Base.eSourceSelection)inputSelector;
|
Tx.AudioSource = (DmTx200Base.eSourceSelection)inputSelector;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Tx_BaseEvent(GenericBase device, BaseEventArgs args)
|
void Tx_BaseEvent(GenericBase device, BaseEventArgs 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);
|
||||||
|
|
||||||
switch (id)
|
switch (id)
|
||||||
{
|
{
|
||||||
case EndpointTransmitterBase.VideoSourceFeedbackEventId:
|
case EndpointTransmitterBase.VideoSourceFeedbackEventId:
|
||||||
var localVideoInputPort = InputPorts.FirstOrDefault(p => (DmTx200Base.eSourceSelection)p.Selector == Tx.VideoSourceFeedback);
|
var localVideoInputPort = InputPorts.FirstOrDefault(p => (DmTx200Base.eSourceSelection)p.Selector == Tx.VideoSourceFeedback);
|
||||||
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();
|
||||||
OnSwitchChange(new RoutingNumericEventArgs(1, VideoSourceNumericFeedback.UShortValue, OutputPorts.First(), localVideoInputPort, eRoutingSignalType.Video));
|
OnSwitchChange(new RoutingNumericEventArgs(1, VideoSourceNumericFeedback.UShortValue, OutputPorts.First(), localVideoInputPort, eRoutingSignalType.Video));
|
||||||
break;
|
break;
|
||||||
case EndpointTransmitterBase.AudioSourceFeedbackEventId:
|
case EndpointTransmitterBase.AudioSourceFeedbackEventId:
|
||||||
var localInputAudioPort = InputPorts.FirstOrDefault(p => (DmTx200Base.eSourceSelection)p.Selector == Tx.AudioSourceFeedback);
|
var localInputAudioPort = InputPorts.FirstOrDefault(p => (DmTx200Base.eSourceSelection)p.Selector == Tx.AudioSourceFeedback);
|
||||||
Debug.Console(2, this, " Audio Source: {0}", Tx.AudioSourceFeedback);
|
Debug.Console(2, this, " Audio Source: {0}", Tx.AudioSourceFeedback);
|
||||||
AudioSourceNumericFeedback.FireUpdate();
|
AudioSourceNumericFeedback.FireUpdate();
|
||||||
OnSwitchChange(new RoutingNumericEventArgs(1, AudioSourceNumericFeedback.UShortValue, OutputPorts.First(), localInputAudioPort, eRoutingSignalType.Audio));
|
OnSwitchChange(new RoutingNumericEventArgs(1, AudioSourceNumericFeedback.UShortValue, OutputPorts.First(), localInputAudioPort, eRoutingSignalType.Audio));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void InputStreamChangeEvent(EndpointInputStream inputStream, EndpointInputStreamEventArgs args)
|
void InputStreamChangeEvent(EndpointInputStream inputStream, EndpointInputStreamEventArgs args)
|
||||||
{
|
{
|
||||||
Debug.Console(2, "{0} event {1} stream {2}", Tx.ToString(), inputStream.ToString(), args.EventId.ToString());
|
Debug.Console(2, "{0} event {1} stream {2}", Tx.ToString(), inputStream.ToString(), args.EventId.ToString());
|
||||||
|
|
||||||
switch (args.EventId)
|
switch (args.EventId)
|
||||||
{
|
{
|
||||||
case EndpointInputStreamEventIds.HdcpSupportOffFeedbackEventId:
|
case EndpointInputStreamEventIds.HdcpSupportOffFeedbackEventId:
|
||||||
HdmiInHdcpCapabilityFeedback.FireUpdate();
|
HdmiInHdcpCapabilityFeedback.FireUpdate();
|
||||||
break;
|
break;
|
||||||
case EndpointInputStreamEventIds.HdcpSupportOnFeedbackEventId:
|
case EndpointInputStreamEventIds.HdcpSupportOnFeedbackEventId:
|
||||||
HdmiInHdcpCapabilityFeedback.FireUpdate();
|
HdmiInHdcpCapabilityFeedback.FireUpdate();
|
||||||
break;
|
break;
|
||||||
case EndpointInputStreamEventIds.SyncDetectedFeedbackEventId:
|
case EndpointInputStreamEventIds.SyncDetectedFeedbackEventId:
|
||||||
HdmiVideoSyncFeedback.FireUpdate();
|
HdmiVideoSyncFeedback.FireUpdate();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Relays the input stream change to the appropriate RoutingInputPort.
|
/// Relays the input stream change to the appropriate RoutingInputPort.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
void FowardInputStreamChange(RoutingInputPortWithVideoStatuses inputPort, int eventId)
|
void FowardInputStreamChange(RoutingInputPortWithVideoStatuses inputPort, int eventId)
|
||||||
{
|
{
|
||||||
if (eventId != EndpointInputStreamEventIds.SyncDetectedFeedbackEventId)
|
if (eventId != EndpointInputStreamEventIds.SyncDetectedFeedbackEventId)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
inputPort.VideoStatus.VideoSyncFeedback.FireUpdate();
|
inputPort.VideoStatus.VideoSyncFeedback.FireUpdate();
|
||||||
AnyVideoInput.VideoStatus.VideoSyncFeedback.FireUpdate();
|
AnyVideoInput.VideoStatus.VideoSyncFeedback.FireUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Relays the VideoAttributes change to a RoutingInputPort
|
/// Relays the VideoAttributes change to a RoutingInputPort
|
||||||
/// </summary>
|
/// </summary>
|
||||||
void FireVideoAttributeChange(RoutingInputPortWithVideoStatuses inputPort, int eventId)
|
void FireVideoAttributeChange(RoutingInputPortWithVideoStatuses inputPort, int eventId)
|
||||||
{
|
{
|
||||||
//// LOCATION: Crestron.SimplSharpPro.DM.VideoAttributeEventIds
|
//// LOCATION: Crestron.SimplSharpPro.DM.VideoAttributeEventIds
|
||||||
//Debug.Console(2, this, "VideoAttributes_AttributeChange event id={0} from {1}",
|
//Debug.Console(2, this, "VideoAttributes_AttributeChange event id={0} from {1}",
|
||||||
// args.EventId, (sender as VideoAttributesEnhanced).Owner.GetType());
|
// args.EventId, (sender as VideoAttributesEnhanced).Owner.GetType());
|
||||||
switch (eventId)
|
switch (eventId)
|
||||||
{
|
{
|
||||||
case VideoAttributeEventIds.HdcpActiveFeedbackEventId:
|
case VideoAttributeEventIds.HdcpActiveFeedbackEventId:
|
||||||
inputPort.VideoStatus.HdcpActiveFeedback.FireUpdate();
|
inputPort.VideoStatus.HdcpActiveFeedback.FireUpdate();
|
||||||
AnyVideoInput.VideoStatus.HdcpActiveFeedback.FireUpdate();
|
AnyVideoInput.VideoStatus.HdcpActiveFeedback.FireUpdate();
|
||||||
break;
|
break;
|
||||||
case VideoAttributeEventIds.HdcpStateFeedbackEventId:
|
case VideoAttributeEventIds.HdcpStateFeedbackEventId:
|
||||||
inputPort.VideoStatus.HdcpStateFeedback.FireUpdate();
|
inputPort.VideoStatus.HdcpStateFeedback.FireUpdate();
|
||||||
AnyVideoInput.VideoStatus.HdcpStateFeedback.FireUpdate();
|
AnyVideoInput.VideoStatus.HdcpStateFeedback.FireUpdate();
|
||||||
break;
|
break;
|
||||||
case VideoAttributeEventIds.HorizontalResolutionFeedbackEventId:
|
case VideoAttributeEventIds.HorizontalResolutionFeedbackEventId:
|
||||||
case VideoAttributeEventIds.VerticalResolutionFeedbackEventId:
|
case VideoAttributeEventIds.VerticalResolutionFeedbackEventId:
|
||||||
inputPort.VideoStatus.VideoResolutionFeedback.FireUpdate();
|
inputPort.VideoStatus.VideoResolutionFeedback.FireUpdate();
|
||||||
AnyVideoInput.VideoStatus.VideoResolutionFeedback.FireUpdate();
|
AnyVideoInput.VideoStatus.VideoResolutionFeedback.FireUpdate();
|
||||||
break;
|
break;
|
||||||
case VideoAttributeEventIds.FramesPerSecondFeedbackEventId:
|
case VideoAttributeEventIds.FramesPerSecondFeedbackEventId:
|
||||||
inputPort.VideoStatus.VideoResolutionFeedback.FireUpdate();
|
inputPort.VideoStatus.VideoResolutionFeedback.FireUpdate();
|
||||||
AnyVideoInput.VideoStatus.VideoResolutionFeedback.FireUpdate();
|
AnyVideoInput.VideoStatus.VideoResolutionFeedback.FireUpdate();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -8,33 +8,33 @@ using System.Linq;
|
|||||||
|
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
using PepperDash.Essentials.Core.Bridges;
|
using PepperDash.Essentials.Core.Bridges;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.DM
|
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-201-C")]
|
[Description("Wrapper class for DM-TX-201-C")]
|
||||||
public class DmTx201CController : DmTxControllerBase, ITxRoutingWithFeedback, IHasFreeRun, IVgaBrightnessContrastControls
|
public class DmTx201CController : DmTxControllerBase, ITxRoutingWithFeedback, IHasFreeRun, IVgaBrightnessContrastControls
|
||||||
{
|
{
|
||||||
public DmTx201C Tx { get; private set; }
|
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; }
|
||||||
public RoutingOutputPort DmOutput { get; private set; }
|
public RoutingOutputPort DmOutput { get; private set; }
|
||||||
public RoutingOutputPort HdmiLoopOut { get; private set; }
|
public RoutingOutputPort HdmiLoopOut { get; private set; }
|
||||||
|
|
||||||
public override StringFeedback ActiveVideoInputFeedback { get; protected set; }
|
public override StringFeedback ActiveVideoInputFeedback { get; protected set; }
|
||||||
public IntFeedback VideoSourceNumericFeedback { get; protected set; }
|
public IntFeedback VideoSourceNumericFeedback { get; protected set; }
|
||||||
public IntFeedback AudioSourceNumericFeedback { get; protected set; }
|
public IntFeedback AudioSourceNumericFeedback { get; protected set; }
|
||||||
public IntFeedback HdmiInHdcpCapabilityFeedback { get; protected set; }
|
public IntFeedback HdmiInHdcpCapabilityFeedback { get; protected set; }
|
||||||
public BoolFeedback HdmiVideoSyncFeedback { get; protected set; }
|
public BoolFeedback HdmiVideoSyncFeedback { get; protected set; }
|
||||||
public BoolFeedback VgaVideoSyncFeedback { get; protected set; }
|
public BoolFeedback VgaVideoSyncFeedback { get; protected set; }
|
||||||
|
|
||||||
public BoolFeedback FreeRunEnabledFeedback { get; protected set; }
|
public BoolFeedback FreeRunEnabledFeedback { get; protected set; }
|
||||||
|
|
||||||
public IntFeedback VgaBrightnessFeedback { get; protected set; }
|
public IntFeedback VgaBrightnessFeedback { get; protected set; }
|
||||||
public IntFeedback VgaContrastFeedback { get; protected set; }
|
public IntFeedback VgaContrastFeedback { get; protected set; }
|
||||||
|
|
||||||
//IroutingNumericEvent
|
//IroutingNumericEvent
|
||||||
@@ -48,61 +48,61 @@ namespace PepperDash.Essentials.DM
|
|||||||
{
|
{
|
||||||
var newEvent = NumericSwitchChange;
|
var newEvent = NumericSwitchChange;
|
||||||
if (newEvent != null) newEvent(this, e);
|
if (newEvent != null) newEvent(this, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Helps get the "real" inputs, including when in Auto
|
/// Helps get the "real" inputs, including when in Auto
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public DmTx200Base.eSourceSelection ActualActiveVideoInput
|
public DmTx200Base.eSourceSelection ActualActiveVideoInput
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
if (Tx.VideoSourceFeedback == DmTx200Base.eSourceSelection.Digital ||
|
if (Tx.VideoSourceFeedback == DmTx200Base.eSourceSelection.Digital ||
|
||||||
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
|
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)
|
else if (Tx.VgaInput.SyncDetectedFeedback.BoolValue)
|
||||||
return DmTx200Base.eSourceSelection.Analog;
|
return DmTx200Base.eSourceSelection.Analog;
|
||||||
else
|
else
|
||||||
return DmTx200Base.eSourceSelection.Disable;
|
return DmTx200Base.eSourceSelection.Disable;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public RoutingPortCollection<RoutingInputPort> InputPorts
|
public RoutingPortCollection<RoutingInputPort> InputPorts
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return new RoutingPortCollection<RoutingInputPort>
|
return new RoutingPortCollection<RoutingInputPort>
|
||||||
{
|
{
|
||||||
HdmiInput,
|
HdmiInput,
|
||||||
VgaInput,
|
VgaInput,
|
||||||
AnyVideoInput
|
AnyVideoInput
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public RoutingPortCollection<RoutingOutputPort> OutputPorts
|
public RoutingPortCollection<RoutingOutputPort> OutputPorts
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return new RoutingPortCollection<RoutingOutputPort> { DmOutput, HdmiLoopOut };
|
return new RoutingPortCollection<RoutingOutputPort> { DmOutput, HdmiLoopOut };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="key"></param>
|
/// <param name="key"></param>
|
||||||
/// <param name="name"></param>
|
/// <param name="name"></param>
|
||||||
/// <param name="tx"></param>
|
/// <param name="tx"></param>
|
||||||
public DmTx201CController(string key, string name, DmTx201C tx, bool preventRegistration)
|
public DmTx201CController(string key, string name, DmTx201C tx, bool preventRegistration)
|
||||||
: base(key, name, tx)
|
: base(key, name, tx)
|
||||||
{
|
{
|
||||||
Tx = tx;
|
Tx = tx;
|
||||||
PreventRegistration = preventRegistration;
|
PreventRegistration = preventRegistration;
|
||||||
|
|
||||||
@@ -119,89 +119,89 @@ namespace PepperDash.Essentials.DM
|
|||||||
VideoStatusHelper.GetVgaInputStatusFuncs(tx.VgaInput))
|
VideoStatusHelper.GetVgaInputStatusFuncs(tx.VgaInput))
|
||||||
{
|
{
|
||||||
FeedbackMatchObject = DmTx200Base.eSourceSelection.Analog
|
FeedbackMatchObject = DmTx200Base.eSourceSelection.Analog
|
||||||
};
|
};
|
||||||
|
|
||||||
ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput",
|
ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput",
|
||||||
() => ActualActiveVideoInput.ToString());
|
() => ActualActiveVideoInput.ToString());
|
||||||
|
|
||||||
Tx.HdmiInput.InputStreamChange += InputStreamChangeEvent;
|
Tx.HdmiInput.InputStreamChange += InputStreamChangeEvent;
|
||||||
Tx.VgaInput.InputStreamChange += VgaInputOnInputStreamChange;
|
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(() => (int)Tx.VideoSourceFeedback);
|
VideoSourceNumericFeedback = new IntFeedback(() => (int)Tx.VideoSourceFeedback);
|
||||||
|
|
||||||
AudioSourceNumericFeedback = new IntFeedback(() => (int)Tx.AudioSourceFeedback);
|
AudioSourceNumericFeedback = new IntFeedback(() => (int)Tx.AudioSourceFeedback);
|
||||||
|
|
||||||
HdmiInHdcpCapabilityFeedback = new IntFeedback("HdmiInHdcpCapability", () =>
|
HdmiInHdcpCapabilityFeedback = new IntFeedback("HdmiInHdcpCapability", () =>
|
||||||
(tx.HdmiInput.HdcpSupportOnFeedback.BoolValue ? 1 : 0));
|
(tx.HdmiInput.HdcpSupportOnFeedback.BoolValue ? 1 : 0));
|
||||||
|
|
||||||
HdcpStateFeedback = HdmiInHdcpCapabilityFeedback;
|
HdcpStateFeedback = HdmiInHdcpCapabilityFeedback;
|
||||||
|
|
||||||
HdmiVideoSyncFeedback = new BoolFeedback(() => (bool)tx.HdmiInput.SyncDetectedFeedback.BoolValue);
|
|
||||||
|
|
||||||
VgaVideoSyncFeedback = new BoolFeedback(() => (bool)tx.VgaInput.SyncDetectedFeedback.BoolValue);
|
|
||||||
|
|
||||||
FreeRunEnabledFeedback = new BoolFeedback(() => tx.VgaInput.FreeRunFeedback == eDmFreeRunSetting.Enabled);
|
|
||||||
|
|
||||||
VgaBrightnessFeedback = new IntFeedback(() => tx.VgaInput.VideoControls.BrightnessFeedback.UShortValue);
|
|
||||||
|
|
||||||
VgaContrastFeedback = new IntFeedback(() => tx.VgaInput.VideoControls.ContrastFeedback.UShortValue);
|
|
||||||
|
|
||||||
tx.VgaInput.VideoControls.ControlChange += VideoControls_ControlChange;
|
|
||||||
|
|
||||||
HdcpSupportCapability = eHdcpCapabilityType.HdcpAutoSupport;
|
|
||||||
|
|
||||||
var combinedFuncs = new VideoStatusFuncsWrapper
|
|
||||||
{
|
|
||||||
HdcpActiveFeedbackFunc = () =>
|
|
||||||
(ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital
|
|
||||||
&& tx.HdmiInput.VideoAttributes.HdcpActiveFeedback.BoolValue),
|
|
||||||
|
|
||||||
HdcpStateFeedbackFunc = () => ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital ?
|
HdmiVideoSyncFeedback = new BoolFeedback(() => (bool)tx.HdmiInput.SyncDetectedFeedback.BoolValue);
|
||||||
tx.HdmiInput.VideoAttributes.HdcpStateFeedback.ToString() : "",
|
|
||||||
|
VgaVideoSyncFeedback = new BoolFeedback(() => (bool)tx.VgaInput.SyncDetectedFeedback.BoolValue);
|
||||||
VideoResolutionFeedbackFunc = () =>
|
|
||||||
{
|
FreeRunEnabledFeedback = new BoolFeedback(() => tx.VgaInput.FreeRunFeedback == eDmFreeRunSetting.Enabled);
|
||||||
if (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital)
|
|
||||||
return tx.HdmiInput.VideoAttributes.GetVideoResolutionString();
|
VgaBrightnessFeedback = new IntFeedback(() => tx.VgaInput.VideoControls.BrightnessFeedback.UShortValue);
|
||||||
return ActualActiveVideoInput == DmTx200Base.eSourceSelection.Analog ?
|
|
||||||
tx.VgaInput.VideoAttributes.GetVideoResolutionString() : "";
|
VgaContrastFeedback = new IntFeedback(() => tx.VgaInput.VideoControls.ContrastFeedback.UShortValue);
|
||||||
},
|
|
||||||
|
tx.VgaInput.VideoControls.ControlChange += VideoControls_ControlChange;
|
||||||
VideoSyncFeedbackFunc = () =>
|
|
||||||
(ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital
|
HdcpSupportCapability = eHdcpCapabilityType.HdcpAutoSupport;
|
||||||
&& tx.HdmiInput.SyncDetectedFeedback.BoolValue)
|
|
||||||
|| (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Analog
|
var combinedFuncs = new VideoStatusFuncsWrapper
|
||||||
&& tx.VgaInput.SyncDetectedFeedback.BoolValue)
|
{
|
||||||
|| (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Auto
|
HdcpActiveFeedbackFunc = () =>
|
||||||
&& (tx.VgaInput.SyncDetectedFeedback.BoolValue || tx.HdmiInput.SyncDetectedFeedback.BoolValue))
|
(ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital
|
||||||
|
&& tx.HdmiInput.VideoAttributes.HdcpActiveFeedback.BoolValue),
|
||||||
};
|
|
||||||
|
HdcpStateFeedbackFunc = () => ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital ?
|
||||||
AnyVideoInput = new RoutingInputPortWithVideoStatuses(DmPortName.AnyVideoIn,
|
tx.HdmiInput.VideoAttributes.HdcpStateFeedback.ToString() : "",
|
||||||
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.None, 0, this, combinedFuncs);
|
|
||||||
|
VideoResolutionFeedbackFunc = () =>
|
||||||
DmOutput = new RoutingOutputPort(DmPortName.DmOut, eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.DmCat, null, this);
|
{
|
||||||
HdmiLoopOut = new RoutingOutputPort(DmPortName.HdmiLoopOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
|
if (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital)
|
||||||
eRoutingPortConnectionType.Hdmi, null, this);
|
return tx.HdmiInput.VideoAttributes.GetVideoResolutionString();
|
||||||
|
return ActualActiveVideoInput == DmTx200Base.eSourceSelection.Analog ?
|
||||||
AddToFeedbackList(ActiveVideoInputFeedback, VideoSourceNumericFeedback, AudioSourceNumericFeedback,
|
tx.VgaInput.VideoAttributes.GetVideoResolutionString() : "";
|
||||||
AnyVideoInput.VideoStatus.HasVideoStatusFeedback, AnyVideoInput.VideoStatus.HdcpActiveFeedback,
|
},
|
||||||
AnyVideoInput.VideoStatus.HdcpStateFeedback, AnyVideoInput.VideoStatus.VideoResolutionFeedback,
|
|
||||||
AnyVideoInput.VideoStatus.VideoSyncFeedback, HdmiInHdcpCapabilityFeedback, HdmiVideoSyncFeedback,
|
VideoSyncFeedbackFunc = () =>
|
||||||
VgaVideoSyncFeedback);
|
(ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital
|
||||||
|
&& tx.HdmiInput.SyncDetectedFeedback.BoolValue)
|
||||||
// Set Ports for CEC
|
|| (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Analog
|
||||||
HdmiInput.Port = Tx.HdmiInput;
|
&& tx.VgaInput.SyncDetectedFeedback.BoolValue)
|
||||||
VgaInput.Port = Tx.VgaInput;
|
|| (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Auto
|
||||||
HdmiLoopOut.Port = Tx.HdmiOutput;
|
&& (tx.VgaInput.SyncDetectedFeedback.BoolValue || tx.HdmiInput.SyncDetectedFeedback.BoolValue))
|
||||||
DmOutput.Port = Tx.DmOutput;
|
|
||||||
}
|
};
|
||||||
|
|
||||||
void VideoControls_ControlChange(object sender, Crestron.SimplSharpPro.DeviceSupport.GenericEventArgs args)
|
AnyVideoInput = new RoutingInputPortWithVideoStatuses(DmPortName.AnyVideoIn,
|
||||||
{
|
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.None, 0, this, combinedFuncs);
|
||||||
var id = args.EventId;
|
|
||||||
|
DmOutput = 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, HdmiInHdcpCapabilityFeedback, HdmiVideoSyncFeedback,
|
||||||
|
VgaVideoSyncFeedback);
|
||||||
|
|
||||||
|
// Set Ports for CEC
|
||||||
|
HdmiInput.Port = Tx.HdmiInput;
|
||||||
|
VgaInput.Port = Tx.VgaInput;
|
||||||
|
HdmiLoopOut.Port = Tx.HdmiOutput;
|
||||||
|
DmOutput.Port = Tx.DmOutput;
|
||||||
|
}
|
||||||
|
|
||||||
|
void VideoControls_ControlChange(object sender, Crestron.SimplSharpPro.DeviceSupport.GenericEventArgs args)
|
||||||
|
{
|
||||||
|
var id = args.EventId;
|
||||||
Debug.Console(2, this, "EventId {0}", args.EventId);
|
Debug.Console(2, this, "EventId {0}", args.EventId);
|
||||||
|
|
||||||
switch (id)
|
switch (id)
|
||||||
@@ -212,7 +212,7 @@ namespace PepperDash.Essentials.DM
|
|||||||
case VideoControlsEventIds.ContrastFeedbackEventId:
|
case VideoControlsEventIds.ContrastFeedbackEventId:
|
||||||
VgaContrastFeedback.FireUpdate();
|
VgaContrastFeedback.FireUpdate();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Tx_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args)
|
void Tx_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args)
|
||||||
@@ -228,7 +228,7 @@ namespace PepperDash.Essentials.DM
|
|||||||
AudioSourceNumericFeedback.FireUpdate();
|
AudioSourceNumericFeedback.FireUpdate();
|
||||||
OnSwitchChange(new RoutingNumericEventArgs(1, VideoSourceNumericFeedback.UShortValue, OutputPorts.First(), localVideoInputPort, eRoutingSignalType.Video));
|
OnSwitchChange(new RoutingNumericEventArgs(1, VideoSourceNumericFeedback.UShortValue, OutputPorts.First(), localVideoInputPort, eRoutingSignalType.Video));
|
||||||
OnSwitchChange(new RoutingNumericEventArgs(1, AudioSourceNumericFeedback.UShortValue, OutputPorts.First(), localAudioInputPort, eRoutingSignalType.Audio));
|
OnSwitchChange(new RoutingNumericEventArgs(1, AudioSourceNumericFeedback.UShortValue, OutputPorts.First(), localAudioInputPort, eRoutingSignalType.Audio));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void VgaInputOnInputStreamChange(EndpointInputStream inputStream, EndpointInputStreamEventArgs args)
|
private void VgaInputOnInputStreamChange(EndpointInputStream inputStream, EndpointInputStreamEventArgs args)
|
||||||
{
|
{
|
||||||
@@ -241,107 +241,107 @@ namespace PepperDash.Essentials.DM
|
|||||||
VgaVideoSyncFeedback.FireUpdate();
|
VgaVideoSyncFeedback.FireUpdate();
|
||||||
break;
|
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);
|
||||||
Tx.HdmiInput.VideoAttributes.AttributeChange += (o, a) => FireVideoAttributeChange(HdmiInput, a.EventId);
|
Tx.HdmiInput.VideoAttributes.AttributeChange += (o, a) => FireVideoAttributeChange(HdmiInput, a.EventId);
|
||||||
|
|
||||||
Tx.VgaInput.InputStreamChange += (o, a) => FowardInputStreamChange(VgaInput, a.EventId);
|
Tx.VgaInput.InputStreamChange += (o, a) => FowardInputStreamChange(VgaInput, a.EventId);
|
||||||
Tx.VgaInput.VideoAttributes.AttributeChange += (o, a) => FireVideoAttributeChange(VgaInput, a.EventId);
|
Tx.VgaInput.VideoAttributes.AttributeChange += (o, a) => FireVideoAttributeChange(VgaInput, a.EventId);
|
||||||
|
|
||||||
// Base does register and sets up comm monitoring.
|
// Base does register and sets up comm monitoring.
|
||||||
return base.CustomActivate();
|
return base.CustomActivate();
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
||||||
{
|
|
||||||
var joinMap = GetDmTxJoinMap(joinStart, joinMapKey);
|
|
||||||
|
|
||||||
if (HdmiVideoSyncFeedback != null)
|
|
||||||
{
|
|
||||||
HdmiVideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.Input1VideoSyncStatus.JoinNumber]);
|
|
||||||
}
|
|
||||||
if (VgaVideoSyncFeedback != null)
|
|
||||||
{
|
|
||||||
VgaVideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.Input2VideoSyncStatus.JoinNumber]);
|
|
||||||
}
|
|
||||||
|
|
||||||
LinkDmTxToApi(this, trilist, joinMap, bridge);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Enables or disables free run
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="enable"></param>
|
|
||||||
public void SetFreeRunEnabled(bool enable)
|
|
||||||
{
|
{
|
||||||
Tx.VgaInput.FreeRun = enable ? eDmFreeRunSetting.Enabled : eDmFreeRunSetting.Disabled;
|
var joinMap = GetDmTxJoinMap(joinStart, joinMapKey);
|
||||||
}
|
|
||||||
|
if (HdmiVideoSyncFeedback != null)
|
||||||
/// <summary>
|
{
|
||||||
/// Sets the VGA brightness level
|
HdmiVideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.Input1VideoSyncStatus.JoinNumber]);
|
||||||
/// </summary>
|
}
|
||||||
/// <param name="level"></param>
|
if (VgaVideoSyncFeedback != null)
|
||||||
public void SetVgaBrightness(ushort level)
|
{
|
||||||
{
|
VgaVideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.Input2VideoSyncStatus.JoinNumber]);
|
||||||
Tx.VgaInput.VideoControls.Brightness.UShortValue = level;
|
}
|
||||||
}
|
|
||||||
|
LinkDmTxToApi(this, trilist, joinMap, bridge);
|
||||||
/// <summary>
|
}
|
||||||
/// Sets the VGA contrast level
|
|
||||||
/// </summary>
|
/// <summary>
|
||||||
/// <param name="level"></param>
|
/// Enables or disables free run
|
||||||
public void SetVgaContrast(ushort level)
|
/// </summary>
|
||||||
{
|
/// <param name="enable"></param>
|
||||||
Tx.VgaInput.VideoControls.Contrast.UShortValue = level;
|
public void SetFreeRunEnabled(bool enable)
|
||||||
}
|
{
|
||||||
|
Tx.VgaInput.FreeRun = enable ? eDmFreeRunSetting.Enabled : eDmFreeRunSetting.Disabled;
|
||||||
/// <summary>
|
}
|
||||||
/// Switches the audio/video source based on the integer value (0-Auto, 1-HDMI, 2-VGA, 3-Disable)
|
|
||||||
/// </summary>
|
/// <summary>
|
||||||
/// <param name="input"></param>
|
/// Sets the VGA brightness level
|
||||||
/// <param name="output"></param>
|
/// </summary>
|
||||||
/// <param name="type"></param>
|
/// <param name="level"></param>
|
||||||
public void ExecuteNumericSwitch(ushort input, ushort output, eRoutingSignalType type)
|
public void SetVgaBrightness(ushort level)
|
||||||
{
|
{
|
||||||
Debug.Console(2, this, "Executing Numeric Switch to input {0}.", input);
|
Tx.VgaInput.VideoControls.Brightness.UShortValue = level;
|
||||||
|
}
|
||||||
switch (input)
|
|
||||||
{
|
/// <summary>
|
||||||
case 0:
|
/// Sets the VGA contrast level
|
||||||
{
|
/// </summary>
|
||||||
ExecuteSwitch(DmTx200Base.eSourceSelection.Auto, null, type);
|
/// <param name="level"></param>
|
||||||
break;
|
public void SetVgaContrast(ushort level)
|
||||||
}
|
{
|
||||||
case 1:
|
Tx.VgaInput.VideoControls.Contrast.UShortValue = level;
|
||||||
{
|
}
|
||||||
ExecuteSwitch(HdmiInput.Selector, null, type);
|
|
||||||
break;
|
/// <summary>
|
||||||
}
|
/// Switches the audio/video source based on the integer value (0-Auto, 1-HDMI, 2-VGA, 3-Disable)
|
||||||
case 2:
|
/// </summary>
|
||||||
{
|
/// <param name="input"></param>
|
||||||
ExecuteSwitch(VgaInput.Selector, null, type);
|
/// <param name="output"></param>
|
||||||
break;
|
/// <param name="type"></param>
|
||||||
}
|
public void ExecuteNumericSwitch(ushort input, ushort output, eRoutingSignalType type)
|
||||||
case 3:
|
{
|
||||||
{
|
Debug.Console(2, this, "Executing Numeric Switch to input {0}.", input);
|
||||||
ExecuteSwitch(DmTx200Base.eSourceSelection.Disable, null, type);
|
|
||||||
break;
|
switch (input)
|
||||||
}
|
{
|
||||||
}
|
case 0:
|
||||||
}
|
{
|
||||||
|
ExecuteSwitch(DmTx200Base.eSourceSelection.Auto, null, type);
|
||||||
public void ExecuteSwitch(object inputSelector, object outputSelector, eRoutingSignalType signalType)
|
break;
|
||||||
{
|
}
|
||||||
if((signalType | eRoutingSignalType.Video) == eRoutingSignalType.Video)
|
case 1:
|
||||||
Tx.VideoSource = (DmTx200Base.eSourceSelection)inputSelector;
|
{
|
||||||
if ((signalType | eRoutingSignalType.Audio) == eRoutingSignalType.Audio)
|
ExecuteSwitch(HdmiInput.Selector, null, type);
|
||||||
Tx.AudioSource = (DmTx200Base.eSourceSelection)inputSelector;
|
break;
|
||||||
}
|
}
|
||||||
|
case 2:
|
||||||
void Tx_BaseEvent(GenericBase device, BaseEventArgs args)
|
{
|
||||||
|
ExecuteSwitch(VgaInput.Selector, null, type);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 3:
|
||||||
|
{
|
||||||
|
ExecuteSwitch(DmTx200Base.eSourceSelection.Disable, null, type);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ExecuteSwitch(object inputSelector, object outputSelector, eRoutingSignalType signalType)
|
||||||
|
{
|
||||||
|
if((signalType | eRoutingSignalType.Video) == eRoutingSignalType.Video)
|
||||||
|
Tx.VideoSource = (DmTx200Base.eSourceSelection)inputSelector;
|
||||||
|
if ((signalType | eRoutingSignalType.Audio) == eRoutingSignalType.Audio)
|
||||||
|
Tx.AudioSource = (DmTx200Base.eSourceSelection)inputSelector;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Tx_BaseEvent(GenericBase device, BaseEventArgs 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);
|
||||||
@@ -361,11 +361,11 @@ namespace PepperDash.Essentials.DM
|
|||||||
AudioSourceNumericFeedback.FireUpdate();
|
AudioSourceNumericFeedback.FireUpdate();
|
||||||
OnSwitchChange(new RoutingNumericEventArgs(1, AudioSourceNumericFeedback.UShortValue, OutputPorts.First(), localInputAudioPort, eRoutingSignalType.Audio));
|
OnSwitchChange(new RoutingNumericEventArgs(1, AudioSourceNumericFeedback.UShortValue, OutputPorts.First(), localInputAudioPort, eRoutingSignalType.Audio));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void InputStreamChangeEvent(EndpointInputStream inputStream, EndpointInputStreamEventArgs args)
|
void InputStreamChangeEvent(EndpointInputStream inputStream, EndpointInputStreamEventArgs args)
|
||||||
{
|
{
|
||||||
Debug.Console(2, "{0} event {1} stream {2}", Tx.ToString(), inputStream.ToString(), args.EventId.ToString());
|
Debug.Console(2, "{0} event {1} stream {2}", Tx.ToString(), inputStream.ToString(), args.EventId.ToString());
|
||||||
|
|
||||||
switch (args.EventId)
|
switch (args.EventId)
|
||||||
@@ -379,52 +379,52 @@ namespace PepperDash.Essentials.DM
|
|||||||
case EndpointInputStreamEventIds.SyncDetectedFeedbackEventId:
|
case EndpointInputStreamEventIds.SyncDetectedFeedbackEventId:
|
||||||
HdmiVideoSyncFeedback.FireUpdate();
|
HdmiVideoSyncFeedback.FireUpdate();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Relays the input stream change to the appropriate RoutingInputPort.
|
/// Relays the input stream change to the appropriate RoutingInputPort.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
void FowardInputStreamChange(RoutingInputPortWithVideoStatuses inputPort, int eventId)
|
void FowardInputStreamChange(RoutingInputPortWithVideoStatuses inputPort, int eventId)
|
||||||
{
|
{
|
||||||
if (eventId != EndpointInputStreamEventIds.SyncDetectedFeedbackEventId)
|
if (eventId != EndpointInputStreamEventIds.SyncDetectedFeedbackEventId)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
inputPort.VideoStatus.VideoSyncFeedback.FireUpdate();
|
inputPort.VideoStatus.VideoSyncFeedback.FireUpdate();
|
||||||
AnyVideoInput.VideoStatus.VideoSyncFeedback.FireUpdate();
|
AnyVideoInput.VideoStatus.VideoSyncFeedback.FireUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Relays the VideoAttributes change to a RoutingInputPort
|
/// Relays the VideoAttributes change to a RoutingInputPort
|
||||||
/// </summary>
|
/// </summary>
|
||||||
void FireVideoAttributeChange(RoutingInputPortWithVideoStatuses inputPort, int eventId)
|
void FireVideoAttributeChange(RoutingInputPortWithVideoStatuses inputPort, int eventId)
|
||||||
{
|
{
|
||||||
//// LOCATION: Crestron.SimplSharpPro.DM.VideoAttributeEventIds
|
//// LOCATION: Crestron.SimplSharpPro.DM.VideoAttributeEventIds
|
||||||
//Debug.Console(2, this, "VideoAttributes_AttributeChange event id={0} from {1}",
|
//Debug.Console(2, this, "VideoAttributes_AttributeChange event id={0} from {1}",
|
||||||
// args.EventId, (sender as VideoAttributesEnhanced).Owner.GetType());
|
// args.EventId, (sender as VideoAttributesEnhanced).Owner.GetType());
|
||||||
switch (eventId)
|
switch (eventId)
|
||||||
{
|
{
|
||||||
case VideoAttributeEventIds.HdcpActiveFeedbackEventId:
|
case VideoAttributeEventIds.HdcpActiveFeedbackEventId:
|
||||||
inputPort.VideoStatus.HdcpActiveFeedback.FireUpdate();
|
inputPort.VideoStatus.HdcpActiveFeedback.FireUpdate();
|
||||||
AnyVideoInput.VideoStatus.HdcpActiveFeedback.FireUpdate();
|
AnyVideoInput.VideoStatus.HdcpActiveFeedback.FireUpdate();
|
||||||
break;
|
break;
|
||||||
case VideoAttributeEventIds.HdcpStateFeedbackEventId:
|
case VideoAttributeEventIds.HdcpStateFeedbackEventId:
|
||||||
inputPort.VideoStatus.HdcpStateFeedback.FireUpdate();
|
inputPort.VideoStatus.HdcpStateFeedback.FireUpdate();
|
||||||
AnyVideoInput.VideoStatus.HdcpStateFeedback.FireUpdate();
|
AnyVideoInput.VideoStatus.HdcpStateFeedback.FireUpdate();
|
||||||
break;
|
break;
|
||||||
case VideoAttributeEventIds.HorizontalResolutionFeedbackEventId:
|
case VideoAttributeEventIds.HorizontalResolutionFeedbackEventId:
|
||||||
case VideoAttributeEventIds.VerticalResolutionFeedbackEventId:
|
case VideoAttributeEventIds.VerticalResolutionFeedbackEventId:
|
||||||
inputPort.VideoStatus.VideoResolutionFeedback.FireUpdate();
|
inputPort.VideoStatus.VideoResolutionFeedback.FireUpdate();
|
||||||
AnyVideoInput.VideoStatus.VideoResolutionFeedback.FireUpdate();
|
AnyVideoInput.VideoStatus.VideoResolutionFeedback.FireUpdate();
|
||||||
break;
|
break;
|
||||||
case VideoAttributeEventIds.FramesPerSecondFeedbackEventId:
|
case VideoAttributeEventIds.FramesPerSecondFeedbackEventId:
|
||||||
inputPort.VideoStatus.VideoResolutionFeedback.FireUpdate();
|
inputPort.VideoStatus.VideoResolutionFeedback.FireUpdate();
|
||||||
AnyVideoInput.VideoStatus.VideoResolutionFeedback.FireUpdate();
|
AnyVideoInput.VideoStatus.VideoResolutionFeedback.FireUpdate();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -78,6 +78,8 @@ namespace PepperDash.Essentials.DM
|
|||||||
IsOnline.SetValueFunc(() => controller.InputEndpointOnlineFeedbacks[num].BoolValue);
|
IsOnline.SetValueFunc(() => controller.InputEndpointOnlineFeedbacks[num].BoolValue);
|
||||||
controller.InputEndpointOnlineFeedbacks[num].OutputChange += (o, a) => IsOnline.FireUpdate();
|
controller.InputEndpointOnlineFeedbacks[num].OutputChange += (o, a) => IsOnline.FireUpdate();
|
||||||
}
|
}
|
||||||
|
PreventRegistration = true;
|
||||||
|
tx.Register();
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
||||||
|
|||||||
@@ -1,49 +1,49 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
using Crestron.SimplSharpPro;
|
using Crestron.SimplSharpPro;
|
||||||
//using Crestron.SimplSharpPro.DeviceSupport;
|
//using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
using Crestron.SimplSharpPro.DeviceSupport;
|
using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
using Crestron.SimplSharpPro.DM;
|
using Crestron.SimplSharpPro.DM;
|
||||||
using Crestron.SimplSharpPro.DM.Endpoints;
|
using Crestron.SimplSharpPro.DM.Endpoints;
|
||||||
using Crestron.SimplSharpPro.DM.Endpoints.Transmitters;
|
using Crestron.SimplSharpPro.DM.Endpoints.Transmitters;
|
||||||
|
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
using PepperDash.Essentials.Core.Bridges;
|
using PepperDash.Essentials.Core.Bridges;
|
||||||
using PepperDash.Essentials.DM.Config;
|
using PepperDash.Essentials.DM.Config;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.DM
|
namespace PepperDash.Essentials.DM
|
||||||
{
|
{
|
||||||
using eVst = Crestron.SimplSharpPro.DeviceSupport.eX02VideoSourceType;
|
using eVst = Crestron.SimplSharpPro.DeviceSupport.eX02VideoSourceType;
|
||||||
using eAst = Crestron.SimplSharpPro.DeviceSupport.eX02AudioSourceType;
|
using eAst = Crestron.SimplSharpPro.DeviceSupport.eX02AudioSourceType;
|
||||||
|
|
||||||
[Description("Wrapper class for DM-TX-4K-302-C")]
|
[Description("Wrapper class for DM-TX-4K-302-C")]
|
||||||
public class DmTx4k302CController : DmTxControllerBase, ITxRoutingWithFeedback, IHasFeedback,
|
public class DmTx4k302CController : DmTxControllerBase, ITxRoutingWithFeedback, IHasFeedback,
|
||||||
IIROutputPorts, IComPorts, IHasFreeRun, IVgaBrightnessContrastControls
|
IIROutputPorts, IComPorts, IHasFreeRun, IVgaBrightnessContrastControls
|
||||||
{
|
{
|
||||||
public DmTx4k302C Tx { get; private set; }
|
public DmTx4k302C Tx { get; private set; }
|
||||||
|
|
||||||
public RoutingInputPortWithVideoStatuses HdmiIn1 { get; private set; }
|
public RoutingInputPortWithVideoStatuses HdmiIn1 { get; private set; }
|
||||||
public RoutingInputPortWithVideoStatuses HdmiIn2 { get; private set; }
|
public RoutingInputPortWithVideoStatuses HdmiIn2 { get; private set; }
|
||||||
public RoutingInputPortWithVideoStatuses VgaIn { get; private set; }
|
public RoutingInputPortWithVideoStatuses VgaIn { get; private set; }
|
||||||
public RoutingOutputPort DmOut { get; private set; }
|
public RoutingOutputPort DmOut { get; private set; }
|
||||||
public RoutingOutputPort HdmiLoopOut { get; private set; }
|
public RoutingOutputPort HdmiLoopOut { get; private set; }
|
||||||
|
|
||||||
public override StringFeedback ActiveVideoInputFeedback { get; protected set; }
|
public override StringFeedback ActiveVideoInputFeedback { get; protected set; }
|
||||||
public IntFeedback VideoSourceNumericFeedback { get; protected set; }
|
public IntFeedback VideoSourceNumericFeedback { get; protected set; }
|
||||||
public IntFeedback AudioSourceNumericFeedback { get; protected set; }
|
public IntFeedback AudioSourceNumericFeedback { get; protected set; }
|
||||||
public IntFeedback HdmiIn1HdcpCapabilityFeedback { get; protected set; }
|
public IntFeedback HdmiIn1HdcpCapabilityFeedback { get; protected set; }
|
||||||
public IntFeedback HdmiIn2HdcpCapabilityFeedback { get; protected set; }
|
public IntFeedback HdmiIn2HdcpCapabilityFeedback { get; protected set; }
|
||||||
public BoolFeedback Hdmi1VideoSyncFeedback { get; protected set; }
|
public BoolFeedback Hdmi1VideoSyncFeedback { get; protected set; }
|
||||||
public BoolFeedback Hdmi2VideoSyncFeedback { get; protected set; }
|
public BoolFeedback Hdmi2VideoSyncFeedback { get; protected set; }
|
||||||
public BoolFeedback VgaVideoSyncFeedback { get; protected set; }
|
public BoolFeedback VgaVideoSyncFeedback { get; protected set; }
|
||||||
|
|
||||||
public BoolFeedback FreeRunEnabledFeedback { get; protected set; }
|
public BoolFeedback FreeRunEnabledFeedback { get; protected set; }
|
||||||
|
|
||||||
public IntFeedback VgaBrightnessFeedback { get; protected set; }
|
public IntFeedback VgaBrightnessFeedback { get; protected set; }
|
||||||
public IntFeedback VgaContrastFeedback { get; protected set; }
|
public IntFeedback VgaContrastFeedback { get; protected set; }
|
||||||
|
|
||||||
//IroutingNumericEvent
|
//IroutingNumericEvent
|
||||||
@@ -57,92 +57,92 @@ namespace PepperDash.Essentials.DM
|
|||||||
{
|
{
|
||||||
var newEvent = NumericSwitchChange;
|
var newEvent = NumericSwitchChange;
|
||||||
if (newEvent != null) newEvent(this, e);
|
if (newEvent != null) newEvent(this, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Helps get the "real" inputs, including when in Auto
|
/// Helps get the "real" inputs, including when in Auto
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Crestron.SimplSharpPro.DeviceSupport.eX02VideoSourceType ActualActiveVideoInput
|
public Crestron.SimplSharpPro.DeviceSupport.eX02VideoSourceType ActualActiveVideoInput
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
if (Tx.VideoSourceFeedback != eVst.Auto)
|
if (Tx.VideoSourceFeedback != eVst.Auto)
|
||||||
return Tx.VideoSourceFeedback;
|
return Tx.VideoSourceFeedback;
|
||||||
else // auto
|
else // auto
|
||||||
{
|
{
|
||||||
if (Tx.HdmiInputs[1].SyncDetectedFeedback.BoolValue)
|
if (Tx.HdmiInputs[1].SyncDetectedFeedback.BoolValue)
|
||||||
return eVst.Hdmi1;
|
return eVst.Hdmi1;
|
||||||
else if (Tx.HdmiInputs[2].SyncDetectedFeedback.BoolValue)
|
else if (Tx.HdmiInputs[2].SyncDetectedFeedback.BoolValue)
|
||||||
return eVst.Hdmi2;
|
return eVst.Hdmi2;
|
||||||
else if (Tx.VgaInput.SyncDetectedFeedback.BoolValue)
|
else if (Tx.VgaInput.SyncDetectedFeedback.BoolValue)
|
||||||
return eVst.Vga;
|
return eVst.Vga;
|
||||||
else
|
else
|
||||||
return eVst.AllDisabled;
|
return eVst.AllDisabled;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
public RoutingPortCollection<RoutingInputPort> InputPorts
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return new RoutingPortCollection<RoutingInputPort>
|
|
||||||
{
|
|
||||||
HdmiIn1,
|
|
||||||
HdmiIn2,
|
|
||||||
VgaIn,
|
|
||||||
AnyVideoInput
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public RoutingPortCollection<RoutingOutputPort> OutputPorts
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return new RoutingPortCollection<RoutingOutputPort> { DmOut, HdmiLoopOut };
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
public DmTx4k302CController(string key, string name, DmTx4k302C tx, bool preventRegistration)
|
public RoutingPortCollection<RoutingInputPort> InputPorts
|
||||||
: base(key, name, tx)
|
{
|
||||||
{
|
get
|
||||||
|
{
|
||||||
|
return new RoutingPortCollection<RoutingInputPort>
|
||||||
|
{
|
||||||
|
HdmiIn1,
|
||||||
|
HdmiIn2,
|
||||||
|
VgaIn,
|
||||||
|
AnyVideoInput
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public RoutingPortCollection<RoutingOutputPort> OutputPorts
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return new RoutingPortCollection<RoutingOutputPort> { DmOut, HdmiLoopOut };
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public DmTx4k302CController(string key, string name, DmTx4k302C tx, bool preventRegistration)
|
||||||
|
: base(key, name, tx)
|
||||||
|
{
|
||||||
Tx = tx;
|
Tx = tx;
|
||||||
PreventRegistration = preventRegistration;
|
PreventRegistration = preventRegistration;
|
||||||
|
|
||||||
HdmiIn1 = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn1,
|
HdmiIn1 = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn1,
|
||||||
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, eVst.Hdmi1, this,
|
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, eVst.Hdmi1, this,
|
||||||
VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInputs[1]))
|
VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInputs[1]))
|
||||||
{
|
{
|
||||||
FeedbackMatchObject = eVst.Hdmi1
|
FeedbackMatchObject = eVst.Hdmi1
|
||||||
};
|
};
|
||||||
HdmiIn2 = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn2,
|
HdmiIn2 = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn2,
|
||||||
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, eVst.Hdmi2, this,
|
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, eVst.Hdmi2, this,
|
||||||
VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInputs[2]))
|
VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInputs[2]))
|
||||||
{
|
{
|
||||||
FeedbackMatchObject = eVst.Hdmi2
|
FeedbackMatchObject = eVst.Hdmi2
|
||||||
};
|
};
|
||||||
|
|
||||||
VgaIn = new RoutingInputPortWithVideoStatuses(DmPortName.VgaIn,
|
VgaIn = new RoutingInputPortWithVideoStatuses(DmPortName.VgaIn,
|
||||||
eRoutingSignalType.Video, eRoutingPortConnectionType.Vga, eVst.Vga, this,
|
eRoutingSignalType.Video, eRoutingPortConnectionType.Vga, eVst.Vga, this,
|
||||||
VideoStatusHelper.GetVgaInputStatusFuncs(tx.VgaInput))
|
VideoStatusHelper.GetVgaInputStatusFuncs(tx.VgaInput))
|
||||||
{
|
{
|
||||||
FeedbackMatchObject = eVst.Vga
|
FeedbackMatchObject = eVst.Vga
|
||||||
};
|
};
|
||||||
|
|
||||||
ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput",
|
ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput",
|
||||||
() => ActualActiveVideoInput.ToString());
|
() => ActualActiveVideoInput.ToString());
|
||||||
|
|
||||||
Tx.HdmiInputs[1].InputStreamChange += InputStreamChangeEvent;
|
Tx.HdmiInputs[1].InputStreamChange += InputStreamChangeEvent;
|
||||||
Tx.HdmiInputs[2].InputStreamChange += InputStreamChangeEvent;
|
Tx.HdmiInputs[2].InputStreamChange += InputStreamChangeEvent;
|
||||||
Tx.VgaInput.InputStreamChange += VgaInputOnInputStreamChange;
|
Tx.VgaInput.InputStreamChange += VgaInputOnInputStreamChange;
|
||||||
Tx.BaseEvent += Tx_BaseEvent;
|
Tx.BaseEvent += Tx_BaseEvent;
|
||||||
|
|
||||||
Tx.OnlineStatusChange += Tx_OnlineStatusChange;
|
Tx.OnlineStatusChange += Tx_OnlineStatusChange;
|
||||||
|
|
||||||
VideoSourceNumericFeedback = new IntFeedback(() => (int)Tx.VideoSourceFeedback);
|
VideoSourceNumericFeedback = new IntFeedback(() => (int)Tx.VideoSourceFeedback);
|
||||||
AudioSourceNumericFeedback = new IntFeedback(() => (int)Tx.AudioSourceFeedback);
|
AudioSourceNumericFeedback = new IntFeedback(() => (int)Tx.AudioSourceFeedback);
|
||||||
|
|
||||||
HdmiIn1HdcpCapabilityFeedback = new IntFeedback("HdmiIn1HdcpCapability", () => (int)tx.HdmiInputs[1].HdcpCapabilityFeedback);
|
HdmiIn1HdcpCapabilityFeedback = new IntFeedback("HdmiIn1HdcpCapability", () => (int)tx.HdmiInputs[1].HdcpCapabilityFeedback);
|
||||||
|
|
||||||
HdmiIn2HdcpCapabilityFeedback = new IntFeedback("HdmiIn2HdcpCapability", () => (int)tx.HdmiInputs[2].HdcpCapabilityFeedback);
|
HdmiIn2HdcpCapabilityFeedback = new IntFeedback("HdmiIn2HdcpCapability", () => (int)tx.HdmiInputs[2].HdcpCapabilityFeedback);
|
||||||
|
|
||||||
HdcpStateFeedback =
|
HdcpStateFeedback =
|
||||||
@@ -150,77 +150,77 @@ namespace PepperDash.Essentials.DM
|
|||||||
() =>
|
() =>
|
||||||
tx.HdmiInputs[1].HdcpCapabilityFeedback > tx.HdmiInputs[2].HdcpCapabilityFeedback
|
tx.HdmiInputs[1].HdcpCapabilityFeedback > tx.HdmiInputs[2].HdcpCapabilityFeedback
|
||||||
? (int)tx.HdmiInputs[1].HdcpCapabilityFeedback
|
? (int)tx.HdmiInputs[1].HdcpCapabilityFeedback
|
||||||
: (int)tx.HdmiInputs[2].HdcpCapabilityFeedback);
|
: (int)tx.HdmiInputs[2].HdcpCapabilityFeedback);
|
||||||
|
|
||||||
HdcpSupportCapability = eHdcpCapabilityType.Hdcp2_2Support;
|
HdcpSupportCapability = eHdcpCapabilityType.Hdcp2_2Support;
|
||||||
|
|
||||||
Hdmi1VideoSyncFeedback = new BoolFeedback(() => (bool)tx.HdmiInputs[1].SyncDetectedFeedback.BoolValue);
|
Hdmi1VideoSyncFeedback = new BoolFeedback(() => (bool)tx.HdmiInputs[1].SyncDetectedFeedback.BoolValue);
|
||||||
|
|
||||||
Hdmi2VideoSyncFeedback = new BoolFeedback(() => (bool)tx.HdmiInputs[2].SyncDetectedFeedback.BoolValue);
|
Hdmi2VideoSyncFeedback = new BoolFeedback(() => (bool)tx.HdmiInputs[2].SyncDetectedFeedback.BoolValue);
|
||||||
|
|
||||||
VgaVideoSyncFeedback = new BoolFeedback(() => (bool)tx.VgaInput.SyncDetectedFeedback.BoolValue);
|
VgaVideoSyncFeedback = new BoolFeedback(() => (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 += new Crestron.SimplSharpPro.DeviceSupport.GenericEventHandler(VideoControls_ControlChange);
|
||||||
|
|
||||||
|
|
||||||
var combinedFuncs = new VideoStatusFuncsWrapper
|
var combinedFuncs = new VideoStatusFuncsWrapper
|
||||||
{
|
{
|
||||||
HdcpActiveFeedbackFunc = () =>
|
HdcpActiveFeedbackFunc = () =>
|
||||||
(ActualActiveVideoInput == eVst.Hdmi1
|
(ActualActiveVideoInput == eVst.Hdmi1
|
||||||
&& tx.HdmiInputs[1].VideoAttributes.HdcpActiveFeedback.BoolValue)
|
&& tx.HdmiInputs[1].VideoAttributes.HdcpActiveFeedback.BoolValue)
|
||||||
|| (ActualActiveVideoInput == eVst.Hdmi2
|
|| (ActualActiveVideoInput == eVst.Hdmi2
|
||||||
&& tx.HdmiInputs[2].VideoAttributes.HdcpActiveFeedback.BoolValue),
|
&& tx.HdmiInputs[2].VideoAttributes.HdcpActiveFeedback.BoolValue),
|
||||||
|
|
||||||
HdcpStateFeedbackFunc = () =>
|
HdcpStateFeedbackFunc = () =>
|
||||||
{
|
{
|
||||||
if (ActualActiveVideoInput == eVst.Hdmi1)
|
if (ActualActiveVideoInput == eVst.Hdmi1)
|
||||||
return tx.HdmiInputs[1].VideoAttributes.HdcpStateFeedback.ToString();
|
return tx.HdmiInputs[1].VideoAttributes.HdcpStateFeedback.ToString();
|
||||||
return ActualActiveVideoInput == eVst.Hdmi2 ? tx.HdmiInputs[2].VideoAttributes.HdcpStateFeedback.ToString() : "";
|
return ActualActiveVideoInput == eVst.Hdmi2 ? tx.HdmiInputs[2].VideoAttributes.HdcpStateFeedback.ToString() : "";
|
||||||
},
|
},
|
||||||
|
|
||||||
VideoResolutionFeedbackFunc = () =>
|
VideoResolutionFeedbackFunc = () =>
|
||||||
{
|
{
|
||||||
if (ActualActiveVideoInput == eVst.Hdmi1)
|
if (ActualActiveVideoInput == eVst.Hdmi1)
|
||||||
return tx.HdmiInputs[1].VideoAttributes.GetVideoResolutionString();
|
return tx.HdmiInputs[1].VideoAttributes.GetVideoResolutionString();
|
||||||
if (ActualActiveVideoInput == eVst.Hdmi2)
|
if (ActualActiveVideoInput == eVst.Hdmi2)
|
||||||
return tx.HdmiInputs[2].VideoAttributes.GetVideoResolutionString();
|
return tx.HdmiInputs[2].VideoAttributes.GetVideoResolutionString();
|
||||||
return ActualActiveVideoInput == eVst.Vga ? tx.VgaInput.VideoAttributes.GetVideoResolutionString() : "";
|
return ActualActiveVideoInput == eVst.Vga ? tx.VgaInput.VideoAttributes.GetVideoResolutionString() : "";
|
||||||
},
|
},
|
||||||
VideoSyncFeedbackFunc = () =>
|
VideoSyncFeedbackFunc = () =>
|
||||||
(ActualActiveVideoInput == eVst.Hdmi1
|
(ActualActiveVideoInput == eVst.Hdmi1
|
||||||
&& tx.HdmiInputs[1].SyncDetectedFeedback.BoolValue)
|
&& tx.HdmiInputs[1].SyncDetectedFeedback.BoolValue)
|
||||||
|| (ActualActiveVideoInput == eVst.Hdmi2
|
|| (ActualActiveVideoInput == eVst.Hdmi2
|
||||||
&& tx.HdmiInputs[2].SyncDetectedFeedback.BoolValue)
|
&& tx.HdmiInputs[2].SyncDetectedFeedback.BoolValue)
|
||||||
|| (ActualActiveVideoInput == eVst.Vga
|
|| (ActualActiveVideoInput == eVst.Vga
|
||||||
&& tx.VgaInput.SyncDetectedFeedback.BoolValue)
|
&& tx.VgaInput.SyncDetectedFeedback.BoolValue)
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
AnyVideoInput = new RoutingInputPortWithVideoStatuses(DmPortName.AnyVideoIn,
|
AnyVideoInput = new RoutingInputPortWithVideoStatuses(DmPortName.AnyVideoIn,
|
||||||
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.None, 0, this, combinedFuncs);
|
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.None, 0, this, combinedFuncs);
|
||||||
|
|
||||||
DmOut = new RoutingOutputPort(DmPortName.DmOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
|
DmOut = new RoutingOutputPort(DmPortName.DmOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
|
||||||
eRoutingPortConnectionType.DmCat, null, this);
|
eRoutingPortConnectionType.DmCat, null, this);
|
||||||
HdmiLoopOut = new RoutingOutputPort(DmPortName.HdmiLoopOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
|
HdmiLoopOut = new RoutingOutputPort(DmPortName.HdmiLoopOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
|
||||||
eRoutingPortConnectionType.Hdmi, null, this);
|
eRoutingPortConnectionType.Hdmi, null, this);
|
||||||
|
|
||||||
|
|
||||||
AddToFeedbackList(ActiveVideoInputFeedback, VideoSourceNumericFeedback, AudioSourceNumericFeedback,
|
AddToFeedbackList(ActiveVideoInputFeedback, VideoSourceNumericFeedback, AudioSourceNumericFeedback,
|
||||||
AnyVideoInput.VideoStatus.HasVideoStatusFeedback, AnyVideoInput.VideoStatus.HdcpActiveFeedback,
|
AnyVideoInput.VideoStatus.HasVideoStatusFeedback, AnyVideoInput.VideoStatus.HdcpActiveFeedback,
|
||||||
AnyVideoInput.VideoStatus.HdcpStateFeedback, AnyVideoInput.VideoStatus.VideoResolutionFeedback,
|
AnyVideoInput.VideoStatus.HdcpStateFeedback, AnyVideoInput.VideoStatus.VideoResolutionFeedback,
|
||||||
AnyVideoInput.VideoStatus.VideoSyncFeedback, HdmiIn1HdcpCapabilityFeedback, HdmiIn2HdcpCapabilityFeedback,
|
AnyVideoInput.VideoStatus.VideoSyncFeedback, HdmiIn1HdcpCapabilityFeedback, HdmiIn2HdcpCapabilityFeedback,
|
||||||
Hdmi1VideoSyncFeedback, Hdmi2VideoSyncFeedback, VgaVideoSyncFeedback);
|
Hdmi1VideoSyncFeedback, Hdmi2VideoSyncFeedback, VgaVideoSyncFeedback);
|
||||||
|
|
||||||
// Set Ports for CEC
|
// Set Ports for CEC
|
||||||
HdmiIn1.Port = Tx.HdmiInputs[1];
|
HdmiIn1.Port = Tx.HdmiInputs[1];
|
||||||
HdmiIn2.Port = Tx.HdmiInputs[2];
|
HdmiIn2.Port = Tx.HdmiInputs[2];
|
||||||
HdmiLoopOut.Port = Tx.HdmiOutput;
|
HdmiLoopOut.Port = Tx.HdmiOutput;
|
||||||
DmOut.Port = Tx.DmOutput;
|
DmOut.Port = Tx.DmOutput;
|
||||||
}
|
}
|
||||||
|
|
||||||
void VgaInputOnInputStreamChange(EndpointInputStream inputStream, EndpointInputStreamEventArgs args)
|
void VgaInputOnInputStreamChange(EndpointInputStream inputStream, EndpointInputStreamEventArgs args)
|
||||||
@@ -234,13 +234,13 @@ namespace PepperDash.Essentials.DM
|
|||||||
VgaVideoSyncFeedback.FireUpdate();
|
VgaVideoSyncFeedback.FireUpdate();
|
||||||
break;
|
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);
|
||||||
|
|
||||||
switch (id)
|
switch (id)
|
||||||
{
|
{
|
||||||
case VideoControlsEventIds.BrightnessFeedbackEventId:
|
case VideoControlsEventIds.BrightnessFeedbackEventId:
|
||||||
@@ -249,76 +249,76 @@ namespace PepperDash.Essentials.DM
|
|||||||
case VideoControlsEventIds.ContrastFeedbackEventId:
|
case VideoControlsEventIds.ContrastFeedbackEventId:
|
||||||
VgaContrastFeedback.FireUpdate();
|
VgaContrastFeedback.FireUpdate();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public override bool CustomActivate()
|
public override bool CustomActivate()
|
||||||
{
|
{
|
||||||
// Link up all of these damned events to the various RoutingPorts via a helper handler
|
// Link up all of these damned events to the various RoutingPorts via a helper handler
|
||||||
Tx.HdmiInputs[1].InputStreamChange += (o, a) => FowardInputStreamChange(HdmiIn1, a.EventId);
|
Tx.HdmiInputs[1].InputStreamChange += (o, a) => FowardInputStreamChange(HdmiIn1, a.EventId);
|
||||||
Tx.HdmiInputs[1].VideoAttributes.AttributeChange += (o, a) => ForwardVideoAttributeChange(HdmiIn1, a.EventId);
|
Tx.HdmiInputs[1].VideoAttributes.AttributeChange += (o, a) => ForwardVideoAttributeChange(HdmiIn1, a.EventId);
|
||||||
|
|
||||||
Tx.HdmiInputs[2].InputStreamChange += (o, a) => FowardInputStreamChange(HdmiIn2, a.EventId);
|
Tx.HdmiInputs[2].InputStreamChange += (o, a) => FowardInputStreamChange(HdmiIn2, a.EventId);
|
||||||
Tx.HdmiInputs[2].VideoAttributes.AttributeChange += (o, a) => ForwardVideoAttributeChange(HdmiIn2, a.EventId);
|
Tx.HdmiInputs[2].VideoAttributes.AttributeChange += (o, a) => ForwardVideoAttributeChange(HdmiIn2, a.EventId);
|
||||||
|
|
||||||
Tx.VgaInput.InputStreamChange += (o, a) => FowardInputStreamChange(VgaIn, a.EventId);
|
Tx.VgaInput.InputStreamChange += (o, a) => FowardInputStreamChange(VgaIn, a.EventId);
|
||||||
Tx.VgaInput.VideoAttributes.AttributeChange += (o, a) => ForwardVideoAttributeChange(VgaIn, a.EventId);
|
Tx.VgaInput.VideoAttributes.AttributeChange += (o, a) => ForwardVideoAttributeChange(VgaIn, a.EventId);
|
||||||
|
|
||||||
// Base does register and sets up comm monitoring.
|
// Base does register and sets up comm monitoring.
|
||||||
return base.CustomActivate();
|
return base.CustomActivate();
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
||||||
{
|
{
|
||||||
var joinMap = GetDmTxJoinMap(joinStart, joinMapKey);
|
var joinMap = GetDmTxJoinMap(joinStart, joinMapKey);
|
||||||
|
|
||||||
if (Hdmi1VideoSyncFeedback != null)
|
if (Hdmi1VideoSyncFeedback != null)
|
||||||
{
|
{
|
||||||
Hdmi1VideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.Input1VideoSyncStatus.JoinNumber]);
|
Hdmi1VideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.Input1VideoSyncStatus.JoinNumber]);
|
||||||
}
|
}
|
||||||
if (Hdmi2VideoSyncFeedback != null)
|
if (Hdmi2VideoSyncFeedback != null)
|
||||||
{
|
{
|
||||||
Hdmi2VideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.Input2VideoSyncStatus.JoinNumber]);
|
Hdmi2VideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.Input2VideoSyncStatus.JoinNumber]);
|
||||||
}
|
}
|
||||||
if (VgaVideoSyncFeedback != null)
|
if (VgaVideoSyncFeedback != null)
|
||||||
{
|
{
|
||||||
VgaVideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.Input3VideoSyncStatus.JoinNumber]);
|
VgaVideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.Input3VideoSyncStatus.JoinNumber]);
|
||||||
}
|
}
|
||||||
|
|
||||||
LinkDmTxToApi(this, trilist, joinMap, bridge);
|
LinkDmTxToApi(this, trilist, joinMap, bridge);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Enables or disables free run
|
/// Enables or disables free run
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="enable"></param>
|
/// <param name="enable"></param>
|
||||||
public void SetFreeRunEnabled(bool enable)
|
public void SetFreeRunEnabled(bool enable)
|
||||||
{
|
{
|
||||||
Tx.VgaInput.FreeRun = enable ? eDmFreeRunSetting.Enabled : eDmFreeRunSetting.Disabled;
|
Tx.VgaInput.FreeRun = enable ? eDmFreeRunSetting.Enabled : eDmFreeRunSetting.Disabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Sets the VGA brightness level
|
/// Sets the VGA brightness level
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="level"></param>
|
/// <param name="level"></param>
|
||||||
public void SetVgaBrightness(ushort level)
|
public void SetVgaBrightness(ushort level)
|
||||||
{
|
{
|
||||||
Tx.VgaInput.VideoControls.Brightness.UShortValue = level;
|
Tx.VgaInput.VideoControls.Brightness.UShortValue = level;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Sets the VGA contrast level
|
/// Sets the VGA contrast level
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="level"></param>
|
/// <param name="level"></param>
|
||||||
public void SetVgaContrast(ushort level)
|
public void SetVgaContrast(ushort level)
|
||||||
{
|
{
|
||||||
Tx.VgaInput.VideoControls.Contrast.UShortValue = level;
|
Tx.VgaInput.VideoControls.Contrast.UShortValue = level;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public void ExecuteNumericSwitch(ushort input, ushort output, eRoutingSignalType type)
|
public void ExecuteNumericSwitch(ushort input, ushort output, eRoutingSignalType type)
|
||||||
{
|
{
|
||||||
Debug.Console(2, this, "Executing Numeric Switch to input {0}.", input);
|
Debug.Console(2, this, "Executing Numeric Switch to input {0}.", input);
|
||||||
@@ -326,76 +326,76 @@ namespace PepperDash.Essentials.DM
|
|||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
case eRoutingSignalType.Video:
|
case eRoutingSignalType.Video:
|
||||||
switch (input)
|
switch (input)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
{
|
{
|
||||||
ExecuteSwitch(eVst.Auto, null, type);
|
ExecuteSwitch(eVst.Auto, null, type);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 1:
|
case 1:
|
||||||
{
|
{
|
||||||
ExecuteSwitch(HdmiIn1.Selector, null, type);
|
ExecuteSwitch(HdmiIn1.Selector, null, type);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 2:
|
case 2:
|
||||||
{
|
{
|
||||||
ExecuteSwitch(HdmiIn2.Selector, null, type);
|
ExecuteSwitch(HdmiIn2.Selector, null, type);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 3:
|
case 3:
|
||||||
{
|
{
|
||||||
ExecuteSwitch(VgaIn.Selector, null, type);
|
ExecuteSwitch(VgaIn.Selector, null, type);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 4:
|
case 4:
|
||||||
{
|
{
|
||||||
ExecuteSwitch(eVst.AllDisabled, null, type);
|
ExecuteSwitch(eVst.AllDisabled, null, type);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case eRoutingSignalType.Audio:
|
case eRoutingSignalType.Audio:
|
||||||
switch (input)
|
switch (input)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
{
|
{
|
||||||
ExecuteSwitch(eAst.Auto, null, type);
|
ExecuteSwitch(eAst.Auto, null, type);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 1:
|
case 1:
|
||||||
{
|
{
|
||||||
ExecuteSwitch(eAst.Hdmi1, null, type);
|
ExecuteSwitch(eAst.Hdmi1, null, type);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 2:
|
case 2:
|
||||||
{
|
{
|
||||||
ExecuteSwitch(eAst.Hdmi2, null, type);
|
ExecuteSwitch(eAst.Hdmi2, null, type);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 3:
|
case 3:
|
||||||
{
|
{
|
||||||
ExecuteSwitch(eAst.AudioIn, null, type);
|
ExecuteSwitch(eAst.AudioIn, null, type);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 4:
|
case 4:
|
||||||
{
|
{
|
||||||
ExecuteSwitch(eAst.AllDisabled, null, type);
|
ExecuteSwitch(eAst.AllDisabled, null, type);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ExecuteSwitch(object inputSelector, object outputSelector, eRoutingSignalType signalType)
|
public void ExecuteSwitch(object inputSelector, object outputSelector, eRoutingSignalType signalType)
|
||||||
{
|
{
|
||||||
if ((signalType | eRoutingSignalType.Video) == eRoutingSignalType.Video)
|
if ((signalType | eRoutingSignalType.Video) == eRoutingSignalType.Video)
|
||||||
Tx.VideoSource = (eVst)inputSelector;
|
Tx.VideoSource = (eVst)inputSelector;
|
||||||
if ((signalType | eRoutingSignalType.Audio) == eRoutingSignalType.Audio)
|
if ((signalType | eRoutingSignalType.Audio) == eRoutingSignalType.Audio)
|
||||||
Tx.AudioSource = (eAst)inputSelector;
|
Tx.AudioSource = (eAst)inputSelector;
|
||||||
}
|
}
|
||||||
|
|
||||||
void InputStreamChangeEvent(EndpointInputStream inputStream, EndpointInputStreamEventArgs args)
|
void InputStreamChangeEvent(EndpointInputStream inputStream, EndpointInputStreamEventArgs args)
|
||||||
{
|
{
|
||||||
Debug.Console(2, "{0} event {1} stream {2}", this.Tx.ToString(), inputStream.ToString(), args.EventId.ToString());
|
Debug.Console(2, "{0} event {1} stream {2}", this.Tx.ToString(), inputStream.ToString(), args.EventId.ToString());
|
||||||
@@ -405,7 +405,7 @@ namespace PepperDash.Essentials.DM
|
|||||||
case EndpointInputStreamEventIds.HdcpSupportOffFeedbackEventId:
|
case EndpointInputStreamEventIds.HdcpSupportOffFeedbackEventId:
|
||||||
case EndpointInputStreamEventIds.HdcpSupportOnFeedbackEventId:
|
case EndpointInputStreamEventIds.HdcpSupportOnFeedbackEventId:
|
||||||
case EndpointInputStreamEventIds.HdcpCapabilityFeedbackEventId:
|
case EndpointInputStreamEventIds.HdcpCapabilityFeedbackEventId:
|
||||||
if (inputStream == Tx.HdmiInputs[1]) HdmiIn1HdcpCapabilityFeedback.FireUpdate();
|
if (inputStream == Tx.HdmiInputs[1]) HdmiIn1HdcpCapabilityFeedback.FireUpdate();
|
||||||
if (inputStream == Tx.HdmiInputs[2]) HdmiIn2HdcpCapabilityFeedback.FireUpdate();
|
if (inputStream == Tx.HdmiInputs[2]) HdmiIn2HdcpCapabilityFeedback.FireUpdate();
|
||||||
HdcpStateFeedback.FireUpdate();
|
HdcpStateFeedback.FireUpdate();
|
||||||
break;
|
break;
|
||||||
@@ -450,57 +450,57 @@ namespace PepperDash.Essentials.DM
|
|||||||
OnSwitchChange(new RoutingNumericEventArgs(1, AudioSourceNumericFeedback.UShortValue, OutputPorts.First(), localInputAudioPort, eRoutingSignalType.Audio));
|
OnSwitchChange(new RoutingNumericEventArgs(1, AudioSourceNumericFeedback.UShortValue, OutputPorts.First(), localInputAudioPort, eRoutingSignalType.Audio));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Relays the input stream change to the appropriate RoutingInputPort.
|
/// Relays the input stream change to the appropriate RoutingInputPort.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
void FowardInputStreamChange(RoutingInputPortWithVideoStatuses inputPort, int eventId)
|
void FowardInputStreamChange(RoutingInputPortWithVideoStatuses inputPort, int eventId)
|
||||||
{
|
{
|
||||||
if (eventId != EndpointInputStreamEventIds.SyncDetectedFeedbackEventId) return;
|
if (eventId != EndpointInputStreamEventIds.SyncDetectedFeedbackEventId) return;
|
||||||
inputPort.VideoStatus.VideoSyncFeedback.FireUpdate();
|
inputPort.VideoStatus.VideoSyncFeedback.FireUpdate();
|
||||||
AnyVideoInput.VideoStatus.VideoSyncFeedback.FireUpdate();
|
AnyVideoInput.VideoStatus.VideoSyncFeedback.FireUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Relays the VideoAttributes change to a RoutingInputPort
|
/// Relays the VideoAttributes change to a RoutingInputPort
|
||||||
/// </summary>
|
/// </summary>
|
||||||
void ForwardVideoAttributeChange(RoutingInputPortWithVideoStatuses inputPort, int eventId)
|
void ForwardVideoAttributeChange(RoutingInputPortWithVideoStatuses inputPort, int eventId)
|
||||||
{
|
{
|
||||||
//// LOCATION: Crestron.SimplSharpPro.DM.VideoAttributeEventIds
|
//// LOCATION: Crestron.SimplSharpPro.DM.VideoAttributeEventIds
|
||||||
//Debug.Console(2, this, "VideoAttributes_AttributeChange event id={0} from {1}",
|
//Debug.Console(2, this, "VideoAttributes_AttributeChange event id={0} from {1}",
|
||||||
// args.EventId, (sender as VideoAttributesEnhanced).Owner.GetType());
|
// args.EventId, (sender as VideoAttributesEnhanced).Owner.GetType());
|
||||||
switch (eventId)
|
switch (eventId)
|
||||||
{
|
{
|
||||||
case VideoAttributeEventIds.HdcpActiveFeedbackEventId:
|
case VideoAttributeEventIds.HdcpActiveFeedbackEventId:
|
||||||
inputPort.VideoStatus.HdcpActiveFeedback.FireUpdate();
|
inputPort.VideoStatus.HdcpActiveFeedback.FireUpdate();
|
||||||
AnyVideoInput.VideoStatus.HdcpActiveFeedback.FireUpdate();
|
AnyVideoInput.VideoStatus.HdcpActiveFeedback.FireUpdate();
|
||||||
break;
|
break;
|
||||||
case VideoAttributeEventIds.HdcpStateFeedbackEventId:
|
case VideoAttributeEventIds.HdcpStateFeedbackEventId:
|
||||||
inputPort.VideoStatus.HdcpStateFeedback.FireUpdate();
|
inputPort.VideoStatus.HdcpStateFeedback.FireUpdate();
|
||||||
AnyVideoInput.VideoStatus.HdcpStateFeedback.FireUpdate();
|
AnyVideoInput.VideoStatus.HdcpStateFeedback.FireUpdate();
|
||||||
break;
|
break;
|
||||||
case VideoAttributeEventIds.HorizontalResolutionFeedbackEventId:
|
case VideoAttributeEventIds.HorizontalResolutionFeedbackEventId:
|
||||||
case VideoAttributeEventIds.VerticalResolutionFeedbackEventId:
|
case VideoAttributeEventIds.VerticalResolutionFeedbackEventId:
|
||||||
inputPort.VideoStatus.VideoResolutionFeedback.FireUpdate();
|
inputPort.VideoStatus.VideoResolutionFeedback.FireUpdate();
|
||||||
AnyVideoInput.VideoStatus.VideoResolutionFeedback.FireUpdate();
|
AnyVideoInput.VideoStatus.VideoResolutionFeedback.FireUpdate();
|
||||||
break;
|
break;
|
||||||
case VideoAttributeEventIds.FramesPerSecondFeedbackEventId:
|
case VideoAttributeEventIds.FramesPerSecondFeedbackEventId:
|
||||||
inputPort.VideoStatus.VideoResolutionFeedback.FireUpdate();
|
inputPort.VideoStatus.VideoResolutionFeedback.FireUpdate();
|
||||||
AnyVideoInput.VideoStatus.VideoResolutionFeedback.FireUpdate();
|
AnyVideoInput.VideoStatus.VideoResolutionFeedback.FireUpdate();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#region IIROutputPorts Members
|
#region IIROutputPorts Members
|
||||||
public CrestronCollection<IROutputPort> IROutputPorts { get { return Tx.IROutputPorts; } }
|
public CrestronCollection<IROutputPort> IROutputPorts { get { return Tx.IROutputPorts; } }
|
||||||
public int NumberOfIROutputPorts { get { return Tx.NumberOfIROutputPorts; } }
|
public int NumberOfIROutputPorts { get { return Tx.NumberOfIROutputPorts; } }
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region IComPorts Members
|
#region IComPorts Members
|
||||||
public CrestronCollection<ComPort> ComPorts { get { return Tx.ComPorts; } }
|
public CrestronCollection<ComPort> ComPorts { get { return Tx.ComPorts; } }
|
||||||
public int NumberOfComPorts { get { return Tx.NumberOfComPorts; } }
|
public int NumberOfComPorts { get { return Tx.NumberOfComPorts; } }
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -72,6 +72,7 @@ namespace PepperDash.Essentials.DM
|
|||||||
HdmiIn.Port = Tx;
|
HdmiIn.Port = Tx;
|
||||||
|
|
||||||
PreventRegistration = true;
|
PreventRegistration = true;
|
||||||
|
tx.Register();
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ namespace PepperDash.Essentials.DM
|
|||||||
|
|
||||||
|
|
||||||
[Description("Wrapper class for DM-TX-4K-Z-302-C")]
|
[Description("Wrapper class for DM-TX-4K-Z-302-C")]
|
||||||
public class DmTx4kz302CController : DmTxControllerBase, ITxRoutingWithFeedback, IHasFeedback,
|
public class DmTx4kz302CController : DmTxControllerBase, ITxRoutingWithFeedback,
|
||||||
IIROutputPorts, IComPorts
|
IIROutputPorts, IComPorts
|
||||||
{
|
{
|
||||||
public DmTx4kz302C Tx { get; private set; }
|
public DmTx4kz302C Tx { get; private set; }
|
||||||
@@ -34,6 +34,7 @@ namespace PepperDash.Essentials.DM
|
|||||||
public IntFeedback AudioSourceNumericFeedback { get; protected set; }
|
public IntFeedback AudioSourceNumericFeedback { get; protected set; }
|
||||||
public IntFeedback HdmiIn1HdcpCapabilityFeedback { get; protected set; }
|
public IntFeedback HdmiIn1HdcpCapabilityFeedback { get; protected set; }
|
||||||
public IntFeedback HdmiIn2HdcpCapabilityFeedback { get; protected set; }
|
public IntFeedback HdmiIn2HdcpCapabilityFeedback { get; protected set; }
|
||||||
|
public IntFeedback DisplayPortInHdcpCapabilityFeedback { get; protected set; }
|
||||||
public BoolFeedback Hdmi1VideoSyncFeedback { get; protected set; }
|
public BoolFeedback Hdmi1VideoSyncFeedback { get; protected set; }
|
||||||
public BoolFeedback Hdmi2VideoSyncFeedback { get; protected set; }
|
public BoolFeedback Hdmi2VideoSyncFeedback { get; protected set; }
|
||||||
public BoolFeedback DisplayPortVideoSyncFeedback { get; protected set; }
|
public BoolFeedback DisplayPortVideoSyncFeedback { get; protected set; }
|
||||||
@@ -131,12 +132,25 @@ namespace PepperDash.Essentials.DM
|
|||||||
|
|
||||||
HdmiIn2HdcpCapabilityFeedback = new IntFeedback("HdmiIn2HdcpCapability", () => (int)tx.HdmiInputs[2].HdcpCapabilityFeedback);
|
HdmiIn2HdcpCapabilityFeedback = new IntFeedback("HdmiIn2HdcpCapability", () => (int)tx.HdmiInputs[2].HdcpCapabilityFeedback);
|
||||||
|
|
||||||
|
DisplayPortInHdcpCapabilityFeedback = new IntFeedback("DisplayPortHdcpCapability",
|
||||||
|
() => (int) tx.DisplayPortInput.HdcpCapabilityFeedback);
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
HdcpStateFeedback =
|
HdcpStateFeedback =
|
||||||
new IntFeedback(
|
new IntFeedback(
|
||||||
() =>
|
() =>
|
||||||
tx.HdmiInputs[1].HdcpCapabilityFeedback > tx.HdmiInputs[2].HdcpCapabilityFeedback
|
tx.HdmiInputs[1].HdcpCapabilityFeedback > tx.HdmiInputs[2].HdcpCapabilityFeedback
|
||||||
? (int)tx.HdmiInputs[1].HdcpCapabilityFeedback
|
? (int)tx.HdmiInputs[1].HdcpCapabilityFeedback
|
||||||
: (int)tx.HdmiInputs[2].HdcpCapabilityFeedback);
|
: (int)tx.HdmiInputs[2].HdcpCapabilityFeedback);
|
||||||
|
*/
|
||||||
|
|
||||||
|
//yeah this is gross - but it's the quickest way to do this...
|
||||||
|
HdcpStateFeedback = new IntFeedback(() => {
|
||||||
|
var states = new[] {(int) tx.DisplayPortInput.HdcpCapabilityFeedback, (int) tx.HdmiInputs[1].HdcpCapabilityFeedback, (int) tx.HdmiInputs[2].HdcpCapabilityFeedback};
|
||||||
|
|
||||||
|
return states.Max();
|
||||||
|
});
|
||||||
|
|
||||||
HdcpSupportCapability = eHdcpCapabilityType.Hdcp2_2Support;
|
HdcpSupportCapability = eHdcpCapabilityType.Hdcp2_2Support;
|
||||||
|
|
||||||
@@ -146,7 +160,6 @@ namespace PepperDash.Essentials.DM
|
|||||||
|
|
||||||
DisplayPortVideoSyncFeedback = new BoolFeedback(() => (bool)tx.DisplayPortInput.SyncDetectedFeedback.BoolValue);
|
DisplayPortVideoSyncFeedback = new BoolFeedback(() => (bool)tx.DisplayPortInput.SyncDetectedFeedback.BoolValue);
|
||||||
|
|
||||||
|
|
||||||
var combinedFuncs = new VideoStatusFuncsWrapper
|
var combinedFuncs = new VideoStatusFuncsWrapper
|
||||||
{
|
{
|
||||||
HdcpActiveFeedbackFunc = () =>
|
HdcpActiveFeedbackFunc = () =>
|
||||||
@@ -411,8 +424,7 @@ namespace PepperDash.Essentials.DM
|
|||||||
AnyVideoInput.VideoStatus.VideoResolutionFeedback.FireUpdate();
|
AnyVideoInput.VideoStatus.VideoResolutionFeedback.FireUpdate();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#region IIROutputPorts Members
|
#region IIROutputPorts Members
|
||||||
public CrestronCollection<IROutputPort> IROutputPorts { get { return Tx.IROutputPorts; } }
|
public CrestronCollection<IROutputPort> IROutputPorts { get { return Tx.IROutputPorts; } }
|
||||||
|
|||||||
@@ -126,6 +126,7 @@ namespace PepperDash.Essentials.DM
|
|||||||
var parentDev = DeviceManager.GetDeviceForKey(pKey);
|
var parentDev = DeviceManager.GetDeviceForKey(pKey);
|
||||||
DMInput dmInput;
|
DMInput dmInput;
|
||||||
BasicDmTxControllerBase tx;
|
BasicDmTxControllerBase tx;
|
||||||
|
bool useChassisForOfflineFeedback = false;
|
||||||
|
|
||||||
if (parentDev is DmChassisController)
|
if (parentDev is DmChassisController)
|
||||||
{
|
{
|
||||||
@@ -155,15 +156,23 @@ namespace PepperDash.Essentials.DM
|
|||||||
chassis is DmMd128x128 || chassis is DmMd64x64)
|
chassis is DmMd128x128 || chassis is DmMd64x64)
|
||||||
{
|
{
|
||||||
tx = GetDmTxForChassisWithoutIpId(key, name, typeName, dmInput);
|
tx = GetDmTxForChassisWithoutIpId(key, name, typeName, dmInput);
|
||||||
Debug.Console(0, "DM endpoint output {0} is for Cpu3, changing online feedback to chassis", num);
|
useChassisForOfflineFeedback = true;
|
||||||
tx.IsOnline.SetValueFunc(() => switchDev.InputEndpointOnlineFeedbacks[num].BoolValue);
|
|
||||||
switchDev.InputEndpointOnlineFeedbacks[num].OutputChange += (o, a) => tx.IsOnline.FireUpdate();
|
|
||||||
return tx;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return GetDmTxForChassisWithIpId(key, name, typeName, ipid, dmInput);
|
tx = GetDmTxForChassisWithIpId(key, name, typeName, ipid, dmInput);
|
||||||
|
if (typeName == "hdbasettx" || typeName == "dmtx4k100c1g")
|
||||||
|
{
|
||||||
|
useChassisForOfflineFeedback = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
if (useChassisForOfflineFeedback)
|
||||||
|
{
|
||||||
|
Debug.Console(0, "DM endpoint output {0} does not have direct online feedback, changing online feedback to chassis", num);
|
||||||
|
tx.IsOnline.SetValueFunc(() => switchDev.InputEndpointOnlineFeedbacks[num].BoolValue);
|
||||||
|
switchDev.InputEndpointOnlineFeedbacks[num].OutputChange += (o, a) => tx.IsOnline.FireUpdate();
|
||||||
|
}
|
||||||
|
return tx;
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
@@ -203,15 +212,23 @@ namespace PepperDash.Essentials.DM
|
|||||||
if(Global.ControlSystemIsDmps4kType)
|
if(Global.ControlSystemIsDmps4kType)
|
||||||
{
|
{
|
||||||
tx = GetDmTxForChassisWithoutIpId(key, name, typeName, dmInput);
|
tx = GetDmTxForChassisWithoutIpId(key, name, typeName, dmInput);
|
||||||
Debug.Console(0, "DM endpoint output {0} is for DMPS3-4K, changing online feedback to chassis", num);
|
useChassisForOfflineFeedback = true;
|
||||||
tx.IsOnline.SetValueFunc(() => dmpsDev.InputEndpointOnlineFeedbacks[num].BoolValue);
|
|
||||||
dmpsDev.InputEndpointOnlineFeedbacks[num].OutputChange += (o, a) => tx.IsOnline.FireUpdate();
|
|
||||||
return tx;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return GetDmTxForChassisWithIpId(key, name, typeName, ipid, dmInput);
|
tx = GetDmTxForChassisWithIpId(key, name, typeName, ipid, dmInput);
|
||||||
|
if (typeName == "hdbasettx" || typeName == "dmtx4k100c1g")
|
||||||
|
{
|
||||||
|
useChassisForOfflineFeedback = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
if (useChassisForOfflineFeedback)
|
||||||
|
{
|
||||||
|
Debug.Console(0, "DM endpoint output {0} does not have direct online feedback, changing online feedback to chassis", num);
|
||||||
|
tx.IsOnline.SetValueFunc(() => dmpsDev.InputEndpointOnlineFeedbacks[num].BoolValue);
|
||||||
|
dmpsDev.InputEndpointOnlineFeedbacks[num].OutputChange += (o, a) => tx.IsOnline.FireUpdate();
|
||||||
|
}
|
||||||
|
return tx;
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
@@ -377,6 +394,26 @@ namespace PepperDash.Essentials.DM
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (txR.InputPorts[DmPortName.DisplayPortIn] != null)
|
||||||
|
{
|
||||||
|
var inputPort = txR.InputPorts[DmPortName.DisplayPortIn];
|
||||||
|
|
||||||
|
if (tx.Feedbacks["DisplayPortInHdcpCapability"] != null)
|
||||||
|
{
|
||||||
|
var intFeedback = tx.Feedbacks["DisplayPortInHdcpCapability"] as IntFeedback;
|
||||||
|
if (intFeedback != null)
|
||||||
|
intFeedback.LinkInputSig(trilist.UShortInput[joinMap.Port3HdcpState.JoinNumber]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (inputPort.ConnectionType == eRoutingPortConnectionType.Hdmi && inputPort.Port != null)
|
||||||
|
{
|
||||||
|
var port = inputPort.Port as EndpointDisplayPortInput;
|
||||||
|
|
||||||
|
SetHdcpCapabilityAction(hdcpTypeSimple, port, joinMap.Port3HdcpState.JoinNumber, trilist);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var txFreeRun = tx as IHasFreeRun;
|
var txFreeRun = tx as IHasFreeRun;
|
||||||
@@ -424,6 +461,20 @@ namespace PepperDash.Essentials.DM
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void SetHdcpCapabilityAction(bool hdcpTypeSimple, EndpointDisplayPortInput port, uint join,
|
||||||
|
BasicTriList trilist)
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
trilist.SetUShortSigAction(join,
|
||||||
|
s =>
|
||||||
|
{
|
||||||
|
port.HdcpCapability = (eHdcpCapabilityType) s;
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class DmTxControllerFactory : EssentialsDeviceFactory<DmTxControllerBase>
|
public class DmTxControllerFactory : EssentialsDeviceFactory<DmTxControllerBase>
|
||||||
|
|||||||
@@ -52,6 +52,9 @@ namespace PepperDash.Essentials.DM
|
|||||||
IsOnline.SetValueFunc(() => controller.InputEndpointOnlineFeedbacks[num].BoolValue);
|
IsOnline.SetValueFunc(() => controller.InputEndpointOnlineFeedbacks[num].BoolValue);
|
||||||
controller.InputEndpointOnlineFeedbacks[num].OutputChange += (o, a) => IsOnline.FireUpdate();
|
controller.InputEndpointOnlineFeedbacks[num].OutputChange += (o, a) => IsOnline.FireUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PreventRegistration = true;
|
||||||
|
tx.Register();
|
||||||
}
|
}
|
||||||
|
|
||||||
#region IRoutingInputs Members
|
#region IRoutingInputs Members
|
||||||
|
|||||||
@@ -105,6 +105,7 @@
|
|||||||
<Compile Include="Chassis\HdMdNxM4kEBridgeableController.cs" />
|
<Compile Include="Chassis\HdMdNxM4kEBridgeableController.cs" />
|
||||||
<Compile Include="Chassis\HdMdNxM4kEController.cs" />
|
<Compile Include="Chassis\HdMdNxM4kEController.cs" />
|
||||||
<Compile Include="Config\InputPropertiesConfig.cs" />
|
<Compile Include="Config\InputPropertiesConfig.cs" />
|
||||||
|
<Compile Include="Endpoints\DGEs\DgeJoinMap.cs" />
|
||||||
<Compile Include="Endpoints\DGEs\DmDge200CController.cs" />
|
<Compile Include="Endpoints\DGEs\DmDge200CController.cs" />
|
||||||
<Compile Include="Endpoints\Receivers\DmRmc4kZ100CController.cs" />
|
<Compile Include="Endpoints\Receivers\DmRmc4kZ100CController.cs" />
|
||||||
<Compile Include="Endpoints\Receivers\DmRmc4kZScalerCController.cs" />
|
<Compile Include="Endpoints\Receivers\DmRmc4kZScalerCController.cs" />
|
||||||
|
|||||||
@@ -1004,7 +1004,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
|
|
||||||
if (codec.DirectoryRoot != null)
|
if (codec.DirectoryRoot != null)
|
||||||
{
|
{
|
||||||
trilist.SetUshort(joinMap.DirectoryRowCount.JoinNumber, (ushort)codec.DirectoryRoot.CurrentDirectoryResults.Count);
|
var contactsCount = codec.DirectoryRoot.CurrentDirectoryResults.Where(c => c.ParentFolderId.Equals("root")).ToList().Count;
|
||||||
|
trilist.SetUshort(joinMap.DirectoryRowCount.JoinNumber, (ushort)contactsCount);
|
||||||
|
Debug.Console(2, this, ">>> contactsCount: {0}", contactsCount);
|
||||||
|
|
||||||
var clearBytes = XSigHelpers.ClearOutputs();
|
var clearBytes = XSigHelpers.ClearOutputs();
|
||||||
|
|
||||||
@@ -1020,7 +1022,13 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
|
|
||||||
codec.DirectoryResultReturned += (sender, args) =>
|
codec.DirectoryResultReturned += (sender, args) =>
|
||||||
{
|
{
|
||||||
trilist.SetUshort(joinMap.DirectoryRowCount.JoinNumber, (ushort)args.Directory.CurrentDirectoryResults.Count);
|
var isRoot = codec.CurrentDirectoryResultIsNotDirectoryRoot.BoolValue == false;
|
||||||
|
var argsCount = isRoot
|
||||||
|
? args.Directory.CurrentDirectoryResults.Where(a => a.ParentFolderId.Equals("root")).ToList().Count
|
||||||
|
: args.Directory.CurrentDirectoryResults.Count;
|
||||||
|
|
||||||
|
trilist.SetUshort(joinMap.DirectoryRowCount.JoinNumber, (ushort)argsCount);
|
||||||
|
Debug.Console(2, this, ">>> argsCount: {0}", argsCount);
|
||||||
|
|
||||||
var clearBytes = XSigHelpers.ClearOutputs();
|
var clearBytes = XSigHelpers.ClearOutputs();
|
||||||
|
|
||||||
@@ -1184,46 +1192,47 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
return GetXSigString(tokenArray);
|
return GetXSigString(tokenArray);
|
||||||
}
|
}
|
||||||
|
|
||||||
private string UpdateDirectoryXSig(CodecDirectory directory, bool isRoot)
|
private string UpdateDirectoryXSig(CodecDirectory directory, bool isRoot)
|
||||||
{
|
{
|
||||||
var xSigMaxIndex = 1023;
|
var xSigMaxIndex = 1023;
|
||||||
var tokenArray = new XSigToken[directory.CurrentDirectoryResults.Count > xSigMaxIndex
|
var tokenArray = new XSigToken[directory.CurrentDirectoryResults.Count > xSigMaxIndex
|
||||||
? xSigMaxIndex
|
? xSigMaxIndex
|
||||||
: directory.CurrentDirectoryResults.Count];
|
: directory.CurrentDirectoryResults.Count];
|
||||||
|
|
||||||
Debug.Console(2, this, "IsRoot: {0}, Directory Count: {1}, TokenArray.Length: {2}", isRoot,
|
Debug.Console(2, this, "IsRoot: {0}, Directory Count: {1}, TokenArray.Length: {2}", isRoot, directory.CurrentDirectoryResults.Count, tokenArray.Length);
|
||||||
directory.CurrentDirectoryResults.Count, tokenArray.Length);
|
|
||||||
|
|
||||||
var contacts = directory.CurrentDirectoryResults.Count > xSigMaxIndex
|
var contacts = directory.CurrentDirectoryResults.Count > xSigMaxIndex
|
||||||
? directory.CurrentDirectoryResults.Take(xSigMaxIndex)
|
? directory.CurrentDirectoryResults.Take(xSigMaxIndex)
|
||||||
: directory.CurrentDirectoryResults;
|
: directory.CurrentDirectoryResults;
|
||||||
|
|
||||||
var counterIndex = 1;
|
var contactsToDisplay = isRoot
|
||||||
foreach (var entry in contacts)
|
? contacts.Where(c => c.ParentFolderId == "root")
|
||||||
{
|
: contacts.Where(c => c.ParentFolderId != "root");
|
||||||
var arrayIndex = counterIndex - 1;
|
|
||||||
var entryIndex = counterIndex;
|
|
||||||
|
|
||||||
Debug.Console(2, this, "Entry{2:0000} Name: {0}, Folder ID: {1}", entry.Name, entry.FolderId, entryIndex);
|
var counterIndex = 1;
|
||||||
|
foreach (var entry in contactsToDisplay)
|
||||||
|
{
|
||||||
|
var arrayIndex = counterIndex - 1;
|
||||||
|
var entryIndex = counterIndex;
|
||||||
|
|
||||||
if (entry is DirectoryFolder && entry.ParentFolderId == "root")
|
Debug.Console(2, this, "Entry{2:0000} Name: {0}, Folder ID: {1}, Type: {3}, ParentFolderId: {4}",
|
||||||
{
|
entry.Name, entry.FolderId, entryIndex, entry.GetType().GetCType().FullName, entry.ParentFolderId);
|
||||||
tokenArray[arrayIndex] = new XSigSerialToken(entryIndex, String.Format("[+] {0}", entry.Name));
|
|
||||||
|
|
||||||
counterIndex++;
|
if (entry is DirectoryFolder)
|
||||||
counterIndex++;
|
{
|
||||||
|
tokenArray[arrayIndex] = new XSigSerialToken(entryIndex, String.Format("[+] {0}", entry.Name));
|
||||||
|
|
||||||
continue;
|
counterIndex++;
|
||||||
}
|
|
||||||
|
|
||||||
tokenArray[arrayIndex] = new XSigSerialToken(entryIndex, entry.Name);
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
counterIndex++;
|
tokenArray[arrayIndex] = new XSigSerialToken(entryIndex, entry.Name);
|
||||||
}
|
|
||||||
|
|
||||||
return GetXSigString(tokenArray);
|
|
||||||
|
|
||||||
|
counterIndex++;
|
||||||
|
}
|
||||||
|
|
||||||
|
return GetXSigString(tokenArray);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void LinkVideoCodecCallControlsToApi(BasicTriList trilist, VideoCodecControllerJoinMap joinMap)
|
private void LinkVideoCodecCallControlsToApi(BasicTriList trilist, VideoCodecControllerJoinMap joinMap)
|
||||||
|
|||||||
@@ -303,11 +303,19 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
|||||||
{
|
{
|
||||||
var contact = new InvitableDirectoryContact { Name = c.ScreenName, ContactId = c.Jid };
|
var contact = new InvitableDirectoryContact { Name = c.ScreenName, ContactId = c.Jid };
|
||||||
|
|
||||||
contact.ContactMethods.Add(new ContactMethod() { Number = c.Jid, Device = eContactMethodDevice.Video, CallType = eContactMethodCallType.Video, ContactMethodId = c.Jid });
|
contact.ContactMethods.Add(new ContactMethod()
|
||||||
|
{
|
||||||
|
Number = c.Jid,
|
||||||
|
Device = eContactMethodDevice.Video,
|
||||||
|
CallType = eContactMethodCallType.Video,
|
||||||
|
ContactMethodId = c.Jid
|
||||||
|
});
|
||||||
|
|
||||||
if (folders.Count > 0)
|
if (folders.Count > 0)
|
||||||
{
|
{
|
||||||
contact.ParentFolderId = c.IsZoomRoom ? "rooms" : "contacts";
|
contact.ParentFolderId = c.IsZoomRoom
|
||||||
|
? roomFolder.FolderId // "rooms"
|
||||||
|
: contactFolder.FolderId; // "contacts"
|
||||||
}
|
}
|
||||||
|
|
||||||
contacts.Add(contact);
|
contacts.Add(contact);
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
<packages>
|
<packages>
|
||||||
<package id="PepperDashCore" version="1.1.4" targetFramework="net35" allowedVersions="[1.0,2.0)"/>
|
<package id="PepperDashCore" version="1.2.1" targetFramework="net35" allowedVersions="[1.0,2.0)"/>
|
||||||
</packages>
|
</packages>
|
||||||
|
|||||||
Reference in New Issue
Block a user