mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-01-27 19:34:51 +00:00
Compare commits
440 Commits
1.10.1-alp
...
feature/Ge
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fbba6e089a | ||
|
|
cef78c881e | ||
|
|
e1ce35863f | ||
|
|
acd3bad1f2 | ||
|
|
08514915b2 | ||
|
|
ea464038b9 | ||
|
|
c4c44d02f5 | ||
|
|
3fe5d89904 | ||
|
|
c0d78e8978 | ||
|
|
3716dd0824 | ||
|
|
ebe8ee5653 | ||
|
|
432934ad00 | ||
|
|
372cf86613 | ||
|
|
67c99a9ad4 | ||
|
|
31085d42a9 | ||
|
|
0df315426b | ||
|
|
6ddbdd90c7 | ||
|
|
39e1e5167b | ||
|
|
7f916d1d2f | ||
|
|
7c7f087898 | ||
|
|
898dab1d9a | ||
|
|
b221d2f0cb | ||
|
|
9656269826 | ||
|
|
ba182c1d98 | ||
|
|
2460290dc1 | ||
|
|
0b01661196 | ||
|
|
dfa55ab9f8 | ||
|
|
55ad92e2f6 | ||
|
|
c53cad8119 | ||
|
|
82e8b4b203 | ||
|
|
8965752025 | ||
|
|
8c3b891255 | ||
|
|
51bd95937a | ||
|
|
10fc8ee30b | ||
|
|
8da8b8c584 | ||
|
|
c7e0326b8c | ||
|
|
845978c741 | ||
|
|
ba511067d3 | ||
|
|
a9fe8bbb10 | ||
|
|
bc64ee37cb | ||
|
|
b2646f50cb | ||
|
|
465aa947cf | ||
|
|
16b78d27b9 | ||
|
|
4e56213dad | ||
|
|
668fc89eb2 | ||
|
|
e623c482a9 | ||
|
|
243c7cc3ee | ||
|
|
615598c8a6 | ||
|
|
3b25108a26 | ||
|
|
f253abd0ae | ||
|
|
e04f6d0396 | ||
|
|
eb4c7ff605 | ||
|
|
d0688cbc16 | ||
|
|
961af69aae | ||
|
|
df402ce498 | ||
|
|
e524bf358a | ||
|
|
3abd195c57 | ||
|
|
a3615d8d1b | ||
|
|
6a461a6923 | ||
|
|
77776f3258 | ||
|
|
701513d30e | ||
|
|
c9eaff6fce | ||
|
|
e8cdf3a63b | ||
|
|
f55ecdb67e | ||
|
|
cad677ae89 | ||
|
|
b057d3de18 | ||
|
|
1920d37488 | ||
|
|
e005a30383 | ||
|
|
058b3820be | ||
|
|
8a77b134e4 | ||
|
|
88f843250a | ||
|
|
772369bcd6 | ||
|
|
cef29af1ba | ||
|
|
8cc6cfafe9 | ||
|
|
89ba4627ea | ||
|
|
e05186defd | ||
|
|
83b0aec227 | ||
|
|
a3ba014c0f | ||
|
|
4919a863c3 | ||
|
|
2228bc1a1e | ||
|
|
1411add591 | ||
|
|
cbec2f2119 | ||
|
|
34d3b705fa | ||
|
|
e1d7374f1e | ||
|
|
a3346d5ef4 | ||
|
|
1c1eabcef6 | ||
|
|
12f3f519cc | ||
|
|
4dc6d5b5ac | ||
|
|
faaa2a354e | ||
|
|
087e74b207 | ||
|
|
8bb670c43b | ||
|
|
55a5cc53c9 | ||
|
|
0793a09095 | ||
|
|
15efed02a5 | ||
|
|
c68d46f971 | ||
|
|
dd2aca9aa4 | ||
|
|
705e750419 | ||
|
|
23af38aefa | ||
|
|
1bae7dc91b | ||
|
|
0c2896f9aa | ||
|
|
555944011d | ||
|
|
03d5c24dc4 | ||
|
|
f4a5d6737e | ||
|
|
b52bee5714 | ||
|
|
5de4382cd0 | ||
|
|
6414631deb | ||
|
|
300c675341 | ||
|
|
a4290e68b1 | ||
|
|
c14e5fe449 | ||
|
|
3b2fa8aec5 | ||
|
|
ffa864c71b | ||
|
|
86f904c8f9 | ||
|
|
6b60f4ddb1 | ||
|
|
2677d63553 | ||
|
|
d03581fea8 | ||
|
|
decc8ed3a5 | ||
|
|
b0637288e9 | ||
|
|
ea8c3995bd | ||
|
|
f6e08eb077 | ||
|
|
112a2b7382 | ||
|
|
c2d49c65f0 | ||
|
|
99bc3f4f3e | ||
|
|
e8f773b2e6 | ||
|
|
e342bede11 | ||
|
|
81c779e595 | ||
|
|
d980209bd8 | ||
|
|
c2a439d20d | ||
|
|
52d945fca3 | ||
|
|
0ef8fcfd27 | ||
|
|
042416b470 | ||
|
|
84f2222c38 | ||
|
|
966377ee2e | ||
|
|
3d27b0928f | ||
|
|
860182dbfc | ||
|
|
f325ff7af0 | ||
|
|
58a5600ac6 | ||
|
|
efb6d3ef83 | ||
|
|
04477d62cc | ||
|
|
668cbc430c | ||
|
|
e54de1f1cb | ||
|
|
f48b1a2de3 | ||
|
|
8e57e7ec31 | ||
|
|
1b43b44d19 | ||
|
|
4306128474 | ||
|
|
5263b16bb7 | ||
|
|
a2b67798f3 | ||
|
|
1b43fba37e | ||
|
|
f262c1a3bb | ||
|
|
93ee695c57 | ||
|
|
ba0bae3c4e | ||
|
|
37a98d00af | ||
|
|
247827ac25 | ||
|
|
5e797db096 | ||
|
|
57eeeec0fb | ||
|
|
db19da124c | ||
|
|
c07f52b06f | ||
|
|
92e48a62a8 | ||
|
|
f3653039ca | ||
|
|
3b79c2c8c3 | ||
|
|
c9efa3cfaa | ||
|
|
bd8a3de172 | ||
|
|
7bc7e7ff4f | ||
|
|
afe0568177 | ||
|
|
07c8c50c19 | ||
|
|
c34b4fc3a0 | ||
|
|
b711548c3b | ||
|
|
906433ff8d | ||
|
|
b6675477be | ||
|
|
0b307ee40a | ||
|
|
f5d89e2067 | ||
|
|
c9a175031d | ||
|
|
4fd01610c1 | ||
|
|
c19becc170 | ||
|
|
fc3840173e | ||
|
|
ce51a62d97 | ||
|
|
2be42f88bc | ||
|
|
60afe203dd | ||
|
|
6f9a9ee255 | ||
|
|
a09212417c | ||
|
|
4d6da37c60 | ||
|
|
95627df1a6 | ||
|
|
bef07fe41b | ||
|
|
99e1ec3b3b | ||
|
|
e44e7c976f | ||
|
|
fea3189a18 | ||
|
|
578754de85 | ||
|
|
4903232c10 | ||
|
|
83d2497264 | ||
|
|
50f5145a89 | ||
|
|
969abcc8b6 | ||
|
|
c136943c3a | ||
|
|
a734a869c1 | ||
|
|
c6495577e7 | ||
|
|
5359604098 | ||
|
|
70d2633eb0 | ||
|
|
58aa9dae08 | ||
|
|
6715a680cc | ||
|
|
f3fc0f2b26 | ||
|
|
330bb2d002 | ||
|
|
c0436b1230 | ||
|
|
26b968463b | ||
|
|
d33b89f232 | ||
|
|
10d77ac006 | ||
|
|
c19ab76a4c | ||
|
|
040c57b5e1 | ||
|
|
d6864bf214 | ||
|
|
62275890cb | ||
|
|
2a6b845fde | ||
|
|
4fb2d6d755 | ||
|
|
5994704fbd | ||
|
|
ca1cbb6e05 | ||
|
|
f82b7f8f12 | ||
|
|
dbd77f5f9f | ||
|
|
55031d16af | ||
|
|
4938071f70 | ||
|
|
3670bde7cf | ||
|
|
4deb9a0828 | ||
|
|
a524b1607d | ||
|
|
155f511ce2 | ||
|
|
21b09c593a | ||
|
|
cdeca09855 | ||
|
|
93435b60b5 | ||
|
|
2daf3c0328 | ||
|
|
eaef8ea616 | ||
|
|
b67eb6325b | ||
|
|
38cb86218c | ||
|
|
edddf295fe | ||
|
|
05ec0ebac3 | ||
|
|
c3d07fe4fd | ||
|
|
eae089cdf5 | ||
|
|
b48859d202 | ||
|
|
bda46eb1b9 | ||
|
|
47c24a237e | ||
|
|
ee735388bb | ||
|
|
77f202b9f4 | ||
|
|
939afb7aae | ||
|
|
4a98b58b60 | ||
|
|
2bf9336712 | ||
|
|
c0c67f6c15 | ||
|
|
eb3922aa43 | ||
|
|
598886dfd4 | ||
|
|
215cf6696e | ||
|
|
c557400f38 | ||
|
|
49a96d2632 | ||
|
|
ccf7acd53d | ||
|
|
f1590aeec8 | ||
|
|
f1d1ce9722 | ||
|
|
edd55d0349 | ||
|
|
384c4c2781 | ||
|
|
9b2611be02 | ||
|
|
26bd49aa85 | ||
|
|
1b9f16ea74 | ||
|
|
88a16b577b | ||
|
|
b4ab0c1c32 | ||
|
|
d01be57f81 | ||
|
|
5ba7abb59b | ||
|
|
f5a352cf08 | ||
|
|
c4a23e0887 | ||
|
|
2622e68afc | ||
|
|
7fe2d04d31 | ||
|
|
358f44cfe5 | ||
|
|
d7cccc0709 | ||
|
|
72086b57b3 | ||
|
|
f04b93d5e9 | ||
|
|
18c52ca199 | ||
|
|
1dcafff8fb | ||
|
|
81b1117310 | ||
|
|
fb689c4484 | ||
|
|
40cb1b0fcf | ||
|
|
4574941288 | ||
|
|
122abc56e5 | ||
|
|
074ee190ad | ||
|
|
68a0157fbe | ||
|
|
0376943dac | ||
|
|
62abbdf5e9 | ||
|
|
12248c6393 | ||
|
|
139ecc3e58 | ||
|
|
afa0a4cac2 | ||
|
|
ed335cc9ae | ||
|
|
5d51570018 | ||
|
|
e5393deea8 | ||
|
|
c446c3a976 | ||
|
|
49e44ec850 | ||
|
|
7298b9b767 | ||
|
|
5a8914a33f | ||
|
|
0ec42f8de2 | ||
|
|
008c82edb9 | ||
|
|
3033322212 | ||
|
|
5b350c7a0c | ||
|
|
afd2198eef | ||
|
|
dccab58a28 | ||
|
|
19d29a03c8 | ||
|
|
41bc6a9cd4 | ||
|
|
051d50e8c9 | ||
|
|
16af75ae0d | ||
|
|
4037fad26b | ||
|
|
5a4cc2fd39 | ||
|
|
04e8508c0c | ||
|
|
cbab051c11 | ||
|
|
9c8bb66c5e | ||
|
|
96ec2cbe49 | ||
|
|
9ecaec5584 | ||
|
|
b505ad467b | ||
|
|
d8ac302f1c | ||
|
|
712d38011c | ||
|
|
d849e4185c | ||
|
|
c3818b8bf2 | ||
|
|
05dadbe8ee | ||
|
|
c39fd231bf | ||
|
|
bbb31aea23 | ||
|
|
0df587071d | ||
|
|
4a405804c8 | ||
|
|
38c4a540a9 | ||
|
|
4c9a470885 | ||
|
|
be5158d29e | ||
|
|
8ce390d650 | ||
|
|
05066dc1ea | ||
|
|
70a78b540d | ||
|
|
c56caff1cb | ||
|
|
5e22ca9c59 | ||
|
|
5131e73567 | ||
|
|
e02c267988 | ||
|
|
53c9f9e664 | ||
|
|
794ba7e6dd | ||
|
|
5b94d89bc3 | ||
|
|
6dbdd0587d | ||
|
|
1a5d4896e1 | ||
|
|
50e9a7935f | ||
|
|
03e4c913ac | ||
|
|
b26e1b97aa | ||
|
|
60b6cea697 | ||
|
|
dfc0915fe0 | ||
|
|
96e3d52b95 | ||
|
|
cd4f2d5edd | ||
|
|
59b18d713b | ||
|
|
1cc37b7521 | ||
|
|
86dfc395ec | ||
|
|
05f3a7eb2c | ||
|
|
20beeb076a | ||
|
|
a7db15d9fd | ||
|
|
b8442e7048 | ||
|
|
1e65c961c6 | ||
|
|
bdc4f0ae28 | ||
|
|
82ac34d3b6 | ||
|
|
23555e5174 | ||
|
|
a74753d4a3 | ||
|
|
768a93d44d | ||
|
|
46cb10f452 | ||
|
|
5386f0fffb | ||
|
|
ad3ae0de69 | ||
|
|
892167d236 | ||
|
|
e843098ac3 | ||
|
|
7c892b4f71 | ||
|
|
1abe54fa48 | ||
|
|
1566e04edf | ||
|
|
f902a57f60 | ||
|
|
309605ee38 | ||
|
|
e2b8e356ff | ||
|
|
832102f4bb | ||
|
|
b23b7cb813 | ||
|
|
33c7038d99 | ||
|
|
7f36a00813 | ||
|
|
c4843d68f4 | ||
|
|
7e8d88c3af | ||
|
|
c539c79135 | ||
|
|
281b6f065f | ||
|
|
b42d487c4c | ||
|
|
acfbefca00 | ||
|
|
5f668c7173 | ||
|
|
6db5a9b2ca | ||
|
|
89dd098ea6 | ||
|
|
787c8eb954 | ||
|
|
97b9ed5016 | ||
|
|
06fdee313a | ||
|
|
b3f7568469 | ||
|
|
55ab593d73 | ||
|
|
a06652ee61 | ||
|
|
4f26df3149 | ||
|
|
428edad38a | ||
|
|
f3431f287c | ||
|
|
80b5fb6c7f | ||
|
|
6df594dd7f | ||
|
|
e39c76001a | ||
|
|
d88a454499 | ||
|
|
b0e3fddec7 | ||
|
|
0e5cecbfc3 | ||
|
|
57dac392da | ||
|
|
348981d8cb | ||
|
|
bee3f0caf3 | ||
|
|
79a3a8ed7e | ||
|
|
cb3c80ff8f | ||
|
|
0bb4b6edd4 | ||
|
|
e4a4564bbc | ||
|
|
b0288951eb | ||
|
|
bfdc882eb6 | ||
|
|
7a2e99f145 | ||
|
|
db67f97a1f | ||
|
|
102ae3ad4f | ||
|
|
7dd6b3a9b6 | ||
|
|
e24965eb54 | ||
|
|
9d80954214 | ||
|
|
70c5df9040 | ||
|
|
89a7f2aa80 | ||
|
|
90023621dc | ||
|
|
adbce916ba | ||
|
|
b97783603b | ||
|
|
db526cdd40 | ||
|
|
db982f4490 | ||
|
|
c84525ddef | ||
|
|
a3b078d327 | ||
|
|
b9c07b01e9 | ||
|
|
faabdde3f7 | ||
|
|
402754b69e | ||
|
|
84b39a959e | ||
|
|
93bfcc7baa | ||
|
|
64352811c5 | ||
|
|
3a74abd061 | ||
|
|
b5589364ff | ||
|
|
6cd1a03ee0 | ||
|
|
e19b0ba530 | ||
|
|
7b2498ac6b | ||
|
|
d9181c780f | ||
|
|
bc826c9e17 | ||
|
|
c6023ad700 | ||
|
|
742ff4bc1b | ||
|
|
2502947df8 | ||
|
|
7075da5b68 | ||
|
|
abdd1b38f8 | ||
|
|
5d5dee2e5e | ||
|
|
611f0bec2e | ||
|
|
90e22e9136 | ||
|
|
4552a15cbb | ||
|
|
c685608f67 | ||
|
|
cdafaf1bcb | ||
|
|
d8aef1a0da | ||
|
|
0ff29695e7 | ||
|
|
8aae23db9e | ||
|
|
a043309bb1 | ||
|
|
dc53ce42e7 | ||
|
|
6dd882b1a0 |
23
.github/scripts/GenerateVersionNumber-2.0.0.ps1
vendored
23
.github/scripts/GenerateVersionNumber-2.0.0.ps1
vendored
@@ -1,23 +0,0 @@
|
|||||||
$latestVersion = [version]"2.0.0"
|
|
||||||
|
|
||||||
$newVersion = [version]$latestVersion
|
|
||||||
$phase = ""
|
|
||||||
$newVersionString = ""
|
|
||||||
|
|
||||||
switch -regex ($Env:GITHUB_REF) {
|
|
||||||
'^refs\/pull\/*.' {
|
|
||||||
$phase = 'beta';
|
|
||||||
$newVersionString = "{0}-{1}-{2}" -f $newVersion, $phase, $Env:GITHUB_RUN_NUMBER
|
|
||||||
}
|
|
||||||
'^refs\/heads\/feature-2.0.0\/*.' {
|
|
||||||
$phase = 'alpha'
|
|
||||||
$newVersionString = "{0}-{1}-{2}" -f $newVersion, $phase, $Env:GITHUB_RUN_NUMBER
|
|
||||||
}
|
|
||||||
'development-2.0.0' {
|
|
||||||
$phase = 'beta'
|
|
||||||
$newVersionString = "{0}-{1}-{2}" -f $newVersion, $phase, $Env:GITHUB_RUN_NUMBER
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Write-Output $newVersionString
|
|
||||||
141
.github/workflows/docker.yml
vendored
Normal file
141
.github/workflows/docker.yml
vendored
Normal file
@@ -0,0 +1,141 @@
|
|||||||
|
name: Branch Build Using Docker
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- feature/*
|
||||||
|
- hotfix/*
|
||||||
|
- bugfix/*
|
||||||
|
- release/*
|
||||||
|
- development
|
||||||
|
|
||||||
|
env:
|
||||||
|
# solution path doesn't need slashes unless 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-2019
|
||||||
|
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
|
||||||
|
- name: Create Release
|
||||||
|
id: create_release
|
||||||
|
# using contributor's version to allow for pointing at the right commit
|
||||||
|
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
|
||||||
|
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-2019
|
||||||
|
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
|
||||||
271
.github/workflows/essentialsplugins-betabuilds.yml
vendored
271
.github/workflows/essentialsplugins-betabuilds.yml
vendored
@@ -1,271 +0,0 @@
|
|||||||
name: 2.0.0 Branch Build Using Docker
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- feature/*
|
|
||||||
- hotfix/*
|
|
||||||
- release/*
|
|
||||||
- dev*
|
|
||||||
|
|
||||||
env:
|
|
||||||
# Do not edit this, we're just creating it here
|
|
||||||
VERSION: 0.0.0-buildtype-buildnumber
|
|
||||||
# Defaults to debug for build type
|
|
||||||
BUILD_TYPE: Debug
|
|
||||||
# Defaults to master as the release branch. Change as necessary
|
|
||||||
RELEASE_BRANCH: main
|
|
||||||
jobs:
|
|
||||||
Build_Project:
|
|
||||||
runs-on: windows-2019
|
|
||||||
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: |
|
|
||||||
$latestVersions = $(git tag --merged origin/main)
|
|
||||||
$latestVersion = [version]"0.0.0"
|
|
||||||
Foreach ($version in $latestVersions) {
|
|
||||||
Write-Host $version
|
|
||||||
try {
|
|
||||||
if (([version]$version) -ge $latestVersion) {
|
|
||||||
$latestVersion = $version
|
|
||||||
Write-Host "Setting latest version to: $latestVersion"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch {
|
|
||||||
Write-Host "Unable to convert $($version). Skipping"
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$newVersion = [version]$latestVersion
|
|
||||||
$phase = ""
|
|
||||||
$newVersionString = ""
|
|
||||||
switch -regex ($Env:GITHUB_REF) {
|
|
||||||
'^refs\/heads\/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\/dev*.' {
|
|
||||||
$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
|
|
||||||
}
|
|
||||||
}
|
|
||||||
echo "VERSION=$newVersionString" | 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: |
|
|
||||||
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($Env:VERSION, "\d+\.\d+\.\d+.*");
|
|
||||||
if ($r.Success) {
|
|
||||||
Write-Output "Updating Assembly Version to $Env:VERSION ...";
|
|
||||||
Update-AllAssemblyInfoFiles $Env:VERSION;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
Write-Output " ";
|
|
||||||
Write-Output "Error: Input version $Env:VERSION does not match x.y.z format!"
|
|
||||||
Write-Output " ";
|
|
||||||
Write-Output "Unable to apply version to AssemblyInfo.cs files";
|
|
||||||
}
|
|
||||||
- name: restore Nuget Packages
|
|
||||||
run: nuget install .\packages.config -OutputDirectory .\packages -ExcludeVersion
|
|
||||||
# Set the SOLUTION_PATH
|
|
||||||
- name: Get SLN Path
|
|
||||||
shell: powershell
|
|
||||||
run: |
|
|
||||||
$solution_path = Get-ChildItem *.sln -recurse
|
|
||||||
$solution_path = $solution_path.FullName
|
|
||||||
$solution_path = $solution_path -replace "(?:[^\\]*\\){4}", ""
|
|
||||||
Write-Output $solution_path
|
|
||||||
echo "SOLUTION_PATH=$($solution_path)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
|
||||||
# Set the SOLUTION_FILE
|
|
||||||
- name: Get SLN File
|
|
||||||
shell: powershell
|
|
||||||
run: |
|
|
||||||
$solution_file = Get-ChildItem .\*.sln -recurse -Path "$($Env:GITHUB_WORKSPACE)"
|
|
||||||
echo "SOLUTION_FILE=$($solution_file.BaseName)"| Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
|
||||||
# Login to Docker
|
|
||||||
- name: Login to Docker
|
|
||||||
uses: azure/docker-login@v1
|
|
||||||
with:
|
|
||||||
username: ${{ secrets.DOCKERHUB_USER }}
|
|
||||||
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
|
||||||
# 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_PATH)"" -BuildSolutionConfiguration $($ENV:BUILD_TYPE)"
|
|
||||||
# Zip up the output files as needed
|
|
||||||
- name: Zip Build Output
|
|
||||||
shell: powershell
|
|
||||||
run: |
|
|
||||||
$destination = "$($Env:GITHUB_HOME)\output"
|
|
||||||
New-Item -ItemType Directory -Force -Path ($destination)
|
|
||||||
Get-ChildItem ($destination)
|
|
||||||
$exclusions = "packages"
|
|
||||||
# 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", "*.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
|
|
||||||
$filenames = @($($_ -replace "cpz|clz|cplz", "dll"), $($_ -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\*.cplz | 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
|
|
||||||
# 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 output files
|
|
||||||
- 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 Release
|
|
||||||
id: create_release
|
|
||||||
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
|
|
||||||
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: Get nuget File
|
|
||||||
shell: powershell
|
|
||||||
run: |
|
|
||||||
$nuspec_file = Get-ChildItem *.nuspec -recurse
|
|
||||||
echo "NUSPEC_FILE=$($nuspec_file.BaseName)"| Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
|
||||||
- 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 }}
|
|
||||||
# Pushes to nuget, not needed unless publishing publicly
|
|
||||||
- name: Add nuget.org API Key
|
|
||||||
run: nuget setApiKey ${{ secrets.NUGET_API_KEY }}
|
|
||||||
- name: Create nuget package
|
|
||||||
run: nuget pack "./${{ env.NUSPEC_FILE}}.nuspec" -version ${{ env.VERSION }}
|
|
||||||
- name: Publish nuget package to Github registry
|
|
||||||
run: nuget push **/*.nupkg -source github
|
|
||||||
# Pushes to nuget, not needed unless publishing publicly >> this pushes package to nuget.org
|
|
||||||
- name: Publish nuget package to nuget.org
|
|
||||||
run: nuget push **/*.nupkg -Source https://api.nuget.org/v3/index.json
|
|
||||||
@@ -1,219 +0,0 @@
|
|||||||
name: 2.0.0 Main Build using Docker
|
|
||||||
|
|
||||||
on:
|
|
||||||
release:
|
|
||||||
types:
|
|
||||||
- released
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
|
|
||||||
env:
|
|
||||||
# Do not edit this, we're just creating it here
|
|
||||||
VERSION: 0.0.0-buildtype-buildnumber
|
|
||||||
# Defaults to debug for build type
|
|
||||||
BUILD_TYPE: Release
|
|
||||||
# Defaults to master as the release branch. Change as necessary
|
|
||||||
RELEASE_BRANCH: main
|
|
||||||
jobs:
|
|
||||||
Build_Project:
|
|
||||||
runs-on: windows-2019
|
|
||||||
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
|
|
||||||
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: |
|
|
||||||
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($Env:VERSION, "\d+\.\d+\.\d+.*");
|
|
||||||
if ($r.Success) {
|
|
||||||
Write-Output "Updating Assembly Version to $Env:VERSION ...";
|
|
||||||
Update-AllAssemblyInfoFiles $Env:VERSION;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
Write-Output " ";
|
|
||||||
Write-Output "Error: Input version $Env:VERSION does not match x.y.z format!"
|
|
||||||
Write-Output " ";
|
|
||||||
Write-Output "Unable to apply version to AssemblyInfo.cs files";
|
|
||||||
}
|
|
||||||
- name: restore Nuget Packages
|
|
||||||
run: nuget install .\packages.config -OutputDirectory .\packages -ExcludeVersion
|
|
||||||
# Set the SOLUTION_PATH
|
|
||||||
- name: Get SLN Path
|
|
||||||
shell: powershell
|
|
||||||
run: |
|
|
||||||
$solution_path = Get-ChildItem *.sln -recurse
|
|
||||||
$solution_path = $solution_path.FullName
|
|
||||||
$solution_path = $solution_path -replace "(?:[^\\]*\\){4}", ""
|
|
||||||
Write-Output $solution_path
|
|
||||||
echo "SOLUTION_PATH=$($solution_path)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
|
||||||
# Set the SOLUTION_FILE
|
|
||||||
- name: Get SLN File
|
|
||||||
shell: powershell
|
|
||||||
run: |
|
|
||||||
$solution_file = Get-ChildItem .\*.sln -recurse -Path "$($Env:GITHUB_WORKSPACE)"
|
|
||||||
echo "SOLUTION_FILE=$($solution_file.BaseName)"| Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
|
||||||
# Login to Docker
|
|
||||||
- name: Login to Docker
|
|
||||||
uses: azure/docker-login@v1
|
|
||||||
with:
|
|
||||||
username: ${{ secrets.DOCKERHUB_USER }}
|
|
||||||
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
|
||||||
# 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_PATH)"" -BuildSolutionConfiguration $($ENV:BUILD_TYPE)"
|
|
||||||
# Zip up the output files as needed
|
|
||||||
- name: Zip Build Output
|
|
||||||
shell: powershell
|
|
||||||
run: |
|
|
||||||
$destination = "$($Env:GITHUB_HOME)\output"
|
|
||||||
New-Item -ItemType Directory -Force -Path ($destination)
|
|
||||||
Get-ChildItem ($destination)
|
|
||||||
$exclusions = "packages"
|
|
||||||
# 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", "*.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
|
|
||||||
$filenames = @($($_ -replace "cpz|clz|cplz", "dll"), $($_ -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\*.cplz | 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
|
|
||||||
# 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 output files
|
|
||||||
- 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: Get nuget File
|
|
||||||
shell: powershell
|
|
||||||
run: |
|
|
||||||
$nuspec_file = Get-ChildItem *.nuspec -recurse
|
|
||||||
echo "NUSPEC_FILE=$($nuspec_file.BaseName)"| Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
|
||||||
- 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 }}
|
|
||||||
# Pushes to nuget, not needed unless publishing publicly
|
|
||||||
- name: Add nuget.org API Key
|
|
||||||
run: nuget setApiKey ${{ secrets.NUGET_API_KEY }}
|
|
||||||
- name: Create nuget package
|
|
||||||
run: nuget pack "./${{ env.NUSPEC_FILE}}.nuspec" -version ${{ env.VERSION }}
|
|
||||||
- name: Publish nuget package to Github registry
|
|
||||||
run: nuget push **/*.nupkg -source github
|
|
||||||
# Pushes to nuget, not needed unless publishing publicly >> this pushes package to nuget.org
|
|
||||||
- name: Publish nuget package to nuget.org
|
|
||||||
run: nuget push **/*.nupkg -Source https://api.nuget.org/v3/index.json
|
|
||||||
125
.github/workflows/main.yml
vendored
Normal file
125
.github/workflows/main.yml
vendored
Normal file
@@ -0,0 +1,125 @@
|
|||||||
|
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-2019
|
||||||
|
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-2019
|
||||||
|
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
|
||||||
3
.gitmodules
vendored
3
.gitmodules
vendored
@@ -0,0 +1,3 @@
|
|||||||
|
[submodule "Essentials-Template-UI"]
|
||||||
|
path = Essentials-Template-UI
|
||||||
|
url = https://github.com/PepperDash/Essentials-Template-UI.git
|
||||||
|
|||||||
1
Essentials-Template-UI
Submodule
1
Essentials-Template-UI
Submodule
Submodule Essentials-Template-UI added at 8eaf88791b
@@ -1,21 +1,21 @@
|
|||||||
|
|
||||||
Microsoft Visual Studio Solution File, Format Version 10.00
|
Microsoft Visual Studio Solution File, Format Version 10.00
|
||||||
# Visual Studio 2008
|
# Visual Studio 2008
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PepperDash.Essentials", "Src/PepperDash.Essentials/PepperDash.Essentials.csproj", "{1BED5BA9-88C4-4365-9362-6F4B128071D3}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PepperDashEssentials", "PepperDashEssentials\PepperDashEssentials.csproj", "{1BED5BA9-88C4-4365-9362-6F4B128071D3}"
|
||||||
ProjectSection(ProjectDependencies) = postProject
|
ProjectSection(ProjectDependencies) = postProject
|
||||||
{892B761C-E479-44CE-BD74-243E9214AF13} = {892B761C-E479-44CE-BD74-243E9214AF13}
|
{892B761C-E479-44CE-BD74-243E9214AF13} = {892B761C-E479-44CE-BD74-243E9214AF13}
|
||||||
{9199CE8A-0C9F-4952-8672-3EED798B284F} = {9199CE8A-0C9F-4952-8672-3EED798B284F}
|
{9199CE8A-0C9F-4952-8672-3EED798B284F} = {9199CE8A-0C9F-4952-8672-3EED798B284F}
|
||||||
{A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5} = {A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5}
|
{A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5} = {A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5}
|
||||||
EndProjectSection
|
EndProjectSection
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PepperDash.Essentials.Core", "Src/PepperDash.Essentials.Core/PepperDash.Essentials.Core.csproj", "{A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PepperDash_Essentials_Core", "essentials-framework\Essentials Core\PepperDashEssentialsBase\PepperDash_Essentials_Core.csproj", "{A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PepperDash.Essentials.Devices.Common", "Src/PepperDash.Essentials.Devices.Common/PepperDash.Essentials.Devices.Common.csproj", "{892B761C-E479-44CE-BD74-243E9214AF13}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Essentials Devices Common", "essentials-framework\Essentials Devices Common\Essentials Devices Common\Essentials Devices Common.csproj", "{892B761C-E479-44CE-BD74-243E9214AF13}"
|
||||||
ProjectSection(ProjectDependencies) = postProject
|
ProjectSection(ProjectDependencies) = postProject
|
||||||
{A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5} = {A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5}
|
{A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5} = {A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5}
|
||||||
EndProjectSection
|
EndProjectSection
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PepperDash.Essentials.Devices.Dm", "SRc/PepperDash.Essentials.Devices.DM/PepperDash.Essentials.Devices.Dm.csproj", "{9199CE8A-0C9F-4952-8672-3EED798B284F}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PepperDash_Essentials_DM", "essentials-framework\Essentials DM\Essentials_DM\PepperDash_Essentials_DM.csproj", "{9199CE8A-0C9F-4952-8672-3EED798B284F}"
|
||||||
ProjectSection(ProjectDependencies) = postProject
|
ProjectSection(ProjectDependencies) = postProject
|
||||||
{A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5} = {A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5}
|
{A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5} = {A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5}
|
||||||
EndProjectSection
|
EndProjectSection
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ namespace PepperDash.Essentials
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// DSP format: deviceKey--levelName, biampTesira-1--master
|
// DSP/DMPS format: deviceKey--levelName, biampTesira-1--master
|
||||||
match = Regex.Match(DeviceKey, @"([-_\w]+)--(.+)");
|
match = Regex.Match(DeviceKey, @"([-_\w]+)--(.+)");
|
||||||
if (match.Success)
|
if (match.Success)
|
||||||
{
|
{
|
||||||
@@ -67,6 +67,27 @@ namespace PepperDash.Essentials
|
|||||||
if (dsp.LevelControlPoints.ContainsKey(levelTag)) // should always...
|
if (dsp.LevelControlPoints.ContainsKey(levelTag)) // should always...
|
||||||
return dsp.LevelControlPoints[levelTag];
|
return dsp.LevelControlPoints[levelTag];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var dmps = DeviceManager.GetDeviceForKey(devKey) as DmpsAudioOutputController;
|
||||||
|
if (dmps != null)
|
||||||
|
{
|
||||||
|
var levelTag = match.Groups[2].Value;
|
||||||
|
switch (levelTag)
|
||||||
|
{
|
||||||
|
case "master":
|
||||||
|
return dmps.MasterVolumeLevel;
|
||||||
|
case "source":
|
||||||
|
return dmps.SourceVolumeLevel;
|
||||||
|
case "micsmaster":
|
||||||
|
return dmps.MicsMasterVolumeLevel;
|
||||||
|
case "codec1":
|
||||||
|
return dmps.Codec1VolumeLevel;
|
||||||
|
case "codec2":
|
||||||
|
return dmps.Codec2VolumeLevel;
|
||||||
|
default:
|
||||||
|
return dmps.MasterVolumeLevel;
|
||||||
|
}
|
||||||
|
}
|
||||||
// No volume for some reason. We have failed as developers
|
// No volume for some reason. We have failed as developers
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -1,129 +1,129 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
using PepperDash.Essentials.Core.Bridges;
|
using PepperDash.Essentials.Core.Bridges;
|
||||||
using PepperDash.Essentials.Core.Config;
|
using PepperDash.Essentials.Core.Config;
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core.Routing;
|
using PepperDash.Essentials.Core.Routing;
|
||||||
using PepperDash.Essentials.Bridges;
|
using PepperDash.Essentials.Bridges;
|
||||||
using Crestron.SimplSharpPro;
|
using Crestron.SimplSharpPro;
|
||||||
using Crestron.SimplSharpPro.EthernetCommunication;
|
using Crestron.SimplSharpPro.EthernetCommunication;
|
||||||
|
|
||||||
namespace PepperDash.Essentials
|
namespace PepperDash.Essentials
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Responsible for loading all of the device types for this library
|
/// Responsible for loading all of the device types for this library
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class BridgeFactory
|
public class BridgeFactory
|
||||||
{
|
{
|
||||||
public BridgeFactory()
|
public BridgeFactory()
|
||||||
{
|
{
|
||||||
var eiscApiAdvancedFactory = new EiscApiAdvancedFactory() as IDeviceFactory;
|
var eiscApiAdvancedFactory = new EiscApiAdvancedFactory() as IDeviceFactory;
|
||||||
eiscApiAdvancedFactory.LoadTypeFactories();
|
eiscApiAdvancedFactory.LoadTypeFactories();
|
||||||
|
|
||||||
var eiscApiFactory = new EiscApiFactory() as IDeviceFactory;
|
var eiscApiFactory = new EiscApiFactory() as IDeviceFactory;
|
||||||
eiscApiFactory.LoadTypeFactories();
|
eiscApiFactory.LoadTypeFactories();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class CommBridge : Device
|
public class CommBridge : Device
|
||||||
{
|
{
|
||||||
public CommBridgeProperties Properties { get; private set; }
|
public CommBridgeProperties Properties { get; private set; }
|
||||||
|
|
||||||
public List<IBasicCommunication> CommDevices { get; private set; }
|
public List<IBasicCommunication> CommDevices { get; private set; }
|
||||||
|
|
||||||
public CommBridge(string key, string name, JToken properties)
|
public CommBridge(string key, string name, JToken properties)
|
||||||
: base(key, name)
|
: base(key, name)
|
||||||
{
|
{
|
||||||
Properties = JsonConvert.DeserializeObject<CommBridgeProperties>(properties.ToString());
|
Properties = JsonConvert.DeserializeObject<CommBridgeProperties>(properties.ToString());
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool CustomActivate()
|
public override bool CustomActivate()
|
||||||
{
|
{
|
||||||
// Create EiscApis
|
// Create EiscApis
|
||||||
if (Properties.Eiscs != null)
|
if (Properties.Eiscs != null)
|
||||||
{
|
{
|
||||||
foreach (var eisc in Properties.Eiscs)
|
foreach (var eisc in Properties.Eiscs)
|
||||||
{
|
{
|
||||||
var ApiEisc = new BridgeApiEisc(eisc.IpId, eisc.Hostname);
|
var ApiEisc = new BridgeApiEisc(eisc.IpId, eisc.Hostname);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (var deviceKey in Properties.CommDevices)
|
foreach (var deviceKey in Properties.CommDevices)
|
||||||
{
|
{
|
||||||
var device = DeviceManager.GetDeviceForKey(deviceKey);
|
var device = DeviceManager.GetDeviceForKey(deviceKey);
|
||||||
|
|
||||||
if (device != null)
|
if (device != null)
|
||||||
{
|
{
|
||||||
Debug.Console(0, "deviceKey {0} Found in Device Manager", device.Key);
|
Debug.Console(0, "deviceKey {0} Found in Device Manager", device.Key);
|
||||||
CommDevices.Add(device as IBasicCommunication);
|
CommDevices.Add(device as IBasicCommunication);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Debug.Console(0, "deviceKey {0} Not Found in Device Manager", deviceKey);
|
Debug.Console(0, "deviceKey {0} Not Found in Device Manager", deviceKey);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Iterate through all the CommDevices and link up their Actions and Feedbacks
|
// Iterate through all the CommDevices and link up their Actions and Feedbacks
|
||||||
|
|
||||||
Debug.Console(0, "Bridge {0} Activated", this.Name);
|
Debug.Console(0, "Bridge {0} Activated", this.Name);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public class EiscBridgeProperties
|
public class EiscBridgeProperties
|
||||||
{
|
{
|
||||||
public string ParentDeviceKey { get; set; }
|
public string ParentDeviceKey { get; set; }
|
||||||
public eApiType ApiType { get; set; }
|
public eApiType ApiType { get; set; }
|
||||||
public List<EiscProperties> Eiscs { get; set; }
|
public List<EiscProperties> Eiscs { get; set; }
|
||||||
public string ApiOverrideFilePath { get; set; }
|
public string ApiOverrideFilePath { get; set; }
|
||||||
|
|
||||||
public class EiscProperties
|
public class EiscProperties
|
||||||
{
|
{
|
||||||
public string IpId { get; set; }
|
public string IpId { get; set; }
|
||||||
public string Hostname { get; set; }
|
public string Hostname { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class CommBridgeProperties : EiscBridgeProperties
|
public class CommBridgeProperties : EiscBridgeProperties
|
||||||
{
|
{
|
||||||
public List<string> CommDevices { get; set; }
|
public List<string> CommDevices { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum eApiType { Eisc = 0 }
|
public enum eApiType { Eisc = 0 }
|
||||||
|
|
||||||
public class BridgeApiEisc
|
public class BridgeApiEisc
|
||||||
{
|
{
|
||||||
public uint Ipid { get; private set; }
|
public uint Ipid { get; private set; }
|
||||||
public ThreeSeriesTcpIpEthernetIntersystemCommunications Eisc { get; private set; }
|
public ThreeSeriesTcpIpEthernetIntersystemCommunications Eisc { get; private set; }
|
||||||
|
|
||||||
public BridgeApiEisc(string ipid, string hostname)
|
public BridgeApiEisc(string ipid, string hostname)
|
||||||
{
|
{
|
||||||
Ipid = (UInt32)int.Parse(ipid, System.Globalization.NumberStyles.HexNumber);
|
Ipid = (UInt32)int.Parse(ipid, System.Globalization.NumberStyles.HexNumber);
|
||||||
Eisc = new ThreeSeriesTcpIpEthernetIntersystemCommunications(Ipid, hostname, Global.ControlSystem);
|
Eisc = new ThreeSeriesTcpIpEthernetIntersystemCommunications(Ipid, hostname, Global.ControlSystem);
|
||||||
Eisc.Register();
|
Eisc.Register();
|
||||||
Eisc.SigChange += Eisc_SigChange;
|
Eisc.SigChange += Eisc_SigChange;
|
||||||
Debug.Console(0, "BridgeApiEisc Created at Ipid {0}", ipid);
|
Debug.Console(0, "BridgeApiEisc Created at Ipid {0}", ipid);
|
||||||
}
|
}
|
||||||
void Eisc_SigChange(object currentDevice, Crestron.SimplSharpPro.SigEventArgs args)
|
void Eisc_SigChange(object currentDevice, Crestron.SimplSharpPro.SigEventArgs args)
|
||||||
{
|
{
|
||||||
if (Debug.Level >= 1)
|
if (Debug.Level >= 1)
|
||||||
Debug.Console(1, "BridgeApiEisc change: {0} {1}={2}", args.Sig.Type, args.Sig.Number, args.Sig.StringValue);
|
Debug.Console(1, "BridgeApiEisc change: {0} {1}={2}", args.Sig.Type, args.Sig.Number, args.Sig.StringValue);
|
||||||
var uo = args.Sig.UserObject;
|
var uo = args.Sig.UserObject;
|
||||||
if (uo is Action<bool>)
|
if (uo is Action<bool>)
|
||||||
(uo as Action<bool>)(args.Sig.BoolValue);
|
(uo as Action<bool>)(args.Sig.BoolValue);
|
||||||
else if (uo is Action<ushort>)
|
else if (uo is Action<ushort>)
|
||||||
(uo as Action<ushort>)(args.Sig.UShortValue);
|
(uo as Action<ushort>)(args.Sig.UShortValue);
|
||||||
else if (uo is Action<string>)
|
else if (uo is Action<string>)
|
||||||
(uo as Action<string>)(args.Sig.StringValue);
|
(uo as Action<string>)(args.Sig.StringValue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,90 +1,90 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
using PepperDash.Essentials.Core.Config;
|
using PepperDash.Essentials.Core.Config;
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core.Routing;
|
using PepperDash.Essentials.Core.Routing;
|
||||||
using Crestron.SimplSharpPro;
|
using Crestron.SimplSharpPro;
|
||||||
using Crestron.SimplSharpPro.EthernetCommunication;
|
using Crestron.SimplSharpPro.EthernetCommunication;
|
||||||
using PepperDash.Essentials.Bridges;
|
using PepperDash.Essentials.Bridges;
|
||||||
|
|
||||||
namespace PepperDash.Essentials {
|
namespace PepperDash.Essentials {
|
||||||
public class BridgeFactory {
|
public class BridgeFactory {
|
||||||
public static IKeyed GetDevice(PepperDash.Essentials.Core.Config.DeviceConfig dc) {
|
public static IKeyed GetDevice(PepperDash.Essentials.Core.Config.DeviceConfig dc) {
|
||||||
// ? why is this static JTA 2018-06-13?
|
// ? why is this static JTA 2018-06-13?
|
||||||
|
|
||||||
var key = dc.Key;
|
var key = dc.Key;
|
||||||
var name = dc.Name;
|
var name = dc.Name;
|
||||||
var type = dc.Type;
|
var type = dc.Type;
|
||||||
var properties = dc.Properties;
|
var properties = dc.Properties;
|
||||||
var propAnon = new { };
|
var propAnon = new { };
|
||||||
JsonConvert.DeserializeAnonymousType(dc.Properties.ToString(), propAnon);
|
JsonConvert.DeserializeAnonymousType(dc.Properties.ToString(), propAnon);
|
||||||
|
|
||||||
var typeName = dc.Type.ToLower();
|
var typeName = dc.Type.ToLower();
|
||||||
var groupName = dc.Group.ToLower();
|
var groupName = dc.Group.ToLower();
|
||||||
|
|
||||||
Debug.Console(2, "Name {0}, Key {1}, Type {2}, Properties {3}", name, key, type, properties.ToString());
|
Debug.Console(2, "Name {0}, Key {1}, Type {2}, Properties {3}", name, key, type, properties.ToString());
|
||||||
if (typeName == "essentialdm")
|
if (typeName == "essentialdm")
|
||||||
{
|
{
|
||||||
return new EssentialDM(key, name, properties);
|
return new EssentialDM(key, name, properties);
|
||||||
}
|
}
|
||||||
else if (typeName == "essentialcomm")
|
else if (typeName == "essentialcomm")
|
||||||
{
|
{
|
||||||
Debug.Console(2, "Launch Essential Comm");
|
Debug.Console(2, "Launch Essential Comm");
|
||||||
return new EssentialComm(key, name, properties);
|
return new EssentialComm(key, name, properties);
|
||||||
}
|
}
|
||||||
else if (typeName == "essentialdsp")
|
else if (typeName == "essentialdsp")
|
||||||
{
|
{
|
||||||
Debug.Console(2, "Launch EssentialDsp");
|
Debug.Console(2, "Launch EssentialDsp");
|
||||||
return new EssentialDsp(key, name, properties);
|
return new EssentialDsp(key, name, properties);
|
||||||
}
|
}
|
||||||
else if (typeName == "essentialstvone")
|
else if (typeName == "essentialstvone")
|
||||||
{
|
{
|
||||||
Debug.Console(2, "Launch essentialstvone");
|
Debug.Console(2, "Launch essentialstvone");
|
||||||
return new EssentialsTVOne(key, name, properties);
|
return new EssentialsTVOne(key, name, properties);
|
||||||
}
|
}
|
||||||
else if (typeName == "essentialslighting")
|
else if (typeName == "essentialslighting")
|
||||||
{
|
{
|
||||||
Debug.Console(2, "Launch essentialslighting");
|
Debug.Console(2, "Launch essentialslighting");
|
||||||
return new EssentialsLightsBridge(key, name, properties);
|
return new EssentialsLightsBridge(key, name, properties);
|
||||||
}
|
}
|
||||||
else if (typeName == "eiscapi")
|
else if (typeName == "eiscapi")
|
||||||
{
|
{
|
||||||
return new EiscApi(dc);
|
return new EiscApi(dc);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public class BridgeApiEisc {
|
public class BridgeApiEisc {
|
||||||
public uint Ipid;
|
public uint Ipid;
|
||||||
public ThreeSeriesTcpIpEthernetIntersystemCommunications Eisc;
|
public ThreeSeriesTcpIpEthernetIntersystemCommunications Eisc;
|
||||||
public BridgeApiEisc(string ipid) {
|
public BridgeApiEisc(string ipid) {
|
||||||
Ipid = (UInt32)int.Parse(ipid, System.Globalization.NumberStyles.HexNumber);
|
Ipid = (UInt32)int.Parse(ipid, System.Globalization.NumberStyles.HexNumber);
|
||||||
Eisc = new ThreeSeriesTcpIpEthernetIntersystemCommunications(Ipid, "127.0.0.2", Global.ControlSystem);
|
Eisc = new ThreeSeriesTcpIpEthernetIntersystemCommunications(Ipid, "127.0.0.2", Global.ControlSystem);
|
||||||
Eisc.Register();
|
Eisc.Register();
|
||||||
Eisc.SigChange += Eisc_SigChange;
|
Eisc.SigChange += Eisc_SigChange;
|
||||||
Debug.Console(2, "BridgeApiEisc Created at Ipid {0}", ipid);
|
Debug.Console(2, "BridgeApiEisc Created at Ipid {0}", ipid);
|
||||||
}
|
}
|
||||||
void Eisc_SigChange(object currentDevice, Crestron.SimplSharpPro.SigEventArgs args) {
|
void Eisc_SigChange(object currentDevice, Crestron.SimplSharpPro.SigEventArgs args) {
|
||||||
if (Debug.Level >= 1)
|
if (Debug.Level >= 1)
|
||||||
Debug.Console(2, "DDVC EISC change: {0} {1}={2}", args.Sig.Type, args.Sig.Number, args.Sig.StringValue);
|
Debug.Console(2, "DDVC EISC change: {0} {1}={2}", args.Sig.Type, args.Sig.Number, args.Sig.StringValue);
|
||||||
var uo = args.Sig.UserObject;
|
var uo = args.Sig.UserObject;
|
||||||
if (uo is Action<bool>)
|
if (uo is Action<bool>)
|
||||||
(uo as Action<bool>)(args.Sig.BoolValue);
|
(uo as Action<bool>)(args.Sig.BoolValue);
|
||||||
else if (uo is Action<ushort>)
|
else if (uo is Action<ushort>)
|
||||||
(uo as Action<ushort>)(args.Sig.UShortValue);
|
(uo as Action<ushort>)(args.Sig.UShortValue);
|
||||||
else if (uo is Action<string>)
|
else if (uo is Action<string>)
|
||||||
(uo as Action<string>)(args.Sig.StringValue);
|
(uo as Action<string>)(args.Sig.StringValue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,38 +1,38 @@
|
|||||||
using Crestron.SimplSharpPro.DeviceSupport;
|
using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
using PepperDash.Essentials.Core.CrestronIO;
|
using PepperDash.Essentials.Core.CrestronIO;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Core.Bridges
|
namespace PepperDash.Essentials.Core.Bridges
|
||||||
{
|
{
|
||||||
public static class C2nRthsControllerApiExtensions
|
public static class C2nRthsControllerApiExtensions
|
||||||
{
|
{
|
||||||
public static void LinkToApi(this C2nRthsController device, BasicTriList triList, uint joinStart,
|
public static void LinkToApi(this C2nRthsController device, BasicTriList triList, uint joinStart,
|
||||||
string joinMapKey)
|
string joinMapKey)
|
||||||
{
|
{
|
||||||
var joinMap = new C2nRthsControllerJoinMap();
|
var joinMap = new C2nRthsControllerJoinMap();
|
||||||
|
|
||||||
var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
|
var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(joinMapSerialized))
|
if (!string.IsNullOrEmpty(joinMapSerialized))
|
||||||
joinMap = JsonConvert.DeserializeObject<C2nRthsControllerJoinMap>(joinMapSerialized);
|
joinMap = JsonConvert.DeserializeObject<C2nRthsControllerJoinMap>(joinMapSerialized);
|
||||||
|
|
||||||
joinMap.OffsetJoinNumbers(joinStart);
|
joinMap.OffsetJoinNumbers(joinStart);
|
||||||
|
|
||||||
Debug.Console(1, device, "Linking to Trilist '{0}'", triList.ID.ToString("X"));
|
Debug.Console(1, device, "Linking to Trilist '{0}'", triList.ID.ToString("X"));
|
||||||
|
|
||||||
|
|
||||||
triList.SetBoolSigAction(joinMap.TemperatureFormat, device.SetTemperatureFormat);
|
triList.SetBoolSigAction(joinMap.TemperatureFormat, device.SetTemperatureFormat);
|
||||||
|
|
||||||
device.IsOnline.LinkInputSig(triList.BooleanInput[joinMap.IsOnline]);
|
device.IsOnline.LinkInputSig(triList.BooleanInput[joinMap.IsOnline]);
|
||||||
device.TemperatureFeedback.LinkInputSig(triList.UShortInput[joinMap.Temperature]);
|
device.TemperatureFeedback.LinkInputSig(triList.UShortInput[joinMap.Temperature]);
|
||||||
device.HumidityFeedback.LinkInputSig(triList.UShortInput[joinMap.Humidity]);
|
device.HumidityFeedback.LinkInputSig(triList.UShortInput[joinMap.Humidity]);
|
||||||
|
|
||||||
triList.StringInput[joinMap.Name].StringValue = device.Name;
|
triList.StringInput[joinMap.Name].StringValue = device.Name;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,169 +1,169 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
using Crestron.SimplSharpPro.DeviceSupport;
|
using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
using PepperDash.Essentials.Devices.Common;
|
using PepperDash.Essentials.Devices.Common;
|
||||||
using PepperDash.Essentials.Devices.Common.Cameras;
|
using PepperDash.Essentials.Devices.Common.Cameras;
|
||||||
|
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Core.Bridges
|
namespace PepperDash.Essentials.Core.Bridges
|
||||||
{
|
{
|
||||||
public static class CameraControllerApiExtensions
|
public static class CameraControllerApiExtensions
|
||||||
{
|
{
|
||||||
public static void LinkToApi(this PepperDash.Essentials.Devices.Common.Cameras.CameraBase cameraDevice, BasicTriList trilist, uint joinStart, string joinMapKey, EiscApi bridge)
|
public static void LinkToApi(this PepperDash.Essentials.Devices.Common.Cameras.CameraBase cameraDevice, BasicTriList trilist, uint joinStart, string joinMapKey, EiscApi bridge)
|
||||||
{
|
{
|
||||||
CameraControllerJoinMap joinMap = new CameraControllerJoinMap(joinStart);
|
CameraControllerJoinMap joinMap = new CameraControllerJoinMap(joinStart);
|
||||||
|
|
||||||
// Adds the join map to the bridge
|
// Adds the join map to the bridge
|
||||||
bridge.AddJoinMap(cameraDevice.Key, joinMap);
|
bridge.AddJoinMap(cameraDevice.Key, joinMap);
|
||||||
|
|
||||||
var customJoins = JoinMapHelper.TryGetJoinMapAdvancedForDevice(joinMapKey);
|
var customJoins = JoinMapHelper.TryGetJoinMapAdvancedForDevice(joinMapKey);
|
||||||
|
|
||||||
if (customJoins != null)
|
if (customJoins != null)
|
||||||
{
|
{
|
||||||
joinMap.SetCustomJoinData(customJoins);
|
joinMap.SetCustomJoinData(customJoins);
|
||||||
}
|
}
|
||||||
|
|
||||||
Debug.Console(1, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
Debug.Console(1, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
||||||
Debug.Console(0, "Linking to Bridge Type {0}", cameraDevice.GetType().Name.ToString());
|
Debug.Console(0, "Linking to Bridge Type {0}", cameraDevice.GetType().Name.ToString());
|
||||||
|
|
||||||
var commMonitor = cameraDevice as ICommunicationMonitor;
|
var commMonitor = cameraDevice as ICommunicationMonitor;
|
||||||
commMonitor.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline.JoinNumber]);
|
commMonitor.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline.JoinNumber]);
|
||||||
|
|
||||||
var ptzCamera = cameraDevice as IHasCameraPtzControl;
|
var ptzCamera = cameraDevice as IHasCameraPtzControl;
|
||||||
|
|
||||||
if (ptzCamera != null)
|
if (ptzCamera != null)
|
||||||
{
|
{
|
||||||
trilist.SetBoolSigAction(joinMap.PanLeft.JoinNumber, (b) =>
|
trilist.SetBoolSigAction(joinMap.PanLeft.JoinNumber, (b) =>
|
||||||
{
|
{
|
||||||
if (b)
|
if (b)
|
||||||
{
|
{
|
||||||
ptzCamera.PanLeft();
|
ptzCamera.PanLeft();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ptzCamera.PanStop();
|
ptzCamera.PanStop();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
trilist.SetBoolSigAction(joinMap.PanRight.JoinNumber, (b) =>
|
trilist.SetBoolSigAction(joinMap.PanRight.JoinNumber, (b) =>
|
||||||
{
|
{
|
||||||
if (b)
|
if (b)
|
||||||
{
|
{
|
||||||
ptzCamera.PanRight();
|
ptzCamera.PanRight();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ptzCamera.PanStop();
|
ptzCamera.PanStop();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
trilist.SetBoolSigAction(joinMap.TiltUp.JoinNumber, (b) =>
|
trilist.SetBoolSigAction(joinMap.TiltUp.JoinNumber, (b) =>
|
||||||
{
|
{
|
||||||
if (b)
|
if (b)
|
||||||
{
|
{
|
||||||
ptzCamera.TiltUp();
|
ptzCamera.TiltUp();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ptzCamera.TiltStop();
|
ptzCamera.TiltStop();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
trilist.SetBoolSigAction(joinMap.TiltDown.JoinNumber, (b) =>
|
trilist.SetBoolSigAction(joinMap.TiltDown.JoinNumber, (b) =>
|
||||||
{
|
{
|
||||||
if (b)
|
if (b)
|
||||||
{
|
{
|
||||||
ptzCamera.TiltDown();
|
ptzCamera.TiltDown();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ptzCamera.TiltStop();
|
ptzCamera.TiltStop();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
trilist.SetBoolSigAction(joinMap.ZoomIn.JoinNumber, (b) =>
|
trilist.SetBoolSigAction(joinMap.ZoomIn.JoinNumber, (b) =>
|
||||||
{
|
{
|
||||||
if (b)
|
if (b)
|
||||||
{
|
{
|
||||||
ptzCamera.ZoomIn();
|
ptzCamera.ZoomIn();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ptzCamera.ZoomStop();
|
ptzCamera.ZoomStop();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
trilist.SetBoolSigAction(joinMap.ZoomOut.JoinNumber, (b) =>
|
trilist.SetBoolSigAction(joinMap.ZoomOut.JoinNumber, (b) =>
|
||||||
{
|
{
|
||||||
if (b)
|
if (b)
|
||||||
{
|
{
|
||||||
ptzCamera.ZoomOut();
|
ptzCamera.ZoomOut();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ptzCamera.ZoomStop();
|
ptzCamera.ZoomStop();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cameraDevice is IPower)
|
if (cameraDevice is IPower)
|
||||||
{
|
{
|
||||||
var powerCamera = cameraDevice as IPower;
|
var powerCamera = cameraDevice as IPower;
|
||||||
trilist.SetSigTrueAction(joinMap.PowerOn.JoinNumber, () => powerCamera.PowerOn());
|
trilist.SetSigTrueAction(joinMap.PowerOn.JoinNumber, () => powerCamera.PowerOn());
|
||||||
trilist.SetSigTrueAction(joinMap.PowerOff.JoinNumber, () => powerCamera.PowerOff());
|
trilist.SetSigTrueAction(joinMap.PowerOff.JoinNumber, () => powerCamera.PowerOff());
|
||||||
|
|
||||||
powerCamera.PowerIsOnFeedback.LinkInputSig(trilist.BooleanInput[joinMap.PowerOn.JoinNumber]);
|
powerCamera.PowerIsOnFeedback.LinkInputSig(trilist.BooleanInput[joinMap.PowerOn.JoinNumber]);
|
||||||
powerCamera.PowerIsOnFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.PowerOff.JoinNumber]);
|
powerCamera.PowerIsOnFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.PowerOff.JoinNumber]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cameraDevice is ICommunicationMonitor)
|
if (cameraDevice is ICommunicationMonitor)
|
||||||
{
|
{
|
||||||
var monitoredCamera = cameraDevice as ICommunicationMonitor;
|
var monitoredCamera = cameraDevice as ICommunicationMonitor;
|
||||||
monitoredCamera.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline.JoinNumber]);
|
monitoredCamera.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline.JoinNumber]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cameraDevice is IHasCameraPresets)
|
if (cameraDevice is IHasCameraPresets)
|
||||||
{
|
{
|
||||||
// Set the preset lables when they change
|
// Set the preset lables when they change
|
||||||
var presetsCamera = cameraDevice as IHasCameraPresets;
|
var presetsCamera = cameraDevice as IHasCameraPresets;
|
||||||
presetsCamera.PresetsListHasChanged += new EventHandler<EventArgs>((o, a) =>
|
presetsCamera.PresetsListHasChanged += new EventHandler<EventArgs>((o, a) =>
|
||||||
{
|
{
|
||||||
for (int i = 1; i <= joinMap.NumberOfPresets.JoinNumber; i++)
|
for (int i = 1; i <= joinMap.NumberOfPresets.JoinNumber; i++)
|
||||||
{
|
{
|
||||||
int tempNum = i - 1;
|
int tempNum = i - 1;
|
||||||
|
|
||||||
string label = "" ;
|
string label = "" ;
|
||||||
|
|
||||||
var preset = presetsCamera.Presets.FirstOrDefault(p => p.ID.Equals(i));
|
var preset = presetsCamera.Presets.FirstOrDefault(p => p.ID.Equals(i));
|
||||||
|
|
||||||
if (preset != null)
|
if (preset != null)
|
||||||
label = preset.Description;
|
label = preset.Description;
|
||||||
|
|
||||||
trilist.SetString((ushort)(joinMap.PresetLabelStart.JoinNumber + tempNum), label);
|
trilist.SetString((ushort)(joinMap.PresetLabelStart.JoinNumber + tempNum), label);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
for (int i = 0; i < joinMap.NumberOfPresets.JoinNumber; i++)
|
for (int i = 0; i < joinMap.NumberOfPresets.JoinNumber; i++)
|
||||||
{
|
{
|
||||||
int tempNum = i;
|
int tempNum = i;
|
||||||
|
|
||||||
trilist.SetSigTrueAction((ushort)(joinMap.PresetRecallStart.JoinNumber + tempNum), () =>
|
trilist.SetSigTrueAction((ushort)(joinMap.PresetRecallStart.JoinNumber + tempNum), () =>
|
||||||
{
|
{
|
||||||
presetsCamera.PresetSelect(tempNum);
|
presetsCamera.PresetSelect(tempNum);
|
||||||
});
|
});
|
||||||
trilist.SetSigTrueAction((ushort)(joinMap.PresetSaveStart.JoinNumber + tempNum), () =>
|
trilist.SetSigTrueAction((ushort)(joinMap.PresetSaveStart.JoinNumber + tempNum), () =>
|
||||||
{
|
{
|
||||||
var label = trilist.GetString((ushort)(joinMap.PresetLabelStart.JoinNumber + tempNum));
|
var label = trilist.GetString((ushort)(joinMap.PresetLabelStart.JoinNumber + tempNum));
|
||||||
|
|
||||||
presetsCamera.PresetStore(tempNum, label);
|
presetsCamera.PresetStore(tempNum, label);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,120 +1,120 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
using Crestron.SimplSharpPro.DeviceSupport;
|
using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
using PepperDash.Essentials.Devices.Common;
|
using PepperDash.Essentials.Devices.Common;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Bridges
|
namespace PepperDash.Essentials.Bridges
|
||||||
{
|
{
|
||||||
public static class SamsungDisplayControllerApiExtensions
|
public static class SamsungDisplayControllerApiExtensions
|
||||||
{
|
{
|
||||||
public static void LinkToApi(this PepperDash.Essentials.Core.TwoWayDisplayBase displayDevice, BasicTriList trilist, uint joinStart, string joinMapKey)
|
public static void LinkToApi(this PepperDash.Essentials.Core.TwoWayDisplayBase displayDevice, BasicTriList trilist, uint joinStart, string joinMapKey)
|
||||||
{
|
{
|
||||||
var joinMap = JoinMapHelper.GetJoinMapForDevice(joinMapKey) as DisplayControllerJoinMap;
|
var joinMap = JoinMapHelper.GetJoinMapForDevice(joinMapKey) as DisplayControllerJoinMap;
|
||||||
|
|
||||||
if (joinMap == null)
|
if (joinMap == null)
|
||||||
{
|
{
|
||||||
joinMap = new DisplayControllerJoinMap();
|
joinMap = new DisplayControllerJoinMap();
|
||||||
}
|
}
|
||||||
|
|
||||||
joinMap.OffsetJoinNumbers(joinStart);
|
joinMap.OffsetJoinNumbers(joinStart);
|
||||||
Debug.Console(1, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
Debug.Console(1, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
||||||
Debug.Console(0, "Linking to lighting Type {0}", displayDevice.GetType().Name.ToString());
|
Debug.Console(0, "Linking to lighting Type {0}", displayDevice.GetType().Name.ToString());
|
||||||
|
|
||||||
var commMonitor = displayDevice as ICommunicationMonitor;
|
var commMonitor = displayDevice as ICommunicationMonitor;
|
||||||
commMonitor.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
|
commMonitor.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
|
||||||
|
|
||||||
|
|
||||||
// Poewer Off
|
// Poewer Off
|
||||||
trilist.SetSigTrueAction(joinMap.PowerOff, () => displayDevice.PowerOff());
|
trilist.SetSigTrueAction(joinMap.PowerOff, () => displayDevice.PowerOff());
|
||||||
displayDevice.PowerIsOnFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.PowerOff]);
|
displayDevice.PowerIsOnFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.PowerOff]);
|
||||||
|
|
||||||
// Poewer On
|
// Poewer On
|
||||||
trilist.SetSigTrueAction(joinMap.PowerOn, () => displayDevice.PowerOn());
|
trilist.SetSigTrueAction(joinMap.PowerOn, () => displayDevice.PowerOn());
|
||||||
displayDevice.PowerIsOnFeedback.LinkInputSig(trilist.BooleanInput[joinMap.PowerOn]);
|
displayDevice.PowerIsOnFeedback.LinkInputSig(trilist.BooleanInput[joinMap.PowerOn]);
|
||||||
|
|
||||||
// GenericLighitng Actions & FeedBack
|
// GenericLighitng Actions & FeedBack
|
||||||
|
|
||||||
// int sceneIndex = 1;
|
// int sceneIndex = 1;
|
||||||
/*
|
/*
|
||||||
foreach (var scene in displayDevice.LightingScenes)
|
foreach (var scene in displayDevice.LightingScenes)
|
||||||
{
|
{
|
||||||
var tempIndex = sceneIndex - 1;
|
var tempIndex = sceneIndex - 1;
|
||||||
//trilist.SetSigTrueAction((uint)(joinMap.LightingSceneOffset + sceneIndex), () => displayDevice.SelectScene(displayDevice.LightingScenes[tempIndex]));
|
//trilist.SetSigTrueAction((uint)(joinMap.LightingSceneOffset + sceneIndex), () => displayDevice.SelectScene(displayDevice.LightingScenes[tempIndex]));
|
||||||
scene.IsActiveFeedback.LinkInputSig(trilist.BooleanInput[(uint)(joinMap.LightingSceneOffset + sceneIndex)]);
|
scene.IsActiveFeedback.LinkInputSig(trilist.BooleanInput[(uint)(joinMap.LightingSceneOffset + sceneIndex)]);
|
||||||
trilist.StringInput[(uint)(joinMap.LightingSceneOffset + sceneIndex)].StringValue = scene.Name;
|
trilist.StringInput[(uint)(joinMap.LightingSceneOffset + sceneIndex)].StringValue = scene.Name;
|
||||||
trilist.BooleanInput[(uint)(joinMap.ButtonVisibilityOffset + sceneIndex)].BoolValue = true;
|
trilist.BooleanInput[(uint)(joinMap.ButtonVisibilityOffset + sceneIndex)].BoolValue = true;
|
||||||
sceneIndex++;
|
sceneIndex++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (displayDevice.GetType().Name.ToString() == "LutronQuantumArea")
|
if (displayDevice.GetType().Name.ToString() == "LutronQuantumArea")
|
||||||
{
|
{
|
||||||
var lutronDevice = displayDevice as PepperDash.Essentials.Devices.Common.Environment.Lutron.LutronQuantumArea;
|
var lutronDevice = displayDevice as PepperDash.Essentials.Devices.Common.Environment.Lutron.LutronQuantumArea;
|
||||||
lutronDevice.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
|
lutronDevice.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
|
||||||
trilist.SetStringSigAction(joinMap.IntegrationIdSet, s => lutronDevice.IntegrationId = s);
|
trilist.SetStringSigAction(joinMap.IntegrationIdSet, s => lutronDevice.IntegrationId = s);
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
//ApiEisc.Eisc.SetStringSigAction(ApiMap.integrationID, (s) => { lutronLights.IntegrationId = s; });
|
//ApiEisc.Eisc.SetStringSigAction(ApiMap.integrationID, (s) => { lutronLights.IntegrationId = s; });
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
var lutronLights = displayDevice as PepperDash.Essentials.Devices.Common.Environment.Lutron.LutronQuantumArea;
|
var lutronLights = displayDevice as PepperDash.Essentials.Devices.Common.Environment.Lutron.LutronQuantumArea;
|
||||||
|
|
||||||
|
|
||||||
for (uint i = 1; i <= lightingBase.CircuitCount; i++)
|
for (uint i = 1; i <= lightingBase.CircuitCount; i++)
|
||||||
{
|
{
|
||||||
var circuit = i;
|
var circuit = i;
|
||||||
lightingBase.CircuitNameFeedbacks[circuit - 1].LinkInputSig(trilist.StringInput[joinMap.CircuitNames + circuit]);
|
lightingBase.CircuitNameFeedbacks[circuit - 1].LinkInputSig(trilist.StringInput[joinMap.CircuitNames + circuit]);
|
||||||
lightingBase.CircuitIsCritical[circuit - 1].LinkInputSig(trilist.BooleanInput[joinMap.CircuitIsCritical + circuit]);
|
lightingBase.CircuitIsCritical[circuit - 1].LinkInputSig(trilist.BooleanInput[joinMap.CircuitIsCritical + circuit]);
|
||||||
lightingBase.CircuitState[circuit - 1].LinkInputSig(trilist.BooleanInput[joinMap.CircuitState + circuit]);
|
lightingBase.CircuitState[circuit - 1].LinkInputSig(trilist.BooleanInput[joinMap.CircuitState + circuit]);
|
||||||
trilist.SetSigTrueAction(joinMap.CircuitCycle + circuit, () => lightingBase.CycleCircuit(circuit - 1));
|
trilist.SetSigTrueAction(joinMap.CircuitCycle + circuit, () => lightingBase.CycleCircuit(circuit - 1));
|
||||||
trilist.SetSigTrueAction(joinMap.CircuitOnCmd + circuit, () => lightingBase.TurnOnCircuit(circuit - 1));
|
trilist.SetSigTrueAction(joinMap.CircuitOnCmd + circuit, () => lightingBase.TurnOnCircuit(circuit - 1));
|
||||||
trilist.SetSigTrueAction(joinMap.CircuitOffCmd + circuit, () => lightingBase.TurnOffCircuit(circuit - 1));
|
trilist.SetSigTrueAction(joinMap.CircuitOffCmd + circuit, () => lightingBase.TurnOffCircuit(circuit - 1));
|
||||||
|
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public class DisplayControllerJoinMap : JoinMapBase
|
public class DisplayControllerJoinMap : JoinMapBase
|
||||||
{
|
{
|
||||||
public uint IsOnline { get; set; }
|
public uint IsOnline { get; set; }
|
||||||
public uint PowerOff { get; set; }
|
public uint PowerOff { get; set; }
|
||||||
public uint PowerOn { get; set; }
|
public uint PowerOn { get; set; }
|
||||||
public uint SelectScene { get; set; }
|
public uint SelectScene { get; set; }
|
||||||
public uint LightingSceneOffset { get; set; }
|
public uint LightingSceneOffset { get; set; }
|
||||||
public uint ButtonVisibilityOffset { get; set; }
|
public uint ButtonVisibilityOffset { get; set; }
|
||||||
public uint IntegrationIdSet { get; set; }
|
public uint IntegrationIdSet { get; set; }
|
||||||
|
|
||||||
public DisplayControllerJoinMap()
|
public DisplayControllerJoinMap()
|
||||||
{
|
{
|
||||||
// Digital
|
// Digital
|
||||||
IsOnline = 1;
|
IsOnline = 1;
|
||||||
PowerOff = 1;
|
PowerOff = 1;
|
||||||
PowerOn = 2;
|
PowerOn = 2;
|
||||||
SelectScene = 1;
|
SelectScene = 1;
|
||||||
IntegrationIdSet = 1;
|
IntegrationIdSet = 1;
|
||||||
LightingSceneOffset = 10;
|
LightingSceneOffset = 10;
|
||||||
ButtonVisibilityOffset = 40;
|
ButtonVisibilityOffset = 40;
|
||||||
// Analog
|
// Analog
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void OffsetJoinNumbers(uint joinStart)
|
public override void OffsetJoinNumbers(uint joinStart)
|
||||||
{
|
{
|
||||||
var joinOffset = joinStart - 1;
|
var joinOffset = joinStart - 1;
|
||||||
|
|
||||||
IsOnline = IsOnline + joinOffset;
|
IsOnline = IsOnline + joinOffset;
|
||||||
PowerOff = PowerOff + joinOffset;
|
PowerOff = PowerOff + joinOffset;
|
||||||
PowerOn = PowerOn + joinOffset;
|
PowerOn = PowerOn + joinOffset;
|
||||||
SelectScene = SelectScene + joinOffset;
|
SelectScene = SelectScene + joinOffset;
|
||||||
LightingSceneOffset = LightingSceneOffset + joinOffset;
|
LightingSceneOffset = LightingSceneOffset + joinOffset;
|
||||||
ButtonVisibilityOffset = ButtonVisibilityOffset + joinOffset;
|
ButtonVisibilityOffset = ButtonVisibilityOffset + joinOffset;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,144 +1,144 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
using PepperDash.Essentials.Core.Config;
|
using PepperDash.Essentials.Core.Config;
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core.Routing;
|
using PepperDash.Essentials.Core.Routing;
|
||||||
using Crestron.SimplSharpPro;
|
using Crestron.SimplSharpPro;
|
||||||
using Crestron.SimplSharpPro.EthernetCommunication;
|
using Crestron.SimplSharpPro.EthernetCommunication;
|
||||||
using Crestron.SimplSharpPro.CrestronThread;
|
using Crestron.SimplSharpPro.CrestronThread;
|
||||||
|
|
||||||
namespace PepperDash.Essentials {
|
namespace PepperDash.Essentials {
|
||||||
public class EssentialCommConfig {
|
public class EssentialCommConfig {
|
||||||
public string[] EiscApiIpids;
|
public string[] EiscApiIpids;
|
||||||
public EssentialCommCommConnectionConfigs[] CommConnections;
|
public EssentialCommCommConnectionConfigs[] CommConnections;
|
||||||
}
|
}
|
||||||
public class EssentialCommCommConnectionConfigs {
|
public class EssentialCommCommConnectionConfigs {
|
||||||
public uint joinNumber {get; set; }
|
public uint joinNumber {get; set; }
|
||||||
public EssentialsControlPropertiesConfig control { get; set; }
|
public EssentialsControlPropertiesConfig control { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class EssentialCommsPort {
|
public class EssentialCommsPort {
|
||||||
public IBasicCommunication Comm;
|
public IBasicCommunication Comm;
|
||||||
public IntFeedback StatusFeedback;
|
public IntFeedback StatusFeedback;
|
||||||
public BoolFeedback ConnectedFeedback;
|
public BoolFeedback ConnectedFeedback;
|
||||||
public List<EssentialComApiMap> Outputs = new List<EssentialComApiMap>();
|
public List<EssentialComApiMap> Outputs = new List<EssentialComApiMap>();
|
||||||
public String RxBuffer;
|
public String RxBuffer;
|
||||||
public EssentialCommsPort(EssentialsControlPropertiesConfig config, string keyPrefix) {
|
public EssentialCommsPort(EssentialsControlPropertiesConfig config, string keyPrefix) {
|
||||||
Comm = CommFactory.CreateCommForConfig(config, keyPrefix);
|
Comm = CommFactory.CreateCommForConfig(config, keyPrefix);
|
||||||
// var PortGather = new CommunicationGather(Comm, config.EndOfLineChar);
|
// var PortGather = new CommunicationGather(Comm, config.EndOfLineChar);
|
||||||
Comm.TextReceived += new EventHandler<GenericCommMethodReceiveTextArgs>(Communication_TextReceived);
|
Comm.TextReceived += new EventHandler<GenericCommMethodReceiveTextArgs>(Communication_TextReceived);
|
||||||
|
|
||||||
var socket = Comm as ISocketStatus;
|
var socket = Comm as ISocketStatus;
|
||||||
StatusFeedback = new IntFeedback(() => { return (int)socket.ClientStatus; });
|
StatusFeedback = new IntFeedback(() => { return (int)socket.ClientStatus; });
|
||||||
ConnectedFeedback = new BoolFeedback(() => { return Comm.IsConnected; });
|
ConnectedFeedback = new BoolFeedback(() => { return Comm.IsConnected; });
|
||||||
|
|
||||||
if (socket != null) {
|
if (socket != null) {
|
||||||
socket.ConnectionChange += new EventHandler<GenericSocketStatusChageEventArgs>(socket_ConnectionChange);
|
socket.ConnectionChange += new EventHandler<GenericSocketStatusChageEventArgs>(socket_ConnectionChange);
|
||||||
} else {
|
} else {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
void socket_ConnectionChange(object sender, GenericSocketStatusChageEventArgs e) {
|
void socket_ConnectionChange(object sender, GenericSocketStatusChageEventArgs e) {
|
||||||
StatusFeedback.FireUpdate();
|
StatusFeedback.FireUpdate();
|
||||||
ConnectedFeedback.FireUpdate();
|
ConnectedFeedback.FireUpdate();
|
||||||
if (e.Client.IsConnected) {
|
if (e.Client.IsConnected) {
|
||||||
// Tasks on connect
|
// Tasks on connect
|
||||||
} else {
|
} else {
|
||||||
// Cleanup items from this session
|
// Cleanup items from this session
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void Communication_TextReceived(object sender, GenericCommMethodReceiveTextArgs args) {
|
void Communication_TextReceived(object sender, GenericCommMethodReceiveTextArgs args) {
|
||||||
try {
|
try {
|
||||||
foreach (var Output in Outputs) {
|
foreach (var Output in Outputs) {
|
||||||
Output.Api.Eisc.StringInput[Output.Join].StringValue = args.Text;
|
Output.Api.Eisc.StringInput[Output.Join].StringValue = args.Text;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (Exception) {
|
catch (Exception) {
|
||||||
throw new FormatException(string.Format("ERROR:{0}"));
|
throw new FormatException(string.Format("ERROR:{0}"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class EssentialComm : Device {
|
public class EssentialComm : Device {
|
||||||
public EssentialCommConfig Properties;
|
public EssentialCommConfig Properties;
|
||||||
|
|
||||||
public CommunicationGather PortGather { get; private set; }
|
public CommunicationGather PortGather { get; private set; }
|
||||||
public List<BridgeApiEisc> Apis {get; set;}
|
public List<BridgeApiEisc> Apis {get; set;}
|
||||||
public Dictionary<string, StringFeedback> CommFeedbacks {get; private set; }
|
public Dictionary<string, StringFeedback> CommFeedbacks {get; private set; }
|
||||||
public StatusMonitorBase CommunicationMonitor { get; private set; }
|
public StatusMonitorBase CommunicationMonitor { get; private set; }
|
||||||
public Dictionary<uint, EssentialCommsPort> CommDictionary { get; private set; }
|
public Dictionary<uint, EssentialCommsPort> CommDictionary { get; private set; }
|
||||||
|
|
||||||
public EssentialComm(string key, string name, JToken properties) : base(key, name) {
|
public EssentialComm(string key, string name, JToken properties) : base(key, name) {
|
||||||
Properties = JsonConvert.DeserializeObject<EssentialCommConfig>(properties.ToString());
|
Properties = JsonConvert.DeserializeObject<EssentialCommConfig>(properties.ToString());
|
||||||
CommFeedbacks = new Dictionary<string, StringFeedback>();
|
CommFeedbacks = new Dictionary<string, StringFeedback>();
|
||||||
CommDictionary = new Dictionary<uint, EssentialCommsPort>();
|
CommDictionary = new Dictionary<uint, EssentialCommsPort>();
|
||||||
Apis = new List<BridgeApiEisc>();
|
Apis = new List<BridgeApiEisc>();
|
||||||
int commNumber = 1;
|
int commNumber = 1;
|
||||||
foreach (var commConfig in Properties.CommConnections) {
|
foreach (var commConfig in Properties.CommConnections) {
|
||||||
var commPort = new EssentialCommsPort(commConfig.control, string.Format("{0}-{1}", this.Key, commConfig.joinNumber));
|
var commPort = new EssentialCommsPort(commConfig.control, string.Format("{0}-{1}", this.Key, commConfig.joinNumber));
|
||||||
CommDictionary.Add(commConfig.joinNumber, commPort);
|
CommDictionary.Add(commConfig.joinNumber, commPort);
|
||||||
|
|
||||||
commNumber++;
|
commNumber++;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (var Ipid in Properties.EiscApiIpids) {
|
foreach (var Ipid in Properties.EiscApiIpids) {
|
||||||
var ApiEisc = new BridgeApiEisc(Ipid);
|
var ApiEisc = new BridgeApiEisc(Ipid);
|
||||||
Apis.Add(ApiEisc);
|
Apis.Add(ApiEisc);
|
||||||
foreach (var commConnection in CommDictionary) {
|
foreach (var commConnection in CommDictionary) {
|
||||||
Debug.Console(2, "Joining Api{0} to comm {1}", Ipid, commConnection.Key);
|
Debug.Console(2, "Joining Api{0} to comm {1}", Ipid, commConnection.Key);
|
||||||
var tempComm = commConnection.Value;
|
var tempComm = commConnection.Value;
|
||||||
var tempJoin = (uint)commConnection.Key;
|
var tempJoin = (uint)commConnection.Key;
|
||||||
EssentialComApiMap ApiMap = new EssentialComApiMap(ApiEisc, (uint)tempJoin);
|
EssentialComApiMap ApiMap = new EssentialComApiMap(ApiEisc, (uint)tempJoin);
|
||||||
|
|
||||||
tempComm.Outputs.Add(ApiMap);
|
tempComm.Outputs.Add(ApiMap);
|
||||||
// Check for ApiMap Overide Values here
|
// Check for ApiMap Overide Values here
|
||||||
|
|
||||||
ApiEisc.Eisc.SetBoolSigAction(tempJoin, b => {if (b) { tempComm.Comm.Connect(); } else { tempComm.Comm.Disconnect(); }});
|
ApiEisc.Eisc.SetBoolSigAction(tempJoin, b => {if (b) { tempComm.Comm.Connect(); } else { tempComm.Comm.Disconnect(); }});
|
||||||
ApiEisc.Eisc.SetStringSigAction(tempJoin, s => tempComm.Comm.SendText(s));
|
ApiEisc.Eisc.SetStringSigAction(tempJoin, s => tempComm.Comm.SendText(s));
|
||||||
|
|
||||||
tempComm.StatusFeedback.LinkInputSig(ApiEisc.Eisc.UShortInput[tempJoin]);
|
tempComm.StatusFeedback.LinkInputSig(ApiEisc.Eisc.UShortInput[tempJoin]);
|
||||||
tempComm.ConnectedFeedback.LinkInputSig(ApiEisc.Eisc.BooleanInput[tempJoin]);
|
tempComm.ConnectedFeedback.LinkInputSig(ApiEisc.Eisc.BooleanInput[tempJoin]);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
ApiEisc.Eisc.Register();
|
ApiEisc.Eisc.Register();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public override bool CustomActivate()
|
public override bool CustomActivate()
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Debug.Console(2, "Name {0} Activated", this.Name);
|
Debug.Console(2, "Name {0} Activated", this.Name);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
Debug.Console(0, "Bridge {0}", e);
|
Debug.Console(0, "Bridge {0}", e);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
public class EssentialComApiMap {
|
public class EssentialComApiMap {
|
||||||
public uint Join;
|
public uint Join;
|
||||||
public BridgeApiEisc Api;
|
public BridgeApiEisc Api;
|
||||||
public uint connectJoin;
|
public uint connectJoin;
|
||||||
public EssentialComApiMap(BridgeApiEisc api, uint join) {
|
public EssentialComApiMap(BridgeApiEisc api, uint join) {
|
||||||
Join = join;
|
Join = join;
|
||||||
Api = api;
|
Api = api;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,150 +1,150 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
using PepperDash.Essentials.Core.Config;
|
using PepperDash.Essentials.Core.Config;
|
||||||
using PepperDash.Essentials.DM;
|
using PepperDash.Essentials.DM;
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core.Routing;
|
using PepperDash.Essentials.Core.Routing;
|
||||||
using Crestron.SimplSharpPro;
|
using Crestron.SimplSharpPro;
|
||||||
using Crestron.SimplSharpPro.EthernetCommunication;
|
using Crestron.SimplSharpPro.EthernetCommunication;
|
||||||
using Crestron.SimplSharpPro.DM;
|
using Crestron.SimplSharpPro.DM;
|
||||||
|
|
||||||
namespace PepperDash.Essentials {
|
namespace PepperDash.Essentials {
|
||||||
public class EssentialDM : PepperDash.Core.Device {
|
public class EssentialDM : PepperDash.Core.Device {
|
||||||
public EssentialDMProperties Properties;
|
public EssentialDMProperties Properties;
|
||||||
public List<BridgeApiEisc> BridgeApiEiscs;
|
public List<BridgeApiEisc> BridgeApiEiscs;
|
||||||
private PepperDash.Essentials.DM.DmChassisController DmSwitch;
|
private PepperDash.Essentials.DM.DmChassisController DmSwitch;
|
||||||
private EssentialDMApiMap ApiMap = new EssentialDMApiMap();
|
private EssentialDMApiMap ApiMap = new EssentialDMApiMap();
|
||||||
public EssentialDM(string key, string name, JToken properties)
|
public EssentialDM(string key, string name, JToken properties)
|
||||||
: base(key, name) {
|
: base(key, name) {
|
||||||
Properties = JsonConvert.DeserializeObject<EssentialDMProperties>(properties.ToString());
|
Properties = JsonConvert.DeserializeObject<EssentialDMProperties>(properties.ToString());
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
public override bool CustomActivate() {
|
public override bool CustomActivate() {
|
||||||
// Create EiscApis
|
// Create EiscApis
|
||||||
try {
|
try {
|
||||||
foreach (var device in DeviceManager.AllDevices) {
|
foreach (var device in DeviceManager.AllDevices) {
|
||||||
if (device.Key == this.Properties.connectionDeviceKey) {
|
if (device.Key == this.Properties.connectionDeviceKey) {
|
||||||
Debug.Console(2, "deviceKey {0} Matches", device.Key);
|
Debug.Console(2, "deviceKey {0} Matches", device.Key);
|
||||||
DmSwitch = DeviceManager.GetDeviceForKey(device.Key) as PepperDash.Essentials.DM.DmChassisController;
|
DmSwitch = DeviceManager.GetDeviceForKey(device.Key) as PepperDash.Essentials.DM.DmChassisController;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
else {
|
else {
|
||||||
Debug.Console(2, "deviceKey {0} doesn't match", device.Key);
|
Debug.Console(2, "deviceKey {0} doesn't match", device.Key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (Properties.EiscApiIpids != null) {
|
if (Properties.EiscApiIpids != null) {
|
||||||
|
|
||||||
|
|
||||||
foreach (string Ipid in Properties.EiscApiIpids) {
|
foreach (string Ipid in Properties.EiscApiIpids) {
|
||||||
var ApiEisc = new BridgeApiEisc(Ipid);
|
var ApiEisc = new BridgeApiEisc(Ipid);
|
||||||
for (uint x = 1; x <= DmSwitch.Chassis.NumberOfInputs;x++ ) {
|
for (uint x = 1; x <= DmSwitch.Chassis.NumberOfInputs;x++ ) {
|
||||||
uint tempX = x;
|
uint tempX = x;
|
||||||
Debug.Console(2, "Creating EiscActions {0}", tempX);
|
Debug.Console(2, "Creating EiscActions {0}", tempX);
|
||||||
|
|
||||||
|
|
||||||
ApiEisc.Eisc.SetUShortSigAction(ApiMap.OutputVideoRoutes[tempX], u => DmSwitch.ExecuteSwitch(u, tempX, eRoutingSignalType.Video));
|
ApiEisc.Eisc.SetUShortSigAction(ApiMap.OutputVideoRoutes[tempX], u => DmSwitch.ExecuteSwitch(u, tempX, eRoutingSignalType.Video));
|
||||||
ApiEisc.Eisc.SetUShortSigAction(ApiMap.OutputAudioRoutes[tempX], u => DmSwitch.ExecuteSwitch(u, tempX, eRoutingSignalType.Audio));
|
ApiEisc.Eisc.SetUShortSigAction(ApiMap.OutputAudioRoutes[tempX], u => DmSwitch.ExecuteSwitch(u, tempX, eRoutingSignalType.Audio));
|
||||||
|
|
||||||
|
|
||||||
if (DmSwitch.TxDictionary.ContainsKey(tempX)) {
|
if (DmSwitch.TxDictionary.ContainsKey(tempX)) {
|
||||||
Debug.Console(2, "Creating Tx Feedbacks {0}", tempX);
|
Debug.Console(2, "Creating Tx Feedbacks {0}", tempX);
|
||||||
var TxKey = DmSwitch.TxDictionary[tempX];
|
var TxKey = DmSwitch.TxDictionary[tempX];
|
||||||
var TxDevice = DeviceManager.GetDeviceForKey(TxKey) as DmTxControllerBase;
|
var TxDevice = DeviceManager.GetDeviceForKey(TxKey) as DmTxControllerBase;
|
||||||
TxDevice.IsOnline.LinkInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.TxOnlineStatus[tempX]]);
|
TxDevice.IsOnline.LinkInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.TxOnlineStatus[tempX]]);
|
||||||
TxDevice.AnyVideoInput.VideoStatus.VideoSyncFeedback.LinkInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.TxVideoSyncStatus[tempX]]);
|
TxDevice.AnyVideoInput.VideoStatus.VideoSyncFeedback.LinkInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.TxVideoSyncStatus[tempX]]);
|
||||||
ApiEisc.Eisc.SetUShortSigAction((ApiMap.HdcpSupport[tempX]), u => TxDevice.SetHdcpSupportAll((ePdtHdcpSupport)(u)));
|
ApiEisc.Eisc.SetUShortSigAction((ApiMap.HdcpSupport[tempX]), u => TxDevice.SetHdcpSupportAll((ePdtHdcpSupport)(u)));
|
||||||
TxDevice.HdcpSupportAllFeedback.LinkInputSig(ApiEisc.Eisc.UShortInput[ApiMap.HdcpSupport[tempX]]);
|
TxDevice.HdcpSupportAllFeedback.LinkInputSig(ApiEisc.Eisc.UShortInput[ApiMap.HdcpSupport[tempX]]);
|
||||||
ApiEisc.Eisc.UShortInput[ApiMap.HdcpSupportCapability[tempX]].UShortValue = TxDevice.HdcpSupportCapability;
|
ApiEisc.Eisc.UShortInput[ApiMap.HdcpSupportCapability[tempX]].UShortValue = TxDevice.HdcpSupportCapability;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
DmSwitch.VideoInputSyncFeedbacks[tempX].LinkInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.TxVideoSyncStatus[tempX]]);
|
DmSwitch.VideoInputSyncFeedbacks[tempX].LinkInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.TxVideoSyncStatus[tempX]]);
|
||||||
}
|
}
|
||||||
if (DmSwitch.RxDictionary.ContainsKey(tempX)) {
|
if (DmSwitch.RxDictionary.ContainsKey(tempX)) {
|
||||||
Debug.Console(2, "Creating Rx Feedbacks {0}", tempX);
|
Debug.Console(2, "Creating Rx Feedbacks {0}", tempX);
|
||||||
var RxKey = DmSwitch.RxDictionary[tempX];
|
var RxKey = DmSwitch.RxDictionary[tempX];
|
||||||
var RxDevice = DeviceManager.GetDeviceForKey(RxKey) as DmRmcControllerBase;
|
var RxDevice = DeviceManager.GetDeviceForKey(RxKey) as DmRmcControllerBase;
|
||||||
RxDevice.IsOnline.LinkInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.RxOnlineStatus[tempX]]);
|
RxDevice.IsOnline.LinkInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.RxOnlineStatus[tempX]]);
|
||||||
}
|
}
|
||||||
// DmSwitch.InputEndpointOnlineFeedbacks[(ushort)tempOutputNum].LinkInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.OutputVideoRoutes[tempOutputNum]]);
|
// DmSwitch.InputEndpointOnlineFeedbacks[(ushort)tempOutputNum].LinkInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.OutputVideoRoutes[tempOutputNum]]);
|
||||||
DmSwitch.VideoOutputFeedbacks[(ushort)tempX].LinkInputSig(ApiEisc.Eisc.UShortInput[ApiMap.OutputVideoRoutes[tempX]]);
|
DmSwitch.VideoOutputFeedbacks[(ushort)tempX].LinkInputSig(ApiEisc.Eisc.UShortInput[ApiMap.OutputVideoRoutes[tempX]]);
|
||||||
DmSwitch.AudioOutputFeedbacks[(ushort)tempX].LinkInputSig(ApiEisc.Eisc.UShortInput[ApiMap.OutputAudioRoutes[tempX]]);
|
DmSwitch.AudioOutputFeedbacks[(ushort)tempX].LinkInputSig(ApiEisc.Eisc.UShortInput[ApiMap.OutputAudioRoutes[tempX]]);
|
||||||
DmSwitch.InputNameFeedbacks[(ushort)tempX].LinkInputSig(ApiEisc.Eisc.StringInput[ApiMap.InputNames[tempX]]);
|
DmSwitch.InputNameFeedbacks[(ushort)tempX].LinkInputSig(ApiEisc.Eisc.StringInput[ApiMap.InputNames[tempX]]);
|
||||||
DmSwitch.OutputNameFeedbacks[(ushort)tempX].LinkInputSig(ApiEisc.Eisc.StringInput[ApiMap.OutputNames[tempX]]);
|
DmSwitch.OutputNameFeedbacks[(ushort)tempX].LinkInputSig(ApiEisc.Eisc.StringInput[ApiMap.OutputNames[tempX]]);
|
||||||
DmSwitch.OutputRouteNameFeedbacks[(ushort)tempX].LinkInputSig(ApiEisc.Eisc.StringInput[ApiMap.OutputRouteNames[tempX]]);
|
DmSwitch.OutputRouteNameFeedbacks[(ushort)tempX].LinkInputSig(ApiEisc.Eisc.StringInput[ApiMap.OutputRouteNames[tempX]]);
|
||||||
}
|
}
|
||||||
DmSwitch.IsOnline.LinkInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.ChassisOnline]);
|
DmSwitch.IsOnline.LinkInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.ChassisOnline]);
|
||||||
ApiEisc.Eisc.Register();
|
ApiEisc.Eisc.Register();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Debug.Console(2, "Name {0} Activated", this.Name);
|
Debug.Console(2, "Name {0} Activated", this.Name);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
Debug.Console(2, "BRidge {0}", e);
|
Debug.Console(2, "BRidge {0}", e);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public class EssentialDMProperties {
|
public class EssentialDMProperties {
|
||||||
public string connectionDeviceKey;
|
public string connectionDeviceKey;
|
||||||
public string[] EiscApiIpids;
|
public string[] EiscApiIpids;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public class EssentialDMApiMap {
|
public class EssentialDMApiMap {
|
||||||
public ushort ChassisOnline = 11;
|
public ushort ChassisOnline = 11;
|
||||||
public Dictionary<uint, ushort> OutputVideoRoutes;
|
public Dictionary<uint, ushort> OutputVideoRoutes;
|
||||||
public Dictionary<uint, ushort> OutputAudioRoutes;
|
public Dictionary<uint, ushort> OutputAudioRoutes;
|
||||||
public Dictionary<uint, ushort> TxOnlineStatus;
|
public Dictionary<uint, ushort> TxOnlineStatus;
|
||||||
public Dictionary<uint, ushort> RxOnlineStatus;
|
public Dictionary<uint, ushort> RxOnlineStatus;
|
||||||
public Dictionary<uint, ushort> TxVideoSyncStatus;
|
public Dictionary<uint, ushort> TxVideoSyncStatus;
|
||||||
public Dictionary<uint, ushort> InputNames;
|
public Dictionary<uint, ushort> InputNames;
|
||||||
public Dictionary<uint, ushort> OutputNames;
|
public Dictionary<uint, ushort> OutputNames;
|
||||||
public Dictionary<uint, ushort> OutputRouteNames;
|
public Dictionary<uint, ushort> OutputRouteNames;
|
||||||
public Dictionary<uint, ushort> HdcpSupport;
|
public Dictionary<uint, ushort> HdcpSupport;
|
||||||
public Dictionary<uint, ushort> HdcpSupportCapability;
|
public Dictionary<uint, ushort> HdcpSupportCapability;
|
||||||
|
|
||||||
public EssentialDMApiMap() {
|
public EssentialDMApiMap() {
|
||||||
OutputVideoRoutes = new Dictionary<uint, ushort>();
|
OutputVideoRoutes = new Dictionary<uint, ushort>();
|
||||||
OutputAudioRoutes = new Dictionary<uint, ushort>();
|
OutputAudioRoutes = new Dictionary<uint, ushort>();
|
||||||
TxOnlineStatus = new Dictionary<uint, ushort>();
|
TxOnlineStatus = new Dictionary<uint, ushort>();
|
||||||
RxOnlineStatus = new Dictionary<uint, ushort>();
|
RxOnlineStatus = new Dictionary<uint, ushort>();
|
||||||
TxVideoSyncStatus = new Dictionary<uint, ushort>();
|
TxVideoSyncStatus = new Dictionary<uint, ushort>();
|
||||||
InputNames = new Dictionary<uint, ushort>();
|
InputNames = new Dictionary<uint, ushort>();
|
||||||
OutputNames = new Dictionary<uint, ushort>();
|
OutputNames = new Dictionary<uint, ushort>();
|
||||||
OutputRouteNames = new Dictionary<uint, ushort>();
|
OutputRouteNames = new Dictionary<uint, ushort>();
|
||||||
HdcpSupport = new Dictionary<uint, ushort>();
|
HdcpSupport = new Dictionary<uint, ushort>();
|
||||||
HdcpSupportCapability = new Dictionary<uint, ushort>();
|
HdcpSupportCapability = new Dictionary<uint, ushort>();
|
||||||
|
|
||||||
for (uint x = 1; x <= 200; x++) {
|
for (uint x = 1; x <= 200; x++) {
|
||||||
// Debug.Console(0, "Init Value {0}", x);
|
// Debug.Console(0, "Init Value {0}", x);
|
||||||
uint tempNum = x;
|
uint tempNum = x;
|
||||||
HdcpSupportCapability[tempNum] = (ushort)(tempNum + 1200);
|
HdcpSupportCapability[tempNum] = (ushort)(tempNum + 1200);
|
||||||
HdcpSupport[tempNum] = (ushort)(tempNum + 1000);
|
HdcpSupport[tempNum] = (ushort)(tempNum + 1000);
|
||||||
OutputVideoRoutes[tempNum] = (ushort)(tempNum + 100);
|
OutputVideoRoutes[tempNum] = (ushort)(tempNum + 100);
|
||||||
OutputAudioRoutes[tempNum] = (ushort)(tempNum + 300);
|
OutputAudioRoutes[tempNum] = (ushort)(tempNum + 300);
|
||||||
TxOnlineStatus[tempNum] = (ushort)(tempNum + 500);
|
TxOnlineStatus[tempNum] = (ushort)(tempNum + 500);
|
||||||
RxOnlineStatus[tempNum] = (ushort)(tempNum + 700);
|
RxOnlineStatus[tempNum] = (ushort)(tempNum + 700);
|
||||||
TxVideoSyncStatus[tempNum] = (ushort)(tempNum + 100);
|
TxVideoSyncStatus[tempNum] = (ushort)(tempNum + 100);
|
||||||
InputNames[tempNum] = (ushort)(tempNum + 100);
|
InputNames[tempNum] = (ushort)(tempNum + 100);
|
||||||
OutputNames[tempNum] = (ushort)(tempNum + 300);
|
OutputNames[tempNum] = (ushort)(tempNum + 300);
|
||||||
OutputRouteNames[tempNum] = (ushort)(tempNum + 2000);
|
OutputRouteNames[tempNum] = (ushort)(tempNum + 2000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1,217 +1,217 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
using PepperDash.Essentials.Core.Config;
|
using PepperDash.Essentials.Core.Config;
|
||||||
using PepperDash.Essentials.DM;
|
using PepperDash.Essentials.DM;
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core.Routing;
|
using PepperDash.Essentials.Core.Routing;
|
||||||
using Crestron.SimplSharpPro;
|
using Crestron.SimplSharpPro;
|
||||||
using Crestron.SimplSharpPro.EthernetCommunication;
|
using Crestron.SimplSharpPro.EthernetCommunication;
|
||||||
using Crestron.SimplSharpPro.DM;
|
using Crestron.SimplSharpPro.DM;
|
||||||
|
|
||||||
namespace PepperDash.Essentials {
|
namespace PepperDash.Essentials {
|
||||||
public class EssentialDsp : PepperDash.Core.Device {
|
public class EssentialDsp : PepperDash.Core.Device {
|
||||||
public EssentialDspProperties Properties;
|
public EssentialDspProperties Properties;
|
||||||
public List<BridgeApiEisc> BridgeApiEiscs;
|
public List<BridgeApiEisc> BridgeApiEiscs;
|
||||||
private PepperDash.Essentials.Devices.Common.DSP.QscDsp Dsp;
|
private PepperDash.Essentials.Devices.Common.DSP.QscDsp Dsp;
|
||||||
private EssentialDspApiMap ApiMap = new EssentialDspApiMap();
|
private EssentialDspApiMap ApiMap = new EssentialDspApiMap();
|
||||||
public EssentialDsp(string key, string name, JToken properties)
|
public EssentialDsp(string key, string name, JToken properties)
|
||||||
: base(key, name) {
|
: base(key, name) {
|
||||||
Properties = JsonConvert.DeserializeObject<EssentialDspProperties>(properties.ToString());
|
Properties = JsonConvert.DeserializeObject<EssentialDspProperties>(properties.ToString());
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
public override bool CustomActivate() {
|
public override bool CustomActivate() {
|
||||||
// Create EiscApis
|
// Create EiscApis
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
ICommunicationMonitor comm = null;
|
ICommunicationMonitor comm = null;
|
||||||
foreach (var device in DeviceManager.AllDevices)
|
foreach (var device in DeviceManager.AllDevices)
|
||||||
{
|
{
|
||||||
if (device.Key == this.Properties.connectionDeviceKey)
|
if (device.Key == this.Properties.connectionDeviceKey)
|
||||||
{
|
{
|
||||||
if (!(device is ICommunicationMonitor))
|
if (!(device is ICommunicationMonitor))
|
||||||
{
|
{
|
||||||
comm = device as ICommunicationMonitor;
|
comm = device as ICommunicationMonitor;
|
||||||
}
|
}
|
||||||
Debug.Console(2, "deviceKey {0} Matches", device.Key);
|
Debug.Console(2, "deviceKey {0} Matches", device.Key);
|
||||||
Dsp = DeviceManager.GetDeviceForKey(device.Key) as PepperDash.Essentials.Devices.Common.DSP.QscDsp;
|
Dsp = DeviceManager.GetDeviceForKey(device.Key) as PepperDash.Essentials.Devices.Common.DSP.QscDsp;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Debug.Console(2, "deviceKey {0} doesn't match", device.Key);
|
Debug.Console(2, "deviceKey {0} doesn't match", device.Key);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (Properties.EiscApiIpids != null && Dsp != null)
|
if (Properties.EiscApiIpids != null && Dsp != null)
|
||||||
{
|
{
|
||||||
foreach (string Ipid in Properties.EiscApiIpids)
|
foreach (string Ipid in Properties.EiscApiIpids)
|
||||||
{
|
{
|
||||||
var ApiEisc = new BridgeApiEisc(Ipid);
|
var ApiEisc = new BridgeApiEisc(Ipid);
|
||||||
Debug.Console(2, "Connecting EiscApi {0} to {1}", ApiEisc.Ipid, Dsp.Name);
|
Debug.Console(2, "Connecting EiscApi {0} to {1}", ApiEisc.Ipid, Dsp.Name);
|
||||||
ushort x = 1;
|
ushort x = 1;
|
||||||
if (comm != null)
|
if (comm != null)
|
||||||
{
|
{
|
||||||
comm.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.Online]);
|
comm.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.Online]);
|
||||||
}
|
}
|
||||||
foreach (var channel in Dsp.LevelControlPoints)
|
foreach (var channel in Dsp.LevelControlPoints)
|
||||||
{
|
{
|
||||||
//var QscChannel = channel.Value as PepperDash.Essentials.Devices.Common.DSP.QscDspLevelControl;
|
//var QscChannel = channel.Value as PepperDash.Essentials.Devices.Common.DSP.QscDspLevelControl;
|
||||||
Debug.Console(2, "QscChannel {0} connect", x);
|
Debug.Console(2, "QscChannel {0} connect", x);
|
||||||
|
|
||||||
var genericChannel = channel.Value as IBasicVolumeWithFeedback;
|
var genericChannel = channel.Value as IBasicVolumeWithFeedback;
|
||||||
if (channel.Value.Enabled)
|
if (channel.Value.Enabled)
|
||||||
{
|
{
|
||||||
ApiEisc.Eisc.StringInput[ApiMap.channelName[x]].StringValue = channel.Value.LevelCustomName;
|
ApiEisc.Eisc.StringInput[ApiMap.channelName[x]].StringValue = channel.Value.LevelCustomName;
|
||||||
ApiEisc.Eisc.UShortInput[ApiMap.channelType[x]].UShortValue = (ushort)channel.Value.Type;
|
ApiEisc.Eisc.UShortInput[ApiMap.channelType[x]].UShortValue = (ushort)channel.Value.Type;
|
||||||
|
|
||||||
genericChannel.MuteFeedback.LinkInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.channelMuteToggle[x]]);
|
genericChannel.MuteFeedback.LinkInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.channelMuteToggle[x]]);
|
||||||
genericChannel.VolumeLevelFeedback.LinkInputSig(ApiEisc.Eisc.UShortInput[ApiMap.channelVolume[x]]);
|
genericChannel.VolumeLevelFeedback.LinkInputSig(ApiEisc.Eisc.UShortInput[ApiMap.channelVolume[x]]);
|
||||||
|
|
||||||
ApiEisc.Eisc.SetSigTrueAction(ApiMap.channelMuteToggle[x], () => genericChannel.MuteToggle());
|
ApiEisc.Eisc.SetSigTrueAction(ApiMap.channelMuteToggle[x], () => genericChannel.MuteToggle());
|
||||||
ApiEisc.Eisc.SetSigTrueAction(ApiMap.channelMuteOn[x], () => genericChannel.MuteOn());
|
ApiEisc.Eisc.SetSigTrueAction(ApiMap.channelMuteOn[x], () => genericChannel.MuteOn());
|
||||||
ApiEisc.Eisc.SetSigTrueAction(ApiMap.channelMuteOff[x], () => genericChannel.MuteOff());
|
ApiEisc.Eisc.SetSigTrueAction(ApiMap.channelMuteOff[x], () => genericChannel.MuteOff());
|
||||||
|
|
||||||
ApiEisc.Eisc.SetBoolSigAction(ApiMap.channelVolumeUp[x], b => genericChannel.VolumeUp(b));
|
ApiEisc.Eisc.SetBoolSigAction(ApiMap.channelVolumeUp[x], b => genericChannel.VolumeUp(b));
|
||||||
ApiEisc.Eisc.SetBoolSigAction(ApiMap.channelVolumeDown[x], b => genericChannel.VolumeDown(b));
|
ApiEisc.Eisc.SetBoolSigAction(ApiMap.channelVolumeDown[x], b => genericChannel.VolumeDown(b));
|
||||||
|
|
||||||
ApiEisc.Eisc.SetUShortSigAction(ApiMap.channelVolume[x], u => genericChannel.SetVolume(u));
|
ApiEisc.Eisc.SetUShortSigAction(ApiMap.channelVolume[x], u => genericChannel.SetVolume(u));
|
||||||
ApiEisc.Eisc.SetStringSigAction(ApiMap.presetString, s => Dsp.RunPreset(s));
|
ApiEisc.Eisc.SetStringSigAction(ApiMap.presetString, s => Dsp.RunPreset(s));
|
||||||
}
|
}
|
||||||
x++;
|
x++;
|
||||||
|
|
||||||
}
|
}
|
||||||
x = 1;
|
x = 1;
|
||||||
foreach (var preset in Dsp.PresetList)
|
foreach (var preset in Dsp.PresetList)
|
||||||
{
|
{
|
||||||
ApiEisc.Eisc.StringInput[ApiMap.presets[x]].StringValue = preset.label;
|
ApiEisc.Eisc.StringInput[ApiMap.presets[x]].StringValue = preset.label;
|
||||||
ApiEisc.Eisc.SetSigTrueAction(ApiMap.presets[x], () => Dsp.RunPresetNumber(x));
|
ApiEisc.Eisc.SetSigTrueAction(ApiMap.presets[x], () => Dsp.RunPresetNumber(x));
|
||||||
x++;
|
x++;
|
||||||
}
|
}
|
||||||
foreach (var dialer in Dsp.Dialers)
|
foreach (var dialer in Dsp.Dialers)
|
||||||
{
|
{
|
||||||
ApiEisc.Eisc.SetSigTrueAction(ApiMap.Keypad0, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Num0));
|
ApiEisc.Eisc.SetSigTrueAction(ApiMap.Keypad0, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Num0));
|
||||||
ApiEisc.Eisc.SetSigTrueAction(ApiMap.Keypad1, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Num1));
|
ApiEisc.Eisc.SetSigTrueAction(ApiMap.Keypad1, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Num1));
|
||||||
ApiEisc.Eisc.SetSigTrueAction(ApiMap.Keypad2, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Num2));
|
ApiEisc.Eisc.SetSigTrueAction(ApiMap.Keypad2, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Num2));
|
||||||
ApiEisc.Eisc.SetSigTrueAction(ApiMap.Keypad3, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Num3));
|
ApiEisc.Eisc.SetSigTrueAction(ApiMap.Keypad3, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Num3));
|
||||||
ApiEisc.Eisc.SetSigTrueAction(ApiMap.Keypad4, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Num4));
|
ApiEisc.Eisc.SetSigTrueAction(ApiMap.Keypad4, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Num4));
|
||||||
ApiEisc.Eisc.SetSigTrueAction(ApiMap.Keypad5, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Num5));
|
ApiEisc.Eisc.SetSigTrueAction(ApiMap.Keypad5, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Num5));
|
||||||
ApiEisc.Eisc.SetSigTrueAction(ApiMap.Keypad6, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Num6));
|
ApiEisc.Eisc.SetSigTrueAction(ApiMap.Keypad6, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Num6));
|
||||||
ApiEisc.Eisc.SetSigTrueAction(ApiMap.Keypad7, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Num7));
|
ApiEisc.Eisc.SetSigTrueAction(ApiMap.Keypad7, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Num7));
|
||||||
ApiEisc.Eisc.SetSigTrueAction(ApiMap.Keypad8, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Num8));
|
ApiEisc.Eisc.SetSigTrueAction(ApiMap.Keypad8, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Num8));
|
||||||
ApiEisc.Eisc.SetSigTrueAction(ApiMap.Keypad9, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Num9));
|
ApiEisc.Eisc.SetSigTrueAction(ApiMap.Keypad9, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Num9));
|
||||||
ApiEisc.Eisc.SetSigTrueAction(ApiMap.KeypadStar, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Star));
|
ApiEisc.Eisc.SetSigTrueAction(ApiMap.KeypadStar, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Star));
|
||||||
ApiEisc.Eisc.SetSigTrueAction(ApiMap.KeypadPound, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Pound));
|
ApiEisc.Eisc.SetSigTrueAction(ApiMap.KeypadPound, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Pound));
|
||||||
ApiEisc.Eisc.SetSigTrueAction(ApiMap.KeypadClear, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Clear));
|
ApiEisc.Eisc.SetSigTrueAction(ApiMap.KeypadClear, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Clear));
|
||||||
ApiEisc.Eisc.SetSigTrueAction(ApiMap.KeypadBackspace, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Backspace));
|
ApiEisc.Eisc.SetSigTrueAction(ApiMap.KeypadBackspace, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Backspace));
|
||||||
|
|
||||||
ApiEisc.Eisc.SetSigTrueAction(ApiMap.Dial, () => dialer.Value.Dial());
|
ApiEisc.Eisc.SetSigTrueAction(ApiMap.Dial, () => dialer.Value.Dial());
|
||||||
ApiEisc.Eisc.SetSigTrueAction(ApiMap.DoNotDisturbToggle, () => dialer.Value.DoNotDisturbToggle());
|
ApiEisc.Eisc.SetSigTrueAction(ApiMap.DoNotDisturbToggle, () => dialer.Value.DoNotDisturbToggle());
|
||||||
ApiEisc.Eisc.SetSigTrueAction(ApiMap.DoNotDisturbOn, () => dialer.Value.DoNotDisturbOn());
|
ApiEisc.Eisc.SetSigTrueAction(ApiMap.DoNotDisturbOn, () => dialer.Value.DoNotDisturbOn());
|
||||||
ApiEisc.Eisc.SetSigTrueAction(ApiMap.DoNotDisturbOff, () => dialer.Value.DoNotDisturbOff());
|
ApiEisc.Eisc.SetSigTrueAction(ApiMap.DoNotDisturbOff, () => dialer.Value.DoNotDisturbOff());
|
||||||
ApiEisc.Eisc.SetSigTrueAction(ApiMap.AutoAnswerToggle, () => dialer.Value.AutoAnswerToggle());
|
ApiEisc.Eisc.SetSigTrueAction(ApiMap.AutoAnswerToggle, () => dialer.Value.AutoAnswerToggle());
|
||||||
ApiEisc.Eisc.SetSigTrueAction(ApiMap.AutoAnswerOn, () => dialer.Value.AutoAnswerOn());
|
ApiEisc.Eisc.SetSigTrueAction(ApiMap.AutoAnswerOn, () => dialer.Value.AutoAnswerOn());
|
||||||
ApiEisc.Eisc.SetSigTrueAction(ApiMap.AutoAnswerOff, () => dialer.Value.AutoAnswerOff());
|
ApiEisc.Eisc.SetSigTrueAction(ApiMap.AutoAnswerOff, () => dialer.Value.AutoAnswerOff());
|
||||||
|
|
||||||
dialer.Value.DoNotDisturbFeedback.LinkInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.DoNotDisturbToggle]);
|
dialer.Value.DoNotDisturbFeedback.LinkInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.DoNotDisturbToggle]);
|
||||||
dialer.Value.DoNotDisturbFeedback.LinkInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.DoNotDisturbOn]);
|
dialer.Value.DoNotDisturbFeedback.LinkInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.DoNotDisturbOn]);
|
||||||
dialer.Value.DoNotDisturbFeedback.LinkComplementInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.DoNotDisturbOff]);
|
dialer.Value.DoNotDisturbFeedback.LinkComplementInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.DoNotDisturbOff]);
|
||||||
|
|
||||||
dialer.Value.AutoAnswerFeedback.LinkInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.AutoAnswerToggle]);
|
dialer.Value.AutoAnswerFeedback.LinkInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.AutoAnswerToggle]);
|
||||||
dialer.Value.AutoAnswerFeedback.LinkInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.AutoAnswerOn]);
|
dialer.Value.AutoAnswerFeedback.LinkInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.AutoAnswerOn]);
|
||||||
dialer.Value.AutoAnswerFeedback.LinkComplementInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.AutoAnswerOff]);
|
dialer.Value.AutoAnswerFeedback.LinkComplementInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.AutoAnswerOff]);
|
||||||
|
|
||||||
dialer.Value.OffHookFeedback.LinkInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.Dial]);
|
dialer.Value.OffHookFeedback.LinkInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.Dial]);
|
||||||
dialer.Value.DialStringFeedback.LinkInputSig(ApiEisc.Eisc.StringInput[ApiMap.DialString]);
|
dialer.Value.DialStringFeedback.LinkInputSig(ApiEisc.Eisc.StringInput[ApiMap.DialString]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Debug.Console(2, "Name {0} Activated", this.Name);
|
Debug.Console(2, "Name {0} Activated", this.Name);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
Debug.Console(0, "Bridge {0}", e);
|
Debug.Console(0, "Bridge {0}", e);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public class EssentialDspProperties {
|
public class EssentialDspProperties {
|
||||||
public string connectionDeviceKey;
|
public string connectionDeviceKey;
|
||||||
public string[] EiscApiIpids;
|
public string[] EiscApiIpids;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public class EssentialDspApiMap {
|
public class EssentialDspApiMap {
|
||||||
public ushort Online = 1;
|
public ushort Online = 1;
|
||||||
public ushort presetString = 2000;
|
public ushort presetString = 2000;
|
||||||
public Dictionary<uint, ushort> channelMuteToggle;
|
public Dictionary<uint, ushort> channelMuteToggle;
|
||||||
public Dictionary<uint, ushort> channelMuteOn;
|
public Dictionary<uint, ushort> channelMuteOn;
|
||||||
public Dictionary<uint, ushort> channelMuteOff;
|
public Dictionary<uint, ushort> channelMuteOff;
|
||||||
public Dictionary<uint, ushort> channelVolume;
|
public Dictionary<uint, ushort> channelVolume;
|
||||||
public Dictionary<uint, ushort> channelType;
|
public Dictionary<uint, ushort> channelType;
|
||||||
public Dictionary<uint, ushort> channelName;
|
public Dictionary<uint, ushort> channelName;
|
||||||
public Dictionary<uint, ushort> channelVolumeUp;
|
public Dictionary<uint, ushort> channelVolumeUp;
|
||||||
public Dictionary<uint, ushort> channelVolumeDown;
|
public Dictionary<uint, ushort> channelVolumeDown;
|
||||||
public Dictionary<uint, ushort> presets;
|
public Dictionary<uint, ushort> presets;
|
||||||
public ushort DialString = 3100;
|
public ushort DialString = 3100;
|
||||||
public ushort Keypad0 = 3110;
|
public ushort Keypad0 = 3110;
|
||||||
public ushort Keypad1 = 3111;
|
public ushort Keypad1 = 3111;
|
||||||
public ushort Keypad2 = 3112;
|
public ushort Keypad2 = 3112;
|
||||||
public ushort Keypad3 = 3113;
|
public ushort Keypad3 = 3113;
|
||||||
public ushort Keypad4 = 3114;
|
public ushort Keypad4 = 3114;
|
||||||
public ushort Keypad5 = 3115;
|
public ushort Keypad5 = 3115;
|
||||||
public ushort Keypad6 = 3116;
|
public ushort Keypad6 = 3116;
|
||||||
public ushort Keypad7 = 3117;
|
public ushort Keypad7 = 3117;
|
||||||
public ushort Keypad8 = 3118;
|
public ushort Keypad8 = 3118;
|
||||||
public ushort Keypad9 = 3119;
|
public ushort Keypad9 = 3119;
|
||||||
public ushort KeypadStar = 3120;
|
public ushort KeypadStar = 3120;
|
||||||
public ushort KeypadPound = 3121;
|
public ushort KeypadPound = 3121;
|
||||||
public ushort KeypadClear = 3122;
|
public ushort KeypadClear = 3122;
|
||||||
public ushort KeypadBackspace = 3123;
|
public ushort KeypadBackspace = 3123;
|
||||||
public ushort Dial = 3124;
|
public ushort Dial = 3124;
|
||||||
public ushort DoNotDisturbToggle = 3132;
|
public ushort DoNotDisturbToggle = 3132;
|
||||||
public ushort DoNotDisturbOn = 3133;
|
public ushort DoNotDisturbOn = 3133;
|
||||||
public ushort DoNotDisturbOff = 3134;
|
public ushort DoNotDisturbOff = 3134;
|
||||||
public ushort AutoAnswerToggle = 3127;
|
public ushort AutoAnswerToggle = 3127;
|
||||||
public ushort AutoAnswerOn = 3125;
|
public ushort AutoAnswerOn = 3125;
|
||||||
public ushort AutoAnswerOff = 3126;
|
public ushort AutoAnswerOff = 3126;
|
||||||
|
|
||||||
public EssentialDspApiMap() {
|
public EssentialDspApiMap() {
|
||||||
channelMuteToggle = new Dictionary<uint, ushort>();
|
channelMuteToggle = new Dictionary<uint, ushort>();
|
||||||
channelMuteOn = new Dictionary<uint, ushort>();
|
channelMuteOn = new Dictionary<uint, ushort>();
|
||||||
channelMuteOff = new Dictionary<uint, ushort>();
|
channelMuteOff = new Dictionary<uint, ushort>();
|
||||||
channelVolume = new Dictionary<uint, ushort>();
|
channelVolume = new Dictionary<uint, ushort>();
|
||||||
channelName = new Dictionary<uint, ushort>();
|
channelName = new Dictionary<uint, ushort>();
|
||||||
channelType = new Dictionary<uint, ushort>();
|
channelType = new Dictionary<uint, ushort>();
|
||||||
presets = new Dictionary<uint, ushort>();
|
presets = new Dictionary<uint, ushort>();
|
||||||
channelVolumeUp = new Dictionary<uint, ushort>();
|
channelVolumeUp = new Dictionary<uint, ushort>();
|
||||||
channelVolumeDown = new Dictionary<uint, ushort>();
|
channelVolumeDown = new Dictionary<uint, ushort>();
|
||||||
for (uint x = 1; x <= 100; x++) {
|
for (uint x = 1; x <= 100; x++) {
|
||||||
uint tempNum = x;
|
uint tempNum = x;
|
||||||
presets[tempNum] = (ushort)(tempNum + 100);
|
presets[tempNum] = (ushort)(tempNum + 100);
|
||||||
channelMuteToggle[tempNum] = (ushort)(tempNum + 400);
|
channelMuteToggle[tempNum] = (ushort)(tempNum + 400);
|
||||||
channelMuteOn[tempNum] = (ushort)(tempNum + 600);
|
channelMuteOn[tempNum] = (ushort)(tempNum + 600);
|
||||||
channelMuteOff[tempNum] = (ushort)(tempNum + 800);
|
channelMuteOff[tempNum] = (ushort)(tempNum + 800);
|
||||||
channelVolume[tempNum] = (ushort)(tempNum + 200);
|
channelVolume[tempNum] = (ushort)(tempNum + 200);
|
||||||
channelName[tempNum] = (ushort)(tempNum + 200);
|
channelName[tempNum] = (ushort)(tempNum + 200);
|
||||||
channelType[tempNum] = (ushort)(tempNum + 400);
|
channelType[tempNum] = (ushort)(tempNum + 400);
|
||||||
channelVolumeUp[tempNum] = (ushort)(tempNum + 1000);
|
channelVolumeUp[tempNum] = (ushort)(tempNum + 1000);
|
||||||
channelVolumeDown[tempNum] = (ushort)(tempNum + 1200);
|
channelVolumeDown[tempNum] = (ushort)(tempNum + 1200);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1,98 +1,98 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
using PepperDash.Essentials.Core.Config;
|
using PepperDash.Essentials.Core.Config;
|
||||||
using PepperDash.Essentials.DM;
|
using PepperDash.Essentials.DM;
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core.Routing;
|
using PepperDash.Essentials.Core.Routing;
|
||||||
using Crestron.SimplSharpPro;
|
using Crestron.SimplSharpPro;
|
||||||
using Crestron.SimplSharpPro.EthernetCommunication;
|
using Crestron.SimplSharpPro.EthernetCommunication;
|
||||||
using Crestron.SimplSharpPro.DM;
|
using Crestron.SimplSharpPro.DM;
|
||||||
|
|
||||||
namespace PepperDash.Essentials
|
namespace PepperDash.Essentials
|
||||||
{
|
{
|
||||||
public class EssentialsTVOne : PepperDash.Core.Device
|
public class EssentialsTVOne : PepperDash.Core.Device
|
||||||
{
|
{
|
||||||
public EssentialTVOneProperties Properties;
|
public EssentialTVOneProperties Properties;
|
||||||
public List<BridgeApiEisc> BridgeApiEiscs;
|
public List<BridgeApiEisc> BridgeApiEiscs;
|
||||||
private PepperDash.Essentials.Devices.Common.TVOneCorio TVOneCorio;
|
private PepperDash.Essentials.Devices.Common.TVOneCorio TVOneCorio;
|
||||||
private EssentialsTVOneApiMap ApiMap = new EssentialsTVOneApiMap();
|
private EssentialsTVOneApiMap ApiMap = new EssentialsTVOneApiMap();
|
||||||
public EssentialsTVOne(string key, string name, JToken properties)
|
public EssentialsTVOne(string key, string name, JToken properties)
|
||||||
: base(key, name)
|
: base(key, name)
|
||||||
{
|
{
|
||||||
Properties = JsonConvert.DeserializeObject<EssentialTVOneProperties>(properties.ToString());
|
Properties = JsonConvert.DeserializeObject<EssentialTVOneProperties>(properties.ToString());
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
public override bool CustomActivate() {
|
public override bool CustomActivate() {
|
||||||
// Create EiscApis
|
// Create EiscApis
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
foreach (var device in DeviceManager.AllDevices)
|
foreach (var device in DeviceManager.AllDevices)
|
||||||
{
|
{
|
||||||
if (device.Key == this.Properties.connectionDeviceKey)
|
if (device.Key == this.Properties.connectionDeviceKey)
|
||||||
{
|
{
|
||||||
Debug.Console(2, "deviceKey {0} Matches", device.Key);
|
Debug.Console(2, "deviceKey {0} Matches", device.Key);
|
||||||
TVOneCorio = DeviceManager.GetDeviceForKey(device.Key) as PepperDash.Essentials.Devices.Common.TVOneCorio;
|
TVOneCorio = DeviceManager.GetDeviceForKey(device.Key) as PepperDash.Essentials.Devices.Common.TVOneCorio;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Debug.Console(2, "deviceKey {0} doesn't match", device.Key);
|
Debug.Console(2, "deviceKey {0} doesn't match", device.Key);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (Properties.EiscApiIpids != null && TVOneCorio != null)
|
if (Properties.EiscApiIpids != null && TVOneCorio != null)
|
||||||
{
|
{
|
||||||
foreach (string Ipid in Properties.EiscApiIpids)
|
foreach (string Ipid in Properties.EiscApiIpids)
|
||||||
{
|
{
|
||||||
var ApiEisc = new BridgeApiEisc(Ipid);
|
var ApiEisc = new BridgeApiEisc(Ipid);
|
||||||
Debug.Console(2, "Connecting EiscApi {0} to {1}", ApiEisc.Ipid, TVOneCorio.Name);
|
Debug.Console(2, "Connecting EiscApi {0} to {1}", ApiEisc.Ipid, TVOneCorio.Name);
|
||||||
ushort x = 1;
|
ushort x = 1;
|
||||||
TVOneCorio.OnlineFeedback.LinkInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.Online]);
|
TVOneCorio.OnlineFeedback.LinkInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.Online]);
|
||||||
ApiEisc.Eisc.SetUShortSigAction(ApiMap.CallPreset, u => TVOneCorio.CallPreset(u));
|
ApiEisc.Eisc.SetUShortSigAction(ApiMap.CallPreset, u => TVOneCorio.CallPreset(u));
|
||||||
TVOneCorio.PresetFeedback.LinkInputSig(ApiEisc.Eisc.UShortInput[ApiMap.PresetFeedback]);
|
TVOneCorio.PresetFeedback.LinkInputSig(ApiEisc.Eisc.UShortInput[ApiMap.PresetFeedback]);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Debug.Console(2, "Name {0} Activated", this.Name);
|
Debug.Console(2, "Name {0} Activated", this.Name);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
Debug.Console(0, "Bridge {0}", e);
|
Debug.Console(0, "Bridge {0}", e);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public class EssentialTVOneProperties
|
public class EssentialTVOneProperties
|
||||||
{
|
{
|
||||||
public string connectionDeviceKey;
|
public string connectionDeviceKey;
|
||||||
public string[] EiscApiIpids;
|
public string[] EiscApiIpids;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public class EssentialsTVOneApiMap
|
public class EssentialsTVOneApiMap
|
||||||
{
|
{
|
||||||
public ushort CallPreset = 1;
|
public ushort CallPreset = 1;
|
||||||
public ushort PresetFeedback = 1;
|
public ushort PresetFeedback = 1;
|
||||||
public ushort Online = 1;
|
public ushort Online = 1;
|
||||||
|
|
||||||
public EssentialsTVOneApiMap()
|
public EssentialsTVOneApiMap()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,74 +1,74 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
using Crestron.SimplSharpPro.DeviceSupport;
|
using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
using PepperDash.Essentials.Devices.Common;
|
using PepperDash.Essentials.Devices.Common;
|
||||||
|
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Core.Bridges
|
namespace PepperDash.Essentials.Core.Bridges
|
||||||
{
|
{
|
||||||
public static class GenericLightingApiExtensions
|
public static class GenericLightingApiExtensions
|
||||||
{
|
{
|
||||||
public static void LinkToApi(this PepperDash.Essentials.Core.Lighting.LightingBase lightingDevice, BasicTriList trilist, uint joinStart, string joinMapKey)
|
public static void LinkToApi(this PepperDash.Essentials.Core.Lighting.LightingBase lightingDevice, BasicTriList trilist, uint joinStart, string joinMapKey)
|
||||||
{
|
{
|
||||||
GenericLightingJoinMap joinMap = new GenericLightingJoinMap();
|
GenericLightingJoinMap joinMap = new GenericLightingJoinMap();
|
||||||
|
|
||||||
var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
|
var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(joinMapSerialized))
|
if (!string.IsNullOrEmpty(joinMapSerialized))
|
||||||
joinMap = JsonConvert.DeserializeObject<GenericLightingJoinMap>(joinMapSerialized);
|
joinMap = JsonConvert.DeserializeObject<GenericLightingJoinMap>(joinMapSerialized);
|
||||||
|
|
||||||
joinMap.OffsetJoinNumbers(joinStart);
|
joinMap.OffsetJoinNumbers(joinStart);
|
||||||
|
|
||||||
Debug.Console(1, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
Debug.Console(1, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
||||||
|
|
||||||
Debug.Console(0, "Linking to Lighting Type {0}", lightingDevice.GetType().Name.ToString());
|
Debug.Console(0, "Linking to Lighting Type {0}", lightingDevice.GetType().Name.ToString());
|
||||||
|
|
||||||
// GenericLighitng Actions & FeedBack
|
// GenericLighitng Actions & FeedBack
|
||||||
trilist.SetUShortSigAction(joinMap.SelectScene, u => lightingDevice.SelectScene(lightingDevice.LightingScenes[u]));
|
trilist.SetUShortSigAction(joinMap.SelectScene, u => lightingDevice.SelectScene(lightingDevice.LightingScenes[u]));
|
||||||
|
|
||||||
int sceneIndex = 1;
|
int sceneIndex = 1;
|
||||||
foreach (var scene in lightingDevice.LightingScenes)
|
foreach (var scene in lightingDevice.LightingScenes)
|
||||||
{
|
{
|
||||||
var tempIndex = sceneIndex - 1;
|
var tempIndex = sceneIndex - 1;
|
||||||
trilist.SetSigTrueAction((uint)(joinMap.LightingSceneOffset + sceneIndex), () => lightingDevice.SelectScene(lightingDevice.LightingScenes[tempIndex]));
|
trilist.SetSigTrueAction((uint)(joinMap.LightingSceneOffset + sceneIndex), () => lightingDevice.SelectScene(lightingDevice.LightingScenes[tempIndex]));
|
||||||
scene.IsActiveFeedback.LinkInputSig(trilist.BooleanInput[(uint)(joinMap.LightingSceneOffset + sceneIndex)]);
|
scene.IsActiveFeedback.LinkInputSig(trilist.BooleanInput[(uint)(joinMap.LightingSceneOffset + sceneIndex)]);
|
||||||
trilist.StringInput[(uint)(joinMap.LightingSceneOffset + sceneIndex)].StringValue = scene.Name;
|
trilist.StringInput[(uint)(joinMap.LightingSceneOffset + sceneIndex)].StringValue = scene.Name;
|
||||||
trilist.BooleanInput[(uint)(joinMap.ButtonVisibilityOffset + sceneIndex)].BoolValue = true;
|
trilist.BooleanInput[(uint)(joinMap.ButtonVisibilityOffset + sceneIndex)].BoolValue = true;
|
||||||
sceneIndex++;
|
sceneIndex++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lightingDevice.GetType().Name.ToString() == "LutronQuantumArea")
|
if (lightingDevice.GetType().Name.ToString() == "LutronQuantumArea")
|
||||||
{
|
{
|
||||||
var lutronDevice = lightingDevice as PepperDash.Essentials.Devices.Common.Environment.Lutron.LutronQuantumArea;
|
var lutronDevice = lightingDevice as PepperDash.Essentials.Devices.Common.Environment.Lutron.LutronQuantumArea;
|
||||||
lutronDevice.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
|
lutronDevice.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
|
||||||
trilist.SetStringSigAction(joinMap.IntegrationIdSet, s => lutronDevice.IntegrationId = s);
|
trilist.SetStringSigAction(joinMap.IntegrationIdSet, s => lutronDevice.IntegrationId = s);
|
||||||
}
|
}
|
||||||
|
|
||||||
//ApiEisc.Eisc.SetStringSigAction(ApiMap.integrationID, (s) => { lutronLights.IntegrationId = s; });
|
//ApiEisc.Eisc.SetStringSigAction(ApiMap.integrationID, (s) => { lutronLights.IntegrationId = s; });
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
var lutronLights = lightingDevice as PepperDash.Essentials.Devices.Common.Environment.Lutron.LutronQuantumArea;
|
var lutronLights = lightingDevice as PepperDash.Essentials.Devices.Common.Environment.Lutron.LutronQuantumArea;
|
||||||
|
|
||||||
|
|
||||||
for (uint i = 1; i <= lightingBase.CircuitCount; i++)
|
for (uint i = 1; i <= lightingBase.CircuitCount; i++)
|
||||||
{
|
{
|
||||||
var circuit = i;
|
var circuit = i;
|
||||||
lightingBase.CircuitNameFeedbacks[circuit - 1].LinkInputSig(trilist.StringInput[joinMap.CircuitNames + circuit]);
|
lightingBase.CircuitNameFeedbacks[circuit - 1].LinkInputSig(trilist.StringInput[joinMap.CircuitNames + circuit]);
|
||||||
lightingBase.CircuitIsCritical[circuit - 1].LinkInputSig(trilist.BooleanInput[joinMap.CircuitIsCritical + circuit]);
|
lightingBase.CircuitIsCritical[circuit - 1].LinkInputSig(trilist.BooleanInput[joinMap.CircuitIsCritical + circuit]);
|
||||||
lightingBase.CircuitState[circuit - 1].LinkInputSig(trilist.BooleanInput[joinMap.CircuitState + circuit]);
|
lightingBase.CircuitState[circuit - 1].LinkInputSig(trilist.BooleanInput[joinMap.CircuitState + circuit]);
|
||||||
trilist.SetSigTrueAction(joinMap.CircuitCycle + circuit, () => lightingBase.CycleCircuit(circuit - 1));
|
trilist.SetSigTrueAction(joinMap.CircuitCycle + circuit, () => lightingBase.CycleCircuit(circuit - 1));
|
||||||
trilist.SetSigTrueAction(joinMap.CircuitOnCmd + circuit, () => lightingBase.TurnOnCircuit(circuit - 1));
|
trilist.SetSigTrueAction(joinMap.CircuitOnCmd + circuit, () => lightingBase.TurnOnCircuit(circuit - 1));
|
||||||
trilist.SetSigTrueAction(joinMap.CircuitOffCmd + circuit, () => lightingBase.TurnOffCircuit(circuit - 1));
|
trilist.SetSigTrueAction(joinMap.CircuitOffCmd + circuit, () => lightingBase.TurnOffCircuit(circuit - 1));
|
||||||
|
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,125 +1,125 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
using Crestron.SimplSharpPro.DeviceSupport;
|
using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
|
|
||||||
using PepperDash.Essentials.Devices.Common.Occupancy;
|
using PepperDash.Essentials.Devices.Common.Occupancy;
|
||||||
|
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
|
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Core.Bridges
|
namespace PepperDash.Essentials.Core.Bridges
|
||||||
{
|
{
|
||||||
public static class GlsOccupancySensorBaseControllerApiExtensions
|
public static class GlsOccupancySensorBaseControllerApiExtensions
|
||||||
{
|
{
|
||||||
public static void LinkToApi(this GlsOccupancySensorBaseController occController, BasicTriList trilist, uint joinStart, string joinMapKey)
|
public static void LinkToApi(this GlsOccupancySensorBaseController occController, BasicTriList trilist, uint joinStart, string joinMapKey)
|
||||||
{
|
{
|
||||||
GlsOccupancySensorBaseJoinMap joinMap = new GlsOccupancySensorBaseJoinMap();
|
GlsOccupancySensorBaseJoinMap joinMap = new GlsOccupancySensorBaseJoinMap();
|
||||||
|
|
||||||
var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
|
var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(joinMapSerialized))
|
if (!string.IsNullOrEmpty(joinMapSerialized))
|
||||||
joinMap = JsonConvert.DeserializeObject<GlsOccupancySensorBaseJoinMap>(joinMapSerialized);
|
joinMap = JsonConvert.DeserializeObject<GlsOccupancySensorBaseJoinMap>(joinMapSerialized);
|
||||||
|
|
||||||
joinMap.OffsetJoinNumbers(joinStart);
|
joinMap.OffsetJoinNumbers(joinStart);
|
||||||
|
|
||||||
Debug.Console(1, occController, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
Debug.Console(1, occController, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
||||||
|
|
||||||
#region Single and Dual Sensor Stuff
|
#region Single and Dual Sensor Stuff
|
||||||
occController.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
|
occController.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
|
||||||
trilist.StringInput[joinMap.Name].StringValue = occController.Name;
|
trilist.StringInput[joinMap.Name].StringValue = occController.Name;
|
||||||
|
|
||||||
trilist.OnlineStatusChange += new Crestron.SimplSharpPro.OnlineStatusChangeEventHandler((d, args) =>
|
trilist.OnlineStatusChange += new Crestron.SimplSharpPro.OnlineStatusChangeEventHandler((d, args) =>
|
||||||
{
|
{
|
||||||
if (args.DeviceOnLine)
|
if (args.DeviceOnLine)
|
||||||
{
|
{
|
||||||
trilist.StringInput[joinMap.Name].StringValue = occController.Name;
|
trilist.StringInput[joinMap.Name].StringValue = occController.Name;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
// Occupied status
|
// Occupied status
|
||||||
trilist.SetSigTrueAction(joinMap.ForceOccupied, new Action(() => occController.ForceOccupied()));
|
trilist.SetSigTrueAction(joinMap.ForceOccupied, new Action(() => occController.ForceOccupied()));
|
||||||
trilist.SetSigTrueAction(joinMap.ForceVacant, new Action(() => occController.ForceVacant()));
|
trilist.SetSigTrueAction(joinMap.ForceVacant, new Action(() => occController.ForceVacant()));
|
||||||
occController.RoomIsOccupiedFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RoomOccupiedFeedback]);
|
occController.RoomIsOccupiedFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RoomOccupiedFeedback]);
|
||||||
occController.RoomIsOccupiedFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.RoomVacantFeedback]);
|
occController.RoomIsOccupiedFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.RoomVacantFeedback]);
|
||||||
occController.RawOccupancyFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RawOccupancyFeedback]);
|
occController.RawOccupancyFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RawOccupancyFeedback]);
|
||||||
trilist.SetBoolSigAction(joinMap.EnableRawStates, new Action<bool>((b) => occController.EnableRawStates(b)));
|
trilist.SetBoolSigAction(joinMap.EnableRawStates, new Action<bool>((b) => occController.EnableRawStates(b)));
|
||||||
|
|
||||||
// Timouts
|
// Timouts
|
||||||
trilist.SetUShortSigAction(joinMap.Timeout, new Action<ushort>((u) => occController.SetRemoteTimeout(u)));
|
trilist.SetUShortSigAction(joinMap.Timeout, new Action<ushort>((u) => occController.SetRemoteTimeout(u)));
|
||||||
occController.CurrentTimeoutFeedback.LinkInputSig(trilist.UShortInput[joinMap.Timeout]);
|
occController.CurrentTimeoutFeedback.LinkInputSig(trilist.UShortInput[joinMap.Timeout]);
|
||||||
occController.LocalTimoutFeedback.LinkInputSig(trilist.UShortInput[joinMap.TimeoutLocalFeedback]);
|
occController.LocalTimoutFeedback.LinkInputSig(trilist.UShortInput[joinMap.TimeoutLocalFeedback]);
|
||||||
|
|
||||||
// LED Flash
|
// LED Flash
|
||||||
trilist.SetSigTrueAction(joinMap.EnableLedFlash, new Action(() => occController.SetLedFlashEnable(true)));
|
trilist.SetSigTrueAction(joinMap.EnableLedFlash, new Action(() => occController.SetLedFlashEnable(true)));
|
||||||
trilist.SetSigTrueAction(joinMap.DisableLedFlash, new Action(() => occController.SetLedFlashEnable(false)));
|
trilist.SetSigTrueAction(joinMap.DisableLedFlash, new Action(() => occController.SetLedFlashEnable(false)));
|
||||||
occController.LedFlashEnabledFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.EnableLedFlash]);
|
occController.LedFlashEnabledFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.EnableLedFlash]);
|
||||||
|
|
||||||
// Short Timeout
|
// Short Timeout
|
||||||
trilist.SetSigTrueAction(joinMap.EnableShortTimeout, new Action(() => occController.SetShortTimeoutState(true)));
|
trilist.SetSigTrueAction(joinMap.EnableShortTimeout, new Action(() => occController.SetShortTimeoutState(true)));
|
||||||
trilist.SetSigTrueAction(joinMap.DisableShortTimeout, new Action(() => occController.SetShortTimeoutState(false)));
|
trilist.SetSigTrueAction(joinMap.DisableShortTimeout, new Action(() => occController.SetShortTimeoutState(false)));
|
||||||
occController.ShortTimeoutEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.EnableShortTimeout]);
|
occController.ShortTimeoutEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.EnableShortTimeout]);
|
||||||
|
|
||||||
// PIR Sensor
|
// PIR Sensor
|
||||||
trilist.SetSigTrueAction(joinMap.EnablePir, new Action(() => occController.SetPirEnable(true)));
|
trilist.SetSigTrueAction(joinMap.EnablePir, new Action(() => occController.SetPirEnable(true)));
|
||||||
trilist.SetSigTrueAction(joinMap.DisablePir, new Action(() => occController.SetPirEnable(false)));
|
trilist.SetSigTrueAction(joinMap.DisablePir, new Action(() => occController.SetPirEnable(false)));
|
||||||
occController.PirSensorEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.EnablePir]);
|
occController.PirSensorEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.EnablePir]);
|
||||||
|
|
||||||
// PIR Sensitivity in Occupied State
|
// PIR Sensitivity in Occupied State
|
||||||
trilist.SetBoolSigAction(joinMap.IncrementPirInOccupiedState, new Action<bool>((b) => occController.IncrementPirSensitivityInOccupiedState(b)));
|
trilist.SetBoolSigAction(joinMap.IncrementPirInOccupiedState, new Action<bool>((b) => occController.IncrementPirSensitivityInOccupiedState(b)));
|
||||||
trilist.SetBoolSigAction(joinMap.DecrementPirInOccupiedState, new Action<bool>((b) => occController.DecrementPirSensitivityInOccupiedState(b)));
|
trilist.SetBoolSigAction(joinMap.DecrementPirInOccupiedState, new Action<bool>((b) => occController.DecrementPirSensitivityInOccupiedState(b)));
|
||||||
occController.PirSensitivityInOccupiedStateFeedback.LinkInputSig(trilist.UShortInput[joinMap.PirSensitivityInOccupiedState]);
|
occController.PirSensitivityInOccupiedStateFeedback.LinkInputSig(trilist.UShortInput[joinMap.PirSensitivityInOccupiedState]);
|
||||||
|
|
||||||
// PIR Sensitivity in Vacant State
|
// PIR Sensitivity in Vacant State
|
||||||
trilist.SetBoolSigAction(joinMap.IncrementPirInVacantState, new Action<bool>((b) => occController.IncrementPirSensitivityInVacantState(b)));
|
trilist.SetBoolSigAction(joinMap.IncrementPirInVacantState, new Action<bool>((b) => occController.IncrementPirSensitivityInVacantState(b)));
|
||||||
trilist.SetBoolSigAction(joinMap.DecrementPirInVacantState, new Action<bool>((b) => occController.DecrementPirSensitivityInVacantState(b)));
|
trilist.SetBoolSigAction(joinMap.DecrementPirInVacantState, new Action<bool>((b) => occController.DecrementPirSensitivityInVacantState(b)));
|
||||||
occController.PirSensitivityInVacantStateFeedback.LinkInputSig(trilist.UShortInput[joinMap.PirSensitivityInVacantState]);
|
occController.PirSensitivityInVacantStateFeedback.LinkInputSig(trilist.UShortInput[joinMap.PirSensitivityInVacantState]);
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Dual Technology Sensor Stuff
|
#region Dual Technology Sensor Stuff
|
||||||
var odtOccController = occController as GlsOdtOccupancySensorController;
|
var odtOccController = occController as GlsOdtOccupancySensorController;
|
||||||
|
|
||||||
if (odtOccController != null)
|
if (odtOccController != null)
|
||||||
{
|
{
|
||||||
// OR When Vacated
|
// OR When Vacated
|
||||||
trilist.SetBoolSigAction(joinMap.OrWhenVacated, new Action<bool>((b) => odtOccController.SetOrWhenVacatedState(b)));
|
trilist.SetBoolSigAction(joinMap.OrWhenVacated, new Action<bool>((b) => odtOccController.SetOrWhenVacatedState(b)));
|
||||||
odtOccController.OrWhenVacatedFeedback.LinkInputSig(trilist.BooleanInput[joinMap.OrWhenVacated]);
|
odtOccController.OrWhenVacatedFeedback.LinkInputSig(trilist.BooleanInput[joinMap.OrWhenVacated]);
|
||||||
|
|
||||||
// AND When Vacated
|
// AND When Vacated
|
||||||
trilist.SetBoolSigAction(joinMap.AndWhenVacated, new Action<bool>((b) => odtOccController.SetAndWhenVacatedState(b)));
|
trilist.SetBoolSigAction(joinMap.AndWhenVacated, new Action<bool>((b) => odtOccController.SetAndWhenVacatedState(b)));
|
||||||
odtOccController.AndWhenVacatedFeedback.LinkInputSig(trilist.BooleanInput[joinMap.AndWhenVacated]);
|
odtOccController.AndWhenVacatedFeedback.LinkInputSig(trilist.BooleanInput[joinMap.AndWhenVacated]);
|
||||||
|
|
||||||
// Ultrasonic A Sensor
|
// Ultrasonic A Sensor
|
||||||
trilist.SetSigTrueAction(joinMap.EnableUsA, new Action(() => odtOccController.SetUsAEnable(true)));
|
trilist.SetSigTrueAction(joinMap.EnableUsA, new Action(() => odtOccController.SetUsAEnable(true)));
|
||||||
trilist.SetSigTrueAction(joinMap.DisableUsA, new Action(() => odtOccController.SetUsAEnable(false)));
|
trilist.SetSigTrueAction(joinMap.DisableUsA, new Action(() => odtOccController.SetUsAEnable(false)));
|
||||||
odtOccController.UltrasonicAEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.EnableUsA]);
|
odtOccController.UltrasonicAEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.EnableUsA]);
|
||||||
|
|
||||||
// Ultrasonic B Sensor
|
// Ultrasonic B Sensor
|
||||||
trilist.SetSigTrueAction(joinMap.EnableUsB, new Action(() => odtOccController.SetUsBEnable(true)));
|
trilist.SetSigTrueAction(joinMap.EnableUsB, new Action(() => odtOccController.SetUsBEnable(true)));
|
||||||
trilist.SetSigTrueAction(joinMap.DisableUsB, new Action(() => odtOccController.SetUsBEnable(false)));
|
trilist.SetSigTrueAction(joinMap.DisableUsB, new Action(() => odtOccController.SetUsBEnable(false)));
|
||||||
odtOccController.UltrasonicAEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.EnableUsB]);
|
odtOccController.UltrasonicAEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.EnableUsB]);
|
||||||
|
|
||||||
// US Sensitivity in Occupied State
|
// US Sensitivity in Occupied State
|
||||||
trilist.SetBoolSigAction(joinMap.IncrementUsInOccupiedState, new Action<bool>((b) => odtOccController.IncrementUsSensitivityInOccupiedState(b)));
|
trilist.SetBoolSigAction(joinMap.IncrementUsInOccupiedState, new Action<bool>((b) => odtOccController.IncrementUsSensitivityInOccupiedState(b)));
|
||||||
trilist.SetBoolSigAction(joinMap.DecrementUsInOccupiedState, new Action<bool>((b) => odtOccController.DecrementUsSensitivityInOccupiedState(b)));
|
trilist.SetBoolSigAction(joinMap.DecrementUsInOccupiedState, new Action<bool>((b) => odtOccController.DecrementUsSensitivityInOccupiedState(b)));
|
||||||
odtOccController.UltrasonicSensitivityInOccupiedStateFeedback.LinkInputSig(trilist.UShortInput[joinMap.UsSensitivityInOccupiedState]);
|
odtOccController.UltrasonicSensitivityInOccupiedStateFeedback.LinkInputSig(trilist.UShortInput[joinMap.UsSensitivityInOccupiedState]);
|
||||||
|
|
||||||
// US Sensitivity in Vacant State
|
// US Sensitivity in Vacant State
|
||||||
trilist.SetBoolSigAction(joinMap.IncrementUsInVacantState, new Action<bool>((b) => odtOccController.IncrementUsSensitivityInVacantState(b)));
|
trilist.SetBoolSigAction(joinMap.IncrementUsInVacantState, new Action<bool>((b) => odtOccController.IncrementUsSensitivityInVacantState(b)));
|
||||||
trilist.SetBoolSigAction(joinMap.DecrementUsInVacantState, new Action<bool>((b) => odtOccController.DecrementUsSensitivityInVacantState(b)));
|
trilist.SetBoolSigAction(joinMap.DecrementUsInVacantState, new Action<bool>((b) => odtOccController.DecrementUsSensitivityInVacantState(b)));
|
||||||
odtOccController.UltrasonicSensitivityInVacantStateFeedback.LinkInputSig(trilist.UShortInput[joinMap.UsSensitivityInVacantState]);
|
odtOccController.UltrasonicSensitivityInVacantStateFeedback.LinkInputSig(trilist.UShortInput[joinMap.UsSensitivityInVacantState]);
|
||||||
|
|
||||||
//Sensor Raw States
|
//Sensor Raw States
|
||||||
odtOccController.RawOccupancyPirFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RawOccupancyPirFeedback]);
|
odtOccController.RawOccupancyPirFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RawOccupancyPirFeedback]);
|
||||||
odtOccController.RawOccupancyUsFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RawOccupancyUsFeedback]);
|
odtOccController.RawOccupancyUsFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RawOccupancyUsFeedback]);
|
||||||
|
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,128 +1,128 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
using Crestron.SimplSharpPro.DeviceSupport;
|
using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
using PepperDash.Essentials.Devices.Common;
|
using PepperDash.Essentials.Devices.Common;
|
||||||
|
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Core.Bridges
|
namespace PepperDash.Essentials.Core.Bridges
|
||||||
{
|
{
|
||||||
public static class IRSetTopBoxBaseApiExtensions
|
public static class IRSetTopBoxBaseApiExtensions
|
||||||
{
|
{
|
||||||
public static void LinkToApi(this PepperDash.Essentials.Devices.Common.IRSetTopBoxBase stbDevice, BasicTriList trilist, uint joinStart, string joinMapKey)
|
public static void LinkToApi(this PepperDash.Essentials.Devices.Common.IRSetTopBoxBase stbDevice, BasicTriList trilist, uint joinStart, string joinMapKey)
|
||||||
{
|
{
|
||||||
SetTopBoxControllerJoinMap joinMap = new SetTopBoxControllerJoinMap();
|
SetTopBoxControllerJoinMap joinMap = new SetTopBoxControllerJoinMap();
|
||||||
var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
|
var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(joinMapSerialized))
|
if (!string.IsNullOrEmpty(joinMapSerialized))
|
||||||
joinMap = JsonConvert.DeserializeObject<SetTopBoxControllerJoinMap>(joinMapSerialized);
|
joinMap = JsonConvert.DeserializeObject<SetTopBoxControllerJoinMap>(joinMapSerialized);
|
||||||
|
|
||||||
joinMap.OffsetJoinNumbers(joinStart);
|
joinMap.OffsetJoinNumbers(joinStart);
|
||||||
|
|
||||||
Debug.Console(1, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
Debug.Console(1, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
||||||
Debug.Console(0, "Linking to Display: {0}", stbDevice.Name);
|
Debug.Console(0, "Linking to Display: {0}", stbDevice.Name);
|
||||||
|
|
||||||
trilist.StringInput[joinMap.Name].StringValue = stbDevice.Name;
|
trilist.StringInput[joinMap.Name].StringValue = stbDevice.Name;
|
||||||
|
|
||||||
var stbBase = stbDevice as ISetTopBoxControls;
|
var stbBase = stbDevice as ISetTopBoxControls;
|
||||||
if (stbBase != null)
|
if (stbBase != null)
|
||||||
{
|
{
|
||||||
trilist.BooleanInput[joinMap.HasDpad].BoolValue = stbBase.HasDpad;
|
trilist.BooleanInput[joinMap.HasDpad].BoolValue = stbBase.HasDpad;
|
||||||
trilist.BooleanInput[joinMap.HasNumeric].BoolValue = stbBase.HasNumeric;
|
trilist.BooleanInput[joinMap.HasNumeric].BoolValue = stbBase.HasNumeric;
|
||||||
trilist.BooleanInput[joinMap.HasDvr].BoolValue = stbBase.HasDvr;
|
trilist.BooleanInput[joinMap.HasDvr].BoolValue = stbBase.HasDvr;
|
||||||
trilist.BooleanInput[joinMap.HasPresets].BoolValue = stbBase.HasPresets;
|
trilist.BooleanInput[joinMap.HasPresets].BoolValue = stbBase.HasPresets;
|
||||||
|
|
||||||
trilist.SetBoolSigAction(joinMap.DvrList, (b) => stbBase.DvrList(b));
|
trilist.SetBoolSigAction(joinMap.DvrList, (b) => stbBase.DvrList(b));
|
||||||
trilist.SetBoolSigAction(joinMap.Replay, (b) => stbBase.Replay(b));
|
trilist.SetBoolSigAction(joinMap.Replay, (b) => stbBase.Replay(b));
|
||||||
|
|
||||||
trilist.SetStringSigAction(joinMap.LoadPresets, (s) => stbBase.LoadPresets(s));
|
trilist.SetStringSigAction(joinMap.LoadPresets, (s) => stbBase.LoadPresets(s));
|
||||||
}
|
}
|
||||||
|
|
||||||
var stbPower = stbDevice as IPower;
|
var stbPower = stbDevice as IPower;
|
||||||
if (stbPower != null)
|
if (stbPower != null)
|
||||||
{
|
{
|
||||||
trilist.SetSigTrueAction(joinMap.PowerOn, () => stbPower.PowerOn());
|
trilist.SetSigTrueAction(joinMap.PowerOn, () => stbPower.PowerOn());
|
||||||
trilist.SetSigTrueAction(joinMap.PowerOff, () => stbPower.PowerOff());
|
trilist.SetSigTrueAction(joinMap.PowerOff, () => stbPower.PowerOff());
|
||||||
trilist.SetSigTrueAction(joinMap.PowerToggle, () => stbPower.PowerToggle());
|
trilist.SetSigTrueAction(joinMap.PowerToggle, () => stbPower.PowerToggle());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var stbDPad = stbDevice as IDPad;
|
var stbDPad = stbDevice as IDPad;
|
||||||
if (stbDPad != null)
|
if (stbDPad != null)
|
||||||
{
|
{
|
||||||
trilist.SetBoolSigAction(joinMap.Up, (b) => stbDPad.Up(b));
|
trilist.SetBoolSigAction(joinMap.Up, (b) => stbDPad.Up(b));
|
||||||
trilist.SetBoolSigAction(joinMap.Down, (b) => stbDPad.Down(b));
|
trilist.SetBoolSigAction(joinMap.Down, (b) => stbDPad.Down(b));
|
||||||
trilist.SetBoolSigAction(joinMap.Left, (b) => stbDPad.Left(b));
|
trilist.SetBoolSigAction(joinMap.Left, (b) => stbDPad.Left(b));
|
||||||
trilist.SetBoolSigAction(joinMap.Right, (b) => stbDPad.Right(b));
|
trilist.SetBoolSigAction(joinMap.Right, (b) => stbDPad.Right(b));
|
||||||
trilist.SetBoolSigAction(joinMap.Select, (b) => stbDPad.Select(b));
|
trilist.SetBoolSigAction(joinMap.Select, (b) => stbDPad.Select(b));
|
||||||
trilist.SetBoolSigAction(joinMap.Menu, (b) => stbDPad.Menu(b));
|
trilist.SetBoolSigAction(joinMap.Menu, (b) => stbDPad.Menu(b));
|
||||||
trilist.SetBoolSigAction(joinMap.Exit, (b) => stbDPad.Exit(b));
|
trilist.SetBoolSigAction(joinMap.Exit, (b) => stbDPad.Exit(b));
|
||||||
}
|
}
|
||||||
|
|
||||||
var stbChannel = stbDevice as IChannel;
|
var stbChannel = stbDevice as IChannel;
|
||||||
if (stbChannel != null)
|
if (stbChannel != null)
|
||||||
{
|
{
|
||||||
trilist.SetBoolSigAction(joinMap.ChannelUp, (b) => stbChannel.ChannelUp(b));
|
trilist.SetBoolSigAction(joinMap.ChannelUp, (b) => stbChannel.ChannelUp(b));
|
||||||
trilist.SetBoolSigAction(joinMap.ChannelDown, (b) => stbChannel.ChannelDown(b));
|
trilist.SetBoolSigAction(joinMap.ChannelDown, (b) => stbChannel.ChannelDown(b));
|
||||||
trilist.SetBoolSigAction(joinMap.LastChannel, (b) => stbChannel.LastChannel(b));
|
trilist.SetBoolSigAction(joinMap.LastChannel, (b) => stbChannel.LastChannel(b));
|
||||||
trilist.SetBoolSigAction(joinMap.Guide, (b) => stbChannel.Guide(b));
|
trilist.SetBoolSigAction(joinMap.Guide, (b) => stbChannel.Guide(b));
|
||||||
trilist.SetBoolSigAction(joinMap.Info, (b) => stbChannel.Info(b));
|
trilist.SetBoolSigAction(joinMap.Info, (b) => stbChannel.Info(b));
|
||||||
trilist.SetBoolSigAction(joinMap.Exit, (b) => stbChannel.Exit(b));
|
trilist.SetBoolSigAction(joinMap.Exit, (b) => stbChannel.Exit(b));
|
||||||
}
|
}
|
||||||
|
|
||||||
var stbColor = stbDevice as IColor;
|
var stbColor = stbDevice as IColor;
|
||||||
if (stbColor != null)
|
if (stbColor != null)
|
||||||
{
|
{
|
||||||
trilist.SetBoolSigAction(joinMap.Red, (b) => stbColor.Red(b));
|
trilist.SetBoolSigAction(joinMap.Red, (b) => stbColor.Red(b));
|
||||||
trilist.SetBoolSigAction(joinMap.Green, (b) => stbColor.Green(b));
|
trilist.SetBoolSigAction(joinMap.Green, (b) => stbColor.Green(b));
|
||||||
trilist.SetBoolSigAction(joinMap.Yellow, (b) => stbColor.Yellow(b));
|
trilist.SetBoolSigAction(joinMap.Yellow, (b) => stbColor.Yellow(b));
|
||||||
trilist.SetBoolSigAction(joinMap.Blue, (b) => stbColor.Blue(b));
|
trilist.SetBoolSigAction(joinMap.Blue, (b) => stbColor.Blue(b));
|
||||||
}
|
}
|
||||||
|
|
||||||
var stbKeypad = stbDevice as ISetTopBoxNumericKeypad;
|
var stbKeypad = stbDevice as ISetTopBoxNumericKeypad;
|
||||||
if (stbKeypad != null)
|
if (stbKeypad != null)
|
||||||
{
|
{
|
||||||
trilist.StringInput[joinMap.KeypadAccessoryButton1Label].StringValue = stbKeypad.KeypadAccessoryButton1Label;
|
trilist.StringInput[joinMap.KeypadAccessoryButton1Label].StringValue = stbKeypad.KeypadAccessoryButton1Label;
|
||||||
trilist.StringInput[joinMap.KeypadAccessoryButton2Label].StringValue = stbKeypad.KeypadAccessoryButton2Label;
|
trilist.StringInput[joinMap.KeypadAccessoryButton2Label].StringValue = stbKeypad.KeypadAccessoryButton2Label;
|
||||||
|
|
||||||
trilist.BooleanInput[joinMap.HasKeypadAccessoryButton1].BoolValue = stbKeypad.HasKeypadAccessoryButton1;
|
trilist.BooleanInput[joinMap.HasKeypadAccessoryButton1].BoolValue = stbKeypad.HasKeypadAccessoryButton1;
|
||||||
trilist.BooleanInput[joinMap.HasKeypadAccessoryButton2].BoolValue = stbKeypad.HasKeypadAccessoryButton2;
|
trilist.BooleanInput[joinMap.HasKeypadAccessoryButton2].BoolValue = stbKeypad.HasKeypadAccessoryButton2;
|
||||||
|
|
||||||
trilist.SetBoolSigAction(joinMap.Digit0, (b) => stbKeypad.Digit0(b));
|
trilist.SetBoolSigAction(joinMap.Digit0, (b) => stbKeypad.Digit0(b));
|
||||||
trilist.SetBoolSigAction(joinMap.Digit1, (b) => stbKeypad.Digit1(b));
|
trilist.SetBoolSigAction(joinMap.Digit1, (b) => stbKeypad.Digit1(b));
|
||||||
trilist.SetBoolSigAction(joinMap.Digit2, (b) => stbKeypad.Digit2(b));
|
trilist.SetBoolSigAction(joinMap.Digit2, (b) => stbKeypad.Digit2(b));
|
||||||
trilist.SetBoolSigAction(joinMap.Digit3, (b) => stbKeypad.Digit3(b));
|
trilist.SetBoolSigAction(joinMap.Digit3, (b) => stbKeypad.Digit3(b));
|
||||||
trilist.SetBoolSigAction(joinMap.Digit4, (b) => stbKeypad.Digit4(b));
|
trilist.SetBoolSigAction(joinMap.Digit4, (b) => stbKeypad.Digit4(b));
|
||||||
trilist.SetBoolSigAction(joinMap.Digit5, (b) => stbKeypad.Digit5(b));
|
trilist.SetBoolSigAction(joinMap.Digit5, (b) => stbKeypad.Digit5(b));
|
||||||
trilist.SetBoolSigAction(joinMap.Digit6, (b) => stbKeypad.Digit6(b));
|
trilist.SetBoolSigAction(joinMap.Digit6, (b) => stbKeypad.Digit6(b));
|
||||||
trilist.SetBoolSigAction(joinMap.Digit7, (b) => stbKeypad.Digit7(b));
|
trilist.SetBoolSigAction(joinMap.Digit7, (b) => stbKeypad.Digit7(b));
|
||||||
trilist.SetBoolSigAction(joinMap.Digit8, (b) => stbKeypad.Digit8(b));
|
trilist.SetBoolSigAction(joinMap.Digit8, (b) => stbKeypad.Digit8(b));
|
||||||
trilist.SetBoolSigAction(joinMap.Digit9, (b) => stbKeypad.Digit9(b));
|
trilist.SetBoolSigAction(joinMap.Digit9, (b) => stbKeypad.Digit9(b));
|
||||||
trilist.SetBoolSigAction(joinMap.KeypadAccessoryButton1Press, (b) => stbKeypad.KeypadAccessoryButton1(b));
|
trilist.SetBoolSigAction(joinMap.KeypadAccessoryButton1Press, (b) => stbKeypad.KeypadAccessoryButton1(b));
|
||||||
trilist.SetBoolSigAction(joinMap.KeypadAccessoryButton2Press, (b) => stbKeypad.KeypadAccessoryButton1(b));
|
trilist.SetBoolSigAction(joinMap.KeypadAccessoryButton2Press, (b) => stbKeypad.KeypadAccessoryButton1(b));
|
||||||
trilist.SetBoolSigAction(joinMap.Dash, (b) => stbKeypad.Dash(b));
|
trilist.SetBoolSigAction(joinMap.Dash, (b) => stbKeypad.Dash(b));
|
||||||
trilist.SetBoolSigAction(joinMap.KeypadEnter, (b) => stbKeypad.KeypadEnter(b));
|
trilist.SetBoolSigAction(joinMap.KeypadEnter, (b) => stbKeypad.KeypadEnter(b));
|
||||||
}
|
}
|
||||||
|
|
||||||
var stbTransport = stbDevice as ITransport;
|
var stbTransport = stbDevice as ITransport;
|
||||||
if (stbTransport != null)
|
if (stbTransport != null)
|
||||||
{
|
{
|
||||||
trilist.SetBoolSigAction(joinMap.Play, (b) => stbTransport.Play(b));
|
trilist.SetBoolSigAction(joinMap.Play, (b) => stbTransport.Play(b));
|
||||||
trilist.SetBoolSigAction(joinMap.Pause, (b) => stbTransport.Pause(b));
|
trilist.SetBoolSigAction(joinMap.Pause, (b) => stbTransport.Pause(b));
|
||||||
trilist.SetBoolSigAction(joinMap.Rewind, (b) => stbTransport.Rewind(b));
|
trilist.SetBoolSigAction(joinMap.Rewind, (b) => stbTransport.Rewind(b));
|
||||||
trilist.SetBoolSigAction(joinMap.FFwd, (b) => stbTransport.FFwd(b));
|
trilist.SetBoolSigAction(joinMap.FFwd, (b) => stbTransport.FFwd(b));
|
||||||
trilist.SetBoolSigAction(joinMap.ChapMinus, (b) => stbTransport.ChapMinus(b));
|
trilist.SetBoolSigAction(joinMap.ChapMinus, (b) => stbTransport.ChapMinus(b));
|
||||||
trilist.SetBoolSigAction(joinMap.ChapPlus, (b) => stbTransport.ChapPlus(b));
|
trilist.SetBoolSigAction(joinMap.ChapPlus, (b) => stbTransport.ChapPlus(b));
|
||||||
trilist.SetBoolSigAction(joinMap.Stop, (b) => stbTransport.Stop(b));
|
trilist.SetBoolSigAction(joinMap.Stop, (b) => stbTransport.Stop(b));
|
||||||
trilist.SetBoolSigAction(joinMap.Record, (b) => stbTransport.Record(b));
|
trilist.SetBoolSigAction(joinMap.Record, (b) => stbTransport.Record(b));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -38,12 +38,12 @@ namespace PepperDash.Essentials.Bridges
|
|||||||
/// Reports the EDID serial number value
|
/// Reports the EDID serial number value
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public uint EdidSerialNumber { get; set; }
|
public uint EdidSerialNumber { get; set; }
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Analogs
|
#region Analogs
|
||||||
public uint AudioVideoSource { get; set; }
|
public uint AudioVideoSource { get; set; }
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
public DmRmcControllerJoinMap()
|
public DmRmcControllerJoinMap()
|
||||||
{
|
{
|
||||||
// Digital
|
// Digital
|
||||||
@@ -56,7 +56,7 @@ namespace PepperDash.Essentials.Bridges
|
|||||||
EdidPrefferedTiming = 4;
|
EdidPrefferedTiming = 4;
|
||||||
EdidSerialNumber = 5;
|
EdidSerialNumber = 5;
|
||||||
|
|
||||||
//Analog
|
//Analog
|
||||||
AudioVideoSource = 1;
|
AudioVideoSource = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -69,7 +69,7 @@ namespace PepperDash.Essentials.Bridges
|
|||||||
EdidManufacturer = EdidManufacturer + joinOffset;
|
EdidManufacturer = EdidManufacturer + joinOffset;
|
||||||
EdidName = EdidName + joinOffset;
|
EdidName = EdidName + joinOffset;
|
||||||
EdidPrefferedTiming = EdidPrefferedTiming + joinOffset;
|
EdidPrefferedTiming = EdidPrefferedTiming + joinOffset;
|
||||||
EdidSerialNumber = EdidSerialNumber + joinOffset;
|
EdidSerialNumber = EdidSerialNumber + joinOffset;
|
||||||
AudioVideoSource = AudioVideoSource + joinOffset;
|
AudioVideoSource = AudioVideoSource + joinOffset;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,65 +1,65 @@
|
|||||||
using Crestron.SimplSharpPro.DeviceSupport;
|
using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
using PepperDash.Essentials.Core.CrestronIO;
|
using PepperDash.Essentials.Core.CrestronIO;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Core.Bridges
|
namespace PepperDash.Essentials.Core.Bridges
|
||||||
{
|
{
|
||||||
public static class StatusSignDeviceApiExtensions
|
public static class StatusSignDeviceApiExtensions
|
||||||
{
|
{
|
||||||
public static void LinkToApi(this StatusSignController ssDevice, BasicTriList trilist, uint joinStart,
|
public static void LinkToApi(this StatusSignController ssDevice, BasicTriList trilist, uint joinStart,
|
||||||
string joinMapKey)
|
string joinMapKey)
|
||||||
{
|
{
|
||||||
var joinMap = new StatusSignControllerJoinMap();
|
var joinMap = new StatusSignControllerJoinMap();
|
||||||
|
|
||||||
var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
|
var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(joinMapSerialized))
|
if (!string.IsNullOrEmpty(joinMapSerialized))
|
||||||
joinMap = JsonConvert.DeserializeObject<StatusSignControllerJoinMap>(joinMapSerialized);
|
joinMap = JsonConvert.DeserializeObject<StatusSignControllerJoinMap>(joinMapSerialized);
|
||||||
|
|
||||||
joinMap.OffsetJoinNumbers(joinStart);
|
joinMap.OffsetJoinNumbers(joinStart);
|
||||||
|
|
||||||
Debug.Console(1, ssDevice, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
Debug.Console(1, ssDevice, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
||||||
|
|
||||||
trilist.SetBoolSigAction(joinMap.RedControl, b => EnableControl(trilist, joinMap, ssDevice));
|
trilist.SetBoolSigAction(joinMap.RedControl, b => EnableControl(trilist, joinMap, ssDevice));
|
||||||
trilist.SetBoolSigAction(joinMap.GreenControl, b => EnableControl(trilist, joinMap, ssDevice));
|
trilist.SetBoolSigAction(joinMap.GreenControl, b => EnableControl(trilist, joinMap, ssDevice));
|
||||||
trilist.SetBoolSigAction(joinMap.BlueControl, b => EnableControl(trilist, joinMap, ssDevice));
|
trilist.SetBoolSigAction(joinMap.BlueControl, b => EnableControl(trilist, joinMap, ssDevice));
|
||||||
|
|
||||||
trilist.SetUShortSigAction(joinMap.RedLed, u => SetColor(trilist, joinMap, ssDevice));
|
trilist.SetUShortSigAction(joinMap.RedLed, u => SetColor(trilist, joinMap, ssDevice));
|
||||||
trilist.SetUShortSigAction(joinMap.GreenLed, u => SetColor(trilist, joinMap, ssDevice));
|
trilist.SetUShortSigAction(joinMap.GreenLed, u => SetColor(trilist, joinMap, ssDevice));
|
||||||
trilist.SetUShortSigAction(joinMap.BlueLed, u => SetColor(trilist, joinMap, ssDevice));
|
trilist.SetUShortSigAction(joinMap.BlueLed, u => SetColor(trilist, joinMap, ssDevice));
|
||||||
|
|
||||||
trilist.StringInput[joinMap.Name].StringValue = ssDevice.Name;
|
trilist.StringInput[joinMap.Name].StringValue = ssDevice.Name;
|
||||||
|
|
||||||
ssDevice.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
|
ssDevice.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
|
||||||
ssDevice.RedLedEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RedControl]);
|
ssDevice.RedLedEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RedControl]);
|
||||||
ssDevice.BlueLedEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.BlueControl]);
|
ssDevice.BlueLedEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.BlueControl]);
|
||||||
ssDevice.GreenLedEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.GreenControl]);
|
ssDevice.GreenLedEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.GreenControl]);
|
||||||
|
|
||||||
ssDevice.RedLedBrightnessFeedback.LinkInputSig(trilist.UShortInput[joinMap.RedLed]);
|
ssDevice.RedLedBrightnessFeedback.LinkInputSig(trilist.UShortInput[joinMap.RedLed]);
|
||||||
ssDevice.BlueLedBrightnessFeedback.LinkInputSig(trilist.UShortInput[joinMap.BlueLed]);
|
ssDevice.BlueLedBrightnessFeedback.LinkInputSig(trilist.UShortInput[joinMap.BlueLed]);
|
||||||
ssDevice.GreenLedBrightnessFeedback.LinkInputSig(trilist.UShortInput[joinMap.GreenLed]);
|
ssDevice.GreenLedBrightnessFeedback.LinkInputSig(trilist.UShortInput[joinMap.GreenLed]);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void EnableControl(BasicTriList triList, StatusSignControllerJoinMap joinMap,
|
private static void EnableControl(BasicTriList triList, StatusSignControllerJoinMap joinMap,
|
||||||
StatusSignController device)
|
StatusSignController device)
|
||||||
{
|
{
|
||||||
var redEnable = triList.BooleanOutput[joinMap.RedControl].BoolValue;
|
var redEnable = triList.BooleanOutput[joinMap.RedControl].BoolValue;
|
||||||
var greenEnable = triList.BooleanOutput[joinMap.GreenControl].BoolValue;
|
var greenEnable = triList.BooleanOutput[joinMap.GreenControl].BoolValue;
|
||||||
var blueEnable = triList.BooleanOutput[joinMap.BlueControl].BoolValue;
|
var blueEnable = triList.BooleanOutput[joinMap.BlueControl].BoolValue;
|
||||||
device.EnableLedControl(redEnable, greenEnable, blueEnable);
|
device.EnableLedControl(redEnable, greenEnable, blueEnable);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void SetColor(BasicTriList triList, StatusSignControllerJoinMap joinMap,
|
private static void SetColor(BasicTriList triList, StatusSignControllerJoinMap joinMap,
|
||||||
StatusSignController device)
|
StatusSignController device)
|
||||||
{
|
{
|
||||||
var redBrightness = triList.UShortOutput[joinMap.RedLed].UShortValue;
|
var redBrightness = triList.UShortOutput[joinMap.RedLed].UShortValue;
|
||||||
var greenBrightness = triList.UShortOutput[joinMap.GreenLed].UShortValue;
|
var greenBrightness = triList.UShortOutput[joinMap.GreenLed].UShortValue;
|
||||||
var blueBrightness = triList.UShortOutput[joinMap.BlueLed].UShortValue;
|
var blueBrightness = triList.UShortOutput[joinMap.BlueLed].UShortValue;
|
||||||
|
|
||||||
device.SetColor(redBrightness, greenBrightness, blueBrightness);
|
device.SetColor(redBrightness, greenBrightness, blueBrightness);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,47 +1,47 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
using Crestron.SimplSharp.CrestronIO;
|
using Crestron.SimplSharp.CrestronIO;
|
||||||
using Crestron.SimplSharpPro;
|
using Crestron.SimplSharpPro;
|
||||||
using Crestron.SimplSharp.Reflection;
|
using Crestron.SimplSharp.Reflection;
|
||||||
|
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
using PepperDash.Essentials.Core.Config;
|
using PepperDash.Essentials.Core.Config;
|
||||||
|
|
||||||
namespace PepperDash.Essentials
|
namespace PepperDash.Essentials
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Responsible for loading all of the device types for this library
|
/// Responsible for loading all of the device types for this library
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class DeviceFactory
|
public class DeviceFactory
|
||||||
{
|
{
|
||||||
|
|
||||||
public DeviceFactory()
|
public DeviceFactory()
|
||||||
{
|
{
|
||||||
var assy = Assembly.GetExecutingAssembly();
|
var assy = Assembly.GetExecutingAssembly();
|
||||||
PluginLoader.SetEssentialsAssembly(assy.GetName().Name, assy);
|
PluginLoader.SetEssentialsAssembly(assy.GetName().Name, assy);
|
||||||
|
|
||||||
var types = assy.GetTypes().Where(ct => typeof(IDeviceFactory).IsAssignableFrom(ct) && !ct.IsInterface && !ct.IsAbstract);
|
var types = assy.GetTypes().Where(ct => typeof(IDeviceFactory).IsAssignableFrom(ct) && !ct.IsInterface && !ct.IsAbstract);
|
||||||
|
|
||||||
if (types != null)
|
if (types != null)
|
||||||
{
|
{
|
||||||
foreach (var type in types)
|
foreach (var type in types)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var factory = (IDeviceFactory)Crestron.SimplSharp.Reflection.Activator.CreateInstance(type);
|
var factory = (IDeviceFactory)Crestron.SimplSharp.Reflection.Activator.CreateInstance(type);
|
||||||
factory.LoadTypeFactories();
|
factory.LoadTypeFactories();
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
Debug.Console(0, Debug.ErrorLogLevel.Error, "Unable to load type: '{1}' DeviceFactory: {0}", e, type.Name);
|
Debug.Console(0, Debug.ErrorLogLevel.Error, "Unable to load type: '{1}' DeviceFactory: {0}", e, type.Name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,358 +1,358 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
using Crestron.SimplSharpPro;
|
using Crestron.SimplSharpPro;
|
||||||
using Crestron.SimplSharpPro.Fusion;
|
using Crestron.SimplSharpPro.Fusion;
|
||||||
|
|
||||||
|
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
using PepperDash.Essentials.Core.Config;
|
using PepperDash.Essentials.Core.Config;
|
||||||
using PepperDash.Essentials.Core.Fusion;
|
using PepperDash.Essentials.Core.Fusion;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Fusion
|
namespace PepperDash.Essentials.Fusion
|
||||||
{
|
{
|
||||||
public class EssentialsHuddleVtc1FusionController : EssentialsHuddleSpaceFusionSystemControllerBase
|
public class EssentialsHuddleVtc1FusionController : EssentialsHuddleSpaceFusionSystemControllerBase
|
||||||
{
|
{
|
||||||
BooleanSigData CodecIsInCall;
|
BooleanSigData CodecIsInCall;
|
||||||
|
|
||||||
public EssentialsHuddleVtc1FusionController(IEssentialsHuddleVtc1Room room, uint ipId, string joinMapKey)
|
public EssentialsHuddleVtc1FusionController(IEssentialsHuddleVtc1Room room, uint ipId, string joinMapKey)
|
||||||
: base(room, ipId, joinMapKey)
|
: base(room, ipId, joinMapKey)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Called in base class constructor before RVI and GUID files are built
|
/// Called in base class constructor before RVI and GUID files are built
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected override void ExecuteCustomSteps()
|
protected override void ExecuteCustomSteps()
|
||||||
{
|
{
|
||||||
SetUpCodec();
|
SetUpCodec();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates a static asset for the codec and maps the joins to the main room symbol
|
/// Creates a static asset for the codec and maps the joins to the main room symbol
|
||||||
/// </summary>
|
/// </summary>
|
||||||
void SetUpCodec()
|
void SetUpCodec()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var codec = (Room as IEssentialsHuddleVtc1Room).VideoCodec;
|
var codec = (Room as IEssentialsHuddleVtc1Room).VideoCodec;
|
||||||
|
|
||||||
if (codec == null)
|
if (codec == null)
|
||||||
{
|
{
|
||||||
Debug.Console(1, this, "Cannot link codec to Fusion because codec is null");
|
Debug.Console(1, this, "Cannot link codec to Fusion because codec is null");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
codec.UsageTracker = new UsageTracking(codec);
|
codec.UsageTracker = new UsageTracking(codec);
|
||||||
codec.UsageTracker.UsageIsTracked = true;
|
codec.UsageTracker.UsageIsTracked = true;
|
||||||
codec.UsageTracker.DeviceUsageEnded += UsageTracker_DeviceUsageEnded;
|
codec.UsageTracker.DeviceUsageEnded += UsageTracker_DeviceUsageEnded;
|
||||||
|
|
||||||
var codecPowerOnAction = new Action<bool>(b => { if (!b) codec.StandbyDeactivate(); });
|
var codecPowerOnAction = new Action<bool>(b => { if (!b) codec.StandbyDeactivate(); });
|
||||||
var codecPowerOffAction = new Action<bool>(b => { if (!b) codec.StandbyActivate(); });
|
var codecPowerOffAction = new Action<bool>(b => { if (!b) codec.StandbyActivate(); });
|
||||||
|
|
||||||
// Map FusionRoom Attributes:
|
// Map FusionRoom Attributes:
|
||||||
|
|
||||||
// Codec volume
|
// Codec volume
|
||||||
var codecVolume = FusionRoom.CreateOffsetUshortSig(JoinMap.VolumeFader1.JoinNumber, JoinMap.VolumeFader1.AttributeName, eSigIoMask.InputOutputSig);
|
var codecVolume = FusionRoom.CreateOffsetUshortSig(JoinMap.VolumeFader1.JoinNumber, JoinMap.VolumeFader1.AttributeName, eSigIoMask.InputOutputSig);
|
||||||
codecVolume.OutputSig.UserObject = new Action<ushort>(b => (codec as IBasicVolumeWithFeedback).SetVolume(b));
|
codecVolume.OutputSig.UserObject = new Action<ushort>(b => (codec as IBasicVolumeWithFeedback).SetVolume(b));
|
||||||
(codec as IBasicVolumeWithFeedback).VolumeLevelFeedback.LinkInputSig(codecVolume.InputSig);
|
(codec as IBasicVolumeWithFeedback).VolumeLevelFeedback.LinkInputSig(codecVolume.InputSig);
|
||||||
|
|
||||||
// In Call Status
|
// In Call Status
|
||||||
CodecIsInCall = FusionRoom.CreateOffsetBoolSig(JoinMap.VcCodecInCall.JoinNumber, JoinMap.VcCodecInCall.AttributeName, eSigIoMask.InputSigOnly);
|
CodecIsInCall = FusionRoom.CreateOffsetBoolSig(JoinMap.VcCodecInCall.JoinNumber, JoinMap.VcCodecInCall.AttributeName, eSigIoMask.InputSigOnly);
|
||||||
codec.CallStatusChange += new EventHandler<PepperDash.Essentials.Devices.Common.Codec.CodecCallStatusItemChangeEventArgs>(codec_CallStatusChange);
|
codec.CallStatusChange += new EventHandler<PepperDash.Essentials.Devices.Common.Codec.CodecCallStatusItemChangeEventArgs>(codec_CallStatusChange);
|
||||||
|
|
||||||
// Online status
|
// Online status
|
||||||
if (codec is ICommunicationMonitor)
|
if (codec is ICommunicationMonitor)
|
||||||
{
|
{
|
||||||
var c = codec as ICommunicationMonitor;
|
var c = codec as ICommunicationMonitor;
|
||||||
var codecOnline = FusionRoom.CreateOffsetBoolSig(JoinMap.VcCodecOnline.JoinNumber, JoinMap.VcCodecOnline.AttributeName, eSigIoMask.InputSigOnly);
|
var codecOnline = FusionRoom.CreateOffsetBoolSig(JoinMap.VcCodecOnline.JoinNumber, JoinMap.VcCodecOnline.AttributeName, eSigIoMask.InputSigOnly);
|
||||||
codecOnline.InputSig.BoolValue = c.CommunicationMonitor.Status == MonitorStatus.IsOk;
|
codecOnline.InputSig.BoolValue = c.CommunicationMonitor.Status == MonitorStatus.IsOk;
|
||||||
c.CommunicationMonitor.StatusChange += (o, a) =>
|
c.CommunicationMonitor.StatusChange += (o, a) =>
|
||||||
{
|
{
|
||||||
codecOnline.InputSig.BoolValue = a.Status == MonitorStatus.IsOk;
|
codecOnline.InputSig.BoolValue = a.Status == MonitorStatus.IsOk;
|
||||||
};
|
};
|
||||||
Debug.Console(0, this, "Linking '{0}' communication monitor to Fusion '{1}'", codec.Key, JoinMap.VcCodecOnline.AttributeName);
|
Debug.Console(0, this, "Linking '{0}' communication monitor to Fusion '{1}'", codec.Key, JoinMap.VcCodecOnline.AttributeName);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Codec IP Address
|
// Codec IP Address
|
||||||
bool codecHasIpInfo = false;
|
bool codecHasIpInfo = false;
|
||||||
var codecComm = codec.Communication;
|
var codecComm = codec.Communication;
|
||||||
|
|
||||||
string codecIpAddress = string.Empty;
|
string codecIpAddress = string.Empty;
|
||||||
int codecIpPort = 0;
|
int codecIpPort = 0;
|
||||||
|
|
||||||
StringSigData codecIpAddressSig;
|
StringSigData codecIpAddressSig;
|
||||||
StringSigData codecIpPortSig;
|
StringSigData codecIpPortSig;
|
||||||
|
|
||||||
if(codecComm is GenericSshClient)
|
if(codecComm is GenericSshClient)
|
||||||
{
|
{
|
||||||
codecIpAddress = (codecComm as GenericSshClient).Hostname;
|
codecIpAddress = (codecComm as GenericSshClient).Hostname;
|
||||||
codecIpPort = (codecComm as GenericSshClient).Port;
|
codecIpPort = (codecComm as GenericSshClient).Port;
|
||||||
codecHasIpInfo = true;
|
codecHasIpInfo = true;
|
||||||
}
|
}
|
||||||
else if (codecComm is GenericTcpIpClient)
|
else if (codecComm is GenericTcpIpClient)
|
||||||
{
|
{
|
||||||
codecIpAddress = (codecComm as GenericTcpIpClient).Hostname;
|
codecIpAddress = (codecComm as GenericTcpIpClient).Hostname;
|
||||||
codecIpPort = (codecComm as GenericTcpIpClient).Port;
|
codecIpPort = (codecComm as GenericTcpIpClient).Port;
|
||||||
codecHasIpInfo = true;
|
codecHasIpInfo = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (codecHasIpInfo)
|
if (codecHasIpInfo)
|
||||||
{
|
{
|
||||||
codecIpAddressSig = FusionRoom.CreateOffsetStringSig(JoinMap.VcCodecIpAddress.JoinNumber, JoinMap.VcCodecIpAddress.AttributeName, eSigIoMask.InputSigOnly);
|
codecIpAddressSig = FusionRoom.CreateOffsetStringSig(JoinMap.VcCodecIpAddress.JoinNumber, JoinMap.VcCodecIpAddress.AttributeName, eSigIoMask.InputSigOnly);
|
||||||
codecIpAddressSig.InputSig.StringValue = codecIpAddress;
|
codecIpAddressSig.InputSig.StringValue = codecIpAddress;
|
||||||
|
|
||||||
codecIpPortSig = FusionRoom.CreateOffsetStringSig(JoinMap.VcCodecIpPort.JoinNumber, JoinMap.VcCodecIpPort.AttributeName, eSigIoMask.InputSigOnly);
|
codecIpPortSig = FusionRoom.CreateOffsetStringSig(JoinMap.VcCodecIpPort.JoinNumber, JoinMap.VcCodecIpPort.AttributeName, eSigIoMask.InputSigOnly);
|
||||||
codecIpPortSig.InputSig.StringValue = codecIpPort.ToString();
|
codecIpPortSig.InputSig.StringValue = codecIpPort.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
var tempAsset = new FusionAsset();
|
var tempAsset = new FusionAsset();
|
||||||
|
|
||||||
var deviceConfig = ConfigReader.ConfigObject.Devices.FirstOrDefault(c => c.Key.Equals(codec.Key));
|
var deviceConfig = ConfigReader.ConfigObject.Devices.FirstOrDefault(c => c.Key.Equals(codec.Key));
|
||||||
|
|
||||||
if (FusionStaticAssets.ContainsKey(deviceConfig.Uid))
|
if (FusionStaticAssets.ContainsKey(deviceConfig.Uid))
|
||||||
{
|
{
|
||||||
tempAsset = FusionStaticAssets[deviceConfig.Uid];
|
tempAsset = FusionStaticAssets[deviceConfig.Uid];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Create a new asset
|
// Create a new asset
|
||||||
tempAsset = new FusionAsset(FusionRoomGuids.GetNextAvailableAssetNumber(FusionRoom), codec.Name, "Codec", "");
|
tempAsset = new FusionAsset(FusionRoomGuids.GetNextAvailableAssetNumber(FusionRoom), codec.Name, "Codec", "");
|
||||||
FusionStaticAssets.Add(deviceConfig.Uid, tempAsset);
|
FusionStaticAssets.Add(deviceConfig.Uid, tempAsset);
|
||||||
}
|
}
|
||||||
|
|
||||||
var codecAsset = FusionRoom.CreateStaticAsset(tempAsset.SlotNumber, tempAsset.Name, "Codec", tempAsset.InstanceId);
|
var codecAsset = FusionRoom.CreateStaticAsset(tempAsset.SlotNumber, tempAsset.Name, "Codec", tempAsset.InstanceId);
|
||||||
codecAsset.PowerOn.OutputSig.UserObject = codecPowerOnAction;
|
codecAsset.PowerOn.OutputSig.UserObject = codecPowerOnAction;
|
||||||
codecAsset.PowerOff.OutputSig.UserObject = codecPowerOffAction;
|
codecAsset.PowerOff.OutputSig.UserObject = codecPowerOffAction;
|
||||||
codec.StandbyIsOnFeedback.LinkComplementInputSig(codecAsset.PowerOn.InputSig);
|
codec.StandbyIsOnFeedback.LinkComplementInputSig(codecAsset.PowerOn.InputSig);
|
||||||
|
|
||||||
// TODO: Map relevant attributes on asset symbol
|
// TODO: Map relevant attributes on asset symbol
|
||||||
|
|
||||||
codecAsset.TrySetMakeModel(codec);
|
codecAsset.TrySetMakeModel(codec);
|
||||||
codecAsset.TryLinkAssetErrorToCommunication(codec);
|
codecAsset.TryLinkAssetErrorToCommunication(codec);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
Debug.Console(1, this, "Error setting up codec in Fusion: {0}", e);
|
Debug.Console(1, this, "Error setting up codec in Fusion: {0}", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void codec_CallStatusChange(object sender, PepperDash.Essentials.Devices.Common.Codec.CodecCallStatusItemChangeEventArgs e)
|
void codec_CallStatusChange(object sender, PepperDash.Essentials.Devices.Common.Codec.CodecCallStatusItemChangeEventArgs e)
|
||||||
{
|
{
|
||||||
var codec = (Room as IEssentialsHuddleVtc1Room).VideoCodec;
|
var codec = (Room as IEssentialsHuddleVtc1Room).VideoCodec;
|
||||||
|
|
||||||
CodecIsInCall.InputSig.BoolValue = codec.IsInCall;
|
CodecIsInCall.InputSig.BoolValue = codec.IsInCall;
|
||||||
}
|
}
|
||||||
|
|
||||||
// These methods are overridden because they access the room class which is of a different type
|
// These methods are overridden because they access the room class which is of a different type
|
||||||
|
|
||||||
protected override void CreateSymbolAndBasicSigs(uint ipId)
|
protected override void CreateSymbolAndBasicSigs(uint ipId)
|
||||||
{
|
{
|
||||||
Debug.Console(0, this, "Creating Fusion Room symbol with GUID: {0} and IP-ID {1:X2}", RoomGuid, ipId);
|
Debug.Console(0, this, "Creating Fusion Room symbol with GUID: {0} and IP-ID {1:X2}", RoomGuid, ipId);
|
||||||
|
|
||||||
FusionRoom = new FusionRoom(ipId, Global.ControlSystem, Room.Name, RoomGuid);
|
FusionRoom = new FusionRoom(ipId, Global.ControlSystem, Room.Name, RoomGuid);
|
||||||
FusionRoom.ExtenderRoomViewSchedulingDataReservedSigs.Use();
|
FusionRoom.ExtenderRoomViewSchedulingDataReservedSigs.Use();
|
||||||
FusionRoom.ExtenderFusionRoomDataReservedSigs.Use();
|
FusionRoom.ExtenderFusionRoomDataReservedSigs.Use();
|
||||||
|
|
||||||
FusionRoom.Register();
|
FusionRoom.Register();
|
||||||
|
|
||||||
FusionRoom.FusionStateChange += FusionRoom_FusionStateChange;
|
FusionRoom.FusionStateChange += FusionRoom_FusionStateChange;
|
||||||
|
|
||||||
FusionRoom.ExtenderRoomViewSchedulingDataReservedSigs.DeviceExtenderSigChange += FusionRoomSchedule_DeviceExtenderSigChange;
|
FusionRoom.ExtenderRoomViewSchedulingDataReservedSigs.DeviceExtenderSigChange += FusionRoomSchedule_DeviceExtenderSigChange;
|
||||||
FusionRoom.ExtenderFusionRoomDataReservedSigs.DeviceExtenderSigChange += ExtenderFusionRoomDataReservedSigs_DeviceExtenderSigChange;
|
FusionRoom.ExtenderFusionRoomDataReservedSigs.DeviceExtenderSigChange += ExtenderFusionRoomDataReservedSigs_DeviceExtenderSigChange;
|
||||||
FusionRoom.OnlineStatusChange += FusionRoom_OnlineStatusChange;
|
FusionRoom.OnlineStatusChange += FusionRoom_OnlineStatusChange;
|
||||||
|
|
||||||
CrestronConsole.AddNewConsoleCommand(RequestFullRoomSchedule, "FusReqRoomSchedule", "Requests schedule of the room for the next 24 hours", ConsoleAccessLevelEnum.AccessOperator);
|
CrestronConsole.AddNewConsoleCommand(RequestFullRoomSchedule, "FusReqRoomSchedule", "Requests schedule of the room for the next 24 hours", ConsoleAccessLevelEnum.AccessOperator);
|
||||||
CrestronConsole.AddNewConsoleCommand(ModifyMeetingEndTimeConsoleHelper, "FusReqRoomSchMod", "Ends or extends a meeting by the specified time", ConsoleAccessLevelEnum.AccessOperator);
|
CrestronConsole.AddNewConsoleCommand(ModifyMeetingEndTimeConsoleHelper, "FusReqRoomSchMod", "Ends or extends a meeting by the specified time", ConsoleAccessLevelEnum.AccessOperator);
|
||||||
CrestronConsole.AddNewConsoleCommand(CreateAdHocMeeting, "FusCreateMeeting", "Creates and Ad Hoc meeting for on hour or until the next meeting", ConsoleAccessLevelEnum.AccessOperator);
|
CrestronConsole.AddNewConsoleCommand(CreateAdHocMeeting, "FusCreateMeeting", "Creates and Ad Hoc meeting for on hour or until the next meeting", ConsoleAccessLevelEnum.AccessOperator);
|
||||||
|
|
||||||
// Room to fusion room
|
// Room to fusion room
|
||||||
Room.OnFeedback.LinkInputSig(FusionRoom.SystemPowerOn.InputSig);
|
Room.OnFeedback.LinkInputSig(FusionRoom.SystemPowerOn.InputSig);
|
||||||
|
|
||||||
// Moved to
|
// Moved to
|
||||||
CurrentRoomSourceNameSig = FusionRoom.CreateOffsetStringSig(JoinMap.Display1CurrentSourceName.JoinNumber, JoinMap.Display1CurrentSourceName.AttributeName, eSigIoMask.InputSigOnly);
|
CurrentRoomSourceNameSig = FusionRoom.CreateOffsetStringSig(JoinMap.Display1CurrentSourceName.JoinNumber, JoinMap.Display1CurrentSourceName.AttributeName, eSigIoMask.InputSigOnly);
|
||||||
// Don't think we need to get current status of this as nothing should be alive yet.
|
// Don't think we need to get current status of this as nothing should be alive yet.
|
||||||
(Room as IEssentialsHuddleVtc1Room).CurrentSourceChange += Room_CurrentSourceInfoChange;
|
(Room as IEssentialsHuddleVtc1Room).CurrentSourceChange += Room_CurrentSourceInfoChange;
|
||||||
|
|
||||||
|
|
||||||
FusionRoom.SystemPowerOn.OutputSig.SetSigFalseAction((Room as IEssentialsHuddleVtc1Room).PowerOnToDefaultOrLastSource);
|
FusionRoom.SystemPowerOn.OutputSig.SetSigFalseAction((Room as IEssentialsHuddleVtc1Room).PowerOnToDefaultOrLastSource);
|
||||||
FusionRoom.SystemPowerOff.OutputSig.SetSigFalseAction(() => (Room as IEssentialsHuddleVtc1Room).RunRouteAction("roomOff", Room.SourceListKey));
|
FusionRoom.SystemPowerOff.OutputSig.SetSigFalseAction(() => (Room as IEssentialsHuddleVtc1Room).RunRouteAction("roomOff", Room.SourceListKey));
|
||||||
|
|
||||||
|
|
||||||
CrestronEnvironment.EthernetEventHandler += CrestronEnvironment_EthernetEventHandler;
|
CrestronEnvironment.EthernetEventHandler += CrestronEnvironment_EthernetEventHandler;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void SetUpSources()
|
protected override void SetUpSources()
|
||||||
{
|
{
|
||||||
// Sources
|
// Sources
|
||||||
var dict = ConfigReader.ConfigObject.GetSourceListForKey((Room as IEssentialsHuddleVtc1Room).SourceListKey);
|
var dict = ConfigReader.ConfigObject.GetSourceListForKey((Room as IEssentialsHuddleVtc1Room).SourceListKey);
|
||||||
if (dict != null)
|
if (dict != null)
|
||||||
{
|
{
|
||||||
// NEW PROCESS:
|
// NEW PROCESS:
|
||||||
// Make these lists and insert the fusion attributes by iterating these
|
// Make these lists and insert the fusion attributes by iterating these
|
||||||
var setTopBoxes = dict.Where(d => d.Value.SourceDevice is ISetTopBoxControls);
|
var setTopBoxes = dict.Where(d => d.Value.SourceDevice is ISetTopBoxControls);
|
||||||
uint i = 1;
|
uint i = 1;
|
||||||
foreach (var kvp in setTopBoxes)
|
foreach (var kvp in setTopBoxes)
|
||||||
{
|
{
|
||||||
TryAddRouteActionSigs(JoinMap.Display1DiscPlayerSourceStart.AttributeName + " " + i, JoinMap.Display1DiscPlayerSourceStart.JoinNumber + i, kvp.Key, kvp.Value.SourceDevice);
|
TryAddRouteActionSigs(JoinMap.Display1DiscPlayerSourceStart.AttributeName + " " + i, JoinMap.Display1DiscPlayerSourceStart.JoinNumber + i, kvp.Key, kvp.Value.SourceDevice);
|
||||||
i++;
|
i++;
|
||||||
if (i > JoinMap.Display1SetTopBoxSourceStart.JoinSpan) // We only have five spots
|
if (i > JoinMap.Display1SetTopBoxSourceStart.JoinSpan) // We only have five spots
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
var discPlayers = dict.Where(d => d.Value.SourceDevice is IDiscPlayerControls);
|
var discPlayers = dict.Where(d => d.Value.SourceDevice is IDiscPlayerControls);
|
||||||
i = 1;
|
i = 1;
|
||||||
foreach (var kvp in discPlayers)
|
foreach (var kvp in discPlayers)
|
||||||
{
|
{
|
||||||
TryAddRouteActionSigs(JoinMap.Display1DiscPlayerSourceStart.AttributeName + " " + i, JoinMap.Display1DiscPlayerSourceStart.JoinNumber + i, kvp.Key, kvp.Value.SourceDevice);
|
TryAddRouteActionSigs(JoinMap.Display1DiscPlayerSourceStart.AttributeName + " " + i, JoinMap.Display1DiscPlayerSourceStart.JoinNumber + i, kvp.Key, kvp.Value.SourceDevice);
|
||||||
i++;
|
i++;
|
||||||
if (i > 5) // We only have five spots
|
if (i > 5) // We only have five spots
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
var laptops = dict.Where(d => d.Value.SourceDevice is Core.Devices.Laptop);
|
var laptops = dict.Where(d => d.Value.SourceDevice is Core.Devices.Laptop);
|
||||||
i = 1;
|
i = 1;
|
||||||
foreach (var kvp in laptops)
|
foreach (var kvp in laptops)
|
||||||
{
|
{
|
||||||
TryAddRouteActionSigs(JoinMap.Display1LaptopSourceStart.AttributeName + " " + i, JoinMap.Display1LaptopSourceStart.JoinNumber + i, kvp.Key, kvp.Value.SourceDevice);
|
TryAddRouteActionSigs(JoinMap.Display1LaptopSourceStart.AttributeName + " " + i, JoinMap.Display1LaptopSourceStart.JoinNumber + i, kvp.Key, kvp.Value.SourceDevice);
|
||||||
i++;
|
i++;
|
||||||
if (i > JoinMap.Display1LaptopSourceStart.JoinSpan) // We only have ten spots???
|
if (i > JoinMap.Display1LaptopSourceStart.JoinSpan) // We only have ten spots???
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (var kvp in dict)
|
foreach (var kvp in dict)
|
||||||
{
|
{
|
||||||
var usageDevice = kvp.Value.SourceDevice as IUsageTracking;
|
var usageDevice = kvp.Value.SourceDevice as IUsageTracking;
|
||||||
|
|
||||||
if (usageDevice != null)
|
if (usageDevice != null)
|
||||||
{
|
{
|
||||||
usageDevice.UsageTracker = new UsageTracking(usageDevice as Device);
|
usageDevice.UsageTracker = new UsageTracking(usageDevice as Device);
|
||||||
usageDevice.UsageTracker.UsageIsTracked = true;
|
usageDevice.UsageTracker.UsageIsTracked = true;
|
||||||
usageDevice.UsageTracker.DeviceUsageEnded += new EventHandler<DeviceUsageEventArgs>(UsageTracker_DeviceUsageEnded);
|
usageDevice.UsageTracker.DeviceUsageEnded += new EventHandler<DeviceUsageEventArgs>(UsageTracker_DeviceUsageEnded);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Debug.Console(1, this, "WARNING: Config source list '{0}' not found for room '{1}'",
|
Debug.Console(1, this, "WARNING: Config source list '{0}' not found for room '{1}'",
|
||||||
(Room as IEssentialsHuddleVtc1Room).SourceListKey, Room.Key);
|
(Room as IEssentialsHuddleVtc1Room).SourceListKey, Room.Key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void SetUpDisplay()
|
protected override void SetUpDisplay()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
//Setup Display Usage Monitoring
|
//Setup Display Usage Monitoring
|
||||||
|
|
||||||
var displays = DeviceManager.AllDevices.Where(d => d is DisplayBase);
|
var displays = DeviceManager.AllDevices.Where(d => d is DisplayBase);
|
||||||
|
|
||||||
// Consider updating this in multiple display systems
|
// Consider updating this in multiple display systems
|
||||||
|
|
||||||
foreach (DisplayBase display in displays)
|
foreach (DisplayBase display in displays)
|
||||||
{
|
{
|
||||||
display.UsageTracker = new UsageTracking(display);
|
display.UsageTracker = new UsageTracking(display);
|
||||||
display.UsageTracker.UsageIsTracked = true;
|
display.UsageTracker.UsageIsTracked = true;
|
||||||
display.UsageTracker.DeviceUsageEnded += new EventHandler<DeviceUsageEventArgs>(UsageTracker_DeviceUsageEnded);
|
display.UsageTracker.DeviceUsageEnded += new EventHandler<DeviceUsageEventArgs>(UsageTracker_DeviceUsageEnded);
|
||||||
}
|
}
|
||||||
|
|
||||||
var defaultDisplay = (Room as IEssentialsHuddleVtc1Room).DefaultDisplay as DisplayBase;
|
var defaultDisplay = (Room as IEssentialsHuddleVtc1Room).DefaultDisplay as DisplayBase;
|
||||||
if (defaultDisplay == null)
|
if (defaultDisplay == null)
|
||||||
{
|
{
|
||||||
Debug.Console(1, this, "Cannot link null display to Fusion because default display is null");
|
Debug.Console(1, this, "Cannot link null display to Fusion because default display is null");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var dispPowerOnAction = new Action<bool>(b => { if (!b) defaultDisplay.PowerOn(); });
|
var dispPowerOnAction = new Action<bool>(b => { if (!b) defaultDisplay.PowerOn(); });
|
||||||
var dispPowerOffAction = new Action<bool>(b => { if (!b) defaultDisplay.PowerOff(); });
|
var dispPowerOffAction = new Action<bool>(b => { if (!b) defaultDisplay.PowerOff(); });
|
||||||
|
|
||||||
// Display to fusion room sigs
|
// Display to fusion room sigs
|
||||||
FusionRoom.DisplayPowerOn.OutputSig.UserObject = dispPowerOnAction;
|
FusionRoom.DisplayPowerOn.OutputSig.UserObject = dispPowerOnAction;
|
||||||
FusionRoom.DisplayPowerOff.OutputSig.UserObject = dispPowerOffAction;
|
FusionRoom.DisplayPowerOff.OutputSig.UserObject = dispPowerOffAction;
|
||||||
|
|
||||||
var defaultDisplayTwoWay = defaultDisplay as IHasPowerControlWithFeedback;
|
var defaultDisplayTwoWay = defaultDisplay as IHasPowerControlWithFeedback;
|
||||||
if (defaultDisplayTwoWay != null)
|
if (defaultDisplayTwoWay != null)
|
||||||
{
|
{
|
||||||
defaultDisplayTwoWay.PowerIsOnFeedback.LinkInputSig(FusionRoom.DisplayPowerOn.InputSig);
|
defaultDisplayTwoWay.PowerIsOnFeedback.LinkInputSig(FusionRoom.DisplayPowerOn.InputSig);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (defaultDisplay is IDisplayUsage)
|
if (defaultDisplay is IDisplayUsage)
|
||||||
(defaultDisplay as IDisplayUsage).LampHours.LinkInputSig(FusionRoom.DisplayUsage.InputSig);
|
(defaultDisplay as IDisplayUsage).LampHours.LinkInputSig(FusionRoom.DisplayUsage.InputSig);
|
||||||
|
|
||||||
MapDisplayToRoomJoins(1, JoinMap.Display1Start.JoinNumber, defaultDisplay);
|
MapDisplayToRoomJoins(1, JoinMap.Display1Start.JoinNumber, defaultDisplay);
|
||||||
|
|
||||||
var deviceConfig = ConfigReader.ConfigObject.Devices.FirstOrDefault(d => d.Key.Equals(defaultDisplay.Key));
|
var deviceConfig = ConfigReader.ConfigObject.Devices.FirstOrDefault(d => d.Key.Equals(defaultDisplay.Key));
|
||||||
|
|
||||||
//Check for existing asset in GUIDs collection
|
//Check for existing asset in GUIDs collection
|
||||||
|
|
||||||
var tempAsset = new FusionAsset();
|
var tempAsset = new FusionAsset();
|
||||||
|
|
||||||
if (FusionStaticAssets.ContainsKey(deviceConfig.Uid))
|
if (FusionStaticAssets.ContainsKey(deviceConfig.Uid))
|
||||||
{
|
{
|
||||||
tempAsset = FusionStaticAssets[deviceConfig.Uid];
|
tempAsset = FusionStaticAssets[deviceConfig.Uid];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Create a new asset
|
// Create a new asset
|
||||||
tempAsset = new FusionAsset(FusionRoomGuids.GetNextAvailableAssetNumber(FusionRoom), defaultDisplay.Name, "Display", "");
|
tempAsset = new FusionAsset(FusionRoomGuids.GetNextAvailableAssetNumber(FusionRoom), defaultDisplay.Name, "Display", "");
|
||||||
FusionStaticAssets.Add(deviceConfig.Uid, tempAsset);
|
FusionStaticAssets.Add(deviceConfig.Uid, tempAsset);
|
||||||
}
|
}
|
||||||
|
|
||||||
var dispAsset = FusionRoom.CreateStaticAsset(tempAsset.SlotNumber, tempAsset.Name, "Display", tempAsset.InstanceId);
|
var dispAsset = FusionRoom.CreateStaticAsset(tempAsset.SlotNumber, tempAsset.Name, "Display", tempAsset.InstanceId);
|
||||||
dispAsset.PowerOn.OutputSig.UserObject = dispPowerOnAction;
|
dispAsset.PowerOn.OutputSig.UserObject = dispPowerOnAction;
|
||||||
dispAsset.PowerOff.OutputSig.UserObject = dispPowerOffAction;
|
dispAsset.PowerOff.OutputSig.UserObject = dispPowerOffAction;
|
||||||
|
|
||||||
|
|
||||||
var defaultTwoWayDisplay = defaultDisplay as IHasPowerControlWithFeedback;
|
var defaultTwoWayDisplay = defaultDisplay as IHasPowerControlWithFeedback;
|
||||||
if (defaultTwoWayDisplay != null)
|
if (defaultTwoWayDisplay != null)
|
||||||
{
|
{
|
||||||
defaultTwoWayDisplay.PowerIsOnFeedback.LinkInputSig(FusionRoom.DisplayPowerOn.InputSig);
|
defaultTwoWayDisplay.PowerIsOnFeedback.LinkInputSig(FusionRoom.DisplayPowerOn.InputSig);
|
||||||
if (defaultDisplay is IDisplayUsage)
|
if (defaultDisplay is IDisplayUsage)
|
||||||
(defaultDisplay as IDisplayUsage).LampHours.LinkInputSig(FusionRoom.DisplayUsage.InputSig);
|
(defaultDisplay as IDisplayUsage).LampHours.LinkInputSig(FusionRoom.DisplayUsage.InputSig);
|
||||||
|
|
||||||
defaultTwoWayDisplay.PowerIsOnFeedback.LinkInputSig(dispAsset.PowerOn.InputSig);
|
defaultTwoWayDisplay.PowerIsOnFeedback.LinkInputSig(dispAsset.PowerOn.InputSig);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Use extension methods
|
// Use extension methods
|
||||||
dispAsset.TrySetMakeModel(defaultDisplay);
|
dispAsset.TrySetMakeModel(defaultDisplay);
|
||||||
dispAsset.TryLinkAssetErrorToCommunication(defaultDisplay);
|
dispAsset.TryLinkAssetErrorToCommunication(defaultDisplay);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
Debug.Console(1, this, "Error setting up display in Fusion: {0}", e);
|
Debug.Console(1, this, "Error setting up display in Fusion: {0}", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void MapDisplayToRoomJoins(int displayIndex, uint joinOffset, DisplayBase display)
|
protected override void MapDisplayToRoomJoins(int displayIndex, uint joinOffset, DisplayBase display)
|
||||||
{
|
{
|
||||||
string displayName = string.Format("Display {0} - ", displayIndex);
|
string displayName = string.Format("Display {0} - ", displayIndex);
|
||||||
|
|
||||||
|
|
||||||
if (display == (Room as IEssentialsHuddleVtc1Room).DefaultDisplay)
|
if (display == (Room as IEssentialsHuddleVtc1Room).DefaultDisplay)
|
||||||
{
|
{
|
||||||
// Power on
|
// Power on
|
||||||
var defaultDisplayPowerOn = FusionRoom.CreateOffsetBoolSig((uint)joinOffset, displayName + "Power On", eSigIoMask.InputOutputSig);
|
var defaultDisplayPowerOn = FusionRoom.CreateOffsetBoolSig((uint)joinOffset, displayName + "Power On", eSigIoMask.InputOutputSig);
|
||||||
defaultDisplayPowerOn.OutputSig.UserObject = new Action<bool>(b => { if (!b) display.PowerOn(); });
|
defaultDisplayPowerOn.OutputSig.UserObject = new Action<bool>(b => { if (!b) display.PowerOn(); });
|
||||||
|
|
||||||
// Power Off
|
// Power Off
|
||||||
var defaultDisplayPowerOff = FusionRoom.CreateOffsetBoolSig((uint)joinOffset + 1, displayName + "Power Off", eSigIoMask.InputOutputSig);
|
var defaultDisplayPowerOff = FusionRoom.CreateOffsetBoolSig((uint)joinOffset + 1, displayName + "Power Off", eSigIoMask.InputOutputSig);
|
||||||
defaultDisplayPowerOn.OutputSig.UserObject = new Action<bool>(b => { if (!b) display.PowerOff(); }); ;
|
defaultDisplayPowerOn.OutputSig.UserObject = new Action<bool>(b => { if (!b) display.PowerOff(); }); ;
|
||||||
|
|
||||||
var displayTwoWay = display as IHasPowerControlWithFeedback;
|
var displayTwoWay = display as IHasPowerControlWithFeedback;
|
||||||
if (displayTwoWay != null)
|
if (displayTwoWay != null)
|
||||||
{
|
{
|
||||||
displayTwoWay.PowerIsOnFeedback.LinkInputSig(defaultDisplayPowerOn.InputSig);
|
displayTwoWay.PowerIsOnFeedback.LinkInputSig(defaultDisplayPowerOn.InputSig);
|
||||||
displayTwoWay.PowerIsOnFeedback.LinkInputSig(defaultDisplayPowerOn.InputSig);
|
displayTwoWay.PowerIsOnFeedback.LinkInputSig(defaultDisplayPowerOn.InputSig);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Current Source
|
// Current Source
|
||||||
var defaultDisplaySourceNone = FusionRoom.CreateOffsetBoolSig((uint)joinOffset + 8, displayName + "Source None", eSigIoMask.InputOutputSig);
|
var defaultDisplaySourceNone = FusionRoom.CreateOffsetBoolSig((uint)joinOffset + 8, displayName + "Source None", eSigIoMask.InputOutputSig);
|
||||||
defaultDisplaySourceNone.OutputSig.UserObject = new Action<bool>(b => { if (!b) (Room as IEssentialsHuddleVtc1Room).RunRouteAction("roomOff", Room.SourceListKey); }); ;
|
defaultDisplaySourceNone.OutputSig.UserObject = new Action<bool>(b => { if (!b) (Room as IEssentialsHuddleVtc1Room).RunRouteAction("roomOff", Room.SourceListKey); }); ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -7,8 +7,8 @@
|
|||||||
<ProjectGuid>{1BED5BA9-88C4-4365-9362-6F4B128071D3}</ProjectGuid>
|
<ProjectGuid>{1BED5BA9-88C4-4365-9362-6F4B128071D3}</ProjectGuid>
|
||||||
<OutputType>Library</OutputType>
|
<OutputType>Library</OutputType>
|
||||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||||
<RootNamespace>PepperDash.Essentials</RootNamespace>
|
<RootNamespace>PepperDashEssentials</RootNamespace>
|
||||||
<AssemblyName>PepperDash.Essentials</AssemblyName>
|
<AssemblyName>PepperDashEssentials</AssemblyName>
|
||||||
<ProjectTypeGuids>{0B4745B0-194B-4BB6-8E21-E9057CA92230};{4D628B5B-2FBC-4AA6-8C16-197242AEB884};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
<ProjectTypeGuids>{0B4745B0-194B-4BB6-8E21-E9057CA92230};{4D628B5B-2FBC-4AA6-8C16-197242AEB884};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||||
<PlatformFamilyName>WindowsCE</PlatformFamilyName>
|
<PlatformFamilyName>WindowsCE</PlatformFamilyName>
|
||||||
<PlatformID>E2BECB1F-8C8C-41ba-B736-9BE7D946A398</PlatformID>
|
<PlatformID>E2BECB1F-8C8C-41ba-B736-9BE7D946A398</PlatformID>
|
||||||
@@ -73,7 +73,7 @@
|
|||||||
<Reference Include="mscorlib" />
|
<Reference Include="mscorlib" />
|
||||||
<Reference Include="PepperDash_Core, Version=1.0.42.30563, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="PepperDash_Core, Version=1.0.42.30563, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<SpecificVersion>False</SpecificVersion>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
<HintPath>..\..\packages\PepperDashCore\lib\net35\PepperDash_Core.dll</HintPath>
|
<HintPath>..\packages\PepperDashCore\lib\net35\PepperDash_Core.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="SimplSharpCustomAttributesInterface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
<Reference Include="SimplSharpCustomAttributesInterface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||||
<SpecificVersion>False</SpecificVersion>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
@@ -209,17 +209,17 @@
|
|||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\PepperDash.Essentials.Core\PepperDash.Essentials.Core.csproj">
|
<ProjectReference Include="..\essentials-framework\Essentials Core\PepperDashEssentialsBase\PepperDash_Essentials_Core.csproj">
|
||||||
<Project>{A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5}</Project>
|
<Project>{A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5}</Project>
|
||||||
<Name>PepperDash.Essentials.Core</Name>
|
<Name>PepperDash_Essentials_Core</Name>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
<ProjectReference Include="..\PepperDash.Essentials.Devices.Common\PepperDash.Essentials.Devices.Common.csproj">
|
<ProjectReference Include="..\essentials-framework\Essentials Devices Common\Essentials Devices Common\Essentials Devices Common.csproj">
|
||||||
<Project>{892B761C-E479-44CE-BD74-243E9214AF13}</Project>
|
<Project>{892B761C-E479-44CE-BD74-243E9214AF13}</Project>
|
||||||
<Name>PepperDash.Essentials.Devices.Common</Name>
|
<Name>Essentials Devices Common</Name>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
<ProjectReference Include="..\PepperDash.Essentials.Devices.DM\PepperDash.Essentials.Devices.Dm.csproj">
|
<ProjectReference Include="..\essentials-framework\Essentials DM\Essentials_DM\PepperDash_Essentials_DM.csproj">
|
||||||
<Project>{9199CE8A-0C9F-4952-8672-3EED798B284F}</Project>
|
<Project>{9199CE8A-0C9F-4952-8672-3EED798B284F}</Project>
|
||||||
<Name>PepperDash.Essentials.Devices.Dm</Name>
|
<Name>PepperDash_Essentials_DM</Name>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildBinPath)\Microsoft.CompactFramework.CSharp.targets" />
|
<Import Project="$(MSBuildBinPath)\Microsoft.CompactFramework.CSharp.targets" />
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<ControlSystem>
|
<ControlSystem>
|
||||||
<Name>Test RMC3</Name>
|
<Name>Test RMC3</Name>
|
||||||
<Address>auto 192.168.1.40;username crestron</Address>
|
<Address>auto 192.168.1.40;username crestron</Address>
|
||||||
<ProgramSlot>Program01</ProgramSlot>
|
<ProgramSlot>Program01</ProgramSlot>
|
||||||
<Storage>Internal Flash</Storage>
|
<Storage>Internal Flash</Storage>
|
||||||
</ControlSystem>
|
</ControlSystem>
|
||||||
@@ -1,393 +1,411 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials;
|
using PepperDash.Essentials;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
using PepperDash.Essentials.Core.Config;
|
using PepperDash.Essentials.Core.Config;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Room.Config
|
namespace PepperDash.Essentials.Room.Config
|
||||||
{
|
{
|
||||||
public class EssentialsRoomConfigHelper
|
public class EssentialsRoomConfigHelper
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns a room object from this config data
|
/// Returns a room object from this config data
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static Device GetRoomObject(DeviceConfig roomConfig)
|
public static IKeyed GetRoomObject(DeviceConfig roomConfig)
|
||||||
{
|
{
|
||||||
var typeName = roomConfig.Type.ToLower();
|
var typeName = roomConfig.Type.ToLower();
|
||||||
|
|
||||||
if (typeName == "huddle")
|
switch (typeName)
|
||||||
{
|
{
|
||||||
return new EssentialsHuddleSpaceRoom(roomConfig);
|
case "huddle" :
|
||||||
}
|
{
|
||||||
if (typeName == "huddlevtc1")
|
return new EssentialsHuddleSpaceRoom(roomConfig);
|
||||||
{
|
}
|
||||||
return new EssentialsHuddleVtc1Room(roomConfig);
|
case "huddlevtc1" :
|
||||||
}
|
{
|
||||||
if (typeName == "ddvc01bridge")
|
return new EssentialsHuddleVtc1Room(roomConfig);
|
||||||
{
|
}
|
||||||
return new Device(roomConfig.Key, roomConfig.Name); // placeholder device that does nothing.
|
case "ddvc01bridge" :
|
||||||
}
|
{
|
||||||
if (typeName == "dualdisplay")
|
return new Device(roomConfig.Key, roomConfig.Name); // placeholder device that does nothing.
|
||||||
{
|
}
|
||||||
return new EssentialsDualDisplayRoom(roomConfig);
|
case "dualdisplay" :
|
||||||
}
|
{
|
||||||
if (typeName == "combinedhuddlevtc1")
|
return new EssentialsDualDisplayRoom(roomConfig);
|
||||||
{
|
}
|
||||||
return new EssentialsCombinedHuddleVtc1Room(roomConfig);
|
case "combinedhuddlevtc1" :
|
||||||
}
|
{
|
||||||
|
return new EssentialsCombinedHuddleVtc1Room(roomConfig);
|
||||||
return typeName != "techroom" ? null : new EssentialsTechRoom(roomConfig);
|
}
|
||||||
}
|
case "techroom" :
|
||||||
|
{
|
||||||
/// <summary>
|
return new EssentialsTechRoom(roomConfig);
|
||||||
/// Gets and operating, standalone emergegncy object that can be plugged into a room.
|
}
|
||||||
/// Returns null if there is no emergency defined
|
default :
|
||||||
/// </summary>
|
{
|
||||||
public static EssentialsRoomEmergencyBase GetEmergency(EssentialsRoomPropertiesConfig props, IEssentialsRoom room)
|
return Core.DeviceFactory.GetDevice(roomConfig);
|
||||||
{
|
}
|
||||||
// This emergency
|
}
|
||||||
var emergency = props.Emergency;
|
}
|
||||||
if (emergency != null)
|
|
||||||
{
|
/// <summary>
|
||||||
//switch on emergency type here. Right now only contact and shutdown
|
/// Gets and operating, standalone emergegncy object that can be plugged into a room.
|
||||||
var e = new EssentialsRoomEmergencyContactClosure(room.Key + "-emergency", props.Emergency, room);
|
/// Returns null if there is no emergency defined
|
||||||
DeviceManager.AddDevice(e);
|
/// </summary>
|
||||||
}
|
public static EssentialsRoomEmergencyBase GetEmergency(EssentialsRoomPropertiesConfig props, IEssentialsRoom room)
|
||||||
return null;
|
{
|
||||||
}
|
// This emergency
|
||||||
|
var emergency = props.Emergency;
|
||||||
/// <summary>
|
if (emergency != null)
|
||||||
///
|
{
|
||||||
/// </summary>
|
//switch on emergency type here. Right now only contact and shutdown
|
||||||
/// <param name="props"></param>
|
var e = new EssentialsRoomEmergencyContactClosure(room.Key + "-emergency", props.Emergency, room);
|
||||||
/// <param name="room"></param>
|
DeviceManager.AddDevice(e);
|
||||||
/// <returns></returns>
|
}
|
||||||
public static Core.Privacy.MicrophonePrivacyController GetMicrophonePrivacy(
|
return null;
|
||||||
EssentialsRoomPropertiesConfig props, IPrivacy room)
|
}
|
||||||
{
|
|
||||||
var microphonePrivacy = props.MicrophonePrivacy;
|
/// <summary>
|
||||||
if (microphonePrivacy == null)
|
///
|
||||||
{
|
/// </summary>
|
||||||
Debug.Console(0, "Cannot create microphone privacy with null properties");
|
/// <param name="props"></param>
|
||||||
return null;
|
/// <param name="room"></param>
|
||||||
}
|
/// <returns></returns>
|
||||||
// Get the MicrophonePrivacy device from the device manager
|
public static Core.Privacy.MicrophonePrivacyController GetMicrophonePrivacy(
|
||||||
var mP = (DeviceManager.GetDeviceForKey(props.MicrophonePrivacy.DeviceKey) as
|
EssentialsRoomPropertiesConfig props, IPrivacy room)
|
||||||
Core.Privacy.MicrophonePrivacyController);
|
{
|
||||||
// Set this room as the IPrivacy device
|
var microphonePrivacy = props.MicrophonePrivacy;
|
||||||
if (mP == null)
|
if (microphonePrivacy == null)
|
||||||
{
|
{
|
||||||
Debug.Console(0, "ERROR: Selected device {0} is not MicrophonePrivacyController", props.MicrophonePrivacy.DeviceKey);
|
Debug.Console(0, "Cannot create microphone privacy with null properties");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
mP.SetPrivacyDevice(room);
|
// Get the MicrophonePrivacy device from the device manager
|
||||||
|
var mP = (DeviceManager.GetDeviceForKey(props.MicrophonePrivacy.DeviceKey) as
|
||||||
var behaviour = props.MicrophonePrivacy.Behaviour.ToLower();
|
Core.Privacy.MicrophonePrivacyController);
|
||||||
|
// Set this room as the IPrivacy device
|
||||||
if (behaviour == null)
|
if (mP == null)
|
||||||
{
|
{
|
||||||
Debug.Console(0, "WARNING: No behaviour defined for MicrophonePrivacyController");
|
Debug.Console(0, "ERROR: Selected device {0} is not MicrophonePrivacyController", props.MicrophonePrivacy.DeviceKey);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
if (behaviour == "trackroomstate")
|
mP.SetPrivacyDevice(room);
|
||||||
{
|
|
||||||
// Tie LED enable to room power state
|
var behaviour = props.MicrophonePrivacy.Behaviour.ToLower();
|
||||||
var essRoom = room as IEssentialsRoom;
|
|
||||||
essRoom.OnFeedback.OutputChange += (o, a) =>
|
if (behaviour == null)
|
||||||
{
|
{
|
||||||
if (essRoom.OnFeedback.BoolValue)
|
Debug.Console(0, "WARNING: No behaviour defined for MicrophonePrivacyController");
|
||||||
mP.EnableLeds = true;
|
return null;
|
||||||
else
|
}
|
||||||
mP.EnableLeds = false;
|
if (behaviour == "trackroomstate")
|
||||||
};
|
{
|
||||||
|
// Tie LED enable to room power state
|
||||||
mP.EnableLeds = essRoom.OnFeedback.BoolValue;
|
var essRoom = room as IEssentialsRoom;
|
||||||
}
|
essRoom.OnFeedback.OutputChange += (o, a) =>
|
||||||
else if (behaviour == "trackcallstate")
|
{
|
||||||
{
|
if (essRoom.OnFeedback.BoolValue)
|
||||||
// Tie LED enable to room power state
|
mP.EnableLeds = true;
|
||||||
var inCallRoom = room as IHasInCallFeedback;
|
else
|
||||||
inCallRoom.InCallFeedback.OutputChange += (o, a) =>
|
mP.EnableLeds = false;
|
||||||
{
|
};
|
||||||
if (inCallRoom.InCallFeedback.BoolValue)
|
|
||||||
mP.EnableLeds = true;
|
mP.EnableLeds = essRoom.OnFeedback.BoolValue;
|
||||||
else
|
}
|
||||||
mP.EnableLeds = false;
|
else if (behaviour == "trackcallstate")
|
||||||
};
|
{
|
||||||
|
// Tie LED enable to room power state
|
||||||
mP.EnableLeds = inCallRoom.InCallFeedback.BoolValue;
|
var inCallRoom = room as IHasInCallFeedback;
|
||||||
}
|
inCallRoom.InCallFeedback.OutputChange += (o, a) =>
|
||||||
|
{
|
||||||
return mP;
|
if (inCallRoom.InCallFeedback.BoolValue)
|
||||||
}
|
mP.EnableLeds = true;
|
||||||
|
else
|
||||||
}
|
mP.EnableLeds = false;
|
||||||
|
};
|
||||||
/// <summary>
|
|
||||||
///
|
mP.EnableLeds = inCallRoom.InCallFeedback.BoolValue;
|
||||||
/// </summary>
|
}
|
||||||
public class EssentialsRoomPropertiesConfig
|
|
||||||
{
|
return mP;
|
||||||
[JsonProperty("addresses")]
|
}
|
||||||
public EssentialsRoomAddressPropertiesConfig Addresses { get; set; }
|
|
||||||
|
}
|
||||||
[JsonProperty("description")]
|
|
||||||
public string Description { get; set; }
|
/// <summary>
|
||||||
|
///
|
||||||
[JsonProperty("emergency")]
|
/// </summary>
|
||||||
public EssentialsRoomEmergencyConfig Emergency { get; set; }
|
public class EssentialsRoomPropertiesConfig
|
||||||
|
{
|
||||||
[JsonProperty("help")]
|
[JsonProperty("addresses")]
|
||||||
public EssentialsHelpPropertiesConfig Help { get; set; }
|
public EssentialsRoomAddressPropertiesConfig Addresses { get; set; }
|
||||||
|
|
||||||
[JsonProperty("helpMessage")]
|
[JsonProperty("description")]
|
||||||
public string HelpMessage { get; set; }
|
public string Description { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
[JsonProperty("emergency")]
|
||||||
/// Read this value to get the help message. It checks for the old and new config format.
|
public EssentialsRoomEmergencyConfig Emergency { get; set; }
|
||||||
/// </summary>
|
|
||||||
public string HelpMessageForDisplay
|
[JsonProperty("help")]
|
||||||
{
|
public EssentialsHelpPropertiesConfig Help { get; set; }
|
||||||
get
|
|
||||||
{
|
[JsonProperty("helpMessage")]
|
||||||
if(Help != null && !string.IsNullOrEmpty(Help.Message))
|
public string HelpMessage { get; set; }
|
||||||
{
|
|
||||||
return Help.Message;
|
/// <summary>
|
||||||
}
|
/// Read this value to get the help message. It checks for the old and new config format.
|
||||||
else
|
/// </summary>
|
||||||
{
|
public string HelpMessageForDisplay
|
||||||
return HelpMessage;
|
{
|
||||||
}
|
get
|
||||||
}
|
{
|
||||||
}
|
if(Help != null && !string.IsNullOrEmpty(Help.Message))
|
||||||
|
{
|
||||||
[JsonProperty("environment")]
|
return Help.Message;
|
||||||
public EssentialsEnvironmentPropertiesConfig Environment { get; set; }
|
}
|
||||||
|
else
|
||||||
[JsonProperty("logo")]
|
{
|
||||||
public EssentialsLogoPropertiesConfig LogoLight { get; set; }
|
return HelpMessage;
|
||||||
|
}
|
||||||
[JsonProperty("logoDark")]
|
}
|
||||||
public EssentialsLogoPropertiesConfig LogoDark { get; set; }
|
}
|
||||||
|
|
||||||
[JsonProperty("microphonePrivacy")]
|
[JsonProperty("environment")]
|
||||||
public EssentialsRoomMicrophonePrivacyConfig MicrophonePrivacy { get; set; }
|
public EssentialsEnvironmentPropertiesConfig Environment { get; set; }
|
||||||
|
|
||||||
[JsonProperty("occupancy")]
|
[JsonProperty("logo")]
|
||||||
public EssentialsRoomOccSensorConfig Occupancy { get; set; }
|
public EssentialsLogoPropertiesConfig LogoLight { get; set; }
|
||||||
|
|
||||||
[JsonProperty("oneButtonMeeting")]
|
[JsonProperty("logoDark")]
|
||||||
public EssentialsOneButtonMeetingPropertiesConfig OneButtonMeeting { get; set; }
|
public EssentialsLogoPropertiesConfig LogoDark { get; set; }
|
||||||
|
|
||||||
[JsonProperty("shutdownVacancySeconds")]
|
[JsonProperty("microphonePrivacy")]
|
||||||
public int ShutdownVacancySeconds { get; set; }
|
public EssentialsRoomMicrophonePrivacyConfig MicrophonePrivacy { get; set; }
|
||||||
|
|
||||||
[JsonProperty("shutdownPromptSeconds")]
|
[JsonProperty("occupancy")]
|
||||||
public int ShutdownPromptSeconds { get; set; }
|
public EssentialsRoomOccSensorConfig Occupancy { get; set; }
|
||||||
|
|
||||||
[JsonProperty("tech")]
|
[JsonProperty("oneButtonMeeting")]
|
||||||
public EssentialsRoomTechConfig Tech { get; set; }
|
public EssentialsOneButtonMeetingPropertiesConfig OneButtonMeeting { get; set; }
|
||||||
|
|
||||||
[JsonProperty("volumes")]
|
[JsonProperty("shutdownVacancySeconds")]
|
||||||
public EssentialsRoomVolumesConfig Volumes { get; set; }
|
public int ShutdownVacancySeconds { get; set; }
|
||||||
|
|
||||||
[JsonProperty("fusion")]
|
[JsonProperty("shutdownPromptSeconds")]
|
||||||
public EssentialsRoomFusionConfig Fusion { get; set; }
|
public int ShutdownPromptSeconds { get; set; }
|
||||||
|
|
||||||
[JsonProperty("zeroVolumeWhenSwtichingVolumeDevices")]
|
[JsonProperty("tech")]
|
||||||
public bool ZeroVolumeWhenSwtichingVolumeDevices { get; set; }
|
public EssentialsRoomTechConfig Tech { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
[JsonProperty("volumes")]
|
||||||
/// Indicates if this room represents a combination of other rooms
|
public EssentialsRoomVolumesConfig Volumes { get; set; }
|
||||||
/// </summary>
|
|
||||||
[JsonProperty("isRoomCombinationScenario")]
|
[JsonProperty("fusion")]
|
||||||
public bool IsRoomCombinationScenario { get; set; }
|
public EssentialsRoomFusionConfig Fusion { get; set; }
|
||||||
|
|
||||||
public EssentialsRoomPropertiesConfig()
|
[JsonProperty("essentialsRoomUiBehaviorConfig", NullValueHandling=NullValueHandling.Ignore)]
|
||||||
{
|
public EssentialsRoomUiBehaviorConfig UiBehavior { get; set; }
|
||||||
LogoLight = new EssentialsLogoPropertiesConfig();
|
|
||||||
LogoDark = new EssentialsLogoPropertiesConfig();
|
[JsonProperty("zeroVolumeWhenSwtichingVolumeDevices")]
|
||||||
}
|
public bool ZeroVolumeWhenSwtichingVolumeDevices { get; set; }
|
||||||
}
|
|
||||||
|
/// <summary>
|
||||||
public class EssentialsAvRoomPropertiesConfig : EssentialsRoomPropertiesConfig
|
/// Indicates if this room represents a combination of other rooms
|
||||||
{
|
/// </summary>
|
||||||
[JsonProperty("defaultAudioKey")]
|
[JsonProperty("isRoomCombinationScenario")]
|
||||||
public string DefaultAudioKey { get; set; }
|
public bool IsRoomCombinationScenario { get; set; }
|
||||||
[JsonProperty("sourceListKey")]
|
|
||||||
public string SourceListKey { get; set; }
|
public EssentialsRoomPropertiesConfig()
|
||||||
[JsonProperty("destinationListKey")]
|
{
|
||||||
public string DestinationListKey { get; set; }
|
LogoLight = new EssentialsLogoPropertiesConfig();
|
||||||
[JsonProperty("defaultSourceItem")]
|
LogoDark = new EssentialsLogoPropertiesConfig();
|
||||||
public string DefaultSourceItem { get; set; }
|
}
|
||||||
/// <summary>
|
}
|
||||||
/// Indicates if the room supports advanced sharing
|
|
||||||
/// </summary>
|
public class EssentialsRoomUiBehaviorConfig
|
||||||
[JsonProperty("supportsAdvancedSharing")]
|
{
|
||||||
public bool SupportsAdvancedSharing { get; set; }
|
[JsonProperty("disableActivityButtonsWhileWarmingCooling")]
|
||||||
/// <summary>
|
public bool DisableActivityButtonsWhileWarmingCooling { get; set; }
|
||||||
/// Indicates if non-tech users can change the share mode
|
}
|
||||||
/// </summary>
|
|
||||||
[JsonProperty("userCanChangeShareMode")]
|
public class EssentialsAvRoomPropertiesConfig : EssentialsRoomPropertiesConfig
|
||||||
public bool UserCanChangeShareMode { get; set; }
|
{
|
||||||
}
|
[JsonProperty("defaultAudioKey")]
|
||||||
|
public string DefaultAudioKey { get; set; }
|
||||||
public class EssentialsConferenceRoomPropertiesConfig : EssentialsAvRoomPropertiesConfig
|
[JsonProperty("sourceListKey")]
|
||||||
{
|
public string SourceListKey { get; set; }
|
||||||
[JsonProperty("videoCodecKey")]
|
[JsonProperty("destinationListKey")]
|
||||||
public string VideoCodecKey { get; set; }
|
public string DestinationListKey { get; set; }
|
||||||
[JsonProperty("audioCodecKey")]
|
[JsonProperty("defaultSourceItem")]
|
||||||
public string AudioCodecKey { get; set; }
|
public string DefaultSourceItem { get; set; }
|
||||||
}
|
/// <summary>
|
||||||
|
/// Indicates if the room supports advanced sharing
|
||||||
public class EssentialsEnvironmentPropertiesConfig
|
/// </summary>
|
||||||
{
|
[JsonProperty("supportsAdvancedSharing")]
|
||||||
public bool Enabled { get; set; }
|
public bool SupportsAdvancedSharing { get; set; }
|
||||||
|
/// <summary>
|
||||||
[JsonProperty("deviceKeys")]
|
/// Indicates if non-tech users can change the share mode
|
||||||
public List<string> DeviceKeys { get; set; }
|
/// </summary>
|
||||||
|
[JsonProperty("userCanChangeShareMode")]
|
||||||
public EssentialsEnvironmentPropertiesConfig()
|
public bool UserCanChangeShareMode { get; set; }
|
||||||
{
|
}
|
||||||
DeviceKeys = new List<string>();
|
|
||||||
}
|
public class EssentialsConferenceRoomPropertiesConfig : EssentialsAvRoomPropertiesConfig
|
||||||
|
{
|
||||||
}
|
[JsonProperty("videoCodecKey")]
|
||||||
|
public string VideoCodecKey { get; set; }
|
||||||
public class EssentialsRoomFusionConfig
|
[JsonProperty("audioCodecKey")]
|
||||||
{
|
public string AudioCodecKey { get; set; }
|
||||||
public uint IpIdInt
|
}
|
||||||
{
|
|
||||||
get
|
public class EssentialsEnvironmentPropertiesConfig
|
||||||
{
|
{
|
||||||
try
|
public bool Enabled { get; set; }
|
||||||
{
|
|
||||||
return Convert.ToUInt32(IpId, 16);
|
[JsonProperty("deviceKeys")]
|
||||||
}
|
public List<string> DeviceKeys { get; set; }
|
||||||
catch (Exception)
|
|
||||||
{
|
public EssentialsEnvironmentPropertiesConfig()
|
||||||
throw new FormatException(string.Format("ERROR:Unable to convert IP ID: {0} to hex. Error:\n{1}", IpId));
|
{
|
||||||
}
|
DeviceKeys = new List<string>();
|
||||||
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[JsonProperty("ipId")]
|
public class EssentialsRoomFusionConfig
|
||||||
public string IpId { get; set; }
|
{
|
||||||
|
public uint IpIdInt
|
||||||
[JsonProperty("joinMapKey")]
|
{
|
||||||
public string JoinMapKey { get; set; }
|
get
|
||||||
|
{
|
||||||
}
|
try
|
||||||
|
{
|
||||||
public class EssentialsRoomMicrophonePrivacyConfig
|
return Convert.ToUInt32(IpId, 16);
|
||||||
{
|
}
|
||||||
[JsonProperty("deviceKey")]
|
catch (Exception)
|
||||||
public string DeviceKey { get; set; }
|
{
|
||||||
|
throw new FormatException(string.Format("ERROR:Unable to convert IP ID: {0} to hex. Error:\n{1}", IpId));
|
||||||
[JsonProperty("behaviour")]
|
}
|
||||||
public string Behaviour { get; set; }
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
/// <summary>
|
|
||||||
/// Properties for the help text box
|
[JsonProperty("ipId")]
|
||||||
/// </summary>
|
public string IpId { get; set; }
|
||||||
public class EssentialsHelpPropertiesConfig
|
|
||||||
{
|
[JsonProperty("joinMapKey")]
|
||||||
[JsonProperty("message")]
|
public string JoinMapKey { get; set; }
|
||||||
public string Message { get; set; }
|
|
||||||
|
}
|
||||||
[JsonProperty("showCallButton")]
|
|
||||||
public bool ShowCallButton { get; set; }
|
public class EssentialsRoomMicrophonePrivacyConfig
|
||||||
|
{
|
||||||
/// <summary>
|
[JsonProperty("deviceKey")]
|
||||||
/// Defaults to "Call Help Desk"
|
public string DeviceKey { get; set; }
|
||||||
/// </summary>
|
|
||||||
[JsonProperty("callButtonText")]
|
[JsonProperty("behaviour")]
|
||||||
public string CallButtonText { get; set; }
|
public string Behaviour { get; set; }
|
||||||
|
}
|
||||||
public EssentialsHelpPropertiesConfig()
|
|
||||||
{
|
/// <summary>
|
||||||
CallButtonText = "Call Help Desk";
|
/// Properties for the help text box
|
||||||
}
|
/// </summary>
|
||||||
}
|
public class EssentialsHelpPropertiesConfig
|
||||||
|
{
|
||||||
/// <summary>
|
[JsonProperty("message")]
|
||||||
///
|
public string Message { get; set; }
|
||||||
/// </summary>
|
|
||||||
public class EssentialsOneButtonMeetingPropertiesConfig
|
[JsonProperty("showCallButton")]
|
||||||
{
|
public bool ShowCallButton { get; set; }
|
||||||
[JsonProperty("enable")]
|
|
||||||
public bool Enable { get; set; }
|
/// <summary>
|
||||||
}
|
/// Defaults to "Call Help Desk"
|
||||||
|
/// </summary>
|
||||||
public class EssentialsRoomAddressPropertiesConfig
|
[JsonProperty("callButtonText")]
|
||||||
{
|
public string CallButtonText { get; set; }
|
||||||
[JsonProperty("phoneNumber")]
|
|
||||||
public string PhoneNumber { get; set; }
|
public EssentialsHelpPropertiesConfig()
|
||||||
|
{
|
||||||
[JsonProperty("sipAddress")]
|
CallButtonText = "Call Help Desk";
|
||||||
public string SipAddress { get; set; }
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
/// <summary>
|
///
|
||||||
/// Properties for the room's logo on panels
|
/// </summary>
|
||||||
/// </summary>
|
public class EssentialsOneButtonMeetingPropertiesConfig
|
||||||
public class EssentialsLogoPropertiesConfig
|
{
|
||||||
{
|
[JsonProperty("enable")]
|
||||||
[JsonProperty("type")]
|
public bool Enable { get; set; }
|
||||||
public string Type { get; set; }
|
}
|
||||||
|
|
||||||
[JsonProperty("url")]
|
public class EssentialsRoomAddressPropertiesConfig
|
||||||
public string Url { get; set; }
|
{
|
||||||
/// <summary>
|
[JsonProperty("phoneNumber")]
|
||||||
/// Gets either the custom URL, a local-to-processor URL, or null if it's a default logo
|
public string PhoneNumber { get; set; }
|
||||||
/// </summary>
|
|
||||||
public string GetLogoUrlLight()
|
[JsonProperty("sipAddress")]
|
||||||
{
|
public string SipAddress { get; set; }
|
||||||
if (Type == "url")
|
}
|
||||||
return Url;
|
|
||||||
if (Type == "system")
|
|
||||||
return string.Format("http://{0}:8080/logo.png",
|
/// <summary>
|
||||||
CrestronEthernetHelper.GetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_CURRENT_IP_ADDRESS, 0));
|
/// Properties for the room's logo on panels
|
||||||
return null;
|
/// </summary>
|
||||||
}
|
public class EssentialsLogoPropertiesConfig
|
||||||
|
{
|
||||||
public string GetLogoUrlDark()
|
[JsonProperty("type")]
|
||||||
{
|
public string Type { get; set; }
|
||||||
if (Type == "url")
|
|
||||||
return Url;
|
[JsonProperty("url")]
|
||||||
if (Type == "system")
|
public string Url { get; set; }
|
||||||
return string.Format("http://{0}:8080/logo-dark.png",
|
/// <summary>
|
||||||
CrestronEthernetHelper.GetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_CURRENT_IP_ADDRESS, 0));
|
/// Gets either the custom URL, a local-to-processor URL, or null if it's a default logo
|
||||||
return null;
|
/// </summary>
|
||||||
}
|
public string GetLogoUrlLight()
|
||||||
}
|
{
|
||||||
|
if (Type == "url")
|
||||||
/// <summary>
|
return Url;
|
||||||
/// Represents occupancy sensor(s) setup for a room
|
if (Type == "system")
|
||||||
/// </summary>
|
return string.Format("http://{0}:8080/logo.png",
|
||||||
public class EssentialsRoomOccSensorConfig
|
CrestronEthernetHelper.GetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_CURRENT_IP_ADDRESS, 0));
|
||||||
{
|
return null;
|
||||||
[JsonProperty("deviceKey")]
|
}
|
||||||
public string DeviceKey { get; set; }
|
|
||||||
|
public string GetLogoUrlDark()
|
||||||
[JsonProperty("timeoutMinutes")]
|
{
|
||||||
public int TimeoutMinutes { get; set; }
|
if (Type == "url")
|
||||||
}
|
return Url;
|
||||||
|
if (Type == "system")
|
||||||
public class EssentialsRoomTechConfig
|
return string.Format("http://{0}:8080/logo-dark.png",
|
||||||
{
|
CrestronEthernetHelper.GetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_CURRENT_IP_ADDRESS, 0));
|
||||||
[JsonProperty("password")]
|
return null;
|
||||||
public string Password { get; set; }
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Represents occupancy sensor(s) setup for a room
|
||||||
|
/// </summary>
|
||||||
|
public class EssentialsRoomOccSensorConfig
|
||||||
|
{
|
||||||
|
[JsonProperty("deviceKey")]
|
||||||
|
public string DeviceKey { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("timeoutMinutes")]
|
||||||
|
public int TimeoutMinutes { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class EssentialsRoomTechConfig
|
||||||
|
{
|
||||||
|
[JsonProperty("password")]
|
||||||
|
public string Password { get; set; }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -56,6 +56,9 @@ namespace PepperDash.Essentials.Room.Config
|
|||||||
[JsonProperty("mirroredTuners")]
|
[JsonProperty("mirroredTuners")]
|
||||||
public Dictionary<uint, string> MirroredTuners { get; set; }
|
public Dictionary<uint, string> MirroredTuners { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("helpMessage")]
|
||||||
|
public string HelpMessage { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Indicates the room
|
/// Indicates the room
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -89,7 +89,7 @@ namespace PepperDash.Essentials
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public EssentialsConferenceRoomPropertiesConfig PropertiesConfig { get; private set; }
|
public EssentialsHuddleVtc1PropertiesConfig PropertiesConfig { get; private set; }
|
||||||
|
|
||||||
private List<IRoutingSinkWithSwitching> Displays;
|
private List<IRoutingSinkWithSwitching> Displays;
|
||||||
|
|
||||||
@@ -199,7 +199,7 @@ namespace PepperDash.Essentials
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
PropertiesConfig = JsonConvert.DeserializeObject<EssentialsConferenceRoomPropertiesConfig>
|
PropertiesConfig = JsonConvert.DeserializeObject<EssentialsHuddleVtc1PropertiesConfig>
|
||||||
(config.Properties.ToString());
|
(config.Properties.ToString());
|
||||||
|
|
||||||
VideoCodec = DeviceManager.GetDeviceForKey(PropertiesConfig.VideoCodecKey) as
|
VideoCodec = DeviceManager.GetDeviceForKey(PropertiesConfig.VideoCodecKey) as
|
||||||
@@ -361,7 +361,7 @@ namespace PepperDash.Essentials
|
|||||||
|
|
||||||
protected override void CustomSetConfig(DeviceConfig config)
|
protected override void CustomSetConfig(DeviceConfig config)
|
||||||
{
|
{
|
||||||
var newPropertiesConfig = JsonConvert.DeserializeObject<EssentialsConferenceRoomPropertiesConfig>(config.Properties.ToString());
|
var newPropertiesConfig = JsonConvert.DeserializeObject<EssentialsHuddleVtc1PropertiesConfig>(config.Properties.ToString());
|
||||||
|
|
||||||
if (newPropertiesConfig != null)
|
if (newPropertiesConfig != null)
|
||||||
PropertiesConfig = newPropertiesConfig;
|
PropertiesConfig = newPropertiesConfig;
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user