Compare commits

..

1 Commits

Author SHA1 Message Date
Jason T Alborough
a1d5123094 Merge c26d7d73f8 into 61c638452b 2021-08-12 15:14:32 -04:00
677 changed files with 42236 additions and 58539 deletions

View File

@@ -8,7 +8,6 @@ $destination = "$($Env:GITHUB_HOME)\output"
New-Item -ItemType Directory -Force -Path ($destination) New-Item -ItemType Directory -Force -Path ($destination)
Get-ChildItem ($destination) Get-ChildItem ($destination)
$exclusions = @(git submodule foreach --quiet 'echo $name') $exclusions = @(git submodule foreach --quiet 'echo $name')
$exclusions += "Newtonsoft.Compact.Json.dll"
# Trying to get any .json schema files (not currently working) # Trying to get any .json schema files (not currently working)
# Gets any files with the listed extensions. # Gets any files with the listed extensions.
Get-ChildItem -recurse -Path "$($Env:GITHUB_WORKSPACE)" -include "*.clz", "*.cpz", "*.cplz", "*.dll", "*.nuspec" | ForEach-Object { Get-ChildItem -recurse -Path "$($Env:GITHUB_WORKSPACE)" -include "*.clz", "*.cpz", "*.cplz", "*.dll", "*.nuspec" | ForEach-Object {

View File

@@ -1,21 +0,0 @@
name: Build Essentials 1.X
on:
push:
branches:
- '**'
jobs:
getVersion:
uses: PepperDash/workflow-templates/.github/workflows/essentialsplugins-getversion.yml@main
secrets: inherit
build-3Series:
uses: PepperDash/workflow-templates/.github/workflows/essentials-3Series-builds.yml@main
secrets: inherit
needs: getVersion
if: needs.getVersion.outputs.newVersion == 'true'
with:
newVersion: ${{ needs.getVersion.outputs.newVersion }}
version: ${{ needs.getVersion.outputs.version }}
tag: ${{ needs.getVersion.outputs.tag }}
channel: ${{ needs.getVersion.outputs.channel }}

144
.github/workflows/docker.yml vendored Normal file
View File

@@ -0,0 +1,144 @@
name: Branch Build Using Docker
on:
push:
branches:
- feature/*
- hotfix/*
- bugfix/*
- release/*
- development
pull_request:
branches:
- development
env:
# solution path doesn't need slashes unless there it is multiple folders deep
# solution name does not include extension. .sln is assumed
SOLUTION_PATH: PepperDashEssentials
SOLUTION_FILE: PepperDashEssentials
# Do not edit this, we're just creating it here
VERSION: 0.0.0-buildtype-buildnumber
# Defaults to debug for build type
BUILD_TYPE: Debug
# Defaults to main as the release branch. Change as necessary
RELEASE_BRANCH: main
jobs:
Build_Project:
runs-on: windows-latest
steps:
# First we checkout the source repo
- name: Checkout repo
uses: actions/checkout@v2
with:
fetch-depth: 0
# Fetch all tags
- name: Fetch tags
run: git fetch --tags
# Generate the appropriate version number
- name: Set Version Number
shell: powershell
run: |
$version = ./.github/scripts/GenerateVersionNumber.ps1
echo "VERSION=$version" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
# Use the version number to set the version of the assemblies
- name: Update AssemblyInfo.cs
shell: powershell
run: |
./.github/scripts/UpdateAssemblyVersion.ps1 ${{ env.VERSION }}
- name: restore Nuget Packages
run: nuget install .\packages.config -OutputDirectory .\packages -ExcludeVersion
# Login to Docker
- name: Login to Docker
uses: azure/docker-login@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
# Build the solutions in the docker image
- name: Build Solution
shell: powershell
run: |
Invoke-Expression "docker run --rm --mount type=bind,source=""$($Env:GITHUB_WORKSPACE)"",target=""c:/project"" pepperdash/sspbuilder c:\cihelpers\vsidebuild.exe -Solution ""c:\project\$($Env:SOLUTION_FILE).sln"" -BuildSolutionConfiguration $($ENV:BUILD_TYPE)"
# Zip up the output files as needed
- name: Zip Build Output
shell: powershell
run: ./.github/scripts/ZipBuildOutput.ps1
# Write the version to a file to be consumed by the push jobs
- name: Write Version
run: Write-Output "$($Env:VERSION)" | Out-File -FilePath "$($Env:GITHUB_HOME)\output\version.txt"
# Upload the build output as an artifact
- name: Upload Build Output
uses: actions/upload-artifact@v1
with:
name: Build
path: ./${{ env.SOLUTION_FILE}}-${{ env.VERSION}}.zip
# Upload the Version file as an artifact
- name: Upload version.txt
uses: actions/upload-artifact@v1
with:
name: Version
path: ${{env.GITHUB_HOME}}\output\version.txt
- name: Create Release
id: create_release
# using contributor's version to allow for pointing at the right commit
uses: fleskesvor/create-release@feature/support-target-commitish
with:
tag_name: ${{ env.VERSION }}
release_name: ${{ env.VERSION }}
prerelease: ${{contains('debug', env.BUILD_TYPE)}}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Upload the build package to the release
- name: Upload Release Package
id: upload_release
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./${{ env.SOLUTION_FILE}}-${{ env.VERSION}}.zip
asset_name: ${{ env.SOLUTION_FILE}}-${{ env.VERSION}}.zip
asset_content_type: application/zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Push_Nuget_Package:
needs: Build_Project
runs-on: windows-latest
steps:
- name: Download Build Version Info
uses: actions/download-artifact@v1
with:
name: Version
- name: Set Version Number
shell: powershell
run: |
Get-ChildItem "./Version"
$version = Get-Content -Path ./Version/version.txt
Write-Host "Version: $version"
echo "VERSION=$version" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
Remove-Item -Path ./Version/version.txt
Remove-Item -Path ./Version
- name: Download Build output
uses: actions/download-artifact@v1
with:
name: Build
path: ./
- name: Unzip Build file
run: |
Get-ChildItem .\*.zip | Expand-Archive -DestinationPath .\
Remove-Item -Path .\*.zip
- name: Copy Files to root & delete output directory
run: |
Remove-Item -Path .\* -Include @("*.cpz","*.md","*.cplz","*.json","*.dll","*.clz")
Get-ChildItem -Path .\output\* | Copy-Item -Destination .\
Remove-Item -Path .\output -Recurse
- name: Add nuget.exe
uses: nuget/setup-nuget@v1
- name: Add Github Packages source
run: nuget sources add -name github -source https://nuget.pkg.github.com/pepperdash/index.json -username Pepperdash -password ${{ secrets.GITHUB_TOKEN }}
- name: Add nuget.org API Key
run: nuget setApiKey ${{ secrets.NUGET_API_KEY }}
- name: Create nuget package
run: nuget pack "./PepperDash_Essentials_Core.nuspec" -version ${{ env.VERSION }}
- name: Publish nuget package to Github registry
run: nuget push **/*.nupkg -source github
- name: Publish nuget package to nuget.org
run: nuget push **/*.nupkg -Source https://api.nuget.org/v3/index.json

125
.github/workflows/main.yml vendored Normal file
View File

@@ -0,0 +1,125 @@
name: main Build using Docker
on:
release:
types:
- created
branches:
- main
env:
# solution path doesn't need slashes unless there it is multiple folders deep
# solution name does not include extension. .sln is assumed
SOLUTION_PATH: PepperDashEssentials
SOLUTION_FILE: PepperDashEssentials
# Do not edit this, we're just creating it here
VERSION: 0.0.0-buildtype-buildnumber
# Defaults to debug for build type
BUILD_TYPE: Release
# Defaults to main as the release branch. Change as necessary
RELEASE_BRANCH: main
jobs:
Build_Project:
runs-on: windows-latest
steps:
# First we checkout the source repo
- name: Checkout repo
uses: actions/checkout@v2
with:
fetch-depth: 0
# Generate the appropriate version number
- name: Set Version Number
shell: powershell
env:
TAG_NAME: ${{ github.event.release.tag_name }}
run: echo "VERSION=$($Env:TAG_NAME)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
# Use the version number to set the version of the assemblies
- name: Update AssemblyInfo.cs
shell: powershell
run: |
./.github/scripts/UpdateAssemblyVersion.ps1 ${{ env.VERSION }}
- name: restore Nuget Packages
run: nuget install .\packages.config -OutputDirectory .\packages -ExcludeVersion
# Login to Docker
- name: Login to Docker
uses: azure/docker-login@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
# Build the solutions in the docker image
- name: Build Solution
shell: powershell
run: |
Invoke-Expression "docker run --rm --mount type=bind,source=""$($Env:GITHUB_WORKSPACE)"",target=""c:/project"" pepperdash/sspbuilder c:\cihelpers\vsidebuild.exe -Solution ""c:\project\$($Env:SOLUTION_FILE).sln"" -BuildSolutionConfiguration $($ENV:BUILD_TYPE)"
# Zip up the output files as needed
- name: Zip Build Output
shell: powershell
run: ./.github/scripts/ZipBuildOutput.ps1
# Write the version to a file to be consumed by the push jobs
- name: Write Version
run: Write-Output "$($Env:VERSION)" | Out-File -FilePath "$($Env:GITHUB_HOME)\output\version.txt"
# Upload the build output as an artifact
- name: Upload Build Output
uses: actions/upload-artifact@v1
with:
name: Build
path: ./${{ env.SOLUTION_FILE}}-${{ env.VERSION}}.zip
# Upload the Version file as an artifact
- name: Upload version.txt
uses: actions/upload-artifact@v1
with:
name: Version
path: ${{env.GITHUB_HOME}}\output\version.txt
# Upload the build package to the release
- name: Upload Release Package
id: upload_release
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./${{ env.SOLUTION_FILE}}-${{ env.VERSION}}.zip
asset_name: ${{ env.SOLUTION_FILE}}-${{ env.VERSION}}.zip
asset_content_type: application/zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Push_Nuget_Package:
needs: Build_Project
runs-on: windows-latest
steps:
- name: Download Build Version Info
uses: actions/download-artifact@v1
with:
name: Version
- name: Set Version Number
shell: powershell
run: |
Get-ChildItem "./Version"
$version = Get-Content -Path ./Version/version.txt
Write-Host "Version: $version"
echo "VERSION=$version" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
Remove-Item -Path ./Version/version.txt
Remove-Item -Path ./Version
- name: Download Build output
uses: actions/download-artifact@v1
with:
name: Build
path: ./
- name: Unzip Build file
run: |
Get-ChildItem .\*.zip | Expand-Archive -DestinationPath .\
Remove-Item -Path .\*.zip
- name: Copy Files to root & delete output directory
run: |
Remove-Item -Path .\* -Include @("*.cpz","*.md","*.cplz","*.json","*.dll","*.clz")
Get-ChildItem -Path .\output\* | Copy-Item -Destination .\
Remove-Item -Path .\output -Recurse
- name: Add nuget.exe
uses: nuget/setup-nuget@v1
- name: Add Github Packages source
run: nuget sources add -name github -source https://nuget.pkg.github.com/pepperdash/index.json -username Pepperdash -password ${{ secrets.GITHUB_TOKEN }}
- name: Add nuget.org API Key
run: nuget setApiKey ${{ secrets.NUGET_API_KEY }}
- name: Create nuget package
run: nuget pack "./PepperDash_Essentials_Core.nuspec" -version ${{ env.VERSION }}
- name: Publish nuget package to Github registry
run: nuget push **/*.nupkg -source github
- name: Publish nuget package to nuget.org
run: nuget push **/*.nupkg -Source https://api.nuget.org/v3/index.json

1
.gitignore vendored
View File

@@ -389,4 +389,3 @@ MigrationBackup/
# Fody - auto-generated XML schema # Fody - auto-generated XML schema
FodyWeavers.xsd FodyWeavers.xsd
essentials-framework/Essentials Interfaces/PepperDash_Essentials_Interfaces/PepperDash_Essentials_Interfaces.csproj essentials-framework/Essentials Interfaces/PepperDash_Essentials_Interfaces/PepperDash_Essentials_Interfaces.csproj
.DS_Store

View File

@@ -1,34 +0,0 @@
{
"plugins": [
[
"@semantic-release/commit-analyzer",
{
"releaseRules": [
{ "scope": "force-patch", "release": "patch" },
{ "scope": "no-release", "release": false }
]
}
],
"@semantic-release/release-notes-generator",
["@semantic-release/changelog",
{
"changelogFile": "CHANGELOG.md"
}
],
[
"@semantic-release/exec",
{
"verifyReleaseCmd": "echo \"newVersion=true\" >> $GITHUB_OUTPUT",
"publishCmd": "echo \"version=${nextRelease.version}\" >> $GITHUB_OUTPUT && echo \"tag=${nextRelease.gitTag}\" >> $GITHUB_OUTPUT && echo \"type=${nextRelease.type}\" >> $GITHUB_OUTPUT && echo \"channel=${nextRelease.channel}\" >> $GITHUB_OUTPUT"
}
]
],
"branches": [
"maintenance-1x",
{
"name": "replace-me-feature-branch",
"prerelease": "replace-me-prerelease",
"channel": "replace-me-prerelease"
}
]
}

View File

@@ -91,8 +91,8 @@ we receive and the availability of resources to evaluate contributions, we antic
project remains dynamic and relevant. This may affect our responsiveness and ability to accept pull requests project remains dynamic and relevant. This may affect our responsiveness and ability to accept pull requests
quickly. This does not mean we are ignoring them. quickly. This does not mean we are ignoring them.
- Not all innovative ideas need to be accepted as pull requests into this GitHub project to be valuable to the community. - Not all innovative ideas need to be accepted as pull requests into this GitHub project to be valuable to the community.
There may be times when we recommend that you just share your code for some enhancement to Essentials from your own There may be times when we recommend that you just share your code for some enhancement to Ghidra from your own
repository. As we identify and recognize extensions that are of general interest to Essentials, we repository. As we identify and recognize extensions that are of general interest to the reverse engineering community, we
may seek to incorporate them with our baseline. may seek to incorporate them with our baseline.
## Legal ## Legal

View File

@@ -1,49 +1,49 @@
 
Microsoft Visual Studio Solution File, Format Version 10.00 Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008 # Visual Studio 2008
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PepperDashEssentials", "src\PepperDashEssentials\PepperDashEssentials.csproj", "{1BED5BA9-88C4-4365-9362-6F4B128071D3}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PepperDashEssentials", "PepperDashEssentials\PepperDashEssentials.csproj", "{1BED5BA9-88C4-4365-9362-6F4B128071D3}"
ProjectSection(ProjectDependencies) = postProject ProjectSection(ProjectDependencies) = postProject
{892B761C-E479-44CE-BD74-243E9214AF13} = {892B761C-E479-44CE-BD74-243E9214AF13} {892B761C-E479-44CE-BD74-243E9214AF13} = {892B761C-E479-44CE-BD74-243E9214AF13}
{9199CE8A-0C9F-4952-8672-3EED798B284F} = {9199CE8A-0C9F-4952-8672-3EED798B284F} {9199CE8A-0C9F-4952-8672-3EED798B284F} = {9199CE8A-0C9F-4952-8672-3EED798B284F}
{A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5} = {A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5} {A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5} = {A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5}
EndProjectSection EndProjectSection
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PepperDash_Essentials_Core", "src\essentials-framework\Essentials Core\PepperDashEssentialsBase\PepperDash_Essentials_Core.csproj", "{A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PepperDash_Essentials_Core", "essentials-framework\Essentials Core\PepperDashEssentialsBase\PepperDash_Essentials_Core.csproj", "{A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Essentials Devices Common", "src\essentials-framework\Essentials Devices Common\Essentials Devices Common\Essentials Devices Common.csproj", "{892B761C-E479-44CE-BD74-243E9214AF13}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Essentials Devices Common", "essentials-framework\Essentials Devices Common\Essentials Devices Common\Essentials Devices Common.csproj", "{892B761C-E479-44CE-BD74-243E9214AF13}"
ProjectSection(ProjectDependencies) = postProject ProjectSection(ProjectDependencies) = postProject
{A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5} = {A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5} {A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5} = {A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5}
EndProjectSection EndProjectSection
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PepperDash_Essentials_DM", "src\essentials-framework\Essentials DM\Essentials_DM\PepperDash_Essentials_DM.csproj", "{9199CE8A-0C9F-4952-8672-3EED798B284F}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PepperDash_Essentials_DM", "essentials-framework\Essentials DM\Essentials_DM\PepperDash_Essentials_DM.csproj", "{9199CE8A-0C9F-4952-8672-3EED798B284F}"
ProjectSection(ProjectDependencies) = postProject ProjectSection(ProjectDependencies) = postProject
{A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5} = {A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5} {A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5} = {A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5}
EndProjectSection EndProjectSection
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU Release|Any CPU = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution GlobalSection(ProjectConfigurationPlatforms) = postSolution
{1BED5BA9-88C4-4365-9362-6F4B128071D3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {1BED5BA9-88C4-4365-9362-6F4B128071D3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1BED5BA9-88C4-4365-9362-6F4B128071D3}.Debug|Any CPU.Build.0 = Debug|Any CPU {1BED5BA9-88C4-4365-9362-6F4B128071D3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1BED5BA9-88C4-4365-9362-6F4B128071D3}.Release|Any CPU.ActiveCfg = Release|Any CPU {1BED5BA9-88C4-4365-9362-6F4B128071D3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1BED5BA9-88C4-4365-9362-6F4B128071D3}.Release|Any CPU.Build.0 = Release|Any CPU {1BED5BA9-88C4-4365-9362-6F4B128071D3}.Release|Any CPU.Build.0 = Release|Any CPU
{A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5}.Debug|Any CPU.Build.0 = Debug|Any CPU {A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5}.Release|Any CPU.ActiveCfg = Release|Any CPU {A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5}.Release|Any CPU.Build.0 = Release|Any CPU {A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5}.Release|Any CPU.Build.0 = Release|Any CPU
{892B761C-E479-44CE-BD74-243E9214AF13}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {892B761C-E479-44CE-BD74-243E9214AF13}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{892B761C-E479-44CE-BD74-243E9214AF13}.Debug|Any CPU.Build.0 = Debug|Any CPU {892B761C-E479-44CE-BD74-243E9214AF13}.Debug|Any CPU.Build.0 = Debug|Any CPU
{892B761C-E479-44CE-BD74-243E9214AF13}.Release|Any CPU.ActiveCfg = Release|Any CPU {892B761C-E479-44CE-BD74-243E9214AF13}.Release|Any CPU.ActiveCfg = Release|Any CPU
{892B761C-E479-44CE-BD74-243E9214AF13}.Release|Any CPU.Build.0 = Release|Any CPU {892B761C-E479-44CE-BD74-243E9214AF13}.Release|Any CPU.Build.0 = Release|Any CPU
{9199CE8A-0C9F-4952-8672-3EED798B284F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {9199CE8A-0C9F-4952-8672-3EED798B284F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9199CE8A-0C9F-4952-8672-3EED798B284F}.Debug|Any CPU.Build.0 = Debug|Any CPU {9199CE8A-0C9F-4952-8672-3EED798B284F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9199CE8A-0C9F-4952-8672-3EED798B284F}.Release|Any CPU.ActiveCfg = Release|Any CPU {9199CE8A-0C9F-4952-8672-3EED798B284F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9199CE8A-0C9F-4952-8672-3EED798B284F}.Release|Any CPU.Build.0 = Release|Any CPU {9199CE8A-0C9F-4952-8672-3EED798B284F}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
EndGlobalSection EndGlobalSection
EndGlobal EndGlobal

View File

@@ -55,7 +55,7 @@ namespace PepperDash.Essentials
return null; return null;
} }
// DSP/DMPS format: deviceKey--levelName, biampTesira-1--master // DSP format: deviceKey--levelName, biampTesira-1--master
match = Regex.Match(DeviceKey, @"([-_\w]+)--(.+)"); match = Regex.Match(DeviceKey, @"([-_\w]+)--(.+)");
if (match.Success) if (match.Success)
{ {
@@ -67,27 +67,6 @@ namespace PepperDash.Essentials
if (dsp.LevelControlPoints.ContainsKey(levelTag)) // should always... if (dsp.LevelControlPoints.ContainsKey(levelTag)) // should always...
return dsp.LevelControlPoints[levelTag]; return dsp.LevelControlPoints[levelTag];
} }
var dmps = DeviceManager.GetDeviceForKey(devKey) as DmpsAudioOutputController;
if (dmps != null)
{
var levelTag = match.Groups[2].Value;
switch (levelTag)
{
case "master":
return dmps.MasterVolumeLevel;
case "source":
return dmps.SourceVolumeLevel;
case "micsmaster":
return dmps.MicsMasterVolumeLevel;
case "codec1":
return dmps.Codec1VolumeLevel;
case "codec2":
return dmps.Codec2VolumeLevel;
default:
return dmps.MasterVolumeLevel;
}
}
// No volume for some reason. We have failed as developers // No volume for some reason. We have failed as developers
return null; return null;
} }

View File

@@ -1,129 +1,129 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using Crestron.SimplSharp; using Crestron.SimplSharp;
using Newtonsoft.Json; using Newtonsoft.Json;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using PepperDash.Essentials.Core; using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Bridges; using PepperDash.Essentials.Core.Bridges;
using PepperDash.Essentials.Core.Config; using PepperDash.Essentials.Core.Config;
using PepperDash.Core; using PepperDash.Core;
using PepperDash.Essentials.Core.Routing; using PepperDash.Essentials.Core.Routing;
using PepperDash.Essentials.Bridges; using PepperDash.Essentials.Bridges;
using Crestron.SimplSharpPro; using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.EthernetCommunication; using Crestron.SimplSharpPro.EthernetCommunication;
namespace PepperDash.Essentials namespace PepperDash.Essentials
{ {
/// <summary> /// <summary>
/// Responsible for loading all of the device types for this library /// Responsible for loading all of the device types for this library
/// </summary> /// </summary>
public class BridgeFactory public class BridgeFactory
{ {
public BridgeFactory() public BridgeFactory()
{ {
var eiscApiAdvancedFactory = new EiscApiAdvancedFactory() as IDeviceFactory; var eiscApiAdvancedFactory = new EiscApiAdvancedFactory() as IDeviceFactory;
eiscApiAdvancedFactory.LoadTypeFactories(); eiscApiAdvancedFactory.LoadTypeFactories();
var eiscApiFactory = new EiscApiFactory() as IDeviceFactory; var eiscApiFactory = new EiscApiFactory() as IDeviceFactory;
eiscApiFactory.LoadTypeFactories(); eiscApiFactory.LoadTypeFactories();
} }
} }
public class CommBridge : Device public class CommBridge : Device
{ {
public CommBridgeProperties Properties { get; private set; } public CommBridgeProperties Properties { get; private set; }
public List<IBasicCommunication> CommDevices { get; private set; } public List<IBasicCommunication> CommDevices { get; private set; }
public CommBridge(string key, string name, JToken properties) public CommBridge(string key, string name, JToken properties)
: base(key, name) : base(key, name)
{ {
Properties = JsonConvert.DeserializeObject<CommBridgeProperties>(properties.ToString()); Properties = JsonConvert.DeserializeObject<CommBridgeProperties>(properties.ToString());
} }
public override bool CustomActivate() public override bool CustomActivate()
{ {
// Create EiscApis // Create EiscApis
if (Properties.Eiscs != null) if (Properties.Eiscs != null)
{ {
foreach (var eisc in Properties.Eiscs) foreach (var eisc in Properties.Eiscs)
{ {
var ApiEisc = new BridgeApiEisc(eisc.IpId, eisc.Hostname); var ApiEisc = new BridgeApiEisc(eisc.IpId, eisc.Hostname);
} }
} }
foreach (var deviceKey in Properties.CommDevices) foreach (var deviceKey in Properties.CommDevices)
{ {
var device = DeviceManager.GetDeviceForKey(deviceKey); var device = DeviceManager.GetDeviceForKey(deviceKey);
if (device != null) if (device != null)
{ {
Debug.Console(0, "deviceKey {0} Found in Device Manager", device.Key); Debug.Console(0, "deviceKey {0} Found in Device Manager", device.Key);
CommDevices.Add(device as IBasicCommunication); CommDevices.Add(device as IBasicCommunication);
} }
else else
{ {
Debug.Console(0, "deviceKey {0} Not Found in Device Manager", deviceKey); Debug.Console(0, "deviceKey {0} Not Found in Device Manager", deviceKey);
} }
} }
// Iterate through all the CommDevices and link up their Actions and Feedbacks // Iterate through all the CommDevices and link up their Actions and Feedbacks
Debug.Console(0, "Bridge {0} Activated", this.Name); Debug.Console(0, "Bridge {0} Activated", this.Name);
return true; return true;
} }
} }
public class EiscBridgeProperties public class EiscBridgeProperties
{ {
public string ParentDeviceKey { get; set; } public string ParentDeviceKey { get; set; }
public eApiType ApiType { get; set; } public eApiType ApiType { get; set; }
public List<EiscProperties> Eiscs { get; set; } public List<EiscProperties> Eiscs { get; set; }
public string ApiOverrideFilePath { get; set; } public string ApiOverrideFilePath { get; set; }
public class EiscProperties public class EiscProperties
{ {
public string IpId { get; set; } public string IpId { get; set; }
public string Hostname { get; set; } public string Hostname { get; set; }
} }
} }
public class CommBridgeProperties : EiscBridgeProperties public class CommBridgeProperties : EiscBridgeProperties
{ {
public List<string> CommDevices { get; set; } public List<string> CommDevices { get; set; }
} }
public enum eApiType { Eisc = 0 } public enum eApiType { Eisc = 0 }
public class BridgeApiEisc public class BridgeApiEisc
{ {
public uint Ipid { get; private set; } public uint Ipid { get; private set; }
public ThreeSeriesTcpIpEthernetIntersystemCommunications Eisc { get; private set; } public ThreeSeriesTcpIpEthernetIntersystemCommunications Eisc { get; private set; }
public BridgeApiEisc(string ipid, string hostname) public BridgeApiEisc(string ipid, string hostname)
{ {
Ipid = (UInt32)int.Parse(ipid, System.Globalization.NumberStyles.HexNumber); Ipid = (UInt32)int.Parse(ipid, System.Globalization.NumberStyles.HexNumber);
Eisc = new ThreeSeriesTcpIpEthernetIntersystemCommunications(Ipid, hostname, Global.ControlSystem); Eisc = new ThreeSeriesTcpIpEthernetIntersystemCommunications(Ipid, hostname, Global.ControlSystem);
Eisc.Register(); Eisc.Register();
Eisc.SigChange += Eisc_SigChange; Eisc.SigChange += Eisc_SigChange;
Debug.Console(0, "BridgeApiEisc Created at Ipid {0}", ipid); Debug.Console(0, "BridgeApiEisc Created at Ipid {0}", ipid);
} }
void Eisc_SigChange(object currentDevice, Crestron.SimplSharpPro.SigEventArgs args) void Eisc_SigChange(object currentDevice, Crestron.SimplSharpPro.SigEventArgs args)
{ {
if (Debug.Level >= 1) if (Debug.Level >= 1)
Debug.Console(1, "BridgeApiEisc change: {0} {1}={2}", args.Sig.Type, args.Sig.Number, args.Sig.StringValue); Debug.Console(1, "BridgeApiEisc change: {0} {1}={2}", args.Sig.Type, args.Sig.Number, args.Sig.StringValue);
var uo = args.Sig.UserObject; var uo = args.Sig.UserObject;
if (uo is Action<bool>) if (uo is Action<bool>)
(uo as Action<bool>)(args.Sig.BoolValue); (uo as Action<bool>)(args.Sig.BoolValue);
else if (uo is Action<ushort>) else if (uo is Action<ushort>)
(uo as Action<ushort>)(args.Sig.UShortValue); (uo as Action<ushort>)(args.Sig.UShortValue);
else if (uo is Action<string>) else if (uo is Action<string>)
(uo as Action<string>)(args.Sig.StringValue); (uo as Action<string>)(args.Sig.StringValue);
} }
} }
} }

View File

@@ -1,90 +1,90 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using Crestron.SimplSharp; using Crestron.SimplSharp;
using Newtonsoft.Json; using Newtonsoft.Json;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using PepperDash.Essentials.Core; using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Config; using PepperDash.Essentials.Core.Config;
using PepperDash.Core; using PepperDash.Core;
using PepperDash.Essentials.Core.Routing; using PepperDash.Essentials.Core.Routing;
using Crestron.SimplSharpPro; using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.EthernetCommunication; using Crestron.SimplSharpPro.EthernetCommunication;
using PepperDash.Essentials.Bridges; using PepperDash.Essentials.Bridges;
namespace PepperDash.Essentials { namespace PepperDash.Essentials {
public class BridgeFactory { public class BridgeFactory {
public static IKeyed GetDevice(PepperDash.Essentials.Core.Config.DeviceConfig dc) { public static IKeyed GetDevice(PepperDash.Essentials.Core.Config.DeviceConfig dc) {
// ? why is this static JTA 2018-06-13? // ? why is this static JTA 2018-06-13?
var key = dc.Key; var key = dc.Key;
var name = dc.Name; var name = dc.Name;
var type = dc.Type; var type = dc.Type;
var properties = dc.Properties; var properties = dc.Properties;
var propAnon = new { }; var propAnon = new { };
JsonConvert.DeserializeAnonymousType(dc.Properties.ToString(), propAnon); JsonConvert.DeserializeAnonymousType(dc.Properties.ToString(), propAnon);
var typeName = dc.Type.ToLower(); var typeName = dc.Type.ToLower();
var groupName = dc.Group.ToLower(); var groupName = dc.Group.ToLower();
Debug.Console(2, "Name {0}, Key {1}, Type {2}, Properties {3}", name, key, type, properties.ToString()); Debug.Console(2, "Name {0}, Key {1}, Type {2}, Properties {3}", name, key, type, properties.ToString());
if (typeName == "essentialdm") if (typeName == "essentialdm")
{ {
return new EssentialDM(key, name, properties); return new EssentialDM(key, name, properties);
} }
else if (typeName == "essentialcomm") else if (typeName == "essentialcomm")
{ {
Debug.Console(2, "Launch Essential Comm"); Debug.Console(2, "Launch Essential Comm");
return new EssentialComm(key, name, properties); return new EssentialComm(key, name, properties);
} }
else if (typeName == "essentialdsp") else if (typeName == "essentialdsp")
{ {
Debug.Console(2, "Launch EssentialDsp"); Debug.Console(2, "Launch EssentialDsp");
return new EssentialDsp(key, name, properties); return new EssentialDsp(key, name, properties);
} }
else if (typeName == "essentialstvone") else if (typeName == "essentialstvone")
{ {
Debug.Console(2, "Launch essentialstvone"); Debug.Console(2, "Launch essentialstvone");
return new EssentialsTVOne(key, name, properties); return new EssentialsTVOne(key, name, properties);
} }
else if (typeName == "essentialslighting") else if (typeName == "essentialslighting")
{ {
Debug.Console(2, "Launch essentialslighting"); Debug.Console(2, "Launch essentialslighting");
return new EssentialsLightsBridge(key, name, properties); return new EssentialsLightsBridge(key, name, properties);
} }
else if (typeName == "eiscapi") else if (typeName == "eiscapi")
{ {
return new EiscApi(dc); return new EiscApi(dc);
} }
return null; return null;
} }
} }
public class BridgeApiEisc { public class BridgeApiEisc {
public uint Ipid; public uint Ipid;
public ThreeSeriesTcpIpEthernetIntersystemCommunications Eisc; public ThreeSeriesTcpIpEthernetIntersystemCommunications Eisc;
public BridgeApiEisc(string ipid) { public BridgeApiEisc(string ipid) {
Ipid = (UInt32)int.Parse(ipid, System.Globalization.NumberStyles.HexNumber); Ipid = (UInt32)int.Parse(ipid, System.Globalization.NumberStyles.HexNumber);
Eisc = new ThreeSeriesTcpIpEthernetIntersystemCommunications(Ipid, "127.0.0.2", Global.ControlSystem); Eisc = new ThreeSeriesTcpIpEthernetIntersystemCommunications(Ipid, "127.0.0.2", Global.ControlSystem);
Eisc.Register(); Eisc.Register();
Eisc.SigChange += Eisc_SigChange; Eisc.SigChange += Eisc_SigChange;
Debug.Console(2, "BridgeApiEisc Created at Ipid {0}", ipid); Debug.Console(2, "BridgeApiEisc Created at Ipid {0}", ipid);
} }
void Eisc_SigChange(object currentDevice, Crestron.SimplSharpPro.SigEventArgs args) { void Eisc_SigChange(object currentDevice, Crestron.SimplSharpPro.SigEventArgs args) {
if (Debug.Level >= 1) if (Debug.Level >= 1)
Debug.Console(2, "DDVC EISC change: {0} {1}={2}", args.Sig.Type, args.Sig.Number, args.Sig.StringValue); Debug.Console(2, "DDVC EISC change: {0} {1}={2}", args.Sig.Type, args.Sig.Number, args.Sig.StringValue);
var uo = args.Sig.UserObject; var uo = args.Sig.UserObject;
if (uo is Action<bool>) if (uo is Action<bool>)
(uo as Action<bool>)(args.Sig.BoolValue); (uo as Action<bool>)(args.Sig.BoolValue);
else if (uo is Action<ushort>) else if (uo is Action<ushort>)
(uo as Action<ushort>)(args.Sig.UShortValue); (uo as Action<ushort>)(args.Sig.UShortValue);
else if (uo is Action<string>) else if (uo is Action<string>)
(uo as Action<string>)(args.Sig.StringValue); (uo as Action<string>)(args.Sig.StringValue);
} }
} }
} }

View File

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

View File

@@ -1,169 +1,169 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using Crestron.SimplSharp; using Crestron.SimplSharp;
using Crestron.SimplSharpPro.DeviceSupport; using Crestron.SimplSharpPro.DeviceSupport;
using PepperDash.Core; using PepperDash.Core;
using PepperDash.Essentials.Core; using PepperDash.Essentials.Core;
using PepperDash.Essentials.Devices.Common; using PepperDash.Essentials.Devices.Common;
using PepperDash.Essentials.Devices.Common.Cameras; using PepperDash.Essentials.Devices.Common.Cameras;
using Newtonsoft.Json; using Newtonsoft.Json;
namespace PepperDash.Essentials.Core.Bridges namespace PepperDash.Essentials.Core.Bridges
{ {
public static class CameraControllerApiExtensions public static class CameraControllerApiExtensions
{ {
public static void LinkToApi(this PepperDash.Essentials.Devices.Common.Cameras.CameraBase cameraDevice, BasicTriList trilist, uint joinStart, string joinMapKey, EiscApi bridge) public static void LinkToApi(this PepperDash.Essentials.Devices.Common.Cameras.CameraBase cameraDevice, BasicTriList trilist, uint joinStart, string joinMapKey, EiscApi bridge)
{ {
CameraControllerJoinMap joinMap = new CameraControllerJoinMap(joinStart); CameraControllerJoinMap joinMap = new CameraControllerJoinMap(joinStart);
// Adds the join map to the bridge // Adds the join map to the bridge
bridge.AddJoinMap(cameraDevice.Key, joinMap); bridge.AddJoinMap(cameraDevice.Key, joinMap);
var customJoins = JoinMapHelper.TryGetJoinMapAdvancedForDevice(joinMapKey); var customJoins = JoinMapHelper.TryGetJoinMapAdvancedForDevice(joinMapKey);
if (customJoins != null) if (customJoins != null)
{ {
joinMap.SetCustomJoinData(customJoins); joinMap.SetCustomJoinData(customJoins);
} }
Debug.Console(1, "Linking to Trilist '{0}'", trilist.ID.ToString("X")); Debug.Console(1, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
Debug.Console(0, "Linking to Bridge Type {0}", cameraDevice.GetType().Name.ToString()); Debug.Console(0, "Linking to Bridge Type {0}", cameraDevice.GetType().Name.ToString());
var commMonitor = cameraDevice as ICommunicationMonitor; var commMonitor = cameraDevice as ICommunicationMonitor;
commMonitor.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline.JoinNumber]); commMonitor.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline.JoinNumber]);
var ptzCamera = cameraDevice as IHasCameraPtzControl; var ptzCamera = cameraDevice as IHasCameraPtzControl;
if (ptzCamera != null) if (ptzCamera != null)
{ {
trilist.SetBoolSigAction(joinMap.PanLeft.JoinNumber, (b) => trilist.SetBoolSigAction(joinMap.PanLeft.JoinNumber, (b) =>
{ {
if (b) if (b)
{ {
ptzCamera.PanLeft(); ptzCamera.PanLeft();
} }
else else
{ {
ptzCamera.PanStop(); ptzCamera.PanStop();
} }
}); });
trilist.SetBoolSigAction(joinMap.PanRight.JoinNumber, (b) => trilist.SetBoolSigAction(joinMap.PanRight.JoinNumber, (b) =>
{ {
if (b) if (b)
{ {
ptzCamera.PanRight(); ptzCamera.PanRight();
} }
else else
{ {
ptzCamera.PanStop(); ptzCamera.PanStop();
} }
}); });
trilist.SetBoolSigAction(joinMap.TiltUp.JoinNumber, (b) => trilist.SetBoolSigAction(joinMap.TiltUp.JoinNumber, (b) =>
{ {
if (b) if (b)
{ {
ptzCamera.TiltUp(); ptzCamera.TiltUp();
} }
else else
{ {
ptzCamera.TiltStop(); ptzCamera.TiltStop();
} }
}); });
trilist.SetBoolSigAction(joinMap.TiltDown.JoinNumber, (b) => trilist.SetBoolSigAction(joinMap.TiltDown.JoinNumber, (b) =>
{ {
if (b) if (b)
{ {
ptzCamera.TiltDown(); ptzCamera.TiltDown();
} }
else else
{ {
ptzCamera.TiltStop(); ptzCamera.TiltStop();
} }
}); });
trilist.SetBoolSigAction(joinMap.ZoomIn.JoinNumber, (b) => trilist.SetBoolSigAction(joinMap.ZoomIn.JoinNumber, (b) =>
{ {
if (b) if (b)
{ {
ptzCamera.ZoomIn(); ptzCamera.ZoomIn();
} }
else else
{ {
ptzCamera.ZoomStop(); ptzCamera.ZoomStop();
} }
}); });
trilist.SetBoolSigAction(joinMap.ZoomOut.JoinNumber, (b) => trilist.SetBoolSigAction(joinMap.ZoomOut.JoinNumber, (b) =>
{ {
if (b) if (b)
{ {
ptzCamera.ZoomOut(); ptzCamera.ZoomOut();
} }
else else
{ {
ptzCamera.ZoomStop(); ptzCamera.ZoomStop();
} }
}); });
} }
if (cameraDevice is IPower) if (cameraDevice is IPower)
{ {
var powerCamera = cameraDevice as IPower; var powerCamera = cameraDevice as IPower;
trilist.SetSigTrueAction(joinMap.PowerOn.JoinNumber, () => powerCamera.PowerOn()); trilist.SetSigTrueAction(joinMap.PowerOn.JoinNumber, () => powerCamera.PowerOn());
trilist.SetSigTrueAction(joinMap.PowerOff.JoinNumber, () => powerCamera.PowerOff()); trilist.SetSigTrueAction(joinMap.PowerOff.JoinNumber, () => powerCamera.PowerOff());
powerCamera.PowerIsOnFeedback.LinkInputSig(trilist.BooleanInput[joinMap.PowerOn.JoinNumber]); powerCamera.PowerIsOnFeedback.LinkInputSig(trilist.BooleanInput[joinMap.PowerOn.JoinNumber]);
powerCamera.PowerIsOnFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.PowerOff.JoinNumber]); powerCamera.PowerIsOnFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.PowerOff.JoinNumber]);
} }
if (cameraDevice is ICommunicationMonitor) if (cameraDevice is ICommunicationMonitor)
{ {
var monitoredCamera = cameraDevice as ICommunicationMonitor; var monitoredCamera = cameraDevice as ICommunicationMonitor;
monitoredCamera.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline.JoinNumber]); monitoredCamera.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline.JoinNumber]);
} }
if (cameraDevice is IHasCameraPresets) if (cameraDevice is IHasCameraPresets)
{ {
// Set the preset lables when they change // Set the preset lables when they change
var presetsCamera = cameraDevice as IHasCameraPresets; var presetsCamera = cameraDevice as IHasCameraPresets;
presetsCamera.PresetsListHasChanged += new EventHandler<EventArgs>((o, a) => presetsCamera.PresetsListHasChanged += new EventHandler<EventArgs>((o, a) =>
{ {
for (int i = 1; i <= joinMap.NumberOfPresets.JoinNumber; i++) for (int i = 1; i <= joinMap.NumberOfPresets.JoinNumber; i++)
{ {
int tempNum = i - 1; int tempNum = i - 1;
string label = "" ; string label = "" ;
var preset = presetsCamera.Presets.FirstOrDefault(p => p.ID.Equals(i)); var preset = presetsCamera.Presets.FirstOrDefault(p => p.ID.Equals(i));
if (preset != null) if (preset != null)
label = preset.Description; label = preset.Description;
trilist.SetString((ushort)(joinMap.PresetLabelStart.JoinNumber + tempNum), label); trilist.SetString((ushort)(joinMap.PresetLabelStart.JoinNumber + tempNum), label);
} }
}); });
for (int i = 0; i < joinMap.NumberOfPresets.JoinNumber; i++) for (int i = 0; i < joinMap.NumberOfPresets.JoinNumber; i++)
{ {
int tempNum = i; int tempNum = i;
trilist.SetSigTrueAction((ushort)(joinMap.PresetRecallStart.JoinNumber + tempNum), () => trilist.SetSigTrueAction((ushort)(joinMap.PresetRecallStart.JoinNumber + tempNum), () =>
{ {
presetsCamera.PresetSelect(tempNum); presetsCamera.PresetSelect(tempNum);
}); });
trilist.SetSigTrueAction((ushort)(joinMap.PresetSaveStart.JoinNumber + tempNum), () => trilist.SetSigTrueAction((ushort)(joinMap.PresetSaveStart.JoinNumber + tempNum), () =>
{ {
var label = trilist.GetString((ushort)(joinMap.PresetLabelStart.JoinNumber + tempNum)); var label = trilist.GetString((ushort)(joinMap.PresetLabelStart.JoinNumber + tempNum));
presetsCamera.PresetStore(tempNum, label); presetsCamera.PresetStore(tempNum, label);
}); });
} }
} }
} }
} }
} }

View File

@@ -1,120 +1,120 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using Crestron.SimplSharp; using Crestron.SimplSharp;
using Crestron.SimplSharpPro.DeviceSupport; using Crestron.SimplSharpPro.DeviceSupport;
using PepperDash.Core; using PepperDash.Core;
using PepperDash.Essentials.Core; using PepperDash.Essentials.Core;
using PepperDash.Essentials.Devices.Common; using PepperDash.Essentials.Devices.Common;
namespace PepperDash.Essentials.Bridges namespace PepperDash.Essentials.Bridges
{ {
public static class SamsungDisplayControllerApiExtensions public static class SamsungDisplayControllerApiExtensions
{ {
public static void LinkToApi(this PepperDash.Essentials.Core.TwoWayDisplayBase displayDevice, BasicTriList trilist, uint joinStart, string joinMapKey) public static void LinkToApi(this PepperDash.Essentials.Core.TwoWayDisplayBase displayDevice, BasicTriList trilist, uint joinStart, string joinMapKey)
{ {
var joinMap = JoinMapHelper.GetJoinMapForDevice(joinMapKey) as DisplayControllerJoinMap; var joinMap = JoinMapHelper.GetJoinMapForDevice(joinMapKey) as DisplayControllerJoinMap;
if (joinMap == null) if (joinMap == null)
{ {
joinMap = new DisplayControllerJoinMap(); joinMap = new DisplayControllerJoinMap();
} }
joinMap.OffsetJoinNumbers(joinStart); joinMap.OffsetJoinNumbers(joinStart);
Debug.Console(1, "Linking to Trilist '{0}'", trilist.ID.ToString("X")); Debug.Console(1, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
Debug.Console(0, "Linking to lighting Type {0}", displayDevice.GetType().Name.ToString()); Debug.Console(0, "Linking to lighting Type {0}", displayDevice.GetType().Name.ToString());
var commMonitor = displayDevice as ICommunicationMonitor; var commMonitor = displayDevice as ICommunicationMonitor;
commMonitor.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]); commMonitor.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
// Poewer Off // Poewer Off
trilist.SetSigTrueAction(joinMap.PowerOff, () => displayDevice.PowerOff()); trilist.SetSigTrueAction(joinMap.PowerOff, () => displayDevice.PowerOff());
displayDevice.PowerIsOnFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.PowerOff]); displayDevice.PowerIsOnFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.PowerOff]);
// Poewer On // Poewer On
trilist.SetSigTrueAction(joinMap.PowerOn, () => displayDevice.PowerOn()); trilist.SetSigTrueAction(joinMap.PowerOn, () => displayDevice.PowerOn());
displayDevice.PowerIsOnFeedback.LinkInputSig(trilist.BooleanInput[joinMap.PowerOn]); displayDevice.PowerIsOnFeedback.LinkInputSig(trilist.BooleanInput[joinMap.PowerOn]);
// GenericLighitng Actions & FeedBack // GenericLighitng Actions & FeedBack
// int sceneIndex = 1; // int sceneIndex = 1;
/* /*
foreach (var scene in displayDevice.LightingScenes) foreach (var scene in displayDevice.LightingScenes)
{ {
var tempIndex = sceneIndex - 1; var tempIndex = sceneIndex - 1;
//trilist.SetSigTrueAction((uint)(joinMap.LightingSceneOffset + sceneIndex), () => displayDevice.SelectScene(displayDevice.LightingScenes[tempIndex])); //trilist.SetSigTrueAction((uint)(joinMap.LightingSceneOffset + sceneIndex), () => displayDevice.SelectScene(displayDevice.LightingScenes[tempIndex]));
scene.IsActiveFeedback.LinkInputSig(trilist.BooleanInput[(uint)(joinMap.LightingSceneOffset + sceneIndex)]); scene.IsActiveFeedback.LinkInputSig(trilist.BooleanInput[(uint)(joinMap.LightingSceneOffset + sceneIndex)]);
trilist.StringInput[(uint)(joinMap.LightingSceneOffset + sceneIndex)].StringValue = scene.Name; trilist.StringInput[(uint)(joinMap.LightingSceneOffset + sceneIndex)].StringValue = scene.Name;
trilist.BooleanInput[(uint)(joinMap.ButtonVisibilityOffset + sceneIndex)].BoolValue = true; trilist.BooleanInput[(uint)(joinMap.ButtonVisibilityOffset + sceneIndex)].BoolValue = true;
sceneIndex++; sceneIndex++;
} }
if (displayDevice.GetType().Name.ToString() == "LutronQuantumArea") if (displayDevice.GetType().Name.ToString() == "LutronQuantumArea")
{ {
var lutronDevice = displayDevice as PepperDash.Essentials.Devices.Common.Environment.Lutron.LutronQuantumArea; var lutronDevice = displayDevice as PepperDash.Essentials.Devices.Common.Environment.Lutron.LutronQuantumArea;
lutronDevice.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]); lutronDevice.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
trilist.SetStringSigAction(joinMap.IntegrationIdSet, s => lutronDevice.IntegrationId = s); trilist.SetStringSigAction(joinMap.IntegrationIdSet, s => lutronDevice.IntegrationId = s);
} }
*/ */
//ApiEisc.Eisc.SetStringSigAction(ApiMap.integrationID, (s) => { lutronLights.IntegrationId = s; }); //ApiEisc.Eisc.SetStringSigAction(ApiMap.integrationID, (s) => { lutronLights.IntegrationId = s; });
/* /*
var lutronLights = displayDevice as PepperDash.Essentials.Devices.Common.Environment.Lutron.LutronQuantumArea; var lutronLights = displayDevice as PepperDash.Essentials.Devices.Common.Environment.Lutron.LutronQuantumArea;
for (uint i = 1; i <= lightingBase.CircuitCount; i++) for (uint i = 1; i <= lightingBase.CircuitCount; i++)
{ {
var circuit = i; var circuit = i;
lightingBase.CircuitNameFeedbacks[circuit - 1].LinkInputSig(trilist.StringInput[joinMap.CircuitNames + circuit]); lightingBase.CircuitNameFeedbacks[circuit - 1].LinkInputSig(trilist.StringInput[joinMap.CircuitNames + circuit]);
lightingBase.CircuitIsCritical[circuit - 1].LinkInputSig(trilist.BooleanInput[joinMap.CircuitIsCritical + circuit]); lightingBase.CircuitIsCritical[circuit - 1].LinkInputSig(trilist.BooleanInput[joinMap.CircuitIsCritical + circuit]);
lightingBase.CircuitState[circuit - 1].LinkInputSig(trilist.BooleanInput[joinMap.CircuitState + circuit]); lightingBase.CircuitState[circuit - 1].LinkInputSig(trilist.BooleanInput[joinMap.CircuitState + circuit]);
trilist.SetSigTrueAction(joinMap.CircuitCycle + circuit, () => lightingBase.CycleCircuit(circuit - 1)); trilist.SetSigTrueAction(joinMap.CircuitCycle + circuit, () => lightingBase.CycleCircuit(circuit - 1));
trilist.SetSigTrueAction(joinMap.CircuitOnCmd + circuit, () => lightingBase.TurnOnCircuit(circuit - 1)); trilist.SetSigTrueAction(joinMap.CircuitOnCmd + circuit, () => lightingBase.TurnOnCircuit(circuit - 1));
trilist.SetSigTrueAction(joinMap.CircuitOffCmd + circuit, () => lightingBase.TurnOffCircuit(circuit - 1)); trilist.SetSigTrueAction(joinMap.CircuitOffCmd + circuit, () => lightingBase.TurnOffCircuit(circuit - 1));
} }
*/ */
} }
} }
public class DisplayControllerJoinMap : JoinMapBase public class DisplayControllerJoinMap : JoinMapBase
{ {
public uint IsOnline { get; set; } public uint IsOnline { get; set; }
public uint PowerOff { get; set; } public uint PowerOff { get; set; }
public uint PowerOn { get; set; } public uint PowerOn { get; set; }
public uint SelectScene { get; set; } public uint SelectScene { get; set; }
public uint LightingSceneOffset { get; set; } public uint LightingSceneOffset { get; set; }
public uint ButtonVisibilityOffset { get; set; } public uint ButtonVisibilityOffset { get; set; }
public uint IntegrationIdSet { get; set; } public uint IntegrationIdSet { get; set; }
public DisplayControllerJoinMap() public DisplayControllerJoinMap()
{ {
// Digital // Digital
IsOnline = 1; IsOnline = 1;
PowerOff = 1; PowerOff = 1;
PowerOn = 2; PowerOn = 2;
SelectScene = 1; SelectScene = 1;
IntegrationIdSet = 1; IntegrationIdSet = 1;
LightingSceneOffset = 10; LightingSceneOffset = 10;
ButtonVisibilityOffset = 40; ButtonVisibilityOffset = 40;
// Analog // Analog
} }
public override void OffsetJoinNumbers(uint joinStart) public override void OffsetJoinNumbers(uint joinStart)
{ {
var joinOffset = joinStart - 1; var joinOffset = joinStart - 1;
IsOnline = IsOnline + joinOffset; IsOnline = IsOnline + joinOffset;
PowerOff = PowerOff + joinOffset; PowerOff = PowerOff + joinOffset;
PowerOn = PowerOn + joinOffset; PowerOn = PowerOn + joinOffset;
SelectScene = SelectScene + joinOffset; SelectScene = SelectScene + joinOffset;
LightingSceneOffset = LightingSceneOffset + joinOffset; LightingSceneOffset = LightingSceneOffset + joinOffset;
ButtonVisibilityOffset = ButtonVisibilityOffset + joinOffset; ButtonVisibilityOffset = ButtonVisibilityOffset + joinOffset;
} }
} }
} }

