mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-01-12 12:05:00 +00:00
Compare commits
1583 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
823f7447c3 | ||
|
|
f9925f9ec9 | ||
|
|
25c4d94366 | ||
|
|
91dda3213e | ||
|
|
b41dd23c7f | ||
|
|
14ad0eee48 | ||
|
|
56e106ff32 | ||
|
|
5ec97f2e31 | ||
|
|
98c20464d7 | ||
|
|
ce86255119 | ||
|
|
d69e81972e | ||
|
|
3f9d306a34 | ||
|
|
14c3914e5c | ||
|
|
b5337572c4 | ||
|
|
1d1b4f0790 | ||
|
|
ccdd8005d0 | ||
|
|
1d184f0f5e | ||
|
|
2ed9e632c6 | ||
|
|
ecba28c9cd | ||
|
|
06e8cac597 | ||
|
|
1dfdd4dd28 | ||
|
|
48585469f6 | ||
|
|
f9ba562b0b | ||
|
|
5c63a49071 | ||
|
|
3d224496a8 | ||
|
|
73addfefe7 | ||
|
|
af0e2180bd | ||
|
|
a431015853 | ||
|
|
788244fbf4 | ||
|
|
282230b28e | ||
|
|
dc010ce28c | ||
|
|
5a3597f2a7 | ||
|
|
5b889ea59c | ||
|
|
faa6e20034 | ||
|
|
82a97f8c1f | ||
|
|
6557d21aa8 | ||
|
|
a733ed69cb | ||
|
|
9877ba93a0 | ||
|
|
669f9e71bc | ||
|
|
5d2f20efd5 | ||
|
|
06dccdd97f | ||
|
|
e705f67333 | ||
|
|
4903b99eb5 | ||
|
|
38ab6626fc | ||
|
|
b44bc8fae3 | ||
|
|
7d72d54862 | ||
|
|
0a218cebb4 | ||
|
|
ed6ad6ae76 | ||
|
|
1689b15d95 | ||
|
|
010fdde45c | ||
|
|
10509991c1 | ||
|
|
c686ee394d | ||
|
|
985902092e | ||
|
|
944b72e2a8 | ||
|
|
d074be323c | ||
|
|
0098401584 | ||
|
|
0d7d5fe380 | ||
|
|
1cb9fb6058 | ||
|
|
5076ba405e | ||
|
|
3c60dfdf7b | ||
|
|
5d44b5f3ef | ||
|
|
40cdd4c1e7 | ||
|
|
f5753109d5 | ||
|
|
51e338749a | ||
|
|
e37fb33afe | ||
|
|
47af06578a | ||
|
|
ad0cbba0b1 | ||
|
|
c7a3282dd9 | ||
|
|
fd593baa07 | ||
|
|
88f1230620 | ||
|
|
cad558980f | ||
|
|
e879aba801 | ||
|
|
114fdb9545 | ||
|
|
1886ddfbaf | ||
|
|
39d2c3aab6 | ||
|
|
3cd8a1f310 | ||
|
|
b457886ee3 | ||
|
|
e27c041256 | ||
|
|
5fcafe0b38 | ||
|
|
8250246f34 | ||
|
|
d9bcaa0b1d | ||
|
|
dd6e26ae4b | ||
|
|
fac1dd3d61 | ||
|
|
e573749aa0 | ||
|
|
f22bf60eb6 | ||
|
|
d1b99fdda3 | ||
|
|
e1a4cfca4e | ||
|
|
8a43824f3d | ||
|
|
b948fc7264 | ||
|
|
d9f891dfb1 | ||
|
|
a9524bcc33 | ||
|
|
4b537cb79d | ||
|
|
1484c26434 | ||
|
|
36e8dc9fa5 | ||
|
|
8feb7037aa | ||
|
|
d8863142c7 | ||
|
|
061109c901 | ||
|
|
f95b50c99d | ||
|
|
def5cc273c | ||
|
|
e01d2c9569 | ||
|
|
415dbbb195 | ||
|
|
765d90214d | ||
|
|
36fd1dcda9 | ||
|
|
812b9b731b | ||
|
|
e80a68485d | ||
|
|
535f4ccb8e | ||
|
|
7bbdf43452 | ||
|
|
59881d6b3b | ||
|
|
085e198409 | ||
|
|
81f27fcbde | ||
|
|
50dae0ef69 | ||
|
|
e0fdefa28e | ||
|
|
f6a826505c | ||
|
|
68ac506a25 | ||
|
|
1150d9e497 | ||
|
|
633a946f26 | ||
|
|
8e01455140 | ||
|
|
b373ab8708 | ||
|
|
cb752850ff | ||
|
|
08c929699f | ||
|
|
1862090a89 | ||
|
|
1ea80c3fab | ||
|
|
1676f5a956 | ||
|
|
cdc9cdbe95 | ||
|
|
28e8a1fb11 | ||
|
|
5f1b92ca62 | ||
|
|
c58a1874ca | ||
|
|
f4fb9cd173 | ||
|
|
ad4a6e9383 | ||
|
|
decdaf9f1f | ||
|
|
27382a6be1 | ||
|
|
34440af1c5 | ||
|
|
c0e3da9214 | ||
|
|
d50ad7345d | ||
|
|
95016c3ec6 | ||
|
|
f8f5c2474c | ||
|
|
b997e9a135 | ||
|
|
c7ccac2fe6 | ||
|
|
05885f568e | ||
|
|
b500b9f6cc | ||
|
|
e784c08f80 | ||
|
|
45ea5cc875 | ||
|
|
a006698bb2 | ||
|
|
e365944dc3 | ||
|
|
c33dcb78d0 | ||
|
|
e48ec3af7c | ||
|
|
4b9d7d1a1f | ||
|
|
d6133905b2 | ||
|
|
741b401d8c | ||
|
|
cb661313c2 | ||
|
|
3c794849bd | ||
|
|
753b4e69ee | ||
|
|
b502007fff | ||
|
|
1e6d65fe53 | ||
|
|
72515a79ca | ||
|
|
b286008403 | ||
|
|
c8e3f752db | ||
|
|
33c3822b7c | ||
|
|
97701ef3c4 | ||
|
|
d2eadcd2f5 | ||
|
|
6589f8c4f4 | ||
|
|
13dabc09c7 | ||
|
|
eb80f38813 | ||
|
|
0fc6a73b30 | ||
|
|
aa38b13adf | ||
|
|
6a79f41367 | ||
|
|
88263ccc77 | ||
|
|
9d15704b78 | ||
|
|
832060e8ad | ||
|
|
5d5652907b | ||
|
|
477d7957e3 | ||
|
|
41b39a5d3b | ||
|
|
6972b544ec | ||
|
|
1bd9eca806 | ||
|
|
a203eef9a6 | ||
|
|
f583b84951 | ||
|
|
8f319a4405 | ||
|
|
862a5ebd12 | ||
|
|
cb89bd3908 | ||
|
|
54dd424b01 | ||
|
|
b6b88086f3 | ||
|
|
b2ec99e663 | ||
|
|
74c101628b | ||
|
|
ea28b8afa4 | ||
|
|
f5d7c90be1 | ||
|
|
62b6c5193a | ||
|
|
6d9ea8a13c | ||
|
|
9abac555c3 | ||
|
|
f742f850eb | ||
|
|
83ca24b32a | ||
|
|
484e7c2102 | ||
|
|
f416e12dac | ||
|
|
1a140ab5c8 | ||
|
|
006c5f8655 | ||
|
|
b0e2985f5e | ||
|
|
cbb57411a0 | ||
|
|
28c1172db3 | ||
|
|
e708946f4c | ||
|
|
b9fff95215 | ||
|
|
7cd3a143a0 | ||
|
|
7248e90762 | ||
|
|
ceef883ad8 | ||
|
|
8a98924ad7 | ||
|
|
9526b9b6fe | ||
|
|
741f694733 | ||
|
|
8f2ef9082b | ||
|
|
e7dcc088d6 | ||
|
|
f036c3f1cc | ||
|
|
d3c64be229 | ||
|
|
5404309193 | ||
|
|
635b4d2432 | ||
|
|
3fc9ff3abf | ||
|
|
41833c8aad | ||
|
|
fdf9778f46 | ||
|
|
1e676f5a6b | ||
|
|
0af944176a | ||
|
|
6fe13b6a92 | ||
|
|
4f562e0d8e | ||
|
|
fdae50a972 | ||
|
|
277886b092 | ||
|
|
75c407ca01 | ||
|
|
2b40c5a55c | ||
|
|
cffe55428a | ||
|
|
f51708e01d | ||
|
|
3e6b98894d | ||
|
|
25faa7e702 | ||
|
|
c6dab1fe9a | ||
|
|
c9178aef76 | ||
|
|
aa8b349711 | ||
|
|
6194948259 | ||
|
|
ff6e898091 | ||
|
|
c43503eb27 | ||
|
|
2373d0ace7 | ||
|
|
f10ac6da06 | ||
|
|
e90b9fe5e3 | ||
|
|
da73365c2f | ||
|
|
3f9253a550 | ||
|
|
0ed316eaa4 | ||
|
|
5f80e12faf | ||
|
|
64d92fdfce | ||
|
|
6c400c80a2 | ||
|
|
9846d87a40 | ||
|
|
e952f3d775 | ||
|
|
726f2083db | ||
|
|
436db82006 | ||
|
|
5938869e7a | ||
|
|
4bad8585e5 | ||
|
|
9af95e017a | ||
|
|
5e74eaf3f2 | ||
|
|
74268d6a9b | ||
|
|
4d53e6b33e | ||
|
|
9f70031cc1 | ||
|
|
c74a92d220 | ||
|
|
a4c24fc197 | ||
|
|
25fccbd095 | ||
|
|
c9fce06bd7 | ||
|
|
b1040b56d5 | ||
|
|
5359427981 | ||
|
|
764f61a500 | ||
|
|
e292790cea | ||
|
|
1fb329f1c1 | ||
|
|
a2fc1b9f40 | ||
|
|
419e7c5b31 | ||
|
|
efbd78fb7c | ||
|
|
486c951982 | ||
|
|
468aff6e3f | ||
|
|
fc67c53f4c | ||
|
|
f0a887981d | ||
|
|
7628b0ffff | ||
|
|
63d8cf27fd | ||
|
|
eb9149b96a | ||
|
|
f5410c0786 | ||
|
|
7624445b4b | ||
|
|
ece05caa28 | ||
|
|
702c186c2c | ||
|
|
22ce57e628 | ||
|
|
10f1f5b1d6 | ||
|
|
a30062db71 | ||
|
|
182499a79b | ||
|
|
6e148e7d62 | ||
|
|
6a31504cf8 | ||
|
|
a6bb35a20d | ||
|
|
b53282e3e0 | ||
|
|
d6fd9517f0 | ||
|
|
bbcd3598b2 | ||
|
|
4ad966d909 | ||
|
|
f61db7f7bf | ||
|
|
95fb6cc204 | ||
|
|
5668653785 | ||
|
|
3325d81cab | ||
|
|
78f9142b35 | ||
|
|
f18ed56909 | ||
|
|
951da716a6 | ||
|
|
7ac11952eb | ||
|
|
a99b6e37e4 | ||
|
|
9b567b7ead | ||
|
|
67f0ae92ef | ||
|
|
4e2683f8fc | ||
|
|
f0d10fb1f9 | ||
|
|
aea6942a1f | ||
|
|
d0a2ccd7d6 | ||
|
|
84099b1d0b | ||
|
|
1b7dd2dd2a | ||
|
|
e5d4ba48fb | ||
|
|
22ff61d7f3 | ||
|
|
f066321f3a | ||
|
|
302603aa54 | ||
|
|
dea858e187 | ||
|
|
ddbee2ed04 | ||
|
|
b7c9677c7a | ||
|
|
d6581cab2e | ||
|
|
66c481e3dc | ||
|
|
edd01785d5 | ||
|
|
192aa4255c | ||
|
|
637ca2f312 | ||
|
|
bf7a0600f3 | ||
|
|
f59654d75e | ||
|
|
211665c0c4 | ||
|
|
829e3eb634 | ||
|
|
683f007e0b | ||
|
|
c77fe5c454 | ||
|
|
23bfecd870 | ||
|
|
0b485d8d96 | ||
|
|
1d42d88c3f | ||
|
|
ec0b2fa181 | ||
|
|
1b621e1655 | ||
|
|
3ecadf72e9 | ||
|
|
744298bdb5 | ||
|
|
fe090113ce | ||
|
|
55e50f68d3 | ||
|
|
8d13de0e8c | ||
|
|
41aae794b6 | ||
|
|
dbafce0aa8 | ||
|
|
383777c0f5 | ||
|
|
5e24bb6cd3 | ||
|
|
4fdc19ff20 | ||
|
|
518c0a8bfb | ||
|
|
d17cd42b19 | ||
|
|
35d7c23815 | ||
|
|
c7e6e0c250 | ||
|
|
7c4222a598 | ||
|
|
fda888b095 | ||
|
|
894da801b1 | ||
|
|
642d573c3b | ||
|
|
03cf6ffd60 | ||
|
|
989becb8dd | ||
|
|
97e0b732d0 | ||
|
|
80073c22b1 | ||
|
|
49edaa33ac | ||
|
|
f9b326e1e1 | ||
|
|
7cfd27a5cc | ||
|
|
bb23452bb0 | ||
|
|
f184808ab5 | ||
|
|
b686ee6df6 | ||
|
|
671ebc65a0 | ||
|
|
b12b1fa3fd | ||
|
|
91aa304990 | ||
|
|
6aad15c452 | ||
|
|
c43fdc156d | ||
|
|
d920234652 | ||
|
|
8103ca6cb2 | ||
|
|
232233d58e | ||
|
|
985c0e05e3 | ||
|
|
cef8dbd706 | ||
|
|
9732da7a8a | ||
|
|
6cd686ec7c | ||
|
|
3152430584 | ||
|
|
22453d4786 | ||
|
|
2312657a2f | ||
|
|
fb93dab3a3 | ||
|
|
507edd4e43 | ||
|
|
cdf876cb5a | ||
|
|
8341631618 | ||
|
|
75dacb48a1 | ||
|
|
6a4c7bb65e | ||
|
|
276c681b66 | ||
|
|
414a4a9564 | ||
|
|
25cb4e8727 | ||
|
|
044a259f0b | ||
|
|
ecabd66b07 | ||
|
|
aff2371a4b | ||
|
|
7a93223678 | ||
|
|
5590925774 | ||
|
|
3b73a7d73c | ||
|
|
af85135674 | ||
|
|
2767bccb2c | ||
|
|
2f7e6bf778 | ||
|
|
232ec81ec0 | ||
|
|
98d3d8182e | ||
|
|
0da38f5fd2 | ||
|
|
bd4ae16ab7 | ||
|
|
1d2722d409 | ||
|
|
99e2dd1ff4 | ||
|
|
38d6200409 | ||
|
|
e8d42b701e | ||
|
|
0686e9d054 | ||
|
|
b917cb552e | ||
|
|
a1ee157ab8 | ||
|
|
b1befeb32d | ||
|
|
615c0d1545 | ||
|
|
a2e041652d | ||
|
|
76033f53fc | ||
|
|
fa4d4bbd0f | ||
|
|
08a0cdfddd | ||
|
|
56e4488087 | ||
|
|
62b57e453d | ||
|
|
2a1ff2e32b | ||
|
|
8ede3a49ae | ||
|
|
ca75b751a7 | ||
|
|
7ed4f479a9 | ||
|
|
3eeca2fbed | ||
|
|
82fb724bdd | ||
|
|
4360dcdca9 | ||
|
|
bfe87ae090 | ||
|
|
8497924c85 | ||
|
|
52bfbb6dcf | ||
|
|
715a8af0a3 | ||
|
|
86acda9935 | ||
|
|
12a9146d79 | ||
|
|
4ee9e2aa26 | ||
|
|
b65ecddb39 | ||
|
|
1c8b44e3d7 | ||
|
|
bc94560536 | ||
|
|
ae424a2a10 | ||
|
|
5b679c1f35 | ||
|
|
88c4c4ae77 | ||
|
|
e705d2191a | ||
|
|
6a3d11dee1 | ||
|
|
0d802bdeed | ||
|
|
00958164ff | ||
|
|
2fea151089 | ||
|
|
bfa49b4772 | ||
|
|
9596d0f3c3 | ||
|
|
0a3f2bb524 | ||
|
|
38ae5dcd2f | ||
|
|
ea86c8b639 | ||
|
|
ac379763ce | ||
|
|
b694f7640a | ||
|
|
f954043981 | ||
|
|
495bf70d3a | ||
|
|
e1c93cc13a | ||
|
|
ce9c8042e4 | ||
|
|
5d1aa3b024 | ||
|
|
f6286cb5c1 | ||
|
|
2d7b2c05c5 | ||
|
|
9f8542049c | ||
|
|
a26c951dba | ||
|
|
83ca3ee350 | ||
|
|
acdff4ad67 | ||
|
|
708d4c266e | ||
|
|
6160580f08 | ||
|
|
c7363c6434 | ||
|
|
5f04190e6a | ||
|
|
6b908e18de | ||
|
|
4d4230d9f4 | ||
|
|
2e788d1917 | ||
|
|
1f21b573e2 | ||
|
|
a03e6824c5 | ||
|
|
67cdd8bfa6 | ||
|
|
44f6b465d4 | ||
|
|
48220b8fe9 | ||
|
|
51f5d7e07b | ||
|
|
ea3cb6eb80 | ||
|
|
91464d8ec1 | ||
|
|
80c98c60ca | ||
|
|
8d8899f9ac | ||
|
|
001933bac3 | ||
|
|
8445656289 | ||
|
|
e8a8d481aa | ||
|
|
fd1de75a1d | ||
|
|
7f08bfc913 | ||
|
|
377cf23bca | ||
|
|
6f16bc3427 | ||
|
|
a1bb6685d4 | ||
|
|
53e3e603b9 | ||
|
|
827678961c | ||
|
|
17368a0a12 | ||
|
|
9a9387b151 | ||
|
|
7f8d4d94d0 | ||
|
|
df228fca6d | ||
|
|
1ccc2c891e | ||
|
|
35ec5e903e | ||
|
|
f98292a4aa | ||
|
|
6b6604b7a9 | ||
|
|
55eb110373 | ||
|
|
42418fedb8 | ||
|
|
407fc2e948 | ||
|
|
49177da820 | ||
|
|
a1809dccb4 | ||
|
|
7d97bc118e | ||
|
|
48bc41a69e | ||
|
|
e4a8e89135 | ||
|
|
1bd6825258 | ||
|
|
e5099e9a2a | ||
|
|
ccdaa12f20 | ||
|
|
60d387c792 | ||
|
|
d9b4ca815e | ||
|
|
37686044d4 | ||
|
|
ef50098460 | ||
|
|
f2eff3fdb4 | ||
|
|
2749fdc2e9 | ||
|
|
514fe466fd | ||
|
|
c77d394e08 | ||
|
|
b689a54936 | ||
|
|
1046672386 | ||
|
|
0cfcf4f266 | ||
|
|
d86cc44c3b | ||
|
|
26bd0d624e | ||
|
|
841cb2a83b | ||
|
|
b89112bec1 | ||
|
|
5920c7c0f0 | ||
|
|
d23ef01281 | ||
|
|
dab153f1b0 | ||
|
|
c5ad321842 | ||
|
|
c78b305faa | ||
|
|
5853dd6617 | ||
|
|
a67b435565 | ||
|
|
84d8ff410e | ||
|
|
625c870072 | ||
|
|
c475155546 | ||
|
|
1b6669d4ef | ||
|
|
ffbba24b5a | ||
|
|
9bdbb1fbad | ||
|
|
0465a3b9a6 | ||
|
|
a0ef356bac | ||
|
|
e62dd762f4 | ||
|
|
9c4e4c7976 | ||
|
|
486d6db7d8 | ||
|
|
81d9261a73 | ||
|
|
2ace6ef6bc | ||
|
|
cc6d94b188 | ||
|
|
0525f76b6b | ||
|
|
7fa3031cfa | ||
|
|
d34177482e | ||
|
|
345442e195 | ||
|
|
e94e8b60a6 | ||
|
|
4f4c8cba04 | ||
|
|
1be0a3cba9 | ||
|
|
ce513ac086 | ||
|
|
c98cd05a5c | ||
|
|
d68645ccb0 | ||
|
|
9517eaa0b0 | ||
|
|
6b140bf2d7 | ||
|
|
eab0d2b1d7 | ||
|
|
df8a885594 | ||
|
|
5ea79ac94e | ||
|
|
459dc951e9 | ||
|
|
f823abacc1 | ||
|
|
0a38442ac5 | ||
|
|
083a3662e0 | ||
|
|
37e1e50b94 | ||
|
|
f0eeae0432 | ||
|
|
4b663eea62 | ||
|
|
8d2d45b5ce | ||
|
|
62fdd6a572 | ||
|
|
305fe5c372 | ||
|
|
b39afe2f50 | ||
|
|
862610b17d | ||
|
|
43698ba839 | ||
|
|
7bfc82c3cc | ||
|
|
b975ce6a6d | ||
|
|
e83acd5bfa | ||
|
|
2f1592bc62 | ||
|
|
1c609764b8 | ||
|
|
c7464a1e34 | ||
|
|
608a9068b9 | ||
|
|
e006a4616a | ||
|
|
677789bec1 | ||
|
|
0dc589f2ea | ||
|
|
aecb36e937 | ||
|
|
be97fe15da | ||
|
|
2a7311ba50 | ||
|
|
b95c341fca | ||
|
|
469d3b0975 | ||
|
|
bece417bf3 | ||
|
|
75774d128d | ||
|
|
430c819813 | ||
|
|
6c2d8c02c1 | ||
|
|
2d0876486d | ||
|
|
22427b1246 | ||
|
|
3c7495aaa1 | ||
|
|
ef4b0441d3 | ||
|
|
190697d855 | ||
|
|
19e78d649f | ||
|
|
0dad34893e | ||
|
|
1fee896a3d | ||
|
|
b6f0ccbf17 | ||
|
|
f81fe3d01f | ||
|
|
4f5b649b1d | ||
|
|
d0ee05def9 | ||
|
|
dd0a52c1a2 | ||
|
|
76abd05830 | ||
|
|
102535cd04 | ||
|
|
e0e9fc2ce4 | ||
|
|
a657525562 | ||
|
|
10bc39ffea | ||
|
|
2a9f6e253b | ||
|
|
496b70f73f | ||
|
|
0869961622 | ||
|
|
dedcfcbb66 | ||
|
|
19b3c51c25 | ||
|
|
476d661ece | ||
|
|
546cdacc0f | ||
|
|
b4605578ad | ||
|
|
39f25cc9db | ||
|
|
788aa33a3a | ||
|
|
46ecb676c0 | ||
|
|
19c4428dc8 | ||
|
|
25ddb95db5 | ||
|
|
43ff15ff5e | ||
|
|
406e6a912f | ||
|
|
57f1db17c3 | ||
|
|
c9d97e5cae | ||
|
|
f33763ce43 | ||
|
|
5707d12fbe | ||
|
|
8fe586dfec | ||
|
|
696f169ea4 | ||
|
|
efd4f379ee | ||
|
|
aef491855c | ||
|
|
1dd55f5a5f | ||
|
|
7882210eaf | ||
|
|
138628613c | ||
|
|
a192ec3117 | ||
|
|
f9ca609c1e | ||
|
|
b0a21a1c2f | ||
|
|
a4339bf5a4 | ||
|
|
06cc871432 | ||
|
|
45b6a09067 | ||
|
|
2085e14f24 | ||
|
|
912e545678 | ||
|
|
efe8b15763 | ||
|
|
f2cb95af96 | ||
|
|
3bf3ac2cce | ||
|
|
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 | ||
|
|
f57ee74e8c | ||
|
|
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 | ||
|
|
d150e03bdd | ||
|
|
158b2fc346 | ||
|
|
e078e6bda7 | ||
|
|
6de70a83f1 | ||
|
|
d370564900 | ||
|
|
23b3ed2416 | ||
|
|
47d1eb9105 | ||
|
|
837e3044f6 | ||
|
|
ad93eb33cd | ||
|
|
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 | ||
|
|
6c02423a1c | ||
|
|
6ea966ec6c | ||
|
|
6e9b24576e | ||
|
|
ad04235061 | ||
|
|
34f3e543f2 | ||
|
|
e145bfbaee | ||
|
|
4f726007b8 | ||
|
|
d62b5b7e0c | ||
|
|
967d281b62 | ||
|
|
be9fd5e8d1 | ||
|
|
f25d05edc2 | ||
|
|
c3d6890a4c | ||
|
|
ff6184c241 | ||
|
|
034c6913f7 | ||
|
|
03da699a36 | ||
|
|
3a3f6db692 | ||
|
|
87a449d1ee | ||
|
|
1d6a835323 | ||
|
|
6bbad2e0f9 | ||
|
|
821f2a6d60 | ||
|
|
f6136a8c77 | ||
|
|
676526ed48 | ||
|
|
a8ffe2d09f | ||
|
|
541fbbbb2d | ||
|
|
3a5686c27a | ||
|
|
531e7186f2 | ||
|
|
9bc0269e78 | ||
|
|
0df53facb1 | ||
|
|
2ee77f1bca | ||
|
|
9a56f5bb49 | ||
|
|
895f49b888 | ||
|
|
e51e1930d9 | ||
|
|
d245f36cf3 | ||
|
|
47675f12b4 | ||
|
|
a7c920b780 | ||
|
|
3a91a895e6 | ||
|
|
397b0b4d9c | ||
|
|
b793c04ad3 | ||
|
|
bd31831a9b | ||
|
|
3d9070dc4f | ||
|
|
3f82eaeb66 | ||
|
|
3cbf784417 | ||
|
|
3d6ce7534f | ||
|
|
28d694d0b4 | ||
|
|
a320eff13c | ||
|
|
f7db0ef36c | ||
|
|
184144dc3c | ||
|
|
dfd7cb4411 | ||
|
|
5014343fa3 | ||
|
|
f2bfeda074 | ||
|
|
339a4f8a62 | ||
|
|
78668e8abb | ||
|
|
101d1b5625 | ||
|
|
780f7bc249 | ||
|
|
6ec0295aba | ||
|
|
f4d2ad86f5 | ||
|
|
d98b7e837a | ||
|
|
99da6debdc | ||
|
|
c2665f0225 | ||
|
|
0406361d75 | ||
|
|
182326b3c5 | ||
|
|
4a69207038 | ||
|
|
7b4aad3516 | ||
|
|
8dabe732ec | ||
|
|
410cf1b4ad | ||
|
|
fbb4951548 | ||
|
|
065075aabd | ||
|
|
ee6293fa75 | ||
|
|
7112c50f5a | ||
|
|
873fd81b5c | ||
|
|
a2a3f4caed | ||
|
|
1df658b7eb | ||
|
|
1c9061cc28 | ||
|
|
a0a83a1af7 | ||
|
|
f17b62844d | ||
|
|
5f8170fb66 | ||
|
|
42086f650d | ||
|
|
6a8ae5b244 | ||
|
|
30506419df | ||
|
|
a84084b273 | ||
|
|
5ed8ff6dac | ||
|
|
b295f931a3 | ||
|
|
0487099ee4 | ||
|
|
bff8529c9f | ||
|
|
c3bea683fc | ||
|
|
f819d0d743 | ||
|
|
6afe1729bf | ||
|
|
d563a6224b | ||
|
|
7ba2429cbf | ||
|
|
1534433949 | ||
|
|
daf44ae797 | ||
|
|
bd31d76e8b | ||
|
|
759635b364 | ||
|
|
c0c90f926e | ||
|
|
96e60f6eaf | ||
|
|
a13428fb4e | ||
|
|
818d6c9ca5 | ||
|
|
a6df8f908b | ||
|
|
0d5c93bbde | ||
|
|
40dcca0e8d | ||
|
|
ef443bdfb0 | ||
|
|
c839cea495 | ||
|
|
768bbf9298 | ||
|
|
999982f789 | ||
|
|
ad48b1ebac | ||
|
|
e196ff1627 | ||
|
|
a900a08095 | ||
|
|
fa94b83d63 | ||
|
|
d70d8b58dd | ||
|
|
1b942918d7 | ||
|
|
ccfcd95508 | ||
|
|
5f119690c2 | ||
|
|
3778314d51 | ||
|
|
163f6e6941 | ||
|
|
7e8cdd738f | ||
|
|
1371c728c5 | ||
|
|
d1d8e29be2 | ||
|
|
43071a4d91 | ||
|
|
4d4d50bc92 | ||
|
|
9eb9485bba | ||
|
|
c447875baf | ||
|
|
f1feaaae90 | ||
|
|
b989b07d78 | ||
|
|
3841a9bad1 | ||
|
|
9ad2fef94a | ||
|
|
f09ccda33c | ||
|
|
4e45103080 | ||
|
|
c2e82e9cb9 | ||
|
|
b16d61f64c | ||
|
|
2e566b41a0 | ||
|
|
be5b23e9d1 | ||
|
|
385686e7e0 | ||
|
|
448b408f94 | ||
|
|
e1422d8653 | ||
|
|
b353b93458 | ||
|
|
55f9dc4c1f | ||
|
|
e7adaabb87 | ||
|
|
0f25d9ed4b | ||
|
|
5cefba4934 | ||
|
|
0e9d1e4c35 | ||
|
|
058ea730ed | ||
|
|
9945f36c90 | ||
|
|
8490f2d722 | ||
|
|
ca9da1ef79 | ||
|
|
e0bfb8f091 | ||
|
|
97db1f35a1 | ||
|
|
f5b589bc2e | ||
|
|
2b6a13271f | ||
|
|
4686799371 | ||
|
|
cb750a2fd0 | ||
|
|
6d81e8d21e | ||
|
|
600b9f11ff | ||
|
|
c20036cfe9 | ||
|
|
005b3f0843 | ||
|
|
fbe5df84be | ||
|
|
8e4c84dd02 | ||
|
|
dace2a57c2 | ||
|
|
3cf188f820 | ||
|
|
80377a41d0 | ||
|
|
a0ebc08838 | ||
|
|
0de4fbb69c | ||
|
|
c88b259c71 | ||
|
|
20660c561a | ||
|
|
b44613b91f | ||
|
|
58de8ce8ad | ||
|
|
33f0a1fe32 | ||
|
|
4b0f8abd9f | ||
|
|
4defea55f0 | ||
|
|
9c8f85555e | ||
|
|
62e2c3d19f | ||
|
|
e1c8b54434 | ||
|
|
6d913e8a72 | ||
|
|
afa1cff0e0 | ||
|
|
ce6cecbb79 | ||
|
|
69314bb1f1 | ||
|
|
fb19b5894b | ||
|
|
82fad55c1e | ||
|
|
8d03e81431 | ||
|
|
fa8ea4cef6 | ||
|
|
97a44ffa4f | ||
|
|
ee55be86e0 | ||
|
|
ced1efdb47 | ||
|
|
5129b19748 | ||
|
|
525881ebe1 | ||
|
|
856a81ded4 | ||
|
|
ef8298ccd6 | ||
|
|
cdbab152f6 | ||
|
|
359bd508e5 | ||
|
|
62e5e6f176 | ||
|
|
2d375ed2d7 | ||
|
|
2e78191e33 | ||
|
|
45ac17622a | ||
|
|
e7e6ae98cf | ||
|
|
2fbd645bf0 | ||
|
|
2a4ed67bee | ||
|
|
17c448e309 | ||
|
|
5afa626fb3 | ||
|
|
ba1e8646e5 | ||
|
|
88e82fb398 | ||
|
|
53ee87c9be | ||
|
|
032bb2b8e5 | ||
|
|
6ee56dd66c | ||
|
|
d887b448c9 | ||
|
|
f099c88352 | ||
|
|
f98a429b55 | ||
|
|
645816c75f | ||
|
|
491fff2793 | ||
|
|
952e7f4083 | ||
|
|
56c418580c | ||
|
|
4134622b28 | ||
|
|
09b3f7c5e7 | ||
|
|
9fa2b22448 | ||
|
|
62d8190eef | ||
|
|
19284b171a | ||
|
|
29c60548cc | ||
|
|
17f147b5e0 | ||
|
|
7aa3d50cd6 | ||
|
|
b85abe1b79 | ||
|
|
b7bab6cfd1 | ||
|
|
b83b3737e9 | ||
|
|
42c4c705c9 | ||
|
|
cb41b31018 | ||
|
|
6f028c06ae | ||
|
|
bc25c31860 | ||
|
|
32b548eba0 | ||
|
|
f83e64ee7e | ||
|
|
2ee365447c | ||
|
|
e5ac725b85 | ||
|
|
d0cbb8d096 | ||
|
|
91f6235441 | ||
|
|
3c256564c6 | ||
|
|
53de4f32eb | ||
|
|
9effa78fdf | ||
|
|
ba5036e400 | ||
|
|
cd747a01ea | ||
|
|
ac4ef972fe | ||
|
|
857d10f0b2 | ||
|
|
b45fb57cb2 | ||
|
|
e1e2627f56 | ||
|
|
d1646f8216 | ||
|
|
02cfc46f90 | ||
|
|
0fb946c7d5 | ||
|
|
026ab438ad | ||
|
|
51afb966d5 | ||
|
|
68fb82f801 | ||
|
|
0830fb8943 | ||
|
|
2ed63e7c84 | ||
|
|
08a4497f2c | ||
|
|
85d79c5265 | ||
|
|
fe76b257b2 | ||
|
|
800de511ce | ||
|
|
82784f00a4 | ||
|
|
289a33451f | ||
|
|
ae496f556b | ||
|
|
762f13c708 | ||
|
|
a61bfc4173 | ||
|
|
c3d455a7c2 | ||
|
|
864e65fe92 | ||
|
|
385dd8a482 | ||
|
|
19860be486 | ||
|
|
4d6a680f23 | ||
|
|
f9cb4e8a34 | ||
|
|
07e77f2ce4 | ||
|
|
6dbc152810 | ||
|
|
a3580ca15c | ||
|
|
7a1ead7b56 | ||
|
|
f9d1a737c4 | ||
|
|
d9013157ad | ||
|
|
43f0ae0533 | ||
|
|
6d66c7d896 | ||
|
|
f327ab1590 | ||
|
|
47fc2f3371 | ||
|
|
d1197329f3 | ||
|
|
a0817307b1 | ||
|
|
43c3b83637 | ||
|
|
2a485e36c8 | ||
|
|
bc47c65e48 | ||
|
|
1ad5bc68e5 |
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.
|
||||
59
.github/scripts/GenerateVersionNumber.ps1
vendored
Normal file
59
.github/scripts/GenerateVersionNumber.ps1
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
$latestVersions = $(git tag --merged origin/main)
|
||||
$latestVersion = [version]"0.0.0"
|
||||
Write-Host "GITHUB_REF: $($Env:GITHUB_REF)"
|
||||
Write-Host "GITHUB_HEAD_REF: $($Env:GITHUB_HEAD_REF)"
|
||||
Write-Host "GITHUB_BASE_REF: $($Env:GITHUB_BASE_REF)"
|
||||
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\/pull\/*.' {
|
||||
$splitRef = $Env:GITHUB_REF -split "/"
|
||||
$phase = "pr$($splitRef[2])"
|
||||
$newVersionString = "{0}.{1}.{2}-{3}-{4}" -f $newVersion.Major, $newVersion.Minor, ($newVersion.Build + 1), $phase, $Env:GITHUB_RUN_NUMBER
|
||||
}
|
||||
'^refs\/heads\/main*.' {
|
||||
$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", "*.nuspec" | 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
|
||||
309
.github/workflows/docker.yml
vendored
Normal file
309
.github/workflows/docker.yml
vendored
Normal file
@@ -0,0 +1,309 @@
|
||||
name: Branch Build Using Docker
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- feature/*
|
||||
- hotfix/*
|
||||
- bugfix/*
|
||||
- release/*
|
||||
- development
|
||||
pull_request:
|
||||
branches:
|
||||
- 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 main as the release branch. Change as necessary
|
||||
RELEASE_BRANCH: main
|
||||
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
|
||||
# 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
|
||||
echo "VERSION=$version" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||
# Use the version number to set the version of the assemblies
|
||||
- name: Update AssemblyInfo.cs
|
||||
shell: powershell
|
||||
run: |
|
||||
./.github/scripts/UpdateAssemblyVersion.ps1 ${{ env.VERSION }}
|
||||
- name: restore Nuget Packages
|
||||
run: nuget install .\packages.config -OutputDirectory .\packages -ExcludeVersion
|
||||
# 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 }}
|
||||
Push_Nuget_Package:
|
||||
needs: Build_Project
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- name: Download Build Version Info
|
||||
uses: actions/download-artifact@v1
|
||||
with:
|
||||
name: Version
|
||||
- name: Set Version Number
|
||||
shell: powershell
|
||||
run: |
|
||||
Get-ChildItem "./Version"
|
||||
$version = Get-Content -Path ./Version/version.txt
|
||||
Write-Host "Version: $version"
|
||||
echo "VERSION=$version" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||
Remove-Item -Path ./Version/version.txt
|
||||
Remove-Item -Path ./Version
|
||||
- name: Download Build output
|
||||
uses: actions/download-artifact@v1
|
||||
with:
|
||||
name: Build
|
||||
path: ./
|
||||
- name: Unzip Build file
|
||||
run: |
|
||||
Get-ChildItem .\*.zip | Expand-Archive -DestinationPath .\
|
||||
Remove-Item -Path .\*.zip
|
||||
- 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
|
||||
- name: Add nuget.exe
|
||||
uses: nuget/setup-nuget@v1
|
||||
- name: Add Github Packages source
|
||||
run: nuget sources add -name github -source https://nuget.pkg.github.com/pepperdash/index.json -username Pepperdash -password ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Add nuget.org API Key
|
||||
run: nuget setApiKey ${{ secrets.NUGET_API_KEY }}
|
||||
- name: Create nuget package
|
||||
run: nuget pack "./PepperDash_Essentials_Core.nuspec" -version ${{ env.VERSION }}
|
||||
- name: Publish nuget package to Github registry
|
||||
run: nuget push **/*.nupkg -source github
|
||||
- name: Publish nuget package to nuget.org
|
||||
run: nuget push **/*.nupkg -Source https://api.nuget.org/v3/index.json
|
||||
# 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"
|
||||
echo "VERSION=$version" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||
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 main 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, 'main') || 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"
|
||||
echo "VERSION=$version" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||
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 ./
|
||||
270
.github/workflows/main.yml
vendored
Normal file
270
.github/workflows/main.yml
vendored
Normal file
@@ -0,0 +1,270 @@
|
||||
name: main Build using Docker
|
||||
|
||||
on:
|
||||
release:
|
||||
types:
|
||||
- created
|
||||
branches:
|
||||
- main
|
||||
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 main as the release branch. Change as necessary
|
||||
RELEASE_BRANCH: main
|
||||
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
|
||||
# Generate the appropriate version number
|
||||
- name: Set Version Number
|
||||
shell: powershell
|
||||
env:
|
||||
TAG_NAME: ${{ github.event.release.tag_name }}
|
||||
run: echo "VERSION=$($Env:TAG_NAME)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||
# Use the version number to set the version of the assemblies
|
||||
- name: Update AssemblyInfo.cs
|
||||
shell: powershell
|
||||
run: |
|
||||
./.github/scripts/UpdateAssemblyVersion.ps1 ${{ env.VERSION }}
|
||||
- name: restore Nuget Packages
|
||||
run: nuget install .\packages.config -OutputDirectory .\packages -ExcludeVersion
|
||||
# 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 }}
|
||||
Push_Nuget_Package:
|
||||
needs: Build_Project
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- name: Download Build Version Info
|
||||
uses: actions/download-artifact@v1
|
||||
with:
|
||||
name: Version
|
||||
- name: Set Version Number
|
||||
shell: powershell
|
||||
run: |
|
||||
Get-ChildItem "./Version"
|
||||
$version = Get-Content -Path ./Version/version.txt
|
||||
Write-Host "Version: $version"
|
||||
echo "VERSION=$version" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||
Remove-Item -Path ./Version/version.txt
|
||||
Remove-Item -Path ./Version
|
||||
- name: Download Build output
|
||||
uses: actions/download-artifact@v1
|
||||
with:
|
||||
name: Build
|
||||
path: ./
|
||||
- name: Unzip Build file
|
||||
run: |
|
||||
Get-ChildItem .\*.zip | Expand-Archive -DestinationPath .\
|
||||
Remove-Item -Path .\*.zip
|
||||
- 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
|
||||
- name: Add nuget.exe
|
||||
uses: nuget/setup-nuget@v1
|
||||
- name: Add Github Packages source
|
||||
run: nuget sources add -name github -source https://nuget.pkg.github.com/pepperdash/index.json -username Pepperdash -password ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Add nuget.org API Key
|
||||
run: nuget setApiKey ${{ secrets.NUGET_API_KEY }}
|
||||
- name: Create nuget package
|
||||
run: nuget pack "./PepperDash_Essentials_Core.nuspec" -version ${{ env.VERSION }}
|
||||
- name: Publish nuget package to Github registry
|
||||
run: nuget push **/*.nupkg -source github
|
||||
- name: Publish nuget package to nuget.org
|
||||
run: nuget push **/*.nupkg -Source https://api.nuget.org/v3/index.json
|
||||
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"
|
||||
echo "VERSION=$version" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||
Remove-Item -Path ./Version/version.txt
|
||||
Remove-Item -Path ./Version
|
||||
# Checkout/Create the branch
|
||||
- name: Checkout main branch
|
||||
run: git checkout main
|
||||
# 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 main --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 main 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"
|
||||
echo "VERSION=$version" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||
Remove-Item -Path ./Version/version.txt
|
||||
Remove-Item -Path ./Version
|
||||
# Checkout main branch
|
||||
- name: Create new branch
|
||||
run: git checkout main
|
||||
# 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 main --force
|
||||
# Push the tags
|
||||
- name: Push tags
|
||||
run: git push --tags origin
|
||||
- name: Check Directory
|
||||
run: Get-ChildItem ./
|
||||
369
.gitignore
vendored
369
.gitignore
vendored
@@ -20,4 +20,371 @@ obj/
|
||||
[Rr]elease*/
|
||||
_ReSharper*/
|
||||
SIMPLSharpLogs/
|
||||
*.projectinfo
|
||||
*.projectinfo
|
||||
essentials-framework/EssentialDMTestConfig/
|
||||
output/
|
||||
packages/
|
||||
|
||||
PepperDashEssentials-0.0.0-buildType-test.zip
|
||||
## Ignore Visual Studio temporary files, build results, and
|
||||
## files generated by popular Visual Studio add-ons.
|
||||
##
|
||||
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
|
||||
|
||||
# User-specific files
|
||||
*.rsuser
|
||||
*.suo
|
||||
*.user
|
||||
*.userosscache
|
||||
*.sln.docstates
|
||||
|
||||
# User-specific files (MonoDevelop/Xamarin Studio)
|
||||
*.userprefs
|
||||
|
||||
# Mono auto generated files
|
||||
mono_crash.*
|
||||
|
||||
# Build results
|
||||
[Dd]ebug/
|
||||
[Dd]ebugPublic/
|
||||
[Rr]elease/
|
||||
[Rr]eleases/
|
||||
x64/
|
||||
x86/
|
||||
[Ww][Ii][Nn]32/
|
||||
[Aa][Rr][Mm]/
|
||||
[Aa][Rr][Mm]64/
|
||||
bld/
|
||||
[Bb]in/
|
||||
[Oo]bj/
|
||||
[Ll]og/
|
||||
[Ll]ogs/
|
||||
|
||||
# Visual Studio 2015/2017 cache/options directory
|
||||
.vs/
|
||||
# Uncomment if you have tasks that create the project's static files in wwwroot
|
||||
#wwwroot/
|
||||
|
||||
# Visual Studio 2017 auto generated files
|
||||
Generated\ Files/
|
||||
|
||||
# MSTest test Results
|
||||
[Tt]est[Rr]esult*/
|
||||
[Bb]uild[Ll]og.*
|
||||
|
||||
# NUnit
|
||||
*.VisualState.xml
|
||||
TestResult.xml
|
||||
nunit-*.xml
|
||||
|
||||
# Build Results of an ATL Project
|
||||
[Dd]ebugPS/
|
||||
[Rr]eleasePS/
|
||||
dlldata.c
|
||||
|
||||
# Benchmark Results
|
||||
BenchmarkDotNet.Artifacts/
|
||||
|
||||
# .NET Core
|
||||
project.lock.json
|
||||
project.fragment.lock.json
|
||||
artifacts/
|
||||
|
||||
# ASP.NET Scaffolding
|
||||
ScaffoldingReadMe.txt
|
||||
|
||||
# StyleCop
|
||||
StyleCopReport.xml
|
||||
|
||||
# Files built by Visual Studio
|
||||
*_i.c
|
||||
*_p.c
|
||||
*_h.h
|
||||
*.ilk
|
||||
*.meta
|
||||
*.obj
|
||||
*.iobj
|
||||
*.pch
|
||||
*.pdb
|
||||
*.ipdb
|
||||
*.pgc
|
||||
*.pgd
|
||||
*.rsp
|
||||
*.sbr
|
||||
*.tlb
|
||||
*.tli
|
||||
*.tlh
|
||||
*.tmp
|
||||
*.tmp_proj
|
||||
*_wpftmp.csproj
|
||||
*.log
|
||||
*.vspscc
|
||||
*.vssscc
|
||||
.builds
|
||||
*.pidb
|
||||
*.svclog
|
||||
*.scc
|
||||
|
||||
# Chutzpah Test files
|
||||
_Chutzpah*
|
||||
|
||||
# Visual C++ cache files
|
||||
ipch/
|
||||
*.aps
|
||||
*.ncb
|
||||
*.opendb
|
||||
*.opensdf
|
||||
*.sdf
|
||||
*.cachefile
|
||||
*.VC.db
|
||||
*.VC.VC.opendb
|
||||
|
||||
# Visual Studio profiler
|
||||
*.psess
|
||||
*.vsp
|
||||
*.vspx
|
||||
*.sap
|
||||
|
||||
# Visual Studio Trace Files
|
||||
*.e2e
|
||||
|
||||
# TFS 2012 Local Workspace
|
||||
$tf/
|
||||
|
||||
# Guidance Automation Toolkit
|
||||
*.gpState
|
||||
|
||||
# ReSharper is a .NET coding add-in
|
||||
_ReSharper*/
|
||||
*.[Rr]e[Ss]harper
|
||||
*.DotSettings.user
|
||||
|
||||
# TeamCity is a build add-in
|
||||
_TeamCity*
|
||||
|
||||
# DotCover is a Code Coverage Tool
|
||||
*.dotCover
|
||||
|
||||
# AxoCover is a Code Coverage Tool
|
||||
.axoCover/*
|
||||
!.axoCover/settings.json
|
||||
|
||||
# Coverlet is a free, cross platform Code Coverage Tool
|
||||
coverage*.json
|
||||
coverage*.xml
|
||||
coverage*.info
|
||||
|
||||
# Visual Studio code coverage results
|
||||
*.coverage
|
||||
*.coveragexml
|
||||
|
||||
# NCrunch
|
||||
_NCrunch_*
|
||||
.*crunch*.local.xml
|
||||
nCrunchTemp_*
|
||||
|
||||
# MightyMoose
|
||||
*.mm.*
|
||||
AutoTest.Net/
|
||||
|
||||
# Web workbench (sass)
|
||||
.sass-cache/
|
||||
|
||||
# Installshield output folder
|
||||
[Ee]xpress/
|
||||
|
||||
# DocProject is a documentation generator add-in
|
||||
DocProject/buildhelp/
|
||||
DocProject/Help/*.HxT
|
||||
DocProject/Help/*.HxC
|
||||
DocProject/Help/*.hhc
|
||||
DocProject/Help/*.hhk
|
||||
DocProject/Help/*.hhp
|
||||
DocProject/Help/Html2
|
||||
DocProject/Help/html
|
||||
|
||||
# Click-Once directory
|
||||
publish/
|
||||
|
||||
# Publish Web Output
|
||||
*.[Pp]ublish.xml
|
||||
*.azurePubxml
|
||||
# Note: Comment the next line if you want to checkin your web deploy settings,
|
||||
# but database connection strings (with potential passwords) will be unencrypted
|
||||
*.pubxml
|
||||
*.publishproj
|
||||
|
||||
# Microsoft Azure Web App publish settings. Comment the next line if you want to
|
||||
# checkin your Azure Web App publish settings, but sensitive information contained
|
||||
# in these scripts will be unencrypted
|
||||
PublishScripts/
|
||||
|
||||
# NuGet Packages
|
||||
*.nupkg
|
||||
# NuGet Symbol Packages
|
||||
*.snupkg
|
||||
# The packages folder can be ignored because of Package Restore
|
||||
**/[Pp]ackages/*
|
||||
# except build/, which is used as an MSBuild target.
|
||||
!**/[Pp]ackages/build/
|
||||
# Uncomment if necessary however generally it will be regenerated when needed
|
||||
#!**/[Pp]ackages/repositories.config
|
||||
# NuGet v3's project.json files produces more ignorable files
|
||||
*.nuget.props
|
||||
*.nuget.targets
|
||||
|
||||
# Microsoft Azure Build Output
|
||||
csx/
|
||||
*.build.csdef
|
||||
|
||||
# Microsoft Azure Emulator
|
||||
ecf/
|
||||
rcf/
|
||||
|
||||
# Windows Store app package directories and files
|
||||
AppPackages/
|
||||
BundleArtifacts/
|
||||
Package.StoreAssociation.xml
|
||||
_pkginfo.txt
|
||||
*.appx
|
||||
*.appxbundle
|
||||
*.appxupload
|
||||
|
||||
# Visual Studio cache files
|
||||
# files ending in .cache can be ignored
|
||||
*.[Cc]ache
|
||||
# but keep track of directories ending in .cache
|
||||
!?*.[Cc]ache/
|
||||
|
||||
# Others
|
||||
ClientBin/
|
||||
~$*
|
||||
*~
|
||||
*.dbmdl
|
||||
*.dbproj.schemaview
|
||||
*.jfm
|
||||
*.pfx
|
||||
*.publishsettings
|
||||
orleans.codegen.cs
|
||||
|
||||
# Including strong name files can present a security risk
|
||||
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
|
||||
#*.snk
|
||||
|
||||
# Since there are multiple workflows, uncomment next line to ignore bower_components
|
||||
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
|
||||
#bower_components/
|
||||
|
||||
# RIA/Silverlight projects
|
||||
Generated_Code/
|
||||
|
||||
# Backup & report files from converting an old project file
|
||||
# to a newer Visual Studio version. Backup files are not needed,
|
||||
# because we have git ;-)
|
||||
_UpgradeReport_Files/
|
||||
Backup*/
|
||||
UpgradeLog*.XML
|
||||
UpgradeLog*.htm
|
||||
ServiceFabricBackup/
|
||||
*.rptproj.bak
|
||||
|
||||
# SQL Server files
|
||||
*.mdf
|
||||
*.ldf
|
||||
*.ndf
|
||||
|
||||
# Business Intelligence projects
|
||||
*.rdl.data
|
||||
*.bim.layout
|
||||
*.bim_*.settings
|
||||
*.rptproj.rsuser
|
||||
*- [Bb]ackup.rdl
|
||||
*- [Bb]ackup ([0-9]).rdl
|
||||
*- [Bb]ackup ([0-9][0-9]).rdl
|
||||
|
||||
# Microsoft Fakes
|
||||
FakesAssemblies/
|
||||
|
||||
# GhostDoc plugin setting file
|
||||
*.GhostDoc.xml
|
||||
|
||||
# Node.js Tools for Visual Studio
|
||||
.ntvs_analysis.dat
|
||||
node_modules/
|
||||
|
||||
# Visual Studio 6 build log
|
||||
*.plg
|
||||
|
||||
# Visual Studio 6 workspace options file
|
||||
*.opt
|
||||
|
||||
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
|
||||
*.vbw
|
||||
|
||||
# Visual Studio LightSwitch build output
|
||||
**/*.HTMLClient/GeneratedArtifacts
|
||||
**/*.DesktopClient/GeneratedArtifacts
|
||||
**/*.DesktopClient/ModelManifest.xml
|
||||
**/*.Server/GeneratedArtifacts
|
||||
**/*.Server/ModelManifest.xml
|
||||
_Pvt_Extensions
|
||||
|
||||
# Paket dependency manager
|
||||
.paket/paket.exe
|
||||
paket-files/
|
||||
|
||||
# FAKE - F# Make
|
||||
.fake/
|
||||
|
||||
# CodeRush personal settings
|
||||
.cr/personal
|
||||
|
||||
# Python Tools for Visual Studio (PTVS)
|
||||
__pycache__/
|
||||
*.pyc
|
||||
|
||||
# Cake - Uncomment if you are using it
|
||||
# tools/**
|
||||
# !tools/packages.config
|
||||
|
||||
# Tabs Studio
|
||||
*.tss
|
||||
|
||||
# Telerik's JustMock configuration file
|
||||
*.jmconfig
|
||||
|
||||
# BizTalk build output
|
||||
*.btp.cs
|
||||
*.btm.cs
|
||||
*.odx.cs
|
||||
*.xsd.cs
|
||||
|
||||
# OpenCover UI analysis results
|
||||
OpenCover/
|
||||
|
||||
# Azure Stream Analytics local run output
|
||||
ASALocalRun/
|
||||
|
||||
# MSBuild Binary and Structured Log
|
||||
*.binlog
|
||||
|
||||
# NVidia Nsight GPU debugger configuration file
|
||||
*.nvuser
|
||||
|
||||
# MFractors (Xamarin productivity tool) working folder
|
||||
.mfractor/
|
||||
|
||||
# Local History for Visual Studio
|
||||
.localhistory/
|
||||
|
||||
# BeatPulse healthcheck temp database
|
||||
healthchecksdb
|
||||
|
||||
# Backup folder for Package Reference Convert tool in Visual Studio 2017
|
||||
MigrationBackup/
|
||||
|
||||
# Ionide (cross platform F# VS Code tools) working folder
|
||||
.ionide/
|
||||
|
||||
# Fody - auto-generated XML schema
|
||||
FodyWeavers.xsd
|
||||
|
||||
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
[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,105 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
public class ComPortController : Device, IBasicCommunication
|
||||
{
|
||||
public event EventHandler<GenericCommMethodReceiveBytesArgs> BytesReceived;
|
||||
public event EventHandler<GenericCommMethodReceiveTextArgs> TextReceived;
|
||||
|
||||
ComPort Port;
|
||||
ComPort.ComPortSpec Spec;
|
||||
|
||||
public ComPortController(string key, IComPorts ComDevice, uint comPortNum, ComPort.ComPortSpec spec)
|
||||
: base(key)
|
||||
{
|
||||
Port = ComDevice.ComPorts[comPortNum];
|
||||
Spec = spec;
|
||||
|
||||
Debug.Console(2, "Creating com port '{0}'", key);
|
||||
Debug.Console(2, "Com port spec:\r{0}", JsonConvert.SerializeObject(spec));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a ComPort if the parameters are correct. Returns and logs errors if not
|
||||
/// </summary>
|
||||
public static ComPortController GetComPortController(string key,
|
||||
IComPorts comDevice, uint comPortNum, ComPort.ComPortSpec spec)
|
||||
{
|
||||
Debug.Console(1, "Creating com port '{0}'", key);
|
||||
if (comDevice == null)
|
||||
throw new ArgumentNullException("comDevice");
|
||||
if (string.IsNullOrEmpty(key))
|
||||
throw new ArgumentNullException("key");
|
||||
if (comPortNum > comDevice.NumberOfComPorts)
|
||||
{
|
||||
Debug.Console(0, "[{0}] Com port {1} out of range on {2}",
|
||||
key, comPortNum, comDevice.GetType().Name);
|
||||
return null;
|
||||
}
|
||||
var port = new ComPortController(key, comDevice, comPortNum, spec);
|
||||
return port;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Registers port and sends ComSpec
|
||||
/// </summary>
|
||||
/// <returns>false if either register or comspec fails</returns>
|
||||
public override bool CustomActivate()
|
||||
{
|
||||
var result = Port.Register();
|
||||
if (result != eDeviceRegistrationUnRegistrationResponse.Success)
|
||||
{
|
||||
Debug.Console(0, this, "Cannot register Com port: {0}", result);
|
||||
return false;
|
||||
}
|
||||
var specResult = Port.SetComPortSpec(Spec);
|
||||
if (specResult != 0)
|
||||
{
|
||||
Debug.Console(0, this, "Cannot set comspec");
|
||||
return false;
|
||||
}
|
||||
Port.SerialDataReceived += new ComPortDataReceivedEvent(Port_SerialDataReceived);
|
||||
return true;
|
||||
}
|
||||
|
||||
void Port_SerialDataReceived(ComPort ReceivingComPort, ComPortSerialDataEventArgs args)
|
||||
{
|
||||
if (BytesReceived != null)
|
||||
{
|
||||
var bytes = Encoding.GetEncoding(28591).GetBytes(args.SerialData);
|
||||
BytesReceived(this, new GenericCommMethodReceiveBytesArgs(bytes));
|
||||
}
|
||||
if(TextReceived != null)
|
||||
TextReceived(this, new GenericCommMethodReceiveTextArgs(args.SerialData));
|
||||
}
|
||||
|
||||
public override bool Deactivate()
|
||||
{
|
||||
return Port.UnRegister() == eDeviceRegistrationUnRegistrationResponse.Success;
|
||||
}
|
||||
|
||||
#region IBasicCommunication Members
|
||||
|
||||
public void SendText(string text)
|
||||
{
|
||||
Port.Send(text);
|
||||
}
|
||||
|
||||
public void SendBytes(byte[] bytes)
|
||||
{
|
||||
|
||||
var text = Encoding.GetEncoding(28591).GetString(bytes, 0, bytes.Length);
|
||||
Port.Send(text);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,160 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharp.CrestronIO;
|
||||
using Crestron.SimplSharpPro;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core.Config;
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public static class IRPortHelper
|
||||
{
|
||||
public static string IrDriverPathPrefix
|
||||
{
|
||||
get
|
||||
{
|
||||
return string.Format(@"\NVRAM\Program{0}\IR\", InitialParametersClass.ApplicationNumber);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Finds either the ControlSystem or a device controller that contains IR ports and
|
||||
/// returns a port from the hardware device
|
||||
/// </summary>
|
||||
/// <param name="propsToken"></param>
|
||||
/// <returns>IrPortConfig object. The port and or filename will be empty/null
|
||||
/// if valid values don't exist on config</returns>
|
||||
public static IrOutPortConfig GetIrPort(JToken propsToken)
|
||||
{
|
||||
var control = propsToken["control"];
|
||||
if (control == null)
|
||||
return null;
|
||||
if (control["method"].Value<string>() != "ir")
|
||||
{
|
||||
Debug.Console(0, "IRPortHelper called with non-IR properties");
|
||||
return null;
|
||||
}
|
||||
|
||||
var port = new IrOutPortConfig();
|
||||
|
||||
var portDevKey = control.Value<string>("controlPortDevKey");
|
||||
var portNum = control.Value<uint>("controlPortNumber");
|
||||
if (portDevKey == null || portNum == 0)
|
||||
{
|
||||
Debug.Console(1, "WARNING: Properties is missing port device or port number");
|
||||
return port;
|
||||
}
|
||||
|
||||
IIROutputPorts irDev = null;
|
||||
if (portDevKey.Equals("controlSystem", StringComparison.OrdinalIgnoreCase)
|
||||
|| portDevKey.Equals("processor", StringComparison.OrdinalIgnoreCase))
|
||||
irDev = Global.ControlSystem;
|
||||
else
|
||||
irDev = DeviceManager.GetDeviceForKey(portDevKey) as IIROutputPorts;
|
||||
|
||||
if (irDev == null)
|
||||
{
|
||||
Debug.Console(1, "[Config] Error, device with IR ports '{0}' not found", portDevKey);
|
||||
return port;
|
||||
}
|
||||
|
||||
if (portNum <= irDev.NumberOfIROutputPorts) // success!
|
||||
{
|
||||
var file = IrDriverPathPrefix + control["irFile"].Value<string>();
|
||||
port.Port = irDev.IROutputPorts[portNum];
|
||||
port.FileName = file;
|
||||
return port; // new IrOutPortConfig { Port = irDev.IROutputPorts[portNum], FileName = file };
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Console(1, "[Config] Error, device '{0}' IR port {1} out of range",
|
||||
portDevKey, portNum);
|
||||
return port;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a ready-to-go IrOutputPortController from a DeviceConfig object.
|
||||
/// </summary>
|
||||
public static IrOutputPortController GetIrOutputPortController(DeviceConfig devConf)
|
||||
{
|
||||
var irControllerKey = devConf.Key + "-ir";
|
||||
if (devConf.Properties == null)
|
||||
{
|
||||
Debug.Console(0, "[{0}] WARNING: Device config does not include properties. IR will not function.", devConf.Key);
|
||||
return new IrOutputPortController(irControllerKey, null, "");
|
||||
}
|
||||
|
||||
var control = devConf.Properties["control"];
|
||||
if (control == null)
|
||||
{
|
||||
var c = new IrOutputPortController(irControllerKey, null, "");
|
||||
Debug.Console(0, c, "WARNING: Device config does not include control properties. IR will not function");
|
||||
return c;
|
||||
}
|
||||
|
||||
var portDevKey = control.Value<string>("controlPortDevKey");
|
||||
var portNum = control.Value<uint>("controlPortNumber");
|
||||
IIROutputPorts irDev = null;
|
||||
|
||||
if (portDevKey == null)
|
||||
{
|
||||
var c = new IrOutputPortController(irControllerKey, null, "");
|
||||
Debug.Console(0, c, "WARNING: control properties is missing ir device");
|
||||
return c;
|
||||
}
|
||||
|
||||
if (portNum == 0)
|
||||
{
|
||||
var c = new IrOutputPortController(irControllerKey, null, "");
|
||||
Debug.Console(0, c, "WARNING: control properties is missing ir port number");
|
||||
return c;
|
||||
}
|
||||
|
||||
if (portDevKey.Equals("controlSystem", StringComparison.OrdinalIgnoreCase)
|
||||
|| portDevKey.Equals("processor", StringComparison.OrdinalIgnoreCase))
|
||||
irDev = Global.ControlSystem;
|
||||
else
|
||||
irDev = DeviceManager.GetDeviceForKey(portDevKey) as IIROutputPorts;
|
||||
|
||||
if (irDev == null)
|
||||
{
|
||||
var c = new IrOutputPortController(irControllerKey, null, "");
|
||||
Debug.Console(0, c, "WARNING: device with IR ports '{0}' not found", portDevKey);
|
||||
return c;
|
||||
}
|
||||
|
||||
if (portNum <= irDev.NumberOfIROutputPorts) // success!
|
||||
return new IrOutputPortController(irControllerKey, irDev.IROutputPorts[portNum],
|
||||
IrDriverPathPrefix + control["irFile"].Value<string>());
|
||||
else
|
||||
{
|
||||
var c = new IrOutputPortController(irControllerKey, null, "");
|
||||
Debug.Console(0, c, "WARNING: device '{0}' IR port {1} out of range",
|
||||
portDevKey, portNum);
|
||||
return c;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Wrapper to help in IR port creation
|
||||
/// </summary>
|
||||
public class IrOutPortConfig
|
||||
{
|
||||
public IROutputPort Port { get; set; }
|
||||
public string FileName { get; set; }
|
||||
|
||||
public IrOutPortConfig()
|
||||
{
|
||||
FileName = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,26 +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.Core;
|
||||
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
|
||||
//public class ComPortConfig
|
||||
//{
|
||||
// //public string ContolPortDevKey { get; set; }
|
||||
|
||||
// //public uint ControlPortNumber { get; set; }
|
||||
|
||||
// [JsonConverter(typeof(ComSpecJsonConverter))]
|
||||
// public ComPort.ComPortSpec ComParams { get; set; }
|
||||
//}
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
using System;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace PepperDash.Essentials.Core.Config
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents the info section of a Config file
|
||||
/// </summary>
|
||||
public class InfoConfig
|
||||
{
|
||||
[JsonProperty("name")]
|
||||
public string Name { get; set; }
|
||||
|
||||
[JsonProperty("date")]
|
||||
public DateTime Date { get; set; }
|
||||
|
||||
[JsonProperty("type")]
|
||||
public string Type { get; set; }
|
||||
|
||||
[JsonProperty("version")]
|
||||
public string Version { get; set; }
|
||||
|
||||
[JsonProperty("comment")]
|
||||
public string Comment { get; set; }
|
||||
|
||||
public InfoConfig()
|
||||
{
|
||||
Name = "";
|
||||
Date = DateTime.Now;
|
||||
Type = "";
|
||||
Version = "";
|
||||
Comment = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,127 +0,0 @@
|
||||
using Crestron.SimplSharpPro;
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
public static class CommonBoolCue
|
||||
{
|
||||
public static readonly Cue Power = new Cue("Power", 101, eCueType.Bool);
|
||||
public static readonly Cue PowerOn = new Cue("PowerOn", 102, eCueType.Bool);
|
||||
public static readonly Cue PowerOff = new Cue("PowerOff", 103, eCueType.Bool);
|
||||
|
||||
public static readonly Cue HasPowerFeedback = new Cue("HasPowerFeedback", 101, eCueType.Bool);
|
||||
public static readonly Cue PowerOnFeedback = new Cue("PowerOnFeedback", 102, eCueType.Bool);
|
||||
public static readonly Cue IsOnlineFeedback = new Cue("IsOnlineFeedback", 104, eCueType.Bool);
|
||||
public static readonly Cue IsWarmingUp = new Cue("IsWarmingUp", 105, eCueType.Bool);
|
||||
public static readonly Cue IsCoolingDown = new Cue("IsCoolingDown", 106, eCueType.Bool);
|
||||
|
||||
public static readonly Cue Dash = new Cue("Dash", 109, eCueType.Bool);
|
||||
public static readonly Cue Digit0 = new Cue("Digit0", 110, eCueType.Bool);
|
||||
public static readonly Cue Digit1 = new Cue("Digit1", 111, eCueType.Bool);
|
||||
public static readonly Cue Digit2 = new Cue("Digit2", 112, eCueType.Bool);
|
||||
public static readonly Cue Digit3 = new Cue("Digit3", 113, eCueType.Bool);
|
||||
public static readonly Cue Digit4 = new Cue("Digit4", 114, eCueType.Bool);
|
||||
public static readonly Cue Digit5 = new Cue("Digit5", 115, eCueType.Bool);
|
||||
public static readonly Cue Digit6 = new Cue("Digit6", 116, eCueType.Bool);
|
||||
public static readonly Cue Digit7 = new Cue("Digit7", 117, eCueType.Bool);
|
||||
public static readonly Cue Digit8 = new Cue("Digit8", 118, eCueType.Bool);
|
||||
public static readonly Cue Digit9 = new Cue("Digit9", 119, eCueType.Bool);
|
||||
public static readonly Cue KeypadMisc1 = new Cue("KeypadMisc1", 120, eCueType.Bool);
|
||||
public static readonly Cue KeypadMisc2 = new Cue("KeypadMisc2", 121, eCueType.Bool);
|
||||
|
||||
public static readonly Cue NumericEnter = new Cue("Enter", 122, eCueType.Bool);
|
||||
public static readonly Cue ChannelUp = new Cue("ChannelUp", 123, eCueType.Bool);
|
||||
public static readonly Cue ChannelDown = new Cue("ChannelDown", 124, eCueType.Bool);
|
||||
public static readonly Cue Last = new Cue("Last", 125, eCueType.Bool);
|
||||
public static readonly Cue OpenClose = new Cue("OpenClose", 126, eCueType.Bool);
|
||||
public static readonly Cue Subtitle = new Cue("Subtitle", 127, eCueType.Bool);
|
||||
public static readonly Cue Audio = new Cue("Audio", 128, eCueType.Bool);
|
||||
public static readonly Cue Info = new Cue("Info", 129, eCueType.Bool);
|
||||
public static readonly Cue Menu = new Cue("Menu", 130, eCueType.Bool);
|
||||
public static readonly Cue DeviceMenu = new Cue("DeviceMenu", 131, eCueType.Bool);
|
||||
public static readonly Cue Return = new Cue("Return", 132, eCueType.Bool);
|
||||
public static readonly Cue Back = new Cue("Back", 133, eCueType.Bool);
|
||||
public static readonly Cue Exit = new Cue("Exit", 134, eCueType.Bool);
|
||||
public static readonly Cue Clear = new Cue("Clear", 135, eCueType.Bool);
|
||||
public static readonly Cue List = new Cue("List", 136, eCueType.Bool);
|
||||
public static readonly Cue Guide = new Cue("Guide", 137, eCueType.Bool);
|
||||
public static readonly Cue Am = new Cue("Am", 136, eCueType.Bool);
|
||||
public static readonly Cue Fm = new Cue("Fm", 137, eCueType.Bool);
|
||||
public static readonly Cue Up = new Cue("Up", 138, eCueType.Bool);
|
||||
public static readonly Cue Down = new Cue("Down", 139, eCueType.Bool);
|
||||
public static readonly Cue Left = new Cue("Left", 140, eCueType.Bool);
|
||||
public static readonly Cue Right = new Cue("Right", 141, eCueType.Bool);
|
||||
public static readonly Cue Select = new Cue("Select", 142, eCueType.Bool);
|
||||
public static readonly Cue SmartApps = new Cue("SmartApps", 143, eCueType.Bool);
|
||||
public static readonly Cue Dvr = new Cue("Dvr", 144, eCueType.Bool);
|
||||
|
||||
public static readonly Cue Play = new Cue("Play", 145, eCueType.Bool);
|
||||
public static readonly Cue Pause = new Cue("Pause", 146, eCueType.Bool);
|
||||
public static readonly Cue Stop = new Cue("Stop", 147, eCueType.Bool);
|
||||
public static readonly Cue ChapNext = new Cue("ChapNext", 148, eCueType.Bool);
|
||||
public static readonly Cue ChapPrevious = new Cue("ChapPrevious", 149, eCueType.Bool);
|
||||
public static readonly Cue Rewind = new Cue("Rewind", 150, eCueType.Bool);
|
||||
public static readonly Cue Ffwd = new Cue("Ffwd", 151, eCueType.Bool);
|
||||
public static readonly Cue Replay = new Cue("Replay", 152, eCueType.Bool);
|
||||
public static readonly Cue Advance = new Cue("Advance", 153, eCueType.Bool);
|
||||
public static readonly Cue Record = new Cue("Record", 154, eCueType.Bool);
|
||||
public static readonly Cue Red = new Cue("Red", 155, eCueType.Bool);
|
||||
public static readonly Cue Green = new Cue("Green", 156, eCueType.Bool);
|
||||
public static readonly Cue Yellow = new Cue("Yellow", 157, eCueType.Bool);
|
||||
public static readonly Cue Blue = new Cue("Blue", 158, eCueType.Bool);
|
||||
public static readonly Cue Home = new Cue("Home", 159, eCueType.Bool);
|
||||
public static readonly Cue PopUp = new Cue("PopUp", 160, eCueType.Bool);
|
||||
public static readonly Cue PageUp = new Cue("PageUp", 161, eCueType.Bool);
|
||||
public static readonly Cue PageDown = new Cue("PageDown", 162, eCueType.Bool);
|
||||
public static readonly Cue Search = new Cue("Search", 163, eCueType.Bool);
|
||||
public static readonly Cue Setup = new Cue("Setup", 164, eCueType.Bool);
|
||||
public static readonly Cue RStep = new Cue("RStep", 165, eCueType.Bool);
|
||||
public static readonly Cue FStep = new Cue("FStep", 166, eCueType.Bool);
|
||||
|
||||
public static readonly Cue IsConnected = new Cue("IsConnected", 281, eCueType.Bool);
|
||||
public static readonly Cue IsOk = new Cue("IsOk", 282, eCueType.Bool);
|
||||
public static readonly Cue InWarning = new Cue("InWarning", 283, eCueType.Bool);
|
||||
public static readonly Cue InError = new Cue("InError", 284, eCueType.Bool);
|
||||
public static readonly Cue StatusUnknown = new Cue("StatusUnknown", 285, eCueType.Bool);
|
||||
|
||||
public static readonly Cue VolumeUp = new Cue("VolumeUp", 401, eCueType.Bool);
|
||||
public static readonly Cue VolumeDown = new Cue("VolumeDown", 402, eCueType.Bool);
|
||||
public static readonly Cue MuteOn = new Cue("MuteOn", 403, eCueType.Bool);
|
||||
public static readonly Cue MuteOff = new Cue("MuteOff", 404, eCueType.Bool);
|
||||
public static readonly Cue MuteToggle = new Cue("MuteToggle", 405, eCueType.Bool);
|
||||
public static readonly Cue ShowVolumeButtons = new Cue("ShowVolumeButtons", 406, eCueType.Bool);
|
||||
public static readonly Cue ShowVolumeSlider = new Cue("ShowVolumeSlider", 407, eCueType.Bool);
|
||||
|
||||
public static readonly Cue Hdmi1 = new Cue("Hdmi1", 451, eCueType.Bool);
|
||||
public static readonly Cue Hdmi2 = new Cue("Hdmi2", 452, eCueType.Bool);
|
||||
public static readonly Cue Hdmi3 = new Cue("Hdmi3", 453, eCueType.Bool);
|
||||
public static readonly Cue Hdmi4 = new Cue("Hdmi4", 454, eCueType.Bool);
|
||||
public static readonly Cue Hdmi5 = new Cue("Hdmi5", 455, eCueType.Bool);
|
||||
public static readonly Cue Hdmi6 = new Cue("Hdmi6", 456, eCueType.Bool);
|
||||
public static readonly Cue DisplayPort1 = new Cue("DisplayPort1", 457, eCueType.Bool);
|
||||
public static readonly Cue DisplayPort2 = new Cue("DisplayPort2", 458, eCueType.Bool);
|
||||
public static readonly Cue Dvi1 = new Cue("Dvi1", 459, eCueType.Bool);
|
||||
public static readonly Cue Dvi2 = new Cue("Dvi2", 460, eCueType.Bool);
|
||||
public static readonly Cue Video1 = new Cue("Video1", 461, eCueType.Bool);
|
||||
public static readonly Cue Video2 = new Cue("Video2", 462, eCueType.Bool);
|
||||
public static readonly Cue Component1 = new Cue("Component1", 463, eCueType.Bool);
|
||||
public static readonly Cue Component2 = new Cue("Component2", 464, eCueType.Bool);
|
||||
public static readonly Cue Vga1 = new Cue("Vga1", 465, eCueType.Bool);
|
||||
public static readonly Cue Vga2 = new Cue("Vga2", 466, eCueType.Bool);
|
||||
public static readonly Cue Rgb1 = new Cue("Rgb1", 467, eCueType.Bool);
|
||||
public static readonly Cue Rgb2 = new Cue("Rgb2", 468, eCueType.Bool);
|
||||
public static readonly Cue Antenna = new Cue("Antenna", 469, eCueType.Bool);
|
||||
|
||||
public static readonly Cue InCall = new Cue("InCall", 501, eCueType.Bool);
|
||||
}
|
||||
|
||||
public static class CommonIntCue
|
||||
{
|
||||
public static readonly Cue MainVolumeLevel = new Cue("MainVolumeLevel", 401, eCueType.Int);
|
||||
public static readonly Cue MainVolumeLevelFeedback = new Cue("MainVolumeLevelFeedback", 401, eCueType.Int);
|
||||
}
|
||||
|
||||
public static class CommonStringCue
|
||||
{
|
||||
public static readonly Cue IpConnectionsText = new Cue("IpConnectionsText", 9999, eCueType.String);
|
||||
}
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro;
|
||||
|
||||
|
||||
namespace PepperDash.Essentials.Core.Crestron_IO
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a generic digital input deviced tied to a versiport
|
||||
/// </summary>
|
||||
public class GenericVersiportInputDevice
|
||||
{
|
||||
//Versiport InputPort {get; private set;}
|
||||
|
||||
//BoolFeedback InputStateFeedback {get; private set;}
|
||||
|
||||
//Func<bool> InputStateFeedbackFunc
|
||||
//{
|
||||
// get
|
||||
// {
|
||||
// return () => InputPort.DigitalIn;
|
||||
// }
|
||||
//}
|
||||
|
||||
//public GenericVersiportInputDevice(Versiport inputPort)
|
||||
//{
|
||||
// InputStateFeedback = new BoolFeedback(InputStateFeedbackFunc);
|
||||
|
||||
// InputPort = inputPort;
|
||||
|
||||
// InputPort.VersiportChange += new VersiportEventHandler(InputPort_VersiportChange);
|
||||
|
||||
//}
|
||||
|
||||
//void InputPort_VersiportChange(Versiport port, VersiportEventArgs args)
|
||||
//{
|
||||
// InputStateFeedback.FireUpdate();
|
||||
//}
|
||||
}
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
|
||||
using Crestron.SimplSharpPro;
|
||||
|
||||
namespace PepperDash.Essentials.Core.Crestron_IO
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a generic device controlled by relays
|
||||
/// </summary>
|
||||
public class GenericRelayDevice
|
||||
{
|
||||
//Relay RelayOutput { get; private set; }
|
||||
|
||||
//public boolfeedback relaystatefeedback { get; private set; }
|
||||
|
||||
//func<bool> relaystatefeedbackfunc
|
||||
//{
|
||||
// get
|
||||
// {
|
||||
// return () => relayoutput.state;
|
||||
// }
|
||||
//}
|
||||
|
||||
//public genericrelaydevice(relay relay)
|
||||
//{
|
||||
// relaystatefeedback = new boolfeedback(relaystatefeedbackfunc);
|
||||
|
||||
// if(relay.availableforuse)
|
||||
// relayoutput = relay;
|
||||
|
||||
// relayoutput.statechange += new relayeventhandler(relayoutput_statechange);
|
||||
//}
|
||||
|
||||
//void relayoutput_statechange(relay relay, relayeventargs args)
|
||||
//{
|
||||
// relaystatefeedback.fireupdate();
|
||||
//}
|
||||
}
|
||||
}
|
||||
@@ -1,98 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro;
|
||||
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Encapsulates a string-named, joined and typed command to a device
|
||||
/// </summary>
|
||||
[Obsolete()]
|
||||
public class DevAction
|
||||
{
|
||||
public Cue Cue { get; private set; }
|
||||
public Action<object> Action { get; private set; }
|
||||
|
||||
|
||||
public DevAction(Cue cue, Action<object> action)
|
||||
{
|
||||
Cue = cue;
|
||||
Action = action;
|
||||
}
|
||||
}
|
||||
|
||||
public enum eCueType
|
||||
{
|
||||
Bool, Int, String, Void, Other
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// The Cue class is a container to represent a name / join number / type for simplifying
|
||||
/// commands coming into devices.
|
||||
/// </summary>
|
||||
public class Cue
|
||||
{
|
||||
public string Name { get; private set; }
|
||||
public uint Number { get; private set; }
|
||||
public eCueType Type { get; private set; }
|
||||
|
||||
public Cue(string name, uint join, eCueType type)
|
||||
{
|
||||
Name = name;
|
||||
Number = join;
|
||||
Type = type;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Override that prints out the cue's data
|
||||
/// </summary>
|
||||
public override string ToString()
|
||||
{
|
||||
return string.Format("{0} Cue '{1}'-{2}", Type, Name, Number);
|
||||
}
|
||||
|
||||
///// <summary>
|
||||
///// Returns a new Cue with JoinNumber offset
|
||||
///// </summary>
|
||||
//public Cue GetOffsetCopy(uint offset)
|
||||
//{
|
||||
// return new Cue(Name, Number + offset, Type);
|
||||
//}
|
||||
|
||||
/// <summary>
|
||||
/// Helper method to create a Cue of Bool type
|
||||
/// </summary>
|
||||
/// <returns>Cue</returns>
|
||||
public static Cue BoolCue(string name, uint join)
|
||||
{
|
||||
return new Cue(name, join, eCueType.Bool);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Helper method to create a Cue of ushort type
|
||||
/// </summary>
|
||||
/// <returns>Cue</returns>
|
||||
public static Cue UShortCue(string name, uint join)
|
||||
{
|
||||
return new Cue(name, join, eCueType.Int);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Helper method to create a Cue of string type
|
||||
/// </summary>
|
||||
/// <returns>Cue</returns>
|
||||
public static Cue StringCue(string name, uint join)
|
||||
{
|
||||
return new Cue(name, join, eCueType.String);
|
||||
}
|
||||
|
||||
public static readonly Cue DefaultBoolCue = new Cue("-none-", 0, eCueType.Bool);
|
||||
public static readonly Cue DefaultIntCue = new Cue("-none-", 0, eCueType.Int);
|
||||
public static readonly Cue DefaultStringCue = new Cue("-none-", 0, eCueType.String);
|
||||
}
|
||||
}
|
||||
@@ -1,142 +0,0 @@
|
||||
//using System;
|
||||
//using System.Collections.Generic;
|
||||
//using System.Linq;
|
||||
//using System.Text;
|
||||
//using Crestron.SimplSharp;
|
||||
//using Crestron.SimplSharp.CrestronDataStore;
|
||||
//using Crestron.SimplSharpPro;
|
||||
|
||||
|
||||
//namespace PepperDash.Essentials.Core
|
||||
//{
|
||||
// public class Debug
|
||||
// {
|
||||
// public static uint Level { get; private set; }
|
||||
|
||||
// /// <summary>
|
||||
// /// This should called from the ControlSystem Initiailize method.
|
||||
// /// </summary>
|
||||
// public static void Initialize()
|
||||
// {
|
||||
// // Add command to console
|
||||
// CrestronConsole.AddNewConsoleCommand(SetDebugFromConsole, "appdebug",
|
||||
// "appdebug:P [0-2]: Sets the application's console debug message level",
|
||||
// ConsoleAccessLevelEnum.AccessOperator);
|
||||
|
||||
// uint level = 0;
|
||||
// var err = CrestronDataStoreStatic.GetGlobalUintValue("DebugLevel", out level);
|
||||
// if (err == CrestronDataStore.CDS_ERROR.CDS_SUCCESS)
|
||||
// SetDebugLevel(level);
|
||||
// else if (err == CrestronDataStore.CDS_ERROR.CDS_RECORD_NOT_FOUND)
|
||||
// CrestronDataStoreStatic.SetGlobalUintValue("DebugLevel", 0);
|
||||
// else
|
||||
// CrestronConsole.PrintLine("Error restoring console debug level setting: {0}", err);
|
||||
// }
|
||||
|
||||
// /// <summary>
|
||||
// /// Callback for console command
|
||||
// /// </summary>
|
||||
// /// <param name="levelString"></param>
|
||||
// public static void SetDebugFromConsole(string levelString)
|
||||
// {
|
||||
// try
|
||||
// {
|
||||
// if (string.IsNullOrEmpty(levelString.Trim()))
|
||||
// {
|
||||
// CrestronConsole.PrintLine("AppDebug level = {0}", Level);
|
||||
// return;
|
||||
// }
|
||||
|
||||
// SetDebugLevel(Convert.ToUInt32(levelString));
|
||||
// }
|
||||
// catch
|
||||
// {
|
||||
// CrestronConsole.PrintLine("Usage: appdebug:P [0-2]");
|
||||
// }
|
||||
// }
|
||||
|
||||
// /// <summary>
|
||||
// /// Sets the debug level
|
||||
// /// </summary>
|
||||
// /// <param name="level"> Valid values 0 (no debug), 1 (critical), 2 (all messages)</param>
|
||||
// public static void SetDebugLevel(uint level)
|
||||
// {
|
||||
// if (level <= 2)
|
||||
// {
|
||||
// Level = 2;
|
||||
// CrestronConsole.PrintLine("[Application {0}], Debug level set to {1}",
|
||||
// InitialParametersClass.ApplicationNumber, level);
|
||||
// var err = CrestronDataStoreStatic.SetGlobalUintValue("DebugLevel", level);
|
||||
// if(err != CrestronDataStore.CDS_ERROR.CDS_SUCCESS)
|
||||
// CrestronConsole.PrintLine("Error saving console debug level setting: {0}", err);
|
||||
// }
|
||||
// }
|
||||
|
||||
// /// <summary>
|
||||
// /// Prints message to console if current debug level is equal to or higher than the level of this message.
|
||||
// /// Uses CrestronConsole.PrintLine.
|
||||
// /// </summary>
|
||||
// /// <param name="level"></param>
|
||||
// /// <param name="format">Console format string</param>
|
||||
// /// <param name="items">Object parameters</param>
|
||||
// public static void Console(uint level, string format, params object[] items)
|
||||
// {
|
||||
// if (Level >= level)
|
||||
// CrestronConsole.PrintLine("App {0}:{1}", InitialParametersClass.ApplicationNumber,
|
||||
// string.Format(format, items));
|
||||
// }
|
||||
|
||||
// /// <summary>
|
||||
// /// Appends a device Key to the beginning of a message
|
||||
// /// </summary>
|
||||
// public static void Console(uint level, IKeyed dev, string format, params object[] items)
|
||||
// {
|
||||
// if (Level >= level)
|
||||
// Console(level, "[{0}] {1}", dev.Key, string.Format(format, items));
|
||||
// }
|
||||
|
||||
// public static void Console(uint level, IKeyed dev, ErrorLogLevel errorLogLevel,
|
||||
// string format, params object[] items)
|
||||
// {
|
||||
// if (Level >= level)
|
||||
// {
|
||||
// var str = string.Format("[{0}] {1}", dev.Key, string.Format(format, items));
|
||||
// Console(level, str);
|
||||
// LogError(errorLogLevel, str);
|
||||
// }
|
||||
// }
|
||||
|
||||
// public static void Console(uint level, ErrorLogLevel errorLogLevel,
|
||||
// string format, params object[] items)
|
||||
// {
|
||||
// if (Level >= level)
|
||||
// {
|
||||
// var str = string.Format(format, items);
|
||||
// Console(level, str);
|
||||
// LogError(errorLogLevel, str);
|
||||
// }
|
||||
// }
|
||||
|
||||
// public static void LogError(ErrorLogLevel errorLogLevel, string str)
|
||||
// {
|
||||
// string msg = string.Format("App {0}:{1}", InitialParametersClass.ApplicationNumber, str);
|
||||
// switch (errorLogLevel)
|
||||
// {
|
||||
// case ErrorLogLevel.Error:
|
||||
// ErrorLog.Error(msg);
|
||||
// break;
|
||||
// case ErrorLogLevel.Warning:
|
||||
// ErrorLog.Warn(msg);
|
||||
// break;
|
||||
// case ErrorLogLevel.Notice:
|
||||
// ErrorLog.Notice(msg);
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
|
||||
// public enum ErrorLogLevel
|
||||
// {
|
||||
// Error, Warning, Notice, None
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
@@ -1,48 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
using Crestron.SimplSharpPro.Fusion;
|
||||
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.SmartObjects;
|
||||
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public interface IPower
|
||||
{
|
||||
void PowerOn();
|
||||
void PowerOff();
|
||||
void PowerToggle();
|
||||
BoolFeedback PowerIsOnFeedback { get; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public static class IPowerExtensions
|
||||
{
|
||||
public static void LinkButtons(this IPower dev, BasicTriList triList)
|
||||
{
|
||||
triList.SetSigFalseAction(101, dev.PowerOn);
|
||||
triList.SetSigFalseAction(102, dev.PowerOff);
|
||||
triList.SetSigFalseAction(103, dev.PowerToggle);
|
||||
dev.PowerIsOnFeedback.LinkInputSig(triList.BooleanInput[101]);
|
||||
}
|
||||
|
||||
public static void UnlinkButtons(this IPower dev, BasicTriList triList)
|
||||
{
|
||||
triList.ClearBoolSigAction(101);
|
||||
triList.ClearBoolSigAction(102);
|
||||
triList.ClearBoolSigAction(103);
|
||||
dev.PowerIsOnFeedback.UnlinkInputSig(triList.BooleanInput[101]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,56 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
//public interface IVolumeFunctions
|
||||
//{
|
||||
// BoolCueActionPair VolumeUpCueActionPair { get; }
|
||||
// BoolCueActionPair VolumeDownCueActionPair { get; }
|
||||
// BoolCueActionPair MuteToggleCueActionPair { get; }
|
||||
//}
|
||||
|
||||
//public interface IVolumeTwoWay : IVolumeFunctions
|
||||
//{
|
||||
// IntFeedback VolumeLevelFeedback { get; }
|
||||
// UShortCueActionPair VolumeLevelCueActionPair { get; }
|
||||
// BoolFeedback IsMutedFeedback { get; }
|
||||
//}
|
||||
|
||||
///// <summary>
|
||||
/////
|
||||
///// </summary>
|
||||
//public static class IFunctionListExtensions
|
||||
//{
|
||||
// public static string GetFunctionsConsoleList(this IHasCueActionList device)
|
||||
// {
|
||||
// var sb = new StringBuilder();
|
||||
// var list = device.CueActionList;
|
||||
// foreach (var cap in list)
|
||||
// sb.AppendFormat("{0,-15} {1,4} {2}\r", cap.Cue.Name, cap.Cue.Number, cap.GetType().Name);
|
||||
// return sb.ToString();
|
||||
// }
|
||||
//}
|
||||
|
||||
public enum AudioChangeType
|
||||
{
|
||||
Mute, Volume
|
||||
}
|
||||
|
||||
public class AudioChangeEventArgs
|
||||
{
|
||||
public AudioChangeType ChangeType { get; private set; }
|
||||
public IBasicVolumeControls AudioDevice { get; private set; }
|
||||
|
||||
public AudioChangeEventArgs(IBasicVolumeControls device, AudioChangeType changeType)
|
||||
{
|
||||
ChangeType = changeType;
|
||||
AudioDevice = device;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,89 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharp.CrestronIO;
|
||||
using Crestron.SimplSharpPro;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using PepperDash.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public enum eSourceListItemType
|
||||
{
|
||||
Route, Off, Other, SomethingAwesomerThanThese
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents an item in a source list - can be deserialized into.
|
||||
/// </summary>
|
||||
public class SourceListItem
|
||||
{
|
||||
public string SourceKey { get; set; }
|
||||
/// <summary>
|
||||
/// Returns the source Device for this, if it exists in DeviceManager
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public Device SourceDevice
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_SourceDevice == null)
|
||||
_SourceDevice = DeviceManager.GetDeviceForKey(SourceKey) as Device;
|
||||
return _SourceDevice;
|
||||
}
|
||||
}
|
||||
Device _SourceDevice;
|
||||
|
||||
/// <summary>
|
||||
/// Gets either the source's Name or this AlternateName property, if
|
||||
/// defined. If source doesn't exist, returns "Missing source"
|
||||
/// </summary>
|
||||
public string PreferredName
|
||||
{
|
||||
get
|
||||
{
|
||||
if (string.IsNullOrEmpty(Name))
|
||||
{
|
||||
if (SourceDevice == null)
|
||||
return "---";
|
||||
return SourceDevice.Name;
|
||||
}
|
||||
return Name;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A name that will override the source's name on the UI
|
||||
/// </summary>
|
||||
public string Name { get; set; }
|
||||
public string Icon { get; set; }
|
||||
public string AltIcon { get; set; }
|
||||
public bool IncludeInSourceList { get; set; }
|
||||
public int Order { get; set; }
|
||||
public string VolumeControlKey { get; set; }
|
||||
public eSourceListItemType Type { get; set; }
|
||||
public List<SourceRouteListItem> RouteList { get; set; }
|
||||
|
||||
public SourceListItem()
|
||||
{
|
||||
Icon = "Blank";
|
||||
}
|
||||
}
|
||||
|
||||
public class SourceRouteListItem
|
||||
{
|
||||
[JsonProperty("sourceKey")]
|
||||
public string SourceKey { get; set; }
|
||||
|
||||
[JsonProperty("destinationKey")]
|
||||
public string DestinationKey { get; set; }
|
||||
|
||||
[JsonProperty("type")]
|
||||
public eRoutingSignalType Type { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,105 +0,0 @@
|
||||
//using System;
|
||||
//using System.Collections.Generic;
|
||||
//using System.Linq;
|
||||
//using System.Text;
|
||||
//using Crestron.SimplSharp;
|
||||
//using Crestron.SimplSharpPro;
|
||||
|
||||
//namespace PepperDash.Essentials.Core
|
||||
//{
|
||||
// public abstract class IRDisplayBase : DisplayBase, IHasCueActionList
|
||||
// {
|
||||
// public IrOutputPortController IrPort { get; private set; }
|
||||
// /// <summary>
|
||||
// /// Default to 200ms
|
||||
// /// </summary>
|
||||
// public ushort IrPulseTime { get; set; }
|
||||
// bool _PowerIsOn;
|
||||
// bool _IsWarmingUp;
|
||||
// bool _IsCoolingDown;
|
||||
|
||||
// /// <summary>
|
||||
// /// FunctionList is pre-defined to have power commands.
|
||||
// /// </summary>
|
||||
// public IRDisplayBase(string key, string name, IROutputPort port, string irDriverFilepath)
|
||||
// : base(key, name)
|
||||
// {
|
||||
// IrPort = new IrOutputPortController("ir-" + key, port, irDriverFilepath);
|
||||
// IrPulseTime = 200;
|
||||
// WarmupTime = 7000;
|
||||
// CooldownTime = 10000;
|
||||
|
||||
// CueActionList = new List<CueActionPair>
|
||||
// {
|
||||
// new BoolCueActionPair(CommonBoolCue.Power, b=> PowerToggle()),
|
||||
// new BoolCueActionPair(CommonBoolCue.PowerOn, b=> PowerOn()),
|
||||
// new BoolCueActionPair(CommonBoolCue.PowerOff, b=> PowerOff()),
|
||||
// };
|
||||
// }
|
||||
|
||||
// public override void PowerOn()
|
||||
// {
|
||||
// if (!PowerIsOnFeedback.BoolValue && !_IsWarmingUp && !_IsCoolingDown)
|
||||
// {
|
||||
// _IsWarmingUp = true;
|
||||
// IsWarmingUpFeedback.FireUpdate();
|
||||
// // Fake power-up cycle
|
||||
// WarmupTimer = new CTimer(o =>
|
||||
// {
|
||||
// _IsWarmingUp = false;
|
||||
// _PowerIsOn = true;
|
||||
// IsWarmingUpFeedback.FireUpdate();
|
||||
// PowerIsOnFeedback.FireUpdate();
|
||||
// }, WarmupTime);
|
||||
// }
|
||||
// IrPort.Pulse(IROutputStandardCommands.IROut_POWER_ON, IrPulseTime);
|
||||
// }
|
||||
|
||||
// public override void PowerOff()
|
||||
// {
|
||||
// // If a display has unreliable-power off feedback, just override this and
|
||||
// // remove this check.
|
||||
// if (PowerIsOnFeedback.BoolValue && !_IsWarmingUp && !_IsCoolingDown)
|
||||
// {
|
||||
// _IsCoolingDown = true;
|
||||
// _PowerIsOn = false;
|
||||
// PowerIsOnFeedback.FireUpdate();
|
||||
// IsCoolingDownFeedback.FireUpdate();
|
||||
// // Fake cool-down cycle
|
||||
// CooldownTimer = new CTimer(o =>
|
||||
// {
|
||||
// _IsCoolingDown = false;
|
||||
// IsCoolingDownFeedback.FireUpdate();
|
||||
// }, CooldownTime);
|
||||
// }
|
||||
// IrPort.Pulse(IROutputStandardCommands.IROut_POWER_OFF, IrPulseTime);
|
||||
// }
|
||||
|
||||
// public override void PowerToggle()
|
||||
// {
|
||||
// // Not sure how to handle the feedback, but we should default to power off fb.
|
||||
// // Does this need to trigger feedback??
|
||||
// _PowerIsOn = false;
|
||||
// IrPort.Pulse(IROutputStandardCommands.IROut_POWER, IrPulseTime);
|
||||
// }
|
||||
|
||||
// #region IFunctionList Members
|
||||
|
||||
// public List<CueActionPair> CueActionList
|
||||
// {
|
||||
// get;
|
||||
// private set;
|
||||
// }
|
||||
|
||||
// #endregion
|
||||
|
||||
// protected override Func<bool> PowerIsOnOutputFunc { get { return () => _PowerIsOn; } }
|
||||
// protected override Func<bool> IsCoolingDownOutputFunc { get { return () => _IsCoolingDown; } }
|
||||
// protected override Func<bool> IsWarmingUpOutputFunc { get { return () => _IsWarmingUp; } }
|
||||
|
||||
// public override void ExecuteSwitch(object selector)
|
||||
// {
|
||||
// IrPort.Pulse((string)selector, IrPulseTime);
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
@@ -1,127 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro;
|
||||
using Crestron.SimplSharpPro.DM;
|
||||
using Crestron.SimplSharpPro.DM.Endpoints;
|
||||
using Crestron.SimplSharpPro.DM.Endpoints.Transmitters;
|
||||
|
||||
using PepperDash.Core;
|
||||
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public abstract class DisplayBase : Device, IHasFeedback, IRoutingSinkWithSwitching, IPower, IWarmingCooling, IUsageTracking
|
||||
{
|
||||
public BoolFeedback PowerIsOnFeedback { get; protected set; }
|
||||
public BoolFeedback IsCoolingDownFeedback { get; protected set; }
|
||||
public BoolFeedback IsWarmingUpFeedback { get; private set; }
|
||||
|
||||
public UsageTracking UsageTracker { get; set; }
|
||||
|
||||
public uint WarmupTime { get; set; }
|
||||
public uint CooldownTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Bool Func that will provide a value for the PowerIsOn Output. Must be implemented
|
||||
/// by concrete sub-classes
|
||||
/// </summary>
|
||||
abstract protected Func<bool> PowerIsOnFeedbackFunc { get; }
|
||||
abstract protected Func<bool> IsCoolingDownFeedbackFunc { get; }
|
||||
abstract protected Func<bool> IsWarmingUpFeedbackFunc { get; }
|
||||
|
||||
|
||||
protected CTimer WarmupTimer;
|
||||
protected CTimer CooldownTimer;
|
||||
|
||||
#region IRoutingInputs Members
|
||||
|
||||
public RoutingPortCollection<RoutingInputPort> InputPorts { get; private set; }
|
||||
|
||||
#endregion
|
||||
|
||||
public DisplayBase(string key, string name)
|
||||
: base(key, name)
|
||||
{
|
||||
PowerIsOnFeedback = new BoolFeedback(CommonBoolCue.PowerOnFeedback, PowerIsOnFeedbackFunc);
|
||||
IsCoolingDownFeedback = new BoolFeedback(CommonBoolCue.IsCoolingDown, IsCoolingDownFeedbackFunc);
|
||||
IsWarmingUpFeedback = new BoolFeedback(CommonBoolCue.IsWarmingUp, IsWarmingUpFeedbackFunc);
|
||||
|
||||
InputPorts = new RoutingPortCollection<RoutingInputPort>();
|
||||
|
||||
PowerIsOnFeedback.OutputChange += new EventHandler<EventArgs>(PowerIsOnFeedback_OutputChange);
|
||||
}
|
||||
|
||||
void PowerIsOnFeedback_OutputChange(object sender, EventArgs e)
|
||||
{
|
||||
if (UsageTracker != null)
|
||||
{
|
||||
if (PowerIsOnFeedback.BoolValue)
|
||||
UsageTracker.StartDeviceUsage();
|
||||
else
|
||||
UsageTracker.EndDeviceUsage();
|
||||
}
|
||||
}
|
||||
|
||||
public abstract void PowerOn();
|
||||
public abstract void PowerOff();
|
||||
public abstract void PowerToggle();
|
||||
|
||||
public virtual List<Feedback> Feedbacks
|
||||
{
|
||||
get
|
||||
{
|
||||
return new List<Feedback>
|
||||
{
|
||||
PowerIsOnFeedback,
|
||||
IsCoolingDownFeedback,
|
||||
IsWarmingUpFeedback
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public abstract void ExecuteSwitch(object selector);
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public abstract class TwoWayDisplayBase : DisplayBase
|
||||
{
|
||||
public StringFeedback CurrentInputFeedback { get; private set; }
|
||||
|
||||
abstract protected Func<string> CurrentInputFeedbackFunc { get; }
|
||||
|
||||
|
||||
public static MockDisplay DefaultDisplay
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_DefaultDisplay == null)
|
||||
_DefaultDisplay = new MockDisplay("default", "Default Display");
|
||||
return _DefaultDisplay;
|
||||
}
|
||||
}
|
||||
static MockDisplay _DefaultDisplay;
|
||||
|
||||
public TwoWayDisplayBase(string key, string name)
|
||||
: base(key, name)
|
||||
{
|
||||
CurrentInputFeedback = new StringFeedback(CurrentInputFeedbackFunc);
|
||||
|
||||
WarmupTime = 7000;
|
||||
CooldownTime = 15000;
|
||||
|
||||
Feedbacks.Add(CurrentInputFeedback);
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,235 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro;
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
public abstract class Feedback
|
||||
{
|
||||
public event EventHandler<EventArgs> OutputChange;
|
||||
|
||||
public virtual bool BoolValue { get { return false; } }
|
||||
public virtual int IntValue { get { return 0; } }
|
||||
public virtual string StringValue { get { return ""; } }
|
||||
|
||||
public Cue Cue { get; private set; }
|
||||
|
||||
public abstract eCueType Type { get; }
|
||||
|
||||
protected Feedback()
|
||||
{
|
||||
}
|
||||
|
||||
protected Feedback(Cue cue)
|
||||
{
|
||||
Cue = cue;
|
||||
}
|
||||
|
||||
public abstract void FireUpdate();
|
||||
|
||||
protected void OnOutputChange()
|
||||
{
|
||||
if (OutputChange != null) OutputChange(this, EventArgs.Empty);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A Feedback whose output is derived from the return value of a provided Func.
|
||||
/// </summary>
|
||||
public class BoolFeedback : Feedback
|
||||
{
|
||||
/// <summary>
|
||||
/// Returns the current value of the feedback, derived from the ValueFunc
|
||||
/// </summary>
|
||||
public override bool BoolValue { get { return _BoolValue; } }
|
||||
bool _BoolValue;
|
||||
|
||||
public override eCueType Type { get { return eCueType.Bool; } }
|
||||
|
||||
public Func<bool> ValueFunc { get; private set; }
|
||||
/// <summary>
|
||||
/// The last value delivered on FireUpdate
|
||||
/// </summary>
|
||||
//public bool PreviousValue { get; private set; }
|
||||
List<BoolInputSig> LinkedInputSigs = new List<BoolInputSig>();
|
||||
List<BoolInputSig> LinkedComplementInputSigs = new List<BoolInputSig>();
|
||||
|
||||
public BoolFeedback(Func<bool> valueFunc)
|
||||
: this(Cue.DefaultBoolCue, valueFunc)
|
||||
{
|
||||
}
|
||||
|
||||
public BoolFeedback(Cue cue, Func<bool> valueFunc)
|
||||
: base(cue)
|
||||
{
|
||||
if (cue == null) throw new ArgumentNullException("cue");
|
||||
ValueFunc = valueFunc;
|
||||
}
|
||||
|
||||
public override void FireUpdate()
|
||||
{
|
||||
var newValue = ValueFunc.Invoke();
|
||||
if (newValue != _BoolValue)
|
||||
{
|
||||
_BoolValue = newValue;
|
||||
LinkedInputSigs.ForEach(s => UpdateSig(s));
|
||||
LinkedComplementInputSigs.ForEach(s => UpdateComplementSig(s));
|
||||
OnOutputChange();
|
||||
}
|
||||
}
|
||||
|
||||
public void LinkInputSig(BoolInputSig sig)
|
||||
{
|
||||
LinkedInputSigs.Add(sig);
|
||||
UpdateSig(sig);
|
||||
}
|
||||
|
||||
public void UnlinkInputSig(BoolInputSig sig)
|
||||
{
|
||||
LinkedInputSigs.Remove(sig);
|
||||
}
|
||||
|
||||
public void LinkComplementInputSig(BoolInputSig sig)
|
||||
{
|
||||
LinkedComplementInputSigs.Add(sig);
|
||||
UpdateComplementSig(sig);
|
||||
}
|
||||
|
||||
public void UnlinkComplementInputSig(BoolInputSig sig)
|
||||
{
|
||||
LinkedComplementInputSigs.Remove(sig);
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return BoolValue.ToString();
|
||||
}
|
||||
|
||||
void UpdateSig(BoolInputSig sig)
|
||||
{
|
||||
sig.BoolValue = _BoolValue;
|
||||
}
|
||||
|
||||
void UpdateComplementSig(BoolInputSig sig)
|
||||
{
|
||||
sig.BoolValue = !_BoolValue;
|
||||
}
|
||||
}
|
||||
|
||||
//******************************************************************************
|
||||
public class IntFeedback : Feedback
|
||||
{
|
||||
public override int IntValue { get { return _IntValue; } } // ValueFunc.Invoke(); } }
|
||||
int _IntValue;
|
||||
public ushort UShortValue { get { return (ushort)_IntValue; } }
|
||||
public override eCueType Type { get { return eCueType.Int; } }
|
||||
//public int PreviousValue { get; private set; }
|
||||
|
||||
Func<int> ValueFunc;
|
||||
List<UShortInputSig> LinkedInputSigs = new List<UShortInputSig>();
|
||||
|
||||
public IntFeedback(Func<int> valueFunc)
|
||||
: this(Cue.DefaultIntCue, valueFunc)
|
||||
{
|
||||
}
|
||||
|
||||
public IntFeedback(Cue cue, Func<int> valueFunc)
|
||||
: base(cue)
|
||||
{
|
||||
if (cue == null) throw new ArgumentNullException("cue");
|
||||
ValueFunc = valueFunc;
|
||||
}
|
||||
|
||||
public override void FireUpdate()
|
||||
{
|
||||
var newValue = ValueFunc.Invoke();
|
||||
if (newValue != _IntValue)
|
||||
{
|
||||
_IntValue = newValue;
|
||||
LinkedInputSigs.ForEach(s => UpdateSig(s));
|
||||
OnOutputChange();
|
||||
}
|
||||
}
|
||||
|
||||
public void LinkInputSig(UShortInputSig sig)
|
||||
{
|
||||
LinkedInputSigs.Add(sig);
|
||||
UpdateSig(sig);
|
||||
}
|
||||
|
||||
public void UnlinkInputSig(UShortInputSig sig)
|
||||
{
|
||||
LinkedInputSigs.Remove(sig);
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return IntValue.ToString();
|
||||
}
|
||||
|
||||
void UpdateSig(UShortInputSig sig)
|
||||
{
|
||||
sig.UShortValue = UShortValue;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//******************************************************************************
|
||||
public class StringFeedback : Feedback
|
||||
{
|
||||
public override string StringValue { get { return _StringValue; } } // ValueFunc.Invoke(); } }
|
||||
string _StringValue;
|
||||
public override eCueType Type { get { return eCueType.String; } }
|
||||
//public string PreviousValue { get; private set; }
|
||||
public Func<string> ValueFunc { get; private set; }
|
||||
List<StringInputSig> LinkedInputSigs = new List<StringInputSig>();
|
||||
|
||||
public StringFeedback(Func<string> valueFunc)
|
||||
: this(Cue.DefaultStringCue, valueFunc)
|
||||
{
|
||||
}
|
||||
|
||||
public StringFeedback(Cue cue, Func<string> valueFunc)
|
||||
: base(cue)
|
||||
{
|
||||
if (cue == null) throw new ArgumentNullException("cue");
|
||||
ValueFunc = valueFunc;
|
||||
|
||||
}
|
||||
|
||||
public override void FireUpdate()
|
||||
{
|
||||
var newValue = ValueFunc.Invoke();
|
||||
if (newValue != _StringValue)
|
||||
{
|
||||
_StringValue = newValue;
|
||||
LinkedInputSigs.ForEach(s => UpdateSig(s));
|
||||
OnOutputChange();
|
||||
}
|
||||
}
|
||||
|
||||
public void LinkInputSig(StringInputSig sig)
|
||||
{
|
||||
LinkedInputSigs.Add(sig);
|
||||
UpdateSig(sig);
|
||||
}
|
||||
|
||||
public void UnlinkInputSig(StringInputSig sig)
|
||||
{
|
||||
LinkedInputSigs.Remove(sig);
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return StringValue;
|
||||
}
|
||||
|
||||
void UpdateSig(StringInputSig sig)
|
||||
{
|
||||
sig.StringValue = _StringValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,377 +0,0 @@
|
||||
//using System;
|
||||
//using System.Collections.Generic;
|
||||
//using System.Linq;
|
||||
//using System.Text;
|
||||
|
||||
//using Crestron.SimplSharp;
|
||||
//using Crestron.SimplSharpPro;
|
||||
//using Crestron.SimplSharpPro.DeviceSupport;
|
||||
|
||||
//using Crestron.SimplSharpPro.Fusion;
|
||||
//using PepperDash.Essentials.Core;
|
||||
|
||||
//using PepperDash.Core;
|
||||
|
||||
|
||||
//namespace PepperDash.Essentials.Core.Fusion
|
||||
//{
|
||||
// public class EssentialsHuddleSpaceFusionSystemController : Device
|
||||
// {
|
||||
// FusionRoom FusionRoom;
|
||||
// Room Room;
|
||||
// Dictionary<IPresentationSource, BoolInputSig> SourceToFeedbackSigs = new Dictionary<IPresentationSource, BoolInputSig>();
|
||||
|
||||
// StatusMonitorCollection ErrorMessageRollUp;
|
||||
|
||||
// public EssentialsHuddleSpaceFusionSystemController(HuddleSpaceRoom room, uint ipId)
|
||||
// : base(room.Key + "-fusion")
|
||||
// {
|
||||
// Room = room;
|
||||
|
||||
// FusionRoom = new FusionRoom(ipId, Global.ControlSystem, room.Name, "awesomeGuid-" + room.Key);
|
||||
// FusionRoom.Register();
|
||||
|
||||
// FusionRoom.FusionStateChange += new FusionStateEventHandler(FusionRoom_FusionStateChange);
|
||||
|
||||
// // Room to fusion room
|
||||
// room.RoomIsOn.LinkInputSig(FusionRoom.SystemPowerOn.InputSig);
|
||||
// var srcName = FusionRoom.CreateOffsetStringSig(50, "Source - Name", eSigIoMask.InputSigOnly);
|
||||
// room.CurrentSourceName.LinkInputSig(srcName.InputSig);
|
||||
|
||||
// FusionRoom.SystemPowerOn.OutputSig.UserObject = new Action<bool>(b => { if (b) room.RoomOn(null); });
|
||||
// FusionRoom.SystemPowerOff.OutputSig.UserObject = new Action<bool>(b => { if (b) room.RoomOff(); });
|
||||
// // NO!! room.RoomIsOn.LinkComplementInputSig(FusionRoom.SystemPowerOff.InputSig);
|
||||
// FusionRoom.ErrorMessage.InputSig.StringValue = "3: 7 Errors: This is a really long error message;This is a really long error message;This is a really long error message;This is a really long error message;This is a really long error message;This is a really long error message;This is a really long error message;";
|
||||
|
||||
// // Sources
|
||||
// foreach (var src in room.Sources)
|
||||
// {
|
||||
// var srcNum = src.Key;
|
||||
// var pSrc = src.Value as IPresentationSource;
|
||||
// var keyNum = ExtractNumberFromKey(pSrc.Key);
|
||||
// if (keyNum == -1)
|
||||
// {
|
||||
// Debug.Console(1, this, "WARNING: Cannot link source '{0}' to numbered Fusion attributes", pSrc.Key);
|
||||
// continue;
|
||||
// }
|
||||
// string attrName = null;
|
||||
// uint attrNum = Convert.ToUInt32(keyNum);
|
||||
// switch (pSrc.Type)
|
||||
// {
|
||||
// case PresentationSourceType.None:
|
||||
// break;
|
||||
// case PresentationSourceType.SetTopBox:
|
||||
// attrName = "Source - TV " + keyNum;
|
||||
// attrNum += 115; // TV starts at 116
|
||||
// break;
|
||||
// case PresentationSourceType.Dvd:
|
||||
// attrName = "Source - DVD " + keyNum;
|
||||
// attrNum += 120; // DVD starts at 121
|
||||
// break;
|
||||
// case PresentationSourceType.PC:
|
||||
// attrName = "Source - PC " + keyNum;
|
||||
// attrNum += 110; // PC starts at 111
|
||||
// break;
|
||||
// case PresentationSourceType.Laptop:
|
||||
// attrName = "Source - Laptop " + keyNum;
|
||||
// attrNum += 100; // Laptops start at 101
|
||||
// break;
|
||||
// case PresentationSourceType.VCR:
|
||||
// attrName = "Source - VCR " + keyNum;
|
||||
// attrNum += 125; // VCRs start at 126
|
||||
// break;
|
||||
// }
|
||||
// if (attrName == null)
|
||||
// {
|
||||
// Debug.Console(1, this, "Source type {0} does not have corresponsing Fusion attribute type, skipping", pSrc.Type);
|
||||
// continue;
|
||||
// }
|
||||
// Debug.Console(2, this, "Creating attribute '{0}' with join {1} for source {2}", attrName, attrNum, pSrc.Key);
|
||||
// var sigD = FusionRoom.CreateOffsetBoolSig(attrNum, attrName, eSigIoMask.InputOutputSig);
|
||||
// // Need feedback when this source is selected
|
||||
// // Event handler, added below, will compare source changes with this sig dict
|
||||
// SourceToFeedbackSigs.Add(pSrc, sigD.InputSig);
|
||||
|
||||
// // And respond to selection in Fusion
|
||||
// sigD.OutputSig.UserObject = new Action<bool>(b => { if(b) room.SelectSource(pSrc); });
|
||||
// }
|
||||
|
||||
// // Attach to all room's devices with monitors.
|
||||
// //foreach (var dev in DeviceManager.Devices)
|
||||
// foreach (var dev in DeviceManager.GetDevices())
|
||||
// {
|
||||
// if (!(dev is ICommunicationMonitor))
|
||||
// continue;
|
||||
|
||||
// var keyNum = ExtractNumberFromKey(dev.Key);
|
||||
// if (keyNum == -1)
|
||||
// {
|
||||
// Debug.Console(1, this, "WARNING: Cannot link device '{0}' to numbered Fusion monitoring attributes", dev.Key);
|
||||
// continue;
|
||||
// }
|
||||
// string attrName = null;
|
||||
// uint attrNum = Convert.ToUInt32(keyNum);
|
||||
|
||||
// //if (dev is SmartGraphicsTouchpanelControllerBase)
|
||||
// //{
|
||||
// // if (attrNum > 10)
|
||||
// // continue;
|
||||
// // attrName = "Device Ok - Touch Panel " + attrNum;
|
||||
// // attrNum += 200;
|
||||
// //}
|
||||
// //// add xpanel here
|
||||
|
||||
// //else
|
||||
// if (dev is DisplayBase)
|
||||
// {
|
||||
// if (attrNum > 10)
|
||||
// continue;
|
||||
// attrName = "Device Ok - Display " + attrNum;
|
||||
// attrNum += 240;
|
||||
// }
|
||||
// //else if (dev is DvdDeviceBase)
|
||||
// //{
|
||||
// // if (attrNum > 5)
|
||||
// // continue;
|
||||
// // attrName = "Device Ok - DVD " + attrNum;
|
||||
// // attrNum += 260;
|
||||
// //}
|
||||
// // add set top box
|
||||
|
||||
// // add Cresnet roll-up
|
||||
|
||||
// // add DM-devices roll-up
|
||||
|
||||
// if (attrName != null)
|
||||
// {
|
||||
// // Link comm status to sig and update
|
||||
// var sigD = FusionRoom.CreateOffsetBoolSig(attrNum, attrName, eSigIoMask.InputSigOnly);
|
||||
// var smd = dev as ICommunicationMonitor;
|
||||
// sigD.InputSig.BoolValue = smd.CommunicationMonitor.Status == MonitorStatus.IsOk;
|
||||
// smd.CommunicationMonitor.StatusChange += (o, a) => { sigD.InputSig.BoolValue = a.Status == MonitorStatus.IsOk; };
|
||||
// Debug.Console(0, this, "Linking '{0}' communication monitor to Fusion '{1}'", dev.Key, attrName);
|
||||
// }
|
||||
// }
|
||||
|
||||
// // Don't think we need to get current status of this as nothing should be alive yet.
|
||||
// room.PresentationSourceChange += Room_PresentationSourceChange;
|
||||
|
||||
// // these get used in multiple places
|
||||
// var display = room.Display;
|
||||
// var dispPowerOnAction = new Action<bool>(b => { if (!b) display.PowerOn(); });
|
||||
// var dispPowerOffAction = new Action<bool>(b => { if (!b) display.PowerOff(); });
|
||||
|
||||
// // Display to fusion room sigs
|
||||
// FusionRoom.DisplayPowerOn.OutputSig.UserObject = dispPowerOnAction;
|
||||
// FusionRoom.DisplayPowerOff.OutputSig.UserObject = dispPowerOffAction;
|
||||
// display.PowerIsOnFeedback.LinkInputSig(FusionRoom.DisplayPowerOn.InputSig);
|
||||
// if (display is IDisplayUsage)
|
||||
// (display as IDisplayUsage).LampHours.LinkInputSig(FusionRoom.DisplayUsage.InputSig);
|
||||
|
||||
// // Roll up ALL device errors
|
||||
// ErrorMessageRollUp = new StatusMonitorCollection(this);
|
||||
// foreach (var dev in DeviceManager.GetDevices())
|
||||
// {
|
||||
// var md = dev as ICommunicationMonitor;
|
||||
// if (md != null)
|
||||
// {
|
||||
// ErrorMessageRollUp.AddMonitor(md.CommunicationMonitor);
|
||||
// Debug.Console(2, this, "Adding '{0}' to room's overall error monitor", md.CommunicationMonitor.Parent.Key);
|
||||
// }
|
||||
// }
|
||||
// ErrorMessageRollUp.Start();
|
||||
// FusionRoom.ErrorMessage.InputSig.StringValue = ErrorMessageRollUp.Message;
|
||||
// ErrorMessageRollUp.StatusChange += (o, a) => {
|
||||
// FusionRoom.ErrorMessage.InputSig.StringValue = ErrorMessageRollUp.Message; };
|
||||
|
||||
|
||||
// // static assets --------------- testing
|
||||
|
||||
// // test assets --- THESE ARE BOTH WIRED TO AssetUsage somewhere internally.
|
||||
// var ta1 = FusionRoom.CreateStaticAsset(1, "Test asset 1", "Awesome Asset", "Awesome123");
|
||||
// ta1.AssetError.InputSig.StringValue = "This should be error";
|
||||
|
||||
|
||||
// var ta2 = FusionRoom.CreateStaticAsset(2, "Test asset 2", "Awesome Asset", "Awesome1232");
|
||||
// ta2.AssetUsage.InputSig.StringValue = "This should be usage";
|
||||
|
||||
|
||||
// // Make a display asset
|
||||
// var dispAsset = FusionRoom.CreateStaticAsset(3, display.Name, "Display", "awesomeDisplayId" + room.Key);
|
||||
// dispAsset.PowerOn.OutputSig.UserObject = dispPowerOnAction;
|
||||
// dispAsset.PowerOff.OutputSig.UserObject = dispPowerOffAction;
|
||||
// display.PowerIsOnFeedback.LinkInputSig(dispAsset.PowerOn.InputSig);
|
||||
// // NO!! display.PowerIsOn.LinkComplementInputSig(dispAsset.PowerOff.InputSig);
|
||||
// // Use extension methods
|
||||
// dispAsset.TrySetMakeModel(display);
|
||||
// dispAsset.TryLinkAssetErrorToCommunication(display);
|
||||
|
||||
|
||||
// // Make it so!
|
||||
// FusionRVI.GenerateFileForAllFusionDevices();
|
||||
// }
|
||||
|
||||
// /// <summary>
|
||||
// /// Helper to get the number from the end of a device's key string
|
||||
// /// </summary>
|
||||
// /// <returns>-1 if no number matched</returns>
|
||||
// int ExtractNumberFromKey(string key)
|
||||
// {
|
||||
// var capture = System.Text.RegularExpressions.Regex.Match(key, @"\D+(\d+)");
|
||||
// if (!capture.Success)
|
||||
// return -1;
|
||||
// else return Convert.ToInt32(capture.Groups[1].Value);
|
||||
// }
|
||||
|
||||
// void Room_PresentationSourceChange(object sender, EssentialsRoomSourceChangeEventArgs e)
|
||||
// {
|
||||
// if (e.OldSource != null)
|
||||
// {
|
||||
// if (SourceToFeedbackSigs.ContainsKey(e.OldSource))
|
||||
// SourceToFeedbackSigs[e.OldSource].BoolValue = false;
|
||||
// }
|
||||
// if (e.NewSource != null)
|
||||
// {
|
||||
// if (SourceToFeedbackSigs.ContainsKey(e.NewSource))
|
||||
// SourceToFeedbackSigs[e.NewSource].BoolValue = true;
|
||||
// }
|
||||
// }
|
||||
|
||||
// void FusionRoom_FusionStateChange(FusionBase device, FusionStateEventArgs args)
|
||||
// {
|
||||
|
||||
// // The sig/UO method: Need separate handlers for fixed and user sigs, all flavors,
|
||||
// // even though they all contain sigs.
|
||||
|
||||
// var sigData = (args.UserConfiguredSigDetail as BooleanSigDataFixedName);
|
||||
// if (sigData != null)
|
||||
// {
|
||||
// var outSig = sigData.OutputSig;
|
||||
// if (outSig.UserObject is Action<bool>)
|
||||
// (outSig.UserObject as Action<bool>).Invoke(outSig.BoolValue);
|
||||
// else if (outSig.UserObject is Action<ushort>)
|
||||
// (outSig.UserObject as Action<ushort>).Invoke(outSig.UShortValue);
|
||||
// else if (outSig.UserObject is Action<string>)
|
||||
// (outSig.UserObject as Action<string>).Invoke(outSig.StringValue);
|
||||
// return;
|
||||
// }
|
||||
|
||||
// var attrData = (args.UserConfiguredSigDetail as BooleanSigData);
|
||||
// if (attrData != null)
|
||||
// {
|
||||
// var outSig = attrData.OutputSig;
|
||||
// if (outSig.UserObject is Action<bool>)
|
||||
// (outSig.UserObject as Action<bool>).Invoke(outSig.BoolValue);
|
||||
// else if (outSig.UserObject is Action<ushort>)
|
||||
// (outSig.UserObject as Action<ushort>).Invoke(outSig.UShortValue);
|
||||
// else if (outSig.UserObject is Action<string>)
|
||||
// (outSig.UserObject as Action<string>).Invoke(outSig.StringValue);
|
||||
// return;
|
||||
// }
|
||||
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
// public static class FusionRoomExtensions
|
||||
// {
|
||||
// /// <summary>
|
||||
// /// Creates and returns a fusion attribute. The join number will match the established Simpl
|
||||
// /// standard of 50+, and will generate a 50+ join in the RVI. It calls
|
||||
// /// FusionRoom.AddSig with join number - 49
|
||||
// /// </summary>
|
||||
// /// <returns>The new attribute</returns>
|
||||
// public static BooleanSigData CreateOffsetBoolSig(this FusionRoom fr, uint number, string name, eSigIoMask mask)
|
||||
// {
|
||||
// if (number < 50) throw new ArgumentOutOfRangeException("number", "Cannot be less than 50");
|
||||
// number -= 49;
|
||||
// fr.AddSig(eSigType.Bool, number, name, mask);
|
||||
// return fr.UserDefinedBooleanSigDetails[number];
|
||||
// }
|
||||
|
||||
// /// <summary>
|
||||
// /// Creates and returns a fusion attribute. The join number will match the established Simpl
|
||||
// /// standard of 50+, and will generate a 50+ join in the RVI. It calls
|
||||
// /// FusionRoom.AddSig with join number - 49
|
||||
// /// </summary>
|
||||
// /// <returns>The new attribute</returns>
|
||||
// public static UShortSigData CreateOffsetUshortSig(this FusionRoom fr, uint number, string name, eSigIoMask mask)
|
||||
// {
|
||||
// if (number < 50) throw new ArgumentOutOfRangeException("number", "Cannot be less than 50");
|
||||
// number -= 49;
|
||||
// fr.AddSig(eSigType.UShort, number, name, mask);
|
||||
// return fr.UserDefinedUShortSigDetails[number];
|
||||
// }
|
||||
|
||||
// /// <summary>
|
||||
// /// Creates and returns a fusion attribute. The join number will match the established Simpl
|
||||
// /// standard of 50+, and will generate a 50+ join in the RVI. It calls
|
||||
// /// FusionRoom.AddSig with join number - 49
|
||||
// /// </summary>
|
||||
// /// <returns>The new attribute</returns>
|
||||
// public static StringSigData CreateOffsetStringSig(this FusionRoom fr, uint number, string name, eSigIoMask mask)
|
||||
// {
|
||||
// if (number < 50) throw new ArgumentOutOfRangeException("number", "Cannot be less than 50");
|
||||
// number -= 49;
|
||||
// fr.AddSig(eSigType.String, number, name, mask);
|
||||
// return fr.UserDefinedStringSigDetails[number];
|
||||
// }
|
||||
|
||||
// /// <summary>
|
||||
// /// Creates and returns a static asset
|
||||
// /// </summary>
|
||||
// /// <returns>the new asset</returns>
|
||||
// public static FusionStaticAsset CreateStaticAsset(this FusionRoom fr, uint number, string name, string type, string instanceId)
|
||||
// {
|
||||
// fr.AddAsset(eAssetType.StaticAsset, number, name, type, instanceId);
|
||||
// return fr.UserConfigurableAssetDetails[number].Asset as FusionStaticAsset;
|
||||
// }
|
||||
// }
|
||||
|
||||
// //************************************************************************************************
|
||||
// /// <summary>
|
||||
// /// Extensions to enhance Fusion room, asset and signal creation.
|
||||
// /// </summary>
|
||||
// public static class FusionStaticAssetExtensions
|
||||
// {
|
||||
// /// <summary>
|
||||
// /// Tries to set a Fusion asset with the make and model of a device.
|
||||
// /// If the provided Device is IMakeModel, will set the corresponding parameters on the fusion static asset.
|
||||
// /// Otherwise, does nothing.
|
||||
// /// </summary>
|
||||
// public static void TrySetMakeModel(this FusionStaticAsset asset, Device device)
|
||||
// {
|
||||
// var mm = device as IMakeModel;
|
||||
// if (mm != null)
|
||||
// {
|
||||
// asset.ParamMake.Value = mm.DeviceMake;
|
||||
// asset.ParamModel.Value = mm.DeviceModel;
|
||||
// }
|
||||
// }
|
||||
|
||||
// /// <summary>
|
||||
// /// Tries to attach the AssetError input on a Fusion asset to a Device's
|
||||
// /// CommunicationMonitor.StatusChange event. Does nothing if the device is not
|
||||
// /// IStatusMonitor
|
||||
// /// </summary>
|
||||
// /// <param name="asset"></param>
|
||||
// /// <param name="device"></param>
|
||||
// public static void TryLinkAssetErrorToCommunication(this FusionStaticAsset asset, Device device)
|
||||
// {
|
||||
// if (device is ICommunicationMonitor)
|
||||
// {
|
||||
// var monitor = (device as ICommunicationMonitor).CommunicationMonitor;
|
||||
// monitor.StatusChange += (o, a) =>
|
||||
// {
|
||||
// // Link connected and error inputs on asset
|
||||
// asset.Connected.InputSig.BoolValue = a.Status == MonitorStatus.IsOk;
|
||||
// asset.AssetError.InputSig.StringValue = a.Status.ToString();
|
||||
// };
|
||||
// // set current value
|
||||
// asset.Connected.InputSig.BoolValue = monitor.Status == MonitorStatus.IsOk;
|
||||
// asset.AssetError.InputSig.StringValue = monitor.Status.ToString();
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
//}
|
||||
@@ -1,42 +0,0 @@
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharp.CrestronDataStore;
|
||||
using Crestron.SimplSharpPro;
|
||||
|
||||
//using PepperDash.Essentials.Core.Http;
|
||||
using PepperDash.Essentials.License;
|
||||
|
||||
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
public static class Global
|
||||
{
|
||||
public static CrestronControlSystem ControlSystem { get; set; }
|
||||
|
||||
public static LicenseManager LicenseManager { get; set; }
|
||||
|
||||
//public static EssentialsHttpServer HttpConfigServer
|
||||
//{
|
||||
// get
|
||||
// {
|
||||
// if (_HttpConfigServer == null)
|
||||
// _HttpConfigServer = new EssentialsHttpServer();
|
||||
// return _HttpConfigServer;
|
||||
// }
|
||||
//}
|
||||
//static EssentialsHttpServer _HttpConfigServer;
|
||||
|
||||
|
||||
static Global()
|
||||
{
|
||||
// Fire up CrestronDataStoreStatic
|
||||
var err = CrestronDataStoreStatic.InitCrestronDataStore();
|
||||
if (err != CrestronDataStore.CDS_ERROR.CDS_SUCCESS)
|
||||
{
|
||||
CrestronConsole.PrintLine("Error starting CrestronDataStoreStatic: {0}", err);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,234 +0,0 @@
|
||||
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Release</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>9.0.30729</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>PepperDash.Essentials.Core</RootNamespace>
|
||||
<AssemblyName>PepperDash_Essentials_Core</AssemblyName>
|
||||
<ProjectTypeGuids>{0B4745B0-194B-4BB6-8E21-E9057CA92300};{4D628B5B-2FBC-4AA6-8C16-197242AEB884};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<PlatformFamilyName>WindowsCE</PlatformFamilyName>
|
||||
<PlatformID>E2BECB1F-8C8C-41ba-B736-9BE7D946A398</PlatformID>
|
||||
<OSVersion>5.0</OSVersion>
|
||||
<DeployDirSuffix>SmartDeviceProject1</DeployDirSuffix>
|
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||
<NativePlatformName>Windows CE</NativePlatformName>
|
||||
<FormFactorID>
|
||||
</FormFactorID>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<AllowedReferenceRelatedFileExtensions>.allowedReferenceRelatedFileExtensions</AllowedReferenceRelatedFileExtensions>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>..\..\Release Package\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE;</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<NoStdLib>true</NoStdLib>
|
||||
<NoConfig>true</NoConfig>
|
||||
<GenerateSerializationAssemblies>off</GenerateSerializationAssemblies>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<AllowedReferenceRelatedFileExtensions>.allowedReferenceRelatedFileExtensions</AllowedReferenceRelatedFileExtensions>
|
||||
<DebugType>none</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\</OutputPath>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<NoStdLib>true</NoStdLib>
|
||||
<NoConfig>true</NoConfig>
|
||||
<GenerateSerializationAssemblies>off</GenerateSerializationAssemblies>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Crestron.SimplSharpPro.DeviceSupport, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.DeviceSupport.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Crestron.SimplSharpPro.DM, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.DM.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Crestron.SimplSharpPro.EthernetCommunications, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.EthernetCommunications.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Crestron.SimplSharpPro.Fusion, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.Fusion.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Crestron.SimplSharpPro.Remotes, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.Remotes.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Crestron.SimplSharpPro.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.UI.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="mscorlib" />
|
||||
<Reference Include="PepperDash_Core, Version=1.0.1.26313, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\PepperDash.Core\Pepperdash Core\Pepperdash Core\bin\PepperDash_Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="SimplSharpCustomAttributesInterface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpCustomAttributesInterface.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="SimplSharpHelperInterface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpHelperInterface.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="SimplSharpNewtonsoft, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpNewtonsoft.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="SimplSharpPro, Version=1.5.0.7, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpPro.exe</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="SimplSharpReflectionInterface, Version=1.0.5583.25238, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpReflectionInterface.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Data" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Crestron IO\Inputs\GenericVersiportInputDevice.cs" />
|
||||
<Compile Include="Crestron IO\Inputs\IDigitalInput.cs" />
|
||||
<Compile Include="Crestron IO\Relay\GenericRelayDevice.cs" />
|
||||
<Compile Include="Devices\CodecInterfaces.cs" />
|
||||
<Compile Include="Global\JobTimer.cs" />
|
||||
<Compile Include="Ramps and Increments\ActionIncrementer.cs" />
|
||||
<Compile Include="Comm and IR\CommFactory.cs" />
|
||||
<Compile Include="Comm and IR\CommunicationExtras.cs" />
|
||||
<Compile Include="Comm and IR\REMOVE ComPortConfig.cs" />
|
||||
<Compile Include="Comm and IR\ComSpecJsonConverter.cs" />
|
||||
<Compile Include="Comm and IR\ConsoleCommMockDevice.cs" />
|
||||
<Compile Include="Comm and IR\IRPortHelper.cs" />
|
||||
<Compile Include="Config\BasicConfig.cs" />
|
||||
<Compile Include="Config\ConfigPropertiesHelpers.cs" />
|
||||
<Compile Include="Config\InfoConfig.cs" />
|
||||
<Compile Include="Config\DeviceConfig.cs" />
|
||||
<Compile Include="Constants\CommonCues.cs" />
|
||||
<Compile Include="Devices\DisplayUiConstants.cs" />
|
||||
<Compile Include="Devices\IUsageTracking.cs" />
|
||||
<Compile Include="Devices\DeviceJsonApi.cs" />
|
||||
<Compile Include="Devices\SourceListItem.cs" />
|
||||
<Compile Include="DeviceTypeInterfaces\IDisplayBasic.cs" />
|
||||
<Compile Include="DeviceTypeInterfaces\IDumbSource.cs" />
|
||||
<Compile Include="DeviceTypeInterfaces\IWarmingCooling.cs" />
|
||||
<Compile Include="DeviceTypeInterfaces\IDiscPlayerControls.cs" />
|
||||
<Compile Include="DeviceTypeInterfaces\IPower.cs" />
|
||||
<Compile Include="DeviceTypeInterfaces\IUiDisplayInfo.cs" />
|
||||
<Compile Include="DeviceTypeInterfaces\ISetTopBoxControls.cs" />
|
||||
<Compile Include="DeviceTypeInterfaces\IChannel.cs" />
|
||||
<Compile Include="DeviceTypeInterfaces\IColorFunctions.cs" />
|
||||
<Compile Include="DeviceTypeInterfaces\IDPad.cs" />
|
||||
<Compile Include="DeviceTypeInterfaces\IDvr.cs" />
|
||||
<Compile Include="DeviceTypeInterfaces\Template.cs" />
|
||||
<Compile Include="DeviceTypeInterfaces\ITransport.cs" />
|
||||
<Compile Include="Devices\GenericMonitoredTcpDevice.cs" />
|
||||
<Compile Include="DeviceTypeInterfaces\INumeric.cs" />
|
||||
<Compile Include="Devices\IVolumeAndAudioInterfaces.cs" />
|
||||
<Compile Include="Display\BasicIrDisplay.cs" />
|
||||
<Compile Include="Feedbacks\BoolFeedbackOneShot.cs" />
|
||||
<Compile Include="Ramps and Increments\NumericalHelpers.cs" />
|
||||
<Compile Include="Ramps and Increments\UshortSigIncrementer.cs" />
|
||||
<Compile Include="Routing\DummyRoutingInputsDevice.cs" />
|
||||
<Compile Include="Routing\ICardPortsDevice.cs" />
|
||||
<Compile Include="InUseTracking\IInUseTracking.cs" />
|
||||
<Compile Include="InUseTracking\InUseTracking.cs" />
|
||||
<Compile Include="Routing\IRoutingInputsExtensions.cs" />
|
||||
<Compile Include="Monitoring\StatusMonitorCollection.cs" />
|
||||
<Compile Include="Monitoring\CrestronGenericBaseCommunicationMonitor.cs" />
|
||||
<Compile Include="Monitoring\StatusMonitorBase.cs" />
|
||||
<Compile Include="Monitoring\Interfaces and things.cs" />
|
||||
<Compile Include="Monitoring\GenericCommunicationMonitor.cs" />
|
||||
<Compile Include="Devices\NewInterfaces.cs" />
|
||||
<Compile Include="Devices\IAttachVideoStatusExtensions.cs" />
|
||||
<Compile Include="Devices\IHasFeedbacks.cs" />
|
||||
<Compile Include="Devices\SmartObjectBaseTypes.cs" />
|
||||
<Compile Include="Devices\PresentationDeviceType.cs" />
|
||||
<Compile Include="Display\DELETE IRDisplayBase.cs" />
|
||||
<Compile Include="Display\MockDisplay.cs" />
|
||||
<Compile Include="Ethernet\EthernetStatistics.cs" />
|
||||
<Compile Include="Fusion\MOVED FusionSystemController.cs" />
|
||||
<Compile Include="Global\Global.cs" />
|
||||
<Compile Include="License\EssentialsLicenseManager.cs" />
|
||||
<Compile Include="Feedbacks\BoolOutputLogicals.cs" />
|
||||
<Compile Include="Presets\Interfaces.cs" />
|
||||
<Compile Include="Presets\PresetsListSubpageReferenceListItem.cs" />
|
||||
<Compile Include="Presets\DevicePresetsView.cs" />
|
||||
<Compile Include="Presets\PresetChannel.cs" />
|
||||
<Compile Include="Presets\DevicePresets.cs" />
|
||||
<Compile Include="Routing\RoutingInterfaces.cs" />
|
||||
<Compile Include="Routing\RoutingPort.cs" />
|
||||
<Compile Include="Routing\RoutingPortCollection.cs" />
|
||||
<Compile Include="Feedbacks\BoolFeedbackPulseExtender.cs" />
|
||||
<Compile Include="Routing\RoutingPortNames.cs" />
|
||||
<Compile Include="Routing\TieLineConfig.cs" />
|
||||
<Compile Include="SmartObjects\SmartObjectNumeric.cs" />
|
||||
<Compile Include="SmartObjects\SmartObjectDynamicList.cs" />
|
||||
<Compile Include="SmartObjects\SmartObjectDPad.cs" />
|
||||
<Compile Include="SmartObjects\SmartObjectHelper.cs" />
|
||||
<Compile Include="SmartObjects\SmartObjectHelperBase.cs" />
|
||||
<Compile Include="Routing\TieLine.cs" />
|
||||
<Compile Include="Timers\CountdownTimer.cs" />
|
||||
<Compile Include="Touchpanels\Keyboards\HabaneroKeyboardController.cs" />
|
||||
<Compile Include="Touchpanels\MOVED LargeTouchpanelControllerBase.cs" />
|
||||
<Compile Include="Touchpanels\TriListExtensions.cs" />
|
||||
<Compile Include="Touchpanels\MOVED UIControllers\DevicePageControllerBase.cs" />
|
||||
<Compile Include="UI PageManagers\BlurayPageManager.cs" />
|
||||
<Compile Include="UI PageManagers\SetTopBoxThreePanelPageManager.cs" />
|
||||
<Compile Include="UI PageManagers\SinglePageManager.cs" />
|
||||
<Compile Include="UI PageManagers\PageManager.cs" />
|
||||
<Compile Include="UI PageManagers\SetTopBoxTwoPanelPageManager.cs" />
|
||||
<Compile Include="VideoStatus\VideoStatusOutputs.cs" />
|
||||
<Compile Include="VideoStatus\VideoStatusCues.cs" />
|
||||
<Compile Include="Cues and DevAction\Cues.cs" />
|
||||
<Compile Include="Comm and IR\ComPortController.cs" />
|
||||
<Compile Include="Crestron\CrestronGenericBaseDevice.cs" />
|
||||
<Compile Include="Debug\Debug.cs" />
|
||||
<Compile Include="DeviceControlsParentInterfaces\IPresentationSource.cs" />
|
||||
<Compile Include="Devices\DeviceManager.cs" />
|
||||
<Compile Include="Devices\IrOutputPortController.cs" />
|
||||
<Compile Include="Display\DisplayBase.cs" />
|
||||
<Compile Include="Feedbacks\Feedbacks.cs" />
|
||||
<Compile Include="Room\Room.cs" />
|
||||
<Compile Include="Room\RoomCues.cs" />
|
||||
<Compile Include="Room\MOVED RoomEventArgs.cs" />
|
||||
<Compile Include="SmartObjects\SubpageReferencList\SourceListSubpageReferenceList.cs" />
|
||||
<Compile Include="Touchpanels\ModalDialog.cs" />
|
||||
<Compile Include="Touchpanels\SmartGraphicsTouchpanelControllerBase.cs" />
|
||||
<Compile Include="TriListBridges\HandlerBridge.cs" />
|
||||
<Compile Include="Devices\FIND HOMES Interfaces.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="SigHelper.cs" />
|
||||
<Compile Include="REMOVE SigId.cs" />
|
||||
<Compile Include="SmartObjects\SubpageReferencList\SubpageReferenceList.cs" />
|
||||
<Compile Include="SmartObjects\SubpageReferencList\SubpageReferenceListItem.cs" />
|
||||
<None Include="app.config" />
|
||||
<None Include="Properties\ControlSystem.cfg" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="bin\" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CompactFramework.CSharp.targets" />
|
||||
<ProjectExtensions>
|
||||
<VisualStudio>
|
||||
</VisualStudio>
|
||||
</ProjectExtensions>
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>rem S# Pro preparation will execute after these operations</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -1,8 +0,0 @@
|
||||
using System.Reflection;
|
||||
|
||||
[assembly: AssemblyTitle("PepperDashEssentialsBase")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("PepperDashEssentialsBase")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2015")]
|
||||
[assembly: AssemblyVersion("1.0.0.*")]
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
//using System;
|
||||
//using System.Collections.Generic;
|
||||
//using System.Linq;
|
||||
//using System.Text;
|
||||
//using Crestron.SimplSharpPro;
|
||||
|
||||
//namespace PepperDash.Essentials.Core
|
||||
//{
|
||||
// public class SigId
|
||||
// {
|
||||
// public uint Number { get; private set; }
|
||||
// public eSigType Type { get; private set; }
|
||||
|
||||
// public SigId(eSigType type, uint number)
|
||||
// {
|
||||
// Type = type;
|
||||
// Number = number;
|
||||
// }
|
||||
|
||||
// public override bool Equals(object id)
|
||||
// {
|
||||
// if (id is SigId)
|
||||
// {
|
||||
// var sigId = id as SigId;
|
||||
// return this.Number == sigId.Number && this.Type == sigId.Type;
|
||||
// }
|
||||
// else
|
||||
// return base.Equals(id);
|
||||
// }
|
||||
|
||||
// public override int GetHashCode()
|
||||
// {
|
||||
// return base.GetHashCode();
|
||||
// }
|
||||
// }
|
||||
|
||||
//}
|
||||
Binary file not shown.
@@ -1,16 +0,0 @@
|
||||
<ProgramInfo>
|
||||
<RequiredInfo>
|
||||
<FriendlyName>SSMonoIOLibrary</FriendlyName>
|
||||
<SystemName>SSMonoIOLibrary</SystemName>
|
||||
<EntryPoint>SSMonoIOLibrary</EntryPoint>
|
||||
<MinFirmwareVersion>1.007.0017</MinFirmwareVersion>
|
||||
<ProgramTool>SIMPL# Plugin</ProgramTool>
|
||||
<DesignToolId>5</DesignToolId>
|
||||
<ProgramToolId>5</ProgramToolId>
|
||||
<ArchiveName />
|
||||
</RequiredInfo>
|
||||
<OptionalInfo>
|
||||
<CompiledOn>4/6/2016 7:49:24 AM</CompiledOn>
|
||||
<CompilerRev>1.0.0.14081</CompilerRev>
|
||||
</OptionalInfo>
|
||||
</ProgramInfo>
|
||||
Binary file not shown.
@@ -1,18 +0,0 @@
|
||||
MainAssembly=SSMonoIOLibrary.dll:6c69af117dca3f74ebca99f7a0e3181c
|
||||
MainAssemblyMinFirmwareVersion=1.007.0017
|
||||
ü
|
||||
DependencySource=SimplSharpCustomAttributesInterface.dll:9c4b4d4c519b655af90016edca2d66b9
|
||||
DependencyPath=SSMonoIOLibrary.clz:SimplSharpCustomAttributesInterface.dll
|
||||
DependencyMainAssembly=SimplSharpCustomAttributesInterface.dll:9c4b4d4c519b655af90016edca2d66b9
|
||||
ü
|
||||
DependencySource=SimplSharpHelperInterface.dll:aed72eb0e19559a3f56708be76445dcd
|
||||
DependencyPath=SSMonoIOLibrary.clz:SimplSharpHelperInterface.dll
|
||||
DependencyMainAssembly=SimplSharpHelperInterface.dll:aed72eb0e19559a3f56708be76445dcd
|
||||
ü
|
||||
DependencySource=SimplSharpReflectionInterface.dll:e3ff8edbba84ccd7155b9984e67488b2
|
||||
DependencyPath=SSMonoIOLibrary.clz:SimplSharpReflectionInterface.dll
|
||||
DependencyMainAssembly=SimplSharpReflectionInterface.dll:e3ff8edbba84ccd7155b9984e67488b2
|
||||
ü
|
||||
DependencySource=SSharpCrestronExtensionsLibrary.dll:655a49edee523f150d1c03bcb5db87d0
|
||||
DependencyPath=SSMonoIOLibrary.clz:SSharpCrestronExtensionsLibrary.dll
|
||||
DependencyMainAssembly=SSharpCrestronExtensionsLibrary.dll:655a49edee523f150d1c03bcb5db87d0
|
||||
Binary file not shown.
@@ -1,16 +0,0 @@
|
||||
<ProgramInfo>
|
||||
<RequiredInfo>
|
||||
<FriendlyName>SSMonoProTaskLibrary</FriendlyName>
|
||||
<SystemName>SSMonoProTaskLibrary</SystemName>
|
||||
<EntryPoint>SSMonoProTaskLibrary</EntryPoint>
|
||||
<MinFirmwareVersion>1.009.0029</MinFirmwareVersion>
|
||||
<ProgramTool>SIMPL# Plugin</ProgramTool>
|
||||
<DesignToolId>5</DesignToolId>
|
||||
<ProgramToolId>5</ProgramToolId>
|
||||
<ArchiveName />
|
||||
</RequiredInfo>
|
||||
<OptionalInfo>
|
||||
<CompiledOn>4/6/2016 7:55:41 AM</CompiledOn>
|
||||
<CompilerRev>1.0.0.14269</CompilerRev>
|
||||
</OptionalInfo>
|
||||
</ProgramInfo>
|
||||
Binary file not shown.
Binary file not shown.
@@ -1,30 +0,0 @@
|
||||
MainAssembly=SSMonoProTaskLibrary.dll:5d3a301400516bd812bf1566c72ccbf2
|
||||
MainAssemblyMinFirmwareVersion=1.009.0029
|
||||
ü
|
||||
DependencySource=SimplSharpReflectionInterface.dll:e3ff8edbba84ccd7155b9984e67488b2
|
||||
DependencyPath=SSMonoProTaskLibrary.cplz:SimplSharpReflectionInterface.dll
|
||||
DependencyMainAssembly=SimplSharpReflectionInterface.dll:e3ff8edbba84ccd7155b9984e67488b2
|
||||
ü
|
||||
DependencySource=SSharpCrestronExtensionsLibrary.dll:776d0247d8d42164c46c7cc1dfadbd03
|
||||
DependencyPath=SSMonoProTaskLibrary.cplz:SSharpCrestronExtensionsLibrary.dll
|
||||
DependencyMainAssembly=SSharpCrestronExtensionsLibrary.dll:776d0247d8d42164c46c7cc1dfadbd03
|
||||
ü
|
||||
DependencySource=SSMonoConcurrentCollectionsLibrary.dll:b0afcd989b081899c9eb29f9e4c8b799
|
||||
DependencyPath=SSMonoProTaskLibrary.cplz:SSMonoConcurrentCollectionsLibrary.dll
|
||||
DependencyMainAssembly=SSMonoConcurrentCollectionsLibrary.dll:b0afcd989b081899c9eb29f9e4c8b799
|
||||
ü
|
||||
DependencySource=SSMonoProConcurrentCollectionsLibrary.dll:8b718ce29f938bbf9cb5b8fc2d89332f
|
||||
DependencyPath=SSMonoProTaskLibrary.cplz:SSMonoProConcurrentCollectionsLibrary.dll
|
||||
DependencyMainAssembly=SSMonoProConcurrentCollectionsLibrary.dll:8b718ce29f938bbf9cb5b8fc2d89332f
|
||||
ü
|
||||
DependencySource=SSMonoSupportLibrary.dll:59362515f2c1d61583b2e40793987917
|
||||
DependencyPath=SSMonoProTaskLibrary.cplz:SSMonoSupportLibrary.dll
|
||||
DependencyMainAssembly=SSMonoSupportLibrary.dll:59362515f2c1d61583b2e40793987917
|
||||
ü
|
||||
DependencySource=SSMonoThreadingLibrary.dll:ea2ae2e1d9c425236f39de9192591062
|
||||
DependencyPath=SSMonoProTaskLibrary.cplz:SSMonoThreadingLibrary.dll
|
||||
DependencyMainAssembly=SSMonoThreadingLibrary.dll:ea2ae2e1d9c425236f39de9192591062
|
||||
ü
|
||||
DependencySource=SSMonoTupleLibrary.dll:2a3b419fff4199838079879053fcb41d
|
||||
DependencyPath=SSMonoProTaskLibrary.cplz:SSMonoTupleLibrary.dll
|
||||
DependencyMainAssembly=SSMonoTupleLibrary.dll:2a3b419fff4199838079879053fcb41d
|
||||
Binary file not shown.
@@ -1,41 +0,0 @@
|
||||
//using System;
|
||||
//using System.Collections.Generic;
|
||||
//using System.Linq;
|
||||
//using System.Text;
|
||||
//using Crestron.SimplSharp;
|
||||
|
||||
//namespace PepperDash.Essentials.Core
|
||||
//{
|
||||
// public class EssentialsRoomSourceChangeEventArgs : EventArgs
|
||||
// {
|
||||
// public EssentialsRoom Room { get; private set; }
|
||||
// public IPresentationSource OldSource { get; private set; }
|
||||
// public IPresentationSource NewSource { get; private set; }
|
||||
|
||||
// public EssentialsRoomSourceChangeEventArgs(EssentialsRoom room,
|
||||
// IPresentationSource oldSource, IPresentationSource newSource)
|
||||
// {
|
||||
// Room = room;
|
||||
// OldSource = oldSource;
|
||||
// NewSource = newSource;
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
|
||||
// public class EssentialsRoomAudioDeviceChangeEventArgs : EventArgs
|
||||
// {
|
||||
// public EssentialsRoom Room { get; private set; }
|
||||
// public IBasicVolumeControls OldDevice { get; private set; }
|
||||
// public IBasicVolumeControls NewDevice { get; private set; }
|
||||
|
||||
// public EssentialsRoomAudioDeviceChangeEventArgs(EssentialsRoom room,
|
||||
// IBasicVolumeControls oldDevice, IBasicVolumeControls newDevice)
|
||||
// {
|
||||
// Room = room;
|
||||
// OldDevice = oldDevice;
|
||||
// NewDevice = newDevice;
|
||||
// }
|
||||
// }
|
||||
|
||||
//}
|
||||
@@ -1,61 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro;
|
||||
|
||||
using PepperDash.Essentials.Core;
|
||||
|
||||
namespace PepperDash.Essentials
|
||||
{
|
||||
public static class RoomCue
|
||||
{
|
||||
// Commands/
|
||||
//bools
|
||||
public static readonly Cue RoomOnToggle = Cue.BoolCue("RoomOnToggle", 2001);
|
||||
public static readonly Cue RoomOn = Cue.BoolCue("RoomOn", 2002);
|
||||
public static readonly Cue RoomOff = Cue.BoolCue("RoomOff", 2003);
|
||||
public static readonly Cue VolumeUp = Cue.BoolCue("VolumeUp", 2011);
|
||||
public static readonly Cue VolumeDown = Cue.BoolCue("VolumeDown", 2012);
|
||||
public static readonly Cue VolumeDefault = Cue.BoolCue("VolumeDefault", 2013);
|
||||
public static readonly Cue MuteToggle = Cue.BoolCue("MuteToggle", 2014);
|
||||
public static readonly Cue MuteOn = Cue.BoolCue("MuteOn", 2015);
|
||||
public static readonly Cue MuteOff = Cue.BoolCue("MuteOff", 2016);
|
||||
|
||||
//ushorts
|
||||
public static readonly Cue SelectSourceByNumber = Cue.UShortCue("SelectSourceByNumber", 2001);
|
||||
public static readonly Cue VolumeLevel = Cue.UShortCue("VolumeLevel", 2011);
|
||||
public static readonly Cue VolumeLevelPercent = Cue.UShortCue("VolumeLevelPercent", 2012);
|
||||
|
||||
//strings
|
||||
public static readonly Cue SelectSourceByKey = Cue.StringCue("SelectSourceByKey", 2001);
|
||||
|
||||
// Outputs
|
||||
//Bools
|
||||
public static readonly Cue RoomIsOn = Cue.BoolCue("RoomIsOn", 2002);
|
||||
public static readonly Cue RoomIsOnStandby = Cue.BoolCue("RoomIsOnStandby", 2003);
|
||||
public static readonly Cue RoomIsWarmingUp = Cue.BoolCue("RoomIsWarmingUp", 2004);
|
||||
public static readonly Cue RoomIsCoolingDown = Cue.BoolCue("RoomIsCoolingDown", 2005);
|
||||
public static readonly Cue RoomIsOccupied = Cue.BoolCue("RoomIsOccupied", 2006);
|
||||
|
||||
//Ushorts
|
||||
public static readonly Cue SourcesCount = Cue.UShortCue("SourcesCount", 2001);
|
||||
public static readonly Cue CurrentSourceNumber = Cue.UShortCue("CurrentSourceNumber", 2002);
|
||||
public static readonly Cue CurrentSourceType = Cue.UShortCue("CurrentSourceType", 2003);
|
||||
|
||||
//Strings
|
||||
public static readonly Cue CurrentSourceKey = Cue.StringCue("CurrentSourceKey", 2001);
|
||||
public static readonly Cue CurrentSourceName = Cue.StringCue("CurrentSourceName", 2002);
|
||||
|
||||
public static readonly Cue VolumeLevelText = Cue.StringCue("VolumeLevelText", 2012);
|
||||
|
||||
public static readonly Cue Key = Cue.StringCue("RoomKey", 2021);
|
||||
public static readonly Cue Name = Cue.StringCue("RoomName", 2022);
|
||||
public static readonly Cue Description = Cue.StringCue("Description", 2023);
|
||||
public static readonly Cue HelpMessage = Cue.StringCue("HelpMessage", 2024);
|
||||
|
||||
//Special
|
||||
public static readonly Cue Source = new Cue("Source", 0, eCueType.Other);
|
||||
}
|
||||
}
|
||||
@@ -1,300 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro;
|
||||
using Crestron.SimplSharpPro.DM;
|
||||
|
||||
using PepperDash.Core;
|
||||
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public static class IRoutingInputsExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets any existing route for a destination, clears it, and then
|
||||
/// </summary>
|
||||
public static void ReleaseAndMakeRoute(this IRoutingInputs destination, IRoutingOutputs source, eRoutingSignalType signalType)
|
||||
{
|
||||
var sw = new Stopwatch();
|
||||
sw.Start();
|
||||
|
||||
destination.ReleaseRoute();
|
||||
|
||||
if (source == null) return;
|
||||
var newRoute = destination.GetRouteToSource(source, signalType);
|
||||
if (newRoute == null) return;
|
||||
RouteDescriptorCollection.DefaultCollection.AddRouteDescriptor(newRoute);
|
||||
Debug.Console(2, destination, "Executing new route");
|
||||
newRoute.ExecuteRoutes();
|
||||
sw.Stop();
|
||||
Debug.Console(2, destination, "Route took {0} ms", sw.ElapsedMilliseconds);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Will release the existing route on the destination
|
||||
/// </summary>
|
||||
/// <param name="destination"></param>
|
||||
/// <param name="signalType"></param>
|
||||
public static void ReleaseRoute(this IRoutingInputs destination)
|
||||
{
|
||||
var current = RouteDescriptorCollection.DefaultCollection.RemoveRouteDescriptor(destination);
|
||||
if (current != null)
|
||||
{
|
||||
Debug.Console(2, destination, "Releasing current route: {0}", current.Source.Key);
|
||||
current.ReleaseRoutes();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="device"></param>
|
||||
/// <param name="targetSource"></param>
|
||||
/// <param name="signalType"></param>
|
||||
/// <returns></returns>
|
||||
public static RouteDescriptor GetRouteToSource(this IRoutingInputs destination, IRoutingOutputs source, eRoutingSignalType signalType)
|
||||
{
|
||||
var routeTable = new RouteDescriptor (source, destination, signalType);
|
||||
|
||||
Debug.Console(0, destination, "Attempting to build source route from {0}***", source.Key);
|
||||
if (!destination.GetRouteToSource(source, null, null, signalType, 0, routeTable))
|
||||
routeTable = null;
|
||||
|
||||
Debug.Console(0, destination, "Route{0} discovered ***", routeTable == null ? " NOT" : "");
|
||||
return routeTable;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The recursive part of this. Will stop on each device, search its inputs for the
|
||||
/// desired source and if not found, invoke this function for the each input port
|
||||
/// hoping to find the source.
|
||||
/// </summary>
|
||||
/// <param name="destination"></param>
|
||||
/// <param name="source"></param>
|
||||
/// <param name="onSuccessOutputPort"></param>
|
||||
/// <param name="alreadyCheckedDevices"></param>
|
||||
/// <param name="signalType"></param>
|
||||
/// <param name="cycle"></param>
|
||||
/// <param name="routeTable"></param>
|
||||
/// <returns>true if source is hit</returns>
|
||||
static bool GetRouteToSource(this IRoutingInputs destination, IRoutingOutputs source,
|
||||
RoutingOutputPort onSuccessOutputPort, List<IRoutingInputsOutputs> alreadyCheckedDevices,
|
||||
eRoutingSignalType signalType, int cycle, RouteDescriptor routeTable)
|
||||
{
|
||||
cycle++;
|
||||
Debug.Console(0, destination, "SelectInput-cycle {1}. Finding {2} route back to {0}", source.Key, cycle, signalType);
|
||||
var destDevInputTies = TieLineCollection.Default.Where(t =>
|
||||
t.DestinationPort.ParentDevice == destination && (t.Type == signalType || t.Type == eRoutingSignalType.AudioVideo));
|
||||
|
||||
// find a direct tie
|
||||
var directTie = destDevInputTies.FirstOrDefault(
|
||||
t => !(t.SourcePort.ParentDevice is IRoutingInputsOutputs)
|
||||
&& t.DestinationPort.ParentDevice == destination
|
||||
&& t.SourcePort.ParentDevice == source);
|
||||
RoutingInputPort inputPort = null;
|
||||
if (directTie != null) // Found a tie directly to the source
|
||||
{
|
||||
Debug.Console(0, destination, "Found direct tie to {0}**", source.Key);
|
||||
inputPort = directTie.DestinationPort;
|
||||
}
|
||||
else // no direct-connect. Walk back devices.
|
||||
{
|
||||
Debug.Console(0, destination, "is not directly connected to {0}. Walking down tie lines", source.Key);
|
||||
|
||||
// No direct tie? Run back out on the inputs' attached devices...
|
||||
// Only the ones that are routing devices
|
||||
var attachedMidpoints = destDevInputTies.Where(t => t.SourcePort.ParentDevice is IRoutingInputsOutputs);
|
||||
foreach (var inputTieToTry in attachedMidpoints)
|
||||
{
|
||||
Debug.Console(0, destination, "Trying to find route on {0}", inputTieToTry.SourcePort.ParentDevice.Key);
|
||||
var upstreamDeviceOutputPort = inputTieToTry.SourcePort;
|
||||
var upstreamRoutingDevice = upstreamDeviceOutputPort.ParentDevice as IRoutingInputsOutputs;
|
||||
// Check if this previous device has already been walked
|
||||
if (!(alreadyCheckedDevices != null && alreadyCheckedDevices.Contains(upstreamRoutingDevice)))
|
||||
{
|
||||
// haven't seen this device yet. Do it. Pass the output port to the next
|
||||
// level to enable switching on success
|
||||
var upstreamRoutingSuccess = upstreamRoutingDevice.GetRouteToSource(source, upstreamDeviceOutputPort,
|
||||
alreadyCheckedDevices, signalType, cycle, routeTable);
|
||||
if (upstreamRoutingSuccess)
|
||||
{
|
||||
Debug.Console(0, destination, "Upstream device route found");
|
||||
inputPort = inputTieToTry.DestinationPort;
|
||||
break; // Stop looping the inputs in this cycle
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// we have a route on corresponding inputPort. *** Do the route ***
|
||||
if (inputPort != null)
|
||||
{
|
||||
Debug.Console(0, destination, "adding route:");
|
||||
if (onSuccessOutputPort == null)
|
||||
{
|
||||
// it's a sink device
|
||||
routeTable.Routes.Add(new RouteSwitchDescriptor(inputPort));
|
||||
}
|
||||
else if (destination is IRouting)
|
||||
{
|
||||
routeTable.Routes.Add(new RouteSwitchDescriptor (onSuccessOutputPort, inputPort));
|
||||
}
|
||||
else // device is merely IRoutingInputOutputs
|
||||
Debug.Console(0, destination, " No routing. Passthrough device");
|
||||
Debug.Console(0, destination, "Exiting cycle {0}", cycle);
|
||||
return true;
|
||||
}
|
||||
|
||||
if(alreadyCheckedDevices == null)
|
||||
alreadyCheckedDevices = new List<IRoutingInputsOutputs>();
|
||||
alreadyCheckedDevices.Add(destination as IRoutingInputsOutputs);
|
||||
|
||||
Debug.Console(0, destination, "No route found to {0}", source.Key);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// MOVE MOVE MOVE MOVE MOVE MOVE MOVE MOVE MOVE MOVE MOVE MOVE MOVE MOVE MOVE MOVE MOVE MOVE MOVE MOVE MOVE
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A collection of routes - typically the global DefaultCollection is used
|
||||
/// </summary>
|
||||
public class RouteDescriptorCollection
|
||||
{
|
||||
public static RouteDescriptorCollection DefaultCollection
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_DefaultCollection == null)
|
||||
_DefaultCollection = new RouteDescriptorCollection();
|
||||
return _DefaultCollection;
|
||||
}
|
||||
}
|
||||
static RouteDescriptorCollection _DefaultCollection;
|
||||
|
||||
List<RouteDescriptor> RouteDescriptors = new List<RouteDescriptor>();
|
||||
|
||||
public void AddRouteDescriptor(RouteDescriptor descriptor)
|
||||
{
|
||||
if (RouteDescriptors.Any(t => t.Destination == descriptor.Destination))
|
||||
{
|
||||
Debug.Console(1, descriptor.Destination,
|
||||
"Route to [{0}] already exists in global routes table", descriptor.Source.Key);
|
||||
return;
|
||||
}
|
||||
RouteDescriptors.Add(descriptor);
|
||||
}
|
||||
|
||||
public RouteDescriptor GetRouteDescriptorForDestination(IRoutingInputs destination)
|
||||
{
|
||||
return RouteDescriptors.FirstOrDefault(rd => rd.Destination == destination);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the RouteDescriptor for a given destination and removes it from collection.
|
||||
/// Returns null if no route with the provided destination exists.
|
||||
/// </summary>
|
||||
public RouteDescriptor RemoveRouteDescriptor(IRoutingInputs destination)
|
||||
{
|
||||
var descr = GetRouteDescriptorForDestination(destination);
|
||||
if (descr != null)
|
||||
RouteDescriptors.Remove(descr);
|
||||
return descr;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents an collection of individual route steps between Source and Destination
|
||||
/// </summary>
|
||||
public class RouteDescriptor
|
||||
{
|
||||
public IRoutingInputs Destination { get; private set; }
|
||||
public IRoutingOutputs Source { get; private set; }
|
||||
public eRoutingSignalType SignalType { get; private set; }
|
||||
public List<RouteSwitchDescriptor> Routes { get; private set; }
|
||||
|
||||
|
||||
public RouteDescriptor(IRoutingOutputs source, IRoutingInputs destination, eRoutingSignalType signalType)
|
||||
{
|
||||
Destination = destination;
|
||||
Source = source;
|
||||
SignalType = signalType;
|
||||
Routes = new List<RouteSwitchDescriptor>();
|
||||
}
|
||||
|
||||
public void ExecuteRoutes()
|
||||
{
|
||||
foreach (var route in Routes)
|
||||
{
|
||||
Debug.Console(2, route.ToString());
|
||||
if (route.SwitchingDevice is IRoutingSinkWithSwitching)
|
||||
(route.SwitchingDevice as IRoutingSinkWithSwitching).ExecuteSwitch(route.InputPort.Selector);
|
||||
else if (route.SwitchingDevice is IRouting)
|
||||
{
|
||||
(route.SwitchingDevice as IRouting).ExecuteSwitch(route.InputPort.Selector, route.OutputPort.Selector, SignalType);
|
||||
route.OutputPort.InUseTracker.AddUser(Destination, "destination");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void ReleaseRoutes()
|
||||
{
|
||||
foreach (var route in Routes)
|
||||
{
|
||||
if (route.SwitchingDevice is IRouting)
|
||||
{
|
||||
// Pull the route from the port. Whatever is watching the output's in use tracker is
|
||||
// responsible for responding appropriately.
|
||||
route.OutputPort.InUseTracker.RemoveUser(Destination, "destination");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
var routesText = Routes.Select(r => r.ToString()).ToArray();
|
||||
return string.Format("Route table from {0} to {1}:\r{2}", Source.Key, Destination.Key, string.Join("\r", routesText));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents an individual link for a route
|
||||
/// </summary>
|
||||
public class RouteSwitchDescriptor
|
||||
{
|
||||
public IRoutingInputs SwitchingDevice { get { return InputPort.ParentDevice; } }
|
||||
public RoutingOutputPort OutputPort { get; set; }
|
||||
public RoutingInputPort InputPort { get; set; }
|
||||
|
||||
public RouteSwitchDescriptor(RoutingInputPort inputPort)
|
||||
{
|
||||
InputPort = inputPort;
|
||||
}
|
||||
|
||||
public RouteSwitchDescriptor(RoutingOutputPort outputPort, RoutingInputPort inputPort)
|
||||
{
|
||||
InputPort = inputPort;
|
||||
OutputPort = outputPort;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
if(OutputPort == null) // IRoutingSink
|
||||
return string.Format("{0} switches to input '{1}'", SwitchingDevice.Key, InputPort.Selector);
|
||||
|
||||
return string.Format("{0} switches output '{1}' to input '{2}'", SwitchingDevice.Key, OutputPort.Selector, InputPort.Selector);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro;
|
||||
using Crestron.SimplSharpPro.DM;
|
||||
|
||||
using PepperDash.Core;
|
||||
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
//*******************************************************************************************
|
||||
// Interfaces
|
||||
|
||||
public interface IRoutingInputs : IKeyed
|
||||
{
|
||||
RoutingPortCollection<RoutingInputPort> InputPorts { get; }
|
||||
}
|
||||
|
||||
public interface IRoutingOutputs : IKeyed
|
||||
{
|
||||
RoutingPortCollection<RoutingOutputPort> OutputPorts { get; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// For fixed-source endpoint devices
|
||||
/// </summary>
|
||||
public interface IRoutingSinkNoSwitching : IRoutingInputs
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public interface IRoutingSinkWithSwitching : IRoutingSinkNoSwitching
|
||||
{
|
||||
//void ClearRoute();
|
||||
void ExecuteSwitch(object inputSelector);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// For devices like RMCs, baluns, other devices with no switching.
|
||||
/// </summary>
|
||||
public interface IRoutingInputsOutputs : IRoutingInputs, IRoutingOutputs
|
||||
{
|
||||
}
|
||||
|
||||
public interface IRouting : IRoutingInputsOutputs
|
||||
{
|
||||
//void ClearRoute(object outputSelector);
|
||||
void ExecuteSwitch(object inputSelector, object outputSelector, eRoutingSignalType signalType);
|
||||
}
|
||||
|
||||
public interface IRoutingSource : IRoutingOutputs
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,144 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
using PepperDash.Core;
|
||||
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Base class for RoutingInput and Output ports
|
||||
/// </summary>
|
||||
public abstract class RoutingPort : IKeyed
|
||||
{
|
||||
public string Key { get; private set; }
|
||||
public eRoutingSignalType Type { get; private set; }
|
||||
public eRoutingPortConnectionType ConnectionType { get; private set; }
|
||||
public readonly object Selector;
|
||||
public bool IsInternal { get; private set; }
|
||||
|
||||
public RoutingPort(string key, eRoutingSignalType type, eRoutingPortConnectionType connType, object selector, bool isInternal)
|
||||
{
|
||||
Key = key;
|
||||
Type = type;
|
||||
ConnectionType = connType;
|
||||
Selector = selector;
|
||||
IsInternal = IsInternal;
|
||||
}
|
||||
}
|
||||
|
||||
public enum eRoutingSignalType
|
||||
{
|
||||
Audio,
|
||||
Video,
|
||||
AudioVideo
|
||||
}
|
||||
|
||||
public enum eRoutingPortConnectionType
|
||||
{
|
||||
None, BackplaneOnly, Hdmi, Rgb, Vga, LineAudio, DigitalAudio, Sdi, Composite, Component, DmCat, DmMmFiber, DmSmFiber
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Basic RoutingInput with no statuses.
|
||||
/// </summary>
|
||||
public class RoutingInputPort : RoutingPort
|
||||
{
|
||||
/// <summary>
|
||||
/// The IRoutingInputs object this lives on
|
||||
/// </summary>
|
||||
public IRoutingInputs ParentDevice { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Constructor for a basic RoutingInputPort
|
||||
/// </summary>
|
||||
/// <param name="selector">An object used to refer to this port in the IRouting device's ExecuteSwitch method.
|
||||
/// May be string, number, whatever</param>
|
||||
/// <param name="parent">The IRoutingInputs object this lives on</param>
|
||||
public RoutingInputPort(string key, eRoutingSignalType type, eRoutingPortConnectionType connType,
|
||||
object selector, IRoutingInputs parent)
|
||||
: this (key, type, connType, selector, parent, false)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Constructor for a virtual routing input port that lives inside a device. For example
|
||||
/// the ports that link a DM card to a DM matrix bus
|
||||
/// </summary>
|
||||
/// <param name="isInternal">true for internal ports</param>
|
||||
public RoutingInputPort(string key, eRoutingSignalType type, eRoutingPortConnectionType connType,
|
||||
object selector, IRoutingInputs parent, bool isInternal)
|
||||
: base(key, type, connType, selector, isInternal)
|
||||
{
|
||||
if (parent == null)
|
||||
throw new ArgumentNullException("parent");
|
||||
ParentDevice = parent;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A RoutingInputPort for devices like DM-TX and DM input cards.
|
||||
/// Will provide video statistics on connected signals
|
||||
/// </summary>
|
||||
public class RoutingInputPortWithVideoStatuses : RoutingInputPort
|
||||
{
|
||||
/// <summary>
|
||||
/// Video statuses attached to this port
|
||||
/// </summary>
|
||||
public VideoStatusOutputs VideoStatus { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Constructor
|
||||
/// </summary>
|
||||
/// <param name="selector">An object used to refer to this port in the IRouting device's ExecuteSwitch method.
|
||||
/// May be string, number, whatever</param>
|
||||
/// <param name="parent">The IRoutingInputs object this lives on</param>
|
||||
/// <param name="funcs">A VideoStatusFuncsWrapper used to assign the callback funcs that will get
|
||||
/// the values for the various stats</param>
|
||||
public RoutingInputPortWithVideoStatuses(string key,
|
||||
eRoutingSignalType type, eRoutingPortConnectionType connType, object selector,
|
||||
IRoutingInputs parent, VideoStatusFuncsWrapper funcs) :
|
||||
base(key, type, connType, selector, parent)
|
||||
{
|
||||
VideoStatus = new VideoStatusOutputs(funcs);
|
||||
}
|
||||
}
|
||||
|
||||
public class RoutingOutputPort : RoutingPort
|
||||
{
|
||||
/// <summary>
|
||||
/// The IRoutingOutputs object this port lives on
|
||||
/// </summary>
|
||||
public IRoutingOutputs ParentDevice { get; private set; }
|
||||
|
||||
public InUseTracking InUseTracker { get; private set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
/// <param name="selector">An object used to refer to this port in the IRouting device's ExecuteSwitch method.
|
||||
/// May be string, number, whatever</param>
|
||||
/// <param name="parent">The IRoutingOutputs object this port lives on</param>
|
||||
public RoutingOutputPort(string key, eRoutingSignalType type, eRoutingPortConnectionType connType,
|
||||
object selector, IRoutingOutputs parent)
|
||||
: this(key, type, connType, selector, parent, false)
|
||||
{
|
||||
}
|
||||
|
||||
public RoutingOutputPort(string key, eRoutingSignalType type, eRoutingPortConnectionType connType,
|
||||
object selector, IRoutingOutputs parent, bool isInternal)
|
||||
: base(key, type, connType, selector, isInternal)
|
||||
{
|
||||
if (parent == null)
|
||||
throw new ArgumentNullException("parent");
|
||||
ParentDevice = parent;
|
||||
InUseTracker = new InUseTracking();
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return ParentDevice.Key + ":" + Key;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,142 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro;
|
||||
using Crestron.SimplSharpPro.DM;
|
||||
|
||||
using PepperDash.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
public class TieLine
|
||||
{
|
||||
public RoutingOutputPort SourcePort { get; private set; }
|
||||
public RoutingInputPort DestinationPort { get; private set; }
|
||||
public int InUseCount { get { return DestinationUsingThis.Count; } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the type of this tie line. Will either be the type of the desination port
|
||||
/// or the type of OverrideType when it is set.
|
||||
/// </summary>
|
||||
public eRoutingSignalType Type
|
||||
{
|
||||
get
|
||||
{
|
||||
if (OverrideType.HasValue) return OverrideType.Value;
|
||||
return DestinationPort.Type;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Use this to override the Type property for the destination port. For example,
|
||||
/// when the tie line is type AudioVideo, and the signal flow should be limited to
|
||||
/// Audio-only or Video only, changing this type will alter the signal paths
|
||||
/// available to the routing algorithm without affecting the actual Type
|
||||
/// of the destination port.
|
||||
/// </summary>
|
||||
public eRoutingSignalType? OverrideType { get; set; }
|
||||
|
||||
List<IRoutingInputs> DestinationUsingThis = new List<IRoutingInputs>();
|
||||
|
||||
/// <summary>
|
||||
/// For tie lines that represent internal links, like from cards to the matrix in a DM.
|
||||
/// This property is true if SourcePort and DestinationPort IsInternal
|
||||
/// property are both true
|
||||
/// </summary>
|
||||
public bool IsInternal { get { return SourcePort.IsInternal && DestinationPort.IsInternal; } }
|
||||
public bool TypeMismatch { get { return SourcePort.Type != DestinationPort.Type; } }
|
||||
public bool ConnectionTypeMismatch { get { return SourcePort.ConnectionType != DestinationPort.ConnectionType; } }
|
||||
public string TypeMismatchNote { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="sourcePort"></param>
|
||||
/// <param name="destinationPort"></param>
|
||||
public TieLine(RoutingOutputPort sourcePort, RoutingInputPort destinationPort)
|
||||
{
|
||||
if (sourcePort == null || destinationPort == null)
|
||||
throw new ArgumentNullException("source or destination port");
|
||||
SourcePort = sourcePort;
|
||||
DestinationPort = destinationPort;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a tie line with an overriding Type. See help for OverrideType property for info
|
||||
/// </summary>
|
||||
/// <param name="overrideType">The signal type to limit the link to. Overrides DestinationPort.Type</param>
|
||||
public TieLine(RoutingOutputPort sourcePort, RoutingInputPort destinationPort, eRoutingSignalType overrideType) :
|
||||
this(sourcePort, destinationPort)
|
||||
{
|
||||
OverrideType = overrideType;
|
||||
}
|
||||
|
||||
public static TieLine TieLineFromStrings(string sourceKey, string sourcePortKey, string destinationKey, string destinationPortKey)
|
||||
{
|
||||
var sourceDev = DeviceManager.GetDeviceForKey(sourceKey) as IRoutingOutputs;
|
||||
if (sourceDev == null)
|
||||
{
|
||||
Debug.Console(1, "WARNING: Cannot create tie line, routable source '{0}' not found", sourceKey);
|
||||
return null;
|
||||
}
|
||||
var destDev = DeviceManager.GetDeviceForKey(destinationKey) as IRoutingInputs;
|
||||
if (destDev == null)
|
||||
{
|
||||
Debug.Console(1, "WARNING: Cannot create tie line, routable destination '{0}' not found", destinationKey);
|
||||
return null;
|
||||
}
|
||||
var sourcePort = sourceDev.OutputPorts[sourcePortKey];
|
||||
if (sourcePort == null)
|
||||
{
|
||||
Debug.Console(1, "WARNING: Cannot create tie line. Source '{0}' does not contain port '{1}'", sourceKey, sourcePortKey);
|
||||
return null;
|
||||
}
|
||||
var destPort = destDev.InputPorts[destinationPortKey];
|
||||
if (destPort == null)
|
||||
{
|
||||
Debug.Console(1, "WARNING: Cannot create tie line. Destination '{0}' does not contain port '{1}'", destinationKey, destinationPortKey);
|
||||
return null;
|
||||
}
|
||||
|
||||
return new TieLine(sourcePort, destPort);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Will link up video status from supporting inputs to connected outputs
|
||||
/// </summary>
|
||||
public void Activate()
|
||||
{
|
||||
// Now does nothing
|
||||
}
|
||||
|
||||
public void Deactivate()
|
||||
{
|
||||
// Now does nothing
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return string.Format("Tie line: [{0}]{1} --> [{2}]{3}", SourcePort.ParentDevice.Key, SourcePort.Key,
|
||||
DestinationPort.ParentDevice.Key, DestinationPort.Key);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//********************************************************************************
|
||||
|
||||
public class TieLineCollection : List<TieLine>
|
||||
{
|
||||
public static TieLineCollection Default
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_Default == null)
|
||||
_Default = new TieLineCollection();
|
||||
return _Default;
|
||||
}
|
||||
}
|
||||
static TieLineCollection _Default;
|
||||
}
|
||||
}
|
||||
@@ -1,77 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro;
|
||||
using Crestron.SimplSharpPro.DM;
|
||||
|
||||
using PepperDash.Core;
|
||||
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
//*******************************************************************************************
|
||||
// Interfaces
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Defines a class that has a collection of RoutingInputPorts
|
||||
/// </summary>
|
||||
public interface IRoutingInputs : IKeyed
|
||||
{
|
||||
RoutingPortCollection<RoutingInputPort> InputPorts { get; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Defines a class that has a collection of RoutingOutputPorts
|
||||
/// </summary>
|
||||
|
||||
public interface IRoutingOutputs : IKeyed
|
||||
{
|
||||
RoutingPortCollection<RoutingOutputPort> OutputPorts { get; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// For fixed-source endpoint devices
|
||||
/// </summary>
|
||||
public interface IRoutingSinkNoSwitching : IRoutingInputs
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Endpoint device like a display, that selects inputs
|
||||
/// </summary>
|
||||
public interface IRoutingSinkWithSwitching : IRoutingSinkNoSwitching
|
||||
{
|
||||
//void ClearRoute();
|
||||
void ExecuteSwitch(object inputSelector);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// For devices like RMCs, baluns, other devices with no switching.
|
||||
/// </summary>
|
||||
public interface IRoutingInputsOutputs : IRoutingInputs, IRoutingOutputs
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Defines a midpoint device as have internal routing. Any devices in the middle of the
|
||||
/// signal chain, that do switching, must implement this for routing to work otherwise
|
||||
/// the routing algorithm will treat the IRoutingInputsOutputs device as a passthrough
|
||||
/// device.
|
||||
/// </summary>
|
||||
public interface IRouting : IRoutingInputsOutputs
|
||||
{
|
||||
//void ClearRoute(object outputSelector);
|
||||
void ExecuteSwitch(object inputSelector, object outputSelector, eRoutingSignalType signalType);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Defines an IRoutingOutputs devices as being a source - the start of the chain
|
||||
/// </summary>
|
||||
public interface IRoutingSource : IRoutingOutputs
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
using PepperDash.Core;
|
||||
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Basically a List , with an indexer to find ports by key name
|
||||
/// </summary>
|
||||
public class RoutingPortCollection<T> : List<T> where T: RoutingPort
|
||||
{
|
||||
/// <summary>
|
||||
/// Case-insensitive port lookup linked to ports' keys
|
||||
/// </summary>
|
||||
public T this[string key]
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.FirstOrDefault(i => i.Key.Equals(key, StringComparison.OrdinalIgnoreCase));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,128 +0,0 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using Crestron.SimplSharpPro;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
|
||||
using PepperDash.Core;
|
||||
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
public class SmartObjectHelper
|
||||
{
|
||||
public static uint GetSmartObjectJoinForTypeAndObject(uint sourceType, uint typeOffset)
|
||||
{
|
||||
return (uint)(10000 + (sourceType * 100) + typeOffset);
|
||||
}
|
||||
|
||||
//public static void DumpSmartObject(SmartGraphicsTouchpanelControllerBase tp, uint id)
|
||||
//{
|
||||
// if (!tp.TriList.SmartObjects.Contains(id))
|
||||
// {
|
||||
// Debug.Console(0, tp, "does not contain smart object ID {0}", id);
|
||||
// return;
|
||||
// }
|
||||
// var so = tp.TriList.SmartObjects[id];
|
||||
// Debug.Console(0, tp, "Signals for smart object ID {0}", id);
|
||||
// Debug.Console(0, "BooleanInput -------------------------------");
|
||||
// foreach (var s in so.BooleanInput)
|
||||
// Debug.Console(0, " {0,5} {1}", s.Number, s.Name);
|
||||
// Debug.Console(0, "UShortInput -------------------------------");
|
||||
// foreach (var s in so.UShortInput)
|
||||
// Debug.Console(0, " {0,5} {1}", s.Number, s.Name);
|
||||
// Debug.Console(0, "StringInput -------------------------------");
|
||||
// foreach (var s in so.StringInput)
|
||||
// Debug.Console(0, " {0,5} {1}", s.Number, s.Name);
|
||||
// Debug.Console(0, "BooleanOutput -------------------------------");
|
||||
// foreach (var s in so.BooleanOutput)
|
||||
// Debug.Console(0, " {0,5} {1}", s.Number, s.Name);
|
||||
// Debug.Console(0, "UShortOutput -------------------------------");
|
||||
// foreach (var s in so.UShortOutput)
|
||||
// Debug.Console(0, " {0,5} {1}", s.Number, s.Name);
|
||||
// Debug.Console(0, "StringOutput -------------------------------");
|
||||
// foreach (var s in so.StringOutput)
|
||||
// Debug.Console(0, " {0,5} {1}", s.Number, s.Name);
|
||||
//}
|
||||
|
||||
///// <summary>
|
||||
///// Inserts/removes the appropriate UO's onto sigs
|
||||
///// </summary>
|
||||
///// <param name="triList"></param>
|
||||
///// <param name="smartObjectId"></param>
|
||||
///// <param name="deviceUserObjects"></param>
|
||||
///// <param name="state"></param>
|
||||
//public static void LinkNumpadWithUserObjects(BasicTriListWithSmartObject triList,
|
||||
// uint smartObjectId, List<CueActionPair> deviceUserObjects, Cue Misc_1Function, Cue Misc_2Function, bool state)
|
||||
//{
|
||||
// var sigDict = new Dictionary<string, Cue>
|
||||
// {
|
||||
// { "0", CommonBoolCue.Digit0 },
|
||||
// { "1", CommonBoolCue.Digit1 },
|
||||
// { "2", CommonBoolCue.Digit2 },
|
||||
// { "3", CommonBoolCue.Digit3 },
|
||||
// { "4", CommonBoolCue.Digit4 },
|
||||
// { "5", CommonBoolCue.Digit5 },
|
||||
// { "6", CommonBoolCue.Digit6 },
|
||||
// { "7", CommonBoolCue.Digit7 },
|
||||
// { "8", CommonBoolCue.Digit8 },
|
||||
// { "9", CommonBoolCue.Digit9 },
|
||||
// { "Misc_1", Misc_1Function },
|
||||
// { "Misc_2", Misc_2Function },
|
||||
// };
|
||||
// LinkSmartObjectWithUserObjects(triList, smartObjectId, deviceUserObjects, sigDict, state);
|
||||
//}
|
||||
|
||||
//public static void LinkDpadWithUserObjects(BasicTriListWithSmartObject triList,
|
||||
// uint smartObjectId, List<CueActionPair> deviceUserObjects, bool state)
|
||||
//{
|
||||
// var sigDict = new Dictionary<string, Cue>
|
||||
// {
|
||||
// { "Up", CommonBoolCue.Up },
|
||||
// { "Down", CommonBoolCue.Down },
|
||||
// { "Left", CommonBoolCue.Left },
|
||||
// { "Right", CommonBoolCue.Right },
|
||||
// { "OK", CommonBoolCue.Select },
|
||||
// };
|
||||
// LinkSmartObjectWithUserObjects(triList, smartObjectId, deviceUserObjects, sigDict, state);
|
||||
//}
|
||||
|
||||
|
||||
///// <summary>
|
||||
///// MOVE TO HELPER CLASS
|
||||
///// </summary>
|
||||
///// <param name="triList"></param>
|
||||
///// <param name="smartObjectId"></param>
|
||||
///// <param name="deviceUserObjects"></param>
|
||||
///// <param name="smartObjectSigMap"></param>
|
||||
///// <param name="state"></param>
|
||||
//public static void LinkSmartObjectWithUserObjects(BasicTriListWithSmartObject triList,
|
||||
// uint smartObjectId, List<CueActionPair> deviceUserObjects, Dictionary<string, Cue> smartObjectSigMap, bool state)
|
||||
//{
|
||||
// // Hook up smart objects if applicable
|
||||
// if (triList.SmartObjects.Contains(smartObjectId))
|
||||
// {
|
||||
// var smartObject = triList.SmartObjects[smartObjectId];
|
||||
// foreach (var kvp in smartObjectSigMap)
|
||||
// {
|
||||
// if (smartObject.BooleanOutput.Contains(kvp.Key))
|
||||
// {
|
||||
// if (state)
|
||||
// {
|
||||
// // look for a user object and if so, attach/detach it to/from the sig.
|
||||
// var uo = deviceUserObjects.FirstOrDefault(ao => ao.Cue == kvp.Value);
|
||||
// if (uo != null)
|
||||
// smartObject.BooleanOutput[kvp.Key].UserObject = uo;
|
||||
// }
|
||||
// else
|
||||
// smartObject.BooleanOutput[kvp.Key].UserObject = null;
|
||||
// }
|
||||
// else
|
||||
// Debug.Console(0, "Smart object {0} does not contain Sig {1}", smartObject.ID, kvp.Key);
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// Debug.Console(0, "ERROR Smart object {0} not found on {1:X2}", smartObjectId, triList.ID);
|
||||
//}
|
||||
}
|
||||
}
|
||||
@@ -1,275 +0,0 @@
|
||||
//using System;
|
||||
//using System.Collections.Generic;
|
||||
//using System.Linq;
|
||||
//using Crestron.SimplSharp;
|
||||
//using Crestron.SimplSharpPro;
|
||||
//using Crestron.SimplSharpPro.DeviceSupport;
|
||||
|
||||
//using PepperDash.Core;
|
||||
|
||||
|
||||
//namespace PepperDash.Essentials.Core
|
||||
//{
|
||||
// /// <summary>
|
||||
// ///
|
||||
// /// </summary>
|
||||
// public class LargeTouchpanelControllerBase : SmartGraphicsTouchpanelControllerBase
|
||||
// {
|
||||
// public string PresentationShareButtonInVideoText = "Share";
|
||||
// public string PresentationShareButtonNotInVideoText = "Presentation";
|
||||
|
||||
// SourceListSubpageReferenceList SourceSelectSRL;
|
||||
// DevicePageControllerBase CurrentPresentationSourcePageController;
|
||||
|
||||
// public LargeTouchpanelControllerBase(string key, string name,
|
||||
// BasicTriListWithSmartObject triList, string sgdFilePath)
|
||||
// : base(key, name, triList, sgdFilePath)
|
||||
// {
|
||||
// }
|
||||
|
||||
// public override bool CustomActivate()
|
||||
// {
|
||||
// var baseSuccess = base.CustomActivate();
|
||||
// if (!baseSuccess) return false;
|
||||
|
||||
// SourceSelectSRL = new SourceListSubpageReferenceList(this.TriList, n =>
|
||||
// { if (CurrentRoom != null) CurrentRoom.SelectSource(n); });
|
||||
|
||||
// var lm = Global.LicenseManager;
|
||||
// if (lm != null)
|
||||
// {
|
||||
// lm.LicenseIsValid.LinkInputSig(TriList.BooleanInput[UiCue.ShowLicensed.Number]);
|
||||
// //others
|
||||
// }
|
||||
|
||||
// // Temp things -----------------------------------------------------------------------
|
||||
// TriList.StringInput[UiCue.SplashMessage.Number].StringValue = SplashMessage;
|
||||
// //------------------------------------------------------------------------------------
|
||||
|
||||
// // Initialize initial view
|
||||
// ShowSplashOrMain();
|
||||
// return true;
|
||||
// }
|
||||
|
||||
// /// <summary>
|
||||
// /// In Essentials, this should NEVER be called, since it's a one-room solution
|
||||
// /// </summary>
|
||||
// protected override void HideRoomUI()
|
||||
// {
|
||||
// // UI Cleanup here????
|
||||
|
||||
// //SwapAudioDeviceControls(CurrentRoom.CurrentAudioDevice, null);
|
||||
// //CurrentRoom.AudioDeviceWillChange -= CurrentRoom_AudioDeviceWillChange;
|
||||
|
||||
// CurrentRoom.IsCoolingDown.OutputChange -= CurrentRoom_IsCoolingDown_OutputChange;
|
||||
// CurrentRoom.IsWarmingUp.OutputChange -= CurrentRoom_IsWarmingUp_OutputChange;
|
||||
|
||||
// SourceSelectSRL.DetachFromCurrentRoom();
|
||||
// }
|
||||
|
||||
// /// <summary>
|
||||
// /// Ties this panel controller to the Room and gets updates.
|
||||
// /// </summary>
|
||||
// protected override void ShowRoomUI()
|
||||
// {
|
||||
// Debug.Console(1, this, "connecting to system '{0}'", CurrentRoom.Key);
|
||||
|
||||
// TriList.StringInput[RoomCue.Name.Number].StringValue = CurrentRoom.Name;
|
||||
// TriList.StringInput[RoomCue.Description.Number].StringValue = CurrentRoom.Description;
|
||||
|
||||
// CurrentRoom.IsCoolingDown.OutputChange -= CurrentRoom_IsCoolingDown_OutputChange;
|
||||
// CurrentRoom.IsWarmingUp.OutputChange -= CurrentRoom_IsWarmingUp_OutputChange;
|
||||
// CurrentRoom.IsCoolingDown.OutputChange += CurrentRoom_IsCoolingDown_OutputChange;
|
||||
// CurrentRoom.IsWarmingUp.OutputChange += CurrentRoom_IsWarmingUp_OutputChange;
|
||||
|
||||
// SourceSelectSRL.AttachToRoom(CurrentRoom);
|
||||
// }
|
||||
|
||||
// void CurrentRoom_IsCoolingDown_OutputChange(object sender, EventArgs e)
|
||||
// {
|
||||
// Debug.Console(2, this, "Received room in cooldown={0}", CurrentRoom.IsCoolingDown.BoolValue);
|
||||
// if (CurrentRoom.IsCoolingDown.BoolValue) // When entering cooldown
|
||||
// {
|
||||
// // Do we need to check for an already-running cooldown - like in the case of room switches?
|
||||
// new ModalDialog(TriList).PresentModalTimerDialog(0, "Power Off", "Power", "Please wait, shutting down",
|
||||
// "", "", CurrentRoom.CooldownTime, true, b =>
|
||||
// {
|
||||
// ShowSplashOrMain();
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
|
||||
// void CurrentRoom_IsWarmingUp_OutputChange(object sender, EventArgs e)
|
||||
// {
|
||||
// Debug.Console(2, this, "Received room in warmup={0}", CurrentRoom.IsWarmingUp.BoolValue);
|
||||
// if (CurrentRoom.IsWarmingUp.BoolValue) // When entering warmup
|
||||
// {
|
||||
// // Do we need to check for an already-running cooldown - like in the case of room switches?
|
||||
// new ModalDialog(TriList).PresentModalTimerDialog(0, "Power On", "Power", "Please wait, powering on",
|
||||
// "", "", CurrentRoom.WarmupTime, false, b =>
|
||||
// {
|
||||
// // Reveal sources - or has already been done behind modal
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
|
||||
// // Handler for source change events.
|
||||
// void CurrentRoom_PresentationSourceChange(object sender, EssentialsRoomSourceChangeEventArgs args)
|
||||
// {
|
||||
// // Put away the old source and set up the new source.
|
||||
// Debug.Console(2, this, "Received source change={0}", args.NewSource != null ? args.NewSource.Key : "none");
|
||||
|
||||
// // If we're in tech, don't switch screen modes. Add any other modes we may want to switch away from
|
||||
// // inside the if below.
|
||||
// if (MainMode == eMainModeType.Splash)
|
||||
// setMainMode(eMainModeType.Presentation);
|
||||
// SetControlSource(args.NewSource);
|
||||
// }
|
||||
|
||||
// //***********************************************************************
|
||||
// //** UI Manipulation
|
||||
// //***********************************************************************
|
||||
|
||||
// /// <summary>
|
||||
// /// Shows the splash page or the main presentation page, depending on config setting
|
||||
// /// </summary>
|
||||
// void ShowSplashOrMain()
|
||||
// {
|
||||
// if (UsesSplashPage)
|
||||
// setMainMode(eMainModeType.Splash);
|
||||
// else
|
||||
// setMainMode(eMainModeType.Presentation);
|
||||
// }
|
||||
|
||||
// /// <summary>
|
||||
// /// Switches between main modes
|
||||
// /// </summary>
|
||||
// void setMainMode(eMainModeType mode)
|
||||
// {
|
||||
// MainMode = mode;
|
||||
// switch (mode)
|
||||
// {
|
||||
// case eMainModeType.Presentation:
|
||||
// TriList.BooleanInput[UiCue.VisibleCommonFooter.Number].BoolValue = true;
|
||||
// TriList.BooleanInput[UiCue.VisibleCommonHeader.Number].BoolValue = true;
|
||||
// TriList.BooleanInput[UiCue.VisibleSplash.Number].BoolValue = false;
|
||||
// TriList.BooleanInput[UiCue.VisiblePresentationSourceList.Number].BoolValue = true;
|
||||
// ShowCurrentPresentationSourceUi();
|
||||
// break;
|
||||
// case eMainModeType.Splash:
|
||||
// TriList.BooleanInput[UiCue.VisibleCommonFooter.Number].BoolValue = false;
|
||||
// TriList.BooleanInput[UiCue.VisibleCommonHeader.Number].BoolValue = false;
|
||||
// TriList.BooleanInput[UiCue.VisiblePresentationSourceList.Number].BoolValue = false;
|
||||
// TriList.BooleanInput[UiCue.VisibleSplash.Number].BoolValue = true;
|
||||
// HideCurrentPresentationSourceUi();
|
||||
// break;
|
||||
// case eMainModeType.Tech:
|
||||
// new ModalDialog(TriList).PresentModalTimerDialog(1, "Tech page", "Info",
|
||||
// "Tech page will be here soon!<br>I promise",
|
||||
// "Bueno!", "", 0, false, null);
|
||||
// MainMode = eMainModeType.Presentation;
|
||||
// break;
|
||||
// default:
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
|
||||
// void PowerOffWithConfirmPressed()
|
||||
// {
|
||||
// if (!CurrentRoom.RoomIsOn.BoolValue) return;
|
||||
// // Timeout or button 1 press will shut down
|
||||
// var modal = new ModalDialog(TriList);
|
||||
// uint seconds = CurrentRoom.UnattendedShutdownTimeMs / 1000;
|
||||
// var message = string.Format("Meeting will end in {0} seconds", seconds);
|
||||
// modal.PresentModalTimerDialog(2, "End Meeting", "Info", message,
|
||||
// "End Meeting Now", "Cancel", CurrentRoom.UnattendedShutdownTimeMs, true,
|
||||
// but => { if (but != 2) CurrentRoom.RoomOff(); });
|
||||
// }
|
||||
|
||||
// /// <summary>
|
||||
// /// Reveals the basic UI for the current device
|
||||
// /// </summary>
|
||||
// protected override void ShowCurrentPresentationSourceUi()
|
||||
// {
|
||||
// if (MainMode == eMainModeType.Splash && CurrentRoom.RoomIsOn.BoolValue)
|
||||
// setMainMode(eMainModeType.Presentation);
|
||||
|
||||
// if (CurrentPresentationControlDevice == null)
|
||||
// {
|
||||
// // If system is off, do one thing
|
||||
|
||||
// // Otherwise, do something else - shouldn't be in this condition
|
||||
|
||||
// return;
|
||||
// }
|
||||
|
||||
// // If a controller is already loaded, use it
|
||||
// if (LoadedPageControllers.ContainsKey(CurrentPresentationControlDevice))
|
||||
// CurrentPresentationSourcePageController = LoadedPageControllers[CurrentPresentationControlDevice];
|
||||
// else
|
||||
// {
|
||||
// // This is by no means optimal, but for now....
|
||||
// if (CurrentPresentationControlDevice.Type == PresentationSourceType.SetTopBox
|
||||
// && CurrentPresentationControlDevice is IHasSetTopBoxProperties)
|
||||
// CurrentPresentationSourcePageController = new PageControllerLargeSetTopBoxGeneric(TriList,
|
||||
// CurrentPresentationControlDevice as IHasSetTopBoxProperties);
|
||||
|
||||
// else if (CurrentPresentationControlDevice.Type == PresentationSourceType.Laptop)
|
||||
// CurrentPresentationSourcePageController = new PageControllerLaptop(TriList);
|
||||
|
||||
// // separate these...
|
||||
// else if (CurrentPresentationControlDevice.Type == PresentationSourceType.Dvd)
|
||||
// CurrentPresentationSourcePageController =
|
||||
// new PageControllerLargeDvd(TriList, CurrentPresentationControlDevice as IHasCueActionList);
|
||||
|
||||
// else
|
||||
// CurrentPresentationSourcePageController = null;
|
||||
|
||||
// // Save it.
|
||||
// if (CurrentPresentationSourcePageController != null)
|
||||
// LoadedPageControllers[CurrentPresentationControlDevice] = CurrentPresentationSourcePageController;
|
||||
// }
|
||||
|
||||
// if (CurrentPresentationSourcePageController != null)
|
||||
// CurrentPresentationSourcePageController.SetVisible(true);
|
||||
// }
|
||||
|
||||
// protected override void HideCurrentPresentationSourceUi()
|
||||
// {
|
||||
// if (CurrentPresentationControlDevice != null && CurrentPresentationSourcePageController != null)
|
||||
// CurrentPresentationSourcePageController.SetVisible(false);
|
||||
// }
|
||||
|
||||
|
||||
|
||||
// void ShowHelp()
|
||||
// {
|
||||
// new ModalDialog(TriList).PresentModalTimerDialog(1, "Help", "Help", CurrentRoom.HelpMessage,
|
||||
// "OK", "", 0, false, null);
|
||||
// }
|
||||
|
||||
// protected void ListSmartObjects()
|
||||
// {
|
||||
// Debug.Console(0, this, "Smart objects IDs:");
|
||||
// var list = TriList.SmartObjects.OrderBy(s => s.Key);
|
||||
// foreach (var kvp in list)
|
||||
// Debug.Console(0, " {0}", kvp.Key);
|
||||
// }
|
||||
|
||||
// public override List<CueActionPair> FunctionList
|
||||
// {
|
||||
// get
|
||||
// {
|
||||
// return new List<CueActionPair>
|
||||
// {
|
||||
// new BoolCueActionPair(UiCue.PressSplash, b => { if(!b) setMainMode(eMainModeType.Presentation); }),
|
||||
// new BoolCueActionPair(UiCue.PressRoomOffWithConfirm, b => { if(!b) PowerOffWithConfirmPressed(); }),
|
||||
// new BoolCueActionPair(UiCue.PressModePresentationShare, b => { if(!b) setMainMode(eMainModeType.Presentation); }),
|
||||
// new BoolCueActionPair(UiCue.PressHelp, b => { if(!b) ShowHelp(); }),
|
||||
// new BoolCueActionPair(UiCue.PressSettings, b => { if(!b) setMainMode(eMainModeType.Tech); }),
|
||||
// };
|
||||
// }
|
||||
// }
|
||||
// //#endregion
|
||||
// }
|
||||
//}
|
||||
@@ -1,244 +0,0 @@
|
||||
//using System;
|
||||
//using System.Collections.Generic;
|
||||
//using System.Linq;
|
||||
//using System.Text;
|
||||
//using Crestron.SimplSharp;
|
||||
//using Crestron.SimplSharpPro;
|
||||
//using Crestron.SimplSharpPro.DeviceSupport;
|
||||
|
||||
//using PepperDash.Essentials.Core.Presets;
|
||||
|
||||
//using PepperDash.Core;
|
||||
|
||||
|
||||
//namespace PepperDash.Essentials.Core
|
||||
//{
|
||||
// /// <summary>
|
||||
// ///
|
||||
// /// </summary>
|
||||
// public abstract class DevicePageControllerBase
|
||||
// {
|
||||
|
||||
// protected BasicTriListWithSmartObject TriList;
|
||||
// protected List<BoolInputSig> FixedObjectSigs;
|
||||
|
||||
// public DevicePageControllerBase(BasicTriListWithSmartObject triList)
|
||||
// {
|
||||
// TriList = triList;
|
||||
// }
|
||||
|
||||
// public void SetVisible(bool state)
|
||||
// {
|
||||
// foreach (var sig in FixedObjectSigs)
|
||||
// {
|
||||
// Debug.Console(2, "set visible {0}={1}", sig.Number, state);
|
||||
// sig.BoolValue = state;
|
||||
// }
|
||||
// CustomSetVisible(state);
|
||||
// }
|
||||
|
||||
// /// <summary>
|
||||
// /// Add any specialized show/hide logic here - beyond FixedObjectSigs. Overriding
|
||||
// /// methods do not need to call this base method
|
||||
// /// </summary>
|
||||
// protected virtual void CustomSetVisible(bool state)
|
||||
// {
|
||||
// }
|
||||
// }
|
||||
|
||||
// //public class InterlockedDevicePageController
|
||||
// //{
|
||||
// // public List<uint> ObjectBoolJoins { get; set; }
|
||||
// // public uint DefaultJoin { get; set; }
|
||||
// //}
|
||||
|
||||
|
||||
|
||||
|
||||
// ///// <summary>
|
||||
// /////
|
||||
// ///// </summary>
|
||||
// //public interface IHasSetTopBoxProperties
|
||||
// //{
|
||||
// // bool HasDpad { get; }
|
||||
// // bool HasPreset { get; }
|
||||
// // bool HasDvr { get; }
|
||||
// // bool HasNumbers { get; }
|
||||
// // DevicePresetsModel PresetsModel { get; }
|
||||
// // void LoadPresets(string filePath);
|
||||
// //}
|
||||
|
||||
// public class PageControllerLaptop : DevicePageControllerBase
|
||||
// {
|
||||
// public PageControllerLaptop(BasicTriListWithSmartObject tl)
|
||||
// : base(tl)
|
||||
// {
|
||||
// FixedObjectSigs = new List<BoolInputSig>
|
||||
// {
|
||||
// tl.BooleanInput[10092], // well
|
||||
// tl.BooleanInput[11001] // Laptop info
|
||||
// };
|
||||
// }
|
||||
// }
|
||||
|
||||
// ///// <summary>
|
||||
// /////
|
||||
// ///// </summary>
|
||||
// //public class PageControllerLargeDvd : DevicePageControllerBase
|
||||
// //{
|
||||
// // IHasCueActionList Device;
|
||||
|
||||
// // public PageControllerLargeDvd(BasicTriListWithSmartObject tl, IHasCueActionList device)
|
||||
// // : base(tl)
|
||||
// // {
|
||||
|
||||
// // Device = device;
|
||||
// // FixedObjectSigs = new List<BoolInputSig>
|
||||
// // {
|
||||
// // tl.BooleanInput[10093], // well
|
||||
// // tl.BooleanInput[10411], // DVD Dpad
|
||||
// // tl.BooleanInput[10412] // everything else
|
||||
// // };
|
||||
// // }
|
||||
|
||||
// // protected override void CustomSetVisible(bool state)
|
||||
// // {
|
||||
// // // Hook up smart objects if applicable
|
||||
// // if (Device != null)
|
||||
// // {
|
||||
// // var uos = (Device as IHasCueActionList).CueActionList;
|
||||
// // SmartObjectHelper.LinkDpadWithUserObjects(TriList, 10411, uos, state);
|
||||
// // }
|
||||
// // }
|
||||
// //}
|
||||
|
||||
|
||||
// /// <summary>
|
||||
// ///
|
||||
// /// </summary>
|
||||
// //public class PageControllerLargeSetTopBoxGeneric : DevicePageControllerBase
|
||||
// //{
|
||||
// // // To-DO: Add properties for component subpage names. DpadPos1, DpadPos2...
|
||||
// // // Derived classes can then insert special subpages for variations on given
|
||||
// // // device types. Like DirecTV vs Comcast
|
||||
|
||||
// // public uint DpadSmartObjectId { get; set; }
|
||||
// // public uint NumberPadSmartObjectId { get; set; }
|
||||
// // public uint PresetsSmartObjectId { get; set; }
|
||||
// // public uint Position5TabsId { get; set; }
|
||||
|
||||
// // IHasSetTopBoxProperties Device;
|
||||
// // DevicePresetsView PresetsView;
|
||||
|
||||
|
||||
// // bool ShowPosition5Tabs;
|
||||
// // uint CurrentVisiblePosition5Item = 1;
|
||||
// // Dictionary<uint, uint> Position5SubpageJoins = new Dictionary<uint, uint>
|
||||
// // {
|
||||
// // { 1, 10053 },
|
||||
// // { 2, 10054 }
|
||||
// // };
|
||||
|
||||
// // public PageControllerLargeSetTopBoxGeneric(BasicTriListWithSmartObject tl, IHasSetTopBoxProperties device)
|
||||
// // : base(tl)
|
||||
// // {
|
||||
// // Device = device;
|
||||
// // DpadSmartObjectId = 10011;
|
||||
// // NumberPadSmartObjectId = 10014;
|
||||
// // PresetsSmartObjectId = 10012;
|
||||
// // Position5TabsId = 10081;
|
||||
|
||||
// // bool dpad = device.HasDpad;
|
||||
// // bool preset = device.HasPreset;
|
||||
// // bool dvr = device.HasDvr;
|
||||
// // bool numbers = device.HasNumbers;
|
||||
// // uint[] joins = null;
|
||||
|
||||
// // if (dpad && !preset && !dvr && !numbers) joins = new uint[] { 10031, 10091 };
|
||||
// // else if (!dpad && preset && !dvr && !numbers) joins = new uint[] { 10032, 10091 };
|
||||
// // else if (!dpad && !preset && dvr && !numbers) joins = new uint[] { 10033, 10091 };
|
||||
// // else if (!dpad && !preset && !dvr && numbers) joins = new uint[] { 10034, 10091 };
|
||||
|
||||
// // else if (dpad && preset && !dvr && !numbers) joins = new uint[] { 10042, 10021, 10092 };
|
||||
// // else if (dpad && !preset && dvr && !numbers) joins = new uint[] { 10043, 10021, 10092 };
|
||||
// // else if (dpad && !preset && !dvr && numbers) joins = new uint[] { 10044, 10021, 10092 };
|
||||
// // else if (!dpad && preset && dvr && !numbers) joins = new uint[] { 10043, 10022, 10092 };
|
||||
// // else if (!dpad && preset && !dvr && numbers) joins = new uint[] { 10044, 10022, 10092 };
|
||||
// // else if (!dpad && !preset && dvr && numbers) joins = new uint[] { 10044, 10023, 10092 };
|
||||
|
||||
// // else if (dpad && preset && dvr && !numbers) joins = new uint[] { 10053, 10032, 10011, 10093 };
|
||||
// // else if (dpad && preset && !dvr && numbers) joins = new uint[] { 10054, 10032, 10011, 10093 };
|
||||
// // else if (dpad && !preset && dvr && numbers) joins = new uint[] { 10054, 10033, 10011, 10093 };
|
||||
// // else if (!dpad && preset && dvr && numbers) joins = new uint[] { 10054, 10033, 10012, 10093 };
|
||||
|
||||
// // else if (dpad && preset && dvr && numbers)
|
||||
// // {
|
||||
// // joins = new uint[] { 10081, 10032, 10011, 10093 }; // special case
|
||||
// // ShowPosition5Tabs = true;
|
||||
// // }
|
||||
// // // Project the joins into corresponding sigs.
|
||||
// // FixedObjectSigs = joins.Select(u => TriList.BooleanInput[u]).ToList();
|
||||
|
||||
// // // Build presets
|
||||
// // if (device.HasPreset)
|
||||
// // {
|
||||
// // PresetsView = new DevicePresetsView(tl, device.PresetsModel);
|
||||
// // }
|
||||
|
||||
|
||||
// // }
|
||||
|
||||
// // protected override void CustomSetVisible(bool state)
|
||||
// // {
|
||||
// // if (ShowPosition5Tabs)
|
||||
// // {
|
||||
// // // Show selected tab
|
||||
// // TriList.BooleanInput[Position5SubpageJoins[CurrentVisiblePosition5Item]].BoolValue = state;
|
||||
|
||||
// // var tabSo = TriList.SmartObjects[Position5TabsId];
|
||||
// // if (state) // Link up the tab object
|
||||
|
||||
// // {
|
||||
// // tabSo.BooleanOutput["Tab Button 1 Press"].UserObject = new BoolCueActionPair(b => ShowTab(1));
|
||||
// // tabSo.BooleanOutput["Tab Button 2 Press"].UserObject = new BoolCueActionPair(b => ShowTab(2));
|
||||
// // }
|
||||
// // else // Disco tab object
|
||||
// // {
|
||||
// // tabSo.BooleanOutput["Tab Button 1 Press"].UserObject = null;
|
||||
// // tabSo.BooleanOutput["Tab Button 2 Press"].UserObject = null;
|
||||
// // }
|
||||
// // }
|
||||
|
||||
// // // Hook up smart objects if applicable
|
||||
// // if (Device is IHasCueActionList)
|
||||
// // {
|
||||
// // var uos = (Device as IHasCueActionList).CueActionList;
|
||||
// // SmartObjectHelper.LinkDpadWithUserObjects(TriList, DpadSmartObjectId, uos, state);
|
||||
// // SmartObjectHelper.LinkNumpadWithUserObjects(TriList, NumberPadSmartObjectId,
|
||||
// // uos, CommonBoolCue.Dash, CommonBoolCue.Last, state);
|
||||
// // }
|
||||
|
||||
|
||||
// // // Link, unlink presets
|
||||
// // if (Device.HasPreset && state)
|
||||
// // PresetsView.Attach();
|
||||
// // else if (Device.HasPreset && !state)
|
||||
// // PresetsView.Detach();
|
||||
// // }
|
||||
|
||||
// // void ShowTab(uint number)
|
||||
// // {
|
||||
// // // Ignore re-presses
|
||||
// // if (CurrentVisiblePosition5Item == number) return;
|
||||
// // // Swap subpage
|
||||
// // var bi = TriList.BooleanInput;
|
||||
// // if(CurrentVisiblePosition5Item > 0)
|
||||
// // bi[Position5SubpageJoins[CurrentVisiblePosition5Item]].BoolValue = false;
|
||||
// // CurrentVisiblePosition5Item = number;
|
||||
// // bi[Position5SubpageJoins[CurrentVisiblePosition5Item]].BoolValue = true;
|
||||
|
||||
// // // Show feedback on buttons
|
||||
// // }
|
||||
|
||||
// //}
|
||||
//}
|
||||
@@ -1,135 +0,0 @@
|
||||
//using System;
|
||||
//using System.Collections.Generic;
|
||||
//using System.Linq;
|
||||
//using Crestron.SimplSharp;
|
||||
//using Crestron.SimplSharpPro;
|
||||
//using Crestron.SimplSharpPro.DeviceSupport;
|
||||
//using Crestron.SimplSharpPro.UI;
|
||||
|
||||
//using PepperDash.Core;
|
||||
|
||||
|
||||
//namespace PepperDash.Essentials.Core
|
||||
//{
|
||||
//[Obsolete("Replaced, initially with CrestronTsr302Controller in Resissentials")]
|
||||
// public class Tsr302Controller : SmartGraphicsTouchpanelControllerBase
|
||||
// {
|
||||
// //public override List<CueActionPair> FunctionList
|
||||
// //{
|
||||
// // get
|
||||
// // {
|
||||
// // return new List<CueActionPair>
|
||||
// // {
|
||||
|
||||
// // };
|
||||
// // }
|
||||
// //}
|
||||
|
||||
// public Tsr302 Remote { get; private set; }
|
||||
|
||||
// SourceListSubpageReferenceList SourceSelectSRL;
|
||||
// DevicePageControllerBase CurrentPresentationSourcePageController;
|
||||
// CTimer VolumeFeedbackTimer;
|
||||
|
||||
|
||||
// public Tsr302Controller(string key, string name, Tsr302 device, string sgdFilePath) :
|
||||
// base(key, name, device, sgdFilePath)
|
||||
// {
|
||||
// // Base takes care of TriList
|
||||
// Remote = device;
|
||||
// Remote.Home.UserObject = new BoolCueActionPair(b => { if (!b) PressHome(); });
|
||||
// Remote.VolumeUp.UserObject = new BoolCueActionPair(b => { if (!b) PressHome(); });
|
||||
// Remote.ButtonStateChange += Remote_ButtonStateChange;
|
||||
// }
|
||||
|
||||
// public override bool CustomActivate()
|
||||
// {
|
||||
// var baseSuccess = base.CustomActivate();
|
||||
// if (!baseSuccess) return false;
|
||||
|
||||
// SourceSelectSRL = new SourceListSubpageReferenceList(this.TriList, n =>
|
||||
// { if (CurrentRoom != null) CurrentRoom.SelectSource(n); });
|
||||
|
||||
|
||||
// return true;
|
||||
// }
|
||||
|
||||
// protected override void SwapAudioDeviceControls(IVolumeFunctions oldDev, IVolumeFunctions newDev)
|
||||
// {
|
||||
// // stop presses
|
||||
// if (oldDev != null)
|
||||
// {
|
||||
// ReleaseAudioPresses();
|
||||
// if (oldDev is IVolumeTwoWay)
|
||||
// {
|
||||
// (newDev as IVolumeTwoWay).VolumeLevelFeedback.OutputChange -= VolumeLevelOutput_OutputChange;
|
||||
// (oldDev as IVolumeTwoWay).VolumeLevelFeedback
|
||||
// .UnlinkInputSig(TriList.UShortInput[CommonIntCue.MainVolumeLevel.Number]);
|
||||
// }
|
||||
// }
|
||||
|
||||
// if (newDev != null)
|
||||
// {
|
||||
// Remote.VolumeDown.UserObject = newDev.VolumeDownCueActionPair;
|
||||
// Remote.VolumeUp.UserObject = newDev.VolumeUpCueActionPair;
|
||||
// Remote.Mute.UserObject = newDev.MuteToggleCueActionPair;
|
||||
// if (newDev is IVolumeTwoWay)
|
||||
// {
|
||||
// var vOut = (newDev as IVolumeTwoWay).VolumeLevelFeedback;
|
||||
// vOut.OutputChange += VolumeLevelOutput_OutputChange;
|
||||
// TriList.UShortInput[CommonIntCue.MainVolumeLevel.Number].UShortValue = vOut.UShortValue;
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// Remote.VolumeDown.UserObject = null;
|
||||
// Remote.VolumeUp.UserObject = null;
|
||||
// Remote.Mute.UserObject = null;
|
||||
// }
|
||||
|
||||
// base.SwapAudioDeviceControls(oldDev, newDev);
|
||||
// }
|
||||
|
||||
// void PressHome()
|
||||
// {
|
||||
|
||||
// }
|
||||
|
||||
// void VolumeLevelOutput_OutputChange(object sender, EventArgs e)
|
||||
// {
|
||||
// // Set level and show popup on timer
|
||||
// TriList.UShortInput[CommonIntCue.MainVolumeLevel.Number].UShortValue =
|
||||
// (sender as IntFeedback).UShortValue;
|
||||
|
||||
// if (VolumeFeedbackTimer == null)
|
||||
// {
|
||||
// TriList.BooleanInput[CommonBoolCue.ShowVolumeSlider.Number].BoolValue = true;
|
||||
// VolumeFeedbackTimer = new CTimer(o => {
|
||||
// TriList.BooleanInput[CommonBoolCue.ShowVolumeSlider.Number].BoolValue = false;
|
||||
// }, 1000);
|
||||
// }
|
||||
|
||||
// }
|
||||
|
||||
// void ReleaseAudioPresses()
|
||||
// {
|
||||
// if (Remote.VolumeDown.UserObject is BoolCueActionPair && Remote.VolumeDown.State == eButtonState.Pressed)
|
||||
// (Remote.VolumeDown.UserObject as BoolCueActionPair).Invoke(false);
|
||||
// if (Remote.VolumeUp.UserObject is BoolCueActionPair && Remote.VolumeUp.State == eButtonState.Pressed)
|
||||
// (Remote.VolumeUp.UserObject as BoolCueActionPair).Invoke(false);
|
||||
// if (Remote.Mute.UserObject is BoolCueActionPair && Remote.Mute.State == eButtonState.Pressed)
|
||||
// (Remote.Mute.UserObject as BoolCueActionPair).Invoke(false);
|
||||
// }
|
||||
|
||||
// /// <summary>
|
||||
// /// Handler. Run UO's stored in buttons
|
||||
// /// </summary>
|
||||
// void Remote_ButtonStateChange(GenericBase device, ButtonEventArgs args)
|
||||
// {
|
||||
// Debug.Console(2, this, "{0}={1}", args.Button.Name, args.Button.State);
|
||||
// var uo = args.Button.UserObject as BoolCueActionPair;
|
||||
// if (uo != null)
|
||||
// uo.Invoke(args.NewButtonState == eButtonState.Pressed);
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
@@ -1,309 +0,0 @@
|
||||
//using System;
|
||||
//using System.Collections.Generic;
|
||||
//using System.Linq;
|
||||
//using Crestron.SimplSharp;
|
||||
//using Crestron.SimplSharpPro;
|
||||
//using Crestron.SimplSharpPro.DeviceSupport;
|
||||
|
||||
|
||||
//namespace PepperDash.Essentials.Core
|
||||
//{
|
||||
// public abstract class SmartGraphicsTouchpanelControllerBase : CrestronGenericBaseDevice
|
||||
// {
|
||||
// public BasicTriListWithSmartObject TriList { get; protected set; }
|
||||
// public bool UsesSplashPage { get; set; }
|
||||
// public string SplashMessage { get; set; }
|
||||
// public bool ShowDate
|
||||
// {
|
||||
// set { TriList.BooleanInput[UiCue.ShowDate.Number].BoolValue = value; }
|
||||
// }
|
||||
// public bool ShowTime
|
||||
// {
|
||||
// set { TriList.BooleanInput[UiCue.ShowTime.Number].BoolValue = value; }
|
||||
// }
|
||||
|
||||
// public abstract List<CueActionPair> FunctionList { get; }
|
||||
|
||||
|
||||
// protected eMainModeType MainMode;
|
||||
// protected IPresentationSource CurrentPresentationControlDevice;
|
||||
|
||||
// /// <summary>
|
||||
// /// Defines the signal offset for the presentation device. Defaults to 100
|
||||
// /// </summary>
|
||||
// public uint PresentationControlDeviceJoinOffset { get { return 100; } }
|
||||
|
||||
// public enum eMainModeType
|
||||
// {
|
||||
// Presentation, Splash, Tech
|
||||
// }
|
||||
|
||||
// protected string SgdFilePath;
|
||||
// public EssentialsRoom CurrentRoom { get; protected set; }
|
||||
// protected Dictionary<IPresentationSource, DevicePageControllerBase> LoadedPageControllers
|
||||
// = new Dictionary<IPresentationSource, DevicePageControllerBase>();
|
||||
|
||||
// static object RoomChangeLock = new object();
|
||||
|
||||
// /// <summary>
|
||||
// /// Constructor
|
||||
// /// </summary>
|
||||
// public SmartGraphicsTouchpanelControllerBase(string key, string name, BasicTriListWithSmartObject triList,
|
||||
// string sgdFilePath)
|
||||
// : base(key, name, triList)
|
||||
// {
|
||||
// TriList = triList;
|
||||
// if (string.IsNullOrEmpty(key)) throw new ArgumentNullException("key");
|
||||
// if (string.IsNullOrEmpty(sgdFilePath)) throw new ArgumentNullException("sgdFilePath");
|
||||
// SgdFilePath = sgdFilePath;
|
||||
// TriList.LoadSmartObjects(SgdFilePath);
|
||||
// UsesSplashPage = true;
|
||||
// SplashMessage = "Welcome";
|
||||
// TriList.SigChange += Tsw_AnySigChange;
|
||||
// foreach (var kvp in TriList.SmartObjects)
|
||||
// kvp.Value.SigChange += this.Tsw_AnySigChange;
|
||||
// }
|
||||
|
||||
// public override bool CustomActivate()
|
||||
// {
|
||||
// var baseSuccess = base.CustomActivate();
|
||||
// if (!baseSuccess) return false;
|
||||
|
||||
// // Wiring up the buttons with UOs
|
||||
// foreach (var uo in this.FunctionList)
|
||||
// {
|
||||
// if (uo.Cue.Number == 0) continue;
|
||||
// if (uo is BoolCueActionPair)
|
||||
// TriList.BooleanOutput[uo.Cue.Number].UserObject = uo;
|
||||
// else if (uo is UShortCueActionPair)
|
||||
// TriList.UShortOutput[uo.Cue.Number].UserObject = uo;
|
||||
// else if (uo is StringCueActionPair)
|
||||
// TriList.StringOutput[uo.Cue.Number].UserObject = uo;
|
||||
// }
|
||||
|
||||
// return true;
|
||||
// }
|
||||
|
||||
// //public void SetCurrentRoom(EssentialsRoom room)
|
||||
// //{
|
||||
// // if (CurrentRoom != null)
|
||||
// // HideRoomUI();
|
||||
// // CurrentRoom = room;
|
||||
// // ShowRoomUI();
|
||||
// //}
|
||||
|
||||
// /// <summary>
|
||||
// ///
|
||||
// /// </summary>
|
||||
// /// <param name="room"></param>
|
||||
// public void SetCurrentRoom(EssentialsRoom room)
|
||||
// {
|
||||
// if (CurrentRoom == room) return;
|
||||
|
||||
// IVolumeFunctions oldAudio = null;
|
||||
// //Disconnect current room and audio device
|
||||
// if (CurrentRoom != null)
|
||||
// {
|
||||
// HideRoomUI();
|
||||
// CurrentRoom.AudioDeviceWillChange -= CurrentRoom_AudioDeviceWillChange;
|
||||
// CurrentRoom.PresentationSourceChange -= CurrentRoom_PresentationSourceChange;
|
||||
// oldAudio = CurrentRoom.CurrentAudioDevice;
|
||||
// }
|
||||
|
||||
// CurrentRoom = room;
|
||||
// IVolumeFunctions newAudio = null;
|
||||
// if (CurrentRoom != null)
|
||||
// {
|
||||
// CurrentRoom.AudioDeviceWillChange += this.CurrentRoom_AudioDeviceWillChange;
|
||||
// CurrentRoom.PresentationSourceChange += this.CurrentRoom_PresentationSourceChange;
|
||||
// SetControlSource(CurrentRoom.CurrentPresentationSource);
|
||||
// newAudio = CurrentRoom.CurrentAudioDevice;
|
||||
// ShowRoomUI();
|
||||
// }
|
||||
|
||||
// SwapAudioDeviceControls(oldAudio, newAudio);
|
||||
// }
|
||||
|
||||
// /// <summary>
|
||||
// /// Detaches and attaches an IVolumeFunctions device to the appropriate TP TriList signals.
|
||||
// /// This will also add IVolumeNumeric if the device implements it.
|
||||
// /// Overriding classes should call this. Overriding classes are responsible for
|
||||
// /// linking up to hard keys, etc.
|
||||
// /// </summary>
|
||||
// /// <param name="oldDev">May be null</param>
|
||||
// /// <param name="newDev">May be null</param>
|
||||
// protected virtual void SwapAudioDeviceControls(IVolumeFunctions oldDev, IVolumeFunctions newDev)
|
||||
// {
|
||||
// // Disconnect
|
||||
// if (oldDev != null)
|
||||
// {
|
||||
// TriList.BooleanOutput[CommonBoolCue.VolumeDown.Number].UserObject = null;
|
||||
// TriList.BooleanOutput[CommonBoolCue.VolumeUp.Number].UserObject = null;
|
||||
// TriList.BooleanOutput[CommonBoolCue.MuteToggle.Number].UserObject = null;
|
||||
// TriList.BooleanInput[CommonBoolCue.ShowVolumeButtons.Number].BoolValue = false;
|
||||
// TriList.BooleanInput[CommonBoolCue.ShowVolumeSlider.Number].BoolValue = false;
|
||||
// if (oldDev is IVolumeTwoWay)
|
||||
// {
|
||||
// TriList.UShortOutput[CommonIntCue.MainVolumeLevel.Number].UserObject = null;
|
||||
// (oldDev as IVolumeTwoWay).IsMutedFeedback
|
||||
// .UnlinkInputSig(TriList.BooleanInput[CommonBoolCue.MuteOn.Number]);
|
||||
// (oldDev as IVolumeTwoWay).VolumeLevelFeedback
|
||||
// .UnlinkInputSig(TriList.UShortInput[CommonIntCue.MainVolumeLevel.Number]);
|
||||
// }
|
||||
// }
|
||||
// if (newDev != null)
|
||||
// {
|
||||
// TriList.BooleanInput[CommonBoolCue.ShowVolumeSlider.Number].BoolValue = true;
|
||||
// TriList.BooleanOutput[CommonBoolCue.VolumeDown.Number].UserObject = newDev.VolumeDownCueActionPair;
|
||||
// TriList.BooleanOutput[CommonBoolCue.VolumeUp.Number].UserObject = newDev.VolumeUpCueActionPair;
|
||||
// TriList.BooleanOutput[CommonBoolCue.MuteToggle.Number].UserObject = newDev.MuteToggleCueActionPair;
|
||||
// if (newDev is IVolumeTwoWay)
|
||||
// {
|
||||
// TriList.BooleanInput[CommonBoolCue.ShowVolumeSlider.Number].BoolValue = true;
|
||||
// var numDev = newDev as IVolumeTwoWay;
|
||||
// TriList.UShortOutput[CommonIntCue.MainVolumeLevel.Number].UserObject = numDev.VolumeLevelCueActionPair;
|
||||
// numDev.VolumeLevelFeedback
|
||||
// .LinkInputSig(TriList.UShortInput[CommonIntCue.MainVolumeLevel.Number]);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
// /// <summary>
|
||||
// /// Does nothing. Override to add functionality when calling SetCurrentRoom
|
||||
// /// </summary>
|
||||
// protected virtual void HideRoomUI() { }
|
||||
|
||||
// /// <summary>
|
||||
// /// Does nothing. Override to add functionality when calling SetCurrentRoom
|
||||
// /// </summary>
|
||||
// protected virtual void ShowRoomUI() { }
|
||||
|
||||
// /// <summary>
|
||||
// /// Sets up the current presentation device and updates statuses if the device is capable.
|
||||
// /// </summary>
|
||||
// protected void SetControlSource(IPresentationSource newSource)
|
||||
// {
|
||||
// if (CurrentPresentationControlDevice != null)
|
||||
// {
|
||||
// HideCurrentPresentationSourceUi();
|
||||
|
||||
// // Unhook presses and things
|
||||
// if (CurrentPresentationControlDevice is IHasCueActionList)
|
||||
// {
|
||||
// foreach (var uo in (CurrentPresentationControlDevice as IHasCueActionList).CueActionList)
|
||||
// {
|
||||
// if (uo.Cue.Number == 0) continue;
|
||||
// if (uo is BoolCueActionPair)
|
||||
// {
|
||||
// var bSig = TriList.BooleanOutput[uo.Cue.Number];
|
||||
// // Disconnection should also clear bool sigs in case they are pressed and
|
||||
// // might be orphaned
|
||||
// if (bSig.BoolValue)
|
||||
// (bSig.UserObject as BoolCueActionPair).Invoke(false);
|
||||
// bSig.UserObject = null;
|
||||
// }
|
||||
// else if (uo is UShortCueActionPair)
|
||||
// TriList.UShortOutput[uo.Cue.Number].UserObject = null;
|
||||
// else if (uo is StringCueActionPair)
|
||||
// TriList.StringOutput[uo.Cue.Number].UserObject = null;
|
||||
// }
|
||||
// }
|
||||
// // unhook outputs
|
||||
// if (CurrentPresentationControlDevice is IHasFeedback)
|
||||
// {
|
||||
// foreach (var output in (CurrentPresentationControlDevice as IHasFeedback).Feedbacks)
|
||||
// {
|
||||
// if (output.Cue.Number == 0) continue;
|
||||
// if (output is BoolFeedback)
|
||||
// (output as BoolFeedback).UnlinkInputSig(TriList.BooleanInput[output.Cue.Number]);
|
||||
// else if (output is IntFeedback)
|
||||
// (output as IntFeedback).UnlinkInputSig(TriList.UShortInput[output.Cue.Number]);
|
||||
// else if (output is StringFeedback)
|
||||
// (output as StringFeedback).UnlinkInputSig(TriList.StringInput[output.Cue.Number]);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// CurrentPresentationControlDevice = newSource;
|
||||
// //connect presses and things
|
||||
// if (newSource is IHasCueActionList) // This has functions, get 'em
|
||||
// {
|
||||
// foreach (var ao in (newSource as IHasCueActionList).CueActionList)
|
||||
// {
|
||||
// if (ao.Cue.Number == 0) continue;
|
||||
// if (ao is BoolCueActionPair)
|
||||
// TriList.BooleanOutput[ao.Cue.Number].UserObject = ao;
|
||||
// else if (ao is UShortCueActionPair)
|
||||
// TriList.UShortOutput[ao.Cue.Number].UserObject = ao;
|
||||
// else if (ao is StringCueActionPair)
|
||||
// TriList.StringOutput[ao.Cue.Number].UserObject = ao;
|
||||
// }
|
||||
// }
|
||||
// // connect outputs (addInputSig should update sig)
|
||||
// if (CurrentPresentationControlDevice is IHasFeedback)
|
||||
// {
|
||||
// foreach (var output in (CurrentPresentationControlDevice as IHasFeedback).Feedbacks)
|
||||
// {
|
||||
// if (output.Cue.Number == 0) continue;
|
||||
// if (output is BoolFeedback)
|
||||
// (output as BoolFeedback).LinkInputSig(TriList.BooleanInput[output.Cue.Number]);
|
||||
// else if (output is IntFeedback)
|
||||
// (output as IntFeedback).LinkInputSig(TriList.UShortInput[output.Cue.Number]);
|
||||
// else if (output is StringFeedback)
|
||||
// (output as StringFeedback).LinkInputSig(TriList.StringInput[output.Cue.Number]);
|
||||
// }
|
||||
// }
|
||||
// ShowCurrentPresentationSourceUi();
|
||||
// }
|
||||
|
||||
// /// <summary>
|
||||
// /// Reveals the basic UI for the current device
|
||||
// /// </summary>
|
||||
// protected virtual void ShowCurrentPresentationSourceUi()
|
||||
// {
|
||||
// }
|
||||
|
||||
// /// <summary>
|
||||
// /// Hides the UI for the current device and calls for a feedback signal cleanup
|
||||
// /// </summary>
|
||||
// protected virtual void HideCurrentPresentationSourceUi()
|
||||
// {
|
||||
// }
|
||||
|
||||
|
||||
// /// <summary>
|
||||
// ///
|
||||
// /// </summary>
|
||||
// void CurrentRoom_PresentationSourceChange(object sender, EssentialsRoomSourceChangeEventArgs args)
|
||||
// {
|
||||
// SetControlSource(args.NewSource);
|
||||
// }
|
||||
|
||||
|
||||
// /// <summary>
|
||||
// ///
|
||||
// /// </summary>
|
||||
// void CurrentRoom_AudioDeviceWillChange(object sender, EssentialsRoomAudioDeviceChangeEventArgs e)
|
||||
// {
|
||||
// SwapAudioDeviceControls(e.OldDevice, e.NewDevice);
|
||||
// }
|
||||
|
||||
|
||||
|
||||
// /// <summary>
|
||||
// /// Panel event handler
|
||||
// /// </summary>
|
||||
// void Tsw_AnySigChange(object currentDevice, SigEventArgs args)
|
||||
// {
|
||||
// // plugged in commands
|
||||
// object uo = args.Sig.UserObject;
|
||||
|
||||
// if (uo is Action<bool>)
|
||||
// (uo as Action<bool>)(args.Sig.BoolValue);
|
||||
// else if (uo is Action<ushort>)
|
||||
// (uo as Action<ushort>)(args.Sig.UShortValue);
|
||||
// else if (uo is Action<string>)
|
||||
// (uo as Action<string>)(args.Sig.StringValue);
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
@@ -1,20 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro;
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
public static class VideoStatusCues
|
||||
{
|
||||
public static readonly Cue HasVideoStatusFeedback = Cue.BoolCue("HasVideoStatusFeedback", 1);
|
||||
public static readonly Cue VideoSyncFeedback = Cue.BoolCue("VideoSyncFeedback", 2);
|
||||
public static readonly Cue HdcpActiveFeedback = Cue.BoolCue("HdcpActiveFeedback", 3);
|
||||
public static readonly Cue HdcpStateFeedback = Cue.StringCue("HdcpStateFeedback", 3);
|
||||
public static readonly Cue VideoResolutionFeedback = Cue.StringCue("VideoResolutionFeedback", 2);
|
||||
public static readonly Cue VideoStatusDeviceKey = Cue.StringCue("VideoStatusDeviceKey", 0);
|
||||
public static readonly Cue VideoStatusDeviceName = Cue.StringCue("VideoStatusDeviceName", 4);
|
||||
}
|
||||
}
|
||||
@@ -1,62 +0,0 @@
|
||||
//using System;
|
||||
//using System.Collections.Generic;
|
||||
//using System.Linq;
|
||||
//using System.Text;
|
||||
//using Crestron.SimplSharp;
|
||||
//using Crestron.SimplSharpPro;
|
||||
//using Crestron.SimplSharpPro.DeviceSupport;
|
||||
//using Crestron.SimplSharpPro.DM;
|
||||
//using Crestron.SimplSharpPro.DM.Cards;
|
||||
|
||||
//using PepperDash.Essentials.Core;
|
||||
//using PepperDash.Essentials.DM;
|
||||
|
||||
//namespace PepperDash.Essentials.DM.Cards
|
||||
//{
|
||||
// public class DmInputCardControllerBase : IRoutingInputsOutputs
|
||||
// {
|
||||
// public string Key { get; private set; }
|
||||
// public uint Slot { get; private set; }
|
||||
// public abstract eDmInputCardType Type { get; }
|
||||
|
||||
// //public RoutingOutputPort BackplaneVideoOut { get; private set; }
|
||||
// //public RoutingOutputPort BackplaneAudioOut { get; private set; }
|
||||
|
||||
// public RoutingPortCollection<RoutingInputPort> InputPorts { get; private set; }
|
||||
|
||||
// public RoutingPortCollection<RoutingOutputPort> OutputPorts { get; private set; }
|
||||
|
||||
// public DmInputCardControllerBase(string key, uint slot)
|
||||
// {
|
||||
// Key = key;
|
||||
// Slot = slot;
|
||||
// //BackplaneAudioOut = new RoutingOutputPort("backplaneAudioOut", eRoutingSignalType.Audio,
|
||||
// // eRoutingPortConnectionType.BackplaneOnly, slot, this);
|
||||
// //BackplaneVideoOut = new RoutingOutputPort("backplaneVideoOut", eRoutingSignalType.Video,
|
||||
// // eRoutingPortConnectionType.BackplaneOnly, slot, this);
|
||||
// //InputPorts = new RoutingPortCollection<RoutingInputPort>();
|
||||
// //OutputPorts = new RoutingPortCollection<RoutingOutputPort> { BackplaneAudioOut, BackplaneVideoOut };
|
||||
// }
|
||||
|
||||
// ///// <summary>
|
||||
// ///// Gets a physical port by name. Returns null if doesn't exist
|
||||
// ///// </summary>
|
||||
// //public RoutingInputPort GetInputPort(string key)
|
||||
// //{
|
||||
// // return InputPorts.FirstOrDefault(p => p.Key.Equals(key, StringComparison.OrdinalIgnoreCase));
|
||||
// //}
|
||||
|
||||
// ///// <summary>
|
||||
// ///// Gets a physical port by name. Returns null if doesn't exist
|
||||
// ///// </summary>
|
||||
// //public RoutingOutputPort GetOutputPort(string key)
|
||||
// //{
|
||||
// // return OutputPorts.FirstOrDefault(p => p.Key.Equals(key, StringComparison.OrdinalIgnoreCase));
|
||||
// //}
|
||||
// }
|
||||
|
||||
// public enum eDmInputCardType
|
||||
// {
|
||||
// None, DmcHd, DmcHdDsp, Dmc4kHd, Dmc4kHdDsp, Dmc4kC, Dmc4kCDsp
|
||||
// }
|
||||
//}
|
||||
@@ -1,79 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
using Crestron.SimplSharpPro.DM;
|
||||
using Crestron.SimplSharpPro.DM.Cards;
|
||||
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.DM;
|
||||
|
||||
namespace PepperDash.Essentials.DM.Cards
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public abstract class DmSingleOutputCardControllerBase// : IRoutingInputsOutputs
|
||||
{
|
||||
public string Key { get; private set; }
|
||||
public uint Slot { get; private set; }
|
||||
public abstract eDmOutputCardType Type { get; }
|
||||
|
||||
//public RoutingInputPort BackplaneAudioIn1 { get; private set; }
|
||||
//public RoutingInputPort BackplaneVideoIn1 { get; private set; }
|
||||
//public RoutingInputPort BackplaneAudioIn2 { get; private set; }
|
||||
//public RoutingInputPort BackplaneVideoIn2 { get; private set; }
|
||||
|
||||
//public RoutingPortCollection<RoutingInputPort> InputPorts { get; private set; }
|
||||
//public RoutingPortCollection<RoutingOutputPort> OutputPorts { get; private set; }
|
||||
|
||||
public DmSingleOutputCardControllerBase(string key, uint cardSlot)
|
||||
{
|
||||
Key = key;
|
||||
Slot = cardSlot;
|
||||
//BackplaneAudioIn1 = new RoutingInputPort("backplaneAudioIn1", eRoutingSignalType.Audio,
|
||||
// eRoutingPortConnectionType.BackplaneOnly, cardSlot, this);
|
||||
//BackplaneVideoIn1 = new RoutingInputPort("backplaneVideoIn1", eRoutingSignalType.Video,
|
||||
// eRoutingPortConnectionType.BackplaneOnly, cardSlot, this);
|
||||
//BackplaneAudioIn2 = new RoutingInputPort("backplaneAudioIn2", eRoutingSignalType.Audio,
|
||||
// eRoutingPortConnectionType.BackplaneOnly, cardSlot + 1, this);
|
||||
//BackplaneVideoIn2 = new RoutingInputPort("backplaneVideoIn2", eRoutingSignalType.Video,
|
||||
// eRoutingPortConnectionType.BackplaneOnly, cardSlot + 1, this);
|
||||
//InputPorts = new RoutingPortCollection<RoutingInputPort>
|
||||
//{
|
||||
// BackplaneAudioIn1,
|
||||
// BackplaneAudioIn2,
|
||||
// BackplaneVideoIn1,
|
||||
// BackplaneVideoIn2
|
||||
//};
|
||||
//OutputPorts = new RoutingPortCollection<RoutingOutputPort>();
|
||||
}
|
||||
|
||||
///// <summary>
|
||||
///// Gets a physical port by name. Returns null if doesn't exist
|
||||
///// </summary>
|
||||
//public RoutingInputPort GetInputPort(string key)
|
||||
//{
|
||||
// return InputPorts.FirstOrDefault(p => p.Key.Equals(key, StringComparison.OrdinalIgnoreCase));
|
||||
//}
|
||||
|
||||
///// <summary>
|
||||
///// Gets a physical port by name. Returns null if doesn't exist
|
||||
///// </summary>
|
||||
//public RoutingOutputPort GetOutputPort(string key)
|
||||
//{
|
||||
// return OutputPorts.FirstOrDefault(p => p.Key.Equals(key, StringComparison.OrdinalIgnoreCase));
|
||||
//}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public enum eDmOutputCardType
|
||||
{
|
||||
None, Dmc4kCoHd, Dmc4kHdo, DmcCoHd, DmcSoHd
|
||||
}
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
using Crestron.SimplSharpPro.DM;
|
||||
using Crestron.SimplSharpPro.DM.Cards;
|
||||
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.DM;
|
||||
|
||||
namespace PepperDash.Essentials.DM.Cards
|
||||
{
|
||||
public class Dmc4kCoHdSingleOutputCard : DmSingleOutputCardControllerBase
|
||||
{
|
||||
public override eDmOutputCardType Type
|
||||
{
|
||||
get { return eDmOutputCardType.Dmc4kCoHd; }
|
||||
}
|
||||
public Dmc4kCoHdSingle Card { get; private set; }
|
||||
|
||||
//public RoutingOutputPort DmOut1 { get; private set; }
|
||||
//public RoutingOutputPort DmOut2 { get; private set; }
|
||||
//public RoutingOutputPort HdmiOut1 { get; private set; }
|
||||
|
||||
public Dmc4kCoHdSingleOutputCard(string key, Dmc4kCoHdSingle card, uint slot)
|
||||
: base(key, slot)
|
||||
{
|
||||
Card = card;
|
||||
//DmOut1 = new RoutingOutputPort(DmPortName.DmOut1, eRoutingSignalType.AudioVideo,
|
||||
// eRoutingPortConnectionType.DmCat, null, this);
|
||||
//DmOut2 = new RoutingOutputPort(DmPortName.DmOut2, eRoutingSignalType.AudioVideo,
|
||||
// eRoutingPortConnectionType.DmCat, null, this);
|
||||
//HdmiOut1 = new RoutingOutputPort(DmPortName.HdmiOut1, eRoutingSignalType.AudioVideo,
|
||||
// eRoutingPortConnectionType.Hdmi, null, this);
|
||||
|
||||
//OutputPorts.AddRange(new[] { DmOut1, DmOut2, HdmiOut1 });
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
//using System;
|
||||
//using System.Collections.Generic;
|
||||
//using System.Linq;
|
||||
//using System.Text;
|
||||
//using Crestron.SimplSharp;
|
||||
//using Crestron.SimplSharpPro;
|
||||
//using Crestron.SimplSharpPro.DeviceSupport;
|
||||
//using Crestron.SimplSharpPro.DM;
|
||||
//using Crestron.SimplSharpPro.DM.Cards;
|
||||
|
||||
//using PepperDash.Core;
|
||||
//using PepperDash.Essentials.Core;
|
||||
//using PepperDash.Essentials.DM;
|
||||
|
||||
//namespace PepperDash.Essentials.DM.Cards
|
||||
//{
|
||||
// public class Dmc4kHdoSingleOutputCard : DmSingleOutputCardControllerBase
|
||||
// {
|
||||
// public override eDmOutputCardType Type
|
||||
// {
|
||||
// get { return eDmOutputCardType.Dmc4kHdo; }
|
||||
// }
|
||||
// public Dmc4kHdoSingle Card { get; private set; }
|
||||
|
||||
// //public RoutingOutputPort AudioOut1 { get; private set; }
|
||||
// //public RoutingOutputPort AudioOut2 { get; private set; }
|
||||
// //public RoutingOutputPort HdmiOut1 { get; private set; }
|
||||
// //public RoutingOutputPort HdmiOut2 { get; private set; }
|
||||
|
||||
// public Dmc4kHdoSingleOutputCard(string key, Dmc4kHdoSingle card, uint slot)
|
||||
// : base(key, slot)
|
||||
// {
|
||||
// Card = card;
|
||||
// //AudioOut1 = new RoutingOutputPort(DmPortName.BalancedAudioOut1, eRoutingSignalType.Audio,
|
||||
// // eRoutingPortConnectionType.LineAudio, null, this);
|
||||
// //AudioOut2 = new RoutingOutputPort(DmPortName.BalancedAudioOut2, eRoutingSignalType.Audio,
|
||||
// // eRoutingPortConnectionType.LineAudio, null, this);
|
||||
// //HdmiOut1 = new RoutingOutputPort(DmPortName.HdmiOut1, eRoutingSignalType.AudioVideo,
|
||||
// // eRoutingPortConnectionType.Hdmi, null, this);
|
||||
// //HdmiOut2 = new RoutingOutputPort(DmPortName.HdmiOut2, eRoutingSignalType.AudioVideo,
|
||||
// // eRoutingPortConnectionType.Hdmi, null, this);
|
||||
|
||||
// //OutputPorts.AddRange(new[] { AudioOut1, AudioOut2, HdmiOut1, HdmiOut2 });
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
@@ -1,76 +0,0 @@
|
||||
//using System;
|
||||
//using System.Collections.Generic;
|
||||
//using System.Linq;
|
||||
//using System.Text;
|
||||
//using Crestron.SimplSharp;
|
||||
//using Crestron.SimplSharpPro;
|
||||
//using Crestron.SimplSharpPro.DeviceSupport;
|
||||
//using Crestron.SimplSharpPro.DM;
|
||||
//using Crestron.SimplSharpPro.DM.Cards;
|
||||
|
||||
//using PepperDash.Essentials.Core;
|
||||
//using PepperDash.Essentials.DM;
|
||||
|
||||
//namespace PepperDash.Essentials.DM.Cards
|
||||
//{
|
||||
// public class Dmc4kCController : DmInputCardControllerBase
|
||||
// {
|
||||
// public override eDmInputCardType Type
|
||||
// {
|
||||
// get { return eDmInputCardType.Dmc4kC; }
|
||||
// }
|
||||
// public Dmc4kC Card { get; private set; }
|
||||
|
||||
// //public RoutingInputPortWithVideoStatuses DmIn { get; private set; }
|
||||
// //public RoutingOutputPort HdmiLoopOut { get; private set; }
|
||||
// //public RoutingOutputPort AudioLoopOut { get; private set; }
|
||||
|
||||
// public Dmc4kCController(string key, Dmc4kC card, uint slot)
|
||||
// : base(key, slot)
|
||||
// {
|
||||
// Card = card;
|
||||
// //DmIn = new RoutingInputPortWithVideoStatuses(DmPortName.DmIn, eRoutingSignalType.AudioVideo,
|
||||
// // eRoutingPortConnectionType.DmCat, null, this,
|
||||
// // VideoStatusHelper.GetDmInputStatusFuncs(Card.DmInput));
|
||||
|
||||
// //HdmiLoopOut = new RoutingOutputPort(DmPortName.HdmiLoopOut, eRoutingSignalType.AudioVideo,
|
||||
// // eRoutingPortConnectionType.Hdmi, null, this);
|
||||
// //AudioLoopOut = new RoutingOutputPort(DmPortName.AudioLoopOut, eRoutingSignalType.Audio,
|
||||
// // eRoutingPortConnectionType.Hdmi, null, this);
|
||||
|
||||
// //InputPorts.Add(DmIn);
|
||||
// //OutputPorts.AddRange(new[] { HdmiLoopOut, AudioLoopOut });
|
||||
// }
|
||||
// }
|
||||
|
||||
// public class Dmc4kCDspController : DmInputCardControllerBase
|
||||
// {
|
||||
// public override eDmInputCardType Type
|
||||
// {
|
||||
// get { return eDmInputCardType.Dmc4kCDsp; }
|
||||
// }
|
||||
// public Dmc4kCDsp Card { get; private set; }
|
||||
|
||||
// //public RoutingInputPortWithVideoStatuses DmIn { get; private set; }
|
||||
// //public RoutingOutputPort HdmiLoopOut { get; private set; }
|
||||
// //public RoutingOutputPort AudioLoopOut { get; private set; }
|
||||
|
||||
// public Dmc4kCDspController(string key, Dmc4kCDsp card, uint slot)
|
||||
// : base(key, slot)
|
||||
// {
|
||||
// Card = card;
|
||||
// //DmIn = new RoutingInputPortWithVideoStatuses(DmPortName.DmIn, eRoutingSignalType.AudioVideo,
|
||||
// // eRoutingPortConnectionType.DmCat, null, this,
|
||||
// // VideoStatusHelper.GetDmInputStatusFuncs(Card.DmInput));
|
||||
|
||||
// //HdmiLoopOut = new RoutingOutputPort(DmPortName.HdmiLoopOut, eRoutingSignalType.AudioVideo,
|
||||
// // eRoutingPortConnectionType.Hdmi, null, this);
|
||||
// //AudioLoopOut = new RoutingOutputPort(DmPortName.AudioLoopOut, eRoutingSignalType.Audio,
|
||||
// // eRoutingPortConnectionType.Hdmi, null, this);
|
||||
|
||||
// //InputPorts.Add(DmIn);
|
||||
// //OutputPorts.AddRange(new[] { HdmiLoopOut, AudioLoopOut });
|
||||
// }
|
||||
// }
|
||||
|
||||
//}
|
||||
@@ -1,82 +0,0 @@
|
||||
//using System;
|
||||
//using System.Collections.Generic;
|
||||
//using System.Linq;
|
||||
//using System.Text;
|
||||
//using Crestron.SimplSharp;
|
||||
//using Crestron.SimplSharpPro;
|
||||
//using Crestron.SimplSharpPro.DeviceSupport;
|
||||
//using Crestron.SimplSharpPro.DM;
|
||||
//using Crestron.SimplSharpPro.DM.Cards;
|
||||
|
||||
//using PepperDash.Essentials.Core;
|
||||
//using PepperDash.Essentials.DM;
|
||||
|
||||
//namespace PepperDash.Essentials.DM.Cards
|
||||
//{
|
||||
// /// <summary>
|
||||
// ///
|
||||
// /// </summary>
|
||||
// public class Dmc4kHdController : DmInputCardControllerBase
|
||||
// {
|
||||
// public Dmc4kHd Card { get; private set; }
|
||||
// public override eDmInputCardType Type
|
||||
// {
|
||||
// get { return eDmInputCardType.Dmc4kHd; }
|
||||
// }
|
||||
|
||||
// public RoutingInputPortWithVideoStatuses HdmiIn { get; private set; }
|
||||
// public RoutingOutputPort HdmiLoopOut { get; private set; }
|
||||
// public RoutingOutputPort AudioLoopOut { get; private set; }
|
||||
|
||||
// public Dmc4kHdController(string key, Dmc4kHd card, uint slot)
|
||||
// : base(key, slot)
|
||||
// {
|
||||
// Card = card;
|
||||
// HdmiIn = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn, eRoutingSignalType.AudioVideo,
|
||||
// eRoutingPortConnectionType.Hdmi, null, this,
|
||||
// VideoStatusHelper.GetHdmiInputStatusFuncs(Card.HdmiInput));
|
||||
|
||||
// HdmiLoopOut = new RoutingOutputPort(DmPortName.HdmiLoopOut, eRoutingSignalType.AudioVideo,
|
||||
// eRoutingPortConnectionType.Hdmi, null, this);
|
||||
// AudioLoopOut = new RoutingOutputPort(DmPortName.AudioLoopOut, eRoutingSignalType.Audio,
|
||||
// eRoutingPortConnectionType.Hdmi, null, this);
|
||||
|
||||
// InputPorts.Add(HdmiIn);
|
||||
// OutputPorts.AddRange(new[] { HdmiLoopOut, AudioLoopOut });
|
||||
// }
|
||||
// }
|
||||
|
||||
// /// <summary>
|
||||
// ///
|
||||
// /// </summary>
|
||||
// public class Dmc4kHdDspController : DmInputCardControllerBase
|
||||
// {
|
||||
// public Dmc4kHdDsp Card { get; private set; }
|
||||
// public override eDmInputCardType Type
|
||||
// {
|
||||
// get { return eDmInputCardType.Dmc4kHdDsp; }
|
||||
// }
|
||||
|
||||
// //public RoutingInputPortWithVideoStatuses HdmiIn { get; private set; }
|
||||
// //public RoutingOutputPort HdmiLoopOut { get; private set; }
|
||||
// //public RoutingOutputPort AudioLoopOut { get; private set; }
|
||||
|
||||
// public Dmc4kHdDspController(string key, Dmc4kHdDsp card, uint slot)
|
||||
// : base(key, slot)
|
||||
// {
|
||||
// Card = card;
|
||||
// //HdmiIn = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn, eRoutingSignalType.AudioVideo,
|
||||
// // eRoutingPortConnectionType.Hdmi, null, this,
|
||||
// // VideoStatusHelper.GetHdmiInputStatusFuncs(Card.HdmiInput));
|
||||
|
||||
// //HdmiLoopOut = new RoutingOutputPort(DmPortName.HdmiLoopOut, eRoutingSignalType.AudioVideo,
|
||||
// // eRoutingPortConnectionType.Hdmi, null, this);
|
||||
// //AudioLoopOut = new RoutingOutputPort(DmPortName.AudioLoopOut, eRoutingSignalType.Audio,
|
||||
// // eRoutingPortConnectionType.Hdmi, null, this);
|
||||
|
||||
// //InputPorts.Add(HdmiIn);
|
||||
// //OutputPorts.AddRange(new[] { HdmiLoopOut, AudioLoopOut });
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
@@ -1,569 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro;
|
||||
using Crestron.SimplSharpPro.DM;
|
||||
using Crestron.SimplSharpPro.DM.Cards;
|
||||
using Crestron.SimplSharpPro.DM.Endpoints;
|
||||
using Crestron.SimplSharpPro.DM.Endpoints.Receivers;
|
||||
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.DM.Cards;
|
||||
|
||||
using PepperDash.Essentials.DM.Config;
|
||||
|
||||
namespace PepperDash.Essentials.DM
|
||||
{
|
||||
/// <summary>
|
||||
/// Builds a controller for basic DM-RMCs with Com and IR ports and no control functions
|
||||
///
|
||||
/// </summary>
|
||||
public class DmChassisController : CrestronGenericBaseDevice, IRoutingInputsOutputs, IRouting//, ICardPortsDevice
|
||||
{
|
||||
public DmMDMnxn Chassis { get; private set; }
|
||||
|
||||
// Need a couple Lists of generic Backplane ports
|
||||
public RoutingPortCollection<RoutingInputPort> InputPorts { get; private set; }
|
||||
public RoutingPortCollection<RoutingOutputPort> OutputPorts { get; private set; }
|
||||
|
||||
//public Dictionary<uint, DmInputCardControllerBase> InputCards { get; private set; }
|
||||
//public Dictionary<uint, DmSingleOutputCardControllerBase> OutputCards { get; private set; }
|
||||
|
||||
public Dictionary<uint, string> InputNames { get; set; }
|
||||
public Dictionary<uint, string> OutputNames { get; set; }
|
||||
public Dictionary<uint, DmCardAudioOutputController> VolumeControls { get; private set; }
|
||||
|
||||
public const int RouteOffTime = 500;
|
||||
Dictionary<PortNumberType, CTimer> RouteOffTimers = new Dictionary<PortNumberType, CTimer>();
|
||||
|
||||
/// <summary>
|
||||
/// Factory method to create a new chassis controller from config data. Limited to 8x8 right now
|
||||
/// </summary>
|
||||
public static DmChassisController GetDmChassisController(string key, string name,
|
||||
string type, DMChassisPropertiesConfig properties)
|
||||
{
|
||||
try
|
||||
{
|
||||
type = type.ToLower();
|
||||
uint ipid = properties.Control.IpIdInt; // Convert.ToUInt16(properties.Id, 16);
|
||||
DmChassisController controller = null;
|
||||
if (type == "dmmd8x8")
|
||||
{
|
||||
controller = new DmChassisController(key, name, new DmMd8x8(ipid, Global.ControlSystem));
|
||||
// add the cards and port names
|
||||
foreach (var kvp in properties.InputSlots)
|
||||
controller.AddInputCard(kvp.Value, kvp.Key);
|
||||
foreach (var kvp in properties.OutputSlots)
|
||||
controller.AddOutputCard(kvp.Value, kvp.Key);
|
||||
foreach (var kvp in properties.VolumeControls)
|
||||
{
|
||||
// get the card
|
||||
// check it for an audio-compatible type
|
||||
// make a something-something that will make it work
|
||||
// retire to mountain village
|
||||
var outNum = kvp.Key;
|
||||
var card = controller.Chassis.Outputs[outNum].Card;
|
||||
Audio.Output audio = null;
|
||||
if (card is DmcHdo)
|
||||
audio = (card as DmcHdo).Audio;
|
||||
else if (card is Dmc4kHdo)
|
||||
audio = (card as Dmc4kHdo).Audio;
|
||||
if (audio == null)
|
||||
continue;
|
||||
// wire up the audio to something here...
|
||||
controller.AddVolumeControl(outNum, audio);
|
||||
}
|
||||
|
||||
controller.InputNames = properties.InputNames;
|
||||
controller.OutputNames = properties.OutputNames;
|
||||
return controller;
|
||||
}
|
||||
}
|
||||
catch (System.Exception e)
|
||||
{
|
||||
Debug.Console(0, "Error creating DM chassis:\r{0}", e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="key"></param>
|
||||
/// <param name="name"></param>
|
||||
/// <param name="chassis"></param>
|
||||
public DmChassisController(string key, string name, DmMDMnxn chassis)
|
||||
: base(key, name, chassis)
|
||||
{
|
||||
Chassis = chassis;
|
||||
InputPorts = new RoutingPortCollection<RoutingInputPort>();
|
||||
OutputPorts = new RoutingPortCollection<RoutingOutputPort>();
|
||||
VolumeControls = new Dictionary<uint, DmCardAudioOutputController>();
|
||||
IsOnline.OutputChange += new EventHandler<EventArgs>(IsOnline_OutputChange);
|
||||
Chassis.DMOutputChange += new DMOutputEventHandler(Chassis_DMOutputChange);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="type"></param>
|
||||
/// <param name="number"></param>
|
||||
public void AddInputCard(string type, uint number)
|
||||
{
|
||||
Debug.Console(2, this, "Adding input card '{0}', slot {1}", type, number);
|
||||
if (type == "dmc4kHd")
|
||||
{
|
||||
new Dmc4kHd(number, this.Chassis);
|
||||
AddHdmiInCardPorts(number);
|
||||
}
|
||||
else if (type == "dmc4kHdDsp")
|
||||
{
|
||||
new Dmc4kHdDsp(number, this.Chassis);
|
||||
AddHdmiInCardPorts(number);
|
||||
}
|
||||
else if (type == "dmc4kC")
|
||||
{
|
||||
new Dmc4kC(number, this.Chassis);
|
||||
AddDmInCardPorts(number);
|
||||
}
|
||||
else if (type == "dmc4kCDsp")
|
||||
{
|
||||
new Dmc4kCDsp(number, this.Chassis);
|
||||
AddDmInCardPorts(number);
|
||||
}
|
||||
else if (type == "dmcHd")
|
||||
{
|
||||
new DmcHd(number, this.Chassis);
|
||||
AddHdmiInCardPorts(number);
|
||||
}
|
||||
else if (type == "dmcHdDsp")
|
||||
{
|
||||
new DmcHdDsp(number, this.Chassis);
|
||||
AddHdmiInCardPorts(number);
|
||||
}
|
||||
|
||||
else if (type == "dmcC")
|
||||
{
|
||||
new DmcC(number, this.Chassis);
|
||||
AddDmInCardPorts(number);
|
||||
}
|
||||
else if (type == "dmcCDsp")
|
||||
{
|
||||
new DmcCDsp(number, this.Chassis);
|
||||
AddDmInCardPorts(number);
|
||||
}
|
||||
else if (type == "dmcS")
|
||||
{
|
||||
new DmcS(number, Chassis);
|
||||
AddInputPortWithDebug(number, "dmIn", eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.DmMmFiber);
|
||||
AddInCardLoopPorts(number);
|
||||
}
|
||||
else if (type == "dmcSDsp")
|
||||
{
|
||||
new DmcSDsp(number, Chassis);
|
||||
AddInputPortWithDebug(number, "dmIn", eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.DmMmFiber);
|
||||
AddInCardLoopPorts(number);
|
||||
}
|
||||
else if (type == "dmcS2")
|
||||
{
|
||||
new DmcS2(number, Chassis);
|
||||
AddInputPortWithDebug(number, "dmIn", eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.DmSmFiber);
|
||||
AddInCardLoopPorts(number);
|
||||
}
|
||||
else if (type == "dmcS2Dsp")
|
||||
{
|
||||
new DmcS2Dsp(number, Chassis);
|
||||
AddInputPortWithDebug(number, "dmIn", eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.DmSmFiber);
|
||||
AddInCardLoopPorts(number);
|
||||
}
|
||||
else if (type == "dmcSdi")
|
||||
{
|
||||
new DmcSdi(number, Chassis);
|
||||
AddInputPortWithDebug(number, "sdiIn", eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.Sdi);
|
||||
AddOutputPortWithDebug(number, "sdiOut", eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.Sdi, null);
|
||||
AddInCardLoopPorts(number);
|
||||
}
|
||||
}
|
||||
|
||||
void AddDmInCardPorts(uint number)
|
||||
{
|
||||
AddInputPortWithDebug(number, "dmIn", eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.DmCat);
|
||||
AddInCardLoopPorts(number);
|
||||
}
|
||||
|
||||
void AddHdmiInCardPorts(uint number)
|
||||
{
|
||||
AddInputPortWithDebug(number, "hdmiIn", eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.Hdmi);
|
||||
AddInCardLoopPorts(number);
|
||||
}
|
||||
|
||||
void AddInCardLoopPorts(uint number)
|
||||
{
|
||||
AddOutputPortWithDebug(number, "hdmiLoopOut", eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.Hdmi, null);
|
||||
AddOutputPortWithDebug(number, "audioLoopOut", eRoutingSignalType.Audio, eRoutingPortConnectionType.Hdmi, null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="type"></param>
|
||||
/// <param name="number"></param>
|
||||
public void AddOutputCard(string type, uint number)
|
||||
{
|
||||
Debug.Console(2, this, "Adding output card '{0}', slot {1}", type, number);
|
||||
if (type == "dmc4kHdo")
|
||||
{
|
||||
new Dmc4kHdoSingle(number, Chassis);
|
||||
AddDmcHdoPorts(number);
|
||||
}
|
||||
else if (type == "dmcHdo")
|
||||
{
|
||||
new DmcHdoSingle(number, Chassis);
|
||||
AddDmcHdoPorts(number);
|
||||
}
|
||||
else if (type == "dmc4kCoHd")
|
||||
{
|
||||
new Dmc4kCoHdSingle(number, Chassis);
|
||||
AddDmcCoPorts(number);
|
||||
}
|
||||
else if (type == "dmcCoHd")
|
||||
{
|
||||
new DmcCoHdSingle(number, Chassis);
|
||||
AddDmcCoPorts(number);
|
||||
}
|
||||
else if (type == "dmcSoHd")
|
||||
{
|
||||
new DmcSoHdSingle(number, Chassis);
|
||||
AddOutputPortWithDebug(number, "dmOut1", eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.DmMmFiber, 2 * (number - 1) + 1);
|
||||
AddOutputPortWithDebug(number, "hdmiOut1", eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.Hdmi, 2 * (number - 1) + 1);
|
||||
AddOutputPortWithDebug(number, "dmOut2", eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.DmMmFiber, 2 * (number - 1) + 2);
|
||||
|
||||
}
|
||||
else if (type == "dmcS2oHd")
|
||||
{
|
||||
new DmcS2oHdSingle(number, Chassis);
|
||||
AddOutputPortWithDebug(number, "dmOut1", eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.DmSmFiber, 2 * (number - 1) + 1);
|
||||
AddOutputPortWithDebug(number, "hdmiOut1", eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.Hdmi, 2 * (number - 1) + 1);
|
||||
AddOutputPortWithDebug(number, "dmOut2", eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.DmSmFiber, 2 * (number - 1) + 2);
|
||||
}
|
||||
|
||||
else
|
||||
Debug.Console(1, this, " WARNING: Output card type '{0}' is not available", type);
|
||||
}
|
||||
|
||||
void AddDmcHdoPorts(uint number)
|
||||
{
|
||||
AddOutputPortWithDebug(number, "hdmiOut1", eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.Hdmi, 2 * (number - 1) + 1);
|
||||
AddOutputPortWithDebug(number, "audioOut1", eRoutingSignalType.Audio, eRoutingPortConnectionType.LineAudio, 2 * (number - 1) + 1);
|
||||
AddOutputPortWithDebug(number, "hdmiOut2", eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.Hdmi, 2 * (number - 1) + 2);
|
||||
AddOutputPortWithDebug(number, "audioOut2", eRoutingSignalType.Audio, eRoutingPortConnectionType.LineAudio, 2 * (number - 1) + 2);
|
||||
|
||||
}
|
||||
|
||||
void AddDmcCoPorts(uint number)
|
||||
{
|
||||
AddOutputPortWithDebug(number, "dmOut1", eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.DmCat, 2 * (number - 1) + 1);
|
||||
AddOutputPortWithDebug(number, "hdmiOut1", eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.Hdmi, 2 * (number - 1) + 1);
|
||||
AddOutputPortWithDebug(number, "dmOut2", eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.DmCat, 2 * (number - 1) + 2);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
void AddInputPortWithDebug(uint cardNum, string portName, eRoutingSignalType sigType, eRoutingPortConnectionType portType)
|
||||
{
|
||||
Debug.Console(2, this, " Adding input port '{0}'", portName);
|
||||
InputPorts.Add(new RoutingInputPort(string.Format("card{0}--{1}", cardNum, portName),
|
||||
sigType, portType, cardNum, this));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
void AddOutputPortWithDebug(uint cardNum, string portName, eRoutingSignalType sigType, eRoutingPortConnectionType portType, object selector)
|
||||
{
|
||||
Debug.Console(2, this, " Adding output port '{0}'", portName);
|
||||
OutputPorts.Add(new RoutingOutputPort(string.Format("card{0}--{1}", cardNum, portName),
|
||||
sigType, portType, selector, this));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
void AddVolumeControl(uint number, Audio.Output audio)
|
||||
{
|
||||
VolumeControls.Add(number, new DmCardAudioOutputController(audio));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
void Chassis_DMOutputChange(Switch device, DMOutputEventArgs args)
|
||||
{
|
||||
if (args.EventId == DMOutputEventIds.VolumeEventId &&
|
||||
VolumeControls.ContainsKey(args.Number))
|
||||
VolumeControls[args.Number].VolumeEventFromChassis();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="pnt"></param>
|
||||
void StartOffTimer(PortNumberType pnt)
|
||||
{
|
||||
if (RouteOffTimers.ContainsKey(pnt))
|
||||
return;
|
||||
RouteOffTimers[pnt] = new CTimer(o =>
|
||||
{
|
||||
ExecuteSwitch(0, pnt.Number, pnt.Type);
|
||||
}, RouteOffTime);
|
||||
}
|
||||
|
||||
// Send out sigs when coming online
|
||||
void IsOnline_OutputChange(object sender, EventArgs e)
|
||||
{
|
||||
if (IsOnline.BoolValue)
|
||||
{
|
||||
if (InputNames != null)
|
||||
foreach (var kvp in InputNames)
|
||||
Chassis.Inputs[kvp.Key].Name.StringValue = kvp.Value;
|
||||
if (OutputNames != null)
|
||||
foreach(var kvp in OutputNames)
|
||||
Chassis.Outputs[kvp.Key].Name.StringValue = kvp.Value;
|
||||
}
|
||||
}
|
||||
|
||||
#region IRouting Members
|
||||
|
||||
public void ExecuteSwitch(object inputSelector, object outputSelector, eRoutingSignalType sigType)
|
||||
{
|
||||
Debug.Console(0, this, "Making an awesome DM route from {0} to {1} {2}", inputSelector, outputSelector, sigType);
|
||||
|
||||
var input = Convert.ToUInt32(inputSelector); // Cast can sometimes fail
|
||||
var output = Convert.ToUInt32(outputSelector);
|
||||
// Check to see if there's an off timer waiting on this and if so, cancel
|
||||
var key = new PortNumberType(output, sigType);
|
||||
if (input == 0)
|
||||
{
|
||||
StartOffTimer(key);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(RouteOffTimers.ContainsKey(key))
|
||||
{
|
||||
Debug.Console(2, this, "{0} cancelling route off due to new source", output);
|
||||
RouteOffTimers[key].Stop();
|
||||
RouteOffTimers.Remove(key);
|
||||
}
|
||||
}
|
||||
|
||||
Card.DMICard inCard = input == 0 ? null : Chassis.Inputs[input];
|
||||
|
||||
// NOTE THAT THESE ARE NOTS - TO CATCH THE AudioVideo TYPE
|
||||
if (sigType != eRoutingSignalType.Audio)
|
||||
{
|
||||
Chassis.VideoEnter.BoolValue = true;
|
||||
Chassis.Outputs[output].VideoOut = inCard;
|
||||
}
|
||||
|
||||
if (sigType != eRoutingSignalType.Video)
|
||||
{
|
||||
Chassis.AudioEnter.BoolValue = true;
|
||||
Chassis.Outputs[output].AudioOut = inCard;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
// void AddInUseTrackerToPort(RoutingOutputPort port, eRoutingSignalType sigType)
|
||||
// {
|
||||
// port.InUseTracker.InUseFeedback.OutputChange += (o, a) =>
|
||||
// {
|
||||
//#warning Can we add something here that will de-route based on breakaway, or does it even matter?
|
||||
// if (!port.InUseTracker.InUseFeedback.BoolValue)
|
||||
// this.ExecuteSwitch(0, port.Selector, sigType);
|
||||
// };
|
||||
// }
|
||||
|
||||
|
||||
//[Obsolete]
|
||||
//public void AddInputCard(uint slot, eDmInputCardType type)
|
||||
//{
|
||||
// var cardKey = Key + "-inputCard" + slot;
|
||||
// switch (type)
|
||||
// {
|
||||
// case eDmInputCardType.Dmc4kHd:
|
||||
// InputCards[slot] = new Dmc4kHdController(cardKey,
|
||||
// new Dmc4kHd(slot, this.Chassis), slot);
|
||||
// break;
|
||||
// case eDmInputCardType.Dmc4kHdDsp:
|
||||
// InputCards[slot] = new Dmc4kHdDspController(cardKey,
|
||||
// new Dmc4kHdDsp(slot, this.Chassis), slot);
|
||||
// break;
|
||||
// case eDmInputCardType.Dmc4kC:
|
||||
// InputCards[slot] = new Dmc4kCController(cardKey,
|
||||
// new Dmc4kC(slot, this.Chassis), slot);
|
||||
// break;
|
||||
// case eDmInputCardType.Dmc4kCDsp:
|
||||
// InputCards[slot] = new Dmc4kCDspController(cardKey,
|
||||
// new Dmc4kCDsp(slot, this.Chassis), slot);
|
||||
// break;
|
||||
// }
|
||||
//}
|
||||
|
||||
//[Obsolete]
|
||||
//public void AddOutputCard(uint cardSlot, eDmOutputCardType type)
|
||||
//{
|
||||
// var cardKey = Key + "-outputCard" + cardSlot;
|
||||
// switch (type)
|
||||
// {
|
||||
// case eDmOutputCardType.Dmc4kCoHd:
|
||||
// OutputCards[cardSlot] = new Dmc4kCoHdSingleOutputCard(cardKey,
|
||||
// new Dmc4kCoHdSingle(cardSlot, this.Chassis), cardSlot);
|
||||
// break;
|
||||
// case eDmOutputCardType.DmcCoHd:
|
||||
// OutputCards[cardSlot] = new Dmc4kHdoSingleOutputCard(cardKey,
|
||||
// new Dmc4kHdoSingle(cardSlot, this.Chassis), cardSlot);
|
||||
// break;
|
||||
// default:
|
||||
// break;
|
||||
// }
|
||||
//}
|
||||
|
||||
///// <summary>
|
||||
///// Helper to get a specific port from a given attached card
|
||||
///// </summary>
|
||||
///// <param name="card">Named 'input-N' ('output-N' is not valid, as output cards have no inputs)</param>
|
||||
///// <param name="port">The port name on the card, for example 'hdmiOut'</param>
|
||||
///// <returns>Returns port or null if doesn't exist</returns>
|
||||
//public RoutingInputPort GetChildInputPort(string card, string port)
|
||||
//{
|
||||
// return GetChildPort(card, port, false) as RoutingInputPort;
|
||||
//}
|
||||
|
||||
///// <summary>
|
||||
///// Helper to get a specific port from a given attached card
|
||||
///// </summary>
|
||||
///// <param name="card">Named 'input-N' or 'output-N'</param>
|
||||
///// <param name="port">The port name on the card, for example 'hdmiOut'</param>
|
||||
///// <returns>Returns port or null if doesn't exist</returns>
|
||||
//public RoutingOutputPort GetChildOutputPort(string card, string port)
|
||||
//{
|
||||
// return GetChildPort(card, port, true) as RoutingOutputPort;
|
||||
//}
|
||||
|
||||
///// <summary>
|
||||
///// Helper for above methods
|
||||
///// </summary>
|
||||
//RoutingPort GetChildPort(string cardKey, string portKey, bool portIsOutput)
|
||||
//{
|
||||
// var cardTokens = cardKey.Split('-');
|
||||
// if (cardTokens.Length != 2)
|
||||
// {
|
||||
// Debug.Console(0, this, "WARNING: GetChildPort cannot get port. Card parameter must be 'input-N' or 'output-N'");
|
||||
// return null;
|
||||
// }
|
||||
// try
|
||||
// {
|
||||
// uint slotNum = Convert.ToUInt32(cardTokens[1]);
|
||||
// var cardType = cardTokens[0].ToLower();
|
||||
// if (cardType == "input" && InputCards.ContainsKey(slotNum))
|
||||
// {
|
||||
// var card = InputCards[slotNum];
|
||||
// if (portIsOutput)
|
||||
// return card.GetOutputPort(portKey);
|
||||
// else
|
||||
// return card.GetInputPort(portKey);
|
||||
// }
|
||||
// if (cardType == "output" && OutputCards.ContainsKey(slotNum))
|
||||
// {
|
||||
// var card = OutputCards[slotNum];
|
||||
// return card.GetOutputPort(portKey);
|
||||
// }
|
||||
// }
|
||||
// catch (Exception)
|
||||
// {
|
||||
// Debug.Console(0, this, "WARNING: GetChildPort cannot get port. Only integer card numbers are valid.");
|
||||
// }
|
||||
// return null;
|
||||
//}
|
||||
|
||||
//public override bool CustomActivate()
|
||||
//{
|
||||
// var tlc = TieLineCollection.Default;
|
||||
// // Take all cards and TieLine them together with the internal ports
|
||||
// for (uint i = 1; i <= Chassis.NumberOfInputs; i++)
|
||||
// {
|
||||
// // If there's a matching input card for a given input number...
|
||||
// // This test *shouldn't* be necessary if data is consistent
|
||||
// if (InputCards.ContainsKey(i))
|
||||
// {
|
||||
// // Get the ports to link
|
||||
// var cardAudio = InputCards[i].BackplaneAudioOut;
|
||||
// var chassisAudio = InputPorts.FirstOrDefault(p =>
|
||||
// (uint)p.Selector == i && p.Type == eRoutingSignalType.Audio);
|
||||
// if (chassisAudio != null)
|
||||
// tlc.Add(new TieLine(cardAudio, chassisAudio));
|
||||
// else
|
||||
// Debug.Console(0, this, Debug.ErrorLogLevel.Warning,
|
||||
// "Backplane audio tie line creation for input card {0} failed", i);
|
||||
|
||||
// // Repeat for video link
|
||||
// var cardVideo = InputCards[i].BackplaneVideoOut;
|
||||
// var chassisVideo = InputPorts.FirstOrDefault(p =>
|
||||
// (uint)p.Selector == i && p.Type == eRoutingSignalType.Video);
|
||||
// if (cardVideo != null)
|
||||
// tlc.Add(new TieLine(cardVideo, chassisVideo));
|
||||
// else
|
||||
// Debug.Console(0, this, Debug.ErrorLogLevel.Warning,
|
||||
// "Backplane video tie line creation for input card {0} failed", i);
|
||||
// }
|
||||
// }
|
||||
|
||||
// // Loop through outputs and do it again - in pairs, because FYC
|
||||
// for (uint i = 1; i <= Chassis.NumberOfOutputs / 2; i += 1)
|
||||
// {
|
||||
// if (OutputCards.ContainsKey(i))
|
||||
// {
|
||||
// //Debug.Console(0, this, "Adding internal TieLines on output card {0}", OutputCards[i].Key);
|
||||
// // Left side of card
|
||||
// uint a = i * 2 - 1;
|
||||
// tlc.Add(new TieLine(
|
||||
// OutputPorts.First(p => (uint)p.Selector == a && p.Type == eRoutingSignalType.Audio),
|
||||
// OutputCards[i].BackplaneAudioIn1));
|
||||
// tlc.Add(new TieLine(
|
||||
// OutputPorts.First(p => (uint)p.Selector == a && p.Type == eRoutingSignalType.Video),
|
||||
// OutputCards[i].BackplaneVideoIn1));
|
||||
|
||||
// // Right side of card
|
||||
// uint b = i * 2;
|
||||
// tlc.Add(new TieLine(
|
||||
// OutputPorts.First(p => (uint)p.Selector == b && p.Type == eRoutingSignalType.Audio),
|
||||
// OutputCards[i].BackplaneAudioIn2));
|
||||
// tlc.Add(new TieLine(
|
||||
// OutputPorts.First(p => (uint)p.Selector == b && p.Type == eRoutingSignalType.Video),
|
||||
// OutputCards[i].BackplaneVideoIn2));
|
||||
// }
|
||||
// }
|
||||
|
||||
// // Base does register and sets up comm monitoring.
|
||||
// return base.CustomActivate();
|
||||
//}
|
||||
|
||||
}
|
||||
|
||||
public struct PortNumberType
|
||||
{
|
||||
public uint Number { get; private set; }
|
||||
public eRoutingSignalType Type { get; private set; }
|
||||
|
||||
public PortNumberType(uint number, eRoutingSignalType type) : this()
|
||||
{
|
||||
Number = number;
|
||||
Type = type;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,56 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharp.CrestronIO;
|
||||
using Crestron.SimplSharpPro;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.Config;
|
||||
|
||||
namespace PepperDash.Essentials.DM
|
||||
{
|
||||
public class DeviceFactory
|
||||
{
|
||||
public static IKeyed GetDevice(DeviceConfig dc)
|
||||
{
|
||||
var key = dc.Key;
|
||||
var name = dc.Name;
|
||||
var type = dc.Type;
|
||||
var properties = dc.Properties;
|
||||
|
||||
var typeName = dc.Type.ToLower();
|
||||
|
||||
if (typeName == "dmmd8x8")
|
||||
{
|
||||
var props = JsonConvert.DeserializeObject
|
||||
<PepperDash.Essentials.DM.Config.DMChassisPropertiesConfig>(properties.ToString());
|
||||
return PepperDash.Essentials.DM.DmChassisController.
|
||||
GetDmChassisController(key, name, type, props);
|
||||
}
|
||||
|
||||
// Hand off to DmTxHelper class
|
||||
else if (typeName.StartsWith("dmtx"))
|
||||
{
|
||||
var props = JsonConvert.DeserializeObject
|
||||
<PepperDash.Essentials.DM.Config.DmTxPropertiesConfig>(properties.ToString());
|
||||
return PepperDash.Essentials.DM.DmTxHelper.GetDmTxController(key, name, type, props);
|
||||
}
|
||||
|
||||
// Hand off to DmRmcHelper class
|
||||
else if (typeName.StartsWith("dmrmc"))
|
||||
{
|
||||
var props = JsonConvert.DeserializeObject
|
||||
<PepperDash.Essentials.DM.Config.DmRmcPropertiesConfig>(properties.ToString());
|
||||
return PepperDash.Essentials.DM.DmRmcHelper.GetDmRmcController(key, name, type, props);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,70 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro;
|
||||
using Crestron.SimplSharpPro.DM;
|
||||
using Crestron.SimplSharpPro.DM.Endpoints;
|
||||
using Crestron.SimplSharpPro.DM.Endpoints.Receivers;
|
||||
|
||||
using PepperDash.Essentials.Core;
|
||||
|
||||
namespace PepperDash.Essentials.DM
|
||||
{
|
||||
/// <summary>
|
||||
/// Builds a controller for basic DM-RMCs with Com and IR ports and no control functions
|
||||
///
|
||||
/// </summary>
|
||||
public class DmRmc100CController : DmRmcControllerBase, IRoutingInputsOutputs,
|
||||
IIROutputPorts, IComPorts, ICec
|
||||
{
|
||||
public DmRmc100C Rmc { get; private set; }
|
||||
|
||||
public RoutingInputPort DmIn { get; private set; }
|
||||
public RoutingOutputPort HdmiOut { get; private set; }
|
||||
|
||||
public RoutingPortCollection<RoutingInputPort> InputPorts
|
||||
{
|
||||
get { return new RoutingPortCollection<RoutingInputPort> { DmIn }; }
|
||||
}
|
||||
|
||||
public RoutingPortCollection<RoutingOutputPort> OutputPorts
|
||||
{
|
||||
get { return new RoutingPortCollection<RoutingOutputPort> { HdmiOut }; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Make a Crestron RMC and put it in here
|
||||
/// </summary>
|
||||
public DmRmc100CController(string key, string name, DmRmc100C rmc)
|
||||
: base(key, name, rmc)
|
||||
{
|
||||
Rmc = rmc;
|
||||
DmIn = new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.AudioVideo,
|
||||
eRoutingPortConnectionType.DmCat, 0, this);
|
||||
HdmiOut = new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.AudioVideo,
|
||||
eRoutingPortConnectionType.Hdmi, null, this);
|
||||
}
|
||||
|
||||
public override bool CustomActivate()
|
||||
{
|
||||
// Base does register and sets up comm monitoring.
|
||||
return base.CustomActivate();
|
||||
}
|
||||
|
||||
#region IIROutputPorts Members
|
||||
public CrestronCollection<IROutputPort> IROutputPorts { get { return Rmc.IROutputPorts; } }
|
||||
public int NumberOfIROutputPorts { get { return Rmc.NumberOfIROutputPorts; } }
|
||||
#endregion
|
||||
|
||||
#region IComPorts Members
|
||||
public CrestronCollection<ComPort> ComPorts { get { return Rmc.ComPorts; } }
|
||||
public int NumberOfComPorts { get { return Rmc.NumberOfComPorts; } }
|
||||
#endregion
|
||||
|
||||
#region ICec Members
|
||||
public Cec StreamCec { get { return Rmc.StreamCec; } }
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,156 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro;
|
||||
using Crestron.SimplSharpPro.DM;
|
||||
using Crestron.SimplSharpPro.DM.Endpoints;
|
||||
using Crestron.SimplSharpPro.DM.Endpoints.Receivers;
|
||||
|
||||
using PepperDash.Essentials.Core;
|
||||
|
||||
namespace PepperDash.Essentials.DM
|
||||
{
|
||||
/// <summary>
|
||||
/// Builds a controller for basic DM-RMCs with Com and IR ports and no control functions
|
||||
///
|
||||
/// </summary>
|
||||
public class DmRmc4kScalerCController : DmRmcControllerBase, IRoutingInputsOutputs, IBasicVolumeWithFeedback,
|
||||
IIROutputPorts, IComPorts, ICec, IRelayPorts
|
||||
{
|
||||
public DmRmc4kScalerC Rmc { get; private set; }
|
||||
|
||||
public RoutingInputPort DmIn { get; private set; }
|
||||
public RoutingOutputPort HdmiOut { get; private set; }
|
||||
public RoutingOutputPort BalancedAudioOut { get; private set; }
|
||||
|
||||
public RoutingPortCollection<RoutingInputPort> InputPorts
|
||||
{
|
||||
get { return new RoutingPortCollection<RoutingInputPort> { DmIn }; }
|
||||
}
|
||||
|
||||
public RoutingPortCollection<RoutingOutputPort> OutputPorts
|
||||
{
|
||||
get { return new RoutingPortCollection<RoutingOutputPort> { HdmiOut, BalancedAudioOut }; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Make a Crestron RMC and put it in here
|
||||
/// </summary>
|
||||
public DmRmc4kScalerCController(string key, string name, DmRmc4kScalerC rmc)
|
||||
: base(key, name, rmc)
|
||||
{
|
||||
Rmc = rmc;
|
||||
DmIn = new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.AudioVideo,
|
||||
eRoutingPortConnectionType.DmCat, 0, this);
|
||||
HdmiOut = new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.AudioVideo,
|
||||
eRoutingPortConnectionType.Hdmi, null, this);
|
||||
BalancedAudioOut = new RoutingOutputPort(DmPortName.BalancedAudioOut, eRoutingSignalType.Audio,
|
||||
eRoutingPortConnectionType.LineAudio, null, this);
|
||||
|
||||
MuteFeedback = new BoolFeedback(() => false);
|
||||
VolumeLevelFeedback = new IntFeedback(CommonIntCue.MainVolumeLevelFeedback, () =>
|
||||
rmc.AudioOutput.VolumeFeedback.UShortValue);
|
||||
}
|
||||
|
||||
public override bool CustomActivate()
|
||||
{
|
||||
// Base does register and sets up comm monitoring.
|
||||
return base.CustomActivate();
|
||||
}
|
||||
|
||||
#region IIROutputPorts Members
|
||||
public CrestronCollection<IROutputPort> IROutputPorts { get { return Rmc.IROutputPorts; } }
|
||||
public int NumberOfIROutputPorts { get { return Rmc.NumberOfIROutputPorts; } }
|
||||
#endregion
|
||||
|
||||
#region IComPorts Members
|
||||
public CrestronCollection<ComPort> ComPorts { get { return Rmc.ComPorts; } }
|
||||
public int NumberOfComPorts { get { return Rmc.NumberOfComPorts; } }
|
||||
#endregion
|
||||
|
||||
#region ICec Members
|
||||
/// <summary>
|
||||
/// Gets the CEC stream directly from the HDMI port.
|
||||
/// </summary>
|
||||
public Cec StreamCec { get { return Rmc.HdmiOutput.StreamCec; } }
|
||||
#endregion
|
||||
|
||||
#region IRelayPorts Members
|
||||
|
||||
public int NumberOfRelayPorts
|
||||
{
|
||||
get { return Rmc.NumberOfRelayPorts; }
|
||||
}
|
||||
|
||||
public CrestronCollection<Relay> RelayPorts
|
||||
{
|
||||
get { return Rmc.RelayPorts; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region IBasicVolumeWithFeedback Members
|
||||
|
||||
public BoolFeedback MuteFeedback
|
||||
{
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Not implemented
|
||||
/// </summary>
|
||||
public void MuteOff()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Not implemented
|
||||
/// </summary>
|
||||
public void MuteOn()
|
||||
{
|
||||
}
|
||||
|
||||
public void SetVolume(ushort level)
|
||||
{
|
||||
Rmc.AudioOutput.Volume.UShortValue = level;
|
||||
}
|
||||
|
||||
public IntFeedback VolumeLevelFeedback
|
||||
{
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region IBasicVolumeControls Members
|
||||
|
||||
/// <summary>
|
||||
/// Not implemented
|
||||
/// </summary>
|
||||
public void MuteToggle()
|
||||
{
|
||||
}
|
||||
|
||||
public void VolumeDown(bool pressRelease)
|
||||
{
|
||||
if (pressRelease)
|
||||
SigHelper.RampTimeScaled(Rmc.AudioOutput.Volume, 0, 4000);
|
||||
else
|
||||
Rmc.AudioOutput.Volume.StopRamp();
|
||||
}
|
||||
|
||||
public void VolumeUp(bool pressRelease)
|
||||
{
|
||||
if (pressRelease)
|
||||
SigHelper.RampTimeScaled(Rmc.AudioOutput.Volume, 65535, 4000);
|
||||
else
|
||||
Rmc.AudioOutput.Volume.StopRamp();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,138 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro;
|
||||
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.Config;
|
||||
|
||||
namespace PepperDash.Essentials.DM
|
||||
{
|
||||
public abstract class DmRmcControllerBase : CrestronGenericBaseDevice
|
||||
{
|
||||
public DmRmcControllerBase(string key, string name, EndpointReceiverBase device)
|
||||
: base(key, name, device)
|
||||
{ }
|
||||
}
|
||||
|
||||
public class DmRmcHelper
|
||||
{
|
||||
/// <summary>
|
||||
/// A factory method for various DmTxControllers
|
||||
/// </summary>
|
||||
/// <param name="key"></param>
|
||||
/// <param name="name"></param>
|
||||
/// <param name="props"></param>
|
||||
/// <returns></returns>
|
||||
public static DmRmcControllerBase GetDmRmcController(string key, string name, string typeName, DmRmcPropertiesConfig props)
|
||||
{
|
||||
// switch on type name... later...
|
||||
|
||||
typeName = typeName.ToLower();
|
||||
uint ipid = props.Control.IpIdInt; // Convert.ToUInt16(props.Id, 16);
|
||||
|
||||
|
||||
|
||||
// right here, we need to grab the tie line that associates this
|
||||
// RMC with a chassis or processor. If the RMC input's tie line is not
|
||||
// connected to a chassis, then it's parent is the processor.
|
||||
// If the RMC is connected to a chassis, then we need to grab the
|
||||
// output number from the tie line and use that to plug it in.
|
||||
// Example of chassis-connected:
|
||||
//{
|
||||
// "sourceKey": "dmMd8x8-1",
|
||||
// "sourcePort": "anyOut2",
|
||||
// "destinationKey": "dmRmc100C-2",
|
||||
// "destinationPort": "DmIn"
|
||||
//}
|
||||
|
||||
// Tx -> RMC link:
|
||||
//{
|
||||
// "sourceKey": "dmTx201C-1",
|
||||
// "sourcePort": "DmOut",
|
||||
// "destinationKey": "dmRmc100C-2",
|
||||
// "destinationPort": "DmIn"
|
||||
//}
|
||||
|
||||
var tlc = TieLineCollection.Default;
|
||||
// grab the tie line that has this key as
|
||||
// THIS DOESN'T WORK BECAUSE THE RMC THAT WE NEED (THIS) HASN'T BEEN MADE
|
||||
// YET AND THUS WILL NOT HAVE A TIE LINE...
|
||||
var inputTieLine = tlc.FirstOrDefault(t =>
|
||||
{
|
||||
var d = t.DestinationPort.ParentDevice;
|
||||
return d.Key.Equals(key, StringComparison.OrdinalIgnoreCase)
|
||||
&& d is DmChassisController;
|
||||
});
|
||||
|
||||
var pKey = props.ParentDeviceKey.ToLower();
|
||||
|
||||
|
||||
|
||||
|
||||
// Non-DM-chassis endpoints
|
||||
if (pKey == "processor")
|
||||
{
|
||||
// Catch constructor failures, mainly dues to IPID
|
||||
try
|
||||
{
|
||||
if (typeName.StartsWith("dmrmc100c"))
|
||||
return new DmRmc100CController(key, name, new DmRmc100C(ipid, Global.ControlSystem));
|
||||
if (typeName.StartsWith("dmrmcscalerc"))
|
||||
return new DmRmcScalerCController(key, name, new DmRmcScalerC(ipid, Global.ControlSystem));
|
||||
if (typeName.StartsWith("dmrmc4kscalerc"))
|
||||
return new DmRmc4kScalerCController(key, name, new DmRmc4kScalerC(ipid, Global.ControlSystem));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.Console(0, "[{0}] WARNING: Cannot create DM-RMC device: {1}", key, e.Message);
|
||||
}
|
||||
|
||||
|
||||
Debug.Console(0, "Cannot create DM-RMC of type: '{0}'", typeName);
|
||||
}
|
||||
// Endpoints attached to DM Chassis
|
||||
else
|
||||
{
|
||||
var parentDev = DeviceManager.GetDeviceForKey(pKey);
|
||||
if (!(parentDev is DmChassisController))
|
||||
{
|
||||
Debug.Console(0, "Cannot create DM device '{0}'. '{1}' is not a DM Chassis.",
|
||||
key, pKey);
|
||||
return null;
|
||||
}
|
||||
|
||||
var chassis = (parentDev as DmChassisController).Chassis;
|
||||
var num = props.ParentOutputNumber;
|
||||
if (num <= 0 || num > chassis.NumberOfOutputs)
|
||||
{
|
||||
Debug.Console(0, "Cannot create DM device '{0}'. Output number '{1}' is out of range",
|
||||
key, num);
|
||||
return null;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
if (typeName.StartsWith("dmrmc100c"))
|
||||
return new DmRmc100CController(key, name, new DmRmc100C(ipid, chassis.Outputs[num]));
|
||||
if (typeName.StartsWith("dmrmcscalerc"))
|
||||
return new DmRmcScalerCController(key, name, new DmRmcScalerC(ipid, chassis.Outputs[num]));
|
||||
if (typeName.StartsWith("dmrmc4kscalerc"))
|
||||
return new DmRmc4kScalerCController(key, name, new DmRmc4kScalerC(ipid, chassis.Outputs[num]));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.Console(0, "[{0}] WARNING: Cannot create DM-RMC device: {1}", key, e.Message);
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,73 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro;
|
||||
using Crestron.SimplSharpPro.DM;
|
||||
using Crestron.SimplSharpPro.DM.Endpoints;
|
||||
using Crestron.SimplSharpPro.DM.Endpoints.Receivers;
|
||||
|
||||
using PepperDash.Essentials.Core;
|
||||
|
||||
namespace PepperDash.Essentials.DM
|
||||
{
|
||||
/// <summary>
|
||||
/// Builds a controller for basic DM-RMCs with Com and IR ports and no control functions
|
||||
///
|
||||
/// </summary>
|
||||
public class DmRmcScalerCController : DmRmcControllerBase, IRoutingInputsOutputs,
|
||||
IIROutputPorts, IComPorts, ICec
|
||||
{
|
||||
public DmRmcScalerC Rmc { get; private set; }
|
||||
|
||||
public RoutingInputPort DmIn { get; private set; }
|
||||
public RoutingOutputPort HdmiOut { get; private set; }
|
||||
|
||||
public RoutingPortCollection<RoutingInputPort> InputPorts
|
||||
{
|
||||
get { return new RoutingPortCollection<RoutingInputPort> { DmIn }; }
|
||||
}
|
||||
|
||||
public RoutingPortCollection<RoutingOutputPort> OutputPorts
|
||||
{
|
||||
get { return new RoutingPortCollection<RoutingOutputPort> { HdmiOut }; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Make a Crestron RMC and put it in here
|
||||
/// </summary>
|
||||
public DmRmcScalerCController(string key, string name, DmRmcScalerC rmc)
|
||||
: base(key, name, rmc)
|
||||
{
|
||||
Rmc = rmc;
|
||||
DmIn = new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.AudioVideo,
|
||||
eRoutingPortConnectionType.DmCat, 0, this);
|
||||
HdmiOut = new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.AudioVideo,
|
||||
eRoutingPortConnectionType.Hdmi, null, this);
|
||||
}
|
||||
|
||||
public override bool CustomActivate()
|
||||
{
|
||||
// Base does register and sets up comm monitoring.
|
||||
return base.CustomActivate();
|
||||
}
|
||||
|
||||
#region IIROutputPorts Members
|
||||
public CrestronCollection<IROutputPort> IROutputPorts { get { return Rmc.IROutputPorts; } }
|
||||
public int NumberOfIROutputPorts { get { return Rmc.NumberOfIROutputPorts; } }
|
||||
#endregion
|
||||
|
||||
#region IComPorts Members
|
||||
public CrestronCollection<ComPort> ComPorts { get { return Rmc.ComPorts; } }
|
||||
public int NumberOfComPorts { get { return Rmc.NumberOfComPorts; } }
|
||||
#endregion
|
||||
|
||||
#region ICec Members
|
||||
/// <summary>
|
||||
/// Gets the CEC stream directly from the HDMI port.
|
||||
/// </summary>
|
||||
public Cec StreamCec { get { return Rmc.HdmiOutput.StreamCec; } }
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,196 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro;
|
||||
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.Config;
|
||||
|
||||
namespace PepperDash.Essentials.DM
|
||||
{
|
||||
public class DmTx201SBasicController : DmTxControllerBase, IRoutingInputsOutputs, IHasFeedback
|
||||
{
|
||||
public DmTx201S Tx { get; private set; }
|
||||
|
||||
public RoutingInputPortWithVideoStatuses AnyVideoInput { get; private set; }
|
||||
public RoutingInputPortWithVideoStatuses HdmiInput { get; private set; }
|
||||
public RoutingInputPortWithVideoStatuses VgaInput { get; private set; }
|
||||
public RoutingOutputPort DmOutput { get; private set; }
|
||||
public StringFeedback ActiveVideoInputFeedback { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Helps get the "real" inputs, including when in Auto
|
||||
/// </summary>
|
||||
public DmTx200Base.eSourceSelection ActualVideoInput
|
||||
{
|
||||
get
|
||||
{
|
||||
if (Tx.VideoSourceFeedback == DmTx200Base.eSourceSelection.Digital ||
|
||||
Tx.VideoSourceFeedback == DmTx200Base.eSourceSelection.Analog ||
|
||||
Tx.VideoSourceFeedback == DmTx200Base.eSourceSelection.Disable)
|
||||
return Tx.VideoSourceFeedback;
|
||||
else // auto
|
||||
{
|
||||
if (Tx.HdmiInput.SyncDetectedFeedback.BoolValue)
|
||||
return DmTx200Base.eSourceSelection.Digital;
|
||||
else if (Tx.VgaInput.SyncDetectedFeedback.BoolValue)
|
||||
return DmTx200Base.eSourceSelection.Analog;
|
||||
else
|
||||
return DmTx200Base.eSourceSelection.Disable;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public RoutingPortCollection<RoutingInputPort> InputPorts
|
||||
{
|
||||
get
|
||||
{
|
||||
return new RoutingPortCollection<RoutingInputPort>
|
||||
{
|
||||
HdmiInput,
|
||||
VgaInput,
|
||||
AnyVideoInput
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public RoutingPortCollection<RoutingOutputPort> OutputPorts
|
||||
{
|
||||
get
|
||||
{
|
||||
return new RoutingPortCollection<RoutingOutputPort> { DmOutput };
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="key"></param>
|
||||
/// <param name="name"></param>
|
||||
/// <param name="tx"></param>
|
||||
public DmTx201SBasicController(string key, string name, DmTx201S tx)
|
||||
: base(key, name, tx)
|
||||
{
|
||||
Tx = tx;
|
||||
|
||||
//Can this be combined into helper somehow??
|
||||
var combinedFuncs = new VideoStatusFuncsWrapper
|
||||
{
|
||||
HdcpActiveFeedbackFunc = () =>
|
||||
ActualVideoInput == DmTx200Base.eSourceSelection.Digital
|
||||
&& tx.HdmiInput.VideoAttributes.HdcpActiveFeedback.BoolValue,
|
||||
|
||||
HdcpStateFeedbackFunc = () =>
|
||||
ActualVideoInput == DmTx200Base.eSourceSelection.Digital
|
||||
? tx.HdmiInput.VideoAttributes.HdcpStateFeedback.ToString()
|
||||
: "",
|
||||
|
||||
VideoResolutionFeedbackFunc = () =>
|
||||
ActualVideoInput == DmTx200Base.eSourceSelection.Digital
|
||||
? Tx.HdmiInput.VideoAttributes.GetVideoResolutionString()
|
||||
: Tx.VgaInput.VideoAttributes.GetVideoResolutionString(),
|
||||
|
||||
VideoSyncFeedbackFunc = () =>
|
||||
ActualVideoInput == DmTx200Base.eSourceSelection.Digital
|
||||
? HdmiInput.VideoStatus.VideoSyncFeedback.BoolValue
|
||||
: VgaInput.VideoStatus.VideoSyncFeedback.BoolValue
|
||||
};
|
||||
HdmiInput = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn,
|
||||
eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.Hdmi, 1, this,
|
||||
VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInput));
|
||||
VgaInput = new RoutingInputPortWithVideoStatuses(DmPortName.VgaIn,
|
||||
eRoutingSignalType.Video, eRoutingPortConnectionType.Vga, 2, this,
|
||||
VideoStatusHelper.GetVgaInputStatusFuncs(tx.VgaInput));
|
||||
AnyVideoInput = new RoutingInputPortWithVideoStatuses(DmPortName.AnyVideoIn,
|
||||
eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.None, 0, this, combinedFuncs);
|
||||
|
||||
DmOutput = new RoutingOutputPort(DmPortName.DmOut, eRoutingSignalType.AudioVideo,
|
||||
eRoutingPortConnectionType.DmCat, null, this);
|
||||
|
||||
ActiveVideoInputFeedback = new StringFeedback(new Cue("ActiveVideoInput", 0, eCueType.String),
|
||||
() => ActualVideoInput.ToString());
|
||||
}
|
||||
|
||||
public override bool CustomActivate()
|
||||
{
|
||||
Tx.HdmiInput.InputStreamChange += (o, a) => FireInputStreamChange(HdmiInput, a.EventId);
|
||||
Tx.HdmiInput.VideoAttributes.AttributeChange += (o, a) => FireVideoAttributeChange(HdmiInput, a.EventId);
|
||||
|
||||
Tx.VgaInput.InputStreamChange += (o, a) => FireInputStreamChange(VgaInput, a.EventId);
|
||||
Tx.VgaInput.VideoAttributes.AttributeChange += (o, a) => FireVideoAttributeChange(VgaInput, a.EventId);
|
||||
|
||||
// Base does register and sets up comm monitoring.
|
||||
return base.CustomActivate();
|
||||
}
|
||||
|
||||
void Tx_BaseEvent(GenericBase device, BaseEventArgs args)
|
||||
{
|
||||
var id = args.EventId;
|
||||
if (id == DmTx201S.VideoSourceFeedbackEventID)
|
||||
{
|
||||
Debug.Console(2, this, " Video Source: {0}", Tx.VideoSourceFeedback);
|
||||
}
|
||||
|
||||
// ------------------------------ incomplete -----------------------------------------
|
||||
else if (id == DmTx201S.AudioSourceFeedbackEventID)
|
||||
{
|
||||
Debug.Console(2, this, " Audio Source: {0}", Tx.AudioSourceFeedback);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Relays the input stream change to the appropriate RoutingInputPort.
|
||||
/// </summary>
|
||||
void FireInputStreamChange(RoutingInputPortWithVideoStatuses inputPort, int eventId)
|
||||
{
|
||||
if (eventId == EndpointInputStreamEventIds.SyncDetectedFeedbackEventId)
|
||||
{
|
||||
inputPort.VideoStatus.VideoSyncFeedback.FireUpdate();
|
||||
AnyVideoInput.VideoStatus.VideoSyncFeedback.FireUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Relays the VideoAttributes change to a RoutingInputPort
|
||||
/// </summary>
|
||||
void FireVideoAttributeChange(RoutingInputPortWithVideoStatuses inputPort, int eventId)
|
||||
{
|
||||
//// LOCATION: Crestron.SimplSharpPro.DM.VideoAttributeEventIds
|
||||
//Debug.Console(2, this, "VideoAttributes_AttributeChange event id={0} from {1}",
|
||||
// args.EventId, (sender as VideoAttributesEnhanced).Owner.GetType());
|
||||
switch (eventId)
|
||||
{
|
||||
case VideoAttributeEventIds.HdcpActiveFeedbackEventId:
|
||||
inputPort.VideoStatus.HdcpActiveFeedback.FireUpdate();
|
||||
AnyVideoInput.VideoStatus.HdcpActiveFeedback.FireUpdate();
|
||||
break;
|
||||
case VideoAttributeEventIds.HdcpStateFeedbackEventId:
|
||||
inputPort.VideoStatus.HdcpStateFeedback.FireUpdate();
|
||||
AnyVideoInput.VideoStatus.HdcpStateFeedback.FireUpdate();
|
||||
break;
|
||||
case VideoAttributeEventIds.HorizontalResolutionFeedbackEventId:
|
||||
case VideoAttributeEventIds.VerticalResolutionFeedbackEventId:
|
||||
inputPort.VideoStatus.VideoResolutionFeedback.FireUpdate();
|
||||
AnyVideoInput.VideoStatus.VideoResolutionFeedback.FireUpdate();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public override List<Feedback> Feedbacks
|
||||
{
|
||||
get
|
||||
{
|
||||
List<Feedback> list = AnyVideoInput.VideoStatus.ToList();
|
||||
list.AddRange(base.Feedbacks);
|
||||
list.Add(ActiveVideoInputFeedback);
|
||||
return list;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,246 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro;
|
||||
//using Crestron.SimplSharpPro.DeviceSupport;
|
||||
using Crestron.SimplSharpPro.DM;
|
||||
using Crestron.SimplSharpPro.DM.Endpoints;
|
||||
using Crestron.SimplSharpPro.DM.Endpoints.Transmitters;
|
||||
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.DM.Config;
|
||||
|
||||
namespace PepperDash.Essentials.DM
|
||||
{
|
||||
using eVst = DmTx401C.eSourceSelection;
|
||||
|
||||
public class DmTx401CController : DmTxControllerBase, IRoutingInputsOutputs, IHasFeedback, IIROutputPorts, IComPorts
|
||||
{
|
||||
public DmTx401C Tx { get; private set; }
|
||||
|
||||
public RoutingInputPortWithVideoStatuses AnyVideoInput { get; private set; }
|
||||
public RoutingInputPortWithVideoStatuses HdmiIn { get; private set; }
|
||||
public RoutingInputPortWithVideoStatuses DisplayPortIn { get; private set; }
|
||||
public RoutingInputPortWithVideoStatuses VgaIn { get; private set; }
|
||||
public RoutingInputPortWithVideoStatuses CompositeIn { get; private set; }
|
||||
public RoutingOutputPort DmOut { get; private set; }
|
||||
|
||||
public StringFeedback ActiveVideoInputFeedback { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Helps get the "real" inputs, including when in Auto
|
||||
/// </summary>
|
||||
public BaseDmTx401.eSourceSelection ActualVideoInput
|
||||
{
|
||||
get
|
||||
{
|
||||
if (Tx.VideoSourceFeedback != BaseDmTx401.eSourceSelection.Auto)
|
||||
return Tx.VideoSourceFeedback;
|
||||
else // auto
|
||||
{
|
||||
if (Tx.HdmiInput.SyncDetectedFeedback.BoolValue)
|
||||
return BaseDmTx401.eSourceSelection.HDMI;
|
||||
else if (Tx.VgaInput.SyncDetectedFeedback.BoolValue)
|
||||
return BaseDmTx401.eSourceSelection.VGA;
|
||||
else if (Tx.DisplayPortInput.SyncDetectedFeedback.BoolValue)
|
||||
return BaseDmTx401.eSourceSelection.DisplayPort;
|
||||
else if (Tx.CvbsInput.SyncDetectedFeedback.BoolValue)
|
||||
return BaseDmTx401.eSourceSelection.Composite;
|
||||
else
|
||||
return BaseDmTx401.eSourceSelection.Disabled;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public RoutingPortCollection<RoutingInputPort> InputPorts
|
||||
{
|
||||
get
|
||||
{
|
||||
return new RoutingPortCollection<RoutingInputPort>
|
||||
{
|
||||
HdmiIn,
|
||||
DisplayPortIn,
|
||||
VgaIn,
|
||||
CompositeIn,
|
||||
AnyVideoInput
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public RoutingPortCollection<RoutingOutputPort> OutputPorts
|
||||
{
|
||||
get
|
||||
{
|
||||
return new RoutingPortCollection<RoutingOutputPort> { DmOut };
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="key"></param>
|
||||
/// <param name="name"></param>
|
||||
/// <param name="tx"></param>
|
||||
public DmTx401CController(string key, string name, DmTx401C tx)
|
||||
: base(key, name, tx)
|
||||
{
|
||||
Tx = tx;
|
||||
|
||||
HdmiIn = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn,
|
||||
eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.Hdmi, 1, this,
|
||||
VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInput));
|
||||
DisplayPortIn = new RoutingInputPortWithVideoStatuses(DmPortName.DisplayPortIn,
|
||||
eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.Hdmi, 2, this,
|
||||
VideoStatusHelper.GetDisplayPortInputStatusFuncs(tx.DisplayPortInput));
|
||||
VgaIn = new RoutingInputPortWithVideoStatuses(DmPortName.VgaIn,
|
||||
eRoutingSignalType.Video, eRoutingPortConnectionType.Vga, 3, this,
|
||||
VideoStatusHelper.GetVgaInputStatusFuncs(tx.VgaInput));
|
||||
CompositeIn = new RoutingInputPortWithVideoStatuses(DmPortName.CompositeIn,
|
||||
eRoutingSignalType.Video, eRoutingPortConnectionType.Composite, 3, this,
|
||||
VideoStatusHelper.GetVgaInputStatusFuncs(tx.VgaInput));
|
||||
|
||||
ActiveVideoInputFeedback = new StringFeedback(new Cue("ActiveVideoInput", 0, eCueType.String),
|
||||
() => ActualVideoInput.ToString());
|
||||
|
||||
|
||||
var combinedFuncs = new VideoStatusFuncsWrapper
|
||||
{
|
||||
HdcpActiveFeedbackFunc = () =>
|
||||
(ActualVideoInput == eVst.HDMI
|
||||
&& tx.HdmiInput.VideoAttributes.HdcpActiveFeedback.BoolValue)
|
||||
|| (ActualVideoInput == eVst.DisplayPort
|
||||
&& tx.DisplayPortInput.VideoAttributes.HdcpActiveFeedback.BoolValue),
|
||||
|
||||
HdcpStateFeedbackFunc = () =>
|
||||
{
|
||||
if (ActualVideoInput == eVst.HDMI)
|
||||
return tx.HdmiInput.VideoAttributes.HdcpStateFeedback.ToString();
|
||||
if (ActualVideoInput == eVst.DisplayPort)
|
||||
return tx.DisplayPortInput.VideoAttributes.HdcpStateFeedback.ToString();
|
||||
return "";
|
||||
},
|
||||
|
||||
VideoResolutionFeedbackFunc = () =>
|
||||
{
|
||||
if (ActualVideoInput == eVst.HDMI)
|
||||
return tx.HdmiInput.VideoAttributes.GetVideoResolutionString();
|
||||
if (ActualVideoInput == eVst.DisplayPort)
|
||||
return tx.DisplayPortInput.VideoAttributes.GetVideoResolutionString();
|
||||
if (ActualVideoInput == eVst.VGA)
|
||||
return tx.VgaInput.VideoAttributes.GetVideoResolutionString();
|
||||
if (ActualVideoInput == eVst.Composite)
|
||||
return tx.CvbsInput.VideoAttributes.GetVideoResolutionString();
|
||||
return "";
|
||||
},
|
||||
VideoSyncFeedbackFunc = () =>
|
||||
(ActualVideoInput == eVst.HDMI
|
||||
&& tx.HdmiInput.SyncDetectedFeedback.BoolValue)
|
||||
|| (ActualVideoInput == eVst.DisplayPort
|
||||
&& tx.DisplayPortInput.SyncDetectedFeedback.BoolValue)
|
||||
|| (ActualVideoInput == eVst.VGA
|
||||
&& tx.VgaInput.SyncDetectedFeedback.BoolValue)
|
||||
|| (ActualVideoInput == eVst.Composite
|
||||
&& tx.CvbsInput.SyncDetectedFeedback.BoolValue)
|
||||
};
|
||||
|
||||
AnyVideoInput = new RoutingInputPortWithVideoStatuses(DmPortName.AnyVideoIn,
|
||||
eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.None, 0, this, combinedFuncs);
|
||||
|
||||
DmOut = new RoutingOutputPort(DmPortName.DmOut, eRoutingSignalType.AudioVideo,
|
||||
eRoutingPortConnectionType.DmCat, null, this);
|
||||
}
|
||||
|
||||
public override bool CustomActivate()
|
||||
{
|
||||
// Link up all of these damned events to the various RoutingPorts via a helper handler
|
||||
Tx.HdmiInput.InputStreamChange += (o, a) => FowardInputStreamChange(HdmiIn, a.EventId);
|
||||
Tx.HdmiInput.VideoAttributes.AttributeChange += (o, a) => ForwardVideoAttributeChange(HdmiIn, a.EventId);
|
||||
|
||||
Tx.DisplayPortInput.InputStreamChange += (o, a) => FowardInputStreamChange(DisplayPortIn, a.EventId);
|
||||
Tx.DisplayPortInput.VideoAttributes.AttributeChange += (o, a) => ForwardVideoAttributeChange(DisplayPortIn, a.EventId);
|
||||
|
||||
Tx.VgaInput.InputStreamChange += (o, a) => FowardInputStreamChange(VgaIn, a.EventId);
|
||||
Tx.VgaInput.VideoAttributes.AttributeChange += (o, a) => ForwardVideoAttributeChange(VgaIn, a.EventId);
|
||||
|
||||
// Base does register and sets up comm monitoring.
|
||||
return base.CustomActivate();
|
||||
}
|
||||
|
||||
void Tx_BaseEvent(GenericBase device, BaseEventArgs args)
|
||||
{
|
||||
var id = args.EventId;
|
||||
if (id == EndpointTransmitterBase.VideoSourceFeedbackEventId)
|
||||
{
|
||||
Debug.Console(2, this, " Video Source: {0}", Tx.VideoSourceFeedback);
|
||||
}
|
||||
|
||||
// ------------------------------ incomplete -----------------------------------------
|
||||
else if (id == EndpointTransmitterBase.AudioSourceFeedbackEventId)
|
||||
{
|
||||
Debug.Console(2, this, " Audio Source: {0}", Tx.AudioSourceFeedback);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Relays the input stream change to the appropriate RoutingInputPort.
|
||||
/// </summary>
|
||||
void FowardInputStreamChange(RoutingInputPortWithVideoStatuses inputPort, int eventId)
|
||||
{
|
||||
if (eventId == EndpointInputStreamEventIds.SyncDetectedFeedbackEventId)
|
||||
{
|
||||
inputPort.VideoStatus.VideoSyncFeedback.FireUpdate();
|
||||
AnyVideoInput.VideoStatus.VideoSyncFeedback.FireUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Relays the VideoAttributes change to a RoutingInputPort
|
||||
/// </summary>
|
||||
void ForwardVideoAttributeChange(RoutingInputPortWithVideoStatuses inputPort, int eventId)
|
||||
{
|
||||
//// LOCATION: Crestron.SimplSharpPro.DM.VideoAttributeEventIds
|
||||
//Debug.Console(2, this, "VideoAttributes_AttributeChange event id={0} from {1}",
|
||||
// args.EventId, (sender as VideoAttributesEnhanced).Owner.GetType());
|
||||
switch (eventId)
|
||||
{
|
||||
case VideoAttributeEventIds.HdcpActiveFeedbackEventId:
|
||||
inputPort.VideoStatus.HdcpActiveFeedback.FireUpdate();
|
||||
AnyVideoInput.VideoStatus.HdcpActiveFeedback.FireUpdate();
|
||||
break;
|
||||
case VideoAttributeEventIds.HdcpStateFeedbackEventId:
|
||||
inputPort.VideoStatus.HdcpStateFeedback.FireUpdate();
|
||||
AnyVideoInput.VideoStatus.HdcpStateFeedback.FireUpdate();
|
||||
break;
|
||||
case VideoAttributeEventIds.HorizontalResolutionFeedbackEventId:
|
||||
case VideoAttributeEventIds.VerticalResolutionFeedbackEventId:
|
||||
inputPort.VideoStatus.VideoResolutionFeedback.FireUpdate();
|
||||
AnyVideoInput.VideoStatus.VideoResolutionFeedback.FireUpdate();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public override List<Feedback> Feedbacks
|
||||
{
|
||||
get
|
||||
{
|
||||
List<Feedback> list = AnyVideoInput.VideoStatus.ToList();
|
||||
list.AddRange(base.Feedbacks);
|
||||
list.Add(ActiveVideoInputFeedback);
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
||||
#region IIROutputPorts Members
|
||||
public CrestronCollection<IROutputPort> IROutputPorts { get { return Tx.IROutputPorts; } }
|
||||
public int NumberOfIROutputPorts { get { return Tx.NumberOfIROutputPorts; } }
|
||||
#endregion
|
||||
|
||||
#region IComPorts Members
|
||||
public CrestronCollection<ComPort> ComPorts { get { return Tx.ComPorts; } }
|
||||
public int NumberOfComPorts { get { return Tx.NumberOfComPorts; } }
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,237 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro;
|
||||
//using Crestron.SimplSharpPro.DeviceSupport;
|
||||
using Crestron.SimplSharpPro.DM;
|
||||
using Crestron.SimplSharpPro.DM.Endpoints;
|
||||
using Crestron.SimplSharpPro.DM.Endpoints.Transmitters;
|
||||
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.DM.Config;
|
||||
|
||||
namespace PepperDash.Essentials.DM
|
||||
{
|
||||
using eVst = Crestron.SimplSharpPro.DeviceSupport.eX02VideoSourceType;
|
||||
|
||||
public class DmTx4k302CController : DmTxControllerBase, IRoutingInputsOutputs, IHasFeedback,
|
||||
IIROutputPorts, IComPorts
|
||||
{
|
||||
public DmTx4k302C Tx { get; private set; }
|
||||
|
||||
public RoutingInputPortWithVideoStatuses AnyVideoInput { get; private set; }
|
||||
public RoutingInputPortWithVideoStatuses HdmiIn1 { get; private set; }
|
||||
public RoutingInputPortWithVideoStatuses HdmiIn2 { get; private set; }
|
||||
public RoutingInputPortWithVideoStatuses VgaIn { get; private set; }
|
||||
public RoutingOutputPort DmOut { get; private set; }
|
||||
public RoutingOutputPort HdmiLoopOut { get; private set; }
|
||||
|
||||
public StringFeedback ActiveVideoInputFeedback { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Helps get the "real" inputs, including when in Auto
|
||||
/// </summary>
|
||||
public Crestron.SimplSharpPro.DeviceSupport.eX02VideoSourceType ActualActiveVideoInput
|
||||
{
|
||||
get
|
||||
{
|
||||
if (Tx.VideoSourceFeedback != eVst.Auto)
|
||||
return Tx.VideoSourceFeedback;
|
||||
else // auto
|
||||
{
|
||||
if (Tx.HdmiInputs[1].SyncDetectedFeedback.BoolValue)
|
||||
return eVst.Hdmi1;
|
||||
else if (Tx.HdmiInputs[2].SyncDetectedFeedback.BoolValue)
|
||||
return eVst.Hdmi2;
|
||||
else if (Tx.VgaInput.SyncDetectedFeedback.BoolValue)
|
||||
return eVst.Vga;
|
||||
else
|
||||
return eVst.AllDisabled;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public RoutingPortCollection<RoutingInputPort> InputPorts
|
||||
{
|
||||
get
|
||||
{
|
||||
return new RoutingPortCollection<RoutingInputPort>
|
||||
{
|
||||
HdmiIn1,
|
||||
HdmiIn2,
|
||||
VgaIn,
|
||||
AnyVideoInput
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public RoutingPortCollection<RoutingOutputPort> OutputPorts
|
||||
{
|
||||
get
|
||||
{
|
||||
return new RoutingPortCollection<RoutingOutputPort> { DmOut, HdmiLoopOut };
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="key"></param>
|
||||
/// <param name="name"></param>
|
||||
/// <param name="tx"></param>
|
||||
public DmTx4k302CController(string key, string name, DmTx4k302C tx)
|
||||
: base(key, name, tx)
|
||||
{
|
||||
Tx = tx;
|
||||
|
||||
HdmiIn1 = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn1,
|
||||
eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.Hdmi, 1, this,
|
||||
VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInputs[1]));
|
||||
HdmiIn2 = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn2,
|
||||
eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.Hdmi, 2, this,
|
||||
VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInputs[2]));
|
||||
VgaIn = new RoutingInputPortWithVideoStatuses(DmPortName.VgaIn,
|
||||
eRoutingSignalType.Video, eRoutingPortConnectionType.Vga, 3, this,
|
||||
VideoStatusHelper.GetVgaInputStatusFuncs(tx.VgaInput));
|
||||
ActiveVideoInputFeedback = new StringFeedback(new Cue("ActiveVideoInput", 0, eCueType.String),
|
||||
() => ActualActiveVideoInput.ToString());
|
||||
|
||||
var combinedFuncs = new VideoStatusFuncsWrapper
|
||||
{
|
||||
HdcpActiveFeedbackFunc = () =>
|
||||
(ActualActiveVideoInput == eVst.Hdmi1
|
||||
&& tx.HdmiInputs[1].VideoAttributes.HdcpActiveFeedback.BoolValue)
|
||||
|| (ActualActiveVideoInput == eVst.Hdmi2
|
||||
&& tx.HdmiInputs[2].VideoAttributes.HdcpActiveFeedback.BoolValue),
|
||||
|
||||
HdcpStateFeedbackFunc = () =>
|
||||
{
|
||||
if (ActualActiveVideoInput == eVst.Hdmi1)
|
||||
return tx.HdmiInputs[1].VideoAttributes.HdcpStateFeedback.ToString();
|
||||
if (ActualActiveVideoInput == eVst.Hdmi2)
|
||||
return tx.HdmiInputs[2].VideoAttributes.HdcpStateFeedback.ToString();
|
||||
return "";
|
||||
},
|
||||
|
||||
VideoResolutionFeedbackFunc = () =>
|
||||
{
|
||||
if (ActualActiveVideoInput == eVst.Hdmi1)
|
||||
return tx.HdmiInputs[1].VideoAttributes.GetVideoResolutionString();
|
||||
if (ActualActiveVideoInput == eVst.Hdmi2)
|
||||
return tx.HdmiInputs[2].VideoAttributes.GetVideoResolutionString();
|
||||
if (ActualActiveVideoInput == eVst.Vga)
|
||||
return tx.VgaInput.VideoAttributes.GetVideoResolutionString();
|
||||
return "";
|
||||
},
|
||||
VideoSyncFeedbackFunc = () =>
|
||||
(ActualActiveVideoInput == eVst.Hdmi1
|
||||
&& tx.HdmiInputs[1].SyncDetectedFeedback.BoolValue)
|
||||
|| (ActualActiveVideoInput == eVst.Hdmi2
|
||||
&& tx.HdmiInputs[2].SyncDetectedFeedback.BoolValue)
|
||||
|| (ActualActiveVideoInput == eVst.Vga
|
||||
&& tx.VgaInput.SyncDetectedFeedback.BoolValue)
|
||||
};
|
||||
|
||||
AnyVideoInput = new RoutingInputPortWithVideoStatuses(DmPortName.AnyVideoIn,
|
||||
eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.None, 0, this, combinedFuncs);
|
||||
|
||||
DmOut = new RoutingOutputPort(DmPortName.DmOut, eRoutingSignalType.AudioVideo,
|
||||
eRoutingPortConnectionType.DmCat, null, this);
|
||||
HdmiLoopOut = new RoutingOutputPort(DmPortName.HdmiLoopOut, eRoutingSignalType.AudioVideo,
|
||||
eRoutingPortConnectionType.Hdmi, null, this);
|
||||
}
|
||||
|
||||
public override bool CustomActivate()
|
||||
{
|
||||
// Link up all of these damned events to the various RoutingPorts via a helper handler
|
||||
Tx.HdmiInputs[1].InputStreamChange += (o, a) => FowardInputStreamChange(HdmiIn1, a.EventId);
|
||||
Tx.HdmiInputs[1].VideoAttributes.AttributeChange += (o, a) => ForwardVideoAttributeChange(HdmiIn1, a.EventId);
|
||||
|
||||
Tx.HdmiInputs[2].InputStreamChange += (o, a) => FowardInputStreamChange(HdmiIn2, a.EventId);
|
||||
Tx.HdmiInputs[2].VideoAttributes.AttributeChange += (o, a) => ForwardVideoAttributeChange(HdmiIn2, a.EventId);
|
||||
|
||||
Tx.VgaInput.InputStreamChange += (o, a) => FowardInputStreamChange(VgaIn, a.EventId);
|
||||
Tx.VgaInput.VideoAttributes.AttributeChange += (o, a) => ForwardVideoAttributeChange(VgaIn, a.EventId);
|
||||
|
||||
// Base does register and sets up comm monitoring.
|
||||
return base.CustomActivate();
|
||||
}
|
||||
|
||||
void Tx_BaseEvent(GenericBase device, BaseEventArgs args)
|
||||
{
|
||||
var id = args.EventId;
|
||||
if (id == DmTx4k302C.VideoSourceFeedbackEventId)
|
||||
{
|
||||
Debug.Console(2, this, " Video Source: {0}", Tx.VideoSourceFeedback);
|
||||
}
|
||||
|
||||
// ------------------------------ incomplete -----------------------------------------
|
||||
else if (id == DmTx4k302C.AudioSourceFeedbackEventId)
|
||||
{
|
||||
Debug.Console(2, this, " Audio Source: {0}", Tx.AudioSourceFeedback);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Relays the input stream change to the appropriate RoutingInputPort.
|
||||
/// </summary>
|
||||
void FowardInputStreamChange(RoutingInputPortWithVideoStatuses inputPort, int eventId)
|
||||
{
|
||||
if (eventId == EndpointInputStreamEventIds.SyncDetectedFeedbackEventId)
|
||||
{
|
||||
inputPort.VideoStatus.VideoSyncFeedback.FireUpdate();
|
||||
AnyVideoInput.VideoStatus.VideoSyncFeedback.FireUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Relays the VideoAttributes change to a RoutingInputPort
|
||||
/// </summary>
|
||||
void ForwardVideoAttributeChange(RoutingInputPortWithVideoStatuses inputPort, int eventId)
|
||||
{
|
||||
//// LOCATION: Crestron.SimplSharpPro.DM.VideoAttributeEventIds
|
||||
//Debug.Console(2, this, "VideoAttributes_AttributeChange event id={0} from {1}",
|
||||
// args.EventId, (sender as VideoAttributesEnhanced).Owner.GetType());
|
||||
switch (eventId)
|
||||
{
|
||||
case VideoAttributeEventIds.HdcpActiveFeedbackEventId:
|
||||
inputPort.VideoStatus.HdcpActiveFeedback.FireUpdate();
|
||||
AnyVideoInput.VideoStatus.HdcpActiveFeedback.FireUpdate();
|
||||
break;
|
||||
case VideoAttributeEventIds.HdcpStateFeedbackEventId:
|
||||
inputPort.VideoStatus.HdcpStateFeedback.FireUpdate();
|
||||
AnyVideoInput.VideoStatus.HdcpStateFeedback.FireUpdate();
|
||||
break;
|
||||
case VideoAttributeEventIds.HorizontalResolutionFeedbackEventId:
|
||||
case VideoAttributeEventIds.VerticalResolutionFeedbackEventId:
|
||||
inputPort.VideoStatus.VideoResolutionFeedback.FireUpdate();
|
||||
AnyVideoInput.VideoStatus.VideoResolutionFeedback.FireUpdate();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public override List<Feedback> Feedbacks
|
||||
{
|
||||
get
|
||||
{
|
||||
List<Feedback> list = AnyVideoInput.VideoStatus.ToList();
|
||||
list.AddRange(base.Feedbacks);
|
||||
list.Add(ActiveVideoInputFeedback);
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
||||
#region IIROutputPorts Members
|
||||
public CrestronCollection<IROutputPort> IROutputPorts { get { return Tx.IROutputPorts; } }
|
||||
public int NumberOfIROutputPorts { get { return Tx.NumberOfIROutputPorts; } }
|
||||
#endregion
|
||||
|
||||
#region IComPorts Members
|
||||
public CrestronCollection<ComPort> ComPorts { get { return Tx.ComPorts; } }
|
||||
public int NumberOfComPorts { get { return Tx.NumberOfComPorts; } }
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,105 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro;
|
||||
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.Config;
|
||||
|
||||
namespace PepperDash.Essentials.DM
|
||||
{
|
||||
public class DmTxHelper
|
||||
{
|
||||
/// <summary>
|
||||
/// A factory method for various DmTxControllers
|
||||
/// </summary>
|
||||
/// <param name="key"></param>
|
||||
/// <param name="name"></param>
|
||||
/// <param name="props"></param>
|
||||
/// <returns></returns>
|
||||
public static DmTxControllerBase GetDmTxController(string key, string name, string typeName, DmTxPropertiesConfig props)
|
||||
{
|
||||
// switch on type name... later...
|
||||
|
||||
typeName = typeName.ToLower();
|
||||
//uint ipid = Convert.ToUInt16(props.Id, 16);
|
||||
var ipid = props.Control.IpIdInt;
|
||||
var pKey = props.ParentDeviceKey.ToLower();
|
||||
|
||||
if (pKey == "processor")
|
||||
{
|
||||
// Catch constructor failures, mainly dues to IPID
|
||||
try
|
||||
{
|
||||
if (typeName.StartsWith("dmtx201"))
|
||||
return new DmTx201SBasicController(key, name, new DmTx201C(ipid, Global.ControlSystem));
|
||||
if (typeName.StartsWith("dmtx4k302"))
|
||||
return new DmTx4k302CController(key, name, new DmTx4k302C(ipid, Global.ControlSystem));
|
||||
if (typeName.StartsWith("dmtx401"))
|
||||
return new DmTx401CController(key, name, new DmTx401C(ipid, Global.ControlSystem));
|
||||
Debug.Console(0, "{1} WARNING: Cannot create DM-TX of type: '{0}'", typeName, key);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.Console(0, "[{0}] WARNING: Cannot create DM-TX device: {1}", key, e.Message);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var parentDev = DeviceManager.GetDeviceForKey(pKey);
|
||||
if (!(parentDev is DmChassisController))
|
||||
{
|
||||
Debug.Console(0, "Cannot create DM device '{0}'. '{1}' is not a DM Chassis.",
|
||||
key, pKey);
|
||||
return null;
|
||||
}
|
||||
|
||||
// Get the Crestron chassis and link stuff up
|
||||
var switchDev = parentDev as DmChassisController;
|
||||
var chassis = switchDev.Chassis;
|
||||
|
||||
var num = props.ParentInputNumber;
|
||||
if (num <= 0 || num > chassis.NumberOfInputs)
|
||||
{
|
||||
Debug.Console(0, "Cannot create DM device '{0}'. Input number '{1}' is out of range",
|
||||
key, num);
|
||||
return null;
|
||||
}
|
||||
|
||||
// Catch constructor failures, mainly dues to IPID
|
||||
try
|
||||
{
|
||||
if (typeName.StartsWith("dmtx201"))
|
||||
return new DmTx201SBasicController(key, name, new DmTx201S(ipid, chassis.Inputs[num]));
|
||||
|
||||
if (typeName.StartsWith("dmtx4k302"))
|
||||
return new DmTx4k302CController(key, name, new DmTx4k302C(ipid, chassis.Inputs[num]));
|
||||
|
||||
if (typeName.StartsWith("dmtx401"))
|
||||
return new DmTx401CController(key, name, new DmTx401C(ipid, chassis.Inputs[num]));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.Console(0, "[{0}] WARNING: Cannot create DM-TX device: {1}", key, e.Message);
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public abstract class DmTxControllerBase : CrestronGenericBaseDevice
|
||||
{
|
||||
public DmTxControllerBase(string key, string name, EndpointTransmitterBase hardware)
|
||||
: base(key, name, hardware) { }
|
||||
}
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
using Crestron.SimplSharpPro.DM;
|
||||
using Crestron.SimplSharpPro.DM.Cards;
|
||||
|
||||
using PepperDash.Essentials.Core;
|
||||
|
||||
namespace PepperDash.Essentials.DM
|
||||
{
|
||||
public static class VideoAttributesBasicExtensions
|
||||
{
|
||||
public static string GetVideoResolutionString(this VideoAttributesBasic va)
|
||||
{
|
||||
ushort h = va.HorizontalResolutionFeedback.UShortValue;
|
||||
ushort v = va.VerticalResolutionFeedback.UShortValue;
|
||||
if (h == 0 || v == 0)
|
||||
return "n/a";
|
||||
else
|
||||
return string.Format("{0}x{1}", h, v);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
|
||||
using PepperDash.Essentials.Core;
|
||||
|
||||
namespace PepperDash.Essentials.DM
|
||||
{
|
||||
public interface IBasicVideoStatusFeedbacks
|
||||
{
|
||||
BoolFeedback HasVideoStatusFeedback { get; }
|
||||
BoolFeedback HdcpActiveFeedback { get; }
|
||||
StringFeedback HdcpStateFeedback { get; }
|
||||
StringFeedback VideoResolutionFeedback { get; }
|
||||
BoolFeedback VideoSyncFeedback { get; }
|
||||
}
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
using System.Reflection;
|
||||
|
||||
[assembly: AssemblyTitle("Essentials_DM")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("Essentials_DM")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2016")]
|
||||
[assembly: AssemblyVersion("1.0.0.*")]
|
||||
|
||||
@@ -1,142 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Devices.Common.VideoCodec;
|
||||
|
||||
namespace PepperDash.Essentials.Devices.Common.Codec
|
||||
{
|
||||
public interface IHasDirectory
|
||||
{
|
||||
event EventHandler<DirectoryEventArgs> DirectoryResultReturned;
|
||||
|
||||
CodecDirectory DirectoryRoot { get; }
|
||||
|
||||
CodecPhonebookSyncState PhonebookSyncState { get; }
|
||||
|
||||
void SearchDirectory(string searchString);
|
||||
|
||||
void GetDirectoryFolderContents(string folderId);
|
||||
}
|
||||
|
||||
public class DirectoryEventArgs : EventArgs
|
||||
{
|
||||
public CodecDirectory Directory { get; set; }
|
||||
}
|
||||
|
||||
public class CodecDirectory
|
||||
{
|
||||
public List<DirectoryItem> DirectoryResults { get; private set; }
|
||||
|
||||
public string ResultsFolderId { get; set; }
|
||||
|
||||
//public int Limit { get; private set; }
|
||||
|
||||
public CodecDirectory()
|
||||
{
|
||||
DirectoryResults = new List<DirectoryItem>();
|
||||
}
|
||||
|
||||
public void AddFoldersToDirectory(List<DirectoryItem> folders)
|
||||
{
|
||||
if(folders != null)
|
||||
DirectoryResults.AddRange(folders);
|
||||
|
||||
SortDirectory();
|
||||
}
|
||||
|
||||
public void AddContactsToDirectory(List<DirectoryItem> contacts)
|
||||
{
|
||||
if(contacts != null)
|
||||
DirectoryResults.AddRange(contacts);
|
||||
|
||||
SortDirectory();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Formats the DirectoryResults list to display all folders alphabetically, then all contacts alphabetically
|
||||
/// </summary>
|
||||
private void SortDirectory()
|
||||
{
|
||||
var sortedFolders = new List<DirectoryItem>();
|
||||
|
||||
sortedFolders.AddRange(DirectoryResults.Where(f => f is DirectoryFolder));
|
||||
|
||||
sortedFolders.OrderBy(f => f.Name);
|
||||
|
||||
var sortedContacts = new List<DirectoryItem>();
|
||||
|
||||
sortedContacts.AddRange(DirectoryResults.Where(c => c is DirectoryContact));
|
||||
|
||||
sortedFolders.OrderBy(c => c.Name);
|
||||
|
||||
DirectoryResults.Clear();
|
||||
|
||||
DirectoryResults.AddRange(sortedFolders);
|
||||
|
||||
DirectoryResults.AddRange(sortedContacts);
|
||||
}
|
||||
}
|
||||
|
||||
public class DirectoryItem
|
||||
{
|
||||
public string Name { get; set; }
|
||||
}
|
||||
|
||||
public class DirectoryFolder : DirectoryItem
|
||||
{
|
||||
public List<DirectoryContact> Contacts { get; set; }
|
||||
public string FolderId { get; set; }
|
||||
public string ParentFolderId { get; set; }
|
||||
|
||||
public DirectoryFolder()
|
||||
{
|
||||
Contacts = new List<DirectoryContact>();
|
||||
}
|
||||
}
|
||||
|
||||
public class DirectoryContact : DirectoryItem
|
||||
{
|
||||
public string ContactId { get; set; }
|
||||
public string FolderId { get; set; }
|
||||
public string Title { get; set; }
|
||||
public List<ContactMethod> ContactMethods { get; set; }
|
||||
|
||||
public DirectoryContact()
|
||||
{
|
||||
ContactMethods = new List<ContactMethod>();
|
||||
}
|
||||
}
|
||||
|
||||
public class ContactMethod
|
||||
{
|
||||
public string ContactMethodId { get; set; }
|
||||
public string Number { get; set; }
|
||||
public eContactMethodDevice Device { get; set; }
|
||||
public eContactMethodCallType CallType { get; set; }
|
||||
}
|
||||
|
||||
public enum eContactMethodDevice
|
||||
{
|
||||
Unknown = 0,
|
||||
Mobile,
|
||||
Other,
|
||||
Telephone,
|
||||
Video
|
||||
}
|
||||
|
||||
public enum eContactMethodCallType
|
||||
{
|
||||
Unknown = 0,
|
||||
Audio,
|
||||
Video
|
||||
}
|
||||
|
||||
public class DirectorySearchResultEventArgs : EventArgs
|
||||
{
|
||||
public CodecDirectory Directory { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,115 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro;
|
||||
using Crestron.SimplSharpPro.Gateways;
|
||||
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Devices.Common
|
||||
{
|
||||
public class CenRfgwController : CrestronGenericBaseDevice
|
||||
{
|
||||
public GatewayBase Gateway { get { return Hardware as GatewayBase; } }
|
||||
|
||||
/// <summary>
|
||||
/// Constructor for the on-board gateway
|
||||
/// </summary>
|
||||
/// <param name="key"></param>
|
||||
/// <param name="name"></param>
|
||||
public CenRfgwController(string key, string name, GatewayBase gateway) :
|
||||
base(key, name, gateway)
|
||||
{
|
||||
}
|
||||
|
||||
public static CenRfgwController GetNewExGatewayController(string key, string name, string id, string gatewayType)
|
||||
{
|
||||
uint uid;
|
||||
eExGatewayType type;
|
||||
try
|
||||
{
|
||||
uid = Convert.ToUInt32(id, 16);
|
||||
type = (eExGatewayType)Enum.Parse(typeof(eExGatewayType), gatewayType, true);
|
||||
var cs = Global.ControlSystem;
|
||||
|
||||
GatewayBase gw = null;
|
||||
switch (type)
|
||||
{
|
||||
case eExGatewayType.Ethernet:
|
||||
gw = new CenRfgwEx(uid, cs);
|
||||
break;
|
||||
case eExGatewayType.EthernetShared:
|
||||
gw = new CenRfgwExEthernetSharable(uid, cs);
|
||||
break;
|
||||
case eExGatewayType.Cresnet:
|
||||
gw = new CenRfgwExCresnet(uid, cs);
|
||||
break;
|
||||
}
|
||||
return new CenRfgwController(key, name, gw);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
Debug.Console(0, "ERROR: Cannot create EX Gateway, id {0}, type {1}", id, gatewayType);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
public static CenRfgwController GetNewErGatewayController(string key, string name, string id, string gatewayType)
|
||||
{
|
||||
uint uid;
|
||||
eExGatewayType type;
|
||||
try
|
||||
{
|
||||
uid = Convert.ToUInt32(id, 16);
|
||||
type = (eExGatewayType)Enum.Parse(typeof(eExGatewayType), gatewayType, true);
|
||||
var cs = Global.ControlSystem;
|
||||
|
||||
GatewayBase gw = null;
|
||||
switch (type)
|
||||
{
|
||||
case eExGatewayType.Ethernet:
|
||||
gw = new CenErfgwPoe(uid, cs);
|
||||
break;
|
||||
case eExGatewayType.EthernetShared:
|
||||
gw = new CenErfgwPoeEthernetSharable(uid, cs);
|
||||
break;
|
||||
case eExGatewayType.Cresnet:
|
||||
gw = new CenErfgwPoeCresnet(uid, cs);
|
||||
break;
|
||||
}
|
||||
return new CenRfgwController(key, name, gw);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
Debug.Console(0, "ERROR: Cannot create EX Gateway, id {0}, type {1}", id, gatewayType);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets the actual Crestron EX gateway for a given key. "processor" or the key of
|
||||
/// a CenRfgwExController in DeviceManager
|
||||
/// </summary>
|
||||
/// <param name="key"></param>
|
||||
/// <returns>Either processor GW or Gateway property of CenRfgwExController</returns>
|
||||
public static GatewayBase GetExGatewayBaseForKey(string key)
|
||||
{
|
||||
key = key.ToLower();
|
||||
if (key == "processor" && Global.ControlSystem.SupportsInternalRFGateway)
|
||||
return Global.ControlSystem.ControllerRFGatewayDevice;
|
||||
var gwCont = DeviceManager.GetDeviceForKey(key) as CenRfgwController;
|
||||
if (gwCont != null)
|
||||
return gwCont.Gateway;
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public enum eExGatewayType
|
||||
{
|
||||
Ethernet, EthernetShared, Cresnet
|
||||
}
|
||||
}
|
||||
@@ -1,124 +0,0 @@
|
||||
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.Devices.Common.DSP
|
||||
{
|
||||
public abstract class DspBase : Device
|
||||
{
|
||||
public Dictionary<string, DspControlPoint> LevelControlPoints { get; private set; }
|
||||
|
||||
public Dictionary<string, DspControlPoint> DialerControlPoints { get; private set; }
|
||||
|
||||
public Dictionary<string, DspControlPoint> SwitcherControlPoints { get; private set; }
|
||||
|
||||
public abstract void RunPreset(string name);
|
||||
|
||||
public DspBase(string key, string name) :
|
||||
base(key, name) { }
|
||||
|
||||
|
||||
// in audio call feedback
|
||||
|
||||
// VOIP
|
||||
// Phone dialer
|
||||
}
|
||||
|
||||
// Fusion
|
||||
// Privacy state
|
||||
// Online state
|
||||
// level/mutes ?
|
||||
|
||||
// AC Log call stats
|
||||
|
||||
// Typical presets:
|
||||
// call default preset to restore levels and mutes
|
||||
|
||||
public abstract class DspControlPoint
|
||||
{
|
||||
//string Key { get; protected set; }
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Main program
|
||||
// VTC
|
||||
// ATC
|
||||
// Mics, unusual
|
||||
|
||||
public interface IDspLevelControl : IBasicVolumeWithFeedback
|
||||
{
|
||||
/// <summary>
|
||||
/// In BiAmp: Instance Tag, QSC: Named Control, Polycom:
|
||||
/// </summary>
|
||||
string ControlPointTag { get; }
|
||||
int Index1 { get; }
|
||||
int Index2 { get; }
|
||||
bool HasMute { get; }
|
||||
bool HasLevel { get; }
|
||||
bool AutomaticUnmuteOnVolumeUp { get; }
|
||||
}
|
||||
|
||||
//public abstract class DspLevelControl : DspControlPoint, IBasicVolumeWithFeedback
|
||||
//{
|
||||
// protected abstract Func<bool> MuteFeedbackFunc { get; }
|
||||
// protected abstract Func<int> VolumeLevelFeedbackFunc { get; }
|
||||
|
||||
// public DspLevelControl(string id)
|
||||
// {
|
||||
// MuteFeedback = new BoolFeedback(MuteFeedbackFunc);
|
||||
// VolumeLevelFeedback = new IntFeedback(VolumeLevelFeedbackFunc);
|
||||
// }
|
||||
|
||||
// // Poll and listen for these
|
||||
// // Max value
|
||||
// // Min value
|
||||
// #region IBasicVolumeWithFeedback Members
|
||||
|
||||
// public BoolFeedback MuteFeedback { get; private set; }
|
||||
|
||||
// public abstract void MuteOff();
|
||||
|
||||
// public abstract void MuteOn();
|
||||
|
||||
// public abstract void SetVolume(ushort level);
|
||||
|
||||
// public IntFeedback VolumeLevelFeedback { get; private set; }
|
||||
|
||||
// #endregion
|
||||
|
||||
// #region IBasicVolumeControls Members
|
||||
|
||||
// public abstract void MuteToggle();
|
||||
|
||||
// public abstract void VolumeDown(bool pressRelease);
|
||||
|
||||
// public abstract void VolumeUp(bool pressRelease);
|
||||
|
||||
// #endregion
|
||||
//}
|
||||
|
||||
// Privacy mute
|
||||
public abstract class DspMuteControl : DspControlPoint
|
||||
{
|
||||
protected abstract Func<bool> MuteFeedbackFunc { get; }
|
||||
|
||||
public DspMuteControl(string id)
|
||||
{
|
||||
MuteFeedback = new BoolFeedback(MuteFeedbackFunc);
|
||||
}
|
||||
|
||||
public BoolFeedback MuteFeedback { get; private set; }
|
||||
|
||||
public abstract void MuteOff();
|
||||
|
||||
public abstract void MuteOn();
|
||||
|
||||
public abstract void MuteToggle();
|
||||
}
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro;
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
|
||||
|
||||
namespace PepperDash.Essentials.Devices.Displays
|
||||
{
|
||||
public abstract class ComTcpDisplayBase : DisplayBase, IPower
|
||||
{
|
||||
/// <summary>
|
||||
/// Sets the communication method for this - swaps out event handlers and output handlers
|
||||
/// </summary>
|
||||
public IBasicCommunication CommunicationMethod
|
||||
{
|
||||
get { return _CommunicationMethod; }
|
||||
set
|
||||
{
|
||||
if (_CommunicationMethod != null)
|
||||
_CommunicationMethod.BytesReceived -= this.CommunicationMethod_BytesReceived;
|
||||
// Outputs???
|
||||
_CommunicationMethod = value;
|
||||
if (_CommunicationMethod != null)
|
||||
_CommunicationMethod.BytesReceived += this.CommunicationMethod_BytesReceived;
|
||||
// Outputs?
|
||||
}
|
||||
}
|
||||
IBasicCommunication _CommunicationMethod;
|
||||
|
||||
public ComTcpDisplayBase(string key, string name)
|
||||
: base(key, name)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
protected abstract void CommunicationMethod_BytesReceived(object sender, GenericCommMethodReceiveBytesArgs args);
|
||||
}
|
||||
}
|
||||
@@ -1,52 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharp.CrestronIO;
|
||||
using Crestron.SimplSharpPro;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.Config;
|
||||
|
||||
namespace PepperDash.Essentials.Devices.Displays
|
||||
{
|
||||
public class DisplayDeviceFactory
|
||||
{
|
||||
public static IKeyed GetDevice(DeviceConfig dc)
|
||||
{
|
||||
var key = dc.Key;
|
||||
var name = dc.Name;
|
||||
var type = dc.Type;
|
||||
var properties = dc.Properties;
|
||||
|
||||
var typeName = dc.Type.ToLower();
|
||||
|
||||
try
|
||||
{
|
||||
if (typeName == "necmpsx")
|
||||
{
|
||||
var comm = CommFactory.CreateCommForDevice(dc);
|
||||
if (comm != null)
|
||||
return new NecPSXMDisplay(dc.Key, dc.Name, comm);
|
||||
}
|
||||
else if(typeName == "samsungmdc")
|
||||
{
|
||||
var comm = CommFactory.CreateCommForDevice(dc);
|
||||
if (comm != null)
|
||||
return new SamsungMDC(dc.Key, dc.Name, comm, dc.Properties["id"].Value<string>());
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.Console(0, "Displays factory: Exception creating device type {0}, key {1}: \nCONFIG JSON: {2} \nERROR: {3}\n\n",
|
||||
dc.Type, dc.Key, JsonConvert.SerializeObject(dc), e);
|
||||
return null;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,243 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro;
|
||||
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Devices.Displays
|
||||
{
|
||||
public class NecPaSeriesProjector : ComTcpDisplayBase
|
||||
{
|
||||
public readonly IntFeedback Lamp1RemainingPercent;
|
||||
int _Lamp1RemainingPercent;
|
||||
public readonly IntFeedback Lamp2RemainingPercent;
|
||||
int _Lamp2RemainingPercent;
|
||||
protected override Func<bool> PowerIsOnFeedbackFunc
|
||||
{
|
||||
get { return () => _PowerIsOn; }
|
||||
}
|
||||
bool _PowerIsOn;
|
||||
|
||||
protected override Func<bool> IsCoolingDownFeedbackFunc
|
||||
{
|
||||
get { return () => false; }
|
||||
}
|
||||
|
||||
protected override Func<bool> IsWarmingUpFeedbackFunc
|
||||
{
|
||||
get { return () => false; }
|
||||
}
|
||||
|
||||
public override void PowerToggle()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override void ExecuteSwitch(object selector)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
Dictionary<string, string> InputMap;
|
||||
|
||||
/// <summary>
|
||||
/// Constructor
|
||||
/// </summary>
|
||||
public NecPaSeriesProjector(string key, string name)
|
||||
: base(key, name)
|
||||
{
|
||||
Lamp1RemainingPercent = new IntFeedback(Cue.UShortCue("Lamp1RemainingPercent", 0), () => _Lamp1RemainingPercent);
|
||||
Lamp2RemainingPercent = new IntFeedback(Cue.UShortCue("Lamp2RemainingPercent", 0), () => _Lamp2RemainingPercent);
|
||||
|
||||
InputMap = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase)
|
||||
{
|
||||
{ "computer1", "\x02\x03\x00\x00\x02\x01\x01\x09" },
|
||||
{ "computer2", "\x02\x03\x00\x00\x02\x01\x02\x0a" },
|
||||
{ "computer3", "\x02\x03\x00\x00\x02\x01\x03\x0b" },
|
||||
{ "hdmi", "\x02\x03\x00\x00\x02\x01\x1a\x22" },
|
||||
{ "dp", "\x02\x03\x00\x00\x02\x01\x1b\x23" },
|
||||
{ "video", "\x02\x03\x00\x00\x02\x01\x06\x0e" },
|
||||
{ "viewer", "\x02\x03\x00\x00\x02\x01\x1f\x27" },
|
||||
{ "network", "\x02\x03\x00\x00\x02\x01\x20\x28" },
|
||||
};
|
||||
}
|
||||
|
||||
void IsConnected_OutputChange(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void SetEnable(bool state)
|
||||
{
|
||||
var tcp = CommunicationMethod as GenericTcpIpClient;
|
||||
if (tcp != null)
|
||||
{
|
||||
tcp.Connect();
|
||||
}
|
||||
}
|
||||
|
||||
public override void PowerOn()
|
||||
{
|
||||
SendText("\x02\x00\x00\x00\x00\x02");
|
||||
}
|
||||
|
||||
public override void PowerOff()
|
||||
{
|
||||
SendText("\x02\x01\x00\x00\x00\x03");
|
||||
}
|
||||
|
||||
public void PictureMuteOn()
|
||||
{
|
||||
SendText("\x02\x10\x00\x00\x00\x12");
|
||||
}
|
||||
|
||||
public void PictureMuteOff()
|
||||
{
|
||||
SendText("\x02\x11\x00\x00\x00\x13");
|
||||
}
|
||||
|
||||
public void GetRunningStatus()
|
||||
{
|
||||
SendText("\x00\x85\x00\x00\x01\x01\x87");
|
||||
}
|
||||
|
||||
public void GetLampRemaining(int lampNum)
|
||||
{
|
||||
if (!_PowerIsOn) return;
|
||||
|
||||
var bytes = new byte[]{0x03,0x96,0x00,0x00,0x02,0x00,0x04};
|
||||
if (lampNum == 2)
|
||||
bytes[5] = 0x01;
|
||||
SendBytes(AppendChecksum(bytes));
|
||||
}
|
||||
|
||||
public void SelectInput(string inputKey)
|
||||
{
|
||||
if (InputMap.ContainsKey(inputKey))
|
||||
SendText(InputMap[inputKey]);
|
||||
}
|
||||
|
||||
void SendText(string text)
|
||||
{
|
||||
if (CommunicationMethod != null)
|
||||
CommunicationMethod.SendText(text);
|
||||
}
|
||||
|
||||
void SendBytes(byte[] bytes)
|
||||
{
|
||||
if (CommunicationMethod != null)
|
||||
CommunicationMethod.SendBytes(bytes);
|
||||
}
|
||||
|
||||
byte[] AppendChecksum(byte[] bytes)
|
||||
{
|
||||
byte sum = unchecked((byte)bytes.Sum(x => (int)x));
|
||||
var retVal = new byte[bytes.Length + 1];
|
||||
bytes.CopyTo(retVal, 0);
|
||||
retVal[retVal.Length - 1] = sum;
|
||||
return retVal;
|
||||
}
|
||||
|
||||
protected override void CommunicationMethod_BytesReceived(object sender, GenericCommMethodReceiveBytesArgs args)
|
||||
{
|
||||
var bytes = args.Bytes;
|
||||
ParseBytes(args.Bytes);
|
||||
}
|
||||
|
||||
void ParseBytes(byte[] bytes)
|
||||
{
|
||||
if (bytes[0] == 0x22)
|
||||
{
|
||||
// Power on
|
||||
if (bytes[1] == 0x00)
|
||||
{
|
||||
_PowerIsOn = true;
|
||||
PowerIsOnFeedback.FireUpdate();
|
||||
}
|
||||
// Power off
|
||||
else if (bytes[1] == 0x01)
|
||||
{
|
||||
_PowerIsOn = false;
|
||||
PowerIsOnFeedback.FireUpdate();
|
||||
}
|
||||
}
|
||||
// Running Status
|
||||
else if (bytes[0] == 0x20 && bytes[1] == 0x85 && bytes[4] == 0x10)
|
||||
{
|
||||
var operationStates = new Dictionary<int, string>
|
||||
{
|
||||
{ 0x00, "Standby" },
|
||||
{ 0x04, "Power On" },
|
||||
{ 0x05, "Cooling" },
|
||||
{ 0x06, "Standby (error)" },
|
||||
{ 0x0f, "Standby (power saving" },
|
||||
{ 0x10, "Network Standby" },
|
||||
{ 0xff, "Not supported" }
|
||||
};
|
||||
|
||||
var newPowerIsOn = bytes[7] == 0x01;
|
||||
if (newPowerIsOn != _PowerIsOn)
|
||||
{
|
||||
_PowerIsOn = newPowerIsOn;
|
||||
PowerIsOnFeedback.FireUpdate();
|
||||
}
|
||||
|
||||
Debug.Console(2, this, "PowerIsOn={0}\rCooling={1}\rPowering on/off={2}\rStatus={3}",
|
||||
_PowerIsOn,
|
||||
bytes[8] == 0x01,
|
||||
bytes[9] == 0x01,
|
||||
operationStates[bytes[10]]);
|
||||
|
||||
}
|
||||
// Lamp remaining
|
||||
else if (bytes[0] == 0x23 && bytes[1] == 0x96 && bytes[4] == 0x06 && bytes[6] == 0x04)
|
||||
{
|
||||
var newValue = bytes[7];
|
||||
if (bytes[5] == 0x00)
|
||||
{
|
||||
if (newValue != _Lamp1RemainingPercent)
|
||||
{
|
||||
_Lamp1RemainingPercent = newValue;
|
||||
Lamp1RemainingPercent.FireUpdate();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (newValue != _Lamp2RemainingPercent)
|
||||
{
|
||||
_Lamp2RemainingPercent = newValue;
|
||||
Lamp2RemainingPercent.FireUpdate();
|
||||
}
|
||||
}
|
||||
Debug.Console(0, this, "Lamp {0}, {1}% remaining", (bytes[5] + 1), bytes[7]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
#region INonStandardControls Members
|
||||
|
||||
public Dictionary<Cue, Action<object>> GetNonStandardControls()
|
||||
{
|
||||
return new Dictionary<Cue, Action<object>>
|
||||
{
|
||||
{ CommonBoolCue.PowerOn, o => PowerOn() },
|
||||
{ CommonBoolCue.PowerOff, o => PowerOff() },
|
||||
{ Cue.BoolCue("PictureMute", 0), o =>
|
||||
{
|
||||
if((bool)o)
|
||||
PictureMuteOn();
|
||||
else
|
||||
PictureMuteOff(); } },
|
||||
{ Cue.UShortCue("GetLampRemaining", 0), o => GetLampRemaining((int) o) },
|
||||
{ Cue.StringCue("SelectInput", 0), o => SelectInput((String)o) }
|
||||
};
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,141 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharp.CrestronIO;
|
||||
using Crestron.SimplSharpPro;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.Config;
|
||||
|
||||
using PepperDash.Essentials.Devices.Common.DSP;
|
||||
using PepperDash.Essentials.Devices.Common.VideoCodec;
|
||||
|
||||
using PepperDash.Essentials.Devices.Common;
|
||||
|
||||
namespace PepperDash.Essentials.Devices.Common
|
||||
{
|
||||
public class DeviceFactory
|
||||
{
|
||||
public static IKeyed GetDevice(DeviceConfig dc)
|
||||
{
|
||||
var key = dc.Key;
|
||||
var name = dc.Name;
|
||||
var type = dc.Type;
|
||||
var properties = dc.Properties;
|
||||
|
||||
var typeName = dc.Type.ToLower();
|
||||
var groupName = dc.Group.ToLower();
|
||||
|
||||
if (typeName == "appletv")
|
||||
{
|
||||
//var ir = IRPortHelper.GetIrPort(properties);
|
||||
//if (ir != null)
|
||||
// return new AppleTV(key, name, ir.Port, ir.FileName);
|
||||
|
||||
var irCont = IRPortHelper.GetIrOutputPortController(dc);
|
||||
return new AppleTV(key, name, irCont);
|
||||
}
|
||||
|
||||
else if (typeName == "basicirdisplay")
|
||||
{
|
||||
var ir = IRPortHelper.GetIrPort(properties);
|
||||
if (ir != null)
|
||||
return new BasicIrDisplay(key, name, ir.Port, ir.FileName);
|
||||
}
|
||||
|
||||
else if (typeName == "biamptesira")
|
||||
{
|
||||
var comm = CommFactory.CreateCommForDevice(dc);
|
||||
var props = JsonConvert.DeserializeObject<BiampTesiraFortePropertiesConfig>(
|
||||
properties.ToString());
|
||||
return new BiampTesiraForteDsp(key, name, comm, props);
|
||||
}
|
||||
|
||||
else if (typeName == "cenrfgwex")
|
||||
{
|
||||
return CenRfgwController.GetNewExGatewayController(key, name,
|
||||
properties.Value<string>("id"), properties.Value<string>("gatewayType"));
|
||||
}
|
||||
|
||||
else if (typeName == "cenerfgwpoe")
|
||||
{
|
||||
return CenRfgwController.GetNewErGatewayController(key, name,
|
||||
properties.Value<string>("id"), properties.Value<string>("gatewayType"));
|
||||
}
|
||||
|
||||
else if (groupName == "discplayer") // (typeName == "irbluray")
|
||||
{
|
||||
if (properties["control"]["method"].Value<string>() == "ir")
|
||||
{
|
||||
var irCont = IRPortHelper.GetIrOutputPortController(dc);
|
||||
return new IRBlurayBase(key, name, irCont);
|
||||
}
|
||||
else if (properties["control"]["method"].Value<string>() == "com")
|
||||
{
|
||||
Debug.Console(0, "[{0}] COM Device type not implemented YET!", key);
|
||||
}
|
||||
}
|
||||
|
||||
else if (typeName == "genericaudiooutwithvolume")
|
||||
{
|
||||
var zone = dc.Properties.Value<uint>("zone");
|
||||
return new GenericAudioOutWithVolume(key, name,
|
||||
dc.Properties.Value<string>("volumeDeviceKey"), zone);
|
||||
}
|
||||
|
||||
else if (groupName == "genericsource")
|
||||
{
|
||||
return new GenericSource(key, name);
|
||||
}
|
||||
|
||||
else if (typeName == "inroompc")
|
||||
{
|
||||
return new InRoomPc(key, name);
|
||||
}
|
||||
|
||||
else if (typeName == "laptop")
|
||||
{
|
||||
return new Laptop(key, name);
|
||||
}
|
||||
|
||||
else if (typeName == "mockvc")
|
||||
{
|
||||
var props = JsonConvert.DeserializeObject
|
||||
<PepperDash.Essentials.Devices.Common.VideoCodec.MockVcPropertiesConfig>(properties.ToString());
|
||||
return new PepperDash.Essentials.Devices.Common.VideoCodec
|
||||
.MockVC(key, name, props);
|
||||
}
|
||||
|
||||
else if (typeName.StartsWith("ciscospark"))
|
||||
{
|
||||
var comm = CommFactory.CreateCommForDevice(dc);
|
||||
var props = JsonConvert.DeserializeObject<Codec.CiscoSparkCodecPropertiesConfig>(properties.ToString());
|
||||
return new PepperDash.Essentials.Devices.Common.VideoCodec.Cisco.CiscoSparkCodec(key, name, comm, props);
|
||||
}
|
||||
|
||||
else if (groupName == "settopbox") //(typeName == "irstbbase")
|
||||
{
|
||||
var irCont = IRPortHelper.GetIrOutputPortController(dc);
|
||||
var config = dc.Properties.ToObject<SetTopBoxPropertiesConfig>();
|
||||
var stb = new IRSetTopBoxBase(key, name, irCont, config);
|
||||
|
||||
//stb.HasDvr = properties.Value<bool>("hasDvr");
|
||||
var listName = properties.Value<string>("presetsList");
|
||||
if (listName != null)
|
||||
stb.LoadPresets(listName);
|
||||
return stb;
|
||||
}
|
||||
|
||||
else if (typeName == "roku")
|
||||
{
|
||||
var irCont = IRPortHelper.GetIrOutputPortController(dc);
|
||||
return new Roku2(key, name, irCont);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro.GeneralIO;
|
||||
|
||||
using PepperDash.Essentials.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Devices.Common.Occupancy
|
||||
{
|
||||
public class EssentialsGlsOccupancySensorBaseController : CrestronGenericBaseDevice, IOccupancyStatusProvider
|
||||
{
|
||||
public GlsOccupancySensorBase OccSensor { get; private set; }
|
||||
|
||||
public BoolFeedback RoomIsOccupiedFeedback { get; private set; }
|
||||
|
||||
public EssentialsGlsOccupancySensorBaseController(string key, string name, GlsOccupancySensorBase sensor, GlsOccupancySensorConfigurationProperties props)
|
||||
: base(key, name, sensor)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public class GlsOccupancySensorConfigurationProperties
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
using System.Reflection;
|
||||
|
||||
[assembly: AssemblyTitle("Essentials_Devices_Common")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("Essentials_Devices_Common")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2016")]
|
||||
[assembly: AssemblyVersion("1.0.0.*")]
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -1,343 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro;
|
||||
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.Presets;
|
||||
using PepperDash.Essentials.Core.Routing;
|
||||
|
||||
namespace PepperDash.Essentials.Devices.Common
|
||||
{
|
||||
public class IRSetTopBoxBase : Device, ISetTopBoxControls, IUiDisplayInfo, IRoutingOutputs, IUsageTracking
|
||||
{
|
||||
public IrOutputPortController IrPort { get; private set; }
|
||||
|
||||
public uint DisplayUiType { get { return DisplayUiConstants.TypeDirecTv; } }
|
||||
|
||||
|
||||
public bool HasPresets { get; set; }
|
||||
public bool HasDvr { get; set; }
|
||||
public bool HasDpad { get; set; }
|
||||
public bool HasNumeric { get; set; }
|
||||
|
||||
public DevicePresetsModel PresetsModel { get; private set; }
|
||||
|
||||
public IRSetTopBoxBase(string key, string name, IrOutputPortController portCont,
|
||||
SetTopBoxPropertiesConfig props)
|
||||
: base(key, name)
|
||||
{
|
||||
IrPort = portCont;
|
||||
DeviceManager.AddDevice(portCont);
|
||||
|
||||
HasPresets = props.HasPresets;
|
||||
HasDvr = props.HasDvr;
|
||||
HasDpad = props.HasDpad;
|
||||
HasNumeric = props.HasNumeric;
|
||||
|
||||
HasKeypadAccessoryButton1 = true;
|
||||
KeypadAccessoryButton1Command = "Dash";
|
||||
KeypadAccessoryButton1Label = "-";
|
||||
|
||||
HasKeypadAccessoryButton2 = true;
|
||||
KeypadAccessoryButton2Command = "NumericEnter";
|
||||
KeypadAccessoryButton2Label = "Enter";
|
||||
|
||||
AnyVideoOut = new RoutingOutputPort(RoutingPortNames.AnyVideoOut, eRoutingSignalType.AudioVideo,
|
||||
eRoutingPortConnectionType.Hdmi, null, this);
|
||||
AnyAudioOut = new RoutingOutputPort(RoutingPortNames.AnyAudioOut, eRoutingSignalType.Audio,
|
||||
eRoutingPortConnectionType.DigitalAudio, null, this);
|
||||
OutputPorts = new RoutingPortCollection<RoutingOutputPort> { AnyVideoOut, AnyAudioOut };
|
||||
|
||||
}
|
||||
|
||||
public void LoadPresets(string filePath)
|
||||
{
|
||||
PresetsModel = new DevicePresetsModel(Key + "-presets", this, filePath);
|
||||
DeviceManager.AddDevice(PresetsModel);
|
||||
}
|
||||
|
||||
|
||||
#region ISetTopBoxControls Members
|
||||
|
||||
public void DvrList(bool pressRelease)
|
||||
{
|
||||
IrPort.PressRelease(IROutputStandardCommands.IROut_DVR, pressRelease);
|
||||
}
|
||||
|
||||
public void Replay(bool pressRelease)
|
||||
{
|
||||
IrPort.PressRelease(IROutputStandardCommands.IROut_REPLAY, pressRelease);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region IDPad Members
|
||||
|
||||
public void Up(bool pressRelease)
|
||||
{
|
||||
IrPort.PressRelease(IROutputStandardCommands.IROut_UP_ARROW, pressRelease);
|
||||
}
|
||||
|
||||
public void Down(bool pressRelease)
|
||||
{
|
||||
IrPort.PressRelease(IROutputStandardCommands.IROut_DN_ARROW, pressRelease);
|
||||
}
|
||||
|
||||
public void Left(bool pressRelease)
|
||||
{
|
||||
IrPort.PressRelease(IROutputStandardCommands.IROut_LEFT_ARROW, pressRelease);
|
||||
}
|
||||
|
||||
public void Right(bool pressRelease)
|
||||
{
|
||||
IrPort.PressRelease(IROutputStandardCommands.IROut_RIGHT_ARROW, pressRelease);
|
||||
}
|
||||
|
||||
public void Select(bool pressRelease)
|
||||
{
|
||||
IrPort.PressRelease(IROutputStandardCommands.IROut_ENTER, pressRelease);
|
||||
}
|
||||
|
||||
public void Menu(bool pressRelease)
|
||||
{
|
||||
IrPort.PressRelease(IROutputStandardCommands.IROut_MENU, pressRelease);
|
||||
}
|
||||
|
||||
public void Exit(bool pressRelease)
|
||||
{
|
||||
IrPort.PressRelease(IROutputStandardCommands.IROut_EXIT, pressRelease);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region INumericKeypad Members
|
||||
|
||||
public void Digit0(bool pressRelease)
|
||||
{
|
||||
IrPort.PressRelease(IROutputStandardCommands.IROut_0, pressRelease);
|
||||
}
|
||||
|
||||
public void Digit1(bool pressRelease)
|
||||
{
|
||||
IrPort.PressRelease(IROutputStandardCommands.IROut_1, pressRelease);
|
||||
}
|
||||
|
||||
public void Digit2(bool pressRelease)
|
||||
{
|
||||
IrPort.PressRelease(IROutputStandardCommands.IROut_2, pressRelease);
|
||||
}
|
||||
|
||||
public void Digit3(bool pressRelease)
|
||||
{
|
||||
IrPort.PressRelease(IROutputStandardCommands.IROut_3, pressRelease);
|
||||
}
|
||||
|
||||
public void Digit4(bool pressRelease)
|
||||
{
|
||||
IrPort.PressRelease(IROutputStandardCommands.IROut_4, pressRelease);
|
||||
}
|
||||
|
||||
public void Digit5(bool pressRelease)
|
||||
{
|
||||
IrPort.PressRelease(IROutputStandardCommands.IROut_5, pressRelease);
|
||||
}
|
||||
|
||||
public void Digit6(bool pressRelease)
|
||||
{
|
||||
IrPort.PressRelease(IROutputStandardCommands.IROut_6, pressRelease);
|
||||
}
|
||||
|
||||
public void Digit7(bool pressRelease)
|
||||
{
|
||||
IrPort.PressRelease(IROutputStandardCommands.IROut_7, pressRelease);
|
||||
}
|
||||
|
||||
public void Digit8(bool pressRelease)
|
||||
{
|
||||
IrPort.PressRelease(IROutputStandardCommands.IROut_8, pressRelease);
|
||||
}
|
||||
|
||||
public void Digit9(bool pressRelease)
|
||||
{
|
||||
IrPort.PressRelease(IROutputStandardCommands.IROut_9, pressRelease);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Defaults to true
|
||||
/// </summary>
|
||||
public bool HasKeypadAccessoryButton1 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Defaults to "-"
|
||||
/// </summary>
|
||||
public string KeypadAccessoryButton1Label { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Defaults to "Dash"
|
||||
/// </summary>
|
||||
public string KeypadAccessoryButton1Command { get; set; }
|
||||
|
||||
public void KeypadAccessoryButton1(bool pressRelease)
|
||||
{
|
||||
IrPort.PressRelease(KeypadAccessoryButton1Command, pressRelease);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Defaults to true
|
||||
/// </summary>
|
||||
public bool HasKeypadAccessoryButton2 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Defaults to "Enter"
|
||||
/// </summary>
|
||||
public string KeypadAccessoryButton2Label { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Defaults to "Enter"
|
||||
/// </summary>
|
||||
public string KeypadAccessoryButton2Command { get; set; }
|
||||
|
||||
public void KeypadAccessoryButton2(bool pressRelease)
|
||||
{
|
||||
IrPort.PressRelease(KeypadAccessoryButton2Command, pressRelease);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region ISetTopBoxNumericKeypad Members
|
||||
|
||||
/// <summary>
|
||||
/// Corresponds to "dash" IR command
|
||||
/// </summary>
|
||||
public void Dash(bool pressRelease)
|
||||
{
|
||||
IrPort.PressRelease("dash", pressRelease);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Corresponds to "numericEnter" IR command
|
||||
/// </summary>
|
||||
public void KeypadEnter(bool pressRelease)
|
||||
{
|
||||
IrPort.PressRelease("numericEnter", pressRelease);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region IChannelFunctions Members
|
||||
|
||||
public void ChannelUp(bool pressRelease)
|
||||
{
|
||||
IrPort.PressRelease(IROutputStandardCommands.IROut_CH_PLUS, pressRelease);
|
||||
}
|
||||
|
||||
public void ChannelDown(bool pressRelease)
|
||||
{
|
||||
IrPort.PressRelease(IROutputStandardCommands.IROut_CH_MINUS, pressRelease);
|
||||
}
|
||||
|
||||
public void LastChannel(bool pressRelease)
|
||||
{
|
||||
IrPort.PressRelease(IROutputStandardCommands.IROut_LAST, pressRelease);
|
||||
}
|
||||
|
||||
public void Guide(bool pressRelease)
|
||||
{
|
||||
IrPort.PressRelease(IROutputStandardCommands.IROut_GUIDE, pressRelease);
|
||||
}
|
||||
|
||||
public void Info(bool pressRelease)
|
||||
{
|
||||
IrPort.PressRelease(IROutputStandardCommands.IROut_INFO, pressRelease);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region IColorFunctions Members
|
||||
|
||||
public void Red(bool pressRelease)
|
||||
{
|
||||
IrPort.PressRelease(IROutputStandardCommands.IROut_RED, pressRelease);
|
||||
}
|
||||
|
||||
public void Green(bool pressRelease)
|
||||
{
|
||||
IrPort.PressRelease(IROutputStandardCommands.IROut_GREEN, pressRelease);
|
||||
}
|
||||
|
||||
public void Yellow(bool pressRelease)
|
||||
{
|
||||
IrPort.PressRelease(IROutputStandardCommands.IROut_YELLOW, pressRelease);
|
||||
}
|
||||
|
||||
public void Blue(bool pressRelease)
|
||||
{
|
||||
IrPort.PressRelease(IROutputStandardCommands.IROut_BLUE, pressRelease);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region IRoutingOutputs Members
|
||||
|
||||
public RoutingOutputPort AnyVideoOut { get; private set; }
|
||||
public RoutingOutputPort AnyAudioOut { get; private set; }
|
||||
public RoutingPortCollection<RoutingOutputPort> OutputPorts { get; private set; }
|
||||
|
||||
#endregion
|
||||
|
||||
#region ITransport Members
|
||||
|
||||
public void ChapMinus(bool pressRelease)
|
||||
{
|
||||
IrPort.PressRelease(IROutputStandardCommands.IROut_REPLAY, pressRelease);
|
||||
}
|
||||
|
||||
public void ChapPlus(bool pressRelease)
|
||||
{
|
||||
}
|
||||
|
||||
public void FFwd(bool pressRelease)
|
||||
{
|
||||
IrPort.PressRelease(IROutputStandardCommands.IROut_FSCAN, pressRelease);
|
||||
}
|
||||
|
||||
public void Pause(bool pressRelease)
|
||||
{
|
||||
IrPort.PressRelease(IROutputStandardCommands.IROut_RSCAN, pressRelease);
|
||||
}
|
||||
|
||||
public void Play(bool pressRelease)
|
||||
{
|
||||
IrPort.PressRelease(IROutputStandardCommands.IROut_PLAY, pressRelease);
|
||||
}
|
||||
|
||||
public void Record(bool pressRelease)
|
||||
{
|
||||
IrPort.PressRelease(IROutputStandardCommands.IROut_RECORD, pressRelease);
|
||||
}
|
||||
|
||||
public void Rewind(bool pressRelease)
|
||||
{
|
||||
IrPort.PressRelease(IROutputStandardCommands.IROut_RSCAN, pressRelease);
|
||||
}
|
||||
|
||||
public void Stop(bool pressRelease)
|
||||
{
|
||||
IrPort.PressRelease(IROutputStandardCommands.IROut_STOP, pressRelease);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region IUsageTracking Members
|
||||
|
||||
public UsageTracking UsageTracker { get; set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,145 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.Routing;
|
||||
|
||||
namespace PepperDash.Essentials.Devices.Common
|
||||
{
|
||||
public class AppleTV : Device, IDPad, ITransport, IUiDisplayInfo, IRoutingOutputs
|
||||
{
|
||||
|
||||
public IrOutputPortController IrPort { get; private set; }
|
||||
public const string StandardDriverName = "Apple AppleTV-v2.ir";
|
||||
public uint DisplayUiType { get { return DisplayUiConstants.TypeAppleTv; } }
|
||||
|
||||
public AppleTV(string key, string name, IrOutputPortController portCont)
|
||||
: base(key, name)
|
||||
{
|
||||
IrPort = portCont;
|
||||
DeviceManager.AddDevice(portCont);
|
||||
|
||||
HdmiOut = new RoutingOutputPort(RoutingPortNames.HdmiOut, eRoutingSignalType.AudioVideo,
|
||||
eRoutingPortConnectionType.Hdmi, null, this);
|
||||
AnyAudioOut = new RoutingOutputPort(RoutingPortNames.AnyAudioOut, eRoutingSignalType.Audio,
|
||||
eRoutingPortConnectionType.DigitalAudio, null, this);
|
||||
OutputPorts = new RoutingPortCollection<RoutingOutputPort> { HdmiOut, AnyAudioOut };
|
||||
}
|
||||
|
||||
|
||||
#region IDPad Members
|
||||
|
||||
public void Up(bool pressRelease)
|
||||
{
|
||||
IrPort.PressRelease("+", pressRelease);
|
||||
}
|
||||
|
||||
public void Down(bool pressRelease)
|
||||
{
|
||||
IrPort.PressRelease("-", pressRelease);
|
||||
}
|
||||
|
||||
public void Left(bool pressRelease)
|
||||
{
|
||||
IrPort.PressRelease(IROutputStandardCommands.IROut_TRACK_MINUS, pressRelease);
|
||||
}
|
||||
|
||||
public void Right(bool pressRelease)
|
||||
{
|
||||
IrPort.PressRelease(IROutputStandardCommands.IROut_TRACK_PLUS, pressRelease);
|
||||
}
|
||||
|
||||
public void Select(bool pressRelease)
|
||||
{
|
||||
IrPort.PressRelease(IROutputStandardCommands.IROut_ENTER, pressRelease);
|
||||
}
|
||||
|
||||
public void Menu(bool pressRelease)
|
||||
{
|
||||
IrPort.PressRelease("Menu", pressRelease);
|
||||
}
|
||||
|
||||
public void Exit(bool pressRelease)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region ITransport Members
|
||||
|
||||
public void Play(bool pressRelease)
|
||||
{
|
||||
IrPort.PressRelease("PLAY/PAUSE", pressRelease);
|
||||
}
|
||||
|
||||
public void Pause(bool pressRelease)
|
||||
{
|
||||
IrPort.PressRelease("PLAY/PAUSE", pressRelease);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Not implemented
|
||||
/// </summary>
|
||||
/// <param name="pressRelease"></param>
|
||||
public void Rewind(bool pressRelease)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Not implemented
|
||||
/// </summary>
|
||||
/// <param name="pressRelease"></param>
|
||||
public void FFwd(bool pressRelease)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Not implemented
|
||||
/// </summary>
|
||||
/// <param name="pressRelease"></param>
|
||||
public void ChapMinus(bool pressRelease)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Not implemented
|
||||
/// </summary>
|
||||
/// <param name="pressRelease"></param>
|
||||
public void ChapPlus(bool pressRelease)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Not implemented
|
||||
/// </summary>
|
||||
/// <param name="pressRelease"></param>
|
||||
public void Stop(bool pressRelease)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Not implemented
|
||||
/// </summary>
|
||||
/// <param name="pressRelease"></param>
|
||||
public void Record(bool pressRelease)
|
||||
{
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region IRoutingOutputs Members
|
||||
|
||||
public RoutingOutputPort HdmiOut { get; private set; }
|
||||
public RoutingOutputPort AnyAudioOut { get; private set; }
|
||||
public RoutingPortCollection<RoutingOutputPort> OutputPorts { get; private set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
//using System;
|
||||
//using System.Collections.Generic;
|
||||
//using System.Linq;
|
||||
//using System.Text;
|
||||
//using Crestron.SimplSharp;
|
||||
|
||||
//namespace PepperDash.Essentials.Devices.Common.VideoCodec.CiscoCodec
|
||||
//{
|
||||
// /// <summary>
|
||||
// /// This helps convert the camera section differences between Spark and Spark+
|
||||
// /// One of them returns an object. One returns an array.
|
||||
// /// </summary>
|
||||
// public class CameraConverter : JsonConverter
|
||||
// {
|
||||
|
||||
// public override bool CanConvert(System.Type objectType)
|
||||
// {
|
||||
// return objectType == typeof(Camera) || objectType == typeof(List<Camera>);
|
||||
// }
|
||||
|
||||
// public override object ReadJson(JsonReader reader, System.Type objectType, object existingValue, JsonSerializer serializer)
|
||||
// {
|
||||
// if (reader.TokenType == JsonToken.StartArray)
|
||||
// {
|
||||
// var l = new List<Camera>();
|
||||
// reader.Read();
|
||||
// while (reader.TokenType != JsonToken.EndArray)
|
||||
// {
|
||||
// l.Add(reader.Value as Camera);
|
||||
// reader.Read();
|
||||
// }
|
||||
// return l;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// return new List<Camera> { reader.Value as Camera };
|
||||
// }
|
||||
// }
|
||||
|
||||
// public override bool CanWrite
|
||||
// {
|
||||
// get
|
||||
// {
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
|
||||
// public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
|
||||
// {
|
||||
// throw new NotImplementedException("SOD OFF HOSER");
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
@@ -1,33 +0,0 @@
|
||||
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.Devices.Common.Codec
|
||||
{
|
||||
public class CiscoSparkCodecPropertiesConfig
|
||||
{
|
||||
public CommunicationMonitorConfig CommunicationMonitorProperties { get; set; }
|
||||
|
||||
public List<CodecActiveCallItem> Favorites { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Valid values: "Local" or "Corporate"
|
||||
/// </summary>
|
||||
public string PhonebookMode { get; set; }
|
||||
|
||||
public bool ShowSelfViewByDefault { get; set; }
|
||||
|
||||
public SharingProperties Sharing { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public class SharingProperties
|
||||
{
|
||||
public bool AutoShareContentWhileInCall { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,314 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.Routing;
|
||||
using PepperDash.Essentials.Devices.Common;
|
||||
using PepperDash.Essentials.Devices.Common.Codec;
|
||||
|
||||
namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
||||
{
|
||||
public abstract class VideoCodecBase : Device, IRoutingInputsOutputs,
|
||||
IUsageTracking, IHasDialer, IHasContentSharing, ICodecAudio, iCodecInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// Fires when the status of any active, dialing, or incoming call changes or is new
|
||||
/// </summary>
|
||||
public event EventHandler<CodecCallStatusItemChangeEventArgs> CallStatusChange;
|
||||
|
||||
public event EventHandler<EventArgs> IsReadyChange;
|
||||
|
||||
public IBasicCommunication Communication { get; protected set; }
|
||||
|
||||
#region IUsageTracking Members
|
||||
|
||||
/// <summary>
|
||||
/// This object can be added by outside users of this class to provide usage tracking
|
||||
/// for various services
|
||||
/// </summary>
|
||||
public UsageTracking UsageTracker { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// An internal pseudo-source that is routable and connected to the osd input
|
||||
/// </summary>
|
||||
public DummyRoutingInputsDevice OsdSource { get; protected set; }
|
||||
|
||||
public RoutingPortCollection<RoutingInputPort> InputPorts { get; private set; }
|
||||
|
||||
public RoutingPortCollection<RoutingOutputPort> OutputPorts { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns true when any call is not in state Unknown, Disconnecting, Disconnected
|
||||
/// </summary>
|
||||
public bool IsInCall
|
||||
{
|
||||
get
|
||||
{
|
||||
var value = ActiveCalls.Any(c => c.IsActiveCall);
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
||||
public BoolFeedback StandbyIsOnFeedback { get; private set; }
|
||||
|
||||
abstract protected Func<bool> PrivacyModeIsOnFeedbackFunc { get; }
|
||||
abstract protected Func<int> VolumeLevelFeedbackFunc { get; }
|
||||
abstract protected Func<bool> MuteFeedbackFunc { get; }
|
||||
abstract protected Func<bool> StandbyIsOnFeedbackFunc { get; }
|
||||
|
||||
public List<CodecActiveCallItem> ActiveCalls { get; set; }
|
||||
|
||||
public VideoCodecInfo CodecInfo { get; protected set; }
|
||||
|
||||
public bool ShowSelfViewByDefault { get; protected set; }
|
||||
|
||||
|
||||
public bool IsReady { get; protected set; }
|
||||
|
||||
public VideoCodecBase(string key, string name)
|
||||
: base(key, name)
|
||||
{
|
||||
StandbyIsOnFeedback = new BoolFeedback(StandbyIsOnFeedbackFunc);
|
||||
PrivacyModeIsOnFeedback = new BoolFeedback(PrivacyModeIsOnFeedbackFunc);
|
||||
VolumeLevelFeedback = new IntFeedback(VolumeLevelFeedbackFunc);
|
||||
MuteFeedback = new BoolFeedback(MuteFeedbackFunc);
|
||||
SharingSourceFeedback = new StringFeedback(SharingSourceFeedbackFunc);
|
||||
SharingContentIsOnFeedback = new BoolFeedback(SharingContentIsOnFeedbackFunc);
|
||||
|
||||
InputPorts = new RoutingPortCollection<RoutingInputPort>();
|
||||
OutputPorts = new RoutingPortCollection<RoutingOutputPort>();
|
||||
|
||||
ActiveCalls = new List<CodecActiveCallItem>();
|
||||
}
|
||||
|
||||
#region IHasDialer Members
|
||||
|
||||
public abstract void Dial(string number);
|
||||
public abstract void Dial(Meeting meeting);
|
||||
public abstract void EndCall(CodecActiveCallItem call);
|
||||
public abstract void EndAllCalls();
|
||||
public abstract void AcceptCall(CodecActiveCallItem call);
|
||||
public abstract void RejectCall(CodecActiveCallItem call);
|
||||
public abstract void SendDtmf(string s);
|
||||
|
||||
#endregion
|
||||
|
||||
public virtual List<Feedback> Feedbacks
|
||||
{
|
||||
get
|
||||
{
|
||||
return new List<Feedback>
|
||||
{
|
||||
PrivacyModeIsOnFeedback,
|
||||
SharingSourceFeedback
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public abstract void ExecuteSwitch(object selector);
|
||||
|
||||
/// <summary>
|
||||
/// Helper method to fire CallStatusChange event with old and new status
|
||||
/// </summary>
|
||||
protected void SetNewCallStatusAndFireCallStatusChange(eCodecCallStatus newStatus, CodecActiveCallItem call)
|
||||
{
|
||||
call.Status = newStatus;
|
||||
|
||||
OnCallStatusChange(call);
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="previousStatus"></param>
|
||||
/// <param name="newStatus"></param>
|
||||
/// <param name="item"></param>
|
||||
protected void OnCallStatusChange(CodecActiveCallItem item)
|
||||
{
|
||||
var handler = CallStatusChange;
|
||||
if (handler != null)
|
||||
handler(this, new CodecCallStatusItemChangeEventArgs(item));
|
||||
|
||||
if (AutoShareContentWhileInCall)
|
||||
StartSharing();
|
||||
|
||||
if(IsInCall && !UsageTracker.UsageTrackingStarted)
|
||||
UsageTracker.StartDeviceUsage();
|
||||
else if(UsageTracker.UsageTrackingStarted && !IsInCall)
|
||||
UsageTracker.EndDeviceUsage();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets IsReady property and fires the event. Used for dependent classes to sync up their data.
|
||||
/// </summary>
|
||||
protected void SetIsReady()
|
||||
{
|
||||
IsReady = true;
|
||||
var h = IsReadyChange;
|
||||
if(h != null)
|
||||
h(this, new EventArgs());
|
||||
}
|
||||
|
||||
#region ICodecAudio Members
|
||||
|
||||
public abstract void PrivacyModeOn();
|
||||
public abstract void PrivacyModeOff();
|
||||
public abstract void PrivacyModeToggle();
|
||||
public BoolFeedback PrivacyModeIsOnFeedback { get; private set; }
|
||||
|
||||
|
||||
public BoolFeedback MuteFeedback { get; private set; }
|
||||
|
||||
public abstract void MuteOff();
|
||||
|
||||
public abstract void MuteOn();
|
||||
|
||||
public abstract void SetVolume(ushort level);
|
||||
|
||||
public IntFeedback VolumeLevelFeedback { get; private set; }
|
||||
|
||||
public abstract void MuteToggle();
|
||||
|
||||
public abstract void VolumeDown(bool pressRelease);
|
||||
|
||||
|
||||
public abstract void VolumeUp(bool pressRelease);
|
||||
|
||||
#endregion
|
||||
|
||||
#region IHasSharing Members
|
||||
|
||||
public abstract void StartSharing();
|
||||
public abstract void StopSharing();
|
||||
|
||||
public bool AutoShareContentWhileInCall { get; protected set; }
|
||||
|
||||
public StringFeedback SharingSourceFeedback { get; private set; }
|
||||
public BoolFeedback SharingContentIsOnFeedback { get; private set; }
|
||||
|
||||
abstract protected Func<string> SharingSourceFeedbackFunc { get; }
|
||||
abstract protected Func<bool> SharingContentIsOnFeedbackFunc { get; }
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
// **** DEBUGGING THINGS ****
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public virtual void ListCalls()
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
foreach (var c in ActiveCalls)
|
||||
sb.AppendFormat("{0} {1} -- {2} {3}\n", c.Id, c.Number, c.Name, c.Status);
|
||||
Debug.Console(1, this, "\n{0}\n", sb.ToString());
|
||||
}
|
||||
|
||||
public abstract void StandbyActivate();
|
||||
|
||||
public abstract void StandbyDeactivate();
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Used to track the status of syncronizing the phonebook values when connecting to a codec or refreshing the phonebook info
|
||||
/// </summary>
|
||||
public class CodecPhonebookSyncState : IKeyed
|
||||
{
|
||||
bool _InitialSyncComplete;
|
||||
|
||||
public event EventHandler<EventArgs> InitialSyncCompleted;
|
||||
|
||||
public string Key { get; private set; }
|
||||
|
||||
public bool InitialSyncComplete
|
||||
{
|
||||
get { return _InitialSyncComplete; }
|
||||
private set
|
||||
{
|
||||
if (value == true)
|
||||
{
|
||||
var handler = InitialSyncCompleted;
|
||||
if (handler != null)
|
||||
handler(this, new EventArgs());
|
||||
}
|
||||
_InitialSyncComplete = value;
|
||||
}
|
||||
}
|
||||
|
||||
public bool InitialPhonebookFoldersWasReceived { get; private set; }
|
||||
|
||||
public bool NumberOfContactsWasReceived { get; private set; }
|
||||
|
||||
public bool PhonebookRootEntriesWasRecieved { get; private set; }
|
||||
|
||||
public bool PhonebookHasFolders { get; private set; }
|
||||
|
||||
public int NumberOfContacts { get; private set; }
|
||||
|
||||
public CodecPhonebookSyncState(string key)
|
||||
{
|
||||
Key = key;
|
||||
|
||||
CodecDisconnected();
|
||||
}
|
||||
|
||||
public void InitialPhonebookFoldersReceived()
|
||||
{
|
||||
InitialPhonebookFoldersWasReceived = true;
|
||||
|
||||
CheckSyncStatus();
|
||||
}
|
||||
|
||||
public void PhonebookRootEntriesReceived()
|
||||
{
|
||||
PhonebookRootEntriesWasRecieved = true;
|
||||
|
||||
CheckSyncStatus();
|
||||
}
|
||||
|
||||
public void SetPhonebookHasFolders(bool value)
|
||||
{
|
||||
PhonebookHasFolders = value;
|
||||
|
||||
Debug.Console(1, this, "Phonebook has folders: {0}", PhonebookHasFolders);
|
||||
}
|
||||
|
||||
public void SetNumberOfContacts(int contacts)
|
||||
{
|
||||
NumberOfContacts = contacts;
|
||||
NumberOfContactsWasReceived = true;
|
||||
|
||||
Debug.Console(1, this, "Phonebook contains {0} contacts.", NumberOfContacts);
|
||||
|
||||
CheckSyncStatus();
|
||||
}
|
||||
|
||||
public void CodecDisconnected()
|
||||
{
|
||||
InitialPhonebookFoldersWasReceived = false;
|
||||
PhonebookHasFolders = false;
|
||||
NumberOfContacts = 0;
|
||||
NumberOfContactsWasReceived = false;
|
||||
}
|
||||
|
||||
void CheckSyncStatus()
|
||||
{
|
||||
if (InitialPhonebookFoldersWasReceived && NumberOfContactsWasReceived && PhonebookRootEntriesWasRecieved)
|
||||
{
|
||||
InitialSyncComplete = true;
|
||||
Debug.Console(1, this, "Initial Phonebook Sync Complete!");
|
||||
}
|
||||
else
|
||||
InitialSyncComplete = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
1
Essentials-Template-UI
Submodule
1
Essentials-Template-UI
Submodule
Submodule Essentials-Template-UI added at 8eaf88791b
@@ -1,162 +0,0 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharp.CrestronIO;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core.Config;
|
||||
|
||||
namespace PepperDash.Essentials
|
||||
{
|
||||
/// <summary>
|
||||
/// Loads the ConfigObject from the file
|
||||
/// </summary>
|
||||
public class ConfigReader
|
||||
{
|
||||
public static EssentialsConfig ConfigObject { get; private set; }
|
||||
|
||||
public static void LoadConfig2()
|
||||
{
|
||||
Debug.Console(0, "Using unmerged system/template configs.");
|
||||
try
|
||||
{
|
||||
using (StreamReader fs = new StreamReader(string.Format(@"\NVRAM\program{0}\ConfigurationFile.json",
|
||||
InitialParametersClass.ApplicationNumber)))
|
||||
{
|
||||
var doubleObj = JObject.Parse(fs.ReadToEnd());
|
||||
ConfigObject = MergeConfigs(doubleObj).ToObject<EssentialsConfig>();
|
||||
|
||||
// Extract SystemUrl and TemplateUrl
|
||||
|
||||
if (doubleObj["system_url"] != null)
|
||||
{
|
||||
ConfigObject.SystemUrl = doubleObj["system_url"].Value<string>();
|
||||
}
|
||||
|
||||
if (doubleObj["template_url"] != null)
|
||||
{
|
||||
ConfigObject.TemplateUrl= doubleObj["template_url"].Value<string>();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.Console(0, "Config failed: \r{0}", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static JObject MergeConfigs(JObject doubleConfig)
|
||||
{
|
||||
var system = JObject.FromObject(doubleConfig["system"]);
|
||||
var template = JObject.FromObject(doubleConfig["template"]);
|
||||
var merged = new JObject();
|
||||
|
||||
// Put together top-level objects
|
||||
if (system["info"] != null)
|
||||
merged.Add("info", Merge(template["info"], system["info"]));
|
||||
else
|
||||
merged.Add("info", template["info"]);
|
||||
|
||||
merged.Add("devices", MergeArraysOnTopLevelProperty(template["devices"] as JArray,
|
||||
system["devices"] as JArray, "uid"));
|
||||
|
||||
if (system["rooms"] == null)
|
||||
merged.Add("rooms", template["rooms"]);
|
||||
else
|
||||
merged.Add("rooms", MergeArraysOnTopLevelProperty(template["rooms"] as JArray,
|
||||
system["rooms"] as JArray, "key"));
|
||||
|
||||
if (system["sourceLists"] == null)
|
||||
merged.Add("sourceLists", template["sourceLists"]);
|
||||
else
|
||||
merged.Add("sourceLists", Merge(template["sourceLists"], system["sourceLists"]));
|
||||
|
||||
// Template tie lines take precdence. Config tool probably can't do them at system
|
||||
// level anyway...
|
||||
if (template["tieLines"] != null)
|
||||
merged.Add("tieLines", template["tieLines"]);
|
||||
else if (system["tieLines"] != null)
|
||||
merged.Add("tieLines", system["tieLines"]);
|
||||
else
|
||||
merged.Add("tieLines", new JArray());
|
||||
|
||||
//Debug.Console(0, "MERGED RESULT: \x0d\x0a{0}", merged);
|
||||
return merged;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Merges the contents of a base and a delta array, matching the entries on a top-level property
|
||||
/// given by propertyName. Returns a merge of them. Items in the delta array that do not have
|
||||
/// a matched item in base array will not be merged.
|
||||
/// </summary>
|
||||
static JArray MergeArraysOnTopLevelProperty(JArray a1, JArray a2, string propertyName)
|
||||
{
|
||||
var result = new JArray();
|
||||
if (a2 == null)
|
||||
result = a1;
|
||||
else if (a1 != null)
|
||||
{
|
||||
for (int i = 0; i < a1.Count(); i++)
|
||||
{
|
||||
var a1Dev = a1[i];
|
||||
// Try to get a system device and if found, merge it onto template
|
||||
var a2Match = a2.FirstOrDefault(t => t[propertyName].Equals(a1Dev[propertyName]));// t.Value<int>("uid") == tmplDev.Value<int>("uid"));
|
||||
if (a2Match != null)
|
||||
{
|
||||
var mergedItem = Merge(a1Dev, a2Match);// Merge(JObject.FromObject(a1Dev), JObject.FromObject(a2Match));
|
||||
result.Add(mergedItem);
|
||||
}
|
||||
else
|
||||
result.Add(a1Dev);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Helper for using with JTokens. Converts to JObject
|
||||
/// </summary>
|
||||
static JObject Merge(JToken t1, JToken t2)
|
||||
{
|
||||
return Merge(JObject.FromObject(t1), JObject.FromObject(t2));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Merge b ONTO a
|
||||
/// </summary>
|
||||
/// <param name="a"></param>
|
||||
/// <param name="b"></param>
|
||||
static JObject Merge(JObject o1, JObject o2)
|
||||
{
|
||||
//Console.WriteLine("Merging {0}\ronto {1}", o2, o1);
|
||||
foreach (var o2Prop in o2)
|
||||
{
|
||||
var o1Value = o1[o2Prop.Key];
|
||||
if (o1Value == null)
|
||||
o1.Add(o2Prop.Key, o2Prop.Value);
|
||||
else
|
||||
{
|
||||
JToken replacement = null;
|
||||
if (o2Prop.Value.HasValues && o1Value.HasValues) // Drill down
|
||||
replacement = Merge(JObject.FromObject(o1Value), JObject.FromObject(o2Prop.Value));
|
||||
else
|
||||
replacement = o2Prop.Value;
|
||||
o1[o2Prop.Key].Replace(replacement);
|
||||
}
|
||||
}
|
||||
return o1;
|
||||
}
|
||||
|
||||
public static string GetGroupForDeviceKey(string key)
|
||||
{
|
||||
var dev = ConfigObject.Devices.FirstOrDefault(d => d.Key.Equals(key, StringComparison.OrdinalIgnoreCase));
|
||||
return dev == null ? null : dev.Group;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,74 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharp.CrestronIO;
|
||||
using Crestron.SimplSharpPro;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.Config;
|
||||
|
||||
namespace PepperDash.Essentials
|
||||
{
|
||||
public class DeviceFactory
|
||||
{
|
||||
public static IKeyed GetDevice(DeviceConfig dc)
|
||||
{
|
||||
var key = dc.Key;
|
||||
var name = dc.Name;
|
||||
var type = dc.Type;
|
||||
var properties = dc.Properties;
|
||||
|
||||
var typeName = dc.Type.ToLower();
|
||||
|
||||
if (typeName == "amplifier")
|
||||
{
|
||||
return new Amplifier(dc.Key, dc.Name);
|
||||
}
|
||||
else if (dc.Group.ToLower() == "touchpanel") // typeName.StartsWith("tsw"))
|
||||
{
|
||||
var comm = CommFactory.GetControlPropertiesConfig(dc);
|
||||
|
||||
var props = JsonConvert.DeserializeObject<CrestronTouchpanelPropertiesConfig>(
|
||||
properties.ToString());
|
||||
return new EssentialsTouchpanelController(key, name, typeName, props, comm.IpIdInt);
|
||||
}
|
||||
|
||||
else if (typeName == "mockdisplay")
|
||||
{
|
||||
return new MockDisplay(key, name);
|
||||
}
|
||||
|
||||
else if (typeName == "generic")
|
||||
{
|
||||
return new Device(key, name);
|
||||
}
|
||||
|
||||
// MOVE into something else???
|
||||
else if (typeName == "basicirdisplay")
|
||||
{
|
||||
var ir = IRPortHelper.GetIrPort(properties);
|
||||
if (ir != null)
|
||||
return new BasicIrDisplay(key, name, ir.Port, ir.FileName);
|
||||
}
|
||||
|
||||
else if (typeName == "commmock")
|
||||
{
|
||||
var comm = CommFactory.CreateCommForDevice(dc);
|
||||
var props = JsonConvert.DeserializeObject<ConsoleCommMockDevicePropertiesConfig>(
|
||||
properties.ToString());
|
||||
return new ConsoleCommMockDevice(key, name, props, comm);
|
||||
}
|
||||
|
||||
else if (typeName == "webserver")
|
||||
{
|
||||
var props = JsonConvert.DeserializeObject<CotijaConfig>(properties.ToString());
|
||||
return new CotijaSystemController(key, name, props);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,72 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.Config;
|
||||
|
||||
namespace PepperDash.Essentials
|
||||
{
|
||||
|
||||
//public class TPConfig : DeviceConfig
|
||||
//{
|
||||
// new public TPConfigProperties Properties { get; set; }
|
||||
//}
|
||||
|
||||
//public class TPConfigProperties
|
||||
//{
|
||||
// /*
|
||||
// "properties": {
|
||||
// "ipId": "aa",
|
||||
// "defaultSystemKey": "system1",
|
||||
// "sgdPath": "\\NVRAM\\Program1\\Sgds\\PepperDash Essentials TSW1050_v0.9.sgd",
|
||||
// "usesSplashPage": true,
|
||||
// "showDate": true,
|
||||
// "showTime": false
|
||||
// }
|
||||
// */
|
||||
// public uint IpId { get; set; }
|
||||
// public string deafultSystemKey { get; set; }
|
||||
// public string SgdPath { get; set; }
|
||||
// public bool UsesSplashPage { get; set; }
|
||||
// public bool ShowDate { get; set; }
|
||||
// public bool ShowTime { get; set; }
|
||||
|
||||
//}
|
||||
|
||||
|
||||
|
||||
|
||||
///// <summary>
|
||||
///// The gist of this converter: The comspec JSON comes in with normal values that need to be converted
|
||||
///// into enum names. This converter takes the value and applies the appropriate enum's name prefix to the value
|
||||
///// and then returns the enum value using Enum.Parse
|
||||
///// </summary>
|
||||
//public class TPPropertiesConverter : JsonConverter
|
||||
//{
|
||||
// public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
|
||||
// {
|
||||
// return JObject.Load(reader);
|
||||
// }
|
||||
|
||||
// /// <summary>
|
||||
// /// This will be hit with every value in the ComPortConfig class. We only need to
|
||||
// /// do custom conversion on the comspec items.
|
||||
// /// </summary>
|
||||
// public override bool CanConvert(Type objectType)
|
||||
// {
|
||||
// return true;
|
||||
// }
|
||||
|
||||
// public override bool CanRead { get { return true; } }
|
||||
// public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
|
||||
// {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
//}
|
||||
}
|
||||
@@ -1,82 +0,0 @@
|
||||
using System.Linq;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Core;
|
||||
|
||||
namespace PepperDash.Essentials
|
||||
{
|
||||
public class ConfigTieLine
|
||||
{
|
||||
[JsonProperty(Required=Required.Always)]
|
||||
public string SourceDeviceKey { get; set; }
|
||||
|
||||
[JsonProperty(Required = Required.Always)]
|
||||
public string SourcePortKey { get; set; }
|
||||
|
||||
[JsonProperty(Required = Required.Always)]
|
||||
public string DestinationDeviceKey { get; set; }
|
||||
|
||||
[JsonProperty(Required = Required.Always)]
|
||||
public string DestinationPortKey { get; set; }
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return string.Format("Tie line: [{0}]{1} --> [{2}]{3}", SourceDeviceKey, SourcePortKey, DestinationDeviceKey, DestinationPortKey);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a tie line if one can be constructed between the two devices and ports
|
||||
/// </summary>
|
||||
/// <returns>TieLine or null if devices or ports don't exist</returns>
|
||||
public TieLine GetTieLine()
|
||||
{
|
||||
var sourceDevice = (IRoutingOutputs)DeviceManager.GetDeviceForKey(SourceDeviceKey);
|
||||
var destinationDevice = (IRoutingInputs)DeviceManager.GetDeviceForKey(DestinationDeviceKey);
|
||||
|
||||
if (sourceDevice == null)
|
||||
{
|
||||
Debug.Console(0, " Cannot create TieLine. Source device '{0}' not found or does not have outputs",
|
||||
SourceDeviceKey);
|
||||
return null;
|
||||
}
|
||||
else if (destinationDevice == null)
|
||||
{
|
||||
Debug.Console(0, " Cannot create TieLine. Destination device '{0}' not found or does not have inputs",
|
||||
DestinationDeviceKey);
|
||||
return null;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Get the ports by key name from the lists
|
||||
RoutingOutputPort sourcePort = sourceDevice.OutputPorts.FirstOrDefault(
|
||||
p => p.Key.Equals(SourcePortKey, System.StringComparison.OrdinalIgnoreCase));
|
||||
//RoutingOutputPort sourcePort = null;
|
||||
//sourceDevice.OutputPorts.TryGetValue(SourcePortKey, out sourcePort);
|
||||
if (sourcePort == null)
|
||||
{
|
||||
Debug.Console(0, " Cannot create TieLine {0}-->{1}. Source device does not have output port '{2}'",
|
||||
sourceDevice.Key, destinationDevice.Key, SourcePortKey);
|
||||
return null;
|
||||
}
|
||||
|
||||
RoutingInputPort destinationPort = destinationDevice.InputPorts.FirstOrDefault(
|
||||
p => p.Key.Equals(DestinationPortKey, System.StringComparison.OrdinalIgnoreCase));
|
||||
//RoutingInputPort destinationPort = null;
|
||||
//destinationDevice.InputPorts.TryGetValue(DestinationPortKey, out destinationPort);
|
||||
if (destinationPort == null)
|
||||
{
|
||||
Debug.Console(0, " Cannot create TieLine {0}-->{1}. Destination device does not have input port '{2}'",
|
||||
sourceDevice.Key, destinationDevice.Key, DestinationPortKey);
|
||||
return null;
|
||||
}
|
||||
|
||||
var tl = new TieLine(sourcePort, destinationPort);
|
||||
Debug.Console(1, " Created {0}", this);
|
||||
return tl;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,287 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharp.CrestronIO;
|
||||
using Crestron.SimplSharpPro;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
using Crestron.SimplSharpPro.CrestronThread;
|
||||
using Crestron.SimplSharpPro.Diagnostics;
|
||||
using Crestron.SimplSharpPro.EthernetCommunication;
|
||||
using Crestron.SimplSharpPro.UI;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Devices;
|
||||
//using PepperDash.Essentials.Core.Devices.Dm;
|
||||
//using PepperDash.Essentials.Fusion;
|
||||
using PepperDash.Core;
|
||||
|
||||
namespace PepperDash.Essentials
|
||||
{
|
||||
public static class Configuration
|
||||
{
|
||||
|
||||
public static string LastPath { get; private set; }
|
||||
public static CrestronControlSystem ControlSystem { get; private set; }
|
||||
|
||||
public static void Initialize(CrestronControlSystem cs)
|
||||
{
|
||||
CrestronConsole.AddNewConsoleCommand(ReloadFromConsole, "configreload", "Reloads configuration file",
|
||||
ConsoleAccessLevelEnum.AccessOperator);
|
||||
ControlSystem = cs;
|
||||
}
|
||||
|
||||
public static bool ReadConfiguration(string filePath)
|
||||
{
|
||||
try
|
||||
{
|
||||
// Read file
|
||||
if (File.Exists(filePath))
|
||||
{
|
||||
LastPath = filePath;
|
||||
string json = File.ReadToEnd(filePath, System.Text.Encoding.ASCII);
|
||||
JObject jo = JObject.Parse(json);
|
||||
|
||||
var info = JsonConvert.DeserializeObject<ConfigInfo>(jo["info"].ToString());
|
||||
Debug.Console(0, "\r[Config] file read:");
|
||||
Debug.Console(0, " File: {0}", filePath);
|
||||
Debug.Console(0, " Name: {0}", info.Name);
|
||||
Debug.Console(0, " Type: {0}", info.SystemTemplateType);
|
||||
Debug.Console(0, " Date: {0}", info.EditDate);
|
||||
Debug.Console(0, " ConfigVersion: {0}", info.Version);
|
||||
Debug.Console(0, " EditedBy: {0}", info.EditedBy);
|
||||
Debug.Console(0, " Comment: {0}\r", info.Comment);
|
||||
|
||||
// Get the main config object
|
||||
var jConfig = jo["configuration"];
|
||||
|
||||
// Devices
|
||||
var jDevices = (JArray)jConfig["devices"];
|
||||
CreateDevices(jDevices);
|
||||
|
||||
// TieLines
|
||||
var jRouting = jConfig["routing"];
|
||||
CreateRouting(jRouting);
|
||||
|
||||
/// Parse the available source list(s)
|
||||
var jSourceLists = (JArray)jConfig["sourceLists"];
|
||||
var jSourceListJson = jSourceLists.ToString();
|
||||
List<ConfigSourceList> sourceLists = JsonConvert.DeserializeObject<List<ConfigSourceList>>(jSourceListJson);
|
||||
|
||||
// System
|
||||
var jSystems = (JArray)jConfig["systems"];
|
||||
CreateSystems(jSystems, sourceLists);
|
||||
|
||||
// Activate everything
|
||||
DeviceManager.ActivateAll();
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Console(0, "[Config] file not found '{0}'", filePath);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.Console(0, "Configuration read error: \r {0}", e);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static void CreateDevices(JArray jDevices)
|
||||
{
|
||||
//Debug.Console(0, " Creating {0} devices", jDevices.Count);
|
||||
//for (int i = 0; i < jDevices.Count; i++)
|
||||
//{
|
||||
// var jDev = jDevices[i];
|
||||
|
||||
// //var devConfig = JsonConvert.DeserializeObject<DeviceConfig>(jDev.ToString());
|
||||
// //Debug.Console(0, "++++++++++++{0}", devConfig);
|
||||
|
||||
|
||||
// var group = jDev["group"].Value<string>();
|
||||
// Debug.Console(0, " [{0}], creating {1}:{2}", jDev["key"].Value<string>(),
|
||||
// group, jDev["type"].Value<string>());
|
||||
|
||||
// Device dev = null;
|
||||
// if (group.Equals("Display", StringComparison.OrdinalIgnoreCase))
|
||||
// dev = DisplayFactory.CreateDisplay(jDev);
|
||||
// else if (group.Equals("DeviceMonitor", StringComparison.OrdinalIgnoreCase))
|
||||
// dev = DeviceManagerFactory.Create(jDev);
|
||||
// //else if (group.Equals("Pc", StringComparison.OrdinalIgnoreCase))
|
||||
// // dev = PcFactory.Create(jDev);
|
||||
// //else if (group.Equals("SetTopBox", StringComparison.OrdinalIgnoreCase))
|
||||
// // dev = SetTopBoxFactory.Create(jDev);
|
||||
// //else if (group.Equals("DiscPlayer", StringComparison.OrdinalIgnoreCase))
|
||||
// // dev = DiscPlayerFactory.Create(jDev);
|
||||
// //else if (group.Equals("Touchpanel", StringComparison.OrdinalIgnoreCase))
|
||||
// // dev = TouchpanelFactory.Create(jDev);
|
||||
// else if (group.Equals("dmEndpoint", StringComparison.OrdinalIgnoreCase)) // Add Transmitter and Receiver
|
||||
// dev = DmFactory.Create(jDev);
|
||||
// else if (group.Equals("dmChassic", StringComparison.OrdinalIgnoreCase))
|
||||
// dev = DmFactory.CreateChassis(jDev);
|
||||
// else if (group.Equals("processor", StringComparison.OrdinalIgnoreCase))
|
||||
// continue; // ignore it. Has no value right now.
|
||||
// //else if (group.Equals("remote", StringComparison.OrdinalIgnoreCase))
|
||||
// // dev = RemoteFactory.Create(jDev);
|
||||
// else
|
||||
// {
|
||||
// Debug.Console(0, " ERROR: Device [{0}] has unknown Group '{1}'. Skipping",
|
||||
// jDev["key"].Value<string>(), group);
|
||||
// continue;
|
||||
// }
|
||||
|
||||
// if (dev != null)
|
||||
// DeviceManager.AddDevice(dev);
|
||||
// else
|
||||
// Debug.Console(0, " ERROR: failed to create device {0}",
|
||||
// jDev["key"].Value<string>());
|
||||
//}
|
||||
}
|
||||
|
||||
static void CreateSystems(JArray jSystems, List<ConfigSourceList> sourceLists)
|
||||
{
|
||||
// // assuming one system
|
||||
// var jSystem = jSystems[0];
|
||||
// var name = jSystem.Value<string>("name");
|
||||
// var key = FactoryHelper.KeyOrConvertName(jSystem.Value<string>("key"), name);
|
||||
|
||||
// if (jSystem.Value<string>("type").Equals("EssentialsHuddleSpace", StringComparison.OrdinalIgnoreCase))
|
||||
// {
|
||||
// var sys = new HuddleSpaceRoom(key, name);
|
||||
// var props = jSystem["properties"];
|
||||
// var displayKey = props["displayKey"].Value<string>();
|
||||
// if (displayKey != null)
|
||||
// sys.DefaultDisplay = (DisplayBase)DeviceManager.GetDeviceForKey(displayKey);
|
||||
|
||||
// // Add sources from passed in config list
|
||||
// var myList = sourceLists.FirstOrDefault(
|
||||
// l => l.Key.Equals(props.Value<string>("sourceListKey"), StringComparison.OrdinalIgnoreCase));
|
||||
// if (myList != null)
|
||||
// AddSourcesToSystem(sys, myList);
|
||||
|
||||
// DeviceManager.AddDevice(sys);
|
||||
|
||||
// //spin up a fusion thing too
|
||||
//#warning add this fusion connector back in later
|
||||
// //DeviceManager.AddDevice(new EssentialsHuddleSpaceFusionSystemController(sys, 0xf1));
|
||||
//}
|
||||
}
|
||||
|
||||
//static void AddSourcesToSystem(Room system, ConfigSourceList configList)
|
||||
//{
|
||||
//foreach (var configItem in configList.PresentationSources)
|
||||
//{
|
||||
// var src = (IPresentationSource)DeviceManager.GetDeviceForKey(configItem.SourceKey);
|
||||
// if (src != null)
|
||||
// system.Sources.Add(configItem.Number, src);
|
||||
// else
|
||||
// Debug.Console(0, system, "cannot find source '{0}' from list {1}",
|
||||
// configItem.SourceKey, configList.Name);
|
||||
//}
|
||||
//}
|
||||
|
||||
/// <summary>
|
||||
/// Links up routing, creates tie lines
|
||||
/// </summary>
|
||||
/// <param name="jRouting">The "Routing" JArray from configuration</param>
|
||||
static void CreateRouting(JToken jRouting)
|
||||
{
|
||||
var jsonTieLines = jRouting["tieLines"].ToString();
|
||||
var tieLineConfigs = JsonConvert.DeserializeObject<List<ConfigTieLine>>(jsonTieLines);
|
||||
foreach (var c in tieLineConfigs)
|
||||
{
|
||||
var tl = c.GetTieLine();
|
||||
if (tl != null)
|
||||
TieLineCollection.Default.Add(tl);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Returns the IIROutputPorts device (control system, etc) that contains a given IR port
|
||||
/// </summary>
|
||||
/// <param name="propsToken"></param>
|
||||
static IROutputPort GetIrPort(JToken propsToken)
|
||||
{
|
||||
var portDevName = propsToken.Value<string>("IrPortDevice");
|
||||
var portNum = propsToken.Value<uint>("IrPortNumber");
|
||||
if (portDevName.Equals("controlSystem", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
IIROutputPorts irDev = ControlSystem;
|
||||
if (portNum <= irDev.NumberOfIROutputPorts)
|
||||
return ControlSystem.IROutputPorts[portNum];
|
||||
else
|
||||
Debug.Console(0, "[Config] ERROR: IR Port {0} out of range. Range 0-{1} on {2}", portNum,
|
||||
ControlSystem.IROutputPorts.Count, irDev.ToString());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static void HandleUnknownType(JToken devToken, string type)
|
||||
{
|
||||
Debug.Console(0, "[Config] ERROR: Type '{0}' not found in group '{1}'", type,
|
||||
devToken.Value<string>("Group"));
|
||||
}
|
||||
|
||||
static void HandleDeviceCreationError(JToken devToken, Exception e)
|
||||
{
|
||||
Debug.Console(0, "[Config] ERROR creating device [{0}]: \r{1}",
|
||||
devToken["Key"].Value<string>(), e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Console helper to reload
|
||||
/// </summary>
|
||||
static void ReloadFromConsole(string s)
|
||||
{
|
||||
// Gotta tear down everything first!
|
||||
|
||||
if (!string.IsNullOrEmpty(LastPath))
|
||||
{
|
||||
ReadConfiguration(LastPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class ConfigSourceList
|
||||
{
|
||||
[JsonProperty(Required = Required.Always)]
|
||||
public string Key { get; set; }
|
||||
|
||||
[JsonProperty(Required = Required.Always)]
|
||||
public string Name { get; set; }
|
||||
|
||||
[JsonProperty(Required = Required.Always)]
|
||||
public List<ConfigSourceItem> PresentationSources { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public class ConfigSourceItem
|
||||
{
|
||||
[JsonProperty(Required = Required.Always)]
|
||||
public uint Number { get; set; }
|
||||
|
||||
[JsonProperty(Required = Required.Always)]
|
||||
public string SourceKey { get; set; }
|
||||
|
||||
public string AlternateName { get; set; }
|
||||
}
|
||||
|
||||
public class ConfigInfo
|
||||
{
|
||||
public string SystemTemplateType { get; set; }
|
||||
public string ProcessorType { get; set; }
|
||||
public string Name { get; set; }
|
||||
public uint ProgramSlotNumber { get; set; }
|
||||
public string Version { get; set; }
|
||||
public string EditedBy { get; set; }
|
||||
public string EditDate { get; set; }
|
||||
public string Comment { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace PepperDash.Essentials
|
||||
{
|
||||
public class SourceListConfigProperties
|
||||
{
|
||||
[JsonProperty(Required= Required.Always)]
|
||||
public uint Number { get; set; }
|
||||
[JsonProperty(Required= Required.Always)]
|
||||
public string SourceKey { get; set; }
|
||||
public string AltName { get; set; }
|
||||
public string AltIcon { get; set; }
|
||||
|
||||
public SourceListConfigProperties()
|
||||
{
|
||||
AltName = "";
|
||||
AltIcon = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
//using System;
|
||||
//using Crestron.SimplSharpPro;
|
||||
|
||||
//using Newtonsoft.Json;
|
||||
//using Newtonsoft.Json.Linq;
|
||||
|
||||
//using PepperDash.Essentials.Core;
|
||||
//using PepperDash.Essentials.Devices;
|
||||
//using PepperDash.Core;
|
||||
|
||||
//namespace PepperDash.Essentials
|
||||
//{
|
||||
// public class CommFactory
|
||||
// {
|
||||
// public static IBasicCommunication CreateCommForDevice(JToken devToken)
|
||||
// {
|
||||
// var devKey = devToken.Value<string>("key");
|
||||
// IBasicCommunication comm = null;
|
||||
// try
|
||||
// {
|
||||
// var control = devToken["properties"]["control"];
|
||||
// var commMethod = control["method"].Value<string>();
|
||||
// if (commMethod == "com")
|
||||
// {
|
||||
// var comConfig = JsonConvert.DeserializeObject<ComPortConfig>(
|
||||
// control["comParams"].ToString(),
|
||||
// new JsonSerializerSettings
|
||||
// {
|
||||
// // Needs ObjectCreationHandling to make the ComSpec struct populate
|
||||
// ObjectCreationHandling = ObjectCreationHandling.Replace,
|
||||
// Converters = new JsonConverter[] { new ComSpecJsonConverter() }
|
||||
// });
|
||||
// comm = new ComPortController(devKey + "-com", comConfig.GetComPort(), comConfig.ComSpec);
|
||||
// }
|
||||
// else if (commMethod == "tcpIp")
|
||||
// {
|
||||
// var tcpConfig = JsonConvert.DeserializeObject<TcpIpConfig>(control["tcpParams"].ToString());
|
||||
// comm = new GenericTcpIpClient(devKey + "-tcp", tcpConfig.Address, tcpConfig.Port, tcpConfig.BufferSize);
|
||||
// }
|
||||
// }
|
||||
// catch (Exception e)
|
||||
// {
|
||||
// Debug.Console(0, "Cannot create communication from JSON:\r{0}\r\rException:\r{1}", devToken.ToString(), e);
|
||||
// }
|
||||
|
||||
// // put it in the device manager if it's the right flavor
|
||||
// var comDev = comm as Device;
|
||||
// if (comDev != null)
|
||||
// DeviceManager.AddDevice(comDev);
|
||||
|
||||
// return comm;
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
@@ -1,38 +0,0 @@
|
||||
//using System;
|
||||
//using Crestron.SimplSharpPro;
|
||||
|
||||
//using Newtonsoft.Json.Linq;
|
||||
|
||||
//using PepperDash.Essentials.Core;
|
||||
//using PepperDash.Essentials.Core.Devices;
|
||||
//using PepperDash.Core;
|
||||
|
||||
//namespace PepperDash.Essentials
|
||||
//{
|
||||
// public class DeviceManagerFactory
|
||||
// {
|
||||
// public static Device Create(JToken devToken)
|
||||
// {
|
||||
// Device dev = null;
|
||||
// try
|
||||
// {
|
||||
// var devType = devToken.Value<string>("type");
|
||||
// var devKey = devToken.Value<string>("key");
|
||||
// var devName = devToken.Value<string>("name");
|
||||
// if (devType.Equals("DeviceMonitor", StringComparison.OrdinalIgnoreCase))
|
||||
// {
|
||||
// var comm = CommFactory.CreateCommForDevice(devToken);
|
||||
// if (comm == null) return null;
|
||||
// dev = new GenericCommunicationMonitoredDevice(devKey, devName, comm, devToken["properties"]["pollString"].Value<string>());
|
||||
// }
|
||||
// else
|
||||
// FactoryHelper.HandleUnknownType(devToken, devType);
|
||||
// }
|
||||
// catch (Exception e)
|
||||
// {
|
||||
// FactoryHelper.HandleDeviceCreationError(devToken, e);
|
||||
// }
|
||||
// return dev;
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
@@ -1,122 +0,0 @@
|
||||
//using System;
|
||||
//using System.Collections.Generic;
|
||||
//using System.Linq;
|
||||
//using System.Text;
|
||||
//using Crestron.SimplSharp;
|
||||
|
||||
//using Newtonsoft.Json;
|
||||
//using Newtonsoft.Json.Linq;
|
||||
|
||||
//using PepperDash.Essentials.Core;
|
||||
//using PepperDash.Essentials.Devices;
|
||||
//using PepperDash.Essentials.Displays;
|
||||
//using PepperDash.Core;
|
||||
|
||||
//namespace PepperDash.Essentials
|
||||
//{
|
||||
// public class DisplayFactory
|
||||
// {
|
||||
// public static DisplayBase CreateDisplay(JToken devToken)
|
||||
// {
|
||||
// DisplayBase dev = null;
|
||||
// try
|
||||
// {
|
||||
// var devType = devToken.Value<string>("type");
|
||||
// var devKey = devToken.Value<string>("key");
|
||||
// var devName = devToken.Value<string>("name");
|
||||
// var properties = devToken["properties"];
|
||||
|
||||
// if (devType.Equals("MockDisplay", StringComparison.OrdinalIgnoreCase))
|
||||
// dev = new MockDisplay(devKey, devName);
|
||||
|
||||
// else if (devType.Equals("NecMPSX", StringComparison.OrdinalIgnoreCase))
|
||||
// {
|
||||
// var comm = CommFactory.CreateCommForDevice(devToken);
|
||||
// if (comm == null) return null;
|
||||
// dev = new NecPSXMDisplayCom(devKey, devName, comm);
|
||||
|
||||
|
||||
|
||||
// //var commMethod = properties["control"]["method"].Value<string>();
|
||||
|
||||
// //// Helper-ize this?
|
||||
// //if(commMethod == "com")
|
||||
// //{
|
||||
// // // Move some of this up above???
|
||||
// // var comConfig = JsonConvert.DeserializeObject<ComPortConfig>(
|
||||
// // properties["control"]["comParams"].ToString(),
|
||||
// // new JsonSerializerSettings {
|
||||
// // // Needs ObjectCreationHandling to make the ComSpec struct populate
|
||||
// // ObjectCreationHandling = ObjectCreationHandling.Replace,
|
||||
// // Converters = new JsonConverter[] { new ComSpecJsonConverter() }
|
||||
// // });
|
||||
// // dev = new NecPSXMDisplayCom(devKey, devName, comConfig.GetComPort(), comConfig.ComSpec);
|
||||
// //}
|
||||
// //else if (commMethod == "tcpIp")
|
||||
// //{
|
||||
// // var spec = properties["control"]["tcpSpec"];
|
||||
// // var host = spec["address"].Value<string>();
|
||||
// // var port = spec["port"].Value<int>();
|
||||
// // dev = new NecPSXMDisplayCom(devKey, devName, host, port);
|
||||
// //}
|
||||
|
||||
|
||||
|
||||
// }
|
||||
|
||||
// else if (devType.Equals("NecNpPa550", StringComparison.OrdinalIgnoreCase))
|
||||
// {
|
||||
// var proj = new NecPaSeriesProjector(devKey, devName);
|
||||
// var comm = CreateCommunicationFromPropertiesToken(
|
||||
// devKey + "-comm", properties, 3000);
|
||||
// proj.CommunicationMethod = comm;
|
||||
// dev = proj;
|
||||
// }
|
||||
// else
|
||||
// FactoryHelper.HandleUnknownType(devToken, devType);
|
||||
// }
|
||||
// catch (Exception e)
|
||||
// {
|
||||
// FactoryHelper.HandleDeviceCreationError(devToken, e);
|
||||
// }
|
||||
// return dev;
|
||||
// }
|
||||
|
||||
// public static IBasicCommunication CreateCommunicationFromPropertiesToken(
|
||||
// string commKey, JToken properties, int bufferSize)
|
||||
// {
|
||||
// Debug.Console(2, "Building port from: {0}", properties.ToString());
|
||||
|
||||
// var tcpToken = properties["TcpIp"];
|
||||
// if (tcpToken != null)
|
||||
// {
|
||||
// // Convert the Tcp property
|
||||
// var spec = JsonConvert.DeserializeObject<TcpIpConfig>(tcpToken.ToString());
|
||||
|
||||
// var tcp = new GenericTcpIpClient(commKey, spec.Address, spec.Port, bufferSize);
|
||||
// DeviceManager.AddDevice(tcp);
|
||||
// return tcp;
|
||||
// }
|
||||
|
||||
// var com = properties["Com"];
|
||||
// if (com != null)
|
||||
// {
|
||||
// // Make the interim config object
|
||||
// var comConfig = JsonConvert.DeserializeObject<ComPortConfig>(com.ToString(),
|
||||
// new JsonSerializerSettings { ObjectCreationHandling = ObjectCreationHandling.Replace });
|
||||
|
||||
// // Get the IComPorts hardware device from the Device or Control System
|
||||
// var comDev = comConfig.GetIComPortsDeviceFromManagedDevice();
|
||||
// if (comDev != null)
|
||||
// {
|
||||
// var controller = new ComPortController(commKey, comDev.ComPorts[comConfig.ComPortNumber], comConfig.ComSpec);
|
||||
// DeviceManager.AddDevice(controller);
|
||||
// return controller;
|
||||
// }
|
||||
// }
|
||||
// Debug.Console(0, "No Tcp or Com port information for port {0}", commKey);
|
||||
// return null;
|
||||
// }
|
||||
|
||||
// }
|
||||
//}
|
||||
@@ -1,124 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Devices;
|
||||
using PepperDash.Core;
|
||||
|
||||
namespace PepperDash.Essentials
|
||||
{
|
||||
public static class FactoryHelper
|
||||
{
|
||||
public static string IrDriverPathPrefix = @"\NVRAM\IR\";
|
||||
|
||||
public static void HandleUnknownType(JToken devToken, string type)
|
||||
{
|
||||
Debug.Console(0, "[Config] ERROR: Type '{0}' not found in group '{1}'", type,
|
||||
devToken.Value<string>("group"));
|
||||
}
|
||||
|
||||
public static void HandleDeviceCreationError(JToken devToken, Exception e)
|
||||
{
|
||||
Debug.Console(0, "[Config] ERROR creating device [{0}]: \r{1}",
|
||||
devToken["key"].Value<string>(), e);
|
||||
Debug.Console(0, "Relevant config:\r{0}", devToken.ToString(Newtonsoft.Json.Formatting.Indented));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Finds either the ControlSystem or a device controller that contains IR ports and
|
||||
/// returns a port from the hardware device
|
||||
/// </summary>
|
||||
/// <param name="propsToken"></param>
|
||||
/// <returns>Crestron IrPort or null if device doesn't have IR or is not found</returns>
|
||||
public static IrOutPortConfig GetIrPort(JToken propsToken)
|
||||
{
|
||||
var irSpec = propsToken["control"]["irSpec"];
|
||||
var portDevKey = irSpec.Value<string>("portDeviceKey");
|
||||
var portNum = irSpec.Value<uint>("portNumber");
|
||||
IIROutputPorts irDev = null;
|
||||
if (portDevKey.Equals("controlSystem", StringComparison.OrdinalIgnoreCase)
|
||||
|| portDevKey.Equals("processor", StringComparison.OrdinalIgnoreCase))
|
||||
irDev = Global.ControlSystem;
|
||||
else
|
||||
irDev = DeviceManager.GetDeviceForKey(portDevKey) as IIROutputPorts;
|
||||
|
||||
if (irDev == null)
|
||||
{
|
||||
Debug.Console(0, "[Config] Error, device with IR ports '{0}' not found", portDevKey);
|
||||
return null;
|
||||
}
|
||||
|
||||
if (portNum <= irDev.NumberOfIROutputPorts) // success!
|
||||
{
|
||||
var file = IrDriverPathPrefix + irSpec["file"].Value<string>();
|
||||
return new IrOutPortConfig { Port = irDev.IROutputPorts[portNum], FileName = file };
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Console(0, "[Config] Error, device '{0}' IR port {1} out of range",
|
||||
portDevKey, portNum);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Finds either the ControlSystem or a device controller that contains com ports and
|
||||
/// returns a port from the hardware device
|
||||
/// </summary>
|
||||
/// <param name="propsToken">The Properties token from the device's config</param>
|
||||
/// <returns>Crestron ComPort or null if device doesn't have IR or is not found</returns>
|
||||
public static ComPort GetComPort(JToken propsToken)
|
||||
{
|
||||
var portDevKey = propsToken.Value<string>("comPortDevice");
|
||||
var portNum = propsToken.Value<uint>("comPortNumber");
|
||||
IComPorts comDev = null;
|
||||
if (portDevKey.Equals("controlSystem", StringComparison.OrdinalIgnoreCase))
|
||||
comDev = Global.ControlSystem;
|
||||
else
|
||||
comDev = DeviceManager.GetDeviceForKey(portDevKey) as IComPorts;
|
||||
|
||||
if (comDev == null)
|
||||
{
|
||||
Debug.Console(0, "[Config] Error, device with com ports '{0}' not found", portDevKey);
|
||||
return null;
|
||||
}
|
||||
|
||||
if (portNum <= comDev.NumberOfComPorts) // success!
|
||||
return comDev.ComPorts[portNum];
|
||||
else
|
||||
{
|
||||
Debug.Console(0, "[Config] Error, device '{0}' com port {1} out of range",
|
||||
portDevKey, portNum);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the key if it exists or converts the name into a key
|
||||
/// </summary>
|
||||
public static string KeyOrConvertName(string key, string name)
|
||||
{
|
||||
if (string.IsNullOrEmpty(key))
|
||||
return name.Replace(' ', '-');
|
||||
return key;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Wrapper to help in IR port creation
|
||||
/// </summary>
|
||||
public class IrOutPortConfig
|
||||
{
|
||||
public IROutputPort Port { get; set; }
|
||||
public string FileName { get; set; }
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user