mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-16 05:05:00 +00:00
Merge remote-tracking branch 'origin/development' into feature/ecs-1257
This commit is contained in:
7
.github/.vscode/settings.json
vendored
Normal file
7
.github/.vscode/settings.json
vendored
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"workbench.colorCustomizations": {
|
||||||
|
"activityBar.background": "#59014E",
|
||||||
|
"titleBar.activeBackground": "#7C016D",
|
||||||
|
"titleBar.activeForeground": "#FFF8FE"
|
||||||
|
}
|
||||||
|
}
|
||||||
38
.github/scripts/GenerateVersionNumber.ps1
vendored
Normal file
38
.github/scripts/GenerateVersionNumber.ps1
vendored
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
$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 + 1)
|
||||||
|
}
|
||||||
|
'^refs\/heads\/feature\/*.' {
|
||||||
|
$phase = 'alpha'
|
||||||
|
}
|
||||||
|
'^refs\/heads\/release\/*.' {
|
||||||
|
$phase = 'rc'
|
||||||
|
}
|
||||||
|
'^refs\/heads\/development*.' {
|
||||||
|
$phase = 'beta'
|
||||||
|
}
|
||||||
|
'^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
|
||||||
40
.github/scripts/UpdateAssemblyVersion.ps1
vendored
Normal file
40
.github/scripts/UpdateAssemblyVersion.ps1
vendored
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
function Update-SourceVersion {
|
||||||
|
Param ([string]$Version)
|
||||||
|
#$fullVersion = $Version
|
||||||
|
$baseVersion = [regex]::Match($Version, "(\d+.\d+.\d+).*").captures.groups[1].value
|
||||||
|
$NewAssemblyVersion = ‘AssemblyVersion("‘ + $baseVersion + ‘.*")’
|
||||||
|
Write-Output "AssemblyVersion = $NewAssemblyVersion"
|
||||||
|
$NewAssemblyInformationalVersion = ‘AssemblyInformationalVersion("‘ + $Version + ‘")’
|
||||||
|
Write-Output "AssemblyInformationalVersion = $NewAssemblyInformationalVersion"
|
||||||
|
|
||||||
|
foreach ($o in $input) {
|
||||||
|
Write-output $o.FullName
|
||||||
|
$TmpFile = $o.FullName + “.tmp”
|
||||||
|
get-content $o.FullName |
|
||||||
|
ForEach-Object {
|
||||||
|
$_ -replace ‘AssemblyVersion\(".*"\)’, $NewAssemblyVersion } |
|
||||||
|
ForEach-Object {
|
||||||
|
$_ -replace ‘AssemblyInformationalVersion\(".*"\)’, $NewAssemblyInformationalVersion
|
||||||
|
} > $TmpFile
|
||||||
|
move-item $TmpFile $o.FullName -force
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function Update-AllAssemblyInfoFiles ( $version ) {
|
||||||
|
foreach ($file in “AssemblyInfo.cs”, “AssemblyInfo.vb” ) {
|
||||||
|
get-childitem -Path $Env:GITHUB_WORKSPACE -recurse | Where-Object { $_.Name -eq $file } | Update-SourceVersion $version ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# validate arguments
|
||||||
|
$r = [System.Text.RegularExpressions.Regex]::Match($args[0], "\d+\.\d+\.\d+.*");
|
||||||
|
if ($r.Success) {
|
||||||
|
Write-Output "Updating Assembly Version to $args ...";
|
||||||
|
Update-AllAssemblyInfoFiles $args[0];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Write-Output ” “;
|
||||||
|
Write-Output “Error: Input version does not match x.y.z format!”
|
||||||
|
Write-Output ” “;
|
||||||
|
Write-Output "Unable to apply version to AssemblyInfo.cs files";
|
||||||
|
}
|
||||||
41
.github/scripts/ZipBuildOutput.ps1
vendored
Normal file
41
.github/scripts/ZipBuildOutput.ps1
vendored
Normal 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
|
||||||
247
.github/workflows/docker.yml
vendored
Normal file
247
.github/workflows/docker.yml
vendored
Normal file
@@ -0,0 +1,247 @@
|
|||||||
|
name: Branch Build Using Docker
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- feature/*
|
||||||
|
- hotfix/*
|
||||||
|
- release/*
|
||||||
|
- master
|
||||||
|
- 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
|
||||||
|
# Set the BUILD_TYPE environment variable
|
||||||
|
- name: Set Build to Release if triggered from Master
|
||||||
|
run: |
|
||||||
|
if("$($Env:GITHUB_REF)".contains("$($Env:RELEASE_BRANCH)")) {
|
||||||
|
Write-Host "Setting build type to Release"
|
||||||
|
Write-Output "::set-env name=BUILD_TYPE::Release"
|
||||||
|
}
|
||||||
|
# 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 ./
|
||||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -22,3 +22,6 @@ _ReSharper*/
|
|||||||
SIMPLSharpLogs/
|
SIMPLSharpLogs/
|
||||||
*.projectinfo
|
*.projectinfo
|
||||||
essentials-framework/EssentialDMTestConfig/
|
essentials-framework/EssentialDMTestConfig/
|
||||||
|
output/
|
||||||
|
|
||||||
|
PepperDashEssentials-0.0.0-buildType-test.zip
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
@@ -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 DmChassisControllerApiExtensions
|
{
|
||||||
{
|
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 (advancedTxDevice != null) // Advanced TX device
|
|
||||||
{
|
if (basicTxDevice != null && advancedTxDevice == null)
|
||||||
advancedTxDevice.AnyVideoInput.VideoStatus.VideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.VideoSyncStatus + ioSlot]);
|
trilist.BooleanInput[joinMap.TxAdvancedIsPresent + ioSlot].BoolValue = true;
|
||||||
|
|
||||||
// Flag if the TX is an advanced endpoint type
|
if (advancedTxDevice != null)
|
||||||
trilist.BooleanInput[joinMap.TxAdvancedIsPresent + ioSlot].BoolValue = true;
|
{
|
||||||
}
|
advancedTxDevice.AnyVideoInput.VideoStatus.VideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.VideoSyncStatus + ioSlot]);
|
||||||
else if(advancedTxDevice == null || basicTxDevice != null) // Basic TX device
|
}
|
||||||
{
|
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;
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -31,6 +31,16 @@ namespace PepperDash.Essentials.Bridges
|
|||||||
|
|
||||||
#region Single and Dual Sensor Stuff
|
#region Single and Dual Sensor Stuff
|
||||||
occController.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
|
occController.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
|
||||||
|
trilist.StringInput[joinMap.Name].StringValue = occController.Name;
|
||||||
|
|
||||||
|
trilist.OnlineStatusChange += new Crestron.SimplSharpPro.OnlineStatusChangeEventHandler((d, args) =>
|
||||||
|
{
|
||||||
|
if (args.DeviceOnLine)
|
||||||
|
{
|
||||||
|
trilist.StringInput[joinMap.Name].StringValue = occController.Name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
// Occupied status
|
// Occupied status
|
||||||
trilist.SetSigTrueAction(joinMap.ForceOccupied, new Action(() => occController.ForceOccupied()));
|
trilist.SetSigTrueAction(joinMap.ForceOccupied, new Action(() => occController.ForceOccupied()));
|
||||||
@@ -38,6 +48,7 @@ namespace PepperDash.Essentials.Bridges
|
|||||||
occController.RoomIsOccupiedFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RoomOccupiedFeedback]);
|
occController.RoomIsOccupiedFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RoomOccupiedFeedback]);
|
||||||
occController.RoomIsOccupiedFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.RoomVacantFeedback]);
|
occController.RoomIsOccupiedFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.RoomVacantFeedback]);
|
||||||
occController.RawOccupancyFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RawOccupancyFeedback]);
|
occController.RawOccupancyFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RawOccupancyFeedback]);
|
||||||
|
trilist.SetBoolSigAction(joinMap.EnableRawStates, new Action<bool>((b) => occController.EnableRawStates(b)));
|
||||||
|
|
||||||
// Timouts
|
// Timouts
|
||||||
trilist.SetUShortSigAction(joinMap.Timeout, new Action<ushort>((u) => occController.SetRemoteTimeout(u)));
|
trilist.SetUShortSigAction(joinMap.Timeout, new Action<ushort>((u) => occController.SetRemoteTimeout(u)));
|
||||||
|
|||||||
128
PepperDashEssentials/Bridges/IRSetTopBoxBaseBridge.cs
Normal file
128
PepperDashEssentials/Bridges/IRSetTopBoxBaseBridge.cs
Normal file
@@ -0,0 +1,128 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using Crestron.SimplSharp;
|
||||||
|
using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
|
using PepperDash.Core;
|
||||||
|
using PepperDash.Essentials.Core;
|
||||||
|
using PepperDash.Essentials.Devices.Common;
|
||||||
|
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.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));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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,7 @@ 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;
|
TxAdvancedIsPresent = TxAdvancedIsPresent + joinOffset;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -137,6 +137,10 @@ namespace PepperDash.Essentials.Bridges
|
|||||||
public uint PirSensitivityInVacantState { get; set; }
|
public uint PirSensitivityInVacantState { get; set; }
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region Serial
|
||||||
|
public uint Name { get; set; }
|
||||||
|
#endregion
|
||||||
|
|
||||||
public GlsOccupancySensorBaseJoinMap()
|
public GlsOccupancySensorBaseJoinMap()
|
||||||
{
|
{
|
||||||
IsOnline = 1;
|
IsOnline = 1;
|
||||||
@@ -177,7 +181,10 @@ namespace PepperDash.Essentials.Bridges
|
|||||||
UsSensitivityInOccupiedState = 5;
|
UsSensitivityInOccupiedState = 5;
|
||||||
UsSensitivityInVacantState = 6;
|
UsSensitivityInVacantState = 6;
|
||||||
PirSensitivityInOccupiedState = 7;
|
PirSensitivityInOccupiedState = 7;
|
||||||
PirSensitivityInVacantState = 8;
|
PirSensitivityInVacantState = 8;
|
||||||
|
|
||||||
|
Name = 1;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void OffsetJoinNumbers(uint joinStart)
|
public override void OffsetJoinNumbers(uint joinStart)
|
||||||
@@ -206,7 +213,6 @@ namespace PepperDash.Essentials.Bridges
|
|||||||
DisableUsB = DisableUsB + joinOffset;
|
DisableUsB = DisableUsB + joinOffset;
|
||||||
EnablePir = EnablePir + joinOffset;
|
EnablePir = EnablePir + joinOffset;
|
||||||
DisablePir = DisablePir + joinOffset;
|
DisablePir = DisablePir + joinOffset;
|
||||||
DisablePir = DisablePir + joinOffset;
|
|
||||||
IncrementUsInOccupiedState = IncrementUsInOccupiedState + joinOffset;
|
IncrementUsInOccupiedState = IncrementUsInOccupiedState + joinOffset;
|
||||||
DecrementUsInOccupiedState = DecrementUsInOccupiedState + joinOffset;
|
DecrementUsInOccupiedState = DecrementUsInOccupiedState + joinOffset;
|
||||||
IncrementUsInVacantState = IncrementUsInVacantState + joinOffset;
|
IncrementUsInVacantState = IncrementUsInVacantState + joinOffset;
|
||||||
@@ -224,6 +230,8 @@ namespace PepperDash.Essentials.Bridges
|
|||||||
UsSensitivityInVacantState = UsSensitivityInVacantState + joinOffset;
|
UsSensitivityInVacantState = UsSensitivityInVacantState + joinOffset;
|
||||||
PirSensitivityInOccupiedState = PirSensitivityInOccupiedState + joinOffset;
|
PirSensitivityInOccupiedState = PirSensitivityInOccupiedState + joinOffset;
|
||||||
PirSensitivityInVacantState = PirSensitivityInVacantState + joinOffset;
|
PirSensitivityInVacantState = PirSensitivityInVacantState + joinOffset;
|
||||||
|
|
||||||
|
Name = Name + joinOffset;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -61,6 +61,16 @@ namespace PepperDash.Essentials.Bridges
|
|||||||
(b => SystemMonitor.ProgramCollection[programNumber].RegistrationState = eProgramRegistrationState.Unregister));
|
(b => SystemMonitor.ProgramCollection[programNumber].RegistrationState = eProgramRegistrationState.Unregister));
|
||||||
p.Value.ProgramUnregisteredFeedback.LinkInputSig(trilist.BooleanInput[programSlotJoinStart + joinMap.ProgramUnregister]);
|
p.Value.ProgramUnregisteredFeedback.LinkInputSig(trilist.BooleanInput[programSlotJoinStart + joinMap.ProgramUnregister]);
|
||||||
|
|
||||||
|
p.Value.ProgramNameFeedback.LinkInputSig(trilist.StringInput[programSlotJoinStart + joinMap.ProgramName]);
|
||||||
|
p.Value.ProgramCompileTimeFeedback.LinkInputSig(
|
||||||
|
trilist.StringInput[programSlotJoinStart + joinMap.ProgramCompiledTime]);
|
||||||
|
p.Value.CrestronDataBaseVersionFeedback.LinkInputSig(
|
||||||
|
trilist.StringInput[programSlotJoinStart + joinMap.ProgramCrestronDatabaseVersion]);
|
||||||
|
p.Value.EnvironmentVersionFeedback.LinkInputSig(
|
||||||
|
trilist.StringInput[programSlotJoinStart + joinMap.ProgramEnvironmentVersion]);
|
||||||
|
p.Value.AggregatedProgramInfoFeedback.LinkInputSig(
|
||||||
|
trilist.StringInput[programSlotJoinStart + joinMap.AggregatedProgramInfo]);
|
||||||
|
|
||||||
programSlotJoinStart = programSlotJoinStart + joinMap.ProgramOffsetJoin;
|
programSlotJoinStart = programSlotJoinStart + joinMap.ProgramOffsetJoin;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -98,10 +98,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
|
||||||
{
|
{
|
||||||
@@ -453,11 +455,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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -123,6 +123,7 @@
|
|||||||
<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\C2nRthsControllerJoinMap.cs" />
|
||||||
<Compile Include="Bridges\JoinMaps\DmBladeChassisControllerJoinMap.cs" />
|
<Compile Include="Bridges\JoinMaps\DmBladeChassisControllerJoinMap.cs" />
|
||||||
<Compile Include="Bridges\DmpsAudioOutputControllerBridge.cs" />
|
<Compile Include="Bridges\DmpsAudioOutputControllerBridge.cs" />
|
||||||
@@ -155,6 +156,7 @@
|
|||||||
<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\StatusSignControllerJoinMap.cs" />
|
||||||
<Compile Include="Bridges\JoinMaps\SystemMonitorJoinMap.cs" />
|
<Compile Include="Bridges\JoinMaps\SystemMonitorJoinMap.cs" />
|
||||||
<Compile Include="Bridges\StatusSignControllerBridge.cs" />
|
<Compile Include="Bridges\StatusSignControllerBridge.cs" />
|
||||||
|
|||||||
@@ -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")]
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -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>
|
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -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
|
|
||||||
Binary file not shown.
@@ -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": []}
|
||||||
|
|
||||||
|
|||||||
@@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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>
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ 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.CrestronIO;
|
||||||
|
using PepperDash.Essentials.Core.Touchpanels;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Core
|
namespace PepperDash.Essentials.Core
|
||||||
{
|
{
|
||||||
@@ -47,13 +48,21 @@ 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;
|
||||||
@@ -75,13 +84,6 @@ namespace PepperDash.Essentials.Core
|
|||||||
return new C2nRthsController(key, name, new C2nRths(cresnetId, Global.ControlSystem));
|
return new C2nRthsController(key, name, new C2nRths(cresnetId, Global.ControlSystem));
|
||||||
}
|
}
|
||||||
|
|
||||||
// then 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);
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -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)
|
||||||
|
|||||||
@@ -131,6 +131,7 @@
|
|||||||
<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" />
|
||||||
@@ -236,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" />
|
||||||
|
|||||||
@@ -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 © Pepperdash 2019")]
|
|
||||||
[assembly: AssemblyVersion("1.4.0.*")]
|
|
||||||
Binary file not shown.
@@ -1,16 +0,0 @@
|
|||||||
<ProgramInfo>
|
|
||||||
<RequiredInfo>
|
|
||||||
<FriendlyName>SSMonoIOLibrary</FriendlyName>
|
|
||||||
<SystemName>SSMonoIOLibrary</SystemName>
|
|
||||||
<EntryPoint>SSMonoIOLibrary</EntryPoint>
|
|
||||||
<MinFirmwareVersion>1.007.0017</MinFirmwareVersion>
|
|
||||||
<ProgramTool>SIMPL# Plugin</ProgramTool>
|
|
||||||
<DesignToolId>5</DesignToolId>
|
|
||||||
<ProgramToolId>5</ProgramToolId>
|
|
||||||
<ArchiveName />
|
|
||||||
</RequiredInfo>
|
|
||||||
<OptionalInfo>
|
|
||||||
<CompiledOn>4/6/2016 7:49:24 AM</CompiledOn>
|
|
||||||
<CompilerRev>1.0.0.14081</CompilerRev>
|
|
||||||
</OptionalInfo>
|
|
||||||
</ProgramInfo>
|
|
||||||
Binary file not shown.
@@ -1,18 +0,0 @@
|
|||||||
MainAssembly=SSMonoIOLibrary.dll:6c69af117dca3f74ebca99f7a0e3181c
|
|
||||||
MainAssemblyMinFirmwareVersion=1.007.0017
|
|
||||||
ü
|
|
||||||
DependencySource=SimplSharpCustomAttributesInterface.dll:9c4b4d4c519b655af90016edca2d66b9
|
|
||||||
DependencyPath=SSMonoIOLibrary.clz:SimplSharpCustomAttributesInterface.dll
|
|
||||||
DependencyMainAssembly=SimplSharpCustomAttributesInterface.dll:9c4b4d4c519b655af90016edca2d66b9
|
|
||||||
ü
|
|
||||||
DependencySource=SimplSharpHelperInterface.dll:aed72eb0e19559a3f56708be76445dcd
|
|
||||||
DependencyPath=SSMonoIOLibrary.clz:SimplSharpHelperInterface.dll
|
|
||||||
DependencyMainAssembly=SimplSharpHelperInterface.dll:aed72eb0e19559a3f56708be76445dcd
|
|
||||||
ü
|
|
||||||
DependencySource=SimplSharpReflectionInterface.dll:e3ff8edbba84ccd7155b9984e67488b2
|
|
||||||
DependencyPath=SSMonoIOLibrary.clz:SimplSharpReflectionInterface.dll
|
|
||||||
DependencyMainAssembly=SimplSharpReflectionInterface.dll:e3ff8edbba84ccd7155b9984e67488b2
|
|
||||||
ü
|
|
||||||
DependencySource=SSharpCrestronExtensionsLibrary.dll:655a49edee523f150d1c03bcb5db87d0
|
|
||||||
DependencyPath=SSMonoIOLibrary.clz:SSharpCrestronExtensionsLibrary.dll
|
|
||||||
DependencyMainAssembly=SSharpCrestronExtensionsLibrary.dll:655a49edee523f150d1c03bcb5db87d0
|
|
||||||
Binary file not shown.
@@ -1,16 +0,0 @@
|
|||||||
<ProgramInfo>
|
|
||||||
<RequiredInfo>
|
|
||||||
<FriendlyName>SSMonoProTaskLibrary</FriendlyName>
|
|
||||||
<SystemName>SSMonoProTaskLibrary</SystemName>
|
|
||||||
<EntryPoint>SSMonoProTaskLibrary</EntryPoint>
|
|
||||||
<MinFirmwareVersion>1.009.0029</MinFirmwareVersion>
|
|
||||||
<ProgramTool>SIMPL# Plugin</ProgramTool>
|
|
||||||
<DesignToolId>5</DesignToolId>
|
|
||||||
<ProgramToolId>5</ProgramToolId>
|
|
||||||
<ArchiveName />
|
|
||||||
</RequiredInfo>
|
|
||||||
<OptionalInfo>
|
|
||||||
<CompiledOn>4/6/2016 7:55:41 AM</CompiledOn>
|
|
||||||
<CompilerRev>1.0.0.14269</CompilerRev>
|
|
||||||
</OptionalInfo>
|
|
||||||
</ProgramInfo>
|
|
||||||
Binary file not shown.
Binary file not shown.
@@ -1,30 +0,0 @@
|
|||||||
MainAssembly=SSMonoProTaskLibrary.dll:5d3a301400516bd812bf1566c72ccbf2
|
|
||||||
MainAssemblyMinFirmwareVersion=1.009.0029
|
|
||||||
ü
|
|
||||||
DependencySource=SimplSharpReflectionInterface.dll:e3ff8edbba84ccd7155b9984e67488b2
|
|
||||||
DependencyPath=SSMonoProTaskLibrary.cplz:SimplSharpReflectionInterface.dll
|
|
||||||
DependencyMainAssembly=SimplSharpReflectionInterface.dll:e3ff8edbba84ccd7155b9984e67488b2
|
|
||||||
ü
|
|
||||||
DependencySource=SSharpCrestronExtensionsLibrary.dll:776d0247d8d42164c46c7cc1dfadbd03
|
|
||||||
DependencyPath=SSMonoProTaskLibrary.cplz:SSharpCrestronExtensionsLibrary.dll
|
|
||||||
DependencyMainAssembly=SSharpCrestronExtensionsLibrary.dll:776d0247d8d42164c46c7cc1dfadbd03
|
|
||||||
ü
|
|
||||||
DependencySource=SSMonoConcurrentCollectionsLibrary.dll:b0afcd989b081899c9eb29f9e4c8b799
|
|
||||||
DependencyPath=SSMonoProTaskLibrary.cplz:SSMonoConcurrentCollectionsLibrary.dll
|
|
||||||
DependencyMainAssembly=SSMonoConcurrentCollectionsLibrary.dll:b0afcd989b081899c9eb29f9e4c8b799
|
|
||||||
ü
|
|
||||||
DependencySource=SSMonoProConcurrentCollectionsLibrary.dll:8b718ce29f938bbf9cb5b8fc2d89332f
|
|
||||||
DependencyPath=SSMonoProTaskLibrary.cplz:SSMonoProConcurrentCollectionsLibrary.dll
|
|
||||||
DependencyMainAssembly=SSMonoProConcurrentCollectionsLibrary.dll:8b718ce29f938bbf9cb5b8fc2d89332f
|
|
||||||
ü
|
|
||||||
DependencySource=SSMonoSupportLibrary.dll:59362515f2c1d61583b2e40793987917
|
|
||||||
DependencyPath=SSMonoProTaskLibrary.cplz:SSMonoSupportLibrary.dll
|
|
||||||
DependencyMainAssembly=SSMonoSupportLibrary.dll:59362515f2c1d61583b2e40793987917
|
|
||||||
ü
|
|
||||||
DependencySource=SSMonoThreadingLibrary.dll:ea2ae2e1d9c425236f39de9192591062
|
|
||||||
DependencyPath=SSMonoProTaskLibrary.cplz:SSMonoThreadingLibrary.dll
|
|
||||||
DependencyMainAssembly=SSMonoThreadingLibrary.dll:ea2ae2e1d9c425236f39de9192591062
|
|
||||||
ü
|
|
||||||
DependencySource=SSMonoTupleLibrary.dll:2a3b419fff4199838079879053fcb41d
|
|
||||||
DependencyPath=SSMonoProTaskLibrary.cplz:SSMonoTupleLibrary.dll
|
|
||||||
DependencyMainAssembly=SSMonoTupleLibrary.dll:2a3b419fff4199838079879053fcb41d
|
|
||||||
Binary file not shown.
@@ -1,138 +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; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The number of seconds to countdown
|
/// The number of seconds to countdown
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int SecondsToCount { get; set; }
|
public int SecondsToCount { get; set; }
|
||||||
|
|
||||||
public DateTime StartTime { get; private set; }
|
public DateTime StartTime { get; private set; }
|
||||||
public DateTime FinishTime { get; private set; }
|
public DateTime FinishTime { get; private set; }
|
||||||
|
|
||||||
CTimer SecondTimer;
|
CTimer SecondTimer;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Constructor
|
/// Constructor
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="key"></param>
|
/// <param name="key"></param>
|
||||||
public SecondsCountdownTimer(string key)
|
public SecondsCountdownTimer(string key)
|
||||||
{
|
{
|
||||||
Key = key;
|
Key = key;
|
||||||
IsRunningFeedback = new BoolFeedback(() => _IsRunning);
|
IsRunningFeedback = new BoolFeedback(() => _IsRunning);
|
||||||
|
|
||||||
TimeRemainingFeedback = new StringFeedback(() =>
|
TimeRemainingFeedback = new StringFeedback(() =>
|
||||||
{
|
{
|
||||||
// Need to handle up and down here.
|
// Need to handle up and down here.
|
||||||
|
|
||||||
if (StartTime == null || FinishTime == null)
|
if (StartTime == null || FinishTime == null)
|
||||||
return "";
|
return "";
|
||||||
var timeSpan = FinishTime - DateTime.Now;
|
var timeSpan = FinishTime - DateTime.Now;
|
||||||
return Math.Round(timeSpan.TotalSeconds).ToString();
|
|
||||||
});
|
if (timeSpan.TotalSeconds < 60)
|
||||||
|
{
|
||||||
PercentFeedback = new IntFeedback(() =>
|
return Math.Round(timeSpan.TotalSeconds).ToString();
|
||||||
{
|
}
|
||||||
if (StartTime == null || FinishTime == null)
|
else
|
||||||
return 0;
|
{
|
||||||
double percent = (FinishTime - DateTime.Now).TotalSeconds
|
Debug.Console(2, this, "timeSpan.Minutes == {0}, timeSpan.Seconds == {1}", timeSpan.Minutes, timeSpan.Seconds);
|
||||||
/ (FinishTime - StartTime).TotalSeconds
|
return String.Format("{0:D2}:{1:D2}",
|
||||||
* 100;
|
timeSpan.Minutes,
|
||||||
return (int)percent;
|
timeSpan.Seconds);
|
||||||
});
|
}
|
||||||
}
|
});
|
||||||
|
|
||||||
/// <summary>
|
PercentFeedback = new IntFeedback(() =>
|
||||||
/// Starts the Timer
|
{
|
||||||
/// </summary>
|
if (StartTime == null || FinishTime == null)
|
||||||
public void Start()
|
return 0;
|
||||||
{
|
double percent = (FinishTime - DateTime.Now).TotalSeconds
|
||||||
if (_IsRunning)
|
/ (FinishTime - StartTime).TotalSeconds
|
||||||
return;
|
* 100;
|
||||||
StartTime = DateTime.Now;
|
return (int)percent;
|
||||||
FinishTime = StartTime + TimeSpan.FromSeconds(SecondsToCount);
|
});
|
||||||
|
}
|
||||||
if (SecondTimer != null)
|
|
||||||
SecondTimer.Stop();
|
/// <summary>
|
||||||
SecondTimer = new CTimer(SecondElapsedTimerCallback, null, 0, 1000);
|
/// Starts the Timer
|
||||||
_IsRunning = true;
|
/// </summary>
|
||||||
IsRunningFeedback.FireUpdate();
|
public void Start()
|
||||||
|
{
|
||||||
var handler = HasStarted;
|
if (_IsRunning)
|
||||||
if (handler != null)
|
return;
|
||||||
handler(this, new EventArgs());
|
StartTime = DateTime.Now;
|
||||||
}
|
FinishTime = StartTime + TimeSpan.FromSeconds(SecondsToCount);
|
||||||
|
|
||||||
/// <summary>
|
if (SecondTimer != null)
|
||||||
/// Restarts the timer
|
SecondTimer.Stop();
|
||||||
/// </summary>
|
SecondTimer = new CTimer(SecondElapsedTimerCallback, null, 0, 1000);
|
||||||
public void Reset()
|
_IsRunning = true;
|
||||||
{
|
IsRunningFeedback.FireUpdate();
|
||||||
_IsRunning = false;
|
|
||||||
Start();
|
var handler = HasStarted;
|
||||||
}
|
if (handler != null)
|
||||||
|
handler(this, new EventArgs());
|
||||||
/// <summary>
|
}
|
||||||
/// Cancels the timer (without triggering it to finish)
|
|
||||||
/// </summary>
|
/// <summary>
|
||||||
public void Cancel()
|
/// Restarts the timer
|
||||||
{
|
/// </summary>
|
||||||
StopHelper();
|
public void Reset()
|
||||||
|
{
|
||||||
var handler = WasCancelled;
|
_IsRunning = false;
|
||||||
if (handler != null)
|
Start();
|
||||||
handler(this, new EventArgs());
|
}
|
||||||
}
|
|
||||||
|
/// <summary>
|
||||||
/// <summary>
|
/// Cancels the timer (without triggering it to finish)
|
||||||
/// Called upon expiration, or calling this will force timer to finish.
|
/// </summary>
|
||||||
/// </summary>
|
public void Cancel()
|
||||||
public void Finish()
|
{
|
||||||
{
|
StopHelper();
|
||||||
StopHelper();
|
|
||||||
|
var handler = WasCancelled;
|
||||||
var handler = HasFinished;
|
if (handler != null)
|
||||||
if (handler != null)
|
handler(this, new EventArgs());
|
||||||
handler(this, new EventArgs());
|
}
|
||||||
}
|
|
||||||
|
/// <summary>
|
||||||
void StopHelper()
|
/// Called upon expiration, or calling this will force timer to finish.
|
||||||
{
|
/// </summary>
|
||||||
if (SecondTimer != null)
|
public void Finish()
|
||||||
SecondTimer.Stop();
|
{
|
||||||
_IsRunning = false;
|
StopHelper();
|
||||||
IsRunningFeedback.FireUpdate();
|
|
||||||
}
|
var handler = HasFinished;
|
||||||
|
if (handler != null)
|
||||||
void SecondElapsedTimerCallback(object o)
|
handler(this, new EventArgs());
|
||||||
{
|
}
|
||||||
PercentFeedback.FireUpdate();
|
|
||||||
TimeRemainingFeedback.FireUpdate();
|
void StopHelper()
|
||||||
|
{
|
||||||
if (DateTime.Now >= FinishTime)
|
if (SecondTimer != null)
|
||||||
Finish();
|
SecondTimer.Stop();
|
||||||
}
|
_IsRunning = false;
|
||||||
}
|
IsRunningFeedback.FireUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
|
void SecondElapsedTimerCallback(object o)
|
||||||
|
{
|
||||||
|
PercentFeedback.FireUpdate();
|
||||||
|
TimeRemainingFeedback.FireUpdate();
|
||||||
|
|
||||||
|
if (DateTime.Now >= FinishTime)
|
||||||
|
Finish();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -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; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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));
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -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"))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -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);
|
||||||
|
|||||||
@@ -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>
|
||||||
@@ -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>
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
@@ -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" />
|
||||||
|
|||||||
@@ -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")]
|
||||||
@@ -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;
|
||||||
|
|||||||
@@ -1,65 +1,65 @@
|
|||||||
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 BoolFeedback RawOccupancyPirFeedback { get; private set; }
|
||||||
|
|
||||||
public BoolFeedback RawOccupancyUsFeedback { get; private set; }
|
public BoolFeedback RawOccupancyUsFeedback { get; private set; }
|
||||||
|
|
||||||
|
|
||||||
public GlsOdtOccupancySensorController(string key, string name, GlsOdtCCn sensor)
|
public GlsOdtOccupancySensorController(string key, string name, GlsOdtCCn sensor)
|
||||||
: base(key, name, sensor)
|
: base(key, name, sensor)
|
||||||
{
|
{
|
||||||
OccSensor = sensor;
|
OccSensor = sensor;
|
||||||
|
|
||||||
AndWhenVacatedFeedback = new BoolFeedback(() => OccSensor.AndWhenVacatedFeedback.BoolValue);
|
AndWhenVacatedFeedback = new BoolFeedback(() => OccSensor.AndWhenVacatedFeedback.BoolValue);
|
||||||
|
|
||||||
OrWhenVacatedFeedback = new BoolFeedback(() => OccSensor.OrWhenVacatedFeedback.BoolValue);
|
OrWhenVacatedFeedback = new BoolFeedback(() => OccSensor.OrWhenVacatedFeedback.BoolValue);
|
||||||
|
|
||||||
UltrasonicAEnabledFeedback = new BoolFeedback(() => OccSensor.UsAEnabledFeedback.BoolValue);
|
UltrasonicAEnabledFeedback = new BoolFeedback(() => OccSensor.UsAEnabledFeedback.BoolValue);
|
||||||
|
|
||||||
UltrasonicBEnabledFeedback = new BoolFeedback(() => OccSensor.UsBEnabledFeedback.BoolValue);
|
UltrasonicBEnabledFeedback = new BoolFeedback(() => OccSensor.UsBEnabledFeedback.BoolValue);
|
||||||
|
|
||||||
RawOccupancyPirFeedback = new BoolFeedback(() => OccSensor.RawOccupancyPirFeedback.BoolValue);
|
RawOccupancyPirFeedback = new BoolFeedback(() => OccSensor.RawOccupancyPirFeedback.BoolValue);
|
||||||
|
|
||||||
RawOccupancyUsFeedback = new BoolFeedback(() => OccSensor.RawOccupancyUsFeedback.BoolValue);
|
RawOccupancyUsFeedback = new BoolFeedback(() => OccSensor.RawOccupancyUsFeedback.BoolValue);
|
||||||
|
|
||||||
UltrasonicSensitivityInVacantStateFeedback = new IntFeedback(() => OccSensor.UsSensitivityInVacantStateFeedback.UShortValue);
|
UltrasonicSensitivityInVacantStateFeedback = new IntFeedback(() => OccSensor.UsSensitivityInVacantStateFeedback.UShortValue);
|
||||||
|
|
||||||
UltrasonicSensitivityInOccupiedStateFeedback = new IntFeedback(() => OccSensor.UsSensitivityInOccupiedStateFeedback.UShortValue);
|
UltrasonicSensitivityInOccupiedStateFeedback = new IntFeedback(() => OccSensor.UsSensitivityInOccupiedStateFeedback.UShortValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Overrides the base class event delegate to fire feedbacks for event IDs that pertain to this extended class.
|
/// Overrides the base class event delegate to fire feedbacks for event IDs that pertain to this extended class.
|
||||||
/// Then calls the base delegate method to ensure any common event IDs are captured.
|
/// Then calls the base delegate method to ensure any common event IDs are captured.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="device"></param>
|
/// <param name="device"></param>
|
||||||
/// <param name="args"></param>
|
/// <param name="args"></param>
|
||||||
protected override void OccSensor_GlsOccupancySensorChange(GlsOccupancySensorBase device, GlsOccupancySensorChangeEventArgs args)
|
protected override void OccSensor_GlsOccupancySensorChange(GlsOccupancySensorBase device, GlsOccupancySensorChangeEventArgs args)
|
||||||
{
|
{
|
||||||
if (args.EventId == GlsOccupancySensorBase.AndWhenVacatedFeedbackEventId)
|
if (args.EventId == GlsOccupancySensorBase.AndWhenVacatedFeedbackEventId)
|
||||||
AndWhenVacatedFeedback.FireUpdate();
|
AndWhenVacatedFeedback.FireUpdate();
|
||||||
@@ -69,91 +69,103 @@ namespace PepperDash.Essentials.Devices.Common.Occupancy
|
|||||||
UltrasonicAEnabledFeedback.FireUpdate();
|
UltrasonicAEnabledFeedback.FireUpdate();
|
||||||
else if (args.EventId == GlsOccupancySensorBase.UsBEnabledFeedbackEventId)
|
else if (args.EventId == GlsOccupancySensorBase.UsBEnabledFeedbackEventId)
|
||||||
UltrasonicBEnabledFeedback.FireUpdate();
|
UltrasonicBEnabledFeedback.FireUpdate();
|
||||||
else if (args.EventId == GlsOccupancySensorBase.RawOccupancyPirFeedbackEventId)
|
|
||||||
RawOccupancyPirFeedback.FireUpdate();
|
|
||||||
else if (args.EventId == GlsOccupancySensorBase.RawOccupancyUsFeedbackEventId)
|
|
||||||
RawOccupancyUsFeedback.FireUpdate();
|
|
||||||
else if (args.EventId == GlsOccupancySensorBase.UsSensitivityInOccupiedStateFeedbackEventId)
|
else if (args.EventId == GlsOccupancySensorBase.UsSensitivityInOccupiedStateFeedbackEventId)
|
||||||
UltrasonicSensitivityInOccupiedStateFeedback.FireUpdate();
|
UltrasonicSensitivityInOccupiedStateFeedback.FireUpdate();
|
||||||
else if (args.EventId == GlsOccupancySensorBase.UsSensitivityInVacantStateFeedbackEventId)
|
else if (args.EventId == GlsOccupancySensorBase.UsSensitivityInVacantStateFeedbackEventId)
|
||||||
UltrasonicSensitivityInVacantStateFeedback.FireUpdate();
|
UltrasonicSensitivityInVacantStateFeedback.FireUpdate();
|
||||||
|
|
||||||
base.OccSensor_GlsOccupancySensorChange(device, args);
|
base.OccSensor_GlsOccupancySensorChange(device, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Sets the OrWhenVacated state
|
/// 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.
|
||||||
/// <param name="state"></param>
|
/// </summary>
|
||||||
public void SetOrWhenVacatedState(bool state)
|
/// <param name="device"></param>
|
||||||
{
|
/// <param name="args"></param>
|
||||||
OccSensor.OrWhenVacated.BoolValue = state;
|
protected override void OccSensor_BaseEvent(Crestron.SimplSharpPro.GenericBase device, Crestron.SimplSharpPro.BaseEventArgs args)
|
||||||
}
|
{
|
||||||
|
if (args.EventId == GlsOccupancySensorBase.RawOccupancyPirFeedbackEventId)
|
||||||
/// <summary>
|
RawOccupancyPirFeedback.FireUpdate();
|
||||||
/// Sets the AndWhenVacated state
|
else if (args.EventId == GlsOccupancySensorBase.RawOccupancyUsFeedbackEventId)
|
||||||
/// </summary>
|
RawOccupancyUsFeedback.FireUpdate();
|
||||||
/// <param name="state"></param>
|
|
||||||
public void SetAndWhenVacatedState(bool state)
|
base.OccSensor_BaseEvent(device, args);
|
||||||
{
|
}
|
||||||
OccSensor.AndWhenVacated.BoolValue = state;
|
|
||||||
}
|
/// <summary>
|
||||||
|
/// Sets the OrWhenVacated state
|
||||||
/// <summary>
|
/// </summary>
|
||||||
/// Enables or disables the Ultrasonic A sensor
|
/// <param name="state"></param>
|
||||||
/// </summary>
|
public void SetOrWhenVacatedState(bool state)
|
||||||
/// <param name="state"></param>
|
{
|
||||||
public void SetUsAEnable(bool state)
|
OccSensor.OrWhenVacated.BoolValue = state;
|
||||||
{
|
}
|
||||||
if (state)
|
|
||||||
{
|
/// <summary>
|
||||||
OccSensor.EnableUsA.BoolValue = state;
|
/// Sets the AndWhenVacated state
|
||||||
OccSensor.DisableUsA.BoolValue = !state;
|
/// </summary>
|
||||||
}
|
/// <param name="state"></param>
|
||||||
else
|
public void SetAndWhenVacatedState(bool state)
|
||||||
{
|
{
|
||||||
OccSensor.EnableUsA.BoolValue = state;
|
OccSensor.AndWhenVacated.BoolValue = state;
|
||||||
OccSensor.DisableUsA.BoolValue = !state;
|
}
|
||||||
}
|
|
||||||
}
|
/// <summary>
|
||||||
|
/// Enables or disables the Ultrasonic A sensor
|
||||||
|
/// </summary>
|
||||||
/// <summary>
|
/// <param name="state"></param>
|
||||||
/// Enables or disables the Ultrasonic B sensor
|
public void SetUsAEnable(bool state)
|
||||||
/// </summary>
|
{
|
||||||
/// <param name="state"></param>
|
if (state)
|
||||||
public void SetUsBEnable(bool state)
|
{
|
||||||
{
|
OccSensor.EnableUsA.BoolValue = state;
|
||||||
if (state)
|
OccSensor.DisableUsA.BoolValue = !state;
|
||||||
{
|
}
|
||||||
OccSensor.EnableUsB.BoolValue = state;
|
else
|
||||||
OccSensor.DisableUsB.BoolValue = !state;
|
{
|
||||||
}
|
OccSensor.EnableUsA.BoolValue = state;
|
||||||
else
|
OccSensor.DisableUsA.BoolValue = !state;
|
||||||
{
|
}
|
||||||
OccSensor.EnableUsB.BoolValue = state;
|
}
|
||||||
OccSensor.DisableUsB.BoolValue = !state;
|
|
||||||
}
|
|
||||||
}
|
/// <summary>
|
||||||
|
/// Enables or disables the Ultrasonic B sensor
|
||||||
public void IncrementUsSensitivityInOccupiedState(bool pressRelease)
|
/// </summary>
|
||||||
{
|
/// <param name="state"></param>
|
||||||
OccSensor.IncrementUsSensitivityInOccupiedState.BoolValue = pressRelease;
|
public void SetUsBEnable(bool state)
|
||||||
}
|
{
|
||||||
|
if (state)
|
||||||
public void DecrementUsSensitivityInOccupiedState(bool pressRelease)
|
{
|
||||||
{
|
OccSensor.EnableUsB.BoolValue = state;
|
||||||
OccSensor.DecrementUsSensitivityInOccupiedState.BoolValue = pressRelease;
|
OccSensor.DisableUsB.BoolValue = !state;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
public void IncrementUsSensitivityInVacantState(bool pressRelease)
|
{
|
||||||
{
|
OccSensor.EnableUsB.BoolValue = state;
|
||||||
OccSensor.IncrementUsSensitivityInVacantState.BoolValue = pressRelease;
|
OccSensor.DisableUsB.BoolValue = !state;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
public void DecrementUsSensitivityInVacantState(bool pressRelease)
|
|
||||||
{
|
public void IncrementUsSensitivityInOccupiedState(bool pressRelease)
|
||||||
OccSensor.DecrementUsSensitivityInVacantState.BoolValue = 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -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")]
|
||||||
@@ -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
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user