Merge pull request #93 from PepperDash/release/v1.4.33

Release/v1.4.33
This commit is contained in:
Andrew Welker 2020-04-08 14:03:08 -06:00 committed by GitHub
commit e078e6bda7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
75 changed files with 4527 additions and 2553 deletions

View file

@ -0,0 +1,45 @@
$latestVersions = $(git tag --merged origin/master)
$latestVersion = [version]"0.0.0"
Foreach ($version in $latestVersions) {
Write-Host $version
try {
if (([version]$version) -ge $latestVersion) {
$latestVersion = $version
Write-Host "Setting latest version to: $latestVersion"
}
}
catch {
Write-Host "Unable to convert $($version). Skipping"
continue;
}
}
$newVersion = [version]$latestVersion
$phase = ""
$newVersionString = ""
switch -regex ($Env:GITHUB_REF) {
'^refs\/heads\/master*.' {
$newVersionString = "{0}.{1}.{2}" -f $newVersion.Major, $newVersion.Minor, $newVersion.Build
}
'^refs\/heads\/feature\/*.' {
$phase = 'alpha'
$newVersionString = "{0}.{1}.{2}-{3}-{4}" -f $newVersion.Major, $newVersion.Minor, ($newVersion.Build + 1), $phase, $Env:GITHUB_RUN_NUMBER
}
'^refs\/heads\/release\/*.' {
$splitRef = $Env:GITHUB_REF -split "/"
$version = [version]($splitRef[-1] -replace "v", "")
$phase = 'rc'
$newVersionString = "{0}.{1}.{2}-{3}-{4}" -f $version.Major, $version.Minor, $version.Build, $phase, $Env:GITHUB_RUN_NUMBER
}
'^refs\/heads\/development*.' {
$phase = 'beta'
$newVersionString = "{0}.{1}.{2}-{3}-{4}" -f $newVersion.Major, $newVersion.Minor, ($newVersion.Build + 1), $phase, $Env:GITHUB_RUN_NUMBER
}
'^refs\/heads\/hotfix\/*.' {
$phase = 'hotfix'
$newVersionString = "{0}.{1}.{2}-{3}-{4}" -f $newVersion.Major, $newVersion.Minor, ($newVersion.Build + 1), $phase, $Env:GITHUB_RUN_NUMBER
}
}
Write-Output $newVersionString

View file

@ -0,0 +1,40 @@
function Update-SourceVersion {
Param ([string]$Version)
#$fullVersion = $Version
$baseVersion = [regex]::Match($Version, "(\d+.\d+.\d+).*").captures.groups[1].value
$NewAssemblyVersion = AssemblyVersion(" + $baseVersion + .*")
Write-Output "AssemblyVersion = $NewAssemblyVersion"
$NewAssemblyInformationalVersion = AssemblyInformationalVersion(" + $Version + ")
Write-Output "AssemblyInformationalVersion = $NewAssemblyInformationalVersion"
foreach ($o in $input) {
Write-output $o.FullName
$TmpFile = $o.FullName + .tmp
get-content $o.FullName |
ForEach-Object {
$_ -replace AssemblyVersion\(".*"\), $NewAssemblyVersion } |
ForEach-Object {
$_ -replace AssemblyInformationalVersion\(".*"\), $NewAssemblyInformationalVersion
} > $TmpFile
move-item $TmpFile $o.FullName -force
}
}
function Update-AllAssemblyInfoFiles ( $version ) {
foreach ($file in AssemblyInfo.cs, AssemblyInfo.vb ) {
get-childitem -Path $Env:GITHUB_WORKSPACE -recurse | Where-Object { $_.Name -eq $file } | Update-SourceVersion $version ;
}
}
# validate arguments
$r = [System.Text.RegularExpressions.Regex]::Match($args[0], "\d+\.\d+\.\d+.*");
if ($r.Success) {
Write-Output "Updating Assembly Version to $args ...";
Update-AllAssemblyInfoFiles $args[0];
}
else {
Write-Output ;
Write-Output Error: Input version does not match x.y.z format!
Write-Output ;
Write-Output "Unable to apply version to AssemblyInfo.cs files";
}

41
.github/scripts/ZipBuildOutput.ps1 vendored Normal file
View file

@ -0,0 +1,41 @@
# Uncomment these for local testing
# $Env:GITHUB_WORKSPACE = "C:\Working Directories\PD\essentials"
# $Env:SOLUTION_FILE = "PepperDashEssentials"
# $Env:VERSION = "0.0.0-buildType-test"
# Sets the root directory for the operation
$destination = "$($Env:GITHUB_HOME)\output"
New-Item -ItemType Directory -Force -Path ($destination)
Get-ChildItem ($destination)
$exclusions = @(git submodule foreach --quiet 'echo $name')
# Trying to get any .json schema files (not currently working)
# Gets any files with the listed extensions.
Get-ChildItem -recurse -Path "$($Env:GITHUB_WORKSPACE)" -include "*.clz", "*.cpz", "*.cplz" | 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
}
}
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

239
.github/workflows/docker.yml vendored Normal file
View file

@ -0,0 +1,239 @@
name: Branch Build Using Docker
on:
push:
branches:
- feature/*
- hotfix/*
- release/*
- development
env:
# solution path doesn't need slashes unless there it is multiple folders deep
# solution name does not include extension. .sln is assumed
SOLUTION_PATH: PepperDashEssentials
SOLUTION_FILE: PepperDashEssentials
# Do not edit this, we're just creating it here
VERSION: 0.0.0-buildtype-buildnumber
# Defaults to debug for build type
BUILD_TYPE: Debug
# Defaults to master as the release branch. Change as necessary
RELEASE_BRANCH: master
jobs:
Build_Project:
runs-on: windows-latest
steps:
# First we checkout the source repo
- name: Checkout repo
uses: actions/checkout@v2
with:
fetch-depth: 0
# And any submodules
- name: Checkout submodules
shell: bash
run: |
git config --global url."https://github.com/".insteadOf "git@github.com:"
auth_header="$(git config --local --get http.https://github.com/.extraheader)"
git submodule sync --recursive
git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
# Fetch all tags
- name: Fetch tags
run: git fetch --tags
# Generate the appropriate version number
- name: Set Version Number
shell: powershell
run: |
$version = ./.github/scripts/GenerateVersionNumber.ps1
Write-Output "::set-env name=VERSION::$version"
# Use the version number to set the version of the assemblies
- name: Update AssemblyInfo.cs
shell: powershell
run: |
Write-Output ${{ env.VERSION }}
./.github/scripts/UpdateAssemblyVersion.ps1 ${{ env.VERSION }}
# Build the solutions in the docker image
- name: Build Solution
shell: powershell
run: |
Invoke-Expression "docker run --rm --mount type=bind,source=""$($Env:GITHUB_WORKSPACE)"",target=""c:/project"" pepperdash/sspbuilder c:\cihelpers\vsidebuild.exe -Solution ""c:\project\$($Env:SOLUTION_FILE).sln"" -BuildSolutionConfiguration $($ENV:BUILD_TYPE)"
# Zip up the output files as needed
- name: Zip Build Output
shell: powershell
run: ./.github/scripts/ZipBuildOutput.ps1
# Write the version to a file to be consumed by the push jobs
- name: Write Version
run: Write-Output "$($Env:VERSION)" | Out-File -FilePath "$($Env:GITHUB_HOME)\output\version.txt"
# Upload the build output as an artifact
- name: Upload Build Output
uses: actions/upload-artifact@v1
with:
name: Build
path: ./${{ env.SOLUTION_FILE}}-${{ env.VERSION}}.zip
# Upload the Version file as an artifact
- name: Upload version.txt
uses: actions/upload-artifact@v1
with:
name: Version
path: ${{env.GITHUB_HOME}}\output\version.txt
# Create the release on the source repo
- name: Create Release
id: create_release
uses: actions/create-release@v1
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 }}
# This step always runs and pushes the build to the internal build rep
Internal_Push_Output:
needs: Build_Project
runs-on: windows-latest
steps:
# Checkout the repo
- name: Checkout Builds Repo
uses: actions/checkout@v2
with:
token: ${{ secrets.BUILDS_TOKEN }}
repository: PepperDash-Engineering/essentials-builds
ref: ${{ Env.GITHUB_REF }}
# Download the version artifact from the build job
- name: Download Build Version Info
uses: actions/download-artifact@v1
with:
name: Version
- name: Check Directory
run: Get-ChildItem "./"
# Set the version number environment variable from the file we just downloaded
- name: Set Version Number
shell: powershell
run: |
Get-ChildItem "./Version"
$version = Get-Content -Path ./Version/version.txt
Write-Host "Version: $version"
Write-Output "::set-env name=VERSION::$version"
Remove-Item -Path ./Version/version.txt
Remove-Item -Path ./Version
# Checkout/Create the branch
- name: Create new branch
run: git checkout -b $($Env:GITHUB_REF -replace "refs/heads/")
# Download the build output into the repo
- name: Download Build output
uses: actions/download-artifact@v1
with:
name: Build
path: ./
- name: Check directory
run: Get-ChildItem ./
# Unzip the build package file
- name: Unzip Build file
run: |
Get-ChildItem .\*.zip | Expand-Archive -DestinationPath .\
Remove-Item -Path .\*.zip
- name: Check directory again
run: Get-ChildItem ./
# Commits the build output to the branch and tags it with the version
- name: Commit build output and tag the commit
shell: powershell
run: |
git config user.email "actions@pepperdash.com"
git config user.name "GitHub Actions"
git add .
$commit = "Build $($Env:GITHUB_RUN_NUMBER) from commit: https://github.com/$($Env:GITHUB_REPOSITORY)/commit/$($Env:GITHUB_SHA)"
Write-Host "Commit: $commit"
git commit -m $commit
git tag $($Env:VERSION)
# Push the commit
- name: Push to Builds Repo
shell: powershell
run: |
$branch = $($Env:GITHUB_REF) -replace "refs/heads/"
Write-Host "Branch: $branch"
git push -u origin $($branch) --force
# Push the tags
- name: Push tags
run: git push --tags origin
- name: Check Directory
run: Get-ChildItem ./
# This step only runs if the branch is master or release/ runs and pushes the build to the public build repo
Public_Push_Output:
needs: Build_Project
runs-on: windows-latest
if: contains(github.ref, 'master') || contains(github.ref, 'release')
steps:
# Checkout the repo
- name: Checkout Builds Repo
uses: actions/checkout@v2
with:
token: ${{ secrets.BUILDS_TOKEN }}
repository: PepperDash/Essentials-Builds
ref: ${{ Env.GITHUB_REF }}
# Download the version artifact from the build job
- name: Download Build Version Info
uses: actions/download-artifact@v1
with:
name: Version
- name: Check Directory
run: Get-ChildItem "./"
# Set the version number environment variable from the file we just downloaded
- name: Set Version Number
shell: powershell
run: |
Get-ChildItem "./Version"
$version = Get-Content -Path ./Version/version.txt
Write-Host "Version: $version"
Write-Output "::set-env name=VERSION::$version"
Remove-Item -Path ./Version/version.txt
Remove-Item -Path ./Version
# Checkout/Create the branch
- name: Create new branch
run: git checkout -b $($Env:GITHUB_REF -replace "refs/heads/")
# Download the build output into the repo
- name: Download Build output
uses: actions/download-artifact@v1
with:
name: Build
path: ./
- name: Check directory
run: Get-ChildItem ./
# Unzip the build package file
- name: Unzip Build file
run: |
Get-ChildItem .\*.zip | Expand-Archive -DestinationPath .\
Remove-Item -Path .\*.zip
- name: Check directory again
run: Get-ChildItem ./
# Commits the build output to the branch and tags it with the version
- name: Commit build output and tag the commit
shell: powershell
run: |
git config user.email "actions@pepperdash.com"
git config user.name "GitHub Actions"
git add .
$commit = "Build $($Env:GITHUB_RUN_NUMBER) from commit: https://github.com/$($Env:GITHUB_REPOSITORY)/commit/$($Env:GITHUB_SHA)"
Write-Host "Commit: $commit"
git commit -m $commit
git tag $($Env:VERSION)
# Push the commit
- name: Push to Builds Repo
shell: powershell
run: |
$branch = $($Env:GITHUB_REF) -replace "refs/heads/"
Write-Host "Branch: $branch"
git push -u origin $($branch) --force
# Push the tags
- name: Push tags
run: git push --tags origin
- name: Check Directory
run: Get-ChildItem ./

74
.github/workflows/master.yml vendored Normal file
View file

@ -0,0 +1,74 @@
name: Master Build using Docker
on:
release:
types:
- created
branches:
- master
env:
# solution path doesn't need slashes unless there it is multiple folders deep
# solution name does not include extension. .sln is assumed
SOLUTION_PATH: PepperDashEssentials
SOLUTION_FILE: PepperDashEssentials
# Do not edit this, we're just creating it here
VERSION: 0.0.0-buildtype-buildnumber
# Defaults to debug for build type
BUILD_TYPE: Release
# Defaults to master as the release branch. Change as necessary
RELEASE_BRANCH: master
jobs:
Build_Project:
runs-on: windows-latest
steps:
# First we checkout the source repo
- name: Checkout repo
uses: actions/checkout@v2
# And any submodules
- name: Checkout submodules
shell: bash
run: |
git config --global url."https://github.com/".insteadOf "git@github.com:"
auth_header="$(git config --local --get http.https://github.com/.extraheader)"
git submodule sync --recursive
git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
# 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: Write-Output "::set-env name=VERSION::$($Env:TAG_NAME)"
# Use the version number to set the version of the assemblies
- name: Update AssemblyInfo.cs
shell: powershell
run: |
Write-Output ${{ env.VERSION }}
./.github/scripts/UpdateAssemblyVersion.ps1 ${{ env.VERSION }}
# 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
- name: Upload Build Output
uses: actions/upload-artifact@v1
with:
name: Build
path: ./${{ env.SOLUTION_FILE}}-${{ env.VERSION}}.zip
# 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 }}

3
.gitignore vendored
View file

@ -22,3 +22,6 @@ _ReSharper*/
SIMPLSharpLogs/ SIMPLSharpLogs/
*.projectinfo *.projectinfo
essentials-framework/EssentialDMTestConfig/ essentials-framework/EssentialDMTestConfig/
output/
PepperDashEssentials-0.0.0-buildType-test.zip

110
CONTRIBUTING.md Normal file
View file

@ -0,0 +1,110 @@
# Contributors Guide
Essentials is an open source project. If you are interested in making it better,
there are many ways you can contribute. For example, you can:
- Submit a bug report
- Suggest a new feature
- Provide feedback by commenting on feature requests/proposals
- Propose a patch by submitting a pull request
- Suggest or submit documentation improvements
- Review outstanding pull requests
- Answer questions from other users
- Share the software with other users who are interested
- Teach others to use the software
## Bugs and Feature Requests
If you believe that you have found a bug or wish to propose a new feature,
please first search the existing [issues] to see if it has already been
reported. If you are unable to find an existing issue, consider using one of
the provided templates to create a new issue and provide as many details as you
can to assist in reproducing the bug or explaining your proposed feature.
## Patch Submission tips
Patches should be submitted in the form of Pull Requests to the Essentials
[repository] on GitHub. But first, consider the following tips to ensure a
smooth process when submitting a patch:
- Ensure that the patch compiles and does not break any build-time tests.
- Be understanding, patient, and friendly; developers may need time to review
your submissions before they can take action or respond. This does not mean
your contribution is not valued. If your contribution has not received a
response in a reasonable time, consider commenting with a polite inquiry for
an update.
- Limit your patches to the smallest reasonable change to achieve your intended
goal. For example, do not make unnecessary indentation changes; but don't go
out of your way to make the patch so minimal that it isn't easy to read,
either. Consider the reviewer's perspective.
- Before submission, please squash your commits to using a message that starts
with the issue number and a description of the changes.
- Isolate multiple patches from each other. If you wish to make several
independent patches, do so in separate, smaller pull requests that can be
reviewed more easily.
- Be prepared to answer questions from reviewers. They may have further
questions before accepting your patch, and may even propose changes. Please
accept this feedback constructively, and not as a rejection of your proposed
change.
## GitFlow Branch Model
This repository adheres to the [GitFlow](https://nvie.com/posts/a-successful-git-branching-model/) branch model and is intitialized for GitFlow to make for consistent branch name prefixes. Please take time to familiarize yourself with this model.
- `master` will contain the latest stable version of the framework and release builds will be created from tagged commits on `master`.
- HotFix/Patch Pull Requests should target `master` as the base branch.
- All other Pull Requests (bug fixes, enhancements, etc.) should target `development` as the base branch.
- `release/vX.Y.X` branches will be used for release candidates when moving new features from `development` to `master`.
Beta builds will be created from tagged commits on release candidate branches.
## Review
- We welcome code reviews from anyone. A committer is required to formally
accept and merge the changes.
- Reviewers will be looking for things like threading issues, performance
implications, API design, duplication of existing functionality, readability
and code style, avoidance of bloat (scope-creep), etc.
- Reviewers will likely ask questions to better understand your change.
- Reviewers will make comments about changes to your patch:
- MUST means that the change is required
- SHOULD means that the change is suggested, further discussion on the
subject may be required
- COULD means that the change is optional
## Timeline and Managing Expectations
As we continue to engage contributors and learn best practices for running a successful open source project, our processes
and guidance will likely evolve. We will try to communicate expectations as we are able and to always be responsive. We
hope that the community will share their suggestions for improving this engagement. Based on the level of initial interest
we receive and the availability of resources to evaluate contributions, we anticipate the following:
- We will initially prioritize pull requests that include small bug fixes and code that addresses potential vulnerabilities
as well as pull requests that include improvements for processor language specifications because these require a
reasonable amount of effort to evaluate and will help us exercise and revise our process for accepting contributions. In
other words, we are going to start small in order to work out the kinks first.
- We are committed to maintaining the integrity and security of our code base. In addition to the careful review the
maintainers will give to code contributions to make sure they do not introduce new bugs or vulnerabilities, we will be
trying to identify best practices to incorporate with our open source project so that contributors can have more control
over whether their contributions are accepted. These might include things like style guides and requirements for tests and
documentation to accompany some code contributions. As a result, it may take a long time for some contributions to be
accepted. This does not mean we are ignoring them.
- We are committed to integrating this GitHub project with our team's regular development work flow so that the open source
project remains dynamic and relevant. This may affect our responsiveness and ability to accept pull requests
quickly. This does not mean we are ignoring them.
- Not all innovative ideas need to be accepted as pull requests into this GitHub project to be valuable to the community.
There may be times when we recommend that you just share your code for some enhancement to Ghidra from your own
repository. As we identify and recognize extensions that are of general interest to the reverse engineering community, we
may seek to incorporate them with our baseline.
## Legal
Consistent with Section D.6. of the GitHub Terms of Service as of 2019, and the MIT license, the project maintainer for this project accepts contributions using the inbound=outbound model.
When you submit a pull request to this repository (inbound), you are agreeing to license your contribution under the same terms as specified in [LICENSE] (outbound).
This is an open source project.
Contributions you make to this repository are completely voluntary.
When you submit an issue, bug report, question, enhancement, pull request, etc., you are offering your contribution without expectation of payment, you expressly waive any future pay claims against PepperDash related to your contribution, and you acknowledge that this does not create an obligation on the part of PepperDash of any kind.
Furthermore, your contributing to this project does not create an employer-employee relationship between the PepperDash and the contributor.
[issues]: https://github.com/PepperDash/Essentials/issues
[repository]: https://github.com/PepperDash/Essentials
[LICENSE]: https://github.com/PepperDash/Essentials/blob/master/LICENSE.md

View file

@ -136,6 +136,11 @@ namespace PepperDash.Essentials.Bridges
(device as GenericRelayDevice).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey); (device as GenericRelayDevice).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
continue; continue;
} }
else if (device is IRSetTopBoxBase)
{
(device as IRSetTopBoxBase).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
continue;
}
else if (device is IDigitalInput) else if (device is IDigitalInput)
{ {
(device as IDigitalInput).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey); (device as IDigitalInput).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
@ -166,6 +171,16 @@ namespace PepperDash.Essentials.Bridges
(device as PepperDash.Essentials.Devices.Common.Occupancy.GlsOccupancySensorBaseController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey); (device as PepperDash.Essentials.Devices.Common.Occupancy.GlsOccupancySensorBaseController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
continue; continue;
} }
else if (device is StatusSignController)
{
(device as StatusSignController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
continue;
}
else if (device is C2nRthsController)
{
(device as C2nRthsController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
continue;
}
} }
} }

View file

@ -0,0 +1,38 @@
using Crestron.SimplSharpPro.DeviceSupport;
using Newtonsoft.Json;
using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.CrestronIO;
namespace PepperDash.Essentials.Bridges
{
public static class C2nRthsControllerApiExtensions
{
public static void LinkToApi(this C2nRthsController device, BasicTriList triList, uint joinStart,
string joinMapKey)
{
var joinMap = new C2nRthsControllerJoinMap();
var joinMapSerialized = JoinMapHelper.GetJoinMapForDevice(joinMapKey);
if (!string.IsNullOrEmpty(joinMapSerialized))
joinMap = JsonConvert.DeserializeObject<C2nRthsControllerJoinMap>(joinMapSerialized);
joinMap.OffsetJoinNumbers(joinStart);
Debug.Console(1, device, "Linking to Trilist '{0}'", triList.ID.ToString("X"));
triList.SetBoolSigAction(joinMap.TemperatureFormat, device.SetTemperatureFormat);
device.IsOnline.LinkInputSig(triList.BooleanInput[joinMap.IsOnline]);
device.TemperatureFeedback.LinkInputSig(triList.UShortInput[joinMap.Temperature]);
device.HumidityFeedback.LinkInputSig(triList.UShortInput[joinMap.Humidity]);
triList.StringInput[joinMap.Name].StringValue = device.Name;
}
}
}

View file

