mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-23 16:44:49 +00:00
Compare commits
214 Commits
1.6.5-beta
...
1.7.3-hotf
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
24e59e1474 | ||
|
|
5d7cdab933 | ||
|
|
c9fee785f9 | ||
|
|
dfc90e58dc | ||
|
|
2a5810b671 | ||
|
|
9d354fb0ed | ||
|
|
52494ca13e | ||
|
|
f6059e249f | ||
|
|
cf14706961 | ||
|
|
7945bce854 | ||
|
|
44cacc839b | ||
|
|
dfebd47ef4 | ||
|
|
3c714f724d | ||
|
|
03e0dc5208 | ||
|
|
50b2c7d3af | ||
|
|
030d69c190 | ||
|
|
bdb007f6ed | ||
|
|
91abe4c09a | ||
|
|
82029894e4 | ||
|
|
3c1ed6e58a | ||
|
|
8999097100 | ||
|
|
72197e547f | ||
|
|
9b62849d9d | ||
|
|
d311b6fef9 | ||
|
|
4a642b1e36 | ||
|
|
de4f003c67 | ||
|
|
708ee1a8ff | ||
|
|
7196d0aba8 | ||
|
|
3b0a5285ab | ||
|
|
ae03b8cd7e | ||
|
|
cc159e306e | ||
|
|
0a43f43f66 | ||
|
|
0f924360c1 | ||
|
|
870f2f8fa6 | ||
|
|
aa61479adc | ||
|
|
522c107ce6 | ||
|
|
cb29775004 | ||
|
|
fccbb55344 | ||
|
|
b2402402d9 | ||
|
|
f0a3b27e3b | ||
|
|
57ebd2b608 | ||
|
|
695ff5487f | ||
|
|
66cd39c013 | ||
|
|
91eec8c258 | ||
|
|
d2c308c009 | ||
|
|
a4a99f4a9b | ||
|
|
eb114b4a95 | ||
|
|
93e8d50e55 | ||
|
|
3c6fc978d4 | ||
|
|
01ddf1721c | ||
|
|
1ee87c0499 | ||
|
|
f8ae6264f7 | ||
|
|
3e56859943 | ||
|
|
945db8a233 | ||
|
|
823f7447c3 | ||
|
|
6e4fa48b9d | ||
|
|
7e8f216afb | ||
|
|
b09c151738 | ||
|
|
56cf54a644 | ||
|
|
169e897748 | ||
|
|
748b1ca147 | ||
|
|
2e636082bb | ||
|
|
9204ad2701 | ||
|
|
8feb7a142c | ||
|
|
d990930b19 | ||
|
|
4d67279827 | ||
|
|
a78b29b0a1 | ||
|
|
2c36c0f2cb | ||
|
|
2eaf21b1e0 | ||
|
|
099e387570 | ||
|
|
c4755f23cd | ||
|
|
9c4650b4af | ||
|
|
43d7fab04d | ||
|
|
d2b7e71c4a | ||
|
|
ab6d44e604 | ||
|
|
0dc2e9d134 | ||
|
|
3a024b8d4c | ||
|
|
05e2422cb4 | ||
|
|
fc5d4f946d | ||
|
|
45c1e25e4f | ||
|
|
f11bdcfd53 | ||
|
|
9888fbf047 | ||
|
|
9171610e34 | ||
|
|
7a8c1f3165 | ||
|
|
008a052045 | ||
|
|
93a5f2e3b2 | ||
|
|
0e4edca08a | ||
|
|
f9925f9ec9 | ||
|
|
f283f82bbc | ||
|
|
ab5dd5f756 | ||
|
|
e22c71853f | ||
|
|
8bf27ecbd9 | ||
|
|
d94d003050 | ||
|
|
25c4d94366 | ||
|
|
91dda3213e | ||
|
|
b41dd23c7f | ||
|
|
14ad0eee48 | ||
|
|
56e106ff32 | ||
|
|
b67424c1e1 | ||
|
|
c366ee9d12 | ||
|
|
5ec97f2e31 | ||
|
|
98c20464d7 | ||
|
|
b1aa9c3306 | ||
|
|
db6ab3ee98 | ||
|
|
2ccf4be559 | ||
|
|
ce86255119 | ||
|
|
d69e81972e | ||
|
|
3f9d306a34 | ||
|
|
14c3914e5c | ||
|
|
b5337572c4 | ||
|
|
1d1b4f0790 | ||
|
|
ccdd8005d0 | ||
|
|
1d184f0f5e | ||
|
|
2ed9e632c6 | ||
|
|
ecba28c9cd | ||
|
|
06e8cac597 | ||
|
|
1dfdd4dd28 | ||
|
|
48585469f6 | ||
|
|
f9ba562b0b | ||
|
|
5c63a49071 | ||
|
|
3d224496a8 | ||
|
|
73addfefe7 | ||
|
|
af0e2180bd | ||
|
|
a431015853 | ||
|
|
788244fbf4 | ||
|
|
282230b28e | ||
|
|
dc010ce28c | ||
|
|
5a3597f2a7 | ||
|
|
5b889ea59c | ||
|
|
faa6e20034 | ||
|
|
82a97f8c1f | ||
|
|
6557d21aa8 | ||
|
|
a733ed69cb | ||
|
|
9877ba93a0 | ||
|
|
669f9e71bc | ||
|
|
5d2f20efd5 | ||
|
|
06dccdd97f | ||
|
|
e705f67333 | ||
|
|
4903b99eb5 | ||
|
|
38ab6626fc | ||
|
|
b44bc8fae3 | ||
|
|
7d72d54862 | ||
|
|
0a218cebb4 | ||
|
|
ed6ad6ae76 | ||
|
|
1689b15d95 | ||
|
|
010fdde45c | ||
|
|
10509991c1 | ||
|
|
c686ee394d | ||
|
|
985902092e | ||
|
|
944b72e2a8 | ||
|
|
d074be323c | ||
|
|
0098401584 | ||
|
|
0d7d5fe380 | ||
|
|
1cb9fb6058 | ||
|
|
5076ba405e | ||
|
|
3c60dfdf7b | ||
|
|
5d44b5f3ef | ||
|
|
40cdd4c1e7 | ||
|
|
f5753109d5 | ||
|
|
51e338749a | ||
|
|
e37fb33afe | ||
|
|
47af06578a | ||
|
|
ad0cbba0b1 | ||
|
|
c7a3282dd9 | ||
|
|
fd593baa07 | ||
|
|
88f1230620 | ||
|
|
cad558980f | ||
|
|
e879aba801 | ||
|
|
114fdb9545 | ||
|
|
1886ddfbaf | ||
|
|
39d2c3aab6 | ||
|
|
3cd8a1f310 | ||
|
|
b457886ee3 | ||
|
|
e27c041256 | ||
|
|
5fcafe0b38 | ||
|
|
8250246f34 | ||
|
|
d9bcaa0b1d | ||
|
|
dd6e26ae4b | ||
|
|
fac1dd3d61 | ||
|
|
e573749aa0 | ||
|
|
f22bf60eb6 | ||
|
|
d1b99fdda3 | ||
|
|
e1a4cfca4e | ||
|
|
8a43824f3d | ||
|
|
b948fc7264 | ||
|
|
d9f891dfb1 | ||
|
|
a9524bcc33 | ||
|
|
4b537cb79d | ||
|
|
1484c26434 | ||
|
|
36e8dc9fa5 | ||
|
|
8feb7037aa | ||
|
|
d8863142c7 | ||
|
|
061109c901 | ||
|
|
f95b50c99d | ||
|
|
def5cc273c | ||
|
|
e01d2c9569 | ||
|
|
415dbbb195 | ||
|
|
765d90214d | ||
|
|
36fd1dcda9 | ||
|
|
812b9b731b | ||
|
|
e80a68485d | ||
|
|
535f4ccb8e | ||
|
|
7bbdf43452 | ||
|
|
59881d6b3b | ||
|
|
085e198409 | ||
|
|
81f27fcbde | ||
|
|
50dae0ef69 | ||
|
|
e0fdefa28e | ||
|
|
f6a826505c | ||
|
|
1150d9e497 | ||
|
|
cb752850ff | ||
|
|
08c929699f | ||
|
|
1862090a89 | ||
|
|
f036c3f1cc |
12
.github/workflows/docker.yml
vendored
12
.github/workflows/docker.yml
vendored
@@ -32,7 +32,6 @@ jobs:
|
|||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
submodules: true
|
|
||||||
# Fetch all tags
|
# Fetch all tags
|
||||||
- name: Fetch tags
|
- name: Fetch tags
|
||||||
run: git fetch --tags
|
run: git fetch --tags
|
||||||
@@ -41,12 +40,11 @@ jobs:
|
|||||||
shell: powershell
|
shell: powershell
|
||||||
run: |
|
run: |
|
||||||
$version = ./.github/scripts/GenerateVersionNumber.ps1
|
$version = ./.github/scripts/GenerateVersionNumber.ps1
|
||||||
Write-Output "::set-env name=VERSION::$version"
|
echo "VERSION=$version" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||||
# Use the version number to set the version of the assemblies
|
# Use the version number to set the version of the assemblies
|
||||||
- name: Update AssemblyInfo.cs
|
- name: Update AssemblyInfo.cs
|
||||||
shell: powershell
|
shell: powershell
|
||||||
run: |
|
run: |
|
||||||
Write-Output ${{ env.VERSION }}
|
|
||||||
./.github/scripts/UpdateAssemblyVersion.ps1 ${{ env.VERSION }}
|
./.github/scripts/UpdateAssemblyVersion.ps1 ${{ env.VERSION }}
|
||||||
- name: restore Nuget Packages
|
- name: restore Nuget Packages
|
||||||
run: nuget install .\packages.config -OutputDirectory .\packages -ExcludeVersion
|
run: nuget install .\packages.config -OutputDirectory .\packages -ExcludeVersion
|
||||||
@@ -60,7 +58,7 @@ jobs:
|
|||||||
- name: Build Solution
|
- name: Build Solution
|
||||||
shell: powershell
|
shell: powershell
|
||||||
run: |
|
run: |
|
||||||
Invoke-Expression "docker run --rm --mount type=bind,source=""$($Env:GITHUB_WORKSPACE)"",target=""c:/project"" pepperdash/sspbuilder:v1.4.1 c:\cihelpers\vsidebuild.exe -Solution ""c:\project\$($Env:SOLUTION_FILE).sln"" -BuildSolutionConfiguration $($ENV:BUILD_TYPE)"
|
Invoke-Expression "docker run --rm --mount type=bind,source=""$($Env:GITHUB_WORKSPACE)"",target=""c:/project"" pepperdash/sspbuilder c:\cihelpers\vsidebuild.exe -Solution ""c:\project\$($Env:SOLUTION_FILE).sln"" -BuildSolutionConfiguration $($ENV:BUILD_TYPE)"
|
||||||
# Zip up the output files as needed
|
# Zip up the output files as needed
|
||||||
- name: Zip Build Output
|
- name: Zip Build Output
|
||||||
shell: powershell
|
shell: powershell
|
||||||
@@ -123,7 +121,7 @@ jobs:
|
|||||||
Get-ChildItem "./Version"
|
Get-ChildItem "./Version"
|
||||||
$version = Get-Content -Path ./Version/version.txt
|
$version = Get-Content -Path ./Version/version.txt
|
||||||
Write-Host "Version: $version"
|
Write-Host "Version: $version"
|
||||||
Write-Output "::set-env name=VERSION::$version"
|
echo "VERSION=$version" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||||
Remove-Item -Path ./Version/version.txt
|
Remove-Item -Path ./Version/version.txt
|
||||||
Remove-Item -Path ./Version
|
Remove-Item -Path ./Version
|
||||||
- name: Download Build output
|
- name: Download Build output
|
||||||
@@ -180,7 +178,7 @@ jobs:
|
|||||||
Get-ChildItem "./Version"
|
Get-ChildItem "./Version"
|
||||||
$version = Get-Content -Path ./Version/version.txt
|
$version = Get-Content -Path ./Version/version.txt
|
||||||
Write-Host "Version: $version"
|
Write-Host "Version: $version"
|
||||||
Write-Output "::set-env name=VERSION::$version"
|
echo "VERSION=$version" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||||
Remove-Item -Path ./Version/version.txt
|
Remove-Item -Path ./Version/version.txt
|
||||||
Remove-Item -Path ./Version
|
Remove-Item -Path ./Version
|
||||||
# Checkout/Create the branch
|
# Checkout/Create the branch
|
||||||
@@ -259,7 +257,7 @@ jobs:
|
|||||||
Get-ChildItem "./Version"
|
Get-ChildItem "./Version"
|
||||||
$version = Get-Content -Path ./Version/version.txt
|
$version = Get-Content -Path ./Version/version.txt
|
||||||
Write-Host "Version: $version"
|
Write-Host "Version: $version"
|
||||||
Write-Output "::set-env name=VERSION::$version"
|
echo "VERSION=$version" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||||
Remove-Item -Path ./Version/version.txt
|
Remove-Item -Path ./Version/version.txt
|
||||||
Remove-Item -Path ./Version
|
Remove-Item -Path ./Version
|
||||||
# Checkout/Create the branch
|
# Checkout/Create the branch
|
||||||
|
|||||||
19
.github/workflows/main.yml
vendored
19
.github/workflows/main.yml
vendored
@@ -24,25 +24,18 @@ jobs:
|
|||||||
# First we checkout the source repo
|
# First we checkout the source repo
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
# And any submodules
|
with:
|
||||||
- name: Checkout submodules
|
fetch-depth: 0
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
git config --global url."https://github.com/".insteadOf "git@github.com:"
|
|
||||||
auth_header="$(git config --local --get http.https://github.com/.extraheader)"
|
|
||||||
git submodule sync --recursive
|
|
||||||
git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
|
|
||||||
# Generate the appropriate version number
|
# Generate the appropriate version number
|
||||||
- name: Set Version Number
|
- name: Set Version Number
|
||||||
shell: powershell
|
shell: powershell
|
||||||
env:
|
env:
|
||||||
TAG_NAME: ${{ github.event.release.tag_name }}
|
TAG_NAME: ${{ github.event.release.tag_name }}
|
||||||
run: Write-Output "::set-env name=VERSION::$($Env:TAG_NAME)"
|
run: echo "VERSION=$($Env:TAG_NAME)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||||
# Use the version number to set the version of the assemblies
|
# Use the version number to set the version of the assemblies
|
||||||
- name: Update AssemblyInfo.cs
|
- name: Update AssemblyInfo.cs
|
||||||
shell: powershell
|
shell: powershell
|
||||||
run: |
|
run: |
|
||||||
Write-Output ${{ env.VERSION }}
|
|
||||||
./.github/scripts/UpdateAssemblyVersion.ps1 ${{ env.VERSION }}
|
./.github/scripts/UpdateAssemblyVersion.ps1 ${{ env.VERSION }}
|
||||||
- name: restore Nuget Packages
|
- name: restore Nuget Packages
|
||||||
run: nuget install .\packages.config -OutputDirectory .\packages -ExcludeVersion
|
run: nuget install .\packages.config -OutputDirectory .\packages -ExcludeVersion
|
||||||
@@ -101,7 +94,7 @@ jobs:
|
|||||||
Get-ChildItem "./Version"
|
Get-ChildItem "./Version"
|
||||||
$version = Get-Content -Path ./Version/version.txt
|
$version = Get-Content -Path ./Version/version.txt
|
||||||
Write-Host "Version: $version"
|
Write-Host "Version: $version"
|
||||||
Write-Output "::set-env name=VERSION::$version"
|
echo "VERSION=$version" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||||
Remove-Item -Path ./Version/version.txt
|
Remove-Item -Path ./Version/version.txt
|
||||||
Remove-Item -Path ./Version
|
Remove-Item -Path ./Version
|
||||||
- name: Download Build output
|
- name: Download Build output
|
||||||
@@ -155,7 +148,7 @@ jobs:
|
|||||||
Get-ChildItem "./Version"
|
Get-ChildItem "./Version"
|
||||||
$version = Get-Content -Path ./Version/version.txt
|
$version = Get-Content -Path ./Version/version.txt
|
||||||
Write-Host "Version: $version"
|
Write-Host "Version: $version"
|
||||||
Write-Output "::set-env name=VERSION::$version"
|
echo "VERSION=$version" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||||
Remove-Item -Path ./Version/version.txt
|
Remove-Item -Path ./Version/version.txt
|
||||||
Remove-Item -Path ./Version
|
Remove-Item -Path ./Version
|
||||||
# Checkout/Create the branch
|
# Checkout/Create the branch
|
||||||
@@ -228,7 +221,7 @@ jobs:
|
|||||||
Get-ChildItem "./Version"
|
Get-ChildItem "./Version"
|
||||||
$version = Get-Content -Path ./Version/version.txt
|
$version = Get-Content -Path ./Version/version.txt
|
||||||
Write-Host "Version: $version"
|
Write-Host "Version: $version"
|
||||||
Write-Output "::set-env name=VERSION::$version"
|
echo "VERSION=$version" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||||
Remove-Item -Path ./Version/version.txt
|
Remove-Item -Path ./Version/version.txt
|
||||||
Remove-Item -Path ./Version
|
Remove-Item -Path ./Version
|
||||||
# Checkout main branch
|
# Checkout main branch
|
||||||
|
|||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -388,3 +388,4 @@ MigrationBackup/
|
|||||||
|
|
||||||
# Fody - auto-generated XML schema
|
# Fody - auto-generated XML schema
|
||||||
FodyWeavers.xsd
|
FodyWeavers.xsd
|
||||||
|
essentials-framework/Essentials Interfaces/PepperDash_Essentials_Interfaces/PepperDash_Essentials_Interfaces.csproj
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@@ -70,6 +70,14 @@ namespace PepperDash.Essentials.Bridges
|
|||||||
/// Range reports the highest supported HDCP state level for the corresponding input card
|
/// Range reports the highest supported HDCP state level for the corresponding input card
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public uint HdcpSupportCapability { get; set; }
|
public uint HdcpSupportCapability { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// DM Chassis Stream Input Start (1), Stop (2), Pause (3) with Feedback
|
||||||
|
/// </summary>
|
||||||
|
public uint InputStreamCardStatus { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// DM Chassis Stream Output Start (1), Stop (2), Pause (3) with Feedback
|
||||||
|
/// </summary>
|
||||||
|
public uint OutputStreamCardStatus { get; set; }
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Serials
|
#region Serials
|
||||||
@@ -115,6 +123,8 @@ namespace PepperDash.Essentials.Bridges
|
|||||||
InputUsb = 700; //701-899
|
InputUsb = 700; //701-899
|
||||||
HdcpSupportState = 1000; //1001-1199
|
HdcpSupportState = 1000; //1001-1199
|
||||||
HdcpSupportCapability = 1200; //1201-1399
|
HdcpSupportCapability = 1200; //1201-1399
|
||||||
|
InputStreamCardStatus = 1500; //1501-1532
|
||||||
|
OutputStreamCardStatus = 1600; //1601-1632
|
||||||
|
|
||||||
|
|
||||||
//Serial
|
//Serial
|
||||||
@@ -145,6 +155,8 @@ namespace PepperDash.Essentials.Bridges
|
|||||||
OutputEndpointOnline = OutputEndpointOnline + joinOffset;
|
OutputEndpointOnline = OutputEndpointOnline + joinOffset;
|
||||||
HdcpSupportState = HdcpSupportState + joinOffset;
|
HdcpSupportState = HdcpSupportState + joinOffset;
|
||||||
HdcpSupportCapability = HdcpSupportCapability + joinOffset;
|
HdcpSupportCapability = HdcpSupportCapability + joinOffset;
|
||||||
|
InputStreamCardStatus = InputStreamCardStatus + joinOffset;
|
||||||
|
OutputStreamCardStatus = OutputStreamCardStatus + joinOffset;
|
||||||
OutputDisabledByHdcp = OutputDisabledByHdcp + joinOffset;
|
OutputDisabledByHdcp = OutputDisabledByHdcp + joinOffset;
|
||||||
TxAdvancedIsPresent = TxAdvancedIsPresent + joinOffset;
|
TxAdvancedIsPresent = TxAdvancedIsPresent + joinOffset;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,11 +12,11 @@ using PepperDash.Core;
|
|||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
using PepperDash.Essentials.Core.Bridges;
|
using PepperDash.Essentials.Core.Bridges;
|
||||||
using PepperDash.Essentials.Core.Config;
|
using PepperDash.Essentials.Core.Config;
|
||||||
|
using PepperDash.Essentials.Core.Fusion;
|
||||||
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;
|
||||||
using PepperDash.Essentials.Room.Config;
|
using PepperDash.Essentials.Room.Config;
|
||||||
//using PepperDash.Essentials.Room.MobileControl;
|
|
||||||
|
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
|
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
|
||||||
@@ -53,7 +53,7 @@ namespace PepperDash.Essentials
|
|||||||
|
|
||||||
if (Debug.DoNotLoadOnNextBoot)
|
if (Debug.DoNotLoadOnNextBoot)
|
||||||
{
|
{
|
||||||
CrestronConsole.AddNewConsoleCommand(s => GoWithLoad(), "go", "Loads configuration file",
|
CrestronConsole.AddNewConsoleCommand(s => CrestronInvoke.BeginInvoke((o) => GoWithLoad()), "go", "Loads configuration file",
|
||||||
ConsoleAccessLevelEnum.AccessOperator);
|
ConsoleAccessLevelEnum.AccessOperator);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -290,33 +290,14 @@ namespace PepperDash.Essentials
|
|||||||
|
|
||||||
DeviceManager.ActivateAll();
|
DeviceManager.ActivateAll();
|
||||||
|
|
||||||
var mobileControl = DeviceManager.GetDeviceForKey("appServer") as IMobileControl;
|
var mobileControl = GetMobileControlDevice();
|
||||||
|
|
||||||
if (mobileControl == null) return;
|
if (mobileControl == null) return;
|
||||||
|
|
||||||
mobileControl.LinkSystemMonitorToAppServer();
|
mobileControl.LinkSystemMonitorToAppServer();
|
||||||
//LinkSystemMonitorToAppServer();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//void LinkSystemMonitorToAppServer()
|
|
||||||
//{
|
|
||||||
// var sysMon = DeviceManager.GetDeviceForKey("systemMonitor") as PepperDash.Essentials.Core.Monitoring.SystemMonitorController;
|
|
||||||
|
|
||||||
// var appServer = DeviceManager.GetDeviceForKey("appServer") as MobileControlSystemController;
|
|
||||||
|
|
||||||
|
|
||||||
// if (sysMon != null && appServer != null)
|
|
||||||
// {
|
|
||||||
// var key = sysMon.Key + "-" + appServer.Key;
|
|
||||||
// var messenger = new PepperDash.Essentials.AppServer.Messengers.SystemMonitorMessenger
|
|
||||||
// (key, sysMon, "/device/systemMonitor");
|
|
||||||
|
|
||||||
// messenger.RegisterWithAppServer(appServer);
|
|
||||||
|
|
||||||
// DeviceManager.AddDevice(messenger);
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Reads all devices from config and adds them to DeviceManager
|
/// Reads all devices from config and adds them to DeviceManager
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -394,11 +375,6 @@ namespace PepperDash.Essentials
|
|||||||
if (newDev == null)
|
if (newDev == null)
|
||||||
newDev = PepperDash.Essentials.Core.DeviceFactory.GetDevice(devConf);
|
newDev = PepperDash.Essentials.Core.DeviceFactory.GetDevice(devConf);
|
||||||
|
|
||||||
//
|
|
||||||
//if (newDev == null)
|
|
||||||
// newDev = PepperDash.Essentials.Devices.Displays.DisplayDeviceFactory.GetDevice(devConf);
|
|
||||||
//
|
|
||||||
|
|
||||||
if (newDev != null)
|
if (newDev != null)
|
||||||
DeviceManager.AddDevice(newDev);
|
DeviceManager.AddDevice(newDev);
|
||||||
else
|
else
|
||||||
@@ -456,19 +432,34 @@ namespace PepperDash.Essentials
|
|||||||
var room = EssentialsRoomConfigHelper.GetRoomObject(roomConfig) as EssentialsRoomBase;
|
var room = EssentialsRoomConfigHelper.GetRoomObject(roomConfig) as EssentialsRoomBase;
|
||||||
if (room != null)
|
if (room != null)
|
||||||
{
|
{
|
||||||
|
// default IPID
|
||||||
|
uint fusionIpId = 0xf1;
|
||||||
|
|
||||||
|
// default to no join map key
|
||||||
|
string fusionJoinMapKey = string.Empty;
|
||||||
|
|
||||||
|
if (room.Config.Properties["fusion"] != null)
|
||||||
|
{
|
||||||
|
Debug.Console(2, "Custom Fusion config found. Using custom values");
|
||||||
|
|
||||||
|
var fusionConfig = room.Config.Properties["fusion"].ToObject<EssentialsRoomFusionConfig>();
|
||||||
|
|
||||||
|
if (fusionConfig != null)
|
||||||
|
{
|
||||||
|
fusionIpId = fusionConfig.IpIdInt;
|
||||||
|
fusionJoinMapKey = fusionConfig.JoinMapKey;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (room is EssentialsHuddleSpaceRoom)
|
if (room is EssentialsHuddleSpaceRoom)
|
||||||
{
|
{
|
||||||
DeviceManager.AddDevice(room);
|
DeviceManager.AddDevice(room);
|
||||||
|
|
||||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Room is EssentialsHuddleSpaceRoom, attempting to add to DeviceManager with Fusion");
|
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Room is EssentialsHuddleSpaceRoom, attempting to add to DeviceManager with Fusion");
|
||||||
DeviceManager.AddDevice(new Core.Fusion.EssentialsHuddleSpaceFusionSystemControllerBase((EssentialsHuddleSpaceRoom)room, 0xf1));
|
DeviceManager.AddDevice(new Core.Fusion.EssentialsHuddleSpaceFusionSystemControllerBase(room, fusionIpId, fusionJoinMapKey));
|
||||||
|
|
||||||
|
|
||||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Attempting to build Mobile Control Bridge...");
|
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Attempting to build Mobile Control Bridge...");
|
||||||
// Mobile Control bridge
|
|
||||||
//var bridge = new MobileConrolEssentialsHuddleSpaceRoomBridge(room as EssentialsHuddleSpaceRoom);
|
|
||||||
//AddBridgePostActivationHelper(bridge); // Lets things happen later when all devices are present
|
|
||||||
//DeviceManager.AddDevice(bridge);
|
|
||||||
|
|
||||||
CreateMobileControlBridge(room);
|
CreateMobileControlBridge(room);
|
||||||
}
|
}
|
||||||
@@ -477,13 +468,21 @@ namespace PepperDash.Essentials
|
|||||||
DeviceManager.AddDevice(room);
|
DeviceManager.AddDevice(room);
|
||||||
|
|
||||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Room is EssentialsHuddleVtc1Room, attempting to add to DeviceManager with Fusion");
|
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Room is EssentialsHuddleVtc1Room, attempting to add to DeviceManager with Fusion");
|
||||||
DeviceManager.AddDevice(new EssentialsHuddleVtc1FusionController((EssentialsHuddleVtc1Room)room, 0xf1));
|
DeviceManager.AddDevice(new EssentialsHuddleVtc1FusionController((EssentialsHuddleVtc1Room)room, fusionIpId, fusionJoinMapKey));
|
||||||
|
|
||||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Attempting to build Mobile Control Bridge...");
|
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Attempting to build Mobile Control Bridge...");
|
||||||
// Mobile Control bridge
|
|
||||||
//var bridge = new MobileConrolEssentialsHuddleSpaceRoomBridge(room);
|
CreateMobileControlBridge(room);
|
||||||
//AddBridgePostActivationHelper(bridge); // Lets things happen later when all devices are present
|
}
|
||||||
//DeviceManager.AddDevice(bridge);
|
else if (room is EssentialsTechRoom)
|
||||||
|
{
|
||||||
|
DeviceManager.AddDevice(room);
|
||||||
|
|
||||||
|
Debug.Console(0, Debug.ErrorLogLevel.Notice,
|
||||||
|
"Room is EssentialsTechRoom, Attempting to add to DeviceManager with Fusion");
|
||||||
|
DeviceManager.AddDevice(new EssentialsTechRoomFusionSystemController((EssentialsTechRoom)room, fusionIpId, fusionJoinMapKey));
|
||||||
|
|
||||||
|
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Attempting to build Mobile Control Bridge");
|
||||||
|
|
||||||
CreateMobileControlBridge(room);
|
CreateMobileControlBridge(room);
|
||||||
}
|
}
|
||||||
@@ -504,40 +503,55 @@ namespace PepperDash.Essentials
|
|||||||
|
|
||||||
private static void CreateMobileControlBridge(EssentialsRoomBase room)
|
private static void CreateMobileControlBridge(EssentialsRoomBase room)
|
||||||
{
|
{
|
||||||
var mobileControl = DeviceManager.GetDeviceForKey("appServer") as IMobileControl;
|
var mobileControl = GetMobileControlDevice();
|
||||||
|
|
||||||
if (mobileControl == null) return;
|
if (mobileControl == null) return;
|
||||||
|
|
||||||
mobileControl.CreateMobileControlRoomBridge(room);
|
mobileControl.CreateMobileControlRoomBridge(room, mobileControl);
|
||||||
|
|
||||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Mobile Control Bridge Added...");
|
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Mobile Control Bridge Added...");
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
private static IMobileControl GetMobileControlDevice()
|
||||||
/// Helps add the post activation steps that link bridges to main controller
|
{
|
||||||
/// </summary>
|
var mobileControlList = DeviceManager.AllDevices.OfType<IMobileControl>().ToList();
|
||||||
/// <param name="bridge"></param>
|
|
||||||
//void AddBridgePostActivationHelper(MobileControlBridgeBase bridge)
|
if (mobileControlList.Count > 1)
|
||||||
//{
|
{
|
||||||
// bridge.AddPostActivationAction(() =>
|
Debug.Console(0, Debug.ErrorLogLevel.Warning,
|
||||||
// {
|
"Multiple instances of Mobile Control Server found.");
|
||||||
// var parent = DeviceManager.AllDevices.FirstOrDefault(d => d.Key == "appServer") as MobileControlSystemController;
|
|
||||||
// if (parent == null)
|
return null;
|
||||||
// {
|
}
|
||||||
// Debug.Console(0, bridge, "ERROR: Cannot connect app server room bridge. System controller not present");
|
|
||||||
// return;
|
if (mobileControlList.Count > 0)
|
||||||
// }
|
{
|
||||||
// Debug.Console(0, bridge, "Linking to parent controller");
|
return mobileControlList[0];
|
||||||
// bridge.AddParent(parent);
|
}
|
||||||
// parent.AddBridge(bridge);
|
|
||||||
// });
|
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Mobile Control not enabled for this system");
|
||||||
//}
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Fires up a logo server if not already running
|
/// Fires up a logo server if not already running
|
||||||
/// </summary>
|
/// </summary>
|
||||||
void LoadLogoServer()
|
void LoadLogoServer()
|
||||||
{
|
{
|
||||||
|
if (ConfigReader.ConfigObject.Rooms == null)
|
||||||
|
{
|
||||||
|
Debug.Console(0, Debug.ErrorLogLevel.Notice, "No rooms configured. Bypassing Logo server startup.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
!ConfigReader.ConfigObject.Rooms.Any(
|
||||||
|
CheckRoomConfig))
|
||||||
|
{
|
||||||
|
Debug.Console(0, Debug.ErrorLogLevel.Notice, "No rooms configured to use system Logo server. Bypassing Logo server startup");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
LogoServer = new HttpLogoServer(8080, Global.DirectorySeparator + "html" + Global.DirectorySeparator + "logo");
|
LogoServer = new HttpLogoServer(8080, Global.DirectorySeparator + "html" + Global.DirectorySeparator + "logo");
|
||||||
@@ -547,5 +561,38 @@ namespace PepperDash.Essentials
|
|||||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "NOTICE: Logo server cannot be started. Likely already running in another program");
|
Debug.Console(0, Debug.ErrorLogLevel.Notice, "NOTICE: Logo server cannot be started. Likely already running in another program");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private bool CheckRoomConfig(DeviceConfig c)
|
||||||
|
{
|
||||||
|
string logoDark = null;
|
||||||
|
string logoLight = null;
|
||||||
|
string logo = null;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (c.Properties["logoDark"] != null)
|
||||||
|
{
|
||||||
|
logoDark = c.Properties["logoDark"].Value<string>("type");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (c.Properties["logoLight"] != null)
|
||||||
|
{
|
||||||
|
logoLight = c.Properties["logoLight"].Value<string>("type");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (c.Properties["logo"] != null)
|
||||||
|
{
|
||||||
|
logo = c.Properties["logo"].Value<string>("type");
|
||||||
|
}
|
||||||
|
|
||||||
|
return ((logoDark != null && logoDark == "system") ||
|
||||||
|
(logoLight != null && logoLight == "system") || (logo != null && logo == "system"));
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
Debug.Console(1, Debug.ErrorLogLevel.Notice, "Unable to find logo information in any room config");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,8 +16,8 @@ namespace PepperDash.Essentials.Fusion
|
|||||||
{
|
{
|
||||||
BooleanSigData CodecIsInCall;
|
BooleanSigData CodecIsInCall;
|
||||||
|
|
||||||
public EssentialsHuddleVtc1FusionController(EssentialsHuddleVtc1Room room, uint ipId)
|
public EssentialsHuddleVtc1FusionController(EssentialsHuddleVtc1Room room, uint ipId, string joinMapKey)
|
||||||
: base(room, ipId)
|
: base(room, ipId, joinMapKey)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -55,25 +55,25 @@ namespace PepperDash.Essentials.Fusion
|
|||||||
// Map FusionRoom Attributes:
|
// Map FusionRoom Attributes:
|
||||||
|
|
||||||
// Codec volume
|
// Codec volume
|
||||||
var codecVolume = FusionRoom.CreateOffsetUshortSig(50, "Volume - Fader01", eSigIoMask.InputOutputSig);
|
var codecVolume = FusionRoom.CreateOffsetUshortSig(JoinMap.VolumeFader1.JoinNumber, JoinMap.VolumeFader1.AttributeName, eSigIoMask.InputOutputSig);
|
||||||
codecVolume.OutputSig.UserObject = new Action<ushort>(b => (codec as IBasicVolumeWithFeedback).SetVolume(b));
|
codecVolume.OutputSig.UserObject = new Action<ushort>(b => (codec as IBasicVolumeWithFeedback).SetVolume(b));
|
||||||
(codec as IBasicVolumeWithFeedback).VolumeLevelFeedback.LinkInputSig(codecVolume.InputSig);
|
(codec as IBasicVolumeWithFeedback).VolumeLevelFeedback.LinkInputSig(codecVolume.InputSig);
|
||||||
|
|
||||||
// In Call Status
|
// In Call Status
|
||||||
CodecIsInCall = FusionRoom.CreateOffsetBoolSig(69, "Conf - VC 1 In Call", eSigIoMask.InputSigOnly);
|
CodecIsInCall = FusionRoom.CreateOffsetBoolSig(JoinMap.VcCodecInCall.JoinNumber, JoinMap.VcCodecInCall.AttributeName, eSigIoMask.InputSigOnly);
|
||||||
codec.CallStatusChange += new EventHandler<PepperDash.Essentials.Devices.Common.Codec.CodecCallStatusItemChangeEventArgs>(codec_CallStatusChange);
|
codec.CallStatusChange += new EventHandler<PepperDash.Essentials.Devices.Common.Codec.CodecCallStatusItemChangeEventArgs>(codec_CallStatusChange);
|
||||||
|
|
||||||
// Online status
|
// Online status
|
||||||
if (codec is ICommunicationMonitor)
|
if (codec is ICommunicationMonitor)
|
||||||
{
|
{
|
||||||
var c = codec as ICommunicationMonitor;
|
var c = codec as ICommunicationMonitor;
|
||||||
var codecOnline = FusionRoom.CreateOffsetBoolSig(122, "Online - VC 1", eSigIoMask.InputSigOnly);
|
var codecOnline = FusionRoom.CreateOffsetBoolSig(JoinMap.VcCodecOnline.JoinNumber, JoinMap.VcCodecOnline.AttributeName, eSigIoMask.InputSigOnly);
|
||||||
codecOnline.InputSig.BoolValue = c.CommunicationMonitor.Status == MonitorStatus.IsOk;
|
codecOnline.InputSig.BoolValue = c.CommunicationMonitor.Status == MonitorStatus.IsOk;
|
||||||
c.CommunicationMonitor.StatusChange += (o, a) =>
|
c.CommunicationMonitor.StatusChange += (o, a) =>
|
||||||
{
|
{
|
||||||
codecOnline.InputSig.BoolValue = a.Status == MonitorStatus.IsOk;
|
codecOnline.InputSig.BoolValue = a.Status == MonitorStatus.IsOk;
|
||||||
};
|
};
|
||||||
Debug.Console(0, this, "Linking '{0}' communication monitor to Fusion '{1}'", codec.Key, "Online - VC 1");
|
Debug.Console(0, this, "Linking '{0}' communication monitor to Fusion '{1}'", codec.Key, JoinMap.VcCodecOnline.AttributeName);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Codec IP Address
|
// Codec IP Address
|
||||||
@@ -101,10 +101,10 @@ namespace PepperDash.Essentials.Fusion
|
|||||||
|
|
||||||
if (codecHasIpInfo)
|
if (codecHasIpInfo)
|
||||||
{
|
{
|
||||||
codecIpAddressSig = FusionRoom.CreateOffsetStringSig(121, "IP Address - VC", eSigIoMask.InputSigOnly);
|
codecIpAddressSig = FusionRoom.CreateOffsetStringSig(JoinMap.VcCodecIpAddress.JoinNumber, JoinMap.VcCodecIpAddress.AttributeName, eSigIoMask.InputSigOnly);
|
||||||
codecIpAddressSig.InputSig.StringValue = codecIpAddress;
|
codecIpAddressSig.InputSig.StringValue = codecIpAddress;
|
||||||
|
|
||||||
codecIpPortSig = FusionRoom.CreateOffsetStringSig(150, "IP Port - VC", eSigIoMask.InputSigOnly);
|
codecIpPortSig = FusionRoom.CreateOffsetStringSig(JoinMap.VcCodecIpPort.JoinNumber, JoinMap.VcCodecIpPort.AttributeName, eSigIoMask.InputSigOnly);
|
||||||
codecIpPortSig.InputSig.StringValue = codecIpPort.ToString();
|
codecIpPortSig.InputSig.StringValue = codecIpPort.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -123,7 +123,7 @@ namespace PepperDash.Essentials.Fusion
|
|||||||
FusionStaticAssets.Add(deviceConfig.Uid, tempAsset);
|
FusionStaticAssets.Add(deviceConfig.Uid, tempAsset);
|
||||||
}
|
}
|
||||||
|
|
||||||
var codecAsset = FusionRoom.CreateStaticAsset(tempAsset.SlotNumber, tempAsset.Name, "Display", tempAsset.InstanceId);
|
var codecAsset = FusionRoom.CreateStaticAsset(tempAsset.SlotNumber, tempAsset.Name, "Codec", tempAsset.InstanceId);
|
||||||
codecAsset.PowerOn.OutputSig.UserObject = codecPowerOnAction;
|
codecAsset.PowerOn.OutputSig.UserObject = codecPowerOnAction;
|
||||||
codecAsset.PowerOff.OutputSig.UserObject = codecPowerOffAction;
|
codecAsset.PowerOff.OutputSig.UserObject = codecPowerOffAction;
|
||||||
codec.StandbyIsOnFeedback.LinkComplementInputSig(codecAsset.PowerOn.InputSig);
|
codec.StandbyIsOnFeedback.LinkComplementInputSig(codecAsset.PowerOn.InputSig);
|
||||||
@@ -166,20 +166,19 @@ namespace PepperDash.Essentials.Fusion
|
|||||||
|
|
||||||
CrestronConsole.AddNewConsoleCommand(RequestFullRoomSchedule, "FusReqRoomSchedule", "Requests schedule of the room for the next 24 hours", ConsoleAccessLevelEnum.AccessOperator);
|
CrestronConsole.AddNewConsoleCommand(RequestFullRoomSchedule, "FusReqRoomSchedule", "Requests schedule of the room for the next 24 hours", ConsoleAccessLevelEnum.AccessOperator);
|
||||||
CrestronConsole.AddNewConsoleCommand(ModifyMeetingEndTimeConsoleHelper, "FusReqRoomSchMod", "Ends or extends a meeting by the specified time", ConsoleAccessLevelEnum.AccessOperator);
|
CrestronConsole.AddNewConsoleCommand(ModifyMeetingEndTimeConsoleHelper, "FusReqRoomSchMod", "Ends or extends a meeting by the specified time", ConsoleAccessLevelEnum.AccessOperator);
|
||||||
CrestronConsole.AddNewConsoleCommand(CreateAsHocMeeting, "FusCreateMeeting", "Creates and Ad Hoc meeting for on hour or until the next meeting", ConsoleAccessLevelEnum.AccessOperator);
|
CrestronConsole.AddNewConsoleCommand(CreateAdHocMeeting, "FusCreateMeeting", "Creates and Ad Hoc meeting for on hour or until the next meeting", ConsoleAccessLevelEnum.AccessOperator);
|
||||||
|
|
||||||
// Room to fusion room
|
// Room to fusion room
|
||||||
Room.OnFeedback.LinkInputSig(FusionRoom.SystemPowerOn.InputSig);
|
Room.OnFeedback.LinkInputSig(FusionRoom.SystemPowerOn.InputSig);
|
||||||
|
|
||||||
// Moved to
|
// Moved to
|
||||||
CurrentRoomSourceNameSig = FusionRoom.CreateOffsetStringSig(84, "Display 1 - Current Source", eSigIoMask.InputSigOnly);
|
CurrentRoomSourceNameSig = FusionRoom.CreateOffsetStringSig(JoinMap.Display1CurrentSourceName.JoinNumber, JoinMap.Display1CurrentSourceName.AttributeName, eSigIoMask.InputSigOnly);
|
||||||
// Don't think we need to get current status of this as nothing should be alive yet.
|
// Don't think we need to get current status of this as nothing should be alive yet.
|
||||||
(Room as EssentialsHuddleVtc1Room).CurrentSourceChange += Room_CurrentSourceInfoChange;
|
(Room as EssentialsHuddleVtc1Room).CurrentSourceChange += Room_CurrentSourceInfoChange;
|
||||||
|
|
||||||
|
|
||||||
FusionRoom.SystemPowerOn.OutputSig.SetSigFalseAction((Room as EssentialsHuddleVtc1Room).PowerOnToDefaultOrLastSource);
|
FusionRoom.SystemPowerOn.OutputSig.SetSigFalseAction((Room as EssentialsHuddleVtc1Room).PowerOnToDefaultOrLastSource);
|
||||||
FusionRoom.SystemPowerOff.OutputSig.SetSigFalseAction(() => (Room as EssentialsHuddleVtc1Room).RunRouteAction("roomOff", Room.SourceListKey));
|
FusionRoom.SystemPowerOff.OutputSig.SetSigFalseAction(() => (Room as EssentialsHuddleVtc1Room).RunRouteAction("roomOff", Room.SourceListKey));
|
||||||
// NO!! room.RoomIsOn.LinkComplementInputSig(FusionRoom.SystemPowerOff.InputSig);
|
|
||||||
|
|
||||||
|
|
||||||
CrestronEnvironment.EthernetEventHandler += CrestronEnvironment_EthernetEventHandler;
|
CrestronEnvironment.EthernetEventHandler += CrestronEnvironment_EthernetEventHandler;
|
||||||
@@ -197,9 +196,9 @@ namespace PepperDash.Essentials.Fusion
|
|||||||
uint i = 1;
|
uint i = 1;
|
||||||
foreach (var kvp in setTopBoxes)
|
foreach (var kvp in setTopBoxes)
|
||||||
{
|
{
|
||||||
TryAddRouteActionSigs("Display 1 - Source TV " + i, 188 + i, kvp.Key, kvp.Value.SourceDevice);
|
TryAddRouteActionSigs(JoinMap.Display1DiscPlayerSourceStart.AttributeName + " " + i, JoinMap.Display1DiscPlayerSourceStart.JoinNumber + i, kvp.Key, kvp.Value.SourceDevice);
|
||||||
i++;
|
i++;
|
||||||
if (i > 5) // We only have five spots
|
if (i > JoinMap.Display1SetTopBoxSourceStart.JoinSpan) // We only have five spots
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -207,7 +206,7 @@ namespace PepperDash.Essentials.Fusion
|
|||||||
i = 1;
|
i = 1;
|
||||||
foreach (var kvp in discPlayers)
|
foreach (var kvp in discPlayers)
|
||||||
{
|
{
|
||||||
TryAddRouteActionSigs("Display 1 - Source DVD " + i, 181 + i, kvp.Key, kvp.Value.SourceDevice);
|
TryAddRouteActionSigs(JoinMap.Display1DiscPlayerSourceStart.AttributeName + " " + i, JoinMap.Display1DiscPlayerSourceStart.JoinNumber + i, kvp.Key, kvp.Value.SourceDevice);
|
||||||
i++;
|
i++;
|
||||||
if (i > 5) // We only have five spots
|
if (i > 5) // We only have five spots
|
||||||
break;
|
break;
|
||||||
@@ -217,9 +216,9 @@ namespace PepperDash.Essentials.Fusion
|
|||||||
i = 1;
|
i = 1;
|
||||||
foreach (var kvp in laptops)
|
foreach (var kvp in laptops)
|
||||||
{
|
{
|
||||||
TryAddRouteActionSigs("Display 1 - Source Laptop " + i, 166 + i, kvp.Key, kvp.Value.SourceDevice);
|
TryAddRouteActionSigs(JoinMap.Display1LaptopSourceStart.AttributeName + " " + i, JoinMap.Display1LaptopSourceStart.JoinNumber + i, kvp.Key, kvp.Value.SourceDevice);
|
||||||
i++;
|
i++;
|
||||||
if (i > 10) // We only have ten spots???
|
if (i > JoinMap.Display1LaptopSourceStart.JoinSpan) // We only have ten spots???
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -273,14 +272,17 @@ namespace PepperDash.Essentials.Fusion
|
|||||||
// Display to fusion room sigs
|
// Display to fusion room sigs
|
||||||
FusionRoom.DisplayPowerOn.OutputSig.UserObject = dispPowerOnAction;
|
FusionRoom.DisplayPowerOn.OutputSig.UserObject = dispPowerOnAction;
|
||||||
FusionRoom.DisplayPowerOff.OutputSig.UserObject = dispPowerOffAction;
|
FusionRoom.DisplayPowerOff.OutputSig.UserObject = dispPowerOffAction;
|
||||||
defaultDisplay.PowerIsOnFeedback.LinkInputSig(FusionRoom.DisplayPowerOn.InputSig);
|
|
||||||
|
var defaultDisplayTwoWay = defaultDisplay as IHasPowerControlWithFeedback;
|
||||||
|
if (defaultDisplayTwoWay != null)
|
||||||
|
{
|
||||||
|
defaultDisplayTwoWay.PowerIsOnFeedback.LinkInputSig(FusionRoom.DisplayPowerOn.InputSig);
|
||||||
|
}
|
||||||
|
|
||||||
if (defaultDisplay is IDisplayUsage)
|
if (defaultDisplay is IDisplayUsage)
|
||||||
(defaultDisplay as IDisplayUsage).LampHours.LinkInputSig(FusionRoom.DisplayUsage.InputSig);
|
(defaultDisplay as IDisplayUsage).LampHours.LinkInputSig(FusionRoom.DisplayUsage.InputSig);
|
||||||
|
|
||||||
|
MapDisplayToRoomJoins(1, JoinMap.Display1Start.JoinNumber, defaultDisplay);
|
||||||
|
|
||||||
MapDisplayToRoomJoins(1, 158, defaultDisplay);
|
|
||||||
|
|
||||||
|
|
||||||
var deviceConfig = ConfigReader.ConfigObject.Devices.FirstOrDefault(d => d.Key.Equals(defaultDisplay.Key));
|
var deviceConfig = ConfigReader.ConfigObject.Devices.FirstOrDefault(d => d.Key.Equals(defaultDisplay.Key));
|
||||||
|
|
||||||
@@ -302,8 +304,18 @@ namespace PepperDash.Essentials.Fusion
|
|||||||
var dispAsset = FusionRoom.CreateStaticAsset(tempAsset.SlotNumber, tempAsset.Name, "Display", tempAsset.InstanceId);
|
var dispAsset = FusionRoom.CreateStaticAsset(tempAsset.SlotNumber, tempAsset.Name, "Display", tempAsset.InstanceId);
|
||||||
dispAsset.PowerOn.OutputSig.UserObject = dispPowerOnAction;
|
dispAsset.PowerOn.OutputSig.UserObject = dispPowerOnAction;
|
||||||
dispAsset.PowerOff.OutputSig.UserObject = dispPowerOffAction;
|
dispAsset.PowerOff.OutputSig.UserObject = dispPowerOffAction;
|
||||||
defaultDisplay.PowerIsOnFeedback.LinkInputSig(dispAsset.PowerOn.InputSig);
|
|
||||||
// NO!! display.PowerIsOn.LinkComplementInputSig(dispAsset.PowerOff.InputSig);
|
|
||||||
|
var defaultTwoWayDisplay = defaultDisplay as IHasPowerControlWithFeedback;
|
||||||
|
if (defaultTwoWayDisplay != null)
|
||||||
|
{
|
||||||
|
defaultTwoWayDisplay.PowerIsOnFeedback.LinkInputSig(FusionRoom.DisplayPowerOn.InputSig);
|
||||||
|
if (defaultDisplay is IDisplayUsage)
|
||||||
|
(defaultDisplay as IDisplayUsage).LampHours.LinkInputSig(FusionRoom.DisplayUsage.InputSig);
|
||||||
|
|
||||||
|
defaultTwoWayDisplay.PowerIsOnFeedback.LinkInputSig(dispAsset.PowerOn.InputSig);
|
||||||
|
}
|
||||||
|
|
||||||
// Use extension methods
|
// Use extension methods
|
||||||
dispAsset.TrySetMakeModel(defaultDisplay);
|
dispAsset.TrySetMakeModel(defaultDisplay);
|
||||||
dispAsset.TryLinkAssetErrorToCommunication(defaultDisplay);
|
dispAsset.TryLinkAssetErrorToCommunication(defaultDisplay);
|
||||||
@@ -315,7 +327,7 @@ namespace PepperDash.Essentials.Fusion
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void MapDisplayToRoomJoins(int displayIndex, int joinOffset, DisplayBase display)
|
protected override void MapDisplayToRoomJoins(int displayIndex, uint joinOffset, DisplayBase display)
|
||||||
{
|
{
|
||||||
string displayName = string.Format("Display {0} - ", displayIndex);
|
string displayName = string.Format("Display {0} - ", displayIndex);
|
||||||
|
|
||||||
@@ -325,12 +337,17 @@ namespace PepperDash.Essentials.Fusion
|
|||||||
// Power on
|
// Power on
|
||||||
var defaultDisplayPowerOn = FusionRoom.CreateOffsetBoolSig((uint)joinOffset, displayName + "Power On", eSigIoMask.InputOutputSig);
|
var defaultDisplayPowerOn = FusionRoom.CreateOffsetBoolSig((uint)joinOffset, displayName + "Power On", eSigIoMask.InputOutputSig);
|
||||||
defaultDisplayPowerOn.OutputSig.UserObject = new Action<bool>(b => { if (!b) display.PowerOn(); });
|
defaultDisplayPowerOn.OutputSig.UserObject = new Action<bool>(b => { if (!b) display.PowerOn(); });
|
||||||
display.PowerIsOnFeedback.LinkInputSig(defaultDisplayPowerOn.InputSig);
|
|
||||||
|
|
||||||
// Power Off
|
// Power Off
|
||||||
var defaultDisplayPowerOff = FusionRoom.CreateOffsetBoolSig((uint)joinOffset + 1, displayName + "Power Off", eSigIoMask.InputOutputSig);
|
var defaultDisplayPowerOff = FusionRoom.CreateOffsetBoolSig((uint)joinOffset + 1, displayName + "Power Off", eSigIoMask.InputOutputSig);
|
||||||
defaultDisplayPowerOn.OutputSig.UserObject = new Action<bool>(b => { if (!b) display.PowerOff(); }); ;
|
defaultDisplayPowerOn.OutputSig.UserObject = new Action<bool>(b => { if (!b) display.PowerOff(); }); ;
|
||||||
display.PowerIsOnFeedback.LinkInputSig(defaultDisplayPowerOn.InputSig);
|
|
||||||
|
var displayTwoWay = display as IHasPowerControlWithFeedback;
|
||||||
|
if (displayTwoWay != null)
|
||||||
|
{
|
||||||
|
displayTwoWay.PowerIsOnFeedback.LinkInputSig(defaultDisplayPowerOn.InputSig);
|
||||||
|
displayTwoWay.PowerIsOnFeedback.LinkInputSig(defaultDisplayPowerOn.InputSig);
|
||||||
|
}
|
||||||
|
|
||||||
// Current Source
|
// Current Source
|
||||||
var defaultDisplaySourceNone = FusionRoom.CreateOffsetBoolSig((uint)joinOffset + 8, displayName + "Source None", eSigIoMask.InputOutputSig);
|
var defaultDisplaySourceNone = FusionRoom.CreateOffsetBoolSig((uint)joinOffset + 8, displayName + "Source None", eSigIoMask.InputOutputSig);
|
||||||
|
|||||||
@@ -0,0 +1,98 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using Crestron.SimplSharp;
|
||||||
|
|
||||||
|
using PepperDash.Core;
|
||||||
|
using PepperDash.Essentials.Core;
|
||||||
|
using PepperDash.Essentials.Core.Config;
|
||||||
|
using PepperDash.Essentials.Core.Fusion;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Fusion
|
||||||
|
{
|
||||||
|
public class EssentialsTechRoomFusionSystemController : EssentialsHuddleSpaceFusionSystemControllerBase
|
||||||
|
{
|
||||||
|
public EssentialsTechRoomFusionSystemController(EssentialsTechRoom room, uint ipId, string joinMapKey)
|
||||||
|
: base(room, ipId, joinMapKey)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void SetUpDisplay()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
|
||||||
|
var displays = (Room as EssentialsTechRoom).Displays;
|
||||||
|
|
||||||
|
Debug.Console(1, this, "Setting up Static Assets for {0} Displays", displays.Count);
|
||||||
|
|
||||||
|
foreach (var display in displays.Values.Cast<DisplayBase>())
|
||||||
|
{
|
||||||
|
Debug.Console(2, this, "Setting up Static Asset for {0}", display.Key);
|
||||||
|
|
||||||
|
display.UsageTracker = new UsageTracking(display) { UsageIsTracked = true };
|
||||||
|
display.UsageTracker.DeviceUsageEnded += UsageTracker_DeviceUsageEnded;
|
||||||
|
|
||||||
|
var dispPowerOnAction = new Action<bool>(b =>
|
||||||
|
{
|
||||||
|
if (!b)
|
||||||
|
{
|
||||||
|
display.PowerOn();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
var dispPowerOffAction = new Action<bool>(b =>
|
||||||
|
{
|
||||||
|
if (!b)
|
||||||
|
{
|
||||||
|
display.PowerOff();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
var deviceConfig = ConfigReader.ConfigObject.GetDeviceForKey(display.Key);
|
||||||
|
|
||||||
|
FusionAsset tempAsset;
|
||||||
|
|
||||||
|
if (FusionStaticAssets.ContainsKey(deviceConfig.Uid))
|
||||||
|
{
|
||||||
|
// Used existing asset
|
||||||
|
tempAsset = FusionStaticAssets[deviceConfig.Uid];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Create a new asset
|
||||||
|
tempAsset = new FusionAsset(FusionRoomGuids.GetNextAvailableAssetNumber(FusionRoom),
|
||||||
|
display.Name, "Display", "");
|
||||||
|
FusionStaticAssets.Add(deviceConfig.Uid, tempAsset);
|
||||||
|
}
|
||||||
|
|
||||||
|
var dispAsset = FusionRoom.CreateStaticAsset(tempAsset.SlotNumber, tempAsset.Name, "Display",
|
||||||
|
tempAsset.InstanceId);
|
||||||
|
dispAsset.PowerOn.OutputSig.UserObject = dispPowerOnAction;
|
||||||
|
dispAsset.PowerOff.OutputSig.UserObject = dispPowerOffAction;
|
||||||
|
|
||||||
|
var defaultTwoWayDisplay = display as IHasPowerControlWithFeedback;
|
||||||
|
if (defaultTwoWayDisplay != null)
|
||||||
|
{
|
||||||
|
defaultTwoWayDisplay.PowerIsOnFeedback.LinkInputSig(FusionRoom.DisplayPowerOn.InputSig);
|
||||||
|
if (display is IDisplayUsage)
|
||||||
|
{
|
||||||
|
(display as IDisplayUsage).LampHours.LinkInputSig(FusionRoom.DisplayUsage.InputSig);
|
||||||
|
}
|
||||||
|
|
||||||
|
defaultTwoWayDisplay.PowerIsOnFeedback.LinkInputSig(dispAsset.PowerOn.InputSig);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Use extension methods
|
||||||
|
dispAsset.TrySetMakeModel(display);
|
||||||
|
dispAsset.TryLinkAssetErrorToCommunication(display);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Debug.Console(1, this, "Error setting up displays in Fusion: {0}", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -71,7 +71,7 @@
|
|||||||
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.UI.dll</HintPath>
|
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.UI.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="mscorlib" />
|
<Reference Include="mscorlib" />
|
||||||
<Reference Include="PepperDash_Core, Version=1.0.41.31808, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="PepperDash_Core, Version=1.0.42.30563, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<SpecificVersion>False</SpecificVersion>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
<HintPath>..\packages\PepperDashCore\lib\net35\PepperDash_Core.dll</HintPath>
|
<HintPath>..\packages\PepperDashCore\lib\net35\PepperDash_Core.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
@@ -133,6 +133,7 @@
|
|||||||
<Compile Include="Devices\Amplifier.cs" />
|
<Compile Include="Devices\Amplifier.cs" />
|
||||||
<Compile Include="ControlSystem.cs" />
|
<Compile Include="ControlSystem.cs" />
|
||||||
<Compile Include="Fusion\EssentialsHuddleVtc1FusionController.cs" />
|
<Compile Include="Fusion\EssentialsHuddleVtc1FusionController.cs" />
|
||||||
|
<Compile Include="Fusion\EssentialsTechRoomFusionSystemController.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
<Compile Include="Room\Config\EssentialsDualDisplayRoomPropertiesConfig.cs" />
|
<Compile Include="Room\Config\EssentialsDualDisplayRoomPropertiesConfig.cs" />
|
||||||
<Compile Include="Room\Config\EssentialsNDisplayRoomPropertiesConfig.cs" />
|
<Compile Include="Room\Config\EssentialsNDisplayRoomPropertiesConfig.cs" />
|
||||||
@@ -141,11 +142,13 @@
|
|||||||
<Compile Include="Room\Config\EssentialsHuddleRoomPropertiesConfig.cs" />
|
<Compile Include="Room\Config\EssentialsHuddleRoomPropertiesConfig.cs" />
|
||||||
<Compile Include="Room\Config\EssentialsHuddleVtc1PropertiesConfig.cs" />
|
<Compile Include="Room\Config\EssentialsHuddleVtc1PropertiesConfig.cs" />
|
||||||
<Compile Include="Room\Config\EssentialsRoomEmergencyConfig.cs" />
|
<Compile Include="Room\Config\EssentialsRoomEmergencyConfig.cs" />
|
||||||
|
<Compile Include="Room\Config\EssentialsTechRoomConfig.cs" />
|
||||||
<Compile Include="Room\Emergency\EsentialsRoomEmergencyContactClosure.cs" />
|
<Compile Include="Room\Emergency\EsentialsRoomEmergencyContactClosure.cs" />
|
||||||
<Compile Include="Room\Types\EssentialsDualDisplayRoom.cs" />
|
<Compile Include="Room\Types\EssentialsDualDisplayRoom.cs" />
|
||||||
<Compile Include="Room\Types\EssentialsHuddleVtc1Room.cs" />
|
<Compile Include="Room\Types\EssentialsHuddleVtc1Room.cs" />
|
||||||
<Compile Include="Room\Types\EssentialsNDisplayRoomBase.cs" />
|
<Compile Include="Room\Types\EssentialsNDisplayRoomBase.cs" />
|
||||||
<Compile Include="Room\Config\EssentialsRoomConfig.cs" />
|
<Compile Include="Room\Config\EssentialsRoomConfig.cs" />
|
||||||
|
<Compile Include="Room\Types\EssentialsTechRoom.cs" />
|
||||||
<Compile Include="UIDrivers\Environment Drivers\EssentialsEnvironmentDriver.cs" />
|
<Compile Include="UIDrivers\Environment Drivers\EssentialsEnvironmentDriver.cs" />
|
||||||
<Compile Include="UIDrivers\Environment Drivers\EssentialsLightingDriver.cs" />
|
<Compile Include="UIDrivers\Environment Drivers\EssentialsLightingDriver.cs" />
|
||||||
<Compile Include="UIDrivers\Environment Drivers\EssentialsShadeDriver.cs" />
|
<Compile Include="UIDrivers\Environment Drivers\EssentialsShadeDriver.cs" />
|
||||||
|
|||||||
@@ -22,30 +22,25 @@ namespace PepperDash.Essentials.Room.Config
|
|||||||
public static Device GetRoomObject(DeviceConfig roomConfig)
|
public static Device GetRoomObject(DeviceConfig roomConfig)
|
||||||
{
|
{
|
||||||
var typeName = roomConfig.Type.ToLower();
|
var typeName = roomConfig.Type.ToLower();
|
||||||
|
|
||||||
if (typeName == "huddle")
|
if (typeName == "huddle")
|
||||||
{
|
{
|
||||||
var huddle = new EssentialsHuddleSpaceRoom(roomConfig);
|
return new EssentialsHuddleSpaceRoom(roomConfig);
|
||||||
|
|
||||||
return huddle;
|
|
||||||
}
|
}
|
||||||
else if (typeName == "huddlevtc1")
|
if (typeName == "huddlevtc1")
|
||||||
{
|
{
|
||||||
var rm = new EssentialsHuddleVtc1Room(roomConfig);
|
return new EssentialsHuddleVtc1Room(roomConfig);
|
||||||
|
|
||||||
return rm;
|
|
||||||
}
|
}
|
||||||
else if (typeName == "ddvc01Bridge")
|
if (typeName == "ddvc01bridge")
|
||||||
{
|
{
|
||||||
return new Device(roomConfig.Key, roomConfig.Name); // placeholder device that does nothing.
|
return new Device(roomConfig.Key, roomConfig.Name); // placeholder device that does nothing.
|
||||||
}
|
}
|
||||||
else if (typeName == "dualdisplay")
|
if (typeName == "dualdisplay")
|
||||||
{
|
{
|
||||||
var rm = new EssentialsDualDisplayRoom(roomConfig);
|
return new EssentialsDualDisplayRoom(roomConfig);
|
||||||
|
|
||||||
return rm;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return typeName != "techroom" ? null : new EssentialsTechRoom(roomConfig);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -182,6 +177,9 @@ namespace PepperDash.Essentials.Room.Config
|
|||||||
[JsonProperty("volumes")]
|
[JsonProperty("volumes")]
|
||||||
public EssentialsRoomVolumesConfig Volumes { get; set; }
|
public EssentialsRoomVolumesConfig Volumes { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("fusion")]
|
||||||
|
public EssentialsRoomFusionConfig Fusion { get; set; }
|
||||||
|
|
||||||
[JsonProperty("zeroVolumeWhenSwtichingVolumeDevices")]
|
[JsonProperty("zeroVolumeWhenSwtichingVolumeDevices")]
|
||||||
public bool ZeroVolumeWhenSwtichingVolumeDevices { get; set; }
|
public bool ZeroVolumeWhenSwtichingVolumeDevices { get; set; }
|
||||||
|
|
||||||
@@ -225,6 +223,32 @@ namespace PepperDash.Essentials.Room.Config
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class EssentialsRoomFusionConfig
|
||||||
|
{
|
||||||
|
public uint IpIdInt
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
return Convert.ToUInt32(IpId, 16);
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
throw new FormatException(string.Format("ERROR:Unable to convert IP ID: {0} to hex. Error:\n{1}", IpId));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[JsonProperty("ipId")]
|
||||||
|
public string IpId { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("joinMapKey")]
|
||||||
|
public string JoinMapKey { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public class EssentialsRoomMicrophonePrivacyConfig
|
public class EssentialsRoomMicrophonePrivacyConfig
|
||||||
{
|
{
|
||||||
[JsonProperty("deviceKey")]
|
[JsonProperty("deviceKey")]
|
||||||
|
|||||||
40
PepperDashEssentials/Room/Config/EssentialsTechRoomConfig.cs
Normal file
40
PepperDashEssentials/Room/Config/EssentialsTechRoomConfig.cs
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Room.Config
|
||||||
|
{
|
||||||
|
public class EssentialsTechRoomConfig
|
||||||
|
{
|
||||||
|
[JsonProperty("dummySourceKey")]
|
||||||
|
public string DummySourceKey { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("displays")]
|
||||||
|
public List<string> Displays;
|
||||||
|
|
||||||
|
[JsonProperty("tuners")]
|
||||||
|
public List<string> Tuners;
|
||||||
|
|
||||||
|
[JsonProperty("userPin")]
|
||||||
|
public string UserPin;
|
||||||
|
|
||||||
|
[JsonProperty("techPin")]
|
||||||
|
public string TechPin;
|
||||||
|
|
||||||
|
[JsonProperty("presetsFileName")]
|
||||||
|
public string PresetsFileName;
|
||||||
|
|
||||||
|
[JsonProperty("scheduledEvents")]
|
||||||
|
public List<ScheduledEventConfig> ScheduledEvents;
|
||||||
|
|
||||||
|
[JsonProperty("isPrimary")] public bool IsPrimary;
|
||||||
|
|
||||||
|
[JsonProperty("isTvPresetsProvider")] public bool IsTvPresetsProvider;
|
||||||
|
|
||||||
|
public EssentialsTechRoomConfig()
|
||||||
|
{
|
||||||
|
Displays = new List<string>();
|
||||||
|
Tuners = new List<string>();
|
||||||
|
ScheduledEvents = new List<ScheduledEventConfig>();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -283,19 +283,23 @@ namespace PepperDash.Essentials
|
|||||||
if (disp != null)
|
if (disp != null)
|
||||||
{
|
{
|
||||||
// Link power, warming, cooling to display
|
// Link power, warming, cooling to display
|
||||||
disp.PowerIsOnFeedback.OutputChange += (o, a) =>
|
var dispTwoWay = disp as IHasPowerControlWithFeedback;
|
||||||
|
if (dispTwoWay != null)
|
||||||
{
|
{
|
||||||
if (disp.PowerIsOnFeedback.BoolValue != OnFeedback.BoolValue)
|
dispTwoWay.PowerIsOnFeedback.OutputChange += (o, a) =>
|
||||||
{
|
{
|
||||||
if (!disp.PowerIsOnFeedback.BoolValue)
|
if (dispTwoWay.PowerIsOnFeedback.BoolValue != OnFeedback.BoolValue)
|
||||||
|
{
|
||||||
|
if (!dispTwoWay.PowerIsOnFeedback.BoolValue)
|
||||||
disp.CurrentSourceInfo = null;
|
disp.CurrentSourceInfo = null;
|
||||||
OnFeedback.FireUpdate();
|
OnFeedback.FireUpdate();
|
||||||
}
|
}
|
||||||
if (disp.PowerIsOnFeedback.BoolValue)
|
if (dispTwoWay.PowerIsOnFeedback.BoolValue)
|
||||||
{
|
{
|
||||||
SetDefaultLevels();
|
SetDefaultLevels();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
disp.IsWarmingUpFeedback.OutputChange += (o, a) =>
|
disp.IsWarmingUpFeedback.OutputChange += (o, a) =>
|
||||||
{
|
{
|
||||||
@@ -579,8 +583,8 @@ namespace PepperDash.Essentials
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (dest is IPower)
|
if (dest is IHasPowerControl)
|
||||||
(dest as IPower).PowerOff();
|
(dest as IHasPowerControl).PowerOff();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -176,15 +176,19 @@ namespace PepperDash.Essentials
|
|||||||
if (disp != null)
|
if (disp != null)
|
||||||
{
|
{
|
||||||
// Link power, warming, cooling to display
|
// Link power, warming, cooling to display
|
||||||
disp.PowerIsOnFeedback.OutputChange += (o, a) =>
|
var dispTwoWay = disp as IHasPowerControlWithFeedback;
|
||||||
|
if (dispTwoWay != null)
|
||||||
{
|
{
|
||||||
if (disp.PowerIsOnFeedback.BoolValue != OnFeedback.BoolValue)
|
dispTwoWay.PowerIsOnFeedback.OutputChange += (o, a) =>
|
||||||
{
|
{
|
||||||
if (!disp.PowerIsOnFeedback.BoolValue)
|
if (dispTwoWay.PowerIsOnFeedback.BoolValue != OnFeedback.BoolValue)
|
||||||
|
{
|
||||||
|
if (!dispTwoWay.PowerIsOnFeedback.BoolValue)
|
||||||
CurrentSourceInfo = null;
|
CurrentSourceInfo = null;
|
||||||
OnFeedback.FireUpdate();
|
OnFeedback.FireUpdate();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
disp.IsWarmingUpFeedback.OutputChange += (o, a) =>
|
disp.IsWarmingUpFeedback.OutputChange += (o, a) =>
|
||||||
{
|
{
|
||||||
@@ -495,8 +499,8 @@ namespace PepperDash.Essentials
|
|||||||
if (route.SourceKey.Equals("$off", StringComparison.OrdinalIgnoreCase))
|
if (route.SourceKey.Equals("$off", StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
dest.ReleaseRoute();
|
dest.ReleaseRoute();
|
||||||
if (dest is IPower)
|
if (dest is IHasPowerControl)
|
||||||
(dest as IPower).PowerOff();
|
(dest as IHasPowerControl).PowerOff();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -190,6 +190,12 @@ namespace PepperDash.Essentials
|
|||||||
(_CurrentSourceInfo.SourceDevice as IInUseTracking).InUseTracker.AddUser(this, "control");
|
(_CurrentSourceInfo.SourceDevice as IInUseTracking).InUseTracker.AddUser(this, "control");
|
||||||
if (handler != null)
|
if (handler != null)
|
||||||
handler(_CurrentSourceInfo, ChangeType.DidChange);
|
handler(_CurrentSourceInfo, ChangeType.DidChange);
|
||||||
|
|
||||||
|
var vc = VideoCodec as IHasExternalSourceSwitching;
|
||||||
|
if (vc != null)
|
||||||
|
{
|
||||||
|
vc.SetSelectedSource(CurrentSourceInfoKey);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SourceListItem _CurrentSourceInfo;
|
SourceListItem _CurrentSourceInfo;
|
||||||
@@ -273,19 +279,23 @@ namespace PepperDash.Essentials
|
|||||||
if (disp != null)
|
if (disp != null)
|
||||||
{
|
{
|
||||||
// Link power, warming, cooling to display
|
// Link power, warming, cooling to display
|
||||||
disp.PowerIsOnFeedback.OutputChange += (o, a) =>
|
var dispTwoWay = disp as IHasPowerControlWithFeedback;
|
||||||
|
if (dispTwoWay != null)
|
||||||
{
|
{
|
||||||
if (disp.PowerIsOnFeedback.BoolValue != OnFeedback.BoolValue)
|
dispTwoWay.PowerIsOnFeedback.OutputChange += (o, a) =>
|
||||||
{
|
{
|
||||||
if (!disp.PowerIsOnFeedback.BoolValue)
|
if (dispTwoWay.PowerIsOnFeedback.BoolValue != OnFeedback.BoolValue)
|
||||||
|
{
|
||||||
|
if (!dispTwoWay.PowerIsOnFeedback.BoolValue)
|
||||||
CurrentSourceInfo = null;
|
CurrentSourceInfo = null;
|
||||||
OnFeedback.FireUpdate();
|
OnFeedback.FireUpdate();
|
||||||
}
|
}
|
||||||
if (disp.PowerIsOnFeedback.BoolValue)
|
if (dispTwoWay.PowerIsOnFeedback.BoolValue)
|
||||||
{
|
{
|
||||||
SetDefaultLevels();
|
SetDefaultLevels();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
disp.IsWarmingUpFeedback.OutputChange += (o, a) =>
|
disp.IsWarmingUpFeedback.OutputChange += (o, a) =>
|
||||||
{
|
{
|
||||||
@@ -383,6 +393,8 @@ namespace PepperDash.Essentials
|
|||||||
Debug.Console(0, this, Debug.ErrorLogLevel.Notice, "Shutting down room");
|
Debug.Console(0, this, Debug.ErrorLogLevel.Notice, "Shutting down room");
|
||||||
|
|
||||||
RunRouteAction("roomOff");
|
RunRouteAction("roomOff");
|
||||||
|
VideoCodec.StopSharing();
|
||||||
|
VideoCodec.StandbyActivate();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -580,6 +592,19 @@ namespace PepperDash.Essentials
|
|||||||
|
|
||||||
OnFeedback.FireUpdate();
|
OnFeedback.FireUpdate();
|
||||||
|
|
||||||
|
if (OnFeedback.BoolValue)
|
||||||
|
{
|
||||||
|
if (VideoCodec.UsageTracker.InUseTracker.InUseFeedback.BoolValue)
|
||||||
|
{
|
||||||
|
Debug.Console(1, this, "Video Codec in use, deactivating standby on codec");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (VideoCodec.StandbyIsOnFeedback.BoolValue)
|
||||||
|
{
|
||||||
|
VideoCodec.StandbyDeactivate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// report back when done
|
// report back when done
|
||||||
if (successCallback != null)
|
if (successCallback != null)
|
||||||
successCallback();
|
successCallback();
|
||||||
@@ -640,8 +665,9 @@ namespace PepperDash.Essentials
|
|||||||
if (route.SourceKey.Equals("$off", StringComparison.OrdinalIgnoreCase))
|
if (route.SourceKey.Equals("$off", StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
dest.ReleaseRoute();
|
dest.ReleaseRoute();
|
||||||
if (dest is IPower)
|
if (dest is IHasPowerControl)
|
||||||
(dest as IPower).PowerOff();
|
(dest as IHasPowerControl).PowerOff();
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -700,12 +726,17 @@ namespace PepperDash.Essentials
|
|||||||
{
|
{
|
||||||
var videoCodecWithExternalSwitching = VideoCodec as IHasExternalSourceSwitching;
|
var videoCodecWithExternalSwitching = VideoCodec as IHasExternalSourceSwitching;
|
||||||
|
|
||||||
if (videoCodecWithExternalSwitching == null)
|
if (videoCodecWithExternalSwitching == null || !videoCodecWithExternalSwitching.ExternalSourceListEnabled)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
string codecTieLine = ConfigReader.ConfigObject.TieLines.SingleOrDefault(x => x.DestinationKey == VideoCodec.Key).DestinationPort;
|
try
|
||||||
|
{
|
||||||
|
// Get the tie line that the external switcher is connected to
|
||||||
|
string codecInputConnectorName = ConfigReader.ConfigObject.TieLines.SingleOrDefault(
|
||||||
|
x => x.DestinationKey == VideoCodec.Key && x.DestinationPort == videoCodecWithExternalSwitching.ExternalSourceInputPort).DestinationPort;
|
||||||
|
|
||||||
videoCodecWithExternalSwitching.ClearExternalSources();
|
videoCodecWithExternalSwitching.ClearExternalSources();
|
||||||
videoCodecWithExternalSwitching.RunRouteAction = RunRouteAction;
|
videoCodecWithExternalSwitching.RunRouteAction = RunRouteAction;
|
||||||
var srcList = ConfigReader.ConfigObject.SourceLists.SingleOrDefault(x => x.Key == SourceListKey).Value.OrderBy(kv => kv.Value.Order); ;
|
var srcList = ConfigReader.ConfigObject.SourceLists.SingleOrDefault(x => x.Key == SourceListKey).Value.OrderBy(kv => kv.Value.Order); ;
|
||||||
@@ -716,14 +747,16 @@ namespace PepperDash.Essentials
|
|||||||
|
|
||||||
if (kvp.Key != DefaultCodecRouteString && kvp.Key != "roomOff")
|
if (kvp.Key != DefaultCodecRouteString && kvp.Key != "roomOff")
|
||||||
{
|
{
|
||||||
|
videoCodecWithExternalSwitching.AddExternalSource(codecInputConnectorName, kvp.Key, srcConfig.PreferredName, PepperDash.Essentials.Devices.Common.VideoCodec.Cisco.eExternalSourceType.desktop);
|
||||||
videoCodecWithExternalSwitching.AddExternalSource(codecTieLine, kvp.Key, srcConfig.PreferredName, PepperDash.Essentials.Devices.Common.VideoCodec.Cisco.eExternalSourceType.desktop);
|
|
||||||
videoCodecWithExternalSwitching.SetExternalSourceState(kvp.Key, PepperDash.Essentials.Devices.Common.VideoCodec.Cisco.eExternalSourceMode.Ready);
|
videoCodecWithExternalSwitching.SetExternalSourceState(kvp.Key, PepperDash.Essentials.Devices.Common.VideoCodec.Cisco.eExternalSourceMode.Ready);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Debug.Console(2, this, "Error setting codec external sources: {0}", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void SetCodecBranding()
|
private void SetCodecBranding()
|
||||||
{
|
{
|
||||||
|
|||||||
473
PepperDashEssentials/Room/Types/EssentialsTechRoom.cs
Normal file
473
PepperDashEssentials/Room/Types/EssentialsTechRoom.cs
Normal file
@@ -0,0 +1,473 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using Crestron.SimplSharp;
|
||||||
|
using Crestron.SimplSharp.Scheduler;
|
||||||
|
using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using PepperDash.Core;
|
||||||
|
using PepperDash.Essentials.Core;
|
||||||
|
using PepperDash.Essentials.Core.Bridges;
|
||||||
|
using PepperDash.Essentials.Core.Config;
|
||||||
|
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
|
||||||
|
using PepperDash.Essentials.Core.Presets;
|
||||||
|
using PepperDash.Essentials.Devices.Common;
|
||||||
|
using PepperDash.Essentials.Room.Config;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials
|
||||||
|
{
|
||||||
|
public class EssentialsTechRoom : EssentialsRoomBase, ITvPresetsProvider, IBridgeAdvanced, IRunDirectRouteAction
|
||||||
|
{
|
||||||
|
private readonly EssentialsTechRoomConfig _config;
|
||||||
|
private readonly Dictionary<string, TwoWayDisplayBase> _displays;
|
||||||
|
|
||||||
|
private readonly DevicePresetsModel _tunerPresets;
|
||||||
|
private readonly Dictionary<string, IRSetTopBoxBase> _tuners;
|
||||||
|
|
||||||
|
private Dictionary<string, string> _currentPresets;
|
||||||
|
private ScheduledEventGroup _roomScheduledEventGroup;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
protected override Func<bool> IsWarmingFeedbackFunc
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return () =>
|
||||||
|
{
|
||||||
|
return _displays.All(kv => kv.Value.IsWarmingUpFeedback.BoolValue);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
protected override Func<bool> IsCoolingFeedbackFunc
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return () =>
|
||||||
|
{
|
||||||
|
return _displays.All(kv => kv.Value.IsCoolingDownFeedback.BoolValue);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public EssentialsTechRoom(DeviceConfig config) : base(config)
|
||||||
|
{
|
||||||
|
_config = config.Properties.ToObject<EssentialsTechRoomConfig>();
|
||||||
|
|
||||||
|
_tunerPresets = new DevicePresetsModel(String.Format("{0}-presets", config.Key), _config.PresetsFileName);
|
||||||
|
|
||||||
|
_tunerPresets.SetFileName(_config.PresetsFileName);
|
||||||
|
|
||||||
|
_tunerPresets.PresetRecalled += TunerPresetsOnPresetRecalled;
|
||||||
|
|
||||||
|
_tuners = GetDevices<IRSetTopBoxBase>(_config.Tuners);
|
||||||
|
_displays = GetDevices<TwoWayDisplayBase>(_config.Displays);
|
||||||
|
|
||||||
|
RoomPowerIsOnFeedback = new BoolFeedback(() => RoomPowerIsOn);
|
||||||
|
|
||||||
|
SetUpTunerPresetsFeedback();
|
||||||
|
|
||||||
|
SubscribeToDisplayFeedbacks();
|
||||||
|
|
||||||
|
CreateOrUpdateScheduledEvents();
|
||||||
|
}
|
||||||
|
|
||||||
|
public Dictionary<string, StringFeedback> CurrentPresetsFeedbacks { get; private set; }
|
||||||
|
|
||||||
|
public Dictionary<string, IRSetTopBoxBase> Tuners
|
||||||
|
{
|
||||||
|
get { return _tuners; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public Dictionary<string, TwoWayDisplayBase> Displays
|
||||||
|
{
|
||||||
|
get { return _displays; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public BoolFeedback RoomPowerIsOnFeedback { get; private set; }
|
||||||
|
|
||||||
|
public bool RoomPowerIsOn
|
||||||
|
{
|
||||||
|
get { return _displays.All(kv => kv.Value.PowerIsOnFeedback.BoolValue); }
|
||||||
|
}
|
||||||
|
|
||||||
|
#region ITvPresetsProvider Members
|
||||||
|
|
||||||
|
public DevicePresetsModel TvPresets
|
||||||
|
{
|
||||||
|
get { return _tunerPresets; }
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private void TunerPresetsOnPresetRecalled(ISetTopBoxNumericKeypad device, string channel)
|
||||||
|
{
|
||||||
|
if (!_currentPresets.ContainsKey(device.Key))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
_currentPresets[device.Key] = channel;
|
||||||
|
|
||||||
|
if (!CurrentPresetsFeedbacks.ContainsKey(device.Key))
|
||||||
|
{
|
||||||
|
CurrentPresetsFeedbacks[device.Key].FireUpdate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SetUpTunerPresetsFeedback()
|
||||||
|
{
|
||||||
|
_currentPresets = new Dictionary<string, string>();
|
||||||
|
CurrentPresetsFeedbacks = new Dictionary<string, StringFeedback>();
|
||||||
|
|
||||||
|
foreach (var setTopBox in _tuners)
|
||||||
|
{
|
||||||
|
var tuner = setTopBox.Value;
|
||||||
|
_currentPresets.Add(tuner.Key, String.Empty);
|
||||||
|
CurrentPresetsFeedbacks.Add(tuner.Key, new StringFeedback(() => _currentPresets[tuner.Key]));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SubscribeToDisplayFeedbacks()
|
||||||
|
{
|
||||||
|
foreach (var display in _displays)
|
||||||
|
{
|
||||||
|
display.Value.PowerIsOnFeedback.OutputChange +=
|
||||||
|
(sender, args) =>
|
||||||
|
{
|
||||||
|
RoomPowerIsOnFeedback.InvokeFireUpdate();
|
||||||
|
IsWarmingUpFeedback.InvokeFireUpdate();
|
||||||
|
IsCoolingDownFeedback.InvokeFireUpdate();
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void CreateOrUpdateScheduledEvents()
|
||||||
|
{
|
||||||
|
var eventsConfig = _config.ScheduledEvents;
|
||||||
|
|
||||||
|
GetOrCreateScheduleGroup();
|
||||||
|
|
||||||
|
foreach (var eventConfig in eventsConfig)
|
||||||
|
{
|
||||||
|
CreateOrUpdateSingleEvent(eventConfig);
|
||||||
|
}
|
||||||
|
|
||||||
|
_roomScheduledEventGroup.UserGroupCallBack += HandleScheduledEvent;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void GetOrCreateScheduleGroup()
|
||||||
|
{
|
||||||
|
if (_roomScheduledEventGroup == null)
|
||||||
|
{
|
||||||
|
_roomScheduledEventGroup = Scheduler.GetEventGroup(Key) ?? new ScheduledEventGroup(Key);
|
||||||
|
|
||||||
|
Scheduler.AddEventGroup(_roomScheduledEventGroup);
|
||||||
|
}
|
||||||
|
|
||||||
|
_roomScheduledEventGroup.RetrieveAllEvents();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void CreateOrUpdateSingleEvent(ScheduledEventConfig scheduledEvent)
|
||||||
|
{
|
||||||
|
if (!_roomScheduledEventGroup.ScheduledEvents.ContainsKey(scheduledEvent.Key))
|
||||||
|
{
|
||||||
|
SchedulerUtilities.CreateEventFromConfig(scheduledEvent, _roomScheduledEventGroup, HandleScheduledEvent);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var roomEvent = _roomScheduledEventGroup.ScheduledEvents[scheduledEvent.Key];
|
||||||
|
|
||||||
|
if (!SchedulerUtilities.CheckEventTimeForMatch(roomEvent, DateTime.Parse(scheduledEvent.Time)) &&
|
||||||
|
!SchedulerUtilities.CheckEventRecurrenceForMatch(roomEvent, scheduledEvent.Days))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Debug.Console(1, this,
|
||||||
|
"Existing event does not match new config properties. Deleting existing event '{0}' and creating new event from configuration",
|
||||||
|
roomEvent.Name);
|
||||||
|
|
||||||
|
_roomScheduledEventGroup.DeleteEvent(roomEvent);
|
||||||
|
|
||||||
|
SchedulerUtilities.CreateEventFromConfig(scheduledEvent, _roomScheduledEventGroup, HandleScheduledEvent);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void AddOrUpdateScheduledEvent(ScheduledEventConfig scheduledEvent)
|
||||||
|
{
|
||||||
|
//update config based on key of scheduleEvent
|
||||||
|
GetOrCreateScheduleGroup();
|
||||||
|
var existingEventIndex = _config.ScheduledEvents.FindIndex((e) => e.Key == scheduledEvent.Key);
|
||||||
|
|
||||||
|
if (existingEventIndex < 0)
|
||||||
|
{
|
||||||
|
_config.ScheduledEvents.Add(scheduledEvent);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_config.ScheduledEvents[existingEventIndex] = scheduledEvent;
|
||||||
|
}
|
||||||
|
|
||||||
|
//create or update event based on config
|
||||||
|
CreateOrUpdateSingleEvent(scheduledEvent);
|
||||||
|
//save config
|
||||||
|
Config.Properties = JToken.FromObject(_config);
|
||||||
|
|
||||||
|
CustomSetConfig(Config);
|
||||||
|
//Fire Event
|
||||||
|
OnScheduledEventUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<ScheduledEventConfig> GetScheduledEvents()
|
||||||
|
{
|
||||||
|
return _config.ScheduledEvents ?? new List<ScheduledEventConfig>();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnScheduledEventUpdate()
|
||||||
|
{
|
||||||
|
var handler = ScheduledEventsChanged;
|
||||||
|
|
||||||
|
if (handler == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
handler(this, new ScheduledEventEventArgs {ScheduledEvents = _config.ScheduledEvents});
|
||||||
|
}
|
||||||
|
|
||||||
|
public event EventHandler<ScheduledEventEventArgs> ScheduledEventsChanged;
|
||||||
|
|
||||||
|
private void HandleScheduledEvent(ScheduledEvent schevent, ScheduledEventCommon.eCallbackReason type)
|
||||||
|
{
|
||||||
|
var eventConfig = _config.ScheduledEvents.FirstOrDefault(e => e.Key == schevent.Name);
|
||||||
|
|
||||||
|
if (eventConfig == null)
|
||||||
|
{
|
||||||
|
Debug.Console(1, this, "Event with name {0} not found", schevent.Name);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Debug.Console(1, this, "Running actions for event {0}", schevent.Name);
|
||||||
|
|
||||||
|
if (eventConfig.Acknowledgeable)
|
||||||
|
{
|
||||||
|
schevent.Acknowledge();
|
||||||
|
}
|
||||||
|
|
||||||
|
CrestronInvoke.BeginInvoke((o) =>
|
||||||
|
{
|
||||||
|
Debug.Console(2, this, "There are {0} actions to execute for this event.", eventConfig.Actions.Count);
|
||||||
|
|
||||||
|
foreach (var a in eventConfig.Actions)
|
||||||
|
{
|
||||||
|
Debug.Console(2, this,
|
||||||
|
@"Attempting to run action:
|
||||||
|
DeviceKey: {0}
|
||||||
|
MethodName: {1}
|
||||||
|
Params: {2}"
|
||||||
|
, a.DeviceKey, a.MethodName, a.Params);
|
||||||
|
DeviceJsonApi.DoDeviceAction(a);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void RoomPowerOn()
|
||||||
|
{
|
||||||
|
Debug.Console(2, this, "Room Powering On");
|
||||||
|
|
||||||
|
var dummySource = DeviceManager.GetDeviceForKey(_config.DummySourceKey) as IRoutingOutputs;
|
||||||
|
|
||||||
|
if (dummySource == null)
|
||||||
|
{
|
||||||
|
Debug.Console(1, this, "Unable to get source with key: {0}", _config.DummySourceKey);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (var display in _displays)
|
||||||
|
{
|
||||||
|
RunDirectRoute(dummySource, display.Value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void RoomPowerOff()
|
||||||
|
{
|
||||||
|
Debug.Console(2, this, "Room Powering Off");
|
||||||
|
|
||||||
|
foreach (var display in _displays)
|
||||||
|
{
|
||||||
|
display.Value.PowerOff();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private Dictionary<string, T> GetDevices<T>(ICollection<string> config) where T : IKeyed
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var returnValue = DeviceManager.AllDevices.OfType<T>()
|
||||||
|
.Where(d => config.Contains(d.Key))
|
||||||
|
.ToDictionary(d => d.Key, d => d);
|
||||||
|
|
||||||
|
return returnValue;
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
Debug.Console(0, this, Debug.ErrorLogLevel.Error,
|
||||||
|
"Error getting devices. Check Essentials Configuration");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Overrides of EssentialsRoomBase
|
||||||
|
|
||||||
|
protected override Func<bool> OnFeedbackFunc
|
||||||
|
{
|
||||||
|
get { return () => RoomPowerIsOn; }
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void EndShutdown()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void SetDefaultLevels()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void PowerOnToDefaultOrLastSource()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public override bool RunDefaultPresentRoute()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void RoomVacatedForTimeoutPeriod(object o)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Implementation of IBridgeAdvanced
|
||||||
|
|
||||||
|
public void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
||||||
|
{
|
||||||
|
|
||||||
|
var joinMap = new EssentialsTechRoomJoinMap(joinStart);
|
||||||
|
var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
|
||||||
|
|
||||||
|
if (!String.IsNullOrEmpty(joinMapSerialized))
|
||||||
|
{
|
||||||
|
joinMap = JsonConvert.DeserializeObject<EssentialsTechRoomJoinMap>(joinMapSerialized);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (bridge != null)
|
||||||
|
{
|
||||||
|
bridge.AddJoinMap(Key, joinMap);
|
||||||
|
}
|
||||||
|
uint i;
|
||||||
|
if (_config.IsPrimary)
|
||||||
|
{
|
||||||
|
i = 0;
|
||||||
|
foreach (var feedback in CurrentPresetsFeedbacks)
|
||||||
|
{
|
||||||
|
feedback.Value.LinkInputSig(trilist.StringInput[(uint) (joinMap.CurrentPreset.JoinNumber + i)]);
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
trilist.OnlineStatusChange += (device, args) =>
|
||||||
|
{
|
||||||
|
if (!args.DeviceOnLine)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (var feedback in CurrentPresetsFeedbacks)
|
||||||
|
{
|
||||||
|
feedback.Value.FireUpdate();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
i = 0;
|
||||||
|
foreach (var setTopBox in _tuners)
|
||||||
|
{
|
||||||
|
var tuner = setTopBox;
|
||||||
|
|
||||||
|
trilist.SetStringSigAction(joinMap.CurrentPreset.JoinNumber + i, s => _tunerPresets.Dial(s, tuner.Value));
|
||||||
|
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private class EssentialsTechRoomJoinMap : JoinMapBaseAdvanced
|
||||||
|
{
|
||||||
|
[JoinName("currentPreset")]
|
||||||
|
public JoinDataComplete CurrentPreset = new JoinDataComplete(new JoinData {JoinNumber = 1, JoinSpan = 16},
|
||||||
|
new JoinMetadata {Description = "Current Tuner Preset", JoinType = eJoinType.Serial});
|
||||||
|
|
||||||
|
public EssentialsTechRoomJoinMap(uint joinStart) : base(joinStart, typeof(EssentialsTechRoomJoinMap))
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#region IRunDirectRouteAction Members
|
||||||
|
|
||||||
|
private void RunDirectRoute(IRoutingOutputs source, IRoutingSink dest)
|
||||||
|
{
|
||||||
|
if (dest == null)
|
||||||
|
{
|
||||||
|
Debug.Console(1, this, "Cannot route, unknown destination '{0}'", dest.Key);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (source == null)
|
||||||
|
{
|
||||||
|
dest.ReleaseRoute();
|
||||||
|
if (dest is IHasPowerControl)
|
||||||
|
(dest as IHasPowerControl).PowerOff();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dest.ReleaseAndMakeRoute(source, eRoutingSignalType.Video);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Attempts to route directly between a source and destination
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sourceKey"></param>
|
||||||
|
/// <param name="destinationKey"></param>
|
||||||
|
public void RunDirectRoute(string sourceKey, string destinationKey)
|
||||||
|
{
|
||||||
|
IRoutingSink dest = null;
|
||||||
|
|
||||||
|
dest = DeviceManager.GetDeviceForKey(destinationKey) as IRoutingSink;
|
||||||
|
|
||||||
|
var source = DeviceManager.GetDeviceForKey(sourceKey) as IRoutingOutputs;
|
||||||
|
|
||||||
|
if (source == null || dest == null)
|
||||||
|
{
|
||||||
|
Debug.Console(1, this, "Cannot route unknown source or destination '{0}' to {1}", sourceKey, destinationKey);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
RunDirectRoute(source, dest);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ScheduledEventEventArgs : EventArgs
|
||||||
|
{
|
||||||
|
public List<ScheduledEventConfig> ScheduledEvents;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,13 +1,10 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
using Crestron.SimplSharp.CrestronIO;
|
using Crestron.SimplSharp.CrestronIO;
|
||||||
using Crestron.SimplSharp.Net.Http;
|
using Crestron.SimplSharp.Net.Http;
|
||||||
|
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core;
|
|
||||||
|
|
||||||
namespace PepperDash.Essentials
|
namespace PepperDash.Essentials
|
||||||
{
|
{
|
||||||
@@ -16,12 +13,12 @@ namespace PepperDash.Essentials
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
HttpServer Server;
|
readonly HttpServer _server;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
string FileDirectory;
|
readonly string _fileDirectory;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
@@ -45,18 +42,17 @@ namespace PepperDash.Essentials
|
|||||||
//{ ".js", "application/javascript" },
|
//{ ".js", "application/javascript" },
|
||||||
//{ ".json", "application/json" },
|
//{ ".json", "application/json" },
|
||||||
//{ ".map", "application/x-navimap" },
|
//{ ".map", "application/x-navimap" },
|
||||||
{ ".pdf", "application.pdf" },
|
{ ".pdf", "application/pdf" },
|
||||||
{ ".png", "image/png" },
|
{ ".png", "image/png" },
|
||||||
//{ ".txt", "text/plain" },
|
//{ ".txt", "text/plain" },
|
||||||
};
|
};
|
||||||
|
|
||||||
Server = new HttpServer();
|
_server = new HttpServer {Port = port};
|
||||||
Server.Port = port;
|
_fileDirectory = directory;
|
||||||
FileDirectory = directory;
|
_server.OnHttpRequest += Server_OnHttpRequest;
|
||||||
Server.OnHttpRequest += new OnHttpRequestHandler(Server_OnHttpRequest);
|
_server.Open();
|
||||||
Server.Open();
|
|
||||||
|
|
||||||
CrestronEnvironment.ProgramStatusEventHandler += new ProgramStatusEventHandler(CrestronEnvironment_ProgramStatusEventHandler);
|
CrestronEnvironment.ProgramStatusEventHandler += CrestronEnvironment_ProgramStatusEventHandler;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -67,10 +63,12 @@ namespace PepperDash.Essentials
|
|||||||
var path = args.Request.Path;
|
var path = args.Request.Path;
|
||||||
Debug.Console(2, "HTTP Request with path: '{0}'", args.Request.Path);
|
Debug.Console(2, "HTTP Request with path: '{0}'", args.Request.Path);
|
||||||
|
|
||||||
if (File.Exists(FileDirectory + path))
|
try
|
||||||
{
|
{
|
||||||
string filePath = path.Replace('/', '\\');
|
if (File.Exists(_fileDirectory + path))
|
||||||
string localPath = string.Format(@"{0}{1}", FileDirectory, filePath);
|
{
|
||||||
|
var filePath = path.Replace('/', '\\');
|
||||||
|
var localPath = string.Format(@"{0}{1}", _fileDirectory, filePath);
|
||||||
|
|
||||||
Debug.Console(2, "HTTP Logo Server attempting to find file: '{0}'", localPath);
|
Debug.Console(2, "HTTP Logo Server attempting to find file: '{0}'", localPath);
|
||||||
if (File.Exists(localPath))
|
if (File.Exists(localPath))
|
||||||
@@ -87,7 +85,18 @@ namespace PepperDash.Essentials
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Debug.Console(2, "HTTP Logo Server: '{0}' does not exist", FileDirectory + path);
|
Debug.Console(2, "HTTP Logo Server: '{0}' does not exist", _fileDirectory + path);
|
||||||
|
args.Response.ContentString = string.Format("Not found: '{0}'", _fileDirectory + path);
|
||||||
|
args.Response.Code = 404;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Debug.Console(0, Debug.ErrorLogLevel.Error, "Exception getting file: {0}", ex.Message);
|
||||||
|
Debug.Console(0, Debug.ErrorLogLevel.Error, "Stack Trace: {0}", ex.StackTrace);
|
||||||
|
|
||||||
|
args.Response.Code = 400;
|
||||||
|
args.Response.ContentString = string.Format("invalid request");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -97,7 +106,7 @@ namespace PepperDash.Essentials
|
|||||||
void CrestronEnvironment_ProgramStatusEventHandler(eProgramStatusEventType programEventType)
|
void CrestronEnvironment_ProgramStatusEventHandler(eProgramStatusEventType programEventType)
|
||||||
{
|
{
|
||||||
if (programEventType == eProgramStatusEventType.Stopping)
|
if (programEventType == eProgramStatusEventType.Stopping)
|
||||||
Server.Close();
|
_server.Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -107,11 +116,7 @@ namespace PepperDash.Essentials
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static string GetContentType(string extension)
|
public static string GetContentType(string extension)
|
||||||
{
|
{
|
||||||
string type;
|
var type = ExtensionContentTypes.ContainsKey(extension) ? ExtensionContentTypes[extension] : "text/plain";
|
||||||
if (ExtensionContentTypes.ContainsKey(extension))
|
|
||||||
type = ExtensionContentTypes[extension];
|
|
||||||
else
|
|
||||||
type = "text/plain";
|
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -306,8 +306,8 @@ namespace PepperDash.Essentials
|
|||||||
|
|
||||||
TriList.SetSigFalseAction(UIBoolJoin.DisplayPowerTogglePress, () =>
|
TriList.SetSigFalseAction(UIBoolJoin.DisplayPowerTogglePress, () =>
|
||||||
{
|
{
|
||||||
if (CurrentRoom != null && CurrentRoom.DefaultDisplay is IPower)
|
if (CurrentRoom != null && CurrentRoom.DefaultDisplay is IHasPowerControl)
|
||||||
(CurrentRoom.DefaultDisplay as IPower).PowerToggle();
|
(CurrentRoom.DefaultDisplay as IHasPowerControl).PowerToggle();
|
||||||
});
|
});
|
||||||
|
|
||||||
base.Show();
|
base.Show();
|
||||||
@@ -984,8 +984,8 @@ namespace PepperDash.Essentials
|
|||||||
(previousDev as IDvr).UnlinkButtons(TriList);
|
(previousDev as IDvr).UnlinkButtons(TriList);
|
||||||
if (previousDev is INumericKeypad)
|
if (previousDev is INumericKeypad)
|
||||||
(previousDev as INumericKeypad).UnlinkButtons(TriList);
|
(previousDev as INumericKeypad).UnlinkButtons(TriList);
|
||||||
if (previousDev is IPower)
|
if (previousDev is IHasPowerControl)
|
||||||
(previousDev as IPower).UnlinkButtons(TriList);
|
(previousDev as IHasPowerControl).UnlinkButtons(TriList);
|
||||||
if (previousDev is ITransport)
|
if (previousDev is ITransport)
|
||||||
(previousDev as ITransport).UnlinkButtons(TriList);
|
(previousDev as ITransport).UnlinkButtons(TriList);
|
||||||
//if (previousDev is IRadio)
|
//if (previousDev is IRadio)
|
||||||
@@ -1044,8 +1044,8 @@ namespace PepperDash.Essentials
|
|||||||
(dev as IDvr).LinkButtons(TriList);
|
(dev as IDvr).LinkButtons(TriList);
|
||||||
if (dev is INumericKeypad)
|
if (dev is INumericKeypad)
|
||||||
(dev as INumericKeypad).LinkButtons(TriList);
|
(dev as INumericKeypad).LinkButtons(TriList);
|
||||||
if (dev is IPower)
|
if (dev is IHasPowerControl)
|
||||||
(dev as IPower).LinkButtons(TriList);
|
(dev as IHasPowerControl).LinkButtons(TriList);
|
||||||
if (dev is ITransport)
|
if (dev is ITransport)
|
||||||
(dev as ITransport).LinkButtons(TriList);
|
(dev as ITransport).LinkButtons(TriList);
|
||||||
//if (dev is IRadio)
|
//if (dev is IRadio)
|
||||||
|
|||||||
@@ -319,8 +319,8 @@ namespace PepperDash.Essentials
|
|||||||
|
|
||||||
TriList.SetSigFalseAction(UIBoolJoin.DisplayPowerTogglePress, () =>
|
TriList.SetSigFalseAction(UIBoolJoin.DisplayPowerTogglePress, () =>
|
||||||
{
|
{
|
||||||
if (CurrentRoom != null && CurrentRoom.DefaultDisplay is IPower)
|
if (CurrentRoom != null && CurrentRoom.DefaultDisplay is IHasPowerControl)
|
||||||
(CurrentRoom.DefaultDisplay as IPower).PowerToggle();
|
(CurrentRoom.DefaultDisplay as IHasPowerControl).PowerToggle();
|
||||||
});
|
});
|
||||||
|
|
||||||
SetupNextMeetingTimer();
|
SetupNextMeetingTimer();
|
||||||
@@ -1293,8 +1293,8 @@ namespace PepperDash.Essentials
|
|||||||
(previousDev as IDvr).UnlinkButtons(TriList);
|
(previousDev as IDvr).UnlinkButtons(TriList);
|
||||||
if (previousDev is INumericKeypad)
|
if (previousDev is INumericKeypad)
|
||||||
(previousDev as INumericKeypad).UnlinkButtons(TriList);
|
(previousDev as INumericKeypad).UnlinkButtons(TriList);
|
||||||
if (previousDev is IPower)
|
if (previousDev is IHasPowerControl)
|
||||||
(previousDev as IPower).UnlinkButtons(TriList);
|
(previousDev as IHasPowerControl).UnlinkButtons(TriList);
|
||||||
if (previousDev is ITransport)
|
if (previousDev is ITransport)
|
||||||
(previousDev as ITransport).UnlinkButtons(TriList);
|
(previousDev as ITransport).UnlinkButtons(TriList);
|
||||||
}
|
}
|
||||||
@@ -1351,8 +1351,8 @@ namespace PepperDash.Essentials
|
|||||||
(dev as IDvr).LinkButtons(TriList);
|
(dev as IDvr).LinkButtons(TriList);
|
||||||
if (dev is INumericKeypad)
|
if (dev is INumericKeypad)
|
||||||
(dev as INumericKeypad).LinkButtons(TriList);
|
(dev as INumericKeypad).LinkButtons(TriList);
|
||||||
if (dev is IPower)
|
if (dev is IHasPowerControl)
|
||||||
(dev as IPower).LinkButtons(TriList);
|
(dev as IHasPowerControl).LinkButtons(TriList);
|
||||||
if (dev is ITransport)
|
if (dev is ITransport)
|
||||||
(dev as ITransport).LinkButtons(TriList);
|
(dev as ITransport).LinkButtons(TriList);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ namespace PepperDash.Essentials.Core.Bridges
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Bridge API using EISC
|
/// Bridge API using EISC
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class EiscApiAdvanced : BridgeApi
|
public class EiscApiAdvanced : BridgeApi, ICommunicationMonitor
|
||||||
{
|
{
|
||||||
public EiscApiPropertiesConfig PropertiesConfig { get; private set; }
|
public EiscApiPropertiesConfig PropertiesConfig { get; private set; }
|
||||||
|
|
||||||
@@ -98,13 +98,35 @@ namespace PepperDash.Essentials.Core.Bridges
|
|||||||
|
|
||||||
Eisc.SigChange += Eisc_SigChange;
|
Eisc.SigChange += Eisc_SigChange;
|
||||||
|
|
||||||
|
CommunicationMonitor = new CrestronGenericBaseCommunicationMonitor(this, Eisc, 120000, 300000);
|
||||||
|
|
||||||
AddPostActivationAction(LinkDevices);
|
AddPostActivationAction(LinkDevices);
|
||||||
|
AddPostActivationAction(LinkRooms);
|
||||||
|
AddPostActivationAction(RegisterEisc);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override bool CustomActivate()
|
||||||
|
{
|
||||||
|
CommunicationMonitor.Start();
|
||||||
|
return base.CustomActivate();
|
||||||
|
}
|
||||||
|
|
||||||
|
public override bool Deactivate()
|
||||||
|
{
|
||||||
|
CommunicationMonitor.Stop();
|
||||||
|
return base.Deactivate();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void LinkDevices()
|
private void LinkDevices()
|
||||||
{
|
{
|
||||||
Debug.Console(1, this, "Linking Devices...");
|
Debug.Console(1, this, "Linking Devices...");
|
||||||
|
|
||||||
|
if (PropertiesConfig.Devices == null)
|
||||||
|
{
|
||||||
|
Debug.Console(1, this, Debug.ErrorLogLevel.Notice, "No devices linked to this bridge");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
foreach (var d in PropertiesConfig.Devices)
|
foreach (var d in PropertiesConfig.Devices)
|
||||||
{
|
{
|
||||||
var device = DeviceManager.GetDeviceForKey(d.DeviceKey);
|
var device = DeviceManager.GetDeviceForKey(d.DeviceKey);
|
||||||
@@ -130,6 +152,14 @@ namespace PepperDash.Essentials.Core.Bridges
|
|||||||
bridge.LinkToApi(Eisc, d.JoinStart, d.JoinMapKey, this);
|
bridge.LinkToApi(Eisc, d.JoinStart, d.JoinMapKey, this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void RegisterEisc()
|
||||||
|
{
|
||||||
|
if (Eisc.Registered)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var registerResult = Eisc.Register();
|
var registerResult = Eisc.Register();
|
||||||
|
|
||||||
@@ -142,6 +172,31 @@ namespace PepperDash.Essentials.Core.Bridges
|
|||||||
Debug.Console(1, this, Debug.ErrorLogLevel.Notice, "EISC registration successful");
|
Debug.Console(1, this, Debug.ErrorLogLevel.Notice, "EISC registration successful");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void LinkRooms()
|
||||||
|
{
|
||||||
|
Debug.Console(1, this, "Linking Rooms...");
|
||||||
|
|
||||||
|
if (PropertiesConfig.Rooms == null)
|
||||||
|
{
|
||||||
|
Debug.Console(1, this, Debug.ErrorLogLevel.Notice, "No rooms linked to this bridge.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (var room in PropertiesConfig.Rooms)
|
||||||
|
{
|
||||||
|
var rm = DeviceManager.GetDeviceForKey(room.RoomKey) as IBridgeAdvanced;
|
||||||
|
|
||||||
|
if (rm == null)
|
||||||
|
{
|
||||||
|
Debug.Console(1, this, Debug.ErrorLogLevel.Notice,
|
||||||
|
"Room {0} does not implement IBridgeAdvanced. Skipping...", room.RoomKey);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
rm.LinkToApi(Eisc, room.JoinStart, room.JoinMapKey, this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Adds a join map
|
/// Adds a join map
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -280,6 +335,12 @@ namespace PepperDash.Essentials.Core.Bridges
|
|||||||
Debug.Console(2, this, "Error in Eisc_SigChange handler: {0}", e);
|
Debug.Console(2, this, "Error in Eisc_SigChange handler: {0}", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#region Implementation of ICommunicationMonitor
|
||||||
|
|
||||||
|
public StatusMonitorBase CommunicationMonitor { get; private set; }
|
||||||
|
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
public class EiscApiPropertiesConfig
|
public class EiscApiPropertiesConfig
|
||||||
@@ -290,6 +351,9 @@ namespace PepperDash.Essentials.Core.Bridges
|
|||||||
[JsonProperty("devices")]
|
[JsonProperty("devices")]
|
||||||
public List<ApiDevicePropertiesConfig> Devices { get; set; }
|
public List<ApiDevicePropertiesConfig> Devices { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("rooms")]
|
||||||
|
public List<ApiRoomPropertiesConfig> Rooms { get; set; }
|
||||||
|
|
||||||
|
|
||||||
public class ApiDevicePropertiesConfig
|
public class ApiDevicePropertiesConfig
|
||||||
{
|
{
|
||||||
@@ -303,6 +367,18 @@ namespace PepperDash.Essentials.Core.Bridges
|
|||||||
public string JoinMapKey { get; set; }
|
public string JoinMapKey { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class ApiRoomPropertiesConfig
|
||||||
|
{
|
||||||
|
[JsonProperty("roomKey")]
|
||||||
|
public string RoomKey { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("joinStart")]
|
||||||
|
public uint JoinStart { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("joinMapKey")]
|
||||||
|
public string JoinMapKey { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class EiscApiAdvancedFactory : EssentialsDeviceFactory<EiscApiAdvanced>
|
public class EiscApiAdvancedFactory : EssentialsDeviceFactory<EiscApiAdvanced>
|
||||||
|
|||||||
@@ -76,6 +76,14 @@ namespace PepperDash.Essentials.Core.Bridges
|
|||||||
public JoinDataComplete HdcpSupportCapability = new JoinDataComplete(new JoinData { JoinNumber = 1201, JoinSpan = 32 },
|
public JoinDataComplete HdcpSupportCapability = new JoinDataComplete(new JoinData { JoinNumber = 1201, JoinSpan = 32 },
|
||||||
new JoinMetadata { Description = "DM Chassis Input HDCP Support Capability", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Analog });
|
new JoinMetadata { Description = "DM Chassis Input HDCP Support Capability", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Analog });
|
||||||
|
|
||||||
|
[JoinName("InputStreamCardState")]
|
||||||
|
public JoinDataComplete InputStreamCardState = new JoinDataComplete(new JoinData { JoinNumber = 1501, JoinSpan = 32 },
|
||||||
|
new JoinMetadata { Description = "DM Chassis Stream Input Start (1), Stop (2), Pause (3) with Feedback", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Analog });
|
||||||
|
|
||||||
|
[JoinName("OutputStreamCardState")]
|
||||||
|
public JoinDataComplete OutputStreamCardState = new JoinDataComplete(new JoinData { JoinNumber = 1601, JoinSpan = 32 },
|
||||||
|
new JoinMetadata { Description = "DM Chassis Stream Output Start (1), Stop (2), Pause (3) with Feedback", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Analog });
|
||||||
|
|
||||||
[JoinName("InputNames")]
|
[JoinName("InputNames")]
|
||||||
public JoinDataComplete InputNames = new JoinDataComplete(new JoinData { JoinNumber = 101, JoinSpan = 32 },
|
public JoinDataComplete InputNames = new JoinDataComplete(new JoinData { JoinNumber = 101, JoinSpan = 32 },
|
||||||
new JoinMetadata { Description = "DM Chassis Input Name", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
|
new JoinMetadata { Description = "DM Chassis Input Name", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
|
||||||
|
|||||||
@@ -56,6 +56,11 @@ namespace PepperDash.Essentials.Core
|
|||||||
|
|
||||||
private void RegisterAndConfigureComPort()
|
private void RegisterAndConfigureComPort()
|
||||||
{
|
{
|
||||||
|
if (Port == null)
|
||||||
|
{
|
||||||
|
Debug.Console(0,this,Debug.ErrorLogLevel.Error, "Configured com Port for this device does not exist.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (Port.Parent is CrestronControlSystem)
|
if (Port.Parent is CrestronControlSystem)
|
||||||
{
|
{
|
||||||
var result = Port.Register();
|
var result = Port.Register();
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ namespace PepperDash.Essentials.Core
|
|||||||
var dev = GetIComPortsDeviceFromManagedDevice(config.ControlPortDevKey);
|
var dev = GetIComPortsDeviceFromManagedDevice(config.ControlPortDevKey);
|
||||||
if (dev != null && config.ControlPortNumber <= dev.NumberOfComPorts)
|
if (dev != null && config.ControlPortNumber <= dev.NumberOfComPorts)
|
||||||
return dev.ComPorts[config.ControlPortNumber];
|
return dev.ComPorts[config.ControlPortNumber];
|
||||||
Debug.Console(0, "GetComPort: Device '{0}' does not have com port {1}", config.ControlPortDevKey, config.ControlPortNumber);
|
Debug.Console(0,Debug.ErrorLogLevel.Notice, "GetComPort: Device '{0}' does not have com port {1}", config.ControlPortDevKey, config.ControlPortNumber);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ using Newtonsoft.Json;
|
|||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
|
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Core.Config
|
namespace PepperDash.Essentials.Core.Config
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -27,7 +29,7 @@ namespace PepperDash.Essentials.Core.Config
|
|||||||
public List<TieLineConfig> TieLines { get; set; }
|
public List<TieLineConfig> TieLines { get; set; }
|
||||||
|
|
||||||
[JsonProperty("joinMaps")]
|
[JsonProperty("joinMaps")]
|
||||||
public Dictionary<string, string> JoinMaps { get; set; }
|
public Dictionary<string, JObject> JoinMaps { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Checks SourceLists for a given list and returns it if found. Otherwise, returns null
|
/// Checks SourceLists for a given list and returns it if found. Otherwise, returns null
|
||||||
|
|||||||
@@ -73,21 +73,21 @@ namespace PepperDash.Essentials.Core.CrestronIO.Cards
|
|||||||
string cardType;
|
string cardType;
|
||||||
if (!_config.Cards.TryGetValue(i, out cardType))
|
if (!_config.Cards.TryGetValue(i, out cardType))
|
||||||
{
|
{
|
||||||
Debug.Console(1, this, "No card found for slot {0}", i);
|
Debug.Console(0, this, "No card found for slot {0}", i);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (String.IsNullOrEmpty(cardType))
|
if (String.IsNullOrEmpty(cardType))
|
||||||
{
|
{
|
||||||
Debug.Console(0, this, "No card specified for slot {0}", i);
|
Debug.Console(0, this, "No card specified for slot {0}", i);
|
||||||
return;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
Func<uint, C3CardControllerBase> cardBuilder;
|
Func<uint, C3CardControllerBase> cardBuilder;
|
||||||
if (!_cardDict.TryGetValue(cardType.ToLower(), out cardBuilder))
|
if (!_cardDict.TryGetValue(cardType.ToLower(), out cardBuilder))
|
||||||
{
|
{
|
||||||
Debug.Console(0, "Unable to find factory for 3-Series card type {0}.", cardType);
|
Debug.Console(0, "Unable to find factory for 3-Series card type {0}.", cardType);
|
||||||
return;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ namespace PepperDash.Essentials.Core.CrestronIO
|
|||||||
IOPortConfig config)
|
IOPortConfig config)
|
||||||
: base(key, name)
|
: base(key, name)
|
||||||
{
|
{
|
||||||
|
InputStateFeedback = new BoolFeedback(InputStateFeedbackFunc);
|
||||||
|
|
||||||
AddPostActivationAction(() =>
|
AddPostActivationAction(() =>
|
||||||
{
|
{
|
||||||
@@ -81,7 +82,7 @@ namespace PepperDash.Essentials.Core.CrestronIO
|
|||||||
}
|
}
|
||||||
if (ioPortDevice == null)
|
if (ioPortDevice == null)
|
||||||
{
|
{
|
||||||
Debug.Console(0, "GetDigitalInput: Device '0' is not a valid IRelayPorts Device", dc.PortDeviceKey);
|
Debug.Console(0, "GetDigitalInput: Device '0' is not a valid IDigitalInputPorts Device", dc.PortDeviceKey);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -144,7 +145,7 @@ namespace PepperDash.Essentials.Core.CrestronIO
|
|||||||
|
|
||||||
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||||
{
|
{
|
||||||
Debug.Console(1, "Factory Attempting to create new Generic Relay Device");
|
Debug.Console(1, "Factory Attempting to create new Generic Digital Input Device");
|
||||||
|
|
||||||
var props = JsonConvert.DeserializeObject<IOPortConfig>(dc.Properties.ToString());
|
var props = JsonConvert.DeserializeObject<IOPortConfig>(dc.Properties.ToString());
|
||||||
|
|
||||||
|
|||||||
@@ -4,15 +4,21 @@ 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 PepperDash.Core;
|
using PepperDash.Core;
|
||||||
|
using PepperDash.Essentials.Core.Config;
|
||||||
|
using PepperDash.Essentials.Core.Bridges;
|
||||||
|
|
||||||
|
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Core.CrestronIO
|
namespace PepperDash.Essentials.Core.CrestronIO
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents a generic digital input deviced tied to a versiport
|
/// Represents a generic digital input deviced tied to a versiport
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class GenericVersiportDigitalInputDevice : EssentialsDevice, IDigitalInput
|
public class GenericVersiportDigitalInputDevice : EssentialsBridgeableDevice, IDigitalInput
|
||||||
{
|
{
|
||||||
public Versiport InputPort { get; private set; }
|
public Versiport InputPort { get; private set; }
|
||||||
|
|
||||||
@@ -26,17 +32,29 @@ namespace PepperDash.Essentials.Core.CrestronIO
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public GenericVersiportDigitalInputDevice(string key, Versiport inputPort, IOPortConfig props):
|
public GenericVersiportDigitalInputDevice(string key, string name, Func<IOPortConfig, Versiport> postActivationFunc, IOPortConfig config) :
|
||||||
base(key)
|
base(key, name)
|
||||||
{
|
{
|
||||||
InputStateFeedback = new BoolFeedback(InputStateFeedbackFunc);
|
InputStateFeedback = new BoolFeedback(InputStateFeedbackFunc);
|
||||||
InputPort = inputPort;
|
|
||||||
InputPort.SetVersiportConfiguration(eVersiportConfiguration.DigitalInput);
|
|
||||||
if (props.DisablePullUpResistor)
|
|
||||||
InputPort.DisablePullUpResistor = true;
|
|
||||||
InputPort.VersiportChange += new VersiportEventHandler(InputPort_VersiportChange);
|
|
||||||
|
|
||||||
Debug.Console(1, this, "Created GenericVersiportDigitalInputDevice on port '{0}'. DisablePullUpResistor: '{1}'", props.PortNumber, InputPort.DisablePullUpResistor);
|
AddPostActivationAction(() =>
|
||||||
|
{
|
||||||
|
InputPort = postActivationFunc(config);
|
||||||
|
|
||||||
|
InputPort.Register();
|
||||||
|
|
||||||
|
InputPort.SetVersiportConfiguration(eVersiportConfiguration.DigitalInput);
|
||||||
|
if (config.DisablePullUpResistor)
|
||||||
|
InputPort.DisablePullUpResistor = true;
|
||||||
|
|
||||||
|
InputPort.VersiportChange += InputPort_VersiportChange;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Debug.Console(1, this, "Created GenericVersiportDigitalInputDevice on port '{0}'. DisablePullUpResistor: '{1}'", config.PortNumber, InputPort.DisablePullUpResistor);
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void InputPort_VersiportChange(Versiport port, VersiportEventArgs args)
|
void InputPort_VersiportChange(Versiport port, VersiportEventArgs args)
|
||||||
@@ -46,5 +64,105 @@ namespace PepperDash.Essentials.Core.CrestronIO
|
|||||||
if(args.Event == eVersiportEvent.DigitalInChange)
|
if(args.Event == eVersiportEvent.DigitalInChange)
|
||||||
InputStateFeedback.FireUpdate();
|
InputStateFeedback.FireUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#region Bridge Linking
|
||||||
|
|
||||||
|
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
||||||
|
{
|
||||||
|
var joinMap = new IDigitalInputJoinMap(joinStart);
|
||||||
|
|
||||||
|
var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(joinMapSerialized))
|
||||||
|
joinMap = JsonConvert.DeserializeObject<IDigitalInputJoinMap>(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.");
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Debug.Console(1, this, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
||||||
|
|
||||||
|
// Link feedback for input state
|
||||||
|
InputStateFeedback.LinkInputSig(trilist.BooleanInput[joinMap.InputState.JoinNumber]);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Debug.Console(1, this, "Unable to link device '{0}'. Input is null", Key);
|
||||||
|
Debug.Console(1, this, "Error: {0}", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
public static Versiport GetVersiportDigitalInput(IOPortConfig dc)
|
||||||
|
{
|
||||||
|
|
||||||
|
IIOPorts ioPortDevice;
|
||||||
|
|
||||||
|
if (dc.PortDeviceKey.Equals("processor"))
|
||||||
|
{
|
||||||
|
if (!Global.ControlSystem.SupportsVersiport)
|
||||||
|
{
|
||||||
|
Debug.Console(0, "GetVersiportDigitalInput: Processor does not support Versiports");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
ioPortDevice = Global.ControlSystem;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var ioPortDev = DeviceManager.GetDeviceForKey(dc.PortDeviceKey) as IIOPorts;
|
||||||
|
if (ioPortDev == null)
|
||||||
|
{
|
||||||
|
Debug.Console(0, "GetVersiportDigitalInput: Device {0} is not a valid device", dc.PortDeviceKey);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
ioPortDevice = ioPortDev;
|
||||||
|
}
|
||||||
|
if (ioPortDevice == null)
|
||||||
|
{
|
||||||
|
Debug.Console(0, "GetVersiportDigitalInput: Device '0' is not a valid IIOPorts Device", dc.PortDeviceKey);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (dc.PortNumber > ioPortDevice.NumberOfVersiPorts)
|
||||||
|
{
|
||||||
|
Debug.Console(0, "GetVersiportDigitalInput: Device {0} does not contain a port {1}", dc.PortDeviceKey, dc.PortNumber);
|
||||||
|
}
|
||||||
|
|
||||||
|
return ioPortDevice.VersiPorts[dc.PortNumber];
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public class GenericVersiportDigitalInputDeviceFactory : EssentialsDeviceFactory<GenericVersiportDigitalInputDevice>
|
||||||
|
{
|
||||||
|
public GenericVersiportDigitalInputDeviceFactory()
|
||||||
|
{
|
||||||
|
TypeNames = new List<string>() { "versiportinput" };
|
||||||
|
}
|
||||||
|
|
||||||
|
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||||
|
{
|
||||||
|
Debug.Console(1, "Factory Attempting to create new Generic Versiport Device");
|
||||||
|
|
||||||
|
var props = JsonConvert.DeserializeObject<IOPortConfig>(dc.Properties.ToString());
|
||||||
|
|
||||||
|
if (props == null) return null;
|
||||||
|
|
||||||
|
var portDevice = new GenericVersiportDigitalInputDevice(dc.Key, dc.Name, GenericVersiportDigitalInputDevice.GetVersiportDigitalInput, props);
|
||||||
|
|
||||||
|
return portDevice;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
namespace PepperDash.Essentials.Core.DeviceInfo
|
||||||
|
{
|
||||||
|
public class DeviceInfo
|
||||||
|
{
|
||||||
|
public string HostName { get; set; }
|
||||||
|
public string IpAddress { get; set; }
|
||||||
|
public string MacAddress { get; set; }
|
||||||
|
public string SerialNumber { get; set; }
|
||||||
|
public string FirmwareVersion { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
using System;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Core.DeviceInfo
|
||||||
|
{
|
||||||
|
public class DeviceInfoEventArgs:EventArgs
|
||||||
|
{
|
||||||
|
public DeviceInfo DeviceInfo { get; set; }
|
||||||
|
|
||||||
|
public DeviceInfoEventArgs()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public DeviceInfoEventArgs(DeviceInfo devInfo)
|
||||||
|
{
|
||||||
|
DeviceInfo = devInfo;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
using System;
|
||||||
|
using PepperDash.Core;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Core.DeviceInfo
|
||||||
|
{
|
||||||
|
public interface IDeviceInfoProvider:IKeyed
|
||||||
|
{
|
||||||
|
DeviceInfo DeviceInfo { get; }
|
||||||
|
|
||||||
|
event DeviceInfoChangeHandler DeviceInfoChanged;
|
||||||
|
|
||||||
|
void UpdateDeviceInfo();
|
||||||
|
}
|
||||||
|
|
||||||
|
public delegate void DeviceInfoChangeHandler(IKeyed device, DeviceInfoEventArgs args);
|
||||||
|
}
|
||||||
@@ -6,7 +6,7 @@ using PepperDash.Essentials.Core.SmartObjects;
|
|||||||
namespace PepperDash.Essentials.Core
|
namespace PepperDash.Essentials.Core
|
||||||
{
|
{
|
||||||
|
|
||||||
public interface IDiscPlayerControls : IColor, IDPad, INumericKeypad, IPower, ITransport, IUiDisplayInfo
|
public interface IDiscPlayerControls : IColor, IDPad, INumericKeypad, IHasPowerControl, ITransport, IUiDisplayInfo
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace PepperDash_Essentials_Core.DeviceTypeInterfaces
|
||||||
|
{
|
||||||
|
public interface ILanguageDefinition
|
||||||
|
{
|
||||||
|
string LocaleName { get; set; }
|
||||||
|
string FriendlyName { get; set; }
|
||||||
|
bool Enable { get; set; }
|
||||||
|
List<LanguageLabel> UiLabels { get; set; }
|
||||||
|
List<LanguageLabel> Sources { get; set; }
|
||||||
|
List<LanguageLabel> Destinations { get; set; }
|
||||||
|
List<LanguageLabel> SourceGroupNames { get; set; }
|
||||||
|
List<LanguageLabel> DestinationGroupNames { get; set; }
|
||||||
|
List<LanguageLabel> RoomNames { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace PepperDash_Essentials_Core.DeviceTypeInterfaces
|
||||||
|
{
|
||||||
|
public interface ILanguageProvider
|
||||||
|
{
|
||||||
|
ILanguageDefinition CurrentLanguage { get; set; }
|
||||||
|
|
||||||
|
event EventHandler CurrentLanguageChanged;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -8,11 +8,9 @@ namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IMobileControl : IKeyed
|
public interface IMobileControl : IKeyed
|
||||||
{
|
{
|
||||||
void CreateMobileControlRoomBridge(EssentialsRoomBase room);
|
void CreateMobileControlRoomBridge(EssentialsRoomBase room, IMobileControl parent);
|
||||||
|
|
||||||
void LinkSystemMonitorToAppServer();
|
void LinkSystemMonitorToAppServer();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -26,6 +24,8 @@ namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
|
|||||||
|
|
||||||
string QrCodeUrl { get; }
|
string QrCodeUrl { get; }
|
||||||
|
|
||||||
|
string QrCodeChecksum { get; }
|
||||||
|
|
||||||
string McServerUrl { get; }
|
string McServerUrl { get; }
|
||||||
|
|
||||||
string RoomName { get; }
|
string RoomName { get; }
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
using Crestron.SimplSharpPro.DeviceSupport;
|
using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
using PepperDash.Essentials.Core.SmartObjects;
|
using PepperDash.Essentials.Core.SmartObjects;
|
||||||
|
|
||||||
@@ -8,7 +8,7 @@ namespace PepperDash.Essentials.Core
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface INumericKeypad
|
public interface INumericKeypad:IKeyed
|
||||||
{
|
{
|
||||||
void Digit0(bool pressRelease);
|
void Digit0(bool pressRelease);
|
||||||
void Digit1(bool pressRelease);
|
void Digit1(bool pressRelease);
|
||||||
|
|||||||
@@ -14,8 +14,9 @@ using PepperDash.Essentials.Core.SmartObjects;
|
|||||||
namespace PepperDash.Essentials.Core
|
namespace PepperDash.Essentials.Core
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
/// Defines the ability to power a device on and off
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[Obsolete("Will be replaced by IHasPowerControlWithFeedback")]
|
||||||
public interface IPower
|
public interface IPower
|
||||||
{
|
{
|
||||||
void PowerOn();
|
void PowerOn();
|
||||||
@@ -24,25 +25,53 @@ namespace PepperDash.Essentials.Core
|
|||||||
BoolFeedback PowerIsOnFeedback { get; }
|
BoolFeedback PowerIsOnFeedback { get; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Adds feedback for current power state
|
||||||
|
/// </summary>
|
||||||
|
public interface IHasPowerControlWithFeedback : IHasPowerControl
|
||||||
|
{
|
||||||
|
BoolFeedback PowerIsOnFeedback { get; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Defines the ability to power a device on and off
|
||||||
|
/// </summary>
|
||||||
|
public interface IHasPowerControl
|
||||||
|
{
|
||||||
|
void PowerOn();
|
||||||
|
void PowerOff();
|
||||||
|
void PowerToggle();
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static class IPowerExtensions
|
public static class IHasPowerControlExtensions
|
||||||
{
|
{
|
||||||
public static void LinkButtons(this IPower dev, BasicTriList triList)
|
public static void LinkButtons(this IHasPowerControl dev, BasicTriList triList)
|
||||||
{
|
{
|
||||||
triList.SetSigFalseAction(101, dev.PowerOn);
|
triList.SetSigFalseAction(101, dev.PowerOn);
|
||||||
triList.SetSigFalseAction(102, dev.PowerOff);
|
triList.SetSigFalseAction(102, dev.PowerOff);
|
||||||
triList.SetSigFalseAction(103, dev.PowerToggle);
|
triList.SetSigFalseAction(103, dev.PowerToggle);
|
||||||
dev.PowerIsOnFeedback.LinkInputSig(triList.BooleanInput[101]);
|
|
||||||
|
var fbdev = dev as IHasPowerControlWithFeedback;
|
||||||
|
if (fbdev != null)
|
||||||
|
{
|
||||||
|
fbdev.PowerIsOnFeedback.LinkInputSig(triList.BooleanInput[101]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void UnlinkButtons(this IPower dev, BasicTriList triList)
|
public static void UnlinkButtons(this IHasPowerControl dev, BasicTriList triList)
|
||||||
{
|
{
|
||||||
triList.ClearBoolSigAction(101);
|
triList.ClearBoolSigAction(101);
|
||||||
triList.ClearBoolSigAction(102);
|
triList.ClearBoolSigAction(102);
|
||||||
triList.ClearBoolSigAction(103);
|
triList.ClearBoolSigAction(103);
|
||||||
dev.PowerIsOnFeedback.UnlinkInputSig(triList.BooleanInput[101]);
|
|
||||||
|
var fbdev = dev as IHasPowerControlWithFeedback;
|
||||||
|
if (fbdev != null)
|
||||||
|
{
|
||||||
|
fbdev.PowerIsOnFeedback.UnlinkInputSig(triList.BooleanInput[101]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
using PepperDash.Essentials.Core.Presets;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
|
||||||
|
{
|
||||||
|
public interface ITvPresetsProvider
|
||||||
|
{
|
||||||
|
DevicePresetsModel TvPresets { get; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
using PepperDash.Core;
|
||||||
|
|
||||||
|
namespace PepperDash_Essentials_Core.DeviceTypeInterfaces
|
||||||
|
{
|
||||||
|
public class LanguageLabel
|
||||||
|
{
|
||||||
|
public string Key { get; set; }
|
||||||
|
public string Description { get; set; }
|
||||||
|
public string DisplayText { get; set; }
|
||||||
|
public uint JoinNumber { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -13,6 +13,8 @@ namespace PepperDash.Essentials.Core
|
|||||||
{
|
{
|
||||||
public static class DeviceManager
|
public static class DeviceManager
|
||||||
{
|
{
|
||||||
|
public static event EventHandler<EventArgs> AllDevicesActivated;
|
||||||
|
|
||||||
private static readonly CCriticalSection DeviceCriticalSection = new CCriticalSection();
|
private static readonly CCriticalSection DeviceCriticalSection = new CCriticalSection();
|
||||||
private static readonly CEvent AllowAddDevicesCEvent = new CEvent(false, true);
|
private static readonly CEvent AllowAddDevicesCEvent = new CEvent(false, true);
|
||||||
//public static List<Device> Devices { get { return _Devices; } }
|
//public static List<Device> Devices { get { return _Devices; } }
|
||||||
@@ -98,6 +100,8 @@ namespace PepperDash.Essentials.Core
|
|||||||
Debug.Console(0, d, "ERROR: Device PostActivation failure:\r{0}", e);
|
Debug.Console(0, d, "ERROR: Device PostActivation failure:\r{0}", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
OnAllDevicesActivated();
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
@@ -105,6 +109,15 @@ namespace PepperDash.Essentials.Core
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void OnAllDevicesActivated()
|
||||||
|
{
|
||||||
|
var handler = AllDevicesActivated;
|
||||||
|
if (handler != null)
|
||||||
|
{
|
||||||
|
handler(null, new EventArgs());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Calls activate on all Device class items
|
/// Calls activate on all Device class items
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Core
|
||||||
|
{
|
||||||
|
public interface IHasDspPresets
|
||||||
|
{
|
||||||
|
List<IDspPreset> Presets { get; }
|
||||||
|
|
||||||
|
void RecallPreset(IDspPreset preset);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface IDspPreset
|
||||||
|
{
|
||||||
|
string Name { get; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -20,7 +20,10 @@ namespace PepperDash.Essentials.Core
|
|||||||
public IrOutputPortController IrPort { get; private set; }
|
public IrOutputPortController IrPort { get; private set; }
|
||||||
public ushort IrPulseTime { get; set; }
|
public ushort IrPulseTime { get; set; }
|
||||||
|
|
||||||
protected override Func<bool> PowerIsOnFeedbackFunc
|
[Obsolete("This property will be removed in version 2.0.0")]
|
||||||
|
public override BoolFeedback PowerIsOnFeedback { get; protected set; }
|
||||||
|
|
||||||
|
protected Func<bool> PowerIsOnFeedbackFunc
|
||||||
{
|
{
|
||||||
get { return () => _PowerIsOn; }
|
get { return () => _PowerIsOn; }
|
||||||
}
|
}
|
||||||
@@ -43,7 +46,10 @@ namespace PepperDash.Essentials.Core
|
|||||||
IrPort = new IrOutputPortController(key + "-ir", port, irDriverFilepath);
|
IrPort = new IrOutputPortController(key + "-ir", port, irDriverFilepath);
|
||||||
DeviceManager.AddDevice(IrPort);
|
DeviceManager.AddDevice(IrPort);
|
||||||
|
|
||||||
PowerIsOnFeedback.OutputChange += (o, a) => {
|
PowerIsOnFeedback = new BoolFeedback(PowerIsOnFeedbackFunc);
|
||||||
|
|
||||||
|
PowerIsOnFeedback.OutputChange += (o, a) =>
|
||||||
|
{
|
||||||
Debug.Console(2, this, "Power on={0}", _PowerIsOn);
|
Debug.Console(2, this, "Power on={0}", _PowerIsOn);
|
||||||
if (_PowerIsOn) StartWarmingTimer();
|
if (_PowerIsOn) StartWarmingTimer();
|
||||||
else StartCoolingTimer();
|
else StartCoolingTimer();
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ namespace PepperDash.Essentials.Core
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public abstract class DisplayBase : EssentialsDevice, IHasFeedback, IRoutingSinkWithSwitching, IPower, IWarmingCooling, IUsageTracking
|
public abstract class DisplayBase : EssentialsDevice, IHasFeedback, IRoutingSinkWithSwitching, IHasPowerControl, IWarmingCooling, IUsageTracking, IPower
|
||||||
{
|
{
|
||||||
public event SourceInfoChangeHandler CurrentSourceChange;
|
public event SourceInfoChangeHandler CurrentSourceChange;
|
||||||
|
|
||||||
@@ -46,10 +46,12 @@ namespace PepperDash.Essentials.Core
|
|||||||
}
|
}
|
||||||
SourceListItem _CurrentSourceInfo;
|
SourceListItem _CurrentSourceInfo;
|
||||||
|
|
||||||
public BoolFeedback PowerIsOnFeedback { get; protected set; }
|
|
||||||
public BoolFeedback IsCoolingDownFeedback { get; protected set; }
|
public BoolFeedback IsCoolingDownFeedback { get; protected set; }
|
||||||
public BoolFeedback IsWarmingUpFeedback { get; private set; }
|
public BoolFeedback IsWarmingUpFeedback { get; private set; }
|
||||||
|
|
||||||
|
[Obsolete("This property will be removed in version 2.0.0")]
|
||||||
|
public abstract BoolFeedback PowerIsOnFeedback { get; protected set; }
|
||||||
|
|
||||||
public UsageTracking UsageTracker { get; set; }
|
public UsageTracking UsageTracker { get; set; }
|
||||||
|
|
||||||
public uint WarmupTime { get; set; }
|
public uint WarmupTime { get; set; }
|
||||||
@@ -59,7 +61,6 @@ namespace PepperDash.Essentials.Core
|
|||||||
/// Bool Func that will provide a value for the PowerIsOn Output. Must be implemented
|
/// Bool Func that will provide a value for the PowerIsOn Output. Must be implemented
|
||||||
/// by concrete sub-classes
|
/// by concrete sub-classes
|
||||||
/// </summary>
|
/// </summary>
|
||||||
abstract protected Func<bool> PowerIsOnFeedbackFunc { get; }
|
|
||||||
abstract protected Func<bool> IsCoolingDownFeedbackFunc { get; }
|
abstract protected Func<bool> IsCoolingDownFeedbackFunc { get; }
|
||||||
abstract protected Func<bool> IsWarmingUpFeedbackFunc { get; }
|
abstract protected Func<bool> IsWarmingUpFeedbackFunc { get; }
|
||||||
|
|
||||||
@@ -76,24 +77,11 @@ namespace PepperDash.Essentials.Core
|
|||||||
protected DisplayBase(string key, string name)
|
protected DisplayBase(string key, string name)
|
||||||
: base(key, name)
|
: base(key, name)
|
||||||
{
|
{
|
||||||
PowerIsOnFeedback = new BoolFeedback("PowerOnFeedback", PowerIsOnFeedbackFunc);
|
|
||||||
IsCoolingDownFeedback = new BoolFeedback("IsCoolingDown", IsCoolingDownFeedbackFunc);
|
IsCoolingDownFeedback = new BoolFeedback("IsCoolingDown", IsCoolingDownFeedbackFunc);
|
||||||
IsWarmingUpFeedback = new BoolFeedback("IsWarmingUp", IsWarmingUpFeedbackFunc);
|
IsWarmingUpFeedback = new BoolFeedback("IsWarmingUp", IsWarmingUpFeedbackFunc);
|
||||||
|
|
||||||
InputPorts = new RoutingPortCollection<RoutingInputPort>();
|
InputPorts = new RoutingPortCollection<RoutingInputPort>();
|
||||||
|
|
||||||
PowerIsOnFeedback.OutputChange += PowerIsOnFeedback_OutputChange;
|
|
||||||
}
|
|
||||||
|
|
||||||
void PowerIsOnFeedback_OutputChange(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
if (UsageTracker != null)
|
|
||||||
{
|
|
||||||
if (PowerIsOnFeedback.BoolValue)
|
|
||||||
UsageTracker.StartDeviceUsage();
|
|
||||||
else
|
|
||||||
UsageTracker.EndDeviceUsage();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract void PowerOn();
|
public abstract void PowerOn();
|
||||||
@@ -106,7 +94,6 @@ namespace PepperDash.Essentials.Core
|
|||||||
{
|
{
|
||||||
return new FeedbackCollection<Feedback>
|
return new FeedbackCollection<Feedback>
|
||||||
{
|
{
|
||||||
PowerIsOnFeedback,
|
|
||||||
IsCoolingDownFeedback,
|
IsCoolingDownFeedback,
|
||||||
IsWarmingUpFeedback
|
IsWarmingUpFeedback
|
||||||
};
|
};
|
||||||
@@ -171,7 +158,10 @@ namespace PepperDash.Essentials.Core
|
|||||||
displayDevice.PowerOff();
|
displayDevice.PowerOff();
|
||||||
});
|
});
|
||||||
|
|
||||||
displayDevice.PowerIsOnFeedback.OutputChange += (o, a) =>
|
var twoWayDisplayDevice = displayDevice as TwoWayDisplayBase;
|
||||||
|
if (twoWayDisplayDevice != null)
|
||||||
|
{
|
||||||
|
twoWayDisplayDevice.PowerIsOnFeedback.OutputChange += (o, a) =>
|
||||||
{
|
{
|
||||||
if (!a.BoolValue)
|
if (!a.BoolValue)
|
||||||
{
|
{
|
||||||
@@ -186,7 +176,9 @@ namespace PepperDash.Essentials.Core
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
displayDevice.PowerIsOnFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.PowerOff.JoinNumber]);
|
twoWayDisplayDevice.PowerIsOnFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.PowerOff.JoinNumber]);
|
||||||
|
twoWayDisplayDevice.PowerIsOnFeedback.LinkInputSig(trilist.BooleanInput[joinMap.PowerOn.JoinNumber]);
|
||||||
|
}
|
||||||
|
|
||||||
// PowerOn
|
// PowerOn
|
||||||
trilist.SetSigTrueAction(joinMap.PowerOn.JoinNumber, () =>
|
trilist.SetSigTrueAction(joinMap.PowerOn.JoinNumber, () =>
|
||||||
@@ -197,7 +189,6 @@ namespace PepperDash.Essentials.Core
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
displayDevice.PowerIsOnFeedback.LinkInputSig(trilist.BooleanInput[joinMap.PowerOn.JoinNumber]);
|
|
||||||
|
|
||||||
for (int i = 0; i < displayDevice.InputPorts.Count; i++)
|
for (int i = 0; i < displayDevice.InputPorts.Count; i++)
|
||||||
{
|
{
|
||||||
@@ -259,17 +250,22 @@ namespace PepperDash.Essentials.Core
|
|||||||
volumeDisplayWithFeedback.MuteFeedback.LinkInputSig(trilist.BooleanInput[joinMap.VolumeMuteOn.JoinNumber]);
|
volumeDisplayWithFeedback.MuteFeedback.LinkInputSig(trilist.BooleanInput[joinMap.VolumeMuteOn.JoinNumber]);
|
||||||
volumeDisplayWithFeedback.MuteFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.VolumeMuteOff.JoinNumber]);
|
volumeDisplayWithFeedback.MuteFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.VolumeMuteOff.JoinNumber]);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public abstract class TwoWayDisplayBase : DisplayBase
|
public abstract class TwoWayDisplayBase : DisplayBase, IRoutingFeedback, IHasPowerControlWithFeedback
|
||||||
{
|
{
|
||||||
public StringFeedback CurrentInputFeedback { get; private set; }
|
public StringFeedback CurrentInputFeedback { get; private set; }
|
||||||
|
|
||||||
abstract protected Func<string> CurrentInputFeedbackFunc { get; }
|
abstract protected Func<string> CurrentInputFeedbackFunc { get; }
|
||||||
|
|
||||||
|
public override BoolFeedback PowerIsOnFeedback { get; protected set; }
|
||||||
|
|
||||||
|
abstract protected Func<bool> PowerIsOnFeedbackFunc { get; }
|
||||||
|
|
||||||
|
|
||||||
public static MockDisplay DefaultDisplay
|
public static MockDisplay DefaultDisplay
|
||||||
{
|
{
|
||||||
@@ -290,10 +286,36 @@ namespace PepperDash.Essentials.Core
|
|||||||
WarmupTime = 7000;
|
WarmupTime = 7000;
|
||||||
CooldownTime = 15000;
|
CooldownTime = 15000;
|
||||||
|
|
||||||
|
PowerIsOnFeedback = new BoolFeedback("PowerOnFeedback", PowerIsOnFeedbackFunc);
|
||||||
|
|
||||||
Feedbacks.Add(CurrentInputFeedback);
|
Feedbacks.Add(CurrentInputFeedback);
|
||||||
|
Feedbacks.Add(PowerIsOnFeedback);
|
||||||
|
|
||||||
|
PowerIsOnFeedback.OutputChange += PowerIsOnFeedback_OutputChange;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PowerIsOnFeedback_OutputChange(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (UsageTracker != null)
|
||||||
|
{
|
||||||
|
if (PowerIsOnFeedback.BoolValue)
|
||||||
|
UsageTracker.StartDeviceUsage();
|
||||||
|
else
|
||||||
|
UsageTracker.EndDeviceUsage();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public event EventHandler<RoutingNumericEventArgs> NumericSwitchChange;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Raise an event when the status of a switch object changes.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="e">Arguments defined as IKeyName sender, output, input, and eRoutingSignalType</param>
|
||||||
|
protected void OnSwitchChange(RoutingNumericEventArgs e)
|
||||||
|
{
|
||||||
|
var newEvent = NumericSwitchChange;
|
||||||
|
if (newEvent != null) newEvent(this, e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,150 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using Crestron.SimplSharp;
|
||||||
|
|
||||||
|
using PepperDash.Essentials.Core.Bridges;
|
||||||
|
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Core.Fusion
|
||||||
|
{
|
||||||
|
public class EssentialsHuddleSpaceRoomFusionRoomJoinMap : JoinMapBaseAdvanced
|
||||||
|
{
|
||||||
|
|
||||||
|
// Processor Attributes
|
||||||
|
[JoinName("ProcessorIp1")]
|
||||||
|
public JoinDataComplete ProcessorIp1 = new JoinDataComplete(new JoinData { JoinNumber = 50, JoinSpan = 1, AttributeName = "Info - Processor - IP 1" },
|
||||||
|
new JoinMetadata { Description = "Info - Processor - IP 1", JoinCapabilities = eJoinCapabilities.ToFusion, JoinType = eJoinType.Serial });
|
||||||
|
|
||||||
|
[JoinName("ProcessorIp2")]
|
||||||
|
public JoinDataComplete ProcessorIp2 = new JoinDataComplete(new JoinData { JoinNumber = 51, JoinSpan = 1, AttributeName = "Info - Processor - IP 2" },
|
||||||
|
new JoinMetadata { Description = "Info - Processor - IP 2", JoinCapabilities = eJoinCapabilities.ToFusion, JoinType = eJoinType.Serial });
|
||||||
|
|
||||||
|
[JoinName("ProcessorGateway")]
|
||||||
|
public JoinDataComplete ProcessorGateway = new JoinDataComplete(new JoinData { JoinNumber = 52, JoinSpan = 1, AttributeName = "Info - Processor - Gateway" },
|
||||||
|
new JoinMetadata { Description = "Info - Processor - Gateway", JoinCapabilities = eJoinCapabilities.ToFusion, JoinType = eJoinType.Serial });
|
||||||
|
|
||||||
|
[JoinName("ProcessorHostname")]
|
||||||
|
public JoinDataComplete ProcessorHostname = new JoinDataComplete(new JoinData { JoinNumber = 53, JoinSpan = 1, AttributeName = "Info - Processor - Hostname" },
|
||||||
|
new JoinMetadata { Description = "Info - Processor - Hostname", JoinCapabilities = eJoinCapabilities.ToFusion, JoinType = eJoinType.Serial });
|
||||||
|
|
||||||
|
[JoinName("ProcessorDomain")]
|
||||||
|
public JoinDataComplete ProcessorDomain = new JoinDataComplete(new JoinData { JoinNumber = 54, JoinSpan = 1, AttributeName = "Info - Processor - Domain" },
|
||||||
|
new JoinMetadata { Description = "Info - Processor - Domain", JoinCapabilities = eJoinCapabilities.ToFusion, JoinType = eJoinType.Serial });
|
||||||
|
|
||||||
|
[JoinName("ProcessorDns1")]
|
||||||
|
public JoinDataComplete ProcessorDns1 = new JoinDataComplete(new JoinData { JoinNumber = 55, JoinSpan = 1, AttributeName = "Info - Processor - DNS 1" },
|
||||||
|
new JoinMetadata { Description = "Info - Processor - DNS 1", JoinCapabilities = eJoinCapabilities.ToFusion, JoinType = eJoinType.Serial });
|
||||||
|
|
||||||
|
[JoinName("ProcessorDns2")]
|
||||||
|
public JoinDataComplete ProcessorDns2 = new JoinDataComplete(new JoinData { JoinNumber = 56, JoinSpan = 1, AttributeName = "Info - Processor - DNS 2" },
|
||||||
|
new JoinMetadata { Description = "Info - Processor - DNS 2", JoinCapabilities = eJoinCapabilities.ToFusion, JoinType = eJoinType.Serial });
|
||||||
|
|
||||||
|
[JoinName("ProcessorMac1")]
|
||||||
|
public JoinDataComplete ProcessorMac1 = new JoinDataComplete(new JoinData { JoinNumber = 57, JoinSpan = 1, AttributeName = "Info - Processor - MAC 1" },
|
||||||
|
new JoinMetadata { Description = "Info - Processor - MAC 1", JoinCapabilities = eJoinCapabilities.ToFusion, JoinType = eJoinType.Serial });
|
||||||
|
|
||||||
|
[JoinName("ProcessorMac2")]
|
||||||
|
public JoinDataComplete ProcessorMac2 = new JoinDataComplete(new JoinData { JoinNumber = 58, JoinSpan = 1, AttributeName = "Info - Processor - MAC 2" },
|
||||||
|
new JoinMetadata { Description = "Info - Processor - MAC 2", JoinCapabilities = eJoinCapabilities.ToFusion, JoinType = eJoinType.Serial });
|
||||||
|
|
||||||
|
[JoinName("ProcessorNetMask1")]
|
||||||
|
public JoinDataComplete ProcessorNetMask1 = new JoinDataComplete(new JoinData { JoinNumber = 59, JoinSpan = 1, AttributeName = "Info - Processor - Net Mask 1" },
|
||||||
|
new JoinMetadata { Description = "Info - Processor - Net Mask 1", JoinCapabilities = eJoinCapabilities.ToFusion, JoinType = eJoinType.Serial });
|
||||||
|
|
||||||
|
[JoinName("ProcessorNetMask2")]
|
||||||
|
public JoinDataComplete ProcessorNetMask2 = new JoinDataComplete(new JoinData { JoinNumber = 60, JoinSpan = 1, AttributeName = "Info - Processor - Net Mask 2" },
|
||||||
|
new JoinMetadata { Description = "Info - Processor - Net Mask 2", JoinCapabilities = eJoinCapabilities.ToFusion, JoinType = eJoinType.Serial });
|
||||||
|
|
||||||
|
[JoinName("ProcessorFirmware")]
|
||||||
|
public JoinDataComplete ProcessorFirmware = new JoinDataComplete(new JoinData { JoinNumber = 61, JoinSpan = 1, AttributeName = "Info - Processor - Firmware" },
|
||||||
|
new JoinMetadata { Description = "Info - Processor - Firmware", JoinCapabilities = eJoinCapabilities.ToFusion, JoinType = eJoinType.Serial });
|
||||||
|
|
||||||
|
[JoinName("ProgramNameStart")]
|
||||||
|
public JoinDataComplete ProgramNameStart = new JoinDataComplete(new JoinData { JoinNumber = 62, JoinSpan = 10, AttributeName = "Info - Processor - Program" },
|
||||||
|
new JoinMetadata { Description = "Info - Processor - Program", JoinCapabilities = eJoinCapabilities.ToFusion, JoinType = eJoinType.Serial });
|
||||||
|
|
||||||
|
[JoinName("ProcessorReboot")]
|
||||||
|
public JoinDataComplete ProcessorReboot = new JoinDataComplete(new JoinData { JoinNumber = 74, JoinSpan = 1, AttributeName = "Processor - Reboot" },
|
||||||
|
new JoinMetadata { Description = "Processor - Reboot", JoinCapabilities = eJoinCapabilities.FromFusion, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
// Volume Controls
|
||||||
|
[JoinName("VolumeFader1")]
|
||||||
|
public JoinDataComplete VolumeFader1 = new JoinDataComplete(new JoinData { JoinNumber = 50, JoinSpan = 1, AttributeName = "Volume - Fader01" },
|
||||||
|
new JoinMetadata { Description = "Volume - Fader01", JoinCapabilities = eJoinCapabilities.ToFromFusion, JoinType = eJoinType.Analog });
|
||||||
|
|
||||||
|
// Codec Info
|
||||||
|
[JoinName("VcCodecInCall")]
|
||||||
|
public JoinDataComplete VcCodecInCall = new JoinDataComplete(new JoinData { JoinNumber = 69, JoinSpan = 1, AttributeName = "Conf - VC 1 In Call" },
|
||||||
|
new JoinMetadata { Description = "Conf - VC 1 In Call", JoinCapabilities = eJoinCapabilities.ToFusion, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
[JoinName("VcCodecOnline")]
|
||||||
|
public JoinDataComplete VcCodecOnline = new JoinDataComplete(new JoinData { JoinNumber = 122, JoinSpan = 1, AttributeName = "Online - VC 1" },
|
||||||
|
new JoinMetadata { Description = "Online - VC 1", JoinCapabilities = eJoinCapabilities.ToFusion, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
[JoinName("VcCodecIpAddress")]
|
||||||
|
public JoinDataComplete VcCodecIpAddress = new JoinDataComplete(new JoinData { JoinNumber = 121, JoinSpan = 1, AttributeName = "IP Address - VC" },
|
||||||
|
new JoinMetadata { Description = "IP Address - VC", JoinCapabilities = eJoinCapabilities.ToFusion, JoinType = eJoinType.Serial });
|
||||||
|
|
||||||
|
[JoinName("VcCodecIpPort")]
|
||||||
|
public JoinDataComplete VcCodecIpPort = new JoinDataComplete(new JoinData { JoinNumber = 150, JoinSpan = 1, AttributeName = "IP Port - VC" },
|
||||||
|
new JoinMetadata { Description = "IP Port - VC", JoinCapabilities = eJoinCapabilities.ToFusion, JoinType = eJoinType.Serial });
|
||||||
|
|
||||||
|
// Source Attributes
|
||||||
|
[JoinName("Display1CurrentSourceName")]
|
||||||
|
public JoinDataComplete Display1CurrentSourceName = new JoinDataComplete(new JoinData { JoinNumber = 84, JoinSpan = 1, AttributeName = "Display 1 - Current Source" },
|
||||||
|
new JoinMetadata { Description = "Display 1 - Current Source", JoinCapabilities = eJoinCapabilities.ToFusion, JoinType = eJoinType.Serial });
|
||||||
|
|
||||||
|
|
||||||
|
// Device Online Status
|
||||||
|
[JoinName("TouchpanelOnlineStart")]
|
||||||
|
public JoinDataComplete TouchpanelOnlineStart = new JoinDataComplete(new JoinData { JoinNumber = 150, JoinSpan = 10, AttributeName = "Online - Touch Panel" },
|
||||||
|
new JoinMetadata { Description = "Online - Touch Panel", JoinCapabilities = eJoinCapabilities.ToFusion, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
[JoinName("XpanelOnlineStart")]
|
||||||
|
public JoinDataComplete XpanelOnlineStart = new JoinDataComplete(new JoinData { JoinNumber = 160, JoinSpan = 5, AttributeName = "Online - XPanel" },
|
||||||
|
new JoinMetadata { Description = "Online - XPanel", JoinCapabilities = eJoinCapabilities.ToFusion, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
[JoinName("DisplayOnlineStart")]
|
||||||
|
public JoinDataComplete DisplayOnlineStart = new JoinDataComplete(new JoinData { JoinNumber = 170, JoinSpan = 10, AttributeName = "Online - Display" },
|
||||||
|
new JoinMetadata { Description = "Online - Display", JoinCapabilities = eJoinCapabilities.ToFusion, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
[JoinName("Display1LaptopSourceStart")]
|
||||||
|
public JoinDataComplete Display1LaptopSourceStart = new JoinDataComplete(new JoinData { JoinNumber = 166, JoinSpan = 5, AttributeName = "Display 1 - Source Laptop" },
|
||||||
|
new JoinMetadata { Description = "Display 1 - Source Laptop", JoinCapabilities = eJoinCapabilities.ToFromFusion, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
[JoinName("Display1DiscPlayerSourceStart")]
|
||||||
|
public JoinDataComplete Display1DiscPlayerSourceStart = new JoinDataComplete(new JoinData { JoinNumber = 181, JoinSpan = 5, AttributeName = "Display 1 - Source Disc Player" },
|
||||||
|
new JoinMetadata { Description = "Display 1 - Source Disc Player", JoinCapabilities = eJoinCapabilities.ToFromFusion, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
[JoinName("Display1SetTopBoxSourceStart")]
|
||||||
|
public JoinDataComplete Display1SetTopBoxSourceStart = new JoinDataComplete(new JoinData { JoinNumber = 188, JoinSpan = 5, AttributeName = "Display 1 - Source TV" },
|
||||||
|
new JoinMetadata { Description = "Display 1 - Source TV", JoinCapabilities = eJoinCapabilities.ToFromFusion, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
// Display 1
|
||||||
|
[JoinName("Display1Start")]
|
||||||
|
public JoinDataComplete Display1Start = new JoinDataComplete(new JoinData { JoinNumber = 158, JoinSpan = 1 },
|
||||||
|
new JoinMetadata { Description = "Display 1 Start", JoinCapabilities = eJoinCapabilities.ToFromFusion, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Constructor to use when instantiating this Join Map without inheriting from it
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="joinStart">Join this join map will start at</param>
|
||||||
|
public EssentialsHuddleSpaceRoomFusionRoomJoinMap(uint joinStart)
|
||||||
|
: base(joinStart, typeof(EssentialsHuddleSpaceRoomFusionRoomJoinMap))
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <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>
|
||||||
|
public EssentialsHuddleSpaceRoomFusionRoomJoinMap(uint joinStart, Type type) : base(joinStart, type)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using Crestron.SimplSharp;
|
||||||
|
|
||||||
|
namespace PepperDash_Essentials_Core.Gateways
|
||||||
|
{
|
||||||
|
public class CenCn2Controller
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,11 +1,14 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
|
||||||
using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
|
using Crestron.SimplSharp.Reflection;
|
||||||
using Crestron.SimplSharp.Scheduler;
|
using Crestron.SimplSharp.Scheduler;
|
||||||
|
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
|
using PepperDash.Essentials.Core.Fusion;
|
||||||
|
using PepperDash.Essentials.Room.Config;
|
||||||
|
using Activator = System.Activator;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Core
|
namespace PepperDash.Essentials.Core
|
||||||
{
|
{
|
||||||
@@ -14,7 +17,7 @@ namespace PepperDash.Essentials.Core
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public static class Scheduler
|
public static class Scheduler
|
||||||
{
|
{
|
||||||
private static Dictionary<string, ScheduledEventGroup> EventGroups = new Dictionary<string,ScheduledEventGroup>();
|
private static readonly Dictionary<string, ScheduledEventGroup> EventGroups = new Dictionary<string,ScheduledEventGroup>();
|
||||||
|
|
||||||
static Scheduler()
|
static Scheduler()
|
||||||
{
|
{
|
||||||
@@ -49,7 +52,6 @@ namespace PepperDash.Essentials.Core
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Adds the event group to the global list
|
/// Adds the event group to the global list
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="name"></param>
|
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static void AddEventGroup(ScheduledEventGroup eventGroup)
|
public static void AddEventGroup(ScheduledEventGroup eventGroup)
|
||||||
{
|
{
|
||||||
@@ -67,6 +69,13 @@ namespace PepperDash.Essentials.Core
|
|||||||
if(!EventGroups.ContainsKey(eventGroup.Name))
|
if(!EventGroups.ContainsKey(eventGroup.Name))
|
||||||
EventGroups.Remove(eventGroup.Name);
|
EventGroups.Remove(eventGroup.Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static ScheduledEventGroup GetEventGroup(string key)
|
||||||
|
{
|
||||||
|
ScheduledEventGroup returnValue;
|
||||||
|
|
||||||
|
return EventGroups.TryGetValue(key, out returnValue) ? returnValue : null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class SchedulerUtilities
|
public static class SchedulerUtilities
|
||||||
@@ -135,5 +144,90 @@ namespace PepperDash.Essentials.Core
|
|||||||
|
|
||||||
return isMatch;
|
return isMatch;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static bool CheckEventTimeForMatch(ScheduledEvent evnt, DateTime time)
|
||||||
|
{
|
||||||
|
return evnt.DateAndTime.Hour == time.Hour && evnt.DateAndTime.Minute == time.Minute;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static bool CheckEventRecurrenceForMatch(ScheduledEvent evnt, ScheduledEventCommon.eWeekDays days)
|
||||||
|
{
|
||||||
|
return evnt.Recurrence.RecurrenceDays == days;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void CreateEventFromConfig(ScheduledEventConfig config, ScheduledEventGroup group, ScheduledEvent.UserEventCallBack handler)
|
||||||
|
{
|
||||||
|
if (group == null)
|
||||||
|
{
|
||||||
|
Debug.Console(0, "Unable to create event. Group is null");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var scheduledEvent = new ScheduledEvent(config.Key, group)
|
||||||
|
{
|
||||||
|
Acknowledgeable = config.Acknowledgeable,
|
||||||
|
Persistent = config.Persistent
|
||||||
|
};
|
||||||
|
|
||||||
|
scheduledEvent.UserCallBack += handler;
|
||||||
|
|
||||||
|
scheduledEvent.DateAndTime.SetFirstDayOfWeek(ScheduledEventCommon.eFirstDayOfWeek.Sunday);
|
||||||
|
|
||||||
|
var eventTime = DateTime.Parse(config.Time);
|
||||||
|
|
||||||
|
if (DateTime.Now > eventTime)
|
||||||
|
{
|
||||||
|
eventTime = eventTime.AddDays(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
Debug.Console(2, "[Scheduler] Current Date day of week: {0} recurrence days: {1}", eventTime.DayOfWeek,
|
||||||
|
config.Days);
|
||||||
|
|
||||||
|
var dayOfWeekConverted = ConvertDayOfWeek(eventTime);
|
||||||
|
|
||||||
|
Debug.Console(1, "[Scheduler] eventTime Day: {0}", dayOfWeekConverted);
|
||||||
|
|
||||||
|
while (!dayOfWeekConverted.IsFlagSet(config.Days))
|
||||||
|
{
|
||||||
|
eventTime = eventTime.AddDays(1);
|
||||||
|
|
||||||
|
dayOfWeekConverted = ConvertDayOfWeek(eventTime);
|
||||||
|
}
|
||||||
|
|
||||||
|
scheduledEvent.DateAndTime.SetAbsoluteEventTime(eventTime);
|
||||||
|
|
||||||
|
scheduledEvent.Recurrence.Weekly(config.Days);
|
||||||
|
|
||||||
|
if (config.Enable)
|
||||||
|
{
|
||||||
|
scheduledEvent.Enable();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
scheduledEvent.Disable();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static ScheduledEventCommon.eWeekDays ConvertDayOfWeek(DateTime eventTime)
|
||||||
|
{
|
||||||
|
return (ScheduledEventCommon.eWeekDays) Enum.Parse(typeof(ScheduledEventCommon.eWeekDays), eventTime.DayOfWeek.ToString(), true);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static bool IsFlagSet<T>(this T value, T flag) where T : struct
|
||||||
|
{
|
||||||
|
CheckIsEnum<T>(true);
|
||||||
|
|
||||||
|
var lValue = Convert.ToInt64(value);
|
||||||
|
var lFlag = Convert.ToInt64(flag);
|
||||||
|
|
||||||
|
return (lValue & lFlag) != 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void CheckIsEnum<T>(bool withFlags)
|
||||||
|
{
|
||||||
|
if (!typeof(T).IsEnum)
|
||||||
|
throw new ArgumentException(string.Format("Type '{0}' is not an enum", typeof(T).FullName));
|
||||||
|
if (withFlags && !Attribute.IsDefined(typeof(T), typeof(FlagsAttribute)))
|
||||||
|
throw new ArgumentException(string.Format("Type '{0}' doesn't have the 'Flags' attribute", typeof(T).FullName));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -25,7 +25,7 @@ namespace PepperDash.Essentials.Core
|
|||||||
|
|
||||||
var joinMap = ConfigReader.ConfigObject.JoinMaps[joinMapKey];
|
var joinMap = ConfigReader.ConfigObject.JoinMaps[joinMapKey];
|
||||||
|
|
||||||
return joinMap;
|
return joinMap.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -44,18 +44,35 @@ namespace PepperDash.Essentials.Core
|
|||||||
/// <param name="joinMapKey"></param>
|
/// <param name="joinMapKey"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static Dictionary<string, JoinData> TryGetJoinMapAdvancedForDevice(string joinMapKey)
|
public static Dictionary<string, JoinData> TryGetJoinMapAdvancedForDevice(string joinMapKey)
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(joinMapKey))
|
if (string.IsNullOrEmpty(joinMapKey))
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
var joinMapSerialzed = ConfigReader.ConfigObject.JoinMaps[joinMapKey];
|
if (!ConfigReader.ConfigObject.JoinMaps.ContainsKey(joinMapKey))
|
||||||
|
{
|
||||||
|
Debug.Console(2, "No Join Map found in config with key: '{0}'", joinMapKey);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
if (joinMapSerialzed == null) return null;
|
Debug.Console(2, "Attempting to load custom join map with key: {0}", joinMapKey);
|
||||||
|
|
||||||
var joinMapData = JsonConvert.DeserializeObject<Dictionary<string, JoinData>>(joinMapSerialzed);
|
var joinMapJToken = ConfigReader.ConfigObject.JoinMaps[joinMapKey];
|
||||||
|
|
||||||
|
if (joinMapJToken == null)
|
||||||
|
return null;
|
||||||
|
|
||||||
|
var joinMapData = joinMapJToken.ToObject<Dictionary<string, JoinData>>();
|
||||||
|
|
||||||
return joinMapData;
|
return joinMapData;
|
||||||
}
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Debug.Console(2, "Error getting join map for key: '{0}'. Error: {1}", joinMapKey, e);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -266,7 +283,7 @@ namespace PepperDash.Essentials.Core
|
|||||||
@"Join Number: {0} | JoinSpan: '{1}' | Description: '{2}' | Type: '{3}' | Capabilities: '{4}'",
|
@"Join Number: {0} | JoinSpan: '{1}' | Description: '{2}' | Type: '{3}' | Capabilities: '{4}'",
|
||||||
join.Value.JoinNumber,
|
join.Value.JoinNumber,
|
||||||
join.Value.JoinSpan,
|
join.Value.JoinSpan,
|
||||||
String.IsNullOrEmpty(join.Value.Metadata.Description) ? join.Value.Metadata.Label: join.Value.Metadata.Description,
|
String.IsNullOrEmpty(join.Value.AttributeName) ? join.Value.Metadata.Label : join.Value.AttributeName,
|
||||||
join.Value.Metadata.JoinType.ToString(),
|
join.Value.Metadata.JoinType.ToString(),
|
||||||
join.Value.Metadata.JoinCapabilities.ToString());
|
join.Value.Metadata.JoinCapabilities.ToString());
|
||||||
}
|
}
|
||||||
@@ -288,7 +305,7 @@ namespace PepperDash.Essentials.Core
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Debug.Console(2, "No mathcing key found in join map for: '{0}'", customJoinData.Key);
|
Debug.Console(2, "No matching key found in join map for: '{0}'", customJoinData.Key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -327,7 +344,10 @@ namespace PepperDash.Essentials.Core
|
|||||||
None = 0,
|
None = 0,
|
||||||
ToSIMPL = 1,
|
ToSIMPL = 1,
|
||||||
FromSIMPL = 2,
|
FromSIMPL = 2,
|
||||||
ToFromSIMPL = ToSIMPL | FromSIMPL
|
ToFromSIMPL = ToSIMPL | FromSIMPL,
|
||||||
|
ToFusion = 4,
|
||||||
|
FromFusion = 8,
|
||||||
|
ToFromFusion = ToFusion | FromFusion,
|
||||||
}
|
}
|
||||||
|
|
||||||
[Flags]
|
[Flags]
|
||||||
@@ -340,7 +360,7 @@ namespace PepperDash.Essentials.Core
|
|||||||
DigitalAnalog = Digital | Analog,
|
DigitalAnalog = Digital | Analog,
|
||||||
DigitalSerial = Digital | Serial,
|
DigitalSerial = Digital | Serial,
|
||||||
AnalogSerial = Analog | Serial,
|
AnalogSerial = Analog | Serial,
|
||||||
DigitalAnalogSerial = Digital | Analog | Serial
|
DigitalAnalogSerial = Digital | Analog | Serial,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -394,7 +414,7 @@ namespace PepperDash.Essentials.Core
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Data describing the join. Can be
|
/// Data describing the join. Can be overridden from configuratino
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class JoinData
|
public class JoinData
|
||||||
{
|
{
|
||||||
@@ -408,6 +428,11 @@ namespace PepperDash.Essentials.Core
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("joinSpan")]
|
[JsonProperty("joinSpan")]
|
||||||
public uint JoinSpan { get; set; }
|
public uint JoinSpan { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// Fusion Attribute Name (optional)
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("attributeName")]
|
||||||
|
public string AttributeName { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -419,6 +444,10 @@ namespace PepperDash.Essentials.Core
|
|||||||
|
|
||||||
private JoinData _data;
|
private JoinData _data;
|
||||||
public JoinMetadata Metadata { get; set; }
|
public JoinMetadata Metadata { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// To store some future information as you please
|
||||||
|
/// </summary>
|
||||||
|
public object UserObject { get; private set; }
|
||||||
|
|
||||||
public JoinDataComplete(JoinData data, JoinMetadata metadata)
|
public JoinDataComplete(JoinData data, JoinMetadata metadata)
|
||||||
{
|
{
|
||||||
@@ -449,6 +478,11 @@ namespace PepperDash.Essentials.Core
|
|||||||
get { return _data.JoinSpan; }
|
get { return _data.JoinSpan; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public string AttributeName
|
||||||
|
{
|
||||||
|
get { return _data.AttributeName; }
|
||||||
|
}
|
||||||
|
|
||||||
public void SetCustomJoinData(JoinData customJoinData)
|
public void SetCustomJoinData(JoinData customJoinData)
|
||||||
{
|
{
|
||||||
_data = customJoinData;
|
_data = customJoinData;
|
||||||
|
|||||||
@@ -88,8 +88,12 @@ namespace PepperDash.Essentials.Core.Privacy
|
|||||||
else
|
else
|
||||||
Debug.Console(0, this, "Unable to add Red LED device");
|
Debug.Console(0, this, "Unable to add Red LED device");
|
||||||
|
|
||||||
AddPostActivationAction(() => {
|
DeviceManager.AllDevicesActivated += (o, a) =>
|
||||||
|
{
|
||||||
CheckPrivacyMode();
|
CheckPrivacyMode();
|
||||||
|
};
|
||||||
|
|
||||||
|
AddPostActivationAction(() => {
|
||||||
PrivacyDevice.PrivacyModeIsOnFeedback.OutputChange -= PrivacyModeIsOnFeedback_OutputChange;
|
PrivacyDevice.PrivacyModeIsOnFeedback.OutputChange -= PrivacyModeIsOnFeedback_OutputChange;
|
||||||
PrivacyDevice.PrivacyModeIsOnFeedback.OutputChange += PrivacyModeIsOnFeedback_OutputChange;
|
PrivacyDevice.PrivacyModeIsOnFeedback.OutputChange += PrivacyModeIsOnFeedback_OutputChange;
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -505,17 +505,23 @@ namespace PepperDash.Essentials.Core.Monitoring
|
|||||||
ProgramInfo.RegistrationState = Program.RegistrationState;
|
ProgramInfo.RegistrationState = Program.RegistrationState;
|
||||||
|
|
||||||
ProgramStartedFeedback = new BoolFeedback(() => Program.OperatingState == eProgramOperatingState.Start);
|
ProgramStartedFeedback = new BoolFeedback(() => Program.OperatingState == eProgramOperatingState.Start);
|
||||||
|
ProgramStartedFeedback.FireUpdate();
|
||||||
|
|
||||||
ProgramStoppedFeedback = new BoolFeedback(() => Program.OperatingState == eProgramOperatingState.Stop);
|
ProgramStoppedFeedback = new BoolFeedback(() => Program.OperatingState == eProgramOperatingState.Stop);
|
||||||
|
ProgramStoppedFeedback.FireUpdate();
|
||||||
|
|
||||||
ProgramRegisteredFeedback =
|
ProgramRegisteredFeedback =
|
||||||
new BoolFeedback(() => Program.RegistrationState == eProgramRegistrationState.Register);
|
new BoolFeedback(() => Program.RegistrationState == eProgramRegistrationState.Register);
|
||||||
|
ProgramRegisteredFeedback.FireUpdate();
|
||||||
|
|
||||||
ProgramUnregisteredFeedback =
|
ProgramUnregisteredFeedback =
|
||||||
new BoolFeedback(() => Program.RegistrationState == eProgramRegistrationState.Unregister);
|
new BoolFeedback(() => Program.RegistrationState == eProgramRegistrationState.Unregister);
|
||||||
|
ProgramUnregisteredFeedback.FireUpdate();
|
||||||
|
|
||||||
ProgramNameFeedback = new StringFeedback(() => ProgramInfo.ProgramFile);
|
ProgramNameFeedback = new StringFeedback(() => ProgramInfo.ProgramFile);
|
||||||
ProgramCompileTimeFeedback = new StringFeedback(() => ProgramInfo.CompileTime);
|
ProgramCompileTimeFeedback = new StringFeedback(() => ProgramInfo.CompileTime);
|
||||||
CrestronDataBaseVersionFeedback = new StringFeedback(() => ProgramInfo.CrestronDb);
|
CrestronDataBaseVersionFeedback = new StringFeedback(() => ProgramInfo.CrestronDb);
|
||||||
EnvironmentVersionFeedback = new StringFeedback(() => ProgramInfo.Environment);
|
EnvironmentVersionFeedback = new StringFeedback(() => ProgramInfo.Environment);
|
||||||
|
|
||||||
AggregatedProgramInfoFeedback = new StringFeedback(() => JsonConvert.SerializeObject(ProgramInfo));
|
AggregatedProgramInfoFeedback = new StringFeedback(() => JsonConvert.SerializeObject(ProgramInfo));
|
||||||
|
|
||||||
GetProgramInfo();
|
GetProgramInfo();
|
||||||
|
|||||||
@@ -83,7 +83,7 @@
|
|||||||
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.UI.dll</HintPath>
|
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.UI.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="mscorlib" />
|
<Reference Include="mscorlib" />
|
||||||
<Reference Include="PepperDash_Core, Version=1.0.41.31808, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="PepperDash_Core, Version=1.0.42.30563, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<SpecificVersion>False</SpecificVersion>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
<HintPath>..\..\..\packages\PepperDashCore\lib\net35\PepperDash_Core.dll</HintPath>
|
<HintPath>..\..\..\packages\PepperDashCore\lib\net35\PepperDash_Core.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
@@ -183,6 +183,9 @@
|
|||||||
<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="Device Info\DeviceInfo.cs" />
|
||||||
|
<Compile Include="Device Info\DeviceInfoEventArgs.cs" />
|
||||||
|
<Compile Include="Device Info\IDeviceInfoProvider.cs" />
|
||||||
<Compile Include="Devices\CodecInterfaces.cs" />
|
<Compile Include="Devices\CodecInterfaces.cs" />
|
||||||
<Compile Include="Devices\CrestronProcessor.cs" />
|
<Compile Include="Devices\CrestronProcessor.cs" />
|
||||||
<Compile Include="Devices\DeviceApiBase.cs" />
|
<Compile Include="Devices\DeviceApiBase.cs" />
|
||||||
@@ -190,12 +193,17 @@
|
|||||||
<Compile Include="Devices\EssentialsBridgeableDevice.cs" />
|
<Compile Include="Devices\EssentialsBridgeableDevice.cs" />
|
||||||
<Compile Include="Devices\EssentialsDevice.cs" />
|
<Compile Include="Devices\EssentialsDevice.cs" />
|
||||||
<Compile Include="Devices\GenericIRController.cs" />
|
<Compile Include="Devices\GenericIRController.cs" />
|
||||||
|
<Compile Include="Devices\IDspPreset.cs" />
|
||||||
<Compile Include="Devices\IProjectorInterfaces.cs" />
|
<Compile Include="Devices\IProjectorInterfaces.cs" />
|
||||||
<Compile Include="Devices\PC\InRoomPc.cs" />
|
<Compile Include="Devices\PC\InRoomPc.cs" />
|
||||||
<Compile Include="Devices\PC\Laptop.cs" />
|
<Compile Include="Devices\PC\Laptop.cs" />
|
||||||
<Compile Include="Devices\ReconfigurableDevice.cs" />
|
<Compile Include="Devices\ReconfigurableDevice.cs" />
|
||||||
<Compile Include="Devices\VolumeDeviceChangeEventArgs.cs" />
|
<Compile Include="Devices\VolumeDeviceChangeEventArgs.cs" />
|
||||||
|
<Compile Include="DeviceTypeInterfaces\ITvPresetsProvider.cs" />
|
||||||
|
<Compile Include="DeviceTypeInterfaces\LanguageLabel.cs" />
|
||||||
|
<Compile Include="DeviceTypeInterfaces\ILanguageProvider.cs" />
|
||||||
<Compile Include="DeviceTypeInterfaces\IHasBranding.cs" />
|
<Compile Include="DeviceTypeInterfaces\IHasBranding.cs" />
|
||||||
|
<Compile Include="DeviceTypeInterfaces\ILanguageDefinition.cs" />
|
||||||
<Compile Include="DeviceTypeInterfaces\IHasFarEndContentStatus.cs" />
|
<Compile Include="DeviceTypeInterfaces\IHasFarEndContentStatus.cs" />
|
||||||
<Compile Include="DeviceTypeInterfaces\IHasPhoneDialing.cs" />
|
<Compile Include="DeviceTypeInterfaces\IHasPhoneDialing.cs" />
|
||||||
<Compile Include="DeviceTypeInterfaces\IMobileControl.cs" />
|
<Compile Include="DeviceTypeInterfaces\IMobileControl.cs" />
|
||||||
@@ -212,6 +220,7 @@
|
|||||||
<Compile Include="Fusion\FusionCustomPropertiesBridge.cs" />
|
<Compile Include="Fusion\FusionCustomPropertiesBridge.cs" />
|
||||||
<Compile Include="Fusion\FusionEventHandlers.cs" />
|
<Compile Include="Fusion\FusionEventHandlers.cs" />
|
||||||
<Compile Include="Fusion\FusionProcessorQueries.cs" />
|
<Compile Include="Fusion\FusionProcessorQueries.cs" />
|
||||||
|
<Compile Include="Fusion\EssentialsHuddleSpaceRoomFusionRoomJoinMap.cs" />
|
||||||
<Compile Include="Fusion\FusionRviDataClasses.cs" />
|
<Compile Include="Fusion\FusionRviDataClasses.cs" />
|
||||||
<Compile Include="Gateways\CenRfgwController.cs" />
|
<Compile Include="Gateways\CenRfgwController.cs" />
|
||||||
<Compile Include="Gateways\EssentialsRfGatewayConfig.cs" />
|
<Compile Include="Gateways\EssentialsRfGatewayConfig.cs" />
|
||||||
@@ -271,6 +280,7 @@
|
|||||||
<Compile Include="Remotes\Hrxx0WirelessRemoteController.cs" />
|
<Compile Include="Remotes\Hrxx0WirelessRemoteController.cs" />
|
||||||
<Compile Include="Room\Behaviours\RoomOnToDefaultSourceWhenOccupied.cs" />
|
<Compile Include="Room\Behaviours\RoomOnToDefaultSourceWhenOccupied.cs" />
|
||||||
<Compile Include="Room\EssentialsRoomBase.cs" />
|
<Compile Include="Room\EssentialsRoomBase.cs" />
|
||||||
|
<Compile Include="Room\Config\EssentialsRoomScheduledEventsConfig.cs" />
|
||||||
<Compile Include="Room\Interfaces.cs" />
|
<Compile Include="Room\Interfaces.cs" />
|
||||||
<Compile Include="Room\iOccupancyStatusProvider.cs" />
|
<Compile Include="Room\iOccupancyStatusProvider.cs" />
|
||||||
<Compile Include="Routing\DummyRoutingInputsDevice.cs" />
|
<Compile Include="Routing\DummyRoutingInputsDevice.cs" />
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
<tags>crestron 3series 4series</tags>
|
<tags>crestron 3series 4series</tags>
|
||||||
<repository type="git" url="https://github.com/PepperDash/Essentials"/>
|
<repository type="git" url="https://github.com/PepperDash/Essentials"/>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency id="PepperDashCore" version="[1.0, 1.1)"/>
|
<dependency id="PepperDashCore" version="[1.0.45, 1.1.0)"/>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</metadata>
|
</metadata>
|
||||||
<files>
|
<files>
|
||||||
|
|||||||
@@ -402,13 +402,16 @@ namespace PepperDash.Essentials
|
|||||||
/// Loads a
|
/// Loads a
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="plugin"></param>
|
/// <param name="plugin"></param>
|
||||||
|
/// <param name="loadedAssembly"></param>
|
||||||
static void LoadCustomPlugin(IPluginDeviceFactory plugin, LoadedAssembly loadedAssembly)
|
static void LoadCustomPlugin(IPluginDeviceFactory plugin, LoadedAssembly loadedAssembly)
|
||||||
{
|
{
|
||||||
var passed = Global.IsRunningMinimumVersionOrHigher(plugin.MinimumEssentialsFrameworkVersion);
|
var passed = Global.IsRunningMinimumVersionOrHigher(plugin.MinimumEssentialsFrameworkVersion);
|
||||||
|
|
||||||
if (!passed)
|
if (!passed)
|
||||||
{
|
{
|
||||||
Debug.Console(0, Debug.ErrorLogLevel.Error, "Plugin indicates minimum Essentials version {0}. Dependency check failed. Skipping Plugin", plugin.MinimumEssentialsFrameworkVersion);
|
Debug.Console(0, Debug.ErrorLogLevel.Error,
|
||||||
|
"\r\n********************\r\n\tPlugin indicates minimum Essentials version {0}. Dependency check failed. Skipping Plugin {1}\r\n********************",
|
||||||
|
plugin.MinimumEssentialsFrameworkVersion, loadedAssembly.Name);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -1,16 +1,13 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
using Crestron.SimplSharp.CrestronIO;
|
using Crestron.SimplSharp.CrestronIO;
|
||||||
|
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Newtonsoft.Json.Linq;
|
|
||||||
|
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
|
|
||||||
//using SSMono.IO;
|
//using SSMono.IO;
|
||||||
|
using PepperDash.Core.WebApi.Presets;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Core.Presets
|
namespace PepperDash.Essentials.Core.Presets
|
||||||
{
|
{
|
||||||
@@ -19,43 +16,34 @@ namespace PepperDash.Essentials.Core.Presets
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public class DevicePresetsModel : Device
|
public class DevicePresetsModel : Device
|
||||||
{
|
{
|
||||||
public event EventHandler PresetsLoaded;
|
public delegate void PresetRecalledCallback(ISetTopBoxNumericKeypad device, string channel);
|
||||||
|
|
||||||
public int PulseTime { get; set; }
|
public delegate void PresetsSavedCallback(List<PresetChannel> presets);
|
||||||
public int DigitSpacingMS { get; set; }
|
|
||||||
public bool PresetsAreLoaded { get; private set; }
|
|
||||||
|
|
||||||
public List<PresetChannel> PresetsList { get { return _PresetsList.ToList(); } }
|
private readonly CCriticalSection _fileOps = new CCriticalSection();
|
||||||
List<PresetChannel> _PresetsList;
|
private readonly bool _initSuccess;
|
||||||
public int Count { get { return PresetsList != null ? PresetsList.Count : 0; } }
|
|
||||||
|
|
||||||
public bool UseLocalImageStorage { get; set; }
|
private readonly ISetTopBoxNumericKeypad _setTopBox;
|
||||||
public string ImagesLocalHostPrefix { get; set; }
|
|
||||||
public string ImagesPathPrefix { get; set; }
|
|
||||||
public string ListPathPrefix { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The methods on the STB device to call when dialing
|
/// The methods on the STB device to call when dialing
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Dictionary<char, Action<bool>> DialFunctions;
|
private Dictionary<char, Action<bool>> _dialFunctions;
|
||||||
Action<bool> EnterFunction;
|
|
||||||
|
|
||||||
bool DialIsRunning;
|
private bool _dialIsRunning;
|
||||||
string FilePath;
|
private Action<bool> _enterFunction;
|
||||||
bool InitSuccess;
|
private string _filePath;
|
||||||
//SSMono.IO.FileSystemWatcher ListWatcher;
|
|
||||||
|
|
||||||
public DevicePresetsModel(string key, ISetTopBoxNumericKeypad setTopBox, string fileName)
|
public DevicePresetsModel(string key, ISetTopBoxNumericKeypad setTopBox, string fileName)
|
||||||
: base(key)
|
: this(key, fileName)
|
||||||
{
|
{
|
||||||
PulseTime = 150;
|
|
||||||
DigitSpacingMS = 150;
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
_setTopBox = setTopBox;
|
||||||
|
|
||||||
// Grab the digit functions from the device
|
// Grab the digit functions from the device
|
||||||
// If any fail, the whole thing fails peacefully
|
// If any fail, the whole thing fails peacefully
|
||||||
DialFunctions = new Dictionary<char, Action<bool>>(10)
|
_dialFunctions = new Dictionary<char, Action<bool>>(10)
|
||||||
{
|
{
|
||||||
{'1', setTopBox.Digit1},
|
{'1', setTopBox.Digit1},
|
||||||
{'2', setTopBox.Digit2},
|
{'2', setTopBox.Digit2},
|
||||||
@@ -73,11 +61,17 @@ namespace PepperDash.Essentials.Core.Presets
|
|||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
Debug.Console(0, "DevicePresets '{0}', not attached to INumericKeypad device. Ignoring", key);
|
Debug.Console(0, "DevicePresets '{0}', not attached to INumericKeypad device. Ignoring", key);
|
||||||
DialFunctions = null;
|
_dialFunctions = null;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
EnterFunction = setTopBox.KeypadEnter;
|
_enterFunction = setTopBox.KeypadEnter;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DevicePresetsModel(string key, string fileName) : base(key)
|
||||||
|
{
|
||||||
|
PulseTime = 150;
|
||||||
|
DigitSpacingMs = 150;
|
||||||
|
|
||||||
UseLocalImageStorage = true;
|
UseLocalImageStorage = true;
|
||||||
|
|
||||||
@@ -88,91 +82,219 @@ namespace PepperDash.Essentials.Core.Presets
|
|||||||
|
|
||||||
SetFileName(fileName);
|
SetFileName(fileName);
|
||||||
|
|
||||||
//ListWatcher = new FileSystemWatcher(@"\HTML\presets\lists");
|
_initSuccess = true;
|
||||||
//ListWatcher.NotifyFilter = NotifyFilters.LastWrite;
|
|
||||||
//ListWatcher.EnableRaisingEvents = true;
|
|
||||||
//ListWatcher.Changed += ListWatcher_Changed;
|
|
||||||
InitSuccess = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public event PresetRecalledCallback PresetRecalled;
|
||||||
|
public event PresetsSavedCallback PresetsSaved;
|
||||||
|
|
||||||
|
public int PulseTime { get; set; }
|
||||||
|
public int DigitSpacingMs { get; set; }
|
||||||
|
public bool PresetsAreLoaded { get; private set; }
|
||||||
|
|
||||||
|
public List<PresetChannel> PresetsList { get; private set; }
|
||||||
|
|
||||||
|
public int Count
|
||||||
|
{
|
||||||
|
get { return PresetsList != null ? PresetsList.Count : 0; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool UseLocalImageStorage { get; set; }
|
||||||
|
public string ImagesLocalHostPrefix { get; set; }
|
||||||
|
public string ImagesPathPrefix { get; set; }
|
||||||
|
public string ListPathPrefix { get; set; }
|
||||||
|
public event EventHandler PresetsLoaded;
|
||||||
|
|
||||||
|
|
||||||
public void SetFileName(string path)
|
public void SetFileName(string path)
|
||||||
{
|
{
|
||||||
FilePath = ListPathPrefix + path;
|
_filePath = ListPathPrefix + path;
|
||||||
|
|
||||||
|
Debug.Console(2, this, "Setting presets file path to {0}", _filePath);
|
||||||
LoadChannels();
|
LoadChannels();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void LoadChannels()
|
public void LoadChannels()
|
||||||
{
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
_fileOps.Enter();
|
||||||
|
|
||||||
|
Debug.Console(2, this, "Loading presets from {0}", _filePath);
|
||||||
PresetsAreLoaded = false;
|
PresetsAreLoaded = false;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var pl = JsonConvert.DeserializeObject<PresetsList>(Crestron.SimplSharp.CrestronIO.File.ReadToEnd(FilePath, Encoding.ASCII));
|
var pl = JsonConvert.DeserializeObject<PresetsList>(File.ReadToEnd(_filePath, Encoding.ASCII));
|
||||||
Name = pl.Name;
|
Name = pl.Name;
|
||||||
_PresetsList = pl.Channels;
|
PresetsList = pl.Channels;
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
Debug.Console(2, this, "LoadChannels: Error reading presets file. These presets will be empty:\r '{0}'\r Error:{1}", FilePath, e.Message);
|
Debug.Console(2, this,
|
||||||
|
"LoadChannels: Error reading presets file. These presets will be empty:\r '{0}'\r Error:{1}",
|
||||||
|
_filePath, e.Message);
|
||||||
// Just save a default empty list
|
// Just save a default empty list
|
||||||
_PresetsList = new List<PresetChannel>();
|
PresetsList = new List<PresetChannel>();
|
||||||
}
|
}
|
||||||
PresetsAreLoaded = true;
|
PresetsAreLoaded = true;
|
||||||
|
|
||||||
var handler = PresetsLoaded;
|
var handler = PresetsLoaded;
|
||||||
if (handler != null)
|
if (handler != null)
|
||||||
|
{
|
||||||
handler(this, EventArgs.Empty);
|
handler(this, EventArgs.Empty);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
_fileOps.Leave();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void Dial(int presetNum)
|
public void Dial(int presetNum)
|
||||||
{
|
{
|
||||||
if (presetNum <= _PresetsList.Count)
|
if (presetNum <= PresetsList.Count)
|
||||||
Dial(_PresetsList[presetNum - 1].Channel);
|
{
|
||||||
|
Dial(PresetsList[presetNum - 1].Channel);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Dial(string chanNum)
|
public void Dial(string chanNum)
|
||||||
{
|
{
|
||||||
if (DialIsRunning || !InitSuccess) return;
|
if (_dialIsRunning || !_initSuccess)
|
||||||
if (DialFunctions == null)
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (_dialFunctions == null)
|
||||||
{
|
{
|
||||||
Debug.Console(1, "DevicePresets '{0}', not attached to keypad device. Ignoring channel", Key);
|
Debug.Console(1, "DevicePresets '{0}', not attached to keypad device. Ignoring channel", Key);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
DialIsRunning = true;
|
_dialIsRunning = true;
|
||||||
CrestronInvoke.BeginInvoke(o =>
|
CrestronInvoke.BeginInvoke(o =>
|
||||||
{
|
{
|
||||||
foreach (var c in chanNum.ToCharArray())
|
foreach (var c in chanNum.ToCharArray())
|
||||||
{
|
{
|
||||||
if (DialFunctions.ContainsKey(c))
|
if (_dialFunctions.ContainsKey(c))
|
||||||
Pulse(DialFunctions[c]);
|
{
|
||||||
CrestronEnvironment.Sleep(DigitSpacingMS);
|
Pulse(_dialFunctions[c]);
|
||||||
|
}
|
||||||
|
CrestronEnvironment.Sleep(DigitSpacingMs);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (EnterFunction != null)
|
if (_enterFunction != null)
|
||||||
Pulse(EnterFunction);
|
{
|
||||||
DialIsRunning = false;
|
Pulse(_enterFunction);
|
||||||
|
}
|
||||||
|
_dialIsRunning = false;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (_setTopBox == null) return;
|
||||||
|
|
||||||
|
OnPresetRecalled(_setTopBox, chanNum);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Pulse(Action<bool> act)
|
public void Dial(int presetNum, ISetTopBoxNumericKeypad setTopBox)
|
||||||
|
{
|
||||||
|
if (presetNum <= PresetsList.Count)
|
||||||
|
{
|
||||||
|
Dial(PresetsList[presetNum - 1].Channel, setTopBox);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Dial(string chanNum, ISetTopBoxNumericKeypad setTopBox)
|
||||||
|
{
|
||||||
|
_dialFunctions = new Dictionary<char, Action<bool>>(10)
|
||||||
|
{
|
||||||
|
{'1', setTopBox.Digit1},
|
||||||
|
{'2', setTopBox.Digit2},
|
||||||
|
{'3', setTopBox.Digit3},
|
||||||
|
{'4', setTopBox.Digit4},
|
||||||
|
{'5', setTopBox.Digit5},
|
||||||
|
{'6', setTopBox.Digit6},
|
||||||
|
{'7', setTopBox.Digit7},
|
||||||
|
{'8', setTopBox.Digit8},
|
||||||
|
{'9', setTopBox.Digit9},
|
||||||
|
{'0', setTopBox.Digit0},
|
||||||
|
{'-', setTopBox.Dash}
|
||||||
|
};
|
||||||
|
|
||||||
|
_enterFunction = setTopBox.KeypadEnter;
|
||||||
|
|
||||||
|
OnPresetRecalled(setTopBox, chanNum);
|
||||||
|
|
||||||
|
Dial(chanNum);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnPresetRecalled(ISetTopBoxNumericKeypad setTopBox, string channel)
|
||||||
|
{
|
||||||
|
var handler = PresetRecalled;
|
||||||
|
|
||||||
|
if (handler == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
handler(setTopBox, channel);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UpdatePreset(int index, PresetChannel preset)
|
||||||
|
{
|
||||||
|
if (index >= PresetsList.Count)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
PresetsList[index] = preset;
|
||||||
|
|
||||||
|
SavePresets();
|
||||||
|
|
||||||
|
OnPresetsSaved();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UpdatePresets(List<PresetChannel> presets)
|
||||||
|
{
|
||||||
|
PresetsList = presets;
|
||||||
|
|
||||||
|
SavePresets();
|
||||||
|
|
||||||
|
OnPresetsSaved();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SavePresets()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
_fileOps.Enter();
|
||||||
|
var pl = new PresetsList {Channels = PresetsList, Name = Name};
|
||||||
|
var json = JsonConvert.SerializeObject(pl, Formatting.Indented);
|
||||||
|
|
||||||
|
using (var file = File.Open(_filePath, FileMode.Truncate))
|
||||||
|
{
|
||||||
|
file.Write(json, Encoding.UTF8);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
_fileOps.Leave();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnPresetsSaved()
|
||||||
|
{
|
||||||
|
var handler = PresetsSaved;
|
||||||
|
|
||||||
|
if (handler == null) return;
|
||||||
|
|
||||||
|
handler(PresetsList);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Pulse(Action<bool> act)
|
||||||
{
|
{
|
||||||
act(true);
|
act(true);
|
||||||
CrestronEnvironment.Sleep(PulseTime);
|
CrestronEnvironment.Sleep(PulseTime);
|
||||||
act(false);
|
act(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Event handler for filesystem watcher. When directory changes, this is called
|
|
||||||
/// </summary>
|
|
||||||
//void ListWatcher_Changed(object sender, FileSystemEventArgs e)
|
|
||||||
//{
|
|
||||||
// Debug.Console(1, this, "folder modified: {0}", e.FullPath);
|
|
||||||
// if (e.FullPath.Equals(FilePath, StringComparison.OrdinalIgnoreCase))
|
|
||||||
// {
|
|
||||||
// Debug.Console(1, this, "File changed: {0}", e.ChangeType);
|
|
||||||
// LoadChannels();
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -10,19 +10,22 @@ namespace PepperDash.Essentials.Core.Presets
|
|||||||
public class PresetChannel
|
public class PresetChannel
|
||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty(Required = Required.Always)]
|
[JsonProperty(Required = Required.Always,PropertyName = "name")]
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
[JsonProperty(Required = Required.Always)]
|
|
||||||
|
[JsonProperty(Required = Required.Always, PropertyName = "iconUrl")]
|
||||||
public string IconUrl { get; set; }
|
public string IconUrl { get; set; }
|
||||||
[JsonProperty(Required = Required.Always)]
|
|
||||||
|
[JsonProperty(Required = Required.Always, PropertyName = "channel")]
|
||||||
public string Channel { get; set; }
|
public string Channel { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class PresetsList
|
public class PresetsList
|
||||||
{
|
{
|
||||||
[JsonProperty(Required=Required.Always)]
|
[JsonProperty(Required=Required.Always,PropertyName = "name")]
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
[JsonProperty(Required = Required.Always)]
|
|
||||||
|
[JsonProperty(Required = Required.Always, PropertyName = "channels")]
|
||||||
public List<PresetChannel> Channels { get; set; }
|
public List<PresetChannel> Channels { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
using Crestron.SimplSharp.Scheduler;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Converters;
|
||||||
|
using PepperDash.Essentials.Core;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Room.Config
|
||||||
|
{
|
||||||
|
public class EssentialsRoomScheduledEventsConfig
|
||||||
|
{
|
||||||
|
[JsonProperty("scheduledEvents")]
|
||||||
|
public List<ScheduledEventConfig> ScheduledEvents;
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ScheduledEventConfig
|
||||||
|
{
|
||||||
|
[JsonProperty("key")]
|
||||||
|
public string Key;
|
||||||
|
|
||||||
|
[JsonProperty("name")]
|
||||||
|
public string Name;
|
||||||
|
|
||||||
|
[JsonProperty("days")]
|
||||||
|
public ScheduledEventCommon.eWeekDays Days;
|
||||||
|
|
||||||
|
[JsonProperty("time")]
|
||||||
|
public string Time;
|
||||||
|
|
||||||
|
[JsonProperty("actions")]
|
||||||
|
public List<DeviceActionWrapper> Actions;
|
||||||
|
|
||||||
|
[JsonProperty("persistent")]
|
||||||
|
public bool Persistent;
|
||||||
|
|
||||||
|
[JsonProperty("acknowledgeable")]
|
||||||
|
public bool Acknowledgeable;
|
||||||
|
|
||||||
|
[JsonProperty("enable")]
|
||||||
|
public bool Enable;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -41,6 +41,14 @@ namespace PepperDash.Essentials.Core
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Simplified routing direct from source to destination
|
||||||
|
/// </summary>
|
||||||
|
public interface IRunDirectRouteAction
|
||||||
|
{
|
||||||
|
void RunDirectRoute(string sourceKey, string destinationKey);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// For rooms that default presentation only routing
|
/// For rooms that default presentation only routing
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ namespace PepperDash.Essentials.Core
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// For fixed-source endpoint devices
|
/// For fixed-source endpoint devices
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Obsolete]
|
[Obsolete("Please switch to IRoutingSink")]
|
||||||
public interface IRoutingSinkNoSwitching : IRoutingSink
|
public interface IRoutingSinkNoSwitching : IRoutingSink
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -111,10 +111,87 @@ namespace PepperDash.Essentials.Core
|
|||||||
IntFeedback AudioVideoSourceNumericFeedback { get; }
|
IntFeedback AudioVideoSourceNumericFeedback { get; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Defines an IRmcRouting with a feedback event
|
||||||
|
/// </summary>
|
||||||
|
public interface ITxRoutingWithFeedback : ITxRouting
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Defines an IRmcRouting with a feedback event
|
||||||
|
/// </summary>
|
||||||
|
public interface IRmcRoutingWithFeedback : IRmcRouting
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Defines an IRoutingOutputs devices as being a source - the start of the chain
|
/// Defines an IRoutingOutputs devices as being a source - the start of the chain
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IRoutingSource : IRoutingOutputs
|
public interface IRoutingSource : IRoutingOutputs
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Defines an event structure for reporting output route data
|
||||||
|
/// </summary>
|
||||||
|
public interface IRoutingFeedback : IKeyName
|
||||||
|
{
|
||||||
|
event EventHandler<RoutingNumericEventArgs> NumericSwitchChange;
|
||||||
|
//void OnSwitchChange(RoutingNumericEventArgs e);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Defines an IRoutingNumeric with a feedback event
|
||||||
|
/// </summary>
|
||||||
|
public interface IRoutingNumericWithFeedback : IRoutingNumeric, IRoutingFeedback
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Defines an IRouting with a feedback event
|
||||||
|
/// </summary>
|
||||||
|
public interface IRoutingWithFeedback : IRouting, IRoutingFeedback
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class RoutingNumericEventArgs : EventArgs
|
||||||
|
{
|
||||||
|
|
||||||
|
public uint? Output { get; set; }
|
||||||
|
public uint? Input { get; set; }
|
||||||
|
|
||||||
|
public eRoutingSignalType SigType { get; set; }
|
||||||
|
public RoutingInputPort InputPort { get; set; }
|
||||||
|
public RoutingOutputPort OutputPort { get; set; }
|
||||||
|
|
||||||
|
public RoutingNumericEventArgs(uint output, uint input, eRoutingSignalType sigType) : this(output, input, null, null, sigType)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public RoutingNumericEventArgs(RoutingOutputPort outputPort, RoutingInputPort inputPort,
|
||||||
|
eRoutingSignalType sigType)
|
||||||
|
: this(null, null, outputPort, inputPort, sigType)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public RoutingNumericEventArgs()
|
||||||
|
: this(null, null, null, null, 0)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public RoutingNumericEventArgs(uint? output, uint? input, RoutingOutputPort outputPort,
|
||||||
|
RoutingInputPort inputPort, eRoutingSignalType sigType)
|
||||||
|
{
|
||||||
|
OutputPort = outputPort;
|
||||||
|
InputPort = inputPort;
|
||||||
|
|
||||||
|
Output = output;
|
||||||
|
Input = input;
|
||||||
|
SigType = sigType;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -17,7 +17,7 @@ using PepperDash.Essentials.Core.Config;
|
|||||||
namespace PepperDash.Essentials.DM.AirMedia
|
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, IRoutingNumeric, IIROutputPorts, IComPorts
|
public class AirMediaController : CrestronGenericBridgeableBaseDevice, IRoutingNumericWithFeedback, IIROutputPorts, IComPorts
|
||||||
{
|
{
|
||||||
public AmX00 AirMedia { get; private set; }
|
public AmX00 AirMedia { get; private set; }
|
||||||
|
|
||||||
@@ -29,6 +29,10 @@ namespace PepperDash.Essentials.DM.AirMedia
|
|||||||
|
|
||||||
public RoutingPortCollection<RoutingOutputPort> OutputPorts { get; private set; }
|
public RoutingPortCollection<RoutingOutputPort> OutputPorts { get; private set; }
|
||||||
|
|
||||||
|
|
||||||
|
//IroutingNumericEvent
|
||||||
|
public event EventHandler<RoutingNumericEventArgs> NumericSwitchChange;
|
||||||
|
|
||||||
public BoolFeedback IsInSessionFeedback { get; private set; }
|
public BoolFeedback IsInSessionFeedback { get; private set; }
|
||||||
public IntFeedback ErrorFeedback { get; private set; }
|
public IntFeedback ErrorFeedback { get; private set; }
|
||||||
public IntFeedback NumberOfUsersConnectedFeedback { get; set; }
|
public IntFeedback NumberOfUsersConnectedFeedback { get; set; }
|
||||||
@@ -43,6 +47,7 @@ namespace PepperDash.Essentials.DM.AirMedia
|
|||||||
public AirMediaController(string key, string name, AmX00 device, DeviceConfig dc, AirMediaPropertiesConfig props)
|
public AirMediaController(string key, string name, AmX00 device, DeviceConfig dc, AirMediaPropertiesConfig props)
|
||||||
: base(key, name, device)
|
: base(key, name, device)
|
||||||
{
|
{
|
||||||
|
|
||||||
AirMedia = device;
|
AirMedia = device;
|
||||||
|
|
||||||
DeviceConfig = dc;
|
DeviceConfig = dc;
|
||||||
@@ -53,21 +58,36 @@ namespace PepperDash.Essentials.DM.AirMedia
|
|||||||
OutputPorts = new RoutingPortCollection<RoutingOutputPort>();
|
OutputPorts = new RoutingPortCollection<RoutingOutputPort>();
|
||||||
|
|
||||||
InputPorts.Add(new RoutingInputPort(DmPortName.Osd, eRoutingSignalType.AudioVideo,
|
InputPorts.Add(new RoutingInputPort(DmPortName.Osd, eRoutingSignalType.AudioVideo,
|
||||||
eRoutingPortConnectionType.None, new Action(SelectPinPointUxLandingPage), this));
|
eRoutingPortConnectionType.None, new Action(SelectPinPointUxLandingPage), this)
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = 0
|
||||||
|
});
|
||||||
|
|
||||||
InputPorts.Add(new RoutingInputPort(DmPortName.AirMediaIn, eRoutingSignalType.AudioVideo,
|
InputPorts.Add(new RoutingInputPort(DmPortName.AirMediaIn, eRoutingSignalType.AudioVideo,
|
||||||
eRoutingPortConnectionType.Streaming, new Action(SelectAirMedia), this));
|
eRoutingPortConnectionType.Streaming, new Action(SelectAirMedia), this)
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = 1
|
||||||
|
});
|
||||||
|
|
||||||
InputPorts.Add(new RoutingInputPort(DmPortName.HdmiIn, eRoutingSignalType.AudioVideo,
|
InputPorts.Add(new RoutingInputPort(DmPortName.HdmiIn, eRoutingSignalType.AudioVideo,
|
||||||
eRoutingPortConnectionType.Hdmi, new Action(SelectHdmiIn), this));
|
eRoutingPortConnectionType.Hdmi, new Action(SelectHdmiIn), this)
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = 2
|
||||||
|
});
|
||||||
|
|
||||||
InputPorts.Add(new RoutingInputPort(DmPortName.AirBoardIn, eRoutingSignalType.AudioVideo,
|
InputPorts.Add(new RoutingInputPort(DmPortName.AirBoardIn, eRoutingSignalType.AudioVideo,
|
||||||
eRoutingPortConnectionType.None, new Action(SelectAirboardIn), this));
|
eRoutingPortConnectionType.None, new Action(SelectAirboardIn), this)
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = 4
|
||||||
|
});
|
||||||
|
|
||||||
if (AirMedia is Am300)
|
if (AirMedia is Am300)
|
||||||
{
|
{
|
||||||
InputPorts.Add(new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.AudioVideo,
|
InputPorts.Add(new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.AudioVideo,
|
||||||
eRoutingPortConnectionType.DmCat, new Action(SelectDmIn), this));
|
eRoutingPortConnectionType.DmCat, new Action(SelectDmIn), this)
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = 3
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
OutputPorts.Add(new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.AudioVideo,
|
OutputPorts.Add(new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.AudioVideo,
|
||||||
@@ -153,6 +173,17 @@ namespace PepperDash.Essentials.DM.AirMedia
|
|||||||
SerialNumberFeedback.LinkInputSig(trilist.StringInput[joinMap.SerialNumberFeedback.JoinNumber]);
|
SerialNumberFeedback.LinkInputSig(trilist.StringInput[joinMap.SerialNumberFeedback.JoinNumber]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Raise an event when the status of a switch object changes.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="e">Arguments defined as IKeyName sender, output, input, and eRoutingSignalType</param>
|
||||||
|
private void OnSwitchChange(RoutingNumericEventArgs e)
|
||||||
|
{
|
||||||
|
var newEvent = NumericSwitchChange;
|
||||||
|
if (newEvent != null) newEvent(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)
|
if (args.EventId == AirMediaInputSlot.AirMediaStatusFeedbackEventId)
|
||||||
@@ -172,12 +203,20 @@ namespace PepperDash.Essentials.DM.AirMedia
|
|||||||
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)
|
if (args.EventId == AmX00.VideoOutFeedbackEventId)
|
||||||
|
{
|
||||||
VideoOutFeedback.FireUpdate();
|
VideoOutFeedback.FireUpdate();
|
||||||
|
|
||||||
|
var localInputPort =
|
||||||
|
InputPorts.FirstOrDefault(p => (int) p.FeedbackMatchObject == VideoOutFeedback.UShortValue);
|
||||||
|
|
||||||
|
OnSwitchChange(new RoutingNumericEventArgs(1, VideoOutFeedback.UShortValue, OutputPorts.First(),
|
||||||
|
localInputPort, eRoutingSignalType.AudioVideo));
|
||||||
|
}
|
||||||
else if (args.EventId == AmX00.EnableAutomaticRoutingFeedbackEventId)
|
else if (args.EventId == AmX00.EnableAutomaticRoutingFeedbackEventId)
|
||||||
AutomaticInputRoutingEnabledFeedback.FireUpdate();
|
AutomaticInputRoutingEnabledFeedback.FireUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
void HdmiIn_StreamChange(Crestron.SimplSharpPro.DeviceSupport.Stream stream, Crestron.SimplSharpPro.DeviceSupport.StreamEventArgs args)
|
void HdmiIn_StreamChange(Stream stream, Crestron.SimplSharpPro.DeviceSupport.StreamEventArgs args)
|
||||||
{
|
{
|
||||||
if (args.EventId == DMInputEventIds.SourceSyncEventId)
|
if (args.EventId == DMInputEventIds.SourceSyncEventId)
|
||||||
HdmiVideoSyncDetectedFeedback.FireUpdate();
|
HdmiVideoSyncDetectedFeedback.FireUpdate();
|
||||||
|
|||||||
@@ -21,12 +21,15 @@ namespace PepperDash.Essentials.DM {
|
|||||||
/// Builds a controller for basic DM-RMCs with Com and IR ports and no control functions
|
/// Builds a controller for basic DM-RMCs with Com and IR ports and no control functions
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class DmBladeChassisController : CrestronGenericBridgeableBaseDevice, IDmSwitch, IRoutingNumeric
|
public class DmBladeChassisController : CrestronGenericBridgeableBaseDevice, IDmSwitch, IRoutingNumericWithFeedback
|
||||||
{
|
{
|
||||||
public DMChassisPropertiesConfig PropertiesConfig { get; set; }
|
public DMChassisPropertiesConfig PropertiesConfig { get; set; }
|
||||||
|
|
||||||
public Switch Chassis { get; private set; }
|
public Switch Chassis { get; private set; }
|
||||||
|
|
||||||
|
//IroutingNumericEvent
|
||||||
|
public event EventHandler<RoutingNumericEventArgs> NumericSwitchChange;
|
||||||
|
|
||||||
// Feedbacks for EssentialDM
|
// Feedbacks for EssentialDM
|
||||||
public Dictionary<uint, IntFeedback> VideoOutputFeedbacks { get; private set; }
|
public Dictionary<uint, IntFeedback> VideoOutputFeedbacks { get; private set; }
|
||||||
public Dictionary<uint, IntFeedback> AudioOutputFeedbacks { get; private set; }
|
public Dictionary<uint, IntFeedback> AudioOutputFeedbacks { get; private set; }
|
||||||
@@ -287,6 +290,15 @@ namespace PepperDash.Essentials.DM {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Raise an event when the status of a switch object changes.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="e">Arguments defined as IKeyName sender, output, input, and eRoutingSignalType</param>
|
||||||
|
private void OnSwitchChange(RoutingNumericEventArgs e)
|
||||||
|
{
|
||||||
|
var newEvent = NumericSwitchChange;
|
||||||
|
if (newEvent != null) newEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void AddHdmiInBladePorts(uint number, ICec cecPort) {
|
void AddHdmiInBladePorts(uint number, ICec cecPort) {
|
||||||
@@ -377,7 +389,10 @@ namespace PepperDash.Essentials.DM {
|
|||||||
void AddInputPortWithDebug(uint cardNum, string portName, eRoutingSignalType sigType, eRoutingPortConnectionType portType) {
|
void AddInputPortWithDebug(uint cardNum, string portName, eRoutingSignalType sigType, eRoutingPortConnectionType portType) {
|
||||||
var portKey = string.Format("inputCard{0}--{1}", cardNum, portName);
|
var portKey = string.Format("inputCard{0}--{1}", cardNum, portName);
|
||||||
Debug.Console(2, this, "Adding input port '{0}'", portKey);
|
Debug.Console(2, this, "Adding input port '{0}'", portKey);
|
||||||
var inputPort = new RoutingInputPort(portKey, sigType, portType, cardNum, this);
|
var inputPort = new RoutingInputPort(portKey, sigType, portType, cardNum, this)
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = Chassis.Inputs[cardNum]
|
||||||
|
};
|
||||||
|
|
||||||
InputPorts.Add(inputPort);
|
InputPorts.Add(inputPort);
|
||||||
}
|
}
|
||||||
@@ -385,20 +400,21 @@ namespace PepperDash.Essentials.DM {
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Adds InputPort and sets Port as ICec object
|
/// Adds InputPort and sets Port as ICec object
|
||||||
/// </summary>
|
/// </summary>
|
||||||
void AddInputPortWithDebug(uint cardNum, string portName, eRoutingSignalType sigType, eRoutingPortConnectionType portType, ICec cecPort) {
|
private void AddInputPortWithDebug(uint cardNum, string portName, eRoutingSignalType sigType,
|
||||||
|
eRoutingPortConnectionType portType, ICec cecPort)
|
||||||
|
{
|
||||||
var portKey = string.Format("inputCard{0}--{1}", cardNum, portName);
|
var portKey = string.Format("inputCard{0}--{1}", cardNum, portName);
|
||||||
Debug.Console(2, this, "Adding input port '{0}'", portKey);
|
Debug.Console(2, this, "Adding input port '{0}'", portKey);
|
||||||
var inputPort = new RoutingInputPort(portKey, sigType, portType, cardNum, this);
|
var inputPort = new RoutingInputPort(portKey, sigType, portType, cardNum, this)
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = Chassis.Inputs[cardNum]
|
||||||
|
};
|
||||||
|
|
||||||
if (inputPort != null) {
|
|
||||||
if (cecPort != null)
|
if (cecPort != null)
|
||||||
inputPort.Port = cecPort;
|
inputPort.Port = cecPort;
|
||||||
|
|
||||||
InputPorts.Add(inputPort);
|
InputPorts.Add(inputPort);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
Debug.Console(2, this, "inputPort is null");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -407,7 +423,10 @@ namespace PepperDash.Essentials.DM {
|
|||||||
void AddOutputPortWithDebug(string cardName, string portName, eRoutingSignalType sigType, eRoutingPortConnectionType portType, object selector) {
|
void AddOutputPortWithDebug(string cardName, string portName, eRoutingSignalType sigType, eRoutingPortConnectionType portType, object selector) {
|
||||||
var portKey = string.Format("{0}--{1}", cardName, portName);
|
var portKey = string.Format("{0}--{1}", cardName, portName);
|
||||||
Debug.Console(2, this, "Adding output port '{0}'", portKey);
|
Debug.Console(2, this, "Adding output port '{0}'", portKey);
|
||||||
OutputPorts.Add(new RoutingOutputPort(portKey, sigType, portType, selector, this));
|
OutputPorts.Add(new RoutingOutputPort(portKey, sigType, portType, selector, this)
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = Chassis.Outputs[(uint)selector]
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -458,52 +477,82 @@ namespace PepperDash.Essentials.DM {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
void Chassis_DMOutputChange(Switch device, DMOutputEventArgs args)
|
private void Chassis_DMOutputChange(Switch device, DMOutputEventArgs args)
|
||||||
{
|
{
|
||||||
var output = args.Number;
|
var output = args.Number;
|
||||||
|
|
||||||
switch (args.EventId) {
|
switch (args.EventId)
|
||||||
case DMOutputEventIds.VolumeEventId: {
|
{
|
||||||
if (VolumeControls.ContainsKey(output)) {
|
case DMOutputEventIds.VolumeEventId:
|
||||||
|
{
|
||||||
|
if (VolumeControls.ContainsKey(output))
|
||||||
|
{
|
||||||
VolumeControls[args.Number].VolumeEventFromChassis();
|
VolumeControls[args.Number].VolumeEventFromChassis();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case DMOutputEventIds.EndpointOnlineEventId: {
|
case DMOutputEventIds.EndpointOnlineEventId:
|
||||||
Debug.Console(2, this, "Output {0} DMOutputEventIds.EndpointOnlineEventId fired. EndpointOnlineFeedback State: {1}", args.Number, Chassis.Outputs[output].EndpointOnlineFeedback);
|
{
|
||||||
|
Debug.Console(2, this,
|
||||||
|
"Output {0} DMOutputEventIds.EndpointOnlineEventId fired. EndpointOnlineFeedback State: {1}",
|
||||||
|
args.Number, Chassis.Outputs[output].EndpointOnlineFeedback);
|
||||||
if (Chassis.Outputs[output].Endpoint != null)
|
if (Chassis.Outputs[output].Endpoint != null)
|
||||||
Debug.Console(2, this, "Output {0} DMOutputEventIds.EndpointOnlineEventId fired. Endpoint.IsOnline State: {1}", args.Number, Chassis.Outputs[output].Endpoint.IsOnline);
|
Debug.Console(2, this,
|
||||||
|
"Output {0} DMOutputEventIds.EndpointOnlineEventId fired. Endpoint.IsOnline State: {1}",
|
||||||
|
args.Number, Chassis.Outputs[output].Endpoint.IsOnline);
|
||||||
|
|
||||||
OutputEndpointOnlineFeedbacks[output].FireUpdate();
|
OutputEndpointOnlineFeedbacks[output].FireUpdate();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case DMOutputEventIds.OnlineFeedbackEventId: {
|
case DMOutputEventIds.OnlineFeedbackEventId:
|
||||||
Debug.Console(2, this, "Output {0} DMInputEventIds.OnlineFeedbackEventId fired. State: {1}", args.Number, Chassis.Outputs[output].EndpointOnlineFeedback);
|
{
|
||||||
|
Debug.Console(2, this, "Output {0} DMInputEventIds.OnlineFeedbackEventId fired. State: {1}",
|
||||||
|
args.Number, Chassis.Outputs[output].EndpointOnlineFeedback);
|
||||||
OutputEndpointOnlineFeedbacks[output].FireUpdate();
|
OutputEndpointOnlineFeedbacks[output].FireUpdate();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case DMOutputEventIds.VideoOutEventId: {
|
case DMOutputEventIds.VideoOutEventId:
|
||||||
if (Chassis.Outputs[output].VideoOutFeedback != null) {
|
{
|
||||||
Debug.Console(2, this, "DMSwitchVideo:{0} Routed Input:{1} Output:{2}'", this.Name, Chassis.Outputs[output].VideoOutFeedback.Number, output);
|
|
||||||
}
|
var inputNumber = Chassis.Outputs[output].VideoOutFeedback == null ? 0 : Chassis.Outputs[output].VideoOutFeedback.Number;
|
||||||
if (VideoOutputFeedbacks.ContainsKey(output)) {
|
|
||||||
|
Debug.Console(2, this, "DMSwitchAudioVideo:{0} Routed Input:{1} Output:{2}'", this.Name,
|
||||||
|
inputNumber, output);
|
||||||
|
|
||||||
|
if (VideoOutputFeedbacks.ContainsKey(output))
|
||||||
|
{
|
||||||
|
var localInputPort = InputPorts.FirstOrDefault(p => (DMInput)p.FeedbackMatchObject == Chassis.Outputs[output].VideoOutFeedback);
|
||||||
|
var localOutputPort =
|
||||||
|
OutputPorts.FirstOrDefault(p => (DMOutput) p.FeedbackMatchObject == Chassis.Outputs[output]);
|
||||||
|
|
||||||
|
|
||||||
VideoOutputFeedbacks[output].FireUpdate();
|
VideoOutputFeedbacks[output].FireUpdate();
|
||||||
|
OnSwitchChange(new RoutingNumericEventArgs(output,
|
||||||
|
inputNumber,
|
||||||
|
localOutputPort,
|
||||||
|
localInputPort,
|
||||||
|
eRoutingSignalType.AudioVideo));
|
||||||
|
|
||||||
}
|
}
|
||||||
if (OutputVideoRouteNameFeedbacks.ContainsKey(output)) {
|
if (OutputVideoRouteNameFeedbacks.ContainsKey(output))
|
||||||
|
{
|
||||||
OutputVideoRouteNameFeedbacks[output].FireUpdate();
|
OutputVideoRouteNameFeedbacks[output].FireUpdate();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case DMOutputEventIds.OutputNameEventId: {
|
case DMOutputEventIds.OutputNameEventId:
|
||||||
|
{
|
||||||
Debug.Console(2, this, "DM Output {0} NameFeedbackEventId", output);
|
Debug.Console(2, this, "DM Output {0} NameFeedbackEventId", output);
|
||||||
OutputNameFeedbacks[output].FireUpdate();
|
OutputNameFeedbacks[output].FireUpdate();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default: {
|
default:
|
||||||
Debug.Console(2, this, "DMOutputChange fired for Output {0} with Unhandled EventId: {1}", args.Number, args.EventId);
|
{
|
||||||
|
Debug.Console(2, this, "DMOutputChange fired for Output {0} with Unhandled EventId: {1}",
|
||||||
|
args.Number, args.EventId);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,12 +21,15 @@ namespace PepperDash.Essentials.DM
|
|||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Description("Wrapper class for all DM-MD chassis variants from 8x8 to 32x32")]
|
[Description("Wrapper class for all DM-MD chassis variants from 8x8 to 32x32")]
|
||||||
public class DmChassisController : CrestronGenericBridgeableBaseDevice, IDmSwitch, IRoutingNumeric
|
public class DmChassisController : CrestronGenericBridgeableBaseDevice, IDmSwitch, IRoutingNumericWithFeedback
|
||||||
{
|
{
|
||||||
public DMChassisPropertiesConfig PropertiesConfig { get; set; }
|
public DMChassisPropertiesConfig PropertiesConfig { get; set; }
|
||||||
|
|
||||||
public Switch Chassis { get; private set; }
|
public Switch Chassis { get; private set; }
|
||||||
|
|
||||||
|
//IroutingNumericEvent
|
||||||
|
public event EventHandler<RoutingNumericEventArgs> NumericSwitchChange;
|
||||||
|
|
||||||
// Feedbacks for EssentialDM
|
// Feedbacks for EssentialDM
|
||||||
public Dictionary<uint, IntFeedback> VideoOutputFeedbacks { get; private set; }
|
public Dictionary<uint, IntFeedback> VideoOutputFeedbacks { get; private set; }
|
||||||
public Dictionary<uint, IntFeedback> AudioOutputFeedbacks { get; private set; }
|
public Dictionary<uint, IntFeedback> AudioOutputFeedbacks { get; private set; }
|
||||||
@@ -47,6 +50,8 @@ namespace PepperDash.Essentials.DM
|
|||||||
public BoolFeedback EnableUsbBreakawayFeedback { get; private set; }
|
public BoolFeedback EnableUsbBreakawayFeedback { get; private set; }
|
||||||
|
|
||||||
public Dictionary<uint, IntFeedback> InputCardHdcpStateFeedbacks { get; private set; }
|
public Dictionary<uint, IntFeedback> InputCardHdcpStateFeedbacks { get; private set; }
|
||||||
|
public Dictionary<uint, IntFeedback> InputStreamCardStateFeedbacks { get; private set; }
|
||||||
|
public Dictionary<uint, IntFeedback> OutputStreamCardStateFeedbacks { get; private set; }
|
||||||
|
|
||||||
public Dictionary<uint, eHdcpCapabilityType> InputCardHdcpCapabilityTypes { get; private set; }
|
public Dictionary<uint, eHdcpCapabilityType> InputCardHdcpCapabilityTypes { get; private set; }
|
||||||
|
|
||||||
@@ -188,6 +193,7 @@ namespace PepperDash.Essentials.DM
|
|||||||
public DmChassisController(string key, string name, DmMDMnxn chassis)
|
public DmChassisController(string key, string name, DmMDMnxn chassis)
|
||||||
: base(key, name, chassis)
|
: base(key, name, chassis)
|
||||||
{
|
{
|
||||||
|
|
||||||
Chassis = chassis;
|
Chassis = chassis;
|
||||||
InputPorts = new RoutingPortCollection<RoutingInputPort>();
|
InputPorts = new RoutingPortCollection<RoutingInputPort>();
|
||||||
OutputPorts = new RoutingPortCollection<RoutingOutputPort>();
|
OutputPorts = new RoutingPortCollection<RoutingOutputPort>();
|
||||||
@@ -220,6 +226,8 @@ namespace PepperDash.Essentials.DM
|
|||||||
new BoolFeedback(() => (Chassis as DmMDMnxn).EnableUSBBreakawayFeedback.BoolValue);
|
new BoolFeedback(() => (Chassis as DmMDMnxn).EnableUSBBreakawayFeedback.BoolValue);
|
||||||
|
|
||||||
InputCardHdcpStateFeedbacks = new Dictionary<uint, IntFeedback>();
|
InputCardHdcpStateFeedbacks = new Dictionary<uint, IntFeedback>();
|
||||||
|
InputStreamCardStateFeedbacks = new Dictionary<uint, IntFeedback>();
|
||||||
|
OutputStreamCardStateFeedbacks = new Dictionary<uint, IntFeedback>();
|
||||||
InputCardHdcpCapabilityTypes = new Dictionary<uint, eHdcpCapabilityType>();
|
InputCardHdcpCapabilityTypes = new Dictionary<uint, eHdcpCapabilityType>();
|
||||||
|
|
||||||
for (uint x = 1; x <= Chassis.NumberOfOutputs; x++)
|
for (uint x = 1; x <= Chassis.NumberOfOutputs; x++)
|
||||||
@@ -304,6 +312,33 @@ namespace PepperDash.Essentials.DM
|
|||||||
|
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
OutputStreamCardStateFeedbacks[tempX] = new IntFeedback(() =>
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var outputCard = Chassis.Outputs[tempX];
|
||||||
|
|
||||||
|
if (outputCard.Card is DmcStroAV)
|
||||||
|
{
|
||||||
|
Debug.Console(2, "Found output stream card in slot: {0}.", tempX);
|
||||||
|
var streamCard = outputCard.Card as DmcStroAV;
|
||||||
|
if (streamCard.Control.StartFeedback.BoolValue == true)
|
||||||
|
return 1;
|
||||||
|
else if (streamCard.Control.StopFeedback.BoolValue == true)
|
||||||
|
return 2;
|
||||||
|
else if (streamCard.Control.PauseFeedback.BoolValue == true)
|
||||||
|
return 3;
|
||||||
|
else
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
catch (InvalidOperationException iopex)
|
||||||
|
{
|
||||||
|
Debug.Console(0, this, Debug.ErrorLogLevel.Warning, "Error adding output stream card in slot: {0}. Error: {1}", tempX, iopex);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Chassis.Inputs[tempX] != null)
|
if (Chassis.Inputs[tempX] != null)
|
||||||
@@ -403,6 +438,33 @@ namespace PepperDash.Essentials.DM
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
InputStreamCardStateFeedbacks[tempX] = new IntFeedback(() =>
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var inputCard = Chassis.Inputs[tempX];
|
||||||
|
|
||||||
|
if (inputCard.Card is DmcStr)
|
||||||
|
{
|
||||||
|
Debug.Console(2, "Found input stream card in slot: {0}.", tempX);
|
||||||
|
var streamCard = inputCard.Card as DmcStr;
|
||||||
|
if (streamCard.Control.StartFeedback.BoolValue == true)
|
||||||
|
return 1;
|
||||||
|
else if (streamCard.Control.StopFeedback.BoolValue == true)
|
||||||
|
return 2;
|
||||||
|
else if (streamCard.Control.PauseFeedback.BoolValue == true)
|
||||||
|
return 3;
|
||||||
|
else
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
catch (InvalidOperationException iopex)
|
||||||
|
{
|
||||||
|
Debug.Console(0, this, Debug.ErrorLogLevel.Warning, "Error adding input stream card in slot: {0}. Error: {1}", tempX, iopex);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -737,7 +799,10 @@ namespace PepperDash.Essentials.DM
|
|||||||
{
|
{
|
||||||
var portKey = string.Format("inputCard{0}--{1}", cardNum, portName);
|
var portKey = string.Format("inputCard{0}--{1}", cardNum, portName);
|
||||||
Debug.Console(2, this, "Adding input port '{0}'", portKey);
|
Debug.Console(2, this, "Adding input port '{0}'", portKey);
|
||||||
var inputPort = new RoutingInputPort(portKey, sigType, portType, cardNum, this);
|
var inputPort = new RoutingInputPort(portKey, sigType, portType, cardNum, this)
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = Chassis.Inputs[cardNum]
|
||||||
|
};
|
||||||
|
|
||||||
InputPorts.Add(inputPort);
|
InputPorts.Add(inputPort);
|
||||||
}
|
}
|
||||||
@@ -749,7 +814,10 @@ namespace PepperDash.Essentials.DM
|
|||||||
{
|
{
|
||||||
var portKey = string.Format("inputCard{0}--{1}", cardNum, portName);
|
var portKey = string.Format("inputCard{0}--{1}", cardNum, portName);
|
||||||
Debug.Console(2, this, "Adding input port '{0}'", portKey);
|
Debug.Console(2, this, "Adding input port '{0}'", portKey);
|
||||||
var inputPort = new RoutingInputPort(portKey, sigType, portType, cardNum, this);
|
var inputPort = new RoutingInputPort(portKey, sigType, portType, cardNum, this)
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = Chassis.Inputs[cardNum]
|
||||||
|
}; ;
|
||||||
|
|
||||||
if (cecPort != null)
|
if (cecPort != null)
|
||||||
inputPort.Port = cecPort;
|
inputPort.Port = cecPort;
|
||||||
@@ -764,7 +832,15 @@ namespace PepperDash.Essentials.DM
|
|||||||
{
|
{
|
||||||
var portKey = string.Format("{0}--{1}", cardName, portName);
|
var portKey = string.Format("{0}--{1}", cardName, portName);
|
||||||
Debug.Console(2, this, "Adding output port '{0}'", portKey);
|
Debug.Console(2, this, "Adding output port '{0}'", portKey);
|
||||||
OutputPorts.Add(new RoutingOutputPort(portKey, sigType, portType, selector, this));
|
|
||||||
|
var outputPort = new RoutingOutputPort(portKey, sigType, portType, selector, this);
|
||||||
|
|
||||||
|
if (portName.IndexOf("Loop", StringComparison.InvariantCultureIgnoreCase) < 0)
|
||||||
|
{
|
||||||
|
outputPort.FeedbackMatchObject = Chassis.Outputs[(uint) selector];
|
||||||
|
}
|
||||||
|
|
||||||
|
OutputPorts.Add(outputPort);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -776,6 +852,10 @@ namespace PepperDash.Essentials.DM
|
|||||||
Debug.Console(2, this, "Adding output port '{0}'", portKey);
|
Debug.Console(2, this, "Adding output port '{0}'", portKey);
|
||||||
var outputPort = new RoutingOutputPort(portKey, sigType, portType, selector, this);
|
var outputPort = new RoutingOutputPort(portKey, sigType, portType, selector, this);
|
||||||
|
|
||||||
|
if (portName.IndexOf("Loop", StringComparison.InvariantCultureIgnoreCase) < 0)
|
||||||
|
{
|
||||||
|
outputPort.FeedbackMatchObject = Chassis.Outputs[(uint)selector];
|
||||||
|
}
|
||||||
if (cecPort != null)
|
if (cecPort != null)
|
||||||
outputPort.Port = cecPort;
|
outputPort.Port = cecPort;
|
||||||
|
|
||||||
@@ -894,6 +974,19 @@ namespace PepperDash.Essentials.DM
|
|||||||
Debug.Console(1, this, "No index of {0} found in InputCardHdcpCapabilityFeedbacks");
|
Debug.Console(1, this, "No index of {0} found in InputCardHdcpCapabilityFeedbacks");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case DMInputEventIds.StartEventId:
|
||||||
|
case DMInputEventIds.StopEventId:
|
||||||
|
case DMInputEventIds.PauseEventId:
|
||||||
|
{
|
||||||
|
Debug.Console(2, this, "DM Input {0} Stream Status EventId", args.Number);
|
||||||
|
if (InputStreamCardStateFeedbacks[args.Number] != null)
|
||||||
|
{
|
||||||
|
InputStreamCardStateFeedbacks[args.Number].FireUpdate();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
Debug.Console(2, this, "No index of {0} found in InputStreamCardStateFeedbacks");
|
||||||
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
Debug.Console(2, this, "DMInputChange fired for Input {0} with Unhandled EventId: {1}", args.Number, args.EventId);
|
Debug.Console(2, this, "DMInputChange fired for Input {0} with Unhandled EventId: {1}", args.Number, args.EventId);
|
||||||
@@ -907,6 +1000,17 @@ namespace PepperDash.Essentials.DM
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// <summary>
|
||||||
|
/// Raise an event when the status of a switch object changes.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="e">Arguments defined as IKeyName sender, output, input, and eRoutingSignalType</param>
|
||||||
|
private void OnSwitchChange(RoutingNumericEventArgs e)
|
||||||
|
{
|
||||||
|
var newEvent = NumericSwitchChange;
|
||||||
|
if (newEvent != null) newEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
void Chassis_DMOutputChange(Switch device, DMOutputEventArgs args)
|
void Chassis_DMOutputChange(Switch device, DMOutputEventArgs args)
|
||||||
@@ -940,11 +1044,26 @@ namespace PepperDash.Essentials.DM
|
|||||||
}
|
}
|
||||||
case DMOutputEventIds.VideoOutEventId:
|
case DMOutputEventIds.VideoOutEventId:
|
||||||
{
|
{
|
||||||
if (Chassis.Outputs[output].VideoOutFeedback != null)
|
|
||||||
Debug.Console(2, this, "DMSwitchVideo:{0} Routed Input:{1} Output:{2}'", this.Name, Chassis.Outputs[output].VideoOutFeedback.Number, output);
|
var inputNumber = Chassis.Outputs[output].VideoOutFeedback == null ? 0 : Chassis.
|
||||||
|
Outputs[output].VideoOutFeedback.Number;
|
||||||
|
|
||||||
|
Debug.Console(2, this, "DMSwitchVideo:{0} Routed Input:{1} Output:{2}'", this.Name, inputNumber, output);
|
||||||
|
|
||||||
if (VideoOutputFeedbacks.ContainsKey(output))
|
if (VideoOutputFeedbacks.ContainsKey(output))
|
||||||
|
{
|
||||||
|
var localInputPort = InputPorts.FirstOrDefault(p => (DMInput)p.FeedbackMatchObject == Chassis.Outputs[output].VideoOutFeedback);
|
||||||
|
var localOutputPort =
|
||||||
|
OutputPorts.FirstOrDefault(p => (DMOutput) p.FeedbackMatchObject == Chassis.Outputs[output]);
|
||||||
|
|
||||||
|
|
||||||
VideoOutputFeedbacks[output].FireUpdate();
|
VideoOutputFeedbacks[output].FireUpdate();
|
||||||
|
OnSwitchChange(new RoutingNumericEventArgs(output,
|
||||||
|
inputNumber,
|
||||||
|
localOutputPort,
|
||||||
|
localInputPort,
|
||||||
|
eRoutingSignalType.Video));
|
||||||
|
}
|
||||||
|
|
||||||
if (OutputVideoRouteNameFeedbacks.ContainsKey(output))
|
if (OutputVideoRouteNameFeedbacks.ContainsKey(output))
|
||||||
OutputVideoRouteNameFeedbacks[output].FireUpdate();
|
OutputVideoRouteNameFeedbacks[output].FireUpdate();
|
||||||
@@ -953,11 +1072,25 @@ namespace PepperDash.Essentials.DM
|
|||||||
}
|
}
|
||||||
case DMOutputEventIds.AudioOutEventId:
|
case DMOutputEventIds.AudioOutEventId:
|
||||||
{
|
{
|
||||||
if (Chassis.Outputs[output].AudioOutFeedback != null)
|
var inputNumber = Chassis.Outputs[output].AudioOutFeedback == null ? 0 : Chassis.
|
||||||
Debug.Console(2, this, "DMSwitchAudio:{0} Routed Input:{1} Output:{2}'", this.Name, Chassis.Outputs[output].AudioOutFeedback.Number, output);
|
Outputs[output].AudioOutFeedback.Number;
|
||||||
|
|
||||||
|
Debug.Console(2, this, "DMSwitchAudio:{0} Routed Input:{1} Output:{2}'", this.Name, inputNumber, output);
|
||||||
|
|
||||||
if (AudioOutputFeedbacks.ContainsKey(output))
|
if (AudioOutputFeedbacks.ContainsKey(output))
|
||||||
|
{
|
||||||
|
var localInputPort = InputPorts.FirstOrDefault(p => (DMInput)p.FeedbackMatchObject == Chassis.Outputs[output].AudioOutFeedback);
|
||||||
|
var localOutputPort =
|
||||||
|
OutputPorts.FirstOrDefault(p => (DMOutput)p.FeedbackMatchObject == Chassis.Outputs[output]);
|
||||||
|
|
||||||
|
|
||||||
AudioOutputFeedbacks[output].FireUpdate();
|
AudioOutputFeedbacks[output].FireUpdate();
|
||||||
|
OnSwitchChange(new RoutingNumericEventArgs(output,
|
||||||
|
inputNumber,
|
||||||
|
localOutputPort,
|
||||||
|
localInputPort,
|
||||||
|
eRoutingSignalType.Audio));
|
||||||
|
}
|
||||||
|
|
||||||
if (OutputAudioRouteNameFeedbacks.ContainsKey(output))
|
if (OutputAudioRouteNameFeedbacks.ContainsKey(output))
|
||||||
OutputAudioRouteNameFeedbacks[output].FireUpdate();
|
OutputAudioRouteNameFeedbacks[output].FireUpdate();
|
||||||
@@ -982,6 +1115,19 @@ namespace PepperDash.Essentials.DM
|
|||||||
OutputDisabledByHdcpFeedbacks[args.Number].FireUpdate();
|
OutputDisabledByHdcpFeedbacks[args.Number].FireUpdate();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case DMOutputEventIds.StartEventId:
|
||||||
|
case DMOutputEventIds.StopEventId:
|
||||||
|
case DMOutputEventIds.PauseEventId:
|
||||||
|
{
|
||||||
|
Debug.Console(2, this, "DM Output {0} Stream Status EventId", args.Number);
|
||||||
|
if (OutputStreamCardStateFeedbacks[args.Number] != null)
|
||||||
|
{
|
||||||
|
OutputStreamCardStateFeedbacks[args.Number].FireUpdate();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
Debug.Console(2, this, "No index of {0} found in OutputStreamCardStateFeedbacks");
|
||||||
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
Debug.Console(2, this, "DMOutputChange fired for Output {0} with Unhandled EventId: {1}", args.Number, args.EventId);
|
Debug.Console(2, this, "DMOutputChange fired for Output {0} with Unhandled EventId: {1}", args.Number, args.EventId);
|
||||||
@@ -1181,12 +1327,15 @@ namespace PepperDash.Essentials.DM
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
LinkHdmiInputToApi(trilist, ioSlot, joinMap, ioSlotJoin);
|
LinkHdmiInputToApi(trilist, ioSlot, joinMap, ioSlotJoin);
|
||||||
|
LinkStreamInputToApi(trilist, ioSlot, joinMap, ioSlotJoin);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (RxDictionary.ContainsKey(ioSlot))
|
if (RxDictionary.ContainsKey(ioSlot))
|
||||||
{
|
{
|
||||||
LinkRxToApi(trilist, ioSlot, joinMap, ioSlotJoin);
|
LinkRxToApi(trilist, ioSlot, joinMap, ioSlotJoin);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
LinkStreamOutputToApi(trilist, ioSlot, joinMap, ioSlotJoin);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1235,6 +1384,86 @@ namespace PepperDash.Essentials.DM
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void LinkStreamInputToApi(BasicTriList trilist, uint ioSlot, DmChassisControllerJoinMap joinMap, uint ioSlotJoin)
|
||||||
|
{
|
||||||
|
var inputPort = InputPorts[string.Format("inputCard{0}--streamIn", ioSlot)];
|
||||||
|
if (inputPort == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var streamCard = Chassis.Inputs[ioSlot].Card as DmcStr;
|
||||||
|
var join = joinMap.InputStreamCardState.JoinNumber + ioSlotJoin;
|
||||||
|
|
||||||
|
Debug.Console(1, "Port value for input card {0} is set as a stream card", ioSlot);
|
||||||
|
|
||||||
|
trilist.SetUShortSigAction(join, s =>
|
||||||
|
{
|
||||||
|
if (s == 1)
|
||||||
|
{
|
||||||
|
Debug.Console(2, this, "Join {0} value {1}: Setting stream state to start", join, s);
|
||||||
|
streamCard.Control.Start();
|
||||||
|
}
|
||||||
|
else if (s == 2)
|
||||||
|
{
|
||||||
|
Debug.Console(2, this, "Join {0} value {1}: Setting stream state to stop", join, s);
|
||||||
|
streamCard.Control.Stop();
|
||||||
|
}
|
||||||
|
else if (s == 3)
|
||||||
|
{
|
||||||
|
Debug.Console(2, this, "Join {0} value {1}: Setting stream state to pause", join, s);
|
||||||
|
streamCard.Control.Pause();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Debug.Console(2, this, "Join {0} value {1}: Ignore stream state", join, s);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
InputStreamCardStateFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[join]);
|
||||||
|
|
||||||
|
trilist.UShortInput[join].UShortValue = InputStreamCardStateFeedbacks[ioSlot].UShortValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void LinkStreamOutputToApi(BasicTriList trilist, uint ioSlot, DmChassisControllerJoinMap joinMap, uint ioSlotJoin)
|
||||||
|
{
|
||||||
|
var outputPort = OutputPorts[string.Format("outputCard{0}--streamOut", ioSlot)];
|
||||||
|
if (outputPort == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var streamCard = Chassis.Outputs[ioSlot].Card as DmcStroAV;
|
||||||
|
var join = joinMap.OutputStreamCardState.JoinNumber + ioSlotJoin;
|
||||||
|
|
||||||
|
Debug.Console(1, "Port value for output card {0} is set as a stream card", ioSlot);
|
||||||
|
|
||||||
|
trilist.SetUShortSigAction(join, s =>
|
||||||
|
{
|
||||||
|
if (s == 1)
|
||||||
|
{
|
||||||
|
Debug.Console(2, this, "Join {0} value {1}: Setting stream state to start", join, s);
|
||||||
|
streamCard.Control.Start();
|
||||||
|
}
|
||||||
|
else if (s == 2)
|
||||||
|
{
|
||||||
|
Debug.Console(2, this, "Join {0} value {1}: Setting stream state to stop", join, s);
|
||||||
|
streamCard.Control.Stop();
|
||||||
|
}
|
||||||
|
else if (s == 3)
|
||||||
|
{
|
||||||
|
Debug.Console(2, this, "Join {0} value {1}: Setting stream state to pause", join, s);
|
||||||
|
streamCard.Control.Pause();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Debug.Console(2, this, "Join {0} value {1}: Ignore stream state", join, s);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
OutputStreamCardStateFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[join]);
|
||||||
|
|
||||||
|
trilist.UShortInput[join].UShortValue = OutputStreamCardStateFeedbacks[ioSlot].UShortValue;
|
||||||
|
}
|
||||||
|
|
||||||
private void LinkRxToApi(BasicTriList trilist, uint ioSlot, DmChassisControllerJoinMap joinMap, uint ioSlotJoin)
|
private void LinkRxToApi(BasicTriList trilist, uint ioSlot, DmChassisControllerJoinMap joinMap, uint ioSlotJoin)
|
||||||
{
|
{
|
||||||
Debug.Console(2, "Creating Rx Feedbacks {0}", ioSlot);
|
Debug.Console(2, "Creating Rx Feedbacks {0}", ioSlot);
|
||||||
|
|||||||
@@ -19,11 +19,14 @@ using Feedback = PepperDash.Essentials.Core.Feedback;
|
|||||||
|
|
||||||
namespace PepperDash.Essentials.DM
|
namespace PepperDash.Essentials.DM
|
||||||
{
|
{
|
||||||
public class DmpsRoutingController : EssentialsBridgeableDevice, IRoutingNumeric, IHasFeedback
|
public class DmpsRoutingController : EssentialsBridgeableDevice, IRoutingNumericWithFeedback, IHasFeedback
|
||||||
{
|
{
|
||||||
public CrestronControlSystem Dmps { get; set; }
|
public CrestronControlSystem Dmps { get; set; }
|
||||||
public ISystemControl SystemControl { get; private set; }
|
public ISystemControl SystemControl { get; private set; }
|
||||||
|
|
||||||
|
//IroutingNumericEvent
|
||||||
|
public event EventHandler<RoutingNumericEventArgs> NumericSwitchChange;
|
||||||
|
|
||||||
// Feedbacks for EssentialDM
|
// Feedbacks for EssentialDM
|
||||||
public Dictionary<uint, IntFeedback> VideoOutputFeedbacks { get; private set; }
|
public Dictionary<uint, IntFeedback> VideoOutputFeedbacks { get; private set; }
|
||||||
public Dictionary<uint, IntFeedback> AudioOutputFeedbacks { get; private set; }
|
public Dictionary<uint, IntFeedback> AudioOutputFeedbacks { get; private set; }
|
||||||
@@ -56,11 +59,23 @@ namespace PepperDash.Essentials.DM
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public string NoRouteText = "";
|
public string NoRouteText = "";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Raise an event when the status of a switch object changes.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="e">Arguments defined as IKeyName sender, output, input, and eRoutingSignalType</param>
|
||||||
|
private void OnSwitchChange(RoutingNumericEventArgs e)
|
||||||
|
{
|
||||||
|
var newEvent = NumericSwitchChange;
|
||||||
|
if (newEvent != null) newEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public static DmpsRoutingController GetDmpsRoutingController(string key, string name,
|
public static DmpsRoutingController GetDmpsRoutingController(string key, string name,
|
||||||
DmpsRoutingPropertiesConfig properties)
|
DmpsRoutingPropertiesConfig properties)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
||||||
ISystemControl systemControl = null;
|
ISystemControl systemControl = null;
|
||||||
|
|
||||||
systemControl = Global.ControlSystem.SystemControl as ISystemControl;
|
systemControl = Global.ControlSystem.SystemControl as ISystemControl;
|
||||||
@@ -120,6 +135,9 @@ namespace PepperDash.Essentials.DM
|
|||||||
Debug.Console(1, this, "{0} Switcher Inputs Present.", Dmps.SwitcherInputs.Count);
|
Debug.Console(1, this, "{0} Switcher Inputs Present.", Dmps.SwitcherInputs.Count);
|
||||||
Debug.Console(1, this, "{0} Switcher Outputs Present.", Dmps.SwitcherOutputs.Count);
|
Debug.Console(1, this, "{0} Switcher Outputs Present.", Dmps.SwitcherOutputs.Count);
|
||||||
|
|
||||||
|
Debug.Console(1, this, "{0} Inputs in ControlSystem", Dmps.NumberOfSwitcherInputs);
|
||||||
|
Debug.Console(1, this, "{0} Outputs in ControlSystem", Dmps.NumberOfSwitcherOutputs);
|
||||||
|
|
||||||
SetupOutputCards();
|
SetupOutputCards();
|
||||||
|
|
||||||
SetupInputCards();
|
SetupInputCards();
|
||||||
@@ -128,30 +146,48 @@ namespace PepperDash.Essentials.DM
|
|||||||
public override bool CustomActivate()
|
public override bool CustomActivate()
|
||||||
{
|
{
|
||||||
// Set input and output names from config
|
// Set input and output names from config
|
||||||
if (InputNames != null)
|
SetInputNames();
|
||||||
{
|
|
||||||
foreach (var kvp in InputNames)
|
SetOutputNames();
|
||||||
{
|
|
||||||
var input = (Dmps.SwitcherInputs[kvp.Key] as DMInput);
|
// Subscribe to events
|
||||||
if (input != null)
|
Dmps.DMInputChange += Dmps_DMInputChange;
|
||||||
input.Name.StringValue = kvp.Value;
|
Dmps.DMOutputChange += Dmps_DMOutputChange;
|
||||||
|
|
||||||
|
return base.CustomActivate();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (OutputNames != null)
|
private void SetOutputNames()
|
||||||
{
|
{
|
||||||
|
if (OutputNames == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
foreach (var kvp in OutputNames)
|
foreach (var kvp in OutputNames)
|
||||||
{
|
{
|
||||||
var output = (Dmps.SwitcherOutputs[kvp.Key] as DMOutput);
|
var output = (Dmps.SwitcherOutputs[kvp.Key] as DMOutput);
|
||||||
if (output != null)
|
if (output != null && output.Name.Type != eSigType.NA)
|
||||||
|
{
|
||||||
output.Name.StringValue = kvp.Value;
|
output.Name.StringValue = kvp.Value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Subscribe to events
|
private void SetInputNames()
|
||||||
Dmps.DMInputChange += new DMInputEventHandler(Dmps_DMInputChange);
|
{
|
||||||
Dmps.DMOutputChange += new DMOutputEventHandler(Dmps_DMOutputChange);
|
if (InputNames == null)
|
||||||
|
{
|
||||||
return base.CustomActivate();
|
return;
|
||||||
|
}
|
||||||
|
foreach (var kvp in InputNames)
|
||||||
|
{
|
||||||
|
var input = (Dmps.SwitcherInputs[kvp.Key] as DMInput);
|
||||||
|
if (input != null && input.Name.Type != eSigType.NA)
|
||||||
|
{
|
||||||
|
input.Name.StringValue = kvp.Value;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
||||||
@@ -175,53 +211,14 @@ namespace PepperDash.Essentials.DM
|
|||||||
Debug.Console(1, this, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
Debug.Console(1, this, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
||||||
|
|
||||||
// Link up outputs
|
// Link up outputs
|
||||||
for (uint i = 1; i <= Dmps.NumberOfSwitcherInputs; i++)
|
LinkInputsToApi(trilist, joinMap);
|
||||||
{
|
|
||||||
Debug.Console(2, this, "Linking Input Card {0}", i);
|
|
||||||
|
|
||||||
var ioSlot = i;
|
LinkOutputsToApi(trilist, joinMap);
|
||||||
var ioSlotJoin = ioSlot - 1;
|
|
||||||
|
|
||||||
//if (TxDictionary.ContainsKey(ioSlot))
|
|
||||||
//{
|
|
||||||
// Debug.Console(2, "Creating Tx Feedbacks {0}", ioSlot);
|
|
||||||
// var TxKey = TxDictionary[ioSlot];
|
|
||||||
// var TxDevice = DeviceManager.GetDeviceForKey(TxKey) as DmTxControllerBase;
|
|
||||||
// //TxDevice.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.InputEndpointOnline + ioSlot]);
|
|
||||||
// // TxDevice.AnyVideoInput.VideoStatus.VideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.InputEndpointOnline + ioSlot]);
|
|
||||||
// // trilist.SetUShortSigAction((ApiMap.HdcpSupport[ioSlot]), u => TxDevice.SetHdcpSupportAll((ePdtHdcpSupport)(u)));
|
|
||||||
// // TxDevice.HdcpSupportAllFeedback.LinkInputSig(trilist.UShortInput[joinMap. + ioSlot]);
|
|
||||||
// // trilist.UShortInput[ApiMap.HdcpSupportCapability[ioSlot]].UShortValue = TxDevice.HdcpSupportCapability;
|
|
||||||
//}
|
|
||||||
//else
|
|
||||||
//{
|
|
||||||
// // dmChassis.VideoInputSyncFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[ApiMap.TxVideoSyncStatus[ioSlot]]);
|
|
||||||
//}
|
|
||||||
|
|
||||||
if (VideoInputSyncFeedbacks[ioSlot] != null)
|
|
||||||
VideoInputSyncFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.VideoSyncStatus.JoinNumber + ioSlotJoin]);
|
|
||||||
|
|
||||||
if (InputNameFeedbacks[ioSlot] != null)
|
|
||||||
InputNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.InputNames.JoinNumber + ioSlotJoin]);
|
|
||||||
|
|
||||||
trilist.SetStringSigAction(joinMap.InputNames.JoinNumber + ioSlotJoin, new Action<string>(s =>
|
|
||||||
{
|
|
||||||
var inputCard = Dmps.SwitcherInputs[ioSlot] as DMInput;
|
|
||||||
|
|
||||||
if (inputCard != null)
|
|
||||||
{
|
|
||||||
if (inputCard.NameFeedback != null && !string.IsNullOrEmpty(inputCard.NameFeedback.StringValue) && inputCard.NameFeedback.StringValue != s)
|
|
||||||
if (inputCard.Name != null)
|
|
||||||
inputCard.Name.StringValue = s;
|
|
||||||
}
|
|
||||||
}));
|
|
||||||
|
|
||||||
|
|
||||||
if (InputEndpointOnlineFeedbacks[ioSlot] != null)
|
|
||||||
InputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.InputEndpointOnline.JoinNumber + ioSlotJoin]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (uint i = 1; i <= Dmps.NumberOfSwitcherOutputs; i++)
|
private void LinkOutputsToApi(BasicTriList trilist, DmpsRoutingControllerJoinMap joinMap)
|
||||||
|
{
|
||||||
|
for (uint i = 1; i <= Dmps.SwitcherOutputs.Count; i++)
|
||||||
{
|
{
|
||||||
Debug.Console(2, this, "Linking Output Card {0}", i);
|
Debug.Console(2, this, "Linking Output Card {0}", i);
|
||||||
|
|
||||||
@@ -229,8 +226,10 @@ namespace PepperDash.Essentials.DM
|
|||||||
var ioSlotJoin = ioSlot - 1;
|
var ioSlotJoin = ioSlot - 1;
|
||||||
|
|
||||||
// Control
|
// Control
|
||||||
trilist.SetUShortSigAction(joinMap.OutputVideo.JoinNumber + ioSlotJoin, o => ExecuteSwitch(o, ioSlot, eRoutingSignalType.Video));
|
trilist.SetUShortSigAction(joinMap.OutputVideo.JoinNumber + ioSlotJoin,
|
||||||
trilist.SetUShortSigAction(joinMap.OutputAudio.JoinNumber + ioSlotJoin, o => ExecuteSwitch(o, ioSlot, eRoutingSignalType.Audio));
|
o => ExecuteSwitch(o, ioSlot, eRoutingSignalType.Video));
|
||||||
|
trilist.SetUShortSigAction(joinMap.OutputAudio.JoinNumber + ioSlotJoin,
|
||||||
|
o => ExecuteSwitch(o, ioSlot, eRoutingSignalType.Audio));
|
||||||
|
|
||||||
trilist.SetStringSigAction(joinMap.OutputNames.JoinNumber + ioSlotJoin, s =>
|
trilist.SetStringSigAction(joinMap.OutputNames.JoinNumber + ioSlotJoin, s =>
|
||||||
{
|
{
|
||||||
@@ -238,38 +237,106 @@ namespace PepperDash.Essentials.DM
|
|||||||
|
|
||||||
//Debug.Console(2, dmpsRouter, "Output Name String Sig Action for Output Card {0}", ioSlot);
|
//Debug.Console(2, dmpsRouter, "Output Name String Sig Action for Output Card {0}", ioSlot);
|
||||||
|
|
||||||
if (outputCard != null)
|
if (outputCard == null)
|
||||||
{
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
//Debug.Console(2, dmpsRouter, "Card Type: {0}", outputCard.CardInputOutputType);
|
//Debug.Console(2, dmpsRouter, "Card Type: {0}", outputCard.CardInputOutputType);
|
||||||
|
|
||||||
if (!(outputCard is Card.Dmps3CodecOutput) && outputCard.NameFeedback != null)
|
if (outputCard is Card.Dmps3CodecOutput || outputCard.NameFeedback == null)
|
||||||
{
|
{
|
||||||
if (!string.IsNullOrEmpty(outputCard.NameFeedback.StringValue))
|
return;
|
||||||
|
}
|
||||||
|
if (string.IsNullOrEmpty(outputCard.NameFeedback.StringValue))
|
||||||
{
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
//Debug.Console(2, dmpsRouter, "NameFeedabck: {0}", outputCard.NameFeedback.StringValue);
|
//Debug.Console(2, dmpsRouter, "NameFeedabck: {0}", outputCard.NameFeedback.StringValue);
|
||||||
|
|
||||||
if (outputCard.NameFeedback.StringValue != s && outputCard.Name != null)
|
if (outputCard.NameFeedback.StringValue != s && outputCard.Name != null)
|
||||||
{
|
{
|
||||||
outputCard.Name.StringValue = s;
|
outputCard.Name.StringValue = s;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// Feedback
|
// Feedback
|
||||||
if (VideoOutputFeedbacks[ioSlot] != null)
|
if (VideoOutputFeedbacks[ioSlot] != null)
|
||||||
|
{
|
||||||
VideoOutputFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.OutputVideo.JoinNumber + ioSlotJoin]);
|
VideoOutputFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.OutputVideo.JoinNumber + ioSlotJoin]);
|
||||||
|
}
|
||||||
if (AudioOutputFeedbacks[ioSlot] != null)
|
if (AudioOutputFeedbacks[ioSlot] != null)
|
||||||
|
{
|
||||||
AudioOutputFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.OutputAudio.JoinNumber + ioSlotJoin]);
|
AudioOutputFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.OutputAudio.JoinNumber + ioSlotJoin]);
|
||||||
|
}
|
||||||
if (OutputNameFeedbacks[ioSlot] != null)
|
if (OutputNameFeedbacks[ioSlot] != null)
|
||||||
|
{
|
||||||
OutputNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputNames.JoinNumber + ioSlotJoin]);
|
OutputNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputNames.JoinNumber + ioSlotJoin]);
|
||||||
|
}
|
||||||
if (OutputVideoRouteNameFeedbacks[ioSlot] != null)
|
if (OutputVideoRouteNameFeedbacks[ioSlot] != null)
|
||||||
OutputVideoRouteNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputCurrentVideoInputNames.JoinNumber + ioSlotJoin]);
|
{
|
||||||
|
OutputVideoRouteNameFeedbacks[ioSlot].LinkInputSig(
|
||||||
|
trilist.StringInput[joinMap.OutputCurrentVideoInputNames.JoinNumber + ioSlotJoin]);
|
||||||
|
}
|
||||||
if (OutputAudioRouteNameFeedbacks[ioSlot] != null)
|
if (OutputAudioRouteNameFeedbacks[ioSlot] != null)
|
||||||
OutputAudioRouteNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputCurrentAudioInputNames.JoinNumber + ioSlotJoin]);
|
{
|
||||||
|
OutputAudioRouteNameFeedbacks[ioSlot].LinkInputSig(
|
||||||
|
trilist.StringInput[joinMap.OutputCurrentAudioInputNames.JoinNumber + ioSlotJoin]);
|
||||||
|
}
|
||||||
if (OutputEndpointOnlineFeedbacks[ioSlot] != null)
|
if (OutputEndpointOnlineFeedbacks[ioSlot] != null)
|
||||||
OutputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.OutputEndpointOnline.JoinNumber + ioSlotJoin]);
|
{
|
||||||
|
OutputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(
|
||||||
|
trilist.BooleanInput[joinMap.OutputEndpointOnline.JoinNumber + ioSlotJoin]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void LinkInputsToApi(BasicTriList trilist, DmpsRoutingControllerJoinMap joinMap)
|
||||||
|
{
|
||||||
|
for (uint i = 1; i <= Dmps.SwitcherInputs.Count; i++)
|
||||||
|
{
|
||||||
|
Debug.Console(2, this, "Linking Input Card {0}", i);
|
||||||
|
|
||||||
|
var ioSlot = i;
|
||||||
|
var ioSlotJoin = ioSlot - 1;
|
||||||
|
|
||||||
|
if (VideoInputSyncFeedbacks[ioSlot] != null)
|
||||||
|
{
|
||||||
|
VideoInputSyncFeedbacks[ioSlot].LinkInputSig(
|
||||||
|
trilist.BooleanInput[joinMap.VideoSyncStatus.JoinNumber + ioSlotJoin]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (InputNameFeedbacks[ioSlot] != null)
|
||||||
|
{
|
||||||
|
InputNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.InputNames.JoinNumber + ioSlotJoin]);
|
||||||
|
}
|
||||||
|
|
||||||
|
trilist.SetStringSigAction(joinMap.InputNames.JoinNumber + ioSlotJoin, s =>
|
||||||
|
{
|
||||||
|
var inputCard = Dmps.SwitcherInputs[ioSlot] as DMInput;
|
||||||
|
|
||||||
|
if (inputCard == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (inputCard.NameFeedback == null || string.IsNullOrEmpty(inputCard.NameFeedback.StringValue) ||
|
||||||
|
inputCard.NameFeedback.StringValue == s)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (inputCard.Name != null)
|
||||||
|
{
|
||||||
|
inputCard.Name.StringValue = s;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
if (InputEndpointOnlineFeedbacks[ioSlot] != null)
|
||||||
|
{
|
||||||
|
InputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(
|
||||||
|
trilist.BooleanInput[joinMap.InputEndpointOnline.JoinNumber + ioSlotJoin]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -281,22 +348,37 @@ namespace PepperDash.Essentials.DM
|
|||||||
{
|
{
|
||||||
foreach (var card in Dmps.SwitcherOutputs)
|
foreach (var card in Dmps.SwitcherOutputs)
|
||||||
{
|
{
|
||||||
|
Debug.Console(1, this, "Output Card Type: {0}", card.CardInputOutputType);
|
||||||
|
|
||||||
var outputCard = card as DMOutput;
|
var outputCard = card as DMOutput;
|
||||||
|
|
||||||
Debug.Console(1, this, "Adding Output Card Number {0} Type: {1}", outputCard.Number, outputCard.CardInputOutputType.ToString());
|
if (outputCard == null)
|
||||||
|
|
||||||
if (outputCard != null)
|
|
||||||
{
|
{
|
||||||
|
Debug.Console(1, this, "Output card {0} is not a DMOutput", card.CardInputOutputType);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
Debug.Console(1, this, "Adding Output Card Number {0} Type: {1}", outputCard.Number, outputCard.CardInputOutputType.ToString());
|
||||||
VideoOutputFeedbacks[outputCard.Number] = new IntFeedback(() =>
|
VideoOutputFeedbacks[outputCard.Number] = new IntFeedback(() =>
|
||||||
{
|
{
|
||||||
if (outputCard.VideoOutFeedback != null) { return (ushort)outputCard.VideoOutFeedback.Number; }
|
if (outputCard.VideoOutFeedback != null) { return (ushort)outputCard.VideoOutFeedback.Number; }
|
||||||
else { return 0; };
|
return 0;
|
||||||
|
;
|
||||||
});
|
});
|
||||||
AudioOutputFeedbacks[outputCard.Number] = new IntFeedback(() =>
|
AudioOutputFeedbacks[outputCard.Number] = new IntFeedback(() =>
|
||||||
{
|
{
|
||||||
if (outputCard.AudioOutFeedback != null) { return (ushort)outputCard.AudioOutFeedback.Number; }
|
try
|
||||||
else { return 0; };
|
{
|
||||||
|
if (outputCard.AudioOutFeedback != null)
|
||||||
|
{
|
||||||
|
return (ushort) outputCard.AudioOutFeedback.Number;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
catch (NotSupportedException)
|
||||||
|
{
|
||||||
|
return (ushort) outputCard.AudioOutSourceFeedback;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
OutputNameFeedbacks[outputCard.Number] = new StringFeedback(() =>
|
OutputNameFeedbacks[outputCard.Number] = new StringFeedback(() =>
|
||||||
@@ -306,10 +388,7 @@ namespace PepperDash.Essentials.DM
|
|||||||
Debug.Console(2, this, "Output Card {0} Name: {1}", outputCard.Number, outputCard.NameFeedback.StringValue);
|
Debug.Console(2, this, "Output Card {0} Name: {1}", outputCard.Number, outputCard.NameFeedback.StringValue);
|
||||||
return outputCard.NameFeedback.StringValue;
|
return outputCard.NameFeedback.StringValue;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
return "";
|
return "";
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
OutputVideoRouteNameFeedbacks[outputCard.Number] = new StringFeedback(() =>
|
OutputVideoRouteNameFeedbacks[outputCard.Number] = new StringFeedback(() =>
|
||||||
@@ -318,10 +397,7 @@ namespace PepperDash.Essentials.DM
|
|||||||
{
|
{
|
||||||
return outputCard.VideoOutFeedback.NameFeedback.StringValue;
|
return outputCard.VideoOutFeedback.NameFeedback.StringValue;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
return NoRouteText;
|
return NoRouteText;
|
||||||
}
|
|
||||||
});
|
});
|
||||||
OutputAudioRouteNameFeedbacks[outputCard.Number] = new StringFeedback(() =>
|
OutputAudioRouteNameFeedbacks[outputCard.Number] = new StringFeedback(() =>
|
||||||
{
|
{
|
||||||
@@ -329,19 +405,14 @@ namespace PepperDash.Essentials.DM
|
|||||||
{
|
{
|
||||||
return outputCard.AudioOutFeedback.NameFeedback.StringValue;
|
return outputCard.AudioOutFeedback.NameFeedback.StringValue;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
return NoRouteText;
|
return NoRouteText;
|
||||||
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
OutputEndpointOnlineFeedbacks[outputCard.Number] = new BoolFeedback(() => { return outputCard.EndpointOnlineFeedback; });
|
OutputEndpointOnlineFeedbacks[outputCard.Number] = new BoolFeedback(() => outputCard.EndpointOnlineFeedback);
|
||||||
|
|
||||||
AddOutputCard(outputCard.Number, outputCard);
|
AddOutputCard(outputCard.Number, outputCard);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Iterate the SwitcherInputs collection to setup feedbacks and add routing ports
|
/// Iterate the SwitcherInputs collection to setup feedbacks and add routing ports
|
||||||
@@ -457,11 +528,16 @@ namespace PepperDash.Essentials.DM
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Adds InputPort
|
/// Adds InputPort
|
||||||
/// </summary>
|
/// </summary>
|
||||||
void AddInputPortWithDebug(uint cardNum, string portName, eRoutingSignalType sigType, eRoutingPortConnectionType portType)
|
private void AddInputPortWithDebug(uint cardNum, string portName, eRoutingSignalType sigType,
|
||||||
|
eRoutingPortConnectionType portType)
|
||||||
{
|
{
|
||||||
var portKey = string.Format("inputCard{0}--{1}", cardNum, portName);
|
var portKey = string.Format("inputCard{0}--{1}", cardNum, portName);
|
||||||
Debug.Console(2, this, "Adding input port '{0}'", portKey);
|
Debug.Console(2, this, "Adding input port '{0}'", portKey);
|
||||||
var inputPort = new RoutingInputPort(portKey, sigType, portType, cardNum, this);
|
var inputPort = new RoutingInputPort(portKey, sigType, portType, cardNum, this)
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = Dmps.SwitcherInputs[cardNum]
|
||||||
|
};
|
||||||
|
;
|
||||||
|
|
||||||
InputPorts.Add(inputPort);
|
InputPorts.Add(inputPort);
|
||||||
}
|
}
|
||||||
@@ -473,7 +549,11 @@ namespace PepperDash.Essentials.DM
|
|||||||
{
|
{
|
||||||
var portKey = string.Format("inputCard{0}--{1}", cardNum, portName);
|
var portKey = string.Format("inputCard{0}--{1}", cardNum, portName);
|
||||||
Debug.Console(2, this, "Adding input port '{0}'", portKey);
|
Debug.Console(2, this, "Adding input port '{0}'", portKey);
|
||||||
var inputPort = new RoutingInputPort(portKey, sigType, portType, cardNum, this);
|
var inputPort = new RoutingInputPort(portKey, sigType, portType, cardNum, this)
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = Dmps.SwitcherInputs[cardNum]
|
||||||
|
};
|
||||||
|
;
|
||||||
|
|
||||||
if (cecPort != null)
|
if (cecPort != null)
|
||||||
inputPort.Port = cecPort;
|
inputPort.Port = cecPort;
|
||||||
@@ -481,6 +561,7 @@ namespace PepperDash.Essentials.DM
|
|||||||
InputPorts.Add(inputPort);
|
InputPorts.Add(inputPort);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Builds the appropriate ports and calls the appropriate add port method
|
/// Builds the appropriate ports and calls the appropriate add port method
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -495,17 +576,22 @@ namespace PepperDash.Essentials.DM
|
|||||||
var cecPort = hdmiOutputCard.HdmiOutputPort;
|
var cecPort = hdmiOutputCard.HdmiOutputPort;
|
||||||
|
|
||||||
AddHdmiOutputPort(number, cecPort);
|
AddHdmiOutputPort(number, cecPort);
|
||||||
|
}
|
||||||
|
else if (outputCard is Card.Dmps3HdmiOutputBackend)
|
||||||
|
{
|
||||||
|
var hdmiOutputCard = outputCard as Card.Dmps3HdmiOutputBackend;
|
||||||
|
|
||||||
return;
|
var cecPort = hdmiOutputCard.HdmiOutputPort;
|
||||||
|
|
||||||
|
AddHdmiOutputPort(number, cecPort);
|
||||||
}
|
}
|
||||||
else if (outputCard is Card.Dmps3DmOutput)
|
else if (outputCard is Card.Dmps3DmOutput)
|
||||||
{
|
{
|
||||||
var dmOutputCard = outputCard as Card.Dmps3DmOutput;
|
|
||||||
|
|
||||||
var cecPort = dmOutputCard.DmOutputPort;
|
|
||||||
|
|
||||||
AddDmOutputPort(number);
|
AddDmOutputPort(number);
|
||||||
return;
|
}
|
||||||
|
else if (outputCard is Card.Dmps3DmOutputBackend)
|
||||||
|
{
|
||||||
|
AddDmOutputPort(number);
|
||||||
}
|
}
|
||||||
else if (outputCard is Card.Dmps3ProgramOutput)
|
else if (outputCard is Card.Dmps3ProgramOutput)
|
||||||
{
|
{
|
||||||
@@ -514,12 +600,12 @@ namespace PepperDash.Essentials.DM
|
|||||||
var programOutput = new DmpsAudioOutputController(string.Format("processor-programAudioOutput"), "Program Audio Output", outputCard as Card.Dmps3OutputBase);
|
var programOutput = new DmpsAudioOutputController(string.Format("processor-programAudioOutput"), "Program Audio Output", outputCard as Card.Dmps3OutputBase);
|
||||||
|
|
||||||
DeviceManager.AddDevice(programOutput);
|
DeviceManager.AddDevice(programOutput);
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
else if (outputCard is Card.Dmps3AuxOutput)
|
else if (outputCard is Card.Dmps3AuxOutput)
|
||||||
{
|
{
|
||||||
if (outputCard.CardInputOutputType == eCardInputOutputType.Dmps3Aux1Output)
|
switch (outputCard.CardInputOutputType)
|
||||||
|
{
|
||||||
|
case eCardInputOutputType.Dmps3Aux1Output:
|
||||||
{
|
{
|
||||||
AddAudioOnlyOutputPort(number, "Aux1");
|
AddAudioOnlyOutputPort(number, "Aux1");
|
||||||
|
|
||||||
@@ -527,7 +613,8 @@ namespace PepperDash.Essentials.DM
|
|||||||
|
|
||||||
DeviceManager.AddDevice(aux1Output);
|
DeviceManager.AddDevice(aux1Output);
|
||||||
}
|
}
|
||||||
else if (outputCard.CardInputOutputType == eCardInputOutputType.Dmps3Aux2Output)
|
break;
|
||||||
|
case eCardInputOutputType.Dmps3Aux2Output:
|
||||||
{
|
{
|
||||||
AddAudioOnlyOutputPort(number, "Aux2");
|
AddAudioOnlyOutputPort(number, "Aux2");
|
||||||
|
|
||||||
@@ -535,28 +622,28 @@ namespace PepperDash.Essentials.DM
|
|||||||
|
|
||||||
DeviceManager.AddDevice(aux2Output);
|
DeviceManager.AddDevice(aux2Output);
|
||||||
}
|
}
|
||||||
return;
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (outputCard is Card.Dmps3CodecOutput)
|
else if (outputCard is Card.Dmps3CodecOutput)
|
||||||
{
|
{
|
||||||
if (number == (uint)CrestronControlSystem.eDmps300cOutputs.Codec1
|
switch (number)
|
||||||
|| number == (uint)CrestronControlSystem.eDmps3200cOutputs.Codec1
|
{
|
||||||
|| number == (uint)CrestronControlSystem.eDmps3300cAecOutputs.Codec1
|
case (uint)CrestronControlSystem.eDmps34K350COutputs.Codec1:
|
||||||
|| number == (uint)CrestronControlSystem.eDmps34K250COutputs.Codec1
|
case (uint)CrestronControlSystem.eDmps34K250COutputs.Codec1:
|
||||||
|| number == (uint)CrestronControlSystem.eDmps34K350COutputs.Codec1)
|
case (uint)CrestronControlSystem.eDmps3300cAecOutputs.Codec1:
|
||||||
AddAudioOnlyOutputPort(number, CrestronControlSystem.eDmps300cOutputs.Codec1.ToString());
|
AddAudioOnlyOutputPort(number, CrestronControlSystem.eDmps300cOutputs.Codec1.ToString());
|
||||||
else if (number == (uint)CrestronControlSystem.eDmps300cOutputs.Codec2
|
break;
|
||||||
|| number == (uint)CrestronControlSystem.eDmps3200cOutputs.Codec2
|
case (uint)CrestronControlSystem.eDmps34K350COutputs.Codec2:
|
||||||
|| number == (uint)CrestronControlSystem.eDmps3300cAecOutputs.Codec2
|
case (uint)CrestronControlSystem.eDmps34K250COutputs.Codec2:
|
||||||
|| number == (uint)CrestronControlSystem.eDmps34K250COutputs.Codec2
|
case (uint)CrestronControlSystem.eDmps3300cAecOutputs.Codec2:
|
||||||
|| number == (uint)CrestronControlSystem.eDmps34K350COutputs.Codec2)
|
|
||||||
AddAudioOnlyOutputPort(number, CrestronControlSystem.eDmps300cOutputs.Codec2.ToString());
|
AddAudioOnlyOutputPort(number, CrestronControlSystem.eDmps300cOutputs.Codec2.ToString());
|
||||||
return;
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (outputCard is Card.Dmps3DialerOutput)
|
else if (outputCard is Card.Dmps3DialerOutput)
|
||||||
{
|
{
|
||||||
AddAudioOnlyOutputPort(number, "Dialer");
|
AddAudioOnlyOutputPort(number, "Dialer");
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
else if (outputCard is Card.Dmps3DigitalMixOutput)
|
else if (outputCard is Card.Dmps3DigitalMixOutput)
|
||||||
{
|
{
|
||||||
@@ -568,12 +655,10 @@ namespace PepperDash.Essentials.DM
|
|||||||
|| number == (uint)CrestronControlSystem.eDmps34K300COutputs.Mix2
|
|| number == (uint)CrestronControlSystem.eDmps34K300COutputs.Mix2
|
||||||
|| number == (uint)CrestronControlSystem.eDmps34K350COutputs.Mix2)
|
|| number == (uint)CrestronControlSystem.eDmps34K350COutputs.Mix2)
|
||||||
AddAudioOnlyOutputPort(number, CrestronControlSystem.eDmps34K250COutputs.Mix2.ToString());
|
AddAudioOnlyOutputPort(number, CrestronControlSystem.eDmps34K250COutputs.Mix2.ToString());
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
else if (outputCard is Card.Dmps3AecOutput)
|
else if (outputCard is Card.Dmps3AecOutput)
|
||||||
{
|
{
|
||||||
AddAudioOnlyOutputPort(number, "Aec");
|
AddAudioOnlyOutputPort(number, "Aec");
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -616,7 +701,10 @@ namespace PepperDash.Essentials.DM
|
|||||||
{
|
{
|
||||||
var portKey = string.Format("outputCard{0}--{1}", cardNum, portName);
|
var portKey = string.Format("outputCard{0}--{1}", cardNum, portName);
|
||||||
Debug.Console(2, this, "Adding output port '{0}'", portKey);
|
Debug.Console(2, this, "Adding output port '{0}'", portKey);
|
||||||
OutputPorts.Add(new RoutingOutputPort(portKey, sigType, portType, selector, this));
|
OutputPorts.Add(new RoutingOutputPort(portKey, sigType, portType, selector, this)
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = Dmps.SwitcherOutputs[cardNum]
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -626,7 +714,10 @@ namespace PepperDash.Essentials.DM
|
|||||||
{
|
{
|
||||||
var portKey = string.Format("outputCard{0}--{1}", cardNum, portName);
|
var portKey = string.Format("outputCard{0}--{1}", cardNum, portName);
|
||||||
Debug.Console(2, this, "Adding output port '{0}'", portKey);
|
Debug.Console(2, this, "Adding output port '{0}'", portKey);
|
||||||
var outputPort = new RoutingOutputPort(portKey, sigType, portType, selector, this);
|
var outputPort = new RoutingOutputPort(portKey, sigType, portType, selector, this)
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = Dmps.SwitcherOutputs[cardNum]
|
||||||
|
};
|
||||||
|
|
||||||
if (cecPort != null)
|
if (cecPort != null)
|
||||||
outputPort.Port = cecPort;
|
outputPort.Port = cecPort;
|
||||||
@@ -702,16 +793,32 @@ namespace PepperDash.Essentials.DM
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (args.EventId == DMOutputEventIds.AudioOutEventId)
|
else if (args.EventId == DMOutputEventIds.AudioOutEventId)
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
if (outputCard != null && outputCard.AudioOutFeedback != null)
|
if (outputCard != null && outputCard.AudioOutFeedback != null)
|
||||||
{
|
{
|
||||||
Debug.Console(2, this, "DMSwitchAudio:{0} Routed Input:{1} Output:{2}'", this.Name, outputCard.AudioOutFeedback.Number, output);
|
Debug.Console(2, this, "DMSwitchAudio:{0} Routed Input:{1} Output:{2}'", this.Name,
|
||||||
|
outputCard.AudioOutFeedback.Number, output);
|
||||||
}
|
}
|
||||||
if (AudioOutputFeedbacks.ContainsKey(output))
|
if (AudioOutputFeedbacks.ContainsKey(output))
|
||||||
{
|
{
|
||||||
AudioOutputFeedbacks[output].FireUpdate();
|
AudioOutputFeedbacks[output].FireUpdate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch (NotSupportedException)
|
||||||
|
{
|
||||||
|
if (outputCard != null)
|
||||||
|
{
|
||||||
|
Debug.Console(2, this, "DMSwitchAudio:{0} Routed Input:{1} Output:{2}'", Name,
|
||||||
|
outputCard.AudioOutSourceFeedback, output);
|
||||||
|
}
|
||||||
|
if (AudioOutputFeedbacks.ContainsKey(output))
|
||||||
|
{
|
||||||
|
AudioOutputFeedbacks[output].FireUpdate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
else if (args.EventId == DMOutputEventIds.OutputNameEventId
|
else if (args.EventId == DMOutputEventIds.OutputNameEventId
|
||||||
&& OutputNameFeedbacks.ContainsKey(output))
|
&& OutputNameFeedbacks.ContainsKey(output))
|
||||||
{
|
{
|
||||||
@@ -744,7 +851,14 @@ namespace PepperDash.Essentials.DM
|
|||||||
var input = Convert.ToUInt32(inputSelector); // Cast can sometimes fail
|
var input = Convert.ToUInt32(inputSelector); // Cast can sometimes fail
|
||||||
var output = Convert.ToUInt32(outputSelector);
|
var output = Convert.ToUInt32(outputSelector);
|
||||||
|
|
||||||
if (input <= Dmps.NumberOfSwitcherInputs && output <= Dmps.NumberOfSwitcherOutputs)
|
var sigTypeIsUsbOrVideo = ((sigType & eRoutingSignalType.Video) == eRoutingSignalType.Video) ||
|
||||||
|
((sigType & eRoutingSignalType.UsbInput) == eRoutingSignalType.UsbInput) ||
|
||||||
|
((sigType & eRoutingSignalType.UsbOutput) == eRoutingSignalType.UsbOutput);
|
||||||
|
|
||||||
|
if ((input <= Dmps.NumberOfSwitcherInputs && output <= Dmps.NumberOfSwitcherOutputs &&
|
||||||
|
sigTypeIsUsbOrVideo) ||
|
||||||
|
(input <= Dmps.NumberOfSwitcherInputs + 5 && output <= Dmps.NumberOfSwitcherOutputs &&
|
||||||
|
(sigType & eRoutingSignalType.Audio) == eRoutingSignalType.Audio))
|
||||||
{
|
{
|
||||||
// Check to see if there's an off timer waiting on this and if so, cancel
|
// Check to see if there's an off timer waiting on this and if so, cancel
|
||||||
var key = new PortNumberType(output, sigType);
|
var key = new PortNumberType(output, sigType);
|
||||||
@@ -762,36 +876,54 @@ namespace PepperDash.Essentials.DM
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DMInput inCard = input == 0 ? null : Dmps.SwitcherInputs[input] as DMInput;
|
|
||||||
DMOutput outCard = output == 0 ? null : Dmps.SwitcherOutputs[output] as DMOutput;
|
DMOutput dmOutputCard = output == 0 ? null : Dmps.SwitcherOutputs[output] as DMOutput;
|
||||||
|
|
||||||
//if (inCard != null)
|
//if (inCard != null)
|
||||||
//{
|
//{
|
||||||
// NOTE THAT BITWISE COMPARISONS - TO CATCH ALL ROUTING TYPES
|
// NOTE THAT BITWISE COMPARISONS - TO CATCH ALL ROUTING TYPES
|
||||||
if ((sigType | eRoutingSignalType.Video) == eRoutingSignalType.Video)
|
if ((sigType & eRoutingSignalType.Video) == eRoutingSignalType.Video)
|
||||||
{
|
{
|
||||||
|
DMInput dmInputCard = input == 0 ? null : Dmps.SwitcherInputs[input] as DMInput;
|
||||||
//SystemControl.VideoEnter.BoolValue = true;
|
//SystemControl.VideoEnter.BoolValue = true;
|
||||||
if (outCard != null)
|
if (dmOutputCard != null)
|
||||||
outCard.VideoOut = inCard;
|
dmOutputCard.VideoOut = dmInputCard;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((sigType | eRoutingSignalType.Audio) == eRoutingSignalType.Audio)
|
if ((sigType & eRoutingSignalType.Audio) == eRoutingSignalType.Audio)
|
||||||
{
|
{
|
||||||
if (outCard != null)
|
DMInput dmInputCard = null;
|
||||||
outCard.AudioOut = inCard;
|
if (input <= Dmps.NumberOfSwitcherInputs)
|
||||||
|
{
|
||||||
|
dmInputCard = input == 0 ? null : Dmps.SwitcherInputs[input] as DMInput;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((sigType | eRoutingSignalType.UsbOutput) == eRoutingSignalType.UsbOutput)
|
if (dmOutputCard != null)
|
||||||
|
try
|
||||||
{
|
{
|
||||||
if (outCard != null)
|
dmOutputCard.AudioOut = dmInputCard;
|
||||||
outCard.USBRoutedTo = inCard;
|
}
|
||||||
|
catch (NotSupportedException)
|
||||||
|
{
|
||||||
|
Debug.Console(1, this, "Routing input {0} audio to output {1}",
|
||||||
|
(eDmps34KAudioOutSource) input, (CrestronControlSystem.eDmps34K350COutputs) output);
|
||||||
|
|
||||||
|
dmOutputCard.AudioOutSource = (eDmps34KAudioOutSource) input;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((sigType | eRoutingSignalType.UsbInput) == eRoutingSignalType.UsbInput)
|
if ((sigType & eRoutingSignalType.UsbOutput) == eRoutingSignalType.UsbOutput)
|
||||||
{
|
{
|
||||||
if (inCard != null)
|
DMInput dmInputCard = input == 0 ? null : Dmps.SwitcherInputs[input] as DMInput;
|
||||||
inCard.USBRoutedTo = outCard;
|
if (dmOutputCard != null)
|
||||||
|
dmOutputCard.USBRoutedTo = dmInputCard;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((sigType & eRoutingSignalType.UsbInput) == eRoutingSignalType.UsbInput)
|
||||||
|
{
|
||||||
|
DMInput dmInputCard = input == 0 ? null : Dmps.SwitcherInputs[input] as DMInput;
|
||||||
|
if (dmInputCard != null)
|
||||||
|
dmInputCard.USBRoutedTo = dmOutputCard;
|
||||||
}
|
}
|
||||||
//}
|
//}
|
||||||
//else
|
//else
|
||||||
@@ -802,7 +934,8 @@ namespace PepperDash.Essentials.DM
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Debug.Console(1, this, "Unable to execute route from input {0} to output {1}", inputSelector, outputSelector);
|
Debug.Console(1, this, "Unable to execute route from input {0} to output {1}", inputSelector,
|
||||||
|
outputSelector);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
|
|||||||
@@ -16,11 +16,14 @@ using PepperDash.Essentials.Core.Config;
|
|||||||
namespace PepperDash.Essentials.DM.Chassis
|
namespace PepperDash.Essentials.DM.Chassis
|
||||||
{
|
{
|
||||||
[Description("Wrapper class for all HdMdNxM4E switchers")]
|
[Description("Wrapper class for all HdMdNxM4E switchers")]
|
||||||
public class HdMdNxM4kEBridgeableController : CrestronGenericBridgeableBaseDevice, IRoutingInputsOutputs, IRoutingNumeric, IHasFeedback
|
public class HdMdNxM4kEBridgeableController : CrestronGenericBridgeableBaseDevice, IRoutingNumericWithFeedback, IHasFeedback
|
||||||
{
|
{
|
||||||
private HdMdNxM _Chassis;
|
private HdMdNxM _Chassis;
|
||||||
private HdMd4x14kE _Chassis4x1;
|
private HdMd4x14kE _Chassis4x1;
|
||||||
|
|
||||||
|
//IroutingNumericEvent
|
||||||
|
public event EventHandler<RoutingNumericEventArgs> NumericSwitchChange;
|
||||||
|
|
||||||
public Dictionary<uint, string> InputNames { get; set; }
|
public Dictionary<uint, string> InputNames { get; set; }
|
||||||
public Dictionary<uint, string> OutputNames { get; set; }
|
public Dictionary<uint, string> OutputNames { get; set; }
|
||||||
|
|
||||||
@@ -70,26 +73,34 @@ namespace PepperDash.Essentials.DM.Chassis
|
|||||||
|
|
||||||
for (uint i = 1; i <= _Chassis.NumberOfInputs; i++)
|
for (uint i = 1; i <= _Chassis.NumberOfInputs; i++)
|
||||||
{
|
{
|
||||||
var inputName = InputNames[i];
|
var index = i;
|
||||||
_Chassis.Inputs[i].Name.StringValue = inputName;
|
var inputName = InputNames[index];
|
||||||
|
_Chassis.Inputs[index].Name.StringValue = inputName;
|
||||||
|
|
||||||
InputPorts.Add(new RoutingInputPort(inputName, eRoutingSignalType.AudioVideo,
|
InputPorts.Add(new RoutingInputPort(inputName, eRoutingSignalType.AudioVideo,
|
||||||
eRoutingPortConnectionType.Hdmi, i, this));
|
eRoutingPortConnectionType.Hdmi, index, this)
|
||||||
VideoInputSyncFeedbacks.Add(new BoolFeedback(inputName, () => _Chassis.Inputs[i].VideoDetectedFeedback.BoolValue));
|
{
|
||||||
InputNameFeedbacks.Add(new StringFeedback(inputName, () => _Chassis.Inputs[i].Name.StringValue));
|
FeedbackMatchObject = _Chassis.HdmiInputs[index]
|
||||||
InputHdcpEnableFeedback.Add(new BoolFeedback(inputName, () => _Chassis.HdmiInputs[i].HdmiInputPort.HdcpSupportOnFeedback.BoolValue));
|
});
|
||||||
|
VideoInputSyncFeedbacks.Add(new BoolFeedback(inputName, () => _Chassis.Inputs[index].VideoDetectedFeedback.BoolValue));
|
||||||
|
InputNameFeedbacks.Add(new StringFeedback(inputName, () => _Chassis.Inputs[index].Name.StringValue));
|
||||||
|
InputHdcpEnableFeedback.Add(new BoolFeedback(inputName, () => _Chassis.HdmiInputs[index].HdmiInputPort.HdcpSupportOnFeedback.BoolValue));
|
||||||
}
|
}
|
||||||
|
|
||||||
for (uint i = 1; i <= _Chassis.NumberOfOutputs; i++)
|
for (uint i = 1; i <= _Chassis.NumberOfOutputs; i++)
|
||||||
{
|
{
|
||||||
var outputName = OutputNames[i];
|
var index = i;
|
||||||
|
var outputName = OutputNames[index];
|
||||||
_Chassis.Outputs[i].Name.StringValue = outputName;
|
_Chassis.Outputs[i].Name.StringValue = outputName;
|
||||||
|
|
||||||
OutputPorts.Add(new RoutingOutputPort(outputName, eRoutingSignalType.AudioVideo,
|
OutputPorts.Add(new RoutingOutputPort(outputName, eRoutingSignalType.AudioVideo,
|
||||||
eRoutingPortConnectionType.Hdmi, i, this));
|
eRoutingPortConnectionType.Hdmi, index, this)
|
||||||
VideoOutputRouteFeedbacks.Add(new IntFeedback(outputName, () => (int)_Chassis.Outputs[i].VideoOutFeedback.Number));
|
{
|
||||||
OutputNameFeedbacks.Add(new StringFeedback(outputName, () => _Chassis.Outputs[i].Name.StringValue));
|
FeedbackMatchObject = _Chassis.HdmiOutputs[index]
|
||||||
OutputRouteNameFeedbacks.Add(new StringFeedback(outputName, () => _Chassis.Outputs[i].VideoOutFeedback.NameFeedback.StringValue));
|
});
|
||||||
|
VideoOutputRouteFeedbacks.Add(new IntFeedback(outputName, () => (int)_Chassis.Outputs[index].VideoOutFeedback.Number));
|
||||||
|
OutputNameFeedbacks.Add(new StringFeedback(outputName, () => _Chassis.Outputs[index].Name.StringValue));
|
||||||
|
OutputRouteNameFeedbacks.Add(new StringFeedback(outputName, () => _Chassis.Outputs[index].VideoOutFeedback.NameFeedback.StringValue));
|
||||||
}
|
}
|
||||||
|
|
||||||
_Chassis.DMInputChange += new DMInputEventHandler(Chassis_DMInputChange);
|
_Chassis.DMInputChange += new DMInputEventHandler(Chassis_DMInputChange);
|
||||||
@@ -102,6 +113,16 @@ namespace PepperDash.Essentials.DM.Chassis
|
|||||||
|
|
||||||
#region Methods
|
#region Methods
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Raise an event when the status of a switch object changes.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="e">Arguments defined as IKeyName sender, output, input, and eRoutingSignalType</param>
|
||||||
|
private void OnSwitchChange(RoutingNumericEventArgs e)
|
||||||
|
{
|
||||||
|
var newEvent = NumericSwitchChange;
|
||||||
|
if (newEvent != null) newEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
public void EnableHdcp(uint port)
|
public void EnableHdcp(uint port)
|
||||||
{
|
{
|
||||||
if (port > _Chassis.NumberOfInputs) return;
|
if (port > _Chassis.NumberOfInputs) return;
|
||||||
@@ -328,8 +349,7 @@ namespace PepperDash.Essentials.DM.Chassis
|
|||||||
|
|
||||||
void Chassis_OnlineStatusChange(Crestron.SimplSharpPro.GenericBase currentDevice, Crestron.SimplSharpPro.OnlineOfflineEventArgs args)
|
void Chassis_OnlineStatusChange(Crestron.SimplSharpPro.GenericBase currentDevice, Crestron.SimplSharpPro.OnlineOfflineEventArgs args)
|
||||||
{
|
{
|
||||||
if (args.DeviceOnLine)
|
if (!args.DeviceOnLine) return;
|
||||||
{
|
|
||||||
for (uint i = 1; i <= _Chassis.NumberOfInputs; i++)
|
for (uint i = 1; i <= _Chassis.NumberOfInputs; i++)
|
||||||
{
|
{
|
||||||
_Chassis.Inputs[i].Name.StringValue = InputNames[i];
|
_Chassis.Inputs[i].Name.StringValue = InputNames[i];
|
||||||
@@ -345,29 +365,31 @@ namespace PepperDash.Essentials.DM.Chassis
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void Chassis_DMOutputChange(Switch device, DMOutputEventArgs args)
|
void Chassis_DMOutputChange(Switch device, DMOutputEventArgs args)
|
||||||
{
|
{
|
||||||
if (args.EventId == DMOutputEventIds.VideoOutEventId)
|
if (args.EventId != DMOutputEventIds.VideoOutEventId) return;
|
||||||
|
|
||||||
|
for (var i = 0; i < VideoOutputRouteFeedbacks.Count; i++)
|
||||||
{
|
{
|
||||||
foreach (var item in VideoOutputRouteFeedbacks)
|
var index = i;
|
||||||
{
|
var localInputPort = InputPorts.FirstOrDefault(p => (DMInput)p.FeedbackMatchObject == _Chassis.HdmiOutputs[(uint)index + 1].VideoOutFeedback);
|
||||||
item.FireUpdate();
|
var localOutputPort =
|
||||||
}
|
OutputPorts.FirstOrDefault(p => (DMOutput)p.FeedbackMatchObject == _Chassis.HdmiOutputs[(uint)index + 1]);
|
||||||
|
|
||||||
|
|
||||||
|
VideoOutputRouteFeedbacks[i].FireUpdate();
|
||||||
|
OnSwitchChange(new RoutingNumericEventArgs((ushort)i, VideoOutputRouteFeedbacks[i].UShortValue, localOutputPort, localInputPort, eRoutingSignalType.AudioVideo));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Chassis_DMInputChange(Switch device, DMInputEventArgs args)
|
void Chassis_DMInputChange(Switch device, DMInputEventArgs args)
|
||||||
{
|
{
|
||||||
if (args.EventId == DMInputEventIds.VideoDetectedEventId)
|
if (args.EventId != DMInputEventIds.VideoDetectedEventId) return;
|
||||||
{
|
|
||||||
foreach (var item in VideoInputSyncFeedbacks)
|
foreach (var item in VideoInputSyncFeedbacks)
|
||||||
{
|
{
|
||||||
item.FireUpdate();
|
item.FireUpdate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Net.Sockets;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
using Crestron.SimplSharpPro;
|
using Crestron.SimplSharpPro;
|
||||||
@@ -15,14 +16,18 @@ using PepperDash.Core;
|
|||||||
using PepperDash.Essentials.Core;
|
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;
|
||||||
|
|
||||||
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
|
public class Dge100Controller : CrestronGenericBaseDevice, IComPorts, IIROutputPorts, IHasBasicTriListWithSmartObject, ICec, IDeviceInfoProvider
|
||||||
{
|
{
|
||||||
|
private const int CtpPort = 41795;
|
||||||
private readonly Dge100 _dge;
|
private readonly Dge100 _dge;
|
||||||
|
|
||||||
|
private readonly TsxCcsUcCodec100EthernetReservedSigs _dgeEthernetInfo;
|
||||||
|
|
||||||
public BasicTriListWithSmartObject Panel { get { return _dge; } }
|
public BasicTriListWithSmartObject Panel { get { return _dge; } }
|
||||||
|
|
||||||
private DeviceConfig _dc;
|
private DeviceConfig _dc;
|
||||||
@@ -33,6 +38,13 @@ namespace PepperDash.Essentials.DM.Endpoints.DGEs
|
|||||||
:base(key, name, device)
|
:base(key, name, device)
|
||||||
{
|
{
|
||||||
_dge = device;
|
_dge = device;
|
||||||
|
_dgeEthernetInfo = _dge.ExtenderEthernetReservedSigs;
|
||||||
|
//_dgeEthernetInfo.DeviceExtenderSigChange += (extender, args) => UpdateDeviceInfo();
|
||||||
|
_dgeEthernetInfo.Use();
|
||||||
|
|
||||||
|
DeviceInfo = new DeviceInfo();
|
||||||
|
|
||||||
|
//_dge.OnlineStatusChange += (currentDevice, args) => { if (args.DeviceOnLine) UpdateDeviceInfo(); };
|
||||||
|
|
||||||
_dc = dc;
|
_dc = dc;
|
||||||
|
|
||||||
@@ -71,6 +83,84 @@ namespace PepperDash.Essentials.DM.Endpoints.DGEs
|
|||||||
public Cec StreamCec { get { return _dge.HdmiOut.StreamCec; } }
|
public Cec StreamCec { get { return _dge.HdmiOut.StreamCec; } }
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region Implementation of IDeviceInfoProvider
|
||||||
|
|
||||||
|
public DeviceInfo DeviceInfo { get; private set; }
|
||||||
|
|
||||||
|
public event DeviceInfoChangeHandler DeviceInfoChanged;
|
||||||
|
|
||||||
|
public void UpdateDeviceInfo()
|
||||||
|
{
|
||||||
|
DeviceInfo.IpAddress = _dgeEthernetInfo.IpAddressFeedback.StringValue;
|
||||||
|
DeviceInfo.MacAddress = _dgeEthernetInfo.MacAddressFeedback.StringValue;
|
||||||
|
|
||||||
|
GetFirmwareAndSerialInfo();
|
||||||
|
|
||||||
|
OnDeviceInfoChange();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void GetFirmwareAndSerialInfo()
|
||||||
|
{
|
||||||
|
if (String.IsNullOrEmpty(_dgeEthernetInfo.IpAddressFeedback.StringValue))
|
||||||
|
{
|
||||||
|
Debug.Console(1, this, "IP Address information not yet received. No device is online");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var tcpClient = new GenericTcpIpClient("", _dgeEthernetInfo.IpAddressFeedback.StringValue, CtpPort, 1024){AutoReconnect = false};
|
||||||
|
|
||||||
|
var gather = new CommunicationGather(tcpClient, "\r\n\r\n");
|
||||||
|
|
||||||
|
tcpClient.ConnectionChange += (sender, args) =>
|
||||||
|
{
|
||||||
|
if (!args.Client.IsConnected)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
args.Client.SendText("ver\r\n");
|
||||||
|
};
|
||||||
|
|
||||||
|
gather.LineReceived += (sender, args) =>
|
||||||
|
{
|
||||||
|
if (args.Text.ToLower().Contains("host"))
|
||||||
|
{
|
||||||
|
DeviceInfo.HostName = args.Text.Split(';')[1].Trim();
|
||||||
|
|
||||||
|
tcpClient.Disconnect();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
//ignore console prompt
|
||||||
|
if (args.Text.ToLower().Contains(">"))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!args.Text.ToLower().Contains("dge"))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
DeviceInfo.SerialNumber = args.Text.Split('[')[1].Split(' ')[4].Replace("#", "");
|
||||||
|
DeviceInfo.FirmwareVersion = args.Text.Split('[')[1].Split(' ')[1];
|
||||||
|
|
||||||
|
tcpClient.SendText("host\r\n");
|
||||||
|
};
|
||||||
|
|
||||||
|
tcpClient.Connect();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnDeviceInfoChange()
|
||||||
|
{
|
||||||
|
var handler = DeviceInfoChanged;
|
||||||
|
|
||||||
|
if (handler == null) return;
|
||||||
|
|
||||||
|
handler(this, new DeviceInfoEventArgs(DeviceInfo));
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
public class Dge100ControllerFactory : EssentialsDeviceFactory<Dge100Controller>
|
public class Dge100ControllerFactory : EssentialsDeviceFactory<Dge100Controller>
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ using PepperDash.Core;
|
|||||||
namespace PepperDash.Essentials.DM
|
namespace PepperDash.Essentials.DM
|
||||||
{
|
{
|
||||||
[Description("Wrapper Class for DM-RMC-4K-Z-SCALER-C")]
|
[Description("Wrapper Class for DM-RMC-4K-Z-SCALER-C")]
|
||||||
public class DmRmc4kZScalerCController : DmRmcControllerBase, IRmcRouting,
|
public class DmRmc4kZScalerCController : DmRmcControllerBase, IRmcRoutingWithFeedback,
|
||||||
IIROutputPorts, IComPorts, ICec
|
IIROutputPorts, IComPorts, ICec
|
||||||
{
|
{
|
||||||
private readonly DmRmc4kzScalerC _rmc;
|
private readonly DmRmc4kzScalerC _rmc;
|
||||||
@@ -31,14 +31,34 @@ namespace PepperDash.Essentials.DM
|
|||||||
|
|
||||||
public RoutingPortCollection<RoutingOutputPort> OutputPorts { get; private set; }
|
public RoutingPortCollection<RoutingOutputPort> OutputPorts { get; private set; }
|
||||||
|
|
||||||
|
//IroutingNumericEvent
|
||||||
|
public event EventHandler<RoutingNumericEventArgs> NumericSwitchChange;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Raise an event when the status of a switch object changes.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="e">Arguments defined as IKeyName sender, output, input, and eRoutingSignalType</param>
|
||||||
|
private void OnSwitchChange(RoutingNumericEventArgs e)
|
||||||
|
{
|
||||||
|
var newEvent = NumericSwitchChange;
|
||||||
|
if (newEvent != null) newEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public DmRmc4kZScalerCController(string key, string name, DmRmc4kzScalerC rmc)
|
public DmRmc4kZScalerCController(string key, string name, DmRmc4kzScalerC rmc)
|
||||||
: base(key, name, rmc)
|
: base(key, name, rmc)
|
||||||
{
|
{
|
||||||
_rmc = rmc;
|
_rmc = rmc;
|
||||||
DmIn = new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.AudioVideo,
|
DmIn = new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.AudioVideo,
|
||||||
eRoutingPortConnectionType.DmCat, 0, this);
|
eRoutingPortConnectionType.DmCat, 0, this)
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = 1
|
||||||
|
};
|
||||||
HdmiIn = new RoutingInputPort(DmPortName.HdmiIn, eRoutingSignalType.AudioVideo,
|
HdmiIn = new RoutingInputPort(DmPortName.HdmiIn, eRoutingSignalType.AudioVideo,
|
||||||
eRoutingPortConnectionType.Hdmi, 0, this);
|
eRoutingPortConnectionType.Hdmi, 0, this)
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = 2
|
||||||
|
};
|
||||||
HdmiOut = new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.AudioVideo,
|
HdmiOut = new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.AudioVideo,
|
||||||
eRoutingPortConnectionType.Hdmi, null, this);
|
eRoutingPortConnectionType.Hdmi, null, this);
|
||||||
|
|
||||||
@@ -55,12 +75,20 @@ namespace PepperDash.Essentials.DM
|
|||||||
_rmc.HdmiOutput.OutputStreamChange += HdmiOutput_OutputStreamChange;
|
_rmc.HdmiOutput.OutputStreamChange += HdmiOutput_OutputStreamChange;
|
||||||
_rmc.HdmiOutput.ConnectedDevice.DeviceInformationChange += ConnectedDevice_DeviceInformationChange;
|
_rmc.HdmiOutput.ConnectedDevice.DeviceInformationChange += ConnectedDevice_DeviceInformationChange;
|
||||||
|
|
||||||
|
_rmc.OnlineStatusChange += _rmc_OnlineStatusChange;
|
||||||
|
|
||||||
// Set Ports for CEC
|
// Set Ports for CEC
|
||||||
HdmiOut.Port = _rmc.HdmiOutput;
|
HdmiOut.Port = _rmc.HdmiOutput;
|
||||||
|
|
||||||
AudioVideoSourceNumericFeedback = new IntFeedback(() => (ushort)(_rmc.SelectedSourceFeedback));
|
AudioVideoSourceNumericFeedback = new IntFeedback(() => (ushort)(_rmc.SelectedSourceFeedback));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void _rmc_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args)
|
||||||
|
{
|
||||||
|
AudioVideoSourceNumericFeedback.FireUpdate();
|
||||||
|
OnSwitchChange(new RoutingNumericEventArgs(1, AudioVideoSourceNumericFeedback.UShortValue, eRoutingSignalType.AudioVideo));
|
||||||
|
}
|
||||||
|
|
||||||
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 ||
|
||||||
@@ -71,7 +99,12 @@ namespace PepperDash.Essentials.DM
|
|||||||
|
|
||||||
if (args.EventId == EndpointOutputStreamEventIds.SelectedSourceFeedbackEventId)
|
if (args.EventId == EndpointOutputStreamEventIds.SelectedSourceFeedbackEventId)
|
||||||
{
|
{
|
||||||
|
var localInputPort =
|
||||||
|
InputPorts.FirstOrDefault(p => (int)p.FeedbackMatchObject == AudioVideoSourceNumericFeedback.UShortValue);
|
||||||
|
|
||||||
|
|
||||||
AudioVideoSourceNumericFeedback.FireUpdate();
|
AudioVideoSourceNumericFeedback.FireUpdate();
|
||||||
|
OnSwitchChange(new RoutingNumericEventArgs(1, AudioVideoSourceNumericFeedback.UShortValue, OutputPorts.First(), localInputPort, eRoutingSignalType.AudioVideo));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,19 +2,22 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Crestron.SimplSharpPro.DeviceSupport;
|
using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
using Crestron.SimplSharpPro.DM;
|
using Crestron.SimplSharpPro.DM;
|
||||||
|
using Crestron.SimplSharpPro.DM.Cards;
|
||||||
using Crestron.SimplSharpPro.DM.Endpoints.Receivers;
|
using Crestron.SimplSharpPro.DM.Endpoints.Receivers;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
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.Core.DeviceInfo;
|
||||||
using PepperDash.Essentials.DM.Config;
|
using PepperDash.Essentials.DM.Config;
|
||||||
using PepperDash.Essentials.Core.Config;
|
using PepperDash.Essentials.Core.Config;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.DM
|
namespace PepperDash.Essentials.DM
|
||||||
{
|
{
|
||||||
[Description("Wrapper class for all DM-RMC variants")]
|
[Description("Wrapper class for all DM-RMC variants")]
|
||||||
public abstract class DmRmcControllerBase : CrestronGenericBridgeableBaseDevice
|
public abstract class DmRmcControllerBase : CrestronGenericBridgeableBaseDevice, IDeviceInfoProvider
|
||||||
{
|
{
|
||||||
|
private const int CtpPort = 41795;
|
||||||
private readonly EndpointReceiverBase _rmc; //kept here just in case. Only property or method on this class that's not device-specific is the DMOutput that it's attached to.
|
private readonly EndpointReceiverBase _rmc; //kept here just in case. Only property or method on this class that's not device-specific is the DMOutput that it's attached to.
|
||||||
|
|
||||||
public StringFeedback VideoOutputResolutionFeedback { get; protected set; }
|
public StringFeedback VideoOutputResolutionFeedback { get; protected set; }
|
||||||
@@ -31,6 +34,10 @@ namespace PepperDash.Essentials.DM
|
|||||||
PreventRegistration = _rmc.DMOutput != null;
|
PreventRegistration = _rmc.DMOutput != null;
|
||||||
|
|
||||||
AddToFeedbackList(VideoOutputResolutionFeedback, EdidManufacturerFeedback, EdidSerialNumberFeedback, EdidNameFeedback, EdidPreferredTimingFeedback);
|
AddToFeedbackList(VideoOutputResolutionFeedback, EdidManufacturerFeedback, EdidSerialNumberFeedback, EdidNameFeedback, EdidPreferredTimingFeedback);
|
||||||
|
|
||||||
|
DeviceInfo = new DeviceInfo();
|
||||||
|
|
||||||
|
_rmc.OnlineStatusChange += (currentDevice, args) => { if (args.DeviceOnLine) UpdateDeviceInfo(); };
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void LinkDmRmcToApi(DmRmcControllerBase rmc, BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
protected void LinkDmRmcToApi(DmRmcControllerBase rmc, BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
||||||
@@ -78,6 +85,105 @@ namespace PepperDash.Essentials.DM
|
|||||||
|
|
||||||
trilist.SetUShortSigAction(joinMap.AudioVideoSource.JoinNumber, a => routing.ExecuteNumericSwitch(a, 1, eRoutingSignalType.AudioVideo));
|
trilist.SetUShortSigAction(joinMap.AudioVideoSource.JoinNumber, a => routing.ExecuteNumericSwitch(a, 1, eRoutingSignalType.AudioVideo));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#region Implementation of IDeviceInfoProvider
|
||||||
|
|
||||||
|
public DeviceInfo DeviceInfo { get; private set; }
|
||||||
|
public event DeviceInfoChangeHandler DeviceInfoChanged;
|
||||||
|
|
||||||
|
public void UpdateDeviceInfo()
|
||||||
|
{
|
||||||
|
Debug.Console(1, this, "Updating Device Info");
|
||||||
|
|
||||||
|
if (_rmc.ConnectedIpList.Count == 0)
|
||||||
|
{
|
||||||
|
Debug.Console(1, this, "IP Address information not yet received. No device is online");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
DeviceInfo.IpAddress = _rmc.ConnectedIpList[0].DeviceIpAddress;
|
||||||
|
|
||||||
|
foreach (var ip in _rmc.ConnectedIpList)
|
||||||
|
{
|
||||||
|
Debug.Console(0, this, "Connected IP Address: {0}", ip.DeviceIpAddress);
|
||||||
|
}
|
||||||
|
|
||||||
|
GetFirmwareAndSerialInfo();
|
||||||
|
|
||||||
|
OnDeviceInfoChange();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void GetFirmwareAndSerialInfo()
|
||||||
|
{
|
||||||
|
var tcpClient = new GenericTcpIpClient(String.Format("{0}-devInfoSocket", Key), _rmc.ConnectedIpList[0].DeviceIpAddress, CtpPort, 1024)
|
||||||
|
{
|
||||||
|
AutoReconnect = false,
|
||||||
|
};
|
||||||
|
|
||||||
|
var gather = new CommunicationGather(tcpClient, "\r\n\r\n");
|
||||||
|
|
||||||
|
tcpClient.ConnectionChange += (sender, args) =>
|
||||||
|
{
|
||||||
|
if (!args.Client.IsConnected)
|
||||||
|
{
|
||||||
|
OnDeviceInfoChange();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
args.Client.SendText("ver\r\n");
|
||||||
|
};
|
||||||
|
|
||||||
|
gather.LineReceived += (sender, args) =>
|
||||||
|
{
|
||||||
|
//ignore console prompt
|
||||||
|
if (args.Text.ToLower().Contains(">"))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (args.Text.ToLower().Contains("host"))
|
||||||
|
{
|
||||||
|
DeviceInfo.HostName = args.Text.Split(':')[1].Trim();
|
||||||
|
|
||||||
|
tcpClient.SendText("maca\r\n");
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (args.Text.ToLower().Contains("mac"))
|
||||||
|
{
|
||||||
|
DeviceInfo.MacAddress = args.Text.Split(':')[1].Trim().Replace(" ", ":");
|
||||||
|
|
||||||
|
tcpClient.Disconnect();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!args.Text.ToLower().Contains("rmc"))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
DeviceInfo.SerialNumber = args.Text.Split('[')[1].Split(' ')[4].Replace("#", "");
|
||||||
|
DeviceInfo.FirmwareVersion = args.Text.Split('[')[1].Split(' ')[1];
|
||||||
|
|
||||||
|
tcpClient.SendText("host\r\n");
|
||||||
|
};
|
||||||
|
|
||||||
|
tcpClient.Connect();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnDeviceInfoChange()
|
||||||
|
{
|
||||||
|
var handler = DeviceInfoChanged;
|
||||||
|
|
||||||
|
if (handler == null) return;
|
||||||
|
|
||||||
|
handler(this, new DeviceInfoEventArgs(DeviceInfo));
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract class DmHdBaseTControllerBase : CrestronGenericBaseDevice
|
public abstract class DmHdBaseTControllerBase : CrestronGenericBaseDevice
|
||||||
@@ -221,6 +327,10 @@ 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);
|
||||||
|
if (parentDev is DmpsRoutingController)
|
||||||
|
{
|
||||||
|
return GetDmRmcControllerForDmps(key, name, typeName, parentDev as DmpsRoutingController, props.ParentOutputNumber);
|
||||||
|
}
|
||||||
if (!(parentDev is IDmSwitch))
|
if (!(parentDev is IDmSwitch))
|
||||||
{
|
{
|
||||||
Debug.Console(0, "Cannot create DM device '{0}'. '{1}' is not a DM Chassis.",
|
Debug.Console(0, "Cannot create DM device '{0}'. '{1}' is not a DM Chassis.",
|
||||||
@@ -285,6 +395,28 @@ namespace PepperDash.Essentials.DM
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static CrestronGenericBaseDevice GetDmRmcControllerForDmps(string key, string name, string typeName,
|
||||||
|
DmpsRoutingController controller, uint num)
|
||||||
|
{
|
||||||
|
Func<string, string, DMOutput, CrestronGenericBaseDevice> dmpsHandler;
|
||||||
|
if (ChassisCpu3Dict.TryGetValue(typeName.ToLower(), out dmpsHandler))
|
||||||
|
{
|
||||||
|
var output = controller.Dmps.SwitcherOutputs[num] as DMOutput;
|
||||||
|
|
||||||
|
if (output != null)
|
||||||
|
{
|
||||||
|
return dmpsHandler(key, name, output);
|
||||||
|
}
|
||||||
|
Debug.Console(0, Debug.ErrorLogLevel.Error,
|
||||||
|
"Cannot attach DM-RMC of type '{0}' to output {1} on DMPS chassis. Output is not a DM Output.",
|
||||||
|
typeName, num);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
Debug.Console(0, Debug.ErrorLogLevel.Error, "Cannot create DM-RMC of type '{0}' to output {1} on DMPS chassis", typeName, num);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
private static CrestronGenericBaseDevice GetDmRmcControllerForProcessor(string key, string name, string typeName, uint ipid)
|
private static CrestronGenericBaseDevice GetDmRmcControllerForProcessor(string key, string name, string typeName, uint ipid)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@@ -305,6 +437,8 @@ namespace PepperDash.Essentials.DM
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class DmRmcControllerFactory : EssentialsDeviceFactory<DmRmcControllerBase>
|
public class DmRmcControllerFactory : EssentialsDeviceFactory<DmRmcControllerBase>
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
|
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;
|
||||||
@@ -17,7 +18,7 @@ namespace PepperDash.Essentials.DM
|
|||||||
/// 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, ITxRouting, IHasFreeRun, IVgaBrightnessContrastControls
|
public class DmTx200Controller : DmTxControllerBase, ITxRoutingWithFeedback, IHasFreeRun, IVgaBrightnessContrastControls
|
||||||
{
|
{
|
||||||
public DmTx200C2G Tx { get; private set; }
|
public DmTx200C2G Tx { get; private set; }
|
||||||
|
|
||||||
@@ -37,6 +38,20 @@ namespace PepperDash.Essentials.DM
|
|||||||
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
|
||||||
|
public event EventHandler<RoutingNumericEventArgs> NumericSwitchChange;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Raise an event when the status of a switch object changes.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="e">Arguments defined as IKeyName sender, output, input, and eRoutingSignalType</param>
|
||||||
|
private void OnSwitchChange(RoutingNumericEventArgs e)
|
||||||
|
{
|
||||||
|
var newEvent = NumericSwitchChange;
|
||||||
|
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>
|
||||||
@@ -88,11 +103,19 @@ namespace PepperDash.Essentials.DM
|
|||||||
Tx = tx;
|
Tx = tx;
|
||||||
|
|
||||||
HdmiInput = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn,
|
HdmiInput = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn,
|
||||||
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, DmTx200Base.eSourceSelection.Digital, this,
|
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi,
|
||||||
VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInput));
|
DmTx200Base.eSourceSelection.Digital, this,
|
||||||
|
VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInput))
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = DmTx200Base.eSourceSelection.Digital
|
||||||
|
};
|
||||||
|
|
||||||
VgaInput = new RoutingInputPortWithVideoStatuses(DmPortName.VgaIn,
|
VgaInput = new RoutingInputPortWithVideoStatuses(DmPortName.VgaIn,
|
||||||
eRoutingSignalType.Video, eRoutingPortConnectionType.Vga, DmTx200Base.eSourceSelection.Analog, this,
|
eRoutingSignalType.Video, eRoutingPortConnectionType.Vga, DmTx200Base.eSourceSelection.Analog, this,
|
||||||
VideoStatusHelper.GetVgaInputStatusFuncs(tx.VgaInput));
|
VideoStatusHelper.GetVgaInputStatusFuncs(tx.VgaInput))
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = DmTx200Base.eSourceSelection.Analog
|
||||||
|
};
|
||||||
|
|
||||||
ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput",
|
ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput",
|
||||||
() => ActualActiveVideoInput.ToString());
|
() => ActualActiveVideoInput.ToString());
|
||||||
@@ -197,10 +220,17 @@ namespace PepperDash.Essentials.DM
|
|||||||
|
|
||||||
void Tx_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args)
|
void Tx_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args)
|
||||||
{
|
{
|
||||||
|
var localVideoInputPort =
|
||||||
|
InputPorts.FirstOrDefault(p => (DmTx200Base.eSourceSelection) p.Selector == Tx.VideoSourceFeedback);
|
||||||
|
var localAudioInputPort =
|
||||||
|
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, AudioSourceNumericFeedback.UShortValue, OutputPorts.First(), localAudioInputPort, eRoutingSignalType.Audio));
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool CustomActivate()
|
public override bool CustomActivate()
|
||||||
@@ -304,13 +334,17 @@ namespace PepperDash.Essentials.DM
|
|||||||
switch (id)
|
switch (id)
|
||||||
{
|
{
|
||||||
case EndpointTransmitterBase.VideoSourceFeedbackEventId:
|
case EndpointTransmitterBase.VideoSourceFeedbackEventId:
|
||||||
|
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));
|
||||||
break;
|
break;
|
||||||
case EndpointTransmitterBase.AudioSourceFeedbackEventId:
|
case EndpointTransmitterBase.AudioSourceFeedbackEventId:
|
||||||
|
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));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ 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 System.Linq;
|
||||||
|
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
@@ -15,7 +16,7 @@ namespace PepperDash.Essentials.DM
|
|||||||
/// 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, ITxRouting, IHasFreeRun, IVgaBrightnessContrastControls
|
public class DmTx201CController : DmTxControllerBase, ITxRoutingWithFeedback, IHasFreeRun, IVgaBrightnessContrastControls
|
||||||
{
|
{
|
||||||
public DmTx201C Tx { get; private set; }
|
public DmTx201C Tx { get; private set; }
|
||||||
|
|
||||||
@@ -36,6 +37,19 @@ namespace PepperDash.Essentials.DM
|
|||||||
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
|
||||||
|
public event EventHandler<RoutingNumericEventArgs> NumericSwitchChange;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Raise an event when the status of a switch object changes.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="e">Arguments defined as IKeyName sender, output, input, and eRoutingSignalType</param>
|
||||||
|
private void OnSwitchChange(RoutingNumericEventArgs e)
|
||||||
|
{
|
||||||
|
var newEvent = NumericSwitchChange;
|
||||||
|
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>
|
||||||
@@ -92,11 +106,19 @@ namespace PepperDash.Essentials.DM
|
|||||||
Tx = tx;
|
Tx = tx;
|
||||||
|
|
||||||
HdmiInput = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn,
|
HdmiInput = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn,
|
||||||
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, DmTx200Base.eSourceSelection.Digital, this,
|
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi,
|
||||||
VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInput));
|
DmTx200Base.eSourceSelection.Digital, this,
|
||||||
|
VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInput))
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = DmTx200Base.eSourceSelection.Digital
|
||||||
|
};
|
||||||
|
|
||||||
VgaInput = new RoutingInputPortWithVideoStatuses(DmPortName.VgaIn,
|
VgaInput = new RoutingInputPortWithVideoStatuses(DmPortName.VgaIn,
|
||||||
eRoutingSignalType.Video, eRoutingPortConnectionType.Vga, DmTx200Base.eSourceSelection.Analog, this,
|
eRoutingSignalType.Video, eRoutingPortConnectionType.Vga, DmTx200Base.eSourceSelection.Analog, this,
|
||||||
VideoStatusHelper.GetVgaInputStatusFuncs(tx.VgaInput));
|
VideoStatusHelper.GetVgaInputStatusFuncs(tx.VgaInput))
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = DmTx200Base.eSourceSelection.Analog
|
||||||
|
};
|
||||||
|
|
||||||
ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput",
|
ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput",
|
||||||
() => ActualActiveVideoInput.ToString());
|
() => ActualActiveVideoInput.ToString());
|
||||||
@@ -194,10 +216,17 @@ namespace PepperDash.Essentials.DM
|
|||||||
|
|
||||||
void Tx_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args)
|
void Tx_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args)
|
||||||
{
|
{
|
||||||
|
var localVideoInputPort =
|
||||||
|
InputPorts.FirstOrDefault(p => (DmTx200Base.eSourceSelection)p.Selector == Tx.VideoSourceFeedback);
|
||||||
|
var localAudioInputPort =
|
||||||
|
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, AudioSourceNumericFeedback.UShortValue, OutputPorts.First(), localAudioInputPort, eRoutingSignalType.Audio));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void VgaInputOnInputStreamChange(EndpointInputStream inputStream, EndpointInputStreamEventArgs args)
|
private void VgaInputOnInputStreamChange(EndpointInputStream inputStream, EndpointInputStreamEventArgs args)
|
||||||
@@ -319,14 +348,17 @@ namespace PepperDash.Essentials.DM
|
|||||||
switch (id)
|
switch (id)
|
||||||
{
|
{
|
||||||
case EndpointTransmitterBase.VideoSourceFeedbackEventId:
|
case EndpointTransmitterBase.VideoSourceFeedbackEventId:
|
||||||
|
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);
|
||||||
ActiveVideoInputFeedback.FireUpdate();
|
|
||||||
VideoSourceNumericFeedback.FireUpdate();
|
VideoSourceNumericFeedback.FireUpdate();
|
||||||
ActiveVideoInputFeedback.FireUpdate();
|
ActiveVideoInputFeedback.FireUpdate();
|
||||||
|
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);
|
||||||
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));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ 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 System.Linq;
|
||||||
|
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
@@ -15,7 +16,7 @@ namespace PepperDash.Essentials.DM
|
|||||||
/// Controller class for all DM-TX-201S/F transmitters
|
/// Controller class for all DM-TX-201S/F transmitters
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Description("Wrapper class for DM-TX-201-S/F")]
|
[Description("Wrapper class for DM-TX-201-S/F")]
|
||||||
public class DmTx201SController : DmTxControllerBase, ITxRouting, IHasFreeRun, IVgaBrightnessContrastControls
|
public class DmTx201SController : DmTxControllerBase, ITxRoutingWithFeedback, IHasFreeRun, IVgaBrightnessContrastControls
|
||||||
{
|
{
|
||||||
public DmTx201S Tx { get; private set; }
|
public DmTx201S Tx { get; private set; }
|
||||||
|
|
||||||
@@ -36,6 +37,21 @@ namespace PepperDash.Essentials.DM
|
|||||||
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
|
||||||
|
public event EventHandler<RoutingNumericEventArgs> NumericSwitchChange;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// <summary>
|
||||||
|
/// Raise an event when the status of a switch object changes.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="e">Arguments defined as IKeyName sender, output, input, and eRoutingSignalType</param>
|
||||||
|
private void OnSwitchChange(RoutingNumericEventArgs e)
|
||||||
|
{
|
||||||
|
var newEvent = NumericSwitchChange;
|
||||||
|
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>
|
||||||
@@ -92,11 +108,19 @@ namespace PepperDash.Essentials.DM
|
|||||||
Tx = tx;
|
Tx = tx;
|
||||||
|
|
||||||
HdmiInput = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn,
|
HdmiInput = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn,
|
||||||
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, DmTx200Base.eSourceSelection.Digital, this,
|
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi,
|
||||||
VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInput));
|
DmTx200Base.eSourceSelection.Digital, this,
|
||||||
|
VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInput))
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = DmTx200Base.eSourceSelection.Digital
|
||||||
|
};
|
||||||
|
|
||||||
VgaInput = new RoutingInputPortWithVideoStatuses(DmPortName.VgaIn,
|
VgaInput = new RoutingInputPortWithVideoStatuses(DmPortName.VgaIn,
|
||||||
eRoutingSignalType.Video, eRoutingPortConnectionType.Vga, DmTx200Base.eSourceSelection.Analog, this,
|
eRoutingSignalType.Video, eRoutingPortConnectionType.Vga, DmTx200Base.eSourceSelection.Analog, this,
|
||||||
VideoStatusHelper.GetVgaInputStatusFuncs(tx.VgaInput));
|
VideoStatusHelper.GetVgaInputStatusFuncs(tx.VgaInput))
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = DmTx200Base.eSourceSelection.Analog
|
||||||
|
};
|
||||||
|
|
||||||
ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput",
|
ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput",
|
||||||
() => ActualActiveVideoInput.ToString());
|
() => ActualActiveVideoInput.ToString());
|
||||||
@@ -194,10 +218,17 @@ namespace PepperDash.Essentials.DM
|
|||||||
|
|
||||||
void Tx_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args)
|
void Tx_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args)
|
||||||
{
|
{
|
||||||
|
var localVideoInputPort =
|
||||||
|
InputPorts.FirstOrDefault(p => (DmTx200Base.eSourceSelection)p.Selector == Tx.VideoSourceFeedback);
|
||||||
|
var localAudioInputPort =
|
||||||
|
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, AudioSourceNumericFeedback.UShortValue, OutputPorts.First(), localAudioInputPort, eRoutingSignalType.Audio));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void VgaInputOnInputStreamChange(EndpointInputStream inputStream, EndpointInputStreamEventArgs args)
|
private void VgaInputOnInputStreamChange(EndpointInputStream inputStream, EndpointInputStreamEventArgs args)
|
||||||
@@ -319,14 +350,17 @@ namespace PepperDash.Essentials.DM
|
|||||||
switch (id)
|
switch (id)
|
||||||
{
|
{
|
||||||
case EndpointTransmitterBase.VideoSourceFeedbackEventId:
|
case EndpointTransmitterBase.VideoSourceFeedbackEventId:
|
||||||
|
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);
|
||||||
ActiveVideoInputFeedback.FireUpdate();
|
|
||||||
VideoSourceNumericFeedback.FireUpdate();
|
VideoSourceNumericFeedback.FireUpdate();
|
||||||
ActiveVideoInputFeedback.FireUpdate();
|
ActiveVideoInputFeedback.FireUpdate();
|
||||||
|
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);
|
||||||
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));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ namespace PepperDash.Essentials.DM
|
|||||||
using eVst = DmTx401C.eSourceSelection;
|
using eVst = DmTx401C.eSourceSelection;
|
||||||
|
|
||||||
[Description("Wrapper class for DM-TX-401-C")]
|
[Description("Wrapper class for DM-TX-401-C")]
|
||||||
public class DmTx401CController : DmTxControllerBase, ITxRouting, IIROutputPorts, IComPorts, IHasFreeRun, IVgaBrightnessContrastControls
|
public class DmTx401CController : DmTxControllerBase, ITxRoutingWithFeedback, IIROutputPorts, IComPorts, IHasFreeRun, IVgaBrightnessContrastControls
|
||||||
{
|
{
|
||||||
public DmTx401C Tx { get; private set; }
|
public DmTx401C Tx { get; private set; }
|
||||||
|
|
||||||
@@ -43,6 +43,20 @@ namespace PepperDash.Essentials.DM
|
|||||||
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
|
||||||
|
public event EventHandler<RoutingNumericEventArgs> NumericSwitchChange;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Raise an event when the status of a switch object changes.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="e">Arguments defined as IKeyName sender, output, input, and eRoutingSignalType</param>
|
||||||
|
private void OnSwitchChange(RoutingNumericEventArgs e)
|
||||||
|
{
|
||||||
|
var newEvent = NumericSwitchChange;
|
||||||
|
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>
|
||||||
@@ -104,20 +118,33 @@ namespace PepperDash.Essentials.DM
|
|||||||
|
|
||||||
HdmiIn = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn,
|
HdmiIn = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn,
|
||||||
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, eVst.HDMI, this,
|
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, eVst.HDMI, this,
|
||||||
VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInput));
|
VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInput))
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = eVst.HDMI
|
||||||
|
};
|
||||||
DisplayPortIn = new RoutingInputPortWithVideoStatuses(DmPortName.DisplayPortIn,
|
DisplayPortIn = new RoutingInputPortWithVideoStatuses(DmPortName.DisplayPortIn,
|
||||||
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, eVst.DisplayPort, this,
|
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, eVst.DisplayPort, this,
|
||||||
VideoStatusHelper.GetDisplayPortInputStatusFuncs(tx.DisplayPortInput));
|
VideoStatusHelper.GetDisplayPortInputStatusFuncs(tx.DisplayPortInput))
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = eVst.DisplayPort
|
||||||
|
};
|
||||||
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
|
||||||
|
};
|
||||||
CompositeIn = new RoutingInputPortWithVideoStatuses(DmPortName.CompositeIn,
|
CompositeIn = new RoutingInputPortWithVideoStatuses(DmPortName.CompositeIn,
|
||||||
eRoutingSignalType.Video, eRoutingPortConnectionType.Composite, eVst.Composite, this,
|
eRoutingSignalType.Video, eRoutingPortConnectionType.Composite, eVst.Composite, this,
|
||||||
VideoStatusHelper.GetVgaInputStatusFuncs(tx.VgaInput));
|
VideoStatusHelper.GetVgaInputStatusFuncs(tx.VgaInput))
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = eVst.Composite
|
||||||
|
};
|
||||||
|
|
||||||
Tx.HdmiInput.InputStreamChange += HdmiInputStreamChangeEvent;
|
Tx.HdmiInput.InputStreamChange += HdmiInputStreamChangeEvent;
|
||||||
Tx.DisplayPortInput.InputStreamChange += DisplayPortInputStreamChangeEvent;
|
Tx.DisplayPortInput.InputStreamChange += DisplayPortInputStreamChangeEvent;
|
||||||
Tx.BaseEvent += Tx_BaseEvent;
|
Tx.BaseEvent += Tx_BaseEvent;
|
||||||
|
Tx.OnlineStatusChange += Tx_OnlineStatusChange;
|
||||||
Tx.VgaInput.InputStreamChange += VgaInputOnInputStreamChange;
|
Tx.VgaInput.InputStreamChange += VgaInputOnInputStreamChange;
|
||||||
tx.VgaInput.VideoControls.ControlChange += VideoControls_ControlChange;
|
tx.VgaInput.VideoControls.ControlChange += VideoControls_ControlChange;
|
||||||
|
|
||||||
@@ -286,6 +313,20 @@ namespace PepperDash.Essentials.DM
|
|||||||
Tx.AudioSource = (eVst)inputSelector;
|
Tx.AudioSource = (eVst)inputSelector;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Tx_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args)
|
||||||
|
{
|
||||||
|
var localVideoInputPort =
|
||||||
|
InputPorts.FirstOrDefault(p => (eVst)p.Selector == Tx.VideoSourceFeedback);
|
||||||
|
var localAudioInputPort =
|
||||||
|
InputPorts.FirstOrDefault(p => (eVst)p.Selector == Tx.AudioSourceFeedback);
|
||||||
|
|
||||||
|
ActiveVideoInputFeedback.FireUpdate();
|
||||||
|
VideoSourceNumericFeedback.FireUpdate();
|
||||||
|
AudioSourceNumericFeedback.FireUpdate();
|
||||||
|
OnSwitchChange(new RoutingNumericEventArgs(1, VideoSourceNumericFeedback.UShortValue, OutputPorts.First(), localVideoInputPort, eRoutingSignalType.Video));
|
||||||
|
OnSwitchChange(new RoutingNumericEventArgs(1, AudioSourceNumericFeedback.UShortValue, OutputPorts.First(), localAudioInputPort, eRoutingSignalType.Audio));
|
||||||
|
}
|
||||||
|
|
||||||
void Tx_BaseEvent(GenericBase device, BaseEventArgs args)
|
void Tx_BaseEvent(GenericBase device, BaseEventArgs args)
|
||||||
{
|
{
|
||||||
var id = args.EventId;
|
var id = args.EventId;
|
||||||
@@ -294,13 +335,17 @@ namespace PepperDash.Essentials.DM
|
|||||||
switch (id)
|
switch (id)
|
||||||
{
|
{
|
||||||
case EndpointTransmitterBase.VideoSourceFeedbackEventId:
|
case EndpointTransmitterBase.VideoSourceFeedbackEventId:
|
||||||
|
var localVideoInputPort = InputPorts.FirstOrDefault(p => (eVst)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));
|
||||||
break;
|
break;
|
||||||
case EndpointTransmitterBase.AudioSourceFeedbackEventId:
|
case EndpointTransmitterBase.AudioSourceFeedbackEventId:
|
||||||
|
var localInputAudioPort = InputPorts.FirstOrDefault(p => (eVst)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));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ namespace PepperDash.Essentials.DM
|
|||||||
using eAst = Crestron.SimplSharpPro.DeviceSupport.eX02AudioSourceType;
|
using eAst = Crestron.SimplSharpPro.DeviceSupport.eX02AudioSourceType;
|
||||||
|
|
||||||
[Description("Wrapper class for DM-TX-4K-202-C")]
|
[Description("Wrapper class for DM-TX-4K-202-C")]
|
||||||
public class DmTx4k202CController : DmTxControllerBase, ITxRouting, IHasFeedback,
|
public class DmTx4k202CController : DmTxControllerBase, ITxRoutingWithFeedback, IHasFeedback,
|
||||||
IIROutputPorts, IComPorts
|
IIROutputPorts, IComPorts
|
||||||
{
|
{
|
||||||
public DmTx4k202C Tx { get; private set; }
|
public DmTx4k202C Tx { get; private set; }
|
||||||
@@ -39,6 +39,20 @@ namespace PepperDash.Essentials.DM
|
|||||||
public BoolFeedback Hdmi1VideoSyncFeedback { get; protected set; }
|
public BoolFeedback Hdmi1VideoSyncFeedback { get; protected set; }
|
||||||
public BoolFeedback Hdmi2VideoSyncFeedback { get; protected set; }
|
public BoolFeedback Hdmi2VideoSyncFeedback { get; protected set; }
|
||||||
|
|
||||||
|
//IroutingNumericEvent
|
||||||
|
public event EventHandler<RoutingNumericEventArgs> NumericSwitchChange;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Raise an event when the status of a switch object changes.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="e">Arguments defined as IKeyName sender, output, input, and eRoutingSignalType</param>
|
||||||
|
private void OnSwitchChange(RoutingNumericEventArgs e)
|
||||||
|
{
|
||||||
|
var newEvent = NumericSwitchChange;
|
||||||
|
if (newEvent != null) newEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//public override IntFeedback HdcpSupportAllFeedback { get; protected set; }
|
//public override IntFeedback HdcpSupportAllFeedback { get; protected set; }
|
||||||
//public override ushort HdcpSupportCapability { get; protected set; }
|
//public override ushort HdcpSupportCapability { get; protected set; }
|
||||||
|
|
||||||
@@ -81,6 +95,7 @@ namespace PepperDash.Essentials.DM
|
|||||||
return new RoutingPortCollection<RoutingOutputPort> { DmOut, HdmiLoopOut };
|
return new RoutingPortCollection<RoutingOutputPort> { DmOut, HdmiLoopOut };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public DmTx4k202CController(string key, string name, DmTx4k202C tx)
|
public DmTx4k202CController(string key, string name, DmTx4k202C tx)
|
||||||
: base(key, name, tx)
|
: base(key, name, tx)
|
||||||
{
|
{
|
||||||
@@ -88,10 +103,17 @@ namespace PepperDash.Essentials.DM
|
|||||||
|
|
||||||
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
|
||||||
|
};
|
||||||
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
|
||||||
|
};
|
||||||
|
|
||||||
ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput",
|
ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput",
|
||||||
() => ActualActiveVideoInput.ToString());
|
() => ActualActiveVideoInput.ToString());
|
||||||
|
|
||||||
@@ -102,13 +124,17 @@ namespace PepperDash.Essentials.DM
|
|||||||
|
|
||||||
Tx.BaseEvent += Tx_BaseEvent;
|
Tx.BaseEvent += Tx_BaseEvent;
|
||||||
|
|
||||||
|
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 =
|
||||||
new IntFeedback(
|
new IntFeedback(
|
||||||
@@ -157,18 +183,21 @@ namespace PepperDash.Essentials.DM
|
|||||||
};
|
};
|
||||||
|
|
||||||
AnyVideoInput = new RoutingInputPortWithVideoStatuses(DmPortName.AnyVideoIn,
|
AnyVideoInput = new RoutingInputPortWithVideoStatuses(DmPortName.AnyVideoIn,
|
||||||
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.None, 0, this, combinedFuncs);
|
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.None, 0, this,
|
||||||
|
combinedFuncs);
|
||||||
|
|
||||||
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);
|
Hdmi1VideoSyncFeedback, Hdmi2VideoSyncFeedback);
|
||||||
|
|
||||||
// Set Ports for CEC
|
// Set Ports for CEC
|
||||||
@@ -296,6 +325,20 @@ namespace PepperDash.Essentials.DM
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Tx_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args)
|
||||||
|
{
|
||||||
|
var localVideoInputPort =
|
||||||
|
InputPorts.FirstOrDefault(p => (eVst)p.Selector == Tx.VideoSourceFeedback);
|
||||||
|
var localAudioInputPort =
|
||||||
|
InputPorts.FirstOrDefault(p => (eAst)p.Selector == Tx.AudioSourceFeedback);
|
||||||
|
|
||||||
|
ActiveVideoInputFeedback.FireUpdate();
|
||||||
|
VideoSourceNumericFeedback.FireUpdate();
|
||||||
|
AudioSourceNumericFeedback.FireUpdate();
|
||||||
|
OnSwitchChange(new RoutingNumericEventArgs(1, VideoSourceNumericFeedback.UShortValue, OutputPorts.First(), localVideoInputPort, eRoutingSignalType.Video));
|
||||||
|
OnSwitchChange(new RoutingNumericEventArgs(1, AudioSourceNumericFeedback.UShortValue, OutputPorts.First(), localAudioInputPort, eRoutingSignalType.Audio));
|
||||||
|
}
|
||||||
|
|
||||||
void Tx_BaseEvent(GenericBase device, BaseEventArgs args)
|
void Tx_BaseEvent(GenericBase device, BaseEventArgs args)
|
||||||
{
|
{
|
||||||
var id = args.EventId;
|
var id = args.EventId;
|
||||||
@@ -304,14 +347,17 @@ namespace PepperDash.Essentials.DM
|
|||||||
switch (id)
|
switch (id)
|
||||||
{
|
{
|
||||||
case EndpointTransmitterBase.VideoSourceFeedbackEventId:
|
case EndpointTransmitterBase.VideoSourceFeedbackEventId:
|
||||||
|
var localVideoInputPort = InputPorts.FirstOrDefault(p => (eVst)p.Selector == Tx.VideoSourceFeedback);
|
||||||
Debug.Console(2, this, " Video Source: {0}", Tx.VideoSourceFeedback);
|
Debug.Console(2, this, " Video Source: {0}", Tx.VideoSourceFeedback);
|
||||||
ActiveVideoInputFeedback.FireUpdate();
|
|
||||||
VideoSourceNumericFeedback.FireUpdate();
|
VideoSourceNumericFeedback.FireUpdate();
|
||||||
ActiveVideoInputFeedback.FireUpdate();
|
ActiveVideoInputFeedback.FireUpdate();
|
||||||
|
OnSwitchChange(new RoutingNumericEventArgs(1, VideoSourceNumericFeedback.UShortValue, OutputPorts.First(), localVideoInputPort, eRoutingSignalType.Video));
|
||||||
break;
|
break;
|
||||||
case EndpointTransmitterBase.AudioSourceFeedbackEventId:
|
case EndpointTransmitterBase.AudioSourceFeedbackEventId:
|
||||||
|
var localInputAudioPort = InputPorts.FirstOrDefault(p => (eAst)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));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ namespace PepperDash.Essentials.DM
|
|||||||
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, ITxRouting, 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; }
|
||||||
@@ -46,6 +46,20 @@ namespace PepperDash.Essentials.DM
|
|||||||
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
|
||||||
|
public event EventHandler<RoutingNumericEventArgs> NumericSwitchChange;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Raise an event when the status of a switch object changes.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="e">Arguments defined as IKeyName sender, output, input, and eRoutingSignalType</param>
|
||||||
|
private void OnSwitchChange(RoutingNumericEventArgs e)
|
||||||
|
{
|
||||||
|
var newEvent = NumericSwitchChange;
|
||||||
|
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>
|
||||||
@@ -95,13 +109,24 @@ namespace PepperDash.Essentials.DM
|
|||||||
|
|
||||||
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
|
||||||
|
};
|
||||||
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
|
||||||
|
};
|
||||||
|
|
||||||
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
|
||||||
|
};
|
||||||
|
|
||||||
ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput",
|
ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput",
|
||||||
() => ActualActiveVideoInput.ToString());
|
() => ActualActiveVideoInput.ToString());
|
||||||
|
|
||||||
@@ -110,6 +135,8 @@ namespace PepperDash.Essentials.DM
|
|||||||
Tx.VgaInput.InputStreamChange += VgaInputOnInputStreamChange;
|
Tx.VgaInput.InputStreamChange += VgaInputOnInputStreamChange;
|
||||||
Tx.BaseEvent += Tx_BaseEvent;
|
Tx.BaseEvent += Tx_BaseEvent;
|
||||||
|
|
||||||
|
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);
|
||||||
|
|
||||||
@@ -387,20 +414,39 @@ namespace PepperDash.Essentials.DM
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
void Tx_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args)
|
||||||
|
{
|
||||||
|
var localVideoInputPort =
|
||||||
|
InputPorts.FirstOrDefault(p => (eVst)p.Selector == Tx.VideoSourceFeedback);
|
||||||
|
var localAudioInputPort =
|
||||||
|
InputPorts.FirstOrDefault(p => (eAst)p.Selector == Tx.AudioSourceFeedback);
|
||||||
|
|
||||||
|
ActiveVideoInputFeedback.FireUpdate();
|
||||||
|
VideoSourceNumericFeedback.FireUpdate();
|
||||||
|
AudioSourceNumericFeedback.FireUpdate();
|
||||||
|
OnSwitchChange(new RoutingNumericEventArgs(1, VideoSourceNumericFeedback.UShortValue, OutputPorts.First(), localVideoInputPort, eRoutingSignalType.Video));
|
||||||
|
OnSwitchChange(new RoutingNumericEventArgs(1, AudioSourceNumericFeedback.UShortValue, OutputPorts.First(), localAudioInputPort, eRoutingSignalType.Audio));
|
||||||
|
}
|
||||||
|
|
||||||
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);
|
||||||
|
|
||||||
switch (id)
|
switch (id)
|
||||||
{
|
{
|
||||||
case EndpointTransmitterBase.VideoSourceFeedbackEventId:
|
case EndpointTransmitterBase.VideoSourceFeedbackEventId:
|
||||||
|
var localVideoInputPort = InputPorts.FirstOrDefault(p => (eVst)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));
|
||||||
break;
|
break;
|
||||||
case EndpointTransmitterBase.AudioSourceFeedbackEventId:
|
case EndpointTransmitterBase.AudioSourceFeedbackEventId:
|
||||||
|
var localInputAudioPort = InputPorts.FirstOrDefault(p => (eAst)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));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
using Crestron.SimplSharpPro;
|
using Crestron.SimplSharpPro;
|
||||||
|
using System;
|
||||||
|
using System.Linq;
|
||||||
//using Crestron.SimplSharpPro.DeviceSupport;
|
//using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
using Crestron.SimplSharpPro.DeviceSupport;
|
using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
using Crestron.SimplSharpPro.DM;
|
using Crestron.SimplSharpPro.DM;
|
||||||
@@ -14,7 +16,7 @@ namespace PepperDash.Essentials.DM
|
|||||||
using eVst = eX02VideoSourceType;
|
using eVst = eX02VideoSourceType;
|
||||||
using eAst = eX02AudioSourceType;
|
using eAst = eX02AudioSourceType;
|
||||||
|
|
||||||
public class DmTx4kz202CController : DmTxControllerBase, ITxRouting,
|
public class DmTx4kz202CController : DmTxControllerBase, ITxRoutingWithFeedback,
|
||||||
IIROutputPorts, IComPorts
|
IIROutputPorts, IComPorts
|
||||||
{
|
{
|
||||||
public DmTx4kz202C Tx { get; private set; }
|
public DmTx4kz202C Tx { get; private set; }
|
||||||
@@ -34,6 +36,20 @@ namespace PepperDash.Essentials.DM
|
|||||||
|
|
||||||
//public override IntFeedback HdcpSupportAllFeedback { get; protected set; }
|
//public override IntFeedback HdcpSupportAllFeedback { get; protected set; }
|
||||||
//public override ushort HdcpSupportCapability { get; protected set; }
|
//public override ushort HdcpSupportCapability { get; protected set; }
|
||||||
|
//IroutingNumericEvent
|
||||||
|
public event EventHandler<RoutingNumericEventArgs> NumericSwitchChange;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Raise an event when the status of a switch object changes.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="e">Arguments defined as IKeyName sender, output, input, and eRoutingSignalType</param>
|
||||||
|
private void OnSwitchChange(RoutingNumericEventArgs e)
|
||||||
|
{
|
||||||
|
var newEvent = NumericSwitchChange;
|
||||||
|
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
|
||||||
@@ -77,10 +93,17 @@ namespace PepperDash.Essentials.DM
|
|||||||
|
|
||||||
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
|
||||||
|
};
|
||||||
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
|
||||||
|
};
|
||||||
|
|
||||||
ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput",
|
ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput",
|
||||||
() => ActualActiveVideoInput.ToString());
|
() => ActualActiveVideoInput.ToString());
|
||||||
|
|
||||||
@@ -89,6 +112,7 @@ namespace PepperDash.Essentials.DM
|
|||||||
Tx.HdmiInputs[1].InputStreamChange += InputStreamChangeEvent;
|
Tx.HdmiInputs[1].InputStreamChange += InputStreamChangeEvent;
|
||||||
Tx.HdmiInputs[2].InputStreamChange += InputStreamChangeEvent;
|
Tx.HdmiInputs[2].InputStreamChange += InputStreamChangeEvent;
|
||||||
Tx.BaseEvent += Tx_BaseEvent;
|
Tx.BaseEvent += Tx_BaseEvent;
|
||||||
|
Tx.OnlineStatusChange += Tx_OnlineStatusChange;
|
||||||
|
|
||||||
VideoSourceNumericFeedback = new IntFeedback(() => (int)Tx.VideoSourceFeedback);
|
VideoSourceNumericFeedback = new IntFeedback(() => (int)Tx.VideoSourceFeedback);
|
||||||
|
|
||||||
@@ -284,6 +308,21 @@ namespace PepperDash.Essentials.DM
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Tx_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args)
|
||||||
|
{
|
||||||
|
var localVideoInputPort =
|
||||||
|
InputPorts.FirstOrDefault(p => (eVst)p.Selector == Tx.VideoSourceFeedback);
|
||||||
|
var localAudioInputPort =
|
||||||
|
InputPorts.FirstOrDefault(p => (eAst)p.Selector == Tx.AudioSourceFeedback);
|
||||||
|
|
||||||
|
ActiveVideoInputFeedback.FireUpdate();
|
||||||
|
VideoSourceNumericFeedback.FireUpdate();
|
||||||
|
AudioSourceNumericFeedback.FireUpdate();
|
||||||
|
OnSwitchChange(new RoutingNumericEventArgs(1, VideoSourceNumericFeedback.UShortValue, OutputPorts.First(), localVideoInputPort, eRoutingSignalType.Video));
|
||||||
|
OnSwitchChange(new RoutingNumericEventArgs(1, AudioSourceNumericFeedback.UShortValue, OutputPorts.First(), localAudioInputPort, eRoutingSignalType.Audio));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void Tx_BaseEvent(GenericBase device, BaseEventArgs args)
|
void Tx_BaseEvent(GenericBase device, BaseEventArgs args)
|
||||||
{
|
{
|
||||||
var id = args.EventId;
|
var id = args.EventId;
|
||||||
@@ -292,15 +331,17 @@ namespace PepperDash.Essentials.DM
|
|||||||
switch (id)
|
switch (id)
|
||||||
{
|
{
|
||||||
case EndpointTransmitterBase.VideoSourceFeedbackEventId:
|
case EndpointTransmitterBase.VideoSourceFeedbackEventId:
|
||||||
|
var localVideoInputPort = InputPorts.FirstOrDefault(p => (eVst)p.Selector == Tx.VideoSourceFeedback);
|
||||||
Debug.Console(2, this, " Video Source: {0}", Tx.VideoSourceFeedback);
|
Debug.Console(2, this, " Video Source: {0}", Tx.VideoSourceFeedback);
|
||||||
ActiveVideoInputFeedback.FireUpdate();
|
|
||||||
VideoSourceNumericFeedback.FireUpdate();
|
VideoSourceNumericFeedback.FireUpdate();
|
||||||
AudioSourceNumericFeedback.FireUpdate();
|
|
||||||
ActiveVideoInputFeedback.FireUpdate();
|
ActiveVideoInputFeedback.FireUpdate();
|
||||||
|
OnSwitchChange(new RoutingNumericEventArgs(1, VideoSourceNumericFeedback.UShortValue, OutputPorts.First(), localVideoInputPort, eRoutingSignalType.Video));
|
||||||
break;
|
break;
|
||||||
case EndpointTransmitterBase.AudioSourceFeedbackEventId:
|
case EndpointTransmitterBase.AudioSourceFeedbackEventId:
|
||||||
|
var localInputAudioPort = InputPorts.FirstOrDefault(p => (eAst)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));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
using Crestron.SimplSharpPro;
|
using Crestron.SimplSharpPro;
|
||||||
|
using System;
|
||||||
|
using System.Linq;
|
||||||
//using Crestron.SimplSharpPro.DeviceSupport;
|
//using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
using Crestron.SimplSharpPro.DeviceSupport;
|
using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
using Crestron.SimplSharpPro.DM;
|
using Crestron.SimplSharpPro.DM;
|
||||||
@@ -16,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, ITxRouting, IHasFeedback,
|
public class DmTx4kz302CController : DmTxControllerBase, ITxRoutingWithFeedback, IHasFeedback,
|
||||||
IIROutputPorts, IComPorts
|
IIROutputPorts, IComPorts
|
||||||
{
|
{
|
||||||
public DmTx4kz302C Tx { get; private set; }
|
public DmTx4kz302C Tx { get; private set; }
|
||||||
@@ -39,6 +41,19 @@ namespace PepperDash.Essentials.DM
|
|||||||
//public override IntFeedback HdcpSupportAllFeedback { get; protected set; }
|
//public override IntFeedback HdcpSupportAllFeedback { get; protected set; }
|
||||||
//public override ushort HdcpSupportCapability { get; protected set; }
|
//public override ushort HdcpSupportCapability { get; protected set; }
|
||||||
|
|
||||||
|
//IroutingNumericEvent
|
||||||
|
public event EventHandler<RoutingNumericEventArgs> NumericSwitchChange;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Raise an event when the status of a switch object changes.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="e">Arguments defined as IKeyName sender, output, input, and eRoutingSignalType</param>
|
||||||
|
private void OnSwitchChange(RoutingNumericEventArgs e)
|
||||||
|
{
|
||||||
|
var newEvent = NumericSwitchChange;
|
||||||
|
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>
|
||||||
@@ -83,13 +98,22 @@ namespace PepperDash.Essentials.DM
|
|||||||
|
|
||||||
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
|
||||||
|
};
|
||||||
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]))
|
||||||
DisplayPortIn = new RoutingInputPortWithVideoStatuses(DmPortName.VgaIn,
|
{
|
||||||
|
FeedbackMatchObject = eVst.Hdmi2
|
||||||
|
};
|
||||||
|
DisplayPortIn = new RoutingInputPortWithVideoStatuses(DmPortName.DisplayPortIn,
|
||||||
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.DisplayPort, eVst.DisplayPort, this,
|
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.DisplayPort, eVst.DisplayPort, this,
|
||||||
VideoStatusHelper.GetDisplayPortInputStatusFuncs(tx.DisplayPortInput));
|
VideoStatusHelper.GetDisplayPortInputStatusFuncs(tx.DisplayPortInput))
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = eVst.DisplayPort
|
||||||
|
};
|
||||||
ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput",
|
ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput",
|
||||||
() => ActualActiveVideoInput.ToString());
|
() => ActualActiveVideoInput.ToString());
|
||||||
|
|
||||||
@@ -97,6 +121,7 @@ namespace PepperDash.Essentials.DM
|
|||||||
Tx.HdmiInputs[2].InputStreamChange += InputStreamChangeEvent;
|
Tx.HdmiInputs[2].InputStreamChange += InputStreamChangeEvent;
|
||||||
Tx.DisplayPortInput.InputStreamChange += DisplayPortInputStreamChange;
|
Tx.DisplayPortInput.InputStreamChange += DisplayPortInputStreamChange;
|
||||||
Tx.BaseEvent += Tx_BaseEvent;
|
Tx.BaseEvent += Tx_BaseEvent;
|
||||||
|
Tx.OnlineStatusChange += Tx_OnlineStatusChange;
|
||||||
|
|
||||||
VideoSourceNumericFeedback = new IntFeedback(() => (int)Tx.VideoSourceFeedback);
|
VideoSourceNumericFeedback = new IntFeedback(() => (int)Tx.VideoSourceFeedback);
|
||||||
AudioSourceNumericFeedback = new IntFeedback(() => (int)Tx.VideoSourceFeedback);
|
AudioSourceNumericFeedback = new IntFeedback(() => (int)Tx.VideoSourceFeedback);
|
||||||
@@ -234,29 +259,35 @@ namespace PepperDash.Essentials.DM
|
|||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
{
|
{
|
||||||
ExecuteSwitch(eVst.Auto, null, eRoutingSignalType.Audio | eRoutingSignalType.Video);
|
ExecuteSwitch(eVst.Auto, null, type);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 1:
|
case 1:
|
||||||
{
|
{
|
||||||
ExecuteSwitch(HdmiIn1.Selector, null, eRoutingSignalType.Audio | eRoutingSignalType.Video);
|
ExecuteSwitch(HdmiIn1.Selector, null, type);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 2:
|
case 2:
|
||||||
{
|
{
|
||||||
ExecuteSwitch(HdmiIn2.Selector, null, eRoutingSignalType.Audio | eRoutingSignalType.Video);
|
ExecuteSwitch(HdmiIn2.Selector, null, type);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 3:
|
case 3:
|
||||||
{
|
{
|
||||||
ExecuteSwitch(DisplayPortIn.Selector, null, eRoutingSignalType.Audio | eRoutingSignalType.Video);
|
ExecuteSwitch(DisplayPortIn.Selector, null, type);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 4:
|
case 4:
|
||||||
{
|
{
|
||||||
ExecuteSwitch(eVst.AllDisabled, null, eRoutingSignalType.Audio | eRoutingSignalType.Video);
|
ExecuteSwitch(eVst.AllDisabled, null, type);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
Debug.Console(2, this, "Unable to execute numeric switch to input {0}", input);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -264,6 +295,9 @@ namespace PepperDash.Essentials.DM
|
|||||||
|
|
||||||
public void ExecuteSwitch(object inputSelector, object outputSelector, eRoutingSignalType signalType)
|
public void ExecuteSwitch(object inputSelector, object outputSelector, eRoutingSignalType signalType)
|
||||||
{
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Debug.Console(2, this, "Attempting to switch InputSelector {0}", ((eVst)inputSelector).ToString());
|
||||||
if ((signalType | eRoutingSignalType.Video) == eRoutingSignalType.Video)
|
if ((signalType | eRoutingSignalType.Video) == eRoutingSignalType.Video)
|
||||||
Tx.VideoSource = (eVst)inputSelector;
|
Tx.VideoSource = (eVst)inputSelector;
|
||||||
|
|
||||||
@@ -274,6 +308,11 @@ namespace PepperDash.Essentials.DM
|
|||||||
Debug.Console(2, this, "Unable to execute audio-only switch for tx {0}", Key);
|
Debug.Console(2, this, "Unable to execute audio-only switch for tx {0}", Key);
|
||||||
//Tx.AudioSource = (eAst)inputSelector;
|
//Tx.AudioSource = (eAst)inputSelector;
|
||||||
}
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Debug.Console(2, this, "Exception in ExecuteSwitch: {0}", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void InputStreamChangeEvent(EndpointInputStream inputStream, EndpointInputStreamEventArgs args)
|
void InputStreamChangeEvent(EndpointInputStream inputStream, EndpointInputStreamEventArgs args)
|
||||||
{
|
{
|
||||||
@@ -295,19 +334,40 @@ namespace PepperDash.Essentials.DM
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Tx_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args)
|
||||||
|
{
|
||||||
|
var localVideoInputPort =
|
||||||
|
InputPorts.FirstOrDefault(p => (eVst)p.Selector == Tx.VideoSourceFeedback);
|
||||||
|
var localAudioInputPort =
|
||||||
|
InputPorts.FirstOrDefault(p => (eAst)p.Selector == Tx.AudioSourceFeedback);
|
||||||
|
|
||||||
|
ActiveVideoInputFeedback.FireUpdate();
|
||||||
|
VideoSourceNumericFeedback.FireUpdate();
|
||||||
|
AudioSourceNumericFeedback.FireUpdate();
|
||||||
|
OnSwitchChange(new RoutingNumericEventArgs(1, VideoSourceNumericFeedback.UShortValue, OutputPorts.First(), localVideoInputPort, eRoutingSignalType.Video));
|
||||||
|
OnSwitchChange(new RoutingNumericEventArgs(1, AudioSourceNumericFeedback.UShortValue, OutputPorts.First(), localAudioInputPort, eRoutingSignalType.Audio));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
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);
|
||||||
|
|
||||||
switch (id)
|
switch (id)
|
||||||
{
|
{
|
||||||
case EndpointTransmitterBase.VideoSourceFeedbackEventId:
|
case EndpointTransmitterBase.VideoSourceFeedbackEventId:
|
||||||
|
var localVideoInputPort = InputPorts.FirstOrDefault(p => (eVst)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));
|
||||||
break;
|
break;
|
||||||
case EndpointTransmitterBase.AudioSourceFeedbackEventId:
|
case EndpointTransmitterBase.AudioSourceFeedbackEventId:
|
||||||
|
var localInputAudioPort = InputPorts.FirstOrDefault(p => (eAst)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));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,7 +59,7 @@
|
|||||||
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.UI.dll</HintPath>
|
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.UI.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="mscorlib" />
|
<Reference Include="mscorlib" />
|
||||||
<Reference Include="PepperDash_Core, Version=1.0.41.31808, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="PepperDash_Core, Version=1.0.42.30563, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<SpecificVersion>False</SpecificVersion>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
<HintPath>..\..\..\packages\PepperDashCore\lib\net35\PepperDash_Core.dll</HintPath>
|
<HintPath>..\..\..\packages\PepperDashCore\lib\net35\PepperDash_Core.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
|||||||
@@ -181,14 +181,18 @@ namespace PepperDash.Essentials.Devices.Common.Cameras
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cameraDevice is IPower)
|
var powerCamera = cameraDevice as IHasPowerControl;
|
||||||
|
if (powerCamera != null)
|
||||||
{
|
{
|
||||||
var powerCamera = cameraDevice as IPower;
|
|
||||||
trilist.SetSigTrueAction(joinMap.PowerOn.JoinNumber, () => powerCamera.PowerOn());
|
trilist.SetSigTrueAction(joinMap.PowerOn.JoinNumber, () => powerCamera.PowerOn());
|
||||||
trilist.SetSigTrueAction(joinMap.PowerOff.JoinNumber, () => powerCamera.PowerOff());
|
trilist.SetSigTrueAction(joinMap.PowerOff.JoinNumber, () => powerCamera.PowerOff());
|
||||||
|
|
||||||
powerCamera.PowerIsOnFeedback.LinkInputSig(trilist.BooleanInput[joinMap.PowerOn.JoinNumber]);
|
var powerFbCamera = powerCamera as IHasPowerControlWithFeedback;
|
||||||
powerCamera.PowerIsOnFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.PowerOff.JoinNumber]);
|
if (powerFbCamera != null)
|
||||||
|
{
|
||||||
|
powerFbCamera.PowerIsOnFeedback.LinkInputSig(trilist.BooleanInput[joinMap.PowerOn.JoinNumber]);
|
||||||
|
powerFbCamera.PowerIsOnFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.PowerOff.JoinNumber]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cameraDevice is ICommunicationMonitor)
|
if (cameraDevice is ICommunicationMonitor)
|
||||||
|
|||||||
@@ -92,8 +92,6 @@ namespace PepperDash.Essentials.Devices.Common.Cameras
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IHasCameraPanControl : IHasCameraControls
|
public interface IHasCameraPanControl : IHasCameraControls
|
||||||
{
|
{
|
||||||
// void PanLeft(bool pressRelease);
|
|
||||||
// void PanRight(bool pressRelease);
|
|
||||||
void PanLeft();
|
void PanLeft();
|
||||||
void PanRight();
|
void PanRight();
|
||||||
void PanStop();
|
void PanStop();
|
||||||
@@ -104,8 +102,6 @@ namespace PepperDash.Essentials.Devices.Common.Cameras
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IHasCameraTiltControl : IHasCameraControls
|
public interface IHasCameraTiltControl : IHasCameraControls
|
||||||
{
|
{
|
||||||
// void TiltDown(bool pressRelease);
|
|
||||||
// void TildUp(bool pressRelease);
|
|
||||||
void TiltDown();
|
void TiltDown();
|
||||||
void TiltUp();
|
void TiltUp();
|
||||||
void TiltStop();
|
void TiltStop();
|
||||||
@@ -116,8 +112,6 @@ namespace PepperDash.Essentials.Devices.Common.Cameras
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IHasCameraZoomControl : IHasCameraControls
|
public interface IHasCameraZoomControl : IHasCameraControls
|
||||||
{
|
{
|
||||||
// void ZoomIn(bool pressRelease);
|
|
||||||
// void ZoomOut(bool pressRelease);
|
|
||||||
void ZoomIn();
|
void ZoomIn();
|
||||||
void ZoomOut();
|
void ZoomOut();
|
||||||
void ZoomStop();
|
void ZoomStop();
|
||||||
@@ -135,6 +129,13 @@ namespace PepperDash.Essentials.Devices.Common.Cameras
|
|||||||
void TriggerAutoFocus();
|
void TriggerAutoFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public interface IHasAutoFocusMode
|
||||||
|
{
|
||||||
|
void SetFocusModeAuto();
|
||||||
|
void SetFocusModeManual();
|
||||||
|
void ToggleFocusMode();
|
||||||
|
}
|
||||||
|
|
||||||
public interface IHasCameraAutoMode : IHasCameraControls
|
public interface IHasCameraAutoMode : IHasCameraControls
|
||||||
{
|
{
|
||||||
void CameraAutoModeOn();
|
void CameraAutoModeOn();
|
||||||
|
|||||||
@@ -12,29 +12,86 @@ using PepperDash.Essentials.Devices.Common.Codec;
|
|||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using Crestron.SimplSharp.Reflection;
|
using Crestron.SimplSharp.Reflection;
|
||||||
|
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Devices.Common.Cameras
|
namespace PepperDash.Essentials.Devices.Common.Cameras
|
||||||
{
|
{
|
||||||
public class CameraVisca : CameraBase, IHasCameraPtzControl, ICommunicationMonitor, IHasCameraPresets, IPower, IBridgeAdvanced
|
public class CameraVisca : CameraBase, IHasCameraPtzControl, ICommunicationMonitor, IHasCameraPresets, IHasPowerControlWithFeedback, IBridgeAdvanced, IHasCameraFocusControl, IHasAutoFocusMode
|
||||||
{
|
{
|
||||||
|
CameraViscaPropertiesConfig PropertiesConfig;
|
||||||
|
|
||||||
public IBasicCommunication Communication { get; private set; }
|
public IBasicCommunication Communication { get; private set; }
|
||||||
public CommunicationGather PortGather { get; private set; }
|
|
||||||
|
|
||||||
public StatusMonitorBase CommunicationMonitor { get; private set; }
|
public StatusMonitorBase CommunicationMonitor { get; private set; }
|
||||||
|
|
||||||
public byte PanSpeed = 0x10;
|
/// <summary>
|
||||||
public byte TiltSpeed = 0x10;
|
/// Used to store the actions to parse inquiry responses as the inquiries are sent
|
||||||
|
/// </summary>
|
||||||
|
private CrestronQueue<Action<byte[]>> InquiryResponseQueue;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Camera ID (Default 1)
|
||||||
|
/// </summary>
|
||||||
|
public byte ID = 0x01;
|
||||||
|
public byte ResponseID;
|
||||||
|
|
||||||
|
|
||||||
|
public byte PanSpeedSlow = 0x10;
|
||||||
|
public byte TiltSpeedSlow = 0x10;
|
||||||
|
|
||||||
|
public byte PanSpeedFast = 0x13;
|
||||||
|
public byte TiltSpeedFast = 0x13;
|
||||||
|
|
||||||
private bool IsMoving;
|
private bool IsMoving;
|
||||||
private bool IsZooming;
|
private bool IsZooming;
|
||||||
public bool PowerIsOn { get; private set; }
|
|
||||||
|
bool _powerIsOn;
|
||||||
|
public bool PowerIsOn
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return _powerIsOn;
|
||||||
|
}
|
||||||
|
private set
|
||||||
|
{
|
||||||
|
if (value != _powerIsOn)
|
||||||
|
{
|
||||||
|
_powerIsOn = value;
|
||||||
|
PowerIsOnFeedback.FireUpdate();
|
||||||
|
CameraIsOffFeedback.FireUpdate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const byte ZoomInCmd = 0x02;
|
||||||
|
const byte ZoomOutCmd = 0x03;
|
||||||
|
const byte ZoomStopCmd = 0x00;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Used to determine when to move the camera at a faster speed if a direction is held
|
||||||
|
/// </summary>
|
||||||
|
CTimer SpeedTimer;
|
||||||
|
// TODO: Implment speed timer for PTZ controls
|
||||||
|
|
||||||
|
long FastSpeedHoldTimeMs = 2000;
|
||||||
|
|
||||||
byte[] IncomingBuffer = new byte[] { };
|
byte[] IncomingBuffer = new byte[] { };
|
||||||
public BoolFeedback PowerIsOnFeedback { get; private set; }
|
public BoolFeedback PowerIsOnFeedback { get; private set; }
|
||||||
|
|
||||||
public CameraVisca(string key, string name, IBasicCommunication comm, CameraPropertiesConfig props) :
|
public CameraVisca(string key, string name, IBasicCommunication comm, CameraViscaPropertiesConfig props) :
|
||||||
base(key, name)
|
base(key, name)
|
||||||
{
|
{
|
||||||
|
InquiryResponseQueue = new CrestronQueue<Action<byte[]>>(15);
|
||||||
|
|
||||||
Presets = props.Presets;
|
Presets = props.Presets;
|
||||||
|
|
||||||
|
PropertiesConfig = props;
|
||||||
|
|
||||||
|
ID = (byte)(props.Id + 0x80);
|
||||||
|
ResponseID = (byte)((props.Id * 0x10) + 0x80);
|
||||||
|
|
||||||
|
SetupCameraSpeeds();
|
||||||
|
|
||||||
OutputPorts.Add(new RoutingOutputPort("videoOut", eRoutingSignalType.Video, eRoutingPortConnectionType.None, null, this, true));
|
OutputPorts.Add(new RoutingOutputPort("videoOut", eRoutingSignalType.Video, eRoutingPortConnectionType.None, null, this, true));
|
||||||
|
|
||||||
// Default to all capabilties
|
// Default to all capabilties
|
||||||
@@ -51,11 +108,10 @@ namespace PepperDash.Essentials.Devices.Common.Cameras
|
|||||||
{
|
{
|
||||||
// This instance uses RS-232 control
|
// This instance uses RS-232 control
|
||||||
}
|
}
|
||||||
PortGather = new CommunicationGather(Communication, "\xFF");
|
|
||||||
|
|
||||||
|
|
||||||
Communication.BytesReceived += new EventHandler<GenericCommMethodReceiveBytesArgs>(Communication_BytesReceived);
|
Communication.BytesReceived += new EventHandler<GenericCommMethodReceiveBytesArgs>(Communication_BytesReceived);
|
||||||
PowerIsOnFeedback = new BoolFeedback(() => { return PowerIsOn; });
|
PowerIsOnFeedback = new BoolFeedback(() => { return PowerIsOn; });
|
||||||
|
CameraIsOffFeedback = new BoolFeedback(() => { return !PowerIsOn; });
|
||||||
|
|
||||||
if (props.CommunicationMonitorProperties != null)
|
if (props.CommunicationMonitorProperties != null)
|
||||||
{
|
{
|
||||||
@@ -66,9 +122,38 @@ namespace PepperDash.Essentials.Devices.Common.Cameras
|
|||||||
CommunicationMonitor = new GenericCommunicationMonitor(this, Communication, 20000, 120000, 300000, "\x81\x09\x04\x00\xFF");
|
CommunicationMonitor = new GenericCommunicationMonitor(this, Communication, 20000, 120000, 300000, "\x81\x09\x04\x00\xFF");
|
||||||
}
|
}
|
||||||
DeviceManager.AddDevice(CommunicationMonitor);
|
DeviceManager.AddDevice(CommunicationMonitor);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sets up camera speed values based on config
|
||||||
|
/// </summary>
|
||||||
|
void SetupCameraSpeeds()
|
||||||
|
{
|
||||||
|
if (PropertiesConfig.FastSpeedHoldTimeMs > 0)
|
||||||
|
{
|
||||||
|
FastSpeedHoldTimeMs = PropertiesConfig.FastSpeedHoldTimeMs;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (PropertiesConfig.PanSpeedSlow > 0)
|
||||||
|
{
|
||||||
|
PanSpeedSlow = (byte)PropertiesConfig.PanSpeedSlow;
|
||||||
|
}
|
||||||
|
if (PropertiesConfig.PanSpeedFast > 0)
|
||||||
|
{
|
||||||
|
PanSpeedFast = (byte)PropertiesConfig.PanSpeedFast;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (PropertiesConfig.TiltSpeedSlow > 0)
|
||||||
|
{
|
||||||
|
TiltSpeedSlow = (byte)PropertiesConfig.TiltSpeedSlow;
|
||||||
|
}
|
||||||
|
if (PropertiesConfig.TiltSpeedFast > 0)
|
||||||
|
{
|
||||||
|
TiltSpeedFast = (byte)PropertiesConfig.TiltSpeedFast;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public override bool CustomActivate()
|
public override bool CustomActivate()
|
||||||
{
|
{
|
||||||
Communication.Connect();
|
Communication.Connect();
|
||||||
@@ -110,39 +195,244 @@ namespace PepperDash.Essentials.Devices.Common.Cameras
|
|||||||
|
|
||||||
Communication.SendBytes(b);
|
Communication.SendBytes(b);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Communication_BytesReceived(object sender, GenericCommMethodReceiveBytesArgs e)
|
void Communication_BytesReceived(object sender, GenericCommMethodReceiveBytesArgs e)
|
||||||
|
{
|
||||||
|
var newBytes = new byte[IncomingBuffer.Length + e.Bytes.Length];
|
||||||
|
|
||||||
|
try
|
||||||
{
|
{
|
||||||
// This is probably not thread-safe buffering
|
// This is probably not thread-safe buffering
|
||||||
// Append the incoming bytes with whatever is in the buffer
|
// Append the incoming bytes with whatever is in the buffer
|
||||||
var newBytes = new byte[IncomingBuffer.Length + e.Bytes.Length];
|
|
||||||
IncomingBuffer.CopyTo(newBytes, 0);
|
IncomingBuffer.CopyTo(newBytes, 0);
|
||||||
e.Bytes.CopyTo(newBytes, IncomingBuffer.Length);
|
e.Bytes.CopyTo(newBytes, IncomingBuffer.Length);
|
||||||
if (Debug.Level == 2) // This check is here to prevent following string format from building unnecessarily on level 0 or 1
|
if (Debug.Level == 2) // This check is here to prevent following string format from building unnecessarily on level 0 or 1
|
||||||
Debug.Console(2, this, "Received:{0}", ComTextHelper.GetEscapedText(newBytes));
|
Debug.Console(2, this, "Received:{0}", ComTextHelper.GetEscapedText(newBytes));
|
||||||
|
|
||||||
|
byte[] message = new byte[] { };
|
||||||
|
|
||||||
|
// Search for the delimiter 0xFF character
|
||||||
|
for (int i = 0; i < newBytes.Length; i++)
|
||||||
|
{
|
||||||
|
if (newBytes[i] == 0xFF)
|
||||||
|
{
|
||||||
|
// i will be the index of the delmiter character
|
||||||
|
message = newBytes.Take(i).ToArray();
|
||||||
|
// Skip over what we just took and save the rest for next time
|
||||||
|
newBytes = newBytes.Skip(i).ToArray();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (message.Length > 0)
|
||||||
private void SendPanTiltCommand (byte[] cmd)
|
|
||||||
{
|
{
|
||||||
var temp = new Byte[] { 0x81, 0x01, 0x06, 0x01, PanSpeed, TiltSpeed };
|
// Check for matching ID
|
||||||
|
if (message[0] != ResponseID)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (message[1])
|
||||||
|
{
|
||||||
|
case 0x40:
|
||||||
|
{
|
||||||
|
// ACK received
|
||||||
|
Debug.Console(2, this, "ACK Received");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 0x50:
|
||||||
|
{
|
||||||
|
|
||||||
|
if (message[2] == 0xFF)
|
||||||
|
{
|
||||||
|
// Completion received
|
||||||
|
Debug.Console(2, this, "Completion Received");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Inquiry response received. Dequeue the next response handler and invoke it
|
||||||
|
if (InquiryResponseQueue.Count > 0)
|
||||||
|
{
|
||||||
|
var inquiryAction = InquiryResponseQueue.Dequeue();
|
||||||
|
|
||||||
|
inquiryAction.Invoke(message.Skip(2).ToArray());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Debug.Console(2, this, "Response Queue is empty. Nothing to dequeue.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 0x60:
|
||||||
|
{
|
||||||
|
// Error message
|
||||||
|
|
||||||
|
switch (message[2])
|
||||||
|
{
|
||||||
|
case 0x01:
|
||||||
|
{
|
||||||
|
// Message Length Error
|
||||||
|
Debug.Console(2, this, "Error from device: Message Length Error");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 0x02:
|
||||||
|
{
|
||||||
|
// Syntax Error
|
||||||
|
Debug.Console(2, this, "Error from device: Syntax Error");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 0x03:
|
||||||
|
{
|
||||||
|
// Command Buffer Full
|
||||||
|
Debug.Console(2, this, "Error from device: Command Buffer Full");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 0x04:
|
||||||
|
{
|
||||||
|
// Command Cancelled
|
||||||
|
Debug.Console(2, this, "Error from device: Command Cancelled");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 0x05:
|
||||||
|
{
|
||||||
|
// No Socket
|
||||||
|
Debug.Console(2, this, "Error from device: No Socket");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 0x41:
|
||||||
|
{
|
||||||
|
// Command not executable
|
||||||
|
Debug.Console(2, this, "Error from device: Command not executable");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (message == new byte[] { ResponseID, 0x50, 0x02, 0xFF })
|
||||||
|
{
|
||||||
|
PowerIsOn = true;
|
||||||
|
}
|
||||||
|
else if (message == new byte[] { ResponseID, 0x50, 0x03, 0xFF })
|
||||||
|
{
|
||||||
|
PowerIsOn = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (Exception err)
|
||||||
|
{
|
||||||
|
Debug.Console(2, this, "Error parsing feedback: {0}", err);
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
// Save whatever partial message is here
|
||||||
|
IncomingBuffer = newBytes;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sends a pan/tilt command. If the command is not for fastSpeed then it starts a timer to initiate fast speed.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="cmd"></param>
|
||||||
|
/// <param name="fastSpeed"></param>
|
||||||
|
private void SendPanTiltCommand (byte[] cmd, bool fastSpeedEnabled)
|
||||||
|
{
|
||||||
|
SendBytes(GetPanTiltCommand(cmd, fastSpeedEnabled));
|
||||||
|
|
||||||
|
if (!fastSpeedEnabled)
|
||||||
|
{
|
||||||
|
if (SpeedTimer != null)
|
||||||
|
{
|
||||||
|
StopSpeedTimer();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Start the timer to send fast speed if still moving after FastSpeedHoldTime elapses
|
||||||
|
SpeedTimer = new CTimer((o) => SendPanTiltCommand(GetPanTiltCommand(cmd, true), true), FastSpeedHoldTimeMs);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void StopSpeedTimer()
|
||||||
|
{
|
||||||
|
if (SpeedTimer != null)
|
||||||
|
{
|
||||||
|
SpeedTimer.Stop();
|
||||||
|
SpeedTimer.Dispose();
|
||||||
|
SpeedTimer = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Generates the pan/tilt command with either slow or fast speed
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="cmd"></param>
|
||||||
|
/// <param name="fastSpeed"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
private byte[] GetPanTiltCommand(byte[] cmd, bool fastSpeed)
|
||||||
|
{
|
||||||
|
byte panSpeed;
|
||||||
|
byte tiltSpeed;
|
||||||
|
|
||||||
|
if (!fastSpeed)
|
||||||
|
{
|
||||||
|
panSpeed = PanSpeedSlow;
|
||||||
|
tiltSpeed = TiltSpeedSlow;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
panSpeed = PanSpeedFast;
|
||||||
|
tiltSpeed = TiltSpeedFast;
|
||||||
|
}
|
||||||
|
|
||||||
|
var temp = new byte[] { ID, 0x01, 0x06, 0x01, panSpeed, tiltSpeed };
|
||||||
int length = temp.Length + cmd.Length + 1;
|
int length = temp.Length + cmd.Length + 1;
|
||||||
|
|
||||||
byte[] sum = new byte[length];
|
byte[] sum = new byte[length];
|
||||||
temp.CopyTo(sum, 0);
|
temp.CopyTo(sum, 0);
|
||||||
cmd.CopyTo(sum, temp.Length);
|
cmd.CopyTo(sum, temp.Length);
|
||||||
sum[length - 1] = 0xFF;
|
sum[length - 1] = 0xFF;
|
||||||
SendBytes(sum);
|
|
||||||
|
return sum;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void SendPowerQuery()
|
||||||
|
{
|
||||||
|
SendBytes(new byte[] { ID, 0x09, 0x04, 0x00, 0xFF });
|
||||||
|
InquiryResponseQueue.Enqueue(HandlePowerResponse);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void PowerOn()
|
public void PowerOn()
|
||||||
{
|
{
|
||||||
|
SendBytes(new byte[] { ID, 0x01, 0x04, 0x00, 0x02, 0xFF });
|
||||||
|
SendPowerQuery();
|
||||||
|
}
|
||||||
|
|
||||||
SendBytes(new Byte[] { 0x81, 0x01, 0x04, 0x00, 0x02, 0xFF });
|
void HandlePowerResponse(byte[] response)
|
||||||
|
{
|
||||||
|
switch (response[0])
|
||||||
|
{
|
||||||
|
case 0x02:
|
||||||
|
{
|
||||||
|
PowerIsOn = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 0x03:
|
||||||
|
{
|
||||||
|
PowerIsOn = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void PowerOff()
|
public void PowerOff()
|
||||||
{
|
{
|
||||||
SendBytes(new Byte[] {0x81, 0x01, 0x04, 0x00, 0x03, 0xFF});
|
SendBytes(new byte[] {ID, 0x01, 0x04, 0x00, 0x03, 0xFF});
|
||||||
|
SendPowerQuery();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void PowerToggle()
|
public void PowerToggle()
|
||||||
@@ -155,12 +445,12 @@ namespace PepperDash.Essentials.Devices.Common.Cameras
|
|||||||
|
|
||||||
public void PanLeft()
|
public void PanLeft()
|
||||||
{
|
{
|
||||||
SendPanTiltCommand(new byte[] {0x01, 0x03});
|
SendPanTiltCommand(new byte[] {0x01, 0x03}, false);
|
||||||
IsMoving = true;
|
IsMoving = true;
|
||||||
}
|
}
|
||||||
public void PanRight()
|
public void PanRight()
|
||||||
{
|
{
|
||||||
SendPanTiltCommand(new byte[] { 0x02, 0x03 });
|
SendPanTiltCommand(new byte[] { 0x02, 0x03 }, false);
|
||||||
IsMoving = true;
|
IsMoving = true;
|
||||||
}
|
}
|
||||||
public void PanStop()
|
public void PanStop()
|
||||||
@@ -169,12 +459,12 @@ namespace PepperDash.Essentials.Devices.Common.Cameras
|
|||||||
}
|
}
|
||||||
public void TiltDown()
|
public void TiltDown()
|
||||||
{
|
{
|
||||||
SendPanTiltCommand(new byte[] { 0x03, 0x02 });
|
SendPanTiltCommand(new byte[] { 0x03, 0x02 }, false);
|
||||||
IsMoving = true;
|
IsMoving = true;
|
||||||
}
|
}
|
||||||
public void TiltUp()
|
public void TiltUp()
|
||||||
{
|
{
|
||||||
SendPanTiltCommand(new byte[] { 0x03, 0x01 });
|
SendPanTiltCommand(new byte[] { 0x03, 0x01 }, false);
|
||||||
IsMoving = true;
|
IsMoving = true;
|
||||||
}
|
}
|
||||||
public void TiltStop()
|
public void TiltStop()
|
||||||
@@ -184,16 +474,18 @@ namespace PepperDash.Essentials.Devices.Common.Cameras
|
|||||||
|
|
||||||
private void SendZoomCommand (byte cmd)
|
private void SendZoomCommand (byte cmd)
|
||||||
{
|
{
|
||||||
SendBytes(new byte[] {0x81, 0x01, 0x04, 0x07, cmd, 0xFF} );
|
SendBytes(new byte[] {ID, 0x01, 0x04, 0x07, cmd, 0xFF} );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void ZoomIn()
|
public void ZoomIn()
|
||||||
{
|
{
|
||||||
SendZoomCommand(0x02);
|
SendZoomCommand(ZoomInCmd);
|
||||||
IsZooming = true;
|
IsZooming = true;
|
||||||
}
|
}
|
||||||
public void ZoomOut()
|
public void ZoomOut()
|
||||||
{
|
{
|
||||||
SendZoomCommand(0x03);
|
SendZoomCommand(ZoomOutCmd);
|
||||||
IsZooming = true;
|
IsZooming = true;
|
||||||
}
|
}
|
||||||
public void ZoomStop()
|
public void ZoomStop()
|
||||||
@@ -205,26 +497,28 @@ namespace PepperDash.Essentials.Devices.Common.Cameras
|
|||||||
{
|
{
|
||||||
if (IsZooming)
|
if (IsZooming)
|
||||||
{
|
{
|
||||||
SendZoomCommand(0x00);
|
SendZoomCommand(ZoomStopCmd);
|
||||||
IsZooming = false;
|
IsZooming = false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SendPanTiltCommand(new byte[] {0x03, 0x03});
|
StopSpeedTimer();
|
||||||
|
SendPanTiltCommand(new byte[] { 0x03, 0x03 }, false);
|
||||||
IsMoving = false;
|
IsMoving = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public void PositionHome()
|
public void PositionHome()
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
SendBytes(new byte[] { ID, 0x01, 0x06, 0x02, PanSpeedFast, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF });
|
||||||
|
SendBytes(new byte[] { ID, 0x01, 0x04, 0x47, 0x00, 0x00, 0x00, 0x00, 0xFF });
|
||||||
}
|
}
|
||||||
public void RecallPreset(int presetNumber)
|
public void RecallPreset(int presetNumber)
|
||||||
{
|
{
|
||||||
SendBytes(new byte[] {0x81, 0x01, 0x04, 0x3F, 0x02, (byte)presetNumber, 0xFF} );
|
SendBytes(new byte[] {ID, 0x01, 0x04, 0x3F, 0x02, (byte)presetNumber, 0xFF} );
|
||||||
}
|
}
|
||||||
public void SavePreset(int presetNumber)
|
public void SavePreset(int presetNumber)
|
||||||
{
|
{
|
||||||
SendBytes(new byte[] { 0x81, 0x01, 0x04, 0x3F, 0x01, (byte)presetNumber, 0xFF });
|
SendBytes(new byte[] { ID, 0x01, 0x04, 0x3F, 0x01, (byte)presetNumber, 0xFF });
|
||||||
}
|
}
|
||||||
|
|
||||||
#region IHasCameraPresets Members
|
#region IHasCameraPresets Members
|
||||||
@@ -244,6 +538,90 @@ namespace PepperDash.Essentials.Devices.Common.Cameras
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region IHasCameraFocusControl Members
|
||||||
|
|
||||||
|
public void FocusNear()
|
||||||
|
{
|
||||||
|
SendBytes(new byte[] { ID, 0x01, 0x04, 0x08, 0x03, 0xFF });
|
||||||
|
}
|
||||||
|
|
||||||
|
public void FocusFar()
|
||||||
|
{
|
||||||
|
SendBytes(new byte[] { ID, 0x01, 0x04, 0x08, 0x02, 0xFF });
|
||||||
|
}
|
||||||
|
|
||||||
|
public void FocusStop()
|
||||||
|
{
|
||||||
|
SendBytes(new byte[] { ID, 0x01, 0x04, 0x08, 0x00, 0xFF });
|
||||||
|
}
|
||||||
|
|
||||||
|
public void TriggerAutoFocus()
|
||||||
|
{
|
||||||
|
SendBytes(new byte[] { ID, 0x01, 0x04, 0x18, 0x01, 0xFF });
|
||||||
|
SendAutoFocusQuery();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region IHasAutoFocus Members
|
||||||
|
|
||||||
|
public void SetFocusModeAuto()
|
||||||
|
{
|
||||||
|
SendBytes(new byte[] { ID, 0x01, 0x04, 0x38, 0x02, 0xFF });
|
||||||
|
SendAutoFocusQuery();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetFocusModeManual()
|
||||||
|
{
|
||||||
|
SendBytes(new byte[] { ID, 0x01, 0x04, 0x38, 0x03, 0xFF });
|
||||||
|
SendAutoFocusQuery();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ToggleFocusMode()
|
||||||
|
{
|
||||||
|
SendBytes(new byte[] { ID, 0x01, 0x04, 0x38, 0x10, 0xFF });
|
||||||
|
SendAutoFocusQuery();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
void SendAutoFocusQuery()
|
||||||
|
{
|
||||||
|
SendBytes(new byte[] { ID, 0x09, 0x04, 0x38, 0xFF });
|
||||||
|
InquiryResponseQueue.Enqueue(HandleAutoFocusResponse);
|
||||||
|
}
|
||||||
|
|
||||||
|
void HandleAutoFocusResponse(byte[] response)
|
||||||
|
{
|
||||||
|
switch (response[0])
|
||||||
|
{
|
||||||
|
case 0x02:
|
||||||
|
{
|
||||||
|
// Auto Mode
|
||||||
|
PowerIsOn = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 0x03:
|
||||||
|
{
|
||||||
|
// Manual Mode
|
||||||
|
PowerIsOn = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#region IHasCameraOff Members
|
||||||
|
|
||||||
|
public BoolFeedback CameraIsOffFeedback { get; private set; }
|
||||||
|
|
||||||
|
|
||||||
|
public void CameraOff()
|
||||||
|
{
|
||||||
|
PowerOff();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
public class CameraViscaFactory : EssentialsDeviceFactory<CameraVisca>
|
public class CameraViscaFactory : EssentialsDeviceFactory<CameraVisca>
|
||||||
@@ -257,10 +635,51 @@ namespace PepperDash.Essentials.Devices.Common.Cameras
|
|||||||
{
|
{
|
||||||
Debug.Console(1, "Factory Attempting to create new CameraVisca Device");
|
Debug.Console(1, "Factory Attempting to create new CameraVisca Device");
|
||||||
var comm = CommFactory.CreateCommForDevice(dc);
|
var comm = CommFactory.CreateCommForDevice(dc);
|
||||||
var props = Newtonsoft.Json.JsonConvert.DeserializeObject<Cameras.CameraPropertiesConfig>(
|
var props = Newtonsoft.Json.JsonConvert.DeserializeObject<Cameras.CameraViscaPropertiesConfig>(
|
||||||
dc.Properties.ToString());
|
dc.Properties.ToString());
|
||||||
return new Cameras.CameraVisca(dc.Key, dc.Name, comm, props);
|
return new Cameras.CameraVisca(dc.Key, dc.Name, comm, props);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public class CameraViscaPropertiesConfig : CameraPropertiesConfig
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Control ID of the camera (1-7)
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("id")]
|
||||||
|
public uint Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Slow Pan speed (0-18)
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("panSpeedSlow")]
|
||||||
|
public uint PanSpeedSlow { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Fast Pan speed (0-18)
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("panSpeedFast")]
|
||||||
|
public uint PanSpeedFast { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Slow tilt speed (0-18)
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("tiltSpeedSlow")]
|
||||||
|
public uint TiltSpeedSlow { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Fast tilt speed (0-18)
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("tiltSpeedFast")]
|
||||||
|
public uint TiltSpeedFast { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Time a button must be held before fast speed is engaged (Milliseconds)
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("fastSpeedHoldTimeMs")]
|
||||||
|
public uint FastSpeedHoldTimeMs { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -11,9 +11,11 @@ namespace PepperDash.Essentials.Devices.Common.Codec
|
|||||||
public interface IHasExternalSourceSwitching
|
public interface IHasExternalSourceSwitching
|
||||||
{
|
{
|
||||||
bool ExternalSourceListEnabled { get; }
|
bool ExternalSourceListEnabled { get; }
|
||||||
|
string ExternalSourceInputPort { get; }
|
||||||
void AddExternalSource(string connectorId, string key, string name, eExternalSourceType type);
|
void AddExternalSource(string connectorId, string key, string name, eExternalSourceType type);
|
||||||
void SetExternalSourceState(string key, eExternalSourceMode mode);
|
void SetExternalSourceState(string key, eExternalSourceMode mode);
|
||||||
void ClearExternalSources();
|
void ClearExternalSources();
|
||||||
|
void SetSelectedSource(string key);
|
||||||
Action<string, string> RunRouteAction { set;}
|
Action<string, string> RunRouteAction { set;}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -28,15 +28,15 @@ namespace PepperDash.Essentials.Devices.Common.DSP
|
|||||||
public CommunicationGather PortGather { get; private set; }
|
public CommunicationGather PortGather { get; private set; }
|
||||||
public StatusMonitorBase CommunicationMonitor { get; private set; }
|
public StatusMonitorBase CommunicationMonitor { get; private set; }
|
||||||
|
|
||||||
new public Dictionary<string, TesiraForteLevelControl> LevelControlPoints { get; private set; }
|
public new Dictionary<string, TesiraForteLevelControl> LevelControlPoints { get; private set; }
|
||||||
|
|
||||||
public bool isSubscribed;
|
public bool isSubscribed;
|
||||||
|
|
||||||
private CTimer SubscriptionTimer;
|
private CTimer SubscriptionTimer;
|
||||||
|
|
||||||
CrestronQueue CommandQueue;
|
private CrestronQueue CommandQueue;
|
||||||
|
|
||||||
bool CommandQueueInProgress = false;
|
private bool CommandQueueInProgress = false;
|
||||||
|
|
||||||
//new public Dictionary<string, DspControlPoint> DialerControlPoints { get; private set; }
|
//new public Dictionary<string, DspControlPoint> DialerControlPoints { get; private set; }
|
||||||
|
|
||||||
@@ -47,7 +47,8 @@ namespace PepperDash.Essentials.Devices.Common.DSP
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public bool ShowHexResponse { get; set; }
|
public bool ShowHexResponse { get; set; }
|
||||||
|
|
||||||
public BiampTesiraForteDsp(string key, string name, IBasicCommunication comm, BiampTesiraFortePropertiesConfig props) :
|
public BiampTesiraForteDsp(string key, string name, IBasicCommunication comm,
|
||||||
|
BiampTesiraFortePropertiesConfig props) :
|
||||||
base(key, name)
|
base(key, name)
|
||||||
{
|
{
|
||||||
CommandQueue = new CrestronQueue(100);
|
CommandQueue = new CrestronQueue(100);
|
||||||
@@ -68,12 +69,14 @@ namespace PepperDash.Essentials.Devices.Common.DSP
|
|||||||
PortGather.LineReceived += this.Port_LineReceived;
|
PortGather.LineReceived += this.Port_LineReceived;
|
||||||
if (props.CommunicationMonitorProperties != null)
|
if (props.CommunicationMonitorProperties != null)
|
||||||
{
|
{
|
||||||
CommunicationMonitor = new GenericCommunicationMonitor(this, Communication, props.CommunicationMonitorProperties);
|
CommunicationMonitor = new GenericCommunicationMonitor(this, Communication,
|
||||||
|
props.CommunicationMonitorProperties);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//#warning Need to deal with this poll string
|
//#warning Need to deal with this poll string
|
||||||
CommunicationMonitor = new GenericCommunicationMonitor(this, Communication, 120000, 120000, 300000, "SESSION get aliases\x0d\x0a");
|
CommunicationMonitor = new GenericCommunicationMonitor(this, Communication, 120000, 120000, 300000,
|
||||||
|
"SESSION get aliases\x0d\x0a");
|
||||||
}
|
}
|
||||||
|
|
||||||
LevelControlPoints = new Dictionary<string, TesiraForteLevelControl>();
|
LevelControlPoints = new Dictionary<string, TesiraForteLevelControl>();
|
||||||
@@ -88,15 +91,17 @@ namespace PepperDash.Essentials.Devices.Common.DSP
|
|||||||
public override bool CustomActivate()
|
public override bool CustomActivate()
|
||||||
{
|
{
|
||||||
Communication.Connect();
|
Communication.Connect();
|
||||||
CommunicationMonitor.StatusChange += (o, a) => { Debug.Console(2, this, "Communication monitor state: {0}", CommunicationMonitor.Status); };
|
CommunicationMonitor.StatusChange +=
|
||||||
|
(o, a) => { Debug.Console(2, this, "Communication monitor state: {0}", CommunicationMonitor.Status); };
|
||||||
CommunicationMonitor.Start();
|
CommunicationMonitor.Start();
|
||||||
|
|
||||||
CrestronConsole.AddNewConsoleCommand(SendLine, "send" + Key, "", ConsoleAccessLevelEnum.AccessOperator);
|
CrestronConsole.AddNewConsoleCommand(SendLine, "send" + Key, "", ConsoleAccessLevelEnum.AccessOperator);
|
||||||
CrestronConsole.AddNewConsoleCommand(s => Communication.Connect(), "con" + Key, "", ConsoleAccessLevelEnum.AccessOperator);
|
CrestronConsole.AddNewConsoleCommand(s => Communication.Connect(), "con" + Key, "",
|
||||||
|
ConsoleAccessLevelEnum.AccessOperator);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void socket_ConnectionChange(object sender, GenericSocketStatusChageEventArgs e)
|
private void socket_ConnectionChange(object sender, GenericSocketStatusChageEventArgs e)
|
||||||
{
|
{
|
||||||
Debug.Console(2, this, "Socket Status Change: {0}", e.Client.ClientStatus.ToString());
|
Debug.Console(2, this, "Socket Status Change: {0}", e.Client.ClientStatus.ToString());
|
||||||
|
|
||||||
@@ -123,7 +128,7 @@ namespace PepperDash.Essentials.Devices.Common.DSP
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initiates the subscription process to the DSP
|
/// Initiates the subscription process to the DSP
|
||||||
/// </summary>
|
/// </summary>
|
||||||
void SubscribeToAttributes()
|
private void SubscribeToAttributes()
|
||||||
{
|
{
|
||||||
SendLine("SESSION set verbose true");
|
SendLine("SESSION set verbose true");
|
||||||
|
|
||||||
@@ -141,7 +146,7 @@ namespace PepperDash.Essentials.Devices.Common.DSP
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Resets or Sets the subscription timer
|
/// Resets or Sets the subscription timer
|
||||||
/// </summary>
|
/// </summary>
|
||||||
void ResetSubscriptionTimer()
|
private void ResetSubscriptionTimer()
|
||||||
{
|
{
|
||||||
isSubscribed = true;
|
isSubscribed = true;
|
||||||
|
|
||||||
@@ -158,7 +163,7 @@ namespace PepperDash.Essentials.Devices.Common.DSP
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="dev"></param>
|
/// <param name="dev"></param>
|
||||||
/// <param name="args"></param>
|
/// <param name="args"></param>
|
||||||
void Port_LineReceived(object dev, GenericCommMethodReceiveTextArgs args)
|
private void Port_LineReceived(object dev, GenericCommMethodReceiveTextArgs args)
|
||||||
{
|
{
|
||||||
if (Debug.Level == 2)
|
if (Debug.Level == 2)
|
||||||
Debug.Console(2, this, "RX: '{0}'",
|
Debug.Console(2, this, "RX: '{0}'",
|
||||||
@@ -200,7 +205,8 @@ namespace PepperDash.Essentials.Devices.Common.DSP
|
|||||||
|
|
||||||
foreach (KeyValuePair<string, TesiraForteLevelControl> controlPoint in LevelControlPoints)
|
foreach (KeyValuePair<string, TesiraForteLevelControl> controlPoint in LevelControlPoints)
|
||||||
{
|
{
|
||||||
if (customName == controlPoint.Value.LevelCustomName || customName == controlPoint.Value.MuteCustomName)
|
if (customName == controlPoint.Value.LevelCustomName ||
|
||||||
|
customName == controlPoint.Value.MuteCustomName)
|
||||||
{
|
{
|
||||||
controlPoint.Value.ParseSubscriptionMessage(customName, value);
|
controlPoint.Value.ParseSubscriptionMessage(customName, value);
|
||||||
return;
|
return;
|
||||||
@@ -215,7 +221,8 @@ namespace PepperDash.Essentials.Devices.Common.DSP
|
|||||||
}
|
}
|
||||||
else if (args.Text.IndexOf("+OK") > -1)
|
else if (args.Text.IndexOf("+OK") > -1)
|
||||||
{
|
{
|
||||||
if (args.Text == "+OK" || args.Text.IndexOf("list\":") > -1 ) // Check for a simple "+OK" only 'ack' repsonse or a list response and ignore
|
if (args.Text == "+OK" || args.Text.IndexOf("list\":") > -1)
|
||||||
|
// Check for a simple "+OK" only 'ack' repsonse or a list response and ignore
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// response is not from a subscribed attribute. From a get/set/toggle/increment/decrement command
|
// response is not from a subscribed attribute. From a get/set/toggle/increment/decrement command
|
||||||
@@ -298,6 +305,7 @@ namespace PepperDash.Essentials.Devices.Common.DSP
|
|||||||
SendNextQueuedCommand();
|
SendNextQueuedCommand();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Adds a raw string command to the queue
|
/// Adds a raw string command to the queue
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -314,7 +322,7 @@ namespace PepperDash.Essentials.Devices.Common.DSP
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Sends the next queued command to the DSP
|
/// Sends the next queued command to the DSP
|
||||||
/// </summary>
|
/// </summary>
|
||||||
void SendNextQueuedCommand()
|
private void SendNextQueuedCommand()
|
||||||
{
|
{
|
||||||
//Debug.Console(2, this, "Attempting to send next queued command. CommandQueueInProgress: {0} Communication isConnected: {1}", CommandQueueInProgress, Communication.IsConnected);
|
//Debug.Console(2, this, "Attempting to send next queued command. CommandQueueInProgress: {0} Communication isConnected: {1}", CommandQueueInProgress, Communication.IsConnected);
|
||||||
|
|
||||||
@@ -362,7 +370,7 @@ namespace PepperDash.Essentials.Devices.Common.DSP
|
|||||||
/// Sends a command to execute a preset
|
/// Sends a command to execute a preset
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="name">Preset Name</param>
|
/// <param name="name">Preset Name</param>
|
||||||
public override void RunPreset(string name)
|
public void RunPreset(string name)
|
||||||
{
|
{
|
||||||
SendLine(string.Format("DEVICE recallPreset {0}", name));
|
SendLine(string.Format("DEVICE recallPreset {0}", name));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,16 +17,17 @@ namespace PepperDash.Essentials.Devices.Common.DSP
|
|||||||
|
|
||||||
public Dictionary<string, DspControlPoint> SwitcherControlPoints { get; private set; }
|
public Dictionary<string, DspControlPoint> SwitcherControlPoints { get; private set; }
|
||||||
|
|
||||||
public abstract void RunPreset(string name);
|
|
||||||
|
|
||||||
public DspBase(string key, string name) :
|
public DspBase(string key, string name) :
|
||||||
base(key, name) { }
|
base(key, name)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// in audio call feedback
|
// in audio call feedback
|
||||||
|
|
||||||
// VOIP
|
// VOIP
|
||||||
// Phone dialer
|
// Phone dialer
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fusion
|
// Fusion
|
||||||
|
|||||||
@@ -10,26 +10,28 @@ using PepperDash.Essentials.Core;
|
|||||||
|
|
||||||
namespace PepperDash.Essentials.Devices.Displays
|
namespace PepperDash.Essentials.Devices.Displays
|
||||||
{
|
{
|
||||||
public abstract class ComTcpDisplayBase : DisplayBase, IPower
|
[Obsolete("Please use TwoWayDisplayBase instead")]
|
||||||
|
public abstract class ComTcpDisplayBase : TwoWayDisplayBase
|
||||||
{
|
{
|
||||||
/// <summary>
|
|
||||||
/// Sets the communication method for this - swaps out event handlers and output handlers
|
///// <summary>
|
||||||
/// </summary>
|
///// Sets the communication method for this - swaps out event handlers and output handlers
|
||||||
public IBasicCommunication CommunicationMethod
|
///// </summary>
|
||||||
{
|
//public IBasicCommunication CommunicationMethod
|
||||||
get { return _CommunicationMethod; }
|
//{
|
||||||
set
|
// get { return _CommunicationMethod; }
|
||||||
{
|
// set
|
||||||
if (_CommunicationMethod != null)
|
// {
|
||||||
_CommunicationMethod.BytesReceived -= this.CommunicationMethod_BytesReceived;
|
// if (_CommunicationMethod != null)
|
||||||
// Outputs???
|
// _CommunicationMethod.BytesReceived -= this.CommunicationMethod_BytesReceived;
|
||||||
_CommunicationMethod = value;
|
// // Outputs???
|
||||||
if (_CommunicationMethod != null)
|
// _CommunicationMethod = value;
|
||||||
_CommunicationMethod.BytesReceived += this.CommunicationMethod_BytesReceived;
|
// if (_CommunicationMethod != null)
|
||||||
// Outputs?
|
// _CommunicationMethod.BytesReceived += this.CommunicationMethod_BytesReceived;
|
||||||
}
|
// // Outputs?
|
||||||
}
|
// }
|
||||||
IBasicCommunication _CommunicationMethod;
|
//}
|
||||||
|
//IBasicCommunication _CommunicationMethod;
|
||||||
|
|
||||||
public ComTcpDisplayBase(string key, string name)
|
public ComTcpDisplayBase(string key, string name)
|
||||||
: base(key, name)
|
: base(key, name)
|
||||||
@@ -38,6 +40,6 @@ namespace PepperDash.Essentials.Devices.Displays
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected abstract void CommunicationMethod_BytesReceived(object sender, GenericCommMethodReceiveBytesArgs args);
|
//protected abstract void CommunicationMethod_BytesReceived(object sender, GenericCommMethodReceiveBytesArgs args);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -11,217 +11,222 @@ using PepperDash.Essentials.Core.Bridges;
|
|||||||
|
|
||||||
namespace PepperDash.Essentials.Devices.Displays
|
namespace PepperDash.Essentials.Devices.Displays
|
||||||
{
|
{
|
||||||
public class NecPaSeriesProjector : ComTcpDisplayBase, IBridgeAdvanced
|
//public class NecPaSeriesProjector : TwoWayDisplayBase, IBridgeAdvanced
|
||||||
{
|
//{
|
||||||
public readonly IntFeedback Lamp1RemainingPercent;
|
// public readonly IntFeedback Lamp1RemainingPercent;
|
||||||
int _Lamp1RemainingPercent;
|
// int _Lamp1RemainingPercent;
|
||||||
public readonly IntFeedback Lamp2RemainingPercent;
|
// public readonly IntFeedback Lamp2RemainingPercent;
|
||||||
int _Lamp2RemainingPercent;
|
// int _Lamp2RemainingPercent;
|
||||||
protected override Func<bool> PowerIsOnFeedbackFunc
|
|
||||||
{
|
|
||||||
get { return () => _PowerIsOn; }
|
|
||||||
}
|
|
||||||
bool _PowerIsOn;
|
|
||||||
|
|
||||||
protected override Func<bool> IsCoolingDownFeedbackFunc
|
// RoutingInputPort _CurrentInputPort;
|
||||||
{
|
|
||||||
get { return () => false; }
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override Func<bool> IsWarmingUpFeedbackFunc
|
// protected override Func<string> CurrentInputFeedbackFunc { get { return () => _CurrentInputPort.Key; } }
|
||||||
{
|
|
||||||
get { return () => false; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void PowerToggle()
|
// protected override Func<bool> PowerIsOnFeedbackFunc
|
||||||
{
|
// {
|
||||||
throw new NotImplementedException();
|
// get { return () => _PowerIsOn; }
|
||||||
}
|
// }
|
||||||
|
// bool _PowerIsOn;
|
||||||
|
|
||||||
public override void ExecuteSwitch(object selector)
|
// protected override Func<bool> IsCoolingDownFeedbackFunc
|
||||||
{
|
// {
|
||||||
throw new NotImplementedException();
|
// get { return () => false; }
|
||||||
}
|
// }
|
||||||
|
|
||||||
Dictionary<string, string> InputMap;
|
// protected override Func<bool> IsWarmingUpFeedbackFunc
|
||||||
|
// {
|
||||||
|
// get { return () => false; }
|
||||||
|
// }
|
||||||
|
|
||||||
/// <summary>
|
// public override void PowerToggle()
|
||||||
/// Constructor
|
// {
|
||||||
/// </summary>
|
// throw new NotImplementedException();
|
||||||
public NecPaSeriesProjector(string key, string name)
|
// }
|
||||||
: base(key, name)
|
|
||||||
{
|
|
||||||
Lamp1RemainingPercent = new IntFeedback("Lamp1RemainingPercent", () => _Lamp1RemainingPercent);
|
|
||||||
Lamp2RemainingPercent = new IntFeedback("Lamp2RemainingPercent", () => _Lamp2RemainingPercent);
|
|
||||||
|
|
||||||
InputMap = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase)
|
// public override void ExecuteSwitch(object selector)
|
||||||
{
|
// {
|
||||||
{ "computer1", "\x02\x03\x00\x00\x02\x01\x01\x09" },
|
// throw new NotImplementedException();
|
||||||
{ "computer2", "\x02\x03\x00\x00\x02\x01\x02\x0a" },
|
// }
|
||||||
{ "computer3", "\x02\x03\x00\x00\x02\x01\x03\x0b" },
|
|
||||||
{ "hdmi", "\x02\x03\x00\x00\x02\x01\x1a\x22" },
|
|
||||||
{ "dp", "\x02\x03\x00\x00\x02\x01\x1b\x23" },
|
|
||||||
{ "video", "\x02\x03\x00\x00\x02\x01\x06\x0e" },
|
|
||||||
{ "viewer", "\x02\x03\x00\x00\x02\x01\x1f\x27" },
|
|
||||||
{ "network", "\x02\x03\x00\x00\x02\x01\x20\x28" },
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
void IsConnected_OutputChange(object sender, EventArgs e)
|
// Dictionary<string, string> InputMap;
|
||||||
{
|
|
||||||
|
|
||||||
}
|
// /// <summary>
|
||||||
|
// /// Constructor
|
||||||
|
// /// </summary>
|
||||||
|
// public NecPaSeriesProjector(string key, string name)
|
||||||
|
// : base(key, name)
|
||||||
|
// {
|
||||||
|
// Lamp1RemainingPercent = new IntFeedback("Lamp1RemainingPercent", () => _Lamp1RemainingPercent);
|
||||||
|
// Lamp2RemainingPercent = new IntFeedback("Lamp2RemainingPercent", () => _Lamp2RemainingPercent);
|
||||||
|
|
||||||
public void SetEnable(bool state)
|
// InputMap = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase)
|
||||||
{
|
// {
|
||||||
var tcp = CommunicationMethod as GenericTcpIpClient;
|
// { "computer1", "\x02\x03\x00\x00\x02\x01\x01\x09" },
|
||||||
if (tcp != null)
|
// { "computer2", "\x02\x03\x00\x00\x02\x01\x02\x0a" },
|
||||||
{
|
// { "computer3", "\x02\x03\x00\x00\x02\x01\x03\x0b" },
|
||||||
tcp.Connect();
|
// { "hdmi", "\x02\x03\x00\x00\x02\x01\x1a\x22" },
|
||||||
}
|
// { "dp", "\x02\x03\x00\x00\x02\x01\x1b\x23" },
|
||||||
}
|
// { "video", "\x02\x03\x00\x00\x02\x01\x06\x0e" },
|
||||||
|
// { "viewer", "\x02\x03\x00\x00\x02\x01\x1f\x27" },
|
||||||
|
// { "network", "\x02\x03\x00\x00\x02\x01\x20\x28" },
|
||||||
|
// };
|
||||||
|
// }
|
||||||
|
|
||||||
public override void PowerOn()
|
// void IsConnected_OutputChange(object sender, EventArgs e)
|
||||||
{
|
// {
|
||||||
SendText("\x02\x00\x00\x00\x00\x02");
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void PowerOff()
|
// }
|
||||||
{
|
|
||||||
SendText("\x02\x01\x00\x00\x00\x03");
|
|
||||||
}
|
|
||||||
|
|
||||||
public void PictureMuteOn()
|
// public void SetEnable(bool state)
|
||||||
{
|
// {
|
||||||
SendText("\x02\x10\x00\x00\x00\x12");
|
// var tcp = CommunicationMethod as GenericTcpIpClient;
|
||||||
}
|
// if (tcp != null)
|
||||||
|
// {
|
||||||
|
// tcp.Connect();
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
public void PictureMuteOff()
|
// public override void PowerOn()
|
||||||
{
|
// {
|
||||||
SendText("\x02\x11\x00\x00\x00\x13");
|
// SendText("\x02\x00\x00\x00\x00\x02");
|
||||||
}
|
// }
|
||||||
|
|
||||||
public void GetRunningStatus()
|
// public override void PowerOff()
|
||||||
{
|
// {
|
||||||
SendText("\x00\x85\x00\x00\x01\x01\x87");
|
// SendText("\x02\x01\x00\x00\x00\x03");
|
||||||
}
|
// }
|
||||||
|
|
||||||
public void GetLampRemaining(int lampNum)
|
// public void PictureMuteOn()
|
||||||
{
|
// {
|
||||||
if (!_PowerIsOn) return;
|
// SendText("\x02\x10\x00\x00\x00\x12");
|
||||||
|
// }
|
||||||
|
|
||||||
var bytes = new byte[]{0x03,0x96,0x00,0x00,0x02,0x00,0x04};
|
// public void PictureMuteOff()
|
||||||
if (lampNum == 2)
|
// {
|
||||||
bytes[5] = 0x01;
|
// SendText("\x02\x11\x00\x00\x00\x13");
|
||||||
SendBytes(AppendChecksum(bytes));
|
// }
|
||||||
}
|
|
||||||
|
|
||||||
public void SelectInput(string inputKey)
|
// public void GetRunningStatus()
|
||||||
{
|
// {
|
||||||
if (InputMap.ContainsKey(inputKey))
|
// SendText("\x00\x85\x00\x00\x01\x01\x87");
|
||||||
SendText(InputMap[inputKey]);
|
// }
|
||||||
}
|
|
||||||
|
|
||||||
void SendText(string text)
|
// public void GetLampRemaining(int lampNum)
|
||||||
{
|
// {
|
||||||
if (CommunicationMethod != null)
|
// if (!_PowerIsOn) return;
|
||||||
CommunicationMethod.SendText(text);
|
|
||||||
}
|
|
||||||
|
|
||||||
void SendBytes(byte[] bytes)
|
// var bytes = new byte[]{0x03,0x96,0x00,0x00,0x02,0x00,0x04};
|
||||||
{
|
// if (lampNum == 2)
|
||||||
if (CommunicationMethod != null)
|
// bytes[5] = 0x01;
|
||||||
CommunicationMethod.SendBytes(bytes);
|
// SendBytes(AppendChecksum(bytes));
|
||||||
}
|
// }
|
||||||
|
|
||||||
byte[] AppendChecksum(byte[] bytes)
|
// public void SelectInput(string inputKey)
|
||||||
{
|
// {
|
||||||
byte sum = unchecked((byte)bytes.Sum(x => (int)x));
|
// if (InputMap.ContainsKey(inputKey))
|
||||||
var retVal = new byte[bytes.Length + 1];
|
// SendText(InputMap[inputKey]);
|
||||||
bytes.CopyTo(retVal, 0);
|
// }
|
||||||
retVal[retVal.Length - 1] = sum;
|
|
||||||
return retVal;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void CommunicationMethod_BytesReceived(object sender, GenericCommMethodReceiveBytesArgs args)
|
// void SendText(string text)
|
||||||
{
|
// {
|
||||||
var bytes = args.Bytes;
|
// if (CommunicationMethod != null)
|
||||||
ParseBytes(args.Bytes);
|
// CommunicationMethod.SendText(text);
|
||||||
}
|
// }
|
||||||
|
|
||||||
void ParseBytes(byte[] bytes)
|
// void SendBytes(byte[] bytes)
|
||||||
{
|
// {
|
||||||
if (bytes[0] == 0x22)
|
// if (CommunicationMethod != null)
|
||||||
{
|
// CommunicationMethod.SendBytes(bytes);
|
||||||
// Power on
|
// }
|
||||||
if (bytes[1] == 0x00)
|
|
||||||
{
|
|
||||||
_PowerIsOn = true;
|
|
||||||
PowerIsOnFeedback.FireUpdate();
|
|
||||||
}
|
|
||||||
// Power off
|
|
||||||
else if (bytes[1] == 0x01)
|
|
||||||
{
|
|
||||||
_PowerIsOn = false;
|
|
||||||
PowerIsOnFeedback.FireUpdate();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Running Status
|
|
||||||
else if (bytes[0] == 0x20 && bytes[1] == 0x85 && bytes[4] == 0x10)
|
|
||||||
{
|
|
||||||
var operationStates = new Dictionary<int, string>
|
|
||||||
{
|
|
||||||
{ 0x00, "Standby" },
|
|
||||||
{ 0x04, "Power On" },
|
|
||||||
{ 0x05, "Cooling" },
|
|
||||||
{ 0x06, "Standby (error)" },
|
|
||||||
{ 0x0f, "Standby (power saving" },
|
|
||||||
{ 0x10, "Network Standby" },
|
|
||||||
{ 0xff, "Not supported" }
|
|
||||||
};
|
|
||||||
|
|
||||||
var newPowerIsOn = bytes[7] == 0x01;
|
// byte[] AppendChecksum(byte[] bytes)
|
||||||
if (newPowerIsOn != _PowerIsOn)
|
// {
|
||||||
{
|
// byte sum = unchecked((byte)bytes.Sum(x => (int)x));
|
||||||
_PowerIsOn = newPowerIsOn;
|
// var retVal = new byte[bytes.Length + 1];
|
||||||
PowerIsOnFeedback.FireUpdate();
|
// bytes.CopyTo(retVal, 0);
|
||||||
}
|
// retVal[retVal.Length - 1] = sum;
|
||||||
|
// return retVal;
|
||||||
|
// }
|
||||||
|
|
||||||
Debug.Console(2, this, "PowerIsOn={0}\rCooling={1}\rPowering on/off={2}\rStatus={3}",
|
// protected override void CommunicationMethod_BytesReceived(object sender, GenericCommMethodReceiveBytesArgs args)
|
||||||
_PowerIsOn,
|
// {
|
||||||
bytes[8] == 0x01,
|
// var bytes = args.Bytes;
|
||||||
bytes[9] == 0x01,
|
// ParseBytes(args.Bytes);
|
||||||
operationStates[bytes[10]]);
|
// }
|
||||||
|
|
||||||
}
|
// void ParseBytes(byte[] bytes)
|
||||||
// Lamp remaining
|
// {
|
||||||
else if (bytes[0] == 0x23 && bytes[1] == 0x96 && bytes[4] == 0x06 && bytes[6] == 0x04)
|
// if (bytes[0] == 0x22)
|
||||||
{
|
// {
|
||||||
var newValue = bytes[7];
|
// // Power on
|
||||||
if (bytes[5] == 0x00)
|
// if (bytes[1] == 0x00)
|
||||||
{
|
// {
|
||||||
if (newValue != _Lamp1RemainingPercent)
|
// _PowerIsOn = true;
|
||||||
{
|
// PowerIsOnFeedback.FireUpdate();
|
||||||
_Lamp1RemainingPercent = newValue;
|
// }
|
||||||
Lamp1RemainingPercent.FireUpdate();
|
// // Power off
|
||||||
}
|
// else if (bytes[1] == 0x01)
|
||||||
}
|
// {
|
||||||
else
|
// _PowerIsOn = false;
|
||||||
{
|
// PowerIsOnFeedback.FireUpdate();
|
||||||
if (newValue != _Lamp2RemainingPercent)
|
// }
|
||||||
{
|
// }
|
||||||
_Lamp2RemainingPercent = newValue;
|
// // Running Status
|
||||||
Lamp2RemainingPercent.FireUpdate();
|
// else if (bytes[0] == 0x20 && bytes[1] == 0x85 && bytes[4] == 0x10)
|
||||||
}
|
// {
|
||||||
}
|
// var operationStates = new Dictionary<int, string>
|
||||||
Debug.Console(0, this, "Lamp {0}, {1}% remaining", (bytes[5] + 1), bytes[7]);
|
// {
|
||||||
}
|
// { 0x00, "Standby" },
|
||||||
|
// { 0x04, "Power On" },
|
||||||
|
// { 0x05, "Cooling" },
|
||||||
|
// { 0x06, "Standby (error)" },
|
||||||
|
// { 0x0f, "Standby (power saving" },
|
||||||
|
// { 0x10, "Network Standby" },
|
||||||
|
// { 0xff, "Not supported" }
|
||||||
|
// };
|
||||||
|
|
||||||
}
|
// var newPowerIsOn = bytes[7] == 0x01;
|
||||||
|
// if (newPowerIsOn != _PowerIsOn)
|
||||||
|
// {
|
||||||
|
// _PowerIsOn = newPowerIsOn;
|
||||||
|
// PowerIsOnFeedback.FireUpdate();
|
||||||
|
// }
|
||||||
|
|
||||||
public void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
// Debug.Console(2, this, "PowerIsOn={0}\rCooling={1}\rPowering on/off={2}\rStatus={3}",
|
||||||
{
|
// _PowerIsOn,
|
||||||
LinkDisplayToApi(this, trilist, joinStart, joinMapKey, bridge);
|
// bytes[8] == 0x01,
|
||||||
}
|
// bytes[9] == 0x01,
|
||||||
}
|
// operationStates[bytes[10]]);
|
||||||
|
|
||||||
|
// }
|
||||||
|
// // Lamp remaining
|
||||||
|
// else if (bytes[0] == 0x23 && bytes[1] == 0x96 && bytes[4] == 0x06 && bytes[6] == 0x04)
|
||||||
|
// {
|
||||||
|
// var newValue = bytes[7];
|
||||||
|
// if (bytes[5] == 0x00)
|
||||||
|
// {
|
||||||
|
// if (newValue != _Lamp1RemainingPercent)
|
||||||
|
// {
|
||||||
|
// _Lamp1RemainingPercent = newValue;
|
||||||
|
// Lamp1RemainingPercent.FireUpdate();
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
// if (newValue != _Lamp2RemainingPercent)
|
||||||
|
// {
|
||||||
|
// _Lamp2RemainingPercent = newValue;
|
||||||
|
// Lamp2RemainingPercent.FireUpdate();
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// Debug.Console(0, this, "Lamp {0}, {1}% remaining", (bytes[5] + 1), bytes[7]);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// }
|
||||||
|
|
||||||
|
// public void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
||||||
|
// {
|
||||||
|
// LinkDisplayToApi(this, trilist, joinStart, joinMapKey, bridge);
|
||||||
|
// }
|
||||||
|
//}
|
||||||
}
|
}
|
||||||
@@ -25,6 +25,8 @@ namespace PepperDash.Essentials.Devices.Displays
|
|||||||
{
|
{
|
||||||
public IBasicCommunication Communication { get; private set; }
|
public IBasicCommunication Communication { get; private set; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public StatusMonitorBase CommunicationMonitor { get; private set; }
|
public StatusMonitorBase CommunicationMonitor { get; private set; }
|
||||||
|
|
||||||
public byte ID { get; private set; }
|
public byte ID { get; private set; }
|
||||||
@@ -326,6 +328,9 @@ namespace PepperDash.Essentials.Devices.Displays
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -336,6 +341,7 @@ namespace PepperDash.Essentials.Devices.Displays
|
|||||||
{
|
{
|
||||||
_CurrentInputPort = newInput;
|
_CurrentInputPort = newInput;
|
||||||
CurrentInputFeedback.FireUpdate();
|
CurrentInputFeedback.FireUpdate();
|
||||||
|
OnSwitchChange(new RoutingNumericEventArgs(null, _CurrentInputPort, eRoutingSignalType.AudioVideo));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -63,7 +63,7 @@
|
|||||||
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.Lighting.dll</HintPath>
|
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.Lighting.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="mscorlib" />
|
<Reference Include="mscorlib" />
|
||||||
<Reference Include="PepperDash_Core, Version=1.0.41.31808, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="PepperDash_Core, Version=1.0.42.30563, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<SpecificVersion>False</SpecificVersion>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
<HintPath>..\..\..\packages\PepperDashCore\lib\net35\PepperDash_Core.dll</HintPath>
|
<HintPath>..\..\..\packages\PepperDashCore\lib\net35\PepperDash_Core.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
|||||||
@@ -16,12 +16,12 @@ using PepperDash.Essentials.Core.Routing;
|
|||||||
namespace PepperDash.Essentials.Devices.Common
|
namespace PepperDash.Essentials.Devices.Common
|
||||||
{
|
{
|
||||||
[Description("Wrapper class for an IR Set Top Box")]
|
[Description("Wrapper class for an IR Set Top Box")]
|
||||||
public class IRSetTopBoxBase : EssentialsBridgeableDevice, ISetTopBoxControls, IRoutingOutputs, IUsageTracking, IPower
|
public class IRSetTopBoxBase : EssentialsBridgeableDevice, ISetTopBoxControls, IRoutingOutputs, IUsageTracking, IHasPowerControl
|
||||||
{
|
{
|
||||||
public IrOutputPortController IrPort { get; private set; }
|
public IrOutputPortController IrPort { get; private set; }
|
||||||
|
|
||||||
public uint DisplayUiType { get { return DisplayUiConstants.TypeDirecTv; } }
|
public uint DisplayUiType { get { return DisplayUiConstants.TypeDirecTv; } }
|
||||||
|
public ushort IrPulseTime { get; set; }
|
||||||
|
|
||||||
public bool HasPresets { get; set; }
|
public bool HasPresets { get; set; }
|
||||||
public bool HasDvr { get; set; }
|
public bool HasDvr { get; set; }
|
||||||
@@ -35,6 +35,13 @@ namespace PepperDash.Essentials.Devices.Common
|
|||||||
: base(key, name)
|
: base(key, name)
|
||||||
{
|
{
|
||||||
IrPort = portCont;
|
IrPort = portCont;
|
||||||
|
IrPulseTime = 200;
|
||||||
|
|
||||||
|
if (props.IrPulseTime > 0)
|
||||||
|
{
|
||||||
|
IrPulseTime = (ushort)props.IrPulseTime;
|
||||||
|
}
|
||||||
|
|
||||||
DeviceManager.AddDevice(portCont);
|
DeviceManager.AddDevice(portCont);
|
||||||
|
|
||||||
HasPresets = props.HasPresets;
|
HasPresets = props.HasPresets;
|
||||||
@@ -47,7 +54,7 @@ namespace PepperDash.Essentials.Devices.Common
|
|||||||
KeypadAccessoryButton1Label = "-";
|
KeypadAccessoryButton1Label = "-";
|
||||||
|
|
||||||
HasKeypadAccessoryButton2 = true;
|
HasKeypadAccessoryButton2 = true;
|
||||||
KeypadAccessoryButton2Command = "NumericEnter";
|
KeypadAccessoryButton2Command = "KEYPAD_ENTER";
|
||||||
KeypadAccessoryButton2Label = "Enter";
|
KeypadAccessoryButton2Label = "Enter";
|
||||||
|
|
||||||
AnyVideoOut = new RoutingOutputPort(RoutingPortNames.AnyVideoOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
|
AnyVideoOut = new RoutingOutputPort(RoutingPortNames.AnyVideoOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
|
||||||
@@ -55,7 +62,6 @@ namespace PepperDash.Essentials.Devices.Common
|
|||||||
AnyAudioOut = new RoutingOutputPort(RoutingPortNames.AnyAudioOut, eRoutingSignalType.Audio,
|
AnyAudioOut = new RoutingOutputPort(RoutingPortNames.AnyAudioOut, eRoutingSignalType.Audio,
|
||||||
eRoutingPortConnectionType.DigitalAudio, null, this);
|
eRoutingPortConnectionType.DigitalAudio, null, this);
|
||||||
OutputPorts = new RoutingPortCollection<RoutingOutputPort> { AnyVideoOut, AnyAudioOut };
|
OutputPorts = new RoutingPortCollection<RoutingOutputPort> { AnyVideoOut, AnyAudioOut };
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void LoadPresets(string filePath)
|
public void LoadPresets(string filePath)
|
||||||
@@ -348,26 +354,17 @@ namespace PepperDash.Essentials.Devices.Common
|
|||||||
|
|
||||||
public void PowerOn()
|
public void PowerOn()
|
||||||
{
|
{
|
||||||
IrPort.PressRelease(IROutputStandardCommands.IROut_POWER_ON, true);
|
IrPort.Pulse(IROutputStandardCommands.IROut_POWER_ON, IrPulseTime);
|
||||||
IrPort.PressRelease(IROutputStandardCommands.IROut_POWER_ON, false);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void PowerOff()
|
public void PowerOff()
|
||||||
{
|
{
|
||||||
IrPort.PressRelease(IROutputStandardCommands.IROut_POWER_OFF, true);
|
IrPort.Pulse(IROutputStandardCommands.IROut_POWER_OFF, IrPulseTime);
|
||||||
IrPort.PressRelease(IROutputStandardCommands.IROut_POWER_OFF, false);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void PowerToggle()
|
public void PowerToggle()
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
IrPort.Pulse(IROutputStandardCommands.IROut_POWER, IrPulseTime);
|
||||||
}
|
|
||||||
|
|
||||||
public BoolFeedback PowerIsOnFeedback
|
|
||||||
{
|
|
||||||
get { throw new NotImplementedException(); }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
@@ -395,7 +392,8 @@ namespace PepperDash.Essentials.Devices.Common
|
|||||||
trilist.StringInput[joinMap.Name.JoinNumber].StringValue = Name;
|
trilist.StringInput[joinMap.Name.JoinNumber].StringValue = Name;
|
||||||
|
|
||||||
var stbBase = this as ISetTopBoxControls;
|
var stbBase = this as ISetTopBoxControls;
|
||||||
|
if (stbBase != null)
|
||||||
|
{
|
||||||
trilist.BooleanInput[joinMap.HasDpad.JoinNumber].BoolValue = stbBase.HasDpad;
|
trilist.BooleanInput[joinMap.HasDpad.JoinNumber].BoolValue = stbBase.HasDpad;
|
||||||
trilist.BooleanInput[joinMap.HasNumeric.JoinNumber].BoolValue = stbBase.HasNumeric;
|
trilist.BooleanInput[joinMap.HasNumeric.JoinNumber].BoolValue = stbBase.HasNumeric;
|
||||||
trilist.BooleanInput[joinMap.HasDvr.JoinNumber].BoolValue = stbBase.HasDvr;
|
trilist.BooleanInput[joinMap.HasDvr.JoinNumber].BoolValue = stbBase.HasDvr;
|
||||||
@@ -405,15 +403,19 @@ namespace PepperDash.Essentials.Devices.Common
|
|||||||
trilist.SetBoolSigAction(joinMap.Replay.JoinNumber, stbBase.Replay);
|
trilist.SetBoolSigAction(joinMap.Replay.JoinNumber, stbBase.Replay);
|
||||||
|
|
||||||
trilist.SetStringSigAction(joinMap.LoadPresets.JoinNumber, stbBase.LoadPresets);
|
trilist.SetStringSigAction(joinMap.LoadPresets.JoinNumber, stbBase.LoadPresets);
|
||||||
|
}
|
||||||
|
|
||||||
var stbPower = this as IPower;
|
var stbPower = this as IHasPowerControl;
|
||||||
|
if (stbPower != null)
|
||||||
|
{
|
||||||
trilist.SetSigTrueAction(joinMap.PowerOn.JoinNumber, stbPower.PowerOn);
|
trilist.SetSigTrueAction(joinMap.PowerOn.JoinNumber, stbPower.PowerOn);
|
||||||
trilist.SetSigTrueAction(joinMap.PowerOff.JoinNumber, stbPower.PowerOff);
|
trilist.SetSigTrueAction(joinMap.PowerOff.JoinNumber, stbPower.PowerOff);
|
||||||
trilist.SetSigTrueAction(joinMap.PowerToggle.JoinNumber, stbPower.PowerToggle);
|
trilist.SetSigTrueAction(joinMap.PowerToggle.JoinNumber, stbPower.PowerToggle);
|
||||||
|
}
|
||||||
|
|
||||||
var stbDPad = this as IDPad;
|
var stbDPad = this as IDPad;
|
||||||
|
if (stbDPad != null)
|
||||||
|
{
|
||||||
trilist.SetBoolSigAction(joinMap.Up.JoinNumber, stbDPad.Up);
|
trilist.SetBoolSigAction(joinMap.Up.JoinNumber, stbDPad.Up);
|
||||||
trilist.SetBoolSigAction(joinMap.Down.JoinNumber, stbDPad.Down);
|
trilist.SetBoolSigAction(joinMap.Down.JoinNumber, stbDPad.Down);
|
||||||
trilist.SetBoolSigAction(joinMap.Left.JoinNumber, stbDPad.Left);
|
trilist.SetBoolSigAction(joinMap.Left.JoinNumber, stbDPad.Left);
|
||||||
@@ -421,23 +423,31 @@ namespace PepperDash.Essentials.Devices.Common
|
|||||||
trilist.SetBoolSigAction(joinMap.Select.JoinNumber, stbDPad.Select);
|
trilist.SetBoolSigAction(joinMap.Select.JoinNumber, stbDPad.Select);
|
||||||
trilist.SetBoolSigAction(joinMap.Menu.JoinNumber, stbDPad.Menu);
|
trilist.SetBoolSigAction(joinMap.Menu.JoinNumber, stbDPad.Menu);
|
||||||
trilist.SetBoolSigAction(joinMap.Exit.JoinNumber, stbDPad.Exit);
|
trilist.SetBoolSigAction(joinMap.Exit.JoinNumber, stbDPad.Exit);
|
||||||
|
}
|
||||||
|
|
||||||
var stbChannel = this as IChannel;
|
var stbChannel = this as IChannel;
|
||||||
|
if (stbChannel != null)
|
||||||
|
{
|
||||||
trilist.SetBoolSigAction(joinMap.ChannelUp.JoinNumber, stbChannel.ChannelUp);
|
trilist.SetBoolSigAction(joinMap.ChannelUp.JoinNumber, stbChannel.ChannelUp);
|
||||||
trilist.SetBoolSigAction(joinMap.ChannelDown.JoinNumber, stbChannel.ChannelDown);
|
trilist.SetBoolSigAction(joinMap.ChannelDown.JoinNumber, stbChannel.ChannelDown);
|
||||||
trilist.SetBoolSigAction(joinMap.LastChannel.JoinNumber, stbChannel.LastChannel);
|
trilist.SetBoolSigAction(joinMap.LastChannel.JoinNumber, stbChannel.LastChannel);
|
||||||
trilist.SetBoolSigAction(joinMap.Guide.JoinNumber, stbChannel.Guide);
|
trilist.SetBoolSigAction(joinMap.Guide.JoinNumber, stbChannel.Guide);
|
||||||
trilist.SetBoolSigAction(joinMap.Info.JoinNumber, stbChannel.Info);
|
trilist.SetBoolSigAction(joinMap.Info.JoinNumber, stbChannel.Info);
|
||||||
trilist.SetBoolSigAction(joinMap.Exit.JoinNumber, stbChannel.Exit);
|
trilist.SetBoolSigAction(joinMap.Exit.JoinNumber, stbChannel.Exit);
|
||||||
|
}
|
||||||
|
|
||||||
var stbColor = this as IColor;
|
var stbColor = this as IColor;
|
||||||
|
if (stbColor != null)
|
||||||
|
{
|
||||||
trilist.SetBoolSigAction(joinMap.Red.JoinNumber, stbColor.Red);
|
trilist.SetBoolSigAction(joinMap.Red.JoinNumber, stbColor.Red);
|
||||||
trilist.SetBoolSigAction(joinMap.Green.JoinNumber, stbColor.Green);
|
trilist.SetBoolSigAction(joinMap.Green.JoinNumber, stbColor.Green);
|
||||||
trilist.SetBoolSigAction(joinMap.Yellow.JoinNumber, stbColor.Yellow);
|
trilist.SetBoolSigAction(joinMap.Yellow.JoinNumber, stbColor.Yellow);
|
||||||
trilist.SetBoolSigAction(joinMap.Blue.JoinNumber, stbColor.Blue);
|
trilist.SetBoolSigAction(joinMap.Blue.JoinNumber, stbColor.Blue);
|
||||||
|
}
|
||||||
|
|
||||||
var stbKeypad = this as ISetTopBoxNumericKeypad;
|
var stbKeypad = this as ISetTopBoxNumericKeypad;
|
||||||
|
if (stbKeypad != null)
|
||||||
|
{
|
||||||
trilist.StringInput[joinMap.KeypadAccessoryButton1Label.JoinNumber].StringValue = stbKeypad.KeypadAccessoryButton1Label;
|
trilist.StringInput[joinMap.KeypadAccessoryButton1Label.JoinNumber].StringValue = stbKeypad.KeypadAccessoryButton1Label;
|
||||||
trilist.StringInput[joinMap.KeypadAccessoryButton2Label.JoinNumber].StringValue = stbKeypad.KeypadAccessoryButton2Label;
|
trilist.StringInput[joinMap.KeypadAccessoryButton2Label.JoinNumber].StringValue = stbKeypad.KeypadAccessoryButton2Label;
|
||||||
|
|
||||||
@@ -458,8 +468,11 @@ namespace PepperDash.Essentials.Devices.Common
|
|||||||
trilist.SetBoolSigAction(joinMap.KeypadAccessoryButton2Press.JoinNumber, stbKeypad.KeypadAccessoryButton1);
|
trilist.SetBoolSigAction(joinMap.KeypadAccessoryButton2Press.JoinNumber, stbKeypad.KeypadAccessoryButton1);
|
||||||
trilist.SetBoolSigAction(joinMap.Dash.JoinNumber, stbKeypad.Dash);
|
trilist.SetBoolSigAction(joinMap.Dash.JoinNumber, stbKeypad.Dash);
|
||||||
trilist.SetBoolSigAction(joinMap.KeypadEnter.JoinNumber, stbKeypad.KeypadEnter);
|
trilist.SetBoolSigAction(joinMap.KeypadEnter.JoinNumber, stbKeypad.KeypadEnter);
|
||||||
|
}
|
||||||
|
|
||||||
var stbTransport = this as ITransport;
|
var stbTransport = this as ITransport;
|
||||||
|
if (stbTransport != null)
|
||||||
|
{
|
||||||
trilist.SetBoolSigAction(joinMap.Play.JoinNumber, stbTransport.Play);
|
trilist.SetBoolSigAction(joinMap.Play.JoinNumber, stbTransport.Play);
|
||||||
trilist.SetBoolSigAction(joinMap.Pause.JoinNumber, stbTransport.Pause);
|
trilist.SetBoolSigAction(joinMap.Pause.JoinNumber, stbTransport.Pause);
|
||||||
trilist.SetBoolSigAction(joinMap.Rewind.JoinNumber, stbTransport.Rewind);
|
trilist.SetBoolSigAction(joinMap.Rewind.JoinNumber, stbTransport.Rewind);
|
||||||
@@ -470,6 +483,7 @@ namespace PepperDash.Essentials.Devices.Common
|
|||||||
trilist.SetBoolSigAction(joinMap.Record.JoinNumber, stbTransport.Record);
|
trilist.SetBoolSigAction(joinMap.Record.JoinNumber, stbTransport.Record);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public class IRSetTopBoxBaseFactory : EssentialsDeviceFactory<IRSetTopBoxBase>
|
public class IRSetTopBoxBaseFactory : EssentialsDeviceFactory<IRSetTopBoxBase>
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ namespace PepperDash.Essentials.Devices.Common
|
|||||||
public bool HasDvr { get; set; }
|
public bool HasDvr { get; set; }
|
||||||
public bool HasDpad { get; set; }
|
public bool HasDpad { get; set; }
|
||||||
public bool HasNumeric { get; set; }
|
public bool HasNumeric { get; set; }
|
||||||
|
public int IrPulseTime { get; set; }
|
||||||
|
|
||||||
public ControlPropertiesConfig Control { get; set; }
|
public ControlPropertiesConfig Control { get; set; }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -106,8 +106,8 @@ namespace PepperDash.Essentials.Devices.Common.SoftCodec
|
|||||||
if (route.SourceKey.Equals("$off", StringComparison.OrdinalIgnoreCase))
|
if (route.SourceKey.Equals("$off", StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
dest.ReleaseRoute();
|
dest.ReleaseRoute();
|
||||||
if (dest is IPower)
|
if (dest is IHasPowerControl)
|
||||||
(dest as IPower).PowerOff();
|
(dest as IHasPowerControl).PowerOff();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -407,6 +407,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
|||||||
CreateOsdSource();
|
CreateOsdSource();
|
||||||
|
|
||||||
ExternalSourceListEnabled = props.ExternalSourceListEnabled;
|
ExternalSourceListEnabled = props.ExternalSourceListEnabled;
|
||||||
|
ExternalSourceInputPort = props.ExternalSourceInputPort;
|
||||||
|
|
||||||
if (props.UiBranding == null)
|
if (props.UiBranding == null)
|
||||||
{
|
{
|
||||||
@@ -416,6 +417,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
|||||||
props.UiBranding.BrandingUrl);
|
props.UiBranding.BrandingUrl);
|
||||||
|
|
||||||
BrandingEnabled = props.UiBranding.Enable;
|
BrandingEnabled = props.UiBranding.Enable;
|
||||||
|
|
||||||
_brandingUrl = props.UiBranding.BrandingUrl;
|
_brandingUrl = props.UiBranding.BrandingUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -514,12 +516,16 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
|||||||
SendText("xconfiguration userinterface custommessage: \"Scan the QR code with a mobile phone to get started\"");
|
SendText("xconfiguration userinterface custommessage: \"Scan the QR code with a mobile phone to get started\"");
|
||||||
SendText("xconfiguration userinterface osd halfwakemessage: \"Tap the touch panel or scan the QR code with a mobile phone to get started\"");
|
SendText("xconfiguration userinterface osd halfwakemessage: \"Tap the touch panel or scan the QR code with a mobile phone to get started\"");
|
||||||
|
|
||||||
|
var checksum = !String.IsNullOrEmpty(mcBridge.QrCodeChecksum)
|
||||||
|
? String.Format("checksum: {0} ", mcBridge.QrCodeChecksum)
|
||||||
|
: String.Empty;
|
||||||
|
|
||||||
SendText(String.Format(
|
SendText(String.Format(
|
||||||
"xcommand userinterface branding fetch type: branding url: {0}",
|
"xcommand userinterface branding fetch {1}type: branding url: {0}",
|
||||||
mcBridge.QrCodeUrl));
|
mcBridge.QrCodeUrl, checksum));
|
||||||
SendText(String.Format(
|
SendText(String.Format(
|
||||||
"xcommand userinterface branding fetch type: halfwakebranding url: {0}",
|
"xcommand userinterface branding fetch {1}type: halfwakebranding url: {0}",
|
||||||
mcBridge.QrCodeUrl));
|
mcBridge.QrCodeUrl, checksum));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SendBrandingUrl()
|
private void SendBrandingUrl()
|
||||||
@@ -1338,12 +1344,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
|||||||
}
|
}
|
||||||
|
|
||||||
public override void SendDtmf(string s)
|
public override void SendDtmf(string s)
|
||||||
{
|
|
||||||
if (CallFavorites != null)
|
|
||||||
{
|
{
|
||||||
SendText(string.Format("xCommand Call DTMFSend CallId: {0} DTMFString: \"{1}\"", GetCallId(), s));
|
SendText(string.Format("xCommand Call DTMFSend CallId: {0} DTMFString: \"{1}\"", GetCallId(), s));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public void SelectPresentationSource(int source)
|
public void SelectPresentationSource(int source)
|
||||||
{
|
{
|
||||||
@@ -1920,7 +1923,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
|||||||
#region IHasExternalSourceSwitching Members
|
#region IHasExternalSourceSwitching Members
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Weather the Cisco supports External Source Lists or not
|
/// Wheather the Cisco supports External Source Lists or not
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool ExternalSourceListEnabled
|
public bool ExternalSourceListEnabled
|
||||||
{
|
{
|
||||||
@@ -1928,6 +1931,11 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
|||||||
private set;
|
private set;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The name of the RoutingInputPort to which the upstream external switcher is connected
|
||||||
|
/// </summary>
|
||||||
|
public string ExternalSourceInputPort { get; private set; }
|
||||||
|
|
||||||
public bool BrandingEnabled { get; private set; }
|
public bool BrandingEnabled { get; private set; }
|
||||||
private string _brandingUrl;
|
private string _brandingUrl;
|
||||||
private bool _sendMcUrl;
|
private bool _sendMcUrl;
|
||||||
@@ -1970,6 +1978,14 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sets the selected source of the available external sources on teh Touch10 UI
|
||||||
|
/// </summary>
|
||||||
|
public void SetSelectedSource(string key)
|
||||||
|
{
|
||||||
|
SendText(string.Format("xCommand UserInterface Presentation ExternalSource Select SourceIdentifier: {0}", key));
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Action that will run when the External Source is selected.
|
/// Action that will run when the External Source is selected.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -2097,7 +2113,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
|||||||
{
|
{
|
||||||
public CiscoSparkCodecFactory()
|
public CiscoSparkCodecFactory()
|
||||||
{
|
{
|
||||||
TypeNames = new List<string>() { "ciscospark", "ciscowebex", "ciscowebexpro", "ciscoroomkit" };
|
TypeNames = new List<string>() { "ciscospark", "ciscowebex", "ciscowebexpro", "ciscoroomkit", "ciscosparkpluscodec" };
|
||||||
}
|
}
|
||||||
|
|
||||||
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||||
|
|||||||
@@ -31,9 +31,18 @@ namespace PepperDash.Essentials.Devices.Common.Codec
|
|||||||
[JsonProperty("sharing")]
|
[JsonProperty("sharing")]
|
||||||
public SharingProperties Sharing { get; set; }
|
public SharingProperties Sharing { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Enables external source switching capability
|
||||||
|
/// </summary>
|
||||||
[JsonProperty("externalSourceListEnabled")]
|
[JsonProperty("externalSourceListEnabled")]
|
||||||
public bool ExternalSourceListEnabled { get; set; }
|
public bool ExternalSourceListEnabled { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The name of the routing input port on the codec to which the external switch is connected
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("externalSourceInputPort")]
|
||||||
|
public string ExternalSourceInputPort { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Optionsal property to set the limit of any phonebook queries for directory or searching
|
/// Optionsal property to set the limit of any phonebook queries for directory or searching
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -1368,8 +1368,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
|||||||
{
|
{
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
// If the incoming value is "Of" it sets the BoolValue true, otherwise sets it false
|
// If the incoming value is "On" it sets the BoolValue true, otherwise sets it false
|
||||||
BoolValue = value == "Off";
|
BoolValue = value == "On";
|
||||||
OnValueChanged();
|
OnValueChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ using System.Text;
|
|||||||
using Crestron.SimplSharp.CrestronIO;
|
using Crestron.SimplSharp.CrestronIO;
|
||||||
using Crestron.SimplSharp.Ssh;
|
using Crestron.SimplSharp.Ssh;
|
||||||
using Crestron.SimplSharpPro.DeviceSupport;
|
using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
|
using Crestron.SimplSharp;
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Core.Intersystem;
|
using PepperDash.Core.Intersystem;
|
||||||
using PepperDash.Core.Intersystem.Tokens;
|
using PepperDash.Core.Intersystem.Tokens;
|
||||||
@@ -230,6 +231,10 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
/// Sets IsReady property and fires the event. Used for dependent classes to sync up their data.
|
/// Sets IsReady property and fires the event. Used for dependent classes to sync up their data.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected void SetIsReady()
|
protected void SetIsReady()
|
||||||
|
{
|
||||||
|
CrestronInvoke.BeginInvoke((o) =>
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
IsReady = true;
|
IsReady = true;
|
||||||
var h = IsReadyChange;
|
var h = IsReadyChange;
|
||||||
@@ -238,6 +243,12 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
h(this, new EventArgs());
|
h(this, new EventArgs());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Debug.Console(2, this, "Error in SetIsReady() : {0}", e);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// **** DEBUGGING THINGS ****
|
// **** DEBUGGING THINGS ****
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -585,6 +596,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
trilist.SetBoolSigAction(joinMap.SourceShareAutoStart.JoinNumber, (b) => AutoShareContentWhileInCall = b);
|
trilist.SetBoolSigAction(joinMap.SourceShareAutoStart.JoinNumber, (b) => AutoShareContentWhileInCall = b);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO [ ] 2021-01-06, jkd: Added to debug OBTP dialing issues
|
||||||
|
private List<Meeting> _currentMeetings = new List<Meeting>();
|
||||||
|
|
||||||
private void LinkVideoCodecScheduleToApi(IHasScheduleAwareness codec, BasicTriList trilist, VideoCodecControllerJoinMap joinMap)
|
private void LinkVideoCodecScheduleToApi(IHasScheduleAwareness codec, BasicTriList trilist, VideoCodecControllerJoinMap joinMap)
|
||||||
{
|
{
|
||||||
trilist.SetSigFalseAction(joinMap.UpdateMeetings.JoinNumber, codec.GetSchedule);
|
trilist.SetSigFalseAction(joinMap.UpdateMeetings.JoinNumber, codec.GetSchedule);
|
||||||
@@ -594,10 +608,39 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
codec.CodecSchedule.MeetingWarningMinutes = i;
|
codec.CodecSchedule.MeetingWarningMinutes = i;
|
||||||
});
|
});
|
||||||
|
|
||||||
codec.CodecSchedule.MeetingsListHasChanged += (sender, args) => UpdateMeetingsList(codec, trilist, joinMap);
|
// TODO [ ] 2021-01-06, jkd: Added to debug OBTP dialing issues
|
||||||
|
trilist.SetSigFalseAction(joinMap.DialMeeting1.JoinNumber, () =>
|
||||||
|
{
|
||||||
|
var mtg = 1;
|
||||||
|
var index = mtg - 1;
|
||||||
|
Debug.Console(1, this, "Meeting {0} Selected (EISC dig-o{1}) > _currentMeetings[{2}].Id: {3}, Title: {4}",
|
||||||
|
mtg, joinMap.DialMeeting1.JoinNumber, index, _currentMeetings[index].Id, _currentMeetings[index].Title);
|
||||||
|
if (_currentMeetings[index] != null)
|
||||||
|
Dial(_currentMeetings[index]);
|
||||||
|
});
|
||||||
|
// TODO [ ] 2021-01-06, jkd: Added to debug OBTP dialing issues
|
||||||
|
trilist.SetSigFalseAction(joinMap.DialMeeting2.JoinNumber, () =>
|
||||||
|
{
|
||||||
|
var mtg = 2;
|
||||||
|
var index = mtg - 1;
|
||||||
|
Debug.Console(1, this, "Meeting {0} Selected (EISC dig-o{1}) > _currentMeetings[{2}].Id: {3}, Title: {4}",
|
||||||
|
mtg, joinMap.DialMeeting2.JoinNumber, index, _currentMeetings[index].Id, _currentMeetings[index].Title);
|
||||||
|
if (_currentMeetings[index] != null)
|
||||||
|
Dial(_currentMeetings[index]);
|
||||||
|
});
|
||||||
|
// TODO [ ] 2021-01-06, jkd: Added to debug OBTP dialing issues
|
||||||
|
trilist.SetSigFalseAction(joinMap.DialMeeting3.JoinNumber, () =>
|
||||||
|
{
|
||||||
|
var mtg = 3;
|
||||||
|
var index = mtg - 1;
|
||||||
|
Debug.Console(1, this, "Meeting {0} Selected (EISC dig-o{1}) > _currentMeetings[{2}].Id: {3}, Title: {4}",
|
||||||
|
mtg, joinMap.DialMeeting3.JoinNumber, index, _currentMeetings[index].Id, _currentMeetings[index].Title);
|
||||||
|
if (_currentMeetings[index] != null)
|
||||||
|
Dial(_currentMeetings[index]);
|
||||||
|
});
|
||||||
|
|
||||||
codec.CodecSchedule.MeetingEventChange +=
|
codec.CodecSchedule.MeetingsListHasChanged += (sender, args) => UpdateMeetingsList(codec, trilist, joinMap);
|
||||||
(sender, args) =>
|
codec.CodecSchedule.MeetingEventChange += (sender, args) =>
|
||||||
{
|
{
|
||||||
if (args.ChangeType == eMeetingEventChangeType.MeetingStartWarning)
|
if (args.ChangeType == eMeetingEventChangeType.MeetingStartWarning)
|
||||||
{
|
{
|
||||||
@@ -609,30 +652,18 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
private void UpdateMeetingsList(IHasScheduleAwareness codec, BasicTriList trilist, VideoCodecControllerJoinMap joinMap)
|
private void UpdateMeetingsList(IHasScheduleAwareness codec, BasicTriList trilist, VideoCodecControllerJoinMap joinMap)
|
||||||
{
|
{
|
||||||
var currentTime = DateTime.Now;
|
var currentTime = DateTime.Now;
|
||||||
var currentMeetings =
|
|
||||||
codec.CodecSchedule.Meetings.Where(m => m.StartTime >= currentTime || m.EndTime >= currentTime).ToList();
|
|
||||||
|
|
||||||
var meetingsData = UpdateMeetingsListXSig(currentMeetings);
|
// TODO [ ] 2021-01-06, jkd: Added to debug OBTP dialing issues
|
||||||
|
// - changed var currentMeetings >> field _currentMeetings
|
||||||
|
//_currentMeetings.Clear();
|
||||||
|
_currentMeetings = codec.CodecSchedule.Meetings.Where(m => m.StartTime >= currentTime || m.EndTime >= currentTime).ToList();
|
||||||
|
|
||||||
|
// TODO [ ] 2021-01-06, jkd: Added to debug OBTP dialing issues
|
||||||
|
// - moved the trilist.SetSigFlaseAction(joinMap.DialMeeting1..3.JoinNumber) lambda's to LinkVideoCodecScheduleToApi
|
||||||
|
|
||||||
|
var meetingsData = UpdateMeetingsListXSig(_currentMeetings);
|
||||||
trilist.SetString(joinMap.Schedule.JoinNumber, meetingsData);
|
trilist.SetString(joinMap.Schedule.JoinNumber, meetingsData);
|
||||||
|
trilist.SetUshort(joinMap.MeetingCount.JoinNumber, (ushort)_currentMeetings.Count);
|
||||||
trilist.SetSigFalseAction(joinMap.DialMeeting1.JoinNumber, () =>
|
|
||||||
{
|
|
||||||
if(codec.CodecSchedule.Meetings[0] != null)
|
|
||||||
Dial(codec.CodecSchedule.Meetings[0]);
|
|
||||||
});
|
|
||||||
trilist.SetSigFalseAction(joinMap.DialMeeting2.JoinNumber, () =>
|
|
||||||
{
|
|
||||||
if (codec.CodecSchedule.Meetings[1] != null)
|
|
||||||
Dial(codec.CodecSchedule.Meetings[1]);
|
|
||||||
});
|
|
||||||
trilist.SetSigFalseAction(joinMap.DialMeeting3.JoinNumber, () =>
|
|
||||||
{
|
|
||||||
if (codec.CodecSchedule.Meetings[2] != null)
|
|
||||||
Dial(codec.CodecSchedule.Meetings[2]);
|
|
||||||
});
|
|
||||||
|
|
||||||
trilist.SetUshort(joinMap.MeetingCount.JoinNumber, (ushort)currentMeetings.Count);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private string UpdateMeetingsListXSig(List<Meeting> meetings)
|
private string UpdateMeetingsListXSig(List<Meeting> meetings)
|
||||||
@@ -658,6 +689,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
* Start Time - 4
|
* Start Time - 4
|
||||||
* End Date - 5
|
* End Date - 5
|
||||||
* End Time - 6
|
* End Time - 6
|
||||||
|
* Id - 7
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
@@ -670,7 +702,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
if (meetingIndex >= maxMeetings * offset)
|
if (meetingIndex >= maxMeetings * offset)
|
||||||
{
|
{
|
||||||
Debug.Console(2, this, "Max Meetings reached");
|
Debug.Console(2, this, "Max Meetings reached");
|
||||||
break;}
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
//digitals
|
//digitals
|
||||||
tokenArray[digitalIndex] = new XSigDigitalToken(digitalIndex + 1, meeting.Joinable);
|
tokenArray[digitalIndex] = new XSigDigitalToken(digitalIndex + 1, meeting.Joinable);
|
||||||
@@ -813,7 +846,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
{
|
{
|
||||||
trilist.SetBool(joinMap.HookState.JoinNumber, IsInCall);
|
trilist.SetBool(joinMap.HookState.JoinNumber, IsInCall);
|
||||||
|
|
||||||
trilist.SetBool(joinMap.IncomingCall.JoinNumber, args.CallItem.Direction == eCodecCallDirection.Incoming);
|
Debug.Console(1, this, "Call Direction: {0}", args.CallItem.Direction);
|
||||||
|
Debug.Console(1, this, "Call is incoming: {0}", args.CallItem.Direction == eCodecCallDirection.Incoming);
|
||||||
|
trilist.SetBool(joinMap.IncomingCall.JoinNumber, args.CallItem.Direction == eCodecCallDirection.Incoming && args.CallItem.Status == eCodecCallStatus.Ringing);
|
||||||
|
|
||||||
if (args.CallItem.Direction == eCodecCallDirection.Incoming)
|
if (args.CallItem.Direction == eCodecCallDirection.Incoming)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -205,7 +205,14 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
|||||||
|
|
||||||
protected Func<string> SelfviewPipPositionFeedbackFunc
|
protected Func<string> SelfviewPipPositionFeedbackFunc
|
||||||
{
|
{
|
||||||
get { return () => _currentSelfviewPipPosition.Command; }
|
get
|
||||||
|
{
|
||||||
|
return
|
||||||
|
() =>
|
||||||
|
_currentSelfviewPipPosition != null
|
||||||
|
? _currentSelfviewPipPosition.Command ?? "Unknown"
|
||||||
|
: "Unknown";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Func<string> LocalLayoutFeedbackFunc
|
protected Func<string> LocalLayoutFeedbackFunc
|
||||||
@@ -1373,13 +1380,17 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private void UpdateCallStatus()
|
private void UpdateCallStatus()
|
||||||
{
|
{
|
||||||
|
Debug.Console(1, this, "[UpdateCallStatus] Current Call Status: {0}",
|
||||||
|
Status.Call != null ? Status.Call.Sharing.State.ToString() : "no call");
|
||||||
|
|
||||||
if (Status.Call != null)
|
if (Status.Call != null)
|
||||||
{
|
{
|
||||||
var callStatus = Status.Call.Status;
|
var callStatus = Status.Call.Status;
|
||||||
|
|
||||||
// If not currently in a meeting, intialize the call object
|
// If not currently in a meeting, intialize the call object
|
||||||
if (callStatus != zStatus.eCallStatus.IN_MEETING || callStatus != zStatus.eCallStatus.CONNECTING_MEETING)
|
if (callStatus != zStatus.eCallStatus.IN_MEETING && callStatus != zStatus.eCallStatus.CONNECTING_MEETING)
|
||||||
{
|
{
|
||||||
|
Debug.Console(1, this, "Creating new Status.Call object");
|
||||||
Status.Call = new zStatus.Call {Status = callStatus};
|
Status.Call = new zStatus.Call {Status = callStatus};
|
||||||
|
|
||||||
SetUpCallFeedbackActions();
|
SetUpCallFeedbackActions();
|
||||||
@@ -1406,6 +1417,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
|||||||
|
|
||||||
ActiveCalls.Add(newCall);
|
ActiveCalls.Add(newCall);
|
||||||
|
|
||||||
|
Debug.Console(1, this, "[UpdateCallStatus] Current Call Status: {0}",
|
||||||
|
Status.Call != null ? Status.Call.Sharing.State.ToString() : "no call");
|
||||||
|
|
||||||
OnCallStatusChange(newCall);
|
OnCallStatusChange(newCall);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1423,6 +1437,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Debug.Console(1, this, "[UpdateCallStatus] Current Call Status: {0}",
|
||||||
|
Status.Call != null ? Status.Call.Sharing.State.ToString() : "no call");
|
||||||
|
|
||||||
OnCallStatusChange(existingCall);
|
OnCallStatusChange(existingCall);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1460,6 +1477,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
|||||||
{
|
{
|
||||||
base.OnCallStatusChange(item);
|
base.OnCallStatusChange(item);
|
||||||
|
|
||||||
|
Debug.Console(1, this, "[OnCallStatusChange] Current Call Status: {0}",
|
||||||
|
Status.Call != null ? Status.Call.Sharing.State.ToString() : "no call");
|
||||||
|
|
||||||
if (_props.AutoDefaultLayouts)
|
if (_props.AutoDefaultLayouts)
|
||||||
{
|
{
|
||||||
SetLayout();
|
SetLayout();
|
||||||
@@ -1605,6 +1625,12 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
|||||||
public override void AcceptCall(CodecActiveCallItem call)
|
public override void AcceptCall(CodecActiveCallItem call)
|
||||||
{
|
{
|
||||||
SendText(string.Format("zCommand Call Accept callerJID: {0}", call.Id));
|
SendText(string.Format("zCommand Call Accept callerJID: {0}", call.Id));
|
||||||
|
|
||||||
|
call.Status = eCodecCallStatus.Connected;
|
||||||
|
|
||||||
|
OnCallStatusChange(call);
|
||||||
|
|
||||||
|
UpdateCallStatus();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RejectCall()
|
public void RejectCall()
|
||||||
@@ -1619,10 +1645,17 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
|||||||
public override void RejectCall(CodecActiveCallItem call)
|
public override void RejectCall(CodecActiveCallItem call)
|
||||||
{
|
{
|
||||||
SendText(string.Format("zCommand Call Reject callerJID: {0}", call.Id));
|
SendText(string.Format("zCommand Call Reject callerJID: {0}", call.Id));
|
||||||
|
|
||||||
|
call.Status = eCodecCallStatus.Disconnected;
|
||||||
|
|
||||||
|
OnCallStatusChange(call);
|
||||||
|
|
||||||
|
UpdateCallStatus();
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Dial(Meeting meeting)
|
public override void Dial(Meeting meeting)
|
||||||
{
|
{
|
||||||
|
Debug.Console(1, this,"Dialing meeting.Id: {0} Title: {1}", meeting.Id, meeting.Title);
|
||||||
SendText(string.Format("zCommand Dial Start meetingNumber: {0}", meeting.Id));
|
SendText(string.Format("zCommand Dial Start meetingNumber: {0}", meeting.Id));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
<packages>
|
<packages>
|
||||||
<package id="PepperDashCore" version="1.0.42" targetFramework="net35" allowedVersions="[1.0,1.1)"/>
|
<package id="PepperDashCore" version="1.0.45" targetFramework="net35" allowedVersions="[1.0,1.1)"/>
|
||||||
</packages>
|
</packages>
|
||||||
Reference in New Issue
Block a user