View File

@@ -70,7 +70,7 @@ namespace PepperDash.Essentials.Bridges
catch (NullReferenceException) catch (NullReferenceException)
{ {
Debug.ConsoleWithLog(0, this, Debug.ConsoleWithLog(0, this,
"Please update the bridge config to use eiscApiAdvanced with this device: {0}", device.Key); "Please update the bridge config to use EiscBridgeAdvanced with this device: {0}", device.Key);
} }
} }
Debug.Console(1, this, "Devices Linked."); Debug.Console(1, this, "Devices Linked.");

View File

@@ -1,144 +1,144 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using Crestron.SimplSharp; using Crestron.SimplSharp;
using Newtonsoft.Json; using Newtonsoft.Json;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using PepperDash.Essentials.Core; using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Config; using PepperDash.Essentials.Core.Config;
using PepperDash.Core; using PepperDash.Core;
using PepperDash.Essentials.Core.Routing; using PepperDash.Essentials.Core.Routing;
using Crestron.SimplSharpPro; using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.EthernetCommunication; using Crestron.SimplSharpPro.EthernetCommunication;
using Crestron.SimplSharpPro.CrestronThread; using Crestron.SimplSharpPro.CrestronThread;
namespace PepperDash.Essentials { namespace PepperDash.Essentials {
public class EssentialCommConfig { public class EssentialCommConfig {
public string[] EiscApiIpids; public string[] EiscApiIpids;
public EssentialCommCommConnectionConfigs[] CommConnections; public EssentialCommCommConnectionConfigs[] CommConnections;
} }
public class EssentialCommCommConnectionConfigs { public class EssentialCommCommConnectionConfigs {
public uint joinNumber {get; set; } public uint joinNumber {get; set; }
public EssentialsControlPropertiesConfig control { get; set; } public EssentialsControlPropertiesConfig control { get; set; }
} }
public class EssentialCommsPort { public class EssentialCommsPort {
public IBasicCommunication Comm; public IBasicCommunication Comm;
public IntFeedback StatusFeedback; public IntFeedback StatusFeedback;
public BoolFeedback ConnectedFeedback; public BoolFeedback ConnectedFeedback;
public List<EssentialComApiMap> Outputs = new List<EssentialComApiMap>(); public List<EssentialComApiMap> Outputs = new List<EssentialComApiMap>();
public String RxBuffer; public String RxBuffer;
public EssentialCommsPort(EssentialsControlPropertiesConfig config, string keyPrefix) { public EssentialCommsPort(EssentialsControlPropertiesConfig config, string keyPrefix) {
Comm = CommFactory.CreateCommForConfig(config, keyPrefix); Comm = CommFactory.CreateCommForConfig(config, keyPrefix);
// var PortGather = new CommunicationGather(Comm, config.EndOfLineChar); // var PortGather = new CommunicationGather(Comm, config.EndOfLineChar);
Comm.TextReceived += new EventHandler<GenericCommMethodReceiveTextArgs>(Communication_TextReceived); Comm.TextReceived += new EventHandler<GenericCommMethodReceiveTextArgs>(Communication_TextReceived);
var socket = Comm as ISocketStatus; var socket = Comm as ISocketStatus;
StatusFeedback = new IntFeedback(() => { return (int)socket.ClientStatus; }); StatusFeedback = new IntFeedback(() => { return (int)socket.ClientStatus; });
ConnectedFeedback = new BoolFeedback(() => { return Comm.IsConnected; }); ConnectedFeedback = new BoolFeedback(() => { return Comm.IsConnected; });
if (socket != null) { if (socket != null) {
socket.ConnectionChange += new EventHandler<GenericSocketStatusChageEventArgs>(socket_ConnectionChange); socket.ConnectionChange += new EventHandler<GenericSocketStatusChageEventArgs>(socket_ConnectionChange);
} else { } else {
} }
} }
void socket_ConnectionChange(object sender, GenericSocketStatusChageEventArgs e) { void socket_ConnectionChange(object sender, GenericSocketStatusChageEventArgs e) {
StatusFeedback.FireUpdate(); StatusFeedback.FireUpdate();
ConnectedFeedback.FireUpdate(); ConnectedFeedback.FireUpdate();
if (e.Client.IsConnected) { if (e.Client.IsConnected) {
// Tasks on connect // Tasks on connect
} else { } else {
// Cleanup items from this session // Cleanup items from this session
} }
} }
void Communication_TextReceived(object sender, GenericCommMethodReceiveTextArgs args) { void Communication_TextReceived(object sender, GenericCommMethodReceiveTextArgs args) {
try { try {
foreach (var Output in Outputs) { foreach (var Output in Outputs) {
Output.Api.Eisc.StringInput[Output.Join].StringValue = args.Text; Output.Api.Eisc.StringInput[Output.Join].StringValue = args.Text;
} }
} }
catch (Exception) { catch (Exception) {
throw new FormatException(string.Format("ERROR:{0}")); throw new FormatException(string.Format("ERROR:{0}"));
} }
} }
} }
public class EssentialComm : Device { public class EssentialComm : Device {
public EssentialCommConfig Properties; public EssentialCommConfig Properties;
public CommunicationGather PortGather { get; private set; } public CommunicationGather PortGather { get; private set; }
public List<BridgeApiEisc> Apis {get; set;} public List<BridgeApiEisc> Apis {get; set;}
public Dictionary<string, StringFeedback> CommFeedbacks {get; private set; } public Dictionary<string, StringFeedback> CommFeedbacks {get; private set; }
public StatusMonitorBase CommunicationMonitor { get; private set; } public StatusMonitorBase CommunicationMonitor { get; private set; }
public Dictionary<uint, EssentialCommsPort> CommDictionary { get; private set; } public Dictionary<uint, EssentialCommsPort> CommDictionary { get; private set; }
public EssentialComm(string key, string name, JToken properties) : base(key, name) { public EssentialComm(string key, string name, JToken properties) : base(key, name) {
Properties = JsonConvert.DeserializeObject<EssentialCommConfig>(properties.ToString()); Properties = JsonConvert.DeserializeObject<EssentialCommConfig>(properties.ToString());
CommFeedbacks = new Dictionary<string, StringFeedback>(); CommFeedbacks = new Dictionary<string, StringFeedback>();
CommDictionary = new Dictionary<uint, EssentialCommsPort>(); CommDictionary = new Dictionary<uint, EssentialCommsPort>();
Apis = new List<BridgeApiEisc>(); Apis = new List<BridgeApiEisc>();
int commNumber = 1; int commNumber = 1;
foreach (var commConfig in Properties.CommConnections) { foreach (var commConfig in Properties.CommConnections) {
var commPort = new EssentialCommsPort(commConfig.control, string.Format("{0}-{1}", this.Key, commConfig.joinNumber)); var commPort = new EssentialCommsPort(commConfig.control, string.Format("{0}-{1}", this.Key, commConfig.joinNumber));
CommDictionary.Add(commConfig.joinNumber, commPort); CommDictionary.Add(commConfig.joinNumber, commPort);
commNumber++; commNumber++;
} }
foreach (var Ipid in Properties.EiscApiIpids) { foreach (var Ipid in Properties.EiscApiIpids) {
var ApiEisc = new BridgeApiEisc(Ipid); var ApiEisc = new BridgeApiEisc(Ipid);
Apis.Add(ApiEisc); Apis.Add(ApiEisc);
foreach (var commConnection in CommDictionary) { foreach (var commConnection in CommDictionary) {
Debug.Console(2, "Joining Api{0} to comm {1}", Ipid, commConnection.Key); Debug.Console(2, "Joining Api{0} to comm {1}", Ipid, commConnection.Key);
var tempComm = commConnection.Value; var tempComm = commConnection.Value;
var tempJoin = (uint)commConnection.Key; var tempJoin = (uint)commConnection.Key;
EssentialComApiMap ApiMap = new EssentialComApiMap(ApiEisc, (uint)tempJoin); EssentialComApiMap ApiMap = new EssentialComApiMap(ApiEisc, (uint)tempJoin);
tempComm.Outputs.Add(ApiMap); tempComm.Outputs.Add(ApiMap);
// Check for ApiMap Overide Values here // Check for ApiMap Overide Values here
ApiEisc.Eisc.SetBoolSigAction(tempJoin, b => {if (b) { tempComm.Comm.Connect(); } else { tempComm.Comm.Disconnect(); }}); ApiEisc.Eisc.SetBoolSigAction(tempJoin, b => {if (b) { tempComm.Comm.Connect(); } else { tempComm.Comm.Disconnect(); }});
ApiEisc.Eisc.SetStringSigAction(tempJoin, s => tempComm.Comm.SendText(s)); ApiEisc.Eisc.SetStringSigAction(tempJoin, s => tempComm.Comm.SendText(s));
tempComm.StatusFeedback.LinkInputSig(ApiEisc.Eisc.UShortInput[tempJoin]); tempComm.StatusFeedback.LinkInputSig(ApiEisc.Eisc.UShortInput[tempJoin]);
tempComm.ConnectedFeedback.LinkInputSig(ApiEisc.Eisc.BooleanInput[tempJoin]); tempComm.ConnectedFeedback.LinkInputSig(ApiEisc.Eisc.BooleanInput[tempJoin]);
} }
ApiEisc.Eisc.Register(); ApiEisc.Eisc.Register();
} }
} }
public override bool CustomActivate() public override bool CustomActivate()
{ {
try { try {
Debug.Console(2, "Name {0} Activated", this.Name); Debug.Console(2, "Name {0} Activated", this.Name);
return true; return true;
} }
catch (Exception e) { catch (Exception e) {
Debug.Console(0, "Bridge {0}", e); Debug.Console(0, "Bridge {0}", e);
return false; return false;
} }
} }
} }
public class EssentialComApiMap { public class EssentialComApiMap {
public uint Join; public uint Join;
public BridgeApiEisc Api; public BridgeApiEisc Api;
public uint connectJoin; public uint connectJoin;
public EssentialComApiMap(BridgeApiEisc api, uint join) { public EssentialComApiMap(BridgeApiEisc api, uint join) {
Join = join; Join = join;
Api = api; Api = api;
} }
} }
} }

