mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-01-12 03:54:51 +00:00
Compare commits
713 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5ef7882955 | ||
|
|
3992aba843 | ||
|
|
b689a54936 | ||
|
|
1046672386 | ||
|
|
5853dd6617 | ||
|
|
a0ef356bac | ||
|
|
486d6db7d8 | ||
|
|
81d9261a73 | ||
|
|
2ace6ef6bc | ||
|
|
cc6d94b188 | ||
|
|
0525f76b6b | ||
|
|
345442e195 | ||
|
|
e94e8b60a6 | ||
|
|
4f4c8cba04 | ||
|
|
0a38442ac5 | ||
|
|
083a3662e0 | ||
|
|
37e1e50b94 | ||
|
|
862610b17d | ||
|
|
7bfc82c3cc | ||
|
|
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 | ||
|
|
62ca5f6f07 | ||
|
|
f7aaf7a576 | ||
|
|
59590e5463 | ||
|
|
d2b8d38000 | ||
|
|
48da139b2f | ||
|
|
32a548b8fb | ||
|
|
0724ec06eb | ||
|
|
f000097a03 | ||
|
|
22c769ab98 | ||
|
|
6377b1bc78 | ||
|
|
2b3921ce8a | ||
|
|
df6bd2a21f | ||
|
|
8d3b409ec3 | ||
|
|
9eb48acd6a | ||
|
|
4361fe6186 | ||
|
|
09bc84346d | ||
|
|
00e3e6af35 | ||
|
|
61f24321c3 | ||
|
|
8f530aa7fe | ||
|
|
36cd356bc5 | ||
|
|
b72f55228a | ||
|
|
7f87b083cb | ||
|
|
eef5c41dfe | ||
|
|
1017464980 | ||
|
|
47f4d90c5a | ||
|
|
c3dbd41942 | ||
|
|
45788a4d6b | ||
|
|
d63787bc78 | ||
|
|
d269a04bab | ||
|
|
dd1b15edee | ||
|
|
1a44d28adb | ||
|
|
e218f13d45 | ||
|
|
cc5889385e | ||
|
|
fe14d543d6 | ||
|
|
df92bdac8e | ||
|
|
51ece9daff | ||
|
|
08d6090bc5 | ||
|
|
96cd5cfe81 | ||
|
|
9a4af1703b | ||
|
|
5987b5b078 | ||
|
|
0d854270b6 | ||
|
|
531f93040a | ||
|
|
5fc93ca251 | ||
|
|
16d5795267 | ||
|
|
c54351f8ee | ||
|
|
5819ac78ec | ||
|
|
ebc50f0caa | ||
|
|
85f28498c4 | ||
|
|
df192895a1 | ||
|
|
e74d8c2497 | ||
|
|
042c94e6cf | ||
|
|
0ed613de73 | ||
|
|
bd4bb24945 | ||
|
|
10104e2a09 | ||
|
|
c99ba9ca1d | ||
|
|
74de1c2475 | ||
|
|
ce247b8e8a | ||
|
|
8e0262e1c3 | ||
|
|
f2e2166146 | ||
|
|
b07e85c4e7 | ||
|
|
3e9b67a1ad | ||
|
|
3b84c0e3db | ||
|
|
89db680986 | ||
|
|
11a01c707c | ||
|
|
db08b1fcd9 | ||
|
|
9c0440e8f0 | ||
|
|
2173116664 | ||
|
|
419d956a8d | ||
|
|
f44bde2d83 | ||
|
|
6c7bc1a24e | ||
|
|
af62bf86a5 | ||
|
|
905c40dc0a | ||
|
|
492d8f8203 | ||
|
|
dd7408dbf1 | ||
|
|
52c387081c | ||
|
|
84374a8af0 | ||
|
|
c0b59c375e | ||
|
|
0eb6411dd9 | ||
|
|
405677a3df | ||
|
|
a1de8e2edd | ||
|
|
841cc1a5e4 | ||
|
|
130bac79f3 | ||
|
|
1a9546c970 | ||
|
|
89f6300d14 | ||
|
|
2012f55735 | ||
|
|
ed468add2c | ||
|
|
c22e95cad2 | ||
|
|
59b2e9a8d6 | ||
|
|
13132c29fc | ||
|
|
407a354cfe | ||
|
|
2fe1ac0e75 | ||
|
|
fcfec55b20 | ||
|
|
ae87498c0b | ||
|
|
5b05e8bb48 | ||
|
|
96d48c9d56 | ||
|
|
d21f6798fd | ||
|
|
ac93081278 | ||
|
|
690ba92773 | ||
|
|
115745467a | ||
|
|
0bb107f5ef | ||
|
|
3887a07d55 | ||
|
|
da832a7da1 | ||
|
|
0e80c6f54d | ||
|
|
c7b813447c | ||
|
|
1257dde4ce | ||
|
|
af7d97efef | ||
|
|
ce782c1cd3 | ||
|
|
f93287641f | ||
|
|
d2e9c2e238 | ||
|
|
4b926c10f6 | ||
|
|
7e9256187a | ||
|
|
061d95e2b1 | ||
|
|
78fe799afc | ||
|
|
596b8bf29a | ||
|
|
87de4a4bf0 | ||
|
|
52343ddf7b | ||
|
|
854c2bcb6f | ||
|
|
0b9ed462b4 | ||
|
|
4dafa34b2e | ||
|
|
f1611da74c | ||
|
|
d588757eb6 | ||
|
|
5bb5c9e07f | ||
|
|
176c9d9835 | ||
|
|
6726e989a7 | ||
|
|
77fbee78a8 | ||
|
|
172e2fb744 | ||
|
|
f2b2825220 | ||
|
|
1b832409e4 | ||
|
|
969ba3c87c | ||
|
|
d93a563cd8 | ||
|
|
63f81456e8 | ||
|
|
764d8d2b48 | ||
|
|
1ae6069ac2 | ||
|
|
7eccc82541 | ||
|
|
b2dbd3c377 | ||
|
|
47e47ec272 | ||
|
|
c392ac6b06 | ||
|
|
af2fe7e54e | ||
|
|
3f68a84fe8 | ||
|
|
5d93a5177c | ||
|
|
f83a7aecf2 | ||
|
|
6b21b37aef | ||
|
|
b1459da2ba | ||
|
|
82e2f1e959 | ||
|
|
c329e31802 | ||
|
|
2b9615ad94 | ||
|
|
71098ca65d | ||
|
|
b917ff980a | ||
|
|
c3c9c584ae | ||
|
|
b6f6c72c92 | ||
|
|
59b2995a1b | ||
|
|
bdf3e2054f | ||
|
|
1acb3a20c5 | ||
|
|
2c98fc4545 | ||
|
|
05c9dd3c69 | ||
|
|
5de8b703dd | ||
|
|
a3887510df | ||
|
|
dc8d0e25d5 | ||
|
|
028e411ffe | ||
|
|
5aed3c4480 | ||
|
|
ddfd1d0586 | ||
|
|
77d5438063 | ||
|
|
42a79f0e1e | ||
|
|
f8a6ef8c41 | ||
|
|
af1489d511 | ||
|
|
aa2b5b9ab4 | ||
|
|
fd2fe8fa6e | ||
|
|
15c6da43eb | ||
|
|
6725266ad9 | ||
|
|
8f564a82d4 | ||
|
|
6f6ff28784 | ||
|
|
0a0bfc018d | ||
|
|
bd5a69a83c | ||
|
|
48c6bb78bc | ||
|
|
2cd68d40dc | ||
|
|
43281f0db6 | ||
|
|
fa141c6207 | ||
|
|
07d6fcef1c | ||
|
|
a5ea9bb1eb | ||
|
|
90c122d966 | ||
|
|
634b07dc12 | ||
|
|
699900518a | ||
|
|
ea2d573ab3 | ||
|
|
5c923e66ec | ||
|
|
7958c64e67 | ||
|
|
410ffd2f19 | ||
|
|
53e0599e2a | ||
|
|
af12a81c00 | ||
|
|
2a9e7c81eb | ||
|
|
c15adea02e | ||
|
|
935f2c4bf4 | ||
|
|
327a9a5f6b | ||
|
|
b7ed1d8238 | ||
|
|
aff4e5a61f | ||
|
|
fe172098b9 | ||
|
|
f2c2cd423d | ||
|
|
22722fca21 | ||
|
|
6efec400b8 | ||
|
|
f82816729b | ||
|
|
1b599ff863 | ||
|
|
ae23e48fd0 | ||
|
|
a8f1f77d48 | ||
|
|
68064c7194 | ||
|
|
3ceecd3fbe | ||
|
|
8585977f71 | ||
|
|
288c9bb04c | ||
|
|
47fb805766 | ||
|
|
31b0683cdf | ||
|
|
04194da31c | ||
|
|
09bdc49c15 | ||
|
|
e36b2b97d2 | ||
|
|
d705525a45 | ||
|
|
ecce6e2be9 | ||
|
|
95c0f57000 | ||
|
|
697b9109a3 | ||
|
|
727367c061 | ||
|
|
f26ff0b767 | ||
|
|
44b72dcfe5 | ||
|
|
937f3f3dc0 | ||
|
|
17bf6e3f0a | ||
|
|
e7253b4acc | ||
|
|
71a27027e7 | ||
|
|
2655b8f7b8 | ||
|
|
3adee8bc30 | ||
|
|
e3a3a2cd2d | ||
|
|
6235b44d89 | ||
|
|
90bbd65fdc | ||
|
|
43fd263ea1 | ||
|
|
038e23289e | ||
|
|
2121456d50 | ||
|
|
3a99c3bb30 | ||
|
|
52ac57c080 | ||
|
|
84ee743ff5 | ||
|
|
24fb74701a | ||
|
|
1c9aa1eaf6 | ||
|
|
7c88843f50 | ||
|
|
7a3ce5fcf1 | ||
|
|
3049e5a041 | ||
|
|
59234274dc | ||
|
|
120dae2e63 | ||
|
|
e4317825d3 | ||
|
|
bf6971a52d | ||
|
|
ef0a8dd3b9 | ||
|
|
ca42d744cf | ||
|
|
ffa4de49e9 | ||
|
|
3c5c157a70 | ||
|
|
8ef58359e7 | ||
|
|
530e1ebcb8 | ||
|
|
8d03bef34f | ||
|
|
a870418f96 | ||
|
|
37e2dfd11f | ||
|
|
47675f12b4 |
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 ./
|
||||
6
.gitignore
vendored
6
.gitignore
vendored
@@ -20,4 +20,8 @@ obj/
|
||||
[Rr]elease*/
|
||||
_ReSharper*/
|
||||
SIMPLSharpLogs/
|
||||
*.projectinfo
|
||||
*.projectinfo
|
||||
essentials-framework/EssentialDMTestConfig/
|
||||
output/
|
||||
|
||||
PepperDashEssentials-0.0.0-buildType-test.zip
|
||||
|
||||
9
.gitmodules
vendored
9
.gitmodules
vendored
@@ -1,3 +1,6 @@
|
||||
[submodule "essentials-framework"]
|
||||
path = essentials-framework
|
||||
url = https://bitbucket.org/Pepperdash_Products/essentials-framework.git
|
||||
[submodule "essentials-framework/pepperdashcore-builds"]
|
||||
path = essentials-framework/pepperdashcore-builds
|
||||
url = https://github.com/ndorin/PepperDashCore-Builds.git
|
||||
[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
BIN
IR Drivers/samsung_un_series.ir
Normal file
BIN
IR Drivers/samsung_un_series.ir
Normal file
Binary file not shown.
7
LICENSE.md
Normal file
7
LICENSE.md
Normal file
@@ -0,0 +1,7 @@
|
||||
Copyright (c) <2020> PepperDash Technology Corporation
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
@@ -1,49 +1,49 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 10.00
|
||||
# Visual Studio 2008
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PepperDashEssentials", ".\PepperDashEssentials\PepperDashEssentials.csproj", "{1BED5BA9-88C4-4365-9362-6F4B128071D3}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{892B761C-E479-44CE-BD74-243E9214AF13} = {892B761C-E479-44CE-BD74-243E9214AF13}
|
||||
{9199CE8A-0C9F-4952-8672-3EED798B284F} = {9199CE8A-0C9F-4952-8672-3EED798B284F}
|
||||
{A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5} = {A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PepperDash_Essentials_Core", ".\essentials-framework\Essentials Core\PepperDashEssentialsBase\PepperDash_Essentials_Core.csproj", "{A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Essentials Devices Common", ".\essentials-framework\Essentials Devices Common\Essentials Devices Common\Essentials Devices Common.csproj", "{892B761C-E479-44CE-BD74-243E9214AF13}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5} = {A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Essentials_DM", ".\essentials-framework\Essentials DM\Essentials_DM\Essentials_DM.csproj", "{9199CE8A-0C9F-4952-8672-3EED798B284F}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5} = {A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{1BED5BA9-88C4-4365-9362-6F4B128071D3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{1BED5BA9-88C4-4365-9362-6F4B128071D3}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{1BED5BA9-88C4-4365-9362-6F4B128071D3}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{1BED5BA9-88C4-4365-9362-6F4B128071D3}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{892B761C-E479-44CE-BD74-243E9214AF13}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{892B761C-E479-44CE-BD74-243E9214AF13}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{892B761C-E479-44CE-BD74-243E9214AF13}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{892B761C-E479-44CE-BD74-243E9214AF13}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{9199CE8A-0C9F-4952-8672-3EED798B284F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{9199CE8A-0C9F-4952-8672-3EED798B284F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{9199CE8A-0C9F-4952-8672-3EED798B284F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{9199CE8A-0C9F-4952-8672-3EED798B284F}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 10.00
|
||||
# Visual Studio 2008
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PepperDashEssentials", "PepperDashEssentials\PepperDashEssentials.csproj", "{1BED5BA9-88C4-4365-9362-6F4B128071D3}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{892B761C-E479-44CE-BD74-243E9214AF13} = {892B761C-E479-44CE-BD74-243E9214AF13}
|
||||
{9199CE8A-0C9F-4952-8672-3EED798B284F} = {9199CE8A-0C9F-4952-8672-3EED798B284F}
|
||||
{A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5} = {A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PepperDash_Essentials_Core", "essentials-framework\Essentials Core\PepperDashEssentialsBase\PepperDash_Essentials_Core.csproj", "{A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Essentials Devices Common", "essentials-framework\Essentials Devices Common\Essentials Devices Common\Essentials Devices Common.csproj", "{892B761C-E479-44CE-BD74-243E9214AF13}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5} = {A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "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
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{1BED5BA9-88C4-4365-9362-6F4B128071D3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{1BED5BA9-88C4-4365-9362-6F4B128071D3}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{1BED5BA9-88C4-4365-9362-6F4B128071D3}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{1BED5BA9-88C4-4365-9362-6F4B128071D3}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{892B761C-E479-44CE-BD74-243E9214AF13}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{892B761C-E479-44CE-BD74-243E9214AF13}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{892B761C-E479-44CE-BD74-243E9214AF13}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{892B761C-E479-44CE-BD74-243E9214AF13}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{9199CE8A-0C9F-4952-8672-3EED798B284F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{9199CE8A-0C9F-4952-8672-3EED798B284F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{9199CE8A-0C9F-4952-8672-3EED798B284F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{9199CE8A-0C9F-4952-8672-3EED798B284F}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
||||
@@ -6,11 +6,11 @@ using Crestron.SimplSharp;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Room.Cotija
|
||||
namespace PepperDash.Essentials.Room.MobileControl
|
||||
{
|
||||
public static class IChannelExtensions
|
||||
{
|
||||
public static void LinkActions(this IChannel dev, CotijaSystemController controller)
|
||||
public static void LinkActions(this IChannel dev, MobileControlSystemController controller)
|
||||
{
|
||||
var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace PepperDash.Essentials.Room.Cotija
|
||||
controller.AddAction(prefix + "exit", new PressAndHoldAction(dev.Exit));
|
||||
}
|
||||
|
||||
public static void UnlinkActions(this IChannel dev, CotijaSystemController controller)
|
||||
public static void UnlinkActions(this IChannel dev, MobileControlSystemController controller)
|
||||
{
|
||||
var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);
|
||||
|
||||
|
||||
@@ -6,11 +6,11 @@ using Crestron.SimplSharp;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Room.Cotija
|
||||
namespace PepperDash.Essentials.Room.MobileControl
|
||||
{
|
||||
public static class IColorExtensions
|
||||
{
|
||||
public static void LinkActions(this IColor dev, CotijaSystemController controller)
|
||||
public static void LinkActions(this IColor dev, MobileControlSystemController controller)
|
||||
{
|
||||
var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace PepperDash.Essentials.Room.Cotija
|
||||
controller.AddAction(prefix + "blue", new PressAndHoldAction(dev.Blue));
|
||||
}
|
||||
|
||||
public static void UnlinkActions(this IColor dev, CotijaSystemController controller)
|
||||
public static void UnlinkActions(this IColor dev, MobileControlSystemController controller)
|
||||
{
|
||||
var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);
|
||||
|
||||
|
||||
@@ -6,11 +6,11 @@ using Crestron.SimplSharp;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Room.Cotija
|
||||
namespace PepperDash.Essentials.Room.MobileControl
|
||||
{
|
||||
public static class IDPadExtensions
|
||||
{
|
||||
public static void LinkActions(this IDPad dev, CotijaSystemController controller)
|
||||
public static void LinkActions(this IDPad dev, MobileControlSystemController controller)
|
||||
{
|
||||
var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace PepperDash.Essentials.Room.Cotija
|
||||
controller.AddAction(prefix + "exit", new PressAndHoldAction(dev.Exit));
|
||||
}
|
||||
|
||||
public static void UnlinkActions(this IDPad dev, CotijaSystemController controller)
|
||||
public static void UnlinkActions(this IDPad dev, MobileControlSystemController controller)
|
||||
{
|
||||
var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);
|
||||
|
||||
|
||||
@@ -6,11 +6,11 @@ using Crestron.SimplSharp;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Room.Cotija
|
||||
namespace PepperDash.Essentials.Room.MobileControl
|
||||
{
|
||||
public static class IDvrExtensions
|
||||
{
|
||||
public static void LinkActions(this IDvr dev, CotijaSystemController controller)
|
||||
public static void LinkActions(this IDvr dev, MobileControlSystemController controller)
|
||||
{
|
||||
var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace PepperDash.Essentials.Room.Cotija
|
||||
controller.AddAction(prefix + "record", new PressAndHoldAction(dev.Record));
|
||||
}
|
||||
|
||||
public static void UnlinkActions(this IDvr dev, CotijaSystemController controller)
|
||||
public static void UnlinkActions(this IDvr dev, MobileControlSystemController controller)
|
||||
{
|
||||
var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);
|
||||
|
||||
|
||||
@@ -6,11 +6,11 @@ using Crestron.SimplSharp;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Room.Cotija
|
||||
namespace PepperDash.Essentials.Room.MobileControl
|
||||
{
|
||||
public static class INumericExtensions
|
||||
{
|
||||
public static void LinkActions(this INumericKeypad dev, CotijaSystemController controller)
|
||||
public static void LinkActions(this INumericKeypad dev, MobileControlSystemController controller)
|
||||
{
|
||||
var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace PepperDash.Essentials.Room.Cotija
|
||||
// Deal with the Accessory functions on the numpad later
|
||||
}
|
||||
|
||||
public static void UnlinkActions(this INumericKeypad dev, CotijaSystemController controller)
|
||||
public static void UnlinkActions(this INumericKeypad dev, MobileControlSystemController controller)
|
||||
{
|
||||
var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);
|
||||
|
||||
|
||||
@@ -6,11 +6,11 @@ using Crestron.SimplSharp;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Room.Cotija
|
||||
namespace PepperDash.Essentials.Room.MobileControl
|
||||
{
|
||||
public static class IPowerExtensions
|
||||
{
|
||||
public static void LinkActions(this IPower dev, CotijaSystemController controller)
|
||||
public static void LinkActions(this IPower dev, MobileControlSystemController controller)
|
||||
{
|
||||
var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace PepperDash.Essentials.Room.Cotija
|
||||
controller.AddAction(prefix + "powerToggle", new Action(dev.PowerToggle));
|
||||
}
|
||||
|
||||
public static void UnlinkActions(this IPower dev, CotijaSystemController controller)
|
||||
public static void UnlinkActions(this IPower dev, MobileControlSystemController controller)
|
||||
{
|
||||
var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);
|
||||
|
||||
|
||||
@@ -6,11 +6,11 @@ using Crestron.SimplSharp;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Room.Cotija
|
||||
namespace PepperDash.Essentials.Room.MobileControl
|
||||
{
|
||||
public static class ISetTopBoxControlsExtensions
|
||||
{
|
||||
public static void LinkActions(this ISetTopBoxControls dev, CotijaSystemController controller)
|
||||
public static void LinkActions(this ISetTopBoxControls dev, MobileControlSystemController controller)
|
||||
{
|
||||
var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace PepperDash.Essentials.Room.Cotija
|
||||
controller.AddAction(prefix + "replay", new PressAndHoldAction(dev.Replay));
|
||||
}
|
||||
|
||||
public static void UnlinkActions(this ISetTopBoxControls dev, CotijaSystemController controller)
|
||||
public static void UnlinkActions(this ISetTopBoxControls dev, MobileControlSystemController controller)
|
||||
{
|
||||
var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);
|
||||
|
||||
|
||||
@@ -6,11 +6,11 @@ using Crestron.SimplSharp;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Room.Cotija
|
||||
namespace PepperDash.Essentials.Room.MobileControl
|
||||
{
|
||||
public static class ITransportExtensions
|
||||
{
|
||||
public static void LinkActions(this ITransport dev, CotijaSystemController controller)
|
||||
public static void LinkActions(this ITransport dev, MobileControlSystemController controller)
|
||||
{
|
||||
var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace PepperDash.Essentials.Room.Cotija
|
||||
controller.AddAction(prefix + "record", new PressAndHoldAction(dev.Record));
|
||||
}
|
||||
|
||||
public static void UnlinkActions(this ITransport dev, CotijaSystemController controller)
|
||||
public static void UnlinkActions(this ITransport dev, MobileControlSystemController controller)
|
||||
{
|
||||
var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ using Crestron.SimplSharp;
|
||||
|
||||
using PepperDash.Essentials.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Room.Cotija
|
||||
namespace PepperDash.Essentials.Room.MobileControl
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a room whose configuration is derived from runtime data,
|
||||
@@ -19,42 +19,3 @@ namespace PepperDash.Essentials.Room.Cotija
|
||||
}
|
||||
}
|
||||
|
||||
namespace PepperDash.Essentials
|
||||
{
|
||||
/// <summary>
|
||||
/// For rooms with a single presentation source, change event
|
||||
/// </summary>
|
||||
public interface IHasCurrentSourceInfoChange
|
||||
{
|
||||
string CurrentSourceInfoKey { get; }
|
||||
SourceListItem CurrentSourceInfo { get; }
|
||||
event SourceInfoChangeHandler CurrentSingleSourceChange;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// For rooms with routing
|
||||
/// </summary>
|
||||
public interface IRunRouteAction
|
||||
{
|
||||
void RunRouteAction(string routeKey);
|
||||
|
||||
void RunRouteAction(string routeKey, Action successCallback);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// For rooms that default presentation only routing
|
||||
/// </summary>
|
||||
public interface IRunDefaultPresentRoute
|
||||
{
|
||||
bool RunDefaultPresentRoute();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// For rooms that have default presentation and calling routes
|
||||
/// </summary>
|
||||
public interface IRunDefaultCallRoute : IRunDefaultPresentRoute
|
||||
{
|
||||
bool RunDefaultCallRoute();
|
||||
}
|
||||
}
|
||||
@@ -1,187 +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;
|
||||
|
||||
const uint BDialHangup = 221;
|
||||
const uint BIncomingAnswer = 251;
|
||||
const uint BIncomingReject = 252;
|
||||
const uint BSpeedDial1 = 241;
|
||||
const uint BSpeedDial2 = 242;
|
||||
const uint BSpeedDial3 = 243;
|
||||
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>
|
||||
///
|
||||
/// </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 },
|
||||
};
|
||||
|
||||
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(CotijaSystemController appServerController)
|
||||
{
|
||||
//EISC.SetStringSigAction(SCurrentDialString, s => PostStatusMessage(new { currentDialString = s }));
|
||||
|
||||
EISC.SetStringSigAction(SHookState, s =>
|
||||
{
|
||||
CurrentCallItem.Status = (eCodecCallStatus)Enum.Parse(typeof(eCodecCallStatus), s, true);
|
||||
//GetCurrentCallList();
|
||||
SendCallsList();
|
||||
});
|
||||
|
||||
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", BDialHangup);
|
||||
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);
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
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 };
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -39,7 +39,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
|
||||
}
|
||||
|
||||
protected override void CustomRegisterWithAppServer(CotijaSystemController appServerController)
|
||||
protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
|
||||
{
|
||||
appServerController.AddAction(MessagePath + "/fullStatus", new Action(SendAtcFullMessageObject));
|
||||
appServerController.AddAction(MessagePath + "/dial", new Action<string>(s => Codec.Dial(s)));
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
75
PepperDashEssentials/AppServer/Messengers/ConfigMessenger.cs
Normal file
75
PepperDashEssentials/AppServer/Messengers/ConfigMessenger.cs
Normal file
@@ -0,0 +1,75 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core.Config;
|
||||
|
||||
namespace PepperDash.Essentials.AppServer.Messengers
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Handles interactions with the app server to update the config
|
||||
/// </summary>
|
||||
public class ConfigMessenger : MessengerBase
|
||||
{
|
||||
public ConfigMessenger(string key, string messagePath)
|
||||
: base(key, messagePath)
|
||||
{
|
||||
ConfigUpdater.ConfigStatusChanged -= ConfigUpdater_ConfigStatusChanged;
|
||||
ConfigUpdater.ConfigStatusChanged += new EventHandler<ConfigStatusEventArgs>(ConfigUpdater_ConfigStatusChanged);
|
||||
}
|
||||
|
||||
void ConfigUpdater_ConfigStatusChanged(object sender, ConfigStatusEventArgs e)
|
||||
{
|
||||
PostUpdateStatus(e.UpdateStatus.ToString());
|
||||
}
|
||||
|
||||
protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
|
||||
{
|
||||
appServerController.AddAction(MessagePath + "/updateConfig", new Action<string>(s => GetConfigFile(s)));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Generates or passes the URL to make the request to GET the config from a server
|
||||
/// </summary>
|
||||
/// <param name="url"></param>
|
||||
void GetConfigFile(string url)
|
||||
{
|
||||
try
|
||||
{
|
||||
// Attempt to parse the URL
|
||||
var parser = new Crestron.SimplSharp.Net.Http.UrlParser(url);
|
||||
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Successfully parsed URL from AppServer message: {0}", parser.Url);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
// If unable to parse the URL, generate it from config data
|
||||
Debug.Console(2, "Error parsing URL: {0}", e);
|
||||
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Unable to parse URL from AppServer message. Generating URL from config data");
|
||||
url = string.Format("http://{0}/api/system/{1}/config", AppServerController.Config.ServerUrl, AppServerController.SystemUuid);
|
||||
}
|
||||
|
||||
ConfigUpdater.GetConfigFromServer(url);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Posts a message with the current status of the config update
|
||||
/// </summary>
|
||||
/// <param name="status"></param>
|
||||
void PostUpdateStatus(string status)
|
||||
{
|
||||
PostStatusMessage(new
|
||||
{
|
||||
updateStatus = status
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -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
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -24,7 +24,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public CotijaSystemController AppServerController { get; private set; }
|
||||
public MobileControlSystemController AppServerController { get; private set; }
|
||||
|
||||
public string MessagePath { get; private set; }
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
/// Registers this messenger with appserver controller
|
||||
/// </summary>
|
||||
/// <param name="appServerController"></param>
|
||||
public void RegisterWithAppServer(CotijaSystemController appServerController)
|
||||
public void RegisterWithAppServer(MobileControlSystemController appServerController)
|
||||
{
|
||||
if (appServerController == null)
|
||||
throw new ArgumentNullException("appServerController");
|
||||
@@ -60,7 +60,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
/// Implemented in extending classes. Wire up API calls and feedback here
|
||||
/// </summary>
|
||||
/// <param name="appServerController"></param>
|
||||
abstract protected void CustomRegisterWithAppServer(CotijaSystemController appServerController);
|
||||
abstract protected void CustomRegisterWithAppServer(MobileControlSystemController appServerController);
|
||||
|
||||
/// <summary>
|
||||
/// Helper for posting status message
|
||||
|
||||
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);
|
||||
@@ -40,8 +34,11 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
/// <param name="e"></param>
|
||||
void ProgramInfoChanged(object sender, ProgramInfoEventArgs e)
|
||||
{
|
||||
Debug.Console(1, "Posting Status Message: {0}", e.ProgramInfo.ToString());
|
||||
PostStatusMessage(e.ProgramInfo);
|
||||
if (e.ProgramInfo != null)
|
||||
{
|
||||
//Debug.Console(1, "Posting Status Message: {0}", e.ProgramInfo.ToString());
|
||||
PostStatusMessage(e.ProgramInfo);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -69,21 +66,18 @@ 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(CotijaSystemController appServerController)
|
||||
protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
|
||||
{
|
||||
AppServerController.AddAction(MessagePath + "/fullStatus", new Action(SendFullStatusMessage));
|
||||
}
|
||||
|
||||
@@ -7,7 +7,10 @@ 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;
|
||||
|
||||
namespace PepperDash.Essentials.AppServer.Messengers
|
||||
@@ -40,6 +43,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
if (dirCodec != null)
|
||||
{
|
||||
dirCodec.DirectoryResultReturned += new EventHandler<DirectoryEventArgs>(dirCodec_DirectoryResultReturned);
|
||||
|
||||
}
|
||||
|
||||
var recCodec = codec as IHasCallHistory;
|
||||
@@ -74,12 +78,73 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
/// <param name="e"></param>
|
||||
void dirCodec_DirectoryResultReturned(object sender, DirectoryEventArgs e)
|
||||
{
|
||||
PostStatusMessage(new
|
||||
{
|
||||
currentDirectory = e.Directory
|
||||
});
|
||||
SendDirectory((Codec as IHasDirectory).CurrentDirectoryResult, e.DirectoryIsOnRoot);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Posts the current directory
|
||||
/// </summary>
|
||||
void SendDirectory(CodecDirectory directory, bool isRoot)
|
||||
{
|
||||
var dirCodec = Codec as IHasDirectory;
|
||||
|
||||
if (dirCodec != null)
|
||||
{
|
||||
var prefixedDirectoryResults = PrefixDirectoryFolderItems(directory);
|
||||
|
||||
var directoryMessage = new
|
||||
{
|
||||
currentDirectory = new
|
||||
{
|
||||
directoryResults = prefixedDirectoryResults,
|
||||
isRootDirectory = isRoot
|
||||
}
|
||||
};
|
||||
PostStatusMessage(directoryMessage);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Iterates a directory object and prefixes any folder items with "[+] "
|
||||
/// </summary>
|
||||
/// <param name="directory"></param>
|
||||
/// <returns></returns>
|
||||
List<DirectoryItem> PrefixDirectoryFolderItems (CodecDirectory directory)
|
||||
{
|
||||
var tempDirectoryList = new List<DirectoryItem>();
|
||||
|
||||
if (directory.CurrentDirectoryResults.Count > 0)
|
||||
{
|
||||
foreach (var item in directory.CurrentDirectoryResults)
|
||||
{
|
||||
if (item is DirectoryFolder)
|
||||
{
|
||||
var newFolder = new DirectoryFolder();
|
||||
|
||||
newFolder = (DirectoryFolder)item.Clone();
|
||||
|
||||
string prefixName = "[+] " + newFolder.Name;
|
||||
|
||||
newFolder.Name = prefixName;
|
||||
|
||||
tempDirectoryList.Add(newFolder);
|
||||
}
|
||||
else
|
||||
{
|
||||
tempDirectoryList.Add(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
//else
|
||||
//{
|
||||
// DirectoryItem noResults = new DirectoryItem() { Name = "No Results Found" };
|
||||
|
||||
// tempDirectoryList.Add(noResults);
|
||||
//}
|
||||
|
||||
return tempDirectoryList;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
@@ -97,7 +162,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
/// Called from base's RegisterWithAppServer method
|
||||
/// </summary>
|
||||
/// <param name="appServerController"></param>
|
||||
protected override void CustomRegisterWithAppServer(CotijaSystemController appServerController)
|
||||
protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
|
||||
{
|
||||
appServerController.AddAction("/device/videoCodec/isReady", new Action(SendIsReady));
|
||||
appServerController.AddAction("/device/videoCodec/fullStatus", new Action(SendVtcFullMessageObject));
|
||||
@@ -122,10 +187,77 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
if (call != null)
|
||||
Codec.AcceptCall(call);
|
||||
}));
|
||||
appServerController.AddAction(MessagePath + "/directoryRoot", new Action(GetDirectoryRoot));
|
||||
appServerController.AddAction(MessagePath + "/directoryById", new Action<string>(s => GetDirectory(s)));
|
||||
appServerController.AddAction(MessagePath + "/directorySearch", new Action<string>(s => DirectorySearch(s)));
|
||||
appServerController.AddAction(MessagePath + "/getCallHistory", new Action(GetCallHistory));
|
||||
|
||||
// Directory actions
|
||||
var dirCodec = Codec as IHasDirectory;
|
||||
if (dirCodec != null)
|
||||
{
|
||||
appServerController.AddAction(MessagePath + "/getDirectory", new Action(GetDirectoryRoot));
|
||||
appServerController.AddAction(MessagePath + "/directoryById", new Action<string>(s => GetDirectory(s)));
|
||||
appServerController.AddAction(MessagePath + "/directorySearch", new Action<string>(s => DirectorySearch(s)));
|
||||
appServerController.AddAction(MessagePath + "/directoryBack", new Action(GetPreviousDirectory));
|
||||
}
|
||||
|
||||
// History actions
|
||||
var recCodec = Codec as IHasCallHistory;
|
||||
if (recCodec != null)
|
||||
{
|
||||
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));
|
||||
appServerController.AddAction(MessagePath + "/privacyModeToggle", new Action(Codec.PrivacyModeToggle));
|
||||
@@ -135,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);
|
||||
@@ -215,12 +430,28 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
return;
|
||||
}
|
||||
|
||||
PostStatusMessage(new
|
||||
{
|
||||
currentDirectory = dirCodec.DirectoryRoot
|
||||
});
|
||||
dirCodec.SetCurrentDirectoryToRoot();
|
||||
|
||||
//PostStatusMessage(new
|
||||
//{
|
||||
// currentDirectory = dirCodec.DirectoryRoot
|
||||
//});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Requests the parent folder contents
|
||||
/// </summary>
|
||||
void GetPreviousDirectory()
|
||||
{
|
||||
var dirCodec = Codec as IHasDirectory;
|
||||
if (dirCodec == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
dirCodec.GetDirectoryParentFolderContents();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Handler for codec changes
|
||||
/// </summary>
|
||||
@@ -251,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
|
||||
{
|
||||
@@ -271,9 +518,79 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
},
|
||||
showSelfViewByDefault = Codec.ShowSelfViewByDefault,
|
||||
hasDirectory = Codec is IHasDirectory,
|
||||
hasDirectorySearch = true,
|
||||
hasRecents = Codec is IHasCallHistory,
|
||||
hasCameras = Codec is IHasCameraControl
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -13,7 +13,7 @@ namespace PepperDash.Essentials
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public class CotijaConfig
|
||||
public class MobileControlConfig
|
||||
{
|
||||
[JsonProperty("serverUrl")]
|
||||
public string ServerUrl { get; set; }
|
||||
@@ -25,7 +25,7 @@ namespace PepperDash.Essentials
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public class CotijaDdvc01RoomBridgePropertiesConfig
|
||||
public class MobileControlDdvc01RoomBridgePropertiesConfig
|
||||
{
|
||||
[JsonProperty("eiscId")]
|
||||
public string EiscId { get; set; }
|
||||
@@ -8,19 +8,19 @@ using Crestron.SimplSharpPro.EthernetCommunication;
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Room.Cotija
|
||||
namespace PepperDash.Essentials.Room.MobileControl
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a generic device connection through to and EISC for DDVC01
|
||||
/// </summary>
|
||||
public class CotijaDdvc01DeviceBridge : Device, IChannel, INumericKeypad
|
||||
public class MobileControlDdvc01DeviceBridge : Device, IChannel, INumericKeypad
|
||||
{
|
||||
/// <summary>
|
||||
/// EISC used to talk to Simpl
|
||||
/// </summary>
|
||||
ThreeSeriesTcpIpEthernetIntersystemCommunications EISC;
|
||||
|
||||
public CotijaDdvc01DeviceBridge(string key, string name, ThreeSeriesTcpIpEthernetIntersystemCommunications eisc)
|
||||
public MobileControlDdvc01DeviceBridge(string key, string name, ThreeSeriesTcpIpEthernetIntersystemCommunications eisc)
|
||||
: base(key, name)
|
||||
{
|
||||
EISC = eisc;
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,679 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharp.Reflection;
|
||||
using Crestron.SimplSharpPro.EthernetCommunication;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.AppServer.Messengers;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.Config;
|
||||
using PepperDash.Essentials.Room.Config;
|
||||
|
||||
|
||||
namespace PepperDash.Essentials.Room.Cotija
|
||||
{
|
||||
public class CotijaDdvc01RoomBridge : CotijaBridgeBase, IDelayedConfiguration
|
||||
{
|
||||
public class BoolJoin
|
||||
{
|
||||
/// <summary>
|
||||
/// 301
|
||||
/// </summary>
|
||||
public const uint RoomIsOn = 301;
|
||||
|
||||
/// <summary>
|
||||
/// 41
|
||||
/// </summary>
|
||||
public const uint PromptForCode = 41;
|
||||
/// <summary>
|
||||
/// 42
|
||||
/// </summary>
|
||||
public const uint ClientJoined = 42;
|
||||
/// <summary>
|
||||
/// 51
|
||||
/// </summary>
|
||||
public const uint ActivitySharePress = 51;
|
||||
/// <summary>
|
||||
/// 52
|
||||
/// </summary>
|
||||
public const uint ActivityPhoneCallPress = 52;
|
||||
/// <summary>
|
||||
/// 53
|
||||
/// </summary>
|
||||
public const uint ActivityVideoCallPress = 53;
|
||||
|
||||
/// <summary>
|
||||
/// 1
|
||||
/// </summary>
|
||||
public const uint MasterVolumeIsMuted = 1;
|
||||
/// <summary>
|
||||
/// 1
|
||||
/// </summary>
|
||||
public const uint MasterVolumeMuteToggle = 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 = 72;
|
||||
/// <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;
|
||||
}
|
||||
|
||||
public class UshortJoin
|
||||
{
|
||||
/// <summary>
|
||||
/// 1
|
||||
/// </summary>
|
||||
public const uint MasterVolumeLevel = 1;
|
||||
|
||||
/// <summary>
|
||||
/// 61
|
||||
/// </summary>
|
||||
public const uint ShutdownPromptDuration = 61;
|
||||
}
|
||||
|
||||
public class StringJoin
|
||||
{
|
||||
/// <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>
|
||||
/// Fires when config is ready to go
|
||||
/// </summary>
|
||||
public event EventHandler<EventArgs> ConfigurationIsReady;
|
||||
|
||||
public ThreeSeriesTcpIpEthernetIntersystemCommunications EISC { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public bool ConfigIsLoaded { get; private set; }
|
||||
|
||||
public override string RoomName
|
||||
{
|
||||
get {
|
||||
var name = EISC.StringOutput[StringJoin.ConfigRoomName].StringValue;
|
||||
return string.IsNullOrEmpty(name) ? "Not Loaded" : name;
|
||||
}
|
||||
}
|
||||
|
||||
CotijaDdvc01DeviceBridge SourceBridge;
|
||||
|
||||
Ddvc01AtcMessenger AtcMessenger;
|
||||
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="key"></param>
|
||||
/// <param name="name"></param>
|
||||
/// <param name="ipId"></param>
|
||||
public CotijaDdvc01RoomBridge(string key, string name, uint ipId)
|
||||
: base(key, name)
|
||||
{
|
||||
try
|
||||
{
|
||||
EISC = new ThreeSeriesTcpIpEthernetIntersystemCommunications(ipId, "127.0.0.2", Global.ControlSystem);
|
||||
var reg = EISC.Register();
|
||||
if (reg != Crestron.SimplSharpPro.eDeviceRegistrationUnRegistrationResponse.Success)
|
||||
Debug.Console(0, this, "Cannot connect EISC at IPID {0}: \r{1}", ipId, reg);
|
||||
|
||||
SourceBridge = new CotijaDdvc01DeviceBridge(key + "-sourceBridge", "DDVC01 source bridge", EISC);
|
||||
DeviceManager.AddDevice(SourceBridge);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Finish wiring up everything after all devices are created. The base class will hunt down the related
|
||||
/// parent controller and link them up.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public override bool CustomActivate()
|
||||
{
|
||||
Debug.Console(0, this, "Final activation. Setting up actions and feedbacks");
|
||||
SetupFunctions();
|
||||
SetupFeedbacks();
|
||||
|
||||
var key = this.Key + "-" + Parent.Key;
|
||||
AtcMessenger = new Ddvc01AtcMessenger(key, EISC, "/device/audioCodec");
|
||||
AtcMessenger.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)
|
||||
LoadConfigValues();
|
||||
};
|
||||
// load config if it's already there
|
||||
if (EISC.IsOnline && EISC.BooleanOutput[BoolJoin.ConfigIsReady].BoolValue) // || EISC.BooleanInput[BoolJoin.ConfigIsReady].BoolValue)
|
||||
LoadConfigValues();
|
||||
|
||||
|
||||
CrestronConsole.AddNewConsoleCommand(s =>
|
||||
{
|
||||
for (uint i = 1; i < 1000; i++)
|
||||
{
|
||||
if (s.ToLower().Equals("b"))
|
||||
{
|
||||
CrestronConsole.ConsoleCommandResponse("D{0,6} {1} - ", i, EISC.BooleanOutput[i].BoolValue);
|
||||
}
|
||||
else if (s.ToLower().Equals("u"))
|
||||
{
|
||||
CrestronConsole.ConsoleCommandResponse("U{0,6} {1,8} - ", i, EISC.UShortOutput[i].UShortValue);
|
||||
}
|
||||
else if (s.ToLower().Equals("s"))
|
||||
{
|
||||
var val = EISC.StringOutput[i].StringValue;
|
||||
if(!string.IsNullOrEmpty(val))
|
||||
CrestronConsole.ConsoleCommandResponse("S{0,6} {1}\r", i, EISC.StringOutput[i].StringValue);
|
||||
}
|
||||
|
||||
}
|
||||
}, "mobilebridgedump", "Dumps DDVC01 bridge EISC data b,u,s", ConsoleAccessLevelEnum.AccessOperator);
|
||||
|
||||
return base.CustomActivate();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Setup the actions to take place on various incoming API calls
|
||||
/// </summary>
|
||||
void SetupFunctions()
|
||||
{
|
||||
#warning need join numbers for these
|
||||
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/status", new Action(SendFullStatus));
|
||||
|
||||
Parent.AddAction(@"/room/room1/source", new Action<SourceSelectMessageContent>(c =>
|
||||
{
|
||||
EISC.SetString(StringJoin.SelectedSourceKey, c.SourceListItem);
|
||||
EISC.PulseBool(BoolJoin.SourceHasChanged);
|
||||
}));
|
||||
|
||||
Parent.AddAction(@"/room/room1/defaultsource", new Action(() =>
|
||||
EISC.PulseBool(BoolJoin.ActivitySharePress)));
|
||||
Parent.AddAction(@"/room/room1/activityVideo", new Action(() =>
|
||||
EISC.PulseBool(BoolJoin.ActivityVideoCallPress)));
|
||||
Parent.AddAction(@"/room/room1/activityPhone", new Action(() =>
|
||||
EISC.PulseBool(BoolJoin.ActivityPhoneCallPress)));
|
||||
|
||||
Parent.AddAction(@"/room/room1/volumes/master/level", new Action<ushort>(u =>
|
||||
EISC.SetUshort(UshortJoin.MasterVolumeLevel, u)));
|
||||
Parent.AddAction(@"/room/room1/volumes/master/muteToggle", new Action(() =>
|
||||
EISC.PulseBool(BoolJoin.MasterVolumeIsMuted)));
|
||||
|
||||
Parent.AddAction(@"/room/room1/shutdownStart", new Action(() =>
|
||||
EISC.PulseBool(BoolJoin.ShutdownStart)));
|
||||
Parent.AddAction(@"/room/room1/shutdownEnd", new Action(() =>
|
||||
EISC.PulseBool(BoolJoin.ShutdownEnd)));
|
||||
Parent.AddAction(@"/room/room1/shutdownCancel", new Action(() =>
|
||||
EISC.PulseBool(BoolJoin.ShutdownCancel)));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="devKey"></param>
|
||||
void SetupSourceFunctions(string devKey)
|
||||
{
|
||||
SourceDeviceMapDictionary sourceJoinMap = new SourceDeviceMapDictionary();
|
||||
|
||||
var prefix = string.Format("/device/{0}/", devKey);
|
||||
|
||||
foreach (var item in sourceJoinMap)
|
||||
{
|
||||
var join = item.Value;
|
||||
Parent.AddAction(string.Format("{0}{1}", prefix, item.Key), new PressAndHoldAction(b => EISC.SetBool(join, b)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Links feedbacks to whatever is gonna happen!
|
||||
/// </summary>
|
||||
void SetupFeedbacks()
|
||||
{
|
||||
// Power
|
||||
EISC.SetBoolSigAction(BoolJoin.RoomIsOn, b =>
|
||||
PostStatusMessage(new
|
||||
{
|
||||
isOn = b
|
||||
}));
|
||||
|
||||
// Source change things
|
||||
EISC.SetSigTrueAction(BoolJoin.SourceHasChanged, () =>
|
||||
PostStatusMessage(new
|
||||
{
|
||||
selectedSourceKey = EISC.StringOutput[StringJoin.SelectedSourceKey].StringValue
|
||||
}));
|
||||
|
||||
// Volume things
|
||||
EISC.SetUShortSigAction(UshortJoin.MasterVolumeLevel, u =>
|
||||
PostStatusMessage(new
|
||||
{
|
||||
volumes = new
|
||||
{
|
||||
master = new
|
||||
{
|
||||
level = u
|
||||
}
|
||||
}
|
||||
}));
|
||||
|
||||
EISC.SetBoolSigAction(BoolJoin.MasterVolumeIsMuted, b =>
|
||||
PostStatusMessage(new
|
||||
{
|
||||
volumes = new
|
||||
{
|
||||
master = new
|
||||
{
|
||||
muted = b
|
||||
}
|
||||
}
|
||||
}));
|
||||
|
||||
|
||||
// shutdown things
|
||||
EISC.SetSigTrueAction(BoolJoin.ShutdownCancel, new Action(() =>
|
||||
PostMessage("/room/shutdown/", new
|
||||
{
|
||||
state = "wasCancelled"
|
||||
})));
|
||||
EISC.SetSigTrueAction(BoolJoin.ShutdownEnd, new Action(() =>
|
||||
PostMessage("/room/shutdown/", new
|
||||
{
|
||||
state = "hasFinished"
|
||||
})));
|
||||
EISC.SetSigTrueAction(BoolJoin.ShutdownStart, new Action(() =>
|
||||
PostMessage("/room/shutdown/", new
|
||||
{
|
||||
state = "hasStarted",
|
||||
duration = EISC.UShortOutput[UshortJoin.ShutdownPromptDuration].UShortValue
|
||||
})));
|
||||
|
||||
// Config things
|
||||
EISC.SetSigTrueAction(BoolJoin.ConfigIsReady, LoadConfigValues);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Reads in config values when the Simpl program is ready
|
||||
/// </summary>
|
||||
void LoadConfigValues()
|
||||
{
|
||||
Debug.Console(1, this, "Loading configuration from DDVC01 EISC bridge");
|
||||
ConfigIsLoaded = false;
|
||||
|
||||
var co = ConfigReader.ConfigObject;
|
||||
|
||||
co.Info.RuntimeInfo.AppName = Assembly.GetExecutingAssembly().GetName().Name;
|
||||
var version = Assembly.GetExecutingAssembly().GetName().Version;
|
||||
co.Info.RuntimeInfo.AssemblyVersion = string.Format("{0}.{1}.{2}", version.Major, version.Minor, version.Build);
|
||||
|
||||
//Room
|
||||
//if (co.Rooms == null)
|
||||
// always start fresh in case simpl changed
|
||||
co.Rooms = new List<DeviceConfig>();
|
||||
var rm = new DeviceConfig();
|
||||
if (co.Rooms.Count == 0)
|
||||
{
|
||||
Debug.Console(0, this, "Adding room to config");
|
||||
co.Rooms.Add(rm);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Console(0, this, "Replacing Room[0] in config");
|
||||
co.Rooms[0] = rm;
|
||||
}
|
||||
rm.Name = EISC.StringOutput[501].StringValue;
|
||||
rm.Key = "room1";
|
||||
rm.Type = "ddvc01";
|
||||
|
||||
DDVC01RoomPropertiesConfig rmProps;
|
||||
if (rm.Properties == null)
|
||||
rmProps = new DDVC01RoomPropertiesConfig();
|
||||
else
|
||||
rmProps = JsonConvert.DeserializeObject<DDVC01RoomPropertiesConfig>(rm.Properties.ToString());
|
||||
|
||||
rmProps.Help = new EssentialsHelpPropertiesConfig();
|
||||
rmProps.Help.CallButtonText = EISC.StringOutput[503].StringValue;
|
||||
rmProps.Help.Message = EISC.StringOutput[502].StringValue;
|
||||
|
||||
rmProps.Environment = new EssentialsEnvironmentPropertiesConfig(); // enabled defaults to false
|
||||
|
||||
rmProps.RoomPhoneNumber = EISC.StringOutput[504].StringValue;
|
||||
rmProps.RoomURI = EISC.StringOutput[505].StringValue;
|
||||
rmProps.SpeedDials = new List<DDVC01SpeedDial>();
|
||||
// add speed dials as long as there are more - up to 4
|
||||
for (uint i = 512; i <= 519; i = i + 2)
|
||||
{
|
||||
var num = EISC.StringOutput[i].StringValue;
|
||||
if (string.IsNullOrEmpty(num))
|
||||
break;
|
||||
var name = EISC.StringOutput[i + 1].StringValue;
|
||||
rmProps.SpeedDials.Add(new DDVC01SpeedDial { Number = num, Name = name});
|
||||
}
|
||||
|
||||
// This MAY need a check
|
||||
rmProps.AudioCodecKey = "audioCodec";
|
||||
rmProps.VideoCodecKey = null; // "videoCodec";
|
||||
|
||||
// volume control names
|
||||
var volCount = EISC.UShortOutput[701].UShortValue;
|
||||
|
||||
//// use Volumes object or?
|
||||
//rmProps.VolumeSliderNames = new List<string>();
|
||||
//for(uint i = 701; i <= 700 + volCount; i++)
|
||||
//{
|
||||
// rmProps.VolumeSliderNames.Add(EISC.StringInput[i].StringValue);
|
||||
//}
|
||||
|
||||
// There should be cotija devices in here, I think...
|
||||
if(co.Devices == null)
|
||||
co.Devices = new List<DeviceConfig>();
|
||||
|
||||
// clear out previous DDVC devices
|
||||
co.Devices.RemoveAll(d =>
|
||||
d.Key.StartsWith("source-", StringComparison.OrdinalIgnoreCase)
|
||||
|| d.Key.Equals("audioCodec", StringComparison.OrdinalIgnoreCase)
|
||||
|| d.Key.Equals("videoCodec", StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
rmProps.SourceListKey = "default";
|
||||
rm.Properties = JToken.FromObject(rmProps);
|
||||
|
||||
// Source list! This might be brutal!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
var groupMap = GetSourceGroupDictionary();
|
||||
|
||||
co.SourceLists = new Dictionary<string,Dictionary<string,SourceListItem>>();
|
||||
var newSl = new Dictionary<string, SourceListItem>();
|
||||
// add sources...
|
||||
for (uint i = 0; i<= 19; i++)
|
||||
{
|
||||
var name = EISC.StringOutput[601 + i].StringValue;
|
||||
if(string.IsNullOrEmpty(name))
|
||||
break;
|
||||
var icon = EISC.StringOutput[651 + i].StringValue;
|
||||
var key = EISC.StringOutput[671 + i].StringValue;
|
||||
|
||||
var type = EISC.StringOutput[701 + i].StringValue;
|
||||
|
||||
Debug.Console(0, this, "Adding source {0} '{1}'", key, name);
|
||||
var newSLI = new SourceListItem{
|
||||
Icon = icon,
|
||||
Name = name,
|
||||
Order = (int)i + 1,
|
||||
SourceKey = key,
|
||||
Type = eSourceListItemType.Route
|
||||
};
|
||||
newSl.Add(key, newSLI);
|
||||
|
||||
string group = "genericsource";
|
||||
if (groupMap.ContainsKey(type))
|
||||
{
|
||||
group = groupMap[type];
|
||||
}
|
||||
|
||||
// add dev to devices list
|
||||
var devConf = new DeviceConfig {
|
||||
Group = group,
|
||||
Key = key,
|
||||
Name = name,
|
||||
Type = type
|
||||
};
|
||||
co.Devices.Add(devConf);
|
||||
|
||||
if (group.ToLower().StartsWith("settopbox")) // Add others here as needed
|
||||
{
|
||||
SetupSourceFunctions(key);
|
||||
}
|
||||
}
|
||||
|
||||
co.SourceLists.Add("default", newSl);
|
||||
|
||||
// build "audioCodec" config if we need
|
||||
if (!string.IsNullOrEmpty(rmProps.AudioCodecKey))
|
||||
{
|
||||
var acFavs = new List<PepperDash.Essentials.Devices.Common.Codec.CodecActiveCallItem>();
|
||||
for (uint i = 0; i < 4; i++)
|
||||
{
|
||||
if (!EISC.GetBool(BoolJoin.SpeedDialVisibleStartJoin + i))
|
||||
{
|
||||
break;
|
||||
}
|
||||
acFavs.Add(new PepperDash.Essentials.Devices.Common.Codec.CodecActiveCallItem()
|
||||
{
|
||||
Name = EISC.GetString(StringJoin.SpeedDialNameStartJoin + i),
|
||||
Number = EISC.GetString(StringJoin.SpeedDialNumberStartJoin + i),
|
||||
Type = PepperDash.Essentials.Devices.Common.Codec.eCodecCallType.Audio
|
||||
});
|
||||
}
|
||||
|
||||
var acProps = new
|
||||
{
|
||||
favorites = acFavs
|
||||
};
|
||||
|
||||
var acStr = "audioCodec";
|
||||
var acConf = new DeviceConfig()
|
||||
{
|
||||
Group = acStr,
|
||||
Key = acStr,
|
||||
Name = acStr,
|
||||
Type = acStr,
|
||||
Properties = JToken.FromObject(acProps)
|
||||
};
|
||||
co.Devices.Add(acConf);
|
||||
}
|
||||
|
||||
Debug.Console(0, this, "******* CONFIG FROM DDVC: \r{0}", JsonConvert.SerializeObject(ConfigReader.ConfigObject, Formatting.Indented));
|
||||
|
||||
var handler = ConfigurationIsReady;
|
||||
if (handler != null)
|
||||
{
|
||||
handler(this, new EventArgs());
|
||||
}
|
||||
|
||||
ConfigIsLoaded = true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
void SendFullStatus()
|
||||
{
|
||||
if (ConfigIsLoaded)
|
||||
{
|
||||
var count = EISC.UShortOutput[801].UShortValue;
|
||||
|
||||
Debug.Console(1, this, "The Fader Count is : {0}", count);
|
||||
|
||||
// build volumes object, serialize and put in content of method below
|
||||
|
||||
var auxFaders = new List<Volume>();
|
||||
|
||||
// Create auxFaders
|
||||
for (uint i = 2; i <= count; i++)
|
||||
{
|
||||
auxFaders.Add(
|
||||
new Volume(string.Format("level-{0}", i),
|
||||
EISC.UShortOutput[i].UShortValue,
|
||||
EISC.BooleanOutput[i].BoolValue,
|
||||
EISC.StringOutput[800 + i].StringValue,
|
||||
true,
|
||||
"someting.png"));
|
||||
}
|
||||
|
||||
var volumes = new Volumes();
|
||||
|
||||
volumes.Master = new Volume("master",
|
||||
EISC.UShortOutput[UshortJoin.MasterVolumeLevel].UShortValue,
|
||||
EISC.BooleanOutput[BoolJoin.MasterVolumeIsMuted].BoolValue,
|
||||
EISC.StringOutput[801].StringValue,
|
||||
true,
|
||||
"something.png");
|
||||
|
||||
volumes.AuxFaders = auxFaders;
|
||||
|
||||
PostStatusMessage(new
|
||||
{
|
||||
isOn = EISC.BooleanOutput[BoolJoin.RoomIsOn].BoolValue,
|
||||
selectedSourceKey = EISC.StringOutput[StringJoin.SelectedSourceKey].StringValue,
|
||||
volumes = volumes
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
PostStatusMessage(new
|
||||
{
|
||||
error = "systemNotReady"
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Helper for posting status message
|
||||
/// </summary>
|
||||
/// <param name="contentObject">The contents of the content object</param>
|
||||
void PostStatusMessage(object contentObject)
|
||||
{
|
||||
Parent.SendMessageToServer(JObject.FromObject(new
|
||||
{
|
||||
type = "/room/status/",
|
||||
content = contentObject
|
||||
}));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="messageType"></param>
|
||||
/// <param name="contentObject"></param>
|
||||
void PostMessage(string messageType, object contentObject)
|
||||
{
|
||||
Parent.SendMessageToServer(JObject.FromObject(new
|
||||
{
|
||||
type = messageType,
|
||||
content = contentObject
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="currentDevice"></param>
|
||||
/// <param name="args"></param>
|
||||
void EISC_SigChange(object currentDevice, Crestron.SimplSharpPro.SigEventArgs args)
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the mapping of types to groups, for setting up devices.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Dictionary<string, string> GetSourceGroupDictionary()
|
||||
{
|
||||
//type, group
|
||||
var d = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase)
|
||||
{
|
||||
{ "laptop", "pc" },
|
||||
{ "wireless", "genericsource" },
|
||||
{ "iptv", "settopbox" }
|
||||
|
||||
};
|
||||
return d;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// updates the usercode from server
|
||||
/// </summary>
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,15 +12,15 @@ namespace PepperDash.Essentials
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public abstract class CotijaBridgeBase: Device
|
||||
public abstract class MobileControlBridgeBase: EssentialsDevice
|
||||
{
|
||||
public CotijaSystemController Parent { get; private set; }
|
||||
public MobileControlSystemController Parent { get; private set; }
|
||||
|
||||
public string UserCode { get; private set; }
|
||||
|
||||
public abstract string RoomName { get; }
|
||||
|
||||
public CotijaBridgeBase(string key, string name)
|
||||
public MobileControlBridgeBase(string key, string name)
|
||||
: base(key, name)
|
||||
{
|
||||
}
|
||||
@@ -30,7 +30,7 @@ namespace PepperDash.Essentials
|
||||
/// as adding actions to parent
|
||||
/// </summary>
|
||||
/// <param name="parent"></param>
|
||||
public virtual void AddParent(CotijaSystemController parent)
|
||||
public virtual void AddParent(MobileControlSystemController parent)
|
||||
{
|
||||
Parent = parent;
|
||||
}
|
||||
@@ -9,14 +9,14 @@ using Newtonsoft.Json.Linq;
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.AppServer.Messengers;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Room.Cotija;
|
||||
using PepperDash.Essentials.Room.MobileControl;
|
||||
using PepperDash.Essentials.Devices.Common.Codec;
|
||||
using PepperDash.Essentials.Devices.Common.VideoCodec;
|
||||
using PepperDash.Essentials.Devices.Common.AudioCodec;
|
||||
|
||||
namespace PepperDash.Essentials
|
||||
{
|
||||
public class CotijaEssentialsHuddleSpaceRoomBridge : CotijaBridgeBase
|
||||
public class MobileConrolEssentialsHuddleSpaceRoomBridge : MobileControlBridgeBase
|
||||
{
|
||||
|
||||
public EssentialsRoomBase Room { get; private set; }
|
||||
@@ -25,6 +25,9 @@ namespace PepperDash.Essentials
|
||||
|
||||
public AudioCodecBaseMessenger ACMessenger { get; private set; }
|
||||
|
||||
public Dictionary<string, MessengerBase> DeviceMessengers { get; private set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
@@ -41,7 +44,7 @@ namespace PepperDash.Essentials
|
||||
/// </summary>
|
||||
/// <param name="parent"></param>
|
||||
/// <param name="room"></param>
|
||||
public CotijaEssentialsHuddleSpaceRoomBridge(EssentialsRoomBase room):
|
||||
public MobileConrolEssentialsHuddleSpaceRoomBridge(EssentialsRoomBase room):
|
||||
base("mobileControlBridge-essentialsHuddle", "Essentials Mobile Control Bridge-Huddle")
|
||||
{
|
||||
Room = room;
|
||||
@@ -51,7 +54,7 @@ namespace PepperDash.Essentials
|
||||
/// Override of base: calls base to add parent and then registers actions and events.
|
||||
/// </summary>
|
||||
/// <param name="parent"></param>
|
||||
public override void AddParent(CotijaSystemController parent)
|
||||
public override void AddParent(MobileControlSystemController parent)
|
||||
{
|
||||
base.AddParent(parent);
|
||||
|
||||
@@ -66,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)
|
||||
@@ -92,7 +103,7 @@ namespace PepperDash.Essentials
|
||||
|
||||
var sscRoom = Room as IHasCurrentSourceInfoChange;
|
||||
if(sscRoom != null)
|
||||
sscRoom.CurrentSingleSourceChange += new SourceInfoChangeHandler(Room_CurrentSingleSourceChange);
|
||||
sscRoom.CurrentSourceChange += new SourceInfoChangeHandler(Room_CurrentSingleSourceChange);
|
||||
|
||||
var vcRoom = Room as IHasVideoCodec;
|
||||
if (vcRoom != null && vcRoom.VideoCodec != null)
|
||||
@@ -114,6 +125,8 @@ namespace PepperDash.Essentials
|
||||
ACMessenger.RegisterWithAppServer(Parent);
|
||||
}
|
||||
|
||||
SetupDeviceMessengers();
|
||||
|
||||
var defCallRm = Room as IRunDefaultCallRoute;
|
||||
if (defCallRm != null)
|
||||
{
|
||||
@@ -133,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>
|
||||
@@ -168,19 +211,6 @@ namespace PepperDash.Essentials
|
||||
});
|
||||
}
|
||||
|
||||
///// <summary>
|
||||
///// Handler for codec changes
|
||||
///// </summary>
|
||||
//void codec_CallStatusChange(object sender, CodecCallStatusItemChangeEventArgs e)
|
||||
//{
|
||||
// PostStatusMessage(new
|
||||
// {
|
||||
// calls = GetCallsMessageObject(),
|
||||
// //vtc = GetVtcCallsMessageObject()
|
||||
// });
|
||||
|
||||
//}
|
||||
|
||||
/// <summary>
|
||||
/// Helper for posting status message
|
||||
/// </summary>
|
||||
@@ -333,7 +363,7 @@ namespace PepperDash.Essentials
|
||||
}
|
||||
|
||||
|
||||
void Room_CurrentSingleSourceChange(EssentialsRoomBase room, PepperDash.Essentials.Core.SourceListItem info, ChangeType type)
|
||||
void Room_CurrentSingleSourceChange(PepperDash.Essentials.Core.SourceListItem info, ChangeType type)
|
||||
{
|
||||
/* Example message
|
||||
* {
|
||||
@@ -394,11 +424,14 @@ namespace PepperDash.Essentials
|
||||
if (dev is ITransport)
|
||||
(dev as ITransport).LinkActions(Parent);
|
||||
|
||||
var srcRm = room as IHasCurrentSourceInfoChange;
|
||||
PostStatusMessage(new
|
||||
{
|
||||
selectedSourceKey = srcRm.CurrentSourceInfoKey
|
||||
});
|
||||
var srcRm = Room as IHasCurrentSourceInfoChange;
|
||||
if (srcRm != null)
|
||||
{
|
||||
PostStatusMessage(new
|
||||
{
|
||||
selectedSourceKey = srcRm.CurrentSourceInfoKey
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -416,7 +449,7 @@ namespace PepperDash.Essentials
|
||||
if (rmVc != null)
|
||||
{
|
||||
var vc = rmVc.CurrentVolumeControls as IBasicVolumeWithFeedback;
|
||||
if (rmVc != null)
|
||||
if (vc != null)
|
||||
{
|
||||
volumes.Master = new Volume("master", vc.VolumeLevelFeedback.UShortValue, vc.MuteFeedback.BoolValue, "Volume", true, "");
|
||||
}
|
||||
@@ -431,45 +464,6 @@ namespace PepperDash.Essentials
|
||||
volumes = volumes
|
||||
});
|
||||
}
|
||||
|
||||
///// <summary>
|
||||
///// Helper to return a anonymous object with the call data for JSON message
|
||||
///// </summary>
|
||||
///// <returns></returns>
|
||||
//object GetCallsMessageObject()
|
||||
//{
|
||||
// var callRm = Room as IHasVideoCodec;
|
||||
// if (callRm == null)
|
||||
// return null;
|
||||
// return new
|
||||
// {
|
||||
// activeCalls = callRm.VideoCodec.ActiveCalls,
|
||||
// callType = callRm.CallTypeFeedback.IntValue,
|
||||
// inCall = callRm.InCallFeedback.BoolValue,
|
||||
// isSharing = callRm.IsSharingFeedback.BoolValue,
|
||||
// privacyModeIsOn = callRm.PrivacyModeIsOnFeedback.BoolValue
|
||||
// };
|
||||
//}
|
||||
|
||||
///// <summary>
|
||||
///// Helper method to build call status for vtc
|
||||
///// </summary>
|
||||
///// <returns></returns>
|
||||
//object GetVtcCallsMessageObject()
|
||||
//{
|
||||
// var callRm = Room as IHasVideoCodec;
|
||||
// object vtc = null;
|
||||
// if (callRm != null)
|
||||
// {
|
||||
// var codec = callRm.VideoCodec;
|
||||
// vtc = new
|
||||
// {
|
||||
// isInCall = codec.IsInCall,
|
||||
// calls = codec.ActiveCalls
|
||||
// };
|
||||
// }
|
||||
// return vtc;
|
||||
//}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -478,6 +472,7 @@ namespace PepperDash.Essentials
|
||||
public class SourceSelectMessageContent
|
||||
{
|
||||
public string SourceListItem { get; set; }
|
||||
public string SourceListKey { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -0,0 +1,859 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharp.Reflection;
|
||||
using Crestron.SimplSharpPro.EthernetCommunication;
|
||||
|
||||
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;
|
||||
using PepperDash.Essentials.Room.Config;
|
||||
|
||||
|
||||
namespace PepperDash.Essentials.Room.MobileControl
|
||||
{
|
||||
public class MobileControlSIMPLRoomBridge : MobileControlBridgeBase, IDelayedConfiguration
|
||||
{
|
||||
/// <summary>
|
||||
/// Fires when config is ready to go
|
||||
/// </summary>
|
||||
public event EventHandler<EventArgs> ConfigurationIsReady;
|
||||
|
||||
public ThreeSeriesTcpIpEthernetIntersystemCommunications EISC { get; private set; }
|
||||
|
||||
public MobileControlSIMPLRoomJoinMap JoinMap { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public bool ConfigIsLoaded { get; private set; }
|
||||
|
||||
public override string RoomName
|
||||
{
|
||||
get {
|
||||
var name = EISC.StringOutput[JoinMap.ConfigRoomName.JoinNumber].StringValue;
|
||||
return string.IsNullOrEmpty(name) ? "Not Loaded" : name;
|
||||
}
|
||||
}
|
||||
|
||||
MobileControlDdvc01DeviceBridge SourceBridge;
|
||||
|
||||
SIMPLAtcMessenger AtcMessenger;
|
||||
SIMPLVtcMessenger VtcMessenger;
|
||||
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="key"></param>
|
||||
/// <param name="name"></param>
|
||||
/// <param name="ipId"></param>
|
||||
public MobileControlSIMPLRoomBridge(string key, string name, uint ipId)
|
||||
: base(key, name)
|
||||
{
|
||||
try
|
||||
{
|
||||
EISC = new ThreeSeriesTcpIpEthernetIntersystemCommunications(ipId, "127.0.0.2", Global.ControlSystem);
|
||||
var reg = EISC.Register();
|
||||
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)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Finish wiring up everything after all devices are created. The base class will hunt down the related
|
||||
/// parent controller and link them up.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public override bool CustomActivate()
|
||||
{
|
||||
Debug.Console(0, this, "Final activation. Setting up actions and feedbacks");
|
||||
SetupFunctions();
|
||||
SetupFeedbacks();
|
||||
|
||||
var atcKey = string.Format("atc-{0}-{1}", this.Key, Parent.Key);
|
||||
AtcMessenger = new SIMPLAtcMessenger(atcKey, EISC, "/device/audioCodec");
|
||||
AtcMessenger.RegisterWithAppServer(Parent);
|
||||
|
||||
var vtcKey = string.Format("atc-{0}-{1}", this.Key, Parent.Key);
|
||||
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}. 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[JoinMap.ConfigIsReady.JoinNumber].BoolValue) // || EISC.BooleanInput[JoinMap.ConfigIsReady].BoolValue)
|
||||
LoadConfigValues();
|
||||
|
||||
if (EISC.IsOnline && EISC.BooleanOutput[JoinMap.ConfigIsLocal.JoinNumber].BoolValue)
|
||||
{
|
||||
UseEssentialsConfig();
|
||||
}
|
||||
|
||||
CrestronConsole.AddNewConsoleCommand(s =>
|
||||
{
|
||||
for (uint i = 1; i < 1000; i++)
|
||||
{
|
||||
if (s.ToLower().Equals("b"))
|
||||
{
|
||||
CrestronConsole.ConsoleCommandResponse("D{0,6} {1} - ", i, EISC.BooleanOutput[i].BoolValue);
|
||||
}
|
||||
else if (s.ToLower().Equals("u"))
|
||||
{
|
||||
CrestronConsole.ConsoleCommandResponse("U{0,6} {1,8} - ", i, EISC.UShortOutput[i].UShortValue);
|
||||
}
|
||||
else if (s.ToLower().Equals("s"))
|
||||
{
|
||||
var val = EISC.StringOutput[i].StringValue;
|
||||
if(!string.IsNullOrEmpty(val))
|
||||
CrestronConsole.ConsoleCommandResponse("S{0,6} {1}\r", i, EISC.StringOutput[i].StringValue);
|
||||
}
|
||||
|
||||
}
|
||||
}, "mobilebridgedump", "Dumps DDVC01 bridge EISC data b,u,s", ConsoleAccessLevelEnum.AccessOperator);
|
||||
|
||||
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(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(JoinMap.CurrentSourceKey.JoinNumber, c.SourceListItem);
|
||||
EISC.PulseBool(JoinMap.SourceHasChanged.JoinNumber);
|
||||
}));
|
||||
|
||||
Parent.AddAction(@"/room/room1/defaultsource", new Action(() =>
|
||||
EISC.PulseBool(JoinMap.ActivityShare.JoinNumber)));
|
||||
Parent.AddAction(@"/room/room1/activityPhone", new Action(() =>
|
||||
EISC.PulseBool(JoinMap.ActivityPhoneCall.JoinNumber)));
|
||||
Parent.AddAction(@"/room/room1/activityVideo", new Action(() =>
|
||||
EISC.PulseBool(JoinMap.ActivityVideoCall.JoinNumber)));
|
||||
|
||||
Parent.AddAction(@"/room/room1/volumes/master/level", new Action<ushort>(u =>
|
||||
EISC.SetUshort(JoinMap.MasterVolume.JoinNumber, u)));
|
||||
Parent.AddAction(@"/room/room1/volumes/master/muteToggle", new Action(() =>
|
||||
EISC.PulseBool(JoinMap.MasterVolume.JoinNumber)));
|
||||
Parent.AddAction(@"/room/room1/volumes/master/privacyMuteToggle", new Action(() =>
|
||||
EISC.PulseBool(JoinMap.PrivacyMute.JoinNumber)));
|
||||
|
||||
|
||||
// /xyzxyz/volumes/master/muteToggle ---> BoolInput[1]
|
||||
|
||||
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 =>
|
||||
EISC.SetUshort(index, u)));
|
||||
Parent.AddAction(string.Format(@"/room/room1/volumes/level-{0}/muteToggle", index), new Action(() =>
|
||||
EISC.PulseBool(index)));
|
||||
}
|
||||
|
||||
Parent.AddAction(@"/room/room1/shutdownStart", new Action(() =>
|
||||
EISC.PulseBool(JoinMap.ShutdownStart.JoinNumber)));
|
||||
Parent.AddAction(@"/room/room1/shutdownEnd", new Action(() =>
|
||||
EISC.PulseBool(JoinMap.ShutdownEnd.JoinNumber)));
|
||||
Parent.AddAction(@"/room/room1/shutdownCancel", new Action(() =>
|
||||
EISC.PulseBool(JoinMap.ShutdownCancel.JoinNumber)));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="devKey"></param>
|
||||
void SetupSourceFunctions(string devKey)
|
||||
{
|
||||
SourceDeviceMapDictionary sourceJoinMap = new SourceDeviceMapDictionary();
|
||||
|
||||
var prefix = string.Format("/device/{0}/", devKey);
|
||||
|
||||
foreach (var item in sourceJoinMap)
|
||||
{
|
||||
var join = item.Value;
|
||||
Parent.AddAction(string.Format("{0}{1}", prefix, item.Key), new PressAndHoldAction(b => EISC.SetBool(join, b)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Links feedbacks to whatever is gonna happen!
|
||||
/// </summary>
|
||||
void SetupFeedbacks()
|
||||
{
|
||||
// Power
|
||||
EISC.SetBoolSigAction(JoinMap.RoomIsOn.JoinNumber, b =>
|
||||
PostStatusMessage(new
|
||||
{
|
||||
isOn = b
|
||||
}));
|
||||
|
||||
// Source change things
|
||||
EISC.SetSigTrueAction(JoinMap.SourceHasChanged.JoinNumber, () =>
|
||||
PostStatusMessage(new
|
||||
{
|
||||
selectedSourceKey = EISC.StringOutput[JoinMap.CurrentSourceKey.JoinNumber].StringValue
|
||||
}));
|
||||
|
||||
// Volume things
|
||||
EISC.SetUShortSigAction(JoinMap.MasterVolume.JoinNumber, u =>
|
||||
PostStatusMessage(new
|
||||
{
|
||||
volumes = new
|
||||
{
|
||||
master = new
|
||||
{
|
||||
level = u
|
||||
}
|
||||
}
|
||||
}));
|
||||
|
||||
// map MasterVolumeIsMuted join -> status/volumes/master/muted
|
||||
//
|
||||
|
||||
EISC.SetBoolSigAction(JoinMap.MasterVolume.JoinNumber, b =>
|
||||
PostStatusMessage(new
|
||||
{
|
||||
volumes = new
|
||||
{
|
||||
master = new
|
||||
{
|
||||
muted = b
|
||||
}
|
||||
}
|
||||
}));
|
||||
EISC.SetBoolSigAction(JoinMap.PrivacyMute.JoinNumber, b =>
|
||||
PostStatusMessage(new
|
||||
{
|
||||
volumes = new
|
||||
{
|
||||
master = new
|
||||
{
|
||||
privacyMuted = b
|
||||
}
|
||||
}
|
||||
}));
|
||||
|
||||
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
|
||||
{
|
||||
// need a dict in order to create the level-n property on auxFaders
|
||||
var dict = new Dictionary<string, object>();
|
||||
dict.Add("level-" + index, new { level = u });
|
||||
PostStatusMessage(new
|
||||
{
|
||||
volumes = new
|
||||
{
|
||||
auxFaders = dict,
|
||||
}
|
||||
});
|
||||
});
|
||||
EISC.SetBoolSigAction(index, b =>
|
||||
{
|
||||
// need a dict in order to create the level-n property on auxFaders
|
||||
var dict = new Dictionary<string, object>();
|
||||
dict.Add("level-" + index, new { muted = b });
|
||||
PostStatusMessage(new
|
||||
{
|
||||
volumes = new
|
||||
{
|
||||
auxFaders = dict,
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
EISC.SetUShortSigAction(JoinMap.NumberOfAuxFaders.JoinNumber, u =>
|
||||
PostStatusMessage(new {
|
||||
volumes = new {
|
||||
numberOfAuxFaders = u,
|
||||
}
|
||||
}));
|
||||
|
||||
// shutdown things
|
||||
EISC.SetSigTrueAction(JoinMap.ShutdownCancel.JoinNumber, new Action(() =>
|
||||
PostMessage("/room/shutdown/", new
|
||||
{
|
||||
state = "wasCancelled"
|
||||
})));
|
||||
EISC.SetSigTrueAction(JoinMap.ShutdownEnd.JoinNumber, new Action(() =>
|
||||
PostMessage("/room/shutdown/", new
|
||||
{
|
||||
state = "hasFinished"
|
||||
})));
|
||||
EISC.SetSigTrueAction(JoinMap.ShutdownStart.JoinNumber, new Action(() =>
|
||||
PostMessage("/room/shutdown/", new
|
||||
{
|
||||
state = "hasStarted",
|
||||
duration = EISC.UShortOutput[JoinMap.ShutdownPromptDuration.JoinNumber].UShortValue
|
||||
})));
|
||||
|
||||
// Config things
|
||||
EISC.SetSigTrueAction(JoinMap.ConfigIsReady.JoinNumber, LoadConfigValues);
|
||||
|
||||
// Activity modes
|
||||
EISC.SetSigTrueAction(JoinMap.ActivityShare.JoinNumber, () => UpdateActivity(1));
|
||||
EISC.SetSigTrueAction(JoinMap.ActivityPhoneCall.JoinNumber, () => UpdateActivity(2));
|
||||
EISC.SetSigTrueAction(JoinMap.ActivityVideoCall.JoinNumber, () => UpdateActivity(3));
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Updates activity states
|
||||
/// </summary>
|
||||
void UpdateActivity(int mode)
|
||||
{
|
||||
PostStatusMessage(new
|
||||
{
|
||||
activityMode = mode,
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Reads in config values when the Simpl program is ready
|
||||
/// </summary>
|
||||
void LoadConfigValues()
|
||||
{
|
||||
Debug.Console(1, this, "Loading configuration from DDVC01 EISC bridge");
|
||||
ConfigIsLoaded = false;
|
||||
|
||||
var co = ConfigReader.ConfigObject;
|
||||
|
||||
co.Info.RuntimeInfo.AppName = Assembly.GetExecutingAssembly().GetName().Name;
|
||||
var version = Assembly.GetExecutingAssembly().GetName().Version;
|
||||
co.Info.RuntimeInfo.AssemblyVersion = string.Format("{0}.{1}.{2}", version.Major, version.Minor, version.Build);
|
||||
|
||||
//Room
|
||||
//if (co.Rooms == null)
|
||||
// always start fresh in case simpl changed
|
||||
co.Rooms = new List<DeviceConfig>();
|
||||
var rm = new DeviceConfig();
|
||||
if (co.Rooms.Count == 0)
|
||||
{
|
||||
Debug.Console(0, this, "Adding room to config");
|
||||
co.Rooms.Add(rm);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Console(0, this, "Replacing Room[0] in config");
|
||||
co.Rooms[0] = rm;
|
||||
}
|
||||
rm.Name = EISC.StringOutput[JoinMap.ConfigRoomName.JoinNumber].StringValue;
|
||||
rm.Key = "room1";
|
||||
rm.Type = "ddvc01";
|
||||
|
||||
DDVC01RoomPropertiesConfig rmProps;
|
||||
if (rm.Properties == null)
|
||||
rmProps = new DDVC01RoomPropertiesConfig();
|
||||
else
|
||||
rmProps = JsonConvert.DeserializeObject<DDVC01RoomPropertiesConfig>(rm.Properties.ToString());
|
||||
|
||||
rmProps.Help = new EssentialsHelpPropertiesConfig();
|
||||
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[JoinMap.ConfigRoomPhoneNumber.JoinNumber].StringValue;
|
||||
rmProps.RoomURI = EISC.StringOutput[JoinMap.ConfigRoomURI.JoinNumber].StringValue;
|
||||
rmProps.SpeedDials = new List<DDVC01SpeedDial>();
|
||||
|
||||
// This MAY need a check
|
||||
rmProps.AudioCodecKey = "audioCodec";
|
||||
rmProps.VideoCodecKey = "videoCodec";
|
||||
|
||||
// volume control names
|
||||
var volCount = EISC.UShortOutput[JoinMap.NumberOfAuxFaders.JoinNumber].UShortValue;
|
||||
|
||||
//// use Volumes object or?
|
||||
//rmProps.VolumeSliderNames = new List<string>();
|
||||
//for(uint i = 701; i <= 700 + volCount; i++)
|
||||
//{
|
||||
// rmProps.VolumeSliderNames.Add(EISC.StringInput[i].StringValue);
|
||||
//}
|
||||
|
||||
// There should be Mobile Control devices in here, I think...
|
||||
if(co.Devices == null)
|
||||
co.Devices = new List<DeviceConfig>();
|
||||
|
||||
// clear out previous DDVC devices
|
||||
co.Devices.RemoveAll(d =>
|
||||
d.Key.StartsWith("source-", StringComparison.OrdinalIgnoreCase)
|
||||
|| d.Key.Equals("audioCodec", StringComparison.OrdinalIgnoreCase)
|
||||
|| d.Key.Equals("videoCodec", StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
rmProps.SourceListKey = "default";
|
||||
rm.Properties = JToken.FromObject(rmProps);
|
||||
|
||||
// Source list! This might be brutal!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
var groupMap = GetSourceGroupDictionary();
|
||||
|
||||
co.SourceLists = new Dictionary<string,Dictionary<string,SourceListItem>>();
|
||||
var newSl = new Dictionary<string, SourceListItem>();
|
||||
// add "none" source if VTC present
|
||||
|
||||
if (!string.IsNullOrEmpty(rmProps.VideoCodecKey))
|
||||
{
|
||||
var codecOsd = new SourceListItem()
|
||||
{
|
||||
Name = "None",
|
||||
IncludeInSourceList = true,
|
||||
Order = 1,
|
||||
Type = eSourceListItemType.Route,
|
||||
SourceKey = ""
|
||||
};
|
||||
newSl.Add("Source-None", codecOsd);
|
||||
}
|
||||
// add sources...
|
||||
for (uint i = 0; i <= 19; i++)
|
||||
{
|
||||
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[JoinMap.UseSourceEnabled.JoinNumber].BoolValue && string.IsNullOrEmpty(name))
|
||||
break;
|
||||
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{
|
||||
Icon = icon,
|
||||
Name = name,
|
||||
Order = (int)i + 10,
|
||||
SourceKey = key,
|
||||
Type = eSourceListItemType.Route,
|
||||
DisableCodecSharing = disableShare,
|
||||
};
|
||||
newSl.Add(key, newSLI);
|
||||
|
||||
string group = "genericsource";
|
||||
if (groupMap.ContainsKey(type))
|
||||
{
|
||||
group = groupMap[type];
|
||||
}
|
||||
|
||||
// add dev to devices list
|
||||
var devConf = new DeviceConfig {
|
||||
Group = group,
|
||||
Key = key,
|
||||
Name = name,
|
||||
Type = type
|
||||
};
|
||||
co.Devices.Add(devConf);
|
||||
|
||||
if (group.ToLower().StartsWith("settopbox")) // Add others here as needed
|
||||
{
|
||||
SetupSourceFunctions(key);
|
||||
}
|
||||
}
|
||||
|
||||
co.SourceLists.Add("default", newSl);
|
||||
|
||||
// Build "audioCodec" config if we need
|
||||
if (!string.IsNullOrEmpty(rmProps.AudioCodecKey))
|
||||
{
|
||||
var acFavs = new List<PepperDash.Essentials.Devices.Common.Codec.CodecActiveCallItem>();
|
||||
for (uint i = 0; i < 4; i++)
|
||||
{
|
||||
if (!EISC.GetBool(JoinMap.SpeedDialVisibleStartJoin.JoinNumber + i))
|
||||
{
|
||||
break;
|
||||
}
|
||||
acFavs.Add(new PepperDash.Essentials.Devices.Common.Codec.CodecActiveCallItem()
|
||||
{
|
||||
Name = EISC.GetString(JoinMap.SpeedDialNameStartJoin.JoinNumber + i),
|
||||
Number = EISC.GetString(JoinMap.SpeedDialNumberStartJoin.JoinNumber + i),
|
||||
Type = PepperDash.Essentials.Devices.Common.Codec.eCodecCallType.Audio
|
||||
});
|
||||
}
|
||||
|
||||
var acProps = new
|
||||
{
|
||||
favorites = acFavs
|
||||
};
|
||||
|
||||
var acStr = "audioCodec";
|
||||
var acConf = new DeviceConfig()
|
||||
{
|
||||
Group = acStr,
|
||||
Key = acStr,
|
||||
Name = acStr,
|
||||
Type = acStr,
|
||||
Properties = JToken.FromObject(acProps)
|
||||
};
|
||||
co.Devices.Add(acConf);
|
||||
}
|
||||
|
||||
// Build Video codec config
|
||||
if (!string.IsNullOrEmpty(rmProps.VideoCodecKey))
|
||||
{
|
||||
// No favorites, for now?
|
||||
var favs = new List<PepperDash.Essentials.Devices.Common.Codec.CodecActiveCallItem>();
|
||||
|
||||
// cameras
|
||||
var camsProps = new List<object>();
|
||||
for (uint i = 0; i < 9; i++)
|
||||
{
|
||||
var name = EISC.GetString(i + JoinMap.CameraNearNameStart.JoinNumber);
|
||||
if (!string.IsNullOrEmpty(name))
|
||||
{
|
||||
camsProps.Add(new
|
||||
{
|
||||
name = name,
|
||||
selector = "camera" + (i + 1),
|
||||
});
|
||||
}
|
||||
}
|
||||
var farName = EISC.GetString(JoinMap.CameraFarName.JoinNumber);
|
||||
if (!string.IsNullOrEmpty(farName))
|
||||
{
|
||||
camsProps.Add(new
|
||||
{
|
||||
name = farName,
|
||||
selector = "cameraFar",
|
||||
});
|
||||
}
|
||||
|
||||
var props = new
|
||||
{
|
||||
favorites = favs,
|
||||
cameras = camsProps,
|
||||
};
|
||||
var str = "videoCodec";
|
||||
var conf = new DeviceConfig()
|
||||
{
|
||||
Group = str,
|
||||
Key = str,
|
||||
Name = str,
|
||||
Type = str,
|
||||
Properties = JToken.FromObject(props)
|
||||
};
|
||||
co.Devices.Add(conf);
|
||||
}
|
||||
|
||||
SetupDeviceMessengers();
|
||||
|
||||
Debug.Console(0, this, "******* CONFIG FROM DDVC: \r{0}", JsonConvert.SerializeObject(ConfigReader.ConfigObject, Formatting.Indented));
|
||||
|
||||
var handler = ConfigurationIsReady;
|
||||
if (handler != null)
|
||||
{
|
||||
handler(this, new EventArgs());
|
||||
}
|
||||
|
||||
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>
|
||||
void SendFullStatus()
|
||||
{
|
||||
if (ConfigIsLoaded)
|
||||
{
|
||||
var count = EISC.UShortOutput[JoinMap.NumberOfAuxFaders.JoinNumber].UShortValue;
|
||||
|
||||
Debug.Console(1, this, "The Fader Count is : {0}", count);
|
||||
|
||||
// build volumes object, serialize and put in content of method below
|
||||
|
||||
// Create auxFaders
|
||||
var auxFaderDict = new Dictionary<string, Volume>();
|
||||
|
||||
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,
|
||||
EISC.UShortOutput[i].UShortValue,
|
||||
EISC.BooleanOutput[i].BoolValue,
|
||||
EISC.StringOutput[i].StringValue,
|
||||
true,
|
||||
"someting.png"));
|
||||
}
|
||||
|
||||
var volumes = new Volumes();
|
||||
|
||||
volumes.Master = new Volume("master",
|
||||
EISC.UShortOutput[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[JoinMap.PrivacyMute.JoinNumber].BoolValue;
|
||||
|
||||
volumes.AuxFaders = auxFaderDict;
|
||||
volumes.NumberOfAuxFaders = EISC.UShortInput[JoinMap.NumberOfAuxFaders.JoinNumber].UShortValue;
|
||||
|
||||
PostStatusMessage(new
|
||||
{
|
||||
activityMode = GetActivityMode(),
|
||||
isOn = EISC.BooleanOutput[JoinMap.RoomIsOn.JoinNumber].BoolValue,
|
||||
selectedSourceKey = EISC.StringOutput[JoinMap.CurrentSourceKey.JoinNumber].StringValue,
|
||||
volumes = volumes
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
PostStatusMessage(new
|
||||
{
|
||||
error = "systemNotReady"
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the activity mode int
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
int GetActivityMode()
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Helper for posting status message
|
||||
/// </summary>
|
||||
/// <param name="contentObject">The contents of the content object</param>
|
||||
void PostStatusMessage(object contentObject)
|
||||
{
|
||||
Parent.SendMessageToServer(JObject.FromObject(new
|
||||
{
|
||||
type = "/room/status/",
|
||||
content = contentObject
|
||||
}));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="messageType"></param>
|
||||
/// <param name="contentObject"></param>
|
||||
void PostMessage(string messageType, object contentObject)
|
||||
{
|
||||
Parent.SendMessageToServer(JObject.FromObject(new
|
||||
{
|
||||
type = messageType,
|
||||
content = contentObject
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="currentDevice"></param>
|
||||
/// <param name="args"></param>
|
||||
void EISC_SigChange(object currentDevice, Crestron.SimplSharpPro.SigEventArgs args)
|
||||
{
|
||||
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 != 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>
|
||||
/// Returns the mapping of types to groups, for setting up devices.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Dictionary<string, string> GetSourceGroupDictionary()
|
||||
{
|
||||
//type, group
|
||||
var d = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase)
|
||||
{
|
||||
{ "laptop", "pc" },
|
||||
{ "pc", "pc" },
|
||||
{ "wireless", "genericsource" },
|
||||
{ "iptv", "settopbox" }
|
||||
|
||||
};
|
||||
return d;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// updates the usercode from server
|
||||
/// </summary>
|
||||
protected override void UserCodeChange()
|
||||
{
|
||||
Debug.Console(1, this, "Server user code changed: {0}", UserCode);
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -4,7 +4,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
|
||||
namespace PepperDash.Essentials.Room.Cotija
|
||||
namespace PepperDash.Essentials.Room.MobileControl
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,7 @@ using Crestron.SimplSharp;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace PepperDash.Essentials.Room.Cotija
|
||||
namespace PepperDash.Essentials.Room.MobileControl
|
||||
{
|
||||
public class Volumes
|
||||
{
|
||||
@@ -14,11 +14,14 @@ namespace PepperDash.Essentials.Room.Cotija
|
||||
public Volume Master { get; set; }
|
||||
|
||||
[JsonProperty("auxFaders")]
|
||||
public List<Volume> AuxFaders { get; set; }
|
||||
public Dictionary<string, Volume> AuxFaders { get; set; }
|
||||
|
||||
[JsonProperty("numberOfAuxFaders")]
|
||||
public int NumberOfAuxFaders { get; set; }
|
||||
|
||||
public Volumes()
|
||||
{
|
||||
AuxFaders = new List<Volume>();
|
||||
AuxFaders = new Dictionary<string, Volume>();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,6 +42,13 @@ namespace PepperDash.Essentials.Room.Cotija
|
||||
[JsonProperty("hasMute")]
|
||||
public bool HasMute { get; set; }
|
||||
|
||||
[JsonProperty("hasPrivacyMute")]
|
||||
public bool HasPrivacyMute { get; set; }
|
||||
|
||||
[JsonProperty("privacyMuted")]
|
||||
public bool PrivacyMuted { get; set; }
|
||||
|
||||
|
||||
[JsonProperty("muteIcon")]
|
||||
public string MuteIcon { get; set; }
|
||||
|
||||
|
||||
61
PepperDashEssentials/Bridges/AirMediaControllerBridge.cs
Normal file
61
PepperDashEssentials/Bridges/AirMediaControllerBridge.cs
Normal file
@@ -0,0 +1,61 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Devices.Common;
|
||||
using PepperDash.Essentials.DM.AirMedia;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace PepperDash.Essentials.Core.Bridges
|
||||
{
|
||||
public static class AirMediaControllerApiExtensions
|
||||
{
|
||||
public static void LinkToApi(this AirMediaController airMedia, BasicTriList trilist, uint joinStart, string joinMapKey)
|
||||
{
|
||||
AirMediaControllerJoinMap joinMap = new AirMediaControllerJoinMap();
|
||||
|
||||
var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
|
||||
|
||||
if (!string.IsNullOrEmpty(joinMapSerialized))
|
||||
joinMap = JsonConvert.DeserializeObject<AirMediaControllerJoinMap>(joinMapSerialized);
|
||||
|
||||
joinMap.OffsetJoinNumbers(joinStart);
|
||||
|
||||
Debug.Console(1, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
||||
Debug.Console(0, "Linking to Airmedia: {0}", airMedia.Name);
|
||||
|
||||
trilist.StringInput[joinMap.Name].StringValue = airMedia.Name;
|
||||
|
||||
var commMonitor = airMedia as ICommunicationMonitor;
|
||||
if (commMonitor != null)
|
||||
{
|
||||
commMonitor.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
|
||||
}
|
||||
|
||||
airMedia.IsInSessionFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IsInSession]);
|
||||
airMedia.HdmiVideoSyncDetectedFeedback.LinkInputSig(trilist.BooleanInput[joinMap.HdmiVideoSync]);
|
||||
|
||||
trilist.SetSigTrueAction(joinMap.AutomaticInputRoutingEnabled, new Action( airMedia.AirMedia.DisplayControl.EnableAutomaticRouting));
|
||||
trilist.SetSigFalseAction(joinMap.AutomaticInputRoutingEnabled, new Action( airMedia.AirMedia.DisplayControl.DisableAutomaticRouting));
|
||||
airMedia.AutomaticInputRoutingEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.AutomaticInputRoutingEnabled]);
|
||||
|
||||
trilist.SetUShortSigAction(joinMap.VideoOut, new Action<ushort>((u) => airMedia.SelectVideoOut(u)));
|
||||
|
||||
airMedia.VideoOutFeedback.LinkInputSig(trilist.UShortInput[joinMap.VideoOut]);
|
||||
airMedia.ErrorFeedback.LinkInputSig(trilist.UShortInput[joinMap.ErrorFB]);
|
||||
airMedia.NumberOfUsersConnectedFeedback.LinkInputSig(trilist.UShortInput[joinMap.NumberOfUsersConnectedFB]);
|
||||
|
||||
trilist.SetUShortSigAction(joinMap.LoginCode, new Action<ushort>((u) => airMedia.AirMedia.AirMedia.LoginCode.UShortValue = u));
|
||||
airMedia.LoginCodeFeedback.LinkInputSig(trilist.UShortInput[joinMap.LoginCode]);
|
||||
|
||||
airMedia.ConnectionAddressFeedback.LinkInputSig(trilist.StringInput[joinMap.ConnectionAddressFB]);
|
||||
airMedia.HostnameFeedback.LinkInputSig(trilist.StringInput[joinMap.HostnameFB]);
|
||||
airMedia.SerialNumberFeedback.LinkInputSig(trilist.StringInput[joinMap.SerialNumberFeedback]);
|
||||
}
|
||||
}
|
||||
}
|
||||
41
PepperDashEssentials/Bridges/AppleTvBridge.cs
Normal file
41
PepperDashEssentials/Bridges/AppleTvBridge.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Devices.Common;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace PepperDash.Essentials.Core.Bridges
|
||||
{
|
||||
public static class AppleTvApiExtensions
|
||||
{
|
||||
public static void LinkToApi(this AppleTV appleTv, BasicTriList trilist, uint joinStart, string joinMapKey)
|
||||
{
|
||||
AppleTvJoinMap joinMap = new AppleTvJoinMap();
|
||||
|
||||
var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
|
||||
|
||||
if(!string.IsNullOrEmpty(joinMapSerialized))
|
||||
joinMap = JsonConvert.DeserializeObject<AppleTvJoinMap>(joinMapSerialized);
|
||||
|
||||
joinMap.OffsetJoinNumbers(joinStart);
|
||||
|
||||
Debug.Console(1, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
||||
Debug.Console(0, "Linking to Bridge Type {0}", appleTv.GetType().Name.ToString());
|
||||
|
||||
trilist.SetBoolSigAction(joinMap.UpArrow, (b) => appleTv.Up(b));
|
||||
trilist.SetBoolSigAction(joinMap.DnArrow, (b) => appleTv.Down(b));
|
||||
trilist.SetBoolSigAction(joinMap.LeftArrow, (b) => appleTv.Left(b));
|
||||
trilist.SetBoolSigAction(joinMap.RightArrow, (b) => appleTv.Right(b));
|
||||
trilist.SetBoolSigAction(joinMap.Select, (b) => appleTv.Select(b));
|
||||
trilist.SetBoolSigAction(joinMap.Menu, (b) => appleTv.Menu(b));
|
||||
trilist.SetBoolSigAction(joinMap.PlayPause, (b) => appleTv.Play(b));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,187 +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.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 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.TwoWayDisplayBase)
|
||||
{
|
||||
(device as TwoWayDisplayBase).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 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 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Debug.Console(1, this, "Devices Linked.");
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Handles incoming sig changes
|
||||
/// </summary>
|
||||
/// <param name="currentDevice"></param>
|
||||
/// <param name="args"></param>
|
||||
void Eisc_SigChange(object currentDevice, Crestron.SimplSharpPro.SigEventArgs args)
|
||||
{
|
||||
if (Debug.Level >= 1)
|
||||
Debug.Console(1, this, "EiscApi change: {0} {1}={2}", args.Sig.Type, args.Sig.Number, args.Sig.StringValue);
|
||||
var uo = args.Sig.UserObject;
|
||||
if (uo is Action<bool>)
|
||||
(uo as Action<bool>)(args.Sig.BoolValue);
|
||||
else if (uo is Action<ushort>)
|
||||
(uo as Action<ushort>)(args.Sig.UShortValue);
|
||||
else if (uo is Action<string>)
|
||||
(uo as Action<string>)(args.Sig.StringValue);
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
@@ -13,129 +14,116 @@ using PepperDash.Essentials.Bridges;
|
||||
using Crestron.SimplSharpPro;
|
||||
using Crestron.SimplSharpPro.EthernetCommunication;
|
||||
|
||||
namespace PepperDash.Essentials
|
||||
|
||||
namespace PepperDash.Essentials
|
||||
{
|
||||
public class BridgeFactory
|
||||
{
|
||||
public static IKeyed GetDevice(DeviceConfig dc)
|
||||
{
|
||||
// ? why is this static JTA 2018-06-13?
|
||||
|
||||
var key = dc.Key;
|
||||
var name = dc.Name;
|
||||
var type = dc.Type;
|
||||
var properties = dc.Properties;
|
||||
var propAnon = new { };
|
||||
|
||||
var typeName = dc.Type.ToLower();
|
||||
var groupName = dc.Group.ToLower();
|
||||
/// <summary>
|
||||
/// Responsible for loading all of the device types for this library
|
||||
/// </summary>
|
||||
public class BridgeFactory
|
||||
{
|
||||
public BridgeFactory()
|
||||
{
|
||||
var eiscApiAdvancedFactory = new EiscApiAdvancedFactory() as IDeviceFactory;
|
||||
eiscApiAdvancedFactory.LoadTypeFactories();
|
||||
|
||||
//Debug.Console(2, "Name {0}, Key {1}, Type {2}, Properties {3}", name, key, type, properties.ToString());
|
||||
var eiscApiFactory = new EiscApiFactory() as IDeviceFactory;
|
||||
eiscApiFactory.LoadTypeFactories();
|
||||
}
|
||||
|
||||
if (typeName == "eiscapi")
|
||||
{
|
||||
return new EiscApi(dc);
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
public class CommBridge : Device
|
||||
{
|
||||
public CommBridgeProperties Properties { get; private set; }
|
||||
|
||||
public List<IBasicCommunication> CommDevices { get; private set; }
|
||||
|
||||
public CommBridge(string key, string name, JToken properties)
|
||||
: base(key, name)
|
||||
{
|
||||
Properties = JsonConvert.DeserializeObject<CommBridgeProperties>(properties.ToString());
|
||||
}
|
||||
|
||||
public override bool CustomActivate()
|
||||
{
|
||||
// Create EiscApis
|
||||
if (Properties.Eiscs != null)
|
||||
{
|
||||
foreach (var eisc in Properties.Eiscs)
|
||||
{
|
||||
var ApiEisc = new BridgeApiEisc(eisc.IpId, eisc.Hostname);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var deviceKey in Properties.CommDevices)
|
||||
{
|
||||
var device = DeviceManager.GetDeviceForKey(deviceKey);
|
||||
|
||||
if (device != null)
|
||||
{
|
||||
Debug.Console(0, "deviceKey {0} Found in Device Manager", device.Key);
|
||||
CommDevices.Add(device as IBasicCommunication);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Console(0, "deviceKey {0} Not Found in Device Manager", deviceKey);
|
||||
}
|
||||
}
|
||||
|
||||
// Iterate through all the CommDevices and link up their Actions and Feedbacks
|
||||
|
||||
Debug.Console(0, "Bridge {0} Activated", this.Name);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class EiscBridgeProperties
|
||||
{
|
||||
public string ParentDeviceKey { get; set; }
|
||||
public eApiType ApiType { get; set; }
|
||||
public List<EiscProperties> Eiscs { get; set; }
|
||||
public string ApiOverrideFilePath { get; set; }
|
||||
|
||||
public class EiscProperties
|
||||
{
|
||||
public string IpId { get; set; }
|
||||
public string Hostname { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
public class CommBridgeProperties : EiscBridgeProperties
|
||||
{
|
||||
public List<string> CommDevices { get; set; }
|
||||
}
|
||||
|
||||
public enum eApiType { Eisc = 0 }
|
||||
|
||||
public class BridgeApiEisc
|
||||
{
|
||||
public uint Ipid { get; private set; }
|
||||
public ThreeSeriesTcpIpEthernetIntersystemCommunications Eisc { get; private set; }
|
||||
|
||||
public BridgeApiEisc(string ipid, string hostname)
|
||||
{
|
||||
Ipid = (UInt32)int.Parse(ipid, System.Globalization.NumberStyles.HexNumber);
|
||||
Eisc = new ThreeSeriesTcpIpEthernetIntersystemCommunications(Ipid, hostname, Global.ControlSystem);
|
||||
Eisc.Register();
|
||||
Eisc.SigChange += Eisc_SigChange;
|
||||
Debug.Console(0, "BridgeApiEisc Created at Ipid {0}", ipid);
|
||||
}
|
||||
void Eisc_SigChange(object currentDevice, Crestron.SimplSharpPro.SigEventArgs args)
|
||||
{
|
||||
if (Debug.Level >= 1)
|
||||
Debug.Console(1, "BridgeApiEisc change: {0} {1}={2}", args.Sig.Type, args.Sig.Number, args.Sig.StringValue);
|
||||
var uo = args.Sig.UserObject;
|
||||
if (uo is Action<bool>)
|
||||
(uo as Action<bool>)(args.Sig.BoolValue);
|
||||
else if (uo is Action<ushort>)
|
||||
(uo as Action<ushort>)(args.Sig.UShortValue);
|
||||
else if (uo is Action<string>)
|
||||
(uo as Action<string>)(args.Sig.StringValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class CommBridge : Device
|
||||
{
|
||||
public CommBridgeProperties Properties { get; private set; }
|
||||
|
||||
public List<IBasicCommunication> CommDevices { get; private set; }
|
||||
|
||||
public CommBridge(string key, string name, JToken properties)
|
||||
: base(key, name)
|
||||
{
|
||||
Properties = JsonConvert.DeserializeObject<CommBridgeProperties>(properties.ToString());
|
||||
}
|
||||
|
||||
public override bool CustomActivate()
|
||||
{
|
||||
// Create EiscApis
|
||||
if (Properties.Eiscs != null)
|
||||
{
|
||||
foreach (var eisc in Properties.Eiscs)
|
||||
{
|
||||
var ApiEisc = new BridgeApiEisc(eisc.IpId, eisc.Hostname);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var deviceKey in Properties.CommDevices)
|
||||
{
|
||||
var device = DeviceManager.GetDeviceForKey(deviceKey);
|
||||
|
||||
if (device != null)
|
||||
{
|
||||
Debug.Console(0, "deviceKey {0} Found in Device Manager", device.Key);
|
||||
CommDevices.Add(device as IBasicCommunication);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Console(0, "deviceKey {0} Not Found in Device Manager", deviceKey);
|
||||
}
|
||||
}
|
||||
|
||||
// Iterate through all the CommDevices and link up their Actions and Feedbacks
|
||||
|
||||
Debug.Console(0, "Bridge {0} Activated", this.Name);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class EiscBridgeProperties
|
||||
{
|
||||
public string ParentDeviceKey { get; set; }
|
||||
public eApiType ApiType { get; set; }
|
||||
public List<EiscProperties> Eiscs { get; set; }
|
||||
public string ApiOverrideFilePath { get; set; }
|
||||
|
||||
public class EiscProperties
|
||||
{
|
||||
public string IpId { get; set; }
|
||||
public string Hostname { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
public class CommBridgeProperties : EiscBridgeProperties
|
||||
{
|
||||
public List<string> CommDevices { get; set; }
|
||||
}
|
||||
|
||||
public enum eApiType { Eisc = 0 }
|
||||
|
||||
public class BridgeApiEisc
|
||||
{
|
||||
public uint Ipid { get; private set; }
|
||||
public ThreeSeriesTcpIpEthernetIntersystemCommunications Eisc { get; private set; }
|
||||
|
||||
public BridgeApiEisc(string ipid, string hostname)
|
||||
{
|
||||
Ipid = (UInt32)int.Parse(ipid, System.Globalization.NumberStyles.HexNumber);
|
||||
Eisc = new ThreeSeriesTcpIpEthernetIntersystemCommunications(Ipid, hostname, Global.ControlSystem);
|
||||
Eisc.Register();
|
||||
Eisc.SigChange += Eisc_SigChange;
|
||||
Debug.Console(0, "BridgeApiEisc Created at Ipid {0}", ipid);
|
||||
}
|
||||
void Eisc_SigChange(object currentDevice, Crestron.SimplSharpPro.SigEventArgs args)
|
||||
{
|
||||
if (Debug.Level >= 1)
|
||||
Debug.Console(1, "BridgeApiEisc change: {0} {1}={2}", args.Sig.Type, args.Sig.Number, args.Sig.StringValue);
|
||||
var uo = args.Sig.UserObject;
|
||||
if (uo is Action<bool>)
|
||||
(uo as Action<bool>)(args.Sig.BoolValue);
|
||||
else if (uo is Action<ushort>)
|
||||
(uo as Action<ushort>)(args.Sig.UShortValue);
|
||||
else if (uo is Action<string>)
|
||||
(uo as Action<string>)(args.Sig.StringValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
38
PepperDashEssentials/Bridges/C2nRthsControllerBridge.cs
Normal file
38
PepperDashEssentials/Bridges/C2nRthsControllerBridge.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
using Newtonsoft.Json;
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.CrestronIO;
|
||||
|
||||
namespace PepperDash.Essentials.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;
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -7,181 +7,163 @@ using Crestron.SimplSharpPro.DeviceSupport;
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Devices.Common;
|
||||
using PepperDash.Essentials.Devices.Common.Cameras;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace PepperDash.Essentials.Core.Bridges
|
||||
{
|
||||
public static class CameraControllerApiExtensions
|
||||
{
|
||||
public static class CameraControllerApiExtensions
|
||||
{
|
||||
public static void LinkToApi(this PepperDash.Essentials.Devices.Common.Cameras.CameraBase cameraDevice, BasicTriList trilist, uint joinStart, string joinMapKey, EiscApi bridge)
|
||||
{
|
||||
CameraControllerJoinMap joinMap = new CameraControllerJoinMap(joinStart);
|
||||
|
||||
// Adds the join map to the bridge
|
||||
bridge.AddJoinMap(cameraDevice.Key, joinMap);
|
||||
|
||||
public static BasicTriList _TriList;
|
||||
public static CameraControllerJoinMap JoinMap;
|
||||
public static void LinkToApi(this PepperDash.Essentials.Devices.Common.Cameras.CameraBase cameraDevice, BasicTriList trilist, uint joinStart, string joinMapKey)
|
||||
{
|
||||
JoinMap = JoinMapHelper.GetJoinMapForDevice(joinMapKey) as CameraControllerJoinMap;
|
||||
|
||||
_TriList = trilist;
|
||||
if (JoinMap == null)
|
||||
{
|
||||
JoinMap = new CameraControllerJoinMap();
|
||||
}
|
||||
|
||||
JoinMap.OffsetJoinNumbers(joinStart);
|
||||
Debug.Console(1, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
||||
Debug.Console(0, "Linking to Bridge Type {0}", cameraDevice.GetType().Name.ToString());
|
||||
var customJoins = JoinMapHelper.TryGetJoinMapAdvancedForDevice(joinMapKey);
|
||||
|
||||
var commMonitor = cameraDevice as ICommunicationMonitor;
|
||||
commMonitor.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[JoinMap.IsOnline]);
|
||||
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());
|
||||
|
||||
trilist.SetBoolSigAction(JoinMap.Left, (b) =>
|
||||
{
|
||||
if (b)
|
||||
{
|
||||
cameraDevice.PanLeft();
|
||||
}
|
||||
else
|
||||
{
|
||||
cameraDevice.Stop();
|
||||
}
|
||||
});
|
||||
trilist.SetBoolSigAction(JoinMap.Right, (b) =>
|
||||
{
|
||||
if (b)
|
||||
{
|
||||
cameraDevice.PanRight();
|
||||
}
|
||||
else
|
||||
{
|
||||
cameraDevice.Stop();
|
||||
}
|
||||
});
|
||||
var commMonitor = cameraDevice as ICommunicationMonitor;
|
||||
commMonitor.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline.JoinNumber]);
|
||||
|
||||
trilist.SetBoolSigAction(JoinMap.Up, (b) =>
|
||||
{
|
||||
if (b)
|
||||
{
|
||||
cameraDevice.TiltUp();
|
||||
}
|
||||
else
|
||||
{
|
||||
cameraDevice.Stop();
|
||||
}
|
||||
});
|
||||
trilist.SetBoolSigAction(JoinMap.Down, (b) =>
|
||||
{
|
||||
if (b)
|
||||
{
|
||||
cameraDevice.TiltDown();
|
||||
}
|
||||
else
|
||||
{
|
||||
cameraDevice.Stop();
|
||||
}
|
||||
});
|
||||
var ptzCamera = cameraDevice as IHasCameraPtzControl;
|
||||
|
||||
trilist.SetBoolSigAction(JoinMap.ZoomIn, (b) =>
|
||||
{
|
||||
if (b)
|
||||
{
|
||||
cameraDevice.ZoomIn();
|
||||
}
|
||||
else
|
||||
{
|
||||
cameraDevice.Stop();
|
||||
}
|
||||
});
|
||||
if (ptzCamera != null)
|
||||
{
|
||||
trilist.SetBoolSigAction(joinMap.PanLeft.JoinNumber, (b) =>
|
||||
{
|
||||
if (b)
|
||||
{
|
||||
ptzCamera.PanLeft();
|
||||
}
|
||||
else
|
||||
{
|
||||
ptzCamera.PanStop();
|
||||
}
|
||||
});
|
||||
trilist.SetBoolSigAction(joinMap.PanRight.JoinNumber, (b) =>
|
||||
{
|
||||
if (b)
|
||||
{
|
||||
ptzCamera.PanRight();
|
||||
}
|
||||
else
|
||||
{
|
||||
ptzCamera.PanStop();
|
||||
}
|
||||
});
|
||||
|
||||
trilist.SetBoolSigAction(JoinMap.ZoomOut, (b) =>
|
||||
{
|
||||
if (b)
|
||||
{
|
||||
cameraDevice.ZoomOut();
|
||||
}
|
||||
else
|
||||
{
|
||||
cameraDevice.Stop();
|
||||
}
|
||||
});
|
||||
trilist.SetBoolSigAction(joinMap.TiltUp.JoinNumber, (b) =>
|
||||
{
|
||||
if (b)
|
||||
{
|
||||
ptzCamera.TiltUp();
|
||||
}
|
||||
else
|
||||
{
|
||||
ptzCamera.TiltStop();
|
||||
}
|
||||
});
|
||||
trilist.SetBoolSigAction(joinMap.TiltDown.JoinNumber, (b) =>
|
||||
{
|
||||
if (b)
|
||||
{
|
||||
ptzCamera.TiltDown();
|
||||
}
|
||||
else
|
||||
{
|
||||
ptzCamera.TiltStop();
|
||||
}
|
||||
});
|
||||
|
||||
trilist.SetBoolSigAction(joinMap.ZoomIn.JoinNumber, (b) =>
|
||||
{
|
||||
if (b)
|
||||
{
|
||||
ptzCamera.ZoomIn();
|
||||
}
|
||||
else
|
||||
{
|
||||
ptzCamera.ZoomStop();
|
||||
}
|
||||
});
|
||||
|
||||
if (cameraDevice.GetType().Name.ToString().ToLower() == "cameravisca")
|
||||
{
|
||||
var viscaCamera = cameraDevice as PepperDash.Essentials.Devices.Common.Cameras.CameraVisca;
|
||||
trilist.SetSigTrueAction(JoinMap.PowerOn, () => viscaCamera.PowerOn());
|
||||
trilist.SetSigTrueAction(JoinMap.PowerOff, () => viscaCamera.PowerOff());
|
||||
trilist.SetBoolSigAction(joinMap.ZoomOut.JoinNumber, (b) =>
|
||||
{
|
||||
if (b)
|
||||
{
|
||||
ptzCamera.ZoomOut();
|
||||
}
|
||||
else
|
||||
{
|
||||
ptzCamera.ZoomStop();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
viscaCamera.PowerIsOnFeedback.LinkInputSig(trilist.BooleanInput[JoinMap.PowerOn]);
|
||||
viscaCamera.PowerIsOnFeedback.LinkComplementInputSig(trilist.BooleanInput[JoinMap.PowerOff]);
|
||||
if (cameraDevice is IPower)
|
||||
{
|
||||
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.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[JoinMap.IsOnline]);
|
||||
for (int i = 0; i < JoinMap.NumberOfPresets; i++)
|
||||
{
|
||||
int tempNum = i;
|
||||
trilist.SetSigTrueAction((ushort)(JoinMap.PresetRecallOffset + tempNum), () =>
|
||||
{
|
||||
viscaCamera.RecallPreset(tempNum);
|
||||
});
|
||||
trilist.SetSigTrueAction((ushort)(JoinMap.PresetSaveOffset + tempNum), () =>
|
||||
{
|
||||
viscaCamera.SavePreset(tempNum);
|
||||
});
|
||||
}
|
||||
}
|
||||
if (cameraDevice is ICommunicationMonitor)
|
||||
{
|
||||
var monitoredCamera = cameraDevice as ICommunicationMonitor;
|
||||
monitoredCamera.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline.JoinNumber]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
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 = "" ;
|
||||
|
||||
}
|
||||
public class CameraControllerJoinMap : JoinMapBase
|
||||
{
|
||||
public uint IsOnline { get; set; }
|
||||
public uint PowerOff { get; set; }
|
||||
public uint PowerOn { get; set; }
|
||||
public uint Up { get; set; }
|
||||
public uint Down { get; set; }
|
||||
public uint Left { get; set; }
|
||||
public uint Right { get; set; }
|
||||
public uint ZoomIn { get; set; }
|
||||
public uint ZoomOut { get; set; }
|
||||
public uint PresetRecallOffset { get; set; }
|
||||
public uint PresetSaveOffset { get; set; }
|
||||
public uint NumberOfPresets { get; set; }
|
||||
var preset = presetsCamera.Presets.FirstOrDefault(p => p.ID.Equals(i));
|
||||
|
||||
public CameraControllerJoinMap()
|
||||
{
|
||||
// Digital
|
||||
IsOnline = 9;
|
||||
PowerOff = 8;
|
||||
PowerOn = 7;
|
||||
Up = 1;
|
||||
Down = 2;
|
||||
Left = 3;
|
||||
Right = 4;
|
||||
ZoomIn = 5;
|
||||
ZoomOut = 6;
|
||||
PresetRecallOffset = 10;
|
||||
PresetSaveOffset = 30;
|
||||
NumberOfPresets = 5;
|
||||
// Analog
|
||||
}
|
||||
if (preset != null)
|
||||
label = preset.Description;
|
||||
|
||||
public override void OffsetJoinNumbers(uint joinStart)
|
||||
{
|
||||
var joinOffset = joinStart - 1;
|
||||
trilist.SetString((ushort)(joinMap.PresetLabelStart.JoinNumber + tempNum), label);
|
||||
}
|
||||
});
|
||||
|
||||
for (int i = 0; i < joinMap.NumberOfPresets.JoinNumber; i++)
|
||||
{
|
||||
int tempNum = i;
|
||||
|
||||
trilist.SetSigTrueAction((ushort)(joinMap.PresetRecallStart.JoinNumber + tempNum), () =>
|
||||
{
|
||||
presetsCamera.PresetSelect(tempNum);
|
||||
});
|
||||
trilist.SetSigTrueAction((ushort)(joinMap.PresetSaveStart.JoinNumber + tempNum), () =>
|
||||
{
|
||||
var label = trilist.GetString((ushort)(joinMap.PresetLabelStart.JoinNumber + tempNum));
|
||||
|
||||
presetsCamera.PresetStore(tempNum, label);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
IsOnline = IsOnline + joinOffset;
|
||||
PowerOff = PowerOff + joinOffset;
|
||||
PowerOn = PowerOn + joinOffset;
|
||||
Up = Up + joinOffset;
|
||||
Down = Down + joinOffset;
|
||||
Left = Left + joinOffset;
|
||||
Right = Right + joinOffset;
|
||||
ZoomIn = ZoomIn + joinOffset;
|
||||
ZoomOut = ZoomOut + joinOffset;
|
||||
PresetRecallOffset = PresetRecallOffset + joinOffset;
|
||||
PresetSaveOffset = PresetSaveOffset + joinOffset;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,77 +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;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
public static class DigitalLoggerApiExtensions
|
||||
{
|
||||
public static void LinkToApi(this DigitalLogger DigitalLogger, BasicTriList trilist, uint joinStart, string joinMapKey)
|
||||
{
|
||||
var joinMap = JoinMapHelper.GetJoinMapForDevice(joinMapKey) as DigitalLoggerJoinMap;
|
||||
|
||||
if (joinMap == null)
|
||||
joinMap = new DigitalLoggerJoinMap();
|
||||
|
||||
joinMap.OffsetJoinNumbers(joinStart);
|
||||
Debug.Console(1, DigitalLogger, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
||||
for (uint i = 1; i <= DigitalLogger.CircuitCount; i++)
|
||||
{
|
||||
var circuit = i;
|
||||
DigitalLogger.CircuitNameFeedbacks[circuit - 1].LinkInputSig(trilist.StringInput[joinMap.CircuitNames + circuit]);
|
||||
DigitalLogger.CircuitIsCritical[circuit - 1].LinkInputSig(trilist.BooleanInput[joinMap.CircuitIsCritical + circuit]);
|
||||
DigitalLogger.CircuitState[circuit - 1].LinkInputSig(trilist.BooleanInput[joinMap.CircuitState + circuit]);
|
||||
trilist.SetSigTrueAction(joinMap.CircuitCycle + circuit, () => DigitalLogger.CycleCircuit(circuit - 1));
|
||||
trilist.SetSigTrueAction(joinMap.CircuitOnCmd + circuit, () => DigitalLogger.TurnOnCircuit(circuit - 1));
|
||||
trilist.SetSigTrueAction(joinMap.CircuitOffCmd + circuit, () => DigitalLogger.TurnOffCircuit(circuit - 1));
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
public class DigitalLoggerJoinMap : JoinMapBase
|
||||
{
|
||||
public uint IsOnline { get; set; }
|
||||
public uint CircuitNames { get; set; }
|
||||
public uint CircuitState { get; set; }
|
||||
public uint CircuitCycle { get; set; }
|
||||
public uint CircuitIsCritical { get; set; }
|
||||
public uint CircuitOnCmd { get; set; }
|
||||
public uint CircuitOffCmd { get; set; }
|
||||
public DigitalLoggerJoinMap()
|
||||
{
|
||||
// Digital
|
||||
IsOnline = 9;
|
||||
CircuitState = 0;
|
||||
CircuitCycle = 0;
|
||||
CircuitIsCritical = 10;
|
||||
CircuitOnCmd = 10;
|
||||
CircuitOffCmd = 20;
|
||||
// Serial
|
||||
CircuitNames = 0;
|
||||
// Analog
|
||||
}
|
||||
|
||||
public override void OffsetJoinNumbers(uint joinStart)
|
||||
{
|
||||
var joinOffset = joinStart - 1;
|
||||
|
||||
IsOnline = IsOnline + joinOffset;
|
||||
CircuitNames = CircuitNames + joinOffset;
|
||||
CircuitState = CircuitState + joinOffset;
|
||||
CircuitCycle = CircuitCycle + joinOffset;
|
||||
CircuitIsCritical = CircuitIsCritical + joinOffset;
|
||||
CircuitOnCmd = CircuitOnCmd + joinOffset;
|
||||
CircuitOffCmd = CircuitOffCmd + joinOffset;
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,171 +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;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
public static class DisplayControllerApiExtensions
|
||||
{
|
||||
|
||||
public static BasicTriList _TriList;
|
||||
public static DisplayControllerJoinMap JoinMap;
|
||||
public static int InputNumber;
|
||||
public static IntFeedback InputNumberFeedback;
|
||||
public static List<string> InputKeys = new List<string>();
|
||||
public static void LinkToApi(this PepperDash.Essentials.Core.TwoWayDisplayBase displayDevice, BasicTriList trilist, uint joinStart, string joinMapKey)
|
||||
{
|
||||
JoinMap = JoinMapHelper.GetJoinMapForDevice(joinMapKey) as DisplayControllerJoinMap;
|
||||
_TriList = trilist;
|
||||
|
||||
if (JoinMap == null)
|
||||
{
|
||||
JoinMap = new DisplayControllerJoinMap();
|
||||
}
|
||||
|
||||
JoinMap.OffsetJoinNumbers(joinStart);
|
||||
Debug.Console(1, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
||||
Debug.Console(0, "Linking to Bridge Type {0}", displayDevice.GetType().Name.ToString());
|
||||
|
||||
trilist.StringInput[JoinMap.Name].StringValue = displayDevice.GetType().Name.ToString();
|
||||
|
||||
InputNumberFeedback = new IntFeedback(() => { return InputNumber;});
|
||||
InputNumberFeedback.LinkInputSig(trilist.UShortInput[JoinMap.InputSelect]);
|
||||
var commMonitor = displayDevice as ICommunicationMonitor;
|
||||
commMonitor.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[JoinMap.IsOnline]);
|
||||
|
||||
// Poewer Off
|
||||
trilist.SetSigTrueAction(JoinMap.PowerOff, () =>
|
||||
{
|
||||
InputNumber = 102;
|
||||
InputNumberFeedback.FireUpdate();
|
||||
displayDevice.PowerOff();
|
||||
});
|
||||
|
||||
displayDevice.PowerIsOnFeedback.OutputChange += new EventHandler<FeedbackEventArgs>(PowerIsOnFeedback_OutputChange);
|
||||
displayDevice.PowerIsOnFeedback.LinkComplementInputSig(trilist.BooleanInput[JoinMap.PowerOff]);
|
||||
|
||||
// Poewer On
|
||||
trilist.SetSigTrueAction(JoinMap.PowerOn, () =>
|
||||
{
|
||||
InputNumber = 0;
|
||||
InputNumberFeedback.FireUpdate();
|
||||
displayDevice.PowerOn();
|
||||
});
|
||||
|
||||
|
||||
displayDevice.PowerIsOnFeedback.LinkInputSig(trilist.BooleanInput[JoinMap.PowerOn]);
|
||||
|
||||
int count = 1;
|
||||
foreach (var input in displayDevice.InputPorts)
|
||||
{
|
||||
InputKeys.Add(input.Key.ToString());
|
||||
var tempKey = InputKeys.ElementAt(count - 1);
|
||||
trilist.SetSigTrueAction((ushort)(JoinMap.InputSelectOffset + count), () => { displayDevice.ExecuteSwitch(displayDevice.InputPorts[tempKey].Selector); });
|
||||
trilist.StringInput[(ushort)(JoinMap.InputNamesOffset + count)].StringValue = input.Key.ToString();
|
||||
count++;
|
||||
}
|
||||
|
||||
displayDevice.CurrentInputFeedback.OutputChange += new EventHandler<FeedbackEventArgs>(CurrentInputFeedback_OutputChange);
|
||||
trilist.SetUShortSigAction(JoinMap.InputSelect, (a) =>
|
||||
{
|
||||
if (a == 0)
|
||||
{
|
||||
displayDevice.PowerOff();
|
||||
InputNumber = 0;
|
||||
}
|
||||
else if (a > 0 && a < displayDevice.InputPorts.Count && a != InputNumber)
|
||||
{
|
||||
displayDevice.ExecuteSwitch(displayDevice.InputPorts.ElementAt(a - 1).Selector);
|
||||
InputNumber = a;
|
||||
}
|
||||
else if (a == 102)
|
||||
{
|
||||
displayDevice.PowerToggle();
|
||||
|
||||
}
|
||||
InputNumberFeedback.FireUpdate();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
static void CurrentInputFeedback_OutputChange(object sender, FeedbackEventArgs e)
|
||||
{
|
||||
|
||||
Debug.Console(0, "CurrentInputFeedback_OutputChange {0}", e.StringValue);
|
||||
|
||||
}
|
||||
|
||||
static void PowerIsOnFeedback_OutputChange(object sender, FeedbackEventArgs e)
|
||||
{
|
||||
|
||||
// Debug.Console(0, "PowerIsOnFeedback_OutputChange {0}", e.BoolValue);
|
||||
if (!e.BoolValue)
|
||||
{
|
||||
InputNumber = 102;
|
||||
InputNumberFeedback.FireUpdate();
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
InputNumber = 0;
|
||||
InputNumberFeedback.FireUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
public class DisplayControllerJoinMap : JoinMapBase
|
||||
{
|
||||
public uint Name { get; set; }
|
||||
public uint InputNamesOffset { get; set; }
|
||||
public uint InputSelectOffset { get; set; }
|
||||
public uint IsOnline { get; set; }
|
||||
public uint PowerOff { get; set; }
|
||||
public uint InputSelect { get; set; }
|
||||
public uint PowerOn { get; set; }
|
||||
public uint SelectScene { get; set; }
|
||||
public uint LightingSceneOffset { get; set; }
|
||||
public uint ButtonVisibilityOffset { get; set; }
|
||||
public uint IntegrationIdSet { get; set; }
|
||||
|
||||
public DisplayControllerJoinMap()
|
||||
{
|
||||
// Digital
|
||||
IsOnline = 50;
|
||||
PowerOff = 1;
|
||||
PowerOn = 2;
|
||||
InputSelect = 4;
|
||||
IntegrationIdSet = 1;
|
||||
LightingSceneOffset = 10;
|
||||
ButtonVisibilityOffset = 40;
|
||||
Name = 1;
|
||||
InputNamesOffset = 10;
|
||||
InputSelectOffset = 4;
|
||||
// Analog
|
||||
}
|
||||
|
||||
public override void OffsetJoinNumbers(uint joinStart)
|
||||
{
|
||||
var joinOffset = joinStart - 1;
|
||||
|
||||
IsOnline = IsOnline + joinOffset;
|
||||
PowerOff = PowerOff + joinOffset;
|
||||
PowerOn = PowerOn + joinOffset;
|
||||
SelectScene = SelectScene + joinOffset;
|
||||
LightingSceneOffset = LightingSceneOffset + joinOffset;
|
||||
ButtonVisibilityOffset = ButtonVisibilityOffset + joinOffset;
|
||||
Name = Name + joinOffset;
|
||||
InputNamesOffset = InputNamesOffset + joinOffset;
|
||||
InputSelectOffset = InputSelectOffset + joinOffset;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,130 +1,288 @@
|
||||
using System;
|
||||
|
||||
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;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace PepperDash.Essentials.Core.Bridges
|
||||
{
|
||||
public static class DmChassisControllerApiExtentions
|
||||
public static class DmChassisControllerApiExtentions
|
||||
{
|
||||
public static void LinkToApi(this DmChassisController dmChassis, BasicTriList trilist, uint joinStart, string joinMapKey)
|
||||
{
|
||||
var joinMap = JoinMapHelper.GetJoinMapForDevice(joinMapKey) as DmChassisControllerJoinMap;
|
||||
DmChassisControllerJoinMap joinMap = new DmChassisControllerJoinMap();
|
||||
|
||||
if (joinMap == null)
|
||||
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 - 1; i++)
|
||||
for (uint i = 1; i <= dmChassis.Chassis.NumberOfOutputs; i++)
|
||||
{
|
||||
var ioSlot = i;
|
||||
|
||||
// Control
|
||||
trilist.SetUShortSigAction(joinMap.OutputVideo + ioSlot, new Action<ushort>(o => dmChassis.ExecuteSwitch(o, ioSlot, eRoutingSignalType.Video)));
|
||||
trilist.SetUShortSigAction(joinMap.OutputAudio + ioSlot, new Action<ushort>(o => dmChassis.ExecuteSwitch(o, ioSlot, eRoutingSignalType.Audio)));
|
||||
if (dmChassis.TxDictionary.ContainsKey(ioSlot))
|
||||
{
|
||||
Debug.Console(2, "Creating Tx Feedbacks {0}", ioSlot);
|
||||
var TxKey = dmChassis.TxDictionary[ioSlot];
|
||||
var TxDevice = DeviceManager.GetDeviceForKey(TxKey) as DmTxControllerBase;
|
||||
TxDevice.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.InputEndpointOnline + ioSlot]);
|
||||
// TxDevice.AnyVideoInput.VideoStatus.VideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.InputEndpointOnline + ioSlot]);
|
||||
// trilist.SetUShortSigAction((ApiMap.HdcpSupport[ioSlot]), u => TxDevice.SetHdcpSupportAll((ePdtHdcpSupport)(u)));
|
||||
// TxDevice.HdcpSupportAllFeedback.LinkInputSig(trilist.UShortInput[joinMap. + ioSlot]);
|
||||
// trilist.UShortInput[ApiMap.HdcpSupportCapability[ioSlot]].UShortValue = TxDevice.HdcpSupportCapability;
|
||||
}
|
||||
else
|
||||
{
|
||||
// dmChassis.VideoInputSyncFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[ApiMap.TxVideoSyncStatus[ioSlot]]);
|
||||
}
|
||||
if (dmChassis.RxDictionary.ContainsKey(ioSlot))
|
||||
{
|
||||
Debug.Console(2, "Creating Rx Feedbacks {0}", ioSlot);
|
||||
var RxKey = dmChassis.RxDictionary[ioSlot];
|
||||
var RxDevice = DeviceManager.GetDeviceForKey(RxKey) as DmRmcControllerBase;
|
||||
RxDevice.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.OutputEndpointOnline + ioSlot]);
|
||||
}
|
||||
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.VideoInputSyncFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.VideoSyncStatus + 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.InputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.InputEndpointOnline + ioSlot]);
|
||||
// dmChassis.OutputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.OutputEndpointOnline + ioSlot]);
|
||||
|
||||
dmChassis.OutputDisabledByHdcpFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.OutputDisabledByHdcp + ioSlot]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class DmChassisControllerJoinMap : JoinMapBase
|
||||
static void SetHdcpStateAction(bool hdcpTypeSimple, HdmiInputWithCEC port, uint join, BasicTriList trilist)
|
||||
{
|
||||
public uint IsOnline { get; set; }
|
||||
public uint OutputVideo { get; set; }
|
||||
public uint OutputAudio { get; set; }
|
||||
public uint VideoSyncStatus { get; set; }
|
||||
public uint InputNames { get; set; }
|
||||
public uint OutputNames { get; set; }
|
||||
public uint OutputCurrentVideoInputNames { get; set; }
|
||||
public uint OutputCurrentAudioInputNames { get; set; }
|
||||
public uint InputCurrentResolution { get; set; }
|
||||
public uint InputEndpointOnline { get; set; }
|
||||
public uint OutputEndpointOnline { get; set; }
|
||||
//public uint HdcpSupport { get; set; }
|
||||
//public uint HdcpSupportCapability { get; set; }
|
||||
|
||||
|
||||
public DmChassisControllerJoinMap()
|
||||
if (hdcpTypeSimple)
|
||||
{
|
||||
IsOnline = 11;
|
||||
OutputVideo = 100; //101-299
|
||||
OutputAudio = 300; //301-499
|
||||
VideoSyncStatus = 100; //101-299
|
||||
InputNames = 100; //101-299
|
||||
OutputNames = 300; //301-499
|
||||
OutputCurrentVideoInputNames = 2000; //2001-2199
|
||||
OutputCurrentAudioInputNames = 2200; //2201-2399
|
||||
InputCurrentResolution = 2400; // 2401-2599
|
||||
InputEndpointOnline = 500;
|
||||
OutputEndpointOnline = 700;
|
||||
//HdcpSupport = 1000; //1001-1199
|
||||
//HdcpSupportCapability = 1200; //1201-1399
|
||||
|
||||
trilist.SetUShortSigAction(join,
|
||||
new Action<ushort>(s =>
|
||||
{
|
||||
if (s == 0)
|
||||
{
|
||||
port.HdcpSupportOff();
|
||||
}
|
||||
else if (s > 0)
|
||||
{
|
||||
port.HdcpSupportOn();
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
public override void OffsetJoinNumbers(uint joinStart)
|
||||
else
|
||||
{
|
||||
var joinOffset = joinStart - 1;
|
||||
|
||||
IsOnline = IsOnline + joinOffset;
|
||||
OutputVideo = OutputVideo + joinOffset;
|
||||
OutputAudio = OutputAudio + joinOffset;
|
||||
VideoSyncStatus = VideoSyncStatus + joinOffset;
|
||||
InputNames = InputNames + joinOffset;
|
||||
OutputNames = OutputNames + joinOffset;
|
||||
OutputCurrentVideoInputNames = OutputCurrentVideoInputNames + joinOffset;
|
||||
OutputCurrentAudioInputNames = OutputCurrentAudioInputNames + joinOffset;
|
||||
InputCurrentResolution = InputCurrentResolution + joinOffset;
|
||||
InputEndpointOnline = InputEndpointOnline + joinOffset;
|
||||
OutputEndpointOnline = OutputEndpointOnline + joinOffset;
|
||||
//HdcpSupport = HdcpSupport + joinOffset;
|
||||
//HdcpSupportCapability = HdcpSupportCapability + joinOffset;
|
||||
trilist.SetUShortSigAction(join,
|
||||
new Action<ushort>(u =>
|
||||
{
|
||||
port.HdcpReceiveCapability = (eHdcpCapabilityType)u;
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
static void SetHdcpStateAction(bool hdcpTypeSimple, EndpointHdmiInput port, uint join, BasicTriList trilist)
|
||||
{
|
||||
if (hdcpTypeSimple)
|
||||
{
|
||||
trilist.SetUShortSigAction(join,
|
||||
new Action<ushort>(s =>
|
||||
{
|
||||
if (s == 0)
|
||||
{
|
||||
port.HdcpSupportOff();
|
||||
}
|
||||
else if (s > 0)
|
||||
{
|
||||
port.HdcpSupportOn();
|
||||
}
|
||||
}));
|
||||
}
|
||||
else
|
||||
{
|
||||
trilist.SetUShortSigAction(join,
|
||||
new Action<ushort>(u =>
|
||||
{
|
||||
port.HdcpCapability = (eHdcpCapabilityType)u;
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
static void SetHdcpStateAction(bool supportsHdcp2, DMInputPortWithCec port, uint join, BasicTriList trilist)
|
||||
{
|
||||
if (!supportsHdcp2)
|
||||
{
|
||||
trilist.SetUShortSigAction(join,
|
||||
new Action<ushort>(s =>
|
||||
{
|
||||
if (s == 0)
|
||||
{
|
||||
port.HdcpSupportOff();
|
||||
}
|
||||
else if (s > 0)
|
||||
{
|
||||
port.HdcpSupportOn();
|
||||
}
|
||||
}));
|
||||
}
|
||||
else
|
||||
{
|
||||
trilist.SetUShortSigAction(join,
|
||||
new Action<ushort>(u =>
|
||||
{
|
||||
port.HdcpReceiveCapability = (eHdcpCapabilityType)u;
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -9,16 +9,20 @@ using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.DM;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace PepperDash.Essentials.Core.Bridges
|
||||
{
|
||||
public static class DmRmcControllerApiExtensions
|
||||
{
|
||||
public static void LinkToApi(this DmRmcControllerBase rmc, BasicTriList trilist, uint joinStart, string joinMapKey)
|
||||
{
|
||||
var joinMap = JoinMapHelper.GetJoinMapForDevice(joinMapKey) as DmRmcControllerJoinMap;
|
||||
DmRmcControllerJoinMap joinMap = new DmRmcControllerJoinMap();
|
||||
|
||||
if (joinMap == null)
|
||||
joinMap = new DmRmcControllerJoinMap();
|
||||
var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
|
||||
|
||||
if (!string.IsNullOrEmpty(joinMapSerialized))
|
||||
joinMap = JsonConvert.DeserializeObject<DmRmcControllerJoinMap>(joinMapSerialized);
|
||||
|
||||
joinMap.OffsetJoinNumbers(joinStart);
|
||||
|
||||
@@ -36,40 +40,5 @@ namespace PepperDash.Essentials.Bridges
|
||||
if(rmc.EdidSerialNumberFeedback != null)
|
||||
rmc.EdidSerialNumberFeedback.LinkInputSig(trilist.StringInput[joinMap.EdidSerialNumber]);
|
||||
}
|
||||
|
||||
public class DmRmcControllerJoinMap : JoinMapBase
|
||||
{
|
||||
public uint IsOnline { get; set; }
|
||||
public uint CurrentOutputResolution { get; set; }
|
||||
public uint EdidManufacturer { get; set; }
|
||||
public uint EdidName { get; set; }
|
||||
public uint EdidPrefferedTiming { get; set; }
|
||||
public uint EdidSerialNumber { get; set; }
|
||||
|
||||
public DmRmcControllerJoinMap()
|
||||
{
|
||||
// Digital
|
||||
IsOnline = 1;
|
||||
|
||||
// Serial
|
||||
CurrentOutputResolution = 1;
|
||||
EdidManufacturer = 2;
|
||||
EdidName = 3;
|
||||
EdidPrefferedTiming = 4;
|
||||
EdidSerialNumber = 5;
|
||||
}
|
||||
|
||||
public override void OffsetJoinNumbers(uint joinStart)
|
||||
{
|
||||
var joinOffset = joinStart - 1;
|
||||
|
||||
IsOnline = IsOnline + joinOffset;
|
||||
CurrentOutputResolution = CurrentOutputResolution + joinOffset;
|
||||
EdidManufacturer = EdidManufacturer + joinOffset;
|
||||
EdidName = EdidName + joinOffset;
|
||||
EdidPrefferedTiming = EdidPrefferedTiming + joinOffset;
|
||||
EdidSerialNumber = EdidSerialNumber + joinOffset;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,16 +12,20 @@ using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.DM;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace PepperDash.Essentials.Core.Bridges
|
||||
{
|
||||
public static class DmTxControllerApiExtensions
|
||||
{
|
||||
public static void LinkToApi(this DmTxControllerBase tx, BasicTriList trilist, uint joinStart, string joinMapKey)
|
||||
{
|
||||
var joinMap = JoinMapHelper.GetJoinMapForDevice(joinMapKey) as DmTxControllerJoinMap;
|
||||
DmTxControllerJoinMap joinMap = new DmTxControllerJoinMap();
|
||||
|
||||
if (joinMap == null)
|
||||
joinMap = new DmTxControllerJoinMap();
|
||||
var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
|
||||
|
||||
if (!string.IsNullOrEmpty(joinMapSerialized))
|
||||
joinMap = JsonConvert.DeserializeObject<DmTxControllerJoinMap>(joinMapSerialized);
|
||||
|
||||
joinMap.OffsetJoinNumbers(joinStart);
|
||||
|
||||
@@ -30,7 +34,7 @@ namespace PepperDash.Essentials.Bridges
|
||||
tx.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
|
||||
tx.AnyVideoInput.VideoStatus.VideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.VideoSyncStatus]);
|
||||
tx.AnyVideoInput.VideoStatus.VideoResolutionFeedback.LinkInputSig(trilist.StringInput[joinMap.CurrentInputResolution]);
|
||||
//tx.HdcpSupportAllFeedback.LinkInputSig(trilist.UShortInput[joinMap.HdcpSupportCapability]);
|
||||
trilist.UShortInput[joinMap.HdcpSupportCapability].UShortValue = (ushort)tx.HdcpSupportCapability;
|
||||
|
||||
bool hdcpTypeSimple;
|
||||
|
||||
@@ -53,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];
|
||||
|
||||
@@ -67,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];
|
||||
@@ -99,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)
|
||||
@@ -128,46 +148,6 @@ namespace PepperDash.Essentials.Bridges
|
||||
}
|
||||
}
|
||||
|
||||
public class DmTxControllerJoinMap : JoinMapBase
|
||||
{
|
||||
public uint IsOnline { get; set; }
|
||||
public uint VideoSyncStatus { get; set; }
|
||||
public uint CurrentInputResolution { get; set; }
|
||||
public uint HdcpSupportCapability { get; set; }
|
||||
public uint VideoInput { get; set; }
|
||||
public uint AudioInput { get; set; }
|
||||
public uint Port1HdcpState { get; set; }
|
||||
public uint Port2HdcpState { get; set; }
|
||||
|
||||
|
||||
public DmTxControllerJoinMap()
|
||||
{
|
||||
// Digital
|
||||
IsOnline = 1;
|
||||
VideoSyncStatus = 2;
|
||||
// Serial
|
||||
CurrentInputResolution = 1;
|
||||
// Analog
|
||||
VideoInput = 1;
|
||||
AudioInput = 2;
|
||||
HdcpSupportCapability = 3;
|
||||
Port1HdcpState = 4;
|
||||
Port2HdcpState = 5;
|
||||
}
|
||||
|
||||
public override void OffsetJoinNumbers(uint joinStart)
|
||||
{
|
||||
var joinOffset = joinStart - 1;
|
||||
|
||||
IsOnline = IsOnline + joinOffset;
|
||||
VideoSyncStatus = VideoSyncStatus + joinOffset;
|
||||
CurrentInputResolution = CurrentInputResolution + joinOffset;
|
||||
VideoInput = VideoInput + joinOffset;
|
||||
AudioInput = AudioInput + joinOffset;
|
||||
HdcpSupportCapability = HdcpSupportCapability + joinOffset;
|
||||
Port1HdcpState = Port1HdcpState + joinOffset;
|
||||
Port2HdcpState = Port2HdcpState + joinOffset;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
using Crestron.SimplSharpPro.DM;
|
||||
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.DM;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace PepperDash.Essentials.Core.Bridges
|
||||
{
|
||||
public static class DmpsAudioOutputControllerApiExtensions
|
||||
{
|
||||
public static void LinkToApi(this DmpsAudioOutputController dmAudioOutputController, BasicTriList trilist, uint joinStart, string joinMapKey)
|
||||
{
|
||||
DmpsAudioOutputControllerJoinMap joinMap = new DmpsAudioOutputControllerJoinMap();
|
||||
|
||||
var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
|
||||
|
||||
if (!string.IsNullOrEmpty(joinMapSerialized))
|
||||
joinMap = JsonConvert.DeserializeObject<DmpsAudioOutputControllerJoinMap>(joinMapSerialized);
|
||||
|
||||
joinMap.OffsetJoinNumbers(joinStart);
|
||||
|
||||
Debug.Console(1, dmAudioOutputController, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
||||
|
||||
if (dmAudioOutputController.MasterVolumeLevel != null)
|
||||
{
|
||||
SetUpDmpsAudioOutputJoins(trilist, dmAudioOutputController.MasterVolumeLevel, joinMap.MasterVolume);
|
||||
}
|
||||
|
||||
if (dmAudioOutputController.SourceVolumeLevel != null)
|
||||
{
|
||||
SetUpDmpsAudioOutputJoins(trilist, dmAudioOutputController.SourceVolumeLevel, joinMap.SourceVolume);
|
||||
}
|
||||
|
||||
if (dmAudioOutputController.Codec1VolumeLevel != null)
|
||||
{
|
||||
SetUpDmpsAudioOutputJoins(trilist, dmAudioOutputController.Codec1VolumeLevel, joinMap.Codec1Volume);
|
||||
}
|
||||
|
||||
if (dmAudioOutputController.Codec2VolumeLevel != null)
|
||||
{
|
||||
SetUpDmpsAudioOutputJoins(trilist, dmAudioOutputController.Codec2VolumeLevel, joinMap.Codec2Volume);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static void SetUpDmpsAudioOutputJoins(BasicTriList trilist, DmpsAudioOutput output, uint joinStart)
|
||||
{
|
||||
var volumeLevelJoin = joinStart;
|
||||
var muteOnJoin = joinStart;
|
||||
var muteOffJoin = joinStart + 1;
|
||||
var volumeUpJoin = joinStart + 2;
|
||||
var volumeDownJoin = joinStart + 3;
|
||||
|
||||
|
||||
trilist.SetUShortSigAction(volumeLevelJoin, new Action<ushort>(o => output.SetVolume(o)));
|
||||
output.VolumeLevelFeedback.LinkInputSig(trilist.UShortInput[volumeLevelJoin]);
|
||||
|
||||
trilist.SetSigTrueAction(muteOnJoin, new Action(output.MuteOn));
|
||||
output.MuteFeedback.LinkInputSig(trilist.BooleanInput[muteOnJoin]);
|
||||
trilist.SetSigTrueAction(muteOffJoin, new Action(output.MuteOff));
|
||||
output.MuteFeedback.LinkComplementInputSig(trilist.BooleanInput[muteOffJoin]);
|
||||
|
||||
trilist.SetBoolSigAction(volumeUpJoin, new Action<bool>(b => output.VolumeUp(b)));
|
||||
trilist.SetBoolSigAction(volumeDownJoin, new Action<bool>(b => output.VolumeDown(b)));
|
||||
}
|
||||
}
|
||||
}
|
||||
128
PepperDashEssentials/Bridges/DmpsRoutingControllerBridge.cs
Normal file
128
PepperDashEssentials/Bridges/DmpsRoutingControllerBridge.cs
Normal file
@@ -0,0 +1,128 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
using Crestron.SimplSharpPro.DM;
|
||||
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.DM;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace PepperDash.Essentials.Core.Bridges
|
||||
{
|
||||
public static class DmpsRoutingControllerApiExtentions
|
||||
{
|
||||
public static void LinkToApi(this DmpsRoutingController dmpsRouter, BasicTriList trilist, uint joinStart, string joinMapKey)
|
||||
{
|
||||
DmpsRoutingControllerJoinMap joinMap = new DmpsRoutingControllerJoinMap();
|
||||
|
||||
var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
|
||||
|
||||
if (!string.IsNullOrEmpty(joinMapSerialized))
|
||||
joinMap = JsonConvert.DeserializeObject<DmpsRoutingControllerJoinMap>(joinMapSerialized);
|
||||
|
||||
joinMap.OffsetJoinNumbers(joinStart);
|
||||
|
||||
Debug.Console(1, dmpsRouter, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
||||
|
||||
// Link up outputs
|
||||
for (uint i = 1; i <= dmpsRouter.Dmps.NumberOfSwitcherInputs; i++)
|
||||
{
|
||||
Debug.Console(2, dmpsRouter, "Linking Input Card {0}", i);
|
||||
|
||||
var ioSlot = i;
|
||||
|
||||
//if (dmpsRouter.TxDictionary.ContainsKey(ioSlot))
|
||||
//{
|
||||
// Debug.Console(2, "Creating Tx Feedbacks {0}", ioSlot);
|
||||
// var TxKey = dmpsRouter.TxDictionary[ioSlot];
|
||||
// var TxDevice = DeviceManager.GetDeviceForKey(TxKey) as DmTxControllerBase;
|
||||
// //TxDevice.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.InputEndpointOnline + ioSlot]);
|
||||
// // TxDevice.AnyVideoInput.VideoStatus.VideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.InputEndpointOnline + ioSlot]);
|
||||
// // trilist.SetUShortSigAction((ApiMap.HdcpSupport[ioSlot]), u => TxDevice.SetHdcpSupportAll((ePdtHdcpSupport)(u)));
|
||||
// // TxDevice.HdcpSupportAllFeedback.LinkInputSig(trilist.UShortInput[joinMap. + ioSlot]);
|
||||
// // trilist.UShortInput[ApiMap.HdcpSupportCapability[ioSlot]].UShortValue = TxDevice.HdcpSupportCapability;
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// // dmChassis.VideoInputSyncFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[ApiMap.TxVideoSyncStatus[ioSlot]]);
|
||||
//}
|
||||
|
||||
if(dmpsRouter.VideoInputSyncFeedbacks[ioSlot] != null)
|
||||
dmpsRouter.VideoInputSyncFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.VideoSyncStatus + ioSlot]);
|
||||
|
||||
if (dmpsRouter.InputNameFeedbacks[ioSlot] != null)
|
||||
dmpsRouter.InputNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.InputNames + ioSlot]);
|
||||
|
||||
trilist.SetStringSigAction(joinMap.InputNames + ioSlot, new Action<string>(s =>
|
||||
{
|
||||
var inputCard = dmpsRouter.Dmps.SwitcherInputs[ioSlot] as DMInput;
|
||||
|
||||
if (inputCard != null)
|
||||
{
|
||||
if (inputCard.NameFeedback != null && !string.IsNullOrEmpty(inputCard.NameFeedback.StringValue) && inputCard.NameFeedback.StringValue != s)
|
||||
if(inputCard.Name != null)
|
||||
inputCard.Name.StringValue = s;
|
||||
}
|
||||
}));
|
||||
|
||||
|
||||
if(dmpsRouter.InputEndpointOnlineFeedbacks[ioSlot] != null)
|
||||
dmpsRouter.InputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.InputEndpointOnline + ioSlot]);
|
||||
}
|
||||
|
||||
for (uint i = 1; i <= dmpsRouter.Dmps.NumberOfSwitcherOutputs; i++)
|
||||
{
|
||||
Debug.Console(2, dmpsRouter, "Linking Output Card {0}", i);
|
||||
|
||||
var ioSlot = i;
|
||||
// Control
|
||||
trilist.SetUShortSigAction(joinMap.OutputVideo + ioSlot, new Action<ushort>(o => dmpsRouter.ExecuteSwitch(o, ioSlot, eRoutingSignalType.Video)));
|
||||
trilist.SetUShortSigAction(joinMap.OutputAudio + ioSlot, new Action<ushort>(o => dmpsRouter.ExecuteSwitch(o, ioSlot, eRoutingSignalType.Audio)));
|
||||
|
||||
trilist.SetStringSigAction(joinMap.OutputNames + ioSlot, new Action<string>(s =>
|
||||
{
|
||||
var outputCard = dmpsRouter.Dmps.SwitcherOutputs[ioSlot] as DMOutput;
|
||||
|
||||
//Debug.Console(2, dmpsRouter, "Output Name String Sig Action for Output Card {0}", ioSlot);
|
||||
|
||||
if (outputCard != null)
|
||||
{
|
||||
//Debug.Console(2, dmpsRouter, "Card Type: {0}", outputCard.CardInputOutputType);
|
||||
|
||||
if (!(outputCard is Crestron.SimplSharpPro.DM.Cards.Card.Dmps3CodecOutput) && outputCard.NameFeedback != null)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(outputCard.NameFeedback.StringValue))
|
||||
{
|
||||
//Debug.Console(2, dmpsRouter, "NameFeedabck: {0}", outputCard.NameFeedback.StringValue);
|
||||
|
||||
if (outputCard.NameFeedback.StringValue != s && outputCard.Name != null)
|
||||
{
|
||||
outputCard.Name.StringValue = s;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}));
|
||||
|
||||
// Feedback
|
||||
if(dmpsRouter.VideoOutputFeedbacks[ioSlot] != null)
|
||||
dmpsRouter.VideoOutputFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.OutputVideo + ioSlot]);
|
||||
if (dmpsRouter.AudioOutputFeedbacks[ioSlot] != null)
|
||||
dmpsRouter.AudioOutputFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.OutputAudio + ioSlot]);
|
||||
if (dmpsRouter.OutputNameFeedbacks[ioSlot] != null)
|
||||
dmpsRouter.OutputNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputNames + ioSlot]);
|
||||
if (dmpsRouter.OutputVideoRouteNameFeedbacks[ioSlot] != null)
|
||||
dmpsRouter.OutputVideoRouteNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputCurrentVideoInputNames + ioSlot]);
|
||||
if (dmpsRouter.OutputAudioRouteNameFeedbacks[ioSlot] != null)
|
||||
dmpsRouter.OutputAudioRouteNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputCurrentAudioInputNames + ioSlot]);
|
||||
if (dmpsRouter.OutputEndpointOnlineFeedbacks[ioSlot] != null)
|
||||
dmpsRouter.OutputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.OutputEndpointOnline + ioSlot]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -8,96 +8,67 @@ using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Devices.Common;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace PepperDash.Essentials.Core.Bridges
|
||||
{
|
||||
public static class GenericLightingApiExtensions
|
||||
{
|
||||
public static void LinkToApi(this PepperDash.Essentials.Core.Lighting.LightingBase lightingDevice, BasicTriList trilist, uint joinStart, string joinMapKey)
|
||||
{
|
||||
var joinMap = JoinMapHelper.GetJoinMapForDevice(joinMapKey) as GenericLightingJoinMap;
|
||||
public static class GenericLightingApiExtensions
|
||||
{
|
||||
public static void LinkToApi(this PepperDash.Essentials.Core.Lighting.LightingBase lightingDevice, BasicTriList trilist, uint joinStart, string joinMapKey)
|
||||
{
|
||||
GenericLightingJoinMap joinMap = new GenericLightingJoinMap();
|
||||
|
||||
if (joinMap == null)
|
||||
joinMap = new GenericLightingJoinMap();
|
||||
var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
|
||||
|
||||
joinMap.OffsetJoinNumbers(joinStart);
|
||||
Debug.Console(1, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
||||
if (!string.IsNullOrEmpty(joinMapSerialized))
|
||||
joinMap = JsonConvert.DeserializeObject<GenericLightingJoinMap>(joinMapSerialized);
|
||||
|
||||
joinMap.OffsetJoinNumbers(joinStart);
|
||||
|
||||
Debug.Console(1, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
||||
|
||||
Debug.Console(0, "Linking to Lighting Type {0}", lightingDevice.GetType().Name.ToString());
|
||||
|
||||
// GenericLighitng Actions & FeedBack
|
||||
trilist.SetUShortSigAction(joinMap.SelectScene, u => lightingDevice.SelectScene(lightingDevice.LightingScenes[u]));
|
||||
|
||||
int sceneIndex = 1;
|
||||
foreach (var scene in lightingDevice.LightingScenes)
|
||||
{
|
||||
var tempIndex = sceneIndex - 1;
|
||||
trilist.SetSigTrueAction((uint)(joinMap.LightingSceneOffset + sceneIndex), () => lightingDevice.SelectScene(lightingDevice.LightingScenes[tempIndex]));
|
||||
scene.IsActiveFeedback.LinkInputSig(trilist.BooleanInput[(uint)(joinMap.LightingSceneOffset + sceneIndex)]);
|
||||
trilist.StringInput[(uint)(joinMap.LightingSceneOffset + sceneIndex)].StringValue = scene.Name;
|
||||
trilist.BooleanInput[(uint)(joinMap.ButtonVisibilityOffset + sceneIndex)].BoolValue = true;
|
||||
sceneIndex++;
|
||||
}
|
||||
|
||||
if (lightingDevice.GetType().Name.ToString() == "LutronQuantumArea")
|
||||
{
|
||||
var lutronDevice = lightingDevice as PepperDash.Essentials.Devices.Common.Environment.Lutron.LutronQuantumArea;
|
||||
lutronDevice.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
|
||||
trilist.SetStringSigAction(joinMap.IntegrationIdSet, s => lutronDevice.IntegrationId = s);
|
||||
}
|
||||
|
||||
//ApiEisc.Eisc.SetStringSigAction(ApiMap.integrationID, (s) => { lutronLights.IntegrationId = s; });
|
||||
|
||||
|
||||
/*
|
||||
var lutronLights = lightingDevice as PepperDash.Essentials.Devices.Common.Environment.Lutron.LutronQuantumArea;
|
||||
|
||||
|
||||
|
||||
Debug.Console(0, "Linking to lighting Type {0}", lightingDevice.GetType().Name.ToString());
|
||||
|
||||
// GenericLighitng Actions & FeedBack
|
||||
trilist.SetUShortSigAction(joinMap.SelectScene, u => lightingDevice.SelectScene(lightingDevice.LightingScenes[u]));
|
||||
|
||||
int sceneIndex = 1;
|
||||
foreach (var scene in lightingDevice.LightingScenes)
|
||||
{
|
||||
var tempIndex = sceneIndex - 1;
|
||||
trilist.SetSigTrueAction((uint)(joinMap.LightingSceneOffset + sceneIndex), () => lightingDevice.SelectScene(lightingDevice.LightingScenes[tempIndex]));
|
||||
scene.IsActiveFeedback.LinkInputSig(trilist.BooleanInput[(uint)(joinMap.LightingSceneOffset + sceneIndex)]);
|
||||
trilist.StringInput[(uint)(joinMap.LightingSceneOffset + sceneIndex)].StringValue = scene.Name;
|
||||
trilist.BooleanInput[(uint)(joinMap.ButtonVisibilityOffset + sceneIndex)].BoolValue = true;
|
||||
sceneIndex++;
|
||||
}
|
||||
|
||||
if (lightingDevice.GetType().Name.ToString() == "LutronQuantumArea")
|
||||
{
|
||||
var lutronDevice = lightingDevice as PepperDash.Essentials.Devices.Common.Environment.Lutron.LutronQuantumArea;
|
||||
lutronDevice.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
|
||||
trilist.SetStringSigAction(joinMap.IntegrationIdSet, s => lutronDevice.IntegrationId = s);
|
||||
}
|
||||
|
||||
//ApiEisc.Eisc.SetStringSigAction(ApiMap.integrationID, (s) => { lutronLights.IntegrationId = s; });
|
||||
|
||||
|
||||
/*
|
||||
var lutronLights = lightingDevice as PepperDash.Essentials.Devices.Common.Environment.Lutron.LutronQuantumArea;
|
||||
|
||||
|
||||
for (uint i = 1; i <= lightingBase.CircuitCount; i++)
|
||||
for (uint i = 1; i <= lightingBase.CircuitCount; i++)
|
||||
{
|
||||
var circuit = i;
|
||||
lightingBase.CircuitNameFeedbacks[circuit - 1].LinkInputSig(trilist.StringInput[joinMap.CircuitNames + circuit]);
|
||||
lightingBase.CircuitIsCritical[circuit - 1].LinkInputSig(trilist.BooleanInput[joinMap.CircuitIsCritical + circuit]);
|
||||
lightingBase.CircuitState[circuit - 1].LinkInputSig(trilist.BooleanInput[joinMap.CircuitState + circuit]);
|
||||
trilist.SetSigTrueAction(joinMap.CircuitCycle + circuit, () => lightingBase.CycleCircuit(circuit - 1));
|
||||
trilist.SetSigTrueAction(joinMap.CircuitOnCmd + circuit, () => lightingBase.TurnOnCircuit(circuit - 1));
|
||||
trilist.SetSigTrueAction(joinMap.CircuitOffCmd + circuit, () => lightingBase.TurnOffCircuit(circuit - 1));
|
||||
lightingBase.CircuitNameFeedbacks[circuit - 1].LinkInputSig(trilist.StringInput[joinMap.CircuitNames + circuit]);
|
||||
lightingBase.CircuitIsCritical[circuit - 1].LinkInputSig(trilist.BooleanInput[joinMap.CircuitIsCritical + circuit]);
|
||||
lightingBase.CircuitState[circuit - 1].LinkInputSig(trilist.BooleanInput[joinMap.CircuitState + circuit]);
|
||||
trilist.SetSigTrueAction(joinMap.CircuitCycle + circuit, () => lightingBase.CycleCircuit(circuit - 1));
|
||||
trilist.SetSigTrueAction(joinMap.CircuitOnCmd + circuit, () => lightingBase.TurnOnCircuit(circuit - 1));
|
||||
trilist.SetSigTrueAction(joinMap.CircuitOffCmd + circuit, () => lightingBase.TurnOffCircuit(circuit - 1));
|
||||
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
public class GenericLightingJoinMap : JoinMapBase
|
||||
{
|
||||
public uint IsOnline { get; set; }
|
||||
public uint SelectScene { get; set; }
|
||||
public uint LightingSceneOffset { get; set; }
|
||||
public uint ButtonVisibilityOffset { get; set; }
|
||||
public uint IntegrationIdSet { get; set; }
|
||||
|
||||
public GenericLightingJoinMap()
|
||||
{
|
||||
// Digital
|
||||
IsOnline = 1;
|
||||
SelectScene = 1;
|
||||
IntegrationIdSet = 1;
|
||||
LightingSceneOffset = 10;
|
||||
ButtonVisibilityOffset = 40;
|
||||
// Analog
|
||||
}
|
||||
|
||||
public override void OffsetJoinNumbers(uint joinStart)
|
||||
{
|
||||
var joinOffset = joinStart - 1;
|
||||
|
||||
IsOnline = IsOnline + joinOffset;
|
||||
SelectScene = SelectScene + joinOffset;
|
||||
LightingSceneOffset = LightingSceneOffset + joinOffset;
|
||||
ButtonVisibilityOffset = ButtonVisibilityOffset + joinOffset;
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,21 +5,24 @@ using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
|
||||
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.CrestronIO;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace PepperDash.Essentials.Core.Bridges
|
||||
{
|
||||
public static class GenericRelayDeviceApiExtensions
|
||||
{
|
||||
public static void LinkToApi(this GenericRelayDevice relay, BasicTriList trilist, uint joinStart, string joinMapKey)
|
||||
{
|
||||
var joinMap = JoinMapHelper.GetJoinMapForDevice(joinMapKey) as GenericRelayControllerJoinMap;
|
||||
GenericRelayControllerJoinMap joinMap = new GenericRelayControllerJoinMap();
|
||||
|
||||
if (joinMap == null)
|
||||
joinMap = new GenericRelayControllerJoinMap();
|
||||
var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
|
||||
|
||||
if (!string.IsNullOrEmpty(joinMapSerialized))
|
||||
joinMap = JsonConvert.DeserializeObject<GenericRelayControllerJoinMap>(joinMapSerialized);
|
||||
|
||||
joinMap.OffsetJoinNumbers(joinStart);
|
||||
|
||||
@@ -45,22 +48,4 @@ namespace PepperDash.Essentials.Bridges
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public class GenericRelayControllerJoinMap : JoinMapBase
|
||||
{
|
||||
//Digital
|
||||
public uint Relay { get; set; }
|
||||
|
||||
public GenericRelayControllerJoinMap()
|
||||
{
|
||||
Relay = 1;
|
||||
}
|
||||
|
||||
public override void OffsetJoinNumbers(uint joinStart)
|
||||
{
|
||||
var joinOffset = joinStart - 1;
|
||||
|
||||
Relay = Relay + joinOffset;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,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.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
|
||||
}
|
||||
}
|
||||
}
|
||||
66
PepperDashEssentials/Bridges/HdMdxxxCEControllerBridge.cs
Normal file
66
PepperDashEssentials/Bridges/HdMdxxxCEControllerBridge.cs
Normal file
@@ -0,0 +1,66 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
using Crestron.SimplSharpPro.DM;
|
||||
using Crestron.SimplSharpPro.DM.Endpoints;
|
||||
using Crestron.SimplSharpPro.DM.Endpoints.Receivers;
|
||||
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.DM;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace PepperDash.Essentials.Core.Bridges
|
||||
{
|
||||
public static class HdMdxxxCEControllerApiExtensions
|
||||
{
|
||||
public static void LinkToApi(this HdMdxxxCEController hdMdPair, BasicTriList trilist, uint joinStart, string joinMapKey)
|
||||
{
|
||||
HdMdxxxCEControllerJoinMap joinMap = new HdMdxxxCEControllerJoinMap();
|
||||
|
||||
var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
|
||||
|
||||
if (!string.IsNullOrEmpty(joinMapSerialized))
|
||||
joinMap = JsonConvert.DeserializeObject<HdMdxxxCEControllerJoinMap>(joinMapSerialized);
|
||||
|
||||
joinMap.OffsetJoinNumbers(joinStart);
|
||||
|
||||
Debug.Console(1, hdMdPair, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
||||
|
||||
hdMdPair.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
|
||||
hdMdPair.RemoteEndDetectedFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RemoteEndDetected]);
|
||||
|
||||
trilist.SetSigTrueAction(joinMap.AutoRouteOn, new Action(() => hdMdPair.AutoRouteOn()));
|
||||
hdMdPair.AutoRouteOnFeedback.LinkInputSig(trilist.BooleanInput[joinMap.AutoRouteOn]);
|
||||
trilist.SetSigTrueAction(joinMap.AutoRouteOff, new Action(() => hdMdPair.AutoRouteOff()));
|
||||
hdMdPair.AutoRouteOnFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.AutoRouteOff]);
|
||||
|
||||
trilist.SetSigTrueAction(joinMap.PriorityRoutingOn, new Action(() => hdMdPair.PriorityRouteOn()));
|
||||
hdMdPair.PriorityRoutingOnFeedback.LinkInputSig(trilist.BooleanInput[joinMap.PriorityRoutingOn]);
|
||||
trilist.SetSigTrueAction(joinMap.PriorityRoutingOff, new Action(() => hdMdPair.PriorityRouteOff()));
|
||||
hdMdPair.PriorityRoutingOnFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.PriorityRoutingOff]);
|
||||
|
||||
trilist.SetSigTrueAction(joinMap.InputOnScreenDisplayEnabled, new Action(() => hdMdPair.OnScreenDisplayEnable()));
|
||||
hdMdPair.InputOnScreenDisplayEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.InputOnScreenDisplayEnabled]);
|
||||
trilist.SetSigTrueAction(joinMap.AutoRouteOff, new Action(() => hdMdPair.OnScreenDisplayDisable()));
|
||||
hdMdPair.InputOnScreenDisplayEnabledFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.InputOnScreenDisplayDisabled]);
|
||||
|
||||
trilist.SetUShortSigAction(joinMap.VideoSource, new Action<ushort>((i) => hdMdPair.ExecuteSwitch(i, null, eRoutingSignalType.Video | eRoutingSignalType.Audio)));
|
||||
hdMdPair.VideoSourceFeedback.LinkInputSig(trilist.UShortInput[joinMap.VideoSource]);
|
||||
|
||||
trilist.UShortInput[joinMap.SourceCount].UShortValue = (ushort)hdMdPair.InputPorts.Count;
|
||||
|
||||
foreach (var input in hdMdPair.InputPorts)
|
||||
{
|
||||
var number = Convert.ToUInt16(input.Selector);
|
||||
hdMdPair.SyncDetectedFeedbacks[number].LinkInputSig(trilist.BooleanInput[joinMap.SyncDetected + number]);
|
||||
trilist.StringInput[joinMap.SourceNames + number].StringValue = input.Key;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,17 +8,20 @@ using Crestron.SimplSharpPro.DeviceSupport;
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace PepperDash.Essentials.Core.Bridges
|
||||
{
|
||||
public static class IBasicCommunicationApiExtensions
|
||||
{
|
||||
public static void LinkToApi(this GenericComm comm, BasicTriList trilist, uint joinStart, string joinMapKey)
|
||||
{
|
||||
var joinMap = JoinMapHelper.GetJoinMapForDevice(joinMapKey) as IBasicCommunicationJoinMap;
|
||||
IBasicCommunicationJoinMap joinMap = new IBasicCommunicationJoinMap();
|
||||
|
||||
if (joinMap == null)
|
||||
joinMap = new IBasicCommunicationJoinMap();
|
||||
var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
|
||||
|
||||
if (!string.IsNullOrEmpty(joinMapSerialized))
|
||||
joinMap = JsonConvert.DeserializeObject<IBasicCommunicationJoinMap>(joinMapSerialized);
|
||||
joinMap.OffsetJoinNumbers(joinStart);
|
||||
|
||||
if (comm.CommPort == null)
|
||||
@@ -30,10 +33,14 @@ namespace PepperDash.Essentials.Bridges
|
||||
Debug.Console(1, comm, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
||||
|
||||
// this is a permanent event handler. This cannot be -= from event
|
||||
comm.CommPort.TextReceived += (s, a) => trilist.SetString(joinMap.TextReceived, a.Text);
|
||||
comm.CommPort.TextReceived += (s, a) =>
|
||||
{
|
||||
Debug.Console(2, comm, "RX: {0}", a.Text);
|
||||
trilist.SetString(joinMap.TextReceived, a.Text);
|
||||
};
|
||||
trilist.SetStringSigAction(joinMap.SendText, new Action<string>(s => comm.CommPort.SendText(s)));
|
||||
trilist.SetStringSigAction(joinMap.SetPortConfig + 1, new Action<string>(s => comm.SetPortConfig(s)));
|
||||
|
||||
trilist.SetStringSigAction(joinMap.SetPortConfig, new Action<string>(s => comm.SetPortConfig(s)));
|
||||
|
||||
|
||||
var sComm = comm.CommPort as ISocketStatus;
|
||||
if (sComm != null)
|
||||
@@ -58,46 +65,5 @@ namespace PepperDash.Essentials.Bridges
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public class IBasicCommunicationJoinMap : JoinMapBase
|
||||
{
|
||||
//Digital
|
||||
public uint Connect { get; set; }
|
||||
public uint Connected { get; set; }
|
||||
|
||||
//Analog
|
||||
public uint Status { get; set; }
|
||||
|
||||
// Serial
|
||||
public uint TextReceived { get; set; }
|
||||
public uint SendText { get; set; }
|
||||
public uint SetPortConfig { get; set; }
|
||||
|
||||
|
||||
public IBasicCommunicationJoinMap()
|
||||
{
|
||||
TextReceived = 1;
|
||||
SendText = 1;
|
||||
SetPortConfig = 2;
|
||||
Connect = 1;
|
||||
Connected = 1;
|
||||
Status = 1;
|
||||
}
|
||||
|
||||
public override void OffsetJoinNumbers(uint joinStart)
|
||||
{
|
||||
var joinOffset = joinStart - 1;
|
||||
|
||||
TextReceived = TextReceived + joinOffset;
|
||||
SendText = SendText + joinOffset;
|
||||
SetPortConfig = SetPortConfig + joinOffset;
|
||||
Connect = Connect + joinOffset;
|
||||
Connected = Connected + joinOffset;
|
||||
Status = Status + joinOffset;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
12
PepperDashEssentials/Bridges/IBridge.cs
Normal file
12
PepperDashEssentials/Bridges/IBridge.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
|
||||
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:Core.Bridges.IBridge
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -6,18 +6,23 @@ using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.CrestronIO;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace PepperDash.Essentials.Core.Bridges
|
||||
{
|
||||
public static class IDigitalInputApiExtenstions
|
||||
{
|
||||
public static void LinkToApi(this IDigitalInput input, BasicTriList trilist, uint joinStart, string joinMapKey)
|
||||
{
|
||||
var joinMap = JoinMapHelper.GetJoinMapForDevice(joinMapKey) as IDigitalInputApiJoinMap;
|
||||
IDigitalInputJoinMap joinMap = new IDigitalInputJoinMap();
|
||||
|
||||
if (joinMap == null)
|
||||
joinMap = new IDigitalInputApiJoinMap();
|
||||
var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
|
||||
|
||||
if (!string.IsNullOrEmpty(joinMapSerialized))
|
||||
joinMap = JsonConvert.DeserializeObject<IDigitalInputJoinMap>(joinMapSerialized);
|
||||
|
||||
joinMap.OffsetJoinNumbers(joinStart);
|
||||
|
||||
@@ -35,25 +40,5 @@ namespace PepperDash.Essentials.Bridges
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public class IDigitalInputApiJoinMap : JoinMapBase
|
||||
{
|
||||
//Digital
|
||||
public uint InputState { get; set; }
|
||||
|
||||
public IDigitalInputApiJoinMap()
|
||||
{
|
||||
InputState = 1;
|
||||
}
|
||||
|
||||
public override void OffsetJoinNumbers(uint joinStart)
|
||||
{
|
||||
var joinOffset = joinStart - 1;
|
||||
|
||||
InputState = InputState + joinOffset;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
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));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
public static class JoinMapHelper
|
||||
{
|
||||
/// <summary>
|
||||
/// Attempts to get the join map from config
|
||||
/// </summary>
|
||||
/// <param name="joinMapKey"></param>
|
||||
/// <returns></returns>
|
||||
public static JoinMapBase GetJoinMapForDevice(string joinMapKey)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(joinMapKey))
|
||||
return null;
|
||||
|
||||
// FUTURE TODO: Get the join map from the ConfigReader.ConfigObject
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public abstract class JoinMapBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Modifies all the join numbers by adding the offset. This should never be called twice
|
||||
/// </summary>
|
||||
/// <param name="joinStart"></param>
|
||||
public abstract void OffsetJoinNumbers(uint joinStart);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,111 @@
|
||||
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 AirMediaControllerJoinMap : JoinMapBase
|
||||
{
|
||||
#region Digitals
|
||||
/// <summary>
|
||||
/// Indicates that the device is online when high
|
||||
/// </summary>
|
||||
public uint IsOnline { get; set; }
|
||||
/// <summary>
|
||||
/// Indicates that the device is in session when high
|
||||
/// </summary>
|
||||
public uint IsInSession { get; set; }
|
||||
/// <summary>
|
||||
/// Indicates sync detected on HDMI input when high
|
||||
/// </summary>
|
||||
public uint HdmiVideoSync { get; set; }
|
||||
/// <summary>
|
||||
/// Set High to enable automatic input routing and low to disable. Feedback high when enabled
|
||||
/// </summary>
|
||||
public uint AutomaticInputRoutingEnabled { get; set; }
|
||||
#endregion
|
||||
|
||||
#region Analogs
|
||||
/// <summary>
|
||||
/// Selects source and provides feedback
|
||||
/// </summary>
|
||||
public uint VideoOut { get; set; }
|
||||
/// <summary>
|
||||
/// Provided error feedback
|
||||
/// </summary>
|
||||
public uint ErrorFB { get; set; }
|
||||
/// <summary>
|
||||
/// Indicates the number of connected users as feedback
|
||||
/// </summary>
|
||||
public uint NumberOfUsersConnectedFB { get; set; }
|
||||
/// <summary>
|
||||
/// Sets the login code and provides the current code as feedback
|
||||
/// </summary>
|
||||
public uint LoginCode { get; set; }
|
||||
#endregion
|
||||
|
||||
#region Serials
|
||||
/// <summary>
|
||||
/// Provides the name defined in config as feedback
|
||||
/// </summary>
|
||||
public uint Name { get; set; }
|
||||
/// <summary>
|
||||
/// Provides the connection address as feedback
|
||||
/// </summary>
|
||||
public uint ConnectionAddressFB { get; set; }
|
||||
/// <summary>
|
||||
/// Provides the hostname as feedback
|
||||
/// </summary>
|
||||
public uint HostnameFB { get; set; }
|
||||
/// <summary>
|
||||
/// Provides the serial number as feedback
|
||||
/// </summary>
|
||||
public uint SerialNumberFeedback { get; set; }
|
||||
#endregion
|
||||
|
||||
public AirMediaControllerJoinMap()
|
||||
{
|
||||
// Digital
|
||||
IsOnline = 1;
|
||||
IsInSession = 2;
|
||||
HdmiVideoSync = 3;
|
||||
AutomaticInputRoutingEnabled = 4;
|
||||
|
||||
// Analog
|
||||
VideoOut = 1;
|
||||
ErrorFB = 2;
|
||||
NumberOfUsersConnectedFB = 3;
|
||||
LoginCode = 4;
|
||||
|
||||
// Serial
|
||||
Name = 1;
|
||||
ConnectionAddressFB = 2;
|
||||
HostnameFB = 3;
|
||||
SerialNumberFeedback = 4;
|
||||
}
|
||||
|
||||
public override void OffsetJoinNumbers(uint joinStart)
|
||||
{
|
||||
var joinOffset = joinStart - 1;
|
||||
|
||||
IsOnline = IsOnline + joinOffset;
|
||||
IsInSession = IsInSession + joinOffset;
|
||||
HdmiVideoSync = HdmiVideoSync + joinOffset;
|
||||
AutomaticInputRoutingEnabled = AutomaticInputRoutingEnabled + joinOffset;
|
||||
|
||||
VideoOut = VideoOut + joinOffset;
|
||||
ErrorFB = ErrorFB + joinOffset;
|
||||
NumberOfUsersConnectedFB = NumberOfUsersConnectedFB + joinOffset;
|
||||
LoginCode = LoginCode + joinOffset;
|
||||
|
||||
Name = Name + joinOffset;
|
||||
ConnectionAddressFB = ConnectionAddressFB + joinOffset;
|
||||
HostnameFB = HostnameFB + joinOffset;
|
||||
SerialNumberFeedback = SerialNumberFeedback + joinOffset;
|
||||
}
|
||||
}
|
||||
}
|
||||
68
PepperDashEssentials/Bridges/JoinMaps/AppleTvJoinMap.cs
Normal file
68
PepperDashEssentials/Bridges/JoinMaps/AppleTvJoinMap.cs
Normal file
@@ -0,0 +1,68 @@
|
||||
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 AppleTvJoinMap : JoinMapBase
|
||||
{
|
||||
#region Digitals
|
||||
/// <summary>
|
||||
/// Sends up arrow command while high
|
||||
/// </summary>
|
||||
public uint UpArrow { get; set; }
|
||||
/// <summary>
|
||||
/// Sends down arrow command while high
|
||||
/// </summary>
|
||||
public uint DnArrow { get; set; }
|
||||
/// <summary>
|
||||
/// Sends left arrow command while high
|
||||
/// </summary>
|
||||
public uint LeftArrow { get; set; }
|
||||
/// <summary>
|
||||
/// Sends right arrow command while high
|
||||
/// </summary>
|
||||
public uint RightArrow { get; set; }
|
||||
/// <summary>
|
||||
/// Sends menu command
|
||||
/// </summary>
|
||||
public uint Menu { get; set; }
|
||||
/// <summary>
|
||||
/// Sends select command
|
||||
/// </summary>
|
||||
public uint Select { get; set; }
|
||||
/// <summary>
|
||||
/// Sends play/pause command
|
||||
/// </summary>
|
||||
public uint PlayPause { get; set; }
|
||||
#endregion
|
||||
|
||||
public AppleTvJoinMap()
|
||||
{
|
||||
UpArrow = 1;
|
||||
DnArrow = 2;
|
||||
LeftArrow = 3;
|
||||
RightArrow = 4;
|
||||
Menu = 5;
|
||||
Select = 6;
|
||||
PlayPause = 7;
|
||||
}
|
||||
|
||||
public override void OffsetJoinNumbers(uint joinStart)
|
||||
{
|
||||
var joinOffset = joinStart - 1;
|
||||
|
||||
UpArrow = UpArrow + joinOffset;
|
||||
DnArrow = DnArrow + joinOffset;
|
||||
LeftArrow = LeftArrow + joinOffset;
|
||||
RightArrow = RightArrow + joinOffset;
|
||||
Menu = Menu + joinOffset;
|
||||
Select = Select + joinOffset;
|
||||
PlayPause = PlayPause + joinOffset;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
|
||||
using PepperDash.Essentials.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
/// <summary>
|
||||
/// Join map for CameraBase devices
|
||||
/// </summary>
|
||||
///
|
||||
[Obsolete("Please use version PepperDash.Essentials.Core.Bridges")]
|
||||
public class CameraControllerJoinMap : JoinMapBaseAdvanced
|
||||
{
|
||||
[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 });
|
||||
|
||||
[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))
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
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 DigitalLoggerJoinMap : JoinMapBase
|
||||
{
|
||||
public uint IsOnline { get; set; }
|
||||
public uint CircuitNames { get; set; }
|
||||
public uint CircuitState { get; set; }
|
||||
public uint CircuitCycle { get; set; }
|
||||
public uint CircuitIsCritical { get; set; }
|
||||
public uint CircuitOnCmd { get; set; }
|
||||
public uint CircuitOffCmd { get; set; }
|
||||
|
||||
public DigitalLoggerJoinMap()
|
||||
{
|
||||
// Digital
|
||||
IsOnline = 9;
|
||||
CircuitState = 0;
|
||||
CircuitCycle = 0;
|
||||
CircuitIsCritical = 10;
|
||||
CircuitOnCmd = 10;
|
||||
CircuitOffCmd = 20;
|
||||
// Serial
|
||||
CircuitNames = 0;
|
||||
// Analog
|
||||
}
|
||||
|
||||
public override void OffsetJoinNumbers(uint joinStart)
|
||||
{
|
||||
var joinOffset = joinStart - 1;
|
||||
|
||||
IsOnline = IsOnline + joinOffset;
|
||||
CircuitNames = CircuitNames + joinOffset;
|
||||
CircuitState = CircuitState + joinOffset;
|
||||
CircuitCycle = CircuitCycle + joinOffset;
|
||||
CircuitIsCritical = CircuitIsCritical + joinOffset;
|
||||
CircuitOnCmd = CircuitOnCmd + joinOffset;
|
||||
CircuitOffCmd = CircuitOffCmd + joinOffset;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
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 DisplayControllerJoinMap : JoinMapBase
|
||||
{
|
||||
#region Digitals
|
||||
/// <summary>
|
||||
/// Turns the display off and reports power off feedback
|
||||
/// </summary>
|
||||
public uint PowerOff { get; set; }
|
||||
/// <summary>
|
||||
/// Turns the display on and repots power on feedback
|
||||
/// </summary>
|
||||
public uint PowerOn { get; set; }
|
||||
/// <summary>
|
||||
/// Indicates that the display device supports two way communication when high
|
||||
/// </summary>
|
||||
public uint IsTwoWayDisplay { get; set; }
|
||||
/// <summary>
|
||||
/// Increments the volume while high
|
||||
/// </summary>
|
||||
public uint VolumeUp { get; set; }
|
||||
/// <summary>
|
||||
/// Decrements teh volume while high
|
||||
/// </summary>
|
||||
public uint VolumeDown { get; set; }
|
||||
/// <summary>
|
||||
/// Toggles the mute state. Feedback is high when volume is muted
|
||||
/// </summary>
|
||||
public uint VolumeMute { get; set; }
|
||||
/// <summary>
|
||||
/// Range of digital joins to select inputs and report current input as feedback
|
||||
/// </summary>
|
||||
public uint InputSelectOffset { get; set; }
|
||||
/// <summary>
|
||||
/// Range of digital joins to report visibility for input buttons
|
||||
/// </summary>
|
||||
public uint ButtonVisibilityOffset { get; set; }
|
||||
/// <summary>
|
||||
/// High if the device is online
|
||||
/// </summary>
|
||||
public uint IsOnline { get; set; }
|
||||
#endregion
|
||||
|
||||
#region Analogs
|
||||
/// <summary>
|
||||
/// Analog join to set the input and report current input as feedback
|
||||
/// </summary>
|
||||
public uint InputSelect { get; set; }
|
||||
/// <summary>
|
||||
/// Sets the volume level and reports the current level as feedback
|
||||
/// </summary>
|
||||
public uint VolumeLevel { get; set; }
|
||||
#endregion
|
||||
|
||||
#region Serials
|
||||
/// <summary>
|
||||
/// Reports the name of the display as defined in config as feedback
|
||||
/// </summary>
|
||||
public uint Name { get; set; }
|
||||
/// <summary>
|
||||
/// Range of serial joins that reports the names of the inputs as feedback
|
||||
/// </summary>
|
||||
public uint InputNamesOffset { get; set; }
|
||||
#endregion
|
||||
|
||||
public DisplayControllerJoinMap()
|
||||
{
|
||||
// Digital
|
||||
IsOnline = 50;
|
||||
PowerOff = 1;
|
||||
PowerOn = 2;
|
||||
IsTwoWayDisplay = 3;
|
||||
VolumeUp = 5;
|
||||
VolumeDown = 6;
|
||||
VolumeMute = 7;
|
||||
|
||||
ButtonVisibilityOffset = 40;
|
||||
InputSelectOffset = 10;
|
||||
|
||||
// Analog
|
||||
InputSelect = 11;
|
||||
VolumeLevel = 5;
|
||||
|
||||
// Serial
|
||||
Name = 1;
|
||||
InputNamesOffset = 10;
|
||||
}
|
||||
|
||||
public override void OffsetJoinNumbers(uint joinStart)
|
||||
{
|
||||
var joinOffset = joinStart - 1;
|
||||
|
||||
IsOnline = IsOnline + joinOffset;
|
||||
PowerOff = PowerOff + joinOffset;
|
||||
PowerOn = PowerOn + joinOffset;
|
||||
IsTwoWayDisplay = IsTwoWayDisplay + joinOffset;
|
||||
ButtonVisibilityOffset = ButtonVisibilityOffset + joinOffset;
|
||||
Name = Name + joinOffset;
|
||||
InputNamesOffset = InputNamesOffset + joinOffset;
|
||||
InputSelectOffset = InputSelectOffset + joinOffset;
|
||||
|
||||
InputSelect = InputSelect + joinOffset;
|
||||
|
||||
VolumeUp = VolumeUp + joinOffset;
|
||||
VolumeDown = VolumeDown + joinOffset;
|
||||
VolumeMute = VolumeMute + joinOffset;
|
||||
VolumeLevel = VolumeLevel + joinOffset;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,152 @@
|
||||
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 DmChassisControllerJoinMap : JoinMapBase
|
||||
{
|
||||
#region Digital/Analogs
|
||||
/// <summary>
|
||||
/// Analog input sets System ID, output reports current ID as feedback.
|
||||
/// Digital input applies System ID, output is high when applying busy.
|
||||
/// </summary>
|
||||
public uint SystemId { get; set; }
|
||||
#endregion
|
||||
|
||||
#region Digitals
|
||||
/// <summary>
|
||||
/// High when device is online
|
||||
/// </summary>
|
||||
public uint IsOnline { get; set; }
|
||||
/// <summary>
|
||||
/// Range reports video sync feedback for each input
|
||||
/// </summary>
|
||||
public uint VideoSyncStatus { get; set; }
|
||||
/// <summary>
|
||||
/// Range reports high if corresponding input's endpoint is online
|
||||
/// </summary>
|
||||
public uint InputEndpointOnline { get; set; }
|
||||
/// <summary>
|
||||
/// Range reports high if corresponding output's endpoint is online
|
||||
/// </summary>
|
||||
public uint OutputEndpointOnline { get; set; }
|
||||
/// <summary>
|
||||
/// Range reports high if corresponding input's transmitter supports bridging as a separate device for detailed AV switching, HDCP control, etc.
|
||||
/// </summary>
|
||||
public uint TxAdvancedIsPresent { get; set; } // indicates that there is an attached transmitter that should be bridged to be interacted with
|
||||
/// <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
|
||||
/// <summary>
|
||||
/// Range sets and reports the current video source for the corresponding output
|
||||
/// </summary>
|
||||
public uint OutputVideo { get; set; }
|
||||
/// <summary>
|
||||
/// Range sets and reports the current audio source for the corresponding output
|
||||
/// </summary>
|
||||
public uint OutputAudio { get; set; }
|
||||
/// <summary>
|
||||
/// Range sets and reports the current Usb source for the corresponding output
|
||||
/// </summary>
|
||||
public uint OutputUsb { get; set; }
|
||||
/// <summary>
|
||||
/// Range sets and reports the current Usb source for the corresponding input
|
||||
/// </summary>
|
||||
public uint InputUsb { get; set; }
|
||||
/// <summary>
|
||||
/// Range sets and reports the current HDCP state for the corresponding input card
|
||||
/// </summary>
|
||||
public uint HdcpSupportState { get; set; }
|
||||
/// <summary>
|
||||
/// Range reports the highest supported HDCP state level for the corresponding input card
|
||||
/// </summary>
|
||||
public uint HdcpSupportCapability { get; set; }
|
||||
#endregion
|
||||
|
||||
#region Serials
|
||||
/// <summary>
|
||||
/// Range sets and reports the name for the corresponding input card
|
||||
/// </summary>
|
||||
public uint InputNames { get; set; }
|
||||
/// <summary>
|
||||
/// Range sets and reports the name for the corresponding output card
|
||||
/// </summary>
|
||||
public uint OutputNames { get; set; }
|
||||
/// <summary>
|
||||
/// Range reports the name of the current video source for the corresponding output card
|
||||
/// </summary>
|
||||
public uint OutputCurrentVideoInputNames { get; set; }
|
||||
/// <summary>
|
||||
/// Range reports the name of the current audio source for the corresponding output card
|
||||
/// </summary>
|
||||
public uint OutputCurrentAudioInputNames { get; set; }
|
||||
/// <summary>
|
||||
/// Range reports the current input resolution for each corresponding input card
|
||||
/// </summary>
|
||||
public uint InputCurrentResolution { get; set; }
|
||||
#endregion
|
||||
|
||||
public DmChassisControllerJoinMap()
|
||||
{
|
||||
//Digital/Analog
|
||||
SystemId = 10; // Analog sets/gets SystemId, digital input applies and provides feedback of ID change busy
|
||||
|
||||
//Digital
|
||||
IsOnline = 11;
|
||||
VideoSyncStatus = 100; //101-299
|
||||
InputEndpointOnline = 500; //501-699
|
||||
OutputEndpointOnline = 700; //701-899
|
||||
TxAdvancedIsPresent = 1000; //1001-1199
|
||||
OutputDisabledByHdcp = 1200; //1201-1399
|
||||
|
||||
//Analog
|
||||
OutputVideo = 100; //101-299
|
||||
OutputAudio = 300; //301-499
|
||||
OutputUsb = 500; //501-699
|
||||
InputUsb = 700; //701-899
|
||||
HdcpSupportState = 1000; //1001-1199
|
||||
HdcpSupportCapability = 1200; //1201-1399
|
||||
|
||||
|
||||
//Serial
|
||||
InputNames = 100; //101-299
|
||||
OutputNames = 300; //301-499
|
||||
OutputCurrentVideoInputNames = 2000; //2001-2199
|
||||
OutputCurrentAudioInputNames = 2200; //2201-2399
|
||||
InputCurrentResolution = 2400; // 2401-2599
|
||||
}
|
||||
|
||||
public override void OffsetJoinNumbers(uint joinStart)
|
||||
{
|
||||
var joinOffset = joinStart - 1;
|
||||
|
||||
SystemId = SystemId + joinOffset;
|
||||
IsOnline = IsOnline + joinOffset;
|
||||
OutputVideo = OutputVideo + joinOffset;
|
||||
OutputAudio = OutputAudio + joinOffset;
|
||||
OutputUsb = OutputUsb + joinOffset;
|
||||
InputUsb = InputUsb + joinOffset;
|
||||
VideoSyncStatus = VideoSyncStatus + joinOffset;
|
||||
InputNames = InputNames + joinOffset;
|
||||
OutputNames = OutputNames + joinOffset;
|
||||
OutputCurrentVideoInputNames = OutputCurrentVideoInputNames + joinOffset;
|
||||
OutputCurrentAudioInputNames = OutputCurrentAudioInputNames + joinOffset;
|
||||
InputCurrentResolution = InputCurrentResolution + joinOffset;
|
||||
InputEndpointOnline = InputEndpointOnline + joinOffset;
|
||||
OutputEndpointOnline = OutputEndpointOnline + joinOffset;
|
||||
HdcpSupportState = HdcpSupportState + joinOffset;
|
||||
HdcpSupportCapability = HdcpSupportCapability + joinOffset;
|
||||
OutputDisabledByHdcp = OutputDisabledByHdcp + joinOffset;
|
||||
TxAdvancedIsPresent = TxAdvancedIsPresent + joinOffset;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
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 DmRmcControllerJoinMap : JoinMapBase
|
||||
{
|
||||
#region Digitals
|
||||
/// <summary>
|
||||
/// High when device is online (if not attached to a DMP3 or DM chassis with a CPU3 card
|
||||
/// </summary>
|
||||
public uint IsOnline { get; set; }
|
||||
#endregion
|
||||
|
||||
#region Serials
|
||||
/// <summary>
|
||||
/// Reports the current output resolution
|
||||
/// </summary>
|
||||
public uint CurrentOutputResolution { get; set; }
|
||||
/// <summary>
|
||||
/// Reports the EDID manufacturer value
|
||||
/// </summary>
|
||||
public uint EdidManufacturer { get; set; }
|
||||
/// <summary>
|
||||
/// Reports the EDID Name value
|
||||
/// </summary>
|
||||
public uint EdidName { get; set; }
|
||||
/// <summary>
|
||||
/// Reports the EDID preffered timing value
|
||||
/// </summary>
|
||||
public uint EdidPrefferedTiming { get; set; }
|
||||
/// <summary>
|
||||
/// Reports the EDID serial number value
|
||||
/// </summary>
|
||||
public uint EdidSerialNumber { get; set; }
|
||||
#endregion
|
||||
|
||||
#region Analogs
|
||||
public uint AudioVideoSource { get; set; }
|
||||
#endregion
|
||||
|
||||
public DmRmcControllerJoinMap()
|
||||
{
|
||||
// Digital
|
||||
IsOnline = 1;
|
||||
|
||||
// Serial
|
||||
CurrentOutputResolution = 1;
|
||||
EdidManufacturer = 2;
|
||||
EdidName = 3;
|
||||
EdidPrefferedTiming = 4;
|
||||
EdidSerialNumber = 5;
|
||||
|
||||
//Analog
|
||||
AudioVideoSource = 1;
|
||||
}
|
||||
|
||||
public override void OffsetJoinNumbers(uint joinStart)
|
||||
{
|
||||
var joinOffset = joinStart - 1;
|
||||
|
||||
IsOnline = IsOnline + joinOffset;
|
||||
CurrentOutputResolution = CurrentOutputResolution + joinOffset;
|
||||
EdidManufacturer = EdidManufacturer + joinOffset;
|
||||
EdidName = EdidName + joinOffset;
|
||||
EdidPrefferedTiming = EdidPrefferedTiming + joinOffset;
|
||||
EdidSerialNumber = EdidSerialNumber + joinOffset;
|
||||
AudioVideoSource = AudioVideoSource + joinOffset;
|
||||
}
|
||||
}
|
||||
}
|
||||
100
PepperDashEssentials/Bridges/JoinMaps/DmTxControllerJoinMap.cs
Normal file
100
PepperDashEssentials/Bridges/JoinMaps/DmTxControllerJoinMap.cs
Normal file
@@ -0,0 +1,100 @@
|
||||
using System;
|
||||
using PepperDash.Essentials.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
[Obsolete("Please use version PepperDash.Essentials.Core.Bridges")]
|
||||
public class DmTxControllerJoinMap : JoinMapBase
|
||||
{
|
||||
#region Digitals
|
||||
/// <summary>
|
||||
/// High when device is online (if not attached to a DMP3 or DM chassis with a CPU3 card
|
||||
/// </summary>
|
||||
public uint IsOnline { get; set; }
|
||||
/// <summary>
|
||||
/// High when video sync is detected
|
||||
/// </summary>
|
||||
public uint VideoSyncStatus { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public uint FreeRunEnabled { get; set; }
|
||||
#endregion
|
||||
|
||||
#region Analogs
|
||||
/// <summary>
|
||||
/// Sets and reports the video source
|
||||
/// </summary>
|
||||
public uint VideoInput { get; set; }
|
||||
/// <summary>
|
||||
/// Sets and reports the audio source
|
||||
/// </summary>
|
||||
public uint AudioInput { get; set; }
|
||||
/// <summary>
|
||||
/// Reports the highest supported HDCP state level for the corresponding input card
|
||||
/// </summary>
|
||||
public uint HdcpSupportCapability { get; set; }
|
||||
/// <summary>
|
||||
/// Sets and reports the current HDCP state for the corresponding input port
|
||||
/// </summary>
|
||||
public uint Port1HdcpState { get; set; }
|
||||
/// <summary>
|
||||
/// Sets and reports the current HDCP state for the corresponding input port
|
||||
/// </summary>
|
||||
public uint Port2HdcpState { get; set; }
|
||||
|
||||
/// <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
|
||||
/// <summary>
|
||||
/// Reports the current input resolution
|
||||
/// </summary>
|
||||
public uint CurrentInputResolution { get; set; }
|
||||
#endregion
|
||||
|
||||
|
||||
public DmTxControllerJoinMap()
|
||||
{
|
||||
// Digital
|
||||
IsOnline = 1;
|
||||
VideoSyncStatus = 2;
|
||||
FreeRunEnabled = 3;
|
||||
// Serial
|
||||
CurrentInputResolution = 1;
|
||||
// Analog
|
||||
VideoInput = 1;
|
||||
AudioInput = 2;
|
||||
HdcpSupportCapability = 3;
|
||||
Port1HdcpState = 4;
|
||||
Port2HdcpState = 5;
|
||||
VgaBrightness = 6;
|
||||
VgaContrast = 7;
|
||||
}
|
||||
|
||||
public override void OffsetJoinNumbers(uint joinStart)
|
||||
{
|
||||
var joinOffset = joinStart - 1;
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
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 DmpsAudioOutputControllerJoinMap : JoinMapBase
|
||||
{
|
||||
#region Digital/Analog
|
||||
/// <summary>
|
||||
/// Range of joins for Master Volume
|
||||
/// Analog join 1 is volume level and feedback
|
||||
/// Digital join 1 is Mute on and feedback
|
||||
/// Digital join 2 is Mute off and feedback
|
||||
/// Digital join 3 is volume up
|
||||
/// Digital join 4 is volume down
|
||||
/// </summary>
|
||||
public uint MasterVolume { get; set; }
|
||||
/// <summary>
|
||||
/// Range of joins for Source Volume
|
||||
/// Analog join 11 is volume level and feedback
|
||||
/// Digital join 11 is Mute on and feedback
|
||||
/// Digital join 12 is Mute off and feedback
|
||||
/// Digital join 13 is volume up
|
||||
/// Digital join 14 is volume down
|
||||
/// </summary>
|
||||
public uint SourceVolume { get; set; }
|
||||
/// <summary>
|
||||
/// Range of joins for Codec1 Volume (if applicable)
|
||||
/// Analog join 21 is volume level and feedback
|
||||
/// Digital join 21 is Mute on and feedback
|
||||
/// Digital join 22 is Mute off and feedback
|
||||
/// Digital join 23 is volume up
|
||||
/// Digital join 24 is volume down
|
||||
/// </summary>
|
||||
public uint Codec1Volume { get; set; }
|
||||
/// <summary>
|
||||
/// Range of joins for Codec2 Volume (if applicable)
|
||||
/// Analog join 31 is volume level and feedback
|
||||
/// Digital join 31 is Mute on and feedback
|
||||
/// Digital join 32 is Mute off and feedback
|
||||
/// Digital join 33 is volume up
|
||||
/// Digital join 34 is volume down
|
||||
/// </summary>
|
||||
public uint Codec2Volume { get; set; }
|
||||
#endregion
|
||||
|
||||
public DmpsAudioOutputControllerJoinMap()
|
||||
{
|
||||
MasterVolume = 1; // 1-10
|
||||
SourceVolume = 11; // 11-20
|
||||
Codec1Volume = 21; // 21-30
|
||||
Codec2Volume = 31; // 31-40
|
||||
}
|
||||
|
||||
public override void OffsetJoinNumbers(uint joinStart)
|
||||
{
|
||||
var joinOffset = joinStart;
|
||||
|
||||
MasterVolume = MasterVolume + joinOffset;
|
||||
SourceVolume = SourceVolume + joinOffset;
|
||||
Codec1Volume = Codec1Volume + joinOffset;
|
||||
Codec2Volume = Codec2Volume + joinOffset;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,128 @@
|
||||
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 DmpsRoutingControllerJoinMap : JoinMapBase
|
||||
{
|
||||
#region Digitals
|
||||
/// <summary>
|
||||
/// Range reports video sync feedback for each input
|
||||
/// </summary>
|
||||
public uint VideoSyncStatus { get; set; }
|
||||
/// <summary>
|
||||
/// Range reports high if corresponding input's endpoint is online
|
||||
/// </summary>
|
||||
public uint InputEndpointOnline { get; set; }
|
||||
/// <summary>
|
||||
/// Range reports high if corresponding output's endpoint is online
|
||||
/// </summary>
|
||||
public uint OutputEndpointOnline { get; set; }
|
||||
#endregion
|
||||
|
||||
|
||||
#region Analogs
|
||||
/// <summary>
|
||||
/// Range sets and reports the current video source for the corresponding output
|
||||
/// </summary>
|
||||
public uint OutputVideo { get; set; }
|
||||
/// <summary>
|
||||
/// Range sets and reports the current audio source for the corresponding output
|
||||
/// </summary>
|
||||
public uint OutputAudio { get; set; }
|
||||
/// <summary>
|
||||
/// Range sets and reports the current Usb source for the corresponding output
|
||||
/// </summary>
|
||||
//public uint OutputUsb { get; set; }
|
||||
///// <summary>
|
||||
///// Range sets and reports the current Usb source for the corresponding input
|
||||
///// </summary>
|
||||
//public uint InputUsb { get; set; }
|
||||
///// <summary>
|
||||
///// Range sets and reports the current HDCP state for the corresponding input card
|
||||
///// </summary>
|
||||
//public uint HdcpSupportState { get; set; }
|
||||
///// <summary>
|
||||
///// Range reports the highest supported HDCP state level for the corresponding input card
|
||||
///// </summary>
|
||||
//public uint HdcpSupportCapability { get; set; }
|
||||
#endregion
|
||||
|
||||
#region Serials
|
||||
/// <summary>
|
||||
/// Range sets and reports the name for the corresponding input card
|
||||
/// </summary>
|
||||
public uint InputNames { get; set; }
|
||||
/// <summary>
|
||||
/// Range sets and reports the name for the corresponding output card
|
||||
/// </summary>
|
||||
public uint OutputNames { get; set; }
|
||||
/// <summary>
|
||||
/// Range reports the name of the current video source for the corresponding output card
|
||||
/// </summary>
|
||||
public uint OutputCurrentVideoInputNames { get; set; }
|
||||
/// <summary>
|
||||
/// Range reports the name of the current audio source for the corresponding output card
|
||||
/// </summary>
|
||||
public uint OutputCurrentAudioInputNames { get; set; }
|
||||
/// <summary>
|
||||
/// Range reports the current input resolution for each corresponding input card
|
||||
/// </summary>
|
||||
public uint InputCurrentResolution { get; set; }
|
||||
#endregion
|
||||
|
||||
|
||||
public DmpsRoutingControllerJoinMap()
|
||||
{
|
||||
//Digital
|
||||
VideoSyncStatus = 100; //101-299
|
||||
InputEndpointOnline = 500; //501-699
|
||||
OutputEndpointOnline = 700; //701-899
|
||||
|
||||
//Analog
|
||||
OutputVideo = 100; //101-299
|
||||
OutputAudio = 300; //301-499
|
||||
//OutputUsb = 500; //501-699
|
||||
//InputUsb = 700; //701-899
|
||||
VideoSyncStatus = 100; //101-299
|
||||
//HdcpSupportState = 1000; //1001-1199
|
||||
//HdcpSupportCapability = 1200; //1201-1399
|
||||
|
||||
|
||||
//Serial
|
||||
InputNames = 100; //101-299
|
||||
OutputNames = 300; //301-499
|
||||
OutputCurrentVideoInputNames = 2000; //2001-2199
|
||||
OutputCurrentAudioInputNames = 2200; //2201-2399
|
||||
InputCurrentResolution = 2400; // 2401-2599
|
||||
InputEndpointOnline = 500; //501-699
|
||||
OutputEndpointOnline = 700; //701-899
|
||||
|
||||
}
|
||||
|
||||
public override void OffsetJoinNumbers(uint joinStart)
|
||||
{
|
||||
var joinOffset = joinStart - 1;
|
||||
|
||||
OutputVideo = OutputVideo + joinOffset;
|
||||
OutputAudio = OutputAudio + joinOffset;
|
||||
//OutputUsb = OutputUsb + joinOffset;
|
||||
//InputUsb = InputUsb + joinOffset;
|
||||
VideoSyncStatus = VideoSyncStatus + joinOffset;
|
||||
InputNames = InputNames + joinOffset;
|
||||
OutputNames = OutputNames + joinOffset;
|
||||
OutputCurrentVideoInputNames = OutputCurrentVideoInputNames + joinOffset;
|
||||
OutputCurrentAudioInputNames = OutputCurrentAudioInputNames + joinOffset;
|
||||
InputCurrentResolution = InputCurrentResolution + joinOffset;
|
||||
InputEndpointOnline = InputEndpointOnline + joinOffset;
|
||||
OutputEndpointOnline = OutputEndpointOnline + joinOffset;
|
||||
//HdcpSupportState = HdcpSupportState + joinOffset;
|
||||
//HdcpSupportCapability = HdcpSupportCapability + joinOffset;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
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 GenericLightingJoinMap : JoinMapBase
|
||||
{
|
||||
public uint IsOnline { get; set; }
|
||||
public uint SelectScene { get; set; }
|
||||
public uint LightingSceneOffset { get; set; }
|
||||
public uint ButtonVisibilityOffset { get; set; }
|
||||
public uint IntegrationIdSet { get; set; }
|
||||
|
||||
public GenericLightingJoinMap()
|
||||
{
|
||||
// Digital
|
||||
IsOnline = 1;
|
||||
SelectScene = 1;
|
||||
IntegrationIdSet = 1;
|
||||
LightingSceneOffset = 10;
|
||||
ButtonVisibilityOffset = 40;
|
||||
// Analog
|
||||
}
|
||||
|
||||
public override void OffsetJoinNumbers(uint joinStart)
|
||||
{
|
||||
var joinOffset = joinStart - 1;
|
||||
|
||||
IsOnline = IsOnline + joinOffset;
|
||||
SelectScene = SelectScene + joinOffset;
|
||||
LightingSceneOffset = LightingSceneOffset + joinOffset;
|
||||
ButtonVisibilityOffset = ButtonVisibilityOffset + joinOffset;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
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 GenericRelayControllerJoinMap : JoinMapBase
|
||||
{
|
||||
#region Digitals
|
||||
/// <summary>
|
||||
/// Sets and reports the state of the relay (High = closed, Low = Open)
|
||||
/// </summary>
|
||||
public uint Relay { get; set; }
|
||||
#endregion
|
||||
|
||||
public GenericRelayControllerJoinMap()
|
||||
{
|
||||
Relay = 1;
|
||||
}
|
||||
|
||||
public override void OffsetJoinNumbers(uint joinStart)
|
||||
{
|
||||
var joinOffset = joinStart - 1;
|
||||
|
||||
Relay = Relay + joinOffset;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,239 @@
|
||||
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 GlsOccupancySensorBaseJoinMap : JoinMapBase
|
||||
{
|
||||
#region Digitals
|
||||
|
||||
/// <summary>
|
||||
/// High when device is online
|
||||
/// </summary>
|
||||
public uint IsOnline { get; set; }
|
||||
/// <summary>
|
||||
/// Forces the device to report occupied status
|
||||
/// </summary>
|
||||
public uint ForceOccupied { get; set; }
|
||||
/// <summary>
|
||||
/// Forces the device to report vacant status
|
||||
/// </summary>
|
||||
public uint ForceVacant { get; set; }
|
||||
/// <summary>
|
||||
/// Enables raw status reporting
|
||||
/// </summary>
|
||||
public uint EnableRawStates { get; set; }
|
||||
/// <summary>
|
||||
/// High when raw occupancy is detected
|
||||
/// </summary>
|
||||
public uint RawOccupancyFeedback { get; set; }
|
||||
/// <summary>
|
||||
/// High when PIR sensor detects motion
|
||||
/// </summary>
|
||||
public uint RawOccupancyPirFeedback { get; set; }
|
||||
/// <summary>
|
||||
/// High when US sensor detects motion
|
||||
/// </summary>
|
||||
public uint RawOccupancyUsFeedback { get; set; }
|
||||
/// <summary>
|
||||
/// High when occupancy is detected
|
||||
/// </summary>
|
||||
public uint RoomOccupiedFeedback { get; set; }
|
||||
/// <summary>
|
||||
/// Hich when occupancy is detected in the grace period
|
||||
/// </summary>
|
||||
public uint GraceOccupancyDetectedFeedback { get; set; }
|
||||
/// <summary>
|
||||
/// High when vacancy is detected
|
||||
/// </summary>
|
||||
public uint RoomVacantFeedback { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Enables the LED Flash when set high
|
||||
/// </summary>
|
||||
public uint EnableLedFlash { get; set; }
|
||||
/// <summary>
|
||||
/// Disables the LED flash when set high
|
||||
/// </summary>
|
||||
public uint DisableLedFlash { get; set; }
|
||||
/// <summary>
|
||||
/// Enables the Short Timeout
|
||||
/// </summary>
|
||||
public uint EnableShortTimeout { get; set; }
|
||||
/// <summary>
|
||||
/// Disables the Short Timout
|
||||
/// </summary>
|
||||
public uint DisableShortTimeout { get; set; }
|
||||
/// <summary>
|
||||
/// Set high to enable one technology to trigger occupancy
|
||||
/// </summary>
|
||||
public uint OrWhenVacated { get; set; }
|
||||
/// <summary>
|
||||
/// Set high to require both technologies to trigger occupancy
|
||||
/// </summary>
|
||||
public uint AndWhenVacated { get; set; }
|
||||
/// <summary>
|
||||
/// Enables Ultrasonic Sensor A
|
||||
/// </summary>
|
||||
public uint EnableUsA { get; set; }
|
||||
/// <summary>
|
||||
/// Disables Ultrasonic Sensor A
|
||||
/// </summary>
|
||||
public uint DisableUsA { get; set; }
|
||||
/// <summary>
|
||||
/// Enables Ultrasonic Sensor B
|
||||
/// </summary>
|
||||
public uint EnableUsB { get; set; }
|
||||
/// <summary>
|
||||
/// Disables Ultrasonic Sensor B
|
||||
/// </summary>
|
||||
public uint DisableUsB { get; set; }
|
||||
/// <summary>
|
||||
/// Enables Pir
|
||||
/// </summary>
|
||||
public uint EnablePir { get; set; }
|
||||
/// <summary>
|
||||
/// Disables Pir
|
||||
/// </summary>
|
||||
public uint DisablePir { get; set; }
|
||||
public uint IncrementUsInOccupiedState { get; set; }
|
||||
public uint DecrementUsInOccupiedState { get; set; }
|
||||
public uint IncrementUsInVacantState { get; set; }
|
||||
public uint DecrementUsInVacantState { get; set; }
|
||||
public uint IncrementPirInOccupiedState { get; set; }
|
||||
public uint DecrementPirInOccupiedState { get; set; }
|
||||
public uint IncrementPirInVacantState { get; set; }
|
||||
public uint DecrementPirInVacantState { get; set; }
|
||||
#endregion
|
||||
|
||||
#region Analogs
|
||||
/// <summary>
|
||||
/// Sets adn reports the remote timeout value
|
||||
/// </summary>
|
||||
public uint Timeout { get; set; }
|
||||
/// <summary>
|
||||
/// Reports the local timeout value
|
||||
/// </summary>
|
||||
public uint TimeoutLocalFeedback { get; set; }
|
||||
/// <summary>
|
||||
/// Sets the minimum internal photo sensor value and reports the current level
|
||||
/// </summary>
|
||||
public uint InternalPhotoSensorValue { get; set; }
|
||||
/// <summary>
|
||||
/// Sets the minimum external photo sensor value and reports the current level
|
||||
/// </summary>
|
||||
public uint ExternalPhotoSensorValue { get; set; }
|
||||
|
||||
public uint UsSensitivityInOccupiedState { get; set; }
|
||||
|
||||
public uint UsSensitivityInVacantState { get; set; }
|
||||
|
||||
public uint PirSensitivityInOccupiedState { get; set; }
|
||||
|
||||
public uint PirSensitivityInVacantState { get; set; }
|
||||
#endregion
|
||||
|
||||
#region Serial
|
||||
public uint Name { get; set; }
|
||||
#endregion
|
||||
|
||||
public GlsOccupancySensorBaseJoinMap()
|
||||
{
|
||||
IsOnline = 1;
|
||||
ForceOccupied = 2;
|
||||
ForceVacant = 3;
|
||||
EnableRawStates = 4;
|
||||
RoomOccupiedFeedback = 2;
|
||||
GraceOccupancyDetectedFeedback = 3;
|
||||
RoomVacantFeedback = 4;
|
||||
RawOccupancyFeedback = 5;
|
||||
RawOccupancyPirFeedback = 6;
|
||||
RawOccupancyUsFeedback = 7;
|
||||
EnableLedFlash = 11;
|
||||
DisableLedFlash = 12;
|
||||
EnableShortTimeout = 13;
|
||||
DisableShortTimeout = 14;
|
||||
OrWhenVacated = 15;
|
||||
AndWhenVacated = 16;
|
||||
EnableUsA = 17;
|
||||
DisableUsA = 18;
|
||||
EnableUsB = 19;
|
||||
DisableUsB = 20;
|
||||
EnablePir = 21;
|
||||
DisablePir = 22;
|
||||
IncrementUsInOccupiedState = 23;
|
||||
DecrementUsInOccupiedState = 24;
|
||||
IncrementUsInVacantState = 25;
|
||||
DecrementUsInVacantState = 26;
|
||||
IncrementPirInOccupiedState = 27;
|
||||
DecrementPirInOccupiedState = 28;
|
||||
IncrementPirInVacantState = 29;
|
||||
DecrementPirInVacantState = 30;
|
||||
|
||||
Timeout = 1;
|
||||
TimeoutLocalFeedback = 2;
|
||||
InternalPhotoSensorValue = 3;
|
||||
ExternalPhotoSensorValue = 4;
|
||||
UsSensitivityInOccupiedState = 5;
|
||||
UsSensitivityInVacantState = 6;
|
||||
PirSensitivityInOccupiedState = 7;
|
||||
PirSensitivityInVacantState = 8;
|
||||
|
||||
Name = 1;
|
||||
|
||||
}
|
||||
|
||||
public override void OffsetJoinNumbers(uint joinStart)
|
||||
{
|
||||
var joinOffset = joinStart - 1;
|
||||
|
||||
IsOnline = IsOnline + joinOffset;
|
||||
ForceOccupied = ForceOccupied + joinOffset;
|
||||
ForceVacant = ForceVacant + joinOffset;
|
||||
EnableRawStates = EnableRawStates + joinOffset;
|
||||
RoomOccupiedFeedback = RoomOccupiedFeedback + joinOffset;
|
||||
GraceOccupancyDetectedFeedback = GraceOccupancyDetectedFeedback + joinOffset;
|
||||
RoomVacantFeedback = RoomVacantFeedback + joinOffset;
|
||||
RawOccupancyFeedback = RawOccupancyFeedback + joinOffset;
|
||||
RawOccupancyPirFeedback = RawOccupancyPirFeedback + joinOffset;
|
||||
RawOccupancyUsFeedback = RawOccupancyUsFeedback + joinOffset;
|
||||
EnableLedFlash = EnableLedFlash + joinOffset;
|
||||
DisableLedFlash = DisableLedFlash + joinOffset;
|
||||
EnableShortTimeout = EnableShortTimeout + joinOffset;
|
||||
DisableShortTimeout = DisableShortTimeout + joinOffset;
|
||||
OrWhenVacated = OrWhenVacated + joinOffset;
|
||||
AndWhenVacated = AndWhenVacated + joinOffset;
|
||||
EnableUsA = EnableUsA + joinOffset;
|
||||
DisableUsA = DisableUsA + joinOffset;
|
||||
EnableUsB = EnableUsB + joinOffset;
|
||||
DisableUsB = DisableUsB + joinOffset;
|
||||
EnablePir = EnablePir + joinOffset;
|
||||
DisablePir = DisablePir + joinOffset;
|
||||
IncrementUsInOccupiedState = IncrementUsInOccupiedState + joinOffset;
|
||||
DecrementUsInOccupiedState = DecrementUsInOccupiedState + joinOffset;
|
||||
IncrementUsInVacantState = IncrementUsInVacantState + joinOffset;
|
||||
DecrementUsInVacantState = DecrementUsInVacantState + joinOffset;
|
||||
IncrementPirInOccupiedState = IncrementPirInOccupiedState + joinOffset;
|
||||
DecrementPirInOccupiedState = DecrementPirInOccupiedState + joinOffset;
|
||||
IncrementPirInVacantState = IncrementPirInVacantState + joinOffset;
|
||||
DecrementPirInVacantState = DecrementPirInVacantState + joinOffset;
|
||||
|
||||
Timeout = Timeout + joinOffset;
|
||||
TimeoutLocalFeedback = TimeoutLocalFeedback + joinOffset;
|
||||
InternalPhotoSensorValue = InternalPhotoSensorValue + joinOffset;
|
||||
ExternalPhotoSensorValue = ExternalPhotoSensorValue + joinOffset;
|
||||
UsSensitivityInOccupiedState = UsSensitivityInOccupiedState + joinOffset;
|
||||
UsSensitivityInVacantState = UsSensitivityInVacantState + joinOffset;
|
||||
PirSensitivityInOccupiedState = PirSensitivityInOccupiedState + joinOffset;
|
||||
PirSensitivityInVacantState = PirSensitivityInVacantState + joinOffset;
|
||||
|
||||
Name = Name + joinOffset;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
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 HdMdxxxCEControllerJoinMap : JoinMapBase
|
||||
{
|
||||
#region Digitals
|
||||
/// <summary>
|
||||
/// High when the pair is online
|
||||
/// </summary>
|
||||
public uint IsOnline { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// High when the remote end device is online
|
||||
/// </summary>
|
||||
public uint RemoteEndDetected { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Sets Auto Route On and provides feedback
|
||||
/// </summary>
|
||||
public uint AutoRouteOn { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Sets Auto Route Off and provides feedback
|
||||
/// </summary>
|
||||
public uint AutoRouteOff { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Sets Priority Routing On and provides feedback
|
||||
/// </summary>
|
||||
public uint PriorityRoutingOn { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Sets Priority Routing Off and provides feedback
|
||||
/// </summary>
|
||||
public uint PriorityRoutingOff { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Enables OSD and provides feedback
|
||||
/// </summary>
|
||||
public uint InputOnScreenDisplayEnabled { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Disables OSD and provides feedback
|
||||
/// </summary>
|
||||
public uint InputOnScreenDisplayDisabled { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Provides Video Sync Detected feedback for each input
|
||||
/// </summary>
|
||||
public uint SyncDetected { get; set; }
|
||||
#endregion
|
||||
|
||||
#region Analogs
|
||||
/// <summary>
|
||||
/// Sets the video source for the receiver's HDMI out and provides feedback
|
||||
/// </summary>
|
||||
public uint VideoSource { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates the number of sources supported by the Tx/Rx pair
|
||||
/// </summary>
|
||||
public uint SourceCount { get; set; }
|
||||
#endregion
|
||||
|
||||
#region Serials
|
||||
/// <summary>
|
||||
/// Indicates the name of each input port
|
||||
/// </summary>
|
||||
public uint SourceNames { get; set; }
|
||||
#endregion
|
||||
|
||||
public HdMdxxxCEControllerJoinMap()
|
||||
{
|
||||
//Digital
|
||||
IsOnline = 1;
|
||||
RemoteEndDetected = 2;
|
||||
AutoRouteOn = 3;
|
||||
AutoRouteOff = 4;
|
||||
PriorityRoutingOn = 5;
|
||||
PriorityRoutingOff = 6;
|
||||
InputOnScreenDisplayEnabled = 7;
|
||||
InputOnScreenDisplayDisabled = 8;
|
||||
SyncDetected = 10; // 11-15
|
||||
|
||||
//Analog
|
||||
VideoSource = 1;
|
||||
SourceCount = 2;
|
||||
|
||||
//Serials
|
||||
SourceNames = 10; // 11-15
|
||||
}
|
||||
|
||||
public override void OffsetJoinNumbers(uint joinStart)
|
||||
{
|
||||
var joinOffset = joinStart - 1;
|
||||
|
||||
IsOnline = IsOnline + joinOffset;
|
||||
RemoteEndDetected = RemoteEndDetected + joinOffset;
|
||||
AutoRouteOn = AutoRouteOn + joinOffset;
|
||||
AutoRouteOff = AutoRouteOff + joinOffset;
|
||||
PriorityRoutingOn = PriorityRoutingOn + joinOffset;
|
||||
PriorityRoutingOff = PriorityRoutingOff + joinOffset;
|
||||
InputOnScreenDisplayEnabled = InputOnScreenDisplayEnabled + joinOffset;
|
||||
InputOnScreenDisplayDisabled = InputOnScreenDisplayDisabled + joinOffset;
|
||||
SyncDetected = SyncDetected + joinOffset;
|
||||
|
||||
VideoSource = VideoSource + joinOffset;
|
||||
SourceCount = SourceCount + joinOffset;
|
||||
|
||||
SourceNames = SourceNames + joinOffset;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
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 IBasicCommunicationJoinMap : JoinMapBase
|
||||
{
|
||||
#region Digitals
|
||||
/// <summary>
|
||||
/// Set High to connect, Low to disconnect
|
||||
/// </summary>
|
||||
public uint Connect { get; set; }
|
||||
/// <summary>
|
||||
/// Reports Connected State (High = Connected)
|
||||
/// </summary>
|
||||
public uint Connected { get; set; }
|
||||
#endregion
|
||||
|
||||
#region Analogs
|
||||
/// <summary>
|
||||
/// Reports the connections status value
|
||||
/// </summary>
|
||||
public uint Status { get; set; }
|
||||
#endregion
|
||||
|
||||
#region Serials
|
||||
/// <summary>
|
||||
/// Data back from port
|
||||
/// </summary>
|
||||
public uint TextReceived { get; set; }
|
||||
/// <summary>
|
||||
/// Sends data to the port
|
||||
/// </summary>
|
||||
public uint SendText { get; set; }
|
||||
/// <summary>
|
||||
/// Takes a JSON serialized string that sets a COM port's parameters
|
||||
/// </summary>
|
||||
public uint SetPortConfig { get; set; }
|
||||
#endregion
|
||||
|
||||
public IBasicCommunicationJoinMap()
|
||||
{
|
||||
TextReceived = 1;
|
||||
SendText = 1;
|
||||
SetPortConfig = 2;
|
||||
Connect = 1;
|
||||
Connected = 1;
|
||||
Status = 1;
|
||||
}
|
||||
|
||||
public override void OffsetJoinNumbers(uint joinStart)
|
||||
{
|
||||
var joinOffset = joinStart - 1;
|
||||
|
||||
TextReceived = TextReceived + joinOffset;
|
||||
SendText = SendText + joinOffset;
|
||||
SetPortConfig = SetPortConfig + joinOffset;
|
||||
Connect = Connect + joinOffset;
|
||||
Connected = Connected + joinOffset;
|
||||
Status = Status + joinOffset;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
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 IDigitalInputJoinMap : JoinMapBase
|
||||
{
|
||||
#region Digitals
|
||||
/// <summary>
|
||||
/// Reports the state of the digital input
|
||||
/// </summary>
|
||||
public uint InputState { get; set; }
|
||||
#endregion
|
||||
|
||||
public IDigitalInputJoinMap()
|
||||
{
|
||||
InputState = 1;
|
||||
}
|
||||
|
||||
public override void OffsetJoinNumbers(uint joinStart)
|
||||
{
|
||||
var joinOffset = joinStart - 1;
|
||||
|
||||
InputState = InputState + joinOffset;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
227
PepperDashEssentials/Bridges/JoinMaps/SystemMonitorJoinMap.cs
Normal file
227
PepperDashEssentials/Bridges/JoinMaps/SystemMonitorJoinMap.cs
Normal file
@@ -0,0 +1,227 @@
|
||||
using System;
|
||||
using PepperDash.Essentials.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
[Obsolete("Please use version PepperDash.Essentials.Core.Bridges")]
|
||||
public class SystemMonitorJoinMap : JoinMapBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Offset to indicate where the range of iterated program joins will start
|
||||
/// </summary>
|
||||
public uint ProgramStartJoin { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Offset 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
|
||||
/// </summary>
|
||||
public uint ProgramStart { get; set; }
|
||||
/// <summary>
|
||||
/// Range Sets and reports whether the corresponding program slot is stopped
|
||||
/// </summary>
|
||||
public uint ProgramStop { get; set; }
|
||||
/// <summary>
|
||||
/// Range Sets and reports whether the corresponding program is registered
|
||||
/// </summary>
|
||||
public uint ProgramRegister { get; set; }
|
||||
/// <summary>
|
||||
/// Range Sets and reports whether the corresponding program is unregistered
|
||||
/// </summary>
|
||||
public uint ProgramUnregister { get; set; }
|
||||
#endregion
|
||||
|
||||
#region Analogs
|
||||
/// <summary>
|
||||
/// Sets and reports the time zone
|
||||
/// </summary>
|
||||
public uint TimeZone { get; set; }
|
||||
#endregion
|
||||
|
||||
#region Serials
|
||||
/// <summary>
|
||||
/// Reports the time zone name
|
||||
/// </summary>
|
||||
public uint TimeZoneName { get; set; }
|
||||
/// <summary>
|
||||
/// Reports the IO Controller Version
|
||||
/// </summary>
|
||||
public uint IOControllerVersion { get; set; }
|
||||
/// <summary>
|
||||
/// Reports the SNMP App Version
|
||||
/// </summary>
|
||||
public uint SnmpAppVersion { get; set; }
|
||||
/// <summary>
|
||||
/// Reports the BACnet App Version
|
||||
/// </summary>
|
||||
public uint BACnetAppVersion { get; set; }
|
||||
/// <summary>
|
||||
/// Reports the firmware version
|
||||
/// </summary>
|
||||
public uint ControllerVersion { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Reports the name of the corresponding program
|
||||
/// </summary>
|
||||
public uint ProgramName { get; set; }
|
||||
/// <summary>
|
||||
/// Reports the compile time of the corresponding program
|
||||
/// </summary>
|
||||
public uint ProgramCompiledTime { get; set; }
|
||||
/// <summary>
|
||||
/// Reports the Crestron Database version of the corresponding program
|
||||
/// </summary>
|
||||
public uint ProgramCrestronDatabaseVersion { get; set; }
|
||||
/// <summary>
|
||||
/// Reports the Environment Version of the corresponding program
|
||||
/// </summary>
|
||||
public uint ProgramEnvironmentVersion { get; set; }
|
||||
/// <summary>
|
||||
/// Serialized JSON output that aggregates the program info of the corresponding program
|
||||
/// </summary>
|
||||
public uint AggregatedProgramInfo { get; set; }
|
||||
/// <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()
|
||||
{
|
||||
TimeZone = 1;
|
||||
|
||||
TimeZoneName = 1;
|
||||
IOControllerVersion = 2;
|
||||
SnmpAppVersion = 3;
|
||||
BACnetAppVersion = 4;
|
||||
ControllerVersion = 5;
|
||||
SerialNumber = 6;
|
||||
Model = 7;
|
||||
Uptime = 8;
|
||||
LastBoot = 9;
|
||||
|
||||
|
||||
ProgramStartJoin = 10;
|
||||
|
||||
ProgramOffsetJoin = 5;
|
||||
|
||||
// Offset in groups of 5 joins
|
||||
ProgramStart = 1;
|
||||
ProgramStop = 2;
|
||||
ProgramRegister = 3;
|
||||
ProgramUnregister = 4;
|
||||
|
||||
ProgramName = 1;
|
||||
ProgramCompiledTime = 2;
|
||||
ProgramCrestronDatabaseVersion = 3;
|
||||
ProgramEnvironmentVersion = 4;
|
||||
AggregatedProgramInfo = 5;
|
||||
|
||||
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)
|
||||
{
|
||||
var joinOffset = joinStart - 1;
|
||||
|
||||
TimeZone = TimeZone + joinOffset;
|
||||
|
||||
TimeZoneName = TimeZoneName + joinOffset;
|
||||
IOControllerVersion = IOControllerVersion + joinOffset;
|
||||
SnmpAppVersion = SnmpAppVersion + joinOffset;
|
||||
BACnetAppVersion = BACnetAppVersion + joinOffset;
|
||||
ControllerVersion = ControllerVersion + joinOffset;
|
||||
|
||||
// Sets the initial join value where the iterated program joins will begin
|
||||
ProgramStartJoin = ProgramStartJoin + joinOffset;
|
||||
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,150 +1,108 @@
|
||||
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;
|
||||
using PepperDash.Essentials.Core.Monitoring;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace PepperDash.Essentials.Core.Bridges
|
||||
{
|
||||
public static class SystemMonitorBridge
|
||||
{
|
||||
public static void LinkToApi(this SystemMonitorController systemMonitorController, BasicTriList trilist, uint joinStart, string joinMapKey)
|
||||
{
|
||||
var joinMap = JoinMapHelper.GetJoinMapForDevice(joinMapKey) as SystemMonitorJoinMap;
|
||||
var joinMap = new SystemMonitorJoinMap();
|
||||
|
||||
if (joinMap == null)
|
||||
joinMap = new SystemMonitorJoinMap();
|
||||
var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
|
||||
|
||||
if(!string.IsNullOrEmpty(joinMapSerialized))
|
||||
joinMap = JsonConvert.DeserializeObject<SystemMonitorJoinMap>(joinMapSerialized);
|
||||
|
||||
joinMap.OffsetJoinNumbers(joinStart);
|
||||
|
||||
//Debug.Console(1, systemMonitorController, "Linking API starting at join: {0}", joinStart);
|
||||
Debug.Console(1, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
||||
Debug.Console(2, systemMonitorController, "Linking API starting at join: {0}", joinStart);
|
||||
|
||||
systemMonitorController.TimeZoneFeedback.LinkInputSig(trilist.UShortInput[joinMap.TimeZone]);
|
||||
//trilist.SetUShortSigAction(joinMap.TimeZone, new Action<ushort>(u => systemMonitorController.SetTimeZone(u)));
|
||||
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)
|
||||
{
|
||||
|
||||
// TODO: link feedbacks for each program slot
|
||||
var programNumber = p.Value.Program.Number;
|
||||
|
||||
//Debug.Console(1, systemMonitorController, "Linking API for Program Slot: {0} starting at join: {1}", programNumber, programSlotJoinStart);
|
||||
|
||||
trilist.SetBoolSigAction(programSlotJoinStart + joinMap.ProgramStart, new Action<bool>
|
||||
(b => SystemMonitor.ProgramCollection[programNumber].OperatingState = eProgramOperatingState.Start));
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public class SystemMonitorJoinMap : JoinMapBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Offset to indicate where the range of iterated program joins will start
|
||||
/// </summary>
|
||||
public uint ProgramStartJoin { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Offset between each program join set
|
||||
/// </summary>
|
||||
public uint ProgramOffsetJoin { get; set; }
|
||||
|
||||
//Digital
|
||||
public uint ProgramStart { get; set; }
|
||||
public uint ProgramStop { get; set; }
|
||||
public uint ProgramRegister { get; set; }
|
||||
public uint ProgramUnregister { get; set; }
|
||||
|
||||
//Analog
|
||||
public uint TimeZone { get; set; }
|
||||
|
||||
//Serial
|
||||
public uint TimeZoneName { get; set; }
|
||||
public uint IOControllerVersion { get; set; }
|
||||
public uint SnmpAppVersion { get; set; }
|
||||
public uint BACnetAppVersion { get; set; }
|
||||
public uint ControllerVersion { get; set; }
|
||||
|
||||
public uint ProgramName { get; set; }
|
||||
public uint ProgramCompiledTime { get; set; }
|
||||
public uint ProgramCrestronDatabaseVersion { get; set; }
|
||||
public uint ProgramEnvironmentVersion { get; set; }
|
||||
public uint AggregatedProgramInfo { get; set; }
|
||||
|
||||
public SystemMonitorJoinMap()
|
||||
{
|
||||
TimeZone = 1;
|
||||
|
||||
TimeZoneName = 1;
|
||||
IOControllerVersion = 2;
|
||||
SnmpAppVersion = 3;
|
||||
BACnetAppVersion = 4;
|
||||
ControllerVersion = 5;
|
||||
|
||||
|
||||
ProgramStartJoin = 10;
|
||||
|
||||
ProgramOffsetJoin = 5;
|
||||
|
||||
// Offset in groups of 5 joins
|
||||
ProgramStart = 1;
|
||||
ProgramStop = 2;
|
||||
ProgramRegister = 3;
|
||||
ProgramUnregister = 4;
|
||||
|
||||
ProgramName = 1;
|
||||
ProgramCompiledTime = 2;
|
||||
ProgramCrestronDatabaseVersion = 3;
|
||||
ProgramEnvironmentVersion = 4;
|
||||
AggregatedProgramInfo = 5;
|
||||
}
|
||||
|
||||
public override void OffsetJoinNumbers(uint joinStart)
|
||||
{
|
||||
var joinOffset = joinStart - 1;
|
||||
|
||||
TimeZone = TimeZone + joinOffset;
|
||||
|
||||
TimeZoneName = TimeZoneName + joinOffset;
|
||||
IOControllerVersion = IOControllerVersion + joinOffset;
|
||||
SnmpAppVersion = SnmpAppVersion + joinOffset;
|
||||
BACnetAppVersion = BACnetAppVersion + joinOffset;
|
||||
ControllerVersion = ControllerVersion + joinOffset;
|
||||
|
||||
// Sets the initial join value where the iterated program joins will begin
|
||||
ProgramStartJoin = ProgramStartJoin + joinOffset;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,72 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.Config;
|
||||
|
||||
namespace PepperDash.Essentials
|
||||
{
|
||||
|
||||
//public class TPConfig : DeviceConfig
|
||||
//{
|
||||
// new public TPConfigProperties Properties { get; set; }
|
||||
//}
|
||||
|
||||
//public class TPConfigProperties
|
||||
//{
|
||||
// /*
|
||||
// "properties": {
|
||||
// "ipId": "aa",
|
||||
// "defaultSystemKey": "system1",
|
||||
// "sgdPath": "\\NVRAM\\Program1\\Sgds\\PepperDash Essentials TSW1050_v0.9.sgd",
|
||||
// "usesSplashPage": true,
|
||||
// "showDate": true,
|
||||
// "showTime": false
|
||||
// }
|
||||
// */
|
||||
// public uint IpId { get; set; }
|
||||
// public string deafultSystemKey { get; set; }
|
||||
// public string SgdPath { get; set; }
|
||||
// public bool UsesSplashPage { get; set; }
|
||||
// public bool ShowDate { get; set; }
|
||||
// public bool ShowTime { get; set; }
|
||||
|
||||
//}
|
||||
|
||||
|
||||
|
||||
|
||||
///// <summary>
|
||||
///// The gist of this converter: The comspec JSON comes in with normal values that need to be converted
|
||||
///// into enum names. This converter takes the value and applies the appropriate enum's name prefix to the value
|
||||
///// and then returns the enum value using Enum.Parse
|
||||
///// </summary>
|
||||
//public class TPPropertiesConverter : JsonConverter
|
||||
//{
|
||||
// public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
|
||||
// {
|
||||
// return JObject.Load(reader);
|
||||
// }
|
||||
|
||||
// /// <summary>
|
||||
// /// This will be hit with every value in the ComPortConfig class. We only need to
|
||||
// /// do custom conversion on the comspec items.
|
||||
// /// </summary>
|
||||
// public override bool CanConvert(Type objectType)
|
||||
// {
|
||||
// return true;
|
||||
// }
|
||||
|
||||
// public override bool CanRead { get { return true; } }
|
||||
// public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
|
||||
// {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
//}
|
||||
}
|
||||
@@ -1,82 +0,0 @@
|
||||
using System.Linq;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Core;
|
||||
|
||||
namespace PepperDash.Essentials
|
||||
{
|
||||
public class ConfigTieLine
|
||||
{
|
||||
[JsonProperty(Required=Required.Always)]
|
||||
public string SourceDeviceKey { get; set; }
|
||||
|
||||
[JsonProperty(Required = Required.Always)]
|
||||
public string SourcePortKey { get; set; }
|
||||
|
||||
[JsonProperty(Required = Required.Always)]
|
||||
public string DestinationDeviceKey { get; set; }
|
||||
|
||||
[JsonProperty(Required = Required.Always)]
|
||||
public string DestinationPortKey { get; set; }
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return string.Format("Tie line: [{0}]{1} --> [{2}]{3}", SourceDeviceKey, SourcePortKey, DestinationDeviceKey, DestinationPortKey);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a tie line if one can be constructed between the two devices and ports
|
||||
/// </summary>
|
||||
/// <returns>TieLine or null if devices or ports don't exist</returns>
|
||||
public TieLine GetTieLine()
|
||||
{
|
||||
var sourceDevice = (IRoutingOutputs)DeviceManager.GetDeviceForKey(SourceDeviceKey);
|
||||
var destinationDevice = (IRoutingInputs)DeviceManager.GetDeviceForKey(DestinationDeviceKey);
|
||||
|
||||
if (sourceDevice == null)
|
||||
{
|
||||
Debug.Console(0, " Cannot create TieLine. Source device '{0}' not found or does not have outputs",
|
||||
SourceDeviceKey);
|
||||
return null;
|
||||
}
|
||||
else if (destinationDevice == null)
|
||||
{
|
||||
Debug.Console(0, " Cannot create TieLine. Destination device '{0}' not found or does not have inputs",
|
||||
DestinationDeviceKey);
|
||||
return null;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Get the ports by key name from the lists
|
||||
RoutingOutputPort sourcePort = sourceDevice.OutputPorts.FirstOrDefault(
|
||||
p => p.Key.Equals(SourcePortKey, System.StringComparison.OrdinalIgnoreCase));
|
||||
//RoutingOutputPort sourcePort = null;
|
||||
//sourceDevice.OutputPorts.TryGetValue(SourcePortKey, out sourcePort);
|
||||
if (sourcePort == null)
|
||||
{
|
||||
Debug.Console(0, " Cannot create TieLine {0}-->{1}. Source device does not have output port '{2}'",
|
||||
sourceDevice.Key, destinationDevice.Key, SourcePortKey);
|
||||
return null;
|
||||
}
|
||||
|
||||
RoutingInputPort destinationPort = destinationDevice.InputPorts.FirstOrDefault(
|
||||
p => p.Key.Equals(DestinationPortKey, System.StringComparison.OrdinalIgnoreCase));
|
||||
//RoutingInputPort destinationPort = null;
|
||||
//destinationDevice.InputPorts.TryGetValue(DestinationPortKey, out destinationPort);
|
||||
if (destinationPort == null)
|
||||
{
|
||||
Debug.Console(0, " Cannot create TieLine {0}-->{1}. Destination device does not have input port '{2}'",
|
||||
sourceDevice.Key, destinationDevice.Key, DestinationPortKey);
|
||||
return null;
|
||||
}
|
||||
|
||||
var tl = new TieLine(sourcePort, destinationPort);
|
||||
Debug.Console(1, " Created {0}", this);
|
||||
return tl;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,287 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharp.CrestronIO;
|
||||
using Crestron.SimplSharpPro;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
using Crestron.SimplSharpPro.CrestronThread;
|
||||
using Crestron.SimplSharpPro.Diagnostics;
|
||||
using Crestron.SimplSharpPro.EthernetCommunication;
|
||||
using Crestron.SimplSharpPro.UI;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Devices;
|
||||
//using PepperDash.Essentials.Core.Devices.Dm;
|
||||
//using PepperDash.Essentials.Fusion;
|
||||
using PepperDash.Core;
|
||||
|
||||
namespace PepperDash.Essentials
|
||||
{
|
||||
public static class Configuration
|
||||
{
|
||||
|
||||
public static string LastPath { get; private set; }
|
||||
public static CrestronControlSystem ControlSystem { get; private set; }
|
||||
|
||||
public static void Initialize(CrestronControlSystem cs)
|
||||
{
|
||||
CrestronConsole.AddNewConsoleCommand(ReloadFromConsole, "configreload", "Reloads configuration file",
|
||||
ConsoleAccessLevelEnum.AccessOperator);
|
||||
ControlSystem = cs;
|
||||
}
|
||||
|
||||
public static bool ReadConfiguration(string filePath)
|
||||
{
|
||||
try
|
||||
{
|
||||
// Read file
|
||||
if (File.Exists(filePath))
|
||||
{
|
||||
LastPath = filePath;
|
||||
string json = File.ReadToEnd(filePath, System.Text.Encoding.ASCII);
|
||||
JObject jo = JObject.Parse(json);
|
||||
|
||||
var info = JsonConvert.DeserializeObject<ConfigInfo>(jo["info"].ToString());
|
||||
Debug.Console(0, "\r[Config] file read:");
|
||||
Debug.Console(0, " File: {0}", filePath);
|
||||
Debug.Console(0, " Name: {0}", info.Name);
|
||||
Debug.Console(0, " Type: {0}", info.SystemTemplateType);
|
||||
Debug.Console(0, " Date: {0}", info.EditDate);
|
||||
Debug.Console(0, " ConfigVersion: {0}", info.Version);
|
||||
Debug.Console(0, " EditedBy: {0}", info.EditedBy);
|
||||
Debug.Console(0, " Comment: {0}\r", info.Comment);
|
||||
|
||||
// Get the main config object
|
||||
var jConfig = jo["configuration"];
|
||||
|
||||
// Devices
|
||||
var jDevices = (JArray)jConfig["devices"];
|
||||
CreateDevices(jDevices);
|
||||
|
||||
// TieLines
|
||||
var jRouting = jConfig["routing"];
|
||||
CreateRouting(jRouting);
|
||||
|
||||
/// Parse the available source list(s)
|
||||
var jSourceLists = (JArray)jConfig["sourceLists"];
|
||||
var jSourceListJson = jSourceLists.ToString();
|
||||
List<ConfigSourceList> sourceLists = JsonConvert.DeserializeObject<List<ConfigSourceList>>(jSourceListJson);
|
||||
|
||||
// System
|
||||
var jSystems = (JArray)jConfig["systems"];
|
||||
CreateSystems(jSystems, sourceLists);
|
||||
|
||||
// Activate everything
|
||||
DeviceManager.ActivateAll();
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Console(0, "[Config] file not found '{0}'", filePath);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.Console(0, "Configuration read error: \r {0}", e);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static void CreateDevices(JArray jDevices)
|
||||
{
|
||||
//Debug.Console(0, " Creating {0} devices", jDevices.Count);
|
||||
//for (int i = 0; i < jDevices.Count; i++)
|
||||
//{
|
||||
// var jDev = jDevices[i];
|
||||
|
||||
// //var devConfig = JsonConvert.DeserializeObject<DeviceConfig>(jDev.ToString());
|
||||
// //Debug.Console(0, "++++++++++++{0}", devConfig);
|
||||
|
||||
|
||||
// var group = jDev["group"].Value<string>();
|
||||
// Debug.Console(0, " [{0}], creating {1}:{2}", jDev["key"].Value<string>(),
|
||||
// group, jDev["type"].Value<string>());
|
||||
|
||||
// Device dev = null;
|
||||
// if (group.Equals("Display", StringComparison.OrdinalIgnoreCase))
|
||||
// dev = DisplayFactory.CreateDisplay(jDev);
|
||||
// else if (group.Equals("DeviceMonitor", StringComparison.OrdinalIgnoreCase))
|
||||
// dev = DeviceManagerFactory.Create(jDev);
|
||||
// //else if (group.Equals("Pc", StringComparison.OrdinalIgnoreCase))
|
||||
// // dev = PcFactory.Create(jDev);
|
||||
// //else if (group.Equals("SetTopBox", StringComparison.OrdinalIgnoreCase))
|
||||
// // dev = SetTopBoxFactory.Create(jDev);
|
||||
// //else if (group.Equals("DiscPlayer", StringComparison.OrdinalIgnoreCase))
|
||||
// // dev = DiscPlayerFactory.Create(jDev);
|
||||
// //else if (group.Equals("Touchpanel", StringComparison.OrdinalIgnoreCase))
|
||||
// // dev = TouchpanelFactory.Create(jDev);
|
||||
// else if (group.Equals("dmEndpoint", StringComparison.OrdinalIgnoreCase)) // Add Transmitter and Receiver
|
||||
// dev = DmFactory.Create(jDev);
|
||||
// else if (group.Equals("dmChassic", StringComparison.OrdinalIgnoreCase))
|
||||
// dev = DmFactory.CreateChassis(jDev);
|
||||
// else if (group.Equals("processor", StringComparison.OrdinalIgnoreCase))
|
||||
// continue; // ignore it. Has no value right now.
|
||||
// //else if (group.Equals("remote", StringComparison.OrdinalIgnoreCase))
|
||||
// // dev = RemoteFactory.Create(jDev);
|
||||
// else
|
||||
// {
|
||||
// Debug.Console(0, " ERROR: Device [{0}] has unknown Group '{1}'. Skipping",
|
||||
// jDev["key"].Value<string>(), group);
|
||||
// continue;
|
||||
// }
|
||||
|
||||
// if (dev != null)
|
||||
// DeviceManager.AddDevice(dev);
|
||||
// else
|
||||
// Debug.Console(0, " ERROR: failed to create device {0}",
|
||||
// jDev["key"].Value<string>());
|
||||
//}
|
||||
}
|
||||
|
||||
static void CreateSystems(JArray jSystems, List<ConfigSourceList> sourceLists)
|
||||
{
|
||||
// // assuming one system
|
||||
// var jSystem = jSystems[0];
|
||||
// var name = jSystem.Value<string>("name");
|
||||
// var key = FactoryHelper.KeyOrConvertName(jSystem.Value<string>("key"), name);
|
||||
|
||||
// if (jSystem.Value<string>("type").Equals("EssentialsHuddleSpace", StringComparison.OrdinalIgnoreCase))
|
||||
// {
|
||||
// var sys = new HuddleSpaceRoom(key, name);
|
||||
// var props = jSystem["properties"];
|
||||
// var displayKey = props["displayKey"].Value<string>();
|
||||
// if (displayKey != null)
|
||||
// sys.DefaultDisplay = (DisplayBase)DeviceManager.GetDeviceForKey(displayKey);
|
||||
|
||||
// // Add sources from passed in config list
|
||||
// var myList = sourceLists.FirstOrDefault(
|
||||
// l => l.Key.Equals(props.Value<string>("sourceListKey"), StringComparison.OrdinalIgnoreCase));
|
||||
// if (myList != null)
|
||||
// AddSourcesToSystem(sys, myList);
|
||||
|
||||
// DeviceManager.AddDevice(sys);
|
||||
|
||||
// //spin up a fusion thing too
|
||||
//#warning add this fusion connector back in later
|
||||
// //DeviceManager.AddDevice(new EssentialsHuddleSpaceFusionSystemController(sys, 0xf1));
|
||||
//}
|
||||
}
|
||||
|
||||
//static void AddSourcesToSystem(Room system, ConfigSourceList configList)
|
||||
//{
|
||||
//foreach (var configItem in configList.PresentationSources)
|
||||
//{
|
||||
// var src = (IPresentationSource)DeviceManager.GetDeviceForKey(configItem.SourceKey);
|
||||
// if (src != null)
|
||||
// system.Sources.Add(configItem.Number, src);
|
||||
// else
|
||||
// Debug.Console(0, system, "cannot find source '{0}' from list {1}",
|
||||
// configItem.SourceKey, configList.Name);
|
||||
//}
|
||||
//}
|
||||
|
||||
/// <summary>
|
||||
/// Links up routing, creates tie lines
|
||||
/// </summary>
|
||||
/// <param name="jRouting">The "Routing" JArray from configuration</param>
|
||||
static void CreateRouting(JToken jRouting)
|
||||
{
|
||||
var jsonTieLines = jRouting["tieLines"].ToString();
|
||||
var tieLineConfigs = JsonConvert.DeserializeObject<List<ConfigTieLine>>(jsonTieLines);
|
||||
foreach (var c in tieLineConfigs)
|
||||
{
|
||||
var tl = c.GetTieLine();
|
||||
if (tl != null)
|
||||
TieLineCollection.Default.Add(tl);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Returns the IIROutputPorts device (control system, etc) that contains a given IR port
|
||||
/// </summary>
|
||||
/// <param name="propsToken"></param>
|
||||
static IROutputPort GetIrPort(JToken propsToken)
|
||||
{
|
||||
var portDevName = propsToken.Value<string>("IrPortDevice");
|
||||
var portNum = propsToken.Value<uint>("IrPortNumber");
|
||||
if (portDevName.Equals("controlSystem", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
IIROutputPorts irDev = ControlSystem;
|
||||
if (portNum <= irDev.NumberOfIROutputPorts)
|
||||
return ControlSystem.IROutputPorts[portNum];
|
||||
else
|
||||
Debug.Console(0, "[Config] ERROR: IR Port {0} out of range. Range 0-{1} on {2}", portNum,
|
||||
ControlSystem.IROutputPorts.Count, irDev.ToString());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static void HandleUnknownType(JToken devToken, string type)
|
||||
{
|
||||
Debug.Console(0, "[Config] ERROR: Type '{0}' not found in group '{1}'", type,
|
||||
devToken.Value<string>("Group"));
|
||||
}
|
||||
|
||||
static void HandleDeviceCreationError(JToken devToken, Exception e)
|
||||
{
|
||||
Debug.Console(0, "[Config] ERROR creating device [{0}]: \r{1}",
|
||||
devToken["Key"].Value<string>(), e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Console helper to reload
|
||||
/// </summary>
|
||||
static void ReloadFromConsole(string s)
|
||||
{
|
||||
// Gotta tear down everything first!
|
||||
|
||||
if (!string.IsNullOrEmpty(LastPath))
|
||||
{
|
||||
ReadConfiguration(LastPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class ConfigSourceList
|
||||
{
|
||||
[JsonProperty(Required = Required.Always)]
|
||||
public string Key { get; set; }
|
||||
|
||||
[JsonProperty(Required = Required.Always)]
|
||||
public string Name { get; set; }
|
||||
|
||||
[JsonProperty(Required = Required.Always)]
|
||||
public List<ConfigSourceItem> PresentationSources { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public class ConfigSourceItem
|
||||
{
|
||||
[JsonProperty(Required = Required.Always)]
|
||||
public uint Number { get; set; }
|
||||
|
||||
[JsonProperty(Required = Required.Always)]
|
||||
public string SourceKey { get; set; }
|
||||
|
||||
public string AlternateName { get; set; }
|
||||
}
|
||||
|
||||
public class ConfigInfo
|
||||
{
|
||||
public string SystemTemplateType { get; set; }
|
||||
public string ProcessorType { get; set; }
|
||||
public string Name { get; set; }
|
||||
public uint ProgramSlotNumber { get; set; }
|
||||
public string Version { get; set; }
|
||||
public string EditedBy { get; set; }
|
||||
public string EditDate { get; set; }
|
||||
public string Comment { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace PepperDash.Essentials
|
||||
{
|
||||
public class SourceListConfigProperties
|
||||
{
|
||||
[JsonProperty(Required= Required.Always)]
|
||||
public uint Number { get; set; }
|
||||
[JsonProperty(Required= Required.Always)]
|
||||
public string SourceKey { get; set; }
|
||||
public string AltName { get; set; }
|
||||
public string AltIcon { get; set; }
|
||||
|
||||
public SourceListConfigProperties()
|
||||
{
|
||||
AltName = "";
|
||||
AltIcon = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
//using System;
|
||||
//using Crestron.SimplSharpPro;
|
||||
|
||||
//using Newtonsoft.Json;
|
||||
//using Newtonsoft.Json.Linq;
|
||||
|
||||
//using PepperDash.Essentials.Core;
|
||||
//using PepperDash.Essentials.Devices;
|
||||
//using PepperDash.Core;
|
||||
|
||||
//namespace PepperDash.Essentials
|
||||
//{
|
||||
// public class CommFactory
|
||||
// {
|
||||
// public static IBasicCommunication CreateCommForDevice(JToken devToken)
|
||||
// {
|
||||
// var devKey = devToken.Value<string>("key");
|
||||
// IBasicCommunication comm = null;
|
||||
// try
|
||||
// {
|
||||
// var control = devToken["properties"]["control"];
|
||||
// var commMethod = control["method"].Value<string>();
|
||||
// if (commMethod == "com")
|
||||
// {
|
||||
// var comConfig = JsonConvert.DeserializeObject<ComPortConfig>(
|
||||
// control["comParams"].ToString(),
|
||||
// new JsonSerializerSettings
|
||||
// {
|
||||
// // Needs ObjectCreationHandling to make the ComSpec struct populate
|
||||
// ObjectCreationHandling = ObjectCreationHandling.Replace,
|
||||
// Converters = new JsonConverter[] { new ComSpecJsonConverter() }
|
||||
// });
|
||||
// comm = new ComPortController(devKey + "-com", comConfig.GetComPort(), comConfig.ComSpec);
|
||||
// }
|
||||
// else if (commMethod == "tcpIp")
|
||||
// {
|
||||
// var tcpConfig = JsonConvert.DeserializeObject<TcpIpConfig>(control["tcpParams"].ToString());
|
||||
// comm = new GenericTcpIpClient(devKey + "-tcp", tcpConfig.Address, tcpConfig.Port, tcpConfig.BufferSize);
|
||||
// }
|
||||
// }
|
||||
// catch (Exception e)
|
||||
// {
|
||||
// Debug.Console(0, "Cannot create communication from JSON:\r{0}\r\rException:\r{1}", devToken.ToString(), e);
|
||||
// }
|
||||
|
||||
// // put it in the device manager if it's the right flavor
|
||||
// var comDev = comm as Device;
|
||||
// if (comDev != null)
|
||||
// DeviceManager.AddDevice(comDev);
|
||||
|
||||
// return comm;
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
@@ -1,38 +0,0 @@
|
||||
//using System;
|
||||
//using Crestron.SimplSharpPro;
|
||||
|
||||
//using Newtonsoft.Json.Linq;
|
||||
|
||||
//using PepperDash.Essentials.Core;
|
||||
//using PepperDash.Essentials.Core.Devices;
|
||||
//using PepperDash.Core;
|
||||
|
||||
//namespace PepperDash.Essentials
|
||||
//{
|
||||
// public class DeviceManagerFactory
|
||||
// {
|
||||
// public static Device Create(JToken devToken)
|
||||
// {
|
||||
// Device dev = null;
|
||||
// try
|
||||
// {
|
||||
// var devType = devToken.Value<string>("type");
|
||||
// var devKey = devToken.Value<string>("key");
|
||||
// var devName = devToken.Value<string>("name");
|
||||
// if (devType.Equals("DeviceMonitor", StringComparison.OrdinalIgnoreCase))
|
||||
// {
|
||||
// var comm = CommFactory.CreateCommForDevice(devToken);
|
||||
// if (comm == null) return null;
|
||||
// dev = new GenericCommunicationMonitoredDevice(devKey, devName, comm, devToken["properties"]["pollString"].Value<string>());
|
||||
// }
|
||||
// else
|
||||
// FactoryHelper.HandleUnknownType(devToken, devType);
|
||||
// }
|
||||
// catch (Exception e)
|
||||
// {
|
||||
// FactoryHelper.HandleDeviceCreationError(devToken, e);
|
||||
// }
|
||||
// return dev;
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user