@ -1,284 +1,288 @@
using System;
using System.Collections.Generic; using System;
using System.Linq; using System.Collections.Generic;
using System.Text; using System.Linq;
using Crestron.SimplSharp; using System.Text;
using Crestron.SimplSharpPro.DeviceSupport; using Crestron.SimplSharp;
using Crestron.SimplSharpPro.DM; using Crestron.SimplSharpPro.DeviceSupport;
using Crestron.SimplSharpPro.DM.Endpoints; using Crestron.SimplSharpPro.DM;
using Crestron.SimplSharpPro.DM.Endpoints.Transmitters; using Crestron.SimplSharpPro.DM.Endpoints;
using Crestron.SimplSharpPro.DM.Endpoints.Transmitters;
using PepperDash.Core;
using PepperDash.Essentials.Core; using PepperDash.Core;
using PepperDash.Essentials.DM; using PepperDash.Essentials.Core;
using PepperDash.Essentials.DM;
using Newtonsoft.Json;
using Newtonsoft.Json;
namespace PepperDash.Essentials.Bridges
{ namespace PepperDash.Essentials.Bridges
public static class DmChassisControllerApiExtentions {
{ public static class DmChassisControllerApiExtentions
public static void LinkToApi(this DmChassisController dmChassis, BasicTriList trilist, uint joinStart, string joinMapKey) {
{ public static void LinkToApi(this DmChassisController dmChassis, BasicTriList trilist, uint joinStart, string joinMapKey)
DmChassisControllerJoinMap joinMap = new DmChassisControllerJoinMap(); {
DmChassisControllerJoinMap joinMap = new DmChassisControllerJoinMap();
var joinMapSerialized = JoinMapHelper.GetJoinMapForDevice(joinMapKey);
var joinMapSerialized = JoinMapHelper.GetJoinMapForDevice(joinMapKey);
if (!string.IsNullOrEmpty(joinMapSerialized))
joinMap = JsonConvert.DeserializeObject<DmChassisControllerJoinMap>(joinMapSerialized); if (!string.IsNullOrEmpty(joinMapSerialized))
joinMap = JsonConvert.DeserializeObject<DmChassisControllerJoinMap>(joinMapSerialized);
joinMap.OffsetJoinNumbers(joinStart);
joinMap.OffsetJoinNumbers(joinStart);
Debug.Console(1, dmChassis, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
Debug.Console(1, dmChassis, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
var chassis = dmChassis.Chassis as DmMDMnxn;
var chassis = dmChassis.Chassis as DmMDMnxn;
dmChassis.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
dmChassis.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
trilist.SetUShortSigAction(joinMap.SystemId, new Action<ushort>(o => chassis.SystemId.UShortValue = o));
trilist.SetSigTrueAction(joinMap.SystemId, new Action(() => chassis.ApplySystemId())); trilist.SetUShortSigAction(joinMap.SystemId, new Action<ushort>(o => chassis.SystemId.UShortValue = o));
trilist.SetSigTrueAction(joinMap.SystemId, new Action(() => chassis.ApplySystemId()));
dmChassis.SystemIdFeebdack.LinkInputSig(trilist.UShortInput[joinMap.SystemId]);
dmChassis.SystemIdBusyFeedback.LinkInputSig(trilist.BooleanInput[joinMap.SystemId]); dmChassis.SystemIdFeebdack.LinkInputSig(trilist.UShortInput[joinMap.SystemId]);
dmChassis.SystemIdBusyFeedback.LinkInputSig(trilist.BooleanInput[joinMap.SystemId]);
// Link up outputs
for (uint i = 1; i <= dmChassis.Chassis.NumberOfOutputs; i++) // Link up outputs
{ for (uint i = 1; i <= dmChassis.Chassis.NumberOfOutputs; i++)
var ioSlot = i; {
var ioSlot = i;
// Control
trilist.SetUShortSigAction(joinMap.OutputVideo + ioSlot, new Action<ushort>(o => dmChassis.ExecuteSwitch(o, ioSlot, eRoutingSignalType.Video))); // Control
trilist.SetUShortSigAction(joinMap.OutputAudio + ioSlot, new Action<ushort>(o => dmChassis.ExecuteSwitch(o, ioSlot, eRoutingSignalType.Audio))); trilist.SetUShortSigAction(joinMap.OutputVideo + ioSlot, new Action<ushort>(o => dmChassis.ExecuteSwitch(o, ioSlot, eRoutingSignalType.Video)));
trilist.SetUShortSigAction(joinMap.OutputUsb + ioSlot, new Action<ushort>(o => dmChassis.ExecuteSwitch(o, ioSlot, eRoutingSignalType.UsbOutput))); trilist.SetUShortSigAction(joinMap.OutputAudio + ioSlot, new Action<ushort>(o => dmChassis.ExecuteSwitch(o, ioSlot, eRoutingSignalType.Audio)));
trilist.SetUShortSigAction(joinMap.InputUsb + ioSlot, new Action<ushort>(o => dmChassis.ExecuteSwitch(o, ioSlot, eRoutingSignalType.UsbInput))); trilist.SetUShortSigAction(joinMap.OutputUsb + ioSlot, new Action<ushort>(o => dmChassis.ExecuteSwitch(o, ioSlot, eRoutingSignalType.UsbOutput)));
trilist.SetUShortSigAction(joinMap.InputUsb + ioSlot, new Action<ushort>(o => dmChassis.ExecuteSwitch(o, ioSlot, eRoutingSignalType.UsbInput)));
if (dmChassis.TxDictionary.ContainsKey(ioSlot))
{ if (dmChassis.TxDictionary.ContainsKey(ioSlot))
Debug.Console(2, "Creating Tx Feedbacks {0}", ioSlot); {
var txKey = dmChassis.TxDictionary[ioSlot]; Debug.Console(2, "Creating Tx Feedbacks {0}", ioSlot);
var basicTxDevice = DeviceManager.GetDeviceForKey(txKey) as BasicDmTxControllerBase; var txKey = dmChassis.TxDictionary[ioSlot];
var basicTxDevice = DeviceManager.GetDeviceForKey(txKey) as BasicDmTxControllerBase;
var advancedTxDevice = basicTxDevice as DmTxControllerBase;
var advancedTxDevice = basicTxDevice as DmTxControllerBase;
if (dmChassis.Chassis is DmMd8x8Cpu3 || dmChassis.Chassis is DmMd8x8Cpu3rps
|| dmChassis.Chassis is DmMd16x16Cpu3 || dmChassis.Chassis is DmMd16x16Cpu3rps if (dmChassis.Chassis is DmMd8x8Cpu3 || dmChassis.Chassis is DmMd8x8Cpu3rps
|| dmChassis.Chassis is DmMd32x32Cpu3 || dmChassis.Chassis is DmMd32x32Cpu3rps) || dmChassis.Chassis is DmMd16x16Cpu3 || dmChassis.Chassis is DmMd16x16Cpu3rps
{ || dmChassis.Chassis is DmMd32x32Cpu3 || dmChassis.Chassis is DmMd32x32Cpu3rps)
dmChassis.InputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.InputEndpointOnline + ioSlot]); {
} dmChassis.InputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.InputEndpointOnline + ioSlot]);
else }
{ else
if (advancedTxDevice != null) {
{ if (advancedTxDevice != null)
advancedTxDevice.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.InputEndpointOnline + ioSlot]); {
Debug.Console(2, "Linking Tx Online Feedback from Advanced Transmitter at input {0}", ioSlot); advancedTxDevice.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.InputEndpointOnline + ioSlot]);
} Debug.Console(2, "Linking Tx Online Feedback from Advanced Transmitter at input {0}", ioSlot);
else if (dmChassis.InputEndpointOnlineFeedbacks[ioSlot] != null) }
{ else if (dmChassis.InputEndpointOnlineFeedbacks[ioSlot] != null)
Debug.Console(2, "Linking Tx Online Feedback from Input Card {0}", ioSlot); {
dmChassis.InputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.InputEndpointOnline + ioSlot]); Debug.Console(2, "Linking Tx Online Feedback from Input Card {0}", ioSlot);
} dmChassis.InputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.InputEndpointOnline + ioSlot]);
} }
}
if (basicTxDevice != null && advancedTxDevice == null)
trilist.BooleanInput[joinMap.TxAdvancedIsPresent + ioSlot].BoolValue = true; if (basicTxDevice != null && advancedTxDevice == null)
trilist.BooleanInput[joinMap.TxAdvancedIsPresent + ioSlot].BoolValue = true;
if (advancedTxDevice != null)
{ if (advancedTxDevice != null)
advancedTxDevice.AnyVideoInput.VideoStatus.VideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.VideoSyncStatus + ioSlot]); {
} advancedTxDevice.AnyVideoInput.VideoStatus.VideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.VideoSyncStatus + ioSlot]);
else if(advancedTxDevice == null || basicTxDevice != null) }
{ else if(advancedTxDevice == null || basicTxDevice != null)
Debug.Console(1, "Setting up actions and feedbacks on input card {0}", ioSlot); {
dmChassis.VideoInputSyncFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.VideoSyncStatus + ioSlot]); Debug.Console(1, "Setting up actions and feedbacks on input card {0}", ioSlot);
dmChassis.VideoInputSyncFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.VideoSyncStatus + ioSlot]);
var inputPort = dmChassis.InputPorts[string.Format("inputCard{0}--hdmiIn", ioSlot)];
if (inputPort != null) var inputPort = dmChassis.InputPorts[string.Format("inputCard{0}--hdmiIn", ioSlot)];
{ if (inputPort != null)
Debug.Console(1, "Port value for input card {0} is set", ioSlot); {
var port = inputPort.Port; Debug.Console(1, "Port value for input card {0} is set", ioSlot);
var port = inputPort.Port;
if (port != null)
{ if (port != null)
if (port is HdmiInputWithCEC) {
{ if (port is HdmiInputWithCEC)
Debug.Console(1, "Port is HdmiInputWithCec"); {
Debug.Console(1, "Port is HdmiInputWithCec");
var hdmiInPortWCec = port as HdmiInputWithCEC;
var hdmiInPortWCec = port as HdmiInputWithCEC;
if (hdmiInPortWCec.HdcpSupportedLevel != eHdcpSupportedLevel.Unknown)
{ if (hdmiInPortWCec.HdcpSupportedLevel != eHdcpSupportedLevel.Unknown)
SetHdcpStateAction(true, hdmiInPortWCec, joinMap.HdcpSupportState + ioSlot, trilist); {
} SetHdcpStateAction(true, hdmiInPortWCec, joinMap.HdcpSupportState + ioSlot, trilist);
}
dmChassis.InputCardHdcpCapabilityFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.HdcpSupportState + ioSlot]);
dmChassis.InputCardHdcpCapabilityFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.HdcpSupportState + ioSlot]);
if(dmChassis.InputCardHdcpCapabilityTypes.ContainsKey(ioSlot))
trilist.UShortInput[joinMap.HdcpSupportCapability + ioSlot].UShortValue = (ushort)dmChassis.InputCardHdcpCapabilityTypes[ioSlot]; if(dmChassis.InputCardHdcpCapabilityTypes.ContainsKey(ioSlot))
else trilist.UShortInput[joinMap.HdcpSupportCapability + ioSlot].UShortValue = (ushort)dmChassis.InputCardHdcpCapabilityTypes[ioSlot];
trilist.UShortInput[joinMap.HdcpSupportCapability + ioSlot].UShortValue = 1; else
} trilist.UShortInput[joinMap.HdcpSupportCapability + ioSlot].UShortValue = 1;
} }
} }
else }
{ else
inputPort = dmChassis.InputPorts[string.Format("inputCard{0}--dmIn", ioSlot)]; {
inputPort = dmChassis.InputPorts[string.Format("inputCard{0}--dmIn", ioSlot)];
if(inputPort != null)
{ if(inputPort != null)
var port = inputPort.Port; {
var port = inputPort.Port;
if (port is DMInputPortWithCec)
{ if (port is DMInputPortWithCec)
Debug.Console(1, "Port is DMInputPortWithCec"); {
Debug.Console(1, "Port is DMInputPortWithCec");
var dmInPortWCec = port as DMInputPortWithCec;
var dmInPortWCec = port as DMInputPortWithCec;
if (dmInPortWCec != null)
{ if (dmInPortWCec != null)
SetHdcpStateAction(dmChassis.PropertiesConfig.InputSlotSupportsHdcp2[ioSlot], dmInPortWCec, joinMap.HdcpSupportState + ioSlot, trilist); {
} SetHdcpStateAction(dmChassis.PropertiesConfig.InputSlotSupportsHdcp2[ioSlot], dmInPortWCec, joinMap.HdcpSupportState + ioSlot, trilist);
}
dmChassis.InputCardHdcpCapabilityFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.HdcpSupportState + ioSlot]);
dmChassis.InputCardHdcpCapabilityFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.HdcpSupportState + ioSlot]);
if (dmChassis.InputCardHdcpCapabilityTypes.ContainsKey(ioSlot))
trilist.UShortInput[joinMap.HdcpSupportCapability + ioSlot].UShortValue = (ushort)dmChassis.InputCardHdcpCapabilityTypes[ioSlot]; if (dmChassis.InputCardHdcpCapabilityTypes.ContainsKey(ioSlot))
else trilist.UShortInput[joinMap.HdcpSupportCapability + ioSlot].UShortValue = (ushort)dmChassis.InputCardHdcpCapabilityTypes[ioSlot];
trilist.UShortInput[joinMap.HdcpSupportCapability + ioSlot].UShortValue = 1; else
} trilist.UShortInput[joinMap.HdcpSupportCapability + ioSlot].UShortValue = 1;
} }
} }
} }
} }
else }
{ else
dmChassis.VideoInputSyncFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.VideoSyncStatus + ioSlot]); {
dmChassis.VideoInputSyncFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.VideoSyncStatus + ioSlot]);
var inputPort = dmChassis.InputPorts[string.Format("inputCard{0}--hdmiIn", ioSlot)];
if (inputPort != null) var inputPort = dmChassis.InputPorts[string.Format("inputCard{0}--hdmiIn", ioSlot)];
{ if (inputPort != null)
var hdmiPort = inputPort.Port as EndpointHdmiInput; {
var hdmiPort = inputPort.Port as EndpointHdmiInput;
if (hdmiPort != null)
{ if (hdmiPort != null)
SetHdcpStateAction(true, hdmiPort, joinMap.HdcpSupportState + ioSlot, trilist); {
dmChassis.InputCardHdcpCapabilityFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.HdcpSupportState + ioSlot]); SetHdcpStateAction(true, hdmiPort, joinMap.HdcpSupportState + ioSlot, trilist);
} dmChassis.InputCardHdcpCapabilityFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.HdcpSupportState + ioSlot]);
} }
} }
if (dmChassis.RxDictionary.ContainsKey(ioSlot)) }
{
Debug.Console(2, "Creating Rx Feedbacks {0}", ioSlot); if (dmChassis.RxDictionary.ContainsKey(ioSlot))
var rxKey = dmChassis.RxDictionary[ioSlot]; {
var rxDevice = DeviceManager.GetDeviceForKey(rxKey) as DmRmcControllerBase; Debug.Console(2, "Creating Rx Feedbacks {0}", ioSlot);
var hdBaseTDevice = DeviceManager.GetDeviceForKey(rxKey) as DmHdBaseTControllerBase; var rxKey = dmChassis.RxDictionary[ioSlot];
if (dmChassis.Chassis is DmMd8x8Cpu3 || dmChassis.Chassis is DmMd8x8Cpu3rps var rxDevice = DeviceManager.GetDeviceForKey(rxKey) as DmRmcControllerBase;
|| dmChassis.Chassis is DmMd16x16Cpu3 || dmChassis.Chassis is DmMd16x16Cpu3rps var hdBaseTDevice = DeviceManager.GetDeviceForKey(rxKey) as DmHdBaseTControllerBase;
|| dmChassis.Chassis is DmMd32x32Cpu3 || dmChassis.Chassis is DmMd32x32Cpu3rps || hdBaseTDevice != null) if (dmChassis.Chassis is DmMd8x8Cpu3 || dmChassis.Chassis is DmMd8x8Cpu3rps
{ || dmChassis.Chassis is DmMd16x16Cpu3 || dmChassis.Chassis is DmMd16x16Cpu3rps
dmChassis.OutputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.OutputEndpointOnline + ioSlot]); || dmChassis.Chassis is DmMd32x32Cpu3 || dmChassis.Chassis is DmMd32x32Cpu3rps || hdBaseTDevice != null)
} {
else if (rxDevice != null) dmChassis.OutputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.OutputEndpointOnline + ioSlot]);
{ }
rxDevice.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.OutputEndpointOnline + ioSlot]); else if (rxDevice != null)
} {
} rxDevice.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.OutputEndpointOnline + ioSlot]);
}
// Feedback }
dmChassis.VideoOutputFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.OutputVideo + ioSlot]);
dmChassis.AudioOutputFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.OutputAudio + ioSlot]); // Feedback
dmChassis.UsbOutputRoutedToFeebacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.OutputUsb + ioSlot]); dmChassis.VideoOutputFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.OutputVideo + ioSlot]);
dmChassis.UsbInputRoutedToFeebacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.InputUsb + ioSlot]); dmChassis.AudioOutputFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.OutputAudio + ioSlot]);
dmChassis.UsbOutputRoutedToFeebacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.OutputUsb + ioSlot]);
dmChassis.UsbInputRoutedToFeebacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.InputUsb + ioSlot]);
dmChassis.OutputNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputNames + ioSlot]);
dmChassis.InputNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.InputNames + ioSlot]); dmChassis.OutputNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputNames + ioSlot]);
dmChassis.OutputVideoRouteNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputCurrentVideoInputNames + ioSlot]); dmChassis.InputNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.InputNames + ioSlot]);
dmChassis.OutputAudioRouteNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputCurrentAudioInputNames + ioSlot]); dmChassis.OutputVideoRouteNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputCurrentVideoInputNames + ioSlot]);
} dmChassis.OutputAudioRouteNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputCurrentAudioInputNames + ioSlot]);
}
dmChassis.OutputDisabledByHdcpFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.OutputDisabledByHdcp + ioSlot]);
static void SetHdcpStateAction(bool hdcpTypeSimple, HdmiInputWithCEC port, uint join, BasicTriList trilist) }
{ }
if (hdcpTypeSimple)
{ static void SetHdcpStateAction(bool hdcpTypeSimple, HdmiInputWithCEC port, uint join, BasicTriList trilist)
trilist.SetUShortSigAction(join, {
new Action<ushort>(s => if (hdcpTypeSimple)
{ {
if (s == 0) trilist.SetUShortSigAction(join,
{ new Action<ushort>(s =>
port.HdcpSupportOff(); {
} if (s == 0)
else if (s > 0) {
{ port.HdcpSupportOff();
port.HdcpSupportOn(); }
} else if (s > 0)
})); {
} port.HdcpSupportOn();
else }
{ }));
trilist.SetUShortSigAction(join, }
new Action<ushort>(u => else
{ {
port.HdcpReceiveCapability = (eHdcpCapabilityType)u; trilist.SetUShortSigAction(join,
})); new Action<ushort>(u =>
} {
} port.HdcpReceiveCapability = (eHdcpCapabilityType)u;
}));
static void SetHdcpStateAction(bool hdcpTypeSimple, EndpointHdmiInput port, uint join, BasicTriList trilist) }
{ }
if (hdcpTypeSimple)
{ static void SetHdcpStateAction(bool hdcpTypeSimple, EndpointHdmiInput port, uint join, BasicTriList trilist)
trilist.SetUShortSigAction(join, {
new Action<ushort>(s => if (hdcpTypeSimple)
{ {
if (s == 0) trilist.SetUShortSigAction(join,
{ new Action<ushort>(s =>
port.HdcpSupportOff(); {
} if (s == 0)
else if (s > 0) {
{ port.HdcpSupportOff();
port.HdcpSupportOn(); }
} else if (s > 0)
})); {
} port.HdcpSupportOn();
else }
{ }));
trilist.SetUShortSigAction(join, }
new Action<ushort>(u => else
{ {
port.HdcpCapability = (eHdcpCapabilityType)u; trilist.SetUShortSigAction(join,
})); new Action<ushort>(u =>
} {
} port.HdcpCapability = (eHdcpCapabilityType)u;
}));
static void SetHdcpStateAction(bool supportsHdcp2, DMInputPortWithCec port, uint join, BasicTriList trilist) }
{ }
if (!supportsHdcp2)
{ static void SetHdcpStateAction(bool supportsHdcp2, DMInputPortWithCec port, uint join, BasicTriList trilist)
trilist.SetUShortSigAction(join, {
new Action<ushort>(s => if (!supportsHdcp2)
{ {
if (s == 0) trilist.SetUShortSigAction(join,
{ new Action<ushort>(s =>
port.HdcpSupportOff(); {
} if (s == 0)
else if (s > 0) {
{ port.HdcpSupportOff();
port.HdcpSupportOn(); }
} else if (s > 0)
})); {
} port.HdcpSupportOn();
else }
{ }));
trilist.SetUShortSigAction(join, }
new Action<ushort>(u => else
{ {
port.HdcpReceiveCapability = (eHdcpCapabilityType)u; trilist.SetUShortSigAction(join,
})); new Action<ushort>(u =>
} {
} port.HdcpReceiveCapability = (eHdcpCapabilityType)u;
}));
} }
}
}
} }

View file

@ -57,7 +57,7 @@ namespace PepperDash.Essentials.Bridges
trilist.UShortInput[joinMap.HdcpSupportCapability].UShortValue = (ushort)tx.HdcpSupportCapability; trilist.UShortInput[joinMap.HdcpSupportCapability].UShortValue = (ushort)tx.HdcpSupportCapability;
if(txR.InputPorts[DmPortName.HdmiIn] != null) if (txR.InputPorts[DmPortName.HdmiIn] != null)
{ {
var inputPort = txR.InputPorts[DmPortName.HdmiIn]; var inputPort = txR.InputPorts[DmPortName.HdmiIn];
@ -71,7 +71,7 @@ namespace PepperDash.Essentials.Bridges
SetHdcpCapabilityAction(hdcpTypeSimple, port, joinMap.Port1HdcpState, trilist); SetHdcpCapabilityAction(hdcpTypeSimple, port, joinMap.Port1HdcpState, trilist);
} }
} }
if (txR.InputPorts[DmPortName.HdmiIn1] != null) if (txR.InputPorts[DmPortName.HdmiIn1] != null)
{ {
var inputPort = txR.InputPorts[DmPortName.HdmiIn1]; var inputPort = txR.InputPorts[DmPortName.HdmiIn1];
@ -103,6 +103,22 @@ namespace PepperDash.Essentials.Bridges
} }
} }
var txFreeRun = tx as IHasFreeRun;
if (txFreeRun != null)
{
txFreeRun.FreeRunEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.FreeRunEnabled]);
trilist.SetBoolSigAction(joinMap.FreeRunEnabled, new Action<bool>(b => txFreeRun.SetFreeRunEnabled(b)));
}
var txVga = tx as IVgaBrightnessContrastControls;
{
txVga.VgaBrightnessFeedback.LinkInputSig(trilist.UShortInput[joinMap.VgaBrightness]);
txVga.VgaContrastFeedback.LinkInputSig(trilist.UShortInput[joinMap.VgaContrast]);
trilist.SetUShortSigAction(joinMap.VgaBrightness, new Action<ushort>(u => txVga.SetVgaBrightness(u)));
trilist.SetUShortSigAction(joinMap.VgaContrast, new Action<ushort>(u => txVga.SetVgaContrast(u)));
}
} }
static void SetHdcpCapabilityAction(bool hdcpTypeSimple, EndpointHdmiInput port, uint join, BasicTriList trilist) static void SetHdcpCapabilityAction(bool hdcpTypeSimple, EndpointHdmiInput port, uint join, BasicTriList trilist)

View file

@ -1,110 +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.Bridges namespace PepperDash.Essentials.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.GetJoinMapForDevice(joinMapKey); var joinMapSerialized = JoinMapHelper.GetJoinMapForDevice(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;
// Occupied status
trilist.SetSigTrueAction(joinMap.ForceOccupied, new Action(() => occController.ForceOccupied())); trilist.OnlineStatusChange += new Crestron.SimplSharpPro.OnlineStatusChangeEventHandler((d, args) =>
trilist.SetSigTrueAction(joinMap.ForceVacant, new Action(() => occController.ForceVacant())); {
occController.RoomIsOccupiedFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RoomOccupiedFeedback]); if (args.DeviceOnLine)
occController.RoomIsOccupiedFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.RoomVacantFeedback]); {
occController.RawOccupancyFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RawOccupancyFeedback]); trilist.StringInput[joinMap.Name].StringValue = occController.Name;
}
// Timouts }
trilist.SetUShortSigAction(joinMap.Timeout, new Action<ushort>((u) => occController.SetRemoteTimeout(u))); );
occController.CurrentTimeoutFeedback.LinkInputSig(trilist.UShortInput[joinMap.Timeout]);
occController.LocalTimoutFeedback.LinkInputSig(trilist.UShortInput[joinMap.TimeoutLocalFeedback]); // Occupied status
trilist.SetSigTrueAction(joinMap.ForceOccupied, new Action(() => occController.ForceOccupied()));
// LED Flash trilist.SetSigTrueAction(joinMap.ForceVacant, new Action(() => occController.ForceVacant()));
trilist.SetSigTrueAction(joinMap.EnableLedFlash, new Action(() => occController.SetLedFlashEnable(true))); occController.RoomIsOccupiedFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RoomOccupiedFeedback]);
trilist.SetSigTrueAction(joinMap.DisableLedFlash, new Action(() => occController.SetLedFlashEnable(false))); occController.RoomIsOccupiedFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.RoomVacantFeedback]);
occController.LedFlashEnabledFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.EnableLedFlash]); occController.RawOccupancyFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RawOccupancyFeedback]);
trilist.SetBoolSigAction(joinMap.EnableRawStates, new Action<bool>((b) => occController.EnableRawStates(b)));
// Short Timeout
trilist.SetSigTrueAction(joinMap.EnableShortTimeout, new Action(() => occController.SetShortTimeoutState(true))); // Timouts
trilist.SetSigTrueAction(joinMap.DisableShortTimeout, new Action(() => occController.SetShortTimeoutState(false))); trilist.SetUShortSigAction(joinMap.Timeout, new Action<ushort>((u) => occController.SetRemoteTimeout(u)));
occController.ShortTimeoutEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.EnableShortTimeout]); occController.CurrentTimeoutFeedback.LinkInputSig(trilist.UShortInput[joinMap.Timeout]);
occController.LocalTimoutFeedback.LinkInputSig(trilist.UShortInput[joinMap.TimeoutLocalFeedback]);
// PIR Sensor
trilist.SetSigTrueAction(joinMap.EnablePir, new Action(() => occController.SetPirEnable(true))); // LED Flash
trilist.SetSigTrueAction(joinMap.DisablePir, new Action(() => occController.SetPirEnable(false))); trilist.SetSigTrueAction(joinMap.EnableLedFlash, new Action(() => occController.SetLedFlashEnable(true)));
occController.PirSensorEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.EnablePir]); trilist.SetSigTrueAction(joinMap.DisableLedFlash, new Action(() => occController.SetLedFlashEnable(false)));
occController.LedFlashEnabledFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.EnableLedFlash]);
// PIR Sensitivity in Occupied State
trilist.SetBoolSigAction(joinMap.IncrementPirInOccupiedState, new Action<bool>((b) => occController.IncrementPirSensitivityInOccupiedState(b))); // Short Timeout
trilist.SetBoolSigAction(joinMap.DecrementPirInOccupiedState, new Action<bool>((b) => occController.DecrementPirSensitivityInOccupiedState(b))); trilist.SetSigTrueAction(joinMap.EnableShortTimeout, new Action(() => occController.SetShortTimeoutState(true)));
occController.PirSensitivityInOccupiedStateFeedback.LinkInputSig(trilist.UShortInput[joinMap.PirSensitivityInOccupiedState]); trilist.SetSigTrueAction(joinMap.DisableShortTimeout, new Action(() => occController.SetShortTimeoutState(false)));
occController.ShortTimeoutEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.EnableShortTimeout]);
// PIR Sensitivity in Vacant State
trilist.SetBoolSigAction(joinMap.IncrementPirInVacantState, new Action<bool>((b) => occController.IncrementPirSensitivityInVacantState(b))); // PIR Sensor
trilist.SetBoolSigAction(joinMap.DecrementPirInVacantState, new Action<bool>((b) => occController.DecrementPirSensitivityInVacantState(b))); trilist.SetSigTrueAction(joinMap.EnablePir, new Action(() => occController.SetPirEnable(true)));
occController.PirSensitivityInVacantStateFeedback.LinkInputSig(trilist.UShortInput[joinMap.PirSensitivityInVacantState]); trilist.SetSigTrueAction(joinMap.DisablePir, new Action(() => occController.SetPirEnable(false)));
#endregion occController.PirSensorEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.EnablePir]);
#region Dual Technology Sensor Stuff // PIR Sensitivity in Occupied State
var odtOccController = occController as GlsOdtOccupancySensorController; trilist.SetBoolSigAction(joinMap.IncrementPirInOccupiedState, new Action<bool>((b) => occController.IncrementPirSensitivityInOccupiedState(b)));
trilist.SetBoolSigAction(joinMap.DecrementPirInOccupiedState, new Action<bool>((b) => occController.DecrementPirSensitivityInOccupiedState(b)));
if (odtOccController != null) occController.PirSensitivityInOccupiedStateFeedback.LinkInputSig(trilist.UShortInput[joinMap.PirSensitivityInOccupiedState]);
{
// OR When Vacated // PIR Sensitivity in Vacant State
trilist.SetBoolSigAction(joinMap.OrWhenVacated, new Action<bool>((b) => odtOccController.SetOrWhenVacatedState(b))); trilist.SetBoolSigAction(joinMap.IncrementPirInVacantState, new Action<bool>((b) => occController.IncrementPirSensitivityInVacantState(b)));
odtOccController.OrWhenVacatedFeedback.LinkInputSig(trilist.BooleanInput[joinMap.OrWhenVacated]); trilist.SetBoolSigAction(joinMap.DecrementPirInVacantState, new Action<bool>((b) => occController.DecrementPirSensitivityInVacantState(b)));
occController.PirSensitivityInVacantStateFeedback.LinkInputSig(trilist.UShortInput[joinMap.PirSensitivityInVacantState]);
// AND When Vacated #endregion
trilist.SetBoolSigAction(joinMap.AndWhenVacated, new Action<bool>((b) => odtOccController.SetAndWhenVacatedState(b)));
odtOccController.AndWhenVacatedFeedback.LinkInputSig(trilist.BooleanInput[joinMap.AndWhenVacated]); #region Dual Technology Sensor Stuff
var odtOccController = occController as GlsOdtOccupancySensorController;
// Ultrasonic A Sensor
trilist.SetSigTrueAction(joinMap.EnableUsA, new Action(() => odtOccController.SetUsAEnable(true))); if (odtOccController != null)
trilist.SetSigTrueAction(joinMap.DisableUsA, new Action(() => odtOccController.SetUsAEnable(false))); {
odtOccController.UltrasonicAEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.EnableUsA]); // OR When Vacated
trilist.SetBoolSigAction(joinMap.OrWhenVacated, new Action<bool>((b) => odtOccController.SetOrWhenVacatedState(b)));
// Ultrasonic B Sensor odtOccController.OrWhenVacatedFeedback.LinkInputSig(trilist.BooleanInput[joinMap.OrWhenVacated]);
trilist.SetSigTrueAction(joinMap.EnableUsB, new Action(() => odtOccController.SetUsBEnable(true)));
trilist.SetSigTrueAction(joinMap.DisableUsB, new Action(() => odtOccController.SetUsBEnable(false))); // AND When Vacated
odtOccController.UltrasonicAEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.EnableUsB]); trilist.SetBoolSigAction(joinMap.AndWhenVacated, new Action<bool>((b) => odtOccController.SetAndWhenVacatedState(b)));
odtOccController.AndWhenVacatedFeedback.LinkInputSig(trilist.BooleanInput[joinMap.AndWhenVacated]);
// US Sensitivity in Occupied State
trilist.SetBoolSigAction(joinMap.IncrementUsInOccupiedState, new Action<bool>((b) => odtOccController.IncrementUsSensitivityInOccupiedState(b))); // Ultrasonic A Sensor
trilist.SetBoolSigAction(joinMap.DecrementUsInOccupiedState, new Action<bool>((b) => odtOccController.DecrementUsSensitivityInOccupiedState(b))); trilist.SetSigTrueAction(joinMap.EnableUsA, new Action(() => odtOccController.SetUsAEnable(true)));
odtOccController.UltrasonicSensitivityInOccupiedStateFeedback.LinkInputSig(trilist.UShortInput[joinMap.UsSensitivityInOccupiedState]); trilist.SetSigTrueAction(joinMap.DisableUsA, new Action(() => odtOccController.SetUsAEnable(false)));
odtOccController.UltrasonicAEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.EnableUsA]);
// US Sensitivity in Vacant State
trilist.SetBoolSigAction(joinMap.IncrementUsInVacantState, new Action<bool>((b) => odtOccController.IncrementUsSensitivityInVacantState(b))); // Ultrasonic B Sensor
trilist.SetBoolSigAction(joinMap.DecrementUsInVacantState, new Action<bool>((b) => odtOccController.DecrementUsSensitivityInVacantState(b))); trilist.SetSigTrueAction(joinMap.EnableUsB, new Action(() => odtOccController.SetUsBEnable(true)));
odtOccController.UltrasonicSensitivityInVacantStateFeedback.LinkInputSig(trilist.UShortInput[joinMap.UsSensitivityInVacantState]); trilist.SetSigTrueAction(joinMap.DisableUsB, new Action(() => odtOccController.SetUsBEnable(false)));
odtOccController.UltrasonicAEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.EnableUsB]);
}
#endregion // US Sensitivity in Occupied State
} trilist.SetBoolSigAction(joinMap.IncrementUsInOccupiedState, new Action<bool>((b) => odtOccController.IncrementUsSensitivityInOccupiedState(b)));
} trilist.SetBoolSigAction(joinMap.DecrementUsInOccupiedState, new Action<bool>((b) => odtOccController.DecrementUsSensitivityInOccupiedState(b)));
odtOccController.UltrasonicSensitivityInOccupiedStateFeedback.LinkInputSig(trilist.UShortInput[joinMap.UsSensitivityInOccupiedState]);
// US Sensitivity in Vacant State
trilist.SetBoolSigAction(joinMap.IncrementUsInVacantState, new Action<bool>((b) => odtOccController.IncrementUsSensitivityInVacantState(b)));
trilist.SetBoolSigAction(joinMap.DecrementUsInVacantState, new Action<bool>((b) => odtOccController.DecrementUsSensitivityInVacantState(b)));
odtOccController.UltrasonicSensitivityInVacantStateFeedback.LinkInputSig(trilist.UShortInput[joinMap.UsSensitivityInVacantState]);
//Sensor Raw States
odtOccController.RawOccupancyPirFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RawOccupancyPirFeedback]);
odtOccController.RawOccupancyUsFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RawOccupancyUsFeedback]);
}
#endregion
}
}
} }