View File

@@ -1,150 +1,150 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using Crestron.SimplSharp; using Crestron.SimplSharp;
using Newtonsoft.Json; using Newtonsoft.Json;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using PepperDash.Essentials.Core; using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Config; using PepperDash.Essentials.Core.Config;
using PepperDash.Essentials.DM; using PepperDash.Essentials.DM;
using PepperDash.Core; using PepperDash.Core;
using PepperDash.Essentials.Core.Routing; using PepperDash.Essentials.Core.Routing;
using Crestron.SimplSharpPro; using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.EthernetCommunication; using Crestron.SimplSharpPro.EthernetCommunication;
using Crestron.SimplSharpPro.DM; using Crestron.SimplSharpPro.DM;
namespace PepperDash.Essentials { namespace PepperDash.Essentials {
public class EssentialDM : PepperDash.Core.Device { public class EssentialDM : PepperDash.Core.Device {
public EssentialDMProperties Properties; public EssentialDMProperties Properties;
public List<BridgeApiEisc> BridgeApiEiscs; public List<BridgeApiEisc> BridgeApiEiscs;
private PepperDash.Essentials.DM.DmChassisController DmSwitch; private PepperDash.Essentials.DM.DmChassisController DmSwitch;
private EssentialDMApiMap ApiMap = new EssentialDMApiMap(); private EssentialDMApiMap ApiMap = new EssentialDMApiMap();
public EssentialDM(string key, string name, JToken properties) public EssentialDM(string key, string name, JToken properties)
: base(key, name) { : base(key, name) {
Properties = JsonConvert.DeserializeObject<EssentialDMProperties>(properties.ToString()); Properties = JsonConvert.DeserializeObject<EssentialDMProperties>(properties.ToString());
} }
public override bool CustomActivate() { public override bool CustomActivate() {
// Create EiscApis // Create EiscApis
try { try {
foreach (var device in DeviceManager.AllDevices) { foreach (var device in DeviceManager.AllDevices) {
if (device.Key == this.Properties.connectionDeviceKey) { if (device.Key == this.Properties.connectionDeviceKey) {
Debug.Console(2, "deviceKey {0} Matches", device.Key); Debug.Console(2, "deviceKey {0} Matches", device.Key);
DmSwitch = DeviceManager.GetDeviceForKey(device.Key) as PepperDash.Essentials.DM.DmChassisController; DmSwitch = DeviceManager.GetDeviceForKey(device.Key) as PepperDash.Essentials.DM.DmChassisController;
} }
else { else {
Debug.Console(2, "deviceKey {0} doesn't match", device.Key); Debug.Console(2, "deviceKey {0} doesn't match", device.Key);
} }
} }
if (Properties.EiscApiIpids != null) { if (Properties.EiscApiIpids != null) {
foreach (string Ipid in Properties.EiscApiIpids) { foreach (string Ipid in Properties.EiscApiIpids) {
var ApiEisc = new BridgeApiEisc(Ipid); var ApiEisc = new BridgeApiEisc(Ipid);
for (uint x = 1; x <= DmSwitch.Chassis.NumberOfInputs;x++ ) { for (uint x = 1; x <= DmSwitch.Chassis.NumberOfInputs;x++ ) {
uint tempX = x; uint tempX = x;
Debug.Console(2, "Creating EiscActions {0}", tempX); Debug.Console(2, "Creating EiscActions {0}", tempX);
ApiEisc.Eisc.SetUShortSigAction(ApiMap.OutputVideoRoutes[tempX], u => DmSwitch.ExecuteSwitch(u, tempX, eRoutingSignalType.Video)); ApiEisc.Eisc.SetUShortSigAction(ApiMap.OutputVideoRoutes[tempX], u => DmSwitch.ExecuteSwitch(u, tempX, eRoutingSignalType.Video));
ApiEisc.Eisc.SetUShortSigAction(ApiMap.OutputAudioRoutes[tempX], u => DmSwitch.ExecuteSwitch(u, tempX, eRoutingSignalType.Audio)); ApiEisc.Eisc.SetUShortSigAction(ApiMap.OutputAudioRoutes[tempX], u => DmSwitch.ExecuteSwitch(u, tempX, eRoutingSignalType.Audio));
if (DmSwitch.TxDictionary.ContainsKey(tempX)) { if (DmSwitch.TxDictionary.ContainsKey(tempX)) {
Debug.Console(2, "Creating Tx Feedbacks {0}", tempX); Debug.Console(2, "Creating Tx Feedbacks {0}", tempX);
var TxKey = DmSwitch.TxDictionary[tempX]; var TxKey = DmSwitch.TxDictionary[tempX];
var TxDevice = DeviceManager.GetDeviceForKey(TxKey) as DmTxControllerBase; var TxDevice = DeviceManager.GetDeviceForKey(TxKey) as DmTxControllerBase;
TxDevice.IsOnline.LinkInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.TxOnlineStatus[tempX]]); TxDevice.IsOnline.LinkInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.TxOnlineStatus[tempX]]);
TxDevice.AnyVideoInput.VideoStatus.VideoSyncFeedback.LinkInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.TxVideoSyncStatus[tempX]]); TxDevice.AnyVideoInput.VideoStatus.VideoSyncFeedback.LinkInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.TxVideoSyncStatus[tempX]]);
ApiEisc.Eisc.SetUShortSigAction((ApiMap.HdcpSupport[tempX]), u => TxDevice.SetHdcpSupportAll((ePdtHdcpSupport)(u))); ApiEisc.Eisc.SetUShortSigAction((ApiMap.HdcpSupport[tempX]), u => TxDevice.SetHdcpSupportAll((ePdtHdcpSupport)(u)));
TxDevice.HdcpSupportAllFeedback.LinkInputSig(ApiEisc.Eisc.UShortInput[ApiMap.HdcpSupport[tempX]]); TxDevice.HdcpSupportAllFeedback.LinkInputSig(ApiEisc.Eisc.UShortInput[ApiMap.HdcpSupport[tempX]]);
ApiEisc.Eisc.UShortInput[ApiMap.HdcpSupportCapability[tempX]].UShortValue = TxDevice.HdcpSupportCapability; ApiEisc.Eisc.UShortInput[ApiMap.HdcpSupportCapability[tempX]].UShortValue = TxDevice.HdcpSupportCapability;
} }
else { else {
DmSwitch.VideoInputSyncFeedbacks[tempX].LinkInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.TxVideoSyncStatus[tempX]]); DmSwitch.VideoInputSyncFeedbacks[tempX].LinkInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.TxVideoSyncStatus[tempX]]);
} }
if (DmSwitch.RxDictionary.ContainsKey(tempX)) { if (DmSwitch.RxDictionary.ContainsKey(tempX)) {
Debug.Console(2, "Creating Rx Feedbacks {0}", tempX); Debug.Console(2, "Creating Rx Feedbacks {0}", tempX);
var RxKey = DmSwitch.RxDictionary[tempX]; var RxKey = DmSwitch.RxDictionary[tempX];
var RxDevice = DeviceManager.GetDeviceForKey(RxKey) as DmRmcControllerBase; var RxDevice = DeviceManager.GetDeviceForKey(RxKey) as DmRmcControllerBase;
RxDevice.IsOnline.LinkInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.RxOnlineStatus[tempX]]); RxDevice.IsOnline.LinkInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.RxOnlineStatus[tempX]]);
} }
// DmSwitch.InputEndpointOnlineFeedbacks[(ushort)tempOutputNum].LinkInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.OutputVideoRoutes[tempOutputNum]]); // DmSwitch.InputEndpointOnlineFeedbacks[(ushort)tempOutputNum].LinkInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.OutputVideoRoutes[tempOutputNum]]);
DmSwitch.VideoOutputFeedbacks[(ushort)tempX].LinkInputSig(ApiEisc.Eisc.UShortInput[ApiMap.OutputVideoRoutes[tempX]]); DmSwitch.VideoOutputFeedbacks[(ushort)tempX].LinkInputSig(ApiEisc.Eisc.UShortInput[ApiMap.OutputVideoRoutes[tempX]]);
DmSwitch.AudioOutputFeedbacks[(ushort)tempX].LinkInputSig(ApiEisc.Eisc.UShortInput[ApiMap.OutputAudioRoutes[tempX]]); DmSwitch.AudioOutputFeedbacks[(ushort)tempX].LinkInputSig(ApiEisc.Eisc.UShortInput[ApiMap.OutputAudioRoutes[tempX]]);
DmSwitch.InputNameFeedbacks[(ushort)tempX].LinkInputSig(ApiEisc.Eisc.StringInput[ApiMap.InputNames[tempX]]); DmSwitch.InputNameFeedbacks[(ushort)tempX].LinkInputSig(ApiEisc.Eisc.StringInput[ApiMap.InputNames[tempX]]);
DmSwitch.OutputNameFeedbacks[(ushort)tempX].LinkInputSig(ApiEisc.Eisc.StringInput[ApiMap.OutputNames[tempX]]); DmSwitch.OutputNameFeedbacks[(ushort)tempX].LinkInputSig(ApiEisc.Eisc.StringInput[ApiMap.OutputNames[tempX]]);
DmSwitch.OutputRouteNameFeedbacks[(ushort)tempX].LinkInputSig(ApiEisc.Eisc.StringInput[ApiMap.OutputRouteNames[tempX]]); DmSwitch.OutputRouteNameFeedbacks[(ushort)tempX].LinkInputSig(ApiEisc.Eisc.StringInput[ApiMap.OutputRouteNames[tempX]]);
} }
DmSwitch.IsOnline.LinkInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.ChassisOnline]); DmSwitch.IsOnline.LinkInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.ChassisOnline]);
ApiEisc.Eisc.Register(); ApiEisc.Eisc.Register();
} }
} }
Debug.Console(2, "Name {0} Activated", this.Name); Debug.Console(2, "Name {0} Activated", this.Name);
return true; return true;
} }
catch (Exception e) { catch (Exception e) {
Debug.Console(2, "BRidge {0}", e); Debug.Console(2, "BRidge {0}", e);
return false; return false;
} }
} }
} }
public class EssentialDMProperties { public class EssentialDMProperties {
public string connectionDeviceKey; public string connectionDeviceKey;
public string[] EiscApiIpids; public string[] EiscApiIpids;
} }
public class EssentialDMApiMap { public class EssentialDMApiMap {
public ushort ChassisOnline = 11; public ushort ChassisOnline = 11;
public Dictionary<uint, ushort> OutputVideoRoutes; public Dictionary<uint, ushort> OutputVideoRoutes;
public Dictionary<uint, ushort> OutputAudioRoutes; public Dictionary<uint, ushort> OutputAudioRoutes;
public Dictionary<uint, ushort> TxOnlineStatus; public Dictionary<uint, ushort> TxOnlineStatus;
public Dictionary<uint, ushort> RxOnlineStatus; public Dictionary<uint, ushort> RxOnlineStatus;
public Dictionary<uint, ushort> TxVideoSyncStatus; public Dictionary<uint, ushort> TxVideoSyncStatus;
public Dictionary<uint, ushort> InputNames; public Dictionary<uint, ushort> InputNames;
public Dictionary<uint, ushort> OutputNames; public Dictionary<uint, ushort> OutputNames;
public Dictionary<uint, ushort> OutputRouteNames; public Dictionary<uint, ushort> OutputRouteNames;
public Dictionary<uint, ushort> HdcpSupport; public Dictionary<uint, ushort> HdcpSupport;
public Dictionary<uint, ushort> HdcpSupportCapability; public Dictionary<uint, ushort> HdcpSupportCapability;
public EssentialDMApiMap() { public EssentialDMApiMap() {
OutputVideoRoutes = new Dictionary<uint, ushort>(); OutputVideoRoutes = new Dictionary<uint, ushort>();
OutputAudioRoutes = new Dictionary<uint, ushort>(); OutputAudioRoutes = new Dictionary<uint, ushort>();
TxOnlineStatus = new Dictionary<uint, ushort>(); TxOnlineStatus = new Dictionary<uint, ushort>();
RxOnlineStatus = new Dictionary<uint, ushort>(); RxOnlineStatus = new Dictionary<uint, ushort>();
TxVideoSyncStatus = new Dictionary<uint, ushort>(); TxVideoSyncStatus = new Dictionary<uint, ushort>();
InputNames = new Dictionary<uint, ushort>(); InputNames = new Dictionary<uint, ushort>();
OutputNames = new Dictionary<uint, ushort>(); OutputNames = new Dictionary<uint, ushort>();
OutputRouteNames = new Dictionary<uint, ushort>(); OutputRouteNames = new Dictionary<uint, ushort>();
HdcpSupport = new Dictionary<uint, ushort>(); HdcpSupport = new Dictionary<uint, ushort>();
HdcpSupportCapability = new Dictionary<uint, ushort>(); HdcpSupportCapability = new Dictionary<uint, ushort>();
for (uint x = 1; x <= 200; x++) { for (uint x = 1; x <= 200; x++) {
// Debug.Console(0, "Init Value {0}", x); // Debug.Console(0, "Init Value {0}", x);
uint tempNum = x; uint tempNum = x;
HdcpSupportCapability[tempNum] = (ushort)(tempNum + 1200); HdcpSupportCapability[tempNum] = (ushort)(tempNum + 1200);
HdcpSupport[tempNum] = (ushort)(tempNum + 1000); HdcpSupport[tempNum] = (ushort)(tempNum + 1000);
OutputVideoRoutes[tempNum] = (ushort)(tempNum + 100); OutputVideoRoutes[tempNum] = (ushort)(tempNum + 100);
OutputAudioRoutes[tempNum] = (ushort)(tempNum + 300); OutputAudioRoutes[tempNum] = (ushort)(tempNum + 300);
TxOnlineStatus[tempNum] = (ushort)(tempNum + 500); TxOnlineStatus[tempNum] = (ushort)(tempNum + 500);
RxOnlineStatus[tempNum] = (ushort)(tempNum + 700); RxOnlineStatus[tempNum] = (ushort)(tempNum + 700);
TxVideoSyncStatus[tempNum] = (ushort)(tempNum + 100); TxVideoSyncStatus[tempNum] = (ushort)(tempNum + 100);
InputNames[tempNum] = (ushort)(tempNum + 100); InputNames[tempNum] = (ushort)(tempNum + 100);
OutputNames[tempNum] = (ushort)(tempNum + 300); OutputNames[tempNum] = (ushort)(tempNum + 300);
OutputRouteNames[tempNum] = (ushort)(tempNum + 2000); OutputRouteNames[tempNum] = (ushort)(tempNum + 2000);
} }
} }
} }
} }

View File

