mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-01-12 12:05:00 +00:00
Compare commits
474 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f81fe3d01f | ||
|
|
4f5b649b1d | ||
|
|
d0ee05def9 | ||
|
|
dd0a52c1a2 | ||
|
|
76abd05830 | ||
|
|
102535cd04 | ||
|
|
e0e9fc2ce4 | ||
|
|
a657525562 | ||
|
|
496b70f73f | ||
|
|
19b3c51c25 | ||
|
|
476d661ece | ||
|
|
546cdacc0f | ||
|
|
b4605578ad | ||
|
|
39f25cc9db | ||
|
|
788aa33a3a | ||
|
|
46ecb676c0 | ||
|
|
19c4428dc8 | ||
|
|
25ddb95db5 | ||
|
|
43ff15ff5e | ||
|
|
406e6a912f | ||
|
|
57f1db17c3 | ||
|
|
c9d97e5cae | ||
|
|
f33763ce43 | ||
|
|
a192ec3117 | ||
|
|
f9ca609c1e | ||
|
|
b0a21a1c2f | ||
|
|
a4339bf5a4 | ||
|
|
06cc871432 | ||
|
|
45b6a09067 | ||
|
|
2085e14f24 | ||
|
|
55d8e6f205 | ||
|
|
4ef8e8cf14 | ||
|
|
e581219e32 | ||
|
|
d11e0db14a | ||
|
|
4c5b60bddb | ||
|
|
0b59dbe20d | ||
|
|
279eaaaf62 | ||
|
|
fd3e8d81f8 | ||
|
|
1dfdca0ab4 | ||
|
|
ba5ab18fad | ||
|
|
7caef808b7 | ||
|
|
fd7f708a83 | ||
|
|
966a6c194f | ||
|
|
dea7edaa1f | ||
|
|
75e74aa06b | ||
|
|
b671f4c77e | ||
|
|
26eedb684a | ||
|
|
0705c412fb | ||
|
|
b76178990d | ||
|
|
c2ce9b2249 | ||
|
|
a1465f55ba | ||
|
|
ea4192838d | ||
|
|
b8553bdb7c | ||
|
|
6e741c4d44 | ||
|
|
24d9873af2 | ||
|
|
7e7159e543 | ||
|
|
2cc5631672 | ||
|
|
4fcccfff0b | ||
|
|
531bda5c7f | ||
|
|
04e159c1d1 | ||
|
|
281bfc4147 | ||
|
|
c6e511131b | ||
|
|
88b10f7ae6 | ||
|
|
9286d5bfc4 | ||
|
|
072c13459c | ||
|
|
93d6bf607b | ||
|
|
35effa5e82 | ||
|
|
caf5a6812b | ||
|
|
99c4dc2266 | ||
|
|
1d47a60695 | ||
|
|
cde25c56e2 | ||
|
|
8da86c360c | ||
|
|
53fa0c0865 | ||
|
|
03cebb75ce | ||
|
|
fc8b4120c7 | ||
|
|
5ec96310c6 | ||
|
|
53d92555c8 | ||
|
|
42b94e3a47 | ||
|
|
4b37d68c0e | ||
|
|
b321fc7b76 | ||
|
|
41e9bead0b | ||
|
|
404f5c921b | ||
|
|
acfd82fa82 | ||
|
|
e387a5534b | ||
|
|
adbb76b87c | ||
|
|
230f29d3f8 | ||
|
|
6530856d28 | ||
|
|
5c560ae82f | ||
|
|
30c1b2755e | ||
|
|
49fcb9e394 | ||
|
|
3a3ccb0acd | ||
|
|
ff7a1838aa | ||
|
|
3a03fa31e8 | ||
|
|
f91930930b | ||
|
|
d8671ea73f | ||
|
|
72ec4de912 | ||
|
|
b9bc3bd0f3 | ||
|
|
8f440c3cb9 | ||
|
|
31536e7f97 | ||
|
|
8499338fac | ||
|
|
622749a37f | ||
|
|
bcd7efa911 | ||
|
|
b58b42c496 | ||
|
|
f7a41f08c4 | ||
|
|
7a7ab33fa4 | ||
|
|
dc9d285de0 | ||
|
|
2519fffb58 | ||
|
|
3f4cc0cb26 | ||
|
|
12f8cc1c0c | ||
|
|
bfa1fee522 | ||
|
|
4cd01aa428 | ||
|
|
98c8a42d97 | ||
|
|
2eacaec577 | ||
|
|
dbec871500 | ||
|
|
03bcb5f338 | ||
|
|
dc760caf71 | ||
|
|
361a9caac1 | ||
|
|
e90436081a | ||
|
|
b3821e90d1 | ||
|
|
282c8b2cef | ||
|
|
250f62d79c | ||
|
|
64b5bc8cb8 | ||
|
|
6766574b38 | ||
|
|
0b660966ac | ||
|
|
18c35b103e | ||
|
|
edb4a1f371 | ||
|
|
7a23f141fc | ||
|
|
02c71f709c | ||
|
|
b993419c3d | ||
|
|
ef8a61c3eb | ||
|
|
d2c8da68a5 | ||
|
|
618fa68000 | ||
|
|
64e100f839 | ||
|
|
7991716ee2 | ||
|
|
531c37c752 | ||
|
|
c06184d973 | ||
|
|
806d845750 | ||
|
|
d0e357f4b7 | ||
|
|
15b65fb9a9 | ||
|
|
51dc215504 | ||
|
|
90c4435253 | ||
|
|
44fcbf98f2 | ||
|
|
79253c6b31 | ||
|
|
4d433ebf22 | ||
|
|
671d506b45 | ||
|
|
1acc018a81 | ||
|
|
0d33354f08 | ||
|
|
d6d0e3cfda | ||
|
|
282ea62f83 | ||
|
|
5608721e3d | ||
|
|
3aca786252 | ||
|
|
5c5d35a72b | ||
|
|
fcdfaca6a8 | ||
|
|
a93ded8c79 | ||
|
|
06edf6c508 | ||
|
|
96adbdb76a | ||
|
|
911bd8daba | ||
|
|
4f6ae386b4 | ||
|
|
2170a79399 | ||
|
|
902a94a82c | ||
|
|
e55a647854 | ||
|
|
ae23eec005 | ||
|
|
c5232ca6b8 | ||
|
|
f75d884986 | ||
|
|
563f690277 | ||
|
|
c7e33b5682 | ||
|
|
91963ea39b | ||
|
|
072618f981 | ||
|
|
7bfc3b35f6 | ||
|
|
204b3a4d4d | ||
|
|
44793f0375 | ||
|
|
6b65db55c1 | ||
|
|
35b5e6dfc5 | ||
|
|
e52b367ef0 | ||
|
|
54d31e128e | ||
|
|
fc9f0dc7f1 | ||
|
|
827315c3cc | ||
|
|
452ea52ae3 | ||
|
|
31418fd469 | ||
|
|
be074b5722 | ||
|
|
20e9ab8cb9 | ||
|
|
65881be81b | ||
|
|
5329d7f931 | ||
|
|
717b9b272c | ||
|
|
b70739ac4c | ||
|
|
101804656a | ||
|
|
4b11145f17 | ||
|
|
2ee1ca974e | ||
|
|
1141ed192d | ||
|
|
08c8cbf7fe | ||
|
|
01bddbf2ff | ||
|
|
33f5881e91 | ||
|
|
37313040e1 | ||
|
|
4102a06497 | ||
|
|
0acec71a7f | ||
|
|
f3d8084d11 | ||
|
|
0e211e02b8 | ||
|
|
894a6a70bb | ||
|
|
2f17734a4c | ||
|
|
c10cf202de | ||
|
|
459587bbb8 | ||
|
|
560e7a0f04 | ||
|
|
0e27928a88 | ||
|
|
c8732aa8cf | ||
|
|
c52e31a785 | ||
|
|
bfa27d589b | ||
|
|
02d12c1f60 | ||
|
|
9ed0390f79 | ||
|
|
80c1a9a46e | ||
|
|
3a5033ba4e | ||
|
|
e1e0527184 | ||
|
|
2ff87d6c4d | ||
|
|
04bbcd1d31 | ||
|
|
1db9e2cc8c | ||
|
|
41d123edf3 | ||
|
|
926e3b7bc8 | ||
|
|
999b3903b7 | ||
|
|
cebca45877 | ||
|
|
31244e4294 | ||
|
|
373f271a91 | ||
|
|
f46386cc28 | ||
|
|
5a75be0a66 | ||
|
|
5782e82eea | ||
|
|
3b2b69de1b | ||
|
|
29a79490ba | ||
|
|
011e82676c | ||
|
|
4edf8921bb | ||
|
|
d53b5470c5 | ||
|
|
ddab940dab | ||
|
|
c81c91aa46 | ||
|
|
b3238ec7b4 | ||
|
|
eec025f5bd | ||
|
|
0d20ddf66a | ||
|
|
e078e6bda7 | ||
|
|
da50272980 | ||
|
|
c8f095f0a3 | ||
|
|
42fbd813a2 | ||
|
|
69f5460442 | ||
|
|
b32212083d | ||
|
|
88702f97c6 | ||
|
|
9b759daca1 | ||
|
|
9363e94749 | ||
|
|
6474bfa136 | ||
|
|
43e57ab6d1 | ||
|
|
9d7f5af26e | ||
|
|
3a101d89ea | ||
|
|
703695e768 | ||
|
|
bb3897160b | ||
|
|
3b2ff5eed8 | ||
|
|
9828e79668 | ||
|
|
a231bb75a6 | ||
|
|
fcc2a5db06 | ||
|
|
f0010a7625 | ||
|
|
294f2fd9ec | ||
|
|
4bf1da36e2 | ||
|
|
0facecc682 | ||
|
|
ed627875a0 | ||
|
|
1d00261b1f | ||
|
|
e52259e750 | ||
|
|
661b3ef9f4 | ||
|
|
dc109b3e35 | ||
|
|
1ae93b3ffd | ||
|
|
e0ca3ac2be | ||
|
|
aaf6d0a21a | ||
|
|
0e5052910f | ||
|
|
b335617e37 | ||
|
|
46578cb3e2 | ||
|
|
c45bf44056 | ||
|
|
96a77539a1 | ||
|
|
1873cca375 | ||
|
|
739bd0c312 | ||
|
|
a403a8b81f | ||
|
|
ca27e01f94 | ||
|
|
50d5850097 | ||
|
|
a2ca41d965 | ||
|
|
5272f84507 | ||
|
|
9a324191d8 | ||
|
|
a2157a9654 | ||
|
|
83298bb06a | ||
|
|
f6ef7017a2 | ||
|
|
1418e8f8c6 | ||
|
|
d097cfe51b | ||
|
|
88ea297f16 | ||
|
|
63feaac9bd | ||
|
|
c5f0bff133 | ||
|
|
bcfd90204b | ||
|
|
475be152a7 | ||
|
|
534110cfbf | ||
|
|
cbe96dbed9 | ||
|
|
e2fe8834c5 | ||
|
|
93e542befd | ||
|
|
3852617270 | ||
|
|
d7a04e202b | ||
|
|
abd6ab121e | ||
|
|
0c274015dd | ||
|
|
ffc0f8f58e | ||
|
|
c47f7ba7e3 | ||
|
|
733dbf9bd7 | ||
|
|
58c3c4fac7 | ||
|
|
82ddd40953 | ||
|
|
60702755c1 | ||
|
|
8e05302d78 | ||
|
|
e6fb9cd1eb | ||
|
|
e6904ca91c | ||
|
|
3cc0574487 | ||
|
|
a74a703610 | ||
|
|
e0813354d9 | ||
|
|
96a4af40c9 | ||
|
|
662966d7b4 | ||
|
|
2f3b2adce4 | ||
|
|
8e53c2d804 | ||
|
|
830b83f99f | ||
|
|
e679b68e30 | ||
|
|
2f0e865740 | ||
|
|
a4f1c7ecb5 | ||
|
|
9dd24e1f02 | ||
|
|
a7cab21040 | ||
|
|
9ca5fe7518 | ||
|
|
f8dec30f94 | ||
|
|
4701937fb6 | ||
|
|
dbe4b4cec8 | ||
|
|
e57068cdb6 | ||
|
|
f5e9c4860c | ||
|
|
a050328bb2 | ||
|
|
f0129f7349 | ||
|
|
b3f6d205ea | ||
|
|
4c5849d52c | ||
|
|
c227ea26d1 | ||
|
|
5029f27bc9 | ||
|
|
5e826f4b73 | ||
|
|
39c6f5e5c7 | ||
|
|
085bc97321 | ||
|
|
b1573e99de | ||
|
|
c25901f8c9 | ||
|
|
73918b9294 | ||
|
|
1500f5aabe | ||
|
|
8f52f49884 | ||
|
|
b5251651af | ||
|
|
8716388be4 | ||
|
|
81d9531853 | ||
|
|
1b096de377 | ||
|
|
7afcbaee61 | ||
|
|
daa0427b53 | ||
|
|
dab74e59be | ||
|
|
fd76244add | ||
|
|
bbcf8e5f3b | ||
|
|
b71313248d | ||
|
|
f27b6fadb9 | ||
|
|
113b08a227 | ||
|
|
0f9e6ca901 | ||
|
|
ddf2bd4c64 | ||
|
|
8bda88dd36 | ||
|
|
cb1115b232 | ||
|
|
c62299aef7 | ||
|
|
1632f5888c | ||
|
|
b5e5eebac6 | ||
|
|
c9ce835786 | ||
|
|
bc004a8764 | ||
|
|
27bae27771 | ||
|
|
05377b06fb | ||
|
|
a875880bc3 | ||
|
|
891feecca1 | ||
|
|
c4a64ab3c2 | ||
|
|
1a2ea3e4a3 | ||
|
|
4126df4720 | ||
|
|
003a2aa76d | ||
|
|
687300811e | ||
|
|
f04f5991d4 | ||
|
|
263e792768 | ||
|
|
1cf5aafa03 | ||
|
|
6c32c6154e | ||
|
|
cd15b4e93b | ||
|
|
92b6e8a752 | ||
|
|
a2ebeab839 | ||
|
|
d905b2c25b | ||
|
|
943ae2115b | ||
|
|
7be1c6df44 | ||
|
|
bea94ceaf0 | ||
|
|
9b6b661c18 | ||
|
|
cdab417de8 | ||
|
|
d80602d3c6 | ||
|
|
a1e9d35a69 | ||
|
|
fd84e44a85 | ||
|
|
4be32cb909 | ||
|
|
b48b9ad9cf | ||
|
|
b7f97dc146 | ||
|
|
c8eb4923e6 | ||
|
|
ddeb41832f | ||
|
|
c62508b8ae | ||
|
|
f565ad9381 | ||
|
|
ab53432197 | ||
|
|
e894e2d1b4 | ||
|
|
3e16cbb092 | ||
|
|
73ab16ce55 | ||
|
|
f74d2241a0 | ||
|
|
65b95006be | ||
|
|
c871f5e6c8 | ||
|
|
66b08b6be0 | ||
|
|
0228d2938d | ||
|
|
d2fc4d2175 | ||
|
|
5f4793ed0c | ||
|
|
8ecf7ff0db | ||
|
|
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 | ||
|
|
d81bcfba9a | ||
|
|
af5699a0b0 | ||
|
|
a0db8532b6 | ||
|
|
d1fb97ec7a | ||
|
|
d18f79ac48 | ||
|
|
2072f0bff8 | ||
|
|
f479418492 | ||
|
|
07bc288fd0 | ||
|
|
69724a8d4d | ||
|
|
3648bdcae4 | ||
|
|
d2b8d38000 | ||
|
|
48da139b2f | ||
|
|
32a548b8fb | ||
|
|
0724ec06eb | ||
|
|
df6bd2a21f | ||
|
|
8d3b409ec3 | ||
|
|
9eb48acd6a | ||
|
|
4361fe6186 | ||
|
|
09bc84346d | ||
|
|
8f530aa7fe | ||
|
|
7f87b083cb | ||
|
|
eef5c41dfe | ||
|
|
dd1b15edee | ||
|
|
1a44d28adb | ||
|
|
e218f13d45 | ||
|
|
df92bdac8e | ||
|
|
51ece9daff | ||
|
|
08d6090bc5 | ||
|
|
96cd5cfe81 | ||
|
|
0d854270b6 | ||
|
|
16d5795267 | ||
|
|
c54351f8ee | ||
|
|
5819ac78ec | ||
|
|
ebc50f0caa | ||
|
|
85f28498c4 | ||
|
|
df192895a1 | ||
|
|
e74d8c2497 | ||
|
|
042c94e6cf | ||
|
|
0ed613de73 | ||
|
|
b07e85c4e7 | ||
|
|
3e9b67a1ad | ||
|
|
3b84c0e3db |
34
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
34
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve
|
||||
title: "[BUG]-"
|
||||
labels: bug
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Describe the bug**
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
**Stacktrace**
|
||||
|
||||
Include a stack trace of the exception if possible.
|
||||
```
|
||||
Paste stack trace here
|
||||
```
|
||||
|
||||
**To Reproduce**
|
||||
Steps to reproduce the behavior:
|
||||
1. Go to '...'
|
||||
2. Click on '....'
|
||||
3. Scroll down to '....'
|
||||
4. See error
|
||||
|
||||
**Expected behavior**
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
||||
**Screenshots**
|
||||
If applicable, add screenshots to help explain your problem.
|
||||
|
||||
**Additional context**
|
||||
Add any other context about the problem here.
|
||||
21
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
21
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest an idea for this project
|
||||
title: "[FEATURE]-"
|
||||
labels: enhancement
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||
If this is a request for support for a new device or type, be as specific as possible and include any pertinent manufacturer and model information.
|
||||
|
||||
**Describe the solution you'd like**
|
||||
A clear and concise description of what you want to happen.
|
||||
|
||||
**Describe alternatives you've considered**
|
||||
A clear and concise description of any alternative solutions or features you've considered.
|
||||
|
||||
**Additional context**
|
||||
Add any other context or screenshots about the feature request here.
|
||||
49
.github/scripts/GenerateVersionNumber.ps1
vendored
Normal file
49
.github/scripts/GenerateVersionNumber.ps1
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
$latestVersions = $(git tag --merged origin/master)
|
||||
$latestVersion = [version]"0.0.0"
|
||||
Foreach ($version in $latestVersions) {
|
||||
Write-Host $version
|
||||
try {
|
||||
if (([version]$version) -ge $latestVersion) {
|
||||
$latestVersion = $version
|
||||
Write-Host "Setting latest version to: $latestVersion"
|
||||
}
|
||||
}
|
||||
catch {
|
||||
Write-Host "Unable to convert $($version). Skipping"
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
$newVersion = [version]$latestVersion
|
||||
$phase = ""
|
||||
$newVersionString = ""
|
||||
switch -regex ($Env:GITHUB_REF) {
|
||||
'^refs\/heads\/master*.' {
|
||||
$newVersionString = "{0}.{1}.{2}" -f $newVersion.Major, $newVersion.Minor, $newVersion.Build
|
||||
}
|
||||
'^refs\/heads\/feature\/*.' {
|
||||
$phase = 'alpha'
|
||||
$newVersionString = "{0}.{1}.{2}-{3}-{4}" -f $newVersion.Major, $newVersion.Minor, ($newVersion.Build + 1), $phase, $Env:GITHUB_RUN_NUMBER
|
||||
}
|
||||
'^refs\/heads\/release\/*.' {
|
||||
$splitRef = $Env:GITHUB_REF -split "/"
|
||||
$version = [version]($splitRef[-1] -replace "v", "")
|
||||
$phase = 'rc'
|
||||
$newVersionString = "{0}.{1}.{2}-{3}-{4}" -f $version.Major, $version.Minor, $version.Build, $phase, $Env:GITHUB_RUN_NUMBER
|
||||
}
|
||||
'^refs\/heads\/development*.' {
|
||||
$phase = 'beta'
|
||||
$newVersionString = "{0}.{1}.{2}-{3}-{4}" -f $newVersion.Major, $newVersion.Minor, ($newVersion.Build + 1), $phase, $Env:GITHUB_RUN_NUMBER
|
||||
}
|
||||
'^refs\/heads\/hotfix\/*.' {
|
||||
$phase = 'hotfix'
|
||||
$newVersionString = "{0}.{1}.{2}-{3}-{4}" -f $newVersion.Major, $newVersion.Minor, ($newVersion.Build + 1), $phase, $Env:GITHUB_RUN_NUMBER
|
||||
}
|
||||
'^refs\/heads\/bugfix\/*.' {
|
||||
$phase = 'hotfix'
|
||||
$newVersionString = "{0}.{1}.{2}-{3}-{4}" -f $newVersion.Major, $newVersion.Minor, ($newVersion.Build + 1), $phase, $Env:GITHUB_RUN_NUMBER
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Write-Output $newVersionString
|
||||
40
.github/scripts/UpdateAssemblyVersion.ps1
vendored
Normal file
40
.github/scripts/UpdateAssemblyVersion.ps1
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
function Update-SourceVersion {
|
||||
Param ([string]$Version)
|
||||
#$fullVersion = $Version
|
||||
$baseVersion = [regex]::Match($Version, "(\d+.\d+.\d+).*").captures.groups[1].value
|
||||
$NewAssemblyVersion = ‘AssemblyVersion("‘ + $baseVersion + ‘.*")’
|
||||
Write-Output "AssemblyVersion = $NewAssemblyVersion"
|
||||
$NewAssemblyInformationalVersion = ‘AssemblyInformationalVersion("‘ + $Version + ‘")’
|
||||
Write-Output "AssemblyInformationalVersion = $NewAssemblyInformationalVersion"
|
||||
|
||||
foreach ($o in $input) {
|
||||
Write-output $o.FullName
|
||||
$TmpFile = $o.FullName + “.tmp”
|
||||
get-content $o.FullName |
|
||||
ForEach-Object {
|
||||
$_ -replace ‘AssemblyVersion\(".*"\)’, $NewAssemblyVersion } |
|
||||
ForEach-Object {
|
||||
$_ -replace ‘AssemblyInformationalVersion\(".*"\)’, $NewAssemblyInformationalVersion
|
||||
} > $TmpFile
|
||||
move-item $TmpFile $o.FullName -force
|
||||
}
|
||||
}
|
||||
|
||||
function Update-AllAssemblyInfoFiles ( $version ) {
|
||||
foreach ($file in “AssemblyInfo.cs”, “AssemblyInfo.vb” ) {
|
||||
get-childitem -Path $Env:GITHUB_WORKSPACE -recurse | Where-Object { $_.Name -eq $file } | Update-SourceVersion $version ;
|
||||
}
|
||||
}
|
||||
|
||||
# validate arguments
|
||||
$r = [System.Text.RegularExpressions.Regex]::Match($args[0], "\d+\.\d+\.\d+.*");
|
||||
if ($r.Success) {
|
||||
Write-Output "Updating Assembly Version to $args ...";
|
||||
Update-AllAssemblyInfoFiles $args[0];
|
||||
}
|
||||
else {
|
||||
Write-Output ” “;
|
||||
Write-Output “Error: Input version does not match x.y.z format!”
|
||||
Write-Output ” “;
|
||||
Write-Output "Unable to apply version to AssemblyInfo.cs files";
|
||||
}
|
||||
44
.github/scripts/ZipBuildOutput.ps1
vendored
Normal file
44
.github/scripts/ZipBuildOutput.ps1
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
# Uncomment these for local testing
|
||||
# $Env:GITHUB_WORKSPACE = "C:\Working Directories\PD\essentials"
|
||||
# $Env:SOLUTION_FILE = "PepperDashEssentials"
|
||||
# $Env:VERSION = "0.0.0-buildType-test"
|
||||
|
||||
# Sets the root directory for the operation
|
||||
$destination = "$($Env:GITHUB_HOME)\output"
|
||||
New-Item -ItemType Directory -Force -Path ($destination)
|
||||
Get-ChildItem ($destination)
|
||||
$exclusions = @(git submodule foreach --quiet 'echo $name')
|
||||
# Trying to get any .json schema files (not currently working)
|
||||
# Gets any files with the listed extensions.
|
||||
Get-ChildItem -recurse -Path "$($Env:GITHUB_WORKSPACE)" -include "*.clz", "*.cpz", "*.cplz", "*.dll" | ForEach-Object {
|
||||
$allowed = $true;
|
||||
# Exclude any files in submodules
|
||||
foreach ($exclude in $exclusions) {
|
||||
if ((Split-Path $_.FullName -Parent).contains("$($exclude)")) {
|
||||
$allowed = $false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ($allowed) {
|
||||
Write-Host "allowing $($_)"
|
||||
$_;
|
||||
}
|
||||
} | Copy-Item -Destination ($destination) -Force
|
||||
Write-Host "Getting matching files..."
|
||||
# Get any files from the output folder that match the following extensions
|
||||
Get-ChildItem -Path $destination | Where-Object { ($_.Extension -eq ".clz") -or ($_.Extension -eq ".cpz" -or ($_.Extension -eq ".cplz")) } | ForEach-Object {
|
||||
# Replace the extensions with dll and xml and create an array
|
||||
# Removed dll file capture, as previous step should capture all of them. Add if needed-> $($_ -replace "cpz|clz|cplz", "dll"),
|
||||
$filenames = @($($_ -replace "cpz|clz|cplz", "xml"))
|
||||
Write-Host "Filenames:"
|
||||
Write-Host $filenames
|
||||
if ($filenames.length -gt 0) {
|
||||
# Attempt to get the files and return them to the output directory
|
||||
Get-ChildItem -Recurse -Path "$($Env:GITHUB_WORKSPACE)" -include $filenames | Copy-Item -Destination ($destination) -Force
|
||||
}
|
||||
}
|
||||
|
||||
Get-ChildItem -Path $destination\*.cpz | Rename-Item -NewName { "$($_.BaseName)-$($Env:VERSION)$($_.Extension)" }
|
||||
Compress-Archive -Path $destination -DestinationPath "$($Env:GITHUB_WORKSPACE)\$($Env:SOLUTION_FILE)-$($Env:VERSION).zip" -Force
|
||||
Write-Host "Output Contents post Zip"
|
||||
Get-ChildItem -Path $destination
|
||||
270
.github/workflows/docker.yml
vendored
Normal file
270
.github/workflows/docker.yml
vendored
Normal file
@@ -0,0 +1,270 @@
|
||||
name: Branch Build Using Docker
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- feature/*
|
||||
- hotfix/*
|
||||
- bugfix/*
|
||||
- release/*
|
||||
- development
|
||||
|
||||
env:
|
||||
# solution path doesn't need slashes unless there it is multiple folders deep
|
||||
# solution name does not include extension. .sln is assumed
|
||||
SOLUTION_PATH: PepperDashEssentials
|
||||
SOLUTION_FILE: PepperDashEssentials
|
||||
# Do not edit this, we're just creating it here
|
||||
VERSION: 0.0.0-buildtype-buildnumber
|
||||
# Defaults to debug for build type
|
||||
BUILD_TYPE: Debug
|
||||
# Defaults to master as the release branch. Change as necessary
|
||||
RELEASE_BRANCH: master
|
||||
jobs:
|
||||
Build_Project:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
# First we checkout the source repo
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
# And any submodules
|
||||
- name: Checkout submodules
|
||||
shell: bash
|
||||
run: |
|
||||
git config --global url."https://github.com/".insteadOf "git@github.com:"
|
||||
auth_header="$(git config --local --get http.https://github.com/.extraheader)"
|
||||
git submodule sync --recursive
|
||||
git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
|
||||
# Fetch all tags
|
||||
- name: Fetch tags
|
||||
run: git fetch --tags
|
||||
# Generate the appropriate version number
|
||||
- name: Set Version Number
|
||||
shell: powershell
|
||||
run: |
|
||||
$version = ./.github/scripts/GenerateVersionNumber.ps1
|
||||
Write-Output "::set-env name=VERSION::$version"
|
||||
# Use the version number to set the version of the assemblies
|
||||
- name: Update AssemblyInfo.cs
|
||||
shell: powershell
|
||||
run: |
|
||||
Write-Output ${{ env.VERSION }}
|
||||
./.github/scripts/UpdateAssemblyVersion.ps1 ${{ env.VERSION }}
|
||||
# Login to Docker
|
||||
- name: Login to Docker
|
||||
uses: azure/docker-login@v1
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_TOKEN }}
|
||||
# Build the solutions in the docker image
|
||||
- name: Build Solution
|
||||
shell: powershell
|
||||
run: |
|
||||
Invoke-Expression "docker run --rm --mount type=bind,source=""$($Env:GITHUB_WORKSPACE)"",target=""c:/project"" pepperdash/sspbuilder c:\cihelpers\vsidebuild.exe -Solution ""c:\project\$($Env:SOLUTION_FILE).sln"" -BuildSolutionConfiguration $($ENV:BUILD_TYPE)"
|
||||
# Zip up the output files as needed
|
||||
- name: Zip Build Output
|
||||
shell: powershell
|
||||
run: ./.github/scripts/ZipBuildOutput.ps1
|
||||
# Write the version to a file to be consumed by the push jobs
|
||||
- name: Write Version
|
||||
run: Write-Output "$($Env:VERSION)" | Out-File -FilePath "$($Env:GITHUB_HOME)\output\version.txt"
|
||||
# Upload the build output as an artifact
|
||||
- name: Upload Build Output
|
||||
uses: actions/upload-artifact@v1
|
||||
with:
|
||||
name: Build
|
||||
path: ./${{ env.SOLUTION_FILE}}-${{ env.VERSION}}.zip
|
||||
# Upload the Version file as an artifact
|
||||
- name: Upload version.txt
|
||||
uses: actions/upload-artifact@v1
|
||||
with:
|
||||
name: Version
|
||||
path: ${{env.GITHUB_HOME}}\output\version.txt
|
||||
# Create the release on the source repo
|
||||
- name: Create tag for non-rc builds
|
||||
if: contains(env.VERSION, 'alpha') || contains(env.VERSION, 'beta')
|
||||
run: |
|
||||
git tag $($Env:VERSION)
|
||||
git push --tags origin
|
||||
- name: Create Release
|
||||
id: create_release
|
||||
# using contributor's version to allow for pointing at the right commit
|
||||
if: contains(env.VERSION,'-rc-') || contains(env.VERSION,'-hotfix-')
|
||||
uses: fleskesvor/create-release@feature/support-target-commitish
|
||||
with:
|
||||
tag_name: ${{ env.VERSION }}
|
||||
release_name: ${{ env.VERSION }}
|
||||
prerelease: ${{contains('debug', env.BUILD_TYPE)}}
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
# Upload the build package to the release
|
||||
- name: Upload Release Package
|
||||
if: contains(env.VERSION,'-rc-') || contains(env.VERSION,'-hotfix-')
|
||||
id: upload_release
|
||||
uses: actions/upload-release-asset@v1
|
||||
with:
|
||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||
asset_path: ./${{ env.SOLUTION_FILE}}-${{ env.VERSION}}.zip
|
||||
asset_name: ${{ env.SOLUTION_FILE}}-${{ env.VERSION}}.zip
|
||||
asset_content_type: application/zip
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
# This step always runs and pushes the build to the internal build rep
|
||||
Internal_Push_Output:
|
||||
needs: Build_Project
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- name: check Github ref
|
||||
run: ${{toJson(github.ref)}}
|
||||
# Checkout the repo
|
||||
- name: Checkout Builds Repo
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
token: ${{ secrets.BUILDS_TOKEN }}
|
||||
repository: PepperDash-Engineering/essentials-builds
|
||||
ref: ${{ Env.GITHUB_REF }}
|
||||
# Download the version artifact from the build job
|
||||
- name: Download Build Version Info
|
||||
uses: actions/download-artifact@v1
|
||||
with:
|
||||
name: Version
|
||||
- name: Check Directory
|
||||
run: Get-ChildItem "./"
|
||||
# Set the version number environment variable from the file we just downloaded
|
||||
- name: Set Version Number
|
||||
shell: powershell
|
||||
run: |
|
||||
Get-ChildItem "./Version"
|
||||
$version = Get-Content -Path ./Version/version.txt
|
||||
Write-Host "Version: $version"
|
||||
Write-Output "::set-env name=VERSION::$version"
|
||||
Remove-Item -Path ./Version/version.txt
|
||||
Remove-Item -Path ./Version
|
||||
# Checkout/Create the branch
|
||||
- name: Create new branch
|
||||
run: git checkout -b $($Env:GITHUB_REF -replace "refs/heads/")
|
||||
# Download the build output into the repo
|
||||
- name: Download Build output
|
||||
uses: actions/download-artifact@v1
|
||||
with:
|
||||
name: Build
|
||||
path: ./
|
||||
- name: Check directory
|
||||
run: Get-ChildItem ./
|
||||
# Unzip the build package file
|
||||
- name: Unzip Build file
|
||||
run: |
|
||||
Get-ChildItem .\*.zip | Expand-Archive -DestinationPath .\
|
||||
Remove-Item -Path .\*.zip
|
||||
- name: Check directory again
|
||||
run: Get-ChildItem ./
|
||||
# Copy Contents of output folder to root directory
|
||||
- name: Copy Files to root & delete output directory
|
||||
run: |
|
||||
Remove-Item -Path .\* -Include @("*.cpz","*.md","*.cplz","*.json","*.dll","*.clz")
|
||||
Get-ChildItem -Path .\output\* | Copy-Item -Destination .\
|
||||
Remove-Item -Path .\output -Recurse
|
||||
# Commits the build output to the branch and tags it with the version
|
||||
- name: Commit build output and tag the commit
|
||||
shell: powershell
|
||||
run: |
|
||||
git config user.email "actions@pepperdash.com"
|
||||
git config user.name "GitHub Actions"
|
||||
git add .
|
||||
$commit = "Build $($Env:GITHUB_RUN_NUMBER) from commit: https://github.com/$($Env:GITHUB_REPOSITORY)/commit/$($Env:GITHUB_SHA)"
|
||||
Write-Host "Commit: $commit"
|
||||
git commit -m $commit
|
||||
git tag $($Env:VERSION)
|
||||
# Push the commit
|
||||
- name: Push to Builds Repo
|
||||
shell: powershell
|
||||
run: |
|
||||
$branch = $($Env:GITHUB_REF) -replace "refs/heads/"
|
||||
Write-Host "Branch: $branch"
|
||||
git push -u origin $($branch) --force
|
||||
# Push the tags
|
||||
- name: Push tags
|
||||
run: git push --tags origin
|
||||
- name: Check Directory
|
||||
run: Get-ChildItem ./
|
||||
# This step only runs if the branch is master or release/ runs and pushes the build to the public build repo
|
||||
Public_Push_Output:
|
||||
needs: Build_Project
|
||||
runs-on: windows-latest
|
||||
if: contains(github.ref, 'master') || contains(github.ref, '/release/')
|
||||
steps:
|
||||
# Checkout the repo
|
||||
- name: check Github ref
|
||||
run: ${{toJson(github.ref)}}
|
||||
- name: Checkout Builds Repo
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
token: ${{ secrets.BUILDS_TOKEN }}
|
||||
repository: PepperDash/Essentials-Builds
|
||||
ref: ${{ Env.GITHUB_REF }}
|
||||
# Download the version artifact from the build job
|
||||
- name: Download Build Version Info
|
||||
uses: actions/download-artifact@v1
|
||||
with:
|
||||
name: Version
|
||||
- name: Check Directory
|
||||
run: Get-ChildItem "./"
|
||||
# Set the version number environment variable from the file we just downloaded
|
||||
- name: Set Version Number
|
||||
shell: powershell
|
||||
run: |
|
||||
Get-ChildItem "./Version"
|
||||
$version = Get-Content -Path ./Version/version.txt
|
||||
Write-Host "Version: $version"
|
||||
Write-Output "::set-env name=VERSION::$version"
|
||||
Remove-Item -Path ./Version/version.txt
|
||||
Remove-Item -Path ./Version
|
||||
# Checkout/Create the branch
|
||||
- name: Create new branch
|
||||
run: git checkout -b $($Env:GITHUB_REF -replace "refs/heads/")
|
||||
# Download the build output into the repo
|
||||
- name: Download Build output
|
||||
uses: actions/download-artifact@v1
|
||||
with:
|
||||
name: Build
|
||||
path: ./
|
||||
- name: Check directory
|
||||
run: Get-ChildItem ./
|
||||
# Unzip the build package file
|
||||
- name: Unzip Build file
|
||||
run: |
|
||||
Get-ChildItem .\*.zip | Expand-Archive -DestinationPath .\
|
||||
Remove-Item -Path .\*.zip
|
||||
- name: Check directory again
|
||||
run: Get-ChildItem ./
|
||||
# Copy Contents of output folder to root directory
|
||||
- name: Copy Files to root & delete output directory
|
||||
run: |
|
||||
Remove-Item -Path .\* -Include @("*.cpz","*.md","*.cplz","*.json","*.dll","*.clz")
|
||||
Get-ChildItem -Path .\output\* | Copy-Item -Destination .\
|
||||
Remove-Item -Path .\output -Recurse
|
||||
# Commits the build output to the branch and tags it with the version
|
||||
- name: Commit build output and tag the commit
|
||||
shell: powershell
|
||||
run: |
|
||||
git config user.email "actions@pepperdash.com"
|
||||
git config user.name "GitHub Actions"
|
||||
git add .
|
||||
$commit = "Build $($Env:GITHUB_RUN_NUMBER) from commit: https://github.com/$($Env:GITHUB_REPOSITORY)/commit/$($Env:GITHUB_SHA)"
|
||||
Write-Host "Commit: $commit"
|
||||
git commit -m $commit
|
||||
git tag $($Env:VERSION)
|
||||
# Push the commit
|
||||
- name: Push to Builds Repo
|
||||
shell: powershell
|
||||
run: |
|
||||
$branch = $($Env:GITHUB_REF) -replace "refs/heads/"
|
||||
Write-Host "Branch: $branch"
|
||||
git push -u origin $($branch) --force
|
||||
# Push the tags
|
||||
- name: Push tags
|
||||
run: git push --tags origin
|
||||
- name: Check Directory
|
||||
run: Get-ChildItem ./
|
||||
232
.github/workflows/master.yml
vendored
Normal file
232
.github/workflows/master.yml
vendored
Normal file
@@ -0,0 +1,232 @@
|
||||
name: Master Build using Docker
|
||||
|
||||
on:
|
||||
release:
|
||||
types:
|
||||
- created
|
||||
branches:
|
||||
- master
|
||||
env:
|
||||
# solution path doesn't need slashes unless there it is multiple folders deep
|
||||
# solution name does not include extension. .sln is assumed
|
||||
SOLUTION_PATH: PepperDashEssentials
|
||||
SOLUTION_FILE: PepperDashEssentials
|
||||
# Do not edit this, we're just creating it here
|
||||
VERSION: 0.0.0-buildtype-buildnumber
|
||||
# Defaults to debug for build type
|
||||
BUILD_TYPE: Release
|
||||
# Defaults to master as the release branch. Change as necessary
|
||||
RELEASE_BRANCH: master
|
||||
jobs:
|
||||
Build_Project:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
# First we checkout the source repo
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v2
|
||||
# And any submodules
|
||||
- name: Checkout submodules
|
||||
shell: bash
|
||||
run: |
|
||||
git config --global url."https://github.com/".insteadOf "git@github.com:"
|
||||
auth_header="$(git config --local --get http.https://github.com/.extraheader)"
|
||||
git submodule sync --recursive
|
||||
git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
|
||||
# Generate the appropriate version number
|
||||
- name: Set Version Number
|
||||
shell: powershell
|
||||
env:
|
||||
TAG_NAME: ${{ github.event.release.tag_name }}
|
||||
run: Write-Output "::set-env name=VERSION::$($Env:TAG_NAME)"
|
||||
# Use the version number to set the version of the assemblies
|
||||
- name: Update AssemblyInfo.cs
|
||||
shell: powershell
|
||||
run: |
|
||||
Write-Output ${{ env.VERSION }}
|
||||
./.github/scripts/UpdateAssemblyVersion.ps1 ${{ env.VERSION }}
|
||||
# Login to Docker
|
||||
- name: Login to Docker
|
||||
uses: azure/docker-login@v1
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_TOKEN }}
|
||||
# Build the solutions in the docker image
|
||||
- name: Build Solution
|
||||
shell: powershell
|
||||
run: |
|
||||
Invoke-Expression "docker run --rm --mount type=bind,source=""$($Env:GITHUB_WORKSPACE)"",target=""c:/project"" pepperdash/sspbuilder c:\cihelpers\vsidebuild.exe -Solution ""c:\project\$($Env:SOLUTION_FILE).sln"" -BuildSolutionConfiguration $($ENV:BUILD_TYPE)"
|
||||
# Zip up the output files as needed
|
||||
- name: Zip Build Output
|
||||
shell: powershell
|
||||
run: ./.github/scripts/ZipBuildOutput.ps1
|
||||
# Write the version to a file to be consumed by the push jobs
|
||||
- name: Write Version
|
||||
run: Write-Output "$($Env:VERSION)" | Out-File -FilePath "$($Env:GITHUB_HOME)\output\version.txt"
|
||||
# Upload the build output as an artifact
|
||||
- name: Upload Build Output
|
||||
uses: actions/upload-artifact@v1
|
||||
with:
|
||||
name: Build
|
||||
path: ./${{ env.SOLUTION_FILE}}-${{ env.VERSION}}.zip
|
||||
# Upload the Version file as an artifact
|
||||
- name: Upload version.txt
|
||||
uses: actions/upload-artifact@v1
|
||||
with:
|
||||
name: Version
|
||||
path: ${{env.GITHUB_HOME}}\output\version.txt
|
||||
# Upload the build package to the release
|
||||
- name: Upload Release Package
|
||||
id: upload_release
|
||||
uses: actions/upload-release-asset@v1
|
||||
with:
|
||||
upload_url: ${{ github.event.release.upload_url }}
|
||||
asset_path: ./${{ env.SOLUTION_FILE}}-${{ env.VERSION}}.zip
|
||||
asset_name: ${{ env.SOLUTION_FILE}}-${{ env.VERSION}}.zip
|
||||
asset_content_type: application/zip
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
Internal_Push_Output:
|
||||
needs: Build_Project
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
# Checkout the repo
|
||||
- name: Checkout Builds Repo
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
token: ${{ secrets.BUILDS_TOKEN }}
|
||||
repository: PepperDash-Engineering/essentials-builds
|
||||
ref: ${{ Env.GITHUB_REF }}
|
||||
# Download the version artifact from the build job
|
||||
- name: Download Build Version Info
|
||||
uses: actions/download-artifact@v1
|
||||
with:
|
||||
name: Version
|
||||
- name: Check Directory
|
||||
run: Get-ChildItem "./"
|
||||
# Set the version number environment variable from the file we just downloaded
|
||||
- name: Set Version Number
|
||||
shell: powershell
|
||||
run: |
|
||||
Get-ChildItem "./Version"
|
||||
$version = Get-Content -Path ./Version/version.txt
|
||||
Write-Host "Version: $version"
|
||||
Write-Output "::set-env name=VERSION::$version"
|
||||
Remove-Item -Path ./Version/version.txt
|
||||
Remove-Item -Path ./Version
|
||||
# Checkout/Create the branch
|
||||
- name: Checkout Master branch
|
||||
run: git checkout master
|
||||
# Download the build output into the repo
|
||||
- name: Download Build output
|
||||
uses: actions/download-artifact@v1
|
||||
with:
|
||||
name: Build
|
||||
path: ./
|
||||
- name: Check directory
|
||||
run: Get-ChildItem ./
|
||||
# Unzip the build package file
|
||||
- name: Unzip Build file
|
||||
run: |
|
||||
Get-ChildItem .\*.zip | Expand-Archive -DestinationPath .\
|
||||
Remove-Item -Path .\*.zip
|
||||
- name: Check directory again
|
||||
run: Get-ChildItem ./
|
||||
# Copy Contents of output folder to root directory
|
||||
- name: Copy Files to root & delete output directory
|
||||
run: |
|
||||
Remove-Item -Path .\* -Include @("*.cpz","*.md","*.cplz","*.json","*.dll","*.clz")
|
||||
Get-ChildItem -Path .\output\* | Copy-Item -Destination .\
|
||||
Remove-Item -Path .\output -Recurse
|
||||
# Commits the build output to the branch and tags it with the version
|
||||
- name: Commit build output and tag the commit
|
||||
shell: powershell
|
||||
run: |
|
||||
git config user.email "actions@pepperdash.com"
|
||||
git config user.name "GitHub Actions"
|
||||
git add .
|
||||
$commit = "Build $($Env:GITHUB_RUN_NUMBER) from commit: https://github.com/$($Env:GITHUB_REPOSITORY)/commit/$($Env:GITHUB_SHA)"
|
||||
Write-Host "Commit: $commit"
|
||||
git commit -m $commit
|
||||
git tag $($Env:VERSION)
|
||||
# Push the commit
|
||||
- name: Push to Builds Repo
|
||||
shell: powershell
|
||||
run: git push -u origin master --force
|
||||
# Push the tags
|
||||
- name: Push tags
|
||||
run: git push --tags origin
|
||||
- name: Check Directory
|
||||
run: Get-ChildItem ./
|
||||
# This step only runs if the branch is master or release/ runs and pushes the build to the public build repo
|
||||
Public_Push_Output:
|
||||
needs: Build_Project
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
# Checkout the repo
|
||||
- name: Checkout Builds Repo
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
token: ${{ secrets.BUILDS_TOKEN }}
|
||||
repository: PepperDash/Essentials-Builds
|
||||
ref: ${{ Env.GITHUB_REF }}
|
||||
# Download the version artifact from the build job
|
||||
- name: Download Build Version Info
|
||||
uses: actions/download-artifact@v1
|
||||
with:
|
||||
name: Version
|
||||
- name: Check Directory
|
||||
run: Get-ChildItem "./"
|
||||
# Set the version number environment variable from the file we just downloaded
|
||||
- name: Set Version Number
|
||||
shell: powershell
|
||||
run: |
|
||||
Get-ChildItem "./Version"
|
||||
$version = Get-Content -Path ./Version/version.txt
|
||||
Write-Host "Version: $version"
|
||||
Write-Output "::set-env name=VERSION::$version"
|
||||
Remove-Item -Path ./Version/version.txt
|
||||
Remove-Item -Path ./Version
|
||||
# Checkout master branch
|
||||
- name: Create new branch
|
||||
run: git checkout master
|
||||
# Download the build output into the repo
|
||||
- name: Download Build output
|
||||
uses: actions/download-artifact@v1
|
||||
with:
|
||||
name: Build
|
||||
path: ./
|
||||
- name: Check directory
|
||||
run: Get-ChildItem ./
|
||||
# Unzip the build package file
|
||||
- name: Unzip Build file
|
||||
run: |
|
||||
Get-ChildItem .\*.zip | Expand-Archive -DestinationPath .\
|
||||
Remove-Item -Path .\*.zip
|
||||
- name: Check directory again
|
||||
run: Get-ChildItem ./
|
||||
# Copy Contents of output folder to root directory
|
||||
- name: Copy Files to root & delete output directory
|
||||
run: |
|
||||
Remove-Item -Path .\* -Include @("*.cpz","*.md","*.cplz","*.json","*.dll","*.clz")
|
||||
Get-ChildItem -Path .\output\* | Copy-Item -Destination .\
|
||||
Remove-Item -Path .\output -Recurse
|
||||
# Commits the build output to the branch and tags it with the version
|
||||
- name: Commit build output and tag the commit
|
||||
shell: powershell
|
||||
run: |
|
||||
git config user.email "actions@pepperdash.com"
|
||||
git config user.name "GitHub Actions"
|
||||
git add .
|
||||
$commit = "Build $($Env:GITHUB_RUN_NUMBER) from commit: https://github.com/$($Env:GITHUB_REPOSITORY)/commit/$($Env:GITHUB_SHA)"
|
||||
Write-Host "Commit: $commit"
|
||||
git commit -m $commit
|
||||
git tag $($Env:VERSION)
|
||||
# Push the commit
|
||||
- name: Push to Builds Repo
|
||||
shell: powershell
|
||||
run: git push -u origin master --force
|
||||
# Push the tags
|
||||
- name: Push tags
|
||||
run: git push --tags origin
|
||||
- name: Check Directory
|
||||
run: Get-ChildItem ./
|
||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -22,3 +22,6 @@ _ReSharper*/
|
||||
SIMPLSharpLogs/
|
||||
*.projectinfo
|
||||
essentials-framework/EssentialDMTestConfig/
|
||||
output/
|
||||
|
||||
PepperDashEssentials-0.0.0-buildType-test.zip
|
||||
|
||||
5
.gitmodules
vendored
5
.gitmodules
vendored
@@ -1,3 +1,6 @@
|
||||
[submodule "essentials-framework/pepperdashcore-builds"]
|
||||
path = essentials-framework/pepperdashcore-builds
|
||||
url = https://bitbucket.org/Pepperdash_Products/pepperdashcore-builds.git
|
||||
url = https://github.com/ndorin/PepperDashCore-Builds.git
|
||||
[submodule "Essentials-Template-UI"]
|
||||
path = Essentials-Template-UI
|
||||
url = https://github.com/PepperDash/Essentials-Template-UI.git
|
||||
|
||||
110
CONTRIBUTING.md
Normal file
110
CONTRIBUTING.md
Normal file
@@ -0,0 +1,110 @@
|
||||
# Contributors Guide
|
||||
|
||||
Essentials is an open source project. If you are interested in making it better,
|
||||
there are many ways you can contribute. For example, you can:
|
||||
|
||||
- Submit a bug report
|
||||
- Suggest a new feature
|
||||
- Provide feedback by commenting on feature requests/proposals
|
||||
- Propose a patch by submitting a pull request
|
||||
- Suggest or submit documentation improvements
|
||||
- Review outstanding pull requests
|
||||
- Answer questions from other users
|
||||
- Share the software with other users who are interested
|
||||
- Teach others to use the software
|
||||
|
||||
## Bugs and Feature Requests
|
||||
|
||||
If you believe that you have found a bug or wish to propose a new feature,
|
||||
please first search the existing [issues] to see if it has already been
|
||||
reported. If you are unable to find an existing issue, consider using one of
|
||||
the provided templates to create a new issue and provide as many details as you
|
||||
can to assist in reproducing the bug or explaining your proposed feature.
|
||||
|
||||
## Patch Submission tips
|
||||
|
||||
Patches should be submitted in the form of Pull Requests to the Essentials
|
||||
[repository] on GitHub. But first, consider the following tips to ensure a
|
||||
smooth process when submitting a patch:
|
||||
|
||||
- Ensure that the patch compiles and does not break any build-time tests.
|
||||
- Be understanding, patient, and friendly; developers may need time to review
|
||||
your submissions before they can take action or respond. This does not mean
|
||||
your contribution is not valued. If your contribution has not received a
|
||||
response in a reasonable time, consider commenting with a polite inquiry for
|
||||
an update.
|
||||
- Limit your patches to the smallest reasonable change to achieve your intended
|
||||
goal. For example, do not make unnecessary indentation changes; but don't go
|
||||
out of your way to make the patch so minimal that it isn't easy to read,
|
||||
either. Consider the reviewer's perspective.
|
||||
- Before submission, please squash your commits to using a message that starts
|
||||
with the issue number and a description of the changes.
|
||||
- Isolate multiple patches from each other. If you wish to make several
|
||||
independent patches, do so in separate, smaller pull requests that can be
|
||||
reviewed more easily.
|
||||
- Be prepared to answer questions from reviewers. They may have further
|
||||
questions before accepting your patch, and may even propose changes. Please
|
||||
accept this feedback constructively, and not as a rejection of your proposed
|
||||
change.
|
||||
|
||||
## GitFlow Branch Model
|
||||
This repository adheres to the [GitFlow](https://nvie.com/posts/a-successful-git-branching-model/) branch model and is intitialized for GitFlow to make for consistent branch name prefixes. Please take time to familiarize yourself with this model.
|
||||
|
||||
- `master` will contain the latest stable version of the framework and release builds will be created from tagged commits on `master`.
|
||||
- HotFix/Patch Pull Requests should target `master` as the base branch.
|
||||
- All other Pull Requests (bug fixes, enhancements, etc.) should target `development` as the base branch.
|
||||
- `release/vX.Y.X` branches will be used for release candidates when moving new features from `development` to `master`.
|
||||
Beta builds will be created from tagged commits on release candidate branches.
|
||||
|
||||
## Review
|
||||
|
||||
- We welcome code reviews from anyone. A committer is required to formally
|
||||
accept and merge the changes.
|
||||
- Reviewers will be looking for things like threading issues, performance
|
||||
implications, API design, duplication of existing functionality, readability
|
||||
and code style, avoidance of bloat (scope-creep), etc.
|
||||
- Reviewers will likely ask questions to better understand your change.
|
||||
- Reviewers will make comments about changes to your patch:
|
||||
- MUST means that the change is required
|
||||
- SHOULD means that the change is suggested, further discussion on the
|
||||
subject may be required
|
||||
- COULD means that the change is optional
|
||||
|
||||
## Timeline and Managing Expectations
|
||||
|
||||
As we continue to engage contributors and learn best practices for running a successful open source project, our processes
|
||||
and guidance will likely evolve. We will try to communicate expectations as we are able and to always be responsive. We
|
||||
hope that the community will share their suggestions for improving this engagement. Based on the level of initial interest
|
||||
we receive and the availability of resources to evaluate contributions, we anticipate the following:
|
||||
|
||||
- We will initially prioritize pull requests that include small bug fixes and code that addresses potential vulnerabilities
|
||||
as well as pull requests that include improvements for processor language specifications because these require a
|
||||
reasonable amount of effort to evaluate and will help us exercise and revise our process for accepting contributions. In
|
||||
other words, we are going to start small in order to work out the kinks first.
|
||||
- We are committed to maintaining the integrity and security of our code base. In addition to the careful review the
|
||||
maintainers will give to code contributions to make sure they do not introduce new bugs or vulnerabilities, we will be
|
||||
trying to identify best practices to incorporate with our open source project so that contributors can have more control
|
||||
over whether their contributions are accepted. These might include things like style guides and requirements for tests and
|
||||
documentation to accompany some code contributions. As a result, it may take a long time for some contributions to be
|
||||
accepted. This does not mean we are ignoring them.
|
||||
- We are committed to integrating this GitHub project with our team's regular development work flow so that the open source
|
||||
project remains dynamic and relevant. This may affect our responsiveness and ability to accept pull requests
|
||||
quickly. This does not mean we are ignoring them.
|
||||
- Not all innovative ideas need to be accepted as pull requests into this GitHub project to be valuable to the community.
|
||||
There may be times when we recommend that you just share your code for some enhancement to Ghidra from your own
|
||||
repository. As we identify and recognize extensions that are of general interest to the reverse engineering community, we
|
||||
may seek to incorporate them with our baseline.
|
||||
|
||||
## Legal
|
||||
|
||||
Consistent with Section D.6. of the GitHub Terms of Service as of 2019, and the MIT license, the project maintainer for this project accepts contributions using the inbound=outbound model.
|
||||
When you submit a pull request to this repository (inbound), you are agreeing to license your contribution under the same terms as specified in [LICENSE] (outbound).
|
||||
|
||||
This is an open source project.
|
||||
Contributions you make to this repository are completely voluntary.
|
||||
When you submit an issue, bug report, question, enhancement, pull request, etc., you are offering your contribution without expectation of payment, you expressly waive any future pay claims against PepperDash related to your contribution, and you acknowledge that this does not create an obligation on the part of PepperDash of any kind.
|
||||
Furthermore, your contributing to this project does not create an employer-employee relationship between the PepperDash and the contributor.
|
||||
|
||||
[issues]: https://github.com/PepperDash/Essentials/issues
|
||||
[repository]: https://github.com/PepperDash/Essentials
|
||||
[LICENSE]: https://github.com/PepperDash/Essentials/blob/master/LICENSE.md
|
||||
1
Essentials-Template-UI
Submodule
1
Essentials-Template-UI
Submodule
Submodule Essentials-Template-UI added at 8eaf88791b
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,21 +1,21 @@
|
||||
|
||||
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}"
|
||||
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}"
|
||||
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}"
|
||||
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}"
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PepperDash_Essentials_DM", "essentials-framework\Essentials DM\Essentials_DM\PepperDash_Essentials_DM.csproj", "{9199CE8A-0C9F-4952-8672-3EED798B284F}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5} = {A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5}
|
||||
EndProjectSection
|
||||
|
||||
174
PepperDashEssentials/AppServer/Messengers/CameraBaseMessenger.cs
Normal file
174
PepperDashEssentials/AppServer/Messengers/CameraBaseMessenger.cs
Normal file
@@ -0,0 +1,174 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Devices.Common.Cameras;
|
||||
|
||||
namespace PepperDash.Essentials.AppServer.Messengers
|
||||
{
|
||||
public class CameraBaseMessenger : MessengerBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Device being bridged
|
||||
/// </summary>
|
||||
public CameraBase Camera { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Constructor
|
||||
/// </summary>
|
||||
/// <param name="key"></param>
|
||||
/// <param name="camera"></param>
|
||||
/// <param name="messagePath"></param>
|
||||
public CameraBaseMessenger(string key, CameraBase camera, string messagePath)
|
||||
: base(key, messagePath)
|
||||
{
|
||||
if (camera == null)
|
||||
throw new ArgumentNullException("camera");
|
||||
|
||||
Camera = camera;
|
||||
|
||||
var presetsCamera = Camera as IHasCameraPresets;
|
||||
|
||||
if (presetsCamera != null)
|
||||
{
|
||||
presetsCamera.PresetsListHasChanged += new EventHandler<EventArgs>(presetsCamera_PresetsListHasChanged);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void presetsCamera_PresetsListHasChanged(object sender, EventArgs e)
|
||||
{
|
||||
var presetsCamera = Camera as IHasCameraPresets;
|
||||
|
||||
var presetList = new List<CameraPreset>();
|
||||
|
||||
if (presetsCamera != null)
|
||||
presetList = presetsCamera.Presets;
|
||||
|
||||
PostStatusMessage(new
|
||||
{
|
||||
presets = presetList
|
||||
});
|
||||
}
|
||||
|
||||
protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
|
||||
{
|
||||
appServerController.AddAction(MessagePath + "/fullStatus", new Action(SendCameraFullMessageObject));
|
||||
|
||||
var ptzCamera = Camera as IHasCameraPtzControl;
|
||||
|
||||
if (ptzCamera != null)
|
||||
{
|
||||
|
||||
// Need to evaluate how to pass through these P&H actions. Need a method that takes a bool maybe?
|
||||
AppServerController.AddAction(MessagePath + "/cameraUp", new PressAndHoldAction((b) =>
|
||||
{
|
||||
if (b)
|
||||
ptzCamera.TiltUp();
|
||||
else
|
||||
ptzCamera.TiltStop();
|
||||
}));
|
||||
AppServerController.AddAction(MessagePath + "/cameraDown", new PressAndHoldAction((b) =>
|
||||
{
|
||||
if (b)
|
||||
ptzCamera.TiltDown();
|
||||
else
|
||||
ptzCamera.TiltStop();
|
||||
}));
|
||||
AppServerController.AddAction(MessagePath + "/cameraLeft", new PressAndHoldAction((b) =>
|
||||
{
|
||||
if (b)
|
||||
ptzCamera.PanLeft();
|
||||
else
|
||||
ptzCamera.PanStop();
|
||||
}));
|
||||
AppServerController.AddAction(MessagePath + "/cameraRight", new PressAndHoldAction((b) =>
|
||||
{
|
||||
if (b)
|
||||
ptzCamera.PanRight();
|
||||
else
|
||||
ptzCamera.PanStop();
|
||||
}));
|
||||
AppServerController.AddAction(MessagePath + "/cameraZoomIn", new PressAndHoldAction((b) =>
|
||||
{
|
||||
if (b)
|
||||
ptzCamera.ZoomIn();
|
||||
else
|
||||
ptzCamera.ZoomStop();
|
||||
}));
|
||||
AppServerController.AddAction(MessagePath + "/cameraZoomOut", new PressAndHoldAction((b) =>
|
||||
{
|
||||
if (b)
|
||||
ptzCamera.ZoomOut();
|
||||
else
|
||||
ptzCamera.ZoomStop();
|
||||
}));
|
||||
}
|
||||
|
||||
if (Camera is IHasCameraAutoMode)
|
||||
{
|
||||
appServerController.AddAction(MessagePath + "/cameraModeAuto", new Action((Camera as IHasCameraAutoMode).CameraAutoModeOn));
|
||||
appServerController.AddAction(MessagePath + "/cameraModeManual", new Action((Camera as IHasCameraAutoMode).CameraAutoModeOff));
|
||||
}
|
||||
|
||||
if (Camera is IPower)
|
||||
{
|
||||
appServerController.AddAction(MessagePath + "/cameraModeOff", new Action((Camera as IPower).PowerOff));
|
||||
}
|
||||
|
||||
var presetsCamera = Camera as IHasCameraPresets;
|
||||
|
||||
if (presetsCamera != null)
|
||||
{
|
||||
for(int i = 1; i <= 6; i++)
|
||||
{
|
||||
var preset = i;
|
||||
appServerController.AddAction(MessagePath + "/cameraPreset" + i, new Action<int>((p) => presetsCamera.PresetSelect(preset)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Helper method to update the full status of the camera
|
||||
/// </summary>
|
||||
void SendCameraFullMessageObject()
|
||||
{
|
||||
var presetsCamera = Camera as IHasCameraPresets;
|
||||
|
||||
var presetList = new List<CameraPreset>();
|
||||
|
||||
if (presetsCamera != null)
|
||||
presetList = presetsCamera.Presets;
|
||||
|
||||
PostStatusMessage(new
|
||||
{
|
||||
cameraMode = GetCameraMode(),
|
||||
hasPresets = Camera is IHasCameraPresets,
|
||||
presets = presetList
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Computes the current camera mode
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
string GetCameraMode()
|
||||
{
|
||||
string m;
|
||||
if (Camera is IHasCameraAutoMode && (Camera as IHasCameraAutoMode).CameraAutoModeIsOnFeedback.BoolValue)
|
||||
m = eCameraControlMode.Auto.ToString().ToLower();
|
||||
else if (Camera is IPower && !(Camera as IPower).PowerIsOnFeedback.BoolValue)
|
||||
m = eCameraControlMode.Off.ToString().ToLower();
|
||||
else
|
||||
m = eCameraControlMode.Manual.ToString().ToLower();
|
||||
return m;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,216 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
using Crestron.SimplSharpPro.EthernetCommunication;
|
||||
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Devices.Common.Codec;
|
||||
|
||||
namespace PepperDash.Essentials.AppServer.Messengers
|
||||
{
|
||||
public class Ddvc01AtcMessenger : MessengerBase
|
||||
{
|
||||
BasicTriList EISC;
|
||||
|
||||
/// <summary>
|
||||
/// 221
|
||||
/// </summary>
|
||||
const uint BDialHangupOnHook = 221;
|
||||
|
||||
/// <summary>
|
||||
/// 251
|
||||
/// </summary>
|
||||
const uint BIncomingAnswer = 251;
|
||||
/// <summary>
|
||||
/// 252
|
||||
/// </summary>
|
||||
const uint BIncomingReject = 252;
|
||||
/// <summary>
|
||||
/// 241
|
||||
/// </summary>
|
||||
const uint BSpeedDial1 = 241;
|
||||
/// <summary>
|
||||
/// 242
|
||||
/// </summary>
|
||||
const uint BSpeedDial2 = 242;
|
||||
/// <summary>
|
||||
/// 243
|
||||
/// </summary>
|
||||
const uint BSpeedDial3 = 243;
|
||||
/// <summary>
|
||||
/// 244
|
||||
/// </summary>
|
||||
const uint BSpeedDial4 = 244;
|
||||
|
||||
/// <summary>
|
||||
/// 201
|
||||
/// </summary>
|
||||
const uint SCurrentDialString = 201;
|
||||
/// <summary>
|
||||
/// 211
|
||||
/// </summary>
|
||||
const uint SCurrentCallNumber = 211;
|
||||
/// <summary>
|
||||
/// 212
|
||||
/// </summary>
|
||||
const uint SCurrentCallName = 212;
|
||||
/// <summary>
|
||||
/// 221
|
||||
/// </summary>
|
||||
const uint SHookState = 221;
|
||||
/// <summary>
|
||||
/// 222
|
||||
/// </summary>
|
||||
const uint SCallDirection = 222;
|
||||
|
||||
/// <summary>
|
||||
/// 201-212 0-9*#
|
||||
/// </summary>
|
||||
Dictionary<string, uint> DTMFMap = new Dictionary<string, uint>
|
||||
{
|
||||
{ "1", 201 },
|
||||
{ "2", 202 },
|
||||
{ "3", 203 },
|
||||
{ "4", 204 },
|
||||
{ "5", 205 },
|
||||
{ "6", 206 },
|
||||
{ "7", 207 },
|
||||
{ "8", 208 },
|
||||
{ "9", 209 },
|
||||
{ "0", 210 },
|
||||
{ "*", 211 },
|
||||
{ "#", 212 },
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
CodecActiveCallItem CurrentCallItem;
|
||||
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="eisc"></param>
|
||||
/// <param name="messagePath"></param>
|
||||
public Ddvc01AtcMessenger(string key, BasicTriList eisc, string messagePath)
|
||||
: base(key, messagePath)
|
||||
{
|
||||
EISC = eisc;
|
||||
|
||||
CurrentCallItem = new CodecActiveCallItem();
|
||||
CurrentCallItem.Type = eCodecCallType.Audio;
|
||||
CurrentCallItem.Id = "-audio-";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
void SendFullStatus()
|
||||
{
|
||||
|
||||
|
||||
this.PostStatusMessage(new
|
||||
{
|
||||
calls = GetCurrentCallList(),
|
||||
currentCallString = EISC.GetString(SCurrentCallNumber),
|
||||
currentDialString = EISC.GetString(SCurrentDialString),
|
||||
isInCall = EISC.GetString(SHookState) == "Connected"
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="appServerController"></param>
|
||||
protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
|
||||
{
|
||||
//EISC.SetStringSigAction(SCurrentDialString, s => PostStatusMessage(new { currentDialString = s }));
|
||||
|
||||
EISC.SetStringSigAction(SHookState, s =>
|
||||
{
|
||||
CurrentCallItem.Status = (eCodecCallStatus)Enum.Parse(typeof(eCodecCallStatus), s, true);
|
||||
//GetCurrentCallList();
|
||||
SendFullStatus();
|
||||
});
|
||||
|
||||
EISC.SetStringSigAction(SCurrentCallNumber, s =>
|
||||
{
|
||||
CurrentCallItem.Number = s;
|
||||
SendCallsList();
|
||||
});
|
||||
|
||||
EISC.SetStringSigAction(SCurrentCallName, s =>
|
||||
{
|
||||
CurrentCallItem.Name = s;
|
||||
SendCallsList();
|
||||
});
|
||||
|
||||
EISC.SetStringSigAction(SCallDirection, s =>
|
||||
{
|
||||
CurrentCallItem.Direction = (eCodecCallDirection)Enum.Parse(typeof(eCodecCallDirection), s, true);
|
||||
SendCallsList();
|
||||
});
|
||||
|
||||
// Add press and holds using helper
|
||||
Action<string, uint> addPHAction = (s, u) =>
|
||||
AppServerController.AddAction(MessagePath + s, new PressAndHoldAction(b => EISC.SetBool(u, b)));
|
||||
|
||||
// Add straight pulse calls
|
||||
Action<string, uint> addAction = (s, u) =>
|
||||
AppServerController.AddAction(MessagePath + s, new Action(() => EISC.PulseBool(u, 100)));
|
||||
addAction("/endCallById", BDialHangupOnHook);
|
||||
addAction("/endAllCalls", BDialHangupOnHook);
|
||||
addAction("/acceptById", BIncomingAnswer);
|
||||
addAction("/rejectById", BIncomingReject);
|
||||
addAction("/speedDial1", BSpeedDial1);
|
||||
addAction("/speedDial2", BSpeedDial2);
|
||||
addAction("/speedDial3", BSpeedDial3);
|
||||
addAction("/speedDial4", BSpeedDial4);
|
||||
|
||||
// Get status
|
||||
AppServerController.AddAction(MessagePath + "/fullStatus", new Action(SendFullStatus));
|
||||
// Dial on string
|
||||
AppServerController.AddAction(MessagePath + "/dial", new Action<string>(s => EISC.SetString(SCurrentDialString, s)));
|
||||
// Pulse DTMF
|
||||
AppServerController.AddAction(MessagePath + "/dtmf", new Action<string>(s =>
|
||||
{
|
||||
if (DTMFMap.ContainsKey(s))
|
||||
{
|
||||
EISC.PulseBool(DTMFMap[s], 100);
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
void SendCallsList()
|
||||
{
|
||||
PostStatusMessage(new
|
||||
{
|
||||
calls = GetCurrentCallList(),
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Turns the
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
List<CodecActiveCallItem> GetCurrentCallList()
|
||||
{
|
||||
if (CurrentCallItem.Status == eCodecCallStatus.Disconnected)
|
||||
{
|
||||
return new List<CodecActiveCallItem>();
|
||||
}
|
||||
else
|
||||
{
|
||||
return new List<CodecActiveCallItem>() { CurrentCallItem };
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,648 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
using Crestron.SimplSharpPro.EthernetCommunication;
|
||||
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Devices.Common.Codec;
|
||||
|
||||
namespace PepperDash.Essentials.AppServer.Messengers
|
||||
{
|
||||
public class Ddvc01VtcMessenger : MessengerBase
|
||||
{
|
||||
BasicTriList EISC;
|
||||
|
||||
/********* Bools *********/
|
||||
/// <summary>
|
||||
/// 724
|
||||
/// </summary>
|
||||
const uint BDialHangup = 724;
|
||||
/// <summary>
|
||||
/// 750
|
||||
/// </summary>
|
||||
const uint BCallIncoming = 750;
|
||||
/// <summary>
|
||||
/// 751
|
||||
/// </summary>
|
||||
const uint BIncomingAnswer = 751;
|
||||
/// <summary>
|
||||
/// 752
|
||||
/// </summary>
|
||||
const uint BIncomingReject = 752;
|
||||
/// <summary>
|
||||
/// 741
|
||||
/// </summary>
|
||||
const uint BSpeedDial1 = 741;
|
||||
/// <summary>
|
||||
/// 742
|
||||
/// </summary>
|
||||
const uint BSpeedDial2 = 742;
|
||||
/// <summary>
|
||||
/// 743
|
||||
/// </summary>
|
||||
const uint BSpeedDial3 = 743;
|
||||
/// <summary>
|
||||
/// 744
|
||||
/// </summary>
|
||||
const uint BSpeedDial4 = 744;
|
||||
/// <summary>
|
||||
/// 800
|
||||
/// </summary>
|
||||
const uint BDirectorySearchBusy = 800;
|
||||
/// <summary>
|
||||
/// 801
|
||||
/// </summary>
|
||||
const uint BDirectoryLineSelected = 801;
|
||||
/// <summary>
|
||||
/// 801 when selected entry is a contact
|
||||
/// </summary>
|
||||
const uint BDirectoryEntryIsContact = 801;
|
||||
/// <summary>
|
||||
/// 802 To show/hide back button
|
||||
/// </summary>
|
||||
const uint BDirectoryIsRoot = 802;
|
||||
/// <summary>
|
||||
/// 803 Pulse from system to inform us when directory is ready
|
||||
/// </summary>
|
||||
const uint DDirectoryHasChanged = 803;
|
||||
/// <summary>
|
||||
/// 804
|
||||
/// </summary>
|
||||
const uint BDirectoryRoot = 804;
|
||||
/// <summary>
|
||||
/// 805
|
||||
/// </summary>
|
||||
const uint BDirectoryFolderBack = 805;
|
||||
/// <summary>
|
||||
/// 806
|
||||
/// </summary>
|
||||
const uint BDirectoryDialSelectedLine = 806;
|
||||
/// <summary>
|
||||
/// 811
|
||||
/// </summary>
|
||||
const uint BCameraControlUp = 811;
|
||||
/// <summary>
|
||||
/// 812
|
||||
/// </summary>
|
||||
const uint BCameraControlDown = 812;
|
||||
/// <summary>
|
||||
/// 813
|
||||
/// </summary>
|
||||
const uint BCameraControlLeft = 813;
|
||||
/// <summary>
|
||||
/// 814
|
||||
/// </summary>
|
||||
const uint BCameraControlRight = 814;
|
||||
/// <summary>
|
||||
/// 815
|
||||
/// </summary>
|
||||
const uint BCameraControlZoomIn = 815;
|
||||
/// <summary>
|
||||
/// 816
|
||||
/// </summary>
|
||||
const uint BCameraControlZoomOut = 816;
|
||||
/// <summary>
|
||||
/// 821 - 826
|
||||
/// </summary>
|
||||
const uint BCameraPresetStart = 821;
|
||||
|
||||
/// <summary>
|
||||
/// 831
|
||||
/// </summary>
|
||||
const uint BCameraModeAuto = 831;
|
||||
/// <summary>
|
||||
/// 832
|
||||
/// </summary>
|
||||
const uint BCameraModeManual = 832;
|
||||
/// <summary>
|
||||
/// 833
|
||||
/// </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 *********/
|
||||
/// <summary>
|
||||
/// 760
|
||||
/// </summary>
|
||||
const uint UCameraNumberSelect = 760;
|
||||
/// <summary>
|
||||
/// 801
|
||||
/// </summary>
|
||||
const uint UDirectorySelectRow = 801;
|
||||
/// <summary>
|
||||
/// 801
|
||||
/// </summary>
|
||||
const uint UDirectoryRowCount = 801;
|
||||
|
||||
|
||||
|
||||
/********* Strings *********/
|
||||
/// <summary>
|
||||
/// 701
|
||||
/// </summary>
|
||||
const uint SCurrentDialString = 701;
|
||||
/// <summary>
|
||||
/// 702
|
||||
/// </summary>
|
||||
const uint SCurrentCallName = 702;
|
||||
/// <summary>
|
||||
/// 703
|
||||
/// </summary>
|
||||
const uint SCurrentCallNumber = 703;
|
||||
/// <summary>
|
||||
/// 731
|
||||
/// </summary>
|
||||
const uint SHookState = 731;
|
||||
/// <summary>
|
||||
/// 722
|
||||
/// </summary>
|
||||
const uint SCallDirection = 722;
|
||||
/// <summary>
|
||||
/// 751
|
||||
/// </summary>
|
||||
const uint SIncomingCallName = 751;
|
||||
/// <summary>
|
||||
/// 752
|
||||
/// </summary>
|
||||
const uint SIncomingCallNumber = 752;
|
||||
|
||||
/// <summary>
|
||||
/// 800
|
||||
/// </summary>
|
||||
const uint SDirectorySearchString = 800;
|
||||
/// <summary>
|
||||
/// 801-1055
|
||||
/// </summary>
|
||||
const uint SDirectoryEntriesStart = 801;
|
||||
/// <summary>
|
||||
/// 1056
|
||||
/// </summary>
|
||||
const uint SDirectoryEntrySelectedName = 1056;
|
||||
/// <summary>
|
||||
/// 1057
|
||||
/// </summary>
|
||||
const uint SDirectoryEntrySelectedNumber = 1057;
|
||||
/// <summary>
|
||||
/// 1058
|
||||
/// </summary>
|
||||
const uint SDirectorySelectedFolderName = 1058;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 701-712 0-9*#
|
||||
/// </summary>
|
||||
Dictionary<string, uint> DTMFMap = new Dictionary<string, uint>
|
||||
{
|
||||
{ "1", 701 },
|
||||
{ "2", 702 },
|
||||
{ "3", 703 },
|
||||
{ "4", 704 },
|
||||
{ "5", 705 },
|
||||
{ "6", 706 },
|
||||
{ "7", 707 },
|
||||
{ "8", 708 },
|
||||
{ "9", 709 },
|
||||
{ "0", 710 },
|
||||
{ "*", 711 },
|
||||
{ "#", 712 },
|
||||
};
|
||||
|
||||
CodecActiveCallItem CurrentCallItem;
|
||||
CodecActiveCallItem IncomingCallItem;
|
||||
|
||||
ushort PreviousDirectoryLength = 0;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="eisc"></param>
|
||||
/// <param name="messagePath"></param>
|
||||
public Ddvc01VtcMessenger(string key, BasicTriList eisc, string messagePath)
|
||||
: base(key, messagePath)
|
||||
{
|
||||
EISC = eisc;
|
||||
|
||||
CurrentCallItem = new CodecActiveCallItem();
|
||||
CurrentCallItem.Type = eCodecCallType.Video;
|
||||
CurrentCallItem.Id = "-video-";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="appServerController"></param>
|
||||
protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
|
||||
{
|
||||
var asc = appServerController;
|
||||
EISC.SetStringSigAction(SHookState, s =>
|
||||
{
|
||||
CurrentCallItem.Status = (eCodecCallStatus)Enum.Parse(typeof(eCodecCallStatus), s, true);
|
||||
PostFullStatus(); // SendCallsList();
|
||||
});
|
||||
|
||||
EISC.SetStringSigAction(SCurrentCallNumber, s =>
|
||||
{
|
||||
CurrentCallItem.Number = s;
|
||||
PostCallsList();
|
||||
});
|
||||
|
||||
EISC.SetStringSigAction(SCurrentCallName, s =>
|
||||
{
|
||||
CurrentCallItem.Name = s;
|
||||
PostCallsList();
|
||||
});
|
||||
|
||||
EISC.SetStringSigAction(SCallDirection, s =>
|
||||
{
|
||||
CurrentCallItem.Direction = (eCodecCallDirection)Enum.Parse(typeof(eCodecCallDirection), s, true);
|
||||
PostCallsList();
|
||||
});
|
||||
|
||||
EISC.SetBoolSigAction(BCallIncoming, b =>
|
||||
{
|
||||
if (b)
|
||||
{
|
||||
var ica = new CodecActiveCallItem()
|
||||
{
|
||||
Direction = eCodecCallDirection.Incoming,
|
||||
Id = "-video-incoming",
|
||||
Name = EISC.GetString(SIncomingCallName),
|
||||
Number = EISC.GetString(SIncomingCallNumber),
|
||||
Status = eCodecCallStatus.Ringing,
|
||||
Type = eCodecCallType.Video
|
||||
};
|
||||
IncomingCallItem = ica;
|
||||
}
|
||||
else
|
||||
{
|
||||
IncomingCallItem = null;
|
||||
}
|
||||
PostCallsList();
|
||||
});
|
||||
|
||||
EISC.SetBoolSigAction(BCameraSupportsAutoMode, b =>
|
||||
{
|
||||
PostStatusMessage(new
|
||||
{
|
||||
cameraSupportsAutoMode = b
|
||||
});
|
||||
});
|
||||
EISC.SetBoolSigAction(BCameraSupportsOffMode, b =>
|
||||
{
|
||||
PostStatusMessage(new
|
||||
{
|
||||
cameraSupportsOffMode = b
|
||||
});
|
||||
});
|
||||
|
||||
// Directory insanity
|
||||
EISC.SetUShortSigAction(UDirectoryRowCount, u =>
|
||||
{
|
||||
// The length of the list comes in before the list does.
|
||||
// Splice the sig change operation onto the last string sig that will be changing
|
||||
// when the directory entries make it through.
|
||||
if (PreviousDirectoryLength > 0)
|
||||
{
|
||||
EISC.ClearStringSigAction(SDirectoryEntriesStart + PreviousDirectoryLength - 1);
|
||||
}
|
||||
EISC.SetStringSigAction(SDirectoryEntriesStart + u - 1, s => PostDirectory());
|
||||
PreviousDirectoryLength = u;
|
||||
});
|
||||
|
||||
EISC.SetStringSigAction(SDirectoryEntrySelectedName, s =>
|
||||
{
|
||||
PostStatusMessage(new
|
||||
{
|
||||
directoryContactSelected = new
|
||||
{
|
||||
name = EISC.GetString(SDirectoryEntrySelectedName),
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
EISC.SetStringSigAction(SDirectoryEntrySelectedNumber, s =>
|
||||
{
|
||||
PostStatusMessage(new
|
||||
{
|
||||
directoryContactSelected = new
|
||||
{
|
||||
number = EISC.GetString(SDirectoryEntrySelectedNumber),
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
EISC.SetStringSigAction(SDirectorySelectedFolderName, s => PostStatusMessage(new
|
||||
{
|
||||
directorySelectedFolderName = EISC.GetString(SDirectorySelectedFolderName)
|
||||
}));
|
||||
|
||||
EISC.SetSigTrueAction(BCameraModeAuto, () => PostCameraMode());
|
||||
EISC.SetSigTrueAction(BCameraModeManual, () => PostCameraMode());
|
||||
EISC.SetSigTrueAction(BCameraModeOff, () => PostCameraMode());
|
||||
|
||||
EISC.SetBoolSigAction(BCameraSelfView, b => PostStatusMessage(new
|
||||
{
|
||||
cameraSelfView = b
|
||||
}));
|
||||
|
||||
EISC.SetUShortSigAction(UCameraNumberSelect, (u) => PostSelectedCamera());
|
||||
|
||||
|
||||
// Add press and holds using helper action
|
||||
Action<string, uint> addPHAction = (s, u) =>
|
||||
AppServerController.AddAction(MessagePath + s, new PressAndHoldAction(b => EISC.SetBool(u, b)));
|
||||
addPHAction("/cameraUp", BCameraControlUp);
|
||||
addPHAction("/cameraDown", BCameraControlDown);
|
||||
addPHAction("/cameraLeft", BCameraControlLeft);
|
||||
addPHAction("/cameraRight", BCameraControlRight);
|
||||
addPHAction("/cameraZoomIn", BCameraControlZoomIn);
|
||||
addPHAction("/cameraZoomOut", BCameraControlZoomOut);
|
||||
|
||||
// Add straight pulse calls using helper action
|
||||
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);
|
||||
addAction("/speedDial2", BSpeedDial2);
|
||||
addAction("/speedDial3", BSpeedDial3);
|
||||
addAction("/speedDial4", BSpeedDial4);
|
||||
addAction("/cameraModeAuto", BCameraModeAuto);
|
||||
addAction("/cameraModeManual", BCameraModeManual);
|
||||
addAction("/cameraModeOff", BCameraModeOff);
|
||||
addAction("/cameraSelfView", BCameraSelfView);
|
||||
addAction("/cameraLayout", BCameraLayout);
|
||||
|
||||
asc.AddAction("/cameraSelect", new Action<string>(SelectCamera));
|
||||
|
||||
// camera presets
|
||||
for(uint i = 0; i < 6; i++)
|
||||
{
|
||||
addAction("/cameraPreset" + (i + 1), BCameraPresetStart + i);
|
||||
}
|
||||
|
||||
asc.AddAction(MessagePath + "/isReady", new Action(PostIsReady));
|
||||
// Get status
|
||||
asc.AddAction(MessagePath + "/fullStatus", new Action(PostFullStatus));
|
||||
// Dial on string
|
||||
asc.AddAction(MessagePath + "/dial", new Action<string>(s =>
|
||||
EISC.SetString(SCurrentDialString, s)));
|
||||
// Pulse DTMF
|
||||
asc.AddAction(MessagePath + "/dtmf", new Action<string>(s =>
|
||||
{
|
||||
if (DTMFMap.ContainsKey(s))
|
||||
{
|
||||
EISC.PulseBool(DTMFMap[s], 100);
|
||||
}
|
||||
}));
|
||||
|
||||
// Directory madness
|
||||
asc.AddAction(MessagePath + "/directoryRoot", new Action(() => EISC.PulseBool(BDirectoryRoot)));
|
||||
asc.AddAction(MessagePath + "/directoryBack", new Action(() => EISC.PulseBool(BDirectoryFolderBack)));
|
||||
asc.AddAction(MessagePath + "/directoryById", new Action<string>(s =>
|
||||
{
|
||||
// the id should contain the line number to forward to simpl
|
||||
try
|
||||
{
|
||||
var u = ushort.Parse(s);
|
||||
EISC.SetUshort(UDirectorySelectRow, u);
|
||||
EISC.PulseBool(BDirectoryLineSelected);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
Debug.Console(1, this, Debug.ErrorLogLevel.Warning,
|
||||
"/directoryById request contains non-numeric ID incompatible with DDVC bridge");
|
||||
}
|
||||
|
||||
}));
|
||||
asc.AddAction(MessagePath + "/directorySelectContact", new Action<string>(s =>
|
||||
{
|
||||
try
|
||||
{
|
||||
var u = ushort.Parse(s);
|
||||
EISC.SetUshort(UDirectorySelectRow, u);
|
||||
EISC.PulseBool(BDirectoryLineSelected);
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
}
|
||||
}));
|
||||
asc.AddAction(MessagePath + "/directoryDialContact", new Action(() => {
|
||||
EISC.PulseBool(BDirectoryDialSelectedLine);
|
||||
}));
|
||||
asc.AddAction(MessagePath + "/getDirectory", new Action(() =>
|
||||
{
|
||||
if (EISC.GetUshort(UDirectoryRowCount) > 0)
|
||||
{
|
||||
PostDirectory();
|
||||
}
|
||||
else
|
||||
{
|
||||
EISC.PulseBool(BDirectoryRoot);
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
void PostFullStatus()
|
||||
{
|
||||
this.PostStatusMessage(new
|
||||
{
|
||||
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
|
||||
{
|
||||
name = EISC.GetString(SDirectoryEntrySelectedName),
|
||||
number = EISC.GetString(SDirectoryEntrySelectedNumber)
|
||||
},
|
||||
directorySelectedFolderName = EISC.GetString(SDirectorySelectedFolderName),
|
||||
isInCall = EISC.GetString(SHookState) == "Connected",
|
||||
hasDirectory = true,
|
||||
hasDirectorySearch = false,
|
||||
hasRecents = !EISC.BooleanOutput[502].BoolValue,
|
||||
hasCameras = true,
|
||||
showCamerasWhenNotInCall = EISC.BooleanOutput[503].BoolValue,
|
||||
selectedCamera = GetSelectedCamera(),
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
void PostDirectory()
|
||||
{
|
||||
var u = EISC.GetUshort(UDirectoryRowCount);
|
||||
var items = new List<object>();
|
||||
for (uint i = 0; i < u; i++)
|
||||
{
|
||||
var name = EISC.GetString(SDirectoryEntriesStart + i);
|
||||
var id = (i + 1).ToString();
|
||||
// is folder or contact?
|
||||
if (name.StartsWith("[+]"))
|
||||
{
|
||||
items.Add(new
|
||||
{
|
||||
folderId = id,
|
||||
name = name
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
items.Add(new
|
||||
{
|
||||
contactId = id,
|
||||
name = name
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
var directoryMessage = new
|
||||
{
|
||||
currentDirectory = new
|
||||
{
|
||||
isRootDirectory = EISC.GetBool(BDirectoryIsRoot),
|
||||
directoryResults = items
|
||||
}
|
||||
};
|
||||
PostStatusMessage(directoryMessage);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
void PostCameraMode()
|
||||
{
|
||||
PostStatusMessage(new
|
||||
{
|
||||
cameraMode = GetCameraMode()
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="mode"></param>
|
||||
string GetCameraMode()
|
||||
{
|
||||
string m;
|
||||
if (EISC.GetBool(BCameraModeAuto)) m = "auto";
|
||||
else if (EISC.GetBool(BCameraModeManual)) m = "manual";
|
||||
else m = "off";
|
||||
return m;
|
||||
}
|
||||
|
||||
void PostSelectedCamera()
|
||||
{
|
||||
PostStatusMessage(new
|
||||
{
|
||||
selectedCamera = GetSelectedCamera()
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
string GetSelectedCamera()
|
||||
{
|
||||
var num = EISC.GetUshort(UCameraNumberSelect);
|
||||
string m;
|
||||
if (num == 100)
|
||||
{
|
||||
m = "cameraFar";
|
||||
}
|
||||
else
|
||||
{
|
||||
m = "camera" + num;
|
||||
}
|
||||
return m;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
void PostIsReady()
|
||||
{
|
||||
PostStatusMessage(new
|
||||
{
|
||||
isReady = true
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
void PostCallsList()
|
||||
{
|
||||
PostStatusMessage(new
|
||||
{
|
||||
calls = GetCurrentCallList(),
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="s"></param>
|
||||
void SelectCamera(string s)
|
||||
{
|
||||
var cam = s.Substring(6);
|
||||
if (cam.ToLower() == "far")
|
||||
{
|
||||
EISC.SetUshort(UCameraNumberSelect, 100);
|
||||
}
|
||||
else
|
||||
{
|
||||
EISC.SetUshort(UCameraNumberSelect, UInt16.Parse(cam));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Turns the
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
List<CodecActiveCallItem> GetCurrentCallList()
|
||||
{
|
||||
var list = new List<CodecActiveCallItem>();
|
||||
if (CurrentCallItem.Status != eCodecCallStatus.Disconnected)
|
||||
{
|
||||
list.Add(CurrentCallItem);
|
||||
}
|
||||
if (EISC.GetBool(BCallIncoming)) {
|
||||
|
||||
}
|
||||
return list;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
|
||||
|
||||
namespace PepperDash.Essentials.AppServer.Messengers
|
||||
{
|
||||
public class IRunRouteActionMessenger : MessengerBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Device being bridged
|
||||
/// </summary>
|
||||
public IRunRouteAction RoutingDevice {get; private set;}
|
||||
|
||||
public IRunRouteActionMessenger(string key, IRunRouteAction routingDevice, string messagePath)
|
||||
: base(key, messagePath)
|
||||
{
|
||||
if (routingDevice == null)
|
||||
throw new ArgumentNullException("routingDevice");
|
||||
|
||||
RoutingDevice = routingDevice;
|
||||
|
||||
var routingSink = RoutingDevice as IRoutingSinkNoSwitching;
|
||||
|
||||
if (routingSink != null)
|
||||
{
|
||||
routingSink.CurrentSourceChange += new SourceInfoChangeHandler(routingSink_CurrentSourceChange);
|
||||
}
|
||||
}
|
||||
|
||||
void routingSink_CurrentSourceChange(SourceListItem info, ChangeType type)
|
||||
{
|
||||
SendRoutingFullMessageObject();
|
||||
}
|
||||
|
||||
protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
|
||||
{
|
||||
appServerController.AddAction(MessagePath + "/fullStatus", new Action(SendRoutingFullMessageObject));
|
||||
|
||||
appServerController.AddAction(MessagePath + "/source", new Action<SourceSelectMessageContent>(c =>
|
||||
{
|
||||
RoutingDevice.RunRouteAction(c.SourceListItem, c.SourceListKey);
|
||||
}));
|
||||
|
||||
var sinkDevice = RoutingDevice as IRoutingSinkNoSwitching;
|
||||
if(sinkDevice != null)
|
||||
{
|
||||
sinkDevice.CurrentSourceChange += new SourceInfoChangeHandler((o, a) =>
|
||||
{
|
||||
SendRoutingFullMessageObject();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Helper method to update full status of the routing device
|
||||
/// </summary>
|
||||
void SendRoutingFullMessageObject()
|
||||
{
|
||||
var sinkDevice = RoutingDevice as IRoutingSinkNoSwitching;
|
||||
|
||||
if(sinkDevice != null)
|
||||
{
|
||||
var sourceKey = sinkDevice.CurrentSourceInfoKey;
|
||||
|
||||
if (string.IsNullOrEmpty(sourceKey))
|
||||
sourceKey = "none";
|
||||
|
||||
PostStatusMessage(new
|
||||
{
|
||||
selectedSourceKey = sourceKey
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
230
PepperDashEssentials/AppServer/Messengers/SIMPLAtcMessenger.cs
Normal file
230
PepperDashEssentials/AppServer/Messengers/SIMPLAtcMessenger.cs
Normal file
@@ -0,0 +1,230 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
using Crestron.SimplSharpPro.EthernetCommunication;
|
||||
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Devices.Common.Codec;
|
||||
|
||||
namespace PepperDash.Essentials.AppServer.Messengers
|
||||
{
|
||||
public class SIMPLAtcMessenger : MessengerBase
|
||||
{
|
||||
BasicTriList EISC;
|
||||
|
||||
public SIMPLAtcJoinMap JoinMap {get; private set;}
|
||||
|
||||
///// <summary>
|
||||
///// 221
|
||||
///// </summary>
|
||||
//const uint BDialHangupOnHook = 221;
|
||||
|
||||
///// <summary>
|
||||
///// 251
|
||||
///// </summary>
|
||||
//const uint BIncomingAnswer = 251;
|
||||
///// <summary>
|
||||
///// 252
|
||||
///// </summary>
|
||||
//const uint BIncomingReject = 252;
|
||||
///// <summary>
|
||||
///// 241
|
||||
///// </summary>
|
||||
//const uint BSpeedDial1 = 241;
|
||||
///// <summary>
|
||||
///// 242
|
||||
///// </summary>
|
||||
//const uint BSpeedDial2 = 242;
|
||||
///// <summary>
|
||||
///// 243
|
||||
///// </summary>
|
||||
//const uint BSpeedDial3 = 243;
|
||||
///// <summary>
|
||||
///// 244
|
||||
///// </summary>
|
||||
//const uint BSpeedDial4 = 244;
|
||||
|
||||
///// <summary>
|
||||
///// 201
|
||||
///// </summary>
|
||||
//const uint SCurrentDialString = 201;
|
||||
///// <summary>
|
||||
///// 211
|
||||
///// </summary>
|
||||
//const uint SCurrentCallNumber = 211;
|
||||
///// <summary>
|
||||
///// 212
|
||||
///// </summary>
|
||||
//const uint SCurrentCallName = 212;
|
||||
///// <summary>
|
||||
///// 221
|
||||
///// </summary>
|
||||
//const uint SHookState = 221;
|
||||
///// <summary>
|
||||
///// 222
|
||||
///// </summary>
|
||||
//const uint SCallDirection = 222;
|
||||
|
||||
///// <summary>
|
||||
///// 201-212 0-9*#
|
||||
///// </summary>
|
||||
//Dictionary<string, uint> DTMFMap = new Dictionary<string, uint>
|
||||
//{
|
||||
// { "1", 201 },
|
||||
// { "2", 202 },
|
||||
// { "3", 203 },
|
||||
// { "4", 204 },
|
||||
// { "5", 205 },
|
||||
// { "6", 206 },
|
||||
// { "7", 207 },
|
||||
// { "8", 208 },
|
||||
// { "9", 209 },
|
||||
// { "0", 210 },
|
||||
// { "*", 211 },
|
||||
// { "#", 212 },
|
||||
//};
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
CodecActiveCallItem CurrentCallItem;
|
||||
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="eisc"></param>
|
||||
/// <param name="messagePath"></param>
|
||||
public SIMPLAtcMessenger(string key, BasicTriList eisc, string messagePath)
|
||||
: base(key, messagePath)
|
||||
{
|
||||
EISC = eisc;
|
||||
|
||||
JoinMap = new SIMPLAtcJoinMap(201);
|
||||
|
||||
CurrentCallItem = new CodecActiveCallItem();
|
||||
CurrentCallItem.Type = eCodecCallType.Audio;
|
||||
CurrentCallItem.Id = "-audio-";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
void SendFullStatus()
|
||||
{
|
||||
|
||||
|
||||
this.PostStatusMessage(new
|
||||
{
|
||||
calls = GetCurrentCallList(),
|
||||
currentCallString = EISC.GetString(JoinMap.CurrentCallName.JoinNumber),
|
||||
currentDialString = EISC.GetString(JoinMap.CurrentDialString.JoinNumber),
|
||||
isInCall = EISC.GetString(JoinMap.HookState.JoinNumber) == "Connected"
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="appServerController"></param>
|
||||
protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
|
||||
{
|
||||
//EISC.SetStringSigAction(SCurrentDialString, s => PostStatusMessage(new { currentDialString = s }));
|
||||
|
||||
EISC.SetStringSigAction(JoinMap.HookState.JoinNumber, s =>
|
||||
{
|
||||
CurrentCallItem.Status = (eCodecCallStatus)Enum.Parse(typeof(eCodecCallStatus), s, true);
|
||||
//GetCurrentCallList();
|
||||
SendFullStatus();
|
||||
});
|
||||
|
||||
EISC.SetStringSigAction(JoinMap.CurrentCallNumber.JoinNumber, s =>
|
||||
{
|
||||
CurrentCallItem.Number = s;
|
||||
SendCallsList();
|
||||
});
|
||||
|
||||
EISC.SetStringSigAction(JoinMap.CurrentCallName.JoinNumber, s =>
|
||||
{
|
||||
CurrentCallItem.Name = s;
|
||||
SendCallsList();
|
||||
});
|
||||
|
||||
EISC.SetStringSigAction(JoinMap.CallDirection.JoinNumber, s =>
|
||||
{
|
||||
CurrentCallItem.Direction = (eCodecCallDirection)Enum.Parse(typeof(eCodecCallDirection), s, true);
|
||||
SendCallsList();
|
||||
});
|
||||
|
||||
// Add press and holds using helper
|
||||
Action<string, uint> addPHAction = (s, u) =>
|
||||
AppServerController.AddAction(MessagePath + s, new PressAndHoldAction(b => EISC.SetBool(u, b)));
|
||||
|
||||
// Add straight pulse calls
|
||||
Action<string, uint> addAction = (s, u) =>
|
||||
AppServerController.AddAction(MessagePath + s, new Action(() => EISC.PulseBool(u, 100)));
|
||||
addAction("/endCallById", JoinMap.EndCall.JoinNumber);
|
||||
addAction("/endAllCalls", JoinMap.EndCall.JoinNumber);
|
||||
addAction("/acceptById", JoinMap.IncomingAnswer.JoinNumber);
|
||||
addAction("/rejectById", JoinMap.IncomingReject.JoinNumber);
|
||||
|
||||
var speeddialStart = JoinMap.SpeedDialStart.JoinNumber;
|
||||
var speeddialEnd = JoinMap.SpeedDialStart.JoinNumber + JoinMap.SpeedDialStart.JoinSpan;
|
||||
|
||||
var speedDialIndex = 1;
|
||||
for (uint i = speeddialStart; i < speeddialEnd; i++)
|
||||
{
|
||||
addAction(string.Format("/speedDial{0}", speedDialIndex), i);
|
||||
speedDialIndex++;
|
||||
}
|
||||
|
||||
// Get status
|
||||
AppServerController.AddAction(MessagePath + "/fullStatus", new Action(SendFullStatus));
|
||||
// Dial on string
|
||||
AppServerController.AddAction(MessagePath + "/dial", new Action<string>(s => EISC.SetString(JoinMap.CurrentDialString.JoinNumber, s)));
|
||||
// Pulse DTMF
|
||||
AppServerController.AddAction(MessagePath + "/dtmf", new Action<string>(s =>
|
||||
{
|
||||
var join = JoinMap.Joins[s];
|
||||
if (join != null)
|
||||
{
|
||||
if (join.JoinNumber > 0)
|
||||
{
|
||||
EISC.PulseBool(join.JoinNumber, 100);
|
||||
}
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
void SendCallsList()
|
||||
{
|
||||
PostStatusMessage(new
|
||||
{
|
||||
calls = GetCurrentCallList(),
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Turns the
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
List<CodecActiveCallItem> GetCurrentCallList()
|
||||
{
|
||||
if (CurrentCallItem.Status == eCodecCallStatus.Disconnected)
|
||||
{
|
||||
return new List<CodecActiveCallItem>();
|
||||
}
|
||||
else
|
||||
{
|
||||
return new List<CodecActiveCallItem>() { CurrentCallItem };
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,149 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
using Crestron.SimplSharpPro.EthernetCommunication;
|
||||
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Bridges;
|
||||
using PepperDash.Essentials.Devices.Common.Cameras;
|
||||
|
||||
namespace PepperDash.Essentials.AppServer.Messengers
|
||||
{
|
||||
public class SIMPLCameraMessenger : MessengerBase
|
||||
{
|
||||
BasicTriList EISC;
|
||||
|
||||
CameraControllerJoinMap JoinMap;
|
||||
|
||||
|
||||
public SIMPLCameraMessenger(string key, BasicTriList eisc, string messagePath, uint joinStart)
|
||||
: base(key, messagePath)
|
||||
{
|
||||
EISC = eisc;
|
||||
|
||||
JoinMap = new CameraControllerJoinMap(joinStart);
|
||||
|
||||
EISC.SetUShortSigAction(JoinMap.NumberOfPresets.JoinNumber, (u) => SendCameraFullMessageObject());
|
||||
|
||||
EISC.SetBoolSigAction(JoinMap.CameraModeAuto.JoinNumber, (b) => PostCameraMode());
|
||||
EISC.SetBoolSigAction(JoinMap.CameraModeManual.JoinNumber, (b) => PostCameraMode());
|
||||
EISC.SetBoolSigAction(JoinMap.CameraModeOff.JoinNumber, (b) => PostCameraMode());
|
||||
}
|
||||
|
||||
|
||||
protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
|
||||
{
|
||||
var asc = appServerController;
|
||||
|
||||
asc.AddAction(MessagePath + "/fullStatus", new Action(SendCameraFullMessageObject));
|
||||
|
||||
// Add press and holds using helper action
|
||||
Action<string, uint> addPHAction = (s, u) =>
|
||||
asc.AddAction(MessagePath + s, new PressAndHoldAction(b => EISC.SetBool(u, b)));
|
||||
addPHAction("/cameraUp", JoinMap.TiltUp.JoinNumber);
|
||||
addPHAction("/cameraDown", JoinMap.TiltDown.JoinNumber);
|
||||
addPHAction("/cameraLeft", JoinMap.PanLeft.JoinNumber);
|
||||
addPHAction("/cameraRight", JoinMap.PanRight.JoinNumber);
|
||||
addPHAction("/cameraZoomIn", JoinMap.ZoomIn.JoinNumber);
|
||||
addPHAction("/cameraZoomOut", JoinMap.ZoomOut.JoinNumber);
|
||||
|
||||
Action<string, uint> addAction = (s, u) =>
|
||||
asc.AddAction(MessagePath + s, new Action(() => EISC.PulseBool(u, 100)));
|
||||
|
||||
addAction("/cameraModeAuto", JoinMap.CameraModeAuto.JoinNumber);
|
||||
addAction("/cameraModeManual", JoinMap.CameraModeManual.JoinNumber);
|
||||
addAction("/cameraModeOff", JoinMap.CameraModeOff.JoinNumber);
|
||||
|
||||
var presetStart = JoinMap.PresetRecallStart.JoinNumber;
|
||||
var presetEnd = JoinMap.PresetRecallStart.JoinNumber + JoinMap.PresetRecallStart.JoinSpan;
|
||||
|
||||
int presetId = 1;
|
||||
// camera presets
|
||||
for (uint i = presetStart; i <= presetEnd; i++)
|
||||
{
|
||||
addAction("/cameraPreset" + (presetId), i);
|
||||
presetId++;
|
||||
}
|
||||
}
|
||||
|
||||
public void CustomUnregsiterWithAppServer(MobileControlSystemController appServerController)
|
||||
{
|
||||
appServerController.RemoveAction(MessagePath + "/fullStatus");
|
||||
|
||||
appServerController.RemoveAction(MessagePath + "/cameraUp");
|
||||
appServerController.RemoveAction(MessagePath + "/cameraDown");
|
||||
appServerController.RemoveAction(MessagePath + "/cameraLeft");
|
||||
appServerController.RemoveAction(MessagePath + "/cameraRight");
|
||||
appServerController.RemoveAction(MessagePath + "/cameraZoomIn");
|
||||
appServerController.RemoveAction(MessagePath + "/cameraZoomOut");
|
||||
appServerController.RemoveAction(MessagePath + "/cameraModeAuto");
|
||||
appServerController.RemoveAction(MessagePath + "/cameraModeManual");
|
||||
appServerController.RemoveAction(MessagePath + "/cameraModeOff");
|
||||
|
||||
EISC.SetUShortSigAction(JoinMap.NumberOfPresets.JoinNumber, null);
|
||||
|
||||
EISC.SetBoolSigAction(JoinMap.CameraModeAuto.JoinNumber, null);
|
||||
EISC.SetBoolSigAction(JoinMap.CameraModeManual.JoinNumber, null);
|
||||
EISC.SetBoolSigAction(JoinMap.CameraModeOff.JoinNumber, null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Helper method to update the full status of the camera
|
||||
/// </summary>
|
||||
void SendCameraFullMessageObject()
|
||||
{
|
||||
var presetList = new List<CameraPreset>();
|
||||
|
||||
// Build a list of camera presets based on the names and count
|
||||
if (EISC.GetBool(JoinMap.SupportsPresets.JoinNumber))
|
||||
{
|
||||
var presetStart = JoinMap.PresetLabelStart.JoinNumber;
|
||||
var presetEnd = JoinMap.PresetLabelStart.JoinNumber + JoinMap.NumberOfPresets.JoinNumber;
|
||||
|
||||
var presetId = 1;
|
||||
for (uint i = presetStart; i < presetEnd; i++)
|
||||
{
|
||||
var presetName = EISC.GetString(i);
|
||||
var preset = new CameraPreset(presetId, presetName, string.IsNullOrEmpty(presetName), true);
|
||||
presetList.Add(preset);
|
||||
presetId++;
|
||||
}
|
||||
}
|
||||
|
||||
PostStatusMessage(new
|
||||
{
|
||||
cameraMode = GetCameraMode(),
|
||||
hasPresets = EISC.GetBool(JoinMap.SupportsPresets.JoinNumber),
|
||||
presets = presetList
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
void PostCameraMode()
|
||||
{
|
||||
PostStatusMessage(new
|
||||
{
|
||||
cameraMode = GetCameraMode()
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Computes the current camera mode
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
string GetCameraMode()
|
||||
{
|
||||
string m;
|
||||
if (EISC.GetBool(JoinMap.CameraModeAuto.JoinNumber)) m = eCameraControlMode.Auto.ToString().ToLower();
|
||||
else if (EISC.GetBool(JoinMap.CameraModeManual.JoinNumber)) m = eCameraControlMode.Manual.ToString().ToLower();
|
||||
else m = eCameraControlMode.Off.ToString().ToLower();
|
||||
return m;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
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;
|
||||
|
||||
|
||||
namespace PepperDash.Essentials.AppServer.Messengers
|
||||
{
|
||||
public class SIMPLRouteMessenger : MessengerBase
|
||||
{
|
||||
BasicTriList EISC;
|
||||
|
||||
uint JoinStart;
|
||||
|
||||
public class StringJoin
|
||||
{
|
||||
/// <summary>
|
||||
/// 1
|
||||
/// </summary>
|
||||
public const uint CurrentSource = 1;
|
||||
}
|
||||
|
||||
public SIMPLRouteMessenger(string key, BasicTriList eisc, string messagePath, uint joinStart)
|
||||
: base(key, messagePath)
|
||||
{
|
||||
EISC = eisc;
|
||||
JoinStart = joinStart - 1;
|
||||
|
||||
EISC.SetStringSigAction(JoinStart + StringJoin.CurrentSource, (s) => SendRoutingFullMessageObject(s));
|
||||
}
|
||||
|
||||
protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
|
||||
{
|
||||
appServerController.AddAction(MessagePath + "/fullStatus", new Action(() =>
|
||||
{
|
||||
SendRoutingFullMessageObject(EISC.GetString(JoinStart + StringJoin.CurrentSource));
|
||||
}));
|
||||
|
||||
appServerController.AddAction(MessagePath +"/source", new Action<SourceSelectMessageContent>(c =>
|
||||
{
|
||||
EISC.SetString(JoinStart + StringJoin.CurrentSource, c.SourceListItem);
|
||||
}));
|
||||
|
||||
}
|
||||
|
||||
public void CustomUnregsiterWithAppServer(MobileControlSystemController appServerController)
|
||||
{
|
||||
appServerController.RemoveAction(MessagePath + "/fullStatus");
|
||||
appServerController.RemoveAction(MessagePath + "/source");
|
||||
|
||||
EISC.SetStringSigAction(JoinStart + StringJoin.CurrentSource, null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Helper method to update full status of the routing device
|
||||
/// </summary>
|
||||
void SendRoutingFullMessageObject(string sourceKey)
|
||||
{
|
||||
if (string.IsNullOrEmpty(sourceKey))
|
||||
sourceKey = "none";
|
||||
|
||||
PostStatusMessage(new
|
||||
{
|
||||
selectedSourceKey = sourceKey
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
665
PepperDashEssentials/AppServer/Messengers/SIMPLVtcMessenger.cs
Normal file
665
PepperDashEssentials/AppServer/Messengers/SIMPLVtcMessenger.cs
Normal file
@@ -0,0 +1,665 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
using Crestron.SimplSharpPro.EthernetCommunication;
|
||||
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Devices.Common.Codec;
|
||||
using PepperDash.Essentials.Devices.Common.Cameras;
|
||||
|
||||
namespace PepperDash.Essentials.AppServer.Messengers
|
||||
{
|
||||
public class SIMPLVtcMessenger : MessengerBase
|
||||
{
|
||||
BasicTriList EISC;
|
||||
|
||||
public SIMPLVtcJoinMap JoinMap { get; private set; }
|
||||
|
||||
///********* Bools *********/
|
||||
///// <summary>
|
||||
///// 724
|
||||
///// </summary>
|
||||
//const uint BDialHangup = 724;
|
||||
///// <summary>
|
||||
///// 750
|
||||
///// </summary>
|
||||
//const uint BCallIncoming = 750;
|
||||
///// <summary>
|
||||
///// 751
|
||||
///// </summary>
|
||||
//const uint BIncomingAnswer = 751;
|
||||
///// <summary>
|
||||
///// 752
|
||||
///// </summary>
|
||||
//const uint BIncomingReject = 752;
|
||||
///// <summary>
|
||||
///// 741
|
||||
///// </summary>
|
||||
//const uint BSpeedDial1 = 741;
|
||||
///// <summary>
|
||||
///// 742
|
||||
///// </summary>
|
||||
//const uint BSpeedDial2 = 742;
|
||||
///// <summary>
|
||||
///// 743
|
||||
///// </summary>
|
||||
//const uint BSpeedDial3 = 743;
|
||||
///// <summary>
|
||||
///// 744
|
||||
///// </summary>
|
||||
//const uint BSpeedDial4 = 744;
|
||||
///// <summary>
|
||||
///// 800
|
||||
///// </summary>
|
||||
//const uint BDirectorySearchBusy = 800;
|
||||
///// <summary>
|
||||
///// 801
|
||||
///// </summary>
|
||||
//const uint BDirectoryLineSelected = 801;
|
||||
///// <summary>
|
||||
///// 801 when selected entry is a contact
|
||||
///// </summary>
|
||||
//const uint BDirectoryEntryIsContact = 801;
|
||||
///// <summary>
|
||||
///// 802 To show/hide back button
|
||||
///// </summary>
|
||||
//const uint BDirectoryIsRoot = 802;
|
||||
///// <summary>
|
||||
///// 803 Pulse from system to inform us when directory is ready
|
||||
///// </summary>
|
||||
//const uint BDirectoryHasChanged = 803;
|
||||
///// <summary>
|
||||
///// 804
|
||||
///// </summary>
|
||||
//const uint BDirectoryRoot = 804;
|
||||
///// <summary>
|
||||
///// 805
|
||||
///// </summary>
|
||||
//const uint BDirectoryFolderBack = 805;
|
||||
///// <summary>
|
||||
///// 806
|
||||
///// </summary>
|
||||
//const uint BDirectoryDialSelectedLine = 806;
|
||||
///// <summary>
|
||||
///// 811
|
||||
///// </summary>
|
||||
//const uint BCameraControlUp = 811;
|
||||
///// <summary>
|
||||
///// 812
|
||||
///// </summary>
|
||||
//const uint BCameraControlDown = 812;
|
||||
///// <summary>
|
||||
///// 813
|
||||
///// </summary>
|
||||
//const uint BCameraControlLeft = 813;
|
||||
///// <summary>
|
||||
///// 814
|
||||
///// </summary>
|
||||
//const uint BCameraControlRight = 814;
|
||||
///// <summary>
|
||||
///// 815
|
||||
///// </summary>
|
||||
//const uint BCameraControlZoomIn = 815;
|
||||
///// <summary>
|
||||
///// 816
|
||||
///// </summary>
|
||||
//const uint BCameraControlZoomOut = 816;
|
||||
///// <summary>
|
||||
///// 821 - 826
|
||||
///// </summary>
|
||||
//const uint BCameraPresetStart = 821;
|
||||
|
||||
///// <summary>
|
||||
///// 831
|
||||
///// </summary>
|
||||
//const uint BCameraModeAuto = 831;
|
||||
///// <summary>
|
||||
///// 832
|
||||
///// </summary>
|
||||
//const uint BCameraModeManual = 832;
|
||||
///// <summary>
|
||||
///// 833
|
||||
///// </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 *********/
|
||||
///// <summary>
|
||||
///// 760
|
||||
///// </summary>
|
||||
//const uint UCameraNumberSelect = 760;
|
||||
///// <summary>
|
||||
///// 801
|
||||
///// </summary>
|
||||
//const uint UDirectorySelectRow = 801;
|
||||
///// <summary>
|
||||
///// 801
|
||||
///// </summary>
|
||||
//const uint UDirectoryRowCount = 801;
|
||||
|
||||
|
||||
|
||||
///********* Strings *********/
|
||||
///// <summary>
|
||||
///// 701
|
||||
///// </summary>
|
||||
//const uint SCurrentDialString = 701;
|
||||
///// <summary>
|
||||
///// 702
|
||||
///// </summary>
|
||||
//const uint SCurrentCallName = 702;
|
||||
///// <summary>
|
||||
///// 703
|
||||
///// </summary>
|
||||
//const uint SCurrentCallNumber = 703;
|
||||
///// <summary>
|
||||
///// 731
|
||||
///// </summary>
|
||||
//const uint SHookState = 731;
|
||||
///// <summary>
|
||||
///// 722
|
||||
///// </summary>
|
||||
//const uint SCallDirection = 722;
|
||||
///// <summary>
|
||||
///// 751
|
||||
///// </summary>
|
||||
//const uint SIncomingCallName = 751;
|
||||
///// <summary>
|
||||
///// 752
|
||||
///// </summary>
|
||||
//const uint SIncomingCallNumber = 752;
|
||||
|
||||
///// <summary>
|
||||
///// 800
|
||||
///// </summary>
|
||||
//const uint SDirectorySearchString = 800;
|
||||
///// <summary>
|
||||
///// 801-1055
|
||||
///// </summary>
|
||||
//const uint SDirectoryEntriesStart = 801;
|
||||
///// <summary>
|
||||
///// 1056
|
||||
///// </summary>
|
||||
//const uint SDirectoryEntrySelectedName = 1056;
|
||||
///// <summary>
|
||||
///// 1057
|
||||
///// </summary>
|
||||
//const uint SDirectoryEntrySelectedNumber = 1057;
|
||||
///// <summary>
|
||||
///// 1058
|
||||
///// </summary>
|
||||
//const uint SDirectorySelectedFolderName = 1058;
|
||||
|
||||
|
||||
///// <summary>
|
||||
///// 701-712 0-9*#
|
||||
///// </summary>
|
||||
//Dictionary<string, uint> DTMFMap = new Dictionary<string, uint>
|
||||
//{
|
||||
// { "1", 701 },
|
||||
// { "2", 702 },
|
||||
// { "3", 703 },
|
||||
// { "4", 704 },
|
||||
// { "5", 705 },
|
||||
// { "6", 706 },
|
||||
// { "7", 707 },
|
||||
// { "8", 708 },
|
||||
// { "9", 709 },
|
||||
// { "0", 710 },
|
||||
// { "*", 711 },
|
||||
// { "#", 712 },
|
||||
//};
|
||||
|
||||
CodecActiveCallItem CurrentCallItem;
|
||||
CodecActiveCallItem IncomingCallItem;
|
||||
|
||||
ushort PreviousDirectoryLength = 701;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="eisc"></param>
|
||||
/// <param name="messagePath"></param>
|
||||
public SIMPLVtcMessenger(string key, BasicTriList eisc, string messagePath)
|
||||
: base(key, messagePath)
|
||||
{
|
||||
EISC = eisc;
|
||||
|
||||
JoinMap = new SIMPLVtcJoinMap(701);
|
||||
|
||||
CurrentCallItem = new CodecActiveCallItem();
|
||||
CurrentCallItem.Type = eCodecCallType.Video;
|
||||
CurrentCallItem.Id = "-video-";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="appServerController"></param>
|
||||
protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
|
||||
{
|
||||
var asc = appServerController;
|
||||
EISC.SetStringSigAction(JoinMap.HookState.JoinNumber, s =>
|
||||
{
|
||||
CurrentCallItem.Status = (eCodecCallStatus)Enum.Parse(typeof(eCodecCallStatus), s, true);
|
||||
PostFullStatus(); // SendCallsList();
|
||||
});
|
||||
|
||||
EISC.SetStringSigAction(JoinMap.CurrentCallNumber.JoinNumber, s =>
|
||||
{
|
||||
CurrentCallItem.Number = s;
|
||||
PostCallsList();
|
||||
});
|
||||
|
||||
EISC.SetStringSigAction(JoinMap.CurrentCallName.JoinNumber, s =>
|
||||
{
|
||||
CurrentCallItem.Name = s;
|
||||
PostCallsList();
|
||||
});
|
||||
|
||||
EISC.SetStringSigAction(JoinMap.CallDirection.JoinNumber, s =>
|
||||
{
|
||||
CurrentCallItem.Direction = (eCodecCallDirection)Enum.Parse(typeof(eCodecCallDirection), s, true);
|
||||
PostCallsList();
|
||||
});
|
||||
|
||||
EISC.SetBoolSigAction(JoinMap.IncomingCall.JoinNumber, b =>
|
||||
{
|
||||
if (b)
|
||||
{
|
||||
var ica = new CodecActiveCallItem()
|
||||
{
|
||||
Direction = eCodecCallDirection.Incoming,
|
||||
Id = "-video-incoming",
|
||||
Name = EISC.GetString(JoinMap.IncomingCallName.JoinNumber),
|
||||
Number = EISC.GetString(JoinMap.IncomingCallNumber.JoinNumber),
|
||||
Status = eCodecCallStatus.Ringing,
|
||||
Type = eCodecCallType.Video
|
||||
};
|
||||
IncomingCallItem = ica;
|
||||
}
|
||||
else
|
||||
{
|
||||
IncomingCallItem = null;
|
||||
}
|
||||
PostCallsList();
|
||||
});
|
||||
|
||||
EISC.SetBoolSigAction(JoinMap.CameraSupportsAutoMode.JoinNumber, b =>
|
||||
{
|
||||
PostStatusMessage(new
|
||||
{
|
||||
cameraSupportsAutoMode = b
|
||||
});
|
||||
});
|
||||
EISC.SetBoolSigAction(JoinMap.CameraSupportsOffMode.JoinNumber, b =>
|
||||
{
|
||||
PostStatusMessage(new
|
||||
{
|
||||
cameraSupportsOffMode = b
|
||||
});
|
||||
});
|
||||
|
||||
// Directory insanity
|
||||
EISC.SetUShortSigAction(JoinMap.DirectoryRowCount.JoinNumber, u =>
|
||||
{
|
||||
// The length of the list comes in before the list does.
|
||||
// Splice the sig change operation onto the last string sig that will be changing
|
||||
// when the directory entries make it through.
|
||||
if (PreviousDirectoryLength > 0)
|
||||
{
|
||||
EISC.ClearStringSigAction(JoinMap.DirectoryEntriesStart.JoinNumber + PreviousDirectoryLength - 1);
|
||||
}
|
||||
EISC.SetStringSigAction(JoinMap.DirectoryEntriesStart.JoinNumber + u - 1, s => PostDirectory());
|
||||
PreviousDirectoryLength = u;
|
||||
});
|
||||
|
||||
EISC.SetStringSigAction(JoinMap.DirectoryEntrySelectedName.JoinNumber, s =>
|
||||
{
|
||||
PostStatusMessage(new
|
||||
{
|
||||
directoryContactSelected = new
|
||||
{
|
||||
name = EISC.GetString(JoinMap.DirectoryEntrySelectedName.JoinNumber),
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
EISC.SetStringSigAction(JoinMap.DirectoryEntrySelectedNumber.JoinNumber, s =>
|
||||
{
|
||||
PostStatusMessage(new
|
||||
{
|
||||
directoryContactSelected = new
|
||||
{
|
||||
number = EISC.GetString(JoinMap.DirectoryEntrySelectedNumber.JoinNumber),
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
EISC.SetStringSigAction(JoinMap.DirectorySelectedFolderName.JoinNumber, s => PostStatusMessage(new
|
||||
{
|
||||
directorySelectedFolderName = EISC.GetString(JoinMap.DirectorySelectedFolderName.JoinNumber)
|
||||
}));
|
||||
|
||||
EISC.SetSigTrueAction(JoinMap.CameraModeAuto.JoinNumber, () => PostCameraMode());
|
||||
EISC.SetSigTrueAction(JoinMap.CameraModeManual.JoinNumber, () => PostCameraMode());
|
||||
EISC.SetSigTrueAction(JoinMap.CameraModeOff.JoinNumber, () => PostCameraMode());
|
||||
|
||||
EISC.SetBoolSigAction(JoinMap.CameraSelfView.JoinNumber, b => PostStatusMessage(new
|
||||
{
|
||||
cameraSelfView = b
|
||||
}));
|
||||
|
||||
EISC.SetUShortSigAction(JoinMap.CameraNumberSelect.JoinNumber, (u) => PostSelectedCamera());
|
||||
|
||||
|
||||
// Add press and holds using helper action
|
||||
Action<string, uint> addPHAction = (s, u) =>
|
||||
AppServerController.AddAction(MessagePath + s, new PressAndHoldAction(b => EISC.SetBool(u, b)));
|
||||
addPHAction("/cameraUp", JoinMap.CameraTiltUp.JoinNumber);
|
||||
addPHAction("/cameraDown", JoinMap.CameraTiltDown.JoinNumber);
|
||||
addPHAction("/cameraLeft", JoinMap.CameraPanLeft.JoinNumber);
|
||||
addPHAction("/cameraRight", JoinMap.CameraPanRight.JoinNumber);
|
||||
addPHAction("/cameraZoomIn", JoinMap.CameraZoomIn.JoinNumber);
|
||||
addPHAction("/cameraZoomOut", JoinMap.CameraZoomOut.JoinNumber);
|
||||
|
||||
// Add straight pulse calls using helper action
|
||||
Action<string, uint> addAction = (s, u) =>
|
||||
AppServerController.AddAction(MessagePath + s, new Action(() => EISC.PulseBool(u, 100)));
|
||||
addAction("/endCallById", JoinMap.EndCall.JoinNumber);
|
||||
addAction("/endAllCalls", JoinMap.EndCall.JoinNumber);
|
||||
addAction("/acceptById", JoinMap.IncomingAnswer.JoinNumber);
|
||||
addAction("/rejectById", JoinMap.IncomingReject.JoinNumber);
|
||||
|
||||
var speeddialStart = JoinMap.SpeedDialStart.JoinNumber;
|
||||
var speeddialEnd = JoinMap.SpeedDialStart.JoinNumber + JoinMap.SpeedDialStart.JoinSpan;
|
||||
|
||||
var speedDialIndex = 1;
|
||||
for (uint i = speeddialStart; i < speeddialEnd; i++)
|
||||
{
|
||||
addAction(string.Format("/speedDial{0}", speedDialIndex), i);
|
||||
speedDialIndex++;
|
||||
}
|
||||
|
||||
addAction("/cameraModeAuto", JoinMap.CameraModeAuto.JoinNumber);
|
||||
addAction("/cameraModeManual", JoinMap.CameraModeManual.JoinNumber);
|
||||
addAction("/cameraModeOff", JoinMap.CameraModeOff.JoinNumber);
|
||||
addAction("/cameraSelfView", JoinMap.CameraSelfView.JoinNumber);
|
||||
addAction("/cameraLayout", JoinMap.CameraLayout.JoinNumber);
|
||||
|
||||
asc.AddAction("/cameraSelect", new Action<string>(SelectCamera));
|
||||
|
||||
// camera presets
|
||||
for(uint i = 0; i < 6; i++)
|
||||
{
|
||||
addAction("/cameraPreset" + (i + 1), JoinMap.CameraPresetStart.JoinNumber + i);
|
||||
}
|
||||
|
||||
asc.AddAction(MessagePath + "/isReady", new Action(PostIsReady));
|
||||
// Get status
|
||||
asc.AddAction(MessagePath + "/fullStatus", new Action(PostFullStatus));
|
||||
// Dial on string
|
||||
asc.AddAction(MessagePath + "/dial", new Action<string>(s =>
|
||||
EISC.SetString(JoinMap.CurrentDialString.JoinNumber, s)));
|
||||
// Pulse DTMF
|
||||
AppServerController.AddAction(MessagePath + "/dtmf", new Action<string>(s =>
|
||||
{
|
||||
var join = JoinMap.Joins[s];
|
||||
if (join != null)
|
||||
{
|
||||
if (join.JoinNumber > 0)
|
||||
{
|
||||
EISC.PulseBool(join.JoinNumber, 100);
|
||||
}
|
||||
}
|
||||
}));
|
||||
|
||||
// Directory madness
|
||||
asc.AddAction(MessagePath + "/directoryRoot", new Action(() => EISC.PulseBool(JoinMap.DirectoryRoot.JoinNumber)));
|
||||
asc.AddAction(MessagePath + "/directoryBack", new Action(() => EISC.PulseBool(JoinMap.DirectoryFolderBack.JoinNumber)));
|
||||
asc.AddAction(MessagePath + "/directoryById", new Action<string>(s =>
|
||||
{
|
||||
// the id should contain the line number to forward to simpl
|
||||
try
|
||||
{
|
||||
var u = ushort.Parse(s);
|
||||
EISC.SetUshort(JoinMap.DirectorySelectRow.JoinNumber, u);
|
||||
EISC.PulseBool(JoinMap.DirectoryLineSelected.JoinNumber);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
Debug.Console(1, this, Debug.ErrorLogLevel.Warning,
|
||||
"/directoryById request contains non-numeric ID incompatible with DDVC bridge");
|
||||
}
|
||||
|
||||
}));
|
||||
asc.AddAction(MessagePath + "/directorySelectContact", new Action<string>(s =>
|
||||
{
|
||||
try
|
||||
{
|
||||
var u = ushort.Parse(s);
|
||||
EISC.SetUshort(JoinMap.DirectorySelectRow.JoinNumber, u);
|
||||
EISC.PulseBool(JoinMap.DirectoryLineSelected.JoinNumber);
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
}
|
||||
}));
|
||||
asc.AddAction(MessagePath + "/directoryDialContact", new Action(() => {
|
||||
EISC.PulseBool(JoinMap.DirectoryDialSelectedLine.JoinNumber);
|
||||
}));
|
||||
asc.AddAction(MessagePath + "/getDirectory", new Action(() =>
|
||||
{
|
||||
if (EISC.GetUshort(JoinMap.DirectoryRowCount.JoinNumber) > 0)
|
||||
{
|
||||
PostDirectory();
|
||||
}
|
||||
else
|
||||
{
|
||||
EISC.PulseBool(JoinMap.DirectoryRoot.JoinNumber);
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
void PostFullStatus()
|
||||
{
|
||||
this.PostStatusMessage(new
|
||||
{
|
||||
calls = GetCurrentCallList(),
|
||||
cameraMode = GetCameraMode(),
|
||||
cameraSelfView = EISC.GetBool(JoinMap.CameraSelfView.JoinNumber),
|
||||
cameraSupportsAutoMode = EISC.GetBool(JoinMap.CameraSupportsAutoMode.JoinNumber),
|
||||
cameraSupportsOffMode = EISC.GetBool(JoinMap.CameraSupportsOffMode.JoinNumber),
|
||||
currentCallString = EISC.GetString(JoinMap.CurrentCallNumber.JoinNumber),
|
||||
currentDialString = EISC.GetString(JoinMap.CurrentDialString.JoinNumber),
|
||||
directoryContactSelected = new
|
||||
{
|
||||
name = EISC.GetString(JoinMap.DirectoryEntrySelectedName.JoinNumber),
|
||||
number = EISC.GetString(JoinMap.DirectoryEntrySelectedNumber.JoinNumber)
|
||||
},
|
||||
directorySelectedFolderName = EISC.GetString(JoinMap.DirectorySelectedFolderName.JoinNumber),
|
||||
isInCall = EISC.GetString(JoinMap.HookState.JoinNumber) == "Connected",
|
||||
hasDirectory = true,
|
||||
hasDirectorySearch = false,
|
||||
hasRecents = !EISC.BooleanOutput[502].BoolValue,
|
||||
hasCameras = true,
|
||||
showCamerasWhenNotInCall = EISC.BooleanOutput[503].BoolValue,
|
||||
selectedCamera = GetSelectedCamera(),
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
void PostDirectory()
|
||||
{
|
||||
var u = EISC.GetUshort(JoinMap.DirectoryRowCount.JoinNumber);
|
||||
var items = new List<object>();
|
||||
for (uint i = 0; i < u; i++)
|
||||
{
|
||||
var name = EISC.GetString(JoinMap.DirectoryEntriesStart.JoinNumber + i);
|
||||
var id = (i + 1).ToString();
|
||||
// is folder or contact?
|
||||
if (name.StartsWith("[+]"))
|
||||
{
|
||||
items.Add(new
|
||||
{
|
||||
folderId = id,
|
||||
name = name
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
items.Add(new
|
||||
{
|
||||
contactId = id,
|
||||
name = name
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
var directoryMessage = new
|
||||
{
|
||||
currentDirectory = new
|
||||
{
|
||||
isRootDirectory = EISC.GetBool(JoinMap.DirectoryIsRoot.JoinNumber),
|
||||
directoryResults = items
|
||||
}
|
||||
};
|
||||
PostStatusMessage(directoryMessage);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
void PostCameraMode()
|
||||
{
|
||||
PostStatusMessage(new
|
||||
{
|
||||
cameraMode = GetCameraMode()
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="mode"></param>
|
||||
string GetCameraMode()
|
||||
{
|
||||
string m;
|
||||
if (EISC.GetBool(JoinMap.CameraModeAuto.JoinNumber)) m = eCameraControlMode.Auto.ToString().ToLower();
|
||||
else if (EISC.GetBool(JoinMap.CameraModeManual.JoinNumber)) m = eCameraControlMode.Manual.ToString().ToLower();
|
||||
else m = eCameraControlMode.Off.ToString().ToLower();
|
||||
return m;
|
||||
}
|
||||
|
||||
void PostSelectedCamera()
|
||||
{
|
||||
PostStatusMessage(new
|
||||
{
|
||||
selectedCamera = GetSelectedCamera()
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
string GetSelectedCamera()
|
||||
{
|
||||
var num = EISC.GetUshort(JoinMap.CameraNumberSelect.JoinNumber);
|
||||
string m;
|
||||
if (num == 100)
|
||||
{
|
||||
m = "cameraFar";
|
||||
}
|
||||
else
|
||||
{
|
||||
m = "camera" + num;
|
||||
}
|
||||
return m;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
void PostIsReady()
|
||||
{
|
||||
PostStatusMessage(new
|
||||
{
|
||||
isReady = true
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
void PostCallsList()
|
||||
{
|
||||
PostStatusMessage(new
|
||||
{
|
||||
calls = GetCurrentCallList(),
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="s"></param>
|
||||
void SelectCamera(string s)
|
||||
{
|
||||
var cam = s.Substring(6);
|
||||
if (cam.ToLower() == "far")
|
||||
{
|
||||
EISC.SetUshort(JoinMap.CameraNumberSelect.JoinNumber, 100);
|
||||
}
|
||||
else
|
||||
{
|
||||
EISC.SetUshort(JoinMap.CameraNumberSelect.JoinNumber, UInt16.Parse(cam));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Turns the
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
List<CodecActiveCallItem> GetCurrentCallList()
|
||||
{
|
||||
var list = new List<CodecActiveCallItem>();
|
||||
if (CurrentCallItem.Status != eCodecCallStatus.Disconnected)
|
||||
{
|
||||
list.Add(CurrentCallItem);
|
||||
}
|
||||
if (EISC.GetBool(JoinMap.IncomingCall.JoinNumber))
|
||||
{
|
||||
|
||||
}
|
||||
return list;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
|
||||
using PepperDash.Essentials.Bridges;
|
||||
using PepperDash.Essentials.Core.Bridges;
|
||||
|
||||
namespace PepperDash.Essentials.AppServer.Messengers
|
||||
{
|
||||
/// <summary>
|
||||
/// Properties to configure a SIMPL Messenger
|
||||
/// </summary>
|
||||
public class SimplMessengerPropertiesConfig : EiscApiPropertiesConfig.ApiDevicePropertiesConfig
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core.Monitoring;
|
||||
|
||||
@@ -23,11 +17,11 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
|
||||
SysMon = sysMon;
|
||||
|
||||
SysMon.SystemMonitorPropertiesChanged += new EventHandler<EventArgs>(SysMon_SystemMonitorPropertiesChanged);
|
||||
SysMon.SystemMonitorPropertiesChanged += SysMon_SystemMonitorPropertiesChanged;
|
||||
|
||||
foreach (var p in SysMon.ProgramStatusFeedbackCollection)
|
||||
{
|
||||
p.Value.ProgramInfoChanged += new EventHandler<ProgramInfoEventArgs>(ProgramInfoChanged);
|
||||
p.Value.ProgramInfoChanged += ProgramInfoChanged;
|
||||
}
|
||||
|
||||
CrestronConsole.AddNewConsoleCommand(s => SendFullStatusMessage(), "SendFullSysMonStatus", "Sends the full System Monitor Status", ConsoleAccessLevelEnum.AccessOperator);
|
||||
@@ -72,18 +66,15 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
Debug.Console(1, "Posting System Monitor Status Message.");
|
||||
|
||||
// This takes a while, launch a new thread
|
||||
CrestronInvoke.BeginInvoke((o) =>
|
||||
CrestronInvoke.BeginInvoke(o => PostStatusMessage(new
|
||||
{
|
||||
PostStatusMessage(new
|
||||
{
|
||||
timeZone = SysMon.TimeZoneFeedback.IntValue,
|
||||
timeZoneName = SysMon.TimeZoneTextFeedback.StringValue,
|
||||
ioControllerVersion = SysMon.IOControllerVersionFeedback.StringValue,
|
||||
snmpVersion = SysMon.SnmpVersionFeedback.StringValue,
|
||||
bacnetVersion = SysMon.BACnetAppVersionFeedback.StringValue,
|
||||
controllerVersion = SysMon.ControllerVersionFeedback.StringValue
|
||||
});
|
||||
});
|
||||
timeZone = SysMon.TimeZoneFeedback.IntValue,
|
||||
timeZoneName = SysMon.TimeZoneTextFeedback.StringValue,
|
||||
ioControllerVersion = SysMon.IoControllerVersionFeedback.StringValue,
|
||||
snmpVersion = SysMon.SnmpVersionFeedback.StringValue,
|
||||
bacnetVersion = SysMon.BaCnetAppVersionFeedback.StringValue,
|
||||
controllerVersion = SysMon.ControllerVersionFeedback.StringValue
|
||||
}));
|
||||
}
|
||||
|
||||
protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
|
||||
|
||||
@@ -7,6 +7,8 @@ using Crestron.SimplSharp;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
using PepperDash.Core;
|
||||
|
||||
using PepperDash.Essentials.Devices.Common.Codec;
|
||||
using PepperDash.Essentials.Devices.Common.Cameras;
|
||||
using PepperDash.Essentials.Devices.Common.VideoCodec;
|
||||
@@ -202,6 +204,59 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
{
|
||||
appServerController.AddAction(MessagePath + "/getCallHistory", new Action(GetCallHistory));
|
||||
}
|
||||
var cameraCodec = Codec as IHasCodecCameras;
|
||||
if (cameraCodec != null)
|
||||
{
|
||||
Debug.Console(2, this, "Adding IHasCodecCameras Actions");
|
||||
|
||||
cameraCodec.CameraSelected += new EventHandler<CameraSelectedEventArgs>(cameraCodec_CameraSelected);
|
||||
|
||||
appServerController.AddAction(MessagePath + "/cameraSelect", new Action<string>(s => cameraCodec.SelectCamera(s)));
|
||||
|
||||
MapCameraActions();
|
||||
|
||||
var presetsCodec = Codec as IHasCodecRoomPresets;
|
||||
if (presetsCodec != null)
|
||||
{
|
||||
Debug.Console(2, this, "Adding IHasCodecRoomPresets Actions");
|
||||
|
||||
presetsCodec.CodecRoomPresetsListHasChanged += new EventHandler<EventArgs>(presetsCodec_CameraPresetsListHasChanged);
|
||||
|
||||
appServerController.AddAction(MessagePath + "/cameraPreset", new Action<int>(u => presetsCodec.CodecRoomPresetSelect(u)));
|
||||
appServerController.AddAction(MessagePath + "/cameraPresetStore", new Action<CodecRoomPreset>(p => presetsCodec.CodecRoomPresetStore(p.ID, p.Description)));
|
||||
}
|
||||
|
||||
var speakerTrackCodec = Codec as IHasCameraAutoMode;
|
||||
if (speakerTrackCodec != null)
|
||||
{
|
||||
Debug.Console(2, this, "Adding IHasCameraAutoMode Actions");
|
||||
|
||||
speakerTrackCodec.CameraAutoModeIsOnFeedback.OutputChange += new EventHandler<PepperDash.Essentials.Core.FeedbackEventArgs>(CameraAutoModeIsOnFeedback_OutputChange);
|
||||
|
||||
appServerController.AddAction(MessagePath + "/cameraAuto", new Action(speakerTrackCodec.CameraAutoModeOn));
|
||||
appServerController.AddAction(MessagePath + "/cameraManual", new Action(speakerTrackCodec.CameraAutoModeOff));
|
||||
}
|
||||
}
|
||||
|
||||
var selfViewCodec = Codec as IHasCodecSelfView;
|
||||
|
||||
if (selfViewCodec != null)
|
||||
{
|
||||
Debug.Console(2, this, "Adding IHasCodecSelfView Actions");
|
||||
|
||||
appServerController.AddAction(MessagePath + "/cameraSelfView", new Action(selfViewCodec.SelfViewModeToggle));
|
||||
}
|
||||
|
||||
var layoutsCodec = Codec as IHasCodecLayouts;
|
||||
|
||||
if (layoutsCodec != null)
|
||||
{
|
||||
Debug.Console(2, this, "Adding IHasCodecLayouts Actions");
|
||||
|
||||
appServerController.AddAction(MessagePath + "/cameraRemoteView", new Action(layoutsCodec.LocalLayoutToggle));
|
||||
}
|
||||
|
||||
Debug.Console(2, this, "Adding Privacy & Standby Actions");
|
||||
|
||||
appServerController.AddAction(MessagePath + "/privacyModeOn", new Action(Codec.PrivacyModeOn));
|
||||
appServerController.AddAction(MessagePath + "/privacyModeOff", new Action(Codec.PrivacyModeOff));
|
||||
@@ -212,6 +267,89 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
appServerController.AddAction(MessagePath + "/standbyOff", new Action(Codec.StandbyDeactivate));
|
||||
}
|
||||
|
||||
void presetsCodec_CameraPresetsListHasChanged(object sender, EventArgs e)
|
||||
{
|
||||
PostCameraPresets();
|
||||
}
|
||||
|
||||
void CameraAutoModeIsOnFeedback_OutputChange(object sender, PepperDash.Essentials.Core.FeedbackEventArgs e)
|
||||
{
|
||||
PostCameraMode();
|
||||
}
|
||||
|
||||
|
||||
void cameraCodec_CameraSelected(object sender, CameraSelectedEventArgs e)
|
||||
{
|
||||
MapCameraActions();
|
||||
PostSelectedCamera();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Maps the camera control actions to the current selected camera on the codec
|
||||
/// </summary>
|
||||
void MapCameraActions()
|
||||
{
|
||||
var cameraCodec = Codec as IHasCameras;
|
||||
|
||||
if (cameraCodec != null && cameraCodec.SelectedCamera != null)
|
||||
{
|
||||
|
||||
AppServerController.RemoveAction(MessagePath + "/cameraUp");
|
||||
AppServerController.RemoveAction(MessagePath + "/cameraDown");
|
||||
AppServerController.RemoveAction(MessagePath + "/cameraLeft");
|
||||
AppServerController.RemoveAction(MessagePath + "/cameraRight");
|
||||
AppServerController.RemoveAction(MessagePath + "/cameraZoomIn");
|
||||
AppServerController.RemoveAction(MessagePath + "/cameraZoomOut");
|
||||
AppServerController.RemoveAction(MessagePath + "/cameraHome");
|
||||
|
||||
var camera = cameraCodec.SelectedCamera as IHasCameraPtzControl;
|
||||
if (camera != null)
|
||||
{
|
||||
AppServerController.AddAction(MessagePath + "/cameraUp", new PressAndHoldAction(new Action<bool>(b => { if (b)camera.TiltUp(); else camera.TiltStop(); })));
|
||||
AppServerController.AddAction(MessagePath + "/cameraDown", new PressAndHoldAction(new Action<bool>(b => { if (b)camera.TiltDown(); else camera.TiltStop(); })));
|
||||
AppServerController.AddAction(MessagePath + "/cameraLeft", new PressAndHoldAction(new Action<bool>(b => { if (b)camera.PanLeft(); else camera.PanStop(); })));
|
||||
AppServerController.AddAction(MessagePath + "/cameraRight", new PressAndHoldAction(new Action<bool>(b => { if (b)camera.PanRight(); else camera.PanStop(); })));
|
||||
AppServerController.AddAction(MessagePath + "/cameraZoomIn", new PressAndHoldAction(new Action<bool>(b => { if (b)camera.ZoomIn(); else camera.ZoomStop(); })));
|
||||
AppServerController.AddAction(MessagePath + "/cameraZoomOut", new PressAndHoldAction(new Action<bool>(b => { if (b)camera.ZoomOut(); else camera.ZoomStop(); })));
|
||||
AppServerController.AddAction(MessagePath + "/cameraHome", new Action(camera.PositionHome));
|
||||
|
||||
var focusCamera = cameraCodec as IHasCameraFocusControl;
|
||||
|
||||
AppServerController.RemoveAction(MessagePath + "/cameraAutoFocus");
|
||||
AppServerController.RemoveAction(MessagePath + "/cameraFocusNear");
|
||||
AppServerController.RemoveAction(MessagePath + "/cameraFocusFar");
|
||||
|
||||
if (focusCamera != null)
|
||||
{
|
||||
AppServerController.AddAction(MessagePath + "/cameraAutoFocus", new Action(focusCamera.TriggerAutoFocus));
|
||||
AppServerController.AddAction(MessagePath + "/cameraFocusNear", new PressAndHoldAction(new Action<bool>(b => { if (b)focusCamera.FocusNear(); else focusCamera.FocusStop(); })));
|
||||
AppServerController.AddAction(MessagePath + "/cameraFocusFar", new PressAndHoldAction(new Action<bool>(b => { if (b)focusCamera.FocusFar(); else focusCamera.FocusStop(); })));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
string GetCameraMode()
|
||||
{
|
||||
string m = "";
|
||||
|
||||
var speakerTrackCodec = Codec as IHasCameraAutoMode;
|
||||
if (speakerTrackCodec != null)
|
||||
{
|
||||
if (speakerTrackCodec.CameraAutoModeIsOnFeedback.BoolValue) m = eCameraControlMode.Auto.ToString();
|
||||
else m = eCameraControlMode.Manual.ToString();
|
||||
}
|
||||
|
||||
var cameraOffCodec = Codec as IHasCameraOff;
|
||||
if (cameraOffCodec != null)
|
||||
{
|
||||
if (cameraOffCodec.CameraIsOffFeedback.BoolValue)
|
||||
m = eCameraControlMode.Off.ToString();
|
||||
}
|
||||
|
||||
return m;
|
||||
}
|
||||
|
||||
void GetCallHistory()
|
||||
{
|
||||
var codec = (Codec as IHasCallHistory);
|
||||
@@ -344,6 +482,22 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
return;
|
||||
}
|
||||
|
||||
object cameraInfo = null;
|
||||
|
||||
var camerasCodec = Codec as IHasCodecCameras;
|
||||
if (camerasCodec != null)
|
||||
{
|
||||
cameraInfo = new
|
||||
{
|
||||
cameraManualSupported = true, // For now, we assume manual mode is supported and selectively hide controls based on camera selection
|
||||
cameraAutoSupported = Codec is IHasCameraAutoMode,
|
||||
cameraOffSupported = Codec is IHasCameraOff,
|
||||
cameraMode = GetCameraMode(),
|
||||
cameraList = camerasCodec.Cameras,
|
||||
selectedCamera = GetSelectedCamera(camerasCodec)
|
||||
};
|
||||
}
|
||||
|
||||
var info = Codec.CodecInfo;
|
||||
PostStatusMessage(new
|
||||
{
|
||||
@@ -366,8 +520,77 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
hasDirectory = Codec is IHasDirectory,
|
||||
hasDirectorySearch = true,
|
||||
hasRecents = Codec is IHasCallHistory,
|
||||
hasCameras = Codec is IHasCodecCameras
|
||||
hasCameras = Codec is IHasCameras,
|
||||
cameras = cameraInfo,
|
||||
presets = GetCurrentPresets()
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
void PostCameraMode()
|
||||
{
|
||||
PostStatusMessage(new
|
||||
{
|
||||
cameras = new
|
||||
{
|
||||
cameraMode = GetCameraMode()
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void PostSelectedCamera()
|
||||
{
|
||||
var camerasCodec = Codec as IHasCodecCameras;
|
||||
|
||||
PostStatusMessage(new
|
||||
{
|
||||
cameras = new
|
||||
{
|
||||
selectedCamera = GetSelectedCamera(camerasCodec)
|
||||
},
|
||||
presets = GetCurrentPresets()
|
||||
});
|
||||
}
|
||||
|
||||
void PostCameraPresets()
|
||||
{
|
||||
|
||||
PostStatusMessage(new
|
||||
{
|
||||
presets = GetCurrentPresets()
|
||||
});
|
||||
}
|
||||
|
||||
object GetSelectedCamera(IHasCodecCameras camerasCodec)
|
||||
{
|
||||
return new
|
||||
{
|
||||
key = camerasCodec.SelectedCameraFeedback.StringValue,
|
||||
isFarEnd = camerasCodec.ControllingFarEndCameraFeedback.BoolValue,
|
||||
capabilites = new
|
||||
{
|
||||
canPan = camerasCodec.SelectedCamera.CanPan,
|
||||
canTilt = camerasCodec.SelectedCamera.CanTilt,
|
||||
canZoom = camerasCodec.SelectedCamera.CanZoom,
|
||||
canFocus = camerasCodec.SelectedCamera.CanFocus
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
List<CodecRoomPreset> GetCurrentPresets()
|
||||
{
|
||||
var presetsCodec = Codec as IHasCodecRoomPresets;
|
||||
|
||||
List<CodecRoomPreset> currentPresets = null;
|
||||
|
||||
if (presetsCodec != null && Codec is IHasFarEndCameraControl && (Codec as IHasFarEndCameraControl).ControllingFarEndCameraFeedback.BoolValue)
|
||||
currentPresets = presetsCodec.FarEndRoomPresets;
|
||||
else
|
||||
currentPresets = presetsCodec.NearEndPresets;
|
||||
|
||||
return currentPresets;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -21,7 +21,7 @@ using PepperDash.Essentials.AppServer.Messengers;
|
||||
|
||||
namespace PepperDash.Essentials
|
||||
{
|
||||
public class MobileControlSystemController : Device
|
||||
public class MobileControlSystemController : EssentialsDevice
|
||||
{
|
||||
WebSocketClient WSClient;
|
||||
|
||||
@@ -290,6 +290,10 @@ namespace PepperDash.Essentials
|
||||
SystemUuid);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Console(0, "Authorization failed, code {0}: {1}", r.Code, r.ContentString);
|
||||
}
|
||||
}
|
||||
else
|
||||
Debug.Console(0, this, "Error {0} in authorizing system", e);
|
||||
@@ -861,4 +865,20 @@ namespace PepperDash.Essentials
|
||||
CrestronConsole.ConsoleCommandResponse("Usage: mobilehttprequest:N get/post url\r");
|
||||
}
|
||||
}
|
||||
|
||||
public class MobileControlSystemControllerFactory : EssentialsDeviceFactory<MobileControlSystemController>
|
||||
{
|
||||
public MobileControlSystemControllerFactory()
|
||||
{
|
||||
TypeNames = new List<string>() { "appserver" };
|
||||
}
|
||||
|
||||
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||
{
|
||||
Debug.Console(1, "Factory Attempting to create new MobileControlSystemController Device");
|
||||
var props = JsonConvert.DeserializeObject<MobileControlConfig>(dc.Properties.ToString());
|
||||
return new MobileControlSystemController(dc.Key, dc.Name, props);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -12,7 +12,7 @@ namespace PepperDash.Essentials
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public abstract class MobileControlBridgeBase: Device
|
||||
public abstract class MobileControlBridgeBase: EssentialsDevice
|
||||
{
|
||||
public MobileControlSystemController Parent { get; private set; }
|
||||
|
||||
|
||||
@@ -25,6 +25,8 @@ namespace PepperDash.Essentials
|
||||
|
||||
public AudioCodecBaseMessenger ACMessenger { get; private set; }
|
||||
|
||||
public Dictionary<string, MessengerBase> DeviceMessengers { get; private set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
@@ -67,7 +69,15 @@ namespace PepperDash.Essentials
|
||||
var routeRoom = Room as IRunRouteAction;
|
||||
if(routeRoom != null)
|
||||
Parent.AddAction(string.Format(@"/room/{0}/source", Room.Key), new Action<SourceSelectMessageContent>(c =>
|
||||
routeRoom.RunRouteAction(c.SourceListItem)));
|
||||
{
|
||||
if(string.IsNullOrEmpty(c.SourceListKey))
|
||||
routeRoom.RunRouteAction(c.SourceListItem, Room.SourceListKey);
|
||||
else
|
||||
{
|
||||
routeRoom.RunRouteAction(c.SourceListItem, c.SourceListKey);
|
||||
}
|
||||
}));
|
||||
|
||||
|
||||
var defaultRoom = Room as IRunDefaultPresentRoute;
|
||||
if(defaultRoom != null)
|
||||
@@ -115,6 +125,8 @@ namespace PepperDash.Essentials
|
||||
ACMessenger.RegisterWithAppServer(Parent);
|
||||
}
|
||||
|
||||
SetupDeviceMessengers();
|
||||
|
||||
var defCallRm = Room as IRunDefaultCallRoute;
|
||||
if (defCallRm != null)
|
||||
{
|
||||
@@ -134,6 +146,36 @@ namespace PepperDash.Essentials
|
||||
Room.ShutdownPromptTimer.WasCancelled += ShutdownPromptTimer_WasCancelled;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set up the messengers for each device type
|
||||
/// </summary>
|
||||
void SetupDeviceMessengers()
|
||||
{
|
||||
DeviceMessengers = new Dictionary<string,MessengerBase>();
|
||||
|
||||
foreach (var device in DeviceManager.AllDevices)
|
||||
{
|
||||
Debug.Console(2, this, "Attempting to set up device messenger for device: {0}", device.Key);
|
||||
|
||||
if (device is Essentials.Devices.Common.Cameras.CameraBase)
|
||||
{
|
||||
var camDevice = device as Essentials.Devices.Common.Cameras.CameraBase;
|
||||
Debug.Console(2, this, "Adding CameraBaseMessenger for device: {0}", device.Key);
|
||||
var cameraMessenger = new CameraBaseMessenger(device.Key + "-" + Parent.Key, camDevice, "/device/" + device.Key);
|
||||
DeviceMessengers.Add(device.Key, cameraMessenger);
|
||||
cameraMessenger.RegisterWithAppServer(Parent);
|
||||
}
|
||||
if (device is Essentials.Devices.Common.SoftCodec.BlueJeansPc)
|
||||
{
|
||||
var softCodecDevice = device as Essentials.Devices.Common.SoftCodec.BlueJeansPc;
|
||||
Debug.Console(2, this, "Adding IRunRouteActionMessnger for device: {0}", device.Key);
|
||||
var routeMessenger = new IRunRouteActionMessenger(device.Key + "-" + Parent.Key, softCodecDevice, "/device/" + device.Key);
|
||||
DeviceMessengers.Add(device.Key, routeMessenger);
|
||||
routeMessenger.RegisterWithAppServer(Parent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
@@ -430,6 +472,7 @@ namespace PepperDash.Essentials
|
||||
public class SourceSelectMessageContent
|
||||
{
|
||||
public string SourceListItem { get; set; }
|
||||
public string SourceListKey { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -10,6 +10,7 @@ using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.AppServer;
|
||||
using PepperDash.Essentials.AppServer.Messengers;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.Config;
|
||||
@@ -18,204 +19,8 @@ using PepperDash.Essentials.Room.Config;
|
||||
|
||||
namespace PepperDash.Essentials.Room.MobileControl
|
||||
{
|
||||
public class MobileControlDdvc01RoomBridge : MobileControlBridgeBase, IDelayedConfiguration
|
||||
public class MobileControlSIMPLRoomBridge : MobileControlBridgeBase, IDelayedConfiguration
|
||||
{
|
||||
public class BoolJoin
|
||||
{
|
||||
/// <summary>
|
||||
/// 301
|
||||
/// </summary>
|
||||
public const uint RoomIsOn = 301;
|
||||
|
||||
/// <summary>
|
||||
/// 12
|
||||
/// </summary>
|
||||
public const uint PrivacyMute = 12;
|
||||
|
||||
/// <summary>
|
||||
/// 41
|
||||
/// </summary>
|
||||
public const uint PromptForCode = 41;
|
||||
/// <summary>
|
||||
/// 42
|
||||
/// </summary>
|
||||
public const uint ClientJoined = 42;
|
||||
/// <summary>
|
||||
/// 51
|
||||
/// </summary>
|
||||
public const uint ActivityShare = 51;
|
||||
/// <summary>
|
||||
/// 52
|
||||
/// </summary>
|
||||
public const uint ActivityPhoneCall = 52;
|
||||
/// <summary>
|
||||
/// 53
|
||||
/// </summary>
|
||||
public const uint ActivityVideoCall = 53;
|
||||
|
||||
/// <summary>
|
||||
/// 1
|
||||
/// </summary>
|
||||
public const uint MasterVolumeIsMuted = 1;
|
||||
/// <summary>
|
||||
/// 1
|
||||
/// </summary>
|
||||
public const uint MasterVolumeMuteToggle = 1;
|
||||
/// <summary>
|
||||
/// 1
|
||||
/// </summary>
|
||||
public const uint VolumeMutesJoinStart = 1;
|
||||
/// <summary>
|
||||
/// 61
|
||||
/// </summary>
|
||||
public const uint ShutdownCancel = 61;
|
||||
/// <summary>
|
||||
/// 62
|
||||
/// </summary>
|
||||
public const uint ShutdownEnd = 62;
|
||||
/// <summary>
|
||||
/// 63
|
||||
/// </summary>
|
||||
public const uint ShutdownStart = 63;
|
||||
/// <summary>
|
||||
/// 72
|
||||
/// </summary>
|
||||
public const uint SourceHasChanged = 71;
|
||||
|
||||
/// <summary>
|
||||
/// 261 - The start of the range of speed dial visibles
|
||||
/// </summary>
|
||||
public const uint SpeedDialVisibleStartJoin = 261;
|
||||
/// <summary>
|
||||
/// 501
|
||||
/// </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 SourceShareDisableJoinStart = 601;
|
||||
/// <summary>
|
||||
/// 621
|
||||
/// </summary>
|
||||
public const uint SourceIsEnabledJoinStart = 621;
|
||||
|
||||
}
|
||||
|
||||
public class UshortJoin
|
||||
{
|
||||
/// <summary>
|
||||
/// 1
|
||||
/// </summary>
|
||||
public const uint MasterVolumeLevel = 1;
|
||||
/// <summary>
|
||||
/// 1
|
||||
/// </summary>
|
||||
public const uint VolumeSlidersJoinStart = 1;
|
||||
/// <summary>
|
||||
/// 61
|
||||
/// </summary>
|
||||
public const uint ShutdownPromptDuration = 61;
|
||||
/// <summary>
|
||||
/// 101
|
||||
/// </summary>
|
||||
public const uint NumberOfAuxFaders = 101;
|
||||
}
|
||||
|
||||
public class StringJoin
|
||||
{
|
||||
/// <summary>
|
||||
/// 1
|
||||
/// </summary>
|
||||
public const uint VolumeSliderNamesJoinStart = 1;
|
||||
/// <summary>
|
||||
/// 71
|
||||
/// </summary>
|
||||
public const uint SelectedSourceKey = 71;
|
||||
|
||||
/// <summary>
|
||||
/// 241
|
||||
/// </summary>
|
||||
public const uint SpeedDialNameStartJoin = 241;
|
||||
|
||||
/// <summary>
|
||||
/// 251
|
||||
/// </summary>
|
||||
public const uint SpeedDialNumberStartJoin = 251;
|
||||
|
||||
/// <summary>
|
||||
/// 501
|
||||
/// </summary>
|
||||
public const uint ConfigRoomName = 501;
|
||||
/// <summary>
|
||||
/// 502
|
||||
/// </summary>
|
||||
public const uint ConfigHelpMessage = 502;
|
||||
/// <summary>
|
||||
/// 503
|
||||
/// </summary>
|
||||
public const uint ConfigHelpNumber = 503;
|
||||
/// <summary>
|
||||
/// 504
|
||||
/// </summary>
|
||||
public const uint ConfigRoomPhoneNumber = 504;
|
||||
/// <summary>
|
||||
/// 505
|
||||
/// </summary>
|
||||
public const uint ConfigRoomURI = 505;
|
||||
/// <summary>
|
||||
/// 401
|
||||
/// </summary>
|
||||
public const uint UserCodeToSystem = 401;
|
||||
/// <summary>
|
||||
/// 402
|
||||
/// </summary>
|
||||
public const uint ServerUrl = 402;
|
||||
/// <summary>
|
||||
/// 512
|
||||
/// </summary>
|
||||
public const uint RoomSpeedDialNamesJoinStart = 512;
|
||||
/// <summary>
|
||||
/// 516
|
||||
/// </summary>
|
||||
public const uint RoomSpeedDialNumberssJoinStart = 516;
|
||||
/// <summary>
|
||||
/// 601
|
||||
/// </summary>
|
||||
public const uint SourceNameJoinStart = 601;
|
||||
/// <summary>
|
||||
/// 621
|
||||
/// </summary>
|
||||
public const uint SourceIconJoinStart = 621;
|
||||
/// <summary>
|
||||
/// 641
|
||||
/// </summary>
|
||||
public const uint SourceKeyJoinStart = 641;
|
||||
/// <summary>
|
||||
/// 661
|
||||
/// </summary>
|
||||
public const uint SourceTypeJoinStart = 661;
|
||||
/// <summary>
|
||||
/// 761
|
||||
/// </summary>
|
||||
public const uint CameraNearNameStart = 761;
|
||||
/// <summary>
|
||||
/// 770 - presence of this name on the input will cause the camera to be added
|
||||
/// </summary>
|
||||
public const uint CameraFarName = 770;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Fires when config is ready to go
|
||||
/// </summary>
|
||||
@@ -223,6 +28,8 @@ namespace PepperDash.Essentials.Room.MobileControl
|
||||
|
||||
public ThreeSeriesTcpIpEthernetIntersystemCommunications EISC { get; private set; }
|
||||
|
||||
public MobileControlSIMPLRoomJoinMap JoinMap { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
@@ -231,15 +38,15 @@ namespace PepperDash.Essentials.Room.MobileControl
|
||||
public override string RoomName
|
||||
{
|
||||
get {
|
||||
var name = EISC.StringOutput[StringJoin.ConfigRoomName].StringValue;
|
||||
var name = EISC.StringOutput[JoinMap.ConfigRoomName.JoinNumber].StringValue;
|
||||
return string.IsNullOrEmpty(name) ? "Not Loaded" : name;
|
||||
}
|
||||
}
|
||||
|
||||
MobileControlDdvc01DeviceBridge SourceBridge;
|
||||
|
||||
Ddvc01AtcMessenger AtcMessenger;
|
||||
Ddvc01VtcMessenger VtcMessenger;
|
||||
SIMPLAtcMessenger AtcMessenger;
|
||||
SIMPLVtcMessenger VtcMessenger;
|
||||
|
||||
|
||||
/// <summary>
|
||||
@@ -248,7 +55,7 @@ namespace PepperDash.Essentials.Room.MobileControl
|
||||
/// <param name="key"></param>
|
||||
/// <param name="name"></param>
|
||||
/// <param name="ipId"></param>
|
||||
public MobileControlDdvc01RoomBridge(string key, string name, uint ipId)
|
||||
public MobileControlSIMPLRoomBridge(string key, string name, uint ipId)
|
||||
: base(key, name)
|
||||
{
|
||||
try
|
||||
@@ -258,8 +65,13 @@ namespace PepperDash.Essentials.Room.MobileControl
|
||||
if (reg != Crestron.SimplSharpPro.eDeviceRegistrationUnRegistrationResponse.Success)
|
||||
Debug.Console(0, this, "Cannot connect EISC at IPID {0}: \r{1}", ipId, reg);
|
||||
|
||||
JoinMap = new MobileControlSIMPLRoomJoinMap(1);
|
||||
|
||||
SourceBridge = new MobileControlDdvc01DeviceBridge(key + "-sourceBridge", "DDVC01 source bridge", EISC);
|
||||
DeviceManager.AddDevice(SourceBridge);
|
||||
|
||||
|
||||
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
@@ -279,24 +91,33 @@ namespace PepperDash.Essentials.Room.MobileControl
|
||||
SetupFeedbacks();
|
||||
|
||||
var atcKey = string.Format("atc-{0}-{1}", this.Key, Parent.Key);
|
||||
AtcMessenger = new Ddvc01AtcMessenger(atcKey, EISC, "/device/audioCodec");
|
||||
AtcMessenger = new SIMPLAtcMessenger(atcKey, EISC, "/device/audioCodec");
|
||||
AtcMessenger.RegisterWithAppServer(Parent);
|
||||
|
||||
var vtcKey = string.Format("atc-{0}-{1}", this.Key, Parent.Key);
|
||||
VtcMessenger = new Ddvc01VtcMessenger(vtcKey, EISC, "/device/videoCodec");
|
||||
VtcMessenger = new SIMPLVtcMessenger(vtcKey, EISC, "/device/videoCodec");
|
||||
VtcMessenger.RegisterWithAppServer(Parent);
|
||||
|
||||
EISC.SigChange += EISC_SigChange;
|
||||
EISC.OnlineStatusChange += (o, a) =>
|
||||
{
|
||||
Debug.Console(1, this, "DDVC EISC online={0}. Config is ready={1}", a.DeviceOnLine, EISC.BooleanOutput[BoolJoin.ConfigIsReady].BoolValue);
|
||||
if (a.DeviceOnLine && EISC.BooleanOutput[BoolJoin.ConfigIsReady].BoolValue)
|
||||
Debug.Console(1, this, "DDVC EISC online={0}. Config is ready={1}. Use Essentials Config={2}",
|
||||
a.DeviceOnLine, EISC.BooleanOutput[JoinMap.ConfigIsReady.JoinNumber].BoolValue, EISC.BooleanOutput[JoinMap.ConfigIsLocal.JoinNumber].BoolValue);
|
||||
|
||||
if (a.DeviceOnLine && EISC.BooleanOutput[JoinMap.ConfigIsReady.JoinNumber].BoolValue)
|
||||
LoadConfigValues();
|
||||
|
||||
if (a.DeviceOnLine && EISC.BooleanOutput[JoinMap.ConfigIsLocal.JoinNumber].BoolValue)
|
||||
UseEssentialsConfig();
|
||||
};
|
||||
// load config if it's already there
|
||||
if (EISC.IsOnline && EISC.BooleanOutput[BoolJoin.ConfigIsReady].BoolValue) // || EISC.BooleanInput[BoolJoin.ConfigIsReady].BoolValue)
|
||||
if (EISC.IsOnline && EISC.BooleanOutput[JoinMap.ConfigIsReady.JoinNumber].BoolValue) // || EISC.BooleanInput[JoinMap.ConfigIsReady].BoolValue)
|
||||
LoadConfigValues();
|
||||
|
||||
if (EISC.IsOnline && EISC.BooleanOutput[JoinMap.ConfigIsLocal.JoinNumber].BoolValue)
|
||||
{
|
||||
UseEssentialsConfig();
|
||||
}
|
||||
|
||||
CrestronConsole.AddNewConsoleCommand(s =>
|
||||
{
|
||||
@@ -323,41 +144,60 @@ namespace PepperDash.Essentials.Room.MobileControl
|
||||
return base.CustomActivate();
|
||||
}
|
||||
|
||||
void UseEssentialsConfig()
|
||||
{
|
||||
ConfigIsLoaded = false;
|
||||
|
||||
SetupDeviceMessengers();
|
||||
|
||||
Debug.Console(0, this, "******* ESSENTIALS CONFIG: \r{0}", JsonConvert.SerializeObject(ConfigReader.ConfigObject, Formatting.Indented));
|
||||
|
||||
var handler = ConfigurationIsReady;
|
||||
if (handler != null)
|
||||
{
|
||||
handler(this, new EventArgs());
|
||||
}
|
||||
|
||||
ConfigIsLoaded = true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Setup the actions to take place on various incoming API calls
|
||||
/// </summary>
|
||||
void SetupFunctions()
|
||||
{
|
||||
Parent.AddAction(@"/room/room1/promptForCode", new Action(() => EISC.PulseBool(BoolJoin.PromptForCode)));
|
||||
Parent.AddAction(@"/room/room1/clientJoined", new Action(() => EISC.PulseBool(BoolJoin.ClientJoined)));
|
||||
Parent.AddAction(@"/room/room1/promptForCode", new Action(() => EISC.PulseBool(JoinMap.PromptForCode.JoinNumber)));
|
||||
Parent.AddAction(@"/room/room1/clientJoined", new Action(() => EISC.PulseBool(JoinMap.ClientJoined.JoinNumber)));
|
||||
|
||||
Parent.AddAction(@"/room/room1/status", new Action(SendFullStatus));
|
||||
|
||||
Parent.AddAction(@"/room/room1/source", new Action<SourceSelectMessageContent>(c =>
|
||||
{
|
||||
EISC.SetString(StringJoin.SelectedSourceKey, c.SourceListItem);
|
||||
EISC.PulseBool(BoolJoin.SourceHasChanged);
|
||||
EISC.SetString(JoinMap.CurrentSourceKey.JoinNumber, c.SourceListItem);
|
||||
EISC.PulseBool(JoinMap.SourceHasChanged.JoinNumber);
|
||||
}));
|
||||
|
||||
Parent.AddAction(@"/room/room1/defaultsource", new Action(() =>
|
||||
EISC.PulseBool(BoolJoin.ActivityShare)));
|
||||
EISC.PulseBool(JoinMap.ActivityShare.JoinNumber)));
|
||||
Parent.AddAction(@"/room/room1/activityPhone", new Action(() =>
|
||||
EISC.PulseBool(BoolJoin.ActivityPhoneCall)));
|
||||
EISC.PulseBool(JoinMap.ActivityPhoneCall.JoinNumber)));
|
||||
Parent.AddAction(@"/room/room1/activityVideo", new Action(() =>
|
||||
EISC.PulseBool(BoolJoin.ActivityVideoCall)));
|
||||
EISC.PulseBool(JoinMap.ActivityVideoCall.JoinNumber)));
|
||||
|
||||
Parent.AddAction(@"/room/room1/volumes/master/level", new Action<ushort>(u =>
|
||||
EISC.SetUshort(UshortJoin.MasterVolumeLevel, u)));
|
||||
EISC.SetUshort(JoinMap.MasterVolume.JoinNumber, u)));
|
||||
Parent.AddAction(@"/room/room1/volumes/master/muteToggle", new Action(() =>
|
||||
EISC.PulseBool(BoolJoin.MasterVolumeIsMuted)));
|
||||
EISC.PulseBool(JoinMap.MasterVolume.JoinNumber)));
|
||||
Parent.AddAction(@"/room/room1/volumes/master/privacyMuteToggle", new Action(() =>
|
||||
EISC.PulseBool(BoolJoin.PrivacyMute)));
|
||||
EISC.PulseBool(JoinMap.PrivacyMute.JoinNumber)));
|
||||
|
||||
|
||||
// /xyzxyz/volumes/master/muteToggle ---> BoolInput[1]
|
||||
|
||||
for (uint i = 2; i <= 7; i++)
|
||||
var volumeStart = JoinMap.VolumeJoinStart.JoinNumber;
|
||||
var volumeEnd = JoinMap.VolumeJoinStart.JoinNumber + JoinMap.VolumeJoinStart.JoinSpan;
|
||||
|
||||
for (uint i = volumeStart; i <= volumeEnd; i++)
|
||||
{
|
||||
var index = i;
|
||||
Parent.AddAction(string.Format(@"/room/room1/volumes/level-{0}/level", index), new Action<ushort>(u =>
|
||||
@@ -367,13 +207,16 @@ namespace PepperDash.Essentials.Room.MobileControl
|
||||
}
|
||||
|
||||
Parent.AddAction(@"/room/room1/shutdownStart", new Action(() =>
|
||||
EISC.PulseBool(BoolJoin.ShutdownStart)));
|
||||
EISC.PulseBool(JoinMap.ShutdownStart.JoinNumber)));
|
||||
Parent.AddAction(@"/room/room1/shutdownEnd", new Action(() =>
|
||||
EISC.PulseBool(BoolJoin.ShutdownEnd)));
|
||||
EISC.PulseBool(JoinMap.ShutdownEnd.JoinNumber)));
|
||||
Parent.AddAction(@"/room/room1/shutdownCancel", new Action(() =>
|
||||
EISC.PulseBool(BoolJoin.ShutdownCancel)));
|
||||
EISC.PulseBool(JoinMap.ShutdownCancel.JoinNumber)));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
@@ -398,21 +241,21 @@ namespace PepperDash.Essentials.Room.MobileControl
|
||||
void SetupFeedbacks()
|
||||
{
|
||||
// Power
|
||||
EISC.SetBoolSigAction(BoolJoin.RoomIsOn, b =>
|
||||
EISC.SetBoolSigAction(JoinMap.RoomIsOn.JoinNumber, b =>
|
||||
PostStatusMessage(new
|
||||
{
|
||||
isOn = b
|
||||
}));
|
||||
|
||||
// Source change things
|
||||
EISC.SetSigTrueAction(BoolJoin.SourceHasChanged, () =>
|
||||
EISC.SetSigTrueAction(JoinMap.SourceHasChanged.JoinNumber, () =>
|
||||
PostStatusMessage(new
|
||||
{
|
||||
selectedSourceKey = EISC.StringOutput[StringJoin.SelectedSourceKey].StringValue
|
||||
selectedSourceKey = EISC.StringOutput[JoinMap.CurrentSourceKey.JoinNumber].StringValue
|
||||
}));
|
||||
|
||||
// Volume things
|
||||
EISC.SetUShortSigAction(UshortJoin.MasterVolumeLevel, u =>
|
||||
EISC.SetUShortSigAction(JoinMap.MasterVolume.JoinNumber, u =>
|
||||
PostStatusMessage(new
|
||||
{
|
||||
volumes = new
|
||||
@@ -427,7 +270,7 @@ namespace PepperDash.Essentials.Room.MobileControl
|
||||
// map MasterVolumeIsMuted join -> status/volumes/master/muted
|
||||
//
|
||||
|
||||
EISC.SetBoolSigAction(BoolJoin.MasterVolumeIsMuted, b =>
|
||||
EISC.SetBoolSigAction(JoinMap.MasterVolume.JoinNumber, b =>
|
||||
PostStatusMessage(new
|
||||
{
|
||||
volumes = new
|
||||
@@ -438,7 +281,7 @@ namespace PepperDash.Essentials.Room.MobileControl
|
||||
}
|
||||
}
|
||||
}));
|
||||
EISC.SetBoolSigAction(BoolJoin.PrivacyMute, b =>
|
||||
EISC.SetBoolSigAction(JoinMap.PrivacyMute.JoinNumber, b =>
|
||||
PostStatusMessage(new
|
||||
{
|
||||
volumes = new
|
||||
@@ -450,7 +293,10 @@ namespace PepperDash.Essentials.Room.MobileControl
|
||||
}
|
||||
}));
|
||||
|
||||
for (uint i = 2; i <= 7; i++)
|
||||
var volumeStart = JoinMap.VolumeJoinStart.JoinNumber;
|
||||
var volumeEnd = JoinMap.VolumeJoinStart.JoinNumber + JoinMap.VolumeJoinStart.JoinSpan;
|
||||
|
||||
for (uint i = volumeStart; i <= volumeEnd; i++)
|
||||
{
|
||||
var index = i; // local scope for lambdas
|
||||
EISC.SetUShortSigAction(index, u => // start at join 2
|
||||
@@ -481,7 +327,7 @@ namespace PepperDash.Essentials.Room.MobileControl
|
||||
});
|
||||
}
|
||||
|
||||
EISC.SetUShortSigAction(UshortJoin.NumberOfAuxFaders, u =>
|
||||
EISC.SetUShortSigAction(JoinMap.NumberOfAuxFaders.JoinNumber, u =>
|
||||
PostStatusMessage(new {
|
||||
volumes = new {
|
||||
numberOfAuxFaders = u,
|
||||
@@ -489,30 +335,30 @@ namespace PepperDash.Essentials.Room.MobileControl
|
||||
}));
|
||||
|
||||
// shutdown things
|
||||
EISC.SetSigTrueAction(BoolJoin.ShutdownCancel, new Action(() =>
|
||||
EISC.SetSigTrueAction(JoinMap.ShutdownCancel.JoinNumber, new Action(() =>
|
||||
PostMessage("/room/shutdown/", new
|
||||
{
|
||||
state = "wasCancelled"
|
||||
})));
|
||||
EISC.SetSigTrueAction(BoolJoin.ShutdownEnd, new Action(() =>
|
||||
EISC.SetSigTrueAction(JoinMap.ShutdownEnd.JoinNumber, new Action(() =>
|
||||
PostMessage("/room/shutdown/", new
|
||||
{
|
||||
state = "hasFinished"
|
||||
})));
|
||||
EISC.SetSigTrueAction(BoolJoin.ShutdownStart, new Action(() =>
|
||||
EISC.SetSigTrueAction(JoinMap.ShutdownStart.JoinNumber, new Action(() =>
|
||||
PostMessage("/room/shutdown/", new
|
||||
{
|
||||
state = "hasStarted",
|
||||
duration = EISC.UShortOutput[UshortJoin.ShutdownPromptDuration].UShortValue
|
||||
duration = EISC.UShortOutput[JoinMap.ShutdownPromptDuration.JoinNumber].UShortValue
|
||||
})));
|
||||
|
||||
// Config things
|
||||
EISC.SetSigTrueAction(BoolJoin.ConfigIsReady, LoadConfigValues);
|
||||
EISC.SetSigTrueAction(JoinMap.ConfigIsReady.JoinNumber, LoadConfigValues);
|
||||
|
||||
// Activity modes
|
||||
EISC.SetSigTrueAction(BoolJoin.ActivityShare, () => UpdateActivity(1));
|
||||
EISC.SetSigTrueAction(BoolJoin.ActivityPhoneCall, () => UpdateActivity(2));
|
||||
EISC.SetSigTrueAction(BoolJoin.ActivityVideoCall, () => UpdateActivity(3));
|
||||
EISC.SetSigTrueAction(JoinMap.ActivityShare.JoinNumber, () => UpdateActivity(1));
|
||||
EISC.SetSigTrueAction(JoinMap.ActivityPhoneCall.JoinNumber, () => UpdateActivity(2));
|
||||
EISC.SetSigTrueAction(JoinMap.ActivityVideoCall.JoinNumber, () => UpdateActivity(3));
|
||||
}
|
||||
|
||||
|
||||
@@ -556,7 +402,7 @@ namespace PepperDash.Essentials.Room.MobileControl
|
||||
Debug.Console(0, this, "Replacing Room[0] in config");
|
||||
co.Rooms[0] = rm;
|
||||
}
|
||||
rm.Name = EISC.StringOutput[StringJoin.ConfigRoomName].StringValue;
|
||||
rm.Name = EISC.StringOutput[JoinMap.ConfigRoomName.JoinNumber].StringValue;
|
||||
rm.Key = "room1";
|
||||
rm.Type = "ddvc01";
|
||||
|
||||
@@ -567,13 +413,13 @@ namespace PepperDash.Essentials.Room.MobileControl
|
||||
rmProps = JsonConvert.DeserializeObject<DDVC01RoomPropertiesConfig>(rm.Properties.ToString());
|
||||
|
||||
rmProps.Help = new EssentialsHelpPropertiesConfig();
|
||||
rmProps.Help.CallButtonText = EISC.StringOutput[StringJoin.ConfigHelpNumber].StringValue;
|
||||
rmProps.Help.Message = EISC.StringOutput[StringJoin.ConfigHelpMessage].StringValue;
|
||||
rmProps.Help.CallButtonText = EISC.StringOutput[JoinMap.ConfigHelpNumber.JoinNumber].StringValue;
|
||||
rmProps.Help.Message = EISC.StringOutput[JoinMap.ConfigHelpMessage.JoinNumber].StringValue;
|
||||
|
||||
rmProps.Environment = new EssentialsEnvironmentPropertiesConfig(); // enabled defaults to false
|
||||
|
||||
rmProps.RoomPhoneNumber = EISC.StringOutput[StringJoin.ConfigRoomPhoneNumber].StringValue;
|
||||
rmProps.RoomURI = EISC.StringOutput[StringJoin.ConfigRoomURI].StringValue;
|
||||
rmProps.RoomPhoneNumber = EISC.StringOutput[JoinMap.ConfigRoomPhoneNumber.JoinNumber].StringValue;
|
||||
rmProps.RoomURI = EISC.StringOutput[JoinMap.ConfigRoomURI.JoinNumber].StringValue;
|
||||
rmProps.SpeedDials = new List<DDVC01SpeedDial>();
|
||||
|
||||
// This MAY need a check
|
||||
@@ -581,7 +427,7 @@ namespace PepperDash.Essentials.Room.MobileControl
|
||||
rmProps.VideoCodecKey = "videoCodec";
|
||||
|
||||
// volume control names
|
||||
var volCount = EISC.UShortOutput[UshortJoin.NumberOfAuxFaders].UShortValue;
|
||||
var volCount = EISC.UShortOutput[JoinMap.NumberOfAuxFaders.JoinNumber].UShortValue;
|
||||
|
||||
//// use Volumes object or?
|
||||
//rmProps.VolumeSliderNames = new List<string>();
|
||||
@@ -626,18 +472,18 @@ namespace PepperDash.Essentials.Room.MobileControl
|
||||
// add sources...
|
||||
for (uint i = 0; i <= 19; i++)
|
||||
{
|
||||
var name = EISC.StringOutput[StringJoin.SourceNameJoinStart + i].StringValue;
|
||||
if (EISC.BooleanOutput[BoolJoin.UseSourceEnabled].BoolValue
|
||||
&& !EISC.BooleanOutput[BoolJoin.SourceIsEnabledJoinStart + i].BoolValue)
|
||||
var name = EISC.StringOutput[JoinMap.SourceNameJoinStart.JoinNumber + i].StringValue;
|
||||
if (EISC.BooleanOutput[JoinMap.UseSourceEnabled.JoinNumber].BoolValue
|
||||
&& !EISC.BooleanOutput[JoinMap.SourceIsEnabledJoinStart.JoinNumber + i].BoolValue)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
else if(!EISC.BooleanOutput[BoolJoin.UseSourceEnabled].BoolValue && string.IsNullOrEmpty(name))
|
||||
else if(!EISC.BooleanOutput[JoinMap.UseSourceEnabled.JoinNumber].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.SourceShareDisableJoinStart + i].BoolValue;
|
||||
var icon = EISC.StringOutput[JoinMap.SourceIconJoinStart.JoinNumber + i].StringValue;
|
||||
var key = EISC.StringOutput[JoinMap.SourceKeyJoinStart.JoinNumber + i].StringValue;
|
||||
var type = EISC.StringOutput[JoinMap.SourceTypeJoinStart.JoinNumber + i].StringValue;
|
||||
var disableShare = EISC.BooleanOutput[JoinMap.SourceShareDisableJoinStart.JoinNumber + i].BoolValue;
|
||||
|
||||
Debug.Console(0, this, "Adding source {0} '{1}'", key, name);
|
||||
var newSLI = new SourceListItem{
|
||||
@@ -679,14 +525,14 @@ namespace PepperDash.Essentials.Room.MobileControl
|
||||
var acFavs = new List<PepperDash.Essentials.Devices.Common.Codec.CodecActiveCallItem>();
|
||||
for (uint i = 0; i < 4; i++)
|
||||
{
|
||||
if (!EISC.GetBool(BoolJoin.SpeedDialVisibleStartJoin + i))
|
||||
if (!EISC.GetBool(JoinMap.SpeedDialVisibleStartJoin.JoinNumber + i))
|
||||
{
|
||||
break;
|
||||
}
|
||||
acFavs.Add(new PepperDash.Essentials.Devices.Common.Codec.CodecActiveCallItem()
|
||||
{
|
||||
Name = EISC.GetString(StringJoin.SpeedDialNameStartJoin + i),
|
||||
Number = EISC.GetString(StringJoin.SpeedDialNumberStartJoin + i),
|
||||
Name = EISC.GetString(JoinMap.SpeedDialNameStartJoin.JoinNumber + i),
|
||||
Number = EISC.GetString(JoinMap.SpeedDialNumberStartJoin.JoinNumber + i),
|
||||
Type = PepperDash.Essentials.Devices.Common.Codec.eCodecCallType.Audio
|
||||
});
|
||||
}
|
||||
@@ -718,7 +564,7 @@ namespace PepperDash.Essentials.Room.MobileControl
|
||||
var camsProps = new List<object>();
|
||||
for (uint i = 0; i < 9; i++)
|
||||
{
|
||||
var name = EISC.GetString(i + StringJoin.CameraNearNameStart);
|
||||
var name = EISC.GetString(i + JoinMap.CameraNearNameStart.JoinNumber);
|
||||
if (!string.IsNullOrEmpty(name))
|
||||
{
|
||||
camsProps.Add(new
|
||||
@@ -728,7 +574,7 @@ namespace PepperDash.Essentials.Room.MobileControl
|
||||
});
|
||||
}
|
||||
}
|
||||
var farName = EISC.GetString(StringJoin.CameraFarName);
|
||||
var farName = EISC.GetString(JoinMap.CameraFarName.JoinNumber);
|
||||
if (!string.IsNullOrEmpty(farName))
|
||||
{
|
||||
camsProps.Add(new
|
||||
@@ -755,6 +601,8 @@ namespace PepperDash.Essentials.Room.MobileControl
|
||||
co.Devices.Add(conf);
|
||||
}
|
||||
|
||||
SetupDeviceMessengers();
|
||||
|
||||
Debug.Console(0, this, "******* CONFIG FROM DDVC: \r{0}", JsonConvert.SerializeObject(ConfigReader.ConfigObject, Formatting.Indented));
|
||||
|
||||
var handler = ConfigurationIsReady;
|
||||
@@ -766,6 +614,67 @@ namespace PepperDash.Essentials.Room.MobileControl
|
||||
ConfigIsLoaded = true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Iterates device config and adds messengers as neede for each device type
|
||||
/// </summary>
|
||||
void SetupDeviceMessengers()
|
||||
{
|
||||
try
|
||||
{
|
||||
foreach (var device in ConfigReader.ConfigObject.Devices)
|
||||
{
|
||||
if (device.Group.Equals("simplmessenger"))
|
||||
{
|
||||
var props = JsonConvert.DeserializeObject<SimplMessengerPropertiesConfig>(device.Properties.ToString());
|
||||
|
||||
var messengerKey = string.Format("device-{0}-{1}", this.Key, Parent.Key);
|
||||
|
||||
if (DeviceManager.GetDeviceForKey(messengerKey) != null)
|
||||
{
|
||||
Debug.Console(2, this, "Messenger with key: {0} already exists. Skipping...", messengerKey);
|
||||
continue;
|
||||
}
|
||||
|
||||
var dev = ConfigReader.ConfigObject.GetDeviceForKey(props.DeviceKey);
|
||||
|
||||
if (dev == null)
|
||||
{
|
||||
Debug.Console(1, this, "Unable to find device config for key: '{0}'", props.DeviceKey);
|
||||
continue;
|
||||
}
|
||||
|
||||
var type = device.Type.ToLower();
|
||||
MessengerBase messenger = null;
|
||||
|
||||
if (type.Equals("simplcameramessenger"))
|
||||
{
|
||||
Debug.Console(2, this, "Adding SIMPLCameraMessenger for: '{0}'", props.DeviceKey);
|
||||
messenger = new SIMPLCameraMessenger(messengerKey, EISC, "/device/" + props.DeviceKey, props.JoinStart);
|
||||
}
|
||||
else if (type.Equals("simplroutemessenger"))
|
||||
{
|
||||
Debug.Console(2, this, "Adding SIMPLRouteMessenger for: '{0}'", props.DeviceKey);
|
||||
messenger = new SIMPLRouteMessenger(messengerKey, EISC, "/device/" + props.DeviceKey, props.JoinStart);
|
||||
}
|
||||
|
||||
if (messenger != null)
|
||||
{
|
||||
DeviceManager.AddDevice(messenger);
|
||||
messenger.RegisterWithAppServer(Parent);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Console(2, this, "Unable to add messenger for device: '{0}' of type: '{1}'", props.DeviceKey, type);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.Console(2, this, "Error Setting up Device Managers: {0}", e);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
@@ -773,7 +682,7 @@ namespace PepperDash.Essentials.Room.MobileControl
|
||||
{
|
||||
if (ConfigIsLoaded)
|
||||
{
|
||||
var count = EISC.UShortOutput[UshortJoin.NumberOfAuxFaders].UShortValue;
|
||||
var count = EISC.UShortOutput[JoinMap.NumberOfAuxFaders.JoinNumber].UShortValue;
|
||||
|
||||
Debug.Console(1, this, "The Fader Count is : {0}", count);
|
||||
|
||||
@@ -781,7 +690,11 @@ namespace PepperDash.Essentials.Room.MobileControl
|
||||
|
||||
// Create auxFaders
|
||||
var auxFaderDict = new Dictionary<string, Volume>();
|
||||
for (uint i = 2; i <= count; i++)
|
||||
|
||||
var volumeStart = JoinMap.VolumeJoinStart.JoinNumber;
|
||||
var volumeEnd = JoinMap.VolumeJoinStart.JoinNumber + JoinMap.VolumeJoinStart.JoinSpan;
|
||||
|
||||
for (uint i = volumeStart; i <= count; i++)
|
||||
{
|
||||
auxFaderDict.Add("level-" + i,
|
||||
new Volume("level-" + i,
|
||||
@@ -795,22 +708,22 @@ namespace PepperDash.Essentials.Room.MobileControl
|
||||
var volumes = new Volumes();
|
||||
|
||||
volumes.Master = new Volume("master",
|
||||
EISC.UShortOutput[UshortJoin.MasterVolumeLevel].UShortValue,
|
||||
EISC.BooleanOutput[BoolJoin.MasterVolumeIsMuted].BoolValue,
|
||||
EISC.StringOutput[1].StringValue,
|
||||
EISC.UShortOutput[JoinMap.MasterVolume.JoinNumber].UShortValue,
|
||||
EISC.BooleanOutput[JoinMap.MasterVolume.JoinNumber].BoolValue,
|
||||
EISC.StringOutput[JoinMap.MasterVolume.JoinNumber].StringValue,
|
||||
true,
|
||||
"something.png");
|
||||
volumes.Master.HasPrivacyMute = true;
|
||||
volumes.Master.PrivacyMuted = EISC.BooleanOutput[BoolJoin.PrivacyMute].BoolValue;
|
||||
volumes.Master.PrivacyMuted = EISC.BooleanOutput[JoinMap.PrivacyMute.JoinNumber].BoolValue;
|
||||
|
||||
volumes.AuxFaders = auxFaderDict;
|
||||
volumes.NumberOfAuxFaders = EISC.UShortInput[UshortJoin.NumberOfAuxFaders].UShortValue;
|
||||
volumes.NumberOfAuxFaders = EISC.UShortInput[JoinMap.NumberOfAuxFaders.JoinNumber].UShortValue;
|
||||
|
||||
PostStatusMessage(new
|
||||
{
|
||||
activityMode = GetActivityMode(),
|
||||
isOn = EISC.BooleanOutput[BoolJoin.RoomIsOn].BoolValue,
|
||||
selectedSourceKey = EISC.StringOutput[StringJoin.SelectedSourceKey].StringValue,
|
||||
isOn = EISC.BooleanOutput[JoinMap.RoomIsOn.JoinNumber].BoolValue,
|
||||
selectedSourceKey = EISC.StringOutput[JoinMap.CurrentSourceKey.JoinNumber].StringValue,
|
||||
volumes = volumes
|
||||
});
|
||||
}
|
||||
@@ -829,9 +742,9 @@ namespace PepperDash.Essentials.Room.MobileControl
|
||||
/// <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;
|
||||
if (EISC.BooleanOutput[JoinMap.ActivityPhoneCall.JoinNumber].BoolValue) return 2;
|
||||
else if (EISC.BooleanOutput[JoinMap.ActivityShare.JoinNumber].BoolValue) return 1;
|
||||
else if (EISC.BooleanOutput[JoinMap.ActivityVideoCall.JoinNumber].BoolValue) return 3;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -873,12 +786,15 @@ namespace PepperDash.Essentials.Room.MobileControl
|
||||
if (Debug.Level >= 1)
|
||||
Debug.Console(1, this, "DDVC EISC 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);
|
||||
if (uo != null)
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -905,8 +821,39 @@ namespace PepperDash.Essentials.Room.MobileControl
|
||||
protected override void UserCodeChange()
|
||||
{
|
||||
Debug.Console(1, this, "Server user code changed: {0}", UserCode);
|
||||
EISC.StringInput[StringJoin.UserCodeToSystem].StringValue = UserCode;
|
||||
EISC.StringInput[StringJoin.ServerUrl].StringValue = Parent.Config.ClientAppUrl;
|
||||
EISC.StringInput[JoinMap.UserCodeToSystem.JoinNumber].StringValue = UserCode;
|
||||
EISC.StringInput[JoinMap.ServerUrl.JoinNumber].StringValue = Parent.Config.ClientAppUrl;
|
||||
}
|
||||
}
|
||||
|
||||
public class MobileControlSIMPLRoomBridgeFactory : EssentialsDeviceFactory<MobileControlSIMPLRoomBridge>
|
||||
{
|
||||
public MobileControlSIMPLRoomBridgeFactory()
|
||||
{
|
||||
TypeNames = new List<string>() { "mobilecontrolbridge-ddvc01", "mobilecontrolbridge-simpl" };
|
||||
}
|
||||
|
||||
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||
{
|
||||
Debug.Console(1, "Factory Attempting to create new MobileControlSIMPLRoomBridge Device");
|
||||
|
||||
var comm = CommFactory.GetControlPropertiesConfig(dc);
|
||||
|
||||
var bridge = new PepperDash.Essentials.Room.MobileControl.MobileControlSIMPLRoomBridge(dc.Key, dc.Name, comm.IpIdInt);
|
||||
bridge.AddPreActivationAction(() =>
|
||||
{
|
||||
var parent = DeviceManager.AllDevices.FirstOrDefault(d => d.Key == "appServer") as MobileControlSystemController;
|
||||
if (parent == null)
|
||||
{
|
||||
Debug.Console(0, bridge, "ERROR: Cannot connect bridge. System controller not present");
|
||||
}
|
||||
Debug.Console(0, bridge, "Linking to parent controller");
|
||||
bridge.AddParent(parent);
|
||||
parent.AddBridge(bridge);
|
||||
});
|
||||
|
||||
return bridge;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
|
||||
using PepperDash.Essentials.Core;
|
||||
|
||||
|
||||
namespace PepperDash.Essentials.AppServer
|
||||
{
|
||||
public class MobileControlSIMPLRoomJoinMap : JoinMapBaseAdvanced
|
||||
{
|
||||
[JoinName("MasterVolume")]
|
||||
public JoinDataComplete MasterVolume = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 }, new JoinMetadata() {Label = "Master Volume Mute Toggle/FB/Level/Label", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.DigitalAnalogSerial });
|
||||
[JoinName("VolumeJoinStart")]
|
||||
public JoinDataComplete VolumeJoinStart = new JoinDataComplete(new JoinData() { JoinNumber = 2, JoinSpan = 8 }, new JoinMetadata() {Label = "Volume Mute Toggle/FB/Level/Label", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.DigitalAnalogSerial });
|
||||
|
||||
[JoinName("PrivacyMute")]
|
||||
public JoinDataComplete PrivacyMute = new JoinDataComplete(new JoinData() { JoinNumber = 12, JoinSpan = 1 }, new JoinMetadata() { Label = "Privacy Mute Toggle/FB", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
|
||||
|
||||
[JoinName("PromptForCode")]
|
||||
public JoinDataComplete PromptForCode = new JoinDataComplete(new JoinData() { JoinNumber = 41, JoinSpan = 1 }, new JoinMetadata() {Label = "Prompt User for Code", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||
[JoinName("ClientJoined")]
|
||||
public JoinDataComplete ClientJoined = new JoinDataComplete(new JoinData() { JoinNumber = 42, JoinSpan = 1 }, new JoinMetadata() { Label = "Client Joined", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||
[JoinName("ActivityShare")]
|
||||
public JoinDataComplete ActivityShare = new JoinDataComplete(new JoinData() { JoinNumber = 51, JoinSpan = 1 }, new JoinMetadata() {Label = "Activity Share", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
|
||||
[JoinName("ActivityPhoneCall")]
|
||||
public JoinDataComplete ActivityPhoneCall = new JoinDataComplete(new JoinData() { JoinNumber = 52, JoinSpan = 1 }, new JoinMetadata() { Label = "Activity Phone Call", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
|
||||
[JoinName("ActivityVideoCall")]
|
||||
public JoinDataComplete ActivityVideoCall = new JoinDataComplete(new JoinData() { JoinNumber = 53, JoinSpan = 1 }, new JoinMetadata() { Label = "Activity Video Call", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
|
||||
|
||||
[JoinName("ShutdownPromptDuration")]
|
||||
public JoinDataComplete ShutdownPromptDuration = new JoinDataComplete(new JoinData() { JoinNumber = 61, JoinSpan = 1 }, new JoinMetadata() { Label ="Shutdown Cancel", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Analog });
|
||||
[JoinName("ShutdownCancel")]
|
||||
public JoinDataComplete ShutdownCancel = new JoinDataComplete(new JoinData() { JoinNumber = 61, JoinSpan = 1 }, new JoinMetadata() { Label ="Shutdown Cancel", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
|
||||
[JoinName("ShutdownEnd")]
|
||||
public JoinDataComplete ShutdownEnd = new JoinDataComplete(new JoinData() { JoinNumber = 62, JoinSpan = 1 }, new JoinMetadata() { Label = "Shutdown End", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
|
||||
[JoinName("ShutdownStart")]
|
||||
public JoinDataComplete ShutdownStart = new JoinDataComplete(new JoinData() { JoinNumber = 63, JoinSpan = 1 }, new JoinMetadata() { Label = "Shutdown Start", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
|
||||
|
||||
[JoinName("SourceHasChanged")]
|
||||
public JoinDataComplete SourceHasChanged = new JoinDataComplete(new JoinData() { JoinNumber = 71, JoinSpan = 1 }, new JoinMetadata() { Label = "Source Changed", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
|
||||
[JoinName("CurrentSourceKey")]
|
||||
public JoinDataComplete CurrentSourceKey = new JoinDataComplete(new JoinData() { JoinNumber = 71, JoinSpan = 1 }, new JoinMetadata() { Label = "Key of selected source", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Serial });
|
||||
|
||||
|
||||
[JoinName("ConfigIsLocal")]
|
||||
public JoinDataComplete ConfigIsLocal = new JoinDataComplete(new JoinData() { JoinNumber = 100, JoinSpan = 1 }, new JoinMetadata() { Label = "Config is local to Essentials", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
|
||||
[JoinName("NumberOfAuxFaders")]
|
||||
public JoinDataComplete NumberOfAuxFaders = new JoinDataComplete(new JoinData() { JoinNumber = 101, JoinSpan = 1 }, new JoinMetadata() { Label = "Number of Auxilliary Faders", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Analog });
|
||||
|
||||
[JoinName("SpeedDialNameStartJoin")]
|
||||
public JoinDataComplete SpeedDialNameStartJoin = new JoinDataComplete(new JoinData() { JoinNumber = 241, JoinSpan = 10 }, new JoinMetadata() { Label = "Speed Dial names", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Serial });
|
||||
[JoinName("SpeedDialNumberStartJoin")]
|
||||
public JoinDataComplete SpeedDialNumberStartJoin = new JoinDataComplete(new JoinData() { JoinNumber = 251, JoinSpan = 10 }, new JoinMetadata() { Label = "Speed Dial numbers", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Serial });
|
||||
|
||||
[JoinName("SpeedDialVisibleStartJoin")]
|
||||
public JoinDataComplete SpeedDialVisibleStartJoin = new JoinDataComplete(new JoinData() { JoinNumber = 261, JoinSpan = 10 }, new JoinMetadata() { Label = "Speed Dial Visible", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
|
||||
|
||||
[JoinName("RoomIsOn")]
|
||||
public JoinDataComplete RoomIsOn = new JoinDataComplete(new JoinData() { JoinNumber = 301, JoinSpan = 1 }, new JoinMetadata() { Label = "Room Is On", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
|
||||
|
||||
[JoinName("UserCodeToSystem")]
|
||||
public JoinDataComplete UserCodeToSystem = new JoinDataComplete(new JoinData() { JoinNumber = 401, JoinSpan = 1 }, new JoinMetadata() { Label = "User Ccde", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
|
||||
[JoinName("ServerUrl")]
|
||||
public JoinDataComplete ServerUrl = new JoinDataComplete(new JoinData() { JoinNumber = 402, JoinSpan = 1 }, new JoinMetadata() { Label ="Server URL", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
|
||||
|
||||
[JoinName("ConfigRoomName")]
|
||||
public JoinDataComplete ConfigRoomName = new JoinDataComplete(new JoinData() { JoinNumber = 501, JoinSpan = 1 }, new JoinMetadata() {Label = "Room Nnme", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Serial });
|
||||
[JoinName("ConfigHelpMessage")]
|
||||
public JoinDataComplete ConfigHelpMessage = new JoinDataComplete(new JoinData() { JoinNumber = 502, JoinSpan = 1 }, new JoinMetadata() { Label = "Room help message", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Serial });
|
||||
[JoinName("ConfigHelpNumber")]
|
||||
public JoinDataComplete ConfigHelpNumber = new JoinDataComplete(new JoinData() { JoinNumber = 503, JoinSpan = 1 }, new JoinMetadata() { Label = "Room help number", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Serial });
|
||||
[JoinName("ConfigRoomPhoneNumber")]
|
||||
public JoinDataComplete ConfigRoomPhoneNumber = new JoinDataComplete(new JoinData() { JoinNumber = 504, JoinSpan = 1 }, new JoinMetadata() { Label = "Room phone number", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Serial });
|
||||
[JoinName("ConfigRoomURI")]
|
||||
public JoinDataComplete ConfigRoomURI = new JoinDataComplete(new JoinData() { JoinNumber = 505, JoinSpan = 1 }, new JoinMetadata() { Label = "Room URI", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Serial });
|
||||
|
||||
[JoinName("ConfigIsReady")]
|
||||
public JoinDataComplete ConfigIsReady = new JoinDataComplete(new JoinData() { JoinNumber = 501, JoinSpan = 1 }, new JoinMetadata() { Label = "Config info from SIMPL is ready", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
|
||||
[JoinName("HideVideoConfRecents")]
|
||||
public JoinDataComplete HideVideoConfRecents = new JoinDataComplete(new JoinData() { JoinNumber = 502, JoinSpan = 1 }, new JoinMetadata() { Label = "Hide Video Conference Recents", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
|
||||
[JoinName("ShowCameraWhenNotInCall")]
|
||||
public JoinDataComplete ShowCameraWhenNotInCall = new JoinDataComplete(new JoinData() { JoinNumber = 503, JoinSpan = 1 }, new JoinMetadata() { Label = "Show camera when not in call", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
|
||||
[JoinName("UseSourceEnabled")]
|
||||
public JoinDataComplete UseSourceEnabled = new JoinDataComplete(new JoinData() { JoinNumber = 504, JoinSpan = 1 }, new JoinMetadata() { Label = "Use Source Enabled Joins", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
|
||||
|
||||
|
||||
[JoinName("SourceShareDisableJoinStart")]
|
||||
public JoinDataComplete SourceShareDisableJoinStart = new JoinDataComplete(new JoinData() { JoinNumber = 601, JoinSpan = 20 }, new JoinMetadata() { Label = "Source is not sharable", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
|
||||
[JoinName("SourceIsEnabledJoinStart")]
|
||||
public JoinDataComplete SourceIsEnabledJoinStart = new JoinDataComplete(new JoinData() { JoinNumber = 621, JoinSpan = 20 }, new JoinMetadata() { Label = "Source is enabled", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
|
||||
|
||||
[JoinName("SourceNameJoinStart")]
|
||||
public JoinDataComplete SourceNameJoinStart = new JoinDataComplete(new JoinData() { JoinNumber = 601, JoinSpan = 20 }, new JoinMetadata() { Label = "Source Names", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Serial });
|
||||
[JoinName("SourceIconJoinStart")]
|
||||
public JoinDataComplete SourceIconJoinStart = new JoinDataComplete(new JoinData() { JoinNumber = 621, JoinSpan = 20 }, new JoinMetadata() { Label = "Source Icons", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Serial });
|
||||
[JoinName("SourceKeyJoinStart")]
|
||||
public JoinDataComplete SourceKeyJoinStart = new JoinDataComplete(new JoinData() { JoinNumber = 641, JoinSpan = 20 }, new JoinMetadata() { Label = "Source Keys", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Serial });
|
||||
[JoinName("SourceTypeJoinStart")]
|
||||
public JoinDataComplete SourceTypeJoinStart = new JoinDataComplete(new JoinData() { JoinNumber = 661, JoinSpan = 20 }, new JoinMetadata() { Label = "Source Types", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Serial });
|
||||
|
||||
[JoinName("CameraNearNameStart")]
|
||||
public JoinDataComplete CameraNearNameStart = new JoinDataComplete(new JoinData() { JoinNumber = 761, JoinSpan = 10 }, new JoinMetadata() { Label = "Near End Camera Names", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Serial });
|
||||
[JoinName("CameraFarName")]
|
||||
public JoinDataComplete CameraFarName = new JoinDataComplete(new JoinData() { JoinNumber = 770, JoinSpan = 1 }, new JoinMetadata() { Label = "Far End Camera Name", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Serial });
|
||||
|
||||
public MobileControlSIMPLRoomJoinMap(uint joinStart)
|
||||
:base(joinStart)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
using System.Linq;
|
||||
using Crestron.SimplSharp.Reflection;
|
||||
|
||||
using PepperDash.Essentials.Core;
|
||||
|
||||
|
||||
namespace PepperDash.Essentials.AppServer
|
||||
{
|
||||
public class SIMPLAtcJoinMap : JoinMapBaseAdvanced
|
||||
{
|
||||
[JoinName("EndCall")]
|
||||
public JoinDataComplete EndCall = new JoinDataComplete(new JoinData() { JoinNumber = 21, JoinSpan = 1 }, new JoinMetadata() { Label = "Hang Up", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||
[JoinName("IncomingAnswer")]
|
||||
public JoinDataComplete IncomingAnswer = new JoinDataComplete(new JoinData() { JoinNumber = 51, JoinSpan = 1 }, new JoinMetadata() { Label = "Answer Incoming Call", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||
[JoinName("IncomingReject")]
|
||||
public JoinDataComplete IncomingReject = new JoinDataComplete(new JoinData() { JoinNumber = 52, JoinSpan = 1 }, new JoinMetadata() { Label = "Reject Incoming Call", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||
[JoinName("SpeedDialStart")]
|
||||
public JoinDataComplete SpeedDialStart = new JoinDataComplete(new JoinData() { JoinNumber = 41, JoinSpan = 4 }, new JoinMetadata() { Label = "Speed Dial", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||
[JoinName("CurrentDialString")]
|
||||
public JoinDataComplete CurrentDialString = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 }, new JoinMetadata() { Label = "Current Dial String", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Serial });
|
||||
[JoinName("CurrentCallNumber")]
|
||||
public JoinDataComplete CurrentCallNumber = new JoinDataComplete(new JoinData() { JoinNumber = 11, JoinSpan = 1 }, new JoinMetadata() { Label = "Current Call Number", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Serial });
|
||||
[JoinName("CurrentCallName")]
|
||||
public JoinDataComplete CurrentCallName = new JoinDataComplete(new JoinData() { JoinNumber = 12, JoinSpan = 1 }, new JoinMetadata() { Label = "Current Call Name", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Serial });
|
||||
[JoinName("HookState")]
|
||||
public JoinDataComplete HookState = new JoinDataComplete(new JoinData() { JoinNumber = 21, JoinSpan = 1 }, new JoinMetadata() { Label = "Current Hook State", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Serial });
|
||||
[JoinName("CallDirection")]
|
||||
public JoinDataComplete CallDirection = new JoinDataComplete(new JoinData() { JoinNumber = 22, JoinSpan = 1 }, new JoinMetadata() { Label = "Current Call Direction", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Serial });
|
||||
[JoinName("IncomingCallName")]
|
||||
public JoinDataComplete IncomingCallName = new JoinDataComplete(new JoinData() { JoinNumber = 51, JoinSpan = 1 }, new JoinMetadata() { Label = "Incoming Call Name", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Serial });
|
||||
[JoinName("IncomingCallNumber")]
|
||||
public JoinDataComplete IncomingCallNumber = new JoinDataComplete(new JoinData() { JoinNumber = 52, JoinSpan = 1 }, new JoinMetadata() { Label = "Incoming Call Number", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Serial });
|
||||
|
||||
[JoinName("0")]
|
||||
public JoinDataComplete Dtmf0 = new JoinDataComplete(new JoinData() { JoinNumber = 10, JoinSpan = 1 }, new JoinMetadata() { Label = "DTMF 0", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||
[JoinName("1")]
|
||||
public JoinDataComplete Dtmf1 = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 }, new JoinMetadata() { Label = "DTMF 1", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||
[JoinName("2")]
|
||||
public JoinDataComplete Dtmf2 = new JoinDataComplete(new JoinData() { JoinNumber = 2, JoinSpan = 1 }, new JoinMetadata() { Label = "DTMF 2", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||
[JoinName("3")]
|
||||
public JoinDataComplete Dtmf3 = new JoinDataComplete(new JoinData() { JoinNumber = 3, JoinSpan = 1 }, new JoinMetadata() { Label = "DTMF 3", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||
[JoinName("4")]
|
||||
public JoinDataComplete Dtmf4 = new JoinDataComplete(new JoinData() { JoinNumber = 4, JoinSpan = 1 }, new JoinMetadata() { Label = "DTMF 4", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||
[JoinName("5")]
|
||||
public JoinDataComplete Dtmf5 = new JoinDataComplete(new JoinData() { JoinNumber = 5, JoinSpan = 1 }, new JoinMetadata() { Label = "DTMF 5", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||
[JoinName("6")]
|
||||
public JoinDataComplete Dtmf6 = new JoinDataComplete(new JoinData() { JoinNumber = 6, JoinSpan = 1 }, new JoinMetadata() { Label = "DTMF 6", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||
[JoinName("7")]
|
||||
public JoinDataComplete Dtmf7 = new JoinDataComplete(new JoinData() { JoinNumber = 7, JoinSpan = 1 }, new JoinMetadata() { Label = "DTMF 7", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||
[JoinName("8")]
|
||||
public JoinDataComplete Dtmf8 = new JoinDataComplete(new JoinData() { JoinNumber = 8, JoinSpan = 1 }, new JoinMetadata() { Label = "DTMF 8", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||
[JoinName("9")]
|
||||
public JoinDataComplete Dtmf9 = new JoinDataComplete(new JoinData() { JoinNumber = 9, JoinSpan = 1 }, new JoinMetadata() { Label = "DTMF 9", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||
[JoinName("*")]
|
||||
public JoinDataComplete DtmfStar = new JoinDataComplete(new JoinData() { JoinNumber = 11, JoinSpan = 1 }, new JoinMetadata() { Label = "DTMF *", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||
[JoinName("#")]
|
||||
public JoinDataComplete DtmfPound = new JoinDataComplete(new JoinData() { JoinNumber = 12, JoinSpan = 1 }, new JoinMetadata() { Label = "DTMF #", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||
|
||||
/// <summary>
|
||||
/// Constructor that passes the joinStart to the base class
|
||||
/// </summary>
|
||||
/// <param name="joinStart"></param>
|
||||
public SIMPLAtcJoinMap(uint joinStart)
|
||||
: base(joinStart)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
141
PepperDashEssentials/AppServer/SIMPLJoinMaps/SIMPLVtcJoinMap.cs
Normal file
141
PepperDashEssentials/AppServer/SIMPLJoinMaps/SIMPLVtcJoinMap.cs
Normal file
@@ -0,0 +1,141 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
|
||||
using PepperDash.Essentials.Core;
|
||||
|
||||
|
||||
namespace PepperDash.Essentials.AppServer
|
||||
{
|
||||
public class SIMPLVtcJoinMap : JoinMapBaseAdvanced
|
||||
{
|
||||
[JoinName("EndCall")]
|
||||
public JoinDataComplete EndCall = new JoinDataComplete(new JoinData() { JoinNumber = 24, JoinSpan = 1 }, new JoinMetadata() { Label = "Hang Up", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||
[JoinName("IncomingCall")]
|
||||
public JoinDataComplete IncomingCall = new JoinDataComplete(new JoinData() { JoinNumber = 50, JoinSpan = 1 }, new JoinMetadata() { Label = "Incoming Call", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
|
||||
[JoinName("IncomingAnswer")]
|
||||
public JoinDataComplete IncomingAnswer = new JoinDataComplete(new JoinData() { JoinNumber = 51, JoinSpan = 1 }, new JoinMetadata() { Label = "Answer Incoming Call", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||
[JoinName("IncomingReject")]
|
||||
public JoinDataComplete IncomingReject = new JoinDataComplete(new JoinData() { JoinNumber = 52, JoinSpan = 1 }, new JoinMetadata() { Label = "Reject Incoming Call", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||
[JoinName("SpeedDialStart")]
|
||||
public JoinDataComplete SpeedDialStart = new JoinDataComplete(new JoinData() { JoinNumber = 41, JoinSpan = 4 }, new JoinMetadata() { Label = "Speed Dial", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||
|
||||
[JoinName("DirectorySearchBusy")]
|
||||
public JoinDataComplete DirectorySearchBusy = new JoinDataComplete(new JoinData() { JoinNumber = 100, JoinSpan = 1 }, new JoinMetadata() { Label = "Directory Search Busy FB", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
|
||||
[JoinName("DirectoryLineSelected")]
|
||||
public JoinDataComplete DirectoryLineSelected = new JoinDataComplete(new JoinData() { JoinNumber = 101, JoinSpan = 1 }, new JoinMetadata() { Label = "Directory Line Selected FB", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
|
||||
[JoinName("DirectoryEntryIsContact")]
|
||||
public JoinDataComplete DirectoryEntryIsContact = new JoinDataComplete(new JoinData() { JoinNumber = 101, JoinSpan = 1 }, new JoinMetadata() { Label = "Directory Selected Entry Is Contact FB", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
|
||||
[JoinName("DirectoryIsRoot")]
|
||||
public JoinDataComplete DirectoryIsRoot = new JoinDataComplete(new JoinData() { JoinNumber = 102, JoinSpan = 1 }, new JoinMetadata() { Label = "Directory is on Root FB", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
|
||||
[JoinName("DDirectoryHasChanged")]
|
||||
public JoinDataComplete DDirectoryHasChanged = new JoinDataComplete(new JoinData() { JoinNumber = 103, JoinSpan = 1 }, new JoinMetadata() {Label = "Directory has changed FB", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
|
||||
[JoinName("DirectoryRoot")]
|
||||
public JoinDataComplete DirectoryRoot = new JoinDataComplete(new JoinData() { JoinNumber = 104, JoinSpan = 1 }, new JoinMetadata() { Label = "Go to Directory Root", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||
[JoinName("DirectoryFolderBack")]
|
||||
public JoinDataComplete DirectoryFolderBack = new JoinDataComplete(new JoinData() { JoinNumber = 105, JoinSpan = 1 }, new JoinMetadata() { Label = "Go back one directory level", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||
[JoinName("DirectoryDialSelectedLine")]
|
||||
public JoinDataComplete DirectoryDialSelectedLine = new JoinDataComplete(new JoinData() { JoinNumber = 106, JoinSpan = 1 }, new JoinMetadata() { Label = "Dial selected directory line", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||
|
||||
[JoinName("CameraTiltUp")]
|
||||
public JoinDataComplete CameraTiltUp = new JoinDataComplete(new JoinData() { JoinNumber = 111, JoinSpan = 1 }, new JoinMetadata() { Label = "Camera Tilt Up", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||
[JoinName("CameraTiltDown")]
|
||||
public JoinDataComplete CameraTiltDown = new JoinDataComplete(new JoinData() { JoinNumber = 112, JoinSpan = 1 }, new JoinMetadata() { Label = "Camera Tilt Down", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||
[JoinName("CameraPanLeft")]
|
||||
public JoinDataComplete CameraPanLeft = new JoinDataComplete(new JoinData() { JoinNumber = 113, JoinSpan = 1 }, new JoinMetadata() { Label = "Camera Pan Left", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||
[JoinName("CameraPanRight")]
|
||||
public JoinDataComplete CameraPanRight = new JoinDataComplete(new JoinData() { JoinNumber = 114, JoinSpan = 1 }, new JoinMetadata() { Label = "Camera Pan Right", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||
[JoinName("CameraZoomIn")]
|
||||
public JoinDataComplete CameraZoomIn = new JoinDataComplete(new JoinData() { JoinNumber = 115, JoinSpan = 1 }, new JoinMetadata() { Label = "Camera Zoom In", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||
[JoinName("CameraZoomOut")]
|
||||
public JoinDataComplete CameraZoomOut = new JoinDataComplete(new JoinData() { JoinNumber = 116, JoinSpan = 1 }, new JoinMetadata() { Label = "Camera Zoom Out", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||
|
||||
[JoinName("CameraPresetStart")]
|
||||
public JoinDataComplete CameraPresetStart = new JoinDataComplete(new JoinData() { JoinNumber = 121, JoinSpan = 5 }, new JoinMetadata() { Label = "Camera Presets", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
|
||||
|
||||
[JoinName("CameraModeAuto")]
|
||||
public JoinDataComplete CameraModeAuto = new JoinDataComplete(new JoinData() { JoinNumber = 131, JoinSpan = 1 }, new JoinMetadata() { Label = "Camera Mode Auto", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
|
||||
[JoinName("CameraModeManual")]
|
||||
public JoinDataComplete CameraModeManual = new JoinDataComplete(new JoinData() { JoinNumber = 132, JoinSpan = 1 }, new JoinMetadata() { Label = "Camera Mode Manual", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
|
||||
[JoinName("CameraModeOff")]
|
||||
public JoinDataComplete CameraModeOff = new JoinDataComplete(new JoinData() { JoinNumber = 133, JoinSpan = 1 }, new JoinMetadata() { Label = "Camera Mode Off", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
|
||||
|
||||
[JoinName("CameraSelfView")]
|
||||
public JoinDataComplete CameraSelfView = new JoinDataComplete(new JoinData() { JoinNumber = 141, JoinSpan = 1 }, new JoinMetadata() { Label = "Camera Self View Toggle/FB", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
|
||||
[JoinName("CameraLayout")]
|
||||
public JoinDataComplete CameraLayout = new JoinDataComplete(new JoinData() { JoinNumber = 142, JoinSpan = 1 }, new JoinMetadata() { Label = "Camera Layout Toggle", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||
|
||||
[JoinName("CameraSupportsAutoMode")]
|
||||
public JoinDataComplete CameraSupportsAutoMode = new JoinDataComplete(new JoinData() { JoinNumber = 143, JoinSpan = 1 }, new JoinMetadata() { Label = "Camera Supports Auto Mode FB", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
|
||||
[JoinName("CameraSupportsOffMode")]
|
||||
public JoinDataComplete CameraSupportsOffMode = new JoinDataComplete(new JoinData() { JoinNumber = 144, JoinSpan = 1 }, new JoinMetadata() { Label = "Camera Supports Off Mode FB", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
|
||||
|
||||
[JoinName("CameraNumberSelect")]
|
||||
public JoinDataComplete CameraNumberSelect = new JoinDataComplete(new JoinData() { JoinNumber = 60, JoinSpan = 1 }, new JoinMetadata() { Label = "Camera Number Select/FB", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
|
||||
[JoinName("DirectorySelectRow")]
|
||||
public JoinDataComplete DirectorySelectRow = new JoinDataComplete(new JoinData() { JoinNumber = 101, JoinSpan = 1 }, new JoinMetadata() { Label = "Directory Select Row", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||
[JoinName("DirectoryRowCount")]
|
||||
public JoinDataComplete DirectoryRowCount = new JoinDataComplete(new JoinData() { JoinNumber = 101, JoinSpan = 1 }, new JoinMetadata() { Label = "Directory Row Count FB", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
|
||||
|
||||
[JoinName("CurrentDialString")]
|
||||
public JoinDataComplete CurrentDialString = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 }, new JoinMetadata() { Label = "Current Dial String", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Serial });
|
||||
[JoinName("CurrentCallName")]
|
||||
public JoinDataComplete CurrentCallName = new JoinDataComplete(new JoinData() { JoinNumber = 2, JoinSpan = 1 }, new JoinMetadata() { Label = "Current Call Name", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Serial });
|
||||
[JoinName("CurrentCallNumber")]
|
||||
public JoinDataComplete CurrentCallNumber = new JoinDataComplete(new JoinData() { JoinNumber = 3, JoinSpan = 1 }, new JoinMetadata() { Label = "Current Call Number", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Serial });
|
||||
[JoinName("HookState")]
|
||||
public JoinDataComplete HookState = new JoinDataComplete(new JoinData() { JoinNumber = 31, JoinSpan = 1 }, new JoinMetadata() { Label = "Current Hook State", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Serial });
|
||||
[JoinName("CallDirection")]
|
||||
public JoinDataComplete CallDirection = new JoinDataComplete(new JoinData() { JoinNumber = 22, JoinSpan = 1 }, new JoinMetadata() { Label = "Current Call Direction", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Serial });
|
||||
|
||||
[JoinName("IncomingCallName")]
|
||||
public JoinDataComplete IncomingCallName = new JoinDataComplete(new JoinData() { JoinNumber = 51, JoinSpan = 1 }, new JoinMetadata() { Label = "Incoming Call Name", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Serial });
|
||||
[JoinName("IncomingCallNumber")]
|
||||
public JoinDataComplete IncomingCallNumber = new JoinDataComplete(new JoinData() { JoinNumber = 52, JoinSpan = 1 }, new JoinMetadata() { Label = "Incoming Call Number", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Serial });
|
||||
|
||||
[JoinName("DirectorySearchString")]
|
||||
public JoinDataComplete DirectorySearchString = new JoinDataComplete(new JoinData() { JoinNumber = 100, JoinSpan = 1 }, new JoinMetadata() { Label = "Directory Search String", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
|
||||
[JoinName("DirectoryEntriesStart")]
|
||||
public JoinDataComplete DirectoryEntriesStart = new JoinDataComplete(new JoinData() { JoinNumber = 101, JoinSpan = 255 }, new JoinMetadata() { Label = "Directory Entries", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Serial });
|
||||
|
||||
[JoinName("DirectoryEntrySelectedName")]
|
||||
public JoinDataComplete DirectoryEntrySelectedName = new JoinDataComplete(new JoinData() { JoinNumber = 356, JoinSpan = 1 }, new JoinMetadata() { Label = "Selected Directory Entry Name", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Serial });
|
||||
[JoinName("DirectoryEntrySelectedNumber")]
|
||||
public JoinDataComplete DirectoryEntrySelectedNumber = new JoinDataComplete(new JoinData() { JoinNumber = 357, JoinSpan = 1 }, new JoinMetadata() { Label = "Selected Directory Entry Number", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Serial });
|
||||
[JoinName("DirectorySelectedFolderName")]
|
||||
public JoinDataComplete DirectorySelectedFolderName = new JoinDataComplete(new JoinData() { JoinNumber = 358, JoinSpan = 1 }, new JoinMetadata() { Label = "Selected Directory Folder Name", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Serial });
|
||||
|
||||
[JoinName("1")]
|
||||
public JoinDataComplete Dtmf1 = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 }, new JoinMetadata() { Label = "DTMF 1", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||
[JoinName("2")]
|
||||
public JoinDataComplete Dtmf2 = new JoinDataComplete(new JoinData() { JoinNumber = 2, JoinSpan = 1 }, new JoinMetadata() { Label = "DTMF 2", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||
[JoinName("3")]
|
||||
public JoinDataComplete Dtmf3 = new JoinDataComplete(new JoinData() { JoinNumber = 3, JoinSpan = 1 }, new JoinMetadata() { Label = "DTMF 3", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||
[JoinName("4")]
|
||||
public JoinDataComplete Dtmf4 = new JoinDataComplete(new JoinData() { JoinNumber = 4, JoinSpan = 1 }, new JoinMetadata() { Label = "DTMF 4", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||
[JoinName("5")]
|
||||
public JoinDataComplete Dtmf5 = new JoinDataComplete(new JoinData() { JoinNumber = 5, JoinSpan = 1 }, new JoinMetadata() { Label = "DTMF 5", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||
[JoinName("6")]
|
||||
public JoinDataComplete Dtmf6 = new JoinDataComplete(new JoinData() { JoinNumber = 6, JoinSpan = 1 }, new JoinMetadata() { Label = "DTMF 6", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||
[JoinName("7")]
|
||||
public JoinDataComplete Dtmf7 = new JoinDataComplete(new JoinData() { JoinNumber = 7, JoinSpan = 1 }, new JoinMetadata() { Label = "DTMF 7", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||
[JoinName("8")]
|
||||
public JoinDataComplete Dtmf8 = new JoinDataComplete(new JoinData() { JoinNumber = 8, JoinSpan = 1 }, new JoinMetadata() { Label = "DTMF 8", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||
[JoinName("9")]
|
||||
public JoinDataComplete Dtmf9 = new JoinDataComplete(new JoinData() { JoinNumber = 9, JoinSpan = 1 }, new JoinMetadata() { Label = "DTMF 9", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||
[JoinName("0")]
|
||||
public JoinDataComplete Dtmf0 = new JoinDataComplete(new JoinData() { JoinNumber = 10, JoinSpan = 1 }, new JoinMetadata() { Label = "DTMF 0", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||
[JoinName("*")]
|
||||
public JoinDataComplete DtmfStar = new JoinDataComplete(new JoinData() { JoinNumber = 11, JoinSpan = 1 }, new JoinMetadata() { Label = "DTMF *", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||
[JoinName("#")]
|
||||
public JoinDataComplete DtmfPound = new JoinDataComplete(new JoinData() { JoinNumber = 12, JoinSpan = 1 }, new JoinMetadata() { Label = "DTMF #", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||
|
||||
public SIMPLVtcJoinMap(uint joinStart)
|
||||
:base(joinStart)
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -11,7 +11,7 @@ using PepperDash.Essentials.DM.AirMedia;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
namespace PepperDash.Essentials.Core.Bridges
|
||||
{
|
||||
public static class AirMediaControllerApiExtensions
|
||||
{
|
||||
@@ -19,7 +19,7 @@ namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
AirMediaControllerJoinMap joinMap = new AirMediaControllerJoinMap();
|
||||
|
||||
var joinMapSerialized = JoinMapHelper.GetJoinMapForDevice(joinMapKey);
|
||||
var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
|
||||
|
||||
if (!string.IsNullOrEmpty(joinMapSerialized))
|
||||
joinMap = JsonConvert.DeserializeObject<AirMediaControllerJoinMap>(joinMapSerialized);
|
||||
|
||||
@@ -11,7 +11,7 @@ using PepperDash.Essentials.Devices.Common;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
namespace PepperDash.Essentials.Core.Bridges
|
||||
{
|
||||
public static class AppleTvApiExtensions
|
||||
{
|
||||
@@ -19,7 +19,7 @@ namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
AppleTvJoinMap joinMap = new AppleTvJoinMap();
|
||||
|
||||
var joinMapSerialized = JoinMapHelper.GetJoinMapForDevice(joinMapKey);
|
||||
var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
|
||||
|
||||
if(!string.IsNullOrEmpty(joinMapSerialized))
|
||||
joinMap = JsonConvert.DeserializeObject<AppleTvJoinMap>(joinMapSerialized);
|
||||
|
||||
@@ -1,290 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro.EthernetCommunication;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
using PepperDash.Core;
|
||||
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;
|
||||
//using PepperDash.Essentials.Devices.Common.Cameras;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
/// <summary>
|
||||
/// Base class for all bridge class variants
|
||||
/// </summary>
|
||||
public class BridgeBase : Device
|
||||
{
|
||||
public BridgeApi Api { get; private set; }
|
||||
|
||||
public BridgeBase(string key) :
|
||||
base(key)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Base class for bridge API variants
|
||||
/// </summary>
|
||||
public abstract class BridgeApi : Device
|
||||
{
|
||||
public BridgeApi(string key) :
|
||||
base(key)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Bridge API using EISC
|
||||
/// </summary>
|
||||
public class EiscApi : BridgeApi
|
||||
{
|
||||
public EiscApiPropertiesConfig PropertiesConfig { get; private set; }
|
||||
|
||||
public ThreeSeriesTcpIpEthernetIntersystemCommunications Eisc { get; private set; }
|
||||
|
||||
public EiscApi(DeviceConfig dc) :
|
||||
base(dc.Key)
|
||||
{
|
||||
PropertiesConfig = JsonConvert.DeserializeObject<EiscApiPropertiesConfig>(dc.Properties.ToString());
|
||||
|
||||
Eisc = new ThreeSeriesTcpIpEthernetIntersystemCommunications(PropertiesConfig.Control.IpIdInt, PropertiesConfig.Control.TcpSshProperties.Address, Global.ControlSystem);
|
||||
|
||||
Eisc.SigChange += new Crestron.SimplSharpPro.DeviceSupport.SigEventHandler(Eisc_SigChange);
|
||||
|
||||
Eisc.Register();
|
||||
|
||||
AddPostActivationAction( () =>
|
||||
{
|
||||
Debug.Console(1, this, "Linking Devices...");
|
||||
|
||||
foreach (var d in PropertiesConfig.Devices)
|
||||
{
|
||||
var device = DeviceManager.GetDeviceForKey(d.DeviceKey);
|
||||
|
||||
if (device != null)
|
||||
{
|
||||
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;
|
||||
}
|
||||
else if (device is GenericComm)
|
||||
{
|
||||
(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.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);
|
||||
continue;
|
||||
}
|
||||
else if (device is DmRmcControllerBase)
|
||||
{
|
||||
(device as DmRmcControllerBase).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
||||
continue;
|
||||
}
|
||||
else if (device is GenericRelayDevice)
|
||||
{
|
||||
(device as GenericRelayDevice).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
||||
continue;
|
||||
}
|
||||
else if (device is IDigitalInput)
|
||||
{
|
||||
(device as IDigitalInput).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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Debug.Console(1, this, "Devices Linked.");
|
||||
});
|
||||
}
|
||||
|
||||
/// <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>
|
||||
/// <param name="currentDevice"></param>
|
||||
/// <param name="args"></param>
|
||||
void Eisc_SigChange(object currentDevice, Crestron.SimplSharpPro.SigEventArgs args)
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class EiscApiPropertiesConfig
|
||||
{
|
||||
[JsonProperty("control")]
|
||||
public EssentialsControlPropertiesConfig Control { get; set; }
|
||||
|
||||
[JsonProperty("devices")]
|
||||
public List<ApiDevice> Devices { get; set; }
|
||||
|
||||
|
||||
public class ApiDevice
|
||||
{
|
||||
[JsonProperty("deviceKey")]
|
||||
public string DeviceKey { get; set; }
|
||||
|
||||
[JsonProperty("joinStart")]
|
||||
public uint JoinStart { get; set; }
|
||||
|
||||
[JsonProperty("joinMapKey")]
|
||||
public string JoinMapKey { get; set; }
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -6,6 +6,7 @@ using Crestron.SimplSharp;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.Bridges;
|
||||
using PepperDash.Essentials.Core.Config;
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core.Routing;
|
||||
@@ -15,32 +16,21 @@ using Crestron.SimplSharpPro.EthernetCommunication;
|
||||
|
||||
namespace PepperDash.Essentials
|
||||
{
|
||||
/// <summary>
|
||||
/// Responsible for loading all of the device types for this library
|
||||
/// </summary>
|
||||
public class BridgeFactory
|
||||
{
|
||||
public static IKeyed GetDevice(DeviceConfig dc)
|
||||
public BridgeFactory()
|
||||
{
|
||||
// ? why is this static JTA 2018-06-13?
|
||||
var eiscApiAdvancedFactory = new EiscApiAdvancedFactory() as IDeviceFactory;
|
||||
eiscApiAdvancedFactory.LoadTypeFactories();
|
||||
|
||||
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();
|
||||
|
||||
//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;
|
||||
var eiscApiFactory = new EiscApiFactory() as IDeviceFactory;
|
||||
eiscApiFactory.LoadTypeFactories();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public class CommBridge : Device
|
||||
{
|
||||
|
||||
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.Core.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.GetSerializedJoinMapForDevice(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;
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -11,33 +11,35 @@ using PepperDash.Essentials.Devices.Common.Cameras;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
namespace PepperDash.Essentials.Core.Bridges
|
||||
{
|
||||
public static class CameraControllerApiExtensions
|
||||
{
|
||||
|
||||
public static void LinkToApi(this PepperDash.Essentials.Devices.Common.Cameras.CameraBase cameraDevice, BasicTriList trilist, uint joinStart, string joinMapKey)
|
||||
public static void LinkToApi(this PepperDash.Essentials.Devices.Common.Cameras.CameraBase cameraDevice, BasicTriList trilist, uint joinStart, string joinMapKey, EiscApi bridge)
|
||||
{
|
||||
CameraControllerJoinMap joinMap = new CameraControllerJoinMap();
|
||||
CameraControllerJoinMap joinMap = new CameraControllerJoinMap(joinStart);
|
||||
|
||||
// Adds the join map to the bridge
|
||||
bridge.AddJoinMap(cameraDevice.Key, joinMap);
|
||||
|
||||
var joinMapSerialized = JoinMapHelper.GetJoinMapForDevice(joinMapKey);
|
||||
var customJoins = JoinMapHelper.TryGetJoinMapAdvancedForDevice(joinMapKey);
|
||||
|
||||
if (!string.IsNullOrEmpty(joinMapSerialized))
|
||||
joinMap = JsonConvert.DeserializeObject<CameraControllerJoinMap>(joinMapSerialized);
|
||||
|
||||
joinMap.OffsetJoinNumbers(joinStart);
|
||||
if (customJoins != null)
|
||||
{
|
||||
joinMap.SetCustomJoinData(customJoins);
|
||||
}
|
||||
|
||||
Debug.Console(1, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
||||
Debug.Console(0, "Linking to Bridge Type {0}", cameraDevice.GetType().Name.ToString());
|
||||
|
||||
var commMonitor = cameraDevice as ICommunicationMonitor;
|
||||
commMonitor.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
|
||||
commMonitor.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline.JoinNumber]);
|
||||
|
||||
var ptzCamera = cameraDevice as IHasCameraPtzControl;
|
||||
|
||||
if (ptzCamera != null)
|
||||
{
|
||||
trilist.SetBoolSigAction(joinMap.Left, (b) =>
|
||||
trilist.SetBoolSigAction(joinMap.PanLeft.JoinNumber, (b) =>
|
||||
{
|
||||
if (b)
|
||||
{
|
||||
@@ -48,7 +50,7 @@ namespace PepperDash.Essentials.Bridges
|
||||
ptzCamera.PanStop();
|
||||
}
|
||||
});
|
||||
trilist.SetBoolSigAction(joinMap.Right, (b) =>
|
||||
trilist.SetBoolSigAction(joinMap.PanRight.JoinNumber, (b) =>
|
||||
{
|
||||
if (b)
|
||||
{
|
||||
@@ -60,7 +62,7 @@ namespace PepperDash.Essentials.Bridges
|
||||
}
|
||||
});
|
||||
|
||||
trilist.SetBoolSigAction(joinMap.Up, (b) =>
|
||||
trilist.SetBoolSigAction(joinMap.TiltUp.JoinNumber, (b) =>
|
||||
{
|
||||
if (b)
|
||||
{
|
||||
@@ -71,7 +73,7 @@ namespace PepperDash.Essentials.Bridges
|
||||
ptzCamera.TiltStop();
|
||||
}
|
||||
});
|
||||
trilist.SetBoolSigAction(joinMap.Down, (b) =>
|
||||
trilist.SetBoolSigAction(joinMap.TiltDown.JoinNumber, (b) =>
|
||||
{
|
||||
if (b)
|
||||
{
|
||||
@@ -83,7 +85,7 @@ namespace PepperDash.Essentials.Bridges
|
||||
}
|
||||
});
|
||||
|
||||
trilist.SetBoolSigAction(joinMap.ZoomIn, (b) =>
|
||||
trilist.SetBoolSigAction(joinMap.ZoomIn.JoinNumber, (b) =>
|
||||
{
|
||||
if (b)
|
||||
{
|
||||
@@ -95,7 +97,7 @@ namespace PepperDash.Essentials.Bridges
|
||||
}
|
||||
});
|
||||
|
||||
trilist.SetBoolSigAction(joinMap.ZoomOut, (b) =>
|
||||
trilist.SetBoolSigAction(joinMap.ZoomOut.JoinNumber, (b) =>
|
||||
{
|
||||
if (b)
|
||||
{
|
||||
@@ -108,27 +110,57 @@ namespace PepperDash.Essentials.Bridges
|
||||
});
|
||||
}
|
||||
|
||||
if (cameraDevice.GetType().Name.ToString().ToLower() == "cameravisca")
|
||||
if (cameraDevice is IPower)
|
||||
{
|
||||
var viscaCamera = cameraDevice as PepperDash.Essentials.Devices.Common.Cameras.CameraVisca;
|
||||
trilist.SetSigTrueAction(joinMap.PowerOn, () => viscaCamera.PowerOn());
|
||||
trilist.SetSigTrueAction(joinMap.PowerOff, () => viscaCamera.PowerOff());
|
||||
var powerCamera = cameraDevice as IPower;
|
||||
trilist.SetSigTrueAction(joinMap.PowerOn.JoinNumber, () => powerCamera.PowerOn());
|
||||
trilist.SetSigTrueAction(joinMap.PowerOff.JoinNumber, () => powerCamera.PowerOff());
|
||||
|
||||
powerCamera.PowerIsOnFeedback.LinkInputSig(trilist.BooleanInput[joinMap.PowerOn.JoinNumber]);
|
||||
powerCamera.PowerIsOnFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.PowerOff.JoinNumber]);
|
||||
}
|
||||
|
||||
viscaCamera.PowerIsOnFeedback.LinkInputSig(trilist.BooleanInput[joinMap.PowerOn]);
|
||||
viscaCamera.PowerIsOnFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.PowerOff]);
|
||||
if (cameraDevice is ICommunicationMonitor)
|
||||
{
|
||||
var monitoredCamera = cameraDevice as ICommunicationMonitor;
|
||||
monitoredCamera.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline.JoinNumber]);
|
||||
}
|
||||
|
||||
viscaCamera.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
|
||||
for (int i = 0; i < joinMap.NumberOfPresets; i++)
|
||||
if (cameraDevice is IHasCameraPresets)
|
||||
{
|
||||
// Set the preset lables when they change
|
||||
var presetsCamera = cameraDevice as IHasCameraPresets;
|
||||
presetsCamera.PresetsListHasChanged += new EventHandler<EventArgs>((o, a) =>
|
||||
{
|
||||
for (int i = 1; i <= joinMap.NumberOfPresets.JoinNumber; i++)
|
||||
{
|
||||
int tempNum = i - 1;
|
||||
|
||||
string label = "" ;
|
||||
|
||||
var preset = presetsCamera.Presets.FirstOrDefault(p => p.ID.Equals(i));
|
||||
|
||||
if (preset != null)
|
||||
label = preset.Description;
|
||||
|
||||
trilist.SetString((ushort)(joinMap.PresetLabelStart.JoinNumber + tempNum), label);
|
||||
}
|
||||
});
|
||||
|
||||
for (int i = 0; i < joinMap.NumberOfPresets.JoinNumber; i++)
|
||||
{
|
||||
int tempNum = i;
|
||||
trilist.SetSigTrueAction((ushort)(joinMap.PresetRecallOffset + tempNum), () =>
|
||||
|
||||
trilist.SetSigTrueAction((ushort)(joinMap.PresetRecallStart.JoinNumber + tempNum), () =>
|
||||
{
|
||||
viscaCamera.RecallPreset(tempNum);
|
||||
presetsCamera.PresetSelect(tempNum);
|
||||
});
|
||||
trilist.SetSigTrueAction((ushort)(joinMap.PresetSaveStart.JoinNumber + tempNum), () =>
|
||||
{
|
||||
var label = trilist.GetString((ushort)(joinMap.PresetLabelStart.JoinNumber + tempNum));
|
||||
|
||||
presetsCamera.PresetStore(tempNum, label);
|
||||
});
|
||||
trilist.SetSigTrueAction((ushort)(joinMap.PresetSaveOffset + tempNum), () =>
|
||||
{
|
||||
viscaCamera.SavePreset(tempNum);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
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 DigitalLoggerApiExtensions
|
||||
{
|
||||
public static void LinkToApi(this DigitalLogger DigitalLogger, BasicTriList trilist, uint joinStart, string joinMapKey)
|
||||
{
|
||||
DigitalLoggerJoinMap joinMap = new DigitalLoggerJoinMap();
|
||||
|
||||
var joinMapSerialized = JoinMapHelper.GetJoinMapForDevice(joinMapKey);
|
||||
|
||||
if (!string.IsNullOrEmpty(joinMapSerialized))
|
||||
joinMap = JsonConvert.DeserializeObject<DigitalLoggerJoinMap>(joinMapSerialized);
|
||||
|
||||
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));
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,153 +0,0 @@
|
||||
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 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();
|
||||
});
|
||||
|
||||
|
||||
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); });
|
||||
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++;
|
||||
}
|
||||
|
||||
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();
|
||||
|
||||
}
|
||||
if (twoWayDisplay != null)
|
||||
inputNumberFeedback.FireUpdate();
|
||||
});
|
||||
|
||||
|
||||
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());
|
||||
|
||||
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)
|
||||
{
|
||||
|
||||
Debug.Console(0, "CurrentInputFeedback_OutputChange {0}", e.StringValue);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,222 +0,0 @@
|
||||
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,284 +1,288 @@
|
||||
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)));
|
||||
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;
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
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.Core.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.GetSerializedJoinMapForDevice(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)));
|
||||
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]);
|
||||
|
||||
dmChassis.OutputDisabledByHdcpFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.OutputDisabledByHdcp + 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;
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -11,7 +11,7 @@ using PepperDash.Essentials.DM;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
namespace PepperDash.Essentials.Core.Bridges
|
||||
{
|
||||
public static class DmRmcControllerApiExtensions
|
||||
{
|
||||
@@ -19,7 +19,7 @@ namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
DmRmcControllerJoinMap joinMap = new DmRmcControllerJoinMap();
|
||||
|
||||
var joinMapSerialized = JoinMapHelper.GetJoinMapForDevice(joinMapKey);
|
||||
var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
|
||||
|
||||
if (!string.IsNullOrEmpty(joinMapSerialized))
|
||||
joinMap = JsonConvert.DeserializeObject<DmRmcControllerJoinMap>(joinMapSerialized);
|
||||
|
||||
@@ -14,7 +14,7 @@ using PepperDash.Essentials.DM;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
namespace PepperDash.Essentials.Core.Bridges
|
||||
{
|
||||
public static class DmTxControllerApiExtensions
|
||||
{
|
||||
@@ -22,7 +22,7 @@ namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
DmTxControllerJoinMap joinMap = new DmTxControllerJoinMap();
|
||||
|
||||
var joinMapSerialized = JoinMapHelper.GetJoinMapForDevice(joinMapKey);
|
||||
var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
|
||||
|
||||
if (!string.IsNullOrEmpty(joinMapSerialized))
|
||||
joinMap = JsonConvert.DeserializeObject<DmTxControllerJoinMap>(joinMapSerialized);
|
||||
@@ -57,7 +57,7 @@ namespace PepperDash.Essentials.Bridges
|
||||
|
||||
trilist.UShortInput[joinMap.HdcpSupportCapability].UShortValue = (ushort)tx.HdcpSupportCapability;
|
||||
|
||||
if(txR.InputPorts[DmPortName.HdmiIn] != null)
|
||||
if (txR.InputPorts[DmPortName.HdmiIn] != null)
|
||||
{
|
||||
var inputPort = txR.InputPorts[DmPortName.HdmiIn];
|
||||
|
||||
@@ -71,7 +71,7 @@ namespace PepperDash.Essentials.Bridges
|
||||
SetHdcpCapabilityAction(hdcpTypeSimple, port, joinMap.Port1HdcpState, trilist);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (txR.InputPorts[DmPortName.HdmiIn1] != null)
|
||||
{
|
||||
var inputPort = txR.InputPorts[DmPortName.HdmiIn1];
|
||||
@@ -103,6 +103,22 @@ namespace PepperDash.Essentials.Bridges
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
var txFreeRun = tx as IHasFreeRun;
|
||||
if (txFreeRun != null)
|
||||
{
|
||||
txFreeRun.FreeRunEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.FreeRunEnabled]);
|
||||
trilist.SetBoolSigAction(joinMap.FreeRunEnabled, new Action<bool>(b => txFreeRun.SetFreeRunEnabled(b)));
|
||||
}
|
||||
|
||||
var txVga = tx as IVgaBrightnessContrastControls;
|
||||
{
|
||||
txVga.VgaBrightnessFeedback.LinkInputSig(trilist.UShortInput[joinMap.VgaBrightness]);
|
||||
txVga.VgaContrastFeedback.LinkInputSig(trilist.UShortInput[joinMap.VgaContrast]);
|
||||
|
||||
trilist.SetUShortSigAction(joinMap.VgaBrightness, new Action<ushort>(u => txVga.SetVgaBrightness(u)));
|
||||
trilist.SetUShortSigAction(joinMap.VgaContrast, new Action<ushort>(u => txVga.SetVgaContrast(u)));
|
||||
}
|
||||
}
|
||||
|
||||
static void SetHdcpCapabilityAction(bool hdcpTypeSimple, EndpointHdmiInput port, uint join, BasicTriList trilist)
|
||||
|
||||
@@ -12,7 +12,7 @@ using PepperDash.Essentials.DM;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
namespace PepperDash.Essentials.Core.Bridges
|
||||
{
|
||||
public static class DmpsAudioOutputControllerApiExtensions
|
||||
{
|
||||
@@ -20,7 +20,7 @@ namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
DmpsAudioOutputControllerJoinMap joinMap = new DmpsAudioOutputControllerJoinMap();
|
||||
|
||||
var joinMapSerialized = JoinMapHelper.GetJoinMapForDevice(joinMapKey);
|
||||
var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
|
||||
|
||||
if (!string.IsNullOrEmpty(joinMapSerialized))
|
||||
joinMap = JsonConvert.DeserializeObject<DmpsAudioOutputControllerJoinMap>(joinMapSerialized);
|
||||
|
||||
@@ -12,7 +12,7 @@ using PepperDash.Essentials.DM;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
namespace PepperDash.Essentials.Core.Bridges
|
||||
{
|
||||
public static class DmpsRoutingControllerApiExtentions
|
||||
{
|
||||
@@ -20,7 +20,7 @@ namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
DmpsRoutingControllerJoinMap joinMap = new DmpsRoutingControllerJoinMap();
|
||||
|
||||
var joinMapSerialized = JoinMapHelper.GetJoinMapForDevice(joinMapKey);
|
||||
var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
|
||||
|
||||
if (!string.IsNullOrEmpty(joinMapSerialized))
|
||||
joinMap = JsonConvert.DeserializeObject<DmpsRoutingControllerJoinMap>(joinMapSerialized);
|
||||
|
||||
232
PepperDashEssentials/Bridges/EiscBridge.cs
Normal file
232
PepperDashEssentials/Bridges/EiscBridge.cs
Normal file
@@ -0,0 +1,232 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Crestron.SimplSharpPro;
|
||||
using Crestron.SimplSharpPro.EthernetCommunication;
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Bridges;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.Bridges;
|
||||
using PepperDash.Essentials.Core.Config;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
[Obsolete("Please use 'eiscapiadvanced' in configurations going forward")]
|
||||
public class EiscApi : BridgeApi
|
||||
{
|
||||
public EiscApiPropertiesConfig PropertiesConfig { get; private set; }
|
||||
|
||||
protected Dictionary<string, JoinMapBaseAdvanced> JoinMaps { get; private set; }
|
||||
|
||||
public ThreeSeriesTcpIpEthernetIntersystemCommunications Eisc { get; private set; }
|
||||
|
||||
public EiscApi(DeviceConfig dc) :
|
||||
base(dc.Key)
|
||||
{
|
||||
JoinMaps = new Dictionary<string, JoinMapBaseAdvanced>();
|
||||
|
||||
PropertiesConfig = dc.Properties.ToObject<EiscApiPropertiesConfig>();
|
||||
//PropertiesConfig = JsonConvert.DeserializeObject<EiscApiPropertiesConfig>(dc.Properties.ToString());
|
||||
|
||||
Eisc = new ThreeSeriesTcpIpEthernetIntersystemCommunications(PropertiesConfig.Control.IpIdInt, PropertiesConfig.Control.TcpSshProperties.Address, Global.ControlSystem);
|
||||
|
||||
Eisc.SigChange += Eisc_SigChange;
|
||||
|
||||
Eisc.Register();
|
||||
|
||||
AddPostActivationAction(() =>
|
||||
{
|
||||
Debug.Console(1, this, "Linking Devices...");
|
||||
|
||||
foreach (var d in PropertiesConfig.Devices)
|
||||
{
|
||||
var device = DeviceManager.GetDeviceForKey(d.DeviceKey);
|
||||
|
||||
if (device == null) continue;
|
||||
|
||||
Debug.Console(1, this, "Linking Device: '{0}'", device.Key);
|
||||
if (device is IBridge) // Check for this first to allow bridges in plugins to override existing bridges that apply to the same type.
|
||||
{
|
||||
Debug.Console(2, this, "'{0}' is IBridge", device.Key);
|
||||
|
||||
var dev = device as IBridge;
|
||||
|
||||
dev.LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
||||
}
|
||||
if (!(device is IBridgeAdvanced)) continue;
|
||||
Debug.Console(2, this, "'{0}' is IBridgeAdvanced", device.Key);
|
||||
|
||||
var advDev = device as IBridgeAdvanced;
|
||||
|
||||
try
|
||||
{
|
||||
advDev.LinkToApi(Eisc, d.JoinStart, d.JoinMapKey, null);
|
||||
}
|
||||
catch (NullReferenceException)
|
||||
{
|
||||
Debug.ConsoleWithLog(0, this,
|
||||
"Please update the bridge config to use EiscBridgeAdvanced with this device: {0}", device.Key);
|
||||
}
|
||||
|
||||
}
|
||||
Debug.Console(1, this, "Devices Linked.");
|
||||
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds a join map
|
||||
/// </summary>
|
||||
/// <param name="deviceKey"></param>
|
||||
/// <param name="joinMap"></param>
|
||||
public void AddJoinMap(string deviceKey, JoinMapBaseAdvanced joinMap)
|
||||
{
|
||||
if (!JoinMaps.ContainsKey(deviceKey))
|
||||
{
|
||||
JoinMaps.Add(deviceKey, joinMap);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Console(2, this, "Unable to add join map with key '{0}'. Key already exists in JoinMaps dictionary", deviceKey);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Prints all the join maps on this bridge
|
||||
/// </summary>
|
||||
public void PrintJoinMaps()
|
||||
{
|
||||
Debug.Console(0, this, "Join Maps for EISC IPID: {0}", Eisc.ID.ToString("X"));
|
||||
|
||||
foreach (var joinMap in JoinMaps)
|
||||
{
|
||||
Debug.Console(0, "Join map for device '{0}':", joinMap.Key);
|
||||
joinMap.Value.PrintJoinMapInfo();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Prints the join map for a device by key
|
||||
/// </summary>
|
||||
/// <param name="deviceKey"></param>
|
||||
public void PrintJoinMapForDevice(string deviceKey)
|
||||
{
|
||||
var joinMap = JoinMaps[deviceKey];
|
||||
|
||||
if (joinMap == null)
|
||||
{
|
||||
Debug.Console(0, this, "Unable to find joinMap for device with key: '{0}'", deviceKey);
|
||||
return;
|
||||
}
|
||||
|
||||
Debug.Console(0, "Join map for device '{0}' on EISC '{1}':", deviceKey, Key);
|
||||
joinMap.PrintJoinMapInfo();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Used for debugging to trigger an action based on a join number and type
|
||||
/// </summary>
|
||||
/// <param name="join"></param>
|
||||
/// <param name="type"></param>
|
||||
/// <param name="state"></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>
|
||||
/// <param name="currentDevice"></param>
|
||||
/// <param name="args"></param>
|
||||
void Eisc_SigChange(object currentDevice, SigEventArgs args)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (Debug.Level >= 1)
|
||||
Debug.Console(1, this, "EiscApiAdvanced change: {0} {1}={2}", args.Sig.Type, args.Sig.Number, args.Sig.StringValue);
|
||||
var uo = args.Sig.UserObject;
|
||||
|
||||
if (uo == null) return;
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class EiscApiFactory : EssentialsDeviceFactory<EiscApiAdvanced>
|
||||
{
|
||||
public EiscApiFactory()
|
||||
{
|
||||
TypeNames = new List<string>() { "eiscapi" };
|
||||
}
|
||||
|
||||
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||
{
|
||||
Debug.Console(1, "Factory Attempting to create new EiscApi Device");
|
||||
|
||||
return new EiscApi(dc);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -10,7 +10,7 @@ using PepperDash.Essentials.Devices.Common;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
namespace PepperDash.Essentials.Core.Bridges
|
||||
{
|
||||
public static class GenericLightingApiExtensions
|
||||
{
|
||||
@@ -18,7 +18,7 @@ namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
GenericLightingJoinMap joinMap = new GenericLightingJoinMap();
|
||||
|
||||
var joinMapSerialized = JoinMapHelper.GetJoinMapForDevice(joinMapKey);
|
||||
var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
|
||||
|
||||
if (!string.IsNullOrEmpty(joinMapSerialized))
|
||||
joinMap = JsonConvert.DeserializeObject<GenericLightingJoinMap>(joinMapSerialized);
|
||||
|
||||
@@ -11,7 +11,7 @@ using PepperDash.Essentials.Core.CrestronIO;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
namespace PepperDash.Essentials.Core.Bridges
|
||||
{
|
||||
public static class GenericRelayDeviceApiExtensions
|
||||
{
|
||||
@@ -19,7 +19,7 @@ namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
GenericRelayControllerJoinMap joinMap = new GenericRelayControllerJoinMap();
|
||||
|
||||
var joinMapSerialized = JoinMapHelper.GetJoinMapForDevice(joinMapKey);
|
||||
var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
|
||||
|
||||
if (!string.IsNullOrEmpty(joinMapSerialized))
|
||||
joinMap = JsonConvert.DeserializeObject<GenericRelayControllerJoinMap>(joinMapSerialized);
|
||||
|
||||
@@ -1,110 +1,125 @@
|
||||
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]);
|
||||
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
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.Core.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.GetSerializedJoinMapForDevice(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]);
|
||||
trilist.StringInput[joinMap.Name].StringValue = occController.Name;
|
||||
|
||||
trilist.OnlineStatusChange += new Crestron.SimplSharpPro.OnlineStatusChangeEventHandler((d, args) =>
|
||||
{
|
||||
if (args.DeviceOnLine)
|
||||
{
|
||||
trilist.StringInput[joinMap.Name].StringValue = occController.Name;
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
// 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]);
|
||||
trilist.SetBoolSigAction(joinMap.EnableRawStates, new Action<bool>((b) => occController.EnableRawStates(b)));
|
||||
|
||||
// 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
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -14,7 +14,7 @@ using PepperDash.Essentials.DM;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
namespace PepperDash.Essentials.Core.Bridges
|
||||
{
|
||||
public static class HdMdxxxCEControllerApiExtensions
|
||||
{
|
||||
@@ -22,7 +22,7 @@ namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
HdMdxxxCEControllerJoinMap joinMap = new HdMdxxxCEControllerJoinMap();
|
||||
|
||||
var joinMapSerialized = JoinMapHelper.GetJoinMapForDevice(joinMapKey);
|
||||
var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
|
||||
|
||||
if (!string.IsNullOrEmpty(joinMapSerialized))
|
||||
joinMap = JsonConvert.DeserializeObject<HdMdxxxCEControllerJoinMap>(joinMapSerialized);
|
||||
|
||||
@@ -10,7 +10,7 @@ using PepperDash.Essentials.Core;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
namespace PepperDash.Essentials.Core.Bridges
|
||||
{
|
||||
public static class IBasicCommunicationApiExtensions
|
||||
{
|
||||
@@ -18,7 +18,7 @@ namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
IBasicCommunicationJoinMap joinMap = new IBasicCommunicationJoinMap();
|
||||
|
||||
var joinMapSerialized = JoinMapHelper.GetJoinMapForDevice(joinMapKey);
|
||||
var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
|
||||
|
||||
if (!string.IsNullOrEmpty(joinMapSerialized))
|
||||
joinMap = JsonConvert.DeserializeObject<IBasicCommunicationJoinMap>(joinMapSerialized);
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines a device that uses the legacy JoinMapBase for its join map
|
||||
/// </summary>
|
||||
[Obsolete("IBridgeAdvanced should be used going forward with JoinMapBaseAdvanced")]
|
||||
public interface IBridge
|
||||
{
|
||||
void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey);
|
||||
|
||||
@@ -11,7 +11,7 @@ using PepperDash.Essentials.Core.CrestronIO;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
namespace PepperDash.Essentials.Core.Bridges
|
||||
{
|
||||
public static class IDigitalInputApiExtenstions
|
||||
{
|
||||
@@ -19,7 +19,7 @@ namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
IDigitalInputJoinMap joinMap = new IDigitalInputJoinMap();
|
||||
|
||||
var joinMapSerialized = JoinMapHelper.GetJoinMapForDevice(joinMapKey);
|
||||
var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
|
||||
|
||||
if (!string.IsNullOrEmpty(joinMapSerialized))
|
||||
joinMap = JsonConvert.DeserializeObject<IDigitalInputJoinMap>(joinMapSerialized);
|
||||
|
||||
128
PepperDashEssentials/Bridges/IRSetTopBoxBaseBridge.cs
Normal file
128
PepperDashEssentials/Bridges/IRSetTopBoxBaseBridge.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 PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Devices.Common;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace PepperDash.Essentials.Core.Bridges
|
||||
{
|
||||
public static class IRSetTopBoxBaseApiExtensions
|
||||
{
|
||||
public static void LinkToApi(this PepperDash.Essentials.Devices.Common.IRSetTopBoxBase stbDevice, BasicTriList trilist, uint joinStart, string joinMapKey)
|
||||
{
|
||||
SetTopBoxControllerJoinMap joinMap = new SetTopBoxControllerJoinMap();
|
||||
var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
|
||||
|
||||
if (!string.IsNullOrEmpty(joinMapSerialized))
|
||||
joinMap = JsonConvert.DeserializeObject<SetTopBoxControllerJoinMap>(joinMapSerialized);
|
||||
|
||||
joinMap.OffsetJoinNumbers(joinStart);
|
||||
|
||||
Debug.Console(1, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
||||
Debug.Console(0, "Linking to Display: {0}", stbDevice.Name);
|
||||
|
||||
trilist.StringInput[joinMap.Name].StringValue = stbDevice.Name;
|
||||
|
||||
var stbBase = stbDevice as ISetTopBoxControls;
|
||||
if (stbBase != null)
|
||||
{
|
||||
trilist.BooleanInput[joinMap.HasDpad].BoolValue = stbBase.HasDpad;
|
||||
trilist.BooleanInput[joinMap.HasNumeric].BoolValue = stbBase.HasNumeric;
|
||||
trilist.BooleanInput[joinMap.HasDvr].BoolValue = stbBase.HasDvr;
|
||||
trilist.BooleanInput[joinMap.HasPresets].BoolValue = stbBase.HasPresets;
|
||||
|
||||
trilist.SetBoolSigAction(joinMap.DvrList, (b) => stbBase.DvrList(b));
|
||||
trilist.SetBoolSigAction(joinMap.Replay, (b) => stbBase.Replay(b));
|
||||
|
||||
trilist.SetStringSigAction(joinMap.LoadPresets, (s) => stbBase.LoadPresets(s));
|
||||
}
|
||||
|
||||
var stbPower = stbDevice as IPower;
|
||||
if (stbPower != null)
|
||||
{
|
||||
trilist.SetSigTrueAction(joinMap.PowerOn, () => stbPower.PowerOn());
|
||||
trilist.SetSigTrueAction(joinMap.PowerOff, () => stbPower.PowerOff());
|
||||
trilist.SetSigTrueAction(joinMap.PowerToggle, () => stbPower.PowerToggle());
|
||||
|
||||
}
|
||||
|
||||
var stbDPad = stbDevice as IDPad;
|
||||
if (stbDPad != null)
|
||||
{
|
||||
trilist.SetBoolSigAction(joinMap.Up, (b) => stbDPad.Up(b));
|
||||
trilist.SetBoolSigAction(joinMap.Down, (b) => stbDPad.Down(b));
|
||||
trilist.SetBoolSigAction(joinMap.Left, (b) => stbDPad.Left(b));
|
||||
trilist.SetBoolSigAction(joinMap.Right, (b) => stbDPad.Right(b));
|
||||
trilist.SetBoolSigAction(joinMap.Select, (b) => stbDPad.Select(b));
|
||||
trilist.SetBoolSigAction(joinMap.Menu, (b) => stbDPad.Menu(b));
|
||||
trilist.SetBoolSigAction(joinMap.Exit, (b) => stbDPad.Exit(b));
|
||||
}
|
||||
|
||||
var stbChannel = stbDevice as IChannel;
|
||||
if (stbChannel != null)
|
||||
{
|
||||
trilist.SetBoolSigAction(joinMap.ChannelUp, (b) => stbChannel.ChannelUp(b));
|
||||
trilist.SetBoolSigAction(joinMap.ChannelDown, (b) => stbChannel.ChannelDown(b));
|
||||
trilist.SetBoolSigAction(joinMap.LastChannel, (b) => stbChannel.LastChannel(b));
|
||||
trilist.SetBoolSigAction(joinMap.Guide, (b) => stbChannel.Guide(b));
|
||||
trilist.SetBoolSigAction(joinMap.Info, (b) => stbChannel.Info(b));
|
||||
trilist.SetBoolSigAction(joinMap.Exit, (b) => stbChannel.Exit(b));
|
||||
}
|
||||
|
||||
var stbColor = stbDevice as IColor;
|
||||
if (stbColor != null)
|
||||
{
|
||||
trilist.SetBoolSigAction(joinMap.Red, (b) => stbColor.Red(b));
|
||||
trilist.SetBoolSigAction(joinMap.Green, (b) => stbColor.Green(b));
|
||||
trilist.SetBoolSigAction(joinMap.Yellow, (b) => stbColor.Yellow(b));
|
||||
trilist.SetBoolSigAction(joinMap.Blue, (b) => stbColor.Blue(b));
|
||||
}
|
||||
|
||||
var stbKeypad = stbDevice as ISetTopBoxNumericKeypad;
|
||||
if (stbKeypad != null)
|
||||
{
|
||||
trilist.StringInput[joinMap.KeypadAccessoryButton1Label].StringValue = stbKeypad.KeypadAccessoryButton1Label;
|
||||
trilist.StringInput[joinMap.KeypadAccessoryButton2Label].StringValue = stbKeypad.KeypadAccessoryButton2Label;
|
||||
|
||||
trilist.BooleanInput[joinMap.HasKeypadAccessoryButton1].BoolValue = stbKeypad.HasKeypadAccessoryButton1;
|
||||
trilist.BooleanInput[joinMap.HasKeypadAccessoryButton2].BoolValue = stbKeypad.HasKeypadAccessoryButton2;
|
||||
|
||||
trilist.SetBoolSigAction(joinMap.Digit0, (b) => stbKeypad.Digit0(b));
|
||||
trilist.SetBoolSigAction(joinMap.Digit1, (b) => stbKeypad.Digit1(b));
|
||||
trilist.SetBoolSigAction(joinMap.Digit2, (b) => stbKeypad.Digit2(b));
|
||||
trilist.SetBoolSigAction(joinMap.Digit3, (b) => stbKeypad.Digit3(b));
|
||||
trilist.SetBoolSigAction(joinMap.Digit4, (b) => stbKeypad.Digit4(b));
|
||||
trilist.SetBoolSigAction(joinMap.Digit5, (b) => stbKeypad.Digit5(b));
|
||||
trilist.SetBoolSigAction(joinMap.Digit6, (b) => stbKeypad.Digit6(b));
|
||||
trilist.SetBoolSigAction(joinMap.Digit7, (b) => stbKeypad.Digit7(b));
|
||||
trilist.SetBoolSigAction(joinMap.Digit8, (b) => stbKeypad.Digit8(b));
|
||||
trilist.SetBoolSigAction(joinMap.Digit9, (b) => stbKeypad.Digit9(b));
|
||||
trilist.SetBoolSigAction(joinMap.KeypadAccessoryButton1Press, (b) => stbKeypad.KeypadAccessoryButton1(b));
|
||||
trilist.SetBoolSigAction(joinMap.KeypadAccessoryButton2Press, (b) => stbKeypad.KeypadAccessoryButton1(b));
|
||||
trilist.SetBoolSigAction(joinMap.Dash, (b) => stbKeypad.Dash(b));
|
||||
trilist.SetBoolSigAction(joinMap.KeypadEnter, (b) => stbKeypad.KeypadEnter(b));
|
||||
}
|
||||
|
||||
var stbTransport = stbDevice as ITransport;
|
||||
if (stbTransport != null)
|
||||
{
|
||||
trilist.SetBoolSigAction(joinMap.Play, (b) => stbTransport.Play(b));
|
||||
trilist.SetBoolSigAction(joinMap.Pause, (b) => stbTransport.Pause(b));
|
||||
trilist.SetBoolSigAction(joinMap.Rewind, (b) => stbTransport.Rewind(b));
|
||||
trilist.SetBoolSigAction(joinMap.FFwd, (b) => stbTransport.FFwd(b));
|
||||
trilist.SetBoolSigAction(joinMap.ChapMinus, (b) => stbTransport.ChapMinus(b));
|
||||
trilist.SetBoolSigAction(joinMap.ChapPlus, (b) => stbTransport.ChapPlus(b));
|
||||
trilist.SetBoolSigAction(joinMap.Stop, (b) => stbTransport.Stop(b));
|
||||
trilist.SetBoolSigAction(joinMap.Record, (b) => stbTransport.Record(b));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,7 @@ using PepperDash.Essentials.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
[Obsolete("Please use version PepperDash.Essentials.Core.Bridges")]
|
||||
public class AirMediaControllerJoinMap : JoinMapBase
|
||||
{
|
||||
#region Digitals
|
||||
|
||||
@@ -7,6 +7,7 @@ using PepperDash.Essentials.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
[Obsolete("Please use version PepperDash.Essentials.Core.Bridges")]
|
||||
public class AppleTvJoinMap : JoinMapBase
|
||||
{
|
||||
#region Digitals
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using Crestron.SimplSharp.Reflection;
|
||||
using PepperDash.Essentials.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
[Obsolete("Please use version PepperDash.Essentials.Core.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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,54 +8,59 @@ using PepperDash.Essentials.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
public class CameraControllerJoinMap : JoinMapBase
|
||||
/// <summary>
|
||||
/// Join map for CameraBase devices
|
||||
/// </summary>
|
||||
///
|
||||
[Obsolete("Please use version PepperDash.Essentials.Core.Bridges")]
|
||||
public class CameraControllerJoinMap : JoinMapBaseAdvanced
|
||||
{
|
||||
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; }
|
||||
[JoinName("TiltUp")]
|
||||
public JoinDataComplete TiltUp = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 }, new JoinMetadata() { Label = "Tilt Up", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
|
||||
[JoinName("TiltDown")]
|
||||
public JoinDataComplete TiltDown = new JoinDataComplete(new JoinData() { JoinNumber = 2, JoinSpan = 1 }, new JoinMetadata() { Label = "Tilt Down", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
|
||||
[JoinName("PanLeft")]
|
||||
public JoinDataComplete PanLeft = new JoinDataComplete(new JoinData() { JoinNumber = 3, JoinSpan = 1 }, new JoinMetadata() { Label = "Pan Left", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
|
||||
[JoinName("PanRight")]
|
||||
public JoinDataComplete PanRight = new JoinDataComplete(new JoinData() { JoinNumber = 4, JoinSpan = 1 }, new JoinMetadata() { Label = "Pan Right", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
|
||||
[JoinName("ZoomIn")]
|
||||
public JoinDataComplete ZoomIn = new JoinDataComplete(new JoinData() { JoinNumber = 5, JoinSpan = 1 }, new JoinMetadata() { Label = "Zoom In", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
|
||||
[JoinName("ZoomOut")]
|
||||
public JoinDataComplete ZoomOut = new JoinDataComplete(new JoinData() { JoinNumber = 6, JoinSpan = 1 }, new JoinMetadata() { Label = "Zoom Out", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
|
||||
|
||||
public CameraControllerJoinMap()
|
||||
[JoinName("IsOnline")]
|
||||
public JoinDataComplete IsOnline = new JoinDataComplete(new JoinData() { JoinNumber = 9, JoinSpan = 1 }, new JoinMetadata() { Label = "Is Online", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||
[JoinName("PowerOn")]
|
||||
public JoinDataComplete PowerOn = new JoinDataComplete(new JoinData() { JoinNumber = 7, JoinSpan = 1 }, new JoinMetadata() { Label = "Power On", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
|
||||
[JoinName("PowerOff")]
|
||||
public JoinDataComplete PowerOff = new JoinDataComplete(new JoinData() { JoinNumber = 8, JoinSpan = 1 }, new JoinMetadata() { Label = "Power Off", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
|
||||
|
||||
[JoinName("NumberOfPresets")]
|
||||
public JoinDataComplete NumberOfPresets = new JoinDataComplete(new JoinData() { JoinNumber = 11, JoinSpan = 1 }, new JoinMetadata() { Label = "Tells Essentials the number of defined presets", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Analog });
|
||||
[JoinName("PresetRecallStart")]
|
||||
public JoinDataComplete PresetRecallStart = new JoinDataComplete(new JoinData() { JoinNumber = 11, JoinSpan = 20 }, new JoinMetadata() { Label = "Preset Recall Start", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
|
||||
[JoinName("PresetLabelStart")]
|
||||
public JoinDataComplete PresetLabelStart = new JoinDataComplete(new JoinData() { JoinNumber = 11, JoinSpan = 20 }, new JoinMetadata() { Label = "Preset Label Start", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Serial });
|
||||
[JoinName("PresetSaveStart")]
|
||||
public JoinDataComplete PresetSaveStart = new JoinDataComplete(new JoinData() { JoinNumber = 31, JoinSpan = 20 }, new JoinMetadata() { Label = "Preset Save Start", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
|
||||
|
||||
[JoinName("CameraModeAuto")]
|
||||
public JoinDataComplete CameraModeAuto = new JoinDataComplete(new JoinData() { JoinNumber = 51, JoinSpan = 1 }, new JoinMetadata() { Label = "Camera Mode Auto", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
|
||||
[JoinName("CameraModeManual")]
|
||||
public JoinDataComplete CameraModeManual = new JoinDataComplete(new JoinData() { JoinNumber = 52, JoinSpan = 1 }, new JoinMetadata() { Label = "Camera Mode Manual", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
|
||||
[JoinName("CameraModeOff")]
|
||||
public JoinDataComplete CameraModeOff = new JoinDataComplete(new JoinData() { JoinNumber = 53, JoinSpan = 1 }, new JoinMetadata() { Label = "Camera Mode Off", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
|
||||
|
||||
[JoinName("SupportsCameraModeAuto")]
|
||||
public JoinDataComplete SupportsCameraModeAuto = new JoinDataComplete(new JoinData() { JoinNumber = 55, JoinSpan = 1 }, new JoinMetadata() { Label = "Supports Camera Mode Auto", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
|
||||
[JoinName("SupportsCameraModeOff")]
|
||||
public JoinDataComplete SupportsCameraModeOff = new JoinDataComplete(new JoinData() { JoinNumber = 56, JoinSpan = 1 }, new JoinMetadata() { Label = "Supports Camera Mode Off", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
|
||||
[JoinName("SupportsPresets")]
|
||||
public JoinDataComplete SupportsPresets = new JoinDataComplete(new JoinData() { JoinNumber = 57, JoinSpan = 1 }, new JoinMetadata() { Label = "Supports Presets", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
|
||||
|
||||
public CameraControllerJoinMap(uint joinStart)
|
||||
: base(joinStart, typeof(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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,7 @@ using PepperDash.Essentials.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
[Obsolete("Please use version PepperDash.Essentials.Core.Bridges")]
|
||||
public class DigitalLoggerJoinMap : JoinMapBase
|
||||
{
|
||||
public uint IsOnline { get; set; }
|
||||
|
||||
@@ -7,6 +7,7 @@ using PepperDash.Essentials.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
[Obsolete("Please use version PepperDash.Essentials.Core.Bridges")]
|
||||
public class DisplayControllerJoinMap : JoinMapBase
|
||||
{
|
||||
#region Digitals
|
||||
|
||||
@@ -1,109 +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 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using PepperDash.Essentials.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges {
|
||||
[Obsolete("Please use version PepperDash.Essentials.Core.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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@@ -7,6 +7,7 @@ using PepperDash.Essentials.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
[Obsolete("Please use version PepperDash.Essentials.Core.Bridges")]
|
||||
public class DmChassisControllerJoinMap : JoinMapBase
|
||||
{
|
||||
#region Digital/Analogs
|
||||
@@ -38,6 +39,10 @@ namespace PepperDash.Essentials.Bridges
|
||||
/// 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
|
||||
/// <summary>
|
||||
/// Range reports high if corresponding output is disabled by HDCP.
|
||||
/// </summary>
|
||||
public uint OutputDisabledByHdcp { get; set; } // indicates that there is an attached transmitter that should be bridged to be interacted with
|
||||
#endregion
|
||||
|
||||
#region Analogs
|
||||
@@ -101,6 +106,7 @@ namespace PepperDash.Essentials.Bridges
|
||||
InputEndpointOnline = 500; //501-699
|
||||
OutputEndpointOnline = 700; //701-899
|
||||
TxAdvancedIsPresent = 1000; //1001-1199
|
||||
OutputDisabledByHdcp = 1200; //1201-1399
|
||||
|
||||
//Analog
|
||||
OutputVideo = 100; //101-299
|
||||
@@ -139,6 +145,8 @@ namespace PepperDash.Essentials.Bridges
|
||||
OutputEndpointOnline = OutputEndpointOnline + joinOffset;
|
||||
HdcpSupportState = HdcpSupportState + joinOffset;
|
||||
HdcpSupportCapability = HdcpSupportCapability + joinOffset;
|
||||
OutputDisabledByHdcp = OutputDisabledByHdcp + joinOffset;
|
||||
TxAdvancedIsPresent = TxAdvancedIsPresent + joinOffset;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ using PepperDash.Essentials.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
[Obsolete("Please use version PepperDash.Essentials.Core.Bridges")]
|
||||
public class DmRmcControllerJoinMap : JoinMapBase
|
||||
{
|
||||
#region Digitals
|
||||
@@ -37,8 +38,12 @@ namespace PepperDash.Essentials.Bridges
|
||||
/// Reports the EDID serial number value
|
||||
/// </summary>
|
||||
public uint EdidSerialNumber { get; set; }
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
#region Analogs
|
||||
public uint AudioVideoSource { get; set; }
|
||||
#endregion
|
||||
|
||||
public DmRmcControllerJoinMap()
|
||||
{
|
||||
// Digital
|
||||
@@ -50,6 +55,9 @@ namespace PepperDash.Essentials.Bridges
|
||||
EdidName = 3;
|
||||
EdidPrefferedTiming = 4;
|
||||
EdidSerialNumber = 5;
|
||||
|
||||
//Analog
|
||||
AudioVideoSource = 1;
|
||||
}
|
||||
|
||||
public override void OffsetJoinNumbers(uint joinStart)
|
||||
@@ -61,7 +69,8 @@ namespace PepperDash.Essentials.Bridges
|
||||
EdidManufacturer = EdidManufacturer + joinOffset;
|
||||
EdidName = EdidName + joinOffset;
|
||||
EdidPrefferedTiming = EdidPrefferedTiming + joinOffset;
|
||||
EdidSerialNumber = EdidSerialNumber + joinOffset;
|
||||
EdidSerialNumber = EdidSerialNumber + joinOffset;
|
||||
AudioVideoSource = AudioVideoSource + joinOffset;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,9 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using PepperDash.Essentials.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
[Obsolete("Please use version PepperDash.Essentials.Core.Bridges")]
|
||||
public class DmTxControllerJoinMap : JoinMapBase
|
||||
{
|
||||
#region Digitals
|
||||
@@ -18,6 +15,10 @@ namespace PepperDash.Essentials.Bridges
|
||||
/// High when video sync is detected
|
||||
/// </summary>
|
||||
public uint VideoSyncStatus { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public uint FreeRunEnabled { get; set; }
|
||||
#endregion
|
||||
|
||||
#region Analogs
|
||||
@@ -41,6 +42,16 @@ namespace PepperDash.Essentials.Bridges
|
||||
/// Sets and reports the current HDCP state for the corresponding input port
|
||||
/// </summary>
|
||||
public uint Port2HdcpState { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Sets and reports the current VGA Brightness level
|
||||
/// </summary>
|
||||
public uint VgaBrightness { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Sets and reports the current VGA Contrast level
|
||||
/// </summary>
|
||||
public uint VgaContrast { get; set; }
|
||||
#endregion
|
||||
|
||||
#region Serials
|
||||
@@ -56,6 +67,7 @@ namespace PepperDash.Essentials.Bridges
|
||||
// Digital
|
||||
IsOnline = 1;
|
||||
VideoSyncStatus = 2;
|
||||
FreeRunEnabled = 3;
|
||||
// Serial
|
||||
CurrentInputResolution = 1;
|
||||
// Analog
|
||||
@@ -64,6 +76,8 @@ namespace PepperDash.Essentials.Bridges
|
||||
HdcpSupportCapability = 3;
|
||||
Port1HdcpState = 4;
|
||||
Port2HdcpState = 5;
|
||||
VgaBrightness = 6;
|
||||
VgaContrast = 7;
|
||||
}
|
||||
|
||||
public override void OffsetJoinNumbers(uint joinStart)
|
||||
@@ -72,12 +86,15 @@ namespace PepperDash.Essentials.Bridges
|
||||
|
||||
IsOnline = IsOnline + joinOffset;
|
||||
VideoSyncStatus = VideoSyncStatus + joinOffset;
|
||||
FreeRunEnabled = FreeRunEnabled + joinOffset;
|
||||
CurrentInputResolution = CurrentInputResolution + joinOffset;
|
||||
VideoInput = VideoInput + joinOffset;
|
||||
AudioInput = AudioInput + joinOffset;
|
||||
HdcpSupportCapability = HdcpSupportCapability + joinOffset;
|
||||
Port1HdcpState = Port1HdcpState + joinOffset;
|
||||
Port2HdcpState = Port2HdcpState + joinOffset;
|
||||
VgaBrightness = VgaBrightness + joinOffset;
|
||||
VgaContrast = VgaContrast + joinOffset;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,7 @@ using PepperDash.Essentials.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
[Obsolete("Please use version PepperDash.Essentials.Core.Bridges")]
|
||||
public class DmpsAudioOutputControllerJoinMap : JoinMapBase
|
||||
{
|
||||
#region Digital/Analog
|
||||
|
||||
@@ -7,6 +7,7 @@ using PepperDash.Essentials.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
[Obsolete("Please use version PepperDash.Essentials.Core.Bridges")]
|
||||
public class DmpsRoutingControllerJoinMap : JoinMapBase
|
||||
{
|
||||
#region Digitals
|
||||
|
||||
@@ -9,6 +9,7 @@ using PepperDash.Essentials.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
[Obsolete("Please use version PepperDash.Essentials.Core.Bridges")]
|
||||
public class GenericLightingJoinMap : JoinMapBase
|
||||
{
|
||||
public uint IsOnline { get; set; }
|
||||
|
||||
@@ -7,6 +7,7 @@ using PepperDash.Essentials.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
[Obsolete("Please use version PepperDash.Essentials.Core.Bridges")]
|
||||
public class GenericRelayControllerJoinMap : JoinMapBase
|
||||
{
|
||||
#region Digitals
|
||||
|
||||
@@ -7,6 +7,7 @@ using PepperDash.Essentials.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
[Obsolete("Please use version PepperDash.Essentials.Core.Bridges")]
|
||||
public class GlsOccupancySensorBaseJoinMap : JoinMapBase
|
||||
{
|
||||
#region Digitals
|
||||
@@ -32,6 +33,14 @@ namespace PepperDash.Essentials.Bridges
|
||||
/// </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; }
|
||||
@@ -129,6 +138,10 @@ namespace PepperDash.Essentials.Bridges
|
||||
public uint PirSensitivityInVacantState { get; set; }
|
||||
#endregion
|
||||
|
||||
#region Serial
|
||||
public uint Name { get; set; }
|
||||
#endregion
|
||||
|
||||
public GlsOccupancySensorBaseJoinMap()
|
||||
{
|
||||
IsOnline = 1;
|
||||
@@ -139,6 +152,8 @@ namespace PepperDash.Essentials.Bridges
|
||||
GraceOccupancyDetectedFeedback = 3;
|
||||
RoomVacantFeedback = 4;
|
||||
RawOccupancyFeedback = 5;
|
||||
RawOccupancyPirFeedback = 6;
|
||||
RawOccupancyUsFeedback = 7;
|
||||
EnableLedFlash = 11;
|
||||
DisableLedFlash = 12;
|
||||
EnableShortTimeout = 13;
|
||||
@@ -151,15 +166,14 @@ namespace PepperDash.Essentials.Bridges
|
||||
DisableUsB = 20;
|
||||
EnablePir = 21;
|
||||
DisablePir = 22;
|
||||
DisablePir = 23;
|
||||
IncrementUsInOccupiedState = 24;
|
||||
DecrementUsInOccupiedState = 25;
|
||||
IncrementUsInVacantState = 26;
|
||||
DecrementUsInVacantState = 27;
|
||||
IncrementPirInOccupiedState = 28;
|
||||
DecrementPirInOccupiedState = 29;
|
||||
IncrementPirInVacantState = 30;
|
||||
DecrementPirInVacantState = 31;
|
||||
IncrementUsInOccupiedState = 23;
|
||||
DecrementUsInOccupiedState = 24;
|
||||
IncrementUsInVacantState = 25;
|
||||
DecrementUsInVacantState = 26;
|
||||
IncrementPirInOccupiedState = 27;
|
||||
DecrementPirInOccupiedState = 28;
|
||||
IncrementPirInVacantState = 29;
|
||||
DecrementPirInVacantState = 30;
|
||||
|
||||
Timeout = 1;
|
||||
TimeoutLocalFeedback = 2;
|
||||
@@ -168,7 +182,10 @@ namespace PepperDash.Essentials.Bridges
|
||||
UsSensitivityInOccupiedState = 5;
|
||||
UsSensitivityInVacantState = 6;
|
||||
PirSensitivityInOccupiedState = 7;
|
||||
PirSensitivityInVacantState = 8;
|
||||
PirSensitivityInVacantState = 8;
|
||||
|
||||
Name = 1;
|
||||
|
||||
}
|
||||
|
||||
public override void OffsetJoinNumbers(uint joinStart)
|
||||
@@ -182,7 +199,9 @@ namespace PepperDash.Essentials.Bridges
|
||||
RoomOccupiedFeedback = RoomOccupiedFeedback + joinOffset;
|
||||
GraceOccupancyDetectedFeedback = GraceOccupancyDetectedFeedback + joinOffset;
|
||||
RoomVacantFeedback = RoomVacantFeedback + joinOffset;
|
||||
RawOccupancyFeedback = RawOccupancyFeedback + joinOffset;
|
||||
RawOccupancyFeedback = RawOccupancyFeedback + joinOffset;
|
||||
RawOccupancyPirFeedback = RawOccupancyPirFeedback + joinOffset;
|
||||
RawOccupancyUsFeedback = RawOccupancyUsFeedback + joinOffset;
|
||||
EnableLedFlash = EnableLedFlash + joinOffset;
|
||||
DisableLedFlash = DisableLedFlash + joinOffset;
|
||||
EnableShortTimeout = EnableShortTimeout + joinOffset;
|
||||
@@ -195,7 +214,6 @@ namespace PepperDash.Essentials.Bridges
|
||||
DisableUsB = DisableUsB + joinOffset;
|
||||
EnablePir = EnablePir + joinOffset;
|
||||
DisablePir = DisablePir + joinOffset;
|
||||
DisablePir = DisablePir + joinOffset;
|
||||
IncrementUsInOccupiedState = IncrementUsInOccupiedState + joinOffset;
|
||||
DecrementUsInOccupiedState = DecrementUsInOccupiedState + joinOffset;
|
||||
IncrementUsInVacantState = IncrementUsInVacantState + joinOffset;
|
||||
@@ -213,6 +231,8 @@ namespace PepperDash.Essentials.Bridges
|
||||
UsSensitivityInVacantState = UsSensitivityInVacantState + joinOffset;
|
||||
PirSensitivityInOccupiedState = PirSensitivityInOccupiedState + joinOffset;
|
||||
PirSensitivityInVacantState = PirSensitivityInVacantState + joinOffset;
|
||||
|
||||
Name = Name + joinOffset;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ using PepperDash.Essentials.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
[Obsolete("Please use version PepperDash.Essentials.Core.Bridges")]
|
||||
public class HdMdxxxCEControllerJoinMap : JoinMapBase
|
||||
{
|
||||
#region Digitals
|
||||
|
||||
@@ -7,6 +7,7 @@ using PepperDash.Essentials.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
[Obsolete("Please use version PepperDash.Essentials.Core.Bridges")]
|
||||
public class IBasicCommunicationJoinMap : JoinMapBase
|
||||
{
|
||||
#region Digitals
|
||||
|
||||
@@ -7,6 +7,7 @@ using PepperDash.Essentials.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
[Obsolete("Please use version PepperDash.Essentials.Core.Bridges")]
|
||||
public class IDigitalInputJoinMap : JoinMapBase
|
||||
{
|
||||
#region Digitals
|
||||
|
||||
@@ -0,0 +1,213 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using PepperDash.Essentials.Core;
|
||||
using Crestron.SimplSharp.Reflection;
|
||||
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
[Obsolete("Please use version PepperDash.Essentials.Core.Bridges")]
|
||||
public class SetTopBoxControllerJoinMap : JoinMapBase
|
||||
{
|
||||
#region Digitals
|
||||
public uint DvrList { get; set; } //
|
||||
public uint Replay { get; set; }
|
||||
public uint Up { get; set; } //
|
||||
public uint Down { get; set; } //
|
||||
public uint Left { get; set; } //
|
||||
public uint Right { get; set; } //
|
||||
public uint Select { get; set; } //
|
||||
public uint Menu { get; set; } //
|
||||
public uint Exit { get; set; } //
|
||||
public uint Digit0 { get; set; } //
|
||||
public uint Digit1 { get; set; } //
|
||||
public uint Digit2 { get; set; } //
|
||||
public uint Digit3 { get; set; } //
|
||||
public uint Digit4 { get; set; } //
|
||||
public uint Digit5 { get; set; } //
|
||||
public uint Digit6 { get; set; } //
|
||||
public uint Digit7 { get; set; } //
|
||||
public uint Digit8 { get; set; } //
|
||||
public uint Digit9 { get; set; } //
|
||||
public uint Dash { get; set; } //
|
||||
public uint KeypadEnter { get; set; } //
|
||||
public uint ChannelUp { get; set; } //
|
||||
public uint ChannelDown { get; set; } //
|
||||
public uint LastChannel { get; set; } //
|
||||
public uint Guide { get; set; } //
|
||||
public uint Info { get; set; } //
|
||||
public uint Red { get; set; } //
|
||||
public uint Green { get; set; } //
|
||||
public uint Yellow { get; set; } //
|
||||
public uint Blue { get; set; } //
|
||||
public uint ChapMinus { get; set; }
|
||||
public uint ChapPlus { get; set; }
|
||||
public uint FFwd { get; set; } //
|
||||
public uint Pause { get; set; } //
|
||||
public uint Play { get; set; } //
|
||||
public uint Record { get; set; }
|
||||
public uint Rewind { get; set; } //
|
||||
public uint Stop { get; set; } //
|
||||
|
||||
public uint PowerOn { get; set; } //
|
||||
public uint PowerOff { get; set; } //
|
||||
public uint PowerToggle { get; set; } //
|
||||
|
||||
public uint HasKeypadAccessoryButton1 { get; set; }
|
||||
public uint HasKeypadAccessoryButton2 { get; set; }
|
||||
|
||||
public uint KeypadAccessoryButton1Press { get; set; }
|
||||
public uint KeypadAccessoryButton2Press { get; set; }
|
||||
|
||||
|
||||
public uint HasDvr { get; set; }
|
||||
public uint HasPresets { get; set; }
|
||||
public uint HasNumeric { get; set; }
|
||||
public uint HasDpad { get; set; }
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region Analogs
|
||||
|
||||
#endregion
|
||||
|
||||
#region Strings
|
||||
public uint Name { get; set; }
|
||||
public uint LoadPresets { get; set; }
|
||||
public uint KeypadAccessoryButton1Label { get; set; }
|
||||
public uint KeypadAccessoryButton2Label { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
public SetTopBoxControllerJoinMap()
|
||||
{
|
||||
PowerOn = 1;
|
||||
PowerOff = 2;
|
||||
PowerToggle = 3;
|
||||
|
||||
HasDpad = 4;
|
||||
Up = 4;
|
||||
Down = 5;
|
||||
Left = 6;
|
||||
Right = 7;
|
||||
Select = 8;
|
||||
Menu = 9;
|
||||
Exit = 10;
|
||||
|
||||
HasNumeric = 11;
|
||||
Digit0 = 11;
|
||||
Digit1 = 12;
|
||||
Digit2 = 13;
|
||||
Digit3 = 14;
|
||||
Digit4 = 15;
|
||||
Digit5 = 16;
|
||||
Digit6 = 17;
|
||||
Digit7 = 18;
|
||||
Digit8 = 19;
|
||||
Digit9 = 20;
|
||||
Dash = 21;
|
||||
KeypadEnter = 22;
|
||||
ChannelUp = 23;
|
||||
ChannelDown = 24;
|
||||
LastChannel = 25;
|
||||
|
||||
Guide = 26;
|
||||
Info = 27;
|
||||
Red = 28;
|
||||
Green = 29;
|
||||
Yellow = 30;
|
||||
Blue = 31;
|
||||
|
||||
HasDvr = 32;
|
||||
DvrList = 32;
|
||||
Play = 33;
|
||||
Pause = 34;
|
||||
Stop = 35;
|
||||
FFwd = 36;
|
||||
Rewind = 37;
|
||||
ChapPlus = 38;
|
||||
ChapMinus = 39;
|
||||
Replay = 40;
|
||||
Record = 41;
|
||||
HasKeypadAccessoryButton1 = 42;
|
||||
KeypadAccessoryButton1Press = 42;
|
||||
HasKeypadAccessoryButton2 = 43;
|
||||
KeypadAccessoryButton2Press = 43;
|
||||
|
||||
Name = 1;
|
||||
KeypadAccessoryButton1Label = 42;
|
||||
KeypadAccessoryButton2Label = 43;
|
||||
|
||||
LoadPresets = 50;
|
||||
}
|
||||
|
||||
public override void OffsetJoinNumbers(uint joinStart)
|
||||
{
|
||||
var joinOffset = joinStart - 1;
|
||||
|
||||
PowerOn += joinOffset;
|
||||
PowerOff += joinOffset;
|
||||
PowerToggle += joinOffset;
|
||||
|
||||
HasDpad += joinOffset;
|
||||
Up += joinOffset;
|
||||
Down += joinOffset;
|
||||
Left += joinOffset;
|
||||
Right += joinOffset;
|
||||
Select += joinOffset;
|
||||
Menu += joinOffset;
|
||||
Exit += joinOffset;
|
||||
|
||||
HasNumeric += joinOffset;
|
||||
Digit0 += joinOffset;
|
||||
Digit1 += joinOffset;
|
||||
Digit2 += joinOffset;
|
||||
Digit3 += joinOffset;
|
||||
Digit4 += joinOffset;
|
||||
Digit5 += joinOffset;
|
||||
Digit6 += joinOffset;
|
||||
Digit7 += joinOffset;
|
||||
Digit8 += joinOffset;
|
||||
Digit9 += joinOffset;
|
||||
Dash += joinOffset;
|
||||
KeypadEnter += joinOffset;
|
||||
ChannelUp += joinOffset;
|
||||
ChannelDown += joinOffset;
|
||||
LastChannel += joinOffset;
|
||||
|
||||
Guide += joinOffset;
|
||||
Info += joinOffset;
|
||||
Red += joinOffset;
|
||||
Green += joinOffset;
|
||||
Yellow += joinOffset;
|
||||
Blue += joinOffset;
|
||||
|
||||
HasDvr += joinOffset;
|
||||
DvrList += joinOffset;
|
||||
Play += joinOffset;
|
||||
Pause += joinOffset;
|
||||
Stop += joinOffset;
|
||||
FFwd += joinOffset;
|
||||
Rewind += joinOffset;
|
||||
ChapPlus += joinOffset;
|
||||
ChapMinus += joinOffset;
|
||||
Replay += joinOffset;
|
||||
Record += joinOffset;
|
||||
HasKeypadAccessoryButton1 += joinOffset;
|
||||
KeypadAccessoryButton1Press += joinOffset;
|
||||
HasKeypadAccessoryButton2 += joinOffset;
|
||||
KeypadAccessoryButton2Press += joinOffset;
|
||||
|
||||
Name += joinOffset;
|
||||
KeypadAccessoryButton1Label += joinOffset;
|
||||
KeypadAccessoryButton2Label += joinOffset;
|
||||
|
||||
LoadPresets += joinOffset;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using Crestron.SimplSharp.Reflection;
|
||||
using PepperDash.Essentials.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
[Obsolete("Please use version PepperDash.Essentials.Core.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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,9 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using PepperDash.Essentials.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
[Obsolete("Please use version PepperDash.Essentials.Core.Bridges")]
|
||||
public class SystemMonitorJoinMap : JoinMapBase
|
||||
{
|
||||
/// <summary>
|
||||
@@ -14,11 +11,21 @@ namespace PepperDash.Essentials.Bridges
|
||||
/// </summary>
|
||||
public uint ProgramStartJoin { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Offset to indicate where the range of iterated Ethernet joins will start
|
||||
/// </summary>
|
||||
public uint EthernetStartJoin { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Offset between each program join set
|
||||
/// </summary>
|
||||
public uint ProgramOffsetJoin { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Offset between each Ethernet Interface join set
|
||||
/// </summary>
|
||||
public uint EthernetOffsetJoin { get; set; }
|
||||
|
||||
#region Digitals
|
||||
/// <summary>
|
||||
/// Range Sets and reports whether the corresponding program slot is started
|
||||
@@ -87,6 +94,68 @@ namespace PepperDash.Essentials.Bridges
|
||||
/// Serialized JSON output that aggregates the program info of the corresponding program
|
||||
/// </summary>
|
||||
public uint AggregatedProgramInfo { get; set; }
|
||||
/// <summary>
|
||||
/// Reports the controller serial number
|
||||
/// </summary>
|
||||
public uint SerialNumber { get; set; }
|
||||
/// <summary>
|
||||
/// Reports the controller model
|
||||
/// </summary>
|
||||
public uint Model { get; set; }
|
||||
/// <summary>
|
||||
/// Reports the Host name set on the corresponding interface
|
||||
/// </summary>
|
||||
public uint HostName { get; set; }
|
||||
/// <summary>
|
||||
/// Reports the Current IP address set on the corresponding interface. If DHCP is enabled, this will be the DHCP assigned address.
|
||||
/// </summary>
|
||||
public uint CurrentIpAddress { get; set; }
|
||||
/// <summary>
|
||||
/// Reporst the Current Default Gateway set on the corresponding interface. If DHCP is enabled, this will be the DHCP assigned gateway
|
||||
/// </summary>
|
||||
public uint CurrentDefaultGateway { get; set; }
|
||||
/// <summary>
|
||||
/// Reports the Current Subnet Mask set on the corresponding interface. If DHCP is enabled, this will be the DHCP assigned subnet mask
|
||||
/// </summary>
|
||||
public uint CurrentSubnetMask { get; set; }
|
||||
/// <summary>
|
||||
/// Reports the Static IP address set on the corresponding interface. If DHCP is disabled, this will match the Current IP address
|
||||
/// </summary>
|
||||
public uint StaticIpAddress { get; set; }
|
||||
/// <summary>
|
||||
/// Reporst the Static Default Gateway set on the corresponding interface. If DHCP is disabled, this will match the Current gateway
|
||||
/// </summary>
|
||||
public uint StaticDefaultGateway { get; set; }
|
||||
/// <summary>
|
||||
/// Reports the Current Subnet Mask set on the corresponding interface. If DHCP is enabled, this will be the DHCP assigned subnet mask
|
||||
/// </summary>
|
||||
public uint StaticSubnetMask { get; set; }
|
||||
/// <summary>
|
||||
/// Reports the current DomainFeedback on the corresponding interface
|
||||
/// </summary>
|
||||
public uint Domain { get; set; }
|
||||
/// <summary>
|
||||
/// Reports the current DNS Servers on the corresponding interface
|
||||
/// </summary>
|
||||
public uint DnsServer { get; set; }
|
||||
/// <summary>
|
||||
/// Reports the MAC Address of the corresponding interface
|
||||
/// </summary>
|
||||
public uint MacAddress { get; set; }
|
||||
/// <summary>
|
||||
/// Reports the DHCP Status of the corresponding interface
|
||||
/// </summary>
|
||||
public uint DhcpStatus { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Reports the current uptime. Updated in 5 minute intervals.
|
||||
/// </summary>
|
||||
public uint Uptime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Reports the date of the last boot
|
||||
/// </summary>
|
||||
public uint LastBoot { get; set; }
|
||||
#endregion
|
||||
|
||||
public SystemMonitorJoinMap()
|
||||
@@ -98,6 +167,10 @@ namespace PepperDash.Essentials.Bridges
|
||||
SnmpAppVersion = 3;
|
||||
BACnetAppVersion = 4;
|
||||
ControllerVersion = 5;
|
||||
SerialNumber = 6;
|
||||
Model = 7;
|
||||
Uptime = 8;
|
||||
LastBoot = 9;
|
||||
|
||||
|
||||
ProgramStartJoin = 10;
|
||||
@@ -115,6 +188,23 @@ namespace PepperDash.Essentials.Bridges
|
||||
ProgramCrestronDatabaseVersion = 3;
|
||||
ProgramEnvironmentVersion = 4;
|
||||
AggregatedProgramInfo = 5;
|
||||
|
||||
EthernetStartJoin = 75;
|
||||
|
||||
EthernetOffsetJoin = 15;
|
||||
|
||||
// Offset in groups of 15
|
||||
HostName = 1;
|
||||
CurrentIpAddress = 2;
|
||||
CurrentSubnetMask = 3;
|
||||
CurrentDefaultGateway = 4;
|
||||
StaticIpAddress = 5;
|
||||
StaticSubnetMask = 6;
|
||||
StaticDefaultGateway = 7;
|
||||
Domain = 8;
|
||||
DnsServer = 9;
|
||||
MacAddress = 10;
|
||||
DhcpStatus = 11;
|
||||
}
|
||||
|
||||
public override void OffsetJoinNumbers(uint joinStart)
|
||||
@@ -131,6 +221,7 @@ namespace PepperDash.Essentials.Bridges
|
||||
|
||||
// Sets the initial join value where the iterated program joins will begin
|
||||
ProgramStartJoin = ProgramStartJoin + joinOffset;
|
||||
EthernetStartJoin = EthernetStartJoin + 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.Core.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.GetSerializedJoinMapForDevice(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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
using Crestron.SimplSharpPro.Diagnostics;
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
@@ -11,15 +6,15 @@ using PepperDash.Essentials.Core.Monitoring;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
namespace PepperDash.Essentials.Core.Bridges
|
||||
{
|
||||
public static class SystemMonitorBridge
|
||||
{
|
||||
public static void LinkToApi(this SystemMonitorController systemMonitorController, BasicTriList trilist, uint joinStart, string joinMapKey)
|
||||
{
|
||||
SystemMonitorJoinMap joinMap = new SystemMonitorJoinMap();
|
||||
var joinMap = new SystemMonitorJoinMap();
|
||||
|
||||
var joinMapSerialized = JoinMapHelper.GetJoinMapForDevice(joinMapKey);
|
||||
var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
|
||||
|
||||
if(!string.IsNullOrEmpty(joinMapSerialized))
|
||||
joinMap = JsonConvert.DeserializeObject<SystemMonitorJoinMap>(joinMapSerialized);
|
||||
@@ -30,36 +25,81 @@ namespace PepperDash.Essentials.Bridges
|
||||
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)));
|
||||
systemMonitorController.TimeZoneTextFeedback.LinkInputSig(trilist.StringInput[joinMap.TimeZoneName]);
|
||||
|
||||
systemMonitorController.IOControllerVersionFeedback.LinkInputSig(trilist.StringInput[joinMap.IOControllerVersion]);
|
||||
systemMonitorController.IoControllerVersionFeedback.LinkInputSig(trilist.StringInput[joinMap.IOControllerVersion]);
|
||||
systemMonitorController.SnmpVersionFeedback.LinkInputSig(trilist.StringInput[joinMap.SnmpAppVersion]);
|
||||
systemMonitorController.BACnetAppVersionFeedback.LinkInputSig(trilist.StringInput[joinMap.BACnetAppVersion]);
|
||||
systemMonitorController.BaCnetAppVersionFeedback.LinkInputSig(trilist.StringInput[joinMap.BACnetAppVersion]);
|
||||
systemMonitorController.ControllerVersionFeedback.LinkInputSig(trilist.StringInput[joinMap.ControllerVersion]);
|
||||
systemMonitorController.SerialNumberFeedback.LinkInputSig(trilist.StringInput[joinMap.SerialNumber]);
|
||||
systemMonitorController.ModelFeedback.LinkInputSig(trilist.StringInput[joinMap.Model]);
|
||||
systemMonitorController.UptimeFeedback.LinkInputSig(trilist.StringInput[joinMap.Uptime]);
|
||||
systemMonitorController.LastStartFeedback.LinkInputSig(trilist.StringInput[joinMap.LastBoot]);
|
||||
|
||||
// iterate the program status feedback collection and map all the joins
|
||||
LinkProgramInfoJoins(systemMonitorController, trilist, joinMap);
|
||||
|
||||
LinkEthernetInfoJoins(systemMonitorController, trilist, joinMap);
|
||||
}
|
||||
|
||||
private static void LinkEthernetInfoJoins(SystemMonitorController systemMonitorController, BasicTriList trilist, SystemMonitorJoinMap joinMap)
|
||||
{
|
||||
var ethernetSlotJoinStart = joinMap.EthernetStartJoin;
|
||||
|
||||
foreach (var fb in systemMonitorController.EthernetStatusFeedbackCollection)
|
||||
{
|
||||
fb.Value.CurrentIpAddressFeedback.LinkInputSig(trilist.StringInput[ethernetSlotJoinStart + joinMap.CurrentIpAddress]);
|
||||
fb.Value.CurrentSubnetMaskFeedback.LinkInputSig(trilist.StringInput[ethernetSlotJoinStart + joinMap.CurrentSubnetMask]);
|
||||
fb.Value.CurrentDefaultGatewayFeedback.LinkInputSig(trilist.StringInput[ethernetSlotJoinStart + joinMap.CurrentDefaultGateway]);
|
||||
fb.Value.StaticIpAddressFeedback.LinkInputSig(trilist.StringInput[ethernetSlotJoinStart + joinMap.StaticIpAddress]);
|
||||
fb.Value.StaticSubnetMaskFeedback.LinkInputSig(trilist.StringInput[ethernetSlotJoinStart + joinMap.StaticSubnetMask]);
|
||||
fb.Value.StaticDefaultGatewayFeedback.LinkInputSig(trilist.StringInput[ethernetSlotJoinStart + joinMap.StaticDefaultGateway]);
|
||||
fb.Value.HostNameFeedback.LinkInputSig(trilist.StringInput[ethernetSlotJoinStart + joinMap.HostName]);
|
||||
fb.Value.MacAddressFeedback.LinkInputSig(trilist.StringInput[ethernetSlotJoinStart + joinMap.MacAddress]);
|
||||
fb.Value.DomainFeedback.LinkInputSig(trilist.StringInput[ethernetSlotJoinStart + joinMap.Domain]);
|
||||
fb.Value.DnsServerFeedback.LinkInputSig(trilist.StringInput[ethernetSlotJoinStart + joinMap.DnsServer]);
|
||||
fb.Value.DhcpStatusFeedback.LinkInputSig(trilist.StringInput[ethernetSlotJoinStart + joinMap.DhcpStatus]);
|
||||
|
||||
ethernetSlotJoinStart += joinMap.EthernetOffsetJoin;
|
||||
}
|
||||
}
|
||||
|
||||
private static void LinkProgramInfoJoins(SystemMonitorController systemMonitorController, BasicTriList trilist,
|
||||
SystemMonitorJoinMap joinMap)
|
||||
{
|
||||
var programSlotJoinStart = joinMap.ProgramStartJoin;
|
||||
|
||||
foreach (var p in systemMonitorController.ProgramStatusFeedbackCollection)
|
||||
{
|
||||
var programNumber = p.Value.Program.Number;
|
||||
|
||||
trilist.SetBoolSigAction(programSlotJoinStart + joinMap.ProgramStart, new Action<bool>
|
||||
(b => SystemMonitor.ProgramCollection[programNumber].OperatingState = eProgramOperatingState.Start));
|
||||
trilist.SetBoolSigAction(programSlotJoinStart + joinMap.ProgramStart,
|
||||
b => SystemMonitor.ProgramCollection[programNumber].OperatingState = eProgramOperatingState.Start);
|
||||
p.Value.ProgramStartedFeedback.LinkInputSig(trilist.BooleanInput[programSlotJoinStart + joinMap.ProgramStart]);
|
||||
|
||||
trilist.SetBoolSigAction(programSlotJoinStart + joinMap.ProgramStop, new Action<bool>
|
||||
(b => SystemMonitor.ProgramCollection[programNumber].OperatingState = eProgramOperatingState.Stop));
|
||||
trilist.SetBoolSigAction(programSlotJoinStart + joinMap.ProgramStop,
|
||||
b => SystemMonitor.ProgramCollection[programNumber].OperatingState = eProgramOperatingState.Stop);
|
||||
p.Value.ProgramStoppedFeedback.LinkInputSig(trilist.BooleanInput[programSlotJoinStart + joinMap.ProgramStop]);
|
||||
|
||||
trilist.SetBoolSigAction(programSlotJoinStart + joinMap.ProgramRegister, new Action<bool>
|
||||
(b => SystemMonitor.ProgramCollection[programNumber].RegistrationState = eProgramRegistrationState.Register));
|
||||
p.Value.ProgramRegisteredFeedback.LinkInputSig(trilist.BooleanInput[programSlotJoinStart + joinMap.ProgramRegister]);
|
||||
trilist.SetBoolSigAction(programSlotJoinStart + joinMap.ProgramRegister,
|
||||
b => SystemMonitor.ProgramCollection[programNumber].RegistrationState = eProgramRegistrationState.Register);
|
||||
p.Value.ProgramRegisteredFeedback.LinkInputSig(
|
||||
trilist.BooleanInput[programSlotJoinStart + joinMap.ProgramRegister]);
|
||||
|
||||
trilist.SetBoolSigAction(programSlotJoinStart + joinMap.ProgramUnregister, new Action<bool>
|
||||
(b => SystemMonitor.ProgramCollection[programNumber].RegistrationState = eProgramRegistrationState.Unregister));
|
||||
p.Value.ProgramUnregisteredFeedback.LinkInputSig(trilist.BooleanInput[programSlotJoinStart + joinMap.ProgramUnregister]);
|
||||
trilist.SetBoolSigAction(programSlotJoinStart + joinMap.ProgramUnregister,
|
||||
b => SystemMonitor.ProgramCollection[programNumber].RegistrationState = eProgramRegistrationState.Unregister);
|
||||
p.Value.ProgramUnregisteredFeedback.LinkInputSig(
|
||||
trilist.BooleanInput[programSlotJoinStart + joinMap.ProgramUnregister]);
|
||||
|
||||
p.Value.ProgramNameFeedback.LinkInputSig(trilist.StringInput[programSlotJoinStart + joinMap.ProgramName]);
|
||||
p.Value.ProgramCompileTimeFeedback.LinkInputSig(
|
||||
trilist.StringInput[programSlotJoinStart + joinMap.ProgramCompiledTime]);
|
||||
p.Value.CrestronDataBaseVersionFeedback.LinkInputSig(
|
||||
trilist.StringInput[programSlotJoinStart + joinMap.ProgramCrestronDatabaseVersion]);
|
||||
p.Value.EnvironmentVersionFeedback.LinkInputSig(
|
||||
trilist.StringInput[programSlotJoinStart + joinMap.ProgramEnvironmentVersion]);
|
||||
p.Value.AggregatedProgramInfoFeedback.LinkInputSig(
|
||||
trilist.StringInput[programSlotJoinStart + joinMap.AggregatedProgramInfo]);
|
||||
|
||||
programSlotJoinStart = programSlotJoinStart + joinMap.ProgramOffsetJoin;
|
||||
}
|
||||
|
||||
@@ -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,101 +0,0 @@
|
||||
using System;
|
||||
using Crestron.SimplSharpPro;
|
||||
using Crestron.SimplSharpPro.DM;
|
||||
using Crestron.SimplSharpPro.DM.Endpoints.Receivers;
|
||||
using Crestron.SimplSharpPro.DM.Endpoints.Transmitters;
|
||||
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Devices;
|
||||
//using PepperDash.Essentials.Devices.Dm;
|
||||
using PepperDash.Core;
|
||||
|
||||
namespace PepperDash.Essentials
|
||||
{
|
||||
public class DmFactory
|
||||
{
|
||||
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");
|
||||
// Catch all 200 series TX
|
||||
var devprops = devToken["properties"];
|
||||
var ipId = Convert.ToUInt32(devprops.Value<string>("ipId"), 16);
|
||||
var parent = devprops.Value<string>("parent");
|
||||
if (parent == null)
|
||||
parent = "controlSystem";
|
||||
|
||||
if (devType.StartsWith("DmTx2", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
DmTx201C tx;
|
||||
if (parent.Equals("controlSystem", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
tx = new DmTx201C(ipId, Global.ControlSystem);
|
||||
//dev = new DmTx201SBasicController(devKey, devName, tx);
|
||||
}
|
||||
|
||||
}
|
||||
else if (devType.StartsWith("DmRmc", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
DmRmc100C rmc;
|
||||
if (parent.Equals("controlSystem", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
rmc = new DmRmc100C(ipId, Global.ControlSystem);
|
||||
//dev = new DmRmcBaseController(devKey, devName, rmc);
|
||||
}
|
||||
}
|
||||
else
|
||||
FactoryHelper.HandleUnknownType(devToken, devType);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
FactoryHelper.HandleDeviceCreationError(devToken, e);
|
||||
}
|
||||
return dev;
|
||||
}
|
||||
|
||||
|
||||
public static Device CreateChassis(JToken devToken)
|
||||
{
|
||||
Device dev = null;
|
||||
try
|
||||
{
|
||||
var devType = devToken.Value<string>("type");
|
||||
var devKey = devToken.Value<string>("key");
|
||||
var devName = devToken.Value<string>("name");
|
||||
// Catch all 200 series TX
|
||||
var devprops = devToken["properties"];
|
||||
var ipId = Convert.ToUInt32(devprops.Value<string>("ipId"), 16);
|
||||
var parent = devprops.Value<string>("parent");
|
||||
if (parent == null)
|
||||
parent = "controlSystem";
|
||||
|
||||
if (devType.Equals("dmmd8x8", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
var dm = new DmMd8x8(ipId, Global.ControlSystem);
|
||||
//dev = new DmChassisController(devKey, devName, dm);
|
||||
}
|
||||
else if (devType.Equals("dmmd16x16", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
var dm = new DmMd16x16(ipId, Global.ControlSystem);
|
||||
//dev = new DmChassisController(devKey, devName, dm);
|
||||
}
|
||||
else if (devType.Equals("dmmd32x32", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
var dm = new DmMd32x32(ipId, Global.ControlSystem);
|
||||
//dev = new DmChassisController(devKey, devName, dm);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
FactoryHelper.HandleDeviceCreationError(devToken, e);
|
||||
}
|
||||
return dev;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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,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,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;
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
@@ -10,6 +10,7 @@ using Crestron.SimplSharp.Reflection;
|
||||
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.Bridges;
|
||||
using PepperDash.Essentials.Core.Config;
|
||||
using PepperDash.Essentials.Devices.Common;
|
||||
using PepperDash.Essentials.DM;
|
||||
@@ -25,6 +26,9 @@ namespace PepperDash.Essentials
|
||||
{
|
||||
HttpLogoServer LogoServer;
|
||||
|
||||
private CTimer _startTimer;
|
||||
private const long StartupTime = 500;
|
||||
|
||||
public ControlSystem()
|
||||
: base()
|
||||
{
|
||||
@@ -37,6 +41,11 @@ namespace PepperDash.Essentials
|
||||
/// Entry point for the program
|
||||
/// </summary>
|
||||
public override void InitializeSystem()
|
||||
{
|
||||
_startTimer = new CTimer(StartSystem,StartupTime);
|
||||
}
|
||||
|
||||
private void StartSystem(object obj)
|
||||
{
|
||||
DeterminePlatform();
|
||||
|
||||
@@ -46,7 +55,12 @@ namespace PepperDash.Essentials
|
||||
ConsoleAccessLevelEnum.AccessOperator);
|
||||
}
|
||||
|
||||
// CrestronConsole.AddNewConsoleCommand(S => { ConfigWriter.WriteConfigFile(null); }, "writeconfig", "writes the current config to a file", ConsoleAccessLevelEnum.AccessOperator);
|
||||
CrestronConsole.AddNewConsoleCommand(PluginLoader.ReportAssemblyVersions, "reportversions", "Reports the versions of the loaded assemblies", ConsoleAccessLevelEnum.AccessOperator);
|
||||
|
||||
CrestronConsole.AddNewConsoleCommand(PepperDash.Essentials.Core.DeviceFactory.GetDeviceFactoryTypes, "gettypes", "Gets the device types that can be built. Accepts a filter string.", ConsoleAccessLevelEnum.AccessOperator);
|
||||
|
||||
CrestronConsole.AddNewConsoleCommand(BridgeHelper.PrintJoinMap, "getjoinmap", "map(s) for bridge or device on bridge [brKey [devKey]]", ConsoleAccessLevelEnum.AccessOperator);
|
||||
|
||||
CrestronConsole.AddNewConsoleCommand(s =>
|
||||
{
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "CONSOLE MESSAGE: {0}", s);
|
||||
@@ -68,11 +82,12 @@ namespace PepperDash.Essentials
|
||||
}, "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.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);
|
||||
|
||||
|
||||
if (!Debug.DoNotLoadOnNextBoot)
|
||||
GoWithLoad();
|
||||
@@ -81,7 +96,7 @@ namespace PepperDash.Essentials
|
||||
/// <summary>
|
||||
/// Determines if the program is running on a processor (appliance) or server (VC-4).
|
||||
///
|
||||
/// Sets Global.FilePathPrefix based on platform
|
||||
/// Sets Global.FilePathPrefix and Global.ApplicationDirectoryPathPrefix based on platform
|
||||
/// </summary>
|
||||
public void DeterminePlatform()
|
||||
{
|
||||
@@ -97,16 +112,18 @@ namespace PepperDash.Essentials
|
||||
|
||||
directoryPrefix = Crestron.SimplSharp.CrestronIO.Directory.GetApplicationRootDirectory();
|
||||
|
||||
var version = Crestron.SimplSharp.Reflection.Assembly.GetExecutingAssembly().GetName().Version;
|
||||
var fullVersion = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyInformationalVersionAttribute), false);
|
||||
|
||||
Global.SetAssemblyVersion(string.Format("{0}.{1}.{2}", version.Major, version.Minor, version.Build));
|
||||
AssemblyInformationalVersionAttribute fullVersionAtt = fullVersion[0] as AssemblyInformationalVersionAttribute;
|
||||
|
||||
Global.SetAssemblyVersion(fullVersionAtt.InformationalVersion);
|
||||
|
||||
if (CrestronEnvironment.DevicePlatform != eDevicePlatform.Server) // Handles 3-series running Windows CE OS
|
||||
{
|
||||
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"
|
||||
if (Directory.Exists(Global.ApplicationDirectoryPathPrefix + dirSeparator + "User"
|
||||
+ dirSeparator + string.Format("program{0}", InitialParametersClass.ApplicationNumber)))
|
||||
{
|
||||
Debug.Console(0, @"User/program{0} directory found", InitialParametersClass.ApplicationNumber);
|
||||
@@ -151,16 +168,23 @@ namespace PepperDash.Essentials
|
||||
public void GoWithLoad()
|
||||
{
|
||||
try
|
||||
{
|
||||
{
|
||||
Debug.SetDoNotLoadOnNextBoot(false);
|
||||
|
||||
PluginLoader.AddProgramAssemblies();
|
||||
|
||||
new Core.DeviceFactory();
|
||||
new Devices.Common.DeviceFactory();
|
||||
new DM.DeviceFactory();
|
||||
new DeviceFactory();
|
||||
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Starting Essentials load from configuration");
|
||||
|
||||
var filesReady = SetupFilesystem();
|
||||
if (filesReady)
|
||||
{
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Checking for plugins");
|
||||
LoadPlugins();
|
||||
PluginLoader.LoadPlugins();
|
||||
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Folder structure verified. Loading config...");
|
||||
if (!ConfigReader.LoadConfig2())
|
||||
@@ -195,118 +219,7 @@ namespace PepperDash.Essentials
|
||||
|
||||
}
|
||||
|
||||
/// <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)
|
||||
|
||||
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
|
||||
@@ -389,12 +302,10 @@ namespace PepperDash.Essentials
|
||||
/// </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"));
|
||||
|
||||
@@ -426,42 +337,43 @@ namespace PepperDash.Essentials
|
||||
|
||||
DeviceManager.AddDevice(dmpsRoutingController);
|
||||
}
|
||||
else if (this.ControllerPrompt.IndexOf("mpc3", StringComparison.OrdinalIgnoreCase) > -1)
|
||||
{
|
||||
Debug.Console(2, "MPC3 processor type detected. Adding Mpc3TouchpanelController.");
|
||||
|
||||
var butToken = devConf.Properties["buttons"];
|
||||
if (butToken != null)
|
||||
{
|
||||
var buttons = butToken.ToObject<Dictionary<string, Essentials.Core.Touchpanels.KeypadButton>>();
|
||||
var tpController = new Essentials.Core.Touchpanels.Mpc3TouchpanelController(devConf.Key, devConf.Name, Global.ControlSystem, buttons);
|
||||
DeviceManager.AddDevice(tpController);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Error, "Error: Unable to deserialize buttons collection for device: {0}", devConf.Key);
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Console(2, "************Processor is not DMPS type***************");
|
||||
}
|
||||
|
||||
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
// Try local factories first
|
||||
var newDev = DeviceFactory.GetDevice(devConf);
|
||||
IKeyed newDev = null;
|
||||
|
||||
if (newDev == null)
|
||||
newDev = BridgeFactory.GetDevice(devConf);
|
||||
|
||||
// Then associated library factories
|
||||
if (newDev == null)
|
||||
newDev = PepperDash.Essentials.Core.DeviceFactory.GetDevice(devConf);
|
||||
if (newDev == null)
|
||||
newDev = PepperDash.Essentials.Devices.Common.DeviceFactory.GetDevice(devConf);
|
||||
if (newDev == null)
|
||||
newDev = PepperDash.Essentials.DM.DeviceFactory.GetDevice(devConf);
|
||||
if (newDev == null)
|
||||
newDev = PepperDash.Essentials.Devices.Displays.DisplayDeviceFactory.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)
|
||||
// newDev = PepperDash.Essentials.Devices.Displays.DisplayDeviceFactory.GetDevice(devConf);
|
||||
//
|
||||
|
||||
if (newDev != null)
|
||||
DeviceManager.AddDevice(newDev);
|
||||
|
||||
@@ -6,11 +6,12 @@ using Crestron.SimplSharp;
|
||||
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.Config;
|
||||
using PepperDash.Essentials.Core.Routing;
|
||||
|
||||
namespace PepperDash.Essentials
|
||||
{
|
||||
public class Amplifier : Device, IRoutingSinkNoSwitching
|
||||
public class Amplifier : EssentialsDevice, IRoutingSinkNoSwitching
|
||||
{
|
||||
public event SourceInfoChangeHandler CurrentSourceChange;
|
||||
|
||||
@@ -54,4 +55,18 @@ namespace PepperDash.Essentials
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
public class AmplifierFactory : EssentialsDeviceFactory<Amplifier>
|
||||
{
|
||||
public AmplifierFactory()
|
||||
{
|
||||
TypeNames = new List<string>() { "amplifier" };
|
||||
}
|
||||
|
||||
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||
{
|
||||
Debug.Console(1, "Factory Attempting to create new Amplifier Device");
|
||||
return new Amplifier(dc.Key, dc.Name);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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": {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -4,94 +4,45 @@ using System.Linq;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharp.CrestronIO;
|
||||
using Crestron.SimplSharpPro;
|
||||
using Crestron.SimplSharp.Reflection;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.Config;
|
||||
using PepperDash.Essentials.Room.MobileControl;
|
||||
|
||||
namespace PepperDash.Essentials
|
||||
{
|
||||
public class DeviceFactory
|
||||
{
|
||||
public static IKeyed GetDevice(DeviceConfig dc)
|
||||
{
|
||||
var key = dc.Key;
|
||||
var name = dc.Name;
|
||||
var type = dc.Type;
|
||||
var properties = dc.Properties;
|
||||
/// <summary>
|
||||
/// Responsible for loading all of the device types for this library
|
||||
/// </summary>
|
||||
public class DeviceFactory
|
||||
{
|
||||
|
||||
var typeName = dc.Type.ToLower();
|
||||
public DeviceFactory()
|
||||
{
|
||||
var assy = Assembly.GetExecutingAssembly();
|
||||
PluginLoader.SetEssentialsAssembly(assy.GetName().Name, assy);
|
||||
|
||||
if (typeName == "amplifier")
|
||||
var types = assy.GetTypes().Where(ct => typeof(IDeviceFactory).IsAssignableFrom(ct) && !ct.IsInterface && !ct.IsAbstract);
|
||||
|
||||
if (types != null)
|
||||
{
|
||||
return new Amplifier(dc.Key, dc.Name);
|
||||
}
|
||||
else if (dc.Group.ToLower() == "touchpanel") // typeName.StartsWith("tsw"))
|
||||
{
|
||||
return UiDeviceFactory.GetUiDevice(dc);
|
||||
foreach (var type in types)
|
||||
{
|
||||
try
|
||||
{
|
||||
var factory = (IDeviceFactory)Crestron.SimplSharp.Reflection.Activator.CreateInstance(type);
|
||||
factory.LoadTypeFactories();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Error, "Unable to load type: '{1}' DeviceFactory: {0}", e, type.Name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
else if (typeName == "mockdisplay")
|
||||
{
|
||||
return new MockDisplay(key, name);
|
||||
}
|
||||
|
||||
else if (typeName == "generic")
|
||||
{
|
||||
return new Device(key, name);
|
||||
}
|
||||
|
||||
//// MOVE into something else???
|
||||
//else if (typeName == "basicirdisplay")
|
||||
//{
|
||||
// var ir = IRPortHelper.GetIrPort(properties);
|
||||
// if (ir != null)
|
||||
// return new BasicIrDisplay(key, name, ir.Port, ir.FileName);
|
||||
//}
|
||||
|
||||
else if (typeName == "commmock")
|
||||
{
|
||||
var comm = CommFactory.CreateCommForDevice(dc);
|
||||
var props = JsonConvert.DeserializeObject<ConsoleCommMockDevicePropertiesConfig>(
|
||||
properties.ToString());
|
||||
return new ConsoleCommMockDevice(key, name, props, comm);
|
||||
}
|
||||
|
||||
else if (typeName == "appserver")
|
||||
{
|
||||
var props = JsonConvert.DeserializeObject<MobileControlConfig>(properties.ToString());
|
||||
return new MobileControlSystemController(key, name, props);
|
||||
}
|
||||
|
||||
else if (typeName == "mobilecontrolbridge-ddvc01")
|
||||
{
|
||||
var comm = CommFactory.GetControlPropertiesConfig(dc);
|
||||
|
||||
var bridge = new PepperDash.Essentials.Room.MobileControl.MobileControlDdvc01RoomBridge(key, name, comm.IpIdInt);
|
||||
bridge.AddPreActivationAction(() =>
|
||||
{
|
||||
var parent = DeviceManager.AllDevices.FirstOrDefault(d => d.Key == "appServer") as MobileControlSystemController;
|
||||
if (parent == null)
|
||||
{
|
||||
Debug.Console(0, bridge, "ERROR: Cannot connect bridge. System controller not present");
|
||||
}
|
||||
Debug.Console(0, bridge, "Linking to parent controller");
|
||||
bridge.AddParent(parent);
|
||||
parent.AddBridge(bridge);
|
||||
});
|
||||
|
||||
return bridge;
|
||||
}
|
||||
|
||||
else if (typeName == "roomonwhenoccupancydetectedfeature")
|
||||
{
|
||||
return new RoomOnToDefaultSourceWhenOccupied(dc);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,191 +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 Crestron.SimplSharpPro.UI;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.Config;
|
||||
using PepperDash.Essentials.Core.PageManagers;
|
||||
using PepperDash.Essentials.DM.Endpoints.DGEs;
|
||||
|
||||
|
||||
namespace PepperDash.Essentials
|
||||
{
|
||||
public class UiDeviceFactory
|
||||
{
|
||||
public static IKeyed GetUiDevice(DeviceConfig config)
|
||||
{
|
||||
var comm = CommFactory.GetControlPropertiesConfig(config);
|
||||
|
||||
var typeName = config.Type.ToLower();
|
||||
|
||||
EssentialsTouchpanelController panelController = null;
|
||||
|
||||
var props = JsonConvert.DeserializeObject<CrestronTouchpanelPropertiesConfig>(config.Properties.ToString());
|
||||
|
||||
if (typeName.Contains("dge"))
|
||||
{
|
||||
Dge100 dgeDevice = null;
|
||||
if (typeName == "dge100")
|
||||
dgeDevice = new Dge100(comm.IpIdInt, Global.ControlSystem);
|
||||
else if (typeName == "dmdge200c")
|
||||
dgeDevice = new DmDge200C(comm.IpIdInt, Global.ControlSystem);
|
||||
|
||||
if (dgeDevice == null)
|
||||
{
|
||||
Debug.Console(1, "Unable to create DGE device");
|
||||
return null;
|
||||
}
|
||||
|
||||
var dgeController = new DgeController(config.Key + "-comPorts", config.Name, dgeDevice, config, props);
|
||||
|
||||
DeviceManager.AddDevice(dgeController);
|
||||
|
||||
panelController = new EssentialsTouchpanelController(config.Key, config.Name, dgeController.DigitalGraphicsEngine,
|
||||
props.ProjectName, props.SgdFile);
|
||||
}
|
||||
else
|
||||
{
|
||||
panelController = new EssentialsTouchpanelController(config.Key, config.Name, config.Type, props, comm.IpIdInt);
|
||||
}
|
||||
|
||||
panelController.AddPostActivationAction(() =>
|
||||
{
|
||||
var mainDriver = new EssentialsPanelMainInterfaceDriver(panelController.Panel, props);
|
||||
// Then the sub drivers
|
||||
|
||||
// spin up different room drivers depending on room type
|
||||
var room = DeviceManager.GetDeviceForKey(props.DefaultRoomKey);
|
||||
if (room is EssentialsHuddleSpaceRoom)
|
||||
{
|
||||
|
||||
// Header Driver
|
||||
Debug.Console(0, panelController, "Adding header driver");
|
||||
mainDriver.HeaderDriver = new EssentialsHeaderDriver(mainDriver, props);
|
||||
|
||||
// AV Driver
|
||||
Debug.Console(0, panelController, "Adding huddle space AV driver");
|
||||
var avDriver = new EssentialsHuddlePanelAvFunctionsDriver(mainDriver, props);
|
||||
avDriver.DefaultRoomKey = props.DefaultRoomKey;
|
||||
mainDriver.AvDriver = avDriver;
|
||||
avDriver.CurrentRoom = room as EssentialsHuddleSpaceRoom;
|
||||
|
||||
// Environment Driver
|
||||
if (avDriver.CurrentRoom.PropertiesConfig.Environment != null && avDriver.CurrentRoom.PropertiesConfig.Environment.DeviceKeys.Count > 0)
|
||||
{
|
||||
Debug.Console(0, panelController, "Adding environment driver");
|
||||
mainDriver.EnvironmentDriver = new EssentialsEnvironmentDriver(mainDriver, props);
|
||||
|
||||
mainDriver.EnvironmentDriver.GetDevicesFromConfig(avDriver.CurrentRoom.PropertiesConfig.Environment);
|
||||
}
|
||||
|
||||
mainDriver.HeaderDriver.SetupHeaderButtons(avDriver, avDriver.CurrentRoom);
|
||||
|
||||
panelController.LoadAndShowDriver(mainDriver); // This is a little convoluted.
|
||||
|
||||
if (panelController.Panel is TswFt5ButtonSystem)
|
||||
{
|
||||
var tsw = panelController.Panel as TswFt5ButtonSystem;
|
||||
// Wire up hard keys
|
||||
tsw.Power.UserObject = new Action<bool>(b => { if (!b) avDriver.PowerButtonPressed(); });
|
||||
//tsw.Home.UserObject = new Action<bool>(b => { if (!b) HomePressed(); });
|
||||
if(mainDriver.EnvironmentDriver != null)
|
||||
tsw.Lights.UserObject = new Action<bool>(b =>
|
||||
{
|
||||
if (!b)
|
||||
{
|
||||
//mainDriver.AvDriver.PopupInterlock.ShowInterlockedWithToggle(mainDriver.EnvironmentDriver.BackgroundSubpageJoin);
|
||||
mainDriver.EnvironmentDriver.Toggle();
|
||||
}
|
||||
});
|
||||
tsw.Up.UserObject = new Action<bool>(avDriver.VolumeUpPress);
|
||||
tsw.Down.UserObject = new Action<bool>(avDriver.VolumeDownPress);
|
||||
}
|
||||
}
|
||||
//else if (room is EssentialsPresentationRoom)
|
||||
//{
|
||||
// Debug.Console(0, panelController, "Adding presentation room driver");
|
||||
// var avDriver = new EssentialsPresentationPanelAvFunctionsDriver(mainDriver, props);
|
||||
// avDriver.CurrentRoom = room as EssentialsPresentationRoom;
|
||||
// avDriver.DefaultRoomKey = props.DefaultRoomKey;
|
||||
// mainDriver.AvDriver = avDriver ;
|
||||
// mainDriver.HeaderDriver = new EssentialsHeaderDriver(mainDriver, props);
|
||||
// panelController.LoadAndShowDriver(mainDriver);
|
||||
|
||||
// if (panelController.Panel is TswFt5ButtonSystem)
|
||||
// {
|
||||
// var tsw = panelController.Panel as TswFt5ButtonSystem;
|
||||
// // Wire up hard keys
|
||||
// tsw.Power.UserObject = new Action<bool>(b => { if (!b) avDriver.PowerButtonPressed(); });
|
||||
// //tsw.Home.UserObject = new Action<bool>(b => { if (!b) HomePressed(); });
|
||||
// tsw.Up.UserObject = new Action<bool>(avDriver.VolumeUpPress);
|
||||
// tsw.Down.UserObject = new Action<bool>(avDriver.VolumeDownPress);
|
||||
// }
|
||||
//}
|
||||
else if (room is EssentialsHuddleVtc1Room)
|
||||
{
|
||||
Debug.Console(0, panelController, "Adding huddle space VTC AV driver");
|
||||
|
||||
// Header Driver
|
||||
mainDriver.HeaderDriver = new EssentialsHeaderDriver(mainDriver, props);
|
||||
|
||||
// AV Driver
|
||||
var avDriver = new EssentialsHuddleVtc1PanelAvFunctionsDriver(mainDriver, props);
|
||||
|
||||
var codecDriver = new PepperDash.Essentials.UIDrivers.VC.EssentialsVideoCodecUiDriver(panelController.Panel, avDriver,
|
||||
(room as EssentialsHuddleVtc1Room).VideoCodec, mainDriver.HeaderDriver);
|
||||
avDriver.SetVideoCodecDriver(codecDriver);
|
||||
avDriver.DefaultRoomKey = props.DefaultRoomKey;
|
||||
mainDriver.AvDriver = avDriver;
|
||||
avDriver.CurrentRoom = room as EssentialsHuddleVtc1Room;
|
||||
|
||||
// Environment Driver
|
||||
if (avDriver.CurrentRoom.PropertiesConfig.Environment != null && avDriver.CurrentRoom.PropertiesConfig.Environment.DeviceKeys.Count > 0)
|
||||
{
|
||||
Debug.Console(0, panelController, "Adding environment driver");
|
||||
mainDriver.EnvironmentDriver = new EssentialsEnvironmentDriver(mainDriver, props);
|
||||
|
||||
mainDriver.EnvironmentDriver.GetDevicesFromConfig(avDriver.CurrentRoom.PropertiesConfig.Environment);
|
||||
}
|
||||
|
||||
mainDriver.HeaderDriver.SetupHeaderButtons(avDriver, avDriver.CurrentRoom);
|
||||
|
||||
panelController.LoadAndShowDriver(mainDriver); // This is a little convoluted.
|
||||
|
||||
if (panelController.Panel is TswFt5ButtonSystem)
|
||||
{
|
||||
var tsw = panelController.Panel as TswFt5ButtonSystem;
|
||||
// Wire up hard keys
|
||||
tsw.Power.UserObject = new Action<bool>(b => { if (!b) avDriver.EndMeetingPress(); });
|
||||
//tsw.Home.UserObject = new Action<bool>(b => { if (!b) HomePressed(); });
|
||||
if (mainDriver.EnvironmentDriver != null)
|
||||
tsw.Lights.UserObject = new Action<bool>(b =>
|
||||
{
|
||||
if (!b)
|
||||
{
|
||||
//mainDriver.AvDriver.PopupInterlock.ShowInterlockedWithToggle(mainDriver.EnvironmentDriver.BackgroundSubpageJoin);
|
||||
mainDriver.EnvironmentDriver.Toggle();
|
||||
}
|
||||
});
|
||||
tsw.Up.UserObject = new Action<bool>(avDriver.VolumeUpPress);
|
||||
tsw.Down.UserObject = new Action<bool>(avDriver.VolumeDownPress);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Console(0, panelController, "ERROR: Cannot load AvFunctionsDriver for room '{0}'", props.DefaultRoomKey);
|
||||
}
|
||||
});
|
||||
|
||||
return panelController;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -186,7 +186,7 @@ namespace PepperDash.Essentials.Fusion
|
||||
|
||||
|
||||
FusionRoom.SystemPowerOn.OutputSig.SetSigFalseAction((Room as EssentialsHuddleVtc1Room).PowerOnToDefaultOrLastSource);
|
||||
FusionRoom.SystemPowerOff.OutputSig.SetSigFalseAction(() => (Room as EssentialsHuddleVtc1Room).RunRouteAction("roomOff"));
|
||||
FusionRoom.SystemPowerOff.OutputSig.SetSigFalseAction(() => (Room as EssentialsHuddleVtc1Room).RunRouteAction("roomOff", Room.SourceListKey));
|
||||
// NO!! room.RoomIsOn.LinkComplementInputSig(FusionRoom.SystemPowerOff.InputSig);
|
||||
|
||||
|
||||
@@ -342,7 +342,7 @@ namespace PepperDash.Essentials.Fusion
|
||||
|
||||
// Current Source
|
||||
var defaultDisplaySourceNone = FusionRoom.CreateOffsetBoolSig((uint)joinOffset + 8, displayName + "Source None", eSigIoMask.InputOutputSig);
|
||||
defaultDisplaySourceNone.OutputSig.UserObject = new Action<bool>(b => { if (!b) (Room as EssentialsHuddleVtc1Room).RunRouteAction("roomOff"); }); ;
|
||||
defaultDisplaySourceNone.OutputSig.UserObject = new Action<bool>(b => { if (!b) (Room as EssentialsHuddleVtc1Room).RunRouteAction("roomOff", Room.SourceListKey); }); ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,266 +0,0 @@
|
||||
//using System;
|
||||
//using System.Collections.Generic;
|
||||
//using System.Linq;
|
||||
//using System.Text;
|
||||
//using Crestron.SimplSharp;
|
||||
//using Crestron.SimplSharp.CrestronIO;
|
||||
//using Crestron.SimplSharp.Net.Http;
|
||||
|
||||
//using Newtonsoft.Json;
|
||||
//using Newtonsoft.Json.Linq;
|
||||
|
||||
//using PepperDash.Essentials.Core;
|
||||
//using PepperDash.Essentials.Core.Http;
|
||||
//using PepperDash.Core;
|
||||
|
||||
//namespace PepperDash.Essentials
|
||||
//{
|
||||
// public class EssentialsHttpApiHandler
|
||||
// {
|
||||
// string ConfigPath;
|
||||
// string PresetsPathPrefix;
|
||||
// EssentialsHttpServer Server;
|
||||
|
||||
// /// <summary>
|
||||
// ///
|
||||
// /// </summary>
|
||||
// /// <param name="server">HTTP server to attach to</param>
|
||||
// /// <param name="configPath">The full path to configuration file</param>
|
||||
// /// <param name="presetsListPath">The folder prefix for the presets path, eq "\HTML\presets\"</param>
|
||||
// public EssentialsHttpApiHandler(EssentialsHttpServer server, string configPath, string presetsPathPrefix)
|
||||
// {
|
||||
// if (server == null) throw new ArgumentNullException("server");
|
||||
// Server = server;
|
||||
// ConfigPath = configPath;
|
||||
// PresetsPathPrefix = presetsPathPrefix;
|
||||
// server.ApiRequest += Server_ApiRequest;
|
||||
// }
|
||||
|
||||
|
||||
// void Server_ApiRequest(object sender, Crestron.SimplSharp.Net.Http.OnHttpRequestArgs args)
|
||||
// {
|
||||
// try
|
||||
// {
|
||||
// var path = args.Request.Path.ToLower();
|
||||
|
||||
// if (path == "/api/config")
|
||||
// HandleApiConfig(args);
|
||||
// else if (path.StartsWith("/api/presetslist/"))
|
||||
// HandleApiPresetsList(args);
|
||||
// else if (path == "/api/presetslists")
|
||||
// HandleApiGetPresetsLists(args.Request, args.Response);
|
||||
// else
|
||||
// {
|
||||
// args.Response.Code = 404;
|
||||
// return;
|
||||
// }
|
||||
// args.Response.Header.SetHeaderValue("Access-Control-Allow-Origin", "*");
|
||||
// args.Response.Header.SetHeaderValue("Access-Control-Allow-Methods", "GET, POST, PATCH, PUT, DELETE, OPTIONS");
|
||||
// }
|
||||
// catch (Exception e)
|
||||
// {
|
||||
// Debug.Console(1, "Uncaught HTTP server error: \n{0}", e);
|
||||
// args.Response.Code = 500;
|
||||
// }
|
||||
// }
|
||||
|
||||
// /// <summary>
|
||||
// /// GET will return the running configuration. POST will attempt to take in a new config
|
||||
// /// and restart the program.
|
||||
// /// </summary>
|
||||
// void HandleApiConfig(OnHttpRequestArgs args)
|
||||
// {
|
||||
// var request = args.Request;
|
||||
// if (request.Header.RequestType == "GET")
|
||||
// {
|
||||
// if (File.Exists(ConfigPath))
|
||||
// {
|
||||
// Debug.Console(2, "Sending config:{0}", ConfigPath);
|
||||
// args.Response.Header.ContentType = EssentialsHttpServer.GetContentType(new FileInfo(ConfigPath).Extension);
|
||||
// args.Response.ContentStream = new FileStream(ConfigPath, FileMode.Open, FileAccess.Read);
|
||||
// }
|
||||
// }
|
||||
// else if (request.Header.RequestType == "POST")
|
||||
// {
|
||||
// Debug.Console(2, "Post type: '{0}'", request.Header.ContentType);
|
||||
|
||||
// // Make sure we're receiving at least good json
|
||||
// Debug.Console(1, "Receving new config");
|
||||
// if (GetContentStringJson(args) == null)
|
||||
// return;
|
||||
|
||||
// //---------------------------- try to move these into common method
|
||||
// // Move current file aside
|
||||
// var bakPath = ConfigPath + ".bak";
|
||||
// if (File.Exists(bakPath))
|
||||
// File.Delete(bakPath);
|
||||
// File.Move(ConfigPath, bakPath);
|
||||
|
||||
// // Write the file
|
||||
// using (FileStream fs = File.Open(ConfigPath, FileMode.OpenOrCreate))
|
||||
// using (StreamWriter sw = new StreamWriter(fs))
|
||||
// {
|
||||
// try
|
||||
// {
|
||||
// sw.Write(args.Request.ContentString);
|
||||
// }
|
||||
// catch (Exception e)
|
||||
// {
|
||||
// string err = string.Format("Error writing received config file:\r{0}", e);
|
||||
// CrestronConsole.PrintLine(err);
|
||||
// ErrorLog.Warn(err);
|
||||
// // Put file back
|
||||
// File.Move(ConfigPath + ".bak", ConfigPath);
|
||||
// args.Response.Code = 500;
|
||||
// return;
|
||||
// }
|
||||
// }
|
||||
|
||||
// // If client says "yeah, restart" and has a good token
|
||||
// // Restart program
|
||||
// string consoleResponse = null;
|
||||
// var restart = CrestronConsole.SendControlSystemCommand("progreset -p:" +
|
||||
// InitialParametersClass.ApplicationNumber, ref consoleResponse);
|
||||
// if (!restart) Debug.Console(0, "CAN'T DO THAT YO: {0}", consoleResponse);
|
||||
// }
|
||||
// }
|
||||
|
||||
// void HandleApiPresetsList(OnHttpRequestArgs args)
|
||||
// {
|
||||
// var listPath = PresetsPathPrefix + args.Request.Path.Remove(0, 17);
|
||||
// Debug.Console(2, "Checking for preset list '{0}'", listPath);
|
||||
|
||||
// if (args.Request.Header.RequestType == "GET")
|
||||
// {
|
||||
// if (File.Exists(listPath))
|
||||
// {
|
||||
// Debug.Console(2, "Sending presets file:{0}", listPath);
|
||||
// args.Response.Header.ContentType = EssentialsHttpServer.GetContentType(new FileInfo(listPath).Extension);
|
||||
// args.Response.ContentStream = new FileStream(listPath, FileMode.Open, FileAccess.Read);
|
||||
// }
|
||||
// }
|
||||
// else if (args.Request.Header.RequestType == "POST")
|
||||
// {
|
||||
// // Make sure we're receiving at least good json
|
||||
// Debug.Console(1, "Receving new presets");
|
||||
// if (GetContentStringJson(args) == null)
|
||||
// return;
|
||||
|
||||
// //---------------------------- try to move these into common method
|
||||
// // Move current file aside
|
||||
// var bakPath = listPath + ".new";
|
||||
// Debug.Console(2, "Moving presets file to {0}", bakPath);
|
||||
// if(File.Exists(bakPath))
|
||||
// File.Delete(bakPath);
|
||||
// File.Move(listPath, bakPath);
|
||||
|
||||
// Debug.Console(2, "Writing new file");
|
||||
// // Write the file
|
||||
// using (FileStream fs = File.OpenWrite(listPath))
|
||||
// using (StreamWriter sw = new StreamWriter(fs))
|
||||
// {
|
||||
// try
|
||||
// {
|
||||
// Debug.Console(2, "Writing {1}, {0} bytes", args.Request.ContentString.Length, listPath);
|
||||
// sw.Write(args.Request.ContentString);
|
||||
// }
|
||||
// catch (Exception e)
|
||||
// {
|
||||
// string err = string.Format("Error writing received presets file:\r{0}", e);
|
||||
// CrestronConsole.PrintLine(err);
|
||||
// ErrorLog.Warn(err);
|
||||
// // Put file back
|
||||
// File.Move(listPath + ".bak", listPath);
|
||||
// args.Response.Code = 500;
|
||||
// return;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
// void HandleApiGetPresetsLists(HttpServerRequest request, HttpServerResponse response)
|
||||
// {
|
||||
// if (request.Header.RequestType != "GET")
|
||||
// {
|
||||
// response.Code = 404; // This should be a 405 with an allow header
|
||||
// return;
|
||||
// }
|
||||
|
||||
// if (Directory.Exists(PresetsPathPrefix))
|
||||
// {
|
||||
// //CrestronConsole.PrintLine("Parsing presets directory");
|
||||
// List<string> files = Directory.GetFiles(PresetsPathPrefix, "*.json")
|
||||
// .ToList().Select(f => Path.GetFileName(f)).ToList();
|
||||
// if (files.Count > 0)
|
||||
// files.Sort();
|
||||
// var json = JsonConvert.SerializeObject(files);
|
||||
// response.Header.ContentType = "application/json";
|
||||
// response.ContentString = json;
|
||||
// }
|
||||
|
||||
// // //CrestronConsole.PrintLine("Found {0} files", files.Count);
|
||||
// // JObject jo = new JObject();
|
||||
// // JArray ja = new JArray();
|
||||
|
||||
// // foreach (var filename in files)
|
||||
// // {
|
||||
// // try
|
||||
// // {
|
||||
// // using (StreamReader sr = new StreamReader(filename))
|
||||
// // {
|
||||
// // JObject tempJo = JObject.Parse(sr.ReadToEnd());
|
||||
// // if (tempJo.Value<string>("content").Equals("presetsList"))
|
||||
// // {
|
||||
// // var jItem = new JObject(); // make a new object
|
||||
// // jItem.Add("Name", tempJo["name"]);
|
||||
// // jItem.Add("File", filename);
|
||||
// // jItem.Add("Url", Uri.EscapeUriString(new Uri(
|
||||
// // filename.Replace("\\html", "")
|
||||
// // .Replace("\\HTML", "")
|
||||
// // .Replace('\\', '/'), UriKind.Relative).ToString()));
|
||||
// // ja.Add(jItem); // add to array
|
||||
// // }
|
||||
// // else
|
||||
// // CrestronConsole.PrintLine("Cannot use presets file '{0}'", filename);
|
||||
// // }
|
||||
// // }
|
||||
// // catch
|
||||
// // {
|
||||
// // // ignore failures - maybe delete them
|
||||
// // CrestronConsole.PrintLine("Unable to read presets file '{0}'", filename);
|
||||
// // }
|
||||
// // }
|
||||
// // jo.Add("PresetChannelLists", ja);
|
||||
// // //CrestronConsole.PrintLine(jo.ToString());
|
||||
// // response.Header.ContentType = "application/json";
|
||||
// // response.ContentString = jo.ToString();
|
||||
// //}
|
||||
// //else
|
||||
// // CrestronConsole.PrintLine("No presets files in directory");
|
||||
// }
|
||||
|
||||
// /// <summary>
|
||||
// /// Simply does what it says
|
||||
// /// </summary>
|
||||
// JObject GetContentStringJson(OnHttpRequestArgs args)
|
||||
// {
|
||||
// //var content = args.Request.ContentString;
|
||||
// //Debug.Console(1, "{0}", content);
|
||||
|
||||
// try
|
||||
// {
|
||||
// // just see if it parses properly
|
||||
// return JObject.Parse(args.Request.ContentString);
|
||||
// }
|
||||
// catch (Exception e)
|
||||
// {
|
||||
// string err = string.Format("JSON Error reading config file:\r{0}", e);
|
||||
// CrestronConsole.PrintLine(err);
|
||||
// ErrorLog.Warn(err);
|
||||
// args.Response.Code = 400; // Bad request
|
||||
// return null;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
@@ -7,7 +7,7 @@
|
||||
<ProjectGuid>{1BED5BA9-88C4-4365-9362-6F4B128071D3}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>PepperDash.Essentials</RootNamespace>
|
||||
<RootNamespace>PepperDashEssentials</RootNamespace>
|
||||
<AssemblyName>PepperDashEssentials</AssemblyName>
|
||||
<ProjectTypeGuids>{0B4745B0-194B-4BB6-8E21-E9057CA92230};{4D628B5B-2FBC-4AA6-8C16-197242AEB884};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<PlatformFamilyName>WindowsCE</PlatformFamilyName>
|
||||
@@ -108,40 +108,31 @@
|
||||
<Reference Include="System.Data" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="AppServer\Messengers\CameraBaseMessenger.cs" />
|
||||
<Compile Include="AppServer\Messengers\ConfigMessenger.cs" />
|
||||
<Compile Include="AppServer\Messengers\Ddvc01AtcMessenger.cs" />
|
||||
<Compile Include="AppServer\Messengers\SIMPLAtcMessenger.cs" />
|
||||
<Compile Include="AppServer\Messengers\AudioCodecBaseMessenger.cs" />
|
||||
<Compile Include="AppServer\Messengers\Ddvc01VtcMessenger.cs" />
|
||||
<Compile Include="AppServer\Messengers\SIMPLVtcMessenger.cs" />
|
||||
<Compile Include="AppServer\Messengers\IRunRouteActionMessenger.cs" />
|
||||
<Compile Include="AppServer\Messengers\MessengerBase.cs" />
|
||||
<Compile Include="AppServer\Messengers\SIMPLCameraMessenger.cs" />
|
||||
<Compile Include="AppServer\Messengers\SimplMessengerPropertiesConfig.cs" />
|
||||
<Compile Include="AppServer\Messengers\SIMPLRouteMessenger.cs" />
|
||||
<Compile Include="AppServer\Messengers\SystemMonitorMessenger.cs" />
|
||||
<Compile Include="AppServer\Messengers\VideoCodecBaseMessenger.cs" />
|
||||
<Compile Include="AppServer\SIMPLJoinMaps\SIMPLVtcJoinMap.cs" />
|
||||
<Compile Include="AppServer\SIMPLJoinMaps\SIMPLAtcJoinMap.cs" />
|
||||
<Compile Include="AppServer\SIMPLJoinMaps\MobileControlSIMPLRoomJoinMap.cs" />
|
||||
<Compile Include="Audio\EssentialsVolumeLevelConfig.cs" />
|
||||
<Compile Include="Bridges\AppleTvBridge.cs" />
|
||||
<Compile Include="Bridges\BridgeBase.cs" />
|
||||
<Compile Include="Bridges\BridgeFactory.cs" />
|
||||
<Compile Include="Bridges\CameraControllerBridge.cs" />
|
||||
<Compile Include="Bridges\AirMediaControllerBridge.cs" />
|
||||
<Compile Include="Bridges\DmBladeChassisControllerBridge.cs" />
|
||||
<Compile Include="Bridges\JoinMaps\DmBladeChassisControllerJoinMap.cs" />
|
||||
<Compile Include="Bridges\DmpsAudioOutputControllerBridge.cs" />
|
||||
<Compile Include="Bridges\DmpsRoutingControllerBridge.cs" />
|
||||
<Compile Include="Bridges\DisplayControllerBridge.cs" />
|
||||
<Compile Include="Bridges\DigitalLoggerBridge.cs" />
|
||||
<Compile Include="Bridges\DmChassisControllerBridge.cs" />
|
||||
<Compile Include="Bridges\DmTxControllerBridge.cs" />
|
||||
<Compile Include="Bridges\GenericLightingBridge.cs" />
|
||||
<Compile Include="Bridges\GenericRelayDeviceBridge.cs" />
|
||||
<Compile Include="Bridges\GlsOccupancySensorBaseControllerBridge.cs" />
|
||||
<Compile Include="Bridges\HdMdxxxCEControllerBridge.cs" />
|
||||
<Compile Include="Bridges\IBasicCommunicationBridge.cs" />
|
||||
<Compile Include="Bridges\DmRmcControllerBridge.cs" />
|
||||
<Compile Include="Bridges\IBridge.cs" />
|
||||
<Compile Include="Bridges\IDigitalInputBridge.cs" />
|
||||
<Compile Include="Bridges\EiscBridge.cs" />
|
||||
<Compile Include="Bridges\JoinMaps\AirMediaControllerJoinMap.cs" />
|
||||
<Compile Include="Bridges\JoinMaps\AppleTvJoinMap.cs" />
|
||||
<Compile Include="Bridges\BridgeFactory.cs" />
|
||||
<Compile Include="Bridges\JoinMaps\C2nRthsControllerJoinMap.cs" />
|
||||
<Compile Include="Bridges\JoinMaps\CameraControllerJoinMap.cs" />
|
||||
<Compile Include="Bridges\JoinMaps\DigitalLoggerJoinMap.cs" />
|
||||
<Compile Include="Bridges\JoinMaps\DisplayControllerJoinMap.cs" />
|
||||
<Compile Include="Bridges\JoinMaps\DmBladeChassisControllerJoinMap.cs" />
|
||||
<Compile Include="Bridges\JoinMaps\DmChassisControllerJoinMap.cs" />
|
||||
<Compile Include="Bridges\JoinMaps\DmpsAudioOutputControllerJoinMap.cs" />
|
||||
<Compile Include="Bridges\JoinMaps\DmpsRoutingControllerJoinMap.cs" />
|
||||
@@ -149,30 +140,18 @@
|
||||
<Compile Include="Bridges\JoinMaps\DmTxControllerJoinMap.cs" />
|
||||
<Compile Include="Bridges\JoinMaps\GenericLightingJoinMap.cs" />
|
||||
<Compile Include="Bridges\JoinMaps\GenericRelayControllerJoinMap.cs" />
|
||||
<Compile Include="Bridges\JoinMaps\GlsOccupancySensorBaseJoinMap.cs" />
|
||||
<Compile Include="Bridges\JoinMaps\HdMdxxxCEControllerJoinMap.cs" />
|
||||
<Compile Include="Bridges\JoinMaps\IBasicCommunicationJoinMap.cs" />
|
||||
<Compile Include="Bridges\IBridge.cs" />
|
||||
<Compile Include="Bridges\JoinMaps\IDigitalInputJoinMap.cs" />
|
||||
<Compile Include="Bridges\JoinMaps\GlsOccupancySensorBaseJoinMap.cs" />
|
||||
<Compile Include="Bridges\JoinMaps\SetTopBoxControllerJoinMap.cs" />
|
||||
<Compile Include="Bridges\JoinMaps\StatusSignControllerJoinMap.cs" />
|
||||
<Compile Include="Bridges\JoinMaps\SystemMonitorJoinMap.cs" />
|
||||
<Compile Include="Bridges\SystemMonitorBridge.cs" />
|
||||
<Compile Include="Configuration ORIGINAL\Builders\TPConfig.cs" />
|
||||
<Compile Include="Configuration ORIGINAL\Configuration.cs" />
|
||||
<Compile Include="Configuration ORIGINAL\ConfigurationHelpers.cs" />
|
||||
<Compile Include="Configuration ORIGINAL\ConfigTieLine.cs" />
|
||||
<Compile Include="Configuration ORIGINAL\Factories\CommFactory.cs" />
|
||||
<Compile Include="Configuration ORIGINAL\Factories\RemoteFactory.cs" />
|
||||
<Compile Include="Configuration ORIGINAL\Factories\DeviceMonitorFactory.cs" />
|
||||
<Compile Include="Configuration ORIGINAL\Factories\DmFactory.cs" />
|
||||
<Compile Include="Configuration ORIGINAL\Factories\TouchpanelFactory.cs" />
|
||||
<Compile Include="Configuration ORIGINAL\Factories\PcFactory.cs" />
|
||||
<Compile Include="Configuration ORIGINAL\Factories\DisplayFactory.cs" />
|
||||
<Compile Include="Configuration ORIGINAL\Factories\FactoryHelper.cs" />
|
||||
<Compile Include="Factory\DeviceFactory.cs" />
|
||||
<Compile Include="Devices\Amplifier.cs" />
|
||||
<Compile Include="ControlSystem.cs" />
|
||||
<Compile Include="Factory\UiDeviceFactory.cs" />
|
||||
<Compile Include="Fusion\EssentialsHuddleVtc1FusionController.cs" />
|
||||
<Compile Include="HttpApiHandler.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Room\Config\EssentialsDualDisplayRoomPropertiesConfig.cs" />
|
||||
<Compile Include="Room\Config\EssentialsNDisplayRoomPropertiesConfig.cs" />
|
||||
@@ -185,7 +164,7 @@
|
||||
<Compile Include="AppServer\MobileControlDdvc01DeviceBridge.cs" />
|
||||
<Compile Include="AppServer\Interfaces.cs" />
|
||||
<Compile Include="AppServer\RoomBridges\MobileControlBridgeBase.cs" />
|
||||
<Compile Include="AppServer\RoomBridges\MobileControlDdvc01RoomBridge.cs" />
|
||||
<Compile Include="AppServer\RoomBridges\MobileControlSIMPLRoomBridge.cs" />
|
||||
<Compile Include="AppServer\RoomBridges\MobileControlEssentialsHuddleSpaceRoomBridge.cs" />
|
||||
<Compile Include="AppServer\DeviceTypeInterfaces\IChannelExtensions.cs" />
|
||||
<Compile Include="AppServer\DeviceTypeInterfaces\IColorExtensions.cs" />
|
||||
@@ -201,7 +180,6 @@
|
||||
<Compile Include="Room\Types\EssentialsDualDisplayRoom.cs" />
|
||||
<Compile Include="Room\Types\EssentialsHuddleVtc1Room.cs" />
|
||||
<Compile Include="Room\Types\EssentialsNDisplayRoomBase.cs" />
|
||||
<Compile Include="Room\Types\EssentialsPresentationRoom.cs" />
|
||||
<Compile Include="Room\Config\EssentialsRoomConfig.cs" />
|
||||
<Compile Include="UIDrivers\Environment Drivers\EssentialsEnvironmentDriver.cs" />
|
||||
<Compile Include="UIDrivers\Environment Drivers\EssentialsLightingDriver.cs" />
|
||||
@@ -236,6 +214,18 @@
|
||||
<Compile Include="UI\EssentialsTouchpanelController.cs" />
|
||||
<Compile Include="UI\SubpageReferenceListSourceItem.cs" />
|
||||
<None Include="app.config" />
|
||||
<EmbeddedResource Include="Example Configuration\EssentialsHuddleSpaceRoom\configurationFile-HuddleSpace-2-Source.json">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Example Configuration\EssentialsHuddleVtc1Room\configurationFile-mockVideoCodec_din-ap3_-_dm4x1.json">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Example Configuration\SIMPLBridging\configurationFile-dmps3300c-avRouting.json">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Example Configuration\SIMPLBridging\SIMPLBridgeExample_configurationFile.json">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</EmbeddedResource>
|
||||
<None Include="Properties\ControlSystem.cfg" />
|
||||
<EmbeddedResource Include="SGD\PepperDash Essentials iPad.sgd">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user