View file

@ -0,0 +1,128 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro.DeviceSupport;
using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Devices.Common;
using Newtonsoft.Json;
namespace PepperDash.Essentials.Bridges
{
public static class IRSetTopBoxBaseApiExtensions
{
public static void LinkToApi(this PepperDash.Essentials.Devices.Common.IRSetTopBoxBase stbDevice, BasicTriList trilist, uint joinStart, string joinMapKey)
{
SetTopBoxControllerJoinMap joinMap = new SetTopBoxControllerJoinMap();
var joinMapSerialized = JoinMapHelper.GetJoinMapForDevice(joinMapKey);
if (!string.IsNullOrEmpty(joinMapSerialized))
joinMap = JsonConvert.DeserializeObject<SetTopBoxControllerJoinMap>(joinMapSerialized);
joinMap.OffsetJoinNumbers(joinStart);
Debug.Console(1, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
Debug.Console(0, "Linking to Display: {0}", stbDevice.Name);
trilist.StringInput[joinMap.Name].StringValue = stbDevice.Name;
var stbBase = stbDevice as ISetTopBoxControls;
if (stbBase != null)
{
trilist.BooleanInput[joinMap.HasDpad].BoolValue = stbBase.HasDpad;
trilist.BooleanInput[joinMap.HasNumeric].BoolValue = stbBase.HasNumeric;
trilist.BooleanInput[joinMap.HasDvr].BoolValue = stbBase.HasDvr;
trilist.BooleanInput[joinMap.HasPresets].BoolValue = stbBase.HasPresets;
trilist.SetBoolSigAction(joinMap.DvrList, (b) => stbBase.DvrList(b));
trilist.SetBoolSigAction(joinMap.Replay, (b) => stbBase.Replay(b));
trilist.SetStringSigAction(joinMap.LoadPresets, (s) => stbBase.LoadPresets(s));
}
var stbPower = stbDevice as IPower;
if (stbPower != null)
{
trilist.SetSigTrueAction(joinMap.PowerOn, () => stbPower.PowerOn());
trilist.SetSigTrueAction(joinMap.PowerOff, () => stbPower.PowerOff());
trilist.SetSigTrueAction(joinMap.PowerToggle, () => stbPower.PowerToggle());
}
var stbDPad = stbDevice as IDPad;
if (stbDPad != null)
{
trilist.SetBoolSigAction(joinMap.Up, (b) => stbDPad.Up(b));
trilist.SetBoolSigAction(joinMap.Down, (b) => stbDPad.Down(b));
trilist.SetBoolSigAction(joinMap.Left, (b) => stbDPad.Left(b));
trilist.SetBoolSigAction(joinMap.Right, (b) => stbDPad.Right(b));
trilist.SetBoolSigAction(joinMap.Select, (b) => stbDPad.Select(b));
trilist.SetBoolSigAction(joinMap.Menu, (b) => stbDPad.Menu(b));
trilist.SetBoolSigAction(joinMap.Exit, (b) => stbDPad.Exit(b));
}
var stbChannel = stbDevice as IChannel;
if (stbChannel != null)
{
trilist.SetBoolSigAction(joinMap.ChannelUp, (b) => stbChannel.ChannelUp(b));
trilist.SetBoolSigAction(joinMap.ChannelDown, (b) => stbChannel.ChannelDown(b));
trilist.SetBoolSigAction(joinMap.LastChannel, (b) => stbChannel.LastChannel(b));
trilist.SetBoolSigAction(joinMap.Guide, (b) => stbChannel.Guide(b));
trilist.SetBoolSigAction(joinMap.Info, (b) => stbChannel.Info(b));
trilist.SetBoolSigAction(joinMap.Exit, (b) => stbChannel.Exit(b));
}
var stbColor = stbDevice as IColor;
if (stbColor != null)
{
trilist.SetBoolSigAction(joinMap.Red, (b) => stbColor.Red(b));
trilist.SetBoolSigAction(joinMap.Green, (b) => stbColor.Green(b));
trilist.SetBoolSigAction(joinMap.Yellow, (b) => stbColor.Yellow(b));
trilist.SetBoolSigAction(joinMap.Blue, (b) => stbColor.Blue(b));
}
var stbKeypad = stbDevice as ISetTopBoxNumericKeypad;
if (stbKeypad != null)
{
trilist.StringInput[joinMap.KeypadAccessoryButton1Label].StringValue = stbKeypad.KeypadAccessoryButton1Label;
trilist.StringInput[joinMap.KeypadAccessoryButton2Label].StringValue = stbKeypad.KeypadAccessoryButton2Label;
trilist.BooleanInput[joinMap.HasKeypadAccessoryButton1].BoolValue = stbKeypad.HasKeypadAccessoryButton1;
trilist.BooleanInput[joinMap.HasKeypadAccessoryButton2].BoolValue = stbKeypad.HasKeypadAccessoryButton2;
trilist.SetBoolSigAction(joinMap.Digit0, (b) => stbKeypad.Digit0(b));
trilist.SetBoolSigAction(joinMap.Digit1, (b) => stbKeypad.Digit1(b));
trilist.SetBoolSigAction(joinMap.Digit2, (b) => stbKeypad.Digit2(b));
trilist.SetBoolSigAction(joinMap.Digit3, (b) => stbKeypad.Digit3(b));
trilist.SetBoolSigAction(joinMap.Digit4, (b) => stbKeypad.Digit4(b));
trilist.SetBoolSigAction(joinMap.Digit5, (b) => stbKeypad.Digit5(b));
trilist.SetBoolSigAction(joinMap.Digit6, (b) => stbKeypad.Digit6(b));
trilist.SetBoolSigAction(joinMap.Digit7, (b) => stbKeypad.Digit7(b));
trilist.SetBoolSigAction(joinMap.Digit8, (b) => stbKeypad.Digit8(b));
trilist.SetBoolSigAction(joinMap.Digit9, (b) => stbKeypad.Digit9(b));
trilist.SetBoolSigAction(joinMap.KeypadAccessoryButton1Press, (b) => stbKeypad.KeypadAccessoryButton1(b));
trilist.SetBoolSigAction(joinMap.KeypadAccessoryButton2Press, (b) => stbKeypad.KeypadAccessoryButton1(b));
trilist.SetBoolSigAction(joinMap.Dash, (b) => stbKeypad.Dash(b));
trilist.SetBoolSigAction(joinMap.KeypadEnter, (b) => stbKeypad.KeypadEnter(b));
}
var stbTransport = stbDevice as ITransport;
if (stbTransport != null)
{
trilist.SetBoolSigAction(joinMap.Play, (b) => stbTransport.Play(b));
trilist.SetBoolSigAction(joinMap.Pause, (b) => stbTransport.Pause(b));
trilist.SetBoolSigAction(joinMap.Rewind, (b) => stbTransport.Rewind(b));
trilist.SetBoolSigAction(joinMap.FFwd, (b) => stbTransport.FFwd(b));
trilist.SetBoolSigAction(joinMap.ChapMinus, (b) => stbTransport.ChapMinus(b));
trilist.SetBoolSigAction(joinMap.ChapPlus, (b) => stbTransport.ChapPlus(b));
trilist.SetBoolSigAction(joinMap.Stop, (b) => stbTransport.Stop(b));
trilist.SetBoolSigAction(joinMap.Record, (b) => stbTransport.Record(b));
}
}
}
}

View file

@ -0,0 +1,43 @@
using System.Linq;
using Crestron.SimplSharp.Reflection;
using PepperDash.Essentials.Core;
namespace PepperDash.Essentials.Bridges
{
public class C2nRthsControllerJoinMap:JoinMapBase
{
public uint IsOnline { get; set; }
public uint Name { get; set; }
public uint Temperature { get; set; }
public uint Humidity { get; set; }
public uint TemperatureFormat { get; set; }
public C2nRthsControllerJoinMap()
{
//digital
IsOnline = 1;
TemperatureFormat = 2;
//Analog
Temperature = 2;
Humidity = 3;
//serial
Name = 1;
}
public override void OffsetJoinNumbers(uint joinStart)
{
var joinOffset = joinStart - 1;
var properties =
GetType().GetCType().GetProperties().Where(p => p.PropertyType == typeof(uint)).ToList();
foreach (var propertyInfo in properties)
{
propertyInfo.SetValue(this, (uint)propertyInfo.GetValue(this, null) + joinOffset, null);
}
}
}
}

View file

@ -1,4 +1,4 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
@ -38,6 +38,10 @@ namespace PepperDash.Essentials.Bridges
/// Range reports high if corresponding input's transmitter supports bridging as a separate device for detailed AV switching, HDCP control, etc. /// Range reports high if corresponding input's transmitter supports bridging as a separate device for detailed AV switching, HDCP control, etc.
/// </summary> /// </summary>
public uint TxAdvancedIsPresent { get; set; } // indicates that there is an attached transmitter that should be bridged to be interacted with public uint TxAdvancedIsPresent { get; set; } // indicates that there is an attached transmitter that should be bridged to be interacted with
/// <summary>
/// Range reports high if corresponding output is disabled by HDCP.
/// </summary>
public uint OutputDisabledByHdcp { get; set; } // indicates that there is an attached transmitter that should be bridged to be interacted with
#endregion #endregion
#region Analogs #region Analogs
@ -101,6 +105,7 @@ namespace PepperDash.Essentials.Bridges
InputEndpointOnline = 500; //501-699 InputEndpointOnline = 500; //501-699
OutputEndpointOnline = 700; //701-899 OutputEndpointOnline = 700; //701-899
TxAdvancedIsPresent = 1000; //1001-1199 TxAdvancedIsPresent = 1000; //1001-1199
OutputDisabledByHdcp = 1200; //1201-1399
//Analog //Analog
OutputVideo = 100; //101-299 OutputVideo = 100; //101-299
@ -139,6 +144,8 @@ namespace PepperDash.Essentials.Bridges
OutputEndpointOnline = OutputEndpointOnline + joinOffset; OutputEndpointOnline = OutputEndpointOnline + joinOffset;
HdcpSupportState = HdcpSupportState + joinOffset; HdcpSupportState = HdcpSupportState + joinOffset;
HdcpSupportCapability = HdcpSupportCapability + joinOffset; HdcpSupportCapability = HdcpSupportCapability + joinOffset;
OutputDisabledByHdcp = OutputDisabledByHdcp + joinOffset;
TxAdvancedIsPresent = TxAdvancedIsPresent + joinOffset;
} }
} }
} }

View file

@ -18,6 +18,10 @@ namespace PepperDash.Essentials.Bridges
/// High when video sync is detected /// High when video sync is detected
/// </summary> /// </summary>
public uint VideoSyncStatus { get; set; } public uint VideoSyncStatus { get; set; }
/// <summary>
///
/// </summary>
public uint FreeRunEnabled { get; set; }
#endregion #endregion
#region Analogs #region Analogs
@ -41,6 +45,16 @@ namespace PepperDash.Essentials.Bridges
/// Sets and reports the current HDCP state for the corresponding input port /// Sets and reports the current HDCP state for the corresponding input port
/// </summary> /// </summary>
public uint Port2HdcpState { get; set; } public uint Port2HdcpState { get; set; }
/// <summary>
/// Sets and reports the current VGA Brightness level
/// </summary>
public uint VgaBrightness { get; set; }
/// <summary>
/// Sets and reports the current VGA Contrast level
/// </summary>
public uint VgaContrast { get; set; }
#endregion #endregion
#region Serials #region Serials
@ -56,6 +70,7 @@ namespace PepperDash.Essentials.Bridges
// Digital // Digital
IsOnline = 1; IsOnline = 1;
VideoSyncStatus = 2; VideoSyncStatus = 2;
FreeRunEnabled = 3;
// Serial // Serial
CurrentInputResolution = 1; CurrentInputResolution = 1;
// Analog // Analog
@ -64,6 +79,8 @@ namespace PepperDash.Essentials.Bridges
HdcpSupportCapability = 3; HdcpSupportCapability = 3;
Port1HdcpState = 4; Port1HdcpState = 4;
Port2HdcpState = 5; Port2HdcpState = 5;
VgaBrightness = 6;
VgaContrast = 7;
} }
public override void OffsetJoinNumbers(uint joinStart) public override void OffsetJoinNumbers(uint joinStart)
@ -72,12 +89,15 @@ namespace PepperDash.Essentials.Bridges
IsOnline = IsOnline + joinOffset; IsOnline = IsOnline + joinOffset;
VideoSyncStatus = VideoSyncStatus + joinOffset; VideoSyncStatus = VideoSyncStatus + joinOffset;
FreeRunEnabled = FreeRunEnabled + joinOffset;
CurrentInputResolution = CurrentInputResolution + joinOffset; CurrentInputResolution = CurrentInputResolution + joinOffset;
VideoInput = VideoInput + joinOffset; VideoInput = VideoInput + joinOffset;
AudioInput = AudioInput + joinOffset; AudioInput = AudioInput + joinOffset;
HdcpSupportCapability = HdcpSupportCapability + joinOffset; HdcpSupportCapability = HdcpSupportCapability + joinOffset;
Port1HdcpState = Port1HdcpState + joinOffset; Port1HdcpState = Port1HdcpState + joinOffset;
Port2HdcpState = Port2HdcpState + joinOffset; Port2HdcpState = Port2HdcpState + joinOffset;
VgaBrightness = VgaBrightness + joinOffset;
VgaContrast = VgaContrast + joinOffset;
} }
} }
} }

View file

@ -1,219 +1,238 @@
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 PepperDash.Essentials.Core; using PepperDash.Essentials.Core;
namespace PepperDash.Essentials.Bridges namespace PepperDash.Essentials.Bridges
{ {
public class GlsOccupancySensorBaseJoinMap : JoinMapBase public class GlsOccupancySensorBaseJoinMap : JoinMapBase
{ {
#region Digitals #region Digitals
/// <summary> /// <summary>
/// High when device is online /// High when device is online
/// </summary> /// </summary>
public uint IsOnline { get; set; } public uint IsOnline { get; set; }
/// <summary> /// <summary>
/// Forces the device to report occupied status /// Forces the device to report occupied status
/// </summary> /// </summary>
public uint ForceOccupied { get; set; } public uint ForceOccupied { get; set; }
/// <summary> /// <summary>
/// Forces the device to report vacant status /// Forces the device to report vacant status
/// </summary> /// </summary>
public uint ForceVacant { get; set; } public uint ForceVacant { get; set; }
/// <summary> /// <summary>
/// Enables raw status reporting /// Enables raw status reporting
/// </summary> /// </summary>
public uint EnableRawStates { get; set; } public uint EnableRawStates { get; set; }
/// <summary> /// <summary>
/// High when raw occupancy is detected /// High when raw occupancy is detected
/// </summary> /// </summary>
public uint RawOccupancyFeedback { get; set; } public uint RawOccupancyFeedback { get; set; }
/// <summary> /// <summary>
/// High when occupancy is detected /// High when PIR sensor detects motion
/// </summary> /// </summary>
public uint RoomOccupiedFeedback { get; set; } public uint RawOccupancyPirFeedback { get; set; }
/// <summary> /// <summary>
/// Hich when occupancy is detected in the grace period /// High when US sensor detects motion
/// </summary> /// </summary>
public uint GraceOccupancyDetectedFeedback { get; set; } public uint RawOccupancyUsFeedback { get; set; }
/// <summary> /// <summary>
/// High when vacancy is detected /// High when occupancy is detected
/// </summary> /// </summary>
public uint RoomVacantFeedback { get; set; } public uint RoomOccupiedFeedback { get; set; }
/// <summary>
/// <summary> /// Hich when occupancy is detected in the grace period
/// Enables the LED Flash when set high /// </summary>
/// </summary> public uint GraceOccupancyDetectedFeedback { get; set; }
public uint EnableLedFlash { get; set; } /// <summary>
/// <summary> /// High when vacancy is detected
/// Disables the LED flash when set high /// </summary>
/// </summary> public uint RoomVacantFeedback { get; set; }
public uint DisableLedFlash { get; set; }
/// <summary> /// <summary>
/// Enables the Short Timeout /// Enables the LED Flash when set high
/// </summary> /// </summary>
public uint EnableShortTimeout { get; set; } public uint EnableLedFlash { get; set; }
/// <summary> /// <summary>
/// Disables the Short Timout /// Disables the LED flash when set high
/// </summary> /// </summary>
public uint DisableShortTimeout { get; set; } public uint DisableLedFlash { get; set; }
/// <summary> /// <summary>
/// Set high to enable one technology to trigger occupancy /// Enables the Short Timeout
/// </summary> /// </summary>
public uint OrWhenVacated { get; set; } public uint EnableShortTimeout { get; set; }
/// <summary> /// <summary>
/// Set high to require both technologies to trigger occupancy /// Disables the Short Timout
/// </summary> /// </summary>
public uint AndWhenVacated { get; set; } public uint DisableShortTimeout { get; set; }
/// <summary> /// <summary>
/// Enables Ultrasonic Sensor A /// Set high to enable one technology to trigger occupancy
/// </summary> /// </summary>
public uint EnableUsA { get; set; } public uint OrWhenVacated { get; set; }
/// <summary> /// <summary>
/// Disables Ultrasonic Sensor A /// Set high to require both technologies to trigger occupancy
/// </summary> /// </summary>
public uint DisableUsA { get; set; } public uint AndWhenVacated { get; set; }
/// <summary> /// <summary>
/// Enables Ultrasonic Sensor B /// Enables Ultrasonic Sensor A
/// </summary> /// </summary>
public uint EnableUsB { get; set; } public uint EnableUsA { get; set; }
/// <summary> /// <summary>
/// Disables Ultrasonic Sensor B /// Disables Ultrasonic Sensor A
/// </summary> /// </summary>
public uint DisableUsB { get; set; } public uint DisableUsA { get; set; }
/// <summary> /// <summary>
/// Enables Pir /// Enables Ultrasonic Sensor B
/// </summary> /// </summary>
public uint EnablePir { get; set; } public uint EnableUsB { get; set; }
/// <summary> /// <summary>
/// Disables Pir /// Disables Ultrasonic Sensor B
/// </summary> /// </summary>
public uint DisablePir { get; set; } public uint DisableUsB { get; set; }
public uint IncrementUsInOccupiedState { get; set; } /// <summary>
public uint DecrementUsInOccupiedState { get; set; } /// Enables Pir
public uint IncrementUsInVacantState { get; set; } /// </summary>
public uint DecrementUsInVacantState { get; set; } public uint EnablePir { get; set; }
public uint IncrementPirInOccupiedState { get; set; } /// <summary>
public uint DecrementPirInOccupiedState { get; set; } /// Disables Pir
public uint IncrementPirInVacantState { get; set; } /// </summary>
public uint DecrementPirInVacantState { get; set; } public uint DisablePir { get; set; }
#endregion public uint IncrementUsInOccupiedState { get; set; }
public uint DecrementUsInOccupiedState { get; set; }
#region Analogs public uint IncrementUsInVacantState { get; set; }
/// <summary> public uint DecrementUsInVacantState { get; set; }
/// Sets adn reports the remote timeout value public uint IncrementPirInOccupiedState { get; set; }
/// </summary> public uint DecrementPirInOccupiedState { get; set; }
public uint Timeout { get; set; } public uint IncrementPirInVacantState { get; set; }
/// <summary> public uint DecrementPirInVacantState { get; set; }
/// Reports the local timeout value #endregion
/// </summary>
public uint TimeoutLocalFeedback { get; set; } #region Analogs
/// <summary> /// <summary>
/// Sets the minimum internal photo sensor value and reports the current level /// Sets adn reports the remote timeout value
/// </summary> /// </summary>
public uint InternalPhotoSensorValue { get; set; } public uint Timeout { get; set; }
/// <summary> /// <summary>
/// Sets the minimum external photo sensor value and reports the current level /// Reports the local timeout value
/// </summary> /// </summary>
public uint ExternalPhotoSensorValue { get; set; } public uint TimeoutLocalFeedback { get; set; }
/// <summary>
public uint UsSensitivityInOccupiedState { get; set; } /// Sets the minimum internal photo sensor value and reports the current level
/// </summary>
public uint UsSensitivityInVacantState { get; set; } public uint InternalPhotoSensorValue { get; set; }
/// <summary>
public uint PirSensitivityInOccupiedState { get; set; } /// Sets the minimum external photo sensor value and reports the current level
/// </summary>
public uint PirSensitivityInVacantState { get; set; } public uint ExternalPhotoSensorValue { get; set; }
#endregion
public uint UsSensitivityInOccupiedState { get; set; }
public GlsOccupancySensorBaseJoinMap()
{ public uint UsSensitivityInVacantState { get; set; }
IsOnline = 1;
ForceOccupied = 2; public uint PirSensitivityInOccupiedState { get; set; }
ForceVacant = 3;
EnableRawStates = 4; public uint PirSensitivityInVacantState { get; set; }
RoomOccupiedFeedback = 2; #endregion
GraceOccupancyDetectedFeedback = 3;
RoomVacantFeedback = 4; #region Serial
RawOccupancyFeedback = 5; public uint Name { get; set; }
EnableLedFlash = 11; #endregion
DisableLedFlash = 12;
EnableShortTimeout = 13; public GlsOccupancySensorBaseJoinMap()
DisableShortTimeout = 14; {
OrWhenVacated = 15; IsOnline = 1;
AndWhenVacated = 16; ForceOccupied = 2;
EnableUsA = 17; ForceVacant = 3;
DisableUsA = 18; EnableRawStates = 4;
EnableUsB = 19; RoomOccupiedFeedback = 2;
DisableUsB = 20; GraceOccupancyDetectedFeedback = 3;
EnablePir = 21; RoomVacantFeedback = 4;
DisablePir = 22; RawOccupancyFeedback = 5;
DisablePir = 23; RawOccupancyPirFeedback = 6;
IncrementUsInOccupiedState = 24; RawOccupancyUsFeedback = 7;
DecrementUsInOccupiedState = 25; EnableLedFlash = 11;
IncrementUsInVacantState = 26; DisableLedFlash = 12;
DecrementUsInVacantState = 27; EnableShortTimeout = 13;
IncrementPirInOccupiedState = 28; DisableShortTimeout = 14;
DecrementPirInOccupiedState = 29; OrWhenVacated = 15;
IncrementPirInVacantState = 30; AndWhenVacated = 16;
DecrementPirInVacantState = 31; EnableUsA = 17;
DisableUsA = 18;
Timeout = 1; EnableUsB = 19;
TimeoutLocalFeedback = 2; DisableUsB = 20;
InternalPhotoSensorValue = 3; EnablePir = 21;
ExternalPhotoSensorValue = 4; DisablePir = 22;
UsSensitivityInOccupiedState = 5; IncrementUsInOccupiedState = 23;
UsSensitivityInVacantState = 6; DecrementUsInOccupiedState = 24;
PirSensitivityInOccupiedState = 7; IncrementUsInVacantState = 25;
PirSensitivityInVacantState = 8; DecrementUsInVacantState = 26;
} IncrementPirInOccupiedState = 27;
DecrementPirInOccupiedState = 28;
public override void OffsetJoinNumbers(uint joinStart) IncrementPirInVacantState = 29;
{ DecrementPirInVacantState = 30;
var joinOffset = joinStart - 1;
Timeout = 1;
IsOnline = IsOnline + joinOffset; TimeoutLocalFeedback = 2;
ForceOccupied = ForceOccupied + joinOffset; InternalPhotoSensorValue = 3;
ForceVacant = ForceVacant + joinOffset; ExternalPhotoSensorValue = 4;
EnableRawStates = EnableRawStates + joinOffset; UsSensitivityInOccupiedState = 5;
RoomOccupiedFeedback = RoomOccupiedFeedback + joinOffset; UsSensitivityInVacantState = 6;
GraceOccupancyDetectedFeedback = GraceOccupancyDetectedFeedback + joinOffset; PirSensitivityInOccupiedState = 7;
RoomVacantFeedback = RoomVacantFeedback + joinOffset; PirSensitivityInVacantState = 8;
RawOccupancyFeedback = RawOccupancyFeedback + joinOffset;
EnableLedFlash = EnableLedFlash + joinOffset; Name = 1;
DisableLedFlash = DisableLedFlash + joinOffset;
EnableShortTimeout = EnableShortTimeout + joinOffset; }
DisableShortTimeout = DisableShortTimeout + joinOffset;
OrWhenVacated = OrWhenVacated + joinOffset; public override void OffsetJoinNumbers(uint joinStart)
AndWhenVacated = AndWhenVacated + joinOffset; {
EnableUsA = EnableUsA + joinOffset; var joinOffset = joinStart - 1;
DisableUsA = DisableUsA + joinOffset;
EnableUsB = EnableUsB + joinOffset; IsOnline = IsOnline + joinOffset;
DisableUsB = DisableUsB + joinOffset; ForceOccupied = ForceOccupied + joinOffset;
EnablePir = EnablePir + joinOffset; ForceVacant = ForceVacant + joinOffset;
DisablePir = DisablePir + joinOffset; EnableRawStates = EnableRawStates + joinOffset;
DisablePir = DisablePir + joinOffset; RoomOccupiedFeedback = RoomOccupiedFeedback + joinOffset;
IncrementUsInOccupiedState = IncrementUsInOccupiedState + joinOffset; GraceOccupancyDetectedFeedback = GraceOccupancyDetectedFeedback + joinOffset;
DecrementUsInOccupiedState = DecrementUsInOccupiedState + joinOffset; RoomVacantFeedback = RoomVacantFeedback + joinOffset;
IncrementUsInVacantState = IncrementUsInVacantState + joinOffset; RawOccupancyFeedback = RawOccupancyFeedback + joinOffset;
DecrementUsInVacantState = DecrementUsInVacantState + joinOffset; RawOccupancyPirFeedback = RawOccupancyPirFeedback + joinOffset;
IncrementPirInOccupiedState = IncrementPirInOccupiedState + joinOffset; RawOccupancyUsFeedback = RawOccupancyUsFeedback + joinOffset;
DecrementPirInOccupiedState = DecrementPirInOccupiedState + joinOffset; EnableLedFlash = EnableLedFlash + joinOffset;
IncrementPirInVacantState = IncrementPirInVacantState + joinOffset; DisableLedFlash = DisableLedFlash + joinOffset;
DecrementPirInVacantState = DecrementPirInVacantState + joinOffset; EnableShortTimeout = EnableShortTimeout + joinOffset;
DisableShortTimeout = DisableShortTimeout + joinOffset;
Timeout = Timeout + joinOffset; OrWhenVacated = OrWhenVacated + joinOffset;
TimeoutLocalFeedback = TimeoutLocalFeedback + joinOffset; AndWhenVacated = AndWhenVacated + joinOffset;
InternalPhotoSensorValue = InternalPhotoSensorValue + joinOffset; EnableUsA = EnableUsA + joinOffset;
ExternalPhotoSensorValue = ExternalPhotoSensorValue + joinOffset; DisableUsA = DisableUsA + joinOffset;
UsSensitivityInOccupiedState = UsSensitivityInOccupiedState + joinOffset; EnableUsB = EnableUsB + joinOffset;
UsSensitivityInVacantState = UsSensitivityInVacantState + joinOffset; DisableUsB = DisableUsB + joinOffset;
PirSensitivityInOccupiedState = PirSensitivityInOccupiedState + joinOffset; EnablePir = EnablePir + joinOffset;
PirSensitivityInVacantState = PirSensitivityInVacantState + joinOffset; DisablePir = DisablePir + joinOffset;
} IncrementUsInOccupiedState = IncrementUsInOccupiedState + joinOffset;
} DecrementUsInOccupiedState = DecrementUsInOccupiedState + joinOffset;
IncrementUsInVacantState = IncrementUsInVacantState + joinOffset;
} DecrementUsInVacantState = DecrementUsInVacantState + joinOffset;
IncrementPirInOccupiedState = IncrementPirInOccupiedState + joinOffset;
DecrementPirInOccupiedState = DecrementPirInOccupiedState + joinOffset;
IncrementPirInVacantState = IncrementPirInVacantState + joinOffset;
DecrementPirInVacantState = DecrementPirInVacantState + joinOffset;
Timeout = Timeout + joinOffset;
TimeoutLocalFeedback = TimeoutLocalFeedback + joinOffset;
InternalPhotoSensorValue = InternalPhotoSensorValue + joinOffset;
ExternalPhotoSensorValue = ExternalPhotoSensorValue + joinOffset;
UsSensitivityInOccupiedState = UsSensitivityInOccupiedState + joinOffset;
UsSensitivityInVacantState = UsSensitivityInVacantState + joinOffset;
PirSensitivityInOccupiedState = PirSensitivityInOccupiedState + joinOffset;
PirSensitivityInVacantState = PirSensitivityInVacantState + joinOffset;
Name = Name + joinOffset;
}
}
}