@@ -1,217 +1,217 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using Crestron.SimplSharp; using Crestron.SimplSharp;
using Newtonsoft.Json; using Newtonsoft.Json;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using PepperDash.Essentials.Core; using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Config; using PepperDash.Essentials.Core.Config;
using PepperDash.Essentials.DM; using PepperDash.Essentials.DM;
using PepperDash.Core; using PepperDash.Core;
using PepperDash.Essentials.Core.Routing; using PepperDash.Essentials.Core.Routing;
using Crestron.SimplSharpPro; using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.EthernetCommunication; using Crestron.SimplSharpPro.EthernetCommunication;
using Crestron.SimplSharpPro.DM; using Crestron.SimplSharpPro.DM;
namespace PepperDash.Essentials { namespace PepperDash.Essentials {
public class EssentialDsp : PepperDash.Core.Device { public class EssentialDsp : PepperDash.Core.Device {
public EssentialDspProperties Properties; public EssentialDspProperties Properties;
public List<BridgeApiEisc> BridgeApiEiscs; public List<BridgeApiEisc> BridgeApiEiscs;
private PepperDash.Essentials.Devices.Common.DSP.QscDsp Dsp; private PepperDash.Essentials.Devices.Common.DSP.QscDsp Dsp;
private EssentialDspApiMap ApiMap = new EssentialDspApiMap(); private EssentialDspApiMap ApiMap = new EssentialDspApiMap();
public EssentialDsp(string key, string name, JToken properties) public EssentialDsp(string key, string name, JToken properties)
: base(key, name) { : base(key, name) {
Properties = JsonConvert.DeserializeObject<EssentialDspProperties>(properties.ToString()); Properties = JsonConvert.DeserializeObject<EssentialDspProperties>(properties.ToString());
} }
public override bool CustomActivate() { public override bool CustomActivate() {
// Create EiscApis // Create EiscApis
try try
{ {
ICommunicationMonitor comm = null; ICommunicationMonitor comm = null;
foreach (var device in DeviceManager.AllDevices) foreach (var device in DeviceManager.AllDevices)
{ {
if (device.Key == this.Properties.connectionDeviceKey) if (device.Key == this.Properties.connectionDeviceKey)
{ {
if (!(device is ICommunicationMonitor)) if (!(device is ICommunicationMonitor))
{ {
comm = device as ICommunicationMonitor; comm = device as ICommunicationMonitor;
} }
Debug.Console(2, "deviceKey {0} Matches", device.Key); Debug.Console(2, "deviceKey {0} Matches", device.Key);
Dsp = DeviceManager.GetDeviceForKey(device.Key) as PepperDash.Essentials.Devices.Common.DSP.QscDsp; Dsp = DeviceManager.GetDeviceForKey(device.Key) as PepperDash.Essentials.Devices.Common.DSP.QscDsp;
break; break;
} }
else else
{ {
Debug.Console(2, "deviceKey {0} doesn't match", device.Key); Debug.Console(2, "deviceKey {0} doesn't match", device.Key);
} }
} }
if (Properties.EiscApiIpids != null && Dsp != null) if (Properties.EiscApiIpids != null && Dsp != null)
{ {
foreach (string Ipid in Properties.EiscApiIpids) foreach (string Ipid in Properties.EiscApiIpids)
{ {
var ApiEisc = new BridgeApiEisc(Ipid); var ApiEisc = new BridgeApiEisc(Ipid);
Debug.Console(2, "Connecting EiscApi {0} to {1}", ApiEisc.Ipid, Dsp.Name); Debug.Console(2, "Connecting EiscApi {0} to {1}", ApiEisc.Ipid, Dsp.Name);
ushort x = 1; ushort x = 1;
if (comm != null) if (comm != null)
{ {
comm.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.Online]); comm.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.Online]);
} }
foreach (var channel in Dsp.LevelControlPoints) foreach (var channel in Dsp.LevelControlPoints)
{ {
//var QscChannel = channel.Value as PepperDash.Essentials.Devices.Common.DSP.QscDspLevelControl; //var QscChannel = channel.Value as PepperDash.Essentials.Devices.Common.DSP.QscDspLevelControl;
Debug.Console(2, "QscChannel {0} connect", x); Debug.Console(2, "QscChannel {0} connect", x);
var genericChannel = channel.Value as IBasicVolumeWithFeedback; var genericChannel = channel.Value as IBasicVolumeWithFeedback;
if (channel.Value.Enabled) if (channel.Value.Enabled)
{ {
ApiEisc.Eisc.StringInput[ApiMap.channelName[x]].StringValue = channel.Value.LevelCustomName; ApiEisc.Eisc.StringInput[ApiMap.channelName[x]].StringValue = channel.Value.LevelCustomName;
ApiEisc.Eisc.UShortInput[ApiMap.channelType[x]].UShortValue = (ushort)channel.Value.Type; ApiEisc.Eisc.UShortInput[ApiMap.channelType[x]].UShortValue = (ushort)channel.Value.Type;
genericChannel.MuteFeedback.LinkInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.channelMuteToggle[x]]); genericChannel.MuteFeedback.LinkInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.channelMuteToggle[x]]);
genericChannel.VolumeLevelFeedback.LinkInputSig(ApiEisc.Eisc.UShortInput[ApiMap.channelVolume[x]]); genericChannel.VolumeLevelFeedback.LinkInputSig(ApiEisc.Eisc.UShortInput[ApiMap.channelVolume[x]]);
ApiEisc.Eisc.SetSigTrueAction(ApiMap.channelMuteToggle[x], () => genericChannel.MuteToggle()); ApiEisc.Eisc.SetSigTrueAction(ApiMap.channelMuteToggle[x], () => genericChannel.MuteToggle());
ApiEisc.Eisc.SetSigTrueAction(ApiMap.channelMuteOn[x], () => genericChannel.MuteOn()); ApiEisc.Eisc.SetSigTrueAction(ApiMap.channelMuteOn[x], () => genericChannel.MuteOn());
ApiEisc.Eisc.SetSigTrueAction(ApiMap.channelMuteOff[x], () => genericChannel.MuteOff()); ApiEisc.Eisc.SetSigTrueAction(ApiMap.channelMuteOff[x], () => genericChannel.MuteOff());
ApiEisc.Eisc.SetBoolSigAction(ApiMap.channelVolumeUp[x], b => genericChannel.VolumeUp(b)); ApiEisc.Eisc.SetBoolSigAction(ApiMap.channelVolumeUp[x], b => genericChannel.VolumeUp(b));
ApiEisc.Eisc.SetBoolSigAction(ApiMap.channelVolumeDown[x], b => genericChannel.VolumeDown(b)); ApiEisc.Eisc.SetBoolSigAction(ApiMap.channelVolumeDown[x], b => genericChannel.VolumeDown(b));
ApiEisc.Eisc.SetUShortSigAction(ApiMap.channelVolume[x], u => genericChannel.SetVolume(u)); ApiEisc.Eisc.SetUShortSigAction(ApiMap.channelVolume[x], u => genericChannel.SetVolume(u));
ApiEisc.Eisc.SetStringSigAction(ApiMap.presetString, s => Dsp.RunPreset(s)); ApiEisc.Eisc.SetStringSigAction(ApiMap.presetString, s => Dsp.RunPreset(s));
} }
x++; x++;
} }
x = 1; x = 1;
foreach (var preset in Dsp.PresetList) foreach (var preset in Dsp.PresetList)
{ {
ApiEisc.Eisc.StringInput[ApiMap.presets[x]].StringValue = preset.label; ApiEisc.Eisc.StringInput[ApiMap.presets[x]].StringValue = preset.label;
ApiEisc.Eisc.SetSigTrueAction(ApiMap.presets[x], () => Dsp.RunPresetNumber(x)); ApiEisc.Eisc.SetSigTrueAction(ApiMap.presets[x], () => Dsp.RunPresetNumber(x));
x++; x++;
} }
foreach (var dialer in Dsp.Dialers) foreach (var dialer in Dsp.Dialers)
{ {
ApiEisc.Eisc.SetSigTrueAction(ApiMap.Keypad0, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Num0)); ApiEisc.Eisc.SetSigTrueAction(ApiMap.Keypad0, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Num0));
ApiEisc.Eisc.SetSigTrueAction(ApiMap.Keypad1, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Num1)); ApiEisc.Eisc.SetSigTrueAction(ApiMap.Keypad1, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Num1));
ApiEisc.Eisc.SetSigTrueAction(ApiMap.Keypad2, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Num2)); ApiEisc.Eisc.SetSigTrueAction(ApiMap.Keypad2, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Num2));
ApiEisc.Eisc.SetSigTrueAction(ApiMap.Keypad3, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Num3)); ApiEisc.Eisc.SetSigTrueAction(ApiMap.Keypad3, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Num3));
ApiEisc.Eisc.SetSigTrueAction(ApiMap.Keypad4, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Num4)); ApiEisc.Eisc.SetSigTrueAction(ApiMap.Keypad4, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Num4));
ApiEisc.Eisc.SetSigTrueAction(ApiMap.Keypad5, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Num5)); ApiEisc.Eisc.SetSigTrueAction(ApiMap.Keypad5, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Num5));
ApiEisc.Eisc.SetSigTrueAction(ApiMap.Keypad6, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Num6)); ApiEisc.Eisc.SetSigTrueAction(ApiMap.Keypad6, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Num6));
ApiEisc.Eisc.SetSigTrueAction(ApiMap.Keypad7, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Num7)); ApiEisc.Eisc.SetSigTrueAction(ApiMap.Keypad7, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Num7));
ApiEisc.Eisc.SetSigTrueAction(ApiMap.Keypad8, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Num8)); ApiEisc.Eisc.SetSigTrueAction(ApiMap.Keypad8, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Num8));
ApiEisc.Eisc.SetSigTrueAction(ApiMap.Keypad9, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Num9)); ApiEisc.Eisc.SetSigTrueAction(ApiMap.Keypad9, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Num9));
ApiEisc.Eisc.SetSigTrueAction(ApiMap.KeypadStar, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Star)); ApiEisc.Eisc.SetSigTrueAction(ApiMap.KeypadStar, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Star));
ApiEisc.Eisc.SetSigTrueAction(ApiMap.KeypadPound, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Pound)); ApiEisc.Eisc.SetSigTrueAction(ApiMap.KeypadPound, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Pound));
ApiEisc.Eisc.SetSigTrueAction(ApiMap.KeypadClear, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Clear)); ApiEisc.Eisc.SetSigTrueAction(ApiMap.KeypadClear, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Clear));
ApiEisc.Eisc.SetSigTrueAction(ApiMap.KeypadBackspace, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Backspace)); ApiEisc.Eisc.SetSigTrueAction(ApiMap.KeypadBackspace, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Backspace));
ApiEisc.Eisc.SetSigTrueAction(ApiMap.Dial, () => dialer.Value.Dial()); ApiEisc.Eisc.SetSigTrueAction(ApiMap.Dial, () => dialer.Value.Dial());
ApiEisc.Eisc.SetSigTrueAction(ApiMap.DoNotDisturbToggle, () => dialer.Value.DoNotDisturbToggle()); ApiEisc.Eisc.SetSigTrueAction(ApiMap.DoNotDisturbToggle, () => dialer.Value.DoNotDisturbToggle());
ApiEisc.Eisc.SetSigTrueAction(ApiMap.DoNotDisturbOn, () => dialer.Value.DoNotDisturbOn()); ApiEisc.Eisc.SetSigTrueAction(ApiMap.DoNotDisturbOn, () => dialer.Value.DoNotDisturbOn());
ApiEisc.Eisc.SetSigTrueAction(ApiMap.DoNotDisturbOff, () => dialer.Value.DoNotDisturbOff()); ApiEisc.Eisc.SetSigTrueAction(ApiMap.DoNotDisturbOff, () => dialer.Value.DoNotDisturbOff());
ApiEisc.Eisc.SetSigTrueAction(ApiMap.AutoAnswerToggle, () => dialer.Value.AutoAnswerToggle()); ApiEisc.Eisc.SetSigTrueAction(ApiMap.AutoAnswerToggle, () => dialer.Value.AutoAnswerToggle());
ApiEisc.Eisc.SetSigTrueAction(ApiMap.AutoAnswerOn, () => dialer.Value.AutoAnswerOn()); ApiEisc.Eisc.SetSigTrueAction(ApiMap.AutoAnswerOn, () => dialer.Value.AutoAnswerOn());
ApiEisc.Eisc.SetSigTrueAction(ApiMap.AutoAnswerOff, () => dialer.Value.AutoAnswerOff()); ApiEisc.Eisc.SetSigTrueAction(ApiMap.AutoAnswerOff, () => dialer.Value.AutoAnswerOff());
dialer.Value.DoNotDisturbFeedback.LinkInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.DoNotDisturbToggle]); dialer.Value.DoNotDisturbFeedback.LinkInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.DoNotDisturbToggle]);
dialer.Value.DoNotDisturbFeedback.LinkInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.DoNotDisturbOn]); dialer.Value.DoNotDisturbFeedback.LinkInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.DoNotDisturbOn]);
dialer.Value.DoNotDisturbFeedback.LinkComplementInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.DoNotDisturbOff]); dialer.Value.DoNotDisturbFeedback.LinkComplementInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.DoNotDisturbOff]);
dialer.Value.AutoAnswerFeedback.LinkInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.AutoAnswerToggle]); dialer.Value.AutoAnswerFeedback.LinkInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.AutoAnswerToggle]);
dialer.Value.AutoAnswerFeedback.LinkInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.AutoAnswerOn]); dialer.Value.AutoAnswerFeedback.LinkInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.AutoAnswerOn]);
dialer.Value.AutoAnswerFeedback.LinkComplementInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.AutoAnswerOff]); dialer.Value.AutoAnswerFeedback.LinkComplementInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.AutoAnswerOff]);
dialer.Value.OffHookFeedback.LinkInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.Dial]); dialer.Value.OffHookFeedback.LinkInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.Dial]);
dialer.Value.DialStringFeedback.LinkInputSig(ApiEisc.Eisc.StringInput[ApiMap.DialString]); dialer.Value.DialStringFeedback.LinkInputSig(ApiEisc.Eisc.StringInput[ApiMap.DialString]);
} }
} }
} }
Debug.Console(2, "Name {0} Activated", this.Name); Debug.Console(2, "Name {0} Activated", this.Name);
return true; return true;
} }
catch (Exception e) { catch (Exception e) {
Debug.Console(0, "Bridge {0}", e); Debug.Console(0, "Bridge {0}", e);
return false; return false;
} }
} }
} }
public class EssentialDspProperties { public class EssentialDspProperties {
public string connectionDeviceKey; public string connectionDeviceKey;
public string[] EiscApiIpids; public string[] EiscApiIpids;
} }
public class EssentialDspApiMap { public class EssentialDspApiMap {
public ushort Online = 1; public ushort Online = 1;
public ushort presetString = 2000; public ushort presetString = 2000;
public Dictionary<uint, ushort> channelMuteToggle; public Dictionary<uint, ushort> channelMuteToggle;
public Dictionary<uint, ushort> channelMuteOn; public Dictionary<uint, ushort> channelMuteOn;
public Dictionary<uint, ushort> channelMuteOff; public Dictionary<uint, ushort> channelMuteOff;
public Dictionary<uint, ushort> channelVolume; public Dictionary<uint, ushort> channelVolume;
public Dictionary<uint, ushort> channelType; public Dictionary<uint, ushort> channelType;
public Dictionary<uint, ushort> channelName; public Dictionary<uint, ushort> channelName;
public Dictionary<uint, ushort> channelVolumeUp; public Dictionary<uint, ushort> channelVolumeUp;
public Dictionary<uint, ushort> channelVolumeDown; public Dictionary<uint, ushort> channelVolumeDown;
public Dictionary<uint, ushort> presets; public Dictionary<uint, ushort> presets;
public ushort DialString = 3100; public ushort DialString = 3100;
public ushort Keypad0 = 3110; public ushort Keypad0 = 3110;
public ushort Keypad1 = 3111; public ushort Keypad1 = 3111;
public ushort Keypad2 = 3112; public ushort Keypad2 = 3112;
public ushort Keypad3 = 3113; public ushort Keypad3 = 3113;
public ushort Keypad4 = 3114; public ushort Keypad4 = 3114;
public ushort Keypad5 = 3115; public ushort Keypad5 = 3115;
public ushort Keypad6 = 3116; public ushort Keypad6 = 3116;
public ushort Keypad7 = 3117; public ushort Keypad7 = 3117;
public ushort Keypad8 = 3118; public ushort Keypad8 = 3118;
public ushort Keypad9 = 3119; public ushort Keypad9 = 3119;
public ushort KeypadStar = 3120; public ushort KeypadStar = 3120;
public ushort KeypadPound = 3121; public ushort KeypadPound = 3121;
public ushort KeypadClear = 3122; public ushort KeypadClear = 3122;
public ushort KeypadBackspace = 3123; public ushort KeypadBackspace = 3123;
public ushort Dial = 3124; public ushort Dial = 3124;
public ushort DoNotDisturbToggle = 3132; public ushort DoNotDisturbToggle = 3132;
public ushort DoNotDisturbOn = 3133; public ushort DoNotDisturbOn = 3133;
public ushort DoNotDisturbOff = 3134; public ushort DoNotDisturbOff = 3134;
public ushort AutoAnswerToggle = 3127; public ushort AutoAnswerToggle = 3127;
public ushort AutoAnswerOn = 3125; public ushort AutoAnswerOn = 3125;
public ushort AutoAnswerOff = 3126; public ushort AutoAnswerOff = 3126;
public EssentialDspApiMap() { public EssentialDspApiMap() {
channelMuteToggle = new Dictionary<uint, ushort>(); channelMuteToggle = new Dictionary<uint, ushort>();
channelMuteOn = new Dictionary<uint, ushort>(); channelMuteOn = new Dictionary<uint, ushort>();
channelMuteOff = new Dictionary<uint, ushort>(); channelMuteOff = new Dictionary<uint, ushort>();
channelVolume = new Dictionary<uint, ushort>(); channelVolume = new Dictionary<uint, ushort>();
channelName = new Dictionary<uint, ushort>(); channelName = new Dictionary<uint, ushort>();
channelType = new Dictionary<uint, ushort>(); channelType = new Dictionary<uint, ushort>();
presets = new Dictionary<uint, ushort>(); presets = new Dictionary<uint, ushort>();
channelVolumeUp = new Dictionary<uint, ushort>(); channelVolumeUp = new Dictionary<uint, ushort>();
channelVolumeDown = new Dictionary<uint, ushort>(); channelVolumeDown = new Dictionary<uint, ushort>();
for (uint x = 1; x <= 100; x++) { for (uint x = 1; x <= 100; x++) {
uint tempNum = x; uint tempNum = x;
presets[tempNum] = (ushort)(tempNum + 100); presets[tempNum] = (ushort)(tempNum + 100);
channelMuteToggle[tempNum] = (ushort)(tempNum + 400); channelMuteToggle[tempNum] = (ushort)(tempNum + 400);
channelMuteOn[tempNum] = (ushort)(tempNum + 600); channelMuteOn[tempNum] = (ushort)(tempNum + 600);
channelMuteOff[tempNum] = (ushort)(tempNum + 800); channelMuteOff[tempNum] = (ushort)(tempNum + 800);
channelVolume[tempNum] = (ushort)(tempNum + 200); channelVolume[tempNum] = (ushort)(tempNum + 200);
channelName[tempNum] = (ushort)(tempNum + 200); channelName[tempNum] = (ushort)(tempNum + 200);
channelType[tempNum] = (ushort)(tempNum + 400); channelType[tempNum] = (ushort)(tempNum + 400);
channelVolumeUp[tempNum] = (ushort)(tempNum + 1000); channelVolumeUp[tempNum] = (ushort)(tempNum + 1000);
channelVolumeDown[tempNum] = (ushort)(tempNum + 1200); channelVolumeDown[tempNum] = (ushort)(tempNum + 1200);
} }
} }
} }
} }

View File

@@ -1,98 +1,98 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using Crestron.SimplSharp; using Crestron.SimplSharp;
using Newtonsoft.Json; using Newtonsoft.Json;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using PepperDash.Essentials.Core; using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Config; using PepperDash.Essentials.Core.Config;
using PepperDash.Essentials.DM; using PepperDash.Essentials.DM;
using PepperDash.Core; using PepperDash.Core;
using PepperDash.Essentials.Core.Routing; using PepperDash.Essentials.Core.Routing;
using Crestron.SimplSharpPro; using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.EthernetCommunication; using Crestron.SimplSharpPro.EthernetCommunication;
using Crestron.SimplSharpPro.DM; using Crestron.SimplSharpPro.DM;
namespace PepperDash.Essentials namespace PepperDash.Essentials
{ {
public class EssentialsTVOne : PepperDash.Core.Device public class EssentialsTVOne : PepperDash.Core.Device
{ {
public EssentialTVOneProperties Properties; public EssentialTVOneProperties Properties;
public List<BridgeApiEisc> BridgeApiEiscs; public List<BridgeApiEisc> BridgeApiEiscs;
private PepperDash.Essentials.Devices.Common.TVOneCorio TVOneCorio; private PepperDash.Essentials.Devices.Common.TVOneCorio TVOneCorio;
private EssentialsTVOneApiMap ApiMap = new EssentialsTVOneApiMap(); private EssentialsTVOneApiMap ApiMap = new EssentialsTVOneApiMap();
public EssentialsTVOne(string key, string name, JToken properties) public EssentialsTVOne(string key, string name, JToken properties)
: base(key, name) : base(key, name)
{ {
Properties = JsonConvert.DeserializeObject<EssentialTVOneProperties>(properties.ToString()); Properties = JsonConvert.DeserializeObject<EssentialTVOneProperties>(properties.ToString());
} }
public override bool CustomActivate() { public override bool CustomActivate() {
// Create EiscApis // Create EiscApis
try try
{ {
foreach (var device in DeviceManager.AllDevices) foreach (var device in DeviceManager.AllDevices)
{ {
if (device.Key == this.Properties.connectionDeviceKey) if (device.Key == this.Properties.connectionDeviceKey)
{ {
Debug.Console(2, "deviceKey {0} Matches", device.Key); Debug.Console(2, "deviceKey {0} Matches", device.Key);
TVOneCorio = DeviceManager.GetDeviceForKey(device.Key) as PepperDash.Essentials.Devices.Common.TVOneCorio; TVOneCorio = DeviceManager.GetDeviceForKey(device.Key) as PepperDash.Essentials.Devices.Common.TVOneCorio;
break; break;
} }
else else
{ {
Debug.Console(2, "deviceKey {0} doesn't match", device.Key); Debug.Console(2, "deviceKey {0} doesn't match", device.Key);
} }
} }
if (Properties.EiscApiIpids != null && TVOneCorio != null) if (Properties.EiscApiIpids != null && TVOneCorio != null)
{ {
foreach (string Ipid in Properties.EiscApiIpids) foreach (string Ipid in Properties.EiscApiIpids)
{ {
var ApiEisc = new BridgeApiEisc(Ipid); var ApiEisc = new BridgeApiEisc(Ipid);
Debug.Console(2, "Connecting EiscApi {0} to {1}", ApiEisc.Ipid, TVOneCorio.Name); Debug.Console(2, "Connecting EiscApi {0} to {1}", ApiEisc.Ipid, TVOneCorio.Name);
ushort x = 1; ushort x = 1;
TVOneCorio.OnlineFeedback.LinkInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.Online]); TVOneCorio.OnlineFeedback.LinkInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.Online]);
ApiEisc.Eisc.SetUShortSigAction(ApiMap.CallPreset, u => TVOneCorio.CallPreset(u)); ApiEisc.Eisc.SetUShortSigAction(ApiMap.CallPreset, u => TVOneCorio.CallPreset(u));
TVOneCorio.PresetFeedback.LinkInputSig(ApiEisc.Eisc.UShortInput[ApiMap.PresetFeedback]); TVOneCorio.PresetFeedback.LinkInputSig(ApiEisc.Eisc.UShortInput[ApiMap.PresetFeedback]);
} }
} }
Debug.Console(2, "Name {0} Activated", this.Name); Debug.Console(2, "Name {0} Activated", this.Name);
return true; return true;
} }
catch (Exception e) { catch (Exception e) {
Debug.Console(0, "Bridge {0}", e); Debug.Console(0, "Bridge {0}", e);
return false; return false;
} }
} }
} }
public class EssentialTVOneProperties public class EssentialTVOneProperties
{ {
public string connectionDeviceKey; public string connectionDeviceKey;
public string[] EiscApiIpids; public string[] EiscApiIpids;
} }
public class EssentialsTVOneApiMap public class EssentialsTVOneApiMap
{ {
public ushort CallPreset = 1; public ushort CallPreset = 1;
public ushort PresetFeedback = 1; public ushort PresetFeedback = 1;
public ushort Online = 1; public ushort Online = 1;
public EssentialsTVOneApiMap() public EssentialsTVOneApiMap()
{ {
} }
} }
} }

View File

@@ -1,74 +1,74 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using Crestron.SimplSharp; using Crestron.SimplSharp;
using Crestron.SimplSharpPro.DeviceSupport; using Crestron.SimplSharpPro.DeviceSupport;
using PepperDash.Core; using PepperDash.Core;
using PepperDash.Essentials.Core; using PepperDash.Essentials.Core;
using PepperDash.Essentials.Devices.Common; using PepperDash.Essentials.Devices.Common;
using Newtonsoft.Json; using Newtonsoft.Json;
namespace PepperDash.Essentials.Core.Bridges namespace PepperDash.Essentials.Core.Bridges
{ {
public static class GenericLightingApiExtensions public static class GenericLightingApiExtensions
{ {
public static void LinkToApi(this PepperDash.Essentials.Core.Lighting.LightingBase lightingDevice, BasicTriList trilist, uint joinStart, string joinMapKey) public static void LinkToApi(this PepperDash.Essentials.Core.Lighting.LightingBase lightingDevice, BasicTriList trilist, uint joinStart, string joinMapKey)
{ {
GenericLightingJoinMap joinMap = new GenericLightingJoinMap(); GenericLightingJoinMap joinMap = new GenericLightingJoinMap();
var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey); var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
if (!string.IsNullOrEmpty(joinMapSerialized)) if (!string.IsNullOrEmpty(joinMapSerialized))
joinMap = JsonConvert.DeserializeObject<GenericLightingJoinMap>(joinMapSerialized); joinMap = JsonConvert.DeserializeObject<GenericLightingJoinMap>(joinMapSerialized);
joinMap.OffsetJoinNumbers(joinStart); joinMap.OffsetJoinNumbers(joinStart);
Debug.Console(1, "Linking to Trilist '{0}'", trilist.ID.ToString("X")); Debug.Console(1, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
Debug.Console(0, "Linking to Lighting Type {0}", lightingDevice.GetType().Name.ToString()); Debug.Console(0, "Linking to Lighting Type {0}", lightingDevice.GetType().Name.ToString());
// GenericLighitng Actions & FeedBack // GenericLighitng Actions & FeedBack
trilist.SetUShortSigAction(joinMap.SelectScene, u => lightingDevice.SelectScene(lightingDevice.LightingScenes[u])); trilist.SetUShortSigAction(joinMap.SelectScene, u => lightingDevice.SelectScene(lightingDevice.LightingScenes[u]));
int sceneIndex = 1; int sceneIndex = 1;
foreach (var scene in lightingDevice.LightingScenes) foreach (var scene in lightingDevice.LightingScenes)
{ {
var tempIndex = sceneIndex - 1; var tempIndex = sceneIndex - 1;
trilist.SetSigTrueAction((uint)(joinMap.LightingSceneOffset + sceneIndex), () => lightingDevice.SelectScene(lightingDevice.LightingScenes[tempIndex])); trilist.SetSigTrueAction((uint)(joinMap.LightingSceneOffset + sceneIndex), () => lightingDevice.SelectScene(lightingDevice.LightingScenes[tempIndex]));
scene.IsActiveFeedback.LinkInputSig(trilist.BooleanInput[(uint)(joinMap.LightingSceneOffset + sceneIndex)]); scene.IsActiveFeedback.LinkInputSig(trilist.BooleanInput[(uint)(joinMap.LightingSceneOffset + sceneIndex)]);
trilist.StringInput[(uint)(joinMap.LightingSceneOffset + sceneIndex)].StringValue = scene.Name; trilist.StringInput[(uint)(joinMap.LightingSceneOffset + sceneIndex)].StringValue = scene.Name;
trilist.BooleanInput[(uint)(joinMap.ButtonVisibilityOffset + sceneIndex)].BoolValue = true; trilist.BooleanInput[(uint)(joinMap.ButtonVisibilityOffset + sceneIndex)].BoolValue = true;
sceneIndex++; sceneIndex++;
} }
if (lightingDevice.GetType().Name.ToString() == "LutronQuantumArea") if (lightingDevice.GetType().Name.ToString() == "LutronQuantumArea")
{ {
var lutronDevice = lightingDevice as PepperDash.Essentials.Devices.Common.Environment.Lutron.LutronQuantumArea; var lutronDevice = lightingDevice as PepperDash.Essentials.Devices.Common.Environment.Lutron.LutronQuantumArea;
lutronDevice.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]); lutronDevice.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
trilist.SetStringSigAction(joinMap.IntegrationIdSet, s => lutronDevice.IntegrationId = s); trilist.SetStringSigAction(joinMap.IntegrationIdSet, s => lutronDevice.IntegrationId = s);
} }
//ApiEisc.Eisc.SetStringSigAction(ApiMap.integrationID, (s) => { lutronLights.IntegrationId = s; }); //ApiEisc.Eisc.SetStringSigAction(ApiMap.integrationID, (s) => { lutronLights.IntegrationId = s; });
/* /*
var lutronLights = lightingDevice as PepperDash.Essentials.Devices.Common.Environment.Lutron.LutronQuantumArea; var lutronLights = lightingDevice as PepperDash.Essentials.Devices.Common.Environment.Lutron.LutronQuantumArea;
for (uint i = 1; i <= lightingBase.CircuitCount; i++) for (uint i = 1; i <= lightingBase.CircuitCount; i++)
{ {
var circuit = i; var circuit = i;
lightingBase.CircuitNameFeedbacks[circuit - 1].LinkInputSig(trilist.StringInput[joinMap.CircuitNames + circuit]); lightingBase.CircuitNameFeedbacks[circuit - 1].LinkInputSig(trilist.StringInput[joinMap.CircuitNames + circuit]);
lightingBase.CircuitIsCritical[circuit - 1].LinkInputSig(trilist.BooleanInput[joinMap.CircuitIsCritical + circuit]); lightingBase.CircuitIsCritical[circuit - 1].LinkInputSig(trilist.BooleanInput[joinMap.CircuitIsCritical + circuit]);
lightingBase.CircuitState[circuit - 1].LinkInputSig(trilist.BooleanInput[joinMap.CircuitState + circuit]); lightingBase.CircuitState[circuit - 1].LinkInputSig(trilist.BooleanInput[joinMap.CircuitState + circuit]);
trilist.SetSigTrueAction(joinMap.CircuitCycle + circuit, () => lightingBase.CycleCircuit(circuit - 1)); trilist.SetSigTrueAction(joinMap.CircuitCycle + circuit, () => lightingBase.CycleCircuit(circuit - 1));
trilist.SetSigTrueAction(joinMap.CircuitOnCmd + circuit, () => lightingBase.TurnOnCircuit(circuit - 1)); trilist.SetSigTrueAction(joinMap.CircuitOnCmd + circuit, () => lightingBase.TurnOnCircuit(circuit - 1));
trilist.SetSigTrueAction(joinMap.CircuitOffCmd + circuit, () => lightingBase.TurnOffCircuit(circuit - 1)); trilist.SetSigTrueAction(joinMap.CircuitOffCmd + circuit, () => lightingBase.TurnOffCircuit(circuit - 1));
} }
*/ */
} }
} }
} }

