mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-01-12 03:54:51 +00:00
Compare commits
251 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
65b95006be | ||
|
|
c871f5e6c8 | ||
|
|
66b08b6be0 | ||
|
|
0228d2938d | ||
|
|
d2fc4d2175 | ||
|
|
5f4793ed0c | ||
|
|
f33f42a40e | ||
|
|
86dcd066fe | ||
|
|
c420e06540 | ||
|
|
00e14b746b | ||
|
|
ee26e77f15 | ||
|
|
8a09ffa7e4 | ||
|
|
4d300a9b68 | ||
|
|
dc9eee9325 | ||
|
|
f5586d2c9d | ||
|
|
b5a7c76c3f | ||
|
|
4f35a4285b | ||
|
|
28d5daab5b | ||
|
|
1a80bcf5c2 | ||
|
|
e5d745f508 | ||
|
|
a799973e52 | ||
|
|
6a9a793bc5 | ||
|
|
7835ed12bb | ||
|
|
f1278d0ee4 | ||
|
|
56fae89ae2 | ||
|
|
9a2c001a93 | ||
|
|
48cc8ec33f | ||
|
|
7e406dd987 | ||
|
|
1fdad20abd | ||
|
|
704bcc974b | ||
|
|
f3e460677d | ||
|
|
f52ee9ab5d | ||
|
|
2822952491 | ||
|
|
0d47cce442 | ||
|
|
615dde41c2 | ||
|
|
ee2a619aa5 | ||
|
|
af5699a0b0 | ||
|
|
a0db8532b6 | ||
|
|
d1fb97ec7a | ||
|
|
d18f79ac48 | ||
|
|
2072f0bff8 | ||
|
|
f479418492 | ||
|
|
07bc288fd0 | ||
|
|
62ca5f6f07 | ||
|
|
f7aaf7a576 | ||
|
|
59590e5463 | ||
|
|
d2b8d38000 | ||
|
|
48da139b2f | ||
|
|
32a548b8fb | ||
|
|
0724ec06eb | ||
|
|
f000097a03 | ||
|
|
22c769ab98 | ||
|
|
6377b1bc78 | ||
|
|
2b3921ce8a | ||
|
|
df6bd2a21f | ||
|
|
8d3b409ec3 | ||
|
|
9eb48acd6a | ||
|
|
4361fe6186 | ||
|
|
09bc84346d | ||
|
|
00e3e6af35 | ||
|
|
61f24321c3 | ||
|
|
8f530aa7fe | ||
|
|
36cd356bc5 | ||
|
|
b72f55228a | ||
|
|
1017464980 | ||
|
|
47f4d90c5a | ||
|
|
c3dbd41942 | ||
|
|
45788a4d6b | ||
|
|
d63787bc78 | ||
|
|
d269a04bab | ||
|
|
cc5889385e | ||
|
|
fe14d543d6 | ||
|
|
9a4af1703b | ||
|
|
5987b5b078 | ||
|
|
531f93040a | ||
|
|
5fc93ca251 | ||
|
|
bd4bb24945 | ||
|
|
10104e2a09 | ||
|
|
c99ba9ca1d | ||
|
|
74de1c2475 | ||
|
|
ce247b8e8a | ||
|
|
8e0262e1c3 | ||
|
|
f2e2166146 | ||
|
|
89db680986 | ||
|
|
11a01c707c | ||
|
|
db08b1fcd9 | ||
|
|
9c0440e8f0 | ||
|
|
2173116664 | ||
|
|
419d956a8d | ||
|
|
f44bde2d83 | ||
|
|
6c7bc1a24e | ||
|
|
af62bf86a5 | ||
|
|
905c40dc0a | ||
|
|
492d8f8203 | ||
|
|
dd7408dbf1 | ||
|
|
52c387081c | ||
|
|
84374a8af0 | ||
|
|
c0b59c375e | ||
|
|
0eb6411dd9 | ||
|
|
405677a3df | ||
|
|
a1de8e2edd | ||
|
|
841cc1a5e4 | ||
|
|
130bac79f3 | ||
|
|
1a9546c970 | ||
|
|
89f6300d14 | ||
|
|
2012f55735 | ||
|
|
ed468add2c | ||
|
|
c22e95cad2 | ||
|
|
59b2e9a8d6 | ||
|
|
13132c29fc | ||
|
|
407a354cfe | ||
|
|
2fe1ac0e75 | ||
|
|
fcfec55b20 | ||
|
|
ae87498c0b | ||
|
|
5b05e8bb48 | ||
|
|
96d48c9d56 | ||
|
|
d21f6798fd | ||
|
|
ac93081278 | ||
|
|
690ba92773 | ||
|
|
115745467a | ||
|
|
0bb107f5ef | ||
|
|
3887a07d55 | ||
|
|
da832a7da1 | ||
|
|
0e80c6f54d | ||
|
|
c7b813447c | ||
|
|
1257dde4ce | ||
|
|
af7d97efef | ||
|
|
ce782c1cd3 | ||
|
|
f93287641f | ||
|
|
d2e9c2e238 | ||
|
|
4b926c10f6 | ||
|
|
7e9256187a | ||
|
|
061d95e2b1 | ||
|
|
78fe799afc | ||
|
|
596b8bf29a | ||
|
|
87de4a4bf0 | ||
|
|
52343ddf7b | ||
|
|
854c2bcb6f | ||
|
|
0b9ed462b4 | ||
|
|
4dafa34b2e | ||
|
|
f1611da74c | ||
|
|
d588757eb6 | ||
|
|
5bb5c9e07f | ||
|
|
176c9d9835 | ||
|
|
6726e989a7 | ||
|
|
77fbee78a8 | ||
|
|
172e2fb744 | ||
|
|
f2b2825220 | ||
|
|
1b832409e4 | ||
|
|
969ba3c87c | ||
|
|
d93a563cd8 | ||
|
|
63f81456e8 | ||
|
|
764d8d2b48 | ||
|
|
1ae6069ac2 | ||
|
|
7eccc82541 | ||
|
|
b2dbd3c377 | ||
|
|
47e47ec272 | ||
|
|
c392ac6b06 | ||
|
|
af2fe7e54e | ||
|
|
3f68a84fe8 | ||
|
|
5d93a5177c | ||
|
|
f83a7aecf2 | ||
|
|
6b21b37aef | ||
|
|
b1459da2ba | ||
|
|
82e2f1e959 | ||
|
|
c329e31802 | ||
|
|
2b9615ad94 | ||
|
|
71098ca65d | ||
|
|
b917ff980a | ||
|
|
c3c9c584ae | ||
|
|
b6f6c72c92 | ||
|
|
59b2995a1b | ||
|
|
bdf3e2054f | ||
|
|
1acb3a20c5 | ||
|
|
2c98fc4545 | ||
|
|
05c9dd3c69 | ||
|
|
5de8b703dd | ||
|
|
a3887510df | ||
|
|
dc8d0e25d5 | ||
|
|
028e411ffe | ||
|
|
5aed3c4480 | ||
|
|
ddfd1d0586 | ||
|
|
77d5438063 | ||
|
|
42a79f0e1e | ||
|
|
f8a6ef8c41 | ||
|
|
af1489d511 | ||
|
|
aa2b5b9ab4 | ||
|
|
fd2fe8fa6e | ||
|
|
15c6da43eb | ||
|
|
6725266ad9 | ||
|
|
8f564a82d4 | ||
|
|
6f6ff28784 | ||
|
|
0a0bfc018d | ||
|
|
bd5a69a83c | ||
|
|
48c6bb78bc | ||
|
|
2cd68d40dc | ||
|
|
43281f0db6 | ||
|
|
fa141c6207 | ||
|
|
07d6fcef1c | ||
|
|
a5ea9bb1eb | ||
|
|
90c122d966 | ||
|
|
634b07dc12 | ||
|
|
699900518a | ||
|
|
ea2d573ab3 | ||
|
|
5c923e66ec | ||
|
|
7958c64e67 | ||
|
|
410ffd2f19 | ||
|
|
53e0599e2a | ||
|
|
af12a81c00 | ||
|
|
2a9e7c81eb | ||
|
|
c15adea02e | ||
|
|
935f2c4bf4 | ||
|
|
327a9a5f6b | ||
|
|
b7ed1d8238 | ||
|
|
aff4e5a61f | ||
|
|
fe172098b9 | ||
|
|
f2c2cd423d | ||
|
|
22722fca21 | ||
|
|
6efec400b8 | ||
|
|
f82816729b | ||
|
|
1b599ff863 | ||
|
|
ae23e48fd0 | ||
|
|
a8f1f77d48 | ||
|
|
68064c7194 | ||
|
|
3ceecd3fbe | ||
|
|
8585977f71 | ||
|
|
288c9bb04c | ||
|
|
47fb805766 | ||
|
|
31b0683cdf | ||
|
|
04194da31c | ||
|
|
09bdc49c15 | ||
|
|
e36b2b97d2 | ||
|
|
d705525a45 | ||
|
|
ecce6e2be9 | ||
|
|
95c0f57000 | ||
|
|
697b9109a3 | ||
|
|
727367c061 | ||
|
|
f26ff0b767 | ||
|
|
44b72dcfe5 | ||
|
|
937f3f3dc0 | ||
|
|
17bf6e3f0a | ||
|
|
e7253b4acc | ||
|
|
71a27027e7 | ||
|
|
2655b8f7b8 | ||
|
|
3adee8bc30 | ||
|
|
e3a3a2cd2d | ||
|
|
6235b44d89 | ||
|
|
90bbd65fdc | ||
|
|
43fd263ea1 | ||
|
|
038e23289e | ||
|
|
47675f12b4 |
3
.gitignore
vendored
3
.gitignore
vendored
@@ -20,4 +20,5 @@ obj/
|
||||
[Rr]elease*/
|
||||
_ReSharper*/
|
||||
SIMPLSharpLogs/
|
||||
*.projectinfo
|
||||
*.projectinfo
|
||||
essentials-framework/EssentialDMTestConfig/
|
||||
|
||||
6
.gitmodules
vendored
6
.gitmodules
vendored
@@ -1,3 +1,3 @@
|
||||
[submodule "essentials-framework"]
|
||||
path = essentials-framework
|
||||
url = https://bitbucket.org/Pepperdash_Products/essentials-framework.git
|
||||
[submodule "essentials-framework/pepperdashcore-builds"]
|
||||
path = essentials-framework/pepperdashcore-builds
|
||||
url = https://github.com/ndorin/PepperDashCore-Builds.git
|
||||
|
||||
BIN
IR Drivers/samsung_un_series.ir
Normal file
BIN
IR Drivers/samsung_un_series.ir
Normal file
Binary file not shown.
7
LICENSE.md
Normal file
7
LICENSE.md
Normal file
@@ -0,0 +1,7 @@
|
||||
Copyright (c) <2020> PepperDash Technology Corporation
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
@@ -1,49 +1,49 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 10.00
|
||||
# Visual Studio 2008
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PepperDashEssentials", ".\PepperDashEssentials\PepperDashEssentials.csproj", "{1BED5BA9-88C4-4365-9362-6F4B128071D3}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{892B761C-E479-44CE-BD74-243E9214AF13} = {892B761C-E479-44CE-BD74-243E9214AF13}
|
||||
{9199CE8A-0C9F-4952-8672-3EED798B284F} = {9199CE8A-0C9F-4952-8672-3EED798B284F}
|
||||
{A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5} = {A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PepperDash_Essentials_Core", ".\essentials-framework\Essentials Core\PepperDashEssentialsBase\PepperDash_Essentials_Core.csproj", "{A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Essentials Devices Common", ".\essentials-framework\Essentials Devices Common\Essentials Devices Common\Essentials Devices Common.csproj", "{892B761C-E479-44CE-BD74-243E9214AF13}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5} = {A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Essentials_DM", ".\essentials-framework\Essentials DM\Essentials_DM\Essentials_DM.csproj", "{9199CE8A-0C9F-4952-8672-3EED798B284F}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5} = {A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{1BED5BA9-88C4-4365-9362-6F4B128071D3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{1BED5BA9-88C4-4365-9362-6F4B128071D3}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{1BED5BA9-88C4-4365-9362-6F4B128071D3}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{1BED5BA9-88C4-4365-9362-6F4B128071D3}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{892B761C-E479-44CE-BD74-243E9214AF13}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{892B761C-E479-44CE-BD74-243E9214AF13}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{892B761C-E479-44CE-BD74-243E9214AF13}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{892B761C-E479-44CE-BD74-243E9214AF13}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{9199CE8A-0C9F-4952-8672-3EED798B284F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{9199CE8A-0C9F-4952-8672-3EED798B284F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{9199CE8A-0C9F-4952-8672-3EED798B284F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{9199CE8A-0C9F-4952-8672-3EED798B284F}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 10.00
|
||||
# Visual Studio 2008
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PepperDashEssentials", ".\PepperDashEssentials\PepperDashEssentials.csproj", "{1BED5BA9-88C4-4365-9362-6F4B128071D3}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{892B761C-E479-44CE-BD74-243E9214AF13} = {892B761C-E479-44CE-BD74-243E9214AF13}
|
||||
{9199CE8A-0C9F-4952-8672-3EED798B284F} = {9199CE8A-0C9F-4952-8672-3EED798B284F}
|
||||
{A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5} = {A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PepperDash_Essentials_Core", ".\essentials-framework\Essentials Core\PepperDashEssentialsBase\PepperDash_Essentials_Core.csproj", "{A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Essentials Devices Common", ".\essentials-framework\Essentials Devices Common\Essentials Devices Common\Essentials Devices Common.csproj", "{892B761C-E479-44CE-BD74-243E9214AF13}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5} = {A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Essentials_DM", ".\essentials-framework\Essentials DM\Essentials_DM\Essentials_DM.csproj", "{9199CE8A-0C9F-4952-8672-3EED798B284F}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5} = {A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{1BED5BA9-88C4-4365-9362-6F4B128071D3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{1BED5BA9-88C4-4365-9362-6F4B128071D3}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{1BED5BA9-88C4-4365-9362-6F4B128071D3}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{1BED5BA9-88C4-4365-9362-6F4B128071D3}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{892B761C-E479-44CE-BD74-243E9214AF13}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{892B761C-E479-44CE-BD74-243E9214AF13}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{892B761C-E479-44CE-BD74-243E9214AF13}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{892B761C-E479-44CE-BD74-243E9214AF13}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{9199CE8A-0C9F-4952-8672-3EED798B284F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{9199CE8A-0C9F-4952-8672-3EED798B284F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{9199CE8A-0C9F-4952-8672-3EED798B284F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{9199CE8A-0C9F-4952-8672-3EED798B284F}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
||||
@@ -6,11 +6,11 @@ using Crestron.SimplSharp;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Room.Cotija
|
||||
namespace PepperDash.Essentials.Room.MobileControl
|
||||
{
|
||||
public static class IChannelExtensions
|
||||
{
|
||||
public static void LinkActions(this IChannel dev, CotijaSystemController controller)
|
||||
public static void LinkActions(this IChannel dev, MobileControlSystemController controller)
|
||||
{
|
||||
var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace PepperDash.Essentials.Room.Cotija
|
||||
controller.AddAction(prefix + "exit", new PressAndHoldAction(dev.Exit));
|
||||
}
|
||||
|
||||
public static void UnlinkActions(this IChannel dev, CotijaSystemController controller)
|
||||
public static void UnlinkActions(this IChannel dev, MobileControlSystemController controller)
|
||||
{
|
||||
var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);
|
||||
|
||||
|
||||
@@ -6,11 +6,11 @@ using Crestron.SimplSharp;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Room.Cotija
|
||||
namespace PepperDash.Essentials.Room.MobileControl
|
||||
{
|
||||
public static class IColorExtensions
|
||||
{
|
||||
public static void LinkActions(this IColor dev, CotijaSystemController controller)
|
||||
public static void LinkActions(this IColor dev, MobileControlSystemController controller)
|
||||
{
|
||||
var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace PepperDash.Essentials.Room.Cotija
|
||||
controller.AddAction(prefix + "blue", new PressAndHoldAction(dev.Blue));
|
||||
}
|
||||
|
||||
public static void UnlinkActions(this IColor dev, CotijaSystemController controller)
|
||||
public static void UnlinkActions(this IColor dev, MobileControlSystemController controller)
|
||||
{
|
||||
var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);
|
||||
|
||||
|
||||
@@ -6,11 +6,11 @@ using Crestron.SimplSharp;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Room.Cotija
|
||||
namespace PepperDash.Essentials.Room.MobileControl
|
||||
{
|
||||
public static class IDPadExtensions
|
||||
{
|
||||
public static void LinkActions(this IDPad dev, CotijaSystemController controller)
|
||||
public static void LinkActions(this IDPad dev, MobileControlSystemController controller)
|
||||
{
|
||||
var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace PepperDash.Essentials.Room.Cotija
|
||||
controller.AddAction(prefix + "exit", new PressAndHoldAction(dev.Exit));
|
||||
}
|
||||
|
||||
public static void UnlinkActions(this IDPad dev, CotijaSystemController controller)
|
||||
public static void UnlinkActions(this IDPad dev, MobileControlSystemController controller)
|
||||
{
|
||||
var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);
|
||||
|
||||
|
||||
@@ -6,11 +6,11 @@ using Crestron.SimplSharp;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Room.Cotija
|
||||
namespace PepperDash.Essentials.Room.MobileControl
|
||||
{
|
||||
public static class IDvrExtensions
|
||||
{
|
||||
public static void LinkActions(this IDvr dev, CotijaSystemController controller)
|
||||
public static void LinkActions(this IDvr dev, MobileControlSystemController controller)
|
||||
{
|
||||
var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace PepperDash.Essentials.Room.Cotija
|
||||
controller.AddAction(prefix + "record", new PressAndHoldAction(dev.Record));
|
||||
}
|
||||
|
||||
public static void UnlinkActions(this IDvr dev, CotijaSystemController controller)
|
||||
public static void UnlinkActions(this IDvr dev, MobileControlSystemController controller)
|
||||
{
|
||||
var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);
|
||||
|
||||
|
||||
@@ -6,11 +6,11 @@ using Crestron.SimplSharp;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Room.Cotija
|
||||
namespace PepperDash.Essentials.Room.MobileControl
|
||||
{
|
||||
public static class INumericExtensions
|
||||
{
|
||||
public static void LinkActions(this INumericKeypad dev, CotijaSystemController controller)
|
||||
public static void LinkActions(this INumericKeypad dev, MobileControlSystemController controller)
|
||||
{
|
||||
var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace PepperDash.Essentials.Room.Cotija
|
||||
// Deal with the Accessory functions on the numpad later
|
||||
}
|
||||
|
||||
public static void UnlinkActions(this INumericKeypad dev, CotijaSystemController controller)
|
||||
public static void UnlinkActions(this INumericKeypad dev, MobileControlSystemController controller)
|
||||
{
|
||||
var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);
|
||||
|
||||
|
||||
@@ -6,11 +6,11 @@ using Crestron.SimplSharp;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Room.Cotija
|
||||
namespace PepperDash.Essentials.Room.MobileControl
|
||||
{
|
||||
public static class IPowerExtensions
|
||||
{
|
||||
public static void LinkActions(this IPower dev, CotijaSystemController controller)
|
||||
public static void LinkActions(this IPower dev, MobileControlSystemController controller)
|
||||
{
|
||||
var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace PepperDash.Essentials.Room.Cotija
|
||||
controller.AddAction(prefix + "powerToggle", new Action(dev.PowerToggle));
|
||||
}
|
||||
|
||||
public static void UnlinkActions(this IPower dev, CotijaSystemController controller)
|
||||
public static void UnlinkActions(this IPower dev, MobileControlSystemController controller)
|
||||
{
|
||||
var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);
|
||||
|
||||
|
||||
@@ -6,11 +6,11 @@ using Crestron.SimplSharp;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Room.Cotija
|
||||
namespace PepperDash.Essentials.Room.MobileControl
|
||||
{
|
||||
public static class ISetTopBoxControlsExtensions
|
||||
{
|
||||
public static void LinkActions(this ISetTopBoxControls dev, CotijaSystemController controller)
|
||||
public static void LinkActions(this ISetTopBoxControls dev, MobileControlSystemController controller)
|
||||
{
|
||||
var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace PepperDash.Essentials.Room.Cotija
|
||||
controller.AddAction(prefix + "replay", new PressAndHoldAction(dev.Replay));
|
||||
}
|
||||
|
||||
public static void UnlinkActions(this ISetTopBoxControls dev, CotijaSystemController controller)
|
||||
public static void UnlinkActions(this ISetTopBoxControls dev, MobileControlSystemController controller)
|
||||
{
|
||||
var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);
|
||||
|
||||
|
||||
@@ -6,11 +6,11 @@ using Crestron.SimplSharp;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Room.Cotija
|
||||
namespace PepperDash.Essentials.Room.MobileControl
|
||||
{
|
||||
public static class ITransportExtensions
|
||||
{
|
||||
public static void LinkActions(this ITransport dev, CotijaSystemController controller)
|
||||
public static void LinkActions(this ITransport dev, MobileControlSystemController controller)
|
||||
{
|
||||
var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace PepperDash.Essentials.Room.Cotija
|
||||
controller.AddAction(prefix + "record", new PressAndHoldAction(dev.Record));
|
||||
}
|
||||
|
||||
public static void UnlinkActions(this ITransport dev, CotijaSystemController controller)
|
||||
public static void UnlinkActions(this ITransport dev, MobileControlSystemController controller)
|
||||
{
|
||||
var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ using Crestron.SimplSharp;
|
||||
|
||||
using PepperDash.Essentials.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Room.Cotija
|
||||
namespace PepperDash.Essentials.Room.MobileControl
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a room whose configuration is derived from runtime data,
|
||||
@@ -19,42 +19,3 @@ namespace PepperDash.Essentials.Room.Cotija
|
||||
}
|
||||
}
|
||||
|
||||
namespace PepperDash.Essentials
|
||||
{
|
||||
/// <summary>
|
||||
/// For rooms with a single presentation source, change event
|
||||
/// </summary>
|
||||
public interface IHasCurrentSourceInfoChange
|
||||
{
|
||||
string CurrentSourceInfoKey { get; }
|
||||
SourceListItem CurrentSourceInfo { get; }
|
||||
event SourceInfoChangeHandler CurrentSingleSourceChange;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// For rooms with routing
|
||||
/// </summary>
|
||||
public interface IRunRouteAction
|
||||
{
|
||||
void RunRouteAction(string routeKey);
|
||||
|
||||
void RunRouteAction(string routeKey, Action successCallback);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// For rooms that default presentation only routing
|
||||
/// </summary>
|
||||
public interface IRunDefaultPresentRoute
|
||||
{
|
||||
bool RunDefaultPresentRoute();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// For rooms that have default presentation and calling routes
|
||||
/// </summary>
|
||||
public interface IRunDefaultCallRoute : IRunDefaultPresentRoute
|
||||
{
|
||||
bool RunDefaultCallRoute();
|
||||
}
|
||||
}
|
||||
@@ -39,7 +39,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
|
||||
}
|
||||
|
||||
protected override void CustomRegisterWithAppServer(CotijaSystemController appServerController)
|
||||
protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
|
||||
{
|
||||
appServerController.AddAction(MessagePath + "/fullStatus", new Action(SendAtcFullMessageObject));
|
||||
appServerController.AddAction(MessagePath + "/dial", new Action<string>(s => Codec.Dial(s)));
|
||||
|
||||
75
PepperDashEssentials/AppServer/Messengers/ConfigMessenger.cs
Normal file
75
PepperDashEssentials/AppServer/Messengers/ConfigMessenger.cs
Normal file
@@ -0,0 +1,75 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core.Config;
|
||||
|
||||
namespace PepperDash.Essentials.AppServer.Messengers
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Handles interactions with the app server to update the config
|
||||
/// </summary>
|
||||
public class ConfigMessenger : MessengerBase
|
||||
{
|
||||
public ConfigMessenger(string key, string messagePath)
|
||||
: base(key, messagePath)
|
||||
{
|
||||
ConfigUpdater.ConfigStatusChanged -= ConfigUpdater_ConfigStatusChanged;
|
||||
ConfigUpdater.ConfigStatusChanged += new EventHandler<ConfigStatusEventArgs>(ConfigUpdater_ConfigStatusChanged);
|
||||
}
|
||||
|
||||
void ConfigUpdater_ConfigStatusChanged(object sender, ConfigStatusEventArgs e)
|
||||
{
|
||||
PostUpdateStatus(e.UpdateStatus.ToString());
|
||||
}
|
||||
|
||||
protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
|
||||
{
|
||||
appServerController.AddAction(MessagePath + "/updateConfig", new Action<string>(s => GetConfigFile(s)));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Generates or passes the URL to make the request to GET the config from a server
|
||||
/// </summary>
|
||||
/// <param name="url"></param>
|
||||
void GetConfigFile(string url)
|
||||
{
|
||||
try
|
||||
{
|
||||
// Attempt to parse the URL
|
||||
var parser = new Crestron.SimplSharp.Net.Http.UrlParser(url);
|
||||
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Successfully parsed URL from AppServer message: {0}", parser.Url);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
// If unable to parse the URL, generate it from config data
|
||||
Debug.Console(2, "Error parsing URL: {0}", e);
|
||||
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Unable to parse URL from AppServer message. Generating URL from config data");
|
||||
url = string.Format("http://{0}/api/system/{1}/config", AppServerController.Config.ServerUrl, AppServerController.SystemUuid);
|
||||
}
|
||||
|
||||
ConfigUpdater.GetConfigFromServer(url);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Posts a message with the current status of the config update
|
||||
/// </summary>
|
||||
/// <param name="status"></param>
|
||||
void PostUpdateStatus(string status)
|
||||
{
|
||||
PostStatusMessage(new
|
||||
{
|
||||
updateStatus = status
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -19,7 +19,8 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
/// <summary>
|
||||
/// 221
|
||||
/// </summary>
|
||||
const uint BDialHangup = 221;
|
||||
const uint BDialHangupOnHook = 221;
|
||||
|
||||
/// <summary>
|
||||
/// 251
|
||||
/// </summary>
|
||||
@@ -126,7 +127,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="appServerController"></param>
|
||||
protected override void CustomRegisterWithAppServer(CotijaSystemController appServerController)
|
||||
protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
|
||||
{
|
||||
//EISC.SetStringSigAction(SCurrentDialString, s => PostStatusMessage(new { currentDialString = s }));
|
||||
|
||||
@@ -134,7 +135,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
{
|
||||
CurrentCallItem.Status = (eCodecCallStatus)Enum.Parse(typeof(eCodecCallStatus), s, true);
|
||||
//GetCurrentCallList();
|
||||
SendCallsList();
|
||||
SendFullStatus();
|
||||
});
|
||||
|
||||
EISC.SetStringSigAction(SCurrentCallNumber, s =>
|
||||
@@ -162,7 +163,8 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
// Add straight pulse calls
|
||||
Action<string, uint> addAction = (s, u) =>
|
||||
AppServerController.AddAction(MessagePath + s, new Action(() => EISC.PulseBool(u, 100)));
|
||||
addAction("/endCallById", BDialHangup);
|
||||
addAction("/endCallById", BDialHangupOnHook);
|
||||
addAction("/endAllCalls", BDialHangupOnHook);
|
||||
addAction("/acceptById", BIncomingAnswer);
|
||||
addAction("/rejectById", BIncomingReject);
|
||||
addAction("/speedDial1", BSpeedDial1);
|
||||
|
||||
@@ -123,6 +123,23 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
/// </summary>
|
||||
const uint BCameraModeOff = 833;
|
||||
|
||||
/// <summary>
|
||||
/// 841
|
||||
/// </summary>
|
||||
const uint BCameraSelfView = 841;
|
||||
|
||||
/// <summary>
|
||||
/// 842
|
||||
/// </summary>
|
||||
const uint BCameraLayout = 842;
|
||||
/// <summary>
|
||||
/// 843
|
||||
/// </summary>
|
||||
const uint BCameraSupportsAutoMode = 843;
|
||||
/// <summary>
|
||||
/// 844
|
||||
/// </summary>
|
||||
const uint BCameraSupportsOffMode = 844;
|
||||
|
||||
|
||||
/********* Ushorts *********/
|
||||
@@ -236,7 +253,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="appServerController"></param>
|
||||
protected override void CustomRegisterWithAppServer(CotijaSystemController appServerController)
|
||||
protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
|
||||
{
|
||||
var asc = appServerController;
|
||||
EISC.SetStringSigAction(SHookState, s =>
|
||||
@@ -285,6 +302,21 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
PostCallsList();
|
||||
});
|
||||
|
||||
EISC.SetBoolSigAction(BCameraSupportsAutoMode, b =>
|
||||
{
|
||||
PostStatusMessage(new
|
||||
{
|
||||
cameraSupportsAutoMode = b
|
||||
});
|
||||
});
|
||||
EISC.SetBoolSigAction(BCameraSupportsOffMode, b =>
|
||||
{
|
||||
PostStatusMessage(new
|
||||
{
|
||||
cameraSupportsOffMode = b
|
||||
});
|
||||
});
|
||||
|
||||
// Directory insanity
|
||||
EISC.SetUShortSigAction(UDirectoryRowCount, u =>
|
||||
{
|
||||
@@ -330,6 +362,11 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
EISC.SetSigTrueAction(BCameraModeManual, () => PostCameraMode());
|
||||
EISC.SetSigTrueAction(BCameraModeOff, () => PostCameraMode());
|
||||
|
||||
EISC.SetBoolSigAction(BCameraSelfView, b => PostStatusMessage(new
|
||||
{
|
||||
cameraSelfView = b
|
||||
}));
|
||||
|
||||
EISC.SetUShortSigAction(UCameraNumberSelect, (u) => PostSelectedCamera());
|
||||
|
||||
|
||||
@@ -347,6 +384,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
Action<string, uint> addAction = (s, u) =>
|
||||
AppServerController.AddAction(MessagePath + s, new Action(() => EISC.PulseBool(u, 100)));
|
||||
addAction("/endCallById", BDialHangup);
|
||||
addAction("/endAllCalls", BDialHangup);
|
||||
addAction("/acceptById", BIncomingAnswer);
|
||||
addAction("/rejectById", BIncomingReject);
|
||||
addAction("/speedDial1", BSpeedDial1);
|
||||
@@ -356,6 +394,8 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
addAction("/cameraModeAuto", BCameraModeAuto);
|
||||
addAction("/cameraModeManual", BCameraModeManual);
|
||||
addAction("/cameraModeOff", BCameraModeOff);
|
||||
addAction("/cameraSelfView", BCameraSelfView);
|
||||
addAction("/cameraLayout", BCameraLayout);
|
||||
|
||||
asc.AddAction("/cameraSelect", new Action<string>(SelectCamera));
|
||||
|
||||
@@ -437,6 +477,9 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
{
|
||||
calls = GetCurrentCallList(),
|
||||
cameraMode = GetCameraMode(),
|
||||
cameraSelfView = EISC.GetBool(BCameraSelfView),
|
||||
cameraSupportsAutoMode = EISC.GetBool(BCameraSupportsAutoMode),
|
||||
cameraSupportsOffMode = EISC.GetBool(BCameraSupportsOffMode),
|
||||
currentCallString = EISC.GetString(SCurrentCallNumber),
|
||||
currentDialString = EISC.GetString(SCurrentDialString),
|
||||
directoryContactSelected = new
|
||||
@@ -448,8 +491,9 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
isInCall = EISC.GetString(SHookState) == "Connected",
|
||||
hasDirectory = true,
|
||||
hasDirectorySearch = false,
|
||||
hasRecents = true,
|
||||
hasRecents = !EISC.BooleanOutput[502].BoolValue,
|
||||
hasCameras = true,
|
||||
showCamerasWhenNotInCall = EISC.BooleanOutput[503].BoolValue,
|
||||
selectedCamera = GetSelectedCamera(),
|
||||
});
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public CotijaSystemController AppServerController { get; private set; }
|
||||
public MobileControlSystemController AppServerController { get; private set; }
|
||||
|
||||
public string MessagePath { get; private set; }
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
/// Registers this messenger with appserver controller
|
||||
/// </summary>
|
||||
/// <param name="appServerController"></param>
|
||||
public void RegisterWithAppServer(CotijaSystemController appServerController)
|
||||
public void RegisterWithAppServer(MobileControlSystemController appServerController)
|
||||
{
|
||||
if (appServerController == null)
|
||||
throw new ArgumentNullException("appServerController");
|
||||
@@ -60,7 +60,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
/// Implemented in extending classes. Wire up API calls and feedback here
|
||||
/// </summary>
|
||||
/// <param name="appServerController"></param>
|
||||
abstract protected void CustomRegisterWithAppServer(CotijaSystemController appServerController);
|
||||
abstract protected void CustomRegisterWithAppServer(MobileControlSystemController appServerController);
|
||||
|
||||
/// <summary>
|
||||
/// Helper for posting status message
|
||||
|
||||
@@ -40,8 +40,11 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
/// <param name="e"></param>
|
||||
void ProgramInfoChanged(object sender, ProgramInfoEventArgs e)
|
||||
{
|
||||
Debug.Console(1, "Posting Status Message: {0}", e.ProgramInfo.ToString());
|
||||
PostStatusMessage(e.ProgramInfo);
|
||||
if (e.ProgramInfo != null)
|
||||
{
|
||||
//Debug.Console(1, "Posting Status Message: {0}", e.ProgramInfo.ToString());
|
||||
PostStatusMessage(e.ProgramInfo);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -83,7 +86,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
});
|
||||
}
|
||||
|
||||
protected override void CustomRegisterWithAppServer(CotijaSystemController appServerController)
|
||||
protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
|
||||
{
|
||||
AppServerController.AddAction(MessagePath + "/fullStatus", new Action(SendFullStatusMessage));
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
using PepperDash.Essentials.Devices.Common.Codec;
|
||||
using PepperDash.Essentials.Devices.Common.Cameras;
|
||||
using PepperDash.Essentials.Devices.Common.VideoCodec;
|
||||
|
||||
namespace PepperDash.Essentials.AppServer.Messengers
|
||||
@@ -159,7 +160,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
/// Called from base's RegisterWithAppServer method
|
||||
/// </summary>
|
||||
/// <param name="appServerController"></param>
|
||||
protected override void CustomRegisterWithAppServer(CotijaSystemController appServerController)
|
||||
protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
|
||||
{
|
||||
appServerController.AddAction("/device/videoCodec/isReady", new Action(SendIsReady));
|
||||
appServerController.AddAction("/device/videoCodec/fullStatus", new Action(SendVtcFullMessageObject));
|
||||
@@ -365,7 +366,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
hasDirectory = Codec is IHasDirectory,
|
||||
hasDirectorySearch = true,
|
||||
hasRecents = Codec is IHasCallHistory,
|
||||
hasCameras = Codec is IHasCameraControl
|
||||
hasCameras = Codec is IHasCodecCameras
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace PepperDash.Essentials
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public class CotijaConfig
|
||||
public class MobileControlConfig
|
||||
{
|
||||
[JsonProperty("serverUrl")]
|
||||
public string ServerUrl { get; set; }
|
||||
@@ -25,7 +25,7 @@ namespace PepperDash.Essentials
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public class CotijaDdvc01RoomBridgePropertiesConfig
|
||||
public class MobileControlDdvc01RoomBridgePropertiesConfig
|
||||
{
|
||||
[JsonProperty("eiscId")]
|
||||
public string EiscId { get; set; }
|
||||
@@ -8,19 +8,19 @@ using Crestron.SimplSharpPro.EthernetCommunication;
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Room.Cotija
|
||||
namespace PepperDash.Essentials.Room.MobileControl
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a generic device connection through to and EISC for DDVC01
|
||||
/// </summary>
|
||||
public class CotijaDdvc01DeviceBridge : Device, IChannel, INumericKeypad
|
||||
public class MobileControlDdvc01DeviceBridge : Device, IChannel, INumericKeypad
|
||||
{
|
||||
/// <summary>
|
||||
/// EISC used to talk to Simpl
|
||||
/// </summary>
|
||||
ThreeSeriesTcpIpEthernetIntersystemCommunications EISC;
|
||||
|
||||
public CotijaDdvc01DeviceBridge(string key, string name, ThreeSeriesTcpIpEthernetIntersystemCommunications eisc)
|
||||
public MobileControlDdvc01DeviceBridge(string key, string name, ThreeSeriesTcpIpEthernetIntersystemCommunications eisc)
|
||||
: base(key, name)
|
||||
{
|
||||
EISC = eisc;
|
||||
File diff suppressed because it is too large
Load Diff
@@ -12,15 +12,15 @@ namespace PepperDash.Essentials
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public abstract class CotijaBridgeBase: Device
|
||||
public abstract class MobileControlBridgeBase: Device
|
||||
{
|
||||
public CotijaSystemController Parent { get; private set; }
|
||||
public MobileControlSystemController Parent { get; private set; }
|
||||
|
||||
public string UserCode { get; private set; }
|
||||
|
||||
public abstract string RoomName { get; }
|
||||
|
||||
public CotijaBridgeBase(string key, string name)
|
||||
public MobileControlBridgeBase(string key, string name)
|
||||
: base(key, name)
|
||||
{
|
||||
}
|
||||
@@ -30,7 +30,7 @@ namespace PepperDash.Essentials
|
||||
/// as adding actions to parent
|
||||
/// </summary>
|
||||
/// <param name="parent"></param>
|
||||
public virtual void AddParent(CotijaSystemController parent)
|
||||
public virtual void AddParent(MobileControlSystemController parent)
|
||||
{
|
||||
Parent = parent;
|
||||
}
|
||||
@@ -16,9 +16,9 @@ using PepperDash.Essentials.Core.Config;
|
||||
using PepperDash.Essentials.Room.Config;
|
||||
|
||||
|
||||
namespace PepperDash.Essentials.Room.Cotija
|
||||
namespace PepperDash.Essentials.Room.MobileControl
|
||||
{
|
||||
public class CotijaDdvc01RoomBridge : CotijaBridgeBase, IDelayedConfiguration
|
||||
public class MobileControlDdvc01RoomBridge : MobileControlBridgeBase, IDelayedConfiguration
|
||||
{
|
||||
public class BoolJoin
|
||||
{
|
||||
@@ -27,6 +27,11 @@ namespace PepperDash.Essentials.Room.Cotija
|
||||
/// </summary>
|
||||
public const uint RoomIsOn = 301;
|
||||
|
||||
/// <summary>
|
||||
/// 12
|
||||
/// </summary>
|
||||
public const uint PrivacyMute = 12;
|
||||
|
||||
/// <summary>
|
||||
/// 41
|
||||
/// </summary>
|
||||
@@ -38,15 +43,15 @@ namespace PepperDash.Essentials.Room.Cotija
|
||||
/// <summary>
|
||||
/// 51
|
||||
/// </summary>
|
||||
public const uint ActivitySharePress = 51;
|
||||
public const uint ActivityShare = 51;
|
||||
/// <summary>
|
||||
/// 52
|
||||
/// </summary>
|
||||
public const uint ActivityPhoneCallPress = 52;
|
||||
public const uint ActivityPhoneCall = 52;
|
||||
/// <summary>
|
||||
/// 53
|
||||
/// </summary>
|
||||
public const uint ActivityVideoCallPress = 53;
|
||||
public const uint ActivityVideoCall = 53;
|
||||
|
||||
/// <summary>
|
||||
/// 1
|
||||
@@ -76,6 +81,7 @@ namespace PepperDash.Essentials.Room.Cotija
|
||||
/// 72
|
||||
/// </summary>
|
||||
public const uint SourceHasChanged = 71;
|
||||
|
||||
/// <summary>
|
||||
/// 261 - The start of the range of speed dial visibles
|
||||
/// </summary>
|
||||
@@ -85,9 +91,25 @@ namespace PepperDash.Essentials.Room.Cotija
|
||||
/// </summary>
|
||||
public const uint ConfigIsReady = 501;
|
||||
/// <summary>
|
||||
/// 502
|
||||
/// </summary>
|
||||
public const uint HideVideoConfRecents = 502;
|
||||
/// <summary>
|
||||
/// 503
|
||||
/// </summary>
|
||||
public const uint ShowCameraWhenNotInCall = 503;
|
||||
/// <summary>
|
||||
/// 504
|
||||
/// </summary>
|
||||
public const uint UseSourceEnabled = 504;
|
||||
/// <summary>
|
||||
/// 601
|
||||
/// </summary>
|
||||
public const uint SourceShareDisableStartJoin = 601;
|
||||
public const uint SourceShareDisableJoinStart = 601;
|
||||
/// <summary>
|
||||
/// 621
|
||||
/// </summary>
|
||||
public const uint SourceIsEnabledJoinStart = 621;
|
||||
|
||||
}
|
||||
|
||||
@@ -108,7 +130,7 @@ namespace PepperDash.Essentials.Room.Cotija
|
||||
/// <summary>
|
||||
/// 101
|
||||
/// </summary>
|
||||
public const uint VolumeSliderCount = 101;
|
||||
public const uint NumberOfAuxFaders = 101;
|
||||
}
|
||||
|
||||
public class StringJoin
|
||||
@@ -214,7 +236,7 @@ namespace PepperDash.Essentials.Room.Cotija
|
||||
}
|
||||
}
|
||||
|
||||
CotijaDdvc01DeviceBridge SourceBridge;
|
||||
MobileControlDdvc01DeviceBridge SourceBridge;
|
||||
|
||||
Ddvc01AtcMessenger AtcMessenger;
|
||||
Ddvc01VtcMessenger VtcMessenger;
|
||||
@@ -226,7 +248,7 @@ namespace PepperDash.Essentials.Room.Cotija
|
||||
/// <param name="key"></param>
|
||||
/// <param name="name"></param>
|
||||
/// <param name="ipId"></param>
|
||||
public CotijaDdvc01RoomBridge(string key, string name, uint ipId)
|
||||
public MobileControlDdvc01RoomBridge(string key, string name, uint ipId)
|
||||
: base(key, name)
|
||||
{
|
||||
try
|
||||
@@ -236,7 +258,7 @@ namespace PepperDash.Essentials.Room.Cotija
|
||||
if (reg != Crestron.SimplSharpPro.eDeviceRegistrationUnRegistrationResponse.Success)
|
||||
Debug.Console(0, this, "Cannot connect EISC at IPID {0}: \r{1}", ipId, reg);
|
||||
|
||||
SourceBridge = new CotijaDdvc01DeviceBridge(key + "-sourceBridge", "DDVC01 source bridge", EISC);
|
||||
SourceBridge = new MobileControlDdvc01DeviceBridge(key + "-sourceBridge", "DDVC01 source bridge", EISC);
|
||||
DeviceManager.AddDevice(SourceBridge);
|
||||
}
|
||||
catch (Exception)
|
||||
@@ -319,16 +341,30 @@ namespace PepperDash.Essentials.Room.Cotija
|
||||
}));
|
||||
|
||||
Parent.AddAction(@"/room/room1/defaultsource", new Action(() =>
|
||||
EISC.PulseBool(BoolJoin.ActivitySharePress)));
|
||||
Parent.AddAction(@"/room/room1/activityVideo", new Action(() =>
|
||||
EISC.PulseBool(BoolJoin.ActivityVideoCallPress)));
|
||||
EISC.PulseBool(BoolJoin.ActivityShare)));
|
||||
Parent.AddAction(@"/room/room1/activityPhone", new Action(() =>
|
||||
EISC.PulseBool(BoolJoin.ActivityPhoneCallPress)));
|
||||
EISC.PulseBool(BoolJoin.ActivityPhoneCall)));
|
||||
Parent.AddAction(@"/room/room1/activityVideo", new Action(() =>
|
||||
EISC.PulseBool(BoolJoin.ActivityVideoCall)));
|
||||
|
||||
Parent.AddAction(@"/room/room1/volumes/master/level", new Action<ushort>(u =>
|
||||
EISC.SetUshort(UshortJoin.MasterVolumeLevel, u)));
|
||||
Parent.AddAction(@"/room/room1/volumes/master/muteToggle", new Action(() =>
|
||||
EISC.PulseBool(BoolJoin.MasterVolumeIsMuted)));
|
||||
Parent.AddAction(@"/room/room1/volumes/master/privacyMuteToggle", new Action(() =>
|
||||
EISC.PulseBool(BoolJoin.PrivacyMute)));
|
||||
|
||||
|
||||
// /xyzxyz/volumes/master/muteToggle ---> BoolInput[1]
|
||||
|
||||
for (uint i = 2; i <= 7; i++)
|
||||
{
|
||||
var index = i;
|
||||
Parent.AddAction(string.Format(@"/room/room1/volumes/level-{0}/level", index), new Action<ushort>(u =>
|
||||
EISC.SetUshort(index, u)));
|
||||
Parent.AddAction(string.Format(@"/room/room1/volumes/level-{0}/muteToggle", index), new Action(() =>
|
||||
EISC.PulseBool(index)));
|
||||
}
|
||||
|
||||
Parent.AddAction(@"/room/room1/shutdownStart", new Action(() =>
|
||||
EISC.PulseBool(BoolJoin.ShutdownStart)));
|
||||
@@ -388,6 +424,9 @@ namespace PepperDash.Essentials.Room.Cotija
|
||||
}
|
||||
}));
|
||||
|
||||
// map MasterVolumeIsMuted join -> status/volumes/master/muted
|
||||
//
|
||||
|
||||
EISC.SetBoolSigAction(BoolJoin.MasterVolumeIsMuted, b =>
|
||||
PostStatusMessage(new
|
||||
{
|
||||
@@ -399,7 +438,55 @@ namespace PepperDash.Essentials.Room.Cotija
|
||||
}
|
||||
}
|
||||
}));
|
||||
EISC.SetBoolSigAction(BoolJoin.PrivacyMute, b =>
|
||||
PostStatusMessage(new
|
||||
{
|
||||
volumes = new
|
||||
{
|
||||
master = new
|
||||
{
|
||||
privacyMuted = b
|
||||
}
|
||||
}
|
||||
}));
|
||||
|
||||
for (uint i = 2; i <= 7; i++)
|
||||
{
|
||||
var index = i; // local scope for lambdas
|
||||
EISC.SetUShortSigAction(index, u => // start at join 2
|
||||
{
|
||||
// need a dict in order to create the level-n property on auxFaders
|
||||
var dict = new Dictionary<string, object>();
|
||||
dict.Add("level-" + index, new { level = u });
|
||||
PostStatusMessage(new
|
||||
{
|
||||
volumes = new
|
||||
{
|
||||
auxFaders = dict,
|
||||
}
|
||||
});
|
||||
});
|
||||
EISC.SetBoolSigAction(index, b =>
|
||||
{
|
||||
// need a dict in order to create the level-n property on auxFaders
|
||||
var dict = new Dictionary<string, object>();
|
||||
dict.Add("level-" + index, new { muted = b });
|
||||
PostStatusMessage(new
|
||||
{
|
||||
volumes = new
|
||||
{
|
||||
auxFaders = dict,
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
EISC.SetUShortSigAction(UshortJoin.NumberOfAuxFaders, u =>
|
||||
PostStatusMessage(new {
|
||||
volumes = new {
|
||||
numberOfAuxFaders = u,
|
||||
}
|
||||
}));
|
||||
|
||||
// shutdown things
|
||||
EISC.SetSigTrueAction(BoolJoin.ShutdownCancel, new Action(() =>
|
||||
@@ -421,6 +508,23 @@ namespace PepperDash.Essentials.Room.Cotija
|
||||
|
||||
// Config things
|
||||
EISC.SetSigTrueAction(BoolJoin.ConfigIsReady, LoadConfigValues);
|
||||
|
||||
// Activity modes
|
||||
EISC.SetSigTrueAction(BoolJoin.ActivityShare, () => UpdateActivity(1));
|
||||
EISC.SetSigTrueAction(BoolJoin.ActivityPhoneCall, () => UpdateActivity(2));
|
||||
EISC.SetSigTrueAction(BoolJoin.ActivityVideoCall, () => UpdateActivity(3));
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Updates activity states
|
||||
/// </summary>
|
||||
void UpdateActivity(int mode)
|
||||
{
|
||||
PostStatusMessage(new
|
||||
{
|
||||
activityMode = mode,
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -471,24 +575,13 @@ namespace PepperDash.Essentials.Room.Cotija
|
||||
rmProps.RoomPhoneNumber = EISC.StringOutput[StringJoin.ConfigRoomPhoneNumber].StringValue;
|
||||
rmProps.RoomURI = EISC.StringOutput[StringJoin.ConfigRoomURI].StringValue;
|
||||
rmProps.SpeedDials = new List<DDVC01SpeedDial>();
|
||||
// add speed dials as long as there are more - up to 4
|
||||
|
||||
#warning fix speed dials - 512-515 names, 516-519 numbers
|
||||
for (uint i = 512; i <= 519; i = i + 2)
|
||||
{
|
||||
var num = EISC.StringOutput[i].StringValue;
|
||||
if (string.IsNullOrEmpty(num))
|
||||
break;
|
||||
var name = EISC.StringOutput[i + 1].StringValue;
|
||||
rmProps.SpeedDials.Add(new DDVC01SpeedDial { Number = num, Name = name});
|
||||
}
|
||||
|
||||
// This MAY need a check
|
||||
rmProps.AudioCodecKey = "audioCodec";
|
||||
rmProps.VideoCodecKey = "videoCodec";
|
||||
|
||||
// volume control names
|
||||
var volCount = EISC.UShortOutput[UshortJoin.VolumeSliderCount].UShortValue;
|
||||
var volCount = EISC.UShortOutput[UshortJoin.NumberOfAuxFaders].UShortValue;
|
||||
|
||||
//// use Volumes object or?
|
||||
//rmProps.VolumeSliderNames = new List<string>();
|
||||
@@ -497,7 +590,7 @@ namespace PepperDash.Essentials.Room.Cotija
|
||||
// rmProps.VolumeSliderNames.Add(EISC.StringInput[i].StringValue);
|
||||
//}
|
||||
|
||||
// There should be cotija devices in here, I think...
|
||||
// There should be Mobile Control devices in here, I think...
|
||||
if(co.Devices == null)
|
||||
co.Devices = new List<DeviceConfig>();
|
||||
|
||||
@@ -534,12 +627,17 @@ namespace PepperDash.Essentials.Room.Cotija
|
||||
for (uint i = 0; i <= 19; i++)
|
||||
{
|
||||
var name = EISC.StringOutput[StringJoin.SourceNameJoinStart + i].StringValue;
|
||||
if(string.IsNullOrEmpty(name))
|
||||
if (EISC.BooleanOutput[BoolJoin.UseSourceEnabled].BoolValue
|
||||
&& !EISC.BooleanOutput[BoolJoin.SourceIsEnabledJoinStart + i].BoolValue)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
else if(!EISC.BooleanOutput[BoolJoin.UseSourceEnabled].BoolValue && string.IsNullOrEmpty(name))
|
||||
break;
|
||||
var icon = EISC.StringOutput[StringJoin.SourceIconJoinStart + i].StringValue;
|
||||
var key = EISC.StringOutput[StringJoin.SourceKeyJoinStart + i].StringValue;
|
||||
var type = EISC.StringOutput[StringJoin.SourceTypeJoinStart + i].StringValue;
|
||||
var disableShare = EISC.BooleanOutput[BoolJoin.SourceShareDisableStartJoin + i].BoolValue;
|
||||
var disableShare = EISC.BooleanOutput[BoolJoin.SourceShareDisableJoinStart + i].BoolValue;
|
||||
|
||||
Debug.Console(0, this, "Adding source {0} '{1}'", key, name);
|
||||
var newSLI = new SourceListItem{
|
||||
@@ -575,7 +673,7 @@ namespace PepperDash.Essentials.Room.Cotija
|
||||
|
||||
co.SourceLists.Add("default", newSl);
|
||||
|
||||
// build "audioCodec" config if we need
|
||||
// Build "audioCodec" config if we need
|
||||
if (!string.IsNullOrEmpty(rmProps.AudioCodecKey))
|
||||
{
|
||||
var acFavs = new List<PepperDash.Essentials.Devices.Common.Codec.CodecActiveCallItem>();
|
||||
@@ -610,25 +708,11 @@ namespace PepperDash.Essentials.Room.Cotija
|
||||
co.Devices.Add(acConf);
|
||||
}
|
||||
|
||||
// Build Video codec config
|
||||
if (!string.IsNullOrEmpty(rmProps.VideoCodecKey))
|
||||
{
|
||||
#warning Break out these video codec favs
|
||||
// No favorites, for now?
|
||||
var favs = new List<PepperDash.Essentials.Devices.Common.Codec.CodecActiveCallItem>();
|
||||
for (uint i = 0; i < 4; i++)
|
||||
{
|
||||
if (!EISC.GetBool(BoolJoin.SpeedDialVisibleStartJoin + i))
|
||||
{
|
||||
break;
|
||||
}
|
||||
favs.Add(new PepperDash.Essentials.Devices.Common.Codec.CodecActiveCallItem()
|
||||
{
|
||||
Name = EISC.GetString(StringJoin.SpeedDialNameStartJoin + i),
|
||||
Number = EISC.GetString(StringJoin.SpeedDialNumberStartJoin + i),
|
||||
Type = PepperDash.Essentials.Devices.Common.Codec.eCodecCallType.Audio
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
// cameras
|
||||
var camsProps = new List<object>();
|
||||
@@ -689,39 +773,42 @@ namespace PepperDash.Essentials.Room.Cotija
|
||||
{
|
||||
if (ConfigIsLoaded)
|
||||
{
|
||||
var count = EISC.UShortOutput[801].UShortValue;
|
||||
var count = EISC.UShortOutput[UshortJoin.NumberOfAuxFaders].UShortValue;
|
||||
|
||||
Debug.Console(1, this, "The Fader Count is : {0}", count);
|
||||
|
||||
// build volumes object, serialize and put in content of method below
|
||||
|
||||
var auxFaders = new List<Volume>();
|
||||
|
||||
// Create auxFaders
|
||||
for (uint i = 2; i <= count; i++)
|
||||
{
|
||||
auxFaders.Add(
|
||||
new Volume(string.Format("level-{0}", i),
|
||||
EISC.UShortOutput[i].UShortValue,
|
||||
EISC.BooleanOutput[i].BoolValue,
|
||||
EISC.StringOutput[800 + i].StringValue,
|
||||
true,
|
||||
"someting.png"));
|
||||
}
|
||||
var auxFaderDict = new Dictionary<string, Volume>();
|
||||
for (uint i = 2; i <= count; i++)
|
||||
{
|
||||
auxFaderDict.Add("level-" + i,
|
||||
new Volume("level-" + i,
|
||||
EISC.UShortOutput[i].UShortValue,
|
||||
EISC.BooleanOutput[i].BoolValue,
|
||||
EISC.StringOutput[i].StringValue,
|
||||
true,
|
||||
"someting.png"));
|
||||
}
|
||||
|
||||
var volumes = new Volumes();
|
||||
|
||||
volumes.Master = new Volume("master",
|
||||
EISC.UShortOutput[UshortJoin.MasterVolumeLevel].UShortValue,
|
||||
EISC.BooleanOutput[BoolJoin.MasterVolumeIsMuted].BoolValue,
|
||||
EISC.StringOutput[801].StringValue,
|
||||
EISC.StringOutput[1].StringValue,
|
||||
true,
|
||||
"something.png");
|
||||
volumes.Master.HasPrivacyMute = true;
|
||||
volumes.Master.PrivacyMuted = EISC.BooleanOutput[BoolJoin.PrivacyMute].BoolValue;
|
||||
|
||||
volumes.AuxFaders = auxFaders;
|
||||
volumes.AuxFaders = auxFaderDict;
|
||||
volumes.NumberOfAuxFaders = EISC.UShortInput[UshortJoin.NumberOfAuxFaders].UShortValue;
|
||||
|
||||
PostStatusMessage(new
|
||||
{
|
||||
activityMode = GetActivityMode(),
|
||||
isOn = EISC.BooleanOutput[BoolJoin.RoomIsOn].BoolValue,
|
||||
selectedSourceKey = EISC.StringOutput[StringJoin.SelectedSourceKey].StringValue,
|
||||
volumes = volumes
|
||||
@@ -736,6 +823,18 @@ namespace PepperDash.Essentials.Room.Cotija
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the activity mode int
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
int GetActivityMode()
|
||||
{
|
||||
if (EISC.BooleanOutput[BoolJoin.ActivityPhoneCall].BoolValue) return 2;
|
||||
else if (EISC.BooleanOutput[BoolJoin.ActivityShare].BoolValue) return 1;
|
||||
else if (EISC.BooleanOutput[BoolJoin.ActivityVideoCall].BoolValue) return 3;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Helper for posting status message
|
||||
/// </summary>
|
||||
@@ -792,6 +891,7 @@ namespace PepperDash.Essentials.Room.Cotija
|
||||
var d = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase)
|
||||
{
|
||||
{ "laptop", "pc" },
|
||||
{ "pc", "pc" },
|
||||
{ "wireless", "genericsource" },
|
||||
{ "iptv", "settopbox" }
|
||||
|
||||
@@ -9,14 +9,14 @@ using Newtonsoft.Json.Linq;
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.AppServer.Messengers;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Room.Cotija;
|
||||
using PepperDash.Essentials.Room.MobileControl;
|
||||
using PepperDash.Essentials.Devices.Common.Codec;
|
||||
using PepperDash.Essentials.Devices.Common.VideoCodec;
|
||||
using PepperDash.Essentials.Devices.Common.AudioCodec;
|
||||
|
||||
namespace PepperDash.Essentials
|
||||
{
|
||||
public class CotijaEssentialsHuddleSpaceRoomBridge : CotijaBridgeBase
|
||||
public class MobileConrolEssentialsHuddleSpaceRoomBridge : MobileControlBridgeBase
|
||||
{
|
||||
|
||||
public EssentialsRoomBase Room { get; private set; }
|
||||
@@ -25,6 +25,7 @@ namespace PepperDash.Essentials
|
||||
|
||||
public AudioCodecBaseMessenger ACMessenger { get; private set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
@@ -41,7 +42,7 @@ namespace PepperDash.Essentials
|
||||
/// </summary>
|
||||
/// <param name="parent"></param>
|
||||
/// <param name="room"></param>
|
||||
public CotijaEssentialsHuddleSpaceRoomBridge(EssentialsRoomBase room):
|
||||
public MobileConrolEssentialsHuddleSpaceRoomBridge(EssentialsRoomBase room):
|
||||
base("mobileControlBridge-essentialsHuddle", "Essentials Mobile Control Bridge-Huddle")
|
||||
{
|
||||
Room = room;
|
||||
@@ -51,7 +52,7 @@ namespace PepperDash.Essentials
|
||||
/// Override of base: calls base to add parent and then registers actions and events.
|
||||
/// </summary>
|
||||
/// <param name="parent"></param>
|
||||
public override void AddParent(CotijaSystemController parent)
|
||||
public override void AddParent(MobileControlSystemController parent)
|
||||
{
|
||||
base.AddParent(parent);
|
||||
|
||||
@@ -92,7 +93,7 @@ namespace PepperDash.Essentials
|
||||
|
||||
var sscRoom = Room as IHasCurrentSourceInfoChange;
|
||||
if(sscRoom != null)
|
||||
sscRoom.CurrentSingleSourceChange += new SourceInfoChangeHandler(Room_CurrentSingleSourceChange);
|
||||
sscRoom.CurrentSourceChange += new SourceInfoChangeHandler(Room_CurrentSingleSourceChange);
|
||||
|
||||
var vcRoom = Room as IHasVideoCodec;
|
||||
if (vcRoom != null && vcRoom.VideoCodec != null)
|
||||
@@ -168,19 +169,6 @@ namespace PepperDash.Essentials
|
||||
});
|
||||
}
|
||||
|
||||
///// <summary>
|
||||
///// Handler for codec changes
|
||||
///// </summary>
|
||||
//void codec_CallStatusChange(object sender, CodecCallStatusItemChangeEventArgs e)
|
||||
//{
|
||||
// PostStatusMessage(new
|
||||
// {
|
||||
// calls = GetCallsMessageObject(),
|
||||
// //vtc = GetVtcCallsMessageObject()
|
||||
// });
|
||||
|
||||
//}
|
||||
|
||||
/// <summary>
|
||||
/// Helper for posting status message
|
||||
/// </summary>
|
||||
@@ -333,7 +321,7 @@ namespace PepperDash.Essentials
|
||||
}
|
||||
|
||||
|
||||
void Room_CurrentSingleSourceChange(EssentialsRoomBase room, PepperDash.Essentials.Core.SourceListItem info, ChangeType type)
|
||||
void Room_CurrentSingleSourceChange(PepperDash.Essentials.Core.SourceListItem info, ChangeType type)
|
||||
{
|
||||
/* Example message
|
||||
* {
|
||||
@@ -394,11 +382,14 @@ namespace PepperDash.Essentials
|
||||
if (dev is ITransport)
|
||||
(dev as ITransport).LinkActions(Parent);
|
||||
|
||||
var srcRm = room as IHasCurrentSourceInfoChange;
|
||||
PostStatusMessage(new
|
||||
{
|
||||
selectedSourceKey = srcRm.CurrentSourceInfoKey
|
||||
});
|
||||
var srcRm = Room as IHasCurrentSourceInfoChange;
|
||||
if (srcRm != null)
|
||||
{
|
||||
PostStatusMessage(new
|
||||
{
|
||||
selectedSourceKey = srcRm.CurrentSourceInfoKey
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -416,7 +407,7 @@ namespace PepperDash.Essentials
|
||||
if (rmVc != null)
|
||||
{
|
||||
var vc = rmVc.CurrentVolumeControls as IBasicVolumeWithFeedback;
|
||||
if (rmVc != null)
|
||||
if (vc != null)
|
||||
{
|
||||
volumes.Master = new Volume("master", vc.VolumeLevelFeedback.UShortValue, vc.MuteFeedback.BoolValue, "Volume", true, "");
|
||||
}
|
||||
@@ -431,45 +422,6 @@ namespace PepperDash.Essentials
|
||||
volumes = volumes
|
||||
});
|
||||
}
|
||||
|
||||
///// <summary>
|
||||
///// Helper to return a anonymous object with the call data for JSON message
|
||||
///// </summary>
|
||||
///// <returns></returns>
|
||||
//object GetCallsMessageObject()
|
||||
//{
|
||||
// var callRm = Room as IHasVideoCodec;
|
||||
// if (callRm == null)
|
||||
// return null;
|
||||
// return new
|
||||
// {
|
||||
// activeCalls = callRm.VideoCodec.ActiveCalls,
|
||||
// callType = callRm.CallTypeFeedback.IntValue,
|
||||
// inCall = callRm.InCallFeedback.BoolValue,
|
||||
// isSharing = callRm.IsSharingFeedback.BoolValue,
|
||||
// privacyModeIsOn = callRm.PrivacyModeIsOnFeedback.BoolValue
|
||||
// };
|
||||
//}
|
||||
|
||||
///// <summary>
|
||||
///// Helper method to build call status for vtc
|
||||
///// </summary>
|
||||
///// <returns></returns>
|
||||
//object GetVtcCallsMessageObject()
|
||||
//{
|
||||
// var callRm = Room as IHasVideoCodec;
|
||||
// object vtc = null;
|
||||
// if (callRm != null)
|
||||
// {
|
||||
// var codec = callRm.VideoCodec;
|
||||
// vtc = new
|
||||
// {
|
||||
// isInCall = codec.IsInCall,
|
||||
// calls = codec.ActiveCalls
|
||||
// };
|
||||
// }
|
||||
// return vtc;
|
||||
//}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -4,7 +4,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
|
||||
namespace PepperDash.Essentials.Room.Cotija
|
||||
namespace PepperDash.Essentials.Room.MobileControl
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -6,7 +6,7 @@ using Crestron.SimplSharp;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace PepperDash.Essentials.Room.Cotija
|
||||
namespace PepperDash.Essentials.Room.MobileControl
|
||||
{
|
||||
public class Volumes
|
||||
{
|
||||
@@ -14,11 +14,14 @@ namespace PepperDash.Essentials.Room.Cotija
|
||||
public Volume Master { get; set; }
|
||||
|
||||
[JsonProperty("auxFaders")]
|
||||
public List<Volume> AuxFaders { get; set; }
|
||||
public Dictionary<string, Volume> AuxFaders { get; set; }
|
||||
|
||||
[JsonProperty("numberOfAuxFaders")]
|
||||
public int NumberOfAuxFaders { get; set; }
|
||||
|
||||
public Volumes()
|
||||
{
|
||||
AuxFaders = new List<Volume>();
|
||||
AuxFaders = new Dictionary<string, Volume>();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,6 +42,13 @@ namespace PepperDash.Essentials.Room.Cotija
|
||||
[JsonProperty("hasMute")]
|
||||
public bool HasMute { get; set; }
|
||||
|
||||
[JsonProperty("hasPrivacyMute")]
|
||||
public bool HasPrivacyMute { get; set; }
|
||||
|
||||
[JsonProperty("privacyMuted")]
|
||||
public bool PrivacyMuted { get; set; }
|
||||
|
||||
|
||||
[JsonProperty("muteIcon")]
|
||||
public string MuteIcon { get; set; }
|
||||
|
||||
|
||||
61
PepperDashEssentials/Bridges/AirMediaControllerBridge.cs
Normal file
61
PepperDashEssentials/Bridges/AirMediaControllerBridge.cs
Normal file
@@ -0,0 +1,61 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Devices.Common;
|
||||
using PepperDash.Essentials.DM.AirMedia;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
public static class AirMediaControllerApiExtensions
|
||||
{
|
||||
public static void LinkToApi(this AirMediaController airMedia, BasicTriList trilist, uint joinStart, string joinMapKey)
|
||||
{
|
||||
AirMediaControllerJoinMap joinMap = new AirMediaControllerJoinMap();
|
||||
|
||||
var joinMapSerialized = JoinMapHelper.GetJoinMapForDevice(joinMapKey);
|
||||
|
||||
if (!string.IsNullOrEmpty(joinMapSerialized))
|
||||
joinMap = JsonConvert.DeserializeObject<AirMediaControllerJoinMap>(joinMapSerialized);
|
||||
|
||||
joinMap.OffsetJoinNumbers(joinStart);
|
||||
|
||||
Debug.Console(1, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
||||
Debug.Console(0, "Linking to Airmedia: {0}", airMedia.Name);
|
||||
|
||||
trilist.StringInput[joinMap.Name].StringValue = airMedia.Name;
|
||||
|
||||
var commMonitor = airMedia as ICommunicationMonitor;
|
||||
if (commMonitor != null)
|
||||
{
|
||||
commMonitor.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
|
||||
}
|
||||
|
||||
airMedia.IsInSessionFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IsInSession]);
|
||||
airMedia.HdmiVideoSyncDetectedFeedback.LinkInputSig(trilist.BooleanInput[joinMap.HdmiVideoSync]);
|
||||
|
||||
trilist.SetSigTrueAction(joinMap.AutomaticInputRoutingEnabled, new Action( airMedia.AirMedia.DisplayControl.EnableAutomaticRouting));
|
||||
trilist.SetSigFalseAction(joinMap.AutomaticInputRoutingEnabled, new Action( airMedia.AirMedia.DisplayControl.DisableAutomaticRouting));
|
||||
airMedia.AutomaticInputRoutingEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.AutomaticInputRoutingEnabled]);
|
||||
|
||||
trilist.SetUShortSigAction(joinMap.VideoOut, new Action<ushort>((u) => airMedia.SelectVideoOut(u)));
|
||||
|
||||
airMedia.VideoOutFeedback.LinkInputSig(trilist.UShortInput[joinMap.VideoOut]);
|
||||
airMedia.ErrorFeedback.LinkInputSig(trilist.UShortInput[joinMap.ErrorFB]);
|
||||
airMedia.NumberOfUsersConnectedFeedback.LinkInputSig(trilist.UShortInput[joinMap.NumberOfUsersConnectedFB]);
|
||||
|
||||
trilist.SetUShortSigAction(joinMap.LoginCode, new Action<ushort>((u) => airMedia.AirMedia.AirMedia.LoginCode.UShortValue = u));
|
||||
airMedia.LoginCodeFeedback.LinkInputSig(trilist.UShortInput[joinMap.LoginCode]);
|
||||
|
||||
airMedia.ConnectionAddressFeedback.LinkInputSig(trilist.StringInput[joinMap.ConnectionAddressFB]);
|
||||
airMedia.HostnameFeedback.LinkInputSig(trilist.StringInput[joinMap.HostnameFB]);
|
||||
airMedia.SerialNumberFeedback.LinkInputSig(trilist.StringInput[joinMap.SerialNumberFeedback]);
|
||||
}
|
||||
}
|
||||
}
|
||||
41
PepperDashEssentials/Bridges/AppleTvBridge.cs
Normal file
41
PepperDashEssentials/Bridges/AppleTvBridge.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Devices.Common;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
public static class AppleTvApiExtensions
|
||||
{
|
||||
public static void LinkToApi(this AppleTV appleTv, BasicTriList trilist, uint joinStart, string joinMapKey)
|
||||
{
|
||||
AppleTvJoinMap joinMap = new AppleTvJoinMap();
|
||||
|
||||
var joinMapSerialized = JoinMapHelper.GetJoinMapForDevice(joinMapKey);
|
||||
|
||||
if(!string.IsNullOrEmpty(joinMapSerialized))
|
||||
joinMap = JsonConvert.DeserializeObject<AppleTvJoinMap>(joinMapSerialized);
|
||||
|
||||
joinMap.OffsetJoinNumbers(joinStart);
|
||||
|
||||
Debug.Console(1, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
||||
Debug.Console(0, "Linking to Bridge Type {0}", appleTv.GetType().Name.ToString());
|
||||
|
||||
trilist.SetBoolSigAction(joinMap.UpArrow, (b) => appleTv.Up(b));
|
||||
trilist.SetBoolSigAction(joinMap.DnArrow, (b) => appleTv.Down(b));
|
||||
trilist.SetBoolSigAction(joinMap.LeftArrow, (b) => appleTv.Left(b));
|
||||
trilist.SetBoolSigAction(joinMap.RightArrow, (b) => appleTv.Right(b));
|
||||
trilist.SetBoolSigAction(joinMap.Select, (b) => appleTv.Select(b));
|
||||
trilist.SetBoolSigAction(joinMap.Menu, (b) => appleTv.Menu(b));
|
||||
trilist.SetBoolSigAction(joinMap.PlayPause, (b) => appleTv.Play(b));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,6 +12,7 @@ using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.Lighting;
|
||||
using PepperDash.Essentials.Core.Devices;
|
||||
using PepperDash.Essentials.Devices.Common;
|
||||
using PepperDash.Essentials.Devices.Common.Cameras;
|
||||
using PepperDash.Essentials.Core.Config;
|
||||
using PepperDash.Essentials.Core.CrestronIO;
|
||||
using PepperDash.Essentials.DM;
|
||||
@@ -56,7 +57,6 @@ namespace PepperDash.Essentials.Bridges
|
||||
|
||||
public ThreeSeriesTcpIpEthernetIntersystemCommunications Eisc { get; private set; }
|
||||
|
||||
|
||||
public EiscApi(DeviceConfig dc) :
|
||||
base(dc.Key)
|
||||
{
|
||||
@@ -78,7 +78,12 @@ namespace PepperDash.Essentials.Bridges
|
||||
|
||||
if (device != null)
|
||||
{
|
||||
if (device is PepperDash.Essentials.Core.Monitoring.SystemMonitorController)
|
||||
if (device is IBridge) // Check for this first to allow bridges in plugins to override existing bridges that apply to the same type.
|
||||
{
|
||||
(device as IBridge).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
||||
continue;
|
||||
}
|
||||
else if (device is PepperDash.Essentials.Core.Monitoring.SystemMonitorController)
|
||||
{
|
||||
(device as PepperDash.Essentials.Core.Monitoring.SystemMonitorController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
||||
continue;
|
||||
@@ -88,22 +93,34 @@ namespace PepperDash.Essentials.Bridges
|
||||
(device as GenericComm).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
||||
continue;
|
||||
}
|
||||
//else if (device is CameraBase)
|
||||
//{
|
||||
// (device as CameraBase).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
||||
// continue;
|
||||
//}
|
||||
//else if (device is PepperDash.Essentials.Core.TwoWayDisplayBase)
|
||||
//{
|
||||
// (device as TwoWayDisplayBase).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
||||
// continue;
|
||||
//}
|
||||
else if (device is DmChassisController)
|
||||
else if (device is CameraBase)
|
||||
{
|
||||
(device as CameraBase).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
||||
continue;
|
||||
}
|
||||
else if (device is PepperDash.Essentials.Core.DisplayBase)
|
||||
{
|
||||
(device as DisplayBase).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
||||
continue;
|
||||
}
|
||||
else if (device is DmChassisController) {
|
||||
(device as DmChassisController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
||||
continue;
|
||||
}
|
||||
|
||||
else if (device is DmBladeChassisController) {
|
||||
(device as DmBladeChassisController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
||||
continue;
|
||||
}
|
||||
else if (device is DmpsRoutingController)
|
||||
{
|
||||
(device as DmpsRoutingController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
||||
continue;
|
||||
}
|
||||
else if (device is DmpsAudioOutputController)
|
||||
{
|
||||
(device as DmpsAudioOutputController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
||||
continue;
|
||||
}
|
||||
else if (device is DmTxControllerBase)
|
||||
{
|
||||
(device as DmTxControllerBase).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
||||
@@ -124,16 +141,41 @@ namespace PepperDash.Essentials.Bridges
|
||||
(device as IDigitalInput).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
||||
continue;
|
||||
}
|
||||
//else if (device is LightingBase)
|
||||
//{
|
||||
// (device as LightingBase).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
||||
// continue;
|
||||
//}
|
||||
//else if (device is DigitalLogger)
|
||||
//{
|
||||
// (device as DigitalLogger).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
||||
// continue;
|
||||
//}
|
||||
else if (device is AppleTV)
|
||||
{
|
||||
(device as AppleTV).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
||||
continue;
|
||||
}
|
||||
else if (device is HdMdxxxCEController)
|
||||
{
|
||||
(device as HdMdxxxCEController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
||||
continue;
|
||||
}
|
||||
else if (device is LightingBase)
|
||||
{
|
||||
(device as LightingBase).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
||||
continue;
|
||||
}
|
||||
else if (device is DigitalLogger)
|
||||
{
|
||||
(device as DigitalLogger).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
||||
continue;
|
||||
}
|
||||
else if (device is PepperDash.Essentials.Devices.Common.Occupancy.GlsOccupancySensorBaseController)
|
||||
{
|
||||
(device as PepperDash.Essentials.Devices.Common.Occupancy.GlsOccupancySensorBaseController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
||||
continue;
|
||||
}
|
||||
else if (device is StatusSignController)
|
||||
{
|
||||
(device as StatusSignController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
||||
continue;
|
||||
}
|
||||
else if (device is C2nRthsController)
|
||||
{
|
||||
(device as C2nRthsController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -141,6 +183,66 @@ namespace PepperDash.Essentials.Bridges
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Used for debugging to trigger an action based on a join number and type
|
||||
/// </summary>
|
||||
/// <param name="join"></param>
|
||||
/// <param name="type"></param>
|
||||
public void ExecuteJoinAction(uint join, string type, object state)
|
||||
{
|
||||
try
|
||||
{
|
||||
switch (type.ToLower())
|
||||
{
|
||||
case "digital":
|
||||
{
|
||||
var uo = Eisc.BooleanOutput[join].UserObject as Action<bool>;
|
||||
if (uo != null)
|
||||
{
|
||||
Debug.Console(1, this, "Executing Action: {0}", uo.ToString());
|
||||
uo(Convert.ToBoolean(state));
|
||||
}
|
||||
else
|
||||
Debug.Console(1, this, "User Action is null. Nothing to Execute");
|
||||
break;
|
||||
}
|
||||
case "analog":
|
||||
{
|
||||
var uo = Eisc.BooleanOutput[join].UserObject as Action<ushort>;
|
||||
if (uo != null)
|
||||
{
|
||||
Debug.Console(1, this, "Executing Action: {0}", uo.ToString());
|
||||
uo(Convert.ToUInt16(state));
|
||||
}
|
||||
else
|
||||
Debug.Console(1, this, "User Action is null. Nothing to Execute"); break;
|
||||
}
|
||||
case "serial":
|
||||
{
|
||||
var uo = Eisc.BooleanOutput[join].UserObject as Action<string>;
|
||||
if (uo != null)
|
||||
{
|
||||
Debug.Console(1, this, "Executing Action: {0}", uo.ToString());
|
||||
uo(Convert.ToString(state));
|
||||
}
|
||||
else
|
||||
Debug.Console(1, this, "User Action is null. Nothing to Execute");
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
Debug.Console(1, "Unknown join type. Use digital/serial/analog");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.Console(1, this, "Error: {0}", e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Handles incoming sig changes
|
||||
/// </summary>
|
||||
@@ -148,15 +250,26 @@ namespace PepperDash.Essentials.Bridges
|
||||
/// <param name="args"></param>
|
||||
void Eisc_SigChange(object currentDevice, Crestron.SimplSharpPro.SigEventArgs args)
|
||||
{
|
||||
if (Debug.Level >= 1)
|
||||
Debug.Console(1, this, "EiscApi change: {0} {1}={2}", args.Sig.Type, args.Sig.Number, args.Sig.StringValue);
|
||||
var uo = args.Sig.UserObject;
|
||||
if (uo is Action<bool>)
|
||||
(uo as Action<bool>)(args.Sig.BoolValue);
|
||||
else if (uo is Action<ushort>)
|
||||
(uo as Action<ushort>)(args.Sig.UShortValue);
|
||||
else if (uo is Action<string>)
|
||||
(uo as Action<string>)(args.Sig.StringValue);
|
||||
try
|
||||
{
|
||||
if (Debug.Level >= 1)
|
||||
Debug.Console(1, this, "EiscApi change: {0} {1}={2}", args.Sig.Type, args.Sig.Number, args.Sig.StringValue);
|
||||
var uo = args.Sig.UserObject;
|
||||
if (uo != null)
|
||||
{
|
||||
Debug.Console(1, this, "Executing Action: {0}", uo.ToString());
|
||||
if (uo is Action<bool>)
|
||||
(uo as Action<bool>)(args.Sig.BoolValue);
|
||||
else if (uo is Action<ushort>)
|
||||
(uo as Action<ushort>)(args.Sig.UShortValue);
|
||||
else if (uo is Action<string>)
|
||||
(uo as Action<string>)(args.Sig.StringValue);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.Console(2, this, "Error in Eisc_SigChange handler: {0}", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -13,129 +13,127 @@ using PepperDash.Essentials.Bridges;
|
||||
using Crestron.SimplSharpPro;
|
||||
using Crestron.SimplSharpPro.EthernetCommunication;
|
||||
|
||||
namespace PepperDash.Essentials
|
||||
|
||||
namespace PepperDash.Essentials
|
||||
{
|
||||
public class BridgeFactory
|
||||
{
|
||||
public static IKeyed GetDevice(DeviceConfig dc)
|
||||
{
|
||||
// ? why is this static JTA 2018-06-13?
|
||||
|
||||
var key = dc.Key;
|
||||
var name = dc.Name;
|
||||
var type = dc.Type;
|
||||
var properties = dc.Properties;
|
||||
var propAnon = new { };
|
||||
|
||||
var typeName = dc.Type.ToLower();
|
||||
var groupName = dc.Group.ToLower();
|
||||
public class BridgeFactory
|
||||
{
|
||||
public static IKeyed GetDevice(DeviceConfig dc)
|
||||
{
|
||||
// ? why is this static JTA 2018-06-13?
|
||||
|
||||
//Debug.Console(2, "Name {0}, Key {1}, Type {2}, Properties {3}", name, key, type, properties.ToString());
|
||||
var key = dc.Key;
|
||||
var name = dc.Name;
|
||||
var type = dc.Type;
|
||||
var properties = dc.Properties;
|
||||
var propAnon = new { };
|
||||
|
||||
if (typeName == "eiscapi")
|
||||
{
|
||||
return new EiscApi(dc);
|
||||
}
|
||||
var typeName = dc.Type.ToLower();
|
||||
var groupName = dc.Group.ToLower();
|
||||
|
||||
return null;
|
||||
}
|
||||
//Debug.Console(2, "Name {0}, Key {1}, Type {2}, Properties {3}", name, key, type, properties.ToString());
|
||||
|
||||
if (typeName == "eiscapi")
|
||||
{
|
||||
return new EiscApi(dc);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class CommBridge : Device
|
||||
{
|
||||
public CommBridgeProperties Properties { get; private set; }
|
||||
|
||||
public List<IBasicCommunication> CommDevices { get; private set; }
|
||||
|
||||
public CommBridge(string key, string name, JToken properties)
|
||||
: base(key, name)
|
||||
{
|
||||
Properties = JsonConvert.DeserializeObject<CommBridgeProperties>(properties.ToString());
|
||||
}
|
||||
|
||||
public override bool CustomActivate()
|
||||
{
|
||||
// Create EiscApis
|
||||
if (Properties.Eiscs != null)
|
||||
{
|
||||
foreach (var eisc in Properties.Eiscs)
|
||||
{
|
||||
var ApiEisc = new BridgeApiEisc(eisc.IpId, eisc.Hostname);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var deviceKey in Properties.CommDevices)
|
||||
{
|
||||
var device = DeviceManager.GetDeviceForKey(deviceKey);
|
||||
|
||||
if (device != null)
|
||||
{
|
||||
Debug.Console(0, "deviceKey {0} Found in Device Manager", device.Key);
|
||||
CommDevices.Add(device as IBasicCommunication);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Console(0, "deviceKey {0} Not Found in Device Manager", deviceKey);
|
||||
}
|
||||
}
|
||||
|
||||
// Iterate through all the CommDevices and link up their Actions and Feedbacks
|
||||
|
||||
Debug.Console(0, "Bridge {0} Activated", this.Name);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class EiscBridgeProperties
|
||||
{
|
||||
public string ParentDeviceKey { get; set; }
|
||||
public eApiType ApiType { get; set; }
|
||||
public List<EiscProperties> Eiscs { get; set; }
|
||||
public string ApiOverrideFilePath { get; set; }
|
||||
|
||||
public class EiscProperties
|
||||
{
|
||||
public string IpId { get; set; }
|
||||
public string Hostname { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
public class CommBridgeProperties : EiscBridgeProperties
|
||||
{
|
||||
public List<string> CommDevices { get; set; }
|
||||
}
|
||||
|
||||
public enum eApiType { Eisc = 0 }
|
||||
|
||||
public class BridgeApiEisc
|
||||
{
|
||||
public uint Ipid { get; private set; }
|
||||
public ThreeSeriesTcpIpEthernetIntersystemCommunications Eisc { get; private set; }
|
||||
|
||||
public BridgeApiEisc(string ipid, string hostname)
|
||||
{
|
||||
Ipid = (UInt32)int.Parse(ipid, System.Globalization.NumberStyles.HexNumber);
|
||||
Eisc = new ThreeSeriesTcpIpEthernetIntersystemCommunications(Ipid, hostname, Global.ControlSystem);
|
||||
Eisc.Register();
|
||||
Eisc.SigChange += Eisc_SigChange;
|
||||
Debug.Console(0, "BridgeApiEisc Created at Ipid {0}", ipid);
|
||||
}
|
||||
void Eisc_SigChange(object currentDevice, Crestron.SimplSharpPro.SigEventArgs args)
|
||||
{
|
||||
if (Debug.Level >= 1)
|
||||
Debug.Console(1, "BridgeApiEisc change: {0} {1}={2}", args.Sig.Type, args.Sig.Number, args.Sig.StringValue);
|
||||
var uo = args.Sig.UserObject;
|
||||
if (uo is Action<bool>)
|
||||
(uo as Action<bool>)(args.Sig.BoolValue);
|
||||
else if (uo is Action<ushort>)
|
||||
(uo as Action<ushort>)(args.Sig.UShortValue);
|
||||
else if (uo is Action<string>)
|
||||
(uo as Action<string>)(args.Sig.StringValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class CommBridge : Device
|
||||
{
|
||||
public CommBridgeProperties Properties { get; private set; }
|
||||
|
||||
public List<IBasicCommunication> CommDevices { get; private set; }
|
||||
|
||||
public CommBridge(string key, string name, JToken properties)
|
||||
: base(key, name)
|
||||
{
|
||||
Properties = JsonConvert.DeserializeObject<CommBridgeProperties>(properties.ToString());
|
||||
}
|
||||
|
||||
public override bool CustomActivate()
|
||||
{
|
||||
// Create EiscApis
|
||||
if (Properties.Eiscs != null)
|
||||
{
|
||||
foreach (var eisc in Properties.Eiscs)
|
||||
{
|
||||
var ApiEisc = new BridgeApiEisc(eisc.IpId, eisc.Hostname);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var deviceKey in Properties.CommDevices)
|
||||
{
|
||||
var device = DeviceManager.GetDeviceForKey(deviceKey);
|
||||
|
||||
if (device != null)
|
||||
{
|
||||
Debug.Console(0, "deviceKey {0} Found in Device Manager", device.Key);
|
||||
CommDevices.Add(device as IBasicCommunication);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Console(0, "deviceKey {0} Not Found in Device Manager", deviceKey);
|
||||
}
|
||||
}
|
||||
|
||||
// Iterate through all the CommDevices and link up their Actions and Feedbacks
|
||||
|
||||
Debug.Console(0, "Bridge {0} Activated", this.Name);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class EiscBridgeProperties
|
||||
{
|
||||
public string ParentDeviceKey { get; set; }
|
||||
public eApiType ApiType { get; set; }
|
||||
public List<EiscProperties> Eiscs { get; set; }
|
||||
public string ApiOverrideFilePath { get; set; }
|
||||
|
||||
public class EiscProperties
|
||||
{
|
||||
public string IpId { get; set; }
|
||||
public string Hostname { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
public class CommBridgeProperties : EiscBridgeProperties
|
||||
{
|
||||
public List<string> CommDevices { get; set; }
|
||||
}
|
||||
|
||||
public enum eApiType { Eisc = 0 }
|
||||
|
||||
public class BridgeApiEisc
|
||||
{
|
||||
public uint Ipid { get; private set; }
|
||||
public ThreeSeriesTcpIpEthernetIntersystemCommunications Eisc { get; private set; }
|
||||
|
||||
public BridgeApiEisc(string ipid, string hostname)
|
||||
{
|
||||
Ipid = (UInt32)int.Parse(ipid, System.Globalization.NumberStyles.HexNumber);
|
||||
Eisc = new ThreeSeriesTcpIpEthernetIntersystemCommunications(Ipid, hostname, Global.ControlSystem);
|
||||
Eisc.Register();
|
||||
Eisc.SigChange += Eisc_SigChange;
|
||||
Debug.Console(0, "BridgeApiEisc Created at Ipid {0}", ipid);
|
||||
}
|
||||
void Eisc_SigChange(object currentDevice, Crestron.SimplSharpPro.SigEventArgs args)
|
||||
{
|
||||
if (Debug.Level >= 1)
|
||||
Debug.Console(1, "BridgeApiEisc change: {0} {1}={2}", args.Sig.Type, args.Sig.Number, args.Sig.StringValue);
|
||||
var uo = args.Sig.UserObject;
|
||||
if (uo is Action<bool>)
|
||||
(uo as Action<bool>)(args.Sig.BoolValue);
|
||||
else if (uo is Action<ushort>)
|
||||
(uo as Action<ushort>)(args.Sig.UShortValue);
|
||||
else if (uo is Action<string>)
|
||||
(uo as Action<string>)(args.Sig.StringValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
38
PepperDashEssentials/Bridges/C2nRthsControllerBridge.cs
Normal file
38
PepperDashEssentials/Bridges/C2nRthsControllerBridge.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
using Newtonsoft.Json;
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.CrestronIO;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
public static class C2nRthsControllerApiExtensions
|
||||
{
|
||||
public static void LinkToApi(this C2nRthsController device, BasicTriList triList, uint joinStart,
|
||||
string joinMapKey)
|
||||
{
|
||||
var joinMap = new C2nRthsControllerJoinMap();
|
||||
|
||||
var joinMapSerialized = JoinMapHelper.GetJoinMapForDevice(joinMapKey);
|
||||
|
||||
if (!string.IsNullOrEmpty(joinMapSerialized))
|
||||
joinMap = JsonConvert.DeserializeObject<C2nRthsControllerJoinMap>(joinMapSerialized);
|
||||
|
||||
joinMap.OffsetJoinNumbers(joinStart);
|
||||
|
||||
Debug.Console(1, device, "Linking to Trilist '{0}'", triList.ID.ToString("X"));
|
||||
|
||||
|
||||
triList.SetBoolSigAction(joinMap.TemperatureFormat, device.SetTemperatureFormat);
|
||||
|
||||
device.IsOnline.LinkInputSig(triList.BooleanInput[joinMap.IsOnline]);
|
||||
device.TemperatureFeedback.LinkInputSig(triList.UShortInput[joinMap.Temperature]);
|
||||
device.HumidityFeedback.LinkInputSig(triList.UShortInput[joinMap.Humidity]);
|
||||
|
||||
triList.StringInput[joinMap.Name].StringValue = device.Name;
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,187 +1,137 @@
|
||||
//using System;
|
||||
//using System.Collections.Generic;
|
||||
//using System.Linq;
|
||||
//using System.Text;
|
||||
//using Crestron.SimplSharp;
|
||||
//using Crestron.SimplSharpPro.DeviceSupport;
|
||||
//using PepperDash.Core;
|
||||
//using PepperDash.Essentials.Core;
|
||||
//using PepperDash.Essentials.Devices.Common;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Devices.Common;
|
||||
using PepperDash.Essentials.Devices.Common.Cameras;
|
||||
|
||||
//namespace PepperDash.Essentials.Bridges
|
||||
//{
|
||||
// public static class CameraControllerApiExtensions
|
||||
// {
|
||||
using Newtonsoft.Json;
|
||||
|
||||
// public static BasicTriList _TriList;
|
||||
// public static CameraControllerJoinMap JoinMap;
|
||||
// public static void LinkToApi(this PepperDash.Essentials.Devices.Common.Cameras.CameraBase cameraDevice, BasicTriList trilist, uint joinStart, string joinMapKey)
|
||||
// {
|
||||
// JoinMap = JoinMapHelper.GetJoinMapForDevice(joinMapKey) as CameraControllerJoinMap;
|
||||
|
||||
// _TriList = trilist;
|
||||
// if (JoinMap == null)
|
||||
// {
|
||||
// JoinMap = new CameraControllerJoinMap();
|
||||
// }
|
||||
|
||||
// JoinMap.OffsetJoinNumbers(joinStart);
|
||||
// Debug.Console(1, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
||||
// Debug.Console(0, "Linking to Bridge Type {0}", cameraDevice.GetType().Name.ToString());
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
public static class CameraControllerApiExtensions
|
||||
{
|
||||
|
||||
// var commMonitor = cameraDevice as ICommunicationMonitor;
|
||||
// commMonitor.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[JoinMap.IsOnline]);
|
||||
public static void LinkToApi(this PepperDash.Essentials.Devices.Common.Cameras.CameraBase cameraDevice, BasicTriList trilist, uint joinStart, string joinMapKey)
|
||||
{
|
||||
CameraControllerJoinMap joinMap = new CameraControllerJoinMap();
|
||||
|
||||
var joinMapSerialized = JoinMapHelper.GetJoinMapForDevice(joinMapKey);
|
||||
|
||||
// trilist.SetBoolSigAction(JoinMap.Left, (b) =>
|
||||
// {
|
||||
// if (b)
|
||||
// {
|
||||
// cameraDevice.PanLeft();
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// cameraDevice.Stop();
|
||||
// }
|
||||
// });
|
||||
// trilist.SetBoolSigAction(JoinMap.Right, (b) =>
|
||||
// {
|
||||
// if (b)
|
||||
// {
|
||||
// cameraDevice.PanRight();
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// cameraDevice.Stop();
|
||||
// }
|
||||
// });
|
||||
if (!string.IsNullOrEmpty(joinMapSerialized))
|
||||
joinMap = JsonConvert.DeserializeObject<CameraControllerJoinMap>(joinMapSerialized);
|
||||
|
||||
// trilist.SetBoolSigAction(JoinMap.Up, (b) =>
|
||||
// {
|
||||
// if (b)
|
||||
// {
|
||||
// cameraDevice.TiltUp();
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// cameraDevice.Stop();
|
||||
// }
|
||||
// });
|
||||
// trilist.SetBoolSigAction(JoinMap.Down, (b) =>
|
||||
// {
|
||||
// if (b)
|
||||
// {
|
||||
// cameraDevice.TiltDown();
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// cameraDevice.Stop();
|
||||
// }
|
||||
// });
|
||||
joinMap.OffsetJoinNumbers(joinStart);
|
||||
|
||||
// trilist.SetBoolSigAction(JoinMap.ZoomIn, (b) =>
|
||||
// {
|
||||
// if (b)
|
||||
// {
|
||||
// cameraDevice.ZoomIn();
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// cameraDevice.Stop();
|
||||
// }
|
||||
// });
|
||||
Debug.Console(1, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
||||
Debug.Console(0, "Linking to Bridge Type {0}", cameraDevice.GetType().Name.ToString());
|
||||
|
||||
// trilist.SetBoolSigAction(JoinMap.ZoomOut, (b) =>
|
||||
// {
|
||||
// if (b)
|
||||
// {
|
||||
// cameraDevice.ZoomOut();
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// cameraDevice.Stop();
|
||||
// }
|
||||
// });
|
||||
var commMonitor = cameraDevice as ICommunicationMonitor;
|
||||
commMonitor.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
|
||||
|
||||
var ptzCamera = cameraDevice as IHasCameraPtzControl;
|
||||
|
||||
// if (cameraDevice.GetType().Name.ToString().ToLower() == "cameravisca")
|
||||
// {
|
||||
// var viscaCamera = cameraDevice as PepperDash.Essentials.Devices.Common.Cameras.CameraVisca;
|
||||
// trilist.SetSigTrueAction(JoinMap.PowerOn, () => viscaCamera.PowerOn());
|
||||
// trilist.SetSigTrueAction(JoinMap.PowerOff, () => viscaCamera.PowerOff());
|
||||
if (ptzCamera != null)
|
||||
{
|
||||
trilist.SetBoolSigAction(joinMap.Left, (b) =>
|
||||
{
|
||||
if (b)
|
||||
{
|
||||
ptzCamera.PanLeft();
|
||||
}
|
||||
else
|
||||
{
|
||||
ptzCamera.PanStop();
|
||||
}
|
||||
});
|
||||
trilist.SetBoolSigAction(joinMap.Right, (b) =>
|
||||
{
|
||||
if (b)
|
||||
{
|
||||
ptzCamera.PanRight();
|
||||
}
|
||||
else
|
||||
{
|
||||
ptzCamera.PanStop();
|
||||
}
|
||||
});
|
||||
|
||||
// viscaCamera.PowerIsOnFeedback.LinkInputSig(trilist.BooleanInput[JoinMap.PowerOn]);
|
||||
// viscaCamera.PowerIsOnFeedback.LinkComplementInputSig(trilist.BooleanInput[JoinMap.PowerOff]);
|
||||
trilist.SetBoolSigAction(joinMap.Up, (b) =>
|
||||
{
|
||||
if (b)
|
||||
{
|
||||
ptzCamera.TiltUp();
|
||||
}
|
||||
else
|
||||
{
|
||||
ptzCamera.TiltStop();
|
||||
}
|
||||
});
|
||||
trilist.SetBoolSigAction(joinMap.Down, (b) =>
|
||||
{
|
||||
if (b)
|
||||
{
|
||||
ptzCamera.TiltDown();
|
||||
}
|
||||
else
|
||||
{
|
||||
ptzCamera.TiltStop();
|
||||
}
|
||||
});
|
||||
|
||||
// viscaCamera.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[JoinMap.IsOnline]);
|
||||
// for (int i = 0; i < JoinMap.NumberOfPresets; i++)
|
||||
// {
|
||||
// int tempNum = i;
|
||||
// trilist.SetSigTrueAction((ushort)(JoinMap.PresetRecallOffset + tempNum), () =>
|
||||
// {
|
||||
// viscaCamera.RecallPreset(tempNum);
|
||||
// });
|
||||
// trilist.SetSigTrueAction((ushort)(JoinMap.PresetSaveOffset + tempNum), () =>
|
||||
// {
|
||||
// viscaCamera.SavePreset(tempNum);
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
trilist.SetBoolSigAction(joinMap.ZoomIn, (b) =>
|
||||
{
|
||||
if (b)
|
||||
{
|
||||
ptzCamera.ZoomIn();
|
||||
}
|
||||
else
|
||||
{
|
||||
ptzCamera.ZoomStop();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
// }
|
||||
trilist.SetBoolSigAction(joinMap.ZoomOut, (b) =>
|
||||
{
|
||||
if (b)
|
||||
{
|
||||
ptzCamera.ZoomOut();
|
||||
}
|
||||
else
|
||||
{
|
||||
ptzCamera.ZoomStop();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (cameraDevice.GetType().Name.ToString().ToLower() == "cameravisca")
|
||||
{
|
||||
var viscaCamera = cameraDevice as PepperDash.Essentials.Devices.Common.Cameras.CameraVisca;
|
||||
trilist.SetSigTrueAction(joinMap.PowerOn, () => viscaCamera.PowerOn());
|
||||
trilist.SetSigTrueAction(joinMap.PowerOff, () => viscaCamera.PowerOff());
|
||||
|
||||
// }
|
||||
// public class CameraControllerJoinMap : JoinMapBase
|
||||
// {
|
||||
// public uint IsOnline { get; set; }
|
||||
// public uint PowerOff { get; set; }
|
||||
// public uint PowerOn { get; set; }
|
||||
// public uint Up { get; set; }
|
||||
// public uint Down { get; set; }
|
||||
// public uint Left { get; set; }
|
||||
// public uint Right { get; set; }
|
||||
// public uint ZoomIn { get; set; }
|
||||
// public uint ZoomOut { get; set; }
|
||||
// public uint PresetRecallOffset { get; set; }
|
||||
// public uint PresetSaveOffset { get; set; }
|
||||
// public uint NumberOfPresets { get; set; }
|
||||
viscaCamera.PowerIsOnFeedback.LinkInputSig(trilist.BooleanInput[joinMap.PowerOn]);
|
||||
viscaCamera.PowerIsOnFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.PowerOff]);
|
||||
|
||||
// public CameraControllerJoinMap()
|
||||
// {
|
||||
// // Digital
|
||||
// IsOnline = 9;
|
||||
// PowerOff = 8;
|
||||
// PowerOn = 7;
|
||||
// Up = 1;
|
||||
// Down = 2;
|
||||
// Left = 3;
|
||||
// Right = 4;
|
||||
// ZoomIn = 5;
|
||||
// ZoomOut = 6;
|
||||
// PresetRecallOffset = 10;
|
||||
// PresetSaveOffset = 30;
|
||||
// NumberOfPresets = 5;
|
||||
// // Analog
|
||||
// }
|
||||
viscaCamera.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
|
||||
for (int i = 0; i < joinMap.NumberOfPresets; i++)
|
||||
{
|
||||
int tempNum = i;
|
||||
trilist.SetSigTrueAction((ushort)(joinMap.PresetRecallOffset + tempNum), () =>
|
||||
{
|
||||
viscaCamera.RecallPreset(tempNum);
|
||||
});
|
||||
trilist.SetSigTrueAction((ushort)(joinMap.PresetSaveOffset + tempNum), () =>
|
||||
{
|
||||
viscaCamera.SavePreset(tempNum);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// public override void OffsetJoinNumbers(uint joinStart)
|
||||
// {
|
||||
// var joinOffset = joinStart - 1;
|
||||
|
||||
// IsOnline = IsOnline + joinOffset;
|
||||
// PowerOff = PowerOff + joinOffset;
|
||||
// PowerOn = PowerOn + joinOffset;
|
||||
// Up = Up + joinOffset;
|
||||
// Down = Down + joinOffset;
|
||||
// Left = Left + joinOffset;
|
||||
// Right = Right + joinOffset;
|
||||
// ZoomIn = ZoomIn + joinOffset;
|
||||
// ZoomOut = ZoomOut + joinOffset;
|
||||
// PresetRecallOffset = PresetRecallOffset + joinOffset;
|
||||
// PresetSaveOffset = PresetSaveOffset + joinOffset;
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
}
|
||||
@@ -1,77 +1,42 @@
|
||||
//using System;
|
||||
//using System.Collections.Generic;
|
||||
//using System.Linq;
|
||||
//using System.Text;
|
||||
//using Crestron.SimplSharp;
|
||||
//using Crestron.SimplSharpPro.DeviceSupport;
|
||||
//using PepperDash.Core;
|
||||
//using PepperDash.Essentials.Core;
|
||||
//using PepperDash.Essentials.Devices.Common;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Devices.Common;
|
||||
|
||||
//namespace PepperDash.Essentials.Bridges
|
||||
//{
|
||||
// public static class DigitalLoggerApiExtensions
|
||||
// {
|
||||
// public static void LinkToApi(this DigitalLogger DigitalLogger, BasicTriList trilist, uint joinStart, string joinMapKey)
|
||||
// {
|
||||
// var joinMap = JoinMapHelper.GetJoinMapForDevice(joinMapKey) as DigitalLoggerJoinMap;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
// if (joinMap == null)
|
||||
// joinMap = new DigitalLoggerJoinMap();
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
public static class DigitalLoggerApiExtensions
|
||||
{
|
||||
public static void LinkToApi(this DigitalLogger DigitalLogger, BasicTriList trilist, uint joinStart, string joinMapKey)
|
||||
{
|
||||
DigitalLoggerJoinMap joinMap = new DigitalLoggerJoinMap();
|
||||
|
||||
// joinMap.OffsetJoinNumbers(joinStart);
|
||||
// Debug.Console(1, DigitalLogger, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
||||
// for (uint i = 1; i <= DigitalLogger.CircuitCount; i++)
|
||||
// {
|
||||
// var circuit = i;
|
||||
// DigitalLogger.CircuitNameFeedbacks[circuit - 1].LinkInputSig(trilist.StringInput[joinMap.CircuitNames + circuit]);
|
||||
// DigitalLogger.CircuitIsCritical[circuit - 1].LinkInputSig(trilist.BooleanInput[joinMap.CircuitIsCritical + circuit]);
|
||||
// DigitalLogger.CircuitState[circuit - 1].LinkInputSig(trilist.BooleanInput[joinMap.CircuitState + circuit]);
|
||||
// trilist.SetSigTrueAction(joinMap.CircuitCycle + circuit, () => DigitalLogger.CycleCircuit(circuit - 1));
|
||||
// trilist.SetSigTrueAction(joinMap.CircuitOnCmd + circuit, () => DigitalLogger.TurnOnCircuit(circuit - 1));
|
||||
// trilist.SetSigTrueAction(joinMap.CircuitOffCmd + circuit, () => DigitalLogger.TurnOffCircuit(circuit - 1));
|
||||
var joinMapSerialized = JoinMapHelper.GetJoinMapForDevice(joinMapKey);
|
||||
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// public class DigitalLoggerJoinMap : JoinMapBase
|
||||
// {
|
||||
// public uint IsOnline { get; set; }
|
||||
// public uint CircuitNames { get; set; }
|
||||
// public uint CircuitState { get; set; }
|
||||
// public uint CircuitCycle { get; set; }
|
||||
// public uint CircuitIsCritical { get; set; }
|
||||
// public uint CircuitOnCmd { get; set; }
|
||||
// public uint CircuitOffCmd { get; set; }
|
||||
// public DigitalLoggerJoinMap()
|
||||
// {
|
||||
// // Digital
|
||||
// IsOnline = 9;
|
||||
// CircuitState = 0;
|
||||
// CircuitCycle = 0;
|
||||
// CircuitIsCritical = 10;
|
||||
// CircuitOnCmd = 10;
|
||||
// CircuitOffCmd = 20;
|
||||
// // Serial
|
||||
// CircuitNames = 0;
|
||||
// // Analog
|
||||
// }
|
||||
if (!string.IsNullOrEmpty(joinMapSerialized))
|
||||
joinMap = JsonConvert.DeserializeObject<DigitalLoggerJoinMap>(joinMapSerialized);
|
||||
|
||||
// public override void OffsetJoinNumbers(uint joinStart)
|
||||
// {
|
||||
// var joinOffset = joinStart - 1;
|
||||
joinMap.OffsetJoinNumbers(joinStart);
|
||||
|
||||
// IsOnline = IsOnline + joinOffset;
|
||||
// CircuitNames = CircuitNames + joinOffset;
|
||||
// CircuitState = CircuitState + joinOffset;
|
||||
// CircuitCycle = CircuitCycle + joinOffset;
|
||||
// CircuitIsCritical = CircuitIsCritical + joinOffset;
|
||||
// CircuitOnCmd = CircuitOnCmd + joinOffset;
|
||||
// CircuitOffCmd = CircuitOffCmd + joinOffset;
|
||||
Debug.Console(1, DigitalLogger, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
||||
for (uint i = 1; i <= DigitalLogger.CircuitCount; i++)
|
||||
{
|
||||
var circuit = i;
|
||||
DigitalLogger.CircuitNameFeedbacks[circuit - 1].LinkInputSig(trilist.StringInput[joinMap.CircuitNames + circuit]);
|
||||
DigitalLogger.CircuitIsCritical[circuit - 1].LinkInputSig(trilist.BooleanInput[joinMap.CircuitIsCritical + circuit]);
|
||||
DigitalLogger.CircuitState[circuit - 1].LinkInputSig(trilist.BooleanInput[joinMap.CircuitState + circuit]);
|
||||
trilist.SetSigTrueAction(joinMap.CircuitCycle + circuit, () => DigitalLogger.CycleCircuit(circuit - 1));
|
||||
trilist.SetSigTrueAction(joinMap.CircuitOnCmd + circuit, () => DigitalLogger.TurnOnCircuit(circuit - 1));
|
||||
trilist.SetSigTrueAction(joinMap.CircuitOffCmd + circuit, () => DigitalLogger.TurnOffCircuit(circuit - 1));
|
||||
|
||||
|
||||
|
||||
// }
|
||||
// }
|
||||
|
||||
//}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,171 +1,153 @@
|
||||
//using System;
|
||||
//using System.Collections.Generic;
|
||||
//using System.Linq;
|
||||
//using System.Text;
|
||||
//using Crestron.SimplSharp;
|
||||
//using Crestron.SimplSharpPro.DeviceSupport;
|
||||
//using PepperDash.Core;
|
||||
//using PepperDash.Essentials.Core;
|
||||
//using PepperDash.Essentials.Devices.Common;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Devices.Common;
|
||||
|
||||
//namespace PepperDash.Essentials.Bridges
|
||||
//{
|
||||
// public static class DisplayControllerApiExtensions
|
||||
// {
|
||||
using Newtonsoft.Json;
|
||||
|
||||
// public static BasicTriList _TriList;
|
||||
// public static DisplayControllerJoinMap JoinMap;
|
||||
// public static int InputNumber;
|
||||
// public static IntFeedback InputNumberFeedback;
|
||||
// public static List<string> InputKeys = new List<string>();
|
||||
// public static void LinkToApi(this PepperDash.Essentials.Core.TwoWayDisplayBase displayDevice, BasicTriList trilist, uint joinStart, string joinMapKey)
|
||||
// {
|
||||
// JoinMap = JoinMapHelper.GetJoinMapForDevice(joinMapKey) as DisplayControllerJoinMap;
|
||||
// _TriList = trilist;
|
||||
|
||||
// if (JoinMap == null)
|
||||
// {
|
||||
// JoinMap = new DisplayControllerJoinMap();
|
||||
// }
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
public static class DisplayControllerApiExtensions
|
||||
{
|
||||
public static void LinkToApi(this PepperDash.Essentials.Core.DisplayBase displayDevice, BasicTriList trilist, uint joinStart, string joinMapKey)
|
||||
{
|
||||
int inputNumber = 0;
|
||||
IntFeedback inputNumberFeedback;
|
||||
List<string> inputKeys = new List<string>();
|
||||
|
||||
DisplayControllerJoinMap joinMap = new DisplayControllerJoinMap();
|
||||
|
||||
var joinMapSerialized = JoinMapHelper.GetJoinMapForDevice(joinMapKey);
|
||||
|
||||
if(!string.IsNullOrEmpty(joinMapSerialized))
|
||||
joinMap = JsonConvert.DeserializeObject<DisplayControllerJoinMap>(joinMapSerialized);
|
||||
|
||||
joinMap.OffsetJoinNumbers(joinStart);
|
||||
|
||||
Debug.Console(1, "Linking to Trilist '{0}'",trilist.ID.ToString("X"));
|
||||
Debug.Console(0, "Linking to Display: {0}", displayDevice.Name);
|
||||
|
||||
trilist.StringInput[joinMap.Name].StringValue = displayDevice.Name;
|
||||
|
||||
var commMonitor = displayDevice as ICommunicationMonitor;
|
||||
if (commMonitor != null)
|
||||
{
|
||||
commMonitor.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
|
||||
}
|
||||
|
||||
inputNumberFeedback = new IntFeedback(() => { return inputNumber; });
|
||||
|
||||
// Two way feedbacks
|
||||
var twoWayDisplay = displayDevice as PepperDash.Essentials.Core.TwoWayDisplayBase;
|
||||
if (twoWayDisplay != null)
|
||||
{
|
||||
trilist.SetBool(joinMap.IsTwoWayDisplay, true);
|
||||
|
||||
twoWayDisplay.CurrentInputFeedback.OutputChange += new EventHandler<FeedbackEventArgs>(CurrentInputFeedback_OutputChange);
|
||||
|
||||
|
||||
inputNumberFeedback.LinkInputSig(trilist.UShortInput[joinMap.InputSelect]);
|
||||
}
|
||||
|
||||
// Power Off
|
||||
trilist.SetSigTrueAction(joinMap.PowerOff, () =>
|
||||
{
|
||||
inputNumber = 102;
|
||||
inputNumberFeedback.FireUpdate();
|
||||
displayDevice.PowerOff();
|
||||
});
|
||||
|
||||
displayDevice.PowerIsOnFeedback.OutputChange += new EventHandler<FeedbackEventArgs>( (o,a) => {
|
||||
if (!a.BoolValue)
|
||||
{
|
||||
inputNumber = 102;
|
||||
inputNumberFeedback.FireUpdate();
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
inputNumber = 0;
|
||||
inputNumberFeedback.FireUpdate();
|
||||
}
|
||||
});
|
||||
|
||||
displayDevice.PowerIsOnFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.PowerOff]);
|
||||
|
||||
// PowerOn
|
||||
trilist.SetSigTrueAction(joinMap.PowerOn, () =>
|
||||
{
|
||||
inputNumber = 0;
|
||||
inputNumberFeedback.FireUpdate();
|
||||
displayDevice.PowerOn();
|
||||
});
|
||||
|
||||
|
||||
// JoinMap.OffsetJoinNumbers(joinStart);
|
||||
// Debug.Console(1, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
||||
// Debug.Console(0, "Linking to Bridge Type {0}", displayDevice.GetType().Name.ToString());
|
||||
displayDevice.PowerIsOnFeedback.LinkInputSig(trilist.BooleanInput[joinMap.PowerOn]);
|
||||
|
||||
// trilist.StringInput[JoinMap.Name].StringValue = displayDevice.GetType().Name.ToString();
|
||||
int count = 1;
|
||||
foreach (var input in displayDevice.InputPorts)
|
||||
{
|
||||
inputKeys.Add(input.Key.ToString());
|
||||
var tempKey = inputKeys.ElementAt(count - 1);
|
||||
trilist.SetSigTrueAction((ushort)(joinMap.InputSelectOffset + count), () => { displayDevice.ExecuteSwitch(displayDevice.InputPorts[tempKey].Selector); });
|
||||
Debug.Console(2, displayDevice, "Setting Input Select Action on Digital Join {0} to Input: {1}", joinMap.InputSelectOffset + count, displayDevice.InputPorts[tempKey].Key.ToString());
|
||||
trilist.StringInput[(ushort)(joinMap.InputNamesOffset + count)].StringValue = input.Key.ToString();
|
||||
count++;
|
||||
}
|
||||
|
||||
// InputNumberFeedback = new IntFeedback(() => { return InputNumber;});
|
||||
// InputNumberFeedback.LinkInputSig(trilist.UShortInput[JoinMap.InputSelect]);
|
||||
// var commMonitor = displayDevice as ICommunicationMonitor;
|
||||
// commMonitor.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[JoinMap.IsOnline]);
|
||||
|
||||
// // Poewer Off
|
||||
// trilist.SetSigTrueAction(JoinMap.PowerOff, () =>
|
||||
// {
|
||||
// InputNumber = 102;
|
||||
// InputNumberFeedback.FireUpdate();
|
||||
// displayDevice.PowerOff();
|
||||
// });
|
||||
Debug.Console(2, displayDevice, "Setting Input Select Action on Analog Join {0}", joinMap.InputSelect);
|
||||
trilist.SetUShortSigAction(joinMap.InputSelect, (a) =>
|
||||
{
|
||||
if (a == 0)
|
||||
{
|
||||
displayDevice.PowerOff();
|
||||
inputNumber = 0;
|
||||
}
|
||||
else if (a > 0 && a < displayDevice.InputPorts.Count && a != inputNumber)
|
||||
{
|
||||
displayDevice.ExecuteSwitch(displayDevice.InputPorts.ElementAt(a - 1).Selector);
|
||||
inputNumber = a;
|
||||
}
|
||||
else if (a == 102)
|
||||
{
|
||||
displayDevice.PowerToggle();
|
||||
|
||||
// displayDevice.PowerIsOnFeedback.OutputChange += new EventHandler<FeedbackEventArgs>(PowerIsOnFeedback_OutputChange);
|
||||
// displayDevice.PowerIsOnFeedback.LinkComplementInputSig(trilist.BooleanInput[JoinMap.PowerOff]);
|
||||
|
||||
// // Poewer On
|
||||
// trilist.SetSigTrueAction(JoinMap.PowerOn, () =>
|
||||
// {
|
||||
// InputNumber = 0;
|
||||
// InputNumberFeedback.FireUpdate();
|
||||
// displayDevice.PowerOn();
|
||||
// });
|
||||
}
|
||||
if (twoWayDisplay != null)
|
||||
inputNumberFeedback.FireUpdate();
|
||||
});
|
||||
|
||||
|
||||
// displayDevice.PowerIsOnFeedback.LinkInputSig(trilist.BooleanInput[JoinMap.PowerOn]);
|
||||
|
||||
// int count = 1;
|
||||
// foreach (var input in displayDevice.InputPorts)
|
||||
// {
|
||||
// InputKeys.Add(input.Key.ToString());
|
||||
// var tempKey = InputKeys.ElementAt(count - 1);
|
||||
// trilist.SetSigTrueAction((ushort)(JoinMap.InputSelectOffset + count), () => { displayDevice.ExecuteSwitch(displayDevice.InputPorts[tempKey].Selector); });
|
||||
// trilist.StringInput[(ushort)(JoinMap.InputNamesOffset + count)].StringValue = input.Key.ToString();
|
||||
// count++;
|
||||
// }
|
||||
var volumeDisplay = displayDevice as IBasicVolumeControls;
|
||||
if (volumeDisplay != null)
|
||||
{
|
||||
trilist.SetBoolSigAction(joinMap.VolumeUp, (b) => volumeDisplay.VolumeUp(b));
|
||||
trilist.SetBoolSigAction(joinMap.VolumeDown, (b) => volumeDisplay.VolumeDown(b));
|
||||
trilist.SetSigTrueAction(joinMap.VolumeMute, () => volumeDisplay.MuteToggle());
|
||||
|
||||
// displayDevice.CurrentInputFeedback.OutputChange += new EventHandler<FeedbackEventArgs>(CurrentInputFeedback_OutputChange);
|
||||
// trilist.SetUShortSigAction(JoinMap.InputSelect, (a) =>
|
||||
// {
|
||||
// if (a == 0)
|
||||
// {
|
||||
// displayDevice.PowerOff();
|
||||
// InputNumber = 0;
|
||||
// }
|
||||
// else if (a > 0 && a < displayDevice.InputPorts.Count && a != InputNumber)
|
||||
// {
|
||||
// displayDevice.ExecuteSwitch(displayDevice.InputPorts.ElementAt(a - 1).Selector);
|
||||
// InputNumber = a;
|
||||
// }
|
||||
// else if (a == 102)
|
||||
// {
|
||||
// displayDevice.PowerToggle();
|
||||
|
||||
// }
|
||||
// InputNumberFeedback.FireUpdate();
|
||||
// });
|
||||
|
||||
// }
|
||||
var volumeDisplayWithFeedback = volumeDisplay as IBasicVolumeWithFeedback;
|
||||
if(volumeDisplayWithFeedback != null)
|
||||
{
|
||||
trilist.SetUShortSigAction(joinMap.VolumeLevel, new Action<ushort>((u) => volumeDisplayWithFeedback.SetVolume(u)));
|
||||
volumeDisplayWithFeedback.VolumeLevelFeedback.LinkInputSig(trilist.UShortInput[joinMap.VolumeLevel]);
|
||||
volumeDisplayWithFeedback.MuteFeedback.LinkInputSig(trilist.BooleanInput[joinMap.VolumeMute]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// static void CurrentInputFeedback_OutputChange(object sender, FeedbackEventArgs e)
|
||||
// {
|
||||
static void CurrentInputFeedback_OutputChange(object sender, FeedbackEventArgs e)
|
||||
{
|
||||
|
||||
// Debug.Console(0, "CurrentInputFeedback_OutputChange {0}", e.StringValue);
|
||||
Debug.Console(0, "CurrentInputFeedback_OutputChange {0}", e.StringValue);
|
||||
|
||||
// }
|
||||
}
|
||||
|
||||
// static void PowerIsOnFeedback_OutputChange(object sender, FeedbackEventArgs e)
|
||||
// {
|
||||
|
||||
// // Debug.Console(0, "PowerIsOnFeedback_OutputChange {0}", e.BoolValue);
|
||||
// if (!e.BoolValue)
|
||||
// {
|
||||
// InputNumber = 102;
|
||||
// InputNumberFeedback.FireUpdate();
|
||||
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// InputNumber = 0;
|
||||
// InputNumberFeedback.FireUpdate();
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
// }
|
||||
// public class DisplayControllerJoinMap : JoinMapBase
|
||||
// {
|
||||
// public uint Name { get; set; }
|
||||
// public uint InputNamesOffset { get; set; }
|
||||
// public uint InputSelectOffset { get; set; }
|
||||
// public uint IsOnline { get; set; }
|
||||
// public uint PowerOff { get; set; }
|
||||
// public uint InputSelect { get; set; }
|
||||
// public uint PowerOn { get; set; }
|
||||
// public uint SelectScene { get; set; }
|
||||
// public uint LightingSceneOffset { get; set; }
|
||||
// public uint ButtonVisibilityOffset { get; set; }
|
||||
// public uint IntegrationIdSet { get; set; }
|
||||
|
||||
// public DisplayControllerJoinMap()
|
||||
// {
|
||||
// // Digital
|
||||
// IsOnline = 50;
|
||||
// PowerOff = 1;
|
||||
// PowerOn = 2;
|
||||
// InputSelect = 4;
|
||||
// IntegrationIdSet = 1;
|
||||
// LightingSceneOffset = 10;
|
||||
// ButtonVisibilityOffset = 40;
|
||||
// Name = 1;
|
||||
// InputNamesOffset = 10;
|
||||
// InputSelectOffset = 4;
|
||||
// // Analog
|
||||
// }
|
||||
|
||||
// public override void OffsetJoinNumbers(uint joinStart)
|
||||
// {
|
||||
// var joinOffset = joinStart - 1;
|
||||
|
||||
// IsOnline = IsOnline + joinOffset;
|
||||
// PowerOff = PowerOff + joinOffset;
|
||||
// PowerOn = PowerOn + joinOffset;
|
||||
// SelectScene = SelectScene + joinOffset;
|
||||
// LightingSceneOffset = LightingSceneOffset + joinOffset;
|
||||
// ButtonVisibilityOffset = ButtonVisibilityOffset + joinOffset;
|
||||
// Name = Name + joinOffset;
|
||||
// InputNamesOffset = InputNamesOffset + joinOffset;
|
||||
// InputSelectOffset = InputSelectOffset + joinOffset;
|
||||
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
}
|
||||
|
||||
}
|
||||
222
PepperDashEssentials/Bridges/DmBladeChassisControllerBridge.cs
Normal file
222
PepperDashEssentials/Bridges/DmBladeChassisControllerBridge.cs
Normal file
@@ -0,0 +1,222 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
using Crestron.SimplSharpPro.DM;
|
||||
using Crestron.SimplSharpPro.DM.Endpoints;
|
||||
using Crestron.SimplSharpPro.DM.Endpoints.Transmitters;
|
||||
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.DM;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges {
|
||||
public static class DmBladeChassisControllerApiExtentions {
|
||||
public static void LinkToApi(this DmBladeChassisController dmChassis, BasicTriList trilist, uint joinStart, string joinMapKey) {
|
||||
DmBladeChassisControllerJoinMap joinMap = new DmBladeChassisControllerJoinMap();
|
||||
|
||||
var joinMapSerialized = JoinMapHelper.GetJoinMapForDevice(joinMapKey);
|
||||
|
||||
if (!string.IsNullOrEmpty(joinMapSerialized))
|
||||
joinMap = JsonConvert.DeserializeObject<DmBladeChassisControllerJoinMap>(joinMapSerialized);
|
||||
|
||||
|
||||
joinMap.OffsetJoinNumbers(joinStart);
|
||||
|
||||
Debug.Console(1, dmChassis, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
||||
|
||||
var chassis = dmChassis.Chassis as BladeSwitch;
|
||||
|
||||
dmChassis.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
|
||||
|
||||
|
||||
// Link up outputs
|
||||
for (uint i = 1; i <= dmChassis.Chassis.NumberOfOutputs; i++) {
|
||||
var ioSlot = i;
|
||||
|
||||
// Control
|
||||
trilist.SetUShortSigAction(joinMap.OutputVideo + ioSlot, new Action<ushort>(o => dmChassis.ExecuteSwitch(o, ioSlot, eRoutingSignalType.Video)));
|
||||
|
||||
if (dmChassis.TxDictionary.ContainsKey(ioSlot)) {
|
||||
Debug.Console(2, "Creating Tx Feedbacks {0}", ioSlot);
|
||||
var txKey = dmChassis.TxDictionary[ioSlot];
|
||||
var basicTxDevice = DeviceManager.GetDeviceForKey(txKey) as BasicDmTxControllerBase;
|
||||
|
||||
var advancedTxDevice = basicTxDevice as DmTxControllerBase;
|
||||
|
||||
if (dmChassis.Chassis is DmMd128x128 || dmChassis.Chassis is DmMd64x64) {
|
||||
dmChassis.InputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.InputEndpointOnline + ioSlot]);
|
||||
}
|
||||
else {
|
||||
if (advancedTxDevice != null) {
|
||||
advancedTxDevice.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.InputEndpointOnline + ioSlot]);
|
||||
Debug.Console(2, "Linking Tx Online Feedback from Advanced Transmitter at input {0}", ioSlot);
|
||||
}
|
||||
else if (dmChassis.InputEndpointOnlineFeedbacks[ioSlot] != null) {
|
||||
Debug.Console(2, "Linking Tx Online Feedback from Input Card {0}", ioSlot);
|
||||
dmChassis.InputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.InputEndpointOnline + ioSlot]);
|
||||
}
|
||||
}
|
||||
|
||||
if (basicTxDevice != null && advancedTxDevice == null)
|
||||
trilist.BooleanInput[joinMap.TxAdvancedIsPresent + ioSlot].BoolValue = true;
|
||||
|
||||
if (advancedTxDevice != null) {
|
||||
advancedTxDevice.AnyVideoInput.VideoStatus.VideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.VideoSyncStatus + ioSlot]);
|
||||
}
|
||||
else if (advancedTxDevice == null || basicTxDevice != null) {
|
||||
Debug.Console(1, "Setting up actions and feedbacks on input card {0}", ioSlot);
|
||||
dmChassis.VideoInputSyncFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.VideoSyncStatus + ioSlot]);
|
||||
|
||||
var inputPort = dmChassis.InputPorts[string.Format("inputCard{0}--hdmiIn", ioSlot)];
|
||||
if (inputPort != null) {
|
||||
Debug.Console(1, "Port value for input card {0} is set", ioSlot);
|
||||
var port = inputPort.Port;
|
||||
|
||||
if (port != null) {
|
||||
if (port is HdmiInputWithCEC) {
|
||||
Debug.Console(1, "Port is HdmiInputWithCec");
|
||||
|
||||
var hdmiInPortWCec = port as HdmiInputWithCEC;
|
||||
|
||||
if (hdmiInPortWCec.HdcpSupportedLevel != eHdcpSupportedLevel.Unknown) {
|
||||
SetHdcpStateAction(true, hdmiInPortWCec, joinMap.HdcpSupportState + ioSlot, trilist);
|
||||
}
|
||||
|
||||
dmChassis.InputCardHdcpCapabilityFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.HdcpSupportState + ioSlot]);
|
||||
|
||||
if (dmChassis.InputCardHdcpCapabilityTypes.ContainsKey(ioSlot))
|
||||
trilist.UShortInput[joinMap.HdcpSupportCapability + ioSlot].UShortValue = (ushort)dmChassis.InputCardHdcpCapabilityTypes[ioSlot];
|
||||
else
|
||||
trilist.UShortInput[joinMap.HdcpSupportCapability + ioSlot].UShortValue = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
inputPort = dmChassis.InputPorts[string.Format("inputCard{0}--dmIn", ioSlot)];
|
||||
|
||||
if (inputPort != null) {
|
||||
var port = inputPort.Port;
|
||||
|
||||
if (port is DMInputPortWithCec) {
|
||||
Debug.Console(1, "Port is DMInputPortWithCec");
|
||||
|
||||
var dmInPortWCec = port as DMInputPortWithCec;
|
||||
|
||||
if (dmInPortWCec != null) {
|
||||
SetHdcpStateAction(dmChassis.PropertiesConfig.InputSlotSupportsHdcp2[ioSlot], dmInPortWCec, joinMap.HdcpSupportState + ioSlot, trilist);
|
||||
}
|
||||
|
||||
dmChassis.InputCardHdcpCapabilityFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.HdcpSupportState + ioSlot]);
|
||||
|
||||
if (dmChassis.InputCardHdcpCapabilityTypes.ContainsKey(ioSlot))
|
||||
trilist.UShortInput[joinMap.HdcpSupportCapability + ioSlot].UShortValue = (ushort)dmChassis.InputCardHdcpCapabilityTypes[ioSlot];
|
||||
else
|
||||
trilist.UShortInput[joinMap.HdcpSupportCapability + ioSlot].UShortValue = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
dmChassis.VideoInputSyncFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.VideoSyncStatus + ioSlot]);
|
||||
|
||||
var inputPort = dmChassis.InputPorts[string.Format("inputCard{0}--hdmiIn", ioSlot)];
|
||||
if (inputPort != null) {
|
||||
var hdmiPort = inputPort.Port as EndpointHdmiInput;
|
||||
|
||||
if (hdmiPort != null) {
|
||||
SetHdcpStateAction(true, hdmiPort, joinMap.HdcpSupportState + ioSlot, trilist);
|
||||
dmChassis.InputCardHdcpCapabilityFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.HdcpSupportState + ioSlot]);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (dmChassis.RxDictionary.ContainsKey(ioSlot)) {
|
||||
Debug.Console(2, "Creating Rx Feedbacks {0}", ioSlot);
|
||||
//var rxKey = dmChassis.RxDictionary[ioSlot];
|
||||
//var rxDevice = DeviceManager.GetDeviceForKey(rxKey) as DmRmcControllerBase;
|
||||
//var hdBaseTDevice = DeviceManager.GetDeviceForKey(rxKey) as DmHdBaseTControllerBase;
|
||||
//if (hdBaseTDevice != null) {
|
||||
dmChassis.OutputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.OutputEndpointOnline + ioSlot]);
|
||||
//}
|
||||
//else if (rxDevice != null) {
|
||||
// rxDevice.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.OutputEndpointOnline + ioSlot]);
|
||||
//}
|
||||
}
|
||||
|
||||
// Feedback
|
||||
dmChassis.VideoOutputFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.OutputVideo + ioSlot]);
|
||||
|
||||
|
||||
dmChassis.OutputNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputNames + ioSlot]);
|
||||
dmChassis.InputNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.InputNames + ioSlot]);
|
||||
dmChassis.OutputVideoRouteNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputCurrentVideoInputNames + ioSlot]);
|
||||
}
|
||||
}
|
||||
|
||||
static void SetHdcpStateAction(bool hdcpTypeSimple, HdmiInputWithCEC port, uint join, BasicTriList trilist) {
|
||||
if (hdcpTypeSimple) {
|
||||
trilist.SetUShortSigAction(join,
|
||||
new Action<ushort>(s => {
|
||||
if (s == 0) {
|
||||
port.HdcpSupportOff();
|
||||
}
|
||||
else if (s > 0) {
|
||||
port.HdcpSupportOn();
|
||||
}
|
||||
}));
|
||||
}
|
||||
else {
|
||||
trilist.SetUShortSigAction(join,
|
||||
new Action<ushort>(u => {
|
||||
port.HdcpReceiveCapability = (eHdcpCapabilityType)u;
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
static void SetHdcpStateAction(bool hdcpTypeSimple, EndpointHdmiInput port, uint join, BasicTriList trilist) {
|
||||
if (hdcpTypeSimple) {
|
||||
trilist.SetUShortSigAction(join,
|
||||
new Action<ushort>(s => {
|
||||
if (s == 0) {
|
||||
port.HdcpSupportOff();
|
||||
}
|
||||
else if (s > 0) {
|
||||
port.HdcpSupportOn();
|
||||
}
|
||||
}));
|
||||
}
|
||||
else {
|
||||
trilist.SetUShortSigAction(join,
|
||||
new Action<ushort>(u => {
|
||||
port.HdcpCapability = (eHdcpCapabilityType)u;
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
static void SetHdcpStateAction(bool supportsHdcp2, DMInputPortWithCec port, uint join, BasicTriList trilist) {
|
||||
if (!supportsHdcp2) {
|
||||
trilist.SetUShortSigAction(join,
|
||||
new Action<ushort>(s => {
|
||||
if (s == 0) {
|
||||
port.HdcpSupportOff();
|
||||
}
|
||||
else if (s > 0) {
|
||||
port.HdcpSupportOn();
|
||||
}
|
||||
}));
|
||||
}
|
||||
else {
|
||||
trilist.SetUShortSigAction(join,
|
||||
new Action<ushort>(u => {
|
||||
port.HdcpReceiveCapability = (eHdcpCapabilityType)u;
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,130 +1,284 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.DM;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
public static class DmChassisControllerApiExtentions
|
||||
{
|
||||
public static void LinkToApi(this DmChassisController dmChassis, BasicTriList trilist, uint joinStart, string joinMapKey)
|
||||
{
|
||||
var joinMap = JoinMapHelper.GetJoinMapForDevice(joinMapKey) as DmChassisControllerJoinMap;
|
||||
|
||||
if (joinMap == null)
|
||||
joinMap = new DmChassisControllerJoinMap();
|
||||
|
||||
joinMap.OffsetJoinNumbers(joinStart);
|
||||
|
||||
Debug.Console(1, dmChassis, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
||||
|
||||
dmChassis.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
|
||||
|
||||
// Link up outputs
|
||||
for (uint i = 1; i <= dmChassis.Chassis.NumberOfOutputs - 1; i++)
|
||||
{
|
||||
var ioSlot = i;
|
||||
|
||||
// Control
|
||||
trilist.SetUShortSigAction(joinMap.OutputVideo + ioSlot, new Action<ushort>(o => dmChassis.ExecuteSwitch(o, ioSlot, eRoutingSignalType.Video)));
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
using Crestron.SimplSharpPro.DM;
|
||||
using Crestron.SimplSharpPro.DM.Endpoints;
|
||||
using Crestron.SimplSharpPro.DM.Endpoints.Transmitters;
|
||||
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.DM;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
public static class DmChassisControllerApiExtentions
|
||||
{
|
||||
public static void LinkToApi(this DmChassisController dmChassis, BasicTriList trilist, uint joinStart, string joinMapKey)
|
||||
{
|
||||
DmChassisControllerJoinMap joinMap = new DmChassisControllerJoinMap();
|
||||
|
||||
var joinMapSerialized = JoinMapHelper.GetJoinMapForDevice(joinMapKey);
|
||||
|
||||
if (!string.IsNullOrEmpty(joinMapSerialized))
|
||||
joinMap = JsonConvert.DeserializeObject<DmChassisControllerJoinMap>(joinMapSerialized);
|
||||
|
||||
|
||||
joinMap.OffsetJoinNumbers(joinStart);
|
||||
|
||||
Debug.Console(1, dmChassis, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
||||
|
||||
var chassis = dmChassis.Chassis as DmMDMnxn;
|
||||
|
||||
dmChassis.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
|
||||
|
||||
trilist.SetUShortSigAction(joinMap.SystemId, new Action<ushort>(o => chassis.SystemId.UShortValue = o));
|
||||
trilist.SetSigTrueAction(joinMap.SystemId, new Action(() => chassis.ApplySystemId()));
|
||||
|
||||
dmChassis.SystemIdFeebdack.LinkInputSig(trilist.UShortInput[joinMap.SystemId]);
|
||||
dmChassis.SystemIdBusyFeedback.LinkInputSig(trilist.BooleanInput[joinMap.SystemId]);
|
||||
|
||||
// Link up outputs
|
||||
for (uint i = 1; i <= dmChassis.Chassis.NumberOfOutputs; i++)
|
||||
{
|
||||
var ioSlot = i;
|
||||
|
||||
// Control
|
||||
trilist.SetUShortSigAction(joinMap.OutputVideo + ioSlot, new Action<ushort>(o => dmChassis.ExecuteSwitch(o, ioSlot, eRoutingSignalType.Video)));
|
||||
trilist.SetUShortSigAction(joinMap.OutputAudio + ioSlot, new Action<ushort>(o => dmChassis.ExecuteSwitch(o, ioSlot, eRoutingSignalType.Audio)));
|
||||
if (dmChassis.TxDictionary.ContainsKey(ioSlot))
|
||||
{
|
||||
Debug.Console(2, "Creating Tx Feedbacks {0}", ioSlot);
|
||||
var TxKey = dmChassis.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 (dmChassis.RxDictionary.ContainsKey(ioSlot))
|
||||
{
|
||||
Debug.Console(2, "Creating Rx Feedbacks {0}", ioSlot);
|
||||
var RxKey = dmChassis.RxDictionary[ioSlot];
|
||||
var RxDevice = DeviceManager.GetDeviceForKey(RxKey) as DmRmcControllerBase;
|
||||
RxDevice.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.OutputEndpointOnline + ioSlot]);
|
||||
}
|
||||
// Feedback
|
||||
dmChassis.VideoOutputFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.OutputVideo + ioSlot]);
|
||||
dmChassis.AudioOutputFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.OutputAudio + ioSlot]);
|
||||
|
||||
dmChassis.VideoInputSyncFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.VideoSyncStatus + ioSlot]);
|
||||
|
||||
dmChassis.OutputNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputNames + ioSlot]);
|
||||
dmChassis.InputNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.InputNames + ioSlot]);
|
||||
dmChassis.OutputVideoRouteNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputCurrentVideoInputNames + ioSlot]);
|
||||
dmChassis.OutputAudioRouteNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputCurrentAudioInputNames + ioSlot]);
|
||||
// dmChassis.InputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.InputEndpointOnline + ioSlot]);
|
||||
// dmChassis.OutputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.OutputEndpointOnline + ioSlot]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class DmChassisControllerJoinMap : JoinMapBase
|
||||
{
|
||||
public uint IsOnline { get; set; }
|
||||
public uint OutputVideo { get; set; }
|
||||
public uint OutputAudio { get; set; }
|
||||
public uint VideoSyncStatus { get; set; }
|
||||
public uint InputNames { get; set; }
|
||||
public uint OutputNames { get; set; }
|
||||
public uint OutputCurrentVideoInputNames { get; set; }
|
||||
public uint OutputCurrentAudioInputNames { get; set; }
|
||||
public uint InputCurrentResolution { get; set; }
|
||||
public uint InputEndpointOnline { get; set; }
|
||||
public uint OutputEndpointOnline { get; set; }
|
||||
//public uint HdcpSupport { get; set; }
|
||||
//public uint HdcpSupportCapability { get; set; }
|
||||
|
||||
|
||||
public DmChassisControllerJoinMap()
|
||||
{
|
||||
IsOnline = 11;
|
||||
OutputVideo = 100; //101-299
|
||||
OutputAudio = 300; //301-499
|
||||
VideoSyncStatus = 100; //101-299
|
||||
InputNames = 100; //101-299
|
||||
OutputNames = 300; //301-499
|
||||
OutputCurrentVideoInputNames = 2000; //2001-2199
|
||||
OutputCurrentAudioInputNames = 2200; //2201-2399
|
||||
InputCurrentResolution = 2400; // 2401-2599
|
||||
InputEndpointOnline = 500;
|
||||
OutputEndpointOnline = 700;
|
||||
//HdcpSupport = 1000; //1001-1199
|
||||
//HdcpSupportCapability = 1200; //1201-1399
|
||||
|
||||
}
|
||||
|
||||
public override void OffsetJoinNumbers(uint joinStart)
|
||||
{
|
||||
var joinOffset = joinStart - 1;
|
||||
|
||||
IsOnline = IsOnline + joinOffset;
|
||||
OutputVideo = OutputVideo + joinOffset;
|
||||
OutputAudio = OutputAudio + joinOffset;
|
||||
VideoSyncStatus = VideoSyncStatus + joinOffset;
|
||||
InputNames = InputNames + joinOffset;
|
||||
OutputNames = OutputNames + joinOffset;
|
||||
OutputCurrentVideoInputNames = OutputCurrentVideoInputNames + joinOffset;
|
||||
OutputCurrentAudioInputNames = OutputCurrentAudioInputNames + joinOffset;
|
||||
InputCurrentResolution = InputCurrentResolution + joinOffset;
|
||||
InputEndpointOnline = InputEndpointOnline + joinOffset;
|
||||
OutputEndpointOnline = OutputEndpointOnline + joinOffset;
|
||||
//HdcpSupport = HdcpSupport + joinOffset;
|
||||
//HdcpSupportCapability = HdcpSupportCapability + joinOffset;
|
||||
}
|
||||
}
|
||||
}
|
||||
trilist.SetUShortSigAction(joinMap.OutputUsb + ioSlot, new Action<ushort>(o => dmChassis.ExecuteSwitch(o, ioSlot, eRoutingSignalType.UsbOutput)));
|
||||
trilist.SetUShortSigAction(joinMap.InputUsb + ioSlot, new Action<ushort>(o => dmChassis.ExecuteSwitch(o, ioSlot, eRoutingSignalType.UsbInput)));
|
||||
|
||||
if (dmChassis.TxDictionary.ContainsKey(ioSlot))
|
||||
{
|
||||
Debug.Console(2, "Creating Tx Feedbacks {0}", ioSlot);
|
||||
var txKey = dmChassis.TxDictionary[ioSlot];
|
||||
var basicTxDevice = DeviceManager.GetDeviceForKey(txKey) as BasicDmTxControllerBase;
|
||||
|
||||
var advancedTxDevice = basicTxDevice as DmTxControllerBase;
|
||||
|
||||
if (dmChassis.Chassis is DmMd8x8Cpu3 || dmChassis.Chassis is DmMd8x8Cpu3rps
|
||||
|| dmChassis.Chassis is DmMd16x16Cpu3 || dmChassis.Chassis is DmMd16x16Cpu3rps
|
||||
|| dmChassis.Chassis is DmMd32x32Cpu3 || dmChassis.Chassis is DmMd32x32Cpu3rps)
|
||||
{
|
||||
dmChassis.InputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.InputEndpointOnline + ioSlot]);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (advancedTxDevice != null)
|
||||
{
|
||||
advancedTxDevice.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.InputEndpointOnline + ioSlot]);
|
||||
Debug.Console(2, "Linking Tx Online Feedback from Advanced Transmitter at input {0}", ioSlot);
|
||||
}
|
||||
else if (dmChassis.InputEndpointOnlineFeedbacks[ioSlot] != null)
|
||||
{
|
||||
Debug.Console(2, "Linking Tx Online Feedback from Input Card {0}", ioSlot);
|
||||
dmChassis.InputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.InputEndpointOnline + ioSlot]);
|
||||
}
|
||||
}
|
||||
|
||||
if (basicTxDevice != null && advancedTxDevice == null)
|
||||
trilist.BooleanInput[joinMap.TxAdvancedIsPresent + ioSlot].BoolValue = true;
|
||||
|
||||
if (advancedTxDevice != null)
|
||||
{
|
||||
advancedTxDevice.AnyVideoInput.VideoStatus.VideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.VideoSyncStatus + ioSlot]);
|
||||
}
|
||||
else if(advancedTxDevice == null || basicTxDevice != null)
|
||||
{
|
||||
Debug.Console(1, "Setting up actions and feedbacks on input card {0}", ioSlot);
|
||||
dmChassis.VideoInputSyncFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.VideoSyncStatus + ioSlot]);
|
||||
|
||||
var inputPort = dmChassis.InputPorts[string.Format("inputCard{0}--hdmiIn", ioSlot)];
|
||||
if (inputPort != null)
|
||||
{
|
||||
Debug.Console(1, "Port value for input card {0} is set", ioSlot);
|
||||
var port = inputPort.Port;
|
||||
|
||||
if (port != null)
|
||||
{
|
||||
if (port is HdmiInputWithCEC)
|
||||
{
|
||||
Debug.Console(1, "Port is HdmiInputWithCec");
|
||||
|
||||
var hdmiInPortWCec = port as HdmiInputWithCEC;
|
||||
|
||||
if (hdmiInPortWCec.HdcpSupportedLevel != eHdcpSupportedLevel.Unknown)
|
||||
{
|
||||
SetHdcpStateAction(true, hdmiInPortWCec, joinMap.HdcpSupportState + ioSlot, trilist);
|
||||
}
|
||||
|
||||
dmChassis.InputCardHdcpCapabilityFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.HdcpSupportState + ioSlot]);
|
||||
|
||||
if(dmChassis.InputCardHdcpCapabilityTypes.ContainsKey(ioSlot))
|
||||
trilist.UShortInput[joinMap.HdcpSupportCapability + ioSlot].UShortValue = (ushort)dmChassis.InputCardHdcpCapabilityTypes[ioSlot];
|
||||
else
|
||||
trilist.UShortInput[joinMap.HdcpSupportCapability + ioSlot].UShortValue = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
inputPort = dmChassis.InputPorts[string.Format("inputCard{0}--dmIn", ioSlot)];
|
||||
|
||||
if(inputPort != null)
|
||||
{
|
||||
var port = inputPort.Port;
|
||||
|
||||
if (port is DMInputPortWithCec)
|
||||
{
|
||||
Debug.Console(1, "Port is DMInputPortWithCec");
|
||||
|
||||
var dmInPortWCec = port as DMInputPortWithCec;
|
||||
|
||||
if (dmInPortWCec != null)
|
||||
{
|
||||
SetHdcpStateAction(dmChassis.PropertiesConfig.InputSlotSupportsHdcp2[ioSlot], dmInPortWCec, joinMap.HdcpSupportState + ioSlot, trilist);
|
||||
}
|
||||
|
||||
dmChassis.InputCardHdcpCapabilityFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.HdcpSupportState + ioSlot]);
|
||||
|
||||
if (dmChassis.InputCardHdcpCapabilityTypes.ContainsKey(ioSlot))
|
||||
trilist.UShortInput[joinMap.HdcpSupportCapability + ioSlot].UShortValue = (ushort)dmChassis.InputCardHdcpCapabilityTypes[ioSlot];
|
||||
else
|
||||
trilist.UShortInput[joinMap.HdcpSupportCapability + ioSlot].UShortValue = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dmChassis.VideoInputSyncFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.VideoSyncStatus + ioSlot]);
|
||||
|
||||
var inputPort = dmChassis.InputPorts[string.Format("inputCard{0}--hdmiIn", ioSlot)];
|
||||
if (inputPort != null)
|
||||
{
|
||||
var hdmiPort = inputPort.Port as EndpointHdmiInput;
|
||||
|
||||
if (hdmiPort != null)
|
||||
{
|
||||
SetHdcpStateAction(true, hdmiPort, joinMap.HdcpSupportState + ioSlot, trilist);
|
||||
dmChassis.InputCardHdcpCapabilityFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.HdcpSupportState + ioSlot]);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (dmChassis.RxDictionary.ContainsKey(ioSlot))
|
||||
{
|
||||
Debug.Console(2, "Creating Rx Feedbacks {0}", ioSlot);
|
||||
var rxKey = dmChassis.RxDictionary[ioSlot];
|
||||
var rxDevice = DeviceManager.GetDeviceForKey(rxKey) as DmRmcControllerBase;
|
||||
var hdBaseTDevice = DeviceManager.GetDeviceForKey(rxKey) as DmHdBaseTControllerBase;
|
||||
if (dmChassis.Chassis is DmMd8x8Cpu3 || dmChassis.Chassis is DmMd8x8Cpu3rps
|
||||
|| dmChassis.Chassis is DmMd16x16Cpu3 || dmChassis.Chassis is DmMd16x16Cpu3rps
|
||||
|| dmChassis.Chassis is DmMd32x32Cpu3 || dmChassis.Chassis is DmMd32x32Cpu3rps || hdBaseTDevice != null)
|
||||
{
|
||||
dmChassis.OutputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.OutputEndpointOnline + ioSlot]);
|
||||
}
|
||||
else if (rxDevice != null)
|
||||
{
|
||||
rxDevice.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.OutputEndpointOnline + ioSlot]);
|
||||
}
|
||||
}
|
||||
|
||||
// Feedback
|
||||
dmChassis.VideoOutputFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.OutputVideo + ioSlot]);
|
||||
dmChassis.AudioOutputFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.OutputAudio + ioSlot]);
|
||||
dmChassis.UsbOutputRoutedToFeebacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.OutputUsb + ioSlot]);
|
||||
dmChassis.UsbInputRoutedToFeebacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.InputUsb + ioSlot]);
|
||||
|
||||
|
||||
dmChassis.OutputNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputNames + ioSlot]);
|
||||
dmChassis.InputNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.InputNames + ioSlot]);
|
||||
dmChassis.OutputVideoRouteNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputCurrentVideoInputNames + ioSlot]);
|
||||
dmChassis.OutputAudioRouteNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputCurrentAudioInputNames + ioSlot]);
|
||||
}
|
||||
}
|
||||
|
||||
static void SetHdcpStateAction(bool hdcpTypeSimple, HdmiInputWithCEC port, uint join, BasicTriList trilist)
|
||||
{
|
||||
if (hdcpTypeSimple)
|
||||
{
|
||||
trilist.SetUShortSigAction(join,
|
||||
new Action<ushort>(s =>
|
||||
{
|
||||
if (s == 0)
|
||||
{
|
||||
port.HdcpSupportOff();
|
||||
}
|
||||
else if (s > 0)
|
||||
{
|
||||
port.HdcpSupportOn();
|
||||
}
|
||||
}));
|
||||
}
|
||||
else
|
||||
{
|
||||
trilist.SetUShortSigAction(join,
|
||||
new Action<ushort>(u =>
|
||||
{
|
||||
port.HdcpReceiveCapability = (eHdcpCapabilityType)u;
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
static void SetHdcpStateAction(bool hdcpTypeSimple, EndpointHdmiInput port, uint join, BasicTriList trilist)
|
||||
{
|
||||
if (hdcpTypeSimple)
|
||||
{
|
||||
trilist.SetUShortSigAction(join,
|
||||
new Action<ushort>(s =>
|
||||
{
|
||||
if (s == 0)
|
||||
{
|
||||
port.HdcpSupportOff();
|
||||
}
|
||||
else if (s > 0)
|
||||
{
|
||||
port.HdcpSupportOn();
|
||||
}
|
||||
}));
|
||||
}
|
||||
else
|
||||
{
|
||||
trilist.SetUShortSigAction(join,
|
||||
new Action<ushort>(u =>
|
||||
{
|
||||
port.HdcpCapability = (eHdcpCapabilityType)u;
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
static void SetHdcpStateAction(bool supportsHdcp2, DMInputPortWithCec port, uint join, BasicTriList trilist)
|
||||
{
|
||||
if (!supportsHdcp2)
|
||||
{
|
||||
trilist.SetUShortSigAction(join,
|
||||
new Action<ushort>(s =>
|
||||
{
|
||||
if (s == 0)
|
||||
{
|
||||
port.HdcpSupportOff();
|
||||
}
|
||||
else if (s > 0)
|
||||
{
|
||||
port.HdcpSupportOn();
|
||||
}
|
||||
}));
|
||||
}
|
||||
else
|
||||
{
|
||||
trilist.SetUShortSigAction(join,
|
||||
new Action<ushort>(u =>
|
||||
{
|
||||
port.HdcpReceiveCapability = (eHdcpCapabilityType)u;
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -9,16 +9,20 @@ using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.DM;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
public static class DmRmcControllerApiExtensions
|
||||
{
|
||||
public static void LinkToApi(this DmRmcControllerBase rmc, BasicTriList trilist, uint joinStart, string joinMapKey)
|
||||
{
|
||||
var joinMap = JoinMapHelper.GetJoinMapForDevice(joinMapKey) as DmRmcControllerJoinMap;
|
||||
DmRmcControllerJoinMap joinMap = new DmRmcControllerJoinMap();
|
||||
|
||||
if (joinMap == null)
|
||||
joinMap = new DmRmcControllerJoinMap();
|
||||
var joinMapSerialized = JoinMapHelper.GetJoinMapForDevice(joinMapKey);
|
||||
|
||||
if (!string.IsNullOrEmpty(joinMapSerialized))
|
||||
joinMap = JsonConvert.DeserializeObject<DmRmcControllerJoinMap>(joinMapSerialized);
|
||||
|
||||
joinMap.OffsetJoinNumbers(joinStart);
|
||||
|
||||
@@ -36,40 +40,5 @@ namespace PepperDash.Essentials.Bridges
|
||||
if(rmc.EdidSerialNumberFeedback != null)
|
||||
rmc.EdidSerialNumberFeedback.LinkInputSig(trilist.StringInput[joinMap.EdidSerialNumber]);
|
||||
}
|
||||
|
||||
public class DmRmcControllerJoinMap : JoinMapBase
|
||||
{
|
||||
public uint IsOnline { get; set; }
|
||||
public uint CurrentOutputResolution { get; set; }
|
||||
public uint EdidManufacturer { get; set; }
|
||||
public uint EdidName { get; set; }
|
||||
public uint EdidPrefferedTiming { get; set; }
|
||||
public uint EdidSerialNumber { get; set; }
|
||||
|
||||
public DmRmcControllerJoinMap()
|
||||
{
|
||||
// Digital
|
||||
IsOnline = 1;
|
||||
|
||||
// Serial
|
||||
CurrentOutputResolution = 1;
|
||||
EdidManufacturer = 2;
|
||||
EdidName = 3;
|
||||
EdidPrefferedTiming = 4;
|
||||
EdidSerialNumber = 5;
|
||||
}
|
||||
|
||||
public override void OffsetJoinNumbers(uint joinStart)
|
||||
{
|
||||
var joinOffset = joinStart - 1;
|
||||
|
||||
IsOnline = IsOnline + joinOffset;
|
||||
CurrentOutputResolution = CurrentOutputResolution + joinOffset;
|
||||
EdidManufacturer = EdidManufacturer + joinOffset;
|
||||
EdidName = EdidName + joinOffset;
|
||||
EdidPrefferedTiming = EdidPrefferedTiming + joinOffset;
|
||||
EdidSerialNumber = EdidSerialNumber + joinOffset;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,16 +12,20 @@ using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.DM;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
public static class DmTxControllerApiExtensions
|
||||
{
|
||||
public static void LinkToApi(this DmTxControllerBase tx, BasicTriList trilist, uint joinStart, string joinMapKey)
|
||||
{
|
||||
var joinMap = JoinMapHelper.GetJoinMapForDevice(joinMapKey) as DmTxControllerJoinMap;
|
||||
DmTxControllerJoinMap joinMap = new DmTxControllerJoinMap();
|
||||
|
||||
if (joinMap == null)
|
||||
joinMap = new DmTxControllerJoinMap();
|
||||
var joinMapSerialized = JoinMapHelper.GetJoinMapForDevice(joinMapKey);
|
||||
|
||||
if (!string.IsNullOrEmpty(joinMapSerialized))
|
||||
joinMap = JsonConvert.DeserializeObject<DmTxControllerJoinMap>(joinMapSerialized);
|
||||
|
||||
joinMap.OffsetJoinNumbers(joinStart);
|
||||
|
||||
@@ -30,7 +34,7 @@ namespace PepperDash.Essentials.Bridges
|
||||
tx.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
|
||||
tx.AnyVideoInput.VideoStatus.VideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.VideoSyncStatus]);
|
||||
tx.AnyVideoInput.VideoStatus.VideoResolutionFeedback.LinkInputSig(trilist.StringInput[joinMap.CurrentInputResolution]);
|
||||
//tx.HdcpSupportAllFeedback.LinkInputSig(trilist.UShortInput[joinMap.HdcpSupportCapability]);
|
||||
trilist.UShortInput[joinMap.HdcpSupportCapability].UShortValue = (ushort)tx.HdcpSupportCapability;
|
||||
|
||||
bool hdcpTypeSimple;
|
||||
|
||||
@@ -128,46 +132,6 @@ namespace PepperDash.Essentials.Bridges
|
||||
}
|
||||
}
|
||||
|
||||
public class DmTxControllerJoinMap : JoinMapBase
|
||||
{
|
||||
public uint IsOnline { get; set; }
|
||||
public uint VideoSyncStatus { get; set; }
|
||||
public uint CurrentInputResolution { get; set; }
|
||||
public uint HdcpSupportCapability { get; set; }
|
||||
public uint VideoInput { get; set; }
|
||||
public uint AudioInput { get; set; }
|
||||
public uint Port1HdcpState { get; set; }
|
||||
public uint Port2HdcpState { get; set; }
|
||||
|
||||
|
||||
public DmTxControllerJoinMap()
|
||||
{
|
||||
// Digital
|
||||
IsOnline = 1;
|
||||
VideoSyncStatus = 2;
|
||||
// Serial
|
||||
CurrentInputResolution = 1;
|
||||
// Analog
|
||||
VideoInput = 1;
|
||||
AudioInput = 2;
|
||||
HdcpSupportCapability = 3;
|
||||
Port1HdcpState = 4;
|
||||
Port2HdcpState = 5;
|
||||
}
|
||||
|
||||
public override void OffsetJoinNumbers(uint joinStart)
|
||||
{
|
||||
var joinOffset = joinStart - 1;
|
||||
|
||||
IsOnline = IsOnline + joinOffset;
|
||||
VideoSyncStatus = VideoSyncStatus + joinOffset;
|
||||
CurrentInputResolution = CurrentInputResolution + joinOffset;
|
||||
VideoInput = VideoInput + joinOffset;
|
||||
AudioInput = AudioInput + joinOffset;
|
||||
HdcpSupportCapability = HdcpSupportCapability + joinOffset;
|
||||
Port1HdcpState = Port1HdcpState + joinOffset;
|
||||
Port2HdcpState = Port2HdcpState + joinOffset;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
using Crestron.SimplSharpPro.DM;
|
||||
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.DM;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
public static class DmpsAudioOutputControllerApiExtensions
|
||||
{
|
||||
public static void LinkToApi(this DmpsAudioOutputController dmAudioOutputController, BasicTriList trilist, uint joinStart, string joinMapKey)
|
||||
{
|
||||
DmpsAudioOutputControllerJoinMap joinMap = new DmpsAudioOutputControllerJoinMap();
|
||||
|
||||
var joinMapSerialized = JoinMapHelper.GetJoinMapForDevice(joinMapKey);
|
||||
|
||||
if (!string.IsNullOrEmpty(joinMapSerialized))
|
||||
joinMap = JsonConvert.DeserializeObject<DmpsAudioOutputControllerJoinMap>(joinMapSerialized);
|
||||
|
||||
joinMap.OffsetJoinNumbers(joinStart);
|
||||
|
||||
Debug.Console(1, dmAudioOutputController, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
||||
|
||||
if (dmAudioOutputController.MasterVolumeLevel != null)
|
||||
{
|
||||
SetUpDmpsAudioOutputJoins(trilist, dmAudioOutputController.MasterVolumeLevel, joinMap.MasterVolume);
|
||||
}
|
||||
|
||||
if (dmAudioOutputController.SourceVolumeLevel != null)
|
||||
{
|
||||
SetUpDmpsAudioOutputJoins(trilist, dmAudioOutputController.SourceVolumeLevel, joinMap.SourceVolume);
|
||||
}
|
||||
|
||||
if (dmAudioOutputController.Codec1VolumeLevel != null)
|
||||
{
|
||||
SetUpDmpsAudioOutputJoins(trilist, dmAudioOutputController.Codec1VolumeLevel, joinMap.Codec1Volume);
|
||||
}
|
||||
|
||||
if (dmAudioOutputController.Codec2VolumeLevel != null)
|
||||
{
|
||||
SetUpDmpsAudioOutputJoins(trilist, dmAudioOutputController.Codec2VolumeLevel, joinMap.Codec2Volume);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static void SetUpDmpsAudioOutputJoins(BasicTriList trilist, DmpsAudioOutput output, uint joinStart)
|
||||
{
|
||||
var volumeLevelJoin = joinStart;
|
||||
var muteOnJoin = joinStart;
|
||||
var muteOffJoin = joinStart + 1;
|
||||
var volumeUpJoin = joinStart + 2;
|
||||
var volumeDownJoin = joinStart + 3;
|
||||
|
||||
|
||||
trilist.SetUShortSigAction(volumeLevelJoin, new Action<ushort>(o => output.SetVolume(o)));
|
||||
output.VolumeLevelFeedback.LinkInputSig(trilist.UShortInput[volumeLevelJoin]);
|
||||
|
||||
trilist.SetSigTrueAction(muteOnJoin, new Action(output.MuteOn));
|
||||
output.MuteFeedback.LinkInputSig(trilist.BooleanInput[muteOnJoin]);
|
||||
trilist.SetSigTrueAction(muteOffJoin, new Action(output.MuteOff));
|
||||
output.MuteFeedback.LinkComplementInputSig(trilist.BooleanInput[muteOffJoin]);
|
||||
|
||||
trilist.SetBoolSigAction(volumeUpJoin, new Action<bool>(b => output.VolumeUp(b)));
|
||||
trilist.SetBoolSigAction(volumeDownJoin, new Action<bool>(b => output.VolumeDown(b)));
|
||||
}
|
||||
}
|
||||
}
|
||||
128
PepperDashEssentials/Bridges/DmpsRoutingControllerBridge.cs
Normal file
128
PepperDashEssentials/Bridges/DmpsRoutingControllerBridge.cs
Normal file
@@ -0,0 +1,128 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
using Crestron.SimplSharpPro.DM;
|
||||
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.DM;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
public static class DmpsRoutingControllerApiExtentions
|
||||
{
|
||||
public static void LinkToApi(this DmpsRoutingController dmpsRouter, BasicTriList trilist, uint joinStart, string joinMapKey)
|
||||
{
|
||||
DmpsRoutingControllerJoinMap joinMap = new DmpsRoutingControllerJoinMap();
|
||||
|
||||
var joinMapSerialized = JoinMapHelper.GetJoinMapForDevice(joinMapKey);
|
||||
|
||||
if (!string.IsNullOrEmpty(joinMapSerialized))
|
||||
joinMap = JsonConvert.DeserializeObject<DmpsRoutingControllerJoinMap>(joinMapSerialized);
|
||||
|
||||
joinMap.OffsetJoinNumbers(joinStart);
|
||||
|
||||
Debug.Console(1, dmpsRouter, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
||||
|
||||
// Link up outputs
|
||||
for (uint i = 1; i <= dmpsRouter.Dmps.NumberOfSwitcherInputs; i++)
|
||||
{
|
||||
Debug.Console(2, dmpsRouter, "Linking Input Card {0}", i);
|
||||
|
||||
var ioSlot = i;
|
||||
|
||||
//if (dmpsRouter.TxDictionary.ContainsKey(ioSlot))
|
||||
//{
|
||||
// Debug.Console(2, "Creating Tx Feedbacks {0}", ioSlot);
|
||||
// var TxKey = dmpsRouter.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(dmpsRouter.VideoInputSyncFeedbacks[ioSlot] != null)
|
||||
dmpsRouter.VideoInputSyncFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.VideoSyncStatus + ioSlot]);
|
||||
|
||||
if (dmpsRouter.InputNameFeedbacks[ioSlot] != null)
|
||||
dmpsRouter.InputNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.InputNames + ioSlot]);
|
||||
|
||||
trilist.SetStringSigAction(joinMap.InputNames + ioSlot, new Action<string>(s =>
|
||||
{
|
||||
var inputCard = dmpsRouter.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(dmpsRouter.InputEndpointOnlineFeedbacks[ioSlot] != null)
|
||||
dmpsRouter.InputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.InputEndpointOnline + ioSlot]);
|
||||
}
|
||||
|
||||
for (uint i = 1; i <= dmpsRouter.Dmps.NumberOfSwitcherOutputs; i++)
|
||||
{
|
||||
Debug.Console(2, dmpsRouter, "Linking Output Card {0}", i);
|
||||
|
||||
var ioSlot = i;
|
||||
// Control
|
||||
trilist.SetUShortSigAction(joinMap.OutputVideo + ioSlot, new Action<ushort>(o => dmpsRouter.ExecuteSwitch(o, ioSlot, eRoutingSignalType.Video)));
|
||||
trilist.SetUShortSigAction(joinMap.OutputAudio + ioSlot, new Action<ushort>(o => dmpsRouter.ExecuteSwitch(o, ioSlot, eRoutingSignalType.Audio)));
|
||||
|
||||
trilist.SetStringSigAction(joinMap.OutputNames + ioSlot, new Action<string>(s =>
|
||||
{
|
||||
var outputCard = dmpsRouter.Dmps.SwitcherOutputs[ioSlot] as DMOutput;
|
||||
|
||||
//Debug.Console(2, dmpsRouter, "Output Name String Sig Action for Output Card {0}", ioSlot);
|
||||
|
||||
if (outputCard != null)
|
||||
{
|
||||
//Debug.Console(2, dmpsRouter, "Card Type: {0}", outputCard.CardInputOutputType);
|
||||
|
||||
if (!(outputCard is Crestron.SimplSharpPro.DM.Cards.Card.Dmps3CodecOutput) && outputCard.NameFeedback != null)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(outputCard.NameFeedback.StringValue))
|
||||
{
|
||||
//Debug.Console(2, dmpsRouter, "NameFeedabck: {0}", outputCard.NameFeedback.StringValue);
|
||||
|
||||
if (outputCard.NameFeedback.StringValue != s && outputCard.Name != null)
|
||||
{
|
||||
outputCard.Name.StringValue = s;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}));
|
||||
|
||||
// Feedback
|
||||
if(dmpsRouter.VideoOutputFeedbacks[ioSlot] != null)
|
||||
dmpsRouter.VideoOutputFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.OutputVideo + ioSlot]);
|
||||
if (dmpsRouter.AudioOutputFeedbacks[ioSlot] != null)
|
||||
dmpsRouter.AudioOutputFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.OutputAudio + ioSlot]);
|
||||
if (dmpsRouter.OutputNameFeedbacks[ioSlot] != null)
|
||||
dmpsRouter.OutputNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputNames + ioSlot]);
|
||||
if (dmpsRouter.OutputVideoRouteNameFeedbacks[ioSlot] != null)
|
||||
dmpsRouter.OutputVideoRouteNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputCurrentVideoInputNames + ioSlot]);
|
||||
if (dmpsRouter.OutputAudioRouteNameFeedbacks[ioSlot] != null)
|
||||
dmpsRouter.OutputAudioRouteNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputCurrentAudioInputNames + ioSlot]);
|
||||
if (dmpsRouter.OutputEndpointOnlineFeedbacks[ioSlot] != null)
|
||||
dmpsRouter.OutputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.OutputEndpointOnline + ioSlot]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,103 +1,74 @@
|
||||
//using System;
|
||||
//using System.Collections.Generic;
|
||||
//using System.Linq;
|
||||
//using System.Text;
|
||||
//using Crestron.SimplSharp;
|
||||
//using Crestron.SimplSharpPro.DeviceSupport;
|
||||
//using PepperDash.Core;
|
||||
//using PepperDash.Essentials.Core;
|
||||
//using PepperDash.Essentials.Devices.Common;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Devices.Common;
|
||||
|
||||
//namespace PepperDash.Essentials.Bridges
|
||||
//{
|
||||
// public static class GenericLightingApiExtensions
|
||||
// {
|
||||
// public static void LinkToApi(this PepperDash.Essentials.Core.Lighting.LightingBase lightingDevice, BasicTriList trilist, uint joinStart, string joinMapKey)
|
||||
// {
|
||||
// var joinMap = JoinMapHelper.GetJoinMapForDevice(joinMapKey) as GenericLightingJoinMap;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
// if (joinMap == null)
|
||||
// joinMap = new GenericLightingJoinMap();
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
public static class GenericLightingApiExtensions
|
||||
{
|
||||
public static void LinkToApi(this PepperDash.Essentials.Core.Lighting.LightingBase lightingDevice, BasicTriList trilist, uint joinStart, string joinMapKey)
|
||||
{
|
||||
GenericLightingJoinMap joinMap = new GenericLightingJoinMap();
|
||||
|
||||
// joinMap.OffsetJoinNumbers(joinStart);
|
||||
// Debug.Console(1, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
||||
var joinMapSerialized = JoinMapHelper.GetJoinMapForDevice(joinMapKey);
|
||||
|
||||
if (!string.IsNullOrEmpty(joinMapSerialized))
|
||||
joinMap = JsonConvert.DeserializeObject<GenericLightingJoinMap>(joinMapSerialized);
|
||||
|
||||
joinMap.OffsetJoinNumbers(joinStart);
|
||||
|
||||
Debug.Console(1, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
||||
|
||||
Debug.Console(0, "Linking to Lighting Type {0}", lightingDevice.GetType().Name.ToString());
|
||||
|
||||
// GenericLighitng Actions & FeedBack
|
||||
trilist.SetUShortSigAction(joinMap.SelectScene, u => lightingDevice.SelectScene(lightingDevice.LightingScenes[u]));
|
||||
|
||||
int sceneIndex = 1;
|
||||
foreach (var scene in lightingDevice.LightingScenes)
|
||||
{
|
||||
var tempIndex = sceneIndex - 1;
|
||||
trilist.SetSigTrueAction((uint)(joinMap.LightingSceneOffset + sceneIndex), () => lightingDevice.SelectScene(lightingDevice.LightingScenes[tempIndex]));
|
||||
scene.IsActiveFeedback.LinkInputSig(trilist.BooleanInput[(uint)(joinMap.LightingSceneOffset + sceneIndex)]);
|
||||
trilist.StringInput[(uint)(joinMap.LightingSceneOffset + sceneIndex)].StringValue = scene.Name;
|
||||
trilist.BooleanInput[(uint)(joinMap.ButtonVisibilityOffset + sceneIndex)].BoolValue = true;
|
||||
sceneIndex++;
|
||||
}
|
||||
|
||||
if (lightingDevice.GetType().Name.ToString() == "LutronQuantumArea")
|
||||
{
|
||||
var lutronDevice = lightingDevice as PepperDash.Essentials.Devices.Common.Environment.Lutron.LutronQuantumArea;
|
||||
lutronDevice.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
|
||||
trilist.SetStringSigAction(joinMap.IntegrationIdSet, s => lutronDevice.IntegrationId = s);
|
||||
}
|
||||
|
||||
//ApiEisc.Eisc.SetStringSigAction(ApiMap.integrationID, (s) => { lutronLights.IntegrationId = s; });
|
||||
|
||||
|
||||
/*
|
||||
var lutronLights = lightingDevice as PepperDash.Essentials.Devices.Common.Environment.Lutron.LutronQuantumArea;
|
||||
|
||||
|
||||
for (uint i = 1; i <= lightingBase.CircuitCount; i++)
|
||||
{
|
||||
var circuit = i;
|
||||
lightingBase.CircuitNameFeedbacks[circuit - 1].LinkInputSig(trilist.StringInput[joinMap.CircuitNames + circuit]);
|
||||
lightingBase.CircuitIsCritical[circuit - 1].LinkInputSig(trilist.BooleanInput[joinMap.CircuitIsCritical + circuit]);
|
||||
lightingBase.CircuitState[circuit - 1].LinkInputSig(trilist.BooleanInput[joinMap.CircuitState + circuit]);
|
||||
trilist.SetSigTrueAction(joinMap.CircuitCycle + circuit, () => lightingBase.CycleCircuit(circuit - 1));
|
||||
trilist.SetSigTrueAction(joinMap.CircuitOnCmd + circuit, () => lightingBase.TurnOnCircuit(circuit - 1));
|
||||
trilist.SetSigTrueAction(joinMap.CircuitOffCmd + circuit, () => lightingBase.TurnOffCircuit(circuit - 1));
|
||||
|
||||
// Debug.Console(0, "Linking to lighting Type {0}", lightingDevice.GetType().Name.ToString());
|
||||
|
||||
// // GenericLighitng Actions & FeedBack
|
||||
// trilist.SetUShortSigAction(joinMap.SelectScene, u => lightingDevice.SelectScene(lightingDevice.LightingScenes[u]));
|
||||
|
||||
// int sceneIndex = 1;
|
||||
// foreach (var scene in lightingDevice.LightingScenes)
|
||||
// {
|
||||
// var tempIndex = sceneIndex - 1;
|
||||
// trilist.SetSigTrueAction((uint)(joinMap.LightingSceneOffset + sceneIndex), () => lightingDevice.SelectScene(lightingDevice.LightingScenes[tempIndex]));
|
||||
// scene.IsActiveFeedback.LinkInputSig(trilist.BooleanInput[(uint)(joinMap.LightingSceneOffset + sceneIndex)]);
|
||||
// trilist.StringInput[(uint)(joinMap.LightingSceneOffset + sceneIndex)].StringValue = scene.Name;
|
||||
// trilist.BooleanInput[(uint)(joinMap.ButtonVisibilityOffset + sceneIndex)].BoolValue = true;
|
||||
// sceneIndex++;
|
||||
// }
|
||||
|
||||
// if (lightingDevice.GetType().Name.ToString() == "LutronQuantumArea")
|
||||
// {
|
||||
// var lutronDevice = lightingDevice as PepperDash.Essentials.Devices.Common.Environment.Lutron.LutronQuantumArea;
|
||||
// lutronDevice.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
|
||||
// trilist.SetStringSigAction(joinMap.IntegrationIdSet, s => lutronDevice.IntegrationId = s);
|
||||
// }
|
||||
|
||||
// //ApiEisc.Eisc.SetStringSigAction(ApiMap.integrationID, (s) => { lutronLights.IntegrationId = s; });
|
||||
|
||||
|
||||
// /*
|
||||
// var lutronLights = lightingDevice as PepperDash.Essentials.Devices.Common.Environment.Lutron.LutronQuantumArea;
|
||||
|
||||
|
||||
// for (uint i = 1; i <= lightingBase.CircuitCount; i++)
|
||||
// {
|
||||
// var circuit = i;
|
||||
// lightingBase.CircuitNameFeedbacks[circuit - 1].LinkInputSig(trilist.StringInput[joinMap.CircuitNames + circuit]);
|
||||
// lightingBase.CircuitIsCritical[circuit - 1].LinkInputSig(trilist.BooleanInput[joinMap.CircuitIsCritical + circuit]);
|
||||
// lightingBase.CircuitState[circuit - 1].LinkInputSig(trilist.BooleanInput[joinMap.CircuitState + circuit]);
|
||||
// trilist.SetSigTrueAction(joinMap.CircuitCycle + circuit, () => lightingBase.CycleCircuit(circuit - 1));
|
||||
// trilist.SetSigTrueAction(joinMap.CircuitOnCmd + circuit, () => lightingBase.TurnOnCircuit(circuit - 1));
|
||||
// trilist.SetSigTrueAction(joinMap.CircuitOffCmd + circuit, () => lightingBase.TurnOffCircuit(circuit - 1));
|
||||
|
||||
// }
|
||||
// */
|
||||
// }
|
||||
// }
|
||||
// public class GenericLightingJoinMap : JoinMapBase
|
||||
// {
|
||||
// public uint IsOnline { get; set; }
|
||||
// public uint SelectScene { get; set; }
|
||||
// public uint LightingSceneOffset { get; set; }
|
||||
// public uint ButtonVisibilityOffset { get; set; }
|
||||
// public uint IntegrationIdSet { get; set; }
|
||||
|
||||
// public GenericLightingJoinMap()
|
||||
// {
|
||||
// // Digital
|
||||
// IsOnline = 1;
|
||||
// SelectScene = 1;
|
||||
// IntegrationIdSet = 1;
|
||||
// LightingSceneOffset = 10;
|
||||
// ButtonVisibilityOffset = 40;
|
||||
// // Analog
|
||||
// }
|
||||
|
||||
// public override void OffsetJoinNumbers(uint joinStart)
|
||||
// {
|
||||
// var joinOffset = joinStart - 1;
|
||||
|
||||
// IsOnline = IsOnline + joinOffset;
|
||||
// SelectScene = SelectScene + joinOffset;
|
||||
// LightingSceneOffset = LightingSceneOffset + joinOffset;
|
||||
// ButtonVisibilityOffset = ButtonVisibilityOffset + joinOffset;
|
||||
|
||||
|
||||
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,21 +5,24 @@ using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
|
||||
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.CrestronIO;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
public static class GenericRelayDeviceApiExtensions
|
||||
{
|
||||
public static void LinkToApi(this GenericRelayDevice relay, BasicTriList trilist, uint joinStart, string joinMapKey)
|
||||
{
|
||||
var joinMap = JoinMapHelper.GetJoinMapForDevice(joinMapKey) as GenericRelayControllerJoinMap;
|
||||
GenericRelayControllerJoinMap joinMap = new GenericRelayControllerJoinMap();
|
||||
|
||||
if (joinMap == null)
|
||||
joinMap = new GenericRelayControllerJoinMap();
|
||||
var joinMapSerialized = JoinMapHelper.GetJoinMapForDevice(joinMapKey);
|
||||
|
||||
if (!string.IsNullOrEmpty(joinMapSerialized))
|
||||
joinMap = JsonConvert.DeserializeObject<GenericRelayControllerJoinMap>(joinMapSerialized);
|
||||
|
||||
joinMap.OffsetJoinNumbers(joinStart);
|
||||
|
||||
@@ -45,22 +48,4 @@ namespace PepperDash.Essentials.Bridges
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public class GenericRelayControllerJoinMap : JoinMapBase
|
||||
{
|
||||
//Digital
|
||||
public uint Relay { get; set; }
|
||||
|
||||
public GenericRelayControllerJoinMap()
|
||||
{
|
||||
Relay = 1;
|
||||
}
|
||||
|
||||
public override void OffsetJoinNumbers(uint joinStart)
|
||||
{
|
||||
var joinOffset = joinStart - 1;
|
||||
|
||||
Relay = Relay + joinOffset;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
|
||||
using PepperDash.Essentials.Devices.Common.Occupancy;
|
||||
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Core;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
public static class GlsOccupancySensorBaseControllerApiExtensions
|
||||
{
|
||||
public static void LinkToApi(this GlsOccupancySensorBaseController occController, BasicTriList trilist, uint joinStart, string joinMapKey)
|
||||
{
|
||||
GlsOccupancySensorBaseJoinMap joinMap = new GlsOccupancySensorBaseJoinMap();
|
||||
|
||||
var joinMapSerialized = JoinMapHelper.GetJoinMapForDevice(joinMapKey);
|
||||
|
||||
if (!string.IsNullOrEmpty(joinMapSerialized))
|
||||
joinMap = JsonConvert.DeserializeObject<GlsOccupancySensorBaseJoinMap>(joinMapSerialized);
|
||||
|
||||
joinMap.OffsetJoinNumbers(joinStart);
|
||||
|
||||
Debug.Console(1, occController, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
||||
|
||||
#region Single and Dual Sensor Stuff
|
||||
occController.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
|
||||
|
||||
// Occupied status
|
||||
trilist.SetSigTrueAction(joinMap.ForceOccupied, new Action(() => occController.ForceOccupied()));
|
||||
trilist.SetSigTrueAction(joinMap.ForceVacant, new Action(() => occController.ForceVacant()));
|
||||
occController.RoomIsOccupiedFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RoomOccupiedFeedback]);
|
||||
occController.RoomIsOccupiedFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.RoomVacantFeedback]);
|
||||
occController.RawOccupancyFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RawOccupancyFeedback]);
|
||||
|
||||
// Timouts
|
||||
trilist.SetUShortSigAction(joinMap.Timeout, new Action<ushort>((u) => occController.SetRemoteTimeout(u)));
|
||||
occController.CurrentTimeoutFeedback.LinkInputSig(trilist.UShortInput[joinMap.Timeout]);
|
||||
occController.LocalTimoutFeedback.LinkInputSig(trilist.UShortInput[joinMap.TimeoutLocalFeedback]);
|
||||
|
||||
// LED Flash
|
||||
trilist.SetSigTrueAction(joinMap.EnableLedFlash, new Action(() => occController.SetLedFlashEnable(true)));
|
||||
trilist.SetSigTrueAction(joinMap.DisableLedFlash, new Action(() => occController.SetLedFlashEnable(false)));
|
||||
occController.LedFlashEnabledFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.EnableLedFlash]);
|
||||
|
||||
// Short Timeout
|
||||
trilist.SetSigTrueAction(joinMap.EnableShortTimeout, new Action(() => occController.SetShortTimeoutState(true)));
|
||||
trilist.SetSigTrueAction(joinMap.DisableShortTimeout, new Action(() => occController.SetShortTimeoutState(false)));
|
||||
occController.ShortTimeoutEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.EnableShortTimeout]);
|
||||
|
||||
// PIR Sensor
|
||||
trilist.SetSigTrueAction(joinMap.EnablePir, new Action(() => occController.SetPirEnable(true)));
|
||||
trilist.SetSigTrueAction(joinMap.DisablePir, new Action(() => occController.SetPirEnable(false)));
|
||||
occController.PirSensorEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.EnablePir]);
|
||||
|
||||
// PIR Sensitivity in Occupied State
|
||||
trilist.SetBoolSigAction(joinMap.IncrementPirInOccupiedState, new Action<bool>((b) => occController.IncrementPirSensitivityInOccupiedState(b)));
|
||||
trilist.SetBoolSigAction(joinMap.DecrementPirInOccupiedState, new Action<bool>((b) => occController.DecrementPirSensitivityInOccupiedState(b)));
|
||||
occController.PirSensitivityInOccupiedStateFeedback.LinkInputSig(trilist.UShortInput[joinMap.PirSensitivityInOccupiedState]);
|
||||
|
||||
// PIR Sensitivity in Vacant State
|
||||
trilist.SetBoolSigAction(joinMap.IncrementPirInVacantState, new Action<bool>((b) => occController.IncrementPirSensitivityInVacantState(b)));
|
||||
trilist.SetBoolSigAction(joinMap.DecrementPirInVacantState, new Action<bool>((b) => occController.DecrementPirSensitivityInVacantState(b)));
|
||||
occController.PirSensitivityInVacantStateFeedback.LinkInputSig(trilist.UShortInput[joinMap.PirSensitivityInVacantState]);
|
||||
#endregion
|
||||
|
||||
#region Dual Technology Sensor Stuff
|
||||
var odtOccController = occController as GlsOdtOccupancySensorController;
|
||||
|
||||
if (odtOccController != null)
|
||||
{
|
||||
// OR When Vacated
|
||||
trilist.SetBoolSigAction(joinMap.OrWhenVacated, new Action<bool>((b) => odtOccController.SetOrWhenVacatedState(b)));
|
||||
odtOccController.OrWhenVacatedFeedback.LinkInputSig(trilist.BooleanInput[joinMap.OrWhenVacated]);
|
||||
|
||||
// AND When Vacated
|
||||
trilist.SetBoolSigAction(joinMap.AndWhenVacated, new Action<bool>((b) => odtOccController.SetAndWhenVacatedState(b)));
|
||||
odtOccController.AndWhenVacatedFeedback.LinkInputSig(trilist.BooleanInput[joinMap.AndWhenVacated]);
|
||||
|
||||
// Ultrasonic A Sensor
|
||||
trilist.SetSigTrueAction(joinMap.EnableUsA, new Action(() => odtOccController.SetUsAEnable(true)));
|
||||
trilist.SetSigTrueAction(joinMap.DisableUsA, new Action(() => odtOccController.SetUsAEnable(false)));
|
||||
odtOccController.UltrasonicAEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.EnableUsA]);
|
||||
|
||||
// Ultrasonic B Sensor
|
||||
trilist.SetSigTrueAction(joinMap.EnableUsB, new Action(() => odtOccController.SetUsBEnable(true)));
|
||||
trilist.SetSigTrueAction(joinMap.DisableUsB, new Action(() => odtOccController.SetUsBEnable(false)));
|
||||
odtOccController.UltrasonicAEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.EnableUsB]);
|
||||
|
||||
// US Sensitivity in Occupied State
|
||||
trilist.SetBoolSigAction(joinMap.IncrementUsInOccupiedState, new Action<bool>((b) => odtOccController.IncrementUsSensitivityInOccupiedState(b)));
|
||||
trilist.SetBoolSigAction(joinMap.DecrementUsInOccupiedState, new Action<bool>((b) => odtOccController.DecrementUsSensitivityInOccupiedState(b)));
|
||||
odtOccController.UltrasonicSensitivityInOccupiedStateFeedback.LinkInputSig(trilist.UShortInput[joinMap.UsSensitivityInOccupiedState]);
|
||||
|
||||
// US Sensitivity in Vacant State
|
||||
trilist.SetBoolSigAction(joinMap.IncrementUsInVacantState, new Action<bool>((b) => odtOccController.IncrementUsSensitivityInVacantState(b)));
|
||||
trilist.SetBoolSigAction(joinMap.DecrementUsInVacantState, new Action<bool>((b) => odtOccController.DecrementUsSensitivityInVacantState(b)));
|
||||
odtOccController.UltrasonicSensitivityInVacantStateFeedback.LinkInputSig(trilist.UShortInput[joinMap.UsSensitivityInVacantState]);
|
||||
|
||||
//Sensor Raw States
|
||||
odtOccController.RawOccupancyPirFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RawOccupancyPirFeedback]);
|
||||
odtOccController.RawOccupancyUsFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RawOccupancyUsFeedback]);
|
||||
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
||||
66
PepperDashEssentials/Bridges/HdMdxxxCEControllerBridge.cs
Normal file
66
PepperDashEssentials/Bridges/HdMdxxxCEControllerBridge.cs
Normal file
@@ -0,0 +1,66 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
using Crestron.SimplSharpPro.DM;
|
||||
using Crestron.SimplSharpPro.DM.Endpoints;
|
||||
using Crestron.SimplSharpPro.DM.Endpoints.Receivers;
|
||||
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.DM;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
public static class HdMdxxxCEControllerApiExtensions
|
||||
{
|
||||
public static void LinkToApi(this HdMdxxxCEController hdMdPair, BasicTriList trilist, uint joinStart, string joinMapKey)
|
||||
{
|
||||
HdMdxxxCEControllerJoinMap joinMap = new HdMdxxxCEControllerJoinMap();
|
||||
|
||||
var joinMapSerialized = JoinMapHelper.GetJoinMapForDevice(joinMapKey);
|
||||
|
||||
if (!string.IsNullOrEmpty(joinMapSerialized))
|
||||
joinMap = JsonConvert.DeserializeObject<HdMdxxxCEControllerJoinMap>(joinMapSerialized);
|
||||
|
||||
joinMap.OffsetJoinNumbers(joinStart);
|
||||
|
||||
Debug.Console(1, hdMdPair, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
||||
|
||||
hdMdPair.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
|
||||
hdMdPair.RemoteEndDetectedFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RemoteEndDetected]);
|
||||
|
||||
trilist.SetSigTrueAction(joinMap.AutoRouteOn, new Action(() => hdMdPair.AutoRouteOn()));
|
||||
hdMdPair.AutoRouteOnFeedback.LinkInputSig(trilist.BooleanInput[joinMap.AutoRouteOn]);
|
||||
trilist.SetSigTrueAction(joinMap.AutoRouteOff, new Action(() => hdMdPair.AutoRouteOff()));
|
||||
hdMdPair.AutoRouteOnFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.AutoRouteOff]);
|
||||
|
||||
trilist.SetSigTrueAction(joinMap.PriorityRoutingOn, new Action(() => hdMdPair.PriorityRouteOn()));
|
||||
hdMdPair.PriorityRoutingOnFeedback.LinkInputSig(trilist.BooleanInput[joinMap.PriorityRoutingOn]);
|
||||
trilist.SetSigTrueAction(joinMap.PriorityRoutingOff, new Action(() => hdMdPair.PriorityRouteOff()));
|
||||
hdMdPair.PriorityRoutingOnFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.PriorityRoutingOff]);
|
||||
|
||||
trilist.SetSigTrueAction(joinMap.InputOnScreenDisplayEnabled, new Action(() => hdMdPair.OnScreenDisplayEnable()));
|
||||
hdMdPair.InputOnScreenDisplayEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.InputOnScreenDisplayEnabled]);
|
||||
trilist.SetSigTrueAction(joinMap.AutoRouteOff, new Action(() => hdMdPair.OnScreenDisplayDisable()));
|
||||
hdMdPair.InputOnScreenDisplayEnabledFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.InputOnScreenDisplayDisabled]);
|
||||
|
||||
trilist.SetUShortSigAction(joinMap.VideoSource, new Action<ushort>((i) => hdMdPair.ExecuteSwitch(i, null, eRoutingSignalType.Video | eRoutingSignalType.Audio)));
|
||||
hdMdPair.VideoSourceFeedback.LinkInputSig(trilist.UShortInput[joinMap.VideoSource]);
|
||||
|
||||
trilist.UShortInput[joinMap.SourceCount].UShortValue = (ushort)hdMdPair.InputPorts.Count;
|
||||
|
||||
foreach (var input in hdMdPair.InputPorts)
|
||||
{
|
||||
var number = Convert.ToUInt16(input.Selector);
|
||||
hdMdPair.SyncDetectedFeedbacks[number].LinkInputSig(trilist.BooleanInput[joinMap.SyncDetected + number]);
|
||||
trilist.StringInput[joinMap.SourceNames + number].StringValue = input.Key;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,17 +8,20 @@ using Crestron.SimplSharpPro.DeviceSupport;
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
public static class IBasicCommunicationApiExtensions
|
||||
{
|
||||
public static void LinkToApi(this GenericComm comm, BasicTriList trilist, uint joinStart, string joinMapKey)
|
||||
{
|
||||
var joinMap = JoinMapHelper.GetJoinMapForDevice(joinMapKey) as IBasicCommunicationJoinMap;
|
||||
IBasicCommunicationJoinMap joinMap = new IBasicCommunicationJoinMap();
|
||||
|
||||
if (joinMap == null)
|
||||
joinMap = new IBasicCommunicationJoinMap();
|
||||
var joinMapSerialized = JoinMapHelper.GetJoinMapForDevice(joinMapKey);
|
||||
|
||||
if (!string.IsNullOrEmpty(joinMapSerialized))
|
||||
joinMap = JsonConvert.DeserializeObject<IBasicCommunicationJoinMap>(joinMapSerialized);
|
||||
joinMap.OffsetJoinNumbers(joinStart);
|
||||
|
||||
if (comm.CommPort == null)
|
||||
@@ -30,14 +33,14 @@ namespace PepperDash.Essentials.Bridges
|
||||
Debug.Console(1, comm, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
||||
|
||||
// this is a permanent event handler. This cannot be -= from event
|
||||
comm.CommPort.TextReceived += (s, a) =>
|
||||
{
|
||||
Debug.Console(2, comm, "RX: {0}", a.Text);
|
||||
trilist.SetString(joinMap.TextReceived, a.Text);
|
||||
};
|
||||
comm.CommPort.TextReceived += (s, a) =>
|
||||
{
|
||||
Debug.Console(2, comm, "RX: {0}", a.Text);
|
||||
trilist.SetString(joinMap.TextReceived, a.Text);
|
||||
};
|
||||
trilist.SetStringSigAction(joinMap.SendText, new Action<string>(s => comm.CommPort.SendText(s)));
|
||||
trilist.SetStringSigAction(joinMap.SetPortConfig + 1, new Action<string>(s => comm.SetPortConfig(s)));
|
||||
|
||||
trilist.SetStringSigAction(joinMap.SetPortConfig, new Action<string>(s => comm.SetPortConfig(s)));
|
||||
|
||||
|
||||
var sComm = comm.CommPort as ISocketStatus;
|
||||
if (sComm != null)
|
||||
@@ -62,46 +65,5 @@ namespace PepperDash.Essentials.Bridges
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public class IBasicCommunicationJoinMap : JoinMapBase
|
||||
{
|
||||
//Digital
|
||||
public uint Connect { get; set; }
|
||||
public uint Connected { get; set; }
|
||||
|
||||
//Analog
|
||||
public uint Status { get; set; }
|
||||
|
||||
// Serial
|
||||
public uint TextReceived { get; set; }
|
||||
public uint SendText { get; set; }
|
||||
public uint SetPortConfig { get; set; }
|
||||
|
||||
|
||||
public IBasicCommunicationJoinMap()
|
||||
{
|
||||
TextReceived = 1;
|
||||
SendText = 1;
|
||||
SetPortConfig = 2;
|
||||
Connect = 1;
|
||||
Connected = 1;
|
||||
Status = 1;
|
||||
}
|
||||
|
||||
public override void OffsetJoinNumbers(uint joinStart)
|
||||
{
|
||||
var joinOffset = joinStart - 1;
|
||||
|
||||
TextReceived = TextReceived + joinOffset;
|
||||
SendText = SendText + joinOffset;
|
||||
SetPortConfig = SetPortConfig + joinOffset;
|
||||
Connect = Connect + joinOffset;
|
||||
Connected = Connected + joinOffset;
|
||||
Status = Status + joinOffset;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
14
PepperDashEssentials/Bridges/IBridge.cs
Normal file
14
PepperDashEssentials/Bridges/IBridge.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
public interface IBridge
|
||||
{
|
||||
void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey);
|
||||
}
|
||||
}
|
||||
@@ -6,18 +6,23 @@ using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.CrestronIO;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
public static class IDigitalInputApiExtenstions
|
||||
{
|
||||
public static void LinkToApi(this IDigitalInput input, BasicTriList trilist, uint joinStart, string joinMapKey)
|
||||
{
|
||||
var joinMap = JoinMapHelper.GetJoinMapForDevice(joinMapKey) as IDigitalInputApiJoinMap;
|
||||
IDigitalInputJoinMap joinMap = new IDigitalInputJoinMap();
|
||||
|
||||
if (joinMap == null)
|
||||
joinMap = new IDigitalInputApiJoinMap();
|
||||
var joinMapSerialized = JoinMapHelper.GetJoinMapForDevice(joinMapKey);
|
||||
|
||||
if (!string.IsNullOrEmpty(joinMapSerialized))
|
||||
joinMap = JsonConvert.DeserializeObject<IDigitalInputJoinMap>(joinMapSerialized);
|
||||
|
||||
joinMap.OffsetJoinNumbers(joinStart);
|
||||
|
||||
@@ -35,25 +40,5 @@ namespace PepperDash.Essentials.Bridges
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public class IDigitalInputApiJoinMap : JoinMapBase
|
||||
{
|
||||
//Digital
|
||||
public uint InputState { get; set; }
|
||||
|
||||
public IDigitalInputApiJoinMap()
|
||||
{
|
||||
InputState = 1;
|
||||
}
|
||||
|
||||
public override void OffsetJoinNumbers(uint joinStart)
|
||||
{
|
||||
var joinOffset = joinStart - 1;
|
||||
|
||||
InputState = InputState + joinOffset;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using PepperDash.Essentials.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
public class AirMediaControllerJoinMap : JoinMapBase
|
||||
{
|
||||
#region Digitals
|
||||
/// <summary>
|
||||
/// Indicates that the device is online when high
|
||||
/// </summary>
|
||||
public uint IsOnline { get; set; }
|
||||
/// <summary>
|
||||
/// Indicates that the device is in session when high
|
||||
/// </summary>
|
||||
public uint IsInSession { get; set; }
|
||||
/// <summary>
|
||||
/// Indicates sync detected on HDMI input when high
|
||||
/// </summary>
|
||||
public uint HdmiVideoSync { get; set; }
|
||||
/// <summary>
|
||||
/// Set High to enable automatic input routing and low to disable. Feedback high when enabled
|
||||
/// </summary>
|
||||
public uint AutomaticInputRoutingEnabled { get; set; }
|
||||
#endregion
|
||||
|
||||
#region Analogs
|
||||
/// <summary>
|
||||
/// Selects source and provides feedback
|
||||
/// </summary>
|
||||
public uint VideoOut { get; set; }
|
||||
/// <summary>
|
||||
/// Provided error feedback
|
||||
/// </summary>
|
||||
public uint ErrorFB { get; set; }
|
||||
/// <summary>
|
||||
/// Indicates the number of connected users as feedback
|
||||
/// </summary>
|
||||
public uint NumberOfUsersConnectedFB { get; set; }
|
||||
/// <summary>
|
||||
/// Sets the login code and provides the current code as feedback
|
||||
/// </summary>
|
||||
public uint LoginCode { get; set; }
|
||||
#endregion
|
||||
|
||||
#region Serials
|
||||
/// <summary>
|
||||
/// Provides the name defined in config as feedback
|
||||
/// </summary>
|
||||
public uint Name { get; set; }
|
||||
/// <summary>
|
||||
/// Provides the connection address as feedback
|
||||
/// </summary>
|
||||
public uint ConnectionAddressFB { get; set; }
|
||||
/// <summary>
|
||||
/// Provides the hostname as feedback
|
||||
/// </summary>
|
||||
public uint HostnameFB { get; set; }
|
||||
/// <summary>
|
||||
/// Provides the serial number as feedback
|
||||
/// </summary>
|
||||
public uint SerialNumberFeedback { get; set; }
|
||||
#endregion
|
||||
|
||||
public AirMediaControllerJoinMap()
|
||||
{
|
||||
// Digital
|
||||
IsOnline = 1;
|
||||
IsInSession = 2;
|
||||
HdmiVideoSync = 3;
|
||||
AutomaticInputRoutingEnabled = 4;
|
||||
|
||||
// Analog
|
||||
VideoOut = 1;
|
||||
ErrorFB = 2;
|
||||
NumberOfUsersConnectedFB = 3;
|
||||
LoginCode = 4;
|
||||
|
||||
// Serial
|
||||
Name = 1;
|
||||
ConnectionAddressFB = 2;
|
||||
HostnameFB = 3;
|
||||
SerialNumberFeedback = 4;
|
||||
}
|
||||
|
||||
public override void OffsetJoinNumbers(uint joinStart)
|
||||
{
|
||||
var joinOffset = joinStart - 1;
|
||||
|
||||
IsOnline = IsOnline + joinOffset;
|
||||
IsInSession = IsInSession + joinOffset;
|
||||
HdmiVideoSync = HdmiVideoSync + joinOffset;
|
||||
AutomaticInputRoutingEnabled = AutomaticInputRoutingEnabled + joinOffset;
|
||||
|
||||
VideoOut = VideoOut + joinOffset;
|
||||
ErrorFB = ErrorFB + joinOffset;
|
||||
NumberOfUsersConnectedFB = NumberOfUsersConnectedFB + joinOffset;
|
||||
LoginCode = LoginCode + joinOffset;
|
||||
|
||||
Name = Name + joinOffset;
|
||||
ConnectionAddressFB = ConnectionAddressFB + joinOffset;
|
||||
HostnameFB = HostnameFB + joinOffset;
|
||||
SerialNumberFeedback = SerialNumberFeedback + joinOffset;
|
||||
}
|
||||
}
|
||||
}
|
||||
67
PepperDashEssentials/Bridges/JoinMaps/AppleTvJoinMap.cs
Normal file
67
PepperDashEssentials/Bridges/JoinMaps/AppleTvJoinMap.cs
Normal file
@@ -0,0 +1,67 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using PepperDash.Essentials.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
public class AppleTvJoinMap : JoinMapBase
|
||||
{
|
||||
#region Digitals
|
||||
/// <summary>
|
||||
/// Sends up arrow command while high
|
||||
/// </summary>
|
||||
public uint UpArrow { get; set; }
|
||||
/// <summary>
|
||||
/// Sends down arrow command while high
|
||||
/// </summary>
|
||||
public uint DnArrow { get; set; }
|
||||
/// <summary>
|
||||
/// Sends left arrow command while high
|
||||
/// </summary>
|
||||
public uint LeftArrow { get; set; }
|
||||
/// <summary>
|
||||
/// Sends right arrow command while high
|
||||
/// </summary>
|
||||
public uint RightArrow { get; set; }
|
||||
/// <summary>
|
||||
/// Sends menu command
|
||||
/// </summary>
|
||||
public uint Menu { get; set; }
|
||||
/// <summary>
|
||||
/// Sends select command
|
||||
/// </summary>
|
||||
public uint Select { get; set; }
|
||||
/// <summary>
|
||||
/// Sends play/pause command
|
||||
/// </summary>
|
||||
public uint PlayPause { get; set; }
|
||||
#endregion
|
||||
|
||||
public AppleTvJoinMap()
|
||||
{
|
||||
UpArrow = 1;
|
||||
DnArrow = 2;
|
||||
LeftArrow = 3;
|
||||
RightArrow = 4;
|
||||
Menu = 5;
|
||||
Select = 6;
|
||||
PlayPause = 7;
|
||||
}
|
||||
|
||||
public override void OffsetJoinNumbers(uint joinStart)
|
||||
{
|
||||
var joinOffset = joinStart - 1;
|
||||
|
||||
UpArrow = UpArrow + joinOffset;
|
||||
DnArrow = DnArrow + joinOffset;
|
||||
LeftArrow = LeftArrow + joinOffset;
|
||||
RightArrow = RightArrow + joinOffset;
|
||||
Menu = Menu + joinOffset;
|
||||
Select = Select + joinOffset;
|
||||
PlayPause = PlayPause + joinOffset;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
using System.Linq;
|
||||
using Crestron.SimplSharp.Reflection;
|
||||
using PepperDash.Essentials.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
public class C2nRthsControllerJoinMap:JoinMapBase
|
||||
{
|
||||
public uint IsOnline { get; set; }
|
||||
public uint Name { get; set; }
|
||||
public uint Temperature { get; set; }
|
||||
public uint Humidity { get; set; }
|
||||
public uint TemperatureFormat { get; set; }
|
||||
|
||||
public C2nRthsControllerJoinMap()
|
||||
{
|
||||
//digital
|
||||
IsOnline = 1;
|
||||
TemperatureFormat = 2;
|
||||
|
||||
//Analog
|
||||
Temperature = 2;
|
||||
Humidity = 3;
|
||||
|
||||
//serial
|
||||
Name = 1;
|
||||
|
||||
|
||||
}
|
||||
|
||||
public override void OffsetJoinNumbers(uint joinStart)
|
||||
{
|
||||
var joinOffset = joinStart - 1;
|
||||
var properties =
|
||||
GetType().GetCType().GetProperties().Where(p => p.PropertyType == typeof(uint)).ToList();
|
||||
|
||||
foreach (var propertyInfo in properties)
|
||||
{
|
||||
propertyInfo.SetValue(this, (uint)propertyInfo.GetValue(this, null) + joinOffset, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
|
||||
using PepperDash.Essentials.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
public class CameraControllerJoinMap : JoinMapBase
|
||||
{
|
||||
public uint IsOnline { get; set; }
|
||||
public uint PowerOff { get; set; }
|
||||
public uint PowerOn { get; set; }
|
||||
public uint Up { get; set; }
|
||||
public uint Down { get; set; }
|
||||
public uint Left { get; set; }
|
||||
public uint Right { get; set; }
|
||||
public uint ZoomIn { get; set; }
|
||||
public uint ZoomOut { get; set; }
|
||||
public uint PresetRecallOffset { get; set; }
|
||||
public uint PresetSaveOffset { get; set; }
|
||||
public uint NumberOfPresets { get; set; }
|
||||
|
||||
public CameraControllerJoinMap()
|
||||
{
|
||||
// Digital
|
||||
IsOnline = 9;
|
||||
PowerOff = 8;
|
||||
PowerOn = 7;
|
||||
Up = 1;
|
||||
Down = 2;
|
||||
Left = 3;
|
||||
Right = 4;
|
||||
ZoomIn = 5;
|
||||
ZoomOut = 6;
|
||||
PresetRecallOffset = 10;
|
||||
PresetSaveOffset = 30;
|
||||
NumberOfPresets = 5;
|
||||
// Analog
|
||||
}
|
||||
|
||||
public override void OffsetJoinNumbers(uint joinStart)
|
||||
{
|
||||
var joinOffset = joinStart - 1;
|
||||
|
||||
IsOnline = IsOnline + joinOffset;
|
||||
PowerOff = PowerOff + joinOffset;
|
||||
PowerOn = PowerOn + joinOffset;
|
||||
Up = Up + joinOffset;
|
||||
Down = Down + joinOffset;
|
||||
Left = Left + joinOffset;
|
||||
Right = Right + joinOffset;
|
||||
ZoomIn = ZoomIn + joinOffset;
|
||||
ZoomOut = ZoomOut + joinOffset;
|
||||
PresetRecallOffset = PresetRecallOffset + joinOffset;
|
||||
PresetSaveOffset = PresetSaveOffset + joinOffset;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
|
||||
using PepperDash.Essentials.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
public class DigitalLoggerJoinMap : JoinMapBase
|
||||
{
|
||||
public uint IsOnline { get; set; }
|
||||
public uint CircuitNames { get; set; }
|
||||
public uint CircuitState { get; set; }
|
||||
public uint CircuitCycle { get; set; }
|
||||
public uint CircuitIsCritical { get; set; }
|
||||
public uint CircuitOnCmd { get; set; }
|
||||
public uint CircuitOffCmd { get; set; }
|
||||
|
||||
public DigitalLoggerJoinMap()
|
||||
{
|
||||
// Digital
|
||||
IsOnline = 9;
|
||||
CircuitState = 0;
|
||||
CircuitCycle = 0;
|
||||
CircuitIsCritical = 10;
|
||||
CircuitOnCmd = 10;
|
||||
CircuitOffCmd = 20;
|
||||
// Serial
|
||||
CircuitNames = 0;
|
||||
// Analog
|
||||
}
|
||||
|
||||
public override void OffsetJoinNumbers(uint joinStart)
|
||||
{
|
||||
var joinOffset = joinStart - 1;
|
||||
|
||||
IsOnline = IsOnline + joinOffset;
|
||||
CircuitNames = CircuitNames + joinOffset;
|
||||
CircuitState = CircuitState + joinOffset;
|
||||
CircuitCycle = CircuitCycle + joinOffset;
|
||||
CircuitIsCritical = CircuitIsCritical + joinOffset;
|
||||
CircuitOnCmd = CircuitOnCmd + joinOffset;
|
||||
CircuitOffCmd = CircuitOffCmd + joinOffset;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using PepperDash.Essentials.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
public class DisplayControllerJoinMap : JoinMapBase
|
||||
{
|
||||
#region Digitals
|
||||
/// <summary>
|
||||
/// Turns the display off and reports power off feedback
|
||||
/// </summary>
|
||||
public uint PowerOff { get; set; }
|
||||
/// <summary>
|
||||
/// Turns the display on and repots power on feedback
|
||||
/// </summary>
|
||||
public uint PowerOn { get; set; }
|
||||
/// <summary>
|
||||
/// Indicates that the display device supports two way communication when high
|
||||
/// </summary>
|
||||
public uint IsTwoWayDisplay { get; set; }
|
||||
/// <summary>
|
||||
/// Increments the volume while high
|
||||
/// </summary>
|
||||
public uint VolumeUp { get; set; }
|
||||
/// <summary>
|
||||
/// Decrements teh volume while high
|
||||
/// </summary>
|
||||
public uint VolumeDown { get; set; }
|
||||
/// <summary>
|
||||
/// Toggles the mute state. Feedback is high when volume is muted
|
||||
/// </summary>
|
||||
public uint VolumeMute { get; set; }
|
||||
/// <summary>
|
||||
/// Range of digital joins to select inputs and report current input as feedback
|
||||
/// </summary>
|
||||
public uint InputSelectOffset { get; set; }
|
||||
/// <summary>
|
||||
/// Range of digital joins to report visibility for input buttons
|
||||
/// </summary>
|
||||
public uint ButtonVisibilityOffset { get; set; }
|
||||
/// <summary>
|
||||
/// High if the device is online
|
||||
/// </summary>
|
||||
public uint IsOnline { get; set; }
|
||||
#endregion
|
||||
|
||||
#region Analogs
|
||||
/// <summary>
|
||||
/// Analog join to set the input and report current input as feedback
|
||||
/// </summary>
|
||||
public uint InputSelect { get; set; }
|
||||
/// <summary>
|
||||
/// Sets the volume level and reports the current level as feedback
|
||||
/// </summary>
|
||||
public uint VolumeLevel { get; set; }
|
||||
#endregion
|
||||
|
||||
#region Serials
|
||||
/// <summary>
|
||||
/// Reports the name of the display as defined in config as feedback
|
||||
/// </summary>
|
||||
public uint Name { get; set; }
|
||||
/// <summary>
|
||||
/// Range of serial joins that reports the names of the inputs as feedback
|
||||
/// </summary>
|
||||
public uint InputNamesOffset { get; set; }
|
||||
#endregion
|
||||
|
||||
public DisplayControllerJoinMap()
|
||||
{
|
||||
// Digital
|
||||
IsOnline = 50;
|
||||
PowerOff = 1;
|
||||
PowerOn = 2;
|
||||
IsTwoWayDisplay = 3;
|
||||
VolumeUp = 5;
|
||||
VolumeDown = 6;
|
||||
VolumeMute = 7;
|
||||
|
||||
ButtonVisibilityOffset = 40;
|
||||
InputSelectOffset = 10;
|
||||
|
||||
// Analog
|
||||
InputSelect = 11;
|
||||
VolumeLevel = 5;
|
||||
|
||||
// Serial
|
||||
Name = 1;
|
||||
InputNamesOffset = 10;
|
||||
}
|
||||
|
||||
public override void OffsetJoinNumbers(uint joinStart)
|
||||
{
|
||||
var joinOffset = joinStart - 1;
|
||||
|
||||
IsOnline = IsOnline + joinOffset;
|
||||
PowerOff = PowerOff + joinOffset;
|
||||
PowerOn = PowerOn + joinOffset;
|
||||
IsTwoWayDisplay = IsTwoWayDisplay + joinOffset;
|
||||
ButtonVisibilityOffset = ButtonVisibilityOffset + joinOffset;
|
||||
Name = Name + joinOffset;
|
||||
InputNamesOffset = InputNamesOffset + joinOffset;
|
||||
InputSelectOffset = InputSelectOffset + joinOffset;
|
||||
|
||||
InputSelect = InputSelect + joinOffset;
|
||||
|
||||
VolumeUp = VolumeUp + joinOffset;
|
||||
VolumeDown = VolumeDown + joinOffset;
|
||||
VolumeMute = VolumeMute + joinOffset;
|
||||
VolumeLevel = VolumeLevel + joinOffset;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using PepperDash.Essentials.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges {
|
||||
public class DmBladeChassisControllerJoinMap : JoinMapBase {
|
||||
#region Digital/Analogs
|
||||
#endregion
|
||||
|
||||
#region Digitals
|
||||
/// <summary>
|
||||
/// High when device is online
|
||||
/// </summary>
|
||||
public uint IsOnline { get; set; }
|
||||
/// <summary>
|
||||
/// Range reports video sync feedback for each input
|
||||
/// </summary>
|
||||
public uint VideoSyncStatus { get; set; }
|
||||
/// <summary>
|
||||
/// Range reports high if corresponding input's endpoint is online
|
||||
/// </summary>
|
||||
public uint InputEndpointOnline { get; set; }
|
||||
/// <summary>
|
||||
/// Range reports high if corresponding output's endpoint is online
|
||||
/// </summary>
|
||||
public uint OutputEndpointOnline { get; set; }
|
||||
/// <summary>
|
||||
/// Range reports high if corresponding input's transmitter supports bridging as a separate device for detailed AV switching, HDCP control, etc.
|
||||
/// </summary>
|
||||
public uint TxAdvancedIsPresent { get; set; } // indicates that there is an attached transmitter that should be bridged to be interacted with
|
||||
#endregion
|
||||
|
||||
#region Analogs
|
||||
/// <summary>
|
||||
/// Range sets and reports the current video source for the corresponding output
|
||||
/// </summary>
|
||||
public uint OutputVideo { get; set; }
|
||||
/// <summary>
|
||||
/// Range sets and reports the current HDCP state for the corresponding input card
|
||||
/// </summary>
|
||||
public uint HdcpSupportState { get; set; }
|
||||
/// <summary>
|
||||
/// Range reports the highest supported HDCP state level for the corresponding input card
|
||||
/// </summary>
|
||||
public uint HdcpSupportCapability { get; set; }
|
||||
#endregion
|
||||
|
||||
#region Serials
|
||||
/// <summary>
|
||||
/// Range sets and reports the name for the corresponding input card
|
||||
/// </summary>
|
||||
public uint InputNames { get; set; }
|
||||
/// <summary>
|
||||
/// Range sets and reports the name for the corresponding output card
|
||||
/// </summary>
|
||||
public uint OutputNames { get; set; }
|
||||
/// <summary>
|
||||
/// Range reports the name of the current video source for the corresponding output card
|
||||
/// </summary>
|
||||
public uint OutputCurrentVideoInputNames { get; set; }
|
||||
/// <summary>
|
||||
/// Range reports the current input resolution for each corresponding input card
|
||||
/// </summary>
|
||||
public uint InputCurrentResolution { get; set; }
|
||||
#endregion
|
||||
|
||||
public DmBladeChassisControllerJoinMap() {
|
||||
//Digital/Analog
|
||||
|
||||
//Digital
|
||||
IsOnline = 11;
|
||||
VideoSyncStatus = 100; //101-299
|
||||
InputEndpointOnline = 500; //501-699
|
||||
OutputEndpointOnline = 700; //701-899
|
||||
TxAdvancedIsPresent = 1000; //1001-1199
|
||||
|
||||
//Analog
|
||||
OutputVideo = 100; //101-299
|
||||
HdcpSupportState = 1000; //1001-1199
|
||||
HdcpSupportCapability = 1200; //1201-1399
|
||||
|
||||
|
||||
//Serial
|
||||
InputNames = 100; //101-299
|
||||
OutputNames = 300; //301-499
|
||||
OutputCurrentVideoInputNames = 2000; //2001-2199
|
||||
InputCurrentResolution = 2400; // 2401-2599
|
||||
}
|
||||
|
||||
public override void OffsetJoinNumbers(uint joinStart) {
|
||||
var joinOffset = joinStart - 1;
|
||||
|
||||
IsOnline = IsOnline + joinOffset;
|
||||
OutputVideo = OutputVideo + joinOffset;
|
||||
VideoSyncStatus = VideoSyncStatus + joinOffset;
|
||||
InputNames = InputNames + joinOffset;
|
||||
OutputNames = OutputNames + joinOffset;
|
||||
OutputCurrentVideoInputNames = OutputCurrentVideoInputNames + joinOffset;
|
||||
InputCurrentResolution = InputCurrentResolution + joinOffset;
|
||||
InputEndpointOnline = InputEndpointOnline + joinOffset;
|
||||
OutputEndpointOnline = OutputEndpointOnline + joinOffset;
|
||||
HdcpSupportState = HdcpSupportState + joinOffset;
|
||||
HdcpSupportCapability = HdcpSupportCapability + joinOffset;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,144 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using PepperDash.Essentials.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
public class DmChassisControllerJoinMap : JoinMapBase
|
||||
{
|
||||
#region Digital/Analogs
|
||||
/// <summary>
|
||||
/// Analog input sets System ID, output reports current ID as feedback.
|
||||
/// Digital input applies System ID, output is high when applying busy.
|
||||
/// </summary>
|
||||
public uint SystemId { get; set; }
|
||||
#endregion
|
||||
|
||||
#region Digitals
|
||||
/// <summary>
|
||||
/// High when device is online
|
||||
/// </summary>
|
||||
public uint IsOnline { get; set; }
|
||||
/// <summary>
|
||||
/// Range reports video sync feedback for each input
|
||||
/// </summary>
|
||||
public uint VideoSyncStatus { get; set; }
|
||||
/// <summary>
|
||||
/// Range reports high if corresponding input's endpoint is online
|
||||
/// </summary>
|
||||
public uint InputEndpointOnline { get; set; }
|
||||
/// <summary>
|
||||
/// Range reports high if corresponding output's endpoint is online
|
||||
/// </summary>
|
||||
public uint OutputEndpointOnline { get; set; }
|
||||
/// <summary>
|
||||
/// Range reports high if corresponding input's transmitter supports bridging as a separate device for detailed AV switching, HDCP control, etc.
|
||||
/// </summary>
|
||||
public uint TxAdvancedIsPresent { get; set; } // indicates that there is an attached transmitter that should be bridged to be interacted with
|
||||
#endregion
|
||||
|
||||
#region Analogs
|
||||
/// <summary>
|
||||
/// Range sets and reports the current video source for the corresponding output
|
||||
/// </summary>
|
||||
public uint OutputVideo { get; set; }
|
||||
/// <summary>
|
||||
/// Range sets and reports the current audio source for the corresponding output
|
||||
/// </summary>
|
||||
public uint OutputAudio { get; set; }
|
||||
/// <summary>
|
||||
/// Range sets and reports the current Usb source for the corresponding output
|
||||
/// </summary>
|
||||
public uint OutputUsb { get; set; }
|
||||
/// <summary>
|
||||
/// Range sets and reports the current Usb source for the corresponding input
|
||||
/// </summary>
|
||||
public uint InputUsb { get; set; }
|
||||
/// <summary>
|
||||
/// Range sets and reports the current HDCP state for the corresponding input card
|
||||
/// </summary>
|
||||
public uint HdcpSupportState { get; set; }
|
||||
/// <summary>
|
||||
/// Range reports the highest supported HDCP state level for the corresponding input card
|
||||
/// </summary>
|
||||
public uint HdcpSupportCapability { get; set; }
|
||||
#endregion
|
||||
|
||||
#region Serials
|
||||
/// <summary>
|
||||
/// Range sets and reports the name for the corresponding input card
|
||||
/// </summary>
|
||||
public uint InputNames { get; set; }
|
||||
/// <summary>
|
||||
/// Range sets and reports the name for the corresponding output card
|
||||
/// </summary>
|
||||
public uint OutputNames { get; set; }
|
||||
/// <summary>
|
||||
/// Range reports the name of the current video source for the corresponding output card
|
||||
/// </summary>
|
||||
public uint OutputCurrentVideoInputNames { get; set; }
|
||||
/// <summary>
|
||||
/// Range reports the name of the current audio source for the corresponding output card
|
||||
/// </summary>
|
||||
public uint OutputCurrentAudioInputNames { get; set; }
|
||||
/// <summary>
|
||||
/// Range reports the current input resolution for each corresponding input card
|
||||
/// </summary>
|
||||
public uint InputCurrentResolution { get; set; }
|
||||
#endregion
|
||||
|
||||
public DmChassisControllerJoinMap()
|
||||
{
|
||||
//Digital/Analog
|
||||
SystemId = 10; // Analog sets/gets SystemId, digital input applies and provides feedback of ID change busy
|
||||
|
||||
//Digital
|
||||
IsOnline = 11;
|
||||
VideoSyncStatus = 100; //101-299
|
||||
InputEndpointOnline = 500; //501-699
|
||||
OutputEndpointOnline = 700; //701-899
|
||||
TxAdvancedIsPresent = 1000; //1001-1199
|
||||
|
||||
//Analog
|
||||
OutputVideo = 100; //101-299
|
||||
OutputAudio = 300; //301-499
|
||||
OutputUsb = 500; //501-699
|
||||
InputUsb = 700; //701-899
|
||||
HdcpSupportState = 1000; //1001-1199
|
||||
HdcpSupportCapability = 1200; //1201-1399
|
||||
|
||||
|
||||
//Serial
|
||||
InputNames = 100; //101-299
|
||||
OutputNames = 300; //301-499
|
||||
OutputCurrentVideoInputNames = 2000; //2001-2199
|
||||
OutputCurrentAudioInputNames = 2200; //2201-2399
|
||||
InputCurrentResolution = 2400; // 2401-2599
|
||||
}
|
||||
|
||||
public override void OffsetJoinNumbers(uint joinStart)
|
||||
{
|
||||
var joinOffset = joinStart - 1;
|
||||
|
||||
SystemId = SystemId + joinOffset;
|
||||
IsOnline = IsOnline + joinOffset;
|
||||
OutputVideo = OutputVideo + joinOffset;
|
||||
OutputAudio = OutputAudio + joinOffset;
|
||||
OutputUsb = OutputUsb + joinOffset;
|
||||
InputUsb = InputUsb + joinOffset;
|
||||
VideoSyncStatus = VideoSyncStatus + joinOffset;
|
||||
InputNames = InputNames + joinOffset;
|
||||
OutputNames = OutputNames + joinOffset;
|
||||
OutputCurrentVideoInputNames = OutputCurrentVideoInputNames + joinOffset;
|
||||
OutputCurrentAudioInputNames = OutputCurrentAudioInputNames + joinOffset;
|
||||
InputCurrentResolution = InputCurrentResolution + joinOffset;
|
||||
InputEndpointOnline = InputEndpointOnline + joinOffset;
|
||||
OutputEndpointOnline = OutputEndpointOnline + joinOffset;
|
||||
HdcpSupportState = HdcpSupportState + joinOffset;
|
||||
HdcpSupportCapability = HdcpSupportCapability + joinOffset;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using PepperDash.Essentials.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
public class DmRmcControllerJoinMap : JoinMapBase
|
||||
{
|
||||
#region Digitals
|
||||
/// <summary>
|
||||
/// High when device is online (if not attached to a DMP3 or DM chassis with a CPU3 card
|
||||
/// </summary>
|
||||
public uint IsOnline { get; set; }
|
||||
#endregion
|
||||
|
||||
#region Serials
|
||||
/// <summary>
|
||||
/// Reports the current output resolution
|
||||
/// </summary>
|
||||
public uint CurrentOutputResolution { get; set; }
|
||||
/// <summary>
|
||||
/// Reports the EDID manufacturer value
|
||||
/// </summary>
|
||||
public uint EdidManufacturer { get; set; }
|
||||
/// <summary>
|
||||
/// Reports the EDID Name value
|
||||
/// </summary>
|
||||
public uint EdidName { get; set; }
|
||||
/// <summary>
|
||||
/// Reports the EDID preffered timing value
|
||||
/// </summary>
|
||||
public uint EdidPrefferedTiming { get; set; }
|
||||
/// <summary>
|
||||
/// Reports the EDID serial number value
|
||||
/// </summary>
|
||||
public uint EdidSerialNumber { get; set; }
|
||||
#endregion
|
||||
|
||||
public DmRmcControllerJoinMap()
|
||||
{
|
||||
// Digital
|
||||
IsOnline = 1;
|
||||
|
||||
// Serial
|
||||
CurrentOutputResolution = 1;
|
||||
EdidManufacturer = 2;
|
||||
EdidName = 3;
|
||||
EdidPrefferedTiming = 4;
|
||||
EdidSerialNumber = 5;
|
||||
}
|
||||
|
||||
public override void OffsetJoinNumbers(uint joinStart)
|
||||
{
|
||||
var joinOffset = joinStart - 1;
|
||||
|
||||
IsOnline = IsOnline + joinOffset;
|
||||
CurrentOutputResolution = CurrentOutputResolution + joinOffset;
|
||||
EdidManufacturer = EdidManufacturer + joinOffset;
|
||||
EdidName = EdidName + joinOffset;
|
||||
EdidPrefferedTiming = EdidPrefferedTiming + joinOffset;
|
||||
EdidSerialNumber = EdidSerialNumber + joinOffset;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using PepperDash.Essentials.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
public class DmTxControllerJoinMap : JoinMapBase
|
||||
{
|
||||
#region Digitals
|
||||
/// <summary>
|
||||
/// High when device is online (if not attached to a DMP3 or DM chassis with a CPU3 card
|
||||
/// </summary>
|
||||
public uint IsOnline { get; set; }
|
||||
/// <summary>
|
||||
/// High when video sync is detected
|
||||
/// </summary>
|
||||
public uint VideoSyncStatus { get; set; }
|
||||
#endregion
|
||||
|
||||
#region Analogs
|
||||
/// <summary>
|
||||
/// Sets and reports the video source
|
||||
/// </summary>
|
||||
public uint VideoInput { get; set; }
|
||||
/// <summary>
|
||||
/// Sets and reports the audio source
|
||||
/// </summary>
|
||||
public uint AudioInput { get; set; }
|
||||
/// <summary>
|
||||
/// Reports the highest supported HDCP state level for the corresponding input card
|
||||
/// </summary>
|
||||
public uint HdcpSupportCapability { get; set; }
|
||||
/// <summary>
|
||||
/// Sets and reports the current HDCP state for the corresponding input port
|
||||
/// </summary>
|
||||
public uint Port1HdcpState { get; set; }
|
||||
/// <summary>
|
||||
/// Sets and reports the current HDCP state for the corresponding input port
|
||||
/// </summary>
|
||||
public uint Port2HdcpState { get; set; }
|
||||
#endregion
|
||||
|
||||
#region Serials
|
||||
/// <summary>
|
||||
/// Reports the current input resolution
|
||||
/// </summary>
|
||||
public uint CurrentInputResolution { get; set; }
|
||||
#endregion
|
||||
|
||||
|
||||
public DmTxControllerJoinMap()
|
||||
{
|
||||
// Digital
|
||||
IsOnline = 1;
|
||||
VideoSyncStatus = 2;
|
||||
// Serial
|
||||
CurrentInputResolution = 1;
|
||||
// Analog
|
||||
VideoInput = 1;
|
||||
AudioInput = 2;
|
||||
HdcpSupportCapability = 3;
|
||||
Port1HdcpState = 4;
|
||||
Port2HdcpState = 5;
|
||||
}
|
||||
|
||||
public override void OffsetJoinNumbers(uint joinStart)
|
||||
{
|
||||
var joinOffset = joinStart - 1;
|
||||
|
||||
IsOnline = IsOnline + joinOffset;
|
||||
VideoSyncStatus = VideoSyncStatus + joinOffset;
|
||||
CurrentInputResolution = CurrentInputResolution + joinOffset;
|
||||
VideoInput = VideoInput + joinOffset;
|
||||
AudioInput = AudioInput + joinOffset;
|
||||
HdcpSupportCapability = HdcpSupportCapability + joinOffset;
|
||||
Port1HdcpState = Port1HdcpState + joinOffset;
|
||||
Port2HdcpState = Port2HdcpState + joinOffset;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using PepperDash.Essentials.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
public class DmpsAudioOutputControllerJoinMap : JoinMapBase
|
||||
{
|
||||
#region Digital/Analog
|
||||
/// <summary>
|
||||
/// Range of joins for Master Volume
|
||||
/// Analog join 1 is volume level and feedback
|
||||
/// Digital join 1 is Mute on and feedback
|
||||
/// Digital join 2 is Mute off and feedback
|
||||
/// Digital join 3 is volume up
|
||||
/// Digital join 4 is volume down
|
||||
/// </summary>
|
||||
public uint MasterVolume { get; set; }
|
||||
/// <summary>
|
||||
/// Range of joins for Source Volume
|
||||
/// Analog join 11 is volume level and feedback
|
||||
/// Digital join 11 is Mute on and feedback
|
||||
/// Digital join 12 is Mute off and feedback
|
||||
/// Digital join 13 is volume up
|
||||
/// Digital join 14 is volume down
|
||||
/// </summary>
|
||||
public uint SourceVolume { get; set; }
|
||||
/// <summary>
|
||||
/// Range of joins for Codec1 Volume (if applicable)
|
||||
/// Analog join 21 is volume level and feedback
|
||||
/// Digital join 21 is Mute on and feedback
|
||||
/// Digital join 22 is Mute off and feedback
|
||||
/// Digital join 23 is volume up
|
||||
/// Digital join 24 is volume down
|
||||
/// </summary>
|
||||
public uint Codec1Volume { get; set; }
|
||||
/// <summary>
|
||||
/// Range of joins for Codec2 Volume (if applicable)
|
||||
/// Analog join 31 is volume level and feedback
|
||||
/// Digital join 31 is Mute on and feedback
|
||||
/// Digital join 32 is Mute off and feedback
|
||||
/// Digital join 33 is volume up
|
||||
/// Digital join 34 is volume down
|
||||
/// </summary>
|
||||
public uint Codec2Volume { get; set; }
|
||||
#endregion
|
||||
|
||||
public DmpsAudioOutputControllerJoinMap()
|
||||
{
|
||||
MasterVolume = 1; // 1-10
|
||||
SourceVolume = 11; // 11-20
|
||||
Codec1Volume = 21; // 21-30
|
||||
Codec2Volume = 31; // 31-40
|
||||
}
|
||||
|
||||
public override void OffsetJoinNumbers(uint joinStart)
|
||||
{
|
||||
var joinOffset = joinStart;
|
||||
|
||||
MasterVolume = MasterVolume + joinOffset;
|
||||
SourceVolume = SourceVolume + joinOffset;
|
||||
Codec1Volume = Codec1Volume + joinOffset;
|
||||
Codec2Volume = Codec2Volume + joinOffset;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using PepperDash.Essentials.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
public class DmpsRoutingControllerJoinMap : JoinMapBase
|
||||
{
|
||||
#region Digitals
|
||||
/// <summary>
|
||||
/// Range reports video sync feedback for each input
|
||||
/// </summary>
|
||||
public uint VideoSyncStatus { get; set; }
|
||||
/// <summary>
|
||||
/// Range reports high if corresponding input's endpoint is online
|
||||
/// </summary>
|
||||
public uint InputEndpointOnline { get; set; }
|
||||
/// <summary>
|
||||
/// Range reports high if corresponding output's endpoint is online
|
||||
/// </summary>
|
||||
public uint OutputEndpointOnline { get; set; }
|
||||
#endregion
|
||||
|
||||
|
||||
#region Analogs
|
||||
/// <summary>
|
||||
/// Range sets and reports the current video source for the corresponding output
|
||||
/// </summary>
|
||||
public uint OutputVideo { get; set; }
|
||||
/// <summary>
|
||||
/// Range sets and reports the current audio source for the corresponding output
|
||||
/// </summary>
|
||||
public uint OutputAudio { get; set; }
|
||||
/// <summary>
|
||||
/// Range sets and reports the current Usb source for the corresponding output
|
||||
/// </summary>
|
||||
//public uint OutputUsb { get; set; }
|
||||
///// <summary>
|
||||
///// Range sets and reports the current Usb source for the corresponding input
|
||||
///// </summary>
|
||||
//public uint InputUsb { get; set; }
|
||||
///// <summary>
|
||||
///// Range sets and reports the current HDCP state for the corresponding input card
|
||||
///// </summary>
|
||||
//public uint HdcpSupportState { get; set; }
|
||||
///// <summary>
|
||||
///// Range reports the highest supported HDCP state level for the corresponding input card
|
||||
///// </summary>
|
||||
//public uint HdcpSupportCapability { get; set; }
|
||||
#endregion
|
||||
|
||||
#region Serials
|
||||
/// <summary>
|
||||
/// Range sets and reports the name for the corresponding input card
|
||||
/// </summary>
|
||||
public uint InputNames { get; set; }
|
||||
/// <summary>
|
||||
/// Range sets and reports the name for the corresponding output card
|
||||
/// </summary>
|
||||
public uint OutputNames { get; set; }
|
||||
/// <summary>
|
||||
/// Range reports the name of the current video source for the corresponding output card
|
||||
/// </summary>
|
||||
public uint OutputCurrentVideoInputNames { get; set; }
|
||||
/// <summary>
|
||||
/// Range reports the name of the current audio source for the corresponding output card
|
||||
/// </summary>
|
||||
public uint OutputCurrentAudioInputNames { get; set; }
|
||||
/// <summary>
|
||||
/// Range reports the current input resolution for each corresponding input card
|
||||
/// </summary>
|
||||
public uint InputCurrentResolution { get; set; }
|
||||
#endregion
|
||||
|
||||
|
||||
public DmpsRoutingControllerJoinMap()
|
||||
{
|
||||
//Digital
|
||||
VideoSyncStatus = 100; //101-299
|
||||
InputEndpointOnline = 500; //501-699
|
||||
OutputEndpointOnline = 700; //701-899
|
||||
|
||||
//Analog
|
||||
OutputVideo = 100; //101-299
|
||||
OutputAudio = 300; //301-499
|
||||
//OutputUsb = 500; //501-699
|
||||
//InputUsb = 700; //701-899
|
||||
VideoSyncStatus = 100; //101-299
|
||||
//HdcpSupportState = 1000; //1001-1199
|
||||
//HdcpSupportCapability = 1200; //1201-1399
|
||||
|
||||
|
||||
//Serial
|
||||
InputNames = 100; //101-299
|
||||
OutputNames = 300; //301-499
|
||||
OutputCurrentVideoInputNames = 2000; //2001-2199
|
||||
OutputCurrentAudioInputNames = 2200; //2201-2399
|
||||
InputCurrentResolution = 2400; // 2401-2599
|
||||
InputEndpointOnline = 500; //501-699
|
||||
OutputEndpointOnline = 700; //701-899
|
||||
|
||||
}
|
||||
|
||||
public override void OffsetJoinNumbers(uint joinStart)
|
||||
{
|
||||
var joinOffset = joinStart - 1;
|
||||
|
||||
OutputVideo = OutputVideo + joinOffset;
|
||||
OutputAudio = OutputAudio + joinOffset;
|
||||
//OutputUsb = OutputUsb + joinOffset;
|
||||
//InputUsb = InputUsb + joinOffset;
|
||||
VideoSyncStatus = VideoSyncStatus + joinOffset;
|
||||
InputNames = InputNames + joinOffset;
|
||||
OutputNames = OutputNames + joinOffset;
|
||||
OutputCurrentVideoInputNames = OutputCurrentVideoInputNames + joinOffset;
|
||||
OutputCurrentAudioInputNames = OutputCurrentAudioInputNames + joinOffset;
|
||||
InputCurrentResolution = InputCurrentResolution + joinOffset;
|
||||
InputEndpointOnline = InputEndpointOnline + joinOffset;
|
||||
OutputEndpointOnline = OutputEndpointOnline + joinOffset;
|
||||
//HdcpSupportState = HdcpSupportState + joinOffset;
|
||||
//HdcpSupportCapability = HdcpSupportCapability + joinOffset;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
|
||||
using PepperDash.Essentials.Core;
|
||||
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
public class GenericLightingJoinMap : JoinMapBase
|
||||
{
|
||||
public uint IsOnline { get; set; }
|
||||
public uint SelectScene { get; set; }
|
||||
public uint LightingSceneOffset { get; set; }
|
||||
public uint ButtonVisibilityOffset { get; set; }
|
||||
public uint IntegrationIdSet { get; set; }
|
||||
|
||||
public GenericLightingJoinMap()
|
||||
{
|
||||
// Digital
|
||||
IsOnline = 1;
|
||||
SelectScene = 1;
|
||||
IntegrationIdSet = 1;
|
||||
LightingSceneOffset = 10;
|
||||
ButtonVisibilityOffset = 40;
|
||||
// Analog
|
||||
}
|
||||
|
||||
public override void OffsetJoinNumbers(uint joinStart)
|
||||
{
|
||||
var joinOffset = joinStart - 1;
|
||||
|
||||
IsOnline = IsOnline + joinOffset;
|
||||
SelectScene = SelectScene + joinOffset;
|
||||
LightingSceneOffset = LightingSceneOffset + joinOffset;
|
||||
ButtonVisibilityOffset = ButtonVisibilityOffset + joinOffset;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using PepperDash.Essentials.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
public class GenericRelayControllerJoinMap : JoinMapBase
|
||||
{
|
||||
#region Digitals
|
||||
/// <summary>
|
||||
/// Sets and reports the state of the relay (High = closed, Low = Open)
|
||||
/// </summary>
|
||||
public uint Relay { get; set; }
|
||||
#endregion
|
||||
|
||||
public GenericRelayControllerJoinMap()
|
||||
{
|
||||
Relay = 1;
|
||||
}
|
||||
|
||||
public override void OffsetJoinNumbers(uint joinStart)
|
||||
{
|
||||
var joinOffset = joinStart - 1;
|
||||
|
||||
Relay = Relay + joinOffset;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,230 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using PepperDash.Essentials.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
public class GlsOccupancySensorBaseJoinMap : JoinMapBase
|
||||
{
|
||||
#region Digitals
|
||||
|
||||
/// <summary>
|
||||
/// High when device is online
|
||||
/// </summary>
|
||||
public uint IsOnline { get; set; }
|
||||
/// <summary>
|
||||
/// Forces the device to report occupied status
|
||||
/// </summary>
|
||||
public uint ForceOccupied { get; set; }
|
||||
/// <summary>
|
||||
/// Forces the device to report vacant status
|
||||
/// </summary>
|
||||
public uint ForceVacant { get; set; }
|
||||
/// <summary>
|
||||
/// Enables raw status reporting
|
||||
/// </summary>
|
||||
public uint EnableRawStates { get; set; }
|
||||
/// <summary>
|
||||
/// High when raw occupancy is detected
|
||||
/// </summary>
|
||||
public uint RawOccupancyFeedback { get; set; }
|
||||
/// <summary>
|
||||
/// High when PIR sensor detects motion
|
||||
/// </summary>
|
||||
public uint RawOccupancyPirFeedback { get; set; }
|
||||
/// <summary>
|
||||
/// High when US sensor detects motion
|
||||
/// </summary>
|
||||
public uint RawOccupancyUsFeedback { get; set; }
|
||||
/// <summary>
|
||||
/// High when occupancy is detected
|
||||
/// </summary>
|
||||
public uint RoomOccupiedFeedback { get; set; }
|
||||
/// <summary>
|
||||
/// Hich when occupancy is detected in the grace period
|
||||
/// </summary>
|
||||
public uint GraceOccupancyDetectedFeedback { get; set; }
|
||||
/// <summary>
|
||||
/// High when vacancy is detected
|
||||
/// </summary>
|
||||
public uint RoomVacantFeedback { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Enables the LED Flash when set high
|
||||
/// </summary>
|
||||
public uint EnableLedFlash { get; set; }
|
||||
/// <summary>
|
||||
/// Disables the LED flash when set high
|
||||
/// </summary>
|
||||
public uint DisableLedFlash { get; set; }
|
||||
/// <summary>
|
||||
/// Enables the Short Timeout
|
||||
/// </summary>
|
||||
public uint EnableShortTimeout { get; set; }
|
||||
/// <summary>
|
||||
/// Disables the Short Timout
|
||||
/// </summary>
|
||||
public uint DisableShortTimeout { get; set; }
|
||||
/// <summary>
|
||||
/// Set high to enable one technology to trigger occupancy
|
||||
/// </summary>
|
||||
public uint OrWhenVacated { get; set; }
|
||||
/// <summary>
|
||||
/// Set high to require both technologies to trigger occupancy
|
||||
/// </summary>
|
||||
public uint AndWhenVacated { get; set; }
|
||||
/// <summary>
|
||||
/// Enables Ultrasonic Sensor A
|
||||
/// </summary>
|
||||
public uint EnableUsA { get; set; }
|
||||
/// <summary>
|
||||
/// Disables Ultrasonic Sensor A
|
||||
/// </summary>
|
||||
public uint DisableUsA { get; set; }
|
||||
/// <summary>
|
||||
/// Enables Ultrasonic Sensor B
|
||||
/// </summary>
|
||||
public uint EnableUsB { get; set; }
|
||||
/// <summary>
|
||||
/// Disables Ultrasonic Sensor B
|
||||
/// </summary>
|
||||
public uint DisableUsB { get; set; }
|
||||
/// <summary>
|
||||
/// Enables Pir
|
||||
/// </summary>
|
||||
public uint EnablePir { get; set; }
|
||||
/// <summary>
|
||||
/// Disables Pir
|
||||
/// </summary>
|
||||
public uint DisablePir { get; set; }
|
||||
public uint IncrementUsInOccupiedState { get; set; }
|
||||
public uint DecrementUsInOccupiedState { get; set; }
|
||||
public uint IncrementUsInVacantState { get; set; }
|
||||
public uint DecrementUsInVacantState { get; set; }
|
||||
public uint IncrementPirInOccupiedState { get; set; }
|
||||
public uint DecrementPirInOccupiedState { get; set; }
|
||||
public uint IncrementPirInVacantState { get; set; }
|
||||
public uint DecrementPirInVacantState { get; set; }
|
||||
#endregion
|
||||
|
||||
#region Analogs
|
||||
/// <summary>
|
||||
/// Sets adn reports the remote timeout value
|
||||
/// </summary>
|
||||
public uint Timeout { get; set; }
|
||||
/// <summary>
|
||||
/// Reports the local timeout value
|
||||
/// </summary>
|
||||
public uint TimeoutLocalFeedback { get; set; }
|
||||
/// <summary>
|
||||
/// Sets the minimum internal photo sensor value and reports the current level
|
||||
/// </summary>
|
||||
public uint InternalPhotoSensorValue { get; set; }
|
||||
/// <summary>
|
||||
/// Sets the minimum external photo sensor value and reports the current level
|
||||
/// </summary>
|
||||
public uint ExternalPhotoSensorValue { get; set; }
|
||||
|
||||
public uint UsSensitivityInOccupiedState { get; set; }
|
||||
|
||||
public uint UsSensitivityInVacantState { get; set; }
|
||||
|
||||
public uint PirSensitivityInOccupiedState { get; set; }
|
||||
|
||||
public uint PirSensitivityInVacantState { get; set; }
|
||||
#endregion
|
||||
|
||||
public GlsOccupancySensorBaseJoinMap()
|
||||
{
|
||||
IsOnline = 1;
|
||||
ForceOccupied = 2;
|
||||
ForceVacant = 3;
|
||||
EnableRawStates = 4;
|
||||
RoomOccupiedFeedback = 2;
|
||||
GraceOccupancyDetectedFeedback = 3;
|
||||
RoomVacantFeedback = 4;
|
||||
RawOccupancyFeedback = 5;
|
||||
RawOccupancyPirFeedback = 6;
|
||||
RawOccupancyUsFeedback = 7;
|
||||
EnableLedFlash = 11;
|
||||
DisableLedFlash = 12;
|
||||
EnableShortTimeout = 13;
|
||||
DisableShortTimeout = 14;
|
||||
OrWhenVacated = 15;
|
||||
AndWhenVacated = 16;
|
||||
EnableUsA = 17;
|
||||
DisableUsA = 18;
|
||||
EnableUsB = 19;
|
||||
DisableUsB = 20;
|
||||
EnablePir = 21;
|
||||
DisablePir = 22;
|
||||
IncrementUsInOccupiedState = 23;
|
||||
DecrementUsInOccupiedState = 24;
|
||||
IncrementUsInVacantState = 25;
|
||||
DecrementUsInVacantState = 26;
|
||||
IncrementPirInOccupiedState = 27;
|
||||
DecrementPirInOccupiedState = 28;
|
||||
IncrementPirInVacantState = 29;
|
||||
DecrementPirInVacantState = 30;
|
||||
|
||||
Timeout = 1;
|
||||
TimeoutLocalFeedback = 2;
|
||||
InternalPhotoSensorValue = 3;
|
||||
ExternalPhotoSensorValue = 4;
|
||||
UsSensitivityInOccupiedState = 5;
|
||||
UsSensitivityInVacantState = 6;
|
||||
PirSensitivityInOccupiedState = 7;
|
||||
PirSensitivityInVacantState = 8;
|
||||
}
|
||||
|
||||
public override void OffsetJoinNumbers(uint joinStart)
|
||||
{
|
||||
var joinOffset = joinStart - 1;
|
||||
|
||||
IsOnline = IsOnline + joinOffset;
|
||||
ForceOccupied = ForceOccupied + joinOffset;
|
||||
ForceVacant = ForceVacant + joinOffset;
|
||||
EnableRawStates = EnableRawStates + joinOffset;
|
||||
RoomOccupiedFeedback = RoomOccupiedFeedback + joinOffset;
|
||||
GraceOccupancyDetectedFeedback = GraceOccupancyDetectedFeedback + joinOffset;
|
||||
RoomVacantFeedback = RoomVacantFeedback + joinOffset;
|
||||
RawOccupancyFeedback = RawOccupancyFeedback + joinOffset;
|
||||
RawOccupancyPirFeedback = RawOccupancyPirFeedback + joinOffset;
|
||||
RawOccupancyUsFeedback = RawOccupancyUsFeedback + joinOffset;
|
||||
EnableLedFlash = EnableLedFlash + joinOffset;
|
||||
DisableLedFlash = DisableLedFlash + joinOffset;
|
||||
EnableShortTimeout = EnableShortTimeout + joinOffset;
|
||||
DisableShortTimeout = DisableShortTimeout + joinOffset;
|
||||
OrWhenVacated = OrWhenVacated + joinOffset;
|
||||
AndWhenVacated = AndWhenVacated + joinOffset;
|
||||
EnableUsA = EnableUsA + joinOffset;
|
||||
DisableUsA = DisableUsA + joinOffset;
|
||||
EnableUsB = EnableUsB + joinOffset;
|
||||
DisableUsB = DisableUsB + joinOffset;
|
||||
EnablePir = EnablePir + joinOffset;
|
||||
DisablePir = DisablePir + joinOffset;
|
||||
DisablePir = DisablePir + joinOffset;
|
||||
IncrementUsInOccupiedState = IncrementUsInOccupiedState + joinOffset;
|
||||
DecrementUsInOccupiedState = DecrementUsInOccupiedState + joinOffset;
|
||||
IncrementUsInVacantState = IncrementUsInVacantState + joinOffset;
|
||||
DecrementUsInVacantState = DecrementUsInVacantState + joinOffset;
|
||||
IncrementPirInOccupiedState = IncrementPirInOccupiedState + joinOffset;
|
||||
DecrementPirInOccupiedState = DecrementPirInOccupiedState + joinOffset;
|
||||
IncrementPirInVacantState = IncrementPirInVacantState + joinOffset;
|
||||
DecrementPirInVacantState = DecrementPirInVacantState + joinOffset;
|
||||
|
||||
Timeout = Timeout + joinOffset;
|
||||
TimeoutLocalFeedback = TimeoutLocalFeedback + joinOffset;
|
||||
InternalPhotoSensorValue = InternalPhotoSensorValue + joinOffset;
|
||||
ExternalPhotoSensorValue = ExternalPhotoSensorValue + joinOffset;
|
||||
UsSensitivityInOccupiedState = UsSensitivityInOccupiedState + joinOffset;
|
||||
UsSensitivityInVacantState = UsSensitivityInVacantState + joinOffset;
|
||||
PirSensitivityInOccupiedState = PirSensitivityInOccupiedState + joinOffset;
|
||||
PirSensitivityInVacantState = PirSensitivityInVacantState + joinOffset;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,119 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using PepperDash.Essentials.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
public class HdMdxxxCEControllerJoinMap : JoinMapBase
|
||||
{
|
||||
#region Digitals
|
||||
/// <summary>
|
||||
/// High when the pair is online
|
||||
/// </summary>
|
||||
public uint IsOnline { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// High when the remote end device is online
|
||||
/// </summary>
|
||||
public uint RemoteEndDetected { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Sets Auto Route On and provides feedback
|
||||
/// </summary>
|
||||
public uint AutoRouteOn { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Sets Auto Route Off and provides feedback
|
||||
/// </summary>
|
||||
public uint AutoRouteOff { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Sets Priority Routing On and provides feedback
|
||||
/// </summary>
|
||||
public uint PriorityRoutingOn { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Sets Priority Routing Off and provides feedback
|
||||
/// </summary>
|
||||
public uint PriorityRoutingOff { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Enables OSD and provides feedback
|
||||
/// </summary>
|
||||
public uint InputOnScreenDisplayEnabled { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Disables OSD and provides feedback
|
||||
/// </summary>
|
||||
public uint InputOnScreenDisplayDisabled { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Provides Video Sync Detected feedback for each input
|
||||
/// </summary>
|
||||
public uint SyncDetected { get; set; }
|
||||
#endregion
|
||||
|
||||
#region Analogs
|
||||
/// <summary>
|
||||
/// Sets the video source for the receiver's HDMI out and provides feedback
|
||||
/// </summary>
|
||||
public uint VideoSource { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates the number of sources supported by the Tx/Rx pair
|
||||
/// </summary>
|
||||
public uint SourceCount { get; set; }
|
||||
#endregion
|
||||
|
||||
#region Serials
|
||||
/// <summary>
|
||||
/// Indicates the name of each input port
|
||||
/// </summary>
|
||||
public uint SourceNames { get; set; }
|
||||
#endregion
|
||||
|
||||
public HdMdxxxCEControllerJoinMap()
|
||||
{
|
||||
//Digital
|
||||
IsOnline = 1;
|
||||
RemoteEndDetected = 2;
|
||||
AutoRouteOn = 3;
|
||||
AutoRouteOff = 4;
|
||||
PriorityRoutingOn = 5;
|
||||
PriorityRoutingOff = 6;
|
||||
InputOnScreenDisplayEnabled = 7;
|
||||
InputOnScreenDisplayDisabled = 8;
|
||||
SyncDetected = 10; // 11-15
|
||||
|
||||
//Analog
|
||||
VideoSource = 1;
|
||||
SourceCount = 2;
|
||||
|
||||
//Serials
|
||||
SourceNames = 10; // 11-15
|
||||
}
|
||||
|
||||
public override void OffsetJoinNumbers(uint joinStart)
|
||||
{
|
||||
var joinOffset = joinStart - 1;
|
||||
|
||||
IsOnline = IsOnline + joinOffset;
|
||||
RemoteEndDetected = RemoteEndDetected + joinOffset;
|
||||
AutoRouteOn = AutoRouteOn + joinOffset;
|
||||
AutoRouteOff = AutoRouteOff + joinOffset;
|
||||
PriorityRoutingOn = PriorityRoutingOn + joinOffset;
|
||||
PriorityRoutingOff = PriorityRoutingOff + joinOffset;
|
||||
InputOnScreenDisplayEnabled = InputOnScreenDisplayEnabled + joinOffset;
|
||||
InputOnScreenDisplayDisabled = InputOnScreenDisplayDisabled + joinOffset;
|
||||
SyncDetected = SyncDetected + joinOffset;
|
||||
|
||||
VideoSource = VideoSource + joinOffset;
|
||||
SourceCount = SourceCount + joinOffset;
|
||||
|
||||
SourceNames = SourceNames + joinOffset;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using PepperDash.Essentials.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
public class IBasicCommunicationJoinMap : JoinMapBase
|
||||
{
|
||||
#region Digitals
|
||||
/// <summary>
|
||||
/// Set High to connect, Low to disconnect
|
||||
/// </summary>
|
||||
public uint Connect { get; set; }
|
||||
/// <summary>
|
||||
/// Reports Connected State (High = Connected)
|
||||
/// </summary>
|
||||
public uint Connected { get; set; }
|
||||
#endregion
|
||||
|
||||
#region Analogs
|
||||
/// <summary>
|
||||
/// Reports the connections status value
|
||||
/// </summary>
|
||||
public uint Status { get; set; }
|
||||
#endregion
|
||||
|
||||
#region Serials
|
||||
/// <summary>
|
||||
/// Data back from port
|
||||
/// </summary>
|
||||
public uint TextReceived { get; set; }
|
||||
/// <summary>
|
||||
/// Sends data to the port
|
||||
/// </summary>
|
||||
public uint SendText { get; set; }
|
||||
/// <summary>
|
||||
/// Takes a JSON serialized string that sets a COM port's parameters
|
||||
/// </summary>
|
||||
public uint SetPortConfig { get; set; }
|
||||
#endregion
|
||||
|
||||
public IBasicCommunicationJoinMap()
|
||||
{
|
||||
TextReceived = 1;
|
||||
SendText = 1;
|
||||
SetPortConfig = 2;
|
||||
Connect = 1;
|
||||
Connected = 1;
|
||||
Status = 1;
|
||||
}
|
||||
|
||||
public override void OffsetJoinNumbers(uint joinStart)
|
||||
{
|
||||
var joinOffset = joinStart - 1;
|
||||
|
||||
TextReceived = TextReceived + joinOffset;
|
||||
SendText = SendText + joinOffset;
|
||||
SetPortConfig = SetPortConfig + joinOffset;
|
||||
Connect = Connect + joinOffset;
|
||||
Connected = Connected + joinOffset;
|
||||
Status = Status + joinOffset;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using PepperDash.Essentials.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
public class IDigitalInputJoinMap : JoinMapBase
|
||||
{
|
||||
#region Digitals
|
||||
/// <summary>
|
||||
/// Reports the state of the digital input
|
||||
/// </summary>
|
||||
public uint InputState { get; set; }
|
||||
#endregion
|
||||
|
||||
public IDigitalInputJoinMap()
|
||||
{
|
||||
InputState = 1;
|
||||
}
|
||||
|
||||
public override void OffsetJoinNumbers(uint joinStart)
|
||||
{
|
||||
var joinOffset = joinStart - 1;
|
||||
|
||||
InputState = InputState + joinOffset;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
using System.Linq;
|
||||
using Crestron.SimplSharp.Reflection;
|
||||
using PepperDash.Essentials.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
public class StatusSignControllerJoinMap:JoinMapBase
|
||||
{
|
||||
public uint IsOnline { get; set; }
|
||||
public uint Name { get; set; }
|
||||
public uint RedLed { get; set; }
|
||||
public uint GreenLed { get; set; }
|
||||
public uint BlueLed { get; set; }
|
||||
public uint RedControl { get; set; }
|
||||
public uint GreenControl { get; set; }
|
||||
public uint BlueControl { get; set; }
|
||||
|
||||
public StatusSignControllerJoinMap()
|
||||
{
|
||||
//digital
|
||||
IsOnline = 1;
|
||||
RedControl = 2;
|
||||
GreenControl = 3;
|
||||
BlueControl = 4;
|
||||
|
||||
//Analog
|
||||
RedLed = 2;
|
||||
GreenLed = 3;
|
||||
BlueLed = 4;
|
||||
|
||||
//string
|
||||
Name = 1;
|
||||
|
||||
|
||||
}
|
||||
|
||||
public override void OffsetJoinNumbers(uint joinStart)
|
||||
{
|
||||
var joinOffset = joinStart - 1;
|
||||
var properties =
|
||||
GetType().GetCType().GetProperties().Where(p => p.PropertyType == typeof (uint)).ToList();
|
||||
|
||||
foreach (var propertyInfo in properties)
|
||||
{
|
||||
propertyInfo.SetValue(this, (uint) propertyInfo.GetValue(this, null) + joinOffset, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
136
PepperDashEssentials/Bridges/JoinMaps/SystemMonitorJoinMap.cs
Normal file
136
PepperDashEssentials/Bridges/JoinMaps/SystemMonitorJoinMap.cs
Normal file
@@ -0,0 +1,136 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using PepperDash.Essentials.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
public class SystemMonitorJoinMap : JoinMapBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Offset to indicate where the range of iterated program joins will start
|
||||
/// </summary>
|
||||
public uint ProgramStartJoin { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Offset between each program join set
|
||||
/// </summary>
|
||||
public uint ProgramOffsetJoin { get; set; }
|
||||
|
||||
#region Digitals
|
||||
/// <summary>
|
||||
/// Range Sets and reports whether the corresponding program slot is started
|
||||
/// </summary>
|
||||
public uint ProgramStart { get; set; }
|
||||
/// <summary>
|
||||
/// Range Sets and reports whether the corresponding program slot is stopped
|
||||
/// </summary>
|
||||
public uint ProgramStop { get; set; }
|
||||
/// <summary>
|
||||
/// Range Sets and reports whether the corresponding program is registered
|
||||
/// </summary>
|
||||
public uint ProgramRegister { get; set; }
|
||||
/// <summary>
|
||||
/// Range Sets and reports whether the corresponding program is unregistered
|
||||
/// </summary>
|
||||
public uint ProgramUnregister { get; set; }
|
||||
#endregion
|
||||
|
||||
#region Analogs
|
||||
/// <summary>
|
||||
/// Sets and reports the time zone
|
||||
/// </summary>
|
||||
public uint TimeZone { get; set; }
|
||||
#endregion
|
||||
|
||||
#region Serials
|
||||
/// <summary>
|
||||
/// Reports the time zone name
|
||||
/// </summary>
|
||||
public uint TimeZoneName { get; set; }
|
||||
/// <summary>
|
||||
/// Reports the IO Controller Version
|
||||
/// </summary>
|
||||
public uint IOControllerVersion { get; set; }
|
||||
/// <summary>
|
||||
/// Reports the SNMP App Version
|
||||
/// </summary>
|
||||
public uint SnmpAppVersion { get; set; }
|
||||
/// <summary>
|
||||
/// Reports the BACnet App Version
|
||||
/// </summary>
|
||||
public uint BACnetAppVersion { get; set; }
|
||||
/// <summary>
|
||||
/// Reports the firmware version
|
||||
/// </summary>
|
||||
public uint ControllerVersion { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Reports the name of the corresponding program
|
||||
/// </summary>
|
||||
public uint ProgramName { get; set; }
|
||||
/// <summary>
|
||||
/// Reports the compile time of the corresponding program
|
||||
/// </summary>
|
||||
public uint ProgramCompiledTime { get; set; }
|
||||
/// <summary>
|
||||
/// Reports the Crestron Database version of the corresponding program
|
||||
/// </summary>
|
||||
public uint ProgramCrestronDatabaseVersion { get; set; }
|
||||
/// <summary>
|
||||
/// Reports the Environment Version of the corresponding program
|
||||
/// </summary>
|
||||
public uint ProgramEnvironmentVersion { get; set; }
|
||||
/// <summary>
|
||||
/// Serialized JSON output that aggregates the program info of the corresponding program
|
||||
/// </summary>
|
||||
public uint AggregatedProgramInfo { get; set; }
|
||||
#endregion
|
||||
|
||||
public SystemMonitorJoinMap()
|
||||
{
|
||||
TimeZone = 1;
|
||||
|
||||
TimeZoneName = 1;
|
||||
IOControllerVersion = 2;
|
||||
SnmpAppVersion = 3;
|
||||
BACnetAppVersion = 4;
|
||||
ControllerVersion = 5;
|
||||
|
||||
|
||||
ProgramStartJoin = 10;
|
||||
|
||||
ProgramOffsetJoin = 5;
|
||||
|
||||
// Offset in groups of 5 joins
|
||||
ProgramStart = 1;
|
||||
ProgramStop = 2;
|
||||
ProgramRegister = 3;
|
||||
ProgramUnregister = 4;
|
||||
|
||||
ProgramName = 1;
|
||||
ProgramCompiledTime = 2;
|
||||
ProgramCrestronDatabaseVersion = 3;
|
||||
ProgramEnvironmentVersion = 4;
|
||||
AggregatedProgramInfo = 5;
|
||||
}
|
||||
|
||||
public override void OffsetJoinNumbers(uint joinStart)
|
||||
{
|
||||
var joinOffset = joinStart - 1;
|
||||
|
||||
TimeZone = TimeZone + joinOffset;
|
||||
|
||||
TimeZoneName = TimeZoneName + joinOffset;
|
||||
IOControllerVersion = IOControllerVersion + joinOffset;
|
||||
SnmpAppVersion = SnmpAppVersion + joinOffset;
|
||||
BACnetAppVersion = BACnetAppVersion + joinOffset;
|
||||
ControllerVersion = ControllerVersion + joinOffset;
|
||||
|
||||
// Sets the initial join value where the iterated program joins will begin
|
||||
ProgramStartJoin = ProgramStartJoin + joinOffset;
|
||||
}
|
||||
}
|
||||
}
|
||||
65
PepperDashEssentials/Bridges/StatusSignControllerBridge.cs
Normal file
65
PepperDashEssentials/Bridges/StatusSignControllerBridge.cs
Normal file
@@ -0,0 +1,65 @@
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
using Newtonsoft.Json;
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.CrestronIO;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
public static class StatusSignDeviceApiExtensions
|
||||
{
|
||||
public static void LinkToApi(this StatusSignController ssDevice, BasicTriList trilist, uint joinStart,
|
||||
string joinMapKey)
|
||||
{
|
||||
var joinMap = new StatusSignControllerJoinMap();
|
||||
|
||||
var joinMapSerialized = JoinMapHelper.GetJoinMapForDevice(joinMapKey);
|
||||
|
||||
if (!string.IsNullOrEmpty(joinMapSerialized))
|
||||
joinMap = JsonConvert.DeserializeObject<StatusSignControllerJoinMap>(joinMapSerialized);
|
||||
|
||||
joinMap.OffsetJoinNumbers(joinStart);
|
||||
|
||||
Debug.Console(1, ssDevice, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
||||
|
||||
trilist.SetBoolSigAction(joinMap.RedControl, b => EnableControl(trilist, joinMap, ssDevice));
|
||||
trilist.SetBoolSigAction(joinMap.GreenControl, b => EnableControl(trilist, joinMap, ssDevice));
|
||||
trilist.SetBoolSigAction(joinMap.BlueControl, b => EnableControl(trilist, joinMap, ssDevice));
|
||||
|
||||
trilist.SetUShortSigAction(joinMap.RedLed, u => SetColor(trilist, joinMap, ssDevice));
|
||||
trilist.SetUShortSigAction(joinMap.GreenLed, u => SetColor(trilist, joinMap, ssDevice));
|
||||
trilist.SetUShortSigAction(joinMap.BlueLed, u => SetColor(trilist, joinMap, ssDevice));
|
||||
|
||||
trilist.StringInput[joinMap.Name].StringValue = ssDevice.Name;
|
||||
|
||||
ssDevice.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
|
||||
ssDevice.RedLedEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RedControl]);
|
||||
ssDevice.BlueLedEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.BlueControl]);
|
||||
ssDevice.GreenLedEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.GreenControl]);
|
||||
|
||||
ssDevice.RedLedBrightnessFeedback.LinkInputSig(trilist.UShortInput[joinMap.RedLed]);
|
||||
ssDevice.BlueLedBrightnessFeedback.LinkInputSig(trilist.UShortInput[joinMap.BlueLed]);
|
||||
ssDevice.GreenLedBrightnessFeedback.LinkInputSig(trilist.UShortInput[joinMap.GreenLed]);
|
||||
|
||||
}
|
||||
|
||||
private static void EnableControl(BasicTriList triList, StatusSignControllerJoinMap joinMap,
|
||||
StatusSignController device)
|
||||
{
|
||||
var redEnable = triList.BooleanOutput[joinMap.RedControl].BoolValue;
|
||||
var greenEnable = triList.BooleanOutput[joinMap.GreenControl].BoolValue;
|
||||
var blueEnable = triList.BooleanOutput[joinMap.BlueControl].BoolValue;
|
||||
device.EnableLedControl(redEnable, greenEnable, blueEnable);
|
||||
}
|
||||
|
||||
private static void SetColor(BasicTriList triList, StatusSignControllerJoinMap joinMap,
|
||||
StatusSignController device)
|
||||
{
|
||||
var redBrightness = triList.UShortOutput[joinMap.RedLed].UShortValue;
|
||||
var greenBrightness = triList.UShortOutput[joinMap.GreenLed].UShortValue;
|
||||
var blueBrightness = triList.UShortOutput[joinMap.BlueLed].UShortValue;
|
||||
|
||||
device.SetColor(redBrightness, greenBrightness, blueBrightness);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,20 +9,25 @@ using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.Monitoring;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
public static class SystemMonitorBridge
|
||||
{
|
||||
public static void LinkToApi(this SystemMonitorController systemMonitorController, BasicTriList trilist, uint joinStart, string joinMapKey)
|
||||
{
|
||||
var joinMap = JoinMapHelper.GetJoinMapForDevice(joinMapKey) as SystemMonitorJoinMap;
|
||||
SystemMonitorJoinMap joinMap = new SystemMonitorJoinMap();
|
||||
|
||||
if (joinMap == null)
|
||||
joinMap = new SystemMonitorJoinMap();
|
||||
var joinMapSerialized = JoinMapHelper.GetJoinMapForDevice(joinMapKey);
|
||||
|
||||
if(!string.IsNullOrEmpty(joinMapSerialized))
|
||||
joinMap = JsonConvert.DeserializeObject<SystemMonitorJoinMap>(joinMapSerialized);
|
||||
|
||||
joinMap.OffsetJoinNumbers(joinStart);
|
||||
|
||||
//Debug.Console(1, systemMonitorController, "Linking API starting at join: {0}", joinStart);
|
||||
Debug.Console(1, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
||||
Debug.Console(2, systemMonitorController, "Linking API starting at join: {0}", joinStart);
|
||||
|
||||
systemMonitorController.TimeZoneFeedback.LinkInputSig(trilist.UShortInput[joinMap.TimeZone]);
|
||||
//trilist.SetUShortSigAction(joinMap.TimeZone, new Action<ushort>(u => systemMonitorController.SetTimeZone(u)));
|
||||
@@ -33,18 +38,13 @@ namespace PepperDash.Essentials.Bridges
|
||||
systemMonitorController.BACnetAppVersionFeedback.LinkInputSig(trilist.StringInput[joinMap.BACnetAppVersion]);
|
||||
systemMonitorController.ControllerVersionFeedback.LinkInputSig(trilist.StringInput[joinMap.ControllerVersion]);
|
||||
|
||||
|
||||
// iterate the program status feedback collection and map all the joins
|
||||
var programSlotJoinStart = joinMap.ProgramStartJoin;
|
||||
|
||||
foreach (var p in systemMonitorController.ProgramStatusFeedbackCollection)
|
||||
{
|
||||
|
||||
// TODO: link feedbacks for each program slot
|
||||
var programNumber = p.Value.Program.Number;
|
||||
|
||||
//Debug.Console(1, systemMonitorController, "Linking API for Program Slot: {0} starting at join: {1}", programNumber, programSlotJoinStart);
|
||||
|
||||
trilist.SetBoolSigAction(programSlotJoinStart + joinMap.ProgramStart, new Action<bool>
|
||||
(b => SystemMonitor.ProgramCollection[programNumber].OperatingState = eProgramOperatingState.Start));
|
||||
p.Value.ProgramStartedFeedback.LinkInputSig(trilist.BooleanInput[programSlotJoinStart + joinMap.ProgramStart]);
|
||||
@@ -63,88 +63,6 @@ namespace PepperDash.Essentials.Bridges
|
||||
|
||||
programSlotJoinStart = programSlotJoinStart + joinMap.ProgramOffsetJoin;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public class SystemMonitorJoinMap : JoinMapBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Offset to indicate where the range of iterated program joins will start
|
||||
/// </summary>
|
||||
public uint ProgramStartJoin { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Offset between each program join set
|
||||
/// </summary>
|
||||
public uint ProgramOffsetJoin { get; set; }
|
||||
|
||||
//Digital
|
||||
public uint ProgramStart { get; set; }
|
||||
public uint ProgramStop { get; set; }
|
||||
public uint ProgramRegister { get; set; }
|
||||
public uint ProgramUnregister { get; set; }
|
||||
|
||||
//Analog
|
||||
public uint TimeZone { get; set; }
|
||||
|
||||
//Serial
|
||||
public uint TimeZoneName { get; set; }
|
||||
public uint IOControllerVersion { get; set; }
|
||||
public uint SnmpAppVersion { get; set; }
|
||||
public uint BACnetAppVersion { get; set; }
|
||||
public uint ControllerVersion { get; set; }
|
||||
|
||||
public uint ProgramName { get; set; }
|
||||
public uint ProgramCompiledTime { get; set; }
|
||||
public uint ProgramCrestronDatabaseVersion { get; set; }
|
||||
public uint ProgramEnvironmentVersion { get; set; }
|
||||
public uint AggregatedProgramInfo { get; set; }
|
||||
|
||||
public SystemMonitorJoinMap()
|
||||
{
|
||||
TimeZone = 1;
|
||||
|
||||
TimeZoneName = 1;
|
||||
IOControllerVersion = 2;
|
||||
SnmpAppVersion = 3;
|
||||
BACnetAppVersion = 4;
|
||||
ControllerVersion = 5;
|
||||
|
||||
|
||||
ProgramStartJoin = 10;
|
||||
|
||||
ProgramOffsetJoin = 5;
|
||||
|
||||
// Offset in groups of 5 joins
|
||||
ProgramStart = 1;
|
||||
ProgramStop = 2;
|
||||
ProgramRegister = 3;
|
||||
ProgramUnregister = 4;
|
||||
|
||||
ProgramName = 1;
|
||||
ProgramCompiledTime = 2;
|
||||
ProgramCrestronDatabaseVersion = 3;
|
||||
ProgramEnvironmentVersion = 4;
|
||||
AggregatedProgramInfo = 5;
|
||||
}
|
||||
|
||||
public override void OffsetJoinNumbers(uint joinStart)
|
||||
{
|
||||
var joinOffset = joinStart - 1;
|
||||
|
||||
TimeZone = TimeZone + joinOffset;
|
||||
|
||||
TimeZoneName = TimeZoneName + joinOffset;
|
||||
IOControllerVersion = IOControllerVersion + joinOffset;
|
||||
SnmpAppVersion = SnmpAppVersion + joinOffset;
|
||||
BACnetAppVersion = BACnetAppVersion + joinOffset;
|
||||
ControllerVersion = ControllerVersion + joinOffset;
|
||||
|
||||
// Sets the initial join value where the iterated program joins will begin
|
||||
ProgramStartJoin = ProgramStartJoin + joinOffset;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,72 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.Config;
|
||||
|
||||
namespace PepperDash.Essentials
|
||||
{
|
||||
|
||||
//public class TPConfig : DeviceConfig
|
||||
//{
|
||||
// new public TPConfigProperties Properties { get; set; }
|
||||
//}
|
||||
|
||||
//public class TPConfigProperties
|
||||
//{
|
||||
// /*
|
||||
// "properties": {
|
||||
// "ipId": "aa",
|
||||
// "defaultSystemKey": "system1",
|
||||
// "sgdPath": "\\NVRAM\\Program1\\Sgds\\PepperDash Essentials TSW1050_v0.9.sgd",
|
||||
// "usesSplashPage": true,
|
||||
// "showDate": true,
|
||||
// "showTime": false
|
||||
// }
|
||||
// */
|
||||
// public uint IpId { get; set; }
|
||||
// public string deafultSystemKey { get; set; }
|
||||
// public string SgdPath { get; set; }
|
||||
// public bool UsesSplashPage { get; set; }
|
||||
// public bool ShowDate { get; set; }
|
||||
// public bool ShowTime { get; set; }
|
||||
|
||||
//}
|
||||
|
||||
|
||||
|
||||
|
||||
///// <summary>
|
||||
///// The gist of this converter: The comspec JSON comes in with normal values that need to be converted
|
||||
///// into enum names. This converter takes the value and applies the appropriate enum's name prefix to the value
|
||||
///// and then returns the enum value using Enum.Parse
|
||||
///// </summary>
|
||||
//public class TPPropertiesConverter : JsonConverter
|
||||
//{
|
||||
// public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
|
||||
// {
|
||||
// return JObject.Load(reader);
|
||||
// }
|
||||
|
||||
// /// <summary>
|
||||
// /// This will be hit with every value in the ComPortConfig class. We only need to
|
||||
// /// do custom conversion on the comspec items.
|
||||
// /// </summary>
|
||||
// public override bool CanConvert(Type objectType)
|
||||
// {
|
||||
// return true;
|
||||
// }
|
||||
|
||||
// public override bool CanRead { get { return true; } }
|
||||
// public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
|
||||
// {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
//}
|
||||
}
|
||||
@@ -1,82 +0,0 @@
|
||||
using System.Linq;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Core;
|
||||
|
||||
namespace PepperDash.Essentials
|
||||
{
|
||||
public class ConfigTieLine
|
||||
{
|
||||
[JsonProperty(Required=Required.Always)]
|
||||
public string SourceDeviceKey { get; set; }
|
||||
|
||||
[JsonProperty(Required = Required.Always)]
|
||||
public string SourcePortKey { get; set; }
|
||||
|
||||
[JsonProperty(Required = Required.Always)]
|
||||
public string DestinationDeviceKey { get; set; }
|
||||
|
||||
[JsonProperty(Required = Required.Always)]
|
||||
public string DestinationPortKey { get; set; }
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return string.Format("Tie line: [{0}]{1} --> [{2}]{3}", SourceDeviceKey, SourcePortKey, DestinationDeviceKey, DestinationPortKey);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a tie line if one can be constructed between the two devices and ports
|
||||
/// </summary>
|
||||
/// <returns>TieLine or null if devices or ports don't exist</returns>
|
||||
public TieLine GetTieLine()
|
||||
{
|
||||
var sourceDevice = (IRoutingOutputs)DeviceManager.GetDeviceForKey(SourceDeviceKey);
|
||||
var destinationDevice = (IRoutingInputs)DeviceManager.GetDeviceForKey(DestinationDeviceKey);
|
||||
|
||||
if (sourceDevice == null)
|
||||
{
|
||||
Debug.Console(0, " Cannot create TieLine. Source device '{0}' not found or does not have outputs",
|
||||
SourceDeviceKey);
|
||||
return null;
|
||||
}
|
||||
else if (destinationDevice == null)
|
||||
{
|
||||
Debug.Console(0, " Cannot create TieLine. Destination device '{0}' not found or does not have inputs",
|
||||
DestinationDeviceKey);
|
||||
return null;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Get the ports by key name from the lists
|
||||
RoutingOutputPort sourcePort = sourceDevice.OutputPorts.FirstOrDefault(
|
||||
p => p.Key.Equals(SourcePortKey, System.StringComparison.OrdinalIgnoreCase));
|
||||
//RoutingOutputPort sourcePort = null;
|
||||
//sourceDevice.OutputPorts.TryGetValue(SourcePortKey, out sourcePort);
|
||||
if (sourcePort == null)
|
||||
{
|
||||
Debug.Console(0, " Cannot create TieLine {0}-->{1}. Source device does not have output port '{2}'",
|
||||
sourceDevice.Key, destinationDevice.Key, SourcePortKey);
|
||||
return null;
|
||||
}
|
||||
|
||||
RoutingInputPort destinationPort = destinationDevice.InputPorts.FirstOrDefault(
|
||||
p => p.Key.Equals(DestinationPortKey, System.StringComparison.OrdinalIgnoreCase));
|
||||
//RoutingInputPort destinationPort = null;
|
||||
//destinationDevice.InputPorts.TryGetValue(DestinationPortKey, out destinationPort);
|
||||
if (destinationPort == null)
|
||||
{
|
||||
Debug.Console(0, " Cannot create TieLine {0}-->{1}. Destination device does not have input port '{2}'",
|
||||
sourceDevice.Key, destinationDevice.Key, DestinationPortKey);
|
||||
return null;
|
||||
}
|
||||
|
||||
var tl = new TieLine(sourcePort, destinationPort);
|
||||
Debug.Console(1, " Created {0}", this);
|
||||
return tl;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,287 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharp.CrestronIO;
|
||||
using Crestron.SimplSharpPro;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
using Crestron.SimplSharpPro.CrestronThread;
|
||||
using Crestron.SimplSharpPro.Diagnostics;
|
||||
using Crestron.SimplSharpPro.EthernetCommunication;
|
||||
using Crestron.SimplSharpPro.UI;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Devices;
|
||||
//using PepperDash.Essentials.Core.Devices.Dm;
|
||||
//using PepperDash.Essentials.Fusion;
|
||||
using PepperDash.Core;
|
||||
|
||||
namespace PepperDash.Essentials
|
||||
{
|
||||
public static class Configuration
|
||||
{
|
||||
|
||||
public static string LastPath { get; private set; }
|
||||
public static CrestronControlSystem ControlSystem { get; private set; }
|
||||
|
||||
public static void Initialize(CrestronControlSystem cs)
|
||||
{
|
||||
CrestronConsole.AddNewConsoleCommand(ReloadFromConsole, "configreload", "Reloads configuration file",
|
||||
ConsoleAccessLevelEnum.AccessOperator);
|
||||
ControlSystem = cs;
|
||||
}
|
||||
|
||||
public static bool ReadConfiguration(string filePath)
|
||||
{
|
||||
try
|
||||
{
|
||||
// Read file
|
||||
if (File.Exists(filePath))
|
||||
{
|
||||
LastPath = filePath;
|
||||
string json = File.ReadToEnd(filePath, System.Text.Encoding.ASCII);
|
||||
JObject jo = JObject.Parse(json);
|
||||
|
||||
var info = JsonConvert.DeserializeObject<ConfigInfo>(jo["info"].ToString());
|
||||
Debug.Console(0, "\r[Config] file read:");
|
||||
Debug.Console(0, " File: {0}", filePath);
|
||||
Debug.Console(0, " Name: {0}", info.Name);
|
||||
Debug.Console(0, " Type: {0}", info.SystemTemplateType);
|
||||
Debug.Console(0, " Date: {0}", info.EditDate);
|
||||
Debug.Console(0, " ConfigVersion: {0}", info.Version);
|
||||
Debug.Console(0, " EditedBy: {0}", info.EditedBy);
|
||||
Debug.Console(0, " Comment: {0}\r", info.Comment);
|
||||
|
||||
// Get the main config object
|
||||
var jConfig = jo["configuration"];
|
||||
|
||||
// Devices
|
||||
var jDevices = (JArray)jConfig["devices"];
|
||||
CreateDevices(jDevices);
|
||||
|
||||
// TieLines
|
||||
var jRouting = jConfig["routing"];
|
||||
CreateRouting(jRouting);
|
||||
|
||||
/// Parse the available source list(s)
|
||||
var jSourceLists = (JArray)jConfig["sourceLists"];
|
||||
var jSourceListJson = jSourceLists.ToString();
|
||||
List<ConfigSourceList> sourceLists = JsonConvert.DeserializeObject<List<ConfigSourceList>>(jSourceListJson);
|
||||
|
||||
// System
|
||||
var jSystems = (JArray)jConfig["systems"];
|
||||
CreateSystems(jSystems, sourceLists);
|
||||
|
||||
// Activate everything
|
||||
DeviceManager.ActivateAll();
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Console(0, "[Config] file not found '{0}'", filePath);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.Console(0, "Configuration read error: \r {0}", e);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static void CreateDevices(JArray jDevices)
|
||||
{
|
||||
//Debug.Console(0, " Creating {0} devices", jDevices.Count);
|
||||
//for (int i = 0; i < jDevices.Count; i++)
|
||||
//{
|
||||
// var jDev = jDevices[i];
|
||||
|
||||
// //var devConfig = JsonConvert.DeserializeObject<DeviceConfig>(jDev.ToString());
|
||||
// //Debug.Console(0, "++++++++++++{0}", devConfig);
|
||||
|
||||
|
||||
// var group = jDev["group"].Value<string>();
|
||||
// Debug.Console(0, " [{0}], creating {1}:{2}", jDev["key"].Value<string>(),
|
||||
// group, jDev["type"].Value<string>());
|
||||
|
||||
// Device dev = null;
|
||||
// if (group.Equals("Display", StringComparison.OrdinalIgnoreCase))
|
||||
// dev = DisplayFactory.CreateDisplay(jDev);
|
||||
// else if (group.Equals("DeviceMonitor", StringComparison.OrdinalIgnoreCase))
|
||||
// dev = DeviceManagerFactory.Create(jDev);
|
||||
// //else if (group.Equals("Pc", StringComparison.OrdinalIgnoreCase))
|
||||
// // dev = PcFactory.Create(jDev);
|
||||
// //else if (group.Equals("SetTopBox", StringComparison.OrdinalIgnoreCase))
|
||||
// // dev = SetTopBoxFactory.Create(jDev);
|
||||
// //else if (group.Equals("DiscPlayer", StringComparison.OrdinalIgnoreCase))
|
||||
// // dev = DiscPlayerFactory.Create(jDev);
|
||||
// //else if (group.Equals("Touchpanel", StringComparison.OrdinalIgnoreCase))
|
||||
// // dev = TouchpanelFactory.Create(jDev);
|
||||
// else if (group.Equals("dmEndpoint", StringComparison.OrdinalIgnoreCase)) // Add Transmitter and Receiver
|
||||
// dev = DmFactory.Create(jDev);
|
||||
// else if (group.Equals("dmChassic", StringComparison.OrdinalIgnoreCase))
|
||||
// dev = DmFactory.CreateChassis(jDev);
|
||||
// else if (group.Equals("processor", StringComparison.OrdinalIgnoreCase))
|
||||
// continue; // ignore it. Has no value right now.
|
||||
// //else if (group.Equals("remote", StringComparison.OrdinalIgnoreCase))
|
||||
// // dev = RemoteFactory.Create(jDev);
|
||||
// else
|
||||
// {
|
||||
// Debug.Console(0, " ERROR: Device [{0}] has unknown Group '{1}'. Skipping",
|
||||
// jDev["key"].Value<string>(), group);
|
||||
// continue;
|
||||
// }
|
||||
|
||||
// if (dev != null)
|
||||
// DeviceManager.AddDevice(dev);
|
||||
// else
|
||||
// Debug.Console(0, " ERROR: failed to create device {0}",
|
||||
// jDev["key"].Value<string>());
|
||||
//}
|
||||
}
|
||||
|
||||
static void CreateSystems(JArray jSystems, List<ConfigSourceList> sourceLists)
|
||||
{
|
||||
// // assuming one system
|
||||
// var jSystem = jSystems[0];
|
||||
// var name = jSystem.Value<string>("name");
|
||||
// var key = FactoryHelper.KeyOrConvertName(jSystem.Value<string>("key"), name);
|
||||
|
||||
// if (jSystem.Value<string>("type").Equals("EssentialsHuddleSpace", StringComparison.OrdinalIgnoreCase))
|
||||
// {
|
||||
// var sys = new HuddleSpaceRoom(key, name);
|
||||
// var props = jSystem["properties"];
|
||||
// var displayKey = props["displayKey"].Value<string>();
|
||||
// if (displayKey != null)
|
||||
// sys.DefaultDisplay = (DisplayBase)DeviceManager.GetDeviceForKey(displayKey);
|
||||
|
||||
// // Add sources from passed in config list
|
||||
// var myList = sourceLists.FirstOrDefault(
|
||||
// l => l.Key.Equals(props.Value<string>("sourceListKey"), StringComparison.OrdinalIgnoreCase));
|
||||
// if (myList != null)
|
||||
// AddSourcesToSystem(sys, myList);
|
||||
|
||||
// DeviceManager.AddDevice(sys);
|
||||
|
||||
// //spin up a fusion thing too
|
||||
//#warning add this fusion connector back in later
|
||||
// //DeviceManager.AddDevice(new EssentialsHuddleSpaceFusionSystemController(sys, 0xf1));
|
||||
//}
|
||||
}
|
||||
|
||||
//static void AddSourcesToSystem(Room system, ConfigSourceList configList)
|
||||
//{
|
||||
//foreach (var configItem in configList.PresentationSources)
|
||||
//{
|
||||
// var src = (IPresentationSource)DeviceManager.GetDeviceForKey(configItem.SourceKey);
|
||||
// if (src != null)
|
||||
// system.Sources.Add(configItem.Number, src);
|
||||
// else
|
||||
// Debug.Console(0, system, "cannot find source '{0}' from list {1}",
|
||||
// configItem.SourceKey, configList.Name);
|
||||
//}
|
||||
//}
|
||||
|
||||
/// <summary>
|
||||
/// Links up routing, creates tie lines
|
||||
/// </summary>
|
||||
/// <param name="jRouting">The "Routing" JArray from configuration</param>
|
||||
static void CreateRouting(JToken jRouting)
|
||||
{
|
||||
var jsonTieLines = jRouting["tieLines"].ToString();
|
||||
var tieLineConfigs = JsonConvert.DeserializeObject<List<ConfigTieLine>>(jsonTieLines);
|
||||
foreach (var c in tieLineConfigs)
|
||||
{
|
||||
var tl = c.GetTieLine();
|
||||
if (tl != null)
|
||||
TieLineCollection.Default.Add(tl);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Returns the IIROutputPorts device (control system, etc) that contains a given IR port
|
||||
/// </summary>
|
||||
/// <param name="propsToken"></param>
|
||||
static IROutputPort GetIrPort(JToken propsToken)
|
||||
{
|
||||
var portDevName = propsToken.Value<string>("IrPortDevice");
|
||||
var portNum = propsToken.Value<uint>("IrPortNumber");
|
||||
if (portDevName.Equals("controlSystem", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
IIROutputPorts irDev = ControlSystem;
|
||||
if (portNum <= irDev.NumberOfIROutputPorts)
|
||||
return ControlSystem.IROutputPorts[portNum];
|
||||
else
|
||||
Debug.Console(0, "[Config] ERROR: IR Port {0} out of range. Range 0-{1} on {2}", portNum,
|
||||
ControlSystem.IROutputPorts.Count, irDev.ToString());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static void HandleUnknownType(JToken devToken, string type)
|
||||
{
|
||||
Debug.Console(0, "[Config] ERROR: Type '{0}' not found in group '{1}'", type,
|
||||
devToken.Value<string>("Group"));
|
||||
}
|
||||
|
||||
static void HandleDeviceCreationError(JToken devToken, Exception e)
|
||||
{
|
||||
Debug.Console(0, "[Config] ERROR creating device [{0}]: \r{1}",
|
||||
devToken["Key"].Value<string>(), e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Console helper to reload
|
||||
/// </summary>
|
||||
static void ReloadFromConsole(string s)
|
||||
{
|
||||
// Gotta tear down everything first!
|
||||
|
||||
if (!string.IsNullOrEmpty(LastPath))
|
||||
{
|
||||
ReadConfiguration(LastPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class ConfigSourceList
|
||||
{
|
||||
[JsonProperty(Required = Required.Always)]
|
||||
public string Key { get; set; }
|
||||
|
||||
[JsonProperty(Required = Required.Always)]
|
||||
public string Name { get; set; }
|
||||
|
||||
[JsonProperty(Required = Required.Always)]
|
||||
public List<ConfigSourceItem> PresentationSources { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public class ConfigSourceItem
|
||||
{
|
||||
[JsonProperty(Required = Required.Always)]
|
||||
public uint Number { get; set; }
|
||||
|
||||
[JsonProperty(Required = Required.Always)]
|
||||
public string SourceKey { get; set; }
|
||||
|
||||
public string AlternateName { get; set; }
|
||||
}
|
||||
|
||||
public class ConfigInfo
|
||||
{
|
||||
public string SystemTemplateType { get; set; }
|
||||
public string ProcessorType { get; set; }
|
||||
public string Name { get; set; }
|
||||
public uint ProgramSlotNumber { get; set; }
|
||||
public string Version { get; set; }
|
||||
public string EditedBy { get; set; }
|
||||
public string EditDate { get; set; }
|
||||
public string Comment { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace PepperDash.Essentials
|
||||
{
|
||||
public class SourceListConfigProperties
|
||||
{
|
||||
[JsonProperty(Required= Required.Always)]
|
||||
public uint Number { get; set; }
|
||||
[JsonProperty(Required= Required.Always)]
|
||||
public string SourceKey { get; set; }
|
||||
public string AltName { get; set; }
|
||||
public string AltIcon { get; set; }
|
||||
|
||||
public SourceListConfigProperties()
|
||||
{
|
||||
AltName = "";
|
||||
AltIcon = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
//using System;
|
||||
//using Crestron.SimplSharpPro;
|
||||
|
||||
//using Newtonsoft.Json;
|
||||
//using Newtonsoft.Json.Linq;
|
||||
|
||||
//using PepperDash.Essentials.Core;
|
||||
//using PepperDash.Essentials.Devices;
|
||||
//using PepperDash.Core;
|
||||
|
||||
//namespace PepperDash.Essentials
|
||||
//{
|
||||
// public class CommFactory
|
||||
// {
|
||||
// public static IBasicCommunication CreateCommForDevice(JToken devToken)
|
||||
// {
|
||||
// var devKey = devToken.Value<string>("key");
|
||||
// IBasicCommunication comm = null;
|
||||
// try
|
||||
// {
|
||||
// var control = devToken["properties"]["control"];
|
||||
// var commMethod = control["method"].Value<string>();
|
||||
// if (commMethod == "com")
|
||||
// {
|
||||
// var comConfig = JsonConvert.DeserializeObject<ComPortConfig>(
|
||||
// control["comParams"].ToString(),
|
||||
// new JsonSerializerSettings
|
||||
// {
|
||||
// // Needs ObjectCreationHandling to make the ComSpec struct populate
|
||||
// ObjectCreationHandling = ObjectCreationHandling.Replace,
|
||||
// Converters = new JsonConverter[] { new ComSpecJsonConverter() }
|
||||
// });
|
||||
// comm = new ComPortController(devKey + "-com", comConfig.GetComPort(), comConfig.ComSpec);
|
||||
// }
|
||||
// else if (commMethod == "tcpIp")
|
||||
// {
|
||||
// var tcpConfig = JsonConvert.DeserializeObject<TcpIpConfig>(control["tcpParams"].ToString());
|
||||
// comm = new GenericTcpIpClient(devKey + "-tcp", tcpConfig.Address, tcpConfig.Port, tcpConfig.BufferSize);
|
||||
// }
|
||||
// }
|
||||
// catch (Exception e)
|
||||
// {
|
||||
// Debug.Console(0, "Cannot create communication from JSON:\r{0}\r\rException:\r{1}", devToken.ToString(), e);
|
||||
// }
|
||||
|
||||
// // put it in the device manager if it's the right flavor
|
||||
// var comDev = comm as Device;
|
||||
// if (comDev != null)
|
||||
// DeviceManager.AddDevice(comDev);
|
||||
|
||||
// return comm;
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
@@ -1,38 +0,0 @@
|
||||
//using System;
|
||||
//using Crestron.SimplSharpPro;
|
||||
|
||||
//using Newtonsoft.Json.Linq;
|
||||
|
||||
//using PepperDash.Essentials.Core;
|
||||
//using PepperDash.Essentials.Core.Devices;
|
||||
//using PepperDash.Core;
|
||||
|
||||
//namespace PepperDash.Essentials
|
||||
//{
|
||||
// public class DeviceManagerFactory
|
||||
// {
|
||||
// public static Device Create(JToken devToken)
|
||||
// {
|
||||
// Device dev = null;
|
||||
// try
|
||||
// {
|
||||
// var devType = devToken.Value<string>("type");
|
||||
// var devKey = devToken.Value<string>("key");
|
||||
// var devName = devToken.Value<string>("name");
|
||||
// if (devType.Equals("DeviceMonitor", StringComparison.OrdinalIgnoreCase))
|
||||
// {
|
||||
// var comm = CommFactory.CreateCommForDevice(devToken);
|
||||
// if (comm == null) return null;
|
||||
// dev = new GenericCommunicationMonitoredDevice(devKey, devName, comm, devToken["properties"]["pollString"].Value<string>());
|
||||
// }
|
||||
// else
|
||||
// FactoryHelper.HandleUnknownType(devToken, devType);
|
||||
// }
|
||||
// catch (Exception e)
|
||||
// {
|
||||
// FactoryHelper.HandleDeviceCreationError(devToken, e);
|
||||
// }
|
||||
// return dev;
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
@@ -1,122 +0,0 @@
|
||||
//using System;
|
||||
//using System.Collections.Generic;
|
||||
//using System.Linq;
|
||||
//using System.Text;
|
||||
//using Crestron.SimplSharp;
|
||||
|
||||
//using Newtonsoft.Json;
|
||||
//using Newtonsoft.Json.Linq;
|
||||
|
||||
//using PepperDash.Essentials.Core;
|
||||
//using PepperDash.Essentials.Devices;
|
||||
//using PepperDash.Essentials.Displays;
|
||||
//using PepperDash.Core;
|
||||
|
||||
//namespace PepperDash.Essentials
|
||||
//{
|
||||
// public class DisplayFactory
|
||||
// {
|
||||
// public static DisplayBase CreateDisplay(JToken devToken)
|
||||
// {
|
||||
// DisplayBase dev = null;
|
||||
// try
|
||||
// {
|
||||
// var devType = devToken.Value<string>("type");
|
||||
// var devKey = devToken.Value<string>("key");
|
||||
// var devName = devToken.Value<string>("name");
|
||||
// var properties = devToken["properties"];
|
||||
|
||||
// if (devType.Equals("MockDisplay", StringComparison.OrdinalIgnoreCase))
|
||||
// dev = new MockDisplay(devKey, devName);
|
||||
|
||||
// else if (devType.Equals("NecMPSX", StringComparison.OrdinalIgnoreCase))
|
||||
// {
|
||||
// var comm = CommFactory.CreateCommForDevice(devToken);
|
||||
// if (comm == null) return null;
|
||||
// dev = new NecPSXMDisplayCom(devKey, devName, comm);
|
||||
|
||||
|
||||
|
||||
// //var commMethod = properties["control"]["method"].Value<string>();
|
||||
|
||||
// //// Helper-ize this?
|
||||
// //if(commMethod == "com")
|
||||
// //{
|
||||
// // // Move some of this up above???
|
||||
// // var comConfig = JsonConvert.DeserializeObject<ComPortConfig>(
|
||||
// // properties["control"]["comParams"].ToString(),
|
||||
// // new JsonSerializerSettings {
|
||||
// // // Needs ObjectCreationHandling to make the ComSpec struct populate
|
||||
// // ObjectCreationHandling = ObjectCreationHandling.Replace,
|
||||
// // Converters = new JsonConverter[] { new ComSpecJsonConverter() }
|
||||
// // });
|
||||
// // dev = new NecPSXMDisplayCom(devKey, devName, comConfig.GetComPort(), comConfig.ComSpec);
|
||||
// //}
|
||||
// //else if (commMethod == "tcpIp")
|
||||
// //{
|
||||
// // var spec = properties["control"]["tcpSpec"];
|
||||
// // var host = spec["address"].Value<string>();
|
||||
// // var port = spec["port"].Value<int>();
|
||||
// // dev = new NecPSXMDisplayCom(devKey, devName, host, port);
|
||||
// //}
|
||||
|
||||
|
||||
|
||||
// }
|
||||
|
||||
// else if (devType.Equals("NecNpPa550", StringComparison.OrdinalIgnoreCase))
|
||||
// {
|
||||
// var proj = new NecPaSeriesProjector(devKey, devName);
|
||||
// var comm = CreateCommunicationFromPropertiesToken(
|
||||
// devKey + "-comm", properties, 3000);
|
||||
// proj.CommunicationMethod = comm;
|
||||
// dev = proj;
|
||||
// }
|
||||
// else
|
||||
// FactoryHelper.HandleUnknownType(devToken, devType);
|
||||
// }
|
||||
// catch (Exception e)
|
||||
// {
|
||||
// FactoryHelper.HandleDeviceCreationError(devToken, e);
|
||||
// }
|
||||
// return dev;
|
||||
// }
|
||||
|
||||
// public static IBasicCommunication CreateCommunicationFromPropertiesToken(
|
||||
// string commKey, JToken properties, int bufferSize)
|
||||
// {
|
||||
// Debug.Console(2, "Building port from: {0}", properties.ToString());
|
||||
|
||||
// var tcpToken = properties["TcpIp"];
|
||||
// if (tcpToken != null)
|
||||
// {
|
||||
// // Convert the Tcp property
|
||||
// var spec = JsonConvert.DeserializeObject<TcpIpConfig>(tcpToken.ToString());
|
||||
|
||||
// var tcp = new GenericTcpIpClient(commKey, spec.Address, spec.Port, bufferSize);
|
||||
// DeviceManager.AddDevice(tcp);
|
||||
// return tcp;
|
||||
// }
|
||||
|
||||
// var com = properties["Com"];
|
||||
// if (com != null)
|
||||
// {
|
||||
// // Make the interim config object
|
||||
// var comConfig = JsonConvert.DeserializeObject<ComPortConfig>(com.ToString(),
|
||||
// new JsonSerializerSettings { ObjectCreationHandling = ObjectCreationHandling.Replace });
|
||||
|
||||
// // Get the IComPorts hardware device from the Device or Control System
|
||||
// var comDev = comConfig.GetIComPortsDeviceFromManagedDevice();
|
||||
// if (comDev != null)
|
||||
// {
|
||||
// var controller = new ComPortController(commKey, comDev.ComPorts[comConfig.ComPortNumber], comConfig.ComSpec);
|
||||
// DeviceManager.AddDevice(controller);
|
||||
// return controller;
|
||||
// }
|
||||
// }
|
||||
// Debug.Console(0, "No Tcp or Com port information for port {0}", commKey);
|
||||
// return null;
|
||||
// }
|
||||
|
||||
// }
|
||||
//}
|
||||
@@ -1,124 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Devices;
|
||||
using PepperDash.Core;
|
||||
|
||||
namespace PepperDash.Essentials
|
||||
{
|
||||
public static class FactoryHelper
|
||||
{
|
||||
public static string IrDriverPathPrefix = Global.FilePathPrefix + "IR" + Global.DirectorySeparator;
|
||||
|
||||
public static void HandleUnknownType(JToken devToken, string type)
|
||||
{
|
||||
Debug.Console(0, "[Config] ERROR: Type '{0}' not found in group '{1}'", type,
|
||||
devToken.Value<string>("group"));
|
||||
}
|
||||
|
||||
public static void HandleDeviceCreationError(JToken devToken, Exception e)
|
||||
{
|
||||
Debug.Console(0, "[Config] ERROR creating device [{0}]: \r{1}",
|
||||
devToken["key"].Value<string>(), e);
|
||||
Debug.Console(0, "Relevant config:\r{0}", devToken.ToString(Newtonsoft.Json.Formatting.Indented));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Finds either the ControlSystem or a device controller that contains IR ports and
|
||||
/// returns a port from the hardware device
|
||||
/// </summary>
|
||||
/// <param name="propsToken"></param>
|
||||
/// <returns>Crestron IrPort or null if device doesn't have IR or is not found</returns>
|
||||
public static IrOutPortConfig GetIrPort(JToken propsToken)
|
||||
{
|
||||
var irSpec = propsToken["control"]["irSpec"];
|
||||
var portDevKey = irSpec.Value<string>("portDeviceKey");
|
||||
var portNum = irSpec.Value<uint>("portNumber");
|
||||
IIROutputPorts irDev = null;
|
||||
if (portDevKey.Equals("controlSystem", StringComparison.OrdinalIgnoreCase)
|
||||
|| portDevKey.Equals("processor", StringComparison.OrdinalIgnoreCase))
|
||||
irDev = Global.ControlSystem;
|
||||
else
|
||||
irDev = DeviceManager.GetDeviceForKey(portDevKey) as IIROutputPorts;
|
||||
|
||||
if (irDev == null)
|
||||
{
|
||||
Debug.Console(0, "[Config] Error, device with IR ports '{0}' not found", portDevKey);
|
||||
return null;
|
||||
}
|
||||
|
||||
if (portNum <= irDev.NumberOfIROutputPorts) // success!
|
||||
{
|
||||
var file = IrDriverPathPrefix + irSpec["file"].Value<string>();
|
||||
return new IrOutPortConfig { Port = irDev.IROutputPorts[portNum], FileName = file };
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Console(0, "[Config] Error, device '{0}' IR port {1} out of range",
|
||||
portDevKey, portNum);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Finds either the ControlSystem or a device controller that contains com ports and
|
||||
/// returns a port from the hardware device
|
||||
/// </summary>
|
||||
/// <param name="propsToken">The Properties token from the device's config</param>
|
||||
/// <returns>Crestron ComPort or null if device doesn't have IR or is not found</returns>
|
||||
public static ComPort GetComPort(JToken propsToken)
|
||||
{
|
||||
var portDevKey = propsToken.Value<string>("comPortDevice");
|
||||
var portNum = propsToken.Value<uint>("comPortNumber");
|
||||
IComPorts comDev = null;
|
||||
if (portDevKey.Equals("controlSystem", StringComparison.OrdinalIgnoreCase))
|
||||
comDev = Global.ControlSystem;
|
||||
else
|
||||
comDev = DeviceManager.GetDeviceForKey(portDevKey) as IComPorts;
|
||||
|
||||
if (comDev == null)
|
||||
{
|
||||
Debug.Console(0, "[Config] Error, device with com ports '{0}' not found", portDevKey);
|
||||
return null;
|
||||
}
|
||||
|
||||
if (portNum <= comDev.NumberOfComPorts) // success!
|
||||
return comDev.ComPorts[portNum];
|
||||
else
|
||||
{
|
||||
Debug.Console(0, "[Config] Error, device '{0}' com port {1} out of range",
|
||||
portDevKey, portNum);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the key if it exists or converts the name into a key
|
||||
/// </summary>
|
||||
public static string KeyOrConvertName(string key, string name)
|
||||
{
|
||||
if (string.IsNullOrEmpty(key))
|
||||
return name.Replace(' ', '-');
|
||||
return key;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Wrapper to help in IR port creation
|
||||
/// </summary>
|
||||
public class IrOutPortConfig
|
||||
{
|
||||
public IROutputPort Port { get; set; }
|
||||
public string FileName { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,52 +0,0 @@
|
||||
//using System;
|
||||
//using Crestron.SimplSharpPro;
|
||||
|
||||
//using Newtonsoft.Json.Linq;
|
||||
|
||||
//using PepperDash.Essentials.Core;
|
||||
//using PepperDash.Essentials.Devices;
|
||||
|
||||
//using PepperDash.Core;
|
||||
|
||||
//namespace PepperDash.Essentials
|
||||
//{
|
||||
// public class SetTopBoxFactory
|
||||
// {
|
||||
// public static Device Create(JToken devToken)
|
||||
// {
|
||||
// Device dev = null;
|
||||
// try
|
||||
// {
|
||||
// var devType = devToken.Value<string>("type");
|
||||
// var devKey = devToken.Value<string>("key");
|
||||
// var devName = devToken.Value<string>("name");
|
||||
// var props = devToken["properties"];
|
||||
// var portConfig = FactoryHelper.GetIrPort(props);
|
||||
// if (portConfig != null)
|
||||
// {
|
||||
// if (devType.EndsWith("-generic"))
|
||||
// {
|
||||
// var stb = new IrSetTopBoxBase(devKey, devName, portConfig.Port, portConfig.FileName);
|
||||
// // Do this a better way?
|
||||
// stb.HasDpad = props["hasDpad"].Value<bool>();
|
||||
// stb.HasDvr = props["hasDvr"].Value<bool>();
|
||||
// stb.HasNumbers = props["hasNumbers"].Value<bool>();
|
||||
// stb.HasPreset = props["hasPresets"].Value<bool>();
|
||||
// dev = stb;
|
||||
// }
|
||||
// else
|
||||
// FactoryHelper.HandleUnknownType(devToken, devType);
|
||||
|
||||
// var preDev = dev as IHasSetTopBoxProperties;
|
||||
// if(preDev.HasPreset)
|
||||
// preDev.LoadPresets(props["presetListName"].Value<string>());
|
||||
// }
|
||||
// }
|
||||
// catch (Exception e)
|
||||
// {
|
||||
// FactoryHelper.HandleDeviceCreationError(devToken, e);
|
||||
// }
|
||||
// return dev;
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
@@ -1,34 +0,0 @@
|
||||
//using System;
|
||||
//using Crestron.SimplSharpPro;
|
||||
|
||||
//using Newtonsoft.Json.Linq;
|
||||
|
||||
//using PepperDash.Essentials.Core;
|
||||
//using PepperDash.Essentials.Devices;
|
||||
//using PepperDash.Core;
|
||||
|
||||
//namespace PepperDash.Essentials
|
||||
//{
|
||||
// public class PcFactory
|
||||
// {
|
||||
// public static Device Create(JToken devToken)
|
||||
// {
|
||||
// Device dev = null;
|
||||
// //try
|
||||
// //{
|
||||
// // var devType = devToken.Value<string>("type");
|
||||
// // var devKey = devToken.Value<string>("key");
|
||||
// // var devName = devToken.Value<string>("name");
|
||||
// // if (devType.Equals("laptop", StringComparison.OrdinalIgnoreCase))
|
||||
// // dev = new Laptop(devKey, devName);
|
||||
// // else
|
||||
// // FactoryHelper.HandleUnknownType(devToken, devType);
|
||||
// //}
|
||||
// //catch (Exception e)
|
||||
// //{
|
||||
// // FactoryHelper.HandleDeviceCreationError(devToken, e);
|
||||
// //}
|
||||
// return dev;
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
@@ -1,46 +0,0 @@
|
||||
//using System;
|
||||
//using Crestron.SimplSharpPro;
|
||||
|
||||
//using Newtonsoft.Json.Linq;
|
||||
|
||||
//using PepperDash.Essentials.Core;
|
||||
//using PepperDash.Essentials.Devices;
|
||||
//using PepperDash.Core;
|
||||
|
||||
//namespace PepperDash.Essentials
|
||||
//{
|
||||
// public class DiscPlayerFactory
|
||||
// {
|
||||
// public static Device Create(JToken devToken)
|
||||
// {
|
||||
// Device dev = null;
|
||||
// try
|
||||
// {
|
||||
// var devType = devToken.Value<string>("type");
|
||||
// var devKey = devToken.Value<string>("key");
|
||||
// var devName = devToken.Value<string>("name");
|
||||
|
||||
// // Filter out special (Pioneer
|
||||
// //(devType.Equals("genericIr", StringComparison.OrdinalIgnoreCase))
|
||||
|
||||
// var props = devToken["properties"];
|
||||
// var portConfig = FactoryHelper.GetIrPort(props);
|
||||
// if (portConfig != null)
|
||||
// {
|
||||
// if (devType.EndsWith("-generic"))
|
||||
// dev = new IrDvdBase(devKey, devName, portConfig.Port, portConfig.FileName);
|
||||
// else
|
||||
// FactoryHelper.HandleUnknownType(devToken, devType);
|
||||
// }
|
||||
|
||||
// // NO PORT ERROR HERE??
|
||||
|
||||
// }
|
||||
// catch (Exception e)
|
||||
// {
|
||||
// FactoryHelper.HandleDeviceCreationError(devToken, e);
|
||||
// }
|
||||
// return dev;
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
@@ -1,127 +0,0 @@
|
||||
//using System;
|
||||
//using System.Collections.Generic;
|
||||
//using Crestron.SimplSharpPro;
|
||||
//using Crestron.SimplSharpPro.Remotes;
|
||||
//using Crestron.SimplSharpPro.UI;
|
||||
//using Newtonsoft.Json;
|
||||
//using Newtonsoft.Json.Linq;
|
||||
|
||||
//using PepperDash.Essentials.Core;
|
||||
//using PepperDash.Essentials.Devices;
|
||||
////using PepperDash.Essentials.Remotes;
|
||||
//using PepperDash.Core;
|
||||
|
||||
//namespace PepperDash.Essentials
|
||||
//{
|
||||
// //public class RemoteFactory
|
||||
// //{
|
||||
// // public static Device Create(JToken devToken)
|
||||
// // {
|
||||
// // Hr150Controller dev = null;
|
||||
// // try
|
||||
// // {
|
||||
// // var devType = devToken.Value<string>("type");
|
||||
// // var devKey = devToken.Value<string>("key");
|
||||
// // var devName = devToken.Value<string>("name");
|
||||
// // var props = devToken["properties"];
|
||||
|
||||
// // if (devType.Equals("hr150", StringComparison.OrdinalIgnoreCase))
|
||||
// // {
|
||||
// // uint id = Convert.ToUInt32(props.Value<string>("rfId"), 16);
|
||||
// // var parent = props.Value<string>("rfGateway");
|
||||
// // RFExGateway rf = GetGateway(parent);
|
||||
|
||||
// // var hw = new Hr150(id, rf);
|
||||
// // dev = new Hr150Controller(devKey, devName, hw);
|
||||
|
||||
// // // Have to add the buttons and default source after all devices are spun up
|
||||
// // dev.AddPostActivationAction(() =>
|
||||
// // {
|
||||
// // var defaultSystemKey = props.Value<string>("defaultSystemKey");
|
||||
// // dev.SetCurrentRoom((EssentialsRoom)DeviceManager.GetDeviceForKey(defaultSystemKey));
|
||||
|
||||
// // // Link custom buttons
|
||||
// // var buttonProps = JsonConvert.DeserializeObject<Dictionary<uint, string>>(props["buttons"].ToString());
|
||||
// // foreach (var kvp in buttonProps)
|
||||
// // {
|
||||
// // var split = kvp.Value.Split(':');
|
||||
// // if (split[0].Equals("source"))
|
||||
// // {
|
||||
// // var src = DeviceManager.GetDeviceForKey(split[1]) as IPresentationSource;
|
||||
// // if (src == null)
|
||||
// // {
|
||||
// // Debug.Console(0, dev, "Error: Cannot add source key '{0}'", split[1]);
|
||||
// // continue;
|
||||
// // }
|
||||
// // dev.SetCustomButtonAsSource(kvp.Key, src);
|
||||
// // }
|
||||
// // else if (split[0] == "room")
|
||||
// // {
|
||||
// // if (split[1] == "off")
|
||||
// // dev.SetCustomButtonAsRoomOff(kvp.Key);
|
||||
// // }
|
||||
// // }
|
||||
// // });
|
||||
// // }
|
||||
// // else if (devType.Equals("tsr302", StringComparison.OrdinalIgnoreCase))
|
||||
// // {
|
||||
// // uint id = Convert.ToUInt32(props.Value<string>("rfId"), 16);
|
||||
// // var parent = props.Value<string>("rfGateway");
|
||||
// // RFExGateway rf = GetGateway(parent);
|
||||
// // var sgd = props.Value<string>("sgdPath");
|
||||
|
||||
// // var hw = new Tsr302(id, rf);
|
||||
|
||||
// // //dev = new Hr150Controller(devKey, devName, hw);
|
||||
|
||||
// // //// Have to add the buttons and default source after all devices are spun up
|
||||
// // //dev.AddPostActivationAction(() =>
|
||||
// // //{
|
||||
// // // var defaultSystemKey = props.Value<string>("defaultSystemKey");
|
||||
// // // dev.SetCurrentRoom((EssentialsRoom)DeviceManager.GetDeviceForKey(defaultSystemKey));
|
||||
|
||||
// // // // Link custom buttons
|
||||
// // // var buttonProps = JsonConvert.DeserializeObject<Dictionary<uint, string>>(props["buttons"].ToString());
|
||||
// // // foreach (var kvp in buttonProps)
|
||||
// // // {
|
||||
// // // var split = kvp.Value.Split(':');
|
||||
// // // if (split[0].Equals("source"))
|
||||
// // // {
|
||||
// // // var src = DeviceManager.GetDeviceForKey(split[1]) as IPresentationSource;
|
||||
// // // if (src == null)
|
||||
// // // {
|
||||
// // // Debug.Console(0, dev, "Error: Cannot add source key '{0}'", split[1]);
|
||||
// // // continue;
|
||||
// // // }
|
||||
// // // dev.SetCustomButtonAsSource(kvp.Key, src);
|
||||
// // // }
|
||||
// // // else if (split[0] == "room")
|
||||
// // // {
|
||||
// // // if (split[1] == "off")
|
||||
// // // dev.SetCustomButtonAsRoomOff(kvp.Key);
|
||||
// // // }
|
||||
// // // }
|
||||
// // //});
|
||||
// // }
|
||||
// // }
|
||||
// // catch (Exception e)
|
||||
// // {
|
||||
// // FactoryHelper.HandleDeviceCreationError(devToken, e);
|
||||
// // }
|
||||
// // return dev;
|
||||
// // }
|
||||
|
||||
// // public static RFExGateway GetGateway(string parent)
|
||||
// // {
|
||||
// // if (parent == null)
|
||||
// // parent = "controlSystem";
|
||||
// // RFExGateway rf = null;
|
||||
// // if (parent.Equals("controlSystem", StringComparison.OrdinalIgnoreCase)
|
||||
// // || parent.Equals("processor", StringComparison.OrdinalIgnoreCase))
|
||||
// // {
|
||||
// // rf = Global.ControlSystem.ControllerRFGatewayDevice;
|
||||
// // }
|
||||
// // return rf;
|
||||
// // }
|
||||
// //}
|
||||
//}
|
||||
@@ -1,48 +0,0 @@
|
||||
//using System;
|
||||
//using Crestron.SimplSharpPro;
|
||||
//using Crestron.SimplSharpPro.UI;
|
||||
|
||||
//using Newtonsoft.Json.Linq;
|
||||
|
||||
//using PepperDash.Essentials.Core;
|
||||
//using PepperDash.Essentials.Devices;
|
||||
//using PepperDash.Core;
|
||||
|
||||
//namespace PepperDash.Essentials
|
||||
//{
|
||||
// public class TouchpanelFactory
|
||||
// {
|
||||
// public static Device Create(JToken devToken)
|
||||
// {
|
||||
// SmartGraphicsTouchpanelControllerBase dev = null;
|
||||
// try
|
||||
// {
|
||||
// var devType = devToken.Value<string>("type");
|
||||
// var devKey = devToken.Value<string>("key");
|
||||
// var devName = devToken.Value<string>("name");
|
||||
// var props = devToken["properties"];
|
||||
// if (devType.Equals("Tsw1052", StringComparison.OrdinalIgnoreCase))
|
||||
// {
|
||||
// uint ipId = Convert.ToUInt32(props.Value<string>("ipId"), 16);
|
||||
// var hw = new Tsw1052(ipId, Global.ControlSystem);
|
||||
// dev = TouchpanelControllerFactory.Create(devKey, devName, hw, props.Value<string>("sgdPath"));
|
||||
// dev.UsesSplashPage = props.Value<bool>("usesSplashPage");
|
||||
// dev.ShowDate = props.Value<bool>("showDate");
|
||||
// dev.ShowTime = props.Value<bool>("showTime");
|
||||
|
||||
// // This plugs the system key into the tp, but it won't be linked up until later
|
||||
// dev.AddPostActivationAction(() =>
|
||||
// {
|
||||
// var defaultSystemKey = props.Value<string>("defaultSystemKey");
|
||||
// dev.SetCurrentRoom((EssentialsRoom)DeviceManager.GetDeviceForKey(defaultSystemKey));
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
// catch (Exception e)
|
||||
// {
|
||||
// FactoryHelper.HandleDeviceCreationError(devToken, e);
|
||||
// }
|
||||
// return dev;
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
@@ -1,10 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharp.CrestronIO;
|
||||
using Crestron.SimplSharpPro;
|
||||
using Crestron.SimplSharpPro.CrestronThread;
|
||||
using Crestron.SimplSharpPro.Diagnostics;
|
||||
using Crestron.SimplSharp.Reflection;
|
||||
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
@@ -13,37 +15,42 @@ using PepperDash.Essentials.Devices.Common;
|
||||
using PepperDash.Essentials.DM;
|
||||
using PepperDash.Essentials.Fusion;
|
||||
using PepperDash.Essentials.Room.Config;
|
||||
using PepperDash.Essentials.Room.Cotija;
|
||||
using PepperDash.Essentials.Room.MobileControl;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace PepperDash.Essentials
|
||||
{
|
||||
public class ControlSystem : CrestronControlSystem
|
||||
{
|
||||
public class ControlSystem : CrestronControlSystem
|
||||
{
|
||||
HttpLogoServer LogoServer;
|
||||
|
||||
public ControlSystem()
|
||||
: base()
|
||||
{
|
||||
Thread.MaxNumberOfUserThreads = 400;
|
||||
Global.ControlSystem = this;
|
||||
DeviceManager.Initialize(this);
|
||||
}
|
||||
public ControlSystem()
|
||||
: base()
|
||||
{
|
||||
Thread.MaxNumberOfUserThreads = 400;
|
||||
Global.ControlSystem = this;
|
||||
DeviceManager.Initialize(this);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Git 'er goin'
|
||||
/// </summary>
|
||||
public override void InitializeSystem()
|
||||
{
|
||||
/// <summary>
|
||||
/// Entry point for the program
|
||||
/// </summary>
|
||||
public override void InitializeSystem()
|
||||
{
|
||||
DeterminePlatform();
|
||||
|
||||
//CrestronConsole.AddNewConsoleCommand(s => GoWithLoad(), "go", "Loads configuration file",
|
||||
// ConsoleAccessLevelEnum.AccessOperator);
|
||||
if (Debug.DoNotLoadOnNextBoot)
|
||||
{
|
||||
CrestronConsole.AddNewConsoleCommand(s => GoWithLoad(), "go", "Loads configuration file",
|
||||
ConsoleAccessLevelEnum.AccessOperator);
|
||||
}
|
||||
|
||||
// CrestronConsole.AddNewConsoleCommand(S => { ConfigWriter.WriteConfigFile(null); }, "writeconfig", "writes the current config to a file", ConsoleAccessLevelEnum.AccessOperator);
|
||||
CrestronConsole.AddNewConsoleCommand(s =>
|
||||
{
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "CONSOLE MESSAGE: {0}", s);
|
||||
}, "appdebugmessage", "Writes message to log", ConsoleAccessLevelEnum.AccessOperator);
|
||||
// CrestronConsole.AddNewConsoleCommand(S => { ConfigWriter.WriteConfigFile(null); }, "writeconfig", "writes the current config to a file", ConsoleAccessLevelEnum.AccessOperator);
|
||||
CrestronConsole.AddNewConsoleCommand(s =>
|
||||
{
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "CONSOLE MESSAGE: {0}", s);
|
||||
}, "appdebugmessage", "Writes message to log", ConsoleAccessLevelEnum.AccessOperator);
|
||||
|
||||
CrestronConsole.AddNewConsoleCommand(s =>
|
||||
{
|
||||
@@ -52,165 +59,284 @@ namespace PepperDash.Essentials
|
||||
},
|
||||
"listtielines", "Prints out all tie lines", ConsoleAccessLevelEnum.AccessOperator);
|
||||
|
||||
CrestronConsole.AddNewConsoleCommand(s =>
|
||||
{
|
||||
CrestronConsole.ConsoleCommandResponse
|
||||
("Current running configuration. This is the merged system and template configuration");
|
||||
CrestronConsole.ConsoleCommandResponse(Newtonsoft.Json.JsonConvert.SerializeObject
|
||||
(ConfigReader.ConfigObject, Newtonsoft.Json.Formatting.Indented));
|
||||
}, "showconfig", "Shows the current running merged config", ConsoleAccessLevelEnum.AccessOperator);
|
||||
CrestronConsole.AddNewConsoleCommand(s =>
|
||||
{
|
||||
CrestronConsole.ConsoleCommandResponse
|
||||
("Current running configuration. This is the merged system and template configuration");
|
||||
CrestronConsole.ConsoleCommandResponse(Newtonsoft.Json.JsonConvert.SerializeObject
|
||||
(ConfigReader.ConfigObject, Newtonsoft.Json.Formatting.Indented));
|
||||
}, "showconfig", "Shows the current running merged config", ConsoleAccessLevelEnum.AccessOperator);
|
||||
|
||||
CrestronConsole.AddNewConsoleCommand(s =>
|
||||
{
|
||||
CrestronConsole.ConsoleCommandResponse("This system can be found at the following URLs:\r" +
|
||||
"System URL: {0}\r" +
|
||||
"Template URL: {1}", ConfigReader.ConfigObject.SystemUrl, ConfigReader.ConfigObject.TemplateUrl);
|
||||
}, "portalinfo", "Shows portal URLS from configuration", ConsoleAccessLevelEnum.AccessOperator);
|
||||
CrestronConsole.AddNewConsoleCommand(s =>
|
||||
{
|
||||
CrestronConsole.ConsoleCommandResponse("This system can be found at the following URLs:\r" +
|
||||
"System URL: {0}\r" +
|
||||
"Template URL: {1}", ConfigReader.ConfigObject.SystemUrl, ConfigReader.ConfigObject.TemplateUrl);
|
||||
}, "portalinfo", "Shows portal URLS from configuration", ConsoleAccessLevelEnum.AccessOperator);
|
||||
|
||||
GoWithLoad();
|
||||
}
|
||||
if (!Debug.DoNotLoadOnNextBoot)
|
||||
GoWithLoad();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Determines if the program is running on a processor (appliance) or server (XiO Edge).
|
||||
/// Determines if the program is running on a processor (appliance) or server (VC-4).
|
||||
///
|
||||
/// Sets Global.FilePathPrefix based on platform
|
||||
/// </summary>
|
||||
public void DeterminePlatform()
|
||||
{
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Determining Platform....");
|
||||
|
||||
string filePathPrefix;
|
||||
|
||||
var dirSeparator = Global.DirectorySeparator;
|
||||
|
||||
var version = Crestron.SimplSharp.Reflection.Assembly.GetExecutingAssembly().GetName().Version;
|
||||
|
||||
var versionString = string.Format("{0}.{1}.{2}", version.Major, version.Minor, version.Build);
|
||||
|
||||
string directoryPrefix;
|
||||
|
||||
directoryPrefix = Crestron.SimplSharp.CrestronIO.Directory.GetApplicationRootDirectory();
|
||||
|
||||
if (CrestronEnvironment.DevicePlatform != eDevicePlatform.Server) // Handles 3-series running Windows OS
|
||||
try
|
||||
{
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Starting Essentials v{0} on 3-series Appliance", versionString);
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Determining Platform....");
|
||||
|
||||
// Check if User/ProgramX exists
|
||||
if(Directory.Exists(directoryPrefix + dirSeparator + "User"
|
||||
+ dirSeparator + string.Format("program{0}", InitialParametersClass.ApplicationNumber)))
|
||||
string filePathPrefix;
|
||||
|
||||
var dirSeparator = Global.DirectorySeparator;
|
||||
|
||||
string directoryPrefix;
|
||||
|
||||
directoryPrefix = Crestron.SimplSharp.CrestronIO.Directory.GetApplicationRootDirectory();
|
||||
|
||||
var version = Crestron.SimplSharp.Reflection.Assembly.GetExecutingAssembly().GetName().Version;
|
||||
|
||||
Global.SetAssemblyVersion(string.Format("{0}.{1}.{2}", version.Major, version.Minor, version.Build));
|
||||
|
||||
if (CrestronEnvironment.DevicePlatform != eDevicePlatform.Server) // Handles 3-series running Windows CE OS
|
||||
{
|
||||
Debug.Console(0, @"User/program{0} directory found", InitialParametersClass.ApplicationNumber);
|
||||
filePathPrefix = directoryPrefix + dirSeparator + "User"
|
||||
+ dirSeparator + string.Format("program{0}", InitialParametersClass.ApplicationNumber) + dirSeparator;
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Starting Essentials v{0} on 3-series Appliance", Global.AssemblyVersion);
|
||||
|
||||
// Check if User/ProgramX exists
|
||||
if (Directory.Exists(directoryPrefix + dirSeparator + "User"
|
||||
+ dirSeparator + string.Format("program{0}", InitialParametersClass.ApplicationNumber)))
|
||||
{
|
||||
Debug.Console(0, @"User/program{0} directory found", InitialParametersClass.ApplicationNumber);
|
||||
filePathPrefix = directoryPrefix + dirSeparator + "User"
|
||||
+ dirSeparator + string.Format("program{0}", InitialParametersClass.ApplicationNumber) + dirSeparator;
|
||||
}
|
||||
// Check if Nvram/Programx exists
|
||||
else if (Directory.Exists(directoryPrefix + dirSeparator + "Nvram"
|
||||
+ dirSeparator + string.Format("program{0}", InitialParametersClass.ApplicationNumber)))
|
||||
{
|
||||
Debug.Console(0, @"Nvram/program{0} directory found", InitialParametersClass.ApplicationNumber);
|
||||
filePathPrefix = directoryPrefix + dirSeparator + "Nvram"
|
||||
+ dirSeparator + string.Format("program{0}", InitialParametersClass.ApplicationNumber) + dirSeparator;
|
||||
}
|
||||
// If neither exists, set path to User/ProgramX
|
||||
else
|
||||
{
|
||||
Debug.Console(0, @"No previous directory found. Using User/program{0}", InitialParametersClass.ApplicationNumber);
|
||||
filePathPrefix = directoryPrefix + dirSeparator + "User"
|
||||
+ dirSeparator + string.Format("program{0}", InitialParametersClass.ApplicationNumber) + dirSeparator;
|
||||
}
|
||||
}
|
||||
// Check if Nvram/Programx exists
|
||||
else if (Directory.Exists(directoryPrefix + dirSeparator + "Nvram"
|
||||
+ dirSeparator + string.Format("program{0}", InitialParametersClass.ApplicationNumber)))
|
||||
else // Handles Linux OS (Virtual Control)
|
||||
{
|
||||
Debug.Console(0, @"Nvram/program{0} directory found", InitialParametersClass.ApplicationNumber);
|
||||
filePathPrefix = directoryPrefix + dirSeparator + "Nvram"
|
||||
+ dirSeparator + string.Format("program{0}", InitialParametersClass.ApplicationNumber) + dirSeparator;
|
||||
}
|
||||
// If neither exists, set path to User/ProgramX
|
||||
else
|
||||
{
|
||||
Debug.Console(0, @"No previous directory found. Using User/program{0}", InitialParametersClass.ApplicationNumber);
|
||||
filePathPrefix = directoryPrefix + dirSeparator + "User"
|
||||
+ dirSeparator + string.Format("program{0}", InitialParametersClass.ApplicationNumber) + dirSeparator;
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Starting Essentials v{0} on Virtual Control Server", Global.AssemblyVersion);
|
||||
|
||||
// Set path to User/
|
||||
filePathPrefix = directoryPrefix + dirSeparator + "User" + dirSeparator;
|
||||
}
|
||||
|
||||
Global.SetFilePathPrefix(filePathPrefix);
|
||||
}
|
||||
else // Handles Linux OS (Virtual Control)
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Starting Essentials v{0} on Virtual Control Server", versionString);
|
||||
|
||||
// Set path to User/
|
||||
filePathPrefix = directoryPrefix + dirSeparator + "User" + dirSeparator;
|
||||
Debug.Console(0, "Unable to Determine Platform due to Exception: {0}", e.Message);
|
||||
}
|
||||
|
||||
Global.SetFilePathPrefix(filePathPrefix);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Do it, yo
|
||||
/// </summary>
|
||||
public void GoWithLoad()
|
||||
{
|
||||
try
|
||||
{
|
||||
CrestronConsole.AddNewConsoleCommand(EnablePortalSync, "portalsync", "Loads Portal Sync",
|
||||
ConsoleAccessLevelEnum.AccessOperator);
|
||||
/// <summary>
|
||||
/// Begins the process of loading resources including plugins and configuration data
|
||||
/// </summary>
|
||||
public void GoWithLoad()
|
||||
{
|
||||
try
|
||||
{
|
||||
Debug.SetDoNotLoadOnNextBoot(false);
|
||||
|
||||
//PortalSync = new PepperDashPortalSyncClient();
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Starting Essentials load from configuration");
|
||||
|
||||
var filesReady = SetupFilesystem();
|
||||
if (filesReady)
|
||||
{
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Folder structure verified. Loading config...");
|
||||
if (!ConfigReader.LoadConfig2())
|
||||
return;
|
||||
var filesReady = SetupFilesystem();
|
||||
if (filesReady)
|
||||
{
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Checking for plugins");
|
||||
LoadPlugins();
|
||||
|
||||
Load();
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Folder structure verified. Loading config...");
|
||||
if (!ConfigReader.LoadConfig2())
|
||||
return;
|
||||
|
||||
Load();
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Essentials load complete\r" +
|
||||
"-------------------------------------------------------------");
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Console(0,
|
||||
"------------------------------------------------\r" +
|
||||
"------------------------------------------------\r" +
|
||||
"------------------------------------------------\r" +
|
||||
"Essentials file structure setup completed.\r" +
|
||||
"Please load config, sgd and ir files and\r" +
|
||||
"restart program.\r" +
|
||||
"------------------------------------------------\r" +
|
||||
"------------------------------------------------\r" +
|
||||
"------------------------------------------------");
|
||||
}
|
||||
"-------------------------------------------------------------");
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Console(0,
|
||||
@"----------------------------------------------
|
||||
------------------------------------------------
|
||||
------------------------------------------------
|
||||
Essentials file structure setup completed.
|
||||
Please load config, sgd and ir files and
|
||||
restart program.
|
||||
------------------------------------------------
|
||||
------------------------------------------------
|
||||
------------------------------------------------");
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.Console(0, "FATAL INITIALIZE ERROR. System is in an inconsistent state:\r{0}", e);
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.Console(0, "FATAL INITIALIZE ERROR. System is in an inconsistent state:\r{0}", e);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// Notify the
|
||||
// Notify the OS that the program intitialization has completed
|
||||
SystemMonitor.ProgramInitialization.ProgramInitializationComplete = true;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verifies filesystem is set up. IR, SGD, and programX folders
|
||||
/// </summary>
|
||||
bool SetupFilesystem()
|
||||
{
|
||||
Debug.Console(0, "Verifying and/or creating folder structure");
|
||||
var configDir = Global.FilePathPrefix;
|
||||
var configExists = Directory.Exists(configDir);
|
||||
if (!configExists)
|
||||
Directory.Create(configDir);
|
||||
/// <summary>
|
||||
/// Initial simple implementation. Reads user/programXX/plugins folder and
|
||||
/// use
|
||||
/// </summary>
|
||||
void LoadPlugins()
|
||||
{
|
||||
var dir = Global.FilePathPrefix + "plugins";
|
||||
if (Directory.Exists(dir))
|
||||
{
|
||||
// TODO Clear out or create localPlugins folder (maybe in program slot folder)
|
||||
|
||||
var irDir = Global.FilePathPrefix + "ir";
|
||||
if (!Directory.Exists(irDir))
|
||||
Directory.Create(irDir);
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Plugins directory found, checking for factory plugins");
|
||||
var di = new DirectoryInfo(dir);
|
||||
var zFiles = di.GetFiles("*.cplz");
|
||||
foreach (var fi in zFiles)
|
||||
{
|
||||
Debug.Console(0, "Found cplz: {0}. Unzipping into plugins directory", fi.Name);
|
||||
var result = CrestronZIP.Unzip(fi.FullName, di.FullName);
|
||||
Debug.Console(0, "UnZip Result: {0}", result.ToString());
|
||||
fi.Delete();
|
||||
}
|
||||
var files = di.GetFiles("*.dll");
|
||||
Dictionary<string, Assembly> assyList = new Dictionary<string, Assembly>();
|
||||
foreach (FileInfo fi in files)
|
||||
{
|
||||
// TODO COPY plugin to loadedPlugins folder
|
||||
// TODO LOAD that loadedPlugins dll file
|
||||
try
|
||||
{
|
||||
var assy = Assembly.LoadFrom(fi.FullName);
|
||||
var ver = assy.GetName().Version;
|
||||
var verStr = string.Format("{0}.{1}.{2}.{3}", ver.Major, ver.Minor, ver.Build, ver.Revision);
|
||||
assyList.Add(fi.FullName, assy);
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Loaded plugin file '{0}', version {1}", fi.FullName, verStr);
|
||||
}
|
||||
catch
|
||||
{
|
||||
Debug.Console(2, "Assembly {0} is not a custom assembly", fi.FullName);
|
||||
continue; //catching any load issues and continuing. There will be exceptions loading Crestron .dlls from the cplz Probably should do something different here
|
||||
}
|
||||
}
|
||||
foreach (var assy in assyList)
|
||||
{
|
||||
// iteratate this assembly's classes, looking for "LoadPlugin()" methods
|
||||
try
|
||||
{
|
||||
var types = assy.Value.GetTypes();
|
||||
foreach (var type in types)
|
||||
{
|
||||
try
|
||||
{
|
||||
var methods = type.GetMethods(BindingFlags.Public | BindingFlags.Static);
|
||||
var loadPlugin = methods.FirstOrDefault(m => m.Name.Equals("LoadPlugin"));
|
||||
if (loadPlugin != null)
|
||||
{
|
||||
Debug.Console(2, "LoadPlugin method found in {0}", type.Name);
|
||||
|
||||
var fields = type.GetFields(BindingFlags.Public | BindingFlags.Static);
|
||||
|
||||
var minimumVersion = fields.FirstOrDefault(p => p.Name.Equals("MinimumEssentialsFrameworkVersion"));
|
||||
if (minimumVersion != null)
|
||||
{
|
||||
Debug.Console(2, "MinimumEssentialsFrameworkVersion found");
|
||||
|
||||
var minimumVersionString = minimumVersion.GetValue(null) as string;
|
||||
|
||||
if (!string.IsNullOrEmpty(minimumVersionString))
|
||||
{
|
||||
var passed = Global.IsRunningMinimumVersionOrHigher(minimumVersionString);
|
||||
|
||||
if (!passed)
|
||||
{
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Error, "Plugin indicates minimum Essentials version {0}. Dependency check failed. Skipping Plugin", minimumVersionString);
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Passed plugin passed dependency check (required version {0})", minimumVersionString);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Warning, "MinimumEssentialsFrameworkVersion found but not set. Loading plugin, but your mileage may vary.");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Warning, "MinimumEssentialsFrameworkVersion not found. Loading plugin, but your mileage may vary.");
|
||||
}
|
||||
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Adding plugin: {0}", assy.Key);
|
||||
loadPlugin.Invoke(null, null);
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
Debug.Console(2, "Load Plugin not found. {0} is not a plugin assembly", assy.Value.FullName);
|
||||
continue;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
Debug.Console(2, "Assembly {0} is not a custom assembly. Types cannot be loaded.", assy.Value.FullName);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
// plugin dll will be loaded. Any classes in plugin should have a static constructor
|
||||
// that registers that class with the Core.DeviceFactory
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verifies filesystem is set up. IR, SGD, and programX folders
|
||||
/// </summary>
|
||||
bool SetupFilesystem()
|
||||
{
|
||||
Debug.Console(0, "Verifying and/or creating folder structure");
|
||||
var configDir = Global.FilePathPrefix;
|
||||
var configExists = Directory.Exists(configDir);
|
||||
if (!configExists)
|
||||
Directory.Create(configDir);
|
||||
|
||||
var irDir = Global.FilePathPrefix + "ir";
|
||||
if (!Directory.Exists(irDir))
|
||||
Directory.Create(irDir);
|
||||
|
||||
var sgdDir = Global.FilePathPrefix + "sgd";
|
||||
if (!Directory.Exists(sgdDir))
|
||||
Directory.Create(sgdDir);
|
||||
|
||||
var pluginDir = Global.FilePathPrefix + "plugins";
|
||||
if (!Directory.Exists(pluginDir))
|
||||
Directory.Create(pluginDir);
|
||||
|
||||
return configExists;
|
||||
}
|
||||
|
||||
public void EnablePortalSync(string s)
|
||||
{
|
||||
if (s.ToLower() == "enable")
|
||||
{
|
||||
CrestronConsole.ConsoleCommandResponse("Portal Sync features enabled");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public void TearDown()
|
||||
{
|
||||
Debug.Console(0, "Tearing down existing system");
|
||||
@@ -237,13 +363,13 @@ namespace PepperDash.Essentials
|
||||
DeviceManager.ActivateAll();
|
||||
|
||||
LinkSystemMonitorToAppServer();
|
||||
}
|
||||
}
|
||||
|
||||
void LinkSystemMonitorToAppServer()
|
||||
{
|
||||
var sysMon = DeviceManager.GetDeviceForKey("systemMonitor") as PepperDash.Essentials.Core.Monitoring.SystemMonitorController;
|
||||
|
||||
var appServer = DeviceManager.GetDeviceForKey("appServer") as CotijaSystemController;
|
||||
var appServer = DeviceManager.GetDeviceForKey("appServer") as MobileControlSystemController;
|
||||
|
||||
|
||||
if (sysMon != null && appServer != null)
|
||||
@@ -254,28 +380,31 @@ namespace PepperDash.Essentials
|
||||
|
||||
messenger.RegisterWithAppServer(appServer);
|
||||
|
||||
DeviceManager.AddDevice(messenger);
|
||||
DeviceManager.AddDevice(messenger);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Reads all devices from config and adds them to DeviceManager
|
||||
/// </summary>
|
||||
public void LoadDevices()
|
||||
{
|
||||
// Build the processor wrapper class
|
||||
DeviceManager.AddDevice(new PepperDash.Essentials.Core.Devices.CrestronProcessor("processor"));
|
||||
/// <summary>
|
||||
/// Reads all devices from config and adds them to DeviceManager
|
||||
/// </summary>
|
||||
public void LoadDevices()
|
||||
{
|
||||
// Build the processor wrapper class
|
||||
|
||||
DeviceManager.AddDevice(new PepperDash.Essentials.Core.Devices.CrestronProcessor("processor"));
|
||||
|
||||
|
||||
|
||||
// Add global System Monitor device
|
||||
DeviceManager.AddDevice(new PepperDash.Essentials.Core.Monitoring.SystemMonitorController("systemMonitor"));
|
||||
|
||||
foreach (var devConf in ConfigReader.ConfigObject.Devices)
|
||||
{
|
||||
foreach (var devConf in ConfigReader.ConfigObject.Devices)
|
||||
{
|
||||
|
||||
try
|
||||
{
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Creating device '{0}'", devConf.Key);
|
||||
// Skip this to prevent unnecessary warnings
|
||||
try
|
||||
{
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Creating device '{0}', type '{1}'", devConf.Key, devConf.Type);
|
||||
// Skip this to prevent unnecessary warnings
|
||||
if (devConf.Key == "processor")
|
||||
{
|
||||
if (devConf.Type.ToLower() != Global.ControlSystem.ControllerPrompt.ToLower())
|
||||
@@ -283,16 +412,35 @@ namespace PepperDash.Essentials
|
||||
"WARNING: Config file defines processor type as '{0}' but actual processor is '{1}'! Some ports may not be available",
|
||||
devConf.Type.ToUpper(), Global.ControlSystem.ControllerPrompt.ToUpper());
|
||||
|
||||
// Check if the processor is a DMPS model
|
||||
if (this.ControllerPrompt.IndexOf("dmps", StringComparison.OrdinalIgnoreCase) > -1)
|
||||
{
|
||||
Debug.Console(2, "Adding DmpsRoutingController for {0} to Device Manager.", this.ControllerPrompt);
|
||||
|
||||
var propertiesConfig = JsonConvert.DeserializeObject<DM.Config.DmpsRoutingPropertiesConfig>(devConf.Properties.ToString());
|
||||
|
||||
if(propertiesConfig == null)
|
||||
propertiesConfig = new DM.Config.DmpsRoutingPropertiesConfig();
|
||||
|
||||
var dmpsRoutingController = DmpsRoutingController.GetDmpsRoutingController("processor-avRouting", this.ControllerPrompt, propertiesConfig);
|
||||
|
||||
DeviceManager.AddDevice(dmpsRoutingController);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Console(2, "************Processor is not DMPS type***************");
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
// Try local factories first
|
||||
var newDev = DeviceFactory.GetDevice(devConf);
|
||||
// Try local factories first
|
||||
var newDev = DeviceFactory.GetDevice(devConf);
|
||||
|
||||
if (newDev == null)
|
||||
newDev = BridgeFactory.GetDevice(devConf);
|
||||
|
||||
// Then associated library factories
|
||||
// Then associated library factories
|
||||
if (newDev == null)
|
||||
newDev = PepperDash.Essentials.Core.DeviceFactory.GetDevice(devConf);
|
||||
if (newDev == null)
|
||||
@@ -301,80 +449,92 @@ namespace PepperDash.Essentials
|
||||
newDev = PepperDash.Essentials.DM.DeviceFactory.GetDevice(devConf);
|
||||
if (newDev == null)
|
||||
newDev = PepperDash.Essentials.Devices.Displays.DisplayDeviceFactory.GetDevice(devConf);
|
||||
if (newDev == null)
|
||||
newDev = PepperDash.Essentials.BridgeFactory.GetDevice(devConf);
|
||||
|
||||
//if (newDev == null) // might want to consider the ability to override an essentials "type"
|
||||
//{
|
||||
// // iterate plugin factories
|
||||
// foreach (var f in FactoryObjects)
|
||||
// {
|
||||
// var cresFactory = f as IGetCrestronDevice;
|
||||
// if (cresFactory != null)
|
||||
// {
|
||||
// newDev = cresFactory.GetDevice(devConf, this);
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
if (newDev != null)
|
||||
DeviceManager.AddDevice(newDev);
|
||||
else
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "ERROR: Cannot load unknown device type '{0}', key '{1}'.", devConf.Type, devConf.Key);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "ERROR: Creating device {0}. Skipping device. \r{1}", devConf.Key, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "All Devices Loaded.");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Helper method to load tie lines. This should run after devices have loaded
|
||||
/// </summary>
|
||||
public void LoadTieLines()
|
||||
{
|
||||
// In the future, we can't necessarily just clear here because devices
|
||||
// might be making their own internal sources/tie lines
|
||||
/// <summary>
|
||||
/// Helper method to load tie lines. This should run after devices have loaded
|
||||
/// </summary>
|
||||
public void LoadTieLines()
|
||||
{
|
||||
// In the future, we can't necessarily just clear here because devices
|
||||
// might be making their own internal sources/tie lines
|
||||
|
||||
var tlc = TieLineCollection.Default;
|
||||
//tlc.Clear();
|
||||
if (ConfigReader.ConfigObject.TieLines == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
var tlc = TieLineCollection.Default;
|
||||
//tlc.Clear();
|
||||
if (ConfigReader.ConfigObject.TieLines == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (var tieLineConfig in ConfigReader.ConfigObject.TieLines)
|
||||
{
|
||||
var newTL = tieLineConfig.GetTieLine();
|
||||
if (newTL != null)
|
||||
tlc.Add(newTL);
|
||||
}
|
||||
foreach (var tieLineConfig in ConfigReader.ConfigObject.TieLines)
|
||||
{
|
||||
var newTL = tieLineConfig.GetTieLine();
|
||||
if (newTL != null)
|
||||
tlc.Add(newTL);
|
||||
}
|
||||
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "All Tie Lines Loaded.");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Reads all rooms from config and adds them to DeviceManager
|
||||
/// </summary>
|
||||
public void LoadRooms()
|
||||
{
|
||||
if (ConfigReader.ConfigObject.Rooms == null)
|
||||
{
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Warning, "WARNING: Configuration contains no rooms");
|
||||
return;
|
||||
}
|
||||
/// <summary>
|
||||
/// Reads all rooms from config and adds them to DeviceManager
|
||||
/// </summary>
|
||||
public void LoadRooms()
|
||||
{
|
||||
if (ConfigReader.ConfigObject.Rooms == null)
|
||||
{
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Warning, "WARNING: Configuration contains no rooms");
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (var roomConfig in ConfigReader.ConfigObject.Rooms)
|
||||
{
|
||||
foreach (var roomConfig in ConfigReader.ConfigObject.Rooms)
|
||||
{
|
||||
var room = EssentialsRoomConfigHelper.GetRoomObject(roomConfig) as EssentialsRoomBase;
|
||||
if (room != null)
|
||||
{
|
||||
if (room != null)
|
||||
{
|
||||
if (room is EssentialsHuddleSpaceRoom)
|
||||
{
|
||||
DeviceManager.AddDevice(room);
|
||||
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Room is EssentialsHuddleSpaceRoom, attempting to add to DeviceManager with Fusion");
|
||||
DeviceManager.AddDevice(new EssentialsHuddleSpaceFusionSystemControllerBase((EssentialsHuddleSpaceRoom)room, 0xf1));
|
||||
DeviceManager.AddDevice(new Core.Fusion.EssentialsHuddleSpaceFusionSystemControllerBase((EssentialsHuddleSpaceRoom)room, 0xf1));
|
||||
|
||||
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Attempting to build Cotija Bridge...");
|
||||
// Cotija bridge
|
||||
var bridge = new CotijaEssentialsHuddleSpaceRoomBridge(room as EssentialsHuddleSpaceRoom);
|
||||
AddBridgePostActivationHelper(bridge); // Lets things happen later when all devices are present
|
||||
DeviceManager.AddDevice(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);
|
||||
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Cotija Bridge Added...");
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Mobile Control Bridge Added...");
|
||||
}
|
||||
else if (room is EssentialsHuddleVtc1Room)
|
||||
{
|
||||
@@ -383,60 +543,60 @@ namespace PepperDash.Essentials
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Room is EssentialsHuddleVtc1Room, attempting to add to DeviceManager with Fusion");
|
||||
DeviceManager.AddDevice(new EssentialsHuddleVtc1FusionController((EssentialsHuddleVtc1Room)room, 0xf1));
|
||||
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Attempting to build Cotija Bridge...");
|
||||
// Cotija bridge
|
||||
var bridge = new CotijaEssentialsHuddleSpaceRoomBridge(room);
|
||||
AddBridgePostActivationHelper(bridge); // Lets things happen later when all devices are present
|
||||
DeviceManager.AddDevice(bridge);
|
||||
}
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Attempting to build Mobile Control Bridge...");
|
||||
// Mobile Control bridge
|
||||
var bridge = new MobileConrolEssentialsHuddleSpaceRoomBridge(room);
|
||||
AddBridgePostActivationHelper(bridge); // Lets things happen later when all devices are present
|
||||
DeviceManager.AddDevice(bridge);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Room is NOT EssentialsRoom, attempting to add to DeviceManager w/o Fusion");
|
||||
DeviceManager.AddDevice(room);
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
}
|
||||
else
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "WARNING: Cannot create room from config, key '{0}'", roomConfig.Key);
|
||||
}
|
||||
}
|
||||
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "All Rooms Loaded.");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Helps add the post activation steps that link bridges to main controller
|
||||
/// </summary>
|
||||
/// <param name="bridge"></param>
|
||||
void AddBridgePostActivationHelper(CotijaBridgeBase bridge)
|
||||
{
|
||||
bridge.AddPostActivationAction(() =>
|
||||
{
|
||||
var parent = DeviceManager.AllDevices.FirstOrDefault(d => d.Key == "appServer") as CotijaSystemController;
|
||||
if (parent == null)
|
||||
{
|
||||
Debug.Console(0, bridge, "ERROR: Cannot connect app server room bridge. System controller not present");
|
||||
return;
|
||||
}
|
||||
Debug.Console(0, bridge, "Linking to parent controller");
|
||||
bridge.AddParent(parent);
|
||||
parent.AddBridge(bridge);
|
||||
});
|
||||
}
|
||||
/// <summary>
|
||||
/// Helps add the post activation steps that link bridges to main controller
|
||||
/// </summary>
|
||||
/// <param name="bridge"></param>
|
||||
void AddBridgePostActivationHelper(MobileControlBridgeBase bridge)
|
||||
{
|
||||
bridge.AddPostActivationAction(() =>
|
||||
{
|
||||
var parent = DeviceManager.AllDevices.FirstOrDefault(d => d.Key == "appServer") as MobileControlSystemController;
|
||||
if (parent == null)
|
||||
{
|
||||
Debug.Console(0, bridge, "ERROR: Cannot connect app server room bridge. System controller not present");
|
||||
return;
|
||||
}
|
||||
Debug.Console(0, bridge, "Linking to parent controller");
|
||||
bridge.AddParent(parent);
|
||||
parent.AddBridge(bridge);
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Fires up a logo server if not already running
|
||||
/// </summary>
|
||||
void LoadLogoServer()
|
||||
{
|
||||
try
|
||||
{
|
||||
/// <summary>
|
||||
/// Fires up a logo server if not already running
|
||||
/// </summary>
|
||||
void LoadLogoServer()
|
||||
{
|
||||
try
|
||||
{
|
||||
LogoServer = new HttpLogoServer(8080, Global.DirectorySeparator + "html" + Global.DirectorySeparator + "logo");
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "NOTICE: Logo server cannot be started. Likely already running in another program");
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "NOTICE: Logo server cannot be started. Likely already running in another program");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,6 +12,32 @@ namespace PepperDash.Essentials
|
||||
{
|
||||
public class Amplifier : Device, IRoutingSinkNoSwitching
|
||||
{
|
||||
public event SourceInfoChangeHandler CurrentSourceChange;
|
||||
|
||||
public string CurrentSourceInfoKey { get; set; }
|
||||
public SourceListItem CurrentSourceInfo
|
||||
{
|
||||
get
|
||||
{
|
||||
return _CurrentSourceInfo;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value == _CurrentSourceInfo) return;
|
||||
|
||||
var handler = CurrentSourceChange;
|
||||
|
||||
if (handler != null)
|
||||
handler(_CurrentSourceInfo, ChangeType.WillChange);
|
||||
|
||||
_CurrentSourceInfo = value;
|
||||
|
||||
if (handler != null)
|
||||
handler(_CurrentSourceInfo, ChangeType.DidChange);
|
||||
}
|
||||
}
|
||||
SourceListItem _CurrentSourceInfo;
|
||||
|
||||
public RoutingInputPort AudioIn { get; private set; }
|
||||
|
||||
public Amplifier(string key, string name)
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
|
||||
using PepperDash.Essentials.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Devices
|
||||
{
|
||||
///// <summary>
|
||||
///// This DVD class should cover most IR, one-way DVD and Bluray fuctions
|
||||
///// </summary>
|
||||
//public class OppoBluray : IrDvdBase, IDvdControls, IExtendedOutputs
|
||||
//{
|
||||
// public OppoBluray(string key, string name, IROutputPort port, string irDriverFilepath) : base(key, name, port, irDriverFilepath) { }
|
||||
|
||||
|
||||
|
||||
// public OutputsToTriListBridge GetExtendedOutputsToTriListBridge()
|
||||
// {
|
||||
// return new ExtendedDvdTriListBridge();
|
||||
// }
|
||||
|
||||
|
||||
//}
|
||||
|
||||
//public class ExtendedDvdTriListBridge : OutputsToTriListBridge
|
||||
//{
|
||||
|
||||
// public override void Link()
|
||||
// {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
|
||||
// public override void UnLink()
|
||||
// {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
//}
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
//using System;
|
||||
//using System.Collections.Generic;
|
||||
//using System.Linq;
|
||||
//using Crestron.SimplSharp;
|
||||
//using Crestron.SimplSharpPro;
|
||||
//using Crestron.SimplSharpPro.DeviceSupport;
|
||||
|
||||
//using PepperDash.Essentials.Core;
|
||||
|
||||
//namespace PepperDash.Essentials.Devices
|
||||
//{
|
||||
// public class AppleTV : Device, IHasCueActionList
|
||||
// {
|
||||
// public IrOutputPortController IrPort { get; private set; }
|
||||
|
||||
// public AppleTV(string key, string name, IROutputPort port, string irDriverFilepath)
|
||||
// : base(key, name)
|
||||
// {
|
||||
// IrPort = new IrOutputPortController("ir" + key, port, irDriverFilepath);
|
||||
// }
|
||||
|
||||
// #region IFunctionList Members
|
||||
// public List<CueActionPair> CueActionList
|
||||
// {
|
||||
// get
|
||||
// {
|
||||
// var numToIr = new Dictionary<Cue, string>
|
||||
// {
|
||||
// { CommonBoolCue.Menu, IROutputStandardCommands.IROut_MENU },
|
||||
// { CommonBoolCue.Up, IROutputStandardCommands.IROut_UP_ARROW },
|
||||
// { CommonBoolCue.Down, IROutputStandardCommands.IROut_DN_ARROW },
|
||||
// { CommonBoolCue.Left, IROutputStandardCommands.IROut_LEFT_ARROW },
|
||||
// { CommonBoolCue.Right, IROutputStandardCommands.IROut_RIGHT_ARROW },
|
||||
// { CommonBoolCue.Select, IROutputStandardCommands.IROut_ENTER }
|
||||
// };
|
||||
// var funcs = new List<CueActionPair>(numToIr.Count);
|
||||
|
||||
// foreach (var kvp in numToIr)
|
||||
// funcs.Add(new BoolCueActionPair(kvp.Key, b => IrPort.PressRelease(kvp.Value, b)));
|
||||
// return funcs;
|
||||
// }
|
||||
// }
|
||||
// #endregion
|
||||
// }
|
||||
//}
|
||||
@@ -0,0 +1,232 @@
|
||||
{
|
||||
"system": {},
|
||||
"system_url": "",
|
||||
"template_url": "",
|
||||
"template": {
|
||||
"sourceLists": {
|
||||
"default": {
|
||||
"source-2": {
|
||||
"order": 6,
|
||||
"type": "route",
|
||||
"altIcon": "Blank",
|
||||
"icon": "",
|
||||
"sourceKey": "wePresent-1",
|
||||
"includeInSourceList": true,
|
||||
"volumeControlKey": "$defaultAudio",
|
||||
"routeList": [
|
||||
{
|
||||
"sourceKey": "wePresent-1",
|
||||
"type": "audioVideo",
|
||||
"destinationKey": "$defaultAll"
|
||||
}
|
||||
]
|
||||
},
|
||||
"source-1": {
|
||||
"order": 5,
|
||||
"type": "route",
|
||||
"altIcon": "Blank",
|
||||
"icon": "",
|
||||
"sourceKey": "inRoomPc-1",
|
||||
"includeInSourceList": true,
|
||||
"volumeControlKey": "$defaultAudio",
|
||||
"routeList": [
|
||||
{
|
||||
"sourceKey": "inRoomPc-1",
|
||||
"type": "audioVideo",
|
||||
"destinationKey": "$defaultAll"
|
||||
}
|
||||
]
|
||||
},
|
||||
"roomOff": {
|
||||
"sourceKey": "$off",
|
||||
"type": "off",
|
||||
"routeList": [
|
||||
{
|
||||
"sourceKey": "$off",
|
||||
"type": "audioVideo",
|
||||
"destinationKey": "$defaultAll"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"devices": [
|
||||
{
|
||||
"name": "RMC3",
|
||||
"group": "processor",
|
||||
"properties": {
|
||||
"numberOfIrPorts": 2,
|
||||
"numberOfComPorts": 1
|
||||
},
|
||||
"supportedSystemTypes": [
|
||||
"hudType",
|
||||
"presType",
|
||||
"vtcType",
|
||||
"custom"
|
||||
],
|
||||
"type": "rmc3",
|
||||
"supportedConfigModes": [
|
||||
"compliance",
|
||||
"essentials"
|
||||
],
|
||||
"supportsCompliance": true,
|
||||
"key": "processor",
|
||||
"uid": 0
|
||||
},
|
||||
{
|
||||
"name": "Room PC",
|
||||
"key": "inRoomPc-1",
|
||||
"type": "inRoomPc",
|
||||
"group": "pc",
|
||||
"uid": 8,
|
||||
"properties": {
|
||||
"hasAudio": true,
|
||||
"hasControls": false,
|
||||
"isDefault": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Wireless Video",
|
||||
"key": "wePresent-1",
|
||||
"type": "wePresent",
|
||||
"group": "genericSource",
|
||||
"uid": 9,
|
||||
"properties": {
|
||||
"isDefault": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Samsung QM Series Display",
|
||||
"key": "display-1",
|
||||
"type": "samsungmdc",
|
||||
"group": "display",
|
||||
"uid": 11,
|
||||
"properties": {
|
||||
"id": "01",
|
||||
"control": {
|
||||
"controlPortDevKey": "processor",
|
||||
"comParams": {
|
||||
"parity": "None",
|
||||
"protocol": "RS232",
|
||||
"baudRate": 9600,
|
||||
"softwareHandshake": "None",
|
||||
"dataBits": 8,
|
||||
"hardwareHandshake": "None",
|
||||
"stopBits": 1
|
||||
},
|
||||
"controlPortNumber": 1,
|
||||
"method": "com"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "TSW-760",
|
||||
"key": "tsw760-1",
|
||||
"type": "tsw760",
|
||||
"group": "touchpanel",
|
||||
"uid": 14,
|
||||
"properties": {
|
||||
"control": {
|
||||
"method": "ipid",
|
||||
"ipid": "03",
|
||||
"params": {
|
||||
"deviceReadyResponsePattern": ".*>",
|
||||
"endOfLineString": "\n"
|
||||
}
|
||||
},
|
||||
"showVolumeGauge": true,
|
||||
"roomListKey": "",
|
||||
"showDate": true,
|
||||
"headerStyle": "Verbose",
|
||||
"sgdFile": "PepperDash Essentials TSW-760.sgd",
|
||||
"showTime": true,
|
||||
"sourcesOverflowCount": 4,
|
||||
"usesSplashPage": false,
|
||||
"defaultRoomKey": "room1"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "iPad",
|
||||
"key": "crestronApp-1",
|
||||
"type": "crestronApp",
|
||||
"group": "touchpanel",
|
||||
"uid": 15,
|
||||
"properties": {
|
||||
"control": {
|
||||
"method": "ipid",
|
||||
"ipid": "04",
|
||||
"params": {
|
||||
"deviceReadyResponsePattern": ".*>",
|
||||
"endOfLineString": "\n"
|
||||
}
|
||||
},
|
||||
"showVolumeGauge": true,
|
||||
"roomListKey": "",
|
||||
"showDate": false,
|
||||
"headerStyle": "Verbose",
|
||||
"sgdFile": "PepperDash Essentials iPad.sgd",
|
||||
"showTime": false,
|
||||
"sourcesOverflowCount": 5,
|
||||
"projectName": "PepperDash Essentials iPad",
|
||||
"defaultRoomKey": "room1",
|
||||
"usesSplashPage": false
|
||||
}
|
||||
}
|
||||
],
|
||||
"info": {
|
||||
"processorType": "rmc3",
|
||||
"lastUid": 16,
|
||||
"lastModifiedDate": "2018-02-16T17:54:41.315Z",
|
||||
"systemType": "huddle",
|
||||
"comment": "",
|
||||
"requiredControlSofwareVersion": ""
|
||||
},
|
||||
"tieLines": [
|
||||
{
|
||||
"sourceKey": "inRoomPc-1",
|
||||
"sourcePort": "anyVideoOut",
|
||||
"destinationKey": "display-1",
|
||||
"destinationPort": "HdmiIn1",
|
||||
"type": "audioVideo"
|
||||
},
|
||||
{
|
||||
"sourceKey": "wePresent-1",
|
||||
"sourcePort": "anyOut",
|
||||
"destinationKey": "display-1",
|
||||
"destinationPort": "HdmiIn2",
|
||||
"type": "audioVideo"
|
||||
}
|
||||
],
|
||||
"rooms": [
|
||||
{
|
||||
"type": "huddle",
|
||||
"name": "Essentials Huddle 2 Inputs",
|
||||
"key": "room1",
|
||||
"properties": {
|
||||
"defaultDisplayKey": "display-1",
|
||||
"logo": {
|
||||
"type": "system",
|
||||
"url": ""
|
||||
},
|
||||
"description": "Huddle Space with 2 sources. RMC3 processor. iPad + TSW-560",
|
||||
"defaultSourceItem": "source-1",
|
||||
"hasDsp": false,
|
||||
"helpMessage": "",
|
||||
"sourceListKey": "default",
|
||||
"volumes": {
|
||||
"master": {
|
||||
"level": 40,
|
||||
"deviceKey": "display-1",
|
||||
"label": "Volume"
|
||||
}
|
||||
},
|
||||
"defaultAudioKey": "display-1",
|
||||
"defaultVideoBehavior": "basic",
|
||||
"tech": {
|
||||
"password": "1234"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,387 @@
|
||||
{
|
||||
"system": {
|
||||
"rooms": [
|
||||
{
|
||||
"name": "Example Room",
|
||||
"key": "room1",
|
||||
"properties": {
|
||||
"occupancy": {
|
||||
"timeoutMinutes": "60"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"devices": [
|
||||
{
|
||||
"key": "hdMd4x14kE-1",
|
||||
"uid": 4,
|
||||
"properties": {
|
||||
"control": {
|
||||
"tcpSshProperties": {
|
||||
"address": "0.0.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"key": "mockCodec-1",
|
||||
"uid": 5,
|
||||
"properties": {
|
||||
"control": {
|
||||
"tcpSshProperties": {
|
||||
"address": "0.0.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"info": {
|
||||
"lastModifiedDate": "2019-02-26T21:08:09.195Z"
|
||||
}
|
||||
},
|
||||
"system_url": "",
|
||||
"template_url": "",
|
||||
"template": {
|
||||
"rooms": [
|
||||
{
|
||||
"type": "huddleVtc1",
|
||||
"name": "Essentials DIN-AP3 - DM4x1",
|
||||
"key": "room1",
|
||||
"properties": {
|
||||
"defaultDisplayKey": "display-1",
|
||||
"description": "",
|
||||
"helpMessage": "",
|
||||
"sourceListKey": "default",
|
||||
"defaultVideoBehavior": "basic",
|
||||
"logo": {
|
||||
"type": "system",
|
||||
"url": ""
|
||||
},
|
||||
"occupancy": {
|
||||
"timeoutMinutes": "60",
|
||||
"deviceKey": "glsOdtCCn-1"
|
||||
},
|
||||
"defaultSourceItem": "source-1",
|
||||
"videoCodecKey": "mockCodec-1",
|
||||
"hasDsp": false,
|
||||
"volumes": {
|
||||
"master": {
|
||||
"level": 40,
|
||||
"deviceKey": "mockCodec-1",
|
||||
"label": "Volume"
|
||||
}
|
||||
},
|
||||
"defaultAudioKey": "display-1",
|
||||
"tech": {
|
||||
"password": "1234"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"devices": [
|
||||
{
|
||||
"name": "DIN-AP3",
|
||||
"key": "processor",
|
||||
"type": "dinAp3",
|
||||
"group": "processor",
|
||||
"uid": 0,
|
||||
"properties": {
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Room PC",
|
||||
"key": "inRoomPc-1",
|
||||
"type": "inRoomPc",
|
||||
"properties": {
|
||||
"hasAudio": true,
|
||||
"hasControls": false,
|
||||
"isDefault": true
|
||||
},
|
||||
"group": "pc",
|
||||
"uid": 1
|
||||
},
|
||||
{
|
||||
"name": "Laptop",
|
||||
"key": "laptop-1",
|
||||
"type": "laptop",
|
||||
"properties": {
|
||||
"hasAudio": true,
|
||||
"hasControls": false
|
||||
},
|
||||
"group": "pc",
|
||||
"uid": 2
|
||||
},
|
||||
{
|
||||
"name": "Wireless Video",
|
||||
"key": "wePresent-1",
|
||||
"type": "wePresent",
|
||||
"properties": {},
|
||||
"group": "genericSource",
|
||||
"uid": 3
|
||||
},
|
||||
{
|
||||
"name": "HD-MD4x1-4k-E HDMI Switch 1",
|
||||
"key": "hdMd4x14kE-1",
|
||||
"type": "hdMd4x14kE",
|
||||
"properties": {
|
||||
"control": {
|
||||
"params": {
|
||||
"deviceReadyResponsePattern": ".*>",
|
||||
"endOfLineString": "\n"
|
||||
},
|
||||
"ipid": "10",
|
||||
"method": "ipidTcp",
|
||||
"tcpSshProperties": {
|
||||
"port": 0,
|
||||
"address": ""
|
||||
}
|
||||
},
|
||||
"parentDeviceKey": "processor",
|
||||
"inputs": {
|
||||
"hdmiIn2": {
|
||||
"disableHdcp": true
|
||||
},
|
||||
"hdmiIn3": {
|
||||
"disableHdcp": true
|
||||
},
|
||||
"hdmiIn4": {
|
||||
"disableHdcp": true
|
||||
},
|
||||
"hdmiIn1": {
|
||||
"disableHdcp": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"group": "hdMdSwitch",
|
||||
"uid": 4
|
||||
},
|
||||
{
|
||||
"name": "Mock Video Codec 1",
|
||||
"key": "mockCodec-1",
|
||||
"type": "mockVc",
|
||||
"properties": {
|
||||
"favorites": [
|
||||
{
|
||||
"name": "Corporate WebEx",
|
||||
"number": "5555555555"
|
||||
}
|
||||
]
|
||||
},
|
||||
"group": "videoCodec",
|
||||
"uid": 5
|
||||
},
|
||||
{
|
||||
"name": "Samsung MDC Protocol 1",
|
||||
"key": "display-1",
|
||||
"type": "samsungmdc",
|
||||
"properties": {
|
||||
"id": "01",
|
||||
"control": {
|
||||
"controlPortDevKey": "processor",
|
||||
"controlPortNumber": 1,
|
||||
"method": "com",
|
||||
"comParams": {
|
||||
"protocol": "RS232",
|
||||
"baudRate": 9600,
|
||||
"hardwareHandshake": "None",
|
||||
"softwareHandshake": "None",
|
||||
"dataBits": 8,
|
||||
"parity": "None",
|
||||
"stopBits": 1
|
||||
}
|
||||
}
|
||||
},
|
||||
"group": "display",
|
||||
"uid": 6
|
||||
},
|
||||
{
|
||||
"name": "Crestron GLS-ODT-C-CN 1",
|
||||
"key": "glsOdtCCn-1",
|
||||
"type": "glsOdtCCn",
|
||||
"properties": {
|
||||
"control": {
|
||||
"method": "cresnet",
|
||||
"cresnetId": "97"
|
||||
}
|
||||
},
|
||||
"group": "occupancy",
|
||||
"uid": 7
|
||||
},
|
||||
{
|
||||
"name": "TSW-760",
|
||||
"key": "tsw760-1",
|
||||
"type": "tsw760",
|
||||
"properties": {
|
||||
"control": {
|
||||
"params": {
|
||||
"deviceReadyResponsePattern": ".*>",
|
||||
"endOfLineString": "\n"
|
||||
},
|
||||
"ipid": "03",
|
||||
"method": "ipid"
|
||||
},
|
||||
"showVolumeGauge": true,
|
||||
"sourcesOverflowCount": 4,
|
||||
"showDate": true,
|
||||
"headerStyle": "Verbose",
|
||||
"sgdFile": "PepperDash Essentials TSW-760.sgd",
|
||||
"showTime": true,
|
||||
"roomListKey": "",
|
||||
"usesSplashPage": false,
|
||||
"defaultRoomKey": "room1"
|
||||
},
|
||||
"group": "touchpanel",
|
||||
"uid": 8
|
||||
},
|
||||
{
|
||||
"name": "Crestron XPanel",
|
||||
"key": "crestronApp-1",
|
||||
"type": "crestronApp",
|
||||
"properties": {
|
||||
"control": {
|
||||
"params": {
|
||||
"deviceReadyResponsePattern": ".*>",
|
||||
"endOfLineString": "\n"
|
||||
},
|
||||
"ipid": "04",
|
||||
"method": "ipid"
|
||||
},
|
||||
"showVolumeGauge": true,
|
||||
"sourcesOverflowCount": 5,
|
||||
"showDate": true,
|
||||
"headerStyle": "Verbose",
|
||||
"sgdFile": "PepperDash Essentials iPad.sgd",
|
||||
"showTime": true,
|
||||
"roomListKey": "",
|
||||
"projectName": "PepperDash Essentials iPad",
|
||||
"defaultRoomKey": "room1",
|
||||
"usesSplashPage": false
|
||||
},
|
||||
"group": "touchpanel",
|
||||
"uid": 9
|
||||
}
|
||||
],
|
||||
"info": {
|
||||
"comment": "",
|
||||
"lastUid": 10,
|
||||
"lastModifiedDate": "2018-07-02T17:41:06.550Z",
|
||||
"systemType": "huddle",
|
||||
"processorType": "dinAp3",
|
||||
"requiredControlSofwareVersion": ""
|
||||
},
|
||||
"tieLines": [
|
||||
{
|
||||
"type": "audioVideo",
|
||||
"sourceKey": "hdMd4x14kE-1",
|
||||
"destinationKey": "mockCodec-1",
|
||||
"destinationPort": "HdmiIn2",
|
||||
"sourcePort": "hdmiOut"
|
||||
},
|
||||
{
|
||||
"type": "audioVideo",
|
||||
"sourceKey": "mockCodec-1",
|
||||
"destinationKey": "display-1",
|
||||
"destinationPort": "HdmiIn1",
|
||||
"sourcePort": "HdmiOut1"
|
||||
},
|
||||
{
|
||||
"type": "audioVideo",
|
||||
"sourceKey": "laptop-1",
|
||||
"destinationKey": "hdMd4x14kE-1",
|
||||
"destinationPort": "hdmiIn1",
|
||||
"sourcePort": "anyOut"
|
||||
},
|
||||
{
|
||||
"type": "audioVideo",
|
||||
"sourceKey": "inRoomPc-1",
|
||||
"destinationKey": "mockCodec-1",
|
||||
"destinationPort": "HdmiIn3",
|
||||
"sourcePort": "anyVideoOut"
|
||||
},
|
||||
{
|
||||
"type": "audioVideo",
|
||||
"sourceKey": "wePresent-1",
|
||||
"destinationKey": "hdMd4x14kE-1",
|
||||
"destinationPort": "hdmiIn2",
|
||||
"sourcePort": "anyOut"
|
||||
}
|
||||
],
|
||||
"sourceLists": {
|
||||
"default": {
|
||||
"source-2": {
|
||||
"order": 6,
|
||||
"icon": "",
|
||||
"altIcon": "Blank",
|
||||
"type": "route",
|
||||
"sourceKey": "laptop-1",
|
||||
"includeInSourceList": true,
|
||||
"volumeControlKey": "$defaultAudio",
|
||||
"routeList": [
|
||||
{
|
||||
"type": "audioVideo",
|
||||
"sourceKey": "laptop-1",
|
||||
"destinationKey": "$defaultAll"
|
||||
}
|
||||
]
|
||||
},
|
||||
"source-3": {
|
||||
"order": 7,
|
||||
"icon": "",
|
||||
"altIcon": "Blank",
|
||||
"type": "route",
|
||||
"sourceKey": "wePresent-1",
|
||||
"includeInSourceList": true,
|
||||
"volumeControlKey": "$defaultAudio",
|
||||
"routeList": [
|
||||
{
|
||||
"type": "audioVideo",
|
||||
"sourceKey": "wePresent-1",
|
||||
"destinationKey": "$defaultAll"
|
||||
}
|
||||
]
|
||||
},
|
||||
"source-1": {
|
||||
"order": 5,
|
||||
"icon": "",
|
||||
"altIcon": "Blank",
|
||||
"type": "route",
|
||||
"sourceKey": "inRoomPc-1",
|
||||
"includeInSourceList": true,
|
||||
"volumeControlKey": "$defaultAudio",
|
||||
"routeList": [
|
||||
{
|
||||
"type": "audioVideo",
|
||||
"sourceKey": "inRoomPc-1",
|
||||
"destinationKey": "$defaultAll"
|
||||
}
|
||||
]
|
||||
},
|
||||
"roomOff": {
|
||||
"type": "off",
|
||||
"sourceKey": "$off",
|
||||
"routeList": [
|
||||
{
|
||||
"type": "audioVideo",
|
||||
"sourceKey": "$off",
|
||||
"destinationKey": "$defaultAll"
|
||||
}
|
||||
]
|
||||
},
|
||||
"codecOsd": {
|
||||
"order": 1,
|
||||
"name": "None",
|
||||
"type": "route",
|
||||
"includeInSourceList": true,
|
||||
"sourceKey": "",
|
||||
"routeList": [
|
||||
{
|
||||
"type": "audioVideo",
|
||||
"sourceKey": "mockCodec-1[osd]",
|
||||
"destinationKey": "$defaultAll"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,439 @@
|
||||
{
|
||||
"system_url": "",
|
||||
"template": {
|
||||
"info": {
|
||||
"comment": "",
|
||||
"requiredControlSofwareVersion": "",
|
||||
"systemType": "huddle",
|
||||
"lastModifiedDate": "2018-07-09T20:00:47.873Z",
|
||||
"lastUid": 23,
|
||||
"processorType": "rmc3"
|
||||
},
|
||||
"devices": [
|
||||
{
|
||||
"key": "processor",
|
||||
"group": "processor",
|
||||
"uid": 0,
|
||||
"supportsCompliance": true,
|
||||
"type": "rmc3",
|
||||
"properties": {},
|
||||
"name": "RMC3"
|
||||
},
|
||||
{
|
||||
"key": "comm-1",
|
||||
"uid": 1,
|
||||
"name": "Generic comm 1",
|
||||
"type": "genericComm",
|
||||
"group": "comm",
|
||||
"properties": {
|
||||
"control": {
|
||||
"comParams": {
|
||||
"hardwareHandshake": "None",
|
||||
"parity": "None",
|
||||
"protocol": "RS232",
|
||||
"baudRate": 9600,
|
||||
"dataBits": 8,
|
||||
"softwareHandshake": "None",
|
||||
"stopBits": 1
|
||||
},
|
||||
"controlPortNumber": 1,
|
||||
"controlPortDevKey": "processor",
|
||||
"method": "Com"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"key": "tcp-1",
|
||||
"uid": 2,
|
||||
"name": "Generic TCP 1",
|
||||
"type": "genericComm",
|
||||
"group": "comm",
|
||||
"properties": {
|
||||
"control": {
|
||||
"tcpSshProperties": {
|
||||
"username": "",
|
||||
"autoReconnect": true,
|
||||
"AutoReconnectIntervalMs": 2000,
|
||||
"port": 23,
|
||||
"address": "0.0.0.0",
|
||||
"password": ""
|
||||
},
|
||||
"method": "Tcpip"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"key": "ssh-1",
|
||||
"uid": 3,
|
||||
"name": "Generic SSH 1",
|
||||
"type": "genericComm",
|
||||
"group": "comm",
|
||||
"properties": {
|
||||
"control": {
|
||||
"tcpSshProperties": {
|
||||
"username": "crestron",
|
||||
"autoReconnect": true,
|
||||
"AutoReconnectIntervalMs": 2000,
|
||||
"port": 22,
|
||||
"address": "10.11.50.135",
|
||||
"password": "2H3Zu&OvgXp6"
|
||||
},
|
||||
"method": "Ssh"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"key": "eisc-1A",
|
||||
"uid": 4,
|
||||
"type": "eiscApi",
|
||||
"group": "api",
|
||||
"properties": {
|
||||
"control": {
|
||||
"tcpSshProperties": {
|
||||
"address": "127.0.0.2",
|
||||
"port": 0
|
||||
},
|
||||
"ipId": "1A"
|
||||
},
|
||||
"devices": [
|
||||
{
|
||||
"deviceKey": "comm-1",
|
||||
"joinStart": 3001
|
||||
},
|
||||
{
|
||||
"deviceKey": "tcp-1",
|
||||
"joinStart": 3011
|
||||
},
|
||||
{
|
||||
"deviceKey": "ssh-1",
|
||||
"joinStart": 3021
|
||||
},
|
||||
{
|
||||
"deviceKey": "dmMd8x8-1",
|
||||
"joinStart": 1
|
||||
},
|
||||
{
|
||||
"deviceKey": "dmTx201C-1",
|
||||
"joinStart": 3051
|
||||
},
|
||||
{
|
||||
"deviceKey": "dmRmc4kScalerC-1",
|
||||
"joinStart": 3061
|
||||
},
|
||||
{
|
||||
"deviceKey": "dmRmc200C-1",
|
||||
"joinStart": 3071
|
||||
},
|
||||
{
|
||||
"deviceKey": "dmRmc100C-1",
|
||||
"joinStart": 3081
|
||||
},
|
||||
{
|
||||
"deviceKey": "comm-2",
|
||||
"joinStart": 2501
|
||||
},
|
||||
{
|
||||
"deviceKey": "comm-3",
|
||||
"joinStart": 2511
|
||||
},
|
||||
{
|
||||
"deviceKey": "comm-4",
|
||||
"joinStart": 2521
|
||||
},
|
||||
{
|
||||
"deviceKey": "cec-1",
|
||||
"joinStart": 2531
|
||||
},
|
||||
{
|
||||
"deviceKey": "cec-2",
|
||||
"joinStart": 2541
|
||||
},
|
||||
{
|
||||
"deviceKey": "cec-3",
|
||||
"joinStart": 2551
|
||||
},
|
||||
{
|
||||
"deviceKey": "cec-4",
|
||||
"joinStart": 2561
|
||||
},
|
||||
{
|
||||
"deviceKey": "cec-5",
|
||||
"joinStart": 2571
|
||||
},
|
||||
{
|
||||
"deviceKey": "cec-6",
|
||||
"joinStart": 2581
|
||||
},
|
||||
{
|
||||
"deviceKey": "cec-7",
|
||||
"joinStart": 2591
|
||||
},
|
||||
{
|
||||
"deviceKey": "gls-oir-1",
|
||||
"joinStart": 2701
|
||||
},
|
||||
{
|
||||
"deviceKey": "gls-odt-1",
|
||||
"joinStart": 2751
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"key": "dmMd8x8-1",
|
||||
"uid": 5,
|
||||
"name": "DM-MD8x8 Chassis 1",
|
||||
"type": "dmMd8x8",
|
||||
"group": "dmChassis",
|
||||
"properties": {
|
||||
"control": {
|
||||
"method": "ipid",
|
||||
"ipid": "40",
|
||||
"params": {
|
||||
"endOfLineString": "\n",
|
||||
"deviceReadyResponsePattern": ".*>"
|
||||
}
|
||||
},
|
||||
"volumeControls": {},
|
||||
"inputSlots": {
|
||||
"1": "dmcHdDsp",
|
||||
"2": "dmcHdDsp",
|
||||
"3": "dmcDvi",
|
||||
"4": "dmcDvi",
|
||||
"5": "dmcC",
|
||||
"6": "dmcCDsp"
|
||||
},
|
||||
"outputSlots": {
|
||||
"1": "dmcCoHd",
|
||||
"2": "dmcCoHd"
|
||||
},
|
||||
"inputNames": {
|
||||
"1": "Input 1",
|
||||
"2": "Input 2",
|
||||
"3": "Input 3",
|
||||
"4": "Input 4",
|
||||
"5": "Input 5",
|
||||
"6": "Input 6"
|
||||
},
|
||||
"parentDeviceKey": "processor",
|
||||
"outputNames": {
|
||||
"1": "Output 1",
|
||||
"2": "Output 2",
|
||||
"3": "Output 3",
|
||||
"4": "Output 4"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"key": "dmTx201C-1",
|
||||
"uid": 6,
|
||||
"name": "DM-TX-201C 1",
|
||||
"type": "dmTx201C",
|
||||
"group": "dmEndpoint",
|
||||
"properties": {
|
||||
"control": {
|
||||
"method": "ipid",
|
||||
"ipid": "45",
|
||||
"params": {
|
||||
"endOfLineString": "\n",
|
||||
"deviceReadyResponsePattern": ".*>"
|
||||
}
|
||||
},
|
||||
"parentDeviceKey": "dmMd8x8-1",
|
||||
"parentInputNumber": "5"
|
||||
}
|
||||
},
|
||||
{
|
||||
"key": "dmRmc4kScalerC-1",
|
||||
"uid": 7,
|
||||
"name": "DM-RMC-4K-SCALER-C Out 1",
|
||||
"type": "dmRmc4kScalerC",
|
||||
"group": "dmEndpoint",
|
||||
"properties": {
|
||||
"control": {
|
||||
"method": "ipid",
|
||||
"ipid": "61",
|
||||
"params": {
|
||||
"endOfLineString": "\n",
|
||||
"deviceReadyResponsePattern": ".*>"
|
||||
}
|
||||
},
|
||||
"parentDeviceKey": "dmMd8x8-1",
|
||||
"parentOutputNumber": "1"
|
||||
}
|
||||
},
|
||||
{
|
||||
"key": "dmRmc200C-1",
|
||||
"uid": 8,
|
||||
"name": "DM-RMC-200-C Out 2",
|
||||
"type": "dmRmc200C",
|
||||
"group": "dmEndpoint",
|
||||
"properties": {
|
||||
"control": {
|
||||
"method": "ipid",
|
||||
"ipid": "62",
|
||||
"params": {
|
||||
"endOfLineString": "\n",
|
||||
"deviceReadyResponsePattern": ".*>"
|
||||
}
|
||||
},
|
||||
"parentDeviceKey": "dmMd8x8-1",
|
||||
"parentOutputNumber": "2"
|
||||
}
|
||||
},
|
||||
{
|
||||
"key": "dmRmc100C-1",
|
||||
"uid": 9,
|
||||
"name": "DM-RMC-100-C Out 3",
|
||||
"type": "dmRmc100C",
|
||||
"group": "dmEndpoint",
|
||||
"properties": {
|
||||
"control": {
|
||||
"method": "ipid",
|
||||
"ipid": "63",
|
||||
"params": {
|
||||
"endOfLineString": "\n",
|
||||
"deviceReadyResponsePattern": ".*>"
|
||||
}
|
||||
},
|
||||
"parentDeviceKey": "dmMd8x8-1",
|
||||
"parentOutputNumber": "3"
|
||||
}
|
||||
},
|
||||
{
|
||||
"key": "comm-2",
|
||||
"uid": 10,
|
||||
"name": "Rmc comm 1",
|
||||
"type": "genericComm",
|
||||
"group": "comm",
|
||||
"properties": {
|
||||
"control": {
|
||||
"comParams": {
|
||||
"hardwareHandshake": "None",
|
||||
"parity": "None",
|
||||
"protocol": "RS232",
|
||||
"baudRate": 9600,
|
||||
"dataBits": 8,
|
||||
"softwareHandshake": "None",
|
||||
"stopBits": 1
|
||||
},
|
||||
"controlPortNumber": 1,
|
||||
"controlPortDevKey": "dmRmc4kScalerC-1",
|
||||
"method": "Com"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"key": "comm-3",
|
||||
"uid": 11,
|
||||
"name": "Rmc comm 2",
|
||||
"type": "genericComm",
|
||||
"group": "comm",
|
||||
"properties": {
|
||||
"control": {
|
||||
"comParams": {
|
||||
"hardwareHandshake": "None",
|
||||
"parity": "None",
|
||||
"protocol": "RS232",
|
||||
"baudRate": 9600,
|
||||
"dataBits": 8,
|
||||
"softwareHandshake": "None",
|
||||
"stopBits": 1
|
||||
},
|
||||
"controlPortNumber": 1,
|
||||
"controlPortDevKey": "dmRmc200C-1",
|
||||
"method": "Com"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"key": "cec-1",
|
||||
"uid": 13,
|
||||
"name": "Tx 5 cec 1",
|
||||
"type": "genericComm",
|
||||
"group": "comm",
|
||||
"properties": {
|
||||
"control": {
|
||||
"controlPortName": "HdmiIn",
|
||||
"controlPortDevKey": "dmTx201C-1",
|
||||
"method": "Cec"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"key": "cec-5",
|
||||
"uid": 17,
|
||||
"name": "Rmc 1 cec 1",
|
||||
"type": "genericComm",
|
||||
"group": "comm",
|
||||
"properties": {
|
||||
"control": {
|
||||
"controlPortName": "HdmiOut",
|
||||
"controlPortDevKey": "dmRmc4kScalerC-1",
|
||||
"method": "Cec"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"key": "cec-6",
|
||||
"uid": 18,
|
||||
"name": "Dm Chassis In 1 cec 1",
|
||||
"type": "genericComm",
|
||||
"group": "comm",
|
||||
"properties": {
|
||||
"control": {
|
||||
"controlPortName": "inputCard1--hdmiIn",
|
||||
"controlPortDevKey": "dmMd8x8-1",
|
||||
"method": "Cec"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"key": "cec-7",
|
||||
"uid": 19,
|
||||
"name": "Dm Chassis Out 1 cec 1",
|
||||
"type": "genericComm",
|
||||
"group": "comm",
|
||||
"properties": {
|
||||
"control": {
|
||||
"controlPortName": "outputCard1--hdmiOut1",
|
||||
"controlPortDevKey": "dmMd8x8-1",
|
||||
"method": "Cec"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"key": "gls-oir-1",
|
||||
"uid": 19,
|
||||
"name": "GLS-OIR-CN 1",
|
||||
"type": "glsoirccn",
|
||||
"group": "occupancy",
|
||||
"properties": {
|
||||
"control": {
|
||||
"cresnetId": "41",
|
||||
"method": "cresnet"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"key": "gls-odt-1",
|
||||
"uid": 19,
|
||||
"name": "GLS-ODT-CN 1",
|
||||
"type": "glsodtccn",
|
||||
"group": "occupancy",
|
||||
"properties": {
|
||||
"control": {
|
||||
"cresnetId": "42",
|
||||
"method": "cresnet"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"rooms": [],
|
||||
"sourceLists": {},
|
||||
"tieLines": []
|
||||
},
|
||||
"template_url": "",
|
||||
"system": {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
{
|
||||
"system_url": "",
|
||||
"template": {
|
||||
"info": {
|
||||
"comment": "",
|
||||
"requiredControlSofwareVersion": "",
|
||||
"systemType": "huddle",
|
||||
"lastModifiedDate": "2018-07-09T20:00:47.873Z",
|
||||
"lastUid": 23,
|
||||
"processorType": "dmps3300c"
|
||||
},
|
||||
"devices": [
|
||||
{
|
||||
"key": "processor",
|
||||
"group": "processor",
|
||||
"uid": 0,
|
||||
"supportsCompliance": true,
|
||||
"type": "dmps3300c",
|
||||
"properties": {
|
||||
},
|
||||
"name": "DMPS3-300-C"
|
||||
},
|
||||
{
|
||||
"key": "eisc-A",
|
||||
"uid":4,
|
||||
"type": "eiscApi",
|
||||
"group":"api",
|
||||
"properties": {
|
||||
"control":{
|
||||
"tcpSshProperties":{
|
||||
"address":"127.0.0.2",
|
||||
"port":0
|
||||
},
|
||||
"ipId":"1A"
|
||||
},
|
||||
"devices": [
|
||||
{
|
||||
"deviceKey":"processor-avRouting",
|
||||
"joinStart":1
|
||||
},
|
||||
{
|
||||
"deviceKey":"processor-programAudioOutput",
|
||||
"joinStart":3001
|
||||
},
|
||||
{
|
||||
"deviceKey":"processor-aux1AudioOutput",
|
||||
"joinStart":3011
|
||||
},
|
||||
{
|
||||
"deviceKey":"processor-aux2AudioOutput",
|
||||
"joinStart":3021
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"rooms": [
|
||||
|
||||
],
|
||||
"sourceLists": {
|
||||
|
||||
},
|
||||
"tieLines": [
|
||||
]
|
||||
},
|
||||
"template_url": "",
|
||||
"system": {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
//using System;
|
||||
//using System.Collections.Generic;
|
||||
//using System.Linq;
|
||||
//using System.Text;
|
||||
//using Crestron.SimplSharp;
|
||||
//using Crestron.SimplSharpPro;
|
||||
//using Crestron.SimplSharpPro.DeviceSupport;
|
||||
|
||||
//using PepperDash.Core;
|
||||
//using PepperDash.Essentials.Core;
|
||||
//using PepperDash.Essentials.Core.Presets;
|
||||
|
||||
//namespace PepperDash.Essentials
|
||||
//{
|
||||
// /// <summary>
|
||||
// ///
|
||||
// /// </summary>
|
||||
// public abstract class DevicePageControllerBase
|
||||
// {
|
||||
|
||||
// protected BasicTriListWithSmartObject TriList;
|
||||
// protected List<BoolInputSig> FixedObjectSigs;
|
||||
|
||||
// public DevicePageControllerBase(BasicTriListWithSmartObject triList)
|
||||
// {
|
||||
// TriList = triList;
|
||||
// }
|
||||
|
||||
// public void SetVisible(bool state)
|
||||
// {
|
||||
// foreach (var sig in FixedObjectSigs)
|
||||
// {
|
||||
// Debug.Console(2, "set visible {0}={1}", sig.Number, state);
|
||||
// sig.BoolValue = state;
|
||||
// }
|
||||
// CustomSetVisible(state);
|
||||
// }
|
||||
|
||||
// /// <summary>
|
||||
// /// Add any specialized show/hide logic here - beyond FixedObjectSigs. Overriding
|
||||
// /// methods do not need to call this base method
|
||||
// /// </summary>
|
||||
// protected virtual void CustomSetVisible(bool state)
|
||||
// {
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
@@ -1,308 +0,0 @@
|
||||
//using System;
|
||||
//using System.Collections.Generic;
|
||||
//using System.Linq;
|
||||
//using Crestron.SimplSharp;
|
||||
//using Crestron.SimplSharpPro;
|
||||
//using Crestron.SimplSharpPro.DeviceSupport;
|
||||
//using Crestron.SimplSharpPro.UI;
|
||||
|
||||
//using PepperDash.Core;
|
||||
|
||||
|
||||
//namespace PepperDash.Essentials.Core
|
||||
//{
|
||||
// /// <summary>
|
||||
// ///
|
||||
// /// </summary>
|
||||
// public class LargeTouchpanelControllerBase : SmartGraphicsTouchpanelControllerBase
|
||||
// {
|
||||
// public string PresentationShareButtonInVideoText = "Share";
|
||||
// public string PresentationShareButtonNotInVideoText = "Presentation";
|
||||
|
||||
// SourceListSubpageReferenceList SourceSelectSRL;
|
||||
// DevicePageControllerBase CurrentPresentationSourcePageController;
|
||||
|
||||
// public LargeTouchpanelControllerBase(string key, string name,
|
||||
// BasicTriListWithSmartObject triList, string sgdFilePath)
|
||||
// : base(key, name, triList, sgdFilePath)
|
||||
// {
|
||||
// }
|
||||
|
||||
// /// <summary>
|
||||
// /// Static factory method
|
||||
// /// </summary>
|
||||
// public static LargeTouchpanelControllerBase GetController(string key, string name,
|
||||
// string type, CrestronTswPropertiesConfig props)
|
||||
// {
|
||||
// var id = Convert.ToUInt32(props.IpId, 16);
|
||||
// type = type.ToLower();
|
||||
// Tswx52ButtonVoiceControl tsw = null;
|
||||
// if (type == "tsw752")
|
||||
// tsw = new Tsw752(id, Global.ControlSystem);
|
||||
// else if (type == "tsw1052")
|
||||
// tsw = new Tsw1052(id, Global.ControlSystem);
|
||||
// else
|
||||
// {
|
||||
// Debug.Console(0, "WARNING: Cannot create TSW controller with type '{0}'", type);
|
||||
// return null;
|
||||
// }
|
||||
|
||||
// var sgdPath = string.Format(@"\NVRAM\Program{0}\SGD\{1}",
|
||||
// InitialParametersClass.ApplicationNumber, props.SgdFile);
|
||||
// var controller = new LargeTouchpanelControllerBase(key, name, tsw, sgdPath);
|
||||
// controller.UsesSplashPage = props.UsesSplashPage;
|
||||
|
||||
// // Get the room and add it after everthing is ready
|
||||
// var room = DeviceManager.GetDeviceForKey(props.DefaultRoomKey) as EssentialsRoom;
|
||||
// controller.AddPostActivationAction(() =>
|
||||
// {
|
||||
// controller.SetCurrentRoom(room);
|
||||
|
||||
// });
|
||||
|
||||
// return controller;
|
||||
// }
|
||||
|
||||
// public override bool CustomActivate()
|
||||
// {
|
||||
// var baseSuccess = base.CustomActivate();
|
||||
// if (!baseSuccess) return false;
|
||||
|
||||
// SourceSelectSRL = new SourceListSubpageReferenceList(this.TriList, n =>
|
||||
// { if (CurrentRoom != null) CurrentRoom.SelectSource(n); });
|
||||
|
||||
// var lm = Global.LicenseManager;
|
||||
// if (lm != null)
|
||||
// {
|
||||
// lm.LicenseIsValid.LinkInputSig(TriList.BooleanInput[UiCue.ShowLicensed.Number]);
|
||||
// //others
|
||||
// }
|
||||
|
||||
// // Wire up buttons
|
||||
// TriList.SetSigFalseAction(15003, () => SetMainMode(eMainModeType.Presentation));
|
||||
// TriList.SetSigFalseAction(15008, PowerOffWithConfirmPressed);
|
||||
// TriList.SetSigFalseAction(15101, () => SetMainMode(eMainModeType.Presentation));
|
||||
// TriList.SetSigFalseAction(15013, ShowHelp);
|
||||
// TriList.SetSigFalseAction(15014, () => SetMainMode(eMainModeType.Tech));
|
||||
|
||||
// // Temp things -----------------------------------------------------------------------
|
||||
// TriList.StringInput[UiCue.SplashMessage.Number].StringValue = SplashMessage;
|
||||
// //------------------------------------------------------------------------------------
|
||||
|
||||
// // Initialize initial view
|
||||
// ShowSplashOrMain();
|
||||
// return true;
|
||||
// }
|
||||
|
||||
// /// <summary>
|
||||
// /// In Essentials, this should NEVER be called, since it's a one-room solution
|
||||
// /// </summary>
|
||||
// protected override void HideRoomUI()
|
||||
// {
|
||||
// // UI Cleanup here????
|
||||
|
||||
// //SwapAudioDeviceControls(CurrentRoom.CurrentAudioDevice, null);
|
||||
// //CurrentRoom.AudioDeviceWillChange -= CurrentRoom_AudioDeviceWillChange;
|
||||
|
||||
// CurrentRoom.IsCoolingDownFeedback.OutputChange -= CurrentRoom_IsCoolingDown_OutputChange;
|
||||
// CurrentRoom.IsWarmingUpFeedback.OutputChange -= CurrentRoom_IsWarmingUp_OutputChange;
|
||||
|
||||
// SourceSelectSRL.DetachFromCurrentRoom();
|
||||
// }
|
||||
|
||||
// /// <summary>
|
||||
// /// Ties this panel controller to the Room and gets updates.
|
||||
// /// </summary>
|
||||
// protected override void ShowRoomUI()
|
||||
// {
|
||||
// Debug.Console(1, this, "connecting to system '{0}'", CurrentRoom.Key);
|
||||
|
||||
// TriList.StringInput[RoomCue.Name.Number].StringValue = CurrentRoom.Name;
|
||||
// TriList.StringInput[RoomCue.Description.Number].StringValue = CurrentRoom.Description;
|
||||
|
||||
// CurrentRoom.IsCoolingDownFeedback.OutputChange -= CurrentRoom_IsCoolingDown_OutputChange;
|
||||
// CurrentRoom.IsWarmingUpFeedback.OutputChange -= CurrentRoom_IsWarmingUp_OutputChange;
|
||||
// CurrentRoom.IsCoolingDownFeedback.OutputChange += CurrentRoom_IsCoolingDown_OutputChange;
|
||||
// CurrentRoom.IsWarmingUpFeedback.OutputChange += CurrentRoom_IsWarmingUp_OutputChange;
|
||||
|
||||
// SourceSelectSRL.AttachToRoom(CurrentRoom);
|
||||
// }
|
||||
|
||||
// void CurrentRoom_IsCoolingDown_OutputChange(object sender, EventArgs e)
|
||||
// {
|
||||
// Debug.Console(2, this, "Received room in cooldown={0}", CurrentRoom.IsCoolingDownFeedback.BoolValue);
|
||||
// if (CurrentRoom.IsCoolingDownFeedback.BoolValue) // When entering cooldown
|
||||
// {
|
||||
// // Do we need to check for an already-running cooldown - like in the case of room switches?
|
||||
// new ModalDialog(TriList).PresentModalTimerDialog(0, "Power Off", "Power", "Please wait, shutting down",
|
||||
// "", "", CurrentRoom.CooldownTime, true, b =>
|
||||
// {
|
||||
// ShowSplashOrMain();
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
|
||||
// void CurrentRoom_IsWarmingUp_OutputChange(object sender, EventArgs e)
|
||||
// {
|
||||
// Debug.Console(2, this, "Received room in warmup={0}", CurrentRoom.IsWarmingUpFeedback.BoolValue);
|
||||
// if (CurrentRoom.IsWarmingUpFeedback.BoolValue) // When entering warmup
|
||||
// {
|
||||
// // Do we need to check for an already-running cooldown - like in the case of room switches?
|
||||
// new ModalDialog(TriList).PresentModalTimerDialog(0, "Power On", "Power", "Please wait, powering on",
|
||||
// "", "", CurrentRoom.WarmupTime, false, b =>
|
||||
// {
|
||||
// // Reveal sources - or has already been done behind modal
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
|
||||
// // Handler for source change events.
|
||||
// void CurrentRoom_PresentationSourceChange(object sender, EssentialsRoomSourceChangeEventArgs args)
|
||||
// {
|
||||
// // Put away the old source and set up the new source.
|
||||
// Debug.Console(2, this, "Received source change={0}", args.NewSource != null ? args.NewSource.SourceKey : "none");
|
||||
|
||||
// // If we're in tech, don't switch screen modes. Add any other modes we may want to switch away from
|
||||
// // inside the if below.
|
||||
// if (MainMode == eMainModeType.Splash)
|
||||
// SetMainMode(eMainModeType.Presentation);
|
||||
// SetControlSource(args.NewSource);
|
||||
// }
|
||||
|
||||
// //***********************************************************************
|
||||
// //** UI Manipulation
|
||||
// //***********************************************************************
|
||||
|
||||
// /// <summary>
|
||||
// /// Shows the splash page or the main presentation page, depending on config setting
|
||||
// /// </summary>
|
||||
// void ShowSplashOrMain()
|
||||
// {
|
||||
// if (UsesSplashPage)
|
||||
// SetMainMode(eMainModeType.Splash);
|
||||
// else
|
||||
// SetMainMode(eMainModeType.Presentation);
|
||||
// }
|
||||
|
||||
// /// <summary>
|
||||
// /// Switches between main modes
|
||||
// /// </summary>
|
||||
// void SetMainMode(eMainModeType mode)
|
||||
// {
|
||||
// MainMode = mode;
|
||||
// switch (mode)
|
||||
// {
|
||||
// case eMainModeType.Presentation:
|
||||
// TriList.BooleanInput[UiCue.VisibleCommonFooter.Number].BoolValue = true;
|
||||
// TriList.BooleanInput[UiCue.VisibleCommonHeader.Number].BoolValue = true;
|
||||
// TriList.BooleanInput[UiCue.VisibleSplash.Number].BoolValue = false;
|
||||
// TriList.BooleanInput[UiCue.VisiblePresentationSourceList.Number].BoolValue = true;
|
||||
// ShowCurrentPresentationSourceUi();
|
||||
// break;
|
||||
// case eMainModeType.Splash:
|
||||
// TriList.BooleanInput[UiCue.VisibleCommonFooter.Number].BoolValue = false;
|
||||
// TriList.BooleanInput[UiCue.VisibleCommonHeader.Number].BoolValue = false;
|
||||
// TriList.BooleanInput[UiCue.VisiblePresentationSourceList.Number].BoolValue = false;
|
||||
// TriList.BooleanInput[UiCue.VisibleSplash.Number].BoolValue = true;
|
||||
// HideCurrentPresentationSourceUi();
|
||||
// break;
|
||||
// case eMainModeType.Tech:
|
||||
// new ModalDialog(TriList).PresentModalTimerDialog(1, "Tech page", "Info",
|
||||
// "Tech page will be here soon!<br>I promise",
|
||||
// "Bueno!", "", 0, false, null);
|
||||
// MainMode = eMainModeType.Presentation;
|
||||
// break;
|
||||
// default:
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
|
||||
// /// <summary>
|
||||
// ///
|
||||
// /// </summary>
|
||||
// void PowerOffWithConfirmPressed()
|
||||
// {
|
||||
// if (CurrentRoom == null)
|
||||
// return;
|
||||
// if (!CurrentRoom.RoomIsOnFeedback.BoolValue)
|
||||
// return;
|
||||
// // Timeout or button 1 press will shut down
|
||||
// var modal = new ModalDialog(TriList);
|
||||
// uint seconds = CurrentRoom.UnattendedShutdownTimeMs / 1000;
|
||||
// var message = string.Format("Meeting will end in {0} seconds", seconds);
|
||||
// modal.PresentModalTimerDialog(2, "End Meeting", "Info", message,
|
||||
// "End Meeting Now", "Cancel", CurrentRoom.UnattendedShutdownTimeMs, true,
|
||||
// but => { if (but != 2) CurrentRoom.RoomOff(); });
|
||||
// }
|
||||
|
||||
// /// <summary>
|
||||
// /// Reveals the basic UI for the current device
|
||||
// /// </summary>
|
||||
// protected override void ShowCurrentPresentationSourceUi()
|
||||
// {
|
||||
// if (MainMode == eMainModeType.Splash && CurrentRoom.RoomIsOnFeedback.BoolValue)
|
||||
// SetMainMode(eMainModeType.Presentation);
|
||||
|
||||
// if (CurrentPresentationControlDevice == null)
|
||||
// {
|
||||
// // If system is off, do one thing
|
||||
|
||||
// // Otherwise, do something else - shouldn't be in this condition
|
||||
|
||||
// return;
|
||||
// }
|
||||
|
||||
// // If a controller is already loaded, use it
|
||||
// if (LoadedPageControllers.ContainsKey(CurrentPresentationControlDevice))
|
||||
// CurrentPresentationSourcePageController = LoadedPageControllers[CurrentPresentationControlDevice];
|
||||
// else
|
||||
// {
|
||||
// // This is by no means optimal, but for now....
|
||||
// if (CurrentPresentationControlDevice.Type == PresentationSourceType.SetTopBox
|
||||
// && CurrentPresentationControlDevice is ISetTopBoxControls)
|
||||
// CurrentPresentationSourcePageController = new PageControllerLargeSetTopBoxGeneric(TriList,
|
||||
// CurrentPresentationControlDevice as ISetTopBoxControls);
|
||||
|
||||
// else if (CurrentPresentationControlDevice.Type == PresentationSourceType.Laptop)
|
||||
// CurrentPresentationSourcePageController = new PageControllerLaptop(TriList);
|
||||
|
||||
// // separate these...
|
||||
// else if (CurrentPresentationControlDevice.Type == PresentationSourceType.Dvd)
|
||||
// CurrentPresentationSourcePageController =
|
||||
// new PageControllerLargeDvd(TriList, CurrentPresentationControlDevice as IDiscPlayerControls);
|
||||
|
||||
// else
|
||||
// CurrentPresentationSourcePageController = null;
|
||||
|
||||
// // Save it.
|
||||
// if (CurrentPresentationSourcePageController != null)
|
||||
// LoadedPageControllers[CurrentPresentationControlDevice] = CurrentPresentationSourcePageController;
|
||||
// }
|
||||
|
||||
// if (CurrentPresentationSourcePageController != null)
|
||||
// CurrentPresentationSourcePageController.SetVisible(true);
|
||||
// }
|
||||
|
||||
// protected override void HideCurrentPresentationSourceUi()
|
||||
// {
|
||||
// if (CurrentPresentationControlDevice != null && CurrentPresentationSourcePageController != null)
|
||||
// CurrentPresentationSourcePageController.SetVisible(false);
|
||||
// }
|
||||
|
||||
|
||||
|
||||
// void ShowHelp()
|
||||
// {
|
||||
// new ModalDialog(TriList).PresentModalTimerDialog(1, "Help", "Help", CurrentRoom.HelpMessage,
|
||||
// "OK", "", 0, false, null);
|
||||
// }
|
||||
|
||||
// protected void ListSmartObjects()
|
||||
// {
|
||||
// Debug.Console(0, this, "Smart objects IDs:");
|
||||
// var list = TriList.SmartObjects.OrderBy(s => s.Key);
|
||||
// foreach (var kvp in list)
|
||||
// Debug.Console(0, " {0}", kvp.Key);
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
@@ -1,28 +0,0 @@
|
||||
//using System;
|
||||
//using System.Collections.Generic;
|
||||
//using System.Linq;
|
||||
//using System.Text;
|
||||
//using Crestron.SimplSharp;
|
||||
//using Crestron.SimplSharpPro;
|
||||
//using Crestron.SimplSharpPro.DeviceSupport;
|
||||
|
||||
//using PepperDash.Core;
|
||||
//using PepperDash.Essentials.Core;
|
||||
//using PepperDash.Essentials.Core.Presets;
|
||||
|
||||
|
||||
//namespace PepperDash.Essentials
|
||||
//{
|
||||
// public class PageControllerLaptop : DevicePageControllerBase
|
||||
// {
|
||||
// public PageControllerLaptop(BasicTriListWithSmartObject tl)
|
||||
// : base(tl)
|
||||
// {
|
||||
// FixedObjectSigs = new List<BoolInputSig>
|
||||
// {
|
||||
// tl.BooleanInput[10092], // well
|
||||
// tl.BooleanInput[11001] // Laptop info
|
||||
// };
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
@@ -1,46 +0,0 @@
|
||||
//using System;
|
||||
//using System.Collections.Generic;
|
||||
//using System.Linq;
|
||||
//using System.Text;
|
||||
//using Crestron.SimplSharp;
|
||||
//using Crestron.SimplSharpPro;
|
||||
//using Crestron.SimplSharpPro.DeviceSupport;
|
||||
|
||||
//using PepperDash.Core;
|
||||
//using PepperDash.Essentials.Core;
|
||||
//using PepperDash.Essentials.Core.Presets;
|
||||
|
||||
//namespace PepperDash.Essentials
|
||||
//{
|
||||
// /// <summary>
|
||||
// ///
|
||||
// /// </summary>
|
||||
// public class PageControllerLargeDvd : DevicePageControllerBase
|
||||
// {
|
||||
// IDiscPlayerControls Device;
|
||||
|
||||
// public PageControllerLargeDvd(BasicTriListWithSmartObject tl, IDiscPlayerControls device)
|
||||
// : base(tl)
|
||||
// {
|
||||
|
||||
// Device = device;
|
||||
// FixedObjectSigs = new List<BoolInputSig>
|
||||
// {
|
||||
// tl.BooleanInput[10093], // well
|
||||
// tl.BooleanInput[10411], // DVD Dpad
|
||||
// tl.BooleanInput[10412] // everything else
|
||||
// };
|
||||
// }
|
||||
|
||||
// protected override void CustomSetVisible(bool state)
|
||||
// {
|
||||
// // Hook up smart objects if applicable
|
||||
// if (Device != null)
|
||||
// {
|
||||
//#warning rewire this
|
||||
// //var uos = (Device as IHasCueActionList).CueActionList;
|
||||
// //SmartObjectHelper.LinkDpadWithUserObjects(TriList, 10411, uos, state);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
@@ -1,139 +0,0 @@
|
||||
//using System;
|
||||
//using System.Collections.Generic;
|
||||
//using System.Linq;
|
||||
//using System.Text;
|
||||
//using Crestron.SimplSharp;
|
||||
//using Crestron.SimplSharpPro;
|
||||
//using Crestron.SimplSharpPro.DeviceSupport;
|
||||
|
||||
//using PepperDash.Essentials.Core.Presets;
|
||||
|
||||
//using PepperDash.Core;
|
||||
//using PepperDash.Essentials.Core;
|
||||
|
||||
//namespace PepperDash.Essentials
|
||||
//{
|
||||
|
||||
// public class PageControllerLargeSetTopBoxGeneric : DevicePageControllerBase
|
||||
// {
|
||||
// // To-DO: Add properties for component subpage names. DpadPos1, DpadPos2...
|
||||
// // Derived classes can then insert special subpages for variations on given
|
||||
// // device types. Like DirecTV vs Comcast
|
||||
|
||||
// public uint DpadSmartObjectId { get; set; }
|
||||
// public uint NumberPadSmartObjectId { get; set; }
|
||||
// public uint PresetsSmartObjectId { get; set; }
|
||||
// public uint Position5TabsId { get; set; }
|
||||
|
||||
// ISetTopBoxControls Device;
|
||||
// DevicePresetsView PresetsView;
|
||||
|
||||
|
||||
// bool ShowPosition5Tabs;
|
||||
// uint CurrentVisiblePosition5Item = 1;
|
||||
// Dictionary<uint, uint> Position5SubpageJoins = new Dictionary<uint, uint>
|
||||
// {
|
||||
// { 1, 10053 },
|
||||
// { 2, 10054 }
|
||||
// };
|
||||
|
||||
// public PageControllerLargeSetTopBoxGeneric(BasicTriListWithSmartObject tl, ISetTopBoxControls device)
|
||||
// : base(tl)
|
||||
// {
|
||||
// Device = device;
|
||||
// DpadSmartObjectId = 10011;
|
||||
// NumberPadSmartObjectId = 10014;
|
||||
// PresetsSmartObjectId = 10012;
|
||||
// Position5TabsId = 10081;
|
||||
|
||||
// bool dpad = device is IDPad;
|
||||
// bool preset = device.HasPresets;
|
||||
// bool dvr = device.HasDvr;
|
||||
// bool numbers = device is INumericKeypad;
|
||||
// uint[] joins = null;
|
||||
|
||||
// if (dpad && !preset && !dvr && !numbers) joins = new uint[] { 10031, 10091 };
|
||||
// else if (!dpad && preset && !dvr && !numbers) joins = new uint[] { 10032, 10091 };
|
||||
// else if (!dpad && !preset && dvr && !numbers) joins = new uint[] { 10033, 10091 };
|
||||
// else if (!dpad && !preset && !dvr && numbers) joins = new uint[] { 10034, 10091 };
|
||||
|
||||
// else if (dpad && preset && !dvr && !numbers) joins = new uint[] { 10042, 10021, 10092 };
|
||||
// else if (dpad && !preset && dvr && !numbers) joins = new uint[] { 10043, 10021, 10092 };
|
||||
// else if (dpad && !preset && !dvr && numbers) joins = new uint[] { 10044, 10021, 10092 };
|
||||
// else if (!dpad && preset && dvr && !numbers) joins = new uint[] { 10043, 10022, 10092 };
|
||||
// else if (!dpad && preset && !dvr && numbers) joins = new uint[] { 10044, 10022, 10092 };
|
||||
// else if (!dpad && !preset && dvr && numbers) joins = new uint[] { 10044, 10023, 10092 };
|
||||
|
||||
// else if (dpad && preset && dvr && !numbers) joins = new uint[] { 10053, 10032, 10011, 10093 };
|
||||
// else if (dpad && preset && !dvr && numbers) joins = new uint[] { 10054, 10032, 10011, 10093 };
|
||||
// else if (dpad && !preset && dvr && numbers) joins = new uint[] { 10054, 10033, 10011, 10093 };
|
||||
// else if (!dpad && preset && dvr && numbers) joins = new uint[] { 10054, 10033, 10012, 10093 };
|
||||
|
||||
// else if (dpad && preset && dvr && numbers)
|
||||
// {
|
||||
// joins = new uint[] { 10081, 10032, 10011, 10093 }; // special case
|
||||
// ShowPosition5Tabs = true;
|
||||
// }
|
||||
// // Project the joins into corresponding sigs.
|
||||
// FixedObjectSigs = joins.Select(u => TriList.BooleanInput[u]).ToList();
|
||||
|
||||
// // Build presets
|
||||
// if (device.HasPresets)
|
||||
// {
|
||||
// PresetsView = new DevicePresetsView(tl, device.PresetsModel);
|
||||
// }
|
||||
// }
|
||||
|
||||
// protected override void CustomSetVisible(bool state)
|
||||
// {
|
||||
// if (ShowPosition5Tabs)
|
||||
// {
|
||||
// // Show selected tab
|
||||
// TriList.BooleanInput[Position5SubpageJoins[CurrentVisiblePosition5Item]].BoolValue = state;
|
||||
|
||||
// var tabSo = TriList.SmartObjects[Position5TabsId];
|
||||
// if (state) // Link up the tab object
|
||||
// {
|
||||
// tabSo.BooleanOutput["Tab Button 1 Press"].UserObject = new Action<bool>(b => ShowTab(1));
|
||||
// tabSo.BooleanOutput["Tab Button 2 Press"].UserObject = new Action<bool>(b => ShowTab(2));
|
||||
// }
|
||||
// else // Disco tab object
|
||||
// {
|
||||
// tabSo.BooleanOutput["Tab Button 1 Press"].UserObject = null;
|
||||
// tabSo.BooleanOutput["Tab Button 2 Press"].UserObject = null;
|
||||
// }
|
||||
// }
|
||||
|
||||
// // Hook up smart objects if applicable
|
||||
//#warning hook these up
|
||||
// //if (Device is IHasCueActionList)
|
||||
// //{
|
||||
// // var uos = (Device as IHasCueActionList).CueActionList;
|
||||
// // SmartObjectHelper.LinkDpadWithUserObjects(TriList, DpadSmartObjectId, uos, state);
|
||||
// // SmartObjectHelper.LinkNumpadWithUserObjects(TriList, NumberPadSmartObjectId,
|
||||
// // uos, CommonBoolCue.Dash, CommonBoolCue.Last, state);
|
||||
// //}
|
||||
|
||||
|
||||
// // Link, unlink presets
|
||||
// if (Device.HasPresets && state)
|
||||
// PresetsView.Attach();
|
||||
// else if (Device.HasPresets && !state)
|
||||
// PresetsView.Detach();
|
||||
// }
|
||||
|
||||
// void ShowTab(uint number)
|
||||
// {
|
||||
// // Ignore re-presses
|
||||
// if (CurrentVisiblePosition5Item == number) return;
|
||||
// // Swap subpage
|
||||
// var bi = TriList.BooleanInput;
|
||||
// if (CurrentVisiblePosition5Item > 0)
|
||||
// bi[Position5SubpageJoins[CurrentVisiblePosition5Item]].BoolValue = false;
|
||||
// CurrentVisiblePosition5Item = number;
|
||||
// bi[Position5SubpageJoins[CurrentVisiblePosition5Item]].BoolValue = true;
|
||||
|
||||
// // Show feedback on buttons
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
@@ -1,43 +0,0 @@
|
||||
//using System;
|
||||
//using System.Collections.Generic;
|
||||
//using System.Linq;
|
||||
//using System.Text;
|
||||
//using Crestron.SimplSharp;
|
||||
|
||||
//namespace PepperDash.Essentials.Core
|
||||
//{
|
||||
// public class UiCue
|
||||
// {
|
||||
// public static readonly Cue VisibleSystemInit = Cue.BoolCue("VisibleSystemInit", 15001);
|
||||
// public static readonly Cue VisibleSplash = Cue.BoolCue("VisibleSplash", 15002);
|
||||
// public static readonly Cue PressSplash = Cue.BoolCue("PressSplash", 15003);
|
||||
// public static readonly Cue PressRoomOn = Cue.BoolCue("PressRoomOn", 15006);
|
||||
// public static readonly Cue PressRoomOff = Cue.BoolCue("PressRoomOff", 15007);
|
||||
// public static readonly Cue PressRoomOffWithConfirm = Cue.BoolCue("PressRoomOffWithConfirm", 15008);
|
||||
// public static readonly Cue VisibleCommonHeader = Cue.BoolCue("PressPowerOffConfirm", 15011);
|
||||
// public static readonly Cue VisibleCommonFooter = Cue.BoolCue("VisibleCommonFooter", 15012);
|
||||
// public static readonly Cue PressHelp = Cue.BoolCue("PressHelp", 15013);
|
||||
// public static readonly Cue PressSettings = Cue.BoolCue("PressSettings", 15014);
|
||||
|
||||
// public static readonly Cue ShowDate = Cue.BoolCue("PressSettings", 15015);
|
||||
// public static readonly Cue ShowTime = Cue.BoolCue("PressSettings", 15016);
|
||||
// public static readonly Cue ShowLicensed = Cue.BoolCue("PressSettings", 15017);
|
||||
// public static readonly Cue ShowUnLicensed = Cue.BoolCue("PressSettings", 15018);
|
||||
|
||||
// public static readonly Cue PressModePresentationShare = Cue.BoolCue("PressModePresentationShare", 15101);
|
||||
// public static readonly Cue PressModeVideoConf = Cue.BoolCue("PressModeVideoConf", 15102);
|
||||
// public static readonly Cue PressModeAudioConf = Cue.BoolCue("PressModeAudioConf", 15103);
|
||||
|
||||
// public static readonly Cue VisiblePresentationSourceList = Cue.BoolCue("VisiblePresentationSourceList", 15111);
|
||||
// public static readonly Cue VisibleSystemIsOff = Cue.BoolCue("VisibleSystemIsOff", 15112);
|
||||
|
||||
// public static readonly Cue VisibleAudioConfPopover = Cue.BoolCue("VisibleAudioConfPopover", 15201);
|
||||
|
||||
// public static readonly Cue VisibleVideoConfPopover = Cue.BoolCue("VisibleVideoConfPopover", 15251);
|
||||
|
||||
// public static readonly Cue TextRoomName = Cue.BoolCue("TextRoomName", 4001);
|
||||
// public static readonly Cue TextPresentationShareButton = Cue.BoolCue("TextPresentationShareButton", 4011);
|
||||
|
||||
// public static readonly Cue SplashMessage = Cue.StringCue("SplashMessage", 2101);
|
||||
// }
|
||||
//}
|
||||
@@ -1,318 +0,0 @@
|
||||
//using System;
|
||||
//using System.Collections.Generic;
|
||||
//using System.Linq;
|
||||
//using Crestron.SimplSharp;
|
||||
//using Crestron.SimplSharpPro;
|
||||
//using Crestron.SimplSharpPro.DeviceSupport;
|
||||
|
||||
|
||||
//namespace PepperDash.Essentials.Core
|
||||
//{
|
||||
// public abstract class SmartGraphicsTouchpanelControllerBase : CrestronGenericBaseDevice
|
||||
// {
|
||||
// public BasicTriListWithSmartObject TriList { get; protected set; }
|
||||
// public bool UsesSplashPage { get; set; }
|
||||
// public string SplashMessage { get; set; }
|
||||
// public bool ShowDate
|
||||
// {
|
||||
// set { TriList.BooleanInput[UiCue.ShowDate.Number].BoolValue = value; }
|
||||
// }
|
||||
// public bool ShowTime
|
||||
// {
|
||||
// set { TriList.BooleanInput[UiCue.ShowTime.Number].BoolValue = value; }
|
||||
// }
|
||||
|
||||
// //public abstract List<CueActionPair> FunctionList { get; }
|
||||
|
||||
|
||||
// protected eMainModeType MainMode;
|
||||
// protected SourceListItem CurrentPresentationControlDevice;
|
||||
|
||||
// /// <summary>
|
||||
// /// Defines the signal offset for the presentation device. Defaults to 100
|
||||
// /// </summary>
|
||||
// public uint PresentationControlDeviceJoinOffset { get { return 100; } }
|
||||
|
||||
// public enum eMainModeType
|
||||
// {
|
||||
// Presentation, Splash, Tech
|
||||
// }
|
||||
|
||||
// protected string SgdFilePath;
|
||||
// public EssentialsRoom CurrentRoom { get; protected set; }
|
||||
// protected Dictionary<SourceListItem, DevicePageControllerBase> LoadedPageControllers
|
||||
// = new Dictionary<SourceListItem, DevicePageControllerBase>();
|
||||
|
||||
// static object RoomChangeLock = new object();
|
||||
|
||||
// /// <summary>
|
||||
// /// Constructor
|
||||
// /// </summary>
|
||||
// public SmartGraphicsTouchpanelControllerBase(string key, string name, BasicTriListWithSmartObject triList,
|
||||
// string sgdFilePath)
|
||||
// : base(key, name, triList)
|
||||
// {
|
||||
// TriList = triList;
|
||||
// if (string.IsNullOrEmpty(key)) throw new ArgumentNullException("key");
|
||||
// if (string.IsNullOrEmpty(sgdFilePath)) throw new ArgumentNullException("sgdFilePath");
|
||||
// SgdFilePath = sgdFilePath;
|
||||
// TriList.LoadSmartObjects(SgdFilePath);
|
||||
// UsesSplashPage = true;
|
||||
// SplashMessage = "Welcome";
|
||||
// TriList.SigChange += Tsw_AnySigChange;
|
||||
// foreach (var kvp in TriList.SmartObjects)
|
||||
// kvp.Value.SigChange += this.Tsw_AnySigChange;
|
||||
// }
|
||||
|
||||
//#warning wire UI manipulating presses up here, typically in child classes...
|
||||
// //public override bool CustomActivate()
|
||||
// //{
|
||||
// // var baseSuccess = base.CustomActivate();
|
||||
// // if (!baseSuccess) return false;
|
||||
|
||||
|
||||
// // // Wiring up the buttons with UOs
|
||||
// // foreach (var uo in this.FunctionList)
|
||||
// // {
|
||||
// // if (uo.Cue.Number == 0) continue;
|
||||
// // //if (uo is BoolCueActionPair)
|
||||
// // // TriList.BooleanOutput[uo.Cue.Number].UserObject = uo;
|
||||
// // //else if (uo is UShortCueActionPair)
|
||||
// // // TriList.UShortOutput[uo.Cue.Number].UserObject = uo;
|
||||
// // //else if (uo is StringCueActionPair)
|
||||
// // // TriList.StringOutput[uo.Cue.Number].UserObject = uo;
|
||||
// // }
|
||||
|
||||
// // return true;
|
||||
// //}
|
||||
|
||||
// //public void SetCurrentRoom(EssentialsRoom room)
|
||||
// //{
|
||||
// // if (CurrentRoom != null)
|
||||
// // HideRoomUI();
|
||||
// // CurrentRoom = room;
|
||||
// // ShowRoomUI();
|
||||
// //}
|
||||
|
||||
// /// <summary>
|
||||
// ///
|
||||
// /// </summary>
|
||||
// /// <param name="room"></param>
|
||||
// public void SetCurrentRoom(EssentialsRoom room)
|
||||
// {
|
||||
// if (CurrentRoom == room) return;
|
||||
|
||||
// IBasicVolumeControls oldAudio = null;
|
||||
// //Disconnect current room and audio device
|
||||
// if (CurrentRoom != null)
|
||||
// {
|
||||
// HideRoomUI();
|
||||
// CurrentRoom.AudioDeviceWillChange -= CurrentRoom_AudioDeviceWillChange;
|
||||
// CurrentRoom.PresentationSourceChange -= CurrentRoom_PresentationSourceChange;
|
||||
// oldAudio = CurrentRoom.CurrentAudioDevice;
|
||||
// }
|
||||
|
||||
// CurrentRoom = room;
|
||||
// IBasicVolumeControls newAudio = null;
|
||||
// if (CurrentRoom != null)
|
||||
// {
|
||||
// CurrentRoom.AudioDeviceWillChange += this.CurrentRoom_AudioDeviceWillChange;
|
||||
// CurrentRoom.PresentationSourceChange += this.CurrentRoom_PresentationSourceChange;
|
||||
// SetControlSource(CurrentRoom.CurrentPresentationSourceInfo);
|
||||
// newAudio = CurrentRoom.CurrentAudioDevice;
|
||||
// ShowRoomUI();
|
||||
// }
|
||||
|
||||
// SwapAudioDeviceControls(oldAudio, newAudio);
|
||||
// }
|
||||
|
||||
// /// <summary>
|
||||
// /// Detaches and attaches an IVolumeFunctions device to the appropriate TP TriList signals.
|
||||
// /// This will also add IVolumeNumeric if the device implements it.
|
||||
// /// Overriding classes should call this. Overriding classes are responsible for
|
||||
// /// linking up to hard keys, etc.
|
||||
// /// </summary>
|
||||
// /// <param name="oldDev">May be null</param>
|
||||
// /// <param name="newDev">May be null</param>
|
||||
// protected virtual void SwapAudioDeviceControls(IBasicVolumeControls oldDev, IBasicVolumeControls newDev)
|
||||
// {
|
||||
// // Disconnect
|
||||
// if (oldDev != null)
|
||||
// {
|
||||
// TriList.BooleanOutput[CommonBoolCue.VolumeDown.Number].UserObject = null;
|
||||
// TriList.BooleanOutput[CommonBoolCue.VolumeUp.Number].UserObject = null;
|
||||
// TriList.BooleanOutput[CommonBoolCue.MuteToggle.Number].UserObject = null;
|
||||
// TriList.BooleanInput[CommonBoolCue.ShowVolumeButtons.Number].BoolValue = false;
|
||||
// TriList.BooleanInput[CommonBoolCue.ShowVolumeSlider.Number].BoolValue = false;
|
||||
// if (oldDev is IBasicVolumeWithFeedback)
|
||||
// {
|
||||
// var fbDev = oldDev as IBasicVolumeWithFeedback;
|
||||
// TriList.UShortOutput[401].UserObject = null;
|
||||
// fbDev.MuteFeedback.UnlinkInputSig(TriList.BooleanInput[403]);
|
||||
// fbDev.VolumeLevelFeedback.UnlinkInputSig(TriList.UShortInput[401]);
|
||||
// }
|
||||
// }
|
||||
// if (newDev != null)
|
||||
// {
|
||||
// TriList.BooleanInput[CommonBoolCue.ShowVolumeSlider.Number].BoolValue = true;
|
||||
// TriList.SetBoolSigAction(401, newDev.VolumeUp);
|
||||
// TriList.SetBoolSigAction(402, newDev.VolumeDown);
|
||||
// TriList.SetSigFalseAction(405, newDev.MuteToggle);
|
||||
|
||||
// if (newDev is IBasicVolumeWithFeedback) // Show slider
|
||||
// {
|
||||
// var fbDev = newDev as IBasicVolumeWithFeedback;
|
||||
// TriList.BooleanInput[406].BoolValue = false;
|
||||
// TriList.BooleanInput[407].BoolValue = true;
|
||||
// TriList.UShortOutput[401].UserObject = new Action<ushort>(fbDev.SetVolume);
|
||||
// fbDev.VolumeLevelFeedback.LinkInputSig(TriList.UShortInput[401]);
|
||||
// }
|
||||
// else // Show buttons only
|
||||
// {
|
||||
// TriList.BooleanInput[406].BoolValue = true;
|
||||
// TriList.BooleanInput[407].BoolValue = false;
|
||||
// }
|
||||
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
// /// <summary>
|
||||
// /// Does nothing. Override to add functionality when calling SetCurrentRoom
|
||||
// /// </summary>
|
||||
// protected virtual void HideRoomUI() { }
|
||||
|
||||
// /// <summary>
|
||||
// /// Does nothing. Override to add functionality when calling SetCurrentRoom
|
||||
// /// </summary>
|
||||
// protected virtual void ShowRoomUI() { }
|
||||
|
||||
// /// <summary>
|
||||
// /// Sets up the current presentation device and updates statuses if the device is capable.
|
||||
// /// </summary>
|
||||
// protected void SetControlSource(SourceListItem newSource)
|
||||
// {
|
||||
// if (CurrentPresentationControlDevice != null)
|
||||
// {
|
||||
// HideCurrentPresentationSourceUi();
|
||||
//#warning Get button methods from RESI, and find a more-well-defined way to wire up feedbacks
|
||||
|
||||
// // Unhook presses and things
|
||||
// //if (CurrentPresentationControlDevice is IHasCueActionList)
|
||||
// //{
|
||||
// // foreach (var uo in (CurrentPresentationControlDevice as IHasCueActionList).CueActionList)
|
||||
// // {
|
||||
// // if (uo.Cue.Number == 0) continue;
|
||||
// // if (uo is BoolCueActionPair)
|
||||
// // {
|
||||
// // var bSig = TriList.BooleanOutput[uo.Cue.Number];
|
||||
// // // Disconnection should also clear bool sigs in case they are pressed and
|
||||
// // // might be orphaned
|
||||
// // if (bSig.BoolValue)
|
||||
// // (bSig.UserObject as BoolCueActionPair).Invoke(false);
|
||||
// // bSig.UserObject = null;
|
||||
// // }
|
||||
// // else if (uo is UShortCueActionPair)
|
||||
// // TriList.UShortOutput[uo.Cue.Number].UserObject = null;
|
||||
// // else if (uo is StringCueActionPair)
|
||||
// // TriList.StringOutput[uo.Cue.Number].UserObject = null;
|
||||
// // }
|
||||
// //}
|
||||
// // unhook outputs
|
||||
// if (CurrentPresentationControlDevice is IHasFeedback)
|
||||
// {
|
||||
// foreach (var fb in (CurrentPresentationControlDevice as IHasFeedback).Feedbacks)
|
||||
// {
|
||||
// if (fb.Cue.Number == 0) continue;
|
||||
// if (fb is BoolFeedback)
|
||||
// (fb as BoolFeedback).UnlinkInputSig(TriList.BooleanInput[fb.Cue.Number]);
|
||||
// else if (fb is IntFeedback)
|
||||
// (fb as IntFeedback).UnlinkInputSig(TriList.UShortInput[fb.Cue.Number]);
|
||||
// else if (fb is StringFeedback)
|
||||
// (fb as StringFeedback).UnlinkInputSig(TriList.StringInput[fb.Cue.Number]);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// CurrentPresentationControlDevice = newSource;
|
||||
// //connect presses and things
|
||||
// //if (newSource is IHasCueActionList) // This has functions, get 'em
|
||||
// //{
|
||||
// // foreach (var ao in (newSource as IHasCueActionList).CueActionList)
|
||||
// // {
|
||||
// // if (ao.Cue.Number == 0) continue;
|
||||
// // if (ao is BoolCueActionPair)
|
||||
// // TriList.BooleanOutput[ao.Cue.Number].UserObject = ao;
|
||||
// // else if (ao is UShortCueActionPair)
|
||||
// // TriList.UShortOutput[ao.Cue.Number].UserObject = ao;
|
||||
// // else if (ao is StringCueActionPair)
|
||||
// // TriList.StringOutput[ao.Cue.Number].UserObject = ao;
|
||||
// // }
|
||||
// //}
|
||||
// // connect outputs (addInputSig should update sig)
|
||||
// if (CurrentPresentationControlDevice is IHasFeedback)
|
||||
// {
|
||||
// foreach (var fb in (CurrentPresentationControlDevice as IHasFeedback).Feedbacks)
|
||||
// {
|
||||
// if (fb.Cue.Number == 0) continue;
|
||||
// if (fb is BoolFeedback)
|
||||
// (fb as BoolFeedback).LinkInputSig(TriList.BooleanInput[fb.Cue.Number]);
|
||||
// else if (fb is IntFeedback)
|
||||
// (fb as IntFeedback).LinkInputSig(TriList.UShortInput[fb.Cue.Number]);
|
||||
// else if (fb is StringFeedback)
|
||||
// (fb as StringFeedback).LinkInputSig(TriList.StringInput[fb.Cue.Number]);
|
||||
// }
|
||||
// }
|
||||
// ShowCurrentPresentationSourceUi();
|
||||
// }
|
||||
|
||||
// /// <summary>
|
||||
// /// Reveals the basic UI for the current device
|
||||
// /// </summary>
|
||||
// protected virtual void ShowCurrentPresentationSourceUi()
|
||||
// {
|
||||
// }
|
||||
|
||||
// /// <summary>
|
||||
// /// Hides the UI for the current device and calls for a feedback signal cleanup
|
||||
// /// </summary>
|
||||
// protected virtual void HideCurrentPresentationSourceUi()
|
||||
// {
|
||||
// }
|
||||
|
||||
|
||||
// /// <summary>
|
||||
// ///
|
||||
// /// </summary>
|
||||
// void CurrentRoom_PresentationSourceChange(object sender, EssentialsRoomSourceChangeEventArgs args)
|
||||
// {
|
||||
// SetControlSource(args.NewSource);
|
||||
// }
|
||||
|
||||
|
||||
// /// <summary>
|
||||
// ///
|
||||
// /// </summary>
|
||||
// void CurrentRoom_AudioDeviceWillChange(object sender, EssentialsRoomAudioDeviceChangeEventArgs e)
|
||||
// {
|
||||
// SwapAudioDeviceControls(e.OldDevice, e.NewDevice);
|
||||
// }
|
||||
|
||||
|
||||
|
||||
// /// <summary>
|
||||
// /// Panel event handler
|
||||
// /// </summary>
|
||||
// void Tsw_AnySigChange(object currentDevice, SigEventArgs args)
|
||||
// {
|
||||
// // plugged in commands
|
||||
// object uo = args.Sig.UserObject;
|
||||
|
||||
// if (uo is Action<bool>)
|
||||
// (uo as Action<bool>)(args.Sig.BoolValue);
|
||||
// else if (uo is Action<ushort>)
|
||||
// (uo as Action<ushort>)(args.Sig.UShortValue);
|
||||
// else if (uo is Action<string>)
|
||||
// (uo as Action<string>)(args.Sig.StringValue);
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user