View file

@ -0,0 +1,212 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using PepperDash.Essentials.Core;
using Crestron.SimplSharp.Reflection;
namespace PepperDash.Essentials.Bridges
{
public class SetTopBoxControllerJoinMap : JoinMapBase
{
#region Digitals
public uint DvrList { get; set; } //
public uint Replay { get; set; }
public uint Up { get; set; } //
public uint Down { get; set; } //
public uint Left { get; set; } //
public uint Right { get; set; } //
public uint Select { get; set; } //
public uint Menu { get; set; } //
public uint Exit { get; set; } //
public uint Digit0 { get; set; } //
public uint Digit1 { get; set; } //
public uint Digit2 { get; set; } //
public uint Digit3 { get; set; } //
public uint Digit4 { get; set; } //
public uint Digit5 { get; set; } //
public uint Digit6 { get; set; } //
public uint Digit7 { get; set; } //
public uint Digit8 { get; set; } //
public uint Digit9 { get; set; } //
public uint Dash { get; set; } //
public uint KeypadEnter { get; set; } //
public uint ChannelUp { get; set; } //
public uint ChannelDown { get; set; } //
public uint LastChannel { get; set; } //
public uint Guide { get; set; } //
public uint Info { get; set; } //
public uint Red { get; set; } //
public uint Green { get; set; } //
public uint Yellow { get; set; } //
public uint Blue { get; set; } //
public uint ChapMinus { get; set; }
public uint ChapPlus { get; set; }
public uint FFwd { get; set; } //
public uint Pause { get; set; } //
public uint Play { get; set; } //
public uint Record { get; set; }
public uint Rewind { get; set; } //
public uint Stop { get; set; } //
public uint PowerOn { get; set; } //
public uint PowerOff { get; set; } //
public uint PowerToggle { get; set; } //
public uint HasKeypadAccessoryButton1 { get; set; }
public uint HasKeypadAccessoryButton2 { get; set; }
public uint KeypadAccessoryButton1Press { get; set; }
public uint KeypadAccessoryButton2Press { get; set; }
public uint HasDvr { get; set; }
public uint HasPresets { get; set; }
public uint HasNumeric { get; set; }
public uint HasDpad { get; set; }
#endregion
#region Analogs
#endregion
#region Strings
public uint Name { get; set; }
public uint LoadPresets { get; set; }
public uint KeypadAccessoryButton1Label { get; set; }
public uint KeypadAccessoryButton2Label { get; set; }
#endregion
public SetTopBoxControllerJoinMap()
{
PowerOn = 1;
PowerOff = 2;
PowerToggle = 3;
HasDpad = 4;
Up = 4;
Down = 5;
Left = 6;
Right = 7;
Select = 8;
Menu = 9;
Exit = 10;
HasNumeric = 11;
Digit0 = 11;
Digit1 = 12;
Digit2 = 13;
Digit3 = 14;
Digit4 = 15;
Digit5 = 16;
Digit6 = 17;
Digit7 = 18;
Digit8 = 19;
Digit9 = 20;
Dash = 21;
KeypadEnter = 22;
ChannelUp = 23;
ChannelDown = 24;
LastChannel = 25;
Guide = 26;
Info = 27;
Red = 28;
Green = 29;
Yellow = 30;
Blue = 31;
HasDvr = 32;
DvrList = 32;
Play = 33;
Pause = 34;
Stop = 35;
FFwd = 36;
Rewind = 37;
ChapPlus = 38;
ChapMinus = 39;
Replay = 40;
Record = 41;
HasKeypadAccessoryButton1 = 42;
KeypadAccessoryButton1Press = 42;
HasKeypadAccessoryButton2 = 43;
KeypadAccessoryButton2Press = 43;
Name = 1;
KeypadAccessoryButton1Label = 42;
KeypadAccessoryButton2Label = 43;
LoadPresets = 50;
}
public override void OffsetJoinNumbers(uint joinStart)
{
var joinOffset = joinStart - 1;
PowerOn += joinOffset;
PowerOff += joinOffset;
PowerToggle += joinOffset;
HasDpad += joinOffset;
Up += joinOffset;
Down += joinOffset;
Left += joinOffset;
Right += joinOffset;
Select += joinOffset;
Menu += joinOffset;
Exit += joinOffset;
HasNumeric += joinOffset;
Digit0 += joinOffset;
Digit1 += joinOffset;
Digit2 += joinOffset;
Digit3 += joinOffset;
Digit4 += joinOffset;
Digit5 += joinOffset;
Digit6 += joinOffset;
Digit7 += joinOffset;
Digit8 += joinOffset;
Digit9 += joinOffset;
Dash += joinOffset;
KeypadEnter += joinOffset;
ChannelUp += joinOffset;
ChannelDown += joinOffset;
LastChannel += joinOffset;
Guide += joinOffset;
Info += joinOffset;
Red += joinOffset;
Green += joinOffset;
Yellow += joinOffset;
Blue += joinOffset;
HasDvr += joinOffset;
DvrList += joinOffset;
Play += joinOffset;
Pause += joinOffset;
Stop += joinOffset;
FFwd += joinOffset;
Rewind += joinOffset;
ChapPlus += joinOffset;
ChapMinus += joinOffset;
Replay += joinOffset;
Record += joinOffset;
HasKeypadAccessoryButton1 += joinOffset;
KeypadAccessoryButton1Press += joinOffset;
HasKeypadAccessoryButton2 += joinOffset;
KeypadAccessoryButton2Press += joinOffset;
Name += joinOffset;
KeypadAccessoryButton1Label += joinOffset;
KeypadAccessoryButton2Label += joinOffset;
LoadPresets += joinOffset;
}
}
}

View file

@ -0,0 +1,49 @@
using System.Linq;
using Crestron.SimplSharp.Reflection;
using PepperDash.Essentials.Core;
namespace PepperDash.Essentials.Bridges
{
public class StatusSignControllerJoinMap:JoinMapBase
{
public uint IsOnline { get; set; }
public uint Name { get; set; }
public uint RedLed { get; set; }
public uint GreenLed { get; set; }
public uint BlueLed { get; set; }
public uint RedControl { get; set; }
public uint GreenControl { get; set; }
public uint BlueControl { get; set; }
public StatusSignControllerJoinMap()
{
//digital
IsOnline = 1;
RedControl = 2;
GreenControl = 3;
BlueControl = 4;
//Analog
RedLed = 2;
GreenLed = 3;
BlueLed = 4;
//string
Name = 1;
}
public override void OffsetJoinNumbers(uint joinStart)
{
var joinOffset = joinStart - 1;
var properties =
GetType().GetCType().GetProperties().Where(p => p.PropertyType == typeof (uint)).ToList();
foreach (var propertyInfo in properties)
{
propertyInfo.SetValue(this, (uint) propertyInfo.GetValue(this, null) + joinOffset, null);
}
}
}
}

View file

@ -0,0 +1,65 @@
using Crestron.SimplSharpPro.DeviceSupport;
using Newtonsoft.Json;
using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.CrestronIO;
namespace PepperDash.Essentials.Bridges
{
public static class StatusSignDeviceApiExtensions
{
public static void LinkToApi(this StatusSignController ssDevice, BasicTriList trilist, uint joinStart,
string joinMapKey)
{
var joinMap = new StatusSignControllerJoinMap();
var joinMapSerialized = JoinMapHelper.GetJoinMapForDevice(joinMapKey);
if (!string.IsNullOrEmpty(joinMapSerialized))
joinMap = JsonConvert.DeserializeObject<StatusSignControllerJoinMap>(joinMapSerialized);
joinMap.OffsetJoinNumbers(joinStart);
Debug.Console(1, ssDevice, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
trilist.SetBoolSigAction(joinMap.RedControl, b => EnableControl(trilist, joinMap, ssDevice));
trilist.SetBoolSigAction(joinMap.GreenControl, b => EnableControl(trilist, joinMap, ssDevice));
trilist.SetBoolSigAction(joinMap.BlueControl, b => EnableControl(trilist, joinMap, ssDevice));
trilist.SetUShortSigAction(joinMap.RedLed, u => SetColor(trilist, joinMap, ssDevice));
trilist.SetUShortSigAction(joinMap.GreenLed, u => SetColor(trilist, joinMap, ssDevice));
trilist.SetUShortSigAction(joinMap.BlueLed, u => SetColor(trilist, joinMap, ssDevice));
trilist.StringInput[joinMap.Name].StringValue = ssDevice.Name;
ssDevice.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
ssDevice.RedLedEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RedControl]);
ssDevice.BlueLedEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.BlueControl]);
ssDevice.GreenLedEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.GreenControl]);
ssDevice.RedLedBrightnessFeedback.LinkInputSig(trilist.UShortInput[joinMap.RedLed]);
ssDevice.BlueLedBrightnessFeedback.LinkInputSig(trilist.UShortInput[joinMap.BlueLed]);
ssDevice.GreenLedBrightnessFeedback.LinkInputSig(trilist.UShortInput[joinMap.GreenLed]);
}
private static void EnableControl(BasicTriList triList, StatusSignControllerJoinMap joinMap,
StatusSignController device)
{
var redEnable = triList.BooleanOutput[joinMap.RedControl].BoolValue;
var greenEnable = triList.BooleanOutput[joinMap.GreenControl].BoolValue;
var blueEnable = triList.BooleanOutput[joinMap.BlueControl].BoolValue;
device.EnableLedControl(redEnable, greenEnable, blueEnable);
}
private static void SetColor(BasicTriList triList, StatusSignControllerJoinMap joinMap,
StatusSignController device)
{
var redBrightness = triList.UShortOutput[joinMap.RedLed].UShortValue;
var greenBrightness = triList.UShortOutput[joinMap.GreenLed].UShortValue;
var blueBrightness = triList.UShortOutput[joinMap.BlueLed].UShortValue;
device.SetColor(redBrightness, greenBrightness, blueBrightness);
}
}
}

View file

@ -96,10 +96,12 @@ namespace PepperDash.Essentials
string directoryPrefix; string directoryPrefix;
directoryPrefix = Crestron.SimplSharp.CrestronIO.Directory.GetApplicationRootDirectory(); directoryPrefix = Crestron.SimplSharp.CrestronIO.Directory.GetApplicationRootDirectory();
var version = Crestron.SimplSharp.Reflection.Assembly.GetExecutingAssembly().GetName().Version;
Global.SetAssemblyVersion(string.Format("{0}.{1}.{2}", version.Major, version.Minor, version.Build)); var fullVersion = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyInformationalVersionAttribute), false);
AssemblyInformationalVersionAttribute fullVersionAtt = fullVersion[0] as AssemblyInformationalVersionAttribute;
Global.SetAssemblyVersion(fullVersionAtt.InformationalVersion);
if (CrestronEnvironment.DevicePlatform != eDevicePlatform.Server) // Handles 3-series running Windows CE OS if (CrestronEnvironment.DevicePlatform != eDevicePlatform.Server) // Handles 3-series running Windows CE OS
{ {
@ -426,11 +428,30 @@ namespace PepperDash.Essentials
DeviceManager.AddDevice(dmpsRoutingController); DeviceManager.AddDevice(dmpsRoutingController);
} }
else if (this.ControllerPrompt.IndexOf("mpc3", StringComparison.OrdinalIgnoreCase) > -1)
{
Debug.Console(2, "MPC3 processor type detected. Adding Mpc3TouchpanelController.");
var butToken = devConf.Properties["buttons"];
if (butToken != null)
{
var buttons = butToken.ToObject<Dictionary<string, Essentials.Core.Touchpanels.KeypadButton>>();
var tpController = new Essentials.Core.Touchpanels.Mpc3TouchpanelController(devConf.Key, devConf.Name, Global.ControlSystem, buttons);
DeviceManager.AddDevice(tpController);
}
else
{
Debug.Console(0, Debug.ErrorLogLevel.Error, "Error: Unable to deserialize buttons collection for device: {0}", devConf.Key);
}
}
else else
{ {
Debug.Console(2, "************Processor is not DMPS type***************"); Debug.Console(2, "************Processor is not DMPS type***************");
} }
continue; continue;
} }

View file

@ -119,9 +119,12 @@
<Compile Include="Bridges\AppleTvBridge.cs" /> <Compile Include="Bridges\AppleTvBridge.cs" />
<Compile Include="Bridges\BridgeBase.cs" /> <Compile Include="Bridges\BridgeBase.cs" />
<Compile Include="Bridges\BridgeFactory.cs" /> <Compile Include="Bridges\BridgeFactory.cs" />
<Compile Include="Bridges\C2nRthsControllerBridge.cs" />
<Compile Include="Bridges\CameraControllerBridge.cs" /> <Compile Include="Bridges\CameraControllerBridge.cs" />
<Compile Include="Bridges\AirMediaControllerBridge.cs" /> <Compile Include="Bridges\AirMediaControllerBridge.cs" />
<Compile Include="Bridges\DmBladeChassisControllerBridge.cs" /> <Compile Include="Bridges\DmBladeChassisControllerBridge.cs" />
<Compile Include="Bridges\IRSetTopBoxBaseBridge.cs" />
<Compile Include="Bridges\JoinMaps\C2nRthsControllerJoinMap.cs" />
<Compile Include="Bridges\JoinMaps\DmBladeChassisControllerJoinMap.cs" /> <Compile Include="Bridges\JoinMaps\DmBladeChassisControllerJoinMap.cs" />
<Compile Include="Bridges\DmpsAudioOutputControllerBridge.cs" /> <Compile Include="Bridges\DmpsAudioOutputControllerBridge.cs" />
<Compile Include="Bridges\DmpsRoutingControllerBridge.cs" /> <Compile Include="Bridges\DmpsRoutingControllerBridge.cs" />
@ -153,7 +156,10 @@
<Compile Include="Bridges\JoinMaps\IBasicCommunicationJoinMap.cs" /> <Compile Include="Bridges\JoinMaps\IBasicCommunicationJoinMap.cs" />
<Compile Include="Bridges\JoinMaps\IDigitalInputJoinMap.cs" /> <Compile Include="Bridges\JoinMaps\IDigitalInputJoinMap.cs" />
<Compile Include="Bridges\JoinMaps\GlsOccupancySensorBaseJoinMap.cs" /> <Compile Include="Bridges\JoinMaps\GlsOccupancySensorBaseJoinMap.cs" />
<Compile Include="Bridges\JoinMaps\SetTopBoxControllerJoinMap.cs" />
<Compile Include="Bridges\JoinMaps\StatusSignControllerJoinMap.cs" />
<Compile Include="Bridges\JoinMaps\SystemMonitorJoinMap.cs" /> <Compile Include="Bridges\JoinMaps\SystemMonitorJoinMap.cs" />
<Compile Include="Bridges\StatusSignControllerBridge.cs" />
<Compile Include="Bridges\SystemMonitorBridge.cs" /> <Compile Include="Bridges\SystemMonitorBridge.cs" />
<Compile Include="Factory\DeviceFactory.cs" /> <Compile Include="Factory\DeviceFactory.cs" />
<Compile Include="Devices\Amplifier.cs" /> <Compile Include="Devices\Amplifier.cs" />

View file

@ -1,8 +1,10 @@
using System.Reflection; using System.Reflection;
using Crestron.SimplSharp.Reflection;
[assembly: AssemblyTitle("PepperDashEssentials")] [assembly: System.Reflection.AssemblyTitle("PepperDashEssentials")]
[assembly: AssemblyCompany("PepperDash Technology Corp")] [assembly: System.Reflection.AssemblyCompany("PepperDash Technology Corp")]
[assembly: AssemblyProduct("PepperDashEssentials")] [assembly: System.Reflection.AssemblyProduct("PepperDashEssentials")]
[assembly: AssemblyCopyright("Copyright © PepperDash Technology Corp 2018")] [assembly: System.Reflection.AssemblyCopyright("Copyright © PepperDash Technology Corp 2020")]
[assembly: AssemblyVersion("1.4.0.*")] [assembly: System.Reflection.AssemblyVersion("0.0.0.*")]
[assembly: System.Reflection.AssemblyInformationalVersion("0.0.0-buildType-buildNumber")]
[assembly: Crestron.SimplSharp.Reflection.AssemblyInformationalVersion("0.0.0-buildType-buildNumber")]

View file

@ -1,13 +1,23 @@
function Update-SourceVersion function Update-SourceVersion
{ {
Param ([string]$Version) Param ([string]$Version)
$NewVersion = AssemblyVersion(" + $Version + .*"); $fullVersion = $Version
$baseVersion = [regex]::Match($Version, "(\d+.\d+.\d+).*").captures.groups[1].value
$NewAssemblyVersion = AssemblyVersion(" + $baseVersion + .*")
echo "AssemblyVersion = $NewAssemblyVersion"
$NewAssemblyInformationalVersion = AssemblyInformationalVersion(" + $Version + ")
echo "AssemblyInformationalVersion = $NewAssemblyInformationalVersion"
foreach ($o in $input) foreach ($o in $input)
{ {
Write-output $o.FullName Write-output $o.FullName
$TmpFile = $o.FullName + .tmp $TmpFile = $o.FullName + .tmp
get-content $o.FullName | get-content $o.FullName |
%{$_ -replace AssemblyVersion\("(\d+\.\d+\.\d+)\.\*"\), $NewVersion } > $TmpFile %{
$_ -replace AssemblyVersion\(".*"\), $NewAssemblyVersion} |
%{
$_ -replace AssemblyInformationalVersion\(".*"\), $NewAssemblyInformationalVersion
} > $TmpFile
move-item $TmpFile $o.FullName -force move-item $TmpFile $o.FullName -force
} }
} }
@ -21,9 +31,10 @@ function Update-AllAssemblyInfoFiles ( $version )
} }
# validate arguments # validate arguments
$r= [System.Text.RegularExpressions.Regex]::Match($args[0], "^\d+\.\d+\.\d+$"); $r= [System.Text.RegularExpressions.Regex]::Match($args[0], "\d+\.\d+\.\d+.*");
if ($r.Success) if ($r.Success)
{ {
echo "Updating Assembly Version to $args ...";
Update-AllAssemblyInfoFiles $args[0]; Update-AllAssemblyInfoFiles $args[0];
} }
else else

View file

@ -1,16 +0,0 @@
<ProgramInfo>
<RequiredInfo>
<FriendlyName>PepperDashEssentials</FriendlyName>
<SystemName>PepperDashEssentialsBase</SystemName>
<EntryPoint>PepperDashEssentialsBase</EntryPoint>
<MinFirmwareVersion>1.009.0029</MinFirmwareVersion>
<ProgramTool>SIMPL# Plugin</ProgramTool>
<DesignToolId>5</DesignToolId>
<ProgramToolId>5</ProgramToolId>
<ArchiveName />
</RequiredInfo>
<OptionalInfo>
<CompiledOn>1/8/2016 3:03:22 PM</CompiledOn>
<CompilerRev>1.0.0.27100</CompilerRev>
</OptionalInfo>
</ProgramInfo>

View file

@ -1,18 +0,0 @@
MainAssembly=PepperDashEssentialsBase.dll:5d68a993ab03b4b88d0f95478188a439
MainAssemblyMinFirmwareVersion=1.009.0029
ü
DependencySource=Crestron.SimplSharpPro.DeviceSupport.dll:caae4b4259aaf619059f0ae34473bfd2
DependencyPath=PepperDashEssentialsBase.cplz:Crestron.SimplSharpPro.DeviceSupport.dll
DependencyMainAssembly=Crestron.SimplSharpPro.DeviceSupport.dll:caae4b4259aaf619059f0ae34473bfd2
ü
DependencySource=Crestron.SimplSharpPro.DM.dll:bdf5acfa80cc3bb87f21deb891128b1d
DependencyPath=PepperDashEssentialsBase.cplz:Crestron.SimplSharpPro.DM.dll
DependencyMainAssembly=Crestron.SimplSharpPro.DM.dll:bdf5acfa80cc3bb87f21deb891128b1d
ü
DependencySource=Crestron.SimplSharpPro.EthernetCommunications.dll:36e663497195140ee6f1b4ebc53f5ea7
DependencyPath=PepperDashEssentialsBase.cplz:Crestron.SimplSharpPro.EthernetCommunications.dll
DependencyMainAssembly=Crestron.SimplSharpPro.EthernetCommunications.dll:36e663497195140ee6f1b4ebc53f5ea7
ü
DependencySource=Crestron.SimplSharpPro.UI.dll:089312a0cb0b4537072d4eb234e71e0e
DependencyPath=PepperDashEssentialsBase.cplz:Crestron.SimplSharpPro.UI.dll
DependencyMainAssembly=Crestron.SimplSharpPro.UI.dll:089312a0cb0b4537072d4eb234e71e0e

View file