View File

@@ -1,125 +1,125 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using Crestron.SimplSharp; using Crestron.SimplSharp;
using Crestron.SimplSharpPro.DeviceSupport; using Crestron.SimplSharpPro.DeviceSupport;
using PepperDash.Essentials.Devices.Common.Occupancy; using PepperDash.Essentials.Devices.Common.Occupancy;
using PepperDash.Essentials.Core; using PepperDash.Essentials.Core;
using PepperDash.Core; using PepperDash.Core;
using Newtonsoft.Json; using Newtonsoft.Json;
namespace PepperDash.Essentials.Core.Bridges namespace PepperDash.Essentials.Core.Bridges
{ {
public static class GlsOccupancySensorBaseControllerApiExtensions public static class GlsOccupancySensorBaseControllerApiExtensions
{ {
public static void LinkToApi(this GlsOccupancySensorBaseController occController, BasicTriList trilist, uint joinStart, string joinMapKey) public static void LinkToApi(this GlsOccupancySensorBaseController occController, BasicTriList trilist, uint joinStart, string joinMapKey)
{ {
GlsOccupancySensorBaseJoinMap joinMap = new GlsOccupancySensorBaseJoinMap(); GlsOccupancySensorBaseJoinMap joinMap = new GlsOccupancySensorBaseJoinMap();
var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey); var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
if (!string.IsNullOrEmpty(joinMapSerialized)) if (!string.IsNullOrEmpty(joinMapSerialized))
joinMap = JsonConvert.DeserializeObject<GlsOccupancySensorBaseJoinMap>(joinMapSerialized); joinMap = JsonConvert.DeserializeObject<GlsOccupancySensorBaseJoinMap>(joinMapSerialized);
joinMap.OffsetJoinNumbers(joinStart); joinMap.OffsetJoinNumbers(joinStart);
Debug.Console(1, occController, "Linking to Trilist '{0}'", trilist.ID.ToString("X")); Debug.Console(1, occController, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
#region Single and Dual Sensor Stuff #region Single and Dual Sensor Stuff
occController.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]); occController.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
trilist.StringInput[joinMap.Name].StringValue = occController.Name; trilist.StringInput[joinMap.Name].StringValue = occController.Name;
trilist.OnlineStatusChange += new Crestron.SimplSharpPro.OnlineStatusChangeEventHandler((d, args) => trilist.OnlineStatusChange += new Crestron.SimplSharpPro.OnlineStatusChangeEventHandler((d, args) =>
{ {
if (args.DeviceOnLine) if (args.DeviceOnLine)
{ {
trilist.StringInput[joinMap.Name].StringValue = occController.Name; trilist.StringInput[joinMap.Name].StringValue = occController.Name;
} }
} }
); );
// Occupied status // Occupied status
trilist.SetSigTrueAction(joinMap.ForceOccupied, new Action(() => occController.ForceOccupied())); trilist.SetSigTrueAction(joinMap.ForceOccupied, new Action(() => occController.ForceOccupied()));
trilist.SetSigTrueAction(joinMap.ForceVacant, new Action(() => occController.ForceVacant())); trilist.SetSigTrueAction(joinMap.ForceVacant, new Action(() => occController.ForceVacant()));
occController.RoomIsOccupiedFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RoomOccupiedFeedback]); occController.RoomIsOccupiedFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RoomOccupiedFeedback]);
occController.RoomIsOccupiedFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.RoomVacantFeedback]); occController.RoomIsOccupiedFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.RoomVacantFeedback]);
occController.RawOccupancyFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RawOccupancyFeedback]); occController.RawOccupancyFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RawOccupancyFeedback]);
trilist.SetBoolSigAction(joinMap.EnableRawStates, new Action<bool>((b) => occController.EnableRawStates(b))); trilist.SetBoolSigAction(joinMap.EnableRawStates, new Action<bool>((b) => occController.EnableRawStates(b)));
// Timouts // Timouts
trilist.SetUShortSigAction(joinMap.Timeout, new Action<ushort>((u) => occController.SetRemoteTimeout(u))); trilist.SetUShortSigAction(joinMap.Timeout, new Action<ushort>((u) => occController.SetRemoteTimeout(u)));
occController.CurrentTimeoutFeedback.LinkInputSig(trilist.UShortInput[joinMap.Timeout]); occController.CurrentTimeoutFeedback.LinkInputSig(trilist.UShortInput[joinMap.Timeout]);
occController.LocalTimoutFeedback.LinkInputSig(trilist.UShortInput[joinMap.TimeoutLocalFeedback]); occController.LocalTimoutFeedback.LinkInputSig(trilist.UShortInput[joinMap.TimeoutLocalFeedback]);
// LED Flash // LED Flash
trilist.SetSigTrueAction(joinMap.EnableLedFlash, new Action(() => occController.SetLedFlashEnable(true))); trilist.SetSigTrueAction(joinMap.EnableLedFlash, new Action(() => occController.SetLedFlashEnable(true)));
trilist.SetSigTrueAction(joinMap.DisableLedFlash, new Action(() => occController.SetLedFlashEnable(false))); trilist.SetSigTrueAction(joinMap.DisableLedFlash, new Action(() => occController.SetLedFlashEnable(false)));
occController.LedFlashEnabledFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.EnableLedFlash]); occController.LedFlashEnabledFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.EnableLedFlash]);
// Short Timeout // Short Timeout
trilist.SetSigTrueAction(joinMap.EnableShortTimeout, new Action(() => occController.SetShortTimeoutState(true))); trilist.SetSigTrueAction(joinMap.EnableShortTimeout, new Action(() => occController.SetShortTimeoutState(true)));
trilist.SetSigTrueAction(joinMap.DisableShortTimeout, new Action(() => occController.SetShortTimeoutState(false))); trilist.SetSigTrueAction(joinMap.DisableShortTimeout, new Action(() => occController.SetShortTimeoutState(false)));
occController.ShortTimeoutEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.EnableShortTimeout]); occController.ShortTimeoutEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.EnableShortTimeout]);
// PIR Sensor // PIR Sensor
trilist.SetSigTrueAction(joinMap.EnablePir, new Action(() => occController.SetPirEnable(true))); trilist.SetSigTrueAction(joinMap.EnablePir, new Action(() => occController.SetPirEnable(true)));
trilist.SetSigTrueAction(joinMap.DisablePir, new Action(() => occController.SetPirEnable(false))); trilist.SetSigTrueAction(joinMap.DisablePir, new Action(() => occController.SetPirEnable(false)));
occController.PirSensorEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.EnablePir]); occController.PirSensorEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.EnablePir]);
// PIR Sensitivity in Occupied State // PIR Sensitivity in Occupied State
trilist.SetBoolSigAction(joinMap.IncrementPirInOccupiedState, new Action<bool>((b) => occController.IncrementPirSensitivityInOccupiedState(b))); trilist.SetBoolSigAction(joinMap.IncrementPirInOccupiedState, new Action<bool>((b) => occController.IncrementPirSensitivityInOccupiedState(b)));
trilist.SetBoolSigAction(joinMap.DecrementPirInOccupiedState, new Action<bool>((b) => occController.DecrementPirSensitivityInOccupiedState(b))); trilist.SetBoolSigAction(joinMap.DecrementPirInOccupiedState, new Action<bool>((b) => occController.DecrementPirSensitivityInOccupiedState(b)));
occController.PirSensitivityInOccupiedStateFeedback.LinkInputSig(trilist.UShortInput[joinMap.PirSensitivityInOccupiedState]); occController.PirSensitivityInOccupiedStateFeedback.LinkInputSig(trilist.UShortInput[joinMap.PirSensitivityInOccupiedState]);
// PIR Sensitivity in Vacant State // PIR Sensitivity in Vacant State
trilist.SetBoolSigAction(joinMap.IncrementPirInVacantState, new Action<bool>((b) => occController.IncrementPirSensitivityInVacantState(b))); trilist.SetBoolSigAction(joinMap.IncrementPirInVacantState, new Action<bool>((b) => occController.IncrementPirSensitivityInVacantState(b)));
trilist.SetBoolSigAction(joinMap.DecrementPirInVacantState, new Action<bool>((b) => occController.DecrementPirSensitivityInVacantState(b))); trilist.SetBoolSigAction(joinMap.DecrementPirInVacantState, new Action<bool>((b) => occController.DecrementPirSensitivityInVacantState(b)));
occController.PirSensitivityInVacantStateFeedback.LinkInputSig(trilist.UShortInput[joinMap.PirSensitivityInVacantState]); occController.PirSensitivityInVacantStateFeedback.LinkInputSig(trilist.UShortInput[joinMap.PirSensitivityInVacantState]);
#endregion #endregion
#region Dual Technology Sensor Stuff #region Dual Technology Sensor Stuff
var odtOccController = occController as GlsOdtOccupancySensorController; var odtOccController = occController as GlsOdtOccupancySensorController;
if (odtOccController != null) if (odtOccController != null)
{ {
// OR When Vacated // OR When Vacated
trilist.SetBoolSigAction(joinMap.OrWhenVacated, new Action<bool>((b) => odtOccController.SetOrWhenVacatedState(b))); trilist.SetBoolSigAction(joinMap.OrWhenVacated, new Action<bool>((b) => odtOccController.SetOrWhenVacatedState(b)));
odtOccController.OrWhenVacatedFeedback.LinkInputSig(trilist.BooleanInput[joinMap.OrWhenVacated]); odtOccController.OrWhenVacatedFeedback.LinkInputSig(trilist.BooleanInput[joinMap.OrWhenVacated]);
// AND When Vacated // AND When Vacated
trilist.SetBoolSigAction(joinMap.AndWhenVacated, new Action<bool>((b) => odtOccController.SetAndWhenVacatedState(b))); trilist.SetBoolSigAction(joinMap.AndWhenVacated, new Action<bool>((b) => odtOccController.SetAndWhenVacatedState(b)));
odtOccController.AndWhenVacatedFeedback.LinkInputSig(trilist.BooleanInput[joinMap.AndWhenVacated]); odtOccController.AndWhenVacatedFeedback.LinkInputSig(trilist.BooleanInput[joinMap.AndWhenVacated]);
// Ultrasonic A Sensor // Ultrasonic A Sensor
trilist.SetSigTrueAction(joinMap.EnableUsA, new Action(() => odtOccController.SetUsAEnable(true))); trilist.SetSigTrueAction(joinMap.EnableUsA, new Action(() => odtOccController.SetUsAEnable(true)));
trilist.SetSigTrueAction(joinMap.DisableUsA, new Action(() => odtOccController.SetUsAEnable(false))); trilist.SetSigTrueAction(joinMap.DisableUsA, new Action(() => odtOccController.SetUsAEnable(false)));
odtOccController.UltrasonicAEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.EnableUsA]); odtOccController.UltrasonicAEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.EnableUsA]);
// Ultrasonic B Sensor // Ultrasonic B Sensor
trilist.SetSigTrueAction(joinMap.EnableUsB, new Action(() => odtOccController.SetUsBEnable(true))); trilist.SetSigTrueAction(joinMap.EnableUsB, new Action(() => odtOccController.SetUsBEnable(true)));
trilist.SetSigTrueAction(joinMap.DisableUsB, new Action(() => odtOccController.SetUsBEnable(false))); trilist.SetSigTrueAction(joinMap.DisableUsB, new Action(() => odtOccController.SetUsBEnable(false)));
odtOccController.UltrasonicAEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.EnableUsB]); odtOccController.UltrasonicAEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.EnableUsB]);
// US Sensitivity in Occupied State // US Sensitivity in Occupied State
trilist.SetBoolSigAction(joinMap.IncrementUsInOccupiedState, new Action<bool>((b) => odtOccController.IncrementUsSensitivityInOccupiedState(b))); trilist.SetBoolSigAction(joinMap.IncrementUsInOccupiedState, new Action<bool>((b) => odtOccController.IncrementUsSensitivityInOccupiedState(b)));
trilist.SetBoolSigAction(joinMap.DecrementUsInOccupiedState, new Action<bool>((b) => odtOccController.DecrementUsSensitivityInOccupiedState(b))); trilist.SetBoolSigAction(joinMap.DecrementUsInOccupiedState, new Action<bool>((b) => odtOccController.DecrementUsSensitivityInOccupiedState(b)));
odtOccController.UltrasonicSensitivityInOccupiedStateFeedback.LinkInputSig(trilist.UShortInput[joinMap.UsSensitivityInOccupiedState]); odtOccController.UltrasonicSensitivityInOccupiedStateFeedback.LinkInputSig(trilist.UShortInput[joinMap.UsSensitivityInOccupiedState]);
// US Sensitivity in Vacant State // US Sensitivity in Vacant State
trilist.SetBoolSigAction(joinMap.IncrementUsInVacantState, new Action<bool>((b) => odtOccController.IncrementUsSensitivityInVacantState(b))); trilist.SetBoolSigAction(joinMap.IncrementUsInVacantState, new Action<bool>((b) => odtOccController.IncrementUsSensitivityInVacantState(b)));
trilist.SetBoolSigAction(joinMap.DecrementUsInVacantState, new Action<bool>((b) => odtOccController.DecrementUsSensitivityInVacantState(b))); trilist.SetBoolSigAction(joinMap.DecrementUsInVacantState, new Action<bool>((b) => odtOccController.DecrementUsSensitivityInVacantState(b)));
odtOccController.UltrasonicSensitivityInVacantStateFeedback.LinkInputSig(trilist.UShortInput[joinMap.UsSensitivityInVacantState]); odtOccController.UltrasonicSensitivityInVacantStateFeedback.LinkInputSig(trilist.UShortInput[joinMap.UsSensitivityInVacantState]);
//Sensor Raw States //Sensor Raw States
odtOccController.RawOccupancyPirFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RawOccupancyPirFeedback]); odtOccController.RawOccupancyPirFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RawOccupancyPirFeedback]);
odtOccController.RawOccupancyUsFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RawOccupancyUsFeedback]); odtOccController.RawOccupancyUsFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RawOccupancyUsFeedback]);
} }
#endregion #endregion
} }
} }
} }

View File

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

View File

@@ -38,12 +38,12 @@ namespace PepperDash.Essentials.Bridges
/// Reports the EDID serial number value /// Reports the EDID serial number value
/// </summary> /// </summary>
public uint EdidSerialNumber { get; set; } public uint EdidSerialNumber { get; set; }
#endregion #endregion
#region Analogs #region Analogs
public uint AudioVideoSource { get; set; } public uint AudioVideoSource { get; set; }
#endregion #endregion
public DmRmcControllerJoinMap() public DmRmcControllerJoinMap()
{ {
// Digital // Digital
@@ -56,7 +56,7 @@ namespace PepperDash.Essentials.Bridges
EdidPrefferedTiming = 4; EdidPrefferedTiming = 4;
EdidSerialNumber = 5; EdidSerialNumber = 5;
//Analog //Analog
AudioVideoSource = 1; AudioVideoSource = 1;
} }
@@ -69,7 +69,7 @@ namespace PepperDash.Essentials.Bridges
EdidManufacturer = EdidManufacturer + joinOffset; EdidManufacturer = EdidManufacturer + joinOffset;
EdidName = EdidName + joinOffset; EdidName = EdidName + joinOffset;
EdidPrefferedTiming = EdidPrefferedTiming + joinOffset; EdidPrefferedTiming = EdidPrefferedTiming + joinOffset;
EdidSerialNumber = EdidSerialNumber + joinOffset; EdidSerialNumber = EdidSerialNumber + joinOffset;
AudioVideoSource = AudioVideoSource + joinOffset; AudioVideoSource = AudioVideoSource + joinOffset;
} }
} }

View File

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

View File

