diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
index c969d2a1..a1757593 100644
--- a/.github/ISSUE_TEMPLATE/bug_report.md
+++ b/.github/ISSUE_TEMPLATE/bug_report.md
@@ -7,6 +7,9 @@ assignees: ''
---
+**Was this bug identified in a specific build version?**
+Please note the build version where this bug was identified
+
**Describe the bug**
A clear and concise description of what the bug is.
diff --git a/.github/ISSUE_TEMPLATE/rfi_request.md b/.github/ISSUE_TEMPLATE/rfi_request.md
new file mode 100644
index 00000000..8ad25ac6
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/rfi_request.md
@@ -0,0 +1,27 @@
+---
+name: Request for Information
+about: Request specific information about capabilities of the framework
+title: "[RFI]-"
+labels: RFI
+assignees: ''
+
+---
+
+**What is your request?**
+Please provide as much detail as possible.
+
+
+**What is the intended use case**
+- [ ] Essentials Standalone Application
+- [ ] Essentials + SIMPL Windows Hybrid
+
+**User Interface Requirements**
+- [ ] Not Applicable (logic only)
+- [ ] Crestron Smart Graphics Touchpanel
+- [ ] Cisco Touch10
+- [ ] Mobile Control
+- [ ] Crestron CH5 Touchpanel interface
+
+
+**Additional context**
+Add any other context or screenshots about the request here.
diff --git a/.github/scripts/ZipBuildOutput.ps1 b/.github/scripts/ZipBuildOutput.ps1
index bf3c9d94..dfc6480d 100644
--- a/.github/scripts/ZipBuildOutput.ps1
+++ b/.github/scripts/ZipBuildOutput.ps1
@@ -8,6 +8,7 @@ $destination = "$($Env:GITHUB_HOME)\output"
New-Item -ItemType Directory -Force -Path ($destination)
Get-ChildItem ($destination)
$exclusions = @(git submodule foreach --quiet 'echo $name')
+$exclusions += "Newtonsoft.Compact.Json.dll"
# Trying to get any .json schema files (not currently working)
# Gets any files with the listed extensions.
Get-ChildItem -recurse -Path "$($Env:GITHUB_WORKSPACE)" -include "*.clz", "*.cpz", "*.cplz", "*.dll", "*.nuspec" | ForEach-Object {
diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml
index 003b1f66..cdcc925b 100644
--- a/.github/workflows/docker.yml
+++ b/.github/workflows/docker.yml
@@ -8,12 +8,9 @@ on:
- bugfix/*
- release/*
- development
- pull_request:
- branches:
- - development
env:
- # solution path doesn't need slashes unless there it is multiple folders deep
+ # solution path doesn't need slashes unless it is multiple folders deep
# solution name does not include extension. .sln is assumed
SOLUTION_PATH: PepperDashEssentials
SOLUTION_FILE: PepperDashEssentials
@@ -25,7 +22,7 @@ env:
RELEASE_BRANCH: main
jobs:
Build_Project:
- runs-on: windows-latest
+ runs-on: windows-2019
steps:
# First we checkout the source repo
- name: Checkout repo
@@ -78,16 +75,9 @@ jobs:
with:
name: Version
path: ${{env.GITHUB_HOME}}\output\version.txt
- # Create the release on the source repo
- - name: Create tag for non-rc builds
- if: contains(env.VERSION, 'alpha') || contains(env.VERSION, 'beta')
- run: |
- git tag $($Env:VERSION)
- git push --tags origin
- name: Create Release
id: create_release
# using contributor's version to allow for pointing at the right commit
- if: contains(env.VERSION,'-rc-') || contains(env.VERSION,'-hotfix-')
uses: fleskesvor/create-release@feature/support-target-commitish
with:
tag_name: ${{ env.VERSION }}
@@ -97,7 +87,6 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Upload the build package to the release
- name: Upload Release Package
- if: contains(env.VERSION,'-rc-') || contains(env.VERSION,'-hotfix-')
id: upload_release
uses: actions/upload-release-asset@v1
with:
@@ -150,160 +139,3 @@ jobs:
run: nuget push **/*.nupkg -source github
- name: Publish nuget package to nuget.org
run: nuget push **/*.nupkg -Source https://api.nuget.org/v3/index.json
- # This step always runs and pushes the build to the internal build rep
- Internal_Push_Output:
- needs: Build_Project
- runs-on: windows-latest
- steps:
- - name: check Github ref
- run: ${{toJson(github.ref)}}
- # Checkout the repo
- - name: Checkout Builds Repo
- uses: actions/checkout@v2
- with:
- token: ${{ secrets.BUILDS_TOKEN }}
- repository: PepperDash-Engineering/essentials-builds
- ref: ${{ Env.GITHUB_REF }}
- # Download the version artifact from the build job
- - name: Download Build Version Info
- uses: actions/download-artifact@v1
- with:
- name: Version
- - name: Check Directory
- run: Get-ChildItem "./"
- # Set the version number environment variable from the file we just downloaded
- - name: Set Version Number
- shell: powershell
- run: |
- Get-ChildItem "./Version"
- $version = Get-Content -Path ./Version/version.txt
- Write-Host "Version: $version"
- echo "VERSION=$version" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- Remove-Item -Path ./Version/version.txt
- Remove-Item -Path ./Version
- # Checkout/Create the branch
- - name: Create new branch
- run: git checkout -b $($Env:GITHUB_REF -replace "refs/heads/")
- # Download the build output into the repo
- - name: Download Build output
- uses: actions/download-artifact@v1
- with:
- name: Build
- path: ./
- - name: Check directory
- run: Get-ChildItem ./
- # Unzip the build package file
- - name: Unzip Build file
- run: |
- Get-ChildItem .\*.zip | Expand-Archive -DestinationPath .\
- Remove-Item -Path .\*.zip
- - name: Check directory again
- run: Get-ChildItem ./
- # Copy Contents of output folder to root directory
- - name: Copy Files to root & delete output directory
- run: |
- Remove-Item -Path .\* -Include @("*.cpz","*.md","*.cplz","*.json","*.dll","*.clz")
- Get-ChildItem -Path .\output\* | Copy-Item -Destination .\
- Remove-Item -Path .\output -Recurse
- # Commits the build output to the branch and tags it with the version
- - name: Commit build output and tag the commit
- shell: powershell
- run: |
- git config user.email "actions@pepperdash.com"
- git config user.name "GitHub Actions"
- git add .
- $commit = "Build $($Env:GITHUB_RUN_NUMBER) from commit: https://github.com/$($Env:GITHUB_REPOSITORY)/commit/$($Env:GITHUB_SHA)"
- Write-Host "Commit: $commit"
- git commit -m $commit
- git tag $($Env:VERSION)
- # Push the commit
- - name: Push to Builds Repo
- shell: powershell
- run: |
- $branch = $($Env:GITHUB_REF) -replace "refs/heads/"
- Write-Host "Branch: $branch"
- git push -u origin $($branch) --force
- # Push the tags
- - name: Push tags
- run: git push --tags origin
- - name: Check Directory
- run: Get-ChildItem ./
- # This step only runs if the branch is main or release/ runs and pushes the build to the public build repo
- Public_Push_Output:
- needs: Build_Project
- runs-on: windows-latest
- if: contains(github.ref, 'main') || contains(github.ref, '/release/')
- steps:
- # Checkout the repo
- - name: check Github ref
- run: ${{toJson(github.ref)}}
- - name: Checkout Builds Repo
- uses: actions/checkout@v2
- with:
- token: ${{ secrets.BUILDS_TOKEN }}
- repository: PepperDash/Essentials-Builds
- ref: ${{ Env.GITHUB_REF }}
- # Download the version artifact from the build job
- - name: Download Build Version Info
- uses: actions/download-artifact@v1
- with:
- name: Version
- - name: Check Directory
- run: Get-ChildItem "./"
- # Set the version number environment variable from the file we just downloaded
- - name: Set Version Number
- shell: powershell
- run: |
- Get-ChildItem "./Version"
- $version = Get-Content -Path ./Version/version.txt
- Write-Host "Version: $version"
- echo "VERSION=$version" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- Remove-Item -Path ./Version/version.txt
- Remove-Item -Path ./Version
- # Checkout/Create the branch
- - name: Create new branch
- run: git checkout -b $($Env:GITHUB_REF -replace "refs/heads/")
- # Download the build output into the repo
- - name: Download Build output
- uses: actions/download-artifact@v1
- with:
- name: Build
- path: ./
- - name: Check directory
- run: Get-ChildItem ./
- # Unzip the build package file
- - name: Unzip Build file
- run: |
- Get-ChildItem .\*.zip | Expand-Archive -DestinationPath .\
- Remove-Item -Path .\*.zip
- - name: Check directory again
- run: Get-ChildItem ./
- # Copy Contents of output folder to root directory
- - name: Copy Files to root & delete output directory
- run: |
- Remove-Item -Path .\* -Include @("*.cpz","*.md","*.cplz","*.json","*.dll","*.clz")
- Get-ChildItem -Path .\output\* | Copy-Item -Destination .\
- Remove-Item -Path .\output -Recurse
- # Commits the build output to the branch and tags it with the version
- - name: Commit build output and tag the commit
- shell: powershell
- run: |
- git config user.email "actions@pepperdash.com"
- git config user.name "GitHub Actions"
- git add .
- $commit = "Build $($Env:GITHUB_RUN_NUMBER) from commit: https://github.com/$($Env:GITHUB_REPOSITORY)/commit/$($Env:GITHUB_SHA)"
- Write-Host "Commit: $commit"
- git commit -m $commit
- git tag $($Env:VERSION)
- # Push the commit
- - name: Push to Builds Repo
- shell: powershell
- run: |
- $branch = $($Env:GITHUB_REF) -replace "refs/heads/"
- Write-Host "Branch: $branch"
- git push -u origin $($branch) --force
- # Push the tags
- - name: Push tags
- run: git push --tags origin
- - name: Check Directory
- run: Get-ChildItem ./
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index f1a6a278..ef43152b 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -19,7 +19,7 @@ env:
RELEASE_BRANCH: main
jobs:
Build_Project:
- runs-on: windows-latest
+ runs-on: windows-2019
steps:
# First we checkout the source repo
- name: Checkout repo
@@ -123,148 +123,3 @@ jobs:
run: nuget push **/*.nupkg -source github
- name: Publish nuget package to nuget.org
run: nuget push **/*.nupkg -Source https://api.nuget.org/v3/index.json
- Internal_Push_Output:
- needs: Build_Project
- runs-on: windows-latest
- steps:
- # Checkout the repo
- - name: Checkout Builds Repo
- uses: actions/checkout@v2
- with:
- token: ${{ secrets.BUILDS_TOKEN }}
- repository: PepperDash-Engineering/essentials-builds
- ref: ${{ Env.GITHUB_REF }}
- # Download the version artifact from the build job
- - name: Download Build Version Info
- uses: actions/download-artifact@v1
- with:
- name: Version
- - name: Check Directory
- run: Get-ChildItem "./"
- # Set the version number environment variable from the file we just downloaded
- - name: Set Version Number
- shell: powershell
- run: |
- Get-ChildItem "./Version"
- $version = Get-Content -Path ./Version/version.txt
- Write-Host "Version: $version"
- echo "VERSION=$version" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- Remove-Item -Path ./Version/version.txt
- Remove-Item -Path ./Version
- # Checkout/Create the branch
- - name: Checkout main branch
- run: git checkout main
- # Download the build output into the repo
- - name: Download Build output
- uses: actions/download-artifact@v1
- with:
- name: Build
- path: ./
- - name: Check directory
- run: Get-ChildItem ./
- # Unzip the build package file
- - name: Unzip Build file
- run: |
- Get-ChildItem .\*.zip | Expand-Archive -DestinationPath .\
- Remove-Item -Path .\*.zip
- - name: Check directory again
- run: Get-ChildItem ./
- # Copy Contents of output folder to root directory
- - name: Copy Files to root & delete output directory
- run: |
- Remove-Item -Path .\* -Include @("*.cpz","*.md","*.cplz","*.json","*.dll","*.clz")
- Get-ChildItem -Path .\output\* | Copy-Item -Destination .\
- Remove-Item -Path .\output -Recurse
- # Commits the build output to the branch and tags it with the version
- - name: Commit build output and tag the commit
- shell: powershell
- run: |
- git config user.email "actions@pepperdash.com"
- git config user.name "GitHub Actions"
- git add .
- $commit = "Build $($Env:GITHUB_RUN_NUMBER) from commit: https://github.com/$($Env:GITHUB_REPOSITORY)/commit/$($Env:GITHUB_SHA)"
- Write-Host "Commit: $commit"
- git commit -m $commit
- git tag $($Env:VERSION)
- # Push the commit
- - name: Push to Builds Repo
- shell: powershell
- run: git push -u origin main --force
- # Push the tags
- - name: Push tags
- run: git push --tags origin
- - name: Check Directory
- run: Get-ChildItem ./
- # This step only runs if the branch is main or release/ runs and pushes the build to the public build repo
- Public_Push_Output:
- needs: Build_Project
- runs-on: windows-latest
- steps:
- # Checkout the repo
- - name: Checkout Builds Repo
- uses: actions/checkout@v2
- with:
- token: ${{ secrets.BUILDS_TOKEN }}
- repository: PepperDash/Essentials-Builds
- ref: ${{ Env.GITHUB_REF }}
- # Download the version artifact from the build job
- - name: Download Build Version Info
- uses: actions/download-artifact@v1
- with:
- name: Version
- - name: Check Directory
- run: Get-ChildItem "./"
- # Set the version number environment variable from the file we just downloaded
- - name: Set Version Number
- shell: powershell
- run: |
- Get-ChildItem "./Version"
- $version = Get-Content -Path ./Version/version.txt
- Write-Host "Version: $version"
- echo "VERSION=$version" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- Remove-Item -Path ./Version/version.txt
- Remove-Item -Path ./Version
- # Checkout main branch
- - name: Create new branch
- run: git checkout main
- # Download the build output into the repo
- - name: Download Build output
- uses: actions/download-artifact@v1
- with:
- name: Build
- path: ./
- - name: Check directory
- run: Get-ChildItem ./
- # Unzip the build package file
- - name: Unzip Build file
- run: |
- Get-ChildItem .\*.zip | Expand-Archive -DestinationPath .\
- Remove-Item -Path .\*.zip
- - name: Check directory again
- run: Get-ChildItem ./
- # Copy Contents of output folder to root directory
- - name: Copy Files to root & delete output directory
- run: |
- Remove-Item -Path .\* -Include @("*.cpz","*.md","*.cplz","*.json","*.dll","*.clz")
- Get-ChildItem -Path .\output\* | Copy-Item -Destination .\
- Remove-Item -Path .\output -Recurse
- # Commits the build output to the branch and tags it with the version
- - name: Commit build output and tag the commit
- shell: powershell
- run: |
- git config user.email "actions@pepperdash.com"
- git config user.name "GitHub Actions"
- git add .
- $commit = "Build $($Env:GITHUB_RUN_NUMBER) from commit: https://github.com/$($Env:GITHUB_REPOSITORY)/commit/$($Env:GITHUB_SHA)"
- Write-Host "Commit: $commit"
- git commit -m $commit
- git tag $($Env:VERSION)
- # Push the commit
- - name: Push to Builds Repo
- shell: powershell
- run: git push -u origin main --force
- # Push the tags
- - name: Push tags
- run: git push --tags origin
- - name: Check Directory
- run: Get-ChildItem ./
diff --git a/.gitignore b/.gitignore
index 501c2f26..94b7d400 100644
--- a/.gitignore
+++ b/.gitignore
@@ -388,3 +388,4 @@ MigrationBackup/
# Fody - auto-generated XML schema
FodyWeavers.xsd
+essentials-framework/Essentials Interfaces/PepperDash_Essentials_Interfaces/PepperDash_Essentials_Interfaces.csproj
diff --git a/IR Drivers/Apple_AppleTV_4th_Gen_Essentials.ir b/IR Drivers/Apple_AppleTV_4th_Gen_Essentials.ir
new file mode 100644
index 00000000..f112ee8b
Binary files /dev/null and b/IR Drivers/Apple_AppleTV_4th_Gen_Essentials.ir differ
diff --git a/IR Drivers/Comcast X1.ir b/IR Drivers/Comcast X1.ir
index bff5afff..4f6c638e 100644
Binary files a/IR Drivers/Comcast X1.ir and b/IR Drivers/Comcast X1.ir differ
diff --git a/IR Drivers/DirecTV H21.ir b/IR Drivers/DirecTV H21.ir
index 612a9b2b..5744d336 100644
Binary files a/IR Drivers/DirecTV H21.ir and b/IR Drivers/DirecTV H21.ir differ
diff --git a/PepperDashEssentials/Bridges/JoinMaps/DmChassisControllerJoinMap.cs b/PepperDashEssentials/Bridges/JoinMaps/DmChassisControllerJoinMap.cs
index 2e1b8394..ba00306d 100644
--- a/PepperDashEssentials/Bridges/JoinMaps/DmChassisControllerJoinMap.cs
+++ b/PepperDashEssentials/Bridges/JoinMaps/DmChassisControllerJoinMap.cs
@@ -70,6 +70,14 @@ namespace PepperDash.Essentials.Bridges
/// Range reports the highest supported HDCP state level for the corresponding input card
///
public uint HdcpSupportCapability { get; set; }
+ ///
+ /// DM Chassis Stream Input Start (1), Stop (2), Pause (3) with Feedback
+ ///
+ public uint InputStreamCardStatus { get; set; }
+ ///
+ /// DM Chassis Stream Output Start (1), Stop (2), Pause (3) with Feedback
+ ///
+ public uint OutputStreamCardStatus { get; set; }
#endregion
#region Serials
@@ -115,6 +123,8 @@ namespace PepperDash.Essentials.Bridges
InputUsb = 700; //701-899
HdcpSupportState = 1000; //1001-1199
HdcpSupportCapability = 1200; //1201-1399
+ InputStreamCardStatus = 1500; //1501-1532
+ OutputStreamCardStatus = 1600; //1601-1632
//Serial
@@ -145,6 +155,8 @@ namespace PepperDash.Essentials.Bridges
OutputEndpointOnline = OutputEndpointOnline + joinOffset;
HdcpSupportState = HdcpSupportState + joinOffset;
HdcpSupportCapability = HdcpSupportCapability + joinOffset;
+ InputStreamCardStatus = InputStreamCardStatus + joinOffset;
+ OutputStreamCardStatus = OutputStreamCardStatus + joinOffset;
OutputDisabledByHdcp = OutputDisabledByHdcp + joinOffset;
TxAdvancedIsPresent = TxAdvancedIsPresent + joinOffset;
}
diff --git a/PepperDashEssentials/ControlSystem.cs b/PepperDashEssentials/ControlSystem.cs
index 460086e0..be78aaf9 100644
--- a/PepperDashEssentials/ControlSystem.cs
+++ b/PepperDashEssentials/ControlSystem.cs
@@ -12,6 +12,7 @@ using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Bridges;
using PepperDash.Essentials.Core.Config;
+using PepperDash.Essentials.Core.Fusion;
using PepperDash.Essentials.Devices.Common;
using PepperDash.Essentials.DM;
using PepperDash.Essentials.Fusion;
@@ -27,6 +28,7 @@ namespace PepperDash.Essentials
HttpLogoServer LogoServer;
private CTimer _startTimer;
+ private CEvent _initializeEvent;
private const long StartupTime = 500;
public ControlSystem()
@@ -35,6 +37,7 @@ namespace PepperDash.Essentials
Thread.MaxNumberOfUserThreads = 400;
Global.ControlSystem = this;
DeviceManager.Initialize(this);
+ SecretsManager.Initialize();
SystemMonitor.ProgramInitialization.ProgramInitializationUnderUserControl = true;
}
@@ -44,6 +47,24 @@ namespace PepperDash.Essentials
public override void InitializeSystem()
{
_startTimer = new CTimer(StartSystem,StartupTime);
+
+
+ // If the control system is a DMPS type, we need to wait to exit this method until all devices have had time to activate
+ // to allow any HD-BaseT DM endpoints to register first.
+ if (Global.ControlSystemIsDmpsType)
+ {
+ Debug.Console(2, "******************* InitializeSystem() Entering **********************");
+
+ _initializeEvent = new CEvent();
+
+ DeviceManager.AllDevicesActivated += (o, a) =>
+ {
+ _initializeEvent.Set();
+ Debug.Console(2, "******************* InitializeSystem() Exiting **********************");
+ };
+
+ _initializeEvent.Wait(30000);
+ }
}
private void StartSystem(object obj)
@@ -52,7 +73,7 @@ namespace PepperDash.Essentials
if (Debug.DoNotLoadOnNextBoot)
{
- CrestronConsole.AddNewConsoleCommand(s => GoWithLoad(), "go", "Loads configuration file",
+ CrestronConsole.AddNewConsoleCommand(s => CrestronInvoke.BeginInvoke((o) => GoWithLoad()), "go", "Loads configuration file",
ConsoleAccessLevelEnum.AccessOperator);
}
@@ -70,7 +91,7 @@ namespace PepperDash.Essentials
CrestronConsole.AddNewConsoleCommand(s =>
{
foreach (var tl in TieLineCollection.Default)
- CrestronConsole.ConsoleCommandResponse(" {0}\r", tl);
+ CrestronConsole.ConsoleCommandResponse(" {0}\r\n", tl);
},
"listtielines", "Prints out all tie lines", ConsoleAccessLevelEnum.AccessOperator);
@@ -84,8 +105,8 @@ namespace PepperDash.Essentials
CrestronConsole.AddNewConsoleCommand(s =>
{
- CrestronConsole.ConsoleCommandResponse("This system can be found at the following URLs:\r" +
- "System URL: {0}\r" +
+ CrestronConsole.ConsoleCommandResponse("This system can be found at the following URLs:\r\n" +
+ "System URL: {0}\r\n" +
"Template URL: {1}", ConfigReader.ConfigObject.SystemUrl, ConfigReader.ConfigObject.TemplateUrl);
}, "portalinfo", "Shows portal URLS from configuration", ConsoleAccessLevelEnum.AccessOperator);
@@ -129,29 +150,46 @@ namespace PepperDash.Essentials
if (CrestronEnvironment.DevicePlatform != eDevicePlatform.Server) // Handles 3-series running Windows CE OS
{
- Debug.Console(0, Debug.ErrorLogLevel.Notice, "Starting Essentials v{0} on 3-series Appliance", Global.AssemblyVersion);
+ string userFolder;
+ string nvramFolder;
+ bool is4series = false;
+
+ if (eCrestronSeries.Series4 == (Global.ProcessorSeries & eCrestronSeries.Series4)) // Handle 4-series
+ {
+ is4series = true;
+ // Set path to user/
+ userFolder = "user";
+ nvramFolder = "nvram";
+ }
+ else
+ {
+ userFolder = "User";
+ nvramFolder = "Nvram";
+ }
+
+ Debug.Console(0, Debug.ErrorLogLevel.Notice, "Starting Essentials v{0} on {1} Appliance", Global.AssemblyVersion, is4series ? "4-series" : "3-series");
// Check if User/ProgramX exists
- if (Directory.Exists(Global.ApplicationDirectoryPathPrefix + dirSeparator + "User"
+ if (Directory.Exists(Global.ApplicationDirectoryPathPrefix + dirSeparator + userFolder
+ dirSeparator + string.Format("program{0}", InitialParametersClass.ApplicationNumber)))
{
- Debug.Console(0, @"User/program{0} directory found", InitialParametersClass.ApplicationNumber);
- filePathPrefix = directoryPrefix + dirSeparator + "User"
+ Debug.Console(0, @"{0}/program{1} directory found", userFolder, InitialParametersClass.ApplicationNumber);
+ filePathPrefix = directoryPrefix + dirSeparator + userFolder
+ dirSeparator + string.Format("program{0}", InitialParametersClass.ApplicationNumber) + dirSeparator;
}
// Check if Nvram/Programx exists
- else if (Directory.Exists(directoryPrefix + dirSeparator + "Nvram"
+ else if (Directory.Exists(directoryPrefix + dirSeparator + nvramFolder
+ dirSeparator + string.Format("program{0}", InitialParametersClass.ApplicationNumber)))
{
- Debug.Console(0, @"Nvram/program{0} directory found", InitialParametersClass.ApplicationNumber);
- filePathPrefix = directoryPrefix + dirSeparator + "Nvram"
+ Debug.Console(0, @"{0}/program{1} directory found", nvramFolder, InitialParametersClass.ApplicationNumber);
+ filePathPrefix = directoryPrefix + dirSeparator + nvramFolder
+ dirSeparator + string.Format("program{0}", InitialParametersClass.ApplicationNumber) + dirSeparator;
}
// If neither exists, set path to User/ProgramX
else
{
- Debug.Console(0, @"No previous directory found. Using User/program{0}", InitialParametersClass.ApplicationNumber);
- filePathPrefix = directoryPrefix + dirSeparator + "User"
+ Debug.Console(0, @"No previous directory found. Using {0}/program{1}", userFolder, InitialParametersClass.ApplicationNumber);
+ filePathPrefix = directoryPrefix + dirSeparator + userFolder
+ dirSeparator + string.Format("program{0}", InitialParametersClass.ApplicationNumber) + dirSeparator;
}
}
@@ -322,7 +360,12 @@ namespace PepperDash.Essentials
// Skip this to prevent unnecessary warnings
if (devConf.Key == "processor")
{
- if (devConf.Type.ToLower() != Global.ControlSystem.ControllerPrompt.ToLower())
+ var prompt = Global.ControlSystem.ControllerPrompt;
+
+ var typeMatch = String.Equals(devConf.Type, prompt, StringComparison.OrdinalIgnoreCase) ||
+ String.Equals(devConf.Type, prompt.Replace("-", ""), StringComparison.OrdinalIgnoreCase);
+
+ if (!typeMatch)
Debug.Console(0,
"WARNING: Config file defines processor type as '{0}' but actual processor is '{1}'! Some ports may not be available",
devConf.Type.ToUpper(), Global.ControlSystem.ControllerPrompt.ToUpper());
@@ -337,9 +380,7 @@ namespace PepperDash.Essentials
if(propertiesConfig == null)
propertiesConfig = new DM.Config.DmpsRoutingPropertiesConfig();
- var dmpsRoutingController = DmpsRoutingController.GetDmpsRoutingController("processor-avRouting", this.ControllerPrompt, propertiesConfig);
-
- DeviceManager.AddDevice(dmpsRoutingController);
+ DeviceManager.AddDevice(DmpsRoutingController.GetDmpsRoutingController("processor-avRouting", this.ControllerPrompt, propertiesConfig));
}
else if (this.ControllerPrompt.IndexOf("mpc3", StringComparison.OrdinalIgnoreCase) > -1)
{
@@ -377,11 +418,11 @@ namespace PepperDash.Essentials
if (newDev != null)
DeviceManager.AddDevice(newDev);
else
- Debug.Console(0, Debug.ErrorLogLevel.Notice, "ERROR: Cannot load unknown device type '{0}', key '{1}'.", devConf.Type, devConf.Key);
+ Debug.Console(0, Debug.ErrorLogLevel.Error, "ERROR: Cannot load unknown device type '{0}', key '{1}'.", devConf.Type, devConf.Key);
}
catch (Exception e)
{
- Debug.Console(0, Debug.ErrorLogLevel.Notice, "ERROR: Creating device {0}. Skipping device. \r{1}", devConf.Key, e);
+ Debug.Console(0, Debug.ErrorLogLevel.Error, "ERROR: Creating device {0}. Skipping device. \r{1}", devConf.Key, e);
}
}
Debug.Console(0, Debug.ErrorLogLevel.Notice, "All Devices Loaded.");
@@ -426,56 +467,102 @@ namespace PepperDash.Essentials
return;
}
+ uint fusionIpId = 0xf1;
+
foreach (var roomConfig in ConfigReader.ConfigObject.Rooms)
{
- var room = EssentialsRoomConfigHelper.GetRoomObject(roomConfig) as EssentialsRoomBase;
+ var room = EssentialsRoomConfigHelper.GetRoomObject(roomConfig) as IEssentialsRoom;
if (room != null)
{
- if (room is EssentialsHuddleSpaceRoom)
+ // default to no join map key
+ string fusionJoinMapKey = string.Empty;
+
+ if (room.Config.Properties["fusion"] != null)
+ {
+ Debug.Console(2, "Custom Fusion config found. Using custom values");
+
+ var fusionConfig = room.Config.Properties["fusion"].ToObject();
+
+ if (fusionConfig != null)
+ {
+ fusionIpId = fusionConfig.IpIdInt;
+ fusionJoinMapKey = fusionConfig.JoinMapKey;
+ }
+ }
+
+ if (room is IEssentialsHuddleSpaceRoom)
{
DeviceManager.AddDevice(room);
- Debug.Console(0, Debug.ErrorLogLevel.Notice, "Room is EssentialsHuddleSpaceRoom, attempting to add to DeviceManager with Fusion");
- DeviceManager.AddDevice(new Core.Fusion.EssentialsHuddleSpaceFusionSystemControllerBase((EssentialsHuddleSpaceRoom)room, 0xf1));
+ Debug.Console(0, Debug.ErrorLogLevel.Notice, "Room is EssentialsHuddleSpaceRoom, attempting to add to DeviceManager with Fusion with IP-ID {0:X2}", fusionIpId);
+ DeviceManager.AddDevice(new Core.Fusion.EssentialsHuddleSpaceFusionSystemControllerBase(room, fusionIpId, fusionJoinMapKey));
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Attempting to build Mobile Control Bridge...");
CreateMobileControlBridge(room);
}
- else if (room is EssentialsHuddleVtc1Room)
+ else if (room is IEssentialsHuddleVtc1Room)
{
DeviceManager.AddDevice(room);
- Debug.Console(0, Debug.ErrorLogLevel.Notice, "Room is EssentialsHuddleVtc1Room, attempting to add to DeviceManager with Fusion");
- DeviceManager.AddDevice(new EssentialsHuddleVtc1FusionController((EssentialsHuddleVtc1Room)room, 0xf1));
+ if (!(room is EssentialsCombinedHuddleVtc1Room))
+ {
+ Debug.Console(0, Debug.ErrorLogLevel.Notice, "Room is EssentialsHuddleVtc1Room, attempting to add to DeviceManager with Fusion with IP-ID {0:X2}", fusionIpId);
+ DeviceManager.AddDevice(new EssentialsHuddleVtc1FusionController((IEssentialsHuddleVtc1Room)room, fusionIpId, fusionJoinMapKey));
+ }
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Attempting to build Mobile Control Bridge...");
CreateMobileControlBridge(room);
}
+ else if (room is EssentialsTechRoom)
+ {
+ DeviceManager.AddDevice(room);
+
+ Debug.Console(0, Debug.ErrorLogLevel.Notice,
+ "Room is EssentialsTechRoom, Attempting to add to DeviceManager with Fusion with IP-ID {0:X2}", fusionIpId);
+ DeviceManager.AddDevice(new EssentialsTechRoomFusionSystemController((EssentialsTechRoom)room, fusionIpId, fusionJoinMapKey));
+
+ Debug.Console(0, Debug.ErrorLogLevel.Notice, "Attempting to build Mobile Control Bridge");
+
+ CreateMobileControlBridge(room);
+ }
else
{
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Room is NOT EssentialsRoom, attempting to add to DeviceManager w/o Fusion");
DeviceManager.AddDevice(room);
}
+ fusionIpId += 1;
}
else
+ {
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Notice: Cannot create room from config, key '{0}' - Is this intentional? This may be a valid configuration.", roomConfig.Key);
+
+ }
}
Debug.Console(0, Debug.ErrorLogLevel.Notice, "All Rooms Loaded.");
}
- private static void CreateMobileControlBridge(EssentialsRoomBase room)
+ private static void CreateMobileControlBridge(object room)
{
var mobileControl = GetMobileControlDevice();
if (mobileControl == null) return;
- mobileControl.CreateMobileControlRoomBridge(room, mobileControl);
+ var mobileControl3 = mobileControl as IMobileControl3;
+
+ if (mobileControl3 != null)
+ {
+ mobileControl3.CreateMobileControlRoomBridge(room as IEssentialsRoom, mobileControl);
+ }
+ else
+ {
+ mobileControl.CreateMobileControlRoomBridge(room as EssentialsRoomBase, mobileControl);
+ }
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Mobile Control Bridge Added...");
}
@@ -556,7 +643,7 @@ namespace PepperDash.Essentials
return ((logoDark != null && logoDark == "system") ||
(logoLight != null && logoLight == "system") || (logo != null && logo == "system"));
}
- catch (Exception e)
+ catch
{
Debug.Console(1, Debug.ErrorLogLevel.Notice, "Unable to find logo information in any room config");
return false;
diff --git a/PepperDashEssentials/Example Configuration/EssentialsHuddleSpaceRoom/configurationFile-HuddleSpace-2-Source.json b/PepperDashEssentials/Example Configuration/EssentialsHuddleSpaceRoom/configurationFile-HuddleSpace-2-Source.json
index 3e43dac6..d3ce3275 100644
--- a/PepperDashEssentials/Example Configuration/EssentialsHuddleSpaceRoom/configurationFile-HuddleSpace-2-Source.json
+++ b/PepperDashEssentials/Example Configuration/EssentialsHuddleSpaceRoom/configurationFile-HuddleSpace-2-Source.json
@@ -88,7 +88,7 @@
{
"name": "Wireless Video",
"key": "wePresent-1",
- "type": "wePresent",
+ "type": "genericSource",
"group": "genericSource",
"uid": 9,
"properties": {
diff --git a/PepperDashEssentials/Example Configuration/EssentialsHuddleVtc1Room/configurationFile-mockVideoCodec_din-ap3_-_dm4x1.json b/PepperDashEssentials/Example Configuration/EssentialsHuddleVtc1Room/configurationFile-mockVideoCodec_din-ap3_-_dm4x1.json
index 7cc97c47..1e5b66d2 100644
--- a/PepperDashEssentials/Example Configuration/EssentialsHuddleVtc1Room/configurationFile-mockVideoCodec_din-ap3_-_dm4x1.json
+++ b/PepperDashEssentials/Example Configuration/EssentialsHuddleVtc1Room/configurationFile-mockVideoCodec_din-ap3_-_dm4x1.json
@@ -114,7 +114,7 @@
{
"name": "Wireless Video",
"key": "wePresent-1",
- "type": "wePresent",
+ "type": "genericSource",
"properties": {},
"group": "genericSource",
"uid": 3
diff --git a/PepperDashEssentials/Fusion/EssentialsHuddleVtc1FusionController.cs b/PepperDashEssentials/Fusion/EssentialsHuddleVtc1FusionController.cs
index 8d9da386..c3877706 100644
--- a/PepperDashEssentials/Fusion/EssentialsHuddleVtc1FusionController.cs
+++ b/PepperDashEssentials/Fusion/EssentialsHuddleVtc1FusionController.cs
@@ -16,8 +16,8 @@ namespace PepperDash.Essentials.Fusion
{
BooleanSigData CodecIsInCall;
- public EssentialsHuddleVtc1FusionController(EssentialsHuddleVtc1Room room, uint ipId)
- : base(room, ipId)
+ public EssentialsHuddleVtc1FusionController(IEssentialsHuddleVtc1Room room, uint ipId, string joinMapKey)
+ : base(room, ipId, joinMapKey)
{
}
@@ -37,7 +37,7 @@ namespace PepperDash.Essentials.Fusion
{
try
{
- var codec = (Room as EssentialsHuddleVtc1Room).VideoCodec;
+ var codec = (Room as IEssentialsHuddleVtc1Room).VideoCodec;
if (codec == null)
{
@@ -55,25 +55,25 @@ namespace PepperDash.Essentials.Fusion
// Map FusionRoom Attributes:
// Codec volume
- var codecVolume = FusionRoom.CreateOffsetUshortSig(50, "Volume - Fader01", eSigIoMask.InputOutputSig);
+ var codecVolume = FusionRoom.CreateOffsetUshortSig(JoinMap.VolumeFader1.JoinNumber, JoinMap.VolumeFader1.AttributeName, eSigIoMask.InputOutputSig);
codecVolume.OutputSig.UserObject = new Action(b => (codec as IBasicVolumeWithFeedback).SetVolume(b));
(codec as IBasicVolumeWithFeedback).VolumeLevelFeedback.LinkInputSig(codecVolume.InputSig);
// In Call Status
- CodecIsInCall = FusionRoom.CreateOffsetBoolSig(69, "Conf - VC 1 In Call", eSigIoMask.InputSigOnly);
+ CodecIsInCall = FusionRoom.CreateOffsetBoolSig(JoinMap.VcCodecInCall.JoinNumber, JoinMap.VcCodecInCall.AttributeName, eSigIoMask.InputSigOnly);
codec.CallStatusChange += new EventHandler(codec_CallStatusChange);
// Online status
if (codec is ICommunicationMonitor)
{
var c = codec as ICommunicationMonitor;
- var codecOnline = FusionRoom.CreateOffsetBoolSig(122, "Online - VC 1", eSigIoMask.InputSigOnly);
+ var codecOnline = FusionRoom.CreateOffsetBoolSig(JoinMap.VcCodecOnline.JoinNumber, JoinMap.VcCodecOnline.AttributeName, eSigIoMask.InputSigOnly);
codecOnline.InputSig.BoolValue = c.CommunicationMonitor.Status == MonitorStatus.IsOk;
c.CommunicationMonitor.StatusChange += (o, a) =>
{
codecOnline.InputSig.BoolValue = a.Status == MonitorStatus.IsOk;
};
- Debug.Console(0, this, "Linking '{0}' communication monitor to Fusion '{1}'", codec.Key, "Online - VC 1");
+ Debug.Console(0, this, "Linking '{0}' communication monitor to Fusion '{1}'", codec.Key, JoinMap.VcCodecOnline.AttributeName);
}
// Codec IP Address
@@ -101,10 +101,10 @@ namespace PepperDash.Essentials.Fusion
if (codecHasIpInfo)
{
- codecIpAddressSig = FusionRoom.CreateOffsetStringSig(121, "IP Address - VC", eSigIoMask.InputSigOnly);
+ codecIpAddressSig = FusionRoom.CreateOffsetStringSig(JoinMap.VcCodecIpAddress.JoinNumber, JoinMap.VcCodecIpAddress.AttributeName, eSigIoMask.InputSigOnly);
codecIpAddressSig.InputSig.StringValue = codecIpAddress;
- codecIpPortSig = FusionRoom.CreateOffsetStringSig(150, "IP Port - VC", eSigIoMask.InputSigOnly);
+ codecIpPortSig = FusionRoom.CreateOffsetStringSig(JoinMap.VcCodecIpPort.JoinNumber, JoinMap.VcCodecIpPort.AttributeName, eSigIoMask.InputSigOnly);
codecIpPortSig.InputSig.StringValue = codecIpPort.ToString();
}
@@ -123,7 +123,7 @@ namespace PepperDash.Essentials.Fusion
FusionStaticAssets.Add(deviceConfig.Uid, tempAsset);
}
- var codecAsset = FusionRoom.CreateStaticAsset(tempAsset.SlotNumber, tempAsset.Name, "Display", tempAsset.InstanceId);
+ var codecAsset = FusionRoom.CreateStaticAsset(tempAsset.SlotNumber, tempAsset.Name, "Codec", tempAsset.InstanceId);
codecAsset.PowerOn.OutputSig.UserObject = codecPowerOnAction;
codecAsset.PowerOff.OutputSig.UserObject = codecPowerOffAction;
codec.StandbyIsOnFeedback.LinkComplementInputSig(codecAsset.PowerOn.InputSig);
@@ -141,7 +141,7 @@ namespace PepperDash.Essentials.Fusion
void codec_CallStatusChange(object sender, PepperDash.Essentials.Devices.Common.Codec.CodecCallStatusItemChangeEventArgs e)
{
- var codec = (Room as EssentialsHuddleVtc1Room).VideoCodec;
+ var codec = (Room as IEssentialsHuddleVtc1Room).VideoCodec;
CodecIsInCall.InputSig.BoolValue = codec.IsInCall;
}
@@ -150,7 +150,7 @@ namespace PepperDash.Essentials.Fusion
protected override void CreateSymbolAndBasicSigs(uint ipId)
{
- Debug.Console(1, this, "Creating Fusion Room symbol with GUID: {0}", RoomGuid);
+ 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.ExtenderRoomViewSchedulingDataReservedSigs.Use();
@@ -166,20 +166,19 @@ namespace PepperDash.Essentials.Fusion
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(CreateAsHocMeeting, "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.OnFeedback.LinkInputSig(FusionRoom.SystemPowerOn.InputSig);
// Moved to
- CurrentRoomSourceNameSig = FusionRoom.CreateOffsetStringSig(84, "Display 1 - Current Source", 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.
- (Room as EssentialsHuddleVtc1Room).CurrentSourceChange += Room_CurrentSourceInfoChange;
+ (Room as IEssentialsHuddleVtc1Room).CurrentSourceChange += Room_CurrentSourceInfoChange;
- FusionRoom.SystemPowerOn.OutputSig.SetSigFalseAction((Room as EssentialsHuddleVtc1Room).PowerOnToDefaultOrLastSource);
- FusionRoom.SystemPowerOff.OutputSig.SetSigFalseAction(() => (Room as EssentialsHuddleVtc1Room).RunRouteAction("roomOff", Room.SourceListKey));
- // NO!! room.RoomIsOn.LinkComplementInputSig(FusionRoom.SystemPowerOff.InputSig);
+ FusionRoom.SystemPowerOn.OutputSig.SetSigFalseAction((Room as IEssentialsHuddleVtc1Room).PowerOnToDefaultOrLastSource);
+ FusionRoom.SystemPowerOff.OutputSig.SetSigFalseAction(() => (Room as IEssentialsHuddleVtc1Room).RunRouteAction("roomOff", Room.SourceListKey));
CrestronEnvironment.EthernetEventHandler += CrestronEnvironment_EthernetEventHandler;
@@ -188,7 +187,7 @@ namespace PepperDash.Essentials.Fusion
protected override void SetUpSources()
{
// Sources
- var dict = ConfigReader.ConfigObject.GetSourceListForKey((Room as EssentialsHuddleVtc1Room).SourceListKey);
+ var dict = ConfigReader.ConfigObject.GetSourceListForKey((Room as IEssentialsHuddleVtc1Room).SourceListKey);
if (dict != null)
{
// NEW PROCESS:
@@ -197,9 +196,9 @@ namespace PepperDash.Essentials.Fusion
uint i = 1;
foreach (var kvp in setTopBoxes)
{
- TryAddRouteActionSigs("Display 1 - Source TV " + i, 188 + i, kvp.Key, kvp.Value.SourceDevice);
+ TryAddRouteActionSigs(JoinMap.Display1DiscPlayerSourceStart.AttributeName + " " + i, JoinMap.Display1DiscPlayerSourceStart.JoinNumber + i, kvp.Key, kvp.Value.SourceDevice);
i++;
- if (i > 5) // We only have five spots
+ if (i > JoinMap.Display1SetTopBoxSourceStart.JoinSpan) // We only have five spots
break;
}
@@ -207,7 +206,7 @@ namespace PepperDash.Essentials.Fusion
i = 1;
foreach (var kvp in discPlayers)
{
- TryAddRouteActionSigs("Display 1 - Source DVD " + i, 181 + i, kvp.Key, kvp.Value.SourceDevice);
+ TryAddRouteActionSigs(JoinMap.Display1DiscPlayerSourceStart.AttributeName + " " + i, JoinMap.Display1DiscPlayerSourceStart.JoinNumber + i, kvp.Key, kvp.Value.SourceDevice);
i++;
if (i > 5) // We only have five spots
break;
@@ -217,9 +216,9 @@ namespace PepperDash.Essentials.Fusion
i = 1;
foreach (var kvp in laptops)
{
- TryAddRouteActionSigs("Display 1 - Source Laptop " + i, 166 + i, kvp.Key, kvp.Value.SourceDevice);
+ TryAddRouteActionSigs(JoinMap.Display1LaptopSourceStart.AttributeName + " " + i, JoinMap.Display1LaptopSourceStart.JoinNumber + i, kvp.Key, kvp.Value.SourceDevice);
i++;
- if (i > 10) // We only have ten spots???
+ if (i > JoinMap.Display1LaptopSourceStart.JoinSpan) // We only have ten spots???
break;
}
@@ -239,7 +238,7 @@ namespace PepperDash.Essentials.Fusion
else
{
Debug.Console(1, this, "WARNING: Config source list '{0}' not found for room '{1}'",
- (Room as EssentialsHuddleVtc1Room).SourceListKey, Room.Key);
+ (Room as IEssentialsHuddleVtc1Room).SourceListKey, Room.Key);
}
}
@@ -260,7 +259,7 @@ namespace PepperDash.Essentials.Fusion
display.UsageTracker.DeviceUsageEnded += new EventHandler(UsageTracker_DeviceUsageEnded);
}
- var defaultDisplay = (Room as EssentialsHuddleVtc1Room).DefaultDisplay as DisplayBase;
+ var defaultDisplay = (Room as IEssentialsHuddleVtc1Room).DefaultDisplay as DisplayBase;
if (defaultDisplay == null)
{
Debug.Console(1, this, "Cannot link null display to Fusion because default display is null");
@@ -283,7 +282,7 @@ namespace PepperDash.Essentials.Fusion
if (defaultDisplay is IDisplayUsage)
(defaultDisplay as IDisplayUsage).LampHours.LinkInputSig(FusionRoom.DisplayUsage.InputSig);
- MapDisplayToRoomJoins(1, 158, defaultDisplay);
+ MapDisplayToRoomJoins(1, JoinMap.Display1Start.JoinNumber, defaultDisplay);
var deviceConfig = ConfigReader.ConfigObject.Devices.FirstOrDefault(d => d.Key.Equals(defaultDisplay.Key));
@@ -328,12 +327,12 @@ namespace PepperDash.Essentials.Fusion
}
- protected override void MapDisplayToRoomJoins(int displayIndex, int joinOffset, DisplayBase display)
+ protected override void MapDisplayToRoomJoins(int displayIndex, uint joinOffset, DisplayBase display)
{
string displayName = string.Format("Display {0} - ", displayIndex);
- if (display == (Room as EssentialsHuddleVtc1Room).DefaultDisplay)
+ if (display == (Room as IEssentialsHuddleVtc1Room).DefaultDisplay)
{
// Power on
var defaultDisplayPowerOn = FusionRoom.CreateOffsetBoolSig((uint)joinOffset, displayName + "Power On", eSigIoMask.InputOutputSig);
@@ -352,7 +351,7 @@ namespace PepperDash.Essentials.Fusion
// Current Source
var defaultDisplaySourceNone = FusionRoom.CreateOffsetBoolSig((uint)joinOffset + 8, displayName + "Source None", eSigIoMask.InputOutputSig);
- defaultDisplaySourceNone.OutputSig.UserObject = new Action(b => { if (!b) (Room as EssentialsHuddleVtc1Room).RunRouteAction("roomOff", Room.SourceListKey); }); ;
+ defaultDisplaySourceNone.OutputSig.UserObject = new Action(b => { if (!b) (Room as IEssentialsHuddleVtc1Room).RunRouteAction("roomOff", Room.SourceListKey); }); ;
}
}
}
diff --git a/PepperDashEssentials/Fusion/EssentialsTechRoomFusionSystemController.cs b/PepperDashEssentials/Fusion/EssentialsTechRoomFusionSystemController.cs
new file mode 100644
index 00000000..0630c53a
--- /dev/null
+++ b/PepperDashEssentials/Fusion/EssentialsTechRoomFusionSystemController.cs
@@ -0,0 +1,106 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Crestron.SimplSharp;
+
+using PepperDash.Core;
+using PepperDash.Essentials.Core;
+using PepperDash.Essentials.Core.Config;
+using PepperDash.Essentials.Core.Fusion;
+
+namespace PepperDash.Essentials.Fusion
+{
+ public class EssentialsTechRoomFusionSystemController : EssentialsHuddleSpaceFusionSystemControllerBase
+ {
+ public EssentialsTechRoomFusionSystemController(EssentialsTechRoom room, uint ipId, string joinMapKey)
+ : base(room, ipId, joinMapKey)
+ {
+
+ }
+
+ protected override void SetUpDisplay()
+ {
+ try
+ {
+
+ var displays = (Room as EssentialsTechRoom).Displays;
+
+ Debug.Console(1, this, "Setting up Static Assets for {0} Displays", displays.Count);
+
+ foreach (var display in displays.Values.Cast())
+ {
+ var disp = display; // Local scope variable
+
+ Debug.Console(2, this, "Setting up Static Asset for {0}", disp.Key);
+
+ disp.UsageTracker = new UsageTracking(disp) { UsageIsTracked = true };
+ disp.UsageTracker.DeviceUsageEnded += UsageTracker_DeviceUsageEnded;
+
+ var dispPowerOnAction = new Action(b =>
+ {
+ if (!b)
+ {
+ disp.PowerOn();
+ }
+ });
+ var dispPowerOffAction = new Action(b =>
+ {
+ if (!b)
+ {
+ disp.PowerOff();
+ }
+ });
+
+ var deviceConfig = ConfigReader.ConfigObject.GetDeviceForKey(disp.Key);
+
+ FusionAsset tempAsset;
+
+ if (FusionStaticAssets.ContainsKey(deviceConfig.Uid))
+ {
+ // Used existing asset
+ tempAsset = FusionStaticAssets[deviceConfig.Uid];
+ }
+ else
+ {
+ // Create a new asset
+ tempAsset = new FusionAsset(FusionRoomGuids.GetNextAvailableAssetNumber(FusionRoom),
+ disp.Name, "Display", "");
+ FusionStaticAssets.Add(deviceConfig.Uid, tempAsset);
+ }
+
+ var dispAsset = FusionRoom.CreateStaticAsset(tempAsset.SlotNumber, tempAsset.Name, "Display",
+ tempAsset.InstanceId);
+
+ if (dispAsset != null)
+ {
+ dispAsset.PowerOn.OutputSig.UserObject = dispPowerOnAction;
+ dispAsset.PowerOff.OutputSig.UserObject = dispPowerOffAction;
+
+ // Use extension methods
+ dispAsset.TrySetMakeModel(disp);
+ dispAsset.TryLinkAssetErrorToCommunication(disp);
+ }
+
+ var defaultTwoWayDisplay = disp as IHasPowerControlWithFeedback;
+ if (defaultTwoWayDisplay != null)
+ {
+ defaultTwoWayDisplay.PowerIsOnFeedback.LinkInputSig(FusionRoom.DisplayPowerOn.InputSig);
+ if (disp is IDisplayUsage)
+ {
+ (disp as IDisplayUsage).LampHours.LinkInputSig(FusionRoom.DisplayUsage.InputSig);
+ }
+
+ if(dispAsset != null)
+ defaultTwoWayDisplay.PowerIsOnFeedback.LinkInputSig(dispAsset.PowerOn.InputSig);
+ }
+
+ }
+ }
+ catch (Exception e)
+ {
+ Debug.Console(1, this, "Error setting up displays in Fusion: {0}", e);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/PepperDashEssentials/PepperDashEssentials.csproj b/PepperDashEssentials/PepperDashEssentials.csproj
index 09e14ec0..8fe57b6f 100644
--- a/PepperDashEssentials/PepperDashEssentials.csproj
+++ b/PepperDashEssentials/PepperDashEssentials.csproj
@@ -133,19 +133,25 @@
+
-
+
+
+
+
+
+
diff --git a/PepperDashEssentials/Properties/ControlSystem.cfg b/PepperDashEssentials/Properties/ControlSystem.cfg
index d2c3b2c7..384bf949 100644
--- a/PepperDashEssentials/Properties/ControlSystem.cfg
+++ b/PepperDashEssentials/Properties/ControlSystem.cfg
@@ -1,7 +1,7 @@
- 192.168.10.1
- auto 192.168.10.1
+ Test RMC3
+ auto 192.168.1.40;username crestron
Program01
Internal Flash
\ No newline at end of file
diff --git a/PepperDashEssentials/Room/Config/EssentialsRoomConfig.cs b/PepperDashEssentials/Room/Config/EssentialsRoomConfig.cs
index dfaa333d..5a2bd34f 100644
--- a/PepperDashEssentials/Room/Config/EssentialsRoomConfig.cs
+++ b/PepperDashEssentials/Room/Config/EssentialsRoomConfig.cs
@@ -22,37 +22,36 @@ namespace PepperDash.Essentials.Room.Config
public static Device GetRoomObject(DeviceConfig roomConfig)
{
var typeName = roomConfig.Type.ToLower();
+
if (typeName == "huddle")
{
- var huddle = new EssentialsHuddleSpaceRoom(roomConfig);
-
- return huddle;
+ return new EssentialsHuddleSpaceRoom(roomConfig);
}
- else if (typeName == "huddlevtc1")
+ if (typeName == "huddlevtc1")
+ {
+ return new EssentialsHuddleVtc1Room(roomConfig);
+ }
+ if (typeName == "ddvc01bridge")
+ {
+ return new Device(roomConfig.Key, roomConfig.Name); // placeholder device that does nothing.
+ }
+ if (typeName == "dualdisplay")
+ {
+ return new EssentialsDualDisplayRoom(roomConfig);
+ }
+ if (typeName == "combinedhuddlevtc1")
{
- var rm = new EssentialsHuddleVtc1Room(roomConfig);
-
- return rm;
- }
- else if (typeName == "ddvc01Bridge")
- {
- return new Device(roomConfig.Key, roomConfig.Name); // placeholder device that does nothing.
- }
- else if (typeName == "dualdisplay")
- {
- var rm = new EssentialsDualDisplayRoom(roomConfig);
-
- return rm;
+ return new EssentialsCombinedHuddleVtc1Room(roomConfig);
}
- return null;
+ return typeName != "techroom" ? null : new EssentialsTechRoom(roomConfig);
}
///
/// Gets and operating, standalone emergegncy object that can be plugged into a room.
/// Returns null if there is no emergency defined
///
- public static EssentialsRoomEmergencyBase GetEmergency(EssentialsRoomPropertiesConfig props, EssentialsRoomBase room)
+ public static EssentialsRoomEmergencyBase GetEmergency(EssentialsRoomPropertiesConfig props, IEssentialsRoom room)
{
// This emergency
var emergency = props.Emergency;
@@ -101,7 +100,7 @@ namespace PepperDash.Essentials.Room.Config
if (behaviour == "trackroomstate")
{
// Tie LED enable to room power state
- var essRoom = room as EssentialsRoomBase;
+ var essRoom = room as IEssentialsRoom;
essRoom.OnFeedback.OutputChange += (o, a) =>
{
if (essRoom.OnFeedback.BoolValue)
@@ -152,6 +151,24 @@ namespace PepperDash.Essentials.Room.Config
[JsonProperty("helpMessage")]
public string HelpMessage { get; set; }
+ ///
+ /// Read this value to get the help message. It checks for the old and new config format.
+ ///
+ public string HelpMessageForDisplay
+ {
+ get
+ {
+ if(Help != null && !string.IsNullOrEmpty(Help.Message))
+ {
+ return Help.Message;
+ }
+ else
+ {
+ return HelpMessage;
+ }
+ }
+ }
+
[JsonProperty("environment")]
public EssentialsEnvironmentPropertiesConfig Environment { get; set; }
@@ -182,9 +199,18 @@ namespace PepperDash.Essentials.Room.Config
[JsonProperty("volumes")]
public EssentialsRoomVolumesConfig Volumes { get; set; }
+ [JsonProperty("fusion")]
+ public EssentialsRoomFusionConfig Fusion { get; set; }
+
[JsonProperty("zeroVolumeWhenSwtichingVolumeDevices")]
public bool ZeroVolumeWhenSwtichingVolumeDevices { get; set; }
+ ///
+ /// Indicates if this room represents a combination of other rooms
+ ///
+ [JsonProperty("isRoomCombinationScenario")]
+ public bool IsRoomCombinationScenario { get; set; }
+
public EssentialsRoomPropertiesConfig()
{
LogoLight = new EssentialsLogoPropertiesConfig();
@@ -198,9 +224,20 @@ namespace PepperDash.Essentials.Room.Config
public string DefaultAudioKey { get; set; }
[JsonProperty("sourceListKey")]
public string SourceListKey { get; set; }
+ [JsonProperty("destinationListKey")]
+ public string DestinationListKey { get; set; }
[JsonProperty("defaultSourceItem")]
public string DefaultSourceItem { get; set; }
-
+ ///
+ /// Indicates if the room supports advanced sharing
+ ///
+ [JsonProperty("supportsAdvancedSharing")]
+ public bool SupportsAdvancedSharing { get; set; }
+ ///
+ /// Indicates if non-tech users can change the share mode
+ ///
+ [JsonProperty("userCanChangeShareMode")]
+ public bool UserCanChangeShareMode { get; set; }
}
public class EssentialsConferenceRoomPropertiesConfig : EssentialsAvRoomPropertiesConfig
@@ -225,6 +262,32 @@ namespace PepperDash.Essentials.Room.Config
}
+ public class EssentialsRoomFusionConfig
+ {
+ public uint IpIdInt
+ {
+ get
+ {
+ try
+ {
+ return Convert.ToUInt32(IpId, 16);
+ }
+ catch (Exception)
+ {
+ throw new FormatException(string.Format("ERROR:Unable to convert IP ID: {0} to hex. Error:\n{1}", IpId));
+ }
+
+ }
+ }
+
+ [JsonProperty("ipId")]
+ public string IpId { get; set; }
+
+ [JsonProperty("joinMapKey")]
+ public string JoinMapKey { get; set; }
+
+ }
+
public class EssentialsRoomMicrophonePrivacyConfig
{
[JsonProperty("deviceKey")]
diff --git a/PepperDashEssentials/Room/Config/EssentialsTechRoomConfig.cs b/PepperDashEssentials/Room/Config/EssentialsTechRoomConfig.cs
new file mode 100644
index 00000000..9ff3a2d2
--- /dev/null
+++ b/PepperDashEssentials/Room/Config/EssentialsTechRoomConfig.cs
@@ -0,0 +1,72 @@
+using System.Collections.Generic;
+using Newtonsoft.Json;
+
+namespace PepperDash.Essentials.Room.Config
+{
+ public class EssentialsTechRoomConfig
+ {
+ ///
+ /// The key of the dummy device used to enable routing
+ ///
+ [JsonProperty("dummySourceKey")]
+ public string DummySourceKey { get; set; }
+
+ ///
+ /// The keys of the displays assigned to this room
+ ///
+ [JsonProperty("displays")]
+ public List Displays { get; set; }
+
+ ///
+ /// The keys of the tuners assinged to this room
+ ///
+ [JsonProperty("tuners")]
+ public List Tuners { get; set; }
+
+ ///
+ /// PIN to access the room as a normal user
+ ///
+ [JsonProperty("userPin")]
+ public string UserPin { get; set; }
+
+ ///
+ /// PIN to access the room as a tech user
+ ///
+ [JsonProperty("techPin")]
+ public string TechPin { get; set; }
+
+ ///
+ /// Name of the presets file. Path prefix is assumed to be /html/presets/lists/
+ ///
+ [JsonProperty("presetsFileName")]
+ public string PresetsFileName { get; set; }
+
+ [JsonProperty("scheduledEvents")]
+ public List ScheduledEvents { get; set; }
+
+ ///
+ /// Indicates that the room is the primary when true
+ ///
+ [JsonProperty("isPrimary")]
+ public bool IsPrimary { get; set; }
+
+ ///
+ /// Indicates which tuners should mirror preset recall when two rooms are configured in a primary->secondary scenario
+ ///
+ [JsonProperty("mirroredTuners")]
+ public Dictionary MirroredTuners { get; set; }
+
+ ///
+ /// Indicates the room
+ ///
+ [JsonProperty("isTvPresetsProvider")]
+ public bool IsTvPresetsProvider;
+
+ public EssentialsTechRoomConfig()
+ {
+ Displays = new List();
+ Tuners = new List();
+ ScheduledEvents = new List();
+ }
+ }
+}
\ No newline at end of file
diff --git a/PepperDashEssentials/Room/Config/DDVC01RoomPropertiesConfig.cs b/PepperDashEssentials/Room/Config/SimplRoomPropertiesConfig.cs
similarity index 78%
rename from PepperDashEssentials/Room/Config/DDVC01RoomPropertiesConfig.cs
rename to PepperDashEssentials/Room/Config/SimplRoomPropertiesConfig.cs
index be779f3a..f0fea9b9 100644
--- a/PepperDashEssentials/Room/Config/DDVC01RoomPropertiesConfig.cs
+++ b/PepperDashEssentials/Room/Config/SimplRoomPropertiesConfig.cs
@@ -8,19 +8,19 @@ using Newtonsoft.Json;
namespace PepperDash.Essentials.Room.Config
{
- public class DDVC01RoomPropertiesConfig : EssentialsHuddleVtc1PropertiesConfig
+ public class SimplRoomPropertiesConfig : EssentialsHuddleVtc1PropertiesConfig
{
[JsonProperty("roomPhoneNumber")]
public string RoomPhoneNumber { get; set; }
[JsonProperty("roomURI")]
public string RoomURI { get; set; }
[JsonProperty("speedDials")]
- public List SpeedDials { get; set; }
+ public List SpeedDials { get; set; }
[JsonProperty("volumeSliderNames")]
public List VolumeSliderNames { get; set; }
}
- public class DDVC01SpeedDial
+ public class SimplSpeedDial
{
[JsonProperty("name")]
public string Name { get; set; }
diff --git a/PepperDashEssentials/Room/Emergency/EsentialsRoomEmergencyContactClosure.cs b/PepperDashEssentials/Room/Emergency/EsentialsRoomEmergencyContactClosure.cs
index ab40d2fe..c40ed496 100644
--- a/PepperDashEssentials/Room/Emergency/EsentialsRoomEmergencyContactClosure.cs
+++ b/PepperDashEssentials/Room/Emergency/EsentialsRoomEmergencyContactClosure.cs
@@ -17,11 +17,11 @@ namespace PepperDash.Essentials.Room
public class EssentialsRoomEmergencyContactClosure : EssentialsRoomEmergencyBase
{
- EssentialsRoomBase Room;
+ IEssentialsRoom Room;
string Behavior;
bool TriggerOnClose;
- public EssentialsRoomEmergencyContactClosure(string key, EssentialsRoomEmergencyConfig config, EssentialsRoomBase room) :
+ public EssentialsRoomEmergencyContactClosure(string key, EssentialsRoomEmergencyConfig config, IEssentialsRoom room) :
base(key)
{
Room = room;
diff --git a/PepperDashEssentials/Room/Types/EssentialsCombinedHuddleVtc1Room.cs b/PepperDashEssentials/Room/Types/EssentialsCombinedHuddleVtc1Room.cs
new file mode 100644
index 00000000..9dec21f2
--- /dev/null
+++ b/PepperDashEssentials/Room/Types/EssentialsCombinedHuddleVtc1Room.cs
@@ -0,0 +1,821 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Crestron.SimplSharp;
+
+using Newtonsoft.Json;
+
+using PepperDash.Core;
+using PepperDash.Essentials.Core;
+using PepperDash.Essentials.Core.Config;
+using PepperDash.Essentials.Room.Config;
+using PepperDash.Essentials.Devices.Common.Codec;
+using PepperDash.Essentials.Devices.Common.VideoCodec;
+using PepperDash.Essentials.Devices.Common.AudioCodec;
+using PepperDash.Essentials.Core.DeviceTypeInterfaces;
+
+namespace PepperDash.Essentials
+{
+ public class EssentialsCombinedHuddleVtc1Room : EssentialsRoomBase, IEssentialsHuddleVtc1Room
+ {
+ private bool _codecExternalSourceChange;
+ public event EventHandler CurrentVolumeDeviceChange;
+ public event SourceInfoChangeHandler CurrentSourceChange;
+
+
+ //************************
+ // Call-related stuff
+
+ public BoolFeedback InCallFeedback { get; private set; }
+
+ /////
+ ///// Make this more specific
+ /////
+ //public List ActiveCalls { get; private set; }
+
+ ///
+ /// States: 0 for on hook, 1 for video, 2 for audio, 3 for telekenesis
+ ///
+ public IntFeedback CallTypeFeedback { get; private set; }
+
+ ///
+ ///
+ ///
+ public BoolFeedback PrivacyModeIsOnFeedback { get; private set; }
+
+ ///
+ /// When something in the room is sharing with the far end or through other means
+ ///
+ public BoolFeedback IsSharingFeedback { get; private set; }
+
+ //************************
+
+ protected override Func OnFeedbackFunc
+ {
+ get
+ {
+ return () =>
+ {
+
+ var displays = Displays.OfType().ToList();
+
+ var val = CurrentSourceInfo != null
+ && CurrentSourceInfo.Type == eSourceListItemType.Route
+ && displays.Count > 0;
+ //&& disp.PowerIsOnFeedback.BoolValue;
+ return val;
+ };
+ }
+ }
+ ///
+ ///
+ ///
+ protected override Func IsWarmingFeedbackFunc
+ {
+ get
+ {
+ return () => Displays.OfType().Any((d) => d.IsWarmingUpFeedback.BoolValue);
+ }
+ }
+ ///
+ ///
+ ///
+ protected override Func IsCoolingFeedbackFunc
+ {
+ get
+ {
+ return () => Displays.OfType().Any((d) => d.IsCoolingDownFeedback.BoolValue);
+ }
+ }
+
+ public EssentialsConferenceRoomPropertiesConfig PropertiesConfig { get; private set; }
+
+ private List Displays;
+
+ public IRoutingSinkWithSwitching DefaultDisplay { get; private set; }
+
+ public IBasicVolumeControls DefaultAudioDevice { get; private set; }
+ public IBasicVolumeControls DefaultVolumeControls { get; private set; }
+
+ public VideoCodecBase VideoCodec { get; private set; }
+
+ public AudioCodecBase AudioCodec { get; private set; }
+
+ public bool ExcludeFromGlobalFunctions { get; set; }
+
+ public string DefaultSourceItem { get; set; }
+
+ public ushort DefaultVolume { get; set; }
+
+ ///
+ /// If room is off, enables power on to last source. Default true
+ ///
+ public bool EnablePowerOnToLastSource { get; set; }
+ string LastSourceKey;
+
+ ///
+ /// Sets the volume control device, and attaches/removes InUseTrackers with "audio"
+ /// tag to device.
+ ///
+ public IBasicVolumeControls CurrentVolumeControls
+ {
+ get { return _CurrentAudioDevice; }
+ set
+ {
+ if (value == _CurrentAudioDevice) return;
+
+ var oldDev = _CurrentAudioDevice;
+ // derigister this room from the device, if it can
+ if (oldDev is IInUseTracking)
+ (oldDev as IInUseTracking).InUseTracker.RemoveUser(this, "audio");
+ var handler = CurrentVolumeDeviceChange;
+ if (handler != null)
+ CurrentVolumeDeviceChange(this, new VolumeDeviceChangeEventArgs(oldDev, value, ChangeType.WillChange));
+ _CurrentAudioDevice = value;
+ if (handler != null)
+ CurrentVolumeDeviceChange(this, new VolumeDeviceChangeEventArgs(oldDev, value, ChangeType.DidChange));
+ // register this room with new device, if it can
+ if (_CurrentAudioDevice is IInUseTracking)
+ (_CurrentAudioDevice as IInUseTracking).InUseTracker.AddUser(this, "audio");
+ }
+ }
+ IBasicVolumeControls _CurrentAudioDevice;
+
+ ///
+ /// The SourceListItem last run - containing names and icons
+ ///
+ public SourceListItem CurrentSourceInfo
+ {
+ get { return _CurrentSourceInfo; }
+ set
+ {
+ if (value == _CurrentSourceInfo) return;
+
+ var handler = CurrentSourceChange;
+ // remove from in-use tracker, if so equipped
+ if (_CurrentSourceInfo != null && _CurrentSourceInfo.SourceDevice is IInUseTracking)
+ (_CurrentSourceInfo.SourceDevice as IInUseTracking).InUseTracker.RemoveUser(this, "control");
+
+ if (handler != null)
+ handler(_CurrentSourceInfo, ChangeType.WillChange);
+
+ _CurrentSourceInfo = value;
+
+ // add to in-use tracking
+ if (_CurrentSourceInfo != null && _CurrentSourceInfo.SourceDevice is IInUseTracking)
+ (_CurrentSourceInfo.SourceDevice as IInUseTracking).InUseTracker.AddUser(this, "control");
+ if (handler != null)
+ handler(_CurrentSourceInfo, ChangeType.DidChange);
+
+ var vc = VideoCodec as IHasExternalSourceSwitching;
+ if (vc != null && !_codecExternalSourceChange)
+ {
+ vc.SetSelectedSource(CurrentSourceInfoKey);
+ }
+
+ _codecExternalSourceChange = false;
+ }
+ }
+ SourceListItem _CurrentSourceInfo;
+
+ public string CurrentSourceInfoKey { get; set; }
+
+ ///
+ /// "codecOsd"
+ ///
+ public string DefaultCodecRouteString { get { return "codecOsd"; } }
+
+ ///
+ /// Temporary implementation. Returns the schedule-ready object or null if none. Fow now,
+ /// always returns the VideoCodec if it is capable
+ ///
+ public IHasScheduleAwareness ScheduleSource { get { return VideoCodec as IHasScheduleAwareness; } }
+
+ CCriticalSection SourceSelectLock = new CCriticalSection();
+
+ public EssentialsCombinedHuddleVtc1Room(DeviceConfig config)
+ : base(config)
+ {
+ try
+ {
+ PropertiesConfig = JsonConvert.DeserializeObject
+ (config.Properties.ToString());
+
+ VideoCodec = DeviceManager.GetDeviceForKey(PropertiesConfig.VideoCodecKey) as
+ PepperDash.Essentials.Devices.Common.VideoCodec.VideoCodecBase;
+
+
+ if (VideoCodec == null)
+ throw new ArgumentNullException("codec cannot be null");
+
+ AudioCodec = DeviceManager.GetDeviceForKey(PropertiesConfig.AudioCodecKey) as
+ PepperDash.Essentials.Devices.Common.AudioCodec.AudioCodecBase;
+ if (AudioCodec == null)
+ Debug.Console(0, this, "No Audio Codec Found");
+
+ DefaultAudioDevice = DeviceManager.GetDeviceForKey(PropertiesConfig.DefaultAudioKey) as IBasicVolumeControls;
+
+ Displays = new List();
+
+ Initialize();
+ }
+ catch (Exception e)
+ {
+ Debug.Console(1, this, "Error building room: \n{0}", e);
+ }
+ }
+
+ void Initialize()
+ {
+ try
+ {
+ if (DefaultAudioDevice is IBasicVolumeControls)
+ DefaultVolumeControls = DefaultAudioDevice as IBasicVolumeControls;
+ else if (DefaultAudioDevice is IHasVolumeDevice)
+ DefaultVolumeControls = (DefaultAudioDevice as IHasVolumeDevice).VolumeDevice;
+ CurrentVolumeControls = DefaultVolumeControls;
+
+
+ // Combines call feedback from both codecs if available
+ InCallFeedback = new BoolFeedback(() =>
+ {
+ bool inAudioCall = false;
+ bool inVideoCall = false;
+
+ if (AudioCodec != null)
+ inAudioCall = AudioCodec.IsInCall;
+
+ if (VideoCodec != null)
+ inVideoCall = VideoCodec.IsInCall;
+
+ if (inAudioCall || inVideoCall)
+ return true;
+ else
+ return false;
+ });
+
+ SetupDisplays();
+
+ // Get Microphone Privacy object, if any MUST HAPPEN AFTER setting InCallFeedback
+ this.MicrophonePrivacy = EssentialsRoomConfigHelper.GetMicrophonePrivacy(PropertiesConfig, this);
+
+ Debug.Console(2, this, "Microphone Privacy Config evaluated.");
+
+ // Get emergency object, if any
+ this.Emergency = EssentialsRoomConfigHelper.GetEmergency(PropertiesConfig, this);
+
+ Debug.Console(2, this, "Emergency Config evaluated.");
+
+
+ VideoCodec.CallStatusChange += (o, a) => this.InCallFeedback.FireUpdate();
+ VideoCodec.IsReadyChange += (o, a) => { this.SetCodecExternalSources(); SetCodecBranding(); };
+
+ if (AudioCodec != null)
+ AudioCodec.CallStatusChange += (o, a) => this.InCallFeedback.FireUpdate();
+
+ IsSharingFeedback = new BoolFeedback(() => VideoCodec.SharingContentIsOnFeedback.BoolValue);
+ VideoCodec.SharingContentIsOnFeedback.OutputChange += (o, a) => this.IsSharingFeedback.FireUpdate();
+
+ // link privacy to VC (for now?)
+ PrivacyModeIsOnFeedback = new BoolFeedback(() => VideoCodec.PrivacyModeIsOnFeedback.BoolValue);
+ VideoCodec.PrivacyModeIsOnFeedback.OutputChange += (o, a) => this.PrivacyModeIsOnFeedback.FireUpdate();
+
+ CallTypeFeedback = new IntFeedback(() => 0);
+
+ SetSourceListKey();
+
+ EnablePowerOnToLastSource = true;
+ }
+ catch (Exception e)
+ {
+ Debug.Console(0, this, "Error Initializing Room: {0}", e);
+ }
+ }
+
+ private void SetupDisplays()
+ {
+ //DefaultDisplay = DeviceManager.GetDeviceForKey(PropertiesConfig.DefaultDisplayKey) as IRoutingSinkWithSwitching;
+
+ var destinationList = ConfigReader.ConfigObject.DestinationLists[PropertiesConfig.DestinationListKey];
+
+ foreach (var destination in destinationList)
+ {
+ var dest = destination.Value.SinkDevice as IRoutingSinkWithSwitching;
+
+ if (dest != null)
+ {
+ Displays.Add(dest);
+ }
+
+ var display = dest as DisplayBase;
+ if (display != null)
+ {
+ // Link power, warming, cooling to display
+ var dispTwoWay = display as IHasPowerControlWithFeedback;
+ if (dispTwoWay != null)
+ {
+ dispTwoWay.PowerIsOnFeedback.OutputChange += (o, a) =>
+ {
+ if (dispTwoWay.PowerIsOnFeedback.BoolValue != OnFeedback.BoolValue)
+ {
+ //if (!dispTwoWay.PowerIsOnFeedback.BoolValue)
+ // CurrentSourceInfo = null;
+ OnFeedback.FireUpdate();
+ }
+ if (dispTwoWay.PowerIsOnFeedback.BoolValue)
+ {
+ SetDefaultLevels();
+ }
+ };
+ }
+
+ display.IsWarmingUpFeedback.OutputChange += (o, a) =>
+ {
+ IsWarmingUpFeedback.FireUpdate();
+ if (!IsWarmingUpFeedback.BoolValue)
+ (CurrentVolumeControls as IBasicVolumeWithFeedback).SetVolume(DefaultVolume);
+ };
+ display.IsCoolingDownFeedback.OutputChange += (o, a) =>
+ {
+ IsCoolingDownFeedback.FireUpdate();
+ };
+
+ }
+ }
+ }
+
+ private void SetSourceListKey()
+ {
+ if (!string.IsNullOrEmpty(PropertiesConfig.SourceListKey))
+ {
+ SetSourceListKey(PropertiesConfig.SourceListKey);
+ }
+ else
+ {
+ SetSourceListKey(Key);
+ }
+
+ SetCodecExternalSources();
+ }
+
+ protected override void CustomSetConfig(DeviceConfig config)
+ {
+ var newPropertiesConfig = JsonConvert.DeserializeObject(config.Properties.ToString());
+
+ if (newPropertiesConfig != null)
+ PropertiesConfig = newPropertiesConfig;
+
+ ConfigWriter.UpdateRoomConfig(config);
+ }
+
+ public override bool CustomActivate()
+ {
+ // Add Occupancy object from config
+ if (PropertiesConfig.Occupancy != null)
+ {
+ Debug.Console(0, this, Debug.ErrorLogLevel.Notice, "Setting Occupancy Provider for room");
+ this.SetRoomOccupancy(DeviceManager.GetDeviceForKey(PropertiesConfig.Occupancy.DeviceKey) as
+ IOccupancyStatusProvider, PropertiesConfig.Occupancy.TimeoutMinutes);
+ }
+
+ this.LogoUrlLightBkgnd = PropertiesConfig.LogoLight.GetLogoUrlLight();
+ this.LogoUrlDarkBkgnd = PropertiesConfig.LogoDark.GetLogoUrlDark();
+
+ this.DefaultSourceItem = PropertiesConfig.DefaultSourceItem;
+ this.DefaultVolume = (ushort)(PropertiesConfig.Volumes.Master.Level * 65535 / 100);
+
+ return base.CustomActivate();
+ }
+
+ ///
+ ///
+ ///
+ protected override void EndShutdown()
+ {
+ VideoCodec.EndAllCalls();
+
+ SetDefaultLevels();
+
+ RunDefaultPresentRoute();
+
+ CrestronEnvironment.Sleep(1000);
+
+ Debug.Console(0, this, Debug.ErrorLogLevel.Notice, "Shutting down room");
+
+ RunRouteAction("roomOff");
+ VideoCodec.StopSharing();
+ VideoCodec.StandbyActivate();
+ }
+
+ ///
+ /// Routes the default source item, if any. Returns true when default route exists
+ ///
+ public override bool RunDefaultPresentRoute()
+ {
+ if (DefaultSourceItem != null)
+ RunRouteAction(DefaultSourceItem);
+
+ return DefaultSourceItem != null;
+ }
+
+ ///
+ /// Sets up the room when started into call mode without presenting a source
+ ///
+ ///
+ public bool RunDefaultCallRoute()
+ {
+ RunRouteAction(DefaultCodecRouteString);
+ return true;
+ }
+
+ public void RunRouteActionCodec(string routeKey, string sourceListKey)
+ {
+ _codecExternalSourceChange = true;
+ RunRouteAction(routeKey, sourceListKey);
+ }
+
+ ///
+ ///
+ ///
+ ///
+ public void RunRouteAction(string routeKey)
+ {
+ RunRouteAction(routeKey, new Action(() => { }));
+ }
+
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public void RunRouteAction(string routeKey, string sourceListKey)
+ {
+ if (string.IsNullOrEmpty(sourceListKey))
+ {
+ Debug.Console(1, this, "No sourceListKey present. RunRouteAction assumes default source list.");
+ RunRouteAction(routeKey, new Action(() => { }));
+ }
+ else
+ {
+ Debug.Console(1, this, "sourceListKey present but not yet implemented");
+ throw new NotImplementedException();
+ }
+ }
+
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public void RunRouteAction(string routeKey, string sourceListKey, Action successCallback)
+ {
+ if (string.IsNullOrEmpty(sourceListKey))
+ {
+ RunRouteAction(routeKey, successCallback);
+ }
+ else
+ throw new NotImplementedException();
+ }
+
+
+ ///
+ /// Gets a source from config list SourceListKey and dynamically build and executes the
+ /// route or commands
+ ///
+ ///
+ public void RunRouteAction(string routeKey, Action successCallback)
+ {
+ // Run this on a separate thread
+ new CTimer(o =>
+ {
+ // try to prevent multiple simultaneous selections
+ SourceSelectLock.TryEnter();
+
+ try
+ {
+
+ Debug.Console(0, this, Debug.ErrorLogLevel.Notice, "Run route action '{0}'", routeKey);
+ var dict = ConfigReader.ConfigObject.GetSourceListForKey(SourceListKey);
+ if (dict == null)
+ {
+ Debug.Console(1, this, "WARNING: Config source list '{0}' not found", SourceListKey);
+ return;
+ }
+
+ // Try to get the list item by it's string key
+ if (!dict.ContainsKey(routeKey))
+ {
+ Debug.Console(1, this, "WARNING: No item '{0}' found on config list '{1}'",
+ routeKey, SourceListKey);
+ return;
+ }
+
+ // End usage timer on last source
+ if (!string.IsNullOrEmpty(LastSourceKey))
+ {
+ var usageLastSource = dict[LastSourceKey].SourceDevice as IUsageTracking;
+ if (usageLastSource != null && usageLastSource.UsageTracker != null)
+ {
+ try
+ {
+ // There MAY have been failures in here. Protect
+ usageLastSource.UsageTracker.EndDeviceUsage();
+ }
+ catch (Exception e)
+ {
+ Debug.Console(1, this, "*#* EXCEPTION in end usage tracking:\r{0}", e);
+ }
+ }
+ }
+
+ // Let's run it
+ var item = dict[routeKey];
+ if (routeKey.ToLower() != "roomoff")
+ {
+
+ LastSourceKey = routeKey;
+ }
+ else
+ CurrentSourceInfoKey = null;
+
+ // hand off the individual routes to this helper
+ foreach (var route in item.RouteList)
+ DoRouteItem(route);
+
+ // Start usage timer on routed source
+ var usageNewSource = item.SourceDevice as IUsageTracking;
+ if (usageNewSource != null && usageNewSource.UsageTracker != null) // Have to make sure there is a usage tracker!
+ {
+ (item.SourceDevice as IUsageTracking).UsageTracker.StartDeviceUsage();
+ }
+
+ // See if this can be moved into common, base-class method -------------
+
+
+ // Set volume control, using default if non provided
+ IBasicVolumeControls volDev = null;
+ // Handle special cases for volume control
+ if (string.IsNullOrEmpty(item.VolumeControlKey)
+ || item.VolumeControlKey.Equals("$defaultAudio", StringComparison.OrdinalIgnoreCase))
+ volDev = DefaultVolumeControls;
+ //else if (item.VolumeControlKey.Equals("$defaultDisplay", StringComparison.OrdinalIgnoreCase))
+ // volDev = DefaultDisplay as IBasicVolumeControls;
+ // Or a specific device, probably rarely used.
+ else
+ {
+ var dev = DeviceManager.GetDeviceForKey(item.VolumeControlKey);
+ if (dev is IBasicVolumeControls)
+ volDev = dev as IBasicVolumeControls;
+ else if (dev is IHasVolumeDevice)
+ volDev = (dev as IHasVolumeDevice).VolumeDevice;
+ }
+
+ if (volDev != CurrentVolumeControls)
+ {
+ // zero the volume on the device we are leaving.
+ // Set the volume to default on device we are entering
+ if (ZeroVolumeWhenSwtichingVolumeDevices && CurrentVolumeControls is IBasicVolumeWithFeedback)
+ {
+ var vd = CurrentVolumeControls as IBasicVolumeWithFeedback;
+ SavedVolumeLevels[vd] = (uint)vd.VolumeLevelFeedback.IntValue;
+ vd.SetVolume(0);
+ }
+
+ CurrentVolumeControls = volDev;
+ if (ZeroVolumeWhenSwtichingVolumeDevices && CurrentVolumeControls is IBasicVolumeWithFeedback)
+ {
+ var vd = CurrentVolumeControls as IBasicVolumeWithFeedback;
+ ushort vol = (SavedVolumeLevels.ContainsKey(vd) ? (ushort)SavedVolumeLevels[vd] : DefaultVolume);
+ vd.SetVolume(vol);
+ }
+ }
+ // -----------------------------------------------------------------------
+
+
+
+ // store the name and UI info for routes
+ if (item.SourceKey == "$off")
+ {
+ CurrentSourceInfoKey = routeKey;
+ CurrentSourceInfo = null;
+ }
+ else if (item.SourceKey != null)
+ {
+ CurrentSourceInfoKey = routeKey;
+ CurrentSourceInfo = item;
+ }
+
+ OnFeedback.FireUpdate();
+
+ if (OnFeedback.BoolValue)
+ {
+ if (VideoCodec.UsageTracker.InUseTracker.InUseFeedback.BoolValue)
+ {
+ Debug.Console(1, this, "Video Codec in use, deactivating standby on codec");
+ VideoCodec.StandbyDeactivate();
+ }
+
+ if (VideoCodec.StandbyIsOnFeedback.BoolValue)
+ {
+ VideoCodec.StandbyDeactivate();
+ }
+ else
+ {
+ Debug.Console(1, this, "Video codec not in standby. No need to wake.");
+ }
+ }
+ else
+ {
+ Debug.Console(1, this, "Room OnFeedback state: {0}", OnFeedback.BoolValue);
+ }
+
+ // report back when done
+ if (successCallback != null)
+ successCallback();
+ }
+ catch (Exception e)
+ {
+ Debug.Console(1, this, "ERROR in routing: {0}", e);
+ }
+
+ SourceSelectLock.Leave();
+ }, 0); // end of CTimer
+ }
+
+ ///
+ ///
+ ///
+ ///
+ void DoRouteItem(SourceRouteListItem route)
+ {
+ // if there is a $defaultAll on route, run two separate
+ if (route.DestinationKey.Equals("$defaultAll", StringComparison.OrdinalIgnoreCase))
+ {
+ foreach (var display in Displays)
+ {
+ var tempVideo = new SourceRouteListItem
+ {
+ DestinationKey = display.Key,
+ SourceKey = route.SourceKey,
+ Type = eRoutingSignalType.Video
+ };
+ DoRoute(tempVideo);
+ }
+ }
+ else
+ DoRoute(route);
+ }
+
+ ///
+ ///
+ ///
+ ///
+ ///
+ bool DoRoute(SourceRouteListItem route)
+ {
+ IRoutingSink dest = null;
+
+ if (route.DestinationKey.Equals("$defaultaudio", StringComparison.OrdinalIgnoreCase))
+ dest = DefaultAudioDevice as IRoutingSink;
+ //else if (route.DestinationKey.Equals("$defaultDisplay", StringComparison.OrdinalIgnoreCase))
+ // dest = DefaultDisplay;
+ else
+ dest = DeviceManager.GetDeviceForKey(route.DestinationKey) as IRoutingSink;
+
+ if (dest == null)
+ {
+ Debug.Console(1, this, "Cannot route, unknown destination '{0}'", route.DestinationKey);
+ return false;
+ }
+
+ if (route.SourceKey.Equals("$off", StringComparison.OrdinalIgnoreCase))
+ {
+ dest.ReleaseRoute();
+ if (dest is IHasPowerControl)
+ (dest as IHasPowerControl).PowerOff();
+
+ }
+ else
+ {
+ var source = DeviceManager.GetDeviceForKey(route.SourceKey) as IRoutingOutputs;
+ if (source == null)
+ {
+ Debug.Console(1, this, "Cannot route unknown source '{0}' to {1}", route.SourceKey, route.DestinationKey);
+ return false;
+ }
+ dest.ReleaseAndMakeRoute(source, route.Type);
+ }
+ return true;
+ }
+
+ public override void RoomVacatedForTimeoutPeriod(object o)
+ {
+ //Implement this
+ }
+
+ ///
+ /// Does what it says
+ ///
+ public override void SetDefaultLevels()
+ {
+ Debug.Console(1, this, "Restoring default levels");
+ var vc = CurrentVolumeControls as IBasicVolumeWithFeedback;
+ if (vc != null)
+ vc.SetVolume(DefaultVolume);
+ }
+ ///
+ /// Will power the room on with the last-used source
+ ///
+ public override void PowerOnToDefaultOrLastSource()
+ {
+ if (!EnablePowerOnToLastSource || LastSourceKey == null)
+ return;
+ RunRouteAction(LastSourceKey);
+ }
+
+ ///
+ /// Runs "roomOff" action on all rooms not set to ExcludeFromGlobalFunctions
+ ///
+ public static void AllRoomsOff()
+ {
+ var allRooms = DeviceManager.AllDevices.Where(d =>
+ d is IEssentialsRoom && !(d as IEssentialsHuddleSpaceRoom).ExcludeFromGlobalFunctions);
+ foreach (var room in allRooms)
+ (room as IEssentialsHuddleSpaceRoom).RunRouteAction("roomOff");
+ }
+
+
+ ///
+ /// Setup the external sources for the Cisco Touch 10 devices that support IHasExternalSourceSwitch
+ ///
+ private void SetCodecExternalSources()
+ {
+ var videoCodecWithExternalSwitching = VideoCodec as IHasExternalSourceSwitching;
+
+ if (videoCodecWithExternalSwitching == null || !videoCodecWithExternalSwitching.ExternalSourceListEnabled)
+ {
+ return;
+ }
+
+ try
+ {
+ // Get the tie line that the external switcher is connected to
+ string codecInputConnectorName = ConfigReader.ConfigObject.TieLines.SingleOrDefault(
+ x => x.DestinationKey == VideoCodec.Key && x.DestinationPort == videoCodecWithExternalSwitching.ExternalSourceInputPort).DestinationPort;
+
+ videoCodecWithExternalSwitching.ClearExternalSources();
+ videoCodecWithExternalSwitching.RunRouteAction = RunRouteActionCodec;
+ var srcList = ConfigReader.ConfigObject.SourceLists.SingleOrDefault(x => x.Key == SourceListKey).Value.OrderBy(kv => kv.Value.Order); ;
+
+ foreach (var kvp in srcList)
+ {
+ var srcConfig = kvp.Value;
+
+ if (kvp.Key != DefaultCodecRouteString && kvp.Key != "roomOff")
+ {
+ videoCodecWithExternalSwitching.AddExternalSource(codecInputConnectorName, kvp.Key, srcConfig.PreferredName, PepperDash.Essentials.Devices.Common.VideoCodec.Cisco.eExternalSourceType.desktop);
+ videoCodecWithExternalSwitching.SetExternalSourceState(kvp.Key, PepperDash.Essentials.Devices.Common.VideoCodec.Cisco.eExternalSourceMode.Ready);
+ }
+ }
+ }
+ catch (Exception e)
+ {
+ Debug.Console(2, this, "Error setting codec external sources: {0}", e);
+ }
+ }
+
+ private void SetCodecBranding()
+ {
+ var vcWithBranding = VideoCodec as IHasBranding;
+
+ if (vcWithBranding == null) return;
+
+ Debug.Console(1, this, "Setting Codec Branding");
+ vcWithBranding.InitializeBranding(Key);
+ }
+
+ #region IPrivacy Members
+
+
+ public void PrivacyModeOff()
+ {
+ VideoCodec.PrivacyModeOff();
+ }
+
+ public void PrivacyModeOn()
+ {
+ VideoCodec.PrivacyModeOn();
+ }
+
+ public void PrivacyModeToggle()
+ {
+ VideoCodec.PrivacyModeToggle();
+ }
+
+ #endregion
+
+ }
+}
\ No newline at end of file
diff --git a/PepperDashEssentials/Room/Types/EssentialsDualDisplayRoom.cs b/PepperDashEssentials/Room/Types/EssentialsDualDisplayRoom.cs
index 2cfb33f7..d3812feb 100644
--- a/PepperDashEssentials/Room/Types/EssentialsDualDisplayRoom.cs
+++ b/PepperDashEssentials/Room/Types/EssentialsDualDisplayRoom.cs
@@ -207,7 +207,7 @@ namespace PepperDash.Essentials
DefaultAudioDevice = DeviceManager.GetDeviceForKey(PropertiesConfig.DefaultAudioKey) as IBasicVolumeControls;
- Initialize();
+ InitializeRoom();
}
catch (Exception e)
{
@@ -215,7 +215,7 @@ namespace PepperDash.Essentials
}
}
- void Initialize()
+ void InitializeRoom()
{
if (DefaultAudioDevice is IBasicVolumeControls)
DefaultVolumeControls = DefaultAudioDevice as IBasicVolumeControls;
@@ -274,10 +274,23 @@ namespace PepperDash.Essentials
CallTypeFeedback = new IntFeedback(() => 0);
- SourceListKey = "default";
+ SetSourceListKey();
EnablePowerOnToLastSource = true;
}
+ private void SetSourceListKey()
+ {
+ if (!string.IsNullOrEmpty(PropertiesConfig.SourceListKey))
+ {
+ SetSourceListKey(PropertiesConfig.SourceListKey);
+ }
+ else
+ {
+ SetSourceListKey(Key);
+ }
+
+ }
+
void InitializeDisplay(DisplayBase disp)
{
if (disp != null)
@@ -333,7 +346,6 @@ namespace PepperDash.Essentials
this.LogoUrlLightBkgnd = PropertiesConfig.LogoLight.GetLogoUrlLight();
this.LogoUrlDarkBkgnd = PropertiesConfig.LogoDark.GetLogoUrlDark();
- this.SourceListKey = PropertiesConfig.SourceListKey;
this.DefaultSourceItem = PropertiesConfig.DefaultSourceItem;
this.DefaultVolume = (ushort)(PropertiesConfig.Volumes.Master.Level * 65535 / 100);
@@ -633,9 +645,9 @@ namespace PepperDash.Essentials
public static void AllRoomsOff()
{
var allRooms = DeviceManager.AllDevices.Where(d =>
- d is EssentialsHuddleSpaceRoom && !(d as EssentialsHuddleSpaceRoom).ExcludeFromGlobalFunctions);
+ d is IEssentialsHuddleSpaceRoom && !(d as IEssentialsHuddleSpaceRoom).ExcludeFromGlobalFunctions);
foreach (var room in allRooms)
- (room as EssentialsHuddleSpaceRoom).RunRouteAction("roomOff", (room as EssentialsHuddleSpaceRoom).SourceListKey);
+ (room as IEssentialsHuddleSpaceRoom).RunRouteAction("roomOff", (room as IEssentialsHuddleSpaceRoom).SourceListKey);
}
#region IPrivacy Members
diff --git a/PepperDashEssentials/Room/Types/EssentialsHuddleSpaceRoom.cs b/PepperDashEssentials/Room/Types/EssentialsHuddleSpaceRoom.cs
index 4af7697a..5dbe7600 100644
--- a/PepperDashEssentials/Room/Types/EssentialsHuddleSpaceRoom.cs
+++ b/PepperDashEssentials/Room/Types/EssentialsHuddleSpaceRoom.cs
@@ -13,7 +13,7 @@ using PepperDash.Essentials.Room.Config;
namespace PepperDash.Essentials
{
- public class EssentialsHuddleSpaceRoom : EssentialsRoomBase, IHasCurrentSourceInfoChange, IRunRouteAction, IRunDefaultPresentRoute, IHasCurrentVolumeControls, IHasDefaultDisplay
+ public class EssentialsHuddleSpaceRoom : EssentialsRoomBase, IEssentialsHuddleSpaceRoom
{
public event EventHandler CurrentVolumeDeviceChange;
public event SourceInfoChangeHandler CurrentSourceChange;
@@ -156,7 +156,7 @@ namespace PepperDash.Essentials
DefaultAudioDevice = DeviceManager.GetDeviceForKey(PropertiesConfig.DefaultAudioKey) as IRoutingSinkWithSwitching;
- Initialize();
+ InitializeRoom();
}
catch (Exception e)
{
@@ -164,7 +164,7 @@ namespace PepperDash.Essentials
}
}
- void Initialize()
+ void InitializeRoom()
{
if (DefaultAudioDevice is IBasicVolumeControls)
DefaultVolumeControls = DefaultAudioDevice as IBasicVolumeControls;
@@ -201,11 +201,42 @@ namespace PepperDash.Essentials
IsCoolingDownFeedback.FireUpdate();
};
}
+
+ SetupEnvironmentalControlDevices();
+
+ SetSourceListKey();
- SourceListKey = "default";
EnablePowerOnToLastSource = true;
}
+ private void SetupEnvironmentalControlDevices()
+ {
+ if (PropertiesConfig.Environment != null)
+ {
+ if (PropertiesConfig.Environment.Enabled)
+ {
+ foreach (var d in PropertiesConfig.Environment.DeviceKeys)
+ {
+ var envDevice = DeviceManager.GetDeviceForKey(d) as EssentialsDevice;
+ EnvironmentalControlDevices.Add(envDevice);
+ }
+ }
+ }
+ }
+
+ private void SetSourceListKey()
+ {
+ if (!string.IsNullOrEmpty(PropertiesConfig.SourceListKey))
+ {
+ SetSourceListKey(PropertiesConfig.SourceListKey);
+ }
+ else
+ {
+ SetSourceListKey(Key);
+ }
+
+ }
+
protected override void CustomSetConfig(DeviceConfig config)
{
var newPropertiesConfig = JsonConvert.DeserializeObject(config.Properties.ToString());
@@ -256,7 +287,6 @@ namespace PepperDash.Essentials
this.LogoUrlLightBkgnd = PropertiesConfig.LogoLight.GetLogoUrlLight();
this.LogoUrlDarkBkgnd = PropertiesConfig.LogoDark.GetLogoUrlDark();
- this.SourceListKey = PropertiesConfig.SourceListKey;
this.DefaultSourceItem = PropertiesConfig.DefaultSourceItem;
this.DefaultVolume = (ushort)(PropertiesConfig.Volumes.Master.Level * 65535 / 100);
diff --git a/PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs b/PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs
index efb0ad7b..f429b8c8 100644
--- a/PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs
+++ b/PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs
@@ -13,13 +13,13 @@ using PepperDash.Essentials.Room.Config;
using PepperDash.Essentials.Devices.Common.Codec;
using PepperDash.Essentials.Devices.Common.VideoCodec;
using PepperDash.Essentials.Devices.Common.AudioCodec;
-using PepperDash_Essentials_Core.DeviceTypeInterfaces;
+using PepperDash.Essentials.Core.DeviceTypeInterfaces;
namespace PepperDash.Essentials
{
- public class EssentialsHuddleVtc1Room : EssentialsRoomBase, IHasCurrentSourceInfoChange,
- IPrivacy, IHasCurrentVolumeControls, IRunRouteAction, IRunDefaultCallRoute, IHasVideoCodec, IHasAudioCodec, IHasDefaultDisplay, IHasInCallFeedback
- {
+ public class EssentialsHuddleVtc1Room : EssentialsRoomBase, IEssentialsHuddleVtc1Room
+ {
+ private bool _codecExternalSourceChange;
public event EventHandler CurrentVolumeDeviceChange;
public event SourceInfoChangeHandler CurrentSourceChange;
@@ -51,20 +51,6 @@ namespace PepperDash.Essentials
//************************
- public override string SourceListKey
- {
- get
- {
- return _SourceListKey;
- }
- set
- {
- _SourceListKey = value;
- SetCodecExternalSources();
-
- }
- }
-
protected override Func OnFeedbackFunc
{
get
@@ -115,7 +101,7 @@ namespace PepperDash.Essentials
}
}
- public EssentialsHuddleVtc1PropertiesConfig PropertiesConfig { get; private set; }
+ public EssentialsConferenceRoomPropertiesConfig PropertiesConfig { get; private set; }
public IRoutingSinkWithSwitching DefaultDisplay { get; private set; }
public IBasicVolumeControls DefaultAudioDevice { get; private set; }
@@ -192,10 +178,12 @@ namespace PepperDash.Essentials
handler(_CurrentSourceInfo, ChangeType.DidChange);
var vc = VideoCodec as IHasExternalSourceSwitching;
- if (vc != null)
+ if (vc != null && !_codecExternalSourceChange)
{
vc.SetSelectedSource(CurrentSourceInfoKey);
}
+
+ _codecExternalSourceChange = false;
}
}
SourceListItem _CurrentSourceInfo;
@@ -222,23 +210,31 @@ namespace PepperDash.Essentials
{
PropertiesConfig = JsonConvert.DeserializeObject
(config.Properties.ToString());
- DefaultDisplay = DeviceManager.GetDeviceForKey(PropertiesConfig.DefaultDisplayKey) as IRoutingSinkWithSwitching;
+ DefaultDisplay = DeviceManager.GetDeviceForKey((PropertiesConfig as EssentialsHuddleVtc1PropertiesConfig).DefaultDisplayKey) as IRoutingSinkWithSwitching;
VideoCodec = DeviceManager.GetDeviceForKey(PropertiesConfig.VideoCodecKey) as
PepperDash.Essentials.Devices.Common.VideoCodec.VideoCodecBase;
-
+
if (VideoCodec == null)
- throw new ArgumentNullException("codec cannot be null");
-
+ {
+ Debug.Console(0, Debug.ErrorLogLevel.Error, "No Video Codec set. Please check 'videoCodecKey' property in room config");
+ throw new ArgumentNullException("VideoCodec cannot be null");
+ }
+
AudioCodec = DeviceManager.GetDeviceForKey(PropertiesConfig.AudioCodecKey) as
PepperDash.Essentials.Devices.Common.AudioCodec.AudioCodecBase;
if (AudioCodec == null)
Debug.Console(0, this, "No Audio Codec Found");
DefaultAudioDevice = DeviceManager.GetDeviceForKey(PropertiesConfig.DefaultAudioKey) as IBasicVolumeControls;
+ if (DefaultAudioDevice == null)
+ {
+ Debug.Console(0, Debug.ErrorLogLevel.Error, "No Default Audio Device set. Please check 'defaultAudioKey' property in room config");
+ throw new ArgumentNullException("DefaultAudioDevice cannot be null");
+ }
- Initialize();
+ InitializeRoom();
}
catch (Exception e)
{
@@ -246,7 +242,7 @@ namespace PepperDash.Essentials
}
}
- void Initialize()
+ void InitializeRoom()
{
try
{
@@ -338,7 +334,10 @@ namespace PepperDash.Essentials
CallTypeFeedback = new IntFeedback(() => 0);
- SourceListKey = "default";
+ SetupEnvironmentalControlDevices();
+
+ SetSourceListKey();
+
EnablePowerOnToLastSource = true;
}
catch (Exception e)
@@ -347,6 +346,36 @@ namespace PepperDash.Essentials
}
}
+ private void SetupEnvironmentalControlDevices()
+ {
+ if (PropertiesConfig.Environment != null)
+ {
+ if (PropertiesConfig.Environment.Enabled)
+ {
+ foreach (var d in PropertiesConfig.Environment.DeviceKeys)
+ {
+ var envDevice = DeviceManager.GetDeviceForKey(d) as EssentialsDevice;
+ EnvironmentalControlDevices.Add(envDevice);
+ }
+ }
+ }
+ }
+
+
+ private void SetSourceListKey()
+ {
+ if (!string.IsNullOrEmpty(PropertiesConfig.SourceListKey))
+ {
+ SetSourceListKey(PropertiesConfig.SourceListKey);
+ }
+ else
+ {
+ SetSourceListKey(Key);
+ }
+
+ SetCodecExternalSources();
+ }
+
protected override void CustomSetConfig(DeviceConfig config)
{
var newPropertiesConfig = JsonConvert.DeserializeObject(config.Properties.ToString());
@@ -370,13 +399,14 @@ namespace PepperDash.Essentials
this.LogoUrlLightBkgnd = PropertiesConfig.LogoLight.GetLogoUrlLight();
this.LogoUrlDarkBkgnd = PropertiesConfig.LogoDark.GetLogoUrlDark();
- this.SourceListKey = PropertiesConfig.SourceListKey;
this.DefaultSourceItem = PropertiesConfig.DefaultSourceItem;
this.DefaultVolume = (ushort)(PropertiesConfig.Volumes.Master.Level * 65535 / 100);
return base.CustomActivate();
}
+
+
///
///
///
@@ -414,10 +444,24 @@ namespace PepperDash.Essentials
///
public bool RunDefaultCallRoute()
{
+ Debug.Console(2, this, "RunDefaultCallRoute() Currently Sharing Content: {0}", VideoCodec.SharingContentIsOnFeedback.BoolValue);
+
+ if (VideoCodec.SharingContentIsOnFeedback.BoolValue)
+ {
+ Debug.Console(2, this, "Currently sharing content. Ignoring request to run default call route.");
+ return false;
+ }
+
RunRouteAction(DefaultCodecRouteString);
return true;
}
+ public void RunRouteActionCodec(string routeKey, string sourceListKey)
+ {
+ _codecExternalSourceChange = true;
+ RunRouteAction(routeKey, sourceListKey);
+ }
+
///
///
///
@@ -443,7 +487,8 @@ namespace PepperDash.Essentials
else
{
Debug.Console(1, this, "sourceListKey present but not yet implemented");
- throw new NotImplementedException();
+
+ RunRouteAction(routeKey, new Action(() => { }));
}
}
@@ -460,7 +505,11 @@ namespace PepperDash.Essentials
RunRouteAction(routeKey, successCallback);
}
else
- throw new NotImplementedException();
+ {
+ Debug.Console(1, this, "sourceListKey present but not yet implemented");
+
+ RunRouteAction(routeKey, successCallback);
+ }
}
///
@@ -597,12 +646,21 @@ namespace PepperDash.Essentials
if (VideoCodec.UsageTracker.InUseTracker.InUseFeedback.BoolValue)
{
Debug.Console(1, this, "Video Codec in use, deactivating standby on codec");
+ VideoCodec.StandbyDeactivate();
}
if (VideoCodec.StandbyIsOnFeedback.BoolValue)
{
VideoCodec.StandbyDeactivate();
}
+ else
+ {
+ Debug.Console(1, this, "Video codec not in standby. No need to wake.");
+ }
+ }
+ else
+ {
+ Debug.Console(1, this, "Room OnFeedback state: {0}", OnFeedback.BoolValue);
}
// report back when done
@@ -712,10 +770,10 @@ namespace PepperDash.Essentials
///
public static void AllRoomsOff()
{
- var allRooms = DeviceManager.AllDevices.Where(d =>
- d is EssentialsHuddleSpaceRoom && !(d as EssentialsHuddleSpaceRoom).ExcludeFromGlobalFunctions);
+ var allRooms = DeviceManager.AllDevices.Where(d =>
+ d is IEssentialsRoom && !(d as IEssentialsHuddleSpaceRoom).ExcludeFromGlobalFunctions);
foreach (var room in allRooms)
- (room as EssentialsHuddleSpaceRoom).RunRouteAction("roomOff");
+ (room as IEssentialsHuddleSpaceRoom).RunRouteAction("roomOff");
}
@@ -738,7 +796,7 @@ namespace PepperDash.Essentials
x => x.DestinationKey == VideoCodec.Key && x.DestinationPort == videoCodecWithExternalSwitching.ExternalSourceInputPort).DestinationPort;
videoCodecWithExternalSwitching.ClearExternalSources();
- videoCodecWithExternalSwitching.RunRouteAction = RunRouteAction;
+ videoCodecWithExternalSwitching.RunRouteAction = RunRouteActionCodec;
var srcList = ConfigReader.ConfigObject.SourceLists.SingleOrDefault(x => x.Key == SourceListKey).Value.OrderBy(kv => kv.Value.Order); ;
foreach (var kvp in srcList)
diff --git a/PepperDashEssentials/Room/Types/EssentialsTechRoom.cs b/PepperDashEssentials/Room/Types/EssentialsTechRoom.cs
new file mode 100644
index 00000000..c2b08f89
--- /dev/null
+++ b/PepperDashEssentials/Room/Types/EssentialsTechRoom.cs
@@ -0,0 +1,517 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using Crestron.SimplSharp;
+using Crestron.SimplSharp.Scheduler;
+using Crestron.SimplSharpPro.DeviceSupport;
+using Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
+using PepperDash.Core;
+using PepperDash.Essentials.Core;
+using PepperDash.Essentials.Core.Bridges;
+using PepperDash.Essentials.Core.Config;
+using PepperDash.Essentials.Core.DeviceTypeInterfaces;
+using PepperDash.Essentials.Core.Presets;
+using PepperDash.Essentials.Devices.Common;
+using PepperDash.Essentials.Room.Config;
+
+namespace PepperDash.Essentials
+{
+ public class EssentialsTechRoom : EssentialsRoomBase, ITvPresetsProvider, IBridgeAdvanced, IRunDirectRouteAction
+ {
+ private readonly EssentialsTechRoomConfig _config;
+ private readonly Dictionary _displays;
+
+ private readonly DevicePresetsModel _tunerPresets;
+ private readonly Dictionary _tuners;
+
+ private Dictionary _currentPresets;
+ private ScheduledEventGroup _roomScheduledEventGroup;
+
+ ///
+ ///
+ ///
+ protected override Func IsWarmingFeedbackFunc
+ {
+ get
+ {
+ return () =>
+ {
+ return _displays.All(kv => kv.Value.IsWarmingUpFeedback.BoolValue);
+ };
+ }
+ }
+ ///
+ ///
+ ///
+ protected override Func IsCoolingFeedbackFunc
+ {
+ get
+ {
+ return () =>
+ {
+ return _displays.All(kv => kv.Value.IsCoolingDownFeedback.BoolValue);
+ };
+ }
+ }
+
+ public EssentialsTechRoom(DeviceConfig config) : base(config)
+ {
+ _config = config.Properties.ToObject();
+
+ _tunerPresets = new DevicePresetsModel(String.Format("{0}-presets", config.Key), _config.PresetsFileName);
+
+ _tunerPresets.SetFileName(_config.PresetsFileName);
+
+ _tunerPresets.PresetRecalled += TunerPresetsOnPresetRecalled;
+
+ _tuners = GetDevices(_config.Tuners);
+ _displays = GetDevices(_config.Displays);
+
+ RoomPowerIsOnFeedback = new BoolFeedback(() => RoomPowerIsOn);
+
+ SetUpTunerPresetsFeedback();
+
+ SubscribeToDisplayFeedbacks();
+
+ CreateOrUpdateScheduledEvents();
+ }
+
+ public Dictionary CurrentPresetsFeedbacks { get; private set; }
+
+ public Dictionary Tuners
+ {
+ get { return _tuners; }
+ }
+
+ public Dictionary Displays
+ {
+ get { return _displays; }
+ }
+
+ public BoolFeedback RoomPowerIsOnFeedback { get; private set; }
+
+ public bool RoomPowerIsOn
+ {
+ get { return _displays.All(kv => kv.Value.PowerIsOnFeedback.BoolValue); }
+ }
+
+ #region ITvPresetsProvider Members
+
+ public DevicePresetsModel TvPresets
+ {
+ get { return _tunerPresets; }
+ }
+
+ #endregion
+
+ private void TunerPresetsOnPresetRecalled(ISetTopBoxNumericKeypad device, string channel)
+ {
+ //Debug.Console(2, this, "TunerPresetsOnPresetRecalled");
+
+ if (!_currentPresets.ContainsKey(device.Key))
+ {
+ return;
+ }
+
+ //Debug.Console(2, this, "Tuner Key: {0} Channel: {1}", device.Key, channel);
+
+ _currentPresets[device.Key] = channel;
+
+ if (CurrentPresetsFeedbacks.ContainsKey(device.Key))
+ {
+ CurrentPresetsFeedbacks[device.Key].FireUpdate();
+ }
+ }
+
+ private void SetUpTunerPresetsFeedback()
+ {
+ _currentPresets = new Dictionary();
+ CurrentPresetsFeedbacks = new Dictionary();
+
+ foreach (var setTopBox in _tuners)
+ {
+ var tuner = setTopBox.Value;
+ _currentPresets.Add(tuner.Key, String.Empty);
+ CurrentPresetsFeedbacks.Add(tuner.Key, new StringFeedback(() => _currentPresets[tuner.Key]));
+ }
+ }
+
+ private void SubscribeToDisplayFeedbacks()
+ {
+ foreach (var display in _displays)
+ {
+ display.Value.PowerIsOnFeedback.OutputChange +=
+ (sender, args) =>
+ {
+ RoomPowerIsOnFeedback.InvokeFireUpdate();
+ IsWarmingUpFeedback.InvokeFireUpdate();
+ IsCoolingDownFeedback.InvokeFireUpdate();
+ };
+ }
+ }
+
+ private void CreateOrUpdateScheduledEvents()
+ {
+ var eventsConfig = _config.ScheduledEvents;
+
+ GetOrCreateScheduleGroup();
+
+ foreach (var eventConfig in eventsConfig)
+ {
+ CreateOrUpdateSingleEvent(eventConfig);
+ }
+
+ _roomScheduledEventGroup.UserGroupCallBack += HandleScheduledEvent;
+ }
+
+ private void GetOrCreateScheduleGroup()
+ {
+ if (_roomScheduledEventGroup == null)
+ {
+ _roomScheduledEventGroup = Scheduler.GetEventGroup(Key) ?? new ScheduledEventGroup(Key);
+
+ Scheduler.AddEventGroup(_roomScheduledEventGroup);
+ }
+
+ _roomScheduledEventGroup.RetrieveAllEvents();
+ }
+
+ private void CreateOrUpdateSingleEvent(ScheduledEventConfig scheduledEvent)
+ {
+ if (!_roomScheduledEventGroup.ScheduledEvents.ContainsKey(scheduledEvent.Key))
+ {
+ SchedulerUtilities.CreateEventFromConfig(scheduledEvent, _roomScheduledEventGroup, HandleScheduledEvent);
+ return;
+ }
+
+ var roomEvent = _roomScheduledEventGroup.ScheduledEvents[scheduledEvent.Key];
+
+ //if (SchedulerUtilities.CheckEventTimeForMatch(roomEvent, DateTime.Parse(scheduledEvent.Time)) &&
+ // SchedulerUtilities.CheckEventRecurrenceForMatch(roomEvent, scheduledEvent.Days))
+ //{
+ // Debug.Console(1, this, "Existing event matches new event properties. Nothing to update");
+ // return;
+ //}
+
+ Debug.Console(1, this,
+ "Existing event does not match new config properties. Deleting existing event '{0}' and creating new event from configuration",
+ roomEvent.Name);
+
+ _roomScheduledEventGroup.DeleteEvent(roomEvent);
+
+ SchedulerUtilities.CreateEventFromConfig(scheduledEvent, _roomScheduledEventGroup, HandleScheduledEvent);
+ }
+
+ public void AddOrUpdateScheduledEvent(ScheduledEventConfig scheduledEvent)
+ {
+ //update config based on key of scheduleEvent
+ GetOrCreateScheduleGroup();
+ var existingEventIndex = _config.ScheduledEvents.FindIndex((e) => e.Key == scheduledEvent.Key);
+
+ if (existingEventIndex < 0)
+ {
+ _config.ScheduledEvents.Add(scheduledEvent);
+ }
+ else
+ {
+ _config.ScheduledEvents[existingEventIndex] = scheduledEvent;
+ }
+
+ //create or update event based on config
+ CreateOrUpdateSingleEvent(scheduledEvent);
+ //save config
+ Config.Properties = JToken.FromObject(_config);
+
+ CustomSetConfig(Config);
+ //Fire Event
+ OnScheduledEventUpdate();
+ }
+
+ public List GetScheduledEvents()
+ {
+ return _config.ScheduledEvents ?? new List();
+ }
+
+ private void OnScheduledEventUpdate()
+ {
+ var handler = ScheduledEventsChanged;
+
+ if (handler == null)
+ {
+ return;
+ }
+
+ handler(this, new ScheduledEventEventArgs {ScheduledEvents = _config.ScheduledEvents});
+ }
+
+ public event EventHandler ScheduledEventsChanged;
+
+ private void HandleScheduledEvent(ScheduledEvent schevent, ScheduledEventCommon.eCallbackReason type)
+ {
+ var eventConfig = _config.ScheduledEvents.FirstOrDefault(e => e.Key == schevent.Name);
+
+ if (eventConfig == null)
+ {
+ Debug.Console(1, this, "Event with name {0} not found", schevent.Name);
+ return;
+ }
+
+ Debug.Console(1, this, "Running actions for event {0}", schevent.Name);
+
+ if (eventConfig.Acknowledgeable)
+ {
+ schevent.Acknowledge();
+ }
+
+ CrestronInvoke.BeginInvoke((o) =>
+ {
+ Debug.Console(2, this, "There are {0} actions to execute for this event.", eventConfig.Actions.Count);
+
+ foreach (var a in eventConfig.Actions)
+ {
+ Debug.Console(2, this,
+@"Attempting to run action:
+DeviceKey: {0}
+MethodName: {1}
+Params: {2}"
+ , a.DeviceKey, a.MethodName, a.Params);
+ DeviceJsonApi.DoDeviceAction(a);
+ }
+ });
+ }
+
+
+ public void RoomPowerOn()
+ {
+ Debug.Console(2, this, "Room Powering On");
+
+ var dummySource = DeviceManager.GetDeviceForKey(_config.DummySourceKey) as IRoutingOutputs;
+
+ if (dummySource == null)
+ {
+ Debug.Console(1, this, "Unable to get source with key: {0}", _config.DummySourceKey);
+ return;
+ }
+
+ foreach (var display in _displays)
+ {
+ RunDirectRoute(dummySource, display.Value);
+ }
+ }
+
+ public void RoomPowerOff()
+ {
+ Debug.Console(2, this, "Room Powering Off");
+
+ foreach (var display in _displays)
+ {
+ display.Value.PowerOff();
+ }
+ }
+
+ private Dictionary GetDevices(ICollection config) where T : IKeyed
+ {
+ try
+ {
+ var returnValue = DeviceManager.AllDevices.OfType()
+ .Where(d => config.Contains(d.Key))
+ .ToDictionary(d => d.Key, d => d);
+
+ return returnValue;
+ }
+ catch
+ {
+ Debug.Console(0, this, Debug.ErrorLogLevel.Error,
+ "Error getting devices. Check Essentials Configuration");
+ return null;
+ }
+ }
+
+ #region Overrides of EssentialsRoomBase
+
+ protected override Func OnFeedbackFunc
+ {
+ get { return () => RoomPowerIsOn; }
+ }
+
+ protected override void EndShutdown()
+ {
+ }
+
+ public override void SetDefaultLevels()
+ {
+ }
+
+ public override void PowerOnToDefaultOrLastSource()
+ {
+ }
+
+ public override bool RunDefaultPresentRoute()
+ {
+ return false;
+ }
+
+ public override void RoomVacatedForTimeoutPeriod(object o)
+ {
+ }
+
+ #endregion
+
+ #region Implementation of IBridgeAdvanced
+
+ public void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
+ {
+
+ var joinMap = new EssentialsTechRoomJoinMap(joinStart);
+ var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
+
+ if (!String.IsNullOrEmpty(joinMapSerialized))
+ {
+ joinMap = JsonConvert.DeserializeObject(joinMapSerialized);
+ }
+
+ if (bridge != null)
+ {
+ bridge.AddJoinMap(Key, joinMap);
+ }
+
+ if (_config.IsPrimary)
+ {
+ Debug.Console(1, this, "Linking Primary system Tuner Preset Mirroring");
+ if (_config.MirroredTuners != null && _config.MirroredTuners.Count > 0)
+ {
+ foreach (var tuner in _config.MirroredTuners)
+ {
+ var f = CurrentPresetsFeedbacks[tuner.Value];
+
+ if (f == null)
+ {
+ Debug.Console(1, this, "Unable to find feedback with key: {0}", tuner.Value);
+ continue;
+ }
+
+ var join = joinMap.CurrentPreset.JoinNumber + tuner.Key;
+ f.LinkInputSig(trilist.StringInput[(uint)(join)]);
+ Debug.Console(1, this, "Linked Current Preset feedback for tuner: {0} to serial join: {1}", tuner.Value, join);
+ }
+ }
+
+ //i = 0;
+ //foreach (var feedback in CurrentPresetsFeedbacks)
+ //{
+ // feedback.Value.LinkInputSig(trilist.StringInput[(uint) (joinMap.CurrentPreset.JoinNumber + i)]);
+ // i++;
+ //}
+
+ trilist.OnlineStatusChange += (device, args) =>
+ {
+ if (!args.DeviceOnLine)
+ {
+ return;
+ }
+
+ foreach (var feedback in CurrentPresetsFeedbacks)
+ {
+ feedback.Value.FireUpdate();
+ }
+ };
+
+ return;
+ }
+ else
+ {
+ Debug.Console(1, this, "Linking Secondary system Tuner Preset Mirroring");
+
+ if (_config.MirroredTuners != null && _config.MirroredTuners.Count > 0)
+ {
+ foreach (var tuner in _config.MirroredTuners)
+ {
+ var t = _tuners[tuner.Value];
+
+ if (t == null)
+ {
+ Debug.Console(1, this, "Unable to find tuner with key: {0}", tuner.Value);
+ continue;
+ }
+
+ var join = joinMap.CurrentPreset.JoinNumber + tuner.Key;
+ trilist.SetStringSigAction(join, s => _tunerPresets.Dial(s, t));
+ Debug.Console(1, this, "Linked preset recall action for tuner: {0} to serial join: {1}", tuner.Value, join);
+ }
+
+ //foreach (var setTopBox in _tuners)
+ //{
+ // var tuner = setTopBox;
+
+ // trilist.SetStringSigAction(joinMap.CurrentPreset.JoinNumber + i, s => _tunerPresets.Dial(s, tuner.Value));
+
+ //}
+ }
+ }
+ }
+
+ #endregion
+
+ private class EssentialsTechRoomJoinMap : JoinMapBaseAdvanced
+ {
+ [JoinName("currentPreset")]
+ public JoinDataComplete CurrentPreset = new JoinDataComplete(new JoinData {JoinNumber = 1, JoinSpan = 16},
+ new JoinMetadata {Description = "Current Tuner Preset", JoinType = eJoinType.Serial});
+
+ public EssentialsTechRoomJoinMap(uint joinStart) : base(joinStart, typeof(EssentialsTechRoomJoinMap))
+ {
+ }
+ }
+
+ #region IRunDirectRouteAction Members
+
+ private void RunDirectRoute(IRoutingOutputs source, IRoutingSink dest)
+ {
+ if (dest == null)
+ {
+ Debug.Console(1, this, "Cannot route, unknown destination '{0}'", dest.Key);
+ return;
+ }
+
+ if (source == null)
+ {
+ dest.ReleaseRoute();
+ if (dest is IHasPowerControl)
+ (dest as IHasPowerControl).PowerOff();
+ }
+ else
+ {
+ dest.ReleaseAndMakeRoute(source, eRoutingSignalType.Video);
+ }
+ }
+
+ ///
+ /// Attempts to route directly between a source and destination
+ ///
+ ///
+ ///
+ public void RunDirectRoute(string sourceKey, string destinationKey)
+ {
+ IRoutingSink dest = null;
+
+ dest = DeviceManager.GetDeviceForKey(destinationKey) as IRoutingSink;
+
+ var source = DeviceManager.GetDeviceForKey(sourceKey) as IRoutingOutputs;
+
+ if (source == null || dest == null)
+ {
+ Debug.Console(1, this, "Cannot route unknown source or destination '{0}' to {1}", sourceKey, destinationKey);
+ return;
+ }
+ RunDirectRoute(source, dest);
+ }
+
+ #endregion
+ }
+
+ public class ScheduledEventEventArgs : EventArgs
+ {
+ public List ScheduledEvents;
+ }
+}
\ No newline at end of file
diff --git a/PepperDashEssentials/Room/Types/IEssentialsHuddleSpaceRoom.cs b/PepperDashEssentials/Room/Types/IEssentialsHuddleSpaceRoom.cs
new file mode 100644
index 00000000..45074fb7
--- /dev/null
+++ b/PepperDashEssentials/Room/Types/IEssentialsHuddleSpaceRoom.cs
@@ -0,0 +1,44 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Crestron.SimplSharp;
+
+using PepperDash.Essentials.Core;
+using PepperDash.Essentials.Core.DeviceTypeInterfaces;
+using PepperDash.Essentials.Room.Config;
+using PepperDash.Essentials.Core.Devices;
+using PepperDash.Essentials.Devices.Common.Codec;
+using PepperDash.Essentials.Devices.Common.VideoCodec;
+using PepperDash.Essentials.Devices.Common.AudioCodec;
+
+
+using PepperDash.Core;
+
+namespace PepperDash.Essentials
+{
+ public interface IEssentialsHuddleSpaceRoom : IEssentialsRoom, IHasCurrentSourceInfoChange, IRunRouteAction, IHasDefaultDisplay
+ {
+ bool ExcludeFromGlobalFunctions { get; }
+
+ void RunRouteAction(string routeKey);
+
+ EssentialsHuddleRoomPropertiesConfig PropertiesConfig { get; }
+
+ IBasicVolumeControls CurrentVolumeControls { get; }
+
+ event EventHandler CurrentVolumeDeviceChange;
+ }
+
+ public interface IEssentialsHuddleVtc1Room : IEssentialsRoom, IHasCurrentSourceInfoChange,
+ IHasCurrentVolumeControls, IRunRouteAction, IRunDefaultCallRoute, IHasVideoCodec, IHasAudioCodec, IHasDefaultDisplay
+ {
+ EssentialsHuddleVtc1PropertiesConfig PropertiesConfig { get; }
+
+ void RunRouteAction(string routeKey);
+
+ IHasScheduleAwareness ScheduleSource { get; }
+
+ string DefaultCodecRouteString { get; }
+ }
+}
\ No newline at end of file
diff --git a/PepperDashEssentials/Room/Types/Interfaces/IEssentialsHuddleSpaceRoom.cs b/PepperDashEssentials/Room/Types/Interfaces/IEssentialsHuddleSpaceRoom.cs
new file mode 100644
index 00000000..c7f68e8b
--- /dev/null
+++ b/PepperDashEssentials/Room/Types/Interfaces/IEssentialsHuddleSpaceRoom.cs
@@ -0,0 +1,24 @@
+using System;
+
+using PepperDash.Essentials.Core;
+using PepperDash.Essentials.Room.Config;
+
+
+
+namespace PepperDash.Essentials
+{
+ public interface IEssentialsHuddleSpaceRoom : IEssentialsRoom, IHasCurrentSourceInfoChange, IRunRouteAction, IRunDefaultPresentRoute, IHasDefaultDisplay
+ {
+ bool ExcludeFromGlobalFunctions { get; }
+
+ void RunRouteAction(string routeKey);
+
+ EssentialsHuddleRoomPropertiesConfig PropertiesConfig { get; }
+
+ IBasicVolumeControls CurrentVolumeControls { get; }
+
+ event EventHandler CurrentVolumeDeviceChange;
+ }
+
+
+}
\ No newline at end of file
diff --git a/PepperDashEssentials/Room/Types/Interfaces/IEssentialsHuddleVtc1Room.cs b/PepperDashEssentials/Room/Types/Interfaces/IEssentialsHuddleVtc1Room.cs
new file mode 100644
index 00000000..4b13145c
--- /dev/null
+++ b/PepperDashEssentials/Room/Types/Interfaces/IEssentialsHuddleVtc1Room.cs
@@ -0,0 +1,27 @@
+
+using PepperDash.Essentials.Core;
+using PepperDash.Essentials.Room.Config;
+using PepperDash.Essentials.Devices.Common.Codec;
+using PepperDash.Essentials.Devices.Common.VideoCodec;
+using PepperDash.Essentials.Devices.Common.AudioCodec;
+
+namespace PepperDash.Essentials
+{
+ public interface IEssentialsHuddleVtc1Room : IEssentialsRoom, IHasCurrentSourceInfoChange,
+ IPrivacy, IHasCurrentVolumeControls, IRunRouteAction, IRunDefaultCallRoute, IHasVideoCodec, IHasAudioCodec, IHasDefaultDisplay, IHasInCallFeedback
+ {
+ EssentialsConferenceRoomPropertiesConfig PropertiesConfig { get; }
+
+ bool ExcludeFromGlobalFunctions { get; }
+
+ void RunRouteAction(string routeKey);
+
+ IHasScheduleAwareness ScheduleSource { get; }
+
+ new BoolFeedback InCallFeedback { get; }
+
+ new BoolFeedback PrivacyModeIsOnFeedback { get; }
+
+ string DefaultCodecRouteString { get; }
+ }
+}
\ No newline at end of file
diff --git a/PepperDashEssentials/UI/EssentialsTouchpanelController.cs b/PepperDashEssentials/UI/EssentialsTouchpanelController.cs
index 65039872..441381bd 100644
--- a/PepperDashEssentials/UI/EssentialsTouchpanelController.cs
+++ b/PepperDashEssentials/UI/EssentialsTouchpanelController.cs
@@ -16,6 +16,8 @@ namespace PepperDash.Essentials
{
public class EssentialsTouchpanelController : EssentialsDevice, IHasBasicTriListWithSmartObject
{
+ private CrestronTouchpanelPropertiesConfig _propertiesConfig;
+
public BasicTriListWithSmartObject Panel { get; private set; }
public PanelDriverBase PanelDriver { get; private set; }
@@ -27,7 +29,14 @@ namespace PepperDash.Essentials
: base(key, name)
{
Panel = tsw;
- tsw.LoadSmartObjects(sgdPath);
+
+ if (!string.IsNullOrEmpty(sgdPath))
+ Panel.LoadSmartObjects(sgdPath);
+ else
+ Debug.Console(1, this, "No SGD file path defined");
+
+
+
tsw.SigChange += Panel_SigChange;
}
@@ -37,7 +46,7 @@ namespace PepperDash.Essentials
Panel = dge;
if (!string.IsNullOrEmpty(sgdPath))
- dge.LoadSmartObjects(sgdPath);
+ Panel.LoadSmartObjects(sgdPath);
else
Debug.Console(1, this, "No SGD file path defined");
@@ -50,6 +59,7 @@ namespace PepperDash.Essentials
public EssentialsTouchpanelController(string key, string name, string type, CrestronTouchpanelPropertiesConfig props, uint id)
: base(key, name)
{
+ _propertiesConfig = props;
Debug.Console(0, this, Debug.ErrorLogLevel.Notice, "Creating touchpanel hardware...");
type = type.ToLower();
@@ -61,6 +71,8 @@ namespace PepperDash.Essentials
app.ParameterProjectName.Value = props.ProjectName;
Panel = app;
}
+ else if (type == "xpanel")
+ Panel = new XpanelForSmartGraphics(id, Global.ControlSystem);
else if (type == "tsw550")
Panel = new Tsw550(id, Global.ControlSystem);
else if (type == "tsw552")
@@ -79,6 +91,16 @@ namespace PepperDash.Essentials
Panel = new Tsw1052(id, Global.ControlSystem);
else if (type == "tsw1060")
Panel = new Tsw1060(id, Global.ControlSystem);
+ else if (type == "tsw570")
+ Panel = new Tsw570(id, Global.ControlSystem);
+ else if (type == "tsw770")
+ Panel = new Tsw770(id, Global.ControlSystem);
+ else if (type == "ts770")
+ Panel = new Ts770(id, Global.ControlSystem);
+ else if (type == "tsw1070")
+ Panel = new Tsw1070(id, Global.ControlSystem);
+ else if (type == "ts1070")
+ Panel = new Ts1070(id, Global.ControlSystem);
else
{
Debug.Console(0, this, Debug.ErrorLogLevel.Notice, "WARNING: Cannot create TSW controller with type '{0}'", type);
@@ -124,10 +146,194 @@ namespace PepperDash.Essentials
Panel.LoadSmartObjects(sgdName);
Panel.SigChange += Panel_SigChange;
+ AddPostActivationAction(() =>
+ {
+ // Check for IEssentialsRoomCombiner in DeviceManager and if found, subscribe to its event
+ var roomCombiner = DeviceManager.AllDevices.FirstOrDefault((d) => d is IEssentialsRoomCombiner) as IEssentialsRoomCombiner;
+
+ if (roomCombiner != null)
+ {
+ // Subscribe to the even
+ roomCombiner.RoomCombinationScenarioChanged += new EventHandler(roomCombiner_RoomCombinationScenarioChanged);
+
+ // Connect to the initial roomKey
+ if (roomCombiner.CurrentScenario != null)
+ {
+ // Use the current scenario
+ DetermineRoomKeyFromScenario(roomCombiner.CurrentScenario);
+ }
+ else
+ {
+ // Current Scenario not yet set. Use default
+ SetupPanelDrivers(_propertiesConfig.DefaultRoomKey);
+ }
+ }
+ else
+ {
+ // No room combiner, use the default key
+ SetupPanelDrivers(_propertiesConfig.DefaultRoomKey);
+ }
+ });
}
+ void roomCombiner_RoomCombinationScenarioChanged(object sender, EventArgs e)
+ {
+ var roomCombiner = sender as IEssentialsRoomCombiner;
+
+ DetermineRoomKeyFromScenario(roomCombiner.CurrentScenario);
+ }
+
+ ///
+ /// Determines the room key to use based on the scenario
+ ///
+ ///
+ void DetermineRoomKeyFromScenario(IRoomCombinationScenario scenario)
+ {
+ string newRoomKey = null;
+
+ if (scenario.UiMap.ContainsKey(Key))
+ {
+ newRoomKey = scenario.UiMap[Key];
+ }
+ else if (scenario.UiMap.ContainsKey(_propertiesConfig.DefaultRoomKey))
+ {
+ newRoomKey = scenario.UiMap[_propertiesConfig.DefaultRoomKey];
+ }
+
+ SetupPanelDrivers(newRoomKey);
+ }
+
+
+ ///
+ /// Sets up drivers and links them to the room specified
+ ///
+ /// key of room to link the drivers to
+ void SetupPanelDrivers(string roomKey)
+ {
+ // Clear out any existing actions
+ Panel.ClearAllSigActions();
+
+ Debug.Console(0, this, "Linking TP '{0}' to Room '{1}'", Key, roomKey);
+
+ var mainDriver = new EssentialsPanelMainInterfaceDriver(Panel, _propertiesConfig);
+ // Then the sub drivers
+
+ // spin up different room drivers depending on room type
+ var room = DeviceManager.GetDeviceForKey(roomKey);
+ if (room is IEssentialsHuddleSpaceRoom)
+ {
+ // Screen Saver Driver
+
+ mainDriver.ScreenSaverController = new ScreenSaverController(mainDriver, _propertiesConfig);
+
+ // Header Driver
+ Debug.Console(0, this, "Adding header driver");
+ mainDriver.HeaderDriver = new EssentialsHeaderDriver(mainDriver, _propertiesConfig);
+
+ // AV Driver
+ Debug.Console(0, this, "Adding huddle space AV driver");
+ var avDriver = new EssentialsHuddlePanelAvFunctionsDriver(mainDriver, _propertiesConfig);
+ avDriver.DefaultRoomKey = roomKey;
+ mainDriver.AvDriver = avDriver;
+ avDriver.CurrentRoom = room as IEssentialsHuddleSpaceRoom;
+
+ // Environment Driver
+ if (avDriver.CurrentRoom.PropertiesConfig.Environment != null && avDriver.CurrentRoom.PropertiesConfig.Environment.DeviceKeys.Count > 0)
+ {
+ Debug.Console(0, this, "Adding environment driver");
+ mainDriver.EnvironmentDriver = new EssentialsEnvironmentDriver(mainDriver, _propertiesConfig);
+
+ mainDriver.EnvironmentDriver.GetDevicesFromConfig(avDriver.CurrentRoom.PropertiesConfig.Environment);
+ }
+
+ mainDriver.HeaderDriver.SetupHeaderButtons(avDriver, avDriver.CurrentRoom);
+
+ if (Panel is TswFt5ButtonSystem)
+ {
+ var tsw = Panel as TswFt5ButtonSystem;
+ // Wire up hard keys
+ tsw.Power.UserObject = new Action(b => { if (!b) avDriver.PowerButtonPressed(); });
+ if (mainDriver.EnvironmentDriver != null)
+ tsw.Lights.UserObject = new Action(b =>
+ {
+ if (!b)
+ {
+ mainDriver.EnvironmentDriver.Toggle();
+ }
+ });
+ tsw.Up.UserObject = new Action(avDriver.VolumeUpPress);
+ tsw.Down.UserObject = new Action(avDriver.VolumeDownPress);
+ }
+ }
+ else if (room is IEssentialsHuddleVtc1Room)
+ {
+ Debug.Console(0, this, "Adding huddle space VTC AV driver");
+
+ // Screen Saver Driver
+ mainDriver.ScreenSaverController = new ScreenSaverController(mainDriver, _propertiesConfig);
+
+ // Header Driver
+ mainDriver.HeaderDriver = new EssentialsHeaderDriver(mainDriver, _propertiesConfig);
+
+ // AV Driver
+ var avDriver = new EssentialsHuddleVtc1PanelAvFunctionsDriver(mainDriver, _propertiesConfig);
+
+ var codecDriver = new PepperDash.Essentials.UIDrivers.VC.EssentialsVideoCodecUiDriver(Panel, avDriver,
+ (room as IEssentialsHuddleVtc1Room).VideoCodec, mainDriver.HeaderDriver);
+ avDriver.SetVideoCodecDriver(codecDriver);
+ avDriver.DefaultRoomKey = roomKey;
+ mainDriver.AvDriver = avDriver;
+ avDriver.CurrentRoom = room as IEssentialsHuddleVtc1Room;
+
+ // Environment Driver
+ if (avDriver.CurrentRoom.PropertiesConfig.Environment != null && avDriver.CurrentRoom.PropertiesConfig.Environment.DeviceKeys.Count > 0)
+ {
+ Debug.Console(0, this, "Adding environment driver");
+ mainDriver.EnvironmentDriver = new EssentialsEnvironmentDriver(mainDriver, _propertiesConfig);
+
+ mainDriver.EnvironmentDriver.GetDevicesFromConfig(avDriver.CurrentRoom.PropertiesConfig.Environment);
+ }
+
+ mainDriver.HeaderDriver.SetupHeaderButtons(avDriver, avDriver.CurrentRoom);
+
+
+ if (Panel is TswFt5ButtonSystem)
+ {
+ var tsw = Panel as TswFt5ButtonSystem;
+ // Wire up hard keys
+ tsw.Power.UserObject = new Action(b => { if (!b) avDriver.EndMeetingPress(); });
+ if (mainDriver.EnvironmentDriver != null)
+ tsw.Lights.UserObject = new Action(b =>
+ {
+ if (!b)
+ {
+ mainDriver.EnvironmentDriver.Toggle();
+ }
+ });
+ tsw.Up.UserObject = new Action(avDriver.VolumeUpPress);
+ tsw.Down.UserObject = new Action(avDriver.VolumeDownPress);
+ }
+
+ LoadAndShowDriver(mainDriver);
+ }
+ else
+ {
+ Debug.Console(0, this, "ERROR: Cannot load AvFunctionsDriver for room '{0}'", roomKey);
+ }
+
+ }
+
public void LoadAndShowDriver(PanelDriverBase driver)
{
+ if (PanelDriver != null)
+ {
+ var mainDriver = PanelDriver as EssentialsPanelMainInterfaceDriver;
+ if (mainDriver != null)
+ {
+ mainDriver.Dispose();
+ }
+ }
+
PanelDriver = driver;
driver.Show();
}
@@ -138,7 +344,6 @@ namespace PepperDash.Essentials
PanelDriver.BackButtonPressed();
}
-
void ExtenderSystemReservedSigs_DeviceExtenderSigChange(DeviceExtender currentDeviceExtender, SigEventArgs args)
{
// If the sig is transitioning on, mark it in case it was home button that transitioned it
@@ -203,7 +408,7 @@ namespace PepperDash.Essentials
{
public EssentialsTouchpanelControllerFactory()
{
- TypeNames = new List() { "tsw550", "tsw750", "tsw1050", "tsw560", "tsw760", "tsw1060", "xpanel" };
+ TypeNames = new List() { "crestronapp", "tsw550", "tsw750", "tsw1050", "tsw560", "tsw760", "tsw1060", "tsw570", "tsw770", "ts770", "tsw1070", "ts1070", "xpanel" };
}
public override EssentialsDevice BuildDevice(DeviceConfig dc)
@@ -215,119 +420,6 @@ namespace PepperDash.Essentials
var panelController = new EssentialsTouchpanelController(dc.Key, dc.Name, dc.Type, props, comm.IpIdInt);
- panelController.AddPostActivationAction(() =>
- {
- var mainDriver = new EssentialsPanelMainInterfaceDriver(panelController.Panel, props);
- // Then the sub drivers
-
- // spin up different room drivers depending on room type
- var room = DeviceManager.GetDeviceForKey(props.DefaultRoomKey);
- if (room is EssentialsHuddleSpaceRoom)
- {
- // Screen Saver Driver
- mainDriver.ScreenSaverController = new ScreenSaverController(mainDriver, props);
-
- // Header Driver
- Debug.Console(0, panelController, "Adding header driver");
- mainDriver.HeaderDriver = new EssentialsHeaderDriver(mainDriver, props);
-
- // AV Driver
- Debug.Console(0, panelController, "Adding huddle space AV driver");
- var avDriver = new EssentialsHuddlePanelAvFunctionsDriver(mainDriver, props);
- avDriver.DefaultRoomKey = props.DefaultRoomKey;
- mainDriver.AvDriver = avDriver;
- avDriver.CurrentRoom = room as EssentialsHuddleSpaceRoom;
-
- // Environment Driver
- if (avDriver.CurrentRoom.PropertiesConfig.Environment != null && avDriver.CurrentRoom.PropertiesConfig.Environment.DeviceKeys.Count > 0)
- {
- Debug.Console(0, panelController, "Adding environment driver");
- mainDriver.EnvironmentDriver = new EssentialsEnvironmentDriver(mainDriver, props);
-
- mainDriver.EnvironmentDriver.GetDevicesFromConfig(avDriver.CurrentRoom.PropertiesConfig.Environment);
- }
-
- mainDriver.HeaderDriver.SetupHeaderButtons(avDriver, avDriver.CurrentRoom);
-
- panelController.LoadAndShowDriver(mainDriver); // This is a little convoluted.
-
- if (panelController.Panel is TswFt5ButtonSystem)
- {
- var tsw = panelController.Panel as TswFt5ButtonSystem;
- // Wire up hard keys
- tsw.Power.UserObject = new Action(b => { if (!b) avDriver.PowerButtonPressed(); });
- //tsw.Home.UserObject = new Action(b => { if (!b) HomePressed(); });
- if (mainDriver.EnvironmentDriver != null)
- tsw.Lights.UserObject = new Action(b =>
- {
- if (!b)
- {
- //mainDriver.AvDriver.PopupInterlock.ShowInterlockedWithToggle(mainDriver.EnvironmentDriver.BackgroundSubpageJoin);
- mainDriver.EnvironmentDriver.Toggle();
- }
- });
- tsw.Up.UserObject = new Action(avDriver.VolumeUpPress);
- tsw.Down.UserObject = new Action(avDriver.VolumeDownPress);
- }
- }
- else if (room is EssentialsHuddleVtc1Room)
- {
- Debug.Console(0, panelController, "Adding huddle space VTC AV driver");
-
- // Screen Saver Driver
- mainDriver.ScreenSaverController = new ScreenSaverController(mainDriver, props);
-
- // Header Driver
- mainDriver.HeaderDriver = new EssentialsHeaderDriver(mainDriver, props);
-
- // AV Driver
- var avDriver = new EssentialsHuddleVtc1PanelAvFunctionsDriver(mainDriver, props);
-
- var codecDriver = new PepperDash.Essentials.UIDrivers.VC.EssentialsVideoCodecUiDriver(panelController.Panel, avDriver,
- (room as EssentialsHuddleVtc1Room).VideoCodec, mainDriver.HeaderDriver);
- avDriver.SetVideoCodecDriver(codecDriver);
- avDriver.DefaultRoomKey = props.DefaultRoomKey;
- mainDriver.AvDriver = avDriver;
- avDriver.CurrentRoom = room as EssentialsHuddleVtc1Room;
-
- // Environment Driver
- if (avDriver.CurrentRoom.PropertiesConfig.Environment != null && avDriver.CurrentRoom.PropertiesConfig.Environment.DeviceKeys.Count > 0)
- {
- Debug.Console(0, panelController, "Adding environment driver");
- mainDriver.EnvironmentDriver = new EssentialsEnvironmentDriver(mainDriver, props);
-
- mainDriver.EnvironmentDriver.GetDevicesFromConfig(avDriver.CurrentRoom.PropertiesConfig.Environment);
- }
-
- mainDriver.HeaderDriver.SetupHeaderButtons(avDriver, avDriver.CurrentRoom);
-
- panelController.LoadAndShowDriver(mainDriver); // This is a little convoluted.
-
- if (panelController.Panel is TswFt5ButtonSystem)
- {
- var tsw = panelController.Panel as TswFt5ButtonSystem;
- // Wire up hard keys
- tsw.Power.UserObject = new Action(b => { if (!b) avDriver.EndMeetingPress(); });
- //tsw.Home.UserObject = new Action(b => { if (!b) HomePressed(); });
- if (mainDriver.EnvironmentDriver != null)
- tsw.Lights.UserObject = new Action(b =>
- {
- if (!b)
- {
- //mainDriver.AvDriver.PopupInterlock.ShowInterlockedWithToggle(mainDriver.EnvironmentDriver.BackgroundSubpageJoin);
- mainDriver.EnvironmentDriver.Toggle();
- }
- });
- tsw.Up.UserObject = new Action(avDriver.VolumeUpPress);
- tsw.Down.UserObject = new Action(avDriver.VolumeDownPress);
- }
- }
- else
- {
- Debug.Console(0, panelController, "ERROR: Cannot load AvFunctionsDriver for room '{0}'", props.DefaultRoomKey);
- }
- });
-
return panelController;
}
}
diff --git a/PepperDashEssentials/UI/JoinConstants/UIBoolJoin.cs b/PepperDashEssentials/UI/JoinConstants/UIBoolJoin.cs
index 23ab797e..1a127000 100644
--- a/PepperDashEssentials/UI/JoinConstants/UIBoolJoin.cs
+++ b/PepperDashEssentials/UI/JoinConstants/UIBoolJoin.cs
@@ -49,6 +49,16 @@ namespace PepperDash.Essentials
/// 1006
///
public const uint CallEndAllConfirmVisible = 1006;
+ ///
+ /// 1007
+ ///
+ public const uint MeetingPasswordVisible = 1007;
+ ///
+ /// 1008
+ ///
+ public const uint MeetingLeavePress = 1008;
+
+
@@ -103,7 +113,7 @@ namespace PepperDash.Essentials
///
/// 1202
///
- public const uint VCStagingInactivePopoverVisible = 1202;
+ public const uint VCStagingInactivePopoverWithRecentsVisible = 1202;
///
///
///
@@ -121,6 +131,11 @@ namespace PepperDash.Essentials
///
public const uint VCRecentsVisible = 1206;
+ ///
+ /// 1202
+ ///
+ public const uint VCStagingInactivePopoverWithoutRecentsVisible = 1207;
+
///
/// 1208
///
@@ -148,6 +163,11 @@ namespace PepperDash.Essentials
public const uint VCFavoriteVisibleStart = 1221;
// RANGE IN USE
public const uint VCFavoriteVisibleEnd = 1225;
+
+ ///
+ /// 1230
+ ///
+ public const uint VCStagingMeetNowPress = 1230;
///
/// 1231
///
@@ -243,6 +263,10 @@ namespace PepperDash.Essentials
///
public const uint VCCameraSelectBarWithoutModeVisible = 1261;
+ ///
+ /// 1262
+ ///
+ public const uint VCCameraAutoModeIsOnFb = 1262;
///
/// 1271
@@ -744,9 +768,9 @@ namespace PepperDash.Essentials
///
public const uint SourceBackgroundOverlayClosePress = 15044;
///
- /// 15045 - Visibility for the bar containing call navigation button list
+ /// 15045
///
- public const uint CallStagingBarVisible = 15045;
+ public const uint ZoomRoomContentSharingVisible = 15045;
///
/// 15046
///
@@ -764,6 +788,10 @@ namespace PepperDash.Essentials
///
public const uint NextMeetingModalVisible = 15049;
///
+ /// 15050
+ ///
+ public const uint NextMeetingNotificationRibbonVisible = 15050;
+ ///
/// 15051
///
public const uint Display1SelectPressAndFb = 15051;
@@ -831,6 +859,11 @@ namespace PepperDash.Essentials
/// 15067
///
public const uint NotificationRibbonVisible = 15067;
+ ///
+ /// 15068
+ ///
+ public const uint HeaderMeetingInfoVisible = 15068;
+
///
/// 15083 - Press for Call help desk on AC/VC
///
@@ -935,5 +968,24 @@ namespace PepperDash.Essentials
/// 15214
///
public const uint PinDialogDot4 = 15214;
+
+ // Password Prompt Dialog **************************
+
+ ///
+ /// 15301
+ ///
+ public const uint PasswordPromptDialogVisible = 15301;
+ ///
+ /// 15302
+ ///
+ public const uint PasswordPromptTextPress = 15302;
+ ///
+ /// 15306
+ ///
+ public const uint PasswordPromptCancelPress = 15306;
+ ///
+ /// 15307
+ ///
+ public const uint PasswordPromptErrorVisible = 15307;
}
}
\ No newline at end of file
diff --git a/PepperDashEssentials/UI/JoinConstants/UIStringlJoin.cs b/PepperDashEssentials/UI/JoinConstants/UIStringlJoin.cs
index 9b2b8a95..6741be35 100644
--- a/PepperDashEssentials/UI/JoinConstants/UIStringlJoin.cs
+++ b/PepperDashEssentials/UI/JoinConstants/UIStringlJoin.cs
@@ -27,6 +27,33 @@ namespace PepperDash.Essentials
/// 1004
///
public const uint CallSharedSourceNameText = 1004;
+ ///
+ /// 1005
+ ///
+ public const uint MeetingIdText = 1005;
+ ///
+ /// 1006
+ ///
+ public const uint MeetingHostText = 1006;
+ ///
+ /// 1007
+ ///
+ public const uint MeetingPasswordText = 1007;
+ ///
+ /// 1008
+ ///
+ public const uint MeetingLeaveText = 1008;
+ ///
+ /// 1009
+ ///
+ public const uint MeetingNameText = 1009;
+
+ ///
+ /// 1240 - Used to determine text for meeting start button
+ ///
+ public const uint MeetingStartButtonText = 1240;
+
+
///
@@ -118,6 +145,14 @@ namespace PepperDash.Essentials
//----- through 3120
+ ///
+ /// 3201
+ ///
+ public const uint PasswordPromptMessageText = 3201;
+ ///
+ /// 3202
+ ///
+ public const uint PasswordPromptPasswordText = 3202;
///
/// 3812
diff --git a/PepperDashEssentials/UI/JoinConstants/UIUshortJoin.cs b/PepperDashEssentials/UI/JoinConstants/UIUshortJoin.cs
index ffc7f19e..73356bf3 100644
--- a/PepperDashEssentials/UI/JoinConstants/UIUshortJoin.cs
+++ b/PepperDashEssentials/UI/JoinConstants/UIUshortJoin.cs
@@ -7,7 +7,7 @@
{
// Video Codec
///
- /// 1234: values 0 = Connect, 1 = End
+ /// 1234: values 0 = Connect, 1 = End, 2 = Start Meeting
///
public const uint VCStagingConnectButtonMode = 1234;
diff --git a/PepperDashEssentials/UI/SubpageReferenceListSourceItem.cs b/PepperDashEssentials/UI/SubpageReferenceListSourceItem.cs
index 3e1869cc..27409007 100644
--- a/PepperDashEssentials/UI/SubpageReferenceListSourceItem.cs
+++ b/PepperDashEssentials/UI/SubpageReferenceListSourceItem.cs
@@ -14,6 +14,8 @@ namespace PepperDash.Essentials
{
public SourceListItem SourceItem { get; private set; }
+ private IHasCurrentSourceInfoChange _room;
+
public SubpageReferenceListSourceItem(uint index, SubpageReferenceList owner,
SourceListItem sourceItem, Action routeAction)
: base(index, owner)
@@ -25,6 +27,7 @@ namespace PepperDash.Essentials
public void RegisterForSourceChange(IHasCurrentSourceInfoChange room)
{
+ _room = room;
room.CurrentSourceChange -= room_CurrentSourceInfoChange;
room.CurrentSourceChange += room_CurrentSourceInfoChange;
}
@@ -44,6 +47,9 @@ namespace PepperDash.Essentials
{
Owner.BoolInputSig(Index, 1).UserObject = null;
Owner.StringInputSig(Index, 1).StringValue = "";
+
+ if(_room != null)
+ _room.CurrentSourceChange -= room_CurrentSourceInfoChange;
}
///
diff --git a/PepperDashEssentials/UIDrivers/DualDisplayRouting.cs b/PepperDashEssentials/UIDrivers/DualDisplayRouting.cs
index 1aeb7a3c..4b29061d 100644
--- a/PepperDashEssentials/UIDrivers/DualDisplayRouting.cs
+++ b/PepperDashEssentials/UIDrivers/DualDisplayRouting.cs
@@ -146,18 +146,18 @@
// }
-// void CurrentRoom_CurrentSourceInfoChange(EssentialsRoomBase room, SourceListItem info, ChangeType type)
+// void CurrentRoom_CurrentSourceInfoChange(IEssentialsRoom room, SourceListItem info, ChangeType type)
// {
// }
-// void CurrentRoom_CurrentDisplay1SourceChange(EssentialsRoomBase room, SourceListItem info, ChangeType type)
+// void CurrentRoom_CurrentDisplay1SourceChange(IEssentialsRoom room, SourceListItem info, ChangeType type)
// {
// TriList.StringInput[UIStringJoin.Display1SourceLabel].StringValue = PendingSource.PreferredName;
// }
-// void CurrentRoom_CurrentDisplay2SourceChange(EssentialsRoomBase room, SourceListItem info, ChangeType type)
+// void CurrentRoom_CurrentDisplay2SourceChange(IEssentialsRoom room, SourceListItem info, ChangeType type)
// {
// TriList.StringInput[UIStringJoin.Display2SourceLabel].StringValue = PendingSource.PreferredName;
// }
diff --git a/PepperDashEssentials/UIDrivers/Essentials/EssentialsHeaderDriver.cs b/PepperDashEssentials/UIDrivers/Essentials/EssentialsHeaderDriver.cs
index ccaedd9c..c63af9d5 100644
--- a/PepperDashEssentials/UIDrivers/Essentials/EssentialsHeaderDriver.cs
+++ b/PepperDashEssentials/UIDrivers/Essentials/EssentialsHeaderDriver.cs
@@ -12,6 +12,7 @@ using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.SmartObjects;
using PepperDash.Essentials.Core.PageManagers;
+using PepperDash.Essentials.Devices.Common.VideoCodec.Interfaces;
using PepperDash.Essentials.Room.Config;
using PepperDash.Essentials.Devices.Common.Codec;
using PepperDash.Essentials.Devices.Common.VideoCodec;
@@ -52,7 +53,7 @@ namespace PepperDash.Essentials
CaretInterlock = new JoinedSigInterlock(TriList);
}
- void SetUpGear(IAVDriver avDriver, EssentialsRoomBase currentRoom)
+ void SetUpGear(IAVDriver avDriver, IEssentialsRoom currentRoom)
{
// Gear
TriList.SetString(UIStringJoin.HeaderButtonIcon5, "Gear");
@@ -105,7 +106,7 @@ namespace PepperDash.Essentials
{
string message = null;
var room = DeviceManager.GetDeviceForKey(Config.DefaultRoomKey)
- as EssentialsHuddleSpaceRoom;
+ as IEssentialsHuddleSpaceRoom;
if (room != null)
message = room.PropertiesConfig.HelpMessage;
else
@@ -164,7 +165,7 @@ namespace PepperDash.Essentials
CallCaretVisible = tempJoin + 10;
TriList.SetSigFalseAction(tempJoin, () =>
{
- avDriver.ShowActiveCallsList();
+ avDriver.ShowActiveCallsListOrMeetingInfo();
if(avDriver.CurrentRoom.InCallFeedback.BoolValue)
CaretInterlock.ShowInterlocked(CallCaretVisible);
});
@@ -191,26 +192,30 @@ namespace PepperDash.Essentials
return;
}
+ var meetingInfoCodec = codec as IHasMeetingInfo;
+
// Set mode of header button
- if (!codec.IsInCall)
- {
- HeaderCallButtonIconSig.StringValue = "DND";
- //HeaderCallButton.SetIcon(HeaderListButton.OnHook);
- }
- else if (codec.ActiveCalls.Any(c => c.Type == eCodecCallType.Video))
- HeaderCallButtonIconSig.StringValue = "Misc-06_Dark";
- //HeaderCallButton.SetIcon(HeaderListButton.Camera);
- //TriList.SetUshort(UIUshortJoin.CallHeaderButtonMode, 2);
- else
- HeaderCallButtonIconSig.StringValue = "Misc-09_Dark";
- //HeaderCallButton.SetIcon(HeaderListButton.Phone);
- //TriList.SetUshort(UIUshortJoin.CallHeaderButtonMode, 1);
+ SetHeaderCallIcon(codec);
// Set the call status text
+ Debug.Console(1, "Active Call Count: {0}", codec.ActiveCalls.Count);
+
if (codec.ActiveCalls.Count > 0)
{
- if (codec.ActiveCalls.Count == 1)
+ if (codec.ActiveCalls.Count == 1 && meetingInfoCodec == null)
TriList.SetString(UIStringJoin.HeaderCallStatusLabel, "1 Active Call");
+ else if (codec.ActiveCalls.Count == 1 && meetingInfoCodec != null)
+ {
+ var headerCallStatusLabel = meetingInfoCodec.MeetingInfo.IsSharingMeeting
+ ? "Sharing-Only Meeting"
+ : "Active Meeting";
+
+ headerCallStatusLabel = meetingInfoCodec.MeetingInfo.WaitingForHost
+ ? "Waiting For Host"
+ : headerCallStatusLabel;
+
+ TriList.SetString(UIStringJoin.HeaderCallStatusLabel, headerCallStatusLabel);
+ }
else if (codec.ActiveCalls.Count > 1)
TriList.SetString(UIStringJoin.HeaderCallStatusLabel, string.Format("{0} Active Calls", codec.ActiveCalls.Count));
}
@@ -218,10 +223,31 @@ namespace PepperDash.Essentials
TriList.SetString(UIStringJoin.HeaderCallStatusLabel, "No Active Calls");
}
+ private void SetHeaderCallIcon(VideoCodecBase codec)
+ {
+ if (!codec.IsInCall)
+ {
+ HeaderCallButtonIconSig.StringValue = "DND";
+ //HeaderCallButton.SetIcon(HeaderListButton.OnHook);
+ }
+ else if (codec.ActiveCalls.Any(c => c.Type == eCodecCallType.Video))
+ {
+ HeaderCallButtonIconSig.StringValue = "Misc-06_Dark";
+ }
+ //HeaderCallButton.SetIcon(HeaderListButton.Camera);
+ //TriList.SetUshort(UIUshortJoin.CallHeaderButtonMode, 2);
+ else
+ {
+ HeaderCallButtonIconSig.StringValue = "Misc-09_Dark";
+ }
+ //HeaderCallButton.SetIcon(HeaderListButton.Phone);
+ //TriList.SetUshort(UIUshortJoin.CallHeaderButtonMode, 1);
+ }
+
///
/// Sets up Header Buttons for the EssentialsHuddleVtc1Room type
///
- public void SetupHeaderButtons(EssentialsHuddleVtc1PanelAvFunctionsDriver avDriver, EssentialsHuddleVtc1Room currentRoom)
+ public void SetupHeaderButtons(EssentialsHuddleVtc1PanelAvFunctionsDriver avDriver, IEssentialsHuddleVtc1Room currentRoom)
{
HeaderButtonsAreSetUp = false;
@@ -255,7 +281,7 @@ namespace PepperDash.Essentials
TriList.SetSigFalseAction(UIBoolJoin.HeaderCallStatusLabelPress,
() =>
{
- avDriver.ShowActiveCallsList();
+ avDriver.ShowActiveCallsListOrMeetingInfo();
if (avDriver.CurrentRoom.InCallFeedback.BoolValue)
CaretInterlock.ShowInterlocked(CallCaretVisible);
});
@@ -283,7 +309,7 @@ namespace PepperDash.Essentials
///
/// Sets up Header Buttons for the EssentialsHuddleSpaceRoom type
///
- public void SetupHeaderButtons(EssentialsHuddlePanelAvFunctionsDriver avDriver, EssentialsHuddleSpaceRoom currentRoom)
+ public void SetupHeaderButtons(EssentialsHuddlePanelAvFunctionsDriver avDriver, IEssentialsHuddleSpaceRoom currentRoom)
{
HeaderButtonsAreSetUp = false;
@@ -353,6 +379,8 @@ namespace PepperDash.Essentials
headerPopupShown = true;
else if (e.NewJoin == UIBoolJoin.HeaderActiveCallsListVisible)
headerPopupShown = true;
+ else if (e.NewJoin == UIBoolJoin.HeaderMeetingInfoVisible)
+ headerPopupShown = true;
else if (e.NewJoin == UIBoolJoin.HelpPageVisible)
headerPopupShown = true;
else if (e.NewJoin == UIBoolJoin.MeetingsOrContacMethodsListVisible)
diff --git a/PepperDashEssentials/UIDrivers/Essentials/EssentialsPanelMainInterfaceDriver.cs b/PepperDashEssentials/UIDrivers/Essentials/EssentialsPanelMainInterfaceDriver.cs
index 9b92fc41..2b787063 100644
--- a/PepperDashEssentials/UIDrivers/Essentials/EssentialsPanelMainInterfaceDriver.cs
+++ b/PepperDashEssentials/UIDrivers/Essentials/EssentialsPanelMainInterfaceDriver.cs
@@ -11,7 +11,7 @@ namespace PepperDash.Essentials
///
///
///
- public class EssentialsPanelMainInterfaceDriver : PanelDriverBase, IHasScreenSaverController
+ public class EssentialsPanelMainInterfaceDriver : PanelDriverBase, IHasScreenSaverController, IDisposable
{
CTimer InactivityTimer;
@@ -69,6 +69,35 @@ namespace PepperDash.Essentials
}
}
+ #region IDisposable Members
+
+ public void Dispose()
+ {
+ var avDriver = AvDriver as PanelDriverBase;
+ if (avDriver != null)
+ {
+ avDriver.Hide();
+ }
+ if (ScreenSaverController != null)
+ {
+ ScreenSaverController.Dispose();
+ }
+ if (HeaderDriver != null)
+ {
+ HeaderDriver.Hide();
+ }
+ if (EnvironmentDriver != null)
+ {
+ EnvironmentDriver.Hide();
+ }
+ if (CurrentChildDriver != null)
+ {
+ CurrentChildDriver.Hide();
+ }
+ }
+
+ #endregion
+
void ExtenderTouchDetectionReservedSigs_DeviceExtenderSigChange(Crestron.SimplSharpPro.DeviceExtender currentDeviceExtender, Crestron.SimplSharpPro.SigEventArgs args)
{
@@ -130,7 +159,7 @@ namespace PepperDash.Essentials
if(CurrentChildDriver != null)
CurrentChildDriver.BackButtonPressed();
}
- }
+ }
public interface IHasScreenSaverController
{
diff --git a/PepperDashEssentials/UIDrivers/Essentials/EssentialsPresentationPanelAvFunctionsDriver.cs b/PepperDashEssentials/UIDrivers/Essentials/EssentialsPresentationPanelAvFunctionsDriver.cs
index 4a8cb53c..9c8514ea 100644
--- a/PepperDashEssentials/UIDrivers/Essentials/EssentialsPresentationPanelAvFunctionsDriver.cs
+++ b/PepperDashEssentials/UIDrivers/Essentials/EssentialsPresentationPanelAvFunctionsDriver.cs
@@ -983,7 +983,7 @@
// ///
// /// Handles source change
// ///
-// void _CurrentRoom_SourceInfoChange(EssentialsRoomBase room,
+// void _CurrentRoom_SourceInfoChange(IEssentialsRoom room,
// SourceListItem info, ChangeType change)
// {
// if (change == ChangeType.WillChange)
@@ -995,7 +995,7 @@
// ///
// ///
// ///
-// void _CurrentRoom_CurrentDisplay1SourceChange(EssentialsRoomBase room, SourceListItem info, ChangeType type)
+// void _CurrentRoom_CurrentDisplay1SourceChange(IEssentialsRoom room, SourceListItem info, ChangeType type)
// {
// if (type == ChangeType.DidChange)
// {
@@ -1021,7 +1021,7 @@
// ///
// ///
// ///
-// void _CurrentRoom_CurrentDisplay2SourceChange(EssentialsRoomBase room, SourceListItem info, ChangeType type)
+// void _CurrentRoom_CurrentDisplay2SourceChange(IEssentialsRoom room, SourceListItem info, ChangeType type)
// {
// if (type == ChangeType.DidChange)
// {
diff --git a/PepperDashEssentials/UIDrivers/EssentialsHuddle/EssentialsHuddlePanelAvFunctionsDriver.cs b/PepperDashEssentials/UIDrivers/EssentialsHuddle/EssentialsHuddlePanelAvFunctionsDriver.cs
index f22565e5..e58172de 100644
--- a/PepperDashEssentials/UIDrivers/EssentialsHuddle/EssentialsHuddlePanelAvFunctionsDriver.cs
+++ b/PepperDashEssentials/UIDrivers/EssentialsHuddle/EssentialsHuddlePanelAvFunctionsDriver.cs
@@ -78,7 +78,7 @@ namespace PepperDash.Essentials
///
///
///
- public EssentialsHuddleSpaceRoom CurrentRoom
+ public IEssentialsHuddleSpaceRoom CurrentRoom
{
get { return _CurrentRoom; }
set
@@ -86,7 +86,7 @@ namespace PepperDash.Essentials
SetCurrentRoom(value);
}
}
- EssentialsHuddleSpaceRoom _CurrentRoom;
+ IEssentialsHuddleSpaceRoom _CurrentRoom;
///
///
@@ -306,7 +306,7 @@ namespace PepperDash.Essentials
TriList.SetSigFalseAction(UIBoolJoin.DisplayPowerTogglePress, () =>
{
- if (CurrentRoom != null && CurrentRoom.DefaultDisplay is IHasPowerControl)
+ if (CurrentRoom != null && CurrentRoom.DefaultDisplay != null && CurrentRoom.DefaultDisplay is IHasPowerControl)
(CurrentRoom.DefaultDisplay as IHasPowerControl).PowerToggle();
});
@@ -498,7 +498,7 @@ namespace PepperDash.Essentials
TriList.BooleanInput[UIBoolJoin.SelectASourceVisible].BoolValue = true;
// Run default source when room is off and share is pressed
if (!CurrentRoom.OnFeedback.BoolValue)
- CurrentRoom.RunDefaultPresentRoute();
+ (CurrentRoom as IRunDefaultPresentRoute).RunDefaultPresentRoute();
}
@@ -583,7 +583,7 @@ namespace PepperDash.Essentials
void UiSelectSource(string key)
{
// Run the route and when it calls back, show the source
- CurrentRoom.RunRouteAction(key, new Action(() => { }));
+ CurrentRoom.RunRouteAction(key);
}
///
@@ -745,7 +745,7 @@ namespace PepperDash.Essentials
///
/// Helper for property setter. Sets the panel to the given room, latching up all functionality
///
- public void RefreshCurrentRoom(EssentialsHuddleSpaceRoom room)
+ public void RefreshCurrentRoom(IEssentialsHuddleSpaceRoom room)
{
if (_CurrentRoom != null)
{
@@ -836,7 +836,7 @@ namespace PepperDash.Essentials
}
}
- void SetCurrentRoom(EssentialsHuddleSpaceRoom room)
+ void SetCurrentRoom(IEssentialsHuddleSpaceRoom room)
{
if (_CurrentRoom == room) return;
// Disconnect current (probably never called)
@@ -871,7 +871,7 @@ namespace PepperDash.Essentials
UpdateMCJoins(_CurrentRoom);
}
- void UpdateMCJoins(EssentialsHuddleSpaceRoom room)
+ void UpdateMCJoins(IEssentialsHuddleSpaceRoom room)
{
TriList.SetString(UIStringJoin.RoomMcUrl, room.MobileControlRoomBridge.McServerUrl);
TriList.SetString(UIStringJoin.RoomMcQrCodeUrl, room.MobileControlRoomBridge.QrCodeUrl);
@@ -918,6 +918,7 @@ namespace PepperDash.Essentials
TriList.BooleanInput[StartPageVisibleJoin].BoolValue = true;
TriList.BooleanInput[UIBoolJoin.VolumeSingleMute1Visible].BoolValue = false;
TriList.BooleanInput[UIBoolJoin.SourceStagingBarVisible].BoolValue = false;
+ TriList.BooleanInput[UIBoolJoin.SelectASourceVisible].BoolValue = false;
}
}
diff --git a/PepperDashEssentials/UIDrivers/EssentialsHuddle/EssentialsHuddleTechPageDriver.cs b/PepperDashEssentials/UIDrivers/EssentialsHuddle/EssentialsHuddleTechPageDriver.cs
index b8e1dfd6..57aed03e 100644
--- a/PepperDashEssentials/UIDrivers/EssentialsHuddle/EssentialsHuddleTechPageDriver.cs
+++ b/PepperDashEssentials/UIDrivers/EssentialsHuddle/EssentialsHuddleTechPageDriver.cs
@@ -8,7 +8,7 @@ using Crestron.SimplSharpPro.DeviceSupport;
using PepperDash.Core;
using PepperDash.Essentials;
-using PepperDash.Essentials.Core;
+using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Config;
using PepperDash.Essentials.Core.SmartObjects;
using PepperDash.Essentials.Core.Touchpanels.Keyboards;
@@ -316,7 +316,7 @@ namespace PepperDash.Essentials.UIDrivers
void CommunicationMonitor_StatusChange(object sender, MonitorStatusChangeEventArgs e)
{
var c = sender as ICommunicationMonitor;
- if (StatusListDeviceIndexes.ContainsKey(c))
+ if (c != null && StatusListDeviceIndexes.ContainsKey(c))
{
var i = StatusListDeviceIndexes[c];
StatusList.UShortInputSig(i, 1).UShortValue = (ushort)e.Status;
diff --git a/PepperDashEssentials/UIDrivers/EssentialsHuddleVTC/EssentialsHuddleVtc1PanelAvFunctionsDriver.cs b/PepperDashEssentials/UIDrivers/EssentialsHuddleVTC/EssentialsHuddleVtc1PanelAvFunctionsDriver.cs
index a4e88e7e..44091362 100644
--- a/PepperDashEssentials/UIDrivers/EssentialsHuddleVTC/EssentialsHuddleVtc1PanelAvFunctionsDriver.cs
+++ b/PepperDashEssentials/UIDrivers/EssentialsHuddleVTC/EssentialsHuddleVtc1PanelAvFunctionsDriver.cs
@@ -1,6 +1,7 @@
using System;
using System.Linq;
using System.Collections.Generic;
+using System.Globalization;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.UI;
@@ -8,11 +9,13 @@ using Crestron.SimplSharpPro.UI;
using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Config;
+using PepperDash.Essentials.Core.DeviceTypeInterfaces;
using PepperDash.Essentials.Core.SmartObjects;
using PepperDash.Essentials.Core.PageManagers;
using PepperDash.Essentials.Room.Config;
using PepperDash.Essentials.Devices.Common.Codec;
using PepperDash.Essentials.Devices.Common.VideoCodec;
+using PepperDash.Essentials.Devices.Common.VideoCodec.Interfaces;
namespace PepperDash.Essentials
{
@@ -50,7 +53,7 @@ namespace PepperDash.Essentials
///
///
///
- public EssentialsHuddleVtc1Room CurrentRoom
+ public IEssentialsHuddleVtc1Room CurrentRoom
{
get { return _CurrentRoom; }
set
@@ -58,7 +61,7 @@ namespace PepperDash.Essentials
SetCurrentRoom(value);
}
}
- EssentialsHuddleVtc1Room _CurrentRoom;
+ IEssentialsHuddleVtc1Room _CurrentRoom;
///
/// For hitting feedbacks
@@ -98,6 +101,9 @@ namespace PepperDash.Essentials
///
public SubpageReferenceList MeetingOrContactMethodModalSrl { get; set; }
+ public uint CallListOrMeetingInfoPopoverVisibilityJoin { get; private set; }
+
+
///
/// The list of buttons on the header. Managed with visibility only
///
@@ -173,10 +179,38 @@ namespace PepperDash.Essentials
///
public PepperDash.Essentials.Core.Touchpanels.Keyboards.HabaneroKeyboardController Keyboard { get; private set; }
+
+ private UiDisplayMode _currentMode;
+
+ private bool _isZoomRoomWithNoExternalSources
+ {
+ get
+ {
+ return CurrentRoom.VideoCodec is Essentials.Devices.Common.VideoCodec.ZoomRoom.ZoomRoom && _sourceListCount <= 1;
+ }
+ }
+
+ private uint _sourceListCount;
+
///
/// The mode showing. Presentation or call.
///
- UiDisplayMode CurrentMode = UiDisplayMode.Start;
+ UiDisplayMode CurrentMode
+ {
+ get
+ {
+ return _currentMode;
+ }
+ set
+ {
+ if (value != _currentMode)
+ {
+ _currentMode = value;
+
+ SetActivityFooterFeedbacks();
+ }
+ }
+ }
CTimer NextMeetingTimer;
@@ -207,6 +241,7 @@ namespace PepperDash.Essentials
MeetingOrContactMethodModalSrl = new SubpageReferenceList(TriList, UISmartObjectJoin.MeetingListSRL, 3, 3, 5);
+ CurrentMode = UiDisplayMode.Start;
// buttons are added in SetCurrentRoom
//HeaderButtonsList = new SmartObjectHeaderButtonList(TriList.SmartObjects[UISmartObjectJoin.HeaderButtonList]);
@@ -319,7 +354,7 @@ namespace PepperDash.Essentials
TriList.SetSigFalseAction(UIBoolJoin.DisplayPowerTogglePress, () =>
{
- if (CurrentRoom != null && CurrentRoom.DefaultDisplay is IHasPowerControl)
+ if (CurrentRoom != null && CurrentRoom.DefaultDisplay != null && CurrentRoom.DefaultDisplay is IHasPowerControl)
(CurrentRoom.DefaultDisplay as IHasPowerControl).PowerToggle();
});
@@ -331,15 +366,17 @@ namespace PepperDash.Essentials
///
/// Allows PopupInterlock to be toggled if the calls list is already visible, or if the codec is in a call
///
- public void ShowActiveCallsList()
+ public void ShowActiveCallsListOrMeetingInfo()
{
TriList.SetBool(UIBoolJoin.CallEndAllConfirmVisible, true);
- if(PopupInterlock.CurrentJoin == UIBoolJoin.HeaderActiveCallsListVisible)
- PopupInterlock.ShowInterlockedWithToggle(UIBoolJoin.HeaderActiveCallsListVisible);
+
+
+ if(PopupInterlock.CurrentJoin == CallListOrMeetingInfoPopoverVisibilityJoin)
+ PopupInterlock.ShowInterlockedWithToggle(CallListOrMeetingInfoPopoverVisibilityJoin);
else
{
- if((CurrentRoom.ScheduleSource as VideoCodecBase).IsInCall)
- PopupInterlock.ShowInterlockedWithToggle(UIBoolJoin.HeaderActiveCallsListVisible);
+ if(CurrentRoom.VideoCodec.IsInCall)
+ PopupInterlock.ShowInterlockedWithToggle(CallListOrMeetingInfoPopoverVisibilityJoin);
}
}
@@ -435,79 +472,92 @@ namespace PepperDash.Essentials
///
void ShowNextMeetingTimerCallback()
{
+ //Update calendar for Zoom. Zoom doesn't automatically update when meetings are in the past
+ if (_isZoomRoomWithNoExternalSources)
+ {
+ CurrentRoom.ScheduleSource.GetSchedule();
+ }
+
// Every 60 seconds, refresh the calendar
RefreshMeetingsList();
// check meetings list for the closest, joinable meeting
var ss = CurrentRoom.ScheduleSource;
var meetings = ss.CodecSchedule.Meetings;
- if (meetings.Count > 0)
- {
- // If the room is off pester the user
- // If the room is on, and the meeting is joinable
- // and the LastMeetingDismissed != this meeting
+ if (meetings.Count <= 0)
+ {
+ return;
+ }
+ // If the room is off pester the user
+ // If the room is on, and the meeting is joinable
+ // and the LastMeetingDismissed != this meeting
- var lastMeetingDismissed = meetings.FirstOrDefault(m => m.Id == LastMeetingDismissedId);
- Debug.Console(0, "*#* Room on: {0}, lastMeetingDismissedId: {1} {2} *#*",
- CurrentRoom.OnFeedback.BoolValue,
- LastMeetingDismissedId,
- lastMeetingDismissed != null ? lastMeetingDismissed.StartTime.ToShortTimeString() : "");
+ var lastMeetingDismissed = meetings.FirstOrDefault(m => m.Id == LastMeetingDismissedId);
+ Debug.Console(0, "*#* Room on: {0}, lastMeetingDismissedId: {1} {2} *#*",
+ CurrentRoom.OnFeedback.BoolValue,
+ LastMeetingDismissedId,
+ lastMeetingDismissed != null ? lastMeetingDismissed.StartTime.ToString("t", Global.Culture) : "");
- var meeting = meetings.LastOrDefault(m => m.Joinable);
- if (CurrentRoom.OnFeedback.BoolValue
- && lastMeetingDismissed == meeting)
- {
- return;
- }
+ var meeting = meetings.LastOrDefault(m => m.Joinable);
+ if (CurrentRoom.OnFeedback.BoolValue
+ && lastMeetingDismissed == meeting)
+ {
+ // meeting no longer joinable, hide popup
+ if(meeting == null)
+ HideNextMeetingPopup();
- LastMeetingDismissedId = null;
- // Clear the popup when we run out of meetings
- if (meeting == null)
- {
- HideNextMeetingPopup();
- }
- else
- {
- TriList.SetString(UIStringJoin.MeetingsOrContactMethodListTitleText, "Upcoming meeting");
- TriList.SetString(UIStringJoin.NextMeetingStartTimeText, meeting.StartTime.ToShortTimeString());
- TriList.SetString(UIStringJoin.NextMeetingEndTimeText, meeting.EndTime.ToShortTimeString());
- TriList.SetString(UIStringJoin.NextMeetingTitleText, meeting.Title);
- TriList.SetString(UIStringJoin.NextMeetingNameText, meeting.Organizer);
- TriList.SetString(UIStringJoin.NextMeetingButtonLabel, "Join");
- TriList.SetSigFalseAction(UIBoolJoin.NextMeetingJoinPress, () =>
- {
- HideNextMeetingPopup();
- PopupInterlock.Hide();
- RoomOnAndDialMeeting(meeting);
- });
- TriList.SetString(UIStringJoin.NextMeetingSecondaryButtonLabel, "Show Schedule");
- TriList.SetSigFalseAction(UIBoolJoin.CalendarHeaderButtonPress, () =>
- {
- HideNextMeetingPopup();
- //CalendarPress();
- RefreshMeetingsList();
- PopupInterlock.ShowInterlocked(UIBoolJoin.MeetingsOrContacMethodsListVisible);
- });
- var indexOfNext = meetings.IndexOf(meeting) + 1;
+ return;
+ }
- // indexOf = 3, 4 meetings :
- if (indexOfNext < meetings.Count)
- TriList.SetString(UIStringJoin.NextMeetingFollowingMeetingText,
- meetings[indexOfNext].StartTime.ToShortTimeString());
- else
- TriList.SetString(UIStringJoin.NextMeetingFollowingMeetingText, "No more meetings today");
+ LastMeetingDismissedId = null;
+ // Clear the popup when we run out of meetings
+ if (meeting == null)
+ {
+ HideNextMeetingPopup();
+ }
+ else
+ {
- TriList.SetSigFalseAction(UIBoolJoin.NextMeetingModalClosePress, () =>
- {
- // Mark the meeting to not re-harass the user
- if(CurrentRoom.OnFeedback.BoolValue)
- LastMeetingDismissedId = meeting.Id;
- HideNextMeetingPopup();
- });
- TriList.SetBool(UIBoolJoin.NextMeetingModalVisible, true);
- }
- }
+ TriList.SetString(UIStringJoin.MeetingsOrContactMethodListTitleText, "Upcoming meeting");
+ TriList.SetString(UIStringJoin.NextMeetingStartTimeText, meeting.StartTime.ToString("t", Global.Culture));
+ TriList.SetString(UIStringJoin.NextMeetingEndTimeText, meeting.EndTime.ToString("t", Global.Culture));
+ TriList.SetString(UIStringJoin.NextMeetingTitleText, meeting.Title);
+ TriList.SetString(UIStringJoin.NextMeetingNameText, meeting.Organizer);
+ TriList.SetString(UIStringJoin.NextMeetingButtonLabel, "Join");
+ TriList.SetSigFalseAction(UIBoolJoin.NextMeetingJoinPress, () =>
+ {
+ HideNextMeetingPopup();
+ PopupInterlock.Hide();
+ RoomOnAndDialMeeting(meeting);
+ });
+ TriList.SetString(UIStringJoin.NextMeetingSecondaryButtonLabel, "Show Schedule");
+ TriList.SetSigFalseAction(UIBoolJoin.CalendarHeaderButtonPress, () =>
+ {
+ HideNextMeetingPopup();
+ //CalendarPress();
+ RefreshMeetingsList();
+ PopupInterlock.ShowInterlocked(UIBoolJoin.MeetingsOrContacMethodsListVisible);
+ });
+ var indexOfNext = meetings.IndexOf(meeting) + 1;
+
+ // indexOf = 3, 4 meetings :
+ if (indexOfNext < meetings.Count)
+ TriList.SetString(UIStringJoin.NextMeetingFollowingMeetingText,
+ meetings[indexOfNext].StartTime.ToString("t", Global.Culture));
+ else
+ TriList.SetString(UIStringJoin.NextMeetingFollowingMeetingText, "No more meetings today");
+
+ TriList.SetSigFalseAction(UIBoolJoin.NextMeetingModalClosePress, () =>
+ {
+ // Mark the meeting to not re-harass the user
+ if(CurrentRoom.OnFeedback.BoolValue)
+ LastMeetingDismissedId = meeting.Id;
+ HideNextMeetingPopup();
+ });
+
+ TriList.SetBool(UIBoolJoin.NextMeetingModalVisible, true);
+ }
}
///
@@ -533,19 +583,26 @@ namespace PepperDash.Essentials
///
void RoomOnAndDialMeeting(Meeting meeting)
{
+ Debug.Console(1, "[RoomOnAndDialMeeting] Joining meeting [{0}]", meeting);
Action dialAction = () =>
{
var d = CurrentRoom.ScheduleSource as VideoCodecBase;
if (d != null)
{
+ Debug.Console(1,
+ "[RoomOnAndDialMeeting] [dialAction] Sending command to codec to join meeting {0}", meeting);
d.Dial(meeting);
LastMeetingDismissedId = meeting.Id; // To prevent prompts for already-joined call
}
};
- if (CurrentRoom.OnFeedback.BoolValue)
- dialAction();
+ if (CurrentRoom.OnFeedback.BoolValue)
+ {
+ Debug.Console(1, "[RoomOnAndDialMeeting] Room is on.");
+ dialAction();
+ }
else
- {
+ {
+ Debug.Console(1, "RoomOnAndDialMeeting] Room is off or warming. Registering for Warming Feedback");
// Rig a one-time handler to catch when the room is warmed and then dial call
EventHandler oneTimeHandler = null;
oneTimeHandler = (o, a) =>
@@ -607,11 +664,39 @@ namespace PepperDash.Essentials
///
void SetActivityFooterFeedbacks()
{
- CallButtonSig.BoolValue = CurrentMode == UiDisplayMode.Call
- && CurrentRoom.ShutdownType == eShutdownType.None;
- ShareButtonSig.BoolValue = CurrentMode == UiDisplayMode.Presentation
- && CurrentRoom.ShutdownType == eShutdownType.None;
- EndMeetingButtonSig.BoolValue = CurrentRoom.ShutdownType != eShutdownType.None;
+ if (CurrentRoom != null)
+ {
+ var startMode = CurrentMode == UiDisplayMode.Start;
+ var presentationMode = CurrentMode == UiDisplayMode.Presentation;
+ var callMode = CurrentMode == UiDisplayMode.Call;
+
+ TriList.SetBool(StartPageVisibleJoin, startMode ? true : false);
+
+ if (presentationMode &&_isZoomRoomWithNoExternalSources)
+ {
+ // For now, if this is a Zoom Room and there are no shareable sources just display the informational subpage
+ TriList.SetBool(UIBoolJoin.SourceStagingBarVisible, false);
+ TriList.SetBool(UIBoolJoin.ZoomRoomContentSharingVisible, true);
+ }
+ else
+ {
+ // Otherwise, show the staging bar
+ TriList.SetBool(UIBoolJoin.ZoomRoomContentSharingVisible, false);
+ TriList.SetBool(UIBoolJoin.SourceStagingBarVisible, presentationMode ? true : false);
+
+ }
+ if (!presentationMode)
+ {
+ TriList.SetBool(UIBoolJoin.ZoomRoomContentSharingVisible, false);
+ TriList.SetBool(UIBoolJoin.SelectASourceVisible, false);
+ }
+
+ CallButtonSig.BoolValue = callMode
+ && CurrentRoom.ShutdownType == eShutdownType.None;
+ ShareButtonSig.BoolValue = presentationMode
+ && CurrentRoom.ShutdownType == eShutdownType.None;
+ EndMeetingButtonSig.BoolValue = CurrentRoom.ShutdownType != eShutdownType.None;
+ }
}
///
@@ -623,14 +708,13 @@ namespace PepperDash.Essentials
return;
HideLogo();
HideNextMeetingPopup();
- TriList.SetBool(StartPageVisibleJoin, false);
- TriList.SetBool(UIBoolJoin.SourceStagingBarVisible, false);
- TriList.SetBool(UIBoolJoin.SelectASourceVisible, false);
+ //TriList.SetBool(StartPageVisibleJoin, false);
+ //TriList.SetBool(UIBoolJoin.SourceStagingBarVisible, false);
+ //TriList.SetBool(UIBoolJoin.SelectASourceVisible, false);
if (CurrentSourcePageManager != null)
CurrentSourcePageManager.Hide();
PowerOnFromCall();
CurrentMode = UiDisplayMode.Call;
- SetActivityFooterFeedbacks();
VCDriver.Show();
}
@@ -643,29 +727,63 @@ namespace PepperDash.Essentials
if (VCDriver.IsVisible)
VCDriver.Hide();
HideNextMeetingPopup();
- TriList.SetBool(StartPageVisibleJoin, false);
- TriList.SetBool(UIBoolJoin.CallStagingBarVisible, false);
- TriList.SetBool(UIBoolJoin.SourceStagingBarVisible, true);
- // Run default source when room is off and share is pressed
- if (!CurrentRoom.OnFeedback.BoolValue)
- {
- if (!CurrentRoom.OnFeedback.BoolValue)
- {
- // If there's no default, show UI elements
- if (!CurrentRoom.RunDefaultPresentRoute())
- TriList.SetBool(UIBoolJoin.SelectASourceVisible, true);
- }
- }
- else // room is on show what's active or select a source if nothing is yet active
+
+
+ if (_isZoomRoomWithNoExternalSources)
{
- if(CurrentRoom.CurrentSourceInfo == null || CurrentRoom.CurrentSourceInfoKey == CurrentRoom.DefaultCodecRouteString)
- TriList.SetBool(UIBoolJoin.SelectASourceVisible, true);
- else if (CurrentSourcePageManager != null)
- CurrentSourcePageManager.Show();
+ if (!CurrentRoom.OnFeedback.BoolValue)
+ {
+ CurrentRoom.RunDefaultPresentRoute();
+ }
+ // For now, if this is a Zoom Room and there are no shareable sources just display the informational subpage
+ TriList.SetBool(UIBoolJoin.ZoomRoomContentSharingVisible, true);
+
+ var presentationMeetingCodec = CurrentRoom.VideoCodec as IHasPresentationOnlyMeeting;
+ var farEndContentStatusCodec = CurrentRoom.VideoCodec as IHasFarEndContentStatus;
+ var receivingContent = false;
+
+ if (farEndContentStatusCodec != null)
+ {
+ receivingContent = farEndContentStatusCodec.ReceivingContent.BoolValue;
+ }
+
+ if (presentationMeetingCodec != null && !CurrentRoom.VideoCodec.IsInCall)
+ {
+ presentationMeetingCodec.StartSharingOnlyMeeting(eSharingMeetingMode.Laptop);
+ }
+ else if (CurrentRoom.VideoCodec.IsInCall && !CurrentRoom.VideoCodec.SharingContentIsOnFeedback.BoolValue &&
+ !receivingContent)
+ {
+ CurrentRoom.VideoCodec.StartSharing();
+ }
+
+ if (CurrentSourcePageManager != null)
+ CurrentSourcePageManager.Hide();
+ }
+ else
+ {
+ // Run default source when room is off and share is pressed
+ if (!CurrentRoom.OnFeedback.BoolValue)
+ {
+ // If there's no default, show UI elements
+ if (!(CurrentRoom as IRunDefaultPresentRoute).RunDefaultPresentRoute())
+ TriList.SetBool(UIBoolJoin.SelectASourceVisible, true);
+ }
+ else // room is on show what's active or select a source if nothing is yet active
+ {
+ if (CurrentRoom.CurrentSourceInfo == null ||
+ (CurrentRoom.VideoCodec != null &&
+ CurrentRoom.CurrentSourceInfo.SourceDevice.Key == CurrentRoom.VideoCodec.OsdSource.Key))
+ TriList.SetBool(UIBoolJoin.SelectASourceVisible, true);
+ else if (CurrentSourcePageManager != null)
+ {
+ TriList.SetBool(UIBoolJoin.SelectASourceVisible, false);
+ CurrentSourcePageManager.Show();
+ }
+ }
+ SetupSourceList();
}
CurrentMode = UiDisplayMode.Presentation;
- SetupSourceList();
- SetActivityFooterFeedbacks();
}
///
@@ -704,9 +822,11 @@ namespace PepperDash.Essentials
///
void ShowCurrentSource()
{
- if (CurrentRoom.CurrentSourceInfo == null)
+ if (CurrentRoom.CurrentSourceInfo == null || _isZoomRoomWithNoExternalSources)
return;
+ CurrentMode = UiDisplayMode.Presentation;
+
if (CurrentRoom.CurrentSourceInfo.SourceDevice == null)
{
TriList.SetBool(UIBoolJoin.SelectASourceVisible, true);
@@ -743,7 +863,7 @@ namespace PepperDash.Essentials
void UiSelectSource(string key)
{
// Run the route and when it calls back, show the source
- CurrentRoom.RunRouteAction(key, new Action(() => { }));
+ CurrentRoom.RunRouteAction(key);
}
///
@@ -894,7 +1014,7 @@ namespace PepperDash.Essentials
///
/// Helper for property setter. Sets the panel to the given room, latching up all functionality
///
- void RefreshCurrentRoom(EssentialsHuddleVtc1Room room)
+ void RefreshCurrentRoom(IEssentialsHuddleVtc1Room room)
{
if (_CurrentRoom != null)
@@ -912,6 +1032,18 @@ namespace PepperDash.Essentials
_CurrentRoom.IsWarmingUpFeedback.OutputChange -= CurrentRoom_IsWarmingFeedback_OutputChange;
_CurrentRoom.IsCoolingDownFeedback.OutputChange -= CurrentRoom_IsCoolingDownFeedback_OutputChange;
_CurrentRoom.InCallFeedback.OutputChange -= CurrentRoom_InCallFeedback_OutputChange;
+
+ var scheduleAwareCodec = _CurrentRoom.VideoCodec as IHasScheduleAwareness;
+ if (scheduleAwareCodec != null)
+ {
+ scheduleAwareCodec.CodecSchedule.MeetingsListHasChanged -= CodecSchedule_MeetingsListHasChanged;
+ }
+
+ var meetingInfoCodec = _CurrentRoom.VideoCodec as IHasMeetingInfo;
+ if (meetingInfoCodec != null)
+ {
+ meetingInfoCodec.MeetingInfoChanged -= meetingInfoCodec_MeetingInfoChanged;
+ }
}
_CurrentRoom = room;
@@ -944,9 +1076,23 @@ namespace PepperDash.Essentials
_CurrentRoom.CurrentSourceChange += CurrentRoom_SourceInfoChange;
RefreshSourceInfo();
- if (_CurrentRoom.VideoCodec is IHasScheduleAwareness)
+
+ var scheduleAwareCodec = _CurrentRoom.VideoCodec as IHasScheduleAwareness;
+ if (scheduleAwareCodec != null)
{
- (_CurrentRoom.VideoCodec as IHasScheduleAwareness).CodecSchedule.MeetingsListHasChanged += CodecSchedule_MeetingsListHasChanged;
+ scheduleAwareCodec.CodecSchedule.MeetingsListHasChanged += CodecSchedule_MeetingsListHasChanged;
+ }
+
+ var meetingInfoCodec = _CurrentRoom.VideoCodec as IHasMeetingInfo;
+ if (meetingInfoCodec != null)
+ {
+ meetingInfoCodec.MeetingInfoChanged += new EventHandler(meetingInfoCodec_MeetingInfoChanged);
+
+ CallListOrMeetingInfoPopoverVisibilityJoin = UIBoolJoin.HeaderMeetingInfoVisible;
+ }
+ else
+ {
+ CallListOrMeetingInfoPopoverVisibilityJoin = UIBoolJoin.HeaderActiveCallsListVisible;
}
CallSharingInfoVisibleFeedback = new BoolFeedback(() => _CurrentRoom.VideoCodec.SharingContentIsOnFeedback.BoolValue);
@@ -958,7 +1104,8 @@ namespace PepperDash.Essentials
if (_CurrentRoom != null)
_CurrentRoom.CurrentSourceChange += new SourceInfoChangeHandler(CurrentRoom_CurrentSingleSourceChange);
- TriList.SetSigFalseAction(UIBoolJoin.CallStopSharingPress, () => _CurrentRoom.RunRouteAction("codecOsd", _CurrentRoom.SourceListKey));
+ // Moved to EssentialsVideoCodecUiDriver
+ //TriList.SetSigFalseAction(UIBoolJoin.CallStopSharingPress, () => _CurrentRoom.RunRouteAction("codecOsd", _CurrentRoom.SourceListKey));
(Parent as EssentialsPanelMainInterfaceDriver).HeaderDriver.SetupHeaderButtons(this, CurrentRoom);
}
@@ -969,7 +1116,27 @@ namespace PepperDash.Essentials
}
}
- void SetCurrentRoom(EssentialsHuddleVtc1Room room)
+ void meetingInfoCodec_MeetingInfoChanged(object sender, MeetingInfoEventArgs e)
+ {
+ if (e.Info == null)
+ {
+ return;
+ }
+
+ TriList.SetString(UIStringJoin.MeetingIdText, e.Info.Id);
+ TriList.SetString(UIStringJoin.MeetingHostText, e.Info.Host);
+ TriList.SetString(UIStringJoin.MeetingNameText, e.Info.Name);
+
+ TriList.SetString(UIStringJoin.MeetingPasswordText, e.Info.Password);
+ // Show the password fields if one is present
+ TriList.SetBool(UIBoolJoin.MeetingPasswordVisible, !string.IsNullOrEmpty(e.Info.Password));
+
+ TriList.SetString(UIStringJoin.CallSharedSourceNameText, e.Info.ShareStatus);
+
+ TriList.SetString(UIStringJoin.MeetingLeaveText, e.Info.IsHost ? "End Meeting" : "Leave Meeting");
+ }
+
+ void SetCurrentRoom(IEssentialsHuddleVtc1Room room)
{
if (_CurrentRoom == room) return;
// Disconnect current (probably never called)
@@ -1004,7 +1171,7 @@ namespace PepperDash.Essentials
UpdateMCJoins(_CurrentRoom);
}
- void UpdateMCJoins(EssentialsHuddleVtc1Room room)
+ void UpdateMCJoins(IEssentialsHuddleVtc1Room room)
{
TriList.SetString(UIStringJoin.RoomMcUrl, room.MobileControlRoomBridge.McServerUrl);
TriList.SetString(UIStringJoin.RoomMcQrCodeUrl, room.MobileControlRoomBridge.QrCodeUrl);
@@ -1035,7 +1202,7 @@ namespace PepperDash.Essentials
if (CurrentRoom.CurrentSourceInfo != null && CurrentRoom.CurrentSourceInfo.DisableCodecSharing)
{
Debug.Console(1, CurrentRoom, "Transitioning to in-call, cancelling non-sharable source");
- CurrentRoom.RunRouteAction("codecOsd", CurrentRoom.SourceListKey);
+ CurrentRoom.RunRouteAction("codecOsd");
}
}
@@ -1082,7 +1249,8 @@ namespace PepperDash.Essentials
Debug.Console(1, "**** KEY {0}", kvp.Key);
}
- SourceStagingSrl.Count = (ushort)(i - 1);
+ _sourceListCount = (i - 1);
+ SourceStagingSrl.Count = (ushort)_sourceListCount;
}
}
@@ -1105,6 +1273,30 @@ namespace PepperDash.Essentials
///
void CurrentRoom_CurrentSingleSourceChange(SourceListItem info, ChangeType type)
{
+ Debug.Console(1, "AvFunctionsDriver: CurrentSingleSourceChange");
+
+ // Show the Select a source subpage
+ if (TriList.BooleanInput[UIBoolJoin.SourceStagingBarVisible].BoolValue)
+ {
+ Debug.Console(1, "AvFunctionsDriver: CurrentSingleSourceChange SourceStagingBarVisisble: true");
+
+ if (_CurrentRoom.CurrentSourceInfo == null || (_CurrentRoom.VideoCodec != null && _CurrentRoom.CurrentSourceInfo.SourceDevice.Key == _CurrentRoom.VideoCodec.OsdSource.Key))
+ {
+ Debug.Console(1, "AvFunctionsDriver: CurrentSingleSourceChange Showing SelectASourceVisible");
+ TriList.SetBool(UIBoolJoin.SelectASourceVisible, true);
+ }
+ else
+ {
+ TriList.SetBool(UIBoolJoin.SelectASourceVisible, false);
+ Debug.Console(1, "AvFunctionsDriver: CurrentSingleSourceChange Hiding SelectASourceVisible");
+ }
+ }
+ else
+ {
+ Debug.Console(1, "AvFunctionsDriver: CurrentSingleSourceChange Hiding SelectASourceVisible");
+ TriList.SetBool(UIBoolJoin.SelectASourceVisible, false);
+ }
+
if (_CurrentRoom.VideoCodec.SharingContentIsOnFeedback.BoolValue && _CurrentRoom.CurrentSourceInfo != null)
TriList.StringInput[UIStringJoin.CallSharedSourceNameText].StringValue = _CurrentRoom.CurrentSourceInfo.PreferredName;
}
@@ -1147,17 +1339,16 @@ namespace PepperDash.Essentials
{
// See if this is helpful or if the callback response in the codec class maybe doesn't come it time?
// Let's build list from event
- // CurrentRoom.ScheduleSource.GetSchedule();
- TriList.SetString(UIStringJoin.MeetingsOrContactMethodListIcon, "Calendar");
+ TriList.SetString(UIStringJoin.MeetingsOrContactMethodListIcon, "Calendar");
TriList.SetString(UIStringJoin.MeetingsOrContactMethodListTitleText, "Today's Meetings");
ushort i = 0;
foreach (var m in CurrentRoom.ScheduleSource.CodecSchedule.Meetings)
{
i++;
- MeetingOrContactMethodModalSrl.StringInputSig(i, 1).StringValue = m.StartTime.ToShortTimeString();
- MeetingOrContactMethodModalSrl.StringInputSig(i, 2).StringValue = m.EndTime.ToShortTimeString();
+ MeetingOrContactMethodModalSrl.StringInputSig(i, 1).StringValue = m.StartTime.ToString("t", Global.Culture);
+ MeetingOrContactMethodModalSrl.StringInputSig(i, 2).StringValue = m.EndTime.ToString("t", Global.Culture);
MeetingOrContactMethodModalSrl.StringInputSig(i, 3).StringValue = m.Title;
MeetingOrContactMethodModalSrl.StringInputSig(i, 4).StringValue = string.Format("
{0}",m.Organizer);
MeetingOrContactMethodModalSrl.StringInputSig(i, 5).StringValue = "Join";
@@ -1202,12 +1393,12 @@ namespace PepperDash.Essentials
var value = _CurrentRoom.OnFeedback.BoolValue;
TriList.BooleanInput[UIBoolJoin.RoomIsOn].BoolValue = value;
- TriList.BooleanInput[StartPageVisibleJoin].BoolValue = !value;
+ //TriList.BooleanInput[StartPageVisibleJoin].BoolValue = !value;
if (value) //ON
{
SetupActivityFooterWhenRoomOn();
- TriList.BooleanInput[UIBoolJoin.SelectASourceVisible].BoolValue = false;
+ //TriList.BooleanInput[UIBoolJoin.SelectASourceVisible].BoolValue = false;
TriList.BooleanInput[UIBoolJoin.VolumeDualMute1Visible].BoolValue = true;
}
@@ -1218,9 +1409,8 @@ namespace PepperDash.Essentials
VCDriver.Hide();
SetupActivityFooterWhenRoomOff();
ShowLogo();
- SetActivityFooterFeedbacks();
- TriList.BooleanInput[UIBoolJoin.VolumeDualMute1Visible].BoolValue = false;
- TriList.BooleanInput[UIBoolJoin.SourceStagingBarVisible].BoolValue = false;
+ //TriList.BooleanInput[UIBoolJoin.VolumeDualMute1Visible].BoolValue = false;
+ //TriList.BooleanInput[UIBoolJoin.SourceStagingBarVisible].BoolValue = false;
// Clear this so that the pesky meeting warning can resurface every minute when off
LastMeetingDismissedId = null;
}
@@ -1443,7 +1633,7 @@ namespace PepperDash.Essentials
///
public interface IAVWithVCDriver : IAVDriver
{
- EssentialsHuddleVtc1Room CurrentRoom { get; }
+ IEssentialsHuddleVtc1Room CurrentRoom { get; }
PepperDash.Essentials.Core.Touchpanels.Keyboards.HabaneroKeyboardController Keyboard { get; }
///
@@ -1455,6 +1645,8 @@ namespace PepperDash.Essentials
///
void PrepareForCodecIncomingCall();
+ uint CallListOrMeetingInfoPopoverVisibilityJoin { get; }
+
SubpageReferenceList MeetingOrContactMethodModalSrl { get; }
}
}
diff --git a/PepperDashEssentials/UIDrivers/ScreenSaverController.cs b/PepperDashEssentials/UIDrivers/ScreenSaverController.cs
index e6d60d5b..0f75e2a2 100644
--- a/PepperDashEssentials/UIDrivers/ScreenSaverController.cs
+++ b/PepperDashEssentials/UIDrivers/ScreenSaverController.cs
@@ -12,7 +12,7 @@ namespace PepperDash.Essentials
///
/// Driver responsible for controlling the screenshaver showing the client logo, MC connection information and QR Code. Moves the elements around to prevent screen burn in
///
- public class ScreenSaverController : PanelDriverBase
+ public class ScreenSaverController : PanelDriverBase, IDisposable
{
///
@@ -42,7 +42,7 @@ namespace PepperDash.Essentials
PositionInterlock = new JoinedSigInterlock(parent.TriList);
- var cmdName = String.Format("shwscrsvr-{0}", parent.TriList.ID);
+ var cmdName = String.Format("shwscrsvr-{0:X2}", parent.TriList.ID);
CrestronConsole.AddNewConsoleCommand((o) => Show(), cmdName, "Shows Panel Screensaver", ConsoleAccessLevelEnum.AccessOperator);
@@ -51,6 +51,8 @@ namespace PepperDash.Essentials
public override void Show()
{
+ Debug.Console(2, "Showing ScreenSaverController: {0:X2}", TriList.ID);
+
if (_parent.AvDriver != null)
{
_parent.AvDriver.PopupInterlock.ShowInterlocked(UIBoolJoin.MCScreenSaverVisible);
@@ -65,10 +67,11 @@ namespace PepperDash.Essentials
public override void Hide()
{
- Debug.Console(1, "Hiding ScreenSaverController");
+ Debug.Console(2, "Hiding ScreenSaverController: {0:X2}", TriList.ID);
if (PositionTimer != null)
{
+ Debug.Console(2, "Stopping PositionTimer: {0:X2}", TriList.ID);
PositionTimer.Stop();
PositionTimer.Dispose();
PositionTimer = null;
@@ -86,6 +89,8 @@ namespace PepperDash.Essentials
void StartPositionTimer()
{
+ Debug.Console(2, "Starting Position Timer: {0:X2}", TriList.ID);
+
if (PositionTimer == null)
{
PositionTimer = new CTimer((o) => PositionTimerExpired(), PositionTimeoutMs);
@@ -117,7 +122,7 @@ namespace PepperDash.Essentials
CurrentPositionIndex = 0;
}
- Debug.Console(1, "ScreenSaver Position Timer Expired: Setting new position: {0}", CurrentPositionIndex);
+ Debug.Console(2, "ScreenSaver Position Timer Expired: Setting new position: {0} ID: {1:X2}", CurrentPositionIndex, TriList.ID);
}
//
@@ -129,9 +134,19 @@ namespace PepperDash.Essentials
void ClearAllPositions()
{
- Debug.Console(1, "Hiding all screensaver positions");
+ Debug.Console(2, "Hiding all screensaver positions: {0:X2}", TriList.ID);
+
PositionInterlock.HideAndClear();
}
+
+ #region IDisposable Members
+
+ public void Dispose()
+ {
+ Hide();
+ }
+
+ #endregion
}
}
\ No newline at end of file
diff --git a/PepperDashEssentials/UIDrivers/SmartObjectRoomsList.cs b/PepperDashEssentials/UIDrivers/SmartObjectRoomsList.cs
index e43abc09..2543e664 100644
--- a/PepperDashEssentials/UIDrivers/SmartObjectRoomsList.cs
+++ b/PepperDashEssentials/UIDrivers/SmartObjectRoomsList.cs
@@ -38,7 +38,7 @@ namespace PepperDash.Essentials
///
/// Sets feedback for the given room
///
- public void SetFeedbackForRoom(EssentialsHuddleSpaceRoom room)
+ public void SetFeedbackForRoom(IEssentialsHuddleSpaceRoom room)
{
var itemToSet = Items.FirstOrDefault(i => i.Room == room);
if (itemToSet != null)
@@ -48,11 +48,11 @@ namespace PepperDash.Essentials
public class SmartObjectRoomsListItem
{
- public EssentialsHuddleSpaceRoom Room { get; private set; }
+ public IEssentialsHuddleSpaceRoom Room { get; private set; }
SmartObjectRoomsList Parent;
public uint Index { get; private set; }
- public SmartObjectRoomsListItem(EssentialsHuddleSpaceRoom room, uint index, SmartObjectRoomsList parent,
+ public SmartObjectRoomsListItem(IEssentialsHuddleSpaceRoom room, uint index, SmartObjectRoomsList parent,
Action buttonAction)
{
Room = room;
diff --git a/PepperDashEssentials/UIDrivers/SourceChangeArgs.cs b/PepperDashEssentials/UIDrivers/SourceChangeArgs.cs
index c777c08e..5c034084 100644
--- a/PepperDashEssentials/UIDrivers/SourceChangeArgs.cs
+++ b/PepperDashEssentials/UIDrivers/SourceChangeArgs.cs
@@ -12,5 +12,5 @@ namespace PepperDash.Essentials
/////
///// The handler type for a Room's SourceInfoChange
/////
- //public delegate void SourceInfoChangeHandler(EssentialsRoomBase room, SourceListItem info, ChangeType type);
+ //public delegate void SourceInfoChangeHandler(IEssentialsRoom room, SourceListItem info, ChangeType type);
}
\ No newline at end of file
diff --git a/PepperDashEssentials/UIDrivers/VC/EssentialsVideoCodecUiDriver.cs b/PepperDashEssentials/UIDrivers/VC/EssentialsVideoCodecUiDriver.cs
index 5642d757..40671238 100644
--- a/PepperDashEssentials/UIDrivers/VC/EssentialsVideoCodecUiDriver.cs
+++ b/PepperDashEssentials/UIDrivers/VC/EssentialsVideoCodecUiDriver.cs
@@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Text;
+using System.Globalization;
using System.Text.RegularExpressions;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro;
@@ -14,6 +15,7 @@ using PepperDash.Essentials.Core.SmartObjects;
using PepperDash.Essentials.Core.Touchpanels.Keyboards;
using PepperDash.Essentials.Devices.Common.Codec;
using PepperDash.Essentials.Devices.Common.VideoCodec;
+using PepperDash.Essentials.Devices.Common.VideoCodec.Interfaces;
using PepperDash.Essentials.Devices.Common.Cameras;
namespace PepperDash.Essentials.UIDrivers.VC
@@ -83,6 +85,9 @@ namespace PepperDash.Essentials.UIDrivers.VC
StringBuilder SearchStringBuilder = new StringBuilder();
BoolFeedback SearchStringBackspaceVisibleFeedback;
+ StringFeedback PasswordStringFeedback;
+ StringBuilder PasswordStringBuilder = new StringBuilder();
+
ModalDialog IncomingCallModal;
eKeypadMode KeypadMode;
@@ -123,26 +128,24 @@ namespace PepperDash.Essentials.UIDrivers.VC
codec.CallStatusChange += new EventHandler(Codec_CallStatusChange);
- // If the codec is ready, then get the values we want, otherwise wait
- if (Codec.IsReady)
- Codec_IsReady();
- else
- codec.IsReadyChange += (o, a) => Codec_IsReady();
-
//InCall = new BoolFeedback(() => false);
LocalPrivacyIsMuted = new BoolFeedback(() => false);
VCControlsInterlock = new JoinedSigInterlock(triList);
VCCameraControlModeInterlock = new JoinedSigInterlock(triList);
+ VCControlsInterlock.HideAndClear();
- if (CodecHasFavorites)
+ /* if (CodecHasFavorites || codec is IHasZoomRoomLayouts) //Checking for Zoom Room...picked a ZoomRoom specific interface to check for
VCControlsInterlock.SetButDontShow(UIBoolJoin.VCKeypadWithFavoritesVisible);
else
- VCControlsInterlock.SetButDontShow(UIBoolJoin.VCKeypadVisible);
+ VCControlsInterlock.SetButDontShow(UIBoolJoin.VCKeypadVisible); */
StagingBarsInterlock = new JoinedSigInterlock(triList);
- StagingBarsInterlock.SetButDontShow(UIBoolJoin.VCStagingInactivePopoverVisible);
+ if(Codec is IHasCallHistory)
+ StagingBarsInterlock.SetButDontShow(UIBoolJoin.VCStagingInactivePopoverWithRecentsVisible);
+ else
+ StagingBarsInterlock.SetButDontShow(UIBoolJoin.VCStagingInactivePopoverWithoutRecentsVisible);
StagingButtonsFeedbackInterlock = new JoinedSigInterlock(triList);
StagingButtonsFeedbackInterlock.ShowInterlocked(UIBoolJoin.VCStagingKeypadPress);
@@ -150,7 +153,8 @@ namespace PepperDash.Essentials.UIDrivers.VC
// Return formatted when dialing, straight digits when in call
DialStringFeedback = new StringFeedback(() =>
{
- if (KeypadMode == eKeypadMode.Dial)
+ // Format the number feedback if in dial mode and the codec is not IHasStartMeeting (ZoomRoom)
+ if (KeypadMode == eKeypadMode.Dial && !(Codec is IHasStartMeeting))
return GetFormattedDialString(DialStringBuilder.ToString());
else
return DialStringBuilder.ToString();
@@ -177,8 +181,22 @@ namespace PepperDash.Essentials.UIDrivers.VC
});
SearchStringFeedback.LinkInputSig(triList.StringInput[UIStringJoin.CodecDirectorySearchEntryText]);
- SetupDirectoryList();
+ PasswordStringFeedback = new StringFeedback(() =>
+ {
+ if (PasswordStringBuilder.Length > 0)
+ {
+ Parent.Keyboard.EnableGoButton();
+ return PasswordStringBuilder.ToString();
+ }
+ else
+ {
+ Parent.Keyboard.DisableGoButton();
+ return "";
+ }
+ });
+ PasswordStringFeedback.LinkInputSig(triList.StringInput[UIStringJoin.PasswordPromptPasswordText]);
+ SetupDirectoryList();
SearchStringBackspaceVisibleFeedback = new BoolFeedback(() => SearchStringBuilder.Length > 0);
SearchStringBackspaceVisibleFeedback.LinkInputSig(triList.BooleanInput[UIBoolJoin.VCDirectoryBackspaceVisible]);
@@ -196,6 +214,18 @@ namespace PepperDash.Essentials.UIDrivers.VC
triList.SetSigHeldAction(UIBoolJoin.VCDirectoryBackspacePress, 500,
StartSearchBackspaceRepeat, StopSearchBackspaceRepeat, SearchKeypadBackspacePress);
+
+ if (Codec is IPasswordPrompt)
+ {
+ SetupPasswordPrompt();
+ }
+
+
+ // If the codec is ready, then get the values we want, otherwise wait
+ if (Codec.IsReady)
+ Codec_IsReady();
+ else
+ codec.IsReadyChange += (o, a) => Codec_IsReady();
}
catch (Exception e)
{
@@ -291,24 +321,20 @@ namespace PepperDash.Essentials.UIDrivers.VC
void Codec_CallStatusChange(object sender, CodecCallStatusItemChangeEventArgs e)
{
var call = e.CallItem;
+ var meetingInfoSender = sender as IHasMeetingInfo;
switch (e.CallItem.Status)
{
case eCodecCallStatus.Connected:
// fire at SRL item
- KeypadMode = eKeypadMode.DTMF;
- DialStringBuilder.Remove(0, DialStringBuilder.Length);
- DialStringFeedback.FireUpdate();
- DialStringTextCheckEnables();
Parent.ShowNotificationRibbon("Connected", 2000);
- StagingButtonsFeedbackInterlock.ShowInterlocked(UIBoolJoin.VCStagingKeypadPress);
- ShowKeypad();
- ((Parent.CurrentRoom as IHasCurrentVolumeControls).CurrentVolumeControls as IBasicVolumeWithFeedback).MuteOff();
+ OnCallConnected();
//VCControlsInterlock.ShowInterlocked(UIBoolJoin.VCKeypadVisible);
break;
case eCodecCallStatus.Connecting:
// fire at SRL item
Parent.ShowNotificationRibbon("Connecting", 0);
+ OnCallConnected();
break;
case eCodecCallStatus.Dialing:
Parent.ShowNotificationRibbon("Connecting", 0);
@@ -324,7 +350,10 @@ namespace PepperDash.Essentials.UIDrivers.VC
DialStringBuilder.Remove(0, DialStringBuilder.Length);
DialStringFeedback.FireUpdate();
Parent.ShowNotificationRibbon("Disconnected", 2000);
+ Debug.Console(0, "Setting Connect Button mode to 0");
}
+
+
break;
case eCodecCallStatus.Disconnecting:
break;
@@ -345,16 +374,32 @@ namespace PepperDash.Essentials.UIDrivers.VC
ShowIncomingModal(call);
break;
}
- default:
- break;
}
- TriList.UShortInput[UIUshortJoin.VCStagingConnectButtonMode].UShortValue = (ushort)(Codec.IsInCall ? 1 : 0);
-
- uint stageJoin;
- if (Codec.IsInCall)
- stageJoin = UIBoolJoin.VCStagingActivePopoverVisible;
- else
- stageJoin = UIBoolJoin.VCStagingInactivePopoverVisible;
+
+ if (meetingInfoSender != null && Codec.IsInCall)
+ {
+ var meetingInfo = meetingInfoSender.MeetingInfo;
+
+ TriList.UShortInput[UIUshortJoin.VCStagingConnectButtonMode].UShortValue =
+ (ushort) (meetingInfo.IsSharingMeeting ? 2 : 1);
+ }
+ else
+ {
+
+ TriList.UShortInput[UIUshortJoin.VCStagingConnectButtonMode].UShortValue =
+ (ushort) (Codec.IsInCall ? 1 : 0);
+ }
+
+ uint stageJoin;
+ if (Codec.IsInCall)
+ stageJoin = UIBoolJoin.VCStagingActivePopoverVisible;
+ else
+ {
+ if (Codec is IHasCallHistory)
+ stageJoin = UIBoolJoin.VCStagingInactivePopoverWithRecentsVisible;
+ else
+ stageJoin = UIBoolJoin.VCStagingInactivePopoverWithoutRecentsVisible;
+ }
if (IsVisible)
StagingBarsInterlock.ShowInterlocked(stageJoin);
else
@@ -366,6 +411,36 @@ namespace PepperDash.Essentials.UIDrivers.VC
UpdateHeaderActiveCallList();
}
+ private void OnCallConnected()
+ {
+ HidePasswordPrompt();
+ KeypadMode = eKeypadMode.DTMF;
+ DialStringBuilder.Remove(0, DialStringBuilder.Length);
+ DialStringFeedback.FireUpdate();
+ DialStringTextCheckEnables();
+
+ StagingButtonsFeedbackInterlock.ShowInterlocked(UIBoolJoin.VCStagingKeypadPress);
+ ShowKeypad();
+
+ UnmuteRoomOnCallConnect();
+ }
+
+ private void UnmuteRoomOnCallConnect()
+ {
+ var volControl = Parent.CurrentRoom as IHasCurrentVolumeControls;
+
+ if (volControl == null)
+ {
+ return;
+ }
+ var currentVolControls = volControl.CurrentVolumeControls as IBasicVolumeWithFeedback;
+
+ if (currentVolControls != null)
+ {
+ currentVolControls.MuteOff();
+ }
+ }
+
///
/// Redraws the calls list on the header
///
@@ -389,8 +464,8 @@ namespace PepperDash.Essentials.UIDrivers.VC
ActiveCallsSRL.Count = (ushort)activeList.Count;
// If Active Calls list is visible and codec is not in a call, hide the list
- if (!Codec.IsInCall && Parent.PopupInterlock.CurrentJoin == UIBoolJoin.HeaderActiveCallsListVisible)
- Parent.PopupInterlock.ShowInterlockedWithToggle(UIBoolJoin.HeaderActiveCallsListVisible);
+ if (!Codec.IsInCall && Parent.PopupInterlock.CurrentJoin == Parent.CallListOrMeetingInfoPopoverVisibilityJoin)
+ Parent.PopupInterlock.ShowInterlockedWithToggle(Parent.CallListOrMeetingInfoPopoverVisibilityJoin);
}
///
@@ -481,20 +556,67 @@ namespace PepperDash.Essentials.UIDrivers.VC
TriList.SetSigFalseAction(UIBoolJoin.VCStagingRecentsPress, ShowRecents);
TriList.SetSigFalseAction(UIBoolJoin.VCStagingCameraPress, ShowCameraControls);
TriList.SetSigFalseAction(UIBoolJoin.VCStagingConnectPress, ConnectPress);
+ TriList.SetSigFalseAction(UIBoolJoin.VCStagingMeetNowPress, MeetNowPress);
+ TriList.SetSigFalseAction(UIBoolJoin.CallStopSharingPress, CallStopSharingPress);
+
+ var meetingInfoCodec = Codec as IHasMeetingInfo;
+
TriList.SetSigFalseAction(UIBoolJoin.CallEndPress, () =>
{
if (Codec.ActiveCalls.Count > 1)
{
- Parent.PopupInterlock.ShowInterlocked(UIBoolJoin.HeaderActiveCallsListVisible);
+ Parent.PopupInterlock.ShowInterlocked(Parent.CallListOrMeetingInfoPopoverVisibilityJoin);
+ }
+ else if (meetingInfoCodec != null && Codec.ActiveCalls.Count == 1)
+ {
+ var meetingInfo = meetingInfoCodec.MeetingInfo;
+
+ if (meetingInfo != null && meetingInfo.IsSharingMeeting)
+ {
+ var presentationMeetingCodec = Codec as IHasPresentationOnlyMeeting;
+ if (presentationMeetingCodec != null)
+ {
+ presentationMeetingCodec.StartNormalMeetingFromSharingOnlyMeeting();
+ }
+ }
+ else
+ {
+ Codec.EndAllCalls();
+ }
}
else
+ {
Codec.EndAllCalls();
+ }
});
+
TriList.SetSigFalseAction(UIBoolJoin.CallEndAllConfirmPress, () =>
{
Parent.PopupInterlock.HideAndClear();
Codec.EndAllCalls();
});
+
+
+ if (meetingInfoCodec != null)
+ {
+ TriList.SetSigFalseAction(UIBoolJoin.MeetingLeavePress, () =>
+ {
+ Parent.PopupInterlock.HideAndClear();
+
+ if (meetingInfoCodec.MeetingInfo.IsHost)
+ {
+ Codec.EndAllCalls();
+ }
+ else
+ {
+ var startMeetingCodec = Codec as IHasStartMeeting;
+ if (startMeetingCodec != null)
+ {
+ startMeetingCodec.LeaveMeeting();
+ }
+ }
+ });
+ }
}
void SetupCameraControls()
@@ -510,16 +632,21 @@ namespace PepperDash.Essentials.UIDrivers.VC
VCControlsInterlock.StatusChanged += new EventHandler(VCControlsInterlock_StatusChanged);
-
var codecOffCameras = Codec as IHasCameraOff;
+ var supportsCameraOffMode = Codec.SupportsCameraOff;
+
var codecAutoCameras = Codec as IHasCameraAutoMode;
- if (codecAutoCameras != null)
+ var supportsAutoCameraMode = Codec.SupportsCameraAutoMode;
+
+ if (codecAutoCameras != null && supportsAutoCameraMode)
{
+
CameraModeList.SetItemButtonAction(1,(b) => codecAutoCameras.CameraAutoModeOn());
TriList.SmartObjects[UISmartObjectJoin.VCCameraMode].BooleanInput["Item 1 Visible"].BoolValue = true;
codecAutoCameras.CameraAutoModeIsOnFeedback.LinkInputSig(CameraModeList.SmartObject.BooleanInput["Item 1 Selected"]);
+ codecAutoCameras.CameraAutoModeIsOnFeedback.LinkInputSig(TriList.BooleanInput[UIBoolJoin.VCCameraAutoModeIsOnFb]);
//TriList.SmartObjects[UISmartObjectJoin.VCCameraMode].BooleanOutput["Item 1 Pressed"].SetSigFalseAction(
//() => codecAutoCameras.CameraAutoModeOn());
@@ -545,6 +672,7 @@ namespace PepperDash.Essentials.UIDrivers.VC
}
};
+
}
// Manual button always visible
@@ -554,8 +682,9 @@ namespace PepperDash.Essentials.UIDrivers.VC
//TriList.SmartObjects[UISmartObjectJoin.VCCameraMode].BooleanOutput["Item 2 Pressed"].SetSigFalseAction(
// () => ShowCameraManualMode());
- if (codecOffCameras != null)
+ if (codecOffCameras != null && supportsCameraOffMode)
{
+
TriList.SmartObjects[UISmartObjectJoin.VCCameraMode].BooleanInput["Item 3 Visible"].BoolValue = true;
codecOffCameras.CameraIsOffFeedback.LinkInputSig(CameraModeList.SmartObject.BooleanInput["Item 3 Selected"]);
CameraModeList.SetItemButtonAction(3, (b) => codecOffCameras.CameraOff());
@@ -583,6 +712,7 @@ namespace PepperDash.Essentials.UIDrivers.VC
}
};
+
}
}
@@ -769,12 +899,14 @@ namespace PepperDash.Essentials.UIDrivers.VC
if (camerasCodec != null && camerasCodec.SelectedCamera != null)
{
-
+ Debug.Console(2, "Attempting to map camera actions to selected camera: '{0}'", camerasCodec.SelectedCamera.Key);
var dpad = CameraPtzPad;
var camera = camerasCodec.SelectedCamera as IHasCameraPtzControl;
if (camera != null)
{
+
+ Debug.Console(2, "Selected camera is IHasCameraPtzControl");
if (camerasCodec.SelectedCamera.CanTilt)
{
dpad.SigUp.SetBoolSigAction((b) =>
@@ -839,25 +971,46 @@ namespace PepperDash.Essentials.UIDrivers.VC
}
}
+ else
+ {
+ Debug.Console(2, "Selected Camera is not IHasCameraPtzControl. No controls to map");
+ }
+ }
+ else
+ {
+ Debug.Console(2, "Codec does not have cameras of selected camera is null");
}
}
// Determines if codec is in manual camera control mode and shows feedback
void ShowCameraManualMode()
{
+ Debug.Console(2, "ShowCameraManualMode");
+
var inManualMode = true;
var codecOffCameras = Codec as IHasCameraOff;
var codecAutoCameras = Codec as IHasCameraAutoMode;
+ var supportsAutoCameras = codecAutoCameras != null && Codec.SupportsCameraAutoMode;
+
if (codecOffCameras != null && codecOffCameras.CameraIsOffFeedback.BoolValue)
{
inManualMode = false;
+
+ var codecCameraMute = Codec as IHasCameraMute;
+
+ if (codecCameraMute != null)
+ {
+ codecCameraMute.CameraMuteOff();
+ inManualMode = true;
+
+ }
}
// Clear auto mode
- if (codecAutoCameras != null )
+ if (supportsAutoCameras)
{
if (codecAutoCameras.CameraAutoModeIsOnFeedback.BoolValue)
{
@@ -948,7 +1101,7 @@ namespace PepperDash.Essentials.UIDrivers.VC
// if it's today, show a simpler string
string timeText = null;
if (c.StartTime.Date == DateTime.Now.Date)
- timeText = c.StartTime.ToShortTimeString();
+ timeText = c.StartTime.ToString("t", Global.Culture);
else if (c.StartTime == DateTime.MinValue)
timeText = "";
else
@@ -1005,22 +1158,21 @@ namespace PepperDash.Essentials.UIDrivers.VC
void SetupDirectoryList()
{
var codec = Codec as IHasDirectory;
- if (codec != null)
- {
- DirectoryList = new SmartObjectDynamicList(TriList.SmartObjects[UISmartObjectJoin.VCDirectoryList],
- true, 1300);
- codec.DirectoryResultReturned += new EventHandler(dir_DirectoryResultReturned);
+ if (codec == null)
+ {
+ return;
+ }
- if (codec.PhonebookSyncState.InitialSyncComplete)
- SetCurrentDirectoryToRoot();
- else
- {
- codec.PhonebookSyncState.InitialSyncCompleted += new EventHandler(PhonebookSyncState_InitialSyncCompleted);
- }
+ DirectoryList = new SmartObjectDynamicList(TriList.SmartObjects[UISmartObjectJoin.VCDirectoryList],
+ true, 1300);
+ codec.DirectoryResultReturned += dir_DirectoryResultReturned;
- RefreshDirectory();
-
- }
+ if (codec.PhonebookSyncState.InitialSyncComplete)
+ SetCurrentDirectoryToRoot();
+ else
+ {
+ codec.PhonebookSyncState.InitialSyncCompleted += PhonebookSyncState_InitialSyncCompleted;
+ }
}
///
@@ -1028,11 +1180,15 @@ namespace PepperDash.Essentials.UIDrivers.VC
///
void SetCurrentDirectoryToRoot()
{
- (Codec as IHasDirectory).SetCurrentDirectoryToRoot();
+ var hasDirectory = Codec as IHasDirectory;
+ if (hasDirectory == null)
+ {
+ return;
+ }
+
+ hasDirectory.SetCurrentDirectoryToRoot();
SearchKeypadClear();
-
- RefreshDirectory();
}
///
@@ -1044,10 +1200,17 @@ namespace PepperDash.Essentials.UIDrivers.VC
{
var codec = Codec as IHasDirectory;
- SetCurrentDirectoryToRoot();
+ if (codec == null)
+ {
+ return;
+ }
- RefreshDirectory();
-
+ if (!codec.CurrentDirectoryResultIsNotDirectoryRoot.BoolValue)
+ {
+ return;
+ }
+
+ SetCurrentDirectoryToRoot();
}
///
@@ -1057,8 +1220,7 @@ namespace PepperDash.Essentials.UIDrivers.VC
///
void dir_DirectoryResultReturned(object sender, DirectoryEventArgs e)
{
-
- RefreshDirectory();
+ RefreshDirectory(e.Directory);
}
///
@@ -1087,16 +1249,27 @@ namespace PepperDash.Essentials.UIDrivers.VC
}
- ///
- ///
- ///
- ///
- void RefreshDirectory()
+ ///
+ ///
+ ///
+ void RefreshDirectory()
{
- if ((Codec as IHasDirectory).CurrentDirectoryResult.CurrentDirectoryResults.Count > 0)
+ var codec = Codec as IHasDirectory;
+
+ if (codec == null)
+ {
+ return;
+ }
+
+ RefreshDirectory(codec.CurrentDirectoryResult);
+ }
+
+ void RefreshDirectory(CodecDirectory directory)
+ {
+ if (directory.CurrentDirectoryResults.Count > 0)
{
ushort i = 0;
- foreach (var r in (Codec as IHasDirectory).CurrentDirectoryResult.CurrentDirectoryResults)
+ foreach (var r in directory.CurrentDirectoryResults)
{
if (i == DirectoryList.MaxCount)
{
@@ -1116,19 +1289,33 @@ namespace PepperDash.Essentials.UIDrivers.VC
// If more than one contact method, show contact method modal dialog
DirectoryList.SetItemButtonAction(i, b =>
{
- if (!b)
+ if (b)
{
- // Refresh the contact methods list
- RefreshContactMethodsModalList(dc);
- Parent.PopupInterlock.ShowInterlockedWithToggle(UIBoolJoin.MeetingsOrContacMethodsListVisible);
+ return;
}
+ // Refresh the contact methods list
+ RefreshContactMethodsModalList(dc);
+ Parent.PopupInterlock.ShowInterlockedWithToggle(UIBoolJoin.MeetingsOrContacMethodsListVisible);
});
}
+ else if (dc.ContactMethods.Count == 1)
+ {
+ var invitableContact = dc as IInvitableContact;
+
+ if (invitableContact != null)
+ {
+ DirectoryList.SetItemButtonAction(i, b => { if (!b) Codec.Dial(invitableContact); });
+ }
+ else
+ {
+ // If only one contact method, just dial that method
+ DirectoryList.SetItemButtonAction(i, b => { if (!b) Codec.Dial(dc.ContactMethods[0].Number); });
+ }
+ }
else
{
- // If only one contact method, just dial that method
- DirectoryList.SetItemButtonAction(i, b => { if (!b) Codec.Dial(dc.ContactMethods[0].Number); });
+ Debug.Console(1, "Unable to dial contact. No availble ContactMethod(s) specified");
}
}
else // is DirectoryFolder
@@ -1155,8 +1342,7 @@ namespace PepperDash.Essentials.UIDrivers.VC
DirectoryList.SetItemMainText(1, "No Results Found");
}
-
- }
+ }
void RefreshContactMethodsModalList(DirectoryContact contact)
{
@@ -1201,7 +1387,7 @@ namespace PepperDash.Essentials.UIDrivers.VC
var lc = Codec as IHasCodecLayouts;
if (lc != null)
{
- TriList.SetSigFalseAction(UIBoolJoin.VCLayoutTogglePress, lc.LocalLayoutToggleSingleProminent);
+
lc.LocalLayoutFeedback.LinkInputSig(TriList.StringInput[UIStringJoin.VCLayoutModeText]);
lc.LocalLayoutFeedback.OutputChange += (o,a) =>
{
@@ -1214,14 +1400,24 @@ namespace PepperDash.Essentials.UIDrivers.VC
var cisco = Codec as PepperDash.Essentials.Devices.Common.VideoCodec.Cisco.CiscoSparkCodec;
if (cisco != null)
{
+ TriList.SetSigFalseAction(UIBoolJoin.VCLayoutTogglePress, lc.LocalLayoutToggleSingleProminent);
// Cisco has min/max buttons that need special sauce
cisco.SharingContentIsOnFeedback.OutputChange += CiscoSharingAndPresentation_OutputChanges;
//cisco.PresentationViewMaximizedFeedback.OutputChange += CiscoSharingAndPresentation_OutputChanges;
TriList.SetSigFalseAction(UIBoolJoin.VCMinMaxPress, cisco.MinMaxLayoutToggle);
}
+
+ var zoomRoom = Codec as PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom.ZoomRoom;
+ if (zoomRoom != null)
+ {
+ TriList.BooleanInput[UIBoolJoin.VCLayoutToggleEnable].BoolValue = true;
+ TriList.SetSigFalseAction(UIBoolJoin.VCLayoutTogglePress, lc.LocalLayoutToggle);
+ }
}
+
+
}
///
@@ -1249,7 +1445,21 @@ namespace PepperDash.Essentials.UIDrivers.VC
///
void RevealKeyboard()
{
- if (VCControlsInterlock.CurrentJoin == UIBoolJoin.VCKeypadWithFavoritesVisible && KeypadMode == eKeypadMode.Dial)
+ if (_passwordPromptDialogVisible)
+ {
+ Debug.Console(2, "Attaching Keyboard to PasswordPromptDialog");
+ DetachDialKeyboard();
+ DetachSearchKeyboard();
+ var kb = Parent.Keyboard;
+ kb.KeyPress -= Keyboard_PasswordKeyPress;
+ kb.KeyPress += Keyboard_PasswordKeyPress;
+ kb.HideAction = this.DetachPasswordKeyboard;
+ kb.GoButtonText = "Submit";
+ kb.GoButtonVisible = true;
+ PasswordStringCheckEnables();
+ kb.Show();
+ }
+ else if (VCControlsInterlock.CurrentJoin == UIBoolJoin.VCKeypadWithFavoritesVisible && KeypadMode == eKeypadMode.Dial)
{
var kb = Parent.Keyboard;
kb.KeyPress -= Keyboard_DialKeyPress;
@@ -1271,6 +1481,7 @@ namespace PepperDash.Essentials.UIDrivers.VC
SearchStringKeypadCheckEnables();
kb.Show();
}
+
}
///
@@ -1326,6 +1537,32 @@ namespace PepperDash.Essentials.UIDrivers.VC
}
}
+ ///
+ /// Event handler for keyboard dialing
+ ///
+ void Keyboard_PasswordKeyPress(object sender, PepperDash.Essentials.Core.Touchpanels.Keyboards.KeyboardControllerPressEventArgs e)
+ {
+ if (_passwordPromptDialogVisible)
+ {
+ if (e.Text != null)
+ PasswordStringBuilder.Append(e.Text);
+ else
+ {
+ if (e.SpecialKey == KeyboardSpecialKey.Backspace)
+ PasswordKeypadBackspacePress();
+ else if (e.SpecialKey == KeyboardSpecialKey.Clear)
+ PasswordKeypadClear();
+ else if (e.SpecialKey == KeyboardSpecialKey.GoButton)
+ {
+ (Codec as IPasswordPrompt).SubmitPassword(PasswordStringBuilder.ToString());
+ HidePasswordPrompt();
+ }
+ }
+ PasswordStringFeedback.FireUpdate();
+ PasswordStringCheckEnables();
+ }
+ }
+
///
/// Call
///
@@ -1339,6 +1576,11 @@ namespace PepperDash.Essentials.UIDrivers.VC
Parent.Keyboard.KeyPress -= Keyboard_SearchKeyPress;
}
+ void DetachPasswordKeyboard()
+ {
+ Parent.Keyboard.KeyPress -= Keyboard_PasswordKeyPress;
+ }
+
///
/// Shows the camera controls subpage
///
@@ -1416,6 +1658,22 @@ namespace PepperDash.Essentials.UIDrivers.VC
StagingButtonsFeedbackInterlock.ShowInterlocked(UIBoolJoin.VCStagingRecentsPress);
}
+ ///
+ /// Meet Now button
+ ///
+ void MeetNowPress()
+ {
+ var startMeetingCodec = Codec as IHasStartMeeting;
+ if (startMeetingCodec != null)
+ {
+ startMeetingCodec.StartMeeting(startMeetingCodec.DefaultMeetingDurationMin);
+ }
+ else
+ {
+ Debug.Console(2, "Codce does not implment IHasStartMeeting. Cannot meet now");
+ }
+ }
+
///
/// Connect call button
///
@@ -1426,6 +1684,16 @@ namespace PepperDash.Essentials.UIDrivers.VC
Codec.Dial(DialStringBuilder.ToString());
}
+ ///
+ /// Stop Sharing button
+ ///
+ void CallStopSharingPress()
+ {
+ Codec.StopSharing();
+ Parent.CurrentRoom.RunRouteAction("codecOsd", Parent.CurrentRoom.SourceListKey);
+ }
+
+
///
///
///
@@ -1592,6 +1860,40 @@ namespace PepperDash.Essentials.UIDrivers.VC
Parent.Keyboard.DisableGoButton();
}
+ ///
+ /// Clears the Password keypad
+ ///
+ void PasswordKeypadClear()
+ {
+ PasswordStringBuilder.Remove(0, PasswordStringBuilder.Length);
+ PasswordStringFeedback.FireUpdate();
+ PasswordStringCheckEnables();
+
+ }
+
+ ///
+ ///
+ ///
+ void PasswordKeypadBackspacePress()
+ {
+ PasswordStringBuilder.Remove(PasswordStringBuilder.Length - 1, 1);
+
+ PasswordStringFeedback.FireUpdate();
+ PasswordStringCheckEnables();
+ }
+
+ ///
+ /// Checks the enabled states of various elements around the keypad
+ ///
+ void PasswordStringCheckEnables()
+ {
+ var textIsEntered = PasswordStringBuilder.Length > 0;
+ if (textIsEntered)
+ Parent.Keyboard.EnableGoButton();
+ else
+ Parent.Keyboard.DisableGoButton();
+ }
+
///
/// Returns the text value for the keypad dial entry field
@@ -1637,5 +1939,62 @@ namespace PepperDash.Essentials.UIDrivers.VC
Dial = 0,
DTMF
}
+
+ void SetupPasswordPrompt()
+ {
+ var passwordPromptCodec = Codec as IPasswordPrompt;
+
+ passwordPromptCodec.PasswordRequired += new EventHandler(passwordPromptCodec_PasswordRequired);
+
+ TriList.SetSigFalseAction(UIBoolJoin.PasswordPromptCancelPress, HidePasswordPrompt);
+ TriList.SetSigFalseAction(UIBoolJoin.PasswordPromptTextPress, RevealKeyboard);
+ }
+
+ void passwordPromptCodec_PasswordRequired(object sender, PasswordPromptEventArgs e)
+ {
+ if (e.LoginAttemptCancelled)
+ {
+ HidePasswordPrompt();
+ return;
+ }
+
+ if (!string.IsNullOrEmpty(e.Message))
+ {
+ TriList.SetString(UIStringJoin.PasswordPromptMessageText, e.Message);
+ }
+
+ if (e.LoginAttemptFailed)
+ {
+ // TODO: Show a message modal to indicate the login attempt failed
+ return;
+ }
+
+ TriList.SetBool(UIBoolJoin.PasswordPromptErrorVisible, e.LastAttemptWasIncorrect);
+
+ ShowPasswordPrompt();
+ }
+
+ private bool _passwordPromptDialogVisible;
+
+ void ShowPasswordPrompt()
+ {
+ // Clear out any previous data
+ PasswordKeypadClear();
+
+ _passwordPromptDialogVisible = true;
+ TriList.SetBool(UIBoolJoin.PasswordPromptDialogVisible, _passwordPromptDialogVisible);
+ RevealKeyboard();
+ }
+
+ void HidePasswordPrompt()
+ {
+ if (_passwordPromptDialogVisible)
+ {
+ _passwordPromptDialogVisible = false;
+ Parent.Keyboard.Hide();
+ TriList.SetBool(UIBoolJoin.PasswordPromptDialogVisible, _passwordPromptDialogVisible);
+ PasswordKeypadClear();
+ }
+ }
}
}
\ No newline at end of file
diff --git a/README.md b/README.md
index efb706c0..0fe4f075 100644
--- a/README.md
+++ b/README.md
@@ -54,6 +54,10 @@ Utilization of Essentials Framework falls into the following categories:
For detailed documentation, see the [Wiki](https://github.com/PepperDash/EssentialsFramework/wiki).
+## Support
+
+* Check out our [Discord Server](https://discord.gg/rWyeRH3K)
+
## How-To (Getting Started)
See [Getting Started](https://github.com/PepperDash/Essentials/wiki/Get-started#how-to-get-started)
diff --git a/devjson commands.json b/devjson commands.json
index 62e675d1..c7ed7291 100644
--- a/devjson commands.json
+++ b/devjson commands.json
@@ -42,3 +42,6 @@ devjson:2 {"deviceKey":"display01Comm-com", "methodName":"SendText", "params": [
devjson:10 {"deviceKey":"dmLink-ssh", "methodName":"Connect", "params": []}
+devjson:2 {"deviceKey":"roomCombiner", "methodName":"SetRoomCombinationScenario", "params": ["combined"]}
+
+devjson:2 {"deviceKey":"roomCombiner", "methodName":"SetRoomCombinationScenario", "params": ["divided"]}
\ No newline at end of file
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/BridgeBase.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/BridgeBase.cs
index 151b5461..a1326770 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/BridgeBase.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/BridgeBase.cs
@@ -78,7 +78,7 @@ namespace PepperDash.Essentials.Core.Bridges
///
/// Bridge API using EISC
///
- public class EiscApiAdvanced : BridgeApi
+ public class EiscApiAdvanced : BridgeApi, ICommunicationMonitor
{
public EiscApiPropertiesConfig PropertiesConfig { get; private set; }
@@ -98,13 +98,35 @@ namespace PepperDash.Essentials.Core.Bridges
Eisc.SigChange += Eisc_SigChange;
+ CommunicationMonitor = new CrestronGenericBaseCommunicationMonitor(this, Eisc, 120000, 300000);
+
AddPostActivationAction(LinkDevices);
+ AddPostActivationAction(LinkRooms);
+ AddPostActivationAction(RegisterEisc);
+ }
+
+ public override bool CustomActivate()
+ {
+ CommunicationMonitor.Start();
+ return base.CustomActivate();
+ }
+
+ public override bool Deactivate()
+ {
+ CommunicationMonitor.Stop();
+ return base.Deactivate();
}
private void LinkDevices()
{
Debug.Console(1, this, "Linking Devices...");
+ if (PropertiesConfig.Devices == null)
+ {
+ Debug.Console(1, this, Debug.ErrorLogLevel.Notice, "No devices linked to this bridge");
+ return;
+ }
+
foreach (var d in PropertiesConfig.Devices)
{
var device = DeviceManager.GetDeviceForKey(d.DeviceKey);
@@ -130,6 +152,14 @@ namespace PepperDash.Essentials.Core.Bridges
bridge.LinkToApi(Eisc, d.JoinStart, d.JoinMapKey, this);
}
}
+ }
+
+ private void RegisterEisc()
+ {
+ if (Eisc.Registered)
+ {
+ return;
+ }
var registerResult = Eisc.Register();
@@ -142,6 +172,31 @@ namespace PepperDash.Essentials.Core.Bridges
Debug.Console(1, this, Debug.ErrorLogLevel.Notice, "EISC registration successful");
}
+ public void LinkRooms()
+ {
+ Debug.Console(1, this, "Linking Rooms...");
+
+ if (PropertiesConfig.Rooms == null)
+ {
+ Debug.Console(1, this, Debug.ErrorLogLevel.Notice, "No rooms linked to this bridge.");
+ return;
+ }
+
+ foreach (var room in PropertiesConfig.Rooms)
+ {
+ var rm = DeviceManager.GetDeviceForKey(room.RoomKey) as IBridgeAdvanced;
+
+ if (rm == null)
+ {
+ Debug.Console(1, this, Debug.ErrorLogLevel.Notice,
+ "Room {0} does not implement IBridgeAdvanced. Skipping...", room.RoomKey);
+ continue;
+ }
+
+ rm.LinkToApi(Eisc, room.JoinStart, room.JoinMapKey, this);
+ }
+ }
+
///
/// Adds a join map
///
@@ -280,6 +335,12 @@ namespace PepperDash.Essentials.Core.Bridges
Debug.Console(2, this, "Error in Eisc_SigChange handler: {0}", e);
}
}
+
+ #region Implementation of ICommunicationMonitor
+
+ public StatusMonitorBase CommunicationMonitor { get; private set; }
+
+ #endregion
}
public class EiscApiPropertiesConfig
@@ -290,6 +351,9 @@ namespace PepperDash.Essentials.Core.Bridges
[JsonProperty("devices")]
public List Devices { get; set; }
+ [JsonProperty("rooms")]
+ public List Rooms { get; set; }
+
public class ApiDevicePropertiesConfig
{
@@ -303,13 +367,25 @@ namespace PepperDash.Essentials.Core.Bridges
public string JoinMapKey { get; set; }
}
+ public class ApiRoomPropertiesConfig
+ {
+ [JsonProperty("roomKey")]
+ public string RoomKey { get; set; }
+
+ [JsonProperty("joinStart")]
+ public uint JoinStart { get; set; }
+
+ [JsonProperty("joinMapKey")]
+ public string JoinMapKey { get; set; }
+ }
+
}
public class EiscApiAdvancedFactory : EssentialsDeviceFactory
{
public EiscApiAdvancedFactory()
{
- TypeNames = new List { "eiscapiadv", "eiscapiadvanced", "vceiscapiadv", "vceiscapiadvanced" };
+ TypeNames = new List { "eiscapiadv", "eiscapiadvanced", "eiscapiadvancedserver", "eiscapiadvancedclient", "vceiscapiadv", "vceiscapiadvanced" };
}
public override EssentialsDevice BuildDevice(DeviceConfig dc)
@@ -327,6 +403,16 @@ namespace PepperDash.Essentials.Core.Bridges
controlProperties.TcpSshProperties.Address, Global.ControlSystem);
return new EiscApiAdvanced(dc, eisc);
}
+ case "eiscapiadvancedserver":
+ {
+ var eisc = new EISCServer(controlProperties.IpIdInt, Global.ControlSystem);
+ return new EiscApiAdvanced(dc, eisc);
+ }
+ case "eiscapiadvancedclient":
+ {
+ var eisc = new EISCClient(controlProperties.IpIdInt, controlProperties.TcpSshProperties.Address, Global.ControlSystem);
+ return new EiscApiAdvanced(dc, eisc);
+ }
case "vceiscapiadv":
case "vceiscapiadvanced":
{
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/AppleTvJoinMap.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/AppleTvJoinMap.cs
index 070e8f61..478f4e29 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/AppleTvJoinMap.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/AppleTvJoinMap.cs
@@ -47,7 +47,7 @@ namespace PepperDash.Essentials.Core.Bridges
/// Join this join map will start at
/// Type of the child join map
public AppleTvJoinMap(uint joinStart, Type type) : base(joinStart, type)
- {
- }
+ {
+ }
}
}
\ No newline at end of file
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/CenOdtOccupancySensorBaseJoinMap.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/CenOdtOccupancySensorBaseJoinMap.cs
index 4e731f41..63684837 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/CenOdtOccupancySensorBaseJoinMap.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/CenOdtOccupancySensorBaseJoinMap.cs
@@ -46,6 +46,14 @@ namespace PepperDash.Essentials.Core.Bridges
public JoinDataComplete RawOccupancyUsFeedback = new JoinDataComplete(new JoinData { JoinNumber = 7, JoinSpan = 1 },
new JoinMetadata { Description = "Raw Occupancy Us Feedback", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
+ [JoinName("IdentityModeOn")]
+ public JoinDataComplete IdentityMode = new JoinDataComplete(new JoinData { JoinNumber = 8, JoinSpan = 1 },
+ new JoinMetadata { Description = "Enable Identity Mode", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("IdentityModeFeedback")]
+ public JoinDataComplete IdentityModeFeedback = new JoinDataComplete(new JoinData { JoinNumber = 8, JoinSpan = 1 },
+ new JoinMetadata { Description = "Identity Mode Feedback", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
+
[JoinName("EnableLedFlash")]
public JoinDataComplete EnableLedFlash = new JoinDataComplete(new JoinData { JoinNumber = 11, JoinSpan = 1 },
new JoinMetadata { Description = "Enable Led Flash", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/DmChassisControllerJoinMap.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/DmChassisControllerJoinMap.cs
index 54909d02..3582e6cf 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/DmChassisControllerJoinMap.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/DmChassisControllerJoinMap.cs
@@ -10,7 +10,7 @@ namespace PepperDash.Essentials.Core.Bridges
new JoinMetadata
{
Description = "DM Chassis enable audio breakaway routing",
- JoinCapabilities = eJoinCapabilities.ToSIMPL,
+ JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
@@ -20,7 +20,7 @@ namespace PepperDash.Essentials.Core.Bridges
new JoinMetadata
{
Description = "DM Chassis enable USB breakaway routing",
- JoinCapabilities = eJoinCapabilities.ToSIMPL,
+ JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
@@ -76,6 +76,18 @@ namespace PepperDash.Essentials.Core.Bridges
public JoinDataComplete HdcpSupportCapability = new JoinDataComplete(new JoinData { JoinNumber = 1201, JoinSpan = 32 },
new JoinMetadata { Description = "DM Chassis Input HDCP Support Capability", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Analog });
+ [JoinName("InputStreamCardState")]
+ public JoinDataComplete InputStreamCardState = new JoinDataComplete(new JoinData { JoinNumber = 1501, JoinSpan = 32 },
+ new JoinMetadata { Description = "DM Chassis Stream Input Start (1), Stop (2), Pause (3) with Feedback", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Analog });
+
+ [JoinName("OutputStreamCardState")]
+ public JoinDataComplete OutputStreamCardState = new JoinDataComplete(new JoinData { JoinNumber = 1601, JoinSpan = 32 },
+ new JoinMetadata { Description = "DM Chassis Stream Output Start (1), Stop (2), Pause (3) with Feedback", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Analog });
+
+ [JoinName("NoRouteName")]
+ public JoinDataComplete NoRouteName = new JoinDataComplete(new JoinData { JoinNumber = 100, JoinSpan = 1 },
+ new JoinMetadata { Description = "DM Chassis Input Name", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
+
[JoinName("InputNames")]
public JoinDataComplete InputNames = new JoinDataComplete(new JoinData { JoinNumber = 101, JoinSpan = 32 },
new JoinMetadata { Description = "DM Chassis Input Name", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
@@ -88,7 +100,7 @@ namespace PepperDash.Essentials.Core.Bridges
new JoinDataComplete(new JoinData {JoinNumber = 501, JoinSpan = 200},
new JoinMetadata
{
- Description = "Video Input Name",
+ Description = "DM Chassis Video Input Names",
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
JoinType = eJoinType.Serial
});
@@ -98,7 +110,7 @@ namespace PepperDash.Essentials.Core.Bridges
new JoinDataComplete(new JoinData { JoinNumber = 701, JoinSpan = 200 },
new JoinMetadata
{
- Description = "Video Input Name",
+ Description = "DM Chassis Audio Input Names",
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
JoinType = eJoinType.Serial
});
@@ -107,7 +119,7 @@ namespace PepperDash.Essentials.Core.Bridges
new JoinDataComplete(new JoinData { JoinNumber = 901, JoinSpan = 200 },
new JoinMetadata
{
- Description = "Video Input Name",
+ Description = "DM Chassis Video Output Names",
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
JoinType = eJoinType.Serial
});
@@ -116,7 +128,7 @@ namespace PepperDash.Essentials.Core.Bridges
new JoinDataComplete(new JoinData { JoinNumber = 1101, JoinSpan = 200 },
new JoinMetadata
{
- Description = "Video Input Name",
+ Description = "DM Chassis Audio Output Names",
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
JoinType = eJoinType.Serial
});
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/DmRmcControllerJoinMap.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/DmRmcControllerJoinMap.cs
index c995e8c8..ec4661a4 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/DmRmcControllerJoinMap.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/DmRmcControllerJoinMap.cs
@@ -28,6 +28,10 @@ namespace PepperDash.Essentials.Core.Bridges
public JoinDataComplete EdidSerialNumber = new JoinDataComplete(new JoinData { JoinNumber = 5, JoinSpan = 1 },
new JoinMetadata { Description = "DM RMC EDID Serial Number", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
+ [JoinName("Name")]
+ public JoinDataComplete Name = new JoinDataComplete(new JoinData { JoinNumber = 6, JoinSpan = 1 },
+ new JoinMetadata { Description = "DM RMC Name", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
+
[JoinName("AudioVideoSource")]
public JoinDataComplete AudioVideoSource = new JoinDataComplete(new JoinData { JoinNumber = 1, JoinSpan = 1 },
new JoinMetadata { Description = "DM RMC Audio Video Source Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/DmTxControllerJoinMap.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/DmTxControllerJoinMap.cs
index 06953467..6d783639 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/DmTxControllerJoinMap.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/DmTxControllerJoinMap.cs
@@ -32,6 +32,10 @@ namespace PepperDash.Essentials.Core.Bridges
public JoinDataComplete CurrentInputResolution = new JoinDataComplete(new JoinData { JoinNumber = 1, JoinSpan = 1 },
new JoinMetadata { Description = "DM TX Current Input Resolution", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
+ [JoinName("Name")]
+ public JoinDataComplete Name = new JoinDataComplete(new JoinData { JoinNumber = 2, JoinSpan = 1 },
+ new JoinMetadata { Description = "DM TX Name", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
+
[JoinName("VideoInput")]
public JoinDataComplete VideoInput = new JoinDataComplete(new JoinData { JoinNumber = 1, JoinSpan = 1 },
new JoinMetadata { Description = "DM TX Video Input Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
@@ -42,7 +46,7 @@ namespace PepperDash.Essentials.Core.Bridges
[JoinName("HdcpSupportCapability")]
public JoinDataComplete HdcpSupportCapability = new JoinDataComplete(new JoinData { JoinNumber = 3, JoinSpan = 1 },
- new JoinMetadata { Description = "DM TX HDCP Support Capability", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Analog });
+ new JoinMetadata { Description = "DM TX HDCP Support Capability", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Analog });
[JoinName("Port1HdcpState")]
public JoinDataComplete Port1HdcpState = new JoinDataComplete(new JoinData { JoinNumber = 4, JoinSpan = 1 },
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/DmpsAudioOutputControllerJoinMap.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/DmpsAudioOutputControllerJoinMap.cs
index 247dfd8f..c7d5c0e5 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/DmpsAudioOutputControllerJoinMap.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/DmpsAudioOutputControllerJoinMap.cs
@@ -7,7 +7,15 @@ namespace PepperDash.Essentials.Core.Bridges
[JoinName("MasterVolumeLevel")]
public JoinDataComplete MasterVolumeLevel = new JoinDataComplete(new JoinData { JoinNumber = 1, JoinSpan = 1 },
- new JoinMetadata { Description = "Master Volume Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
+ new JoinMetadata { Description = "Master Volume Signed dB Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
+
+ [JoinName("MasterVolumeLevelScaled")]
+ public JoinDataComplete MasterVolumeLevelScaled = new JoinDataComplete(new JoinData { JoinNumber = 2, JoinSpan = 1 },
+ new JoinMetadata { Description = "Master Volume 16bit Scaled Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
+
+ [JoinName("MixerPresetRecall")]
+ public JoinDataComplete MixerPresetRecall = new JoinDataComplete(new JoinData { JoinNumber = 3, JoinSpan = 1 },
+ new JoinMetadata { Description = "Mixer Preset Recall Set", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Analog });
[JoinName("MasterVolumeMuteOn")]
public JoinDataComplete MasterVolumeMuteOn = new JoinDataComplete(new JoinData { JoinNumber = 1, JoinSpan = 1 },
@@ -23,11 +31,19 @@ namespace PepperDash.Essentials.Core.Bridges
[JoinName("MasterVolumeDown")]
public JoinDataComplete MasterVolumeDown = new JoinDataComplete(new JoinData { JoinNumber = 4, JoinSpan = 1 },
- new JoinMetadata { Description = "Master Volume Mute Level Down", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+ new JoinMetadata { Description = "Master Volume Level Down", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("MasterVolumeLevelScaledSend")]
+ public JoinDataComplete MasterVolumeLevelScaledSend = new JoinDataComplete(new JoinData { JoinNumber = 5, JoinSpan = 1 },
+ new JoinMetadata { Description = "Master Volume Scaled Send Enable/Disable", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("SourceVolumeLevel")]
public JoinDataComplete SourceVolumeLevel = new JoinDataComplete(new JoinData { JoinNumber = 11, JoinSpan = 1 },
- new JoinMetadata { Description = "Source Volume Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
+ new JoinMetadata { Description = "Source Volume Signed dB Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
+
+ [JoinName("SourceVolumeLevelScaled")]
+ public JoinDataComplete SourceVolumeLevelScaled = new JoinDataComplete(new JoinData { JoinNumber = 12, JoinSpan = 1 },
+ new JoinMetadata { Description = "Source Volume 16bit Scaled Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
[JoinName("SourceVolumeMuteOn")]
public JoinDataComplete SourceVolumeMuteOn = new JoinDataComplete(new JoinData { JoinNumber = 11, JoinSpan = 1 },
@@ -43,11 +59,19 @@ namespace PepperDash.Essentials.Core.Bridges
[JoinName("SourceVolumeDown")]
public JoinDataComplete SourceVolumeDown = new JoinDataComplete(new JoinData { JoinNumber = 14, JoinSpan = 1 },
- new JoinMetadata { Description = "Source Volume Mute Level Down", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+ new JoinMetadata { Description = "Source Volume Level Down", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("SourceVolumeLevelScaledSend")]
+ public JoinDataComplete SourceVolumeLevelScaledSend = new JoinDataComplete(new JoinData { JoinNumber = 15, JoinSpan = 1 },
+ new JoinMetadata { Description = "Source Volume Scaled Send Enable/Disable", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("Codec1VolumeLevel")]
public JoinDataComplete Codec1VolumeLevel = new JoinDataComplete(new JoinData { JoinNumber = 21, JoinSpan = 1 },
- new JoinMetadata { Description = "Codec1 Volume Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
+ new JoinMetadata { Description = "Codec1 Volume Signed dB Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
+
+ [JoinName("Codec1VolumeLevelScaled")]
+ public JoinDataComplete Codec1VolumeLevelScaled = new JoinDataComplete(new JoinData { JoinNumber = 22, JoinSpan = 1 },
+ new JoinMetadata { Description = "Codec1 Volume 16bit Scaled Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
[JoinName("Codec1VolumeMuteOn")]
public JoinDataComplete Codec1VolumeMuteOn = new JoinDataComplete(new JoinData { JoinNumber = 21, JoinSpan = 1 },
@@ -63,11 +87,19 @@ namespace PepperDash.Essentials.Core.Bridges
[JoinName("Codec1VolumeDown")]
public JoinDataComplete Codec1VolumeDown = new JoinDataComplete(new JoinData { JoinNumber = 24, JoinSpan = 1 },
- new JoinMetadata { Description = "Codec1 Volume Mute Level Down", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+ new JoinMetadata { Description = "Codec1 Volume Level Down", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("Codec1VolumeLevelScaledSend")]
+ public JoinDataComplete Codec1VolumeLevelScaledSend = new JoinDataComplete(new JoinData { JoinNumber = 25, JoinSpan = 1 },
+ new JoinMetadata { Description = "Codec1 Volume Scaled Send Enable/Disable", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("Codec2VolumeLevel")]
public JoinDataComplete Codec2VolumeLevel = new JoinDataComplete(new JoinData { JoinNumber = 31, JoinSpan = 1 },
- new JoinMetadata { Description = "Codec2 Volume Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
+ new JoinMetadata { Description = "Codec2 Volume Signed dB Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
+
+ [JoinName("Codec2VolumeLevelScaled")]
+ public JoinDataComplete Codec2VolumeLevelScaled = new JoinDataComplete(new JoinData { JoinNumber = 32, JoinSpan = 1 },
+ new JoinMetadata { Description = "Codec2 Volume 16bit Scaled Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
[JoinName("Codec2VolumeMuteOn")]
public JoinDataComplete Codec2VolumeMuteOn = new JoinDataComplete(new JoinData { JoinNumber = 31, JoinSpan = 1 },
@@ -83,8 +115,39 @@ namespace PepperDash.Essentials.Core.Bridges
[JoinName("Codec2VolumeDown")]
public JoinDataComplete Codec2VolumeDown = new JoinDataComplete(new JoinData { JoinNumber = 34, JoinSpan = 1 },
- new JoinMetadata { Description = "Codec2 Volume Mute Level Down", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+ new JoinMetadata { Description = "Codec2 Volume Level Down", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+ [JoinName("Codec2VolumeLevelScaledSend")]
+ public JoinDataComplete Codec2VolumeLevelScaledSend = new JoinDataComplete(new JoinData { JoinNumber = 35, JoinSpan = 1 },
+ new JoinMetadata { Description = "Codec2 Volume Scaled Send Enable/Disable", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("MicsMasterVolumeLevel")]
+ public JoinDataComplete MicsMasterVolumeLevel = new JoinDataComplete(new JoinData { JoinNumber = 41, JoinSpan = 1 },
+ new JoinMetadata { Description = "MicsMaster Volume Signed dB Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
+
+ [JoinName("MicsMasterVolumeLevelScaled")]
+ public JoinDataComplete MicsMasterVolumeLevelScaled = new JoinDataComplete(new JoinData { JoinNumber = 42, JoinSpan = 1 },
+ new JoinMetadata { Description = "MicsMaster Volume 16bit Scaled Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
+
+ [JoinName("MicsMasterVolumeMuteOn")]
+ public JoinDataComplete MicsMasterVolumeMuteOn = new JoinDataComplete(new JoinData { JoinNumber = 41, JoinSpan = 1 },
+ new JoinMetadata { Description = "MicsMaster Volume Mute On Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("MicsMasterVolumeMuteOff")]
+ public JoinDataComplete MicsMasterVolumeMuteOff = new JoinDataComplete(new JoinData { JoinNumber = 42, JoinSpan = 1 },
+ new JoinMetadata { Description = "MicsMaster Volume Mute Off Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("MicsMasterVolumeUp")]
+ public JoinDataComplete MicsMasterVolumeUp = new JoinDataComplete(new JoinData { JoinNumber = 43, JoinSpan = 1 },
+ new JoinMetadata { Description = "MicsMaster Volume Level Up", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("MicsMasterVolumeDown")]
+ public JoinDataComplete MicsMasterVolumeDown = new JoinDataComplete(new JoinData { JoinNumber = 44, JoinSpan = 1 },
+ new JoinMetadata { Description = "MicsMaster Volume Level Down", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("MicsMasterVolumeLevelScaledSend")]
+ public JoinDataComplete MicsMasterVolumeLevelScaledSend = new JoinDataComplete(new JoinData { JoinNumber = 45, JoinSpan = 1 },
+ new JoinMetadata { Description = "Mics Master Volume Scaled Send Enable/Disable", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
///
/// Constructor to use when instantiating this Join Map without inheriting from it
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/DmpsMicrophoneControllerJoinMap.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/DmpsMicrophoneControllerJoinMap.cs
new file mode 100644
index 00000000..6922c569
--- /dev/null
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/DmpsMicrophoneControllerJoinMap.cs
@@ -0,0 +1,50 @@
+using System;
+
+namespace PepperDash.Essentials.Core.Bridges
+{
+ public class DmpsMicrophoneControllerJoinMap : JoinMapBaseAdvanced
+ {
+ [JoinName("MicGain")]
+ public JoinDataComplete MicGain = new JoinDataComplete(new JoinData { JoinNumber = 1, JoinSpan = 1 },
+ new JoinMetadata { Description = "Mic Gain dB Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
+
+ [JoinName("MicGainScaled")]
+ public JoinDataComplete MicGainScaled = new JoinDataComplete(new JoinData { JoinNumber = 2, JoinSpan = 1 },
+ new JoinMetadata { Description = "Mic Gain 16bit Scaled Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
+
+ [JoinName("MicMuteOn")]
+ public JoinDataComplete MicMuteOn = new JoinDataComplete(new JoinData { JoinNumber = 1, JoinSpan = 1 },
+ new JoinMetadata { Description = "Mic Mute On Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("MicMuteOff")]
+ public JoinDataComplete MicMuteOff = new JoinDataComplete(new JoinData { JoinNumber = 2, JoinSpan = 1 },
+ new JoinMetadata { Description = "Mic Mute Off Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("MicGainScaledSend")]
+ public JoinDataComplete MicGainScaledSend = new JoinDataComplete(new JoinData { JoinNumber = 3, JoinSpan = 1 },
+ new JoinMetadata { Description = "Mic Gain Scaled Send Enable/Disable", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("MicName")]
+ public JoinDataComplete MicName = new JoinDataComplete(new JoinData { JoinNumber = 1, JoinSpan = 1 },
+ new JoinMetadata { Description = "Mic Name Get", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
+
+ ///
+ /// Constructor to use when instantiating this Join Map without inheriting from it
+ ///
+ /// Join this join map will start at
+ public DmpsMicrophoneControllerJoinMap(uint joinStart)
+ : this(joinStart, typeof(DmpsMicrophoneControllerJoinMap))
+ {
+ }
+
+ ///
+ /// Constructor to use when extending this Join map
+ ///
+ /// Join this join map will start at
+ /// Type of the child join map
+ protected DmpsMicrophoneControllerJoinMap(uint joinStart, Type type)
+ : base(joinStart, type)
+ {
+ }
+ }
+}
\ No newline at end of file
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/DmpsRoutingControllerJoinMap.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/DmpsRoutingControllerJoinMap.cs
index 11385916..44917899 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/DmpsRoutingControllerJoinMap.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/DmpsRoutingControllerJoinMap.cs
@@ -1,9 +1,29 @@
using System;
-namespace PepperDash.Essentials.Core.Bridges
-{
- public class DmpsRoutingControllerJoinMap : JoinMapBaseAdvanced
- {
+namespace PepperDash.Essentials.Core.Bridges
+{
+ public class DmpsRoutingControllerJoinMap : JoinMapBaseAdvanced
+ {
+ [JoinName("EnableRouting")]
+ public JoinDataComplete EnableRouting = new JoinDataComplete(new JoinData { JoinNumber = 1, JoinSpan = 1 },
+ new JoinMetadata { Description = "DMPS Enable Audio and Video Routing", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("SystemPowerOn")]
+ public JoinDataComplete SystemPowerOn = new JoinDataComplete(new JoinData { JoinNumber = 12, JoinSpan = 1 },
+ new JoinMetadata { Description = "DMPS System Power On Get/Set", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("SystemPowerOff")]
+ public JoinDataComplete SystemPowerOff = new JoinDataComplete(new JoinData { JoinNumber = 13, JoinSpan = 1 },
+ new JoinMetadata { Description = "DMPS System Power Off Get/Set", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("FrontPanelLockOn")]
+ public JoinDataComplete FrontPanelLockOn = new JoinDataComplete(new JoinData { JoinNumber = 14, JoinSpan = 1 },
+ new JoinMetadata { Description = "DMPS Front Panel Lock On Get/Set", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("FrontPanelLockOff")]
+ public JoinDataComplete FrontPanelLockOff = new JoinDataComplete(new JoinData { JoinNumber = 15, JoinSpan = 1 },
+ new JoinMetadata { Description = "DMPS Front Panel Lock Off Get/Set", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
+
[JoinName("VideoSyncStatus")]
public JoinDataComplete VideoSyncStatus = new JoinDataComplete(new JoinData { JoinNumber = 101, JoinSpan = 32 },
new JoinMetadata { Description = "DM Input Video Sync", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
@@ -32,6 +52,44 @@ namespace PepperDash.Essentials.Core.Bridges
public JoinDataComplete OutputNames = new JoinDataComplete(new JoinData { JoinNumber = 301, JoinSpan = 32 },
new JoinMetadata { Description = "DM Chassis Output Name", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
+ [JoinName("InputVideoNames")]
+ public JoinDataComplete InputVideoNames =
+ new JoinDataComplete(new JoinData { JoinNumber = 501, JoinSpan = 32 },
+ new JoinMetadata
+ {
+ Description = "Video Input Name",
+ JoinCapabilities = eJoinCapabilities.ToSIMPL,
+ JoinType = eJoinType.Serial
+ });
+
+ [JoinName("InputAudioNames")]
+ public JoinDataComplete InputAudioNames =
+ new JoinDataComplete(new JoinData { JoinNumber = 701, JoinSpan = 32 },
+ new JoinMetadata
+ {
+ Description = "Audio Input Name",
+ JoinCapabilities = eJoinCapabilities.ToSIMPL,
+ JoinType = eJoinType.Serial
+ });
+ [JoinName("OutputVideoNames")]
+ public JoinDataComplete OutputVideoNames =
+ new JoinDataComplete(new JoinData { JoinNumber = 901, JoinSpan = 32 },
+ new JoinMetadata
+ {
+ Description = "Video Output Name",
+ JoinCapabilities = eJoinCapabilities.ToSIMPL,
+ JoinType = eJoinType.Serial
+ });
+ [JoinName("OutputAudioNames")]
+ public JoinDataComplete OutputAudioNames =
+ new JoinDataComplete(new JoinData { JoinNumber = 1101, JoinSpan = 32 },
+ new JoinMetadata
+ {
+ Description = "Audio Output Name",
+ JoinCapabilities = eJoinCapabilities.ToSIMPL,
+ JoinType = eJoinType.Serial
+ });
+
[JoinName("OutputCurrentVideoInputNames")]
public JoinDataComplete OutputCurrentVideoInputNames = new JoinDataComplete(new JoinData { JoinNumber = 2001, JoinSpan = 32 },
new JoinMetadata { Description = "DM Chassis Video Output Currently Routed Video Input Name", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
@@ -61,5 +119,5 @@ namespace PepperDash.Essentials.Core.Bridges
protected DmpsRoutingControllerJoinMap(uint joinStart, Type type) : base(joinStart, type)
{
}
- }
+ }
}
\ No newline at end of file
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/GlsOccupancySensorBaseJoinMap.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/GlsOccupancySensorBaseJoinMap.cs
index cc76e793..72cb1433 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/GlsOccupancySensorBaseJoinMap.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/GlsOccupancySensorBaseJoinMap.cs
@@ -154,7 +154,7 @@ namespace PepperDash.Essentials.Core.Bridges
[JoinName("PirSensitivityInVacantState")]
public JoinDataComplete PirSensitivityInVacantState = new JoinDataComplete(new JoinData { JoinNumber = 8, JoinSpan = 1 },
- new JoinMetadata { Description = "Occ Sensor Ultrasonic Sensitivity in Vacant State", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Analog });
+ new JoinMetadata { Description = "Occ Sensor PIR Sensitivity in Vacant State", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Analog });
[JoinName("Name")]
public JoinDataComplete Name = new JoinDataComplete(new JoinData { JoinNumber = 1, JoinSpan = 1 },
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/GlsPartitionSensorJoinMap.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/GlsPartitionSensorJoinMap.cs
index 74402689..5a583d69 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/GlsPartitionSensorJoinMap.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/GlsPartitionSensorJoinMap.cs
@@ -1,131 +1,290 @@
using System;
using PepperDash.Essentials.Core;
-namespace PepperDash_Essentials_Core.Bridges.JoinMaps
+namespace PepperDash.Essentials.Core.Bridges.JoinMaps
{
- public class GlsPartitionSensorJoinMap : JoinMapBaseAdvanced
- {
- [JoinName("IsOnline")]
- public JoinDataComplete IsOnline = new JoinDataComplete(
- new JoinData
- {
- JoinNumber = 1,
- JoinSpan = 1
- },
- new JoinMetadata
- {
- Description = "Sensor Is Online",
- JoinCapabilities = eJoinCapabilities.ToSIMPL,
- JoinType = eJoinType.Digital
- });
+ public class GlsPartitionSensorJoinMap : JoinMapBaseAdvanced
+ {
- [JoinName("Name")]
- public JoinDataComplete Name = new JoinDataComplete(
- new JoinData
- {
- JoinNumber = 1,
- JoinSpan = 1
- },
- new JoinMetadata
- {
- Description = "Sensor Name",
- JoinCapabilities = eJoinCapabilities.ToSIMPL,
- JoinType = eJoinType.Serial
- });
+ #region Digital
- [JoinName("Enable")]
- public JoinDataComplete Enable = new JoinDataComplete(
- new JoinData
- {
- JoinNumber = 2,
- JoinSpan = 1
- },
- new JoinMetadata
- {
- Description = "Sensor Enable",
- JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
- JoinType = eJoinType.Digital
- });
+ [JoinName("IsOnline")]
+ public JoinDataComplete IsOnline = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 1,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Sensor Is Online",
+ JoinCapabilities = eJoinCapabilities.ToSIMPL,
+ JoinType = eJoinType.Digital
+ });
- [JoinName("PartitionSensed")]
- public JoinDataComplete PartitionSensed = new JoinDataComplete(
- new JoinData
- {
- JoinNumber = 3,
- JoinSpan = 1
- },
- new JoinMetadata
- {
- Description = "Sensor Partition Sensed",
- JoinCapabilities = eJoinCapabilities.ToSIMPL,
- JoinType = eJoinType.Digital
- });
+
+ [JoinName("Enable")]
+ public JoinDataComplete Enable = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 2,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Sensor Enable",
+ JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
+ JoinType = eJoinType.Digital
+ });
- [JoinName("PartitionNotSensed")]
- public JoinDataComplete PartitionNotSensed = new JoinDataComplete(
- new JoinData
- {
- JoinNumber = 4,
- JoinSpan = 1
- },
- new JoinMetadata
- {
- Description = "Sensor Partition Not Sensed",
- JoinCapabilities = eJoinCapabilities.ToSIMPL,
- JoinType = eJoinType.Digital
- });
+ [JoinName("PartitionSensed")]
+ public JoinDataComplete PartitionSensed = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 3,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Sensor Partition Sensed",
+ JoinCapabilities = eJoinCapabilities.ToSIMPL,
+ JoinType = eJoinType.Digital
+ });
- [JoinName("IncreaseSensitivity")]
- public JoinDataComplete IncreaseSensitivity = new JoinDataComplete(
- new JoinData
- {
- JoinNumber = 6,
- JoinSpan = 1
- },
- new JoinMetadata
- {
- Description = "Sensor Increase Sensitivity",
- JoinCapabilities = eJoinCapabilities.FromSIMPL,
- JoinType = eJoinType.Digital
- });
+ [JoinName("PartitionNotSensed")]
+ public JoinDataComplete PartitionNotSensed = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 4,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Sensor Partition Not Sensed",
+ JoinCapabilities = eJoinCapabilities.ToSIMPL,
+ JoinType = eJoinType.Digital
+ });
- [JoinName("DecreaseSensitivity")]
- public JoinDataComplete DecreaseSensitivity = new JoinDataComplete(
- new JoinData
- {
- JoinNumber = 7,
- JoinSpan = 1
- },
- new JoinMetadata
- {
- Description = "Sensor Decrease Sensitivity",
- JoinCapabilities = eJoinCapabilities.FromSIMPL,
- JoinType = eJoinType.Digital
- });
+ [JoinName("IncreaseSensitivity")]
+ public JoinDataComplete IncreaseSensitivity = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 6,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Sensor Increase Sensitivity",
+ JoinCapabilities = eJoinCapabilities.FromSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("DecreaseSensitivity")]
+ public JoinDataComplete DecreaseSensitivity = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 7,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Sensor Decrease Sensitivity",
+ JoinCapabilities = eJoinCapabilities.FromSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ #endregion
+
+ #region Analog
+
+ [JoinName("Sensitivity")]
+ public JoinDataComplete Sensitivity = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 2,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Sensor Sensitivity",
+ JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
+ JoinType = eJoinType.Analog
+ });
+
+ #endregion
+
+
+ #region Serial
+
+ [JoinName("Name")]
+ public JoinDataComplete Name = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 1,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Sensor Name",
+ JoinCapabilities = eJoinCapabilities.ToSIMPL,
+ JoinType = eJoinType.Serial
+ });
+
+ #endregion
- [JoinName("Sensitivity")]
- public JoinDataComplete Sensitivity = new JoinDataComplete(
- new JoinData
- {
- JoinNumber = 2,
- JoinSpan = 1
- },
- new JoinMetadata
- {
- Description = "Sensor Sensitivity",
- JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
- JoinType = eJoinType.Analog
- });
///
/// Constructor to use when instantiating this Join Map without inheriting from it
///
/// Join this join map will start at
- public GlsPartitionSensorJoinMap(uint joinStart)
- : this(joinStart, typeof (GlsPartitionSensorJoinMap))
- {
+ public GlsPartitionSensorJoinMap(uint joinStart)
+ : this(joinStart, typeof(GlsPartitionSensorJoinMap))
+ {
- }
+ }
+
+ ///
+ /// Constructor to use when extending this Join map
+ ///
+ /// Join this join map will start at
+ /// Type of the child join map
+ protected GlsPartitionSensorJoinMap(uint joinStart, Type type)
+ : base(joinStart, type)
+ {
+
+ }
+ }
+}
+
+namespace PepperDash_Essentials_Core.Bridges.JoinMaps
+{
+ ///
+ ///
+ ///
+ [Obsolete("use PepperDash.Essentials.Core.Bridges.JoinMaps version")]
+ public class GlsPartitionSensorJoinMap:JoinMapBaseAdvanced
+ {
+ [JoinName("IsOnline")]
+ public JoinDataComplete IsOnline = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 1,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Sensor Is Online",
+ JoinCapabilities = eJoinCapabilities.ToSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("Name")]
+ public JoinDataComplete Name = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 1,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Sensor Name",
+ JoinCapabilities = eJoinCapabilities.ToSIMPL,
+ JoinType = eJoinType.Serial
+ });
+
+ [JoinName("Enable")]
+ public JoinDataComplete Enable = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 2,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Sensor Enable",
+ JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("PartitionSensed")]
+ public JoinDataComplete PartitionSensed = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 3,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Sensor Partition Sensed",
+ JoinCapabilities = eJoinCapabilities.ToSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("PartitionNotSensed")]
+ public JoinDataComplete PartitionNotSensed = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 4,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Sensor Partition Not Sensed",
+ JoinCapabilities = eJoinCapabilities.ToSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("IncreaseSensitivity")]
+ public JoinDataComplete IncreaseSensitivity = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 6,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Sensor Increase Sensitivity",
+ JoinCapabilities = eJoinCapabilities.FromSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("DecreaseSensitivity")]
+ public JoinDataComplete DecreaseSensitivity = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 7,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Sensor Decrease Sensitivity",
+ JoinCapabilities = eJoinCapabilities.FromSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("Sensitivity")]
+ public JoinDataComplete Sensitivity = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 2,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Sensor Sensitivity",
+ JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
+ JoinType = eJoinType.Analog
+ });
+
+ ///
+ /// Constructor to use when instantiating this Join Map without inheriting from it
+ ///
+ /// Join this join map will start at
+ public GlsPartitionSensorJoinMap(uint joinStart)
+ : this(joinStart, typeof(GlsPartitionSensorJoinMap))
+ {
+
+ }
///
/// Constructor to use when extending this Join map
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/IRBlurayBaseJoinMap.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/IRBlurayBaseJoinMap.cs
new file mode 100644
index 00000000..991489e9
--- /dev/null
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/IRBlurayBaseJoinMap.cs
@@ -0,0 +1,222 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Crestron.SimplSharp;
+
+namespace PepperDash.Essentials.Core.Bridges
+{
+ ///
+ /// Join map for IRBlurayBase devices
+ ///
+ public class IRBlurayBaseJoinMap : JoinMapBaseAdvanced
+ {
+ [JoinName("PowerOn")]
+ public JoinDataComplete PowerOn = new JoinDataComplete(new JoinData { JoinNumber = 1, JoinSpan = 1 },
+ new JoinMetadata { Description = "Power On", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("PowerOff")]
+ public JoinDataComplete PowerOff = new JoinDataComplete(new JoinData { JoinNumber = 2, JoinSpan = 1 },
+ new JoinMetadata { Description = "Power Off", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("PowerToggle")]
+ public JoinDataComplete PowerToggle = new JoinDataComplete(new JoinData { JoinNumber = 3, JoinSpan = 1 },
+ new JoinMetadata { Description = "Power Toggle", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("Up")]
+ public JoinDataComplete Up = new JoinDataComplete(new JoinData { JoinNumber = 4, JoinSpan = 1 },
+ new JoinMetadata { Description = "Nav Up", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("Down")]
+ public JoinDataComplete Down = new JoinDataComplete(new JoinData { JoinNumber = 5, JoinSpan = 1 },
+ new JoinMetadata { Description = "Nav Down", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("Left")]
+ public JoinDataComplete Left = new JoinDataComplete(new JoinData { JoinNumber = 6, JoinSpan = 1 },
+ new JoinMetadata { Description = "Nav Left", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("Right")]
+ public JoinDataComplete Right = new JoinDataComplete(new JoinData { JoinNumber = 7, JoinSpan = 1 },
+ new JoinMetadata { Description = "Nav Right", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("Select")]
+ public JoinDataComplete Select = new JoinDataComplete(new JoinData { JoinNumber = 8, JoinSpan = 1 },
+ new JoinMetadata { Description = "Select", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("Menu")]
+ public JoinDataComplete Menu = new JoinDataComplete(new JoinData { JoinNumber = 9, JoinSpan = 1 },
+ new JoinMetadata { Description = "Menu", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("Exit")]
+ public JoinDataComplete Exit = new JoinDataComplete(new JoinData { JoinNumber = 10, JoinSpan = 1 },
+ new JoinMetadata { Description = "Exit", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("Digit0")]
+ public JoinDataComplete Digit0 = new JoinDataComplete(new JoinData { JoinNumber = 11, JoinSpan = 1 },
+ new JoinMetadata { Description = "Digit 0", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("Digit1")]
+ public JoinDataComplete Digit1 = new JoinDataComplete(new JoinData { JoinNumber = 12, JoinSpan = 1 },
+ new JoinMetadata { Description = "Digit 1", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("Digit2")]
+ public JoinDataComplete Digit2 = new JoinDataComplete(new JoinData { JoinNumber = 13, JoinSpan = 1 },
+ new JoinMetadata { Description = "Digit 2", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("Digit3")]
+ public JoinDataComplete Digit3 = new JoinDataComplete(new JoinData { JoinNumber = 14, JoinSpan = 1 },
+ new JoinMetadata { Description = "Digit 3", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("Digit4")]
+ public JoinDataComplete Digit4 = new JoinDataComplete(new JoinData { JoinNumber = 15, JoinSpan = 1 },
+ new JoinMetadata { Description = "Digit 4", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("Digit5")]
+ public JoinDataComplete Digit5 = new JoinDataComplete(new JoinData { JoinNumber = 16, JoinSpan = 1 },
+ new JoinMetadata { Description = "Digit 5", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("Digit6")]
+ public JoinDataComplete Digit6 = new JoinDataComplete(new JoinData { JoinNumber = 17, JoinSpan = 1 },
+ new JoinMetadata { Description = "Digit 6", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("Digit7")]
+ public JoinDataComplete Digit7 = new JoinDataComplete(new JoinData { JoinNumber = 18, JoinSpan = 1 },
+ new JoinMetadata { Description = "Digit 7", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("Digit8")]
+ public JoinDataComplete Digit8 = new JoinDataComplete(new JoinData { JoinNumber = 19, JoinSpan = 1 },
+ new JoinMetadata { Description = "Digit 8", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("Digit9")]
+ public JoinDataComplete Digit9 = new JoinDataComplete(new JoinData { JoinNumber = 20, JoinSpan = 1 },
+ new JoinMetadata { Description = "Digit 9", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("KeypadClear")]
+ public JoinDataComplete KeypadClear = new JoinDataComplete(new JoinData { JoinNumber = 21, JoinSpan = 1 },
+ new JoinMetadata { Description = "Keypad Clear", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("KeypadEnter")]
+ public JoinDataComplete KeypadEnter = new JoinDataComplete(new JoinData { JoinNumber = 22, JoinSpan = 1 },
+ new JoinMetadata { Description = "Keypad Enter", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("ChannelUp")]
+ public JoinDataComplete ChannelUp = new JoinDataComplete(new JoinData { JoinNumber = 23, JoinSpan = 1 },
+ new JoinMetadata { Description = "STB Channel Up", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("ChannelDown")]
+ public JoinDataComplete ChannelDown = new JoinDataComplete(new JoinData { JoinNumber = 24, JoinSpan = 1 },
+ new JoinMetadata { Description = "STB Channel Down", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("LastChannel")]
+ public JoinDataComplete LastChannel = new JoinDataComplete(new JoinData { JoinNumber = 25, JoinSpan = 1 },
+ new JoinMetadata { Description = "Last Channel", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("Guide")]
+ public JoinDataComplete Guide = new JoinDataComplete(new JoinData { JoinNumber = 26, JoinSpan = 1 },
+ new JoinMetadata { Description = "Guide", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("Info")]
+ public JoinDataComplete Info = new JoinDataComplete(new JoinData { JoinNumber = 27, JoinSpan = 1 },
+ new JoinMetadata { Description = "Info", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("Red")]
+ public JoinDataComplete Red = new JoinDataComplete(new JoinData { JoinNumber = 28, JoinSpan = 1 },
+ new JoinMetadata { Description = "Red", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("Green")]
+ public JoinDataComplete Green = new JoinDataComplete(new JoinData { JoinNumber = 29, JoinSpan = 1 },
+ new JoinMetadata { Description = "Green", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("Yellow")]
+ public JoinDataComplete Yellow = new JoinDataComplete(new JoinData { JoinNumber = 30, JoinSpan = 1 },
+ new JoinMetadata { Description = "Yellow", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("Blue")]
+ public JoinDataComplete Blue = new JoinDataComplete(new JoinData { JoinNumber = 31, JoinSpan = 1 },
+ new JoinMetadata { Description = "Blue", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+
+ [JoinName("Play")]
+ public JoinDataComplete Play = new JoinDataComplete(new JoinData { JoinNumber = 33, JoinSpan = 1 },
+ new JoinMetadata { Description = "Play", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("Pause")]
+ public JoinDataComplete Pause = new JoinDataComplete(new JoinData { JoinNumber = 34, JoinSpan = 1 },
+ new JoinMetadata { Description = "Pause", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("Stop")]
+ public JoinDataComplete Stop = new JoinDataComplete(new JoinData { JoinNumber = 35, JoinSpan = 1 },
+ new JoinMetadata { Description = "Stop", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("FFwd")]
+ public JoinDataComplete FFwd = new JoinDataComplete(new JoinData { JoinNumber = 36, JoinSpan = 1 },
+ new JoinMetadata { Description = "FFwd", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("Rewind")]
+ public JoinDataComplete Rewind = new JoinDataComplete(new JoinData { JoinNumber = 37, JoinSpan = 1 },
+ new JoinMetadata { Description = "Rewind", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("ChapPlus")]
+ public JoinDataComplete ChapPlus = new JoinDataComplete(new JoinData { JoinNumber = 38, JoinSpan = 1 },
+ new JoinMetadata { Description = "Chapter Plus", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("ChapMinus")]
+ public JoinDataComplete ChapMinus = new JoinDataComplete(new JoinData { JoinNumber = 39, JoinSpan = 1 },
+ new JoinMetadata { Description = "Chapter Minus", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("Replay")]
+ public JoinDataComplete Replay = new JoinDataComplete(new JoinData { JoinNumber = 40, JoinSpan = 1 },
+ new JoinMetadata { Description = "Replay", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("Record")]
+ public JoinDataComplete Record = new JoinDataComplete(new JoinData { JoinNumber = 41, JoinSpan = 1 },
+ new JoinMetadata { Description = "Record", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("HasKeypadAccessoryButton1")]
+ public JoinDataComplete HasKeypadAccessoryButton1 = new JoinDataComplete(new JoinData { JoinNumber = 42, JoinSpan = 1 },
+ new JoinMetadata { Description = "Has Keypad Accessory Button 1", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("HasKeypadAccessoryButton2")]
+ public JoinDataComplete HasKeypadAccessoryButton2 = new JoinDataComplete(new JoinData { JoinNumber = 43, JoinSpan = 1 },
+ new JoinMetadata { Description = "Has Keypad Accessory Button 2", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("KeypadAccessoryButton1Press")]
+ public JoinDataComplete KeypadAccessoryButton1Press = new JoinDataComplete(new JoinData { JoinNumber = 42, JoinSpan = 2 },
+ new JoinMetadata { Description = "Keypad Accessory Button 1 Press", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("KeypadAccessoryButton2Press")]
+ public JoinDataComplete KeypadAccessoryButton2Press = new JoinDataComplete(new JoinData { JoinNumber = 43, JoinSpan = 2 },
+ new JoinMetadata { Description = "Keypad Accessory Button 2 Press", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("Name")]
+ public JoinDataComplete Name = new JoinDataComplete(new JoinData { JoinNumber = 1, JoinSpan = 1 },
+ new JoinMetadata { Description = "Name", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("KeypadAccessoryButton1Label")]
+ public JoinDataComplete KeypadAccessoryButton1Label = new JoinDataComplete(new JoinData { JoinNumber = 42, JoinSpan = 1 },
+ new JoinMetadata { Description = "Keypad Accessory Button 1 Label", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
+
+ [JoinName("KeypadAccessoryButton2Label")]
+ public JoinDataComplete KeypadAccessoryButton2Label = new JoinDataComplete(new JoinData { JoinNumber = 43, JoinSpan = 1 },
+ new JoinMetadata { Description = "Keypad Accessory Button 1 Label", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
+
+ ///
+ /// Constructor to use when instantiating this Join Map without inheriting from it
+ ///
+ /// Join this join map will start at
+ public IRBlurayBaseJoinMap(uint joinStart)
+ : this(joinStart, typeof(IRBlurayBaseJoinMap))
+ {
+ }
+
+ ///
+ /// Constructor to use when extending this Join map
+ ///
+ /// Join this join map will start at
+ /// Type of the child join map
+ protected IRBlurayBaseJoinMap(uint joinStart, Type type)
+ : base(joinStart, type)
+ {
+ }
+ }
+}
\ No newline at end of file
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/SetTopBoxControllerJoinMap.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/SetTopBoxControllerJoinMap.cs
index 0eddc9f3..a65c537c 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/SetTopBoxControllerJoinMap.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/SetTopBoxControllerJoinMap.cs
@@ -1,10 +1,10 @@
using System;
-namespace PepperDash.Essentials.Core.Bridges
-{
- public class SetTopBoxControllerJoinMap : JoinMapBaseAdvanced
- {
+namespace PepperDash.Essentials.Core.Bridges
+{
+ public class SetTopBoxControllerJoinMap : JoinMapBaseAdvanced
+ {
[JoinName("PowerOn")]
public JoinDataComplete PowerOn = new JoinDataComplete(new JoinData { JoinNumber = 1, JoinSpan = 1 },
new JoinMetadata { Description = "STB Power On", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
@@ -236,5 +236,5 @@ namespace PepperDash.Essentials.Core.Bridges
: base(joinStart, type)
{
}
- }
+ }
}
\ No newline at end of file
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/SystemMonitorJoinMap.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/SystemMonitorJoinMap.cs
index e07ad275..363d389b 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/SystemMonitorJoinMap.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/SystemMonitorJoinMap.cs
@@ -45,7 +45,7 @@ namespace PepperDash.Essentials.Core.Bridges
new JoinMetadata { Description = "Processor Last Boot", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
[JoinName("ProgramOffsetJoin")]
- public JoinDataComplete ProgramOffsetJoin = new JoinDataComplete(new JoinData { JoinNumber = 5, JoinSpan = 1 },
+ public JoinDataComplete ProgramOffsetJoin = new JoinDataComplete(new JoinData { JoinNumber = 5, JoinSpan = 5 },
new JoinMetadata { Description = "All Program Data is offset between slots by 5 - First Joins Start at 11", JoinCapabilities = eJoinCapabilities.None, JoinType = eJoinType.None });
[JoinName("ProgramStart")]
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/VideoCodecControllerJoinMap.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/VideoCodecControllerJoinMap.cs
index 8054a077..21b88ed3 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/VideoCodecControllerJoinMap.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/VideoCodecControllerJoinMap.cs
@@ -1,811 +1,2610 @@
using System;
using PepperDash.Essentials.Core;
+namespace PepperDash.Essentials.Core.Bridges.JoinMaps
+{
+ public class VideoCodecControllerJoinMap : JoinMapBaseAdvanced
+ {
+ #region Digital
+
+ [JoinName("IsOnline")]
+ public JoinDataComplete IsOnline = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 1,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Device is Online",
+ JoinCapabilities = eJoinCapabilities.ToSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("1")]
+ public JoinDataComplete Dtmf1 = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 11,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "DTMF 1",
+ JoinCapabilities = eJoinCapabilities.FromSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("2")]
+ public JoinDataComplete Dtmf2 = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 12,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "DTMF 2",
+ JoinCapabilities = eJoinCapabilities.FromSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("3")]
+ public JoinDataComplete Dtmf3 = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 13,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "DTMF 3",
+ JoinCapabilities = eJoinCapabilities.FromSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("4")]
+ public JoinDataComplete Dtmf4 = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 14,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "DTMF 4",
+ JoinCapabilities = eJoinCapabilities.FromSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("5")]
+ public JoinDataComplete Dtmf5 = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 15,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "DTMF 5",
+ JoinCapabilities = eJoinCapabilities.FromSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("6")]
+ public JoinDataComplete Dtmf6 = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 16,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "DTMF 6",
+ JoinCapabilities = eJoinCapabilities.FromSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("7")]
+ public JoinDataComplete Dtmf7 = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 17,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "DTMF 7",
+ JoinCapabilities = eJoinCapabilities.FromSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("8")]
+ public JoinDataComplete Dtmf8 = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 18,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "DTMF 8",
+ JoinCapabilities = eJoinCapabilities.FromSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("9")]
+ public JoinDataComplete Dtmf9 = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 19,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "DTMF 9",
+ JoinCapabilities = eJoinCapabilities.FromSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("0")]
+ public JoinDataComplete Dtmf0 = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 20,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "DTMF 0",
+ JoinCapabilities = eJoinCapabilities.FromSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("*")]
+ public JoinDataComplete DtmfStar = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 21,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "DTMF *",
+ JoinCapabilities = eJoinCapabilities.FromSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("#")]
+ public JoinDataComplete DtmfPound = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 22,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "DTMF #",
+ JoinCapabilities = eJoinCapabilities.FromSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("EndCall")]
+ public JoinDataComplete EndCall = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 24,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Hang Up",
+ JoinCapabilities = eJoinCapabilities.FromSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("HookState")]
+ public JoinDataComplete HookState = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 31,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Current Hook State",
+ JoinCapabilities = eJoinCapabilities.ToSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("SpeedDialStart")]
+ public JoinDataComplete SpeedDialStart = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 41,
+ JoinSpan = 4
+ },
+ new JoinMetadata
+ {
+ Description = "Speed Dial",
+ JoinCapabilities = eJoinCapabilities.ToSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("IncomingCall")]
+ public JoinDataComplete IncomingCall = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 50,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Incoming Call",
+ JoinCapabilities = eJoinCapabilities.ToSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("IncomingAnswer")]
+ public JoinDataComplete IncomingAnswer = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 51,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Answer Incoming Call",
+ JoinCapabilities = eJoinCapabilities.FromSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("IncomingReject")]
+ public JoinDataComplete IncomingReject = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 52,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Reject Incoming Call",
+ JoinCapabilities = eJoinCapabilities.FromSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("ManualDial")]
+ public JoinDataComplete ManualDial = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 71,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Dial manual string",
+ JoinCapabilities = eJoinCapabilities.FromSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("DialPhoneCall")]
+ public JoinDataComplete DialPhone = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 72,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Dial Phone",
+ JoinCapabilities = eJoinCapabilities.FromSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("PhoneHookState")]
+ public JoinDataComplete PhoneHookState = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 72,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Dial Phone",
+ JoinCapabilities = eJoinCapabilities.ToSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("EndPhoneCall")]
+ public JoinDataComplete HangUpPhone = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 73,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Hang Up PHone",
+ JoinCapabilities = eJoinCapabilities.FromSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("DirectorySearchBusy")]
+ public JoinDataComplete DirectorySearchBusy = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 100,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Directory Search Busy FB",
+ JoinCapabilities = eJoinCapabilities.ToSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("DirectoryEntryIsContact")]
+ public JoinDataComplete DirectoryEntryIsContact = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 101,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Directory Selected Entry Is Contact FB",
+ JoinCapabilities = eJoinCapabilities.ToSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("DirectoryLineSelected")]
+ public JoinDataComplete DirectoryLineSelected = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 101,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Directory Line Selected FB",
+ JoinCapabilities = eJoinCapabilities.FromSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("DirectoryIsRoot")]
+ public JoinDataComplete DirectoryIsRoot = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 102,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Directory is on Root FB",
+ JoinCapabilities = eJoinCapabilities.ToSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("DirectoryHasChanged")]
+ public JoinDataComplete DirectoryHasChanged = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 103,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Directory has changed FB",
+ JoinCapabilities = eJoinCapabilities.ToSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("DirectoryRoot")]
+ public JoinDataComplete DirectoryRoot = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 104,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Go to Directory Root",
+ JoinCapabilities = eJoinCapabilities.ToSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("DirectoryFolderBack")]
+ public JoinDataComplete DirectoryFolderBack = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 105,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Go back one directory level",
+ JoinCapabilities = eJoinCapabilities.FromSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("DirectoryDialSelectedLine")]
+ public JoinDataComplete DirectoryDialSelectedLine = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 106,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Dial selected directory line",
+ JoinCapabilities = eJoinCapabilities.FromSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+
+ [JoinName("CameraTiltUp")]
+ public JoinDataComplete CameraTiltUp = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 111,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Camera Tilt Up",
+ JoinCapabilities = eJoinCapabilities.FromSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("CameraTiltDown")]
+ public JoinDataComplete CameraTiltDown = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 112,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Camera Tilt Down",
+ JoinCapabilities = eJoinCapabilities.FromSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("CameraPanLeft")]
+ public JoinDataComplete CameraPanLeft = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 113,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Camera Pan Left",
+ JoinCapabilities = eJoinCapabilities.FromSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("CameraPanRight")]
+ public JoinDataComplete CameraPanRight = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 114,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Camera Pan Right",
+ JoinCapabilities = eJoinCapabilities.FromSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("CameraZoomIn")]
+ public JoinDataComplete CameraZoomIn = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 115,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Camera Zoom In",
+ JoinCapabilities = eJoinCapabilities.FromSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("CameraZoomOut")]
+ public JoinDataComplete CameraZoomOut = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 116,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Camera Zoom Out",
+ JoinCapabilities = eJoinCapabilities.FromSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("CameraPresetSave")]
+ public JoinDataComplete CameraPresetSave = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 121,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Save Selected Preset",
+ JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("CameraModeAuto")]
+ public JoinDataComplete CameraModeAuto = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 131,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Camera Mode Auto",
+ JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("CameraModeManual")]
+ public JoinDataComplete CameraModeManual = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 132,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Camera Mode Manual",
+ JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("CameraModeOff")]
+ public JoinDataComplete CameraModeOff = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 133,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Camera Mode Off",
+ JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("CameraSelfView")]
+ public JoinDataComplete CameraSelfView = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 141,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Camera Self View Toggle/FB",
+ JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("CameraLayout")]
+ public JoinDataComplete CameraLayout = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 142,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Camera Layout Toggle",
+ JoinCapabilities = eJoinCapabilities.FromSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("CameraSupportsAutoMode")]
+ public JoinDataComplete CameraSupportsAutoMode = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 143,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Camera Supports Auto Mode FB",
+ JoinCapabilities = eJoinCapabilities.ToSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("CameraSupportsOffMode")]
+ public JoinDataComplete CameraSupportsOffMode = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 144,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Camera Supports Off Mode FB",
+ JoinCapabilities = eJoinCapabilities.ToSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("UpdateMeetings")]
+ public JoinDataComplete UpdateMeetings = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 160,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Update Meetings",
+ JoinCapabilities = eJoinCapabilities.FromSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("DialMeeting1")]
+ public JoinDataComplete DialMeeting1 = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 161,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Join first meeting",
+ JoinCapabilities = eJoinCapabilities.FromSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("DialMeeting2")]
+ public JoinDataComplete DialMeeting2 = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 162,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Join second meeting",
+ JoinCapabilities = eJoinCapabilities.FromSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("DialMeeting3")]
+ public JoinDataComplete DialMeeting3 = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 163,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Join third meeting",
+ JoinCapabilities = eJoinCapabilities.FromSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("MicMuteOn")]
+ public JoinDataComplete MicMuteOn = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 171,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Mic Mute On",
+ JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("MicMuteOff")]
+ public JoinDataComplete MicMuteOff = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 172,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Mic Mute Off",
+ JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("MicMuteToggle")]
+ public JoinDataComplete MicMuteToggle = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 173,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Mic Mute Toggle",
+ JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("VolumeUp")]
+ public JoinDataComplete VolumeUp = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 174,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Volume Up",
+ JoinCapabilities = eJoinCapabilities.FromSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("VolumeDown")]
+ public JoinDataComplete VolumeDown = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 175,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Volume Down",
+ JoinCapabilities = eJoinCapabilities.FromSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("VolumeMuteOn")]
+ public JoinDataComplete VolumeMuteOn = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 176,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Volume Mute On",
+ JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("VolumeMuteOff")]
+ public JoinDataComplete VolumeMuteOff = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 177,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Volume Mute Off",
+ JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("VolumeMuteToggle")]
+ public JoinDataComplete VolumeMuteToggle = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 178,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Volume Mute Toggle",
+ JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("SourceShareStart")]
+ public JoinDataComplete SourceShareStart = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 201,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Start Sharing & Feedback",
+ JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("SourceShareEnd")]
+ public JoinDataComplete SourceShareEnd = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 202,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Stop Sharing & Feedback",
+ JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("AutoShareWhileInCall")]
+ public JoinDataComplete SourceShareAutoStart = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 203,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "When high, will autostart sharing when a call is joined",
+ JoinCapabilities = eJoinCapabilities.FromSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("RecievingContent")]
+ public JoinDataComplete RecievingContent = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 204,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Recieving content from the far end",
+ JoinType = eJoinType.Digital,
+ JoinCapabilities = eJoinCapabilities.ToSIMPL
+ });
+
+ [JoinName("SelfviewPosition")]
+ public JoinDataComplete SelfviewPosition = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 211,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "advance selfview position",
+ JoinCapabilities = eJoinCapabilities.FromSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("ParticipantAudioMuteToggleStart")]
+ public JoinDataComplete ParticipantAudioMuteToggleStart = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 501,
+ JoinSpan = 50
+ },
+ new JoinMetadata
+ {
+ Description = "Toggles the participant's audio mute status",
+ JoinCapabilities = eJoinCapabilities.ToSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("ParticipantVideoMuteToggleStart")]
+ public JoinDataComplete ParticipantVideoMuteToggleStart = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 801,
+ JoinSpan = 50
+ },
+ new JoinMetadata
+ {
+ Description = "Toggles the participant's video mute status",
+ JoinCapabilities = eJoinCapabilities.ToSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("ParticipantPinToggleStart")]
+ public JoinDataComplete ParticipantPinToggleStart = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 1101,
+ JoinSpan = 50
+ },
+ new JoinMetadata
+ {
+ Description = "Toggles the participant's pin status",
+ JoinCapabilities = eJoinCapabilities.ToSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+
+ #endregion
+
+
+
+ #region Analog
+
+ // TODO [ ] hotfix/videocodecbase-max-meeting-xsig-set
+ [JoinName("MeetingsToDisplay")]
+ public JoinDataComplete MeetingsToDisplay = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 40,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Set/FB the number of meetings to display via the bridge xsig; default: 3 meetings.",
+ JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
+ JoinType = eJoinType.Analog
+ });
+
+ [JoinName("MinutesBeforeMeetingStart")]
+ public JoinDataComplete MinutesBeforeMeetingStart = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 41,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Minutes before meeting start that a meeting is joinable",
+ JoinCapabilities = eJoinCapabilities.FromSIMPL,
+ JoinType = eJoinType.Analog
+ });
+
+ [JoinName("CameraNumberSelect")]
+ public JoinDataComplete CameraNumberSelect = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 60,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Camera Number Select/FB",
+ JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
+ JoinType = eJoinType.Analog
+ });
+
+ [JoinName("DirectoryRowCount")]
+ public JoinDataComplete DirectoryRowCount = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 101,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Directory Row Count FB",
+ JoinCapabilities = eJoinCapabilities.ToSIMPL,
+ JoinType = eJoinType.Analog
+ });
+
+ [JoinName("DirectorySelectRow")]
+ public JoinDataComplete DirectorySelectRow = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 101,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Directory Select Row",
+ JoinCapabilities = eJoinCapabilities.FromSIMPL,
+ JoinType = eJoinType.Analog
+ });
+
+ [JoinName("CameraPresetSelect")]
+ public JoinDataComplete CameraPresetSelect = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 121,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Camera Preset Select",
+ JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
+ JoinType = eJoinType.Analog
+ });
+
+ [JoinName("ParticipantCount")]
+ public JoinDataComplete ParticipantCount = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 151,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Current Participant Count",
+ JoinCapabilities = eJoinCapabilities.ToSIMPL,
+ JoinType = eJoinType.Analog
+ });
+
+ [JoinName("Meeting Count Fb")]
+ public JoinDataComplete MeetingCount = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 161,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Meeting Count",
+ JoinCapabilities = eJoinCapabilities.ToSIMPL,
+ JoinType = eJoinType.Analog
+ });
+
+ [JoinName("VolumeLevel")]
+ public JoinDataComplete VolumeLevel = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 174,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Volume Level",
+ JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
+ JoinType = eJoinType.Analog
+ });
+
+ #endregion
+
+
+
+ #region Serials
+
+ [JoinName("CurrentDialString")]
+ public JoinDataComplete CurrentDialString = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 1,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Current Dial String",
+ JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
+ JoinType = eJoinType.Serial
+ });
+
+ [JoinName("PhoneString")]
+ public JoinDataComplete PhoneDialString = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 2,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Phone Dial String",
+ JoinCapabilities = eJoinCapabilities.FromSIMPL,
+ JoinType = eJoinType.Serial
+ });
+
+ [JoinName("CurrentCallName")]
+ public JoinDataComplete CurrentCallData = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 2,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Current Call Data - XSIG",
+ JoinCapabilities = eJoinCapabilities.ToSIMPL,
+ JoinType = eJoinType.Serial
+ });
+
+ [JoinName("CallDirection")]
+ public JoinDataComplete CallDirection = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 22,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Current Call Direction",
+ JoinCapabilities = eJoinCapabilities.ToSIMPL,
+ JoinType = eJoinType.Serial
+ });
+
+ [JoinName("IncomingCallName")]
+ public JoinDataComplete IncomingCallName = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 51,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Incoming Call Name",
+ JoinCapabilities = eJoinCapabilities.ToSIMPL,
+ JoinType = eJoinType.Serial
+ });
+
+ [JoinName("IncomingCallNumber")]
+ public JoinDataComplete IncomingCallNumber = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 52,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Incoming Call Number",
+ JoinCapabilities = eJoinCapabilities.ToSIMPL,
+ JoinType = eJoinType.Serial
+ });
+
+
+ [JoinName("DirectorySearchString")]
+ public JoinDataComplete DirectorySearchString = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 100,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Directory Search String",
+ JoinCapabilities = eJoinCapabilities.FromSIMPL,
+ JoinType = eJoinType.Serial
+ });
+
+ [JoinName("DirectoryEntries")]
+ public JoinDataComplete DirectoryEntries = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 101,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Directory Entries - XSig, 255 entries",
+ JoinCapabilities = eJoinCapabilities.ToSIMPL,
+ JoinType = eJoinType.Serial
+ });
+
+ [JoinName("Schedule")]
+ public JoinDataComplete Schedule = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 102,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Schedule Data - XSIG",
+ JoinCapabilities = eJoinCapabilities.ToSIMPL,
+ JoinType = eJoinType.Serial
+ });
+
+ [JoinName("CameraPresetNames")]
+ public JoinDataComplete CameraPresetNames = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 121,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Camera Preset Names - XSIG, max of 15",
+ JoinCapabilities = eJoinCapabilities.ToSIMPL,
+ JoinType = eJoinType.Serial
+ });
+
+ [JoinName("CameraLayoutStringFb")]
+ public JoinDataComplete CameraLayoutStringFb = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 141,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Current Layout Fb",
+ JoinCapabilities = eJoinCapabilities.ToSIMPL,
+ JoinType = eJoinType.Serial
+ });
+
+ [JoinName("CurrentParticipants")]
+ public JoinDataComplete CurrentParticipants = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 151,
+ JoinSpan = 1
+ },
+ new JoinMetadata()
+ {
+ Description = "Current Participants XSig",
+ JoinCapabilities = eJoinCapabilities.ToSIMPL,
+ JoinType = eJoinType.Serial
+ });
+
+ [JoinName("CurrentSource")]
+ public JoinDataComplete CurrentSource = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 201,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Current Source",
+ JoinCapabilities = eJoinCapabilities.ToSIMPL,
+ JoinType = eJoinType.Serial
+ });
+
+ [JoinName("SelfviewPositionFb")]
+ public JoinDataComplete SelfviewPositionFb = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 211,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "advance selfview position",
+ JoinCapabilities = eJoinCapabilities.ToSIMPL,
+ JoinType = eJoinType.Serial
+ });
+
+ [JoinName("DirectoryEntrySelectedName")]
+ public JoinDataComplete DirectoryEntrySelectedName = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 356,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Selected Directory Entry Name",
+ JoinCapabilities = eJoinCapabilities.ToSIMPL,
+ JoinType = eJoinType.Serial
+ });
+
+ [JoinName("DirectoryEntrySelectedNumber")]
+ public JoinDataComplete DirectoryEntrySelectedNumber = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 357,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Selected Directory Entry Number",
+ JoinCapabilities = eJoinCapabilities.ToSIMPL,
+ JoinType = eJoinType.Serial
+ });
+
+ [JoinName("DirectorySelectedFolderName")]
+ public JoinDataComplete DirectorySelectedFolderName = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 358,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Selected Directory Folder Name",
+ JoinCapabilities = eJoinCapabilities.ToSIMPL,
+ JoinType = eJoinType.Serial
+ });
+
+ #endregion
+
+
+ public VideoCodecControllerJoinMap(uint joinStart)
+ : base(joinStart, typeof(VideoCodecControllerJoinMap))
+ {
+ }
+
+ public VideoCodecControllerJoinMap(uint joinStart, Type type)
+ : base(joinStart, type)
+ {
+ }
+ }
+}
+
namespace PepperDash_Essentials_Core.Bridges.JoinMaps
{
- public class VideoCodecControllerJoinMap : JoinMapBaseAdvanced
- {
- #region Status
+ [Obsolete("Use PepperDash.Essentials.Core.Bridges.JoinMaps")]
+ public class VideoCodecControllerJoinMap : JoinMapBaseAdvanced
+ {
- [JoinName("IsOnline")] public JoinDataComplete IsOnline =
- new JoinDataComplete(new JoinData {JoinNumber = 1, JoinSpan = 1},
- new JoinMetadata
- {
- Description = "Device is Online",
- JoinCapabilities = eJoinCapabilities.ToSIMPL,
- JoinType = eJoinType.Digital
- });
+ #region Digital
- #endregion
+ [JoinName("IsOnline")]
+ public JoinDataComplete IsOnline = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 1,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Device is Online",
+ JoinCapabilities = eJoinCapabilities.ToSIMPL,
+ JoinType = eJoinType.Digital
+ });
- [JoinName("CallDirection")] public JoinDataComplete CallDirection =
- new JoinDataComplete(new JoinData {JoinNumber = 22, JoinSpan = 1},
- new JoinMetadata
- {
- Description = "Current Call Direction",
- JoinCapabilities = eJoinCapabilities.ToSIMPL,
- JoinType = eJoinType.Serial
- });
+ [JoinName("1")]
+ public JoinDataComplete Dtmf1 = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 11,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "DTMF 1",
+ JoinCapabilities = eJoinCapabilities.FromSIMPL,
+ JoinType = eJoinType.Digital
+ });
- [JoinName("CameraLayout")] public JoinDataComplete CameraLayout =
- new JoinDataComplete(new JoinData {JoinNumber = 142, JoinSpan = 1},
- new JoinMetadata
- {
- Description = "Camera Layout Toggle",
- JoinCapabilities = eJoinCapabilities.FromSIMPL,
- JoinType = eJoinType.Digital
- });
+ [JoinName("2")]
+ public JoinDataComplete Dtmf2 = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 12,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "DTMF 2",
+ JoinCapabilities = eJoinCapabilities.FromSIMPL,
+ JoinType = eJoinType.Digital
+ });
- [JoinName("CameraLayoutStringFb")] public JoinDataComplete CameraLayoutStringFb =
- new JoinDataComplete(new JoinData {JoinNumber = 141, JoinSpan = 1},
- new JoinMetadata
- {
- Description = "Current Layout Fb",
- JoinCapabilities = eJoinCapabilities.ToSIMPL,
- JoinType = eJoinType.Analog
- });
+ [JoinName("3")]
+ public JoinDataComplete Dtmf3 = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 13,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "DTMF 3",
+ JoinCapabilities = eJoinCapabilities.FromSIMPL,
+ JoinType = eJoinType.Digital
+ });
- [JoinName("CameraModeAuto")] public JoinDataComplete CameraModeAuto =
- new JoinDataComplete(new JoinData {JoinNumber = 131, JoinSpan = 1},
- new JoinMetadata
- {
- Description = "Camera Mode Auto",
- JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
- JoinType = eJoinType.Digital
- });
+ [JoinName("4")]
+ public JoinDataComplete Dtmf4 = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 14,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "DTMF 4",
+ JoinCapabilities = eJoinCapabilities.FromSIMPL,
+ JoinType = eJoinType.Digital
+ });
- [JoinName("CameraModeManual")] public JoinDataComplete CameraModeManual =
- new JoinDataComplete(new JoinData {JoinNumber = 132, JoinSpan = 1},
- new JoinMetadata
- {
- Description = "Camera Mode Manual",
- JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
- JoinType = eJoinType.Digital
- });
+ [JoinName("5")]
+ public JoinDataComplete Dtmf5 = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 15,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "DTMF 5",
+ JoinCapabilities = eJoinCapabilities.FromSIMPL,
+ JoinType = eJoinType.Digital
+ });
- [JoinName("CameraModeOff")] public JoinDataComplete CameraModeOff =
- new JoinDataComplete(new JoinData {JoinNumber = 133, JoinSpan = 1},
- new JoinMetadata
- {
- Description = "Camera Mode Off",
- JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
- JoinType = eJoinType.Digital
- });
+ [JoinName("6")]
+ public JoinDataComplete Dtmf6 = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 16,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "DTMF 6",
+ JoinCapabilities = eJoinCapabilities.FromSIMPL,
+ JoinType = eJoinType.Digital
+ });
- [JoinName("CameraNumberSelect")] public JoinDataComplete CameraNumberSelect =
- new JoinDataComplete(new JoinData {JoinNumber = 60, JoinSpan = 1},
- new JoinMetadata
- {
- Description = "Camera Number Select/FB",
- JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
- JoinType = eJoinType.Analog
- });
+ [JoinName("7")]
+ public JoinDataComplete Dtmf7 = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 17,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "DTMF 7",
+ JoinCapabilities = eJoinCapabilities.FromSIMPL,
+ JoinType = eJoinType.Digital
+ });
- [JoinName("CameraPanLeft")] public JoinDataComplete CameraPanLeft =
- new JoinDataComplete(new JoinData {JoinNumber = 113, JoinSpan = 1},
- new JoinMetadata
- {
- Description = "Camera Pan Left",
- JoinCapabilities = eJoinCapabilities.FromSIMPL,
- JoinType = eJoinType.Digital
- });
+ [JoinName("8")]
+ public JoinDataComplete Dtmf8 = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 18,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "DTMF 8",
+ JoinCapabilities = eJoinCapabilities.FromSIMPL,
+ JoinType = eJoinType.Digital
+ });
- [JoinName("CameraPanRight")] public JoinDataComplete CameraPanRight =
- new JoinDataComplete(new JoinData {JoinNumber = 114, JoinSpan = 1},
- new JoinMetadata
- {
- Description = "Camera Pan Right",
- JoinCapabilities = eJoinCapabilities.FromSIMPL,
- JoinType = eJoinType.Digital
- });
+ [JoinName("9")]
+ public JoinDataComplete Dtmf9 = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 19,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "DTMF 9",
+ JoinCapabilities = eJoinCapabilities.FromSIMPL,
+ JoinType = eJoinType.Digital
+ });
- [JoinName("CameraPresetNames")] public JoinDataComplete CameraPresetNames =
- new JoinDataComplete(new JoinData {JoinNumber = 121, JoinSpan = 1},
- new JoinMetadata
- {
- Description = "Camera Preset Names - XSIG, max of 15",
- JoinCapabilities = eJoinCapabilities.ToSIMPL,
- JoinType = eJoinType.Serial
- });
+ [JoinName("0")]
+ public JoinDataComplete Dtmf0 = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 20,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "DTMF 0",
+ JoinCapabilities = eJoinCapabilities.FromSIMPL,
+ JoinType = eJoinType.Digital
+ });
- [JoinName("CameraPresetSelect")] public JoinDataComplete CameraPresetSelect =
- new JoinDataComplete(new JoinData {JoinNumber = 121, JoinSpan = 1},
- new JoinMetadata
- {
- Description = "Camera Preset Select",
- JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
- JoinType = eJoinType.Analog
- });
+ [JoinName("*")]
+ public JoinDataComplete DtmfStar = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 21,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "DTMF *",
+ JoinCapabilities = eJoinCapabilities.FromSIMPL,
+ JoinType = eJoinType.Digital
+ });
- [JoinName("CameraPresetSave")] public JoinDataComplete CameraPresetSave =
- new JoinDataComplete(new JoinData {JoinNumber = 121, JoinSpan = 1},
- new JoinMetadata
- {
- Description = "Save Selected Preset",
- JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
- JoinType = eJoinType.Digital
- });
+ [JoinName("#")]
+ public JoinDataComplete DtmfPound = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 22,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "DTMF #",
+ JoinCapabilities = eJoinCapabilities.FromSIMPL,
+ JoinType = eJoinType.Digital
+ });
- [JoinName("CameraSelfView")] public JoinDataComplete CameraSelfView =
- new JoinDataComplete(new JoinData {JoinNumber = 141, JoinSpan = 1},
- new JoinMetadata
- {
- Description = "Camera Self View Toggle/FB",
- JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
- JoinType = eJoinType.Digital
- });
+ [JoinName("EndCall")]
+ public JoinDataComplete EndCall = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 24,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Hang Up",
+ JoinCapabilities = eJoinCapabilities.FromSIMPL,
+ JoinType = eJoinType.Digital
+ });
- [JoinName("CameraSupportsAutoMode")] public JoinDataComplete CameraSupportsAutoMode =
- new JoinDataComplete(new JoinData {JoinNumber = 143, JoinSpan = 1},
- new JoinMetadata
- {
- Description = "Camera Supports Auto Mode FB",
- JoinCapabilities = eJoinCapabilities.ToSIMPL,
- JoinType = eJoinType.Digital
- });
+ [JoinName("HookState")]
+ public JoinDataComplete HookState = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 31,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Current Hook State",
+ JoinCapabilities = eJoinCapabilities.ToSIMPL,
+ JoinType = eJoinType.Digital
+ });
- [JoinName("CameraSupportsOffMode")] public JoinDataComplete CameraSupportsOffMode =
- new JoinDataComplete(new JoinData {JoinNumber = 144, JoinSpan = 1},
- new JoinMetadata
- {
- Description = "Camera Supports Off Mode FB",
- JoinCapabilities = eJoinCapabilities.ToSIMPL,
- JoinType = eJoinType.Digital
- });
+ [JoinName("SpeedDialStart")]
+ public JoinDataComplete SpeedDialStart = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 41,
+ JoinSpan = 4
+ },
+ new JoinMetadata
+ {
+ Description = "Speed Dial",
+ JoinCapabilities = eJoinCapabilities.ToSIMPL,
+ JoinType = eJoinType.Digital
+ });
- [JoinName("CameraTiltDown")] public JoinDataComplete CameraTiltDown =
- new JoinDataComplete(new JoinData {JoinNumber = 112, JoinSpan = 1},
- new JoinMetadata
- {
- Description = "Camera Tilt Down",
- JoinCapabilities = eJoinCapabilities.FromSIMPL,
- JoinType = eJoinType.Digital
- });
+ [JoinName("IncomingCall")]
+ public JoinDataComplete IncomingCall = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 50,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Incoming Call",
+ JoinCapabilities = eJoinCapabilities.ToSIMPL,
+ JoinType = eJoinType.Digital
+ });
- [JoinName("CameraTiltUp")] public JoinDataComplete CameraTiltUp =
- new JoinDataComplete(new JoinData {JoinNumber = 111, JoinSpan = 1},
- new JoinMetadata
- {
- Description = "Camera Tilt Up",
- JoinCapabilities = eJoinCapabilities.FromSIMPL,
- JoinType = eJoinType.Digital
- });
+ [JoinName("IncomingAnswer")]
+ public JoinDataComplete IncomingAnswer = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 51,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Answer Incoming Call",
+ JoinCapabilities = eJoinCapabilities.FromSIMPL,
+ JoinType = eJoinType.Digital
+ });
- [JoinName("CameraZoomIn")] public JoinDataComplete CameraZoomIn =
- new JoinDataComplete(new JoinData {JoinNumber = 115, JoinSpan = 1},
- new JoinMetadata
- {
- Description = "Camera Zoom In",
- JoinCapabilities = eJoinCapabilities.FromSIMPL,
- JoinType = eJoinType.Digital
- });
+ [JoinName("IncomingReject")]
+ public JoinDataComplete IncomingReject = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 52,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Reject Incoming Call",
+ JoinCapabilities = eJoinCapabilities.FromSIMPL,
+ JoinType = eJoinType.Digital
+ });
- [JoinName("CameraZoomOut")] public JoinDataComplete CameraZoomOut =
- new JoinDataComplete(new JoinData {JoinNumber = 116, JoinSpan = 1},
- new JoinMetadata
- {
- Description = "Camera Zoom Out",
- JoinCapabilities = eJoinCapabilities.FromSIMPL,
- JoinType = eJoinType.Digital
- });
+ [JoinName("ManualDial")]
+ public JoinDataComplete ManualDial = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 71,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Dial manual string",
+ JoinCapabilities = eJoinCapabilities.FromSIMPL,
+ JoinType = eJoinType.Digital
+ });
- [JoinName("CurrentCallName")] public JoinDataComplete CurrentCallData =
- new JoinDataComplete(new JoinData {JoinNumber = 2, JoinSpan = 1},
- new JoinMetadata
- {
- Description = "Current Call Data - XSIG",
- JoinCapabilities = eJoinCapabilities.ToSIMPL,
- JoinType = eJoinType.Serial
- });
+ [JoinName("DialPhoneCall")]
+ public JoinDataComplete DialPhone = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 72,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Dial Phone",
+ JoinCapabilities = eJoinCapabilities.FromSIMPL,
+ JoinType = eJoinType.Digital
+ });
- [JoinName("CurrentDialString")] public JoinDataComplete CurrentDialString =
- new JoinDataComplete(new JoinData {JoinNumber = 1, JoinSpan = 1},
- new JoinMetadata
- {
- Description = "Current Dial String",
- JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
- JoinType = eJoinType.Serial
- });
+ [JoinName("PhoneHookState")]
+ public JoinDataComplete PhoneHookState = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 72,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Dial Phone",
+ JoinCapabilities = eJoinCapabilities.ToSIMPL,
+ JoinType = eJoinType.Digital
+ });
- [JoinName("CurrentParticipants")] public JoinDataComplete CurrentParticipants =
- new JoinDataComplete(new JoinData {JoinNumber = 151, JoinSpan = 1},
- new JoinMetadata()
- {
- Description = "Current Participants XSig",
- JoinCapabilities = eJoinCapabilities.ToSIMPL,
- JoinType = eJoinType.Serial
- });
+ [JoinName("EndPhoneCall")]
+ public JoinDataComplete HangUpPhone = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 73,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Hang Up PHone",
+ JoinCapabilities = eJoinCapabilities.FromSIMPL,
+ JoinType = eJoinType.Digital
+ });
- [JoinName("CurrentSource")] public JoinDataComplete CurrentSource =
- new JoinDataComplete(new JoinData {JoinNumber = 201, JoinSpan = 1},
- new JoinMetadata
- {
- Description = "Current Source",
- JoinCapabilities = eJoinCapabilities.ToSIMPL,
- JoinType = eJoinType.Serial
- });
+ [JoinName("DirectorySearchBusy")]
+ public JoinDataComplete DirectorySearchBusy = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 100,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Directory Search Busy FB",
+ JoinCapabilities = eJoinCapabilities.ToSIMPL,
+ JoinType = eJoinType.Digital
+ });
- [JoinName("DialMeeting1")] public JoinDataComplete DialMeeting1 =
- new JoinDataComplete(new JoinData {JoinNumber = 161, JoinSpan = 1},
- new JoinMetadata
- {
- Description = "Join first meeting",
- JoinCapabilities = eJoinCapabilities.FromSIMPL,
- JoinType = eJoinType.Digital
- });
+ [JoinName("DirectoryEntryIsContact")]
+ public JoinDataComplete DirectoryEntryIsContact = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 101,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Directory Selected Entry Is Contact FB",
+ JoinCapabilities = eJoinCapabilities.ToSIMPL,
+ JoinType = eJoinType.Digital
+ });
- [JoinName("DialMeeting2")]
- public JoinDataComplete DialMeeting2 =
- new JoinDataComplete(new JoinData { JoinNumber = 162, JoinSpan = 1 },
+ [JoinName("DirectoryLineSelected")]
+ public JoinDataComplete DirectoryLineSelected = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 101,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Directory Line Selected FB",
+ JoinCapabilities = eJoinCapabilities.FromSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("DirectoryIsRoot")]
+ public JoinDataComplete DirectoryIsRoot = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 102,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Directory is on Root FB",
+ JoinCapabilities = eJoinCapabilities.ToSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("DirectoryHasChanged")]
+ public JoinDataComplete DirectoryHasChanged = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 103,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Directory has changed FB",
+ JoinCapabilities = eJoinCapabilities.ToSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("DirectoryRoot")]
+ public JoinDataComplete DirectoryRoot = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 104,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Go to Directory Root",
+ JoinCapabilities = eJoinCapabilities.ToSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("DirectoryFolderBack")]
+ public JoinDataComplete DirectoryFolderBack = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 105,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Go back one directory level",
+ JoinCapabilities = eJoinCapabilities.FromSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("DirectoryDialSelectedLine")]
+ public JoinDataComplete DirectoryDialSelectedLine = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 106,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Dial selected directory line",
+ JoinCapabilities = eJoinCapabilities.FromSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+
+ [JoinName("CameraTiltUp")]
+ public JoinDataComplete CameraTiltUp = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 111,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Camera Tilt Up",
+ JoinCapabilities = eJoinCapabilities.FromSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("CameraTiltDown")]
+ public JoinDataComplete CameraTiltDown = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 112,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Camera Tilt Down",
+ JoinCapabilities = eJoinCapabilities.FromSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("CameraPanLeft")]
+ public JoinDataComplete CameraPanLeft = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 113,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Camera Pan Left",
+ JoinCapabilities = eJoinCapabilities.FromSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("CameraPanRight")]
+ public JoinDataComplete CameraPanRight = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 114,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Camera Pan Right",
+ JoinCapabilities = eJoinCapabilities.FromSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("CameraZoomIn")]
+ public JoinDataComplete CameraZoomIn = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 115,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Camera Zoom In",
+ JoinCapabilities = eJoinCapabilities.FromSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("CameraZoomOut")]
+ public JoinDataComplete CameraZoomOut = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 116,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Camera Zoom Out",
+ JoinCapabilities = eJoinCapabilities.FromSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("CameraPresetSave")]
+ public JoinDataComplete CameraPresetSave = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 121,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Save Selected Preset",
+ JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("CameraModeAuto")]
+ public JoinDataComplete CameraModeAuto = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 131,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Camera Mode Auto",
+ JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("CameraModeManual")]
+ public JoinDataComplete CameraModeManual = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 132,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Camera Mode Manual",
+ JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("CameraModeOff")]
+ public JoinDataComplete CameraModeOff = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 133,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Camera Mode Off",
+ JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("CameraSelfView")]
+ public JoinDataComplete CameraSelfView = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 141,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Camera Self View Toggle/FB",
+ JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("CameraLayout")]
+ public JoinDataComplete CameraLayout = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 142,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Camera Layout Toggle",
+ JoinCapabilities = eJoinCapabilities.FromSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("CameraSupportsAutoMode")]
+ public JoinDataComplete CameraSupportsAutoMode = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 143,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Camera Supports Auto Mode FB",
+ JoinCapabilities = eJoinCapabilities.ToSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("CameraSupportsOffMode")]
+ public JoinDataComplete CameraSupportsOffMode = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 144,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Camera Supports Off Mode FB",
+ JoinCapabilities = eJoinCapabilities.ToSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("UpdateMeetings")]
+ public JoinDataComplete UpdateMeetings = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 160,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Update Meetings",
+ JoinCapabilities = eJoinCapabilities.FromSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("DialMeeting1")]
+ public JoinDataComplete DialMeeting1 = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 161,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Join first meeting",
+ JoinCapabilities = eJoinCapabilities.FromSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("DialMeeting2")]
+ public JoinDataComplete DialMeeting2 = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 162,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Join second meeting",
+ JoinCapabilities = eJoinCapabilities.FromSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("DialMeeting3")]
+ public JoinDataComplete DialMeeting3 = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 163,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Join third meeting",
+ JoinCapabilities = eJoinCapabilities.FromSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("MicMuteOn")]
+ public JoinDataComplete MicMuteOn = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 171,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Mic Mute On",
+ JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("MicMuteOff")]
+ public JoinDataComplete MicMuteOff = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 172,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Mic Mute Off",
+ JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("MicMuteToggle")]
+ public JoinDataComplete MicMuteToggle = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 173,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Mic Mute Toggle",
+ JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("VolumeUp")]
+ public JoinDataComplete VolumeUp = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 174,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Volume Up",
+ JoinCapabilities = eJoinCapabilities.FromSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("VolumeDown")]
+ public JoinDataComplete VolumeDown = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 175,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Volume Down",
+ JoinCapabilities = eJoinCapabilities.FromSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("VolumeMuteOn")]
+ public JoinDataComplete VolumeMuteOn = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 176,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Volume Mute On",
+ JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("VolumeMuteOff")]
+ public JoinDataComplete VolumeMuteOff = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 177,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Volume Mute Off",
+ JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("VolumeMuteToggle")]
+ public JoinDataComplete VolumeMuteToggle = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 178,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Volume Mute Toggle",
+ JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("SourceShareStart")]
+ public JoinDataComplete SourceShareStart = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 201,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Start Sharing & Feedback",
+ JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("SourceShareEnd")]
+ public JoinDataComplete SourceShareEnd = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 202,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Stop Sharing & Feedback",
+ JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("AutoShareWhileInCall")]
+ public JoinDataComplete SourceShareAutoStart = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 203,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "When high, will autostart sharing when a call is joined",
+ JoinCapabilities = eJoinCapabilities.FromSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("RecievingContent")]
+ public JoinDataComplete RecievingContent = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 204,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Recieving content from the far end",
+ JoinType = eJoinType.Digital,
+ JoinCapabilities = eJoinCapabilities.ToSIMPL
+ });
+
+ [JoinName("SelfviewPosition")]
+ public JoinDataComplete SelfviewPosition = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 211,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "advance selfview position",
+ JoinCapabilities = eJoinCapabilities.FromSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("ParticipantAudioMuteToggleStart")]
+ public JoinDataComplete ParticipantAudioMuteToggleStart = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 500,
+ JoinSpan = 50
+ },
new JoinMetadata
{
- Description = "Join second meeting",
- JoinCapabilities = eJoinCapabilities.FromSIMPL,
- JoinType = eJoinType.Digital
- });
-
- [JoinName("DialMeeting3")]
- public JoinDataComplete DialMeeting3 =
- new JoinDataComplete(new JoinData { JoinNumber = 163, JoinSpan = 1 },
- new JoinMetadata
- {
- Description = "Join third meeting",
- JoinCapabilities = eJoinCapabilities.FromSIMPL,
- JoinType = eJoinType.Digital
- });
-
- [JoinName("DirectoryDialSelectedLine")] public JoinDataComplete DirectoryDialSelectedLine =
- new JoinDataComplete(new JoinData {JoinNumber = 106, JoinSpan = 1},
- new JoinMetadata
- {
- Description = "Dial selected directory line",
- JoinCapabilities = eJoinCapabilities.FromSIMPL,
- JoinType = eJoinType.Digital
- });
-
- [JoinName("DirectoryEntries")] public JoinDataComplete DirectoryEntries =
- new JoinDataComplete(new JoinData {JoinNumber = 101, JoinSpan = 1},
- new JoinMetadata
- {
- Description = "Directory Entries - XSig, 255 entries",
- JoinCapabilities = eJoinCapabilities.ToSIMPL,
- JoinType = eJoinType.Serial
- });
-
- [JoinName("DirectoryEntryIsContact")] public JoinDataComplete DirectoryEntryIsContact =
- new JoinDataComplete(new JoinData {JoinNumber = 101, JoinSpan = 1},
- new JoinMetadata
- {
- Description = "Directory Selected Entry Is Contact FB",
- JoinCapabilities = eJoinCapabilities.ToSIMPL,
- JoinType = eJoinType.Digital
- });
-
- [JoinName("DirectoryEntrySelectedName")] public JoinDataComplete DirectoryEntrySelectedName =
- new JoinDataComplete(new JoinData {JoinNumber = 356, JoinSpan = 1},
- new JoinMetadata
- {
- Description = "Selected Directory Entry Name",
- JoinCapabilities = eJoinCapabilities.ToSIMPL,
- JoinType = eJoinType.Serial
- });
-
- [JoinName("DirectoryEntrySelectedNumber")] public JoinDataComplete DirectoryEntrySelectedNumber =
- new JoinDataComplete(new JoinData {JoinNumber = 357, JoinSpan = 1},
- new JoinMetadata
- {
- Description = "Selected Directory Entry Number",
- JoinCapabilities = eJoinCapabilities.ToSIMPL,
- JoinType = eJoinType.Serial
- });
-
- [JoinName("DirectoryFolderBack")] public JoinDataComplete DirectoryFolderBack =
- new JoinDataComplete(new JoinData {JoinNumber = 105, JoinSpan = 1},
- new JoinMetadata
- {
- Description = "Go back one directory level",
- JoinCapabilities = eJoinCapabilities.FromSIMPL,
- JoinType = eJoinType.Digital
- });
-
- [JoinName("DirectoryHasChanged")] public JoinDataComplete DirectoryHasChanged =
- new JoinDataComplete(new JoinData {JoinNumber = 103, JoinSpan = 1},
- new JoinMetadata
- {
- Description = "Directory has changed FB",
- JoinCapabilities = eJoinCapabilities.ToSIMPL,
- JoinType = eJoinType.Digital
- });
-
- [JoinName("DirectoryIsRoot")] public JoinDataComplete DirectoryIsRoot =
- new JoinDataComplete(new JoinData {JoinNumber = 102, JoinSpan = 1},
- new JoinMetadata
- {
- Description = "Directory is on Root FB",
- JoinCapabilities = eJoinCapabilities.ToSIMPL,
- JoinType = eJoinType.Digital
- });
-
- [JoinName("DirectoryLineSelected")] public JoinDataComplete DirectoryLineSelected =
- new JoinDataComplete(new JoinData {JoinNumber = 101, JoinSpan = 1},
- new JoinMetadata
- {
- Description = "Directory Line Selected FB",
- JoinCapabilities = eJoinCapabilities.FromSIMPL,
- JoinType = eJoinType.Digital
- });
-
- [JoinName("DirectoryRoot")] public JoinDataComplete DirectoryRoot =
- new JoinDataComplete(new JoinData {JoinNumber = 104, JoinSpan = 1},
- new JoinMetadata
- {
- Description = "Go to Directory Root",
- JoinCapabilities = eJoinCapabilities.ToSIMPL,
- JoinType = eJoinType.Digital
- });
-
- [JoinName("DirectoryRowCount")] public JoinDataComplete DirectoryRowCount =
- new JoinDataComplete(new JoinData {JoinNumber = 101, JoinSpan = 1},
- new JoinMetadata
- {
- Description = "Directory Row Count FB",
- JoinCapabilities = eJoinCapabilities.ToSIMPL,
- JoinType = eJoinType.Analog
- });
-
- [JoinName("DirectorySearchBusy")] public JoinDataComplete DirectorySearchBusy =
- new JoinDataComplete(new JoinData {JoinNumber = 100, JoinSpan = 1},
- new JoinMetadata
- {
- Description = "Directory Search Busy FB",
- JoinCapabilities = eJoinCapabilities.ToSIMPL,
- JoinType = eJoinType.Digital
- });
-
- [JoinName("DirectorySearchString")] public JoinDataComplete DirectorySearchString =
- new JoinDataComplete(new JoinData {JoinNumber = 100, JoinSpan = 1},
- new JoinMetadata
- {
- Description = "Directory Search String",
- JoinCapabilities = eJoinCapabilities.FromSIMPL,
- JoinType = eJoinType.Serial
- });
-
- [JoinName("DirectorySelectRow")] public JoinDataComplete DirectorySelectRow =
- new JoinDataComplete(new JoinData {JoinNumber = 101, JoinSpan = 1},
- new JoinMetadata
- {
- Description = "Directory Select Row",
- JoinCapabilities = eJoinCapabilities.FromSIMPL,
- JoinType = eJoinType.Analog
- });
-
- [JoinName("DirectorySelectedFolderName")] public JoinDataComplete DirectorySelectedFolderName =
- new JoinDataComplete(new JoinData {JoinNumber = 358, JoinSpan = 1},
- new JoinMetadata
- {
- Description = "Selected Directory Folder Name",
- JoinCapabilities = eJoinCapabilities.ToSIMPL,
- JoinType = eJoinType.Serial
- });
-
- [JoinName("0")] public JoinDataComplete Dtmf0 =
- new JoinDataComplete(new JoinData {JoinNumber = 20, JoinSpan = 1},
- new JoinMetadata
- {
- Description = "DTMF 0",
- JoinCapabilities = eJoinCapabilities.FromSIMPL,
- JoinType = eJoinType.Digital
- });
-
- [JoinName("1")] public JoinDataComplete Dtmf1 =
- new JoinDataComplete(new JoinData {JoinNumber = 11, JoinSpan = 1},
- new JoinMetadata
- {
- Description = "DTMF 1",
- JoinCapabilities = eJoinCapabilities.FromSIMPL,
- JoinType = eJoinType.Digital
- });
-
- [JoinName("2")] public JoinDataComplete Dtmf2 =
- new JoinDataComplete(new JoinData {JoinNumber = 12, JoinSpan = 1},
- new JoinMetadata
- {
- Description = "DTMF 2",
- JoinCapabilities = eJoinCapabilities.FromSIMPL,
- JoinType = eJoinType.Digital
- });
-
- [JoinName("3")] public JoinDataComplete Dtmf3 =
- new JoinDataComplete(new JoinData {JoinNumber = 13, JoinSpan = 1},
- new JoinMetadata
- {
- Description = "DTMF 3",
- JoinCapabilities = eJoinCapabilities.FromSIMPL,
- JoinType = eJoinType.Digital
- });
-
- [JoinName("4")] public JoinDataComplete Dtmf4 =
- new JoinDataComplete(new JoinData {JoinNumber = 14, JoinSpan = 1},
- new JoinMetadata
- {
- Description = "DTMF 4",
- JoinCapabilities = eJoinCapabilities.FromSIMPL,
- JoinType = eJoinType.Digital
- });
-
- [JoinName("5")] public JoinDataComplete Dtmf5 =
- new JoinDataComplete(new JoinData {JoinNumber = 15, JoinSpan = 1},
- new JoinMetadata
- {
- Description = "DTMF 5",
- JoinCapabilities = eJoinCapabilities.FromSIMPL,
- JoinType = eJoinType.Digital
- });
-
- [JoinName("6")] public JoinDataComplete Dtmf6 =
- new JoinDataComplete(new JoinData {JoinNumber = 16, JoinSpan = 1},
- new JoinMetadata
- {
- Description = "DTMF 6",
- JoinCapabilities = eJoinCapabilities.FromSIMPL,
- JoinType = eJoinType.Digital
- });
-
- [JoinName("7")] public JoinDataComplete Dtmf7 =
- new JoinDataComplete(new JoinData {JoinNumber = 17, JoinSpan = 1},
- new JoinMetadata
- {
- Description = "DTMF 7",
- JoinCapabilities = eJoinCapabilities.FromSIMPL,
- JoinType = eJoinType.Digital
- });
-
- [JoinName("8")] public JoinDataComplete Dtmf8 =
- new JoinDataComplete(new JoinData {JoinNumber = 18, JoinSpan = 1},
- new JoinMetadata
- {
- Description = "DTMF 8",
- JoinCapabilities = eJoinCapabilities.FromSIMPL,
- JoinType = eJoinType.Digital
- });
-
- [JoinName("9")] public JoinDataComplete Dtmf9 =
- new JoinDataComplete(new JoinData {JoinNumber = 19, JoinSpan = 1},
- new JoinMetadata
- {
- Description = "DTMF 9",
- JoinCapabilities = eJoinCapabilities.FromSIMPL,
- JoinType = eJoinType.Digital
- });
-
- [JoinName("#")] public JoinDataComplete DtmfPound =
- new JoinDataComplete(new JoinData {JoinNumber = 22, JoinSpan = 1},
- new JoinMetadata
- {
- Description = "DTMF #",
- JoinCapabilities = eJoinCapabilities.FromSIMPL,
- JoinType = eJoinType.Digital
- });
-
- [JoinName("*")] public JoinDataComplete DtmfStar =
- new JoinDataComplete(new JoinData {JoinNumber = 21, JoinSpan = 1},
- new JoinMetadata
- {
- Description = "DTMF *",
- JoinCapabilities = eJoinCapabilities.FromSIMPL,
- JoinType = eJoinType.Digital
- });
-
- [JoinName("EndCall")] public JoinDataComplete EndCall =
- new JoinDataComplete(new JoinData {JoinNumber = 24, JoinSpan = 1},
- new JoinMetadata
- {
- Description = "Hang Up",
- JoinCapabilities = eJoinCapabilities.FromSIMPL,
- JoinType = eJoinType.Digital
- });
-
- [JoinName("HookState")] public JoinDataComplete HookState =
- new JoinDataComplete(new JoinData {JoinNumber = 31, JoinSpan = 1},
- new JoinMetadata
- {
- Description = "Current Hook State",
- JoinCapabilities = eJoinCapabilities.ToSIMPL,
- JoinType = eJoinType.Digital
- });
-
- [JoinName("IncomingAnswer")] public JoinDataComplete IncomingAnswer =
- new JoinDataComplete(new JoinData {JoinNumber = 51, JoinSpan = 1},
- new JoinMetadata
- {
- Description = "Answer Incoming Call",
- JoinCapabilities = eJoinCapabilities.FromSIMPL,
- JoinType = eJoinType.Digital
- });
-
- [JoinName("IncomingCall")] public JoinDataComplete IncomingCall =
- new JoinDataComplete(new JoinData {JoinNumber = 50, JoinSpan = 1},
- new JoinMetadata
- {
- Description = "Incoming Call",
- JoinCapabilities = eJoinCapabilities.ToSIMPL,
- JoinType = eJoinType.Digital
- });
-
- [JoinName("IncomingCallName")] public JoinDataComplete IncomingCallName =
- new JoinDataComplete(new JoinData {JoinNumber = 51, JoinSpan = 1},
- new JoinMetadata
- {
- Description = "Incoming Call Name",
- JoinCapabilities = eJoinCapabilities.ToSIMPL,
- JoinType = eJoinType.Serial
- });
-
- [JoinName("IncomingCallNumber")] public JoinDataComplete IncomingCallNumber =
- new JoinDataComplete(new JoinData {JoinNumber = 52, JoinSpan = 1},
- new JoinMetadata
- {
- Description = "Incoming Call Number",
- JoinCapabilities = eJoinCapabilities.ToSIMPL,
- JoinType = eJoinType.Serial
- });
-
- [JoinName("IncomingReject")] public JoinDataComplete IncomingReject =
- new JoinDataComplete(new JoinData {JoinNumber = 52, JoinSpan = 1},
- new JoinMetadata
- {
- Description = "Reject Incoming Call",
- JoinCapabilities = eJoinCapabilities.FromSIMPL,
- JoinType = eJoinType.Digital
- });
-
-
- [JoinName("ManualDial")] public JoinDataComplete ManualDial =
- new JoinDataComplete(new JoinData {JoinNumber = 71, JoinSpan = 1},
- new JoinMetadata
- {
- Description = "Dial manual string",
- JoinCapabilities = eJoinCapabilities.FromSIMPL,
- JoinType = eJoinType.Digital
- });
-
- [JoinName("Meeting Count Fb")] public JoinDataComplete MeetingCount =
- new JoinDataComplete(new JoinData {JoinNumber = 161, JoinSpan = 1},
- new JoinMetadata
- {
- Description = "Meeting Count",
- JoinCapabilities = eJoinCapabilities.ToSIMPL,
- JoinType = eJoinType.Analog
- });
-
- [JoinName("MicMuteOff")] public JoinDataComplete MicMuteOff =
- new JoinDataComplete(new JoinData {JoinNumber = 172, JoinSpan = 1},
- new JoinMetadata
- {
- Description = "Mic Mute Off",
- JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
- JoinType = eJoinType.Digital
- });
-
- [JoinName("MicMuteOn")] public JoinDataComplete MicMuteOn =
- new JoinDataComplete(new JoinData {JoinNumber = 171, JoinSpan = 1},
- new JoinMetadata
- {
- Description = "Mic Mute On",
- JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
- JoinType = eJoinType.Digital
- });
-
- [JoinName("MicMuteToggle")] public JoinDataComplete MicMuteToggle =
- new JoinDataComplete(new JoinData {JoinNumber = 173, JoinSpan = 1},
- new JoinMetadata
- {
- Description = "Mic Mute Toggle",
- JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
- JoinType = eJoinType.Digital
- });
-
- [JoinName("MinutesBeforeMeetingStart")] public JoinDataComplete MinutesBeforeMeetingStart =
- new JoinDataComplete(new JoinData {JoinNumber = 41, JoinSpan = 1},
- new JoinMetadata
- {
- Description = "Minutes before meeting start that a meeting is joinable",
- JoinCapabilities = eJoinCapabilities.FromSIMPL,
- JoinType = eJoinType.Analog
- });
-
- [JoinName("ParticipantCount")] public JoinDataComplete ParticipantCount =
- new JoinDataComplete(new JoinData {JoinNumber = 151, JoinSpan = 1},
- new JoinMetadata
- {
- Description = "Current Participant Count",
- JoinCapabilities = eJoinCapabilities.ToSIMPL,
- JoinType = eJoinType.Analog
- });
-
- [JoinName("Schedule")] public JoinDataComplete Schedule =
- new JoinDataComplete(new JoinData {JoinNumber = 102, JoinSpan = 1},
- new JoinMetadata
- {
- Description = "Schedule Data - XSIG",
- JoinCapabilities = eJoinCapabilities.ToSIMPL,
- JoinType = eJoinType.Serial
- });
-
- [JoinName("AutoShareWhileInCall")] public JoinDataComplete SourceShareAutoStart =
- new JoinDataComplete(new JoinData {JoinNumber = 203, JoinSpan = 1},
- new JoinMetadata
- {
- Description = "When high, will autostart sharing when a call is joined",
- JoinCapabilities = eJoinCapabilities.FromSIMPL,
- JoinType = eJoinType.Digital
- });
-
- [JoinName("SourceShareEnd")] public JoinDataComplete SourceShareEnd =
- new JoinDataComplete(new JoinData {JoinNumber = 202, JoinSpan = 1},
- new JoinMetadata
- {
- Description = "Stop Sharing & Feedback",
- JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
- JoinType = eJoinType.Digital
- });
-
- [JoinName("SourceShareStart")] public JoinDataComplete SourceShareStart =
- new JoinDataComplete(new JoinData {JoinNumber = 201, JoinSpan = 1},
- new JoinMetadata
- {
- Description = "Start Sharing & Feedback",
- JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
- JoinType = eJoinType.Digital
- });
-
- [JoinName("RecievingContent")] public JoinDataComplete RecievingContent =
- new JoinDataComplete(new JoinData {JoinNumber = 204, JoinSpan = 1},
- new JoinMetadata
- {
- Description = "Recieving content from the far end",
- JoinType = eJoinType.Digital,
- JoinCapabilities = eJoinCapabilities.ToSIMPL
- });
-
- [JoinName("SelfviewPosition")] public JoinDataComplete SelfviewPosition =
- new JoinDataComplete(new JoinData {JoinNumber = 211, JoinSpan = 1},
- new JoinMetadata
- {
- Description = "advance selfview position",
- JoinCapabilities = eJoinCapabilities.FromSIMPL,
- JoinType = eJoinType.Digital
- });
-
- [JoinName("SelfviewPositionFb")]
- public JoinDataComplete SelfviewPositionFb =
- new JoinDataComplete(new JoinData { JoinNumber = 211, JoinSpan = 1 },
- new JoinMetadata
- {
- Description = "advance selfview position",
- JoinCapabilities = eJoinCapabilities.ToSIMPL,
- JoinType = eJoinType.Serial
- });
-
- [JoinName("SpeedDialStart")] public JoinDataComplete SpeedDialStart =
- new JoinDataComplete(new JoinData {JoinNumber = 41, JoinSpan = 4},
- new JoinMetadata
- {
- Description = "Speed Dial",
- JoinCapabilities = eJoinCapabilities.ToSIMPL,
- JoinType = eJoinType.Digital
- });
-
- [JoinName("UpdateMeetings")] public JoinDataComplete UpdateMeetings =
- new JoinDataComplete(new JoinData {JoinNumber = 160, JoinSpan = 1},
- new JoinMetadata
- {
- Description = "Update Meetings",
- JoinCapabilities = eJoinCapabilities.FromSIMPL,
- JoinType = eJoinType.Digital
- });
-
- [JoinName("VolumeDown")] public JoinDataComplete VolumeDown =
- new JoinDataComplete(new JoinData {JoinNumber = 175, JoinSpan = 1},
- new JoinMetadata
- {
- Description = "Volume Down",
- JoinCapabilities = eJoinCapabilities.FromSIMPL,
- JoinType = eJoinType.Digital
- });
-
- [JoinName("VolumeLevel")] public JoinDataComplete VolumeLevel =
- new JoinDataComplete(new JoinData {JoinNumber = 174, JoinSpan = 1},
- new JoinMetadata
- {
- Description = "Volume Level",
- JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
- JoinType = eJoinType.Analog
- });
-
- [JoinName("VolumeMuteOff")] public JoinDataComplete VolumeMuteOff =
- new JoinDataComplete(new JoinData {JoinNumber = 177, JoinSpan = 1},
- new JoinMetadata
- {
- Description = "Volume Mute Off",
- JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
- JoinType = eJoinType.Digital
- });
-
- [JoinName("VolumeMuteOn")] public JoinDataComplete VolumeMuteOn =
- new JoinDataComplete(new JoinData {JoinNumber = 176, JoinSpan = 1},
- new JoinMetadata
- {
- Description = "Volume Mute On",
- JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
- JoinType = eJoinType.Digital
- });
-
- [JoinName("VolumeMuteToggle")] public JoinDataComplete VolumeMuteToggle =
- new JoinDataComplete(new JoinData {JoinNumber = 178, JoinSpan = 1},
- new JoinMetadata
- {
- Description = "Volume Mute Toggle",
- JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
- JoinType = eJoinType.Digital
- });
-
- [JoinName("VolumeUp")] public JoinDataComplete VolumeUp =
- new JoinDataComplete(new JoinData {JoinNumber = 174, JoinSpan = 1},
- new JoinMetadata
- {
- Description = "Volume Up",
- JoinCapabilities = eJoinCapabilities.FromSIMPL,
- JoinType = eJoinType.Digital
- });
-
- [JoinName("DialPhoneCall")]
- public JoinDataComplete DialPhone =
- new JoinDataComplete(new JoinData { JoinNumber = 72, JoinSpan = 1 },
- new JoinMetadata
- {
- Description = "Dial Phone",
- JoinCapabilities = eJoinCapabilities.FromSIMPL,
- JoinType = eJoinType.Digital
- });
-
- [JoinName("PhoneHookState")]
- public JoinDataComplete PhoneHookState =
- new JoinDataComplete(new JoinData { JoinNumber = 72, JoinSpan = 1 },
- new JoinMetadata
- {
- Description = "Dial Phone",
+ Description = "Toggles the participant's audio mute status",
JoinCapabilities = eJoinCapabilities.ToSIMPL,
JoinType = eJoinType.Digital
});
- [JoinName("EndPhoneCall")]
- public JoinDataComplete HangUpPhone =
- new JoinDataComplete(new JoinData { JoinNumber = 73, JoinSpan = 1 },
+ [JoinName("ParticipantVideoMuteToggleStart")]
+ public JoinDataComplete ParticipantVideoMuteToggleStart = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 800,
+ JoinSpan = 50
+ },
new JoinMetadata
{
- Description = "Hang Up PHone",
- JoinCapabilities = eJoinCapabilities.FromSIMPL,
+ Description = "Toggles the participant's video mute status",
+ JoinCapabilities = eJoinCapabilities.ToSIMPL,
JoinType = eJoinType.Digital
});
- [JoinName("PhoneString")]
- public JoinDataComplete PhoneDialString =
- new JoinDataComplete(new JoinData { JoinNumber = 2, JoinSpan = 1 },
+ [JoinName("ParticipantPinToggleStart")]
+ public JoinDataComplete ParticipantPinToggleStart = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 1100,
+ JoinSpan = 50
+ },
new JoinMetadata
{
- Description = "Phone Dial String",
- JoinCapabilities = eJoinCapabilities.FromSIMPL,
- JoinType = eJoinType.Serial
+ Description = "Toggles the participant's pin status",
+ JoinCapabilities = eJoinCapabilities.ToSIMPL,
+ JoinType = eJoinType.Digital
});
- public VideoCodecControllerJoinMap(uint joinStart) : base(joinStart, typeof (VideoCodecControllerJoinMap))
- {
- }
+ #endregion
- public VideoCodecControllerJoinMap(uint joinStart, Type type) : base(joinStart, type)
- {
- }
- }
-}
\ No newline at end of file
+
+
+ #region Analog
+
+ [JoinName("MinutesBeforeMeetingStart")]
+ public JoinDataComplete MinutesBeforeMeetingStart = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 41,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Minutes before meeting start that a meeting is joinable",
+ JoinCapabilities = eJoinCapabilities.FromSIMPL,
+ JoinType = eJoinType.Analog
+ });
+
+ [JoinName("CameraNumberSelect")]
+ public JoinDataComplete CameraNumberSelect = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 60,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Camera Number Select/FB",
+ JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
+ JoinType = eJoinType.Analog
+ });
+
+ [JoinName("DirectoryRowCount")]
+ public JoinDataComplete DirectoryRowCount = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 101,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Directory Row Count FB",
+ JoinCapabilities = eJoinCapabilities.ToSIMPL,
+ JoinType = eJoinType.Analog
+ });
+
+ [JoinName("DirectorySelectRow")]
+ public JoinDataComplete DirectorySelectRow = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 101,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Directory Select Row",
+ JoinCapabilities = eJoinCapabilities.FromSIMPL,
+ JoinType = eJoinType.Analog
+ });
+
+ [JoinName("CameraPresetSelect")]
+ public JoinDataComplete CameraPresetSelect = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 121,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Camera Preset Select",
+ JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
+ JoinType = eJoinType.Analog
+ });
+
+ [JoinName("ParticipantCount")]
+ public JoinDataComplete ParticipantCount = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 151,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Current Participant Count",
+ JoinCapabilities = eJoinCapabilities.ToSIMPL,
+ JoinType = eJoinType.Analog
+ });
+
+ [JoinName("Meeting Count Fb")]
+ public JoinDataComplete MeetingCount = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 161,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Meeting Count",
+ JoinCapabilities = eJoinCapabilities.ToSIMPL,
+ JoinType = eJoinType.Analog
+ });
+
+ [JoinName("VolumeLevel")]
+ public JoinDataComplete VolumeLevel = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 174,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Volume Level",
+ JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
+ JoinType = eJoinType.Analog
+ });
+
+ #endregion
+
+
+
+ #region Serials
+
+ [JoinName("CurrentDialString")]
+ public JoinDataComplete CurrentDialString = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 1,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Current Dial String",
+ JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
+ JoinType = eJoinType.Serial
+ });
+
+ [JoinName("PhoneString")]
+ public JoinDataComplete PhoneDialString = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 2,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Phone Dial String",
+ JoinCapabilities = eJoinCapabilities.FromSIMPL,
+ JoinType = eJoinType.Serial
+ });
+
+ [JoinName("CurrentCallName")]
+ public JoinDataComplete CurrentCallData = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 2,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Current Call Data - XSIG",
+ JoinCapabilities = eJoinCapabilities.ToSIMPL,
+ JoinType = eJoinType.Serial
+ });
+
+ [JoinName("CallDirection")]
+ public JoinDataComplete CallDirection = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 22,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Current Call Direction",
+ JoinCapabilities = eJoinCapabilities.ToSIMPL,
+ JoinType = eJoinType.Serial
+ });
+
+ [JoinName("IncomingCallName")]
+ public JoinDataComplete IncomingCallName = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 51,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Incoming Call Name",
+ JoinCapabilities = eJoinCapabilities.ToSIMPL,
+ JoinType = eJoinType.Serial
+ });
+
+ [JoinName("IncomingCallNumber")]
+ public JoinDataComplete IncomingCallNumber = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 52,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Incoming Call Number",
+ JoinCapabilities = eJoinCapabilities.ToSIMPL,
+ JoinType = eJoinType.Serial
+ });
+
+
+ [JoinName("DirectorySearchString")]
+ public JoinDataComplete DirectorySearchString = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 100,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Directory Search String",
+ JoinCapabilities = eJoinCapabilities.FromSIMPL,
+ JoinType = eJoinType.Serial
+ });
+
+ [JoinName("DirectoryEntries")]
+ public JoinDataComplete DirectoryEntries = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 101,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Directory Entries - XSig, 255 entries",
+ JoinCapabilities = eJoinCapabilities.ToSIMPL,
+ JoinType = eJoinType.Serial
+ });
+
+ [JoinName("Schedule")]
+ public JoinDataComplete Schedule = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 102,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Schedule Data - XSIG",
+ JoinCapabilities = eJoinCapabilities.ToSIMPL,
+ JoinType = eJoinType.Serial
+ });
+
+ [JoinName("CameraPresetNames")]
+ public JoinDataComplete CameraPresetNames = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 121,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Camera Preset Names - XSIG, max of 15",
+ JoinCapabilities = eJoinCapabilities.ToSIMPL,
+ JoinType = eJoinType.Serial
+ });
+
+ [JoinName("CameraLayoutStringFb")]
+ public JoinDataComplete CameraLayoutStringFb = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 141,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Current Layout Fb",
+ JoinCapabilities = eJoinCapabilities.ToSIMPL,
+ JoinType = eJoinType.Serial
+ });
+
+ [JoinName("CurrentParticipants")]
+ public JoinDataComplete CurrentParticipants = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 151,
+ JoinSpan = 1
+ },
+ new JoinMetadata()
+ {
+ Description = "Current Participants XSig",
+ JoinCapabilities = eJoinCapabilities.ToSIMPL,
+ JoinType = eJoinType.Serial
+ });
+
+ [JoinName("CurrentSource")]
+ public JoinDataComplete CurrentSource = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 201,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Current Source",
+ JoinCapabilities = eJoinCapabilities.ToSIMPL,
+ JoinType = eJoinType.Serial
+ });
+
+ [JoinName("SelfviewPositionFb")]
+ public JoinDataComplete SelfviewPositionFb = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 211,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "advance selfview position",
+ JoinCapabilities = eJoinCapabilities.ToSIMPL,
+ JoinType = eJoinType.Serial
+ });
+
+ [JoinName("DirectoryEntrySelectedName")]
+ public JoinDataComplete DirectoryEntrySelectedName = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 356,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Selected Directory Entry Name",
+ JoinCapabilities = eJoinCapabilities.ToSIMPL,
+ JoinType = eJoinType.Serial
+ });
+
+ [JoinName("DirectoryEntrySelectedNumber")]
+ public JoinDataComplete DirectoryEntrySelectedNumber = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 357,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Selected Directory Entry Number",
+ JoinCapabilities = eJoinCapabilities.ToSIMPL,
+ JoinType = eJoinType.Serial
+ });
+
+ [JoinName("DirectorySelectedFolderName")]
+ public JoinDataComplete DirectorySelectedFolderName = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 358,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Selected Directory Folder Name",
+ JoinCapabilities = eJoinCapabilities.ToSIMPL,
+ JoinType = eJoinType.Serial
+ });
+
+ #endregion
+
+
+ public VideoCodecControllerJoinMap(uint joinStart)
+ : base(joinStart, typeof(VideoCodecControllerJoinMap))
+ {
+ }
+
+ public VideoCodecControllerJoinMap(uint joinStart, Type type)
+ : base(joinStart, type)
+ {
+ }
+ }
+}
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Comm and IR/CecPortController.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Comm and IR/CecPortController.cs
index 1ab38d89..203c2f1a 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Comm and IR/CecPortController.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Comm and IR/CecPortController.cs
@@ -11,8 +11,10 @@ using PepperDash.Core;
namespace PepperDash.Essentials.Core
{
- public class CecPortController : Device, IBasicCommunication
+ public class CecPortController : Device, IBasicCommunicationWithStreamDebugging
{
+ public CommunicationStreamDebugging StreamDebugging { get; private set; }
+
public event EventHandler BytesReceived;
public event EventHandler TextReceived;
@@ -23,6 +25,8 @@ namespace PepperDash.Essentials.Core
public CecPortController(string key, Func postActivationFunc,
EssentialsControlPropertiesConfig config):base(key)
{
+ StreamDebugging = new CommunicationStreamDebugging(key);
+
AddPostActivationAction(() =>
{
Port = postActivationFunc(config);
@@ -50,15 +54,21 @@ namespace PepperDash.Essentials.Core
void OnDataReceived(string s)
{
- var bytesHandler = BytesReceived;
+ var bytesHandler = BytesReceived;
if (bytesHandler != null)
{
var bytes = Encoding.GetEncoding(28591).GetBytes(s);
+ if (StreamDebugging.RxStreamDebuggingIsEnabled)
+ Debug.Console(0, this, "Received: '{0}'", ComTextHelper.GetEscapedText(bytes));
bytesHandler(this, new GenericCommMethodReceiveBytesArgs(bytes));
}
var textHandler = TextReceived;
- if (textHandler != null)
- textHandler(this, new GenericCommMethodReceiveTextArgs(s));
+ if (textHandler != null)
+ {
+ if (StreamDebugging.RxStreamDebuggingIsEnabled)
+ Debug.Console(0, this, "Received: '{0}'", s);
+ textHandler(this, new GenericCommMethodReceiveTextArgs(s));
+ }
}
#region IBasicCommunication Members
@@ -67,6 +77,8 @@ namespace PepperDash.Essentials.Core
{
if (Port == null)
return;
+ if (StreamDebugging.TxStreamDebuggingIsEnabled)
+ Debug.Console(0, this, "Sending {0} characters of text: '{1}'", text.Length, text);
Port.StreamCec.Send.StringValue = text;
}
@@ -75,6 +87,8 @@ namespace PepperDash.Essentials.Core
if (Port == null)
return;
var text = Encoding.GetEncoding(28591).GetString(bytes, 0, bytes.Length);
+ if (StreamDebugging.TxStreamDebuggingIsEnabled)
+ Debug.Console(0, this, "Sending {0} bytes: '{1}'", bytes.Length, ComTextHelper.GetEscapedText(bytes));
Port.StreamCec.Send.StringValue = text;
}
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Comm and IR/ComPortController.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Comm and IR/ComPortController.cs
index ddb578d7..6d454ac5 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Comm and IR/ComPortController.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Comm and IR/ComPortController.cs
@@ -56,6 +56,11 @@ namespace PepperDash.Essentials.Core
private void RegisterAndConfigureComPort()
{
+ if (Port == null)
+ {
+ Debug.Console(0,this,Debug.ErrorLogLevel.Error, "Configured com Port for this device does not exist.");
+ return;
+ }
if (Port.Parent is CrestronControlSystem)
{
var result = Port.Register();
@@ -87,18 +92,20 @@ namespace PepperDash.Essentials.Core
void OnDataReceived(string s)
{
+
var bytesHandler = BytesReceived;
if (bytesHandler != null)
{
var bytes = Encoding.GetEncoding(28591).GetBytes(s);
+ if (StreamDebugging.RxStreamDebuggingIsEnabled)
+ Debug.Console(0, this, "Received: '{0}'", ComTextHelper.GetEscapedText(bytes));
bytesHandler(this, new GenericCommMethodReceiveBytesArgs(bytes));
}
var textHandler = TextReceived;
if (textHandler != null)
{
- if (StreamDebugging.RxStreamDebuggingIsEnabled)
- Debug.Console(0, this, "Recevied: '{0}'", s);
-
+ if (StreamDebugging.RxStreamDebuggingIsEnabled)
+ Debug.Console(0, this, "Received: '{0}'", s);
textHandler(this, new GenericCommMethodReceiveTextArgs(s));
}
}
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Comm and IR/CommFactory.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Comm and IR/CommFactory.cs
index a8fa67e4..8a5efe47 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Comm and IR/CommFactory.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Comm and IR/CommFactory.cs
@@ -104,7 +104,7 @@ namespace PepperDash.Essentials.Core
var dev = GetIComPortsDeviceFromManagedDevice(config.ControlPortDevKey);
if (dev != null && config.ControlPortNumber <= dev.NumberOfComPorts)
return dev.ComPorts[config.ControlPortNumber];
- Debug.Console(0, "GetComPort: Device '{0}' does not have com port {1}", config.ControlPortDevKey, config.ControlPortNumber);
+ Debug.Console(0,Debug.ErrorLogLevel.Notice, "GetComPort: Device '{0}' does not have com port {1}", config.ControlPortDevKey, config.ControlPortNumber);
return null;
}
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Comm and IR/ConsoleCommMockDevice.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Comm and IR/ConsoleCommMockDevice.cs
index f360e52b..db06d2aa 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Comm and IR/ConsoleCommMockDevice.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Comm and IR/ConsoleCommMockDevice.cs
@@ -31,7 +31,7 @@ namespace PepperDash.Essentials.Core
{
Communication = comm;
PortGather = new CommunicationGather(Communication, '\x0d');
- PortGather.LineReceived += this.Port_LineReceived;
+ //PortGather.LineReceived += this.Port_LineReceived;
CommunicationMonitor = new GenericCommunicationMonitor(this, Communication, props.CommunicationMonitorProperties);
LineEnding = props.LineEnding;
}
@@ -47,13 +47,6 @@ namespace PepperDash.Essentials.Core
return true;
}
- void Port_LineReceived(object dev, GenericCommMethodReceiveTextArgs args)
- {
- if (Debug.Level == 2)
- Debug.Console(2, this, "RX: '{0}'",
- ShowHexResponse ? ComTextHelper.GetEscapedText(args.Text) : args.Text);
- }
-
void SendLine(string s)
{
//if (Debug.Level == 2)
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Comm and IR/GenericComm.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Comm and IR/GenericComm.cs
index db5ef9ec..7648a379 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Comm and IR/GenericComm.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Comm and IR/GenericComm.cs
@@ -25,6 +25,7 @@ namespace PepperDash.Essentials.Core
public GenericComm(DeviceConfig config)
: base(config)
{
+
PropertiesConfig = CommFactory.GetControlPropertiesConfig(config);
var commPort = CommFactory.CreateCommForDevice(config);
@@ -96,7 +97,6 @@ namespace PepperDash.Essentials.Core
// this is a permanent event handler. This cannot be -= from event
CommPort.TextReceived += (s, a) =>
{
- Debug.Console(2, this, "RX: {0}", a.Text);
trilist.SetString(joinMap.TextReceived.JoinNumber, a.Text);
};
trilist.SetStringSigAction(joinMap.SendText.JoinNumber, s => CommPort.SendText(s));
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Comm and IR/GenericHttpClient.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Comm and IR/GenericHttpClient.cs
index 87cde373..31342a94 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Comm and IR/GenericHttpClient.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Comm and IR/GenericHttpClient.cs
@@ -33,7 +33,6 @@ namespace PepperDash.Essentials.Core
string url = string.Format("http://{0}/{1}", Client.HostName, path);
request.Url = new UrlParser(url);
HttpClient.DISPATCHASYNC_ERROR error = Client.DispatchAsyncEx(request, Response, request);
- Debug.Console(2, this, "GenericHttpClient SentRequest TX:'{0}'", url);
}
public void SendText(string format, params object[] items)
{
@@ -41,7 +40,6 @@ namespace PepperDash.Essentials.Core
string url = string.Format("http://{0}/{1}", Client.HostName, string.Format(format, items));
request.Url = new UrlParser(url);
HttpClient.DISPATCHASYNC_ERROR error = Client.DispatchAsyncEx(request, Response, request);
- Debug.Console(2, this, "GenericHttpClient SentRequest TX:'{0}'", url);
}
public void SendTextNoResponse(string format, params object[] items)
@@ -50,7 +48,6 @@ namespace PepperDash.Essentials.Core
string url = string.Format("http://{0}/{1}", Client.HostName, string.Format(format, items));
request.Url = new UrlParser(url);
Client.Dispatch(request);
- Debug.Console(2, this, "GenericHttpClient SentRequest TX:'{0}'", url);
}
private void Response(HttpClientResponse response, HTTP_CALLBACK_ERROR error, object request)
@@ -63,10 +60,6 @@ namespace PepperDash.Essentials.Core
{
if (ResponseRecived != null)
ResponseRecived(this, new GenericHttpClientEventArgs(responseReceived.ContentString, (request as HttpClientRequest).Url.ToString(), error));
-
- Debug.Console(2, this, "GenericHttpClient ResponseReceived");
- Debug.Console(2, this, "RX:{0}", responseReceived.ContentString);
- Debug.Console(2, this, "TX:{0}", (request as HttpClientRequest).Url.ToString());
}
}
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Config/BasicConfig.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Config/BasicConfig.cs
index 904bfc74..f44f6000 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Config/BasicConfig.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Config/BasicConfig.cs
@@ -1,11 +1,8 @@
-using System;
-using System.Collections.Generic;
+using System.Collections.Generic;
using System.Linq;
-using System.Text;
-using Crestron.SimplSharp;
using Newtonsoft.Json;
-using PepperDash.Core;
-using PepperDash.Essentials.Core;
+
+using Newtonsoft.Json.Linq;
namespace PepperDash.Essentials.Core.Config
{
@@ -23,11 +20,24 @@ namespace PepperDash.Essentials.Core.Config
[JsonProperty("sourceLists")]
public Dictionary> SourceLists { get; set; }
- [JsonProperty("tieLines")]
+ [JsonProperty("destinationLists")]
+ public Dictionary> DestinationLists { get; set; }
+
+ [JsonProperty("tieLines")]
public List TieLines { get; set; }
[JsonProperty("joinMaps")]
- public Dictionary JoinMaps { get; set; }
+ public Dictionary JoinMaps { get; set; }
+
+ public BasicConfig()
+ {
+ Info = new InfoConfig();
+ Devices = new List();
+ SourceLists = new Dictionary>();
+ DestinationLists = new Dictionary>();
+ TieLines = new List();
+ JoinMaps = new Dictionary();
+ }
///
/// Checks SourceLists for a given list and returns it if found. Otherwise, returns null
@@ -40,6 +50,21 @@ namespace PepperDash.Essentials.Core.Config
return SourceLists[key];
}
+ ///
+ /// Retrieves a DestinationListItem based on the key
+ ///
+ /// key of the item to retrieve
+ /// DestinationListItem if the key exists, null otherwise
+ public Dictionary GetDestinationListForKey(string key)
+ {
+ if (string.IsNullOrEmpty(key) || !DestinationLists.ContainsKey(key))
+ {
+ return null;
+ }
+
+ return DestinationLists[key];
+ }
+
///
/// Checks Devices for an item with a Key that matches and returns it if found. Otherwise, retunes null
///
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Config/DeviceConfig.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Config/DeviceConfig.cs
index bb95da01..1d9ed1c2 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Config/DeviceConfig.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Config/DeviceConfig.cs
@@ -30,7 +30,19 @@ namespace PepperDash.Essentials.Core.Config
[JsonProperty("properties")]
[JsonConverter(typeof(DevicePropertiesConverter))]
- public JToken Properties { get; set; }
+ public JToken Properties { get; set; }
+
+ public DeviceConfig(DeviceConfig dc)
+ {
+ Key = dc.Key;
+ Uid = dc.Uid;
+ Name = dc.Name;
+ Group = dc.Group;
+ Type = dc.Type;
+ Properties = JToken.FromObject(dc.Properties);
+ }
+
+ public DeviceConfig() {}
}
///
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Config/Essentials/ConfigReader.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Config/Essentials/ConfigReader.cs
index 48a026c2..e99206e8 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Config/Essentials/ConfigReader.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Config/Essentials/ConfigReader.cs
@@ -1,195 +1,195 @@
-using System;
+using System;
using System.Linq;
using System.Text;
-using Crestron.SimplSharp;
-using Crestron.SimplSharp.CrestronIO;
-using Newtonsoft.Json;
-using Newtonsoft.Json.Linq;
-using PepperDash.Core;
-using PepperDash.Core.Config;
-
-namespace PepperDash.Essentials.Core.Config
-{
- ///
- /// Loads the ConfigObject from the file
- ///
+using Crestron.SimplSharp;
+using Crestron.SimplSharp.CrestronIO;
+using Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
+using PepperDash.Core;
+using PepperDash.Core.Config;
+
+namespace PepperDash.Essentials.Core.Config
+{
+ ///
+ /// Loads the ConfigObject from the file
+ ///
public class ConfigReader
{
public const string LocalConfigPresent =
@"
***************************************************
************* Using Local config file *************
-***************************************************";
-
- public static EssentialsConfig ConfigObject { get; private set; }
-
- public static bool LoadConfig2()
- {
- Debug.Console(0, Debug.ErrorLogLevel.Notice, "Loading unmerged system/template portal configuration file.");
- try
- {
- // Check for local config file first
- var filePath = Global.FilePathPrefix + ConfigWriter.LocalConfigFolder + Global.DirectorySeparator + Global.ConfigFileName;
-
- bool localConfigFound = false;
-
- Debug.Console(0, Debug.ErrorLogLevel.Notice, "Attempting to load Local config file: '{0}'", filePath);
-
- // Check for local config directory first
-
- var configFiles = GetConfigFiles(filePath);
-
- if (configFiles != null)
- {
- if (configFiles.Length > 1)
- {
- Debug.Console(0, Debug.ErrorLogLevel.Error,
- "****Error: Multiple Local Configuration files present. Please ensure only a single file exists and reset program.****");
- return false;
- }
- if(configFiles.Length == 1)
- {
+***************************************************";
+
+ public static EssentialsConfig ConfigObject { get; private set; }
+
+ public static bool LoadConfig2()
+ {
+ Debug.Console(0, Debug.ErrorLogLevel.Notice, "Loading unmerged system/template portal configuration file.");
+ try
+ {
+ // Check for local config file first
+ var filePath = Global.FilePathPrefix + ConfigWriter.LocalConfigFolder + Global.DirectorySeparator + Global.ConfigFileName;
+
+ bool localConfigFound = false;
+
+ Debug.Console(0, Debug.ErrorLogLevel.Notice, "Attempting to load Local config file: '{0}'", filePath);
+
+ // Check for local config directory first
+
+ var configFiles = GetConfigFiles(filePath);
+
+ if (configFiles != null)
+ {
+ if (configFiles.Length > 1)
+ {
+ Debug.Console(0, Debug.ErrorLogLevel.Error,
+ "****Error: Multiple Local Configuration files present. Please ensure only a single file exists and reset program.****");
+ return false;
+ }
+ if(configFiles.Length == 1)
+ {
localConfigFound = true;
-
- }
- }
- else
- {
- Debug.Console(0, Debug.ErrorLogLevel.Notice,
- "Local Configuration file not present.", filePath);
-
- }
-
- // Check for Portal Config
- if(!localConfigFound)
- {
- filePath = Global.FilePathPrefix + Global.ConfigFileName;
-
- Debug.Console(0, Debug.ErrorLogLevel.Notice, "Attempting to load Portal config file: '{0}'", filePath);
-
- configFiles = GetConfigFiles(filePath);
-
- if (configFiles != null)
- {
- Debug.Console(2, "{0} config files found matching pattern", configFiles.Length);
-
- if (configFiles.Length > 1)
- {
- Debug.Console(0, Debug.ErrorLogLevel.Error,
- "****Error: Multiple Portal Configuration files present. Please ensure only a single file exists and reset program.****");
- return false;
- }
- else if (configFiles.Length == 1)
- {
- Debug.Console(0, Debug.ErrorLogLevel.Notice, "Found Portal config file: '{0}'", filePath);
- }
- else
- {
- Debug.Console(0, Debug.ErrorLogLevel.Notice, "No config file found.");
- return false;
- }
- }
- else
- {
- Debug.Console(0, Debug.ErrorLogLevel.Error,
- "ERROR: Portal Configuration file not present. Please load file and reset program.");
- return false;
- }
- }
-
- // Get the actual file path
+
+ }
+ }
+ else
+ {
+ Debug.Console(0, Debug.ErrorLogLevel.Notice,
+ "Local Configuration file not present.", filePath);
+
+ }
+
+ // Check for Portal Config
+ if(!localConfigFound)
+ {
+ filePath = Global.FilePathPrefix + Global.ConfigFileName;
+
+ Debug.Console(0, Debug.ErrorLogLevel.Notice, "Attempting to load Portal config file: '{0}'", filePath);
+
+ configFiles = GetConfigFiles(filePath);
+
+ if (configFiles != null)
+ {
+ Debug.Console(2, "{0} config files found matching pattern", configFiles.Length);
+
+ if (configFiles.Length > 1)
+ {
+ Debug.Console(0, Debug.ErrorLogLevel.Error,
+ "****Error: Multiple Portal Configuration files present. Please ensure only a single file exists and reset program.****");
+ return false;
+ }
+ else if (configFiles.Length == 1)
+ {
+ Debug.Console(0, Debug.ErrorLogLevel.Notice, "Found Portal config file: '{0}'", filePath);
+ }
+ else
+ {
+ Debug.Console(0, Debug.ErrorLogLevel.Notice, "No config file found.");
+ return false;
+ }
+ }
+ else
+ {
+ Debug.Console(0, Debug.ErrorLogLevel.Error,
+ "ERROR: Portal Configuration file not present. Please load file and reset program.");
+ return false;
+ }
+ }
+
+ // Get the actual file path
filePath = configFiles[0].FullName;
// Generate debug statement if using a local file.
if (localConfigFound)
{
GetLocalFileMessage(filePath);
- }
-
- // Read the file
- using (StreamReader fs = new StreamReader(filePath))
- {
- Debug.Console(0, Debug.ErrorLogLevel.Notice, "Loading config file: '{0}'", filePath);
-
- if (localConfigFound)
- {
- ConfigObject = JObject.Parse(fs.ReadToEnd()).ToObject();
-
- Debug.Console(0, Debug.ErrorLogLevel.Notice, "Successfully Loaded Local Config");
-
- return true;
- }
- else
- {
- var doubleObj = JObject.Parse(fs.ReadToEnd());
- ConfigObject = PortalConfigReader.MergeConfigs(doubleObj).ToObject();
-
- // Extract SystemUrl and TemplateUrl into final config output
-
- if (doubleObj["system_url"] != null)
- {
- ConfigObject.SystemUrl = doubleObj["system_url"].Value();
- }
-
- if (doubleObj["template_url"] != null)
- {
- ConfigObject.TemplateUrl = doubleObj["template_url"].Value();
- }
- }
-
- Debug.Console(0, Debug.ErrorLogLevel.Notice, "Successfully Loaded Merged Config");
-
- return true;
- }
- }
- catch (Exception e)
- {
- Debug.Console(0, Debug.ErrorLogLevel.Error, "ERROR: Config load failed: \r{0}", e);
- return false;
- }
- }
-
- ///
- /// Returns all the files from the directory specified.
- ///
- ///
- ///
- public static FileInfo[] GetConfigFiles(string filePath)
- {
- // Get the directory
- var dir = Path.GetDirectoryName(filePath);
-
- if (Directory.Exists(dir))
- {
- Debug.Console(1, "Searching in Directory '{0}'", dir);
- // Get the directory info
- var dirInfo = new DirectoryInfo(dir);
-
- // Get the file name
- var fileName = Path.GetFileName(filePath);
- Debug.Console(1, "For Config Files matching: '{0}'", fileName);
-
- // Get the files that match from the directory
- return dirInfo.GetFiles(fileName);
- }
- else
- {
- Debug.Console(0, Debug.ErrorLogLevel.Notice,
- "Directory not found: ", dir);
-
- return null;
- }
- }
-
- ///
- /// Returns the group for a given device key in config
- ///
- ///
- ///
- public static string GetGroupForDeviceKey(string key)
- {
- var dev = ConfigObject.Devices.FirstOrDefault(d => d.Key.Equals(key, StringComparison.OrdinalIgnoreCase));
- return dev == null ? null : dev.Group;
+ }
+
+ // Read the file
+ using (StreamReader fs = new StreamReader(filePath))
+ {
+ Debug.Console(0, Debug.ErrorLogLevel.Notice, "Loading config file: '{0}'", filePath);
+
+ if (localConfigFound)
+ {
+ ConfigObject = JObject.Parse(fs.ReadToEnd()).ToObject();
+
+ Debug.Console(0, Debug.ErrorLogLevel.Notice, "Successfully Loaded Local Config");
+
+ return true;
+ }
+ else
+ {
+ var doubleObj = JObject.Parse(fs.ReadToEnd());
+ ConfigObject = PortalConfigReader.MergeConfigs(doubleObj).ToObject();
+
+ // Extract SystemUrl and TemplateUrl into final config output
+
+ if (doubleObj["system_url"] != null)
+ {
+ ConfigObject.SystemUrl = doubleObj["system_url"].Value();
+ }
+
+ if (doubleObj["template_url"] != null)
+ {
+ ConfigObject.TemplateUrl = doubleObj["template_url"].Value();
+ }
+ }
+
+ Debug.Console(0, Debug.ErrorLogLevel.Notice, "Successfully Loaded Merged Config");
+
+ return true;
+ }
+ }
+ catch (Exception e)
+ {
+ Debug.Console(0, Debug.ErrorLogLevel.Error, "ERROR: Config load failed: \r{0}", e);
+ return false;
+ }
+ }
+
+ ///
+ /// Returns all the files from the directory specified.
+ ///
+ ///
+ ///
+ public static FileInfo[] GetConfigFiles(string filePath)
+ {
+ // Get the directory
+ var dir = Path.GetDirectoryName(filePath);
+
+ if (Directory.Exists(dir))
+ {
+ Debug.Console(1, "Searching in Directory '{0}'", dir);
+ // Get the directory info
+ var dirInfo = new DirectoryInfo(dir);
+
+ // Get the file name
+ var fileName = Path.GetFileName(filePath);
+ Debug.Console(1, "For Config Files matching: '{0}'", fileName);
+
+ // Get the files that match from the directory
+ return dirInfo.GetFiles(fileName);
+ }
+ else
+ {
+ Debug.Console(0, Debug.ErrorLogLevel.Notice,
+ "Directory not found: ", dir);
+
+ return null;
+ }
+ }
+
+ ///
+ /// Returns the group for a given device key in config
+ ///
+ ///
+ ///
+ public static string GetGroupForDeviceKey(string key)
+ {
+ var dev = ConfigObject.Devices.FirstOrDefault(d => d.Key.Equals(key, StringComparison.OrdinalIgnoreCase));
+ return dev == null ? null : dev.Group;
}
private static void GetLocalFileMessage(string filePath)
@@ -248,7 +248,7 @@ namespace PepperDash.Essentials.Core.Config
Debug.Console(2, Debug.ErrorLogLevel.Notice, "Found Local config file: '{0}'", filePath);
Debug.Console(0, newDebugString.ToString());
- }
-
- }
+ }
+
+ }
}
\ No newline at end of file
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Config/Essentials/ConfigWriter.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Config/Essentials/ConfigWriter.cs
index cb361d28..c6224859 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Config/Essentials/ConfigWriter.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Config/Essentials/ConfigWriter.cs
@@ -1,162 +1,162 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Crestron.SimplSharp;
-using Crestron.SimplSharp.CrestronIO;
-using Newtonsoft.Json;
-using Newtonsoft.Json.Linq;
-using PepperDash.Core;
-
-namespace PepperDash.Essentials.Core.Config
-{
- ///
- /// Responsible for updating config at runtime, and writing the updates out to a local file
- ///
- public class ConfigWriter
- {
- public const string LocalConfigFolder = "LocalConfig";
-
- public const long WriteTimeout = 30000;
-
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Crestron.SimplSharp;
+using Crestron.SimplSharp.CrestronIO;
+using Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
+using PepperDash.Core;
+
+namespace PepperDash.Essentials.Core.Config
+{
+ ///
+ /// Responsible for updating config at runtime, and writing the updates out to a local file
+ ///
+ public class ConfigWriter
+ {
+ public const string LocalConfigFolder = "LocalConfig";
+
+ public const long WriteTimeout = 30000;
+
public static CTimer WriteTimer;
- static CCriticalSection fileLock = new CCriticalSection();
-
- ///
- /// Updates the config properties of a device
- ///
- ///
- ///
- ///
- public static bool UpdateDeviceProperties(string deviceKey, JToken properties)
- {
- bool success = false;
-
- // Get the current device config
- var deviceConfig = ConfigReader.ConfigObject.Devices.FirstOrDefault(d => d.Key.Equals(deviceKey));
-
- if (deviceConfig != null)
- {
- // Replace the current properties JToken with the new one passed into this method
- deviceConfig.Properties = properties;
-
- Debug.Console(1, "Updated properties of device: '{0}'", deviceKey);
-
- success = true;
- }
-
- ResetTimer();
-
- return success;
- }
-
- public static bool UpdateDeviceConfig(DeviceConfig config)
- {
- bool success = false;
-
- var deviceConfig = ConfigReader.ConfigObject.Devices.FirstOrDefault(d => d.Key.Equals(config.Key));
-
- if (deviceConfig != null)
- {
- deviceConfig = config;
-
- Debug.Console(1, "Updated config of device: '{0}'", config.Key);
-
- success = true;
- }
-
- ResetTimer();
-
- return success;
- }
-
- public static bool UpdateRoomConfig(DeviceConfig config)
- {
- bool success = false;
-
- var deviceConfig = ConfigReader.ConfigObject.Rooms.FirstOrDefault(d => d.Key.Equals(config.Key));
-
- if (deviceConfig != null)
- {
- deviceConfig = config;
-
- Debug.Console(1, "Updated config of device: '{0}'", config.Key);
-
- success = true;
- }
-
- ResetTimer();
-
- return success;
- }
-
- ///
- /// Resets (or starts) the write timer
- ///
- static void ResetTimer()
- {
- if (WriteTimer == null)
- WriteTimer = new CTimer(WriteConfigFile, WriteTimeout);
-
- WriteTimer.Reset(WriteTimeout);
-
- Debug.Console(1, "Config File write timer has been reset.");
- }
-
- ///
- /// Writes the current config to a file in the LocalConfig subfolder
- ///
- ///
- private static void WriteConfigFile(object o)
- {
- var filePath = Global.FilePathPrefix + LocalConfigFolder + Global.DirectorySeparator + "configurationFile.json";
-
- var configData = JsonConvert.SerializeObject(ConfigReader.ConfigObject);
-
- WriteFile(filePath, configData);
- }
-
- ///
- /// Writes
- ///
- ///
- ///
- public static void WriteFile(string filePath, string configData)
- {
- if (WriteTimer != null)
- WriteTimer.Stop();
-
- Debug.Console(0, Debug.ErrorLogLevel.Notice, "Writing Configuration to file");
-
- Debug.Console(0, Debug.ErrorLogLevel.Notice, "Attempting to write config file: '{0}'", filePath);
-
- try
- {
- if (fileLock.TryEnter())
- {
- using (StreamWriter sw = new StreamWriter(filePath))
- {
- sw.Write(configData);
- sw.Flush();
- }
- }
- else
- {
- Debug.Console(0, Debug.ErrorLogLevel.Error, "Unable to enter FileLock");
- }
- }
- catch (Exception e)
- {
- Debug.Console(0, Debug.ErrorLogLevel.Error, "Error: Config write failed: \r{0}", e);
- }
- finally
- {
- if (fileLock != null && !fileLock.Disposed)
- fileLock.Leave();
-
- }
- }
-
-
- }
+ static CCriticalSection fileLock = new CCriticalSection();
+
+ ///
+ /// Updates the config properties of a device
+ ///
+ ///
+ ///
+ ///
+ public static bool UpdateDeviceProperties(string deviceKey, JToken properties)
+ {
+ bool success = false;
+
+ // Get the current device config
+ var deviceConfig = ConfigReader.ConfigObject.Devices.FirstOrDefault(d => d.Key.Equals(deviceKey));
+
+ if (deviceConfig != null)
+ {
+ // Replace the current properties JToken with the new one passed into this method
+ deviceConfig.Properties = properties;
+
+ Debug.Console(1, "Updated properties of device: '{0}'", deviceKey);
+
+ success = true;
+ }
+
+ ResetTimer();
+
+ return success;
+ }
+
+ public static bool UpdateDeviceConfig(DeviceConfig config)
+ {
+ bool success = false;
+
+ var deviceConfigIndex = ConfigReader.ConfigObject.Devices.FindIndex(d => d.Key.Equals(config.Key));
+
+ if (deviceConfigIndex >= 0)
+ {
+ ConfigReader.ConfigObject.Devices[deviceConfigIndex] = config;
+
+ Debug.Console(1, "Updated config of device: '{0}'", config.Key);
+
+ success = true;
+ }
+
+ ResetTimer();
+
+ return success;
+ }
+
+ public static bool UpdateRoomConfig(DeviceConfig config)
+ {
+ bool success = false;
+
+ var roomConfigIndex = ConfigReader.ConfigObject.Rooms.FindIndex(d => d.Key.Equals(config.Key));
+
+ if (roomConfigIndex >= 0)
+ {
+ ConfigReader.ConfigObject.Rooms[roomConfigIndex] = config;
+
+ Debug.Console(1, "Updated room of device: '{0}'", config.Key);
+
+ success = true;
+ }
+
+ ResetTimer();
+
+ return success;
+ }
+
+ ///
+ /// Resets (or starts) the write timer
+ ///
+ static void ResetTimer()
+ {
+ if (WriteTimer == null)
+ WriteTimer = new CTimer(WriteConfigFile, WriteTimeout);
+
+ WriteTimer.Reset(WriteTimeout);
+
+ Debug.Console(1, "Config File write timer has been reset.");
+ }
+
+ ///
+ /// Writes the current config to a file in the LocalConfig subfolder
+ ///
+ ///
+ private static void WriteConfigFile(object o)
+ {
+ var filePath = Global.FilePathPrefix + LocalConfigFolder + Global.DirectorySeparator + "configurationFile.json";
+
+ var configData = JsonConvert.SerializeObject(ConfigReader.ConfigObject);
+
+ WriteFile(filePath, configData);
+ }
+
+ ///
+ /// Writes
+ ///
+ ///
+ ///
+ public static void WriteFile(string filePath, string configData)
+ {
+ if (WriteTimer != null)
+ WriteTimer.Stop();
+
+ Debug.Console(0, Debug.ErrorLogLevel.Notice, "Writing Configuration to file");
+
+ Debug.Console(0, Debug.ErrorLogLevel.Notice, "Attempting to write config file: '{0}'", filePath);
+
+ try
+ {
+ if (fileLock.TryEnter())
+ {
+ using (StreamWriter sw = new StreamWriter(filePath))
+ {
+ sw.Write(configData);
+ sw.Flush();
+ }
+ }
+ else
+ {
+ Debug.Console(0, Debug.ErrorLogLevel.Error, "Unable to enter FileLock");
+ }
+ }
+ catch (Exception e)
+ {
+ Debug.Console(0, Debug.ErrorLogLevel.Error, "Error: Config write failed: \r{0}", e);
+ }
+ finally
+ {
+ if (fileLock != null && !fileLock.Disposed)
+ fileLock.Leave();
+
+ }
+ }
+
+
+ }
}
\ No newline at end of file
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Config/Essentials/EssentialsConfig.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Config/Essentials/EssentialsConfig.cs
index cc3375e2..1e819414 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Config/Essentials/EssentialsConfig.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Config/Essentials/EssentialsConfig.cs
@@ -51,6 +51,13 @@ namespace PepperDash.Essentials.Core.Config
[JsonProperty("rooms")]
public List Rooms { get; set; }
+
+
+ public EssentialsConfig()
+ : base()
+ {
+ Rooms = new List();
+ }
}
///
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Crestron IO/C2nIo/C2nIoController.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Crestron IO/C2nIo/C2nIoController.cs
new file mode 100644
index 00000000..0b70288f
--- /dev/null
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Crestron IO/C2nIo/C2nIoController.cs
@@ -0,0 +1,106 @@
+using System;
+using System.Collections.Generic;
+using Crestron.SimplSharpPro;
+using Crestron.SimplSharpPro.DeviceSupport;
+using Crestron.SimplSharpPro.GeneralIO;
+using PepperDash.Core;
+using PepperDash.Essentials.Core.Bridges;
+using PepperDash.Essentials.Core.Config;
+
+namespace PepperDash.Essentials.Core.CrestronIO
+{
+ public class C2NIoController:CrestronGenericBaseDevice, IComPorts, IIROutputPorts, IRelayPorts
+ {
+ private C2nIo _device;
+
+ public C2NIoController(string key, Func preActivationFunc, DeviceConfig config):base(key, config.Name)
+ {
+ AddPreActivationAction(() =>
+ {
+ _device = preActivationFunc(config);
+
+ RegisterCrestronGenericBase(_device);
+ });
+ }
+
+ #region Implementation of IComPorts
+
+ public CrestronCollection ComPorts
+ {
+ get { return _device.ComPorts; }
+ }
+
+ public int NumberOfComPorts
+ {
+ get { return _device.NumberOfComPorts; }
+ }
+
+ #endregion
+
+ #region Implementation of IIROutputPorts
+
+ public CrestronCollection IROutputPorts
+ {
+ get { return _device.IROutputPorts; }
+ }
+
+ public int NumberOfIROutputPorts
+ {
+ get { return _device.NumberOfIROutputPorts; }
+ }
+
+ #endregion
+
+ #region Implementation of IRelayPorts
+
+ public CrestronCollection RelayPorts
+ {
+ get { return _device.RelayPorts; }
+ }
+
+ public int NumberOfRelayPorts
+ {
+ get { return _device.NumberOfRelayPorts; }
+ }
+
+ #endregion
+ }
+
+ public class C2NIoControllerFactory : EssentialsDeviceFactory
+ {
+ public C2NIoControllerFactory()
+ {
+ TypeNames = new List() { "c2nio" };
+ }
+
+ public override EssentialsDevice BuildDevice(DeviceConfig dc)
+ {
+ Debug.Console(1, "Factory Attempting to create new C2N-IO Device");
+
+ return new C2NIoController(dc.Key, GetC2NIoDevice, dc);
+ }
+
+ static C2nIo GetC2NIoDevice(DeviceConfig dc)
+ {
+ var control = CommFactory.GetControlPropertiesConfig(dc);
+ var cresnetId = control.CresnetIdInt;
+ var branchId = control.ControlPortNumber;
+ var parentKey = string.IsNullOrEmpty(control.ControlPortDevKey) ? "processor" : control.ControlPortDevKey;
+
+ if (parentKey.Equals("processor", StringComparison.CurrentCultureIgnoreCase))
+ {
+ Debug.Console(0, "Device {0} is a valid cresnet master - creating new C2nIo", parentKey);
+ return new C2nIo(cresnetId, Global.ControlSystem);
+ }
+ var cresnetBridge = DeviceManager.GetDeviceForKey(parentKey) as IHasCresnetBranches;
+
+ if (cresnetBridge != null)
+ {
+ Debug.Console(0, "Device {0} is a valid cresnet master - creating new C2nIo", parentKey);
+ return new C2nIo(cresnetId, cresnetBridge.CresnetBranches[branchId]);
+ }
+ Debug.Console(0, "Device {0} is not a valid cresnet master", parentKey);
+ return null;
+ }
+ }
+}
\ No newline at end of file
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Crestron IO/Relay/CenIoRy104Controller.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Crestron IO/Relay/CenIoRy104Controller.cs
new file mode 100644
index 00000000..19ca8438
--- /dev/null
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Crestron IO/Relay/CenIoRy104Controller.cs
@@ -0,0 +1,77 @@
+using System.Collections.Generic;
+using Crestron.SimplSharpPro;
+using Crestron.SimplSharpPro.GeneralIO;
+using PepperDash.Core;
+using PepperDash.Essentials.Core.Config;
+
+namespace PepperDash.Essentials.Core
+{
+ ///
+ /// Wrapper class for CEN-IO-RY-104 relay module
+ ///
+ [Description("Wrapper class for the CEN-IO-RY-104 relay module")]
+ public class CenIoRy104Controller : EssentialsDevice, IRelayPorts
+ {
+ private readonly CenIoRy104 _ry104;
+
+ ///
+ /// Constructor
+ ///
+ ///
+ ///
+ ///
+ public CenIoRy104Controller(string key, string name, CenIoRy104 ry104)
+ : base(key, name)
+ {
+ _ry104 = ry104;
+ }
+
+ ///
+ /// Relay port collection
+ ///
+ public CrestronCollection RelayPorts
+ {
+ get { return _ry104.RelayPorts; }
+ }
+
+ ///
+ /// Number of relay ports property
+ ///
+ public int NumberOfRelayPorts
+ {
+ get { return _ry104.NumberOfRelayPorts; }
+ }
+ }
+
+ ///
+ /// CEN-IO-RY Controller factory
+ ///
+ public class CenIoRy104ControllerFactory : EssentialsDeviceFactory
+ {
+ ///
+ /// Constructor
+ ///
+ public CenIoRy104ControllerFactory()
+ {
+ TypeNames = new List() { "ceniory104" };
+ }
+
+ public override EssentialsDevice BuildDevice(DeviceConfig dc)
+ {
+ Debug.Console(1, "Factory Attempting to create a new CEN-IO-RY-104 Device");
+
+ var controlPropertiesConfig = CommFactory.GetControlPropertiesConfig(dc);
+ if (controlPropertiesConfig == null)
+ {
+ Debug.Console(1, "Factory failed to create a new CEN-IO-RY-104 Device");
+ return null;
+ }
+
+ var ipid = controlPropertiesConfig.IpIdInt;
+ if (ipid != 0) return new CenIoRy104Controller(dc.Key, dc.Name, new CenIoRy104(ipid, Global.ControlSystem));
+
+ Debug.Console(1, "Factory failed to create a new CEN-IO-RY-104 Device using IP-ID-{0}", ipid);
+ return null;
+ }
+ }
+}
\ No newline at end of file
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Crestron IO/Relay/GenericRelayDevice.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Crestron IO/Relay/GenericRelayDevice.cs
index 445ac338..69c588ae 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Crestron IO/Relay/GenericRelayDevice.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Crestron IO/Relay/GenericRelayDevice.cs
@@ -44,6 +44,12 @@ namespace PepperDash.Essentials.Core.CrestronIO
{
RelayOutput = postActivationFunc(config);
+ if (RelayOutput == null)
+ {
+ Debug.Console(0, this, Debug.ErrorLogLevel.Error, "Unable to get parent relay device for device key {0} and port {1}", config.PortDeviceKey, config.PortNumber);
+ return;
+ }
+
RelayOutput.Register();
RelayOutput.StateChange += RelayOutput_StateChange;
@@ -61,33 +67,36 @@ namespace PepperDash.Essentials.Core.CrestronIO
{
if (!Global.ControlSystem.SupportsRelay)
{
- Debug.Console(0, "GetRelayDevice: Processor does not support relays");
+ Debug.Console(0, "Processor does not support relays");
return null;
}
relayDevice = Global.ControlSystem;
+
+ return relayDevice.RelayPorts[dc.PortNumber];
}
- else
+
+ var essentialsDevice = DeviceManager.GetDeviceForKey(dc.PortDeviceKey);
+ if (essentialsDevice == null)
{
- var relayDev = DeviceManager.GetDeviceForKey(dc.PortDeviceKey) as IRelayPorts;
- if (relayDev == null)
- {
- Debug.Console(0, "GetRelayDevice: Device {0} is not a valid device", dc.PortDeviceKey);
- return null;
- }
- relayDevice = relayDev;
- }
- if (relayDevice == null)
- {
- Debug.Console(0, "GetRelayDevice: Device '0' is not a valid IRelayPorts Device", dc.PortDeviceKey);
+ Debug.Console(0, "Device {0} was not found in Device Manager. Check configuration or for errors with device.", dc.PortDeviceKey);
return null;
}
- if (dc.PortNumber > relayDevice.NumberOfRelayPorts)
- {
- Debug.Console(0, "GetRelayDevice: Device {0} does not contain a port {1}", dc.PortDeviceKey, dc.PortNumber);
- }
+ relayDevice = essentialsDevice as IRelayPorts;
- return relayDevice.RelayPorts[dc.PortNumber];
+ if (relayDevice == null)
+ {
+ Debug.Console(0, "Device {0} is not a valid relay parent. Please check configuration.", dc.PortDeviceKey);
+ return null;
+ }
+
+ if (dc.PortNumber <= relayDevice.NumberOfRelayPorts)
+ {
+ return relayDevice.RelayPorts[dc.PortNumber];
+ }
+
+ Debug.Console(0, "Device {0} does not contain a port {1}", dc.PortDeviceKey, dc.PortNumber);
+ return null;
}
#endregion
@@ -200,58 +209,6 @@ namespace PepperDash.Essentials.Core.CrestronIO
var portDevice = new GenericRelayDevice(dc.Key, dc.Name, GetRelay, props);
return portDevice;
-
-
- /*
- if (props.PortDeviceKey == "processor")
- portDevice = Global.ControlSystem as IRelayPorts;
- else
- portDevice = DeviceManager.GetDeviceForKey(props.PortDeviceKey) as IRelayPorts;
-
- if (portDevice == null)
- Debug.Console(0, "Unable to add relay device with key '{0}'. Port Device does not support relays", key);
- else
- {
- var cs = (portDevice as CrestronControlSystem);
-
- if (cs != null)
- {
- // The relay is on a control system processor
- if (!cs.SupportsRelay || props.PortNumber > cs.NumberOfRelayPorts)
- {
- Debug.Console(0, "Port Device: {0} does not support relays or does not have enough relays");
- return null;
- }
- }
- else
- {
- // The relay is on another device type
-
- if (props.PortNumber > portDevice.NumberOfRelayPorts)
- {
- Debug.Console(0, "Port Device: {0} does not have enough relays");
- return null;
- }
- }
-
- Relay relay = portDevice.RelayPorts[props.PortNumber];
-
- if (!relay.Registered)
- {
- if (relay.Register() == eDeviceRegistrationUnRegistrationResponse.Success)
- return new GenericRelayDevice(key, relay);
- else
- Debug.Console(0, "Attempt to register relay {0} on device with key '{1}' failed.", props.PortNumber, props.PortDeviceKey);
- }
- else
- {
- return new GenericRelayDevice(key, relay);
- }
-
- // Future: Check if portDevice is 3-series card or other non control system that supports versiports
- }
- */
-
}
}
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Crestron/CrestronGenericBaseDevice.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Crestron/CrestronGenericBaseDevice.cs
index 56b36791..b7534087 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Crestron/CrestronGenericBaseDevice.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Crestron/CrestronGenericBaseDevice.cs
@@ -69,19 +69,28 @@ namespace PepperDash.Essentials.Core
public override bool CustomActivate()
{
Debug.Console(0, this, "Activating");
- if (!PreventRegistration)
- {
+ if (!PreventRegistration)
+ {
//Debug.Console(1, this, " Does not require registration. Skipping");
- var response = Hardware.RegisterWithLogging(Key);
- if (response != eDeviceRegistrationUnRegistrationResponse.Success)
- {
- //Debug.Console(0, this, "ERROR: Cannot register Crestron device: {0}", response);
- return false;
- }
+ var response = Hardware.RegisterWithLogging(Key);
+ if (response != eDeviceRegistrationUnRegistrationResponse.Success)
+ {
+ //Debug.Console(0, this, "ERROR: Cannot register Crestron device: {0}", response);
+ return false;
+ }
IsRegistered.FireUpdate();
- }
+ }
+ else
+ {
+ AddPostActivationAction(() =>
+ {
+ var response = Hardware.RegisterWithLogging(Key);
+
+ IsRegistered.FireUpdate();
+ });
+ }
foreach (var f in Feedbacks)
{
@@ -130,6 +139,12 @@ namespace PepperDash.Essentials.Core
void Hardware_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args)
{
Debug.Console(2, this, "OnlineStatusChange Event. Online = {0}", args.DeviceOnLine);
+
+ if (!Hardware.Registered)
+ {
+ return; // protects in cases where device has been unregistered and feedbacks would attempt to access null sigs.
+ }
+
foreach (var feedback in Feedbacks)
{
if (feedback != null)
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/DeviceTypeInterfaces/IHasBranding.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/DeviceTypeInterfaces/IHasBranding.cs
index d5c95c47..63f4917a 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/DeviceTypeInterfaces/IHasBranding.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/DeviceTypeInterfaces/IHasBranding.cs
@@ -1,8 +1,20 @@
-namespace PepperDash_Essentials_Core.DeviceTypeInterfaces
+using System;
+
+namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
{
public interface IHasBranding
{
bool BrandingEnabled { get; }
void InitializeBranding(string roomKey);
}
+}
+
+namespace PepperDash_Essentials_Core.DeviceTypeInterfaces
+{
+ [Obsolete("Use PepperDash.Essentials.Core.DeviceTypeInterfaces")]
+ public interface IHasBranding
+ {
+ bool BrandingEnabled { get; }
+ void InitializeBranding(string roomKey);
+ }
}
\ No newline at end of file
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/DeviceTypeInterfaces/IHasPhoneDialing.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/DeviceTypeInterfaces/IHasPhoneDialing.cs
index 2b7af8ad..7f75adec 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/DeviceTypeInterfaces/IHasPhoneDialing.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/DeviceTypeInterfaces/IHasPhoneDialing.cs
@@ -1,6 +1,7 @@
-using PepperDash.Essentials.Core;
+using System;
+using PepperDash.Essentials.Core;
-namespace PepperDash_Essentials_Core.DeviceTypeInterfaces
+namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
{
public interface IHasPhoneDialing
{
@@ -11,4 +12,18 @@ namespace PepperDash_Essentials_Core.DeviceTypeInterfaces
void EndPhoneCall();
void SendDtmfToPhone(string digit);
}
+}
+
+namespace PepperDash_Essentials_Core.DeviceTypeInterfaces
+{
+ [Obsolete("Use PepperDash.Essentials.Core.DeviceTypeInterfaces")]
+ public interface IHasPhoneDialing
+ {
+ BoolFeedback PhoneOffHookFeedback { get; }
+ StringFeedback CallerIdNameFeedback { get; }
+ StringFeedback CallerIdNumberFeedback { get; }
+ void DialPhoneCall(string number);
+ void EndPhoneCall();
+ void SendDtmfToPhone(string digit);
+ }
}
\ No newline at end of file
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/DeviceTypeInterfaces/ILanguageDefinition.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/DeviceTypeInterfaces/ILanguageDefinition.cs
index f124240d..abf138a4 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/DeviceTypeInterfaces/ILanguageDefinition.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/DeviceTypeInterfaces/ILanguageDefinition.cs
@@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;
-namespace PepperDash_Essentials_Core.DeviceTypeInterfaces
+namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
{
public interface ILanguageDefinition
{
@@ -15,4 +15,21 @@ namespace PepperDash_Essentials_Core.DeviceTypeInterfaces
List DestinationGroupNames { get; set; }
List RoomNames { get; set; }
}
+}
+
+namespace PepperDash_Essentials_Core.DeviceTypeInterfaces
+{
+ [Obsolete("Use PepperDash.Essentials.Core.DeviceTypeInterfaces")]
+ public interface ILanguageDefinition
+ {
+ string LocaleName { get; set; }
+ string FriendlyName { get; set; }
+ bool Enable { get; set; }
+ List UiLabels { get; set; }
+ List Sources { get; set; }
+ List Destinations { get; set; }
+ List SourceGroupNames { get; set; }
+ List DestinationGroupNames { get; set; }
+ List RoomNames { get; set; }
+ }
}
\ No newline at end of file
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/DeviceTypeInterfaces/ILanguageProvider.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/DeviceTypeInterfaces/ILanguageProvider.cs
index 2ae483f6..dd48723d 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/DeviceTypeInterfaces/ILanguageProvider.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/DeviceTypeInterfaces/ILanguageProvider.cs
@@ -1,9 +1,21 @@
using System;
-using System.Collections.Generic;
+
+namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
+{
+
+ public interface ILanguageProvider
+ {
+ ILanguageDefinition CurrentLanguage { get; set; }
+
+ event EventHandler CurrentLanguageChanged;
+ }
+
+}
namespace PepperDash_Essentials_Core.DeviceTypeInterfaces
{
- public interface ILanguageProvider
+ [Obsolete("Use PepperDash.Essentials.Core.DeviceTypeInterfaces")]
+ public interface ILanguageProvider
{
ILanguageDefinition CurrentLanguage { get; set; }
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/DeviceTypeInterfaces/IMobileControl.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/DeviceTypeInterfaces/IMobileControl.cs
index 2dfa7c41..bb800b44 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/DeviceTypeInterfaces/IMobileControl.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/DeviceTypeInterfaces/IMobileControl.cs
@@ -8,11 +8,19 @@ namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
///
public interface IMobileControl : IKeyed
{
- void CreateMobileControlRoomBridge(EssentialsRoomBase room, IMobileControl parent);
+ void CreateMobileControlRoomBridge(IEssentialsRoom room, IMobileControl parent);
void LinkSystemMonitorToAppServer();
}
+ ///
+ /// Describes a MobileSystemController that accepts IEssentialsRoom
+ ///
+ public interface IMobileControl3 : IMobileControl
+ {
+ void CreateMobileControlRoomBridge(IEssentialsRoom room, IMobileControl parent);
+ }
+
///
/// Describes a MobileControl Room Bridge
///
@@ -20,6 +28,10 @@ namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
{
event EventHandler UserCodeChanged;
+ event EventHandler UserPromptedForCode;
+
+ event EventHandler ClientJoined;
+
string UserCode { get; }
string QrCodeUrl { get; }
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/DeviceTypeInterfaces/INumeric.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/DeviceTypeInterfaces/INumeric.cs
index 0294a0b5..62ea8b3f 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/DeviceTypeInterfaces/INumeric.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/DeviceTypeInterfaces/INumeric.cs
@@ -1,5 +1,5 @@
using Crestron.SimplSharpPro.DeviceSupport;
-
+using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.SmartObjects;
@@ -8,7 +8,7 @@ namespace PepperDash.Essentials.Core
///
///
///
- public interface INumericKeypad
+ public interface INumericKeypad:IKeyed
{
void Digit0(bool pressRelease);
void Digit1(bool pressRelease);
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/DeviceTypeInterfaces/IPasswordPrompt.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/DeviceTypeInterfaces/IPasswordPrompt.cs
new file mode 100644
index 00000000..6ecdd775
--- /dev/null
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/DeviceTypeInterfaces/IPasswordPrompt.cs
@@ -0,0 +1,56 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Crestron.SimplSharp;
+
+namespace PepperDash.Essentials.Core
+{
+ ///
+ /// Describes the functionality required to prompt a user to enter a password
+ ///
+ public interface IPasswordPrompt
+ {
+ ///
+ /// Notifies when a password is required or is entered incorrectly
+ ///
+ event EventHandler PasswordRequired;
+
+ ///
+ /// Submits the password
+ ///
+ ///
+ void SubmitPassword(string password);
+ }
+
+ public class PasswordPromptEventArgs : EventArgs
+ {
+ ///
+ /// Indicates if the last submitted password was incorrect
+ ///
+ public bool LastAttemptWasIncorrect { get; private set; }
+
+ ///
+ /// Indicates that the login attempt has failed
+ ///
+ public bool LoginAttemptFailed { get; private set; }
+
+ ///
+ /// Indicates that the process was cancelled and the prompt should be dismissed
+ ///
+ public bool LoginAttemptCancelled { get; private set; }
+
+ ///
+ /// A message to be displayed to the user
+ ///
+ public string Message { get; private set; }
+
+ public PasswordPromptEventArgs(bool lastAttemptIncorrect, bool loginFailed, bool loginCancelled, string message)
+ {
+ LastAttemptWasIncorrect = lastAttemptIncorrect;
+ LoginAttemptFailed = loginFailed;
+ LoginAttemptCancelled = loginCancelled;
+ Message = message;
+ }
+ }
+}
\ No newline at end of file
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/DeviceTypeInterfaces/ISetTopBoxControls.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/DeviceTypeInterfaces/ISetTopBoxControls.cs
index 8b043cac..a9a92126 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/DeviceTypeInterfaces/ISetTopBoxControls.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/DeviceTypeInterfaces/ISetTopBoxControls.cs
@@ -31,7 +31,7 @@ namespace PepperDash.Essentials.Core
///
bool HasDpad { get; }
- PepperDash.Essentials.Core.Presets.DevicePresetsModel PresetsModel { get; }
+ PepperDash.Essentials.Core.Presets.DevicePresetsModel TvPresets { get; }
void LoadPresets(string filePath);
void DvrList(bool pressRelease);
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/DeviceTypeInterfaces/ITvPresetsProvider.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/DeviceTypeInterfaces/ITvPresetsProvider.cs
new file mode 100644
index 00000000..61b8ec09
--- /dev/null
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/DeviceTypeInterfaces/ITvPresetsProvider.cs
@@ -0,0 +1,9 @@
+using PepperDash.Essentials.Core.Presets;
+
+namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
+{
+ public interface ITvPresetsProvider
+ {
+ DevicePresetsModel TvPresets { get; }
+ }
+}
\ No newline at end of file
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/DeviceTypeInterfaces/LanguageLabel.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/DeviceTypeInterfaces/LanguageLabel.cs
index 345da2ed..c7d26722 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/DeviceTypeInterfaces/LanguageLabel.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/DeviceTypeInterfaces/LanguageLabel.cs
@@ -1,6 +1,7 @@
-using PepperDash.Core;
+using System;
+using PepperDash.Core;
-namespace PepperDash_Essentials_Core.DeviceTypeInterfaces
+namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
{
public class LanguageLabel
{
@@ -9,4 +10,16 @@ namespace PepperDash_Essentials_Core.DeviceTypeInterfaces
public string DisplayText { get; set; }
public uint JoinNumber { get; set; }
}
+}
+
+namespace PepperDash_Essentials_Core.DeviceTypeInterfaces
+{
+ [Obsolete("Use PepperDash.Essentials.Core.DeviceTypeInterfaces")]
+ public class LanguageLabel
+ {
+ public string Key { get; set; }
+ public string Description { get; set; }
+ public string DisplayText { get; set; }
+ public uint JoinNumber { get; set; }
+ }
}
\ No newline at end of file
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/DestinationListItem.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/DestinationListItem.cs
new file mode 100644
index 00000000..49379e44
--- /dev/null
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/DestinationListItem.cs
@@ -0,0 +1,54 @@
+using Newtonsoft.Json;
+using PepperDash.Essentials.Core;
+
+namespace PepperDash.Essentials.Core
+{
+ public class DestinationListItem
+ {
+ [JsonProperty("sinkKey")]
+ public string SinkKey { get; set; }
+
+ private EssentialsDevice _sinkDevice;
+
+ [JsonIgnore]
+ public EssentialsDevice SinkDevice
+ {
+ get { return _sinkDevice ?? (_sinkDevice = DeviceManager.GetDeviceForKey(SinkKey) as EssentialsDevice); }
+ }
+
+ [JsonProperty("preferredName")]
+ public string PreferredName
+ {
+ get
+ {
+ if (!string.IsNullOrEmpty(Name))
+ {
+ return Name;
+ }
+
+ return SinkDevice == null ? "---" : SinkDevice.Name;
+ }
+ }
+
+ [JsonProperty("name")]
+ public string Name { get; set; }
+
+ [JsonProperty("includeInDestinationList")]
+ public bool IncludeInDestinationList { get; set; }
+
+ [JsonProperty("order")]
+ public int Order { get; set; }
+
+ [JsonProperty("surfaceLocation")]
+ public int SurfaceLocation { get; set; }
+
+ [JsonProperty("verticalLocation")]
+ public int VerticalLocation { get; set; }
+
+ [JsonProperty("horizontalLocation")]
+ public int HorizontalLocation { get; set; }
+
+ [JsonProperty("sinkType")]
+ public eRoutingSignalType SinkType { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/DeviceJsonApi.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/DeviceJsonApi.cs
index c7bc7c68..2dda0bf8 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/DeviceJsonApi.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/DeviceJsonApi.cs
@@ -20,8 +20,23 @@ namespace PepperDash.Essentials.Core
///
public static void DoDeviceActionWithJson(string json)
{
- var action = JsonConvert.DeserializeObject(json);
- DoDeviceAction(action);
+ if (String.IsNullOrEmpty(json))
+ {
+ CrestronConsole.ConsoleCommandResponse(
+ "Please provide a JSON object matching the format {\"deviceKey\":\"myDevice\", \"methodName\":\"someMethod\", \"params\": [\"param1\", true]}.\r\nIf the method has no parameters, the \"params\" object may be omitted.");
+ return;
+ }
+ try
+ {
+ var action = JsonConvert.DeserializeObject(json);
+
+ DoDeviceAction(action);
+ }
+ catch (Exception ex)
+ {
+ CrestronConsole.ConsoleCommandResponse("Incorrect format for JSON. Please check that the format matches {\"deviceKey\":\"myDevice\", \"methodName\":\"someMethod\", \"params\": [\"param1\", true]}");
+ }
+
}
@@ -33,31 +48,65 @@ namespace PepperDash.Essentials.Core
{
var key = action.DeviceKey;
var obj = FindObjectOnPath(key);
- if (obj == null)
- return;
+ if (obj == null)
+ {
+ CrestronConsole.ConsoleCommandResponse("Unable to find object at path {0}", key);
+ return;
+ }
- CType t = obj.GetType();
- var method = t.GetMethod(action.MethodName);
- if (method == null)
- {
- Debug.Console(0, "Method '{0}' not found", action.MethodName);
- return;
- }
- var mParams = method.GetParameters();
- // Add empty params if not provided
- if (action.Params == null) action.Params = new object[0];
- if (mParams.Length > action.Params.Length)
- {
- Debug.Console(0, "Method '{0}' requires {1} params", action.MethodName, mParams.Length);
- return;
- }
- object[] convertedParams = mParams
- .Select((p, i) => Convert.ChangeType(action.Params[i], p.ParameterType,
- System.Globalization.CultureInfo.InvariantCulture))
- .ToArray();
- object ret = method.Invoke(obj, convertedParams);
+ if (action.Params == null)
+ {
+ //no params, so setting action.Params to empty array
+ action.Params = new object[0];
+ }
+
+ CType t = obj.GetType();
+ try
+ {
+ var methods = t.GetMethods().Where(m => m.Name == action.MethodName).ToList();
+
+ var method = methods.Count == 1 ? methods[0] : methods.FirstOrDefault(m => m.GetParameters().Length == action.Params.Length);
+
+ if (method == null)
+ {
+ CrestronConsole.ConsoleCommandResponse(
+ "Unable to find method with name {0} and that matches parameters {1}", action.MethodName,
+ action.Params);
+ return;
+ }
+ var mParams = method.GetParameters();
+
+ var convertedParams = mParams
+ .Select((p, i) => ConvertType(action.Params[i], p.ParameterType))
+ .ToArray();
+ method.Invoke(obj, convertedParams);
+
+ CrestronConsole.ConsoleCommandResponse("Method {0} successfully called on device {1}", method.Name,
+ action.DeviceKey);
+ }
+ catch (Exception ex)
+ {
+ CrestronConsole.ConsoleCommandResponse("Unable to call method with name {0}. {1}", action.MethodName,
+ ex.Message);}
}
+ private static object ConvertType(object value, Type conversionType)
+ {
+ if (!conversionType.IsEnum)
+ {
+ return Convert.ChangeType(value, conversionType, System.Globalization.CultureInfo.InvariantCulture);
+ }
+
+ var stringValue = Convert.ToString(value);
+
+ if (String.IsNullOrEmpty(stringValue))
+ {
+ throw new InvalidCastException(
+ String.Format("{0} cannot be converted to a string prior to conversion to enum"));
+ }
+ return Enum.Parse(conversionType, stringValue, true);
+ }
+
///
/// Gets the properties on a device
///
@@ -83,13 +132,13 @@ namespace PepperDash.Essentials.Core
///
public static object GetPropertyByName(string deviceObjectPath, string propertyName)
{
- var obj = FindObjectOnPath(deviceObjectPath);
- if(obj == null)
+ var dev = FindObjectOnPath(deviceObjectPath);
+ if(dev == null)
return "{ \"error\":\"No Device\"}";
+
+ object prop = dev.GetType().GetCType().GetProperty(propertyName).GetValue(dev, null);
- CType t = obj.GetType();
-
- var prop = t.GetProperty(propertyName);
+ // var prop = t.GetProperty(propertyName);
if (prop != null)
{
return prop;
@@ -242,6 +291,8 @@ namespace PepperDash.Essentials.Core
//var props = t.GetProperties().Select(p => new PropertyNameType(p, obj));
//return JsonConvert.SerializeObject(props, Formatting.Indented);
}
+
+
}
public class DeviceActionWrapper
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/DeviceManager.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/DeviceManager.cs
index 0e4efa10..df864550 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/DeviceManager.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/DeviceManager.cs
@@ -46,7 +46,7 @@ namespace PepperDash.Essentials.Core
CrestronConsole.AddNewConsoleCommand(SimulateComReceiveOnDevice, "devsimreceive",
"Simulates incoming data on a com device", ConsoleAccessLevelEnum.AccessOperator);
- CrestronConsole.AddNewConsoleCommand(s => SetDeviceStreamDebugging(s), "setdevicestreamdebug", "set comm debug [deviceKey] [off/rx/tx/both] ([minutes])", ConsoleAccessLevelEnum.AccessOperator);
+ CrestronConsole.AddNewConsoleCommand(SetDeviceStreamDebugging, "setdevicestreamdebug", "set comm debug [deviceKey] [off/rx/tx/both] ([minutes])", ConsoleAccessLevelEnum.AccessOperator);
CrestronConsole.AddNewConsoleCommand(s => DisableAllDeviceStreamDebugging(), "disableallstreamdebug", "disables stream debugging on all devices", ConsoleAccessLevelEnum.AccessOperator);
}
@@ -60,6 +60,7 @@ namespace PepperDash.Essentials.Core
DeviceCriticalSection.Enter();
AddDeviceEnabled = false;
// PreActivate all devices
+ Debug.Console(0,"****PreActivation starting...****");
foreach (var d in Devices.Values)
{
try
@@ -69,9 +70,12 @@ namespace PepperDash.Essentials.Core
}
catch (Exception e)
{
- Debug.Console(0, d, "ERROR: Device PreActivation failure:\r{0}", e);
+ Debug.Console(0, d, "ERROR: Device {1} PreActivation failure: {0}", e.Message, d.Key);
+ Debug.Console(1, d, "Stack Trace: {0}", e.StackTrace);
}
}
+ Debug.Console(0, "****PreActivation complete****");
+ Debug.Console(0, "****Activation starting...****");
// Activate all devices
foreach (var d in Devices.Values)
@@ -83,10 +87,14 @@ namespace PepperDash.Essentials.Core
}
catch (Exception e)
{
- Debug.Console(0, d, "ERROR: Device Activation failure:\r{0}", e);
+ Debug.Console(0, d, "ERROR: Device {1} Activation failure: {0}", e.Message, d.Key);
+ Debug.Console(1, d, "Stack Trace: {0}", e.StackTrace);
}
}
+ Debug.Console(0, "****Activation complete****");
+ Debug.Console(0, "****PostActivation starting...****");
+
// PostActivate all devices
foreach (var d in Devices.Values)
{
@@ -97,10 +105,13 @@ namespace PepperDash.Essentials.Core
}
catch (Exception e)
{
- Debug.Console(0, d, "ERROR: Device PostActivation failure:\r{0}", e);
+ Debug.Console(0, d, "ERROR: Device {1} PostActivation failure: {0}", e.Message, d.Key);
+ Debug.Console(1, d, "Stack Trace: {0}", e.StackTrace);
}
}
+ Debug.Console(0, "****PostActivation complete****");
+
OnAllDevicesActivated();
}
finally
@@ -360,9 +371,9 @@ namespace PepperDash.Essentials.Core
{
var device = GetDeviceForKey(s);
- if (device == null) return;
- var inputPorts = (device as IRoutingInputsOutputs).InputPorts;
- var outputPorts = (device as IRoutingInputsOutputs).OutputPorts;
+ if (device == null) return;
+ var inputPorts = ((device as IRoutingInputs) != null) ? (device as IRoutingInputs).InputPorts : null;
+ var outputPorts = ((device as IRoutingOutputs) != null) ? (device as IRoutingOutputs).OutputPorts : null;
if (inputPorts != null)
{
Debug.Console(0, "Device {0} has {1} Input Ports:", s, inputPorts.Count);
@@ -387,6 +398,15 @@ namespace PepperDash.Essentials.Core
///
public static void SetDeviceStreamDebugging(string s)
{
+ if (String.IsNullOrEmpty(s) || s.Contains("?"))
+ {
+ CrestronConsole.ConsoleCommandResponse(
+ @"SETDEVICESTREAMDEBUG [{deviceKey}] [OFF |TX | RX | BOTH] [timeOutInMinutes]
+ {deviceKey} [OFF | TX | RX | BOTH] - Device to set stream debugging on, and which setting to use
+ timeOutInMinutes - Set timeout for stream debugging. Default is 30 minutes");
+ return;
+ }
+
var args = s.Split(' ');
var deviceKey = args[0];
@@ -426,7 +446,7 @@ namespace PepperDash.Essentials.Core
var min = Convert.ToUInt32(timeout);
device.StreamDebugging.SetDebuggingWithSpecificTimeout(debugSetting, min);
- Debug.Console(0, "Device: '{0}' debug level set to {1) for {2} minutes", deviceKey, debugSetting, min);
+ Debug.Console(0, "Device: '{0}' debug level set to {1} for {2} minutes", deviceKey, debugSetting, min);
}
catch (Exception e)
@@ -437,7 +457,7 @@ namespace PepperDash.Essentials.Core
else
{
device.StreamDebugging.SetDebuggingWithDefaultTimeout(debugSetting);
- Debug.Console(0, "Device: '{0}' debug level set to {1) for default time (30 minutes)", deviceKey, debugSetting);
+ Debug.Console(0, "Device: '{0}' debug level set to {1} for default time (30 minutes)", deviceKey, debugSetting);
}
}
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/EssentialsDevice.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/EssentialsDevice.cs
index 8d7f2c8d..a72bd282 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/EssentialsDevice.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/EssentialsDevice.cs
@@ -1,113 +1,134 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Crestron.SimplSharp;
-using Crestron.SimplSharp.Reflection;
-
-using PepperDash.Core;
-using PepperDash.Essentials.Core.Config;
-
-namespace PepperDash.Essentials.Core
-{
- ///
- /// Defines the basic needs for an EssentialsDevice to enable it to be build by an IDeviceFactory class
- ///
- [Description("The base Essentials Device Class")]
- public abstract class EssentialsDevice : Device
- {
- protected EssentialsDevice(string key)
- : base(key)
- {
-
- }
-
- protected EssentialsDevice(string key, string name)
- : base(key, name)
- {
-
- }
- }
-
- [AttributeUsage(AttributeTargets.Class, Inherited = true, AllowMultiple = true)]
- public class DescriptionAttribute : Attribute
- {
- private string _Description;
-
- public DescriptionAttribute(string description)
- {
- Debug.Console(2, "Setting Description: {0}", description);
- _Description = description;
- }
-
- public string Description
- {
- get { return _Description; }
- }
- }
-
- [AttributeUsage(AttributeTargets.Class, Inherited = true, AllowMultiple = true)]
- public class ConfigSnippetAttribute : Attribute
- {
- private string _ConfigSnippet;
-
- public ConfigSnippetAttribute(string configSnippet)
- {
- Debug.Console(2, "Setting Config Snippet {0}", configSnippet);
- _ConfigSnippet = configSnippet;
- }
-
- public string ConfigSnippet
- {
- get { return _ConfigSnippet; }
- }
- }
-
- ///
- /// Devices the basic needs for a Device Factory
- ///
- public abstract class EssentialsDeviceFactory : IDeviceFactory where T:EssentialsDevice
- {
- #region IDeviceFactory Members
-
- ///
- /// A list of strings that can be used in the type property of a DeviceConfig object to build an instance of this device
- ///
- public List TypeNames { get; protected set; }
-
- ///
- /// Loads an item to the DeviceFactory.FactoryMethods dictionary for each entry in the TypeNames list
- ///
- public void LoadTypeFactories()
- {
- foreach (var typeName in TypeNames)
- {
- Debug.Console(2, "Getting Description Attribute from class: '{0}'", typeof(T).FullName);
- var descriptionAttribute = typeof(T).GetCustomAttributes(typeof(DescriptionAttribute), true) as DescriptionAttribute[];
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Crestron.SimplSharp;
+using Crestron.SimplSharp.Reflection;
+
+using PepperDash.Core;
+using PepperDash.Essentials.Core.Config;
+
+namespace PepperDash.Essentials.Core
+{
+ ///
+ /// Defines the basic needs for an EssentialsDevice to enable it to be build by an IDeviceFactory class
+ ///
+ [Description("The base Essentials Device Class")]
+ public abstract class EssentialsDevice : Device
+ {
+ protected EssentialsDevice(string key)
+ : base(key)
+ {
+ SubscribeToActivateComplete();
+ }
+
+ protected EssentialsDevice(string key, string name)
+ : base(key, name)
+ {
+ SubscribeToActivateComplete();
+ }
+
+ private void SubscribeToActivateComplete()
+ {
+ DeviceManager.AllDevicesActivated += DeviceManagerOnAllDevicesActivated;
+ }
+
+ private void DeviceManagerOnAllDevicesActivated(object sender, EventArgs eventArgs)
+ {
+ CrestronInvoke.BeginInvoke((o) =>
+ {
+ try
+ {
+ Initialize();
+ }
+ catch (Exception ex)
+ {
+ Debug.Console(0, this, Debug.ErrorLogLevel.Error, "Exception initializing device: {0}", ex.Message);
+ Debug.Console(1, this, Debug.ErrorLogLevel.Error, "Stack Trace: {0}", ex.StackTrace);
+ }
+ });
+ }
+ }
+
+ [AttributeUsage(AttributeTargets.Class, Inherited = true, AllowMultiple = true)]
+ public class DescriptionAttribute : Attribute
+ {
+ private string _Description;
+
+ public DescriptionAttribute(string description)
+ {
+ //Debug.Console(2, "Setting Description: {0}", description);
+ _Description = description;
+ }
+
+ public string Description
+ {
+ get { return _Description; }
+ }
+ }
+
+ [AttributeUsage(AttributeTargets.Class, Inherited = true, AllowMultiple = true)]
+ public class ConfigSnippetAttribute : Attribute
+ {
+ private string _ConfigSnippet;
+
+ public ConfigSnippetAttribute(string configSnippet)
+ {
+ //Debug.Console(2, "Setting Config Snippet {0}", configSnippet);
+ _ConfigSnippet = configSnippet;
+ }
+
+ public string ConfigSnippet
+ {
+ get { return _ConfigSnippet; }
+ }
+ }
+
+ ///
+ /// Devices the basic needs for a Device Factory
+ ///
+ public abstract class EssentialsDeviceFactory : IDeviceFactory where T:EssentialsDevice
+ {
+ #region IDeviceFactory Members
+
+ ///
+ /// A list of strings that can be used in the type property of a DeviceConfig object to build an instance of this device
+ ///
+ public List TypeNames { get; protected set; }
+
+ ///
+ /// Loads an item to the DeviceFactory.FactoryMethods dictionary for each entry in the TypeNames list
+ ///
+ public void LoadTypeFactories()
+ {
+ foreach (var typeName in TypeNames)
+ {
+ //Debug.Console(2, "Getting Description Attribute from class: '{0}'", typeof(T).FullName);
+ var descriptionAttribute = typeof(T).GetCustomAttributes(typeof(DescriptionAttribute), true) as DescriptionAttribute[];
string description = descriptionAttribute[0].Description;
- var snippetAttribute = typeof(T).GetCustomAttributes(typeof(ConfigSnippetAttribute), true) as ConfigSnippetAttribute[];
- DeviceFactory.AddFactoryForType(typeName.ToLower(), description, typeof(T), BuildDevice);
- }
- }
-
- ///
- /// The method that will build the device
- ///
- /// The device config
- /// An instance of the device
- public abstract EssentialsDevice BuildDevice(DeviceConfig dc);
-
- #endregion
- }
-
- ///
- /// Devices the basic needs for a Device Factory
- ///
- public abstract class EssentialsPluginDeviceFactory : EssentialsDeviceFactory, IPluginDeviceFactory where T : EssentialsDevice
- {
- ///
- /// Specifies the minimum version of Essentials required for a plugin to run. Must use the format Major.Minor.Build (ex. "1.4.33")
- ///
- public string MinimumEssentialsFrameworkVersion { get; protected set; }
- }
+ var snippetAttribute = typeof(T).GetCustomAttributes(typeof(ConfigSnippetAttribute), true) as ConfigSnippetAttribute[];
+ DeviceFactory.AddFactoryForType(typeName.ToLower(), description, typeof(T), BuildDevice);
+ }
+ }
+
+ ///
+ /// The method that will build the device
+ ///
+ /// The device config
+ /// An instance of the device
+ public abstract EssentialsDevice BuildDevice(DeviceConfig dc);
+
+ #endregion
+ }
+
+ ///
+ /// Devices the basic needs for a Device Factory
+ ///
+ public abstract class EssentialsPluginDeviceFactory : EssentialsDeviceFactory, IPluginDeviceFactory where T : EssentialsDevice
+ {
+ ///
+ /// Specifies the minimum version of Essentials required for a plugin to run. Must use the format Major.Minor.Build (ex. "1.4.33")
+ ///
+ public string MinimumEssentialsFrameworkVersion { get; protected set; }
+ }
}
\ No newline at end of file
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/GenericIRController.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/GenericIRController.cs
index bf4544de..409562a2 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/GenericIRController.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/GenericIRController.cs
@@ -7,7 +7,7 @@ using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Bridges;
using PepperDash.Essentials.Core.Config;
-namespace PepperDash_Essentials_Core.Devices
+namespace PepperDash.Essentials.Core.Devices
{
public class GenericIrController: EssentialsBridgeableDevice
{
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/IProjectorInterfaces.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/IProjectorInterfaces.cs
index 6efb7776..70e2e215 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/IProjectorInterfaces.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/IProjectorInterfaces.cs
@@ -1,7 +1,7 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
using Crestron.SimplSharp;
namespace PepperDash.Essentials.Core
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/IReconfigurableDevice.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/IReconfigurableDevice.cs
new file mode 100644
index 00000000..ab0e37c3
--- /dev/null
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/IReconfigurableDevice.cs
@@ -0,0 +1,19 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Crestron.SimplSharp;
+using PepperDash.Essentials.Core.Config;
+
+
+namespace PepperDash.Essentials.Core.Devices
+{
+ public interface IReconfigurableDevice
+ {
+ event EventHandler ConfigChanged;
+
+ DeviceConfig Config { get; }
+
+ void SetConfig(DeviceConfig config);
+ }
+}
\ No newline at end of file
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/IVolumeAndAudioInterfaces.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/IVolumeAndAudioInterfaces.cs
index 1cff62fc..254eada2 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/IVolumeAndAudioInterfaces.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/IVolumeAndAudioInterfaces.cs
@@ -7,25 +7,53 @@ using Crestron.SimplSharp;
namespace PepperDash.Essentials.Core
{
///
- /// Defines minimal volume control methods
+ /// Defines minimal volume and mute control methods
///
- public interface IBasicVolumeControls
+ public interface IBasicVolumeControls : IHasVolumeControl, IHasMuteControl
{
- void VolumeUp(bool pressRelease);
- void VolumeDown(bool pressRelease);
- void MuteToggle();
}
+ ///
+ /// Defines basic volume control methods
+ ///
+ public interface IHasVolumeControl
+ {
+ void VolumeUp(bool pressRelease);
+ void VolumeDown(bool pressRelease);
+ }
+
+ ///
+ /// Defines volume control methods and properties with feedback
+ ///
+ public interface IHasVolumeControlWithFeedback : IHasVolumeControl
+ {
+ void SetVolume(ushort level);
+ IntFeedback VolumeLevelFeedback { get; }
+ }
+
+ ///
+ /// Defines basic mute control methods
+ ///
+ public interface IHasMuteControl
+ {
+ void MuteToggle();
+ }
+
+ ///
+ /// Defines mute control methods and properties with feedback
+ ///
+ public interface IHasMuteControlWithFeedback : IHasMuteControl
+ {
+ BoolFeedback MuteFeedback { get; }
+ void MuteOn();
+ void MuteOff();
+ }
+
///
/// Adds feedback and direct volume level set to IBasicVolumeControls
///
- public interface IBasicVolumeWithFeedback : IBasicVolumeControls
+ public interface IBasicVolumeWithFeedback : IBasicVolumeControls, IHasVolumeControlWithFeedback, IHasMuteControlWithFeedback
{
- void SetVolume(ushort level);
- void MuteOn();
- void MuteOff();
- IntFeedback VolumeLevelFeedback { get; }
- BoolFeedback MuteFeedback { get; }
}
///
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/ReconfigurableDevice.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/ReconfigurableDevice.cs
index 7b4f1c99..3239e192 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/ReconfigurableDevice.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/ReconfigurableDevice.cs
@@ -7,13 +7,15 @@ using Crestron.SimplSharpPro.DeviceSupport;
using PepperDash.Core;
using PepperDash.Essentials.Core.Bridges;
using PepperDash.Essentials.Core.Config;
+using Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
namespace PepperDash.Essentials.Core.Devices
{
///
///
///
- public abstract class ReconfigurableDevice : EssentialsDevice
+ public abstract class ReconfigurableDevice : EssentialsDevice, IReconfigurableDevice
{
public event EventHandler ConfigChanged;
@@ -52,6 +54,8 @@ namespace PepperDash.Essentials.Core.Devices
Name = config.Name;
}
+
+
///
/// Used by the extending class to allow for any custom actions to be taken (tell the ConfigWriter to write config, etc)
///
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/SourceListItem.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/SourceListItem.cs
index 601d75a7..e302a2a4 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/SourceListItem.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/SourceListItem.cs
@@ -130,10 +130,24 @@ namespace PepperDash.Essentials.Core
[JsonProperty("sourceListKey")]
public string SourceListKey { get; set; }
+ ///
+ /// Indicates if the device associated with this source is controllable
+ ///
+ [JsonProperty("isControllable")]
+ public bool IsControllable { get; set; }
+
+ ///
+ /// Indicates that the device associated with this source has audio available
+ ///
+ [JsonProperty("isAudioSource")]
+ public bool IsAudioSource { get; set; }
+
public SourceListItem()
{
Icon = "Blank";
}
+
+
}
public class SourceRouteListItem
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Display/BasicIrDisplay.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Display/BasicIrDisplay.cs
index 8d70bd55..3c691c19 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Display/BasicIrDisplay.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Display/BasicIrDisplay.cs
@@ -20,7 +20,8 @@ namespace PepperDash.Essentials.Core
public IrOutputPortController IrPort { get; private set; }
public ushort IrPulseTime { get; set; }
- public BoolFeedback PowerIsOnFeedback { get; private set; }
+ [Obsolete("This property will be removed in version 2.0.0")]
+ public override BoolFeedback PowerIsOnFeedback { get; protected set; }
protected Func PowerIsOnFeedbackFunc
{
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Display/DisplayBase.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Display/DisplayBase.cs
index e4a2cb26..17ff8bd1 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Display/DisplayBase.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Display/DisplayBase.cs
@@ -18,7 +18,7 @@ namespace PepperDash.Essentials.Core
///
///
///
- public abstract class DisplayBase : EssentialsDevice, IHasFeedback, IRoutingSinkWithSwitching, IHasPowerControl, IWarmingCooling, IUsageTracking
+ public abstract class DisplayBase : EssentialsDevice, IHasFeedback, IRoutingSinkWithSwitching, IHasPowerControl, IWarmingCooling, IUsageTracking, IPower
{
public event SourceInfoChangeHandler CurrentSourceChange;
@@ -49,6 +49,9 @@ namespace PepperDash.Essentials.Core
public BoolFeedback IsCoolingDownFeedback { get; protected set; }
public BoolFeedback IsWarmingUpFeedback { get; private set; }
+ [Obsolete("This property will be removed in version 2.0.0")]
+ public abstract BoolFeedback PowerIsOnFeedback { get; protected set; }
+
public UsageTracking UsageTracker { get; set; }
public uint WarmupTime { get; set; }
@@ -81,8 +84,6 @@ namespace PepperDash.Essentials.Core
}
-
-
public abstract void PowerOn();
public abstract void PowerOff();
public abstract void PowerToggle();
@@ -99,7 +100,7 @@ namespace PepperDash.Essentials.Core
}
}
- public abstract void ExecuteSwitch(object selector);
+ public abstract void ExecuteSwitch(object selector);
protected void LinkDisplayToApi(DisplayBase displayDevice, BasicTriList trilist, uint joinStart, string joinMapKey,
EiscApiAdvanced bridge)
@@ -261,7 +262,8 @@ namespace PepperDash.Essentials.Core
abstract protected Func CurrentInputFeedbackFunc { get; }
- public BoolFeedback PowerIsOnFeedback { get; protected set; }
+ public override BoolFeedback PowerIsOnFeedback { get; protected set; }
+
abstract protected Func PowerIsOnFeedbackFunc { get; }
@@ -315,7 +317,5 @@ namespace PepperDash.Essentials.Core
var newEvent = NumericSwitchChange;
if (newEvent != null) newEvent(this, e);
}
-
-
}
}
\ No newline at end of file
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Display/MockDisplay.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Display/MockDisplay.cs
index dcdba6d8..eb529376 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Display/MockDisplay.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Display/MockDisplay.cs
@@ -59,6 +59,9 @@ namespace PepperDash.Essentials.Core
VolumeLevelFeedback = new IntFeedback(() => { return _FakeVolumeLevel; });
MuteFeedback = new BoolFeedback("MuteOn", () => _IsMuted);
+
+ WarmupTime = 10000;
+ CooldownTime = 5000;
}
public override void PowerOn()
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Extensions/JsonExtensions.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Extensions/JsonExtensions.cs
new file mode 100644
index 00000000..cdf723ea
--- /dev/null
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Extensions/JsonExtensions.cs
@@ -0,0 +1,42 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Crestron.SimplSharp;
+using Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
+
+namespace PepperDash.Essentials.Core
+{
+ public static class JsonExtensions
+ {
+ public static List FindTokens(this JToken containerToken, string name)
+ {
+ List matches = new List();
+ FindTokens(containerToken, name, matches);
+ return matches;
+ }
+
+ private static void FindTokens(JToken containerToken, string name, List matches)
+ {
+ if (containerToken.Type == JTokenType.Object)
+ {
+ foreach (JProperty child in containerToken.Children())
+ {
+ if (child.Name == name)
+ {
+ matches.Add(child.Value);
+ }
+ FindTokens(child.Value, name, matches);
+ }
+ }
+ else if (containerToken.Type == JTokenType.Array)
+ {
+ foreach (JToken child in containerToken.Children())
+ {
+ FindTokens(child, name, matches);
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Factory/DeviceFactory.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Factory/DeviceFactory.cs
index e337b7d4..ebdc87b1 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Factory/DeviceFactory.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Factory/DeviceFactory.cs
@@ -1,149 +1,208 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Crestron.SimplSharp;
-using Crestron.SimplSharpPro;
-using Crestron.SimplSharpPro.GeneralIO;
-using Crestron.SimplSharp.Reflection;
-using PepperDash.Core;
-using PepperDash.Essentials.Core;
-using PepperDash.Essentials.Core.Config;
-using PepperDash.Essentials.Core.CrestronIO;
-using PepperDash.Essentials.Core.Touchpanels;
-
-namespace PepperDash.Essentials.Core
-{
- public class DeviceFactoryWrapper
- {
- public CType CType { get; set; }
- public string Description { get; set; }
- public Func FactoryMethod { get; set; }
-
- public DeviceFactoryWrapper()
- {
- CType = null;
- Description = "Not Available";
- }
- }
-
- public class DeviceFactory
- {
- public DeviceFactory()
- {
- var assy = Assembly.GetExecutingAssembly();
- PluginLoader.SetEssentialsAssembly(assy.GetName().Name, assy);
-
- var types = assy.GetTypes().Where(ct => typeof(IDeviceFactory).IsAssignableFrom(ct) && !ct.IsInterface && !ct.IsAbstract);
-
- if (types != null)
- {
- foreach (var type in types)
- {
- try
- {
- var factory = (IDeviceFactory)Crestron.SimplSharp.Reflection.Activator.CreateInstance(type);
- factory.LoadTypeFactories();
- }
- catch (Exception e)
- {
- Debug.Console(0, Debug.ErrorLogLevel.Error, "Unable to load type: '{1}' DeviceFactory: {0}", e, type.Name);
- }
- }
- }
- }
-
- ///
- /// A dictionary of factory methods, keyed by config types, added by plugins.
- /// These methods are looked up and called by GetDevice in this class.
- ///
- static Dictionary FactoryMethods =
- new Dictionary(StringComparer.OrdinalIgnoreCase);
-
- ///
- /// Adds a plugin factory method
- ///
- ///
- ///
- public static void AddFactoryForType(string typeName, Func method)
- {
- Debug.Console(0, Debug.ErrorLogLevel.Notice, "Adding factory method for type '{0}'", typeName);
- DeviceFactory.FactoryMethods.Add(typeName, new DeviceFactoryWrapper() { FactoryMethod = method});
- }
-
- public static void AddFactoryForType(string typeName, string description, CType cType, Func method)
- {
- Debug.Console(0, Debug.ErrorLogLevel.Notice, "Adding factory method for type '{0}'", typeName);
-
- if(FactoryMethods.ContainsKey(typeName))
- {
- Debug.Console(0, Debug.ErrorLogLevel.Error, "Unable to add type: '{0}'. Already exists in DeviceFactory", typeName);
- return;
- }
-
- var wrapper = new DeviceFactoryWrapper() { CType = cType, Description = description, FactoryMethod = method };
- DeviceFactory.FactoryMethods.Add(typeName, wrapper);
- }
-
- ///
- /// The factory method for Core "things". Also iterates the Factory methods that have
- /// been loaded from plugins
- ///
- ///
- ///
- public static IKeyed GetDevice(DeviceConfig dc)
- {
- var key = dc.Key;
- var name = dc.Name;
- var type = dc.Type;
- var properties = dc.Properties;
-
- var typeName = dc.Type.ToLower();
-
- // Check for types that have been added by plugin dlls.
- if (FactoryMethods.ContainsKey(typeName))
- {
- Debug.Console(0, Debug.ErrorLogLevel.Notice, "Loading '{0}' from Essentials Core", dc.Type);
- return FactoryMethods[typeName].FactoryMethod(dc);
- }
-
- return null;
- }
-
- ///
- /// Prints the type names and associated metadata from the FactoryMethods collection.
- ///
- ///
- public static void GetDeviceFactoryTypes(string filter)
- {
- Dictionary types = new Dictionary();
-
- if (!string.IsNullOrEmpty(filter))
- {
- types = FactoryMethods.Where(k => k.Key.Contains(filter)).ToDictionary(k => k.Key, k => k.Value);
- }
- else
- {
- types = FactoryMethods;
- }
-
- Debug.Console(0, "Device Types:");
-
- foreach (var type in types.OrderBy(t => t.Key))
- {
- var description = type.Value.Description;
- var cType = "Not Specified by Plugin";
-
- if(type.Value.CType != null)
- {
- cType = type.Value.CType.FullName;
- }
-
- Debug.Console(0,
- @"Type: '{0}'
- CType: '{1}'
- Description: {2}", type.Key, cType, description);
- }
- }
- }
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Crestron.SimplSharp;
+using Crestron.SimplSharpPro;
+using Crestron.SimplSharpPro.GeneralIO;
+using Crestron.SimplSharp.Reflection;
+using PepperDash.Core;
+using Newtonsoft.Json.Linq;
+using Newtonsoft.Json;
+using PepperDash.Essentials.Core;
+using PepperDash.Essentials.Core.Config;
+using PepperDash.Essentials.Core.CrestronIO;
+using PepperDash.Essentials.Core.Touchpanels;
+
+namespace PepperDash.Essentials.Core
+{
+ public class DeviceFactoryWrapper
+ {
+ public CType CType { get; set; }
+ public string Description { get; set; }
+ public Func FactoryMethod { get; set; }
+
+ public DeviceFactoryWrapper()
+ {
+ CType = null;
+ Description = "Not Available";
+ }
+ }
+
+ public class DeviceFactory
+ {
+ public DeviceFactory()
+ {
+ var assy = Assembly.GetExecutingAssembly();
+ PluginLoader.SetEssentialsAssembly(assy.GetName().Name, assy);
+
+ var types = assy.GetTypes().Where(ct => typeof(IDeviceFactory).IsAssignableFrom(ct) && !ct.IsInterface && !ct.IsAbstract);
+
+ if (types != null)
+ {
+ foreach (var type in types)
+ {
+ try
+ {
+ var factory = (IDeviceFactory)Crestron.SimplSharp.Reflection.Activator.CreateInstance(type);
+ factory.LoadTypeFactories();
+ }
+ catch (Exception e)
+ {
+ Debug.Console(0, Debug.ErrorLogLevel.Error, "Unable to load type: '{1}' DeviceFactory: {0}", e, type.Name);
+ }
+ }
+ }
+ }
+
+ ///
+ /// A dictionary of factory methods, keyed by config types, added by plugins.
+ /// These methods are looked up and called by GetDevice in this class.
+ ///
+ static Dictionary FactoryMethods =
+ new Dictionary(StringComparer.OrdinalIgnoreCase);
+
+ ///
+ /// Adds a plugin factory method
+ ///
+ ///
+ ///
+ public static void AddFactoryForType(string typeName, Func method)
+ {
+ //Debug.Console(1, Debug.ErrorLogLevel.Notice, "Adding factory method for type '{0}'", typeName);
+ DeviceFactory.FactoryMethods.Add(typeName, new DeviceFactoryWrapper() { FactoryMethod = method});
+ }
+
+ public static void AddFactoryForType(string typeName, string description, CType cType, Func method)
+ {
+ //Debug.Console(1, Debug.ErrorLogLevel.Notice, "Adding factory method for type '{0}'", typeName);
+
+ if(FactoryMethods.ContainsKey(typeName))
+ {
+ Debug.Console(0, Debug.ErrorLogLevel.Error, "Unable to add type: '{0}'. Already exists in DeviceFactory", typeName);
+ return;
+ }
+
+ var wrapper = new DeviceFactoryWrapper() { CType = cType, Description = description, FactoryMethod = method };
+ DeviceFactory.FactoryMethods.Add(typeName, wrapper);
+ }
+
+ private static void CheckForSecrets(IEnumerable obj)
+ {
+ foreach (var prop in obj.Where(prop => prop.Value as JObject != null))
+ {
+ if (prop.Name.ToLower() == "secret")
+ {
+ var secret = GetSecret(prop.Children().First().ToObject());
+ //var secret = GetSecret(JsonConvert.DeserializeObject(prop.Children().First().ToString()));
+ prop.Parent.Replace(secret);
+ }
+ var recurseProp = prop.Value as JObject;
+ if (recurseProp == null) return;
+ CheckForSecrets(recurseProp.Properties());
+ }
+ }
+
+ private static string GetSecret(SecretsPropertiesConfig data)
+ {
+ var secretProvider = SecretsManager.GetSecretProviderByKey(data.Provider);
+ if (secretProvider == null) return null;
+ var secret = secretProvider.GetSecret(data.Key);
+ if (secret != null) return (string) secret.Value;
+ Debug.Console(1,
+ "Unable to retrieve secret {0}{1} - Make sure you've added it to the secrets provider",
+ data.Provider, data.Key);
+ return String.Empty;
+ }
+
+
+ ///
+ /// The factory method for Core "things". Also iterates the Factory methods that have
+ /// been loaded from plugins
+ ///
+ ///
+ ///
+ public static IKeyed GetDevice(DeviceConfig dc)
+ {
+ try
+ {
+ Debug.Console(0, Debug.ErrorLogLevel.Notice, "Loading '{0}' from Essentials Core", dc.Type);
+
+ var localDc = new DeviceConfig(dc);
+
+ var key = localDc.Key;
+ var name = localDc.Name;
+ var type = localDc.Type;
+ var properties = localDc.Properties;
+ //var propRecurse = properties;
+
+ var typeName = localDc.Type.ToLower();
+
+
+ var jObject = properties as JObject;
+ if (jObject != null)
+ {
+ var jProp = jObject.Properties();
+
+ CheckForSecrets(jProp);
+ }
+
+ Debug.Console(2, "typeName = {0}", typeName);
+ // Check for types that have been added by plugin dlls.
+ return !FactoryMethods.ContainsKey(typeName) ? null : FactoryMethods[typeName].FactoryMethod(localDc);
+ }
+ catch (Exception ex)
+ {
+ Debug.Console(0, Debug.ErrorLogLevel.Error, "Exception occurred while creating device {0}: {1}", dc.Key, ex.Message);
+
+ Debug.Console(2, "{0}", ex.StackTrace);
+
+ if (ex.InnerException == null)
+ {
+ return null;
+ }
+
+ Debug.Console(0, Debug.ErrorLogLevel.Error, "Inner exception while creating device {0}: {1}", dc.Key,
+ ex.InnerException.Message);
+ Debug.Console(2, "{0}", ex.InnerException.StackTrace);
+ return null;
+ }
+ }
+
+ ///
+ /// Prints the type names and associated metadata from the FactoryMethods collection.
+ ///
+ ///
+ public static void GetDeviceFactoryTypes(string filter)
+ {
+ Dictionary types = new Dictionary();
+
+ if (!string.IsNullOrEmpty(filter))
+ {
+ types = FactoryMethods.Where(k => k.Key.Contains(filter)).ToDictionary(k => k.Key, k => k.Value);
+ }
+ else
+ {
+ types = FactoryMethods;
+ }
+
+ Debug.Console(0, "Device Types:");
+
+ foreach (var type in types.OrderBy(t => t.Key))
+ {
+ var description = type.Value.Description;
+ var cType = "Not Specified by Plugin";
+
+ if(type.Value.CType != null)
+ {
+ cType = type.Value.CType.FullName;
+ }
+
+ Debug.Console(0,
+ @"Type: '{0}'
+ CType: '{1}'
+ Description: {2}", type.Key, cType, description);
+ }
+ }
+ }
}
\ No newline at end of file
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Factory/ReadyEventArgs.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Factory/ReadyEventArgs.cs
index 89c0b7b3..3c107f6e 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Factory/ReadyEventArgs.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Factory/ReadyEventArgs.cs
@@ -3,8 +3,9 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
+using PepperDash.Essentials.Core;
-namespace PepperDash_Essentials_Core
+namespace PepperDash.Essentials.Core
{
public class IsReadyEventArgs : EventArgs
{
@@ -16,6 +17,27 @@ namespace PepperDash_Essentials_Core
}
}
+ public interface IHasReady
+ {
+ event EventHandler IsReadyEvent;
+ bool IsReady { get; }
+ }
+}
+
+namespace PepperDash_Essentials_Core
+{
+ [Obsolete("Use PepperDash.Essentials.Core")]
+ public class IsReadyEventArgs : EventArgs
+ {
+ public bool IsReady { get; set; }
+
+ public IsReadyEventArgs(bool data)
+ {
+ IsReady = data;
+ }
+ }
+
+ [Obsolete("Use PepperDash.Essentials.Core")]
public interface IHasReady
{
event EventHandler IsReadyEvent;
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Feedbacks/BoolFeedback.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Feedbacks/BoolFeedback.cs
index f46b4767..055ed5b6 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Feedbacks/BoolFeedback.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Feedbacks/BoolFeedback.cs
@@ -62,6 +62,11 @@ namespace PepperDash.Essentials.Core
ValueFunc = valueFunc;
}
+ public void SetValueFunc(Func newFunc)
+ {
+ ValueFunc = newFunc;
+ }
+
public override void FireUpdate()
{
bool newValue = InTestMode ? TestValue : ValueFunc.Invoke();
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Feedbacks/BoolOutputLogicals.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Feedbacks/BoolOutputLogicals.cs
index 3074254e..a8dae7b8 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Feedbacks/BoolOutputLogicals.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Feedbacks/BoolOutputLogicals.cs
@@ -23,7 +23,7 @@ namespace PepperDash.Essentials.Core
protected bool ComputedValue;
- public BoolFeedbackLogic()
+ protected BoolFeedbackLogic()
{
Output = new BoolFeedback(() => ComputedValue);
}
@@ -40,21 +40,18 @@ namespace PepperDash.Essentials.Core
public void AddOutputsIn(List outputs)
{
- foreach (var o in outputs)
- {
- // skip existing
- if (OutputsIn.Contains(o)) continue;
-
- OutputsIn.Add(o);
- o.OutputChange += AnyInput_OutputChange;
- }
- Evaluate();
+ foreach (var o in outputs.Where(o => !OutputsIn.Contains(o)))
+ {
+ OutputsIn.Add(o);
+ o.OutputChange += AnyInput_OutputChange;
+ }
+ Evaluate();
}
- public void RemoveOutputIn(BoolFeedback output)
+ public void RemoveOutputIn(BoolFeedback output)
{
// Don't double up outputs
- if (OutputsIn.Contains(output)) return;
+ if (!OutputsIn.Contains(output)) return;
OutputsIn.Remove(output);
output.OutputChange -= AnyInput_OutputChange;
@@ -71,6 +68,12 @@ namespace PepperDash.Essentials.Core
Evaluate();
}
+ public void ClearOutputs()
+ {
+ OutputsIn.Clear();
+ Evaluate();
+ }
+
void AnyInput_OutputChange(object sender, EventArgs e)
{
Evaluate();
@@ -85,11 +88,12 @@ namespace PepperDash.Essentials.Core
{
var prevValue = ComputedValue;
var newValue = OutputsIn.All(o => o.BoolValue);
- if (newValue != prevValue)
- {
- ComputedValue = newValue;
- Output.FireUpdate();
- }
+ if (newValue == prevValue)
+ {
+ return;
+ }
+ ComputedValue = newValue;
+ Output.FireUpdate();
}
}
@@ -99,33 +103,35 @@ namespace PepperDash.Essentials.Core
{
var prevValue = ComputedValue;
var newValue = OutputsIn.Any(o => o.BoolValue);
- if (newValue != prevValue)
- {
- ComputedValue = newValue;
- Output.FireUpdate();
- }
+ if (newValue == prevValue)
+ {
+ return;
+ }
+ ComputedValue = newValue;
+ Output.FireUpdate();
}
}
public class BoolFeedbackLinq : BoolFeedbackLogic
{
- Func, bool> Predicate;
+ readonly Func, bool> _predicate;
public BoolFeedbackLinq(Func, bool> predicate)
: base()
{
- Predicate = predicate;
+ _predicate = predicate;
}
protected override void Evaluate()
{
var prevValue = ComputedValue;
- var newValue = Predicate(OutputsIn);
- if (newValue != prevValue)
- {
- ComputedValue = newValue;
- Output.FireUpdate();
- }
+ var newValue = _predicate(OutputsIn);
+ if (newValue == prevValue)
+ {
+ return;
+ }
+ ComputedValue = newValue;
+ Output.FireUpdate();
}
}
}
\ No newline at end of file
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Feedbacks/IntFeedback.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Feedbacks/IntFeedback.cs
index 25390c2c..53bae09a 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Feedbacks/IntFeedback.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Feedbacks/IntFeedback.cs
@@ -51,6 +51,12 @@ namespace PepperDash.Essentials.Core
ValueFunc = valueFunc;
}
+ public void SetValueFunc(Func newFunc)
+ {
+ ValueFunc = newFunc;
+ }
+
+
public override void FireUpdate()
{
var newValue = InTestMode ? TestValue : ValueFunc.Invoke();
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Feedbacks/StringFeedback.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Feedbacks/StringFeedback.cs
index 56251a2e..fb5cccb5 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Feedbacks/StringFeedback.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Feedbacks/StringFeedback.cs
@@ -52,7 +52,10 @@ namespace PepperDash.Essentials.Core
ValueFunc = valueFunc;
}
-
+ public void SetValueFunc(Func newFunc)
+ {
+ ValueFunc = newFunc;
+ }
public override void FireUpdate()
{
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Fusion/EssentialsHuddleSpaceFusionSystemControllerBase.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Fusion/EssentialsHuddleSpaceFusionSystemControllerBase.cs
index 39cd7d78..1bf925d6 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Fusion/EssentialsHuddleSpaceFusionSystemControllerBase.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Fusion/EssentialsHuddleSpaceFusionSystemControllerBase.cs
@@ -2,164 +2,145 @@
using System.Collections.Generic;
using System.Linq;
using System.Text;
-
using Crestron.SimplSharp;
using Crestron.SimplSharp.CrestronIO;
using Crestron.SimplSharp.CrestronXml;
using Crestron.SimplSharp.CrestronXml.Serialization;
-using Crestron.SimplSharp.CrestronXmlLinq;
using Crestron.SimplSharpPro;
-using Crestron.SimplSharpPro.DeviceSupport;
using Crestron.SimplSharpPro.Fusion;
using Newtonsoft.Json;
-using Newtonsoft.Json.Linq;
-
using PepperDash.Core;
-using PepperDash.Essentials;
-using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Config;
-
-
namespace PepperDash.Essentials.Core.Fusion
{
- public class EssentialsHuddleSpaceFusionSystemControllerBase : Device, IOccupancyStatusProvider
- {
- public event EventHandler ScheduleChange;
- //public event EventHandler MeetingEndWarning;
- //public event EventHandler NextMeetingBeginWarning;
+ public class EssentialsHuddleSpaceFusionSystemControllerBase : Device, IOccupancyStatusProvider
+ {
+ protected EssentialsHuddleSpaceRoomFusionRoomJoinMap JoinMap;
- public event EventHandler RoomInfoChange;
+ private const string RemoteOccupancyXml = "Local{0}";
+ private readonly bool _guidFileExists;
+
+ private readonly Dictionary _sourceToFeedbackSigs =
+ new Dictionary();
+
+ protected StringSigData CurrentRoomSourceNameSig;
public FusionCustomPropertiesBridge CustomPropertiesBridge = new FusionCustomPropertiesBridge();
+ protected FusionOccupancySensorAsset FusionOccSensor;
+ protected FusionRemoteOccupancySensor FusionRemoteOccSensor;
- protected FusionRoom FusionRoom;
- protected EssentialsRoomBase Room;
- Dictionary SourceToFeedbackSigs =
- new Dictionary();
+ protected FusionRoom FusionRoom;
+ protected Dictionary FusionStaticAssets;
+ public long PushNotificationTimeout = 5000;
+ protected IEssentialsRoom Room;
+ public long SchedulePollInterval = 300000;
- StatusMonitorCollection ErrorMessageRollUp;
+ private Event _currentMeeting;
+ private RoomSchedule _currentSchedule;
+ private CTimer _dailyTimeRequestTimer;
+ private StatusMonitorCollection _errorMessageRollUp;
- protected StringSigData CurrentRoomSourceNameSig;
+ private FusionRoomGuids _guiDs;
+ private uint _ipId;
+
+ private bool _isRegisteredForSchedulePushNotifications;
+ private Event _nextMeeting;
+
+ private CTimer _pollTimer;
+
+ private CTimer _pushNotificationTimer;
+
+ private string _roomOccupancyRemoteString;
#region System Info Sigs
+
//StringSigData SystemName;
//StringSigData Model;
//StringSigData SerialNumber;
//StringSigData Uptime;
+
#endregion
-
#region Processor Info Sigs
- StringSigData Ip1;
- StringSigData Ip2;
- StringSigData Gateway;
- StringSigData Hostname;
- StringSigData Domain;
- StringSigData Dns1;
- StringSigData Dns2;
- StringSigData Mac1;
- StringSigData Mac2;
- StringSigData NetMask1;
- StringSigData NetMask2;
- StringSigData Firmware;
- StringSigData[] Program = new StringSigData[10];
+ private readonly StringSigData[] _program = new StringSigData[10];
+ private StringSigData _dns1;
+ private StringSigData _dns2;
+ private StringSigData _domain;
+ private StringSigData _firmware;
+ private StringSigData _gateway;
+ private StringSigData _hostname;
+ private StringSigData _ip1;
+ private StringSigData _ip2;
+ private StringSigData _mac1;
+ private StringSigData _mac2;
+ private StringSigData _netMask1;
+ private StringSigData _netMask2;
+
#endregion
#region Default Display Source Sigs
- BooleanSigData[] Source = new BooleanSigData[10];
+ private BooleanSigData[] _source = new BooleanSigData[10];
#endregion
- RoomSchedule CurrentSchedule;
-
- Event NextMeeting;
-
- Event CurrentMeeting;
-
- protected string RoomGuid
+ public EssentialsHuddleSpaceFusionSystemControllerBase(IEssentialsRoom room, uint ipId, string joinMapKey)
+ : base(room.Key + "-fusion")
{
- get
- {
- return GUIDs.RoomGuid;
- }
-
- }
-
- uint IpId;
-
- FusionRoomGuids GUIDs;
-
- bool GuidFileExists;
-
- bool IsRegisteredForSchedulePushNotifications = false;
-
- CTimer PollTimer = null;
-
- CTimer PushNotificationTimer = null;
-
- CTimer DailyTimeRequestTimer = null;
-
- // Default poll time is 5 min unless overridden by config value
- public long SchedulePollInterval = 300000;
-
- public long PushNotificationTimeout = 5000;
-
- private const string RemoteOccupancyXml = "Local{0}";
-
- protected Dictionary FusionStaticAssets;
-
- // For use with local occ sensor devices which will relay to Fusion the current occupancy status
- protected FusionRemoteOccupancySensor FusionRemoteOccSensor;
-
- // For use with occ sensor attached to a scheduling panel in Fusion
- protected FusionOccupancySensorAsset FusionOccSensor;
-
- public BoolFeedback RoomIsOccupiedFeedback { get; private set; }
-
- private string _roomOccupancyRemoteString;
- public StringFeedback RoomOccupancyRemoteStringFeedback { get; private set; }
-
- protected Func RoomIsOccupiedFeedbackFunc
- {
- get
- {
- return () => FusionRemoteOccSensor.RoomOccupied.OutputSig.BoolValue;
- }
- }
-
- //ScheduleResponseEvent NextMeeting;
-
- public EssentialsHuddleSpaceFusionSystemControllerBase(EssentialsRoomBase room, uint ipId)
- : base(room.Key + "-fusion")
- {
-
try
{
+ JoinMap = new EssentialsHuddleSpaceRoomFusionRoomJoinMap(1);
+ CrestronConsole.AddNewConsoleCommand((o) => JoinMap.PrintJoinMapInfo(), string.Format("ptjnmp-{0}", Key), "Prints Attribute Join Map", ConsoleAccessLevelEnum.AccessOperator);
+
+ if (!string.IsNullOrEmpty(joinMapKey))
+ {
+ var customJoins = JoinMapHelper.TryGetJoinMapAdvancedForDevice(joinMapKey);
+ if (customJoins != null)
+ {
+ JoinMap.SetCustomJoinData(customJoins);
+ }
+ }
+
Room = room;
- IpId = ipId;
+ _ipId = ipId;
FusionStaticAssets = new Dictionary();
- GUIDs = new FusionRoomGuids();
+ _guiDs = new FusionRoomGuids();
- var mac = CrestronEthernetHelper.GetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_MAC_ADDRESS, 0);
+ var mac =
+ CrestronEthernetHelper.GetEthernetParameter(
+ CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_MAC_ADDRESS, 0);
var slot = Global.ControlSystem.ProgramNumber;
- string guidFilePath = Global.FilePathPrefix + string.Format(@"{0}-FusionGuids.json", InitialParametersClass.ProgramIDTag);
+ var guidFilePath = Global.FilePathPrefix +
+ string.Format(@"{0}-FusionGuids-{1:X2}.json", InitialParametersClass.ProgramIDTag, _ipId);
- GuidFileExists = File.Exists(guidFilePath);
+ var oldGuidFilePath = Global.FilePathPrefix +
+ string.Format(@"{0}-FusionGuids.json", InitialParametersClass.ProgramIDTag);
+
+ if (File.Exists(oldGuidFilePath))
+ {
+ Debug.Console(0, this, "Migrating from old Fusion GUID file to new Fusion GUID File");
+
+ File.Copy(oldGuidFilePath, guidFilePath);
+
+ File.Delete(oldGuidFilePath);
+ }
+
+ _guidFileExists = File.Exists(guidFilePath);
// Check if file exists
- if (!GuidFileExists)
+ if (!_guidFileExists)
{
// Does not exist. Create GUIDs
- GUIDs = new FusionRoomGuids(Room.Name, ipId, GUIDs.GenerateNewRoomGuid(slot, mac), FusionStaticAssets);
+ _guiDs = new FusionRoomGuids(Room.Name, ipId, _guiDs.GenerateNewRoomGuid(slot, mac),
+ FusionStaticAssets);
}
else
{
@@ -170,49 +151,76 @@ namespace PepperDash.Essentials.Core.Fusion
if (Room.RoomOccupancy != null)
{
if (Room.OccupancyStatusProviderIsRemote)
+ {
SetUpRemoteOccupancy();
+ }
else
{
SetUpLocalOccupancy();
}
}
-
-
- AddPostActivationAction(() =>
- {
- CreateSymbolAndBasicSigs(IpId);
- SetUpSources();
- SetUpCommunitcationMonitors();
- SetUpDisplay();
- SetUpError();
- ExecuteCustomSteps();
-
- FusionRVI.GenerateFileForAllFusionDevices();
-
- GenerateGuidFile(guidFilePath);
- });
+ AddPostActivationAction(() => PostActivate(guidFilePath));
}
catch (Exception e)
{
Debug.Console(0, this, Debug.ErrorLogLevel.Error, "Error Building Fusion System Controller: {0}", e);
}
- }
+ }
+
+ private void PostActivate(string guidFilePath)
+ {
+ CreateSymbolAndBasicSigs(_ipId);
+ SetUpSources();
+ SetUpCommunitcationMonitors();
+ SetUpDisplay();
+ SetUpError();
+ ExecuteCustomSteps();
+
+ FusionRVI.GenerateFileForAllFusionDevices();
+
+ GenerateGuidFile(guidFilePath);
+ }
+
+ protected string RoomGuid
+ {
+ get { return _guiDs.RoomGuid; }
+ }
+
+ public StringFeedback RoomOccupancyRemoteStringFeedback { get; private set; }
+
+ protected Func RoomIsOccupiedFeedbackFunc
+ {
+ get { return () => FusionRemoteOccSensor.RoomOccupied.OutputSig.BoolValue; }
+ }
+
+ #region IOccupancyStatusProvider Members
+
+ public BoolFeedback RoomIsOccupiedFeedback { get; private set; }
+
+ #endregion
+
+ public event EventHandler ScheduleChange;
+ //public event EventHandler MeetingEndWarning;
+ //public event EventHandler NextMeetingBeginWarning;
+
+ public event EventHandler RoomInfoChange;
+
+ //ScheduleResponseEvent NextMeeting;
///
/// Used for extension classes to execute whatever steps are necessary before generating the RVI and GUID files
///
protected virtual void ExecuteCustomSteps()
{
-
}
///
/// Generates the guid file in NVRAM. If the file already exists it will be overwritten.
///
/// path for the file
- void GenerateGuidFile(string filePath)
+ private void GenerateGuidFile(string filePath)
{
if (string.IsNullOrEmpty(filePath))
{
@@ -220,32 +228,32 @@ namespace PepperDash.Essentials.Core.Fusion
return;
}
- CCriticalSection _fileLock = new CCriticalSection();
+ var fileLock = new CCriticalSection();
try
{
- if (_fileLock == null || _fileLock.Disposed)
+ if (fileLock.Disposed)
+ {
return;
+ }
- _fileLock.Enter();
+ fileLock.Enter();
Debug.Console(1, this, "Writing GUIDs to file");
- if (FusionOccSensor == null)
- GUIDs = new FusionRoomGuids(Room.Name, IpId, RoomGuid, FusionStaticAssets);
- else
- GUIDs = new FusionRoomGuids(Room.Name, IpId, RoomGuid, FusionStaticAssets, FusionOccSensor);
+ _guiDs = FusionOccSensor == null
+ ? new FusionRoomGuids(Room.Name, _ipId, RoomGuid, FusionStaticAssets)
+ : new FusionRoomGuids(Room.Name, _ipId, RoomGuid, FusionStaticAssets, FusionOccSensor);
- var JSON = JsonConvert.SerializeObject(GUIDs, Newtonsoft.Json.Formatting.Indented);
+ var json = JsonConvert.SerializeObject(_guiDs, Newtonsoft.Json.Formatting.Indented);
- using (StreamWriter sw = new StreamWriter(filePath))
+ using (var sw = new StreamWriter(filePath))
{
- sw.Write(JSON);
+ sw.Write(json);
sw.Flush();
}
Debug.Console(1, this, "Guids successfully written to file '{0}'", filePath);
-
}
catch (Exception e)
{
@@ -253,8 +261,10 @@ namespace PepperDash.Essentials.Core.Fusion
}
finally
{
- if (_fileLock != null && !_fileLock.Disposed)
- _fileLock.Leave();
+ if (!fileLock.Disposed)
+ {
+ fileLock.Leave();
+ }
}
}
@@ -262,42 +272,45 @@ namespace PepperDash.Essentials.Core.Fusion
/// Reads the guid file from NVRAM
///
/// path for te file
- void ReadGuidFile(string filePath)
+ private void ReadGuidFile(string filePath)
{
- if(string.IsNullOrEmpty(filePath))
+ if (string.IsNullOrEmpty(filePath))
{
Debug.Console(0, this, Debug.ErrorLogLevel.Notice, "Error reading guid file. No path specified.");
return;
}
- CCriticalSection _fileLock = new CCriticalSection();
+ var fileLock = new CCriticalSection();
try
{
- if(_fileLock == null || _fileLock.Disposed)
- return;
-
- _fileLock.Enter();
-
- if(File.Exists(filePath))
+ if (fileLock.Disposed)
{
- var JSON = File.ReadToEnd(filePath, Encoding.ASCII);
-
- GUIDs = JsonConvert.DeserializeObject(JSON);
-
- IpId = GUIDs.IpId;
-
- FusionStaticAssets = GUIDs.StaticAssets;
-
+ return;
}
- Debug.Console(0, this, Debug.ErrorLogLevel.Notice, "Fusion Guids successfully read from file: {0}", filePath);
+ fileLock.Enter();
- Debug.Console(1, this, "\nRoom Name: {0}\nIPID: {1:x}\n RoomGuid: {2}", Room.Name, IpId, RoomGuid);
+ if (File.Exists(filePath))
+ {
+ var json = File.ReadToEnd(filePath, Encoding.ASCII);
+
+ _guiDs = JsonConvert.DeserializeObject(json);
+
+ _ipId = _guiDs.IpId;
+
+ FusionStaticAssets = _guiDs.StaticAssets;
+ }
+
+ Debug.Console(0, this, Debug.ErrorLogLevel.Notice, "Fusion Guids successfully read from file: {0}",
+ filePath);
+
+ Debug.Console(1, this, "\r\n********************\r\n\tRoom Name: {0}\r\n\tIPID: {1:X}\r\n\tRoomGuid: {2}\r\n*******************", Room.Name, _ipId, RoomGuid);
foreach (var item in FusionStaticAssets)
{
- Debug.Console(1, this, "\nAsset Name: {0}\nAsset No: {1}\n Guid: {2}", item.Value.Name, item.Value.SlotNumber, item.Value.InstanceId);
+ Debug.Console(1, this, "\nAsset Name: {0}\nAsset No: {1}\n Guid: {2}", item.Value.Name,
+ item.Value.SlotNumber, item.Value.InstanceId);
}
}
catch (Exception e)
@@ -306,46 +319,65 @@ namespace PepperDash.Essentials.Core.Fusion
}
finally
{
- if(_fileLock != null && !_fileLock.Disposed)
- _fileLock.Leave();
+ if (!fileLock.Disposed)
+ {
+ fileLock.Leave();
+ }
}
-
}
- protected virtual void CreateSymbolAndBasicSigs(uint ipId)
- {
- Debug.Console(0, this, Debug.ErrorLogLevel.Notice, "Creating Fusion Room symbol with GUID: {0}", RoomGuid);
+ protected virtual void CreateSymbolAndBasicSigs(uint ipId)
+ {
+ Debug.Console(0, this, Debug.ErrorLogLevel.Notice, "Creating Fusion Room symbol with GUID: {0} and IP-ID {1:X2}", RoomGuid, ipId);
FusionRoom = new FusionRoom(ipId, Global.ControlSystem, Room.Name, RoomGuid);
FusionRoom.ExtenderRoomViewSchedulingDataReservedSigs.Use();
FusionRoom.ExtenderFusionRoomDataReservedSigs.Use();
- FusionRoom.Register();
+ FusionRoom.Register();
- FusionRoom.FusionStateChange += new FusionStateEventHandler(FusionRoom_FusionStateChange);
+ FusionRoom.FusionStateChange += FusionRoom_FusionStateChange;
- FusionRoom.ExtenderRoomViewSchedulingDataReservedSigs.DeviceExtenderSigChange += new DeviceExtenderJoinChangeEventHandler(FusionRoomSchedule_DeviceExtenderSigChange);
- FusionRoom.ExtenderFusionRoomDataReservedSigs.DeviceExtenderSigChange += new DeviceExtenderJoinChangeEventHandler(ExtenderFusionRoomDataReservedSigs_DeviceExtenderSigChange);
- FusionRoom.OnlineStatusChange += new OnlineStatusChangeEventHandler(FusionRoom_OnlineStatusChange);
+ FusionRoom.ExtenderRoomViewSchedulingDataReservedSigs.DeviceExtenderSigChange +=
+ FusionRoomSchedule_DeviceExtenderSigChange;
+ FusionRoom.ExtenderFusionRoomDataReservedSigs.DeviceExtenderSigChange +=
+ ExtenderFusionRoomDataReservedSigs_DeviceExtenderSigChange;
+ FusionRoom.OnlineStatusChange += FusionRoom_OnlineStatusChange;
- 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(CreateAsHocMeeting, "FusCreateMeeting", "Creates and Ad Hoc meeting for on hour or until the next meeting", 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(CreateAdHocMeeting, "FusCreateMeeting",
+ "Creates and Ad Hoc meeting for on hour or until the next meeting",
+ ConsoleAccessLevelEnum.AccessOperator);
- // Room to fusion room
- Room.OnFeedback.LinkInputSig(FusionRoom.SystemPowerOn.InputSig);
+ // Room to fusion room
+ Room.OnFeedback.LinkInputSig(FusionRoom.SystemPowerOn.InputSig);
// Moved to
- CurrentRoomSourceNameSig = FusionRoom.CreateOffsetStringSig(84, "Display 1 - Current Source", eSigIoMask.InputSigOnly);
- // Don't think we need to get current status of this as nothing should be alive yet.
- (Room as IHasCurrentSourceInfoChange).CurrentSourceChange += new SourceInfoChangeHandler(Room_CurrentSourceInfoChange);
+ 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.
+ var hasCurrentSourceInfoChange = Room as IHasCurrentSourceInfoChange;
+ if (hasCurrentSourceInfoChange != null)
+ {
+ hasCurrentSourceInfoChange.CurrentSourceChange += Room_CurrentSourceInfoChange;
+ }
- FusionRoom.SystemPowerOn.OutputSig.SetSigFalseAction((Room as EssentialsRoomBase).PowerOnToDefaultOrLastSource);
- FusionRoom.SystemPowerOff.OutputSig.SetSigFalseAction(() => (Room as IRunRouteAction).RunRouteAction("roomOff", Room.SourceListKey));
- // NO!! room.RoomIsOn.LinkComplementInputSig(FusionRoom.SystemPowerOff.InputSig);
- FusionRoom.ErrorMessage.InputSig.StringValue =
- "3: 7 Errors: This is a really long error message;This is a really long error message;This is a really long error message;This is a really long error message;This is a really long error message;This is a really long error message;This is a really long error message;";
+ FusionRoom.SystemPowerOn.OutputSig.SetSigFalseAction(Room.PowerOnToDefaultOrLastSource);
+ FusionRoom.SystemPowerOff.OutputSig.SetSigFalseAction(() =>
+ {
+ var runRouteAction = Room as IRunRouteAction;
+ if (runRouteAction != null)
+ {
+ runRouteAction.RunRouteAction("roomOff", Room.SourceListKey);
+ }
+ });
+ // NO!! room.RoomIsOn.LinkComplementInputSig(FusionRoom.SystemPowerOff.InputSig);
+ FusionRoom.ErrorMessage.InputSig.StringValue =
+ "3: 7 Errors: This is a really long error message;This is a really long error message;This is a really long error message;This is a really long error message;This is a really long error message;This is a really long error message;This is a really long error message;";
SetUpEthernetValues();
@@ -355,7 +387,7 @@ namespace PepperDash.Essentials.Core.Fusion
GetProcessorInfo();
- CrestronEnvironment.EthernetEventHandler += new EthernetEventHandler(CrestronEnvironment_EthernetEventHandler);
+ CrestronEnvironment.EthernetEventHandler += CrestronEnvironment_EthernetEventHandler;
}
protected void CrestronEnvironment_EthernetEventHandler(EthernetEventArgs ethernetEventArgs)
@@ -372,82 +404,107 @@ namespace PepperDash.Essentials.Core.Fusion
//Model.InputSig.StringValue = InitialParametersClass.ControllerPromptName;
//SerialNumber.InputSig.StringValue = InitialParametersClass.
- string response = string.Empty;
+ var response = string.Empty;
- var systemReboot = FusionRoom.CreateOffsetBoolSig(74, "Processor - Reboot", eSigIoMask.OutputSigOnly);
- systemReboot.OutputSig.SetSigFalseAction(() => CrestronConsole.SendControlSystemCommand("reboot", ref response));
+ var systemReboot = FusionRoom.CreateOffsetBoolSig(JoinMap.ProcessorReboot.JoinNumber, JoinMap.ProcessorReboot.AttributeName, eSigIoMask.OutputSigOnly);
+ systemReboot.OutputSig.SetSigFalseAction(
+ () => CrestronConsole.SendControlSystemCommand("reboot", ref response));
}
protected void SetUpEthernetValues()
{
- Ip1 = FusionRoom.CreateOffsetStringSig(50, "Info - Processor - IP 1", eSigIoMask.InputSigOnly);
- Ip2 = FusionRoom.CreateOffsetStringSig(51, "Info - Processor - IP 2", eSigIoMask.InputSigOnly);
- Gateway = FusionRoom.CreateOffsetStringSig(52, "Info - Processor - Gateway", eSigIoMask.InputSigOnly);
- Hostname = FusionRoom.CreateOffsetStringSig(53, "Info - Processor - Hostname", eSigIoMask.InputSigOnly);
- Domain = FusionRoom.CreateOffsetStringSig(54, "Info - Processor - Domain", eSigIoMask.InputSigOnly);
- Dns1 = FusionRoom.CreateOffsetStringSig(55, "Info - Processor - DNS 1", eSigIoMask.InputSigOnly);
- Dns2 = FusionRoom.CreateOffsetStringSig(56, "Info - Processor - DNS 2", eSigIoMask.InputSigOnly);
- Mac1 = FusionRoom.CreateOffsetStringSig(57, "Info - Processor - MAC 1", eSigIoMask.InputSigOnly);
- Mac2 = FusionRoom.CreateOffsetStringSig(58, "Info - Processor - MAC 2", eSigIoMask.InputSigOnly);
- NetMask1 = FusionRoom.CreateOffsetStringSig(59, "Info - Processor - Net Mask 1", eSigIoMask.InputSigOnly);
- NetMask2 = FusionRoom.CreateOffsetStringSig(60, "Info - Processor - Net Mask 2", eSigIoMask.InputSigOnly);
+ _ip1 = FusionRoom.CreateOffsetStringSig(JoinMap.ProcessorIp1.JoinNumber, JoinMap.ProcessorIp1.AttributeName, eSigIoMask.InputSigOnly);
+ _ip2 = FusionRoom.CreateOffsetStringSig(JoinMap.ProcessorIp2.JoinNumber, JoinMap.ProcessorIp2.AttributeName, eSigIoMask.InputSigOnly);
+ _gateway = FusionRoom.CreateOffsetStringSig(JoinMap.ProcessorGateway.JoinNumber, JoinMap.ProcessorGateway.AttributeName, eSigIoMask.InputSigOnly);
+ _hostname = FusionRoom.CreateOffsetStringSig(JoinMap.ProcessorHostname.JoinNumber, JoinMap.ProcessorHostname.AttributeName, eSigIoMask.InputSigOnly);
+ _domain = FusionRoom.CreateOffsetStringSig(JoinMap.ProcessorDomain.JoinNumber, JoinMap.ProcessorDomain.AttributeName, eSigIoMask.InputSigOnly);
+ _dns1 = FusionRoom.CreateOffsetStringSig(JoinMap.ProcessorDns1.JoinNumber, JoinMap.ProcessorDns1.AttributeName, eSigIoMask.InputSigOnly);
+ _dns2 = FusionRoom.CreateOffsetStringSig(JoinMap.ProcessorDns2.JoinNumber, JoinMap.ProcessorDns2.AttributeName, eSigIoMask.InputSigOnly);
+ _mac1 = FusionRoom.CreateOffsetStringSig(JoinMap.ProcessorMac1.JoinNumber, JoinMap.ProcessorMac1.AttributeName, eSigIoMask.InputSigOnly);
+ _mac2 = FusionRoom.CreateOffsetStringSig(JoinMap.ProcessorMac2.JoinNumber, JoinMap.ProcessorMac2.AttributeName, eSigIoMask.InputSigOnly);
+ _netMask1 = FusionRoom.CreateOffsetStringSig(JoinMap.ProcessorNetMask1.JoinNumber, JoinMap.ProcessorNetMask1.AttributeName, eSigIoMask.InputSigOnly);
+ _netMask2 = FusionRoom.CreateOffsetStringSig(JoinMap.ProcessorNetMask2.JoinNumber, JoinMap.ProcessorNetMask2.AttributeName, eSigIoMask.InputSigOnly);
}
protected void GetProcessorEthernetValues()
{
- Ip1.InputSig.StringValue = CrestronEthernetHelper.GetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_CURRENT_IP_ADDRESS, 0);
- Gateway.InputSig.StringValue = CrestronEthernetHelper.GetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_CURRENT_ROUTER, 0);
- Hostname.InputSig.StringValue = CrestronEthernetHelper.GetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_HOSTNAME, 0);
- Domain.InputSig.StringValue = CrestronEthernetHelper.GetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_DOMAIN_NAME, 0);
+ _ip1.InputSig.StringValue =
+ CrestronEthernetHelper.GetEthernetParameter(
+ CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_CURRENT_IP_ADDRESS, 0);
+ _gateway.InputSig.StringValue =
+ CrestronEthernetHelper.GetEthernetParameter(
+ CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_CURRENT_ROUTER, 0);
+ _hostname.InputSig.StringValue =
+ CrestronEthernetHelper.GetEthernetParameter(
+ CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_HOSTNAME, 0);
+ _domain.InputSig.StringValue =
+ CrestronEthernetHelper.GetEthernetParameter(
+ CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_DOMAIN_NAME, 0);
- var dnsServers = CrestronEthernetHelper.GetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_DNS_SERVER, 0).Split(',');
- Dns1.InputSig.StringValue = dnsServers[0];
+ var dnsServers =
+ CrestronEthernetHelper.GetEthernetParameter(
+ CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_DNS_SERVER, 0).Split(',');
+ _dns1.InputSig.StringValue = dnsServers[0];
if (dnsServers.Length > 1)
- Dns2.InputSig.StringValue = dnsServers[1];
+ {
+ _dns2.InputSig.StringValue = dnsServers[1];
+ }
- Mac1.InputSig.StringValue = CrestronEthernetHelper.GetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_MAC_ADDRESS, 0);
- NetMask1.InputSig.StringValue = CrestronEthernetHelper.GetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_CURRENT_IP_MASK, 0);
+ _mac1.InputSig.StringValue =
+ CrestronEthernetHelper.GetEthernetParameter(
+ CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_MAC_ADDRESS, 0);
+ _netMask1.InputSig.StringValue =
+ CrestronEthernetHelper.GetEthernetParameter(
+ CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_CURRENT_IP_MASK, 0);
// Interface 1
- if (InitialParametersClass.NumberOfEthernetInterfaces > 1) // Only get these values if the processor has more than 1 NIC
+ if (InitialParametersClass.NumberOfEthernetInterfaces > 1)
+ // Only get these values if the processor has more than 1 NIC
{
- Ip2.InputSig.StringValue = CrestronEthernetHelper.GetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_CURRENT_IP_ADDRESS, 1);
- Mac2.InputSig.StringValue = CrestronEthernetHelper.GetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_MAC_ADDRESS, 1);
- NetMask2.InputSig.StringValue = CrestronEthernetHelper.GetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_CURRENT_IP_MASK, 1);
+ _ip2.InputSig.StringValue =
+ CrestronEthernetHelper.GetEthernetParameter(
+ CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_CURRENT_IP_ADDRESS, 1);
+ _mac2.InputSig.StringValue =
+ CrestronEthernetHelper.GetEthernetParameter(
+ CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_MAC_ADDRESS, 1);
+ _netMask2.InputSig.StringValue =
+ CrestronEthernetHelper.GetEthernetParameter(
+ CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_CURRENT_IP_MASK, 1);
}
}
protected void GetProcessorInfo()
{
-
- Firmware = FusionRoom.CreateOffsetStringSig(61, "Info - Processor - Firmware", eSigIoMask.InputSigOnly);
+ _firmware = FusionRoom.CreateOffsetStringSig(JoinMap.ProcessorFirmware.JoinNumber, JoinMap.ProcessorFirmware.AttributeName, eSigIoMask.InputSigOnly);
if (CrestronEnvironment.DevicePlatform != eDevicePlatform.Server)
{
- for (int i = 0; i < Global.ControlSystem.NumProgramsSupported; i++)
+ for (var i = 0; i < Global.ControlSystem.NumProgramsSupported; i++)
{
- var join = 62 + i;
+ var join = JoinMap.ProgramNameStart.JoinNumber + i;
var progNum = i + 1;
- Program[i] = FusionRoom.CreateOffsetStringSig((uint)join, string.Format("Info - Processor - Program {0}", progNum), eSigIoMask.InputSigOnly);
+ _program[i] = FusionRoom.CreateOffsetStringSig((uint) join,
+ string.Format("{0} {1}", JoinMap.ProgramNameStart.AttributeName, progNum), eSigIoMask.InputSigOnly);
}
}
- Firmware.InputSig.StringValue = InitialParametersClass.FirmwareVersion;
-
+ _firmware.InputSig.StringValue = InitialParametersClass.FirmwareVersion;
}
protected void GetCustomProperties()
{
if (FusionRoom.IsOnline)
{
- string fusionRoomCustomPropertiesRequest = @"RoomConfigurationRequest";
+ const string fusionRoomCustomPropertiesRequest =
+ @"RoomConfigurationRequest";
- FusionRoom.ExtenderFusionRoomDataReservedSigs.RoomConfigQuery.StringValue = fusionRoomCustomPropertiesRequest;
+ FusionRoom.ExtenderFusionRoomDataReservedSigs.RoomConfigQuery.StringValue =
+ fusionRoomCustomPropertiesRequest;
}
}
- void GetTouchpanelInfo()
+ private void GetTouchpanelInfo()
{
// TODO: Get IP and Project Name from TP
}
@@ -456,17 +513,19 @@ namespace PepperDash.Essentials.Core.Fusion
{
if (args.DeviceOnLine)
{
- CrestronEnvironment.Sleep(200);
+ CrestronInvoke.BeginInvoke( (o) =>
+ {
+ CrestronEnvironment.Sleep(200);
- // Send Push Notification Action request:
+ // Send Push Notification Action request:
- string requestID = "InitialPushRequest";
+ const string requestId = "InitialPushRequest";
- string actionRequest =
- string.Format("\n{0}\n", requestID) +
- "RegisterPushModel\n" +
- "\n" +
+ var actionRequest =
+ string.Format("\n{0}\n", requestId) +
+ "RegisterPushModel\n" +
+ "\n" +
"\n" +
"\n" +
"\n" +
@@ -485,30 +544,30 @@ namespace PepperDash.Essentials.Core.Fusion
"\n" +
"\n" +
"\n" +
- "\n" +
- "\n";
+ "\n" +
+ "\n";
- Debug.Console(2, this, "Sending Fusion ActionRequest: \n{0}", actionRequest);
+ Debug.Console(2, this, "Sending Fusion ActionRequest: \n{0}", actionRequest);
- FusionRoom.ExtenderFusionRoomDataReservedSigs.ActionQuery.StringValue = actionRequest;
+ FusionRoom.ExtenderFusionRoomDataReservedSigs.ActionQuery.StringValue = actionRequest;
- GetCustomProperties();
+ GetCustomProperties();
- // Request current Fusion Server Time
- RequestLocalDateTime(null);
+ // Request current Fusion Server Time
+ RequestLocalDateTime(null);
- // Setup timer to request time daily
- if (DailyTimeRequestTimer != null && !DailyTimeRequestTimer.Disposed)
- {
- DailyTimeRequestTimer.Stop();
- DailyTimeRequestTimer.Dispose();
- }
+ // Setup timer to request time daily
+ if (_dailyTimeRequestTimer != null && !_dailyTimeRequestTimer.Disposed)
+ {
+ _dailyTimeRequestTimer.Stop();
+ _dailyTimeRequestTimer.Dispose();
+ }
- DailyTimeRequestTimer = new CTimer(RequestLocalDateTime, null, 86400000, 86400000);
+ _dailyTimeRequestTimer = new CTimer(RequestLocalDateTime, null, 86400000, 86400000);
- DailyTimeRequestTimer.Reset(86400000, 86400000);
+ _dailyTimeRequestTimer.Reset(86400000, 86400000);
+ });
}
-
}
///
@@ -517,9 +576,10 @@ namespace PepperDash.Essentials.Core.Fusion
///
public void RequestLocalDateTime(object callbackObject)
{
- string timeRequestID = "TimeRequest";
+ const string timeRequestId = "TimeRequest";
- string timeRequest = string.Format("{0}", timeRequestID);
+ var timeRequest = string.Format("{0}",
+ timeRequestId);
FusionRoom.ExtenderFusionRoomDataReservedSigs.LocalDateTimeQuery.StringValue = timeRequest;
}
@@ -527,79 +587,78 @@ namespace PepperDash.Essentials.Core.Fusion
///
/// Generates a room schedule request for this room for the next 24 hours.
///
- /// string identifying this request. Used with a corresponding ScheduleResponse value
public void RequestFullRoomSchedule(object callbackObject)
{
- DateTime now = DateTime.Today;
+ var now = DateTime.Today;
- string currentTime = now.ToString("s");
+ var currentTime = now.ToString("s");
- string requestTest =
- string.Format("FullSchedleRequest{0}{1}24", RoomGuid, currentTime);
+ var requestTest =
+ string.Format(
+ "FullSchedleRequest{0}{1}24",
+ RoomGuid, currentTime);
Debug.Console(2, this, "Sending Fusion ScheduleQuery: \n{0}", requestTest);
FusionRoom.ExtenderRoomViewSchedulingDataReservedSigs.ScheduleQuery.StringValue = requestTest;
- if (IsRegisteredForSchedulePushNotifications)
- PushNotificationTimer.Stop();
+ if (_isRegisteredForSchedulePushNotifications)
+ {
+ _pushNotificationTimer.Stop();
+ }
}
-
+
///
/// Wrapper method to allow console commands to modify the current meeting end time
///
/// meetingID extendTime
public void ModifyMeetingEndTimeConsoleHelper(string command)
{
- string requestID;
- string meetingID = null;
- int extendMinutes = -1;
+ var extendMinutes = -1;
- requestID = "ModifyMeetingTest12345";
+ const string requestId = "ModifyMeetingTest12345";
try
{
var tokens = command.Split(' ');
- meetingID = tokens[0];
extendMinutes = Int32.Parse(tokens[1]);
-
}
catch (Exception e)
{
Debug.Console(1, this, "Error parsing console command: {0}", e);
}
- ModifyMeetingEndTime(requestID, extendMinutes);
-
+ ModifyMeetingEndTime(requestId, extendMinutes);
}
///
/// Ends or Extends the current meeting by the specified number of minutes.
///
+ ///
/// Number of minutes to extend the meeting. A value of 0 will end the meeting.
- public void ModifyMeetingEndTime(string requestID, int extendMinutes)
+ public void ModifyMeetingEndTime(string requestId, int extendMinutes)
{
- if(CurrentMeeting == null)
+ if (_currentMeeting == null)
{
Debug.Console(1, this, "No meeting in progress. Unable to modify end time.");
return;
- }
+ }
if (extendMinutes > -1)
{
- if(extendMinutes > 0)
+ if (extendMinutes > 0)
{
- var extendTime = CurrentMeeting.dtEnd - DateTime.Now;
- double extendMinutesRaw = extendTime.TotalMinutes;
+ var extendTime = _currentMeeting.dtEnd - DateTime.Now;
+ var extendMinutesRaw = extendTime.TotalMinutes;
- extendMinutes = extendMinutes + (int)Math.Round(extendMinutesRaw);
+ extendMinutes = extendMinutes + (int) Math.Round(extendMinutesRaw);
}
- string requestTest = string.Format(
+ var requestTest = string.Format(
"{0}{1}MeetingChange"
- , requestID, RoomGuid, CurrentMeeting.MeetingID, extendMinutes);
+ , requestId, RoomGuid, _currentMeeting.MeetingID, extendMinutes);
Debug.Console(1, this, "Sending MeetingChange Request: \n{0}", requestTest);
@@ -609,47 +668,45 @@ namespace PepperDash.Essentials.Core.Fusion
{
Debug.Console(1, this, "Invalid time specified");
}
-
-
}
///
/// Creates and Ad Hoc meeting with a duration of 1 hour, or until the next meeting if in less than 1 hour.
///
- public void CreateAsHocMeeting(string command)
+ public void CreateAdHocMeeting(string command)
{
- string requestID = "CreateAdHocMeeting";
+ const string requestId = "CreateAdHocMeeting";
- DateTime now = DateTime.Now.AddMinutes(1);
+ var now = DateTime.Now.AddMinutes(1);
now.AddSeconds(-now.Second);
// Assume 1 hour meeting if possible
- DateTime dtEnd = now.AddHours(1);
+ var dtEnd = now.AddHours(1);
// Check if room is available for 1 hour before next meeting
- if (NextMeeting != null)
+ if (_nextMeeting != null)
{
- var roomAvailable = NextMeeting.dtEnd.Subtract(dtEnd);
+ var roomAvailable = _nextMeeting.dtEnd.Subtract(dtEnd);
if (roomAvailable.TotalMinutes < 60)
{
- /// Room not available for full hour, book until next meeting starts
- dtEnd = NextMeeting.dtEnd;
+ // Room not available for full hour, book until next meeting starts
+ dtEnd = _nextMeeting.dtEnd;
}
}
- string createMeetingRequest =
+ var createMeetingRequest =
"" +
- string.Format("{0}", requestID) +
- string.Format("{0}", RoomGuid) +
- "" +
- string.Format("{0}", now.ToString("s")) +
- string.Format("{0}", dtEnd.ToString("s")) +
- "AdHoc Meeting" +
- "Room User" +
- "Example Message" +
- "" +
+ string.Format("{0}", requestId) +
+ string.Format("{0}", RoomGuid) +
+ "" +
+ string.Format("{0}", now.ToString("s")) +
+ string.Format("{0}", dtEnd.ToString("s")) +
+ "AdHoc Meeting" +
+ "Room User" +
+ "Example Message" +
+ "" +
"";
Debug.Console(2, this, "Sending CreateMeeting Request: \n{0}", createMeetingRequest);
@@ -659,7 +716,6 @@ namespace PepperDash.Essentials.Core.Fusion
//Debug.Console(1, this, "Sending CreateMeeting Request: \n{0}", command);
//FusionRoom.ExtenderRoomViewSchedulingDataReservedSigs.CreateMeeting.StringValue = command;
-
}
///
@@ -667,73 +723,73 @@ namespace PepperDash.Essentials.Core.Fusion
///
///
///
- protected void ExtenderFusionRoomDataReservedSigs_DeviceExtenderSigChange(DeviceExtender currentDeviceExtender, SigEventArgs args)
+ protected void ExtenderFusionRoomDataReservedSigs_DeviceExtenderSigChange(DeviceExtender currentDeviceExtender,
+ SigEventArgs args)
{
- Debug.Console(2, this, "Event: {0}\n Sig: {1}\nFusionResponse:\n{2}", args.Event, args.Sig.Name, args.Sig.StringValue);
+ Debug.Console(2, this, "Event: {0}\n Sig: {1}\nFusionResponse:\n{2}", args.Event, args.Sig.Name,
+ args.Sig.StringValue);
if (args.Sig == FusionRoom.ExtenderFusionRoomDataReservedSigs.ActionQueryResponse)
{
try
{
- XmlDocument message = new XmlDocument();
+ var message = new XmlDocument();
message.LoadXml(args.Sig.StringValue);
var actionResponse = message["ActionResponse"];
- if (actionResponse != null)
+ if (actionResponse == null)
{
- var requestID = actionResponse["RequestID"];
+ return;
+ }
- if (requestID.InnerText == "InitialPushRequest")
+ var requestId = actionResponse["RequestID"];
+
+ if (requestId.InnerText != "InitialPushRequest")
+ {
+ return;
+ }
+
+ if (actionResponse["ActionID"].InnerText != "RegisterPushModel")
+ {
+ return;
+ }
+
+ var parameters = actionResponse["Parameters"];
+
+ foreach (var isRegistered in from XmlElement parameter in parameters
+ where parameter.HasAttributes
+ select parameter.Attributes
+ into attributes
+ where attributes["ID"].Value == "Registered"
+ select Int32.Parse(attributes["Value"].Value))
+ {
+ switch (isRegistered)
{
- if (actionResponse["ActionID"].InnerText == "RegisterPushModel")
- {
- var parameters = actionResponse["Parameters"];
-
- foreach (XmlElement parameter in parameters)
+ case 1:
+ _isRegisteredForSchedulePushNotifications = true;
+ if (_pollTimer != null && !_pollTimer.Disposed)
{
- if (parameter.HasAttributes)
- {
- var attributes = parameter.Attributes;
-
- if (attributes["ID"].Value == "Registered")
- {
- var isRegistered = Int32.Parse(attributes["Value"].Value);
-
- if (isRegistered == 1)
- {
- IsRegisteredForSchedulePushNotifications = true;
-
- if (PollTimer != null && !PollTimer.Disposed)
- {
- PollTimer.Stop();
- PollTimer.Dispose();
- }
-
- PushNotificationTimer = new CTimer(RequestFullRoomSchedule, null, PushNotificationTimeout, PushNotificationTimeout);
-
- PushNotificationTimer.Reset(PushNotificationTimeout, PushNotificationTimeout);
- }
- else if (isRegistered == 0)
- {
- IsRegisteredForSchedulePushNotifications = false;
-
- if (PushNotificationTimer != null && !PushNotificationTimer.Disposed)
- {
- PushNotificationTimer.Stop();
- PushNotificationTimer.Dispose();
- }
-
- PollTimer = new CTimer(RequestFullRoomSchedule, null, SchedulePollInterval, SchedulePollInterval);
-
- PollTimer.Reset(SchedulePollInterval, SchedulePollInterval);
- }
- }
- }
+ _pollTimer.Stop();
+ _pollTimer.Dispose();
}
- }
+ _pushNotificationTimer = new CTimer(RequestFullRoomSchedule, null,
+ PushNotificationTimeout, PushNotificationTimeout);
+ _pushNotificationTimer.Reset(PushNotificationTimeout, PushNotificationTimeout);
+ break;
+ case 0:
+ _isRegisteredForSchedulePushNotifications = false;
+ if (_pushNotificationTimer != null && !_pushNotificationTimer.Disposed)
+ {
+ _pushNotificationTimer.Stop();
+ _pushNotificationTimer.Dispose();
+ }
+ _pollTimer = new CTimer(RequestFullRoomSchedule, null, SchedulePollInterval,
+ SchedulePollInterval);
+ _pollTimer.Reset(SchedulePollInterval, SchedulePollInterval);
+ break;
}
}
}
@@ -746,7 +802,7 @@ namespace PepperDash.Essentials.Core.Fusion
{
try
{
- XmlDocument message = new XmlDocument();
+ var message = new XmlDocument();
message.LoadXml(args.Sig.StringValue);
@@ -759,13 +815,15 @@ namespace PepperDash.Essentials.Core.Fusion
if (localDateTime != null)
{
var tempLocalDateTime = localDateTime.InnerText;
-
- DateTime currentTime = DateTime.Parse(tempLocalDateTime);
+
+ var currentTime = DateTime.Parse(tempLocalDateTime);
Debug.Console(1, this, "DateTime from Fusion Server: {0}", currentTime);
// Parse time and date from response and insert values
- CrestronEnvironment.SetTimeAndDate((ushort)currentTime.Hour, (ushort)currentTime.Minute, (ushort)currentTime.Second, (ushort)currentTime.Month, (ushort)currentTime.Day, (ushort)currentTime.Year);
+ CrestronEnvironment.SetTimeAndDate((ushort) currentTime.Hour, (ushort) currentTime.Minute,
+ (ushort) currentTime.Second, (ushort) currentTime.Month, (ushort) currentTime.Day,
+ (ushort) currentTime.Year);
Debug.Console(1, this, "Processor time set to {0}", CrestronEnvironment.GetLocalTime());
}
@@ -780,13 +838,13 @@ namespace PepperDash.Essentials.Core.Fusion
{
// Room info response with custom properties
- string roomConfigResponseArgs = args.Sig.StringValue.Replace("&", "and");
+ var roomConfigResponseArgs = args.Sig.StringValue.Replace("&", "and");
Debug.Console(2, this, "Fusion Response: \n {0}", roomConfigResponseArgs);
try
{
- XmlDocument roomConfigResponse = new XmlDocument();
+ var roomConfigResponse = new XmlDocument();
roomConfigResponse.LoadXml(roomConfigResponseArgs);
@@ -794,13 +852,13 @@ namespace PepperDash.Essentials.Core.Fusion
if (requestRoomConfiguration != null)
{
- RoomInformation roomInformation = new RoomInformation();
+ var roomInformation = new RoomInformation();
foreach (XmlElement e in roomConfigResponse.FirstChild.ChildNodes)
{
if (e.Name == "RoomInformation")
{
- XmlReader roomInfo = new XmlReader(e.OuterXml);
+ var roomInfo = new XmlReader(e.OuterXml);
roomInformation = CrestronXMLSerialization.DeSerializeObject(roomInfo);
}
@@ -808,7 +866,7 @@ namespace PepperDash.Essentials.Core.Fusion
{
foreach (XmlElement el in e)
{
- FusionCustomProperty customProperty = new FusionCustomProperty();
+ var customProperty = new FusionCustomProperty();
if (el.Name == "CustomField")
{
@@ -838,7 +896,9 @@ namespace PepperDash.Essentials.Core.Fusion
var handler = RoomInfoChange;
if (handler != null)
+ {
handler(this, new EventArgs());
+ }
CustomPropertiesBridge.EvaluateRoomInfo(Room.Key, roomInformation);
}
@@ -851,7 +911,6 @@ namespace PepperDash.Essentials.Core.Fusion
//getRoomInfoBusy = false;
//_DynFusion.API.EISC.BooleanInput[Constants.GetRoomInfo].BoolValue = getRoomInfoBusy;
}
-
}
///
@@ -859,130 +918,127 @@ namespace PepperDash.Essentials.Core.Fusion
///
///
///
- protected void FusionRoomSchedule_DeviceExtenderSigChange(DeviceExtender currentDeviceExtender, SigEventArgs args)
+ protected void FusionRoomSchedule_DeviceExtenderSigChange(DeviceExtender currentDeviceExtender,
+ SigEventArgs args)
{
- Debug.Console(2, this, "Scehdule Response Event: {0}\n Sig: {1}\nFusionResponse:\n{2}", args.Event, args.Sig.Name, args.Sig.StringValue);
+ Debug.Console(2, this, "Scehdule Response Event: {0}\n Sig: {1}\nFusionResponse:\n{2}", args.Event,
+ args.Sig.Name, args.Sig.StringValue);
- if (args.Sig == FusionRoom.ExtenderRoomViewSchedulingDataReservedSigs.ScheduleResponse)
- {
- try
- {
- ScheduleResponse scheduleResponse = new ScheduleResponse();
+ if (args.Sig == FusionRoom.ExtenderRoomViewSchedulingDataReservedSigs.ScheduleResponse)
+ {
+ try
+ {
+ var scheduleResponse = new ScheduleResponse();
- XmlDocument message = new XmlDocument();
+ var message = new XmlDocument();
- message.LoadXml(args.Sig.StringValue);
+ message.LoadXml(args.Sig.StringValue);
- var response = message["ScheduleResponse"];
+ var response = message["ScheduleResponse"];
- if (response != null)
- {
- // Check for push notification
- if (response["RequestID"].InnerText == "RVRequest")
- {
- var action = response["Action"];
+ if (response != null)
+ {
+ // Check for push notification
+ if (response["RequestID"].InnerText == "RVRequest")
+ {
+ var action = response["Action"];
- if (action.OuterXml.IndexOf("RequestSchedule") > -1)
- {
- PushNotificationTimer.Reset(PushNotificationTimeout, PushNotificationTimeout);
- }
- }
- else // Not a push notification
- {
- CurrentSchedule = new RoomSchedule(); // Clear Current Schedule
- CurrentMeeting = null; // Clear Current Meeting
- NextMeeting = null; // Clear Next Meeting
+ if (action.OuterXml.IndexOf("RequestSchedule", StringComparison.Ordinal) > -1)
+ {
+ _pushNotificationTimer.Reset(PushNotificationTimeout, PushNotificationTimeout);
+ }
+ }
+ else // Not a push notification
+ {
+ _currentSchedule = new RoomSchedule(); // Clear Current Schedule
+ _currentMeeting = null; // Clear Current Meeting
+ _nextMeeting = null; // Clear Next Meeting
- bool isNextMeeting = false;
+ var isNextMeeting = false;
- foreach (XmlElement element in message.FirstChild.ChildNodes)
- {
- if (element.Name == "RequestID")
- {
- scheduleResponse.RequestID = element.InnerText;
- }
- else if (element.Name == "RoomID")
- {
- scheduleResponse.RoomID = element.InnerText;
- }
- else if (element.Name == "RoomName")
- {
- scheduleResponse.RoomName = element.InnerText;
- }
- else if (element.Name == "Event")
- {
- Debug.Console(2, this, "Event Found:\n{0}", element.OuterXml);
+ foreach (XmlElement element in message.FirstChild.ChildNodes)
+ {
+ if (element.Name == "RequestID")
+ {
+ scheduleResponse.RequestID = element.InnerText;
+ }
+ else if (element.Name == "RoomID")
+ {
+ scheduleResponse.RoomID = element.InnerText;
+ }
+ else if (element.Name == "RoomName")
+ {
+ scheduleResponse.RoomName = element.InnerText;
+ }
+ else if (element.Name == "Event")
+ {
+ Debug.Console(2, this, "Event Found:\n{0}", element.OuterXml);
- XmlReader reader = new XmlReader(element.OuterXml);
+ var reader = new XmlReader(element.OuterXml);
- Event tempEvent = new Event();
+ var tempEvent = CrestronXMLSerialization.DeSerializeObject(reader);
- tempEvent = CrestronXMLSerialization.DeSerializeObject(reader);
+ scheduleResponse.Events.Add(tempEvent);
- scheduleResponse.Events.Add(tempEvent);
+ // Check is this is the current event
+ if (tempEvent.dtStart <= DateTime.Now && tempEvent.dtEnd >= DateTime.Now)
+ {
+ _currentMeeting = tempEvent; // Set Current Meeting
+ isNextMeeting = true; // Flag that next element is next meeting
+ }
- // Check is this is the current event
- if (tempEvent.dtStart <= DateTime.Now && tempEvent.dtEnd >= DateTime.Now)
- {
- CurrentMeeting = tempEvent; // Set Current Meeting
- isNextMeeting = true; // Flag that next element is next meeting
- }
+ if (isNextMeeting)
+ {
+ _nextMeeting = tempEvent; // Set Next Meeting
+ isNextMeeting = false;
+ }
- if (isNextMeeting)
- {
- NextMeeting = tempEvent; // Set Next Meeting
- isNextMeeting = false;
- }
+ _currentSchedule.Meetings.Add(tempEvent);
+ }
+ }
- CurrentSchedule.Meetings.Add(tempEvent);
- }
+ PrintTodaysSchedule();
- }
+ if (!_isRegisteredForSchedulePushNotifications)
+ {
+ _pollTimer.Reset(SchedulePollInterval, SchedulePollInterval);
+ }
- PrintTodaysSchedule();
-
- if (!IsRegisteredForSchedulePushNotifications)
- PollTimer.Reset(SchedulePollInterval, SchedulePollInterval);
-
- // Fire Schedule Change Event
- var handler = ScheduleChange;
-
- if (handler != null)
- {
- handler(this, new ScheduleChangeEventArgs() { Schedule = CurrentSchedule });
- }
-
- }
- }
-
-
-
- }
- catch (Exception e)
- {
- Debug.Console(1, this, "Error parsing ScheduleResponse: {0}", e);
- }
- }
- else if (args.Sig == FusionRoom.ExtenderRoomViewSchedulingDataReservedSigs.CreateResponse)
- {
- Debug.Console(2, this, "Create Meeting Response Event: {0}\n Sig: {1}\nFusionResponse:\n{2}", args.Event, args.Sig.Name, args.Sig.StringValue);
- }
+ // Fire Schedule Change Event
+ var handler = ScheduleChange;
+ if (handler != null)
+ {
+ handler(this, new ScheduleChangeEventArgs {Schedule = _currentSchedule});
+ }
+ }
+ }
+ }
+ catch (Exception e)
+ {
+ Debug.Console(1, this, "Error parsing ScheduleResponse: {0}", e);
+ }
+ }
+ else if (args.Sig == FusionRoom.ExtenderRoomViewSchedulingDataReservedSigs.CreateResponse)
+ {
+ Debug.Console(2, this, "Create Meeting Response Event: {0}\n Sig: {1}\nFusionResponse:\n{2}", args.Event,
+ args.Sig.Name, args.Sig.StringValue);
+ }
}
///
/// Prints today's schedule to console for debugging
///
- void PrintTodaysSchedule()
+ private void PrintTodaysSchedule()
{
if (Debug.Level > 1)
{
- if (CurrentSchedule.Meetings.Count > 0)
+ if (_currentSchedule.Meetings.Count > 0)
{
Debug.Console(1, this, "Today's Schedule for '{0}'\n", Room.Name);
- foreach (Event e in CurrentSchedule.Meetings)
+ foreach (var e in _currentSchedule.Meetings)
{
Debug.Console(1, this, "Subject: {0}", e.Subject);
Debug.Console(1, this, "Organizer: {0}", e.Organizer);
@@ -995,63 +1051,62 @@ namespace PepperDash.Essentials.Core.Fusion
}
}
- protected virtual void SetUpSources()
- {
- // Sources
- var dict = ConfigReader.ConfigObject.GetSourceListForKey((Room as EssentialsRoomBase).SourceListKey);
- if (dict != null)
- {
- // NEW PROCESS:
- // Make these lists and insert the fusion attributes by iterating these
- var setTopBoxes = dict.Where(d => d.Value.SourceDevice is ISetTopBoxControls);
- uint i = 1;
- foreach (var kvp in setTopBoxes)
- {
- TryAddRouteActionSigs("Display 1 - Source TV " + i, 188 + i, kvp.Key, kvp.Value.SourceDevice);
- i++;
- if (i > 5) // We only have five spots
- break;
- }
-
- var discPlayers = dict.Where(d => d.Value.SourceDevice is IDiscPlayerControls);
- i = 1;
- foreach (var kvp in discPlayers)
- {
- TryAddRouteActionSigs("Display 1 - Source DVD " + i, 181 + i, kvp.Key, kvp.Value.SourceDevice);
- i++;
- if (i > 5) // We only have five spots
- break;
- }
-
- var laptops = dict.Where(d => d.Value.SourceDevice is Devices.Laptop);
- i = 1;
- foreach (var kvp in laptops)
- {
- TryAddRouteActionSigs("Display 1 - Source Laptop " + i, 166 + i, kvp.Key, kvp.Value.SourceDevice);
- i++;
- if (i > 10) // We only have ten spots???
- break;
- }
-
- foreach (var kvp in dict)
+ protected virtual void SetUpSources()
+ {
+ // Sources
+ var dict = ConfigReader.ConfigObject.GetSourceListForKey(Room.SourceListKey);
+ if (dict != null)
+ {
+ // NEW PROCESS:
+ // Make these lists and insert the fusion attributes by iterating these
+ var setTopBoxes = dict.Where(d => d.Value.SourceDevice is ISetTopBoxControls);
+ uint i = 1;
+ foreach (var kvp in setTopBoxes)
{
- var usageDevice = kvp.Value.SourceDevice as IUsageTracking;
-
- if (usageDevice != null)
+ TryAddRouteActionSigs(JoinMap.Display1SetTopBoxSourceStart.AttributeName + " " + i, JoinMap.Display1SetTopBoxSourceStart.JoinNumber + i, kvp.Key, kvp.Value.SourceDevice);
+ i++;
+ if (i > JoinMap.Display1SetTopBoxSourceStart.JoinSpan) // We only have five spots
{
- usageDevice.UsageTracker = new UsageTracking(usageDevice as Device);
- usageDevice.UsageTracker.UsageIsTracked = true;
- usageDevice.UsageTracker.DeviceUsageEnded += new EventHandler(UsageTracker_DeviceUsageEnded);
+ break;
}
}
-
- }
- else
- {
- Debug.Console(1, this, "WARNING: Config source list '{0}' not found for room '{1}'",
- (Room as EssentialsRoomBase).SourceListKey, Room.Key);
- }
- }
+
+ var discPlayers = dict.Where(d => d.Value.SourceDevice is IDiscPlayerControls);
+ i = 1;
+ foreach (var kvp in discPlayers)
+ {
+ TryAddRouteActionSigs(JoinMap.Display1DiscPlayerSourceStart.AttributeName + " " + i, JoinMap.Display1DiscPlayerSourceStart.JoinNumber + i, kvp.Key, kvp.Value.SourceDevice);
+ i++;
+ if (i > JoinMap.Display1DiscPlayerSourceStart.JoinSpan) // We only have five spots
+ {
+ break;
+ }
+ }
+
+ var laptops = dict.Where(d => d.Value.SourceDevice is Devices.Laptop);
+ i = 1;
+ foreach (var kvp in laptops)
+ {
+ TryAddRouteActionSigs(JoinMap.Display1LaptopSourceStart.AttributeName + " " + i, JoinMap.Display1LaptopSourceStart.JoinNumber + i, kvp.Key, kvp.Value.SourceDevice);
+ i++;
+ if (i > JoinMap.Display1LaptopSourceStart.JoinSpan) // We only have ten spots???
+ {
+ break;
+ }
+ }
+
+ foreach (var usageDevice in dict.Select(kvp => kvp.Value.SourceDevice).OfType())
+ {
+ usageDevice.UsageTracker = new UsageTracking(usageDevice as Device) {UsageIsTracked = true};
+ usageDevice.UsageTracker.DeviceUsageEnded += UsageTracker_DeviceUsageEnded;
+ }
+ }
+ else
+ {
+ Debug.Console(1, this, "WARNING: Config source list '{0}' not found for room '{1}'",
+ Room.SourceListKey, Room.Key);
+ }
+ }
///
/// Collects usage data from source and sends to Fusion
@@ -1059,24 +1114,31 @@ namespace PepperDash.Essentials.Core.Fusion
///
///
protected void UsageTracker_DeviceUsageEnded(object sender, DeviceUsageEventArgs e)
- {
+ {
var deviceTracker = sender as UsageTracking;
- var configDevice = ConfigReader.ConfigObject.Devices.Where(d => d.Key.Equals(deviceTracker.Parent));
+ if (deviceTracker == null)
+ {
+ return;
+ }
- string group = ConfigReader.GetGroupForDeviceKey(deviceTracker.Parent.Key);
+ var group = ConfigReader.GetGroupForDeviceKey(deviceTracker.Parent.Key);
- string currentMeetingId = "-";
+ var currentMeetingId = "-";
- if (CurrentMeeting != null)
- currentMeetingId = CurrentMeeting.MeetingID;
+ if (_currentMeeting != null)
+ {
+ currentMeetingId = _currentMeeting.MeetingID;
+ }
//String Format: "USAGE||[Date YYYY-MM-DD]||[Time HH-mm-ss]||TIME||[Asset_Type]||[Asset_Name]||[Minutes_used]||[Asset_ID]||[Meeting_ID]"
// [Asset_ID] property does not appear to be used in Crestron SSI examples. They are sending "-" instead so that's what is replicated here
- string deviceUsage = string.Format("USAGE||{0}||{1}||TIME||{2}||{3}||-||{4}||-||{5}||{6}||\r\n", e.UsageEndTime.ToString("yyyy-MM-dd"), e.UsageEndTime.ToString("HH:mm:ss"),
- group, deviceTracker.Parent.Name, e.MinutesUsed, "-", currentMeetingId);
+ var deviceUsage = string.Format("USAGE||{0}||{1}||TIME||{2}||{3}||-||{4}||-||{5}||{6}||\r\n",
+ e.UsageEndTime.ToString("yyyy-MM-dd"), e.UsageEndTime.ToString("HH:mm:ss"),
+ @group, deviceTracker.Parent.Name, e.MinutesUsed, "-", currentMeetingId);
- Debug.Console(1, this, "Device usage for: {0} ended at {1}. In use for {2} minutes", deviceTracker.Parent.Name, e.UsageEndTime, e.MinutesUsed);
+ Debug.Console(1, this, "Device usage for: {0} ended at {1}. In use for {2} minutes",
+ deviceTracker.Parent.Name, e.UsageEndTime, e.MinutesUsed);
FusionRoom.DeviceUsage.InputSig.StringValue = deviceUsage;
@@ -1084,41 +1146,51 @@ namespace PepperDash.Essentials.Core.Fusion
}
- protected void TryAddRouteActionSigs(string attrName, uint attrNum, string routeKey, Device pSrc)
- {
- Debug.Console(2, this, "Creating attribute '{0}' with join {1} for source {2}",
- attrName, attrNum, pSrc.Key);
- try
- {
- var sigD = FusionRoom.CreateOffsetBoolSig(attrNum, attrName, eSigIoMask.InputOutputSig);
- // Need feedback when this source is selected
- // Event handler, added below, will compare source changes with this sig dict
- SourceToFeedbackSigs.Add(pSrc, sigD.InputSig);
+ protected void TryAddRouteActionSigs(string attrName, uint attrNum, string routeKey, Device pSrc)
+ {
+ Debug.Console(2, this, "Creating attribute '{0}' with join {1} for source {2}",
+ attrName, attrNum, pSrc.Key);
+ try
+ {
+ var sigD = FusionRoom.CreateOffsetBoolSig(attrNum, attrName, eSigIoMask.InputOutputSig);
+ // Need feedback when this source is selected
+ // Event handler, added below, will compare source changes with this sig dict
+ _sourceToFeedbackSigs.Add(pSrc, sigD.InputSig);
- // And respond to selection in Fusion
- sigD.OutputSig.SetSigFalseAction(() => (Room as IRunRouteAction).RunRouteAction(routeKey, Room.SourceListKey));
- }
- catch (Exception)
- {
- Debug.Console(2, this, "Error creating Fusion signal {0} {1} for device '{2}'. THIS NEEDS REWORKING", attrNum, attrName, pSrc.Key);
- }
- }
+ // And respond to selection in Fusion
+ sigD.OutputSig.SetSigFalseAction(() =>
+ {
+ var runRouteAction = Room as IRunRouteAction;
+ if (runRouteAction != null)
+ {
+ runRouteAction.RunRouteAction(routeKey, Room.SourceListKey);
+ }
+ });
+ }
+ catch (Exception)
+ {
+ Debug.Console(2, this, "Error creating Fusion signal {0} {1} for device '{2}'. THIS NEEDS REWORKING",
+ attrNum, attrName, pSrc.Key);
+ }
+ }
- ///
- ///
- ///
- void SetUpCommunitcationMonitors()
- {
+ ///
+ ///
+ ///
+ private void SetUpCommunitcationMonitors()
+ {
uint displayNum = 0;
uint touchpanelNum = 0;
uint xpanelNum = 0;
- // Attach to all room's devices with monitors.
- //foreach (var dev in DeviceManager.Devices)
- foreach (var dev in DeviceManager.GetDevices())
- {
- if (!(dev is ICommunicationMonitor))
- continue;
+ // Attach to all room's devices with monitors.
+ //foreach (var dev in DeviceManager.Devices)
+ foreach (var dev in DeviceManager.GetDevices())
+ {
+ if (!(dev is ICommunicationMonitor))
+ {
+ continue;
+ }
string attrName = null;
uint attrNum = 1;
@@ -1140,10 +1212,12 @@ namespace PepperDash.Essentials.Core.Fusion
{
attrNum = attrNum + touchpanelNum;
- if (attrNum > 10)
+ if (attrNum > JoinMap.XpanelOnlineStart.JoinSpan)
+ {
continue;
- attrName = "Online - XPanel " + attrNum;
- attrNum += 160;
+ }
+ attrName = JoinMap.XpanelOnlineStart.AttributeName + " " + attrNum;
+ attrNum += JoinMap.XpanelOnlineStart.JoinNumber;
touchpanelNum++;
}
@@ -1151,54 +1225,58 @@ namespace PepperDash.Essentials.Core.Fusion
{
attrNum = attrNum + xpanelNum;
- if (attrNum > 10)
+ if (attrNum > JoinMap.TouchpanelOnlineStart.JoinSpan)
+ {
continue;
- attrName = "Online - Touch Panel " + attrNum;
- attrNum += 150;
+ }
+ attrName = JoinMap.TouchpanelOnlineStart.AttributeName + " " + attrNum;
+ attrNum += JoinMap.TouchpanelOnlineStart.JoinNumber;
xpanelNum++;
}
}
- //else
- if (dev is DisplayBase)
- {
- attrNum = attrNum + displayNum;
- if (attrNum > 10)
- continue;
- attrName = "Online - Display " + attrNum;
- attrNum += 170;
+ //else
+ if (dev is DisplayBase)
+ {
+ attrNum = attrNum + displayNum;
+ if (attrNum > JoinMap.DisplayOnlineStart.JoinSpan)
+ {
+ continue;
+ }
+ attrName = JoinMap.DisplayOnlineStart.AttributeName + " " + attrNum;
+ attrNum += JoinMap.DisplayOnlineStart.JoinNumber;
displayNum++;
- }
- //else if (dev is DvdDeviceBase)
- //{
- // if (attrNum > 5)
- // continue;
- // attrName = "Device Ok - DVD " + attrNum;
- // attrNum += 260;
- //}
- // add set top box
+ }
+ //else if (dev is DvdDeviceBase)
+ //{
+ // if (attrNum > 5)
+ // continue;
+ // attrName = "Device Ok - DVD " + attrNum;
+ // attrNum += 260;
+ //}
+ // add set top box
- // add Cresnet roll-up
+ // add Cresnet roll-up
- // add DM-devices roll-up
+ // add DM-devices roll-up
- if (attrName != null)
- {
- // Link comm status to sig and update
- var sigD = FusionRoom.CreateOffsetBoolSig(attrNum, attrName, eSigIoMask.InputSigOnly);
- var smd = dev as ICommunicationMonitor;
- sigD.InputSig.BoolValue = smd.CommunicationMonitor.Status == MonitorStatus.IsOk;
- smd.CommunicationMonitor.StatusChange += (o, a) =>
- { sigD.InputSig.BoolValue = a.Status == MonitorStatus.IsOk; };
- Debug.Console(0, this, "Linking '{0}' communication monitor to Fusion '{1}'", dev.Key, attrName);
- }
- }
- }
+ if (attrName != null)
+ {
+ // Link comm status to sig and update
+ var sigD = FusionRoom.CreateOffsetBoolSig(attrNum, attrName, eSigIoMask.InputSigOnly);
+ var smd = dev as ICommunicationMonitor;
+ sigD.InputSig.BoolValue = smd.CommunicationMonitor.Status == MonitorStatus.IsOk;
+ smd.CommunicationMonitor.StatusChange +=
+ (o, a) => { sigD.InputSig.BoolValue = a.Status == MonitorStatus.IsOk; };
+ Debug.Console(0, this, "Linking '{0}' communication monitor to Fusion '{1}'", dev.Key, attrName);
+ }
+ }
+ }
- protected virtual void SetUpDisplay()
- {
+ protected virtual void SetUpDisplay()
+ {
try
{
//Setup Display Usage Monitoring
@@ -1207,35 +1285,52 @@ namespace PepperDash.Essentials.Core.Fusion
// Consider updating this in multiple display systems
- foreach (DisplayBase display in displays)
+ foreach (var display in displays.Cast())
{
- display.UsageTracker = new UsageTracking(display);
- display.UsageTracker.UsageIsTracked = true;
- display.UsageTracker.DeviceUsageEnded += new EventHandler(UsageTracker_DeviceUsageEnded);
+ display.UsageTracker = new UsageTracking(display) {UsageIsTracked = true};
+ display.UsageTracker.DeviceUsageEnded += UsageTracker_DeviceUsageEnded;
}
- var defaultDisplay = (Room as IHasDefaultDisplay).DefaultDisplay as DisplayBase;
+ var hasDefaultDisplay = Room as IHasDefaultDisplay;
+ if (hasDefaultDisplay == null)
+ {
+ return;
+ }
+ var defaultDisplay = hasDefaultDisplay.DefaultDisplay as DisplayBase;
if (defaultDisplay == null)
{
Debug.Console(1, this, "Cannot link null display to Fusion because default display is null");
return;
}
- var dispPowerOnAction = new Action(b => { if (!b) defaultDisplay.PowerOn(); });
- var dispPowerOffAction = new Action(b => { if (!b) defaultDisplay.PowerOff(); });
+ var dispPowerOnAction = new Action(b =>
+ {
+ if (!b)
+ {
+ defaultDisplay.PowerOn();
+ }
+ });
+ var dispPowerOffAction = new Action(b =>
+ {
+ if (!b)
+ {
+ defaultDisplay.PowerOff();
+ }
+ });
// Display to fusion room sigs
FusionRoom.DisplayPowerOn.OutputSig.UserObject = dispPowerOnAction;
- FusionRoom.DisplayPowerOff.OutputSig.UserObject = dispPowerOffAction;
+ FusionRoom.DisplayPowerOff.OutputSig.UserObject = dispPowerOffAction;
- MapDisplayToRoomJoins(1, 158, 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
- var tempAsset = new FusionAsset();
+ FusionAsset tempAsset;
if (FusionStaticAssets.ContainsKey(deviceConfig.Uid))
{
@@ -1244,11 +1339,13 @@ namespace PepperDash.Essentials.Core.Fusion
else
{
// 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);
}
- 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.PowerOff.OutputSig.UserObject = dispPowerOffAction;
@@ -1257,13 +1354,14 @@ namespace PepperDash.Essentials.Core.Fusion
{
defaultTwoWayDisplay.PowerIsOnFeedback.LinkInputSig(FusionRoom.DisplayPowerOn.InputSig);
if (defaultDisplay is IDisplayUsage)
+ {
(defaultDisplay as IDisplayUsage).LampHours.LinkInputSig(FusionRoom.DisplayUsage.InputSig);
+ }
defaultTwoWayDisplay.PowerIsOnFeedback.LinkInputSig(dispAsset.PowerOn.InputSig);
-
}
- // Use extension methods
+ // Use extension methods
dispAsset.TrySetMakeModel(defaultDisplay);
dispAsset.TryLinkAssetErrorToCommunication(defaultDisplay);
}
@@ -1271,323 +1369,423 @@ namespace PepperDash.Essentials.Core.Fusion
{
Debug.Console(1, this, "Error setting up display in Fusion: {0}", e);
}
-
- }
+ }
///
/// Maps room attributes to a display at a specified index
///
- ///
- /// a
- protected virtual void MapDisplayToRoomJoins(int displayIndex, int joinOffset, DisplayBase display)
+ ///
+ ///
+ ///
+ /// a
+ protected virtual void MapDisplayToRoomJoins(int displayIndex, uint joinOffset, DisplayBase display)
{
- string displayName = string.Format("Display {0} - ", displayIndex);
+ var displayName = string.Format("Display {0} - ", displayIndex);
- if (display == (Room as IHasDefaultDisplay).DefaultDisplay)
+ var hasDefaultDisplay = Room as IHasDefaultDisplay;
+ if (hasDefaultDisplay == null || display != hasDefaultDisplay.DefaultDisplay)
{
- // Display volume
- var defaultDisplayVolume = FusionRoom.CreateOffsetUshortSig(50, "Volume - Fader01", eSigIoMask.InputOutputSig);
- defaultDisplayVolume.OutputSig.UserObject = new Action(b => (display as IBasicVolumeWithFeedback).SetVolume(b));
- (display as IBasicVolumeWithFeedback).VolumeLevelFeedback.LinkInputSig(defaultDisplayVolume.InputSig);
-
- // Power on
- var defaultDisplayPowerOn = FusionRoom.CreateOffsetBoolSig((uint)joinOffset, displayName + "Power On", eSigIoMask.InputOutputSig);
- defaultDisplayPowerOn.OutputSig.UserObject = new Action(b => { if (!b) display.PowerOn(); });
-
- // Power Off
- var defaultDisplayPowerOff = FusionRoom.CreateOffsetBoolSig((uint)joinOffset + 1, displayName + "Power Off", eSigIoMask.InputOutputSig);
- defaultDisplayPowerOn.OutputSig.UserObject = new Action(b => { if (!b) display.PowerOff(); }); ;
-
-
- var defaultTwoWayDisplay = display as IHasPowerControlWithFeedback;
- if (defaultTwoWayDisplay != null)
+ return;
+ }
+ // Display volume
+ var defaultDisplayVolume = FusionRoom.CreateOffsetUshortSig(JoinMap.VolumeFader1.JoinNumber, JoinMap.VolumeFader1.AttributeName,
+ eSigIoMask.InputOutputSig);
+ defaultDisplayVolume.OutputSig.UserObject = new Action(b =>
+ {
+ var basicVolumeWithFeedback = display as IBasicVolumeWithFeedback;
+ if (basicVolumeWithFeedback == null)
{
- defaultTwoWayDisplay.PowerIsOnFeedback.LinkInputSig(defaultDisplayPowerOn.InputSig);
- defaultTwoWayDisplay.PowerIsOnFeedback.LinkComplementInputSig(defaultDisplayPowerOff.InputSig);
+ return;
}
- // Current Source
- var defaultDisplaySourceNone = FusionRoom.CreateOffsetBoolSig((uint)joinOffset + 8, displayName + "Source None", eSigIoMask.InputOutputSig);
- defaultDisplaySourceNone.OutputSig.UserObject = new Action(b => { if (!b) (Room as IRunRouteAction).RunRouteAction("roomOff", Room.SourceListKey); }); ;
+ basicVolumeWithFeedback.SetVolume(b);
+ basicVolumeWithFeedback.VolumeLevelFeedback.LinkInputSig(defaultDisplayVolume.InputSig);
+ });
+
+
+ // Power on
+ var defaultDisplayPowerOn = FusionRoom.CreateOffsetBoolSig((uint) joinOffset, displayName + "Power On",
+ eSigIoMask.InputOutputSig);
+ defaultDisplayPowerOn.OutputSig.UserObject = new Action(b =>
+ {
+ if (!b)
+ {
+ display.PowerOn();
+ }
+ });
+
+ // Power Off
+ var defaultDisplayPowerOff = FusionRoom.CreateOffsetBoolSig((uint) joinOffset + 1, displayName + "Power Off",
+ eSigIoMask.InputOutputSig);
+ defaultDisplayPowerOn.OutputSig.UserObject = new Action(b =>
+ {
+ if (!b)
+ {
+ display.PowerOff();
+ }
+ });
+
+
+ var defaultTwoWayDisplay = display as IHasPowerControlWithFeedback;
+ if (defaultTwoWayDisplay != null)
+ {
+ defaultTwoWayDisplay.PowerIsOnFeedback.LinkInputSig(defaultDisplayPowerOn.InputSig);
+ defaultTwoWayDisplay.PowerIsOnFeedback.LinkComplementInputSig(defaultDisplayPowerOff.InputSig);
}
+
+ // Current Source
+ var defaultDisplaySourceNone = FusionRoom.CreateOffsetBoolSig((uint) joinOffset + 8,
+ displayName + "Source None", eSigIoMask.InputOutputSig);
+ defaultDisplaySourceNone.OutputSig.UserObject = new Action(b =>
+ {
+ if (!b)
+ {
+ var runRouteAction = Room as IRunRouteAction;
+ if (runRouteAction != null)
+ {
+ runRouteAction.RunRouteAction("roomOff", Room.SourceListKey);
+ }
+ }
+ });
}
- void SetUpError()
- {
- // Roll up ALL device errors
- ErrorMessageRollUp = new StatusMonitorCollection(this);
- foreach (var dev in DeviceManager.GetDevices())
- {
- var md = dev as ICommunicationMonitor;
- if (md != null)
- {
- ErrorMessageRollUp.AddMonitor(md.CommunicationMonitor);
- Debug.Console(2, this, "Adding '{0}' to room's overall error monitor", md.CommunicationMonitor.Parent.Key);
- }
- }
- ErrorMessageRollUp.Start();
- FusionRoom.ErrorMessage.InputSig.StringValue = ErrorMessageRollUp.Message;
- ErrorMessageRollUp.StatusChange += (o, a) =>
- {
- FusionRoom.ErrorMessage.InputSig.StringValue = ErrorMessageRollUp.Message;
- };
-
- }
+ private void SetUpError()
+ {
+ // Roll up ALL device errors
+ _errorMessageRollUp = new StatusMonitorCollection(this);
+ foreach (var dev in DeviceManager.GetDevices())
+ {
+ var md = dev as ICommunicationMonitor;
+ if (md != null)
+ {
+ _errorMessageRollUp.AddMonitor(md.CommunicationMonitor);
+ Debug.Console(2, this, "Adding '{0}' to room's overall error monitor",
+ md.CommunicationMonitor.Parent.Key);
+ }
+ }
+ _errorMessageRollUp.Start();
+ FusionRoom.ErrorMessage.InputSig.StringValue = _errorMessageRollUp.Message;
+ _errorMessageRollUp.StatusChange +=
+ (o, a) => { FusionRoom.ErrorMessage.InputSig.StringValue = _errorMessageRollUp.Message; };
+ }
///
/// Sets up a local occupancy sensor, such as one attached to a Fusion Scheduling panel. The occupancy status of the room will be read from Fusion
///
- void SetUpLocalOccupancy()
+ private void SetUpLocalOccupancy()
{
RoomIsOccupiedFeedback = new BoolFeedback(RoomIsOccupiedFeedbackFunc);
- FusionRoom.FusionAssetStateChange += new FusionAssetStateEventHandler(FusionRoom_FusionAssetStateChange);
+ FusionRoom.FusionAssetStateChange += FusionRoom_FusionAssetStateChange;
// Build Occupancy Asset?
// Link sigs?
//Room.SetRoomOccupancy(this as IOccupancyStatusProvider, 0);
-
-
}
- void FusionRoom_FusionAssetStateChange(FusionBase device, FusionAssetStateEventArgs args)
+ private void FusionRoom_FusionAssetStateChange(FusionBase device, FusionAssetStateEventArgs args)
{
- if (args.EventId == FusionAssetEventId.RoomOccupiedReceivedEventId || args.EventId == FusionAssetEventId.RoomUnoccupiedReceivedEventId)
+ if (args.EventId == FusionAssetEventId.RoomOccupiedReceivedEventId ||
+ args.EventId == FusionAssetEventId.RoomUnoccupiedReceivedEventId)
+ {
RoomIsOccupiedFeedback.FireUpdate();
-
+ }
}
///
/// Sets up remote occupancy that will relay the occupancy status determined by local system devices to Fusion
///
- void SetUpRemoteOccupancy()
- {
-
+ private void SetUpRemoteOccupancy()
+ {
// Need to have the room occupancy object first and somehow determine the slot number of the Occupancy asset but will not be able to use the UID from config likely.
// Consider defining an object just for Room Occupancy (either eAssetType.Occupancy Sensor (local) or eAssetType.RemoteOccupancySensor (from Fusion sched. panel)) and reserving slot 4 for that asset (statics would start at 5)
//if (Room.OccupancyObj != null)
//{
- var tempOccAsset = GUIDs.OccupancyAsset;
-
- if(tempOccAsset == null)
- {
- FusionOccSensor = new FusionOccupancySensorAsset(eAssetType.OccupancySensor);
- tempOccAsset = FusionOccSensor;
- }
+ var tempOccAsset = _guiDs.OccupancyAsset;
- var occSensorAsset = FusionRoom.CreateOccupancySensorAsset(tempOccAsset.SlotNumber, tempOccAsset.Name, "Occupancy Sensor", tempOccAsset.InstanceId);
+ if (tempOccAsset == null)
+ {
+ FusionOccSensor = new FusionOccupancySensorAsset(eAssetType.OccupancySensor);
+ tempOccAsset = FusionOccSensor;
+ }
- occSensorAsset.RoomOccupied.AddSigToRVIFile = true;
+ var occSensorAsset = FusionRoom.CreateOccupancySensorAsset(tempOccAsset.SlotNumber, tempOccAsset.Name,
+ "Occupancy Sensor", tempOccAsset.InstanceId);
- var occSensorShutdownMinutes = FusionRoom.CreateOffsetUshortSig(70, "Occ Shutdown - Minutes", eSigIoMask.InputOutputSig);
-
- // Tie to method on occupancy object
- //occSensorShutdownMinutes.OutputSig.UserObject(new Action(ushort)(b => Room.OccupancyObj.SetShutdownMinutes(b));
+ occSensorAsset.RoomOccupied.AddSigToRVIFile = true;
+
+ //var occSensorShutdownMinutes = FusionRoom.CreateOffsetUshortSig(70, "Occ Shutdown - Minutes", eSigIoMask.InputOutputSig);
+
+ // Tie to method on occupancy object
+ //occSensorShutdownMinutes.OutputSig.UserObject(new Action(ushort)(b => Room.OccupancyObj.SetShutdownMinutes(b));
- RoomOccupancyRemoteStringFeedback = new StringFeedback(() => _roomOccupancyRemoteString);
- Room.RoomOccupancy.RoomIsOccupiedFeedback.LinkInputSig(occSensorAsset.RoomOccupied.InputSig);
- Room.RoomOccupancy.RoomIsOccupiedFeedback.OutputChange += RoomIsOccupiedFeedback_OutputChange;
- RoomOccupancyRemoteStringFeedback.LinkInputSig(occSensorAsset.RoomOccupancyInfo.InputSig);
-
+ RoomOccupancyRemoteStringFeedback = new StringFeedback(() => _roomOccupancyRemoteString);
+ Room.RoomOccupancy.RoomIsOccupiedFeedback.LinkInputSig(occSensorAsset.RoomOccupied.InputSig);
+ Room.RoomOccupancy.RoomIsOccupiedFeedback.OutputChange += RoomIsOccupiedFeedback_OutputChange;
+ RoomOccupancyRemoteStringFeedback.LinkInputSig(occSensorAsset.RoomOccupancyInfo.InputSig);
+
//}
}
- void RoomIsOccupiedFeedback_OutputChange(object sender, FeedbackEventArgs e)
+ private void RoomIsOccupiedFeedback_OutputChange(object sender, FeedbackEventArgs e)
{
_roomOccupancyRemoteString = String.Format(RemoteOccupancyXml, e.BoolValue ? "Occupied" : "Unoccupied");
RoomOccupancyRemoteStringFeedback.FireUpdate();
}
- ///
- /// Helper to get the number from the end of a device's key string
- ///
- /// -1 if no number matched
- int ExtractNumberFromKey(string key)
- {
- var capture = System.Text.RegularExpressions.Regex.Match(key, @"\b(\d+)");
- if (!capture.Success)
- return -1;
- else return Convert.ToInt32(capture.Groups[1].Value);
- }
-
- ///
- /// Event handler for when room source changes
- ///
- protected void Room_CurrentSourceInfoChange(SourceListItem info, ChangeType type)
- {
- // Handle null. Nothing to do when switching from or to null
- if (info == null || info.SourceDevice == null)
- return;
-
- var dev = info.SourceDevice;
- if (type == ChangeType.WillChange)
- {
- if (SourceToFeedbackSigs.ContainsKey(dev))
- SourceToFeedbackSigs[dev].BoolValue = false;
- }
- else
- {
- if (SourceToFeedbackSigs.ContainsKey(dev))
- SourceToFeedbackSigs[dev].BoolValue = true;
- //var name = (room == null ? "" : room.Name);
- CurrentRoomSourceNameSig.InputSig.StringValue = info.SourceDevice.Name;
- }
- }
-
- protected void FusionRoom_FusionStateChange(FusionBase device, FusionStateEventArgs args)
- {
-
- // The sig/UO method: Need separate handlers for fixed and user sigs, all flavors,
- // even though they all contain sigs.
-
- var sigData = (args.UserConfiguredSigDetail as BooleanSigDataFixedName);
- if (sigData != null)
- {
- var outSig = sigData.OutputSig;
- if (outSig.UserObject is Action)
- (outSig.UserObject as Action).Invoke(outSig.BoolValue);
- else if (outSig.UserObject is Action)
- (outSig.UserObject as Action).Invoke(outSig.UShortValue);
- else if (outSig.UserObject is Action)
- (outSig.UserObject as Action).Invoke(outSig.StringValue);
- return;
- }
-
- var attrData = (args.UserConfiguredSigDetail as BooleanSigData);
- if (attrData != null)
- {
- var outSig = attrData.OutputSig;
- if (outSig.UserObject is Action)
- (outSig.UserObject as Action).Invoke(outSig.BoolValue);
- else if (outSig.UserObject is Action)
- (outSig.UserObject as Action).Invoke(outSig.UShortValue);
- else if (outSig.UserObject is Action)
- (outSig.UserObject as Action).Invoke(outSig.StringValue);
- return;
- }
-
- }
- }
-
-
- public static class FusionRoomExtensions
- {
- ///
- /// Creates and returns a fusion attribute. The join number will match the established Simpl
- /// standard of 50+, and will generate a 50+ join in the RVI. It calls
- /// FusionRoom.AddSig with join number - 49
- ///
- /// The new attribute
- public static BooleanSigData CreateOffsetBoolSig(this FusionRoom fr, uint number, string name, eSigIoMask mask)
- {
- if (number < 50) throw new ArgumentOutOfRangeException("number", "Cannot be less than 50");
- number -= 49;
- fr.AddSig(eSigType.Bool, number, name, mask);
- return fr.UserDefinedBooleanSigDetails[number];
- }
-
- ///
- /// Creates and returns a fusion attribute. The join number will match the established Simpl
- /// standard of 50+, and will generate a 50+ join in the RVI. It calls
- /// FusionRoom.AddSig with join number - 49
- ///
- /// The new attribute
- public static UShortSigData CreateOffsetUshortSig(this FusionRoom fr, uint number, string name, eSigIoMask mask)
- {
- if (number < 50) throw new ArgumentOutOfRangeException("number", "Cannot be less than 50");
- number -= 49;
- fr.AddSig(eSigType.UShort, number, name, mask);
- return fr.UserDefinedUShortSigDetails[number];
- }
-
- ///
- /// Creates and returns a fusion attribute. The join number will match the established Simpl
- /// standard of 50+, and will generate a 50+ join in the RVI. It calls
- /// FusionRoom.AddSig with join number - 49
- ///
- /// The new attribute
- public static StringSigData CreateOffsetStringSig(this FusionRoom fr, uint number, string name, eSigIoMask mask)
- {
- if (number < 50) throw new ArgumentOutOfRangeException("number", "Cannot be less than 50");
- number -= 49;
- fr.AddSig(eSigType.String, number, name, mask);
- return fr.UserDefinedStringSigDetails[number];
- }
-
- ///
- /// Creates and returns a static asset
- ///
- /// the new asset
- public static FusionStaticAsset CreateStaticAsset(this FusionRoom fr, uint number, string name, string type, string instanceId)
- {
- Debug.Console(0, "Adding Fusion Static Asset '{0}' to slot {1} with GUID: '{2}'", name, number, instanceId);
-
- fr.AddAsset(eAssetType.StaticAsset, number, name, type, instanceId);
- return fr.UserConfigurableAssetDetails[number].Asset as FusionStaticAsset;
- }
-
- public static FusionOccupancySensor CreateOccupancySensorAsset(this FusionRoom fr, uint number, string name, string type, string instanceId)
+ ///
+ /// Helper to get the number from the end of a device's key string
+ ///
+ /// -1 if no number matched
+ private int ExtractNumberFromKey(string key)
{
- Debug.Console(0, "Adding Fusion Occupancy Sensor Asset '{0}' to slot {1} with GUID: '{2}'", name, number, instanceId);
-
- fr.AddAsset(eAssetType.OccupancySensor, number, name, type, instanceId);
- return fr.UserConfigurableAssetDetails[number].Asset as FusionOccupancySensor;
+ var capture = System.Text.RegularExpressions.Regex.Match(key, @"\b(\d+)");
+ if (!capture.Success)
+ {
+ return -1;
+ }
+ return Convert.ToInt32(capture.Groups[1].Value);
}
- }
- //************************************************************************************************
- ///
- /// Extensions to enhance Fusion room, asset and signal creation.
- ///
- public static class FusionStaticAssetExtensions
- {
- ///
- /// Tries to set a Fusion asset with the make and model of a device.
- /// If the provided Device is IMakeModel, will set the corresponding parameters on the fusion static asset.
- /// Otherwise, does nothing.
- ///
- public static void TrySetMakeModel(this FusionStaticAsset asset, Device device)
- {
- var mm = device as IMakeModel;
- if (mm != null)
- {
- asset.ParamMake.Value = mm.DeviceMake;
- asset.ParamModel.Value = mm.DeviceModel;
- }
- }
+ ///
+ /// Event handler for when room source changes
+ ///
+ protected void Room_CurrentSourceInfoChange(SourceListItem info, ChangeType type)
+ {
+ // Handle null. Nothing to do when switching from or to null
+ if (info == null || info.SourceDevice == null)
+ {
+ return;
+ }
- ///
- /// Tries to attach the AssetError input on a Fusion asset to a Device's
- /// CommunicationMonitor.StatusChange event. Does nothing if the device is not
- /// IStatusMonitor
- ///
- ///
- ///
- public static void TryLinkAssetErrorToCommunication(this FusionStaticAsset asset, Device device)
- {
- if (device is ICommunicationMonitor)
- {
- var monitor = (device as ICommunicationMonitor).CommunicationMonitor;
- monitor.StatusChange += (o, a) =>
- {
- // Link connected and error inputs on asset
- asset.Connected.InputSig.BoolValue = a.Status == MonitorStatus.IsOk;
- asset.AssetError.InputSig.StringValue = a.Status.ToString();
- };
- // set current value
- asset.Connected.InputSig.BoolValue = monitor.Status == MonitorStatus.IsOk;
- asset.AssetError.InputSig.StringValue = monitor.Status.ToString();
- }
- }
- }
+ var dev = info.SourceDevice;
+ if (type == ChangeType.WillChange)
+ {
+ if (_sourceToFeedbackSigs.ContainsKey(dev))
+ {
+ _sourceToFeedbackSigs[dev].BoolValue = false;
+ }
+ }
+ else
+ {
+ if (_sourceToFeedbackSigs.ContainsKey(dev))
+ {
+ _sourceToFeedbackSigs[dev].BoolValue = true;
+ }
+ //var name = (room == null ? "" : room.Name);
+ CurrentRoomSourceNameSig.InputSig.StringValue = info.SourceDevice.Name;
+ }
+ }
+
+ protected void FusionRoom_FusionStateChange(FusionBase device, FusionStateEventArgs args)
+ {
+ // The sig/UO method: Need separate handlers for fixed and user sigs, all flavors,
+ // even though they all contain sigs.
+
+ var sigData = args.UserConfiguredSigDetail as BooleanSigDataFixedName;
+
+ BoolOutputSig outSig;
+ if (sigData != null)
+ {
+ outSig = sigData.OutputSig;
+ if (outSig.UserObject is Action)
+ {
+ (outSig.UserObject as Action).Invoke(outSig.BoolValue);
+ }
+ else if (outSig.UserObject is Action)
+ {
+ (outSig.UserObject as Action).Invoke(outSig.UShortValue);
+ }
+ else if (outSig.UserObject is Action)
+ {
+ (outSig.UserObject as Action).Invoke(outSig.StringValue);
+ }
+ return;
+ }
+
+ var attrData = (args.UserConfiguredSigDetail as BooleanSigData);
+ if (attrData == null)
+ {
+ return;
+ }
+ outSig = attrData.OutputSig;
+ if (outSig.UserObject is Action)
+ {
+ (outSig.UserObject as Action).Invoke(outSig.BoolValue);
+ }
+ else if (outSig.UserObject is Action)
+ {
+ (outSig.UserObject as Action).Invoke(outSig.UShortValue);
+ }
+ else if (outSig.UserObject is Action)
+ {
+ (outSig.UserObject as Action).Invoke(outSig.StringValue);
+ }
+ }
+ }
+
+
+ public static class FusionRoomExtensions
+ {
+ ///
+ /// Creates and returns a fusion attribute. The join number will match the established Simpl
+ /// standard of 50+, and will generate a 50+ join in the RVI. It calls
+ /// FusionRoom.AddSig with join number - 49
+ ///
+ /// The new attribute
+ public static BooleanSigData CreateOffsetBoolSig(this FusionRoom fr, uint number, string name, eSigIoMask mask)
+ {
+ if (number < 50)
+ {
+ throw new ArgumentOutOfRangeException("number", "Cannot be less than 50");
+ }
+ number -= 49;
+ fr.AddSig(eSigType.Bool, number, name, mask);
+ return fr.UserDefinedBooleanSigDetails[number];
+ }
+
+ ///
+ /// Creates and returns a fusion attribute. The join number will match the established Simpl
+ /// standard of 50+, and will generate a 50+ join in the RVI. It calls
+ /// FusionRoom.AddSig with join number - 49
+ ///
+ /// The new attribute
+ public static UShortSigData CreateOffsetUshortSig(this FusionRoom fr, uint number, string name, eSigIoMask mask)
+ {
+ if (number < 50)
+ {
+ throw new ArgumentOutOfRangeException("number", "Cannot be less than 50");
+ }
+ number -= 49;
+ fr.AddSig(eSigType.UShort, number, name, mask);
+ return fr.UserDefinedUShortSigDetails[number];
+ }
+
+ ///
+ /// Creates and returns a fusion attribute. The join number will match the established Simpl
+ /// standard of 50+, and will generate a 50+ join in the RVI. It calls
+ /// FusionRoom.AddSig with join number - 49
+ ///
+ /// The new attribute
+ public static StringSigData CreateOffsetStringSig(this FusionRoom fr, uint number, string name, eSigIoMask mask)
+ {
+ if (number < 50)
+ {
+ throw new ArgumentOutOfRangeException("number", "Cannot be less than 50");
+ }
+ number -= 49;
+ fr.AddSig(eSigType.String, number, name, mask);
+ return fr.UserDefinedStringSigDetails[number];
+ }
+
+ ///
+ /// Creates and returns a static asset
+ ///
+ /// the new asset
+ public static FusionStaticAsset CreateStaticAsset(this FusionRoom fr, uint number, string name, string type,
+ string instanceId)
+ {
+ try
+ {
+ Debug.Console(0, "Adding Fusion Static Asset '{0}' to slot {1} with GUID: '{2}'", name, number, instanceId);
+
+ fr.AddAsset(eAssetType.StaticAsset, number, name, type, instanceId);
+ return fr.UserConfigurableAssetDetails[number].Asset as FusionStaticAsset;
+ }
+ catch (InvalidOperationException ex)
+ {
+ Debug.Console(0, Debug.ErrorLogLevel.Notice, "Error creating Static Asset for device: '{0}'. Check that multiple devices don't have missing or duplicate uid properties in configuration. /r/nError: {1}", name, ex);
+ return null;
+ }
+ catch (Exception e)
+ {
+ Debug.Console(2, Debug.ErrorLogLevel.Error, "Error creating Static Asset: {0}", e);
+ return null;
+ }
+ }
+
+ public static FusionOccupancySensor CreateOccupancySensorAsset(this FusionRoom fr, uint number, string name,
+ string type, string instanceId)
+ {
+ try
+ {
+ Debug.Console(0, "Adding Fusion Occupancy Sensor Asset '{0}' to slot {1} with GUID: '{2}'", name, number,
+ instanceId);
+
+ fr.AddAsset(eAssetType.OccupancySensor, number, name, type, instanceId);
+ return fr.UserConfigurableAssetDetails[number].Asset as FusionOccupancySensor;
+ }
+ catch (InvalidOperationException ex)
+ {
+ Debug.Console(0, Debug.ErrorLogLevel.Notice, "Error creating Static Asset for device: '{0}'. Check that multiple devices don't have missing or duplicate uid properties in configuration. Error: {1}", name, ex);
+ return null;
+ }
+ catch (Exception e)
+ {
+ Debug.Console(2, Debug.ErrorLogLevel.Error, "Error creating Static Asset: {0}", e);
+ return null;
+ }
+ }
+ }
+
+ //************************************************************************************************
+ ///
+ /// Extensions to enhance Fusion room, asset and signal creation.
+ ///
+ public static class FusionStaticAssetExtensions
+ {
+ ///
+ /// Tries to set a Fusion asset with the make and model of a device.
+ /// If the provided Device is IMakeModel, will set the corresponding parameters on the fusion static asset.
+ /// Otherwise, does nothing.
+ ///
+ public static void TrySetMakeModel(this FusionStaticAsset asset, Device device)
+ {
+ var mm = device as IMakeModel;
+ if (mm != null)
+ {
+ asset.ParamMake.Value = mm.DeviceMake;
+ asset.ParamModel.Value = mm.DeviceModel;
+ }
+ }
+
+ ///
+ /// Tries to attach the AssetError input on a Fusion asset to a Device's
+ /// CommunicationMonitor.StatusChange event. Does nothing if the device is not
+ /// IStatusMonitor
+ ///
+ ///
+ ///
+ public static void TryLinkAssetErrorToCommunication(this FusionStaticAsset asset, Device device)
+ {
+ if (device is ICommunicationMonitor)
+ {
+ var monitor = (device as ICommunicationMonitor).CommunicationMonitor;
+ monitor.StatusChange += (o, a) =>
+ {
+ // Link connected and error inputs on asset
+ asset.Connected.InputSig.BoolValue = a.Status == MonitorStatus.IsOk;
+ asset.AssetError.InputSig.StringValue = a.Status.ToString();
+ };
+ // set current value
+ asset.Connected.InputSig.BoolValue = monitor.Status == MonitorStatus.IsOk;
+ asset.AssetError.InputSig.StringValue = monitor.Status.ToString();
+ }
+ }
+ }
public class RoomInformation
{
+ public RoomInformation()
+ {
+ FusionCustomProperties = new List();
+ }
+
public string ID { get; set; }
public string Name { get; set; }
public string Location { get; set; }
@@ -1598,27 +1796,22 @@ namespace PepperDash.Essentials.Core.Fusion
public string SubErrorMsg { get; set; }
public string EmailInfo { get; set; }
public List FusionCustomProperties { get; set; }
-
- public RoomInformation()
- {
- FusionCustomProperties = new List();
- }
}
+
public class FusionCustomProperty
{
- public string ID { get; set; }
- public string CustomFieldName { get; set; }
- public string CustomFieldType { get; set; }
- public string CustomFieldValue { get; set; }
-
public FusionCustomProperty()
{
-
}
public FusionCustomProperty(string id)
{
ID = id;
}
+
+ public string ID { get; set; }
+ public string CustomFieldName { get; set; }
+ public string CustomFieldType { get; set; }
+ public string CustomFieldValue { get; set; }
}
}
\ No newline at end of file
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Fusion/EssentialsHuddleSpaceRoomFusionRoomJoinMap.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Fusion/EssentialsHuddleSpaceRoomFusionRoomJoinMap.cs
new file mode 100644
index 00000000..33f2fe1b
--- /dev/null
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Fusion/EssentialsHuddleSpaceRoomFusionRoomJoinMap.cs
@@ -0,0 +1,150 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Crestron.SimplSharp;
+
+using PepperDash.Essentials.Core.Bridges;
+
+
+namespace PepperDash.Essentials.Core.Fusion
+{
+ public class EssentialsHuddleSpaceRoomFusionRoomJoinMap : JoinMapBaseAdvanced
+ {
+
+ // Processor Attributes
+ [JoinName("ProcessorIp1")]
+ public JoinDataComplete ProcessorIp1 = new JoinDataComplete(new JoinData { JoinNumber = 50, JoinSpan = 1, AttributeName = "Info - Processor - IP 1" },
+ new JoinMetadata { Description = "Info - Processor - IP 1", JoinCapabilities = eJoinCapabilities.ToFusion, JoinType = eJoinType.Serial });
+
+ [JoinName("ProcessorIp2")]
+ public JoinDataComplete ProcessorIp2 = new JoinDataComplete(new JoinData { JoinNumber = 51, JoinSpan = 1, AttributeName = "Info - Processor - IP 2" },
+ new JoinMetadata { Description = "Info - Processor - IP 2", JoinCapabilities = eJoinCapabilities.ToFusion, JoinType = eJoinType.Serial });
+
+ [JoinName("ProcessorGateway")]
+ public JoinDataComplete ProcessorGateway = new JoinDataComplete(new JoinData { JoinNumber = 52, JoinSpan = 1, AttributeName = "Info - Processor - Gateway" },
+ new JoinMetadata { Description = "Info - Processor - Gateway", JoinCapabilities = eJoinCapabilities.ToFusion, JoinType = eJoinType.Serial });
+
+ [JoinName("ProcessorHostname")]
+ public JoinDataComplete ProcessorHostname = new JoinDataComplete(new JoinData { JoinNumber = 53, JoinSpan = 1, AttributeName = "Info - Processor - Hostname" },
+ new JoinMetadata { Description = "Info - Processor - Hostname", JoinCapabilities = eJoinCapabilities.ToFusion, JoinType = eJoinType.Serial });
+
+ [JoinName("ProcessorDomain")]
+ public JoinDataComplete ProcessorDomain = new JoinDataComplete(new JoinData { JoinNumber = 54, JoinSpan = 1, AttributeName = "Info - Processor - Domain" },
+ new JoinMetadata { Description = "Info - Processor - Domain", JoinCapabilities = eJoinCapabilities.ToFusion, JoinType = eJoinType.Serial });
+
+ [JoinName("ProcessorDns1")]
+ public JoinDataComplete ProcessorDns1 = new JoinDataComplete(new JoinData { JoinNumber = 55, JoinSpan = 1, AttributeName = "Info - Processor - DNS 1" },
+ new JoinMetadata { Description = "Info - Processor - DNS 1", JoinCapabilities = eJoinCapabilities.ToFusion, JoinType = eJoinType.Serial });
+
+ [JoinName("ProcessorDns2")]
+ public JoinDataComplete ProcessorDns2 = new JoinDataComplete(new JoinData { JoinNumber = 56, JoinSpan = 1, AttributeName = "Info - Processor - DNS 2" },
+ new JoinMetadata { Description = "Info - Processor - DNS 2", JoinCapabilities = eJoinCapabilities.ToFusion, JoinType = eJoinType.Serial });
+
+ [JoinName("ProcessorMac1")]
+ public JoinDataComplete ProcessorMac1 = new JoinDataComplete(new JoinData { JoinNumber = 57, JoinSpan = 1, AttributeName = "Info - Processor - MAC 1" },
+ new JoinMetadata { Description = "Info - Processor - MAC 1", JoinCapabilities = eJoinCapabilities.ToFusion, JoinType = eJoinType.Serial });
+
+ [JoinName("ProcessorMac2")]
+ public JoinDataComplete ProcessorMac2 = new JoinDataComplete(new JoinData { JoinNumber = 58, JoinSpan = 1, AttributeName = "Info - Processor - MAC 2" },
+ new JoinMetadata { Description = "Info - Processor - MAC 2", JoinCapabilities = eJoinCapabilities.ToFusion, JoinType = eJoinType.Serial });
+
+ [JoinName("ProcessorNetMask1")]
+ public JoinDataComplete ProcessorNetMask1 = new JoinDataComplete(new JoinData { JoinNumber = 59, JoinSpan = 1, AttributeName = "Info - Processor - Net Mask 1" },
+ new JoinMetadata { Description = "Info - Processor - Net Mask 1", JoinCapabilities = eJoinCapabilities.ToFusion, JoinType = eJoinType.Serial });
+
+ [JoinName("ProcessorNetMask2")]
+ public JoinDataComplete ProcessorNetMask2 = new JoinDataComplete(new JoinData { JoinNumber = 60, JoinSpan = 1, AttributeName = "Info - Processor - Net Mask 2" },
+ new JoinMetadata { Description = "Info - Processor - Net Mask 2", JoinCapabilities = eJoinCapabilities.ToFusion, JoinType = eJoinType.Serial });
+
+ [JoinName("ProcessorFirmware")]
+ public JoinDataComplete ProcessorFirmware = new JoinDataComplete(new JoinData { JoinNumber = 61, JoinSpan = 1, AttributeName = "Info - Processor - Firmware" },
+ new JoinMetadata { Description = "Info - Processor - Firmware", JoinCapabilities = eJoinCapabilities.ToFusion, JoinType = eJoinType.Serial });
+
+ [JoinName("ProgramNameStart")]
+ public JoinDataComplete ProgramNameStart = new JoinDataComplete(new JoinData { JoinNumber = 62, JoinSpan = 10, AttributeName = "Info - Processor - Program" },
+ new JoinMetadata { Description = "Info - Processor - Program", JoinCapabilities = eJoinCapabilities.ToFusion, JoinType = eJoinType.Serial });
+
+ [JoinName("ProcessorReboot")]
+ public JoinDataComplete ProcessorReboot = new JoinDataComplete(new JoinData { JoinNumber = 74, JoinSpan = 1, AttributeName = "Processor - Reboot" },
+ new JoinMetadata { Description = "Processor - Reboot", JoinCapabilities = eJoinCapabilities.FromFusion, JoinType = eJoinType.Digital });
+
+ // Volume Controls
+ [JoinName("VolumeFader1")]
+ public JoinDataComplete VolumeFader1 = new JoinDataComplete(new JoinData { JoinNumber = 50, JoinSpan = 1, AttributeName = "Volume - Fader01" },
+ new JoinMetadata { Description = "Volume - Fader01", JoinCapabilities = eJoinCapabilities.ToFromFusion, JoinType = eJoinType.Analog });
+
+ // Codec Info
+ [JoinName("VcCodecInCall")]
+ public JoinDataComplete VcCodecInCall = new JoinDataComplete(new JoinData { JoinNumber = 69, JoinSpan = 1, AttributeName = "Conf - VC 1 In Call" },
+ new JoinMetadata { Description = "Conf - VC 1 In Call", JoinCapabilities = eJoinCapabilities.ToFusion, JoinType = eJoinType.Digital });
+
+ [JoinName("VcCodecOnline")]
+ public JoinDataComplete VcCodecOnline = new JoinDataComplete(new JoinData { JoinNumber = 122, JoinSpan = 1, AttributeName = "Online - VC 1" },
+ new JoinMetadata { Description = "Online - VC 1", JoinCapabilities = eJoinCapabilities.ToFusion, JoinType = eJoinType.Digital });
+
+ [JoinName("VcCodecIpAddress")]
+ public JoinDataComplete VcCodecIpAddress = new JoinDataComplete(new JoinData { JoinNumber = 121, JoinSpan = 1, AttributeName = "IP Address - VC" },
+ new JoinMetadata { Description = "IP Address - VC", JoinCapabilities = eJoinCapabilities.ToFusion, JoinType = eJoinType.Serial });
+
+ [JoinName("VcCodecIpPort")]
+ public JoinDataComplete VcCodecIpPort = new JoinDataComplete(new JoinData { JoinNumber = 150, JoinSpan = 1, AttributeName = "IP Port - VC" },
+ new JoinMetadata { Description = "IP Port - VC", JoinCapabilities = eJoinCapabilities.ToFusion, JoinType = eJoinType.Serial });
+
+ // Source Attributes
+ [JoinName("Display1CurrentSourceName")]
+ public JoinDataComplete Display1CurrentSourceName = new JoinDataComplete(new JoinData { JoinNumber = 84, JoinSpan = 1, AttributeName = "Display 1 - Current Source" },
+ new JoinMetadata { Description = "Display 1 - Current Source", JoinCapabilities = eJoinCapabilities.ToFusion, JoinType = eJoinType.Serial });
+
+
+ // Device Online Status
+ [JoinName("TouchpanelOnlineStart")]
+ public JoinDataComplete TouchpanelOnlineStart = new JoinDataComplete(new JoinData { JoinNumber = 150, JoinSpan = 10, AttributeName = "Online - Touch Panel" },
+ new JoinMetadata { Description = "Online - Touch Panel", JoinCapabilities = eJoinCapabilities.ToFusion, JoinType = eJoinType.Digital });
+
+ [JoinName("XpanelOnlineStart")]
+ public JoinDataComplete XpanelOnlineStart = new JoinDataComplete(new JoinData { JoinNumber = 160, JoinSpan = 5, AttributeName = "Online - XPanel" },
+ new JoinMetadata { Description = "Online - XPanel", JoinCapabilities = eJoinCapabilities.ToFusion, JoinType = eJoinType.Digital });
+
+ [JoinName("DisplayOnlineStart")]
+ public JoinDataComplete DisplayOnlineStart = new JoinDataComplete(new JoinData { JoinNumber = 170, JoinSpan = 10, AttributeName = "Online - Display" },
+ new JoinMetadata { Description = "Online - Display", JoinCapabilities = eJoinCapabilities.ToFusion, JoinType = eJoinType.Digital });
+
+ [JoinName("Display1LaptopSourceStart")]
+ public JoinDataComplete Display1LaptopSourceStart = new JoinDataComplete(new JoinData { JoinNumber = 166, JoinSpan = 5, AttributeName = "Display 1 - Source Laptop" },
+ new JoinMetadata { Description = "Display 1 - Source Laptop", JoinCapabilities = eJoinCapabilities.ToFromFusion, JoinType = eJoinType.Digital });
+
+ [JoinName("Display1DiscPlayerSourceStart")]
+ public JoinDataComplete Display1DiscPlayerSourceStart = new JoinDataComplete(new JoinData { JoinNumber = 181, JoinSpan = 5, AttributeName = "Display 1 - Source Disc Player" },
+ new JoinMetadata { Description = "Display 1 - Source Disc Player", JoinCapabilities = eJoinCapabilities.ToFromFusion, JoinType = eJoinType.Digital });
+
+ [JoinName("Display1SetTopBoxSourceStart")]
+ public JoinDataComplete Display1SetTopBoxSourceStart = new JoinDataComplete(new JoinData { JoinNumber = 188, JoinSpan = 5, AttributeName = "Display 1 - Source TV" },
+ new JoinMetadata { Description = "Display 1 - Source TV", JoinCapabilities = eJoinCapabilities.ToFromFusion, JoinType = eJoinType.Digital });
+
+ // Display 1
+ [JoinName("Display1Start")]
+ public JoinDataComplete Display1Start = new JoinDataComplete(new JoinData { JoinNumber = 158, JoinSpan = 1 },
+ new JoinMetadata { Description = "Display 1 Start", JoinCapabilities = eJoinCapabilities.ToFromFusion, JoinType = eJoinType.Digital });
+
+
+ ///
+ /// Constructor to use when instantiating this Join Map without inheriting from it
+ ///
+ /// Join this join map will start at
+ public EssentialsHuddleSpaceRoomFusionRoomJoinMap(uint joinStart)
+ : base(joinStart, typeof(EssentialsHuddleSpaceRoomFusionRoomJoinMap))
+ {
+
+ }
+
+ ///
+ /// Constructor to use when extending this Join map
+ ///
+ /// Join this join map will start at
+ /// Type of the child join map
+ public EssentialsHuddleSpaceRoomFusionRoomJoinMap(uint joinStart, Type type) : base(joinStart, type)
+ {
+ }
+ }
+}
\ No newline at end of file
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Fusion/FusionCustomPropertiesBridge.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Fusion/FusionCustomPropertiesBridge.cs
index 01b230f9..89b9fcdb 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Fusion/FusionCustomPropertiesBridge.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Fusion/FusionCustomPropertiesBridge.cs
@@ -82,7 +82,7 @@ namespace PepperDash.Essentials.Core.Fusion
deviceConfig.Properties = JToken.FromObject(devProps);
}
- else if (device is EssentialsRoomBase)
+ else if (device is IEssentialsRoom)
{
// Set the room name
if (!string.IsNullOrEmpty(roomInfo.Name))
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Gateways/CenRfgwController.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Gateways/CenRfgwController.cs
index fb7968d9..03e8f51d 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Gateways/CenRfgwController.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Gateways/CenRfgwController.cs
@@ -10,9 +10,7 @@ using Crestron.SimplSharpPro.DeviceSupport;
using PepperDash.Core;
-using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Config;
-using PepperDash_Essentials_Core;
namespace PepperDash.Essentials.Core
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Global/Global.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Global/Global.cs
index 4a846df7..9d792437 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Global/Global.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Global/Global.cs
@@ -1,5 +1,6 @@
using System;
using System.Text.RegularExpressions;
+using System.Globalization;
using Crestron.SimplSharp;
using System.Collections.Generic;
using Crestron.SimplSharp.CrestronIO;
@@ -26,6 +27,33 @@ namespace PepperDash.Essentials.Core
public static LicenseManager LicenseManager { get; set; }
+ public static eCrestronSeries ProcessorSeries { get { return CrestronEnvironment.ProgramCompatibility; } }
+
+ // TODO: consider making this configurable later
+ public static IFormatProvider Culture = CultureInfo.CreateSpecificCulture("en-US");
+
+ ///
+ /// True when the processor type is a DMPS variant
+ ///
+ public static bool ControlSystemIsDmpsType
+ {
+ get
+ {
+ return ControlSystem.ControllerPrompt.ToLower().IndexOf("dmps") > -1;
+ }
+ }
+
+ ///
+ /// True when the processor type is a DMPS 4K variant
+ ///
+ public static bool ControlSystemIsDmps4kType
+ {
+ get
+ {
+ return ControlSystemIsDmpsType && ControlSystem.ControllerPrompt.ToLower().IndexOf("4k") > -1;
+ }
+ }
+
///
/// The file path prefix to the folder containing configuration files
///
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Global/Scheduler.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Global/Scheduler.cs
index a7b721ef..960a56ef 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Global/Scheduler.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Global/Scheduler.cs
@@ -1,11 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using System.Text;
using Crestron.SimplSharp;
+using Crestron.SimplSharp.Reflection;
using Crestron.SimplSharp.Scheduler;
using PepperDash.Core;
+using PepperDash.Essentials.Core.Fusion;
+using PepperDash.Essentials.Room.Config;
+using Activator = System.Activator;
namespace PepperDash.Essentials.Core
{
@@ -14,13 +17,17 @@ namespace PepperDash.Essentials.Core
///
public static class Scheduler
{
- private static Dictionary EventGroups = new Dictionary();
+ private static readonly Dictionary EventGroups = new Dictionary();
static Scheduler()
{
CrestronConsole.AddNewConsoleCommand(ClearEventsFromGroup, "ClearAllEvents", "Clears all scheduled events for this group", ConsoleAccessLevelEnum.AccessOperator);
CrestronConsole.AddNewConsoleCommand(ListAllEventGroups, "ListAllEventGroups", "Lists all the event groups by key", ConsoleAccessLevelEnum.AccessOperator);
+
+ CrestronConsole.AddNewConsoleCommand(ListAllEventsForGroup, "ListEventsForGroup",
+ "Lists all events for the given group", ConsoleAccessLevelEnum.AccessOperator);
+
}
///
@@ -29,12 +36,26 @@ namespace PepperDash.Essentials.Core
///
static void ClearEventsFromGroup(string groupName)
{
+ if (!EventGroups.ContainsKey(groupName))
+ {
+ Debug.Console(0,
+ "[Scheduler]: Unable to delete events from group '{0}'. Group not found in EventGroups dictionary.",
+ groupName);
+ return;
+ }
+
var group = EventGroups[groupName];
if (group != null)
+ {
group.ClearAllEvents();
+
+ Debug.Console(0, "[Scheduler]: All events deleted from group '{0}'", groupName);
+ }
else
- Debug.Console(0, "[Scheduler]: Unable to delete events from group '{0}'. Group not found in EventGroups dictionary.", groupName);
+ Debug.Console(0,
+ "[Scheduler]: Unable to delete events from group '{0}'. Group not found in EventGroups dictionary.",
+ groupName);
}
static void ListAllEventGroups(string command)
@@ -46,10 +67,36 @@ namespace PepperDash.Essentials.Core
}
}
+ static void ListAllEventsForGroup(string args)
+ {
+ Debug.Console(0, "Getting events for group {0}...", args);
+
+ ScheduledEventGroup group;
+
+ if (!EventGroups.TryGetValue(args, out group))
+ {
+ Debug.Console(0, "Unabled to get event group for key {0}", args);
+ return;
+ }
+
+ foreach (var evt in group.ScheduledEvents)
+ {
+ Debug.Console(0,
+ @"
+****Event key {0}****
+Event date/time: {1}
+Persistent: {2}
+Acknowlegable: {3}
+Recurrence: {4}
+Recurrence Days: {5}
+********************", evt.Key, evt.Value.DateAndTime, evt.Value.Persistent, evt.Value.Acknowledgeable,
+ evt.Value.Recurrence.Recurrence, evt.Value.Recurrence.RecurrenceDays);
+ }
+ }
+
///
/// Adds the event group to the global list
///
- ///
///
public static void AddEventGroup(ScheduledEventGroup eventGroup)
{
@@ -67,6 +114,13 @@ namespace PepperDash.Essentials.Core
if(!EventGroups.ContainsKey(eventGroup.Name))
EventGroups.Remove(eventGroup.Name);
}
+
+ public static ScheduledEventGroup GetEventGroup(string key)
+ {
+ ScheduledEventGroup returnValue;
+
+ return EventGroups.TryGetValue(key, out returnValue) ? returnValue : null;
+ }
}
public static class SchedulerUtilities
@@ -135,5 +189,90 @@ namespace PepperDash.Essentials.Core
return isMatch;
}
+
+ public static bool CheckEventTimeForMatch(ScheduledEvent evnt, DateTime time)
+ {
+ return evnt.DateAndTime.Hour == time.Hour && evnt.DateAndTime.Minute == time.Minute;
+ }
+
+ public static bool CheckEventRecurrenceForMatch(ScheduledEvent evnt, ScheduledEventCommon.eWeekDays days)
+ {
+ return evnt.Recurrence.RecurrenceDays == days;
+ }
+
+ public static void CreateEventFromConfig(ScheduledEventConfig config, ScheduledEventGroup group, ScheduledEvent.UserEventCallBack handler)
+ {
+ if (group == null)
+ {
+ Debug.Console(0, "Unable to create event. Group is null");
+ return;
+ }
+ var scheduledEvent = new ScheduledEvent(config.Key, group)
+ {
+ Acknowledgeable = config.Acknowledgeable,
+ Persistent = config.Persistent
+ };
+
+ scheduledEvent.UserCallBack += handler;
+
+ scheduledEvent.DateAndTime.SetFirstDayOfWeek(ScheduledEventCommon.eFirstDayOfWeek.Sunday);
+
+ var eventTime = DateTime.Parse(config.Time);
+
+ if (DateTime.Now > eventTime)
+ {
+ eventTime = eventTime.AddDays(1);
+ }
+
+ Debug.Console(2, "[Scheduler] Current Date day of week: {0} recurrence days: {1}", eventTime.DayOfWeek,
+ config.Days);
+
+ var dayOfWeekConverted = ConvertDayOfWeek(eventTime);
+
+ Debug.Console(1, "[Scheduler] eventTime Day: {0}", dayOfWeekConverted);
+
+ while (!dayOfWeekConverted.IsFlagSet(config.Days))
+ {
+ eventTime = eventTime.AddDays(1);
+
+ dayOfWeekConverted = ConvertDayOfWeek(eventTime);
+ }
+
+ scheduledEvent.DateAndTime.SetAbsoluteEventTime(eventTime);
+
+ scheduledEvent.Recurrence.Weekly(config.Days);
+
+ if (config.Enable)
+ {
+ scheduledEvent.Enable();
+ }
+ else
+ {
+ scheduledEvent.Disable();
+ }
+ }
+
+ private static ScheduledEventCommon.eWeekDays ConvertDayOfWeek(DateTime eventTime)
+ {
+ return (ScheduledEventCommon.eWeekDays) Enum.Parse(typeof(ScheduledEventCommon.eWeekDays), eventTime.DayOfWeek.ToString(), true);
+ }
+
+ private static bool IsFlagSet(this T value, T flag) where T : struct
+ {
+ CheckIsEnum(true);
+
+ var lValue = Convert.ToInt64(value);
+ var lFlag = Convert.ToInt64(flag);
+
+ return (lValue & lFlag) != 0;
+ }
+
+ private static void CheckIsEnum(bool withFlags)
+ {
+ if (!typeof(T).IsEnum)
+ throw new ArgumentException(string.Format("Type '{0}' is not an enum", typeof(T).FullName));
+ if (withFlags && !Attribute.IsDefined(typeof(T), typeof(FlagsAttribute)))
+ throw new ArgumentException(string.Format("Type '{0}' doesn't have the 'Flags' attribute", typeof(T).FullName));
+ }
}
}
\ No newline at end of file
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Interfaces/ILogStrings.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Interfaces/ILogStrings.cs
new file mode 100644
index 00000000..92557319
--- /dev/null
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Interfaces/ILogStrings.cs
@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Crestron.SimplSharp;
+using PepperDash.Core;
+
+namespace PepperDash.Essentials.Core.Interfaces
+{
+ public interface ILogStrings : IKeyed
+ {
+ ///
+ /// Defines a class that is capable of logging a string
+ ///
+ void SendToLog(IKeyed device, string logMessage);
+ }
+}
\ No newline at end of file
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Interfaces/ILogStringsWithLevel.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Interfaces/ILogStringsWithLevel.cs
new file mode 100644
index 00000000..c43c4e6c
--- /dev/null
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Interfaces/ILogStringsWithLevel.cs
@@ -0,0 +1,18 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Crestron.SimplSharp;
+using PepperDash.Core;
+
+namespace PepperDash.Essentials.Core.Interfaces
+{
+ public interface ILogStringsWithLevel : IKeyed
+ {
+ ///
+ /// Defines a class that is capable of logging a string with an int level
+ ///
+ void SendToLog(IKeyed device, Debug.ErrorLogLevel level,string logMessage);
+ }
+
+}
\ No newline at end of file
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/JoinMaps/JoinMapBase.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/JoinMaps/JoinMapBase.cs
index ad5df2e3..aa8e2e6d 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/JoinMaps/JoinMapBase.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/JoinMaps/JoinMapBase.cs
@@ -25,7 +25,7 @@ namespace PepperDash.Essentials.Core
var joinMap = ConfigReader.ConfigObject.JoinMaps[joinMapKey];
- return joinMap;
+ return joinMap.ToString();
}
///
@@ -45,16 +45,33 @@ namespace PepperDash.Essentials.Core
///
public static Dictionary TryGetJoinMapAdvancedForDevice(string joinMapKey)
{
- if (string.IsNullOrEmpty(joinMapKey))
+ try
+ {
+ if (string.IsNullOrEmpty(joinMapKey))
+ return null;
+
+ if (!ConfigReader.ConfigObject.JoinMaps.ContainsKey(joinMapKey))
+ {
+ Debug.Console(2, "No Join Map found in config with key: '{0}'", joinMapKey);
+ return null;
+ }
+
+ Debug.Console(2, "Attempting to load custom join map with key: {0}", joinMapKey);
+
+ var joinMapJToken = ConfigReader.ConfigObject.JoinMaps[joinMapKey];
+
+ if (joinMapJToken == null)
+ return null;
+
+ var joinMapData = joinMapJToken.ToObject>();
+
+ return joinMapData;
+ }
+ catch (Exception e)
+ {
+ Debug.Console(2, "Error getting join map for key: '{0}'. Error: {1}", joinMapKey, e);
return null;
-
- var joinMapSerialzed = ConfigReader.ConfigObject.JoinMaps[joinMapKey];
-
- if (joinMapSerialzed == null) return null;
-
- var joinMapData = JsonConvert.DeserializeObject>(joinMapSerialzed);
-
- return joinMapData;
+ }
}
}
@@ -216,7 +233,10 @@ namespace PepperDash.Essentials.Core
}
- PrintJoinMapInfo();
+ if (Debug.Level > 0)
+ {
+ PrintJoinMapInfo();
+ }
}
///
@@ -266,7 +286,7 @@ namespace PepperDash.Essentials.Core
@"Join Number: {0} | JoinSpan: '{1}' | Description: '{2}' | Type: '{3}' | Capabilities: '{4}'",
join.Value.JoinNumber,
join.Value.JoinSpan,
- String.IsNullOrEmpty(join.Value.Metadata.Description) ? join.Value.Metadata.Label: join.Value.Metadata.Description,
+ String.IsNullOrEmpty(join.Value.AttributeName) ? join.Value.Metadata.Label : join.Value.AttributeName,
join.Value.Metadata.JoinType.ToString(),
join.Value.Metadata.JoinCapabilities.ToString());
}
@@ -288,7 +308,7 @@ namespace PepperDash.Essentials.Core
}
else
{
- Debug.Console(2, "No mathcing key found in join map for: '{0}'", customJoinData.Key);
+ Debug.Console(2, "No matching key found in join map for: '{0}'", customJoinData.Key);
}
}
@@ -327,7 +347,10 @@ namespace PepperDash.Essentials.Core
None = 0,
ToSIMPL = 1,
FromSIMPL = 2,
- ToFromSIMPL = ToSIMPL | FromSIMPL
+ ToFromSIMPL = ToSIMPL | FromSIMPL,
+ ToFusion = 4,
+ FromFusion = 8,
+ ToFromFusion = ToFusion | FromFusion,
}
[Flags]
@@ -340,7 +363,7 @@ namespace PepperDash.Essentials.Core
DigitalAnalog = Digital | Analog,
DigitalSerial = Digital | Serial,
AnalogSerial = Analog | Serial,
- DigitalAnalogSerial = Digital | Analog | Serial
+ DigitalAnalogSerial = Digital | Analog | Serial,
}
///
@@ -394,7 +417,7 @@ namespace PepperDash.Essentials.Core
}
///
- /// Data describing the join. Can be
+ /// Data describing the join. Can be overridden from configuratino
///
public class JoinData
{
@@ -408,6 +431,11 @@ namespace PepperDash.Essentials.Core
///
[JsonProperty("joinSpan")]
public uint JoinSpan { get; set; }
+ ///
+ /// Fusion Attribute Name (optional)
+ ///
+ [JsonProperty("attributeName")]
+ public string AttributeName { get; set; }
}
///
@@ -419,6 +447,10 @@ namespace PepperDash.Essentials.Core
private JoinData _data;
public JoinMetadata Metadata { get; set; }
+ ///
+ /// To store some future information as you please
+ ///
+ public object UserObject { get; private set; }
public JoinDataComplete(JoinData data, JoinMetadata metadata)
{
@@ -449,6 +481,11 @@ namespace PepperDash.Essentials.Core
get { return _data.JoinSpan; }
}
+ public string AttributeName
+ {
+ get { return _data.AttributeName; }
+ }
+
public void SetCustomJoinData(JoinData customJoinData)
{
_data = customJoinData;
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Lighting/LightingBase.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Lighting/LightingBase.cs
index 1bf8aee8..0549985c 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Lighting/LightingBase.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Lighting/LightingBase.cs
@@ -1,83 +1,83 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Crestron.SimplSharp;
-using Crestron.SimplSharpPro;
-using Crestron.SimplSharpPro.DeviceSupport;
-using Newtonsoft.Json;
-using PepperDash.Core;
-using PepperDash.Essentials.Core.Bridges;
-
-namespace PepperDash.Essentials.Core.Lighting
-{
- public abstract class LightingBase : EssentialsBridgeableDevice, ILightingScenes
- {
- #region ILightingScenes Members
-
- public event EventHandler LightingSceneChange;
-
- public List LightingScenes { get; protected set; }
-
- public LightingScene CurrentLightingScene { get; protected set; }
-
- public IntFeedback CurrentLightingSceneFeedback { get; protected set; }
-
- #endregion
-
- protected LightingBase(string key, string name)
- : base(key, name)
- {
- LightingScenes = new List();
-
- CurrentLightingScene = new LightingScene();
- //CurrentLightingSceneFeedback = new IntFeedback(() => { return int.Parse(this.CurrentLightingScene.ID); });
- }
-
- public abstract void SelectScene(LightingScene scene);
-
- public void SimulateSceneSelect(string sceneName)
- {
- Debug.Console(1, this, "Simulating selection of scene '{0}'", sceneName);
-
- var scene = LightingScenes.FirstOrDefault(s => s.Name.Equals(sceneName));
-
- if (scene != null)
- {
- CurrentLightingScene = scene;
- OnLightingSceneChange();
- }
- }
-
- ///
- /// Sets the IsActive property on each scene and fires the LightingSceneChange event
- ///
- protected void OnLightingSceneChange()
- {
- foreach (var scene in LightingScenes)
- {
- if (scene == CurrentLightingScene)
- scene.IsActive = true;
-
- else
- scene.IsActive = false;
- }
-
- var handler = LightingSceneChange;
- if (handler != null)
- {
- handler(this, new LightingSceneChangeEventArgs(CurrentLightingScene));
- }
- }
-
- protected GenericLightingJoinMap LinkLightingToApi(LightingBase lightingDevice, BasicTriList trilist, uint joinStart,
- string joinMapKey, EiscApiAdvanced bridge)
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Crestron.SimplSharp;
+using Crestron.SimplSharpPro;
+using Crestron.SimplSharpPro.DeviceSupport;
+using Newtonsoft.Json;
+using PepperDash.Core;
+using PepperDash.Essentials.Core.Bridges;
+
+namespace PepperDash.Essentials.Core.Lighting
+{
+ public abstract class LightingBase : EssentialsBridgeableDevice, ILightingScenes
+ {
+ #region ILightingScenes Members
+
+ public event EventHandler LightingSceneChange;
+
+ public List LightingScenes { get; protected set; }
+
+ public LightingScene CurrentLightingScene { get; protected set; }
+
+ public IntFeedback CurrentLightingSceneFeedback { get; protected set; }
+
+ #endregion
+
+ protected LightingBase(string key, string name)
+ : base(key, name)
{
- var joinMap = new GenericLightingJoinMap(joinStart);
-
- var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
-
- if (!string.IsNullOrEmpty(joinMapSerialized))
+ LightingScenes = new List();
+
+ CurrentLightingScene = new LightingScene();
+ //CurrentLightingSceneFeedback = new IntFeedback(() => { return int.Parse(this.CurrentLightingScene.ID); });
+ }
+
+ public abstract void SelectScene(LightingScene scene);
+
+ public void SimulateSceneSelect(string sceneName)
+ {
+ Debug.Console(1, this, "Simulating selection of scene '{0}'", sceneName);
+
+ var scene = LightingScenes.FirstOrDefault(s => s.Name.Equals(sceneName));
+
+ if (scene != null)
+ {
+ CurrentLightingScene = scene;
+ OnLightingSceneChange();
+ }
+ }
+
+ ///
+ /// Sets the IsActive property on each scene and fires the LightingSceneChange event
+ ///
+ protected void OnLightingSceneChange()
+ {
+ foreach (var scene in LightingScenes)
+ {
+ if (scene == CurrentLightingScene)
+ scene.IsActive = true;
+
+ else
+ scene.IsActive = false;
+ }
+
+ var handler = LightingSceneChange;
+ if (handler != null)
+ {
+ handler(this, new LightingSceneChangeEventArgs(CurrentLightingScene));
+ }
+ }
+
+ protected GenericLightingJoinMap LinkLightingToApi(LightingBase lightingDevice, BasicTriList trilist, uint joinStart,
+ string joinMapKey, EiscApiAdvanced bridge)
+ {
+ var joinMap = new GenericLightingJoinMap(joinStart);
+
+ var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
+
+ if (!string.IsNullOrEmpty(joinMapSerialized))
joinMap = JsonConvert.DeserializeObject(joinMapSerialized);
if (bridge != null)
@@ -87,52 +87,62 @@ namespace PepperDash.Essentials.Core.Lighting
else
{
Debug.Console(0, this, "Please update config to use 'eiscapiadvanced' to get all join map features for this device.");
- }
-
- 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(1, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
+
+ Debug.Console(0, "Linking to Lighting Type {0}", lightingDevice.GetType().Name.ToString());
+
// GenericLighitng Actions & FeedBack
- trilist.SetUShortSigAction(joinMap.SelectScene.JoinNumber, u => lightingDevice.SelectScene(lightingDevice.LightingScenes[u]));
-
- var sceneIndex = 0;
- foreach (var scene in lightingDevice.LightingScenes)
+ trilist.SetUShortSigAction(joinMap.SelectScene.JoinNumber, u => lightingDevice.SelectScene(lightingDevice.LightingScenes[u]));
+
+ var sceneIndex = 0;
+ foreach (var scene in lightingDevice.LightingScenes)
{
- trilist.SetSigTrueAction((uint)(joinMap.SelectSceneDirect.JoinNumber + sceneIndex), () => lightingDevice.SelectScene(lightingDevice.LightingScenes[sceneIndex]));
+ var index1 = sceneIndex;
+ trilist.SetSigTrueAction((uint)(joinMap.SelectSceneDirect.JoinNumber + sceneIndex), () =>
+ {
+ var index = index1;
+ Debug.Console(2, this, "LightingDevice: sceneIndex: {0} index: {1} > inside action", index1, index);
+ lightingDevice.SelectScene(lightingDevice.LightingScenes[index]);
+ });
scene.IsActiveFeedback.LinkInputSig(trilist.BooleanInput[(uint)(joinMap.SelectSceneDirect.JoinNumber + sceneIndex)]);
- trilist.StringInput[(uint)(joinMap.SelectSceneDirect.JoinNumber + sceneIndex)].StringValue = scene.Name;
- trilist.BooleanInput[(uint)(joinMap.ButtonVisibility.JoinNumber + sceneIndex)].BoolValue = true;
- sceneIndex++;
- }
-
- return joinMap;
- }
-
- }
-
- public class LightingScene
- {
- public string Name { get; set; }
- public string ID { get; set; }
- bool _IsActive;
- public bool IsActive
- {
- get
- {
- return _IsActive;
- }
- set
- {
- _IsActive = value;
- IsActiveFeedback.FireUpdate();
- }
- }
- public BoolFeedback IsActiveFeedback { get; set; }
-
- public LightingScene()
- {
- IsActiveFeedback = new BoolFeedback(new Func(() => IsActive));
- }
- }
+ trilist.StringInput[(uint)(joinMap.SelectSceneDirect.JoinNumber + sceneIndex)].StringValue = scene.Name;
+ trilist.BooleanInput[(uint)(joinMap.ButtonVisibility.JoinNumber + sceneIndex)].BoolValue = true;
+ sceneIndex++;
+ }
+ return joinMap;
+ }
+
+ }
+
+ public class LightingScene
+ {
+ [JsonProperty("name", NullValueHandling = NullValueHandling.Ignore)]
+ public string Name { get; set; }
+ [JsonProperty("id", NullValueHandling = NullValueHandling.Ignore)]
+ public string ID { get; set; }
+ bool _IsActive;
+ [JsonProperty("isActive", NullValueHandling = NullValueHandling.Ignore)]
+ public bool IsActive
+ {
+ get
+ {
+ return _IsActive;
+ }
+ set
+ {
+ _IsActive = value;
+ IsActiveFeedback.FireUpdate();
+ }
+ }
+
+ [JsonIgnore]
+ public BoolFeedback IsActiveFeedback { get; set; }
+
+ public LightingScene()
+ {
+ IsActiveFeedback = new BoolFeedback(new Func(() => IsActive));
+ }
+ }
}
\ No newline at end of file
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Microphone Privacy/MicrophonePrivacyController.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Microphone Privacy/MicrophonePrivacyController.cs
index 0f15a02d..55b458a7 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Microphone Privacy/MicrophonePrivacyController.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Microphone Privacy/MicrophonePrivacyController.cs
@@ -88,11 +88,6 @@ namespace PepperDash.Essentials.Core.Privacy
else
Debug.Console(0, this, "Unable to add Red LED device");
- DeviceManager.AllDevicesActivated += (o, a) =>
- {
- CheckPrivacyMode();
- };
-
AddPostActivationAction(() => {
PrivacyDevice.PrivacyModeIsOnFeedback.OutputChange -= PrivacyModeIsOnFeedback_OutputChange;
PrivacyDevice.PrivacyModeIsOnFeedback.OutputChange += PrivacyModeIsOnFeedback_OutputChange;
@@ -103,6 +98,15 @@ namespace PepperDash.Essentials.Core.Privacy
return base.CustomActivate();
}
+ #region Overrides of Device
+
+ public override void Initialize()
+ {
+ CheckPrivacyMode();
+ }
+
+ #endregion
+
public void SetPrivacyDevice(IPrivacy privacyDevice)
{
PrivacyDevice = privacyDevice;
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Monitoring/StatusMonitorCollection.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Monitoring/StatusMonitorCollection.cs
index d9b5b33a..7f985fe0 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Monitoring/StatusMonitorCollection.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Monitoring/StatusMonitorCollection.cs
@@ -64,30 +64,34 @@ namespace PepperDash.Essentials.Core
initialStatus = MonitorStatus.InWarning;
prefix = "2:";
}
- else if (InWarning.Count() > 0)
+ else if (IsOk.Count() > 0)
initialStatus = MonitorStatus.IsOk;
else
initialStatus = MonitorStatus.StatusUnknown;
// Build the error message string
- if (InError.Count() > 0 || InWarning.Count() > 0)
- {
- StringBuilder sb = new StringBuilder(prefix);
- if (InError.Count() > 0)
- {
- // Do string splits and joins
- sb.Append(string.Format("{0} Errors:", InError.Count()));
- foreach (var mon in InError)
- sb.Append(string.Format("{0}, ", mon.Parent.Key));
- }
- if (InWarning.Count() > 0)
- {
- sb.Append(string.Format("{0} Warnings:", InWarning.Count()));
- foreach (var mon in InWarning)
- sb.Append(string.Format("{0}, ", mon.Parent.Key));
- }
- Message = sb.ToString();
- }
+ if (InError.Count() > 0 || InWarning.Count() > 0)
+ {
+ StringBuilder sb = new StringBuilder(prefix);
+ if (InError.Count() > 0)
+ {
+ // Do string splits and joins
+ sb.Append(string.Format("{0} Errors:", InError.Count()));
+ foreach (var mon in InError)
+ sb.Append(string.Format("{0}, ", mon.Parent.Key));
+ }
+ if (InWarning.Count() > 0)
+ {
+ sb.Append(string.Format("{0} Warnings:", InWarning.Count()));
+ foreach (var mon in InWarning)
+ sb.Append(string.Format("{0}, ", mon.Parent.Key));
+ }
+ Message = sb.ToString();
+ }
+ else
+ {
+ Message = "Room Ok.";
+ }
// Want to fire even if status doesn't change because the message may.
Status = initialStatus;
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Monitoring/SystemMonitorController.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Monitoring/SystemMonitorController.cs
index eadaab12..056686b1 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Monitoring/SystemMonitorController.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Monitoring/SystemMonitorController.cs
@@ -1,106 +1,106 @@
-using System;
+using System;
using System.Collections.Generic;
using System.Linq;
-using Crestron.SimplSharp;
-using Crestron.SimplSharpPro.DeviceSupport;
-using Crestron.SimplSharpPro.Diagnostics;
-using PepperDash.Core;
-using Newtonsoft.Json;
-using Newtonsoft.Json.Converters;
-using PepperDash.Essentials.Core.Bridges;
-
-namespace PepperDash.Essentials.Core.Monitoring
-{
- ///
- /// Wrapper for the static SystemMonitor class to extend functionality and provide external access
- /// to SystemMonitor via APIs
- ///
- public class SystemMonitorController : EssentialsBridgeableDevice
- {
- private const long UptimePollTime = 300000;
- private CTimer _uptimePollTimer;
-
- private string _uptime;
- private string _lastStart;
-
- public event EventHandler SystemMonitorPropertiesChanged;
-
- public Dictionary ProgramStatusFeedbackCollection;
- public Dictionary EthernetStatusFeedbackCollection;
-
- public IntFeedback TimeZoneFeedback { get; protected set; }
- public StringFeedback TimeZoneTextFeedback { get; protected set; }
-
- public StringFeedback IoControllerVersionFeedback { get; protected set; }
- public StringFeedback SnmpVersionFeedback { get; protected set; }
- public StringFeedback BaCnetAppVersionFeedback { get; protected set; }
- public StringFeedback ControllerVersionFeedback { get; protected set; }
-
- //new feedbacks. Issue #50
- public StringFeedback SerialNumberFeedback { get; protected set; }
- public StringFeedback ModelFeedback { get; set; }
-
- public StringFeedback UptimeFeedback { get; set; }
- public StringFeedback LastStartFeedback { get; set; }
-
- public SystemMonitorController(string key)
- : base(key)
- {
- Debug.Console(2, this, "Adding SystemMonitorController.");
-
- SystemMonitor.ProgramInitialization.ProgramInitializationUnderUserControl = true;
-
- TimeZoneFeedback = new IntFeedback(() => SystemMonitor.TimeZoneInformation.TimeZoneNumber);
- TimeZoneTextFeedback = new StringFeedback(() => SystemMonitor.TimeZoneInformation.TimeZoneName);
-
- IoControllerVersionFeedback = new StringFeedback(() => SystemMonitor.VersionInformation.IOPVersion);
- SnmpVersionFeedback = new StringFeedback(() => SystemMonitor.VersionInformation.SNMPVersion);
- BaCnetAppVersionFeedback = new StringFeedback(() => SystemMonitor.VersionInformation.BACNetVersion);
- ControllerVersionFeedback = new StringFeedback(() => SystemMonitor.VersionInformation.ControlSystemVersion);
-
- SerialNumberFeedback = new StringFeedback(() => CrestronEnvironment.SystemInfo.SerialNumber);
- ModelFeedback = new StringFeedback(() => InitialParametersClass.ControllerPromptName);
- UptimeFeedback = new StringFeedback(() => _uptime);
- LastStartFeedback = new StringFeedback(()=> _lastStart);
-
- ProgramStatusFeedbackCollection = new Dictionary();
-
- foreach (var prog in SystemMonitor.ProgramCollection)
- {
- var program = new ProgramStatusFeedbacks(prog);
- ProgramStatusFeedbackCollection.Add(prog.Number, program);
- }
-
- CreateEthernetStatusFeedbacks();
- UpdateEthernetStatusFeeedbacks();
-
- _uptimePollTimer = new CTimer(PollUptime,null,0, UptimePollTime);
-
- SystemMonitor.ProgramChange += SystemMonitor_ProgramChange;
- SystemMonitor.TimeZoneInformation.TimeZoneChange += TimeZoneInformation_TimeZoneChange;
- CrestronEnvironment.EthernetEventHandler += CrestronEnvironmentOnEthernetEventHandler;
- CrestronEnvironment.ProgramStatusEventHandler += CrestronEnvironmentOnProgramStatusEventHandler;
- }
-
- private void CrestronEnvironmentOnProgramStatusEventHandler(eProgramStatusEventType programEventType)
- {
- if (programEventType != eProgramStatusEventType.Stopping) return;
-
- _uptimePollTimer.Stop();
- _uptimePollTimer.Dispose();
- _uptimePollTimer = null;
- }
-
- private void PollUptime(object obj)
- {
- var consoleResponse = string.Empty;
-
- CrestronConsole.SendControlSystemCommand("uptime", ref consoleResponse);
-
- ParseUptime(consoleResponse);
-
- UptimeFeedback.FireUpdate();
- LastStartFeedback.FireUpdate();
+using Crestron.SimplSharp;
+using Crestron.SimplSharpPro.DeviceSupport;
+using Crestron.SimplSharpPro.Diagnostics;
+using PepperDash.Core;
+using Newtonsoft.Json;
+using Newtonsoft.Json.Converters;
+using PepperDash.Essentials.Core.Bridges;
+
+namespace PepperDash.Essentials.Core.Monitoring
+{
+ ///
+ /// Wrapper for the static SystemMonitor class to extend functionality and provide external access
+ /// to SystemMonitor via APIs
+ ///
+ public class SystemMonitorController : EssentialsBridgeableDevice
+ {
+ private const long UptimePollTime = 300000;
+ private CTimer _uptimePollTimer;
+
+ private string _uptime;
+ private string _lastStart;
+
+ public event EventHandler SystemMonitorPropertiesChanged;
+
+ public Dictionary ProgramStatusFeedbackCollection;
+ public Dictionary EthernetStatusFeedbackCollection;
+
+ public IntFeedback TimeZoneFeedback { get; protected set; }
+ public StringFeedback TimeZoneTextFeedback { get; protected set; }
+
+ public StringFeedback IoControllerVersionFeedback { get; protected set; }
+ public StringFeedback SnmpVersionFeedback { get; protected set; }
+ public StringFeedback BaCnetAppVersionFeedback { get; protected set; }
+ public StringFeedback ControllerVersionFeedback { get; protected set; }
+
+ //new feedbacks. Issue #50
+ public StringFeedback SerialNumberFeedback { get; protected set; }
+ public StringFeedback ModelFeedback { get; set; }
+
+ public StringFeedback UptimeFeedback { get; set; }
+ public StringFeedback LastStartFeedback { get; set; }
+
+ public SystemMonitorController(string key)
+ : base(key)
+ {
+ Debug.Console(2, this, "Adding SystemMonitorController.");
+
+ SystemMonitor.ProgramInitialization.ProgramInitializationUnderUserControl = true;
+
+ TimeZoneFeedback = new IntFeedback(() => SystemMonitor.TimeZoneInformation.TimeZoneNumber);
+ TimeZoneTextFeedback = new StringFeedback(() => SystemMonitor.TimeZoneInformation.TimeZoneName);
+
+ IoControllerVersionFeedback = new StringFeedback(() => SystemMonitor.VersionInformation.IOPVersion);
+ SnmpVersionFeedback = new StringFeedback(() => SystemMonitor.VersionInformation.SNMPVersion);
+ BaCnetAppVersionFeedback = new StringFeedback(() => SystemMonitor.VersionInformation.BACNetVersion);
+ ControllerVersionFeedback = new StringFeedback(() => SystemMonitor.VersionInformation.ControlSystemVersion);
+
+ SerialNumberFeedback = new StringFeedback(() => CrestronEnvironment.SystemInfo.SerialNumber);
+ ModelFeedback = new StringFeedback(() => InitialParametersClass.ControllerPromptName);
+ UptimeFeedback = new StringFeedback(() => _uptime);
+ LastStartFeedback = new StringFeedback(()=> _lastStart);
+
+ ProgramStatusFeedbackCollection = new Dictionary();
+
+ foreach (var prog in SystemMonitor.ProgramCollection)
+ {
+ var program = new ProgramStatusFeedbacks(prog);
+ ProgramStatusFeedbackCollection.Add(prog.Number, program);
+ }
+
+ CreateEthernetStatusFeedbacks();
+ UpdateEthernetStatusFeeedbacks();
+
+ _uptimePollTimer = new CTimer(PollUptime,null,0, UptimePollTime);
+
+ SystemMonitor.ProgramChange += SystemMonitor_ProgramChange;
+ SystemMonitor.TimeZoneInformation.TimeZoneChange += TimeZoneInformation_TimeZoneChange;
+ CrestronEnvironment.EthernetEventHandler += CrestronEnvironmentOnEthernetEventHandler;
+ CrestronEnvironment.ProgramStatusEventHandler += CrestronEnvironmentOnProgramStatusEventHandler;
+ }
+
+ private void CrestronEnvironmentOnProgramStatusEventHandler(eProgramStatusEventType programEventType)
+ {
+ if (programEventType != eProgramStatusEventType.Stopping) return;
+
+ _uptimePollTimer.Stop();
+ _uptimePollTimer.Dispose();
+ _uptimePollTimer = null;
+ }
+
+ private void PollUptime(object obj)
+ {
+ var consoleResponse = string.Empty;
+
+ CrestronConsole.SendControlSystemCommand("uptime", ref consoleResponse);
+
+ ParseUptime(consoleResponse);
+
+ UptimeFeedback.FireUpdate();
+ LastStartFeedback.FireUpdate();
}
private void ParseUptime(string response)
@@ -123,94 +123,94 @@ namespace PepperDash.Essentials.Core.Monitoring
_uptime = uptimeRaw.Substring(forIndex + 4);
}
- private void CrestronEnvironmentOnEthernetEventHandler(EthernetEventArgs ethernetEventArgs)
- {
- if (ethernetEventArgs.EthernetEventType != eEthernetEventType.LinkUp) return;
-
- foreach (var fb in EthernetStatusFeedbackCollection)
- {
- fb.Value.UpdateEthernetStatus();
- }
- }
-
- private void CreateEthernetStatusFeedbacks()
- {
- EthernetStatusFeedbackCollection = new Dictionary();
-
- Debug.Console(2, "Creating {0} EthernetStatusFeedbacks", InitialParametersClass.NumberOfEthernetInterfaces);
-
- for (short i = 0; i < InitialParametersClass.NumberOfEthernetInterfaces; i++)
- {
- Debug.Console(2, "Creating EthernetStatusFeedback for Interface {0}", i);
- var ethernetInterface = new EthernetStatusFeedbacks(i);
- EthernetStatusFeedbackCollection.Add(i, ethernetInterface);
- }
- }
-
- private void UpdateEthernetStatusFeeedbacks()
- {
- foreach (var iface in EthernetStatusFeedbackCollection)
- {
- iface.Value.CurrentIpAddressFeedback.FireUpdate();
- iface.Value.CurrentSubnetMaskFeedback.FireUpdate();
- iface.Value.CurrentDefaultGatewayFeedback.FireUpdate();
- iface.Value.StaticIpAddressFeedback.FireUpdate();
- iface.Value.StaticSubnetMaskFeedback.FireUpdate();
- iface.Value.StaticDefaultGatewayFeedback.FireUpdate();
- iface.Value.HostNameFeedback.FireUpdate();
- iface.Value.DnsServerFeedback.FireUpdate();
- iface.Value.DomainFeedback.FireUpdate();
- iface.Value.DhcpStatusFeedback.FireUpdate();
- iface.Value.MacAddressFeedback.FireUpdate();
- }
- }
-
- ///
- /// Gets data in separate thread
- ///
- private void RefreshSystemMonitorData()
- {
- // this takes a while, launch a new thread
- CrestronInvoke.BeginInvoke(UpdateFeedback);
- }
-
- private void UpdateFeedback(object o)
- {
- TimeZoneFeedback.FireUpdate();
- TimeZoneTextFeedback.FireUpdate();
- IoControllerVersionFeedback.FireUpdate();
- SnmpVersionFeedback.FireUpdate();
- BaCnetAppVersionFeedback.FireUpdate();
- ControllerVersionFeedback.FireUpdate();
- SerialNumberFeedback.FireUpdate();
- ModelFeedback.FireUpdate();
-
- OnSystemMonitorPropertiesChanged();
- }
-
- private void OnSystemMonitorPropertiesChanged()
- {
- var handler = SystemMonitorPropertiesChanged;
- if (handler != null)
- {
- handler(this, new EventArgs());
- }
- }
-
- public override bool CustomActivate()
- {
- RefreshSystemMonitorData();
-
- return base.CustomActivate();
- }
-
- public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
+ private void CrestronEnvironmentOnEthernetEventHandler(EthernetEventArgs ethernetEventArgs)
{
- var joinMap = new SystemMonitorJoinMap(joinStart);
-
- var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
-
- if (!string.IsNullOrEmpty(joinMapSerialized))
+ if (ethernetEventArgs.EthernetEventType != eEthernetEventType.LinkUp) return;
+
+ foreach (var fb in EthernetStatusFeedbackCollection)
+ {
+ fb.Value.UpdateEthernetStatus();
+ }
+ }
+
+ private void CreateEthernetStatusFeedbacks()
+ {
+ EthernetStatusFeedbackCollection = new Dictionary();
+
+ Debug.Console(2, "Creating {0} EthernetStatusFeedbacks", InitialParametersClass.NumberOfEthernetInterfaces);
+
+ for (short i = 0; i < InitialParametersClass.NumberOfEthernetInterfaces; i++)
+ {
+ Debug.Console(2, "Creating EthernetStatusFeedback for Interface {0}", i);
+ var ethernetInterface = new EthernetStatusFeedbacks(i);
+ EthernetStatusFeedbackCollection.Add(i, ethernetInterface);
+ }
+ }
+
+ private void UpdateEthernetStatusFeeedbacks()
+ {
+ foreach (var iface in EthernetStatusFeedbackCollection)
+ {
+ iface.Value.CurrentIpAddressFeedback.FireUpdate();
+ iface.Value.CurrentSubnetMaskFeedback.FireUpdate();
+ iface.Value.CurrentDefaultGatewayFeedback.FireUpdate();
+ iface.Value.StaticIpAddressFeedback.FireUpdate();
+ iface.Value.StaticSubnetMaskFeedback.FireUpdate();
+ iface.Value.StaticDefaultGatewayFeedback.FireUpdate();
+ iface.Value.HostNameFeedback.FireUpdate();
+ iface.Value.DnsServerFeedback.FireUpdate();
+ iface.Value.DomainFeedback.FireUpdate();
+ iface.Value.DhcpStatusFeedback.FireUpdate();
+ iface.Value.MacAddressFeedback.FireUpdate();
+ }
+ }
+
+ ///
+ /// Gets data in separate thread
+ ///
+ private void RefreshSystemMonitorData()
+ {
+ // this takes a while, launch a new thread
+ CrestronInvoke.BeginInvoke(UpdateFeedback);
+ }
+
+ private void UpdateFeedback(object o)
+ {
+ TimeZoneFeedback.FireUpdate();
+ TimeZoneTextFeedback.FireUpdate();
+ IoControllerVersionFeedback.FireUpdate();
+ SnmpVersionFeedback.FireUpdate();
+ BaCnetAppVersionFeedback.FireUpdate();
+ ControllerVersionFeedback.FireUpdate();
+ SerialNumberFeedback.FireUpdate();
+ ModelFeedback.FireUpdate();
+
+ OnSystemMonitorPropertiesChanged();
+ }
+
+ private void OnSystemMonitorPropertiesChanged()
+ {
+ var handler = SystemMonitorPropertiesChanged;
+ if (handler != null)
+ {
+ handler(this, new EventArgs());
+ }
+ }
+
+ public override bool CustomActivate()
+ {
+ RefreshSystemMonitorData();
+
+ return base.CustomActivate();
+ }
+
+ public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
+ {
+ var joinMap = new SystemMonitorJoinMap(joinStart);
+
+ var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
+
+ if (!string.IsNullOrEmpty(joinMapSerialized))
joinMap = JsonConvert.DeserializeObject(joinMapSerialized);
if (bridge != null)
@@ -220,11 +220,11 @@ namespace PepperDash.Essentials.Core.Monitoring
else
{
Debug.Console(0, this, "Please update config to use 'eiscapiadvanced' to get all join map features for this device.");
- }
-
- Debug.Console(1, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
- Debug.Console(2, this, "Linking API starting at join: {0}", joinStart);
-
+ }
+
+ Debug.Console(1, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
+ Debug.Console(2, this, "Linking API starting at join: {0}", joinStart);
+
TimeZoneFeedback.LinkInputSig(trilist.UShortInput[joinMap.TimeZone.JoinNumber]);
TimeZoneTextFeedback.LinkInputSig(trilist.StringInput[joinMap.TimeZoneName.JoinNumber]);
@@ -235,18 +235,18 @@ namespace PepperDash.Essentials.Core.Monitoring
SerialNumberFeedback.LinkInputSig(trilist.StringInput[joinMap.SerialNumber.JoinNumber]);
ModelFeedback.LinkInputSig(trilist.StringInput[joinMap.Model.JoinNumber]);
UptimeFeedback.LinkInputSig(trilist.StringInput[joinMap.Uptime.JoinNumber]);
- LastStartFeedback.LinkInputSig(trilist.StringInput[joinMap.LastBoot.JoinNumber]);
-
- // iterate the program status feedback collection and map all the joins
- LinkProgramInfoJoins(this, trilist, joinMap);
-
- LinkEthernetInfoJoins(this, trilist, joinMap);
- }
-
- private static void LinkEthernetInfoJoins(SystemMonitorController systemMonitorController, BasicTriList trilist, SystemMonitorJoinMap joinMap)
+ LastStartFeedback.LinkInputSig(trilist.StringInput[joinMap.LastBoot.JoinNumber]);
+
+ // iterate the program status feedback collection and map all the joins
+ LinkProgramInfoJoins(this, trilist, joinMap);
+
+ LinkEthernetInfoJoins(this, trilist, joinMap);
+ }
+
+ private static void LinkEthernetInfoJoins(SystemMonitorController systemMonitorController, BasicTriList trilist, SystemMonitorJoinMap joinMap)
{
- uint ethernetSlotJoinStart = 0;
- foreach (var fb in systemMonitorController.EthernetStatusFeedbackCollection)
+ uint ethernetSlotJoinStart = 0;
+ foreach (var fb in systemMonitorController.EthernetStatusFeedbackCollection)
{
fb.Value.CurrentIpAddressFeedback.LinkInputSig(trilist.StringInput[ethernetSlotJoinStart + joinMap.CurrentIpAddress.JoinNumber]);
fb.Value.CurrentSubnetMaskFeedback.LinkInputSig(trilist.StringInput[ethernetSlotJoinStart + joinMap.CurrentSubnetMask.JoinNumber]);
@@ -258,494 +258,500 @@ namespace PepperDash.Essentials.Core.Monitoring
fb.Value.MacAddressFeedback.LinkInputSig(trilist.StringInput[ethernetSlotJoinStart + joinMap.MacAddress.JoinNumber]);
fb.Value.DomainFeedback.LinkInputSig(trilist.StringInput[ethernetSlotJoinStart + joinMap.Domain.JoinNumber]);
fb.Value.DnsServerFeedback.LinkInputSig(trilist.StringInput[ethernetSlotJoinStart + joinMap.DnsServer.JoinNumber]);
- fb.Value.DhcpStatusFeedback.LinkInputSig(trilist.StringInput[ethernetSlotJoinStart + joinMap.DhcpStatus.JoinNumber]);
-
- ethernetSlotJoinStart += joinMap.EthernetOffsetJoin.JoinNumber;
- }
- }
-
- private static void LinkProgramInfoJoins(SystemMonitorController systemMonitorController, BasicTriList trilist,
- SystemMonitorJoinMap joinMap)
+ fb.Value.DhcpStatusFeedback.LinkInputSig(trilist.StringInput[ethernetSlotJoinStart + joinMap.DhcpStatus.JoinNumber]);
+
+ ethernetSlotJoinStart += joinMap.EthernetOffsetJoin.JoinNumber;
+ }
+ }
+
+ private static void LinkProgramInfoJoins(SystemMonitorController systemMonitorController, BasicTriList trilist,
+ SystemMonitorJoinMap joinMap)
{
- uint programSlotJoinStart = 0;
-
- foreach (var p in systemMonitorController.ProgramStatusFeedbackCollection)
- {
+ uint programSlotJoinStart = 0;
+
+ foreach (var p in systemMonitorController.ProgramStatusFeedbackCollection)
+ {
var programNumber = p.Value.Program.Number;
- trilist.SetBoolSigAction(programSlotJoinStart + joinMap.ProgramStart.JoinNumber,
+ trilist.SetBoolSigAction(programSlotJoinStart + joinMap.ProgramStart.JoinNumber,
b => SystemMonitor.ProgramCollection[programNumber].OperatingState = eProgramOperatingState.Start);
p.Value.ProgramStartedFeedback.LinkInputSig(trilist.BooleanInput[programSlotJoinStart + joinMap.ProgramStart.JoinNumber]);
- trilist.SetBoolSigAction(programSlotJoinStart + joinMap.ProgramStop.JoinNumber,
+ trilist.SetBoolSigAction(programSlotJoinStart + joinMap.ProgramStop.JoinNumber,
b => SystemMonitor.ProgramCollection[programNumber].OperatingState = eProgramOperatingState.Stop);
p.Value.ProgramStoppedFeedback.LinkInputSig(trilist.BooleanInput[programSlotJoinStart + joinMap.ProgramStop.JoinNumber]);
- trilist.SetBoolSigAction(programSlotJoinStart + joinMap.ProgramRegister.JoinNumber,
- b => SystemMonitor.ProgramCollection[programNumber].RegistrationState = eProgramRegistrationState.Register);
+ trilist.SetBoolSigAction(programSlotJoinStart + joinMap.ProgramRegister.JoinNumber,
+ b => SystemMonitor.ProgramCollection[programNumber].RegistrationState = eProgramRegistrationState.Register);
p.Value.ProgramRegisteredFeedback.LinkInputSig(
trilist.BooleanInput[programSlotJoinStart + joinMap.ProgramRegister.JoinNumber]);
- trilist.SetBoolSigAction(programSlotJoinStart + joinMap.ProgramUnregister.JoinNumber,
- b => SystemMonitor.ProgramCollection[programNumber].RegistrationState = eProgramRegistrationState.Unregister);
+ trilist.SetBoolSigAction(programSlotJoinStart + joinMap.ProgramUnregister.JoinNumber,
+ b => SystemMonitor.ProgramCollection[programNumber].RegistrationState = eProgramRegistrationState.Unregister);
p.Value.ProgramUnregisteredFeedback.LinkInputSig(
trilist.BooleanInput[programSlotJoinStart + joinMap.ProgramUnregister.JoinNumber]);
- p.Value.ProgramNameFeedback.LinkInputSig(trilist.StringInput[programSlotJoinStart + joinMap.ProgramName.JoinNumber]);
+ p.Value.ProgramNameFeedback.LinkInputSig(trilist.StringInput[programSlotJoinStart + joinMap.ProgramName.JoinNumber]);
p.Value.ProgramCompileTimeFeedback.LinkInputSig(
- trilist.StringInput[programSlotJoinStart + joinMap.ProgramCompiledTime.JoinNumber]);
+ trilist.StringInput[programSlotJoinStart + joinMap.ProgramCompiledTime.JoinNumber]);
p.Value.CrestronDataBaseVersionFeedback.LinkInputSig(
- trilist.StringInput[programSlotJoinStart + joinMap.ProgramCrestronDatabaseVersion.JoinNumber]);
+ trilist.StringInput[programSlotJoinStart + joinMap.ProgramCrestronDatabaseVersion.JoinNumber]);
p.Value.EnvironmentVersionFeedback.LinkInputSig(
- trilist.StringInput[programSlotJoinStart + joinMap.ProgramEnvironmentVersion.JoinNumber]);
+ trilist.StringInput[programSlotJoinStart + joinMap.ProgramEnvironmentVersion.JoinNumber]);
p.Value.AggregatedProgramInfoFeedback.LinkInputSig(
trilist.StringInput[programSlotJoinStart + joinMap.AggregatedProgramInfo.JoinNumber]);
- programSlotJoinStart = programSlotJoinStart + joinMap.ProgramOffsetJoin.JoinNumber;
- }
- }
-
- //// Sets the time zone
- //public void SetTimeZone(int timeZone)
- //{
- // SystemMonitor.TimeZoneInformation.TimeZoneNumber = timeZone;
- //}
-
- ///
- /// Responds to program change events and triggers the appropriate feedbacks to update
- ///
- ///
- ///
- private void SystemMonitor_ProgramChange(Program sender, ProgramEventArgs args)
- {
- Debug.Console(2, this, "Program Change Detected for slot: {0}", sender.Number);
- Debug.Console(2, this, "Event Type: {0}", args.EventType);
-
- var program = ProgramStatusFeedbackCollection[sender.Number];
-
- switch (args.EventType)
- {
- case eProgramChangeEventType.OperatingState:
- program.ProgramStartedFeedback.FireUpdate();
- program.ProgramStoppedFeedback.FireUpdate();
- program.ProgramInfo.OperatingState = args.OperatingState;
- if (args.OperatingState == eProgramOperatingState.Start)
- program.GetProgramInfo();
- else
- {
- program.AggregatedProgramInfoFeedback.FireUpdate();
- program.OnProgramInfoChanged();
- }
- break;
- case eProgramChangeEventType.RegistrationState:
- program.ProgramRegisteredFeedback.FireUpdate();
- program.ProgramUnregisteredFeedback.FireUpdate();
- program.ProgramInfo.RegistrationState = args.RegistrationState;
- program.GetProgramInfo();
- break;
- }
- }
-
- ///
- /// Responds to time zone changes and updates the appropriate feedbacks
- ///
- ///
- private void TimeZoneInformation_TimeZoneChange(TimeZoneEventArgs args)
- {
- Debug.Console(2, this, "Time Zone Change Detected.");
- TimeZoneFeedback.FireUpdate();
- TimeZoneTextFeedback.FireUpdate();
-
- OnSystemMonitorPropertiesChanged();
- }
-
- public class EthernetStatusFeedbacks
- {
- public StringFeedback HostNameFeedback { get; protected set; }
- public StringFeedback DnsServerFeedback { get; protected set; }
- public StringFeedback DomainFeedback { get; protected set; }
- public StringFeedback MacAddressFeedback { get; protected set; }
- public StringFeedback DhcpStatusFeedback { get; protected set; }
-
- public StringFeedback CurrentIpAddressFeedback { get; protected set; }
- public StringFeedback CurrentSubnetMaskFeedback { get; protected set; }
- public StringFeedback CurrentDefaultGatewayFeedback { get; protected set; }
-
- public StringFeedback StaticIpAddressFeedback { get; protected set; }
- public StringFeedback StaticSubnetMaskFeedback { get; protected set; }
- public StringFeedback StaticDefaultGatewayFeedback { get; protected set; }
-
- public EthernetStatusFeedbacks(short adapterIndex)
- {
- Debug.Console(2, "Ethernet Information for interface {0}", adapterIndex);
- Debug.Console(2, "Adapter Index: {1} Hostname: {0}", CrestronEthernetHelper.GetEthernetParameter(
- CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_HOSTNAME, adapterIndex), adapterIndex);
- Debug.Console(2, "Adapter Index: {1} Current IP Address: {0}", CrestronEthernetHelper.GetEthernetParameter(
- CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_CURRENT_IP_ADDRESS, adapterIndex), adapterIndex);
- Debug.Console(2, "Adapter Index: {1} Current Subnet Mask: {0}", CrestronEthernetHelper.GetEthernetParameter(
- CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_CURRENT_IP_MASK, adapterIndex), adapterIndex);
- Debug.Console(2, "Adapter Index: {1} Current Router: {0}", CrestronEthernetHelper.GetEthernetParameter(
- CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_CURRENT_ROUTER, adapterIndex), adapterIndex);
- Debug.Console(2, "Adapter Index: {1} Static IP Address: {0}", CrestronEthernetHelper.GetEthernetParameter(
- CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_STATIC_IPADDRESS, adapterIndex), adapterIndex);
- Debug.Console(2, "Adapter Index: {1} Static Subnet Mask: {0}", CrestronEthernetHelper.GetEthernetParameter(
- CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_STATIC_IPMASK, adapterIndex), adapterIndex);
- Debug.Console(2, "Adapter Index: {1} Static Router: {0}", CrestronEthernetHelper.GetEthernetParameter(
- CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_STATIC_ROUTER, adapterIndex), adapterIndex);
- Debug.Console(2, "Adapter Index: {1} DNS Servers: {0}", CrestronEthernetHelper.GetEthernetParameter(
- CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_DNS_SERVER, adapterIndex), adapterIndex);
- Debug.Console(2, "Adapter Index: {1} DHCP State: {0}", CrestronEthernetHelper.GetEthernetParameter(
- CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_CURRENT_DHCP_STATE, adapterIndex), adapterIndex);
- Debug.Console(2, "Adapter Index: {1} Domain Name: {0}", CrestronEthernetHelper.GetEthernetParameter(
- CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_DOMAIN_NAME, adapterIndex), adapterIndex);
- Debug.Console(2, "Adapter Index: {1} MAC Address: {0}", CrestronEthernetHelper.GetEthernetParameter(
- CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_MAC_ADDRESS, adapterIndex), adapterIndex);
- HostNameFeedback =
- new StringFeedback(
- () =>
- CrestronEthernetHelper.GetEthernetParameter(
- CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_HOSTNAME, adapterIndex));
-
- CurrentIpAddressFeedback =
- new StringFeedback(
- () =>
- CrestronEthernetHelper.GetEthernetParameter(
- CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_CURRENT_IP_ADDRESS, adapterIndex));
- CurrentDefaultGatewayFeedback =
- new StringFeedback(
- () =>
- CrestronEthernetHelper.GetEthernetParameter(
- CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_CURRENT_ROUTER, adapterIndex));
- CurrentSubnetMaskFeedback =
- new StringFeedback(
- () =>
- CrestronEthernetHelper.GetEthernetParameter(
- CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_CURRENT_IP_MASK, adapterIndex));
- StaticIpAddressFeedback =
- new StringFeedback(
- () =>
- CrestronEthernetHelper.GetEthernetParameter(
- CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_CURRENT_IP_ADDRESS, adapterIndex));
- StaticDefaultGatewayFeedback =
- new StringFeedback(
- () =>
- CrestronEthernetHelper.GetEthernetParameter(
- CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_CURRENT_ROUTER, adapterIndex));
- StaticSubnetMaskFeedback =
- new StringFeedback(
- () =>
- CrestronEthernetHelper.GetEthernetParameter(
- CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_CURRENT_IP_MASK, adapterIndex));
- DomainFeedback =
- new StringFeedback(
- () =>
- CrestronEthernetHelper.GetEthernetParameter(
- CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_DOMAIN_NAME, adapterIndex));
- DnsServerFeedback =
- new StringFeedback(
- () =>
- CrestronEthernetHelper.GetEthernetParameter(
- CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_DNS_SERVER, adapterIndex));
- MacAddressFeedback =
- new StringFeedback(
- () =>
- CrestronEthernetHelper.GetEthernetParameter(
- CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_MAC_ADDRESS, adapterIndex));
-
- DhcpStatusFeedback = new StringFeedback(
- () =>
- CrestronEthernetHelper.GetEthernetParameter(
- CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_CURRENT_DHCP_STATE, adapterIndex));
- }
-
- public void UpdateEthernetStatus()
- {
- HostNameFeedback.FireUpdate();
- CurrentIpAddressFeedback.FireUpdate();
- CurrentSubnetMaskFeedback.FireUpdate();
- CurrentDefaultGatewayFeedback.FireUpdate();
- StaticIpAddressFeedback.FireUpdate();
- StaticSubnetMaskFeedback.FireUpdate();
- StaticDefaultGatewayFeedback.FireUpdate();
- DomainFeedback.FireUpdate();
- DnsServerFeedback.FireUpdate();
- MacAddressFeedback.FireUpdate();
- DhcpStatusFeedback.FireUpdate();
- }
- }
-
-
- public class ProgramStatusFeedbacks
- {
- public event EventHandler ProgramInfoChanged;
-
- public Program Program;
-
- public ProgramInfo ProgramInfo { get; set; }
-
- public BoolFeedback ProgramStartedFeedback;
- public BoolFeedback ProgramStoppedFeedback;
- public BoolFeedback ProgramRegisteredFeedback;
- public BoolFeedback ProgramUnregisteredFeedback;
-
- public StringFeedback ProgramNameFeedback;
- public StringFeedback ProgramCompileTimeFeedback;
- public StringFeedback CrestronDataBaseVersionFeedback;
- // SIMPL windows version
- public StringFeedback EnvironmentVersionFeedback;
- public StringFeedback AggregatedProgramInfoFeedback;
-
- public ProgramStatusFeedbacks(Program program)
- {
- ProgramInfo = new ProgramInfo(program.Number);
-
- Program = program;
-
- ProgramInfo.OperatingState = Program.OperatingState;
- ProgramInfo.RegistrationState = Program.RegistrationState;
-
- ProgramStartedFeedback = new BoolFeedback(() => Program.OperatingState == eProgramOperatingState.Start);
- ProgramStoppedFeedback = new BoolFeedback(() => Program.OperatingState == eProgramOperatingState.Stop);
- ProgramRegisteredFeedback =
- new BoolFeedback(() => Program.RegistrationState == eProgramRegistrationState.Register);
- ProgramUnregisteredFeedback =
- new BoolFeedback(() => Program.RegistrationState == eProgramRegistrationState.Unregister);
-
- ProgramNameFeedback = new StringFeedback(() => ProgramInfo.ProgramFile);
- ProgramCompileTimeFeedback = new StringFeedback(() => ProgramInfo.CompileTime);
- CrestronDataBaseVersionFeedback = new StringFeedback(() => ProgramInfo.CrestronDb);
- EnvironmentVersionFeedback = new StringFeedback(() => ProgramInfo.Environment);
-
- AggregatedProgramInfoFeedback = new StringFeedback(() => JsonConvert.SerializeObject(ProgramInfo));
-
- GetProgramInfo();
- }
-
- ///
- /// Retrieves information about a running program
- ///
- public void GetProgramInfo()
- {
- CrestronInvoke.BeginInvoke(GetProgramInfo);
- }
-
- private void GetProgramInfo(object o)
- {
- Debug.Console(2, "Attempting to get program info for slot: {0}", Program.Number);
-
- string response = null;
-
- if (Program.RegistrationState == eProgramRegistrationState.Unregister || Program.OperatingState == eProgramOperatingState.Stop)
- {
- Debug.Console(2, "Program {0} not registered. Setting default values for program information.",
- Program.Number);
-
- ProgramInfo = new ProgramInfo(Program.Number)
- {
- OperatingState = Program.OperatingState,
- RegistrationState = Program.RegistrationState
- };
-
- return;
- }
-
- var success = CrestronConsole.SendControlSystemCommand(
- string.Format("progcomments:{0}", Program.Number), ref response);
-
- if (!success)
- {
- Debug.Console(2, "Progcomments Attempt Unsuccessful for slot: {0}", Program.Number);
- UpdateFeedbacks();
- return;
- }
-
- if (response.ToLower().Contains("bad or incomplete"))
- {
- Debug.Console(2,
- "Program in slot {0} not running. Setting default ProgramInfo for slot: {0}",
- Program.Number);
-
- // Assume no valid program info. Constructing a new object will wipe all properties
- ProgramInfo = new ProgramInfo(Program.Number)
- {
- OperatingState = Program.OperatingState,
- RegistrationState = Program.RegistrationState
- };
-
- UpdateFeedbacks();
-
- return;
- }
-
-
- // Shared properteis
- ProgramInfo.ProgramFile = ParseConsoleData(response, "Program File", ": ", "\n");
- ProgramInfo.CompilerRevision = ParseConsoleData(response, "Compiler Rev", ": ", "\n");
- ProgramInfo.CompileTime = ParseConsoleData(response, "Compiled On", ": ", "\n");
- ProgramInfo.Include4Dat = ParseConsoleData(response, "Include4.dat", ": ", "\n");
-
-
- if (ProgramInfo.ProgramFile.Contains(".dll"))
- {
- // SSP Program
- ProgramInfo.FriendlyName = ParseConsoleData(response, "Friendly Name", ": ", "\n");
- ProgramInfo.ApplicationName = ParseConsoleData(response, "Application Name", ": ", "\n");
- ProgramInfo.ProgramTool = ParseConsoleData(response, "Program Tool", ": ", "\n");
- ProgramInfo.MinFirmwareVersion = ParseConsoleData(response, "Min Firmware Version", ": ",
- "\n");
- ProgramInfo.PlugInVersion = ParseConsoleData(response, "PlugInVersion", ": ", "\n");
- }
- else if (ProgramInfo.ProgramFile.Contains(".smw"))
- {
- // SIMPL Windows Program
- ProgramInfo.FriendlyName = ParseConsoleData(response, "Friendly Name", ":", "\n");
- ProgramInfo.SystemName = ParseConsoleData(response, "System Name", ": ", "\n");
- ProgramInfo.CrestronDb = ParseConsoleData(response, "CrestronDB", ": ", "\n");
- ProgramInfo.Environment = ParseConsoleData(response, "Source Env", ": ", "\n");
- ProgramInfo.Programmer = ParseConsoleData(response, "Programmer", ": ", "\n");
- }
- Debug.Console(2, "Program info for slot {0} successfully updated", Program.Number);
-
- UpdateFeedbacks();
- }
-
- private void UpdateFeedbacks()
- {
- ProgramNameFeedback.FireUpdate();
- ProgramCompileTimeFeedback.FireUpdate();
- CrestronDataBaseVersionFeedback.FireUpdate();
- EnvironmentVersionFeedback.FireUpdate();
-
- AggregatedProgramInfoFeedback.FireUpdate();
-
- OnProgramInfoChanged();
- }
-
- public void OnProgramInfoChanged()
- {
- //Debug.Console(1, "Firing ProgramInfoChanged for slot: {0}", Program.Number);
- var handler = ProgramInfoChanged;
- if (handler != null)
- {
- handler(this, new ProgramInfoEventArgs(ProgramInfo));
- }
- }
-
- private string ParseConsoleData(string data, string line, string startString, string endString)
- {
- var outputData = "";
-
- if (data.Length <= 0) return outputData;
-
- try
- {
- //Debug.Console(2, "ParseConsoleData Data: {0}, Line {1}, startStirng {2}, endString {3}", data, line, startString, endString);
- var linePosition = data.IndexOf(line, StringComparison.Ordinal);
- var startPosition = data.IndexOf(startString, linePosition, StringComparison.Ordinal) +
- startString.Length;
- var endPosition = data.IndexOf(endString, startPosition, StringComparison.Ordinal);
- outputData = data.Substring(startPosition, endPosition - startPosition).Trim();
- //Debug.Console(2, "ParseConsoleData Return: {0}", outputData);
- }
- catch (Exception e)
- {
- Debug.Console(1, "Error Parsing Console Data:\r{0}", e);
- }
-
- return outputData;
- }
- }
- }
-
- ///
- /// Class for serializing program slot information
- ///
- public class ProgramInfo
- {
- // Shared properties
-
- [JsonProperty("programNumber")]
- public uint ProgramNumber { get; private set; }
-
- [JsonConverter(typeof (StringEnumConverter))]
- [JsonProperty("operatingState")]
- public eProgramOperatingState OperatingState { get; set; }
-
- [JsonConverter(typeof (StringEnumConverter))]
- [JsonProperty("registrationState")]
- public eProgramRegistrationState RegistrationState { get; set; }
-
- [JsonProperty("programFile")]
- public string ProgramFile { get; set; }
-
- [JsonProperty("friendlyName")]
- public string FriendlyName { get; set; }
-
- [JsonProperty("compilerRevision")]
- public string CompilerRevision { get; set; }
-
- [JsonProperty("compileTime")]
- public string CompileTime { get; set; }
-
- [JsonProperty("include4Dat")]
- public string Include4Dat { get; set; }
-
- // SIMPL Windows properties
- [JsonProperty("systemName")]
- public string SystemName { get; set; }
-
- [JsonProperty("crestronDb")]
- public string CrestronDb { get; set; }
-
- [JsonProperty("environment")]
- public string Environment { get; set; }
-
- [JsonProperty("programmer")]
- public string Programmer { get; set; }
-
-
- // SSP Properties
- [JsonProperty("applicationName")]
- public string ApplicationName { get; set; }
-
- [JsonProperty("programTool")]
- public string ProgramTool { get; set; }
-
- [JsonProperty("minFirmwareVersion")]
- public string MinFirmwareVersion { get; set; }
-
- [JsonProperty("plugInVersion")]
- public string PlugInVersion { get; set; }
-
- public ProgramInfo(uint number)
- {
- ProgramNumber = number;
-
- ProgramFile = "";
- FriendlyName = "";
- CompilerRevision = "";
- CompileTime = "";
- Include4Dat = "";
-
- SystemName = "";
- CrestronDb = "";
- Environment = "";
- Programmer = "";
-
- ApplicationName = "";
- ProgramTool = "";
- MinFirmwareVersion = "";
- PlugInVersion = "";
- }
- }
-
- public class ProgramInfoEventArgs : EventArgs
- {
- public ProgramInfo ProgramInfo;
-
- public ProgramInfoEventArgs(ProgramInfo progInfo)
- {
- ProgramInfo = progInfo;
- }
- }
+ programSlotJoinStart = programSlotJoinStart + joinMap.ProgramOffsetJoin.JoinSpan;
+ }
+ }
+
+ //// Sets the time zone
+ //public void SetTimeZone(int timeZone)
+ //{
+ // SystemMonitor.TimeZoneInformation.TimeZoneNumber = timeZone;
+ //}
+
+ ///
+ /// Responds to program change events and triggers the appropriate feedbacks to update
+ ///
+ ///
+ ///
+ private void SystemMonitor_ProgramChange(Program sender, ProgramEventArgs args)
+ {
+ Debug.Console(2, this, "Program Change Detected for slot: {0}", sender.Number);
+ Debug.Console(2, this, "Event Type: {0}", args.EventType);
+
+ var program = ProgramStatusFeedbackCollection[sender.Number];
+
+ switch (args.EventType)
+ {
+ case eProgramChangeEventType.OperatingState:
+ program.ProgramStartedFeedback.FireUpdate();
+ program.ProgramStoppedFeedback.FireUpdate();
+ program.ProgramInfo.OperatingState = args.OperatingState;
+ if (args.OperatingState == eProgramOperatingState.Start)
+ program.GetProgramInfo();
+ else
+ {
+ program.AggregatedProgramInfoFeedback.FireUpdate();
+ program.OnProgramInfoChanged();
+ }
+ break;
+ case eProgramChangeEventType.RegistrationState:
+ program.ProgramRegisteredFeedback.FireUpdate();
+ program.ProgramUnregisteredFeedback.FireUpdate();
+ program.ProgramInfo.RegistrationState = args.RegistrationState;
+ program.GetProgramInfo();
+ break;
+ }
+ }
+
+ ///
+ /// Responds to time zone changes and updates the appropriate feedbacks
+ ///
+ ///
+ private void TimeZoneInformation_TimeZoneChange(TimeZoneEventArgs args)
+ {
+ Debug.Console(2, this, "Time Zone Change Detected.");
+ TimeZoneFeedback.FireUpdate();
+ TimeZoneTextFeedback.FireUpdate();
+
+ OnSystemMonitorPropertiesChanged();
+ }
+
+ public class EthernetStatusFeedbacks
+ {
+ public StringFeedback HostNameFeedback { get; protected set; }
+ public StringFeedback DnsServerFeedback { get; protected set; }
+ public StringFeedback DomainFeedback { get; protected set; }
+ public StringFeedback MacAddressFeedback { get; protected set; }
+ public StringFeedback DhcpStatusFeedback { get; protected set; }
+
+ public StringFeedback CurrentIpAddressFeedback { get; protected set; }
+ public StringFeedback CurrentSubnetMaskFeedback { get; protected set; }
+ public StringFeedback CurrentDefaultGatewayFeedback { get; protected set; }
+
+ public StringFeedback StaticIpAddressFeedback { get; protected set; }
+ public StringFeedback StaticSubnetMaskFeedback { get; protected set; }
+ public StringFeedback StaticDefaultGatewayFeedback { get; protected set; }
+
+ public EthernetStatusFeedbacks(short adapterIndex)
+ {
+ Debug.Console(2, "Ethernet Information for interface {0}", adapterIndex);
+ Debug.Console(2, "Adapter Index: {1} Hostname: {0}", CrestronEthernetHelper.GetEthernetParameter(
+ CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_HOSTNAME, adapterIndex), adapterIndex);
+ Debug.Console(2, "Adapter Index: {1} Current IP Address: {0}", CrestronEthernetHelper.GetEthernetParameter(
+ CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_CURRENT_IP_ADDRESS, adapterIndex), adapterIndex);
+ Debug.Console(2, "Adapter Index: {1} Current Subnet Mask: {0}", CrestronEthernetHelper.GetEthernetParameter(
+ CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_CURRENT_IP_MASK, adapterIndex), adapterIndex);
+ Debug.Console(2, "Adapter Index: {1} Current Router: {0}", CrestronEthernetHelper.GetEthernetParameter(
+ CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_CURRENT_ROUTER, adapterIndex), adapterIndex);
+ Debug.Console(2, "Adapter Index: {1} Static IP Address: {0}", CrestronEthernetHelper.GetEthernetParameter(
+ CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_STATIC_IPADDRESS, adapterIndex), adapterIndex);
+ Debug.Console(2, "Adapter Index: {1} Static Subnet Mask: {0}", CrestronEthernetHelper.GetEthernetParameter(
+ CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_STATIC_IPMASK, adapterIndex), adapterIndex);
+ Debug.Console(2, "Adapter Index: {1} Static Router: {0}", CrestronEthernetHelper.GetEthernetParameter(
+ CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_STATIC_ROUTER, adapterIndex), adapterIndex);
+ Debug.Console(2, "Adapter Index: {1} DNS Servers: {0}", CrestronEthernetHelper.GetEthernetParameter(
+ CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_DNS_SERVER, adapterIndex), adapterIndex);
+ Debug.Console(2, "Adapter Index: {1} DHCP State: {0}", CrestronEthernetHelper.GetEthernetParameter(
+ CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_CURRENT_DHCP_STATE, adapterIndex), adapterIndex);
+ Debug.Console(2, "Adapter Index: {1} Domain Name: {0}", CrestronEthernetHelper.GetEthernetParameter(
+ CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_DOMAIN_NAME, adapterIndex), adapterIndex);
+ Debug.Console(2, "Adapter Index: {1} MAC Address: {0}", CrestronEthernetHelper.GetEthernetParameter(
+ CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_MAC_ADDRESS, adapterIndex), adapterIndex);
+ HostNameFeedback =
+ new StringFeedback(
+ () =>
+ CrestronEthernetHelper.GetEthernetParameter(
+ CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_HOSTNAME, adapterIndex));
+
+ CurrentIpAddressFeedback =
+ new StringFeedback(
+ () =>
+ CrestronEthernetHelper.GetEthernetParameter(
+ CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_CURRENT_IP_ADDRESS, adapterIndex));
+ CurrentDefaultGatewayFeedback =
+ new StringFeedback(
+ () =>
+ CrestronEthernetHelper.GetEthernetParameter(
+ CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_CURRENT_ROUTER, adapterIndex));
+ CurrentSubnetMaskFeedback =
+ new StringFeedback(
+ () =>
+ CrestronEthernetHelper.GetEthernetParameter(
+ CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_CURRENT_IP_MASK, adapterIndex));
+ StaticIpAddressFeedback =
+ new StringFeedback(
+ () =>
+ CrestronEthernetHelper.GetEthernetParameter(
+ CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_CURRENT_IP_ADDRESS, adapterIndex));
+ StaticDefaultGatewayFeedback =
+ new StringFeedback(
+ () =>
+ CrestronEthernetHelper.GetEthernetParameter(
+ CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_CURRENT_ROUTER, adapterIndex));
+ StaticSubnetMaskFeedback =
+ new StringFeedback(
+ () =>
+ CrestronEthernetHelper.GetEthernetParameter(
+ CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_CURRENT_IP_MASK, adapterIndex));
+ DomainFeedback =
+ new StringFeedback(
+ () =>
+ CrestronEthernetHelper.GetEthernetParameter(
+ CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_DOMAIN_NAME, adapterIndex));
+ DnsServerFeedback =
+ new StringFeedback(
+ () =>
+ CrestronEthernetHelper.GetEthernetParameter(
+ CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_DNS_SERVER, adapterIndex));
+ MacAddressFeedback =
+ new StringFeedback(
+ () =>
+ CrestronEthernetHelper.GetEthernetParameter(
+ CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_MAC_ADDRESS, adapterIndex));
+
+ DhcpStatusFeedback = new StringFeedback(
+ () =>
+ CrestronEthernetHelper.GetEthernetParameter(
+ CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_CURRENT_DHCP_STATE, adapterIndex));
+ }
+
+ public void UpdateEthernetStatus()
+ {
+ HostNameFeedback.FireUpdate();
+ CurrentIpAddressFeedback.FireUpdate();
+ CurrentSubnetMaskFeedback.FireUpdate();
+ CurrentDefaultGatewayFeedback.FireUpdate();
+ StaticIpAddressFeedback.FireUpdate();
+ StaticSubnetMaskFeedback.FireUpdate();
+ StaticDefaultGatewayFeedback.FireUpdate();
+ DomainFeedback.FireUpdate();
+ DnsServerFeedback.FireUpdate();
+ MacAddressFeedback.FireUpdate();
+ DhcpStatusFeedback.FireUpdate();
+ }
+ }
+
+
+ public class ProgramStatusFeedbacks
+ {
+ public event EventHandler ProgramInfoChanged;
+
+ public Program Program;
+
+ public ProgramInfo ProgramInfo { get; set; }
+
+ public BoolFeedback ProgramStartedFeedback;
+ public BoolFeedback ProgramStoppedFeedback;
+ public BoolFeedback ProgramRegisteredFeedback;
+ public BoolFeedback ProgramUnregisteredFeedback;
+
+ public StringFeedback ProgramNameFeedback;
+ public StringFeedback ProgramCompileTimeFeedback;
+ public StringFeedback CrestronDataBaseVersionFeedback;
+ // SIMPL windows version
+ public StringFeedback EnvironmentVersionFeedback;
+ public StringFeedback AggregatedProgramInfoFeedback;
+
+ public ProgramStatusFeedbacks(Program program)
+ {
+ ProgramInfo = new ProgramInfo(program.Number);
+
+ Program = program;
+
+ ProgramInfo.OperatingState = Program.OperatingState;
+ ProgramInfo.RegistrationState = Program.RegistrationState;
+
+ ProgramStartedFeedback = new BoolFeedback(() => Program.OperatingState == eProgramOperatingState.Start);
+ ProgramStartedFeedback.FireUpdate();
+
+ ProgramStoppedFeedback = new BoolFeedback(() => Program.OperatingState == eProgramOperatingState.Stop);
+ ProgramStoppedFeedback.FireUpdate();
+
+ ProgramRegisteredFeedback =
+ new BoolFeedback(() => Program.RegistrationState == eProgramRegistrationState.Register);
+ ProgramRegisteredFeedback.FireUpdate();
+
+ ProgramUnregisteredFeedback =
+ new BoolFeedback(() => Program.RegistrationState == eProgramRegistrationState.Unregister);
+ ProgramUnregisteredFeedback.FireUpdate();
+
+ ProgramNameFeedback = new StringFeedback(() => ProgramInfo.ProgramFile);
+ ProgramCompileTimeFeedback = new StringFeedback(() => ProgramInfo.CompileTime);
+ CrestronDataBaseVersionFeedback = new StringFeedback(() => ProgramInfo.CrestronDb);
+ EnvironmentVersionFeedback = new StringFeedback(() => ProgramInfo.Environment);
+ AggregatedProgramInfoFeedback = new StringFeedback(() => JsonConvert.SerializeObject(ProgramInfo));
+
+ GetProgramInfo();
+ }
+
+ ///
+ /// Retrieves information about a running program
+ ///
+ public void GetProgramInfo()
+ {
+ CrestronInvoke.BeginInvoke(GetProgramInfo);
+ }
+
+ private void GetProgramInfo(object o)
+ {
+ Debug.Console(2, "Attempting to get program info for slot: {0}", Program.Number);
+
+ string response = null;
+
+ if (Program.RegistrationState == eProgramRegistrationState.Unregister || Program.OperatingState == eProgramOperatingState.Stop)
+ {
+ Debug.Console(2, "Program {0} not registered. Setting default values for program information.",
+ Program.Number);
+
+ ProgramInfo = new ProgramInfo(Program.Number)
+ {
+ OperatingState = Program.OperatingState,
+ RegistrationState = Program.RegistrationState
+ };
+
+ return;
+ }
+
+ var success = CrestronConsole.SendControlSystemCommand(
+ string.Format("progcomments:{0}", Program.Number), ref response);
+
+ if (!success)
+ {
+ Debug.Console(2, "Progcomments Attempt Unsuccessful for slot: {0}", Program.Number);
+ UpdateFeedbacks();
+ return;
+ }
+
+ if (response.ToLower().Contains("bad or incomplete"))
+ {
+ Debug.Console(2,
+ "Program in slot {0} not running. Setting default ProgramInfo for slot: {0}",
+ Program.Number);
+
+ // Assume no valid program info. Constructing a new object will wipe all properties
+ ProgramInfo = new ProgramInfo(Program.Number)
+ {
+ OperatingState = Program.OperatingState,
+ RegistrationState = Program.RegistrationState
+ };
+
+ UpdateFeedbacks();
+
+ return;
+ }
+
+
+ // Shared properteis
+ ProgramInfo.ProgramFile = ParseConsoleData(response, "Program File", ": ", "\n");
+ ProgramInfo.CompilerRevision = ParseConsoleData(response, "Compiler Rev", ": ", "\n");
+ ProgramInfo.CompileTime = ParseConsoleData(response, "Compiled On", ": ", "\n");
+ ProgramInfo.Include4Dat = ParseConsoleData(response, "Include4.dat", ": ", "\n");
+
+
+ if (ProgramInfo.ProgramFile.Contains(".dll"))
+ {
+ // SSP Program
+ ProgramInfo.FriendlyName = ParseConsoleData(response, "Friendly Name", ": ", "\n");
+ ProgramInfo.ApplicationName = ParseConsoleData(response, "Application Name", ": ", "\n");
+ ProgramInfo.ProgramTool = ParseConsoleData(response, "Program Tool", ": ", "\n");
+ ProgramInfo.MinFirmwareVersion = ParseConsoleData(response, "Min Firmware Version", ": ",
+ "\n");
+ ProgramInfo.PlugInVersion = ParseConsoleData(response, "PlugInVersion", ": ", "\n");
+ }
+ else if (ProgramInfo.ProgramFile.Contains(".smw"))
+ {
+ // SIMPL Windows Program
+ ProgramInfo.FriendlyName = ParseConsoleData(response, "Friendly Name", ":", "\n");
+ ProgramInfo.SystemName = ParseConsoleData(response, "System Name", ": ", "\n");
+ ProgramInfo.CrestronDb = ParseConsoleData(response, "CrestronDB", ": ", "\n");
+ ProgramInfo.Environment = ParseConsoleData(response, "Source Env", ": ", "\n");
+ ProgramInfo.Programmer = ParseConsoleData(response, "Programmer", ": ", "\n");
+ }
+ Debug.Console(2, "Program info for slot {0} successfully updated", Program.Number);
+
+ UpdateFeedbacks();
+ }
+
+ private void UpdateFeedbacks()
+ {
+ ProgramNameFeedback.FireUpdate();
+ ProgramCompileTimeFeedback.FireUpdate();
+ CrestronDataBaseVersionFeedback.FireUpdate();
+ EnvironmentVersionFeedback.FireUpdate();
+
+ AggregatedProgramInfoFeedback.FireUpdate();
+
+ OnProgramInfoChanged();
+ }
+
+ public void OnProgramInfoChanged()
+ {
+ //Debug.Console(1, "Firing ProgramInfoChanged for slot: {0}", Program.Number);
+ var handler = ProgramInfoChanged;
+ if (handler != null)
+ {
+ handler(this, new ProgramInfoEventArgs(ProgramInfo));
+ }
+ }
+
+ private string ParseConsoleData(string data, string line, string startString, string endString)
+ {
+ var outputData = "";
+
+ if (data.Length <= 0) return outputData;
+
+ try
+ {
+ //Debug.Console(2, "ParseConsoleData Data: {0}, Line {1}, startStirng {2}, endString {3}", data, line, startString, endString);
+ var linePosition = data.IndexOf(line, StringComparison.Ordinal);
+ var startPosition = data.IndexOf(startString, linePosition, StringComparison.Ordinal) +
+ startString.Length;
+ var endPosition = data.IndexOf(endString, startPosition, StringComparison.Ordinal);
+ outputData = data.Substring(startPosition, endPosition - startPosition).Trim();
+ //Debug.Console(2, "ParseConsoleData Return: {0}", outputData);
+ }
+ catch (Exception e)
+ {
+ Debug.Console(1, "Error Parsing Console Data:\r{0}", e);
+ }
+
+ return outputData;
+ }
+ }
+ }
+
+ ///
+ /// Class for serializing program slot information
+ ///
+ public class ProgramInfo
+ {
+ // Shared properties
+
+ [JsonProperty("programNumber")]
+ public uint ProgramNumber { get; private set; }
+
+ [JsonConverter(typeof (StringEnumConverter))]
+ [JsonProperty("operatingState")]
+ public eProgramOperatingState OperatingState { get; set; }
+
+ [JsonConverter(typeof (StringEnumConverter))]
+ [JsonProperty("registrationState")]
+ public eProgramRegistrationState RegistrationState { get; set; }
+
+ [JsonProperty("programFile")]
+ public string ProgramFile { get; set; }
+
+ [JsonProperty("friendlyName")]
+ public string FriendlyName { get; set; }
+
+ [JsonProperty("compilerRevision")]
+ public string CompilerRevision { get; set; }
+
+ [JsonProperty("compileTime")]
+ public string CompileTime { get; set; }
+
+ [JsonProperty("include4Dat")]
+ public string Include4Dat { get; set; }
+
+ // SIMPL Windows properties
+ [JsonProperty("systemName")]
+ public string SystemName { get; set; }
+
+ [JsonProperty("crestronDb")]
+ public string CrestronDb { get; set; }
+
+ [JsonProperty("environment")]
+ public string Environment { get; set; }
+
+ [JsonProperty("programmer")]
+ public string Programmer { get; set; }
+
+
+ // SSP Properties
+ [JsonProperty("applicationName")]
+ public string ApplicationName { get; set; }
+
+ [JsonProperty("programTool")]
+ public string ProgramTool { get; set; }
+
+ [JsonProperty("minFirmwareVersion")]
+ public string MinFirmwareVersion { get; set; }
+
+ [JsonProperty("plugInVersion")]
+ public string PlugInVersion { get; set; }
+
+ public ProgramInfo(uint number)
+ {
+ ProgramNumber = number;
+
+ ProgramFile = "";
+ FriendlyName = "";
+ CompilerRevision = "";
+ CompileTime = "";
+ Include4Dat = "";
+
+ SystemName = "";
+ CrestronDb = "";
+ Environment = "";
+ Programmer = "";
+
+ ApplicationName = "";
+ ProgramTool = "";
+ MinFirmwareVersion = "";
+ PlugInVersion = "";
+ }
+ }
+
+ public class ProgramInfoEventArgs : EventArgs
+ {
+ public ProgramInfo ProgramInfo;
+
+ public ProgramInfoEventArgs(ProgramInfo progInfo)
+ {
+ ProgramInfo = progInfo;
+ }
+ }
}
\ No newline at end of file
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Occupancy/CenOdtOccupancySensorBaseController.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Occupancy/CenOdtOccupancySensorBaseController.cs
index 603abeef..eae2f993 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Occupancy/CenOdtOccupancySensorBaseController.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Occupancy/CenOdtOccupancySensorBaseController.cs
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
+using System.Resources;
using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro.DeviceSupport;
@@ -13,561 +14,762 @@ using PepperDash.Essentials.Core.Bridges;
namespace PepperDash.Essentials.Core
{
- [Description("Wrapper class for CEN-ODT-C-POE")]
- public class CenOdtOccupancySensorBaseController : CrestronGenericBridgeableBaseDevice, IOccupancyStatusProvider
- {
- public CenOdtCPoe OccSensor { get; private set; }
+ [Description("Wrapper class for CEN-ODT-C-POE")]
+ [ConfigSnippet("\"properties\": {\"control\": {\"method\": \"cresnet\",\"cresnetId\": \"97\"},\"enablePir\": true,\"enableLedFlash\": true,\"enableRawStates\":true,\"remoteTimeout\": 30,\"internalPhotoSensorMinChange\": 0,\"externalPhotoSensorMinChange\": 0,\"enableUsA\": true,\"enableUsB\": true,\"orWhenVacatedState\": true}")]
+ public class CenOdtOccupancySensorBaseController : CrestronGenericBridgeableBaseDevice, IOccupancyStatusProvider
+ {
+ public CenOdtCPoe OccSensor { get; private set; }
- public BoolFeedback RoomIsOccupiedFeedback { get; private set; }
+ public GlsOccupancySensorPropertiesConfig PropertiesConfig { get; private set; }
- public BoolFeedback GraceOccupancyDetectedFeedback { get; private set; }
+ public BoolFeedback RoomIsOccupiedFeedback { get; private set; }
- public BoolFeedback RawOccupancyFeedback { get; private set; }
+ public BoolFeedback GraceOccupancyDetectedFeedback { get; private set; }
- public BoolFeedback PirSensorEnabledFeedback { get; private set; }
+ public BoolFeedback RawOccupancyFeedback { get; private set; }
- public BoolFeedback LedFlashEnabledFeedback { get; private set; }
+ public BoolFeedback PirSensorEnabledFeedback { get; private set; }
- public BoolFeedback ShortTimeoutEnabledFeedback { get; private set; }
+ public BoolFeedback LedFlashEnabledFeedback { get; private set; }
- public IntFeedback PirSensitivityInVacantStateFeedback { get; private set; }
+ public BoolFeedback ShortTimeoutEnabledFeedback { get; private set; }
- public IntFeedback PirSensitivityInOccupiedStateFeedback { get; private set; }
+ public IntFeedback PirSensitivityInVacantStateFeedback { get; private set; }
- public IntFeedback CurrentTimeoutFeedback { get; private set; }
+ public IntFeedback PirSensitivityInOccupiedStateFeedback { get; private set; }
- public IntFeedback RemoteTimeoutFeedback { get; private set; }
+ public IntFeedback CurrentTimeoutFeedback { get; private set; }
- public IntFeedback InternalPhotoSensorValue { get; set; }
+ public IntFeedback RemoteTimeoutFeedback { get; private set; }
- public IntFeedback ExternalPhotoSensorValue { get; set; }
+ public IntFeedback InternalPhotoSensorValue { get; set; }
- public BoolFeedback OrWhenVacatedFeedback { get; private set; }
+ public IntFeedback ExternalPhotoSensorValue { get; set; }
- public BoolFeedback AndWhenVacatedFeedback { get; private set; }
+ public BoolFeedback OrWhenVacatedFeedback { get; private set; }
- public BoolFeedback UltrasonicAEnabledFeedback { get; private set; }
+ public BoolFeedback AndWhenVacatedFeedback { get; private set; }
- public BoolFeedback UltrasonicBEnabledFeedback { get; private set; }
+ public BoolFeedback UltrasonicAEnabledFeedback { get; private set; }
- public IntFeedback UltrasonicSensitivityInVacantStateFeedback { get; private set; }
+ public BoolFeedback UltrasonicBEnabledFeedback { get; private set; }
- public IntFeedback UltrasonicSensitivityInOccupiedStateFeedback { get; private set; }
+ public IntFeedback UltrasonicSensitivityInVacantStateFeedback { get; private set; }
- public BoolFeedback RawOccupancyPirFeedback { get; private set; }
+ public IntFeedback UltrasonicSensitivityInOccupiedStateFeedback { get; private set; }
- public BoolFeedback RawOccupancyUsFeedback { get; private set; }
+ public BoolFeedback RawOccupancyPirFeedback { get; private set; }
- // Debug properties
- public bool InTestMode { get; private set; }
+ public BoolFeedback RawOccupancyUsFeedback { get; private set; }
- public bool TestRoomIsOccupiedFeedback { get; private set; }
+ public BoolFeedback IdentityModeFeedback { get; private set; }
- public Func RoomIsOccupiedFeedbackFunc
- {
- get
+ // Debug properties
+ public bool InTestMode { get; private set; }
+
+ public bool TestRoomIsOccupiedFeedback { get; private set; }
+
+ public Func RoomIsOccupiedFeedbackFunc
+ {
+ get
+ {
+ return () => InTestMode ? TestRoomIsOccupiedFeedback : OccSensor.OccupancyDetectedFeedback.BoolValue;
+ }
+ }
+
+ public CenOdtOccupancySensorBaseController(string key, string name, CenOdtCPoe sensor, GlsOccupancySensorPropertiesConfig config)
+ : base(key, name, sensor)
+ {
+ PropertiesConfig = config;
+
+ OccSensor = sensor;
+
+ RoomIsOccupiedFeedback = new BoolFeedback(RoomIsOccupiedFeedbackFunc);
+
+ PirSensorEnabledFeedback = new BoolFeedback(() => OccSensor.PassiveInfraredSensorEnabledFeedback.BoolValue);
+
+ LedFlashEnabledFeedback = new BoolFeedback(() => OccSensor.LedFlashEnabledFeedback.BoolValue);
+
+ ShortTimeoutEnabledFeedback = new BoolFeedback(() => OccSensor.ShortTimeoutEnabledFeedback.BoolValue);
+
+ PirSensitivityInVacantStateFeedback = new IntFeedback(() => (int)OccSensor.PassiveInfraredSensorSensitivityInVacantStateFeedback);
+
+ PirSensitivityInOccupiedStateFeedback = new IntFeedback(() => (int)OccSensor.PassiveInfraredSensorSensitivityInOccupiedStateFeedback);
+
+ CurrentTimeoutFeedback = new IntFeedback(() => OccSensor.CurrentTimeoutFeedback.UShortValue);
+
+ RemoteTimeoutFeedback = new IntFeedback(() => OccSensor.RemoteTimeout.UShortValue);
+
+ GraceOccupancyDetectedFeedback = new BoolFeedback(() => OccSensor.GraceOccupancyDetectedFeedback.BoolValue);
+
+ RawOccupancyFeedback = new BoolFeedback(() => OccSensor.RawOccupancyDetectedFeedback.BoolValue);
+
+ InternalPhotoSensorValue = new IntFeedback(() => OccSensor.InternalPhotoSensorValueFeedback.UShortValue);
+
+ //ExternalPhotoSensorValue = new IntFeedback(() => OccSensor.ex.UShortValue);
+
+ AndWhenVacatedFeedback = new BoolFeedback(() => OccSensor.AndWhenVacatedFeedback.BoolValue);
+
+ OrWhenVacatedFeedback = new BoolFeedback(() => OccSensor.OrWhenVacatedFeedback.BoolValue);
+
+ UltrasonicAEnabledFeedback = new BoolFeedback(() => OccSensor.UltrasonicSensorSideAEnabledFeedback.BoolValue);
+
+ UltrasonicBEnabledFeedback = new BoolFeedback(() => OccSensor.UltrasonicSensorSideBEnabledFeedback.BoolValue);
+
+ RawOccupancyPirFeedback = new BoolFeedback(() => OccSensor.RawOccupancyDetectedByPassiveInfraredSensorFeedback.BoolValue);
+
+ RawOccupancyUsFeedback = new BoolFeedback(() => OccSensor.RawOccupancyDetectedByUltrasonicSensorFeedback.BoolValue);
+
+ IdentityModeFeedback = new BoolFeedback(()=>OccSensor.IdentityModeOnFeedback.BoolValue);
+
+ UltrasonicSensitivityInVacantStateFeedback = new IntFeedback(() => (int)OccSensor.UltrasonicSensorSensitivityInVacantStateFeedback);
+
+ UltrasonicSensitivityInOccupiedStateFeedback = new IntFeedback(() => (int)OccSensor.UltrasonicSensorSensitivityInOccupiedStateFeedback);
+
+ OccSensor.BaseEvent += new Crestron.SimplSharpPro.BaseEventHandler(OccSensor_BaseEvent);
+
+ OccSensor.CenOccupancySensorChange += new GenericEventHandler(OccSensor_CenOccupancySensorChange);
+
+ AddPostActivationAction(() =>
{
- return () => InTestMode ? TestRoomIsOccupiedFeedback : OccSensor.OccupancyDetectedFeedback.BoolValue;
- }
- }
-
- public CenOdtOccupancySensorBaseController(string key, string name, CenOdtCPoe sensor)
- : base(key, name, sensor)
- {
- OccSensor = sensor;
-
- RoomIsOccupiedFeedback = new BoolFeedback(RoomIsOccupiedFeedbackFunc);
-
- PirSensorEnabledFeedback = new BoolFeedback(() => OccSensor.PassiveInfraredSensorEnabledFeedback.BoolValue);
-
- LedFlashEnabledFeedback = new BoolFeedback(() => OccSensor.LedFlashEnabledFeedback.BoolValue);
-
- ShortTimeoutEnabledFeedback = new BoolFeedback(() => OccSensor.ShortTimeoutEnabledFeedback.BoolValue);
-
- PirSensitivityInVacantStateFeedback = new IntFeedback(() => (int)OccSensor.PassiveInfraredSensorSensitivityInVacantStateFeedback);
-
- PirSensitivityInOccupiedStateFeedback = new IntFeedback(() => (int)OccSensor.PassiveInfraredSensorSensitivityInOccupiedStateFeedback);
-
- CurrentTimeoutFeedback = new IntFeedback(() => OccSensor.CurrentTimeoutFeedback.UShortValue);
-
- RemoteTimeoutFeedback = new IntFeedback(() => OccSensor.RemoteTimeout.UShortValue);
-
- GraceOccupancyDetectedFeedback = new BoolFeedback(() => OccSensor.GraceOccupancyDetectedFeedback.BoolValue);
-
- RawOccupancyFeedback = new BoolFeedback(() => OccSensor.RawOccupancyDetectedFeedback.BoolValue);
-
- InternalPhotoSensorValue = new IntFeedback(() => OccSensor.InternalPhotoSensorValueFeedback.UShortValue);
-
- //ExternalPhotoSensorValue = new IntFeedback(() => OccSensor.ex.UShortValue);
-
- AndWhenVacatedFeedback = new BoolFeedback(() => OccSensor.AndWhenVacatedFeedback.BoolValue);
-
- OrWhenVacatedFeedback = new BoolFeedback(() => OccSensor.OrWhenVacatedFeedback.BoolValue);
-
- UltrasonicAEnabledFeedback = new BoolFeedback(() => OccSensor.UltrasonicSensorSideAEnabledFeedback.BoolValue);
-
- UltrasonicBEnabledFeedback = new BoolFeedback(() => OccSensor.UltrasonicSensorSideBEnabledFeedback.BoolValue);
-
- RawOccupancyPirFeedback = new BoolFeedback(() => OccSensor.RawOccupancyDetectedByPassiveInfraredSensorFeedback.BoolValue);
-
- RawOccupancyUsFeedback = new BoolFeedback(() => OccSensor.RawOccupancyDetectedByUltrasonicSensorFeedback.BoolValue);
-
- UltrasonicSensitivityInVacantStateFeedback = new IntFeedback(() => (int)OccSensor.UltrasonicSensorSensitivityInVacantStateFeedback);
-
- UltrasonicSensitivityInOccupiedStateFeedback = new IntFeedback(() => (int)OccSensor.UltrasonicSensorSensitivityInOccupiedStateFeedback);
-
- OccSensor.BaseEvent += new Crestron.SimplSharpPro.BaseEventHandler(OccSensor_BaseEvent);
-
- OccSensor.CenOccupancySensorChange += new GenericEventHandler(OccSensor_CenOccupancySensorChange);
-
- }
-
-
-
-
-
-
- ///
- /// Catches events for feedbacks on the base class. Any extending wrapper class should call this delegate after it checks for it's own event IDs.
- ///
- ///
- ///
- protected virtual void OccSensor_CenOccupancySensorChange(object device, GenericEventArgs args)
- {
- if (args.EventId == GlsOccupancySensorBase.PirEnabledFeedbackEventId)
- PirSensorEnabledFeedback.FireUpdate();
- else if (args.EventId == GlsOccupancySensorBase.LedFlashEnabledFeedbackEventId)
- LedFlashEnabledFeedback.FireUpdate();
- else if (args.EventId == GlsOccupancySensorBase.ShortTimeoutEnabledFeedbackEventId)
- ShortTimeoutEnabledFeedback.FireUpdate();
- else if (args.EventId == GlsOccupancySensorBase.PirSensitivityInOccupiedStateFeedbackEventId)
- PirSensitivityInOccupiedStateFeedback.FireUpdate();
- else if (args.EventId == GlsOccupancySensorBase.PirSensitivityInVacantStateFeedbackEventId)
- PirSensitivityInVacantStateFeedback.FireUpdate();
- else if (args.EventId == GlsOccupancySensorBase.RawOccupancyPirFeedbackEventId)
- RawOccupancyPirFeedback.FireUpdate();
- else if (args.EventId == GlsOccupancySensorBase.RawOccupancyUsFeedbackEventId)
- RawOccupancyUsFeedback.FireUpdate();
- }
-
- protected virtual void OccSensor_BaseEvent(Crestron.SimplSharpPro.GenericBase device, Crestron.SimplSharpPro.BaseEventArgs args)
- {
- Debug.Console(2, this, "PoEOccupancySensorChange EventId: {0}", args.EventId);
-
- if (args.EventId == Crestron.SimplSharpPro.GeneralIO.GlsOccupancySensorBase.RoomOccupiedFeedbackEventId
- || args.EventId == Crestron.SimplSharpPro.GeneralIO.GlsOccupancySensorBase.RoomVacantFeedbackEventId)
- {
- Debug.Console(1, this, "Occupancy State: {0}", OccSensor.OccupancyDetectedFeedback.BoolValue);
- RoomIsOccupiedFeedback.FireUpdate();
- }
- else if (args.EventId == GlsOccupancySensorBase.TimeoutFeedbackEventId)
- CurrentTimeoutFeedback.FireUpdate();
- else if (args.EventId == GlsOccupancySensorBase.TimeoutLocalFeedbackEventId)
- RemoteTimeoutFeedback.FireUpdate();
- else if (args.EventId == GlsOccupancySensorBase.GraceOccupancyDetectedFeedbackEventId)
- GraceOccupancyDetectedFeedback.FireUpdate();
- else if (args.EventId == GlsOccupancySensorBase.RawOccupancyFeedbackEventId)
- RawOccupancyFeedback.FireUpdate();
- else if (args.EventId == GlsOccupancySensorBase.InternalPhotoSensorValueFeedbackEventId)
- InternalPhotoSensorValue.FireUpdate();
- else if (args.EventId == GlsOccupancySensorBase.ExternalPhotoSensorValueFeedbackEventId)
- ExternalPhotoSensorValue.FireUpdate();
- else if (args.EventId == GlsOccupancySensorBase.AndWhenVacatedFeedbackEventId)
- AndWhenVacatedFeedback.FireUpdate();
- else if (args.EventId == GlsOccupancySensorBase.OrWhenVacatedFeedbackEventId)
- OrWhenVacatedFeedback.FireUpdate();
- else if (args.EventId == GlsOccupancySensorBase.UsAEnabledFeedbackEventId)
- UltrasonicAEnabledFeedback.FireUpdate();
- else if (args.EventId == GlsOccupancySensorBase.UsBEnabledFeedbackEventId)
- UltrasonicBEnabledFeedback.FireUpdate();
- else if (args.EventId == GlsOccupancySensorBase.UsSensitivityInOccupiedStateFeedbackEventId)
- UltrasonicSensitivityInOccupiedStateFeedback.FireUpdate();
- else if (args.EventId == GlsOccupancySensorBase.UsSensitivityInVacantStateFeedbackEventId)
- UltrasonicSensitivityInVacantStateFeedback.FireUpdate();
- }
-
- public void SetTestMode(bool mode)
- {
- InTestMode = mode;
-
- Debug.Console(1, this, "In Mock Mode: '{0}'", InTestMode);
- }
-
- public void SetTestOccupiedState(bool state)
- {
- if (!InTestMode)
- Debug.Console(1, "Mock mode not enabled");
- else
- {
- TestRoomIsOccupiedFeedback = state;
-
- RoomIsOccupiedFeedback.FireUpdate();
- }
- }
-
- ///
- /// Enables or disables the PIR sensor
- ///
- ///
- public void SetPirEnable(bool state)
- {
- if (state)
- {
- OccSensor.EnablePassiveInfraredSensor();
- }
- else
- {
- OccSensor.DisablePassiveInfraredSensor();
- }
- }
-
- ///
- /// Enables or disables the LED Flash
- ///
- ///
- public void SetLedFlashEnable(bool state)
- {
- if (state)
- {
- OccSensor.EnableLedFlash();
- }
- else
- {
- OccSensor.DisableLedFlash();
- }
- }
-
- ///
- /// Enables or disables short timeout based on state
- ///
- ///
- public void SetShortTimeoutState(bool state)
- {
- if (state)
- {
- OccSensor.EnableShortTimeout();
- }
- else
- {
- OccSensor.DisableShortTimeout();
- }
- }
-
- public void IncrementPirSensitivityInOccupiedState(bool pressRelease)
- {
- if ((int)OccSensor.PassiveInfraredSensorSensitivityInOccupiedStateFeedback != 3)
- {
- OccSensor.PassiveInfraredSensorSensitivityInOccupiedState = OccSensor.PassiveInfraredSensorSensitivityInOccupiedStateFeedback + 1;
- }
- }
-
- public void DecrementPirSensitivityInOccupiedState(bool pressRelease)
- {
- if ((int)OccSensor.PassiveInfraredSensorSensitivityInOccupiedStateFeedback != 0)
- {
- OccSensor.PassiveInfraredSensorSensitivityInOccupiedState = OccSensor.PassiveInfraredSensorSensitivityInOccupiedStateFeedback - 1;
- }
- }
-
- public void IncrementPirSensitivityInVacantState(bool pressRelease)
- {
- if ((int)OccSensor.PassiveInfraredSensorSensitivityInVacantStateFeedback != 3)
- {
- OccSensor.PassiveInfraredSensorSensitivityInVacantState = OccSensor.PassiveInfraredSensorSensitivityInVacantStateFeedback + 1;
- }
- }
-
- public void DecrementPirSensitivityInVacantState(bool pressRelease)
- {
- if ((int)OccSensor.PassiveInfraredSensorSensitivityInVacantStateFeedback != 0)
- {
- OccSensor.PassiveInfraredSensorSensitivityInVacantState = OccSensor.PassiveInfraredSensorSensitivityInVacantStateFeedback - 1;
- }
- }
-
- public void IncrementUsSensitivityInOccupiedState(bool pressRelease)
- {
- if ((int)OccSensor.UltrasonicSensorSensitivityInOccupiedStateFeedback < 3)
- {
- OccSensor.UltrasonicSensorSensitivityInOccupiedState = OccSensor.UltrasonicSensorSensitivityInOccupiedStateFeedback + 1;
- }
- else if ((int)OccSensor.UltrasonicSensorSensitivityInOccupiedStateFeedback > 4)
- {
- OccSensor.UltrasonicSensorSensitivityInOccupiedState = OccSensor.UltrasonicSensorSensitivityInOccupiedStateFeedback - 1;
- }
- else if ((int)OccSensor.UltrasonicSensorSensitivityInOccupiedStateFeedback == 4)
- {
- OccSensor.UltrasonicSensorSensitivityInOccupiedState = 0;
- }
- }
-
- public void DecrementUsSensitivityInOccupiedState(bool pressRelease)
- {
- if ((int)OccSensor.UltrasonicSensorSensitivityInOccupiedStateFeedback > 0
- && (int)OccSensor.UltrasonicSensorSensitivityInOccupiedStateFeedback < 4)
- {
- OccSensor.UltrasonicSensorSensitivityInOccupiedState = OccSensor.UltrasonicSensorSensitivityInOccupiedStateFeedback - 1;
- }
- else if ((int)OccSensor.UltrasonicSensorSensitivityInOccupiedStateFeedback > 3
- && (int)OccSensor.UltrasonicSensorSensitivityInOccupiedStateFeedback < 7)
- {
- OccSensor.UltrasonicSensorSensitivityInOccupiedState = OccSensor.UltrasonicSensorSensitivityInOccupiedStateFeedback + 1;
- }
- }
-
- public void IncrementUsSensitivityInVacantState(bool pressRelease)
- {
- if ((int)OccSensor.UltrasonicSensorSensitivityInVacantStateFeedback < 3)
- {
- OccSensor.UltrasonicSensorSensitivityInVacantState = OccSensor.UltrasonicSensorSensitivityInVacantStateFeedback + 1;
- }
- else if ((int)OccSensor.UltrasonicSensorSensitivityInVacantStateFeedback > 4)
- {
- OccSensor.UltrasonicSensorSensitivityInVacantState = OccSensor.UltrasonicSensorSensitivityInVacantStateFeedback - 1;
- }
- else if ((int)OccSensor.UltrasonicSensorSensitivityInVacantStateFeedback == 4)
- {
- OccSensor.UltrasonicSensorSensitivityInVacantState = 0;
- }
- }
-
- public void DecrementUsSensitivityInVacantState(bool pressRelease)
- {
- if ((int)OccSensor.UltrasonicSensorSensitivityInVacantStateFeedback > 0
- && (int)OccSensor.UltrasonicSensorSensitivityInVacantStateFeedback < 4)
- {
- OccSensor.UltrasonicSensorSensitivityInVacantState = OccSensor.UltrasonicSensorSensitivityInVacantStateFeedback - 1;
- }
- else if ((int)OccSensor.UltrasonicSensorSensitivityInVacantStateFeedback > 3
- && (int)OccSensor.UltrasonicSensorSensitivityInVacantStateFeedback < 7)
- {
- OccSensor.UltrasonicSensorSensitivityInVacantState = OccSensor.UltrasonicSensorSensitivityInVacantStateFeedback + 1;
- }
- }
-
- public void ForceOccupied()
- {
- OccSensor.ForceOccupied();
- }
-
- public void ForceVacant()
- {
- OccSensor.ForceVacant();
- }
-
- public void EnableRawStates(bool state)
- {
- if (state)
- {
- OccSensor.EnableRawStates();
- }
- else
- OccSensor.DisableRawStates();
- }
-
- public void SetRemoteTimeout(ushort time)
- {
- OccSensor.RemoteTimeout.UShortValue = time;
- }
-
- public void SetInternalPhotoSensorMinChange(ushort value)
- {
- OccSensor.InternalPhotoSensorMinimumChange.UShortValue = value;
- }
-
- ///
- /// Sets the OrWhenVacated state
- ///
- ///
- public void SetOrWhenVacatedState(bool state)
- {
- if (state)
- {
- OccSensor.OrWhenVacated();
- }
- }
-
- ///
- /// Sets the AndWhenVacated state
- ///
- ///
- public void SetAndWhenVacatedState(bool state)
- {
- if (state)
- {
- OccSensor.AndWhenVacated();
- }
- }
-
- ///
- /// Enables or disables the Ultrasonic A sensor
- ///
- ///
- public void SetUsAEnable(bool state)
- {
- if (state)
- {
- OccSensor.EnableUltrasonicSensorSideA();
- }
- else
- {
- OccSensor.DisableUltrasonicSensorSideA();
- }
- }
-
-
- ///
- /// Enables or disables the Ultrasonic B sensor
- ///
- ///
- public void SetUsBEnable(bool state)
- {
- if (state)
- {
- OccSensor.EnableUltrasonicSensorSideB();
- }
- else
- {
- OccSensor.DisableUltrasonicSensorSideB();
- }
- }
-
- public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
- {
- LinkOccSensorToApi(this, trilist, joinStart, joinMapKey, bridge);
- }
-
- protected void LinkOccSensorToApi(CenOdtOccupancySensorBaseController occController,
- BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
- {
- CenOdtOccupancySensorBaseJoinMap joinMap = new CenOdtOccupancySensorBaseJoinMap(joinStart);
-
- var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
-
- if (!string.IsNullOrEmpty(joinMapSerialized))
- joinMap = JsonConvert.DeserializeObject(joinMapSerialized);
-
- if (bridge != null)
- {
- bridge.AddJoinMap(Key, joinMap);
- }
- else
- {
- Debug.Console(0, this, "Please update config to use 'eiscapiadvanced' to get all join map features for this device.");
- }
-
- Debug.Console(1, occController, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
-
- occController.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.Online.JoinNumber]);
- trilist.StringInput[joinMap.Name.JoinNumber].StringValue = occController.Name;
-
- trilist.OnlineStatusChange += new Crestron.SimplSharpPro.OnlineStatusChangeEventHandler((d, args) =>
- {
- if (args.DeviceOnLine)
+ OccSensor.OnlineStatusChange += (o, a) =>
{
- trilist.StringInput[joinMap.Name.JoinNumber].StringValue = occController.Name;
- }
- }
- );
+ if (a.DeviceOnLine)
+ {
+ ApplySettingsToSensorFromConfig();
+ }
+ };
- // Occupied status
- trilist.SetSigTrueAction(joinMap.ForceOccupied.JoinNumber, new Action(() => occController.ForceOccupied()));
- trilist.SetSigTrueAction(joinMap.ForceVacant.JoinNumber, new Action(() => occController.ForceVacant()));
- occController.RoomIsOccupiedFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RoomOccupiedFeedback.JoinNumber]);
- occController.RoomIsOccupiedFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.RoomVacantFeedback.JoinNumber]);
- occController.RawOccupancyFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RawOccupancyFeedback.JoinNumber]);
- trilist.SetBoolSigAction(joinMap.EnableRawStates.JoinNumber, new Action((b) => occController.EnableRawStates(b)));
-
- // Timouts
- trilist.SetUShortSigAction(joinMap.Timeout.JoinNumber, new Action((u) => occController.SetRemoteTimeout(u)));
- occController.CurrentTimeoutFeedback.LinkInputSig(trilist.UShortInput[joinMap.Timeout.JoinNumber]);
- occController.RemoteTimeoutFeedback.LinkInputSig(trilist.UShortInput[joinMap.TimeoutLocalFeedback.JoinNumber]);
-
- // LED Flash
- trilist.SetSigTrueAction(joinMap.EnableLedFlash.JoinNumber, new Action(() => occController.SetLedFlashEnable(true)));
- trilist.SetSigTrueAction(joinMap.DisableLedFlash.JoinNumber, new Action(() => occController.SetLedFlashEnable(false)));
- occController.LedFlashEnabledFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.EnableLedFlash.JoinNumber]);
-
- // Short Timeout
- trilist.SetSigTrueAction(joinMap.EnableShortTimeout.JoinNumber, new Action(() => occController.SetShortTimeoutState(true)));
- trilist.SetSigTrueAction(joinMap.DisableShortTimeout.JoinNumber, new Action(() => occController.SetShortTimeoutState(false)));
- occController.ShortTimeoutEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.EnableShortTimeout.JoinNumber]);
-
- // PIR Sensor
- trilist.SetSigTrueAction(joinMap.EnablePir.JoinNumber, new Action(() => occController.SetPirEnable(true)));
- trilist.SetSigTrueAction(joinMap.DisablePir.JoinNumber, new Action(() => occController.SetPirEnable(false)));
- occController.PirSensorEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.EnablePir.JoinNumber]);
-
- // PIR Sensitivity in Occupied State
- trilist.SetBoolSigAction(joinMap.IncrementPirInOccupiedState.JoinNumber, new Action((b) => occController.IncrementPirSensitivityInOccupiedState(b)));
- trilist.SetBoolSigAction(joinMap.DecrementPirInOccupiedState.JoinNumber, new Action((b) => occController.DecrementPirSensitivityInOccupiedState(b)));
- occController.PirSensitivityInOccupiedStateFeedback.LinkInputSig(trilist.UShortInput[joinMap.PirSensitivityInOccupiedState.JoinNumber]);
-
- // PIR Sensitivity in Vacant State
- trilist.SetBoolSigAction(joinMap.IncrementPirInVacantState.JoinNumber, new Action((b) => occController.IncrementPirSensitivityInVacantState(b)));
- trilist.SetBoolSigAction(joinMap.DecrementPirInVacantState.JoinNumber, new Action((b) => occController.DecrementPirSensitivityInVacantState(b)));
- occController.PirSensitivityInVacantStateFeedback.LinkInputSig(trilist.UShortInput[joinMap.PirSensitivityInVacantState.JoinNumber]);
-
- // OR When Vacated
- trilist.SetBoolSigAction(joinMap.OrWhenVacated.JoinNumber, new Action((b) => occController.SetOrWhenVacatedState(b)));
- occController.OrWhenVacatedFeedback.LinkInputSig(trilist.BooleanInput[joinMap.OrWhenVacated.JoinNumber]);
-
- // AND When Vacated
- trilist.SetBoolSigAction(joinMap.AndWhenVacated.JoinNumber, new Action((b) => occController.SetAndWhenVacatedState(b)));
- occController.AndWhenVacatedFeedback.LinkInputSig(trilist.BooleanInput[joinMap.AndWhenVacated.JoinNumber]);
-
- // Ultrasonic A Sensor
- trilist.SetSigTrueAction(joinMap.EnableUsA.JoinNumber, new Action(() => occController.SetUsAEnable(true)));
- trilist.SetSigTrueAction(joinMap.DisableUsA.JoinNumber, new Action(() => occController.SetUsAEnable(false)));
- occController.UltrasonicAEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.EnableUsA.JoinNumber]);
-
- // Ultrasonic B Sensor
- trilist.SetSigTrueAction(joinMap.EnableUsB.JoinNumber, new Action(() => occController.SetUsBEnable(true)));
- trilist.SetSigTrueAction(joinMap.DisableUsB.JoinNumber, new Action(() => occController.SetUsBEnable(false)));
- occController.UltrasonicAEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.EnableUsB.JoinNumber]);
-
- // US Sensitivity in Occupied State
- trilist.SetBoolSigAction(joinMap.IncrementUsInOccupiedState.JoinNumber, new Action((b) => occController.IncrementUsSensitivityInOccupiedState(b)));
- trilist.SetBoolSigAction(joinMap.DecrementUsInOccupiedState.JoinNumber, new Action((b) => occController.DecrementUsSensitivityInOccupiedState(b)));
- occController.UltrasonicSensitivityInOccupiedStateFeedback.LinkInputSig(trilist.UShortInput[joinMap.UsSensitivityInOccupiedState.JoinNumber]);
-
- // US Sensitivity in Vacant State
- trilist.SetBoolSigAction(joinMap.IncrementUsInVacantState.JoinNumber, new Action((b) => occController.IncrementUsSensitivityInVacantState(b)));
- trilist.SetBoolSigAction(joinMap.DecrementUsInVacantState.JoinNumber, new Action((b) => occController.DecrementUsSensitivityInVacantState(b)));
- occController.UltrasonicSensitivityInVacantStateFeedback.LinkInputSig(trilist.UShortInput[joinMap.UsSensitivityInVacantState.JoinNumber]);
-
- //Sensor Raw States
- occController.RawOccupancyPirFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RawOccupancyPirFeedback.JoinNumber]);
- occController.RawOccupancyUsFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RawOccupancyUsFeedback.JoinNumber]);
-
- }
-
- public class CenOdtOccupancySensorBaseControllerFactory : EssentialsDeviceFactory
- {
- public CenOdtOccupancySensorBaseControllerFactory()
- {
- TypeNames = new List() { "cenodtcpoe", "cenodtocc" };
- }
-
- public override EssentialsDevice BuildDevice(DeviceConfig dc)
- {
- Debug.Console(1, "Factory Attempting to create new GlsOccupancySensorBaseController Device");
-
- var typeName = dc.Type.ToLower();
- var key = dc.Key;
- var name = dc.Name;
- var comm = CommFactory.GetControlPropertiesConfig(dc);
-
- var occSensor = new CenOdtCPoe(comm.IpIdInt, Global.ControlSystem);
-
- if (occSensor == null)
+ if (OccSensor.IsOnline)
{
- Debug.Console(0, "ERROR: Unable to create Occupancy Sensor Device. Key: '{0}'", key);
- return null;
- }
+ ApplySettingsToSensorFromConfig();
- return new CenOdtOccupancySensorBaseController(key, name, occSensor);
+ }
+ });
+ }
+
+ ///
+ /// Applies any sensor settings defined in config
+ ///
+ protected virtual void ApplySettingsToSensorFromConfig()
+ {
+ Debug.Console(1, this, "Checking config for settings to apply");
+
+ if (PropertiesConfig.EnablePir != null)
+ {
+ SetPirEnable((bool)PropertiesConfig.EnablePir);
+ }
+
+ if (PropertiesConfig.EnableLedFlash != null)
+ {
+ SetLedFlashEnable((bool)PropertiesConfig.EnableLedFlash);
+ }
+
+ if (PropertiesConfig.RemoteTimeout != null)
+ {
+ SetRemoteTimeout((ushort)PropertiesConfig.RemoteTimeout);
+ }
+
+ if (PropertiesConfig.ShortTimeoutState != null)
+ {
+ SetShortTimeoutState((bool)PropertiesConfig.ShortTimeoutState);
+ }
+
+ if (PropertiesConfig.EnableRawStates != null)
+ {
+ EnableRawStates((bool)PropertiesConfig.EnableRawStates);
+ }
+
+ if (PropertiesConfig.InternalPhotoSensorMinChange != null)
+ {
+ SetInternalPhotoSensorMinChange((ushort)PropertiesConfig.InternalPhotoSensorMinChange);
+ }
+
+ if (PropertiesConfig.EnableUsA != null)
+ {
+ SetUsAEnable((bool)PropertiesConfig.EnableUsA);
+ }
+
+ if (PropertiesConfig.EnableUsB != null)
+ {
+ SetUsBEnable((bool)PropertiesConfig.EnableUsB);
+ }
+
+ if (PropertiesConfig.OrWhenVacatedState != null)
+ {
+ SetOrWhenVacatedState((bool)PropertiesConfig.OrWhenVacatedState);
+ }
+
+ if (PropertiesConfig.AndWhenVacatedState != null)
+ {
+ SetAndWhenVacatedState((bool)PropertiesConfig.AndWhenVacatedState);
+ }
+
+ // TODO [ ] feature/cenoodtcpoe-sensor-sensitivity-configuration
+ if (PropertiesConfig.UsSensitivityOccupied != null)
+ {
+ SetUsSensitivityOccupied((ushort)PropertiesConfig.UsSensitivityOccupied);
+ }
+
+ if (PropertiesConfig.UsSensitivityVacant != null)
+ {
+ SetUsSensitivityVacant((ushort)PropertiesConfig.UsSensitivityVacant);
+ }
+
+ if (PropertiesConfig.PirSensitivityOccupied != null)
+ {
+ SetPirSensitivityOccupied((ushort)PropertiesConfig.PirSensitivityOccupied);
+ }
+
+ if (PropertiesConfig.PirSensitivityVacant != null)
+ {
+ SetPirSensitivityVacant((ushort)PropertiesConfig.PirSensitivityVacant);
}
}
- }
+
+ ///
+ /// Catches events for feedbacks on the base class. Any extending wrapper class should call this delegate after it checks for it's own event IDs.
+ ///
+ ///
+ ///
+ protected virtual void OccSensor_CenOccupancySensorChange(object device, GenericEventArgs args)
+ {
+ if (args.EventId == GlsOccupancySensorBase.PirEnabledFeedbackEventId)
+ PirSensorEnabledFeedback.FireUpdate();
+ else if (args.EventId == GlsOccupancySensorBase.LedFlashEnabledFeedbackEventId)
+ LedFlashEnabledFeedback.FireUpdate();
+ else if (args.EventId == GlsOccupancySensorBase.ShortTimeoutEnabledFeedbackEventId)
+ ShortTimeoutEnabledFeedback.FireUpdate();
+ else if (args.EventId == GlsOccupancySensorBase.PirSensitivityInOccupiedStateFeedbackEventId)
+ PirSensitivityInOccupiedStateFeedback.FireUpdate();
+ else if (args.EventId == GlsOccupancySensorBase.PirSensitivityInVacantStateFeedbackEventId)
+ PirSensitivityInVacantStateFeedback.FireUpdate();
+ else if (args.EventId == GlsOccupancySensorBase.RawOccupancyPirFeedbackEventId)
+ RawOccupancyPirFeedback.FireUpdate();
+ else if (args.EventId == GlsOccupancySensorBase.RawOccupancyUsFeedbackEventId)
+ RawOccupancyUsFeedback.FireUpdate();
+ }
+
+ protected virtual void OccSensor_BaseEvent(Crestron.SimplSharpPro.GenericBase device, Crestron.SimplSharpPro.BaseEventArgs args)
+ {
+ Debug.Console(2, this, "PoEOccupancySensorChange EventId: {0}", args.EventId);
+
+ if (args.EventId == Crestron.SimplSharpPro.GeneralIO.GlsOccupancySensorBase.RoomOccupiedFeedbackEventId
+ || args.EventId == Crestron.SimplSharpPro.GeneralIO.GlsOccupancySensorBase.RoomVacantFeedbackEventId)
+ {
+ Debug.Console(1, this, "Occupancy State: {0}", OccSensor.OccupancyDetectedFeedback.BoolValue);
+ RoomIsOccupiedFeedback.FireUpdate();
+ }
+ else if (args.EventId == GlsOccupancySensorBase.TimeoutFeedbackEventId)
+ CurrentTimeoutFeedback.FireUpdate();
+ else if (args.EventId == GlsOccupancySensorBase.TimeoutLocalFeedbackEventId)
+ RemoteTimeoutFeedback.FireUpdate();
+ else if (args.EventId == GlsOccupancySensorBase.GraceOccupancyDetectedFeedbackEventId)
+ GraceOccupancyDetectedFeedback.FireUpdate();
+ else if (args.EventId == GlsOccupancySensorBase.RawOccupancyFeedbackEventId)
+ RawOccupancyFeedback.FireUpdate();
+ else if (args.EventId == GlsOccupancySensorBase.InternalPhotoSensorValueFeedbackEventId)
+ InternalPhotoSensorValue.FireUpdate();
+ else if (args.EventId == GlsOccupancySensorBase.ExternalPhotoSensorValueFeedbackEventId)
+ ExternalPhotoSensorValue.FireUpdate();
+ else if (args.EventId == GlsOccupancySensorBase.AndWhenVacatedFeedbackEventId)
+ AndWhenVacatedFeedback.FireUpdate();
+ else if (args.EventId == GlsOccupancySensorBase.OrWhenVacatedFeedbackEventId)
+ OrWhenVacatedFeedback.FireUpdate();
+ else if (args.EventId == GlsOccupancySensorBase.UsAEnabledFeedbackEventId)
+ UltrasonicAEnabledFeedback.FireUpdate();
+ else if (args.EventId == GlsOccupancySensorBase.UsBEnabledFeedbackEventId)
+ UltrasonicBEnabledFeedback.FireUpdate();
+ else if (args.EventId == GlsOccupancySensorBase.UsSensitivityInOccupiedStateFeedbackEventId)
+ UltrasonicSensitivityInOccupiedStateFeedback.FireUpdate();
+ else if (args.EventId == GlsOccupancySensorBase.UsSensitivityInVacantStateFeedbackEventId)
+ UltrasonicSensitivityInVacantStateFeedback.FireUpdate();
+ }
+
+ public void SetTestMode(bool mode)
+ {
+ InTestMode = mode;
+
+ Debug.Console(1, this, "In Mock Mode: '{0}'", InTestMode);
+ }
+
+ public void SetTestOccupiedState(bool state)
+ {
+ if (!InTestMode)
+ Debug.Console(1, "Mock mode not enabled");
+ else
+ {
+ TestRoomIsOccupiedFeedback = state;
+
+ RoomIsOccupiedFeedback.FireUpdate();
+ }
+ }
+
+ ///
+ /// Sets the identity mode on or off
+ ///
+ ///
+ public void SetIdentityMode(bool state)
+ {
+ if (state)
+ OccSensor.IdentityModeOn();
+ else
+ OccSensor.IdentityModeOff();
+
+ Debug.Console(1, this, "Identity Mode: {0}", OccSensor.IdentityModeOnFeedback.BoolValue ? "On" : "Off");
+ }
+
+ ///
+ /// Enables or disables the PIR sensor
+ ///
+ ///
+ public void SetPirEnable(bool state)
+ {
+ if (state)
+ {
+ OccSensor.EnablePassiveInfraredSensor();
+ }
+ else
+ {
+ OccSensor.DisablePassiveInfraredSensor();
+ }
+ }
+
+ ///
+ /// Enables or disables the LED Flash
+ ///
+ ///
+ public void SetLedFlashEnable(bool state)
+ {
+ if (state)
+ {
+ OccSensor.EnableLedFlash();
+ }
+ else
+ {
+ OccSensor.DisableLedFlash();
+ }
+ }
+
+ ///
+ /// Enables or disables short timeout based on state
+ ///
+ ///
+ public void SetShortTimeoutState(bool state)
+ {
+ if (state)
+ {
+ OccSensor.EnableShortTimeout();
+ }
+ else
+ {
+ OccSensor.DisableShortTimeout();
+ }
+ }
+
+ public void IncrementPirSensitivityInOccupiedState(bool pressRelease)
+ {
+ if ((int)OccSensor.PassiveInfraredSensorSensitivityInOccupiedStateFeedback != 3)
+ {
+ OccSensor.PassiveInfraredSensorSensitivityInOccupiedState = OccSensor.PassiveInfraredSensorSensitivityInOccupiedStateFeedback + 1;
+ }
+ }
+
+ public void DecrementPirSensitivityInOccupiedState(bool pressRelease)
+ {
+ if ((int)OccSensor.PassiveInfraredSensorSensitivityInOccupiedStateFeedback != 0)
+ {
+ OccSensor.PassiveInfraredSensorSensitivityInOccupiedState = OccSensor.PassiveInfraredSensorSensitivityInOccupiedStateFeedback - 1;
+ }
+ }
+
+ public void IncrementPirSensitivityInVacantState(bool pressRelease)
+ {
+ if ((int)OccSensor.PassiveInfraredSensorSensitivityInVacantStateFeedback != 3)
+ {
+ OccSensor.PassiveInfraredSensorSensitivityInVacantState = OccSensor.PassiveInfraredSensorSensitivityInVacantStateFeedback + 1;
+ }
+ }
+
+ public void DecrementPirSensitivityInVacantState(bool pressRelease)
+ {
+ if ((int)OccSensor.PassiveInfraredSensorSensitivityInVacantStateFeedback != 0)
+ {
+ OccSensor.PassiveInfraredSensorSensitivityInVacantState = OccSensor.PassiveInfraredSensorSensitivityInVacantStateFeedback - 1;
+ }
+ }
+
+ public void IncrementUsSensitivityInOccupiedState(bool pressRelease)
+ {
+ if ((int)OccSensor.UltrasonicSensorSensitivityInOccupiedStateFeedback < 3)
+ {
+ OccSensor.UltrasonicSensorSensitivityInOccupiedState = OccSensor.UltrasonicSensorSensitivityInOccupiedStateFeedback + 1;
+ }
+ else if ((int)OccSensor.UltrasonicSensorSensitivityInOccupiedStateFeedback > 4)
+ {
+ OccSensor.UltrasonicSensorSensitivityInOccupiedState = OccSensor.UltrasonicSensorSensitivityInOccupiedStateFeedback - 1;
+ }
+ else if ((int)OccSensor.UltrasonicSensorSensitivityInOccupiedStateFeedback == 4)
+ {
+ OccSensor.UltrasonicSensorSensitivityInOccupiedState = 0;
+ }
+ }
+
+ public void DecrementUsSensitivityInOccupiedState(bool pressRelease)
+ {
+ if ((int)OccSensor.UltrasonicSensorSensitivityInOccupiedStateFeedback > 0
+ && (int)OccSensor.UltrasonicSensorSensitivityInOccupiedStateFeedback < 4)
+ {
+ OccSensor.UltrasonicSensorSensitivityInOccupiedState = OccSensor.UltrasonicSensorSensitivityInOccupiedStateFeedback - 1;
+ }
+ else if ((int)OccSensor.UltrasonicSensorSensitivityInOccupiedStateFeedback > 3
+ && (int)OccSensor.UltrasonicSensorSensitivityInOccupiedStateFeedback < 7)
+ {
+ OccSensor.UltrasonicSensorSensitivityInOccupiedState = OccSensor.UltrasonicSensorSensitivityInOccupiedStateFeedback + 1;
+ }
+ }
+
+ public void IncrementUsSensitivityInVacantState(bool pressRelease)
+ {
+ if ((int)OccSensor.UltrasonicSensorSensitivityInVacantStateFeedback < 3)
+ {
+ OccSensor.UltrasonicSensorSensitivityInVacantState = OccSensor.UltrasonicSensorSensitivityInVacantStateFeedback + 1;
+ }
+ else if ((int)OccSensor.UltrasonicSensorSensitivityInVacantStateFeedback > 4)
+ {
+ OccSensor.UltrasonicSensorSensitivityInVacantState = OccSensor.UltrasonicSensorSensitivityInVacantStateFeedback - 1;
+ }
+ else if ((int)OccSensor.UltrasonicSensorSensitivityInVacantStateFeedback == 4)
+ {
+ OccSensor.UltrasonicSensorSensitivityInVacantState = 0;
+ }
+ }
+
+ public void DecrementUsSensitivityInVacantState(bool pressRelease)
+ {
+ if ((int)OccSensor.UltrasonicSensorSensitivityInVacantStateFeedback > 0
+ && (int)OccSensor.UltrasonicSensorSensitivityInVacantStateFeedback < 4)
+ {
+ OccSensor.UltrasonicSensorSensitivityInVacantState = OccSensor.UltrasonicSensorSensitivityInVacantStateFeedback - 1;
+ }
+ else if ((int)OccSensor.UltrasonicSensorSensitivityInVacantStateFeedback > 3
+ && (int)OccSensor.UltrasonicSensorSensitivityInVacantStateFeedback < 7)
+ {
+ OccSensor.UltrasonicSensorSensitivityInVacantState = OccSensor.UltrasonicSensorSensitivityInVacantStateFeedback + 1;
+ }
+ }
+
+ public void ForceOccupied()
+ {
+ OccSensor.ForceOccupied();
+ }
+
+ public void ForceVacant()
+ {
+ OccSensor.ForceVacant();
+ }
+
+ public void EnableRawStates(bool state)
+ {
+ if (state)
+ {
+ OccSensor.EnableRawStates();
+ }
+ else
+ OccSensor.DisableRawStates();
+ }
+
+ public void SetRemoteTimeout(ushort time)
+ {
+ OccSensor.RemoteTimeout.UShortValue = time;
+ }
+
+ public void SetInternalPhotoSensorMinChange(ushort value)
+ {
+ OccSensor.InternalPhotoSensorMinimumChange.UShortValue = value;
+ }
+
+ ///
+ /// Sets the OrWhenVacated state
+ ///
+ ///
+ public void SetOrWhenVacatedState(bool state)
+ {
+ if (state)
+ {
+ OccSensor.OrWhenVacated();
+ }
+ }
+
+ ///
+ /// Sets the AndWhenVacated state
+ ///
+ ///
+ public void SetAndWhenVacatedState(bool state)
+ {
+ if (state)
+ {
+ OccSensor.AndWhenVacated();
+ }
+ }
+
+ ///
+ /// Enables or disables the Ultrasonic A sensor
+ ///
+ ///
+ public void SetUsAEnable(bool state)
+ {
+ if (state)
+ {
+ OccSensor.EnableUltrasonicSensorSideA();
+ }
+ else
+ {
+ OccSensor.DisableUltrasonicSensorSideA();
+ }
+ }
+
+
+ ///
+ /// Enables or disables the Ultrasonic B sensor
+ ///
+ ///
+ public void SetUsBEnable(bool state)
+ {
+ if (state)
+ {
+ OccSensor.EnableUltrasonicSensorSideB();
+ }
+ else
+ {
+ OccSensor.DisableUltrasonicSensorSideB();
+ }
+ }
+
+ ///
+ /// Sets the US sensor sensitivity for occupied state
+ ///
+ ///
+ public void SetUsSensitivityOccupied(ushort sensitivity)
+ {
+ var level = (eSensitivityLevel) sensitivity;
+ if (level == 0) return;
+
+ OccSensor.UltrasonicSensorSensitivityInOccupiedState = level;
+ }
+
+ ///
+ /// Sets the US sensor sensitivity for vacant state
+ ///
+ ///
+ public void SetUsSensitivityVacant(ushort sensitivity)
+ {
+ var level = (eSensitivityLevel)sensitivity;
+ if (level == 0) return;
+
+ OccSensor.UltrasonicSensorSensitivityInVacantState = level;
+ }
+
+ ///
+ /// Sets the PIR sensor sensitivity for occupied state
+ ///
+ ///
+ public void SetPirSensitivityOccupied(ushort sensitivity)
+ {
+ var level = (eSensitivityLevel)sensitivity;
+ if (level == 0) return;
+
+ OccSensor.PassiveInfraredSensorSensitivityInOccupiedState = level;
+ }
+
+ ///
+ /// Sets the PIR sensor sensitivity for vacant state
+ ///
+ ///
+ public void SetPirSensitivityVacant(ushort sensitivity)
+ {
+ var level = (eSensitivityLevel)sensitivity;
+ if (level == 0) return;
+
+ OccSensor.PassiveInfraredSensorSensitivityInVacantState = level;
+ }
+
+ ///
+ /// Method to print current settings to console
+ ///
+ public void GetSettings()
+ {
+ var dash = new string('*', 50);
+ CrestronConsole.PrintLine(string.Format("{0}\n", dash));
+
+ Debug.Console(0, this, "Vacancy Detected: {0}",
+ OccSensor.VacancyDetectedFeedback.BoolValue);
+
+ Debug.Console(0, Key, "Timeout Current: {0} | Remote: {1}",
+ OccSensor.CurrentTimeoutFeedback.UShortValue,
+ OccSensor.RemoteTimeout.UShortValue);
+
+ Debug.Console(0, Key, "Short Timeout Enabled: {0}",
+ OccSensor.ShortTimeoutEnabledFeedback.BoolValue);
+
+ Debug.Console(0, Key, "PIR Sensor Enabled: {0} | Sensitivity Occupied: {1} | Sensitivity Vacant: {2}",
+ OccSensor.PassiveInfraredSensorEnabledFeedback.BoolValue,
+ OccSensor.PassiveInfraredSensorSensitivityInOccupiedStateFeedback,
+ OccSensor.PassiveInfraredSensorSensitivityInVacantStateFeedback);
+
+ Debug.Console(0, Key, "Ultrasonic Enabled A: {0} | B: {1}",
+ OccSensor.UltrasonicSensorSideAEnabledFeedback.BoolValue,
+ OccSensor.UltrasonicSensorSideBEnabledFeedback.BoolValue);
+
+ Debug.Console(0, Key, "Ultrasonic Sensitivity Occupied: {0} | Vacant: {1}",
+ OccSensor.UltrasonicSensorSensitivityInOccupiedStateFeedback,
+ OccSensor.UltrasonicSensorSensitivityInVacantStateFeedback);
+
+ CrestronConsole.PrintLine(string.Format("{0}\n", dash));
+ }
+
+
+ public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
+ {
+ LinkOccSensorToApi(this, trilist, joinStart, joinMapKey, bridge);
+ }
+
+ protected void LinkOccSensorToApi(CenOdtOccupancySensorBaseController occController,
+ BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
+ {
+ CenOdtOccupancySensorBaseJoinMap joinMap = new CenOdtOccupancySensorBaseJoinMap(joinStart);
+
+ var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
+
+ if (!string.IsNullOrEmpty(joinMapSerialized))
+ joinMap = JsonConvert.DeserializeObject(joinMapSerialized);
+
+ if (bridge != null)
+ {
+ bridge.AddJoinMap(Key, joinMap);
+ }
+ else
+ {
+ Debug.Console(0, this, "Please update config to use 'eiscapiadvanced' to get all join map features for this device.");
+ }
+
+ Debug.Console(1, occController, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
+
+ occController.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.Online.JoinNumber]);
+ trilist.StringInput[joinMap.Name.JoinNumber].StringValue = occController.Name;
+
+ trilist.OnlineStatusChange += new Crestron.SimplSharpPro.OnlineStatusChangeEventHandler((d, args) =>
+ {
+ if (args.DeviceOnLine)
+ {
+ trilist.StringInput[joinMap.Name.JoinNumber].StringValue = occController.Name;
+ }
+ }
+ );
+
+ // Occupied status
+ trilist.SetSigTrueAction(joinMap.ForceOccupied.JoinNumber, new Action(() => occController.ForceOccupied()));
+ trilist.SetSigTrueAction(joinMap.ForceVacant.JoinNumber, new Action(() => occController.ForceVacant()));
+ occController.RoomIsOccupiedFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RoomOccupiedFeedback.JoinNumber]);
+ occController.RoomIsOccupiedFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.RoomVacantFeedback.JoinNumber]);
+ occController.RawOccupancyFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RawOccupancyFeedback.JoinNumber]);
+ trilist.SetBoolSigAction(joinMap.EnableRawStates.JoinNumber, new Action((b) => occController.EnableRawStates(b)));
+
+ // Timouts
+ trilist.SetUShortSigAction(joinMap.Timeout.JoinNumber, new Action((u) => occController.SetRemoteTimeout(u)));
+ occController.CurrentTimeoutFeedback.LinkInputSig(trilist.UShortInput[joinMap.Timeout.JoinNumber]);
+ occController.RemoteTimeoutFeedback.LinkInputSig(trilist.UShortInput[joinMap.TimeoutLocalFeedback.JoinNumber]);
+
+ // LED Flash
+ trilist.SetSigTrueAction(joinMap.EnableLedFlash.JoinNumber, new Action(() => occController.SetLedFlashEnable(true)));
+ trilist.SetSigTrueAction(joinMap.DisableLedFlash.JoinNumber, new Action(() => occController.SetLedFlashEnable(false)));
+ occController.LedFlashEnabledFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.EnableLedFlash.JoinNumber]);
+
+ // Short Timeout
+ trilist.SetSigTrueAction(joinMap.EnableShortTimeout.JoinNumber, new Action(() => occController.SetShortTimeoutState(true)));
+ trilist.SetSigTrueAction(joinMap.DisableShortTimeout.JoinNumber, new Action(() => occController.SetShortTimeoutState(false)));
+ occController.ShortTimeoutEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.EnableShortTimeout.JoinNumber]);
+
+ // PIR Sensor
+ trilist.SetSigTrueAction(joinMap.EnablePir.JoinNumber, new Action(() => occController.SetPirEnable(true)));
+ trilist.SetSigTrueAction(joinMap.DisablePir.JoinNumber, new Action(() => occController.SetPirEnable(false)));
+ occController.PirSensorEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.EnablePir.JoinNumber]);
+
+ // PIR Sensitivity in Occupied State
+ trilist.SetBoolSigAction(joinMap.IncrementPirInOccupiedState.JoinNumber, new Action((b) => occController.IncrementPirSensitivityInOccupiedState(b)));
+ trilist.SetBoolSigAction(joinMap.DecrementPirInOccupiedState.JoinNumber, new Action((b) => occController.DecrementPirSensitivityInOccupiedState(b)));
+ occController.PirSensitivityInOccupiedStateFeedback.LinkInputSig(trilist.UShortInput[joinMap.PirSensitivityInOccupiedState.JoinNumber]);
+
+ // PIR Sensitivity in Vacant State
+ trilist.SetBoolSigAction(joinMap.IncrementPirInVacantState.JoinNumber, new Action((b) => occController.IncrementPirSensitivityInVacantState(b)));
+ trilist.SetBoolSigAction(joinMap.DecrementPirInVacantState.JoinNumber, new Action((b) => occController.DecrementPirSensitivityInVacantState(b)));
+ occController.PirSensitivityInVacantStateFeedback.LinkInputSig(trilist.UShortInput[joinMap.PirSensitivityInVacantState.JoinNumber]);
+
+ // OR When Vacated
+ trilist.SetBoolSigAction(joinMap.OrWhenVacated.JoinNumber, new Action((b) => occController.SetOrWhenVacatedState(b)));
+ occController.OrWhenVacatedFeedback.LinkInputSig(trilist.BooleanInput[joinMap.OrWhenVacated.JoinNumber]);
+
+ // AND When Vacated
+ trilist.SetBoolSigAction(joinMap.AndWhenVacated.JoinNumber, new Action((b) => occController.SetAndWhenVacatedState(b)));
+ occController.AndWhenVacatedFeedback.LinkInputSig(trilist.BooleanInput[joinMap.AndWhenVacated.JoinNumber]);
+
+ // Ultrasonic A Sensor
+ trilist.SetSigTrueAction(joinMap.EnableUsA.JoinNumber, new Action(() => occController.SetUsAEnable(true)));
+ trilist.SetSigTrueAction(joinMap.DisableUsA.JoinNumber, new Action(() => occController.SetUsAEnable(false)));
+ occController.UltrasonicAEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.EnableUsA.JoinNumber]);
+
+ // Ultrasonic B Sensor
+ trilist.SetSigTrueAction(joinMap.EnableUsB.JoinNumber, new Action(() => occController.SetUsBEnable(true)));
+ trilist.SetSigTrueAction(joinMap.DisableUsB.JoinNumber, new Action(() => occController.SetUsBEnable(false)));
+ occController.UltrasonicAEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.EnableUsB.JoinNumber]);
+
+ // US Sensitivity in Occupied State
+ trilist.SetBoolSigAction(joinMap.IncrementUsInOccupiedState.JoinNumber, new Action((b) => occController.IncrementUsSensitivityInOccupiedState(b)));
+ trilist.SetBoolSigAction(joinMap.DecrementUsInOccupiedState.JoinNumber, new Action((b) => occController.DecrementUsSensitivityInOccupiedState(b)));
+ occController.UltrasonicSensitivityInOccupiedStateFeedback.LinkInputSig(trilist.UShortInput[joinMap.UsSensitivityInOccupiedState.JoinNumber]);
+
+ // US Sensitivity in Vacant State
+ trilist.SetBoolSigAction(joinMap.IncrementUsInVacantState.JoinNumber, new Action((b) => occController.IncrementUsSensitivityInVacantState(b)));
+ trilist.SetBoolSigAction(joinMap.DecrementUsInVacantState.JoinNumber, new Action((b) => occController.DecrementUsSensitivityInVacantState(b)));
+ occController.UltrasonicSensitivityInVacantStateFeedback.LinkInputSig(trilist.UShortInput[joinMap.UsSensitivityInVacantState.JoinNumber]);
+
+ //Sensor Raw States
+ occController.RawOccupancyPirFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RawOccupancyPirFeedback.JoinNumber]);
+ occController.RawOccupancyUsFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RawOccupancyUsFeedback.JoinNumber]);
+
+ // Identity mode
+ trilist.SetBoolSigAction(joinMap.IdentityMode.JoinNumber, occController.SetIdentityMode);
+ occController.IdentityModeFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IdentityModeFeedback.JoinNumber]);
+ }
+
+ public class CenOdtOccupancySensorBaseControllerFactory : EssentialsDeviceFactory
+ {
+ public CenOdtOccupancySensorBaseControllerFactory()
+ {
+ TypeNames = new List() { "cenodtcpoe", "cenodtocc" };
+ }
+
+ public override EssentialsDevice BuildDevice(DeviceConfig dc)
+ {
+ Debug.Console(1, "Factory Attempting to create new GlsOccupancySensorBaseController Device");
+
+ var typeName = dc.Type.ToLower();
+ var key = dc.Key;
+ var name = dc.Name;
+ var comm = CommFactory.GetControlPropertiesConfig(dc);
+
+ var props = dc.Properties.ToObject();
+
+ var occSensor = new CenOdtCPoe(comm.IpIdInt, Global.ControlSystem);
+
+ if (occSensor == null)
+ {
+ Debug.Console(0, "ERROR: Unable to create Occupancy Sensor Device. Key: '{0}'", key);
+ return null;
+ }
+
+ return new CenOdtOccupancySensorBaseController(key, name, occSensor, props);
+ }
+ }
+ }
}
\ No newline at end of file
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Occupancy/GlsOccupancySensorBaseController.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Occupancy/GlsOccupancySensorBaseController.cs
index 077be4f5..53db1716 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Occupancy/GlsOccupancySensorBaseController.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Occupancy/GlsOccupancySensorBaseController.cs
@@ -1,460 +1,539 @@
using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro.DeviceSupport;
using Crestron.SimplSharpPro.GeneralIO;
using Newtonsoft.Json;
using PepperDash.Core;
-using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Config;
using PepperDash.Essentials.Core.Bridges;
namespace PepperDash.Essentials.Core
{
- [Description("Wrapper class for Single Technology GLS Occupancy Sensors")]
- public class GlsOccupancySensorBaseController : CrestronGenericBridgeableBaseDevice, IOccupancyStatusProvider
- {
- public GlsOccupancySensorBase OccSensor { get; private set; }
+ [Description("Wrapper class for Single Technology GLS Occupancy Sensors")]
+ [ConfigSnippet("\"properties\": {\"control\": {\"method\": \"cresnet\",\"cresnetId\": \"97\"},\"enablePir\": true,\"enableLedFlash\": true,\"enableRawStates\":true,\"remoteTimeout\": 30,\"internalPhotoSensorMinChange\": 0,\"externalPhotoSensorMinChange\": 0}")]
+ public abstract class GlsOccupancySensorBaseController : CrestronGenericBridgeableBaseDevice, IOccupancyStatusProvider
+ {
+ public GlsOccupancySensorPropertiesConfig PropertiesConfig { get; private set; }
- public BoolFeedback RoomIsOccupiedFeedback { get; private set; }
+ protected GlsOccupancySensorBase OccSensor;
- public BoolFeedback GraceOccupancyDetectedFeedback { get; private set; }
+ public BoolFeedback RoomIsOccupiedFeedback { get; private set; }
- public BoolFeedback RawOccupancyFeedback { get; private set; }
+ public BoolFeedback GraceOccupancyDetectedFeedback { get; private set; }
- public BoolFeedback PirSensorEnabledFeedback { get; private set; }
+ public BoolFeedback RawOccupancyFeedback { get; private set; }
- public BoolFeedback LedFlashEnabledFeedback { get; private set; }
+ public BoolFeedback PirSensorEnabledFeedback { get; private set; }
- public BoolFeedback ShortTimeoutEnabledFeedback { get; private set; }
+ public BoolFeedback LedFlashEnabledFeedback { get; private set; }
- public IntFeedback PirSensitivityInVacantStateFeedback { get; private set; }
+ public BoolFeedback ShortTimeoutEnabledFeedback { get; private set; }
- public IntFeedback PirSensitivityInOccupiedStateFeedback { get; private set; }
+ public IntFeedback PirSensitivityInVacantStateFeedback { get; private set; }
- public IntFeedback CurrentTimeoutFeedback { get; private set; }
+ public IntFeedback PirSensitivityInOccupiedStateFeedback { get; private set; }
- public IntFeedback LocalTimoutFeedback { get; private set; }
+ public IntFeedback CurrentTimeoutFeedback { get; private set; }
- public IntFeedback InternalPhotoSensorValue { get; set; }
+ public IntFeedback LocalTimoutFeedback { get; private set; }
- public IntFeedback ExternalPhotoSensorValue { get; set; }
+ public IntFeedback InternalPhotoSensorValue { get; set; }
- // Debug properties
- public bool InTestMode { get; private set; }
+ public IntFeedback ExternalPhotoSensorValue { get; set; }
- public bool TestRoomIsOccupiedFeedback { get; private set; }
+ // Debug properties
+ public bool InTestMode { get; private set; }
- public Func RoomIsOccupiedFeedbackFunc
+ public bool TestRoomIsOccupiedFeedback { get; private set; }
+
+ public Func RoomIsOccupiedFeedbackFunc
+ {
+ get
+ {
+ return () => InTestMode ? TestRoomIsOccupiedFeedback : OccSensor.OccupancyDetectedFeedback.BoolValue;
+ }
+ }
+
+ protected GlsOccupancySensorBaseController(string key, DeviceConfig config)
+ : this(key, config.Name, config)
+ {
+ }
+
+ protected GlsOccupancySensorBaseController(string key, string name, DeviceConfig config)
+ : base(key, name)
{
- get
+
+ var props = config.Properties.ToObject();
+
+ if (props != null)
{
- return () => InTestMode ? TestRoomIsOccupiedFeedback : OccSensor.OccupancyDetectedFeedback.BoolValue;
- }
- }
-
- public GlsOccupancySensorBaseController(string key, Func preActivationFunc,
- DeviceConfig config)
- : base(key, config.Name)
- {
-
-
- AddPreActivationAction(() =>
- {
- OccSensor = preActivationFunc(config);
-
- RegisterCrestronGenericBase(OccSensor);
-
- RegisterGlsOdtSensorBaseController(OccSensor);
-
- });
- }
-
- public GlsOccupancySensorBaseController(string key, string name) : base(key, name) {}
-
- protected void RegisterGlsOdtSensorBaseController(GlsOccupancySensorBase occSensor)
- {
- OccSensor = occSensor;
-
- RoomIsOccupiedFeedback = new BoolFeedback(RoomIsOccupiedFeedbackFunc);
-
- PirSensorEnabledFeedback = new BoolFeedback(() => OccSensor.PirEnabledFeedback.BoolValue);
-
- LedFlashEnabledFeedback = new BoolFeedback(() => OccSensor.LedFlashEnabledFeedback.BoolValue);
-
- ShortTimeoutEnabledFeedback = new BoolFeedback(() => OccSensor.ShortTimeoutEnabledFeedback.BoolValue);
-
- PirSensitivityInVacantStateFeedback =
- new IntFeedback(() => OccSensor.PirSensitivityInVacantStateFeedback.UShortValue);
-
- PirSensitivityInOccupiedStateFeedback =
- new IntFeedback(() => OccSensor.PirSensitivityInOccupiedStateFeedback.UShortValue);
-
- CurrentTimeoutFeedback = new IntFeedback(() => OccSensor.CurrentTimeoutFeedback.UShortValue);
-
- LocalTimoutFeedback = new IntFeedback(() => OccSensor.LocalTimeoutFeedback.UShortValue);
-
- GraceOccupancyDetectedFeedback =
- new BoolFeedback(() => OccSensor.GraceOccupancyDetectedFeedback.BoolValue);
-
- RawOccupancyFeedback = new BoolFeedback(() => OccSensor.RawOccupancyFeedback.BoolValue);
-
- InternalPhotoSensorValue = new IntFeedback(() => OccSensor.InternalPhotoSensorValueFeedback.UShortValue);
-
- ExternalPhotoSensorValue = new IntFeedback(() => OccSensor.ExternalPhotoSensorValueFeedback.UShortValue);
-
- OccSensor.BaseEvent += OccSensor_BaseEvent;
-
- OccSensor.GlsOccupancySensorChange += OccSensor_GlsOccupancySensorChange;
- }
-
-
- ///
- /// Catches events for feedbacks on the base class. Any extending wrapper class should call this delegate after it checks for it's own event IDs.
- ///
- ///
- ///
- protected virtual void OccSensor_GlsOccupancySensorChange(GlsOccupancySensorBase device, GlsOccupancySensorChangeEventArgs args)
- {
- switch (args.EventId)
- {
- case GlsOccupancySensorBase.PirEnabledFeedbackEventId:
- PirSensorEnabledFeedback.FireUpdate();
- break;
- case GlsOccupancySensorBase.LedFlashEnabledFeedbackEventId:
- LedFlashEnabledFeedback.FireUpdate();
- break;
- case GlsOccupancySensorBase.ShortTimeoutEnabledFeedbackEventId:
- ShortTimeoutEnabledFeedback.FireUpdate();
- break;
- case GlsOccupancySensorBase.PirSensitivityInOccupiedStateFeedbackEventId:
- PirSensitivityInOccupiedStateFeedback.FireUpdate();
- break;
- case GlsOccupancySensorBase.PirSensitivityInVacantStateFeedbackEventId:
- PirSensitivityInVacantStateFeedback.FireUpdate();
- break;
- }
- }
-
- protected virtual void OccSensor_BaseEvent(Crestron.SimplSharpPro.GenericBase device, Crestron.SimplSharpPro.BaseEventArgs args)
- {
- Debug.Console(2, this, "GlsOccupancySensorChange EventId: {0}", args.EventId);
-
- switch (args.EventId)
- {
- case Crestron.SimplSharpPro.GeneralIO.GlsOccupancySensorBase.RoomVacantFeedbackEventId:
- case Crestron.SimplSharpPro.GeneralIO.GlsOccupancySensorBase.RoomOccupiedFeedbackEventId:
- Debug.Console(1, this, "Occupancy State: {0}", OccSensor.OccupancyDetectedFeedback.BoolValue);
- RoomIsOccupiedFeedback.FireUpdate();
- break;
- case GlsOccupancySensorBase.TimeoutFeedbackEventId:
- CurrentTimeoutFeedback.FireUpdate();
- break;
- case GlsOccupancySensorBase.TimeoutLocalFeedbackEventId:
- LocalTimoutFeedback.FireUpdate();
- break;
- case GlsOccupancySensorBase.GraceOccupancyDetectedFeedbackEventId:
- GraceOccupancyDetectedFeedback.FireUpdate();
- break;
- case GlsOccupancySensorBase.RawOccupancyFeedbackEventId:
- RawOccupancyFeedback.FireUpdate();
- break;
- case GlsOccupancySensorBase.InternalPhotoSensorValueFeedbackEventId:
- InternalPhotoSensorValue.FireUpdate();
- break;
- case GlsOccupancySensorBase.ExternalPhotoSensorValueFeedbackEventId:
- ExternalPhotoSensorValue.FireUpdate();
- break;
- }
- }
-
- public void SetTestMode(bool mode)
- {
- InTestMode = mode;
-
- Debug.Console(1, this, "In Mock Mode: '{0}'", InTestMode);
- }
-
- public void SetTestOccupiedState(bool state)
- {
- if (!InTestMode)
- Debug.Console(1, "Mock mode not enabled");
- else
- {
- TestRoomIsOccupiedFeedback = state;
-
- RoomIsOccupiedFeedback.FireUpdate();
- }
- }
-
- ///
- /// Enables or disables the PIR sensor
- ///
- ///
- public void SetPirEnable(bool state)
- {
- if (state)
- {
- OccSensor.EnablePir.BoolValue = state;
- OccSensor.DisablePir.BoolValue = !state;
+ PropertiesConfig = props;
}
else
{
- OccSensor.EnablePir.BoolValue = state;
- OccSensor.DisablePir.BoolValue = !state;
- }
- }
-
- ///
- /// Enables or disables the LED Flash
- ///
- ///
- public void SetLedFlashEnable(bool state)
- {
- if (state)
- {
- OccSensor.EnableLedFlash.BoolValue = state;
- OccSensor.DisableLedFlash.BoolValue = !state;
- }
- else
- {
- OccSensor.EnableLedFlash.BoolValue = state;
- OccSensor.DisableLedFlash.BoolValue = !state;
- }
- }
-
- ///
- /// Enables or disables short timeout based on state
- ///
- ///
- public void SetShortTimeoutState(bool state)
- {
- if (state)
- {
- OccSensor.EnableShortTimeout.BoolValue = state;
- OccSensor.DisableShortTimeout.BoolValue = !state;
- }
- else
- {
- OccSensor.EnableShortTimeout.BoolValue = state;
- OccSensor.DisableShortTimeout.BoolValue = !state;
- }
- }
-
- public void IncrementPirSensitivityInOccupiedState(bool pressRelease)
- {
- OccSensor.IncrementPirSensitivityInOccupiedState.BoolValue = pressRelease;
- }
-
- public void DecrementPirSensitivityInOccupiedState(bool pressRelease)
- {
- OccSensor.DecrementPirSensitivityInOccupiedState.BoolValue = pressRelease;
- }
-
- public void IncrementPirSensitivityInVacantState(bool pressRelease)
- {
- OccSensor.IncrementPirSensitivityInVacantState.BoolValue = pressRelease;
- }
-
- public void DecrementPirSensitivityInVacantState(bool pressRelease)
- {
- OccSensor.DecrementPirSensitivityInVacantState.BoolValue = pressRelease;
- }
-
- public void ForceOccupied()
- {
- OccSensor.ForceOccupied.BoolValue = true;
- }
-
- public void ForceVacant()
- {
- OccSensor.ForceVacant.BoolValue = true;
- }
-
- public void EnableRawStates(bool state)
- {
- OccSensor.EnableRawStates.BoolValue = state;
- }
-
- public void SetRemoteTimeout(ushort time)
- {
- OccSensor.RemoteTimeout.UShortValue = time;
- }
-
- public void SetInternalPhotoSensorMinChange(ushort value)
- {
- OccSensor.InternalPhotoSensorMinimumChange.UShortValue = value;
- }
-
- public void SetExternalPhotoSensorMinChange(ushort value)
- {
- OccSensor.ExternalPhotoSensorMinimumChange.UShortValue = value;
- }
-
-
-
- protected void LinkOccSensorToApi(GlsOccupancySensorBaseController occController, BasicTriList trilist,
- uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
- {
- var joinMap = new GlsOccupancySensorBaseJoinMap(joinStart);
-
- var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
-
- if (!string.IsNullOrEmpty(joinMapSerialized))
- joinMap = JsonConvert.DeserializeObject(joinMapSerialized);
-
- if (bridge != null)
- {
- bridge.AddJoinMap(Key, joinMap);
- }
- else
- {
- Debug.Console(0, this, "Please update config to use 'eiscapiadvanced' to get all join map features for this device.");
+ Debug.Console(1, this, "props are null. Unable to deserialize into GlsOccupancySensorPropertiesConfig");
}
- Debug.Console(1, occController, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
-
- #region Single and Dual Sensor Stuff
- occController.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline.JoinNumber]);
- trilist.StringInput[joinMap.Name.JoinNumber].StringValue = occController.Name;
-
- trilist.OnlineStatusChange += (d, args) =>
- {
- if (args.DeviceOnLine)
+ AddPostActivationAction(() =>
{
- trilist.StringInput[joinMap.Name.JoinNumber].StringValue = occController.Name;
- }
- };
+ OccSensor.OnlineStatusChange += (o, a) =>
+ {
+ if (a.DeviceOnLine)
+ {
+ ApplySettingsToSensorFromConfig();
+ }
+ };
- // Occupied status
- trilist.SetSigTrueAction(joinMap.ForceOccupied.JoinNumber, occController.ForceOccupied);
- trilist.SetSigTrueAction(joinMap.ForceVacant.JoinNumber, occController.ForceVacant);
- occController.RoomIsOccupiedFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RoomOccupiedFeedback.JoinNumber]);
- occController.RoomIsOccupiedFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.RoomVacantFeedback.JoinNumber]);
- occController.RawOccupancyFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RawOccupancyFeedback.JoinNumber]);
- trilist.SetBoolSigAction(joinMap.EnableRawStates.JoinNumber, occController.EnableRawStates);
+ if (OccSensor.IsOnline)
+ {
+ ApplySettingsToSensorFromConfig();
- // Timouts
- trilist.SetUShortSigAction(joinMap.Timeout.JoinNumber, occController.SetRemoteTimeout);
- occController.CurrentTimeoutFeedback.LinkInputSig(trilist.UShortInput[joinMap.Timeout.JoinNumber]);
- occController.LocalTimoutFeedback.LinkInputSig(trilist.UShortInput[joinMap.TimeoutLocalFeedback.JoinNumber]);
-
- // LED Flash
- trilist.SetSigTrueAction(joinMap.EnableLedFlash.JoinNumber, () => occController.SetLedFlashEnable(true));
- trilist.SetSigTrueAction(joinMap.DisableLedFlash.JoinNumber, () => occController.SetLedFlashEnable(false));
- occController.LedFlashEnabledFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.EnableLedFlash.JoinNumber]);
-
- // Short Timeout
- trilist.SetSigTrueAction(joinMap.EnableShortTimeout.JoinNumber, () => occController.SetShortTimeoutState(true));
- trilist.SetSigTrueAction(joinMap.DisableShortTimeout.JoinNumber, () => occController.SetShortTimeoutState(false));
- occController.ShortTimeoutEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.EnableShortTimeout.JoinNumber]);
-
- // PIR Sensor
- trilist.SetSigTrueAction(joinMap.EnablePir.JoinNumber, () => occController.SetPirEnable(true));
- trilist.SetSigTrueAction(joinMap.DisablePir.JoinNumber, () => occController.SetPirEnable(false));
- occController.PirSensorEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.EnablePir.JoinNumber]);
-
- // PIR Sensitivity in Occupied State
- trilist.SetBoolSigAction(joinMap.IncrementPirInOccupiedState.JoinNumber, occController.IncrementPirSensitivityInOccupiedState);
- trilist.SetBoolSigAction(joinMap.DecrementPirInOccupiedState.JoinNumber, occController.DecrementPirSensitivityInOccupiedState);
- occController.PirSensitivityInOccupiedStateFeedback.LinkInputSig(trilist.UShortInput[joinMap.PirSensitivityInOccupiedState.JoinNumber]);
-
- // PIR Sensitivity in Vacant State
- trilist.SetBoolSigAction(joinMap.IncrementPirInVacantState.JoinNumber, occController.IncrementPirSensitivityInVacantState);
- trilist.SetBoolSigAction(joinMap.DecrementPirInVacantState.JoinNumber, occController.DecrementPirSensitivityInVacantState);
- occController.PirSensitivityInVacantStateFeedback.LinkInputSig(trilist.UShortInput[joinMap.PirSensitivityInVacantState.JoinNumber]);
- #endregion
-
- #region Dual Technology Sensor Stuff
- var odtOccController = occController as GlsOdtOccupancySensorController;
-
- if (odtOccController == null) return;
- // OR When Vacated
- trilist.SetBoolSigAction(joinMap.OrWhenVacated.JoinNumber, odtOccController.SetOrWhenVacatedState);
- odtOccController.OrWhenVacatedFeedback.LinkInputSig(trilist.BooleanInput[joinMap.OrWhenVacated.JoinNumber]);
-
- // AND When Vacated
- trilist.SetBoolSigAction(joinMap.AndWhenVacated.JoinNumber, odtOccController.SetAndWhenVacatedState);
- odtOccController.AndWhenVacatedFeedback.LinkInputSig(trilist.BooleanInput[joinMap.AndWhenVacated.JoinNumber]);
-
- // Ultrasonic A Sensor
- trilist.SetSigTrueAction(joinMap.EnableUsA.JoinNumber, () => odtOccController.SetUsAEnable(true));
- trilist.SetSigTrueAction(joinMap.DisableUsA.JoinNumber, () => odtOccController.SetUsAEnable(false));
- odtOccController.UltrasonicAEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.EnableUsA.JoinNumber]);
-
- // Ultrasonic B Sensor
- trilist.SetSigTrueAction(joinMap.EnableUsB.JoinNumber, () => odtOccController.SetUsBEnable(true));
- trilist.SetSigTrueAction(joinMap.DisableUsB.JoinNumber, () => odtOccController.SetUsBEnable(false));
- odtOccController.UltrasonicAEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.EnableUsB.JoinNumber]);
-
- // US Sensitivity in Occupied State
- trilist.SetBoolSigAction(joinMap.IncrementUsInOccupiedState.JoinNumber, odtOccController.IncrementUsSensitivityInOccupiedState);
- trilist.SetBoolSigAction(joinMap.DecrementUsInOccupiedState.JoinNumber, odtOccController.DecrementUsSensitivityInOccupiedState);
- odtOccController.UltrasonicSensitivityInOccupiedStateFeedback.LinkInputSig(trilist.UShortInput[joinMap.UsSensitivityInOccupiedState.JoinNumber]);
-
- // US Sensitivity in Vacant State
- trilist.SetBoolSigAction(joinMap.IncrementUsInVacantState.JoinNumber, odtOccController.IncrementUsSensitivityInVacantState);
- trilist.SetBoolSigAction(joinMap.DecrementUsInVacantState.JoinNumber, odtOccController.DecrementUsSensitivityInVacantState);
- odtOccController.UltrasonicSensitivityInVacantStateFeedback.LinkInputSig(trilist.UShortInput[joinMap.UsSensitivityInVacantState.JoinNumber]);
-
- //Sensor Raw States
- odtOccController.RawOccupancyPirFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RawOccupancyPirFeedback.JoinNumber]);
- odtOccController.RawOccupancyUsFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RawOccupancyUsFeedback.JoinNumber]);
-
- #endregion
+ }
+ });
}
- public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
+
+ ///
+ /// Applies any sensor settings defined in config
+ ///
+ protected virtual void ApplySettingsToSensorFromConfig()
{
- LinkOccSensorToApi(this, trilist, joinStart, joinMapKey, bridge);
+ Debug.Console(1, this, "Attempting to apply settings to sensor from config");
+
+ if (PropertiesConfig.EnablePir != null)
+ {
+ Debug.Console(1, this, "EnablePir found, attempting to set value from config");
+ SetPirEnable((bool)PropertiesConfig.EnablePir);
+ }
+ else
+ {
+ Debug.Console(1, this, "EnablePir null, no value specified in config");
+ }
+
+ if (PropertiesConfig.EnableLedFlash != null)
+ {
+ Debug.Console(1, this, "EnableLedFlash found, attempting to set value from config");
+ SetLedFlashEnable((bool)PropertiesConfig.EnableLedFlash);
+ }
+
+ if (PropertiesConfig.RemoteTimeout != null)
+ {
+ Debug.Console(1, this, "RemoteTimeout found, attempting to set value from config");
+ SetRemoteTimeout((ushort)PropertiesConfig.RemoteTimeout);
+ }
+ else
+ {
+ Debug.Console(1, this, "RemoteTimeout null, no value specified in config");
+ }
+
+ if (PropertiesConfig.ShortTimeoutState != null)
+ {
+ SetShortTimeoutState((bool)PropertiesConfig.ShortTimeoutState);
+ }
+
+ if (PropertiesConfig.EnableRawStates != null)
+ {
+ EnableRawStates((bool)PropertiesConfig.EnableRawStates);
+ }
+
+ if (PropertiesConfig.InternalPhotoSensorMinChange != null)
+ {
+ SetInternalPhotoSensorMinChange((ushort)PropertiesConfig.InternalPhotoSensorMinChange);
+ }
+
+ if (PropertiesConfig.ExternalPhotoSensorMinChange != null)
+ {
+ SetExternalPhotoSensorMinChange((ushort)PropertiesConfig.ExternalPhotoSensorMinChange);
+ }
}
- #region PreActivation
+ protected void RegisterGlsOccupancySensorBaseController(GlsOccupancySensorBase occSensor)
+ {
+ OccSensor = occSensor;
- private static GlsOirCCn GetGlsOirCCn(DeviceConfig dc)
- {
- var control = CommFactory.GetControlPropertiesConfig(dc);
- var cresnetId = control.CresnetIdInt;
- var branchId = control.ControlPortNumber;
- var parentKey = string.IsNullOrEmpty(control.ControlPortDevKey) ? "processor" : control.ControlPortDevKey;
+ RoomIsOccupiedFeedback = new BoolFeedback(RoomIsOccupiedFeedbackFunc);
- if (parentKey.Equals("processor", StringComparison.CurrentCultureIgnoreCase))
+ PirSensorEnabledFeedback = new BoolFeedback(() => OccSensor.PirEnabledFeedback.BoolValue);
+
+ LedFlashEnabledFeedback = new BoolFeedback(() => OccSensor.LedFlashEnabledFeedback.BoolValue);
+
+ ShortTimeoutEnabledFeedback = new BoolFeedback(() => OccSensor.ShortTimeoutEnabledFeedback.BoolValue);
+
+ PirSensitivityInVacantStateFeedback =
+ new IntFeedback(() => OccSensor.PirSensitivityInVacantStateFeedback.UShortValue);
+
+ PirSensitivityInOccupiedStateFeedback =
+ new IntFeedback(() => OccSensor.PirSensitivityInOccupiedStateFeedback.UShortValue);
+
+ CurrentTimeoutFeedback = new IntFeedback(() => OccSensor.CurrentTimeoutFeedback.UShortValue);
+
+ LocalTimoutFeedback = new IntFeedback(() => OccSensor.LocalTimeoutFeedback.UShortValue);
+
+ GraceOccupancyDetectedFeedback =
+ new BoolFeedback(() => OccSensor.GraceOccupancyDetectedFeedback.BoolValue);
+
+ RawOccupancyFeedback = new BoolFeedback(() => OccSensor.RawOccupancyFeedback.BoolValue);
+
+ InternalPhotoSensorValue = new IntFeedback(() => OccSensor.InternalPhotoSensorValueFeedback.UShortValue);
+
+ ExternalPhotoSensorValue = new IntFeedback(() => OccSensor.ExternalPhotoSensorValueFeedback.UShortValue);
+
+ OccSensor.BaseEvent += OccSensor_BaseEvent;
+
+ OccSensor.GlsOccupancySensorChange += OccSensor_GlsOccupancySensorChange;
+ }
+
+
+ ///
+ /// Catches events for feedbacks on the base class. Any extending wrapper class should call this delegate after it checks for it's own event IDs.
+ ///
+ ///
+ ///
+ protected virtual void OccSensor_GlsOccupancySensorChange(GlsOccupancySensorBase device, GlsOccupancySensorChangeEventArgs args)
+ {
+ switch (args.EventId)
+ {
+ case GlsOccupancySensorBase.PirEnabledFeedbackEventId:
+ PirSensorEnabledFeedback.FireUpdate();
+ break;
+ case GlsOccupancySensorBase.LedFlashEnabledFeedbackEventId:
+ LedFlashEnabledFeedback.FireUpdate();
+ break;
+ case GlsOccupancySensorBase.ShortTimeoutEnabledFeedbackEventId:
+ ShortTimeoutEnabledFeedback.FireUpdate();
+ break;
+ case GlsOccupancySensorBase.PirSensitivityInOccupiedStateFeedbackEventId:
+ PirSensitivityInOccupiedStateFeedback.FireUpdate();
+ break;
+ case GlsOccupancySensorBase.PirSensitivityInVacantStateFeedbackEventId:
+ PirSensitivityInVacantStateFeedback.FireUpdate();
+ break;
+ }
+ }
+
+ protected virtual void OccSensor_BaseEvent(Crestron.SimplSharpPro.GenericBase device, Crestron.SimplSharpPro.BaseEventArgs args)
+ {
+ Debug.Console(2, this, "GlsOccupancySensorChange EventId: {0}", args.EventId);
+
+ switch (args.EventId)
+ {
+ case GlsOccupancySensorBase.RoomVacantFeedbackEventId:
+ case GlsOccupancySensorBase.RoomOccupiedFeedbackEventId:
+ Debug.Console(1, this, "Occupancy State: {0}", OccSensor.OccupancyDetectedFeedback.BoolValue);
+ RoomIsOccupiedFeedback.FireUpdate();
+ break;
+ case GlsOccupancySensorBase.TimeoutFeedbackEventId:
+ CurrentTimeoutFeedback.FireUpdate();
+ break;
+ case GlsOccupancySensorBase.TimeoutLocalFeedbackEventId:
+ LocalTimoutFeedback.FireUpdate();
+ break;
+ case GlsOccupancySensorBase.GraceOccupancyDetectedFeedbackEventId:
+ GraceOccupancyDetectedFeedback.FireUpdate();
+ break;
+ case GlsOccupancySensorBase.RawOccupancyFeedbackEventId:
+ RawOccupancyFeedback.FireUpdate();
+ break;
+ case GlsOccupancySensorBase.InternalPhotoSensorValueFeedbackEventId:
+ InternalPhotoSensorValue.FireUpdate();
+ break;
+ case GlsOccupancySensorBase.ExternalPhotoSensorValueFeedbackEventId:
+ ExternalPhotoSensorValue.FireUpdate();
+ break;
+ }
+ }
+
+ public void SetTestMode(bool mode)
+ {
+ InTestMode = mode;
+
+ Debug.Console(1, this, "In Mock Mode: '{0}'", InTestMode);
+ }
+
+ public void SetTestOccupiedState(bool state)
+ {
+ if (!InTestMode)
+ Debug.Console(1, "Mock mode not enabled");
+ else
+ {
+ TestRoomIsOccupiedFeedback = state;
+
+ RoomIsOccupiedFeedback.FireUpdate();
+ }
+ }
+
+ ///
+ /// Enables or disables the PIR sensor
+ ///
+ ///
+ public void SetPirEnable(bool state)
+ {
+ Debug.Console(1, this, "Setting EnablePir to: {0}", state);
+
+ OccSensor.EnablePir.BoolValue = state;
+ OccSensor.DisablePir.BoolValue = !state;
+ }
+
+ ///
+ /// Enables or disables the LED Flash
+ ///
+ ///
+ public void SetLedFlashEnable(bool state)
+ {
+ OccSensor.EnableLedFlash.BoolValue = state;
+ OccSensor.DisableLedFlash.BoolValue = !state;
+ }
+
+ ///
+ /// Enables or disables short timeout based on state
+ ///
+ ///
+ public void SetShortTimeoutState(bool state)
+ {
+ OccSensor.EnableShortTimeout.BoolValue = state;
+ OccSensor.DisableShortTimeout.BoolValue = !state;
+ }
+
+ public void IncrementPirSensitivityInOccupiedState(bool pressRelease)
+ {
+ OccSensor.IncrementPirSensitivityInOccupiedState.BoolValue = pressRelease;
+ }
+
+ public void DecrementPirSensitivityInOccupiedState(bool pressRelease)
+ {
+ OccSensor.DecrementPirSensitivityInOccupiedState.BoolValue = pressRelease;
+ }
+
+ public void IncrementPirSensitivityInVacantState(bool pressRelease)
+ {
+ OccSensor.IncrementPirSensitivityInVacantState.BoolValue = pressRelease;
+ }
+
+ public void DecrementPirSensitivityInVacantState(bool pressRelease)
+ {
+ OccSensor.DecrementPirSensitivityInVacantState.BoolValue = pressRelease;
+ }
+
+ ///
+ /// Pulse ForceOccupied on the sensor for .5 seconds
+ ///
+ public void ForceOccupied()
+ {
+ CrestronInvoke.BeginInvoke((o) =>
+ {
+ ForceOccupied(true);
+ CrestronEnvironment.Sleep(500);
+ ForceOccupied(false);
+ });
+ }
+
+ public void ForceOccupied(bool value)
+ {
+ OccSensor.ForceOccupied.BoolValue = value;
+ }
+
+ ///
+ /// Pulse ForceVacant on the sensor for .5 seconds
+ ///
+ public void ForceVacant()
+ {
+ CrestronInvoke.BeginInvoke((o) =>
{
- Debug.Console(0, "Device {0} is a valid cresnet master - creating new GlsOirCCn", parentKey);
- return new GlsOirCCn(cresnetId, Global.ControlSystem);
- }
- var cresnetBridge = DeviceManager.GetDeviceForKey(parentKey) as IHasCresnetBranches;
+ ForceVacant(true);
+ CrestronEnvironment.Sleep(500);
+ ForceVacant(false);
+ });
+ }
- if (cresnetBridge != null)
- {
- Debug.Console(0, "Device {0} is a valid cresnet master - creating new GlsOirCCn", parentKey);
- return new GlsOirCCn(cresnetId, cresnetBridge.CresnetBranches[branchId]);
- }
- Debug.Console(0, "Device {0} is not a valid cresnet master", parentKey);
- return null;
- }
- #endregion
+ public void ForceVacant(bool value)
+ {
+ OccSensor.ForceVacant.BoolValue = value;
+ }
- public class GlsOccupancySensorBaseControllerFactory : EssentialsDeviceFactory
- {
- public GlsOccupancySensorBaseControllerFactory()
- {
- TypeNames = new List() { "glsoirccn" };
- }
+ public void EnableRawStates(bool state)
+ {
+ OccSensor.EnableRawStates.BoolValue = state;
+ }
+
+ public void SetRemoteTimeout(ushort time)
+ {
+ Debug.Console(1, this, "Setting RemoteTimout to: {0}", time);
+
+ OccSensor.RemoteTimeout.UShortValue = time;
+ }
+
+ public void SetInternalPhotoSensorMinChange(ushort value)
+ {
+ OccSensor.InternalPhotoSensorMinimumChange.UShortValue = value;
+ }
+
+ public void SetExternalPhotoSensorMinChange(ushort value)
+ {
+ OccSensor.ExternalPhotoSensorMinimumChange.UShortValue = value;
+ }
+
+ ///
+ /// Method to print current occ settings to console.
+ ///
+ public virtual void GetSettings()
+ {
+ var dash = new string('*', 50);
+ CrestronConsole.PrintLine(string.Format("{0}\n", dash));
+
+ Debug.Console(0, this, "Vacancy Detected: {0}",
+ OccSensor.VacancyDetectedFeedback.BoolValue);
+
+ Debug.Console(0, this, "Timeout Current: {0} | Local: {1}",
+ OccSensor.CurrentTimeoutFeedback.UShortValue,
+ OccSensor.LocalTimeoutFeedback.UShortValue);
+
+ Debug.Console(0, this, "Short Timeout Enabled: {0}",
+ OccSensor.ShortTimeoutEnabledFeedback.BoolValue);
+
+ Debug.Console(0, this, "PIR Sensor Enabled: {0} | Sensitivity Occupied: {1} | Sensitivity Vacant: {2}",
+ OccSensor.PirEnabledFeedback.BoolValue,
+ OccSensor.PirSensitivityInOccupiedStateFeedback.UShortValue,
+ OccSensor.PirSensitivityInVacantStateFeedback.UShortValue);
+
+ CrestronConsole.PrintLine(string.Format("{0}\n", dash));
+ }
+
+ protected void LinkOccSensorToApi(GlsOccupancySensorBaseController occController, BasicTriList trilist,
+ uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
+ {
+ var joinMap = new GlsOccupancySensorBaseJoinMap(joinStart);
+
+ var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
+
+ if (!string.IsNullOrEmpty(joinMapSerialized))
+ joinMap = JsonConvert.DeserializeObject(joinMapSerialized);
+
+ if (bridge != null)
+ {
+ bridge.AddJoinMap(Key, joinMap);
+ }
+ else
+ {
+ Debug.Console(0, this, "Please update config to use 'eiscapiadvanced' to get all join map features for this device.");
+ }
+
+ Debug.Console(1, occController, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
+
+ occController.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline.JoinNumber]);
+ trilist.StringInput[joinMap.Name.JoinNumber].StringValue = occController.Name;
+
+ trilist.OnlineStatusChange += (d, args) =>
+ {
+ if (args.DeviceOnLine)
+ {
+ trilist.StringInput[joinMap.Name.JoinNumber].StringValue = occController.Name;
+ }
+ };
+
+ LinkSingleTechSensorToApi(occController, trilist, joinMap);
+
+ LinkDualTechSensorToApi(occController, trilist, joinMap);
+ }
+
+ private static void LinkDualTechSensorToApi(GlsOccupancySensorBaseController occController, BasicTriList trilist,
+ GlsOccupancySensorBaseJoinMap joinMap)
+ {
+ var odtOccController = occController as GlsOdtOccupancySensorController;
+
+ if (odtOccController == null)
+ {
+ return;
+ }
+ // OR When Vacated
+ trilist.SetBoolSigAction(joinMap.OrWhenVacated.JoinNumber, odtOccController.SetOrWhenVacatedState);
+ odtOccController.OrWhenVacatedFeedback.LinkInputSig(trilist.BooleanInput[joinMap.OrWhenVacated.JoinNumber]);
+
+ // AND When Vacated
+ trilist.SetBoolSigAction(joinMap.AndWhenVacated.JoinNumber, odtOccController.SetAndWhenVacatedState);
+ odtOccController.AndWhenVacatedFeedback.LinkInputSig(trilist.BooleanInput[joinMap.AndWhenVacated.JoinNumber]);
+
+ // Ultrasonic A Sensor
+ trilist.SetSigTrueAction(joinMap.EnableUsA.JoinNumber, () => odtOccController.SetUsAEnable(true));
+ trilist.SetSigTrueAction(joinMap.DisableUsA.JoinNumber, () => odtOccController.SetUsAEnable(false));
+ odtOccController.UltrasonicAEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.EnableUsA.JoinNumber]);
+
+ // Ultrasonic B Sensor
+ trilist.SetSigTrueAction(joinMap.EnableUsB.JoinNumber, () => odtOccController.SetUsBEnable(true));
+ trilist.SetSigTrueAction(joinMap.DisableUsB.JoinNumber, () => odtOccController.SetUsBEnable(false));
+ odtOccController.UltrasonicBEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.EnableUsB.JoinNumber]);
+
+ // US Sensitivity in Occupied State
+ trilist.SetBoolSigAction(joinMap.IncrementUsInOccupiedState.JoinNumber,
+ odtOccController.IncrementUsSensitivityInOccupiedState);
+ trilist.SetBoolSigAction(joinMap.DecrementUsInOccupiedState.JoinNumber,
+ odtOccController.DecrementUsSensitivityInOccupiedState);
+ odtOccController.UltrasonicSensitivityInOccupiedStateFeedback.LinkInputSig(
+ trilist.UShortInput[joinMap.UsSensitivityInOccupiedState.JoinNumber]);
+
+ // US Sensitivity in Vacant State
+ trilist.SetBoolSigAction(joinMap.IncrementUsInVacantState.JoinNumber,
+ odtOccController.IncrementUsSensitivityInVacantState);
+ trilist.SetBoolSigAction(joinMap.DecrementUsInVacantState.JoinNumber,
+ odtOccController.DecrementUsSensitivityInVacantState);
+ odtOccController.UltrasonicSensitivityInVacantStateFeedback.LinkInputSig(
+ trilist.UShortInput[joinMap.UsSensitivityInVacantState.JoinNumber]);
+
+ //Sensor Raw States
+ odtOccController.RawOccupancyPirFeedback.LinkInputSig(
+ trilist.BooleanInput[joinMap.RawOccupancyPirFeedback.JoinNumber]);
+ odtOccController.RawOccupancyUsFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RawOccupancyUsFeedback.JoinNumber]);
+ }
+
+ private static void LinkSingleTechSensorToApi(GlsOccupancySensorBaseController occController, BasicTriList trilist,
+ GlsOccupancySensorBaseJoinMap joinMap)
+ {
+// Occupied status
+ trilist.SetBoolSigAction(joinMap.ForceOccupied.JoinNumber, occController.ForceOccupied);
+ trilist.SetBoolSigAction(joinMap.ForceVacant.JoinNumber, occController.ForceVacant);
+ occController.RoomIsOccupiedFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RoomOccupiedFeedback.JoinNumber]);
+ occController.RoomIsOccupiedFeedback.LinkComplementInputSig(
+ trilist.BooleanInput[joinMap.RoomVacantFeedback.JoinNumber]);
+ occController.RawOccupancyFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RawOccupancyFeedback.JoinNumber]);
+ trilist.SetBoolSigAction(joinMap.EnableRawStates.JoinNumber, occController.EnableRawStates);
+
+ // Timouts
+ trilist.SetUShortSigAction(joinMap.Timeout.JoinNumber, occController.SetRemoteTimeout);
+ occController.CurrentTimeoutFeedback.LinkInputSig(trilist.UShortInput[joinMap.Timeout.JoinNumber]);
+ occController.LocalTimoutFeedback.LinkInputSig(trilist.UShortInput[joinMap.TimeoutLocalFeedback.JoinNumber]);
+
+ // LED Flash
+ trilist.SetSigTrueAction(joinMap.EnableLedFlash.JoinNumber, () => occController.SetLedFlashEnable(true));
+ trilist.SetSigTrueAction(joinMap.DisableLedFlash.JoinNumber, () => occController.SetLedFlashEnable(false));
+ occController.LedFlashEnabledFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.EnableLedFlash.JoinNumber]);
+
+ // Short Timeout
+ trilist.SetSigTrueAction(joinMap.EnableShortTimeout.JoinNumber, () => occController.SetShortTimeoutState(true));
+ trilist.SetSigTrueAction(joinMap.DisableShortTimeout.JoinNumber, () => occController.SetShortTimeoutState(false));
+ occController.ShortTimeoutEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.EnableShortTimeout.JoinNumber]);
+
+ // PIR Sensor
+ trilist.SetSigTrueAction(joinMap.EnablePir.JoinNumber, () => occController.SetPirEnable(true));
+ trilist.SetSigTrueAction(joinMap.DisablePir.JoinNumber, () => occController.SetPirEnable(false));
+ occController.PirSensorEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.EnablePir.JoinNumber]);
+
+ // PIR Sensitivity in Occupied State
+ trilist.SetBoolSigAction(joinMap.IncrementPirInOccupiedState.JoinNumber,
+ occController.IncrementPirSensitivityInOccupiedState);
+ trilist.SetBoolSigAction(joinMap.DecrementPirInOccupiedState.JoinNumber,
+ occController.DecrementPirSensitivityInOccupiedState);
+ occController.PirSensitivityInOccupiedStateFeedback.LinkInputSig(
+ trilist.UShortInput[joinMap.PirSensitivityInOccupiedState.JoinNumber]);
+
+ // PIR Sensitivity in Vacant State
+ trilist.SetBoolSigAction(joinMap.IncrementPirInVacantState.JoinNumber,
+ occController.IncrementPirSensitivityInVacantState);
+ trilist.SetBoolSigAction(joinMap.DecrementPirInVacantState.JoinNumber,
+ occController.DecrementPirSensitivityInVacantState);
+ occController.PirSensitivityInVacantStateFeedback.LinkInputSig(
+ trilist.UShortInput[joinMap.PirSensitivityInVacantState.JoinNumber]);
+ }
+ }
- public override EssentialsDevice BuildDevice(DeviceConfig dc)
- {
- Debug.Console(1, "Factory Attempting to create new GlsOccupancySensorBaseController Device");
-
- return new GlsOccupancySensorBaseController(dc.Key, GetGlsOirCCn, dc);
- }
-
- }
- }
-
-
}
\ No newline at end of file
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Occupancy/GlsOccupancySensorPropertiesConfig.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Occupancy/GlsOccupancySensorPropertiesConfig.cs
new file mode 100644
index 00000000..392c05b0
--- /dev/null
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Occupancy/GlsOccupancySensorPropertiesConfig.cs
@@ -0,0 +1,81 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Crestron.SimplSharp;
+
+using Newtonsoft.Json;
+
+namespace PepperDash.Essentials.Core
+{
+ ///
+ /// Defines configuration properties for Crestron GLS series occupancy sensors
+ ///
+ public class GlsOccupancySensorPropertiesConfig
+ {
+ // Single Technology Sensors (PIR): GlsOccupancySensorBase
+ [JsonProperty("enablePir")]
+ public bool? EnablePir { get; set; }
+
+ [JsonProperty("enableLedFlash")]
+ public bool? EnableLedFlash { get; set; }
+
+ [JsonProperty("shortTimeoutState")]
+ public bool? ShortTimeoutState { get; set; }
+
+ [JsonProperty("enableRawStates")]
+ public bool? EnableRawStates { get; set; }
+
+ [JsonProperty("remoteTimeout")]
+ public ushort? RemoteTimeout { get; set; }
+
+ [JsonProperty("internalPhotoSensorMinChange")]
+ public ushort? InternalPhotoSensorMinChange { get; set; }
+
+ [JsonProperty("externalPhotoSensorMinChange")]
+ public ushort? ExternalPhotoSensorMinChange { get; set; }
+
+ // Dual Technology Sensors: GlsOdtCCn
+ [JsonProperty("enableUsA")]
+ public bool? EnableUsA { get; set; }
+
+ [JsonProperty("enableUsB")]
+ public bool? EnableUsB { get; set; }
+
+ [JsonProperty("orWhenVacatedState")]
+ public bool? OrWhenVacatedState { get; set; }
+
+ [JsonProperty("andWhenVacatedState")]
+ public bool? AndWhenVacatedState { get; set; }
+
+ // PoE Sensors: CenOdtCPoe
+
+ ///
+ /// Sets the sensitivity level for US while sensor is in occupied state
+ /// 1 = low; 2 = medium; 3 = high; 4 = xlow; 5 = 2xlow; 6 = 3xlow
+ ///
+ [JsonProperty("usSensitivityOccupied")]
+ public ushort? UsSensitivityOccupied { get; set; }
+
+ ///
+ /// Sets the sensitivity level for US while sensor is in vacant state
+ /// 1 = low; 2 = medium; 3 = high; 4 = xlow; 5 = 2xlow; 6 = 3xlow
+ ///
+ [JsonProperty("usSensitivityVacant")]
+ public ushort? UsSensitivityVacant { get; set; }
+
+ ///
+ /// Sets the sensitivity level for PIR while sensor is in occupied state
+ /// 1 = low; 2 = medium; 3 = high
+ ///
+ [JsonProperty("pirSensitivityOccupied")]
+ public ushort? PirSensitivityOccupied { get; set; }
+
+ ///
+ /// Sets the sensitivity level for PIR while sensor is in vacant state
+ /// 1 = low; 2 = medium; 3 = high
+ ///
+ [JsonProperty("pirSensitivityVacant")]
+ public ushort? PirSensitivityVacant { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Occupancy/GlsOdtOccupancySensorController.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Occupancy/GlsOdtOccupancySensorController.cs
index 4900ca93..d5e18280 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Occupancy/GlsOdtOccupancySensorController.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Occupancy/GlsOdtOccupancySensorController.cs
@@ -1,183 +1,266 @@
using System;
using System.Collections.Generic;
-using System.Linq;
-using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro.DeviceSupport;
using Crestron.SimplSharpPro.GeneralIO;
using PepperDash.Core;
-using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Config;
using PepperDash.Essentials.Core.Bridges;
namespace PepperDash.Essentials.Core
{
- [Description("Wrapper class for Dual Technology GLS Occupancy Sensors")]
+ [Description("Wrapper class for Dual Technology GLS Occupancy Sensors")]
+ [ConfigSnippet("\"properties\": {\"control\": {\"method\": \"cresnet\",\"cresnetId\": \"97\"},\"enablePir\": true,\"enableLedFlash\": true,\"enableRawStates\":true,\"remoteTimeout\": 30,\"internalPhotoSensorMinChange\": 0,\"externalPhotoSensorMinChange\": 0,\"enableUsA\": true,\"enableUsB\": true,\"orWhenVacatedState\": true}")]
public class GlsOdtOccupancySensorController : GlsOccupancySensorBaseController
- {
- public new GlsOdtCCn OccSensor { get; private set; }
+ {
+ private GlsOdtCCn _occSensor;
- public BoolFeedback OrWhenVacatedFeedback { get; private set; }
+ public BoolFeedback OrWhenVacatedFeedback { get; private set; }
- public BoolFeedback AndWhenVacatedFeedback { get; private set; }
+ public BoolFeedback AndWhenVacatedFeedback { get; private set; }
- public BoolFeedback UltrasonicAEnabledFeedback { get; private set; }
+ public BoolFeedback UltrasonicAEnabledFeedback { get; private set; }
- public BoolFeedback UltrasonicBEnabledFeedback { get; private set; }
+ public BoolFeedback UltrasonicBEnabledFeedback { get; private set; }
- public IntFeedback UltrasonicSensitivityInVacantStateFeedback { get; private set; }
+ public IntFeedback UltrasonicSensitivityInVacantStateFeedback { get; private set; }
- public IntFeedback UltrasonicSensitivityInOccupiedStateFeedback { get; private set; }
+ public IntFeedback UltrasonicSensitivityInOccupiedStateFeedback { get; private set; }
- public BoolFeedback RawOccupancyPirFeedback { get; private set; }
+ public BoolFeedback RawOccupancyPirFeedback { get; private set; }
- public BoolFeedback RawOccupancyUsFeedback { get; private set; }
+ public BoolFeedback RawOccupancyUsFeedback { get; private set; }
- public GlsOdtOccupancySensorController(string key, Func preActivationFunc,
- DeviceConfig config)
- : base(key, config.Name)
+ public GlsOdtOccupancySensorController(string key, Func preActivationFunc,
+ DeviceConfig config)
+ : base(key, config.Name, config)
+ {
+ AddPreActivationAction(() =>
+ {
+ _occSensor = preActivationFunc(config);
+
+ RegisterCrestronGenericBase(_occSensor);
+
+ RegisterGlsOccupancySensorBaseController(_occSensor);
+
+ AndWhenVacatedFeedback = new BoolFeedback(() => _occSensor.AndWhenVacatedFeedback.BoolValue);
+
+ OrWhenVacatedFeedback = new BoolFeedback(() => _occSensor.OrWhenVacatedFeedback.BoolValue);
+
+ UltrasonicAEnabledFeedback = new BoolFeedback(() => _occSensor.UsAEnabledFeedback.BoolValue);
+
+ UltrasonicBEnabledFeedback = new BoolFeedback(() => _occSensor.UsBEnabledFeedback.BoolValue);
+
+ RawOccupancyPirFeedback = new BoolFeedback(() => _occSensor.RawOccupancyPirFeedback.BoolValue);
+
+ RawOccupancyUsFeedback = new BoolFeedback(() => _occSensor.RawOccupancyUsFeedback.BoolValue);
+
+ UltrasonicSensitivityInVacantStateFeedback = new IntFeedback(() => _occSensor.UsSensitivityInVacantStateFeedback.UShortValue);
+
+ UltrasonicSensitivityInOccupiedStateFeedback = new IntFeedback(() => _occSensor.UsSensitivityInOccupiedStateFeedback.UShortValue);
+
+ });
+ }
+
+ protected override void ApplySettingsToSensorFromConfig()
{
- AddPreActivationAction(() =>
+ base.ApplySettingsToSensorFromConfig();
+
+ if (PropertiesConfig.EnableUsA != null)
{
- OccSensor = preActivationFunc(config);
+ Debug.Console(1, this, "EnableUsA found, attempting to set value from config");
+ SetUsAEnable((bool)PropertiesConfig.EnableUsA);
+ }
+ else
+ {
+ Debug.Console(1, this, "EnableUsA null, no value specified in config");
+ }
- RegisterCrestronGenericBase(OccSensor);
- RegisterGlsOdtSensorBaseController(OccSensor);
+ if (PropertiesConfig.EnableUsB != null)
+ {
+ Debug.Console(1, this, "EnableUsB found, attempting to set value from config");
+ SetUsBEnable((bool)PropertiesConfig.EnableUsB);
+ }
+ else
+ {
+ Debug.Console(1, this, "EnablePir null, no value specified in config");
+ }
- AndWhenVacatedFeedback = new BoolFeedback(() => OccSensor.AndWhenVacatedFeedback.BoolValue);
- OrWhenVacatedFeedback = new BoolFeedback(() => OccSensor.OrWhenVacatedFeedback.BoolValue);
+ if (PropertiesConfig.OrWhenVacatedState != null)
+ {
+ SetOrWhenVacatedState((bool)PropertiesConfig.OrWhenVacatedState);
+ }
- UltrasonicAEnabledFeedback = new BoolFeedback(() => OccSensor.UsAEnabledFeedback.BoolValue);
-
- UltrasonicBEnabledFeedback = new BoolFeedback(() => OccSensor.UsBEnabledFeedback.BoolValue);
-
- RawOccupancyPirFeedback = new BoolFeedback(() => OccSensor.RawOccupancyPirFeedback.BoolValue);
-
- RawOccupancyUsFeedback = new BoolFeedback(() => OccSensor.RawOccupancyUsFeedback.BoolValue);
-
- UltrasonicSensitivityInVacantStateFeedback = new IntFeedback(() => OccSensor.UsSensitivityInVacantStateFeedback.UShortValue);
-
- UltrasonicSensitivityInOccupiedStateFeedback = new IntFeedback(() => OccSensor.UsSensitivityInOccupiedStateFeedback.UShortValue);
-
- });
+ if (PropertiesConfig.AndWhenVacatedState != null)
+ {
+ SetAndWhenVacatedState((bool)PropertiesConfig.AndWhenVacatedState);
+ }
}
- ///
- /// Overrides the base class event delegate to fire feedbacks for event IDs that pertain to this extended class.
- /// Then calls the base delegate method to ensure any common event IDs are captured.
- ///
- ///
- ///
- protected override void OccSensor_GlsOccupancySensorChange(GlsOccupancySensorBase device, GlsOccupancySensorChangeEventArgs args)
+ ///
+ /// Overrides the base class event delegate to fire feedbacks for event IDs that pertain to this extended class.
+ /// Then calls the base delegate method to ensure any common event IDs are captured.
+ ///
+ ///
+ ///
+ protected override void OccSensor_GlsOccupancySensorChange(GlsOccupancySensorBase device, GlsOccupancySensorChangeEventArgs args)
+ {
+ switch (args.EventId)
+ {
+ case GlsOccupancySensorBase.AndWhenVacatedFeedbackEventId:
+ AndWhenVacatedFeedback.FireUpdate();
+ break;
+ case GlsOccupancySensorBase.OrWhenVacatedFeedbackEventId:
+ OrWhenVacatedFeedback.FireUpdate();
+ break;
+ case GlsOccupancySensorBase.UsAEnabledFeedbackEventId:
+ UltrasonicAEnabledFeedback.FireUpdate();
+ break;
+ case GlsOccupancySensorBase.UsBEnabledFeedbackEventId:
+ UltrasonicBEnabledFeedback.FireUpdate();
+ break;
+ case GlsOccupancySensorBase.UsSensitivityInOccupiedStateFeedbackEventId:
+ UltrasonicSensitivityInOccupiedStateFeedback.FireUpdate();
+ break;
+ case GlsOccupancySensorBase.UsSensitivityInVacantStateFeedbackEventId:
+ UltrasonicSensitivityInVacantStateFeedback.FireUpdate();
+ break;
+ }
+
+ base.OccSensor_GlsOccupancySensorChange(device, args);
+ }
+
+ ///
+ /// Overrides the base class event delegate to fire feedbacks for event IDs that pertain to this extended class.
+ /// Then calls the base delegate method to ensure any common event IDs are captured.
+ ///
+ ///
+ ///
+ protected override void OccSensor_BaseEvent(Crestron.SimplSharpPro.GenericBase device, Crestron.SimplSharpPro.BaseEventArgs args)
+ {
+ switch (args.EventId)
+ {
+ case GlsOccupancySensorBase.RawOccupancyPirFeedbackEventId:
+ RawOccupancyPirFeedback.FireUpdate();
+ break;
+ case GlsOccupancySensorBase.RawOccupancyUsFeedbackEventId:
+ RawOccupancyUsFeedback.FireUpdate();
+ break;
+ }
+
+ base.OccSensor_BaseEvent(device, args);
+ }
+
+ ///
+ /// Sets the OrWhenVacated state
+ ///
+ ///
+ public void SetOrWhenVacatedState(bool state)
+ {
+ _occSensor.OrWhenVacated.BoolValue = state;
+ }
+
+ ///
+ /// Sets the AndWhenVacated state
+ ///
+ ///
+ public void SetAndWhenVacatedState(bool state)
+ {
+ _occSensor.AndWhenVacated.BoolValue = state;
+ }
+
+ ///
+ /// Enables or disables the Ultrasonic A sensor
+ ///
+ ///
+ public void SetUsAEnable(bool state)
+ {
+ _occSensor.EnableUsA.BoolValue = state;
+ _occSensor.DisableUsA.BoolValue = !state;
+ }
+
+
+ ///
+ /// Enables or disables the Ultrasonic B sensor
+ ///
+ ///
+ public void SetUsBEnable(bool state)
+ {
+ _occSensor.EnableUsB.BoolValue = state;
+ _occSensor.DisableUsB.BoolValue = !state;
+ }
+
+ public void IncrementUsSensitivityInOccupiedState(bool pressRelease)
+ {
+ _occSensor.IncrementUsSensitivityInOccupiedState.BoolValue = pressRelease;
+ }
+
+ public void DecrementUsSensitivityInOccupiedState(bool pressRelease)
+ {
+ _occSensor.DecrementUsSensitivityInOccupiedState.BoolValue = pressRelease;
+ }
+
+ public void IncrementUsSensitivityInVacantState(bool pressRelease)
+ {
+ _occSensor.IncrementUsSensitivityInVacantState.BoolValue = pressRelease;
+ }
+
+ public void DecrementUsSensitivityInVacantState(bool pressRelease)
+ {
+ _occSensor.DecrementUsSensitivityInVacantState.BoolValue = pressRelease;
+ }
+
+ public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
+ {
+ LinkOccSensorToApi(this, trilist, joinStart, joinMapKey, bridge);
+ }
+
+ ///
+ /// Method to print occ sensor settings to console.
+ ///
+ public override void GetSettings()
+ {
+ base.GetSettings();
+
+ Debug.Console(0, this, "Ultrasonic Enabled A: {0} | B: {1}",
+ _occSensor.UsAEnabledFeedback.BoolValue,
+ _occSensor.UsBEnabledFeedback.BoolValue);
+
+ Debug.Console(0, this, "Ultrasonic Sensitivity Occupied: {0} | Vacant: {1}",
+ _occSensor.UsSensitivityInOccupiedStateFeedback.UShortValue,
+ _occSensor.UsSensitivityInVacantStateFeedback.UShortValue);
+
+ var dash = new string('*', 50);
+ CrestronConsole.PrintLine(string.Format("{0}\n", dash));
+ }
+
+ }
+
+ public class GlsOdtOccupancySensorControllerFactory : EssentialsDeviceFactory
+ {
+ public GlsOdtOccupancySensorControllerFactory()
{
- if (args.EventId == GlsOccupancySensorBase.AndWhenVacatedFeedbackEventId)
- AndWhenVacatedFeedback.FireUpdate();
- else if (args.EventId == GlsOccupancySensorBase.OrWhenVacatedFeedbackEventId)
- OrWhenVacatedFeedback.FireUpdate();
- else if (args.EventId == GlsOccupancySensorBase.UsAEnabledFeedbackEventId)
- UltrasonicAEnabledFeedback.FireUpdate();
- else if (args.EventId == GlsOccupancySensorBase.UsBEnabledFeedbackEventId)
- UltrasonicBEnabledFeedback.FireUpdate();
- else if (args.EventId == GlsOccupancySensorBase.UsSensitivityInOccupiedStateFeedbackEventId)
- UltrasonicSensitivityInOccupiedStateFeedback.FireUpdate();
- else if (args.EventId == GlsOccupancySensorBase.UsSensitivityInVacantStateFeedbackEventId)
- UltrasonicSensitivityInVacantStateFeedback.FireUpdate();
-
- base.OccSensor_GlsOccupancySensorChange(device, args);
+ TypeNames = new List { "glsodtccn" };
}
- ///
- /// Overrides the base class event delegate to fire feedbacks for event IDs that pertain to this extended class.
- /// Then calls the base delegate method to ensure any common event IDs are captured.
- ///
- ///
- ///
- protected override void OccSensor_BaseEvent(Crestron.SimplSharpPro.GenericBase device, Crestron.SimplSharpPro.BaseEventArgs args)
+
+ public override EssentialsDevice BuildDevice(DeviceConfig dc)
{
- if (args.EventId == GlsOccupancySensorBase.RawOccupancyPirFeedbackEventId)
- RawOccupancyPirFeedback.FireUpdate();
- else if (args.EventId == GlsOccupancySensorBase.RawOccupancyUsFeedbackEventId)
- RawOccupancyUsFeedback.FireUpdate();
+ Debug.Console(1, "Factory Attempting to create new GlsOccupancySensorBaseController Device");
- base.OccSensor_BaseEvent(device, args);
+ return new GlsOdtOccupancySensorController(dc.Key, GetGlsOdtCCn, dc);
}
- ///
- /// Sets the OrWhenVacated state
- ///
- ///
- public void SetOrWhenVacatedState(bool state)
- {
- OccSensor.OrWhenVacated.BoolValue = state;
- }
-
- ///
- /// Sets the AndWhenVacated state
- ///
- ///
- public void SetAndWhenVacatedState(bool state)
- {
- OccSensor.AndWhenVacated.BoolValue = state;
- }
-
- ///
- /// Enables or disables the Ultrasonic A sensor
- ///
- ///
- public void SetUsAEnable(bool state)
- {
- OccSensor.EnableUsA.BoolValue = state;
- OccSensor.DisableUsA.BoolValue = !state;
- }
-
-
- ///
- /// Enables or disables the Ultrasonic B sensor
- ///
- ///
- public void SetUsBEnable(bool state)
- {
- OccSensor.EnableUsB.BoolValue = state;
- OccSensor.DisableUsB.BoolValue = !state;
- }
-
- public void IncrementUsSensitivityInOccupiedState(bool pressRelease)
- {
- OccSensor.IncrementUsSensitivityInOccupiedState.BoolValue = pressRelease;
- }
-
- public void DecrementUsSensitivityInOccupiedState(bool pressRelease)
- {
- OccSensor.DecrementUsSensitivityInOccupiedState.BoolValue = pressRelease;
- }
-
- public void IncrementUsSensitivityInVacantState(bool pressRelease)
- {
- OccSensor.IncrementUsSensitivityInVacantState.BoolValue = pressRelease;
- }
-
- public void DecrementUsSensitivityInVacantState(bool pressRelease)
- {
- OccSensor.DecrementUsSensitivityInVacantState.BoolValue = pressRelease;
- }
-
- public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
- {
- LinkOccSensorToApi(this, trilist, joinStart, joinMapKey, bridge);
- }
-
- #region PreActivation
-
private static GlsOdtCCn GetGlsOdtCCn(DeviceConfig dc)
{
var control = CommFactory.GetControlPropertiesConfig(dc);
var cresnetId = control.CresnetIdInt;
var branchId = control.ControlPortNumber;
- var parentKey = string.IsNullOrEmpty(control.ControlPortDevKey) ? "processor" : control.ControlPortDevKey;
+ var parentKey = String.IsNullOrEmpty(control.ControlPortDevKey) ? "processor" : control.ControlPortDevKey;
if (parentKey.Equals("processor", StringComparison.CurrentCultureIgnoreCase))
{
@@ -194,24 +277,6 @@ namespace PepperDash.Essentials.Core
Debug.Console(0, "Device {0} is not a valid cresnet master", parentKey);
return null;
}
- #endregion
-
- public class GlsOdtOccupancySensorControllerFactory : EssentialsDeviceFactory
- {
- public GlsOdtOccupancySensorControllerFactory()
- {
- TypeNames = new List() { "glsodtccn" };
- }
-
-
- public override EssentialsDevice BuildDevice(DeviceConfig dc)
- {
- Debug.Console(1, "Factory Attempting to create new GlsOccupancySensorBaseController Device");
-
- return new GlsOdtOccupancySensorController(dc.Key, GetGlsOdtCCn, dc);
- }
-
- }
}
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Occupancy/GlsOirOccupancySensorController.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Occupancy/GlsOirOccupancySensorController.cs
new file mode 100644
index 00000000..573d94ac
--- /dev/null
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Occupancy/GlsOirOccupancySensorController.cs
@@ -0,0 +1,80 @@
+using System;
+using System.Collections.Generic;
+using Crestron.SimplSharpPro.DeviceSupport;
+using Crestron.SimplSharpPro.GeneralIO;
+using PepperDash.Core;
+using PepperDash.Essentials.Core.Bridges;
+using PepperDash.Essentials.Core.Config;
+
+namespace PepperDash.Essentials.Core
+{
+ public class GlsOirOccupancySensorController:GlsOccupancySensorBaseController
+ {
+ private GlsOirCCn _occSensor;
+
+ public GlsOirOccupancySensorController(string key, Func preActivationFunc,DeviceConfig config) : this(key,config.Name, preActivationFunc, config)
+ {
+ }
+
+ public GlsOirOccupancySensorController(string key, string name, Func preActivationFunc, DeviceConfig config) : base(key, name, config)
+ {
+ AddPreActivationAction(() =>
+ {
+ _occSensor = preActivationFunc(config);
+
+ RegisterCrestronGenericBase(_occSensor);
+
+ RegisterGlsOccupancySensorBaseController(_occSensor);
+ });
+ }
+
+ #region Overrides of CrestronGenericBridgeableBaseDevice
+
+ public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
+ {
+ LinkOccSensorToApi(this, trilist, joinStart, joinMapKey, bridge);
+ }
+
+ #endregion
+ }
+
+ public class GlsOccupancySensorBaseControllerFactory : EssentialsDeviceFactory
+ {
+ public GlsOccupancySensorBaseControllerFactory()
+ {
+ TypeNames = new List { "glsoirccn" };
+ }
+
+
+ public override EssentialsDevice BuildDevice(DeviceConfig dc)
+ {
+ Debug.Console(1, "Factory Attempting to create new GlsOirOccupancySensorController Device");
+
+ return new GlsOirOccupancySensorController(dc.Key, GetGlsOirCCn, dc);
+ }
+
+ private static GlsOirCCn GetGlsOirCCn(DeviceConfig dc)
+ {
+ var control = CommFactory.GetControlPropertiesConfig(dc);
+ var cresnetId = control.CresnetIdInt;
+ var branchId = control.ControlPortNumber;
+ var parentKey = string.IsNullOrEmpty(control.ControlPortDevKey) ? "processor" : control.ControlPortDevKey;
+
+ if (parentKey.Equals("processor", StringComparison.CurrentCultureIgnoreCase))
+ {
+ Debug.Console(0, "Device {0} is a valid cresnet master - creating new GlsOirCCn", parentKey);
+ return new GlsOirCCn(cresnetId, Global.ControlSystem);
+ }
+ var cresnetBridge = DeviceManager.GetDeviceForKey(parentKey) as IHasCresnetBranches;
+
+ if (cresnetBridge != null)
+ {
+ Debug.Console(0, "Device {0} is a valid cresnet master - creating new GlsOirCCn", parentKey);
+ return new GlsOirCCn(cresnetId, cresnetBridge.CresnetBranches[branchId]);
+ }
+ Debug.Console(0, "Device {0} is not a valid cresnet master", parentKey);
+ return null;
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Occupancy/IOccupancyStatusProviderAggregator.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Occupancy/IOccupancyStatusProviderAggregator.cs
index c321dcad..3da9c0dc 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Occupancy/IOccupancyStatusProviderAggregator.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Occupancy/IOccupancyStatusProviderAggregator.cs
@@ -2,17 +2,18 @@
using System.Collections.Generic;
using System.Linq;
using System.Text;
-using Crestron.SimplSharp;
-
+using Crestron.SimplSharp;
+using Crestron.SimplSharpPro.GeneralIO;
using PepperDash.Core;
using PepperDash.Essentials.Core;
+using PepperDash.Essentials.Core.Config;
namespace PepperDash.Essentials.Core
{
///
/// Aggregates the RoomIsOccupied feedbacks of one or more IOccupancyStatusProvider objects
///
- public class IOccupancyStatusProviderAggregator : Device, IOccupancyStatusProvider
+ public class IOccupancyStatusProviderAggregator : EssentialsDevice, IOccupancyStatusProvider
{
///
/// Aggregated feedback of all linked IOccupancyStatusProvider devices
@@ -21,16 +22,51 @@ namespace PepperDash.Essentials.Core
{
get
{
- return AggregatedOccupancyStatus.Output;
+ return _aggregatedOccupancyStatus.Output;
}
}
- private BoolFeedbackOr AggregatedOccupancyStatus;
+ private readonly BoolFeedbackOr _aggregatedOccupancyStatus;
public IOccupancyStatusProviderAggregator(string key, string name)
: base(key, name)
{
- AggregatedOccupancyStatus = new BoolFeedbackOr();
+ _aggregatedOccupancyStatus = new BoolFeedbackOr();
+ }
+
+ public IOccupancyStatusProviderAggregator(string key, string name, OccupancyAggregatorConfig config)
+ : this(key, name)
+ {
+ AddPostActivationAction(() =>
+ {
+ if (config.DeviceKeys.Count == 0)
+ {
+ return;
+ }
+
+ foreach (var deviceKey in config.DeviceKeys)
+ {
+ var device = DeviceManager.GetDeviceForKey(deviceKey);
+
+ if (device == null)
+ {
+ Debug.Console(0, this, Debug.ErrorLogLevel.Notice,
+ "Unable to retrieve Occupancy provider with key {0}", deviceKey);
+ continue;
+ }
+
+ var provider = device as IOccupancyStatusProvider;
+
+ if (provider == null)
+ {
+ Debug.Console(0, this, Debug.ErrorLogLevel.Notice,
+ "Device with key {0} does NOT implement IOccupancyStatusProvider. Please check configuration.");
+ continue;
+ }
+
+ AddOccupancyStatusProvider(provider);
+ }
+ });
}
///
@@ -39,7 +75,35 @@ namespace PepperDash.Essentials.Core
///
public void AddOccupancyStatusProvider(IOccupancyStatusProvider statusProvider)
{
- AggregatedOccupancyStatus.AddOutputIn(statusProvider.RoomIsOccupiedFeedback);
+ _aggregatedOccupancyStatus.AddOutputIn(statusProvider.RoomIsOccupiedFeedback);
+ }
+
+ public void RemoveOccupancyStatusProvider(IOccupancyStatusProvider statusProvider)
+ {
+ _aggregatedOccupancyStatus.RemoveOutputIn(statusProvider.RoomIsOccupiedFeedback);
+ }
+
+ public void ClearOccupancyStatusProviders()
+ {
+ _aggregatedOccupancyStatus.ClearOutputs();
}
+ }
+
+ public class OccupancyAggregatorFactory : EssentialsDeviceFactory
+ {
+ public OccupancyAggregatorFactory()
+ {
+ TypeNames = new List { "occupancyAggregator", "occAggregate" };
+ }
+
+
+ public override EssentialsDevice BuildDevice(DeviceConfig dc)
+ {
+ Debug.Console(1, "Factory Attempting to create new GlsOccupancySensorBaseController Device");
+
+ var config = dc.Properties.ToObject();
+
+ return new IOccupancyStatusProviderAggregator(dc.Key, dc.Name, config);
+ }
}
}
\ No newline at end of file
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Occupancy/OccupancyAggregatorConfig.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Occupancy/OccupancyAggregatorConfig.cs
new file mode 100644
index 00000000..ef237e72
--- /dev/null
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Occupancy/OccupancyAggregatorConfig.cs
@@ -0,0 +1,15 @@
+using System.Collections.Generic;
+using Newtonsoft.Json;
+
+namespace PepperDash.Essentials.Core
+{
+ public class OccupancyAggregatorConfig
+ {
+ [JsonProperty("deviceKeys")] public List DeviceKeys { get; set; }
+
+ public OccupancyAggregatorConfig()
+ {
+ DeviceKeys = new List();
+ }
+ }
+}
\ No newline at end of file
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/PartitionSensor/EssentialsPartitionController.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/PartitionSensor/EssentialsPartitionController.cs
new file mode 100644
index 00000000..7066be0e
--- /dev/null
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/PartitionSensor/EssentialsPartitionController.cs
@@ -0,0 +1,149 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Crestron.SimplSharp;
+
+namespace PepperDash.Essentials.Core
+{
+ ///
+ /// Represents an abstract controller device for a partition dividing rooms that are combinable
+ ///
+ /// In Auto mode, it can use a partition sensor to automatically determine whether the partition is present.
+ ///
+ /// In Manual mode it accepts user input to tell it whether the partition is present.
+ ///
+ public class EssentialsPartitionController : IPartitionController
+ {
+ private IPartitionStateProvider _partitionSensor;
+
+ private bool isInAutoMode;
+
+ private bool partitionPresent;
+
+ public EssentialsPartitionController(string key, string name, IPartitionStateProvider sensor, bool defaultToManualMode, List adjacentRoomKeys)
+ {
+ Key = key;
+
+ Name = name;
+
+ AdjacentRoomKeys = adjacentRoomKeys;
+
+ if (sensor != null)
+ {
+ _partitionSensor = sensor;
+
+ if (!defaultToManualMode)
+ {
+ SetAutoMode();
+ }
+ else
+ {
+ SetManualMode();
+ }
+ }
+ else
+ {
+ SetManualMode();
+ }
+
+ PartitionPresentFeedback.FireUpdate();
+ }
+
+ void PartitionPresentFeedback_OutputChange(object sender, FeedbackEventArgs e)
+ {
+ if (isInAutoMode)
+ {
+ PartitionPresentFeedback.FireUpdate();
+ }
+ }
+
+ #region IPartitionController Members
+
+ public List AdjacentRoomKeys { get; private set; }
+
+ public void SetAutoMode()
+ {
+ isInAutoMode = true;
+ if (PartitionPresentFeedback != null)
+ {
+ PartitionPresentFeedback.SetValueFunc(() => _partitionSensor.PartitionPresentFeedback.BoolValue);
+ }
+ else
+ {
+ PartitionPresentFeedback = new BoolFeedback(() => _partitionSensor.PartitionPresentFeedback.BoolValue);
+ }
+
+ if (_partitionSensor != null)
+ {
+ _partitionSensor.PartitionPresentFeedback.OutputChange += PartitionPresentFeedback_OutputChange;
+ }
+ }
+
+ public void SetManualMode()
+ {
+ isInAutoMode = false;
+ if (PartitionPresentFeedback != null)
+ {
+ PartitionPresentFeedback.SetValueFunc(() => partitionPresent);
+ }
+ else
+ {
+ PartitionPresentFeedback = new BoolFeedback(() => partitionPresent);
+ }
+
+ if (_partitionSensor != null)
+ {
+ _partitionSensor.PartitionPresentFeedback.OutputChange -= PartitionPresentFeedback_OutputChange;
+ }
+ }
+
+
+ public void SetPartitionStatePresent()
+ {
+ if (!isInAutoMode)
+ {
+ partitionPresent = true;
+ PartitionPresentFeedback.FireUpdate();
+ }
+ }
+
+ public void SetPartitionStateNotPresent()
+ {
+ if (!isInAutoMode)
+ {
+ partitionPresent = false;
+ PartitionPresentFeedback.FireUpdate();
+ }
+ }
+
+ public void ToggglePartitionState()
+ {
+ if (!isInAutoMode)
+ {
+ partitionPresent = !partitionPresent;
+ PartitionPresentFeedback.FireUpdate();
+ }
+ }
+
+ #endregion
+
+ #region IPartitionStateProvider Members
+
+ public BoolFeedback PartitionPresentFeedback { get; private set; }
+
+ #endregion
+
+ #region IKeyName Members
+
+ public string Name { get; private set; }
+
+ #endregion
+
+ #region IKeyed Members
+
+ public string Key { get; private set; }
+
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/PartitionSensor/GlsPartitionSensorController.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/PartitionSensor/GlsPartitionSensorController.cs
index 7ade8ba5..16b2f265 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/PartitionSensor/GlsPartitionSensorController.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/PartitionSensor/GlsPartitionSensorController.cs
@@ -1,25 +1,29 @@
-using Crestron.SimplSharpPro;
+using Crestron.SimplSharp;
+using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.DeviceSupport;
using Crestron.SimplSharpPro.GeneralIO;
using Newtonsoft.Json;
using PepperDash.Core;
using PepperDash.Essentials.Core.Bridges;
-using PepperDash_Essentials_Core.Bridges.JoinMaps;
+using PepperDash.Essentials.Core.Bridges.JoinMaps;
using System;
using System.Collections.Generic;
using PepperDash.Essentials.Core.Config;
+using PepperDash_Essentials_Core.PartitionSensor;
namespace PepperDash.Essentials.Core
{
[Description("Wrapper class for GLS Cresnet Partition Sensor")]
- public class GlsPartitionSensorController : CrestronGenericBridgeableBaseDevice
+ public class GlsPartitionSensorController : CrestronGenericBridgeableBaseDevice, IPartitionStateProvider
{
- private GlsPartCn _partitionSensor;
- public StringFeedback NameFeedback { get; private set; }
+ public GlsPartitionSensorPropertiesConfig PropertiesConfig { get; private set; }
+
+ private GlsPartCn _partitionSensor;
+
public BoolFeedback EnableFeedback { get; private set; }
- public BoolFeedback PartitionSensedFeedback { get; private set; }
+ public BoolFeedback PartitionPresentFeedback { get; private set; }
public BoolFeedback PartitionNotSensedFeedback { get; private set; }
public IntFeedback SensitivityFeedback { get; private set; }
@@ -32,23 +36,71 @@ namespace PepperDash.Essentials.Core
public GlsPartitionSensorController(string key, Func preActivationFunc, DeviceConfig config)
: base(key, config.Name)
{
+
+ var props = config.Properties.ToObject();
+ if (props != null)
+ {
+ PropertiesConfig = props;
+ }
+ else
+ {
+ Debug.Console(1, this, "props are null. Unable to deserialize into GlsPartSensorPropertiesConfig");
+ }
+
AddPreActivationAction(() =>
{
_partitionSensor = preActivationFunc(config);
-
+
RegisterCrestronGenericBase(_partitionSensor);
+
+ EnableFeedback = new BoolFeedback(() => InTestMode ? TestEnableFeedback : _partitionSensor.EnableFeedback.BoolValue);
+ PartitionPresentFeedback = new BoolFeedback(() => InTestMode ? TestPartitionSensedFeedback : _partitionSensor.PartitionSensedFeedback.BoolValue);
+ PartitionNotSensedFeedback = new BoolFeedback(() => InTestMode ? !TestPartitionSensedFeedback : _partitionSensor.PartitionNotSensedFeedback.BoolValue);
+ SensitivityFeedback = new IntFeedback(() => InTestMode ? TestSensitivityFeedback : _partitionSensor.SensitivityFeedback.UShortValue);
- NameFeedback = new StringFeedback(() => Name);
- EnableFeedback = new BoolFeedback(() => _partitionSensor.EnableFeedback.BoolValue);
- PartitionSensedFeedback = new BoolFeedback(() => _partitionSensor.PartitionSensedFeedback.BoolValue);
- PartitionNotSensedFeedback = new BoolFeedback(() => _partitionSensor.PartitionNotSensedFeedback.BoolValue);
- SensitivityFeedback = new IntFeedback(() => _partitionSensor.SensitivityFeedback.UShortValue);
-
- if (_partitionSensor != null) _partitionSensor.BaseEvent += PartitionSensor_BaseEvent;
+ if (_partitionSensor != null)
+ {
+ _partitionSensor.BaseEvent += PartitionSensor_BaseEvent;
+ }
});
- }
- private void PartitionSensor_BaseEvent(GenericBase device, BaseEventArgs args)
+ AddPostActivationAction(() =>
+ {
+ _partitionSensor.OnlineStatusChange += (o, a) =>
+ {
+ if (a.DeviceOnLine)
+ {
+ ApplySettingsToSensorFromConfig();
+ }
+ };
+
+ if (_partitionSensor.IsOnline)
+ {
+ ApplySettingsToSensorFromConfig();
+ }
+ });
+ }
+
+ private void ApplySettingsToSensorFromConfig()
+ {
+ if (_partitionSensor.IsOnline == false) return;
+
+ Debug.Console(1, this, "Attempting to apply settings to sensor from config");
+
+ if (PropertiesConfig.Sensitivity != null)
+ {
+ Debug.Console(1, this, "Sensitivity found, attempting to set value '{0}' from config",
+ PropertiesConfig.Sensitivity);
+ _partitionSensor.Sensitivity.UShortValue = (ushort) PropertiesConfig.Sensitivity;
+ }
+ else
+ {
+ Debug.Console(1, this, "Sensitivity null, no value specified in config");
+ }
+
+ }
+
+ private void PartitionSensor_BaseEvent(GenericBase device, BaseEventArgs args)
{
Debug.Console(2, this, "EventId: {0}, Index: {1}", args.EventId, args.Index);
@@ -61,11 +113,13 @@ namespace PepperDash.Essentials.Core
}
case (GlsPartCn.PartitionSensedFeedbackEventId):
{
- PartitionSensedFeedback.FireUpdate();
+ Debug.Console(1, this, "Partition Sensed State: {0}", _partitionSensor.PartitionSensedFeedback.BoolValue);
+ PartitionPresentFeedback.FireUpdate();
break;
}
case (GlsPartCn.PartitionNotSensedFeedbackEventId):
{
+ Debug.Console(1, this, "Partition Not Sensed State: {0}", _partitionSensor.PartitionNotSensedFeedback.BoolValue);
PartitionNotSensedFeedback.FireUpdate();
break;
}
@@ -73,7 +127,7 @@ namespace PepperDash.Essentials.Core
{
SensitivityFeedback.FireUpdate();
break;
- }
+ }
default:
{
Debug.Console(2, this, "Unhandled args.EventId: {0}", args.EventId);
@@ -93,6 +147,9 @@ namespace PepperDash.Essentials.Core
if (InTestMode)
{
TestEnableFeedback = state;
+
+ EnableFeedback.FireUpdate();
+
Debug.Console(1, this, "TestEnableFeedback: {0}", TestEnableFeedback.ToString());
return;
}
@@ -105,6 +162,10 @@ namespace PepperDash.Essentials.Core
if (InTestMode)
{
TestPartitionSensedFeedback = state;
+
+ PartitionPresentFeedback.FireUpdate();
+ PartitionNotSensedFeedback.FireUpdate();
+
Debug.Console(1, this, "TestPartitionSensedFeedback: {0}", TestPartitionSensedFeedback.ToString());
return;
}
@@ -117,6 +178,8 @@ namespace PepperDash.Essentials.Core
if (InTestMode)
{
TestSensitivityFeedback = value;
+
+ SensitivityFeedback.FireUpdate();
Debug.Console(1, this, "TestSensitivityFeedback: {0}", TestSensitivityFeedback);
return;
}
@@ -124,8 +187,24 @@ namespace PepperDash.Essentials.Core
Debug.Console(1, this, "InTestMode: {0}, unable to set sensitivity value: {1}", InTestMode.ToString(), value);
}
- public void SetEnableState(bool state)
+ public void GetSettings()
+ {
+ var dash = new string('*', 50);
+ CrestronConsole.PrintLine(string.Format("{0}\n", dash));
+
+ Debug.Console(0, this, "Enabled State: {0}", _partitionSensor.EnableFeedback.BoolValue);
+
+ Debug.Console(0, this, "Partition Sensed State: {0}", _partitionSensor.PartitionSensedFeedback.BoolValue);
+ Debug.Console(0, this, "Partition Not Sensed State: {0}", _partitionSensor.PartitionNotSensedFeedback.BoolValue);
+
+ Debug.Console(0, this, "Sensitivity Value: {0}", _partitionSensor.SensitivityFeedback.UShortValue);
+
+ CrestronConsole.PrintLine(string.Format("{0}\n", dash));
+ }
+
+ public void SetEnableState(bool state)
{
+ Debug.Console(2, this, "Sensor is {0}, SetEnableState: {1}", _partitionSensor == null ? "null" : "not null", state);
if (_partitionSensor == null)
return;
@@ -134,6 +213,7 @@ namespace PepperDash.Essentials.Core
public void IncreaseSensitivity()
{
+ Debug.Console(2, this, "Sensor is {0}, IncreaseSensitivity", _partitionSensor == null ? "null" : "not null");
if (_partitionSensor == null)
return;
@@ -142,6 +222,7 @@ namespace PepperDash.Essentials.Core
public void DecreaseSensitivity()
{
+ Debug.Console(2, this, "Sensor is {0}, DecreaseSensitivity", _partitionSensor == null ? "null" : "not null");
if (_partitionSensor == null)
return;
@@ -150,6 +231,7 @@ namespace PepperDash.Essentials.Core
public void SetSensitivity(ushort value)
{
+ Debug.Console(2, this, "Sensor is {0}, SetSensitivity: {1}", _partitionSensor == null ? "null" : "not null", value);
if (_partitionSensor == null)
return;
@@ -176,19 +258,20 @@ namespace PepperDash.Essentials.Core
Debug.Console(1, this, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
Debug.Console(0, this, "Linking to Bridge Type {0}", GetType().Name);
- // link input from simpl
- trilist.SetSigTrueAction(joinMap.Enable.JoinNumber, () => SetEnableState(true));
- trilist.SetSigFalseAction(joinMap.Enable.JoinNumber, () => SetEnableState(false));
+ IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline.JoinNumber]);
+ trilist.StringInput[joinMap.Name.JoinNumber].StringValue = _partitionSensor.Name;
+
+ trilist.SetBoolSigAction(joinMap.Enable.JoinNumber, SetEnableState);
+ EnableFeedback.LinkInputSig(trilist.BooleanInput[joinMap.Enable.JoinNumber]);
+
+ PartitionPresentFeedback.LinkInputSig(trilist.BooleanInput[joinMap.PartitionSensed.JoinNumber]);
+ PartitionNotSensedFeedback.LinkInputSig(trilist.BooleanInput[joinMap.PartitionNotSensed.JoinNumber]);
+
trilist.SetSigTrueAction(joinMap.IncreaseSensitivity.JoinNumber, IncreaseSensitivity);
trilist.SetSigTrueAction(joinMap.DecreaseSensitivity.JoinNumber, DecreaseSensitivity);
- trilist.SetUShortSigAction(joinMap.Sensitivity.JoinNumber, SetSensitivity);
- // link output to simpl
- IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline.JoinNumber]);
- EnableFeedback.LinkInputSig(trilist.BooleanInput[joinMap.Enable.JoinNumber]);
- PartitionSensedFeedback.LinkInputSig(trilist.BooleanInput[joinMap.PartitionSensed.JoinNumber]);
- PartitionNotSensedFeedback.LinkInputSig(trilist.BooleanInput[joinMap.PartitionNotSensed.JoinNumber]);
- SensitivityFeedback.LinkInputSig(trilist.UShortInput[joinMap.Sensitivity.JoinNumber]);
+ SensitivityFeedback.LinkInputSig(trilist.UShortInput[joinMap.Sensitivity.JoinNumber]);
+ trilist.SetUShortSigAction(joinMap.Sensitivity.JoinNumber, SetSensitivity);
FeedbacksFireUpdates();
@@ -206,6 +289,7 @@ namespace PepperDash.Essentials.Core
{
if (a.DeviceOnLine)
{
+ trilist.StringInput[joinMap.Name.JoinNumber].StringValue = _partitionSensor.Name;
FeedbacksFireUpdates();
}
};
@@ -213,10 +297,9 @@ namespace PepperDash.Essentials.Core
private void FeedbacksFireUpdates()
{
- IsOnline.FireUpdate();
- NameFeedback.FireUpdate();
+ IsOnline.FireUpdate();
EnableFeedback.FireUpdate();
- PartitionSensedFeedback.FireUpdate();
+ PartitionPresentFeedback.FireUpdate();
PartitionNotSensedFeedback.FireUpdate();
SensitivityFeedback.FireUpdate();
}
@@ -257,7 +340,7 @@ namespace PepperDash.Essentials.Core
public override EssentialsDevice BuildDevice(DeviceConfig dc)
{
- Debug.Console(1, "Factory Attempting to create new C2N-RTHS Device");
+ Debug.Console(1, "Factory Attempting to create new GlsPartitionSensorController Device");
return new GlsPartitionSensorController(dc.Key, GetGlsPartCnDevice, dc);
}
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/PartitionSensor/GlsPartitionSensorPropertiesConfig.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/PartitionSensor/GlsPartitionSensorPropertiesConfig.cs
new file mode 100644
index 00000000..8a303662
--- /dev/null
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/PartitionSensor/GlsPartitionSensorPropertiesConfig.cs
@@ -0,0 +1,21 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Crestron.SimplSharp;
+using Newtonsoft.Json;
+
+namespace PepperDash_Essentials_Core.PartitionSensor
+{
+ public class GlsPartitionSensorPropertiesConfig
+ {
+ ///
+ /// Sets the sensor sensitivity
+ ///
+ ///
+ /// The sensitivity range shall be between 1(lowest) to 10 (highest).
+ ///
+ [JsonProperty("sensitivity")]
+ public ushort? Sensitivity { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/PartitionSensor/IPartitionStateProvider.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/PartitionSensor/IPartitionStateProvider.cs
new file mode 100644
index 00000000..adb420b7
--- /dev/null
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/PartitionSensor/IPartitionStateProvider.cs
@@ -0,0 +1,36 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Crestron.SimplSharp;
+
+using PepperDash.Core;
+
+namespace PepperDash.Essentials.Core
+{
+ ///
+ /// Describes the functionality of a device that senses and provides partition state
+ ///
+ public interface IPartitionStateProvider : IKeyName
+ {
+ BoolFeedback PartitionPresentFeedback { get; }
+ }
+
+ ///
+ /// Describes the functionality of a device that can provide partition state either manually via user input or optionally via a sensor state
+ ///
+ public interface IPartitionController : IPartitionStateProvider
+ {
+ List AdjacentRoomKeys { get; }
+
+ void SetPartitionStatePresent();
+
+ void SetPartitionStateNotPresent();
+
+ void ToggglePartitionState();
+
+ void SetManualMode();
+
+ void SetAutoMode();
+ }
+}
\ No newline at end of file
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.csproj b/essentials-framework/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.csproj
index b5aa4543..4d919a66 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.csproj
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.csproj
@@ -48,39 +48,39 @@
False
- ..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.DeviceSupport.dll
+ ..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.DeviceSupport.dll
False
- ..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.DM.dll
+ ..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.DM.dll
False
- ..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.EthernetCommunications.dll
+ ..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.EthernetCommunications.dll
False
- ..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.Fusion.dll
+ ..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.Fusion.dll
False
- ..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.Gateways.dll
+ ..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.Gateways.dll
False
- ..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.GeneralIO.dll
+ ..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.GeneralIO.dll
False
- ..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.Remotes.dll
+ ..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.Remotes.dll
False
- ..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.ThreeSeriesCards.dll
+ ..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.ThreeSeriesCards.dll
False
- ..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.UI.dll
+ ..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.UI.dll
@@ -89,30 +89,30 @@
False
- ..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpCustomAttributesInterface.dll
+ ..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpCustomAttributesInterface.dll
False
False
- ..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpHelperInterface.dll
+ ..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpHelperInterface.dll
False
False
- ..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpNewtonsoft.dll
+ ..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpNewtonsoft.dll
False
- ..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpPro.exe
+ ..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpPro.exe
False
False
- ..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpReflectionInterface.dll
+ ..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpReflectionInterface.dll
False
- ..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpTimerEventInterface.dll
+ ..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpTimerEventInterface.dll
@@ -131,6 +131,7 @@
+
@@ -143,6 +144,7 @@
+
@@ -161,6 +163,7 @@
+
@@ -180,6 +183,7 @@
+
@@ -188,6 +192,7 @@
+
@@ -195,10 +200,13 @@
+
+
+
@@ -206,6 +214,7 @@
+
@@ -219,10 +228,19 @@
+
+
+
+
+
+
+
+
+
@@ -277,7 +295,13 @@
+
+
+
+
+
+
@@ -311,6 +335,10 @@
+
+
+
+
@@ -321,6 +349,7 @@
+
@@ -331,6 +360,7 @@
+
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.nuspec b/essentials-framework/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.nuspec
index 5db86afc..c2394428 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.nuspec
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.nuspec
@@ -14,7 +14,7 @@
crestron 3series 4series
-
+
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Plugins/PluginLoader.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Plugins/PluginLoader.cs
index f7275a66..136303e3 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Plugins/PluginLoader.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Plugins/PluginLoader.cs
@@ -123,7 +123,7 @@ namespace PepperDash.Essentials
///
static LoadedAssembly LoadAssembly(string filePath)
{
- Debug.Console(2, "Attempting to load {0}", filePath);
+ //Debug.Console(2, "Attempting to load {0}", filePath);
var assembly = Assembly.LoadFrom(filePath);
if (assembly != null)
{
@@ -358,14 +358,27 @@ namespace PepperDash.Essentials
try
{
var assy = loadedAssembly.Assembly;
- var types = assy.GetTypes();
+ CType[] types = {};
+ try
+ {
+ types = assy.GetTypes();
+ }
+ catch (TypeLoadException e)
+ {
+ Debug.Console(0, Debug.ErrorLogLevel.Warning, "Unable to get types for assembly {0}: {1}",
+ loadedAssembly.Name, e.Message);
+ Debug.Console(2, e.StackTrace);
+ continue;
+ }
+
foreach (var type in types)
{
try
{
- if (typeof(IPluginDeviceFactory).IsAssignableFrom(type))
+ if (typeof (IPluginDeviceFactory).IsAssignableFrom(type) && !type.IsAbstract)
{
- var plugin = (IPluginDeviceFactory)Crestron.SimplSharp.Reflection.Activator.CreateInstance(type);
+ var plugin =
+ (IPluginDeviceFactory) Crestron.SimplSharp.Reflection.Activator.CreateInstance(type);
LoadCustomPlugin(plugin, loadedAssembly);
}
else
@@ -378,10 +391,15 @@ namespace PepperDash.Essentials
}
}
}
+ catch (NotSupportedException e)
+ {
+ //this happens for dlls that aren't PD dlls, like ports of Mono classes into S#. Swallowing.
+
+ }
catch (Exception e)
{
Debug.Console(2, "Load Plugin not found. {0}.{2} is not a plugin factory. Exception: {1}",
- loadedAssembly.Name, e, type.Name);
+ loadedAssembly.Name, e.Message, type.Name);
continue;
}
@@ -389,7 +407,9 @@ namespace PepperDash.Essentials
}
catch (Exception e)
{
- Debug.Console(2, "Error Loading Assembly: {0} Exception: {1} ", loadedAssembly.Name, e);
+ Debug.Console(0, Debug.ErrorLogLevel.Warning, "Error Loading assembly {0}: {1}",
+ loadedAssembly.Name, e.Message);
+ Debug.Console(2, "{0}", e.StackTrace);
continue;
}
}
@@ -402,13 +422,16 @@ namespace PepperDash.Essentials
/// Loads a
///
///
+ ///
static void LoadCustomPlugin(IPluginDeviceFactory plugin, LoadedAssembly loadedAssembly)
{
var passed = Global.IsRunningMinimumVersionOrHigher(plugin.MinimumEssentialsFrameworkVersion);
if (!passed)
{
- Debug.Console(0, Debug.ErrorLogLevel.Error, "Plugin indicates minimum Essentials version {0}. Dependency check failed. Skipping Plugin", plugin.MinimumEssentialsFrameworkVersion);
+ Debug.Console(0, Debug.ErrorLogLevel.Error,
+ "\r\n********************\r\n\tPlugin indicates minimum Essentials version {0}. Dependency check failed. Skipping Plugin {1}\r\n********************",
+ plugin.MinimumEssentialsFrameworkVersion, loadedAssembly.Name);
return;
}
else
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Presets/DevicePresets.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Presets/DevicePresets.cs
index 4f79626f..d6a9fad0 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Presets/DevicePresets.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Presets/DevicePresets.cs
@@ -1,178 +1,300 @@
using System;
using System.Collections.Generic;
-using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharp.CrestronIO;
-
using Newtonsoft.Json;
-using Newtonsoft.Json.Linq;
-
using PepperDash.Core;
//using SSMono.IO;
+using PepperDash.Core.WebApi.Presets;
namespace PepperDash.Essentials.Core.Presets
{
- ///
- /// Class that represents the model behind presets display
- ///
- public class DevicePresetsModel : Device
- {
- public event EventHandler PresetsLoaded;
+ ///
+ /// Class that represents the model behind presets display
+ ///
+ public class DevicePresetsModel : Device
+ {
+ public delegate void PresetRecalledCallback(ISetTopBoxNumericKeypad device, string channel);
- public int PulseTime { get; set; }
- public int DigitSpacingMS { get; set; }
- public bool PresetsAreLoaded { get; private set; }
+ public delegate void PresetsSavedCallback(List presets);
- public List PresetsList { get { return _PresetsList.ToList(); } }
- List _PresetsList;
- public int Count { get { return PresetsList != null ? PresetsList.Count : 0; } }
+ private readonly CCriticalSection _fileOps = new CCriticalSection();
+ private readonly bool _initSuccess;
- public bool UseLocalImageStorage { get; set; }
- public string ImagesLocalHostPrefix { get; set; }
- public string ImagesPathPrefix { get; set; }
- public string ListPathPrefix { get; set; }
+ private readonly ISetTopBoxNumericKeypad _setTopBox;
- ///
- /// The methods on the STB device to call when dialing
- ///
- Dictionary> DialFunctions;
- Action EnterFunction;
+ ///
+ /// The methods on the STB device to call when dialing
+ ///
+ private Dictionary> _dialFunctions;
- bool DialIsRunning;
- string FilePath;
- bool InitSuccess;
- //SSMono.IO.FileSystemWatcher ListWatcher;
+ private bool _dialIsRunning;
+ private Action _enterFunction;
+ private string _filePath;
- public DevicePresetsModel(string key, ISetTopBoxNumericKeypad setTopBox, string fileName)
- : base(key)
- {
- PulseTime = 150;
- DigitSpacingMS = 150;
+ public DevicePresetsModel(string key, ISetTopBoxNumericKeypad setTopBox, string fileName)
+ : this(key, fileName)
+ {
+ try
+ {
+ _setTopBox = setTopBox;
- try
- {
- // Grab the digit functions from the device
- // If any fail, the whole thing fails peacefully
- DialFunctions = new Dictionary>(10)
- {
- { '1', setTopBox.Digit1 },
- { '2', setTopBox.Digit2 },
- { '3', setTopBox.Digit3 },
- { '4', setTopBox.Digit4 },
- { '5', setTopBox.Digit5 },
- { '6', setTopBox.Digit6 },
- { '7', setTopBox.Digit7 },
- { '8', setTopBox.Digit8 },
- { '9', setTopBox.Digit9 },
- { '0', setTopBox.Digit0 },
- { '-', setTopBox.Dash }
- };
- }
- catch
- {
- Debug.Console(0, "DevicePresets '{0}', not attached to INumericKeypad device. Ignoring", key);
- DialFunctions = null;
- return;
- }
+ // Grab the digit functions from the device
+ // If any fail, the whole thing fails peacefully
+ _dialFunctions = new Dictionary>(10)
+ {
+ {'1', setTopBox.Digit1},
+ {'2', setTopBox.Digit2},
+ {'3', setTopBox.Digit3},
+ {'4', setTopBox.Digit4},
+ {'5', setTopBox.Digit5},
+ {'6', setTopBox.Digit6},
+ {'7', setTopBox.Digit7},
+ {'8', setTopBox.Digit8},
+ {'9', setTopBox.Digit9},
+ {'0', setTopBox.Digit0},
+ {'-', setTopBox.Dash}
+ };
+ }
+ catch
+ {
+ Debug.Console(0, "DevicePresets '{0}', not attached to INumericKeypad device. Ignoring", key);
+ _dialFunctions = null;
+ return;
+ }
- EnterFunction = setTopBox.KeypadEnter;
+ _enterFunction = setTopBox.KeypadEnter;
+ }
- UseLocalImageStorage = true;
+ public DevicePresetsModel(string key, string fileName) : base(key)
+ {
+ PulseTime = 150;
+ DigitSpacingMs = 150;
- ImagesLocalHostPrefix = "http://" + CrestronEthernetHelper.GetEthernetParameter(
- CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_CURRENT_IP_ADDRESS,0);
- ImagesPathPrefix = @"/presets/images.zip/";
- ListPathPrefix = @"/html/presets/lists/";
+ UseLocalImageStorage = true;
- SetFileName(fileName);
+ ImagesLocalHostPrefix = "http://" + CrestronEthernetHelper.GetEthernetParameter(
+ CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_CURRENT_IP_ADDRESS, 0);
+ ImagesPathPrefix = @"/presets/images.zip/";
+ ListPathPrefix = @"/html/presets/lists/";
- //ListWatcher = new FileSystemWatcher(@"\HTML\presets\lists");
- //ListWatcher.NotifyFilter = NotifyFilters.LastWrite;
- //ListWatcher.EnableRaisingEvents = true;
- //ListWatcher.Changed += ListWatcher_Changed;
- InitSuccess = true;
- }
+ SetFileName(fileName);
+
+ _initSuccess = true;
+ }
+
+ public event PresetRecalledCallback PresetRecalled;
+ public event PresetsSavedCallback PresetsSaved;
+
+ public int PulseTime { get; set; }
+ public int DigitSpacingMs { get; set; }
+ public bool PresetsAreLoaded { get; private set; }
+
+ public List PresetsList { get; private set; }
+
+ public int Count
+ {
+ get { return PresetsList != null ? PresetsList.Count : 0; }
+ }
+
+ public bool UseLocalImageStorage { get; set; }
+ public string ImagesLocalHostPrefix { get; set; }
+ public string ImagesPathPrefix { get; set; }
+ public string ListPathPrefix { get; set; }
+ public event EventHandler PresetsLoaded;
- public void SetFileName(string path)
- {
- FilePath = ListPathPrefix + path;
- LoadChannels();
- }
+ public void SetFileName(string path)
+ {
+ _filePath = ListPathPrefix + path;
- public void LoadChannels()
- {
- PresetsAreLoaded = false;
- try
- {
- var pl = JsonConvert.DeserializeObject(Crestron.SimplSharp.CrestronIO.File.ReadToEnd(FilePath, Encoding.ASCII));
- Name = pl.Name;
- _PresetsList = pl.Channels;
- }
- catch (Exception e)
- {
- Debug.Console(2, this, "LoadChannels: Error reading presets file. These presets will be empty:\r '{0}'\r Error:{1}", FilePath, e.Message);
- // Just save a default empty list
- _PresetsList = new List();
- }
- PresetsAreLoaded = true;
+ Debug.Console(2, this, "Setting presets file path to {0}", _filePath);
+ LoadChannels();
+ }
- var handler = PresetsLoaded;
- if (handler != null)
- handler(this, EventArgs.Empty);
- }
+ public void LoadChannels()
+ {
+ try
+ {
+ _fileOps.Enter();
- public void Dial(int presetNum)
- {
- if (presetNum <= _PresetsList.Count)
- Dial(_PresetsList[presetNum - 1].Channel);
- }
+ Debug.Console(2, this, "Loading presets from {0}", _filePath);
+ PresetsAreLoaded = false;
+ try
+ {
+ var pl = JsonConvert.DeserializeObject(File.ReadToEnd(_filePath, Encoding.ASCII));
+ Name = pl.Name;
+ PresetsList = pl.Channels;
+ }
+ catch (Exception e)
+ {
+ Debug.Console(2, this,
+ "LoadChannels: Error reading presets file. These presets will be empty:\r '{0}'\r Error:{1}",
+ _filePath, e.Message);
+ // Just save a default empty list
+ PresetsList = new List();
+ }
+ PresetsAreLoaded = true;
- public void Dial(string chanNum)
- {
- if (DialIsRunning || !InitSuccess) return;
- if (DialFunctions == null)
- {
- Debug.Console(1, "DevicePresets '{0}', not attached to keypad device. Ignoring channel", Key);
- return;
- }
+ var handler = PresetsLoaded;
+ if (handler != null)
+ {
+ handler(this, EventArgs.Empty);
+ }
+ }
+ finally
+ {
+ _fileOps.Leave();
+ }
+ }
- DialIsRunning = true;
- CrestronInvoke.BeginInvoke(o =>
- {
- foreach (var c in chanNum.ToCharArray())
- {
- if (DialFunctions.ContainsKey(c))
- Pulse(DialFunctions[c]);
- CrestronEnvironment.Sleep(DigitSpacingMS);
- }
+ public void Dial(int presetNum)
+ {
+ if (presetNum <= PresetsList.Count)
+ {
+ Dial(PresetsList[presetNum - 1].Channel);
+ }
+ }
- if (EnterFunction != null)
- Pulse(EnterFunction);
- DialIsRunning = false;
- });
- }
+ public void Dial(string chanNum)
+ {
+ if (_dialIsRunning || !_initSuccess)
+ {
+ return;
+ }
+ if (_dialFunctions == null)
+ {
+ Debug.Console(1, "DevicePresets '{0}', not attached to keypad device. Ignoring channel", Key);
+ return;
+ }
- void Pulse(Action act)
- {
- act(true);
- CrestronEnvironment.Sleep(PulseTime);
- act(false);
- }
+ _dialIsRunning = true;
+ CrestronInvoke.BeginInvoke(o =>
+ {
+ foreach (var c in chanNum.ToCharArray())
+ {
+ if (_dialFunctions.ContainsKey(c))
+ {
+ Pulse(_dialFunctions[c]);
+ }
+ CrestronEnvironment.Sleep(DigitSpacingMs);
+ }
- ///
- /// Event handler for filesystem watcher. When directory changes, this is called
- ///
- //void ListWatcher_Changed(object sender, FileSystemEventArgs e)
- //{
- // Debug.Console(1, this, "folder modified: {0}", e.FullPath);
- // if (e.FullPath.Equals(FilePath, StringComparison.OrdinalIgnoreCase))
- // {
- // Debug.Console(1, this, "File changed: {0}", e.ChangeType);
- // LoadChannels();
- // }
- //}
- }
+ if (_enterFunction != null)
+ {
+ Pulse(_enterFunction);
+ }
+ _dialIsRunning = false;
+ });
+
+ if (_setTopBox == null) return;
+
+ OnPresetRecalled(_setTopBox, chanNum);
+ }
+
+ public void Dial(int presetNum, ISetTopBoxNumericKeypad setTopBox)
+ {
+ if (presetNum <= PresetsList.Count)
+ {
+ Dial(PresetsList[presetNum - 1].Channel, setTopBox);
+ }
+ }
+
+ public void Dial(string chanNum, ISetTopBoxNumericKeypad setTopBox)
+ {
+ _dialFunctions = new Dictionary>(10)
+ {
+ {'1', setTopBox.Digit1},
+ {'2', setTopBox.Digit2},
+ {'3', setTopBox.Digit3},
+ {'4', setTopBox.Digit4},
+ {'5', setTopBox.Digit5},
+ {'6', setTopBox.Digit6},
+ {'7', setTopBox.Digit7},
+ {'8', setTopBox.Digit8},
+ {'9', setTopBox.Digit9},
+ {'0', setTopBox.Digit0},
+ {'-', setTopBox.Dash}
+ };
+
+ _enterFunction = setTopBox.KeypadEnter;
+
+ OnPresetRecalled(setTopBox, chanNum);
+
+ Dial(chanNum);
+ }
+
+ private void OnPresetRecalled(ISetTopBoxNumericKeypad setTopBox, string channel)
+ {
+ var handler = PresetRecalled;
+
+ if (handler == null)
+ {
+ return;
+ }
+
+ handler(setTopBox, channel);
+ }
+
+ public void UpdatePreset(int index, PresetChannel preset)
+ {
+ if (index >= PresetsList.Count)
+ {
+ return;
+ }
+
+ PresetsList[index] = preset;
+
+ SavePresets();
+
+ OnPresetsSaved();
+ }
+
+ public void UpdatePresets(List presets)
+ {
+ PresetsList = presets;
+
+ SavePresets();
+
+ OnPresetsSaved();
+ }
+
+ private void SavePresets()
+ {
+ try
+ {
+ _fileOps.Enter();
+ var pl = new PresetsList {Channels = PresetsList, Name = Name};
+ var json = JsonConvert.SerializeObject(pl, Formatting.Indented);
+
+ using (var file = File.Open(_filePath, FileMode.Truncate))
+ {
+ file.Write(json, Encoding.UTF8);
+ }
+ }
+ finally
+ {
+ _fileOps.Leave();
+ }
+
+ }
+
+ private void OnPresetsSaved()
+ {
+ var handler = PresetsSaved;
+
+ if (handler == null) return;
+
+ handler(PresetsList);
+ }
+
+ private void Pulse(Action act)
+ {
+ act(true);
+ CrestronEnvironment.Sleep(PulseTime);
+ act(false);
+ }
+ }
}
\ No newline at end of file
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Presets/PresetChannel.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Presets/PresetChannel.cs
index b9650e60..259ccbb9 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Presets/PresetChannel.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Presets/PresetChannel.cs
@@ -10,19 +10,22 @@ namespace PepperDash.Essentials.Core.Presets
public class PresetChannel
{
- [JsonProperty(Required = Required.Always)]
+ [JsonProperty(Required = Required.Always,PropertyName = "name")]
public string Name { get; set; }
- [JsonProperty(Required = Required.Always)]
+
+ [JsonProperty(Required = Required.Always, PropertyName = "iconUrl")]
public string IconUrl { get; set; }
- [JsonProperty(Required = Required.Always)]
+
+ [JsonProperty(Required = Required.Always, PropertyName = "channel")]
public string Channel { get; set; }
}
public class PresetsList
{
- [JsonProperty(Required=Required.Always)]
+ [JsonProperty(Required=Required.Always,PropertyName = "name")]
public string Name { get; set; }
- [JsonProperty(Required = Required.Always)]
+
+ [JsonProperty(Required = Required.Always, PropertyName = "channels")]
public List Channels { get; set; }
}
}
\ No newline at end of file
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Queues/ComsMessage.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Queues/ComsMessage.cs
index 92c97248..3c01032e 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Queues/ComsMessage.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Queues/ComsMessage.cs
@@ -1,7 +1,7 @@
using System;
using PepperDash.Core;
-namespace PepperDash_Essentials_Core.Queues
+namespace PepperDash.Essentials.Core.Queues
{
///
/// IBasicCommunication Message for IQueue
@@ -40,7 +40,79 @@ namespace PepperDash_Essentials_Core.Queues
private void Validate(IBasicCommunication coms, object message)
{
- if (_coms == null)
+ if (coms == null)
+ throw new ArgumentNullException("coms");
+
+ if (message == null)
+ throw new ArgumentNullException("message");
+ }
+
+ ///
+ /// Dispatchs the string/byte[] to the IBasicCommunication specified
+ ///
+ public void Dispatch()
+ {
+ if (_isByteMessage)
+ {
+ _coms.SendBytes(_bytes);
+ }
+ else
+ {
+ _coms.SendText(_string);
+ }
+ }
+
+ ///
+ /// Shows either the byte[] or string to be sent
+ ///
+ public override string ToString()
+ {
+ return _bytes != null ? _bytes.ToString() : _string;
+ }
+ }
+}
+
+namespace PepperDash_Essentials_Core.Queues
+{
+ ///
+ /// IBasicCommunication Message for IQueue
+ ///
+ [Obsolete("Use PepperDash.Essentials.Core.Queues")]
+ public class ComsMessage : IQueueMessage
+ {
+ private readonly byte[] _bytes;
+ private readonly IBasicCommunication _coms;
+ private readonly string _string;
+ private readonly bool _isByteMessage;
+
+ ///
+ /// Constructor for a string message
+ ///
+ /// IBasicCommunication to send the message
+ /// Message to send
+ public ComsMessage(IBasicCommunication coms, string message)
+ {
+ Validate(coms, message);
+ _coms = coms;
+ _string = message;
+ }
+
+ ///
+ /// Constructor for a byte message
+ ///
+ /// IBasicCommunication to send the message
+ /// Message to send
+ public ComsMessage(IBasicCommunication coms, byte[] message)
+ {
+ Validate(coms, message);
+ _coms = coms;
+ _bytes = message;
+ _isByteMessage = true;
+ }
+
+ private void Validate(IBasicCommunication coms, object message)
+ {
+ if (coms == null)
throw new ArgumentNullException("coms");
if (message == null)
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Queues/GenericQueue.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Queues/GenericQueue.cs
index 1f27fe1e..a1cef30d 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Queues/GenericQueue.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Queues/GenericQueue.cs
@@ -3,7 +3,7 @@ using Crestron.SimplSharp;
using Crestron.SimplSharpPro.CrestronThread;
using PepperDash.Core;
-namespace PepperDash_Essentials_Core.Queues
+namespace PepperDash.Essentials.Core.Queues
{
///
/// Threadsafe processing of queued items with pacing if required
@@ -14,9 +14,11 @@ namespace PepperDash_Essentials_Core.Queues
protected readonly CrestronQueue _queue;
protected readonly Thread _worker;
protected readonly CEvent _waitHandle = new CEvent();
-
- private readonly bool _delayEnabled;
- private readonly int _delayTime;
+
+ private bool _delayEnabled;
+ private int _delayTime;
+
+ private const Thread.eThreadPriority _defaultPriority = Thread.eThreadPriority.MediumPriority;
///
/// If the instance has been disposed.
@@ -24,22 +26,44 @@ namespace PepperDash_Essentials_Core.Queues
public bool Disposed { get; private set; }
///
- /// Constructor for generic queue with no pacing
+ /// Returns the capacity of the CrestronQueue (fixed Size property)
///
- /// Key
- public GenericQueue(string key)
+ public int QueueCapacity
{
- _key = key;
- _queue = new CrestronQueue();
- _worker = new Thread(ProcessQueue, null, Thread.eThreadStartOptions.Running);
-
- CrestronEnvironment.ProgramStatusEventHandler += programEvent =>
+ get
{
- if (programEvent != eProgramStatusEventType.Stopping)
- return;
+ return _queue.Size;
+ }
+ }
- Dispose();
- };
+ ///
+ /// Returns the number of elements currently in the CrestronQueue
+ ///
+ public int QueueCount
+ {
+ get
+ {
+ return _queue.Count;
+ }
+ }
+
+ ///
+ /// Constructor with no thread priority
+ ///
+ ///
+ public GenericQueue(string key)
+ : this(key, _defaultPriority, 0, 0)
+ {
+ }
+
+ ///
+ /// Constructor with queue size
+ ///
+ ///
+ /// Fixed size for the queue to hold
+ public GenericQueue(string key, int capacity)
+ : this(key, _defaultPriority, capacity, 0)
+ {
}
///
@@ -47,11 +71,349 @@ namespace PepperDash_Essentials_Core.Queues
///
/// Key
/// Pacing in ms between actions
- public GenericQueue(string key, int pacing)
- : this(key)
+ public GenericQueue(int pacing, string key)
+ : this(key, _defaultPriority, 0, pacing)
+ {
+ }
+
+ ///
+ /// Constructor with pacing and capacity
+ ///
+ ///
+ ///
+ ///
+ public GenericQueue(string key, int pacing, int capacity)
+ : this(key, _defaultPriority, capacity, pacing)
+ {
+ }
+
+ ///
+ /// Constructor with pacing and priority
+ ///
+ ///
+ ///
+ ///
+ public GenericQueue(string key, int pacing, Thread.eThreadPriority priority)
+ : this(key, priority, 0, pacing)
+ {
+ }
+
+ ///
+ /// Constructor with pacing, priority and capacity
+ ///
+ ///
+ ///
+ ///
+ public GenericQueue(string key, Thread.eThreadPriority priority, int capacity)
+ : this(key, priority, capacity, 0)
+ {
+ }
+
+ ///
+ /// Constructor with pacing, priority and capacity
+ ///
+ ///
+ ///
+ ///
+ ///
+ public GenericQueue(string key, int pacing, Thread.eThreadPriority priority, int capacity)
+ : this(key, priority, capacity, pacing)
+ {
+ }
+
+ ///
+ /// Constructor for generic queue with no pacing
+ ///
+ /// Key
+ ///
+ ///
+ ///
+ protected GenericQueue(string key, Thread.eThreadPriority priority, int capacity, int pacing)
+ {
+ _key = key;
+ int cap = 25; // sets default
+ if (capacity > 0)
+ {
+ cap = capacity; // overrides default
+ }
+ _queue = new CrestronQueue(cap);
+ _worker = new Thread(ProcessQueue, null, Thread.eThreadStartOptions.Running)
+ {
+ Priority = priority
+ };
+
+ SetDelayValues(pacing);
+ }
+
+ private void SetDelayValues(int pacing)
{
_delayEnabled = pacing > 0;
_delayTime = pacing;
+
+ CrestronEnvironment.ProgramStatusEventHandler += programEvent =>
+ {
+ if (programEvent != eProgramStatusEventType.Stopping)
+ return;
+
+ Dispose(true);
+ };
+ }
+
+ ///