@ -40,4 +40,5 @@ devjson:1 {"deviceKey":"commBridge", "methodName":"ExecuteJoinAction", "params":
devjson:2 {"deviceKey":"display01Comm-com", "methodName":"SendText", "params": [ "I'M GETTING TIRED OF THIS" ]} devjson:2 {"deviceKey":"display01Comm-com", "methodName":"SendText", "params": [ "I'M GETTING TIRED OF THIS" ]}
devjson:10 {"deviceKey":"dmLink-ssh", "methodName":"Connect", "params": []} devjson:10 {"deviceKey":"dmLink-ssh", "methodName":"Connect", "params": []}

View file

@ -0,0 +1,44 @@
using System;
using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.GeneralIO;
using PepperDash.Core;
using PepperDash.Essentials.Core;
namespace PepperDash.Essentials.Core.CrestronIO
{
public class C2nRthsController:CrestronGenericBaseDevice
{
private C2nRths _device;
public IntFeedback TemperatureFeedback { get; private set; }
public IntFeedback HumidityFeedback { get; private set; }
public C2nRthsController(string key, string name, GenericBase hardware) : base(key, name, hardware)
{
_device = hardware as C2nRths;
TemperatureFeedback = new IntFeedback(() => _device.TemperatureFeedback.UShortValue);
HumidityFeedback = new IntFeedback(() => _device.HumidityFeedback.UShortValue);
_device.BaseEvent += DeviceOnBaseEvent;
}
private void DeviceOnBaseEvent(GenericBase device, BaseEventArgs args)
{
switch (args.EventId)
{
case C2nRths.TemperatureFeedbackEventId:
TemperatureFeedback.FireUpdate();
break;
case C2nRths.HumidityFeedbackEventId:
HumidityFeedback.FireUpdate();
break;
}
}
public void SetTemperatureFormat(bool setToC)
{
_device.TemperatureFormat.BoolValue = setToC;
}
}
}

View file

@ -0,0 +1,107 @@
using System;
using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.DeviceSupport;
using Crestron.SimplSharpPro.GeneralIO;
using PepperDash.Core;
namespace PepperDash.Essentials.Core.CrestronIO
{
public class StatusSignController:CrestronGenericBaseDevice
{
private StatusSign _device;
public BoolFeedback RedLedEnabledFeedback { get; private set; }
public BoolFeedback GreenLedEnabledFeedback { get; private set; }
public BoolFeedback BlueLedEnabledFeedback { get; private set; }
public IntFeedback RedLedBrightnessFeedback { get; private set; }
public IntFeedback GreenLedBrightnessFeedback { get; private set; }
public IntFeedback BlueLedBrightnessFeedback { get; private set; }
public StatusSignController(string key, string name, GenericBase hardware) : base(key, name, hardware)
{
_device = hardware as StatusSign;
RedLedEnabledFeedback =
new BoolFeedback(
() =>
_device.Leds[(uint) StatusSign.Led.eLedColor.Red]
.ControlFeedback.BoolValue);
GreenLedEnabledFeedback =
new BoolFeedback(
() =>
_device.Leds[(uint) StatusSign.Led.eLedColor.Green]
.ControlFeedback.BoolValue);
BlueLedEnabledFeedback =
new BoolFeedback(
() =>
_device.Leds[(uint) StatusSign.Led.eLedColor.Blue]
.ControlFeedback.BoolValue);
RedLedBrightnessFeedback =
new IntFeedback(() => (int) _device.Leds[(uint) StatusSign.Led.eLedColor.Red].BrightnessFeedback);
GreenLedBrightnessFeedback =
new IntFeedback(() => (int) _device.Leds[(uint) StatusSign.Led.eLedColor.Green].BrightnessFeedback);
BlueLedBrightnessFeedback =
new IntFeedback(() => (int) _device.Leds[(uint) StatusSign.Led.eLedColor.Blue].BrightnessFeedback);
_device.BaseEvent += _device_BaseEvent;
}
void _device_BaseEvent(GenericBase device, BaseEventArgs args)
{
switch (args.EventId)
{
case StatusSign.LedBrightnessFeedbackEventId:
RedLedBrightnessFeedback.FireUpdate();
GreenLedBrightnessFeedback.FireUpdate();
BlueLedBrightnessFeedback.FireUpdate();
break;
case StatusSign.LedControlFeedbackEventId:
RedLedEnabledFeedback.FireUpdate();
GreenLedEnabledFeedback.FireUpdate();
BlueLedEnabledFeedback.FireUpdate();
break;
}
}
public void EnableLedControl(bool red, bool green, bool blue)
{
_device.Leds[(uint) StatusSign.Led.eLedColor.Red].Control.BoolValue = red;
_device.Leds[(uint)StatusSign.Led.eLedColor.Green].Control.BoolValue = green;
_device.Leds[(uint)StatusSign.Led.eLedColor.Blue].Control.BoolValue = blue;
}
public void SetColor(uint red, uint green, uint blue)
{
try
{
_device.Leds[(uint)StatusSign.Led.eLedColor.Red].Brightness =
(StatusSign.Led.eBrightnessPercentageValues)SimplSharpDeviceHelper.PercentToUshort(red);
}
catch (InvalidOperationException)
{
Debug.Console(1, this, "Error converting value to Red LED brightness. value: {0}", red);
}
try
{
_device.Leds[(uint)StatusSign.Led.eLedColor.Green].Brightness =
(StatusSign.Led.eBrightnessPercentageValues)SimplSharpDeviceHelper.PercentToUshort(green);
}
catch (InvalidOperationException)
{
Debug.Console(1, this, "Error converting value to Green LED brightness. value: {0}", green);
}
try
{
_device.Leds[(uint)StatusSign.Led.eLedColor.Blue].Brightness =
(StatusSign.Led.eBrightnessPercentageValues)SimplSharpDeviceHelper.PercentToUshort(blue);
}
catch (InvalidOperationException)
{
Debug.Console(1, this, "Error converting value to Blue LED brightness. value: {0}", blue);
}
}
}
}

View file

@ -1,156 +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; using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.DeviceSupport; using Crestron.SimplSharpPro.DeviceSupport;
using PepperDash.Core; using PepperDash.Core;
namespace PepperDash.Essentials.Core namespace PepperDash.Essentials.Core
{ {
/// <summary> /// <summary>
/// A bridge class to cover the basic features of GenericBase hardware /// A bridge class to cover the basic features of GenericBase hardware
/// </summary> /// </summary>
public class CrestronGenericBaseDevice : Device, IOnline, IHasFeedback, ICommunicationMonitor, IUsageTracking public class CrestronGenericBaseDevice : Device, IOnline, IHasFeedback, ICommunicationMonitor, IUsageTracking
{ {
public virtual GenericBase Hardware { get; protected set; } public virtual GenericBase Hardware { get; protected set; }
/// <summary> /// <summary>
/// Returns a list containing the Outputs that we want to expose. /// Returns a list containing the Outputs that we want to expose.
/// </summary> /// </summary>
public FeedbackCollection<Feedback> Feedbacks { get; private set; } public FeedbackCollection<Feedback> Feedbacks { get; private set; }
public BoolFeedback IsOnline { get; private set; } public BoolFeedback IsOnline { get; private set; }
public BoolFeedback IsRegistered { get; private set; } public BoolFeedback IsRegistered { get; private set; }
public StringFeedback IpConnectionsText { get; private set; } public StringFeedback IpConnectionsText { get; private set; }
/// <summary> /// <summary>
/// Used by implementing classes to prevent registration with Crestron TLDM. For /// Used by implementing classes to prevent registration with Crestron TLDM. For
/// devices like RMCs and TXs attached to a chassis. /// devices like RMCs and TXs attached to a chassis.
/// </summary> /// </summary>
public bool PreventRegistration { get; protected set; } public bool PreventRegistration { get; protected set; }
public CrestronGenericBaseDevice(string key, string name, GenericBase hardware) public CrestronGenericBaseDevice(string key, string name, GenericBase hardware)
: base(key, name) : base(key, name)
{ {
Feedbacks = new FeedbackCollection<Feedback>(); Feedbacks = new FeedbackCollection<Feedback>();
Hardware = hardware; Hardware = hardware;
IsOnline = new BoolFeedback("IsOnlineFeedback", () => Hardware.IsOnline); IsOnline = new BoolFeedback("IsOnlineFeedback", () => Hardware.IsOnline);
IsRegistered = new BoolFeedback("IsRegistered", () => Hardware.Registered); IsRegistered = new BoolFeedback("IsRegistered", () => Hardware.Registered);
IpConnectionsText = new StringFeedback("IpConnectionsText", () => IpConnectionsText = new StringFeedback("IpConnectionsText", () =>
string.Join(",", Hardware.ConnectedIpList.Select(cip => cip.DeviceIpAddress).ToArray())); {
if (Hardware.ConnectedIpList != null)
AddToFeedbackList(IsOnline, IsRegistered, IpConnectionsText); return string.Join(",", Hardware.ConnectedIpList.Select(cip => cip.DeviceIpAddress).ToArray());
else
CommunicationMonitor = new CrestronGenericBaseCommunicationMonitor(this, hardware, 120000, 300000); return string.Empty;
} });
AddToFeedbackList(IsOnline, IpConnectionsText);
/// <summary>
/// Make sure that overriding classes call this! CommunicationMonitor = new CrestronGenericBaseCommunicationMonitor(this, hardware, 120000, 300000);
/// Registers the Crestron device, connects up to the base events, starts communication monitor }
/// </summary>
public override bool CustomActivate() /// <summary>
{ /// Make sure that overriding classes call this!
Debug.Console(0, this, "Activating"); /// Registers the Crestron device, connects up to the base events, starts communication monitor
if (!PreventRegistration) /// </summary>
{ public override bool CustomActivate()
//Debug.Console(1, this, " Does not require registration. Skipping"); {
Debug.Console(0, this, "Activating");
var response = Hardware.RegisterWithLogging(Key); if (!PreventRegistration)
if (response != eDeviceRegistrationUnRegistrationResponse.Success) {
{ //Debug.Console(1, this, " Does not require registration. Skipping");
//Debug.Console(0, this, "ERROR: Cannot register Crestron device: {0}", response);
return false; var response = Hardware.RegisterWithLogging(Key);
} if (response != eDeviceRegistrationUnRegistrationResponse.Success)
} {
//Debug.Console(0, this, "ERROR: Cannot register Crestron device: {0}", response);
Hardware.OnlineStatusChange += new OnlineStatusChangeEventHandler(Hardware_OnlineStatusChange); return false;
CommunicationMonitor.Start(); }
return true; IsRegistered.FireUpdate();
} }
/// <summary> foreach (var f in Feedbacks)
/// This disconnects events and unregisters the base hardware device. {
/// </summary> f.FireUpdate();
/// <returns></returns> }
public override bool Deactivate()
{ Hardware.OnlineStatusChange += new OnlineStatusChangeEventHandler(Hardware_OnlineStatusChange);
CommunicationMonitor.Stop(); CommunicationMonitor.Start();
Hardware.OnlineStatusChange -= Hardware_OnlineStatusChange;
return true;
return Hardware.UnRegister() == eDeviceRegistrationUnRegistrationResponse.Success; }
}
/// <summary>
/// <summary> /// This disconnects events and unregisters the base hardware device.
/// Adds feedback(s) to the list /// </summary>
/// </summary> /// <returns></returns>
/// <param name="newFbs"></param> public override bool Deactivate()
public void AddToFeedbackList(params Feedback[] newFbs) {
{ CommunicationMonitor.Stop();
foreach (var f in newFbs) Hardware.OnlineStatusChange -= Hardware_OnlineStatusChange;
{
if (f != null) var success = Hardware.UnRegister() == eDeviceRegistrationUnRegistrationResponse.Success;
{
if (!Feedbacks.Contains(f)) IsRegistered.FireUpdate();
{
Feedbacks.Add(f); return success;
} }
}
} /// <summary>
} /// Adds feedback(s) to the list
/// </summary>
void Hardware_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args) /// <param name="newFbs"></param>
{ public void AddToFeedbackList(params Feedback[] newFbs)
if (args.DeviceOnLine) {
{ foreach (var f in newFbs)
foreach (var feedback in Feedbacks) {
{ if (f != null)
if (feedback != null) {
feedback.FireUpdate(); if (!Feedbacks.Contains(f))
} {
} Feedbacks.Add(f);
} }
}
#region IStatusMonitor Members }
}
public StatusMonitorBase CommunicationMonitor { get; private set; }
#endregion void Hardware_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args)
{
#region IUsageTracking Members Debug.Console(2, this, "OnlineStatusChange Event. Online = {0}", args.DeviceOnLine);
foreach (var feedback in Feedbacks)
public UsageTracking UsageTracker { get; set; } {
if (feedback != null)
#endregion feedback.FireUpdate();
} }
}
//***********************************************************************************
public class CrestronGenericBaseDeviceEventIds #region IStatusMonitor Members
{
public const uint IsOnline = 1; public StatusMonitorBase CommunicationMonitor { get; private set; }
public const uint IpConnectionsText =2; #endregion
}
#region IUsageTracking Members
/// <summary>
/// Adds logging to Register() failure public UsageTracking UsageTracker { get; set; }
/// </summary>
public static class GenericBaseExtensions #endregion
{ }
public static eDeviceRegistrationUnRegistrationResponse RegisterWithLogging(this GenericBase device, string key)
{ //***********************************************************************************
var result = device.Register(); public class CrestronGenericBaseDeviceEventIds
var level = result == eDeviceRegistrationUnRegistrationResponse.Success ? {
Debug.ErrorLogLevel.Notice : Debug.ErrorLogLevel.Error; public const uint IsOnline = 1;
Debug.Console(0, level, "Register device result: '{0}', type '{1}', result {2}", key, device, result); public const uint IpConnectionsText =2;
//if (result != eDeviceRegistrationUnRegistrationResponse.Success) }
//{
// Debug.Console(0, Debug.ErrorLogLevel.Error, "Cannot register device '{0}': {1}", key, result); /// <summary>
//} /// Adds logging to Register() failure
return result; /// </summary>
} public static class GenericBaseExtensions
{
} public static eDeviceRegistrationUnRegistrationResponse RegisterWithLogging(this GenericBase device, string key)
{
var result = device.Register();
var level = result == eDeviceRegistrationUnRegistrationResponse.Success ?
Debug.ErrorLogLevel.Notice : Debug.ErrorLogLevel.Error;
Debug.Console(0, level, "Register device result: '{0}', type '{1}', result {2}", key, device, result);
//if (result != eDeviceRegistrationUnRegistrationResponse.Success)
//{
// Debug.Console(0, Debug.ErrorLogLevel.Error, "Cannot register device '{0}': {1}", key, result);
//}
return result;
}
}
} }

View file

@ -0,0 +1,32 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using PepperDash.Core;
namespace PepperDash.Essentials.Core
{
public static class DeviceFeedbackExtensions
{
/// <summary>
/// Attempts to get and return a feedback property from a device by name.
/// If unsuccessful, returns null.
/// </summary>
/// <param name="device"></param>
/// <param name="propertyName"></param>
/// <returns></returns>
public static Feedback GetFeedbackProperty(this Device device, string propertyName)
{
var feedback = DeviceJsonApi.GetPropertyByName(device.Key, propertyName) as Feedback;
if (feedback != null)
{
return feedback;
}
return null;
}
}
}

View file

@ -59,7 +59,7 @@ namespace PepperDash.Essentials.Core
} }
/// <summary> /// <summary>
/// /// Gets the properties on a device
/// </summary> /// </summary>
/// <param name="key"></param> /// <param name="key"></param>
/// <returns></returns> /// <returns></returns>
@ -75,8 +75,34 @@ namespace PepperDash.Essentials.Core
return JsonConvert.SerializeObject(props, Formatting.Indented); return JsonConvert.SerializeObject(props, Formatting.Indented);
} }
/// <summary>
/// Gets a property from a device path by name
/// </summary>
/// <param name="deviceObjectPath"></param>
/// <param name="propertyName"></param>
/// <returns></returns>
public static object GetPropertyByName(string deviceObjectPath, string propertyName)
{
var obj = FindObjectOnPath(deviceObjectPath);
if(obj == null)
return "{ \"error\":\"No Device\"}";
CType t = obj.GetType();
var prop = t.GetProperty(propertyName);
if (prop != null)
{
return prop;
}
else
{
Debug.Console(1, "Unable to find Property: {0} on Device with path: {1}", propertyName, deviceObjectPath);
return null;
}
}
/// <summary> /// <summary>
/// /// Gets the methods on a device
/// </summary> /// </summary>
/// <param name="key"></param> /// <param name="key"></param>
/// <returns></returns> /// <returns></returns>

View file

@ -4,10 +4,12 @@ using System.Linq;
using System.Text; using System.Text;
using Crestron.SimplSharp; using Crestron.SimplSharp;
using Crestron.SimplSharpPro; using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.GeneralIO;
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.CrestronIO;
using PepperDash.Essentials.Core.Touchpanels;
namespace PepperDash.Essentials.Core namespace PepperDash.Essentials.Core
{ {
@ -46,26 +48,41 @@ namespace PepperDash.Essentials.Core
var typeName = dc.Type.ToLower(); var typeName = dc.Type.ToLower();
// Check "core" types first
// Check for types that have been added by plugin dlls.
if (FactoryMethods.ContainsKey(typeName))
{
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Loading '{0}' from plugin", dc.Type);
return FactoryMethods[typeName](dc);
}
// Check "core" types
if (typeName == "genericcomm") if (typeName == "genericcomm")
{ {
Debug.Console(1, "Factory Attempting to create new Generic Comm Device"); Debug.Console(1, "Factory Attempting to create new Generic Comm Device");
return new GenericComm(dc); return new GenericComm(dc);
} }
else if (typeName == "ceniodigin104") if (typeName == "ceniodigin104")
{ {
var control = CommFactory.GetControlPropertiesConfig(dc); var control = CommFactory.GetControlPropertiesConfig(dc);
var ipid = control.IpIdInt; var ipid = control.IpIdInt;
return new CenIoDigIn104Controller(key, name, new Crestron.SimplSharpPro.GeneralIO.CenIoDi104(ipid, Global.ControlSystem)); return new CenIoDigIn104Controller(key, name, new Crestron.SimplSharpPro.GeneralIO.CenIoDi104(ipid, Global.ControlSystem));
} }
if (typeName == "statussign")
{
var control = CommFactory.GetControlPropertiesConfig(dc);
var cresnetId = control.CresnetIdInt;
// then check for types that have been added by plugin dlls. return new StatusSignController(key, name, new StatusSign(cresnetId, Global.ControlSystem));
if (FactoryMethods.ContainsKey(typeName)) }
{ if (typeName == "c2nrths")
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Loading '{0}' from plugin", dc.Type); {
return FactoryMethods[typeName](dc); var control = CommFactory.GetControlPropertiesConfig(dc);
} var cresnetId = control.CresnetIdInt;
return new C2nRthsController(key, name, new C2nRths(cresnetId, Global.ControlSystem));
}
return null; return null;
} }

View file

@ -32,6 +32,8 @@ namespace PepperDash.Essentials.Core
List<BoolInputSig> LinkedInputSigs = new List<BoolInputSig>(); List<BoolInputSig> LinkedInputSigs = new List<BoolInputSig>();
List<BoolInputSig> LinkedComplementInputSigs = new List<BoolInputSig>(); List<BoolInputSig> LinkedComplementInputSigs = new List<BoolInputSig>();
List<Crestron.SimplSharpPro.DeviceSupport.Feedback> LinkedCrestronFeedbacks = new List<Crestron.SimplSharpPro.DeviceSupport.Feedback>();
public BoolFeedback(Func<bool> valueFunc) public BoolFeedback(Func<bool> valueFunc)
: this(null, valueFunc) : this(null, valueFunc)
{ {
@ -56,28 +58,63 @@ namespace PepperDash.Essentials.Core
} }
} }
/// <summary>
/// Links an input sig
/// </summary>
/// <param name="sig"></param>
public void LinkInputSig(BoolInputSig sig) public void LinkInputSig(BoolInputSig sig)
{ {
LinkedInputSigs.Add(sig); LinkedInputSigs.Add(sig);
UpdateSig(sig); UpdateSig(sig);
} }
/// <summary>
/// Unlinks an inputs sig
/// </summary>
/// <param name="sig"></param>
public void UnlinkInputSig(BoolInputSig sig) public void UnlinkInputSig(BoolInputSig sig)
{ {
LinkedInputSigs.Remove(sig); LinkedInputSigs.Remove(sig);
} }
/// <summary>
/// Links an input sig to the complement value
/// </summary>
/// <param name="sig"></param>
public void LinkComplementInputSig(BoolInputSig sig) public void LinkComplementInputSig(BoolInputSig sig)
{ {
LinkedComplementInputSigs.Add(sig); LinkedComplementInputSigs.Add(sig);
UpdateComplementSig(sig); UpdateComplementSig(sig);
} }
/// <summary>
/// Unlinks an input sig to the complement value
/// </summary>
/// <param name="sig"></param>
public void UnlinkComplementInputSig(BoolInputSig sig) public void UnlinkComplementInputSig(BoolInputSig sig)
{ {
LinkedComplementInputSigs.Remove(sig); LinkedComplementInputSigs.Remove(sig);
} }
/// <summary>
/// Links a Crestron Feedback object
/// </summary>
/// <param name="feedback"></param>
public void LinkCrestronFeedback(Crestron.SimplSharpPro.DeviceSupport.Feedback feedback)
{
LinkedCrestronFeedbacks.Add(feedback);
UpdateCrestronFeedback(feedback);
}
/// <summary>
///
/// </summary>
/// <param name="feedback"></param>
public void UnlinkCrestronFeedback(Crestron.SimplSharpPro.DeviceSupport.Feedback feedback)
{
LinkedCrestronFeedbacks.Remove(feedback);
}
public override string ToString() public override string ToString()
{ {
return (InTestMode ? "TEST -- " : "") + BoolValue.ToString(); return (InTestMode ? "TEST -- " : "") + BoolValue.ToString();
@ -103,6 +140,11 @@ namespace PepperDash.Essentials.Core
{ {
sig.BoolValue = !_BoolValue; sig.BoolValue = !_BoolValue;
} }
void UpdateCrestronFeedback(Crestron.SimplSharpPro.DeviceSupport.Feedback feedback)
{
feedback.State = _BoolValue;
}
} }
} }

View file

@ -439,7 +439,7 @@ namespace PepperDash.Essentials.Core.Fusion
void GetTouchpanelInfo() void GetTouchpanelInfo()
{ {
// TODO Get IP and Project Name from TP // TODO: Get IP and Project Name from TP
} }
protected void FusionRoom_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args) protected void FusionRoom_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args)

View file

@ -64,7 +64,7 @@
</Reference> </Reference>
<Reference Include="Crestron.SimplSharpPro.GeneralIO, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL"> <Reference Include="Crestron.SimplSharpPro.GeneralIO, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.GeneralIO.dll</HintPath> <HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.GeneralIO.dll</HintPath>
</Reference> </Reference>
<Reference Include="Crestron.SimplSharpPro.Remotes, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL"> <Reference Include="Crestron.SimplSharpPro.Remotes, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
@ -119,6 +119,7 @@
<Compile Include="Config\Essentials\ConfigWriter.cs" /> <Compile Include="Config\Essentials\ConfigWriter.cs" />
<Compile Include="Config\Essentials\EssentialsConfig.cs" /> <Compile Include="Config\Essentials\EssentialsConfig.cs" />
<Compile Include="Config\SourceDevicePropertiesConfigBase.cs" /> <Compile Include="Config\SourceDevicePropertiesConfigBase.cs" />
<Compile Include="Crestron IO\C2nRts\C2nRthsController.cs" />
<Compile Include="Crestron IO\Inputs\CenIoDigIn104Controller.cs" /> <Compile Include="Crestron IO\Inputs\CenIoDigIn104Controller.cs" />
<Compile Include="Crestron IO\Inputs\GenericDigitalInputDevice.cs" /> <Compile Include="Crestron IO\Inputs\GenericDigitalInputDevice.cs" />
<Compile Include="Crestron IO\Inputs\GenericVersiportInputDevice.cs" /> <Compile Include="Crestron IO\Inputs\GenericVersiportInputDevice.cs" />
@ -126,9 +127,11 @@
<Compile Include="Crestron IO\IOPortConfig.cs" /> <Compile Include="Crestron IO\IOPortConfig.cs" />
<Compile Include="Crestron IO\Relay\GenericRelayDevice.cs" /> <Compile Include="Crestron IO\Relay\GenericRelayDevice.cs" />
<Compile Include="Crestron IO\Relay\ISwitchedOutput.cs" /> <Compile Include="Crestron IO\Relay\ISwitchedOutput.cs" />
<Compile Include="Crestron IO\StatusSign\StatusSignController.cs" />
<Compile Include="Devices\CodecInterfaces.cs" /> <Compile Include="Devices\CodecInterfaces.cs" />
<Compile Include="Devices\CrestronProcessor.cs" /> <Compile Include="Devices\CrestronProcessor.cs" />
<Compile Include="Devices\DeviceApiBase.cs" /> <Compile Include="Devices\DeviceApiBase.cs" />
<Compile Include="Devices\DeviceFeedbackExtensions.cs" />
<Compile Include="Devices\PC\InRoomPc.cs" /> <Compile Include="Devices\PC\InRoomPc.cs" />
<Compile Include="Devices\PC\Laptop.cs" /> <Compile Include="Devices\PC\Laptop.cs" />
<Compile Include="Devices\ReconfigurableDevice.cs" /> <Compile Include="Devices\ReconfigurableDevice.cs" />
@ -234,6 +237,7 @@
<Compile Include="Touchpanels\CrestronTouchpanelPropertiesConfig.cs" /> <Compile Include="Touchpanels\CrestronTouchpanelPropertiesConfig.cs" />
<Compile Include="Touchpanels\Interfaces.cs" /> <Compile Include="Touchpanels\Interfaces.cs" />
<Compile Include="Touchpanels\Keyboards\HabaneroKeyboardController.cs" /> <Compile Include="Touchpanels\Keyboards\HabaneroKeyboardController.cs" />
<Compile Include="Touchpanels\Mpc3Touchpanel.cs" />
<Compile Include="Touchpanels\TriListExtensions.cs" /> <Compile Include="Touchpanels\TriListExtensions.cs" />
<Compile Include="UI PageManagers\BlurayPageManager.cs" /> <Compile Include="UI PageManagers\BlurayPageManager.cs" />
<Compile Include="UI PageManagers\SetTopBoxThreePanelPageManager.cs" /> <Compile Include="UI PageManagers\SetTopBoxThreePanelPageManager.cs" />

View file

@ -0,0 +1,11 @@
using PepperDash.Core;
using PepperDash.Essentials.Core.Config;
namespace PepperDash.Essentials.Core.Plugins
{
public interface IPluginDeviceConfig
{
string MinimumEssentialsFrameworkVersion { get; }
IKeyed BuildDevice(DeviceConfig dc);
}
}

View file

@ -0,0 +1,19 @@
using System;
namespace PepperDash.Essentials.Core.Plugins
{
[AttributeUsage(AttributeTargets.Class)]
public sealed class PluginEntryPointAttribute : Attribute
{
private readonly string _uniqueKey;
public string UniqueKey {
get { return _uniqueKey; }
}
public PluginEntryPointAttribute(string key)
{
_uniqueKey = key;
}
}
}

View file

