diff --git a/.github/scripts/ZipBuildOutput.ps1 b/.github/scripts/ZipBuildOutput.ps1
index ac87aeb7..5ca867ef 100644
--- a/.github/scripts/ZipBuildOutput.ps1
+++ b/.github/scripts/ZipBuildOutput.ps1
@@ -10,7 +10,7 @@ Get-ChildItem ($destination)
$exclusions = @(git submodule foreach --quiet 'echo $name')
# Trying to get any .json schema files (not currently working)
# Gets any files with the listed extensions.
-Get-ChildItem -recurse -Path "$($Env:GITHUB_WORKSPACE)" -include "*.clz", "*.cpz", "*.cplz" | ForEach-Object {
+Get-ChildItem -recurse -Path "$($Env:GITHUB_WORKSPACE)" -include "*.clz", "*.cpz", "*.cplz", "*.dll" | ForEach-Object {
$allowed = $true;
# Exclude any files in submodules
foreach ($exclude in $exclusions) {
@@ -28,7 +28,8 @@ Write-Host "Getting matching files..."
# Get any files from the output folder that match the following extensions
Get-ChildItem -Path $destination | Where-Object { ($_.Extension -eq ".clz") -or ($_.Extension -eq ".cpz" -or ($_.Extension -eq ".cplz")) } | ForEach-Object {
# Replace the extensions with dll and xml and create an array
- $filenames = @($($_ -replace "cpz|clz|cplz", "dll"), $($_ -replace "cpz|clz|cplz", "xml"))
+ # Removed dll file capture, as previous step should capture all of them. Add if needed-> $($_ -replace "cpz|clz|cplz", "dll"),
+ $filenames = @($($_ -replace "cpz|clz|cplz", "xml"))
Write-Host "Filenames:"
Write-Host $filenames
if ($filenames.length -gt 0) {
diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml
index e95ac127..ac1c58be 100644
--- a/.github/workflows/docker.yml
+++ b/.github/workflows/docker.yml
@@ -77,9 +77,15 @@ jobs:
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 }}
@@ -89,6 +95,7 @@ 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:
@@ -103,6 +110,8 @@ jobs:
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
@@ -178,9 +187,11 @@ jobs:
Public_Push_Output:
needs: Build_Project
runs-on: windows-latest
- if: contains(github.ref, 'master') || contains(github.ref, 'release')
+ if: contains(github.ref, 'master') || 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:
diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml
index b0f3fa6e..87da915e 100644
--- a/.github/workflows/master.yml
+++ b/.github/workflows/master.yml
@@ -32,9 +32,6 @@ jobs:
auth_header="$(git config --local --get http.https://github.com/.extraheader)"
git submodule sync --recursive
git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
- # Fetch all tags
- - name: Fetch tags
- run: git fetch --tags
# Generate the appropriate version number
- name: Set Version Number
shell: powershell
@@ -56,11 +53,21 @@ jobs:
- name: Zip Build Output
shell: powershell
run: ./.github/scripts/ZipBuildOutput.ps1
+ # Write the version to a file to be consumed by the push jobs
+ - name: Write Version
+ run: Write-Output "$($Env:VERSION)" | Out-File -FilePath "$($Env:GITHUB_HOME)\output\version.txt"
+ # Upload the build output as an artifact
- name: Upload Build Output
uses: actions/upload-artifact@v1
with:
name: Build
path: ./${{ env.SOLUTION_FILE}}-${{ env.VERSION}}.zip
+ # Upload the Version file as an artifact
+ - name: Upload version.txt
+ uses: actions/upload-artifact@v1
+ with:
+ name: Version
+ path: ${{env.GITHUB_HOME}}\output\version.txt
# Upload the build package to the release
- name: Upload Release Package
id: upload_release
@@ -72,7 +79,6 @@ jobs:
asset_content_type: application/zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- # This step always runs and pushes the build to the internal build rep
Internal_Push_Output:
needs: Build_Project
runs-on: windows-latest
@@ -102,85 +108,8 @@ jobs:
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 master or release/ runs and pushes the build to the public build repo
- Public_Push_Output:
- needs: Build_Project
- runs-on: windows-latest
- if: contains(github.ref, 'master') || contains(github.ref, 'release')
- steps:
- # Checkout the repo
- - name: Checkout Builds Repo
- uses: actions/checkout@v2
- with:
- token: ${{ secrets.BUILDS_TOKEN }}
- repository: PepperDash/Essentials-Builds
- ref: ${{ Env.GITHUB_REF }}
- # Download the version artifact from the build job
- - name: Download Build Version Info
- uses: actions/download-artifact@v1
- with:
- name: Version
- - name: Check Directory
- run: Get-ChildItem "./"
- # Set the version number environment variable from the file we just downloaded
- - name: Set Version Number
- shell: powershell
- run: |
- Get-ChildItem "./Version"
- $version = Get-Content -Path ./Version/version.txt
- Write-Host "Version: $version"
- Write-Output "::set-env name=VERSION::$version"
- Remove-Item -Path ./Version/version.txt
- Remove-Item -Path ./Version
- # Checkout/Create the branch
- - name: Create new branch
- run: git checkout -b $($Env:GITHUB_REF -replace "refs/heads/")
+ - name: Checkout Master branch
+ run: git checkout master
# Download the build output into the repo
- name: Download Build output
uses: actions/download-artifact@v1
@@ -216,10 +145,80 @@ jobs:
# 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
+ run: git push -u origin master --force
+ # Push the tags
+ - name: Push tags
+ run: git push --tags origin
+ - name: Check Directory
+ run: Get-ChildItem ./
+ # This step only runs if the branch is master or release/ runs and pushes the build to the public build repo
+ Public_Push_Output:
+ needs: Build_Project
+ runs-on: windows-latest
+ steps:
+ # Checkout the repo
+ - name: Checkout Builds Repo
+ uses: actions/checkout@v2
+ with:
+ token: ${{ secrets.BUILDS_TOKEN }}
+ repository: PepperDash/Essentials-Builds
+ ref: ${{ Env.GITHUB_REF }}
+ # Download the version artifact from the build job
+ - name: Download Build Version Info
+ uses: actions/download-artifact@v1
+ with:
+ name: Version
+ - name: Check Directory
+ run: Get-ChildItem "./"
+ # Set the version number environment variable from the file we just downloaded
+ - name: Set Version Number
+ shell: powershell
+ run: |
+ Get-ChildItem "./Version"
+ $version = Get-Content -Path ./Version/version.txt
+ Write-Host "Version: $version"
+ Write-Output "::set-env name=VERSION::$version"
+ Remove-Item -Path ./Version/version.txt
+ Remove-Item -Path ./Version
+ # Checkout master branch
+ - name: Create new branch
+ run: git checkout master
+ # 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 master --force
# Push the tags
- name: Push tags
run: git push --tags origin
diff --git a/.gitmodules b/.gitmodules
index 2ce66ffc..0abbfb4e 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,3 +1,6 @@
[submodule "essentials-framework/pepperdashcore-builds"]
path = essentials-framework/pepperdashcore-builds
url = https://github.com/ndorin/PepperDashCore-Builds.git
+[submodule "Essentials-Template-UI"]
+ path = Essentials-Template-UI
+ url = https://github.com/PepperDash/Essentials-Template-UI.git
diff --git a/Essentials-Template-UI b/Essentials-Template-UI
new file mode 160000
index 00000000..8eaf8879
--- /dev/null
+++ b/Essentials-Template-UI
@@ -0,0 +1 @@
+Subproject commit 8eaf88791b42318fbe7c64402af46d747516e4fa
diff --git a/PepperDashEssentials/Bridges/AirMediaControllerBridge.cs b/PepperDashEssentials/Bridges/AirMediaControllerBridge.cs
index 6d819c7b..869c5614 100644
--- a/PepperDashEssentials/Bridges/AirMediaControllerBridge.cs
+++ b/PepperDashEssentials/Bridges/AirMediaControllerBridge.cs
@@ -11,7 +11,7 @@ using PepperDash.Essentials.DM.AirMedia;
using Newtonsoft.Json;
-namespace PepperDash.Essentials.Bridges
+namespace PepperDash.Essentials.Core.Bridges
{
public static class AirMediaControllerApiExtensions
{
diff --git a/PepperDashEssentials/Bridges/AppleTvBridge.cs b/PepperDashEssentials/Bridges/AppleTvBridge.cs
index 99501baa..3c2bb0af 100644
--- a/PepperDashEssentials/Bridges/AppleTvBridge.cs
+++ b/PepperDashEssentials/Bridges/AppleTvBridge.cs
@@ -11,7 +11,7 @@ using PepperDash.Essentials.Devices.Common;
using Newtonsoft.Json;
-namespace PepperDash.Essentials.Bridges
+namespace PepperDash.Essentials.Core.Bridges
{
public static class AppleTvApiExtensions
{
diff --git a/PepperDashEssentials/Bridges/BridgeBase.cs b/PepperDashEssentials/Bridges/BridgeBase.cs
deleted file mode 100644
index b3f131c3..00000000
--- a/PepperDashEssentials/Bridges/BridgeBase.cs
+++ /dev/null
@@ -1,407 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Crestron.SimplSharp;
-using Crestron.SimplSharpPro.EthernetCommunication;
-
-using Newtonsoft.Json;
-
-using PepperDash.Core;
-using PepperDash.Essentials.Core;
-using PepperDash.Essentials.Core.Lighting;
-using PepperDash.Essentials.Core.Devices;
-using PepperDash.Essentials.Devices.Common;
-using PepperDash.Essentials.Devices.Common.Cameras;
-using PepperDash.Essentials.Core.Config;
-using PepperDash.Essentials.Core.CrestronIO;
-using PepperDash.Essentials.DM;
-//using PepperDash.Essentials.Devices.Common.Cameras;
-
-namespace PepperDash.Essentials.Bridges
-{
- ///
- /// Helper methods for bridges
- ///
- public static class BridgeHelper
- {
- public static void PrintJoinMap(string command)
- {
- string bridgeKey = "";
- string deviceKey = "";
-
- var targets = command.Split(' ');
-
- bridgeKey = targets[0].Trim();
-
- var bridge = DeviceManager.GetDeviceForKey(bridgeKey) as EiscApi;
-
- if (bridge == null)
- {
- Debug.Console(0, "Unable to find bridge with key: '{0}'", bridgeKey);
- return;
- }
-
- if (targets.Length > 1)
- {
- deviceKey = targets[1].Trim();
-
- if (!string.IsNullOrEmpty(deviceKey))
- {
- bridge.PrintJoinMapForDevice(deviceKey);
- return;
- }
- }
- else
- {
- bridge.PrintJoinMaps();
- }
- }
- }
-
-
- ///
- /// Base class for all bridge class variants
- ///
- public class BridgeBase : Device
- {
- public BridgeApi Api { get; private set; }
-
- public BridgeBase(string key) :
- base(key)
- {
-
- }
-
- }
-
- ///
- /// Base class for bridge API variants
- ///
- public abstract class BridgeApi : Device
- {
- public BridgeApi(string key) :
- base(key)
- {
-
- }
- }
-
- ///
- /// Bridge API using EISC
- ///
- public class EiscApi : BridgeApi
- {
- public EiscApiPropertiesConfig PropertiesConfig { get; private set; }
-
- protected Dictionary JoinMaps { get; private set; }
-
- public ThreeSeriesTcpIpEthernetIntersystemCommunications Eisc { get; private set; }
-
- public EiscApi(DeviceConfig dc) :
- base(dc.Key)
- {
- JoinMaps = new Dictionary();
-
- PropertiesConfig = JsonConvert.DeserializeObject(dc.Properties.ToString());
-
- Eisc = new ThreeSeriesTcpIpEthernetIntersystemCommunications(PropertiesConfig.Control.IpIdInt, PropertiesConfig.Control.TcpSshProperties.Address, Global.ControlSystem);
-
- Eisc.SigChange += new Crestron.SimplSharpPro.DeviceSupport.SigEventHandler(Eisc_SigChange);
-
- Eisc.Register();
-
- AddPostActivationAction( () =>
- {
- Debug.Console(1, this, "Linking Devices...");
-
- foreach (var d in PropertiesConfig.Devices)
- {
- var device = DeviceManager.GetDeviceForKey(d.DeviceKey);
-
- if (device != null)
- {
- Debug.Console(1, this, "Linking Device: '{0}'", device.Key);
-
-
- if (device is IBridge) // Check for this first to allow bridges in plugins to override existing bridges that apply to the same type.
- {
- (device as IBridge).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
- continue;
- }
- else if (device is IBridgeAdvanced)
- {
- Debug.Console(2, this, "'{0}' is IBridgeAdvanced", device.Key);
- (device as IBridgeAdvanced).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey, this);
- }
- else if (device is PepperDash.Essentials.Core.Monitoring.SystemMonitorController)
- {
- (device as PepperDash.Essentials.Core.Monitoring.SystemMonitorController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
- continue;
- }
- else if (device is GenericComm)
- {
- (device as GenericComm).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
- continue;
- }
- else if (device is CameraBase)
- {
- (device as CameraBase).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey, this);
- continue;
- }
- else if (device is PepperDash.Essentials.Core.DisplayBase)
- {
- (device as DisplayBase).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
- continue;
- }
- else if (device is DmChassisController)
- {
- (device as DmChassisController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
- continue;
- }
- else if (device is DmBladeChassisController)
- {
- (device as DmBladeChassisController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
- continue;
- }
- else if (device is DmpsRoutingController)
- {
- (device as DmpsRoutingController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
- continue;
- }
- else if (device is DmpsAudioOutputController)
- {
- (device as DmpsAudioOutputController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
- continue;
- }
- else if (device is DmTxControllerBase)
- {
- (device as DmTxControllerBase).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
- continue;
- }
- else if (device is DmRmcControllerBase)
- {
- (device as DmRmcControllerBase).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
- continue;
- }
- else if (device is GenericRelayDevice)
- {
- (device as GenericRelayDevice).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
- continue;
- }
- else if (device is IRSetTopBoxBase)
- {
- (device as IRSetTopBoxBase).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
- continue;
- }
- else if (device is IDigitalInput)
- {
- (device as IDigitalInput).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
- continue;
- }
- else if (device is AppleTV)
- {
- (device as AppleTV).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
- continue;
- }
- else if (device is HdMdxxxCEController)
- {
- (device as HdMdxxxCEController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
- continue;
- }
- else if (device is LightingBase)
- {
- (device as LightingBase).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
- continue;
- }
- else if (device is DigitalLogger)
- {
- (device as DigitalLogger).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
- continue;
- }
- else if (device is PepperDash.Essentials.Devices.Common.Occupancy.GlsOccupancySensorBaseController)
- {
- (device as PepperDash.Essentials.Devices.Common.Occupancy.GlsOccupancySensorBaseController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
- continue;
- }
- else if (device is StatusSignController)
- {
- (device as StatusSignController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
- continue;
- }
- else if (device is C2nRthsController)
- {
- (device as C2nRthsController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
- continue;
- }
- }
- }
-
- Debug.Console(1, this, "Devices Linked.");
- });
- }
-
- ///
- /// Adds a join map
- ///
- ///
- ///
- public void AddJoinMap(string deviceKey, JoinMapBaseAdvanced joinMap)
- {
- if (!JoinMaps.ContainsKey(deviceKey))
- {
- JoinMaps.Add(deviceKey, joinMap);
- }
- else
- {
- Debug.Console(2, this, "Unable to add join map with key '{0}'. Key already exists in JoinMaps dictionary", deviceKey);
- }
- }
-
- ///
- /// Prints all the join maps on this bridge
- ///
- public void PrintJoinMaps()
- {
- Debug.Console(0, this, "Join Maps for EISC IPID: {0}", Eisc.ID.ToString("X"));
-
- foreach (var joinMap in JoinMaps)
- {
- Debug.Console(0, "Join map for device '{0}':", joinMap.Key);
- joinMap.Value.PrintJoinMapInfo();
- }
- }
-
- ///
- /// Prints the join map for a device by key
- ///
- ///
- public void PrintJoinMapForDevice(string deviceKey)
- {
- var joinMap = JoinMaps[deviceKey];
-
- if (joinMap == null)
- {
- Debug.Console(0, this, "Unable to find joinMap for device with key: '{0}'", deviceKey);
- return;
- }
-
- Debug.Console(0, "Join map for device '{0}' on EISC '{1}':", deviceKey, this.Key);
- joinMap.PrintJoinMapInfo();
- }
-
- ///
- /// Used for debugging to trigger an action based on a join number and type
- ///
- ///
- ///
- public void ExecuteJoinAction(uint join, string type, object state)
- {
- try
- {
- switch (type.ToLower())
- {
- case "digital":
- {
- var uo = Eisc.BooleanOutput[join].UserObject as Action;
- if (uo != null)
- {
- Debug.Console(1, this, "Executing Action: {0}", uo.ToString());
- uo(Convert.ToBoolean(state));
- }
- else
- Debug.Console(1, this, "User Action is null. Nothing to Execute");
- break;
- }
- case "analog":
- {
- var uo = Eisc.BooleanOutput[join].UserObject as Action;
- if (uo != null)
- {
- Debug.Console(1, this, "Executing Action: {0}", uo.ToString());
- uo(Convert.ToUInt16(state));
- }
- else
- Debug.Console(1, this, "User Action is null. Nothing to Execute"); break;
- }
- case "serial":
- {
- var uo = Eisc.BooleanOutput[join].UserObject as Action;
- if (uo != null)
- {
- Debug.Console(1, this, "Executing Action: {0}", uo.ToString());
- uo(Convert.ToString(state));
- }
- else
- Debug.Console(1, this, "User Action is null. Nothing to Execute");
- break;
- }
- default:
- {
- Debug.Console(1, "Unknown join type. Use digital/serial/analog");
- break;
- }
- }
- }
- catch (Exception e)
- {
- Debug.Console(1, this, "Error: {0}", e);
- }
-
- }
-
- ///
- /// Handles incoming sig changes
- ///
- ///
- ///
- void Eisc_SigChange(object currentDevice, Crestron.SimplSharpPro.SigEventArgs args)
- {
- try
- {
- if (Debug.Level >= 1)
- Debug.Console(1, this, "EiscApi change: {0} {1}={2}", args.Sig.Type, args.Sig.Number, args.Sig.StringValue);
- var uo = args.Sig.UserObject;
- if (uo != null)
- {
- Debug.Console(1, this, "Executing Action: {0}", uo.ToString());
- if (uo is Action)
- (uo as Action)(args.Sig.BoolValue);
- else if (uo is Action)
- (uo as Action)(args.Sig.UShortValue);
- else if (uo is Action)
- (uo as Action)(args.Sig.StringValue);
- }
- }
- catch (Exception e)
- {
- Debug.Console(2, this, "Error in Eisc_SigChange handler: {0}", e);
- }
- }
- }
-
- public class EiscApiPropertiesConfig
- {
- [JsonProperty("control")]
- public EssentialsControlPropertiesConfig Control { get; set; }
-
- [JsonProperty("devices")]
- public List Devices { get; set; }
-
-
- public class ApiDevicePropertiesConfig
- {
- [JsonProperty("deviceKey")]
- public string DeviceKey { get; set; }
-
- [JsonProperty("joinStart")]
- public uint JoinStart { get; set; }
-
- [JsonProperty("joinMapKey")]
- public string JoinMapKey { get; set; }
- }
-
- }
-
-
-}
\ No newline at end of file
diff --git a/PepperDashEssentials/Bridges/BridgeFactory.cs b/PepperDashEssentials/Bridges/BridgeFactory.cs
index 38cd117e..c17d4642 100644
--- a/PepperDashEssentials/Bridges/BridgeFactory.cs
+++ b/PepperDashEssentials/Bridges/BridgeFactory.cs
@@ -6,6 +6,7 @@ using Crestron.SimplSharp;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using PepperDash.Essentials.Core;
+using PepperDash.Essentials.Core.Bridges;
using PepperDash.Essentials.Core.Config;
using PepperDash.Core;
using PepperDash.Essentials.Core.Routing;
@@ -15,32 +16,21 @@ using Crestron.SimplSharpPro.EthernetCommunication;
namespace PepperDash.Essentials
{
+ ///
+ /// Responsible for loading all of the device types for this library
+ ///
public class BridgeFactory
{
- public static IKeyed GetDevice(DeviceConfig dc)
+ public BridgeFactory()
{
- // ? why is this static JTA 2018-06-13?
+ var eiscApiAdvancedFactory = new EiscApiAdvancedFactory() as IDeviceFactory;
+ eiscApiAdvancedFactory.LoadTypeFactories();
- var key = dc.Key;
- var name = dc.Name;
- var type = dc.Type;
- var properties = dc.Properties;
- var propAnon = new { };
-
- var typeName = dc.Type.ToLower();
- var groupName = dc.Group.ToLower();
-
- //Debug.Console(2, "Name {0}, Key {1}, Type {2}, Properties {3}", name, key, type, properties.ToString());
-
- if (typeName == "eiscapi")
- {
- return new EiscApi(dc);
- }
-
- return null;
+ var eiscApiFactory = new EiscApiFactory() as IDeviceFactory;
+ eiscApiFactory.LoadTypeFactories();
}
- }
+ }
public class CommBridge : Device
{
diff --git a/PepperDashEssentials/Bridges/C2nRthsControllerBridge.cs b/PepperDashEssentials/Bridges/C2nRthsControllerBridge.cs
index 13b78bae..931ee231 100644
--- a/PepperDashEssentials/Bridges/C2nRthsControllerBridge.cs
+++ b/PepperDashEssentials/Bridges/C2nRthsControllerBridge.cs
@@ -4,7 +4,7 @@ using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.CrestronIO;
-namespace PepperDash.Essentials.Bridges
+namespace PepperDash.Essentials.Core.Bridges
{
public static class C2nRthsControllerApiExtensions
{
diff --git a/PepperDashEssentials/Bridges/CameraControllerBridge.cs b/PepperDashEssentials/Bridges/CameraControllerBridge.cs
index 732fee2e..6a3771d3 100644
--- a/PepperDashEssentials/Bridges/CameraControllerBridge.cs
+++ b/PepperDashEssentials/Bridges/CameraControllerBridge.cs
@@ -11,7 +11,7 @@ using PepperDash.Essentials.Devices.Common.Cameras;
using Newtonsoft.Json;
-namespace PepperDash.Essentials.Bridges
+namespace PepperDash.Essentials.Core.Bridges
{
public static class CameraControllerApiExtensions
{
diff --git a/PepperDashEssentials/Bridges/DigitalLoggerBridge.cs b/PepperDashEssentials/Bridges/DigitalLoggerBridge.cs
deleted file mode 100644
index 7d3fab3d..00000000
--- a/PepperDashEssentials/Bridges/DigitalLoggerBridge.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Crestron.SimplSharp;
-using Crestron.SimplSharpPro.DeviceSupport;
-using PepperDash.Core;
-using PepperDash.Essentials.Core;
-using PepperDash.Essentials.Devices.Common;
-
-using Newtonsoft.Json;
-
-namespace PepperDash.Essentials.Bridges
-{
- public static class DigitalLoggerApiExtensions
- {
- public static void LinkToApi(this DigitalLogger DigitalLogger, BasicTriList trilist, uint joinStart, string joinMapKey)
- {
- DigitalLoggerJoinMap joinMap = new DigitalLoggerJoinMap();
-
- var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
-
- if (!string.IsNullOrEmpty(joinMapSerialized))
- joinMap = JsonConvert.DeserializeObject(joinMapSerialized);
-
- joinMap.OffsetJoinNumbers(joinStart);
-
- Debug.Console(1, DigitalLogger, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
- for (uint i = 1; i <= DigitalLogger.CircuitCount; i++)
- {
- var circuit = i;
- DigitalLogger.CircuitNameFeedbacks[circuit - 1].LinkInputSig(trilist.StringInput[joinMap.CircuitNames + circuit]);
- DigitalLogger.CircuitIsCritical[circuit - 1].LinkInputSig(trilist.BooleanInput[joinMap.CircuitIsCritical + circuit]);
- DigitalLogger.CircuitState[circuit - 1].LinkInputSig(trilist.BooleanInput[joinMap.CircuitState + circuit]);
- trilist.SetSigTrueAction(joinMap.CircuitCycle + circuit, () => DigitalLogger.CycleCircuit(circuit - 1));
- trilist.SetSigTrueAction(joinMap.CircuitOnCmd + circuit, () => DigitalLogger.TurnOnCircuit(circuit - 1));
- trilist.SetSigTrueAction(joinMap.CircuitOffCmd + circuit, () => DigitalLogger.TurnOffCircuit(circuit - 1));
-
- }
- }
- }
-}
\ No newline at end of file
diff --git a/PepperDashEssentials/Bridges/DisplayControllerBridge.cs b/PepperDashEssentials/Bridges/DisplayControllerBridge.cs
deleted file mode 100644
index c94b3691..00000000
--- a/PepperDashEssentials/Bridges/DisplayControllerBridge.cs
+++ /dev/null
@@ -1,153 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Crestron.SimplSharp;
-using Crestron.SimplSharpPro.DeviceSupport;
-using PepperDash.Core;
-using PepperDash.Essentials.Core;
-using PepperDash.Essentials.Devices.Common;
-
-using Newtonsoft.Json;
-
-
-namespace PepperDash.Essentials.Bridges
-{
- public static class DisplayControllerApiExtensions
- {
- public static void LinkToApi(this PepperDash.Essentials.Core.DisplayBase displayDevice, BasicTriList trilist, uint joinStart, string joinMapKey)
- {
- int inputNumber = 0;
- IntFeedback inputNumberFeedback;
- List inputKeys = new List();
-
- DisplayControllerJoinMap joinMap = new DisplayControllerJoinMap();
-
- var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
-
- if(!string.IsNullOrEmpty(joinMapSerialized))
- joinMap = JsonConvert.DeserializeObject(joinMapSerialized);
-
- joinMap.OffsetJoinNumbers(joinStart);
-
- Debug.Console(1, "Linking to Trilist '{0}'",trilist.ID.ToString("X"));
- Debug.Console(0, "Linking to Display: {0}", displayDevice.Name);
-
- trilist.StringInput[joinMap.Name].StringValue = displayDevice.Name;
-
- var commMonitor = displayDevice as ICommunicationMonitor;
- if (commMonitor != null)
- {
- commMonitor.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
- }
-
- inputNumberFeedback = new IntFeedback(() => { return inputNumber; });
-
- // Two way feedbacks
- var twoWayDisplay = displayDevice as PepperDash.Essentials.Core.TwoWayDisplayBase;
- if (twoWayDisplay != null)
- {
- trilist.SetBool(joinMap.IsTwoWayDisplay, true);
-
- twoWayDisplay.CurrentInputFeedback.OutputChange += new EventHandler(CurrentInputFeedback_OutputChange);
-
-
- inputNumberFeedback.LinkInputSig(trilist.UShortInput[joinMap.InputSelect]);
- }
-
- // Power Off
- trilist.SetSigTrueAction(joinMap.PowerOff, () =>
- {
- inputNumber = 102;
- inputNumberFeedback.FireUpdate();
- displayDevice.PowerOff();
- });
-
- displayDevice.PowerIsOnFeedback.OutputChange += new EventHandler( (o,a) => {
- if (!a.BoolValue)
- {
- inputNumber = 102;
- inputNumberFeedback.FireUpdate();
-
- }
- else
- {
- inputNumber = 0;
- inputNumberFeedback.FireUpdate();
- }
- });
-
- displayDevice.PowerIsOnFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.PowerOff]);
-
- // PowerOn
- trilist.SetSigTrueAction(joinMap.PowerOn, () =>
- {
- inputNumber = 0;
- inputNumberFeedback.FireUpdate();
- displayDevice.PowerOn();
- });
-
-
- displayDevice.PowerIsOnFeedback.LinkInputSig(trilist.BooleanInput[joinMap.PowerOn]);
-
- int count = 1;
- foreach (var input in displayDevice.InputPorts)
- {
- inputKeys.Add(input.Key.ToString());
- var tempKey = inputKeys.ElementAt(count - 1);
- trilist.SetSigTrueAction((ushort)(joinMap.InputSelectOffset + count), () => { displayDevice.ExecuteSwitch(displayDevice.InputPorts[tempKey].Selector); });
- Debug.Console(2, displayDevice, "Setting Input Select Action on Digital Join {0} to Input: {1}", joinMap.InputSelectOffset + count, displayDevice.InputPorts[tempKey].Key.ToString());
- trilist.StringInput[(ushort)(joinMap.InputNamesOffset + count)].StringValue = input.Key.ToString();
- count++;
- }
-
- Debug.Console(2, displayDevice, "Setting Input Select Action on Analog Join {0}", joinMap.InputSelect);
- trilist.SetUShortSigAction(joinMap.InputSelect, (a) =>
- {
- if (a == 0)
- {
- displayDevice.PowerOff();
- inputNumber = 0;
- }
- else if (a > 0 && a < displayDevice.InputPorts.Count && a != inputNumber)
- {
- displayDevice.ExecuteSwitch(displayDevice.InputPorts.ElementAt(a - 1).Selector);
- inputNumber = a;
- }
- else if (a == 102)
- {
- displayDevice.PowerToggle();
-
- }
- if (twoWayDisplay != null)
- inputNumberFeedback.FireUpdate();
- });
-
-
- var volumeDisplay = displayDevice as IBasicVolumeControls;
- if (volumeDisplay != null)
- {
- trilist.SetBoolSigAction(joinMap.VolumeUp, (b) => volumeDisplay.VolumeUp(b));
- trilist.SetBoolSigAction(joinMap.VolumeDown, (b) => volumeDisplay.VolumeDown(b));
- trilist.SetSigTrueAction(joinMap.VolumeMute, () => volumeDisplay.MuteToggle());
-
- var volumeDisplayWithFeedback = volumeDisplay as IBasicVolumeWithFeedback;
- if(volumeDisplayWithFeedback != null)
- {
- trilist.SetUShortSigAction(joinMap.VolumeLevel, new Action((u) => volumeDisplayWithFeedback.SetVolume(u)));
- volumeDisplayWithFeedback.VolumeLevelFeedback.LinkInputSig(trilist.UShortInput[joinMap.VolumeLevel]);
- volumeDisplayWithFeedback.MuteFeedback.LinkInputSig(trilist.BooleanInput[joinMap.VolumeMute]);
- }
- }
- }
-
- static void CurrentInputFeedback_OutputChange(object sender, FeedbackEventArgs e)
- {
-
- Debug.Console(0, "CurrentInputFeedback_OutputChange {0}", e.StringValue);
-
- }
-
- }
-
-}
\ No newline at end of file
diff --git a/PepperDashEssentials/Bridges/DmBladeChassisControllerBridge.cs b/PepperDashEssentials/Bridges/DmBladeChassisControllerBridge.cs
deleted file mode 100644
index 221745e8..00000000
--- a/PepperDashEssentials/Bridges/DmBladeChassisControllerBridge.cs
+++ /dev/null
@@ -1,222 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Crestron.SimplSharp;
-using Crestron.SimplSharpPro.DeviceSupport;
-using Crestron.SimplSharpPro.DM;
-using Crestron.SimplSharpPro.DM.Endpoints;
-using Crestron.SimplSharpPro.DM.Endpoints.Transmitters;
-
-using PepperDash.Core;
-using PepperDash.Essentials.Core;
-using PepperDash.Essentials.DM;
-
-using Newtonsoft.Json;
-
-namespace PepperDash.Essentials.Bridges {
- public static class DmBladeChassisControllerApiExtentions {
- public static void LinkToApi(this DmBladeChassisController dmChassis, BasicTriList trilist, uint joinStart, string joinMapKey) {
- DmBladeChassisControllerJoinMap joinMap = new DmBladeChassisControllerJoinMap();
-
- var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
-
- if (!string.IsNullOrEmpty(joinMapSerialized))
- joinMap = JsonConvert.DeserializeObject(joinMapSerialized);
-
-
- joinMap.OffsetJoinNumbers(joinStart);
-
- Debug.Console(1, dmChassis, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
-
- var chassis = dmChassis.Chassis as BladeSwitch;
-
- dmChassis.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
-
-
- // Link up outputs
- for (uint i = 1; i <= dmChassis.Chassis.NumberOfOutputs; i++) {
- var ioSlot = i;
-
- // Control
- trilist.SetUShortSigAction(joinMap.OutputVideo + ioSlot, new Action(o => dmChassis.ExecuteSwitch(o, ioSlot, eRoutingSignalType.Video)));
-
- if (dmChassis.TxDictionary.ContainsKey(ioSlot)) {
- Debug.Console(2, "Creating Tx Feedbacks {0}", ioSlot);
- var txKey = dmChassis.TxDictionary[ioSlot];
- var basicTxDevice = DeviceManager.GetDeviceForKey(txKey) as BasicDmTxControllerBase;
-
- var advancedTxDevice = basicTxDevice as DmTxControllerBase;
-
- if (dmChassis.Chassis is DmMd128x128 || dmChassis.Chassis is DmMd64x64) {
- dmChassis.InputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.InputEndpointOnline + ioSlot]);
- }
- else {
- if (advancedTxDevice != null) {
- advancedTxDevice.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.InputEndpointOnline + ioSlot]);
- Debug.Console(2, "Linking Tx Online Feedback from Advanced Transmitter at input {0}", ioSlot);
- }
- else if (dmChassis.InputEndpointOnlineFeedbacks[ioSlot] != null) {
- Debug.Console(2, "Linking Tx Online Feedback from Input Card {0}", ioSlot);
- dmChassis.InputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.InputEndpointOnline + ioSlot]);
- }
- }
-
- if (basicTxDevice != null && advancedTxDevice == null)
- trilist.BooleanInput[joinMap.TxAdvancedIsPresent + ioSlot].BoolValue = true;
-
- if (advancedTxDevice != null) {
- advancedTxDevice.AnyVideoInput.VideoStatus.VideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.VideoSyncStatus + ioSlot]);
- }
- else if (advancedTxDevice == null || basicTxDevice != null) {
- Debug.Console(1, "Setting up actions and feedbacks on input card {0}", ioSlot);
- dmChassis.VideoInputSyncFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.VideoSyncStatus + ioSlot]);
-
- var inputPort = dmChassis.InputPorts[string.Format("inputCard{0}--hdmiIn", ioSlot)];
- if (inputPort != null) {
- Debug.Console(1, "Port value for input card {0} is set", ioSlot);
- var port = inputPort.Port;
-
- if (port != null) {
- if (port is HdmiInputWithCEC) {
- Debug.Console(1, "Port is HdmiInputWithCec");
-
- var hdmiInPortWCec = port as HdmiInputWithCEC;
-
- if (hdmiInPortWCec.HdcpSupportedLevel != eHdcpSupportedLevel.Unknown) {
- SetHdcpStateAction(true, hdmiInPortWCec, joinMap.HdcpSupportState + ioSlot, trilist);
- }
-
- dmChassis.InputCardHdcpCapabilityFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.HdcpSupportState + ioSlot]);
-
- if (dmChassis.InputCardHdcpCapabilityTypes.ContainsKey(ioSlot))
- trilist.UShortInput[joinMap.HdcpSupportCapability + ioSlot].UShortValue = (ushort)dmChassis.InputCardHdcpCapabilityTypes[ioSlot];
- else
- trilist.UShortInput[joinMap.HdcpSupportCapability + ioSlot].UShortValue = 1;
- }
- }
- }
- else {
- inputPort = dmChassis.InputPorts[string.Format("inputCard{0}--dmIn", ioSlot)];
-
- if (inputPort != null) {
- var port = inputPort.Port;
-
- if (port is DMInputPortWithCec) {
- Debug.Console(1, "Port is DMInputPortWithCec");
-
- var dmInPortWCec = port as DMInputPortWithCec;
-
- if (dmInPortWCec != null) {
- SetHdcpStateAction(dmChassis.PropertiesConfig.InputSlotSupportsHdcp2[ioSlot], dmInPortWCec, joinMap.HdcpSupportState + ioSlot, trilist);
- }
-
- dmChassis.InputCardHdcpCapabilityFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.HdcpSupportState + ioSlot]);
-
- if (dmChassis.InputCardHdcpCapabilityTypes.ContainsKey(ioSlot))
- trilist.UShortInput[joinMap.HdcpSupportCapability + ioSlot].UShortValue = (ushort)dmChassis.InputCardHdcpCapabilityTypes[ioSlot];
- else
- trilist.UShortInput[joinMap.HdcpSupportCapability + ioSlot].UShortValue = 1;
- }
- }
- }
- }
- }
- else {
- dmChassis.VideoInputSyncFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.VideoSyncStatus + ioSlot]);
-
- var inputPort = dmChassis.InputPorts[string.Format("inputCard{0}--hdmiIn", ioSlot)];
- if (inputPort != null) {
- var hdmiPort = inputPort.Port as EndpointHdmiInput;
-
- if (hdmiPort != null) {
- SetHdcpStateAction(true, hdmiPort, joinMap.HdcpSupportState + ioSlot, trilist);
- dmChassis.InputCardHdcpCapabilityFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.HdcpSupportState + ioSlot]);
- }
- }
- }
- if (dmChassis.RxDictionary.ContainsKey(ioSlot)) {
- Debug.Console(2, "Creating Rx Feedbacks {0}", ioSlot);
- //var rxKey = dmChassis.RxDictionary[ioSlot];
- //var rxDevice = DeviceManager.GetDeviceForKey(rxKey) as DmRmcControllerBase;
- //var hdBaseTDevice = DeviceManager.GetDeviceForKey(rxKey) as DmHdBaseTControllerBase;
- //if (hdBaseTDevice != null) {
- dmChassis.OutputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.OutputEndpointOnline + ioSlot]);
- //}
- //else if (rxDevice != null) {
- // rxDevice.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.OutputEndpointOnline + ioSlot]);
- //}
- }
-
- // Feedback
- dmChassis.VideoOutputFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.OutputVideo + ioSlot]);
-
-
- dmChassis.OutputNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputNames + ioSlot]);
- dmChassis.InputNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.InputNames + ioSlot]);
- dmChassis.OutputVideoRouteNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputCurrentVideoInputNames + ioSlot]);
- }
- }
-
- static void SetHdcpStateAction(bool hdcpTypeSimple, HdmiInputWithCEC port, uint join, BasicTriList trilist) {
- if (hdcpTypeSimple) {
- trilist.SetUShortSigAction(join,
- new Action(s => {
- if (s == 0) {
- port.HdcpSupportOff();
- }
- else if (s > 0) {
- port.HdcpSupportOn();
- }
- }));
- }
- else {
- trilist.SetUShortSigAction(join,
- new Action(u => {
- port.HdcpReceiveCapability = (eHdcpCapabilityType)u;
- }));
- }
- }
-
- static void SetHdcpStateAction(bool hdcpTypeSimple, EndpointHdmiInput port, uint join, BasicTriList trilist) {
- if (hdcpTypeSimple) {
- trilist.SetUShortSigAction(join,
- new Action(s => {
- if (s == 0) {
- port.HdcpSupportOff();
- }
- else if (s > 0) {
- port.HdcpSupportOn();
- }
- }));
- }
- else {
- trilist.SetUShortSigAction(join,
- new Action(u => {
- port.HdcpCapability = (eHdcpCapabilityType)u;
- }));
- }
- }
-
- static void SetHdcpStateAction(bool supportsHdcp2, DMInputPortWithCec port, uint join, BasicTriList trilist) {
- if (!supportsHdcp2) {
- trilist.SetUShortSigAction(join,
- new Action(s => {
- if (s == 0) {
- port.HdcpSupportOff();
- }
- else if (s > 0) {
- port.HdcpSupportOn();
- }
- }));
- }
- else {
- trilist.SetUShortSigAction(join,
- new Action(u => {
- port.HdcpReceiveCapability = (eHdcpCapabilityType)u;
- }));
- }
- }
-
- }
-}
\ No newline at end of file
diff --git a/PepperDashEssentials/Bridges/DmChassisControllerBridge.cs b/PepperDashEssentials/Bridges/DmChassisControllerBridge.cs
index 9c8c8551..6522a5f0 100644
--- a/PepperDashEssentials/Bridges/DmChassisControllerBridge.cs
+++ b/PepperDashEssentials/Bridges/DmChassisControllerBridge.cs
@@ -15,7 +15,7 @@ using PepperDash.Essentials.DM;
using Newtonsoft.Json;
-namespace PepperDash.Essentials.Bridges
+namespace PepperDash.Essentials.Core.Bridges
{
public static class DmChassisControllerApiExtentions
{
diff --git a/PepperDashEssentials/Bridges/DmRmcControllerBridge.cs b/PepperDashEssentials/Bridges/DmRmcControllerBridge.cs
index 1e99b734..5609cf03 100644
--- a/PepperDashEssentials/Bridges/DmRmcControllerBridge.cs
+++ b/PepperDashEssentials/Bridges/DmRmcControllerBridge.cs
@@ -11,7 +11,7 @@ using PepperDash.Essentials.DM;
using Newtonsoft.Json;
-namespace PepperDash.Essentials.Bridges
+namespace PepperDash.Essentials.Core.Bridges
{
public static class DmRmcControllerApiExtensions
{
diff --git a/PepperDashEssentials/Bridges/DmTxControllerBridge.cs b/PepperDashEssentials/Bridges/DmTxControllerBridge.cs
index 9b28611e..c565f41e 100644
--- a/PepperDashEssentials/Bridges/DmTxControllerBridge.cs
+++ b/PepperDashEssentials/Bridges/DmTxControllerBridge.cs
@@ -14,7 +14,7 @@ using PepperDash.Essentials.DM;
using Newtonsoft.Json;
-namespace PepperDash.Essentials.Bridges
+namespace PepperDash.Essentials.Core.Bridges
{
public static class DmTxControllerApiExtensions
{
diff --git a/PepperDashEssentials/Bridges/DmpsAudioOutputControllerBridge.cs b/PepperDashEssentials/Bridges/DmpsAudioOutputControllerBridge.cs
index f721b44f..eec058da 100644
--- a/PepperDashEssentials/Bridges/DmpsAudioOutputControllerBridge.cs
+++ b/PepperDashEssentials/Bridges/DmpsAudioOutputControllerBridge.cs
@@ -12,7 +12,7 @@ using PepperDash.Essentials.DM;
using Newtonsoft.Json;
-namespace PepperDash.Essentials.Bridges
+namespace PepperDash.Essentials.Core.Bridges
{
public static class DmpsAudioOutputControllerApiExtensions
{
diff --git a/PepperDashEssentials/Bridges/DmpsRoutingControllerBridge.cs b/PepperDashEssentials/Bridges/DmpsRoutingControllerBridge.cs
index eb359dd9..ea775039 100644
--- a/PepperDashEssentials/Bridges/DmpsRoutingControllerBridge.cs
+++ b/PepperDashEssentials/Bridges/DmpsRoutingControllerBridge.cs
@@ -12,7 +12,7 @@ using PepperDash.Essentials.DM;
using Newtonsoft.Json;
-namespace PepperDash.Essentials.Bridges
+namespace PepperDash.Essentials.Core.Bridges
{
public static class DmpsRoutingControllerApiExtentions
{
diff --git a/PepperDashEssentials/Bridges/EiscBridge.cs b/PepperDashEssentials/Bridges/EiscBridge.cs
new file mode 100644
index 00000000..4c999f20
--- /dev/null
+++ b/PepperDashEssentials/Bridges/EiscBridge.cs
@@ -0,0 +1,232 @@
+using System;
+using System.Collections.Generic;
+using Crestron.SimplSharpPro;
+using Crestron.SimplSharpPro.EthernetCommunication;
+using PepperDash.Core;
+using PepperDash.Essentials.Bridges;
+using PepperDash.Essentials.Core;
+using PepperDash.Essentials.Core.Bridges;
+using PepperDash.Essentials.Core.Config;
+
+namespace PepperDash.Essentials.Bridges
+{
+ [Obsolete("Please use 'eiscapiadvanced' in configurations going forward")]
+ public class EiscApi : BridgeApi
+ {
+ public EiscApiPropertiesConfig PropertiesConfig { get; private set; }
+
+ protected Dictionary JoinMaps { get; private set; }
+
+ public ThreeSeriesTcpIpEthernetIntersystemCommunications Eisc { get; private set; }
+
+ public EiscApi(DeviceConfig dc) :
+ base(dc.Key)
+ {
+ JoinMaps = new Dictionary();
+
+ PropertiesConfig = dc.Properties.ToObject();
+ //PropertiesConfig = JsonConvert.DeserializeObject(dc.Properties.ToString());
+
+ Eisc = new ThreeSeriesTcpIpEthernetIntersystemCommunications(PropertiesConfig.Control.IpIdInt, PropertiesConfig.Control.TcpSshProperties.Address, Global.ControlSystem);
+
+ Eisc.SigChange += Eisc_SigChange;
+
+ Eisc.Register();
+
+ AddPostActivationAction(() =>
+ {
+ Debug.Console(1, this, "Linking Devices...");
+
+ foreach (var d in PropertiesConfig.Devices)
+ {
+ var device = DeviceManager.GetDeviceForKey(d.DeviceKey);
+
+ if (device == null) continue;
+
+ Debug.Console(1, this, "Linking Device: '{0}'", device.Key);
+ if (device is IBridge) // Check for this first to allow bridges in plugins to override existing bridges that apply to the same type.
+ {
+ Debug.Console(2, this, "'{0}' is IBridge", device.Key);
+
+ var dev = device as IBridge;
+
+ dev.LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
+ }
+ if (!(device is IBridgeAdvanced)) continue;
+ Debug.Console(2, this, "'{0}' is IBridgeAdvanced", device.Key);
+
+ var advDev = device as IBridgeAdvanced;
+
+ try
+ {
+ advDev.LinkToApi(Eisc, d.JoinStart, d.JoinMapKey, null);
+ }
+ catch (NullReferenceException)
+ {
+ Debug.ConsoleWithLog(0, this,
+ "Please update the bridge config to use EiscBridgeAdvanced with this device: {0}", device.Key);
+ }
+
+ }
+ Debug.Console(1, this, "Devices Linked.");
+
+
+ });
+ }
+
+ ///
+ /// Adds a join map
+ ///
+ ///
+ ///
+ public void AddJoinMap(string deviceKey, JoinMapBaseAdvanced joinMap)
+ {
+ if (!JoinMaps.ContainsKey(deviceKey))
+ {
+ JoinMaps.Add(deviceKey, joinMap);
+ }
+ else
+ {
+ Debug.Console(2, this, "Unable to add join map with key '{0}'. Key already exists in JoinMaps dictionary", deviceKey);
+ }
+ }
+
+ ///
+ /// Prints all the join maps on this bridge
+ ///
+ public void PrintJoinMaps()
+ {
+ Debug.Console(0, this, "Join Maps for EISC IPID: {0}", Eisc.ID.ToString("X"));
+
+ foreach (var joinMap in JoinMaps)
+ {
+ Debug.Console(0, "Join map for device '{0}':", joinMap.Key);
+ joinMap.Value.PrintJoinMapInfo();
+ }
+ }
+
+ ///
+ /// Prints the join map for a device by key
+ ///
+ ///
+ public void PrintJoinMapForDevice(string deviceKey)
+ {
+ var joinMap = JoinMaps[deviceKey];
+
+ if (joinMap == null)
+ {
+ Debug.Console(0, this, "Unable to find joinMap for device with key: '{0}'", deviceKey);
+ return;
+ }
+
+ Debug.Console(0, "Join map for device '{0}' on EISC '{1}':", deviceKey, Key);
+ joinMap.PrintJoinMapInfo();
+ }
+
+ ///
+ /// Used for debugging to trigger an action based on a join number and type
+ ///
+ ///
+ ///
+ ///
+ public void ExecuteJoinAction(uint join, string type, object state)
+ {
+ try
+ {
+ switch (type.ToLower())
+ {
+ case "digital":
+ {
+ var uo = Eisc.BooleanOutput[join].UserObject as Action;
+ if (uo != null)
+ {
+ Debug.Console(1, this, "Executing Action: {0}", uo.ToString());
+ uo(Convert.ToBoolean(state));
+ }
+ else
+ Debug.Console(1, this, "User Action is null. Nothing to Execute");
+ break;
+ }
+ case "analog":
+ {
+ var uo = Eisc.BooleanOutput[join].UserObject as Action;
+ if (uo != null)
+ {
+ Debug.Console(1, this, "Executing Action: {0}", uo.ToString());
+ uo(Convert.ToUInt16(state));
+ }
+ else
+ Debug.Console(1, this, "User Action is null. Nothing to Execute"); break;
+ }
+ case "serial":
+ {
+ var uo = Eisc.BooleanOutput[join].UserObject as Action;
+ if (uo != null)
+ {
+ Debug.Console(1, this, "Executing Action: {0}", uo.ToString());
+ uo(Convert.ToString(state));
+ }
+ else
+ Debug.Console(1, this, "User Action is null. Nothing to Execute");
+ break;
+ }
+ default:
+ {
+ Debug.Console(1, "Unknown join type. Use digital/serial/analog");
+ break;
+ }
+ }
+ }
+ catch (Exception e)
+ {
+ Debug.Console(1, this, "Error: {0}", e);
+ }
+
+ }
+
+ ///
+ /// Handles incoming sig changes
+ ///
+ ///
+ ///
+ void Eisc_SigChange(object currentDevice, SigEventArgs args)
+ {
+ try
+ {
+ if (Debug.Level >= 1)
+ Debug.Console(1, this, "EiscApiAdvanced change: {0} {1}={2}", args.Sig.Type, args.Sig.Number, args.Sig.StringValue);
+ var uo = args.Sig.UserObject;
+
+ if (uo == null) return;
+
+ Debug.Console(1, this, "Executing Action: {0}", uo.ToString());
+ if (uo is Action)
+ (uo as Action)(args.Sig.BoolValue);
+ else if (uo is Action)
+ (uo as Action)(args.Sig.UShortValue);
+ else if (uo is Action)
+ (uo as Action)(args.Sig.StringValue);
+ }
+ catch (Exception e)
+ {
+ Debug.Console(2, this, "Error in Eisc_SigChange handler: {0}", e);
+ }
+ }
+ }
+
+ public class EiscApiFactory : EssentialsDeviceFactory
+ {
+ public EiscApiFactory()
+ {
+ TypeNames = new List() { "eiscapi" };
+ }
+
+ public override EssentialsDevice BuildDevice(DeviceConfig dc)
+ {
+ Debug.Console(1, "Factory Attempting to create new EiscApi Device");
+
+ return new EiscApi(dc);
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/PepperDashEssentials/Bridges/GenericLightingBridge.cs b/PepperDashEssentials/Bridges/GenericLightingBridge.cs
index d76bbebb..5365b813 100644
--- a/PepperDashEssentials/Bridges/GenericLightingBridge.cs
+++ b/PepperDashEssentials/Bridges/GenericLightingBridge.cs
@@ -10,7 +10,7 @@ using PepperDash.Essentials.Devices.Common;
using Newtonsoft.Json;
-namespace PepperDash.Essentials.Bridges
+namespace PepperDash.Essentials.Core.Bridges
{
public static class GenericLightingApiExtensions
{
diff --git a/PepperDashEssentials/Bridges/GenericRelayDeviceBridge.cs b/PepperDashEssentials/Bridges/GenericRelayDeviceBridge.cs
index 684a5550..8175f115 100644
--- a/PepperDashEssentials/Bridges/GenericRelayDeviceBridge.cs
+++ b/PepperDashEssentials/Bridges/GenericRelayDeviceBridge.cs
@@ -11,7 +11,7 @@ using PepperDash.Essentials.Core.CrestronIO;
using Newtonsoft.Json;
-namespace PepperDash.Essentials.Bridges
+namespace PepperDash.Essentials.Core.Bridges
{
public static class GenericRelayDeviceApiExtensions
{
diff --git a/PepperDashEssentials/Bridges/GlsOccupancySensorBaseControllerBridge.cs b/PepperDashEssentials/Bridges/GlsOccupancySensorBaseControllerBridge.cs
index a49061b7..b073750c 100644
--- a/PepperDashEssentials/Bridges/GlsOccupancySensorBaseControllerBridge.cs
+++ b/PepperDashEssentials/Bridges/GlsOccupancySensorBaseControllerBridge.cs
@@ -12,7 +12,7 @@ using PepperDash.Core;
using Newtonsoft.Json;
-namespace PepperDash.Essentials.Bridges
+namespace PepperDash.Essentials.Core.Bridges
{
public static class GlsOccupancySensorBaseControllerApiExtensions
{
diff --git a/PepperDashEssentials/Bridges/HdMdxxxCEControllerBridge.cs b/PepperDashEssentials/Bridges/HdMdxxxCEControllerBridge.cs
index 52bacfec..bf6fdb54 100644
--- a/PepperDashEssentials/Bridges/HdMdxxxCEControllerBridge.cs
+++ b/PepperDashEssentials/Bridges/HdMdxxxCEControllerBridge.cs
@@ -14,7 +14,7 @@ using PepperDash.Essentials.DM;
using Newtonsoft.Json;
-namespace PepperDash.Essentials.Bridges
+namespace PepperDash.Essentials.Core.Bridges
{
public static class HdMdxxxCEControllerApiExtensions
{
diff --git a/PepperDashEssentials/Bridges/IBasicCommunicationBridge.cs b/PepperDashEssentials/Bridges/IBasicCommunicationBridge.cs
index 6ae9334c..b23860d3 100644
--- a/PepperDashEssentials/Bridges/IBasicCommunicationBridge.cs
+++ b/PepperDashEssentials/Bridges/IBasicCommunicationBridge.cs
@@ -10,7 +10,7 @@ using PepperDash.Essentials.Core;
using Newtonsoft.Json;
-namespace PepperDash.Essentials.Bridges
+namespace PepperDash.Essentials.Core.Bridges
{
public static class IBasicCommunicationApiExtensions
{
diff --git a/PepperDashEssentials/Bridges/IBridge.cs b/PepperDashEssentials/Bridges/IBridge.cs
index f2b959ed..497985c7 100644
--- a/PepperDashEssentials/Bridges/IBridge.cs
+++ b/PepperDashEssentials/Bridges/IBridge.cs
@@ -1,8 +1,4 @@
using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Crestron.SimplSharp;
using Crestron.SimplSharpPro.DeviceSupport;
namespace PepperDash.Essentials.Bridges
@@ -15,12 +11,4 @@ namespace PepperDash.Essentials.Bridges
{
void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey);
}
-
- ///
- /// Defines a device that uses JoinMapBaseAdvanced for its join map
- ///
- public interface IBridgeAdvanced
- {
- void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApi bridge);
- }
}
\ No newline at end of file
diff --git a/PepperDashEssentials/Bridges/IDigitalInputBridge.cs b/PepperDashEssentials/Bridges/IDigitalInputBridge.cs
index 54c48e1a..078e0b13 100644
--- a/PepperDashEssentials/Bridges/IDigitalInputBridge.cs
+++ b/PepperDashEssentials/Bridges/IDigitalInputBridge.cs
@@ -11,7 +11,7 @@ using PepperDash.Essentials.Core.CrestronIO;
using Newtonsoft.Json;
-namespace PepperDash.Essentials.Bridges
+namespace PepperDash.Essentials.Core.Bridges
{
public static class IDigitalInputApiExtenstions
{
diff --git a/PepperDashEssentials/Bridges/IRSetTopBoxBaseBridge.cs b/PepperDashEssentials/Bridges/IRSetTopBoxBaseBridge.cs
index 0f7b5786..76e5b5ee 100644
--- a/PepperDashEssentials/Bridges/IRSetTopBoxBaseBridge.cs
+++ b/PepperDashEssentials/Bridges/IRSetTopBoxBaseBridge.cs
@@ -10,7 +10,7 @@ using PepperDash.Essentials.Devices.Common;
using Newtonsoft.Json;
-namespace PepperDash.Essentials.Bridges
+namespace PepperDash.Essentials.Core.Bridges
{
public static class IRSetTopBoxBaseApiExtensions
{
diff --git a/PepperDashEssentials/Bridges/JoinMaps/AirMediaControllerJoinMap.cs b/PepperDashEssentials/Bridges/JoinMaps/AirMediaControllerJoinMap.cs
index 042a3bf3..5b02c05b 100644
--- a/PepperDashEssentials/Bridges/JoinMaps/AirMediaControllerJoinMap.cs
+++ b/PepperDashEssentials/Bridges/JoinMaps/AirMediaControllerJoinMap.cs
@@ -7,6 +7,7 @@ using PepperDash.Essentials.Core;
namespace PepperDash.Essentials.Bridges
{
+ [Obsolete("Please use version PepperDash.Essentials.Core.Bridges")]
public class AirMediaControllerJoinMap : JoinMapBase
{
#region Digitals
diff --git a/PepperDashEssentials/Bridges/JoinMaps/AppleTvJoinMap.cs b/PepperDashEssentials/Bridges/JoinMaps/AppleTvJoinMap.cs
index 8945d9c9..ac84ee31 100644
--- a/PepperDashEssentials/Bridges/JoinMaps/AppleTvJoinMap.cs
+++ b/PepperDashEssentials/Bridges/JoinMaps/AppleTvJoinMap.cs
@@ -7,6 +7,7 @@ using PepperDash.Essentials.Core;
namespace PepperDash.Essentials.Bridges
{
+ [Obsolete("Please use version PepperDash.Essentials.Core.Bridges")]
public class AppleTvJoinMap : JoinMapBase
{
#region Digitals
diff --git a/PepperDashEssentials/Bridges/JoinMaps/C2nRthsControllerJoinMap.cs b/PepperDashEssentials/Bridges/JoinMaps/C2nRthsControllerJoinMap.cs
index be0f002e..bbf8268d 100644
--- a/PepperDashEssentials/Bridges/JoinMaps/C2nRthsControllerJoinMap.cs
+++ b/PepperDashEssentials/Bridges/JoinMaps/C2nRthsControllerJoinMap.cs
@@ -1,43 +1,45 @@
-using System.Linq;
-using Crestron.SimplSharp.Reflection;
-using PepperDash.Essentials.Core;
-
-namespace PepperDash.Essentials.Bridges
-{
- public class C2nRthsControllerJoinMap:JoinMapBase
- {
- public uint IsOnline { get; set; }
- public uint Name { get; set; }
- public uint Temperature { get; set; }
- public uint Humidity { get; set; }
- public uint TemperatureFormat { get; set; }
-
- public C2nRthsControllerJoinMap()
- {
- //digital
- IsOnline = 1;
- TemperatureFormat = 2;
-
- //Analog
- Temperature = 2;
- Humidity = 3;
-
- //serial
- Name = 1;
-
-
- }
-
- public override void OffsetJoinNumbers(uint joinStart)
- {
- var joinOffset = joinStart - 1;
- var properties =
- GetType().GetCType().GetProperties().Where(p => p.PropertyType == typeof(uint)).ToList();
-
- foreach (var propertyInfo in properties)
- {
- propertyInfo.SetValue(this, (uint)propertyInfo.GetValue(this, null) + joinOffset, null);
- }
- }
- }
+using System;
+using System.Linq;
+using Crestron.SimplSharp.Reflection;
+using PepperDash.Essentials.Core;
+
+namespace PepperDash.Essentials.Bridges
+{
+ [Obsolete("Please use version PepperDash.Essentials.Core.Bridges")]
+ public class C2nRthsControllerJoinMap:JoinMapBase
+ {
+ public uint IsOnline { get; set; }
+ public uint Name { get; set; }
+ public uint Temperature { get; set; }
+ public uint Humidity { get; set; }
+ public uint TemperatureFormat { get; set; }
+
+ public C2nRthsControllerJoinMap()
+ {
+ //digital
+ IsOnline = 1;
+ TemperatureFormat = 2;
+
+ //Analog
+ Temperature = 2;
+ Humidity = 3;
+
+ //serial
+ Name = 1;
+
+
+ }
+
+ public override void OffsetJoinNumbers(uint joinStart)
+ {
+ var joinOffset = joinStart - 1;
+ var properties =
+ GetType().GetCType().GetProperties().Where(p => p.PropertyType == typeof(uint)).ToList();
+
+ foreach (var propertyInfo in properties)
+ {
+ propertyInfo.SetValue(this, (uint)propertyInfo.GetValue(this, null) + joinOffset, null);
+ }
+ }
+ }
}
\ No newline at end of file
diff --git a/PepperDashEssentials/Bridges/JoinMaps/CameraControllerJoinMap.cs b/PepperDashEssentials/Bridges/JoinMaps/CameraControllerJoinMap.cs
index 5a37892f..1546ff23 100644
--- a/PepperDashEssentials/Bridges/JoinMaps/CameraControllerJoinMap.cs
+++ b/PepperDashEssentials/Bridges/JoinMaps/CameraControllerJoinMap.cs
@@ -11,6 +11,8 @@ namespace PepperDash.Essentials.Bridges
///
/// Join map for CameraBase devices
///
+ ///
+ [Obsolete("Please use version PepperDash.Essentials.Core.Bridges")]
public class CameraControllerJoinMap : JoinMapBaseAdvanced
{
[JoinName("TiltUp")]
diff --git a/PepperDashEssentials/Bridges/JoinMaps/DigitalLoggerJoinMap.cs b/PepperDashEssentials/Bridges/JoinMaps/DigitalLoggerJoinMap.cs
index 2b0a1c15..3f4c8c43 100644
--- a/PepperDashEssentials/Bridges/JoinMaps/DigitalLoggerJoinMap.cs
+++ b/PepperDashEssentials/Bridges/JoinMaps/DigitalLoggerJoinMap.cs
@@ -8,6 +8,7 @@ using PepperDash.Essentials.Core;
namespace PepperDash.Essentials.Bridges
{
+ [Obsolete("Please use version PepperDash.Essentials.Core.Bridges")]
public class DigitalLoggerJoinMap : JoinMapBase
{
public uint IsOnline { get; set; }
diff --git a/PepperDashEssentials/Bridges/JoinMaps/DisplayControllerJoinMap.cs b/PepperDashEssentials/Bridges/JoinMaps/DisplayControllerJoinMap.cs
index ddbec182..48671d24 100644
--- a/PepperDashEssentials/Bridges/JoinMaps/DisplayControllerJoinMap.cs
+++ b/PepperDashEssentials/Bridges/JoinMaps/DisplayControllerJoinMap.cs
@@ -7,6 +7,7 @@ using PepperDash.Essentials.Core;
namespace PepperDash.Essentials.Bridges
{
+ [Obsolete("Please use version PepperDash.Essentials.Core.Bridges")]
public class DisplayControllerJoinMap : JoinMapBase
{
#region Digitals
diff --git a/PepperDashEssentials/Bridges/JoinMaps/DmBladeChassisControllerJoinMap.cs b/PepperDashEssentials/Bridges/JoinMaps/DmBladeChassisControllerJoinMap.cs
index 29ee6471..0779523a 100644
--- a/PepperDashEssentials/Bridges/JoinMaps/DmBladeChassisControllerJoinMap.cs
+++ b/PepperDashEssentials/Bridges/JoinMaps/DmBladeChassisControllerJoinMap.cs
@@ -1,109 +1,110 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Crestron.SimplSharp;
-using PepperDash.Essentials.Core;
-
-namespace PepperDash.Essentials.Bridges {
- public class DmBladeChassisControllerJoinMap : JoinMapBase {
- #region Digital/Analogs
- #endregion
-
- #region Digitals
- ///
- /// High when device is online
- ///
- public uint IsOnline { get; set; }
- ///
- /// Range reports video sync feedback for each input
- ///
- public uint VideoSyncStatus { get; set; }
- ///
- /// Range reports high if corresponding input's endpoint is online
- ///
- public uint InputEndpointOnline { get; set; }
- ///
- /// Range reports high if corresponding output's endpoint is online
- ///
- public uint OutputEndpointOnline { get; set; }
- ///
- /// Range reports high if corresponding input's transmitter supports bridging as a separate device for detailed AV switching, HDCP control, etc.
- ///
- public uint TxAdvancedIsPresent { get; set; } // indicates that there is an attached transmitter that should be bridged to be interacted with
- #endregion
-
- #region Analogs
- ///
- /// Range sets and reports the current video source for the corresponding output
- ///
- public uint OutputVideo { get; set; }
- ///
- /// Range sets and reports the current HDCP state for the corresponding input card
- ///
- public uint HdcpSupportState { get; set; }
- ///
- /// Range reports the highest supported HDCP state level for the corresponding input card
- ///
- public uint HdcpSupportCapability { get; set; }
- #endregion
-
- #region Serials
- ///
- /// Range sets and reports the name for the corresponding input card
- ///
- public uint InputNames { get; set; }
- ///
- /// Range sets and reports the name for the corresponding output card
- ///
- public uint OutputNames { get; set; }
- ///
- /// Range reports the name of the current video source for the corresponding output card
- ///
- public uint OutputCurrentVideoInputNames { get; set; }
- ///
- /// Range reports the current input resolution for each corresponding input card
- ///
- public uint InputCurrentResolution { get; set; }
- #endregion
-
- public DmBladeChassisControllerJoinMap() {
- //Digital/Analog
-
- //Digital
- IsOnline = 11;
- VideoSyncStatus = 100; //101-299
- InputEndpointOnline = 500; //501-699
- OutputEndpointOnline = 700; //701-899
- TxAdvancedIsPresent = 1000; //1001-1199
-
- //Analog
- OutputVideo = 100; //101-299
- HdcpSupportState = 1000; //1001-1199
- HdcpSupportCapability = 1200; //1201-1399
-
-
- //Serial
- InputNames = 100; //101-299
- OutputNames = 300; //301-499
- OutputCurrentVideoInputNames = 2000; //2001-2199
- InputCurrentResolution = 2400; // 2401-2599
- }
-
- public override void OffsetJoinNumbers(uint joinStart) {
- var joinOffset = joinStart - 1;
-
- IsOnline = IsOnline + joinOffset;
- OutputVideo = OutputVideo + joinOffset;
- VideoSyncStatus = VideoSyncStatus + joinOffset;
- InputNames = InputNames + joinOffset;
- OutputNames = OutputNames + joinOffset;
- OutputCurrentVideoInputNames = OutputCurrentVideoInputNames + joinOffset;
- InputCurrentResolution = InputCurrentResolution + joinOffset;
- InputEndpointOnline = InputEndpointOnline + joinOffset;
- OutputEndpointOnline = OutputEndpointOnline + joinOffset;
- HdcpSupportState = HdcpSupportState + joinOffset;
- HdcpSupportCapability = HdcpSupportCapability + joinOffset;
- }
- }
-}
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Crestron.SimplSharp;
+using PepperDash.Essentials.Core;
+
+namespace PepperDash.Essentials.Bridges {
+ [Obsolete("Please use version PepperDash.Essentials.Core.Bridges")]
+ public class DmBladeChassisControllerJoinMap : JoinMapBase {
+ #region Digital/Analogs
+ #endregion
+
+ #region Digitals
+ ///
+ /// High when device is online
+ ///
+ public uint IsOnline { get; set; }
+ ///
+ /// Range reports video sync feedback for each input
+ ///
+ public uint VideoSyncStatus { get; set; }
+ ///
+ /// Range reports high if corresponding input's endpoint is online
+ ///
+ public uint InputEndpointOnline { get; set; }
+ ///
+ /// Range reports high if corresponding output's endpoint is online
+ ///
+ public uint OutputEndpointOnline { get; set; }
+ ///
+ /// Range reports high if corresponding input's transmitter supports bridging as a separate device for detailed AV switching, HDCP control, etc.
+ ///
+ public uint TxAdvancedIsPresent { get; set; } // indicates that there is an attached transmitter that should be bridged to be interacted with
+ #endregion
+
+ #region Analogs
+ ///
+ /// Range sets and reports the current video source for the corresponding output
+ ///
+ public uint OutputVideo { get; set; }
+ ///
+ /// Range sets and reports the current HDCP state for the corresponding input card
+ ///
+ public uint HdcpSupportState { get; set; }
+ ///
+ /// Range reports the highest supported HDCP state level for the corresponding input card
+ ///
+ public uint HdcpSupportCapability { get; set; }
+ #endregion
+
+ #region Serials
+ ///
+ /// Range sets and reports the name for the corresponding input card
+ ///
+ public uint InputNames { get; set; }
+ ///
+ /// Range sets and reports the name for the corresponding output card
+ ///
+ public uint OutputNames { get; set; }
+ ///
+ /// Range reports the name of the current video source for the corresponding output card
+ ///
+ public uint OutputCurrentVideoInputNames { get; set; }
+ ///
+ /// Range reports the current input resolution for each corresponding input card
+ ///
+ public uint InputCurrentResolution { get; set; }
+ #endregion
+
+ public DmBladeChassisControllerJoinMap() {
+ //Digital/Analog
+
+ //Digital
+ IsOnline = 11;
+ VideoSyncStatus = 100; //101-299
+ InputEndpointOnline = 500; //501-699
+ OutputEndpointOnline = 700; //701-899
+ TxAdvancedIsPresent = 1000; //1001-1199
+
+ //Analog
+ OutputVideo = 100; //101-299
+ HdcpSupportState = 1000; //1001-1199
+ HdcpSupportCapability = 1200; //1201-1399
+
+
+ //Serial
+ InputNames = 100; //101-299
+ OutputNames = 300; //301-499
+ OutputCurrentVideoInputNames = 2000; //2001-2199
+ InputCurrentResolution = 2400; // 2401-2599
+ }
+
+ public override void OffsetJoinNumbers(uint joinStart) {
+ var joinOffset = joinStart - 1;
+
+ IsOnline = IsOnline + joinOffset;
+ OutputVideo = OutputVideo + joinOffset;
+ VideoSyncStatus = VideoSyncStatus + joinOffset;
+ InputNames = InputNames + joinOffset;
+ OutputNames = OutputNames + joinOffset;
+ OutputCurrentVideoInputNames = OutputCurrentVideoInputNames + joinOffset;
+ InputCurrentResolution = InputCurrentResolution + joinOffset;
+ InputEndpointOnline = InputEndpointOnline + joinOffset;
+ OutputEndpointOnline = OutputEndpointOnline + joinOffset;
+ HdcpSupportState = HdcpSupportState + joinOffset;
+ HdcpSupportCapability = HdcpSupportCapability + joinOffset;
+ }
+ }
+}
diff --git a/PepperDashEssentials/Bridges/JoinMaps/DmChassisControllerJoinMap.cs b/PepperDashEssentials/Bridges/JoinMaps/DmChassisControllerJoinMap.cs
index ff6a42d9..2e1b8394 100644
--- a/PepperDashEssentials/Bridges/JoinMaps/DmChassisControllerJoinMap.cs
+++ b/PepperDashEssentials/Bridges/JoinMaps/DmChassisControllerJoinMap.cs
@@ -7,6 +7,7 @@ using PepperDash.Essentials.Core;
namespace PepperDash.Essentials.Bridges
{
+ [Obsolete("Please use version PepperDash.Essentials.Core.Bridges")]
public class DmChassisControllerJoinMap : JoinMapBase
{
#region Digital/Analogs
diff --git a/PepperDashEssentials/Bridges/JoinMaps/DmRmcControllerJoinMap.cs b/PepperDashEssentials/Bridges/JoinMaps/DmRmcControllerJoinMap.cs
index 7aa8081a..3d7cec8d 100644
--- a/PepperDashEssentials/Bridges/JoinMaps/DmRmcControllerJoinMap.cs
+++ b/PepperDashEssentials/Bridges/JoinMaps/DmRmcControllerJoinMap.cs
@@ -7,6 +7,7 @@ using PepperDash.Essentials.Core;
namespace PepperDash.Essentials.Bridges
{
+ [Obsolete("Please use version PepperDash.Essentials.Core.Bridges")]
public class DmRmcControllerJoinMap : JoinMapBase
{
#region Digitals
@@ -37,8 +38,12 @@ namespace PepperDash.Essentials.Bridges
/// Reports the EDID serial number value
///
public uint EdidSerialNumber { get; set; }
- #endregion
-
+ #endregion
+
+ #region Analogs
+ public uint AudioVideoSource { get; set; }
+ #endregion
+
public DmRmcControllerJoinMap()
{
// Digital
@@ -50,6 +55,9 @@ namespace PepperDash.Essentials.Bridges
EdidName = 3;
EdidPrefferedTiming = 4;
EdidSerialNumber = 5;
+
+ //Analog
+ AudioVideoSource = 1;
}
public override void OffsetJoinNumbers(uint joinStart)
@@ -61,7 +69,8 @@ namespace PepperDash.Essentials.Bridges
EdidManufacturer = EdidManufacturer + joinOffset;
EdidName = EdidName + joinOffset;
EdidPrefferedTiming = EdidPrefferedTiming + joinOffset;
- EdidSerialNumber = EdidSerialNumber + joinOffset;
+ EdidSerialNumber = EdidSerialNumber + joinOffset;
+ AudioVideoSource = AudioVideoSource + joinOffset;
}
}
}
\ No newline at end of file
diff --git a/PepperDashEssentials/Bridges/JoinMaps/DmTxControllerJoinMap.cs b/PepperDashEssentials/Bridges/JoinMaps/DmTxControllerJoinMap.cs
index ff673cab..f84134a1 100644
--- a/PepperDashEssentials/Bridges/JoinMaps/DmTxControllerJoinMap.cs
+++ b/PepperDashEssentials/Bridges/JoinMaps/DmTxControllerJoinMap.cs
@@ -1,12 +1,9 @@
using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Crestron.SimplSharp;
using PepperDash.Essentials.Core;
namespace PepperDash.Essentials.Bridges
{
+ [Obsolete("Please use version PepperDash.Essentials.Core.Bridges")]
public class DmTxControllerJoinMap : JoinMapBase
{
#region Digitals
diff --git a/PepperDashEssentials/Bridges/JoinMaps/DmpsAudioOutputControllerJoinMap.cs b/PepperDashEssentials/Bridges/JoinMaps/DmpsAudioOutputControllerJoinMap.cs
index faa30775..47c7d50d 100644
--- a/PepperDashEssentials/Bridges/JoinMaps/DmpsAudioOutputControllerJoinMap.cs
+++ b/PepperDashEssentials/Bridges/JoinMaps/DmpsAudioOutputControllerJoinMap.cs
@@ -7,6 +7,7 @@ using PepperDash.Essentials.Core;
namespace PepperDash.Essentials.Bridges
{
+ [Obsolete("Please use version PepperDash.Essentials.Core.Bridges")]
public class DmpsAudioOutputControllerJoinMap : JoinMapBase
{
#region Digital/Analog
diff --git a/PepperDashEssentials/Bridges/JoinMaps/DmpsRoutingControllerJoinMap.cs b/PepperDashEssentials/Bridges/JoinMaps/DmpsRoutingControllerJoinMap.cs
index ba3a8cd0..308dddf0 100644
--- a/PepperDashEssentials/Bridges/JoinMaps/DmpsRoutingControllerJoinMap.cs
+++ b/PepperDashEssentials/Bridges/JoinMaps/DmpsRoutingControllerJoinMap.cs
@@ -7,6 +7,7 @@ using PepperDash.Essentials.Core;
namespace PepperDash.Essentials.Bridges
{
+ [Obsolete("Please use version PepperDash.Essentials.Core.Bridges")]
public class DmpsRoutingControllerJoinMap : JoinMapBase
{
#region Digitals
diff --git a/PepperDashEssentials/Bridges/JoinMaps/GenericLightingJoinMap.cs b/PepperDashEssentials/Bridges/JoinMaps/GenericLightingJoinMap.cs
index df5606d0..3bc9b19a 100644
--- a/PepperDashEssentials/Bridges/JoinMaps/GenericLightingJoinMap.cs
+++ b/PepperDashEssentials/Bridges/JoinMaps/GenericLightingJoinMap.cs
@@ -9,6 +9,7 @@ using PepperDash.Essentials.Core;
namespace PepperDash.Essentials.Bridges
{
+ [Obsolete("Please use version PepperDash.Essentials.Core.Bridges")]
public class GenericLightingJoinMap : JoinMapBase
{
public uint IsOnline { get; set; }
diff --git a/PepperDashEssentials/Bridges/JoinMaps/GenericRelayControllerJoinMap.cs b/PepperDashEssentials/Bridges/JoinMaps/GenericRelayControllerJoinMap.cs
index 5c91a358..56b50724 100644
--- a/PepperDashEssentials/Bridges/JoinMaps/GenericRelayControllerJoinMap.cs
+++ b/PepperDashEssentials/Bridges/JoinMaps/GenericRelayControllerJoinMap.cs
@@ -7,6 +7,7 @@ using PepperDash.Essentials.Core;
namespace PepperDash.Essentials.Bridges
{
+ [Obsolete("Please use version PepperDash.Essentials.Core.Bridges")]
public class GenericRelayControllerJoinMap : JoinMapBase
{
#region Digitals
diff --git a/PepperDashEssentials/Bridges/JoinMaps/GlsOccupancySensorBaseJoinMap.cs b/PepperDashEssentials/Bridges/JoinMaps/GlsOccupancySensorBaseJoinMap.cs
index 6e19dff2..800f516c 100644
--- a/PepperDashEssentials/Bridges/JoinMaps/GlsOccupancySensorBaseJoinMap.cs
+++ b/PepperDashEssentials/Bridges/JoinMaps/GlsOccupancySensorBaseJoinMap.cs
@@ -1,238 +1,239 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Crestron.SimplSharp;
-using PepperDash.Essentials.Core;
-
-namespace PepperDash.Essentials.Bridges
-{
- public class GlsOccupancySensorBaseJoinMap : JoinMapBase
- {
- #region Digitals
-
- ///
- /// High when device is online
- ///
- public uint IsOnline { get; set; }
- ///
- /// Forces the device to report occupied status
- ///
- public uint ForceOccupied { get; set; }
- ///
- /// Forces the device to report vacant status
- ///
- public uint ForceVacant { get; set; }
- ///
- /// Enables raw status reporting
- ///
- public uint EnableRawStates { get; set; }
- ///
- /// High when raw occupancy is detected
- ///
- public uint RawOccupancyFeedback { get; set; }
- ///
- /// High when PIR sensor detects motion
- ///
- public uint RawOccupancyPirFeedback { get; set; }
- ///
- /// High when US sensor detects motion
- ///
- public uint RawOccupancyUsFeedback { get; set; }
- ///
- /// High when occupancy is detected
- ///
- public uint RoomOccupiedFeedback { get; set; }
- ///
- /// Hich when occupancy is detected in the grace period
- ///
- public uint GraceOccupancyDetectedFeedback { get; set; }
- ///
- /// High when vacancy is detected
- ///
- public uint RoomVacantFeedback { get; set; }
-
- ///
- /// Enables the LED Flash when set high
- ///
- public uint EnableLedFlash { get; set; }
- ///
- /// Disables the LED flash when set high
- ///
- public uint DisableLedFlash { get; set; }
- ///
- /// Enables the Short Timeout
- ///
- public uint EnableShortTimeout { get; set; }
- ///
- /// Disables the Short Timout
- ///
- public uint DisableShortTimeout { get; set; }
- ///
- /// Set high to enable one technology to trigger occupancy
- ///
- public uint OrWhenVacated { get; set; }
- ///
- /// Set high to require both technologies to trigger occupancy
- ///
- public uint AndWhenVacated { get; set; }
- ///
- /// Enables Ultrasonic Sensor A
- ///
- public uint EnableUsA { get; set; }
- ///
- /// Disables Ultrasonic Sensor A
- ///
- public uint DisableUsA { get; set; }
- ///
- /// Enables Ultrasonic Sensor B
- ///
- public uint EnableUsB { get; set; }
- ///
- /// Disables Ultrasonic Sensor B
- ///
- public uint DisableUsB { get; set; }
- ///
- /// Enables Pir
- ///
- public uint EnablePir { get; set; }
- ///
- /// Disables Pir
- ///
- public uint DisablePir { get; set; }
- public uint IncrementUsInOccupiedState { get; set; }
- public uint DecrementUsInOccupiedState { get; set; }
- public uint IncrementUsInVacantState { get; set; }
- public uint DecrementUsInVacantState { get; set; }
- public uint IncrementPirInOccupiedState { get; set; }
- public uint DecrementPirInOccupiedState { get; set; }
- public uint IncrementPirInVacantState { get; set; }
- public uint DecrementPirInVacantState { get; set; }
- #endregion
-
- #region Analogs
- ///
- /// Sets adn reports the remote timeout value
- ///
- public uint Timeout { get; set; }
- ///
- /// Reports the local timeout value
- ///
- public uint TimeoutLocalFeedback { get; set; }
- ///
- /// Sets the minimum internal photo sensor value and reports the current level
- ///
- public uint InternalPhotoSensorValue { get; set; }
- ///
- /// Sets the minimum external photo sensor value and reports the current level
- ///
- public uint ExternalPhotoSensorValue { get; set; }
-
- public uint UsSensitivityInOccupiedState { get; set; }
-
- public uint UsSensitivityInVacantState { get; set; }
-
- public uint PirSensitivityInOccupiedState { get; set; }
-
- public uint PirSensitivityInVacantState { get; set; }
- #endregion
-
- #region Serial
- public uint Name { get; set; }
- #endregion
-
- public GlsOccupancySensorBaseJoinMap()
- {
- IsOnline = 1;
- ForceOccupied = 2;
- ForceVacant = 3;
- EnableRawStates = 4;
- RoomOccupiedFeedback = 2;
- GraceOccupancyDetectedFeedback = 3;
- RoomVacantFeedback = 4;
- RawOccupancyFeedback = 5;
- RawOccupancyPirFeedback = 6;
- RawOccupancyUsFeedback = 7;
- EnableLedFlash = 11;
- DisableLedFlash = 12;
- EnableShortTimeout = 13;
- DisableShortTimeout = 14;
- OrWhenVacated = 15;
- AndWhenVacated = 16;
- EnableUsA = 17;
- DisableUsA = 18;
- EnableUsB = 19;
- DisableUsB = 20;
- EnablePir = 21;
- DisablePir = 22;
- IncrementUsInOccupiedState = 23;
- DecrementUsInOccupiedState = 24;
- IncrementUsInVacantState = 25;
- DecrementUsInVacantState = 26;
- IncrementPirInOccupiedState = 27;
- DecrementPirInOccupiedState = 28;
- IncrementPirInVacantState = 29;
- DecrementPirInVacantState = 30;
-
- Timeout = 1;
- TimeoutLocalFeedback = 2;
- InternalPhotoSensorValue = 3;
- ExternalPhotoSensorValue = 4;
- UsSensitivityInOccupiedState = 5;
- UsSensitivityInVacantState = 6;
- PirSensitivityInOccupiedState = 7;
- PirSensitivityInVacantState = 8;
-
- Name = 1;
-
- }
-
- public override void OffsetJoinNumbers(uint joinStart)
- {
- var joinOffset = joinStart - 1;
-
- IsOnline = IsOnline + joinOffset;
- ForceOccupied = ForceOccupied + joinOffset;
- ForceVacant = ForceVacant + joinOffset;
- EnableRawStates = EnableRawStates + joinOffset;
- RoomOccupiedFeedback = RoomOccupiedFeedback + joinOffset;
- GraceOccupancyDetectedFeedback = GraceOccupancyDetectedFeedback + joinOffset;
- RoomVacantFeedback = RoomVacantFeedback + joinOffset;
- RawOccupancyFeedback = RawOccupancyFeedback + joinOffset;
- RawOccupancyPirFeedback = RawOccupancyPirFeedback + joinOffset;
- RawOccupancyUsFeedback = RawOccupancyUsFeedback + joinOffset;
- EnableLedFlash = EnableLedFlash + joinOffset;
- DisableLedFlash = DisableLedFlash + joinOffset;
- EnableShortTimeout = EnableShortTimeout + joinOffset;
- DisableShortTimeout = DisableShortTimeout + joinOffset;
- OrWhenVacated = OrWhenVacated + joinOffset;
- AndWhenVacated = AndWhenVacated + joinOffset;
- EnableUsA = EnableUsA + joinOffset;
- DisableUsA = DisableUsA + joinOffset;
- EnableUsB = EnableUsB + joinOffset;
- DisableUsB = DisableUsB + joinOffset;
- EnablePir = EnablePir + joinOffset;
- DisablePir = DisablePir + joinOffset;
- IncrementUsInOccupiedState = IncrementUsInOccupiedState + joinOffset;
- DecrementUsInOccupiedState = DecrementUsInOccupiedState + joinOffset;
- IncrementUsInVacantState = IncrementUsInVacantState + joinOffset;
- DecrementUsInVacantState = DecrementUsInVacantState + joinOffset;
- IncrementPirInOccupiedState = IncrementPirInOccupiedState + joinOffset;
- DecrementPirInOccupiedState = DecrementPirInOccupiedState + joinOffset;
- IncrementPirInVacantState = IncrementPirInVacantState + joinOffset;
- DecrementPirInVacantState = DecrementPirInVacantState + joinOffset;
-
- Timeout = Timeout + joinOffset;
- TimeoutLocalFeedback = TimeoutLocalFeedback + joinOffset;
- InternalPhotoSensorValue = InternalPhotoSensorValue + joinOffset;
- ExternalPhotoSensorValue = ExternalPhotoSensorValue + joinOffset;
- UsSensitivityInOccupiedState = UsSensitivityInOccupiedState + joinOffset;
- UsSensitivityInVacantState = UsSensitivityInVacantState + joinOffset;
- PirSensitivityInOccupiedState = PirSensitivityInOccupiedState + joinOffset;
- PirSensitivityInVacantState = PirSensitivityInVacantState + joinOffset;
-
- Name = Name + joinOffset;
- }
- }
-
-}
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Crestron.SimplSharp;
+using PepperDash.Essentials.Core;
+
+namespace PepperDash.Essentials.Bridges
+{
+ [Obsolete("Please use version PepperDash.Essentials.Core.Bridges")]
+ public class GlsOccupancySensorBaseJoinMap : JoinMapBase
+ {
+ #region Digitals
+
+ ///
+ /// High when device is online
+ ///
+ public uint IsOnline { get; set; }
+ ///
+ /// Forces the device to report occupied status
+ ///
+ public uint ForceOccupied { get; set; }
+ ///
+ /// Forces the device to report vacant status
+ ///
+ public uint ForceVacant { get; set; }
+ ///
+ /// Enables raw status reporting
+ ///
+ public uint EnableRawStates { get; set; }
+ ///
+ /// High when raw occupancy is detected
+ ///
+ public uint RawOccupancyFeedback { get; set; }
+ ///
+ /// High when PIR sensor detects motion
+ ///
+ public uint RawOccupancyPirFeedback { get; set; }
+ ///
+ /// High when US sensor detects motion
+ ///
+ public uint RawOccupancyUsFeedback { get; set; }
+ ///
+ /// High when occupancy is detected
+ ///
+ public uint RoomOccupiedFeedback { get; set; }
+ ///
+ /// Hich when occupancy is detected in the grace period
+ ///
+ public uint GraceOccupancyDetectedFeedback { get; set; }
+ ///
+ /// High when vacancy is detected
+ ///
+ public uint RoomVacantFeedback { get; set; }
+
+ ///
+ /// Enables the LED Flash when set high
+ ///
+ public uint EnableLedFlash { get; set; }
+ ///
+ /// Disables the LED flash when set high
+ ///
+ public uint DisableLedFlash { get; set; }
+ ///
+ /// Enables the Short Timeout
+ ///
+ public uint EnableShortTimeout { get; set; }
+ ///
+ /// Disables the Short Timout
+ ///
+ public uint DisableShortTimeout { get; set; }
+ ///
+ /// Set high to enable one technology to trigger occupancy
+ ///
+ public uint OrWhenVacated { get; set; }
+ ///
+ /// Set high to require both technologies to trigger occupancy
+ ///
+ public uint AndWhenVacated { get; set; }
+ ///
+ /// Enables Ultrasonic Sensor A
+ ///
+ public uint EnableUsA { get; set; }
+ ///
+ /// Disables Ultrasonic Sensor A
+ ///
+ public uint DisableUsA { get; set; }
+ ///
+ /// Enables Ultrasonic Sensor B
+ ///
+ public uint EnableUsB { get; set; }
+ ///
+ /// Disables Ultrasonic Sensor B
+ ///
+ public uint DisableUsB { get; set; }
+ ///
+ /// Enables Pir
+ ///
+ public uint EnablePir { get; set; }
+ ///
+ /// Disables Pir
+ ///
+ public uint DisablePir { get; set; }
+ public uint IncrementUsInOccupiedState { get; set; }
+ public uint DecrementUsInOccupiedState { get; set; }
+ public uint IncrementUsInVacantState { get; set; }
+ public uint DecrementUsInVacantState { get; set; }
+ public uint IncrementPirInOccupiedState { get; set; }
+ public uint DecrementPirInOccupiedState { get; set; }
+ public uint IncrementPirInVacantState { get; set; }
+ public uint DecrementPirInVacantState { get; set; }
+ #endregion
+
+ #region Analogs
+ ///
+ /// Sets adn reports the remote timeout value
+ ///
+ public uint Timeout { get; set; }
+ ///
+ /// Reports the local timeout value
+ ///
+ public uint TimeoutLocalFeedback { get; set; }
+ ///
+ /// Sets the minimum internal photo sensor value and reports the current level
+ ///
+ public uint InternalPhotoSensorValue { get; set; }
+ ///
+ /// Sets the minimum external photo sensor value and reports the current level
+ ///
+ public uint ExternalPhotoSensorValue { get; set; }
+
+ public uint UsSensitivityInOccupiedState { get; set; }
+
+ public uint UsSensitivityInVacantState { get; set; }
+
+ public uint PirSensitivityInOccupiedState { get; set; }
+
+ public uint PirSensitivityInVacantState { get; set; }
+ #endregion
+
+ #region Serial
+ public uint Name { get; set; }
+ #endregion
+
+ public GlsOccupancySensorBaseJoinMap()
+ {
+ IsOnline = 1;
+ ForceOccupied = 2;
+ ForceVacant = 3;
+ EnableRawStates = 4;
+ RoomOccupiedFeedback = 2;
+ GraceOccupancyDetectedFeedback = 3;
+ RoomVacantFeedback = 4;
+ RawOccupancyFeedback = 5;
+ RawOccupancyPirFeedback = 6;
+ RawOccupancyUsFeedback = 7;
+ EnableLedFlash = 11;
+ DisableLedFlash = 12;
+ EnableShortTimeout = 13;
+ DisableShortTimeout = 14;
+ OrWhenVacated = 15;
+ AndWhenVacated = 16;
+ EnableUsA = 17;
+ DisableUsA = 18;
+ EnableUsB = 19;
+ DisableUsB = 20;
+ EnablePir = 21;
+ DisablePir = 22;
+ IncrementUsInOccupiedState = 23;
+ DecrementUsInOccupiedState = 24;
+ IncrementUsInVacantState = 25;
+ DecrementUsInVacantState = 26;
+ IncrementPirInOccupiedState = 27;
+ DecrementPirInOccupiedState = 28;
+ IncrementPirInVacantState = 29;
+ DecrementPirInVacantState = 30;
+
+ Timeout = 1;
+ TimeoutLocalFeedback = 2;
+ InternalPhotoSensorValue = 3;
+ ExternalPhotoSensorValue = 4;
+ UsSensitivityInOccupiedState = 5;
+ UsSensitivityInVacantState = 6;
+ PirSensitivityInOccupiedState = 7;
+ PirSensitivityInVacantState = 8;
+
+ Name = 1;
+
+ }
+
+ public override void OffsetJoinNumbers(uint joinStart)
+ {
+ var joinOffset = joinStart - 1;
+
+ IsOnline = IsOnline + joinOffset;
+ ForceOccupied = ForceOccupied + joinOffset;
+ ForceVacant = ForceVacant + joinOffset;
+ EnableRawStates = EnableRawStates + joinOffset;
+ RoomOccupiedFeedback = RoomOccupiedFeedback + joinOffset;
+ GraceOccupancyDetectedFeedback = GraceOccupancyDetectedFeedback + joinOffset;
+ RoomVacantFeedback = RoomVacantFeedback + joinOffset;
+ RawOccupancyFeedback = RawOccupancyFeedback + joinOffset;
+ RawOccupancyPirFeedback = RawOccupancyPirFeedback + joinOffset;
+ RawOccupancyUsFeedback = RawOccupancyUsFeedback + joinOffset;
+ EnableLedFlash = EnableLedFlash + joinOffset;
+ DisableLedFlash = DisableLedFlash + joinOffset;
+ EnableShortTimeout = EnableShortTimeout + joinOffset;
+ DisableShortTimeout = DisableShortTimeout + joinOffset;
+ OrWhenVacated = OrWhenVacated + joinOffset;
+ AndWhenVacated = AndWhenVacated + joinOffset;
+ EnableUsA = EnableUsA + joinOffset;
+ DisableUsA = DisableUsA + joinOffset;
+ EnableUsB = EnableUsB + joinOffset;
+ DisableUsB = DisableUsB + joinOffset;
+ EnablePir = EnablePir + joinOffset;
+ DisablePir = DisablePir + joinOffset;
+ IncrementUsInOccupiedState = IncrementUsInOccupiedState + joinOffset;
+ DecrementUsInOccupiedState = DecrementUsInOccupiedState + joinOffset;
+ IncrementUsInVacantState = IncrementUsInVacantState + joinOffset;
+ DecrementUsInVacantState = DecrementUsInVacantState + joinOffset;
+ IncrementPirInOccupiedState = IncrementPirInOccupiedState + joinOffset;
+ DecrementPirInOccupiedState = DecrementPirInOccupiedState + joinOffset;
+ IncrementPirInVacantState = IncrementPirInVacantState + joinOffset;
+ DecrementPirInVacantState = DecrementPirInVacantState + joinOffset;
+
+ Timeout = Timeout + joinOffset;
+ TimeoutLocalFeedback = TimeoutLocalFeedback + joinOffset;
+ InternalPhotoSensorValue = InternalPhotoSensorValue + joinOffset;
+ ExternalPhotoSensorValue = ExternalPhotoSensorValue + joinOffset;
+ UsSensitivityInOccupiedState = UsSensitivityInOccupiedState + joinOffset;
+ UsSensitivityInVacantState = UsSensitivityInVacantState + joinOffset;
+ PirSensitivityInOccupiedState = PirSensitivityInOccupiedState + joinOffset;
+ PirSensitivityInVacantState = PirSensitivityInVacantState + joinOffset;
+
+ Name = Name + joinOffset;
+ }
+ }
+
+}
diff --git a/PepperDashEssentials/Bridges/JoinMaps/HdMdxxxCEControllerJoinMap.cs b/PepperDashEssentials/Bridges/JoinMaps/HdMdxxxCEControllerJoinMap.cs
index e88980fe..d9fad27e 100644
--- a/PepperDashEssentials/Bridges/JoinMaps/HdMdxxxCEControllerJoinMap.cs
+++ b/PepperDashEssentials/Bridges/JoinMaps/HdMdxxxCEControllerJoinMap.cs
@@ -7,6 +7,7 @@ using PepperDash.Essentials.Core;
namespace PepperDash.Essentials.Bridges
{
+ [Obsolete("Please use version PepperDash.Essentials.Core.Bridges")]
public class HdMdxxxCEControllerJoinMap : JoinMapBase
{
#region Digitals
diff --git a/PepperDashEssentials/Bridges/JoinMaps/IBasicCommunicationJoinMap.cs b/PepperDashEssentials/Bridges/JoinMaps/IBasicCommunicationJoinMap.cs
index 953bae37..c8939ef8 100644
--- a/PepperDashEssentials/Bridges/JoinMaps/IBasicCommunicationJoinMap.cs
+++ b/PepperDashEssentials/Bridges/JoinMaps/IBasicCommunicationJoinMap.cs
@@ -7,6 +7,7 @@ using PepperDash.Essentials.Core;
namespace PepperDash.Essentials.Bridges
{
+ [Obsolete("Please use version PepperDash.Essentials.Core.Bridges")]
public class IBasicCommunicationJoinMap : JoinMapBase
{
#region Digitals
diff --git a/PepperDashEssentials/Bridges/JoinMaps/IDigitalInputJoinMap.cs b/PepperDashEssentials/Bridges/JoinMaps/IDigitalInputJoinMap.cs
index 65d4ada4..a4c4aaa9 100644
--- a/PepperDashEssentials/Bridges/JoinMaps/IDigitalInputJoinMap.cs
+++ b/PepperDashEssentials/Bridges/JoinMaps/IDigitalInputJoinMap.cs
@@ -7,6 +7,7 @@ using PepperDash.Essentials.Core;
namespace PepperDash.Essentials.Bridges
{
+ [Obsolete("Please use version PepperDash.Essentials.Core.Bridges")]
public class IDigitalInputJoinMap : JoinMapBase
{
#region Digitals
diff --git a/PepperDashEssentials/Bridges/JoinMaps/SetTopBoxControllerJoinMap.cs b/PepperDashEssentials/Bridges/JoinMaps/SetTopBoxControllerJoinMap.cs
index aa23cb7a..20b0d9a9 100644
--- a/PepperDashEssentials/Bridges/JoinMaps/SetTopBoxControllerJoinMap.cs
+++ b/PepperDashEssentials/Bridges/JoinMaps/SetTopBoxControllerJoinMap.cs
@@ -1,212 +1,213 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Crestron.SimplSharp;
-using PepperDash.Essentials.Core;
-using Crestron.SimplSharp.Reflection;
-
-
-namespace PepperDash.Essentials.Bridges
-{
- public class SetTopBoxControllerJoinMap : JoinMapBase
- {
- #region Digitals
- public uint DvrList { get; set; } //
- public uint Replay { get; set; }
- public uint Up { get; set; } //
- public uint Down { get; set; } //
- public uint Left { get; set; } //
- public uint Right { get; set; } //
- public uint Select { get; set; } //
- public uint Menu { get; set; } //
- public uint Exit { get; set; } //
- public uint Digit0 { get; set; } //
- public uint Digit1 { get; set; } //
- public uint Digit2 { get; set; } //
- public uint Digit3 { get; set; } //
- public uint Digit4 { get; set; } //
- public uint Digit5 { get; set; } //
- public uint Digit6 { get; set; } //
- public uint Digit7 { get; set; } //
- public uint Digit8 { get; set; } //
- public uint Digit9 { get; set; } //
- public uint Dash { get; set; } //
- public uint KeypadEnter { get; set; } //
- public uint ChannelUp { get; set; } //
- public uint ChannelDown { get; set; } //
- public uint LastChannel { get; set; } //
- public uint Guide { get; set; } //
- public uint Info { get; set; } //
- public uint Red { get; set; } //
- public uint Green { get; set; } //
- public uint Yellow { get; set; } //
- public uint Blue { get; set; } //
- public uint ChapMinus { get; set; }
- public uint ChapPlus { get; set; }
- public uint FFwd { get; set; } //
- public uint Pause { get; set; } //
- public uint Play { get; set; } //
- public uint Record { get; set; }
- public uint Rewind { get; set; } //
- public uint Stop { get; set; } //
-
- public uint PowerOn { get; set; } //
- public uint PowerOff { get; set; } //
- public uint PowerToggle { get; set; } //
-
- public uint HasKeypadAccessoryButton1 { get; set; }
- public uint HasKeypadAccessoryButton2 { get; set; }
-
- public uint KeypadAccessoryButton1Press { get; set; }
- public uint KeypadAccessoryButton2Press { get; set; }
-
-
- public uint HasDvr { get; set; }
- public uint HasPresets { get; set; }
- public uint HasNumeric { get; set; }
- public uint HasDpad { get; set; }
-
-
- #endregion
-
- #region Analogs
-
- #endregion
-
- #region Strings
- public uint Name { get; set; }
- public uint LoadPresets { get; set; }
- public uint KeypadAccessoryButton1Label { get; set; }
- public uint KeypadAccessoryButton2Label { get; set; }
-
- #endregion
-
- public SetTopBoxControllerJoinMap()
- {
- PowerOn = 1;
- PowerOff = 2;
- PowerToggle = 3;
-
- HasDpad = 4;
- Up = 4;
- Down = 5;
- Left = 6;
- Right = 7;
- Select = 8;
- Menu = 9;
- Exit = 10;
-
- HasNumeric = 11;
- Digit0 = 11;
- Digit1 = 12;
- Digit2 = 13;
- Digit3 = 14;
- Digit4 = 15;
- Digit5 = 16;
- Digit6 = 17;
- Digit7 = 18;
- Digit8 = 19;
- Digit9 = 20;
- Dash = 21;
- KeypadEnter = 22;
- ChannelUp = 23;
- ChannelDown = 24;
- LastChannel = 25;
-
- Guide = 26;
- Info = 27;
- Red = 28;
- Green = 29;
- Yellow = 30;
- Blue = 31;
-
- HasDvr = 32;
- DvrList = 32;
- Play = 33;
- Pause = 34;
- Stop = 35;
- FFwd = 36;
- Rewind = 37;
- ChapPlus = 38;
- ChapMinus = 39;
- Replay = 40;
- Record = 41;
- HasKeypadAccessoryButton1 = 42;
- KeypadAccessoryButton1Press = 42;
- HasKeypadAccessoryButton2 = 43;
- KeypadAccessoryButton2Press = 43;
-
- Name = 1;
- KeypadAccessoryButton1Label = 42;
- KeypadAccessoryButton2Label = 43;
-
- LoadPresets = 50;
- }
-
- public override void OffsetJoinNumbers(uint joinStart)
- {
- var joinOffset = joinStart - 1;
-
- PowerOn += joinOffset;
- PowerOff += joinOffset;
- PowerToggle += joinOffset;
-
- HasDpad += joinOffset;
- Up += joinOffset;
- Down += joinOffset;
- Left += joinOffset;
- Right += joinOffset;
- Select += joinOffset;
- Menu += joinOffset;
- Exit += joinOffset;
-
- HasNumeric += joinOffset;
- Digit0 += joinOffset;
- Digit1 += joinOffset;
- Digit2 += joinOffset;
- Digit3 += joinOffset;
- Digit4 += joinOffset;
- Digit5 += joinOffset;
- Digit6 += joinOffset;
- Digit7 += joinOffset;
- Digit8 += joinOffset;
- Digit9 += joinOffset;
- Dash += joinOffset;
- KeypadEnter += joinOffset;
- ChannelUp += joinOffset;
- ChannelDown += joinOffset;
- LastChannel += joinOffset;
-
- Guide += joinOffset;
- Info += joinOffset;
- Red += joinOffset;
- Green += joinOffset;
- Yellow += joinOffset;
- Blue += joinOffset;
-
- HasDvr += joinOffset;
- DvrList += joinOffset;
- Play += joinOffset;
- Pause += joinOffset;
- Stop += joinOffset;
- FFwd += joinOffset;
- Rewind += joinOffset;
- ChapPlus += joinOffset;
- ChapMinus += joinOffset;
- Replay += joinOffset;
- Record += joinOffset;
- HasKeypadAccessoryButton1 += joinOffset;
- KeypadAccessoryButton1Press += joinOffset;
- HasKeypadAccessoryButton2 += joinOffset;
- KeypadAccessoryButton2Press += joinOffset;
-
- Name += joinOffset;
- KeypadAccessoryButton1Label += joinOffset;
- KeypadAccessoryButton2Label += joinOffset;
-
- LoadPresets += joinOffset;
- }
-
- }
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Crestron.SimplSharp;
+using PepperDash.Essentials.Core;
+using Crestron.SimplSharp.Reflection;
+
+
+namespace PepperDash.Essentials.Bridges
+{
+ [Obsolete("Please use version PepperDash.Essentials.Core.Bridges")]
+ public class SetTopBoxControllerJoinMap : JoinMapBase
+ {
+ #region Digitals
+ public uint DvrList { get; set; } //
+ public uint Replay { get; set; }
+ public uint Up { get; set; } //
+ public uint Down { get; set; } //
+ public uint Left { get; set; } //
+ public uint Right { get; set; } //
+ public uint Select { get; set; } //
+ public uint Menu { get; set; } //
+ public uint Exit { get; set; } //
+ public uint Digit0 { get; set; } //
+ public uint Digit1 { get; set; } //
+ public uint Digit2 { get; set; } //
+ public uint Digit3 { get; set; } //
+ public uint Digit4 { get; set; } //
+ public uint Digit5 { get; set; } //
+ public uint Digit6 { get; set; } //
+ public uint Digit7 { get; set; } //
+ public uint Digit8 { get; set; } //
+ public uint Digit9 { get; set; } //
+ public uint Dash { get; set; } //
+ public uint KeypadEnter { get; set; } //
+ public uint ChannelUp { get; set; } //
+ public uint ChannelDown { get; set; } //
+ public uint LastChannel { get; set; } //
+ public uint Guide { get; set; } //
+ public uint Info { get; set; } //
+ public uint Red { get; set; } //
+ public uint Green { get; set; } //
+ public uint Yellow { get; set; } //
+ public uint Blue { get; set; } //
+ public uint ChapMinus { get; set; }
+ public uint ChapPlus { get; set; }
+ public uint FFwd { get; set; } //
+ public uint Pause { get; set; } //
+ public uint Play { get; set; } //
+ public uint Record { get; set; }
+ public uint Rewind { get; set; } //
+ public uint Stop { get; set; } //
+
+ public uint PowerOn { get; set; } //
+ public uint PowerOff { get; set; } //
+ public uint PowerToggle { get; set; } //
+
+ public uint HasKeypadAccessoryButton1 { get; set; }
+ public uint HasKeypadAccessoryButton2 { get; set; }
+
+ public uint KeypadAccessoryButton1Press { get; set; }
+ public uint KeypadAccessoryButton2Press { get; set; }
+
+
+ public uint HasDvr { get; set; }
+ public uint HasPresets { get; set; }
+ public uint HasNumeric { get; set; }
+ public uint HasDpad { get; set; }
+
+
+ #endregion
+
+ #region Analogs
+
+ #endregion
+
+ #region Strings
+ public uint Name { get; set; }
+ public uint LoadPresets { get; set; }
+ public uint KeypadAccessoryButton1Label { get; set; }
+ public uint KeypadAccessoryButton2Label { get; set; }
+
+ #endregion
+
+ public SetTopBoxControllerJoinMap()
+ {
+ PowerOn = 1;
+ PowerOff = 2;
+ PowerToggle = 3;
+
+ HasDpad = 4;
+ Up = 4;
+ Down = 5;
+ Left = 6;
+ Right = 7;
+ Select = 8;
+ Menu = 9;
+ Exit = 10;
+
+ HasNumeric = 11;
+ Digit0 = 11;
+ Digit1 = 12;
+ Digit2 = 13;
+ Digit3 = 14;
+ Digit4 = 15;
+ Digit5 = 16;
+ Digit6 = 17;
+ Digit7 = 18;
+ Digit8 = 19;
+ Digit9 = 20;
+ Dash = 21;
+ KeypadEnter = 22;
+ ChannelUp = 23;
+ ChannelDown = 24;
+ LastChannel = 25;
+
+ Guide = 26;
+ Info = 27;
+ Red = 28;
+ Green = 29;
+ Yellow = 30;
+ Blue = 31;
+
+ HasDvr = 32;
+ DvrList = 32;
+ Play = 33;
+ Pause = 34;
+ Stop = 35;
+ FFwd = 36;
+ Rewind = 37;
+ ChapPlus = 38;
+ ChapMinus = 39;
+ Replay = 40;
+ Record = 41;
+ HasKeypadAccessoryButton1 = 42;
+ KeypadAccessoryButton1Press = 42;
+ HasKeypadAccessoryButton2 = 43;
+ KeypadAccessoryButton2Press = 43;
+
+ Name = 1;
+ KeypadAccessoryButton1Label = 42;
+ KeypadAccessoryButton2Label = 43;
+
+ LoadPresets = 50;
+ }
+
+ public override void OffsetJoinNumbers(uint joinStart)
+ {
+ var joinOffset = joinStart - 1;
+
+ PowerOn += joinOffset;
+ PowerOff += joinOffset;
+ PowerToggle += joinOffset;
+
+ HasDpad += joinOffset;
+ Up += joinOffset;
+ Down += joinOffset;
+ Left += joinOffset;
+ Right += joinOffset;
+ Select += joinOffset;
+ Menu += joinOffset;
+ Exit += joinOffset;
+
+ HasNumeric += joinOffset;
+ Digit0 += joinOffset;
+ Digit1 += joinOffset;
+ Digit2 += joinOffset;
+ Digit3 += joinOffset;
+ Digit4 += joinOffset;
+ Digit5 += joinOffset;
+ Digit6 += joinOffset;
+ Digit7 += joinOffset;
+ Digit8 += joinOffset;
+ Digit9 += joinOffset;
+ Dash += joinOffset;
+ KeypadEnter += joinOffset;
+ ChannelUp += joinOffset;
+ ChannelDown += joinOffset;
+ LastChannel += joinOffset;
+
+ Guide += joinOffset;
+ Info += joinOffset;
+ Red += joinOffset;
+ Green += joinOffset;
+ Yellow += joinOffset;
+ Blue += joinOffset;
+
+ HasDvr += joinOffset;
+ DvrList += joinOffset;
+ Play += joinOffset;
+ Pause += joinOffset;
+ Stop += joinOffset;
+ FFwd += joinOffset;
+ Rewind += joinOffset;
+ ChapPlus += joinOffset;
+ ChapMinus += joinOffset;
+ Replay += joinOffset;
+ Record += joinOffset;
+ HasKeypadAccessoryButton1 += joinOffset;
+ KeypadAccessoryButton1Press += joinOffset;
+ HasKeypadAccessoryButton2 += joinOffset;
+ KeypadAccessoryButton2Press += joinOffset;
+
+ Name += joinOffset;
+ KeypadAccessoryButton1Label += joinOffset;
+ KeypadAccessoryButton2Label += joinOffset;
+
+ LoadPresets += joinOffset;
+ }
+
+ }
}
\ No newline at end of file
diff --git a/PepperDashEssentials/Bridges/JoinMaps/StatusSignControllerJoinMap.cs b/PepperDashEssentials/Bridges/JoinMaps/StatusSignControllerJoinMap.cs
index d3a95383..3d8916a7 100644
--- a/PepperDashEssentials/Bridges/JoinMaps/StatusSignControllerJoinMap.cs
+++ b/PepperDashEssentials/Bridges/JoinMaps/StatusSignControllerJoinMap.cs
@@ -1,49 +1,51 @@
-using System.Linq;
-using Crestron.SimplSharp.Reflection;
-using PepperDash.Essentials.Core;
-
-namespace PepperDash.Essentials.Bridges
-{
- public class StatusSignControllerJoinMap:JoinMapBase
- {
- public uint IsOnline { get; set; }
- public uint Name { get; set; }
- public uint RedLed { get; set; }
- public uint GreenLed { get; set; }
- public uint BlueLed { get; set; }
- public uint RedControl { get; set; }
- public uint GreenControl { get; set; }
- public uint BlueControl { get; set; }
-
- public StatusSignControllerJoinMap()
- {
- //digital
- IsOnline = 1;
- RedControl = 2;
- GreenControl = 3;
- BlueControl = 4;
-
- //Analog
- RedLed = 2;
- GreenLed = 3;
- BlueLed = 4;
-
- //string
- Name = 1;
-
-
- }
-
- public override void OffsetJoinNumbers(uint joinStart)
- {
- var joinOffset = joinStart - 1;
- var properties =
- GetType().GetCType().GetProperties().Where(p => p.PropertyType == typeof (uint)).ToList();
-
- foreach (var propertyInfo in properties)
- {
- propertyInfo.SetValue(this, (uint) propertyInfo.GetValue(this, null) + joinOffset, null);
- }
- }
- }
+using System;
+using System.Linq;
+using Crestron.SimplSharp.Reflection;
+using PepperDash.Essentials.Core;
+
+namespace PepperDash.Essentials.Bridges
+{
+ [Obsolete("Please use version PepperDash.Essentials.Core.Bridges")]
+ public class StatusSignControllerJoinMap:JoinMapBase
+ {
+ public uint IsOnline { get; set; }
+ public uint Name { get; set; }
+ public uint RedLed { get; set; }
+ public uint GreenLed { get; set; }
+ public uint BlueLed { get; set; }
+ public uint RedControl { get; set; }
+ public uint GreenControl { get; set; }
+ public uint BlueControl { get; set; }
+
+ public StatusSignControllerJoinMap()
+ {
+ //digital
+ IsOnline = 1;
+ RedControl = 2;
+ GreenControl = 3;
+ BlueControl = 4;
+
+ //Analog
+ RedLed = 2;
+ GreenLed = 3;
+ BlueLed = 4;
+
+ //string
+ Name = 1;
+
+
+ }
+
+ public override void OffsetJoinNumbers(uint joinStart)
+ {
+ var joinOffset = joinStart - 1;
+ var properties =
+ GetType().GetCType().GetProperties().Where(p => p.PropertyType == typeof (uint)).ToList();
+
+ foreach (var propertyInfo in properties)
+ {
+ propertyInfo.SetValue(this, (uint) propertyInfo.GetValue(this, null) + joinOffset, null);
+ }
+ }
+ }
}
\ No newline at end of file
diff --git a/PepperDashEssentials/Bridges/JoinMaps/SystemMonitorJoinMap.cs b/PepperDashEssentials/Bridges/JoinMaps/SystemMonitorJoinMap.cs
index b2b66263..fe59416a 100644
--- a/PepperDashEssentials/Bridges/JoinMaps/SystemMonitorJoinMap.cs
+++ b/PepperDashEssentials/Bridges/JoinMaps/SystemMonitorJoinMap.cs
@@ -1,7 +1,9 @@
-using PepperDash.Essentials.Core;
+using System;
+using PepperDash.Essentials.Core;
namespace PepperDash.Essentials.Bridges
{
+ [Obsolete("Please use version PepperDash.Essentials.Core.Bridges")]
public class SystemMonitorJoinMap : JoinMapBase
{
///
diff --git a/PepperDashEssentials/Bridges/StatusSignControllerBridge.cs b/PepperDashEssentials/Bridges/StatusSignControllerBridge.cs
index 860f070d..0b35677d 100644
--- a/PepperDashEssentials/Bridges/StatusSignControllerBridge.cs
+++ b/PepperDashEssentials/Bridges/StatusSignControllerBridge.cs
@@ -4,7 +4,7 @@ using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.CrestronIO;
-namespace PepperDash.Essentials.Bridges
+namespace PepperDash.Essentials.Core.Bridges
{
public static class StatusSignDeviceApiExtensions
{
diff --git a/PepperDashEssentials/Bridges/SystemMonitorBridge.cs b/PepperDashEssentials/Bridges/SystemMonitorBridge.cs
index d048b493..5999c500 100644
--- a/PepperDashEssentials/Bridges/SystemMonitorBridge.cs
+++ b/PepperDashEssentials/Bridges/SystemMonitorBridge.cs
@@ -6,7 +6,7 @@ using PepperDash.Essentials.Core.Monitoring;
using Newtonsoft.Json;
-namespace PepperDash.Essentials.Bridges
+namespace PepperDash.Essentials.Core.Bridges
{
public static class SystemMonitorBridge
{
diff --git a/PepperDashEssentials/ControlSystem.cs b/PepperDashEssentials/ControlSystem.cs
index cffaeca2..5e9049ef 100644
--- a/PepperDashEssentials/ControlSystem.cs
+++ b/PepperDashEssentials/ControlSystem.cs
@@ -10,6 +10,7 @@ using Crestron.SimplSharp.Reflection;
using PepperDash.Core;
using PepperDash.Essentials.Core;
+using PepperDash.Essentials.Core.Bridges;
using PepperDash.Essentials.Core.Config;
using PepperDash.Essentials.Devices.Common;
using PepperDash.Essentials.DM;
@@ -26,6 +27,8 @@ namespace PepperDash.Essentials
{
HttpLogoServer LogoServer;
+ private CTimer _startTimer;
+ private const long StartupTime = 500;
public ControlSystem()
: base()
@@ -39,6 +42,11 @@ namespace PepperDash.Essentials
/// Entry point for the program
///
public override void InitializeSystem()
+ {
+ _startTimer = new CTimer(StartSystem,StartupTime);
+ }
+
+ private void StartSystem(object obj)
{
DeterminePlatform();
@@ -52,7 +60,7 @@ namespace PepperDash.Essentials
CrestronConsole.AddNewConsoleCommand(PepperDash.Essentials.Core.DeviceFactory.GetDeviceFactoryTypes, "gettypes", "Gets the device types that can be built. Accepts a filter string.", ConsoleAccessLevelEnum.AccessOperator);
- CrestronConsole.AddNewConsoleCommand(PepperDash.Essentials.Bridges.BridgeHelper.PrintJoinMap, "getjoinmap", "map(s) for bridge or device on bridge [brKey [devKey]]", ConsoleAccessLevelEnum.AccessOperator);
+ CrestronConsole.AddNewConsoleCommand(BridgeHelper.PrintJoinMap, "getjoinmap", "map(s) for bridge or device on bridge [brKey [devKey]]", ConsoleAccessLevelEnum.AccessOperator);
CrestronConsole.AddNewConsoleCommand(s =>
{
@@ -75,18 +83,17 @@ namespace PepperDash.Essentials
}, "showconfig", "Shows the current running merged config", ConsoleAccessLevelEnum.AccessOperator);
CrestronConsole.AddNewConsoleCommand(s =>
- {
- CrestronConsole.ConsoleCommandResponse("This system can be found at the following URLs:\r" +
- "System URL: {0}\r" +
- "Template URL: {1}", ConfigReader.ConfigObject.SystemUrl, ConfigReader.ConfigObject.TemplateUrl);
- }, "portalinfo", "Shows portal URLS from configuration", ConsoleAccessLevelEnum.AccessOperator);
+ {
+ CrestronConsole.ConsoleCommandResponse("This system can be found at the following URLs:\r" +
+ "System URL: {0}\r" +
+ "Template URL: {1}", ConfigReader.ConfigObject.SystemUrl, ConfigReader.ConfigObject.TemplateUrl);
+ }, "portalinfo", "Shows portal URLS from configuration", ConsoleAccessLevelEnum.AccessOperator);
+
if (!Debug.DoNotLoadOnNextBoot)
GoWithLoad();
}
-
-
///
/// Determines if the program is running on a processor (appliance) or server (VC-4).
///
@@ -162,13 +169,18 @@ namespace PepperDash.Essentials
public void GoWithLoad()
{
try
- {
+ {
Debug.SetDoNotLoadOnNextBoot(false);
- Debug.Console(0, Debug.ErrorLogLevel.Notice, "Starting Essentials load from configuration");
-
PluginLoader.AddProgramAssemblies();
+ new Core.DeviceFactory();
+ new Devices.Common.DeviceFactory();
+ new DM.DeviceFactory();
+ new DeviceFactory();
+
+ Debug.Console(0, Debug.ErrorLogLevel.Notice, "Starting Essentials load from configuration");
+
var filesReady = SetupFilesystem();
if (filesReady)
{
@@ -296,9 +308,6 @@ namespace PepperDash.Essentials
///
public void LoadDevices()
{
- // Instantiate the Device Factories
- new CoreDeviceFactory();
-
// Build the processor wrapper class
DeviceManager.AddDevice(new PepperDash.Essentials.Core.Devices.CrestronProcessor("processor"));
@@ -362,33 +371,15 @@ namespace PepperDash.Essentials
}
// Try local factories first
- var newDev = DeviceFactory.GetDevice(devConf);
+ IKeyed newDev = null;
- if (newDev == null)
- newDev = BridgeFactory.GetDevice(devConf);
-
- // Then associated library factories
if (newDev == null)
newDev = PepperDash.Essentials.Core.DeviceFactory.GetDevice(devConf);
- if (newDev == null)
- newDev = PepperDash.Essentials.Devices.Common.DeviceFactory.GetDevice(devConf);
- if (newDev == null)
- newDev = PepperDash.Essentials.DM.DeviceFactory.GetDevice(devConf);
- if (newDev == null)
- newDev = PepperDash.Essentials.Devices.Displays.DisplayDeviceFactory.GetDevice(devConf);
- //if (newDev == null) // might want to consider the ability to override an essentials "type"
- //{
- // // iterate plugin factories
- // foreach (var f in FactoryObjects)
- // {
- // var cresFactory = f as IGetCrestronDevice;
- // if (cresFactory != null)
- // {
- // newDev = cresFactory.GetDevice(devConf, this);
- // }
- // }
- //}
+ //
+ //if (newDev == null)
+ // newDev = PepperDash.Essentials.Devices.Displays.DisplayDeviceFactory.GetDevice(devConf);
+ //
if (newDev != null)
DeviceManager.AddDevice(newDev);
diff --git a/PepperDashEssentials/Devices/Amplifier.cs b/PepperDashEssentials/Devices/Amplifier.cs
index 20d8efa0..b2725109 100644
--- a/PepperDashEssentials/Devices/Amplifier.cs
+++ b/PepperDashEssentials/Devices/Amplifier.cs
@@ -6,11 +6,12 @@ using Crestron.SimplSharp;
using PepperDash.Core;
using PepperDash.Essentials.Core;
+using PepperDash.Essentials.Core.Config;
using PepperDash.Essentials.Core.Routing;
namespace PepperDash.Essentials
{
- public class Amplifier : Device, IRoutingSinkNoSwitching
+ public class Amplifier : EssentialsDevice, IRoutingSinkNoSwitching
{
public event SourceInfoChangeHandler CurrentSourceChange;
@@ -54,4 +55,18 @@ namespace PepperDash.Essentials
#endregion
}
+
+ public class AmplifierFactory : EssentialsDeviceFactory
+ {
+ public AmplifierFactory()
+ {
+ TypeNames = new List() { "amplifier" };
+ }
+
+ public override EssentialsDevice BuildDevice(DeviceConfig dc)
+ {
+ Debug.Console(1, "Factory Attempting to create new Amplifier Device");
+ return new Amplifier(dc.Key, dc.Name);
+ }
+ }
}
\ No newline at end of file
diff --git a/PepperDashEssentials/Factory/DeviceFactory.cs b/PepperDashEssentials/Factory/DeviceFactory.cs
index afbc31f0..5b15f28c 100644
--- a/PepperDashEssentials/Factory/DeviceFactory.cs
+++ b/PepperDashEssentials/Factory/DeviceFactory.cs
@@ -4,94 +4,45 @@ using System.Linq;
using Crestron.SimplSharp;
using Crestron.SimplSharp.CrestronIO;
using Crestron.SimplSharpPro;
+using Crestron.SimplSharp.Reflection;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Config;
+using PepperDash.Essentials.Room.MobileControl;
namespace PepperDash.Essentials
{
- public class DeviceFactory
- {
- public static IKeyed GetDevice(DeviceConfig dc)
- {
- var key = dc.Key;
- var name = dc.Name;
- var type = dc.Type;
- var properties = dc.Properties;
+ ///
+ /// Responsible for loading all of the device types for this library
+ ///
+ public class DeviceFactory
+ {
- var typeName = dc.Type.ToLower();
+ public DeviceFactory()
+ {
+ var assy = Assembly.GetExecutingAssembly();
+ PluginLoader.SetEssentialsAssembly(assy.GetName().Name, assy);
- if (typeName == "amplifier")
+ var types = assy.GetTypes().Where(ct => typeof(IDeviceFactory).IsAssignableFrom(ct) && !ct.IsInterface && !ct.IsAbstract);
+
+ if (types != null)
{
- return new Amplifier(dc.Key, dc.Name);
- }
- else if (dc.Group.ToLower() == "touchpanel") // typeName.StartsWith("tsw"))
- {
- return UiDeviceFactory.GetUiDevice(dc);
+ 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);
+ }
+ }
}
-
- else if (typeName == "mockdisplay")
- {
- return new MockDisplay(key, name);
- }
-
- else if (typeName == "generic")
- {
- return new Device(key, name);
- }
-
- //// MOVE into something else???
- //else if (typeName == "basicirdisplay")
- //{
- // var ir = IRPortHelper.GetIrPort(properties);
- // if (ir != null)
- // return new BasicIrDisplay(key, name, ir.Port, ir.FileName);
- //}
-
- else if (typeName == "commmock")
- {
- var comm = CommFactory.CreateCommForDevice(dc);
- var props = JsonConvert.DeserializeObject(
- properties.ToString());
- return new ConsoleCommMockDevice(key, name, props, comm);
- }
-
- //else if (typeName == "appserver")
- //{
- // var props = JsonConvert.DeserializeObject(properties.ToString());
- // return new MobileControlSystemController(key, name, props);
- //}
-
- //else if (typeName == "mobilecontrolbridge-ddvc01")
- //{
- // var comm = CommFactory.GetControlPropertiesConfig(dc);
-
- // var bridge = new PepperDash.Essentials.Room.MobileControl.MobileControlSIMPLRoomBridge(key, name, comm.IpIdInt);
- // bridge.AddPreActivationAction(() =>
- // {
- // var parent = DeviceManager.AllDevices.FirstOrDefault(d => d.Key == "appServer") as MobileControlSystemController;
- // if (parent == null)
- // {
- // Debug.Console(0, bridge, "ERROR: Cannot connect bridge. System controller not present");
- // }
- // Debug.Console(0, bridge, "Linking to parent controller");
- // bridge.AddParent(parent);
- // parent.AddBridge(bridge);
- // });
-
- // return bridge;
- //}
-
- else if (typeName == "roomonwhenoccupancydetectedfeature")
- {
- return new RoomOnToDefaultSourceWhenOccupied(dc);
- }
-
- return null;
- }
- }
-
+ }
+ }
}
diff --git a/PepperDashEssentials/Factory/UiDeviceFactory.cs b/PepperDashEssentials/Factory/UiDeviceFactory.cs
deleted file mode 100644
index 6176b6d1..00000000
--- a/PepperDashEssentials/Factory/UiDeviceFactory.cs
+++ /dev/null
@@ -1,191 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Crestron.SimplSharp;
-using Crestron.SimplSharpPro;
-using Crestron.SimplSharpPro.DeviceSupport;
-using Crestron.SimplSharpPro.UI;
-
-using Newtonsoft.Json;
-using Newtonsoft.Json.Linq;
-using PepperDash.Core;
-using PepperDash.Essentials.Core;
-using PepperDash.Essentials.Core.Config;
-using PepperDash.Essentials.Core.PageManagers;
-using PepperDash.Essentials.DM.Endpoints.DGEs;
-
-
-namespace PepperDash.Essentials
-{
- public class UiDeviceFactory
- {
- public static IKeyed GetUiDevice(DeviceConfig config)
- {
- var comm = CommFactory.GetControlPropertiesConfig(config);
-
- var typeName = config.Type.ToLower();
-
- EssentialsTouchpanelController panelController = null;
-
- var props = JsonConvert.DeserializeObject(config.Properties.ToString());
-
- if (typeName.Contains("dge"))
- {
- Dge100 dgeDevice = null;
- if (typeName == "dge100")
- dgeDevice = new Dge100(comm.IpIdInt, Global.ControlSystem);
- else if (typeName == "dmdge200c")
- dgeDevice = new DmDge200C(comm.IpIdInt, Global.ControlSystem);
-
- if (dgeDevice == null)
- {
- Debug.Console(1, "Unable to create DGE device");
- return null;
- }
-
- var dgeController = new DgeController(config.Key + "-comPorts", config.Name, dgeDevice, config, props);
-
- DeviceManager.AddDevice(dgeController);
-
- panelController = new EssentialsTouchpanelController(config.Key, config.Name, dgeController.DigitalGraphicsEngine,
- props.ProjectName, props.SgdFile);
- }
- else
- {
- panelController = new EssentialsTouchpanelController(config.Key, config.Name, config.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)
- {
-
- // 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 EssentialsPresentationRoom)
- //{
- // Debug.Console(0, panelController, "Adding presentation room driver");
- // var avDriver = new EssentialsPresentationPanelAvFunctionsDriver(mainDriver, props);
- // avDriver.CurrentRoom = room as EssentialsPresentationRoom;
- // avDriver.DefaultRoomKey = props.DefaultRoomKey;
- // mainDriver.AvDriver = avDriver ;
- // mainDriver.HeaderDriver = new EssentialsHeaderDriver(mainDriver, props);
- // panelController.LoadAndShowDriver(mainDriver);
-
- // 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(); });
- // 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");
-
- // 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;
- }
-
- }
-}
\ No newline at end of file
diff --git a/PepperDashEssentials/PepperDashEssentials.csproj b/PepperDashEssentials/PepperDashEssentials.csproj
index 4fc16600..c522b52e 100644
--- a/PepperDashEssentials/PepperDashEssentials.csproj
+++ b/PepperDashEssentials/PepperDashEssentials.csproj
@@ -109,35 +109,15 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
@@ -145,19 +125,17 @@
+
+
-
-
-
-
diff --git a/PepperDashEssentials/UI/EssentialsTouchpanelController.cs b/PepperDashEssentials/UI/EssentialsTouchpanelController.cs
index df1ecdce..eade64bd 100644
--- a/PepperDashEssentials/UI/EssentialsTouchpanelController.cs
+++ b/PepperDashEssentials/UI/EssentialsTouchpanelController.cs
@@ -9,11 +9,12 @@ using Crestron.SimplSharpPro.DeviceSupport;
using Crestron.SimplSharpPro.UI;
using PepperDash.Core;
using PepperDash.Essentials.Core;
+using PepperDash.Essentials.Core.Config;
using PepperDash.Essentials.Core.PageManagers;
namespace PepperDash.Essentials
{
- public class EssentialsTouchpanelController : Device, IHasBasicTriListWithSmartObject
+ public class EssentialsTouchpanelController : EssentialsDevice, IHasBasicTriListWithSmartObject
{
public BasicTriListWithSmartObject Panel { get; private set; }
@@ -197,4 +198,132 @@ namespace PepperDash.Essentials
(uo as Action)(args.Button.State == eButtonState.Pressed);
}
}
+
+ public class EssentialsTouchpanelControllerFactory : EssentialsDeviceFactory
+ {
+ public EssentialsTouchpanelControllerFactory()
+ {
+ TypeNames = new List() { "tsw550", "tsw750", "tsw1050", "tsw560", "tsw760", "tsw1060", "xpanel" };
+ }
+
+ public override EssentialsDevice BuildDevice(DeviceConfig dc)
+ {
+ var comm = CommFactory.GetControlPropertiesConfig(dc);
+ var props = Newtonsoft.Json.JsonConvert.DeserializeObject(dc.Properties.ToString());
+
+ Debug.Console(1, "Factory Attempting to create new EssentialsTouchpanelController");
+
+ 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)
+ {
+
+ // 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");
+
+ // 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;
+ }
+ }
}
\ 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
new file mode 100644
index 00000000..5bde418f
--- /dev/null
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/BridgeBase.cs
@@ -0,0 +1,309 @@
+using System;
+using System.Collections.Generic;
+using Crestron.SimplSharp.Reflection;
+using Crestron.SimplSharpPro;
+using Crestron.SimplSharpPro.EthernetCommunication;
+
+using Newtonsoft.Json;
+
+using PepperDash.Core;
+using PepperDash.Essentials.Core;
+using PepperDash.Essentials.Core.Config;
+
+//using PepperDash.Essentials.Devices.Common.Cameras;
+
+namespace PepperDash.Essentials.Core.Bridges
+{
+ ///
+ /// Helper methods for bridges
+ ///
+ public static class BridgeHelper
+ {
+ public static void PrintJoinMap(string command)
+ {
+ var targets = command.Split(' ');
+
+ var bridgeKey = targets[0].Trim();
+
+ var bridge = DeviceManager.GetDeviceForKey(bridgeKey) as EiscApiAdvanced;
+
+ if (bridge == null)
+ {
+ Debug.Console(0, "Unable to find advanced bridge with key: '{0}'", bridgeKey);
+ return;
+ }
+
+ if (targets.Length > 1)
+ {
+ var deviceKey = targets[1].Trim();
+
+ if (string.IsNullOrEmpty(deviceKey)) return;
+ bridge.PrintJoinMapForDevice(deviceKey);
+ }
+ else
+ {
+ bridge.PrintJoinMaps();
+ }
+ }
+ }
+
+
+ ///
+ /// Base class for all bridge class variants
+ ///
+ public class BridgeBase : EssentialsDevice
+ {
+ public BridgeApi Api { get; protected set; }
+
+ public BridgeBase(string key) :
+ base(key)
+ {
+
+ }
+ }
+
+ ///
+ /// Base class for bridge API variants
+ ///
+ public abstract class BridgeApi : EssentialsDevice
+ {
+ protected BridgeApi(string key) :
+ base(key)
+ {
+
+ }
+ }
+
+ ///
+ /// Bridge API using EISC
+ ///
+ public class EiscApiAdvanced : BridgeApi
+ {
+ public EiscApiPropertiesConfig PropertiesConfig { get; private set; }
+
+ protected Dictionary JoinMaps { get; private set; }
+
+ public ThreeSeriesTcpIpEthernetIntersystemCommunications Eisc { get; private set; }
+
+ public EiscApiAdvanced(DeviceConfig dc) :
+ base(dc.Key)
+ {
+ JoinMaps = new Dictionary();
+
+ PropertiesConfig = dc.Properties.ToObject();
+ //PropertiesConfig = JsonConvert.DeserializeObject(dc.Properties.ToString());
+
+ Eisc = new ThreeSeriesTcpIpEthernetIntersystemCommunications(PropertiesConfig.Control.IpIdInt, PropertiesConfig.Control.TcpSshProperties.Address, Global.ControlSystem);
+
+ Eisc.SigChange += Eisc_SigChange;
+
+ Eisc.Register();
+
+ AddPostActivationAction( () =>
+ {
+ Debug.Console(1, this, "Linking Devices...");
+
+ foreach (var d in PropertiesConfig.Devices)
+ {
+ var device = DeviceManager.GetDeviceForKey(d.DeviceKey);
+
+ if (device == null) continue;
+
+ Debug.Console(1, this, "Linking Device: '{0}'", device.Key);
+ //if (device is IBridge) // Check for this first to allow bridges in plugins to override existing bridges that apply to the same type.
+ //{
+ // Debug.Console(2, this, "'{0}' is IBridge", device.Key);
+ //}
+ if (!typeof (IBridgeAdvanced).IsAssignableFrom(device.GetType().GetCType()))
+ {
+ continue;
+ }
+
+ var bridge = device as IBridgeAdvanced;
+ if (bridge != null) bridge.LinkToApi(Eisc, d.JoinStart, d.JoinMapKey, this);
+ }
+
+
+ });
+ }
+
+ ///
+ /// Adds a join map
+ ///
+ ///
+ ///
+ public void AddJoinMap(string deviceKey, JoinMapBaseAdvanced joinMap)
+ {
+ if (!JoinMaps.ContainsKey(deviceKey))
+ {
+ JoinMaps.Add(deviceKey, joinMap);
+ }
+ else
+ {
+ Debug.Console(2, this, "Unable to add join map with key '{0}'. Key already exists in JoinMaps dictionary", deviceKey);
+ }
+ }
+
+ ///
+ /// Prints all the join maps on this bridge
+ ///
+ public void PrintJoinMaps()
+ {
+ Debug.Console(0, this, "Join Maps for EISC IPID: {0}", Eisc.ID.ToString("X"));
+
+ foreach (var joinMap in JoinMaps)
+ {
+ Debug.Console(0, "Join map for device '{0}':", joinMap.Key);
+ joinMap.Value.PrintJoinMapInfo();
+ }
+ }
+
+ ///
+ /// Prints the join map for a device by key
+ ///
+ ///
+ public void PrintJoinMapForDevice(string deviceKey)
+ {
+ var joinMap = JoinMaps[deviceKey];
+
+ if (joinMap == null)
+ {
+ Debug.Console(0, this, "Unable to find joinMap for device with key: '{0}'", deviceKey);
+ return;
+ }
+
+ Debug.Console(0, "Join map for device '{0}' on EISC '{1}':", deviceKey, Key);
+ joinMap.PrintJoinMapInfo();
+ }
+
+ ///
+ /// Used for debugging to trigger an action based on a join number and type
+ ///
+ ///
+ ///
+ ///
+ public void ExecuteJoinAction(uint join, string type, object state)
+ {
+ try
+ {
+ switch (type.ToLower())
+ {
+ case "digital":
+ {
+ var uo = Eisc.BooleanOutput[join].UserObject as Action;
+ if (uo != null)
+ {
+ Debug.Console(1, this, "Executing Action: {0}", uo.ToString());
+ uo(Convert.ToBoolean(state));
+ }
+ else
+ Debug.Console(1, this, "User Action is null. Nothing to Execute");
+ break;
+ }
+ case "analog":
+ {
+ var uo = Eisc.BooleanOutput[join].UserObject as Action;
+ if (uo != null)
+ {
+ Debug.Console(1, this, "Executing Action: {0}", uo.ToString());
+ uo(Convert.ToUInt16(state));
+ }
+ else
+ Debug.Console(1, this, "User Action is null. Nothing to Execute"); break;
+ }
+ case "serial":
+ {
+ var uo = Eisc.BooleanOutput[join].UserObject as Action;
+ if (uo != null)
+ {
+ Debug.Console(1, this, "Executing Action: {0}", uo.ToString());
+ uo(Convert.ToString(state));
+ }
+ else
+ Debug.Console(1, this, "User Action is null. Nothing to Execute");
+ break;
+ }
+ default:
+ {
+ Debug.Console(1, "Unknown join type. Use digital/serial/analog");
+ break;
+ }
+ }
+ }
+ catch (Exception e)
+ {
+ Debug.Console(1, this, "Error: {0}", e);
+ }
+
+ }
+
+ ///
+ /// Handles incoming sig changes
+ ///
+ ///
+ ///
+ void Eisc_SigChange(object currentDevice, SigEventArgs args)
+ {
+ try
+ {
+ if (Debug.Level >= 1)
+ Debug.Console(1, this, "EiscApiAdvanced change: {0} {1}={2}", args.Sig.Type, args.Sig.Number, args.Sig.StringValue);
+ var uo = args.Sig.UserObject;
+
+ if (uo == null) return;
+
+ Debug.Console(1, this, "Executing Action: {0}", uo.ToString());
+ if (uo is Action)
+ (uo as Action)(args.Sig.BoolValue);
+ else if (uo is Action)
+ (uo as Action)(args.Sig.UShortValue);
+ else if (uo is Action)
+ (uo as Action)(args.Sig.StringValue);
+ }
+ catch (Exception e)
+ {
+ Debug.Console(2, this, "Error in Eisc_SigChange handler: {0}", e);
+ }
+ }
+ }
+
+ public class EiscApiPropertiesConfig
+ {
+ [JsonProperty("control")]
+ public EssentialsControlPropertiesConfig Control { get; set; }
+
+ [JsonProperty("devices")]
+ public List Devices { get; set; }
+
+
+ public class ApiDevicePropertiesConfig
+ {
+ [JsonProperty("deviceKey")]
+ public string DeviceKey { 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" };
+ }
+
+ public override EssentialsDevice BuildDevice(DeviceConfig dc)
+ {
+ Debug.Console(1, "Factory Attempting to create new EiscApiAdvanced Device");
+
+ return new EiscApiAdvanced(dc);
+
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/IBridge.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/IBridge.cs
new file mode 100644
index 00000000..1f10e554
--- /dev/null
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/IBridge.cs
@@ -0,0 +1,13 @@
+using System;
+using Crestron.SimplSharpPro.DeviceSupport;
+
+namespace PepperDash.Essentials.Core.Bridges
+{
+ ///
+ /// Defines a device that uses JoinMapBaseAdvanced for its join map
+ ///
+ public interface IBridgeAdvanced
+ {
+ void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge);
+ }
+}
\ No newline at end of file
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/AirMediaControllerJoinMap.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/AirMediaControllerJoinMap.cs
new file mode 100644
index 00000000..c9a6c2b2
--- /dev/null
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/AirMediaControllerJoinMap.cs
@@ -0,0 +1,66 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Crestron.SimplSharp;
+using PepperDash.Essentials.Core;
+
+namespace PepperDash.Essentials.Core.Bridges
+{
+ public class AirMediaControllerJoinMap : JoinMapBaseAdvanced
+ {
+ [JoinName("IsOnline")]
+ public JoinDataComplete IsOnline = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Air Media Online", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("IsInSession")]
+ public JoinDataComplete IsInSession = new JoinDataComplete(new JoinData() { JoinNumber = 2, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Air Media In Sharing Session", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("HdmiVideoSync")]
+ public JoinDataComplete HdmiVideoSync = new JoinDataComplete(new JoinData() { JoinNumber = 3, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Air Media Has HDMI Video Sync", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("AutomaticInputRoutingEnabled")]
+ public JoinDataComplete AutomaticInputRoutingEnabled = new JoinDataComplete(new JoinData() { JoinNumber = 4, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Air Media Automatic Input Routing Enable(d)", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("VideoOut")]
+ public JoinDataComplete VideoOut = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Air Media Video Route Select / Feedback", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
+
+ [JoinName("ErrorFB")]
+ public JoinDataComplete ErrorFB = new JoinDataComplete(new JoinData() { JoinNumber = 2, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Air Media Error Status", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Analog });
+
+ [JoinName("NumberOfUsersConnectedFB")]
+ public JoinDataComplete NumberOfUsersConnectedFB = new JoinDataComplete(new JoinData() { JoinNumber = 3, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Air Media Number of Users Connected", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Analog });
+
+ [JoinName("LoginCode")]
+ public JoinDataComplete LoginCode = new JoinDataComplete(new JoinData() { JoinNumber = 4, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Air Media Login Code Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
+
+ [JoinName("Name")]
+ public JoinDataComplete Name = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Air Media Device Name", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
+
+ [JoinName("ConnectionAddressFB")]
+ public JoinDataComplete ConnectionAddressFB = new JoinDataComplete(new JoinData() { JoinNumber = 2, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Air Media IP Address", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
+
+ [JoinName("HostnameFB")]
+ public JoinDataComplete HostnameFB = new JoinDataComplete(new JoinData() { JoinNumber = 3, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Air Media Hostname", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
+
+ [JoinName("SerialNumberFeedback")]
+ public JoinDataComplete SerialNumberFeedback = new JoinDataComplete(new JoinData() { JoinNumber = 4, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Air Media Serial Number", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
+
+ public AirMediaControllerJoinMap(uint joinStart)
+ : base(joinStart, typeof(AirMediaControllerJoinMap))
+ {
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/AppleTvJoinMap.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/AppleTvJoinMap.cs
new file mode 100644
index 00000000..03abf902
--- /dev/null
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/AppleTvJoinMap.cs
@@ -0,0 +1,46 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Crestron.SimplSharp;
+using PepperDash.Essentials.Core;
+
+namespace PepperDash.Essentials.Core.Bridges
+{
+ public class AppleTvJoinMap : JoinMapBaseAdvanced
+ {
+ [JoinName("UpArrow")]
+ public JoinDataComplete UpArrow = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 },
+ new JoinMetadata() { Label = "AppleTv Nav Up", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("DnArrow")]
+ public JoinDataComplete DnArrow = new JoinDataComplete(new JoinData() { JoinNumber = 2, JoinSpan = 1 },
+ new JoinMetadata() { Label = "AppleTv Nav Down", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("LeftArrow")]
+ public JoinDataComplete LeftArrow = new JoinDataComplete(new JoinData() { JoinNumber = 3, JoinSpan = 1 },
+ new JoinMetadata() { Label = "AppleTv Nav Left", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("RightArrow")]
+ public JoinDataComplete RightArrow = new JoinDataComplete(new JoinData() { JoinNumber = 4, JoinSpan = 1 },
+ new JoinMetadata() { Label = "AppleTv Nav Right", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("Menu")]
+ public JoinDataComplete Menu = new JoinDataComplete(new JoinData() { JoinNumber = 5, JoinSpan = 1 },
+ new JoinMetadata() { Label = "AppleTv Menu", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("Select")]
+ public JoinDataComplete Select = new JoinDataComplete(new JoinData() { JoinNumber = 6, JoinSpan = 1 },
+ new JoinMetadata() { Label = "AppleTv Select", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("PlayPause")]
+ public JoinDataComplete PlayPause = new JoinDataComplete(new JoinData() { JoinNumber = 7, JoinSpan = 1 },
+ new JoinMetadata() { Label = "AppleTv Play/Pause", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ public AppleTvJoinMap(uint joinStart)
+ : base(joinStart, typeof(AppleTvJoinMap))
+ {
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/C2nRthsControllerJoinMap.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/C2nRthsControllerJoinMap.cs
new file mode 100644
index 00000000..50429332
--- /dev/null
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/C2nRthsControllerJoinMap.cs
@@ -0,0 +1,34 @@
+using System.Linq;
+using Crestron.SimplSharp.Reflection;
+using PepperDash.Essentials.Core;
+
+namespace PepperDash.Essentials.Core.Bridges
+{
+ public class C2nRthsControllerJoinMap : JoinMapBaseAdvanced
+ {
+ [JoinName("IsOnline")]
+ public JoinDataComplete IsOnline = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Temp Sensor Online", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("TemperatureFormat")]
+ public JoinDataComplete TemperatureFormat = new JoinDataComplete(new JoinData() { JoinNumber = 2, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Temp Sensor Unit Format", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("Temperature")]
+ public JoinDataComplete Temperature = new JoinDataComplete(new JoinData() { JoinNumber = 2, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Temp Sensor Temperature Feedback", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Analog });
+
+ [JoinName("Humidity")]
+ public JoinDataComplete Humidity = new JoinDataComplete(new JoinData() { JoinNumber = 3, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Temp Sensor Humidity Feedback", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Analog });
+
+ [JoinName("Name")]
+ public JoinDataComplete Name = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Temp Sensor Name", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
+
+ public C2nRthsControllerJoinMap(uint joinStart)
+ : base(joinStart, typeof(C2nRthsControllerJoinMap))
+ {
+ }
+ }
+}
\ No newline at end of file
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/CameraControllerJoinMap.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/CameraControllerJoinMap.cs
new file mode 100644
index 00000000..187978d1
--- /dev/null
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/CameraControllerJoinMap.cs
@@ -0,0 +1,64 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Crestron.SimplSharp;
+
+using PepperDash.Essentials.Core;
+
+namespace PepperDash.Essentials.Core.Bridges
+{
+ ///
+ /// Join map for CameraBase devices
+ ///
+ public class CameraControllerJoinMap : JoinMapBaseAdvanced
+ {
+ [JoinName("TiltUp")]
+ public JoinDataComplete TiltUp = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 }, new JoinMetadata() { Label = "Tilt Up", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+ [JoinName("TiltDown")]
+ public JoinDataComplete TiltDown = new JoinDataComplete(new JoinData() { JoinNumber = 2, JoinSpan = 1 }, new JoinMetadata() { Label = "Tilt Down", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+ [JoinName("PanLeft")]
+ public JoinDataComplete PanLeft = new JoinDataComplete(new JoinData() { JoinNumber = 3, JoinSpan = 1 }, new JoinMetadata() { Label = "Pan Left", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+ [JoinName("PanRight")]
+ public JoinDataComplete PanRight = new JoinDataComplete(new JoinData() { JoinNumber = 4, JoinSpan = 1 }, new JoinMetadata() { Label = "Pan Right", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+ [JoinName("ZoomIn")]
+ public JoinDataComplete ZoomIn = new JoinDataComplete(new JoinData() { JoinNumber = 5, JoinSpan = 1 }, new JoinMetadata() { Label = "Zoom In", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+ [JoinName("ZoomOut")]
+ public JoinDataComplete ZoomOut = new JoinDataComplete(new JoinData() { JoinNumber = 6, JoinSpan = 1 }, new JoinMetadata() { Label = "Zoom Out", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("IsOnline")]
+ public JoinDataComplete IsOnline = new JoinDataComplete(new JoinData() { JoinNumber = 9, JoinSpan = 1 }, new JoinMetadata() { Label = "Is Online", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
+ [JoinName("PowerOn")]
+ public JoinDataComplete PowerOn = new JoinDataComplete(new JoinData() { JoinNumber = 7, JoinSpan = 1 }, new JoinMetadata() { Label = "Power On", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
+ [JoinName("PowerOff")]
+ public JoinDataComplete PowerOff = new JoinDataComplete(new JoinData() { JoinNumber = 8, JoinSpan = 1 }, new JoinMetadata() { Label = "Power Off", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("NumberOfPresets")]
+ public JoinDataComplete NumberOfPresets = new JoinDataComplete(new JoinData() { JoinNumber = 11, JoinSpan = 1 }, new JoinMetadata() { Label = "Tells Essentials the number of defined presets", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Analog });
+ [JoinName("PresetRecallStart")]
+ public JoinDataComplete PresetRecallStart = new JoinDataComplete(new JoinData() { JoinNumber = 11, JoinSpan = 20 }, new JoinMetadata() { Label = "Preset Recall Start", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+ [JoinName("PresetLabelStart")]
+ public JoinDataComplete PresetLabelStart = new JoinDataComplete(new JoinData() { JoinNumber = 11, JoinSpan = 20 }, new JoinMetadata() { Label = "Preset Label Start", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Serial });
+ [JoinName("PresetSaveStart")]
+ public JoinDataComplete PresetSaveStart = new JoinDataComplete(new JoinData() { JoinNumber = 31, JoinSpan = 20 }, new JoinMetadata() { Label = "Preset Save Start", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("CameraModeAuto")]
+ public JoinDataComplete CameraModeAuto = new JoinDataComplete(new JoinData() { JoinNumber = 51, JoinSpan = 1 }, new JoinMetadata() { Label = "Camera Mode Auto", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
+ [JoinName("CameraModeManual")]
+ public JoinDataComplete CameraModeManual = new JoinDataComplete(new JoinData() { JoinNumber = 52, JoinSpan = 1 }, new JoinMetadata() { Label = "Camera Mode Manual", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
+ [JoinName("CameraModeOff")]
+ public JoinDataComplete CameraModeOff = new JoinDataComplete(new JoinData() { JoinNumber = 53, JoinSpan = 1 }, new JoinMetadata() { Label = "Camera Mode Off", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("SupportsCameraModeAuto")]
+ public JoinDataComplete SupportsCameraModeAuto = new JoinDataComplete(new JoinData() { JoinNumber = 55, JoinSpan = 1 }, new JoinMetadata() { Label = "Supports Camera Mode Auto", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+ [JoinName("SupportsCameraModeOff")]
+ public JoinDataComplete SupportsCameraModeOff = new JoinDataComplete(new JoinData() { JoinNumber = 56, JoinSpan = 1 }, new JoinMetadata() { Label = "Supports Camera Mode Off", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+ [JoinName("SupportsPresets")]
+ public JoinDataComplete SupportsPresets = new JoinDataComplete(new JoinData() { JoinNumber = 57, JoinSpan = 1 }, new JoinMetadata() { Label = "Supports Presets", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ public CameraControllerJoinMap(uint joinStart)
+ : base(joinStart, typeof(CameraControllerJoinMap))
+ {
+ }
+ }
+}
\ 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
new file mode 100644
index 00000000..1548f834
--- /dev/null
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/CenOdtOccupancySensorBaseJoinMap.cs
@@ -0,0 +1,182 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Crestron.SimplSharp;
+using PepperDash.Essentials.Core;
+
+namespace PepperDash.Essentials.Core.Bridges
+{
+ public class CenOdtOccupancySensorBaseJoinMap : JoinMapBaseAdvanced
+ {
+ #region Digitals
+
+ [JoinName("Online")]
+ public JoinDataComplete Online = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Online", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("ForceOccupied")]
+ public JoinDataComplete ForceOccupied = new JoinDataComplete(new JoinData() { JoinNumber = 2, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Force Occupied", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("ForceVacant")]
+ public JoinDataComplete ForceVacant = new JoinDataComplete(new JoinData() { JoinNumber = 3, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Force Vacant", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("EnableRawStates")]
+ public JoinDataComplete EnableRawStates = new JoinDataComplete(new JoinData() { JoinNumber = 4, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Enable Raw States", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("RoomOccupiedFeedback")]
+ public JoinDataComplete RoomOccupiedFeedback = new JoinDataComplete(new JoinData() { JoinNumber = 2, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Room Occupied Feedback", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("GraceOccupancyDetectedFeedback")]
+ public JoinDataComplete GraceOccupancyDetectedFeedback = new JoinDataComplete(new JoinData() { JoinNumber = 3, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Grace Occupancy Detected Feedback", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("RoomVacantFeedback")]
+ public JoinDataComplete RoomVacantFeedback = new JoinDataComplete(new JoinData() { JoinNumber = 4, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Room Vacant Feedback", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("RawOccupancyFeedback")]
+ public JoinDataComplete RawOccupancyFeedback = new JoinDataComplete(new JoinData() { JoinNumber = 5, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Raw Occupancy Feedback", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("RawOccupancyPirFeedback")]
+ public JoinDataComplete RawOccupancyPirFeedback = new JoinDataComplete(new JoinData() { JoinNumber = 6, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Raw Occupancy Pir Feedback", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("RawOccupancyUsFeedback")]
+ public JoinDataComplete RawOccupancyUsFeedback = new JoinDataComplete(new JoinData() { JoinNumber = 7, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Raw Occupancy Us Feedback", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("EnableLedFlash")]
+ public JoinDataComplete EnableLedFlash = new JoinDataComplete(new JoinData() { JoinNumber = 11, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Enable Led Flash", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("DisableLedFlash")]
+ public JoinDataComplete DisableLedFlash = new JoinDataComplete(new JoinData() { JoinNumber = 12, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Disable Led Flash", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("EnableShortTimeout")]
+ public JoinDataComplete EnableShortTimeout = new JoinDataComplete(new JoinData() { JoinNumber = 13, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Enable Short Timeout", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("DisableShortTimeout")]
+ public JoinDataComplete DisableShortTimeout = new JoinDataComplete(new JoinData() { JoinNumber = 14, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Disable Short Timeout", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("OrWhenVacated")]
+ public JoinDataComplete OrWhenVacated = new JoinDataComplete(new JoinData() { JoinNumber = 15, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Or When Vacated", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("AndWhenVacated")]
+ public JoinDataComplete AndWhenVacated = new JoinDataComplete(new JoinData() { JoinNumber = 16, JoinSpan = 1 },
+ new JoinMetadata() { Label = "AndWhenVacated", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("EnableUsA")]
+ public JoinDataComplete EnableUsA = new JoinDataComplete(new JoinData() { JoinNumber = 17, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Enable Us A", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("DisableUsA")]
+ public JoinDataComplete DisableUsA = new JoinDataComplete(new JoinData() { JoinNumber = 18, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Disable Us A", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("EnableUsB")]
+ public JoinDataComplete EnableUsB = new JoinDataComplete(new JoinData() { JoinNumber = 19, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Enable Us B", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("DisableUsB")]
+ public JoinDataComplete DisableUsB = new JoinDataComplete(new JoinData() { JoinNumber = 20, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Disable Us B", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("EnablePir")]
+ public JoinDataComplete EnablePir = new JoinDataComplete(new JoinData() { JoinNumber = 21, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Enable Pir", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("DisablePir")]
+ public JoinDataComplete DisablePir = new JoinDataComplete(new JoinData() { JoinNumber = 22, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Disable Pir", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("IncrementUsInOccupiedState")]
+ public JoinDataComplete IncrementUsInOccupiedState = new JoinDataComplete(new JoinData() { JoinNumber = 23, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Increment Us In OccupiedState", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("DecrementUsInOccupiedState")]
+ public JoinDataComplete DecrementUsInOccupiedState = new JoinDataComplete(new JoinData() { JoinNumber = 24, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Dencrement Us In Occupied State", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("IncrementUsInVacantState")]
+ public JoinDataComplete IncrementUsInVacantState = new JoinDataComplete(new JoinData() { JoinNumber = 25, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Increment Us In VacantState", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("DecrementUsInVacantState")]
+ public JoinDataComplete DecrementUsInVacantState = new JoinDataComplete(new JoinData() { JoinNumber = 26, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Decrement Us In VacantState", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("IncrementPirInOccupiedState")]
+ public JoinDataComplete IncrementPirInOccupiedState = new JoinDataComplete(new JoinData() { JoinNumber = 27, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Increment Pir In Occupied State", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("DecrementPirInOccupiedState")]
+ public JoinDataComplete DecrementPirInOccupiedState = new JoinDataComplete(new JoinData() { JoinNumber = 28, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Decrement Pir In OccupiedState", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("IncrementPirInVacantState")]
+ public JoinDataComplete IncrementPirInVacantState = new JoinDataComplete(new JoinData() { JoinNumber = 29, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Increment Pir In Vacant State", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("DecrementPirInVacantState")]
+ public JoinDataComplete DecrementPirInVacantState = new JoinDataComplete(new JoinData() { JoinNumber = 30, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Decrement Pir In Vacant State", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ #endregion
+
+ #region Analog
+
+ [JoinName("Timeout")]
+ public JoinDataComplete Timeout = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Timeout", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
+
+ [JoinName("TimeoutLocalFeedback")]
+ public JoinDataComplete TimeoutLocalFeedback = new JoinDataComplete(new JoinData() { JoinNumber = 2, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Timeout Local Feedback", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Analog });
+
+ [JoinName("InternalPhotoSensorValue")]
+ public JoinDataComplete InternalPhotoSensorValue = new JoinDataComplete(new JoinData() { JoinNumber = 3, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Internal PhotoSensor Value", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
+
+ [JoinName("UsSensitivityInOccupiedState")]
+ public JoinDataComplete UsSensitivityInOccupiedState = new JoinDataComplete(new JoinData() { JoinNumber = 5, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Us Sensitivity In Occupied State", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Analog });
+
+ [JoinName("UsSensitivityInVacantState")]
+ public JoinDataComplete UsSensitivityInVacantState = new JoinDataComplete(new JoinData() { JoinNumber = 6, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Us Sensitivity In Vacant State", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Analog });
+
+ [JoinName("PirSensitivityInOccupiedState")]
+ public JoinDataComplete PirSensitivityInOccupiedState = new JoinDataComplete(new JoinData() { JoinNumber = 7, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Pir Sensitivity In Occupied State", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Analog });
+
+ [JoinName("PirSensitivityInVacantState")]
+ public JoinDataComplete PirSensitivityInVacantState = new JoinDataComplete(new JoinData() { JoinNumber = 8, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Pir Sensitivity In Vacant State", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Analog });
+
+ #endregion
+
+ #region Serial
+
+ [JoinName("Name")]
+ public JoinDataComplete Name = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Name", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
+
+ #endregion
+
+ public CenOdtOccupancySensorBaseJoinMap(uint joinStart)
+ : base(joinStart, typeof(CenOdtOccupancySensorBaseJoinMap))
+ {
+ }
+ }
+
+}
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/DigitalLoggerJoinMap.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/DigitalLoggerJoinMap.cs
new file mode 100644
index 00000000..13123ca0
--- /dev/null
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/DigitalLoggerJoinMap.cs
@@ -0,0 +1,47 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Crestron.SimplSharp;
+
+namespace PepperDash.Essentials.Core.Bridges
+{
+ [Obsolete("This Device will be moved to a plugin in a future update")]
+ public class DigitalLoggerJoinMap : JoinMapBase
+ {
+ public uint IsOnline { get; set; }
+ public uint CircuitNames { get; set; }
+ public uint CircuitState { get; set; }
+ public uint CircuitCycle { get; set; }
+ public uint CircuitIsCritical { get; set; }
+ public uint CircuitOnCmd { get; set; }
+ public uint CircuitOffCmd { get; set; }
+
+ public DigitalLoggerJoinMap()
+ {
+ // Digital
+ IsOnline = 9;
+ CircuitState = 0;
+ CircuitCycle = 0;
+ CircuitIsCritical = 10;
+ CircuitOnCmd = 10;
+ CircuitOffCmd = 20;
+ // Serial
+ CircuitNames = 0;
+ // Analog
+ }
+
+ public override void OffsetJoinNumbers(uint joinStart)
+ {
+ var joinOffset = joinStart - 1;
+
+ IsOnline = IsOnline + joinOffset;
+ CircuitNames = CircuitNames + joinOffset;
+ CircuitState = CircuitState + joinOffset;
+ CircuitCycle = CircuitCycle + joinOffset;
+ CircuitIsCritical = CircuitIsCritical + joinOffset;
+ CircuitOnCmd = CircuitOnCmd + joinOffset;
+ CircuitOffCmd = CircuitOffCmd + joinOffset;
+ }
+ }
+}
\ No newline at end of file
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/DisplayControllerJoinMap.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/DisplayControllerJoinMap.cs
new file mode 100644
index 00000000..e0b13688
--- /dev/null
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/DisplayControllerJoinMap.cs
@@ -0,0 +1,77 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Crestron.SimplSharp;
+using PepperDash.Essentials.Core;
+
+namespace PepperDash.Essentials.Core.Bridges
+{
+ public class DisplayControllerJoinMap : JoinMapBaseAdvanced
+ {
+ [JoinName("Name")]
+ public JoinDataComplete Name = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Name", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
+
+ [JoinName("PowerOff")]
+ public JoinDataComplete PowerOff = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Power Off", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("PowerOn")]
+ public JoinDataComplete PowerOn = new JoinDataComplete(new JoinData() { JoinNumber = 2, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Power On", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("IsTwoWayDisplay")]
+ public JoinDataComplete IsTwoWayDisplay = new JoinDataComplete(new JoinData() { JoinNumber = 3, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Is Two Way Display", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("VolumeUp")]
+ public JoinDataComplete VolumeUp = new JoinDataComplete(new JoinData() { JoinNumber = 5, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Volume Up", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("VolumeLevel")]
+ public JoinDataComplete VolumeLevel = new JoinDataComplete(new JoinData() { JoinNumber = 5, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Volume Level", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
+
+ [JoinName("VolumeDown")]
+ public JoinDataComplete VolumeDown = new JoinDataComplete(new JoinData() { JoinNumber = 6, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Volume Down", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("VolumeMute")]
+ public JoinDataComplete VolumeMute = new JoinDataComplete(new JoinData() { JoinNumber = 7, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Volume Mute", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("VolumeMuteOn")]
+ public JoinDataComplete VolumeMuteOn = new JoinDataComplete(new JoinData() { JoinNumber = 8, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Volume Mute On", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("VolumeMuteOff")]
+ public JoinDataComplete VolumeMuteOff = new JoinDataComplete(new JoinData() { JoinNumber = 9, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Volume Mute Off", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("InputSelectOffset")]
+ public JoinDataComplete InputSelectOffset = new JoinDataComplete(new JoinData() { JoinNumber = 11, JoinSpan = 10 },
+ new JoinMetadata() { Label = "Input Select", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("InputNamesOffset")]
+ public JoinDataComplete InputNamesOffset = new JoinDataComplete(new JoinData() { JoinNumber = 11, JoinSpan = 10 },
+ new JoinMetadata() { Label = "Input Names Offset", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
+
+ [JoinName("InputSelect")]
+ public JoinDataComplete InputSelect = new JoinDataComplete(new JoinData() { JoinNumber = 11, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Input Select", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
+
+ [JoinName("ButtonVisibilityOffset")]
+ public JoinDataComplete ButtonVisibilityOffset = new JoinDataComplete(new JoinData() { JoinNumber = 41, JoinSpan = 10 },
+ new JoinMetadata() { Label = "Button Visibility Offset", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.DigitalSerial });
+
+ [JoinName("IsOnline")]
+ public JoinDataComplete IsOnline = new JoinDataComplete(new JoinData() { JoinNumber = 50, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Is Online", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
+
+ public DisplayControllerJoinMap(uint joinStart)
+ : base(joinStart, typeof(DisplayControllerJoinMap))
+ {
+ }
+ }
+}
\ No newline at end of file
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/DmBladeChassisControllerJoinMap.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/DmBladeChassisControllerJoinMap.cs
new file mode 100644
index 00000000..63e3041e
--- /dev/null
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/DmBladeChassisControllerJoinMap.cs
@@ -0,0 +1,65 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Crestron.SimplSharp;
+using PepperDash.Essentials.Core;
+
+namespace PepperDash.Essentials.Core.Bridges {
+ public class DmBladeChassisControllerJoinMap : JoinMapBaseAdvanced {
+
+ [JoinName("IsOnline")]
+ public JoinDataComplete IsOnline = new JoinDataComplete(new JoinData() { JoinNumber = 11, JoinSpan = 1 },
+ new JoinMetadata() { Label = "DM Blade Chassis Online", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("VideoSyncStatus")]
+ public JoinDataComplete VideoSyncStatus = new JoinDataComplete(new JoinData() { JoinNumber = 101, JoinSpan = 128 },
+ new JoinMetadata() { Label = "DM Blade Input Video Sync", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("InputEndpointOnline")]
+ public JoinDataComplete InputEndpointOnline = new JoinDataComplete(new JoinData() { JoinNumber = 501, JoinSpan = 128 },
+ new JoinMetadata() { Label = "DM Blade Chassis Input Endpoint Online", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("OutputEndpointOnline")]
+ public JoinDataComplete OutputEndpointOnline = new JoinDataComplete(new JoinData() { JoinNumber = 701, JoinSpan = 128 },
+ new JoinMetadata() { Label = "DM Blade Chassis Output Endpoint Online", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("TxAdvancedIsPresent")]
+ public JoinDataComplete TxAdvancedIsPresent = new JoinDataComplete(new JoinData() { JoinNumber = 1001, JoinSpan = 128 },
+ new JoinMetadata() { Label = "DM Blade Chassis Tx Advanced Is Present", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("OutputVideo")]
+ public JoinDataComplete OutputVideo = new JoinDataComplete(new JoinData() { JoinNumber = 101, JoinSpan = 128 },
+ new JoinMetadata() { Label = "DM Blade Chassis Output Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
+
+ [JoinName("HdcpSupportState")]
+ public JoinDataComplete HdcpSupportState = new JoinDataComplete(new JoinData() { JoinNumber = 1001, JoinSpan = 128 },
+ new JoinMetadata() { Label = "DM Blade Chassis Input HDCP Support State", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Analog });
+
+ [JoinName("HdcpSupportCapability")]
+ public JoinDataComplete HdcpSupportCapability = new JoinDataComplete(new JoinData() { JoinNumber = 1201, JoinSpan = 128 },
+ new JoinMetadata() { Label = "DM Blade Chassis Input HDCP Support Capability", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Analog });
+
+ [JoinName("InputNames")]
+ public JoinDataComplete InputNames = new JoinDataComplete(new JoinData() { JoinNumber = 101, JoinSpan = 128 },
+ new JoinMetadata() { Label = "DM Blade Chassis Input Name", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
+
+ [JoinName("OutputNames")]
+ public JoinDataComplete OutputNames = new JoinDataComplete(new JoinData() { JoinNumber = 301, JoinSpan = 128 },
+ new JoinMetadata() { Label = "DM Blade Chassis Output Name", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
+
+ [JoinName("OutputCurrentVideoInputNames")]
+ public JoinDataComplete OutputCurrentVideoInputNames = new JoinDataComplete(new JoinData() { JoinNumber = 2001, JoinSpan = 128 },
+ new JoinMetadata() { Label = "DM Blade Chassis Video Output Currently Routed Video Input Name", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
+
+ [JoinName("InputCurrentResolution")]
+ public JoinDataComplete InputCurrentResolution = new JoinDataComplete(new JoinData() { JoinNumber = 2401, JoinSpan = 128 },
+ new JoinMetadata() { Label = "DM Blade Chassis Input Current Resolution", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
+
+ public DmBladeChassisControllerJoinMap(uint joinStart)
+ : base(joinStart, typeof(DmBladeChassisControllerJoinMap))
+ {
+ }
+
+ }
+}
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/DmChassisControllerJoinMap.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/DmChassisControllerJoinMap.cs
new file mode 100644
index 00000000..9406678a
--- /dev/null
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/DmChassisControllerJoinMap.cs
@@ -0,0 +1,90 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Crestron.SimplSharp;
+using PepperDash.Essentials.Core;
+
+namespace PepperDash.Essentials.Core.Bridges
+{
+ public class DmChassisControllerJoinMap : JoinMapBaseAdvanced
+ {
+
+ [JoinName("SystemId")]
+ public JoinDataComplete SystemId = new JoinDataComplete(new JoinData() { JoinNumber = 10, JoinSpan = 1 },
+ new JoinMetadata() { Label = "DM Chassis SystemId Get/Set/Trigger/", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.DigitalAnalog });
+
+ [JoinName("IsOnline")]
+ public JoinDataComplete IsOnline = new JoinDataComplete(new JoinData() { JoinNumber = 11, JoinSpan = 1 },
+ new JoinMetadata() { Label = "DM Chassis Online", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("VideoSyncStatus")]
+ public JoinDataComplete VideoSyncStatus = new JoinDataComplete(new JoinData() { JoinNumber = 101, JoinSpan = 32 },
+ new JoinMetadata() { Label = "DM Input Video Sync", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("InputEndpointOnline")]
+ public JoinDataComplete InputEndpointOnline = new JoinDataComplete(new JoinData() { JoinNumber = 501, JoinSpan = 32 },
+ new JoinMetadata() { Label = "DM Chassis Input Endpoint Online", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("OutputEndpointOnline")]
+ public JoinDataComplete OutputEndpointOnline = new JoinDataComplete(new JoinData() { JoinNumber = 701, JoinSpan = 32 },
+ new JoinMetadata() { Label = "DM Chassis Output Endpoint Online", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("TxAdvancedIsPresent")]
+ public JoinDataComplete TxAdvancedIsPresent = new JoinDataComplete(new JoinData() { JoinNumber = 1001, JoinSpan = 32 },
+ new JoinMetadata() { Label = "DM Chassis Tx Advanced Is Present", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("OutputDisabledByHdcp")]
+ public JoinDataComplete OutputDisabledByHdcp = new JoinDataComplete(new JoinData() { JoinNumber = 1201, JoinSpan = 32 },
+ new JoinMetadata() { Label = "DM Chassis Output Disabled by HDCP", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("OutputVideo")]
+ public JoinDataComplete OutputVideo = new JoinDataComplete(new JoinData() { JoinNumber = 101, JoinSpan = 32 },
+ new JoinMetadata() { Label = "DM Chassis Output Video Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
+
+ [JoinName("OutputAudio")]
+ public JoinDataComplete OutputAudio = new JoinDataComplete(new JoinData() { JoinNumber = 301, JoinSpan = 32 },
+ new JoinMetadata() { Label = "DM Chassis Output Audio Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
+
+ [JoinName("OutputUsb")]
+ public JoinDataComplete OutputUsb = new JoinDataComplete(new JoinData() { JoinNumber = 501, JoinSpan = 32 },
+ new JoinMetadata() { Label = "DM Chassis Output USB Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
+
+ [JoinName("InputUsb")]
+ public JoinDataComplete InputUsb = new JoinDataComplete(new JoinData() { JoinNumber = 701, JoinSpan = 32 },
+ new JoinMetadata() { Label = "DM Chassis Input Usb Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
+
+ [JoinName("HdcpSupportState")]
+ public JoinDataComplete HdcpSupportState = new JoinDataComplete(new JoinData() { JoinNumber = 1001, JoinSpan = 32 },
+ new JoinMetadata() { Label = "DM Chassis Input HDCP Support State", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Analog });
+
+ [JoinName("HdcpSupportCapability")]
+ public JoinDataComplete HdcpSupportCapability = new JoinDataComplete(new JoinData() { JoinNumber = 1201, JoinSpan = 32 },
+ new JoinMetadata() { Label = "DM Chassis Input HDCP Support Capability", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Analog });
+
+ [JoinName("InputNames")]
+ public JoinDataComplete InputNames = new JoinDataComplete(new JoinData() { JoinNumber = 101, JoinSpan = 32 },
+ new JoinMetadata() { Label = "DM Chassis Input Name", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
+
+ [JoinName("OutputNames")]
+ public JoinDataComplete OutputNames = new JoinDataComplete(new JoinData() { JoinNumber = 301, JoinSpan = 32 },
+ new JoinMetadata() { Label = "DM Chassis Output Name", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
+
+ [JoinName("OutputCurrentVideoInputNames")]
+ public JoinDataComplete OutputCurrentVideoInputNames = new JoinDataComplete(new JoinData() { JoinNumber = 2001, JoinSpan = 32 },
+ new JoinMetadata() { Label = "DM Chassis Video Output Currently Routed Video Input Name", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
+
+ [JoinName("OutputCurrentAudioInputNames")]
+ public JoinDataComplete OutputCurrentAudioInputNames = new JoinDataComplete(new JoinData() { JoinNumber = 2201, JoinSpan = 32 },
+ new JoinMetadata() { Label = "DM Chassis Audio Output Currently Routed Video Input Name", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
+
+ [JoinName("InputCurrentResolution")]
+ public JoinDataComplete InputCurrentResolution = new JoinDataComplete(new JoinData() { JoinNumber = 2401, JoinSpan = 32 },
+ new JoinMetadata() { Label = "DM Chassis Input Current Resolution", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
+
+ public DmChassisControllerJoinMap(uint joinStart)
+ : base(joinStart, typeof(DmChassisControllerJoinMap))
+ {
+ }
+ }
+}
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/DmRmcControllerJoinMap.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/DmRmcControllerJoinMap.cs
new file mode 100644
index 00000000..537be416
--- /dev/null
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/DmRmcControllerJoinMap.cs
@@ -0,0 +1,46 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Crestron.SimplSharp;
+using PepperDash.Essentials.Core;
+
+namespace PepperDash.Essentials.Core.Bridges
+{
+ public class DmRmcControllerJoinMap : JoinMapBaseAdvanced
+ {
+ [JoinName("IsOnline")]
+ public JoinDataComplete IsOnline = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 },
+ new JoinMetadata() { Label = "DM RMC Online", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("CurrentOutputResolution")]
+ public JoinDataComplete CurrentOutputResolution = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 },
+ new JoinMetadata() { Label = "DM RMC Current Output Resolution", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
+
+ [JoinName("EdidManufacturer")]
+ public JoinDataComplete EdidManufacturer = new JoinDataComplete(new JoinData() { JoinNumber = 2, JoinSpan = 1 },
+ new JoinMetadata() { Label = "DM RMC EDID Manufacturer", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
+
+ [JoinName("EdidName")]
+ public JoinDataComplete EdidName = new JoinDataComplete(new JoinData() { JoinNumber = 3, JoinSpan = 1 },
+ new JoinMetadata() { Label = "DM RMC EDID Name", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
+
+ [JoinName("EdidPrefferedTiming")]
+ public JoinDataComplete EdidPrefferedTiming = new JoinDataComplete(new JoinData() { JoinNumber = 4, JoinSpan = 1 },
+ new JoinMetadata() { Label = "DM RMC EDID Preferred Timing", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
+
+ [JoinName("EdidSerialNumber")]
+ public JoinDataComplete EdidSerialNumber = new JoinDataComplete(new JoinData() { JoinNumber = 5, JoinSpan = 1 },
+ new JoinMetadata() { Label = "DM RMC EDID Serial Number", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
+
+ [JoinName("AudioVideoSource")]
+ public JoinDataComplete AudioVideoSource = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 },
+ new JoinMetadata() { Label = "DM RMC Audio Video Source Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
+
+
+ public DmRmcControllerJoinMap(uint joinStart)
+ : base(joinStart, typeof(DmRmcControllerJoinMap))
+ {
+ }
+ }
+}
\ No newline at end of file
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/DmTxControllerJoinMap.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/DmTxControllerJoinMap.cs
new file mode 100644
index 00000000..8b59bd42
--- /dev/null
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/DmTxControllerJoinMap.cs
@@ -0,0 +1,69 @@
+using PepperDash.Essentials.Core;
+
+namespace PepperDash.Essentials.Core.Bridges
+{
+ public class DmTxControllerJoinMap : JoinMapBaseAdvanced
+ {
+ [JoinName("IsOnline")]
+ public JoinDataComplete IsOnline = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 },
+ new JoinMetadata() { Label = "DM TX Online", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("VideoSyncStatus")]
+ public JoinDataComplete VideoSyncStatus = new JoinDataComplete(new JoinData() { JoinNumber = 2, JoinSpan = 1 },
+ new JoinMetadata() { Label = "DM TX Video Sync", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("FreeRunEnabled")]
+ public JoinDataComplete FreeRunEnabled = new JoinDataComplete(new JoinData() { JoinNumber = 3, JoinSpan = 1 },
+ new JoinMetadata() { Label = "DM TX Enable Free Run Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("Input1VideoSyncStatus")]
+ public JoinDataComplete Input1VideoSyncStatus = new JoinDataComplete(new JoinData() { JoinNumber = 4, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Input 1 Video Sync Status", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("Input2VideoSyncStatus")]
+ public JoinDataComplete Input2VideoSyncStatus = new JoinDataComplete(new JoinData() { JoinNumber = 5, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Input 2 Video Sync Status", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("Input3VideoSyncStatus")]
+ public JoinDataComplete Input3VideoSyncStatus = new JoinDataComplete(new JoinData() { JoinNumber = 6, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Input 3 Video Sync Status", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("CurrentInputResolution")]
+ public JoinDataComplete CurrentInputResolution = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 },
+ new JoinMetadata() { Label = "DM TX Current Input Resolution", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
+
+ [JoinName("VideoInput")]
+ public JoinDataComplete VideoInput = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 },
+ new JoinMetadata() { Label = "DM TX Video Input Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
+
+ [JoinName("AudioInput")]
+ public JoinDataComplete AudioInput = new JoinDataComplete(new JoinData() { JoinNumber = 2, JoinSpan = 1 },
+ new JoinMetadata() { Label = "DM TX Audio Input Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
+
+ [JoinName("HdcpSupportCapability")]
+ public JoinDataComplete HdcpSupportCapability = new JoinDataComplete(new JoinData() { JoinNumber = 3, JoinSpan = 1 },
+ new JoinMetadata() { Label = "DM TX HDCP Support Capability", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Analog });
+
+ [JoinName("Port1HdcpState")]
+ public JoinDataComplete Port1HdcpState = new JoinDataComplete(new JoinData() { JoinNumber = 4, JoinSpan = 1 },
+ new JoinMetadata() { Label = "DM TX Port 1 HDCP State Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
+
+ [JoinName("Port2HdcpState")]
+ public JoinDataComplete Port2HdcpState = new JoinDataComplete(new JoinData() { JoinNumber = 5, JoinSpan = 1 },
+ new JoinMetadata() { Label = "DM TX Port 2 HDCP State Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
+
+ [JoinName("VgaBrightness")]
+ public JoinDataComplete VgaBrightness = new JoinDataComplete(new JoinData() { JoinNumber = 6, JoinSpan = 1 },
+ new JoinMetadata() { Label = "DM TX VGA Brightness", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
+
+ [JoinName("VgaContrast")]
+ public JoinDataComplete VgaContrast = new JoinDataComplete(new JoinData() { JoinNumber = 7, JoinSpan = 1 },
+ new JoinMetadata() { Label = "DM TX Online", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
+
+
+ public DmTxControllerJoinMap(uint joinStart)
+ : base(joinStart, typeof(DmTxControllerJoinMap))
+ {
+ }
+ }
+}
\ No newline at end of file
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/DmpsAudioOutputControllerJoinMap.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/DmpsAudioOutputControllerJoinMap.cs
new file mode 100644
index 00000000..89686765
--- /dev/null
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/DmpsAudioOutputControllerJoinMap.cs
@@ -0,0 +1,100 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Crestron.SimplSharp;
+using PepperDash.Essentials.Core;
+
+namespace PepperDash.Essentials.Core.Bridges
+{
+ public class DmpsAudioOutputControllerJoinMap : JoinMapBaseAdvanced
+ {
+
+ [JoinName("MasterVolumeLevel")]
+ public JoinDataComplete MasterVolumeLevel = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Master Volume Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
+
+ [JoinName("MasterVolumeMuteOn")]
+ public JoinDataComplete MasterVolumeMuteOn = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Master Volume Mute On Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("MasterVolumeMuteOff")]
+ public JoinDataComplete MasterVolumeMuteOff = new JoinDataComplete(new JoinData() { JoinNumber = 2, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Master Volume Mute Off Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("MasterVolumeUp")]
+ public JoinDataComplete MasterVolumeUp = new JoinDataComplete(new JoinData() { JoinNumber = 3, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Master Volume Level Up", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("MasterVolumeDown")]
+ public JoinDataComplete MasterVolumeDown = new JoinDataComplete(new JoinData() { JoinNumber = 4, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Master Volume Mute Level Down", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("SourceVolumeLevel")]
+ public JoinDataComplete SourceVolumeLevel = new JoinDataComplete(new JoinData() { JoinNumber = 11, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Source Volume Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
+
+ [JoinName("SourceVolumeMuteOn")]
+ public JoinDataComplete SourceVolumeMuteOn = new JoinDataComplete(new JoinData() { JoinNumber = 11, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Source Volume Mute On Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("SourceVolumeMuteOff")]
+ public JoinDataComplete SourceVolumeMuteOff = new JoinDataComplete(new JoinData() { JoinNumber = 12, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Source Volume Mute Off Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("SourceVolumeUp")]
+ public JoinDataComplete SourceVolumeUp = new JoinDataComplete(new JoinData() { JoinNumber = 13, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Source Volume Level Up", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("SourceVolumeDown")]
+ public JoinDataComplete SourceVolumeDown = new JoinDataComplete(new JoinData() { JoinNumber = 14, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Source Volume Mute Level Down", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("Codec1VolumeLevel")]
+ public JoinDataComplete Codec1VolumeLevel = new JoinDataComplete(new JoinData() { JoinNumber = 21, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Codec1 Volume Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
+
+ [JoinName("Codec1VolumeMuteOn")]
+ public JoinDataComplete Codec1VolumeMuteOn = new JoinDataComplete(new JoinData() { JoinNumber = 21, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Codec1 Volume Mute On Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("Codec1VolumeMuteOff")]
+ public JoinDataComplete Codec1VolumeMuteOff = new JoinDataComplete(new JoinData() { JoinNumber = 22, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Codec1 Volume Mute Off Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("Codec1VolumeUp")]
+ public JoinDataComplete Codec1VolumeUp = new JoinDataComplete(new JoinData() { JoinNumber = 23, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Codec1 Volume Level Up", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("Codec1VolumeDown")]
+ public JoinDataComplete Codec1VolumeDown = new JoinDataComplete(new JoinData() { JoinNumber = 24, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Codec1 Volume Mute Level Down", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("Codec2VolumeLevel")]
+ public JoinDataComplete Codec2VolumeLevel = new JoinDataComplete(new JoinData() { JoinNumber = 31, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Codec2 Volume Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
+
+ [JoinName("Codec2VolumeMuteOn")]
+ public JoinDataComplete Codec2VolumeMuteOn = new JoinDataComplete(new JoinData() { JoinNumber = 31, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Codec2 Volume Mute On Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("Codec2VolumeMuteOff")]
+ public JoinDataComplete Codec2VolumeMuteOff = new JoinDataComplete(new JoinData() { JoinNumber = 32, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Codec2 Volume Mute Off Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("Codec2VolumeUp")]
+ public JoinDataComplete Codec2VolumeUp = new JoinDataComplete(new JoinData() { JoinNumber = 33, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Codec2 Volume Level Up", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("Codec2VolumeDown")]
+ public JoinDataComplete Codec2VolumeDown = new JoinDataComplete(new JoinData() { JoinNumber = 34, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Codec2 Volume Mute Level Down", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+
+
+ public DmpsAudioOutputControllerJoinMap(uint joinStart)
+ : base(joinStart, typeof(DmpsAudioOutputControllerJoinMap))
+ {
+ }
+ }
+}
\ 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
new file mode 100644
index 00000000..dc0d6fba
--- /dev/null
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/DmpsRoutingControllerJoinMap.cs
@@ -0,0 +1,57 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Crestron.SimplSharp;
+using PepperDash.Essentials.Core;
+
+namespace PepperDash.Essentials.Core.Bridges
+{
+ public class DmpsRoutingControllerJoinMap : JoinMapBaseAdvanced
+ {
+ [JoinName("VideoSyncStatus")]
+ public JoinDataComplete VideoSyncStatus = new JoinDataComplete(new JoinData() { JoinNumber = 101, JoinSpan = 32 },
+ new JoinMetadata() { Label = "DM Input Video Sync", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("InputEndpointOnline")]
+ public JoinDataComplete InputEndpointOnline = new JoinDataComplete(new JoinData() { JoinNumber = 501, JoinSpan = 32 },
+ new JoinMetadata() { Label = "DM Chassis Input Endpoint Online", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("OutputEndpointOnline")]
+ public JoinDataComplete OutputEndpointOnline = new JoinDataComplete(new JoinData() { JoinNumber = 701, JoinSpan = 32 },
+ new JoinMetadata() { Label = "DM Chassis Output Endpoint Online", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("OutputVideo")]
+ public JoinDataComplete OutputVideo = new JoinDataComplete(new JoinData() { JoinNumber = 101, JoinSpan = 32 },
+ new JoinMetadata() { Label = "DM Chassis Output Video Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
+
+ [JoinName("OutputAudio")]
+ public JoinDataComplete OutputAudio = new JoinDataComplete(new JoinData() { JoinNumber = 301, JoinSpan = 32 },
+ new JoinMetadata() { Label = "DM Chassis Output Audio Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
+
+ [JoinName("InputNames")]
+ public JoinDataComplete InputNames = new JoinDataComplete(new JoinData() { JoinNumber = 101, JoinSpan = 32 },
+ new JoinMetadata() { Label = "DM Chassis Input Name", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
+
+ [JoinName("OutputNames")]
+ public JoinDataComplete OutputNames = new JoinDataComplete(new JoinData() { JoinNumber = 301, JoinSpan = 32 },
+ new JoinMetadata() { Label = "DM Chassis Output Name", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
+
+ [JoinName("OutputCurrentVideoInputNames")]
+ public JoinDataComplete OutputCurrentVideoInputNames = new JoinDataComplete(new JoinData() { JoinNumber = 2001, JoinSpan = 32 },
+ new JoinMetadata() { Label = "DM Chassis Video Output Currently Routed Video Input Name", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
+
+ [JoinName("OutputCurrentAudioInputNames")]
+ public JoinDataComplete OutputCurrentAudioInputNames = new JoinDataComplete(new JoinData() { JoinNumber = 2201, JoinSpan = 32 },
+ new JoinMetadata() { Label = "DM Chassis Audio Output Currently Routed Video Input Name", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
+
+ [JoinName("InputCurrentResolution")]
+ public JoinDataComplete InputCurrentResolution = new JoinDataComplete(new JoinData() { JoinNumber = 2401, JoinSpan = 32 },
+ new JoinMetadata() { Label = "DM Chassis Input Current Resolution", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
+
+ public DmpsRoutingControllerJoinMap(uint joinStart)
+ : base(joinStart, typeof(DmpsRoutingControllerJoinMap))
+ {
+ }
+ }
+}
\ No newline at end of file
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/GenericLightingJoinMap.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/GenericLightingJoinMap.cs
new file mode 100644
index 00000000..f639cff0
--- /dev/null
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/GenericLightingJoinMap.cs
@@ -0,0 +1,43 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Crestron.SimplSharp;
+
+using PepperDash.Essentials.Core;
+
+
+namespace PepperDash.Essentials.Core.Bridges
+{
+ public class GenericLightingJoinMap : JoinMapBaseAdvanced
+ {
+
+ [JoinName("IsOnline")]
+ public JoinDataComplete IsOnline = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Lighting Controller Online", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("SelectScene")]
+ public JoinDataComplete SelectScene = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Lighting Controller Select Scene By Index", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("SelectSceneDirect")]
+ public JoinDataComplete SelectSceneDirect = new JoinDataComplete(new JoinData() { JoinNumber = 11, JoinSpan = 10 },
+ new JoinMetadata() { Label = "Lighting Controller Select Scene", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.DigitalSerial });
+
+ [JoinName("ButtonVisibility")]
+ public JoinDataComplete ButtonVisibility = new JoinDataComplete(new JoinData() { JoinNumber = 41, JoinSpan = 10 },
+ new JoinMetadata() { Label = "Lighting Controller Button Visibility", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("IntegrationIdSet")]
+ public JoinDataComplete IntegrationIdSet = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Lighting Controller Set Integration Id", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Serial });
+
+
+
+
+ public GenericLightingJoinMap(uint joinStart)
+ : base(joinStart, typeof(GenericLightingJoinMap))
+ {
+ }
+ }
+}
\ No newline at end of file
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/GenericRelayControllerJoinMap.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/GenericRelayControllerJoinMap.cs
new file mode 100644
index 00000000..894b7fd3
--- /dev/null
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/GenericRelayControllerJoinMap.cs
@@ -0,0 +1,23 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Crestron.SimplSharp;
+using PepperDash.Essentials.Core;
+
+namespace PepperDash.Essentials.Core.Bridges
+{
+ public class GenericRelayControllerJoinMap : JoinMapBaseAdvanced
+ {
+
+ [JoinName("Relay")]
+ public JoinDataComplete Relay = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Device Relay State Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
+
+
+ public GenericRelayControllerJoinMap(uint joinStart)
+ : base(joinStart, typeof(GenericRelayControllerJoinMap))
+ {
+ }
+ }
+}
\ 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
new file mode 100644
index 00000000..15b927b2
--- /dev/null
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/GlsOccupancySensorBaseJoinMap.cs
@@ -0,0 +1,176 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Crestron.SimplSharp;
+using PepperDash.Essentials.Core;
+
+namespace PepperDash.Essentials.Core.Bridges
+{
+ public class GlsOccupancySensorBaseJoinMap : JoinMapBaseAdvanced
+ {
+ [JoinName("IsOnline")]
+ public JoinDataComplete IsOnline = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Occ Sensor Is Online", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("ForceOccupied")]
+ public JoinDataComplete ForceOccupied = new JoinDataComplete(new JoinData() { JoinNumber = 2, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Occ Sensor Set to Occupied", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("ForceVacant")]
+ public JoinDataComplete ForceVacant = new JoinDataComplete(new JoinData() { JoinNumber = 3, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Occ Sensor Set to Vacant", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("EnableRawStates")]
+ public JoinDataComplete EnableRawStates = new JoinDataComplete(new JoinData() { JoinNumber = 4, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Occ Sensor Enable Raw", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("RoomOccupiedFeedback")]
+ public JoinDataComplete RoomOccupiedFeedback = new JoinDataComplete(new JoinData() { JoinNumber = 2, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Occ Sensor Room Is Occupied", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("GraceOccupancyDetectedFeedback")]
+ public JoinDataComplete GraceOccupancyDetectedFeedback = new JoinDataComplete(new JoinData() { JoinNumber = 3, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Occ Sensor Grace Occupancy Detected", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("RoomVacantFeedback")]
+ public JoinDataComplete RoomVacantFeedback = new JoinDataComplete(new JoinData() { JoinNumber = 4, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Occ Sensor Room Is Vacant", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("RawOccupancyFeedback")]
+ public JoinDataComplete RawOccupancyFeedback = new JoinDataComplete(new JoinData() { JoinNumber = 5, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Occ Sensor Raw Occupancy Detected", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("RawOccupancyPirFeedback")]
+ public JoinDataComplete RawOccupancyPirFeedback = new JoinDataComplete(new JoinData() { JoinNumber = 6, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Occ Sensor Raw PIR Occupancy Detected", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("RawOccupancyUsFeedback")]
+ public JoinDataComplete RawOccupancyUsFeedback = new JoinDataComplete(new JoinData() { JoinNumber = 7, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Occ Sensor Raw US Occupancy Detected", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("EnableLedFlash")]
+ public JoinDataComplete EnableLedFlash = new JoinDataComplete(new JoinData() { JoinNumber = 11, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Occ Sensor Enable LED Flash", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("DisableLedFlash")]
+ public JoinDataComplete DisableLedFlash = new JoinDataComplete(new JoinData() { JoinNumber = 12, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Occ Sensor Disable LED Flash", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("EnableShortTimeout")]
+ public JoinDataComplete EnableShortTimeout = new JoinDataComplete(new JoinData() { JoinNumber = 13, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Occ Sensor Enable Short Timeout", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("DisableShortTimeout")]
+ public JoinDataComplete DisableShortTimeout = new JoinDataComplete(new JoinData() { JoinNumber = 14, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Occ Sensor Disable Short Timeout", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("OrWhenVacated")]
+ public JoinDataComplete OrWhenVacated = new JoinDataComplete(new JoinData() { JoinNumber = 15, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Occ Sensor Set To Vacant when Either Sensor is Vacant", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("AndWhenVacated")]
+ public JoinDataComplete AndWhenVacated = new JoinDataComplete(new JoinData() { JoinNumber = 16, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Occ Sensor Set To Vacant when Both Sensors are Vacant", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("EnableUsA")]
+ public JoinDataComplete EnableUsA = new JoinDataComplete(new JoinData() { JoinNumber = 17, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Occ Sensor Enable Ultrasonic Sensor A", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("DisableUsA")]
+ public JoinDataComplete DisableUsA = new JoinDataComplete(new JoinData() { JoinNumber = 18, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Occ Sensor Disable Ultrasonic Sensor A", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("EnableUsB")]
+ public JoinDataComplete EnableUsB = new JoinDataComplete(new JoinData() { JoinNumber = 19, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Occ Sensor Enable Ultrasonic Sensor B", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("DisableUsB")]
+ public JoinDataComplete DisableUsB = new JoinDataComplete(new JoinData() { JoinNumber = 20, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Occ Sensor Disable Ultrasonic Sensor B", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("EnablePir")]
+ public JoinDataComplete EnablePir = new JoinDataComplete(new JoinData() { JoinNumber = 21, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Occ Sensor Enable IR Sensor", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("DisablePir")]
+ public JoinDataComplete DisablePir = new JoinDataComplete(new JoinData() { JoinNumber = 22, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Occ Sensor Disable IR Sensor", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("IncrementUsInOccupiedState")]
+ public JoinDataComplete IncrementUsInOccupiedState = new JoinDataComplete(new JoinData() { JoinNumber = 23, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Occ Sensor Increment US Occupied State Sensitivity", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("DecrementUsInOccupiedState")]
+ public JoinDataComplete DecrementUsInOccupiedState = new JoinDataComplete(new JoinData() { JoinNumber = 24, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Occ Sensor Decrement US Occupied State Sensitivity", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("IncrementUsInVacantState")]
+ public JoinDataComplete IncrementUsInVacantState = new JoinDataComplete(new JoinData() { JoinNumber = 25, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Occ Sensor Increment US Vacant State Sensitivity", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("DecrementUsInVacantState")]
+ public JoinDataComplete DecrementUsInVacantState = new JoinDataComplete(new JoinData() { JoinNumber = 26, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Occ Sensor Decrement US Vacant State Sensitivity", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("IncrementPirInOccupiedState")]
+ public JoinDataComplete IncrementPirInOccupiedState = new JoinDataComplete(new JoinData() { JoinNumber = 27, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Occ Sensor Increment IR Occupied State Sensitivity", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("DecrementPirInOccupiedState")]
+ public JoinDataComplete DecrementPirInOccupiedState = new JoinDataComplete(new JoinData() { JoinNumber = 28, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Occ Sensor Decrement IR Occupied State Sensitivity", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("IncrementPirInVacantState")]
+ public JoinDataComplete IncrementPirInVacantState = new JoinDataComplete(new JoinData() { JoinNumber = 29, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Occ Sensor Increment IR Vacant State Sensitivity", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("DecrementPirInVacantState")]
+ public JoinDataComplete DecrementPirInVacantState = new JoinDataComplete(new JoinData() { JoinNumber = 30, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Occ Sensor Decrement IR Vacant State Sensitivity", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("Timeout")]
+ public JoinDataComplete Timeout = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Occ Sensor Timeout Value", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
+
+ [JoinName("TimeoutLocalFeedback")]
+ public JoinDataComplete TimeoutLocalFeedback = new JoinDataComplete(new JoinData() { JoinNumber = 2, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Occ Sensor Local Timeout Value", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Analog });
+
+ [JoinName("InternalPhotoSensorValue")]
+ public JoinDataComplete InternalPhotoSensorValue = new JoinDataComplete(new JoinData() { JoinNumber = 3, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Occ Sensor Internal PhotoSensor Value", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Analog });
+
+ [JoinName("ExternalPhotoSensorValue")]
+ public JoinDataComplete ExternalPhotoSensorValue = new JoinDataComplete(new JoinData() { JoinNumber = 4, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Occ Sensor External PhotoSensor Value", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Analog });
+
+ [JoinName("UsSensitivityInOccupiedState")]
+ public JoinDataComplete UsSensitivityInOccupiedState = new JoinDataComplete(new JoinData() { JoinNumber = 5, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Occ Sensor Ultrasonic Sensitivity in Occupied State", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Analog });
+
+ [JoinName("UsSensitivityInVacantState")]
+ public JoinDataComplete UsSensitivityInVacantState = new JoinDataComplete(new JoinData() { JoinNumber = 6, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Occ Sensor Ultrasonic Sensitivity in Vacant State", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Analog });
+
+ [JoinName("PirSensitivityInOccupiedState")]
+ public JoinDataComplete PirSensitivityInOccupiedState = new JoinDataComplete(new JoinData() { JoinNumber = 7, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Occ Sensor PIR Sensitivity in Occupied State", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Analog });
+
+ [JoinName("PirSensitivityInVacantState")]
+ public JoinDataComplete PirSensitivityInVacantState = new JoinDataComplete(new JoinData() { JoinNumber = 8, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Occ Sensor Ultrasonic Sensitivity in Vacant State", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Analog });
+
+ [JoinName("Name")]
+ public JoinDataComplete Name = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Occ Sensor Name", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
+
+
+
+ public GlsOccupancySensorBaseJoinMap(uint joinStart)
+ : base(joinStart, typeof(GlsOccupancySensorBaseJoinMap))
+ {
+ }
+
+ }
+}
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/HdMdxxxCEControllerJoinMap.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/HdMdxxxCEControllerJoinMap.cs
new file mode 100644
index 00000000..825fc946
--- /dev/null
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/HdMdxxxCEControllerJoinMap.cs
@@ -0,0 +1,68 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Crestron.SimplSharp;
+using PepperDash.Essentials.Core;
+
+namespace PepperDash.Essentials.Core.Bridges
+{
+ public class HdMdxxxCEControllerJoinMap : JoinMapBaseAdvanced
+ {
+
+ [JoinName("IsOnline")]
+ public JoinDataComplete IsOnline = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Device Online", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("RemoteEndDetected")]
+ public JoinDataComplete RemoteEndDetected = new JoinDataComplete(new JoinData() { JoinNumber = 2, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Device Remote End Detected", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("AutoRouteOn")]
+ public JoinDataComplete AutoRouteOn = new JoinDataComplete(new JoinData() { JoinNumber = 3, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Device Auto Route On", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("AutoRouteOff")]
+ public JoinDataComplete AutoRouteOff = new JoinDataComplete(new JoinData() { JoinNumber = 4, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Device Auto Route Off", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("PriorityRoutingOn")]
+ public JoinDataComplete PriorityRoutingOn = new JoinDataComplete(new JoinData() { JoinNumber = 5, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Device Priority Routing On", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("PriorityRoutingOff")]
+ public JoinDataComplete PriorityRoutingOff = new JoinDataComplete(new JoinData() { JoinNumber = 6, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Device Priority Routing Off", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("InputOnScreenDisplayEnabled")]
+ public JoinDataComplete InputOnScreenDisplayEnabled = new JoinDataComplete(new JoinData() { JoinNumber = 7, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Device Input OSD Enabled", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("InputOnScreenDisplayDisabled")]
+ public JoinDataComplete InputOnScreenDisplayDisabled = new JoinDataComplete(new JoinData() { JoinNumber = 8, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Device Input OSD Disabled", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("SyncDetected")]
+ public JoinDataComplete SyncDetected = new JoinDataComplete(new JoinData() { JoinNumber = 11, JoinSpan = 5 },
+ new JoinMetadata() { Label = "Device Sync Detected", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("VideoSource")]
+ public JoinDataComplete VideoSource = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 5 },
+ new JoinMetadata() { Label = "Device Video Source Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
+
+ [JoinName("SourceCount")]
+ public JoinDataComplete SourceCount = new JoinDataComplete(new JoinData() { JoinNumber = 2, JoinSpan = 5 },
+ new JoinMetadata() { Label = "Device Video Source Count", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Analog });
+
+ [JoinName("SourceNames")]
+ public JoinDataComplete SourceNames = new JoinDataComplete(new JoinData() { JoinNumber = 11, JoinSpan = 5 },
+ new JoinMetadata() { Label = "Device Video Source Name", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
+
+
+
+ public HdMdxxxCEControllerJoinMap(uint joinStart)
+ : base(joinStart, typeof(HdMdxxxCEControllerJoinMap))
+ {
+ }
+ }
+}
\ No newline at end of file
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/IBasicCommunicationJoinMap.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/IBasicCommunicationJoinMap.cs
new file mode 100644
index 00000000..612ace4f
--- /dev/null
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/IBasicCommunicationJoinMap.cs
@@ -0,0 +1,42 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Crestron.SimplSharp;
+using PepperDash.Essentials.Core;
+
+namespace PepperDash.Essentials.Core.Bridges
+{
+ public class IBasicCommunicationJoinMap : JoinMapBaseAdvanced
+ {
+ [JoinName("TextReceived")]
+ public JoinDataComplete TextReceived = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Text Received From Remote Device", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
+
+ [JoinName("SendText")]
+ public JoinDataComplete SendText = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Text Sent To Remote Device", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Serial });
+
+ [JoinName("SetPortConfig")]
+ public JoinDataComplete SetPortConfig = new JoinDataComplete(new JoinData() { JoinNumber = 2, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Set Port Config", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Serial });
+
+ [JoinName("Connect")]
+ public JoinDataComplete Connect = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Connect", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("Connected")]
+ public JoinDataComplete Connected = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Connected", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("Status")]
+ public JoinDataComplete Status = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Status", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Analog });
+
+
+ public IBasicCommunicationJoinMap(uint joinStart)
+ : base(joinStart, typeof(IBasicCommunicationJoinMap))
+ {
+ }
+ }
+}
\ No newline at end of file
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/IDigitalInputJoinMap.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/IDigitalInputJoinMap.cs
new file mode 100644
index 00000000..a9e4ca6b
--- /dev/null
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/IDigitalInputJoinMap.cs
@@ -0,0 +1,23 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Crestron.SimplSharp;
+using PepperDash.Essentials.Core;
+
+namespace PepperDash.Essentials.Core.Bridges
+{
+ public class IDigitalInputJoinMap : JoinMapBaseAdvanced
+ {
+
+ [JoinName("InputState")]
+ public JoinDataComplete InputState = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Room Email Url", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
+
+
+ public IDigitalInputJoinMap(uint joinStart)
+ : base(joinStart, typeof(IDigitalInputJoinMap))
+ {
+ }
+ }
+}
\ 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
new file mode 100644
index 00000000..d2058a2d
--- /dev/null
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/SetTopBoxControllerJoinMap.cs
@@ -0,0 +1,233 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Crestron.SimplSharp;
+using PepperDash.Essentials.Core;
+using Crestron.SimplSharp.Reflection;
+
+
+namespace PepperDash.Essentials.Core.Bridges
+{
+ public class SetTopBoxControllerJoinMap : JoinMapBaseAdvanced
+ {
+ [JoinName("PowerOn")]
+ public JoinDataComplete PowerOn = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 },
+ new JoinMetadata() { Label = "STB Power On", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("PowerOff")]
+ public JoinDataComplete PowerOff = new JoinDataComplete(new JoinData() { JoinNumber = 2, JoinSpan = 1 },
+ new JoinMetadata() { Label = "STB Power Off", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("PowerToggle")]
+ public JoinDataComplete PowerToggle = new JoinDataComplete(new JoinData() { JoinNumber = 3, JoinSpan = 1 },
+ new JoinMetadata() { Label = "STB Power Toggle", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("HasDpad")]
+ public JoinDataComplete HasDpad = new JoinDataComplete(new JoinData() { JoinNumber = 4, JoinSpan = 1 },
+ new JoinMetadata() { Label = "STB Has DPad", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("Up")]
+ public JoinDataComplete Up = new JoinDataComplete(new JoinData() { JoinNumber = 4, JoinSpan = 1 },
+ new JoinMetadata() { Label = "STB Nav Up", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("Down")]
+ public JoinDataComplete Down = new JoinDataComplete(new JoinData() { JoinNumber = 5, JoinSpan = 1 },
+ new JoinMetadata() { Label = "STB Nav Down", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("Left")]
+ public JoinDataComplete Left = new JoinDataComplete(new JoinData() { JoinNumber = 6, JoinSpan = 1 },
+ new JoinMetadata() { Label = "STB Nav Left", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("Right")]
+ public JoinDataComplete Right = new JoinDataComplete(new JoinData() { JoinNumber = 7, JoinSpan = 1 },
+ new JoinMetadata() { Label = "STB Nav Right", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("Select")]
+ public JoinDataComplete Select = new JoinDataComplete(new JoinData() { JoinNumber = 8, JoinSpan = 1 },
+ new JoinMetadata() { Label = "STB Select", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("Menu")]
+ public JoinDataComplete Menu = new JoinDataComplete(new JoinData() { JoinNumber = 9, JoinSpan = 1 },
+ new JoinMetadata() { Label = "STB Menu", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("Exit")]
+ public JoinDataComplete Exit = new JoinDataComplete(new JoinData() { JoinNumber = 10, JoinSpan = 1 },
+ new JoinMetadata() { Label = "STB Exit", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("HasNumeric")]
+ public JoinDataComplete HasNumeric = new JoinDataComplete(new JoinData() { JoinNumber = 11, JoinSpan = 1 },
+ new JoinMetadata() { Label = "STB Has Numeric", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("Digit0")]
+ public JoinDataComplete Digit0 = new JoinDataComplete(new JoinData() { JoinNumber = 11, JoinSpan = 1 },
+ new JoinMetadata() { Label = "STB Digit 0", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("Digit1")]
+ public JoinDataComplete Digit1 = new JoinDataComplete(new JoinData() { JoinNumber = 12, JoinSpan = 1 },
+ new JoinMetadata() { Label = "STB Digit 1", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("Digit2")]
+ public JoinDataComplete Digit2 = new JoinDataComplete(new JoinData() { JoinNumber = 13, JoinSpan = 1 },
+ new JoinMetadata() { Label = "STB Digit 2", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("Digit3")]
+ public JoinDataComplete Digit3 = new JoinDataComplete(new JoinData() { JoinNumber = 14, JoinSpan = 1 },
+ new JoinMetadata() { Label = "STB Digit 3", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("Digit4")]
+ public JoinDataComplete Digit4 = new JoinDataComplete(new JoinData() { JoinNumber = 15, JoinSpan = 1 },
+ new JoinMetadata() { Label = "STB Digit 4", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("Digit5")]
+ public JoinDataComplete Digit5 = new JoinDataComplete(new JoinData() { JoinNumber = 16, JoinSpan = 1 },
+ new JoinMetadata() { Label = "STB Digit 5", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("Digit6")]
+ public JoinDataComplete Digit6 = new JoinDataComplete(new JoinData() { JoinNumber = 17, JoinSpan = 1 },
+ new JoinMetadata() { Label = "STB Digit 6", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("Digit7")]
+ public JoinDataComplete Digit7 = new JoinDataComplete(new JoinData() { JoinNumber = 18, JoinSpan = 1 },
+ new JoinMetadata() { Label = "STB Digit 7", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("Digit8")]
+ public JoinDataComplete Digit8 = new JoinDataComplete(new JoinData() { JoinNumber = 19, JoinSpan = 1 },
+ new JoinMetadata() { Label = "STB Digit 8", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("Digit9")]
+ public JoinDataComplete Digit9 = new JoinDataComplete(new JoinData() { JoinNumber = 20, JoinSpan = 1 },
+ new JoinMetadata() { Label = "STB Digit 9", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("Dash")]
+ public JoinDataComplete Dash = new JoinDataComplete(new JoinData() { JoinNumber = 21, JoinSpan = 1 },
+ new JoinMetadata() { Label = "STB Dash", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("KeypadEnter")]
+ public JoinDataComplete KeypadEnter = new JoinDataComplete(new JoinData() { JoinNumber = 22, JoinSpan = 1 },
+ new JoinMetadata() { Label = "STB Keypad Enter", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("ChannelUp")]
+ public JoinDataComplete ChannelUp = new JoinDataComplete(new JoinData() { JoinNumber = 23, JoinSpan = 1 },
+ new JoinMetadata() { Label = "STB Channel Up", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("ChannelDown")]
+ public JoinDataComplete ChannelDown = new JoinDataComplete(new JoinData() { JoinNumber = 24, JoinSpan = 1 },
+ new JoinMetadata() { Label = "STB Channel Down", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("LastChannel")]
+ public JoinDataComplete LastChannel = new JoinDataComplete(new JoinData() { JoinNumber = 25, JoinSpan = 1 },
+ new JoinMetadata() { Label = "STB Last Channel", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("Guide")]
+ public JoinDataComplete Guide = new JoinDataComplete(new JoinData() { JoinNumber = 26, JoinSpan = 1 },
+ new JoinMetadata() { Label = "STB Guide", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("Info")]
+ public JoinDataComplete Info = new JoinDataComplete(new JoinData() { JoinNumber = 27, JoinSpan = 1 },
+ new JoinMetadata() { Label = "STB Info", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("Red")]
+ public JoinDataComplete Red = new JoinDataComplete(new JoinData() { JoinNumber = 28, JoinSpan = 1 },
+ new JoinMetadata() { Label = "STB Red", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("Green")]
+ public JoinDataComplete Green = new JoinDataComplete(new JoinData() { JoinNumber = 29, JoinSpan = 1 },
+ new JoinMetadata() { Label = "STB Green", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("Yellow")]
+ public JoinDataComplete Yellow = new JoinDataComplete(new JoinData() { JoinNumber = 30, JoinSpan = 1 },
+ new JoinMetadata() { Label = "STB Yellow", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("Blue")]
+ public JoinDataComplete Blue = new JoinDataComplete(new JoinData() { JoinNumber = 31, JoinSpan = 1 },
+ new JoinMetadata() { Label = "STB Blue", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("HasDvr")]
+ public JoinDataComplete HasDvr = new JoinDataComplete(new JoinData() { JoinNumber = 32, JoinSpan = 1 },
+ new JoinMetadata() { Label = "STB Has DVR", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("DvrList")]
+ public JoinDataComplete DvrList = new JoinDataComplete(new JoinData() { JoinNumber = 32, JoinSpan = 1 },
+ new JoinMetadata() { Label = "STB DvrList", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("Play")]
+ public JoinDataComplete Play = new JoinDataComplete(new JoinData() { JoinNumber = 33, JoinSpan = 1 },
+ new JoinMetadata() { Label = "STB Play", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("Pause")]
+ public JoinDataComplete Pause = new JoinDataComplete(new JoinData() { JoinNumber = 34, JoinSpan = 1 },
+ new JoinMetadata() { Label = "STB Pause", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("Stop")]
+ public JoinDataComplete Stop = new JoinDataComplete(new JoinData() { JoinNumber = 35, JoinSpan = 1 },
+ new JoinMetadata() { Label = "STB Stop", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("FFwd")]
+ public JoinDataComplete FFwd = new JoinDataComplete(new JoinData() { JoinNumber = 36, JoinSpan = 1 },
+ new JoinMetadata() { Label = "STB FFwd", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("Rewind")]
+ public JoinDataComplete Rewind = new JoinDataComplete(new JoinData() { JoinNumber = 37, JoinSpan = 1 },
+ new JoinMetadata() { Label = "STB Rewind", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("ChapPlus")]
+ public JoinDataComplete ChapPlus = new JoinDataComplete(new JoinData() { JoinNumber = 38, JoinSpan = 1 },
+ new JoinMetadata() { Label = "STB Chapter Plus", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("ChapMinus")]
+ public JoinDataComplete ChapMinus = new JoinDataComplete(new JoinData() { JoinNumber = 39, JoinSpan = 1 },
+ new JoinMetadata() { Label = "STB Chapter Minus", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("Replay")]
+ public JoinDataComplete Replay = new JoinDataComplete(new JoinData() { JoinNumber = 40, JoinSpan = 1 },
+ new JoinMetadata() { Label = "STB Replay", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("Record")]
+ public JoinDataComplete Record = new JoinDataComplete(new JoinData() { JoinNumber = 41, JoinSpan = 1 },
+ new JoinMetadata() { Label = "STB Record", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("HasKeypadAccessoryButton1")]
+ public JoinDataComplete HasKeypadAccessoryButton1 = new JoinDataComplete(new JoinData() { JoinNumber = 42, JoinSpan = 1 },
+ new JoinMetadata() { Label = "STB 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() { Label = "STB 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() { Label = "STB 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() { Label = "STB 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() { Label = "STB Name", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("KeypadAccessoryButton1Label")]
+ public JoinDataComplete KeypadAccessoryButton1Label = new JoinDataComplete(new JoinData() { JoinNumber = 42, JoinSpan = 1 },
+ new JoinMetadata() { Label = "STB 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() { Label = "STB Keypad Accessory Button 1 Label", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
+
+ [JoinName("LoadPresets")]
+ public JoinDataComplete LoadPresets = new JoinDataComplete(new JoinData() { JoinNumber = 50, JoinSpan = 1 },
+ new JoinMetadata() { Label = "STB Load Presets", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("HasPresets")]
+ public JoinDataComplete HasPresets = new JoinDataComplete(new JoinData() { JoinNumber = 50, JoinSpan = 1 },
+ new JoinMetadata() { Label = "STB Load Presets", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
+
+
+
+ public SetTopBoxControllerJoinMap(uint joinStart)
+ : base(joinStart, typeof(SetTopBoxControllerJoinMap))
+ {
+ }
+ }
+}
\ No newline at end of file
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/StatusSignControllerJoinMap.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/StatusSignControllerJoinMap.cs
new file mode 100644
index 00000000..fc699c02
--- /dev/null
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/StatusSignControllerJoinMap.cs
@@ -0,0 +1,48 @@
+using System.Linq;
+using Crestron.SimplSharp.Reflection;
+using PepperDash.Essentials.Core;
+
+namespace PepperDash.Essentials.Core.Bridges
+{
+ public class StatusSignControllerJoinMap : JoinMapBaseAdvanced
+ {
+ [JoinName("IsOnline")]
+ public JoinDataComplete IsOnline = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Status Sign Online", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("Name")]
+ public JoinDataComplete Name = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Status Sign Name", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
+
+ [JoinName("RedControl")]
+ public JoinDataComplete RedControl = new JoinDataComplete(new JoinData() { JoinNumber = 2, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Status Red LED Enable / Disable", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("RedLed")]
+ public JoinDataComplete RedLed = new JoinDataComplete(new JoinData() { JoinNumber = 2, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Status Red LED Intensity", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
+
+ [JoinName("GreenControl")]
+ public JoinDataComplete GreenControl = new JoinDataComplete(new JoinData() { JoinNumber = 3, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Status Green LED Enable / Disable", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("GreenLed")]
+ public JoinDataComplete GreenLed = new JoinDataComplete(new JoinData() { JoinNumber = 3, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Status Green LED Intensity", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
+
+ [JoinName("BlueControl")]
+ public JoinDataComplete BlueControl = new JoinDataComplete(new JoinData() { JoinNumber = 4, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Status Blue LED Enable / Disable", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("BlueLed")]
+ public JoinDataComplete BlueLed = new JoinDataComplete(new JoinData() { JoinNumber = 4, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Status Blue LED Intensity", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
+
+
+ public StatusSignControllerJoinMap(uint joinStart)
+ : base(joinStart, typeof(StatusSignControllerJoinMap))
+ {
+ }
+
+ }
+}
\ 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
new file mode 100644
index 00000000..a021eaaa
--- /dev/null
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/SystemMonitorJoinMap.cs
@@ -0,0 +1,141 @@
+using PepperDash.Essentials.Core;
+
+namespace PepperDash.Essentials.Core.Bridges
+{
+ public class SystemMonitorJoinMap : JoinMapBaseAdvanced
+ {
+ [JoinName("TimeZone")]
+ public JoinDataComplete TimeZone = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Processor Timezone", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Analog });
+
+ [JoinName("TimeZoneName")]
+ public JoinDataComplete TimeZoneName = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Processor Timezone Name", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
+
+ [JoinName("IOControllerVersion")]
+ public JoinDataComplete IOControllerVersion = new JoinDataComplete(new JoinData() { JoinNumber = 2, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Processor IO Controller Version", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
+
+ [JoinName("SnmpAppVersion")]
+ public JoinDataComplete SnmpAppVersion = new JoinDataComplete(new JoinData() { JoinNumber = 3, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Processor SNMP App Version", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
+
+ [JoinName("BACnetAppVersion")]
+ public JoinDataComplete BACnetAppVersion = new JoinDataComplete(new JoinData() { JoinNumber = 4, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Processor BACNet App Version", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
+
+ [JoinName("ControllerVersion")]
+ public JoinDataComplete ControllerVersion = new JoinDataComplete(new JoinData() { JoinNumber = 5, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Processor Controller Version", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
+
+ [JoinName("SerialNumber")]
+ public JoinDataComplete SerialNumber = new JoinDataComplete(new JoinData() { JoinNumber = 6, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Processor Serial Number", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
+
+ [JoinName("Model")]
+ public JoinDataComplete Model = new JoinDataComplete(new JoinData() { JoinNumber = 7, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Processor Model", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
+
+ [JoinName("Uptime")]
+ public JoinDataComplete Uptime = new JoinDataComplete(new JoinData() { JoinNumber = 8, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Processor Uptime", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
+
+ [JoinName("LastBoot")]
+ public JoinDataComplete LastBoot = new JoinDataComplete(new JoinData() { JoinNumber = 9, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Processor Last Boot", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
+
+ [JoinName("ProgramOffsetJoin")]
+ public JoinDataComplete ProgramOffsetJoin = new JoinDataComplete(new JoinData() { JoinNumber = 5, JoinSpan = 1 },
+ new JoinMetadata() { Label = "All Program Data is offset between slots by 5 - First Joins Start at 11", JoinCapabilities = eJoinCapabilities.None, JoinType = eJoinType.None });
+
+ [JoinName("ProgramStart")]
+ public JoinDataComplete ProgramStart = new JoinDataComplete(new JoinData() { JoinNumber = 11, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Processor Program Start / Fb", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("ProgramStop")]
+ public JoinDataComplete ProgramStop = new JoinDataComplete(new JoinData() { JoinNumber = 12, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Processor Program Stop / Fb", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("ProgramRegister")]
+ public JoinDataComplete ProgramRegister = new JoinDataComplete(new JoinData() { JoinNumber = 13, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Processor Program Register / Fb", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("ProgramUnregister")]
+ public JoinDataComplete ProgramUnregister = new JoinDataComplete(new JoinData() { JoinNumber = 14, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Processor Program UnRegister / Fb", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("ProgramName")]
+ public JoinDataComplete ProgramName = new JoinDataComplete(new JoinData() { JoinNumber = 11, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Processor Program Name", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
+
+ [JoinName("ProgramCompiledTime")]
+ public JoinDataComplete ProgramCompiledTime = new JoinDataComplete(new JoinData() { JoinNumber = 12, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Processor Program Compile Time", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
+
+ [JoinName("ProgramCrestronDatabaseVersion")]
+ public JoinDataComplete ProgramCrestronDatabaseVersion = new JoinDataComplete(new JoinData() { JoinNumber = 13, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Processor Program Database Version", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
+
+ [JoinName("ProgramEnvironmentVersion")]
+ public JoinDataComplete ProgramEnvironmentVersion = new JoinDataComplete(new JoinData() { JoinNumber = 14, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Processor Program Environment Version", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
+
+ [JoinName("AggregatedProgramInfo")]
+ public JoinDataComplete AggregatedProgramInfo = new JoinDataComplete(new JoinData() { JoinNumber = 15, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Processor Program Aggregate Info Json", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
+
+ [JoinName("EthernetOffsetJoin")]
+ public JoinDataComplete EthernetOffsetJoin = new JoinDataComplete(new JoinData() { JoinNumber = 15, JoinSpan = 1 },
+ new JoinMetadata() { Label = "All Ethernet Data is offset between Nics by 5 - First Joins Start at 76", JoinCapabilities = eJoinCapabilities.None, JoinType = eJoinType.None });
+
+ [JoinName("HostName")]
+ public JoinDataComplete HostName = new JoinDataComplete(new JoinData() { JoinNumber = 76, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Processor Ethernet Hostname", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
+
+ [JoinName("CurrentIpAddress")]
+ public JoinDataComplete CurrentIpAddress = new JoinDataComplete(new JoinData() { JoinNumber = 77, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Processor Ethernet Current Ip Address", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
+
+ [JoinName("CurrentSubnetMask")]
+ public JoinDataComplete CurrentSubnetMask = new JoinDataComplete(new JoinData() { JoinNumber = 78, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Processor Ethernet Current Subnet Mask", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
+
+ [JoinName("CurrentDefaultGateway")]
+ public JoinDataComplete CurrentDefaultGateway = new JoinDataComplete(new JoinData() { JoinNumber = 79, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Processor Ethernet Current Default Gateway", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
+
+ [JoinName("StaticIpAddress")]
+ public JoinDataComplete StaticIpAddress = new JoinDataComplete(new JoinData() { JoinNumber = 80, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Processor Ethernet Static Ip Address", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
+
+ [JoinName("StaticSubnetMask")]
+ public JoinDataComplete StaticSubnetMask = new JoinDataComplete(new JoinData() { JoinNumber = 81, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Processor Ethernet Static Subnet Mask", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
+
+ [JoinName("StaticDefaultGateway")]
+ public JoinDataComplete StaticDefaultGateway = new JoinDataComplete(new JoinData() { JoinNumber = 82, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Processor Ethernet Static Default Gateway", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
+
+ [JoinName("Domain")]
+ public JoinDataComplete Domain = new JoinDataComplete(new JoinData() { JoinNumber = 83, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Processor Ethernet Domain", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
+
+ [JoinName("DnsServer")]
+ public JoinDataComplete DnsServer = new JoinDataComplete(new JoinData() { JoinNumber = 84, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Processor Ethernet Dns Server", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
+
+ [JoinName("MacAddress")]
+ public JoinDataComplete MacAddress = new JoinDataComplete(new JoinData() { JoinNumber = 85, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Processor Ethernet Mac Address", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
+
+ [JoinName("DhcpStatus")]
+ public JoinDataComplete DhcpStatus = new JoinDataComplete(new JoinData() { JoinNumber = 86, JoinSpan = 1 },
+ new JoinMetadata() { Label = "Processor Ethernet Dhcp Status", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
+
+
+ public SystemMonitorJoinMap(uint joinStart)
+ : base(joinStart, typeof(SystemMonitorJoinMap))
+ {
+ }
+ }
+}
\ No newline at end of file
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Config/Comm and IR/CecPortController.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Config/Comm and IR/CecPortController.cs
index a2493e3c..1ab38d89 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Config/Comm and IR/CecPortController.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Config/Comm and IR/CecPortController.cs
@@ -20,6 +20,17 @@ namespace PepperDash.Essentials.Core
ICec Port;
+ public CecPortController(string key, Func postActivationFunc,
+ EssentialsControlPropertiesConfig config):base(key)
+ {
+ AddPostActivationAction(() =>
+ {
+ Port = postActivationFunc(config);
+
+ Port.StreamCec.CecChange += StreamCec_CecChange;
+ });
+ }
+
public CecPortController(string key, ICec port)
: base(key)
{
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Config/Comm and IR/ComPortController.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Config/Comm and IR/ComPortController.cs
index a5a5b14f..3fbfb43d 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Config/Comm and IR/ComPortController.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Config/Comm and IR/ComPortController.cs
@@ -21,6 +21,19 @@ namespace PepperDash.Essentials.Core
ComPort Port;
ComPort.ComPortSpec Spec;
+ public ComPortController(string key, Func postActivationFunc,
+ ComPort.ComPortSpec spec, EssentialsControlPropertiesConfig config) : base(key)
+ {
+ Spec = spec;
+
+ AddPostActivationAction(() =>
+ {
+ Port = postActivationFunc(config);
+
+ RegisterAndConfigureComPort();
+ });
+ }
+
public ComPortController(string key, ComPort port, ComPort.ComPortSpec spec)
: base(key)
{
@@ -34,27 +47,31 @@ namespace PepperDash.Essentials.Core
Spec = spec;
//IsConnected = new BoolFeedback(CommonBoolCue.IsConnected, () => true);
- if (Port.Parent is CrestronControlSystem)
- {
-
-
- var result = Port.Register();
- if (result != eDeviceRegistrationUnRegistrationResponse.Success)
- {
- Debug.Console(0, this, "ERROR: Cannot register Com port: {0}", result);
- return; // false
- }
- }
- var specResult = Port.SetComPortSpec(Spec);
- if (specResult != 0)
- {
- Debug.Console(0, this, "WARNING: Cannot set comspec");
- return; // false
- }
- Port.SerialDataReceived += new ComPortDataReceivedEvent(Port_SerialDataReceived);
+ RegisterAndConfigureComPort();
}
- ~ComPortController()
+ private void RegisterAndConfigureComPort()
+ {
+ if (Port.Parent is CrestronControlSystem)
+ {
+ var result = Port.Register();
+ if (result != eDeviceRegistrationUnRegistrationResponse.Success)
+ {
+ Debug.Console(0, this, "ERROR: Cannot register Com port: {0}", result);
+ return; // false
+ }
+ }
+
+ var specResult = Port.SetComPortSpec(Spec);
+ if (specResult != 0)
+ {
+ Debug.Console(0, this, "WARNING: Cannot set comspec");
+ return;
+ }
+ Port.SerialDataReceived += Port_SerialDataReceived;
+ }
+
+ ~ComPortController()
{
Port.SerialDataReceived -= Port_SerialDataReceived;
}
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Config/Comm and IR/CommFactory.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Config/Comm and IR/CommFactory.cs
index 23aea272..94110fd7 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Config/Comm and IR/CommFactory.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Config/Comm and IR/CommFactory.cs
@@ -48,10 +48,10 @@ namespace PepperDash.Essentials.Core
switch (controlConfig.Method)
{
case eControlMethod.Com:
- comm = new ComPortController(deviceConfig.Key + "-com", GetComPort(controlConfig), controlConfig.ComParams);
+ comm = new ComPortController(deviceConfig.Key + "-com", GetComPort, controlConfig.ComParams, controlConfig);
break;
case eControlMethod.Cec:
- comm = new CecPortController(deviceConfig.Key + "-cec", GetCecPort(controlConfig));
+ comm = new CecPortController(deviceConfig.Key + "-cec", GetCecPort, controlConfig);
break;
case eControlMethod.IR:
break;
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Config/Comm and IR/ConsoleCommMockDevice.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Config/Comm and IR/ConsoleCommMockDevice.cs
index d833aafa..f360e52b 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Config/Comm and IR/ConsoleCommMockDevice.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Config/Comm and IR/ConsoleCommMockDevice.cs
@@ -5,10 +5,12 @@ using System.Text;
using Crestron.SimplSharp;
using PepperDash.Core;
+using PepperDash.Essentials.Core.Config;
+
namespace PepperDash.Essentials.Core
{
- public class ConsoleCommMockDevice : Device, ICommunicationMonitor
+ public class ConsoleCommMockDevice : EssentialsDevice, ICommunicationMonitor
{
public IBasicCommunication Communication { get; private set; }
public CommunicationGather PortGather { get; private set; }
@@ -71,4 +73,21 @@ namespace PepperDash.Essentials.Core
}
}
+ public class ConsoleCommMockDeviceFactory : EssentialsDeviceFactory
+ {
+ public ConsoleCommMockDeviceFactory()
+ {
+ TypeNames = new List() { "commmock" };
+ }
+
+ public override EssentialsDevice BuildDevice(DeviceConfig dc)
+ {
+ Debug.Console(1, "Factory Attempting to create new Comm Mock Device");
+ var comm = CommFactory.CreateCommForDevice(dc);
+ var props = Newtonsoft.Json.JsonConvert.DeserializeObject(
+ dc.Properties.ToString());
+ return new ConsoleCommMockDevice(dc.Key, dc.Name, props, comm);
+ }
+ }
+
}
\ No newline at end of file
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Config/Comm and IR/GenericComm.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Config/Comm and IR/GenericComm.cs
index 45657e3e..74122905 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Config/Comm and IR/GenericComm.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Config/Comm and IR/GenericComm.cs
@@ -1,75 +1,135 @@
-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.Devices;
-using PepperDash.Essentials.Core.Config;
-
-
-namespace PepperDash.Essentials.Core
-{
- ///
- /// Serves as a generic wrapper class for all styles of IBasicCommuncation ports
- ///
- public class GenericComm : ReconfigurableDevice
- {
- EssentialsControlPropertiesConfig PropertiesConfig;
-
- public IBasicCommunication CommPort { get; private set; }
-
- public GenericComm(DeviceConfig config)
- : base(config)
- {
- PropertiesConfig = CommFactory.GetControlPropertiesConfig(config);
-
- CommPort = CommFactory.CreateCommForDevice(config);
-
- }
-
- public static IKeyed BuildDevice(DeviceConfig dc)
- {
- Debug.Console(1, "Factory Attempting to create new Generic Comm Device");
- return new GenericComm(dc);
- }
-
- public void SetPortConfig(string portConfig)
- {
- // TODO: Deserialize new EssentialsControlPropertiesConfig and handle as necessary
- try
- {
- PropertiesConfig = JsonConvert.DeserializeObject
- (portConfig.ToString());
- }
- catch (Exception e)
- {
- Debug.Console(2, this, "Error deserializing port config: {0}", e);
- }
- }
-
- protected override void CustomSetConfig(DeviceConfig config)
- {
- PropertiesConfig = CommFactory.GetControlPropertiesConfig(config);
-
- ConfigWriter.UpdateDeviceConfig(config);
- }
- }
-
- public class GenericCommFactory : Essentials.Core.EssentialsDeviceFactory
- {
- public GenericCommFactory()
- {
- TypeNames = new List() { "genericComm" };
- }
-
- public override EssentialsDevice BuildDevice(DeviceConfig dc)
- {
- Debug.Console(1, "Factory Attempting to create new Generic Comm Device");
- return new GenericComm(dc);
- }
- }
+using System;
+using System.Collections.Generic;
+using Crestron.SimplSharp.CrestronSockets;
+using Crestron.SimplSharpPro.DeviceSupport;
+using Newtonsoft.Json;
+
+using PepperDash.Core;
+using PepperDash.Essentials.Core.Bridges;
+using PepperDash.Essentials.Core.Devices;
+using PepperDash.Essentials.Core.Config;
+
+
+namespace PepperDash.Essentials.Core
+{
+ ///
+ /// Serves as a generic wrapper class for all styles of IBasicCommuncation ports
+ ///
+ [Description("Generic communication wrapper class for any IBasicCommunication type")]
+ public class GenericComm : ReconfigurableBridgableDevice
+ {
+ EssentialsControlPropertiesConfig PropertiesConfig;
+
+ public IBasicCommunication CommPort { get; private set; }
+
+ public GenericComm(DeviceConfig config)
+ : base(config)
+ {
+ PropertiesConfig = CommFactory.GetControlPropertiesConfig(config);
+
+ var commPort = CommFactory.CreateCommForDevice(config);
+
+ //Fixing decision to require '-comPorts' in delcaration for DGE in order to get a device with comports included
+ if (commPort == null)
+ {
+ config.Key = config.Key + "-comPorts";
+ commPort = CommFactory.CreateCommForDevice(config);
+ }
+
+ CommPort = commPort;
+
+ }
+
+ public static IKeyed BuildDevice(DeviceConfig dc)
+ {
+ Debug.Console(1, "Factory Attempting to create new Generic Comm Device");
+ return new GenericComm(dc);
+ }
+
+ public void SetPortConfig(string portConfig)
+ {
+ // TODO: Deserialize new EssentialsControlPropertiesConfig and handle as necessary
+ try
+ {
+ PropertiesConfig = JsonConvert.DeserializeObject
+ (portConfig);
+ }
+ catch (Exception e)
+ {
+ Debug.Console(2, this, "Error deserializing port config: {0}", e);
+ }
+ }
+
+ protected override void CustomSetConfig(DeviceConfig config)
+ {
+ PropertiesConfig = CommFactory.GetControlPropertiesConfig(config);
+
+ ConfigWriter.UpdateDeviceConfig(config);
+ }
+
+ public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
+ {
+ var joinMap = new IBasicCommunicationJoinMap(joinStart);
+
+ var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
+
+ if (!string.IsNullOrEmpty(joinMapSerialized))
+ joinMap = JsonConvert.DeserializeObject(joinMapSerialized);
+
+ bridge.AddJoinMap(Key, joinMap);
+
+ if (CommPort == null)
+ {
+ Debug.Console(1, this, "Unable to link device '{0}'. CommPort is null", Key);
+ return;
+ }
+
+ Debug.Console(1, this, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
+
+ // 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));
+ trilist.SetStringSigAction(joinMap.SetPortConfig.JoinNumber, SetPortConfig);
+
+
+ var sComm = this as ISocketStatus;
+ if (sComm == null) return;
+ sComm.ConnectionChange += (s, a) =>
+ {
+ trilist.SetUshort(joinMap.Status.JoinNumber, (ushort)(a.Client.ClientStatus));
+ trilist.SetBool(joinMap.Connected.JoinNumber, a.Client.ClientStatus ==
+ SocketStatus.SOCKET_STATUS_CONNECTED);
+ };
+
+ trilist.SetBoolSigAction(joinMap.Connect.JoinNumber, b =>
+ {
+ if (b)
+ {
+ sComm.Connect();
+ }
+ else
+ {
+ sComm.Disconnect();
+ }
+ });
+ }
+ }
+
+ public class GenericCommFactory : EssentialsDeviceFactory
+ {
+ public GenericCommFactory()
+ {
+ TypeNames = new List() { "genericComm" };
+ }
+
+ public override EssentialsDevice BuildDevice(DeviceConfig dc)
+ {
+ Debug.Console(1, "Factory Attempting to create new Generic Comm Device");
+ return new GenericComm(dc);
+ }
+ }
}
\ 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 1cd7b93e..cb361d28 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Config/Essentials/ConfigWriter.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Config/Essentials/ConfigWriter.cs
@@ -19,7 +19,8 @@ namespace PepperDash.Essentials.Core.Config
public const long WriteTimeout = 30000;
- public static CTimer WriteTimer;
+ public static CTimer WriteTimer;
+ static CCriticalSection fileLock = new CCriticalSection();
///
/// Updates the config properties of a device
@@ -127,8 +128,6 @@ namespace PepperDash.Essentials.Core.Config
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Writing Configuration to file");
- var fileLock = new CCriticalSection();
-
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Attempting to write config file: '{0}'", filePath);
try
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Crestron IO/C2nRts/C2nRthsController.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Crestron IO/C2nRts/C2nRthsController.cs
index 865acd1c..728b2487 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Crestron IO/C2nRts/C2nRthsController.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Crestron IO/C2nRts/C2nRthsController.cs
@@ -1,44 +1,92 @@
-using System;
-using Crestron.SimplSharpPro;
-using Crestron.SimplSharpPro.GeneralIO;
-using PepperDash.Core;
-using PepperDash.Essentials.Core;
-
-namespace PepperDash.Essentials.Core.CrestronIO
-{
- public class C2nRthsController:CrestronGenericBaseDevice
- {
- private C2nRths _device;
-
- public IntFeedback TemperatureFeedback { get; private set; }
- public IntFeedback HumidityFeedback { get; private set; }
-
- public C2nRthsController(string key, string name, GenericBase hardware) : base(key, name, hardware)
- {
- _device = hardware as C2nRths;
-
- TemperatureFeedback = new IntFeedback(() => _device.TemperatureFeedback.UShortValue);
- HumidityFeedback = new IntFeedback(() => _device.HumidityFeedback.UShortValue);
-
- _device.BaseEvent += DeviceOnBaseEvent;
- }
-
- private void DeviceOnBaseEvent(GenericBase device, BaseEventArgs args)
- {
- switch (args.EventId)
- {
- case C2nRths.TemperatureFeedbackEventId:
- TemperatureFeedback.FireUpdate();
- break;
- case C2nRths.HumidityFeedbackEventId:
- HumidityFeedback.FireUpdate();
- break;
- }
- }
-
- public void SetTemperatureFormat(bool setToC)
- {
- _device.TemperatureFormat.BoolValue = setToC;
- }
- }
+using System.Collections.Generic;
+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.Config;
+
+
+namespace PepperDash.Essentials.Core.CrestronIO
+{
+ [Description("Wrapper class for the C2N-RTHS sensor")]
+ public class C2nRthsController : CrestronGenericBridgeableBaseDevice
+ {
+ private readonly C2nRths _device;
+
+ public IntFeedback TemperatureFeedback { get; private set; }
+ public IntFeedback HumidityFeedback { get; private set; }
+
+ public C2nRthsController(string key, string name, GenericBase hardware) : base(key, name, hardware)
+ {
+ _device = hardware as C2nRths;
+
+ TemperatureFeedback = new IntFeedback(() => _device.TemperatureFeedback.UShortValue);
+ HumidityFeedback = new IntFeedback(() => _device.HumidityFeedback.UShortValue);
+
+ if (_device != null) _device.BaseEvent += DeviceOnBaseEvent;
+ }
+
+ private void DeviceOnBaseEvent(GenericBase device, BaseEventArgs args)
+ {
+ switch (args.EventId)
+ {
+ case C2nRths.TemperatureFeedbackEventId:
+ TemperatureFeedback.FireUpdate();
+ break;
+ case C2nRths.HumidityFeedbackEventId:
+ HumidityFeedback.FireUpdate();
+ break;
+ }
+ }
+
+ public void SetTemperatureFormat(bool setToC)
+ {
+ _device.TemperatureFormat.BoolValue = setToC;
+ }
+
+ public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
+ {
+ var joinMap = new C2nRthsControllerJoinMap(joinStart);
+
+ var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
+
+ if (!string.IsNullOrEmpty(joinMapSerialized))
+ joinMap = JsonConvert.DeserializeObject(joinMapSerialized);
+
+ bridge.AddJoinMap(Key, joinMap);
+
+ Debug.Console(1, this, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
+
+
+ trilist.SetBoolSigAction(joinMap.TemperatureFormat.JoinNumber, SetTemperatureFormat);
+
+
+
+ IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline.JoinNumber]);
+ TemperatureFeedback.LinkInputSig(trilist.UShortInput[joinMap.Temperature.JoinNumber]);
+ HumidityFeedback.LinkInputSig(trilist.UShortInput[joinMap.Humidity.JoinNumber]);
+
+ trilist.StringInput[joinMap.Name.JoinNumber].StringValue = Name;
+ }
+ }
+
+ public class C2nRthsControllerFactory : EssentialsDeviceFactory
+ {
+ public C2nRthsControllerFactory()
+ {
+ TypeNames = new List() { "c2nrths" };
+ }
+
+ public override EssentialsDevice BuildDevice(DeviceConfig dc)
+ {
+ Debug.Console(1, "Factory Attempting to create new C2N-RTHS Device");
+
+ var control = CommFactory.GetControlPropertiesConfig(dc);
+ var cresnetId = control.CresnetIdInt;
+
+ return new C2nRthsController(dc.Key, dc.Name, new C2nRths(cresnetId, Global.ControlSystem));
+ }
+ }
}
\ No newline at end of file
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Crestron IO/Inputs/CenIoDigIn104Controller.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Crestron IO/Inputs/CenIoDigIn104Controller.cs
index 6bdfc25c..5112f3aa 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Crestron IO/Inputs/CenIoDigIn104Controller.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Crestron IO/Inputs/CenIoDigIn104Controller.cs
@@ -5,6 +5,8 @@ using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.GeneralIO;
+using PepperDash.Essentials.Core.Config;
+
using PepperDash.Core;
@@ -13,7 +15,8 @@ namespace PepperDash.Essentials.Core
///
/// Wrapper class for CEN-IO-DIGIN-104 digital input module
///
- public class CenIoDigIn104Controller : Device, IDigitalInputPorts
+ [Description("Wrapper class for the CEN-IO-DIGIN-104 diginal input module")]
+ public class CenIoDigIn104Controller : EssentialsDevice, IDigitalInputPorts
{
public CenIoDi104 Di104 { get; private set; }
@@ -37,4 +40,23 @@ namespace PepperDash.Essentials.Core
#endregion
}
+
+ public class CenIoDigIn104ControllerFactory : EssentialsDeviceFactory
+ {
+ public CenIoDigIn104ControllerFactory()
+ {
+ TypeNames = new List() { "ceniodigin104" };
+ }
+
+ public override EssentialsDevice BuildDevice(DeviceConfig dc)
+ {
+ Debug.Console(1, "Factory Attempting to create new CEN-DIGIN-104 Device");
+
+ var control = CommFactory.GetControlPropertiesConfig(dc);
+ var ipid = control.IpIdInt;
+
+ return new CenIoDigIn104Controller(dc.Key, dc.Name, new Crestron.SimplSharpPro.GeneralIO.CenIoDi104(ipid, Global.ControlSystem));
+ }
+ }
+
}
\ No newline at end of file
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Crestron IO/Inputs/GenericDigitalInputDevice.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Crestron IO/Inputs/GenericDigitalInputDevice.cs
index 3c1849f9..774c7490 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Crestron IO/Inputs/GenericDigitalInputDevice.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Crestron IO/Inputs/GenericDigitalInputDevice.cs
@@ -4,12 +4,16 @@ 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;
+using PepperDash.Essentials.Core.Config;
+
namespace PepperDash.Essentials.Core.CrestronIO
{
- public class GenericDigitalInputDevice : Device, IDigitalInput
+ public class GenericDigitalInputDevice : EssentialsBridgeableDevice, IDigitalInput
{
public DigitalInput InputPort { get; private set; }
@@ -30,7 +34,7 @@ namespace PepperDash.Essentials.Core.CrestronIO
InputPort = inputPort;
- InputPort.StateChange += new DigitalInputEventHandler(InputPort_StateChange);
+ InputPort.StateChange += InputPort_StateChange;
}
@@ -39,5 +43,120 @@ namespace PepperDash.Essentials.Core.CrestronIO
InputStateFeedback.FireUpdate();
}
+ public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
+ {
+ var joinMap = new IDigitalInputJoinMap(joinStart);
+
+ var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
+
+ if (!string.IsNullOrEmpty(joinMapSerialized))
+ joinMap = JsonConvert.DeserializeObject(joinMapSerialized);
+
+ bridge.AddJoinMap(Key, joinMap);
+
+ try
+ {
+ Debug.Console(1, this, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
+
+ // Link feedback for input state
+ InputStateFeedback.LinkInputSig(trilist.BooleanInput[joinMap.InputState.JoinNumber]);
+ }
+ catch (Exception e)
+ {
+ Debug.Console(1, this, "Unable to link device '{0}'. Input is null", Key);
+ Debug.Console(1, this, "Error: {0}", e);
+ }
+ }
}
+
+ public class GenericDigitalInputDeviceFactory : EssentialsDeviceFactory
+ {
+ public GenericDigitalInputDeviceFactory()
+ {
+ TypeNames = new List() { "digitalinput" };
+ }
+
+ public override EssentialsDevice BuildDevice(DeviceConfig dc)
+ {
+ Debug.Console(1, "Factory Attempting to create new Digtal Input Device");
+
+ var props = JsonConvert.DeserializeObject(dc.Properties.ToString());
+
+ IDigitalInputPorts portDevice;
+
+ if (props.PortDeviceKey == "processor")
+ portDevice = Global.ControlSystem as IDigitalInputPorts;
+ else
+ portDevice = DeviceManager.GetDeviceForKey(props.PortDeviceKey) as IDigitalInputPorts;
+
+ if (portDevice == null)
+ Debug.Console(0, "ERROR: Unable to add digital input device with key '{0}'. Port Device does not support digital inputs", dc.Key);
+ else
+ {
+ var cs = (portDevice as CrestronControlSystem);
+ if (cs == null)
+ {
+ Debug.Console(0, "ERROR: Port device for [{0}] is not control system", props.PortDeviceKey);
+ return null;
+ }
+
+ if (cs.SupportsVersiport)
+ {
+ Debug.Console(1, "Attempting to add Digital Input device to Versiport port '{0}'", props.PortNumber);
+
+ if (props.PortNumber > cs.NumberOfVersiPorts)
+ {
+ Debug.Console(0, "WARNING: Cannot add Vesiport {0} on {1}. Out of range",
+ props.PortNumber, props.PortDeviceKey);
+ return null;
+ }
+
+ Versiport vp = cs.VersiPorts[props.PortNumber];
+
+ if (!vp.Registered)
+ {
+ var regSuccess = vp.Register();
+ if (regSuccess == eDeviceRegistrationUnRegistrationResponse.Success)
+ {
+ Debug.Console(1, "Successfully Created Digital Input Device on Versiport");
+ return new GenericVersiportDigitalInputDevice(dc.Key, vp, props);
+ }
+ else
+ {
+ Debug.Console(0, "WARNING: Attempt to register versiport {0} on device with key '{1}' failed: {2}",
+ props.PortNumber, props.PortDeviceKey, regSuccess);
+ return null;
+ }
+ }
+ }
+ else if (cs.SupportsDigitalInput)
+ {
+ Debug.Console(1, "Attempting to add Digital Input device to Digital Input port '{0}'", props.PortNumber);
+
+ if (props.PortNumber > cs.NumberOfDigitalInputPorts)
+ {
+ Debug.Console(0, "WARNING: Cannot register DIO port {0} on {1}. Out of range",
+ props.PortNumber, props.PortDeviceKey);
+ return null;
+ }
+
+ DigitalInput digitalInput = cs.DigitalInputPorts[props.PortNumber];
+
+ if (!digitalInput.Registered)
+ {
+ if (digitalInput.Register() == eDeviceRegistrationUnRegistrationResponse.Success)
+ {
+ Debug.Console(1, "Successfully Created Digital Input Device on Digital Input");
+ return new GenericDigitalInputDevice(dc.Key, digitalInput);
+ }
+ else
+ Debug.Console(0, "WARNING: Attempt to register digital input {0} on device with key '{1}' failed.",
+ props.PortNumber, props.PortDeviceKey);
+ }
+ }
+ }
+ return null;
+ }
+ }
+
}
\ No newline at end of file
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Crestron IO/Inputs/GenericVersiportInputDevice.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Crestron IO/Inputs/GenericVersiportInputDevice.cs
index 4c5359b9..90ff4fa0 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Crestron IO/Inputs/GenericVersiportInputDevice.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Crestron IO/Inputs/GenericVersiportInputDevice.cs
@@ -12,7 +12,7 @@ namespace PepperDash.Essentials.Core.CrestronIO
///
/// Represents a generic digital input deviced tied to a versiport
///
- public class GenericVersiportDigitalInputDevice : Device, IDigitalInput
+ public class GenericVersiportDigitalInputDevice : EssentialsDevice, IDigitalInput
{
public Versiport InputPort { get; private set; }
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 4786cb2b..b79a8253 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Crestron IO/Relay/GenericRelayDevice.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Crestron IO/Relay/GenericRelayDevice.cs
@@ -4,15 +4,18 @@ 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;
+using PepperDash.Essentials.Core.Config;
namespace PepperDash.Essentials.Core.CrestronIO
{
///
/// Represents a generic device controlled by relays
///
- public class GenericRelayDevice : Device, ISwitchedOutput
+ public class GenericRelayDevice : EssentialsBridgeableDevice, ISwitchedOutput
{
public Relay RelayOutput { get; private set; }
@@ -65,5 +68,107 @@ namespace PepperDash.Essentials.Core.CrestronIO
}
#endregion
+
+ public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
+ {
+ var joinMap = new GenericRelayControllerJoinMap(joinStart);
+
+ var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
+
+ if (!string.IsNullOrEmpty(joinMapSerialized))
+ joinMap = JsonConvert.DeserializeObject(joinMapSerialized);
+
+ bridge.AddJoinMap(Key, joinMap);
+
+ if (RelayOutput == null)
+ {
+ Debug.Console(1, this, "Unable to link device '{0}'. Relay is null", Key);
+ return;
+ }
+
+ Debug.Console(1, this, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
+
+ trilist.SetBoolSigAction(joinMap.Relay.JoinNumber, b =>
+ {
+ if (b)
+ CloseRelay();
+ else
+ OpenRelay();
+ });
+
+ // feedback for relay state
+
+ OutputIsOnFeedback.LinkInputSig(trilist.BooleanInput[joinMap.Relay.JoinNumber]);
+ }
}
+
+ public class GenericRelayDeviceFactory : EssentialsDeviceFactory
+ {
+ public GenericRelayDeviceFactory()
+ {
+ TypeNames = new List() { "relayoutput" };
+ }
+
+ public override EssentialsDevice BuildDevice(DeviceConfig dc)
+ {
+ Debug.Console(1, "Factory Attempting to create new Generic Relay Device");
+
+ var props = JsonConvert.DeserializeObject(dc.Properties.ToString());
+ var key = dc.Key;
+
+ IRelayPorts 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
+ }
+
+ return null;
+
+ }
+ }
+
}
\ No newline at end of file
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Crestron IO/StatusSign/StatusSignController.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Crestron IO/StatusSign/StatusSignController.cs
index b83eae37..df8f778a 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Crestron IO/StatusSign/StatusSignController.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Crestron IO/StatusSign/StatusSignController.cs
@@ -1,14 +1,19 @@
using System;
+using System.Collections.Generic;
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.Config;
namespace PepperDash.Essentials.Core.CrestronIO
{
- public class StatusSignController:CrestronGenericBaseDevice
+ [Description("Wrapper class for the Crestron StatusSign device")]
+ public class StatusSignController : CrestronGenericBridgeableBaseDevice
{
- private StatusSign _device;
+ private readonly StatusSign _device;
public BoolFeedback RedLedEnabledFeedback { get; private set; }
public BoolFeedback GreenLedEnabledFeedback { get; private set; }
@@ -45,7 +50,7 @@ namespace PepperDash.Essentials.Core.CrestronIO
BlueLedBrightnessFeedback =
new IntFeedback(() => (int) _device.Leds[(uint) StatusSign.Led.eLedColor.Blue].BrightnessFeedback);
- _device.BaseEvent += _device_BaseEvent;
+ if (_device != null) _device.BaseEvent += _device_BaseEvent;
}
void _device_BaseEvent(GenericBase device, BaseEventArgs args)
@@ -103,5 +108,75 @@ namespace PepperDash.Essentials.Core.CrestronIO
Debug.Console(1, this, "Error converting value to Blue LED brightness. value: {0}", blue);
}
}
+
+ public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
+ {
+ var joinMap = new StatusSignControllerJoinMap(joinStart);
+
+ var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
+
+ if (!string.IsNullOrEmpty(joinMapSerialized))
+ joinMap = JsonConvert.DeserializeObject(joinMapSerialized);
+
+ bridge.AddJoinMap(Key, joinMap);
+
+ Debug.Console(1, this, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
+
+ trilist.SetBoolSigAction(joinMap.RedControl.JoinNumber, b => EnableControl(trilist, joinMap, this));
+ trilist.SetBoolSigAction(joinMap.GreenControl.JoinNumber, b => EnableControl(trilist, joinMap, this));
+ trilist.SetBoolSigAction(joinMap.BlueControl.JoinNumber, b => EnableControl(trilist, joinMap, this));
+
+ trilist.SetUShortSigAction(joinMap.RedLed.JoinNumber, u => SetColor(trilist, joinMap, this));
+ trilist.SetUShortSigAction(joinMap.GreenLed.JoinNumber, u => SetColor(trilist, joinMap, this));
+ trilist.SetUShortSigAction(joinMap.BlueLed.JoinNumber, u => SetColor(trilist, joinMap, this));
+
+ trilist.StringInput[joinMap.Name.JoinNumber].StringValue = Name;
+
+ IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline.JoinNumber]);
+ RedLedEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RedControl.JoinNumber]);
+ BlueLedEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.BlueControl.JoinNumber]);
+ GreenLedEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.GreenControl.JoinNumber]);
+
+ RedLedBrightnessFeedback.LinkInputSig(trilist.UShortInput[joinMap.RedLed.JoinNumber]);
+ BlueLedBrightnessFeedback.LinkInputSig(trilist.UShortInput[joinMap.BlueLed.JoinNumber]);
+ GreenLedBrightnessFeedback.LinkInputSig(trilist.UShortInput[joinMap.GreenLed.JoinNumber]);
+ }
+
+ private static void EnableControl(BasicTriList triList, StatusSignControllerJoinMap joinMap,
+ StatusSignController device)
+ {
+ var redEnable = triList.BooleanOutput[joinMap.RedControl.JoinNumber].BoolValue;
+ var greenEnable = triList.BooleanOutput[joinMap.GreenControl.JoinNumber].BoolValue;
+ var blueEnable = triList.BooleanOutput[joinMap.BlueControl.JoinNumber].BoolValue;
+ device.EnableLedControl(redEnable, greenEnable, blueEnable);
+ }
+
+ private static void SetColor(BasicTriList triList, StatusSignControllerJoinMap joinMap,
+ StatusSignController device)
+ {
+ var redBrightness = triList.UShortOutput[joinMap.RedLed.JoinNumber].UShortValue;
+ var greenBrightness = triList.UShortOutput[joinMap.GreenLed.JoinNumber].UShortValue;
+ var blueBrightness = triList.UShortOutput[joinMap.BlueLed.JoinNumber].UShortValue;
+
+ device.SetColor(redBrightness, greenBrightness, blueBrightness);
+ }
+ }
+
+ public class StatusSignControllerFactory : EssentialsDeviceFactory
+ {
+ public StatusSignControllerFactory()
+ {
+ TypeNames = new List() { "statussign" };
+ }
+
+ public override EssentialsDevice BuildDevice(DeviceConfig dc)
+ {
+ Debug.Console(1, "Factory Attempting to create new StatusSign Device");
+
+ var control = CommFactory.GetControlPropertiesConfig(dc);
+ var cresnetId = control.CresnetIdInt;
+
+ return new StatusSignController(dc.Key, dc.Name, new StatusSign(cresnetId, Global.ControlSystem));
+ }
}
}
\ No newline at end of file
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Crestron/CrestronGenericBaseDevice.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Crestron/CrestronGenericBaseDevice.cs
index 6d6a5fb4..7866075f 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Crestron/CrestronGenericBaseDevice.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Crestron/CrestronGenericBaseDevice.cs
@@ -1,19 +1,15 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Crestron.SimplSharp;
+using System.Linq;
using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.DeviceSupport;
-
using PepperDash.Core;
+using PepperDash.Essentials.Core.Bridges;
namespace PepperDash.Essentials.Core
{
///
/// A bridge class to cover the basic features of GenericBase hardware
///
- public class CrestronGenericBaseDevice : Device, IOnline, IHasFeedback, ICommunicationMonitor, IUsageTracking
+ public abstract class CrestronGenericBaseDevice : EssentialsDevice, IOnline, IHasFeedback, ICommunicationMonitor, IUsageTracking
{
public virtual GenericBase Hardware { get; protected set; }
@@ -32,7 +28,7 @@ namespace PepperDash.Essentials.Core
///
public bool PreventRegistration { get; protected set; }
- public CrestronGenericBaseDevice(string key, string name, GenericBase hardware)
+ protected CrestronGenericBaseDevice(string key, string name, GenericBase hardware)
: base(key, name)
{
Feedbacks = new FeedbackCollection();
@@ -40,13 +36,7 @@ namespace PepperDash.Essentials.Core
Hardware = hardware;
IsOnline = new BoolFeedback("IsOnlineFeedback", () => Hardware.IsOnline);
IsRegistered = new BoolFeedback("IsRegistered", () => Hardware.Registered);
- IpConnectionsText = new StringFeedback("IpConnectionsText", () =>
- {
- if (Hardware.ConnectedIpList != null)
- return string.Join(",", Hardware.ConnectedIpList.Select(cip => cip.DeviceIpAddress).ToArray());
- else
- return string.Empty;
- });
+ IpConnectionsText = new StringFeedback("IpConnectionsText", () => Hardware.ConnectedIpList != null ? string.Join(",", Hardware.ConnectedIpList.Select(cip => cip.DeviceIpAddress).ToArray()) : string.Empty);
AddToFeedbackList(IsOnline, IpConnectionsText);
CommunicationMonitor = new CrestronGenericBaseCommunicationMonitor(this, hardware, 120000, 300000);
@@ -78,7 +68,7 @@ namespace PepperDash.Essentials.Core
f.FireUpdate();
}
- Hardware.OnlineStatusChange += new OnlineStatusChangeEventHandler(Hardware_OnlineStatusChange);
+ Hardware.OnlineStatusChange += Hardware_OnlineStatusChange;
CommunicationMonitor.Start();
return true;
@@ -99,8 +89,8 @@ namespace PepperDash.Essentials.Core
return success;
}
-
- ///
+
+ ///
/// Adds feedback(s) to the list
///
///
@@ -108,12 +98,11 @@ namespace PepperDash.Essentials.Core
{
foreach (var f in newFbs)
{
- if (f != null)
+ if (f == null) continue;
+
+ if (!Feedbacks.Contains(f))
{
- if (!Feedbacks.Contains(f))
- {
- Feedbacks.Add(f);
- }
+ Feedbacks.Add(f);
}
}
}
@@ -140,6 +129,17 @@ namespace PepperDash.Essentials.Core
#endregion
}
+ public abstract class CrestronGenericBridgeableBaseDevice : CrestronGenericBaseDevice, IBridgeAdvanced
+ {
+ protected CrestronGenericBridgeableBaseDevice(string key, string name, GenericBase hardware) : base(key, name, hardware)
+ {
+ }
+
+
+ public abstract void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge);
+ }
+
+
//***********************************************************************************
public class CrestronGenericBaseDeviceEventIds
{
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/DeviceManager.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/DeviceManager.cs
index 6fa1f558..01563db7 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/DeviceManager.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/DeviceManager.cs
@@ -5,10 +5,6 @@ using System.Text;
using System.Text.RegularExpressions;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro;
-using Crestron.SimplSharpPro.DeviceSupport;
-using Crestron.SimplSharpPro.EthernetCommunication;
-using Crestron.SimplSharpPro.UI;
-using Crestron.SimplSharp.Reflection;
using PepperDash.Core;
@@ -17,18 +13,23 @@ namespace PepperDash.Essentials.Core
{
public static class DeviceManager
{
+ private static readonly CCriticalSection DeviceCriticalSection = new CCriticalSection();
+ private static readonly CEvent AllowAddDevicesCEvent = new CEvent(false, true);
//public static List Devices { get { return _Devices; } }
//static List _Devices = new List();
- static Dictionary Devices = new Dictionary(StringComparer.OrdinalIgnoreCase);
+ static readonly Dictionary Devices = new Dictionary(StringComparer.OrdinalIgnoreCase);
///
/// Returns a copy of all the devices in a list
///
public static List AllDevices { get { return new List(Devices.Values); } }
+ public static bool AddDeviceEnabled;
+
public static void Initialize(CrestronControlSystem cs)
{
+ AddDeviceEnabled = true;
CrestronConsole.AddNewConsoleCommand(ListDeviceCommStatuses, "devcommstatus", "Lists the communication status of all devices",
ConsoleAccessLevelEnum.AccessOperator);
CrestronConsole.AddNewConsoleCommand(ListDeviceFeedbacks, "devfb", "Lists current feedbacks",
@@ -37,18 +38,9 @@ namespace PepperDash.Essentials.Core
ConsoleAccessLevelEnum.AccessOperator);
CrestronConsole.AddNewConsoleCommand(DeviceJsonApi.DoDeviceActionWithJson, "devjson", "",
ConsoleAccessLevelEnum.AccessOperator);
- CrestronConsole.AddNewConsoleCommand(s =>
- {
- CrestronConsole.ConsoleCommandResponse(DeviceJsonApi.GetProperties(s));
- }, "devprops", "", ConsoleAccessLevelEnum.AccessOperator);
- CrestronConsole.AddNewConsoleCommand(s =>
- {
- CrestronConsole.ConsoleCommandResponse(DeviceJsonApi.GetMethods(s));
- }, "devmethods", "", ConsoleAccessLevelEnum.AccessOperator);
- CrestronConsole.AddNewConsoleCommand(s =>
- {
- CrestronConsole.ConsoleCommandResponse(DeviceJsonApi.GetApiMethods(s));
- }, "apimethods", "", ConsoleAccessLevelEnum.AccessOperator);
+ CrestronConsole.AddNewConsoleCommand(s => CrestronConsole.ConsoleCommandResponse(DeviceJsonApi.GetProperties(s)), "devprops", "", ConsoleAccessLevelEnum.AccessOperator);
+ CrestronConsole.AddNewConsoleCommand(s => CrestronConsole.ConsoleCommandResponse(DeviceJsonApi.GetMethods(s)), "devmethods", "", ConsoleAccessLevelEnum.AccessOperator);
+ CrestronConsole.AddNewConsoleCommand(s => CrestronConsole.ConsoleCommandResponse(DeviceJsonApi.GetApiMethods(s)), "apimethods", "", ConsoleAccessLevelEnum.AccessOperator);
CrestronConsole.AddNewConsoleCommand(SimulateComReceiveOnDevice, "devsimreceive",
"Simulates incoming data on a com device", ConsoleAccessLevelEnum.AccessOperator);
}
@@ -58,47 +50,56 @@ namespace PepperDash.Essentials.Core
///
public static void ActivateAll()
{
- // PreActivate all devices
- foreach (var d in Devices.Values)
- {
- try
- {
- if (d is Device)
- (d as Device).PreActivate();
- }
- catch (Exception e)
- {
- Debug.Console(0, d, "ERROR: Device PreActivation failure:\r{0}", e);
- }
- }
+ try
+ {
+ DeviceCriticalSection.Enter();
+ AddDeviceEnabled = false;
+ // PreActivate all devices
+ foreach (var d in Devices.Values)
+ {
+ try
+ {
+ if (d is Device)
+ (d as Device).PreActivate();
+ }
+ catch (Exception e)
+ {
+ Debug.Console(0, d, "ERROR: Device PreActivation failure:\r{0}", e);
+ }
+ }
- // Activate all devices
- foreach (var d in Devices.Values)
- {
- try
- {
- if (d is Device)
- (d as Device).Activate();
- }
- catch (Exception e)
- {
- Debug.Console(0, d, "ERROR: Device Activation failure:\r{0}", e);
- }
- }
+ // Activate all devices
+ foreach (var d in Devices.Values)
+ {
+ try
+ {
+ if (d is Device)
+ (d as Device).Activate();
+ }
+ catch (Exception e)
+ {
+ Debug.Console(0, d, "ERROR: Device Activation failure:\r{0}", e);
+ }
+ }
- // PostActivate all devices
- foreach (var d in Devices.Values)
- {
- try
- {
- if (d is Device)
- (d as Device).PostActivate();
- }
- catch (Exception e)
- {
- Debug.Console(0, d, "ERROR: Device PostActivation failure:\r{0}", e);
- }
- }
+ // PostActivate all devices
+ foreach (var d in Devices.Values)
+ {
+ try
+ {
+ if (d is Device)
+ (d as Device).PostActivate();
+ }
+ catch (Exception e)
+ {
+ Debug.Console(0, d, "ERROR: Device PostActivation failure:\r{0}", e);
+ }
+ }
+ }
+ finally
+ {
+ DeviceCriticalSection.Leave();
+ }
}
///
@@ -106,11 +107,18 @@ namespace PepperDash.Essentials.Core
///
public static void DeactivateAll()
{
- foreach (var d in Devices.Values)
- {
- if (d is Device)
- (d as Device).Deactivate();
- }
+ try
+ {
+ DeviceCriticalSection.Enter();
+ foreach (var d in Devices.Values.OfType())
+ {
+ d.Deactivate();
+ }
+ }
+ finally
+ {
+ DeviceCriticalSection.Leave();
+ }
}
//static void ListMethods(string devKey)
@@ -134,37 +142,37 @@ namespace PepperDash.Essentials.Core
// }
//}
- static void ListDevices(string s)
- {
- Debug.Console(0, "{0} Devices registered with Device Mangager:",Devices.Count);
- var sorted = Devices.Values.ToList();
- sorted.Sort((a, b) => a.Key.CompareTo(b.Key));
+ private static void ListDevices(string s)
+ {
+ Debug.Console(0, "{0} Devices registered with Device Manager:", Devices.Count);
+ var sorted = Devices.Values.ToList();
+ sorted.Sort((a, b) => a.Key.CompareTo(b.Key));
- foreach (var d in sorted)
- {
- var name = d is IKeyName ? (d as IKeyName).Name : "---";
- Debug.Console(0, " [{0}] {1}", d.Key, name);
- }
- }
+ foreach (var d in sorted)
+ {
+ var name = d is IKeyName ? (d as IKeyName).Name : "---";
+ Debug.Console(0, " [{0}] {1}", d.Key, name);
+ }
+ }
- static void ListDeviceFeedbacks(string devKey)
- {
- var dev = GetDeviceForKey(devKey);
- if(dev == null)
- {
- Debug.Console(0, "Device '{0}' not found", devKey);
- return;
- }
- var statusDev = dev as IHasFeedback;
- if(statusDev == null)
- {
- Debug.Console(0, "Device '{0}' does not have visible feedbacks", devKey);
- return;
- }
- statusDev.DumpFeedbacksToConsole(true);
- }
+ private static void ListDeviceFeedbacks(string devKey)
+ {
+ var dev = GetDeviceForKey(devKey);
+ if (dev == null)
+ {
+ Debug.Console(0, "Device '{0}' not found", devKey);
+ return;
+ }
+ var statusDev = dev as IHasFeedback;
+ if (statusDev == null)
+ {
+ Debug.Console(0, "Device '{0}' does not have visible feedbacks", devKey);
+ return;
+ }
+ statusDev.DumpFeedbacksToConsole(true);
+ }
- //static void ListDeviceCommands(string devKey)
+ //static void ListDeviceCommands(string devKey)
//{
// var dev = GetDeviceForKey(devKey);
// if (dev == null)
@@ -175,70 +183,97 @@ namespace PepperDash.Essentials.Core
// Debug.Console(0, "This needs to be reworked. Stay tuned.", devKey);
//}
- static void ListDeviceCommStatuses(string input)
- {
- var sb = new StringBuilder();
- foreach (var dev in Devices.Values)
- {
- if (dev is ICommunicationMonitor)
- sb.Append(string.Format("{0}: {1}\r", dev.Key, (dev as ICommunicationMonitor).CommunicationMonitor.Status));
- }
- CrestronConsole.ConsoleCommandResponse(sb.ToString());
- }
+ private static void ListDeviceCommStatuses(string input)
+ {
+ var sb = new StringBuilder();
+ foreach (var dev in Devices.Values.OfType())
+ {
+ sb.Append(string.Format("{0}: {1}\r", dev,
+ dev.CommunicationMonitor.Status));
+ }
+ CrestronConsole.ConsoleCommandResponse(sb.ToString());
+ }
- //static void DoDeviceCommand(string command)
+ //static void DoDeviceCommand(string command)
//{
// Debug.Console(0, "Not yet implemented. Stay tuned");
//}
public static void AddDevice(IKeyed newDev)
{
- // Check for device with same key
- //var existingDevice = _Devices.FirstOrDefault(d => d.Key.Equals(newDev.Key, StringComparison.OrdinalIgnoreCase));
- ////// If it exists, remove or warn??
- //if (existingDevice != null)
- if(Devices.ContainsKey(newDev.Key))
- {
- Debug.Console(0, newDev, "WARNING: A device with this key already exists. Not added to manager");
- return;
- }
- Devices.Add(newDev.Key, newDev);
- //if (!(_Devices.Contains(newDev)))
- // _Devices.Add(newDev);
+ try
+ {
+ if (!DeviceCriticalSection.TryEnter())
+ {
+ Debug.Console(0, Debug.ErrorLogLevel.Error, "Currently unable to add devices to Device Manager. Please try again");
+ return;
+ }
+ // Check for device with same key
+ //var existingDevice = _Devices.FirstOrDefault(d => d.Key.Equals(newDev.Key, StringComparison.OrdinalIgnoreCase));
+ ////// If it exists, remove or warn??
+ //if (existingDevice != null)
+
+ if (!AddDeviceEnabled)
+ {
+ Debug.Console(0, Debug.ErrorLogLevel.Error, "All devices have been activated. Adding new devices is not allowed.");
+ return;
+ }
+
+ if (Devices.ContainsKey(newDev.Key))
+ {
+ Debug.Console(0, newDev, "WARNING: A device with this key already exists. Not added to manager");
+ return;
+ }
+ Devices.Add(newDev.Key, newDev);
+ //if (!(_Devices.Contains(newDev)))
+ // _Devices.Add(newDev);
+ }
+ finally
+ {
+ DeviceCriticalSection.Leave();
+ }
}
public static void RemoveDevice(IKeyed newDev)
{
- if(newDev == null)
- return;
- if (Devices.ContainsKey(newDev.Key))
- Devices.Remove(newDev.Key);
- //if (_Devices.Contains(newDev))
- // _Devices.Remove(newDev);
- else
- Debug.Console(0, "Device manager: Device '{0}' does not exist in manager. Cannot remove", newDev.Key);
+ try
+ {
+ DeviceCriticalSection.Enter();
+ if (newDev == null)
+ return;
+ if (Devices.ContainsKey(newDev.Key))
+ Devices.Remove(newDev.Key);
+ //if (_Devices.Contains(newDev))
+ // _Devices.Remove(newDev);
+ else
+ Debug.Console(0, "Device manager: Device '{0}' does not exist in manager. Cannot remove", newDev.Key);
+ }
+ finally
+ {
+ DeviceCriticalSection.Leave();
+ }
}
public static IEnumerable GetDeviceKeys()
{
- //return _Devices.Select(d => d.Key).ToList();
- return Devices.Keys;
+ //return _Devices.Select(d => d.Key).ToList();
+ return Devices.Keys;
}
public static IEnumerable GetDevices()
{
- //return _Devices.Select(d => d.Key).ToList();
- return Devices.Values;
+ //return _Devices.Select(d => d.Key).ToList();
+ return Devices.Values;
}
public static IKeyed GetDeviceForKey(string key)
{
- //return _Devices.FirstOrDefault(d => d.Key.Equals(key, StringComparison.OrdinalIgnoreCase));
- if (key != null && Devices.ContainsKey(key))
- return Devices[key];
+ //return _Devices.FirstOrDefault(d => d.Key.Equals(key, StringComparison.OrdinalIgnoreCase));
+ if (key != null && Devices.ContainsKey(key))
+ return Devices[key];
- return null;
+ return null;
}
///
@@ -256,7 +291,7 @@ namespace PepperDash.Essentials.Core
}
//Debug.Console(2, "**** {0} - {1} ****", match.Groups[1].Value, match.Groups[2].Value);
- ComPortController com = GetDeviceForKey(match.Groups[1].Value) as ComPortController;
+ var com = GetDeviceForKey(match.Groups[1].Value) as ComPortController;
if (com == null)
{
CrestronConsole.ConsoleCommandResponse("'{0}' is not a comm port device", match.Groups[1].Value);
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/EssentialsBridgeableDevice.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/EssentialsBridgeableDevice.cs
new file mode 100644
index 00000000..0812ca4e
--- /dev/null
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/EssentialsBridgeableDevice.cs
@@ -0,0 +1,18 @@
+using Crestron.SimplSharpPro.DeviceSupport;
+using PepperDash.Essentials.Core.Bridges;
+
+namespace PepperDash.Essentials.Core
+{
+ public abstract class EssentialsBridgeableDevice:EssentialsDevice, IBridgeAdvanced
+ {
+ protected EssentialsBridgeableDevice(string key) : base(key)
+ {
+ }
+
+ protected EssentialsBridgeableDevice(string key, string name) : base(key, name)
+ {
+ }
+
+ public abstract void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge);
+ }
+}
\ No newline at end of file
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/EssentialsDevice.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/EssentialsDevice.cs
index 18b187b7..410c7a48 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/EssentialsDevice.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/EssentialsDevice.cs
@@ -3,6 +3,7 @@ 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;
@@ -12,6 +13,7 @@ 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)
@@ -27,6 +29,40 @@ namespace PepperDash.Essentials.Core
}
}
+ [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 Description {0}", configSnippet);
+ _ConfigSnippet = configSnippet;
+ }
+
+ public string ConfigSnippet
+ {
+ get { return _ConfigSnippet; }
+ }
+ }
+
///
/// Devices the basic needs for a Device Factory
///
@@ -46,7 +82,10 @@ namespace PepperDash.Essentials.Core
{
foreach (var typeName in TypeNames)
{
- DeviceFactory.AddFactoryForType(typeName, BuildDevice);
+ Debug.Console(2, "Getting Description Attribute from class: '{0}'", typeof(T).FullName);
+ var attributes = typeof(T).GetCustomAttributes(typeof(DescriptionAttribute), true) as DescriptionAttribute[];
+ string description = attributes[0].Description;
+ DeviceFactory.AddFactoryForType(typeName.ToLower(), description, typeof(T), BuildDevice);
}
}
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/IProjectorInterfaces.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/IProjectorInterfaces.cs
new file mode 100644
index 00000000..6efb7776
--- /dev/null
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/IProjectorInterfaces.cs
@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Crestron.SimplSharp;
+
+namespace PepperDash.Essentials.Core
+{
+ public interface IBasicVideoMute
+ {
+ void VideoMuteToggle();
+ }
+
+ public interface IBasicVideoMuteWithFeedback : IBasicVideoMute
+ {
+ BoolFeedback VideoMuteIsOn { get; }
+
+ void VideoMuteOn();
+ void VideoMuteOff();
+
+ }
+}
\ No newline at end of file
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/PC/InRoomPc.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/PC/InRoomPc.cs
index 9a13106f..03e884f0 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/PC/InRoomPc.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/PC/InRoomPc.cs
@@ -4,6 +4,7 @@ using System.Linq;
using Crestron.SimplSharpPro;
using PepperDash.Essentials.Core;
+using PepperDash.Essentials.Core.Config;
using PepperDash.Essentials.Core.Routing;
using PepperDash.Core;
@@ -12,7 +13,7 @@ namespace PepperDash.Essentials.Core.Devices
///
/// This DVD class should cover most IR, one-way DVD and Bluray fuctions
///
- public class InRoomPc : Device, IHasFeedback, IRoutingOutputs, IAttachVideoStatus, IUiDisplayInfo, IUsageTracking
+ public class InRoomPc : EssentialsDevice, IHasFeedback, IRoutingOutputs, IAttachVideoStatus, IUiDisplayInfo, IUsageTracking
{
public uint DisplayUiType { get { return DisplayUiConstants.TypeLaptop; } }
public string IconName { get; set; }
@@ -63,4 +64,19 @@ namespace PepperDash.Essentials.Core.Devices
#endregion
}
+
+ public class InRoomPcFactory : EssentialsDeviceFactory
+ {
+ public InRoomPcFactory()
+ {
+ TypeNames = new List() { "inroompc" };
+ }
+
+ public override EssentialsDevice BuildDevice(DeviceConfig dc)
+ {
+ Debug.Console(1, "Factory Attempting to create new InRoomPc Device");
+ return new InRoomPc(dc.Key, dc.Name);
+ }
+ }
+
}
\ No newline at end of file
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/PC/Laptop.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/PC/Laptop.cs
index a1a8b30b..a2864d77 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/PC/Laptop.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/PC/Laptop.cs
@@ -4,6 +4,7 @@ using System.Linq;
using Crestron.SimplSharpPro;
using PepperDash.Essentials.Core;
+using PepperDash.Essentials.Core.Config;
using PepperDash.Essentials.Core.Routing;
using PepperDash.Core;
@@ -12,7 +13,7 @@ namespace PepperDash.Essentials.Core.Devices
///
/// This DVD class should cover most IR, one-way DVD and Bluray fuctions
///
- public class Laptop : Device, IHasFeedback, IRoutingOutputs, IAttachVideoStatus, IUiDisplayInfo, IUsageTracking
+ public class Laptop : EssentialsDevice, IHasFeedback, IRoutingOutputs, IAttachVideoStatus, IUiDisplayInfo, IUsageTracking
{
public uint DisplayUiType { get { return DisplayUiConstants.TypeLaptop; } }
public string IconName { get; set; }
@@ -63,4 +64,18 @@ namespace PepperDash.Essentials.Core.Devices
#endregion
}
+
+ public class LaptopFactory : EssentialsDeviceFactory
+ {
+ public LaptopFactory()
+ {
+ TypeNames = new List() { "laptop" };
+ }
+
+ public override EssentialsDevice BuildDevice(DeviceConfig dc)
+ {
+ Debug.Console(1, "Factory Attempting to create new Laptop Device");
+ return new Core.Devices.Laptop(dc.Key, dc.Name);
+ }
+ }
}
\ No newline at end of file
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/ReconfigurableDevice.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/ReconfigurableDevice.cs
index b19b40b5..7b4f1c99 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/ReconfigurableDevice.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/ReconfigurableDevice.cs
@@ -3,8 +3,9 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
-
+using Crestron.SimplSharpPro.DeviceSupport;
using PepperDash.Core;
+using PepperDash.Essentials.Core.Bridges;
using PepperDash.Essentials.Core.Config;
namespace PepperDash.Essentials.Core.Devices
@@ -18,7 +19,7 @@ namespace PepperDash.Essentials.Core.Devices
public DeviceConfig Config { get; private set; }
- public ReconfigurableDevice(DeviceConfig config)
+ protected ReconfigurableDevice(DeviceConfig config)
: base(config.Key)
{
SetNameHelper(config);
@@ -60,4 +61,13 @@ namespace PepperDash.Essentials.Core.Devices
ConfigWriter.UpdateDeviceConfig(config);
}
}
+
+ public abstract class ReconfigurableBridgableDevice : ReconfigurableDevice, IBridgeAdvanced
+ {
+ protected ReconfigurableBridgableDevice(DeviceConfig config) : base(config)
+ {
+ }
+
+ public abstract void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge);
+ }
}
\ No newline at end of file
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Display/BasicIrDisplay.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Display/BasicIrDisplay.cs
index 3ffd0bf4..fd83f2a2 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Display/BasicIrDisplay.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Display/BasicIrDisplay.cs
@@ -8,11 +8,13 @@ using Crestron.SimplSharpPro.DeviceSupport;
using PepperDash.Core;
using PepperDash.Essentials.Core;
+using PepperDash.Essentials.Core.Config;
+using PepperDash.Essentials.Core.Bridges;
using PepperDash.Essentials.Core.Routing;
namespace PepperDash.Essentials.Core
{
- public class BasicIrDisplay : DisplayBase, IBasicVolumeControls, IPower, IWarmingCooling
+ public class BasicIrDisplay : DisplayBase, IBasicVolumeControls, IBridgeAdvanced
{
public IrOutputPortController IrPort { get; private set; }
public ushort IrPulseTime { get; set; }
@@ -201,5 +203,33 @@ namespace PepperDash.Essentials.Core
}
#endregion
+
+ public void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
+ {
+ LinkDisplayToApi(this, trilist, joinStart, joinMapKey, bridge);
+ }
}
+
+ public class BasicIrDisplayFactory : EssentialsDeviceFactory
+ {
+ public BasicIrDisplayFactory()
+ {
+ TypeNames = new List() { "basicirdisplay" };
+ }
+
+ public override EssentialsDevice BuildDevice(DeviceConfig dc)
+ {
+ Debug.Console(1, "Factory Attempting to create new BasicIrDisplay Device");
+ var ir = IRPortHelper.GetIrPort(dc.Properties);
+ if (ir != null)
+ {
+ var display = new BasicIrDisplay(dc.Key, dc.Name, ir.Port, ir.FileName);
+ display.IrPulseTime = 200; // Set default pulse time for IR commands.
+ return display;
+ }
+
+ return null;
+ }
+ }
+
}
\ No newline at end of file
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Display/DisplayBase.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Display/DisplayBase.cs
index 98659ab2..90ca9e05 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Display/DisplayBase.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Display/DisplayBase.cs
@@ -4,11 +4,13 @@ using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro;
+using Crestron.SimplSharpPro.DeviceSupport;
using Crestron.SimplSharpPro.DM;
using Crestron.SimplSharpPro.DM.Endpoints;
using Crestron.SimplSharpPro.DM.Endpoints.Transmitters;
-
+using Newtonsoft.Json;
using PepperDash.Core;
+using PepperDash.Essentials.Core.Bridges;
namespace PepperDash.Essentials.Core
@@ -16,7 +18,7 @@ namespace PepperDash.Essentials.Core
///
///
///
- public abstract class DisplayBase : Device, IHasFeedback, IRoutingSinkWithSwitching, IPower, IWarmingCooling, IUsageTracking
+ public abstract class DisplayBase : EssentialsDevice, IHasFeedback, IRoutingSinkWithSwitching, IPower, IWarmingCooling, IUsageTracking
{
public event SourceInfoChangeHandler CurrentSourceChange;
@@ -71,7 +73,7 @@ namespace PepperDash.Essentials.Core
#endregion
- public DisplayBase(string key, string name)
+ protected DisplayBase(string key, string name)
: base(key, name)
{
PowerIsOnFeedback = new BoolFeedback("PowerOnFeedback", PowerIsOnFeedbackFunc);
@@ -113,6 +115,143 @@ namespace PepperDash.Essentials.Core
public abstract void ExecuteSwitch(object selector);
+ protected void LinkDisplayToApi(DisplayBase displayDevice, BasicTriList trilist, uint joinStart, string joinMapKey,
+ EiscApiAdvanced bridge)
+ {
+ var inputNumber = 0;
+ var inputKeys = new List();
+
+ var joinMap = new DisplayControllerJoinMap(joinStart);
+
+ var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
+
+ if (!string.IsNullOrEmpty(joinMapSerialized))
+ joinMap = JsonConvert.DeserializeObject(joinMapSerialized);
+
+ bridge.AddJoinMap(Key, joinMap);
+
+ Debug.Console(1, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
+ Debug.Console(0, "Linking to Display: {0}", displayDevice.Name);
+
+ trilist.StringInput[joinMap.Name.JoinNumber].StringValue = displayDevice.Name;
+
+ var commMonitor = displayDevice as ICommunicationMonitor;
+ if (commMonitor != null)
+ {
+ commMonitor.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline.JoinNumber]);
+ }
+
+ var inputNumberFeedback = new IntFeedback(() => inputNumber);
+
+ // Two way feedbacks
+ var twoWayDisplay = displayDevice as TwoWayDisplayBase;
+
+ if (twoWayDisplay != null)
+ {
+ trilist.SetBool(joinMap.IsTwoWayDisplay.JoinNumber, true);
+
+ twoWayDisplay.CurrentInputFeedback.OutputChange += (o, a) => Debug.Console(0, "CurrentInputFeedback_OutputChange {0}", a.StringValue);
+
+
+ inputNumberFeedback.LinkInputSig(trilist.UShortInput[joinMap.InputSelect.JoinNumber]);
+ }
+
+ // Power Off
+ trilist.SetSigTrueAction(joinMap.PowerOff.JoinNumber, () =>
+ {
+ inputNumber = 102;
+ inputNumberFeedback.FireUpdate();
+ displayDevice.PowerOff();
+ });
+
+ displayDevice.PowerIsOnFeedback.OutputChange += (o, a) =>
+ {
+ if (!a.BoolValue)
+ {
+ inputNumber = 102;
+ inputNumberFeedback.FireUpdate();
+
+ }
+ else
+ {
+ inputNumber = 0;
+ inputNumberFeedback.FireUpdate();
+ }
+ };
+
+ displayDevice.PowerIsOnFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.PowerOff.JoinNumber]);
+
+ // PowerOn
+ trilist.SetSigTrueAction(joinMap.PowerOn.JoinNumber, () =>
+ {
+ inputNumber = 0;
+ inputNumberFeedback.FireUpdate();
+ displayDevice.PowerOn();
+ });
+
+
+ displayDevice.PowerIsOnFeedback.LinkInputSig(trilist.BooleanInput[joinMap.PowerOn.JoinNumber]);
+
+ for (int i = 0; i < displayDevice.InputPorts.Count; i++)
+ {
+ if (i < joinMap.InputNamesOffset.JoinSpan)
+ {
+ inputKeys.Add(displayDevice.InputPorts[i].Key);
+ var tempKey = inputKeys.ElementAt(i);
+ trilist.SetSigTrueAction((ushort)(joinMap.InputSelectOffset.JoinNumber + i),
+ () => displayDevice.ExecuteSwitch(displayDevice.InputPorts[tempKey].Selector));
+ Debug.Console(2, displayDevice, "Setting Input Select Action on Digital Join {0} to Input: {1}",
+ joinMap.InputSelectOffset.JoinNumber + i, displayDevice.InputPorts[tempKey].Key.ToString());
+ trilist.StringInput[(ushort)(joinMap.InputNamesOffset.JoinNumber + i)].StringValue = displayDevice.InputPorts[i].Key.ToString();
+ }
+ else
+ Debug.Console(0, displayDevice, Debug.ErrorLogLevel.Warning, "Device has {0} inputs. The Join Map allows up to {1} inputs. Discarding inputs {2} - {3} from bridge.",
+ displayDevice.InputPorts.Count, joinMap.InputNamesOffset.JoinSpan, i + 1, displayDevice.InputPorts.Count);
+ }
+
+ Debug.Console(2, displayDevice, "Setting Input Select Action on Analog Join {0}", joinMap.InputSelect);
+ trilist.SetUShortSigAction(joinMap.InputSelect.JoinNumber, (a) =>
+ {
+ if (a == 0)
+ {
+ displayDevice.PowerOff();
+ inputNumber = 0;
+ }
+ else if (a > 0 && a < displayDevice.InputPorts.Count && a != inputNumber)
+ {
+ displayDevice.ExecuteSwitch(displayDevice.InputPorts.ElementAt(a - 1).Selector);
+ inputNumber = a;
+ }
+ else if (a == 102)
+ {
+ displayDevice.PowerToggle();
+
+ }
+ if (twoWayDisplay != null)
+ inputNumberFeedback.FireUpdate();
+ });
+
+
+ var volumeDisplay = displayDevice as IBasicVolumeControls;
+ if (volumeDisplay == null) return;
+
+ trilist.SetBoolSigAction(joinMap.VolumeUp.JoinNumber, volumeDisplay.VolumeUp);
+ trilist.SetBoolSigAction(joinMap.VolumeDown.JoinNumber, volumeDisplay.VolumeDown);
+ trilist.SetSigTrueAction(joinMap.VolumeMute.JoinNumber, volumeDisplay.MuteToggle);
+
+ var volumeDisplayWithFeedback = volumeDisplay as IBasicVolumeWithFeedback;
+
+ if (volumeDisplayWithFeedback == null) return;
+ trilist.SetSigTrueAction(joinMap.VolumeMuteOn.JoinNumber, volumeDisplayWithFeedback.MuteOn);
+ trilist.SetSigTrueAction(joinMap.VolumeMuteOff.JoinNumber, volumeDisplayWithFeedback.MuteOff);
+
+
+ trilist.SetUShortSigAction(joinMap.VolumeLevel.JoinNumber, volumeDisplayWithFeedback.SetVolume);
+ volumeDisplayWithFeedback.VolumeLevelFeedback.LinkInputSig(trilist.UShortInput[joinMap.VolumeLevel.JoinNumber]);
+ volumeDisplayWithFeedback.MuteFeedback.LinkInputSig(trilist.BooleanInput[joinMap.VolumeMute.JoinNumber]);
+ volumeDisplayWithFeedback.MuteFeedback.LinkInputSig(trilist.BooleanInput[joinMap.VolumeMuteOn.JoinNumber]);
+ volumeDisplayWithFeedback.MuteFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.VolumeMuteOff.JoinNumber]);
+ }
}
///
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Display/MockDisplay.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Display/MockDisplay.cs
index bf728e8a..dcdba6d8 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Display/MockDisplay.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Display/MockDisplay.cs
@@ -4,20 +4,22 @@ using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro;
+using Crestron.SimplSharpPro.DeviceSupport;
using Crestron.SimplSharpPro.DM;
using Crestron.SimplSharpPro.DM.Endpoints;
using Crestron.SimplSharpPro.DM.Endpoints.Transmitters;
using PepperDash.Core;
+using PepperDash.Essentials.Core.Bridges;
using PepperDash.Essentials.Core.Routing;
-
+using PepperDash.Essentials.Core.Config;
namespace PepperDash.Essentials.Core
{
///
///
///
- public class MockDisplay : TwoWayDisplayBase, IBasicVolumeWithFeedback
+ public class MockDisplay : TwoWayDisplayBase, IBasicVolumeWithFeedback, IBridgeAdvanced
{
public RoutingInputPort HdmiIn1 { get; private set; }
@@ -174,5 +176,25 @@ namespace PepperDash.Essentials.Core
}
#endregion
+
+ public void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
+ {
+ LinkDisplayToApi(this, trilist, joinStart, joinMapKey, bridge);
+ }
}
+
+ public class MockDisplayFactory : EssentialsDeviceFactory
+ {
+ public MockDisplayFactory()
+ {
+ TypeNames = new List() { "mockdisplay" };
+ }
+
+ public override EssentialsDevice BuildDevice(DeviceConfig dc)
+ {
+ Debug.Console(1, "Factory Attempting to create new Mock Display Device");
+ return new MockDisplay(dc.Key, dc.Name);
+ }
+ }
+
}
\ 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 f0808a87..1904867d 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Factory/DeviceFactory.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Factory/DeviceFactory.cs
@@ -5,6 +5,7 @@ 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;
@@ -13,26 +14,77 @@ 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);
+ static Dictionary FactoryMethods =
+ new Dictionary(StringComparer.OrdinalIgnoreCase);
///
/// Adds a plugin factory method
///
///
///
- public static void AddFactoryForType(string type, Func method)
+ public static void AddFactoryForType(string typeName, Func method)
{
- Debug.Console(0, Debug.ErrorLogLevel.Notice, "Adding factory method for type '{0}'", type);
- DeviceFactory.FactoryMethods.Add(type.ToLower(), 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
@@ -52,76 +104,46 @@ namespace PepperDash.Essentials.Core
if (FactoryMethods.ContainsKey(typeName))
{
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Loading '{0}' from plugin", dc.Type);
- return FactoryMethods[typeName](dc);
+ return FactoryMethods[typeName].FactoryMethod(dc);
}
- // Check "core" types
- //if (typeName == "genericcomm")
- //{
- // Debug.Console(1, "Factory Attempting to create new Generic Comm Device");
- // return new GenericComm(dc);
- //}
- if (typeName == "ceniodigin104")
- {
- var control = CommFactory.GetControlPropertiesConfig(dc);
- var ipid = control.IpIdInt;
-
- return new CenIoDigIn104Controller(key, name, new Crestron.SimplSharpPro.GeneralIO.CenIoDi104(ipid, Global.ControlSystem));
- }
- if (typeName == "statussign")
- {
- var control = CommFactory.GetControlPropertiesConfig(dc);
- var cresnetId = control.CresnetIdInt;
-
- return new StatusSignController(key, name, new StatusSign(cresnetId, Global.ControlSystem));
- }
- if (typeName == "c2nrths")
- {
- var control = CommFactory.GetControlPropertiesConfig(dc);
- var cresnetId = control.CresnetIdInt;
-
- return new C2nRthsController(key, name, new C2nRths(cresnetId, Global.ControlSystem));
- }
-
return null;
}
///
- /// Prints the type names fromt the FactoryMethods collection.
+ /// Prints the type names and associated metadata from the FactoryMethods collection.
///
///
public static void GetDeviceFactoryTypes(string filter)
{
- List typeNames = new List();
+ Dictionary types = new Dictionary();
if (!string.IsNullOrEmpty(filter))
{
- typeNames = FactoryMethods.Keys.Where(k => k.Contains(filter)).ToList();
+ types = FactoryMethods.Where(k => k.Key.Contains(filter)).ToDictionary(k => k.Key, k => k.Value);
}
else
{
- typeNames = FactoryMethods.Keys.ToList();
+ types = FactoryMethods;
}
Debug.Console(0, "Device Types:");
- foreach (var type in typeNames)
+ foreach (var type in types.OrderBy(t => t.Key))
{
- Debug.Console(0, "type: '{0}'", type);
+ 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);
}
}
}
-
-
- ///
- /// Responsible for loading all of the device types
- ///
- public class CoreDeviceFactory
- {
- public CoreDeviceFactory()
- {
- var genComm = new GenericCommFactory() as IDeviceFactory;
- genComm.LoadTypeFactories();
- }
- }
}
\ No newline at end of file
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Factory/IDeviceFactory.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Factory/IDeviceFactory.cs
index ef792868..91e073f2 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Factory/IDeviceFactory.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Factory/IDeviceFactory.cs
@@ -3,6 +3,7 @@ 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;
@@ -15,7 +16,7 @@ namespace PepperDash.Essentials.Core
public interface IDeviceFactory
{
///
- /// Will be called when the plugin is loaded by Essentials. Must add any new types to the DeviceFactory using DeviceFactory.AddFactoryForType() for each new type
+ /// Loads all the types to the DeviceFactory
///
void LoadTypeFactories();
}
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Global/Global.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Global/Global.cs
index de533ebb..2f3e1823 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Global/Global.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Global/Global.cs
@@ -98,25 +98,47 @@ namespace PepperDash.Essentials.Core
{
Debug.Console(2, "Comparing running version '{0}' to minimum version '{1}'", AssemblyVersion, minimumVersion);
+ if (String.IsNullOrEmpty(minimumVersion))
+ {
+ Debug.Console(0,"Plugin does not specify a minimum version. Loading plugin may not work as expected. Proceeding with loading plugin");
+ return true;
+ }
+
var runtimeVersion = Regex.Match(AssemblyVersion, @"^(\d*).(\d*).(\d*).*");
var runtimeVersionMajor = Int16.Parse(runtimeVersion.Groups[1].Value);
var runtimeVersionMinor = Int16.Parse(runtimeVersion.Groups[2].Value);
var runtimeVersionBuild = Int16.Parse(runtimeVersion.Groups[3].Value);
- // Check for beta build version
- if (runtimeVersionMajor == 0)
+ var runtimeVer = new Version(runtimeVersionMajor, runtimeVersionMinor, runtimeVersionBuild);
+
+ Version minimumVer;
+ try
{
- Debug.Console(2, "Running Local Build. Bypassing Dependency Check.");
- return true;
+ minimumVer = new Version(minimumVersion);
+ }
+ catch
+ {
+ Debug.Console(2, "unable to parse minimum version {0}. Bypassing plugin load.", minimumVersion);
+ return false;
}
+
+ // Check for beta build version
+ if (runtimeVer.Major != 0)
+ {
+ return runtimeVer.CompareTo(minimumVer) >= 0;
+ }
+
+ Debug.Console(2, "Running Local Build. Bypassing Dependency Check.");
+ return true;
+
+ /*
var minVersion = Regex.Match(minimumVersion, @"^(\d*).(\d*).(\d*)$");
if(!minVersion.Success)
{
- Debug.Console(2, "minimumVersion String does not match format xx.yy.zz");
- return false;
+
}
var minVersionMajor = Int16.Parse(minVersion.Groups[1].Value);
@@ -135,6 +157,7 @@ namespace PepperDash.Essentials.Core
return false;
return true;
+ */
}
static Global()
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Lighting/LightingBase.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Lighting/LightingBase.cs
index af779c16..66e90d97 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Lighting/LightingBase.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Lighting/LightingBase.cs
@@ -4,12 +4,14 @@ 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 : Device, ILightingScenes
+ public abstract class LightingBase : EssentialsBridgeableDevice, ILightingScenes
{
#region ILightingScenes Members
@@ -23,8 +25,7 @@ namespace PepperDash.Essentials.Core.Lighting
#endregion
-
- public LightingBase(string key, string name)
+ protected LightingBase(string key, string name)
: base(key, name)
{
LightingScenes = new List();
@@ -69,6 +70,38 @@ namespace PepperDash.Essentials.Core.Lighting
}
}
+ 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);
+
+ bridge.AddJoinMap(Key, joinMap);
+
+ 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.SetSigTrueAction((uint)(joinMap.SelectSceneDirect.JoinNumber + sceneIndex), () => lightingDevice.SelectScene(lightingDevice.LightingScenes[sceneIndex]));
+ 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
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Microphone Privacy/MicrophonePrivacyController.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Microphone Privacy/MicrophonePrivacyController.cs
index e238c40e..ece2c65f 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Microphone Privacy/MicrophonePrivacyController.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Microphone Privacy/MicrophonePrivacyController.cs
@@ -6,6 +6,7 @@ using Crestron.SimplSharp;
using PepperDash.Core;
using PepperDash.Essentials.Core;
+using PepperDash.Essentials.Core.Config;
using PepperDash.Essentials.Core.CrestronIO;
@@ -15,7 +16,7 @@ namespace PepperDash.Essentials.Core.Privacy
/// Used for applications where one or more microphones with momentary contact closure outputs are used to
/// toggle the privacy state of the room. Privacy state feedback is represented
///
- public class MicrophonePrivacyController : Device
+ public class MicrophonePrivacyController : EssentialsDevice
{
MicrophonePrivacyControllerConfig Config;
@@ -225,4 +226,21 @@ namespace PepperDash.Essentials.Core.Privacy
}
}
}
+
+ public class MicrophonePrivacyControllerFactory : EssentialsDeviceFactory
+ {
+ public MicrophonePrivacyControllerFactory()
+ {
+ TypeNames = new List() { "microphoneprivacycontroller" };
+ }
+
+ public override EssentialsDevice BuildDevice(DeviceConfig dc)
+ {
+ Debug.Console(1, "Factory Attempting to create new MIcrophonePrivacyController Device");
+ var props = Newtonsoft.Json.JsonConvert.DeserializeObject(dc.Properties.ToString());
+
+ return new Core.Privacy.MicrophonePrivacyController(dc.Key, props);
+ }
+ }
+
}
\ No newline at end of file
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Monitoring/SystemMonitorController.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Monitoring/SystemMonitorController.cs
index 495a4a58..e9d06304 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Monitoring/SystemMonitorController.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Monitoring/SystemMonitorController.cs
@@ -1,10 +1,12 @@
using System;
using System.Collections.Generic;
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
{
@@ -12,7 +14,7 @@ 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 : Device
+ public class SystemMonitorController : EssentialsBridgeableDevice
{
private const long UptimePollTime = 300000;
private CTimer _uptimePollTimer;
@@ -198,6 +200,100 @@ namespace PepperDash.Essentials.Core.Monitoring
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);
+
+ bridge.AddJoinMap(Key, joinMap);
+
+ 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]);
+
+ IoControllerVersionFeedback.LinkInputSig(trilist.StringInput[joinMap.IOControllerVersion.JoinNumber]);
+ SnmpVersionFeedback.LinkInputSig(trilist.StringInput[joinMap.SnmpAppVersion.JoinNumber]);
+ BaCnetAppVersionFeedback.LinkInputSig(trilist.StringInput[joinMap.BACnetAppVersion.JoinNumber]);
+ ControllerVersionFeedback.LinkInputSig(trilist.StringInput[joinMap.ControllerVersion.JoinNumber]);
+ 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)
+ {
+ 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]);
+ fb.Value.CurrentDefaultGatewayFeedback.LinkInputSig(trilist.StringInput[ethernetSlotJoinStart + joinMap.CurrentDefaultGateway.JoinNumber]);
+ fb.Value.StaticIpAddressFeedback.LinkInputSig(trilist.StringInput[ethernetSlotJoinStart + joinMap.StaticIpAddress.JoinNumber]);
+ fb.Value.StaticSubnetMaskFeedback.LinkInputSig(trilist.StringInput[ethernetSlotJoinStart + joinMap.StaticSubnetMask.JoinNumber]);
+ fb.Value.StaticDefaultGatewayFeedback.LinkInputSig(trilist.StringInput[ethernetSlotJoinStart + joinMap.StaticDefaultGateway.JoinNumber]);
+ fb.Value.HostNameFeedback.LinkInputSig(trilist.StringInput[ethernetSlotJoinStart + joinMap.HostName.JoinNumber]);
+ 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)
+ {
+ uint programSlotJoinStart = 0;
+
+ foreach (var p in systemMonitorController.ProgramStatusFeedbackCollection)
+ {
+ var programNumber = p.Value.Program.Number;
+
+ 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,
+ 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);
+ p.Value.ProgramRegisteredFeedback.LinkInputSig(
+ trilist.BooleanInput[programSlotJoinStart + joinMap.ProgramRegister.JoinNumber]);
+
+ 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.ProgramCompileTimeFeedback.LinkInputSig(
+ trilist.StringInput[programSlotJoinStart + joinMap.ProgramCompiledTime.JoinNumber]);
+ p.Value.CrestronDataBaseVersionFeedback.LinkInputSig(
+ trilist.StringInput[programSlotJoinStart + joinMap.ProgramCrestronDatabaseVersion.JoinNumber]);
+ p.Value.EnvironmentVersionFeedback.LinkInputSig(
+ 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)
//{
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.csproj b/essentials-framework/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.csproj
index 65176251..1f606044 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.csproj
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.csproj
@@ -111,6 +111,30 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -132,7 +156,9 @@
+
+
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Plugins/PluginLoader.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Plugins/PluginLoader.cs
index 82e75b5c..f7275a66 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Plugins/PluginLoader.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Plugins/PluginLoader.cs
@@ -68,12 +68,21 @@ namespace PepperDash.Essentials
case ("PepperDashEssentials.dll"):
{
version = Global.AssemblyVersion;
- assembly = Assembly.GetExecutingAssembly();
break;
}
- case ("PepperDashEssentialsBase.dll"):
+ case ("PepperDash_Essentials_Core.dll"):
{
-
+ version = Global.AssemblyVersion;
+ break;
+ }
+ case ("PepperDash_Essentials_DM.dll"):
+ {
+ version = Global.AssemblyVersion;
+ break;
+ }
+ case ("Essentials Devices Common.dll"):
+ {
+ version = Global.AssemblyVersion;
break;
}
case ("PepperDash_Core.dll"):
@@ -97,6 +106,17 @@ namespace PepperDash.Essentials
}
}
+
+ public static void SetEssentialsAssembly(string name, Assembly assembly)
+ {
+ var loadedAssembly = LoadedAssemblies.FirstOrDefault(la => la.Name.Equals(name));
+
+ if (loadedAssembly != null)
+ {
+ loadedAssembly.SetAssembly(assembly);
+ }
+ }
+
///
/// Loads an assembly via Reflection and adds it to the list of loaded assemblies
///
@@ -360,7 +380,8 @@ namespace PepperDash.Essentials
}
catch (Exception e)
{
- Debug.Console(2, "Load Plugin not found. {0} is not a plugin assembly. Exception: {1}", loadedAssembly.Name, e);
+ Debug.Console(2, "Load Plugin not found. {0}.{2} is not a plugin factory. Exception: {1}",
+ loadedAssembly.Name, e, type.Name);
continue;
}
@@ -489,5 +510,10 @@ namespace PepperDash.Essentials
Version = version;
Assembly = assembly;
}
+
+ public void SetAssembly(Assembly assembly)
+ {
+ Assembly = assembly;
+ }
}
}
\ No newline at end of file
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Room/Behaviours/RoomOnToDefaultSourceWhenOccupied.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Room/Behaviours/RoomOnToDefaultSourceWhenOccupied.cs
index fcb04420..11debb03 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Room/Behaviours/RoomOnToDefaultSourceWhenOccupied.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Room/Behaviours/RoomOnToDefaultSourceWhenOccupied.cs
@@ -522,4 +522,19 @@ namespace PepperDash.Essentials.Core
[JsonProperty("enableSaturday")]
public bool EnableSaturday { get; set; }
}
+
+ public class RoomOnToDefaultSourceWhenOccupiedFactory : EssentialsDeviceFactory
+ {
+ public RoomOnToDefaultSourceWhenOccupiedFactory()
+ {
+ TypeNames = new List() { "roomonwhenoccupancydetectedfeature" };
+ }
+
+ public override EssentialsDevice BuildDevice(DeviceConfig dc)
+ {
+ Debug.Console(1, "Factory Attempting to create new RoomOnToDefaultSourceWhenOccupied Device");
+ return new RoomOnToDefaultSourceWhenOccupied(dc);
+ }
+ }
+
}
\ No newline at end of file
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Routing/RoutingInterfaces.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Routing/RoutingInterfaces.cs
index 0c642d5c..3b288290 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Routing/RoutingInterfaces.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Routing/RoutingInterfaces.cs
@@ -89,6 +89,15 @@ namespace PepperDash.Essentials.Core
IntFeedback VideoSourceNumericFeedback { get; }
IntFeedback AudioSourceNumericFeedback { get; }
void ExecuteNumericSwitch(ushort input, ushort output, eRoutingSignalType type);
+ }
+
+ ///
+ /// Defines a receiver that has internal routing (DM-RMC-4K-Z-SCALER-C)
+ ///
+ public interface IRmcRouting : IRouting
+ {
+ IntFeedback AudioVideoSourceNumericFeedback { get; }
+ void ExecuteNumericSwitch(ushort input, ushort output, eRoutingSignalType type);
}
///
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Routing/RoutingPort.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Routing/RoutingPort.cs
index 12edb104..cfd6f09e 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Routing/RoutingPort.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Routing/RoutingPort.cs
@@ -29,11 +29,12 @@ namespace PepperDash.Essentials.Core
}
}
+ [Flags]
public enum eRoutingSignalType
{
Audio = 1,
Video = 2,
- AudioVideo = 4,
+ AudioVideo = Audio | Video,
UsbOutput = 8,
UsbInput = 16
}
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Shades/ShadeBase.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Shades/ShadeBase.cs
index 636a5440..d30b716a 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Shades/ShadeBase.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Shades/ShadeBase.cs
@@ -12,7 +12,7 @@ namespace PepperDash.Essentials.Core.Shades
///
/// Base class for a shade device
///
- public abstract class ShadeBase : Device, IShadesOpenClose
+ public abstract class ShadeBase : EssentialsDevice, IShadesOpenClose
{
public ShadeBase(string key, string name)
: base(key, name)
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Shades/ShadeController.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Shades/ShadeController.cs
index b226af05..fc50f631 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Shades/ShadeController.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Shades/ShadeController.cs
@@ -5,13 +5,14 @@ using System.Text;
using Crestron.SimplSharp;
using PepperDash.Core;
+using PepperDash.Essentials.Core.Config;
namespace PepperDash.Essentials.Core.Shades
{
///
/// Class that contains the shades to be controlled in a room
///
- public class ShadeController : Device, IShades
+ public class ShadeController : EssentialsDevice, IShades
{
ShadeControllerConfigProperties Config;
@@ -55,4 +56,21 @@ namespace PepperDash.Essentials.Core.Shades
public string Key { get; set; }
}
}
+
+ public class ShadeControllerFactory : EssentialsDeviceFactory
+ {
+ public ShadeControllerFactory()
+ {
+ TypeNames = new List() { "shadecontroller" };
+ }
+
+ public override EssentialsDevice BuildDevice(DeviceConfig dc)
+ {
+ Debug.Console(1, "Factory Attempting to create new ShadeController Device");
+ var props = Newtonsoft.Json.JsonConvert.DeserializeObject(dc.Properties.ToString());
+
+ return new Core.Shades.ShadeController(dc.Key, dc.Name, props);
+ }
+ }
+
}
\ No newline at end of file
diff --git a/essentials-framework/Essentials DM/Essentials_DM/AirMedia/AirMediaController.cs b/essentials-framework/Essentials DM/Essentials_DM/AirMedia/AirMediaController.cs
index 28358a51..72b4bc4c 100644
--- a/essentials-framework/Essentials DM/Essentials_DM/AirMedia/AirMediaController.cs
+++ b/essentials-framework/Essentials DM/Essentials_DM/AirMedia/AirMediaController.cs
@@ -1,220 +1,288 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Crestron.SimplSharp;
-using Crestron.SimplSharpPro;
-using Crestron.DeviceSupport.Support;
-using Crestron.SimplSharpPro.DM;
-using Crestron.SimplSharpPro.DM.AirMedia;
-
-using PepperDash.Core;
-using PepperDash.Essentials.Core;
-using PepperDash.Essentials.Core.Config;
-
-namespace PepperDash.Essentials.DM.AirMedia
-{
- public class AirMediaController : CrestronGenericBaseDevice, IRoutingInputsOutputs, IIROutputPorts, IComPorts
- {
- public AmX00 AirMedia { get; private set; }
-
- public DeviceConfig DeviceConfig { get; private set; }
-
- AirMediaPropertiesConfig PropertiesConfig;
-
- public RoutingPortCollection InputPorts { get; private set; }
-
- public RoutingPortCollection OutputPorts { get; private set; }
-
- public BoolFeedback IsInSessionFeedback { get; private set; }
- public IntFeedback ErrorFeedback { get; private set; }
- public IntFeedback NumberOfUsersConnectedFeedback { get; set; }
- public IntFeedback LoginCodeFeedback { get; set; }
- public StringFeedback ConnectionAddressFeedback { get; set; }
- public StringFeedback HostnameFeedback { get; set; }
- public IntFeedback VideoOutFeedback { get; private set; }
- public BoolFeedback HdmiVideoSyncDetectedFeedback { get; private set; }
- public StringFeedback SerialNumberFeedback { get; private set; }
- public BoolFeedback AutomaticInputRoutingEnabledFeedback { get; private set; }
-
- public AirMediaController(string key, string name, AmX00 device, DeviceConfig dc, AirMediaPropertiesConfig props)
- :base(key, name, device)
- {
- AirMedia = device;
-
- DeviceConfig = dc;
-
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Crestron.SimplSharp;
+using Crestron.SimplSharpPro;
+using Crestron.DeviceSupport.Support;
+using Crestron.SimplSharpPro.DeviceSupport;
+using Crestron.SimplSharpPro.DM;
+using Crestron.SimplSharpPro.DM.AirMedia;
+using Newtonsoft.Json;
+using PepperDash.Core;
+using PepperDash.Essentials.Core;
+using PepperDash.Essentials.Core.Bridges;
+using PepperDash.Essentials.Core.Config;
+
+namespace PepperDash.Essentials.DM.AirMedia
+{
+ public class AirMediaController : CrestronGenericBridgeableBaseDevice, IRoutingInputsOutputs, IIROutputPorts, IComPorts
+ {
+ public AmX00 AirMedia { get; private set; }
+
+ public DeviceConfig DeviceConfig { get; private set; }
+
+ AirMediaPropertiesConfig PropertiesConfig;
+
+ public RoutingPortCollection InputPorts { get; private set; }
+
+ public RoutingPortCollection OutputPorts { get; private set; }
+
+ public BoolFeedback IsInSessionFeedback { get; private set; }
+ public IntFeedback ErrorFeedback { get; private set; }
+ public IntFeedback NumberOfUsersConnectedFeedback { get; set; }
+ public IntFeedback LoginCodeFeedback { get; set; }
+ public StringFeedback ConnectionAddressFeedback { get; set; }
+ public StringFeedback HostnameFeedback { get; set; }
+ public IntFeedback VideoOutFeedback { get; private set; }
+ public BoolFeedback HdmiVideoSyncDetectedFeedback { get; private set; }
+ public StringFeedback SerialNumberFeedback { get; private set; }
+ public BoolFeedback AutomaticInputRoutingEnabledFeedback { get; private set; }
+
+ public AirMediaController(string key, string name, AmX00 device, DeviceConfig dc, AirMediaPropertiesConfig props)
+ :base(key, name, device)
+ {
+ AirMedia = device;
+
+ DeviceConfig = dc;
+
PropertiesConfig = props;
InputPorts = new RoutingPortCollection();
- OutputPorts = new RoutingPortCollection();
-
- InputPorts.Add(new RoutingInputPort(DmPortName.Osd, eRoutingSignalType.Audio | eRoutingSignalType.Video,
- eRoutingPortConnectionType.None, new Action(SelectPinPointUxLandingPage), this));
-
- InputPorts.Add(new RoutingInputPort(DmPortName.AirMediaIn, eRoutingSignalType.Audio | eRoutingSignalType.Video,
- eRoutingPortConnectionType.Streaming, new Action(SelectAirMedia), this));
-
- InputPorts.Add(new RoutingInputPort(DmPortName.HdmiIn, eRoutingSignalType.Audio | eRoutingSignalType.Video,
- eRoutingPortConnectionType.Hdmi, new Action(SelectHdmiIn), this));
-
- InputPorts.Add(new RoutingInputPort(DmPortName.AirBoardIn, eRoutingSignalType.Video,
- eRoutingPortConnectionType.None, new Action(SelectAirboardIn), this));
-
- if (AirMedia is Am300)
- {
- InputPorts.Add(new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.Audio | eRoutingSignalType.Video,
- eRoutingPortConnectionType.DmCat, new Action(SelectDmIn), this));
- }
-
- AirMedia.AirMedia.AirMediaChange += new Crestron.SimplSharpPro.DeviceSupport.GenericEventHandler(AirMedia_AirMediaChange);
-
- IsInSessionFeedback = new BoolFeedback( new Func(() => AirMedia.AirMedia.StatusFeedback.UShortValue == 0 ));
- ErrorFeedback = new IntFeedback(new Func(() => AirMedia.AirMedia.ErrorFeedback.UShortValue));
- NumberOfUsersConnectedFeedback = new IntFeedback(new Func(() => AirMedia.AirMedia.NumberOfUsersConnectedFeedback.UShortValue));
- LoginCodeFeedback = new IntFeedback(new Func(() => AirMedia.AirMedia.LoginCodeFeedback.UShortValue));
- ConnectionAddressFeedback = new StringFeedback(new Func(() => AirMedia.AirMedia.ConnectionAddressFeedback.StringValue));
- HostnameFeedback = new StringFeedback(new Func(() => AirMedia.AirMedia.HostNameFeedback.StringValue));
-
- // TODO: Figure out if we can actually get the TSID/Serial
- SerialNumberFeedback = new StringFeedback(new Func(() => "unknown"));
-
- AirMedia.DisplayControl.DisplayControlChange += new Crestron.SimplSharpPro.DeviceSupport.GenericEventHandler(DisplayControl_DisplayControlChange);
-
- VideoOutFeedback = new IntFeedback(new Func(() => Convert.ToInt16(AirMedia.DisplayControl.VideoOutFeedback)));
- AutomaticInputRoutingEnabledFeedback = new BoolFeedback(new Func(() => AirMedia.DisplayControl.EnableAutomaticRoutingFeedback.BoolValue));
-
- AirMedia.HdmiIn.StreamChange += new Crestron.SimplSharpPro.DeviceSupport.StreamEventHandler(HdmiIn_StreamChange);
-
- HdmiVideoSyncDetectedFeedback = new BoolFeedback(new Func(() => AirMedia.HdmiIn.SyncDetectedFeedback.BoolValue));
- }
-
- public override bool CustomActivate()
- {
- if (PropertiesConfig.AutoSwitchingEnabled)
- AirMedia.DisplayControl.EnableAutomaticRouting();
- else
- AirMedia.DisplayControl.DisableAutomaticRouting();
-
- return base.CustomActivate();
- }
-
- void AirMedia_AirMediaChange(object sender, Crestron.SimplSharpPro.DeviceSupport.GenericEventArgs args)
- {
- if (args.EventId == AirMediaInputSlot.AirMediaStatusFeedbackEventId)
- IsInSessionFeedback.FireUpdate();
- else if (args.EventId == AirMediaInputSlot.AirMediaErrorFeedbackEventId)
- ErrorFeedback.FireUpdate();
- else if (args.EventId == AirMediaInputSlot.AirMediaNumberOfUserConnectedEventId)
- NumberOfUsersConnectedFeedback.FireUpdate();
- else if (args.EventId == AirMediaInputSlot.AirMediaLoginCodeEventId)
- LoginCodeFeedback.FireUpdate();
- else if (args.EventId == AirMediaInputSlot.AirMediaConnectionAddressFeedbackEventId)
- ConnectionAddressFeedback.FireUpdate();
- else if (args.EventId == AirMediaInputSlot.AirMediaHostNameFeedbackEventId)
- HostnameFeedback.FireUpdate();
- }
-
- void DisplayControl_DisplayControlChange(object sender, Crestron.SimplSharpPro.DeviceSupport.GenericEventArgs args)
- {
- if (args.EventId == AmX00.VideoOutFeedbackEventId)
- VideoOutFeedback.FireUpdate();
- else if (args.EventId == AmX00.EnableAutomaticRoutingFeedbackEventId)
- AutomaticInputRoutingEnabledFeedback.FireUpdate();
- }
-
- void HdmiIn_StreamChange(Crestron.SimplSharpPro.DeviceSupport.Stream stream, Crestron.SimplSharpPro.DeviceSupport.StreamEventArgs args)
- {
- if (args.EventId == DMInputEventIds.SourceSyncEventId)
- HdmiVideoSyncDetectedFeedback.FireUpdate();
- }
-
- ///
- /// Sets the VideoOut source ( 0 = PinpointUX, 1 = AirMedia, 2 = HDMI, 3 = DM, 4 = Airboard )
- ///
- /// source number
- public void SelectVideoOut(uint source)
- {
- AirMedia.DisplayControl.VideoOut = (AmX00DisplayControl.eAirMediaX00VideoSource)source;
- }
-
- ///
- /// Selects the PinPointUXLandingPage input
- ///
- public void SelectPinPointUxLandingPage()
- {
- AirMedia.DisplayControl.VideoOut = AmX00DisplayControl.eAirMediaX00VideoSource.PinPointUxLandingPage;
- }
-
- ///
- /// Selects the AirMedia input
- ///
- public void SelectAirMedia()
- {
- AirMedia.DisplayControl.VideoOut = AmX00DisplayControl.eAirMediaX00VideoSource.AirMedia;
- }
-
- ///
- /// Selects the DM input
- ///
- public void SelectDmIn()
- {
- AirMedia.DisplayControl.VideoOut = AmX00DisplayControl.eAirMediaX00VideoSource.HDMI;
- }
-
- ///
- /// Selects the HDMI INput
- ///
- public void SelectHdmiIn()
- {
- AirMedia.DisplayControl.VideoOut = AmX00DisplayControl.eAirMediaX00VideoSource.DM;
- }
-
- public void SelectAirboardIn()
- {
- AirMedia.DisplayControl.VideoOut = AmX00DisplayControl.eAirMediaX00VideoSource.AirBoard;
- }
-
- ///
- /// Reboots the device
- ///
- public void RebootDevice()
- {
- AirMedia.AirMedia.DeviceReboot();
- }
-
- #region IIROutputPorts Members
-
- public CrestronCollection IROutputPorts
- {
- get { return AirMedia.IROutputPorts; }
- }
-
- public int NumberOfIROutputPorts
- {
- get { return AirMedia.NumberOfIROutputPorts; }
- }
-
-
-
- #endregion
-
-
-
- #region IComPorts Members
-
- public CrestronCollection ComPorts
- {
- get { return AirMedia.ComPorts; }
- }
-
- public int NumberOfComPorts
- {
- get { return AirMedia.NumberOfComPorts; }
- }
-
- #endregion
-
-
- }
+ OutputPorts = new RoutingPortCollection();
+
+ InputPorts.Add(new RoutingInputPort(DmPortName.Osd, eRoutingSignalType.Audio | eRoutingSignalType.Video,
+ eRoutingPortConnectionType.None, new Action(SelectPinPointUxLandingPage), this));
+
+ InputPorts.Add(new RoutingInputPort(DmPortName.AirMediaIn, eRoutingSignalType.Audio | eRoutingSignalType.Video,
+ eRoutingPortConnectionType.Streaming, new Action(SelectAirMedia), this));
+
+ InputPorts.Add(new RoutingInputPort(DmPortName.HdmiIn, eRoutingSignalType.Audio | eRoutingSignalType.Video,
+ eRoutingPortConnectionType.Hdmi, new Action(SelectHdmiIn), this));
+
+ InputPorts.Add(new RoutingInputPort(DmPortName.AirBoardIn, eRoutingSignalType.Video,
+ eRoutingPortConnectionType.None, new Action(SelectAirboardIn), this));
+
+ if (AirMedia is Am300)
+ {
+ InputPorts.Add(new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.Audio | eRoutingSignalType.Video,
+ eRoutingPortConnectionType.DmCat, new Action(SelectDmIn), this));
+ }
+
+ AirMedia.AirMedia.AirMediaChange += new Crestron.SimplSharpPro.DeviceSupport.GenericEventHandler(AirMedia_AirMediaChange);
+
+ IsInSessionFeedback = new BoolFeedback( new Func(() => AirMedia.AirMedia.StatusFeedback.UShortValue == 0 ));
+ ErrorFeedback = new IntFeedback(new Func(() => AirMedia.AirMedia.ErrorFeedback.UShortValue));
+ NumberOfUsersConnectedFeedback = new IntFeedback(new Func(() => AirMedia.AirMedia.NumberOfUsersConnectedFeedback.UShortValue));
+ LoginCodeFeedback = new IntFeedback(new Func(() => AirMedia.AirMedia.LoginCodeFeedback.UShortValue));
+ ConnectionAddressFeedback = new StringFeedback(new Func(() => AirMedia.AirMedia.ConnectionAddressFeedback.StringValue));
+ HostnameFeedback = new StringFeedback(new Func(() => AirMedia.AirMedia.HostNameFeedback.StringValue));
+
+ // TODO: Figure out if we can actually get the TSID/Serial
+ SerialNumberFeedback = new StringFeedback(new Func(() => "unknown"));
+
+ AirMedia.DisplayControl.DisplayControlChange += new Crestron.SimplSharpPro.DeviceSupport.GenericEventHandler(DisplayControl_DisplayControlChange);
+
+ VideoOutFeedback = new IntFeedback(new Func(() => Convert.ToInt16(AirMedia.DisplayControl.VideoOutFeedback)));
+ AutomaticInputRoutingEnabledFeedback = new BoolFeedback(new Func(() => AirMedia.DisplayControl.EnableAutomaticRoutingFeedback.BoolValue));
+
+ AirMedia.HdmiIn.StreamChange += new Crestron.SimplSharpPro.DeviceSupport.StreamEventHandler(HdmiIn_StreamChange);
+
+ HdmiVideoSyncDetectedFeedback = new BoolFeedback(new Func(() => AirMedia.HdmiIn.SyncDetectedFeedback.BoolValue));
+ }
+
+ public override bool CustomActivate()
+ {
+ if (PropertiesConfig.AutoSwitchingEnabled)
+ AirMedia.DisplayControl.EnableAutomaticRouting();
+ else
+ AirMedia.DisplayControl.DisableAutomaticRouting();
+
+ return base.CustomActivate();
+ }
+
+ public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
+ {
+ var joinMap = new AirMediaControllerJoinMap(joinStart);
+
+ var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
+
+ if (!string.IsNullOrEmpty(joinMapSerialized))
+ joinMap = JsonConvert.DeserializeObject(joinMapSerialized);
+
+ bridge.AddJoinMap(Key, joinMap);
+
+ Debug.Console(1, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
+ Debug.Console(0, "Linking to Airmedia: {0}", Name);
+
+ trilist.StringInput[joinMap.Name.JoinNumber].StringValue = Name;
+
+ var commMonitor = this as ICommunicationMonitor;
+
+ commMonitor.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline.JoinNumber]);
+
+ IsInSessionFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IsInSession.JoinNumber]);
+ HdmiVideoSyncDetectedFeedback.LinkInputSig(trilist.BooleanInput[joinMap.HdmiVideoSync.JoinNumber]);
+
+ trilist.SetSigTrueAction(joinMap.AutomaticInputRoutingEnabled.JoinNumber, AirMedia.DisplayControl.EnableAutomaticRouting);
+ trilist.SetSigFalseAction(joinMap.AutomaticInputRoutingEnabled.JoinNumber, AirMedia.DisplayControl.DisableAutomaticRouting);
+ AutomaticInputRoutingEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.AutomaticInputRoutingEnabled.JoinNumber]);
+
+ trilist.SetUShortSigAction(joinMap.VideoOut.JoinNumber, (u) => SelectVideoOut(u));
+
+ VideoOutFeedback.LinkInputSig(trilist.UShortInput[joinMap.VideoOut.JoinNumber]);
+ ErrorFeedback.LinkInputSig(trilist.UShortInput[joinMap.ErrorFB.JoinNumber]);
+ NumberOfUsersConnectedFeedback.LinkInputSig(trilist.UShortInput[joinMap.NumberOfUsersConnectedFB.JoinNumber]);
+
+ trilist.SetUShortSigAction(joinMap.LoginCode.JoinNumber, (u) => AirMedia.AirMedia.LoginCode.UShortValue = u);
+ LoginCodeFeedback.LinkInputSig(trilist.UShortInput[joinMap.LoginCode.JoinNumber]);
+
+ ConnectionAddressFeedback.LinkInputSig(trilist.StringInput[joinMap.ConnectionAddressFB.JoinNumber]);
+ HostnameFeedback.LinkInputSig(trilist.StringInput[joinMap.HostnameFB.JoinNumber]);
+ SerialNumberFeedback.LinkInputSig(trilist.StringInput[joinMap.SerialNumberFeedback.JoinNumber]);
+ }
+
+ void AirMedia_AirMediaChange(object sender, Crestron.SimplSharpPro.DeviceSupport.GenericEventArgs args)
+ {
+ if (args.EventId == AirMediaInputSlot.AirMediaStatusFeedbackEventId)
+ IsInSessionFeedback.FireUpdate();
+ else if (args.EventId == AirMediaInputSlot.AirMediaErrorFeedbackEventId)
+ ErrorFeedback.FireUpdate();
+ else if (args.EventId == AirMediaInputSlot.AirMediaNumberOfUserConnectedEventId)
+ NumberOfUsersConnectedFeedback.FireUpdate();
+ else if (args.EventId == AirMediaInputSlot.AirMediaLoginCodeEventId)
+ LoginCodeFeedback.FireUpdate();
+ else if (args.EventId == AirMediaInputSlot.AirMediaConnectionAddressFeedbackEventId)
+ ConnectionAddressFeedback.FireUpdate();
+ else if (args.EventId == AirMediaInputSlot.AirMediaHostNameFeedbackEventId)
+ HostnameFeedback.FireUpdate();
+ }
+
+ void DisplayControl_DisplayControlChange(object sender, Crestron.SimplSharpPro.DeviceSupport.GenericEventArgs args)
+ {
+ if (args.EventId == AmX00.VideoOutFeedbackEventId)
+ VideoOutFeedback.FireUpdate();
+ else if (args.EventId == AmX00.EnableAutomaticRoutingFeedbackEventId)
+ AutomaticInputRoutingEnabledFeedback.FireUpdate();
+ }
+
+ void HdmiIn_StreamChange(Crestron.SimplSharpPro.DeviceSupport.Stream stream, Crestron.SimplSharpPro.DeviceSupport.StreamEventArgs args)
+ {
+ if (args.EventId == DMInputEventIds.SourceSyncEventId)
+ HdmiVideoSyncDetectedFeedback.FireUpdate();
+ }
+
+ ///
+ /// Sets the VideoOut source ( 0 = PinpointUX, 1 = AirMedia, 2 = HDMI, 3 = DM, 4 = Airboard )
+ ///
+ /// source number
+ public void SelectVideoOut(uint source)
+ {
+ AirMedia.DisplayControl.VideoOut = (AmX00DisplayControl.eAirMediaX00VideoSource)source;
+ }
+
+ ///
+ /// Selects the PinPointUXLandingPage input
+ ///
+ public void SelectPinPointUxLandingPage()
+ {
+ AirMedia.DisplayControl.VideoOut = AmX00DisplayControl.eAirMediaX00VideoSource.PinPointUxLandingPage;
+ }
+
+ ///
+ /// Selects the AirMedia input
+ ///
+ public void SelectAirMedia()
+ {
+ AirMedia.DisplayControl.VideoOut = AmX00DisplayControl.eAirMediaX00VideoSource.AirMedia;
+ }
+
+ ///
+ /// Selects the DM input
+ ///
+ public void SelectDmIn()
+ {
+ AirMedia.DisplayControl.VideoOut = AmX00DisplayControl.eAirMediaX00VideoSource.HDMI;
+ }
+
+ ///
+ /// Selects the HDMI INput
+ ///
+ public void SelectHdmiIn()
+ {
+ AirMedia.DisplayControl.VideoOut = AmX00DisplayControl.eAirMediaX00VideoSource.DM;
+ }
+
+ public void SelectAirboardIn()
+ {
+ AirMedia.DisplayControl.VideoOut = AmX00DisplayControl.eAirMediaX00VideoSource.AirBoard;
+ }
+
+ ///
+ /// Reboots the device
+ ///
+ public void RebootDevice()
+ {
+ AirMedia.AirMedia.DeviceReboot();
+ }
+
+ #region IIROutputPorts Members
+
+ public CrestronCollection IROutputPorts
+ {
+ get { return AirMedia.IROutputPorts; }
+ }
+
+ public int NumberOfIROutputPorts
+ {
+ get { return AirMedia.NumberOfIROutputPorts; }
+ }
+
+
+
+ #endregion
+
+
+
+ #region IComPorts Members
+
+ public CrestronCollection ComPorts
+ {
+ get { return AirMedia.ComPorts; }
+ }
+
+ public int NumberOfComPorts
+ {
+ get { return AirMedia.NumberOfComPorts; }
+ }
+
+ #endregion
+
+
+ }
+
+ public class AirMediaControllerFactory : EssentialsDeviceFactory
+ {
+ public AirMediaControllerFactory()
+ {
+ TypeNames = new List() { "am200", "am300" };
+ }
+
+ public override EssentialsDevice BuildDevice(DeviceConfig dc)
+ {
+ var type = dc.Type.ToLower();
+
+ Debug.Console(1, "Factory Attempting to create new AirMedia Device");
+
+ var props = JsonConvert.DeserializeObject(dc.Properties.ToString());
+ AmX00 amDevice = null;
+ if (type == "am200")
+ amDevice = new Crestron.SimplSharpPro.DM.AirMedia.Am200(props.Control.IpIdInt, Global.ControlSystem);
+ else if (type == "am300")
+ amDevice = new Crestron.SimplSharpPro.DM.AirMedia.Am300(props.Control.IpIdInt, Global.ControlSystem);
+
+ return new AirMediaController(dc.Key, dc.Name, amDevice, dc, props);
+
+ }
+ }
}
\ No newline at end of file
diff --git a/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmBladeChassisController.cs b/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmBladeChassisController.cs
index 7d57127a..5e9c3151 100644
--- a/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmBladeChassisController.cs
+++ b/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmBladeChassisController.cs
@@ -4,15 +4,16 @@ using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro;
+using Crestron.SimplSharpPro.DeviceSupport;
using Crestron.SimplSharpPro.DM;
using Crestron.SimplSharpPro.DM.Cards;
using Crestron.SimplSharpPro.DM.Blades;
using Crestron.SimplSharpPro.DM.Endpoints;
using Crestron.SimplSharpPro.DM.Endpoints.Receivers;
-
+using Newtonsoft.Json;
using PepperDash.Core;
using PepperDash.Essentials.Core;
-
+using PepperDash.Essentials.Core.Bridges;
using PepperDash.Essentials.DM.Config;
namespace PepperDash.Essentials.DM {
@@ -20,7 +21,7 @@ namespace PepperDash.Essentials.DM {
/// Builds a controller for basic DM-RMCs with Com and IR ports and no control functions
///
///
- public class DmBladeChassisController : CrestronGenericBaseDevice, IDmSwitch, IRoutingInputsOutputs, IRouting, IHasFeedback {
+ public class DmBladeChassisController : CrestronGenericBridgeableBaseDevice, IDmSwitch, IRoutingInputsOutputs, IRouting, IHasFeedback {
public DMChassisPropertiesConfig PropertiesConfig { get; set; }
public Switch Chassis { get; private set; }
@@ -570,6 +571,243 @@ namespace PepperDash.Essentials.DM {
#endregion
+ public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
+ {
+ var joinMap = new DmBladeChassisControllerJoinMap(joinStart);
+
+ var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
+
+ if (!string.IsNullOrEmpty(joinMapSerialized))
+ joinMap = JsonConvert.DeserializeObject(joinMapSerialized);
+
+ bridge.AddJoinMap(Key, joinMap);
+
+ Debug.Console(1, this, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
+
+ IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline.JoinNumber]);
+
+ // Link up outputs
+ for (uint i = 1; i <= Chassis.NumberOfOutputs; i++)
+ {
+ var ioSlot = i;
+ var ioSlotJoin = ioSlot - 1;
+
+ // Control
+ trilist.SetUShortSigAction(joinMap.OutputVideo.JoinNumber + ioSlotJoin, o => ExecuteSwitch(o, ioSlot, eRoutingSignalType.Video));
+
+ if (TxDictionary.ContainsKey(ioSlot))
+ {
+ Debug.Console(2, "Creating Tx Feedbacks {0}", ioSlot);
+ var txKey = TxDictionary[ioSlot];
+ var basicTxDevice = DeviceManager.GetDeviceForKey(txKey) as DmTxControllerBase;
+
+ var advancedTxDevice = basicTxDevice as DmTxControllerBase;
+
+ if (Chassis is DmMd128x128 || Chassis is DmMd64x64)
+ {
+ InputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.InputEndpointOnline.JoinNumber + ioSlotJoin]);
+ }
+ else
+ {
+ if (advancedTxDevice != null)
+ {
+ advancedTxDevice.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.InputEndpointOnline.JoinNumber + ioSlotJoin]);
+ Debug.Console(2, "Linking Tx Online Feedback from Advanced Transmitter at input {0}", ioSlot);
+ }
+ else if (InputEndpointOnlineFeedbacks[ioSlot] != null)
+ {
+ Debug.Console(2, "Linking Tx Online Feedback from Input Card {0}", ioSlot);
+ InputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.InputEndpointOnline.JoinNumber + ioSlotJoin]);
+ }
+ }
+
+ if (basicTxDevice != null && advancedTxDevice == null)
+ trilist.BooleanInput[joinMap.TxAdvancedIsPresent.JoinNumber + ioSlotJoin].BoolValue = true;
+
+ if (advancedTxDevice != null)
+ {
+ advancedTxDevice.AnyVideoInput.VideoStatus.VideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.VideoSyncStatus.JoinNumber + ioSlotJoin]);
+ }
+ else
+ {
+ Debug.Console(1, "Setting up actions and feedbacks on input card {0}", ioSlot);
+ VideoInputSyncFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.VideoSyncStatus.JoinNumber + ioSlotJoin]);
+
+ var inputPort = InputPorts[string.Format("inputCard{0}--hdmiIn", ioSlot)];
+ if (inputPort != null)
+ {
+ Debug.Console(1, "Port value for input card {0} is set", ioSlot);
+ var port = inputPort.Port;
+
+ if (port != null)
+ {
+ if (port is HdmiInputWithCEC)
+ {
+ Debug.Console(1, "Port is HdmiInputWithCec");
+
+ var hdmiInPortWCec = port as HdmiInputWithCEC;
+
+ if (hdmiInPortWCec.HdcpSupportedLevel != eHdcpSupportedLevel.Unknown)
+ {
+ SetHdcpStateAction(true, hdmiInPortWCec, joinMap.HdcpSupportState.JoinNumber + ioSlotJoin, trilist);
+ }
+
+ InputCardHdcpCapabilityFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.HdcpSupportState.JoinNumber + ioSlotJoin]);
+
+ if (InputCardHdcpCapabilityTypes.ContainsKey(ioSlot))
+ trilist.UShortInput[joinMap.HdcpSupportCapability.JoinNumber + ioSlotJoin].UShortValue = (ushort)InputCardHdcpCapabilityTypes[ioSlot];
+ else
+ trilist.UShortInput[joinMap.HdcpSupportCapability.JoinNumber + ioSlotJoin].UShortValue = 1;
+ }
+ }
+ }
+ else
+ {
+ inputPort = InputPorts[string.Format("inputCard{0}--dmIn", ioSlot)];
+
+ if (inputPort != null)
+ {
+ var port = inputPort.Port;
+
+ if (port is DMInputPortWithCec)
+ {
+ Debug.Console(1, "Port is DMInputPortWithCec");
+
+ var dmInPortWCec = port as DMInputPortWithCec;
+
+ SetHdcpStateAction(PropertiesConfig.InputSlotSupportsHdcp2[ioSlot], dmInPortWCec, joinMap.HdcpSupportState.JoinNumber + ioSlotJoin, trilist);
+
+ InputCardHdcpCapabilityFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.HdcpSupportState.JoinNumber + ioSlotJoin]);
+
+ if (InputCardHdcpCapabilityTypes.ContainsKey(ioSlot))
+ trilist.UShortInput[joinMap.HdcpSupportCapability.JoinNumber + ioSlotJoin].UShortValue = (ushort)InputCardHdcpCapabilityTypes[ioSlot];
+ else
+ trilist.UShortInput[joinMap.HdcpSupportCapability.JoinNumber + ioSlotJoin].UShortValue = 1;
+ }
+ }
+ }
+ }
+ }
+ else
+ {
+ VideoInputSyncFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.VideoSyncStatus.JoinNumber + ioSlotJoin]);
+
+ var inputPort = InputPorts[string.Format("inputCard{0}--hdmiIn", ioSlot)];
+ if (inputPort != null)
+ {
+ var hdmiPort = inputPort.Port as EndpointHdmiInput;
+
+ if (hdmiPort != null)
+ {
+ SetHdcpStateAction(true, hdmiPort, joinMap.HdcpSupportState.JoinNumber + ioSlotJoin, trilist);
+ InputCardHdcpCapabilityFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.HdcpSupportState.JoinNumber + ioSlotJoin]);
+ }
+ }
+ }
+ if (RxDictionary.ContainsKey(ioSlot))
+ {
+ Debug.Console(2, "Creating Rx Feedbacks {0}", ioSlot);
+ //var rxKey = RxDictionary[ioSlot];
+ //var rxDevice = DeviceManager.GetDeviceForKey(rxKey) as DmRmcControllerBase;
+ //var hdBaseTDevice = DeviceManager.GetDeviceForKey(rxKey) as DmHdBaseTControllerBase;
+ //if (hdBaseTDevice != null) {
+ OutputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.OutputEndpointOnline.JoinNumber + ioSlotJoin]);
+ //}
+ //else if (rxDevice != null) {
+ // rxDevice.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.OutputEndpointOnline + ioSlot]);
+ //}
+ }
+
+ // Feedback
+ VideoOutputFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.OutputVideo.JoinNumber + ioSlotJoin]);
+
+
+ OutputNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputNames.JoinNumber + ioSlotJoin]);
+ InputNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.InputNames.JoinNumber + ioSlotJoin]);
+ OutputVideoRouteNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputCurrentVideoInputNames.JoinNumber + ioSlotJoin]);
+ }
+ }
+
+ private void SetHdcpStateAction(bool hdcpTypeSimple, HdmiInputWithCEC port, uint join, BasicTriList trilist)
+ {
+ if (hdcpTypeSimple)
+ {
+ trilist.SetUShortSigAction(join,
+ s =>
+ {
+ if (s == 0)
+ {
+ port.HdcpSupportOff();
+ }
+ else if (s > 0)
+ {
+ port.HdcpSupportOn();
+ }
+ });
+ }
+ else
+ {
+ trilist.SetUShortSigAction(join,
+ u =>
+ {
+ port.HdcpReceiveCapability = (eHdcpCapabilityType)u;
+ });
+ }
+ }
+
+ private void SetHdcpStateAction(bool hdcpTypeSimple, EndpointHdmiInput port, uint join, BasicTriList trilist)
+ {
+ if (hdcpTypeSimple)
+ {
+ trilist.SetUShortSigAction(join,
+ s =>
+ {
+ if (s == 0)
+ {
+ port.HdcpSupportOff();
+ }
+ else if (s > 0)
+ {
+ port.HdcpSupportOn();
+ }
+ });
+ }
+ else
+ {
+ trilist.SetUShortSigAction(join,
+ u =>
+ {
+ port.HdcpCapability = (eHdcpCapabilityType)u;
+ });
+ }
+ }
+
+ private void SetHdcpStateAction(bool supportsHdcp2, DMInputPortWithCec port, uint join, BasicTriList trilist)
+ {
+ if (!supportsHdcp2)
+ {
+ trilist.SetUShortSigAction(join,
+ s =>
+ {
+ if (s == 0)
+ {
+ port.HdcpSupportOff();
+ }
+ else if (s > 0)
+ {
+ port.HdcpSupportOn();
+ }
+ });
+ }
+ else
+ {
+ trilist.SetUShortSigAction(join,
+ u =>
+ {
+ port.HdcpReceiveCapability = (eHdcpCapabilityType)u;
+ });
+ }
+ }
}
/*
diff --git a/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmChassisController.cs b/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmChassisController.cs
index 033d6a54..0af41f48 100644
--- a/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmChassisController.cs
+++ b/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmChassisController.cs
@@ -1,1003 +1,1318 @@
-
-using System;
-using System.Collections.Generic;
-using Crestron.SimplSharp;
-using Crestron.SimplSharpPro.DM;
-using Crestron.SimplSharpPro.DM.Cards;
-using PepperDash.Core;
-using PepperDash.Essentials.Core;
-using PepperDash.Essentials.DM.Config;
-
-namespace PepperDash.Essentials.DM
-{
- ///
- /// Builds a controller for basic DM-RMCs with Com and IR ports and no control functions
- ///
- ///
- public class DmChassisController : CrestronGenericBaseDevice, IDmSwitch, IRoutingInputsOutputs, IRouting, IHasFeedback
- {
- public DMChassisPropertiesConfig PropertiesConfig { get; set; }
-
- public Switch Chassis { get; private set; }
-
- // Feedbacks for EssentialDM
- public Dictionary VideoOutputFeedbacks { get; private set; }
- public Dictionary AudioOutputFeedbacks { get; private set; }
- public Dictionary VideoInputSyncFeedbacks { get; private set; }
- public Dictionary InputEndpointOnlineFeedbacks { get; private set; }
- public Dictionary OutputEndpointOnlineFeedbacks { get; private set; }
- public Dictionary InputNameFeedbacks { get; private set; }
- public Dictionary OutputNameFeedbacks { get; private set; }
- public Dictionary OutputVideoRouteNameFeedbacks { get; private set; }
- public Dictionary OutputAudioRouteNameFeedbacks { get; private set; }
- public Dictionary UsbOutputRoutedToFeebacks { get; private set; }
- public Dictionary UsbInputRoutedToFeebacks { get; private set; }
- public Dictionary OutputDisabledByHdcpFeedbacks { get; private set; }
-
- public IntFeedback SystemIdFeebdack { get; private set; }
- public BoolFeedback SystemIdBusyFeedback { get; private set; }
-
- public Dictionary InputCardHdcpCapabilityFeedbacks { get; private set; }
-
- public Dictionary InputCardHdcpCapabilityTypes { get; private set; }
-
- // Need a couple Lists of generic Backplane ports
- public RoutingPortCollection InputPorts { get; private set; }
- public RoutingPortCollection OutputPorts { get; private set; }
-
- public Dictionary TxDictionary { get; set; }
- public Dictionary RxDictionary { get; set; }
-
- //public Dictionary InputCards { get; private set; }
- //public Dictionary OutputCards { get; private set; }
-
- public Dictionary InputNames { get; set; }
- public Dictionary OutputNames { get; set; }
- public Dictionary VolumeControls { get; private set; }
-
- public const int RouteOffTime = 500;
- Dictionary RouteOffTimers = new Dictionary();
-
- ///
- /// Text that represents when an output has no source routed to it
- ///
- public string NoRouteText = "";
-
- ///
- /// Factory method to create a new chassis controller from config data. Limited to 8x8 right now
- ///
- public static DmChassisController GetDmChassisController(string key, string name,
- string type, DMChassisPropertiesConfig properties)
- {
- try
- {
- type = type.ToLower();
- uint ipid = properties.Control.IpIdInt;
-
- DmMDMnxn chassis = null;
- switch (type) {
- case "dmmd8x8":
- chassis = new DmMd8x8(ipid, Global.ControlSystem);
- break;
- case "dmmd8x8rps":
- chassis = new DmMd8x8rps(ipid, Global.ControlSystem);
- break;
- case "dmmd8x8cpu3":
- chassis = new DmMd8x8Cpu3(ipid, Global.ControlSystem);
- break;
- case "dmmd8x8cpu3rps":
- chassis = new DmMd8x8Cpu3rps(ipid, Global.ControlSystem);
- break;
- case "dmmd16x16":
- chassis = new DmMd16x16(ipid, Global.ControlSystem);
- break;
- case "dmmd16x16rps":
- chassis = new DmMd16x16rps(ipid, Global.ControlSystem);
- break;
- case "dmmd16x16cpu3":
- chassis = new DmMd16x16Cpu3(ipid, Global.ControlSystem);
- break;
- case "dmmd16x16cpu3rps":
- chassis = new DmMd16x16Cpu3rps(ipid, Global.ControlSystem);
- break;
- case "dmmd32x32":
- chassis = new DmMd32x32(ipid, Global.ControlSystem);
- break;
- case "dmmd32x32rps":
- chassis = new DmMd32x32rps(ipid, Global.ControlSystem);
- break;
- case "dmmd32x32cpu3":
- chassis = new DmMd32x32Cpu3(ipid, Global.ControlSystem);
- break;
- case "dmmd32x32cpu3rps":
- chassis = new DmMd32x32Cpu3rps(ipid, Global.ControlSystem);
- break;
- }
-
- if (chassis == null)
- return null;
-
- var controller = new DmChassisController(key, name, chassis);
-
- // add the cards and port names
- foreach (var kvp in properties.InputSlots)
- controller.AddInputCard(kvp.Value, kvp.Key);
-
- foreach (var kvp in properties.OutputSlots)
- controller.AddOutputCard(kvp.Value, kvp.Key);
-
- foreach (var kvp in properties.VolumeControls)
- {
- // get the card
- // check it for an audio-compatible type
- // make a something-something that will make it work
- // retire to mountain village
- var outNum = kvp.Key;
- var card = controller.Chassis.Outputs[outNum].Card;
- Audio.Output audio = null;
- if (card is DmcHdo)
- audio = (card as DmcHdo).Audio;
- else if (card is Dmc4kHdo)
- audio = (card as Dmc4kHdo).Audio;
- if (audio == null)
- continue;
-
- // wire up the audio to something here...
- controller.AddVolumeControl(outNum, audio);
- }
-
- controller.InputNames = properties.InputNames;
- controller.OutputNames = properties.OutputNames;
-
- if (!string.IsNullOrEmpty(properties.NoRouteText))
- {
- controller.NoRouteText = properties.NoRouteText;
- Debug.Console(1, controller, "Setting No Route Text value to: {0}", controller.NoRouteText);
- }
- else
- {
- Debug.Console(1, controller, "NoRouteText not specified. Defaulting to blank string.", controller.NoRouteText);
- }
-
- controller.PropertiesConfig = properties;
- return controller;
- }
- catch (Exception e)
- {
- Debug.Console(0, "Error creating DM chassis:\r{0}", e);
- }
-
- return null;
- }
-
- ///
- ///
- ///
- ///
- ///
- ///
- public DmChassisController(string key, string name, DmMDMnxn chassis)
- : base(key, name, chassis)
- {
- Chassis = chassis;
- InputPorts = new RoutingPortCollection();
- OutputPorts = new RoutingPortCollection();
- VolumeControls = new Dictionary();
- TxDictionary = new Dictionary();
- RxDictionary = new Dictionary();
- IsOnline.OutputChange += new EventHandler(IsOnline_OutputChange);
- Chassis.DMInputChange += new DMInputEventHandler(Chassis_DMInputChange);
- Chassis.DMSystemChange += new DMSystemEventHandler(Chassis_DMSystemChange);
- Chassis.DMOutputChange += new DMOutputEventHandler(Chassis_DMOutputChange);
- VideoOutputFeedbacks = new Dictionary();
- AudioOutputFeedbacks = new Dictionary();
- UsbOutputRoutedToFeebacks = new Dictionary();
- UsbInputRoutedToFeebacks = new Dictionary();
- OutputDisabledByHdcpFeedbacks = new Dictionary();
- VideoInputSyncFeedbacks = new Dictionary();
- InputNameFeedbacks = new Dictionary();
- OutputNameFeedbacks = new Dictionary();
- OutputVideoRouteNameFeedbacks = new Dictionary();
- OutputAudioRouteNameFeedbacks = new Dictionary();
- InputEndpointOnlineFeedbacks = new Dictionary();
- OutputEndpointOnlineFeedbacks = new Dictionary();
-
- SystemIdFeebdack = new IntFeedback(() => { return (Chassis as DmMDMnxn).SystemIdFeedback.UShortValue; });
- SystemIdBusyFeedback = new BoolFeedback(() => { return (Chassis as DmMDMnxn).SystemIdBusy.BoolValue; });
- InputCardHdcpCapabilityFeedbacks = new Dictionary();
- InputCardHdcpCapabilityTypes = new Dictionary();
-
- for (uint x = 1; x <= Chassis.NumberOfOutputs; x++)
- {
- var tempX = x;
-
- if (Chassis.Outputs[tempX] != null)
- {
- VideoOutputFeedbacks[tempX] = new IntFeedback(() => {
- if (Chassis.Outputs[tempX].VideoOutFeedback != null)
- return (ushort)Chassis.Outputs[tempX].VideoOutFeedback.Number;
-
- return 0;
- });
- AudioOutputFeedbacks[tempX] = new IntFeedback(() => {
- if (Chassis.Outputs[tempX].AudioOutFeedback != null)
- return (ushort)Chassis.Outputs[tempX].AudioOutFeedback.Number;
-
- return 0;
- });
- UsbOutputRoutedToFeebacks[tempX] = new IntFeedback(() => {
- if (Chassis.Outputs[tempX].USBRoutedToFeedback != null)
- return (ushort)Chassis.Outputs[tempX].USBRoutedToFeedback.Number;
-
- return 0;
- });
-
- OutputNameFeedbacks[tempX] = new StringFeedback(() => {
- if (Chassis.Outputs[tempX].NameFeedback != null)
- return Chassis.Outputs[tempX].NameFeedback.StringValue;
-
- return "";
- });
- OutputVideoRouteNameFeedbacks[tempX] = new StringFeedback(() => {
- if (Chassis.Outputs[tempX].VideoOutFeedback != null)
- return Chassis.Outputs[tempX].VideoOutFeedback.NameFeedback.StringValue;
-
- return NoRouteText;
- });
- OutputAudioRouteNameFeedbacks[tempX] = new StringFeedback(() => {
- if (Chassis.Outputs[tempX].AudioOutFeedback != null)
- return Chassis.Outputs[tempX].AudioOutFeedback.NameFeedback.StringValue;
-
- return NoRouteText;
- });
- OutputEndpointOnlineFeedbacks[tempX] = new BoolFeedback(() => Chassis.Outputs[tempX].EndpointOnlineFeedback);
-
- OutputDisabledByHdcpFeedbacks[tempX] = new BoolFeedback(() => {
- var output = Chassis.Outputs[tempX];
-
- var hdmiTxOutput = output as Card.HdmiTx;
- if (hdmiTxOutput != null)
- return hdmiTxOutput.HdmiOutput.DisabledByHdcp.BoolValue;
-
- var dmHdmiOutput = output as Card.DmHdmiOutput;
- if (dmHdmiOutput != null)
- return dmHdmiOutput.DisabledByHdcpFeedback.BoolValue;
-
- var dmsDmOutAdvanced = output as Card.DmsDmOutAdvanced;
- if (dmsDmOutAdvanced != null)
- return dmsDmOutAdvanced.DisabledByHdcpFeedback.BoolValue;
-
- var dmps3HdmiAudioOutput = output as Card.Dmps3HdmiAudioOutput;
- if (dmps3HdmiAudioOutput != null)
- return dmps3HdmiAudioOutput.HdmiOutputPort.DisabledByHdcpFeedback.BoolValue;
-
- var dmps3HdmiOutput = output as Card.Dmps3HdmiOutput;
- if (dmps3HdmiOutput != null)
- return dmps3HdmiOutput.HdmiOutputPort.DisabledByHdcpFeedback.BoolValue;
-
- var dmps3HdmiOutputBackend = output as Card.Dmps3HdmiOutputBackend;
- if (dmps3HdmiOutputBackend != null)
- return dmps3HdmiOutputBackend.HdmiOutputPort.DisabledByHdcpFeedback.BoolValue;
-
- // var hdRx4kX10HdmiOutput = output as HdRx4kX10HdmiOutput;
- // if (hdRx4kX10HdmiOutput != null)
- // return hdRx4kX10HdmiOutput.HdmiOutputPort.DisabledByHdcpFeedback.BoolValue;
-
- // var hdMdNxMHdmiOutput = output as HdMdNxMHdmiOutput;
- // if (hdMdNxMHdmiOutput != null)
- // return hdMdNxMHdmiOutput.HdmiOutputPort.DisabledByHdcpFeedback.BoolValue;
-
- return false;
- });
- }
-
- if (Chassis.Inputs[tempX] != null)
- {
- UsbInputRoutedToFeebacks[tempX] = new IntFeedback(() => {
- if (Chassis.Inputs[tempX].USBRoutedToFeedback != null)
- return (ushort)Chassis.Inputs[tempX].USBRoutedToFeedback.Number;
-
- return 0;
- });
- VideoInputSyncFeedbacks[tempX] = new BoolFeedback(() => {
- if (Chassis.Inputs[tempX].VideoDetectedFeedback != null)
- return Chassis.Inputs[tempX].VideoDetectedFeedback.BoolValue;
-
- return false;
- });
- InputNameFeedbacks[tempX] = new StringFeedback(() => {
- if (Chassis.Inputs[tempX].NameFeedback != null)
- return Chassis.Inputs[tempX].NameFeedback.StringValue;
-
- return "";
- });
-
- InputEndpointOnlineFeedbacks[tempX] = new BoolFeedback(() => { return Chassis.Inputs[tempX].EndpointOnlineFeedback; });
-
- InputCardHdcpCapabilityFeedbacks[tempX] = new IntFeedback(() => {
- var inputCard = Chassis.Inputs[tempX];
-
- if (inputCard.Card is DmcHd)
- {
- InputCardHdcpCapabilityTypes[tempX] = eHdcpCapabilityType.HdcpAutoSupport;
-
- if ((inputCard.Card as DmcHd).HdmiInput.HdcpSupportOnFeedback.BoolValue)
- return 1;
- return 0;
- }
-
- if (inputCard.Card is DmcHdDsp)
- {
- InputCardHdcpCapabilityTypes[tempX] = eHdcpCapabilityType.HdcpAutoSupport;
-
- if ((inputCard.Card as DmcHdDsp).HdmiInput.HdcpSupportOnFeedback.BoolValue)
- return 1;
- return 0;
- }
- if (inputCard.Card is Dmc4kHdBase)
- {
- InputCardHdcpCapabilityTypes[tempX] = eHdcpCapabilityType.Hdcp2_2Support;
- return (int)(inputCard.Card as Dmc4kHdBase).HdmiInput.HdcpReceiveCapability;
- }
- if (inputCard.Card is Dmc4kCBase)
- {
- if (PropertiesConfig.InputSlotSupportsHdcp2[tempX])
- {
- InputCardHdcpCapabilityTypes[tempX] = eHdcpCapabilityType.HdcpAutoSupport;
- return (int)(inputCard.Card as Dmc4kCBase).DmInput.HdcpReceiveCapability;
- }
-
- if ((inputCard.Card as Dmc4kCBase).DmInput.HdcpSupportOnFeedback.BoolValue)
- return 1;
- return 0;
- }
- if (inputCard.Card is Dmc4kCDspBase)
- {
- if (PropertiesConfig.InputSlotSupportsHdcp2[tempX])
- {
- InputCardHdcpCapabilityTypes[tempX] = eHdcpCapabilityType.HdcpAutoSupport;
- return (int)(inputCard.Card as Dmc4kCDspBase).DmInput.HdcpReceiveCapability;
- }
-
- if ((inputCard.Card as Dmc4kCDspBase).DmInput.HdcpSupportOnFeedback.BoolValue)
- return 1;
-
- return 0;
- }
- return 0;
- });
- }
- }
- }
-
- ///
- ///
- ///
- ///
- ///
- public void AddInputCard(string type, uint number)
- {
- Debug.Console(2, this, "Adding input card '{0}', slot {1}", type, number);
-
- type = type.ToLower();
-
- if (type == "dmchd")
- {
- var inputCard = new DmcHd(number, this.Chassis);
- var cecPort = inputCard.HdmiInput as ICec;
- AddHdmiInCardPorts(number, cecPort);
- }
- else if (type == "dmchddsp")
- {
- var inputCard = new DmcHdDsp(number, this.Chassis);
- var cecPort = inputCard.HdmiInput as ICec;
- AddHdmiInCardPorts(number, cecPort);
- }
- else if (type == "dmc4khd")
- {
- var inputCard = new Dmc4kHd(number, this.Chassis);
- var cecPort = inputCard.HdmiInput as ICec;
- AddHdmiInCardPorts(number, cecPort);
- }
- else if (type == "dmc4khddsp")
- {
- var inputCard = new Dmc4kHdDsp(number, this.Chassis);
- var cecPort = inputCard.HdmiInput as ICec;
- AddHdmiInCardPorts(number, cecPort);
- }
- else if (type == "dmc4kzhd")
- {
- var inputCard = new Dmc4kzHd(number, this.Chassis);
- var cecPort = inputCard.HdmiInput as ICec;
- AddHdmiInCardPorts(number, cecPort);
- }
- else if (type == "dmc4kzhddsp")
- {
- var inputCard = new Dmc4kzHdDsp(number, this.Chassis);
- var cecPort = inputCard.HdmiInput as ICec;
- AddHdmiInCardPorts(number, cecPort);
- }
- else if (type == "dmcc")
- {
- var inputCard = new DmcC(number, this.Chassis);
- var cecPort = inputCard.DmInput as ICec;
- AddDmInCardPorts(number, cecPort);
- }
- else if (type == "dmccdsp")
- {
- var inputCard = new DmcCDsp(number, this.Chassis);
- var cecPort = inputCard.DmInput as ICec;
- AddDmInCardPorts(number, cecPort);
- }
- else if (type == "dmc4kc")
- {
- var inputCard = new Dmc4kC(number, this.Chassis);
- var cecPort = inputCard.DmInput as ICec;
- AddDmInCardPorts(number, cecPort);
- }
- else if (type == "dmc4kcdsp")
- {
- var inputCard = new Dmc4kCDsp(number, this.Chassis);
- var cecPort = inputCard.DmInput as ICec;
- AddDmInCardPorts(number, cecPort);
- }
- else if (type == "dmc4kzc")
- {
- var inputCard = new Dmc4kzC(number, this.Chassis);
- var cecPort = inputCard.DmInput as ICec;
- AddDmInCardPorts(number, cecPort);
- }
- else if (type == "dmc4kzcdsp")
- {
- var inputCard = new Dmc4kzCDsp(number, this.Chassis);
- var cecPort = inputCard.DmInput as ICec;
- AddDmInCardPorts(number, cecPort);
- }
- else if (type == "dmccat")
- {
- new DmcCat(number, this.Chassis);
- AddDmInCardPorts(number);
- }
- else if (type == "dmccatdsp")
- {
- new DmcCatDsp(number, this.Chassis);
- AddDmInCardPorts(number);
- }
- else if (type == "dmcs")
- {
- new DmcS(number, Chassis);
- AddInputPortWithDebug(number, "dmIn", eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.DmMmFiber);
- AddInCardHdmiAndAudioLoopPorts(number);
- }
- else if (type == "dmcsdsp")
- {
- new DmcSDsp(number, Chassis);
- AddInputPortWithDebug(number, "dmIn", eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.DmMmFiber);
- AddInCardHdmiAndAudioLoopPorts(number);
- }
- else if (type == "dmcs2")
- {
- new DmcS2(number, Chassis);
- AddInputPortWithDebug(number, "dmIn", eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.DmSmFiber);
- AddInCardHdmiAndAudioLoopPorts(number);
- }
- else if (type == "dmcs2dsp")
- {
- new DmcS2Dsp(number, Chassis);
- AddInputPortWithDebug(number, "dmIn", eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.DmSmFiber);
- AddInCardHdmiAndAudioLoopPorts(number);
- }
- else if (type == "dmcsdi")
- {
- new DmcSdi(number, Chassis);
- AddInputPortWithDebug(number, "sdiIn", eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Sdi);
- AddOutputPortWithDebug(string.Format("inputCard{0}", number), "sdiOut", eRoutingSignalType.Audio | eRoutingSignalType.Video,
- eRoutingPortConnectionType.Sdi, null);
- AddInCardHdmiAndAudioLoopPorts(number);
- }
- else if (type == "dmcdvi")
- {
- new DmcDvi(number, Chassis);
- AddInputPortWithDebug(number, "dviIn", eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Dvi);
- AddInputPortWithDebug(number, "audioIn", eRoutingSignalType.Audio, eRoutingPortConnectionType.LineAudio);
- AddInCardHdmiLoopPort(number);
- }
- else if (type == "dmcvga")
- {
- new DmcVga(number, Chassis);
- AddInputPortWithDebug(number, "vgaIn", eRoutingSignalType.Video, eRoutingPortConnectionType.Vga);
- AddInputPortWithDebug(number, "audioIn", eRoutingSignalType.Audio, eRoutingPortConnectionType.LineAudio);
- AddInCardHdmiLoopPort(number);
- }
- else if (type == "dmcvidbnc")
- {
- new DmcVidBnc(number, Chassis);
- AddInputPortWithDebug(number, "componentIn", eRoutingSignalType.Video, eRoutingPortConnectionType.Component);
- AddInputPortWithDebug(number, "audioIn", eRoutingSignalType.Audio, eRoutingPortConnectionType.LineAudio);
- AddInCardHdmiLoopPort(number);
- }
- else if (type == "dmcvidrcaa")
- {
- new DmcVidRcaA(number, Chassis);
- AddInputPortWithDebug(number, "componentIn", eRoutingSignalType.Video, eRoutingPortConnectionType.Component);
- AddInputPortWithDebug(number, "audioIn", eRoutingSignalType.Audio, eRoutingPortConnectionType.LineAudio);
- AddInCardHdmiLoopPort(number);
- }
- else if (type == "dmcvidrcad")
- {
- new DmcVidRcaD(number, Chassis);
- AddInputPortWithDebug(number, "componentIn", eRoutingSignalType.Video, eRoutingPortConnectionType.Component);
- AddInputPortWithDebug(number, "audioIn", eRoutingSignalType.Audio, eRoutingPortConnectionType.DigitalAudio);
- AddInCardHdmiLoopPort(number);
- }
- else if (type == "dmcvid4")
- {
- new DmcVid4(number, Chassis);
- AddInputPortWithDebug(number, "compositeIn1", eRoutingSignalType.Video, eRoutingPortConnectionType.Composite);
- AddInputPortWithDebug(number, "compositeIn2", eRoutingSignalType.Video, eRoutingPortConnectionType.Composite);
- AddInputPortWithDebug(number, "compositeIn3", eRoutingSignalType.Video, eRoutingPortConnectionType.Composite);
- AddInputPortWithDebug(number, "compositeIn4", eRoutingSignalType.Video, eRoutingPortConnectionType.Composite);
- AddInCardHdmiLoopPort(number);
- }
- else if (type == "dmcstr")
- {
- new DmcStr(number, Chassis);
- AddInputPortWithDebug(number, "streamIn", eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Streaming);
- AddInCardHdmiAndAudioLoopPorts(number);
- }
- }
-
- void AddDmInCardPorts(uint number)
- {
- AddInputPortWithDebug(number, "dmIn", eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.DmCat);
- AddInCardHdmiAndAudioLoopPorts(number);
- }
-
- void AddDmInCardPorts(uint number, ICec cecPort)
- {
- AddInputPortWithDebug(number, "dmIn", eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.DmCat, cecPort);
- AddInCardHdmiAndAudioLoopPorts(number);
- }
-
- void AddHdmiInCardPorts(uint number, ICec cecPort)
- {
- AddInputPortWithDebug(number, "hdmiIn", eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, cecPort);
- AddInCardHdmiAndAudioLoopPorts(number);
- }
-
- void AddInCardHdmiAndAudioLoopPorts(uint number)
- {
- AddOutputPortWithDebug(string.Format("inputCard{0}", number), "hdmiLoopOut", eRoutingSignalType.Audio | eRoutingSignalType.Video,
- eRoutingPortConnectionType.Hdmi, null);
- AddOutputPortWithDebug(string.Format("inputCard{0}", number), "audioLoopOut", eRoutingSignalType.Audio, eRoutingPortConnectionType.Hdmi, null);
- }
-
- void AddInCardHdmiLoopPort(uint number)
- {
- AddOutputPortWithDebug(string.Format("inputCard{0}", number), "hdmiLoopOut", eRoutingSignalType.Audio | eRoutingSignalType.Video,
- eRoutingPortConnectionType.Hdmi, null);
- }
-
- ///
- ///
- ///
- ///
- ///
- public void AddOutputCard(string type, uint number)
- {
- type = type.ToLower();
-
- Debug.Console(2, this, "Adding output card '{0}', slot {1}", type, number);
- if (type == "dmc4khdo")
- {
- var outputCard = new Dmc4kHdoSingle(number, Chassis);
- var cecPort1 = outputCard.Card1.HdmiOutput;
- var cecPort2 = outputCard.Card2.HdmiOutput;
- AddDmcHdoPorts(number, cecPort1, cecPort2);
- }
- else if (type == "dmchdo")
- {
- var outputCard = new DmcHdoSingle(number, Chassis);
- var cecPort1 = outputCard.Card1.HdmiOutput;
- var cecPort2 = outputCard.Card2.HdmiOutput;
- AddDmcHdoPorts(number, cecPort1, cecPort2);
- }
- else if (type == "dmc4kcohd")
- {
- var outputCard = new Dmc4kCoHdSingle(number, Chassis);
- var cecPort1 = outputCard.Card1.HdmiOutput;
- AddDmcCoPorts(number, cecPort1);
- }
- else if (type == "dmc4kzcohd")
- {
- var outputCard = new Dmc4kzCoHdSingle(number, Chassis);
- var cecPort1 = outputCard.Card1.HdmiOutput;
- AddDmcCoPorts(number, cecPort1);
- }
- else if (type == "dmccohd")
- {
- var outputCard = new DmcCoHdSingle(number, Chassis);
- var cecPort1 = outputCard.Card1.HdmiOutput;
- AddDmcCoPorts(number, cecPort1);
- }
- else if (type == "dmccatohd")
- {
- var outputCard = new DmcCatoHdSingle(number, Chassis);
- var cecPort1 = outputCard.Card1.HdmiOutput;
- AddDmcCoPorts(number, cecPort1);
- }
- else if (type == "dmcsohd")
- {
- var outputCard = new DmcSoHdSingle(number, Chassis);
- var cecPort1 = outputCard.Card1.HdmiOutput;
- AddOutputPortWithDebug(string.Format("outputCard{0}", number), "dmOut1", eRoutingSignalType.Audio | eRoutingSignalType.Video,
- eRoutingPortConnectionType.DmMmFiber, 2 * (number - 1) + 1);
- AddOutputPortWithDebug(string.Format("outputCard{0}", number), "hdmiOut1", eRoutingSignalType.Audio | eRoutingSignalType.Video,
- eRoutingPortConnectionType.Hdmi, 2 * (number - 1) + 1, cecPort1);
- AddOutputPortWithDebug(string.Format("outputCard{0}", number), "dmOut2", eRoutingSignalType.Audio | eRoutingSignalType.Video,
- eRoutingPortConnectionType.DmMmFiber, 2 * (number - 1) + 2);
- }
- else if (type == "dmcs2ohd")
- {
- var outputCard = new DmcS2oHdSingle(number, Chassis);
- var cecPort1 = outputCard.Card1.HdmiOutput;
- AddOutputPortWithDebug(string.Format("outputCard{0}", number), "dmOut1", eRoutingSignalType.Audio | eRoutingSignalType.Video,
- eRoutingPortConnectionType.DmSmFiber, 2 * (number - 1) + 1);
- AddOutputPortWithDebug(string.Format("outputCard{0}", number), "hdmiOut1", eRoutingSignalType.Audio | eRoutingSignalType.Video,
- eRoutingPortConnectionType.Hdmi, 2 * (number - 1) + 1, cecPort1);
- AddOutputPortWithDebug(string.Format("outputCard{0}", number), "dmOut2", eRoutingSignalType.Audio | eRoutingSignalType.Video,
- eRoutingPortConnectionType.DmSmFiber, 2 * (number - 1) + 2);
- }
- else if (type == "dmcstro")
- {
- var outputCard = new DmcStroSingle(number, Chassis);
- AddOutputPortWithDebug(string.Format("outputCard{0}", number), "streamOut", eRoutingSignalType.Audio | eRoutingSignalType.Video,
- eRoutingPortConnectionType.Streaming, 2 * (number - 1) + 1);
- }
-
- else
- Debug.Console(1, this, " WARNING: Output card type '{0}' is not available", type);
- }
-
- void AddDmcHdoPorts(uint number, ICec cecPort1, ICec cecPort2)
- {
- AddOutputPortWithDebug(string.Format("outputCard{0}", number), "hdmiOut1", eRoutingSignalType.Audio | eRoutingSignalType.Video,
- eRoutingPortConnectionType.Hdmi, 2 * (number - 1) + 1, cecPort1);
- AddOutputPortWithDebug(string.Format("outputCard{0}", number), "audioOut1", eRoutingSignalType.Audio, eRoutingPortConnectionType.LineAudio,
- 2 * (number - 1) + 1);
- AddOutputPortWithDebug(string.Format("outputCard{0}", number), "hdmiOut2", eRoutingSignalType.Audio | eRoutingSignalType.Video,
- eRoutingPortConnectionType.Hdmi, 2 * (number - 1) + 2, cecPort2);
- AddOutputPortWithDebug(string.Format("outputCard{0}", number), "audioOut2", eRoutingSignalType.Audio, eRoutingPortConnectionType.LineAudio,
- 2 * (number - 1) + 2);
- }
-
- void AddDmcCoPorts(uint number, ICec cecPort1)
- {
- AddOutputPortWithDebug(string.Format("outputCard{0}", number), "dmOut1", eRoutingSignalType.Audio | eRoutingSignalType.Video,
- eRoutingPortConnectionType.DmCat, 2 * (number - 1) + 1);
- AddOutputPortWithDebug(string.Format("outputCard{0}", number), "hdmiOut1", eRoutingSignalType.Audio | eRoutingSignalType.Video,
- eRoutingPortConnectionType.Hdmi, 2 * (number - 1) + 1, cecPort1);
- AddOutputPortWithDebug(string.Format("outputCard{0}", number), "dmOut2", eRoutingSignalType.Audio | eRoutingSignalType.Video,
- eRoutingPortConnectionType.DmCat, 2 * (number - 1) + 2);
- }
-
- ///
- /// Adds InputPort
- ///
- void AddInputPortWithDebug(uint cardNum, string portName, eRoutingSignalType sigType, eRoutingPortConnectionType portType)
- {
- var portKey = string.Format("inputCard{0}--{1}", cardNum, portName);
- Debug.Console(2, this, "Adding input port '{0}'", portKey);
- var inputPort = new RoutingInputPort(portKey, sigType, portType, cardNum, this);
-
- InputPorts.Add(inputPort);
- }
-
- ///
- /// Adds InputPort and sets Port as ICec object
- ///
- void AddInputPortWithDebug(uint cardNum, string portName, eRoutingSignalType sigType, eRoutingPortConnectionType portType, ICec cecPort)
- {
- var portKey = string.Format("inputCard{0}--{1}", cardNum, portName);
- Debug.Console(2, this, "Adding input port '{0}'", portKey);
- var inputPort = new RoutingInputPort(portKey, sigType, portType, cardNum, this);
-
- if (cecPort != null)
- inputPort.Port = cecPort;
-
- InputPorts.Add(inputPort);
- }
-
- ///
- /// Adds OutputPort
- ///
- void AddOutputPortWithDebug(string cardName, string portName, eRoutingSignalType sigType, eRoutingPortConnectionType portType, object selector)
- {
- var portKey = string.Format("{0}--{1}", cardName, portName);
- Debug.Console(2, this, "Adding output port '{0}'", portKey);
- OutputPorts.Add(new RoutingOutputPort(portKey, sigType, portType, selector, this));
- }
-
- ///
- /// Adds OutputPort and sets Port as ICec object
- ///
- void AddOutputPortWithDebug(string cardName, string portName, eRoutingSignalType sigType, eRoutingPortConnectionType portType, object selector, ICec cecPort)
- {
- var portKey = string.Format("{0}--{1}", cardName, portName);
- Debug.Console(2, this, "Adding output port '{0}'", portKey);
- var outputPort = new RoutingOutputPort(portKey, sigType, portType, selector, this);
-
- if (cecPort != null)
- outputPort.Port = cecPort;
-
- OutputPorts.Add(outputPort);
- }
-
- ///
- ///
- ///
- void AddVolumeControl(uint number, Audio.Output audio)
- {
- VolumeControls.Add(number, new DmCardAudioOutputController(audio));
- }
-
- //public void SetInputHdcpSupport(uint input, ePdtHdcpSupport hdcpSetting)
- //{
-
- //}
-
- void Chassis_DMSystemChange(Switch device, DMSystemEventArgs args)
- {
- switch (args.EventId)
- {
- case DMSystemEventIds.SystemIdEventId:
- {
- Debug.Console(2, this, "SystemIdEvent Value: {0}", (Chassis as DmMDMnxn).SystemIdFeedback.UShortValue);
- SystemIdFeebdack.FireUpdate();
- break;
- }
- case DMSystemEventIds.SystemIdBusyEventId:
- {
- Debug.Console(2, this, "SystemIdBusyEvent State: {0}", (Chassis as DmMDMnxn).SystemIdBusy.BoolValue);
- SystemIdBusyFeedback.FireUpdate();
- break;
- }
- }
- }
-
- void Chassis_DMInputChange(Switch device, DMInputEventArgs args)
- {
- switch (args.EventId)
- {
- case DMInputEventIds.EndpointOnlineEventId:
- {
- Debug.Console(2, this, "DM Input EndpointOnlineEventId for input: {0}. State: {1}", args.Number, device.Inputs[args.Number].EndpointOnlineFeedback);
- InputEndpointOnlineFeedbacks[args.Number].FireUpdate();
- break;
- }
- case DMInputEventIds.OnlineFeedbackEventId:
- {
- Debug.Console(2, this, "DM Input OnlineFeedbackEventId for input: {0}. State: {1}", args.Number, device.Inputs[args.Number].EndpointOnlineFeedback);
- InputEndpointOnlineFeedbacks[args.Number].FireUpdate();
- break;
- }
- case DMInputEventIds.VideoDetectedEventId:
- {
- Debug.Console(2, this, "DM Input {0} VideoDetectedEventId", args.Number);
- VideoInputSyncFeedbacks[args.Number].FireUpdate();
- break;
- }
- case DMInputEventIds.InputNameEventId:
- {
- Debug.Console(2, this, "DM Input {0} NameFeedbackEventId", args.Number);
- InputNameFeedbacks[args.Number].FireUpdate();
- break;
- }
- case DMInputEventIds.UsbRoutedToEventId:
- {
- Debug.Console(2, this, "DM Input {0} UsbRoutedToEventId", args.Number);
- if (UsbInputRoutedToFeebacks[args.Number] != null)
- UsbInputRoutedToFeebacks[args.Number].FireUpdate();
- else
- Debug.Console(1, this, "No index of {0} found in UsbInputRoutedToFeedbacks");
- break;
- }
- case DMInputEventIds.HdcpCapabilityFeedbackEventId:
- {
- Debug.Console(2, this, "DM Input {0} HdcpCapabilityFeedbackEventId", args.Number);
- if (InputCardHdcpCapabilityFeedbacks[args.Number] != null)
- InputCardHdcpCapabilityFeedbacks[args.Number].FireUpdate();
- else
- Debug.Console(1, this, "No index of {0} found in InputCardHdcpCapabilityFeedbacks");
- break;
- }
- default:
- {
- Debug.Console(2, this, "DMInputChange fired for Input {0} with Unhandled EventId: {1}", args.Number, args.EventId);
- break;
- }
- }
- }
-
- ///
- ///
- void Chassis_DMOutputChange(Switch device, DMOutputEventArgs args)
- {
- var output = args.Number;
-
- switch (args.EventId)
- {
- case DMOutputEventIds.VolumeEventId:
- {
- if (VolumeControls.ContainsKey(output))
- {
- VolumeControls[args.Number].VolumeEventFromChassis();
- }
-
- break;
- }
- case DMOutputEventIds.EndpointOnlineEventId:
- {
- Debug.Console(2, this, "Output {0} DMOutputEventIds.EndpointOnlineEventId fired. State: {1}", args.Number,
- Chassis.Outputs[output].EndpointOnlineFeedback);
- OutputEndpointOnlineFeedbacks[output].FireUpdate();
- break;
- }
- case DMOutputEventIds.OnlineFeedbackEventId:
- {
- Debug.Console(2, this, "Output {0} DMInputEventIds.OnlineFeedbackEventId fired. State: {1}", args.Number,
- Chassis.Outputs[output].EndpointOnlineFeedback);
- OutputEndpointOnlineFeedbacks[output].FireUpdate();
- break;
- }
- case DMOutputEventIds.VideoOutEventId:
- {
- if (Chassis.Outputs[output].VideoOutFeedback != null)
- Debug.Console(2, this, "DMSwitchVideo:{0} Routed Input:{1} Output:{2}'", this.Name, Chassis.Outputs[output].VideoOutFeedback.Number, output);
-
- if (VideoOutputFeedbacks.ContainsKey(output))
- VideoOutputFeedbacks[output].FireUpdate();
-
- if (OutputVideoRouteNameFeedbacks.ContainsKey(output))
- OutputVideoRouteNameFeedbacks[output].FireUpdate();
-
- break;
- }
- case DMOutputEventIds.AudioOutEventId:
- {
- if (Chassis.Outputs[output].AudioOutFeedback != null)
- Debug.Console(2, this, "DMSwitchAudio:{0} Routed Input:{1} Output:{2}'", this.Name, Chassis.Outputs[output].AudioOutFeedback.Number, output);
-
- if (AudioOutputFeedbacks.ContainsKey(output))
- AudioOutputFeedbacks[output].FireUpdate();
-
- if (OutputAudioRouteNameFeedbacks.ContainsKey(output))
- OutputAudioRouteNameFeedbacks[output].FireUpdate();
-
- break;
- }
- case DMOutputEventIds.OutputNameEventId:
- {
- Debug.Console(2, this, "DM Output {0} NameFeedbackEventId", output);
- OutputNameFeedbacks[output].FireUpdate();
- break;
- }
- case DMOutputEventIds.UsbRoutedToEventId:
- {
- Debug.Console(2, this, "DM Output {0} UsbRoutedToEventId", args.Number);
- UsbOutputRoutedToFeebacks[args.Number].FireUpdate();
- break;
- }
- case DMOutputEventIds.DisabledByHdcpEventId:
- {
- Debug.Console(2, this, "DM Output {0} DisabledByHdcpEventId", args.Number);
- OutputDisabledByHdcpFeedbacks[args.Number].FireUpdate();
- break;
- }
- default:
- {
- Debug.Console(2, this, "DMOutputChange fired for Output {0} with Unhandled EventId: {1}", args.Number, args.EventId);
- break;
- }
- }
- }
-
- ///
- ///
- ///
- ///
- void StartOffTimer(PortNumberType pnt)
- {
- if (RouteOffTimers.ContainsKey(pnt))
- return;
- RouteOffTimers[pnt] = new CTimer(o => { ExecuteSwitch(0, pnt.Number, pnt.Type); }, RouteOffTime);
- }
-
- // Send out sigs when coming online
- void IsOnline_OutputChange(object sender, EventArgs e)
- {
- if (IsOnline.BoolValue)
- {
- (Chassis as DmMDMnxn).EnableAudioBreakaway.BoolValue = true;
- (Chassis as DmMDMnxn).EnableUSBBreakaway.BoolValue = true;
-
- if (InputNames != null)
- foreach (var kvp in InputNames)
- Chassis.Inputs[kvp.Key].Name.StringValue = kvp.Value;
- if (OutputNames != null)
- foreach (var kvp in OutputNames)
- Chassis.Outputs[kvp.Key].Name.StringValue = kvp.Value;
- }
- }
-
- #region IRouting Members
- public void ExecuteSwitch(object inputSelector, object outputSelector, eRoutingSignalType sigType)
- {
- Debug.Console(2, this, "Making an awesome DM route from {0} to {1} {2}", inputSelector, outputSelector, sigType);
-
- var input = Convert.ToUInt32(inputSelector); // Cast can sometimes fail
- var output = Convert.ToUInt32(outputSelector);
-
- // Check to see if there's an off timer waiting on this and if so, cancel
- var key = new PortNumberType(output, sigType);
- if (input == 0)
- {
- StartOffTimer(key);
- }
- else
- {
- if (RouteOffTimers.ContainsKey(key))
- {
- Debug.Console(2, this, "{0} cancelling route off due to new source", output);
- RouteOffTimers[key].Stop();
- RouteOffTimers.Remove(key);
- }
- }
-
- var inCard = input == 0 ? null : Chassis.Inputs[input];
- var outCard = input == 0 ? null : Chassis.Outputs[output];
-
- // NOTE THAT BITWISE COMPARISONS - TO CATCH ALL ROUTING TYPES
- if ((sigType | eRoutingSignalType.Video) == eRoutingSignalType.Video)
- {
- Chassis.VideoEnter.BoolValue = true;
- Chassis.Outputs[output].VideoOut = inCard;
- }
-
- if ((sigType | eRoutingSignalType.Audio) == eRoutingSignalType.Audio)
- {
- (Chassis as DmMDMnxn).AudioEnter.BoolValue = true;
- Chassis.Outputs[output].AudioOut = inCard;
- }
-
- if ((sigType | eRoutingSignalType.UsbOutput) == eRoutingSignalType.UsbOutput)
- {
- Chassis.USBEnter.BoolValue = true;
- if (Chassis.Outputs[output] != null)
- Chassis.Outputs[output].USBRoutedTo = inCard;
- }
-
- if ((sigType | eRoutingSignalType.UsbInput) == eRoutingSignalType.UsbInput)
- {
- Chassis.USBEnter.BoolValue = true;
- if (Chassis.Inputs[input] != null)
- Chassis.Inputs[input].USBRoutedTo = outCard;
- }
- }
- #endregion
- }
-
- public struct PortNumberType
- {
- public uint Number { get; private set; }
- public eRoutingSignalType Type { get; private set; }
-
- public PortNumberType(uint number, eRoutingSignalType type)
- : this()
- {
- Number = number;
- Type = type;
- }
- }
-
-}
\ No newline at end of file
+
+using System;
+using System.Collections.Generic;
+using Crestron.SimplSharp;
+using Crestron.SimplSharpPro.DeviceSupport;
+using Crestron.SimplSharpPro.DM;
+using Crestron.SimplSharpPro.DM.Cards;
+using Crestron.SimplSharpPro.DM.Endpoints;
+using Newtonsoft.Json;
+using PepperDash.Core;
+using PepperDash.Essentials.Core;
+using PepperDash.Essentials.Core.Bridges;
+using PepperDash.Essentials.DM.Config;
+using PepperDash.Essentials.Core.Config;
+
+namespace PepperDash.Essentials.DM
+{
+ ///
+ /// Builds a controller for basic DM-RMCs with Com and IR ports and no control functions
+ ///
+ ///
+ [Description("Wrapper class for all DM-MD chassis variants from 8x8 to 32x32")]
+ public class DmChassisController : CrestronGenericBridgeableBaseDevice, IDmSwitch, IRoutingInputsOutputs, IRouting, IHasFeedback
+ {
+ public DMChassisPropertiesConfig PropertiesConfig { get; set; }
+
+ public Switch Chassis { get; private set; }
+
+ // Feedbacks for EssentialDM
+ public Dictionary VideoOutputFeedbacks { get; private set; }
+ public Dictionary AudioOutputFeedbacks { get; private set; }
+ public Dictionary VideoInputSyncFeedbacks { get; private set; }
+ public Dictionary InputEndpointOnlineFeedbacks { get; private set; }
+ public Dictionary OutputEndpointOnlineFeedbacks { get; private set; }
+ public Dictionary InputNameFeedbacks { get; private set; }
+ public Dictionary OutputNameFeedbacks { get; private set; }
+ public Dictionary OutputVideoRouteNameFeedbacks { get; private set; }
+ public Dictionary OutputAudioRouteNameFeedbacks { get; private set; }
+ public Dictionary UsbOutputRoutedToFeebacks { get; private set; }
+ public Dictionary UsbInputRoutedToFeebacks { get; private set; }
+ public Dictionary OutputDisabledByHdcpFeedbacks { get; private set; }
+
+ public IntFeedback SystemIdFeebdack { get; private set; }
+ public BoolFeedback SystemIdBusyFeedback { get; private set; }
+
+ public Dictionary InputCardHdcpCapabilityFeedbacks { get; private set; }
+
+ public Dictionary InputCardHdcpCapabilityTypes { get; private set; }
+
+ // Need a couple Lists of generic Backplane ports
+ public RoutingPortCollection InputPorts { get; private set; }
+ public RoutingPortCollection OutputPorts { get; private set; }
+
+ public Dictionary TxDictionary { get; set; }
+ public Dictionary RxDictionary { get; set; }
+
+ //public Dictionary InputCards { get; private set; }
+ //public Dictionary OutputCards { get; private set; }
+
+ public Dictionary InputNames { get; set; }
+ public Dictionary OutputNames { get; set; }
+ public Dictionary VolumeControls { get; private set; }
+
+ public const int RouteOffTime = 500;
+ Dictionary RouteOffTimers = new Dictionary();
+
+ ///
+ /// Text that represents when an output has no source routed to it
+ ///
+ public string NoRouteText = "";
+
+ ///
+ /// Factory method to create a new chassis controller from config data. Limited to 8x8 right now
+ ///
+ public static DmChassisController GetDmChassisController(string key, string name,
+ string type, DMChassisPropertiesConfig properties)
+ {
+ try
+ {
+ type = type.ToLower();
+ uint ipid = properties.Control.IpIdInt;
+
+ DmMDMnxn chassis = null;
+ switch (type) {
+ case "dmmd8x8":
+ chassis = new DmMd8x8(ipid, Global.ControlSystem);
+ break;
+ case "dmmd8x8rps":
+ chassis = new DmMd8x8rps(ipid, Global.ControlSystem);
+ break;
+ case "dmmd8x8cpu3":
+ chassis = new DmMd8x8Cpu3(ipid, Global.ControlSystem);
+ break;
+ case "dmmd8x8cpu3rps":
+ chassis = new DmMd8x8Cpu3rps(ipid, Global.ControlSystem);
+ break;
+ case "dmmd16x16":
+ chassis = new DmMd16x16(ipid, Global.ControlSystem);
+ break;
+ case "dmmd16x16rps":
+ chassis = new DmMd16x16rps(ipid, Global.ControlSystem);
+ break;
+ case "dmmd16x16cpu3":
+ chassis = new DmMd16x16Cpu3(ipid, Global.ControlSystem);
+ break;
+ case "dmmd16x16cpu3rps":
+ chassis = new DmMd16x16Cpu3rps(ipid, Global.ControlSystem);
+ break;
+ case "dmmd32x32":
+ chassis = new DmMd32x32(ipid, Global.ControlSystem);
+ break;
+ case "dmmd32x32rps":
+ chassis = new DmMd32x32rps(ipid, Global.ControlSystem);
+ break;
+ case "dmmd32x32cpu3":
+ chassis = new DmMd32x32Cpu3(ipid, Global.ControlSystem);
+ break;
+ case "dmmd32x32cpu3rps":
+ chassis = new DmMd32x32Cpu3rps(ipid, Global.ControlSystem);
+ break;
+ }
+
+ if (chassis == null)
+ return null;
+
+ var controller = new DmChassisController(key, name, chassis);
+
+ // add the cards and port names
+ foreach (var kvp in properties.InputSlots)
+ controller.AddInputCard(kvp.Value, kvp.Key);
+
+ foreach (var kvp in properties.OutputSlots)
+ controller.AddOutputCard(kvp.Value, kvp.Key);
+
+ foreach (var kvp in properties.VolumeControls)
+ {
+ // get the card
+ // check it for an audio-compatible type
+ // make a something-something that will make it work
+ // retire to mountain village
+ var outNum = kvp.Key;
+ var card = controller.Chassis.Outputs[outNum].Card;
+ Audio.Output audio = null;
+ if (card is DmcHdo)
+ audio = (card as DmcHdo).Audio;
+ else if (card is Dmc4kHdo)
+ audio = (card as Dmc4kHdo).Audio;
+ if (audio == null)
+ continue;
+
+ // wire up the audio to something here...
+ controller.AddVolumeControl(outNum, audio);
+ }
+
+ controller.InputNames = properties.InputNames;
+ controller.OutputNames = properties.OutputNames;
+
+ if (!string.IsNullOrEmpty(properties.NoRouteText))
+ {
+ controller.NoRouteText = properties.NoRouteText;
+ Debug.Console(1, controller, "Setting No Route Text value to: {0}", controller.NoRouteText);
+ }
+ else
+ {
+ Debug.Console(1, controller, "NoRouteText not specified. Defaulting to blank string.", controller.NoRouteText);
+ }
+
+ controller.PropertiesConfig = properties;
+ return controller;
+ }
+ catch (Exception e)
+ {
+ Debug.Console(0, "Error creating DM chassis:\r{0}", e);
+ }
+
+ return null;
+ }
+
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public DmChassisController(string key, string name, DmMDMnxn chassis)
+ : base(key, name, chassis)
+ {
+ Chassis = chassis;
+ InputPorts = new RoutingPortCollection();
+ OutputPorts = new RoutingPortCollection();
+ VolumeControls = new Dictionary();
+ TxDictionary = new Dictionary();
+ RxDictionary = new Dictionary();
+ IsOnline.OutputChange += new EventHandler(IsOnline_OutputChange);
+ Chassis.DMInputChange += new DMInputEventHandler(Chassis_DMInputChange);
+ Chassis.DMSystemChange += new DMSystemEventHandler(Chassis_DMSystemChange);
+ Chassis.DMOutputChange += new DMOutputEventHandler(Chassis_DMOutputChange);
+ VideoOutputFeedbacks = new Dictionary();
+ AudioOutputFeedbacks = new Dictionary();
+ UsbOutputRoutedToFeebacks = new Dictionary();
+ UsbInputRoutedToFeebacks = new Dictionary();
+ OutputDisabledByHdcpFeedbacks = new Dictionary();
+ VideoInputSyncFeedbacks = new Dictionary();
+ InputNameFeedbacks = new Dictionary();
+ OutputNameFeedbacks = new Dictionary();
+ OutputVideoRouteNameFeedbacks = new Dictionary();
+ OutputAudioRouteNameFeedbacks = new Dictionary();
+ InputEndpointOnlineFeedbacks = new Dictionary();
+ OutputEndpointOnlineFeedbacks = new Dictionary();
+
+ SystemIdFeebdack = new IntFeedback(() => { return (Chassis as DmMDMnxn).SystemIdFeedback.UShortValue; });
+ SystemIdBusyFeedback = new BoolFeedback(() => { return (Chassis as DmMDMnxn).SystemIdBusy.BoolValue; });
+ InputCardHdcpCapabilityFeedbacks = new Dictionary();
+ InputCardHdcpCapabilityTypes = new Dictionary();
+
+ for (uint x = 1; x <= Chassis.NumberOfOutputs; x++)
+ {
+ var tempX = x;
+
+ if (Chassis.Outputs[tempX] != null)
+ {
+ VideoOutputFeedbacks[tempX] = new IntFeedback(() => {
+ if (Chassis.Outputs[tempX].VideoOutFeedback != null)
+ return (ushort)Chassis.Outputs[tempX].VideoOutFeedback.Number;
+
+ return 0;
+ });
+ AudioOutputFeedbacks[tempX] = new IntFeedback(() => {
+ if (Chassis.Outputs[tempX].AudioOutFeedback != null)
+ return (ushort)Chassis.Outputs[tempX].AudioOutFeedback.Number;
+
+ return 0;
+ });
+ UsbOutputRoutedToFeebacks[tempX] = new IntFeedback(() => {
+ if (Chassis.Outputs[tempX].USBRoutedToFeedback != null)
+ return (ushort)Chassis.Outputs[tempX].USBRoutedToFeedback.Number;
+
+ return 0;
+ });
+
+ OutputNameFeedbacks[tempX] = new StringFeedback(() => {
+ if (Chassis.Outputs[tempX].NameFeedback != null)
+ return Chassis.Outputs[tempX].NameFeedback.StringValue;
+
+ return "";
+ });
+ OutputVideoRouteNameFeedbacks[tempX] = new StringFeedback(() => {
+ if (Chassis.Outputs[tempX].VideoOutFeedback != null)
+ return Chassis.Outputs[tempX].VideoOutFeedback.NameFeedback.StringValue;
+
+ return NoRouteText;
+ });
+ OutputAudioRouteNameFeedbacks[tempX] = new StringFeedback(() => {
+ if (Chassis.Outputs[tempX].AudioOutFeedback != null)
+ return Chassis.Outputs[tempX].AudioOutFeedback.NameFeedback.StringValue;
+
+ return NoRouteText;
+ });
+ OutputEndpointOnlineFeedbacks[tempX] = new BoolFeedback(() => Chassis.Outputs[tempX].EndpointOnlineFeedback);
+
+ OutputDisabledByHdcpFeedbacks[tempX] = new BoolFeedback(() => {
+ var output = Chassis.Outputs[tempX];
+
+ var hdmiTxOutput = output as Card.HdmiTx;
+ if (hdmiTxOutput != null)
+ return hdmiTxOutput.HdmiOutput.DisabledByHdcp.BoolValue;
+
+ var dmHdmiOutput = output as Card.DmHdmiOutput;
+ if (dmHdmiOutput != null)
+ return dmHdmiOutput.DisabledByHdcpFeedback.BoolValue;
+
+ var dmsDmOutAdvanced = output as Card.DmsDmOutAdvanced;
+ if (dmsDmOutAdvanced != null)
+ return dmsDmOutAdvanced.DisabledByHdcpFeedback.BoolValue;
+
+ var dmps3HdmiAudioOutput = output as Card.Dmps3HdmiAudioOutput;
+ if (dmps3HdmiAudioOutput != null)
+ return dmps3HdmiAudioOutput.HdmiOutputPort.DisabledByHdcpFeedback.BoolValue;
+
+ var dmps3HdmiOutput = output as Card.Dmps3HdmiOutput;
+ if (dmps3HdmiOutput != null)
+ return dmps3HdmiOutput.HdmiOutputPort.DisabledByHdcpFeedback.BoolValue;
+
+ var dmps3HdmiOutputBackend = output as Card.Dmps3HdmiOutputBackend;
+ if (dmps3HdmiOutputBackend != null)
+ return dmps3HdmiOutputBackend.HdmiOutputPort.DisabledByHdcpFeedback.BoolValue;
+
+ // var hdRx4kX10HdmiOutput = output as HdRx4kX10HdmiOutput;
+ // if (hdRx4kX10HdmiOutput != null)
+ // return hdRx4kX10HdmiOutput.HdmiOutputPort.DisabledByHdcpFeedback.BoolValue;
+
+ // var hdMdNxMHdmiOutput = output as HdMdNxMHdmiOutput;
+ // if (hdMdNxMHdmiOutput != null)
+ // return hdMdNxMHdmiOutput.HdmiOutputPort.DisabledByHdcpFeedback.BoolValue;
+
+ return false;
+ });
+ }
+
+ if (Chassis.Inputs[tempX] != null)
+ {
+ UsbInputRoutedToFeebacks[tempX] = new IntFeedback(() => {
+ if (Chassis.Inputs[tempX].USBRoutedToFeedback != null)
+ return (ushort)Chassis.Inputs[tempX].USBRoutedToFeedback.Number;
+
+ return 0;
+ });
+ VideoInputSyncFeedbacks[tempX] = new BoolFeedback(() => {
+ if (Chassis.Inputs[tempX].VideoDetectedFeedback != null)
+ return Chassis.Inputs[tempX].VideoDetectedFeedback.BoolValue;
+
+ return false;
+ });
+ InputNameFeedbacks[tempX] = new StringFeedback(() => {
+ if (Chassis.Inputs[tempX].NameFeedback != null)
+ return Chassis.Inputs[tempX].NameFeedback.StringValue;
+
+ return "";
+ });
+
+ InputEndpointOnlineFeedbacks[tempX] = new BoolFeedback(() => { return Chassis.Inputs[tempX].EndpointOnlineFeedback; });
+
+ InputCardHdcpCapabilityFeedbacks[tempX] = new IntFeedback(() => {
+ var inputCard = Chassis.Inputs[tempX];
+
+ if (inputCard.Card is DmcHd)
+ {
+ InputCardHdcpCapabilityTypes[tempX] = eHdcpCapabilityType.HdcpAutoSupport;
+
+ if ((inputCard.Card as DmcHd).HdmiInput.HdcpSupportOnFeedback.BoolValue)
+ return 1;
+ return 0;
+ }
+
+ if (inputCard.Card is DmcHdDsp)
+ {
+ InputCardHdcpCapabilityTypes[tempX] = eHdcpCapabilityType.HdcpAutoSupport;
+
+ if ((inputCard.Card as DmcHdDsp).HdmiInput.HdcpSupportOnFeedback.BoolValue)
+ return 1;
+ return 0;
+ }
+ if (inputCard.Card is Dmc4kHdBase)
+ {
+ InputCardHdcpCapabilityTypes[tempX] = eHdcpCapabilityType.Hdcp2_2Support;
+ return (int)(inputCard.Card as Dmc4kHdBase).HdmiInput.HdcpReceiveCapability;
+ }
+ if (inputCard.Card is Dmc4kCBase)
+ {
+ if (PropertiesConfig.InputSlotSupportsHdcp2[tempX])
+ {
+ InputCardHdcpCapabilityTypes[tempX] = eHdcpCapabilityType.HdcpAutoSupport;
+ return (int)(inputCard.Card as Dmc4kCBase).DmInput.HdcpReceiveCapability;
+ }
+
+ if ((inputCard.Card as Dmc4kCBase).DmInput.HdcpSupportOnFeedback.BoolValue)
+ return 1;
+ return 0;
+ }
+ if (inputCard.Card is Dmc4kCDspBase)
+ {
+ if (PropertiesConfig.InputSlotSupportsHdcp2[tempX])
+ {
+ InputCardHdcpCapabilityTypes[tempX] = eHdcpCapabilityType.HdcpAutoSupport;
+ return (int)(inputCard.Card as Dmc4kCDspBase).DmInput.HdcpReceiveCapability;
+ }
+
+ if ((inputCard.Card as Dmc4kCDspBase).DmInput.HdcpSupportOnFeedback.BoolValue)
+ return 1;
+
+ return 0;
+ }
+ return 0;
+ });
+ }
+ }
+ }
+
+ ///
+ ///
+ ///
+ ///
+ ///
+ public void AddInputCard(string type, uint number)
+ {
+ Debug.Console(2, this, "Adding input card '{0}', slot {1}", type, number);
+
+ type = type.ToLower();
+
+ if (type == "dmchd")
+ {
+ var inputCard = new DmcHd(number, this.Chassis);
+ var cecPort = inputCard.HdmiInput as ICec;
+ AddHdmiInCardPorts(number, cecPort);
+ }
+ else if (type == "dmchddsp")
+ {
+ var inputCard = new DmcHdDsp(number, this.Chassis);
+ var cecPort = inputCard.HdmiInput as ICec;
+ AddHdmiInCardPorts(number, cecPort);
+ }
+ else if (type == "dmc4khd")
+ {
+ var inputCard = new Dmc4kHd(number, this.Chassis);
+ var cecPort = inputCard.HdmiInput as ICec;
+ AddHdmiInCardPorts(number, cecPort);
+ }
+ else if (type == "dmc4khddsp")
+ {
+ var inputCard = new Dmc4kHdDsp(number, this.Chassis);
+ var cecPort = inputCard.HdmiInput as ICec;
+ AddHdmiInCardPorts(number, cecPort);
+ }
+ else if (type == "dmc4kzhd")
+ {
+ var inputCard = new Dmc4kzHd(number, this.Chassis);
+ var cecPort = inputCard.HdmiInput as ICec;
+ AddHdmiInCardPorts(number, cecPort);
+ }
+ else if (type == "dmc4kzhddsp")
+ {
+ var inputCard = new Dmc4kzHdDsp(number, this.Chassis);
+ var cecPort = inputCard.HdmiInput as ICec;
+ AddHdmiInCardPorts(number, cecPort);
+ }
+ else if (type == "dmcc")
+ {
+ var inputCard = new DmcC(number, this.Chassis);
+ var cecPort = inputCard.DmInput as ICec;
+ AddDmInCardPorts(number, cecPort);
+ }
+ else if (type == "dmccdsp")
+ {
+ var inputCard = new DmcCDsp(number, this.Chassis);
+ var cecPort = inputCard.DmInput as ICec;
+ AddDmInCardPorts(number, cecPort);
+ }
+ else if (type == "dmc4kc")
+ {
+ var inputCard = new Dmc4kC(number, this.Chassis);
+ var cecPort = inputCard.DmInput as ICec;
+ AddDmInCardPorts(number, cecPort);
+ }
+ else if (type == "dmc4kcdsp")
+ {
+ var inputCard = new Dmc4kCDsp(number, this.Chassis);
+ var cecPort = inputCard.DmInput as ICec;
+ AddDmInCardPorts(number, cecPort);
+ }
+ else if (type == "dmc4kzc")
+ {
+ var inputCard = new Dmc4kzC(number, this.Chassis);
+ var cecPort = inputCard.DmInput as ICec;
+ AddDmInCardPorts(number, cecPort);
+ }
+ else if (type == "dmc4kzcdsp")
+ {
+ var inputCard = new Dmc4kzCDsp(number, this.Chassis);
+ var cecPort = inputCard.DmInput as ICec;
+ AddDmInCardPorts(number, cecPort);
+ }
+ else if (type == "dmccat")
+ {
+ new DmcCat(number, this.Chassis);
+ AddDmInCardPorts(number);
+ }
+ else if (type == "dmccatdsp")
+ {
+ new DmcCatDsp(number, this.Chassis);
+ AddDmInCardPorts(number);
+ }
+ else if (type == "dmcs")
+ {
+ new DmcS(number, Chassis);
+ AddInputPortWithDebug(number, "dmIn", eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.DmMmFiber);
+ AddInCardHdmiAndAudioLoopPorts(number);
+ }
+ else if (type == "dmcsdsp")
+ {
+ new DmcSDsp(number, Chassis);
+ AddInputPortWithDebug(number, "dmIn", eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.DmMmFiber);
+ AddInCardHdmiAndAudioLoopPorts(number);
+ }
+ else if (type == "dmcs2")
+ {
+ new DmcS2(number, Chassis);
+ AddInputPortWithDebug(number, "dmIn", eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.DmSmFiber);
+ AddInCardHdmiAndAudioLoopPorts(number);
+ }
+ else if (type == "dmcs2dsp")
+ {
+ new DmcS2Dsp(number, Chassis);
+ AddInputPortWithDebug(number, "dmIn", eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.DmSmFiber);
+ AddInCardHdmiAndAudioLoopPorts(number);
+ }
+ else if (type == "dmcsdi")
+ {
+ new DmcSdi(number, Chassis);
+ AddInputPortWithDebug(number, "sdiIn", eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Sdi);
+ AddOutputPortWithDebug(string.Format("inputCard{0}", number), "sdiOut", eRoutingSignalType.Audio | eRoutingSignalType.Video,
+ eRoutingPortConnectionType.Sdi, null);
+ AddInCardHdmiAndAudioLoopPorts(number);
+ }
+ else if (type == "dmcdvi")
+ {
+ new DmcDvi(number, Chassis);
+ AddInputPortWithDebug(number, "dviIn", eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Dvi);
+ AddInputPortWithDebug(number, "audioIn", eRoutingSignalType.Audio, eRoutingPortConnectionType.LineAudio);
+ AddInCardHdmiLoopPort(number);
+ }
+ else if (type == "dmcvga")
+ {
+ new DmcVga(number, Chassis);
+ AddInputPortWithDebug(number, "vgaIn", eRoutingSignalType.Video, eRoutingPortConnectionType.Vga);
+ AddInputPortWithDebug(number, "audioIn", eRoutingSignalType.Audio, eRoutingPortConnectionType.LineAudio);
+ AddInCardHdmiLoopPort(number);
+ }
+ else if (type == "dmcvidbnc")
+ {
+ new DmcVidBnc(number, Chassis);
+ AddInputPortWithDebug(number, "componentIn", eRoutingSignalType.Video, eRoutingPortConnectionType.Component);
+ AddInputPortWithDebug(number, "audioIn", eRoutingSignalType.Audio, eRoutingPortConnectionType.LineAudio);
+ AddInCardHdmiLoopPort(number);
+ }
+ else if (type == "dmcvidrcaa")
+ {
+ new DmcVidRcaA(number, Chassis);
+ AddInputPortWithDebug(number, "componentIn", eRoutingSignalType.Video, eRoutingPortConnectionType.Component);
+ AddInputPortWithDebug(number, "audioIn", eRoutingSignalType.Audio, eRoutingPortConnectionType.LineAudio);
+ AddInCardHdmiLoopPort(number);
+ }
+ else if (type == "dmcvidrcad")
+ {
+ new DmcVidRcaD(number, Chassis);
+ AddInputPortWithDebug(number, "componentIn", eRoutingSignalType.Video, eRoutingPortConnectionType.Component);
+ AddInputPortWithDebug(number, "audioIn", eRoutingSignalType.Audio, eRoutingPortConnectionType.DigitalAudio);
+ AddInCardHdmiLoopPort(number);
+ }
+ else if (type == "dmcvid4")
+ {
+ new DmcVid4(number, Chassis);
+ AddInputPortWithDebug(number, "compositeIn1", eRoutingSignalType.Video, eRoutingPortConnectionType.Composite);
+ AddInputPortWithDebug(number, "compositeIn2", eRoutingSignalType.Video, eRoutingPortConnectionType.Composite);
+ AddInputPortWithDebug(number, "compositeIn3", eRoutingSignalType.Video, eRoutingPortConnectionType.Composite);
+ AddInputPortWithDebug(number, "compositeIn4", eRoutingSignalType.Video, eRoutingPortConnectionType.Composite);
+ AddInCardHdmiLoopPort(number);
+ }
+ else if (type == "dmcstr")
+ {
+ new DmcStr(number, Chassis);
+ AddInputPortWithDebug(number, "streamIn", eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Streaming);
+ AddInCardHdmiAndAudioLoopPorts(number);
+ }
+ }
+
+ void AddDmInCardPorts(uint number)
+ {
+ AddInputPortWithDebug(number, "dmIn", eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.DmCat);
+ AddInCardHdmiAndAudioLoopPorts(number);
+ }
+
+ void AddDmInCardPorts(uint number, ICec cecPort)
+ {
+ AddInputPortWithDebug(number, "dmIn", eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.DmCat, cecPort);
+ AddInCardHdmiAndAudioLoopPorts(number);
+ }
+
+ void AddHdmiInCardPorts(uint number, ICec cecPort)
+ {
+ AddInputPortWithDebug(number, "hdmiIn", eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, cecPort);
+ AddInCardHdmiAndAudioLoopPorts(number);
+ }
+
+ void AddInCardHdmiAndAudioLoopPorts(uint number)
+ {
+ AddOutputPortWithDebug(string.Format("inputCard{0}", number), "hdmiLoopOut", eRoutingSignalType.Audio | eRoutingSignalType.Video,
+ eRoutingPortConnectionType.Hdmi, null);
+ AddOutputPortWithDebug(string.Format("inputCard{0}", number), "audioLoopOut", eRoutingSignalType.Audio, eRoutingPortConnectionType.Hdmi, null);
+ }
+
+ void AddInCardHdmiLoopPort(uint number)
+ {
+ AddOutputPortWithDebug(string.Format("inputCard{0}", number), "hdmiLoopOut", eRoutingSignalType.Audio | eRoutingSignalType.Video,
+ eRoutingPortConnectionType.Hdmi, null);
+ }
+
+ ///
+ ///
+ ///
+ ///
+ ///
+ public void AddOutputCard(string type, uint number)
+ {
+ type = type.ToLower();
+
+ Debug.Console(2, this, "Adding output card '{0}', slot {1}", type, number);
+ if (type == "dmc4khdo")
+ {
+ var outputCard = new Dmc4kHdoSingle(number, Chassis);
+ var cecPort1 = outputCard.Card1.HdmiOutput;
+ var cecPort2 = outputCard.Card2.HdmiOutput;
+ AddDmcHdoPorts(number, cecPort1, cecPort2);
+ }
+ else if (type == "dmchdo")
+ {
+ var outputCard = new DmcHdoSingle(number, Chassis);
+ var cecPort1 = outputCard.Card1.HdmiOutput;
+ var cecPort2 = outputCard.Card2.HdmiOutput;
+ AddDmcHdoPorts(number, cecPort1, cecPort2);
+ }
+ else if (type == "dmc4kcohd")
+ {
+ var outputCard = new Dmc4kCoHdSingle(number, Chassis);
+ var cecPort1 = outputCard.Card1.HdmiOutput;
+ AddDmcCoPorts(number, cecPort1);
+ }
+ else if (type == "dmc4kzcohd")
+ {
+ var outputCard = new Dmc4kzCoHdSingle(number, Chassis);
+ var cecPort1 = outputCard.Card1.HdmiOutput;
+ AddDmcCoPorts(number, cecPort1);
+ }
+ else if (type == "dmccohd")
+ {
+ var outputCard = new DmcCoHdSingle(number, Chassis);
+ var cecPort1 = outputCard.Card1.HdmiOutput;
+ AddDmcCoPorts(number, cecPort1);
+ }
+ else if (type == "dmccatohd")
+ {
+ var outputCard = new DmcCatoHdSingle(number, Chassis);
+ var cecPort1 = outputCard.Card1.HdmiOutput;
+ AddDmcCoPorts(number, cecPort1);
+ }
+ else if (type == "dmcsohd")
+ {
+ var outputCard = new DmcSoHdSingle(number, Chassis);
+ var cecPort1 = outputCard.Card1.HdmiOutput;
+ AddOutputPortWithDebug(string.Format("outputCard{0}", number), "dmOut1", eRoutingSignalType.Audio | eRoutingSignalType.Video,
+ eRoutingPortConnectionType.DmMmFiber, 2 * (number - 1) + 1);
+ AddOutputPortWithDebug(string.Format("outputCard{0}", number), "hdmiOut1", eRoutingSignalType.Audio | eRoutingSignalType.Video,
+ eRoutingPortConnectionType.Hdmi, 2 * (number - 1) + 1, cecPort1);
+ AddOutputPortWithDebug(string.Format("outputCard{0}", number), "dmOut2", eRoutingSignalType.Audio | eRoutingSignalType.Video,
+ eRoutingPortConnectionType.DmMmFiber, 2 * (number - 1) + 2);
+ }
+ else if (type == "dmcs2ohd")
+ {
+ var outputCard = new DmcS2oHdSingle(number, Chassis);
+ var cecPort1 = outputCard.Card1.HdmiOutput;
+ AddOutputPortWithDebug(string.Format("outputCard{0}", number), "dmOut1", eRoutingSignalType.Audio | eRoutingSignalType.Video,
+ eRoutingPortConnectionType.DmSmFiber, 2 * (number - 1) + 1);
+ AddOutputPortWithDebug(string.Format("outputCard{0}", number), "hdmiOut1", eRoutingSignalType.Audio | eRoutingSignalType.Video,
+ eRoutingPortConnectionType.Hdmi, 2 * (number - 1) + 1, cecPort1);
+ AddOutputPortWithDebug(string.Format("outputCard{0}", number), "dmOut2", eRoutingSignalType.Audio | eRoutingSignalType.Video,
+ eRoutingPortConnectionType.DmSmFiber, 2 * (number - 1) + 2);
+ }
+ else if (type == "dmcstro")
+ {
+ var outputCard = new DmcStroSingle(number, Chassis);
+ AddOutputPortWithDebug(string.Format("outputCard{0}", number), "streamOut", eRoutingSignalType.Audio | eRoutingSignalType.Video,
+ eRoutingPortConnectionType.Streaming, 2 * (number - 1) + 1);
+ }
+
+ else
+ Debug.Console(1, this, " WARNING: Output card type '{0}' is not available", type);
+ }
+
+ void AddDmcHdoPorts(uint number, ICec cecPort1, ICec cecPort2)
+ {
+ AddOutputPortWithDebug(string.Format("outputCard{0}", number), "hdmiOut1", eRoutingSignalType.Audio | eRoutingSignalType.Video,
+ eRoutingPortConnectionType.Hdmi, 2 * (number - 1) + 1, cecPort1);
+ AddOutputPortWithDebug(string.Format("outputCard{0}", number), "audioOut1", eRoutingSignalType.Audio, eRoutingPortConnectionType.LineAudio,
+ 2 * (number - 1) + 1);
+ AddOutputPortWithDebug(string.Format("outputCard{0}", number), "hdmiOut2", eRoutingSignalType.Audio | eRoutingSignalType.Video,
+ eRoutingPortConnectionType.Hdmi, 2 * (number - 1) + 2, cecPort2);
+ AddOutputPortWithDebug(string.Format("outputCard{0}", number), "audioOut2", eRoutingSignalType.Audio, eRoutingPortConnectionType.LineAudio,
+ 2 * (number - 1) + 2);
+ }
+
+ void AddDmcCoPorts(uint number, ICec cecPort1)
+ {
+ AddOutputPortWithDebug(string.Format("outputCard{0}", number), "dmOut1", eRoutingSignalType.Audio | eRoutingSignalType.Video,
+ eRoutingPortConnectionType.DmCat, 2 * (number - 1) + 1);
+ AddOutputPortWithDebug(string.Format("outputCard{0}", number), "hdmiOut1", eRoutingSignalType.Audio | eRoutingSignalType.Video,
+ eRoutingPortConnectionType.Hdmi, 2 * (number - 1) + 1, cecPort1);
+ AddOutputPortWithDebug(string.Format("outputCard{0}", number), "dmOut2", eRoutingSignalType.Audio | eRoutingSignalType.Video,
+ eRoutingPortConnectionType.DmCat, 2 * (number - 1) + 2);
+ }
+
+ ///
+ /// Adds InputPort
+ ///
+ void AddInputPortWithDebug(uint cardNum, string portName, eRoutingSignalType sigType, eRoutingPortConnectionType portType)
+ {
+ var portKey = string.Format("inputCard{0}--{1}", cardNum, portName);
+ Debug.Console(2, this, "Adding input port '{0}'", portKey);
+ var inputPort = new RoutingInputPort(portKey, sigType, portType, cardNum, this);
+
+ InputPorts.Add(inputPort);
+ }
+
+ ///
+ /// Adds InputPort and sets Port as ICec object
+ ///
+ void AddInputPortWithDebug(uint cardNum, string portName, eRoutingSignalType sigType, eRoutingPortConnectionType portType, ICec cecPort)
+ {
+ var portKey = string.Format("inputCard{0}--{1}", cardNum, portName);
+ Debug.Console(2, this, "Adding input port '{0}'", portKey);
+ var inputPort = new RoutingInputPort(portKey, sigType, portType, cardNum, this);
+
+ if (cecPort != null)
+ inputPort.Port = cecPort;
+
+ InputPorts.Add(inputPort);
+ }
+
+ ///
+ /// Adds OutputPort
+ ///
+ void AddOutputPortWithDebug(string cardName, string portName, eRoutingSignalType sigType, eRoutingPortConnectionType portType, object selector)
+ {
+ var portKey = string.Format("{0}--{1}", cardName, portName);
+ Debug.Console(2, this, "Adding output port '{0}'", portKey);
+ OutputPorts.Add(new RoutingOutputPort(portKey, sigType, portType, selector, this));
+ }
+
+ ///
+ /// Adds OutputPort and sets Port as ICec object
+ ///
+ void AddOutputPortWithDebug(string cardName, string portName, eRoutingSignalType sigType, eRoutingPortConnectionType portType, object selector, ICec cecPort)
+ {
+ var portKey = string.Format("{0}--{1}", cardName, portName);
+ Debug.Console(2, this, "Adding output port '{0}'", portKey);
+ var outputPort = new RoutingOutputPort(portKey, sigType, portType, selector, this);
+
+ if (cecPort != null)
+ outputPort.Port = cecPort;
+
+ OutputPorts.Add(outputPort);
+ }
+
+ ///
+ ///
+ ///
+ void AddVolumeControl(uint number, Audio.Output audio)
+ {
+ VolumeControls.Add(number, new DmCardAudioOutputController(audio));
+ }
+
+ //public void SetInputHdcpSupport(uint input, ePdtHdcpSupport hdcpSetting)
+ //{
+
+ //}
+
+ void Chassis_DMSystemChange(Switch device, DMSystemEventArgs args)
+ {
+ switch (args.EventId)
+ {
+ case DMSystemEventIds.SystemIdEventId:
+ {
+ Debug.Console(2, this, "SystemIdEvent Value: {0}", (Chassis as DmMDMnxn).SystemIdFeedback.UShortValue);
+ SystemIdFeebdack.FireUpdate();
+ break;
+ }
+ case DMSystemEventIds.SystemIdBusyEventId:
+ {
+ Debug.Console(2, this, "SystemIdBusyEvent State: {0}", (Chassis as DmMDMnxn).SystemIdBusy.BoolValue);
+ SystemIdBusyFeedback.FireUpdate();
+ break;
+ }
+ }
+ }
+
+ void Chassis_DMInputChange(Switch device, DMInputEventArgs args)
+ {
+ switch (args.EventId)
+ {
+ case DMInputEventIds.EndpointOnlineEventId:
+ {
+ Debug.Console(2, this, "DM Input EndpointOnlineEventId for input: {0}. State: {1}", args.Number, device.Inputs[args.Number].EndpointOnlineFeedback);
+ InputEndpointOnlineFeedbacks[args.Number].FireUpdate();
+ break;
+ }
+ case DMInputEventIds.OnlineFeedbackEventId:
+ {
+ Debug.Console(2, this, "DM Input OnlineFeedbackEventId for input: {0}. State: {1}", args.Number, device.Inputs[args.Number].EndpointOnlineFeedback);
+ InputEndpointOnlineFeedbacks[args.Number].FireUpdate();
+ break;
+ }
+ case DMInputEventIds.VideoDetectedEventId:
+ {
+ Debug.Console(2, this, "DM Input {0} VideoDetectedEventId", args.Number);
+ VideoInputSyncFeedbacks[args.Number].FireUpdate();
+ break;
+ }
+ case DMInputEventIds.InputNameEventId:
+ {
+ Debug.Console(2, this, "DM Input {0} NameFeedbackEventId", args.Number);
+ InputNameFeedbacks[args.Number].FireUpdate();
+ break;
+ }
+ case DMInputEventIds.UsbRoutedToEventId:
+ {
+ Debug.Console(2, this, "DM Input {0} UsbRoutedToEventId", args.Number);
+ if (UsbInputRoutedToFeebacks[args.Number] != null)
+ UsbInputRoutedToFeebacks[args.Number].FireUpdate();
+ else
+ Debug.Console(1, this, "No index of {0} found in UsbInputRoutedToFeedbacks");
+ break;
+ }
+ case DMInputEventIds.HdcpCapabilityFeedbackEventId:
+ {
+ Debug.Console(2, this, "DM Input {0} HdcpCapabilityFeedbackEventId", args.Number);
+ if (InputCardHdcpCapabilityFeedbacks[args.Number] != null)
+ InputCardHdcpCapabilityFeedbacks[args.Number].FireUpdate();
+ else
+ Debug.Console(1, this, "No index of {0} found in InputCardHdcpCapabilityFeedbacks");
+ break;
+ }
+ default:
+ {
+ Debug.Console(2, this, "DMInputChange fired for Input {0} with Unhandled EventId: {1}", args.Number, args.EventId);
+ break;
+ }
+ }
+ }
+
+ ///
+ ///
+ void Chassis_DMOutputChange(Switch device, DMOutputEventArgs args)
+ {
+ var output = args.Number;
+
+ switch (args.EventId)
+ {
+ case DMOutputEventIds.VolumeEventId:
+ {
+ if (VolumeControls.ContainsKey(output))
+ {
+ VolumeControls[args.Number].VolumeEventFromChassis();
+ }
+
+ break;
+ }
+ case DMOutputEventIds.EndpointOnlineEventId:
+ {
+ Debug.Console(2, this, "Output {0} DMOutputEventIds.EndpointOnlineEventId fired. State: {1}", args.Number,
+ Chassis.Outputs[output].EndpointOnlineFeedback);
+ OutputEndpointOnlineFeedbacks[output].FireUpdate();
+ break;
+ }
+ case DMOutputEventIds.OnlineFeedbackEventId:
+ {
+ Debug.Console(2, this, "Output {0} DMInputEventIds.OnlineFeedbackEventId fired. State: {1}", args.Number,
+ Chassis.Outputs[output].EndpointOnlineFeedback);
+ OutputEndpointOnlineFeedbacks[output].FireUpdate();
+ break;
+ }
+ case DMOutputEventIds.VideoOutEventId:
+ {
+ if (Chassis.Outputs[output].VideoOutFeedback != null)
+ Debug.Console(2, this, "DMSwitchVideo:{0} Routed Input:{1} Output:{2}'", this.Name, Chassis.Outputs[output].VideoOutFeedback.Number, output);
+
+ if (VideoOutputFeedbacks.ContainsKey(output))
+ VideoOutputFeedbacks[output].FireUpdate();
+
+ if (OutputVideoRouteNameFeedbacks.ContainsKey(output))
+ OutputVideoRouteNameFeedbacks[output].FireUpdate();
+
+ break;
+ }
+ case DMOutputEventIds.AudioOutEventId:
+ {
+ if (Chassis.Outputs[output].AudioOutFeedback != null)
+ Debug.Console(2, this, "DMSwitchAudio:{0} Routed Input:{1} Output:{2}'", this.Name, Chassis.Outputs[output].AudioOutFeedback.Number, output);
+
+ if (AudioOutputFeedbacks.ContainsKey(output))
+ AudioOutputFeedbacks[output].FireUpdate();
+
+ if (OutputAudioRouteNameFeedbacks.ContainsKey(output))
+ OutputAudioRouteNameFeedbacks[output].FireUpdate();
+
+ break;
+ }
+ case DMOutputEventIds.OutputNameEventId:
+ {
+ Debug.Console(2, this, "DM Output {0} NameFeedbackEventId", output);
+ OutputNameFeedbacks[output].FireUpdate();
+ break;
+ }
+ case DMOutputEventIds.UsbRoutedToEventId:
+ {
+ Debug.Console(2, this, "DM Output {0} UsbRoutedToEventId", args.Number);
+ UsbOutputRoutedToFeebacks[args.Number].FireUpdate();
+ break;
+ }
+ case DMOutputEventIds.DisabledByHdcpEventId:
+ {
+ Debug.Console(2, this, "DM Output {0} DisabledByHdcpEventId", args.Number);
+ OutputDisabledByHdcpFeedbacks[args.Number].FireUpdate();
+ break;
+ }
+ default:
+ {
+ Debug.Console(2, this, "DMOutputChange fired for Output {0} with Unhandled EventId: {1}", args.Number, args.EventId);
+ break;
+ }
+ }
+ }
+
+ ///
+ ///
+ ///
+ ///
+ void StartOffTimer(PortNumberType pnt)
+ {
+ if (RouteOffTimers.ContainsKey(pnt))
+ return;
+ RouteOffTimers[pnt] = new CTimer(o => { ExecuteSwitch(0, pnt.Number, pnt.Type); }, RouteOffTime);
+ }
+
+ // Send out sigs when coming online
+ void IsOnline_OutputChange(object sender, EventArgs e)
+ {
+ if (IsOnline.BoolValue)
+ {
+ (Chassis as DmMDMnxn).EnableAudioBreakaway.BoolValue = true;
+ (Chassis as DmMDMnxn).EnableUSBBreakaway.BoolValue = true;
+
+ if (InputNames != null)
+ foreach (var kvp in InputNames)
+ Chassis.Inputs[kvp.Key].Name.StringValue = kvp.Value;
+ if (OutputNames != null)
+ foreach (var kvp in OutputNames)
+ Chassis.Outputs[kvp.Key].Name.StringValue = kvp.Value;
+ }
+ }
+
+ #region IRouting Members
+ public void ExecuteSwitch(object inputSelector, object outputSelector, eRoutingSignalType sigType)
+ {
+ Debug.Console(2, this, "Making an awesome DM route from {0} to {1} {2}", inputSelector, outputSelector, sigType);
+
+ var input = Convert.ToUInt32(inputSelector); // Cast can sometimes fail
+ var output = Convert.ToUInt32(outputSelector);
+
+ // Check to see if there's an off timer waiting on this and if so, cancel
+ var key = new PortNumberType(output, sigType);
+ if (input == 0)
+ {
+ StartOffTimer(key);
+ }
+ else
+ {
+ if (RouteOffTimers.ContainsKey(key))
+ {
+ Debug.Console(2, this, "{0} cancelling route off due to new source", output);
+ RouteOffTimers[key].Stop();
+ RouteOffTimers.Remove(key);
+ }
+ }
+
+ var inCard = input == 0 ? null : Chassis.Inputs[input];
+ var outCard = input == 0 ? null : Chassis.Outputs[output];
+
+ // NOTE THAT BITWISE COMPARISONS - TO CATCH ALL ROUTING TYPES
+ if ((sigType | eRoutingSignalType.Video) == eRoutingSignalType.Video)
+ {
+ Chassis.VideoEnter.BoolValue = true;
+ Chassis.Outputs[output].VideoOut = inCard;
+ }
+
+ if ((sigType | eRoutingSignalType.Audio) == eRoutingSignalType.Audio)
+ {
+ (Chassis as DmMDMnxn).AudioEnter.BoolValue = true;
+ Chassis.Outputs[output].AudioOut = inCard;
+ }
+
+ if ((sigType | eRoutingSignalType.UsbOutput) == eRoutingSignalType.UsbOutput)
+ {
+ Chassis.USBEnter.BoolValue = true;
+ if (Chassis.Outputs[output] != null)
+ Chassis.Outputs[output].USBRoutedTo = inCard;
+ }
+
+ if ((sigType | eRoutingSignalType.UsbInput) == eRoutingSignalType.UsbInput)
+ {
+ Chassis.USBEnter.BoolValue = true;
+ if (Chassis.Inputs[input] != null)
+ Chassis.Inputs[input].USBRoutedTo = outCard;
+ }
+ }
+ #endregion
+
+ public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
+ {
+ var joinMap = new DmChassisControllerJoinMap(joinStart);
+
+ var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
+
+ if (!string.IsNullOrEmpty(joinMapSerialized))
+ joinMap = JsonConvert.DeserializeObject(joinMapSerialized);
+
+ bridge.AddJoinMap(Key, joinMap);
+
+ Debug.Console(1, this, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
+
+ var chassis = Chassis as DmMDMnxn;
+
+ IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline.JoinNumber]);
+
+ trilist.SetUShortSigAction(joinMap.SystemId.JoinNumber, o =>
+ {
+ if (chassis != null)
+ chassis.SystemId.UShortValue = o;
+ });
+
+ trilist.SetSigTrueAction(joinMap.SystemId.JoinNumber, () =>
+ {
+ if (chassis != null) chassis.ApplySystemId();
+ });
+
+ SystemIdFeebdack.LinkInputSig(trilist.UShortInput[joinMap.SystemId.JoinNumber]);
+ SystemIdBusyFeedback.LinkInputSig(trilist.BooleanInput[joinMap.SystemId.JoinNumber]);
+
+ // Link up outputs
+ for (uint i = 1; i <= Chassis.NumberOfOutputs; i++)
+ {
+ var ioSlot = i;
+ var ioSlotJoin = ioSlot - 1;
+
+ // Control
+ trilist.SetUShortSigAction(joinMap.OutputVideo.JoinNumber + ioSlotJoin, o => ExecuteSwitch(o, ioSlot, eRoutingSignalType.Video));
+ trilist.SetUShortSigAction(joinMap.OutputAudio.JoinNumber + ioSlotJoin, o => ExecuteSwitch(o, ioSlot, eRoutingSignalType.Audio));
+ trilist.SetUShortSigAction(joinMap.OutputUsb.JoinNumber + ioSlotJoin, o => ExecuteSwitch(o, ioSlot, eRoutingSignalType.UsbOutput));
+ trilist.SetUShortSigAction(joinMap.InputUsb.JoinNumber + ioSlotJoin, o => ExecuteSwitch(o, ioSlot, eRoutingSignalType.UsbInput));
+
+ if (TxDictionary.ContainsKey(ioSlot))
+ {
+ Debug.Console(2, "Creating Tx Feedbacks {0}", ioSlot);
+ var txKey = TxDictionary[ioSlot];
+ var basicTxDevice = DeviceManager.GetDeviceForKey(txKey) as DmTxControllerBase;
+
+ var advancedTxDevice = basicTxDevice;
+
+ if (Chassis is DmMd8x8Cpu3 || Chassis is DmMd8x8Cpu3rps
+ || Chassis is DmMd16x16Cpu3 || Chassis is DmMd16x16Cpu3rps
+ || Chassis is DmMd32x32Cpu3 || Chassis is DmMd32x32Cpu3rps)
+ {
+ InputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.InputEndpointOnline.JoinNumber + ioSlotJoin]);
+ }
+ else
+ {
+ if (advancedTxDevice != null)
+ {
+ advancedTxDevice.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.InputEndpointOnline.JoinNumber + ioSlotJoin]);
+ Debug.Console(2, "Linking Tx Online Feedback from Advanced Transmitter at input {0}", ioSlot);
+ }
+ else if (InputEndpointOnlineFeedbacks[ioSlot] != null)
+ {
+ Debug.Console(2, "Linking Tx Online Feedback from Input Card {0}", ioSlot);
+ InputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.InputEndpointOnline.JoinNumber + ioSlotJoin]);
+ }
+ }
+
+ if (basicTxDevice != null && advancedTxDevice == null)
+ trilist.BooleanInput[joinMap.TxAdvancedIsPresent.JoinNumber + ioSlotJoin].BoolValue = true;
+
+ if (advancedTxDevice != null)
+ {
+ advancedTxDevice.AnyVideoInput.VideoStatus.VideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.VideoSyncStatus.JoinNumber + ioSlotJoin]);
+ }
+ else if (advancedTxDevice == null || basicTxDevice != null)
+ {
+ Debug.Console(1, "Setting up actions and feedbacks on input card {0}", ioSlot);
+ VideoInputSyncFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.VideoSyncStatus.JoinNumber + ioSlotJoin]);
+
+ var inputPort = InputPorts[string.Format("inputCard{0}--hdmiIn", ioSlot)];
+ if (inputPort != null)
+ {
+ Debug.Console(1, "Port value for input card {0} is set", ioSlot);
+ var port = inputPort.Port;
+
+ if (port != null)
+ {
+ if (port is HdmiInputWithCEC)
+ {
+ Debug.Console(1, "Port is HdmiInputWithCec");
+
+ var hdmiInPortWCec = port as HdmiInputWithCEC;
+
+ if (hdmiInPortWCec.HdcpSupportedLevel != eHdcpSupportedLevel.Unknown)
+ {
+ SetHdcpStateAction(true, hdmiInPortWCec, joinMap.HdcpSupportState.JoinNumber + ioSlotJoin, trilist);
+ }
+
+ InputCardHdcpCapabilityFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.HdcpSupportState.JoinNumber + ioSlotJoin]);
+
+ if (InputCardHdcpCapabilityTypes.ContainsKey(ioSlot))
+ trilist.UShortInput[joinMap.HdcpSupportCapability.JoinNumber + ioSlotJoin].UShortValue = (ushort)InputCardHdcpCapabilityTypes[ioSlot];
+ else
+ trilist.UShortInput[joinMap.HdcpSupportCapability.JoinNumber + ioSlotJoin].UShortValue = 1;
+ }
+ }
+ }
+ else
+ {
+ inputPort = InputPorts[string.Format("inputCard{0}--dmIn", ioSlot)];
+
+ if (inputPort != null)
+ {
+ var port = inputPort.Port;
+
+ if (port is DMInputPortWithCec)
+ {
+ Debug.Console(1, "Port is DMInputPortWithCec");
+
+ var dmInPortWCec = port as DMInputPortWithCec;
+
+ if (dmInPortWCec != null)
+ {
+ SetHdcpStateAction(PropertiesConfig.InputSlotSupportsHdcp2[ioSlot], dmInPortWCec, joinMap.HdcpSupportState.JoinNumber + ioSlotJoin, trilist);
+ }
+
+ InputCardHdcpCapabilityFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.HdcpSupportState.JoinNumber + ioSlotJoin]);
+
+ if (InputCardHdcpCapabilityTypes.ContainsKey(ioSlot))
+ trilist.UShortInput[joinMap.HdcpSupportCapability.JoinNumber + ioSlotJoin].UShortValue = (ushort)InputCardHdcpCapabilityTypes[ioSlot];
+ else
+ trilist.UShortInput[joinMap.HdcpSupportCapability.JoinNumber + ioSlotJoin].UShortValue = 1;
+ }
+ }
+ }
+ }
+ }
+ else
+ {
+ VideoInputSyncFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.VideoSyncStatus.JoinNumber + ioSlotJoin]);
+
+ var inputPort = InputPorts[string.Format("inputCard{0}--hdmiIn", ioSlot)];
+ if (inputPort != null)
+ {
+ var hdmiPort = inputPort.Port as EndpointHdmiInput;
+
+ if (hdmiPort != null)
+ {
+ SetHdcpStateAction(true, hdmiPort, joinMap.HdcpSupportState.JoinNumber + ioSlotJoin, trilist);
+ InputCardHdcpCapabilityFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.HdcpSupportState.JoinNumber + ioSlotJoin]);
+ }
+ }
+ }
+
+ if (RxDictionary.ContainsKey(ioSlot))
+ {
+ Debug.Console(2, "Creating Rx Feedbacks {0}", ioSlot);
+ var rxKey = RxDictionary[ioSlot];
+ var rxDevice = DeviceManager.GetDeviceForKey(rxKey) as DmRmcControllerBase;
+ var hdBaseTDevice = DeviceManager.GetDeviceForKey(rxKey) as DmHdBaseTControllerBase;
+ if (Chassis is DmMd8x8Cpu3 || Chassis is DmMd8x8Cpu3rps
+ || Chassis is DmMd16x16Cpu3 || Chassis is DmMd16x16Cpu3rps
+ || Chassis is DmMd32x32Cpu3 || Chassis is DmMd32x32Cpu3rps || hdBaseTDevice != null)
+ {
+ OutputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.OutputEndpointOnline.JoinNumber + ioSlotJoin]);
+ }
+ else if (rxDevice != null)
+ {
+ rxDevice.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.OutputEndpointOnline.JoinNumber + ioSlotJoin]);
+ }
+ }
+
+ // Feedback
+ VideoOutputFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.OutputVideo.JoinNumber + ioSlotJoin]);
+ AudioOutputFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.OutputAudio.JoinNumber + ioSlotJoin]);
+ UsbOutputRoutedToFeebacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.OutputUsb.JoinNumber + ioSlotJoin]);
+ UsbInputRoutedToFeebacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.InputUsb.JoinNumber + ioSlotJoin]);
+
+ OutputNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputNames.JoinNumber + ioSlotJoin]);
+ InputNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.InputNames.JoinNumber + ioSlotJoin]);
+ OutputVideoRouteNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputCurrentVideoInputNames.JoinNumber + ioSlotJoin]);
+ OutputAudioRouteNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputCurrentAudioInputNames.JoinNumber + ioSlotJoin]);
+
+ OutputDisabledByHdcpFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.OutputDisabledByHdcp.JoinNumber + ioSlotJoin]);
+ }
+ }
+
+ private void SetHdcpStateAction(bool hdcpTypeSimple, HdmiInputWithCEC port, uint join, BasicTriList trilist)
+ {
+ if (hdcpTypeSimple)
+ {
+ trilist.SetUShortSigAction(join,
+ s =>
+ {
+ if (s == 0)
+ {
+ port.HdcpSupportOff();
+ }
+ else if (s > 0)
+ {
+ port.HdcpSupportOn();
+ }
+ });
+ }
+ else
+ {
+ trilist.SetUShortSigAction(join,
+ u =>
+ {
+ port.HdcpReceiveCapability = (eHdcpCapabilityType)u;
+ });
+ }
+ }
+
+ private void SetHdcpStateAction(bool hdcpTypeSimple, EndpointHdmiInput port, uint join, BasicTriList trilist)
+ {
+ if (hdcpTypeSimple)
+ {
+ trilist.SetUShortSigAction(join,
+ s =>
+ {
+ if (s == 0)
+ {
+ port.HdcpSupportOff();
+ }
+ else if (s > 0)
+ {
+ port.HdcpSupportOn();
+ }
+ });
+ }
+ else
+ {
+ trilist.SetUShortSigAction(join,
+ u =>
+ {
+ port.HdcpCapability = (eHdcpCapabilityType)u;
+ });
+ }
+ }
+
+ private void SetHdcpStateAction(bool supportsHdcp2, DMInputPortWithCec port, uint join, BasicTriList trilist)
+ {
+ if (!supportsHdcp2)
+ {
+ trilist.SetUShortSigAction(join,
+ s =>
+ {
+ if (s == 0)
+ {
+ port.HdcpSupportOff();
+ }
+ else if (s > 0)
+ {
+ port.HdcpSupportOn();
+ }
+ });
+ }
+ else
+ {
+ trilist.SetUShortSigAction(join,
+ u =>
+ {
+ port.HdcpReceiveCapability = (eHdcpCapabilityType)u;
+ });
+ }
+ }
+ }
+
+ public struct PortNumberType
+ {
+ public uint Number { get; private set; }
+ public eRoutingSignalType Type { get; private set; }
+
+ public PortNumberType(uint number, eRoutingSignalType type)
+ : this()
+ {
+ Number = number;
+ Type = type;
+ }
+ }
+
+ public class DmChassisControllerFactory : EssentialsDeviceFactory
+ {
+ public DmChassisControllerFactory()
+ {
+ TypeNames = new List() { "dmmd8x8", "dmmd8x8rps", "dmmd8x8cpu3", "dmmd8x8cpu3rps",
+ "dmmd16x16", "dmmd16x16rps", "dmmd16x16cpu3", "dmmd16x16cpu3rps",
+ "dmmd32x32", "dmmd32x32rps", "dmmd32x32cpu3", "dmmd32x32cpu3rps",
+ "dmmd64x64", "dmmd128x128" };
+ }
+
+ public override EssentialsDevice BuildDevice(DeviceConfig dc)
+ {
+ var type = dc.Type.ToLower();
+
+ Debug.Console(1, "Factory Attempting to create new DmChassisController Device");
+
+ if (type.StartsWith("dmmd8x") || type.StartsWith("dmmd16x") || type.StartsWith("dmmd32x"))
+ {
+
+ var props = JsonConvert.DeserializeObject
+ (dc.Properties.ToString());
+ return PepperDash.Essentials.DM.DmChassisController.
+ GetDmChassisController(dc.Key, dc.Name, type, props);
+ }
+ else if (type.StartsWith("dmmd128x") || type.StartsWith("dmmd64x"))
+ {
+ var props = JsonConvert.DeserializeObject
+ (dc.Properties.ToString());
+ return PepperDash.Essentials.DM.DmBladeChassisController.
+ GetDmChassisController(dc.Key, dc.Name, type, props);
+ }
+
+ return null;
+ }
+ }
+
+}
+
diff --git a/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmpsAudioOutputController.cs b/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmpsAudioOutputController.cs
index 8856be01..cc7fd7e4 100644
--- a/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmpsAudioOutputController.cs
+++ b/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmpsAudioOutputController.cs
@@ -4,21 +4,22 @@ using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro;
-
+using Crestron.SimplSharpPro.DeviceSupport;
using Crestron.SimplSharpPro.DM;
using Crestron.SimplSharpPro.DM.Cards;
-
+using Newtonsoft.Json;
using PepperDash.Core;
using PepperDash.Essentials.Core;
-
+using PepperDash.Essentials.Core.Bridges;
using PepperDash.Essentials.DM.Config;
+
namespace PepperDash.Essentials.DM
{
///
/// Exposes the volume levels for Program, Aux1 or Aux2 outputs on a DMPS3 chassis
///
- public class DmpsAudioOutputController : Device
+ public class DmpsAudioOutputController : EssentialsBridgeableDevice
{
Card.Dmps3OutputBase OutputCard;
@@ -100,6 +101,62 @@ namespace PepperDash.Essentials.DM
}
}
}
+
+ public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
+ {
+ var joinMap = new DmpsAudioOutputControllerJoinMap(joinStart);
+
+ var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
+
+ if (!string.IsNullOrEmpty(joinMapSerialized))
+ joinMap = JsonConvert.DeserializeObject(joinMapSerialized);
+
+ bridge.AddJoinMap(Key, joinMap);
+
+ Debug.Console(1, this, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
+
+ if (MasterVolumeLevel != null)
+ {
+ SetUpDmpsAudioOutputJoins(trilist, MasterVolumeLevel, joinMap.MasterVolumeLevel.JoinNumber);
+ }
+
+ if (SourceVolumeLevel != null)
+ {
+ SetUpDmpsAudioOutputJoins(trilist, SourceVolumeLevel, joinMap.SourceVolumeLevel.JoinNumber);
+ }
+
+ if (Codec1VolumeLevel != null)
+ {
+ SetUpDmpsAudioOutputJoins(trilist, Codec1VolumeLevel, joinMap.Codec1VolumeLevel.JoinNumber);
+ }
+
+ if (Codec2VolumeLevel != null)
+ {
+ SetUpDmpsAudioOutputJoins(trilist, Codec2VolumeLevel, joinMap.Codec2VolumeLevel.JoinNumber);
+ }
+
+ }
+
+ static void SetUpDmpsAudioOutputJoins(BasicTriList trilist, DmpsAudioOutput output, uint joinStart)
+ {
+ var volumeLevelJoin = joinStart;
+ var muteOnJoin = joinStart;
+ var muteOffJoin = joinStart + 1;
+ var volumeUpJoin = joinStart + 2;
+ var volumeDownJoin = joinStart + 3;
+
+
+ trilist.SetUShortSigAction(volumeLevelJoin, output.SetVolume);
+ output.VolumeLevelFeedback.LinkInputSig(trilist.UShortInput[volumeLevelJoin]);
+
+ trilist.SetSigTrueAction(muteOnJoin, output.MuteOn);
+ output.MuteFeedback.LinkInputSig(trilist.BooleanInput[muteOnJoin]);
+ trilist.SetSigTrueAction(muteOffJoin, output.MuteOff);
+ output.MuteFeedback.LinkComplementInputSig(trilist.BooleanInput[muteOffJoin]);
+
+ trilist.SetBoolSigAction(volumeUpJoin, output.VolumeUp);
+ trilist.SetBoolSigAction(volumeDownJoin, output.VolumeDown);
+ }
}
public class DmpsAudioOutput : IBasicVolumeWithFeedback
diff --git a/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmpsRoutingController.cs b/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmpsRoutingController.cs
index 6ed0e63b..7d8ba747 100644
--- a/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmpsRoutingController.cs
+++ b/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmpsRoutingController.cs
@@ -4,19 +4,22 @@ using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro;
+using Crestron.SimplSharpPro.DeviceSupport;
using Crestron.SimplSharpPro.DM;
using Crestron.SimplSharpPro.DM.Cards;
using Crestron.SimplSharpPro.DM.Endpoints;
using Crestron.SimplSharpPro.DM.Endpoints.Receivers;
-
+using Newtonsoft.Json;
using PepperDash.Core;
using PepperDash.Essentials.Core;
-
+using PepperDash.Essentials.Core.Bridges;
using PepperDash.Essentials.DM.Config;
+using Feedback = PepperDash.Essentials.Core.Feedback;
+
namespace PepperDash.Essentials.DM
{
- public class DmpsRoutingController : Device, IRoutingInputsOutputs, IRouting, IHasFeedback
+ public class DmpsRoutingController : EssentialsBridgeableDevice, IRouting, IHasFeedback
{
public CrestronControlSystem Dmps { get; set; }
public ISystemControl SystemControl { get; private set; }
@@ -151,6 +154,117 @@ namespace PepperDash.Essentials.DM
return base.CustomActivate();
}
+ public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
+ {
+ var joinMap = new DmpsRoutingControllerJoinMap(joinStart);
+
+ var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
+
+ if (!string.IsNullOrEmpty(joinMapSerialized))
+ joinMap = JsonConvert.DeserializeObject(joinMapSerialized);
+
+ bridge.AddJoinMap(Key, joinMap);
+
+ Debug.Console(1, this, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
+
+ // Link up outputs
+ for (uint i = 1; i <= Dmps.NumberOfSwitcherInputs; i++)
+ {
+ Debug.Console(2, this, "Linking Input Card {0}", i);
+
+ var ioSlot = i;
+ var ioSlotJoin = ioSlot - 1;
+
+ //if (TxDictionary.ContainsKey(ioSlot))
+ //{
+ // Debug.Console(2, "Creating Tx Feedbacks {0}", ioSlot);
+ // var TxKey = TxDictionary[ioSlot];
+ // var TxDevice = DeviceManager.GetDeviceForKey(TxKey) as DmTxControllerBase;
+ // //TxDevice.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.InputEndpointOnline + ioSlot]);
+ // // TxDevice.AnyVideoInput.VideoStatus.VideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.InputEndpointOnline + ioSlot]);
+ // // trilist.SetUShortSigAction((ApiMap.HdcpSupport[ioSlot]), u => TxDevice.SetHdcpSupportAll((ePdtHdcpSupport)(u)));
+ // // TxDevice.HdcpSupportAllFeedback.LinkInputSig(trilist.UShortInput[joinMap. + ioSlot]);
+ // // trilist.UShortInput[ApiMap.HdcpSupportCapability[ioSlot]].UShortValue = TxDevice.HdcpSupportCapability;
+ //}
+ //else
+ //{
+ // // dmChassis.VideoInputSyncFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[ApiMap.TxVideoSyncStatus[ioSlot]]);
+ //}
+
+ if (VideoInputSyncFeedbacks[ioSlot] != null)
+ VideoInputSyncFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.VideoSyncStatus.JoinNumber + ioSlotJoin]);
+
+ if (InputNameFeedbacks[ioSlot] != null)
+ InputNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.InputNames.JoinNumber + ioSlotJoin]);
+
+ trilist.SetStringSigAction(joinMap.InputNames.JoinNumber + ioSlotJoin, new Action(s =>
+ {
+ var inputCard = Dmps.SwitcherInputs[ioSlot] as DMInput;
+
+ if (inputCard != null)
+ {
+ if (inputCard.NameFeedback != null && !string.IsNullOrEmpty(inputCard.NameFeedback.StringValue) && inputCard.NameFeedback.StringValue != s)
+ if (inputCard.Name != null)
+ inputCard.Name.StringValue = s;
+ }
+ }));
+
+
+ if (InputEndpointOnlineFeedbacks[ioSlot] != null)
+ InputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.InputEndpointOnline.JoinNumber + ioSlotJoin]);
+ }
+
+ for (uint i = 1; i <= Dmps.NumberOfSwitcherOutputs; i++)
+ {
+ Debug.Console(2, this, "Linking Output Card {0}", i);
+
+ var ioSlot = i;
+ var ioSlotJoin = ioSlot - 1;
+
+ // Control
+ trilist.SetUShortSigAction(joinMap.OutputVideo.JoinNumber + ioSlotJoin, o => ExecuteSwitch(o, ioSlot, eRoutingSignalType.Video));
+ trilist.SetUShortSigAction(joinMap.OutputAudio.JoinNumber + ioSlotJoin, o => ExecuteSwitch(o, ioSlot, eRoutingSignalType.Audio));
+
+ trilist.SetStringSigAction(joinMap.OutputNames.JoinNumber + ioSlotJoin, s =>
+ {
+ var outputCard = Dmps.SwitcherOutputs[ioSlot] as DMOutput;
+
+ //Debug.Console(2, dmpsRouter, "Output Name String Sig Action for Output Card {0}", ioSlot);
+
+ if (outputCard != null)
+ {
+ //Debug.Console(2, dmpsRouter, "Card Type: {0}", outputCard.CardInputOutputType);
+
+ if (!(outputCard is Card.Dmps3CodecOutput) && outputCard.NameFeedback != null)
+ {
+ if (!string.IsNullOrEmpty(outputCard.NameFeedback.StringValue))
+ {
+ //Debug.Console(2, dmpsRouter, "NameFeedabck: {0}", outputCard.NameFeedback.StringValue);
+
+ if (outputCard.NameFeedback.StringValue != s && outputCard.Name != null)
+ {
+ outputCard.Name.StringValue = s;
+ }
+ }
+ }
+ }
+ });
+
+ // Feedback
+ if (VideoOutputFeedbacks[ioSlot] != null)
+ VideoOutputFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.OutputVideo.JoinNumber + ioSlotJoin]);
+ if (AudioOutputFeedbacks[ioSlot] != null)
+ AudioOutputFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.OutputAudio.JoinNumber + ioSlotJoin]);
+ if (OutputNameFeedbacks[ioSlot] != null)
+ OutputNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputNames.JoinNumber + ioSlotJoin]);
+ if (OutputVideoRouteNameFeedbacks[ioSlot] != null)
+ OutputVideoRouteNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputCurrentVideoInputNames.JoinNumber + ioSlotJoin]);
+ if (OutputAudioRouteNameFeedbacks[ioSlot] != null)
+ OutputAudioRouteNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputCurrentAudioInputNames.JoinNumber + ioSlotJoin]);
+ if (OutputEndpointOnlineFeedbacks[ioSlot] != null)
+ OutputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.OutputEndpointOnline.JoinNumber + ioSlotJoin]);
+ }
+ }
///
diff --git a/essentials-framework/Essentials DM/Essentials_DM/Config/DeviceFactory.cs b/essentials-framework/Essentials DM/Essentials_DM/Config/DeviceFactory.cs
index 2417ce7e..5c532ac5 100644
--- a/essentials-framework/Essentials DM/Essentials_DM/Config/DeviceFactory.cs
+++ b/essentials-framework/Essentials DM/Essentials_DM/Config/DeviceFactory.cs
@@ -1,4 +1,5 @@
using System;
+using System.Linq;
using System.Collections.Generic;
using Crestron.SimplSharp;
using Crestron.SimplSharp.CrestronIO;
@@ -6,6 +7,7 @@ using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.DM;
using Crestron.SimplSharpPro.DM.AirMedia;
using Crestron.SimplSharpPro.UI;
+using Crestron.SimplSharp.Reflection;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
@@ -17,86 +19,33 @@ using PepperDash.Essentials.DM.Endpoints.DGEs;
namespace PepperDash.Essentials.DM
{
- public class DeviceFactory
- {
- public static IKeyed GetDevice(DeviceConfig dc)
- {
- var key = dc.Key;
- var name = dc.Name;
- var type = dc.Type;
- var properties = dc.Properties;
+ ///
+ /// Responsible for loading the type factories for this library
+ ///
+ 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);
- var typeName = dc.Type.ToLower();
-
- if (typeName.StartsWith("am"))
+ if (types != null)
{
- if (typeName == "am200" || typeName == "am300")
+ foreach (var type in types)
{
- var props = JsonConvert.DeserializeObject(properties.ToString());
- AmX00 amDevice = null;
- if (typeName == "am200")
- amDevice = new Crestron.SimplSharpPro.DM.AirMedia.Am200(props.Control.IpIdInt, Global.ControlSystem);
- else if (typeName == "am300")
- amDevice = new Crestron.SimplSharpPro.DM.AirMedia.Am300(props.Control.IpIdInt, Global.ControlSystem);
-
- return new AirMediaController(key, name, amDevice, dc, props);
+ 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);
+ }
}
}
- else if (typeName.StartsWith("dmmd8x") || typeName.StartsWith("dmmd16x") || typeName.StartsWith("dmmd32x"))
- {
- var props = JsonConvert.DeserializeObject
- (properties.ToString());
- return PepperDash.Essentials.DM.DmChassisController.
- GetDmChassisController(key, name, type, props);
- }
- else if (typeName.StartsWith("dmmd128x") || typeName.StartsWith("dmmd64x")) {
- var props = JsonConvert.DeserializeObject
- (properties.ToString());
- return PepperDash.Essentials.DM.DmBladeChassisController.
- GetDmChassisController(key, name, type, props);
- }
- // Hand off to DmTxHelper class
- else if (typeName.StartsWith("dmtx")) {
- var props = JsonConvert.DeserializeObject
- (properties.ToString());
- return PepperDash.Essentials.DM.DmTxHelper.GetDmTxController(key, name, type, props);
- }
-
- // Hand off to DmRmcHelper class
- else if (typeName.StartsWith("dmrmc")) {
- var props = JsonConvert.DeserializeObject
- (properties.ToString());
- return PepperDash.Essentials.DM.DmRmcHelper.GetDmRmcController(key, name, type, props);
- }
-
- else if (typeName.Equals("hdmd4x14ke")) {
- var props = JsonConvert.DeserializeObject
- (properties.ToString());
- return PepperDash.Essentials.DM.Chassis.HdMdNxM4kEController.GetController(key, name, type, props);
- }
-
- else if (typeName.Equals("hdmd400ce") || typeName.Equals("hdmd300ce") || typeName.Equals("hdmd200ce") || typeName.Equals("hdmd200c1ge")) {
- var props = JsonConvert.DeserializeObject
- (properties.ToString());
-
- if (typeName.Equals("hdmd400ce"))
- return new PepperDash.Essentials.DM.HdMdxxxCEController(key, name,
- new HdMd400CE(props.Control.IpIdInt, props.Control.TcpSshProperties.Address, Global.ControlSystem));
- else if (typeName.Equals("hdmd300ce"))
- return new PepperDash.Essentials.DM.HdMdxxxCEController(key, name,
- new HdMd300CE(props.Control.IpIdInt, props.Control.TcpSshProperties.Address, Global.ControlSystem));
- else if (typeName.Equals("hdmd200ce"))
- return new PepperDash.Essentials.DM.HdMdxxxCEController(key, name,
- new HdMd200CE(props.Control.IpIdInt, props.Control.TcpSshProperties.Address, Global.ControlSystem));
- else if (typeName.Equals("hdmd200c1ge"))
- return new PepperDash.Essentials.DM.HdMdxxxCEController(key, name,
- new HdMd200C1GE(props.Control.IpIdInt, props.Control.TcpSshProperties.Address, Global.ControlSystem));
- }
-
- return null;
- }
-
-
- }
-
+ }
+ }
}
\ No newline at end of file
diff --git a/essentials-framework/Essentials DM/Essentials_DM/DmLite/HdMdxxxCEController.cs b/essentials-framework/Essentials DM/Essentials_DM/DmLite/HdMdxxxCEController.cs
index 8113c218..4007e9f5 100644
--- a/essentials-framework/Essentials DM/Essentials_DM/DmLite/HdMdxxxCEController.cs
+++ b/essentials-framework/Essentials DM/Essentials_DM/DmLite/HdMdxxxCEController.cs
@@ -4,19 +4,23 @@ using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro;
+using Crestron.SimplSharpPro.DeviceSupport;
using Crestron.SimplSharpPro.DM;
using Crestron.SimplSharpPro.DM.Endpoints;
using Crestron.SimplSharpPro.DM.Endpoints.Receivers;
-
+using Newtonsoft.Json;
using PepperDash.Core;
using PepperDash.Essentials.Core;
+using PepperDash.Essentials.Core.Bridges;
+using PepperDash.Essentials.Core.Config;
namespace PepperDash.Essentials.DM
{
///
/// Represent both a transmitter and receiver pair of the HD-MD-400-C-E / HD-MD-300-C-E / HD-MD-200-C-E kits
///
- public class HdMdxxxCEController : CrestronGenericBaseDevice, IRouting//, IComPorts
+ [Description("Wrapper class for all HD-MD variants")]
+ public class HdMdxxxCEController : CrestronGenericBridgeableBaseDevice, IRouting//, IComPorts
{
///
///// DmLite Ports
@@ -217,10 +221,90 @@ namespace PepperDash.Essentials.DM
//public CrestronCollection ComPorts { get { return TxRxPair.ComPorts as CrestronCollection; } }
//public int NumberOfComPorts { get { return 1; } }
//#endregion
+ public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
+ {
+ var joinMap = new HdMdxxxCEControllerJoinMap(joinStart);
+
+ var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
+
+ if (!string.IsNullOrEmpty(joinMapSerialized))
+ joinMap = JsonConvert.DeserializeObject(joinMapSerialized);
+
+ bridge.AddJoinMap(Key, joinMap);
+
+ Debug.Console(1, this, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
+
+ IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline.JoinNumber]);
+ RemoteEndDetectedFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RemoteEndDetected.JoinNumber]);
+
+ trilist.SetSigTrueAction(joinMap.AutoRouteOn.JoinNumber, AutoRouteOn);
+ AutoRouteOnFeedback.LinkInputSig(trilist.BooleanInput[joinMap.AutoRouteOn.JoinNumber]);
+ trilist.SetSigTrueAction(joinMap.AutoRouteOff.JoinNumber, AutoRouteOff);
+ AutoRouteOnFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.AutoRouteOff.JoinNumber]);
+
+ trilist.SetSigTrueAction(joinMap.PriorityRoutingOn.JoinNumber, PriorityRouteOn);
+ PriorityRoutingOnFeedback.LinkInputSig(trilist.BooleanInput[joinMap.PriorityRoutingOn.JoinNumber]);
+ trilist.SetSigTrueAction(joinMap.PriorityRoutingOff.JoinNumber, PriorityRouteOff);
+ PriorityRoutingOnFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.PriorityRoutingOff.JoinNumber]);
+
+ trilist.SetSigTrueAction(joinMap.InputOnScreenDisplayEnabled.JoinNumber, OnScreenDisplayEnable);
+ InputOnScreenDisplayEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.InputOnScreenDisplayEnabled.JoinNumber]);
+ trilist.SetSigTrueAction(joinMap.AutoRouteOff.JoinNumber, OnScreenDisplayDisable);
+ InputOnScreenDisplayEnabledFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.InputOnScreenDisplayDisabled.JoinNumber]);
+
+ trilist.SetUShortSigAction(joinMap.VideoSource.JoinNumber, (i) => ExecuteSwitch(i, null, eRoutingSignalType.Video | eRoutingSignalType.Audio));
+ VideoSourceFeedback.LinkInputSig(trilist.UShortInput[joinMap.VideoSource.JoinNumber]);
+
+ trilist.UShortInput[joinMap.SourceCount.JoinNumber].UShortValue = (ushort)InputPorts.Count;
+
+ foreach (var input in InputPorts)
+ {
+ var number = Convert.ToUInt16(input.Selector);
+ var numberJoin = (UInt16)(number - 1);
+ SyncDetectedFeedbacks[number].LinkInputSig(trilist.BooleanInput[joinMap.SyncDetected.JoinNumber + numberJoin]);
+ trilist.StringInput[joinMap.SourceNames.JoinNumber + numberJoin].StringValue = input.Key;
+ }
+ }
}
public class HdMdxxxCEPropertiesConfig
{
public ControlPropertiesConfig Control { get; set; }
}
+
+ public class HdMdxxxCEControllerFactory : EssentialsDeviceFactory
+ {
+ public HdMdxxxCEControllerFactory()
+ {
+ TypeNames = new List() { "hdmd400ce", "hdmd300ce", "hdmd200ce", "hdmd200c1ge"};
+ }
+
+ public override EssentialsDevice BuildDevice(DeviceConfig dc)
+ {
+ var typeName = dc.Type.ToLower();
+ var key = dc.Key;
+ var name = dc.Name;
+
+ Debug.Console(1, "Factory Attempting to create new HD-MD Device");
+
+ var props = JsonConvert.DeserializeObject
+ (dc.Properties.ToString());
+
+ if (typeName.Equals("hdmd400ce"))
+ return new PepperDash.Essentials.DM.HdMdxxxCEController(key, name,
+ new HdMd400CE(props.Control.IpIdInt, props.Control.TcpSshProperties.Address, Global.ControlSystem));
+ else if (typeName.Equals("hdmd300ce"))
+ return new PepperDash.Essentials.DM.HdMdxxxCEController(key, name,
+ new HdMd300CE(props.Control.IpIdInt, props.Control.TcpSshProperties.Address, Global.ControlSystem));
+ else if (typeName.Equals("hdmd200ce"))
+ return new PepperDash.Essentials.DM.HdMdxxxCEController(key, name,
+ new HdMd200CE(props.Control.IpIdInt, props.Control.TcpSshProperties.Address, Global.ControlSystem));
+ else if (typeName.Equals("hdmd200c1ge"))
+ return new PepperDash.Essentials.DM.HdMdxxxCEController(key, name,
+ new HdMd200C1GE(props.Control.IpIdInt, props.Control.TcpSshProperties.Address, Global.ControlSystem));
+ else
+ return null;
+ }
+ }
+
}
\ No newline at end of file
diff --git a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/DGEs/Dge100Controller.cs b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/DGEs/Dge100Controller.cs
new file mode 100644
index 00000000..4a335c39
--- /dev/null
+++ b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/DGEs/Dge100Controller.cs
@@ -0,0 +1,108 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Crestron.SimplSharp;
+using Crestron.SimplSharpPro;
+using Crestron.SimplSharpPro.UI;
+
+using Crestron.SimplSharpPro.DM;
+
+
+using Newtonsoft.Json;
+
+using PepperDash.Core;
+using PepperDash.Essentials.Core;
+using PepperDash.Essentials.Core.Config;
+using Crestron.SimplSharpPro.DeviceSupport;
+
+namespace PepperDash.Essentials.DM.Endpoints.DGEs
+{
+ ///
+ /// Wrapper class for DGE-100 and DM-DGE-200-C
+ ///
+ public class Dge100Controller : CrestronGenericBaseDevice, IComPorts, IIROutputPorts, IHasBasicTriListWithSmartObject, ICec
+ {
+ private readonly Dge100 _dge;
+
+ public BasicTriListWithSmartObject Panel { get { return _dge; } }
+
+ private DeviceConfig _dc;
+
+ CrestronTouchpanelPropertiesConfig PropertiesConfig;
+
+ public Dge100Controller(string key, string name, Dge100 device, DeviceConfig dc, CrestronTouchpanelPropertiesConfig props)
+ :base(key, name, device)
+ {
+ _dge = device;
+
+ _dc = dc;
+
+ PropertiesConfig = props;
+ }
+
+ #region IComPorts Members
+
+ public CrestronCollection ComPorts
+ {
+ get { return _dge.ComPorts; }
+ }
+
+ public int NumberOfComPorts
+ {
+ get { return _dge.NumberOfComPorts; }
+ }
+
+ #endregion
+
+ #region IIROutputPorts Members
+
+ public CrestronCollection IROutputPorts
+ {
+ get { return _dge.IROutputPorts; }
+ }
+
+ public int NumberOfIROutputPorts
+ {
+ get { return _dge.NumberOfIROutputPorts; }
+ }
+
+ #endregion
+
+ #region ICec Members
+ public Cec StreamCec { get { return _dge.HdmiOut.StreamCec; } }
+ #endregion
+
+ }
+
+ public class Dge100ControllerFactory : EssentialsDeviceFactory
+ {
+ public Dge100ControllerFactory()
+ {
+ TypeNames = new List() { "dge100" };
+ }
+
+ public override EssentialsDevice BuildDevice(DeviceConfig dc)
+ {
+ var typeName = dc.Type.ToLower();
+ var comm = CommFactory.GetControlPropertiesConfig(dc);
+ var props = JsonConvert.DeserializeObject(dc.Properties.ToString());
+
+ Debug.Console(1, "Factory Attempting to create new DgeController Device");
+
+ Dge100 dgeDevice = null;
+ if (typeName == "dge100")
+ dgeDevice = new Dge100(comm.IpIdInt, Global.ControlSystem);
+
+ if (dgeDevice == null)
+ {
+ Debug.Console(1, "Unable to create DGE device");
+ return null;
+ }
+
+ var dgeController = new Dge100Controller(dc.Key, dc.Name, dgeDevice, dc, props);
+
+ return dgeController;
+ }
+ }
+}
\ No newline at end of file
diff --git a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/DGEs/DgeController.cs b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/DGEs/DgeController.cs
deleted file mode 100644
index 0fc00323..00000000
--- a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/DGEs/DgeController.cs
+++ /dev/null
@@ -1,66 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Crestron.SimplSharp;
-using Crestron.SimplSharpPro;
-using Crestron.SimplSharpPro.UI;
-
-using Newtonsoft.Json;
-
-using PepperDash.Core;
-using PepperDash.Essentials.Core;
-using PepperDash.Essentials.Core.Config;
-
-namespace PepperDash.Essentials.DM.Endpoints.DGEs
-{
- ///
- /// Wrapper class for DGE-100 and DM-DGE-200-C
- ///
- public class DgeController : CrestronGenericBaseDevice, IComPorts, IIROutputPorts
- {
- public Dge100 DigitalGraphicsEngine { get; private set; }
-
- public DeviceConfig DeviceConfig { get; private set; }
-
- CrestronTouchpanelPropertiesConfig PropertiesConfig;
-
- public DgeController(string key, string name, Dge100 device, DeviceConfig dc, CrestronTouchpanelPropertiesConfig props)
- :base(key, name, device)
- {
- DigitalGraphicsEngine = device;
-
- DeviceConfig = dc;
-
- PropertiesConfig = props;
- }
-
- #region IComPorts Members
-
- public CrestronCollection ComPorts
- {
- get { return DigitalGraphicsEngine.ComPorts; }
- }
-
- public int NumberOfComPorts
- {
- get { return DigitalGraphicsEngine.NumberOfComPorts; }
- }
-
- #endregion
-
- #region IIROutputPorts Members
-
- public CrestronCollection IROutputPorts
- {
- get { return DigitalGraphicsEngine.IROutputPorts; }
- }
-
- public int NumberOfIROutputPorts
- {
- get { return DigitalGraphicsEngine.NumberOfIROutputPorts; }
- }
-
- #endregion
- }
-}
\ No newline at end of file
diff --git a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/DGEs/DmDge200CController.cs b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/DGEs/DmDge200CController.cs
new file mode 100644
index 00000000..d4539e53
--- /dev/null
+++ b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/DGEs/DmDge200CController.cs
@@ -0,0 +1,93 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Crestron.SimplSharp;
+using Crestron.SimplSharpPro;
+using Crestron.SimplSharpPro.UI;
+
+using Newtonsoft.Json;
+
+using PepperDash.Core;
+using PepperDash.Essentials.Core;
+using PepperDash.Essentials.Core.Config;
+using Crestron.SimplSharpPro.DeviceSupport;
+
+using Crestron.SimplSharpPro.DM;
+
+namespace PepperDash.Essentials.DM.Endpoints.DGEs
+{
+ ///
+ /// Wrapper class for DGE-100 and DM-DGE-200-C
+ ///
+ public class DmDge200CController : Dge100Controller, IRoutingInputsOutputs
+ {
+ private readonly DmDge200C _dge;
+
+ public RoutingInputPort DmIn { get; private set; }
+ public RoutingOutputPort HdmiOut { get; private set; }
+
+ public RoutingPortCollection InputPorts
+ {
+ get;
+ private set;
+ }
+
+ public RoutingPortCollection OutputPorts
+ {
+ get;
+ private set;
+ }
+
+ public DmDge200CController(string key, string name, DmDge200C device, DeviceConfig dc, CrestronTouchpanelPropertiesConfig props)
+ : base(key, name, device, dc, props)
+ {
+ _dge = device;
+
+ DmIn = new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.AudioVideo,
+ eRoutingPortConnectionType.DmCat, 0, this);
+ HdmiOut = new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.AudioVideo,
+ eRoutingPortConnectionType.Hdmi, null, this);
+
+
+ InputPorts = new RoutingPortCollection { DmIn };
+ OutputPorts = new RoutingPortCollection { HdmiOut };
+
+ // Set Ports for CEC
+ HdmiOut.Port = _dge.HdmiOut; ;
+
+ }
+
+ public class DmDge200CControllerFactory : EssentialsDeviceFactory
+ {
+ public DmDge200CControllerFactory()
+ {
+ TypeNames = new List() { "dmdge200c" };
+ }
+
+ public override EssentialsDevice BuildDevice(DeviceConfig dc)
+ {
+ var typeName = dc.Type.ToLower();
+ var comm = CommFactory.GetControlPropertiesConfig(dc);
+ var props = JsonConvert.DeserializeObject(dc.Properties.ToString());
+
+ Debug.Console(1, "Factory Attempting to create new DgeController Device");
+
+ DmDge200C dgeDevice = null;
+
+ if (typeName == "dmdge200c")
+ dgeDevice = new DmDge200C(comm.IpIdInt, Global.ControlSystem);
+
+ if (dgeDevice == null)
+ {
+ Debug.Console(1, "Unable to create DGE device");
+ return null;
+ }
+
+ var dgeController = new DmDge200CController(dc.Key , dc.Name, dgeDevice, dc, props);
+
+ return dgeController;
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmHdBaseTEndpointController.cs b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmHdBaseTEndpointController.cs
index 43ac9fc2..3af4f0fe 100644
--- a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmHdBaseTEndpointController.cs
+++ b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmHdBaseTEndpointController.cs
@@ -1,11 +1,5 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Crestron.SimplSharp;
+using Crestron.SimplSharp.Ssh;
using Crestron.SimplSharpPro;
-using Crestron.SimplSharpPro.DM;
-using Crestron.SimplSharpPro.DM.Endpoints;
using Crestron.SimplSharpPro.DM.Endpoints.Receivers;
using PepperDash.Essentials.Core;
@@ -13,32 +7,25 @@ using PepperDash.Essentials.Core;
namespace PepperDash.Essentials.DM
{
public class HDBaseTRxController : DmHdBaseTControllerBase, IRoutingInputsOutputs,
- IComPorts
+ IComPorts
{
public RoutingInputPort DmIn { get; private set; }
public RoutingOutputPort HDBaseTSink { get; private set; }
- public RoutingPortCollection InputPorts
- {
- get { return new RoutingPortCollection { DmIn }; }
- }
+ public RoutingPortCollection InputPorts { get; private set; }
- public RoutingPortCollection OutputPorts
- {
- get { return new RoutingPortCollection { HDBaseTSink }; }
- }
+ public RoutingPortCollection OutputPorts { get; private set; }
public HDBaseTRxController(string key, string name, HDRx3CB rmc)
: base(key, name, rmc)
{
- Rmc = rmc;
- DmIn = new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.Audio | eRoutingSignalType.Video,
+ DmIn = new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.AudioVideo,
eRoutingPortConnectionType.DmCat, 0, this);
- HDBaseTSink = new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
- eRoutingPortConnectionType.Hdmi, null, this);
+ HDBaseTSink = new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.AudioVideo,
+ eRoutingPortConnectionType.Hdmi, null, this) {Port = Rmc};
- // Set Ports for CEC
- HDBaseTSink.Port = Rmc; // Unique case, this class has no HdmiOutput port and ICec is implemented on the receiver class itself
+ InputPorts = new RoutingPortCollection {DmIn};
+ OutputPorts = new RoutingPortCollection {HDBaseTSink};
}
#region IComPorts Members
diff --git a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmc100SController.cs b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmc100SController.cs
index 49034fab..876880d1 100644
--- a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmc100SController.cs
+++ b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmc100SController.cs
@@ -1,14 +1,10 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Crestron.SimplSharp;
-using Crestron.SimplSharpPro;
+using Crestron.SimplSharpPro;
+using Crestron.SimplSharpPro.DeviceSupport;
using Crestron.SimplSharpPro.DM;
-using Crestron.SimplSharpPro.DM.Endpoints;
using Crestron.SimplSharpPro.DM.Endpoints.Receivers;
using PepperDash.Essentials.Core;
+using PepperDash.Essentials.Core.Bridges;
namespace PepperDash.Essentials.DM
{
@@ -19,20 +15,14 @@ namespace PepperDash.Essentials.DM
public class DmRmc100SController : DmRmcControllerBase, IRoutingInputsOutputs,
IIROutputPorts, IComPorts, ICec
{
- public DmRmc100S Rmc { get; private set; }
+ private readonly DmRmc100S _rmc;
public RoutingInputPort DmIn { get; private set; }
public RoutingOutputPort HdmiOut { get; private set; }
- public RoutingPortCollection InputPorts
- {
- get { return new RoutingPortCollection { DmIn }; }
- }
+ public RoutingPortCollection InputPorts { get; private set; }
- public RoutingPortCollection OutputPorts
- {
- get { return new RoutingPortCollection { HdmiOut }; }
- }
+ public RoutingPortCollection OutputPorts { get; private set; }
///
/// Make a Crestron RMC and put it in here
@@ -40,34 +30,34 @@ namespace PepperDash.Essentials.DM
public DmRmc100SController(string key, string name, DmRmc100S rmc)
: base(key, name, rmc)
{
- Rmc = rmc;
- DmIn = new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.Audio | eRoutingSignalType.Video,
- eRoutingPortConnectionType.DmCat, 0, this);
- HdmiOut = new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
- eRoutingPortConnectionType.Hdmi, null, this);
+ _rmc = rmc;
- // Set Ports for CEC
- HdmiOut.Port = Rmc; // Unique case, this class has no HdmiOutput port and ICec is implemented on the receiver class itself
+ DmIn = new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.AudioVideo,
+ eRoutingPortConnectionType.DmCat, 0, this);
+ HdmiOut = new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.AudioVideo,
+ eRoutingPortConnectionType.Hdmi, null, this) {Port = _rmc};
+
+ InputPorts = new RoutingPortCollection {DmIn};
+ OutputPorts = new RoutingPortCollection {HdmiOut};
}
- public override bool CustomActivate()
+ public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
{
- // Base does register and sets up comm monitoring.
- return base.CustomActivate();
+ LinkDmRmcToApi(this, trilist, joinStart, joinMapKey, bridge);
}
#region IIROutputPorts Members
- public CrestronCollection IROutputPorts { get { return Rmc.IROutputPorts; } }
- public int NumberOfIROutputPorts { get { return Rmc.NumberOfIROutputPorts; } }
+ public CrestronCollection IROutputPorts { get { return _rmc.IROutputPorts; } }
+ public int NumberOfIROutputPorts { get { return _rmc.NumberOfIROutputPorts; } }
#endregion
#region IComPorts Members
- public CrestronCollection ComPorts { get { return Rmc.ComPorts; } }
- public int NumberOfComPorts { get { return Rmc.NumberOfComPorts; } }
+ public CrestronCollection ComPorts { get { return _rmc.ComPorts; } }
+ public int NumberOfComPorts { get { return _rmc.NumberOfComPorts; } }
#endregion
#region ICec Members
- public Cec StreamCec { get { return Rmc.HdmiOutput.StreamCec; } }
+ public Cec StreamCec { get { return _rmc.HdmiOutput.StreamCec; } }
#endregion
}
}
\ No newline at end of file
diff --git a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmc150SController.cs b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmc150SController.cs
index e5d5a7df..9803b5b8 100644
--- a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmc150SController.cs
+++ b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmc150SController.cs
@@ -1,14 +1,10 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Crestron.SimplSharp;
-using Crestron.SimplSharpPro;
+using Crestron.SimplSharpPro;
+using Crestron.SimplSharpPro.DeviceSupport;
using Crestron.SimplSharpPro.DM;
-using Crestron.SimplSharpPro.DM.Endpoints;
using Crestron.SimplSharpPro.DM.Endpoints.Receivers;
using PepperDash.Essentials.Core;
+using PepperDash.Essentials.Core.Bridges;
namespace PepperDash.Essentials.DM
{
@@ -19,19 +15,20 @@ namespace PepperDash.Essentials.DM
public class DmRmc150SController : DmRmcControllerBase, IRoutingInputsOutputs,
IIROutputPorts, IComPorts, ICec
{
- public DmRmc150S Rmc { get; private set; }
+ private readonly DmRmc150S _rmc;
public RoutingInputPort DmIn { get; private set; }
public RoutingOutputPort HdmiOut { get; private set; }
public RoutingPortCollection InputPorts
{
- get { return new RoutingPortCollection { DmIn }; }
+ get; private set;
}
public RoutingPortCollection OutputPorts
{
- get { return new RoutingPortCollection { HdmiOut }; }
+ get;
+ private set ;
}
///
@@ -40,73 +37,62 @@ namespace PepperDash.Essentials.DM
public DmRmc150SController(string key, string name, DmRmc150S rmc)
: base(key, name, rmc)
{
- Rmc = rmc;
- DmIn = new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.Audio | eRoutingSignalType.Video,
+ _rmc = rmc;
+ DmIn = new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.AudioVideo,
eRoutingPortConnectionType.DmCat, 0, this);
- HdmiOut = new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
+ HdmiOut = new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.AudioVideo,
eRoutingPortConnectionType.Hdmi, null, this);
- EdidManufacturerFeedback = new StringFeedback(() => Rmc.HdmiOutput.ConnectedDevice.Manufacturer.StringValue);
- EdidNameFeedback = new StringFeedback(() => Rmc.HdmiOutput.ConnectedDevice.Name.StringValue);
- EdidPreferredTimingFeedback = new StringFeedback(() => Rmc.HdmiOutput.ConnectedDevice.PreferredTiming.StringValue);
- EdidSerialNumberFeedback = new StringFeedback(() => Rmc.HdmiOutput.ConnectedDevice.SerialNumber.StringValue);
+ EdidManufacturerFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.Manufacturer.StringValue);
+ EdidNameFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.Name.StringValue);
+ EdidPreferredTimingFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.PreferredTiming.StringValue);
+ EdidSerialNumberFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.SerialNumber.StringValue);
- //VideoOutputResolutionFeedback = new StringFeedback(() => Rmc.HdmiOutput.GetVideoResolutionString());
+ InputPorts = new RoutingPortCollection {DmIn};
+ OutputPorts = new RoutingPortCollection {HdmiOut};
- //Rmc.HdmiOutput.OutputStreamChange += HdmiOutput_OutputStreamChange;
- Rmc.HdmiOutput.ConnectedDevice.DeviceInformationChange += ConnectedDevice_DeviceInformationChange;
+ _rmc.HdmiOutput.ConnectedDevice.DeviceInformationChange += ConnectedDevice_DeviceInformationChange;
// Set Ports for CEC
- HdmiOut.Port = Rmc.HdmiOutput;
+ HdmiOut.Port = _rmc.HdmiOutput;
}
- //void HdmiOutput_OutputStreamChange(EndpointOutputStream outputStream, EndpointOutputStreamEventArgs args)
- //{
- // if (args.EventId == EndpointOutputStreamEventIds.HorizontalResolutionFeedbackEventId || args.EventId == EndpointOutputStreamEventIds.VerticalResolutionFeedbackEventId ||
- // args.EventId == EndpointOutputStreamEventIds.FramesPerSecondFeedbackEventId)
- // {
- // VideoOutputResolutionFeedback.FireUpdate();
- // }
- //}
-
void ConnectedDevice_DeviceInformationChange(ConnectedDeviceInformation connectedDevice, ConnectedDeviceEventArgs args)
{
- if (args.EventId == ConnectedDeviceEventIds.ManufacturerEventId)
+ switch (args.EventId)
{
- EdidManufacturerFeedback.FireUpdate();
- }
- else if (args.EventId == ConnectedDeviceEventIds.NameEventId)
- {
- EdidNameFeedback.FireUpdate();
- }
- else if (args.EventId == ConnectedDeviceEventIds.PreferredTimingEventId)
- {
- EdidPreferredTimingFeedback.FireUpdate();
- }
- else if (args.EventId == ConnectedDeviceEventIds.SerialNumberEventId)
- {
- EdidSerialNumberFeedback.FireUpdate();
+ case ConnectedDeviceEventIds.ManufacturerEventId:
+ EdidManufacturerFeedback.FireUpdate();
+ break;
+ case ConnectedDeviceEventIds.NameEventId:
+ EdidNameFeedback.FireUpdate();
+ break;
+ case ConnectedDeviceEventIds.PreferredTimingEventId:
+ EdidPreferredTimingFeedback.FireUpdate();
+ break;
+ case ConnectedDeviceEventIds.SerialNumberEventId:
+ EdidSerialNumberFeedback.FireUpdate();
+ break;
}
}
- public override bool CustomActivate()
+ public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
{
- // Base does register and sets up comm monitoring.
- return base.CustomActivate();
+ LinkDmRmcToApi(this, trilist, joinStart, joinMapKey, bridge);
}
#region IIROutputPorts Members
- public CrestronCollection IROutputPorts { get { return Rmc.IROutputPorts; } }
- public int NumberOfIROutputPorts { get { return Rmc.NumberOfIROutputPorts; } }
+ public CrestronCollection IROutputPorts { get { return _rmc.IROutputPorts; } }
+ public int NumberOfIROutputPorts { get { return _rmc.NumberOfIROutputPorts; } }
#endregion
#region IComPorts Members
- public CrestronCollection ComPorts { get { return Rmc.ComPorts; } }
- public int NumberOfComPorts { get { return Rmc.NumberOfComPorts; } }
+ public CrestronCollection ComPorts { get { return _rmc.ComPorts; } }
+ public int NumberOfComPorts { get { return _rmc.NumberOfComPorts; } }
#endregion
#region ICec Members
- public Cec StreamCec { get { return Rmc.HdmiOutput.StreamCec; } }
+ public Cec StreamCec { get { return _rmc.HdmiOutput.StreamCec; } }
#endregion
}
}
\ No newline at end of file
diff --git a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmc200CController.cs b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmc200CController.cs
index 7fbef021..27187bcd 100644
--- a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmc200CController.cs
+++ b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmc200CController.cs
@@ -1,14 +1,11 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Crestron.SimplSharp;
-using Crestron.SimplSharpPro;
+using Crestron.SimplSharpPro;
+using Crestron.SimplSharpPro.DeviceSupport;
using Crestron.SimplSharpPro.DM;
using Crestron.SimplSharpPro.DM.Endpoints;
using Crestron.SimplSharpPro.DM.Endpoints.Receivers;
using PepperDash.Essentials.Core;
+using PepperDash.Essentials.Core.Bridges;
namespace PepperDash.Essentials.DM
{
@@ -19,19 +16,19 @@ namespace PepperDash.Essentials.DM
public class DmRmc200CController : DmRmcControllerBase, IRoutingInputsOutputs,
IIROutputPorts, IComPorts, ICec
{
- public DmRmc200C Rmc { get; private set; }
+ private readonly DmRmc200C _rmc;
public RoutingInputPort DmIn { get; private set; }
- public RoutingOutputPort HdmiOut { get; private set; }
+ public RoutingOutputPort HdmiOut { get; private set; }
public RoutingPortCollection InputPorts
{
- get { return new RoutingPortCollection { DmIn }; }
+ get; private set;
}
public RoutingPortCollection OutputPorts
{
- get { return new RoutingPortCollection { HdmiOut }; }
+ get; private set;
}
///
@@ -40,24 +37,27 @@ namespace PepperDash.Essentials.DM
public DmRmc200CController(string key, string name, DmRmc200C rmc)
: base(key, name, rmc)
{
- Rmc = rmc;
- DmIn = new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.Audio | eRoutingSignalType.Video,
+ _rmc = rmc;
+ DmIn = new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.AudioVideo,
eRoutingPortConnectionType.DmCat, 0, this);
- HdmiOut = new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
+ HdmiOut = new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.AudioVideo,
eRoutingPortConnectionType.Hdmi, null, this);
- EdidManufacturerFeedback = new StringFeedback(() => Rmc.HdmiOutput.ConnectedDevice.Manufacturer.StringValue);
- EdidNameFeedback = new StringFeedback(() => Rmc.HdmiOutput.ConnectedDevice.Name.StringValue);
- EdidPreferredTimingFeedback = new StringFeedback(() => Rmc.HdmiOutput.ConnectedDevice.PreferredTiming.StringValue);
- EdidSerialNumberFeedback = new StringFeedback(() => Rmc.HdmiOutput.ConnectedDevice.SerialNumber.StringValue);
+ EdidManufacturerFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.Manufacturer.StringValue);
+ EdidNameFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.Name.StringValue);
+ EdidPreferredTimingFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.PreferredTiming.StringValue);
+ EdidSerialNumberFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.SerialNumber.StringValue);
- VideoOutputResolutionFeedback = new StringFeedback(() => Rmc.HdmiOutput.GetVideoResolutionString());
+ VideoOutputResolutionFeedback = new StringFeedback(() => _rmc.HdmiOutput.GetVideoResolutionString());
- Rmc.HdmiOutput.OutputStreamChange += HdmiOutput_OutputStreamChange;
- Rmc.HdmiOutput.ConnectedDevice.DeviceInformationChange += ConnectedDevice_DeviceInformationChange;
+ _rmc.HdmiOutput.OutputStreamChange += HdmiOutput_OutputStreamChange;
+ _rmc.HdmiOutput.ConnectedDevice.DeviceInformationChange += ConnectedDevice_DeviceInformationChange;
+
+ InputPorts = new RoutingPortCollection {DmIn};
+ OutputPorts = new RoutingPortCollection {HdmiOut};
// Set Ports for CEC
- HdmiOut.Port = Rmc.HdmiOutput;
+ HdmiOut.Port = _rmc.HdmiOutput;
}
void HdmiOutput_OutputStreamChange(EndpointOutputStream outputStream, EndpointOutputStreamEventArgs args)
@@ -71,42 +71,40 @@ namespace PepperDash.Essentials.DM
void ConnectedDevice_DeviceInformationChange(ConnectedDeviceInformation connectedDevice, ConnectedDeviceEventArgs args)
{
- if (args.EventId == ConnectedDeviceEventIds.ManufacturerEventId)
+ switch (args.EventId)
{
- EdidManufacturerFeedback.FireUpdate();
- }
- else if (args.EventId == ConnectedDeviceEventIds.NameEventId)
- {
- EdidNameFeedback.FireUpdate();
- }
- else if (args.EventId == ConnectedDeviceEventIds.PreferredTimingEventId)
- {
- EdidPreferredTimingFeedback.FireUpdate();
- }
- else if (args.EventId == ConnectedDeviceEventIds.SerialNumberEventId)
- {
- EdidSerialNumberFeedback.FireUpdate();
+ case ConnectedDeviceEventIds.ManufacturerEventId:
+ EdidManufacturerFeedback.FireUpdate();
+ break;
+ case ConnectedDeviceEventIds.NameEventId:
+ EdidNameFeedback.FireUpdate();
+ break;
+ case ConnectedDeviceEventIds.PreferredTimingEventId:
+ EdidPreferredTimingFeedback.FireUpdate();
+ break;
+ case ConnectedDeviceEventIds.SerialNumberEventId:
+ EdidSerialNumberFeedback.FireUpdate();
+ break;
}
}
- public override bool CustomActivate()
- {
- // Base does register and sets up comm monitoring.
- return base.CustomActivate();
- }
+ public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
+ {
+ LinkDmRmcToApi(this, trilist, joinStart, joinMapKey, bridge);
+ }
- #region IIROutputPorts Members
- public CrestronCollection IROutputPorts { get { return Rmc.IROutputPorts; } }
- public int NumberOfIROutputPorts { get { return Rmc.NumberOfIROutputPorts; } }
+ #region IIROutputPorts Members
+ public CrestronCollection IROutputPorts { get { return _rmc.IROutputPorts; } }
+ public int NumberOfIROutputPorts { get { return _rmc.NumberOfIROutputPorts; } }
#endregion
#region IComPorts Members
- public CrestronCollection ComPorts { get { return Rmc.ComPorts; } }
- public int NumberOfComPorts { get { return Rmc.NumberOfComPorts; } }
+ public CrestronCollection ComPorts { get { return _rmc.ComPorts; } }
+ public int NumberOfComPorts { get { return _rmc.NumberOfComPorts; } }
#endregion
#region ICec Members
- public Cec StreamCec { get { return Rmc.HdmiOutput.StreamCec; } }
+ public Cec StreamCec { get { return _rmc.HdmiOutput.StreamCec; } }
#endregion
}
}
\ No newline at end of file
diff --git a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmc200S2Controller.cs b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmc200S2Controller.cs
index ec2ead98..c909098f 100644
--- a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmc200S2Controller.cs
+++ b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmc200S2Controller.cs
@@ -1,14 +1,11 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Crestron.SimplSharp;
-using Crestron.SimplSharpPro;
+using Crestron.SimplSharpPro;
+using Crestron.SimplSharpPro.DeviceSupport;
using Crestron.SimplSharpPro.DM;
using Crestron.SimplSharpPro.DM.Endpoints;
using Crestron.SimplSharpPro.DM.Endpoints.Receivers;
using PepperDash.Essentials.Core;
+using PepperDash.Essentials.Core.Bridges;
namespace PepperDash.Essentials.DM
{
@@ -19,20 +16,14 @@ namespace PepperDash.Essentials.DM
public class DmRmc200S2Controller : DmRmcControllerBase, IRoutingInputsOutputs,
IIROutputPorts, IComPorts, ICec
{
- public DmRmc200S2 Rmc { get; private set; }
+ private readonly DmRmc200S2 _rmc;
public RoutingInputPort DmIn { get; private set; }
public RoutingOutputPort HdmiOut { get; private set; }
- public RoutingPortCollection InputPorts
- {
- get { return new RoutingPortCollection { DmIn }; }
- }
+ public RoutingPortCollection InputPorts { get; private set; }
- public RoutingPortCollection OutputPorts
- {
- get { return new RoutingPortCollection { HdmiOut }; }
- }
+ public RoutingPortCollection OutputPorts { get; private set; }
///
/// Make a Crestron RMC and put it in here
@@ -40,24 +31,27 @@ namespace PepperDash.Essentials.DM
public DmRmc200S2Controller(string key, string name, DmRmc200S2 rmc)
: base(key, name, rmc)
{
- Rmc = rmc;
- DmIn = new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.Audio | eRoutingSignalType.Video,
+ _rmc = rmc;
+ DmIn = new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.AudioVideo,
eRoutingPortConnectionType.DmCat, 0, this);
- HdmiOut = new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
+ HdmiOut = new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.AudioVideo,
eRoutingPortConnectionType.Hdmi, null, this);
- EdidManufacturerFeedback = new StringFeedback(() => Rmc.HdmiOutput.ConnectedDevice.Manufacturer.StringValue);
- EdidNameFeedback = new StringFeedback(() => Rmc.HdmiOutput.ConnectedDevice.Name.StringValue);
- EdidPreferredTimingFeedback = new StringFeedback(() => Rmc.HdmiOutput.ConnectedDevice.PreferredTiming.StringValue);
- EdidSerialNumberFeedback = new StringFeedback(() => Rmc.HdmiOutput.ConnectedDevice.SerialNumber.StringValue);
+ EdidManufacturerFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.Manufacturer.StringValue);
+ EdidNameFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.Name.StringValue);
+ EdidPreferredTimingFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.PreferredTiming.StringValue);
+ EdidSerialNumberFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.SerialNumber.StringValue);
- VideoOutputResolutionFeedback = new StringFeedback(() => Rmc.HdmiOutput.GetVideoResolutionString());
+ VideoOutputResolutionFeedback = new StringFeedback(() => _rmc.HdmiOutput.GetVideoResolutionString());
- Rmc.HdmiOutput.OutputStreamChange += HdmiOutput_OutputStreamChange;
- Rmc.HdmiOutput.ConnectedDevice.DeviceInformationChange += ConnectedDevice_DeviceInformationChange;
+ _rmc.HdmiOutput.OutputStreamChange += HdmiOutput_OutputStreamChange;
+ _rmc.HdmiOutput.ConnectedDevice.DeviceInformationChange += ConnectedDevice_DeviceInformationChange;
+
+ InputPorts = new RoutingPortCollection {DmIn};
+ OutputPorts = new RoutingPortCollection {HdmiOut};
// Set Ports for CEC
- HdmiOut.Port = Rmc.HdmiOutput;
+ HdmiOut.Port = _rmc.HdmiOutput;
}
void HdmiOutput_OutputStreamChange(EndpointOutputStream outputStream, EndpointOutputStreamEventArgs args)
@@ -71,42 +65,40 @@ namespace PepperDash.Essentials.DM
void ConnectedDevice_DeviceInformationChange(ConnectedDeviceInformation connectedDevice, ConnectedDeviceEventArgs args)
{
- if (args.EventId == ConnectedDeviceEventIds.ManufacturerEventId)
+ switch (args.EventId)
{
- EdidManufacturerFeedback.FireUpdate();
- }
- else if (args.EventId == ConnectedDeviceEventIds.NameEventId)
- {
- EdidNameFeedback.FireUpdate();
- }
- else if (args.EventId == ConnectedDeviceEventIds.PreferredTimingEventId)
- {
- EdidPreferredTimingFeedback.FireUpdate();
- }
- else if (args.EventId == ConnectedDeviceEventIds.SerialNumberEventId)
- {
- EdidSerialNumberFeedback.FireUpdate();
+ case ConnectedDeviceEventIds.ManufacturerEventId:
+ EdidManufacturerFeedback.FireUpdate();
+ break;
+ case ConnectedDeviceEventIds.NameEventId:
+ EdidNameFeedback.FireUpdate();
+ break;
+ case ConnectedDeviceEventIds.PreferredTimingEventId:
+ EdidPreferredTimingFeedback.FireUpdate();
+ break;
+ case ConnectedDeviceEventIds.SerialNumberEventId:
+ EdidSerialNumberFeedback.FireUpdate();
+ break;
}
}
- public override bool CustomActivate()
+ public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
{
- // Base does register and sets up comm monitoring.
- return base.CustomActivate();
+ LinkDmRmcToApi(this, trilist, joinStart, joinMapKey, bridge);
}
#region IIROutputPorts Members
- public CrestronCollection IROutputPorts { get { return Rmc.IROutputPorts; } }
- public int NumberOfIROutputPorts { get { return Rmc.NumberOfIROutputPorts; } }
+ public CrestronCollection IROutputPorts { get { return _rmc.IROutputPorts; } }
+ public int NumberOfIROutputPorts { get { return _rmc.NumberOfIROutputPorts; } }
#endregion
#region IComPorts Members
- public CrestronCollection ComPorts { get { return Rmc.ComPorts; } }
- public int NumberOfComPorts { get { return Rmc.NumberOfComPorts; } }
+ public CrestronCollection ComPorts { get { return _rmc.ComPorts; } }
+ public int NumberOfComPorts { get { return _rmc.NumberOfComPorts; } }
#endregion
#region ICec Members
- public Cec StreamCec { get { return Rmc.HdmiOutput.StreamCec; } }
+ public Cec StreamCec { get { return _rmc.HdmiOutput.StreamCec; } }
#endregion
}
}
\ No newline at end of file
diff --git a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmc200SController.cs b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmc200SController.cs
index 9f2a5251..8d53964b 100644
--- a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmc200SController.cs
+++ b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmc200SController.cs
@@ -1,14 +1,11 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Crestron.SimplSharp;
-using Crestron.SimplSharpPro;
+using Crestron.SimplSharpPro;
+using Crestron.SimplSharpPro.DeviceSupport;
using Crestron.SimplSharpPro.DM;
using Crestron.SimplSharpPro.DM.Endpoints;
using Crestron.SimplSharpPro.DM.Endpoints.Receivers;
using PepperDash.Essentials.Core;
+using PepperDash.Essentials.Core.Bridges;
namespace PepperDash.Essentials.DM
{
@@ -19,19 +16,16 @@ namespace PepperDash.Essentials.DM
public class DmRmc200SController : DmRmcControllerBase, IRoutingInputsOutputs,
IIROutputPorts, IComPorts, ICec
{
- public DmRmc200S Rmc { get; private set; }
+ private readonly DmRmc200S _rmc;
public RoutingInputPort DmIn { get; private set; }
public RoutingOutputPort HdmiOut { get; private set; }
- public RoutingPortCollection InputPorts
- {
- get { return new RoutingPortCollection { DmIn }; }
- }
+ public RoutingPortCollection InputPorts { get; private set; }
public RoutingPortCollection OutputPorts
{
- get { return new RoutingPortCollection { HdmiOut }; }
+ get; private set;
}
///