@@ -88,7 +88,7 @@
{ {
"name": "Wireless Video", "name": "Wireless Video",
"key": "wePresent-1", "key": "wePresent-1",
"type": "genericSource", "type": "wePresent",
"group": "genericSource", "group": "genericSource",
"uid": 9, "uid": 9,
"properties": { "properties": {

View File

@@ -114,7 +114,7 @@
{ {
"name": "Wireless Video", "name": "Wireless Video",
"key": "wePresent-1", "key": "wePresent-1",
"type": "genericSource", "type": "wePresent",
"properties": {}, "properties": {},
"group": "genericSource", "group": "genericSource",
"uid": 3 "uid": 3

View File

@@ -1,47 +1,47 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using Crestron.SimplSharp; using Crestron.SimplSharp;
using Crestron.SimplSharp.CrestronIO; using Crestron.SimplSharp.CrestronIO;
using Crestron.SimplSharpPro; using Crestron.SimplSharpPro;
using Crestron.SimplSharp.Reflection; using Crestron.SimplSharp.Reflection;
using Newtonsoft.Json; using Newtonsoft.Json;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using PepperDash.Core; using PepperDash.Core;
using PepperDash.Essentials.Core; using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Config; using PepperDash.Essentials.Core.Config;
namespace PepperDash.Essentials namespace PepperDash.Essentials
{ {
/// <summary> /// <summary>
/// Responsible for loading all of the device types for this library /// Responsible for loading all of the device types for this library
/// </summary> /// </summary>
public class DeviceFactory public class DeviceFactory
{ {
public DeviceFactory() public DeviceFactory()
{ {
var assy = Assembly.GetExecutingAssembly(); var assy = Assembly.GetExecutingAssembly();
PluginLoader.SetEssentialsAssembly(assy.GetName().Name, assy); PluginLoader.SetEssentialsAssembly(assy.GetName().Name, assy);
var types = assy.GetTypes().Where(ct => typeof(IDeviceFactory).IsAssignableFrom(ct) && !ct.IsInterface && !ct.IsAbstract); var types = assy.GetTypes().Where(ct => typeof(IDeviceFactory).IsAssignableFrom(ct) && !ct.IsInterface && !ct.IsAbstract);
if (types != null) if (types != null)
{ {
foreach (var type in types) foreach (var type in types)
{ {
try try
{ {
var factory = (IDeviceFactory)Crestron.SimplSharp.Reflection.Activator.CreateInstance(type); var factory = (IDeviceFactory)Crestron.SimplSharp.Reflection.Activator.CreateInstance(type);
factory.LoadTypeFactories(); factory.LoadTypeFactories();
} }
catch (Exception e) catch (Exception e)
{ {
Debug.Console(0, Debug.ErrorLogLevel.Error, "Unable to load type: '{1}' DeviceFactory: {0}", e, type.Name); Debug.Console(0, Debug.ErrorLogLevel.Error, "Unable to load type: '{1}' DeviceFactory: {0}", e, type.Name);
} }
} }
} }
} }
} }
} }

View File

@@ -1,358 +1,358 @@
using System; using System;
using System.Linq; using System.Linq;
using Crestron.SimplSharp; using Crestron.SimplSharp;
using Crestron.SimplSharpPro; using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.Fusion; using Crestron.SimplSharpPro.Fusion;
using PepperDash.Core; using PepperDash.Core;
using PepperDash.Essentials.Core; using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Config; using PepperDash.Essentials.Core.Config;
using PepperDash.Essentials.Core.Fusion; using PepperDash.Essentials.Core.Fusion;
namespace PepperDash.Essentials.Fusion namespace PepperDash.Essentials.Fusion
{ {
public class EssentialsHuddleVtc1FusionController : EssentialsHuddleSpaceFusionSystemControllerBase public class EssentialsHuddleVtc1FusionController : EssentialsHuddleSpaceFusionSystemControllerBase
{ {
BooleanSigData CodecIsInCall; BooleanSigData CodecIsInCall;
public EssentialsHuddleVtc1FusionController(IEssentialsHuddleVtc1Room room, uint ipId, string joinMapKey) public EssentialsHuddleVtc1FusionController(IEssentialsHuddleVtc1Room room, uint ipId, string joinMapKey)
: base(room, ipId, joinMapKey) : base(room, ipId, joinMapKey)
{ {
} }
/// <summary> /// <summary>
/// Called in base class constructor before RVI and GUID files are built /// Called in base class constructor before RVI and GUID files are built
/// </summary> /// </summary>
protected override void ExecuteCustomSteps() protected override void ExecuteCustomSteps()
{ {
SetUpCodec(); SetUpCodec();
} }
/// <summary> /// <summary>
/// Creates a static asset for the codec and maps the joins to the main room symbol /// Creates a static asset for the codec and maps the joins to the main room symbol
/// </summary> /// </summary>
void SetUpCodec() void SetUpCodec()
{ {
try try
{ {
var codec = (Room as IEssentialsHuddleVtc1Room).VideoCodec; var codec = (Room as IEssentialsHuddleVtc1Room).VideoCodec;
if (codec == null) if (codec == null)
{ {
Debug.Console(1, this, "Cannot link codec to Fusion because codec is null"); Debug.Console(1, this, "Cannot link codec to Fusion because codec is null");
return; return;
} }
codec.UsageTracker = new UsageTracking(codec); codec.UsageTracker = new UsageTracking(codec);
codec.UsageTracker.UsageIsTracked = true; codec.UsageTracker.UsageIsTracked = true;
codec.UsageTracker.DeviceUsageEnded += UsageTracker_DeviceUsageEnded; codec.UsageTracker.DeviceUsageEnded += UsageTracker_DeviceUsageEnded;
var codecPowerOnAction = new Action<bool>(b => { if (!b) codec.StandbyDeactivate(); }); var codecPowerOnAction = new Action<bool>(b => { if (!b) codec.StandbyDeactivate(); });
var codecPowerOffAction = new Action<bool>(b => { if (!b) codec.StandbyActivate(); }); var codecPowerOffAction = new Action<bool>(b => { if (!b) codec.StandbyActivate(); });
// Map FusionRoom Attributes: // Map FusionRoom Attributes:
// Codec volume // Codec volume
var codecVolume = FusionRoom.CreateOffsetUshortSig(JoinMap.VolumeFader1.JoinNumber, JoinMap.VolumeFader1.AttributeName, eSigIoMask.InputOutputSig); var codecVolume = FusionRoom.CreateOffsetUshortSig(JoinMap.VolumeFader1.JoinNumber, JoinMap.VolumeFader1.AttributeName, eSigIoMask.InputOutputSig);
codecVolume.OutputSig.UserObject = new Action<ushort>(b => (codec as IBasicVolumeWithFeedback).SetVolume(b)); codecVolume.OutputSig.UserObject = new Action<ushort>(b => (codec as IBasicVolumeWithFeedback).SetVolume(b));
(codec as IBasicVolumeWithFeedback).VolumeLevelFeedback.LinkInputSig(codecVolume.InputSig); (codec as IBasicVolumeWithFeedback).VolumeLevelFeedback.LinkInputSig(codecVolume.InputSig);
// In Call Status // In Call Status
CodecIsInCall = FusionRoom.CreateOffsetBoolSig(JoinMap.VcCodecInCall.JoinNumber, JoinMap.VcCodecInCall.AttributeName, eSigIoMask.InputSigOnly); CodecIsInCall = FusionRoom.CreateOffsetBoolSig(JoinMap.VcCodecInCall.JoinNumber, JoinMap.VcCodecInCall.AttributeName, eSigIoMask.InputSigOnly);
codec.CallStatusChange += new EventHandler<PepperDash.Essentials.Devices.Common.Codec.CodecCallStatusItemChangeEventArgs>(codec_CallStatusChange); codec.CallStatusChange += new EventHandler<PepperDash.Essentials.Devices.Common.Codec.CodecCallStatusItemChangeEventArgs>(codec_CallStatusChange);
// Online status // Online status
if (codec is ICommunicationMonitor) if (codec is ICommunicationMonitor)
{ {
var c = codec as ICommunicationMonitor; var c = codec as ICommunicationMonitor;
var codecOnline = FusionRoom.CreateOffsetBoolSig(JoinMap.VcCodecOnline.JoinNumber, JoinMap.VcCodecOnline.AttributeName, eSigIoMask.InputSigOnly); var codecOnline = FusionRoom.CreateOffsetBoolSig(JoinMap.VcCodecOnline.JoinNumber, JoinMap.VcCodecOnline.AttributeName, eSigIoMask.InputSigOnly);
codecOnline.InputSig.BoolValue = c.CommunicationMonitor.Status == MonitorStatus.IsOk; codecOnline.InputSig.BoolValue = c.CommunicationMonitor.Status == MonitorStatus.IsOk;
c.CommunicationMonitor.StatusChange += (o, a) => c.CommunicationMonitor.StatusChange += (o, a) =>
{ {
codecOnline.InputSig.BoolValue = a.Status == MonitorStatus.IsOk; codecOnline.InputSig.BoolValue = a.Status == MonitorStatus.IsOk;
}; };
Debug.Console(0, this, "Linking '{0}' communication monitor to Fusion '{1}'", codec.Key, JoinMap.VcCodecOnline.AttributeName); Debug.Console(0, this, "Linking '{0}' communication monitor to Fusion '{1}'", codec.Key, JoinMap.VcCodecOnline.AttributeName);
} }
// Codec IP Address // Codec IP Address
bool codecHasIpInfo = false; bool codecHasIpInfo = false;
var codecComm = codec.Communication; var codecComm = codec.Communication;
string codecIpAddress = string.Empty; string codecIpAddress = string.Empty;
int codecIpPort = 0; int codecIpPort = 0;
StringSigData codecIpAddressSig; StringSigData codecIpAddressSig;
StringSigData codecIpPortSig; StringSigData codecIpPortSig;
if(codecComm is GenericSshClient) if(codecComm is GenericSshClient)
{ {
codecIpAddress = (codecComm as GenericSshClient).Hostname; codecIpAddress = (codecComm as GenericSshClient).Hostname;
codecIpPort = (codecComm as GenericSshClient).Port; codecIpPort = (codecComm as GenericSshClient).Port;
codecHasIpInfo = true; codecHasIpInfo = true;
} }
else if (codecComm is GenericTcpIpClient) else if (codecComm is GenericTcpIpClient)
{ {
codecIpAddress = (codecComm as GenericTcpIpClient).Hostname; codecIpAddress = (codecComm as GenericTcpIpClient).Hostname;
codecIpPort = (codecComm as GenericTcpIpClient).Port; codecIpPort = (codecComm as GenericTcpIpClient).Port;
codecHasIpInfo = true; codecHasIpInfo = true;
} }
if (codecHasIpInfo) if (codecHasIpInfo)
{ {
codecIpAddressSig = FusionRoom.CreateOffsetStringSig(JoinMap.VcCodecIpAddress.JoinNumber, JoinMap.VcCodecIpAddress.AttributeName, eSigIoMask.InputSigOnly); codecIpAddressSig = FusionRoom.CreateOffsetStringSig(JoinMap.VcCodecIpAddress.JoinNumber, JoinMap.VcCodecIpAddress.AttributeName, eSigIoMask.InputSigOnly);
codecIpAddressSig.InputSig.StringValue = codecIpAddress; codecIpAddressSig.InputSig.StringValue = codecIpAddress;
codecIpPortSig = FusionRoom.CreateOffsetStringSig(JoinMap.VcCodecIpPort.JoinNumber, JoinMap.VcCodecIpPort.AttributeName, eSigIoMask.InputSigOnly); codecIpPortSig = FusionRoom.CreateOffsetStringSig(JoinMap.VcCodecIpPort.JoinNumber, JoinMap.VcCodecIpPort.AttributeName, eSigIoMask.InputSigOnly);
codecIpPortSig.InputSig.StringValue = codecIpPort.ToString(); codecIpPortSig.InputSig.StringValue = codecIpPort.ToString();
} }
var tempAsset = new FusionAsset(); var tempAsset = new FusionAsset();
var deviceConfig = ConfigReader.ConfigObject.Devices.FirstOrDefault(c => c.Key.Equals(codec.Key)); var deviceConfig = ConfigReader.ConfigObject.Devices.FirstOrDefault(c => c.Key.Equals(codec.Key));
if (FusionStaticAssets.ContainsKey(deviceConfig.Uid)) if (FusionStaticAssets.ContainsKey(deviceConfig.Uid))
{ {
tempAsset = FusionStaticAssets[deviceConfig.Uid]; tempAsset = FusionStaticAssets[deviceConfig.Uid];
} }
else else
{ {
// Create a new asset // Create a new asset
tempAsset = new FusionAsset(FusionRoomGuids.GetNextAvailableAssetNumber(FusionRoom), codec.Name, "Codec", ""); tempAsset = new FusionAsset(FusionRoomGuids.GetNextAvailableAssetNumber(FusionRoom), codec.Name, "Codec", "");
FusionStaticAssets.Add(deviceConfig.Uid, tempAsset); FusionStaticAssets.Add(deviceConfig.Uid, tempAsset);
} }
var codecAsset = FusionRoom.CreateStaticAsset(tempAsset.SlotNumber, tempAsset.Name, "Codec", tempAsset.InstanceId); var codecAsset = FusionRoom.CreateStaticAsset(tempAsset.SlotNumber, tempAsset.Name, "Codec", tempAsset.InstanceId);
codecAsset.PowerOn.OutputSig.UserObject = codecPowerOnAction; codecAsset.PowerOn.OutputSig.UserObject = codecPowerOnAction;
codecAsset.PowerOff.OutputSig.UserObject = codecPowerOffAction; codecAsset.PowerOff.OutputSig.UserObject = codecPowerOffAction;
codec.StandbyIsOnFeedback.LinkComplementInputSig(codecAsset.PowerOn.InputSig); codec.StandbyIsOnFeedback.LinkComplementInputSig(codecAsset.PowerOn.InputSig);
// TODO: Map relevant attributes on asset symbol // TODO: Map relevant attributes on asset symbol
codecAsset.TrySetMakeModel(codec); codecAsset.TrySetMakeModel(codec);
codecAsset.TryLinkAssetErrorToCommunication(codec); codecAsset.TryLinkAssetErrorToCommunication(codec);
} }
catch (Exception e) catch (Exception e)
{ {
Debug.Console(1, this, "Error setting up codec in Fusion: {0}", e); Debug.Console(1, this, "Error setting up codec in Fusion: {0}", e);
} }
} }
void codec_CallStatusChange(object sender, PepperDash.Essentials.Devices.Common.Codec.CodecCallStatusItemChangeEventArgs e) void codec_CallStatusChange(object sender, PepperDash.Essentials.Devices.Common.Codec.CodecCallStatusItemChangeEventArgs e)
{ {
var codec = (Room as IEssentialsHuddleVtc1Room).VideoCodec; var codec = (Room as IEssentialsHuddleVtc1Room).VideoCodec;
CodecIsInCall.InputSig.BoolValue = codec.IsInCall; CodecIsInCall.InputSig.BoolValue = codec.IsInCall;
} }
// These methods are overridden because they access the room class which is of a different type // These methods are overridden because they access the room class which is of a different type
protected override void CreateSymbolAndBasicSigs(uint ipId) protected override void CreateSymbolAndBasicSigs(uint ipId)
{ {
Debug.Console(0, this, "Creating Fusion Room symbol with GUID: {0} and IP-ID {1:X2}", RoomGuid, ipId); Debug.Console(0, this, "Creating Fusion Room symbol with GUID: {0} and IP-ID {1:X2}", RoomGuid, ipId);
FusionRoom = new FusionRoom(ipId, Global.ControlSystem, Room.Name, RoomGuid); FusionRoom = new FusionRoom(ipId, Global.ControlSystem, Room.Name, RoomGuid);
FusionRoom.ExtenderRoomViewSchedulingDataReservedSigs.Use(); FusionRoom.ExtenderRoomViewSchedulingDataReservedSigs.Use();
FusionRoom.ExtenderFusionRoomDataReservedSigs.Use(); FusionRoom.ExtenderFusionRoomDataReservedSigs.Use();
FusionRoom.Register(); FusionRoom.Register();
FusionRoom.FusionStateChange += FusionRoom_FusionStateChange; FusionRoom.FusionStateChange += FusionRoom_FusionStateChange;
FusionRoom.ExtenderRoomViewSchedulingDataReservedSigs.DeviceExtenderSigChange += FusionRoomSchedule_DeviceExtenderSigChange; FusionRoom.ExtenderRoomViewSchedulingDataReservedSigs.DeviceExtenderSigChange += FusionRoomSchedule_DeviceExtenderSigChange;
FusionRoom.ExtenderFusionRoomDataReservedSigs.DeviceExtenderSigChange += ExtenderFusionRoomDataReservedSigs_DeviceExtenderSigChange; FusionRoom.ExtenderFusionRoomDataReservedSigs.DeviceExtenderSigChange += ExtenderFusionRoomDataReservedSigs_DeviceExtenderSigChange;
FusionRoom.OnlineStatusChange += FusionRoom_OnlineStatusChange; FusionRoom.OnlineStatusChange += FusionRoom_OnlineStatusChange;
CrestronConsole.AddNewConsoleCommand(RequestFullRoomSchedule, "FusReqRoomSchedule", "Requests schedule of the room for the next 24 hours", ConsoleAccessLevelEnum.AccessOperator); CrestronConsole.AddNewConsoleCommand(RequestFullRoomSchedule, "FusReqRoomSchedule", "Requests schedule of the room for the next 24 hours", ConsoleAccessLevelEnum.AccessOperator);
CrestronConsole.AddNewConsoleCommand(ModifyMeetingEndTimeConsoleHelper, "FusReqRoomSchMod", "Ends or extends a meeting by the specified time", ConsoleAccessLevelEnum.AccessOperator); CrestronConsole.AddNewConsoleCommand(ModifyMeetingEndTimeConsoleHelper, "FusReqRoomSchMod", "Ends or extends a meeting by the specified time", ConsoleAccessLevelEnum.AccessOperator);
CrestronConsole.AddNewConsoleCommand(CreateAdHocMeeting, "FusCreateMeeting", "Creates and Ad Hoc meeting for on hour or until the next meeting", ConsoleAccessLevelEnum.AccessOperator); CrestronConsole.AddNewConsoleCommand(CreateAdHocMeeting, "FusCreateMeeting", "Creates and Ad Hoc meeting for on hour or until the next meeting", ConsoleAccessLevelEnum.AccessOperator);
// Room to fusion room // Room to fusion room
Room.OnFeedback.LinkInputSig(FusionRoom.SystemPowerOn.InputSig); Room.OnFeedback.LinkInputSig(FusionRoom.SystemPowerOn.InputSig);
// Moved to // Moved to
CurrentRoomSourceNameSig = FusionRoom.CreateOffsetStringSig(JoinMap.Display1CurrentSourceName.JoinNumber, JoinMap.Display1CurrentSourceName.AttributeName, eSigIoMask.InputSigOnly); CurrentRoomSourceNameSig = FusionRoom.CreateOffsetStringSig(JoinMap.Display1CurrentSourceName.JoinNumber, JoinMap.Display1CurrentSourceName.AttributeName, eSigIoMask.InputSigOnly);
// Don't think we need to get current status of this as nothing should be alive yet. // Don't think we need to get current status of this as nothing should be alive yet.
(Room as IEssentialsHuddleVtc1Room).CurrentSourceChange += Room_CurrentSourceInfoChange; (Room as IEssentialsHuddleVtc1Room).CurrentSourceChange += Room_CurrentSourceInfoChange;
FusionRoom.SystemPowerOn.OutputSig.SetSigFalseAction((Room as IEssentialsHuddleVtc1Room).PowerOnToDefaultOrLastSource); FusionRoom.SystemPowerOn.OutputSig.SetSigFalseAction((Room as IEssentialsHuddleVtc1Room).PowerOnToDefaultOrLastSource);
FusionRoom.SystemPowerOff.OutputSig.SetSigFalseAction(() => (Room as IEssentialsHuddleVtc1Room).RunRouteAction("roomOff", Room.SourceListKey)); FusionRoom.SystemPowerOff.OutputSig.SetSigFalseAction(() => (Room as IEssentialsHuddleVtc1Room).RunRouteAction("roomOff", Room.SourceListKey));
CrestronEnvironment.EthernetEventHandler += CrestronEnvironment_EthernetEventHandler; CrestronEnvironment.EthernetEventHandler += CrestronEnvironment_EthernetEventHandler;
} }
protected override void SetUpSources() protected override void SetUpSources()
{ {
// Sources // Sources
var dict = ConfigReader.ConfigObject.GetSourceListForKey((Room as IEssentialsHuddleVtc1Room).SourceListKey); var dict = ConfigReader.ConfigObject.GetSourceListForKey((Room as IEssentialsHuddleVtc1Room).SourceListKey);
if (dict != null) if (dict != null)
{ {
// NEW PROCESS: // NEW PROCESS:
// Make these lists and insert the fusion attributes by iterating these // Make these lists and insert the fusion attributes by iterating these
var setTopBoxes = dict.Where(d => d.Value.SourceDevice is ISetTopBoxControls); var setTopBoxes = dict.Where(d => d.Value.SourceDevice is ISetTopBoxControls);
uint i = 1; uint i = 1;
foreach (var kvp in setTopBoxes) foreach (var kvp in setTopBoxes)
{ {
TryAddRouteActionSigs(JoinMap.Display1DiscPlayerSourceStart.AttributeName + " " + i, JoinMap.Display1DiscPlayerSourceStart.JoinNumber + i, kvp.Key, kvp.Value.SourceDevice); TryAddRouteActionSigs(JoinMap.Display1DiscPlayerSourceStart.AttributeName + " " + i, JoinMap.Display1DiscPlayerSourceStart.JoinNumber + i, kvp.Key, kvp.Value.SourceDevice);
i++; i++;
if (i > JoinMap.Display1SetTopBoxSourceStart.JoinSpan) // We only have five spots if (i > JoinMap.Display1SetTopBoxSourceStart.JoinSpan) // We only have five spots
break; break;
} }
var discPlayers = dict.Where(d => d.Value.SourceDevice is IDiscPlayerControls); var discPlayers = dict.Where(d => d.Value.SourceDevice is IDiscPlayerControls);
i = 1; i = 1;
foreach (var kvp in discPlayers) foreach (var kvp in discPlayers)
{ {
TryAddRouteActionSigs(JoinMap.Display1DiscPlayerSourceStart.AttributeName + " " + i, JoinMap.Display1DiscPlayerSourceStart.JoinNumber + i, kvp.Key, kvp.Value.SourceDevice); TryAddRouteActionSigs(JoinMap.Display1DiscPlayerSourceStart.AttributeName + " " + i, JoinMap.Display1DiscPlayerSourceStart.JoinNumber + i, kvp.Key, kvp.Value.SourceDevice);
i++; i++;
if (i > 5) // We only have five spots if (i > 5) // We only have five spots
break; break;
} }
var laptops = dict.Where(d => d.Value.SourceDevice is Core.Devices.Laptop); var laptops = dict.Where(d => d.Value.SourceDevice is Core.Devices.Laptop);
i = 1; i = 1;
foreach (var kvp in laptops) foreach (var kvp in laptops)
{ {
TryAddRouteActionSigs(JoinMap.Display1LaptopSourceStart.AttributeName + " " + i, JoinMap.Display1LaptopSourceStart.JoinNumber + i, kvp.Key, kvp.Value.SourceDevice); TryAddRouteActionSigs(JoinMap.Display1LaptopSourceStart.AttributeName + " " + i, JoinMap.Display1LaptopSourceStart.JoinNumber + i, kvp.Key, kvp.Value.SourceDevice);
i++; i++;
if (i > JoinMap.Display1LaptopSourceStart.JoinSpan) // We only have ten spots??? if (i > JoinMap.Display1LaptopSourceStart.JoinSpan) // We only have ten spots???
break; break;
} }
foreach (var kvp in dict) foreach (var kvp in dict)
{ {
var usageDevice = kvp.Value.SourceDevice as IUsageTracking; var usageDevice = kvp.Value.SourceDevice as IUsageTracking;
if (usageDevice != null) if (usageDevice != null)
{ {
usageDevice.UsageTracker = new UsageTracking(usageDevice as Device); usageDevice.UsageTracker = new UsageTracking(usageDevice as Device);
usageDevice.UsageTracker.UsageIsTracked = true; usageDevice.UsageTracker.UsageIsTracked = true;
usageDevice.UsageTracker.DeviceUsageEnded += new EventHandler<DeviceUsageEventArgs>(UsageTracker_DeviceUsageEnded); usageDevice.UsageTracker.DeviceUsageEnded += new EventHandler<DeviceUsageEventArgs>(UsageTracker_DeviceUsageEnded);
} }
} }
} }
else else
{ {
Debug.Console(1, this, "WARNING: Config source list '{0}' not found for room '{1}'", Debug.Console(1, this, "WARNING: Config source list '{0}' not found for room '{1}'",
(Room as IEssentialsHuddleVtc1Room).SourceListKey, Room.Key); (Room as IEssentialsHuddleVtc1Room).SourceListKey, Room.Key);
} }
} }
protected override void SetUpDisplay() protected override void SetUpDisplay()
{ {
try try
{ {
//Setup Display Usage Monitoring //Setup Display Usage Monitoring
var displays = DeviceManager.AllDevices.Where(d => d is DisplayBase); var displays = DeviceManager.AllDevices.Where(d => d is DisplayBase);
// Consider updating this in multiple display systems // Consider updating this in multiple display systems
foreach (DisplayBase display in displays) foreach (DisplayBase display in displays)
{ {
display.UsageTracker = new UsageTracking(display); display.UsageTracker = new UsageTracking(display);
display.UsageTracker.UsageIsTracked = true; display.UsageTracker.UsageIsTracked = true;
display.UsageTracker.DeviceUsageEnded += new EventHandler<DeviceUsageEventArgs>(UsageTracker_DeviceUsageEnded); display.UsageTracker.DeviceUsageEnded += new EventHandler<DeviceUsageEventArgs>(UsageTracker_DeviceUsageEnded);
} }
var defaultDisplay = (Room as IEssentialsHuddleVtc1Room).DefaultDisplay as DisplayBase; var defaultDisplay = (Room as IEssentialsHuddleVtc1Room).DefaultDisplay as DisplayBase;
if (defaultDisplay == null) if (defaultDisplay == null)
{ {
Debug.Console(1, this, "Cannot link null display to Fusion because default display is null"); Debug.Console(1, this, "Cannot link null display to Fusion because default display is null");
return; return;
} }
var dispPowerOnAction = new Action<bool>(b => { if (!b) defaultDisplay.PowerOn(); }); var dispPowerOnAction = new Action<bool>(b => { if (!b) defaultDisplay.PowerOn(); });
var dispPowerOffAction = new Action<bool>(b => { if (!b) defaultDisplay.PowerOff(); }); var dispPowerOffAction = new Action<bool>(b => { if (!b) defaultDisplay.PowerOff(); });
// Display to fusion room sigs // Display to fusion room sigs
FusionRoom.DisplayPowerOn.OutputSig.UserObject = dispPowerOnAction; FusionRoom.DisplayPowerOn.OutputSig.UserObject = dispPowerOnAction;
FusionRoom.DisplayPowerOff.OutputSig.UserObject = dispPowerOffAction; FusionRoom.DisplayPowerOff.OutputSig.UserObject = dispPowerOffAction;
var defaultDisplayTwoWay = defaultDisplay as IHasPowerControlWithFeedback; var defaultDisplayTwoWay = defaultDisplay as IHasPowerControlWithFeedback;
if (defaultDisplayTwoWay != null) if (defaultDisplayTwoWay != null)
{ {
defaultDisplayTwoWay.PowerIsOnFeedback.LinkInputSig(FusionRoom.DisplayPowerOn.InputSig); defaultDisplayTwoWay.PowerIsOnFeedback.LinkInputSig(FusionRoom.DisplayPowerOn.InputSig);
} }
if (defaultDisplay is IDisplayUsage) if (defaultDisplay is IDisplayUsage)
(defaultDisplay as IDisplayUsage).LampHours.LinkInputSig(FusionRoom.DisplayUsage.InputSig); (defaultDisplay as IDisplayUsage).LampHours.LinkInputSig(FusionRoom.DisplayUsage.InputSig);
MapDisplayToRoomJoins(1, JoinMap.Display1Start.JoinNumber, defaultDisplay); MapDisplayToRoomJoins(1, JoinMap.Display1Start.JoinNumber, defaultDisplay);
var deviceConfig = ConfigReader.ConfigObject.Devices.FirstOrDefault(d => d.Key.Equals(defaultDisplay.Key)); var deviceConfig = ConfigReader.ConfigObject.Devices.FirstOrDefault(d => d.Key.Equals(defaultDisplay.Key));
//Check for existing asset in GUIDs collection //Check for existing asset in GUIDs collection
var tempAsset = new FusionAsset(); var tempAsset = new FusionAsset();
if (FusionStaticAssets.ContainsKey(deviceConfig.Uid)) if (FusionStaticAssets.ContainsKey(deviceConfig.Uid))
{ {
tempAsset = FusionStaticAssets[deviceConfig.Uid]; tempAsset = FusionStaticAssets[deviceConfig.Uid];
} }
else else
{ {
// Create a new asset // Create a new asset
tempAsset = new FusionAsset(FusionRoomGuids.GetNextAvailableAssetNumber(FusionRoom), defaultDisplay.Name, "Display", ""); tempAsset = new FusionAsset(FusionRoomGuids.GetNextAvailableAssetNumber(FusionRoom), defaultDisplay.Name, "Display", "");
FusionStaticAssets.Add(deviceConfig.Uid, tempAsset); FusionStaticAssets.Add(deviceConfig.Uid, tempAsset);
} }
var dispAsset = FusionRoom.CreateStaticAsset(tempAsset.SlotNumber, tempAsset.Name, "Display", tempAsset.InstanceId); var dispAsset = FusionRoom.CreateStaticAsset(tempAsset.SlotNumber, tempAsset.Name, "Display", tempAsset.InstanceId);
dispAsset.PowerOn.OutputSig.UserObject = dispPowerOnAction; dispAsset.PowerOn.OutputSig.UserObject = dispPowerOnAction;
dispAsset.PowerOff.OutputSig.UserObject = dispPowerOffAction; dispAsset.PowerOff.OutputSig.UserObject = dispPowerOffAction;
var defaultTwoWayDisplay = defaultDisplay as IHasPowerControlWithFeedback; var defaultTwoWayDisplay = defaultDisplay as IHasPowerControlWithFeedback;
if (defaultTwoWayDisplay != null) if (defaultTwoWayDisplay != null)
{ {
defaultTwoWayDisplay.PowerIsOnFeedback.LinkInputSig(FusionRoom.DisplayPowerOn.InputSig); defaultTwoWayDisplay.PowerIsOnFeedback.LinkInputSig(FusionRoom.DisplayPowerOn.InputSig);
if (defaultDisplay is IDisplayUsage) if (defaultDisplay is IDisplayUsage)
(defaultDisplay as IDisplayUsage).LampHours.LinkInputSig(FusionRoom.DisplayUsage.InputSig); (defaultDisplay as IDisplayUsage).LampHours.LinkInputSig(FusionRoom.DisplayUsage.InputSig);
defaultTwoWayDisplay.PowerIsOnFeedback.LinkInputSig(dispAsset.PowerOn.InputSig); defaultTwoWayDisplay.PowerIsOnFeedback.LinkInputSig(dispAsset.PowerOn.InputSig);
} }
// Use extension methods // Use extension methods
dispAsset.TrySetMakeModel(defaultDisplay); dispAsset.TrySetMakeModel(defaultDisplay);
dispAsset.TryLinkAssetErrorToCommunication(defaultDisplay); dispAsset.TryLinkAssetErrorToCommunication(defaultDisplay);
} }
catch (Exception e) catch (Exception e)
{ {
Debug.Console(1, this, "Error setting up display in Fusion: {0}", e); Debug.Console(1, this, "Error setting up display in Fusion: {0}", e);
} }
} }
protected override void MapDisplayToRoomJoins(int displayIndex, uint joinOffset, DisplayBase display) protected override void MapDisplayToRoomJoins(int displayIndex, uint joinOffset, DisplayBase display)
{ {
string displayName = string.Format("Display {0} - ", displayIndex); string displayName = string.Format("Display {0} - ", displayIndex);
if (display == (Room as IEssentialsHuddleVtc1Room).DefaultDisplay) if (display == (Room as IEssentialsHuddleVtc1Room).DefaultDisplay)
{ {
// Power on // Power on
var defaultDisplayPowerOn = FusionRoom.CreateOffsetBoolSig((uint)joinOffset, displayName + "Power On", eSigIoMask.InputOutputSig); var defaultDisplayPowerOn = FusionRoom.CreateOffsetBoolSig((uint)joinOffset, displayName + "Power On", eSigIoMask.InputOutputSig);
defaultDisplayPowerOn.OutputSig.UserObject = new Action<bool>(b => { if (!b) display.PowerOn(); }); defaultDisplayPowerOn.OutputSig.UserObject = new Action<bool>(b => { if (!b) display.PowerOn(); });
// Power Off // Power Off
var defaultDisplayPowerOff = FusionRoom.CreateOffsetBoolSig((uint)joinOffset + 1, displayName + "Power Off", eSigIoMask.InputOutputSig); var defaultDisplayPowerOff = FusionRoom.CreateOffsetBoolSig((uint)joinOffset + 1, displayName + "Power Off", eSigIoMask.InputOutputSig);
defaultDisplayPowerOn.OutputSig.UserObject = new Action<bool>(b => { if (!b) display.PowerOff(); }); ; defaultDisplayPowerOn.OutputSig.UserObject = new Action<bool>(b => { if (!b) display.PowerOff(); }); ;
var displayTwoWay = display as IHasPowerControlWithFeedback; var displayTwoWay = display as IHasPowerControlWithFeedback;
if (displayTwoWay != null) if (displayTwoWay != null)
{ {
displayTwoWay.PowerIsOnFeedback.LinkInputSig(defaultDisplayPowerOn.InputSig); displayTwoWay.PowerIsOnFeedback.LinkInputSig(defaultDisplayPowerOn.InputSig);
displayTwoWay.PowerIsOnFeedback.LinkInputSig(defaultDisplayPowerOn.InputSig); displayTwoWay.PowerIsOnFeedback.LinkInputSig(defaultDisplayPowerOn.InputSig);
} }
// Current Source // Current Source
var defaultDisplaySourceNone = FusionRoom.CreateOffsetBoolSig((uint)joinOffset + 8, displayName + "Source None", eSigIoMask.InputOutputSig); var defaultDisplaySourceNone = FusionRoom.CreateOffsetBoolSig((uint)joinOffset + 8, displayName + "Source None", eSigIoMask.InputOutputSig);
defaultDisplaySourceNone.OutputSig.UserObject = new Action<bool>(b => { if (!b) (Room as IEssentialsHuddleVtc1Room).RunRouteAction("roomOff", Room.SourceListKey); }); ; defaultDisplaySourceNone.OutputSig.UserObject = new Action<bool>(b => { if (!b) (Room as IEssentialsHuddleVtc1Room).RunRouteAction("roomOff", Room.SourceListKey); }); ;
} }
} }
} }
} }

View File

@@ -1,233 +1,232 @@
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Release</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Release</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion> <ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion> <SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{1BED5BA9-88C4-4365-9362-6F4B128071D3}</ProjectGuid> <ProjectGuid>{1BED5BA9-88C4-4365-9362-6F4B128071D3}</ProjectGuid>
<OutputType>Library</OutputType> <OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>PepperDashEssentials</RootNamespace> <RootNamespace>PepperDashEssentials</RootNamespace>
<AssemblyName>PepperDashEssentials</AssemblyName> <AssemblyName>PepperDashEssentials</AssemblyName>
<ProjectTypeGuids>{0B4745B0-194B-4BB6-8E21-E9057CA92230};{4D628B5B-2FBC-4AA6-8C16-197242AEB884};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> <ProjectTypeGuids>{0B4745B0-194B-4BB6-8E21-E9057CA92230};{4D628B5B-2FBC-4AA6-8C16-197242AEB884};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<PlatformFamilyName>WindowsCE</PlatformFamilyName> <PlatformFamilyName>WindowsCE</PlatformFamilyName>
<PlatformID>E2BECB1F-8C8C-41ba-B736-9BE7D946A398</PlatformID> <PlatformID>E2BECB1F-8C8C-41ba-B736-9BE7D946A398</PlatformID>
<OSVersion>5.0</OSVersion> <OSVersion>5.0</OSVersion>
<DeployDirSuffix>SmartDeviceProject1</DeployDirSuffix> <DeployDirSuffix>SmartDeviceProject1</DeployDirSuffix>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion> <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<NativePlatformName>Windows CE</NativePlatformName> <NativePlatformName>Windows CE</NativePlatformName>
<FormFactorID> <FormFactorID>
</FormFactorID> </FormFactorID>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<AllowedReferenceRelatedFileExtensions>.allowedReferenceRelatedFileExtensions</AllowedReferenceRelatedFileExtensions> <AllowedReferenceRelatedFileExtensions>.allowedReferenceRelatedFileExtensions</AllowedReferenceRelatedFileExtensions>
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType> <DebugType>full</DebugType>
<Optimize>false</Optimize> <Optimize>false</Optimize>
<OutputPath>bin\</OutputPath> <OutputPath>bin\</OutputPath>
<DefineConstants>DEBUG;TRACE;</DefineConstants> <DefineConstants>DEBUG;TRACE;</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<NoStdLib>true</NoStdLib> <NoStdLib>true</NoStdLib>
<NoConfig>true</NoConfig> <NoConfig>true</NoConfig>
<GenerateSerializationAssemblies>off</GenerateSerializationAssemblies> <GenerateSerializationAssemblies>off</GenerateSerializationAssemblies>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<AllowedReferenceRelatedFileExtensions>.allowedReferenceRelatedFileExtensions</AllowedReferenceRelatedFileExtensions> <AllowedReferenceRelatedFileExtensions>.allowedReferenceRelatedFileExtensions</AllowedReferenceRelatedFileExtensions>
<DebugType>none</DebugType> <DebugType>none</DebugType>
<Optimize>true</Optimize> <Optimize>true</Optimize>
<OutputPath>bin\</OutputPath> <OutputPath>bin\</OutputPath>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<NoStdLib>true</NoStdLib> <NoStdLib>true</NoStdLib>
<NoConfig>true</NoConfig> <NoConfig>true</NoConfig>
<GenerateSerializationAssemblies>off</GenerateSerializationAssemblies> <GenerateSerializationAssemblies>off</GenerateSerializationAssemblies>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Crestron.SimplSharpPro.DeviceSupport, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL"> <Reference Include="Crestron.SimplSharpPro.DeviceSupport, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.DeviceSupport.dll</HintPath> <HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.DeviceSupport.dll</HintPath>
</Reference> </Reference>
<Reference Include="Crestron.SimplSharpPro.DM, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL"> <Reference Include="Crestron.SimplSharpPro.DM, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.DM.dll</HintPath> <HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.DM.dll</HintPath>
</Reference> </Reference>
<Reference Include="Crestron.SimplSharpPro.EthernetCommunications, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL"> <Reference Include="Crestron.SimplSharpPro.EthernetCommunications, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.EthernetCommunications.dll</HintPath> <HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.EthernetCommunications.dll</HintPath>
</Reference> </Reference>
<Reference Include="Crestron.SimplSharpPro.Fusion, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL"> <Reference Include="Crestron.SimplSharpPro.Fusion, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.Fusion.dll</HintPath> <HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.Fusion.dll</HintPath>
</Reference> </Reference>
<Reference Include="Crestron.SimplSharpPro.Remotes, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL"> <Reference Include="Crestron.SimplSharpPro.Remotes, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.Remotes.dll</HintPath> <HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.Remotes.dll</HintPath>
</Reference> </Reference>
<Reference Include="Crestron.SimplSharpPro.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL"> <Reference Include="Crestron.SimplSharpPro.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.UI.dll</HintPath> <HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.UI.dll</HintPath>
</Reference> </Reference>
<Reference Include="mscorlib" /> <Reference Include="mscorlib" />
<Reference Include="PepperDash_Core, Version=1.3.3.32940, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="PepperDash_Core, Version=1.0.42.30563, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\packages\PepperDashCore\lib\net35\PepperDash_Core.dll</HintPath> <HintPath>..\packages\PepperDashCore\lib\net35\PepperDash_Core.dll</HintPath>
</Reference> </Reference>
<Reference Include="SimplSharpCustomAttributesInterface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL"> <Reference Include="SimplSharpCustomAttributesInterface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpCustomAttributesInterface.dll</HintPath> <HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpCustomAttributesInterface.dll</HintPath>
</Reference> </Reference>
<Reference Include="SimplSharpHelperInterface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL"> <Reference Include="SimplSharpHelperInterface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpHelperInterface.dll</HintPath> <HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpHelperInterface.dll</HintPath>
</Reference> </Reference>
<Reference Include="SimplSharpNewtonsoft, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL"> <Reference Include="SimplSharpNewtonsoft, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpNewtonsoft.dll</HintPath> <HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpNewtonsoft.dll</HintPath>
</Reference> </Reference>
<Reference Include="SimplSharpPro, Version=1.5.3.17, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL"> <Reference Include="SimplSharpPro, Version=1.5.3.17, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpPro.exe</HintPath> <HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpPro.exe</HintPath>
</Reference> </Reference>
<Reference Include="SimplSharpReflectionInterface, Version=1.0.5583.25238, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL"> <Reference Include="SimplSharpReflectionInterface, Version=1.0.5583.25238, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpReflectionInterface.dll</HintPath> <HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpReflectionInterface.dll</HintPath>
</Reference> </Reference>
<Reference Include="SimplSharpTimerEventInterface, Version=1.0.6197.20052, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL"> <Reference Include="SimplSharpTimerEventInterface, Version=1.0.6197.20052, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpTimerEventInterface.dll</HintPath> <HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpTimerEventInterface.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
<Reference Include="System.Data" /> <Reference Include="System.Data" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Audio\EssentialsVolumeLevelConfig.cs" /> <Compile Include="Audio\EssentialsVolumeLevelConfig.cs" />
<Compile Include="Bridges\EiscBridge.cs" /> <Compile Include="Bridges\EiscBridge.cs" />
<Compile Include="Bridges\JoinMaps\AirMediaControllerJoinMap.cs" /> <Compile Include="Bridges\JoinMaps\AirMediaControllerJoinMap.cs" />
<Compile Include="Bridges\JoinMaps\AppleTvJoinMap.cs" /> <Compile Include="Bridges\JoinMaps\AppleTvJoinMap.cs" />
<Compile Include="Bridges\BridgeFactory.cs" /> <Compile Include="Bridges\BridgeFactory.cs" />
<Compile Include="Bridges\JoinMaps\C2nRthsControllerJoinMap.cs" /> <Compile Include="Bridges\JoinMaps\C2nRthsControllerJoinMap.cs" />
<Compile Include="Bridges\JoinMaps\CameraControllerJoinMap.cs" /> <Compile Include="Bridges\JoinMaps\CameraControllerJoinMap.cs" />
<Compile Include="Bridges\JoinMaps\DigitalLoggerJoinMap.cs" /> <Compile Include="Bridges\JoinMaps\DigitalLoggerJoinMap.cs" />
<Compile Include="Bridges\JoinMaps\DisplayControllerJoinMap.cs" /> <Compile Include="Bridges\JoinMaps\DisplayControllerJoinMap.cs" />
<Compile Include="Bridges\JoinMaps\DmBladeChassisControllerJoinMap.cs" /> <Compile Include="Bridges\JoinMaps\DmBladeChassisControllerJoinMap.cs" />
<Compile Include="Bridges\JoinMaps\DmChassisControllerJoinMap.cs" /> <Compile Include="Bridges\JoinMaps\DmChassisControllerJoinMap.cs" />
<Compile Include="Bridges\JoinMaps\DmpsAudioOutputControllerJoinMap.cs" /> <Compile Include="Bridges\JoinMaps\DmpsAudioOutputControllerJoinMap.cs" />
<Compile Include="Bridges\JoinMaps\DmpsRoutingControllerJoinMap.cs" /> <Compile Include="Bridges\JoinMaps\DmpsRoutingControllerJoinMap.cs" />
<Compile Include="Bridges\JoinMaps\DmRmcControllerJoinMap.cs" /> <Compile Include="Bridges\JoinMaps\DmRmcControllerJoinMap.cs" />
<Compile Include="Bridges\JoinMaps\DmTxControllerJoinMap.cs" /> <Compile Include="Bridges\JoinMaps\DmTxControllerJoinMap.cs" />
<Compile Include="Bridges\JoinMaps\GenericLightingJoinMap.cs" /> <Compile Include="Bridges\JoinMaps\GenericLightingJoinMap.cs" />
<Compile Include="Bridges\JoinMaps\GenericRelayControllerJoinMap.cs" /> <Compile Include="Bridges\JoinMaps\GenericRelayControllerJoinMap.cs" />
<Compile Include="Bridges\JoinMaps\GlsOccupancySensorBaseJoinMap.cs" /> <Compile Include="Bridges\JoinMaps\GlsOccupancySensorBaseJoinMap.cs" />
<Compile Include="Bridges\JoinMaps\HdMdxxxCEControllerJoinMap.cs" /> <Compile Include="Bridges\JoinMaps\HdMdxxxCEControllerJoinMap.cs" />
<Compile Include="Bridges\JoinMaps\IBasicCommunicationJoinMap.cs" /> <Compile Include="Bridges\JoinMaps\IBasicCommunicationJoinMap.cs" />
<Compile Include="Bridges\IBridge.cs" /> <Compile Include="Bridges\IBridge.cs" />
<Compile Include="Bridges\JoinMaps\IDigitalInputJoinMap.cs" /> <Compile Include="Bridges\JoinMaps\IDigitalInputJoinMap.cs" />
<Compile Include="Bridges\JoinMaps\SetTopBoxControllerJoinMap.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="Factory\DeviceFactory.cs" /> <Compile Include="Factory\DeviceFactory.cs" />
<Compile Include="Devices\Amplifier.cs" /> <Compile Include="Devices\Amplifier.cs" />
<Compile Include="ControlSystem.cs" /> <Compile Include="ControlSystem.cs" />
<Compile Include="Fusion\EssentialsHuddleVtc1FusionController.cs" /> <Compile Include="Fusion\EssentialsHuddleVtc1FusionController.cs" />
<Compile Include="Fusion\EssentialsTechRoomFusionSystemController.cs" /> <Compile Include="Fusion\EssentialsTechRoomFusionSystemController.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Room\Config\EssentialsDualDisplayRoomPropertiesConfig.cs" /> <Compile Include="Room\Config\EssentialsDualDisplayRoomPropertiesConfig.cs" />
<Compile Include="Room\Config\EssentialsNDisplayRoomPropertiesConfig.cs" /> <Compile Include="Room\Config\EssentialsNDisplayRoomPropertiesConfig.cs" />
<Compile Include="Room\Config\SimplRoomPropertiesConfig.cs" /> <Compile Include="Room\Config\SimplRoomPropertiesConfig.cs" />
<Compile Include="Room\Config\EssentialsPresentationPropertiesConfig.cs" /> <Compile Include="Room\Config\EssentialsPresentationPropertiesConfig.cs" />
<Compile Include="Room\Config\EssentialsHuddleRoomPropertiesConfig.cs" /> <Compile Include="Room\Config\EssentialsHuddleRoomPropertiesConfig.cs" />
<Compile Include="Room\Config\EssentialsHuddleVtc1PropertiesConfig.cs" /> <Compile Include="Room\Config\EssentialsHuddleVtc1PropertiesConfig.cs" />
<Compile Include="Room\Config\EssentialsRoomEmergencyConfig.cs" /> <Compile Include="Room\Config\EssentialsRoomEmergencyConfig.cs" />
<Compile Include="Room\Config\EssentialsTechRoomConfig.cs" /> <Compile Include="Room\Config\EssentialsTechRoomConfig.cs" />
<Compile Include="Room\Emergency\EsentialsRoomEmergencyContactClosure.cs" /> <Compile Include="Room\Emergency\EsentialsRoomEmergencyContactClosure.cs" />
<Compile Include="Room\Types\EssentialsCombinedHuddleVtc1Room.cs" /> <Compile Include="Room\Types\EssentialsDualDisplayRoom.cs" />
<Compile Include="Room\Types\EssentialsDualDisplayRoom.cs" /> <Compile Include="Room\Types\EssentialsHuddleVtc1Room.cs" />
<Compile Include="Room\Types\EssentialsHuddleVtc1Room.cs" /> <Compile Include="Room\Types\EssentialsNDisplayRoomBase.cs" />
<Compile Include="Room\Types\EssentialsNDisplayRoomBase.cs" /> <Compile Include="Room\Config\EssentialsRoomConfig.cs" />
<Compile Include="Room\Config\EssentialsRoomConfig.cs" /> <Compile Include="Room\Types\EssentialsTechRoom.cs" />
<Compile Include="Room\Types\EssentialsTechRoom.cs" /> <Compile Include="Room\Types\Interfaces\IEssentialsHuddleSpaceRoom.cs" />
<Compile Include="Room\Types\Interfaces\IEssentialsHuddleSpaceRoom.cs" /> <Compile Include="Room\Types\Interfaces\IEssentialsHuddleVtc1Room.cs" />
<Compile Include="Room\Types\Interfaces\IEssentialsHuddleVtc1Room.cs" /> <Compile Include="UIDrivers\Environment Drivers\EssentialsEnvironmentDriver.cs" />
<Compile Include="UIDrivers\Environment Drivers\EssentialsEnvironmentDriver.cs" /> <Compile Include="UIDrivers\Environment Drivers\EssentialsLightingDriver.cs" />
<Compile Include="UIDrivers\Environment Drivers\EssentialsLightingDriver.cs" /> <Compile Include="UIDrivers\Environment Drivers\EssentialsShadeDriver.cs" />
<Compile Include="UIDrivers\Environment Drivers\EssentialsShadeDriver.cs" /> <Compile Include="UIDrivers\Essentials\EssentialsHeaderDriver.cs" />
<Compile Include="UIDrivers\Essentials\EssentialsHeaderDriver.cs" /> <Compile Include="UIDrivers\JoinedSigInterlock.cs" />
<Compile Include="UIDrivers\JoinedSigInterlock.cs" /> <Compile Include="UIDrivers\ScreenSaverController.cs" />
<Compile Include="UIDrivers\ScreenSaverController.cs" /> <Compile Include="UIDrivers\SigInterlock.cs" />
<Compile Include="UIDrivers\SigInterlock.cs" /> <Compile Include="UIDrivers\EssentialsHuddleVTC\EssentialsHuddlePresentationUiDriver.cs" />
<Compile Include="UIDrivers\EssentialsHuddleVTC\EssentialsHuddlePresentationUiDriver.cs" /> <Compile Include="UIDrivers\EssentialsHuddle\EssentialsHuddleTechPageDriver.cs" />
<Compile Include="UIDrivers\EssentialsHuddle\EssentialsHuddleTechPageDriver.cs" /> <Compile Include="UI\HttpLogoServer.cs" />
<Compile Include="UI\HttpLogoServer.cs" /> <Compile Include="UI\SmartObjectHeaderButtonList.cs" />
<Compile Include="UI\SmartObjectHeaderButtonList.cs" /> <Compile Include="UI\SubpageReferenceListCallStagingItem.cs" />
<Compile Include="UI\SubpageReferenceListCallStagingItem.cs" /> <Compile Include="UIDrivers\VC\EssentialsVideoCodecUiDriver.cs" />
<Compile Include="UIDrivers\VC\EssentialsVideoCodecUiDriver.cs" /> <Compile Include="UIDrivers\EssentialsHuddleVTC\EssentialsHuddleVtc1PanelAvFunctionsDriver.cs" />
<Compile Include="UIDrivers\EssentialsHuddleVTC\EssentialsHuddleVtc1PanelAvFunctionsDriver.cs" /> <Compile Include="UIDrivers\SourceChangeArgs.cs" />
<Compile Include="UIDrivers\SourceChangeArgs.cs" /> <Compile Include="UI\JoinConstants\UISmartObjectJoin.cs" />
<Compile Include="UI\JoinConstants\UISmartObjectJoin.cs" /> <Compile Include="UI\JoinConstants\UIStringlJoin.cs" />
<Compile Include="UI\JoinConstants\UIStringlJoin.cs" /> <Compile Include="UI\JoinConstants\UIUshortJoin.cs" />
<Compile Include="UI\JoinConstants\UIUshortJoin.cs" /> <Compile Include="UIDrivers\DualDisplayRouting.cs" />
<Compile Include="UIDrivers\DualDisplayRouting.cs" /> <Compile Include="UIDrivers\Essentials\EssentialsPresentationPanelAvFunctionsDriver.cs" />
<Compile Include="UIDrivers\Essentials\EssentialsPresentationPanelAvFunctionsDriver.cs" /> <Compile Include="UIDrivers\Page Drivers\SingleSubpageModalDriver.cs" />
<Compile Include="UIDrivers\Page Drivers\SingleSubpageModalDriver.cs" /> <Compile Include="UIDrivers\Essentials\EssentialsPanelMainInterfaceDriver.cs" />
<Compile Include="UIDrivers\Essentials\EssentialsPanelMainInterfaceDriver.cs" /> <Compile Include="UIDrivers\enums and base.cs" />
<Compile Include="UIDrivers\enums and base.cs" /> <Compile Include="UIDrivers\EssentialsHuddle\EssentialsHuddlePanelAvFunctionsDriver.cs" />
<Compile Include="UIDrivers\EssentialsHuddle\EssentialsHuddlePanelAvFunctionsDriver.cs" /> <Compile Include="UIDrivers\Page Drivers\SingleSubpageModalAndBackDriver.cs" />
<Compile Include="UIDrivers\Page Drivers\SingleSubpageModalAndBackDriver.cs" /> <Compile Include="UIDrivers\SmartObjectRoomsList.cs" />
<Compile Include="UIDrivers\SmartObjectRoomsList.cs" /> <Compile Include="UI\JoinConstants\UIBoolJoin.cs" />
<Compile Include="UI\JoinConstants\UIBoolJoin.cs" /> <Compile Include="UI\DualDisplaySourceSRLController.cs" />
<Compile Include="UI\DualDisplaySourceSRLController.cs" /> <Compile Include="UI\SubpageReferenceListActivityItem.cs" />
<Compile Include="UI\SubpageReferenceListActivityItem.cs" /> <Compile Include="Room\Types\EssentialsHuddleSpaceRoom.cs" />
<Compile Include="Room\Types\EssentialsHuddleSpaceRoom.cs" /> <Compile Include="UI\EssentialsTouchpanelController.cs" />
<Compile Include="UI\EssentialsTouchpanelController.cs" /> <Compile Include="UI\SubpageReferenceListSourceItem.cs" />
<Compile Include="UI\SubpageReferenceListSourceItem.cs" /> <None Include="app.config" />
<None Include="app.config" /> <EmbeddedResource Include="Example Configuration\EssentialsHuddleSpaceRoom\configurationFile-HuddleSpace-2-Source.json">
<EmbeddedResource Include="Example Configuration\EssentialsHuddleSpaceRoom\configurationFile-HuddleSpace-2-Source.json"> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
<CopyToOutputDirectory>Always</CopyToOutputDirectory> </EmbeddedResource>
</EmbeddedResource> <EmbeddedResource Include="Example Configuration\EssentialsHuddleVtc1Room\configurationFile-mockVideoCodec_din-ap3_-_dm4x1.json">
<EmbeddedResource Include="Example Configuration\EssentialsHuddleVtc1Room\configurationFile-mockVideoCodec_din-ap3_-_dm4x1.json"> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
<CopyToOutputDirectory>Always</CopyToOutputDirectory> </EmbeddedResource>
</EmbeddedResource> <EmbeddedResource Include="Example Configuration\SIMPLBridging\configurationFile-dmps3300c-avRouting.json">
<EmbeddedResource Include="Example Configuration\SIMPLBridging\configurationFile-dmps3300c-avRouting.json"> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
<CopyToOutputDirectory>Always</CopyToOutputDirectory> </EmbeddedResource>
</EmbeddedResource> <EmbeddedResource Include="Example Configuration\SIMPLBridging\SIMPLBridgeExample_configurationFile.json">
<EmbeddedResource Include="Example Configuration\SIMPLBridging\SIMPLBridgeExample_configurationFile.json"> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
<CopyToOutputDirectory>Always</CopyToOutputDirectory> </EmbeddedResource>
</EmbeddedResource> <None Include="Properties\ControlSystem.cfg" />
<None Include="Properties\ControlSystem.cfg" /> <EmbeddedResource Include="SGD\PepperDash Essentials iPad.sgd">
<EmbeddedResource Include="SGD\PepperDash Essentials iPad.sgd"> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
<CopyToOutputDirectory>Always</CopyToOutputDirectory> </EmbeddedResource>
</EmbeddedResource> <EmbeddedResource Include="SGD\PepperDash Essentials TSW-560.sgd">
<EmbeddedResource Include="SGD\PepperDash Essentials TSW-560.sgd"> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
<CopyToOutputDirectory>Always</CopyToOutputDirectory> </EmbeddedResource>
</EmbeddedResource> <EmbeddedResource Include="SGD\PepperDash Essentials TSW-760.sgd">
<EmbeddedResource Include="SGD\PepperDash Essentials TSW-760.sgd"> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
<CopyToOutputDirectory>Always</CopyToOutputDirectory> </EmbeddedResource>
</EmbeddedResource> </ItemGroup>
</ItemGroup> <ItemGroup>
<ItemGroup> <ProjectReference Include="..\essentials-framework\Essentials Core\PepperDashEssentialsBase\PepperDash_Essentials_Core.csproj">
<ProjectReference Include="..\essentials-framework\Essentials Core\PepperDashEssentialsBase\PepperDash_Essentials_Core.csproj"> <Project>{A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5}</Project>
<Project>{A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5}</Project> <Name>PepperDash_Essentials_Core</Name>
<Name>PepperDash_Essentials_Core</Name> </ProjectReference>
</ProjectReference> <ProjectReference Include="..\essentials-framework\Essentials Devices Common\Essentials Devices Common\Essentials Devices Common.csproj">
<ProjectReference Include="..\essentials-framework\Essentials Devices Common\Essentials Devices Common\Essentials Devices Common.csproj"> <Project>{892B761C-E479-44CE-BD74-243E9214AF13}</Project>
<Project>{892B761C-E479-44CE-BD74-243E9214AF13}</Project> <Name>Essentials Devices Common</Name>
<Name>Essentials Devices Common</Name> </ProjectReference>
</ProjectReference> <ProjectReference Include="..\essentials-framework\Essentials DM\Essentials_DM\PepperDash_Essentials_DM.csproj">
<ProjectReference Include="..\essentials-framework\Essentials DM\Essentials_DM\PepperDash_Essentials_DM.csproj"> <Project>{9199CE8A-0C9F-4952-8672-3EED798B284F}</Project>
<Project>{9199CE8A-0C9F-4952-8672-3EED798B284F}</Project> <Name>PepperDash_Essentials_DM</Name>
<Name>PepperDash_Essentials_DM</Name> </ProjectReference>
</ProjectReference> </ItemGroup>
</ItemGroup> <Import Project="$(MSBuildBinPath)\Microsoft.CompactFramework.CSharp.targets" />
<Import Project="$(MSBuildBinPath)\Microsoft.CompactFramework.CSharp.targets" /> <ProjectExtensions>
<ProjectExtensions> <VisualStudio>
<VisualStudio> </VisualStudio>
</VisualStudio> </ProjectExtensions>
</ProjectExtensions> <PropertyGroup>
<PropertyGroup> <PostBuildEvent>rem S# Pro preparation will execute after these operations</PostBuildEvent>
<PostBuildEvent>rem S# Pro preparation will execute after these operations</PostBuildEvent> </PropertyGroup>
</PropertyGroup>
</Project> </Project>

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<ControlSystem> <ControlSystem>
<Name>Test RMC3</Name> <Name>192.168.10.1</Name>
<Address>auto 192.168.1.40;username crestron</Address> <Address>auto 192.168.10.1</Address>
<ProgramSlot>Program01</ProgramSlot> <ProgramSlot>Program01</ProgramSlot>
<Storage>Internal Flash</Storage> <Storage>Internal Flash</Storage>
</ControlSystem> </ControlSystem>

View File

@@ -1,411 +1,365 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using Crestron.SimplSharp; using Crestron.SimplSharp;
using Newtonsoft.Json; using Newtonsoft.Json;
using PepperDash.Core; using PepperDash.Core;
using PepperDash.Essentials; using PepperDash.Essentials;
using PepperDash.Essentials.Core; using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Config; using PepperDash.Essentials.Core.Config;
namespace PepperDash.Essentials.Room.Config namespace PepperDash.Essentials.Room.Config
{ {
public class EssentialsRoomConfigHelper public class EssentialsRoomConfigHelper
{ {
/// <summary> /// <summary>
/// Returns a room object from this config data /// Returns a room object from this config data
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
public static IKeyed GetRoomObject(DeviceConfig roomConfig) public static Device GetRoomObject(DeviceConfig roomConfig)
{ {
var typeName = roomConfig.Type.ToLower(); var typeName = roomConfig.Type.ToLower();
switch (typeName) if (typeName == "huddle")
{ {
case "huddle" : return new EssentialsHuddleSpaceRoom(roomConfig);
{ }
return new EssentialsHuddleSpaceRoom(roomConfig); if (typeName == "huddlevtc1")
} {
case "huddlevtc1" : return new EssentialsHuddleVtc1Room(roomConfig);
{ }
return new EssentialsHuddleVtc1Room(roomConfig); if (typeName == "ddvc01bridge")
} {
case "ddvc01bridge" : return new Device(roomConfig.Key, roomConfig.Name); // placeholder device that does nothing.
{ }
return new Device(roomConfig.Key, roomConfig.Name); // placeholder device that does nothing. if (typeName == "dualdisplay")
} {
case "dualdisplay" : return new EssentialsDualDisplayRoom(roomConfig);
{ }
return new EssentialsDualDisplayRoom(roomConfig);
} return typeName != "techroom" ? null : new EssentialsTechRoom(roomConfig);
case "combinedhuddlevtc1" : }
{
return new EssentialsCombinedHuddleVtc1Room(roomConfig); /// <summary>
} /// Gets and operating, standalone emergegncy object that can be plugged into a room.
case "techroom" : /// Returns null if there is no emergency defined
{ /// </summary>
return new EssentialsTechRoom(roomConfig); public static EssentialsRoomEmergencyBase GetEmergency(EssentialsRoomPropertiesConfig props, IEssentialsRoom room)
} {
default : // This emergency
{ var emergency = props.Emergency;
return Core.DeviceFactory.GetDevice(roomConfig); if (emergency != null)
} {
} //switch on emergency type here. Right now only contact and shutdown
} var e = new EssentialsRoomEmergencyContactClosure(room.Key + "-emergency", props.Emergency, room);
DeviceManager.AddDevice(e);
/// <summary> }
/// Gets and operating, standalone emergegncy object that can be plugged into a room. return null;
/// Returns null if there is no emergency defined }
/// </summary>
public static EssentialsRoomEmergencyBase GetEmergency(EssentialsRoomPropertiesConfig props, IEssentialsRoom room) /// <summary>
{ ///
// This emergency /// </summary>
var emergency = props.Emergency; /// <param name="props"></param>
if (emergency != null) /// <param name="room"></param>
{ /// <returns></returns>
//switch on emergency type here. Right now only contact and shutdown public static Core.Privacy.MicrophonePrivacyController GetMicrophonePrivacy(
var e = new EssentialsRoomEmergencyContactClosure(room.Key + "-emergency", props.Emergency, room); EssentialsRoomPropertiesConfig props, IPrivacy room)
DeviceManager.AddDevice(e); {
} var microphonePrivacy = props.MicrophonePrivacy;
return null; if (microphonePrivacy == null)
} {
Debug.Console(0, "Cannot create microphone privacy with null properties");
/// <summary> return null;
/// }
/// </summary> // Get the MicrophonePrivacy device from the device manager
/// <param name="props"></param> var mP = (DeviceManager.GetDeviceForKey(props.MicrophonePrivacy.DeviceKey) as
/// <param name="room"></param> Core.Privacy.MicrophonePrivacyController);
/// <returns></returns> // Set this room as the IPrivacy device
public static Core.Privacy.MicrophonePrivacyController GetMicrophonePrivacy( if (mP == null)
EssentialsRoomPropertiesConfig props, IPrivacy room) {
{ Debug.Console(0, "ERROR: Selected device {0} is not MicrophonePrivacyController", props.MicrophonePrivacy.DeviceKey);
var microphonePrivacy = props.MicrophonePrivacy; return null;
if (microphonePrivacy == null) }
{ mP.SetPrivacyDevice(room);
Debug.Console(0, "Cannot create microphone privacy with null properties");
return null; var behaviour = props.MicrophonePrivacy.Behaviour.ToLower();
}
// Get the MicrophonePrivacy device from the device manager if (behaviour == null)
var mP = (DeviceManager.GetDeviceForKey(props.MicrophonePrivacy.DeviceKey) as {
Core.Privacy.MicrophonePrivacyController); Debug.Console(0, "WARNING: No behaviour defined for MicrophonePrivacyController");
// Set this room as the IPrivacy device return null;
if (mP == null) }
{ if (behaviour == "trackroomstate")
Debug.Console(0, "ERROR: Selected device {0} is not MicrophonePrivacyController", props.MicrophonePrivacy.DeviceKey); {
return null; // Tie LED enable to room power state
} var essRoom = room as IEssentialsRoom;
mP.SetPrivacyDevice(room); essRoom.OnFeedback.OutputChange += (o, a) =>
{
var behaviour = props.MicrophonePrivacy.Behaviour.ToLower(); if (essRoom.OnFeedback.BoolValue)
mP.EnableLeds = true;
if (behaviour == null) else
{ mP.EnableLeds = false;
Debug.Console(0, "WARNING: No behaviour defined for MicrophonePrivacyController"); };
return null;
} mP.EnableLeds = essRoom.OnFeedback.BoolValue;
if (behaviour == "trackroomstate") }
{ else if (behaviour == "trackcallstate")
// Tie LED enable to room power state {
var essRoom = room as IEssentialsRoom; // Tie LED enable to room power state
essRoom.OnFeedback.OutputChange += (o, a) => var inCallRoom = room as IHasInCallFeedback;
{ inCallRoom.InCallFeedback.OutputChange += (o, a) =>
if (essRoom.OnFeedback.BoolValue) {
mP.EnableLeds = true; if (inCallRoom.InCallFeedback.BoolValue)
else mP.EnableLeds = true;
mP.EnableLeds = false; else
}; mP.EnableLeds = false;
};
mP.EnableLeds = essRoom.OnFeedback.BoolValue;
} mP.EnableLeds = inCallRoom.InCallFeedback.BoolValue;
else if (behaviour == "trackcallstate") }
{
// Tie LED enable to room power state return mP;
var inCallRoom = room as IHasInCallFeedback; }
inCallRoom.InCallFeedback.OutputChange += (o, a) =>
{ }
if (inCallRoom.InCallFeedback.BoolValue)
mP.EnableLeds = true; /// <summary>
else ///
mP.EnableLeds = false; /// </summary>
}; public class EssentialsRoomPropertiesConfig
{
mP.EnableLeds = inCallRoom.InCallFeedback.BoolValue; [JsonProperty("addresses")]
} public EssentialsRoomAddressPropertiesConfig Addresses { get; set; }
return mP; [JsonProperty("description")]
} public string Description { get; set; }
} [JsonProperty("emergency")]
public EssentialsRoomEmergencyConfig Emergency { get; set; }
/// <summary>
/// [JsonProperty("help")]
/// </summary> public EssentialsHelpPropertiesConfig Help { get; set; }
public class EssentialsRoomPropertiesConfig
{ [JsonProperty("helpMessage")]
[JsonProperty("addresses")] public string HelpMessage { get; set; }
public EssentialsRoomAddressPropertiesConfig Addresses { get; set; }
[JsonProperty("environment")]
[JsonProperty("description")] public EssentialsEnvironmentPropertiesConfig Environment { get; set; }
public string Description { get; set; }
[JsonProperty("logo")]
[JsonProperty("emergency")] public EssentialsLogoPropertiesConfig LogoLight { get; set; }
public EssentialsRoomEmergencyConfig Emergency { get; set; }
[JsonProperty("logoDark")]
[JsonProperty("help")] public EssentialsLogoPropertiesConfig LogoDark { get; set; }
public EssentialsHelpPropertiesConfig Help { get; set; }
[JsonProperty("microphonePrivacy")]
[JsonProperty("helpMessage")] public EssentialsRoomMicrophonePrivacyConfig MicrophonePrivacy { get; set; }
public string HelpMessage { get; set; }
[JsonProperty("occupancy")]
/// <summary> public EssentialsRoomOccSensorConfig Occupancy { get; set; }
/// Read this value to get the help message. It checks for the old and new config format.
/// </summary> [JsonProperty("oneButtonMeeting")]
public string HelpMessageForDisplay public EssentialsOneButtonMeetingPropertiesConfig OneButtonMeeting { get; set; }
{
get [JsonProperty("shutdownVacancySeconds")]
{ public int ShutdownVacancySeconds { get; set; }
if(Help != null && !string.IsNullOrEmpty(Help.Message))
{ [JsonProperty("shutdownPromptSeconds")]
return Help.Message; public int ShutdownPromptSeconds { get; set; }
}
else [JsonProperty("tech")]
{ public EssentialsRoomTechConfig Tech { get; set; }
return HelpMessage;
} [JsonProperty("volumes")]
} public EssentialsRoomVolumesConfig Volumes { get; set; }
}
[JsonProperty("fusion")]
[JsonProperty("environment")] public EssentialsRoomFusionConfig Fusion { get; set; }
public EssentialsEnvironmentPropertiesConfig Environment { get; set; }
[JsonProperty("zeroVolumeWhenSwtichingVolumeDevices")]
[JsonProperty("logo")] public bool ZeroVolumeWhenSwtichingVolumeDevices { get; set; }
public EssentialsLogoPropertiesConfig LogoLight { get; set; }
public EssentialsRoomPropertiesConfig()
[JsonProperty("logoDark")] {
public EssentialsLogoPropertiesConfig LogoDark { get; set; } LogoLight = new EssentialsLogoPropertiesConfig();
LogoDark = new EssentialsLogoPropertiesConfig();
[JsonProperty("microphonePrivacy")] }
public EssentialsRoomMicrophonePrivacyConfig MicrophonePrivacy { get; set; } }
[JsonProperty("occupancy")] public class EssentialsAvRoomPropertiesConfig : EssentialsRoomPropertiesConfig
public EssentialsRoomOccSensorConfig Occupancy { get; set; } {
[JsonProperty("defaultAudioKey")]
[JsonProperty("oneButtonMeeting")] public string DefaultAudioKey { get; set; }
public EssentialsOneButtonMeetingPropertiesConfig OneButtonMeeting { get; set; } [JsonProperty("sourceListKey")]
public string SourceListKey { get; set; }
[JsonProperty("shutdownVacancySeconds")] [JsonProperty("destinationListKey")]
public int ShutdownVacancySeconds { get; set; } public string DestinationListKey { get; set; }
[JsonProperty("defaultSourceItem")]
[JsonProperty("shutdownPromptSeconds")] public string DefaultSourceItem { get; set; }
public int ShutdownPromptSeconds { get; set; } /// <summary>
/// Indicates if the room supports advanced sharing
[JsonProperty("tech")] /// </summary>
public EssentialsRoomTechConfig Tech { get; set; } [JsonProperty("supportsAdvancedSharing")]
public bool SupportsAdvancedSharing { get; set; }
[JsonProperty("volumes")] /// <summary>
public EssentialsRoomVolumesConfig Volumes { get; set; } /// Indicates if non-tech users can change the share mode
/// </summary>
[JsonProperty("fusion")] [JsonProperty("userCanChangeShareMode")]
public EssentialsRoomFusionConfig Fusion { get; set; } public bool UserCanChangeShareMode { get; set; }
}
[JsonProperty("essentialsRoomUiBehaviorConfig", NullValueHandling=NullValueHandling.Ignore)]
public EssentialsRoomUiBehaviorConfig UiBehavior { get; set; } public class EssentialsConferenceRoomPropertiesConfig : EssentialsAvRoomPropertiesConfig
{
[JsonProperty("zeroVolumeWhenSwtichingVolumeDevices")] [JsonProperty("videoCodecKey")]
public bool ZeroVolumeWhenSwtichingVolumeDevices { get; set; } public string VideoCodecKey { get; set; }
[JsonProperty("audioCodecKey")]
/// <summary> public string AudioCodecKey { get; set; }
/// Indicates if this room represents a combination of other rooms }
/// </summary>
[JsonProperty("isRoomCombinationScenario")] public class EssentialsEnvironmentPropertiesConfig
public bool IsRoomCombinationScenario { get; set; } {
public bool Enabled { get; set; }
public EssentialsRoomPropertiesConfig()
{ [JsonProperty("deviceKeys")]
LogoLight = new EssentialsLogoPropertiesConfig(); public List<string> DeviceKeys { get; set; }
LogoDark = new EssentialsLogoPropertiesConfig();
} public EssentialsEnvironmentPropertiesConfig()
} {
DeviceKeys = new List<string>();
public class EssentialsRoomUiBehaviorConfig }
{
[JsonProperty("disableActivityButtonsWhileWarmingCooling")] }
public bool DisableActivityButtonsWhileWarmingCooling { get; set; }
} public class EssentialsRoomFusionConfig
{
public class EssentialsAvRoomPropertiesConfig : EssentialsRoomPropertiesConfig public uint IpIdInt
{ {
[JsonProperty("defaultAudioKey")] get
public string DefaultAudioKey { get; set; } {
[JsonProperty("sourceListKey")] try
public string SourceListKey { get; set; } {
[JsonProperty("destinationListKey")] return Convert.ToUInt32(IpId, 16);
public string DestinationListKey { get; set; } }
[JsonProperty("defaultSourceItem")] catch (Exception)
public string DefaultSourceItem { get; set; } {
/// <summary> throw new FormatException(string.Format("ERROR:Unable to convert IP ID: {0} to hex. Error:\n{1}", IpId));
/// Indicates if the room supports advanced sharing }
/// </summary>
[JsonProperty("supportsAdvancedSharing")] }
public bool SupportsAdvancedSharing { get; set; } }
/// <summary>
/// Indicates if non-tech users can change the share mode [JsonProperty("ipId")]
/// </summary> public string IpId { get; set; }
[JsonProperty("userCanChangeShareMode")]
public bool UserCanChangeShareMode { get; set; } [JsonProperty("joinMapKey")]
} public string JoinMapKey { get; set; }
public class EssentialsConferenceRoomPropertiesConfig : EssentialsAvRoomPropertiesConfig }
{
[JsonProperty("videoCodecKey")] public class EssentialsRoomMicrophonePrivacyConfig
public string VideoCodecKey { get; set; } {
[JsonProperty("audioCodecKey")] [JsonProperty("deviceKey")]
public string AudioCodecKey { get; set; } public string DeviceKey { get; set; }
}
[JsonProperty("behaviour")]
public class EssentialsEnvironmentPropertiesConfig public string Behaviour { get; set; }
{ }
public bool Enabled { get; set; }
/// <summary>
[JsonProperty("deviceKeys")] /// Properties for the help text box
public List<string> DeviceKeys { get; set; } /// </summary>
public class EssentialsHelpPropertiesConfig
public EssentialsEnvironmentPropertiesConfig() {
{ [JsonProperty("message")]
DeviceKeys = new List<string>(); public string Message { get; set; }
}
[JsonProperty("showCallButton")]
} public bool ShowCallButton { get; set; }
public class EssentialsRoomFusionConfig /// <summary>
{ /// Defaults to "Call Help Desk"
public uint IpIdInt /// </summary>
{ [JsonProperty("callButtonText")]
get public string CallButtonText { get; set; }
{
try public EssentialsHelpPropertiesConfig()
{ {
return Convert.ToUInt32(IpId, 16); CallButtonText = "Call Help Desk";
} }
catch (Exception) }
{
throw new FormatException(string.Format("ERROR:Unable to convert IP ID: {0} to hex. Error:\n{1}", IpId)); /// <summary>
} ///
/// </summary>
} public class EssentialsOneButtonMeetingPropertiesConfig
} {
[JsonProperty("enable")]
[JsonProperty("ipId")] public bool Enable { get; set; }
public string IpId { get; set; } }
[JsonProperty("joinMapKey")] public class EssentialsRoomAddressPropertiesConfig
public string JoinMapKey { get; set; } {
[JsonProperty("phoneNumber")]
} public string PhoneNumber { get; set; }
public class EssentialsRoomMicrophonePrivacyConfig [JsonProperty("sipAddress")]
{ public string SipAddress { get; set; }
[JsonProperty("deviceKey")] }
public string DeviceKey { get; set; }
[JsonProperty("behaviour")] /// <summary>
public string Behaviour { get; set; } /// Properties for the room's logo on panels
} /// </summary>
public class EssentialsLogoPropertiesConfig
/// <summary> {
/// Properties for the help text box [JsonProperty("type")]
/// </summary> public string Type { get; set; }
public class EssentialsHelpPropertiesConfig
{ [JsonProperty("url")]
[JsonProperty("message")] public string Url { get; set; }
public string Message { get; set; } /// <summary>
/// Gets either the custom URL, a local-to-processor URL, or null if it's a default logo
[JsonProperty("showCallButton")] /// </summary>
public bool ShowCallButton { get; set; } public string GetLogoUrlLight()
{
/// <summary> if (Type == "url")
/// Defaults to "Call Help Desk" return Url;
/// </summary> if (Type == "system")
[JsonProperty("callButtonText")] return string.Format("http://{0}:8080/logo.png",
public string CallButtonText { get; set; } CrestronEthernetHelper.GetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_CURRENT_IP_ADDRESS, 0));
return null;
public EssentialsHelpPropertiesConfig() }
{
CallButtonText = "Call Help Desk"; public string GetLogoUrlDark()
} {
} if (Type == "url")
return Url;
/// <summary> if (Type == "system")
/// return string.Format("http://{0}:8080/logo-dark.png",
/// </summary> CrestronEthernetHelper.GetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_CURRENT_IP_ADDRESS, 0));
public class EssentialsOneButtonMeetingPropertiesConfig return null;
{ }
[JsonProperty("enable")] }
public bool Enable { get; set; }
} /// <summary>
/// Represents occupancy sensor(s) setup for a room
public class EssentialsRoomAddressPropertiesConfig /// </summary>
{ public class EssentialsRoomOccSensorConfig
[JsonProperty("phoneNumber")] {
public string PhoneNumber { get; set; } [JsonProperty("deviceKey")]
public string DeviceKey { get; set; }
[JsonProperty("sipAddress")]
public string SipAddress { get; set; } [JsonProperty("timeoutMinutes")]
} public int TimeoutMinutes { get; set; }
}
/// <summary> public class EssentialsRoomTechConfig
/// Properties for the room's logo on panels {
/// </summary> [JsonProperty("password")]
public class EssentialsLogoPropertiesConfig public string Password { get; set; }
{ }
[JsonProperty("type")]
public string Type { get; set; }
[JsonProperty("url")]
public string Url { get; set; }
/// <summary>
/// Gets either the custom URL, a local-to-processor URL, or null if it's a default logo
/// </summary>
public string GetLogoUrlLight()
{
if (Type == "url")
return Url;
if (Type == "system")
return string.Format("http://{0}:8080/logo.png",
CrestronEthernetHelper.GetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_CURRENT_IP_ADDRESS, 0));
return null;
}
public string GetLogoUrlDark()
{
if (Type == "url")
return Url;
if (Type == "system")
return string.Format("http://{0}:8080/logo-dark.png",
CrestronEthernetHelper.GetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_CURRENT_IP_ADDRESS, 0));
return null;
}
}
/// <summary>
/// Represents occupancy sensor(s) setup for a room
/// </summary>
public class EssentialsRoomOccSensorConfig
{
[JsonProperty("deviceKey")]
public string DeviceKey { get; set; }
[JsonProperty("timeoutMinutes")]
public int TimeoutMinutes { get; set; }
}
public class EssentialsRoomTechConfig
{
[JsonProperty("password")]
public string Password { get; set; }
}
} }

View File

@@ -56,9 +56,6 @@ namespace PepperDash.Essentials.Room.Config
[JsonProperty("mirroredTuners")] [JsonProperty("mirroredTuners")]
public Dictionary<uint, string> MirroredTuners { get; set; } public Dictionary<uint, string> MirroredTuners { get; set; }
[JsonProperty("helpMessage")]
public string HelpMessage { get; set; }
/// <summary> /// <summary>
/// Indicates the room /// Indicates the room
/// </summary> /// </summary>

View File

@@ -207,7 +207,7 @@ namespace PepperDash.Essentials
DefaultAudioDevice = DeviceManager.GetDeviceForKey(PropertiesConfig.DefaultAudioKey) as IBasicVolumeControls; DefaultAudioDevice = DeviceManager.GetDeviceForKey(PropertiesConfig.DefaultAudioKey) as IBasicVolumeControls;
InitializeRoom(); Initialize();
} }
catch (Exception e) catch (Exception e)
{ {
@@ -215,7 +215,7 @@ namespace PepperDash.Essentials
} }
} }
void InitializeRoom() void Initialize()
{ {
if (DefaultAudioDevice is IBasicVolumeControls) if (DefaultAudioDevice is IBasicVolumeControls)
DefaultVolumeControls = DefaultAudioDevice as IBasicVolumeControls; DefaultVolumeControls = DefaultAudioDevice as IBasicVolumeControls;

View File

@@ -19,7 +19,7 @@ namespace PepperDash.Essentials
{ {
public class EssentialsTechRoom : EssentialsRoomBase, ITvPresetsProvider, IBridgeAdvanced, IRunDirectRouteAction public class EssentialsTechRoom : EssentialsRoomBase, ITvPresetsProvider, IBridgeAdvanced, IRunDirectRouteAction
{ {
public EssentialsTechRoomConfig PropertiesConfig { get; private set; } private readonly EssentialsTechRoomConfig _config;
private readonly Dictionary<string, TwoWayDisplayBase> _displays; private readonly Dictionary<string, TwoWayDisplayBase> _displays;
private readonly DevicePresetsModel _tunerPresets; private readonly DevicePresetsModel _tunerPresets;
@@ -57,16 +57,16 @@ namespace PepperDash.Essentials
public EssentialsTechRoom(DeviceConfig config) : base(config) public EssentialsTechRoom(DeviceConfig config) : base(config)
{ {
PropertiesConfig = config.Properties.ToObject<EssentialsTechRoomConfig>(); _config = config.Properties.ToObject<EssentialsTechRoomConfig>();
_tunerPresets = new DevicePresetsModel(String.Format("{0}-presets", config.Key), PropertiesConfig.PresetsFileName); _tunerPresets = new DevicePresetsModel(String.Format("{0}-presets", config.Key), _config.PresetsFileName);
_tunerPresets.SetFileName(PropertiesConfig.PresetsFileName); _tunerPresets.SetFileName(_config.PresetsFileName);
_tunerPresets.PresetRecalled += TunerPresetsOnPresetRecalled; _tunerPresets.PresetRecalled += TunerPresetsOnPresetRecalled;
_tuners = GetDevices<IRSetTopBoxBase>(PropertiesConfig.Tuners); _tuners = GetDevices<IRSetTopBoxBase>(_config.Tuners);
_displays = GetDevices<TwoWayDisplayBase>(PropertiesConfig.Displays); _displays = GetDevices<TwoWayDisplayBase>(_config.Displays);
RoomPowerIsOnFeedback = new BoolFeedback(() => RoomPowerIsOn); RoomPowerIsOnFeedback = new BoolFeedback(() => RoomPowerIsOn);
@@ -153,7 +153,7 @@ namespace PepperDash.Essentials
private void CreateOrUpdateScheduledEvents() private void CreateOrUpdateScheduledEvents()
{ {
var eventsConfig = PropertiesConfig.ScheduledEvents; var eventsConfig = _config.ScheduledEvents;
GetOrCreateScheduleGroup(); GetOrCreateScheduleGroup();
@@ -207,21 +207,21 @@ namespace PepperDash.Essentials
{ {
//update config based on key of scheduleEvent //update config based on key of scheduleEvent
GetOrCreateScheduleGroup(); GetOrCreateScheduleGroup();
var existingEventIndex = PropertiesConfig.ScheduledEvents.FindIndex((e) => e.Key == scheduledEvent.Key); var existingEventIndex = _config.ScheduledEvents.FindIndex((e) => e.Key == scheduledEvent.Key);
if (existingEventIndex < 0) if (existingEventIndex < 0)
{ {
PropertiesConfig.ScheduledEvents.Add(scheduledEvent); _config.ScheduledEvents.Add(scheduledEvent);
} }
else else
{ {
PropertiesConfig.ScheduledEvents[existingEventIndex] = scheduledEvent; _config.ScheduledEvents[existingEventIndex] = scheduledEvent;
} }
//create or update event based on config //create or update event based on config
CreateOrUpdateSingleEvent(scheduledEvent); CreateOrUpdateSingleEvent(scheduledEvent);
//save config //save config
Config.Properties = JToken.FromObject(PropertiesConfig); Config.Properties = JToken.FromObject(_config);
CustomSetConfig(Config); CustomSetConfig(Config);
//Fire Event //Fire Event
@@ -230,7 +230,7 @@ namespace PepperDash.Essentials
public List<ScheduledEventConfig> GetScheduledEvents() public List<ScheduledEventConfig> GetScheduledEvents()
{ {
return PropertiesConfig.ScheduledEvents ?? new List<ScheduledEventConfig>(); return _config.ScheduledEvents ?? new List<ScheduledEventConfig>();
} }
private void OnScheduledEventUpdate() private void OnScheduledEventUpdate()
@@ -242,14 +242,14 @@ namespace PepperDash.Essentials
return; return;
} }
handler(this, new ScheduledEventEventArgs {ScheduledEvents = PropertiesConfig.ScheduledEvents}); handler(this, new ScheduledEventEventArgs {ScheduledEvents = _config.ScheduledEvents});
} }
public event EventHandler<ScheduledEventEventArgs> ScheduledEventsChanged; public event EventHandler<ScheduledEventEventArgs> ScheduledEventsChanged;
private void HandleScheduledEvent(ScheduledEvent schevent, ScheduledEventCommon.eCallbackReason type) private void HandleScheduledEvent(ScheduledEvent schevent, ScheduledEventCommon.eCallbackReason type)
{ {
var eventConfig = PropertiesConfig.ScheduledEvents.FirstOrDefault(e => e.Key == schevent.Name); var eventConfig = _config.ScheduledEvents.FirstOrDefault(e => e.Key == schevent.Name);
if (eventConfig == null) if (eventConfig == null)
{ {
@@ -272,7 +272,7 @@ namespace PepperDash.Essentials
{ {
Debug.Console(2, this, Debug.Console(2, this,
@"Attempting to run action: @"Attempting to run action:
Key: {0} DeviceKey: {0}
MethodName: {1} MethodName: {1}
Params: {2}" Params: {2}"
, a.DeviceKey, a.MethodName, a.Params); , a.DeviceKey, a.MethodName, a.Params);
@@ -286,11 +286,11 @@ Params: {2}"
{ {
Debug.Console(2, this, "Room Powering On"); Debug.Console(2, this, "Room Powering On");
var dummySource = DeviceManager.GetDeviceForKey(PropertiesConfig.DummySourceKey) as IRoutingOutputs; var dummySource = DeviceManager.GetDeviceForKey(_config.DummySourceKey) as IRoutingOutputs;
if (dummySource == null) if (dummySource == null)
{ {
Debug.Console(1, this, "Unable to get source with key: {0}", PropertiesConfig.DummySourceKey); Debug.Console(1, this, "Unable to get source with key: {0}", _config.DummySourceKey);
return; return;
} }
@@ -375,13 +375,13 @@ Params: {2}"
{ {
bridge.AddJoinMap(Key, joinMap); bridge.AddJoinMap(Key, joinMap);
} }
uint i;
if (PropertiesConfig.IsPrimary) if (_config.IsPrimary)
{ {
Debug.Console(1, this, "Linking Primary system Tuner Preset Mirroring"); Debug.Console(1, this, "Linking Primary system Tuner Preset Mirroring");
if (PropertiesConfig.MirroredTuners != null && PropertiesConfig.MirroredTuners.Count > 0) if (_config.MirroredTuners != null && _config.MirroredTuners.Count > 0)
{ {
foreach (var tuner in PropertiesConfig.MirroredTuners) foreach (var tuner in _config.MirroredTuners)
{ {
var f = CurrentPresetsFeedbacks[tuner.Value]; var f = CurrentPresetsFeedbacks[tuner.Value];
@@ -423,9 +423,9 @@ Params: {2}"
{ {
Debug.Console(1, this, "Linking Secondary system Tuner Preset Mirroring"); Debug.Console(1, this, "Linking Secondary system Tuner Preset Mirroring");
if (PropertiesConfig.MirroredTuners != null && PropertiesConfig.MirroredTuners.Count > 0) if (_config.MirroredTuners != null && _config.MirroredTuners.Count > 0)
{ {
foreach (var tuner in PropertiesConfig.MirroredTuners) foreach (var tuner in _config.MirroredTuners)
{ {
var t = _tuners[tuner.Value]; var t = _tuners[tuner.Value];

View File

@@ -7,8 +7,7 @@ using PepperDash.Essentials.Room.Config;
namespace PepperDash.Essentials namespace PepperDash.Essentials
{ {
public interface IEssentialsHuddleSpaceRoom : IEssentialsRoom, IHasCurrentSourceInfoChange, IRunRouteAction, IRunDefaultPresentRoute, IHasDefaultDisplay, IHasCurrentVolumeControls, IRoomOccupancy, public interface IEssentialsHuddleSpaceRoom : IEssentialsRoom, IHasCurrentSourceInfoChange, IRunRouteAction, IRunDefaultPresentRoute, IHasDefaultDisplay
IEmergency, IMicrophonePrivacy
{ {
bool ExcludeFromGlobalFunctions { get; } bool ExcludeFromGlobalFunctions { get; }

View File

@@ -8,13 +8,10 @@ using PepperDash.Essentials.Devices.Common.AudioCodec;
namespace PepperDash.Essentials namespace PepperDash.Essentials
{ {
public interface IEssentialsHuddleVtc1Room : IEssentialsRoom, IHasCurrentSourceInfoChange, public interface IEssentialsHuddleVtc1Room : IEssentialsRoom, IHasCurrentSourceInfoChange,
IPrivacy, IHasCurrentVolumeControls, IRunRouteAction, IRunDefaultCallRoute, IHasVideoCodec, IHasAudioCodec, IHasDefaultDisplay, IHasInCallFeedback, IPrivacy, IHasCurrentVolumeControls, IRunRouteAction, IRunDefaultCallRoute, IHasVideoCodec, IHasAudioCodec, IHasDefaultDisplay, IHasInCallFeedback
IRoomOccupancy, IEmergency, IMicrophonePrivacy
{ {
EssentialsHuddleVtc1PropertiesConfig PropertiesConfig { get; } EssentialsHuddleVtc1PropertiesConfig PropertiesConfig { get; }
bool ExcludeFromGlobalFunctions { get; }
void RunRouteAction(string routeKey); void RunRouteAction(string routeKey);
IHasScheduleAwareness ScheduleSource { get; } IHasScheduleAwareness ScheduleSource { get; }

Some files were not shown because too many files have changed in this diff Show More