@ -1,7 +1,11 @@
using System.Reflection; using System.Reflection;
using Crestron.SimplSharp.Reflection;
[assembly: System.Reflection.AssemblyTitle("PepperDashEssentialsBase")]
[assembly: System.Reflection.AssemblyCompany("PepperDash Technology Corp")]
[assembly: System.Reflection.AssemblyProduct("PepperDashEssentials")]
[assembly: System.Reflection.AssemblyCopyright("Copyright © PepperDash Technology Corp 2020")]
[assembly: System.Reflection.AssemblyVersion("0.0.0.*")]
[assembly: System.Reflection.AssemblyInformationalVersion("0.0.0-buildType-buildNumber")]
[assembly: Crestron.SimplSharp.Reflection.AssemblyInformationalVersion("0.0.0-buildType-buildNumber")]
[assembly: AssemblyTitle("PepperDashEssentialsBase")]
[assembly: AssemblyCompany("PepperDash Technology Corp")]
[assembly: AssemblyProduct("PepperDashEssentialsBase")]
[assembly: AssemblyCopyright("Copyright © Ppperdash 2019")]
[assembly: AssemblyVersion("1.4.0.*")]

View file

@ -1,16 +0,0 @@
<ProgramInfo>
<RequiredInfo>
<FriendlyName>SSMonoIOLibrary</FriendlyName>
<SystemName>SSMonoIOLibrary</SystemName>
<EntryPoint>SSMonoIOLibrary</EntryPoint>
<MinFirmwareVersion>1.007.0017</MinFirmwareVersion>
<ProgramTool>SIMPL# Plugin</ProgramTool>
<DesignToolId>5</DesignToolId>
<ProgramToolId>5</ProgramToolId>
<ArchiveName />
</RequiredInfo>
<OptionalInfo>
<CompiledOn>4/6/2016 7:49:24 AM</CompiledOn>
<CompilerRev>1.0.0.14081</CompilerRev>
</OptionalInfo>
</ProgramInfo>

View file

@ -1,18 +0,0 @@
MainAssembly=SSMonoIOLibrary.dll:6c69af117dca3f74ebca99f7a0e3181c
MainAssemblyMinFirmwareVersion=1.007.0017
ü
DependencySource=SimplSharpCustomAttributesInterface.dll:9c4b4d4c519b655af90016edca2d66b9
DependencyPath=SSMonoIOLibrary.clz:SimplSharpCustomAttributesInterface.dll
DependencyMainAssembly=SimplSharpCustomAttributesInterface.dll:9c4b4d4c519b655af90016edca2d66b9
ü
DependencySource=SimplSharpHelperInterface.dll:aed72eb0e19559a3f56708be76445dcd
DependencyPath=SSMonoIOLibrary.clz:SimplSharpHelperInterface.dll
DependencyMainAssembly=SimplSharpHelperInterface.dll:aed72eb0e19559a3f56708be76445dcd
ü
DependencySource=SimplSharpReflectionInterface.dll:e3ff8edbba84ccd7155b9984e67488b2
DependencyPath=SSMonoIOLibrary.clz:SimplSharpReflectionInterface.dll
DependencyMainAssembly=SimplSharpReflectionInterface.dll:e3ff8edbba84ccd7155b9984e67488b2
ü
DependencySource=SSharpCrestronExtensionsLibrary.dll:655a49edee523f150d1c03bcb5db87d0
DependencyPath=SSMonoIOLibrary.clz:SSharpCrestronExtensionsLibrary.dll
DependencyMainAssembly=SSharpCrestronExtensionsLibrary.dll:655a49edee523f150d1c03bcb5db87d0

View file

@ -1,16 +0,0 @@
<ProgramInfo>
<RequiredInfo>
<FriendlyName>SSMonoProTaskLibrary</FriendlyName>
<SystemName>SSMonoProTaskLibrary</SystemName>
<EntryPoint>SSMonoProTaskLibrary</EntryPoint>
<MinFirmwareVersion>1.009.0029</MinFirmwareVersion>
<ProgramTool>SIMPL# Plugin</ProgramTool>
<DesignToolId>5</DesignToolId>
<ProgramToolId>5</ProgramToolId>
<ArchiveName />
</RequiredInfo>
<OptionalInfo>
<CompiledOn>4/6/2016 7:55:41 AM</CompiledOn>
<CompilerRev>1.0.0.14269</CompilerRev>
</OptionalInfo>
</ProgramInfo>

View file

@ -1,30 +0,0 @@
MainAssembly=SSMonoProTaskLibrary.dll:5d3a301400516bd812bf1566c72ccbf2
MainAssemblyMinFirmwareVersion=1.009.0029
ü
DependencySource=SimplSharpReflectionInterface.dll:e3ff8edbba84ccd7155b9984e67488b2
DependencyPath=SSMonoProTaskLibrary.cplz:SimplSharpReflectionInterface.dll
DependencyMainAssembly=SimplSharpReflectionInterface.dll:e3ff8edbba84ccd7155b9984e67488b2
ü
DependencySource=SSharpCrestronExtensionsLibrary.dll:776d0247d8d42164c46c7cc1dfadbd03
DependencyPath=SSMonoProTaskLibrary.cplz:SSharpCrestronExtensionsLibrary.dll
DependencyMainAssembly=SSharpCrestronExtensionsLibrary.dll:776d0247d8d42164c46c7cc1dfadbd03
ü
DependencySource=SSMonoConcurrentCollectionsLibrary.dll:b0afcd989b081899c9eb29f9e4c8b799
DependencyPath=SSMonoProTaskLibrary.cplz:SSMonoConcurrentCollectionsLibrary.dll
DependencyMainAssembly=SSMonoConcurrentCollectionsLibrary.dll:b0afcd989b081899c9eb29f9e4c8b799
ü
DependencySource=SSMonoProConcurrentCollectionsLibrary.dll:8b718ce29f938bbf9cb5b8fc2d89332f
DependencyPath=SSMonoProTaskLibrary.cplz:SSMonoProConcurrentCollectionsLibrary.dll
DependencyMainAssembly=SSMonoProConcurrentCollectionsLibrary.dll:8b718ce29f938bbf9cb5b8fc2d89332f
ü
DependencySource=SSMonoSupportLibrary.dll:59362515f2c1d61583b2e40793987917
DependencyPath=SSMonoProTaskLibrary.cplz:SSMonoSupportLibrary.dll
DependencyMainAssembly=SSMonoSupportLibrary.dll:59362515f2c1d61583b2e40793987917
ü
DependencySource=SSMonoThreadingLibrary.dll:ea2ae2e1d9c425236f39de9192591062
DependencyPath=SSMonoProTaskLibrary.cplz:SSMonoThreadingLibrary.dll
DependencyMainAssembly=SSMonoThreadingLibrary.dll:ea2ae2e1d9c425236f39de9192591062
ü
DependencySource=SSMonoTupleLibrary.dll:2a3b419fff4199838079879053fcb41d
DependencyPath=SSMonoProTaskLibrary.cplz:SSMonoTupleLibrary.dll
DependencyMainAssembly=SSMonoTupleLibrary.dll:2a3b419fff4199838079879053fcb41d

View file

@ -1,134 +1,149 @@
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 PepperDash.Core; using PepperDash.Core;
namespace PepperDash.Essentials.Core namespace PepperDash.Essentials.Core
{ {
public class SecondsCountdownTimer: IKeyed public class SecondsCountdownTimer: IKeyed
{ {
public event EventHandler<EventArgs> HasStarted; public event EventHandler<EventArgs> HasStarted;
public event EventHandler<EventArgs> HasFinished; public event EventHandler<EventArgs> HasFinished;
public event EventHandler<EventArgs> WasCancelled; public event EventHandler<EventArgs> WasCancelled;
public string Key { get; private set; } public string Key { get; private set; }
public BoolFeedback IsRunningFeedback { get; private set; } public BoolFeedback IsRunningFeedback { get; private set; }
bool _IsRunning; bool _IsRunning;
public IntFeedback PercentFeedback { get; private set; } public IntFeedback PercentFeedback { get; private set; }
public StringFeedback TimeRemainingFeedback { get; private set; } public StringFeedback TimeRemainingFeedback { get; private set; }
public bool CountsDown { get; set; } public bool CountsDown { get; set; }
public int SecondsToCount { get; set; }
/// <summary>
public DateTime StartTime { get; private set; } /// The number of seconds to countdown
public DateTime FinishTime { get; private set; } /// </summary>
public int SecondsToCount { get; set; }
CTimer SecondTimer;
public DateTime StartTime { get; private set; }
/// <summary> public DateTime FinishTime { get; private set; }
///
/// </summary> CTimer SecondTimer;
/// <param name="key"></param>
public SecondsCountdownTimer(string key) /// <summary>
{ /// Constructor
Key = key; /// </summary>
IsRunningFeedback = new BoolFeedback(() => _IsRunning); /// <param name="key"></param>
public SecondsCountdownTimer(string key)
TimeRemainingFeedback = new StringFeedback(() => {
{ Key = key;
// Need to handle up and down here. IsRunningFeedback = new BoolFeedback(() => _IsRunning);
if (StartTime == null || FinishTime == null) TimeRemainingFeedback = new StringFeedback(() =>
return ""; {
var timeSpan = FinishTime - DateTime.Now; // Need to handle up and down here.
return Math.Round(timeSpan.TotalSeconds).ToString();
}); if (StartTime == null || FinishTime == null)
return "";
PercentFeedback = new IntFeedback(() => var timeSpan = FinishTime - DateTime.Now;
{
if (StartTime == null || FinishTime == null) if (timeSpan.TotalSeconds < 60)
return 0; {
double percent = (FinishTime - DateTime.Now).TotalSeconds return Math.Round(timeSpan.TotalSeconds).ToString();
/ (FinishTime - StartTime).TotalSeconds }
* 100; else
return (int)percent; {
}); Debug.Console(2, this, "timeSpan.Minutes == {0}, timeSpan.Seconds == {1}", timeSpan.Minutes, timeSpan.Seconds);
} return String.Format("{0:D2}:{1:D2}",
timeSpan.Minutes,
/// <summary> timeSpan.Seconds);
/// }
/// </summary> });
public void Start()
{ PercentFeedback = new IntFeedback(() =>
if (_IsRunning) {
return; if (StartTime == null || FinishTime == null)
StartTime = DateTime.Now; return 0;
FinishTime = StartTime + TimeSpan.FromSeconds(SecondsToCount); double percent = (FinishTime - DateTime.Now).TotalSeconds
/ (FinishTime - StartTime).TotalSeconds
if (SecondTimer != null) * 100;
SecondTimer.Stop(); return (int)percent;
SecondTimer = new CTimer(SecondElapsedTimerCallback, null, 0, 1000); });
_IsRunning = true; }
IsRunningFeedback.FireUpdate();
/// <summary>
var handler = HasStarted; /// Starts the Timer
if (handler != null) /// </summary>
handler(this, new EventArgs()); public void Start()
} {
if (_IsRunning)
/// <summary> return;
/// StartTime = DateTime.Now;
/// </summary> FinishTime = StartTime + TimeSpan.FromSeconds(SecondsToCount);
public void Reset()
{ if (SecondTimer != null)
_IsRunning = false; SecondTimer.Stop();
Start(); SecondTimer = new CTimer(SecondElapsedTimerCallback, null, 0, 1000);
} _IsRunning = true;
IsRunningFeedback.FireUpdate();
/// <summary>
/// var handler = HasStarted;
/// </summary> if (handler != null)
public void Cancel() handler(this, new EventArgs());
{ }
StopHelper();
/// <summary>
var handler = WasCancelled; /// Restarts the timer
if (handler != null) /// </summary>
handler(this, new EventArgs()); public void Reset()
} {
_IsRunning = false;
/// <summary> Start();
/// Called upon expiration, or calling this will force timer to finish. }
/// </summary>
public void Finish() /// <summary>
{ /// Cancels the timer (without triggering it to finish)
StopHelper(); /// </summary>
public void Cancel()
var handler = HasFinished; {
if (handler != null) StopHelper();
handler(this, new EventArgs());
} var handler = WasCancelled;
if (handler != null)
void StopHelper() handler(this, new EventArgs());
{ }
if (SecondTimer != null)
SecondTimer.Stop(); /// <summary>
_IsRunning = false; /// Called upon expiration, or calling this will force timer to finish.
IsRunningFeedback.FireUpdate(); /// </summary>
} public void Finish()
{
void SecondElapsedTimerCallback(object o) StopHelper();
{
PercentFeedback.FireUpdate(); var handler = HasFinished;
TimeRemainingFeedback.FireUpdate(); if (handler != null)
handler(this, new EventArgs());
if (DateTime.Now >= FinishTime) }
Finish();
} void StopHelper()
} {
if (SecondTimer != null)
SecondTimer.Stop();
_IsRunning = false;
IsRunningFeedback.FireUpdate();
}
void SecondElapsedTimerCallback(object o)
{
PercentFeedback.FireUpdate();
TimeRemainingFeedback.FireUpdate();
if (DateTime.Now >= FinishTime)
Finish();
}
}
} }

View file

@ -0,0 +1,145 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro;
using PepperDash.Core;
using PepperDash.Essentials.Core;
namespace PepperDash.Essentials.Core.Touchpanels
{
/// <summary>
/// A wrapper class for the touchpanel portion of an MPC3 class process to allow for configurable
/// behavior of the keybad buttons
/// </summary>
public class Mpc3TouchpanelController : Device
{
MPC3Basic _Touchpanel;
Dictionary<string, KeypadButton> _Buttons;
public Mpc3TouchpanelController(string key, string name, CrestronControlSystem processor, Dictionary<string, KeypadButton> buttons)
: base(key, name)
{
_Touchpanel = processor.ControllerTouchScreenSlotDevice as MPC3Basic;
_Buttons = buttons;
_Touchpanel.ButtonStateChange += new Crestron.SimplSharpPro.DeviceSupport.ButtonEventHandler(_Touchpanel_ButtonStateChange);
AddPostActivationAction(() =>
{
// Link up the button feedbacks to the specified BoolFeedbacks
foreach (var button in _Buttons)
{
var feedbackConfig = button.Value.Feedback;
var device = DeviceManager.GetDeviceForKey(feedbackConfig.DeviceKey) as Device;
if (device != null)
{
var bKey = button.Key.ToLower();
var feedback = device.GetFeedbackProperty(feedbackConfig.BoolFeedbackName);
var bFeedback = feedback as BoolFeedback;
var iFeedback = feedback as IntFeedback;
if (bFeedback != null)
{
if (bKey == "power")
{
bFeedback.LinkCrestronFeedback(_Touchpanel.FeedbackPower);
continue;
}
else if (bKey == "mute")
{
bFeedback.LinkCrestronFeedback(_Touchpanel.FeedbackMute);
continue;
}
// Link to the Crestron Feedback corresponding to the button number
bFeedback.LinkCrestronFeedback(_Touchpanel.Feedbacks[UInt16.Parse(button.Key)]);
}
else if (iFeedback != null)
{
if (bKey == "volumefeedback")
{
var volFeedback = feedback as IntFeedback;
// TODO: Figure out how to subsribe to a volume IntFeedback and link it to the voluem
volFeedback.LinkInputSig(_Touchpanel.VolumeBargraph);
}
}
else
{
Debug.Console(1, this, "Unable to get BoolFeedback with name: {0} from device: {1}", feedbackConfig.BoolFeedbackName, device.Key);
}
}
else
{
Debug.Console(1, this, "Unable to get device with key: {0}", feedbackConfig.DeviceKey);
}
}
});
}
void _Touchpanel_ButtonStateChange(GenericBase device, Crestron.SimplSharpPro.DeviceSupport.ButtonEventArgs args)
{
Debug.Console(1, this, "Button {0} ({1}), {2}", args.Button.Number, args.Button.Name, args.NewButtonState);
var type = args.NewButtonState.ToString();
if (_Buttons.ContainsKey(args.Button.Number.ToString()))
{
Press(args.Button.Number.ToString(), type);
}
else if(_Buttons.ContainsKey(args.Button.Name.ToString()))
{
Press(args.Button.Name.ToString(), type);
}
}
/// <summary>
/// Runs the function associated with this button/type. One of the following strings:
/// Pressed, Released, Tapped, DoubleTapped, Held, HeldReleased
/// </summary>
/// <param name="number"></param>
/// <param name="type"></param>
public void Press(string number, string type)
{
// TODO: In future, consider modifying this to generate actions at device activation time
// to prevent the need to dynamically call the method via reflection on each button press
if (!_Buttons.ContainsKey(number)) { return; }
var but = _Buttons[number];
if (but.EventTypes.ContainsKey(type))
{
foreach (var a in but.EventTypes[type]) { DeviceJsonApi.DoDeviceAction(a); }
}
}
}
/// <summary>
/// Represents the configuration of a keybad buggon
/// </summary>
public class KeypadButton
{
public Dictionary<string, DeviceActionWrapper[]> EventTypes { get; set; }
public KeypadButtonFeedback Feedback { get; set; }
public KeypadButton()
{
EventTypes = new Dictionary<string, DeviceActionWrapper[]>();
Feedback = new KeypadButtonFeedback();
}
}
/// <summary>
///
/// </summary>
public class KeypadButtonFeedback
{
public string DeviceKey { get; set; }
public string BoolFeedbackName { get; set; }
}
}

View file

@ -44,7 +44,10 @@ namespace PepperDash.Essentials.DM.AirMedia
DeviceConfig = dc; DeviceConfig = dc;
PropertiesConfig = props; PropertiesConfig = props;
InputPorts = new RoutingPortCollection<RoutingInputPort>();
OutputPorts = new RoutingPortCollection<RoutingOutputPort>();
InputPorts.Add(new RoutingInputPort(DmPortName.Osd, eRoutingSignalType.Audio | eRoutingSignalType.Video, InputPorts.Add(new RoutingInputPort(DmPortName.Osd, eRoutingSignalType.Audio | eRoutingSignalType.Video,
eRoutingPortConnectionType.None, new Action(SelectPinPointUxLandingPage), this)); eRoutingPortConnectionType.None, new Action(SelectPinPointUxLandingPage), this));

View file

@ -30,14 +30,17 @@ namespace PepperDash.Essentials.DM
if (typeName.StartsWith("am")) if (typeName.StartsWith("am"))
{ {
var props = JsonConvert.DeserializeObject<AirMediaPropertiesConfig>(properties.ToString()); if (typeName == "am200" || typeName == "am300")
AmX00 amDevice = null; {
if (typeName == "am200") var props = JsonConvert.DeserializeObject<AirMediaPropertiesConfig>(properties.ToString());
amDevice = new Crestron.SimplSharpPro.DM.AirMedia.Am200(props.Control.IpIdInt, Global.ControlSystem); AmX00 amDevice = null;
else if(typeName == "am300") if (typeName == "am200")
amDevice = new Crestron.SimplSharpPro.DM.AirMedia.Am300(props.Control.IpIdInt, Global.ControlSystem); amDevice = new Crestron.SimplSharpPro.DM.AirMedia.Am200(props.Control.IpIdInt, Global.ControlSystem);
else if (typeName == "am300")
amDevice = new Crestron.SimplSharpPro.DM.AirMedia.Am300(props.Control.IpIdInt, Global.ControlSystem);
return new AirMediaController(key, name, amDevice, dc, props); return new AirMediaController(key, name, amDevice, dc, props);
}
} }
else if (typeName.StartsWith("dmmd8x") || typeName.StartsWith("dmmd16x") || typeName.StartsWith("dmmd32x")) else if (typeName.StartsWith("dmmd8x") || typeName.StartsWith("dmmd16x") || typeName.StartsWith("dmmd32x"))
{ {

View file

@ -19,7 +19,7 @@ namespace PepperDash.Essentials.DM
/// <summary> /// <summary>
/// Controller class for all DM-TX-201C/S/F transmitters /// Controller class for all DM-TX-201C/S/F transmitters
/// </summary> /// </summary>
public class DmTx200Controller : DmTxControllerBase, ITxRouting, IHasFeedback public class DmTx200Controller : DmTxControllerBase, ITxRouting, IHasFeedback, IHasFreeRun, IVgaBrightnessContrastControls
{ {
public DmTx200C2G Tx { get; private set; } public DmTx200C2G Tx { get; private set; }
@ -32,8 +32,10 @@ namespace PepperDash.Essentials.DM
public IntFeedback AudioSourceNumericFeedback { get; protected set; } public IntFeedback AudioSourceNumericFeedback { get; protected set; }
public IntFeedback HdmiInHdcpCapabilityFeedback { get; protected set; } public IntFeedback HdmiInHdcpCapabilityFeedback { get; protected set; }
//public override IntFeedback HdcpSupportAllFeedback { get; protected set; } public BoolFeedback FreeRunEnabledFeedback { get; protected set; }
//public override ushort HdcpSupportCapability { get; protected set; }
public IntFeedback VgaBrightnessFeedback { get; protected set; }
public IntFeedback VgaContrastFeedback { get; protected set; }
/// <summary> /// <summary>
/// Helps get the "real" inputs, including when in Auto /// Helps get the "real" inputs, including when in Auto
@ -115,7 +117,7 @@ namespace PepperDash.Essentials.DM
HdmiInHdcpCapabilityFeedback = new IntFeedback("HdmiInHdcpCapability", () => HdmiInHdcpCapabilityFeedback = new IntFeedback("HdmiInHdcpCapability", () =>
{ {
if (tx.HdmiInput.HdpcSupportOnFeedback.BoolValue) if (tx.HdmiInput.HdcpSupportOnFeedback.BoolValue)
return 1; return 1;
else else
return 0; return 0;
@ -123,6 +125,14 @@ namespace PepperDash.Essentials.DM
HdcpSupportCapability = eHdcpCapabilityType.HdcpAutoSupport; HdcpSupportCapability = eHdcpCapabilityType.HdcpAutoSupport;
FreeRunEnabledFeedback = new BoolFeedback(() => tx.VgaInput.FreeRunFeedback == eDmFreeRunSetting.Enabled);
VgaBrightnessFeedback = new IntFeedback(() => tx.VgaInput.VideoControls.BrightnessFeedback.UShortValue);
VgaContrastFeedback = new IntFeedback(() => tx.VgaInput.VideoControls.ContrastFeedback.UShortValue);
tx.VgaInput.VideoControls.ControlChange += new Crestron.SimplSharpPro.DeviceSupport.GenericEventHandler(VideoControls_ControlChange);
var combinedFuncs = new VideoStatusFuncsWrapper var combinedFuncs = new VideoStatusFuncsWrapper
{ {
HdcpActiveFeedbackFunc = () => HdcpActiveFeedbackFunc = () =>
@ -170,6 +180,21 @@ namespace PepperDash.Essentials.DM
DmOutput.Port = Tx.DmOutput; DmOutput.Port = Tx.DmOutput;
} }
void VideoControls_ControlChange(object sender, Crestron.SimplSharpPro.DeviceSupport.GenericEventArgs args)
{
var id = args.EventId;
Debug.Console(2, this, "EventId {0}", args.EventId);
if (id == VideoControlsEventIds.BrightnessFeedbackEventId)
{
VgaBrightnessFeedback.FireUpdate();
}
else if (id == VideoControlsEventIds.ContrastFeedbackEventId)
{
VgaContrastFeedback.FireUpdate();
}
}
void Tx_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args) void Tx_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args)
{ {
ActiveVideoInputFeedback.FireUpdate(); ActiveVideoInputFeedback.FireUpdate();
@ -191,6 +216,40 @@ namespace PepperDash.Essentials.DM
return base.CustomActivate(); return base.CustomActivate();
} }
/// <summary>
/// Enables or disables free run
/// </summary>
/// <param name="enable"></param>
public void SetFreeRunEnabled(bool enable)
{
if (enable)
{
Tx.VgaInput.FreeRun = eDmFreeRunSetting.Enabled;
}
else
{
Tx.VgaInput.FreeRun = eDmFreeRunSetting.Disabled;
}
}
/// <summary>
/// Sets the VGA brightness level
/// </summary>
/// <param name="level"></param>
public void SetVgaBrightness(ushort level)
{
Tx.VgaInput.VideoControls.Brightness.UShortValue = level;
}
/// <summary>
/// Sets the VGA contrast level
/// </summary>
/// <param name="level"></param>
public void SetVgaContrast(ushort level)
{
Tx.VgaInput.VideoControls.Contrast.UShortValue = level;
}
public void ExecuteNumericSwitch(ushort input, ushort output, eRoutingSignalType type) public void ExecuteNumericSwitch(ushort input, ushort output, eRoutingSignalType type)
{ {
Debug.Console(2, this, "Executing Numeric Switch to input {0}.", input); Debug.Console(2, this, "Executing Numeric Switch to input {0}.", input);

View file

@ -19,7 +19,7 @@ namespace PepperDash.Essentials.DM
/// <summary> /// <summary>
/// Controller class for all DM-TX-201C/S/F transmitters /// Controller class for all DM-TX-201C/S/F transmitters
/// </summary> /// </summary>
public class DmTx201XController : DmTxControllerBase, ITxRouting, IHasFeedback public class DmTx201XController : DmTxControllerBase, ITxRouting, IHasFeedback, IHasFreeRun, IVgaBrightnessContrastControls
{ {
public DmTx201S Tx { get; private set; } // uses the 201S class as it is the base class for the 201C public DmTx201S Tx { get; private set; } // uses the 201S class as it is the base class for the 201C
@ -33,8 +33,10 @@ namespace PepperDash.Essentials.DM
public IntFeedback AudioSourceNumericFeedback { get; protected set; } public IntFeedback AudioSourceNumericFeedback { get; protected set; }
public IntFeedback HdmiInHdcpCapabilityFeedback { get; protected set; } public IntFeedback HdmiInHdcpCapabilityFeedback { get; protected set; }
//public override IntFeedback HdcpSupportAllFeedback { get; protected set; } public BoolFeedback FreeRunEnabledFeedback { get; protected set; }
//public override ushort HdcpSupportCapability { get; protected set; }
public IntFeedback VgaBrightnessFeedback { get; protected set; }
public IntFeedback VgaContrastFeedback { get; protected set; }
/// <summary> /// <summary>
/// Helps get the "real" inputs, including when in Auto /// Helps get the "real" inputs, including when in Auto
@ -116,12 +118,19 @@ namespace PepperDash.Essentials.DM
HdmiInHdcpCapabilityFeedback = new IntFeedback("HdmiInHdcpCapability", () => HdmiInHdcpCapabilityFeedback = new IntFeedback("HdmiInHdcpCapability", () =>
{ {
if (tx.HdmiInput.HdpcSupportOnFeedback.BoolValue) if (tx.HdmiInput.HdcpSupportOnFeedback.BoolValue)
return 1; return 1;
else else
return 0; return 0;
}); });
FreeRunEnabledFeedback = new BoolFeedback(() => tx.VgaInput.FreeRunFeedback == eDmFreeRunSetting.Enabled);
VgaBrightnessFeedback = new IntFeedback(() => tx.VgaInput.VideoControls.BrightnessFeedback.UShortValue);
VgaContrastFeedback = new IntFeedback(() => tx.VgaInput.VideoControls.ContrastFeedback.UShortValue);
tx.VgaInput.VideoControls.ControlChange += new Crestron.SimplSharpPro.DeviceSupport.GenericEventHandler(VideoControls_ControlChange);
HdcpSupportCapability = eHdcpCapabilityType.HdcpAutoSupport; HdcpSupportCapability = eHdcpCapabilityType.HdcpAutoSupport;
var combinedFuncs = new VideoStatusFuncsWrapper var combinedFuncs = new VideoStatusFuncsWrapper
@ -156,7 +165,7 @@ namespace PepperDash.Essentials.DM
}; };
AnyVideoInput = new RoutingInputPortWithVideoStatuses(DmPortName.AnyVideoIn, AnyVideoInput = new RoutingInputPortWithVideoStatuses(DmPortName.AnyVideoIn,
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.None, 0, this, combinedFuncs); eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.None, 0, this, combinedFuncs);
DmOutput = new RoutingOutputPort(DmPortName.DmOut, eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.DmCat, null, this); DmOutput = new RoutingOutputPort(DmPortName.DmOut, eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.DmCat, null, this);
HdmiLoopOut = new RoutingOutputPort(DmPortName.HdmiLoopOut, eRoutingSignalType.Audio | eRoutingSignalType.Video, HdmiLoopOut = new RoutingOutputPort(DmPortName.HdmiLoopOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
@ -174,6 +183,21 @@ namespace PepperDash.Essentials.DM
DmOutput.Port = Tx.DmOutput; DmOutput.Port = Tx.DmOutput;
} }
void VideoControls_ControlChange(object sender, Crestron.SimplSharpPro.DeviceSupport.GenericEventArgs args)
{
var id = args.EventId;
Debug.Console(2, this, "EventId {0}", args.EventId);
if (id == VideoControlsEventIds.BrightnessFeedbackEventId)
{
VgaBrightnessFeedback.FireUpdate();
}
else if (id == VideoControlsEventIds.ContrastFeedbackEventId)
{
VgaContrastFeedback.FireUpdate();
}
}
void Tx_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args) void Tx_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args)
{ {
ActiveVideoInputFeedback.FireUpdate(); ActiveVideoInputFeedback.FireUpdate();
@ -183,8 +207,7 @@ namespace PepperDash.Essentials.DM
} }
public override bool CustomActivate() public override bool CustomActivate()
{ {
Tx.HdmiInput.InputStreamChange += (o, a) => FowardInputStreamChange(HdmiInput, a.EventId); Tx.HdmiInput.InputStreamChange += (o, a) => FowardInputStreamChange(HdmiInput, a.EventId);
Tx.HdmiInput.VideoAttributes.AttributeChange += (o, a) => FireVideoAttributeChange(HdmiInput, a.EventId); Tx.HdmiInput.VideoAttributes.AttributeChange += (o, a) => FireVideoAttributeChange(HdmiInput, a.EventId);
@ -195,6 +218,46 @@ namespace PepperDash.Essentials.DM
return base.CustomActivate(); return base.CustomActivate();
} }
/// <summary>
/// Enables or disables free run
/// </summary>
/// <param name="enable"></param>
public void SetFreeRunEnabled(bool enable)
{
if (enable)
{
Tx.VgaInput.FreeRun = eDmFreeRunSetting.Enabled;
}
else
{
Tx.VgaInput.FreeRun = eDmFreeRunSetting.Disabled;
}
}
/// <summary>
/// Sets the VGA brightness level
/// </summary>
/// <param name="level"></param>
public void SetVgaBrightness(ushort level)
{
Tx.VgaInput.VideoControls.Brightness.UShortValue = level;
}
/// <summary>
/// Sets the VGA contrast level
/// </summary>
/// <param name="level"></param>
public void SetVgaContrast(ushort level)
{
Tx.VgaInput.VideoControls.Contrast.UShortValue = level;
}
/// <summary>
/// Switches the audio/video source based on the integer value (0-Auto, 1-HDMI, 2-VGA, 3-Disable)
/// </summary>
/// <param name="input"></param>
/// <param name="output"></param>
/// <param name="type"></param>
public void ExecuteNumericSwitch(ushort input, ushort output, eRoutingSignalType type) public void ExecuteNumericSwitch(ushort input, ushort output, eRoutingSignalType type)
{ {
Debug.Console(2, this, "Executing Numeric Switch to input {0}.", input); Debug.Console(2, this, "Executing Numeric Switch to input {0}.", input);
@ -250,6 +313,7 @@ namespace PepperDash.Essentials.DM
Debug.Console(2, this, " Audio Source: {0}", Tx.AudioSourceFeedback); Debug.Console(2, this, " Audio Source: {0}", Tx.AudioSourceFeedback);
AudioSourceNumericFeedback.FireUpdate(); AudioSourceNumericFeedback.FireUpdate();
} }
} }
void InputStreamChangeEvent(EndpointInputStream inputStream, EndpointInputStreamEventArgs args) void InputStreamChangeEvent(EndpointInputStream inputStream, EndpointInputStreamEventArgs args)
@ -264,6 +328,10 @@ namespace PepperDash.Essentials.DM
{ {
HdmiInHdcpCapabilityFeedback.FireUpdate(); HdmiInHdcpCapabilityFeedback.FireUpdate();
} }
else if (args.EventId == EndpointInputStreamEventIds.FreeRunFeedbackEventId)
{
FreeRunEnabledFeedback.FireUpdate();
}
} }
/// <summary> /// <summary>

View file

@ -17,7 +17,7 @@ namespace PepperDash.Essentials.DM
{ {
using eVst = DmTx401C.eSourceSelection; using eVst = DmTx401C.eSourceSelection;
public class DmTx401CController : DmTxControllerBase, ITxRouting, IHasFeedback, IIROutputPorts, IComPorts public class DmTx401CController : DmTxControllerBase, ITxRouting, IHasFeedback, IIROutputPorts, IComPorts, IHasFreeRun, IVgaBrightnessContrastControls
{ {
public DmTx401C Tx { get; private set; } public DmTx401C Tx { get; private set; }
@ -34,6 +34,11 @@ namespace PepperDash.Essentials.DM
public IntFeedback AudioSourceNumericFeedback { get; protected set; } public IntFeedback AudioSourceNumericFeedback { get; protected set; }
public IntFeedback HdmiInHdcpCapabilityFeedback { get; protected set; } public IntFeedback HdmiInHdcpCapabilityFeedback { get; protected set; }
public BoolFeedback FreeRunEnabledFeedback { get; protected set; }
public IntFeedback VgaBrightnessFeedback { get; protected set; }
public IntFeedback VgaContrastFeedback { get; protected set; }
/// <summary> /// <summary>
/// Helps get the "real" inputs, including when in Auto /// Helps get the "real" inputs, including when in Auto
/// </summary> /// </summary>
@ -122,7 +127,7 @@ namespace PepperDash.Essentials.DM
HdmiInHdcpCapabilityFeedback = new IntFeedback("HdmiInHdcpCapability", () => HdmiInHdcpCapabilityFeedback = new IntFeedback("HdmiInHdcpCapability", () =>
{ {
if (tx.HdmiInput.HdpcSupportOnFeedback.BoolValue) if (tx.HdmiInput.HdcpSupportOnFeedback.BoolValue)
return 1; return 1;
else else
return 0; return 0;
@ -130,6 +135,13 @@ namespace PepperDash.Essentials.DM
HdcpSupportCapability = eHdcpCapabilityType.HdcpAutoSupport; HdcpSupportCapability = eHdcpCapabilityType.HdcpAutoSupport;
FreeRunEnabledFeedback = new BoolFeedback(() => tx.VgaInput.FreeRunFeedback == eDmFreeRunSetting.Enabled);
VgaBrightnessFeedback = new IntFeedback(() => tx.VgaInput.VideoControls.BrightnessFeedback.UShortValue);
VgaContrastFeedback = new IntFeedback(() => tx.VgaInput.VideoControls.ContrastFeedback.UShortValue);
tx.VgaInput.VideoControls.ControlChange += new Crestron.SimplSharpPro.DeviceSupport.GenericEventHandler(VideoControls_ControlChange);
var combinedFuncs = new VideoStatusFuncsWrapper var combinedFuncs = new VideoStatusFuncsWrapper
{ {
HdcpActiveFeedbackFunc = () => HdcpActiveFeedbackFunc = () =>
@ -269,6 +281,55 @@ namespace PepperDash.Essentials.DM
} }
} }
void VideoControls_ControlChange(object sender, Crestron.SimplSharpPro.DeviceSupport.GenericEventArgs args)
{
var id = args.EventId;
Debug.Console(2, this, "EventId {0}", args.EventId);
if (id == VideoControlsEventIds.BrightnessFeedbackEventId)
{
VgaBrightnessFeedback.FireUpdate();
}
else if (id == VideoControlsEventIds.ContrastFeedbackEventId)
{
VgaContrastFeedback.FireUpdate();
}
}
/// <summary>
/// Enables or disables free run
/// </summary>
/// <param name="enable"></param>
public void SetFreeRunEnabled(bool enable)
{
if (enable)
{
Tx.VgaInput.FreeRun = eDmFreeRunSetting.Enabled;
}
else
{
Tx.VgaInput.FreeRun = eDmFreeRunSetting.Disabled;
}
}
/// <summary>
/// Sets the VGA brightness level
/// </summary>
/// <param name="level"></param>
public void SetVgaBrightness(ushort level)
{
Tx.VgaInput.VideoControls.Brightness.UShortValue = level;
}
/// <summary>
/// Sets the VGA contrast level
/// </summary>
/// <param name="level"></param>
public void SetVgaContrast(ushort level)
{
Tx.VgaInput.VideoControls.Contrast.UShortValue = level;
}
/// <summary> /// <summary>
/// Relays the input stream change to the appropriate RoutingInputPort. /// Relays the input stream change to the appropriate RoutingInputPort.
/// </summary> /// </summary>

View file

@ -19,7 +19,7 @@ namespace PepperDash.Essentials.DM
using eAst = Crestron.SimplSharpPro.DeviceSupport.eX02AudioSourceType; using eAst = Crestron.SimplSharpPro.DeviceSupport.eX02AudioSourceType;
public class DmTx4k302CController : DmTxControllerBase, ITxRouting, IHasFeedback, public class DmTx4k302CController : DmTxControllerBase, ITxRouting, IHasFeedback,
IIROutputPorts, IComPorts IIROutputPorts, IComPorts, IHasFreeRun, IVgaBrightnessContrastControls
{ {
public DmTx4k302C Tx { get; private set; } public DmTx4k302C Tx { get; private set; }
@ -35,8 +35,10 @@ namespace PepperDash.Essentials.DM
public IntFeedback HdmiIn1HdcpCapabilityFeedback { get; protected set; } public IntFeedback HdmiIn1HdcpCapabilityFeedback { get; protected set; }
public IntFeedback HdmiIn2HdcpCapabilityFeedback { get; protected set; } public IntFeedback HdmiIn2HdcpCapabilityFeedback { get; protected set; }
//public override IntFeedback HdcpSupportAllFeedback { get; protected set; } public BoolFeedback FreeRunEnabledFeedback { get; protected set; }
//public override ushort HdcpSupportCapability { get; protected set; }
public IntFeedback VgaBrightnessFeedback { get; protected set; }
public IntFeedback VgaContrastFeedback { get; protected set; }
/// <summary> /// <summary>
/// Helps get the "real" inputs, including when in Auto /// Helps get the "real" inputs, including when in Auto
@ -122,6 +124,13 @@ namespace PepperDash.Essentials.DM
HdcpSupportCapability = eHdcpCapabilityType.Hdcp2_2Support; HdcpSupportCapability = eHdcpCapabilityType.Hdcp2_2Support;
FreeRunEnabledFeedback = new BoolFeedback(() => tx.VgaInput.FreeRunFeedback == eDmFreeRunSetting.Enabled);
VgaBrightnessFeedback = new IntFeedback(() => tx.VgaInput.VideoControls.BrightnessFeedback.UShortValue);
VgaContrastFeedback = new IntFeedback(() => tx.VgaInput.VideoControls.ContrastFeedback.UShortValue);
tx.VgaInput.VideoControls.ControlChange += new Crestron.SimplSharpPro.DeviceSupport.GenericEventHandler(VideoControls_ControlChange);
var combinedFuncs = new VideoStatusFuncsWrapper var combinedFuncs = new VideoStatusFuncsWrapper
{ {
@ -181,6 +190,21 @@ namespace PepperDash.Essentials.DM
DmOut.Port = Tx.DmOutput; DmOut.Port = Tx.DmOutput;
} }
void VideoControls_ControlChange(object sender, Crestron.SimplSharpPro.DeviceSupport.GenericEventArgs args)
{
var id = args.EventId;
Debug.Console(2, this, "EventId {0}", args.EventId);
if (id == VideoControlsEventIds.BrightnessFeedbackEventId)
{
VgaBrightnessFeedback.FireUpdate();
}
else if (id == VideoControlsEventIds.ContrastFeedbackEventId)
{
VgaContrastFeedback.FireUpdate();
}
}
public override bool CustomActivate() public override bool CustomActivate()
@ -199,6 +223,42 @@ namespace PepperDash.Essentials.DM
return base.CustomActivate(); return base.CustomActivate();
} }
/// <summary>
/// Enables or disables free run
/// </summary>
/// <param name="enable"></param>
public void SetFreeRunEnabled(bool enable)
{
if (enable)
{
Tx.VgaInput.FreeRun = eDmFreeRunSetting.Enabled;
}
else
{
Tx.VgaInput.FreeRun = eDmFreeRunSetting.Disabled;
}
}
/// <summary>
/// Sets the VGA brightness level
/// </summary>
/// <param name="level"></param>
public void SetVgaBrightness(ushort level)
{
Tx.VgaInput.VideoControls.Brightness.UShortValue = level;
}
/// <summary>
/// Sets the VGA contrast level
/// </summary>
/// <param name="level"></param>
public void SetVgaContrast(ushort level)
{
Tx.VgaInput.VideoControls.Contrast.UShortValue = level;
}
public void ExecuteNumericSwitch(ushort input, ushort output, eRoutingSignalType type) public void ExecuteNumericSwitch(ushort input, ushort output, eRoutingSignalType type)
{ {
Debug.Console(2, this, "Executing Numeric Switch to input {0}.", input); Debug.Console(2, this, "Executing Numeric Switch to input {0}.", input);

View file

@ -0,0 +1,32 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using PepperDash.Essentials.Core;
namespace PepperDash.Essentials.DM
{
/// <summary>
/// Defines a device capable of setting the Free Run state of a VGA input and reporting feedback
/// </summary>
public interface IHasFreeRun
{
BoolFeedback FreeRunEnabledFeedback { get; }
void SetFreeRunEnabled(bool enable);
}
/// <summary>
/// Defines a device capable of adjusting VGA settings
/// </summary>
public interface IVgaBrightnessContrastControls
{
IntFeedback VgaBrightnessFeedback { get; }
IntFeedback VgaContrastFeedback { get; }
void SetVgaBrightness(ushort level);
void SetVgaContrast(ushort level);
}
}

View file

@ -82,6 +82,10 @@
<HintPath>..\..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpPro.exe</HintPath> <HintPath>..\..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpPro.exe</HintPath>
<Private>False</Private> <Private>False</Private>
</Reference> </Reference>
<Reference Include="SimplSharpReflectionInterface, Version=1.0.5583.25238, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpReflectionInterface.dll</HintPath>
</Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
<Reference Include="System.Data" /> <Reference Include="System.Data" />
@ -96,6 +100,7 @@
<Compile Include="Chassis\DmpsInternalVirtualDmTxController.cs" /> <Compile Include="Chassis\DmpsInternalVirtualDmTxController.cs" />
<Compile Include="Chassis\DmpsRoutingController.cs" /> <Compile Include="Chassis\DmpsRoutingController.cs" />
<Compile Include="Chassis\HdMdNxM4kEController.cs" /> <Compile Include="Chassis\HdMdNxM4kEController.cs" />
<Compile Include="Endpoints\Transmitters\TxInterfaces.cs" />
<Compile Include="IDmSwitch.cs" /> <Compile Include="IDmSwitch.cs" />
<Compile Include="Config\DmpsRoutingConfig.cs" /> <Compile Include="Config\DmpsRoutingConfig.cs" />
<Compile Include="Config\DmRmcConfig.cs" /> <Compile Include="Config\DmRmcConfig.cs" />

View file

@ -1,7 +1,10 @@
using System.Reflection; using System.Reflection;
using Crestron.SimplSharp.Reflection;
[assembly: AssemblyTitle("Essentials_DM")] [assembly: System.Reflection.AssemblyTitle("Essentials_DM")]
[assembly: AssemblyCompany("PepperDash Technology Corp")] [assembly: System.Reflection.AssemblyCompany("PepperDash Technology Corp")]
[assembly: AssemblyProduct("Essentials_DM")] [assembly: System.Reflection.AssemblyProduct("PepperDashEssentials")]
[assembly: AssemblyCopyright("Copyright © 2019")] [assembly: System.Reflection.AssemblyCopyright("Copyright © PepperDash Technology Corp 2020")]
[assembly: AssemblyVersion("1.3.*")] [assembly: System.Reflection.AssemblyVersion("0.0.0.*")]
[assembly: System.Reflection.AssemblyInformationalVersion("0.0.0-buildType-buildNumber")]
[assembly: Crestron.SimplSharp.Reflection.AssemblyInformationalVersion("0.0.0-buildType-buildNumber")]

View file

@ -73,17 +73,18 @@ namespace PepperDash.Essentials.Devices.Common.Codec
{ {
// Iterate the meeting list and check if any meeting need to do anythingk // Iterate the meeting list and check if any meeting need to do anythingk
const double meetingTimeEpsilon = 0.0001;
foreach (Meeting m in Meetings) foreach (Meeting m in Meetings)
{ {
eMeetingEventChangeType changeType = eMeetingEventChangeType.Unkown; eMeetingEventChangeType changeType = eMeetingEventChangeType.Unkown;
if (m.TimeToMeetingStart.TotalMinutes <= m.MeetingWarningMinutes.TotalMinutes) // Meeting is about to start if (m.TimeToMeetingStart.TotalMinutes <= m.MeetingWarningMinutes.TotalMinutes) // Meeting is about to start
changeType = eMeetingEventChangeType.MeetingStartWarning; changeType = eMeetingEventChangeType.MeetingStartWarning;
else if (m.TimeToMeetingStart.TotalMinutes == 0) // Meeting Start else if (Math.Abs(m.TimeToMeetingStart.TotalMinutes) < meetingTimeEpsilon) // Meeting Start
changeType = eMeetingEventChangeType.MeetingStart; changeType = eMeetingEventChangeType.MeetingStart;
else if (m.TimeToMeetingEnd.TotalMinutes <= m.MeetingWarningMinutes.TotalMinutes) // Meeting is about to end else if (m.TimeToMeetingEnd.TotalMinutes <= m.MeetingWarningMinutes.TotalMinutes) // Meeting is about to end
changeType = eMeetingEventChangeType.MeetingEndWarning; changeType = eMeetingEventChangeType.MeetingEndWarning;
else if (m.TimeToMeetingEnd.TotalMinutes == 0) // Meeting has ended else if (Math.Abs(m.TimeToMeetingEnd.TotalMinutes) < meetingTimeEpsilon) // Meeting has ended
changeType = eMeetingEventChangeType.MeetingEnd; changeType = eMeetingEventChangeType.MeetingEnd;
if (changeType != eMeetingEventChangeType.Unkown) if (changeType != eMeetingEventChangeType.Unkown)

View file

@ -103,6 +103,18 @@ namespace PepperDash.Essentials.Devices.Common.Occupancy
PirSensitivityInOccupiedStateFeedback.FireUpdate(); PirSensitivityInOccupiedStateFeedback.FireUpdate();
else if (args.EventId == GlsOccupancySensorBase.PirSensitivityInVacantStateFeedbackEventId) else if (args.EventId == GlsOccupancySensorBase.PirSensitivityInVacantStateFeedbackEventId)
PirSensitivityInVacantStateFeedback.FireUpdate(); PirSensitivityInVacantStateFeedback.FireUpdate();
}
protected virtual void OccSensor_BaseEvent(Crestron.SimplSharpPro.GenericBase device, Crestron.SimplSharpPro.BaseEventArgs args)
{
Debug.Console(2, this, "GlsOccupancySensorChange EventId: {0}", args.EventId);
if (args.EventId == Crestron.SimplSharpPro.GeneralIO.GlsOccupancySensorBase.RoomOccupiedFeedbackEventId
|| args.EventId == Crestron.SimplSharpPro.GeneralIO.GlsOccupancySensorBase.RoomVacantFeedbackEventId)
{
Debug.Console(1, this, "Occupancy State: {0}", OccSensor.OccupancyDetectedFeedback.BoolValue);
RoomIsOccupiedFeedback.FireUpdate();
}
else if (args.EventId == GlsOccupancySensorBase.TimeoutFeedbackEventId) else if (args.EventId == GlsOccupancySensorBase.TimeoutFeedbackEventId)
CurrentTimeoutFeedback.FireUpdate(); CurrentTimeoutFeedback.FireUpdate();
else if (args.EventId == GlsOccupancySensorBase.TimeoutLocalFeedbackEventId) else if (args.EventId == GlsOccupancySensorBase.TimeoutLocalFeedbackEventId)
@ -117,18 +129,6 @@ namespace PepperDash.Essentials.Devices.Common.Occupancy
ExternalPhotoSensorValue.FireUpdate(); ExternalPhotoSensorValue.FireUpdate();
} }
void OccSensor_BaseEvent(Crestron.SimplSharpPro.GenericBase device, Crestron.SimplSharpPro.BaseEventArgs args)
{
Debug.Console(2, this, "GlsOccupancySensorChange EventId: {0}", args.EventId);
if (args.EventId == Crestron.SimplSharpPro.GeneralIO.GlsOccupancySensorBase.RoomOccupiedFeedbackEventId
|| args.EventId == Crestron.SimplSharpPro.GeneralIO.GlsOccupancySensorBase.RoomVacantFeedbackEventId)
{
Debug.Console(1, this, "Occupancy State: {0}", OccSensor.OccupancyDetectedFeedback.BoolValue);
RoomIsOccupiedFeedback.FireUpdate();
}
}
public void SetTestMode(bool mode) public void SetTestMode(bool mode)
{ {
InTestMode = mode; InTestMode = mode;

View file

@ -1,148 +1,171 @@
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.GeneralIO; using Crestron.SimplSharpPro.GeneralIO;
using PepperDash.Core; using PepperDash.Core;
using PepperDash.Essentials.Core; using PepperDash.Essentials.Core;
namespace PepperDash.Essentials.Devices.Common.Occupancy namespace PepperDash.Essentials.Devices.Common.Occupancy
{ {
public class GlsOdtOccupancySensorController : GlsOccupancySensorBaseController public class GlsOdtOccupancySensorController : GlsOccupancySensorBaseController
{ {
public new GlsOdtCCn OccSensor { get; private set; } public new GlsOdtCCn OccSensor { get; private set; }
public BoolFeedback OrWhenVacatedFeedback { get; private set; } public BoolFeedback OrWhenVacatedFeedback { get; private set; }
public BoolFeedback AndWhenVacatedFeedback { get; private set; } public BoolFeedback AndWhenVacatedFeedback { get; private set; }
public BoolFeedback UltrasonicAEnabledFeedback { get; private set; } public BoolFeedback UltrasonicAEnabledFeedback { get; private set; }
public BoolFeedback UltrasonicBEnabledFeedback { get; private set; } public BoolFeedback UltrasonicBEnabledFeedback { get; private set; }
public IntFeedback UltrasonicSensitivityInVacantStateFeedback { get; private set; } public IntFeedback UltrasonicSensitivityInVacantStateFeedback { get; private set; }
public IntFeedback UltrasonicSensitivityInOccupiedStateFeedback { get; private set; } public IntFeedback UltrasonicSensitivityInOccupiedStateFeedback { get; private set; }
public BoolFeedback RawOccupancyPirFeedback { get; private set; }
public GlsOdtOccupancySensorController(string key, string name, GlsOdtCCn sensor)
: base(key, name, sensor) public BoolFeedback RawOccupancyUsFeedback { get; private set; }
{
OccSensor = sensor;
public GlsOdtOccupancySensorController(string key, string name, GlsOdtCCn sensor)
AndWhenVacatedFeedback = new BoolFeedback(() => OccSensor.AndWhenVacatedFeedback.BoolValue); : base(key, name, sensor)
{
OrWhenVacatedFeedback = new BoolFeedback(() => OccSensor.OrWhenVacatedFeedback.BoolValue); OccSensor = sensor;
UltrasonicAEnabledFeedback = new BoolFeedback(() => OccSensor.UsAEnabledFeedback.BoolValue); AndWhenVacatedFeedback = new BoolFeedback(() => OccSensor.AndWhenVacatedFeedback.BoolValue);
UltrasonicBEnabledFeedback = new BoolFeedback(() => OccSensor.UsBEnabledFeedback.BoolValue); OrWhenVacatedFeedback = new BoolFeedback(() => OccSensor.OrWhenVacatedFeedback.BoolValue);
UltrasonicSensitivityInVacantStateFeedback = new IntFeedback(() => OccSensor.UsSensitivityInVacantStateFeedback.UShortValue); UltrasonicAEnabledFeedback = new BoolFeedback(() => OccSensor.UsAEnabledFeedback.BoolValue);
UltrasonicSensitivityInOccupiedStateFeedback = new IntFeedback(() => OccSensor.UsSensitivityInOccupiedStateFeedback.UShortValue); UltrasonicBEnabledFeedback = new BoolFeedback(() => OccSensor.UsBEnabledFeedback.BoolValue);
}
RawOccupancyPirFeedback = new BoolFeedback(() => OccSensor.RawOccupancyPirFeedback.BoolValue);
/// <summary>
/// Overrides the base class event delegate to fire feedbacks for event IDs that pertain to this extended class. RawOccupancyUsFeedback = new BoolFeedback(() => OccSensor.RawOccupancyUsFeedback.BoolValue);
/// Then calls the base delegate method to ensure any common event IDs are captured.
/// </summary> UltrasonicSensitivityInVacantStateFeedback = new IntFeedback(() => OccSensor.UsSensitivityInVacantStateFeedback.UShortValue);
/// <param name="device"></param>
/// <param name="args"></param> UltrasonicSensitivityInOccupiedStateFeedback = new IntFeedback(() => OccSensor.UsSensitivityInOccupiedStateFeedback.UShortValue);
protected override void OccSensor_GlsOccupancySensorChange(GlsOccupancySensorBase device, GlsOccupancySensorChangeEventArgs args) }
{
if (args.EventId == GlsOccupancySensorBase.AndWhenVacatedFeedbackEventId) /// <summary>
AndWhenVacatedFeedback.FireUpdate(); /// Overrides the base class event delegate to fire feedbacks for event IDs that pertain to this extended class.
else if (args.EventId == GlsOccupancySensorBase.OrWhenVacatedFeedbackEventId) /// Then calls the base delegate method to ensure any common event IDs are captured.
OrWhenVacatedFeedback.FireUpdate(); /// </summary>
else if (args.EventId == GlsOccupancySensorBase.UsAEnabledFeedbackEventId) /// <param name="device"></param>
UltrasonicAEnabledFeedback.FireUpdate(); /// <param name="args"></param>
else if (args.EventId == GlsOccupancySensorBase.UsBEnabledFeedbackEventId) protected override void OccSensor_GlsOccupancySensorChange(GlsOccupancySensorBase device, GlsOccupancySensorChangeEventArgs args)
UltrasonicBEnabledFeedback.FireUpdate(); {
else if (args.EventId == GlsOccupancySensorBase.UsSensitivityInOccupiedStateFeedbackEventId) if (args.EventId == GlsOccupancySensorBase.AndWhenVacatedFeedbackEventId)
UltrasonicSensitivityInOccupiedStateFeedback.FireUpdate(); AndWhenVacatedFeedback.FireUpdate();
else if (args.EventId == GlsOccupancySensorBase.UsSensitivityInVacantStateFeedbackEventId) else if (args.EventId == GlsOccupancySensorBase.OrWhenVacatedFeedbackEventId)
UltrasonicSensitivityInVacantStateFeedback.FireUpdate(); OrWhenVacatedFeedback.FireUpdate();
else if (args.EventId == GlsOccupancySensorBase.UsAEnabledFeedbackEventId)
UltrasonicAEnabledFeedback.FireUpdate();
base.OccSensor_GlsOccupancySensorChange(device, args); else if (args.EventId == GlsOccupancySensorBase.UsBEnabledFeedbackEventId)
} UltrasonicBEnabledFeedback.FireUpdate();
else if (args.EventId == GlsOccupancySensorBase.UsSensitivityInOccupiedStateFeedbackEventId)
/// <summary> UltrasonicSensitivityInOccupiedStateFeedback.FireUpdate();
/// Sets the OrWhenVacated state else if (args.EventId == GlsOccupancySensorBase.UsSensitivityInVacantStateFeedbackEventId)
/// </summary> UltrasonicSensitivityInVacantStateFeedback.FireUpdate();
/// <param name="state"></param>
public void SetOrWhenVacatedState(bool state) base.OccSensor_GlsOccupancySensorChange(device, args);
{ }
OccSensor.OrWhenVacated.BoolValue = state;
} /// <summary>
/// Overrides the base class event delegate to fire feedbacks for event IDs that pertain to this extended class.
/// <summary> /// Then calls the base delegate method to ensure any common event IDs are captured.
/// Sets the AndWhenVacated state /// </summary>
/// </summary> /// <param name="device"></param>
/// <param name="state"></param> /// <param name="args"></param>
public void SetAndWhenVacatedState(bool state) protected override void OccSensor_BaseEvent(Crestron.SimplSharpPro.GenericBase device, Crestron.SimplSharpPro.BaseEventArgs args)
{ {
OccSensor.AndWhenVacated.BoolValue = state; if (args.EventId == GlsOccupancySensorBase.RawOccupancyPirFeedbackEventId)
} RawOccupancyPirFeedback.FireUpdate();
else if (args.EventId == GlsOccupancySensorBase.RawOccupancyUsFeedbackEventId)
/// <summary> RawOccupancyUsFeedback.FireUpdate();
/// Enables or disables the Ultrasonic A sensor
/// </summary> base.OccSensor_BaseEvent(device, args);
/// <param name="state"></param> }
public void SetUsAEnable(bool state)
{ /// <summary>
if (state) /// Sets the OrWhenVacated state
{ /// </summary>
OccSensor.EnableUsA.BoolValue = state; /// <param name="state"></param>
OccSensor.DisableUsA.BoolValue = !state; public void SetOrWhenVacatedState(bool state)
} {
else OccSensor.OrWhenVacated.BoolValue = state;
{ }
OccSensor.EnableUsA.BoolValue = state;
OccSensor.DisableUsA.BoolValue = !state; /// <summary>
} /// Sets the AndWhenVacated state
} /// </summary>
/// <param name="state"></param>
public void SetAndWhenVacatedState(bool state)
/// <summary> {
/// Enables or disables the Ultrasonic B sensor OccSensor.AndWhenVacated.BoolValue = state;
/// </summary> }
/// <param name="state"></param>
public void SetUsBEnable(bool state) /// <summary>
{ /// Enables or disables the Ultrasonic A sensor
if (state) /// </summary>
{ /// <param name="state"></param>
OccSensor.EnableUsB.BoolValue = state; public void SetUsAEnable(bool state)
OccSensor.DisableUsB.BoolValue = !state; {
} if (state)
else {
{ OccSensor.EnableUsA.BoolValue = state;
OccSensor.EnableUsB.BoolValue = state; OccSensor.DisableUsA.BoolValue = !state;
OccSensor.DisableUsB.BoolValue = !state; }
} else
} {
OccSensor.EnableUsA.BoolValue = state;
public void IncrementUsSensitivityInOccupiedState(bool pressRelease) OccSensor.DisableUsA.BoolValue = !state;
{ }
OccSensor.IncrementUsSensitivityInOccupiedState.BoolValue = pressRelease; }
}
public void DecrementUsSensitivityInOccupiedState(bool pressRelease) /// <summary>
{ /// Enables or disables the Ultrasonic B sensor
OccSensor.DecrementUsSensitivityInOccupiedState.BoolValue = pressRelease; /// </summary>
} /// <param name="state"></param>
public void SetUsBEnable(bool state)
public void IncrementUsSensitivityInVacantState(bool pressRelease) {
{ if (state)
OccSensor.IncrementUsSensitivityInVacantState.BoolValue = pressRelease; {
} OccSensor.EnableUsB.BoolValue = state;
OccSensor.DisableUsB.BoolValue = !state;
public void DecrementUsSensitivityInVacantState(bool pressRelease) }
{ else
OccSensor.DecrementUsSensitivityInVacantState.BoolValue = pressRelease; {
} OccSensor.EnableUsB.BoolValue = state;
} OccSensor.DisableUsB.BoolValue = !state;
}
}
public void IncrementUsSensitivityInOccupiedState(bool pressRelease)
{
OccSensor.IncrementUsSensitivityInOccupiedState.BoolValue = pressRelease;
}
public void DecrementUsSensitivityInOccupiedState(bool pressRelease)
{
OccSensor.DecrementUsSensitivityInOccupiedState.BoolValue = pressRelease;
}
public void IncrementUsSensitivityInVacantState(bool pressRelease)
{
OccSensor.IncrementUsSensitivityInVacantState.BoolValue = pressRelease;
}
public void DecrementUsSensitivityInVacantState(bool pressRelease)
{
OccSensor.DecrementUsSensitivityInVacantState.BoolValue = pressRelease;
}
}
} }

View file

@ -1,7 +1,10 @@
using System.Reflection; using System.Reflection;
using Crestron.SimplSharp.Reflection;
[assembly: AssemblyTitle("Essentials_Devices_Common")] [assembly: System.Reflection.AssemblyTitle("Essentials_Devices_Common")]
[assembly: AssemblyCompany("PepperDash Technology Corp")] [assembly: System.Reflection.AssemblyCompany("PepperDash Technology Corp")]
[assembly: AssemblyProduct("Essentials_Devices_Common")] [assembly: System.Reflection.AssemblyProduct("PepperDashEssentials")]
[assembly: AssemblyCopyright("Copyright © 2019")] [assembly: System.Reflection.AssemblyCopyright("Copyright © PepperDash Technology Corp 2020")]
[assembly: AssemblyVersion("1.4.*")] [assembly: System.Reflection.AssemblyVersion("0.0.0.*")]
[assembly: System.Reflection.AssemblyInformationalVersion("0.0.0-buildType-buildNumber")]
[assembly: Crestron.SimplSharp.Reflection.AssemblyInformationalVersion("0.0.0-buildType-buildNumber")]

View file

@ -1,343 +1,371 @@
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; using Crestron.SimplSharpPro;
using PepperDash.Core; using PepperDash.Core;
using PepperDash.Essentials.Core; using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Presets; using PepperDash.Essentials.Core.Presets;
using PepperDash.Essentials.Core.Routing; using PepperDash.Essentials.Core.Routing;
namespace PepperDash.Essentials.Devices.Common namespace PepperDash.Essentials.Devices.Common
{ {
public class IRSetTopBoxBase : Device, ISetTopBoxControls, IUiDisplayInfo, IRoutingOutputs, IUsageTracking public class IRSetTopBoxBase : Device, ISetTopBoxControls, IUiDisplayInfo, IRoutingOutputs, IUsageTracking, IPower
{ {
public IrOutputPortController IrPort { get; private set; } public IrOutputPortController IrPort { get; private set; }
public uint DisplayUiType { get { return DisplayUiConstants.TypeDirecTv; } } public uint DisplayUiType { get { return DisplayUiConstants.TypeDirecTv; } }
public bool HasPresets { get; set; } public bool HasPresets { get; set; }
public bool HasDvr { get; set; } public bool HasDvr { get; set; }
public bool HasDpad { get; set; } public bool HasDpad { get; set; }
public bool HasNumeric { get; set; } public bool HasNumeric { get; set; }
public DevicePresetsModel PresetsModel { get; private set; } public DevicePresetsModel PresetsModel { get; private set; }
public IRSetTopBoxBase(string key, string name, IrOutputPortController portCont, public IRSetTopBoxBase(string key, string name, IrOutputPortController portCont,
SetTopBoxPropertiesConfig props) SetTopBoxPropertiesConfig props)
: base(key, name) : base(key, name)
{ {
IrPort = portCont; IrPort = portCont;
DeviceManager.AddDevice(portCont); DeviceManager.AddDevice(portCont);
HasPresets = props.HasPresets; HasPresets = props.HasPresets;
HasDvr = props.HasDvr; HasDvr = props.HasDvr;
HasDpad = props.HasDpad; HasDpad = props.HasDpad;
HasNumeric = props.HasNumeric; HasNumeric = props.HasNumeric;
HasKeypadAccessoryButton1 = true; HasKeypadAccessoryButton1 = true;
KeypadAccessoryButton1Command = "Dash"; KeypadAccessoryButton1Command = "Dash";
KeypadAccessoryButton1Label = "-"; KeypadAccessoryButton1Label = "-";
HasKeypadAccessoryButton2 = true; HasKeypadAccessoryButton2 = true;
KeypadAccessoryButton2Command = "NumericEnter"; KeypadAccessoryButton2Command = "NumericEnter";
KeypadAccessoryButton2Label = "Enter"; KeypadAccessoryButton2Label = "Enter";
AnyVideoOut = new RoutingOutputPort(RoutingPortNames.AnyVideoOut, eRoutingSignalType.Audio | eRoutingSignalType.Video, AnyVideoOut = new RoutingOutputPort(RoutingPortNames.AnyVideoOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
eRoutingPortConnectionType.Hdmi, null, this); eRoutingPortConnectionType.Hdmi, null, this);
AnyAudioOut = new RoutingOutputPort(RoutingPortNames.AnyAudioOut, eRoutingSignalType.Audio, AnyAudioOut = new RoutingOutputPort(RoutingPortNames.AnyAudioOut, eRoutingSignalType.Audio,
eRoutingPortConnectionType.DigitalAudio, null, this); eRoutingPortConnectionType.DigitalAudio, null, this);
OutputPorts = new RoutingPortCollection<RoutingOutputPort> { AnyVideoOut, AnyAudioOut }; OutputPorts = new RoutingPortCollection<RoutingOutputPort> { AnyVideoOut, AnyAudioOut };
} }
public void LoadPresets(string filePath) public void LoadPresets(string filePath)
{ {
PresetsModel = new DevicePresetsModel(Key + "-presets", this, filePath); PresetsModel = new DevicePresetsModel(Key + "-presets", this, filePath);
DeviceManager.AddDevice(PresetsModel); DeviceManager.AddDevice(PresetsModel);
} }
#region ISetTopBoxControls Members #region ISetTopBoxControls Members
public void DvrList(bool pressRelease) public void DvrList(bool pressRelease)
{ {
IrPort.PressRelease(IROutputStandardCommands.IROut_DVR, pressRelease); IrPort.PressRelease(IROutputStandardCommands.IROut_DVR, pressRelease);
} }
public void Replay(bool pressRelease) public void Replay(bool pressRelease)
{ {
IrPort.PressRelease(IROutputStandardCommands.IROut_REPLAY, pressRelease); IrPort.PressRelease(IROutputStandardCommands.IROut_REPLAY, pressRelease);
} }
#endregion #endregion
#region IDPad Members #region IDPad Members
public void Up(bool pressRelease) public void Up(bool pressRelease)
{ {
IrPort.PressRelease(IROutputStandardCommands.IROut_UP_ARROW, pressRelease); IrPort.PressRelease(IROutputStandardCommands.IROut_UP_ARROW, pressRelease);
} }
public void Down(bool pressRelease) public void Down(bool pressRelease)
{ {
IrPort.PressRelease(IROutputStandardCommands.IROut_DN_ARROW, pressRelease); IrPort.PressRelease(IROutputStandardCommands.IROut_DN_ARROW, pressRelease);
} }
public void Left(bool pressRelease) public void Left(bool pressRelease)
{ {
IrPort.PressRelease(IROutputStandardCommands.IROut_LEFT_ARROW, pressRelease); IrPort.PressRelease(IROutputStandardCommands.IROut_LEFT_ARROW, pressRelease);
} }
public void Right(bool pressRelease) public void Right(bool pressRelease)
{ {
IrPort.PressRelease(IROutputStandardCommands.IROut_RIGHT_ARROW, pressRelease); IrPort.PressRelease(IROutputStandardCommands.IROut_RIGHT_ARROW, pressRelease);
} }
public void Select(bool pressRelease) public void Select(bool pressRelease)
{ {
IrPort.PressRelease(IROutputStandardCommands.IROut_ENTER, pressRelease); IrPort.PressRelease(IROutputStandardCommands.IROut_ENTER, pressRelease);
} }
public void Menu(bool pressRelease) public void Menu(bool pressRelease)
{ {
IrPort.PressRelease(IROutputStandardCommands.IROut_MENU, pressRelease); IrPort.PressRelease(IROutputStandardCommands.IROut_MENU, pressRelease);
} }
public void Exit(bool pressRelease) public void Exit(bool pressRelease)
{ {
IrPort.PressRelease(IROutputStandardCommands.IROut_EXIT, pressRelease); IrPort.PressRelease(IROutputStandardCommands.IROut_EXIT, pressRelease);
} }
#endregion #endregion
#region INumericKeypad Members #region INumericKeypad Members
public void Digit0(bool pressRelease) public void Digit0(bool pressRelease)
{ {
IrPort.PressRelease(IROutputStandardCommands.IROut_0, pressRelease); IrPort.PressRelease(IROutputStandardCommands.IROut_0, pressRelease);
} }
public void Digit1(bool pressRelease) public void Digit1(bool pressRelease)
{ {
IrPort.PressRelease(IROutputStandardCommands.IROut_1, pressRelease); IrPort.PressRelease(IROutputStandardCommands.IROut_1, pressRelease);
} }
public void Digit2(bool pressRelease) public void Digit2(bool pressRelease)
{ {
IrPort.PressRelease(IROutputStandardCommands.IROut_2, pressRelease); IrPort.PressRelease(IROutputStandardCommands.IROut_2, pressRelease);
} }
public void Digit3(bool pressRelease) public void Digit3(bool pressRelease)
{ {
IrPort.PressRelease(IROutputStandardCommands.IROut_3, pressRelease); IrPort.PressRelease(IROutputStandardCommands.IROut_3, pressRelease);
} }
public void Digit4(bool pressRelease) public void Digit4(bool pressRelease)
{ {
IrPort.PressRelease(IROutputStandardCommands.IROut_4, pressRelease); IrPort.PressRelease(IROutputStandardCommands.IROut_4, pressRelease);
} }
public void Digit5(bool pressRelease) public void Digit5(bool pressRelease)
{ {
IrPort.PressRelease(IROutputStandardCommands.IROut_5, pressRelease); IrPort.PressRelease(IROutputStandardCommands.IROut_5, pressRelease);
} }
public void Digit6(bool pressRelease) public void Digit6(bool pressRelease)
{ {
IrPort.PressRelease(IROutputStandardCommands.IROut_6, pressRelease); IrPort.PressRelease(IROutputStandardCommands.IROut_6, pressRelease);
} }
public void Digit7(bool pressRelease) public void Digit7(bool pressRelease)
{ {
IrPort.PressRelease(IROutputStandardCommands.IROut_7, pressRelease); IrPort.PressRelease(IROutputStandardCommands.IROut_7, pressRelease);
} }
public void Digit8(bool pressRelease) public void Digit8(bool pressRelease)
{ {
IrPort.PressRelease(IROutputStandardCommands.IROut_8, pressRelease); IrPort.PressRelease(IROutputStandardCommands.IROut_8, pressRelease);
} }
public void Digit9(bool pressRelease) public void Digit9(bool pressRelease)
{ {
IrPort.PressRelease(IROutputStandardCommands.IROut_9, pressRelease); IrPort.PressRelease(IROutputStandardCommands.IROut_9, pressRelease);
} }
/// <summary> /// <summary>
/// Defaults to true /// Defaults to true
/// </summary> /// </summary>
public bool HasKeypadAccessoryButton1 { get; set; } public bool HasKeypadAccessoryButton1 { get; set; }
/// <summary> /// <summary>
/// Defaults to "-" /// Defaults to "-"
/// </summary> /// </summary>
public string KeypadAccessoryButton1Label { get; set; } public string KeypadAccessoryButton1Label { get; set; }
/// <summary> /// <summary>
/// Defaults to "Dash" /// Defaults to "Dash"
/// </summary> /// </summary>
public string KeypadAccessoryButton1Command { get; set; } public string KeypadAccessoryButton1Command { get; set; }
public void KeypadAccessoryButton1(bool pressRelease) public void KeypadAccessoryButton1(bool pressRelease)
{ {
IrPort.PressRelease(KeypadAccessoryButton1Command, pressRelease); IrPort.PressRelease(KeypadAccessoryButton1Command, pressRelease);
} }
/// <summary> /// <summary>
/// Defaults to true /// Defaults to true
/// </summary> /// </summary>
public bool HasKeypadAccessoryButton2 { get; set; } public bool HasKeypadAccessoryButton2 { get; set; }
/// <summary> /// <summary>
/// Defaults to "Enter" /// Defaults to "Enter"
/// </summary> /// </summary>
public string KeypadAccessoryButton2Label { get; set; } public string KeypadAccessoryButton2Label { get; set; }
/// <summary> /// <summary>
/// Defaults to "Enter" /// Defaults to "Enter"
/// </summary> /// </summary>
public string KeypadAccessoryButton2Command { get; set; } public string KeypadAccessoryButton2Command { get; set; }
public void KeypadAccessoryButton2(bool pressRelease) public void KeypadAccessoryButton2(bool pressRelease)
{ {
IrPort.PressRelease(KeypadAccessoryButton2Command, pressRelease); IrPort.PressRelease(KeypadAccessoryButton2Command, pressRelease);
} }
#endregion #endregion
#region ISetTopBoxNumericKeypad Members #region ISetTopBoxNumericKeypad Members
/// <summary> /// <summary>
/// Corresponds to "dash" IR command /// Corresponds to "dash" IR command
/// </summary> /// </summary>
public void Dash(bool pressRelease) public void Dash(bool pressRelease)
{ {
IrPort.PressRelease("dash", pressRelease); IrPort.PressRelease("dash", pressRelease);
} }
/// <summary> /// <summary>
/// Corresponds to "numericEnter" IR command /// Corresponds to "numericEnter" IR command
/// </summary> /// </summary>
public void KeypadEnter(bool pressRelease) public void KeypadEnter(bool pressRelease)
{ {
IrPort.PressRelease("numericEnter", pressRelease); IrPort.PressRelease("numericEnter", pressRelease);
} }
#endregion #endregion
#region IChannelFunctions Members #region IChannelFunctions Members
public void ChannelUp(bool pressRelease) public void ChannelUp(bool pressRelease)
{ {
IrPort.PressRelease(IROutputStandardCommands.IROut_CH_PLUS, pressRelease); IrPort.PressRelease(IROutputStandardCommands.IROut_CH_PLUS, pressRelease);
} }
public void ChannelDown(bool pressRelease) public void ChannelDown(bool pressRelease)
{ {
IrPort.PressRelease(IROutputStandardCommands.IROut_CH_MINUS, pressRelease); IrPort.PressRelease(IROutputStandardCommands.IROut_CH_MINUS, pressRelease);
} }
public void LastChannel(bool pressRelease) public void LastChannel(bool pressRelease)
{ {
IrPort.PressRelease(IROutputStandardCommands.IROut_LAST, pressRelease); IrPort.PressRelease(IROutputStandardCommands.IROut_LAST, pressRelease);
} }
public void Guide(bool pressRelease) public void Guide(bool pressRelease)
{ {
IrPort.PressRelease(IROutputStandardCommands.IROut_GUIDE, pressRelease); IrPort.PressRelease(IROutputStandardCommands.IROut_GUIDE, pressRelease);
} }
public void Info(bool pressRelease) public void Info(bool pressRelease)
{ {
IrPort.PressRelease(IROutputStandardCommands.IROut_INFO, pressRelease); IrPort.PressRelease(IROutputStandardCommands.IROut_INFO, pressRelease);
} }
#endregion #endregion
#region IColorFunctions Members #region IColorFunctions Members
public void Red(bool pressRelease) public void Red(bool pressRelease)
{ {
IrPort.PressRelease(IROutputStandardCommands.IROut_RED, pressRelease); IrPort.PressRelease(IROutputStandardCommands.IROut_RED, pressRelease);
} }
public void Green(bool pressRelease) public void Green(bool pressRelease)
{ {
IrPort.PressRelease(IROutputStandardCommands.IROut_GREEN, pressRelease); IrPort.PressRelease(IROutputStandardCommands.IROut_GREEN, pressRelease);
} }
public void Yellow(bool pressRelease) public void Yellow(bool pressRelease)
{ {
IrPort.PressRelease(IROutputStandardCommands.IROut_YELLOW, pressRelease); IrPort.PressRelease(IROutputStandardCommands.IROut_YELLOW, pressRelease);
} }
public void Blue(bool pressRelease) public void Blue(bool pressRelease)
{ {
IrPort.PressRelease(IROutputStandardCommands.IROut_BLUE, pressRelease); IrPort.PressRelease(IROutputStandardCommands.IROut_BLUE, pressRelease);
} }
#endregion #endregion
#region IRoutingOutputs Members #region IRoutingOutputs Members
public RoutingOutputPort AnyVideoOut { get; private set; } public RoutingOutputPort AnyVideoOut { get; private set; }
public RoutingOutputPort AnyAudioOut { get; private set; } public RoutingOutputPort AnyAudioOut { get; private set; }
public RoutingPortCollection<RoutingOutputPort> OutputPorts { get; private set; } public RoutingPortCollection<RoutingOutputPort> OutputPorts { get; private set; }
#endregion #endregion
#region ITransport Members #region ITransport Members
public void ChapMinus(bool pressRelease) public void ChapMinus(bool pressRelease)
{ {
IrPort.PressRelease(IROutputStandardCommands.IROut_REPLAY, pressRelease); IrPort.PressRelease(IROutputStandardCommands.IROut_REPLAY, pressRelease);
} }
public void ChapPlus(bool pressRelease) public void ChapPlus(bool pressRelease)
{ {
} }
public void FFwd(bool pressRelease) public void FFwd(bool pressRelease)
{ {
IrPort.PressRelease(IROutputStandardCommands.IROut_FSCAN, pressRelease); IrPort.PressRelease(IROutputStandardCommands.IROut_FSCAN, pressRelease);
} }
public void Pause(bool pressRelease) public void Pause(bool pressRelease)
{ {
IrPort.PressRelease(IROutputStandardCommands.IROut_RSCAN, pressRelease); IrPort.PressRelease(IROutputStandardCommands.IROut_RSCAN, pressRelease);
} }
public void Play(bool pressRelease) public void Play(bool pressRelease)
{ {
IrPort.PressRelease(IROutputStandardCommands.IROut_PLAY, pressRelease); IrPort.PressRelease(IROutputStandardCommands.IROut_PLAY, pressRelease);
} }
public void Record(bool pressRelease) public void Record(bool pressRelease)
{ {
IrPort.PressRelease(IROutputStandardCommands.IROut_RECORD, pressRelease); IrPort.PressRelease(IROutputStandardCommands.IROut_RECORD, pressRelease);
} }
public void Rewind(bool pressRelease) public void Rewind(bool pressRelease)
{ {
IrPort.PressRelease(IROutputStandardCommands.IROut_RSCAN, pressRelease); IrPort.PressRelease(IROutputStandardCommands.IROut_RSCAN, pressRelease);
} }
public void Stop(bool pressRelease) public void Stop(bool pressRelease)
{ {
IrPort.PressRelease(IROutputStandardCommands.IROut_STOP, pressRelease); IrPort.PressRelease(IROutputStandardCommands.IROut_STOP, pressRelease);
} }
#endregion #endregion
#region IUsageTracking Members #region IUsageTracking Members
public UsageTracking UsageTracker { get; set; } public UsageTracking UsageTracker { get; set; }
#endregion #endregion
}
#region IPower Members
public void PowerOn()
{
IrPort.PressRelease(IROutputStandardCommands.IROut_POWER_ON, true);
IrPort.PressRelease(IROutputStandardCommands.IROut_POWER_ON, false);
}
public void PowerOff()
{
IrPort.PressRelease(IROutputStandardCommands.IROut_POWER_OFF, true);
IrPort.PressRelease(IROutputStandardCommands.IROut_POWER_OFF, false);
}
public void PowerToggle()
{
throw new NotImplementedException();
}
public BoolFeedback PowerIsOnFeedback
{
get { throw new NotImplementedException(); }
}
#endregion
}
} }

View file

@ -336,8 +336,10 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
if(b.Agenda != null) if(b.Agenda != null)
meeting.Agenda = b.Agenda.Value; meeting.Agenda = b.Agenda.Value;
if(b.Time != null) if(b.Time != null)
{
meeting.StartTime = b.Time.StartTime.Value; meeting.StartTime = b.Time.StartTime.Value;
meeting.EndTime = b.Time.EndTime.Value; meeting.EndTime = b.Time.EndTime.Value;
}
if(b.Privacy != null) if(b.Privacy != null)
meeting.Privacy = CodecCallPrivacy.ConvertToDirectionEnum(b.Privacy.Value); meeting.Privacy = CodecCallPrivacy.ConvertToDirectionEnum(b.Privacy.Value);