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 839ae827..af91840c 100644
--- a/.github/workflows/docker.yml
+++ b/.github/workflows/docker.yml
@@ -11,7 +11,7 @@ on:
env:
# solution path doesn't need slashes unless there it is multiple folders deep
- # solution name does not include extension. .sln is assumed
+ # solution name does not include extension. .sln is assumed
SOLUTION_PATH: PepperDashEssentials
SOLUTION_FILE: PepperDashEssentials
# Do not edit this, we're just creating it here
@@ -52,6 +52,12 @@ jobs:
run: |
Write-Output ${{ env.VERSION }}
./.github/scripts/UpdateAssemblyVersion.ps1 ${{ env.VERSION }}
+ # Login to Docker
+ - name: Login to Docker
+ uses: azure/docker-login@v1
+ with:
+ username: ${{ secrets.DOCKER_USERNAME }}
+ password: ${{ secrets.DOCKER_TOKEN }}
# Build the solutions in the docker image
- name: Build Solution
shell: powershell
@@ -77,9 +83,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 +101,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 +116,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 +193,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 97f9d3e5..a928d031 100644
--- a/.github/workflows/master.yml
+++ b/.github/workflows/master.yml
@@ -31,7 +31,7 @@ jobs:
git config --global url."https://github.com/".insteadOf "git@github.com:"
auth_header="$(git config --local --get http.https://github.com/.extraheader)"
git submodule sync --recursive
- git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=
+ git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
# Generate the appropriate version number
- name: Set Version Number
shell: powershell
@@ -44,6 +44,12 @@ jobs:
run: |
Write-Output ${{ env.VERSION }}
./.github/scripts/UpdateAssemblyVersion.ps1 ${{ env.VERSION }}
+ # Login to Docker
+ - name: Login to Docker
+ uses: azure/docker-login@v1
+ with:
+ username: ${{ secrets.DOCKER_USERNAME }}
+ password: ${{ secrets.DOCKER_TOKEN }}
# Build the solutions in the docker image
- name: Build Solution
shell: powershell
diff --git a/PepperDashEssentials/Bridges/JoinMaps/DmRmcControllerJoinMap.cs b/PepperDashEssentials/Bridges/JoinMaps/DmRmcControllerJoinMap.cs
index 7e1534bf..3d7cec8d 100644
--- a/PepperDashEssentials/Bridges/JoinMaps/DmRmcControllerJoinMap.cs
+++ b/PepperDashEssentials/Bridges/JoinMaps/DmRmcControllerJoinMap.cs
@@ -38,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
@@ -51,6 +55,9 @@ namespace PepperDash.Essentials.Bridges
EdidName = 3;
EdidPrefferedTiming = 4;
EdidSerialNumber = 5;
+
+ //Analog
+ AudioVideoSource = 1;
}
public override void OffsetJoinNumbers(uint joinStart)
@@ -62,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/ControlSystem.cs b/PepperDashEssentials/ControlSystem.cs
index f0cdc9d5..00748815 100644
--- a/PepperDashEssentials/ControlSystem.cs
+++ b/PepperDashEssentials/ControlSystem.cs
@@ -26,6 +26,8 @@ namespace PepperDash.Essentials
{
HttpLogoServer LogoServer;
+ private CTimer _startTimer;
+ private const long StartupTime = 500;
public ControlSystem()
: base()
@@ -39,6 +41,11 @@ namespace PepperDash.Essentials
/// Entry point for the program
///
public override void InitializeSystem()
+ {
+ _startTimer = new CTimer(StartSystem,StartupTime);
+ }
+
+ private void StartSystem(object obj)
{
DeterminePlatform();
@@ -75,11 +82,11 @@ 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)
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/AirMediaControllerJoinMap.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/AirMediaControllerJoinMap.cs
index 1c091233..c9a6c2b2 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/AirMediaControllerJoinMap.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/AirMediaControllerJoinMap.cs
@@ -1,110 +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 : JoinMapBase
- {
- #region Digitals
- ///
- /// Indicates that the device is online when high
- ///
- public uint IsOnline { get; set; }
- ///
- /// Indicates that the device is in session when high
- ///
- public uint IsInSession { get; set; }
- ///
- /// Indicates sync detected on HDMI input when high
- ///
- public uint HdmiVideoSync { get; set; }
- ///
- /// Set High to enable automatic input routing and low to disable. Feedback high when enabled
- ///
- public uint AutomaticInputRoutingEnabled { get; set; }
- #endregion
-
- #region Analogs
- ///
- /// Selects source and provides feedback
- ///
- public uint VideoOut { get; set; }
- ///
- /// Provided error feedback
- ///
- public uint ErrorFB { get; set; }
- ///
- /// Indicates the number of connected users as feedback
- ///
- public uint NumberOfUsersConnectedFB { get; set; }
- ///
- /// Sets the login code and provides the current code as feedback
- ///
- public uint LoginCode { get; set; }
- #endregion
-
- #region Serials
- ///
- /// Provides the name defined in config as feedback
- ///
- public uint Name { get; set; }
- ///
- /// Provides the connection address as feedback
- ///
- public uint ConnectionAddressFB { get; set; }
- ///
- /// Provides the hostname as feedback
- ///
- public uint HostnameFB { get; set; }
- ///
- /// Provides the serial number as feedback
- ///
- public uint SerialNumberFeedback { get; set; }
- #endregion
-
- public AirMediaControllerJoinMap()
- {
- // Digital
- IsOnline = 1;
- IsInSession = 2;
- HdmiVideoSync = 3;
- AutomaticInputRoutingEnabled = 4;
-
- // Analog
- VideoOut = 1;
- ErrorFB = 2;
- NumberOfUsersConnectedFB = 3;
- LoginCode = 4;
-
- // Serial
- Name = 1;
- ConnectionAddressFB = 2;
- HostnameFB = 3;
- SerialNumberFeedback = 4;
- }
-
- public override void OffsetJoinNumbers(uint joinStart)
- {
- var joinOffset = joinStart - 1;
-
- IsOnline = IsOnline + joinOffset;
- IsInSession = IsInSession + joinOffset;
- HdmiVideoSync = HdmiVideoSync + joinOffset;
- AutomaticInputRoutingEnabled = AutomaticInputRoutingEnabled + joinOffset;
-
- VideoOut = VideoOut + joinOffset;
- ErrorFB = ErrorFB + joinOffset;
- NumberOfUsersConnectedFB = NumberOfUsersConnectedFB + joinOffset;
- LoginCode = LoginCode + joinOffset;
-
- Name = Name + joinOffset;
- ConnectionAddressFB = ConnectionAddressFB + joinOffset;
- HostnameFB = HostnameFB + joinOffset;
- SerialNumberFeedback = SerialNumberFeedback + joinOffset;
- }
- }
+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
index aae9e37b..03abf902 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/AppleTvJoinMap.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/AppleTvJoinMap.cs
@@ -1,67 +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 : JoinMapBase
- {
- #region Digitals
- ///
- /// Sends up arrow command while high
- ///
- public uint UpArrow { get; set; }
- ///
- /// Sends down arrow command while high
- ///
- public uint DnArrow { get; set; }
- ///
- /// Sends left arrow command while high
- ///
- public uint LeftArrow { get; set; }
- ///
- /// Sends right arrow command while high
- ///
- public uint RightArrow { get; set; }
- ///
- /// Sends menu command
- ///
- public uint Menu { get; set; }
- ///
- /// Sends select command
- ///
- public uint Select { get; set; }
- ///
- /// Sends play/pause command
- ///
- public uint PlayPause { get; set; }
- #endregion
-
- public AppleTvJoinMap()
- {
- UpArrow = 1;
- DnArrow = 2;
- LeftArrow = 3;
- RightArrow = 4;
- Menu = 5;
- Select = 6;
- PlayPause = 7;
- }
-
- public override void OffsetJoinNumbers(uint joinStart)
- {
- var joinOffset = joinStart - 1;
-
- UpArrow = UpArrow + joinOffset;
- DnArrow = DnArrow + joinOffset;
- LeftArrow = LeftArrow + joinOffset;
- RightArrow = RightArrow + joinOffset;
- Menu = Menu + joinOffset;
- Select = Select + joinOffset;
- PlayPause = PlayPause + joinOffset;
- }
- }
+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
index 2ef315b5..50429332 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/C2nRthsControllerJoinMap.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/C2nRthsControllerJoinMap.cs
@@ -1,43 +1,34 @@
-using System.Linq;
-using Crestron.SimplSharp.Reflection;
-using PepperDash.Essentials.Core;
-
-namespace 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);
- }
- }
- }
+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/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
index df90a18b..13123ca0 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/DigitalLoggerJoinMap.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/DigitalLoggerJoinMap.cs
@@ -1,48 +1,47 @@
-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 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;
- }
- }
+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
index c2fe8573..e0b13688 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/DisplayControllerJoinMap.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/DisplayControllerJoinMap.cs
@@ -1,117 +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 : JoinMapBase
- {
- #region Digitals
- ///
- /// Turns the display off and reports power off feedback
- ///
- public uint PowerOff { get; set; }
- ///
- /// Turns the display on and repots power on feedback
- ///
- public uint PowerOn { get; set; }
- ///
- /// Indicates that the display device supports two way communication when high
- ///
- public uint IsTwoWayDisplay { get; set; }
- ///
- /// Increments the volume while high
- ///
- public uint VolumeUp { get; set; }
- ///
- /// Decrements teh volume while high
- ///
- public uint VolumeDown { get; set; }
- ///
- /// Toggles the mute state. Feedback is high when volume is muted
- ///
- public uint VolumeMute { get; set; }
- ///
- /// Range of digital joins to select inputs and report current input as feedback
- ///
- public uint InputSelectOffset { get; set; }
- ///
- /// Range of digital joins to report visibility for input buttons
- ///
- public uint ButtonVisibilityOffset { get; set; }
- ///
- /// High if the device is online
- ///
- public uint IsOnline { get; set; }
- #endregion
-
- #region Analogs
- ///
- /// Analog join to set the input and report current input as feedback
- ///
- public uint InputSelect { get; set; }
- ///
- /// Sets the volume level and reports the current level as feedback
- ///
- public uint VolumeLevel { get; set; }
- #endregion
-
- #region Serials
- ///
- /// Reports the name of the display as defined in config as feedback
- ///
- public uint Name { get; set; }
- ///
- /// Range of serial joins that reports the names of the inputs as feedback
- ///
- public uint InputNamesOffset { get; set; }
- #endregion
-
- public DisplayControllerJoinMap()
- {
- // Digital
- IsOnline = 50;
- PowerOff = 1;
- PowerOn = 2;
- IsTwoWayDisplay = 3;
- VolumeUp = 5;
- VolumeDown = 6;
- VolumeMute = 7;
-
- ButtonVisibilityOffset = 40;
- InputSelectOffset = 10;
-
- // Analog
- InputSelect = 11;
- VolumeLevel = 5;
-
- // Serial
- Name = 1;
- InputNamesOffset = 10;
- }
-
- public override void OffsetJoinNumbers(uint joinStart)
- {
- var joinOffset = joinStart - 1;
-
- IsOnline = IsOnline + joinOffset;
- PowerOff = PowerOff + joinOffset;
- PowerOn = PowerOn + joinOffset;
- IsTwoWayDisplay = IsTwoWayDisplay + joinOffset;
- ButtonVisibilityOffset = ButtonVisibilityOffset + joinOffset;
- Name = Name + joinOffset;
- InputNamesOffset = InputNamesOffset + joinOffset;
- InputSelectOffset = InputSelectOffset + joinOffset;
-
- InputSelect = InputSelect + joinOffset;
-
- VolumeUp = VolumeUp + joinOffset;
- VolumeDown = VolumeDown + joinOffset;
- VolumeMute = VolumeMute + joinOffset;
- VolumeLevel = VolumeLevel + joinOffset;
- }
- }
+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
index 001d6f94..63e3041e 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/DmBladeChassisControllerJoinMap.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/DmBladeChassisControllerJoinMap.cs
@@ -1,109 +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 : 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.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
index 5059333f..48c4b59e 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/DmChassisControllerJoinMap.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/DmChassisControllerJoinMap.cs
@@ -1,151 +1,109 @@
-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 : JoinMapBase
- {
-#region Digital/Analogs
- ///
- /// Analog input sets System ID, output reports current ID as feedback.
- /// Digital input applies System ID, output is high when applying busy.
- ///
- public uint SystemId { get; set; }
-#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
- ///
- /// Range reports high if corresponding output is disabled by HDCP.
- ///
- public uint OutputDisabledByHdcp { 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 audio source for the corresponding output
- ///
- public uint OutputAudio { get; set; }
- ///
- /// Range sets and reports the current Usb source for the corresponding output
- ///
- public uint OutputUsb { get; set; }
- ///
- /// Range sets and reports the current Usb source for the corresponding input
- ///
- public uint InputUsb { 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 name of the current audio source for the corresponding output card
- ///
- public uint OutputCurrentAudioInputNames { get; set; }
- ///
- /// Range reports the current input resolution for each corresponding input card
- ///
- public uint InputCurrentResolution { get; set; }
-#endregion
-
- public DmChassisControllerJoinMap()
- {
- //Digital/Analog
- SystemId = 10; // Analog sets/gets SystemId, digital input applies and provides feedback of ID change busy
-
- //Digital
- IsOnline = 11;
- VideoSyncStatus = 100; //101-299
- InputEndpointOnline = 500; //501-699
- OutputEndpointOnline = 700; //701-899
- TxAdvancedIsPresent = 1000; //1001-1199
- OutputDisabledByHdcp = 1200; //1201-1399
-
- //Analog
- OutputVideo = 100; //101-299
- OutputAudio = 300; //301-499
- OutputUsb = 500; //501-699
- InputUsb = 700; //701-899
- HdcpSupportState = 1000; //1001-1199
- HdcpSupportCapability = 1200; //1201-1399
-
-
- //Serial
- InputNames = 100; //101-299
- OutputNames = 300; //301-499
- OutputCurrentVideoInputNames = 2000; //2001-2199
- OutputCurrentAudioInputNames = 2200; //2201-2399
- InputCurrentResolution = 2400; // 2401-2599
- }
-
- public override void OffsetJoinNumbers(uint joinStart)
- {
- var joinOffset = joinStart - 1;
-
- SystemId = SystemId + joinOffset;
- IsOnline = IsOnline + joinOffset;
- OutputVideo = OutputVideo + joinOffset;
- OutputAudio = OutputAudio + joinOffset;
- OutputUsb = OutputUsb + joinOffset;
- InputUsb = InputUsb + joinOffset;
- VideoSyncStatus = VideoSyncStatus + joinOffset;
- InputNames = InputNames + joinOffset;
- OutputNames = OutputNames + joinOffset;
- OutputCurrentVideoInputNames = OutputCurrentVideoInputNames + joinOffset;
- OutputCurrentAudioInputNames = OutputCurrentAudioInputNames + joinOffset;
- InputCurrentResolution = InputCurrentResolution + joinOffset;
- InputEndpointOnline = InputEndpointOnline + joinOffset;
- OutputEndpointOnline = OutputEndpointOnline + joinOffset;
- HdcpSupportState = HdcpSupportState + joinOffset;
- HdcpSupportCapability = HdcpSupportCapability + joinOffset;
- OutputDisabledByHdcp = OutputDisabledByHdcp + joinOffset;
- TxAdvancedIsPresent = TxAdvancedIsPresent + joinOffset;
- }
- }
-}
+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("EnableAudioBreakaway")]
+ public JoinDataComplete EnableAudioBreakaway = new JoinDataComplete(
+ new JoinData {JoinNumber = 4, JoinSpan = 1},
+ new JoinMetadata
+ {
+ Label = "DM Chassis enable audio breakaway routing",
+ JoinCapabilities = eJoinCapabilities.ToSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [JoinName("EnableUsbBreakaway")]
+ public JoinDataComplete EnableUsbBreakaway = new JoinDataComplete(
+ new JoinData { JoinNumber = 5, JoinSpan = 1 },
+ new JoinMetadata
+ {
+ Label = "DM Chassis enable USB breakaway routing",
+ JoinCapabilities = eJoinCapabilities.ToSIMPL,
+ JoinType = eJoinType.Digital
+ });
+
+ [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
index 0bdedbbf..537be416 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/DmRmcControllerJoinMap.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/DmRmcControllerJoinMap.cs
@@ -1,67 +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 : JoinMapBase
- {
- #region Digitals
- ///
- /// High when device is online (if not attached to a DMP3 or DM chassis with a CPU3 card
- ///
- public uint IsOnline { get; set; }
- #endregion
-
- #region Serials
- ///
- /// Reports the current output resolution
- ///
- public uint CurrentOutputResolution { get; set; }
- ///
- /// Reports the EDID manufacturer value
- ///
- public uint EdidManufacturer { get; set; }
- ///
- /// Reports the EDID Name value
- ///
- public uint EdidName { get; set; }
- ///
- /// Reports the EDID preffered timing value
- ///
- public uint EdidPrefferedTiming { get; set; }
- ///
- /// Reports the EDID serial number value
- ///
- public uint EdidSerialNumber { get; set; }
- #endregion
-
- public DmRmcControllerJoinMap()
- {
- // Digital
- IsOnline = 1;
-
- // Serial
- CurrentOutputResolution = 1;
- EdidManufacturer = 2;
- EdidName = 3;
- EdidPrefferedTiming = 4;
- EdidSerialNumber = 5;
- }
-
- public override void OffsetJoinNumbers(uint joinStart)
- {
- var joinOffset = joinStart - 1;
-
- IsOnline = IsOnline + joinOffset;
- CurrentOutputResolution = CurrentOutputResolution + joinOffset;
- EdidManufacturer = EdidManufacturer + joinOffset;
- EdidName = EdidName + joinOffset;
- EdidPrefferedTiming = EdidPrefferedTiming + joinOffset;
- EdidSerialNumber = EdidSerialNumber + joinOffset;
- }
- }
+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
index b01da694..8b59bd42 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/DmTxControllerJoinMap.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/DmTxControllerJoinMap.cs
@@ -1,98 +1,69 @@
-using PepperDash.Essentials.Core;
-
-namespace PepperDash.Essentials.Core.Bridges
-{
- public class DmTxControllerJoinMap : JoinMapBase
- {
- #region Digitals
- ///
- /// High when device is online (if not attached to a DMP3 or DM chassis with a CPU3 card
- ///
- public uint IsOnline { get; set; }
- ///
- /// High when video sync is detected
- ///
- public uint VideoSyncStatus { get; set; }
- ///
- ///
- ///
- public uint FreeRunEnabled { get; set; }
- #endregion
-
- #region Analogs
- ///
- /// Sets and reports the video source
- ///
- public uint VideoInput { get; set; }
- ///
- /// Sets and reports the audio source
- ///
- public uint AudioInput { get; set; }
- ///
- /// Reports the highest supported HDCP state level for the corresponding input card
- ///
- public uint HdcpSupportCapability { get; set; }
- ///
- /// Sets and reports the current HDCP state for the corresponding input port
- ///
- public uint Port1HdcpState { get; set; }
- ///
- /// Sets and reports the current HDCP state for the corresponding input port
- ///
- public uint Port2HdcpState { get; set; }
-
- ///
- /// Sets and reports the current VGA Brightness level
- ///
- public uint VgaBrightness { get; set; }
-
- ///
- /// Sets and reports the current VGA Contrast level
- ///
- public uint VgaContrast { get; set; }
- #endregion
-
- #region Serials
- ///
- /// Reports the current input resolution
- ///
- public uint CurrentInputResolution { get; set; }
- #endregion
-
-
- public DmTxControllerJoinMap()
- {
- // Digital
- IsOnline = 1;
- VideoSyncStatus = 2;
- FreeRunEnabled = 3;
- // Serial
- CurrentInputResolution = 1;
- // Analog
- VideoInput = 1;
- AudioInput = 2;
- HdcpSupportCapability = 3;
- Port1HdcpState = 4;
- Port2HdcpState = 5;
- VgaBrightness = 6;
- VgaContrast = 7;
- }
-
- public override void OffsetJoinNumbers(uint joinStart)
- {
- var joinOffset = joinStart - 1;
-
- IsOnline = IsOnline + joinOffset;
- VideoSyncStatus = VideoSyncStatus + joinOffset;
- FreeRunEnabled = FreeRunEnabled + joinOffset;
- CurrentInputResolution = CurrentInputResolution + joinOffset;
- VideoInput = VideoInput + joinOffset;
- AudioInput = AudioInput + joinOffset;
- HdcpSupportCapability = HdcpSupportCapability + joinOffset;
- Port1HdcpState = Port1HdcpState + joinOffset;
- Port2HdcpState = Port2HdcpState + joinOffset;
- VgaBrightness = VgaBrightness + joinOffset;
- VgaContrast = VgaContrast + joinOffset;
- }
- }
+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
index 125700b2..89686765 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/DmpsAudioOutputControllerJoinMap.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/DmpsAudioOutputControllerJoinMap.cs
@@ -1,69 +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 : JoinMapBase
- {
- #region Digital/Analog
- ///
- /// Range of joins for Master Volume
- /// Analog join 1 is volume level and feedback
- /// Digital join 1 is Mute on and feedback
- /// Digital join 2 is Mute off and feedback
- /// Digital join 3 is volume up
- /// Digital join 4 is volume down
- ///
- public uint MasterVolume { get; set; }
- ///
- /// Range of joins for Source Volume
- /// Analog join 11 is volume level and feedback
- /// Digital join 11 is Mute on and feedback
- /// Digital join 12 is Mute off and feedback
- /// Digital join 13 is volume up
- /// Digital join 14 is volume down
- ///
- public uint SourceVolume { get; set; }
- ///
- /// Range of joins for Codec1 Volume (if applicable)
- /// Analog join 21 is volume level and feedback
- /// Digital join 21 is Mute on and feedback
- /// Digital join 22 is Mute off and feedback
- /// Digital join 23 is volume up
- /// Digital join 24 is volume down
- ///
- public uint Codec1Volume { get; set; }
- ///
- /// Range of joins for Codec2 Volume (if applicable)
- /// Analog join 31 is volume level and feedback
- /// Digital join 31 is Mute on and feedback
- /// Digital join 32 is Mute off and feedback
- /// Digital join 33 is volume up
- /// Digital join 34 is volume down
- ///
- public uint Codec2Volume { get; set; }
- #endregion
-
- public DmpsAudioOutputControllerJoinMap()
- {
- MasterVolume = 1; // 1-10
- SourceVolume = 11; // 11-20
- Codec1Volume = 21; // 21-30
- Codec2Volume = 31; // 31-40
- }
-
- public override void OffsetJoinNumbers(uint joinStart)
- {
- var joinOffset = joinStart;
-
- MasterVolume = MasterVolume + joinOffset;
- SourceVolume = SourceVolume + joinOffset;
- Codec1Volume = Codec1Volume + joinOffset;
- Codec2Volume = Codec2Volume + joinOffset;
- }
- }
+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
index b58611fe..dc0d6fba 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/DmpsRoutingControllerJoinMap.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/DmpsRoutingControllerJoinMap.cs
@@ -7,121 +7,51 @@ using PepperDash.Essentials.Core;
namespace PepperDash.Essentials.Core.Bridges
{
- public class DmpsRoutingControllerJoinMap : JoinMapBase
+ public class DmpsRoutingControllerJoinMap : JoinMapBaseAdvanced
{
- #region Digitals
- ///
- /// 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; }
- #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 audio source for the corresponding output
- ///
- public uint OutputAudio { get; set; }
- ///
- /// Range sets and reports the current Usb source for the corresponding output
- ///
- //public uint OutputUsb { get; set; }
- /////
- ///// Range sets and reports the current Usb source for the corresponding input
- /////
- //public uint InputUsb { 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 name of the current audio source for the corresponding output card
- ///
- public uint OutputCurrentAudioInputNames { get; set; }
- ///
- /// Range reports the current input resolution for each corresponding input card
- ///
- public uint InputCurrentResolution { get; set; }
- #endregion
-
-
- public DmpsRoutingControllerJoinMap()
- {
- //Digital
- VideoSyncStatus = 100; //101-299
- InputEndpointOnline = 500; //501-699
- OutputEndpointOnline = 700; //701-899
-
- //Analog
- OutputVideo = 100; //101-299
- OutputAudio = 300; //301-499
- //OutputUsb = 500; //501-699
- //InputUsb = 700; //701-899
- VideoSyncStatus = 100; //101-299
- //HdcpSupportState = 1000; //1001-1199
- //HdcpSupportCapability = 1200; //1201-1399
-
-
- //Serial
- InputNames = 100; //101-299
- OutputNames = 300; //301-499
- OutputCurrentVideoInputNames = 2000; //2001-2199
- OutputCurrentAudioInputNames = 2200; //2201-2399
- InputCurrentResolution = 2400; // 2401-2599
- InputEndpointOnline = 500; //501-699
- OutputEndpointOnline = 700; //701-899
-
- }
-
- public override void OffsetJoinNumbers(uint joinStart)
- {
- var joinOffset = joinStart - 1;
-
- OutputVideo = OutputVideo + joinOffset;
- OutputAudio = OutputAudio + joinOffset;
- //OutputUsb = OutputUsb + joinOffset;
- //InputUsb = InputUsb + joinOffset;
- VideoSyncStatus = VideoSyncStatus + joinOffset;
- InputNames = InputNames + joinOffset;
- OutputNames = OutputNames + joinOffset;
- OutputCurrentVideoInputNames = OutputCurrentVideoInputNames + joinOffset;
- OutputCurrentAudioInputNames = OutputCurrentAudioInputNames + joinOffset;
- InputCurrentResolution = InputCurrentResolution + joinOffset;
- InputEndpointOnline = InputEndpointOnline + joinOffset;
- OutputEndpointOnline = OutputEndpointOnline + joinOffset;
- //HdcpSupportState = HdcpSupportState + joinOffset;
- //HdcpSupportCapability = HdcpSupportCapability + joinOffset;
+ [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
index 242be651..f639cff0 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/GenericLightingJoinMap.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/GenericLightingJoinMap.cs
@@ -9,33 +9,35 @@ using PepperDash.Essentials.Core;
namespace PepperDash.Essentials.Core.Bridges
{
- public class GenericLightingJoinMap : JoinMapBase
- {
- public uint IsOnline { get; set; }
- public uint SelectScene { get; set; }
- public uint LightingSceneOffset { get; set; }
- public uint ButtonVisibilityOffset { get; set; }
- public uint IntegrationIdSet { get; set; }
-
- public GenericLightingJoinMap()
- {
- // Digital
- IsOnline = 1;
- SelectScene = 1;
- IntegrationIdSet = 1;
- LightingSceneOffset = 10;
- ButtonVisibilityOffset = 40;
- // Analog
- }
-
- public override void OffsetJoinNumbers(uint joinStart)
- {
- var joinOffset = joinStart - 1;
-
- IsOnline = IsOnline + joinOffset;
- SelectScene = SelectScene + joinOffset;
- LightingSceneOffset = LightingSceneOffset + joinOffset;
- ButtonVisibilityOffset = ButtonVisibilityOffset + joinOffset;
+ 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
index e4ccdfbd..894b7fd3 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/GenericRelayControllerJoinMap.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/GenericRelayControllerJoinMap.cs
@@ -7,25 +7,17 @@ using PepperDash.Essentials.Core;
namespace PepperDash.Essentials.Core.Bridges
{
- public class GenericRelayControllerJoinMap : JoinMapBase
+ public class GenericRelayControllerJoinMap : JoinMapBaseAdvanced
{
- #region Digitals
- ///
- /// Sets and reports the state of the relay (High = closed, Low = Open)
- ///
- public uint Relay { get; set; }
- #endregion
- public GenericRelayControllerJoinMap()
- {
- Relay = 1;
- }
-
- public override void OffsetJoinNumbers(uint joinStart)
- {
- var joinOffset = joinStart - 1;
-
- Relay = Relay + joinOffset;
+ [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
index 6e2cd175..15b927b2 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/GlsOccupancySensorBaseJoinMap.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/GlsOccupancySensorBaseJoinMap.cs
@@ -1,238 +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 : 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.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
index d3769838..825fc946 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/HdMdxxxCEControllerJoinMap.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/HdMdxxxCEControllerJoinMap.cs
@@ -7,113 +7,62 @@ using PepperDash.Essentials.Core;
namespace PepperDash.Essentials.Core.Bridges
{
- public class HdMdxxxCEControllerJoinMap : JoinMapBase
+ public class HdMdxxxCEControllerJoinMap : JoinMapBaseAdvanced
{
- #region Digitals
- ///
- /// High when the pair is online
- ///
- public uint IsOnline { get; set; }
- ///
- /// High when the remote end device is online
- ///
- public uint RemoteEndDetected { get; set; }
-
- ///
- /// Sets Auto Route On and provides feedback
- ///
- public uint AutoRouteOn { get; set; }
-
- ///
- /// Sets Auto Route Off and provides feedback
- ///
- public uint AutoRouteOff { get; set; }
-
- ///
- /// Sets Priority Routing On and provides feedback
- ///
- public uint PriorityRoutingOn { get; set; }
-
- ///
- /// Sets Priority Routing Off and provides feedback
- ///
- public uint PriorityRoutingOff { get; set; }
-
- ///
- /// Enables OSD and provides feedback
- ///
- public uint InputOnScreenDisplayEnabled { get; set; }
-
- ///
- /// Disables OSD and provides feedback
- ///
- public uint InputOnScreenDisplayDisabled { get; set; }
-
- ///
- /// Provides Video Sync Detected feedback for each input
- ///
- public uint SyncDetected { get; set; }
- #endregion
-
- #region Analogs
- ///
- /// Sets the video source for the receiver's HDMI out and provides feedback
- ///
- public uint VideoSource { get; set; }
-
- ///
- /// Indicates the number of sources supported by the Tx/Rx pair
- ///
- public uint SourceCount { get; set; }
- #endregion
-
- #region Serials
- ///
- /// Indicates the name of each input port
- ///
- public uint SourceNames { get; set; }
- #endregion
-
- public HdMdxxxCEControllerJoinMap()
- {
- //Digital
- IsOnline = 1;
- RemoteEndDetected = 2;
- AutoRouteOn = 3;
- AutoRouteOff = 4;
- PriorityRoutingOn = 5;
- PriorityRoutingOff = 6;
- InputOnScreenDisplayEnabled = 7;
- InputOnScreenDisplayDisabled = 8;
- SyncDetected = 10; // 11-15
-
- //Analog
- VideoSource = 1;
- SourceCount = 2;
-
- //Serials
- SourceNames = 10; // 11-15
- }
-
- public override void OffsetJoinNumbers(uint joinStart)
- {
- var joinOffset = joinStart - 1;
-
- IsOnline = IsOnline + joinOffset;
- RemoteEndDetected = RemoteEndDetected + joinOffset;
- AutoRouteOn = AutoRouteOn + joinOffset;
- AutoRouteOff = AutoRouteOff + joinOffset;
- PriorityRoutingOn = PriorityRoutingOn + joinOffset;
- PriorityRoutingOff = PriorityRoutingOff + joinOffset;
- InputOnScreenDisplayEnabled = InputOnScreenDisplayEnabled + joinOffset;
- InputOnScreenDisplayDisabled = InputOnScreenDisplayDisabled + joinOffset;
- SyncDetected = SyncDetected + joinOffset;
-
- VideoSource = VideoSource + joinOffset;
- SourceCount = SourceCount + joinOffset;
-
- SourceNames = SourceNames + joinOffset;
+ [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
index 3669738e..612ace4f 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/IBasicCommunicationJoinMap.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/IBasicCommunicationJoinMap.cs
@@ -1,67 +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 : JoinMapBase
- {
- #region Digitals
- ///
- /// Set High to connect, Low to disconnect
- ///
- public uint Connect { get; set; }
- ///
- /// Reports Connected State (High = Connected)
- ///
- public uint Connected { get; set; }
- #endregion
-
- #region Analogs
- ///
- /// Reports the connections status value
- ///
- public uint Status { get; set; }
- #endregion
-
- #region Serials
- ///
- /// Data back from port
- ///
- public uint TextReceived { get; set; }
- ///
- /// Sends data to the port
- ///
- public uint SendText { get; set; }
- ///
- /// Takes a JSON serialized string that sets a COM port's parameters
- ///
- public uint SetPortConfig { get; set; }
- #endregion
-
- public IBasicCommunicationJoinMap()
- {
- TextReceived = 1;
- SendText = 1;
- SetPortConfig = 2;
- Connect = 1;
- Connected = 1;
- Status = 1;
- }
-
- public override void OffsetJoinNumbers(uint joinStart)
- {
- var joinOffset = joinStart - 1;
-
- TextReceived = TextReceived + joinOffset;
- SendText = SendText + joinOffset;
- SetPortConfig = SetPortConfig + joinOffset;
- Connect = Connect + joinOffset;
- Connected = Connected + joinOffset;
- Status = Status + joinOffset;
- }
- }
+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
index ba9bcc0f..a9e4ca6b 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/IDigitalInputJoinMap.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/IDigitalInputJoinMap.cs
@@ -7,25 +7,17 @@ using PepperDash.Essentials.Core;
namespace PepperDash.Essentials.Core.Bridges
{
- public class IDigitalInputJoinMap : JoinMapBase
+ public class IDigitalInputJoinMap : JoinMapBaseAdvanced
{
- #region Digitals
- ///
- /// Reports the state of the digital input
- ///
- public uint InputState { get; set; }
- #endregion
- public IDigitalInputJoinMap()
- {
- InputState = 1;
- }
-
- public override void OffsetJoinNumbers(uint joinStart)
- {
- var joinOffset = joinStart - 1;
-
- InputState = InputState + joinOffset;
+ [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
index dc634ab3..d2058a2d 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/SetTopBoxControllerJoinMap.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/SetTopBoxControllerJoinMap.cs
@@ -9,204 +9,225 @@ using Crestron.SimplSharp.Reflection;
namespace PepperDash.Essentials.Core.Bridges
{
- public class SetTopBoxControllerJoinMap : JoinMapBase
+ public class SetTopBoxControllerJoinMap : JoinMapBaseAdvanced
{
- #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;
- }
-
+ [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
index 7efd049b..fc699c02 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/StatusSignControllerJoinMap.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/StatusSignControllerJoinMap.cs
@@ -4,46 +4,45 @@ using PepperDash.Essentials.Core;
namespace PepperDash.Essentials.Core.Bridges
{
- public class StatusSignControllerJoinMap:JoinMapBase
+ public class StatusSignControllerJoinMap : JoinMapBaseAdvanced
{
- 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;
-
-
+ [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))
+ {
}
- 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/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/SystemMonitorJoinMap.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/SystemMonitorJoinMap.cs
index b2fd3dfd..a021eaaa 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/SystemMonitorJoinMap.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/SystemMonitorJoinMap.cs
@@ -1,225 +1,141 @@
-using PepperDash.Essentials.Core;
-
-namespace PepperDash.Essentials.Core.Bridges
-{
- public class SystemMonitorJoinMap : JoinMapBase
- {
- ///
- /// Offset to indicate where the range of iterated program joins will start
- ///
- public uint ProgramStartJoin { get; set; }
-
- ///
- /// Offset to indicate where the range of iterated Ethernet joins will start
- ///
- public uint EthernetStartJoin { get; set; }
-
- ///
- /// Offset between each program join set
- ///
- public uint ProgramOffsetJoin { get; set; }
-
- ///
- /// Offset between each Ethernet Interface join set
- ///
- public uint EthernetOffsetJoin { get; set; }
-
- #region Digitals
- ///
- /// Range Sets and reports whether the corresponding program slot is started
- ///
- public uint ProgramStart { get; set; }
- ///
- /// Range Sets and reports whether the corresponding program slot is stopped
- ///
- public uint ProgramStop { get; set; }
- ///
- /// Range Sets and reports whether the corresponding program is registered
- ///
- public uint ProgramRegister { get; set; }
- ///
- /// Range Sets and reports whether the corresponding program is unregistered
- ///
- public uint ProgramUnregister { get; set; }
- #endregion
-
- #region Analogs
- ///
- /// Sets and reports the time zone
- ///
- public uint TimeZone { get; set; }
- #endregion
-
- #region Serials
- ///
- /// Reports the time zone name
- ///
- public uint TimeZoneName { get; set; }
- ///
- /// Reports the IO Controller Version
- ///
- public uint IOControllerVersion { get; set; }
- ///
- /// Reports the SNMP App Version
- ///
- public uint SnmpAppVersion { get; set; }
- ///
- /// Reports the BACnet App Version
- ///
- public uint BACnetAppVersion { get; set; }
- ///
- /// Reports the firmware version
- ///
- public uint ControllerVersion { get; set; }
-
- ///
- /// Reports the name of the corresponding program
- ///
- public uint ProgramName { get; set; }
- ///
- /// Reports the compile time of the corresponding program
- ///
- public uint ProgramCompiledTime { get; set; }
- ///
- /// Reports the Crestron Database version of the corresponding program
- ///
- public uint ProgramCrestronDatabaseVersion { get; set; }
- ///
- /// Reports the Environment Version of the corresponding program
- ///
- public uint ProgramEnvironmentVersion { get; set; }
- ///
- /// Serialized JSON output that aggregates the program info of the corresponding program
- ///
- public uint AggregatedProgramInfo { get; set; }
- ///
- /// Reports the controller serial number
- ///
- public uint SerialNumber { get; set; }
- ///
- /// Reports the controller model
- ///
- public uint Model { get; set; }
- ///
- /// Reports the Host name set on the corresponding interface
- ///
- public uint HostName { get; set; }
- ///
- /// Reports the Current IP address set on the corresponding interface. If DHCP is enabled, this will be the DHCP assigned address.
- ///
- public uint CurrentIpAddress { get; set; }
- ///
- /// Reporst the Current Default Gateway set on the corresponding interface. If DHCP is enabled, this will be the DHCP assigned gateway
- ///
- public uint CurrentDefaultGateway { get; set; }
- ///
- /// Reports the Current Subnet Mask set on the corresponding interface. If DHCP is enabled, this will be the DHCP assigned subnet mask
- ///
- public uint CurrentSubnetMask { get; set; }
- ///
- /// Reports the Static IP address set on the corresponding interface. If DHCP is disabled, this will match the Current IP address
- ///
- public uint StaticIpAddress { get; set; }
- ///
- /// Reporst the Static Default Gateway set on the corresponding interface. If DHCP is disabled, this will match the Current gateway
- ///
- public uint StaticDefaultGateway { get; set; }
- ///
- /// Reports the Current Subnet Mask set on the corresponding interface. If DHCP is enabled, this will be the DHCP assigned subnet mask
- ///
- public uint StaticSubnetMask { get; set; }
- ///
- /// Reports the current DomainFeedback on the corresponding interface
- ///
- public uint Domain { get; set; }
- ///
- /// Reports the current DNS Servers on the corresponding interface
- ///
- public uint DnsServer { get; set; }
- ///
- /// Reports the MAC Address of the corresponding interface
- ///
- public uint MacAddress { get; set; }
- ///
- /// Reports the DHCP Status of the corresponding interface
- ///
- public uint DhcpStatus { get; set; }
-
- ///
- /// Reports the current uptime. Updated in 5 minute intervals.
- ///
- public uint Uptime { get; set; }
-
- ///
- /// Reports the date of the last boot
- ///
- public uint LastBoot { get; set; }
- #endregion
-
- public SystemMonitorJoinMap()
- {
- TimeZone = 1;
-
- TimeZoneName = 1;
- IOControllerVersion = 2;
- SnmpAppVersion = 3;
- BACnetAppVersion = 4;
- ControllerVersion = 5;
- SerialNumber = 6;
- Model = 7;
- Uptime = 8;
- LastBoot = 9;
-
-
- ProgramStartJoin = 10;
-
- ProgramOffsetJoin = 5;
-
- // Offset in groups of 5 joins
- ProgramStart = 1;
- ProgramStop = 2;
- ProgramRegister = 3;
- ProgramUnregister = 4;
-
- ProgramName = 1;
- ProgramCompiledTime = 2;
- ProgramCrestronDatabaseVersion = 3;
- ProgramEnvironmentVersion = 4;
- AggregatedProgramInfo = 5;
-
- EthernetStartJoin = 75;
-
- EthernetOffsetJoin = 15;
-
- // Offset in groups of 15
- HostName = 1;
- CurrentIpAddress = 2;
- CurrentSubnetMask = 3;
- CurrentDefaultGateway = 4;
- StaticIpAddress = 5;
- StaticSubnetMask = 6;
- StaticDefaultGateway = 7;
- Domain = 8;
- DnsServer = 9;
- MacAddress = 10;
- DhcpStatus = 11;
- }
-
- public override void OffsetJoinNumbers(uint joinStart)
- {
- var joinOffset = joinStart - 1;
-
- TimeZone = TimeZone + joinOffset;
-
- TimeZoneName = TimeZoneName + joinOffset;
- IOControllerVersion = IOControllerVersion + joinOffset;
- SnmpAppVersion = SnmpAppVersion + joinOffset;
- BACnetAppVersion = BACnetAppVersion + joinOffset;
- ControllerVersion = ControllerVersion + joinOffset;
-
- // Sets the initial join value where the iterated program joins will begin
- ProgramStartJoin = ProgramStartJoin + joinOffset;
- EthernetStartJoin = EthernetStartJoin + joinOffset;
- }
- }
+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/GenericComm.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Config/Comm and IR/GenericComm.cs
index 41438832..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,125 +1,135 @@
-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);
-
- 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);
- }
- 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();
-
- var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
-
- if (!string.IsNullOrEmpty(joinMapSerialized))
- joinMap = JsonConvert.DeserializeObject(joinMapSerialized);
- joinMap.OffsetJoinNumbers(joinStart);
-
- 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, a.Text);
- };
- trilist.SetStringSigAction(joinMap.SendText, s => CommPort.SendText(s));
- trilist.SetStringSigAction(joinMap.SetPortConfig, SetPortConfig);
-
-
- var sComm = this as ISocketStatus;
- if (sComm == null) return;
- sComm.ConnectionChange += (s, a) =>
- {
- trilist.SetUshort(joinMap.Status, (ushort)(a.Client.ClientStatus));
- trilist.SetBool(joinMap.Connected, a.Client.ClientStatus ==
- SocketStatus.SOCKET_STATUS_CONNECTED);
- };
-
- trilist.SetBoolSigAction(joinMap.Connect, 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);
- }
- }
+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/Crestron IO/C2nRts/C2nRthsController.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Crestron IO/C2nRts/C2nRthsController.cs
index 0bc48d80..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,90 +1,92 @@
-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();
-
- var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
-
- if (!string.IsNullOrEmpty(joinMapSerialized))
- joinMap = JsonConvert.DeserializeObject(joinMapSerialized);
-
- joinMap.OffsetJoinNumbers(joinStart);
-
- Debug.Console(1, this, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
-
-
- trilist.SetBoolSigAction(joinMap.TemperatureFormat, SetTemperatureFormat);
-
- IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
- TemperatureFeedback.LinkInputSig(trilist.UShortInput[joinMap.Temperature]);
- HumidityFeedback.LinkInputSig(trilist.UShortInput[joinMap.Humidity]);
-
- trilist.StringInput[joinMap.Name].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));
- }
- }
+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/GenericDigitalInputDevice.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Crestron IO/Inputs/GenericDigitalInputDevice.cs
index 3d3383e9..774c7490 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Crestron IO/Inputs/GenericDigitalInputDevice.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Crestron IO/Inputs/GenericDigitalInputDevice.cs
@@ -44,22 +44,22 @@ namespace PepperDash.Essentials.Core.CrestronIO
}
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
- {
- var joinMap = new IDigitalInputJoinMap();
+ {
+ var joinMap = new IDigitalInputJoinMap(joinStart);
var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
if (!string.IsNullOrEmpty(joinMapSerialized))
- joinMap = JsonConvert.DeserializeObject(joinMapSerialized);
-
- joinMap.OffsetJoinNumbers(joinStart);
+ 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]);
+ InputStateFeedback.LinkInputSig(trilist.BooleanInput[joinMap.InputState.JoinNumber]);
}
catch (Exception e)
{
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 aac9de44..b79a8253 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Crestron IO/Relay/GenericRelayDevice.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Crestron IO/Relay/GenericRelayDevice.cs
@@ -70,15 +70,15 @@ namespace PepperDash.Essentials.Core.CrestronIO
#endregion
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
- {
- var joinMap = new GenericRelayControllerJoinMap();
+ {
+ var joinMap = new GenericRelayControllerJoinMap(joinStart);
var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
if (!string.IsNullOrEmpty(joinMapSerialized))
- joinMap = JsonConvert.DeserializeObject(joinMapSerialized);
-
- joinMap.OffsetJoinNumbers(joinStart);
+ joinMap = JsonConvert.DeserializeObject(joinMapSerialized);
+
+ bridge.AddJoinMap(Key, joinMap);
if (RelayOutput == null)
{
@@ -88,7 +88,7 @@ namespace PepperDash.Essentials.Core.CrestronIO
Debug.Console(1, this, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
- trilist.SetBoolSigAction(joinMap.Relay, b =>
+ trilist.SetBoolSigAction(joinMap.Relay.JoinNumber, b =>
{
if (b)
CloseRelay();
@@ -98,7 +98,7 @@ namespace PepperDash.Essentials.Core.CrestronIO
// feedback for relay state
- OutputIsOnFeedback.LinkInputSig(trilist.BooleanInput[joinMap.Relay]);
+ OutputIsOnFeedback.LinkInputSig(trilist.BooleanInput[joinMap.Relay.JoinNumber]);
}
}
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 ca679bce..89e830e5 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Crestron IO/StatusSign/StatusSignController.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Crestron IO/StatusSign/StatusSignController.cs
@@ -1,182 +1,182 @@
-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
-{
- [Description("Wrapper class for the Crestron StatusSign device")]
- public class StatusSignController : CrestronGenericBridgeableBaseDevice
- {
- private readonly StatusSign _device;
-
- public BoolFeedback RedLedEnabledFeedback { get; private set; }
- public BoolFeedback GreenLedEnabledFeedback { get; private set; }
- public BoolFeedback BlueLedEnabledFeedback { get; private set; }
-
- public IntFeedback RedLedBrightnessFeedback { get; private set; }
- public IntFeedback GreenLedBrightnessFeedback { get; private set; }
- public IntFeedback BlueLedBrightnessFeedback { get; private set; }
-
- public StatusSignController(string key, string name, GenericBase hardware) : base(key, name, hardware)
- {
- _device = hardware as StatusSign;
-
- RedLedEnabledFeedback =
- new BoolFeedback(
- () =>
- _device.Leds[(uint) StatusSign.Led.eLedColor.Red]
- .ControlFeedback.BoolValue);
- GreenLedEnabledFeedback =
- new BoolFeedback(
- () =>
- _device.Leds[(uint) StatusSign.Led.eLedColor.Green]
- .ControlFeedback.BoolValue);
- BlueLedEnabledFeedback =
- new BoolFeedback(
- () =>
- _device.Leds[(uint) StatusSign.Led.eLedColor.Blue]
- .ControlFeedback.BoolValue);
-
- RedLedBrightnessFeedback =
- new IntFeedback(() => (int) _device.Leds[(uint) StatusSign.Led.eLedColor.Red].BrightnessFeedback);
- GreenLedBrightnessFeedback =
- new IntFeedback(() => (int) _device.Leds[(uint) StatusSign.Led.eLedColor.Green].BrightnessFeedback);
- BlueLedBrightnessFeedback =
- new IntFeedback(() => (int) _device.Leds[(uint) StatusSign.Led.eLedColor.Blue].BrightnessFeedback);
-
- if (_device != null) _device.BaseEvent += _device_BaseEvent;
- }
-
- void _device_BaseEvent(GenericBase device, BaseEventArgs args)
- {
- switch (args.EventId)
- {
- case StatusSign.LedBrightnessFeedbackEventId:
- RedLedBrightnessFeedback.FireUpdate();
- GreenLedBrightnessFeedback.FireUpdate();
- BlueLedBrightnessFeedback.FireUpdate();
- break;
- case StatusSign.LedControlFeedbackEventId:
- RedLedEnabledFeedback.FireUpdate();
- GreenLedEnabledFeedback.FireUpdate();
- BlueLedEnabledFeedback.FireUpdate();
- break;
- }
- }
-
- public void EnableLedControl(bool red, bool green, bool blue)
- {
- _device.Leds[(uint) StatusSign.Led.eLedColor.Red].Control.BoolValue = red;
- _device.Leds[(uint)StatusSign.Led.eLedColor.Green].Control.BoolValue = green;
- _device.Leds[(uint)StatusSign.Led.eLedColor.Blue].Control.BoolValue = blue;
- }
-
- public void SetColor(uint red, uint green, uint blue)
- {
- try
- {
- _device.Leds[(uint)StatusSign.Led.eLedColor.Red].Brightness =
- (StatusSign.Led.eBrightnessPercentageValues)SimplSharpDeviceHelper.PercentToUshort(red);
- }
- catch (InvalidOperationException)
- {
- Debug.Console(1, this, "Error converting value to Red LED brightness. value: {0}", red);
- }
- try
- {
- _device.Leds[(uint)StatusSign.Led.eLedColor.Green].Brightness =
- (StatusSign.Led.eBrightnessPercentageValues)SimplSharpDeviceHelper.PercentToUshort(green);
- }
- catch (InvalidOperationException)
- {
- Debug.Console(1, this, "Error converting value to Green LED brightness. value: {0}", green);
- }
-
- try
- {
- _device.Leds[(uint)StatusSign.Led.eLedColor.Blue].Brightness =
- (StatusSign.Led.eBrightnessPercentageValues)SimplSharpDeviceHelper.PercentToUshort(blue);
- }
- catch (InvalidOperationException)
- {
- Debug.Console(1, this, "Error converting value to Blue LED brightness. value: {0}", blue);
- }
- }
-
- public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
- {
- var joinMap = new StatusSignControllerJoinMap();
-
- var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
-
- if (!string.IsNullOrEmpty(joinMapSerialized))
- joinMap = JsonConvert.DeserializeObject(joinMapSerialized);
-
- joinMap.OffsetJoinNumbers(joinStart);
-
- Debug.Console(1, this, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
-
- trilist.SetBoolSigAction(joinMap.RedControl, b => EnableControl(trilist, joinMap, this));
- trilist.SetBoolSigAction(joinMap.GreenControl, b => EnableControl(trilist, joinMap, this));
- trilist.SetBoolSigAction(joinMap.BlueControl, b => EnableControl(trilist, joinMap, this));
-
- trilist.SetUShortSigAction(joinMap.RedLed, u => SetColor(trilist, joinMap, this));
- trilist.SetUShortSigAction(joinMap.GreenLed, u => SetColor(trilist, joinMap, this));
- trilist.SetUShortSigAction(joinMap.BlueLed, u => SetColor(trilist, joinMap, this));
-
- trilist.StringInput[joinMap.Name].StringValue = Name;
-
- IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
- RedLedEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RedControl]);
- BlueLedEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.BlueControl]);
- GreenLedEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.GreenControl]);
-
- RedLedBrightnessFeedback.LinkInputSig(trilist.UShortInput[joinMap.RedLed]);
- BlueLedBrightnessFeedback.LinkInputSig(trilist.UShortInput[joinMap.BlueLed]);
- GreenLedBrightnessFeedback.LinkInputSig(trilist.UShortInput[joinMap.GreenLed]);
- }
-
- private static void EnableControl(BasicTriList triList, StatusSignControllerJoinMap joinMap,
- StatusSignController device)
- {
- var redEnable = triList.BooleanOutput[joinMap.RedControl].BoolValue;
- var greenEnable = triList.BooleanOutput[joinMap.GreenControl].BoolValue;
- var blueEnable = triList.BooleanOutput[joinMap.BlueControl].BoolValue;
- device.EnableLedControl(redEnable, greenEnable, blueEnable);
- }
-
- private static void SetColor(BasicTriList triList, StatusSignControllerJoinMap joinMap,
- StatusSignController device)
- {
- var redBrightness = triList.UShortOutput[joinMap.RedLed].UShortValue;
- var greenBrightness = triList.UShortOutput[joinMap.GreenLed].UShortValue;
- var blueBrightness = triList.UShortOutput[joinMap.BlueLed].UShortValue;
-
- device.SetColor(redBrightness, greenBrightness, blueBrightness);
- }
- }
-
- 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));
- }
- }
+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
+{
+ [Description("Wrapper class for the Crestron StatusSign device")]
+ public class StatusSignController : CrestronGenericBridgeableBaseDevice
+ {
+ private readonly StatusSign _device;
+
+ public BoolFeedback RedLedEnabledFeedback { get; private set; }
+ public BoolFeedback GreenLedEnabledFeedback { get; private set; }
+ public BoolFeedback BlueLedEnabledFeedback { get; private set; }
+
+ public IntFeedback RedLedBrightnessFeedback { get; private set; }
+ public IntFeedback GreenLedBrightnessFeedback { get; private set; }
+ public IntFeedback BlueLedBrightnessFeedback { get; private set; }
+
+ public StatusSignController(string key, string name, GenericBase hardware) : base(key, name, hardware)
+ {
+ _device = hardware as StatusSign;
+
+ RedLedEnabledFeedback =
+ new BoolFeedback(
+ () =>
+ _device.Leds[(uint) StatusSign.Led.eLedColor.Red]
+ .ControlFeedback.BoolValue);
+ GreenLedEnabledFeedback =
+ new BoolFeedback(
+ () =>
+ _device.Leds[(uint) StatusSign.Led.eLedColor.Green]
+ .ControlFeedback.BoolValue);
+ BlueLedEnabledFeedback =
+ new BoolFeedback(
+ () =>
+ _device.Leds[(uint) StatusSign.Led.eLedColor.Blue]
+ .ControlFeedback.BoolValue);
+
+ RedLedBrightnessFeedback =
+ new IntFeedback(() => (int) _device.Leds[(uint) StatusSign.Led.eLedColor.Red].BrightnessFeedback);
+ GreenLedBrightnessFeedback =
+ new IntFeedback(() => (int) _device.Leds[(uint) StatusSign.Led.eLedColor.Green].BrightnessFeedback);
+ BlueLedBrightnessFeedback =
+ new IntFeedback(() => (int) _device.Leds[(uint) StatusSign.Led.eLedColor.Blue].BrightnessFeedback);
+
+ if (_device != null) _device.BaseEvent += _device_BaseEvent;
+ }
+
+ void _device_BaseEvent(GenericBase device, BaseEventArgs args)
+ {
+ switch (args.EventId)
+ {
+ case StatusSign.LedBrightnessFeedbackEventId:
+ RedLedBrightnessFeedback.FireUpdate();
+ GreenLedBrightnessFeedback.FireUpdate();
+ BlueLedBrightnessFeedback.FireUpdate();
+ break;
+ case StatusSign.LedControlFeedbackEventId:
+ RedLedEnabledFeedback.FireUpdate();
+ GreenLedEnabledFeedback.FireUpdate();
+ BlueLedEnabledFeedback.FireUpdate();
+ break;
+ }
+ }
+
+ public void EnableLedControl(bool red, bool green, bool blue)
+ {
+ _device.Leds[(uint) StatusSign.Led.eLedColor.Red].Control.BoolValue = red;
+ _device.Leds[(uint)StatusSign.Led.eLedColor.Green].Control.BoolValue = green;
+ _device.Leds[(uint)StatusSign.Led.eLedColor.Blue].Control.BoolValue = blue;
+ }
+
+ public void SetColor(uint red, uint green, uint blue)
+ {
+ try
+ {
+ _device.Leds[(uint)StatusSign.Led.eLedColor.Red].Brightness =
+ (StatusSign.Led.eBrightnessPercentageValues)SimplSharpDeviceHelper.PercentToUshort(red);
+ }
+ catch (InvalidOperationException)
+ {
+ Debug.Console(1, this, "Error converting value to Red LED brightness. value: {0}", red);
+ }
+ try
+ {
+ _device.Leds[(uint)StatusSign.Led.eLedColor.Green].Brightness =
+ (StatusSign.Led.eBrightnessPercentageValues)SimplSharpDeviceHelper.PercentToUshort(green);
+ }
+ catch (InvalidOperationException)
+ {
+ Debug.Console(1, this, "Error converting value to Green LED brightness. value: {0}", green);
+ }
+
+ try
+ {
+ _device.Leds[(uint)StatusSign.Led.eLedColor.Blue].Brightness =
+ (StatusSign.Led.eBrightnessPercentageValues)SimplSharpDeviceHelper.PercentToUshort(blue);
+ }
+ catch (InvalidOperationException)
+ {
+ Debug.Console(1, this, "Error converting value to Blue LED brightness. value: {0}", blue);
+ }
+ }
+
+ 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/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/Display/DisplayBase.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Display/DisplayBase.cs
index cf317f40..90ca9e05 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Display/DisplayBase.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Display/DisplayBase.cs
@@ -121,24 +121,24 @@ namespace PepperDash.Essentials.Core
var inputNumber = 0;
var inputKeys = new List();
- var joinMap = new DisplayControllerJoinMap();
+ var joinMap = new DisplayControllerJoinMap(joinStart);
var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
if (!string.IsNullOrEmpty(joinMapSerialized))
- joinMap = JsonConvert.DeserializeObject(joinMapSerialized);
-
- joinMap.OffsetJoinNumbers(joinStart);
+ 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].StringValue = 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]);
+ commMonitor.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline.JoinNumber]);
}
var inputNumberFeedback = new IntFeedback(() => inputNumber);
@@ -148,16 +148,16 @@ namespace PepperDash.Essentials.Core
if (twoWayDisplay != null)
{
- trilist.SetBool(joinMap.IsTwoWayDisplay, true);
+ 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]);
+ inputNumberFeedback.LinkInputSig(trilist.UShortInput[joinMap.InputSelect.JoinNumber]);
}
// Power Off
- trilist.SetSigTrueAction(joinMap.PowerOff, () =>
+ trilist.SetSigTrueAction(joinMap.PowerOff.JoinNumber, () =>
{
inputNumber = 102;
inputNumberFeedback.FireUpdate();
@@ -179,10 +179,10 @@ namespace PepperDash.Essentials.Core
}
};
- displayDevice.PowerIsOnFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.PowerOff]);
+ displayDevice.PowerIsOnFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.PowerOff.JoinNumber]);
// PowerOn
- trilist.SetSigTrueAction(joinMap.PowerOn, () =>
+ trilist.SetSigTrueAction(joinMap.PowerOn.JoinNumber, () =>
{
inputNumber = 0;
inputNumberFeedback.FireUpdate();
@@ -190,21 +190,27 @@ namespace PepperDash.Essentials.Core
});
- displayDevice.PowerIsOnFeedback.LinkInputSig(trilist.BooleanInput[joinMap.PowerOn]);
+ displayDevice.PowerIsOnFeedback.LinkInputSig(trilist.BooleanInput[joinMap.PowerOn.JoinNumber]);
- var count = 1;
- foreach (var input in displayDevice.InputPorts)
+ for (int i = 0; i < displayDevice.InputPorts.Count; i++)
{
- inputKeys.Add(input.Key);
- 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++;
+ 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, (a) =>
+ trilist.SetUShortSigAction(joinMap.InputSelect.JoinNumber, (a) =>
{
if (a == 0)
{
@@ -229,17 +235,22 @@ namespace PepperDash.Essentials.Core
var volumeDisplay = displayDevice as IBasicVolumeControls;
if (volumeDisplay == null) return;
- trilist.SetBoolSigAction(joinMap.VolumeUp, volumeDisplay.VolumeUp);
- trilist.SetBoolSigAction(joinMap.VolumeDown, volumeDisplay.VolumeDown);
- trilist.SetSigTrueAction(joinMap.VolumeMute, volumeDisplay.MuteToggle);
+ 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, volumeDisplayWithFeedback.SetVolume);
- volumeDisplayWithFeedback.VolumeLevelFeedback.LinkInputSig(trilist.UShortInput[joinMap.VolumeLevel]);
- volumeDisplayWithFeedback.MuteFeedback.LinkInputSig(trilist.BooleanInput[joinMap.VolumeMute]);
+
+ 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/Lighting/LightingBase.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Lighting/LightingBase.cs
index c22745c0..66e90d97 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Lighting/LightingBase.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Lighting/LightingBase.cs
@@ -72,36 +72,33 @@ namespace PepperDash.Essentials.Core.Lighting
protected GenericLightingJoinMap LinkLightingToApi(LightingBase lightingDevice, BasicTriList trilist, uint joinStart,
string joinMapKey, EiscApiAdvanced bridge)
- {
- var joinMap = new GenericLightingJoinMap();
+ {
+ var joinMap = new GenericLightingJoinMap(joinStart);
var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
if (!string.IsNullOrEmpty(joinMapSerialized))
- joinMap = JsonConvert.DeserializeObject(joinMapSerialized);
-
- joinMap.OffsetJoinNumbers(joinStart);
+ 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, u => lightingDevice.SelectScene(lightingDevice.LightingScenes[u]));
+ // GenericLighitng Actions & FeedBack
+ trilist.SetUShortSigAction(joinMap.SelectScene.JoinNumber, u => lightingDevice.SelectScene(lightingDevice.LightingScenes[u]));
- var sceneIndex = 1;
+ var sceneIndex = 0;
foreach (var scene in lightingDevice.LightingScenes)
- {
- var tempIndex = sceneIndex - 1;
- trilist.SetSigTrueAction((uint)(joinMap.LightingSceneOffset + sceneIndex), () => lightingDevice.SelectScene(lightingDevice.LightingScenes[tempIndex]));
- scene.IsActiveFeedback.LinkInputSig(trilist.BooleanInput[(uint)(joinMap.LightingSceneOffset + sceneIndex)]);
- trilist.StringInput[(uint)(joinMap.LightingSceneOffset + sceneIndex)].StringValue = scene.Name;
- trilist.BooleanInput[(uint)(joinMap.ButtonVisibilityOffset + sceneIndex)].BoolValue = true;
+ {
+ 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;
}
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Monitoring/SystemMonitorController.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Monitoring/SystemMonitorController.cs
index 3f791467..e9d06304 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Monitoring/SystemMonitorController.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Monitoring/SystemMonitorController.cs
@@ -201,30 +201,30 @@ namespace PepperDash.Essentials.Core.Monitoring
}
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
- {
- var joinMap = new SystemMonitorJoinMap();
+ {
+ var joinMap = new SystemMonitorJoinMap(joinStart);
var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
if (!string.IsNullOrEmpty(joinMapSerialized))
- joinMap = JsonConvert.DeserializeObject(joinMapSerialized);
-
- joinMap.OffsetJoinNumbers(joinStart);
+ 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]);
- TimeZoneTextFeedback.LinkInputSig(trilist.StringInput[joinMap.TimeZoneName]);
-
- IoControllerVersionFeedback.LinkInputSig(trilist.StringInput[joinMap.IOControllerVersion]);
- SnmpVersionFeedback.LinkInputSig(trilist.StringInput[joinMap.SnmpAppVersion]);
- BaCnetAppVersionFeedback.LinkInputSig(trilist.StringInput[joinMap.BACnetAppVersion]);
- ControllerVersionFeedback.LinkInputSig(trilist.StringInput[joinMap.ControllerVersion]);
- SerialNumberFeedback.LinkInputSig(trilist.StringInput[joinMap.SerialNumber]);
- ModelFeedback.LinkInputSig(trilist.StringInput[joinMap.Model]);
- UptimeFeedback.LinkInputSig(trilist.StringInput[joinMap.Uptime]);
- LastStartFeedback.LinkInputSig(trilist.StringInput[joinMap.LastBoot]);
+ 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);
@@ -233,65 +233,64 @@ namespace PepperDash.Essentials.Core.Monitoring
}
private static void LinkEthernetInfoJoins(SystemMonitorController systemMonitorController, BasicTriList trilist, SystemMonitorJoinMap joinMap)
- {
- var ethernetSlotJoinStart = joinMap.EthernetStartJoin;
-
+ {
+ uint ethernetSlotJoinStart = 0;
foreach (var fb in systemMonitorController.EthernetStatusFeedbackCollection)
- {
- fb.Value.CurrentIpAddressFeedback.LinkInputSig(trilist.StringInput[ethernetSlotJoinStart + joinMap.CurrentIpAddress]);
- fb.Value.CurrentSubnetMaskFeedback.LinkInputSig(trilist.StringInput[ethernetSlotJoinStart + joinMap.CurrentSubnetMask]);
- fb.Value.CurrentDefaultGatewayFeedback.LinkInputSig(trilist.StringInput[ethernetSlotJoinStart + joinMap.CurrentDefaultGateway]);
- fb.Value.StaticIpAddressFeedback.LinkInputSig(trilist.StringInput[ethernetSlotJoinStart + joinMap.StaticIpAddress]);
- fb.Value.StaticSubnetMaskFeedback.LinkInputSig(trilist.StringInput[ethernetSlotJoinStart + joinMap.StaticSubnetMask]);
- fb.Value.StaticDefaultGatewayFeedback.LinkInputSig(trilist.StringInput[ethernetSlotJoinStart + joinMap.StaticDefaultGateway]);
- fb.Value.HostNameFeedback.LinkInputSig(trilist.StringInput[ethernetSlotJoinStart + joinMap.HostName]);
- fb.Value.MacAddressFeedback.LinkInputSig(trilist.StringInput[ethernetSlotJoinStart + joinMap.MacAddress]);
- fb.Value.DomainFeedback.LinkInputSig(trilist.StringInput[ethernetSlotJoinStart + joinMap.Domain]);
- fb.Value.DnsServerFeedback.LinkInputSig(trilist.StringInput[ethernetSlotJoinStart + joinMap.DnsServer]);
- fb.Value.DhcpStatusFeedback.LinkInputSig(trilist.StringInput[ethernetSlotJoinStart + joinMap.DhcpStatus]);
+ {
+ 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;
+ ethernetSlotJoinStart += joinMap.EthernetOffsetJoin.JoinNumber;
}
}
private static void LinkProgramInfoJoins(SystemMonitorController systemMonitorController, BasicTriList trilist,
SystemMonitorJoinMap joinMap)
- {
- var programSlotJoinStart = joinMap.ProgramStartJoin;
+ {
+ uint programSlotJoinStart = 0;
foreach (var p in systemMonitorController.ProgramStatusFeedbackCollection)
{
- var programNumber = p.Value.Program.Number;
-
- trilist.SetBoolSigAction(programSlotJoinStart + joinMap.ProgramStart,
- b => SystemMonitor.ProgramCollection[programNumber].OperatingState = eProgramOperatingState.Start);
- p.Value.ProgramStartedFeedback.LinkInputSig(trilist.BooleanInput[programSlotJoinStart + joinMap.ProgramStart]);
-
- trilist.SetBoolSigAction(programSlotJoinStart + joinMap.ProgramStop,
- b => SystemMonitor.ProgramCollection[programNumber].OperatingState = eProgramOperatingState.Stop);
- p.Value.ProgramStoppedFeedback.LinkInputSig(trilist.BooleanInput[programSlotJoinStart + joinMap.ProgramStop]);
-
- trilist.SetBoolSigAction(programSlotJoinStart + joinMap.ProgramRegister,
+ 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]);
-
- trilist.SetBoolSigAction(programSlotJoinStart + joinMap.ProgramUnregister,
+ 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]);
-
- p.Value.ProgramNameFeedback.LinkInputSig(trilist.StringInput[programSlotJoinStart + joinMap.ProgramName]);
- p.Value.ProgramCompileTimeFeedback.LinkInputSig(
- trilist.StringInput[programSlotJoinStart + joinMap.ProgramCompiledTime]);
- p.Value.CrestronDataBaseVersionFeedback.LinkInputSig(
- trilist.StringInput[programSlotJoinStart + joinMap.ProgramCrestronDatabaseVersion]);
- p.Value.EnvironmentVersionFeedback.LinkInputSig(
- trilist.StringInput[programSlotJoinStart + joinMap.ProgramEnvironmentVersion]);
- p.Value.AggregatedProgramInfoFeedback.LinkInputSig(
- trilist.StringInput[programSlotJoinStart + joinMap.AggregatedProgramInfo]);
-
- programSlotJoinStart = programSlotJoinStart + joinMap.ProgramOffsetJoin;
+ 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;
}
}
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.csproj b/essentials-framework/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.csproj
index e7a5a8ac..4e3e1b41 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.csproj
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.csproj
@@ -117,6 +117,7 @@
+
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 DM/Essentials_DM/AirMedia/AirMediaController.cs b/essentials-framework/Essentials DM/Essentials_DM/AirMedia/AirMediaController.cs
index 8823ae75..72b4bc4c 100644
--- a/essentials-framework/Essentials DM/Essentials_DM/AirMedia/AirMediaController.cs
+++ b/essentials-framework/Essentials DM/Essentials_DM/AirMedia/AirMediaController.cs
@@ -103,43 +103,43 @@ namespace PepperDash.Essentials.DM.AirMedia
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
{
- var joinMap = new AirMediaControllerJoinMap();
+ var joinMap = new AirMediaControllerJoinMap(joinStart);
var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
if (!string.IsNullOrEmpty(joinMapSerialized))
joinMap = JsonConvert.DeserializeObject(joinMapSerialized);
- joinMap.OffsetJoinNumbers(joinStart);
+ 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].StringValue = Name;
+ trilist.StringInput[joinMap.Name.JoinNumber].StringValue = Name;
var commMonitor = this as ICommunicationMonitor;
- commMonitor.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
+ commMonitor.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline.JoinNumber]);
- IsInSessionFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IsInSession]);
- HdmiVideoSyncDetectedFeedback.LinkInputSig(trilist.BooleanInput[joinMap.HdmiVideoSync]);
+ IsInSessionFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IsInSession.JoinNumber]);
+ HdmiVideoSyncDetectedFeedback.LinkInputSig(trilist.BooleanInput[joinMap.HdmiVideoSync.JoinNumber]);
- trilist.SetSigTrueAction(joinMap.AutomaticInputRoutingEnabled, AirMedia.DisplayControl.EnableAutomaticRouting);
- trilist.SetSigFalseAction(joinMap.AutomaticInputRoutingEnabled, AirMedia.DisplayControl.DisableAutomaticRouting);
- AutomaticInputRoutingEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.AutomaticInputRoutingEnabled]);
+ 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, (u) => SelectVideoOut(u));
+ trilist.SetUShortSigAction(joinMap.VideoOut.JoinNumber, (u) => SelectVideoOut(u));
- VideoOutFeedback.LinkInputSig(trilist.UShortInput[joinMap.VideoOut]);
- ErrorFeedback.LinkInputSig(trilist.UShortInput[joinMap.ErrorFB]);
- NumberOfUsersConnectedFeedback.LinkInputSig(trilist.UShortInput[joinMap.NumberOfUsersConnectedFB]);
+ 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, (u) => AirMedia.AirMedia.LoginCode.UShortValue = u);
- LoginCodeFeedback.LinkInputSig(trilist.UShortInput[joinMap.LoginCode]);
+ trilist.SetUShortSigAction(joinMap.LoginCode.JoinNumber, (u) => AirMedia.AirMedia.LoginCode.UShortValue = u);
+ LoginCodeFeedback.LinkInputSig(trilist.UShortInput[joinMap.LoginCode.JoinNumber]);
- ConnectionAddressFeedback.LinkInputSig(trilist.StringInput[joinMap.ConnectionAddressFB]);
- HostnameFeedback.LinkInputSig(trilist.StringInput[joinMap.HostnameFB]);
- SerialNumberFeedback.LinkInputSig(trilist.StringInput[joinMap.SerialNumberFeedback]);
+ 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)
diff --git a/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmBladeChassisController.cs b/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmBladeChassisController.cs
index 5ce95c93..5e9c3151 100644
--- a/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmBladeChassisController.cs
+++ b/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmBladeChassisController.cs
@@ -573,27 +573,27 @@ namespace PepperDash.Essentials.DM {
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
{
- var joinMap = new DmBladeChassisControllerJoinMap();
+ var joinMap = new DmBladeChassisControllerJoinMap(joinStart);
var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
if (!string.IsNullOrEmpty(joinMapSerialized))
joinMap = JsonConvert.DeserializeObject(joinMapSerialized);
-
- joinMap.OffsetJoinNumbers(joinStart);
+ bridge.AddJoinMap(Key, joinMap);
Debug.Console(1, this, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
- IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
+ 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 + ioSlot, o => ExecuteSwitch(o, ioSlot, eRoutingSignalType.Video));
+ trilist.SetUShortSigAction(joinMap.OutputVideo.JoinNumber + ioSlotJoin, o => ExecuteSwitch(o, ioSlot, eRoutingSignalType.Video));
if (TxDictionary.ContainsKey(ioSlot))
{
@@ -605,33 +605,33 @@ namespace PepperDash.Essentials.DM {
if (Chassis is DmMd128x128 || Chassis is DmMd64x64)
{
- InputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.InputEndpointOnline + ioSlot]);
+ InputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.InputEndpointOnline.JoinNumber + ioSlotJoin]);
}
else
{
if (advancedTxDevice != null)
{
- advancedTxDevice.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.InputEndpointOnline + ioSlot]);
+ 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 + ioSlot]);
+ InputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.InputEndpointOnline.JoinNumber + ioSlotJoin]);
}
}
if (basicTxDevice != null && advancedTxDevice == null)
- trilist.BooleanInput[joinMap.TxAdvancedIsPresent + ioSlot].BoolValue = true;
+ trilist.BooleanInput[joinMap.TxAdvancedIsPresent.JoinNumber + ioSlotJoin].BoolValue = true;
if (advancedTxDevice != null)
{
- advancedTxDevice.AnyVideoInput.VideoStatus.VideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.VideoSyncStatus + ioSlot]);
+ 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 + ioSlot]);
+ VideoInputSyncFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.VideoSyncStatus.JoinNumber + ioSlotJoin]);
var inputPort = InputPorts[string.Format("inputCard{0}--hdmiIn", ioSlot)];
if (inputPort != null)
@@ -649,15 +649,15 @@ namespace PepperDash.Essentials.DM {
if (hdmiInPortWCec.HdcpSupportedLevel != eHdcpSupportedLevel.Unknown)
{
- SetHdcpStateAction(true, hdmiInPortWCec, joinMap.HdcpSupportState + ioSlot, trilist);
+ SetHdcpStateAction(true, hdmiInPortWCec, joinMap.HdcpSupportState.JoinNumber + ioSlotJoin, trilist);
}
- InputCardHdcpCapabilityFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.HdcpSupportState + ioSlot]);
+ InputCardHdcpCapabilityFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.HdcpSupportState.JoinNumber + ioSlotJoin]);
if (InputCardHdcpCapabilityTypes.ContainsKey(ioSlot))
- trilist.UShortInput[joinMap.HdcpSupportCapability + ioSlot].UShortValue = (ushort)InputCardHdcpCapabilityTypes[ioSlot];
+ trilist.UShortInput[joinMap.HdcpSupportCapability.JoinNumber + ioSlotJoin].UShortValue = (ushort)InputCardHdcpCapabilityTypes[ioSlot];
else
- trilist.UShortInput[joinMap.HdcpSupportCapability + ioSlot].UShortValue = 1;
+ trilist.UShortInput[joinMap.HdcpSupportCapability.JoinNumber + ioSlotJoin].UShortValue = 1;
}
}
}
@@ -675,14 +675,14 @@ namespace PepperDash.Essentials.DM {
var dmInPortWCec = port as DMInputPortWithCec;
- SetHdcpStateAction(PropertiesConfig.InputSlotSupportsHdcp2[ioSlot], dmInPortWCec, joinMap.HdcpSupportState + ioSlot, trilist);
+ SetHdcpStateAction(PropertiesConfig.InputSlotSupportsHdcp2[ioSlot], dmInPortWCec, joinMap.HdcpSupportState.JoinNumber + ioSlotJoin, trilist);
- InputCardHdcpCapabilityFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.HdcpSupportState + ioSlot]);
+ InputCardHdcpCapabilityFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.HdcpSupportState.JoinNumber + ioSlotJoin]);
if (InputCardHdcpCapabilityTypes.ContainsKey(ioSlot))
- trilist.UShortInput[joinMap.HdcpSupportCapability + ioSlot].UShortValue = (ushort)InputCardHdcpCapabilityTypes[ioSlot];
+ trilist.UShortInput[joinMap.HdcpSupportCapability.JoinNumber + ioSlotJoin].UShortValue = (ushort)InputCardHdcpCapabilityTypes[ioSlot];
else
- trilist.UShortInput[joinMap.HdcpSupportCapability + ioSlot].UShortValue = 1;
+ trilist.UShortInput[joinMap.HdcpSupportCapability.JoinNumber + ioSlotJoin].UShortValue = 1;
}
}
}
@@ -690,7 +690,7 @@ namespace PepperDash.Essentials.DM {
}
else
{
- VideoInputSyncFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.VideoSyncStatus + ioSlot]);
+ VideoInputSyncFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.VideoSyncStatus.JoinNumber + ioSlotJoin]);
var inputPort = InputPorts[string.Format("inputCard{0}--hdmiIn", ioSlot)];
if (inputPort != null)
@@ -699,8 +699,8 @@ namespace PepperDash.Essentials.DM {
if (hdmiPort != null)
{
- SetHdcpStateAction(true, hdmiPort, joinMap.HdcpSupportState + ioSlot, trilist);
- InputCardHdcpCapabilityFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.HdcpSupportState + ioSlot]);
+ SetHdcpStateAction(true, hdmiPort, joinMap.HdcpSupportState.JoinNumber + ioSlotJoin, trilist);
+ InputCardHdcpCapabilityFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.HdcpSupportState.JoinNumber + ioSlotJoin]);
}
}
}
@@ -711,7 +711,7 @@ namespace PepperDash.Essentials.DM {
//var rxDevice = DeviceManager.GetDeviceForKey(rxKey) as DmRmcControllerBase;
//var hdBaseTDevice = DeviceManager.GetDeviceForKey(rxKey) as DmHdBaseTControllerBase;
//if (hdBaseTDevice != null) {
- OutputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.OutputEndpointOnline + ioSlot]);
+ OutputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.OutputEndpointOnline.JoinNumber + ioSlotJoin]);
//}
//else if (rxDevice != null) {
// rxDevice.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.OutputEndpointOnline + ioSlot]);
@@ -719,12 +719,12 @@ namespace PepperDash.Essentials.DM {
}
// Feedback
- VideoOutputFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.OutputVideo + ioSlot]);
+ VideoOutputFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.OutputVideo.JoinNumber + ioSlotJoin]);
- OutputNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputNames + ioSlot]);
- InputNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.InputNames + ioSlot]);
- OutputVideoRouteNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputCurrentVideoInputNames + ioSlot]);
+ 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]);
}
}
diff --git a/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmChassisController.cs b/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmChassisController.cs
index 789116e7..b0d4682d 100644
--- a/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmChassisController.cs
+++ b/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmChassisController.cs
@@ -1,1324 +1,1433 @@
-
-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 128x128")]
- 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 == "dmc4kzhdo")
- {
- var outputCard = new Dmc4kzHdoSingle(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();
-
- var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
-
- if (!string.IsNullOrEmpty(joinMapSerialized))
- joinMap = JsonConvert.DeserializeObject(joinMapSerialized);
-
-
- joinMap.OffsetJoinNumbers(joinStart);
-
- Debug.Console(1, this, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
-
- var chassis = Chassis as DmMDMnxn;
-
- IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
-
- trilist.SetUShortSigAction(joinMap.SystemId, o =>
- {
- if (chassis != null)
- chassis.SystemId.UShortValue = o;
- });
-
- trilist.SetSigTrueAction(joinMap.SystemId, () => {
- if (chassis != null) chassis.ApplySystemId();
- });
-
- SystemIdFeebdack.LinkInputSig(trilist.UShortInput[joinMap.SystemId]);
- SystemIdBusyFeedback.LinkInputSig(trilist.BooleanInput[joinMap.SystemId]);
-
- // Link up outputs
- for (uint i = 1; i <= Chassis.NumberOfOutputs; i++)
- {
- var ioSlot = i;
-
- // Control
- trilist.SetUShortSigAction(joinMap.OutputVideo + ioSlot, o => ExecuteSwitch(o, ioSlot, eRoutingSignalType.Video));
- trilist.SetUShortSigAction(joinMap.OutputAudio + ioSlot, o => ExecuteSwitch(o, ioSlot, eRoutingSignalType.Audio));
- trilist.SetUShortSigAction(joinMap.OutputUsb + ioSlot, o => ExecuteSwitch(o, ioSlot, eRoutingSignalType.UsbOutput));
- trilist.SetUShortSigAction(joinMap.InputUsb + ioSlot, 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 + 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 (InputEndpointOnlineFeedbacks[ioSlot] != null)
- {
- Debug.Console(2, "Linking Tx Online Feedback from Input Card {0}", ioSlot);
- 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);
- VideoInputSyncFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.VideoSyncStatus + ioSlot]);
-
- 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 + ioSlot, trilist);
- }
-
- InputCardHdcpCapabilityFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.HdcpSupportState + ioSlot]);
-
- if (InputCardHdcpCapabilityTypes.ContainsKey(ioSlot))
- trilist.UShortInput[joinMap.HdcpSupportCapability + ioSlot].UShortValue = (ushort)InputCardHdcpCapabilityTypes[ioSlot];
- else
- trilist.UShortInput[joinMap.HdcpSupportCapability + ioSlot].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 + ioSlot, trilist);
- }
-
- InputCardHdcpCapabilityFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.HdcpSupportState + ioSlot]);
-
- if (InputCardHdcpCapabilityTypes.ContainsKey(ioSlot))
- trilist.UShortInput[joinMap.HdcpSupportCapability + ioSlot].UShortValue = (ushort)InputCardHdcpCapabilityTypes[ioSlot];
- else
- trilist.UShortInput[joinMap.HdcpSupportCapability + ioSlot].UShortValue = 1;
- }
- }
- }
- }
- }
- else
- {
- VideoInputSyncFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.VideoSyncStatus + ioSlot]);
-
- 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 + ioSlot, trilist);
- InputCardHdcpCapabilityFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.HdcpSupportState + ioSlot]);
- }
- }
- }
-
- 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 + ioSlot]);
- }
- else if (rxDevice != null)
- {
- rxDevice.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.OutputEndpointOnline + ioSlot]);
- }
- }
-
- // Feedback
- VideoOutputFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.OutputVideo + ioSlot]);
- AudioOutputFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.OutputAudio + ioSlot]);
- UsbOutputRoutedToFeebacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.OutputUsb + ioSlot]);
- UsbInputRoutedToFeebacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.InputUsb + ioSlot]);
-
- OutputNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputNames + ioSlot]);
- InputNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.InputNames + ioSlot]);
- OutputVideoRouteNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputCurrentVideoInputNames + ioSlot]);
- OutputAudioRouteNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputCurrentAudioInputNames + ioSlot]);
-
- OutputDisabledByHdcpFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.OutputDisabledByHdcp + ioSlot]);
- }
- }
-
- 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;
- }
- }
-
-}
-
+
+using System;
+using System.Collections.Generic;
+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 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 BoolFeedback EnableAudioBreakawayFeedback { get; private set; }
+ public BoolFeedback EnableUsbBreakawayFeedback { 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; });
+ EnableAudioBreakawayFeedback =
+ new BoolFeedback(() => (Chassis as DmMDMnxn).EnableAudioBreakawayFeedback.BoolValue);
+ EnableUsbBreakawayFeedback =
+ new BoolFeedback(() => (Chassis as DmMDMnxn).EnableUSBBreakawayFeedback.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;
+ });
+ }
+ }
+ }
+
+ private void ChassisOnBaseEvent(GenericBase device, BaseEventArgs args)
+ {
+
+ }
+
+ ///
+ ///
+ ///
+ ///
+ ///
+ 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;
+ }
+ case DMSystemEventIds.AudioBreakawayEventId:
+ {
+ Debug.Console(2, this, "AudioBreakaway Event: value: {0}",
+ (Chassis as DmMDMnxn).EnableAudioBreakawayFeedback.BoolValue);
+ EnableAudioBreakawayFeedback.FireUpdate();
+ break;
+ }
+ case DMSystemEventIds.USBBreakawayEventId:
+ {
+ Debug.Console(2, this, "USBBreakaway Event: value: {0}",
+ (Chassis as DmMDMnxn).EnableUSBBreakawayFeedback.BoolValue);
+ EnableUsbBreakawayFeedback.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;
+
+
+ EnableAudioBreakawayFeedback.FireUpdate();
+ EnableUsbBreakawayFeedback.FireUpdate();
+
+ 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);
+
+ var chassisSize = (uint) Chassis.NumberOfInputs; //need this to determine USB routing values 8x8 -> 1-8 is inputs 1-8, 17-24 is outputs 1-8
+ //16x16 1-16 is inputs 1-16, 17-32 is outputs 1-16
+ //32x32 1-32 is inputs 1-32, 33-64 is outputs 1-32
+
+ // 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)
+ {
+ //using base here because USB can be routed between 2 output cards or 2 input cards
+ DMInputOutputBase dmCard;
+
+ Debug.Console(2, this, "Executing USB Output switch.\r\n in:{0} output: {1}", input, output);
+
+ if (input > chassisSize)
+ {
+ //wanting to route an output to an output. Subtract chassis size and get output, unless it's 8x8
+ //need this to determine USB routing values
+ //8x8 -> 1-8 is inputs 1-8, 17-24 is outputs 1-8
+ //16x16 1-16 is inputs 1-16, 17-32 is outputs 1-16
+ //32x32 1-32 is inputs 1-32, 33-64 is outputs 1-32
+ uint outputIndex;
+
+ if (chassisSize == 8)
+ {
+ outputIndex = input - 16;
+ }
+ else
+ {
+ outputIndex = input - chassisSize;
+ }
+ dmCard = Chassis.Outputs[outputIndex];
+ }
+ else
+ {
+ dmCard = inCard;
+ }
+ Chassis.USBEnter.BoolValue = true;
+ if (Chassis.Outputs[output] != null)
+ {
+ Debug.Console(2, this, "Routing USB for input {0} to {1}", Chassis.Outputs[input], dmCard);
+ Chassis.Outputs[output].USBRoutedTo = dmCard;
+ }
+ }
+
+ if ((sigType & eRoutingSignalType.UsbInput) == eRoutingSignalType.UsbInput)
+ {
+ //using base here because USB can be routed between 2 output cards or 2 input cards
+ DMInputOutputBase dmCard;
+
+ Debug.Console(2, this, "Executing USB Input switch.\r\n in:{0} output: {1}", input, output);
+
+ if (output > chassisSize)
+ {
+ //wanting to route an input to an output. Subtract chassis size and get output, unless it's 8x8
+ //need this to determine USB routing values
+ //8x8 -> 1-8 is inputs 1-8, 17-24 is outputs 1-8
+ //16x16 1-16 is inputs 1-16, 17-32 is outputs 1-16
+ //32x32 1-32 is inputs 1-32, 33-64 is outputs 1-32
+ uint outputIndex;
+
+ if (chassisSize == 8)
+ {
+ outputIndex = input - 16;
+ }
+ else
+ {
+ outputIndex = input - chassisSize;
+ }
+ dmCard = Chassis.Outputs[outputIndex];
+ }
+ else
+ {
+ dmCard = Chassis.Inputs[input];
+ }
+
+
+
+ Chassis.USBEnter.BoolValue = true;
+
+ if (Chassis.Inputs[output] == null)
+ {
+ return;
+ }
+ Debug.Console(2, this, "Routing USB for input {0} to {1}", Chassis.Inputs[output], dmCard);
+ Chassis.Inputs[output].USBRoutedTo = dmCard;
+ }
+ }
+ #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]);
+
+ EnableAudioBreakawayFeedback.LinkInputSig(trilist.BooleanInput[joinMap.EnableAudioBreakaway.JoinNumber]);
+ EnableUsbBreakawayFeedback.LinkInputSig(trilist.BooleanInput[joinMap.EnableUsbBreakaway.JoinNumber]);
+
+ trilist.OnlineStatusChange += (o, a) =>
+ {
+ if (!a.DeviceOnLine) return;
+
+ EnableAudioBreakawayFeedback.FireUpdate();
+ EnableUsbBreakawayFeedback.FireUpdate();
+ SystemIdBusyFeedback.FireUpdate();
+ SystemIdFeebdack.FireUpdate();
+ };
+
+ // 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 d330d650..cc7fd7e4 100644
--- a/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmpsAudioOutputController.cs
+++ b/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmpsAudioOutputController.cs
@@ -103,36 +103,36 @@ namespace PepperDash.Essentials.DM
}
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
- {
- var joinMap = new DmpsAudioOutputControllerJoinMap();
+ {
+ var joinMap = new DmpsAudioOutputControllerJoinMap(joinStart);
var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
if (!string.IsNullOrEmpty(joinMapSerialized))
- joinMap = JsonConvert.DeserializeObject(joinMapSerialized);
-
- joinMap.OffsetJoinNumbers(joinStart);
+ 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.MasterVolume);
+ SetUpDmpsAudioOutputJoins(trilist, MasterVolumeLevel, joinMap.MasterVolumeLevel.JoinNumber);
}
if (SourceVolumeLevel != null)
{
- SetUpDmpsAudioOutputJoins(trilist, SourceVolumeLevel, joinMap.SourceVolume);
+ SetUpDmpsAudioOutputJoins(trilist, SourceVolumeLevel, joinMap.SourceVolumeLevel.JoinNumber);
}
if (Codec1VolumeLevel != null)
{
- SetUpDmpsAudioOutputJoins(trilist, Codec1VolumeLevel, joinMap.Codec1Volume);
+ SetUpDmpsAudioOutputJoins(trilist, Codec1VolumeLevel, joinMap.Codec1VolumeLevel.JoinNumber);
}
if (Codec2VolumeLevel != null)
{
- SetUpDmpsAudioOutputJoins(trilist, Codec2VolumeLevel, joinMap.Codec2Volume);
+ SetUpDmpsAudioOutputJoins(trilist, Codec2VolumeLevel, joinMap.Codec2VolumeLevel.JoinNumber);
}
}
diff --git a/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmpsRoutingController.cs b/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmpsRoutingController.cs
index 4c4b256d..7d8ba747 100644
--- a/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmpsRoutingController.cs
+++ b/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmpsRoutingController.cs
@@ -155,15 +155,15 @@ namespace PepperDash.Essentials.DM
}
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
- {
- var joinMap = new DmpsRoutingControllerJoinMap();
+ {
+ var joinMap = new DmpsRoutingControllerJoinMap(joinStart);
var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
if (!string.IsNullOrEmpty(joinMapSerialized))
- joinMap = JsonConvert.DeserializeObject(joinMapSerialized);
-
- joinMap.OffsetJoinNumbers(joinStart);
+ joinMap = JsonConvert.DeserializeObject(joinMapSerialized);
+
+ bridge.AddJoinMap(Key, joinMap);
Debug.Console(1, this, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
@@ -172,7 +172,8 @@ namespace PepperDash.Essentials.DM
{
Debug.Console(2, this, "Linking Input Card {0}", i);
- var ioSlot = i;
+ var ioSlot = i;
+ var ioSlotJoin = ioSlot - 1;
//if (TxDictionary.ContainsKey(ioSlot))
//{
@@ -190,13 +191,13 @@ namespace PepperDash.Essentials.DM
// // dmChassis.VideoInputSyncFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[ApiMap.TxVideoSyncStatus[ioSlot]]);
//}
- if (VideoInputSyncFeedbacks[ioSlot] != null)
- VideoInputSyncFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.VideoSyncStatus + 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 + ioSlot]);
-
- trilist.SetStringSigAction(joinMap.InputNames + ioSlot, new Action(s =>
+ 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;
@@ -209,20 +210,22 @@ namespace PepperDash.Essentials.DM
}));
- if (InputEndpointOnlineFeedbacks[ioSlot] != null)
- InputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.InputEndpointOnline + ioSlot]);
+ 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;
- // Control
- trilist.SetUShortSigAction(joinMap.OutputVideo + ioSlot, o => ExecuteSwitch(o, ioSlot, eRoutingSignalType.Video));
- trilist.SetUShortSigAction(joinMap.OutputAudio + ioSlot, o => ExecuteSwitch(o, ioSlot, eRoutingSignalType.Audio));
+ var ioSlot = i;
+ var ioSlotJoin = ioSlot - 1;
- trilist.SetStringSigAction(joinMap.OutputNames + ioSlot, s =>
+ // 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;
@@ -248,18 +251,18 @@ namespace PepperDash.Essentials.DM
});
// Feedback
- if (VideoOutputFeedbacks[ioSlot] != null)
- VideoOutputFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.OutputVideo + ioSlot]);
- if (AudioOutputFeedbacks[ioSlot] != null)
- AudioOutputFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.OutputAudio + ioSlot]);
- if (OutputNameFeedbacks[ioSlot] != null)
- OutputNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputNames + ioSlot]);
- if (OutputVideoRouteNameFeedbacks[ioSlot] != null)
- OutputVideoRouteNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputCurrentVideoInputNames + ioSlot]);
- if (OutputAudioRouteNameFeedbacks[ioSlot] != null)
- OutputAudioRouteNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputCurrentAudioInputNames + ioSlot]);
- if (OutputEndpointOnlineFeedbacks[ioSlot] != null)
- OutputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.OutputEndpointOnline + ioSlot]);
+ 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/DmLite/HdMdxxxCEController.cs b/essentials-framework/Essentials DM/Essentials_DM/DmLite/HdMdxxxCEController.cs
index 59a318cd..4007e9f5 100644
--- a/essentials-framework/Essentials DM/Essentials_DM/DmLite/HdMdxxxCEController.cs
+++ b/essentials-framework/Essentials DM/Essentials_DM/DmLite/HdMdxxxCEController.cs
@@ -222,46 +222,47 @@ namespace PepperDash.Essentials.DM
//public int NumberOfComPorts { get { return 1; } }
//#endregion
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
- {
- var joinMap = new HdMdxxxCEControllerJoinMap();
+ {
+ var joinMap = new HdMdxxxCEControllerJoinMap(joinStart);
var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
if (!string.IsNullOrEmpty(joinMapSerialized))
- joinMap = JsonConvert.DeserializeObject(joinMapSerialized);
-
- joinMap.OffsetJoinNumbers(joinStart);
+ 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]);
- RemoteEndDetectedFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RemoteEndDetected]);
-
- trilist.SetSigTrueAction(joinMap.AutoRouteOn, AutoRouteOn);
- AutoRouteOnFeedback.LinkInputSig(trilist.BooleanInput[joinMap.AutoRouteOn]);
- trilist.SetSigTrueAction(joinMap.AutoRouteOff, AutoRouteOff);
- AutoRouteOnFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.AutoRouteOff]);
-
- trilist.SetSigTrueAction(joinMap.PriorityRoutingOn, PriorityRouteOn);
- PriorityRoutingOnFeedback.LinkInputSig(trilist.BooleanInput[joinMap.PriorityRoutingOn]);
- trilist.SetSigTrueAction(joinMap.PriorityRoutingOff, PriorityRouteOff);
- PriorityRoutingOnFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.PriorityRoutingOff]);
-
- trilist.SetSigTrueAction(joinMap.InputOnScreenDisplayEnabled, OnScreenDisplayEnable);
- InputOnScreenDisplayEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.InputOnScreenDisplayEnabled]);
- trilist.SetSigTrueAction(joinMap.AutoRouteOff, OnScreenDisplayDisable);
- InputOnScreenDisplayEnabledFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.InputOnScreenDisplayDisabled]);
-
- trilist.SetUShortSigAction(joinMap.VideoSource, (i) => ExecuteSwitch(i, null, eRoutingSignalType.Video | eRoutingSignalType.Audio));
- VideoSourceFeedback.LinkInputSig(trilist.UShortInput[joinMap.VideoSource]);
-
- trilist.UShortInput[joinMap.SourceCount].UShortValue = (ushort)InputPorts.Count;
+ 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);
- SyncDetectedFeedbacks[number].LinkInputSig(trilist.BooleanInput[joinMap.SyncDetected + number]);
- trilist.StringInput[joinMap.SourceNames + number].StringValue = input.Key;
+ 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;
}
}
}
diff --git a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/DGEs/DgeController.cs b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/DGEs/Dge100Controller.cs
similarity index 60%
rename from essentials-framework/Essentials DM/Essentials_DM/Endpoints/DGEs/DgeController.cs
rename to essentials-framework/Essentials DM/Essentials_DM/Endpoints/DGEs/Dge100Controller.cs
index 6b586ac3..4a335c39 100644
--- a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/DGEs/DgeController.cs
+++ b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/DGEs/Dge100Controller.cs
@@ -4,33 +4,39 @@ using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro;
-using Crestron.SimplSharpPro.UI;
+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 DgeController : CrestronGenericBaseDevice, IComPorts, IIROutputPorts
- {
- public Dge100 DigitalGraphicsEngine { get; private set; }
-
- public DeviceConfig DeviceConfig { get; private set; }
+ public class Dge100Controller : CrestronGenericBaseDevice, IComPorts, IIROutputPorts, IHasBasicTriListWithSmartObject, ICec
+ {
+ private readonly Dge100 _dge;
+
+ public BasicTriListWithSmartObject Panel { get { return _dge; } }
+
+ private DeviceConfig _dc;
CrestronTouchpanelPropertiesConfig PropertiesConfig;
- public DgeController(string key, string name, Dge100 device, DeviceConfig dc, CrestronTouchpanelPropertiesConfig props)
+ public Dge100Controller(string key, string name, Dge100 device, DeviceConfig dc, CrestronTouchpanelPropertiesConfig props)
:base(key, name, device)
{
- DigitalGraphicsEngine = device;
+ _dge = device;
- DeviceConfig = dc;
+ _dc = dc;
PropertiesConfig = props;
}
@@ -39,12 +45,12 @@ namespace PepperDash.Essentials.DM.Endpoints.DGEs
public CrestronCollection ComPorts
{
- get { return DigitalGraphicsEngine.ComPorts; }
+ get { return _dge.ComPorts; }
}
public int NumberOfComPorts
{
- get { return DigitalGraphicsEngine.NumberOfComPorts; }
+ get { return _dge.NumberOfComPorts; }
}
#endregion
@@ -53,22 +59,27 @@ namespace PepperDash.Essentials.DM.Endpoints.DGEs
public CrestronCollection IROutputPorts
{
- get { return DigitalGraphicsEngine.IROutputPorts; }
+ get { return _dge.IROutputPorts; }
}
public int NumberOfIROutputPorts
{
- get { return DigitalGraphicsEngine.NumberOfIROutputPorts; }
+ get { return _dge.NumberOfIROutputPorts; }
}
+ #endregion
+
+ #region ICec Members
+ public Cec StreamCec { get { return _dge.HdmiOut.StreamCec; } }
#endregion
+
}
- public class DgeControllerFactory : EssentialsDeviceFactory
+ public class Dge100ControllerFactory : EssentialsDeviceFactory
{
- public DgeControllerFactory()
+ public Dge100ControllerFactory()
{
- TypeNames = new List() { "dge100", "dmdge200c" };
+ TypeNames = new List() { "dge100" };
}
public override EssentialsDevice BuildDevice(DeviceConfig dc)
@@ -77,13 +88,11 @@ namespace PepperDash.Essentials.DM.Endpoints.DGEs
var comm = CommFactory.GetControlPropertiesConfig(dc);
var props = JsonConvert.DeserializeObject(dc.Properties.ToString());
- Debug.Console(1, "Factory Attempting to create new DgeControllerm Device");
+ Debug.Console(1, "Factory Attempting to create new DgeController Device");
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)
{
@@ -91,7 +100,7 @@ namespace PepperDash.Essentials.DM.Endpoints.DGEs
return null;
}
- var dgeController = new DgeController(dc.Key + "-comPorts", dc.Name, dgeDevice, dc, props);
+ var dgeController = new Dge100Controller(dc.Key, dc.Name, dgeDevice, dc, props);
return dgeController;
}
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 ef70e4f7..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,12 +1,6 @@
-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;
@@ -21,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
@@ -42,20 +30,15 @@ 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,
+ _rmc = rmc;
+
+ DmIn = new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.AudioVideo,
eRoutingPortConnectionType.DmCat, 0, this);
- HdmiOut = new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
- eRoutingPortConnectionType.Hdmi, null, this);
+ HdmiOut = new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.AudioVideo,
+ eRoutingPortConnectionType.Hdmi, null, this) {Port = _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
- }
-
- public override bool CustomActivate()
- {
- // Base does register and sets up comm monitoring.
- return base.CustomActivate();
+ InputPorts = new RoutingPortCollection {DmIn};
+ OutputPorts = new RoutingPortCollection {HdmiOut};
}
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
@@ -64,17 +47,17 @@ namespace PepperDash.Essentials.DM
}
#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 faff23d4..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,12 +1,6 @@
-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;
@@ -21,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 ;
}
///
@@ -42,59 +37,43 @@ 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();
+ case ConnectedDeviceEventIds.ManufacturerEventId:
+ EdidManufacturerFeedback.FireUpdate();
+ break;
+ case ConnectedDeviceEventIds.NameEventId:
+ EdidNameFeedback.FireUpdate();
+ break;
+ case ConnectedDeviceEventIds.PreferredTimingEventId:
+ EdidPreferredTimingFeedback.FireUpdate();
+ break;
+ case ConnectedDeviceEventIds.SerialNumberEventId:
+ EdidSerialNumberFeedback.FireUpdate();
+ break;
}
- else if (args.EventId == ConnectedDeviceEventIds.NameEventId)
- {
- EdidNameFeedback.FireUpdate();
- }
- else if (args.EventId == ConnectedDeviceEventIds.PreferredTimingEventId)
- {
- EdidPreferredTimingFeedback.FireUpdate();
- }
- else if (args.EventId == ConnectedDeviceEventIds.SerialNumberEventId)
- {
- EdidSerialNumberFeedback.FireUpdate();
- }
- }
-
- 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)
@@ -103,17 +82,17 @@ namespace PepperDash.Essentials.DM
}
#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 44b1af6c..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,9 +1,4 @@
-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;
@@ -21,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;
}
///
@@ -42,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)
@@ -73,47 +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; } }
+ 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 c30b680f..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,9 +1,4 @@
-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;
@@ -21,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
@@ -42,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)
@@ -73,28 +65,21 @@ namespace PepperDash.Essentials.DM
void ConnectedDevice_DeviceInformationChange(ConnectedDeviceInformation connectedDevice, ConnectedDeviceEventArgs args)
{
- if (args.EventId == ConnectedDeviceEventIds.ManufacturerEventId)
+ switch (args.EventId)
{
- EdidManufacturerFeedback.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;
}
- else if (args.EventId == ConnectedDeviceEventIds.NameEventId)
- {
- EdidNameFeedback.FireUpdate();
- }
- else if (args.EventId == ConnectedDeviceEventIds.PreferredTimingEventId)
- {
- EdidPreferredTimingFeedback.FireUpdate();
- }
- else if (args.EventId == ConnectedDeviceEventIds.SerialNumberEventId)
- {
- EdidSerialNumberFeedback.FireUpdate();
- }
- }
-
- 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)
@@ -103,17 +88,17 @@ namespace PepperDash.Essentials.DM
}
#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 c48850c8..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,9 +1,4 @@
-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;
@@ -21,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;
}
///
@@ -42,24 +34,27 @@ namespace PepperDash.Essentials.DM
public DmRmc200SController(string key, string name, DmRmc200S 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;
+ InputPorts = new RoutingPortCollection {DmIn};
+ OutputPorts = new RoutingPortCollection {HdmiOut};
+
+ _rmc.HdmiOutput.OutputStreamChange += HdmiOutput_OutputStreamChange;
+ _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)
@@ -73,47 +68,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; } }
+ 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/DmRmc4KScalerCController.cs b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmc4KScalerCController.cs
index 6595c6e3..850f7458 100644
--- a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmc4KScalerCController.cs
+++ b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmc4KScalerCController.cs
@@ -1,14 +1,9 @@
-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.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Bridges;
@@ -21,21 +16,15 @@ namespace PepperDash.Essentials.DM
public class DmRmc4kScalerCController : DmRmcControllerBase, IRoutingInputsOutputs, IBasicVolumeWithFeedback,
IIROutputPorts, IComPorts, ICec, IRelayPorts
{
- public DmRmc4kScalerC Rmc { get; private set; }
+ private readonly DmRmc4kScalerC _rmc;
public RoutingInputPort DmIn { get; private set; }
public RoutingOutputPort HdmiOut { get; private set; }
public RoutingOutputPort BalancedAudioOut { 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, BalancedAudioOut }; }
- }
+ public RoutingPortCollection OutputPorts { get; private set; }
///
/// Make a Crestron RMC and put it in here
@@ -43,30 +32,35 @@ namespace PepperDash.Essentials.DM
public DmRmc4kScalerCController(string key, string name, DmRmc4kScalerC 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);
BalancedAudioOut = new RoutingOutputPort(DmPortName.BalancedAudioOut, eRoutingSignalType.Audio,
eRoutingPortConnectionType.LineAudio, null, this);
MuteFeedback = new BoolFeedback(() => false);
+
VolumeLevelFeedback = new IntFeedback("MainVolumeLevelFeedback", () =>
rmc.AudioOutput.VolumeFeedback.UShortValue);
- 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, BalancedAudioOut};
- Rmc.HdmiOutput.OutputStreamChange += HdmiOutput_OutputStreamChange;
- Rmc.HdmiOutput.ConnectedDevice.DeviceInformationChange += ConnectedDevice_DeviceInformationChange;
+ VideoOutputResolutionFeedback = new StringFeedback(() => _rmc.HdmiOutput.GetVideoResolutionString());
+
+ _rmc.HdmiOutput.OutputStreamChange += HdmiOutput_OutputStreamChange;
+ _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)
@@ -80,62 +74,55 @@ 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; } }
+ 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
///
/// Gets the CEC stream directly from the HDMI port.
///
- public Cec StreamCec { get { return Rmc.HdmiOutput.StreamCec; } }
+ public Cec StreamCec { get { return _rmc.HdmiOutput.StreamCec; } }
#endregion
#region IRelayPorts Members
public int NumberOfRelayPorts
{
- get { return Rmc.NumberOfRelayPorts; }
+ get { return _rmc.NumberOfRelayPorts; }
}
public CrestronCollection RelayPorts
{
- get { return Rmc.RelayPorts; }
+ get { return _rmc.RelayPorts; }
}
#endregion
@@ -153,6 +140,7 @@ namespace PepperDash.Essentials.DM
///
public void MuteOff()
{
+ Debug.Console(2, this, "DM Endpoint {0} does not have a mute function", Key);
}
///
@@ -160,11 +148,12 @@ namespace PepperDash.Essentials.DM
///
public void MuteOn()
{
+ Debug.Console(2, this, "DM Endpoint {0} does not have a mute function", Key);
}
public void SetVolume(ushort level)
{
- Rmc.AudioOutput.Volume.UShortValue = level;
+ _rmc.AudioOutput.Volume.UShortValue = level;
}
public IntFeedback VolumeLevelFeedback
@@ -182,22 +171,23 @@ namespace PepperDash.Essentials.DM
///
public void MuteToggle()
{
+ Debug.Console(2, this, "DM Endpoint {0} does not have a mute function", Key);
}
public void VolumeDown(bool pressRelease)
{
if (pressRelease)
- SigHelper.RampTimeScaled(Rmc.AudioOutput.Volume, 0, 4000);
+ SigHelper.RampTimeScaled(_rmc.AudioOutput.Volume, 0, 4000);
else
- Rmc.AudioOutput.Volume.StopRamp();
+ _rmc.AudioOutput.Volume.StopRamp();
}
public void VolumeUp(bool pressRelease)
{
if (pressRelease)
- SigHelper.RampTimeScaled(Rmc.AudioOutput.Volume, 65535, 4000);
+ SigHelper.RampTimeScaled(_rmc.AudioOutput.Volume, 65535, 4000);
else
- Rmc.AudioOutput.Volume.StopRamp();
+ _rmc.AudioOutput.Volume.StopRamp();
}
#endregion
diff --git a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmc4k100C1GController.cs b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmc4k100C1GController.cs
index 1ed8eb26..b2762c97 100644
--- a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmc4k100C1GController.cs
+++ b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmc4k100C1GController.cs
@@ -1,11 +1,5 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Crestron.SimplSharp;
-using Crestron.SimplSharpPro;
+using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.DM;
-using Crestron.SimplSharpPro.DM.Endpoints;
using Crestron.SimplSharpPro.DM.Endpoints.Receivers;
using PepperDash.Essentials.Core;
@@ -16,44 +10,39 @@ namespace PepperDash.Essentials.DM
public class DmRmc4k100C1GController : DmHdBaseTControllerBase, IRoutingInputsOutputs,
IIROutputPorts, IComPorts, ICec
{
+ private readonly DmRmc4K100C1G _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; }
public DmRmc4k100C1GController(string key, string name, DmRmc4K100C1G 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,
- eRoutingPortConnectionType.Hdmi, null, this);
+ HdmiOut = new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.AudioVideo,
+ eRoutingPortConnectionType.Hdmi, null, this) {Port = _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
+ InputPorts = new RoutingPortCollection {DmIn};
+ OutputPorts = new RoutingPortCollection {HdmiOut};
}
#region IIROutputPorts Members
- public CrestronCollection IROutputPorts { get { return (Rmc as DmRmc4K100C1G).IROutputPorts; } }
- public int NumberOfIROutputPorts { get { return (Rmc as DmRmc4K100C1G).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 as DmRmc4K100C1G).StreamCec; } }
+ public Cec StreamCec { get { return _rmc.StreamCec; } }
#endregion
}
}
\ No newline at end of file
diff --git a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmc4kScalerCDspController.cs b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmc4kScalerCDspController.cs
index 8e52822b..e63ad5de 100644
--- a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmc4kScalerCDspController.cs
+++ b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmc4kScalerCDspController.cs
@@ -1,14 +1,9 @@
-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.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Bridges;
@@ -21,21 +16,15 @@ namespace PepperDash.Essentials.DM
public class DmRmc4kScalerCDspController : DmRmcControllerBase, IRoutingInputsOutputs, IBasicVolumeWithFeedback,
IIROutputPorts, IComPorts, ICec, IRelayPorts
{
- public DmRmc4kScalerCDsp Rmc { get; private set; }
+ private readonly DmRmc4kScalerCDsp _rmc;
public RoutingInputPort DmIn { get; private set; }
public RoutingOutputPort HdmiOut { get; private set; }
public RoutingOutputPort BalancedAudioOut { 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, BalancedAudioOut }; }
- }
+ public RoutingPortCollection OutputPorts { get; private set; }
///
/// Make a Crestron RMC and put it in here
@@ -43,10 +32,11 @@ namespace PepperDash.Essentials.DM
public DmRmc4kScalerCDspController(string key, string name, DmRmc4kScalerCDsp 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);
BalancedAudioOut = new RoutingOutputPort(DmPortName.BalancedAudioOut, eRoutingSignalType.Audio,
eRoutingPortConnectionType.LineAudio, null, this);
@@ -55,18 +45,21 @@ namespace PepperDash.Essentials.DM
VolumeLevelFeedback = new IntFeedback("MainVolumeLevelFeedback", () =>
rmc.AudioOutput.VolumeFeedback.UShortValue);
- 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;
+ InputPorts = new RoutingPortCollection {DmIn};
+ OutputPorts = new RoutingPortCollection {HdmiOut, BalancedAudioOut};
+
+ _rmc.HdmiOutput.OutputStreamChange += HdmiOutput_OutputStreamChange;
+ _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)
@@ -80,28 +73,21 @@ namespace PepperDash.Essentials.DM
void ConnectedDevice_DeviceInformationChange(ConnectedDeviceInformation connectedDevice, ConnectedDeviceEventArgs args)
{
- if (args.EventId == ConnectedDeviceEventIds.ManufacturerEventId)
+ switch (args.EventId)
{
- EdidManufacturerFeedback.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;
}
- else if (args.EventId == ConnectedDeviceEventIds.NameEventId)
- {
- EdidNameFeedback.FireUpdate();
- }
- else if (args.EventId == ConnectedDeviceEventIds.PreferredTimingEventId)
- {
- EdidPreferredTimingFeedback.FireUpdate();
- }
- else if (args.EventId == ConnectedDeviceEventIds.SerialNumberEventId)
- {
- EdidSerialNumberFeedback.FireUpdate();
- }
- }
-
- 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)
@@ -110,32 +96,32 @@ namespace PepperDash.Essentials.DM
}
#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
///
/// Gets the CEC stream directly from the HDMI port.
///
- public Cec StreamCec { get { return Rmc.HdmiOutput.StreamCec; } }
+ public Cec StreamCec { get { return _rmc.HdmiOutput.StreamCec; } }
#endregion
#region IRelayPorts Members
public int NumberOfRelayPorts
{
- get { return Rmc.NumberOfRelayPorts; }
+ get { return _rmc.NumberOfRelayPorts; }
}
public CrestronCollection RelayPorts
{
- get { return Rmc.RelayPorts; }
+ get { return _rmc.RelayPorts; }
}
#endregion
@@ -153,6 +139,7 @@ namespace PepperDash.Essentials.DM
///
public void MuteOff()
{
+ Debug.Console(2, this, "DM Endpoint {0} does not have a mute function", Key);
}
///
@@ -160,11 +147,12 @@ namespace PepperDash.Essentials.DM
///
public void MuteOn()
{
+ Debug.Console(2, this, "DM Endpoint {0} does not have a mute function", Key);
}
public void SetVolume(ushort level)
{
- Rmc.AudioOutput.Volume.UShortValue = level;
+ _rmc.AudioOutput.Volume.UShortValue = level;
}
public IntFeedback VolumeLevelFeedback
@@ -182,22 +170,23 @@ namespace PepperDash.Essentials.DM
///
public void MuteToggle()
{
+ Debug.Console(2, this, "DM Endpoint {0} does not have a mute function", Key);
}
public void VolumeDown(bool pressRelease)
{
if (pressRelease)
- SigHelper.RampTimeScaled(Rmc.AudioOutput.Volume, 0, 4000);
+ SigHelper.RampTimeScaled(_rmc.AudioOutput.Volume, 0, 4000);
else
- Rmc.AudioOutput.Volume.StopRamp();
+ _rmc.AudioOutput.Volume.StopRamp();
}
public void VolumeUp(bool pressRelease)
{
if (pressRelease)
- SigHelper.RampTimeScaled(Rmc.AudioOutput.Volume, 65535, 4000);
+ SigHelper.RampTimeScaled(_rmc.AudioOutput.Volume, 65535, 4000);
else
- Rmc.AudioOutput.Volume.StopRamp();
+ _rmc.AudioOutput.Volume.StopRamp();
}
#endregion
diff --git a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmc4kZ100CController.cs b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmc4kZ100CController.cs
new file mode 100644
index 00000000..946613a8
--- /dev/null
+++ b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmc4kZ100CController.cs
@@ -0,0 +1,62 @@
+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
+{
+ public class DmRmc4kZ100CController : DmRmcX100CController
+ {
+ private readonly DmRmc4kz100C _rmc;
+
+ public DmRmc4kZ100CController(string key, string name, DmRmc4kz100C rmc)
+ : base(key, name, rmc)
+ {
+ _rmc = rmc;
+
+ 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);
+
+ _rmc.HdmiOutput.OutputStreamChange += HdmiOutput_OutputStreamChange;
+ _rmc.HdmiOutput.ConnectedDevice.DeviceInformationChange += ConnectedDevice_DeviceInformationChange;
+ }
+
+ 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)
+ {
+ switch (args.EventId)
+ {
+ 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 void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
+ {
+ LinkDmRmcToApi(this, trilist, joinStart, joinMapKey, bridge);
+ }
+ }
+}
\ No newline at end of file
diff --git a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmc4kZScalerCController.cs b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmc4kZScalerCController.cs
new file mode 100644
index 00000000..81fcf69b
--- /dev/null
+++ b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmc4kZScalerCController.cs
@@ -0,0 +1,137 @@
+using System;
+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;
+using PepperDash.Core;
+
+namespace PepperDash.Essentials.DM
+{
+ public class DmRmc4kZScalerCController : DmRmcControllerBase, IRmcRouting,
+ IIROutputPorts, IComPorts, ICec
+ {
+ private readonly DmRmc4kzScalerC _rmc;
+
+ public RoutingInputPort DmIn { get; private set; }
+ public RoutingInputPort HdmiIn { get; private set; }
+ public RoutingOutputPort HdmiOut { get; private set; }
+
+ ///
+ /// The value of the current video source for the HDMI output on the receiver
+ ///
+ public IntFeedback AudioVideoSourceNumericFeedback { get; private set; }
+
+ public RoutingPortCollection InputPorts { get; private set; }
+
+ public RoutingPortCollection OutputPorts { get; private set; }
+
+ public DmRmc4kZScalerCController(string key, string name, DmRmc4kzScalerC rmc)
+ : base(key, name, rmc)
+ {
+ _rmc = rmc;
+ DmIn = new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.AudioVideo,
+ eRoutingPortConnectionType.DmCat, 0, this);
+ HdmiIn = new RoutingInputPort(DmPortName.HdmiIn, eRoutingSignalType.AudioVideo,
+ eRoutingPortConnectionType.Hdmi, 0, this);
+ 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);
+
+ VideoOutputResolutionFeedback = new StringFeedback(() => _rmc.HdmiOutput.GetVideoResolutionString());
+
+ InputPorts = new RoutingPortCollection {DmIn, HdmiIn};
+ OutputPorts = new RoutingPortCollection {HdmiOut};
+
+ _rmc.HdmiOutput.OutputStreamChange += HdmiOutput_OutputStreamChange;
+ _rmc.HdmiOutput.ConnectedDevice.DeviceInformationChange += ConnectedDevice_DeviceInformationChange;
+
+ // Set Ports for CEC
+ HdmiOut.Port = _rmc.HdmiOutput;
+
+ AudioVideoSourceNumericFeedback = new IntFeedback(() => (ushort)(_rmc.SelectedSourceFeedback));
+ }
+
+ void HdmiOutput_OutputStreamChange(EndpointOutputStream outputStream, EndpointOutputStreamEventArgs args)
+ {
+ if (args.EventId == EndpointOutputStreamEventIds.HorizontalResolutionFeedbackEventId || args.EventId == EndpointOutputStreamEventIds.VerticalResolutionFeedbackEventId ||
+ args.EventId == EndpointOutputStreamEventIds.FramesPerSecondFeedbackEventId)
+ {
+ VideoOutputResolutionFeedback.FireUpdate();
+ }
+
+ if (args.EventId == EndpointOutputStreamEventIds.SelectedSourceFeedbackEventId)
+ {
+ AudioVideoSourceNumericFeedback.FireUpdate();
+ }
+ }
+
+ void ConnectedDevice_DeviceInformationChange(ConnectedDeviceInformation connectedDevice, ConnectedDeviceEventArgs args)
+ {
+ switch (args.EventId)
+ {
+ 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 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; } }
+ #endregion
+
+ #region IComPorts Members
+ public CrestronCollection ComPorts { get { return _rmc.ComPorts; } }
+ public int NumberOfComPorts { get { return _rmc.NumberOfComPorts; } }
+ #endregion
+
+ #region ICec Members
+ ///
+ /// Gets the CEC stream directly from the HDMI port.
+ ///
+ public Cec StreamCec { get { return _rmc.HdmiOutput.StreamCec; } }
+ #endregion
+
+
+ #region IRmcRouting Members
+ public void ExecuteSwitch(object inputSelector, object outputSelector, eRoutingSignalType signalType)
+ {
+ Debug.Console(2, this, "Attempting a route from input {0} to HDMI Output", inputSelector);
+
+ var number = Convert.ToUInt16(inputSelector);
+
+ _rmc.AudioVideoSource = (DmRmc4kzScalerC.eAudioVideoSource)number;
+ }
+
+ public void ExecuteNumericSwitch(ushort inputSelector, ushort outputSelector, eRoutingSignalType signalType)
+ {
+ Debug.Console(2, this, "Attempting a route from input {0} to HDMI Output", inputSelector);
+
+ _rmc.AudioVideoSource = (DmRmc4kzScalerC.eAudioVideoSource)inputSelector;
+ }
+ #endregion
+
+ }
+}
\ No newline at end of file
diff --git a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmcHelper.cs b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmcHelper.cs
index da3e587a..648909fc 100644
--- a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmcHelper.cs
+++ b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmcHelper.cs
@@ -1,307 +1,326 @@
-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.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.DM.Config;
-using PepperDash.Essentials.Core.Config;
-
-namespace PepperDash.Essentials.DM
-{
- [Description("Wrapper class for all DM-RMC variants")]
- public abstract class DmRmcControllerBase : CrestronGenericBridgeableBaseDevice
- {
- public virtual StringFeedback VideoOutputResolutionFeedback { get; protected set; }
- public virtual StringFeedback EdidManufacturerFeedback { get; protected set; }
- public virtual StringFeedback EdidNameFeedback { get; protected set; }
- public virtual StringFeedback EdidPreferredTimingFeedback { get; protected set; }
- public virtual StringFeedback EdidSerialNumberFeedback { get; protected set; }
-
- public DmRmcControllerBase(string key, string name, EndpointReceiverBase device)
- : base(key, name, device)
- {
- // if wired to a chassis, skip registration step in base class
- if (device.DMOutput != null)
- {
- this.PreventRegistration = true;
- }
- AddToFeedbackList(VideoOutputResolutionFeedback, EdidManufacturerFeedback, EdidSerialNumberFeedback, EdidNameFeedback, EdidPreferredTimingFeedback);
- }
-
- protected void LinkDmRmcToApi(DmRmcControllerBase rmc, BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
- {
- var joinMap = new DmRmcControllerJoinMap();
-
- var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
-
- if (!string.IsNullOrEmpty(joinMapSerialized))
- joinMap = JsonConvert.DeserializeObject(joinMapSerialized);
-
- joinMap.OffsetJoinNumbers(joinStart);
-
- Debug.Console(1, rmc, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
-
- rmc.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
- if (rmc.VideoOutputResolutionFeedback != null)
- rmc.VideoOutputResolutionFeedback.LinkInputSig(trilist.StringInput[joinMap.CurrentOutputResolution]);
- if (rmc.EdidManufacturerFeedback != null)
- rmc.EdidManufacturerFeedback.LinkInputSig(trilist.StringInput[joinMap.EdidManufacturer]);
- if (rmc.EdidNameFeedback != null)
- rmc.EdidNameFeedback.LinkInputSig(trilist.StringInput[joinMap.EdidName]);
- if (rmc.EdidPreferredTimingFeedback != null)
- rmc.EdidPreferredTimingFeedback.LinkInputSig(trilist.StringInput[joinMap.EdidPrefferedTiming]);
- if (rmc.EdidSerialNumberFeedback != null)
- rmc.EdidSerialNumberFeedback.LinkInputSig(trilist.StringInput[joinMap.EdidSerialNumber]);
- }
- }
-
- public abstract class DmHdBaseTControllerBase : CrestronGenericBaseDevice
- {
- public HDBaseTBase Rmc { get; protected set; }
-
- ///
- /// Make a Crestron RMC and put it in here
- ///
- public DmHdBaseTControllerBase(string key, string name, HDBaseTBase rmc)
- : base(key, name, rmc)
- {
-
- }
- }
-
- public class DmRmcHelper
- {
- ///
- /// A factory method for various DmTxControllers
- ///
- ///
- ///
- ///
- ///
- public static CrestronGenericBaseDevice GetDmRmcController(string key, string name, string typeName, DmRmcPropertiesConfig props)
- {
- // switch on type name... later...
-
- typeName = typeName.ToLower();
- uint ipid = props.Control.IpIdInt; // Convert.ToUInt16(props.Id, 16);
-
-
-
- // right here, we need to grab the tie line that associates this
- // RMC with a chassis or processor. If the RMC input's tie line is not
- // connected to a chassis, then it's parent is the processor.
- // If the RMC is connected to a chassis, then we need to grab the
- // output number from the tie line and use that to plug it in.
- // Example of chassis-connected:
- //{
- // "sourceKey": "dmMd8x8-1",
- // "sourcePort": "anyOut2",
- // "destinationKey": "dmRmc100C-2",
- // "destinationPort": "DmIn"
- //}
-
- // Tx -> RMC link:
- //{
- // "sourceKey": "dmTx201C-1",
- // "sourcePort": "DmOut",
- // "destinationKey": "dmRmc100C-2",
- // "destinationPort": "DmIn"
- //}
-
- var tlc = TieLineCollection.Default;
- // grab the tie line that has this key as
- // THIS DOESN'T WORK BECAUSE THE RMC THAT WE NEED (THIS) HASN'T BEEN MADE
- // YET AND THUS WILL NOT HAVE A TIE LINE...
- var inputTieLine = tlc.FirstOrDefault(t =>
- {
- var d = t.DestinationPort.ParentDevice;
- return d.Key.Equals(key, StringComparison.OrdinalIgnoreCase)
- && d is DmChassisController;
- });
-
- var pKey = props.ParentDeviceKey.ToLower();
-
-
-
-
- // Non-DM-chassis endpoints
- if (pKey == "processor")
- {
- // Catch constructor failures, mainly dues to IPID
- try
- {
- if (typeName.StartsWith("dmrmc100c"))
- return new DmRmcX100CController(key, name, new DmRmc100C(ipid, Global.ControlSystem));
- if (typeName.StartsWith("dmrmc100s"))
- return new DmRmc100SController(key, name, new DmRmc100S(ipid, Global.ControlSystem));
- if (typeName.StartsWith("dmrmc4k100c"))
- return new DmRmcX100CController(key, name, new DmRmc4k100C(ipid, Global.ControlSystem));
- if (typeName.StartsWith("dmrmc4kz100c"))
- return new DmRmcX100CController(key, name, new DmRmc4kz100C(ipid, Global.ControlSystem));
- if (typeName.StartsWith("dmrmc150s"))
- return new DmRmc150SController(key, name, new DmRmc150S(ipid, Global.ControlSystem));
- if (typeName.StartsWith("dmrmc200c"))
- return new DmRmc200CController(key, name, new DmRmc200C(ipid, Global.ControlSystem));
- if (typeName.StartsWith("dmrmc200s"))
- return new DmRmc200SController(key, name, new DmRmc200S(ipid, Global.ControlSystem));
- if (typeName.StartsWith("dmrmc200s2"))
- return new DmRmc200S2Controller(key, name, new DmRmc200S2(ipid, Global.ControlSystem));
- if (typeName.StartsWith("dmrmcscalerc"))
- return new DmRmcScalerCController(key, name, new DmRmcScalerC(ipid, Global.ControlSystem));
- if (typeName.StartsWith("dmrmcscalers"))
- return new DmRmcScalerSController(key, name, new DmRmcScalerS(ipid, Global.ControlSystem));
- if (typeName.StartsWith("dmrmcscalers2"))
- return new DmRmcScalerS2Controller(key, name, new DmRmcScalerS2(ipid, Global.ControlSystem));
- if (typeName.StartsWith("dmrmc4kscalerc"))
- return new DmRmc4kScalerCController(key, name, new DmRmc4kScalerC(ipid, Global.ControlSystem));
- if (typeName.StartsWith("dmrmc4kscalercdsp"))
- return new DmRmc4kScalerCDspController(key, name, new DmRmc4kScalerCDsp(ipid, Global.ControlSystem));
- }
- catch (Exception e)
- {
- Debug.Console(0, "[{0}] WARNING: Cannot create DM-RMC device: {1}", key, e.Message);
- }
-
-
- Debug.Console(0, "Cannot create DM-RMC of type: '{0}'", typeName);
- }
- // Endpoints attached to DM Chassis
- else
- {
- var parentDev = DeviceManager.GetDeviceForKey(pKey);
- if (!(parentDev is IDmSwitch))
- {
- Debug.Console(0, "Cannot create DM device '{0}'. '{1}' is not a DM Chassis.",
- key, pKey);
- return null;
- }
-
- var chassis = (parentDev as IDmSwitch).Chassis;
- var num = props.ParentOutputNumber;
- if (num <= 0 || num > chassis.NumberOfOutputs)
- {
- Debug.Console(0, "Cannot create DM device '{0}'. Output number '{1}' is out of range",
- key, num);
- return null;
- }
- else
- {
- var controller = (parentDev as IDmSwitch);
- controller.RxDictionary.Add(num, key);
- }
- // Catch constructor failures, mainly dues to IPID
- try
- {
-
- // Must use different constructor for CPU3 chassis types. No IPID
- if (chassis is DmMd8x8Cpu3 || chassis is DmMd16x16Cpu3 ||
- chassis is DmMd32x32Cpu3 || chassis is DmMd8x8Cpu3rps ||
- chassis is DmMd16x16Cpu3rps || chassis is DmMd32x32Cpu3rps ||
- chassis is DmMd128x128 || chassis is DmMd64x64)
- {
- if (typeName.StartsWith("hdbasetrx"))
- return new HDBaseTRxController(key, name, new HDRx3CB(chassis.Outputs[num]));
- if (typeName.StartsWith("dmrmc4k100c1g"))
- return new DmRmc4k100C1GController(key, name, new DmRmc4K100C1G(chassis.Outputs[num]));
- if (typeName.StartsWith("dmrmc100c"))
- return new DmRmcX100CController(key, name, new DmRmc100C(chassis.Outputs[num]));
- if (typeName.StartsWith("dmrmc100s"))
- return new DmRmc100SController(key, name, new DmRmc100S(chassis.Outputs[num]));
- if (typeName.StartsWith("dmrmc4k100c"))
- return new DmRmcX100CController(key, name, new DmRmc4k100C(chassis.Outputs[num]));
- if (typeName.StartsWith("dmrmc4kz100c"))
- return new DmRmcX100CController(key, name, new DmRmc4kz100C(chassis.Outputs[num]));
- if (typeName.StartsWith("dmrmc150s"))
- return new DmRmc150SController(key, name, new DmRmc150S(chassis.Outputs[num]));
- if (typeName.StartsWith("dmrmc200c"))
- return new DmRmc200CController(key, name, new DmRmc200C(chassis.Outputs[num]));
- if (typeName.StartsWith("dmrmc200s"))
- return new DmRmc200SController(key, name, new DmRmc200S(chassis.Outputs[num]));
- if (typeName.StartsWith("dmrmc200s2"))
- return new DmRmc200S2Controller(key, name, new DmRmc200S2(chassis.Outputs[num]));
- if (typeName.StartsWith("dmrmcscalerc"))
- return new DmRmcScalerCController(key, name, new DmRmcScalerC(chassis.Outputs[num]));
- if (typeName.StartsWith("dmrmcscalers"))
- return new DmRmcScalerSController(key, name, new DmRmcScalerS(chassis.Outputs[num]));
- if (typeName.StartsWith("dmrmcscalers2"))
- return new DmRmcScalerS2Controller(key, name, new DmRmcScalerS2(chassis.Outputs[num]));
- if (typeName.StartsWith("dmrmc4kscalerc"))
- return new DmRmc4kScalerCController(key, name, new DmRmc4kScalerC(chassis.Outputs[num]));
- if (typeName.StartsWith("dmrmc4kscalercdsp"))
- return new DmRmc4kScalerCDspController(key, name, new DmRmc4kScalerCDsp(chassis.Outputs[num]));
- }
- else
- {
- if (typeName.StartsWith("hdbasetrx"))
- return new HDBaseTRxController(key, name, new HDRx3CB(ipid, chassis.Outputs[num]));
- if (typeName.StartsWith("dmrmc4k100c1g"))
- return new DmRmc4k100C1GController(key, name, new DmRmc4K100C1G(ipid, chassis.Outputs[num]));
- if (typeName.StartsWith("dmrmc100c"))
- return new DmRmcX100CController(key, name, new DmRmc100C(ipid, chassis.Outputs[num]));
- if (typeName.StartsWith("dmrmc100s"))
- return new DmRmc100SController(key, name, new DmRmc100S(ipid, chassis.Outputs[num]));
- if (typeName.StartsWith("dmrmc4k100c"))
- return new DmRmcX100CController(key, name, new DmRmc4k100C(ipid, chassis.Outputs[num]));
- if (typeName.StartsWith("dmrmc4kz100c"))
- return new DmRmcX100CController(key, name, new DmRmc4kz100C(ipid, chassis.Outputs[num]));
- if (typeName.StartsWith("dmrmc150s"))
- return new DmRmc150SController(key, name, new DmRmc150S(ipid, chassis.Outputs[num]));
- if (typeName.StartsWith("dmrmc200c"))
- return new DmRmc200CController(key, name, new DmRmc200C(ipid, chassis.Outputs[num]));
- if (typeName.StartsWith("dmrmc200s"))
- return new DmRmc200SController(key, name, new DmRmc200S(ipid, chassis.Outputs[num]));
- if (typeName.StartsWith("dmrmc200s2"))
- return new DmRmc200S2Controller(key, name, new DmRmc200S2(ipid, chassis.Outputs[num]));
- if (typeName.StartsWith("dmrmcscalerc"))
- return new DmRmcScalerCController(key, name, new DmRmcScalerC(ipid, chassis.Outputs[num]));
- if (typeName.StartsWith("dmrmcscalers"))
- return new DmRmcScalerSController(key, name, new DmRmcScalerS(ipid, chassis.Outputs[num]));
- if (typeName.StartsWith("dmrmcscalers2"))
- return new DmRmcScalerS2Controller(key, name, new DmRmcScalerS2(ipid, chassis.Outputs[num]));
- if (typeName.StartsWith("dmrmc4kscalerc"))
- return new DmRmc4kScalerCController(key, name, new DmRmc4kScalerC(ipid, chassis.Outputs[num]));
- if (typeName.StartsWith("dmrmc4kscalercdsp"))
- return new DmRmc4kScalerCDspController(key, name, new DmRmc4kScalerCDsp(ipid, chassis.Outputs[num]));
- }
- }
- catch (Exception e)
- {
- Debug.Console(0, "[{0}] WARNING: Cannot create DM-RMC device: {1}", key, e.Message);
- }
- }
-
- return null;
- }
- }
-
- public class DmRmcControllerFactory : EssentialsDeviceFactory
- {
- public DmRmcControllerFactory()
- {
- TypeNames = new List() { "hdbasetrx", "dmrmc4k100c1g", "dmrmc100c", "dmrmc100s", "dmrmc4k100c", "dmrmc150s",
- "dmrmc200c", "dmrmc200s", "dmrmc200s2", "dmrmcscalerc", "dmrmcscalers", "dmrmcscalers2", "dmrmc4kscalerc", "dmrmc4kscalercdsp" };
- }
-
- public override EssentialsDevice BuildDevice(DeviceConfig dc)
- {
- var type = dc.Type.ToLower();
-
- Debug.Console(1, "Factory Attempting to create new DM-RMC Device");
-
- var props = JsonConvert.DeserializeObject
- (dc.Properties.ToString());
- return PepperDash.Essentials.DM.DmRmcHelper.GetDmRmcController(dc.Key, dc.Name, type, props);
-
- }
- }
-
+using System;
+using System.Collections.Generic;
+using Crestron.SimplSharpPro.DeviceSupport;
+using Crestron.SimplSharpPro.DM;
+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 PepperDash.Essentials.Core.Config;
+
+namespace PepperDash.Essentials.DM
+{
+ [Description("Wrapper class for all DM-RMC variants")]
+ public abstract class DmRmcControllerBase : CrestronGenericBridgeableBaseDevice
+ {
+ private readonly EndpointReceiverBase _rmc; //kept here just in case. Only property or method on this class that's not device-specific is the DMOutput that it's attached to.
+
+ public StringFeedback VideoOutputResolutionFeedback { get; protected set; }
+ public StringFeedback EdidManufacturerFeedback { get; protected set; }
+ public StringFeedback EdidNameFeedback { get; protected set; }
+ public StringFeedback EdidPreferredTimingFeedback { get; protected set; }
+ public StringFeedback EdidSerialNumberFeedback { get; protected set; }
+
+ protected DmRmcControllerBase(string key, string name, EndpointReceiverBase device)
+ : base(key, name, device)
+ {
+ _rmc = device;
+ // if wired to a chassis, skip registration step in base class
+ PreventRegistration = _rmc.DMOutput != null;
+
+ AddToFeedbackList(VideoOutputResolutionFeedback, EdidManufacturerFeedback, EdidSerialNumberFeedback, EdidNameFeedback, EdidPreferredTimingFeedback);
+ }
+
+ protected void LinkDmRmcToApi(DmRmcControllerBase rmc, BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
+ {
+ var joinMap = new DmRmcControllerJoinMap(joinStart);
+
+ var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
+
+ if (!string.IsNullOrEmpty(joinMapSerialized))
+ joinMap = JsonConvert.DeserializeObject(joinMapSerialized);
+
+ bridge.AddJoinMap(Key, joinMap);
+
+ Debug.Console(1, rmc, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
+
+ rmc.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline.JoinNumber]);
+ if (rmc.VideoOutputResolutionFeedback != null)
+ rmc.VideoOutputResolutionFeedback.LinkInputSig(trilist.StringInput[joinMap.CurrentOutputResolution.JoinNumber]);
+ if (rmc.EdidManufacturerFeedback != null)
+ rmc.EdidManufacturerFeedback.LinkInputSig(trilist.StringInput[joinMap.EdidManufacturer.JoinNumber]);
+ if (rmc.EdidNameFeedback != null)
+ rmc.EdidNameFeedback.LinkInputSig(trilist.StringInput[joinMap.EdidName.JoinNumber]);
+ if (rmc.EdidPreferredTimingFeedback != null)
+ rmc.EdidPreferredTimingFeedback.LinkInputSig(trilist.StringInput[joinMap.EdidPrefferedTiming.JoinNumber]);
+ if (rmc.EdidSerialNumberFeedback != null)
+ rmc.EdidSerialNumberFeedback.LinkInputSig(trilist.StringInput[joinMap.EdidSerialNumber.JoinNumber]);
+
+ //If the device is an DM-RMC-4K-Z-SCALER-C
+ var routing = rmc as IRmcRouting;
+
+ if (routing == null)
+ {
+ return;
+ }
+
+ if (routing.AudioVideoSourceNumericFeedback != null)
+ routing.AudioVideoSourceNumericFeedback.LinkInputSig(trilist.UShortInput[joinMap.AudioVideoSource.JoinNumber]);
+
+ trilist.SetUShortSigAction(joinMap.AudioVideoSource.JoinNumber, a => routing.ExecuteNumericSwitch(a, 1, eRoutingSignalType.AudioVideo));
+ }
+ }
+
+ public abstract class DmHdBaseTControllerBase : CrestronGenericBaseDevice
+ {
+ protected HDBaseTBase Rmc;
+
+ ///
+ /// Make a Crestron RMC and put it in here
+ ///
+ protected DmHdBaseTControllerBase(string key, string name, HDBaseTBase rmc)
+ : base(key, name, rmc)
+ {
+ Rmc = rmc;
+ }
+ }
+
+ public class DmRmcHelper
+ {
+ private static readonly Dictionary> ProcessorFactoryDict;
+ private static readonly Dictionary> ChassisCpu3Dict;
+
+ private static readonly Dictionary>
+ ChassisDict;
+
+ static DmRmcHelper()
+ {
+ ProcessorFactoryDict = new Dictionary>
+ {
+ {"dmrmc100c", (k, n, i) => new DmRmcX100CController(k, n, new DmRmc100C(i, Global.ControlSystem))},
+ {"dmrmc100s", (k, n, i) => new DmRmc100SController(k, n, new DmRmc100S(i, Global.ControlSystem))},
+ {"dmrmc4k100c", (k, n, i) => new DmRmcX100CController(k, n, new DmRmc4k100C(i, Global.ControlSystem))},
+ {"dmrmc4kz100c", (k, n, i) => new DmRmc4kZ100CController(k, n, new DmRmc4kz100C(i, Global.ControlSystem))},
+ {"dmrmc150s", (k, n, i) => new DmRmc150SController(k, n, new DmRmc150S(i, Global.ControlSystem))},
+ {"dmrmc200c", (k, n, i) => new DmRmc200CController(k, n, new DmRmc200C(i, Global.ControlSystem))},
+ {"dmrmc200s", (k, n, i) => new DmRmc200SController(k, n, new DmRmc200S(i, Global.ControlSystem))},
+ {"dmrmc200s2", (k, n, i) => new DmRmc200S2Controller(k, n, new DmRmc200S2(i, Global.ControlSystem))},
+ {"dmrmcscalerc", (k, n, i) => new DmRmcScalerCController(k, n, new DmRmcScalerC(i, Global.ControlSystem))},
+ {"dmrmcscalers", (k, n, i) => new DmRmcScalerSController(k, n, new DmRmcScalerS(i, Global.ControlSystem))},
+ {
+ "dmrmcscalers2",
+ (k, n, i) => new DmRmcScalerS2Controller(k, n, new DmRmcScalerS2(i, Global.ControlSystem))
+ },
+ {
+ "dmrmc4kscalerc",
+ (k, n, i) => new DmRmc4kScalerCController(k, n, new DmRmc4kScalerC(i, Global.ControlSystem))
+ },
+ {
+ "dmrmc4kscalercdsp",
+ (k, n, i) => new DmRmc4kScalerCDspController(k, n, new DmRmc4kScalerCDsp(i, Global.ControlSystem))
+ },
+ {
+ "dmrmc4kzscalerc",
+ (k, n, i) => new DmRmc4kZScalerCController(k, n, new DmRmc4kzScalerC(i, Global.ControlSystem))
+ }
+ };
+
+ ChassisCpu3Dict = new Dictionary>
+ {
+ {"dmrmc100c", (k, n, d) => new DmRmcX100CController(k, n, new DmRmc100C(d))},
+ {"dmrmc100s", (k, n, d) => new DmRmc100SController(k, n, new DmRmc100S(d))},
+ {"dmrmc4k100c", (k, n, d) => new DmRmcX100CController(k, n, new DmRmc4k100C(d))},
+ {"dmrmc4kz100c", (k, n, d) => new DmRmc4kZ100CController(k, n, new DmRmc4kz100C(d))},
+ {"dmrmc150s", (k, n, d) => new DmRmc150SController(k, n, new DmRmc150S(d))},
+ {"dmrmc200c", (k, n, d) => new DmRmc200CController(k, n, new DmRmc200C(d))},
+ {"dmrmc200s", (k, n, d) => new DmRmc200SController(k, n, new DmRmc200S(d))},
+ {"dmrmc200s2", (k, n, d) => new DmRmc200S2Controller(k, n, new DmRmc200S2(d))},
+ {"dmrmcscalerc", (k, n, d) => new DmRmcScalerCController(k, n, new DmRmcScalerC(d))},
+ {"dmrmcscalers", (k, n, d) => new DmRmcScalerSController(k, n, new DmRmcScalerS(d))},
+ {
+ "dmrmcscalers2",
+ (k, n, d) => new DmRmcScalerS2Controller(k, n, new DmRmcScalerS2(d))
+ },
+ {
+ "dmrmc4kscalerc",
+ (k, n, d) => new DmRmc4kScalerCController(k, n, new DmRmc4kScalerC(d))
+ },
+ {
+ "dmrmc4kscalercdsp",
+ (k, n, d) => new DmRmc4kScalerCDspController(k, n, new DmRmc4kScalerCDsp(d))
+ },
+ {
+ "dmrmc4kzscalerc",
+ (k, n, d) => new DmRmc4kZScalerCController(k, n, new DmRmc4kzScalerC(d))
+ },
+ {"hdbasetrx", (k,n,d) => new HDBaseTRxController(k,n, new HDRx3CB(d))},
+ {"dmrmc4k100c1g", (k,n,d) => new DmRmc4k100C1GController(k,n, new DmRmc4K100C1G(d))}
+ };
+
+ ChassisDict = new Dictionary>
+ {
+ {"dmrmc100c", (k, n, i, d) => new DmRmcX100CController(k, n, new DmRmc100C(i,d))},
+ {"dmrmc100s", (k, n,i, d) => new DmRmc100SController(k, n, new DmRmc100S(i,d))},
+ {"dmrmc4k100c", (k, n,i, d) => new DmRmcX100CController(k, n, new DmRmc4k100C(i,d))},
+ {"dmrmc4kz100c", (k, n,i, d) => new DmRmc4kZ100CController(k, n, new DmRmc4kz100C(i,d))},
+ {"dmrmc150s", (k, n,i, d) => new DmRmc150SController(k, n, new DmRmc150S(i,d))},
+ {"dmrmc200c", (k, n,i, d) => new DmRmc200CController(k, n, new DmRmc200C(i,d))},
+ {"dmrmc200s", (k, n,i, d) => new DmRmc200SController(k, n, new DmRmc200S(i,d))},
+ {"dmrmc200s2", (k, n,i, d) => new DmRmc200S2Controller(k, n, new DmRmc200S2(i,d))},
+ {"dmrmcscalerc", (k, n,i, d) => new DmRmcScalerCController(k, n, new DmRmcScalerC(i,d))},
+ {"dmrmcscalers", (k, n,i, d) => new DmRmcScalerSController(k, n, new DmRmcScalerS(i,d))},
+ {
+ "dmrmcscalers2",
+ (k, n,i, d) => new DmRmcScalerS2Controller(k, n, new DmRmcScalerS2(d))
+ },
+ {
+ "dmrmc4kscalerc",
+ (k, n,i, d) => new DmRmc4kScalerCController(k, n, new DmRmc4kScalerC(d))
+ },
+ {
+ "dmrmc4kscalercdsp",
+ (k, n,i, d) => new DmRmc4kScalerCDspController(k, n, new DmRmc4kScalerCDsp(d))
+ },
+ {
+ "dmrmc4kzscalerc",
+ (k, n,i, d) => new DmRmc4kZScalerCController(k, n, new DmRmc4kzScalerC(d))
+ },
+ {"hdbasetrx", (k,n,i,d) => new HDBaseTRxController(k,n, new HDRx3CB(d))},
+ {"dmrmc4k100c1g", (k,n,i,d) => new DmRmc4k100C1GController(k,n, new DmRmc4K100C1G(d))}
+ };
+ }
+ ///
+ /// A factory method for various DmRmcControllers
+ ///
+ /// device key. Used to uniquely identify device
+ /// device name
+ /// device type name. Used to retrived the correct device
+ /// Config from config file
+ ///
+ public static CrestronGenericBaseDevice GetDmRmcController(string key, string name, string typeName, DmRmcPropertiesConfig props)
+ {
+ typeName = typeName.ToLower();
+ var ipid = props.Control.IpIdInt;
+
+ var pKey = props.ParentDeviceKey.ToLower();
+
+ // Non-DM-chassis endpoints
+ return pKey == "processor" ? GetDmRmcControllerForProcessor(key, name, typeName, ipid) : GetDmRmcControllerForChassis(key, name, typeName, props, pKey, ipid);
+ }
+
+ private static CrestronGenericBaseDevice GetDmRmcControllerForChassis(string key, string name, string typeName,
+ DmRmcPropertiesConfig props, string pKey, uint ipid)
+ {
+ var parentDev = DeviceManager.GetDeviceForKey(pKey);
+ if (!(parentDev is IDmSwitch))
+ {
+ Debug.Console(0, "Cannot create DM device '{0}'. '{1}' is not a DM Chassis.",
+ key, pKey);
+ return null;
+ }
+
+ var chassis = (parentDev as IDmSwitch).Chassis;
+ var num = props.ParentOutputNumber;
+
+ if (num <= 0 || num > chassis.NumberOfOutputs)
+ {
+ Debug.Console(0, "Cannot create DM device '{0}'. Output number '{1}' is out of range",
+ key, num);
+ return null;
+ }
+
+ var controller = parentDev as IDmSwitch;
+ controller.RxDictionary.Add(num, key);
+ // Catch constructor failures, mainly dues to IPID
+ try
+ {
+ // Must use different constructor for CPU3 chassis types. No IPID
+ if (chassis is DmMd8x8Cpu3 || chassis is DmMd16x16Cpu3 ||
+ chassis is DmMd32x32Cpu3 || chassis is DmMd8x8Cpu3rps ||
+ chassis is DmMd16x16Cpu3rps || chassis is DmMd32x32Cpu3rps ||
+ chassis is DmMd128x128 || chassis is DmMd64x64)
+ {
+ return GetDmRmcControllerForCpu3Chassis(key, name, typeName, chassis, num, parentDev);
+ }
+
+ return GetDmRmcControllerForCpu2Chassis(key, name, typeName, ipid, chassis, num, parentDev);
+ }
+ catch (Exception e)
+ {
+ Debug.Console(0, "[{0}] WARNING: Cannot create DM-RMC device: {1}", key, e.Message);
+ return null;
+ }
+ }
+
+ private static CrestronGenericBaseDevice GetDmRmcControllerForCpu2Chassis(string key, string name, string typeName,
+ uint ipid, Switch chassis, uint num, IKeyed parentDev)
+ {
+ Func handler;
+ if (ChassisDict.TryGetValue(typeName.ToLower(), out handler))
+ {
+ return handler(key, name, ipid, chassis.Outputs[num]);
+ }
+ Debug.Console(0, "Cannot create DM-RMC of type '{0}' with parent device {1}", typeName, parentDev.Key);
+ return null;
+ }
+
+ private static CrestronGenericBaseDevice GetDmRmcControllerForCpu3Chassis(string key, string name, string typeName,
+ Switch chassis, uint num, IKeyed parentDev)
+ {
+ Func cpu3Handler;
+ if (ChassisCpu3Dict.TryGetValue(typeName.ToLower(), out cpu3Handler))
+ {
+ return cpu3Handler(key, name, chassis.Outputs[num]);
+ }
+ Debug.Console(0, "Cannot create DM-RMC of type '{0}' with parent device {1}", typeName, parentDev.Key);
+ return null;
+ }
+
+ private static CrestronGenericBaseDevice GetDmRmcControllerForProcessor(string key, string name, string typeName, uint ipid)
+ {
+ try
+ {
+ Func handler;
+
+ if (ProcessorFactoryDict.TryGetValue(typeName.ToLower(), out handler))
+ {
+ return handler(key, name, ipid);
+ }
+ Debug.Console(0, "Cannot create DM-RMC of type: '{0}'", typeName);
+
+ return null;
+ }
+ catch (Exception e)
+ {
+ Debug.Console(0, "[{0}] WARNING: Cannot create DM-RMC device: {1}", key, e.Message);
+ return null;
+ }
+ }
+ }
+
+ public class DmRmcControllerFactory : EssentialsDeviceFactory
+ {
+ public DmRmcControllerFactory()
+ {
+ TypeNames = new List
+ { "hdbasetrx", "dmrmc4k100c1g", "dmrmc100c", "dmrmc100s", "dmrmc4k100c", "dmrmc150s",
+ "dmrmc200c", "dmrmc200s", "dmrmc200s2", "dmrmcscalerc", "dmrmcscalers", "dmrmcscalers2", "dmrmc4kscalerc", "dmrmc4kscalercdsp",
+ "dmrmc4kz100c", "dmrmckzscalerc" };
+ }
+
+ public override EssentialsDevice BuildDevice(DeviceConfig dc)
+ {
+ var type = dc.Type.ToLower();
+
+ Debug.Console(1, "Factory Attempting to create new DM-RMC Device");
+
+ var props = JsonConvert.DeserializeObject
+ (dc.Properties.ToString());
+ return DmRmcHelper.GetDmRmcController(dc.Key, dc.Name, type, props);
+
+ }
+ }
+
}
\ No newline at end of file
diff --git a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmcScalerCController.cs b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmcScalerCController.cs
index 32044d48..8b2c1e98 100644
--- a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmcScalerCController.cs
+++ b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmcScalerCController.cs
@@ -1,9 +1,4 @@
-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;
@@ -21,20 +16,14 @@ namespace PepperDash.Essentials.DM
public class DmRmcScalerCController : DmRmcControllerBase, IRoutingInputsOutputs,
IIROutputPorts, IComPorts, ICec
{
- public DmRmcScalerC Rmc { get; private set; }
+ private readonly DmRmcScalerC _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
@@ -42,24 +31,27 @@ namespace PepperDash.Essentials.DM
public DmRmcScalerCController(string key, string name, DmRmcScalerC 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)
@@ -73,50 +65,43 @@ 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; } }
+ 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
///
/// Gets the CEC stream directly from the HDMI port.
///
- 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/DmRmcScalerS2Controller.cs b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmcScalerS2Controller.cs
index 60c3ca07..1e014063 100644
--- a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmcScalerS2Controller.cs
+++ b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmcScalerS2Controller.cs
@@ -1,9 +1,4 @@
-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;
@@ -21,20 +16,14 @@ namespace PepperDash.Essentials.DM
public class DmRmcScalerS2Controller : DmRmcControllerBase, IRoutingInputsOutputs,
IIROutputPorts, IComPorts, ICec
{
- public DmRmcScalerS2 Rmc { get; private set; }
+ private readonly DmRmcScalerS2 _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
@@ -42,24 +31,27 @@ namespace PepperDash.Essentials.DM
public DmRmcScalerS2Controller(string key, string name, DmRmcScalerS2 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)
@@ -73,29 +65,23 @@ 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)
{
@@ -103,20 +89,20 @@ namespace PepperDash.Essentials.DM
}
#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
///
/// Gets the CEC stream directly from the HDMI port.
///
- 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/DmRmcScalerSController.cs b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmcScalerSController.cs
index e7b5a132..ba0f1ad7 100644
--- a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmcScalerSController.cs
+++ b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmcScalerSController.cs
@@ -1,9 +1,4 @@
-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;
@@ -21,20 +16,14 @@ namespace PepperDash.Essentials.DM
public class DmRmcScalerSController : DmRmcControllerBase, IRoutingInputsOutputs,
IIROutputPorts, IComPorts, ICec
{
- public DmRmcScalerS Rmc { get; private set; }
+ private readonly DmRmcScalerS _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
@@ -42,24 +31,27 @@ namespace PepperDash.Essentials.DM
public DmRmcScalerSController(string key, string name, DmRmcScalerS 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)
@@ -73,28 +65,21 @@ namespace PepperDash.Essentials.DM
void ConnectedDevice_DeviceInformationChange(ConnectedDeviceInformation connectedDevice, ConnectedDeviceEventArgs args)
{
- if (args.EventId == ConnectedDeviceEventIds.ManufacturerEventId)
+ switch (args.EventId)
{
- EdidManufacturerFeedback.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;
}
- else if (args.EventId == ConnectedDeviceEventIds.NameEventId)
- {
- EdidNameFeedback.FireUpdate();
- }
- else if (args.EventId == ConnectedDeviceEventIds.PreferredTimingEventId)
- {
- EdidPreferredTimingFeedback.FireUpdate();
- }
- else if (args.EventId == ConnectedDeviceEventIds.SerialNumberEventId)
- {
- EdidSerialNumberFeedback.FireUpdate();
- }
- }
-
- 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)
@@ -103,20 +88,20 @@ namespace PepperDash.Essentials.DM
}
#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
///
/// Gets the CEC stream directly from the HDMI port.
///
- 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/DmRmcX100CController.cs b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmcX100CController.cs
index a7260813..6fa713ad 100644
--- a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmcX100CController.cs
+++ b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmcX100CController.cs
@@ -1,12 +1,6 @@
-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;
@@ -21,20 +15,14 @@ namespace PepperDash.Essentials.DM
public class DmRmcX100CController : DmRmcControllerBase, IRoutingInputsOutputs,
IIROutputPorts, IComPorts, ICec
{
- public DmRmc100C Rmc { get; private set; }
+ private readonly DmRmc100C _rmc;
- public RoutingInputPort DmIn { get; private set; }
- public RoutingOutputPort HdmiOut { get; private set; }
+ public RoutingInputPort DmIn { get; protected set; }
+ public RoutingOutputPort HdmiOut { get; protected set; }
- public RoutingPortCollection InputPorts
- {
- get { return new RoutingPortCollection { DmIn }; }
- }
+ public RoutingPortCollection InputPorts { get; protected set; }
- public RoutingPortCollection OutputPorts
- {
- get { return new RoutingPortCollection { HdmiOut }; }
- }
+ public RoutingPortCollection OutputPorts { get; protected set; }
///
/// Make a Crestron RMC and put it in here
@@ -42,20 +30,14 @@ namespace PepperDash.Essentials.DM
public DmRmcX100CController(string key, string name, DmRmc100C 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,
- eRoutingPortConnectionType.Hdmi, null, this);
+ HdmiOut = new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.AudioVideo,
+ eRoutingPortConnectionType.Hdmi, null, this) {Port = _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
- }
-
- public override bool CustomActivate()
- {
- // Base does register and sets up comm monitoring.
- return base.CustomActivate();
+ InputPorts = new RoutingPortCollection {DmIn};
+ OutputPorts = new RoutingPortCollection {HdmiOut};
}
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
@@ -64,17 +46,17 @@ namespace PepperDash.Essentials.DM
}
#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.StreamCec; } }
+ public Cec StreamCec { get { return _rmc.StreamCec; } }
#endregion
}
}
\ No newline at end of file
diff --git a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/DmTx200Controller.cs b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/DmTx200Controller.cs
index 923a7600..e75a9d55 100644
--- a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/DmTx200Controller.cs
+++ b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/DmTx200Controller.cs
@@ -33,6 +33,8 @@ namespace PepperDash.Essentials.DM
public IntFeedback VideoSourceNumericFeedback { get; protected set; }
public IntFeedback AudioSourceNumericFeedback { get; protected set; }
public IntFeedback HdmiInHdcpCapabilityFeedback { get; protected set; }
+ public BoolFeedback HdmiVideoSyncFeedback { get; protected set; }
+ public BoolFeedback VgaVideoSyncFeedback { get; protected set; }
public BoolFeedback FreeRunEnabledFeedback { get; protected set; }
@@ -127,6 +129,16 @@ namespace PepperDash.Essentials.DM
HdcpSupportCapability = eHdcpCapabilityType.HdcpAutoSupport;
+ HdmiVideoSyncFeedback = new BoolFeedback(() =>
+ {
+ return (bool)tx.HdmiInput.SyncDetectedFeedback.BoolValue;
+ });
+
+ VgaVideoSyncFeedback = new BoolFeedback(() =>
+ {
+ return (bool)tx.VgaInput.SyncDetectedFeedback.BoolValue;
+ });
+
FreeRunEnabledFeedback = new BoolFeedback(() => tx.VgaInput.FreeRunFeedback == eDmFreeRunSetting.Enabled);
VgaBrightnessFeedback = new IntFeedback(() => tx.VgaInput.VideoControls.BrightnessFeedback.UShortValue);
@@ -174,7 +186,8 @@ namespace PepperDash.Essentials.DM
AddToFeedbackList(ActiveVideoInputFeedback, VideoSourceNumericFeedback, AudioSourceNumericFeedback,
AnyVideoInput.VideoStatus.HasVideoStatusFeedback, AnyVideoInput.VideoStatus.HdcpActiveFeedback,
AnyVideoInput.VideoStatus.HdcpStateFeedback, AnyVideoInput.VideoStatus.VideoResolutionFeedback,
- AnyVideoInput.VideoStatus.VideoSyncFeedback, HdmiInHdcpCapabilityFeedback);
+ AnyVideoInput.VideoStatus.VideoSyncFeedback, HdmiInHdcpCapabilityFeedback, HdmiVideoSyncFeedback,
+ VgaVideoSyncFeedback);
// Set Ports for CEC
HdmiInput.Port = Tx.HdmiInput;
@@ -220,7 +233,18 @@ namespace PepperDash.Essentials.DM
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
{
- LinkDmTxToApi(this, trilist, joinStart, joinMapKey, bridge);
+ DmTxControllerJoinMap joinMap = GetDmTxJoinMap(joinStart, joinMapKey);
+
+ if (HdmiVideoSyncFeedback != null)
+ {
+ HdmiVideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.Input1VideoSyncStatus.JoinNumber]);
+ }
+ if (VgaVideoSyncFeedback != null)
+ {
+ VgaVideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.Input2VideoSyncStatus.JoinNumber]);
+ }
+
+ LinkDmTxToApi(this, trilist, joinMap, bridge);
}
///
diff --git a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/DmTx201CController.cs b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/DmTx201CController.cs
index e68a6fc5..ed614829 100644
--- a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/DmTx201CController.cs
+++ b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/DmTx201CController.cs
@@ -21,9 +21,9 @@ namespace PepperDash.Essentials.DM
///
/// Controller class for all DM-TX-201C/S/F transmitters
///
- public class DmTx201XController : DmTxControllerBase, ITxRouting, IHasFeedback, IHasFreeRun, IVgaBrightnessContrastControls
+ public class DmTx201CController : DmTxControllerBase, ITxRouting, IHasFeedback, IHasFreeRun, IVgaBrightnessContrastControls
{
- public DmTx201S Tx { get; private set; } // uses the 201S class as it is the base class for the 201C
+ public DmTx201C Tx { get; private set; } // uses the 201S class as it is the base class for the 201C
public RoutingInputPortWithVideoStatuses HdmiInput { get; private set; }
public RoutingInputPortWithVideoStatuses VgaInput { get; private set; }
@@ -34,6 +34,8 @@ namespace PepperDash.Essentials.DM
public IntFeedback VideoSourceNumericFeedback { get; protected set; }
public IntFeedback AudioSourceNumericFeedback { get; protected set; }
public IntFeedback HdmiInHdcpCapabilityFeedback { get; protected set; }
+ public BoolFeedback HdmiVideoSyncFeedback { get; protected set; }
+ public BoolFeedback VgaVideoSyncFeedback { get; protected set; }
public BoolFeedback FreeRunEnabledFeedback { get; protected set; }
@@ -90,7 +92,7 @@ namespace PepperDash.Essentials.DM
///
///
///
- public DmTx201XController(string key, string name, DmTx201S tx)
+ public DmTx201CController(string key, string name, DmTx201C tx)
: base(key, name, tx)
{
Tx = tx;
@@ -126,6 +128,16 @@ namespace PepperDash.Essentials.DM
return 0;
});
+ HdmiVideoSyncFeedback = new BoolFeedback(() =>
+ {
+ return (bool)tx.HdmiInput.SyncDetectedFeedback.BoolValue;
+ });
+
+ VgaVideoSyncFeedback = new BoolFeedback(() =>
+ {
+ return (bool)tx.VgaInput.SyncDetectedFeedback.BoolValue;
+ });
+
FreeRunEnabledFeedback = new BoolFeedback(() => tx.VgaInput.FreeRunFeedback == eDmFreeRunSetting.Enabled);
VgaBrightnessFeedback = new IntFeedback(() => tx.VgaInput.VideoControls.BrightnessFeedback.UShortValue);
@@ -176,7 +188,8 @@ namespace PepperDash.Essentials.DM
AddToFeedbackList(ActiveVideoInputFeedback, VideoSourceNumericFeedback, AudioSourceNumericFeedback,
AnyVideoInput.VideoStatus.HasVideoStatusFeedback, AnyVideoInput.VideoStatus.HdcpActiveFeedback,
AnyVideoInput.VideoStatus.HdcpStateFeedback, AnyVideoInput.VideoStatus.VideoResolutionFeedback,
- AnyVideoInput.VideoStatus.VideoSyncFeedback, HdmiInHdcpCapabilityFeedback);
+ AnyVideoInput.VideoStatus.VideoSyncFeedback, HdmiInHdcpCapabilityFeedback, HdmiVideoSyncFeedback,
+ VgaVideoSyncFeedback);
// Set Ports for CEC
HdmiInput.Port = Tx.HdmiInput;
@@ -222,7 +235,18 @@ namespace PepperDash.Essentials.DM
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
{
- LinkDmTxToApi(this, trilist, joinStart, joinMapKey, bridge);
+ DmTxControllerJoinMap joinMap = GetDmTxJoinMap(joinStart, joinMapKey);
+
+ if (HdmiVideoSyncFeedback != null)
+ {
+ HdmiVideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.Input1VideoSyncStatus.JoinNumber]);
+ }
+ if (VgaVideoSyncFeedback != null)
+ {
+ VgaVideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.Input2VideoSyncStatus.JoinNumber]);
+ }
+
+ LinkDmTxToApi(this, trilist, joinMap, bridge);
}
///
diff --git a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/DmTx201SController.cs b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/DmTx201SController.cs
new file mode 100644
index 00000000..23e93b5d
--- /dev/null
+++ b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/DmTx201SController.cs
@@ -0,0 +1,411 @@
+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.DM;
+using Crestron.SimplSharpPro.DM.Endpoints;
+using Crestron.SimplSharpPro.DM.Endpoints.Transmitters;
+
+using PepperDash.Core;
+using PepperDash.Essentials.Core;
+using PepperDash.Essentials.Core.Bridges;
+using PepperDash.Essentials.DM.Config;
+
+namespace PepperDash.Essentials.DM
+{
+ // using eVst = Crestron.SimplSharpPro.DeviceSupport.eX02VideoSourceType;
+
+ ///
+ /// Controller class for all DM-TX-201C/S/F transmitters
+ ///
+ public class DmTx201SController : DmTxControllerBase, ITxRouting, IHasFeedback, IHasFreeRun, IVgaBrightnessContrastControls
+ {
+ public DmTx201S Tx { get; private set; } // uses the 201S class as it is the base class for the 201C
+
+ public RoutingInputPortWithVideoStatuses HdmiInput { get; private set; }
+ public RoutingInputPortWithVideoStatuses VgaInput { get; private set; }
+ public RoutingOutputPort DmOutput { get; private set; }
+ public RoutingOutputPort HdmiLoopOut { get; private set; }
+
+ public override StringFeedback ActiveVideoInputFeedback { get; protected set; }
+ public IntFeedback VideoSourceNumericFeedback { get; protected set; }
+ public IntFeedback AudioSourceNumericFeedback { get; protected set; }
+ public IntFeedback HdmiInHdcpCapabilityFeedback { get; protected set; }
+ public BoolFeedback HdmiVideoSyncFeedback { get; protected set; }
+ public BoolFeedback VgaVideoSyncFeedback { get; protected set; }
+
+ public BoolFeedback FreeRunEnabledFeedback { get; protected set; }
+
+ public IntFeedback VgaBrightnessFeedback { get; protected set; }
+ public IntFeedback VgaContrastFeedback { get; protected set; }
+
+ ///
+ /// Helps get the "real" inputs, including when in Auto
+ ///
+ public DmTx200Base.eSourceSelection ActualActiveVideoInput
+ {
+ get
+ {
+ if (Tx.VideoSourceFeedback == DmTx200Base.eSourceSelection.Digital ||
+ Tx.VideoSourceFeedback == DmTx200Base.eSourceSelection.Analog ||
+ Tx.VideoSourceFeedback == DmTx200Base.eSourceSelection.Disable)
+ return Tx.VideoSourceFeedback;
+ else // auto
+ {
+ if (Tx.HdmiInput.SyncDetectedFeedback.BoolValue)
+ return DmTx200Base.eSourceSelection.Digital;
+ else if (Tx.VgaInput.SyncDetectedFeedback.BoolValue)
+ return DmTx200Base.eSourceSelection.Analog;
+ else
+ return DmTx200Base.eSourceSelection.Disable;
+ }
+ }
+ }
+
+ public RoutingPortCollection InputPorts
+ {
+ get
+ {
+ return new RoutingPortCollection
+ {
+ HdmiInput,
+ VgaInput,
+ AnyVideoInput
+ };
+ }
+ }
+
+ public RoutingPortCollection OutputPorts
+ {
+ get
+ {
+ return new RoutingPortCollection { DmOutput, HdmiLoopOut };
+ }
+ }
+
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public DmTx201SController(string key, string name, DmTx201S tx)
+ : base(key, name, tx)
+ {
+ Tx = tx;
+
+ HdmiInput = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn,
+ eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, DmTx200Base.eSourceSelection.Digital, this,
+ VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInput));
+ VgaInput = new RoutingInputPortWithVideoStatuses(DmPortName.VgaIn,
+ eRoutingSignalType.Video, eRoutingPortConnectionType.Vga, DmTx200Base.eSourceSelection.Analog, this,
+ VideoStatusHelper.GetVgaInputStatusFuncs(tx.VgaInput));
+
+ ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput",
+ () => ActualActiveVideoInput.ToString());
+
+ Tx.HdmiInput.InputStreamChange += new EndpointInputStreamChangeEventHandler(InputStreamChangeEvent);
+ Tx.BaseEvent += Tx_BaseEvent;
+ Tx.OnlineStatusChange += new OnlineStatusChangeEventHandler(Tx_OnlineStatusChange);
+
+ VideoSourceNumericFeedback = new IntFeedback(() =>
+ {
+ return (int)Tx.VideoSourceFeedback;
+ });
+ AudioSourceNumericFeedback = new IntFeedback(() =>
+ {
+ return (int)Tx.AudioSourceFeedback;
+ });
+
+ HdmiInHdcpCapabilityFeedback = new IntFeedback("HdmiInHdcpCapability", () =>
+ {
+ if (tx.HdmiInput.HdcpSupportOnFeedback.BoolValue)
+ return 1;
+ else
+ return 0;
+ });
+
+ HdmiVideoSyncFeedback = new BoolFeedback(() =>
+ {
+ return (bool)tx.HdmiInput.SyncDetectedFeedback.BoolValue;
+ });
+
+ VgaVideoSyncFeedback = new BoolFeedback(() =>
+ {
+ return (bool)tx.VgaInput.SyncDetectedFeedback.BoolValue;
+ });
+
+ FreeRunEnabledFeedback = new BoolFeedback(() => tx.VgaInput.FreeRunFeedback == eDmFreeRunSetting.Enabled);
+
+ VgaBrightnessFeedback = new IntFeedback(() => tx.VgaInput.VideoControls.BrightnessFeedback.UShortValue);
+ VgaContrastFeedback = new IntFeedback(() => tx.VgaInput.VideoControls.ContrastFeedback.UShortValue);
+
+ tx.VgaInput.VideoControls.ControlChange += new Crestron.SimplSharpPro.DeviceSupport.GenericEventHandler(VideoControls_ControlChange);
+
+ HdcpSupportCapability = eHdcpCapabilityType.HdcpAutoSupport;
+
+ var combinedFuncs = new VideoStatusFuncsWrapper
+ {
+ HdcpActiveFeedbackFunc = () =>
+ (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital
+ && tx.HdmiInput.VideoAttributes.HdcpActiveFeedback.BoolValue),
+
+ HdcpStateFeedbackFunc = () =>
+ {
+ if (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital)
+ return tx.HdmiInput.VideoAttributes.HdcpStateFeedback.ToString();
+ return "";
+ },
+
+ VideoResolutionFeedbackFunc = () =>
+ {
+ if (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital)
+ return tx.HdmiInput.VideoAttributes.GetVideoResolutionString();
+ if (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Analog)
+ return tx.VgaInput.VideoAttributes.GetVideoResolutionString();
+ return "";
+ },
+ VideoSyncFeedbackFunc = () =>
+ (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital
+ && tx.HdmiInput.SyncDetectedFeedback.BoolValue)
+ || (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Analog
+ && tx.VgaInput.SyncDetectedFeedback.BoolValue)
+ || (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Auto
+ && (tx.VgaInput.SyncDetectedFeedback.BoolValue || tx.HdmiInput.SyncDetectedFeedback.BoolValue))
+
+ };
+
+ AnyVideoInput = new RoutingInputPortWithVideoStatuses(DmPortName.AnyVideoIn,
+ eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.None, 0, this, combinedFuncs);
+
+ DmOutput = new RoutingOutputPort(DmPortName.DmOut, eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.DmCat, null, this);
+ HdmiLoopOut = new RoutingOutputPort(DmPortName.HdmiLoopOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
+ eRoutingPortConnectionType.Hdmi, null, this);
+
+ AddToFeedbackList(ActiveVideoInputFeedback, VideoSourceNumericFeedback, AudioSourceNumericFeedback,
+ AnyVideoInput.VideoStatus.HasVideoStatusFeedback, AnyVideoInput.VideoStatus.HdcpActiveFeedback,
+ AnyVideoInput.VideoStatus.HdcpStateFeedback, AnyVideoInput.VideoStatus.VideoResolutionFeedback,
+ AnyVideoInput.VideoStatus.VideoSyncFeedback, HdmiInHdcpCapabilityFeedback, HdmiVideoSyncFeedback,
+ VgaVideoSyncFeedback);
+
+ // Set Ports for CEC
+ HdmiInput.Port = Tx.HdmiInput;
+ VgaInput.Port = Tx.VgaInput;
+ HdmiLoopOut.Port = Tx.HdmiOutput;
+ DmOutput.Port = Tx.DmOutput;
+ }
+
+ void VideoControls_ControlChange(object sender, Crestron.SimplSharpPro.DeviceSupport.GenericEventArgs args)
+ {
+ var id = args.EventId;
+ Debug.Console(2, this, "EventId {0}", args.EventId);
+
+ if (id == VideoControlsEventIds.BrightnessFeedbackEventId)
+ {
+ VgaBrightnessFeedback.FireUpdate();
+ }
+ else if (id == VideoControlsEventIds.ContrastFeedbackEventId)
+ {
+ VgaContrastFeedback.FireUpdate();
+ }
+ }
+
+ void Tx_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args)
+ {
+ ActiveVideoInputFeedback.FireUpdate();
+ VideoSourceNumericFeedback.FireUpdate();
+ AudioSourceNumericFeedback.FireUpdate();
+
+ }
+
+ public override bool CustomActivate()
+ {
+ Tx.HdmiInput.InputStreamChange += (o, a) => FowardInputStreamChange(HdmiInput, a.EventId);
+ Tx.HdmiInput.VideoAttributes.AttributeChange += (o, a) => FireVideoAttributeChange(HdmiInput, a.EventId);
+
+ Tx.VgaInput.InputStreamChange += (o, a) => FowardInputStreamChange(VgaInput, a.EventId);
+ Tx.VgaInput.VideoAttributes.AttributeChange += (o, a) => FireVideoAttributeChange(VgaInput, a.EventId);
+
+ // Base does register and sets up comm monitoring.
+ return base.CustomActivate();
+ }
+
+ public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
+ {
+ DmTxControllerJoinMap joinMap = GetDmTxJoinMap(joinStart, joinMapKey);
+
+ if (HdmiVideoSyncFeedback != null)
+ {
+ HdmiVideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.Input1VideoSyncStatus.JoinNumber]);
+ }
+ if (VgaVideoSyncFeedback != null)
+ {
+ VgaVideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.Input2VideoSyncStatus.JoinNumber]);
+ }
+
+ LinkDmTxToApi(this, trilist, joinMap, bridge);
+ }
+
+ ///
+ /// Enables or disables free run
+ ///
+ ///
+ public void SetFreeRunEnabled(bool enable)
+ {
+ if (enable)
+ {
+ Tx.VgaInput.FreeRun = eDmFreeRunSetting.Enabled;
+ }
+ else
+ {
+ Tx.VgaInput.FreeRun = eDmFreeRunSetting.Disabled;
+ }
+ }
+
+ ///
+ /// Sets the VGA brightness level
+ ///
+ ///
+ public void SetVgaBrightness(ushort level)
+ {
+ Tx.VgaInput.VideoControls.Brightness.UShortValue = level;
+ }
+
+ ///
+ /// Sets the VGA contrast level
+ ///
+ ///
+ public void SetVgaContrast(ushort level)
+ {
+ Tx.VgaInput.VideoControls.Contrast.UShortValue = level;
+ }
+
+ ///
+ /// Switches the audio/video source based on the integer value (0-Auto, 1-HDMI, 2-VGA, 3-Disable)
+ ///
+ ///
+ ///
+ ///
+ public void ExecuteNumericSwitch(ushort input, ushort output, eRoutingSignalType type)
+ {
+ Debug.Console(2, this, "Executing Numeric Switch to input {0}.", input);
+
+ switch (input)
+ {
+ case 0:
+ {
+ ExecuteSwitch(DmTx200Base.eSourceSelection.Auto, null, type);
+ break;
+ }
+ case 1:
+ {
+ ExecuteSwitch(HdmiInput.Selector, null, type);
+ break;
+ }
+ case 2:
+ {
+ ExecuteSwitch(VgaInput.Selector, null, type);
+ break;
+ }
+ case 3:
+ {
+ ExecuteSwitch(DmTx200Base.eSourceSelection.Disable, null, type);
+ break;
+ }
+ }
+ }
+
+ public void ExecuteSwitch(object inputSelector, object outputSelector, eRoutingSignalType signalType)
+ {
+ if ((signalType | eRoutingSignalType.Video) == eRoutingSignalType.Video)
+ Tx.VideoSource = (DmTx200Base.eSourceSelection)inputSelector;
+ if ((signalType | eRoutingSignalType.Audio) == eRoutingSignalType.Audio)
+ Tx.AudioSource = (DmTx200Base.eSourceSelection)inputSelector;
+ }
+
+ void Tx_BaseEvent(GenericBase device, BaseEventArgs args)
+ {
+ var id = args.EventId;
+ Debug.Console(2, this, "EventId {0}", args.EventId);
+
+ if (id == EndpointTransmitterBase.VideoSourceFeedbackEventId)
+ {
+ Debug.Console(2, this, " Video Source: {0}", Tx.VideoSourceFeedback);
+ VideoSourceNumericFeedback.FireUpdate();
+ ActiveVideoInputFeedback.FireUpdate();
+ }
+
+ // ------------------------------ incomplete -----------------------------------------
+ else if (id == EndpointTransmitterBase.AudioSourceFeedbackEventId)
+ {
+ Debug.Console(2, this, " Audio Source: {0}", Tx.AudioSourceFeedback);
+ AudioSourceNumericFeedback.FireUpdate();
+ }
+
+ }
+
+ void InputStreamChangeEvent(EndpointInputStream inputStream, EndpointInputStreamEventArgs args)
+ {
+ Debug.Console(2, "{0} event {1} stream {2}", this.Tx.ToString(), inputStream.ToString(), args.EventId.ToString());
+
+ if (args.EventId == EndpointInputStreamEventIds.HdcpSupportOffFeedbackEventId)
+ {
+ HdmiInHdcpCapabilityFeedback.FireUpdate();
+ }
+ else if (args.EventId == EndpointInputStreamEventIds.HdcpSupportOnFeedbackEventId)
+ {
+ HdmiInHdcpCapabilityFeedback.FireUpdate();
+ }
+ else if (args.EventId == EndpointInputStreamEventIds.FreeRunFeedbackEventId)
+ {
+ FreeRunEnabledFeedback.FireUpdate();
+ }
+ }
+
+ ///
+ /// Relays the input stream change to the appropriate RoutingInputPort.
+ ///
+ void FowardInputStreamChange(RoutingInputPortWithVideoStatuses inputPort, int eventId)
+ {
+ if (eventId == EndpointInputStreamEventIds.SyncDetectedFeedbackEventId)
+ {
+ inputPort.VideoStatus.VideoSyncFeedback.FireUpdate();
+ AnyVideoInput.VideoStatus.VideoSyncFeedback.FireUpdate();
+ }
+ }
+
+ ///
+ /// Relays the VideoAttributes change to a RoutingInputPort
+ ///
+ void FireVideoAttributeChange(RoutingInputPortWithVideoStatuses inputPort, int eventId)
+ {
+ //// LOCATION: Crestron.SimplSharpPro.DM.VideoAttributeEventIds
+ //Debug.Console(2, this, "VideoAttributes_AttributeChange event id={0} from {1}",
+ // args.EventId, (sender as VideoAttributesEnhanced).Owner.GetType());
+ switch (eventId)
+ {
+ case VideoAttributeEventIds.HdcpActiveFeedbackEventId:
+ inputPort.VideoStatus.HdcpActiveFeedback.FireUpdate();
+ AnyVideoInput.VideoStatus.HdcpActiveFeedback.FireUpdate();
+ break;
+ case VideoAttributeEventIds.HdcpStateFeedbackEventId:
+ inputPort.VideoStatus.HdcpStateFeedback.FireUpdate();
+ AnyVideoInput.VideoStatus.HdcpStateFeedback.FireUpdate();
+ break;
+ case VideoAttributeEventIds.HorizontalResolutionFeedbackEventId:
+ case VideoAttributeEventIds.VerticalResolutionFeedbackEventId:
+ inputPort.VideoStatus.VideoResolutionFeedback.FireUpdate();
+ AnyVideoInput.VideoStatus.VideoResolutionFeedback.FireUpdate();
+ break;
+ case VideoAttributeEventIds.FramesPerSecondFeedbackEventId:
+ inputPort.VideoStatus.VideoResolutionFeedback.FireUpdate();
+ AnyVideoInput.VideoStatus.VideoResolutionFeedback.FireUpdate();
+ break;
+ }
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/DmTx401CController.cs b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/DmTx401CController.cs
index 25c16281..46cae247 100644
--- a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/DmTx401CController.cs
+++ b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/DmTx401CController.cs
@@ -35,6 +35,9 @@ namespace PepperDash.Essentials.DM
public IntFeedback VideoSourceNumericFeedback { get; protected set; }
public IntFeedback AudioSourceNumericFeedback { get; protected set; }
public IntFeedback HdmiInHdcpCapabilityFeedback { get; protected set; }
+ public BoolFeedback DisplayPortVideoSyncFeedback { get; protected set; }
+ public BoolFeedback HdmiVideoSyncFeedback { get; protected set; }
+ public BoolFeedback VgaVideoSyncFeedback { get; protected set; }
public BoolFeedback FreeRunEnabledFeedback { get; protected set; }
@@ -137,6 +140,21 @@ namespace PepperDash.Essentials.DM
HdcpSupportCapability = eHdcpCapabilityType.HdcpAutoSupport;
+ DisplayPortVideoSyncFeedback = new BoolFeedback("DisplayPortVideoSync", () =>
+ {
+ return (bool)tx.DisplayPortInput.SyncDetectedFeedback.BoolValue;
+ });
+
+ HdmiVideoSyncFeedback = new BoolFeedback(() =>
+ {
+ return (bool)tx.HdmiInput.SyncDetectedFeedback.BoolValue;
+ });
+
+ VgaVideoSyncFeedback = new BoolFeedback(() =>
+ {
+ return (bool)tx.VgaInput.SyncDetectedFeedback.BoolValue;
+ });
+
FreeRunEnabledFeedback = new BoolFeedback(() => tx.VgaInput.FreeRunFeedback == eDmFreeRunSetting.Enabled);
VgaBrightnessFeedback = new IntFeedback(() => tx.VgaInput.VideoControls.BrightnessFeedback.UShortValue);
@@ -193,7 +211,8 @@ namespace PepperDash.Essentials.DM
AddToFeedbackList(ActiveVideoInputFeedback, VideoSourceNumericFeedback, AudioSourceNumericFeedback,
AnyVideoInput.VideoStatus.HasVideoStatusFeedback, AnyVideoInput.VideoStatus.HdcpActiveFeedback,
AnyVideoInput.VideoStatus.HdcpStateFeedback, AnyVideoInput.VideoStatus.VideoResolutionFeedback,
- AnyVideoInput.VideoStatus.VideoSyncFeedback, HdmiInHdcpCapabilityFeedback);
+ AnyVideoInput.VideoStatus.VideoSyncFeedback, HdmiInHdcpCapabilityFeedback, DisplayPortVideoSyncFeedback,
+ HdmiVideoSyncFeedback, VgaVideoSyncFeedback);
// Set Ports for CEC
DisplayPortIn.Port = Tx.DisplayPortInput;
@@ -219,7 +238,18 @@ namespace PepperDash.Essentials.DM
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
{
- LinkDmTxToApi(this, trilist, joinStart, joinMapKey, bridge);
+ DmTxControllerJoinMap joinMap = GetDmTxJoinMap(joinStart, joinMapKey);
+
+ if (HdmiVideoSyncFeedback != null)
+ {
+ HdmiVideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.Input1VideoSyncStatus.JoinNumber]);
+ }
+ if (VgaVideoSyncFeedback != null)
+ {
+ VgaVideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.Input2VideoSyncStatus.JoinNumber]);
+ }
+
+ LinkDmTxToApi(this, trilist, joinMap, bridge);
}
public void ExecuteNumericSwitch(ushort input, ushort output, eRoutingSignalType type)
diff --git a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/DmTx4k100Controller.cs b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/DmTx4k100Controller.cs
index c62d0adf..12889528 100644
--- a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/DmTx4k100Controller.cs
+++ b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/DmTx4k100Controller.cs
@@ -72,7 +72,9 @@ namespace PepperDash.Essentials.DM
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
{
- LinkDmTxToApi(this, trilist, joinStart, joinMapKey, bridge);
+ DmTxControllerJoinMap joinMap = GetDmTxJoinMap(joinStart, joinMapKey);
+
+ LinkDmTxToApi(this, trilist, joinMap, bridge);
}
#region IIROutputPorts Members
diff --git a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/DmTx4k202CController.cs b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/DmTx4k202CController.cs
index 1b5ecf6d..460876b4 100644
--- a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/DmTx4k202CController.cs
+++ b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/DmTx4k202CController.cs
@@ -35,6 +35,8 @@ namespace PepperDash.Essentials.DM
public IntFeedback AudioSourceNumericFeedback { get; protected set; }
public IntFeedback HdmiIn1HdcpCapabilityFeedback { get; protected set; }
public IntFeedback HdmiIn2HdcpCapabilityFeedback { get; protected set; }
+ public BoolFeedback Hdmi1VideoSyncFeedback { get; protected set; }
+ public BoolFeedback Hdmi2VideoSyncFeedback { get; protected set; }
//public override IntFeedback HdcpSupportAllFeedback { get; protected set; }
//public override ushort HdcpSupportCapability { get; protected set; }
@@ -119,6 +121,16 @@ namespace PepperDash.Essentials.DM
HdcpSupportCapability = eHdcpCapabilityType.Hdcp2_2Support;
+ Hdmi1VideoSyncFeedback = new BoolFeedback(() =>
+ {
+ return (bool)tx.HdmiInputs[1].SyncDetectedFeedback.BoolValue;
+ });
+
+ Hdmi2VideoSyncFeedback = new BoolFeedback(() =>
+ {
+ return (bool)tx.HdmiInputs[2].SyncDetectedFeedback.BoolValue;
+ });
+
var combinedFuncs = new VideoStatusFuncsWrapper
{
HdcpActiveFeedbackFunc = () =>
@@ -164,7 +176,8 @@ namespace PepperDash.Essentials.DM
AddToFeedbackList(ActiveVideoInputFeedback, VideoSourceNumericFeedback, AudioSourceNumericFeedback,
AnyVideoInput.VideoStatus.HasVideoStatusFeedback, AnyVideoInput.VideoStatus.HdcpActiveFeedback,
AnyVideoInput.VideoStatus.HdcpStateFeedback, AnyVideoInput.VideoStatus.VideoResolutionFeedback,
- AnyVideoInput.VideoStatus.VideoSyncFeedback, HdmiIn1HdcpCapabilityFeedback, HdmiIn2HdcpCapabilityFeedback);
+ AnyVideoInput.VideoStatus.VideoSyncFeedback, HdmiIn1HdcpCapabilityFeedback, HdmiIn2HdcpCapabilityFeedback,
+ Hdmi1VideoSyncFeedback, Hdmi2VideoSyncFeedback);
// Set Ports for CEC
HdmiIn1.Port = Tx.HdmiInputs[1];
@@ -190,7 +203,18 @@ namespace PepperDash.Essentials.DM
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
{
- LinkDmTxToApi(this, trilist, joinStart, joinMapKey, bridge);
+ DmTxControllerJoinMap joinMap = GetDmTxJoinMap(joinStart, joinMapKey);
+
+ if (Hdmi1VideoSyncFeedback != null)
+ {
+ Hdmi1VideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.Input1VideoSyncStatus.JoinNumber]);
+ }
+ if (Hdmi2VideoSyncFeedback != null)
+ {
+ Hdmi2VideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.Input2VideoSyncStatus.JoinNumber]);
+ }
+
+ LinkDmTxToApi(this, trilist, joinMap, bridge);
}
public void ExecuteNumericSwitch(ushort input, ushort output, eRoutingSignalType type)
diff --git a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/DmTx4k302CController.cs b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/DmTx4k302CController.cs
index 5d00a32d..7d787051 100644
--- a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/DmTx4k302CController.cs
+++ b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/DmTx4k302CController.cs
@@ -36,6 +36,9 @@ namespace PepperDash.Essentials.DM
public IntFeedback AudioSourceNumericFeedback { get; protected set; }
public IntFeedback HdmiIn1HdcpCapabilityFeedback { get; protected set; }
public IntFeedback HdmiIn2HdcpCapabilityFeedback { get; protected set; }
+ public BoolFeedback Hdmi1VideoSyncFeedback { get; protected set; }
+ public BoolFeedback Hdmi2VideoSyncFeedback { get; protected set; }
+ public BoolFeedback VgaVideoSyncFeedback { get; protected set; }
public BoolFeedback FreeRunEnabledFeedback { get; protected set; }
@@ -126,6 +129,21 @@ namespace PepperDash.Essentials.DM
HdcpSupportCapability = eHdcpCapabilityType.Hdcp2_2Support;
+ Hdmi1VideoSyncFeedback = new BoolFeedback(() =>
+ {
+ return (bool)tx.HdmiInputs[1].SyncDetectedFeedback.BoolValue;
+ });
+
+ Hdmi2VideoSyncFeedback = new BoolFeedback(() =>
+ {
+ return (bool)tx.HdmiInputs[2].SyncDetectedFeedback.BoolValue;
+ });
+
+ VgaVideoSyncFeedback = new BoolFeedback(() =>
+ {
+ return (bool)tx.VgaInput.SyncDetectedFeedback.BoolValue;
+ });
+
FreeRunEnabledFeedback = new BoolFeedback(() => tx.VgaInput.FreeRunFeedback == eDmFreeRunSetting.Enabled);
VgaBrightnessFeedback = new IntFeedback(() => tx.VgaInput.VideoControls.BrightnessFeedback.UShortValue);
@@ -183,7 +201,8 @@ namespace PepperDash.Essentials.DM
AddToFeedbackList(ActiveVideoInputFeedback, VideoSourceNumericFeedback, AudioSourceNumericFeedback,
AnyVideoInput.VideoStatus.HasVideoStatusFeedback, AnyVideoInput.VideoStatus.HdcpActiveFeedback,
AnyVideoInput.VideoStatus.HdcpStateFeedback, AnyVideoInput.VideoStatus.VideoResolutionFeedback,
- AnyVideoInput.VideoStatus.VideoSyncFeedback, HdmiIn1HdcpCapabilityFeedback, HdmiIn2HdcpCapabilityFeedback);
+ AnyVideoInput.VideoStatus.VideoSyncFeedback, HdmiIn1HdcpCapabilityFeedback, HdmiIn2HdcpCapabilityFeedback,
+ Hdmi1VideoSyncFeedback, Hdmi2VideoSyncFeedback, VgaVideoSyncFeedback);
// Set Ports for CEC
HdmiIn1.Port = Tx.HdmiInputs[1];
@@ -227,7 +246,22 @@ namespace PepperDash.Essentials.DM
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
{
- LinkDmTxToApi(this, trilist, joinStart, joinMapKey, bridge);
+ DmTxControllerJoinMap joinMap = GetDmTxJoinMap(joinStart, joinMapKey);
+
+ if (Hdmi1VideoSyncFeedback != null)
+ {
+ Hdmi1VideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.Input1VideoSyncStatus.JoinNumber]);
+ }
+ if (Hdmi2VideoSyncFeedback != null)
+ {
+ Hdmi2VideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.Input2VideoSyncStatus.JoinNumber]);
+ }
+ if (VgaVideoSyncFeedback != null)
+ {
+ VgaVideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.Input3VideoSyncStatus.JoinNumber]);
+ }
+
+ LinkDmTxToApi(this, trilist, joinMap, bridge);
}
///
diff --git a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/DmTx4kz100Controller.cs b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/DmTx4kz100Controller.cs
new file mode 100644
index 00000000..036602d3
--- /dev/null
+++ b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/DmTx4kz100Controller.cs
@@ -0,0 +1,320 @@
+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.DM;
+using Crestron.SimplSharpPro.DM.Endpoints;
+using Crestron.SimplSharpPro.DM.Endpoints.Transmitters;
+
+using PepperDash.Core;
+using PepperDash.Essentials.Core;
+using PepperDash.Essentials.Core.Bridges;
+using PepperDash.Essentials.DM.Config;
+
+namespace PepperDash.Essentials.DM
+{
+ // using eVst = Crestron.SimplSharpPro.DeviceSupport.eX02VideoSourceType;
+
+ ///
+ /// Controller class for all DM-TX-201C/S/F transmitters
+ ///
+ public class DmTx4kz100Controller : DmTxControllerBase, IRoutingInputsOutputs, IHasFeedback,
+ IIROutputPorts, IComPorts, ICec
+ {
+ public DmTx4kz100C1G Tx { get; private set; }
+
+ public RoutingInputPortWithVideoStatuses HdmiInput { get; private set; }
+ public RoutingOutputPort DmOutput { get; private set; }
+
+ public override StringFeedback ActiveVideoInputFeedback { get; protected set; }
+ public IntFeedback HdmiInHdcpCapabilityFeedback { get; protected set; }
+ public BoolFeedback HdmiVideoSyncFeedback { get; protected set; }
+
+ ///
+ /// Helps get the "real" inputs, including when in Auto
+ ///
+ public DmTx200Base.eSourceSelection ActualActiveVideoInput
+ {
+ get
+ {
+ if (Tx.VideoSourceFeedback == DmTx200Base.eSourceSelection.Digital ||
+ Tx.VideoSourceFeedback == DmTx200Base.eSourceSelection.Analog ||
+ Tx.VideoSourceFeedback == DmTx200Base.eSourceSelection.Disable)
+ return Tx.VideoSourceFeedback;
+ else // auto
+ {
+ if (Tx.HdmiInput.SyncDetectedFeedback.BoolValue)
+ return DmTx200Base.eSourceSelection.Digital;
+ else if (Tx.VgaInput.SyncDetectedFeedback.BoolValue)
+ return DmTx200Base.eSourceSelection.Analog;
+ else
+ return DmTx200Base.eSourceSelection.Disable;
+ }
+ }
+ }
+
+ public RoutingPortCollection InputPorts
+ {
+ get
+ {
+ return new RoutingPortCollection
+ {
+ HdmiInput
+ };
+ }
+ }
+
+ public RoutingPortCollection OutputPorts
+ {
+ get
+ {
+ return new RoutingPortCollection { DmOutput };
+ }
+ }
+
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public DmTx4kz100Controller(string key, string name, DmTx4kz100C1G tx)
+ : base(key, name, tx)
+ {
+ Tx = tx;
+
+ HdmiInput = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn,
+ eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, DmTx200Base.eSourceSelection.Digital, this,
+ VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInput));
+
+ ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput",
+ () => ActualActiveVideoInput.ToString());
+
+ Tx.HdmiInput.InputStreamChange += new EndpointInputStreamChangeEventHandler(InputStreamChangeEvent);
+ Tx.BaseEvent += Tx_BaseEvent;
+ Tx.OnlineStatusChange += new OnlineStatusChangeEventHandler(Tx_OnlineStatusChange);
+
+
+ HdmiInHdcpCapabilityFeedback = new IntFeedback("HdmiInHdcpCapability", () =>
+ {
+ if (tx.HdmiInput.HdcpSupportOnFeedback.BoolValue)
+ return 1;
+ else
+ return 0;
+ });
+
+ HdcpSupportCapability = eHdcpCapabilityType.HdcpAutoSupport;
+
+ HdmiVideoSyncFeedback = new BoolFeedback(() =>
+ {
+ return (bool)tx.HdmiInput.SyncDetectedFeedback.BoolValue;
+ });
+
+
+ var combinedFuncs = new VideoStatusFuncsWrapper
+ {
+ HdcpActiveFeedbackFunc = () =>
+ (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital
+ && tx.HdmiInput.VideoAttributes.HdcpActiveFeedback.BoolValue),
+
+ HdcpStateFeedbackFunc = () =>
+ {
+ if (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital)
+ return tx.HdmiInput.VideoAttributes.HdcpStateFeedback.ToString();
+ return "";
+ },
+
+ VideoResolutionFeedbackFunc = () =>
+ {
+ if (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital)
+ return tx.HdmiInput.VideoAttributes.GetVideoResolutionString();
+ if (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Analog)
+ return tx.VgaInput.VideoAttributes.GetVideoResolutionString();
+ return "";
+ },
+ VideoSyncFeedbackFunc = () =>
+ (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital
+ && tx.HdmiInput.SyncDetectedFeedback.BoolValue)
+ || (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Analog
+ && tx.VgaInput.SyncDetectedFeedback.BoolValue)
+ || (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Auto
+ && (tx.VgaInput.SyncDetectedFeedback.BoolValue || tx.HdmiInput.SyncDetectedFeedback.BoolValue))
+
+ };
+
+ AnyVideoInput = new RoutingInputPortWithVideoStatuses(DmPortName.AnyVideoIn,
+ eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.None, 0, this, combinedFuncs);
+
+ DmOutput = new RoutingOutputPort(DmPortName.DmOut, eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.DmCat, null, this);
+
+ AddToFeedbackList(ActiveVideoInputFeedback,
+ AnyVideoInput.VideoStatus.HasVideoStatusFeedback, AnyVideoInput.VideoStatus.HdcpActiveFeedback,
+ AnyVideoInput.VideoStatus.HdcpStateFeedback, AnyVideoInput.VideoStatus.VideoResolutionFeedback,
+ AnyVideoInput.VideoStatus.VideoSyncFeedback, HdmiInHdcpCapabilityFeedback, HdmiVideoSyncFeedback
+ );
+
+ // Set Ports for CEC
+ HdmiInput.Port = Tx.HdmiInput;
+ DmOutput.Port = Tx.DmOutput;
+ }
+
+
+ void Tx_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args)
+ {
+ ActiveVideoInputFeedback.FireUpdate();
+ HdmiVideoSyncFeedback.FireUpdate();
+ }
+
+ public override bool CustomActivate()
+ {
+
+ Tx.HdmiInput.InputStreamChange += (o, a) => FowardInputStreamChange(HdmiInput, a.EventId);
+ Tx.HdmiInput.VideoAttributes.AttributeChange += (o, a) => FireVideoAttributeChange(HdmiInput, a.EventId);
+
+ // Base does register and sets up comm monitoring.
+ return base.CustomActivate();
+ }
+
+ public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
+ {
+ DmTxControllerJoinMap joinMap = GetDmTxJoinMap(joinStart, joinMapKey);
+
+ if (HdmiVideoSyncFeedback != null)
+ {
+ HdmiVideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.Input1VideoSyncStatus.JoinNumber]);
+ }
+
+ LinkDmTxToApi(this, trilist, joinMap, bridge);
+ }
+
+ ///
+ /// Enables or disables free run
+ ///
+ ///
+ public void SetFreeRunEnabled(bool enable)
+ {
+ if (enable)
+ {
+ Tx.VgaInput.FreeRun = eDmFreeRunSetting.Enabled;
+ }
+ else
+ {
+ Tx.VgaInput.FreeRun = eDmFreeRunSetting.Disabled;
+ }
+ }
+
+ ///
+ /// Sets the VGA brightness level
+ ///
+ ///
+ public void SetVgaBrightness(ushort level)
+ {
+ Tx.VgaInput.VideoControls.Brightness.UShortValue = level;
+ }
+
+ ///
+ /// Sets the VGA contrast level
+ ///
+ ///
+ public void SetVgaContrast(ushort level)
+ {
+ Tx.VgaInput.VideoControls.Contrast.UShortValue = level;
+ }
+
+
+ void Tx_BaseEvent(GenericBase device, BaseEventArgs args)
+ {
+ var id = args.EventId;
+ Debug.Console(2, this, "EventId {0}", args.EventId);
+
+ if (id == EndpointTransmitterBase.VideoSourceFeedbackEventId)
+ {
+ Debug.Console(2, this, " Video Source: {0}", Tx.VideoSourceFeedback);
+ ActiveVideoInputFeedback.FireUpdate();
+ }
+
+ // ------------------------------ incomplete -----------------------------------------
+ else if (id == EndpointTransmitterBase.AudioSourceFeedbackEventId)
+ {
+ Debug.Console(2, this, " Audio Source: {0}", Tx.AudioSourceFeedback);
+ }
+ }
+
+ void InputStreamChangeEvent(EndpointInputStream inputStream, EndpointInputStreamEventArgs args)
+ {
+ Debug.Console(2, "{0} event {1} stream {2}", this.Tx.ToString(), inputStream.ToString(), args.EventId.ToString());
+
+ if (args.EventId == EndpointInputStreamEventIds.HdcpSupportOffFeedbackEventId)
+ {
+ HdmiInHdcpCapabilityFeedback.FireUpdate();
+ }
+ else if (args.EventId == EndpointInputStreamEventIds.HdcpSupportOnFeedbackEventId)
+ {
+ HdmiInHdcpCapabilityFeedback.FireUpdate();
+ }
+ }
+
+ ///
+ /// Relays the input stream change to the appropriate RoutingInputPort.
+ ///
+ void FowardInputStreamChange(RoutingInputPortWithVideoStatuses inputPort, int eventId)
+ {
+ if (eventId == EndpointInputStreamEventIds.SyncDetectedFeedbackEventId)
+ {
+ inputPort.VideoStatus.VideoSyncFeedback.FireUpdate();
+ AnyVideoInput.VideoStatus.VideoSyncFeedback.FireUpdate();
+ }
+ }
+
+ ///
+ /// Relays the VideoAttributes change to a RoutingInputPort
+ ///
+ void FireVideoAttributeChange(RoutingInputPortWithVideoStatuses inputPort, int eventId)
+ {
+ //// LOCATION: Crestron.SimplSharpPro.DM.VideoAttributeEventIds
+ //Debug.Console(2, this, "VideoAttributes_AttributeChange event id={0} from {1}",
+ // args.EventId, (sender as VideoAttributesEnhanced).Owner.GetType());
+ switch (eventId)
+ {
+ case VideoAttributeEventIds.HdcpActiveFeedbackEventId:
+ inputPort.VideoStatus.HdcpActiveFeedback.FireUpdate();
+ AnyVideoInput.VideoStatus.HdcpActiveFeedback.FireUpdate();
+ break;
+ case VideoAttributeEventIds.HdcpStateFeedbackEventId:
+ inputPort.VideoStatus.HdcpStateFeedback.FireUpdate();
+ AnyVideoInput.VideoStatus.HdcpStateFeedback.FireUpdate();
+ break;
+ case VideoAttributeEventIds.HorizontalResolutionFeedbackEventId:
+ case VideoAttributeEventIds.VerticalResolutionFeedbackEventId:
+ inputPort.VideoStatus.VideoResolutionFeedback.FireUpdate();
+ AnyVideoInput.VideoStatus.VideoResolutionFeedback.FireUpdate();
+ break;
+ case VideoAttributeEventIds.FramesPerSecondFeedbackEventId:
+ inputPort.VideoStatus.VideoResolutionFeedback.FireUpdate();
+ AnyVideoInput.VideoStatus.VideoResolutionFeedback.FireUpdate();
+ break;
+ }
+ }
+ #region IIROutputPorts Members
+ public CrestronCollection IROutputPorts { get { return Tx.IROutputPorts; } }
+ public int NumberOfIROutputPorts { get { return Tx.NumberOfIROutputPorts; } }
+ #endregion
+
+ #region IComPorts Members
+ public CrestronCollection ComPorts { get { return Tx.ComPorts; } }
+ public int NumberOfComPorts { get { return Tx.NumberOfComPorts; } }
+ #endregion
+
+ #region ICec Members
+ ///
+ /// Gets the CEC stream directly from the HDMI port.
+ ///
+ public Cec StreamCec { get { return Tx.HdmiInput.StreamCec; } }
+ #endregion
+
+
+ }
+}
\ No newline at end of file
diff --git a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/DmTx4kz302CController.cs b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/DmTx4kz302CController.cs
index c4c1ec6b..c0aebfae 100644
--- a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/DmTx4kz302CController.cs
+++ b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/DmTx4kz302CController.cs
@@ -1,352 +1,381 @@
-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.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.Core.Bridges;
-using PepperDash.Essentials.DM.Config;
-
-namespace PepperDash.Essentials.DM
-{
- using eVst = Crestron.SimplSharpPro.DeviceSupport.eX02VideoSourceType;
- using eAst = Crestron.SimplSharpPro.DeviceSupport.eX02AudioSourceType;
-
- public class DmTx4kz302CController : DmTxControllerBase, ITxRouting, IHasFeedback,
- IIROutputPorts, IComPorts
- {
- public DmTx4kz302C Tx { get; private set; }
-
- public RoutingInputPortWithVideoStatuses HdmiIn1 { get; private set; }
- public RoutingInputPortWithVideoStatuses HdmiIn2 { get; private set; }
- public RoutingInputPortWithVideoStatuses DisplayPortIn { get; private set; }
- public RoutingOutputPort DmOut { get; private set; }
- public RoutingOutputPort HdmiLoopOut { get; private set; }
-
- public override StringFeedback ActiveVideoInputFeedback { get; protected set; }
- public IntFeedback VideoSourceNumericFeedback { get; protected set; }
- public IntFeedback AudioSourceNumericFeedback { get; protected set; }
- public IntFeedback HdmiIn1HdcpCapabilityFeedback { get; protected set; }
- public IntFeedback HdmiIn2HdcpCapabilityFeedback { get; protected set; }
-
- //public override IntFeedback HdcpSupportAllFeedback { get; protected set; }
- //public override ushort HdcpSupportCapability { get; protected set; }
-
- ///
- /// Helps get the "real" inputs, including when in Auto
- ///
- public Crestron.SimplSharpPro.DeviceSupport.eX02VideoSourceType ActualActiveVideoInput
- {
- get
- {
- if (Tx.VideoSourceFeedback != eVst.Auto)
- return Tx.VideoSourceFeedback;
- else // auto
- {
- if (Tx.HdmiInputs[1].SyncDetectedFeedback.BoolValue)
- return eVst.Hdmi1;
- else if (Tx.HdmiInputs[2].SyncDetectedFeedback.BoolValue)
- return eVst.Hdmi2;
- else if (Tx.DisplayPortInput.SyncDetectedFeedback.BoolValue)
- return eVst.Vga;
- else
- return eVst.AllDisabled;
- }
- }
- }
- public RoutingPortCollection InputPorts
- {
- get
- {
- return new RoutingPortCollection
- {
- HdmiIn1,
- HdmiIn2,
- DisplayPortIn,
- AnyVideoInput
- };
- }
- }
- public RoutingPortCollection OutputPorts
- {
- get
- {
- return new RoutingPortCollection { DmOut, HdmiLoopOut };
- }
- }
- public DmTx4kz302CController(string key, string name, DmTx4kz302C tx)
- : base(key, name, tx)
- {
- Tx = tx;
-
- HdmiIn1 = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn1,
- eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, eVst.Hdmi1, this,
- VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInputs[1]));
- HdmiIn2 = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn2,
- eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, eVst.Hdmi2, this,
- VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInputs[2]));
- DisplayPortIn = new RoutingInputPortWithVideoStatuses(DmPortName.VgaIn,
- eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.DisplayPort, eVst.DisplayPort, this,
- VideoStatusHelper.GetDisplayPortInputStatusFuncs(tx.DisplayPortInput));
- ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput",
- () => ActualActiveVideoInput.ToString());
-
- Tx.HdmiInputs[1].InputStreamChange += InputStreamChangeEvent;
- Tx.HdmiInputs[2].InputStreamChange += InputStreamChangeEvent;
- Tx.BaseEvent += Tx_BaseEvent;
-
- VideoSourceNumericFeedback = new IntFeedback(() =>
- {
- return (int)Tx.VideoSourceFeedback;
- });
- AudioSourceNumericFeedback = new IntFeedback(() =>
- {
- //Doing this because 4kz302 does not allow for breakaway audio source selection
- return (int)Tx.VideoSourceFeedback;
- });
-
- HdmiIn1HdcpCapabilityFeedback = new IntFeedback("HdmiIn1HdcpCapability", () =>
- {
- return (int)tx.HdmiInputs[1].HdcpCapabilityFeedback;
- });
-
- HdmiIn2HdcpCapabilityFeedback = new IntFeedback("HdmiIn2HdcpCapability", () =>
- {
- return (int)tx.HdmiInputs[2].HdcpCapabilityFeedback;
- });
-
- HdcpSupportCapability = eHdcpCapabilityType.Hdcp2_2Support;
-
-
- var combinedFuncs = new VideoStatusFuncsWrapper
- {
- HdcpActiveFeedbackFunc = () =>
- (ActualActiveVideoInput == eVst.Hdmi1
- && tx.HdmiInputs[1].VideoAttributes.HdcpActiveFeedback.BoolValue)
- || (ActualActiveVideoInput == eVst.Hdmi2
- && tx.HdmiInputs[2].VideoAttributes.HdcpActiveFeedback.BoolValue),
-
- HdcpStateFeedbackFunc = () =>
- {
- if (ActualActiveVideoInput == eVst.Hdmi1)
- return tx.HdmiInputs[1].VideoAttributes.HdcpStateFeedback.ToString();
- if (ActualActiveVideoInput == eVst.Hdmi2)
- return tx.HdmiInputs[2].VideoAttributes.HdcpStateFeedback.ToString();
- return "";
- },
-
- VideoResolutionFeedbackFunc = () =>
- {
- if (ActualActiveVideoInput == eVst.Hdmi1)
- return tx.HdmiInputs[1].VideoAttributes.GetVideoResolutionString();
- if (ActualActiveVideoInput == eVst.Hdmi2)
- return tx.HdmiInputs[2].VideoAttributes.GetVideoResolutionString();
- if (ActualActiveVideoInput == eVst.Vga)
- return tx.DisplayPortInput.VideoAttributes.GetVideoResolutionString();
- return "";
- },
- VideoSyncFeedbackFunc = () =>
- (ActualActiveVideoInput == eVst.Hdmi1
- && tx.HdmiInputs[1].SyncDetectedFeedback.BoolValue)
- || (ActualActiveVideoInput == eVst.Hdmi2
- && tx.HdmiInputs[2].SyncDetectedFeedback.BoolValue)
- || (ActualActiveVideoInput == eVst.Vga
- && tx.DisplayPortInput.SyncDetectedFeedback.BoolValue)
-
- };
-
- AnyVideoInput = new RoutingInputPortWithVideoStatuses(DmPortName.AnyVideoIn,
- eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.None, 0, this, combinedFuncs);
-
- DmOut = new RoutingOutputPort(DmPortName.DmOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
- eRoutingPortConnectionType.DmCat, null, this);
- HdmiLoopOut = new RoutingOutputPort(DmPortName.HdmiLoopOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
- eRoutingPortConnectionType.Hdmi, null, this);
-
-
- AddToFeedbackList(ActiveVideoInputFeedback, VideoSourceNumericFeedback, AudioSourceNumericFeedback,
- AnyVideoInput.VideoStatus.HasVideoStatusFeedback, AnyVideoInput.VideoStatus.HdcpActiveFeedback,
- AnyVideoInput.VideoStatus.HdcpStateFeedback, AnyVideoInput.VideoStatus.VideoResolutionFeedback,
- AnyVideoInput.VideoStatus.VideoSyncFeedback, HdmiIn1HdcpCapabilityFeedback, HdmiIn2HdcpCapabilityFeedback);
-
- // Set Ports for CEC
- HdmiIn1.Port = Tx.HdmiInputs[1];
- HdmiIn2.Port = Tx.HdmiInputs[2];
- HdmiLoopOut.Port = Tx.HdmiOutput;
- DmOut.Port = Tx.DmOutput;
- }
-
-
-
- public override bool CustomActivate()
- {
- // Link up all of these damned events to the various RoutingPorts via a helper handler
- Tx.HdmiInputs[1].InputStreamChange += (o, a) => FowardInputStreamChange(HdmiIn1, a.EventId);
- Tx.HdmiInputs[1].VideoAttributes.AttributeChange += (o, a) => ForwardVideoAttributeChange(HdmiIn1, a.EventId);
-
- Tx.HdmiInputs[2].InputStreamChange += (o, a) => FowardInputStreamChange(HdmiIn2, a.EventId);
- Tx.HdmiInputs[2].VideoAttributes.AttributeChange += (o, a) => ForwardVideoAttributeChange(HdmiIn2, a.EventId);
-
- Tx.DisplayPortInput.InputStreamChange += (o, a) => FowardInputStreamChange(DisplayPortIn, a.EventId);
- Tx.DisplayPortInput.VideoAttributes.AttributeChange += (o, a) => ForwardVideoAttributeChange(DisplayPortIn, a.EventId);
-
- // Base does register and sets up comm monitoring.
- return base.CustomActivate();
- }
-
- public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
- {
- LinkDmTxToApi(this, trilist, joinStart, joinMapKey, bridge);
- }
-
- public void ExecuteNumericSwitch(ushort input, ushort output, eRoutingSignalType type)
- {
- Debug.Console(2, this, "Executing Numeric Switch to input {0}.", input);
-
- switch (input)
- {
- case 0:
- {
- ExecuteSwitch(eVst.Auto, null, eRoutingSignalType.Audio | eRoutingSignalType.Video);
- break;
- }
- case 1:
- {
- ExecuteSwitch(HdmiIn1.Selector, null, eRoutingSignalType.Audio | eRoutingSignalType.Video);
- break;
- }
- case 2:
- {
- ExecuteSwitch(HdmiIn2.Selector, null, eRoutingSignalType.Audio | eRoutingSignalType.Video);
- break;
- }
- case 3:
- {
- ExecuteSwitch(DisplayPortIn.Selector, null, eRoutingSignalType.Audio | eRoutingSignalType.Video);
- break;
- }
- case 4:
- {
- ExecuteSwitch(eVst.AllDisabled, null, eRoutingSignalType.Audio | eRoutingSignalType.Video);
- break;
- }
- }
-
-
- }
-
- public void ExecuteSwitch(object inputSelector, object outputSelector, eRoutingSignalType signalType)
- {
- if ((signalType | eRoutingSignalType.Video) == eRoutingSignalType.Video)
- Tx.VideoSource = (eVst)inputSelector;
-
- // NOTE: It's possible that this particular TX model may not like the AudioSource property being set.
- // The SIMPL definition only shows a single analog for AudioVideo Source
- if ((signalType | eRoutingSignalType.Audio) == eRoutingSignalType.Audio)
- {
- //it doesn't...
- Debug.Console(2, this, "Unable to execute audio-only switch for tx {0}", Key);
- //Tx.AudioSource = (eAst) inputSelector;
- }
- }
-
- void InputStreamChangeEvent(EndpointInputStream inputStream, EndpointInputStreamEventArgs args)
- {
- Debug.Console(2, "{0} event {1} stream {2}", this.Tx.ToString(), inputStream.ToString(), args.EventId.ToString());
-
- if (args.EventId == EndpointInputStreamEventIds.HdcpSupportOffFeedbackEventId)
- {
- if (inputStream == Tx.HdmiInputs[1])
- HdmiIn1HdcpCapabilityFeedback.FireUpdate();
- else if (inputStream == Tx.HdmiInputs[2])
- HdmiIn2HdcpCapabilityFeedback.FireUpdate();
- }
- else if (args.EventId == EndpointInputStreamEventIds.HdcpSupportOnFeedbackEventId)
- {
- if (inputStream == Tx.HdmiInputs[1])
- HdmiIn1HdcpCapabilityFeedback.FireUpdate();
- else if (inputStream == Tx.HdmiInputs[2])
- HdmiIn2HdcpCapabilityFeedback.FireUpdate();
- }
- }
-
- void Tx_BaseEvent(GenericBase device, BaseEventArgs args)
- {
- var id = args.EventId;
- if (id == EndpointTransmitterBase.VideoSourceFeedbackEventId)
- {
- Debug.Console(2, this, " Video Source: {0}", Tx.VideoSourceFeedback);
- VideoSourceNumericFeedback.FireUpdate();
- ActiveVideoInputFeedback.FireUpdate();
- }
-
- // ------------------------------ incomplete -----------------------------------------
- else if (id == EndpointTransmitterBase.AudioSourceFeedbackEventId)
- {
- Debug.Console(2, this, " Audio Source: {0}", Tx.AudioSourceFeedback);
- AudioSourceNumericFeedback.FireUpdate();
- }
- }
-
- ///
- /// Relays the input stream change to the appropriate RoutingInputPort.
- ///
- void FowardInputStreamChange(RoutingInputPortWithVideoStatuses inputPort, int eventId)
- {
- if (eventId == EndpointInputStreamEventIds.SyncDetectedFeedbackEventId)
- {
- inputPort.VideoStatus.VideoSyncFeedback.FireUpdate();
- AnyVideoInput.VideoStatus.VideoSyncFeedback.FireUpdate();
- }
- }
-
- ///
- /// Relays the VideoAttributes change to a RoutingInputPort
- ///
- void ForwardVideoAttributeChange(RoutingInputPortWithVideoStatuses inputPort, int eventId)
- {
- //// LOCATION: Crestron.SimplSharpPro.DM.VideoAttributeEventIds
- //Debug.Console(2, this, "VideoAttributes_AttributeChange event id={0} from {1}",
- // args.EventId, (sender as VideoAttributesEnhanced).Owner.GetType());
- switch (eventId)
- {
- case VideoAttributeEventIds.HdcpActiveFeedbackEventId:
- inputPort.VideoStatus.HdcpActiveFeedback.FireUpdate();
- AnyVideoInput.VideoStatus.HdcpActiveFeedback.FireUpdate();
- break;
- case VideoAttributeEventIds.HdcpStateFeedbackEventId:
- inputPort.VideoStatus.HdcpStateFeedback.FireUpdate();
- AnyVideoInput.VideoStatus.HdcpStateFeedback.FireUpdate();
- break;
- case VideoAttributeEventIds.HorizontalResolutionFeedbackEventId:
- case VideoAttributeEventIds.VerticalResolutionFeedbackEventId:
- inputPort.VideoStatus.VideoResolutionFeedback.FireUpdate();
- AnyVideoInput.VideoStatus.VideoResolutionFeedback.FireUpdate();
- break;
- case VideoAttributeEventIds.FramesPerSecondFeedbackEventId:
- inputPort.VideoStatus.VideoResolutionFeedback.FireUpdate();
- AnyVideoInput.VideoStatus.VideoResolutionFeedback.FireUpdate();
- break;
- }
- }
-
-
- #region IIROutputPorts Members
- public CrestronCollection IROutputPorts { get { return Tx.IROutputPorts; } }
- public int NumberOfIROutputPorts { get { return Tx.NumberOfIROutputPorts; } }
- #endregion
-
- #region IComPorts Members
- public CrestronCollection ComPorts { get { return Tx.ComPorts; } }
- public int NumberOfComPorts { get { return Tx.NumberOfComPorts; } }
- #endregion
- }
+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.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.Core.Bridges;
+using PepperDash.Essentials.DM.Config;
+
+namespace PepperDash.Essentials.DM
+{
+ using eVst = Crestron.SimplSharpPro.DeviceSupport.eX02VideoSourceType;
+ using eAst = Crestron.SimplSharpPro.DeviceSupport.eX02AudioSourceType;
+
+ public class DmTx4kz302CController : DmTxControllerBase, ITxRouting, IHasFeedback,
+ IIROutputPorts, IComPorts
+ {
+ public DmTx4kz302C Tx { get; private set; }
+
+ public RoutingInputPortWithVideoStatuses HdmiIn1 { get; private set; }
+ public RoutingInputPortWithVideoStatuses HdmiIn2 { get; private set; }
+ public RoutingInputPortWithVideoStatuses DisplayPortIn { get; private set; }
+ public RoutingOutputPort DmOut { get; private set; }
+ public RoutingOutputPort HdmiLoopOut { get; private set; }
+
+ public override StringFeedback ActiveVideoInputFeedback { get; protected set; }
+ public IntFeedback VideoSourceNumericFeedback { get; protected set; }
+ public IntFeedback AudioSourceNumericFeedback { get; protected set; }
+ public IntFeedback HdmiIn1HdcpCapabilityFeedback { get; protected set; }
+ public IntFeedback HdmiIn2HdcpCapabilityFeedback { get; protected set; }
+ public BoolFeedback Hdmi1VideoSyncFeedback { get; protected set; }
+ public BoolFeedback Hdmi2VideoSyncFeedback { get; protected set; }
+ public BoolFeedback DisplayPortVideoSyncFeedback { get; protected set; }
+
+ //public override IntFeedback HdcpSupportAllFeedback { get; protected set; }
+ //public override ushort HdcpSupportCapability { get; protected set; }
+
+ ///
+ /// Helps get the "real" inputs, including when in Auto
+ ///
+ public Crestron.SimplSharpPro.DeviceSupport.eX02VideoSourceType ActualActiveVideoInput
+ {
+ get
+ {
+ if (Tx.VideoSourceFeedback != eVst.Auto)
+ return Tx.VideoSourceFeedback;
+ else // auto
+ {
+ if (Tx.HdmiInputs[1].SyncDetectedFeedback.BoolValue)
+ return eVst.Hdmi1;
+ else if (Tx.HdmiInputs[2].SyncDetectedFeedback.BoolValue)
+ return eVst.Hdmi2;
+ else if (Tx.DisplayPortInput.SyncDetectedFeedback.BoolValue)
+ return eVst.Vga;
+ else
+ return eVst.AllDisabled;
+ }
+ }
+ }
+ public RoutingPortCollection InputPorts
+ {
+ get
+ {
+ return new RoutingPortCollection
+ {
+ HdmiIn1,
+ HdmiIn2,
+ DisplayPortIn,
+ AnyVideoInput
+ };
+ }
+ }
+ public RoutingPortCollection OutputPorts
+ {
+ get
+ {
+ return new RoutingPortCollection { DmOut, HdmiLoopOut };
+ }
+ }
+ public DmTx4kz302CController(string key, string name, DmTx4kz302C tx)
+ : base(key, name, tx)
+ {
+ Tx = tx;
+
+ HdmiIn1 = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn1,
+ eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, eVst.Hdmi1, this,
+ VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInputs[1]));
+ HdmiIn2 = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn2,
+ eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, eVst.Hdmi2, this,
+ VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInputs[2]));
+ DisplayPortIn = new RoutingInputPortWithVideoStatuses(DmPortName.VgaIn,
+ eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.DisplayPort, eVst.DisplayPort, this,
+ VideoStatusHelper.GetDisplayPortInputStatusFuncs(tx.DisplayPortInput));
+ ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput",
+ () => ActualActiveVideoInput.ToString());
+
+ Tx.HdmiInputs[1].InputStreamChange += InputStreamChangeEvent;
+ Tx.HdmiInputs[2].InputStreamChange += InputStreamChangeEvent;
+ Tx.BaseEvent += Tx_BaseEvent;
+
+ VideoSourceNumericFeedback = new IntFeedback(() =>
+ {
+ return (int)Tx.VideoSourceFeedback;
+ });
+ AudioSourceNumericFeedback = new IntFeedback(() =>
+ {
+ return (int)Tx.AudioSourceFeedback;
+ });
+
+ HdmiIn1HdcpCapabilityFeedback = new IntFeedback("HdmiIn1HdcpCapability", () =>
+ {
+ return (int)tx.HdmiInputs[1].HdcpCapabilityFeedback;
+ });
+
+ HdmiIn2HdcpCapabilityFeedback = new IntFeedback("HdmiIn2HdcpCapability", () =>
+ {
+ return (int)tx.HdmiInputs[2].HdcpCapabilityFeedback;
+ });
+
+ HdcpSupportCapability = eHdcpCapabilityType.Hdcp2_2Support;
+
+ Hdmi1VideoSyncFeedback = new BoolFeedback(() =>
+ {
+ return (bool)tx.HdmiInputs[1].SyncDetectedFeedback.BoolValue;
+ });
+
+ Hdmi2VideoSyncFeedback = new BoolFeedback(() =>
+ {
+ return (bool)tx.HdmiInputs[2].SyncDetectedFeedback.BoolValue;
+ });
+
+ DisplayPortVideoSyncFeedback = new BoolFeedback(() =>
+ {
+ return (bool)tx.DisplayPortInput.SyncDetectedFeedback.BoolValue;
+ });
+
+
+ var combinedFuncs = new VideoStatusFuncsWrapper
+ {
+ HdcpActiveFeedbackFunc = () =>
+ (ActualActiveVideoInput == eVst.Hdmi1
+ && tx.HdmiInputs[1].VideoAttributes.HdcpActiveFeedback.BoolValue)
+ || (ActualActiveVideoInput == eVst.Hdmi2
+ && tx.HdmiInputs[2].VideoAttributes.HdcpActiveFeedback.BoolValue),
+
+ HdcpStateFeedbackFunc = () =>
+ {
+ if (ActualActiveVideoInput == eVst.Hdmi1)
+ return tx.HdmiInputs[1].VideoAttributes.HdcpStateFeedback.ToString();
+ if (ActualActiveVideoInput == eVst.Hdmi2)
+ return tx.HdmiInputs[2].VideoAttributes.HdcpStateFeedback.ToString();
+ return "";
+ },
+
+ VideoResolutionFeedbackFunc = () =>
+ {
+ if (ActualActiveVideoInput == eVst.Hdmi1)
+ return tx.HdmiInputs[1].VideoAttributes.GetVideoResolutionString();
+ if (ActualActiveVideoInput == eVst.Hdmi2)
+ return tx.HdmiInputs[2].VideoAttributes.GetVideoResolutionString();
+ if (ActualActiveVideoInput == eVst.Vga)
+ return tx.DisplayPortInput.VideoAttributes.GetVideoResolutionString();
+ return "";
+ },
+ VideoSyncFeedbackFunc = () =>
+ (ActualActiveVideoInput == eVst.Hdmi1
+ && tx.HdmiInputs[1].SyncDetectedFeedback.BoolValue)
+ || (ActualActiveVideoInput == eVst.Hdmi2
+ && tx.HdmiInputs[2].SyncDetectedFeedback.BoolValue)
+ || (ActualActiveVideoInput == eVst.Vga
+ && tx.DisplayPortInput.SyncDetectedFeedback.BoolValue)
+
+ };
+
+ AnyVideoInput = new RoutingInputPortWithVideoStatuses(DmPortName.AnyVideoIn,
+ eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.None, 0, this, combinedFuncs);
+
+ DmOut = new RoutingOutputPort(DmPortName.DmOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
+ eRoutingPortConnectionType.DmCat, null, this);
+ HdmiLoopOut = new RoutingOutputPort(DmPortName.HdmiLoopOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
+ eRoutingPortConnectionType.Hdmi, null, this);
+
+
+ AddToFeedbackList(ActiveVideoInputFeedback, VideoSourceNumericFeedback, AudioSourceNumericFeedback,
+ AnyVideoInput.VideoStatus.HasVideoStatusFeedback, AnyVideoInput.VideoStatus.HdcpActiveFeedback,
+ AnyVideoInput.VideoStatus.HdcpStateFeedback, AnyVideoInput.VideoStatus.VideoResolutionFeedback,
+ AnyVideoInput.VideoStatus.VideoSyncFeedback, HdmiIn1HdcpCapabilityFeedback, HdmiIn2HdcpCapabilityFeedback,
+ Hdmi1VideoSyncFeedback, Hdmi2VideoSyncFeedback, DisplayPortVideoSyncFeedback);
+
+ // Set Ports for CEC
+ HdmiIn1.Port = Tx.HdmiInputs[1];
+ HdmiIn2.Port = Tx.HdmiInputs[2];
+ HdmiLoopOut.Port = Tx.HdmiOutput;
+ DmOut.Port = Tx.DmOutput;
+ }
+
+
+
+ public override bool CustomActivate()
+ {
+ // Link up all of these damned events to the various RoutingPorts via a helper handler
+ Tx.HdmiInputs[1].InputStreamChange += (o, a) => FowardInputStreamChange(HdmiIn1, a.EventId);
+ Tx.HdmiInputs[1].VideoAttributes.AttributeChange += (o, a) => ForwardVideoAttributeChange(HdmiIn1, a.EventId);
+
+ Tx.HdmiInputs[2].InputStreamChange += (o, a) => FowardInputStreamChange(HdmiIn2, a.EventId);
+ Tx.HdmiInputs[2].VideoAttributes.AttributeChange += (o, a) => ForwardVideoAttributeChange(HdmiIn2, a.EventId);
+
+ Tx.DisplayPortInput.InputStreamChange += (o, a) => FowardInputStreamChange(DisplayPortIn, a.EventId);
+ Tx.DisplayPortInput.VideoAttributes.AttributeChange += (o, a) => ForwardVideoAttributeChange(DisplayPortIn, a.EventId);
+
+ // Base does register and sets up comm monitoring.
+ return base.CustomActivate();
+ }
+
+ public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
+ {
+ DmTxControllerJoinMap joinMap = GetDmTxJoinMap(joinStart, joinMapKey);
+
+ if (Hdmi1VideoSyncFeedback != null)
+ {
+ Hdmi1VideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.Input1VideoSyncStatus.JoinNumber]);
+ }
+ if (Hdmi2VideoSyncFeedback != null)
+ {
+ Hdmi2VideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.Input2VideoSyncStatus.JoinNumber]);
+ }
+ if (DisplayPortVideoSyncFeedback != null)
+ {
+ DisplayPortVideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.Input3VideoSyncStatus.JoinNumber]);
+ }
+
+ LinkDmTxToApi(this, trilist, joinMap, bridge);
+ }
+
+ public void ExecuteNumericSwitch(ushort input, ushort output, eRoutingSignalType type)
+ {
+ Debug.Console(2, this, "Executing Numeric Switch to input {0}.", input);
+
+ switch (input)
+ {
+ case 0:
+ {
+ ExecuteSwitch(eVst.Auto, null, eRoutingSignalType.Audio | eRoutingSignalType.Video);
+ break;
+ }
+ case 1:
+ {
+ ExecuteSwitch(HdmiIn1.Selector, null, eRoutingSignalType.Audio | eRoutingSignalType.Video);
+ break;
+ }
+ case 2:
+ {
+ ExecuteSwitch(HdmiIn2.Selector, null, eRoutingSignalType.Audio | eRoutingSignalType.Video);
+ break;
+ }
+ case 3:
+ {
+ ExecuteSwitch(DisplayPortIn.Selector, null, eRoutingSignalType.Audio | eRoutingSignalType.Video);
+ break;
+ }
+ case 4:
+ {
+ ExecuteSwitch(eVst.AllDisabled, null, eRoutingSignalType.Audio | eRoutingSignalType.Video);
+ break;
+ }
+ }
+
+
+ }
+
+ public void ExecuteSwitch(object inputSelector, object outputSelector, eRoutingSignalType signalType)
+ {
+ if ((signalType | eRoutingSignalType.Video) == eRoutingSignalType.Video)
+ Tx.VideoSource = (eVst)inputSelector;
+
+ // NOTE: It's possible that this particular TX model may not like the AudioSource property being set.
+ // The SIMPL definition only shows a single analog for AudioVideo Source
+ if ((signalType | eRoutingSignalType.Audio) == eRoutingSignalType.Audio)
+ Tx.AudioSource = (eAst)inputSelector;
+ }
+
+ void InputStreamChangeEvent(EndpointInputStream inputStream, EndpointInputStreamEventArgs args)
+ {
+ Debug.Console(2, "{0} event {1} stream {2}", this.Tx.ToString(), inputStream.ToString(), args.EventId.ToString());
+
+ if (args.EventId == EndpointInputStreamEventIds.HdcpSupportOffFeedbackEventId)
+ {
+ if (inputStream == Tx.HdmiInputs[1])
+ HdmiIn1HdcpCapabilityFeedback.FireUpdate();
+ else if (inputStream == Tx.HdmiInputs[2])
+ HdmiIn2HdcpCapabilityFeedback.FireUpdate();
+ }
+ else if (args.EventId == EndpointInputStreamEventIds.HdcpSupportOnFeedbackEventId)
+ {
+ if (inputStream == Tx.HdmiInputs[1])
+ HdmiIn1HdcpCapabilityFeedback.FireUpdate();
+ else if (inputStream == Tx.HdmiInputs[2])
+ HdmiIn2HdcpCapabilityFeedback.FireUpdate();
+ }
+ }
+
+ void Tx_BaseEvent(GenericBase device, BaseEventArgs args)
+ {
+ var id = args.EventId;
+ if (id == EndpointTransmitterBase.VideoSourceFeedbackEventId)
+ {
+ Debug.Console(2, this, " Video Source: {0}", Tx.VideoSourceFeedback);
+ VideoSourceNumericFeedback.FireUpdate();
+ ActiveVideoInputFeedback.FireUpdate();
+ }
+
+ // ------------------------------ incomplete -----------------------------------------
+ else if (id == EndpointTransmitterBase.AudioSourceFeedbackEventId)
+ {
+ Debug.Console(2, this, " Audio Source: {0}", Tx.AudioSourceFeedback);
+ AudioSourceNumericFeedback.FireUpdate();
+ }
+ }
+
+ ///
+ /// Relays the input stream change to the appropriate RoutingInputPort.
+ ///
+ void FowardInputStreamChange(RoutingInputPortWithVideoStatuses inputPort, int eventId)
+ {
+ if (eventId == EndpointInputStreamEventIds.SyncDetectedFeedbackEventId)
+ {
+ inputPort.VideoStatus.VideoSyncFeedback.FireUpdate();
+ AnyVideoInput.VideoStatus.VideoSyncFeedback.FireUpdate();
+ }
+ }
+
+ ///
+ /// Relays the VideoAttributes change to a RoutingInputPort
+ ///
+ void ForwardVideoAttributeChange(RoutingInputPortWithVideoStatuses inputPort, int eventId)
+ {
+ //// LOCATION: Crestron.SimplSharpPro.DM.VideoAttributeEventIds
+ //Debug.Console(2, this, "VideoAttributes_AttributeChange event id={0} from {1}",
+ // args.EventId, (sender as VideoAttributesEnhanced).Owner.GetType());
+ switch (eventId)
+ {
+ case VideoAttributeEventIds.HdcpActiveFeedbackEventId:
+ inputPort.VideoStatus.HdcpActiveFeedback.FireUpdate();
+ AnyVideoInput.VideoStatus.HdcpActiveFeedback.FireUpdate();
+ break;
+ case VideoAttributeEventIds.HdcpStateFeedbackEventId:
+ inputPort.VideoStatus.HdcpStateFeedback.FireUpdate();
+ AnyVideoInput.VideoStatus.HdcpStateFeedback.FireUpdate();
+ break;
+ case VideoAttributeEventIds.HorizontalResolutionFeedbackEventId:
+ case VideoAttributeEventIds.VerticalResolutionFeedbackEventId:
+ inputPort.VideoStatus.VideoResolutionFeedback.FireUpdate();
+ AnyVideoInput.VideoStatus.VideoResolutionFeedback.FireUpdate();
+ break;
+ case VideoAttributeEventIds.FramesPerSecondFeedbackEventId:
+ inputPort.VideoStatus.VideoResolutionFeedback.FireUpdate();
+ AnyVideoInput.VideoStatus.VideoResolutionFeedback.FireUpdate();
+ break;
+ }
+ }
+
+
+ #region IIROutputPorts Members
+ public CrestronCollection IROutputPorts { get { return Tx.IROutputPorts; } }
+ public int NumberOfIROutputPorts { get { return Tx.NumberOfIROutputPorts; } }
+ #endregion
+
+ #region IComPorts Members
+ public CrestronCollection ComPorts { get { return Tx.ComPorts; } }
+ public int NumberOfComPorts { get { return Tx.NumberOfComPorts; } }
+ #endregion
+ }
}
\ No newline at end of file
diff --git a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/DmTxHelpers.cs b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/DmTxHelpers.cs
index 81a56008..9fe81c92 100644
--- a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/DmTxHelpers.cs
+++ b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/DmTxHelpers.cs
@@ -43,8 +43,12 @@ namespace PepperDash.Essentials.DM
{
if(typeName.StartsWith("dmtx200"))
return new DmTx200Controller(key, name, new DmTx200C2G(ipid, Global.ControlSystem));
- if (typeName.StartsWith("dmtx201"))
- return new DmTx201XController(key, name, new DmTx201S(ipid, Global.ControlSystem));
+ if (typeName.StartsWith("dmtx4kz100"))
+ return new DmTx4kz100Controller(key, name, new DmTx4kz100C1G(ipid, Global.ControlSystem));
+ if (typeName.StartsWith("dmtx201c"))
+ return new DmTx201CController(key, name, new DmTx201C(ipid, Global.ControlSystem));
+ if (typeName.StartsWith("dmtx201s"))
+ return new DmTx201SController(key, name, new DmTx201S(ipid, Global.ControlSystem));
if (typeName.StartsWith("dmtx4k202"))
return new DmTx4k202CController(key, name, new DmTx4k202C(ipid, Global.ControlSystem));
if (typeName.StartsWith("dmtx4kz202"))
@@ -100,10 +104,14 @@ namespace PepperDash.Essentials.DM
{
if (typeName.StartsWith("dmtx200"))
return new DmTx200Controller(key, name, new DmTx200C2G(chassis.Inputs[num]));
- if (typeName.StartsWith("dmtx201"))
- return new DmTx201XController(key, name, new DmTx201C(chassis.Inputs[num]));
+ if (typeName.StartsWith("dmtx201c"))
+ return new DmTx201CController(key, name, new DmTx201C(chassis.Inputs[num]));
+ if (typeName.StartsWith("dmtx201s"))
+ return new DmTx201SController(key, name, new DmTx201S(chassis.Inputs[num]));
if (typeName.StartsWith("dmtx4k100"))
return new DmTx4k100Controller(key, name, new DmTx4K100C1G(chassis.Inputs[num]));
+ if (typeName.StartsWith("dmtx4kz100"))
+ return new DmTx4kz100Controller(key, name, new DmTx4kz100C1G(chassis.Inputs[num]));
if (typeName.StartsWith("dmtx4k202"))
return new DmTx4k202CController(key, name, new DmTx4k202C(chassis.Inputs[num]));
if (typeName.StartsWith("dmtx4kz202"))
@@ -119,10 +127,14 @@ namespace PepperDash.Essentials.DM
{
if (typeName.StartsWith("dmtx200"))
return new DmTx200Controller(key, name, new DmTx200C2G(ipid, chassis.Inputs[num]));
- if (typeName.StartsWith("dmtx201"))
- return new DmTx201XController(key, name, new DmTx201C(ipid, chassis.Inputs[num]));
+ if (typeName.StartsWith("dmtx201c"))
+ return new DmTx201CController(key, name, new DmTx201C(ipid, chassis.Inputs[num]));
+ if (typeName.StartsWith("dmtx201s"))
+ return new DmTx201SController(key, name, new DmTx201S(ipid, chassis.Inputs[num]));
if (typeName.StartsWith("dmtx4k100"))
return new DmTx4k100Controller(key, name, new DmTx4K100C1G(ipid, chassis.Inputs[num]));
+ if (typeName.StartsWith("dmtx4kz100"))
+ return new DmTx4kz100Controller(key, name, new DmTx4kz100C1G(ipid, chassis.Inputs[num]));
if (typeName.StartsWith("dmtx4k202"))
return new DmTx4k202CController(key, name, new DmTx4k202C(ipid, chassis.Inputs[num]));
if (typeName.StartsWith("dmtx4kz202"))
@@ -171,18 +183,20 @@ namespace PepperDash.Essentials.DM
{
}
- protected void LinkDmTxToApi(DmTxControllerBase tx, BasicTriList trilist, uint joinStart, string joinMapKey,
- EiscApiAdvanced bridge)
- {
- var joinMap = new DmTxControllerJoinMap();
+ protected DmTxControllerJoinMap GetDmTxJoinMap(uint joinStart, string joinMapKey)
+ {
+ var joinMap = new DmTxControllerJoinMap(joinStart);
var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
if (!string.IsNullOrEmpty(joinMapSerialized))
joinMap = JsonConvert.DeserializeObject(joinMapSerialized);
- joinMap.OffsetJoinNumbers(joinStart);
+ return joinMap;
+ }
+ protected void LinkDmTxToApi(DmTxControllerBase tx, BasicTriList trilist, DmTxControllerJoinMap joinMap, EiscApiAdvanced bridge)
+ {
if (tx.Hardware is DmHDBasedTEndPoint)
{
Debug.Console(1, tx, "No properties to link. Skipping device {0}", tx.Name);
@@ -191,10 +205,10 @@ namespace PepperDash.Essentials.DM
Debug.Console(1, tx, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
- tx.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
- tx.AnyVideoInput.VideoStatus.VideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.VideoSyncStatus]);
- tx.AnyVideoInput.VideoStatus.VideoResolutionFeedback.LinkInputSig(trilist.StringInput[joinMap.CurrentInputResolution]);
- trilist.UShortInput[joinMap.HdcpSupportCapability].UShortValue = (ushort)tx.HdcpSupportCapability;
+ tx.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline.JoinNumber]);
+ tx.AnyVideoInput.VideoStatus.VideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.VideoSyncStatus.JoinNumber]);
+ tx.AnyVideoInput.VideoStatus.VideoResolutionFeedback.LinkInputSig(trilist.StringInput[joinMap.CurrentInputResolution.JoinNumber]);
+ trilist.UShortInput[joinMap.HdcpSupportCapability.JoinNumber].UShortValue = (ushort)tx.HdcpSupportCapability;
bool hdcpTypeSimple;
@@ -207,15 +221,15 @@ namespace PepperDash.Essentials.DM
{
var txR = tx as ITxRouting;
- trilist.SetUShortSigAction(joinMap.VideoInput,
+ trilist.SetUShortSigAction(joinMap.VideoInput.JoinNumber,
i => txR.ExecuteNumericSwitch(i, 0, eRoutingSignalType.Video));
- trilist.SetUShortSigAction(joinMap.AudioInput,
+ trilist.SetUShortSigAction(joinMap.AudioInput.JoinNumber,
i => txR.ExecuteNumericSwitch(i, 0, eRoutingSignalType.Audio));
- txR.VideoSourceNumericFeedback.LinkInputSig(trilist.UShortInput[joinMap.VideoInput]);
- txR.AudioSourceNumericFeedback.LinkInputSig(trilist.UShortInput[joinMap.AudioInput]);
+ txR.VideoSourceNumericFeedback.LinkInputSig(trilist.UShortInput[joinMap.VideoInput.JoinNumber]);
+ txR.AudioSourceNumericFeedback.LinkInputSig(trilist.UShortInput[joinMap.AudioInput.JoinNumber]);
- trilist.UShortInput[joinMap.HdcpSupportCapability].UShortValue = (ushort)tx.HdcpSupportCapability;
+ trilist.UShortInput[joinMap.HdcpSupportCapability.JoinNumber].UShortValue = (ushort)tx.HdcpSupportCapability;
if (txR.InputPorts[DmPortName.HdmiIn] != null)
{
@@ -225,14 +239,14 @@ namespace PepperDash.Essentials.DM
{
var intFeedback = tx.Feedbacks["HdmiInHdcpCapability"] as IntFeedback;
if (intFeedback != null)
- intFeedback.LinkInputSig(trilist.UShortInput[joinMap.Port1HdcpState]);
+ intFeedback.LinkInputSig(trilist.UShortInput[joinMap.Port1HdcpState.JoinNumber]);
}
if (inputPort.ConnectionType == eRoutingPortConnectionType.Hdmi && inputPort.Port != null)
{
var port = inputPort.Port as EndpointHdmiInput;
- SetHdcpCapabilityAction(hdcpTypeSimple, port, joinMap.Port1HdcpState, trilist);
+ SetHdcpCapabilityAction(hdcpTypeSimple, port, joinMap.Port1HdcpState.JoinNumber, trilist);
}
}
@@ -244,14 +258,14 @@ namespace PepperDash.Essentials.DM
{
var intFeedback = tx.Feedbacks["HdmiIn1HdcpCapability"] as IntFeedback;
if (intFeedback != null)
- intFeedback.LinkInputSig(trilist.UShortInput[joinMap.Port1HdcpState]);
+ intFeedback.LinkInputSig(trilist.UShortInput[joinMap.Port1HdcpState.JoinNumber]);
}
if (inputPort.ConnectionType == eRoutingPortConnectionType.Hdmi && inputPort.Port != null)
{
var port = inputPort.Port as EndpointHdmiInput;
- SetHdcpCapabilityAction(hdcpTypeSimple, port, joinMap.Port1HdcpState, trilist);
+ SetHdcpCapabilityAction(hdcpTypeSimple, port, joinMap.Port1HdcpState.JoinNumber, trilist);
}
}
@@ -263,14 +277,14 @@ namespace PepperDash.Essentials.DM
{
var intFeedback = tx.Feedbacks["HdmiIn2HdcpCapability"] as IntFeedback;
if (intFeedback != null)
- intFeedback.LinkInputSig(trilist.UShortInput[joinMap.Port1HdcpState]);
+ intFeedback.LinkInputSig(trilist.UShortInput[joinMap.Port1HdcpState.JoinNumber]);
}
if (inputPort.ConnectionType == eRoutingPortConnectionType.Hdmi && inputPort.Port != null)
{
var port = inputPort.Port as EndpointHdmiInput;
- SetHdcpCapabilityAction(hdcpTypeSimple, port, joinMap.Port2HdcpState, trilist);
+ SetHdcpCapabilityAction(hdcpTypeSimple, port, joinMap.Port2HdcpState.JoinNumber, trilist);
}
}
@@ -279,19 +293,19 @@ namespace PepperDash.Essentials.DM
var txFreeRun = tx as IHasFreeRun;
if (txFreeRun != null)
{
- txFreeRun.FreeRunEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.FreeRunEnabled]);
- trilist.SetBoolSigAction(joinMap.FreeRunEnabled, new Action(txFreeRun.SetFreeRunEnabled));
+ txFreeRun.FreeRunEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.FreeRunEnabled.JoinNumber]);
+ trilist.SetBoolSigAction(joinMap.FreeRunEnabled.JoinNumber, new Action(txFreeRun.SetFreeRunEnabled));
}
var txVga = tx as IVgaBrightnessContrastControls;
{
if (txVga == null) return;
- txVga.VgaBrightnessFeedback.LinkInputSig(trilist.UShortInput[joinMap.VgaBrightness]);
- txVga.VgaContrastFeedback.LinkInputSig(trilist.UShortInput[joinMap.VgaContrast]);
+ txVga.VgaBrightnessFeedback.LinkInputSig(trilist.UShortInput[joinMap.VgaBrightness.JoinNumber]);
+ txVga.VgaContrastFeedback.LinkInputSig(trilist.UShortInput[joinMap.VgaContrast.JoinNumber]);
- trilist.SetUShortSigAction(joinMap.VgaBrightness, txVga.SetVgaBrightness);
- trilist.SetUShortSigAction(joinMap.VgaContrast, txVga.SetVgaContrast);
+ trilist.SetUShortSigAction(joinMap.VgaBrightness.JoinNumber, txVga.SetVgaBrightness);
+ trilist.SetUShortSigAction(joinMap.VgaContrast.JoinNumber, txVga.SetVgaContrast);
}
}
@@ -327,7 +341,8 @@ namespace PepperDash.Essentials.DM
{
public DmTxControllerFactory()
{
- TypeNames = new List() { "dmtx200c", "dmtx201c", "dmtx201s", "dmtx4k100c", "dmtx4k202c", "dmtx4kz202c", "dmtx4k302c", "dmtx4kz302c", "dmtx401c", "dmtx401s" };
+ TypeNames = new List() { "dmtx200c", "dmtx201c", "dmtx201s", "dmtx4k100c", "dmtx4k202c", "dmtx4kz202c", "dmtx4k302c", "dmtx4kz302c",
+ "dmtx401c", "dmtx401s", "dmtx4k100c1g", "dmtx4kz100c1g" };
}
public override EssentialsDevice BuildDevice(DeviceConfig dc)
diff --git a/essentials-framework/Essentials DM/Essentials_DM/PepperDash_Essentials_DM.csproj b/essentials-framework/Essentials DM/Essentials_DM/PepperDash_Essentials_DM.csproj
index 7ab8a5a9..7fc4f24d 100644
--- a/essentials-framework/Essentials DM/Essentials_DM/PepperDash_Essentials_DM.csproj
+++ b/essentials-framework/Essentials DM/Essentials_DM/PepperDash_Essentials_DM.csproj
@@ -1,159 +1,164 @@
-
-
- Release
- AnyCPU
- 9.0.30729
- 2.0
- {9199CE8A-0C9F-4952-8672-3EED798B284F}
- Library
- Properties
- PepperDash_Essentials_DM
- PepperDash_Essentials_DM
- {0B4745B0-194B-4BB6-8E21-E9057CA92300};{4D628B5B-2FBC-4AA6-8C16-197242AEB884};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
- WindowsCE
- E2BECB1F-8C8C-41ba-B736-9BE7D946A398
- 5.0
- SmartDeviceProject1
- v3.5
- Windows CE
-
-
-
-
- .allowedReferenceRelatedFileExtensions
- true
- full
- false
- bin\
- DEBUG;TRACE;
- prompt
- 4
- 512
- true
- true
- off
-
-
- .allowedReferenceRelatedFileExtensions
- none
- true
- bin\
- prompt
- 4
- 512
- true
- true
- off
-
-
-
- False
- ..\..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.DeviceSupport.dll
-
-
- False
- ..\..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.DM.dll
-
-
- False
- ..\..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.UI.dll
-
-
-
- False
- ..\..\pepperdashcore-builds\PepperDash_Core.dll
-
-
- False
- ..\..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpCustomAttributesInterface.dll
- False
-
-
- False
- ..\..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpHelperInterface.dll
- False
-
-
- False
- ..\..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpNewtonsoft.dll
-
-
- False
- ..\..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpPro.exe
- False
-
-
- False
- ..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpReflectionInterface.dll
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5}
- PepperDash_Essentials_Core
-
-
-
-
-
-
-
-
- rem S# Pro preparation will execute after these operations
-
+
+
+ Release
+ AnyCPU
+ 9.0.30729
+ 2.0
+ {9199CE8A-0C9F-4952-8672-3EED798B284F}
+ Library
+ Properties
+ PepperDash_Essentials_DM
+ PepperDash_Essentials_DM
+ {0B4745B0-194B-4BB6-8E21-E9057CA92300};{4D628B5B-2FBC-4AA6-8C16-197242AEB884};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
+ WindowsCE
+ E2BECB1F-8C8C-41ba-B736-9BE7D946A398
+ 5.0
+ SmartDeviceProject1
+ v3.5
+ Windows CE
+
+
+
+
+ .allowedReferenceRelatedFileExtensions
+ true
+ full
+ false
+ bin\
+ DEBUG;TRACE;
+ prompt
+ 4
+ 512
+ true
+ true
+ off
+
+
+ .allowedReferenceRelatedFileExtensions
+ none
+ true
+ bin\
+ prompt
+ 4
+ 512
+ true
+ true
+ off
+
+
+
+ False
+ ..\..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.DeviceSupport.dll
+
+
+ False
+ ..\..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.DM.dll
+
+
+ False
+ ..\..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.UI.dll
+
+
+
+ False
+ ..\..\pepperdashcore-builds\PepperDash_Core.dll
+
+
+ False
+ ..\..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpCustomAttributesInterface.dll
+ False
+
+
+ False
+ ..\..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpHelperInterface.dll
+ False
+
+
+ False
+ ..\..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpNewtonsoft.dll
+
+
+ False
+ ..\..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpPro.exe
+ False
+
+
+ False
+ ..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpReflectionInterface.dll
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5}
+ PepperDash_Essentials_Core
+
+
+
+
+
+
+
+
+ rem S# Pro preparation will execute after these operations
+
\ No newline at end of file
diff --git a/essentials-framework/Essentials Devices Common/Essentials Devices Common/Environment/Lutron/LutronQuantum.cs b/essentials-framework/Essentials Devices Common/Essentials Devices Common/Environment/Lutron/LutronQuantum.cs
index 84cf46c2..23bbc913 100644
--- a/essentials-framework/Essentials Devices Common/Essentials Devices Common/Environment/Lutron/LutronQuantum.cs
+++ b/essentials-framework/Essentials Devices Common/Essentials Devices Common/Environment/Lutron/LutronQuantum.cs
@@ -85,8 +85,8 @@ namespace PepperDash.Essentials.Devices.Common.Environment.Lutron
{
var joinMap = LinkLightingToApi(this, trilist, joinStart, joinMapKey, bridge);
- CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
- trilist.SetStringSigAction(joinMap.IntegrationIdSet, s => IntegrationId = s);
+ CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline.JoinNumber]);
+ trilist.SetStringSigAction(joinMap.IntegrationIdSet.JoinNumber , s => IntegrationId = s);
}
void socket_ConnectionChange(object sender, GenericSocketStatusChageEventArgs e)
diff --git a/essentials-framework/Essentials Devices Common/Essentials Devices Common/Essentials Devices Common.csproj b/essentials-framework/Essentials Devices Common/Essentials Devices Common/Essentials Devices Common.csproj
index 147ace5b..83065b05 100644
--- a/essentials-framework/Essentials Devices Common/Essentials Devices Common/Essentials Devices Common.csproj
+++ b/essentials-framework/Essentials Devices Common/Essentials Devices Common/Essentials Devices Common.csproj
@@ -67,6 +67,10 @@
False
..\..\pepperdashcore-builds\PepperDash_Core.dll
+
+ False
+ ..\..\Essentials Core\PepperDashEssentialsBase\bin\PepperDash_Essentials_Core.dll
+
False
..\..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpCustomAttributesInterface.dll
@@ -110,6 +114,7 @@
+
@@ -180,12 +185,6 @@
-
-
- {A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5}
- PepperDash_Essentials_Core
-
-
diff --git a/essentials-framework/Essentials Devices Common/Essentials Devices Common/Occupancy/CenOdtOccupancySensorBaseController.cs b/essentials-framework/Essentials Devices Common/Essentials Devices Common/Occupancy/CenOdtOccupancySensorBaseController.cs
new file mode 100644
index 00000000..eb3172d9
--- /dev/null
+++ b/essentials-framework/Essentials Devices Common/Essentials Devices Common/Occupancy/CenOdtOccupancySensorBaseController.cs
@@ -0,0 +1,565 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Crestron.SimplSharp;
+using Crestron.SimplSharpPro.DeviceSupport;
+using Crestron.SimplSharpPro.GeneralIO;
+using Newtonsoft.Json;
+using PepperDash.Core;
+using PepperDash.Essentials.Core;
+using PepperDash.Essentials.Core.Config;
+using PepperDash.Essentials.Core.Bridges;
+
+namespace PepperDash.Essentials.Devices.Common.Occupancy
+{
+ public class CenOdtOccupancySensorBaseController : CrestronGenericBridgeableBaseDevice, IOccupancyStatusProvider
+ {
+ public CenOdtCPoe OccSensor { get; private set; }
+
+ public BoolFeedback RoomIsOccupiedFeedback { get; private set; }
+
+ public BoolFeedback GraceOccupancyDetectedFeedback { get; private set; }
+
+ public BoolFeedback RawOccupancyFeedback { get; private set; }
+
+ public BoolFeedback PirSensorEnabledFeedback { get; private set; }
+
+ public BoolFeedback LedFlashEnabledFeedback { get; private set; }
+
+ public BoolFeedback ShortTimeoutEnabledFeedback { get; private set; }
+
+ public IntFeedback PirSensitivityInVacantStateFeedback { get; private set; }
+
+ public IntFeedback PirSensitivityInOccupiedStateFeedback { get; private set; }
+
+ public IntFeedback CurrentTimeoutFeedback { get; private set; }
+
+ public IntFeedback RemoteTimeoutFeedback { get; private set; }
+
+ public IntFeedback InternalPhotoSensorValue { get; set; }
+
+ public IntFeedback ExternalPhotoSensorValue { get; set; }
+
+ public BoolFeedback OrWhenVacatedFeedback { get; private set; }
+
+ public BoolFeedback AndWhenVacatedFeedback { get; private set; }
+
+ public BoolFeedback UltrasonicAEnabledFeedback { get; private set; }
+
+ public BoolFeedback UltrasonicBEnabledFeedback { get; private set; }
+
+ public IntFeedback UltrasonicSensitivityInVacantStateFeedback { get; private set; }
+
+ public IntFeedback UltrasonicSensitivityInOccupiedStateFeedback { get; private set; }
+
+ public BoolFeedback RawOccupancyPirFeedback { get; private set; }
+
+ public BoolFeedback RawOccupancyUsFeedback { get; private set; }
+
+ // Debug properties
+ public bool InTestMode { get; private set; }
+
+ public bool TestRoomIsOccupiedFeedback { get; private set; }
+
+ public Func RoomIsOccupiedFeedbackFunc
+ {
+ get
+ {
+ return () => InTestMode ? TestRoomIsOccupiedFeedback : OccSensor.OccupancyDetectedFeedback.BoolValue;
+ }
+ }
+
+ public CenOdtOccupancySensorBaseController(string key, string name, CenOdtCPoe sensor)
+ : base(key, name, sensor)
+ {
+ OccSensor = sensor;
+
+ RoomIsOccupiedFeedback = new BoolFeedback(RoomIsOccupiedFeedbackFunc);
+
+ PirSensorEnabledFeedback = new BoolFeedback(() => OccSensor.PassiveInfraredSensorEnabledFeedback.BoolValue);
+
+ LedFlashEnabledFeedback = new BoolFeedback(() => OccSensor.LedFlashEnabledFeedback.BoolValue);
+
+ ShortTimeoutEnabledFeedback = new BoolFeedback(() => OccSensor.ShortTimeoutEnabledFeedback.BoolValue);
+
+ PirSensitivityInVacantStateFeedback = new IntFeedback(() => (int)OccSensor.PassiveInfraredSensorSensitivityInVacantStateFeedback);
+
+ PirSensitivityInOccupiedStateFeedback = new IntFeedback(() => (int)OccSensor.PassiveInfraredSensorSensitivityInOccupiedStateFeedback);
+
+ CurrentTimeoutFeedback = new IntFeedback(() => OccSensor.CurrentTimeoutFeedback.UShortValue);
+
+ RemoteTimeoutFeedback = new IntFeedback(() => OccSensor.RemoteTimeout.UShortValue);
+
+ GraceOccupancyDetectedFeedback = new BoolFeedback(() => OccSensor.GraceOccupancyDetectedFeedback.BoolValue);
+
+ RawOccupancyFeedback = new BoolFeedback(() => OccSensor.RawOccupancyDetectedFeedback.BoolValue);
+
+ InternalPhotoSensorValue = new IntFeedback(() => OccSensor.InternalPhotoSensorValueFeedback.UShortValue);
+
+ //ExternalPhotoSensorValue = new IntFeedback(() => OccSensor.ex.UShortValue);
+
+ AndWhenVacatedFeedback = new BoolFeedback(() => OccSensor.AndWhenVacatedFeedback.BoolValue);
+
+ OrWhenVacatedFeedback = new BoolFeedback(() => OccSensor.OrWhenVacatedFeedback.BoolValue);
+
+ UltrasonicAEnabledFeedback = new BoolFeedback(() => OccSensor.UltrasonicSensorSideAEnabledFeedback.BoolValue);
+
+ UltrasonicBEnabledFeedback = new BoolFeedback(() => OccSensor.UltrasonicSensorSideBEnabledFeedback.BoolValue);
+
+ RawOccupancyPirFeedback = new BoolFeedback(() => OccSensor.RawOccupancyDetectedByPassiveInfraredSensorFeedback.BoolValue);
+
+ RawOccupancyUsFeedback = new BoolFeedback(() => OccSensor.RawOccupancyDetectedByUltrasonicSensorFeedback.BoolValue);
+
+ UltrasonicSensitivityInVacantStateFeedback = new IntFeedback(() => (int)OccSensor.UltrasonicSensorSensitivityInVacantStateFeedback);
+
+ UltrasonicSensitivityInOccupiedStateFeedback = new IntFeedback(() => (int)OccSensor.UltrasonicSensorSensitivityInOccupiedStateFeedback);
+
+ OccSensor.BaseEvent += new Crestron.SimplSharpPro.BaseEventHandler(OccSensor_BaseEvent);
+
+ OccSensor.CenOccupancySensorChange += new GenericEventHandler(OccSensor_CenOccupancySensorChange);
+
+ }
+
+
+
+
+
+
+ ///
+ /// Catches events for feedbacks on the base class. Any extending wrapper class should call this delegate after it checks for it's own event IDs.
+ ///
+ ///
+ ///
+ protected virtual void OccSensor_CenOccupancySensorChange(object device, GenericEventArgs args)
+ {
+ if (args.EventId == GlsOccupancySensorBase.PirEnabledFeedbackEventId)
+ PirSensorEnabledFeedback.FireUpdate();
+ else if (args.EventId == GlsOccupancySensorBase.LedFlashEnabledFeedbackEventId)
+ LedFlashEnabledFeedback.FireUpdate();
+ else if (args.EventId == GlsOccupancySensorBase.ShortTimeoutEnabledFeedbackEventId)
+ ShortTimeoutEnabledFeedback.FireUpdate();
+ else if (args.EventId == GlsOccupancySensorBase.PirSensitivityInOccupiedStateFeedbackEventId)
+ PirSensitivityInOccupiedStateFeedback.FireUpdate();
+ else if (args.EventId == GlsOccupancySensorBase.PirSensitivityInVacantStateFeedbackEventId)
+ PirSensitivityInVacantStateFeedback.FireUpdate();
+ else if (args.EventId == GlsOccupancySensorBase.RawOccupancyPirFeedbackEventId)
+ RawOccupancyPirFeedback.FireUpdate();
+ else if (args.EventId == GlsOccupancySensorBase.RawOccupancyUsFeedbackEventId)
+ RawOccupancyUsFeedback.FireUpdate();
+ }
+
+ protected virtual void OccSensor_BaseEvent(Crestron.SimplSharpPro.GenericBase device, Crestron.SimplSharpPro.BaseEventArgs args)
+ {
+ Debug.Console(2, this, "PoEOccupancySensorChange EventId: {0}", args.EventId);
+
+ if (args.EventId == Crestron.SimplSharpPro.GeneralIO.GlsOccupancySensorBase.RoomOccupiedFeedbackEventId
+ || args.EventId == Crestron.SimplSharpPro.GeneralIO.GlsOccupancySensorBase.RoomVacantFeedbackEventId)
+ {
+ Debug.Console(1, this, "Occupancy State: {0}", OccSensor.OccupancyDetectedFeedback.BoolValue);
+ RoomIsOccupiedFeedback.FireUpdate();
+ }
+ else if (args.EventId == GlsOccupancySensorBase.TimeoutFeedbackEventId)
+ CurrentTimeoutFeedback.FireUpdate();
+ else if (args.EventId == GlsOccupancySensorBase.TimeoutLocalFeedbackEventId)
+ RemoteTimeoutFeedback.FireUpdate();
+ else if (args.EventId == GlsOccupancySensorBase.GraceOccupancyDetectedFeedbackEventId)
+ GraceOccupancyDetectedFeedback.FireUpdate();
+ else if (args.EventId == GlsOccupancySensorBase.RawOccupancyFeedbackEventId)
+ RawOccupancyFeedback.FireUpdate();
+ else if (args.EventId == GlsOccupancySensorBase.InternalPhotoSensorValueFeedbackEventId)
+ InternalPhotoSensorValue.FireUpdate();
+ else if (args.EventId == GlsOccupancySensorBase.ExternalPhotoSensorValueFeedbackEventId)
+ ExternalPhotoSensorValue.FireUpdate();
+ else if (args.EventId == GlsOccupancySensorBase.AndWhenVacatedFeedbackEventId)
+ AndWhenVacatedFeedback.FireUpdate();
+ else if (args.EventId == GlsOccupancySensorBase.OrWhenVacatedFeedbackEventId)
+ OrWhenVacatedFeedback.FireUpdate();
+ else if (args.EventId == GlsOccupancySensorBase.UsAEnabledFeedbackEventId)
+ UltrasonicAEnabledFeedback.FireUpdate();
+ else if (args.EventId == GlsOccupancySensorBase.UsBEnabledFeedbackEventId)
+ UltrasonicBEnabledFeedback.FireUpdate();
+ else if (args.EventId == GlsOccupancySensorBase.UsSensitivityInOccupiedStateFeedbackEventId)
+ UltrasonicSensitivityInOccupiedStateFeedback.FireUpdate();
+ else if (args.EventId == GlsOccupancySensorBase.UsSensitivityInVacantStateFeedbackEventId)
+ UltrasonicSensitivityInVacantStateFeedback.FireUpdate();
+ }
+
+ public void SetTestMode(bool mode)
+ {
+ InTestMode = mode;
+
+ Debug.Console(1, this, "In Mock Mode: '{0}'", InTestMode);
+ }
+
+ public void SetTestOccupiedState(bool state)
+ {
+ if (!InTestMode)
+ Debug.Console(1, "Mock mode not enabled");
+ else
+ {
+ TestRoomIsOccupiedFeedback = state;
+
+ RoomIsOccupiedFeedback.FireUpdate();
+ }
+ }
+
+ ///
+ /// Enables or disables the PIR sensor
+ ///
+ ///
+ public void SetPirEnable(bool state)
+ {
+ if (state)
+ {
+ OccSensor.EnablePassiveInfraredSensor();
+ }
+ else
+ {
+ OccSensor.DisablePassiveInfraredSensor();
+ }
+ }
+
+ ///
+ /// Enables or disables the LED Flash
+ ///
+ ///
+ public void SetLedFlashEnable(bool state)
+ {
+ if (state)
+ {
+ OccSensor.EnableLedFlash();
+ }
+ else
+ {
+ OccSensor.DisableLedFlash();
+ }
+ }
+
+ ///
+ /// Enables or disables short timeout based on state
+ ///
+ ///
+ public void SetShortTimeoutState(bool state)
+ {
+ if (state)
+ {
+ OccSensor.EnableShortTimeout();
+ }
+ else
+ {
+ OccSensor.DisableShortTimeout();
+ }
+ }
+
+ public void IncrementPirSensitivityInOccupiedState(bool pressRelease)
+ {
+ if ((int)OccSensor.PassiveInfraredSensorSensitivityInOccupiedStateFeedback != 3)
+ {
+ OccSensor.PassiveInfraredSensorSensitivityInOccupiedState = OccSensor.PassiveInfraredSensorSensitivityInOccupiedStateFeedback + 1;
+ }
+ }
+
+ public void DecrementPirSensitivityInOccupiedState(bool pressRelease)
+ {
+ if ((int)OccSensor.PassiveInfraredSensorSensitivityInOccupiedStateFeedback != 0)
+ {
+ OccSensor.PassiveInfraredSensorSensitivityInOccupiedState = OccSensor.PassiveInfraredSensorSensitivityInOccupiedStateFeedback - 1;
+ }
+ }
+
+ public void IncrementPirSensitivityInVacantState(bool pressRelease)
+ {
+ if ((int)OccSensor.PassiveInfraredSensorSensitivityInVacantStateFeedback != 3)
+ {
+ OccSensor.PassiveInfraredSensorSensitivityInVacantState = OccSensor.PassiveInfraredSensorSensitivityInVacantStateFeedback + 1;
+ }
+ }
+
+ public void DecrementPirSensitivityInVacantState(bool pressRelease)
+ {
+ if ((int)OccSensor.PassiveInfraredSensorSensitivityInVacantStateFeedback != 0)
+ {
+ OccSensor.PassiveInfraredSensorSensitivityInVacantState = OccSensor.PassiveInfraredSensorSensitivityInVacantStateFeedback - 1;
+ }
+ }
+
+ public void IncrementUsSensitivityInOccupiedState(bool pressRelease)
+ {
+ if ((int)OccSensor.UltrasonicSensorSensitivityInOccupiedStateFeedback < 3)
+ {
+ OccSensor.UltrasonicSensorSensitivityInOccupiedState = OccSensor.UltrasonicSensorSensitivityInOccupiedStateFeedback + 1;
+ }
+ else if ((int)OccSensor.UltrasonicSensorSensitivityInOccupiedStateFeedback > 4)
+ {
+ OccSensor.UltrasonicSensorSensitivityInOccupiedState = OccSensor.UltrasonicSensorSensitivityInOccupiedStateFeedback - 1;
+ }
+ else if ((int)OccSensor.UltrasonicSensorSensitivityInOccupiedStateFeedback == 4)
+ {
+ OccSensor.UltrasonicSensorSensitivityInOccupiedState = 0;
+ }
+ }
+
+ public void DecrementUsSensitivityInOccupiedState(bool pressRelease)
+ {
+ if ((int)OccSensor.UltrasonicSensorSensitivityInOccupiedStateFeedback > 0
+ && (int)OccSensor.UltrasonicSensorSensitivityInOccupiedStateFeedback < 4)
+ {
+ OccSensor.UltrasonicSensorSensitivityInOccupiedState = OccSensor.UltrasonicSensorSensitivityInOccupiedStateFeedback - 1;
+ }
+ else if ((int)OccSensor.UltrasonicSensorSensitivityInOccupiedStateFeedback > 3
+ && (int)OccSensor.UltrasonicSensorSensitivityInOccupiedStateFeedback < 7)
+ {
+ OccSensor.UltrasonicSensorSensitivityInOccupiedState = OccSensor.UltrasonicSensorSensitivityInOccupiedStateFeedback + 1;
+ }
+ }
+
+ public void IncrementUsSensitivityInVacantState(bool pressRelease)
+ {
+ if ((int)OccSensor.UltrasonicSensorSensitivityInVacantStateFeedback < 3)
+ {
+ OccSensor.UltrasonicSensorSensitivityInVacantState = OccSensor.UltrasonicSensorSensitivityInVacantStateFeedback + 1;
+ }
+ else if ((int)OccSensor.UltrasonicSensorSensitivityInVacantStateFeedback > 4)
+ {
+ OccSensor.UltrasonicSensorSensitivityInVacantState = OccSensor.UltrasonicSensorSensitivityInVacantStateFeedback - 1;
+ }
+ else if ((int)OccSensor.UltrasonicSensorSensitivityInVacantStateFeedback == 4)
+ {
+ OccSensor.UltrasonicSensorSensitivityInVacantState = 0;
+ }
+ }
+
+ public void DecrementUsSensitivityInVacantState(bool pressRelease)
+ {
+ if ((int)OccSensor.UltrasonicSensorSensitivityInVacantStateFeedback > 0
+ && (int)OccSensor.UltrasonicSensorSensitivityInVacantStateFeedback < 4)
+ {
+ OccSensor.UltrasonicSensorSensitivityInVacantState = OccSensor.UltrasonicSensorSensitivityInVacantStateFeedback - 1;
+ }
+ else if ((int)OccSensor.UltrasonicSensorSensitivityInVacantStateFeedback > 3
+ && (int)OccSensor.UltrasonicSensorSensitivityInVacantStateFeedback < 7)
+ {
+ OccSensor.UltrasonicSensorSensitivityInVacantState = OccSensor.UltrasonicSensorSensitivityInVacantStateFeedback + 1;
+ }
+ }
+
+ public void ForceOccupied()
+ {
+ OccSensor.ForceOccupied();
+ }
+
+ public void ForceVacant()
+ {
+ OccSensor.ForceVacant();
+ }
+
+ public void EnableRawStates(bool state)
+ {
+ if (state)
+ {
+ OccSensor.EnableRawStates();
+ }
+ else
+ OccSensor.DisableRawStates();
+ }
+
+ public void SetRemoteTimeout(ushort time)
+ {
+ OccSensor.RemoteTimeout.UShortValue = time;
+ }
+
+ public void SetInternalPhotoSensorMinChange(ushort value)
+ {
+ OccSensor.InternalPhotoSensorMinimumChange.UShortValue = value;
+ }
+
+ ///
+ /// Sets the OrWhenVacated state
+ ///
+ ///
+ public void SetOrWhenVacatedState(bool state)
+ {
+ if (state)
+ {
+ OccSensor.OrWhenVacated();
+ }
+ }
+
+ ///
+ /// Sets the AndWhenVacated state
+ ///
+ ///
+ public void SetAndWhenVacatedState(bool state)
+ {
+ if (state)
+ {
+ OccSensor.AndWhenVacated();
+ }
+ }
+
+ ///
+ /// Enables or disables the Ultrasonic A sensor
+ ///
+ ///
+ public void SetUsAEnable(bool state)
+ {
+ if (state)
+ {
+ OccSensor.EnableUltrasonicSensorSideA();
+ }
+ else
+ {
+ OccSensor.DisableUltrasonicSensorSideA();
+ }
+ }
+
+
+ ///
+ /// Enables or disables the Ultrasonic B sensor
+ ///
+ ///
+ public void SetUsBEnable(bool state)
+ {
+ if (state)
+ {
+ OccSensor.EnableUltrasonicSensorSideB();
+ }
+ else
+ {
+ OccSensor.DisableUltrasonicSensorSideB();
+ }
+ }
+
+ public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
+ {
+ LinkOccSensorToApi(this, trilist, joinStart, joinMapKey, bridge);
+ }
+
+ protected void LinkOccSensorToApi(CenOdtOccupancySensorBaseController occController,
+ BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
+ {
+ CenOdtOccupancySensorBaseJoinMap joinMap = new CenOdtOccupancySensorBaseJoinMap(joinStart);
+
+ var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
+
+ if (!string.IsNullOrEmpty(joinMapSerialized))
+ joinMap = JsonConvert.DeserializeObject(joinMapSerialized);
+
+ bridge.AddJoinMap(Key, joinMap);
+
+ Debug.Console(1, occController, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
+
+ occController.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.Online.JoinNumber]);
+ trilist.StringInput[joinMap.Name.JoinNumber].StringValue = occController.Name;
+
+ trilist.OnlineStatusChange += new Crestron.SimplSharpPro.OnlineStatusChangeEventHandler((d, args) =>
+ {
+ if (args.DeviceOnLine)
+ {
+ trilist.StringInput[joinMap.Name.JoinNumber].StringValue = occController.Name;
+ }
+ }
+ );
+
+ // Occupied status
+ trilist.SetSigTrueAction(joinMap.ForceOccupied.JoinNumber, new Action(() => occController.ForceOccupied()));
+ trilist.SetSigTrueAction(joinMap.ForceVacant.JoinNumber, new Action(() => occController.ForceVacant()));
+ occController.RoomIsOccupiedFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RoomOccupiedFeedback.JoinNumber]);
+ occController.RoomIsOccupiedFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.RoomVacantFeedback.JoinNumber]);
+ occController.RawOccupancyFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RawOccupancyFeedback.JoinNumber]);
+ trilist.SetBoolSigAction(joinMap.EnableRawStates.JoinNumber, new Action((b) => occController.EnableRawStates(b)));
+
+ // Timouts
+ trilist.SetUShortSigAction(joinMap.Timeout.JoinNumber, new Action((u) => occController.SetRemoteTimeout(u)));
+ occController.CurrentTimeoutFeedback.LinkInputSig(trilist.UShortInput[joinMap.Timeout.JoinNumber]);
+ occController.RemoteTimeoutFeedback.LinkInputSig(trilist.UShortInput[joinMap.TimeoutLocalFeedback.JoinNumber]);
+
+ // LED Flash
+ trilist.SetSigTrueAction(joinMap.EnableLedFlash.JoinNumber, new Action(() => occController.SetLedFlashEnable(true)));
+ trilist.SetSigTrueAction(joinMap.DisableLedFlash.JoinNumber, new Action(() => occController.SetLedFlashEnable(false)));
+ occController.LedFlashEnabledFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.EnableLedFlash.JoinNumber]);
+
+ // Short Timeout
+ trilist.SetSigTrueAction(joinMap.EnableShortTimeout.JoinNumber, new Action(() => occController.SetShortTimeoutState(true)));
+ trilist.SetSigTrueAction(joinMap.DisableShortTimeout.JoinNumber, new Action(() => occController.SetShortTimeoutState(false)));
+ occController.ShortTimeoutEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.EnableShortTimeout.JoinNumber]);
+
+ // PIR Sensor
+ trilist.SetSigTrueAction(joinMap.EnablePir.JoinNumber, new Action(() => occController.SetPirEnable(true)));
+ trilist.SetSigTrueAction(joinMap.DisablePir.JoinNumber, new Action(() => occController.SetPirEnable(false)));
+ occController.PirSensorEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.EnablePir.JoinNumber]);
+
+ // PIR Sensitivity in Occupied State
+ trilist.SetBoolSigAction(joinMap.IncrementPirInOccupiedState.JoinNumber, new Action((b) => occController.IncrementPirSensitivityInOccupiedState(b)));
+ trilist.SetBoolSigAction(joinMap.DecrementPirInOccupiedState.JoinNumber, new Action((b) => occController.DecrementPirSensitivityInOccupiedState(b)));
+ occController.PirSensitivityInOccupiedStateFeedback.LinkInputSig(trilist.UShortInput[joinMap.PirSensitivityInOccupiedState.JoinNumber]);
+
+ // PIR Sensitivity in Vacant State
+ trilist.SetBoolSigAction(joinMap.IncrementPirInVacantState.JoinNumber, new Action((b) => occController.IncrementPirSensitivityInVacantState(b)));
+ trilist.SetBoolSigAction(joinMap.DecrementPirInVacantState.JoinNumber, new Action((b) => occController.DecrementPirSensitivityInVacantState(b)));
+ occController.PirSensitivityInVacantStateFeedback.LinkInputSig(trilist.UShortInput[joinMap.PirSensitivityInVacantState.JoinNumber]);
+
+ // OR When Vacated
+ trilist.SetBoolSigAction(joinMap.OrWhenVacated.JoinNumber, new Action((b) => occController.SetOrWhenVacatedState(b)));
+ occController.OrWhenVacatedFeedback.LinkInputSig(trilist.BooleanInput[joinMap.OrWhenVacated.JoinNumber]);
+
+ // AND When Vacated
+ trilist.SetBoolSigAction(joinMap.AndWhenVacated.JoinNumber, new Action((b) => occController.SetAndWhenVacatedState(b)));
+ occController.AndWhenVacatedFeedback.LinkInputSig(trilist.BooleanInput[joinMap.AndWhenVacated.JoinNumber]);
+
+ // Ultrasonic A Sensor
+ trilist.SetSigTrueAction(joinMap.EnableUsA.JoinNumber, new Action(() => occController.SetUsAEnable(true)));
+ trilist.SetSigTrueAction(joinMap.DisableUsA.JoinNumber, new Action(() => occController.SetUsAEnable(false)));
+ occController.UltrasonicAEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.EnableUsA.JoinNumber]);
+
+ // Ultrasonic B Sensor
+ trilist.SetSigTrueAction(joinMap.EnableUsB.JoinNumber, new Action(() => occController.SetUsBEnable(true)));
+ trilist.SetSigTrueAction(joinMap.DisableUsB.JoinNumber, new Action(() => occController.SetUsBEnable(false)));
+ occController.UltrasonicAEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.EnableUsB.JoinNumber]);
+
+ // US Sensitivity in Occupied State
+ trilist.SetBoolSigAction(joinMap.IncrementUsInOccupiedState.JoinNumber, new Action((b) => occController.IncrementUsSensitivityInOccupiedState(b)));
+ trilist.SetBoolSigAction(joinMap.DecrementUsInOccupiedState.JoinNumber, new Action((b) => occController.DecrementUsSensitivityInOccupiedState(b)));
+ occController.UltrasonicSensitivityInOccupiedStateFeedback.LinkInputSig(trilist.UShortInput[joinMap.UsSensitivityInOccupiedState.JoinNumber]);
+
+ // US Sensitivity in Vacant State
+ trilist.SetBoolSigAction(joinMap.IncrementUsInVacantState.JoinNumber, new Action((b) => occController.IncrementUsSensitivityInVacantState(b)));
+ trilist.SetBoolSigAction(joinMap.DecrementUsInVacantState.JoinNumber, new Action((b) => occController.DecrementUsSensitivityInVacantState(b)));
+ occController.UltrasonicSensitivityInVacantStateFeedback.LinkInputSig(trilist.UShortInput[joinMap.UsSensitivityInVacantState.JoinNumber]);
+
+ //Sensor Raw States
+ occController.RawOccupancyPirFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RawOccupancyPirFeedback.JoinNumber]);
+ occController.RawOccupancyUsFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RawOccupancyUsFeedback.JoinNumber]);
+
+ }
+
+ public class CenOdtOccupancySensorBaseControllerFactory : EssentialsDeviceFactory
+ {
+ public CenOdtOccupancySensorBaseControllerFactory()
+ {
+ TypeNames = new List() { "cenodtcpoe", "cenodtocc" };
+ }
+
+ public override EssentialsDevice BuildDevice(DeviceConfig dc)
+ {
+ Debug.Console(1, "Factory Attempting to create new GlsOccupancySensorBaseController Device");
+
+ var typeName = dc.Type.ToLower();
+ var key = dc.Key;
+ var name = dc.Name;
+ var comm = CommFactory.GetControlPropertiesConfig(dc);
+
+ var occSensor = new CenOdtCPoe(comm.IpIdInt, Global.ControlSystem);
+
+ if (occSensor == null)
+ {
+ Debug.Console(0, "ERROR: Unable to create Occupancy Sensor Device. Key: '{0}'", key);
+ return null;
+ }
+
+ return new CenOdtOccupancySensorBaseController(key, name, occSensor);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/essentials-framework/Essentials Devices Common/Essentials Devices Common/Occupancy/GlsOccupancySensorBaseController.cs b/essentials-framework/Essentials Devices Common/Essentials Devices Common/Occupancy/GlsOccupancySensorBaseController.cs
index 18bdb1be..907e8461 100644
--- a/essentials-framework/Essentials Devices Common/Essentials Devices Common/Occupancy/GlsOccupancySensorBaseController.cs
+++ b/essentials-framework/Essentials Devices Common/Essentials Devices Common/Occupancy/GlsOccupancySensorBaseController.cs
@@ -1,403 +1,403 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Crestron.SimplSharp;
-using Crestron.SimplSharpPro.DeviceSupport;
-using Crestron.SimplSharpPro.GeneralIO;
-using Newtonsoft.Json;
-using PepperDash.Core;
-using PepperDash.Essentials.Core;
-using PepperDash.Essentials.Core.Config;
-using PepperDash.Essentials.Core.Bridges;
-
-namespace PepperDash.Essentials.Devices.Common.Occupancy
-{
- public class GlsOccupancySensorBaseController : CrestronGenericBridgeableBaseDevice, IOccupancyStatusProvider
- {
- public GlsOccupancySensorBase OccSensor { get; private set; }
-
- public BoolFeedback RoomIsOccupiedFeedback { get; private set; }
-
- public BoolFeedback GraceOccupancyDetectedFeedback { get; private set; }
-
- public BoolFeedback RawOccupancyFeedback { get; private set; }
-
- public BoolFeedback PirSensorEnabledFeedback { get; private set; }
-
- public BoolFeedback LedFlashEnabledFeedback { get; private set; }
-
- public BoolFeedback ShortTimeoutEnabledFeedback { get; private set; }
-
- public IntFeedback PirSensitivityInVacantStateFeedback { get; private set; }
-
- public IntFeedback PirSensitivityInOccupiedStateFeedback { get; private set; }
-
- public IntFeedback CurrentTimeoutFeedback { get; private set; }
-
- public IntFeedback LocalTimoutFeedback { get; private set; }
-
- public IntFeedback InternalPhotoSensorValue { get; set; }
-
- public IntFeedback ExternalPhotoSensorValue { get; set; }
-
- // Debug properties
- public bool InTestMode { get; private set; }
-
- public bool TestRoomIsOccupiedFeedback { get; private set; }
-
- public Func RoomIsOccupiedFeedbackFunc
- {
- get
- {
- return () => InTestMode ? TestRoomIsOccupiedFeedback : OccSensor.OccupancyDetectedFeedback.BoolValue;
- }
- }
-
- public GlsOccupancySensorBaseController(string key, string name, GlsOccupancySensorBase sensor)
- : base(key, name, sensor)
- {
- OccSensor = sensor;
-
- RoomIsOccupiedFeedback = new BoolFeedback(RoomIsOccupiedFeedbackFunc);
-
- PirSensorEnabledFeedback = new BoolFeedback(() => OccSensor.PirEnabledFeedback.BoolValue);
-
- LedFlashEnabledFeedback = new BoolFeedback(() => OccSensor.LedFlashEnabledFeedback.BoolValue);
-
- ShortTimeoutEnabledFeedback = new BoolFeedback(() => OccSensor.ShortTimeoutEnabledFeedback.BoolValue);
-
- PirSensitivityInVacantStateFeedback = new IntFeedback(() => OccSensor.PirSensitivityInVacantStateFeedback.UShortValue);
-
- PirSensitivityInOccupiedStateFeedback = new IntFeedback(() => OccSensor.PirSensitivityInOccupiedStateFeedback.UShortValue);
-
- CurrentTimeoutFeedback = new IntFeedback(() => OccSensor.CurrentTimeoutFeedback.UShortValue);
-
- LocalTimoutFeedback = new IntFeedback(() => OccSensor.LocalTimeoutFeedback.UShortValue);
-
- GraceOccupancyDetectedFeedback = new BoolFeedback(() => OccSensor.GraceOccupancyDetectedFeedback.BoolValue);
-
- RawOccupancyFeedback = new BoolFeedback(() => OccSensor.RawOccupancyFeedback.BoolValue);
-
- InternalPhotoSensorValue = new IntFeedback(() => OccSensor.InternalPhotoSensorValueFeedback.UShortValue);
-
- ExternalPhotoSensorValue = new IntFeedback(() => OccSensor.ExternalPhotoSensorValueFeedback.UShortValue);
-
- OccSensor.BaseEvent += new Crestron.SimplSharpPro.BaseEventHandler(OccSensor_BaseEvent);
-
- OccSensor.GlsOccupancySensorChange += new GlsOccupancySensorChangeEventHandler(OccSensor_GlsOccupancySensorChange);
- }
-
-
- ///
- /// Catches events for feedbacks on the base class. Any extending wrapper class should call this delegate after it checks for it's own event IDs.
- ///
- ///
- ///
- protected virtual void OccSensor_GlsOccupancySensorChange(GlsOccupancySensorBase device, GlsOccupancySensorChangeEventArgs args)
- {
- if (args.EventId == GlsOccupancySensorBase.PirEnabledFeedbackEventId)
- PirSensorEnabledFeedback.FireUpdate();
- else if (args.EventId == GlsOccupancySensorBase.LedFlashEnabledFeedbackEventId)
- LedFlashEnabledFeedback.FireUpdate();
- else if (args.EventId == GlsOccupancySensorBase.ShortTimeoutEnabledFeedbackEventId)
- ShortTimeoutEnabledFeedback.FireUpdate();
- else if (args.EventId == GlsOccupancySensorBase.PirSensitivityInOccupiedStateFeedbackEventId)
- PirSensitivityInOccupiedStateFeedback.FireUpdate();
- else if (args.EventId == GlsOccupancySensorBase.PirSensitivityInVacantStateFeedbackEventId)
- PirSensitivityInVacantStateFeedback.FireUpdate();
- }
-
- protected virtual void OccSensor_BaseEvent(Crestron.SimplSharpPro.GenericBase device, Crestron.SimplSharpPro.BaseEventArgs args)
- {
- Debug.Console(2, this, "GlsOccupancySensorChange EventId: {0}", args.EventId);
-
- if (args.EventId == Crestron.SimplSharpPro.GeneralIO.GlsOccupancySensorBase.RoomOccupiedFeedbackEventId
- || args.EventId == Crestron.SimplSharpPro.GeneralIO.GlsOccupancySensorBase.RoomVacantFeedbackEventId)
- {
- Debug.Console(1, this, "Occupancy State: {0}", OccSensor.OccupancyDetectedFeedback.BoolValue);
- RoomIsOccupiedFeedback.FireUpdate();
- }
- else if (args.EventId == GlsOccupancySensorBase.TimeoutFeedbackEventId)
- CurrentTimeoutFeedback.FireUpdate();
- else if (args.EventId == GlsOccupancySensorBase.TimeoutLocalFeedbackEventId)
- LocalTimoutFeedback.FireUpdate();
- else if (args.EventId == GlsOccupancySensorBase.GraceOccupancyDetectedFeedbackEventId)
- GraceOccupancyDetectedFeedback.FireUpdate();
- else if (args.EventId == GlsOccupancySensorBase.RawOccupancyFeedbackEventId)
- RawOccupancyFeedback.FireUpdate();
- else if (args.EventId == GlsOccupancySensorBase.InternalPhotoSensorValueFeedbackEventId)
- InternalPhotoSensorValue.FireUpdate();
- else if (args.EventId == GlsOccupancySensorBase.ExternalPhotoSensorValueFeedbackEventId)
- ExternalPhotoSensorValue.FireUpdate();
- }
-
- public void SetTestMode(bool mode)
- {
- InTestMode = mode;
-
- Debug.Console(1, this, "In Mock Mode: '{0}'", InTestMode);
- }
-
- public void SetTestOccupiedState(bool state)
- {
- if (!InTestMode)
- Debug.Console(1, "Mock mode not enabled");
- else
- {
- TestRoomIsOccupiedFeedback = state;
-
- RoomIsOccupiedFeedback.FireUpdate();
- }
- }
-
- ///
- /// Enables or disables the PIR sensor
- ///
- ///
- public void SetPirEnable(bool state)
- {
- if (state)
- {
- OccSensor.EnablePir.BoolValue = state;
- OccSensor.DisablePir.BoolValue = !state;
- }
- else
- {
- OccSensor.EnablePir.BoolValue = state;
- OccSensor.DisablePir.BoolValue = !state;
- }
- }
-
- ///
- /// Enables or disables the LED Flash
- ///
- ///
- public void SetLedFlashEnable(bool state)
- {
- if (state)
- {
- OccSensor.EnableLedFlash.BoolValue = state;
- OccSensor.DisableLedFlash.BoolValue = !state;
- }
- else
- {
- OccSensor.EnableLedFlash.BoolValue = state;
- OccSensor.DisableLedFlash.BoolValue = !state;
- }
- }
-
- ///
- /// Enables or disables short timeout based on state
- ///
- ///
- public void SetShortTimeoutState(bool state)
- {
- if (state)
- {
- OccSensor.EnableShortTimeout.BoolValue = state;
- OccSensor.DisableShortTimeout.BoolValue = !state;
- }
- else
- {
- OccSensor.EnableShortTimeout.BoolValue = state;
- OccSensor.DisableShortTimeout.BoolValue = !state;
- }
- }
-
- public void IncrementPirSensitivityInOccupiedState(bool pressRelease)
- {
- OccSensor.IncrementPirSensitivityInOccupiedState.BoolValue = pressRelease;
- }
-
- public void DecrementPirSensitivityInOccupiedState(bool pressRelease)
- {
- OccSensor.DecrementPirSensitivityInOccupiedState.BoolValue = pressRelease;
- }
-
- public void IncrementPirSensitivityInVacantState(bool pressRelease)
- {
- OccSensor.IncrementPirSensitivityInVacantState.BoolValue = pressRelease;
- }
-
- public void DecrementPirSensitivityInVacantState(bool pressRelease)
- {
- OccSensor.DecrementPirSensitivityInVacantState.BoolValue = pressRelease;
- }
-
- public void ForceOccupied()
- {
- OccSensor.ForceOccupied.BoolValue = true;
- }
-
- public void ForceVacant()
- {
- OccSensor.ForceVacant.BoolValue = true;
- }
-
- public void EnableRawStates(bool state)
- {
- OccSensor.EnableRawStates.BoolValue = state;
- }
-
- public void SetRemoteTimeout(ushort time)
- {
- OccSensor.RemoteTimeout.UShortValue = time;
- }
-
- public void SetInternalPhotoSensorMinChange(ushort value)
- {
- OccSensor.InternalPhotoSensorMinimumChange.UShortValue = value;
- }
-
- public void SetExternalPhotoSensorMinChange(ushort value)
- {
- OccSensor.ExternalPhotoSensorMinimumChange.UShortValue = value;
- }
-
-
-
- protected void LinkOccSensorToApi(GlsOccupancySensorBaseController occController, BasicTriList trilist,
- uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
- {
- var joinMap = new GlsOccupancySensorBaseJoinMap();
-
- var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
-
- if (!string.IsNullOrEmpty(joinMapSerialized))
- joinMap = JsonConvert.DeserializeObject(joinMapSerialized);
-
- joinMap.OffsetJoinNumbers(joinStart);
-
- Debug.Console(1, occController, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
-
- #region Single and Dual Sensor Stuff
- occController.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
- trilist.StringInput[joinMap.Name].StringValue = occController.Name;
-
- trilist.OnlineStatusChange += (d, args) =>
- {
- if (args.DeviceOnLine)
- {
- trilist.StringInput[joinMap.Name].StringValue = occController.Name;
- }
- };
-
- // Occupied status
- trilist.SetSigTrueAction(joinMap.ForceOccupied, occController.ForceOccupied);
- trilist.SetSigTrueAction(joinMap.ForceVacant, occController.ForceVacant);
- occController.RoomIsOccupiedFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RoomOccupiedFeedback]);
- occController.RoomIsOccupiedFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.RoomVacantFeedback]);
- occController.RawOccupancyFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RawOccupancyFeedback]);
- trilist.SetBoolSigAction(joinMap.EnableRawStates, occController.EnableRawStates);
-
- // Timouts
- trilist.SetUShortSigAction(joinMap.Timeout, occController.SetRemoteTimeout);
- occController.CurrentTimeoutFeedback.LinkInputSig(trilist.UShortInput[joinMap.Timeout]);
- occController.LocalTimoutFeedback.LinkInputSig(trilist.UShortInput[joinMap.TimeoutLocalFeedback]);
-
- // LED Flash
- trilist.SetSigTrueAction(joinMap.EnableLedFlash, () => occController.SetLedFlashEnable(true));
- trilist.SetSigTrueAction(joinMap.DisableLedFlash, () => occController.SetLedFlashEnable(false));
- occController.LedFlashEnabledFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.EnableLedFlash]);
-
- // Short Timeout
- trilist.SetSigTrueAction(joinMap.EnableShortTimeout, () => occController.SetShortTimeoutState(true));
- trilist.SetSigTrueAction(joinMap.DisableShortTimeout, () => occController.SetShortTimeoutState(false));
- occController.ShortTimeoutEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.EnableShortTimeout]);
-
- // PIR Sensor
- trilist.SetSigTrueAction(joinMap.EnablePir, () => occController.SetPirEnable(true));
- trilist.SetSigTrueAction(joinMap.DisablePir, () => occController.SetPirEnable(false));
- occController.PirSensorEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.EnablePir]);
-
- // PIR Sensitivity in Occupied State
- trilist.SetBoolSigAction(joinMap.IncrementPirInOccupiedState, occController.IncrementPirSensitivityInOccupiedState);
- trilist.SetBoolSigAction(joinMap.DecrementPirInOccupiedState, occController.DecrementPirSensitivityInOccupiedState);
- occController.PirSensitivityInOccupiedStateFeedback.LinkInputSig(trilist.UShortInput[joinMap.PirSensitivityInOccupiedState]);
-
- // PIR Sensitivity in Vacant State
- trilist.SetBoolSigAction(joinMap.IncrementPirInVacantState, occController.IncrementPirSensitivityInVacantState);
- trilist.SetBoolSigAction(joinMap.DecrementPirInVacantState, occController.DecrementPirSensitivityInVacantState);
- occController.PirSensitivityInVacantStateFeedback.LinkInputSig(trilist.UShortInput[joinMap.PirSensitivityInVacantState]);
- #endregion
-
- #region Dual Technology Sensor Stuff
- var odtOccController = occController as GlsOdtOccupancySensorController;
-
- if (odtOccController == null) return;
- // OR When Vacated
- trilist.SetBoolSigAction(joinMap.OrWhenVacated, odtOccController.SetOrWhenVacatedState);
- odtOccController.OrWhenVacatedFeedback.LinkInputSig(trilist.BooleanInput[joinMap.OrWhenVacated]);
-
- // AND When Vacated
- trilist.SetBoolSigAction(joinMap.AndWhenVacated, odtOccController.SetAndWhenVacatedState);
- odtOccController.AndWhenVacatedFeedback.LinkInputSig(trilist.BooleanInput[joinMap.AndWhenVacated]);
-
- // Ultrasonic A Sensor
- trilist.SetSigTrueAction(joinMap.EnableUsA, () => odtOccController.SetUsAEnable(true));
- trilist.SetSigTrueAction(joinMap.DisableUsA, () => odtOccController.SetUsAEnable(false));
- odtOccController.UltrasonicAEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.EnableUsA]);
-
- // Ultrasonic B Sensor
- trilist.SetSigTrueAction(joinMap.EnableUsB, () => odtOccController.SetUsBEnable(true));
- trilist.SetSigTrueAction(joinMap.DisableUsB, () => odtOccController.SetUsBEnable(false));
- odtOccController.UltrasonicAEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.EnableUsB]);
-
- // US Sensitivity in Occupied State
- trilist.SetBoolSigAction(joinMap.IncrementUsInOccupiedState, odtOccController.IncrementUsSensitivityInOccupiedState);
- trilist.SetBoolSigAction(joinMap.DecrementUsInOccupiedState, odtOccController.DecrementUsSensitivityInOccupiedState);
- odtOccController.UltrasonicSensitivityInOccupiedStateFeedback.LinkInputSig(trilist.UShortInput[joinMap.UsSensitivityInOccupiedState]);
-
- // US Sensitivity in Vacant State
- trilist.SetBoolSigAction(joinMap.IncrementUsInVacantState, odtOccController.IncrementUsSensitivityInVacantState);
- trilist.SetBoolSigAction(joinMap.DecrementUsInVacantState, odtOccController.DecrementUsSensitivityInVacantState);
- odtOccController.UltrasonicSensitivityInVacantStateFeedback.LinkInputSig(trilist.UShortInput[joinMap.UsSensitivityInVacantState]);
-
- //Sensor Raw States
- odtOccController.RawOccupancyPirFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RawOccupancyPirFeedback]);
- odtOccController.RawOccupancyUsFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RawOccupancyUsFeedback]);
-
- #endregion
- }
-
- public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
- {
- LinkOccSensorToApi(this, trilist, joinStart, joinMapKey, bridge);
- }
- }
-
- public class GlsOccupancySensorBaseControllerFactory : EssentialsDeviceFactory
- {
- public GlsOccupancySensorBaseControllerFactory()
- {
- TypeNames = new List() { "glsoirccn" };
- }
-
- public override EssentialsDevice BuildDevice(DeviceConfig dc)
- {
- Debug.Console(1, "Factory Attempting to create new GlsOccupancySensorBaseController Device");
-
- var typeName = dc.Type.ToLower();
- var key = dc.Key;
- var name = dc.Name;
- var comm = CommFactory.GetControlPropertiesConfig(dc);
-
- GlsOccupancySensorBase occSensor = null;
-
- occSensor = new GlsOirCCn(comm.CresnetIdInt, Global.ControlSystem);
-
- if (occSensor != null)
- {
- return new GlsOccupancySensorBaseController(key, name, occSensor);
- }
- else
- {
- Debug.Console(0, "ERROR: Unable to create Occupancy Sensor Device. Key: '{0}'", key);
- return null;
- }
-
- }
- }
-
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Crestron.SimplSharp;
+using Crestron.SimplSharpPro.DeviceSupport;
+using Crestron.SimplSharpPro.GeneralIO;
+using Newtonsoft.Json;
+using PepperDash.Core;
+using PepperDash.Essentials.Core;
+using PepperDash.Essentials.Core.Config;
+using PepperDash.Essentials.Core.Bridges;
+
+namespace PepperDash.Essentials.Devices.Common.Occupancy
+{
+ public class GlsOccupancySensorBaseController : CrestronGenericBridgeableBaseDevice, IOccupancyStatusProvider
+ {
+ public GlsOccupancySensorBase OccSensor { get; private set; }
+
+ public BoolFeedback RoomIsOccupiedFeedback { get; private set; }
+
+ public BoolFeedback GraceOccupancyDetectedFeedback { get; private set; }
+
+ public BoolFeedback RawOccupancyFeedback { get; private set; }
+
+ public BoolFeedback PirSensorEnabledFeedback { get; private set; }
+
+ public BoolFeedback LedFlashEnabledFeedback { get; private set; }
+
+ public BoolFeedback ShortTimeoutEnabledFeedback { get; private set; }
+
+ public IntFeedback PirSensitivityInVacantStateFeedback { get; private set; }
+
+ public IntFeedback PirSensitivityInOccupiedStateFeedback { get; private set; }
+
+ public IntFeedback CurrentTimeoutFeedback { get; private set; }
+
+ public IntFeedback LocalTimoutFeedback { get; private set; }
+
+ public IntFeedback InternalPhotoSensorValue { get; set; }
+
+ public IntFeedback ExternalPhotoSensorValue { get; set; }
+
+ // Debug properties
+ public bool InTestMode { get; private set; }
+
+ public bool TestRoomIsOccupiedFeedback { get; private set; }
+
+ public Func RoomIsOccupiedFeedbackFunc
+ {
+ get
+ {
+ return () => InTestMode ? TestRoomIsOccupiedFeedback : OccSensor.OccupancyDetectedFeedback.BoolValue;
+ }
+ }
+
+ public GlsOccupancySensorBaseController(string key, string name, GlsOccupancySensorBase sensor)
+ : base(key, name, sensor)
+ {
+ OccSensor = sensor;
+
+ RoomIsOccupiedFeedback = new BoolFeedback(RoomIsOccupiedFeedbackFunc);
+
+ PirSensorEnabledFeedback = new BoolFeedback(() => OccSensor.PirEnabledFeedback.BoolValue);
+
+ LedFlashEnabledFeedback = new BoolFeedback(() => OccSensor.LedFlashEnabledFeedback.BoolValue);
+
+ ShortTimeoutEnabledFeedback = new BoolFeedback(() => OccSensor.ShortTimeoutEnabledFeedback.BoolValue);
+
+ PirSensitivityInVacantStateFeedback = new IntFeedback(() => OccSensor.PirSensitivityInVacantStateFeedback.UShortValue);
+
+ PirSensitivityInOccupiedStateFeedback = new IntFeedback(() => OccSensor.PirSensitivityInOccupiedStateFeedback.UShortValue);
+
+ CurrentTimeoutFeedback = new IntFeedback(() => OccSensor.CurrentTimeoutFeedback.UShortValue);
+
+ LocalTimoutFeedback = new IntFeedback(() => OccSensor.LocalTimeoutFeedback.UShortValue);
+
+ GraceOccupancyDetectedFeedback = new BoolFeedback(() => OccSensor.GraceOccupancyDetectedFeedback.BoolValue);
+
+ RawOccupancyFeedback = new BoolFeedback(() => OccSensor.RawOccupancyFeedback.BoolValue);
+
+ InternalPhotoSensorValue = new IntFeedback(() => OccSensor.InternalPhotoSensorValueFeedback.UShortValue);
+
+ ExternalPhotoSensorValue = new IntFeedback(() => OccSensor.ExternalPhotoSensorValueFeedback.UShortValue);
+
+ OccSensor.BaseEvent += new Crestron.SimplSharpPro.BaseEventHandler(OccSensor_BaseEvent);
+
+ OccSensor.GlsOccupancySensorChange += new GlsOccupancySensorChangeEventHandler(OccSensor_GlsOccupancySensorChange);
+ }
+
+
+ ///
+ /// Catches events for feedbacks on the base class. Any extending wrapper class should call this delegate after it checks for it's own event IDs.
+ ///
+ ///
+ ///
+ protected virtual void OccSensor_GlsOccupancySensorChange(GlsOccupancySensorBase device, GlsOccupancySensorChangeEventArgs args)
+ {
+ if (args.EventId == GlsOccupancySensorBase.PirEnabledFeedbackEventId)
+ PirSensorEnabledFeedback.FireUpdate();
+ else if (args.EventId == GlsOccupancySensorBase.LedFlashEnabledFeedbackEventId)
+ LedFlashEnabledFeedback.FireUpdate();
+ else if (args.EventId == GlsOccupancySensorBase.ShortTimeoutEnabledFeedbackEventId)
+ ShortTimeoutEnabledFeedback.FireUpdate();
+ else if (args.EventId == GlsOccupancySensorBase.PirSensitivityInOccupiedStateFeedbackEventId)
+ PirSensitivityInOccupiedStateFeedback.FireUpdate();
+ else if (args.EventId == GlsOccupancySensorBase.PirSensitivityInVacantStateFeedbackEventId)
+ PirSensitivityInVacantStateFeedback.FireUpdate();
+ }
+
+ protected virtual void OccSensor_BaseEvent(Crestron.SimplSharpPro.GenericBase device, Crestron.SimplSharpPro.BaseEventArgs args)
+ {
+ Debug.Console(2, this, "GlsOccupancySensorChange EventId: {0}", args.EventId);
+
+ if (args.EventId == Crestron.SimplSharpPro.GeneralIO.GlsOccupancySensorBase.RoomOccupiedFeedbackEventId
+ || args.EventId == Crestron.SimplSharpPro.GeneralIO.GlsOccupancySensorBase.RoomVacantFeedbackEventId)
+ {
+ Debug.Console(1, this, "Occupancy State: {0}", OccSensor.OccupancyDetectedFeedback.BoolValue);
+ RoomIsOccupiedFeedback.FireUpdate();
+ }
+ else if (args.EventId == GlsOccupancySensorBase.TimeoutFeedbackEventId)
+ CurrentTimeoutFeedback.FireUpdate();
+ else if (args.EventId == GlsOccupancySensorBase.TimeoutLocalFeedbackEventId)
+ LocalTimoutFeedback.FireUpdate();
+ else if (args.EventId == GlsOccupancySensorBase.GraceOccupancyDetectedFeedbackEventId)
+ GraceOccupancyDetectedFeedback.FireUpdate();
+ else if (args.EventId == GlsOccupancySensorBase.RawOccupancyFeedbackEventId)
+ RawOccupancyFeedback.FireUpdate();
+ else if (args.EventId == GlsOccupancySensorBase.InternalPhotoSensorValueFeedbackEventId)
+ InternalPhotoSensorValue.FireUpdate();
+ else if (args.EventId == GlsOccupancySensorBase.ExternalPhotoSensorValueFeedbackEventId)
+ ExternalPhotoSensorValue.FireUpdate();
+ }
+
+ public void SetTestMode(bool mode)
+ {
+ InTestMode = mode;
+
+ Debug.Console(1, this, "In Mock Mode: '{0}'", InTestMode);
+ }
+
+ public void SetTestOccupiedState(bool state)
+ {
+ if (!InTestMode)
+ Debug.Console(1, "Mock mode not enabled");
+ else
+ {
+ TestRoomIsOccupiedFeedback = state;
+
+ RoomIsOccupiedFeedback.FireUpdate();
+ }
+ }
+
+ ///
+ /// Enables or disables the PIR sensor
+ ///
+ ///
+ public void SetPirEnable(bool state)
+ {
+ if (state)
+ {
+ OccSensor.EnablePir.BoolValue = state;
+ OccSensor.DisablePir.BoolValue = !state;
+ }
+ else
+ {
+ OccSensor.EnablePir.BoolValue = state;
+ OccSensor.DisablePir.BoolValue = !state;
+ }
+ }
+
+ ///
+ /// Enables or disables the LED Flash
+ ///
+ ///
+ public void SetLedFlashEnable(bool state)
+ {
+ if (state)
+ {
+ OccSensor.EnableLedFlash.BoolValue = state;
+ OccSensor.DisableLedFlash.BoolValue = !state;
+ }
+ else
+ {
+ OccSensor.EnableLedFlash.BoolValue = state;
+ OccSensor.DisableLedFlash.BoolValue = !state;
+ }
+ }
+
+ ///
+ /// Enables or disables short timeout based on state
+ ///
+ ///
+ public void SetShortTimeoutState(bool state)
+ {
+ if (state)
+ {
+ OccSensor.EnableShortTimeout.BoolValue = state;
+ OccSensor.DisableShortTimeout.BoolValue = !state;
+ }
+ else
+ {
+ OccSensor.EnableShortTimeout.BoolValue = state;
+ OccSensor.DisableShortTimeout.BoolValue = !state;
+ }
+ }
+
+ public void IncrementPirSensitivityInOccupiedState(bool pressRelease)
+ {
+ OccSensor.IncrementPirSensitivityInOccupiedState.BoolValue = pressRelease;
+ }
+
+ public void DecrementPirSensitivityInOccupiedState(bool pressRelease)
+ {
+ OccSensor.DecrementPirSensitivityInOccupiedState.BoolValue = pressRelease;
+ }
+
+ public void IncrementPirSensitivityInVacantState(bool pressRelease)
+ {
+ OccSensor.IncrementPirSensitivityInVacantState.BoolValue = pressRelease;
+ }
+
+ public void DecrementPirSensitivityInVacantState(bool pressRelease)
+ {
+ OccSensor.DecrementPirSensitivityInVacantState.BoolValue = pressRelease;
+ }
+
+ public void ForceOccupied()
+ {
+ OccSensor.ForceOccupied.BoolValue = true;
+ }
+
+ public void ForceVacant()
+ {
+ OccSensor.ForceVacant.BoolValue = true;
+ }
+
+ public void EnableRawStates(bool state)
+ {
+ OccSensor.EnableRawStates.BoolValue = state;
+ }
+
+ public void SetRemoteTimeout(ushort time)
+ {
+ OccSensor.RemoteTimeout.UShortValue = time;
+ }
+
+ public void SetInternalPhotoSensorMinChange(ushort value)
+ {
+ OccSensor.InternalPhotoSensorMinimumChange.UShortValue = value;
+ }
+
+ public void SetExternalPhotoSensorMinChange(ushort value)
+ {
+ OccSensor.ExternalPhotoSensorMinimumChange.UShortValue = value;
+ }
+
+
+
+ protected void LinkOccSensorToApi(GlsOccupancySensorBaseController occController, BasicTriList trilist,
+ uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
+ {
+ var joinMap = new GlsOccupancySensorBaseJoinMap(joinStart);
+
+ var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
+
+ if (!string.IsNullOrEmpty(joinMapSerialized))
+ joinMap = JsonConvert.DeserializeObject(joinMapSerialized);
+
+ bridge.AddJoinMap(Key, joinMap);
+
+ Debug.Console(1, occController, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
+
+ #region Single and Dual Sensor Stuff
+ occController.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline.JoinNumber]);
+ trilist.StringInput[joinMap.Name.JoinNumber].StringValue = occController.Name;
+
+ trilist.OnlineStatusChange += (d, args) =>
+ {
+ if (args.DeviceOnLine)
+ {
+ trilist.StringInput[joinMap.Name.JoinNumber].StringValue = occController.Name;
+ }
+ };
+
+ // Occupied status
+ trilist.SetSigTrueAction(joinMap.ForceOccupied.JoinNumber, occController.ForceOccupied);
+ trilist.SetSigTrueAction(joinMap.ForceVacant.JoinNumber, occController.ForceVacant);
+ occController.RoomIsOccupiedFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RoomOccupiedFeedback.JoinNumber]);
+ occController.RoomIsOccupiedFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.RoomVacantFeedback.JoinNumber]);
+ occController.RawOccupancyFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RawOccupancyFeedback.JoinNumber]);
+ trilist.SetBoolSigAction(joinMap.EnableRawStates.JoinNumber, occController.EnableRawStates);
+
+ // Timouts
+ trilist.SetUShortSigAction(joinMap.Timeout.JoinNumber, occController.SetRemoteTimeout);
+ occController.CurrentTimeoutFeedback.LinkInputSig(trilist.UShortInput[joinMap.Timeout.JoinNumber]);
+ occController.LocalTimoutFeedback.LinkInputSig(trilist.UShortInput[joinMap.TimeoutLocalFeedback.JoinNumber]);
+
+ // LED Flash
+ trilist.SetSigTrueAction(joinMap.EnableLedFlash.JoinNumber, () => occController.SetLedFlashEnable(true));
+ trilist.SetSigTrueAction(joinMap.DisableLedFlash.JoinNumber, () => occController.SetLedFlashEnable(false));
+ occController.LedFlashEnabledFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.EnableLedFlash.JoinNumber]);
+
+ // Short Timeout
+ trilist.SetSigTrueAction(joinMap.EnableShortTimeout.JoinNumber, () => occController.SetShortTimeoutState(true));
+ trilist.SetSigTrueAction(joinMap.DisableShortTimeout.JoinNumber, () => occController.SetShortTimeoutState(false));
+ occController.ShortTimeoutEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.EnableShortTimeout.JoinNumber]);
+
+ // PIR Sensor
+ trilist.SetSigTrueAction(joinMap.EnablePir.JoinNumber, () => occController.SetPirEnable(true));
+ trilist.SetSigTrueAction(joinMap.DisablePir.JoinNumber, () => occController.SetPirEnable(false));
+ occController.PirSensorEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.EnablePir.JoinNumber]);
+
+ // PIR Sensitivity in Occupied State
+ trilist.SetBoolSigAction(joinMap.IncrementPirInOccupiedState.JoinNumber, occController.IncrementPirSensitivityInOccupiedState);
+ trilist.SetBoolSigAction(joinMap.DecrementPirInOccupiedState.JoinNumber, occController.DecrementPirSensitivityInOccupiedState);
+ occController.PirSensitivityInOccupiedStateFeedback.LinkInputSig(trilist.UShortInput[joinMap.PirSensitivityInOccupiedState.JoinNumber]);
+
+ // PIR Sensitivity in Vacant State
+ trilist.SetBoolSigAction(joinMap.IncrementPirInVacantState.JoinNumber, occController.IncrementPirSensitivityInVacantState);
+ trilist.SetBoolSigAction(joinMap.DecrementPirInVacantState.JoinNumber, occController.DecrementPirSensitivityInVacantState);
+ occController.PirSensitivityInVacantStateFeedback.LinkInputSig(trilist.UShortInput[joinMap.PirSensitivityInVacantState.JoinNumber]);
+ #endregion
+
+ #region Dual Technology Sensor Stuff
+ var odtOccController = occController as GlsOdtOccupancySensorController;
+
+ if (odtOccController == null) return;
+ // OR When Vacated
+ trilist.SetBoolSigAction(joinMap.OrWhenVacated.JoinNumber, odtOccController.SetOrWhenVacatedState);
+ odtOccController.OrWhenVacatedFeedback.LinkInputSig(trilist.BooleanInput[joinMap.OrWhenVacated.JoinNumber]);
+
+ // AND When Vacated
+ trilist.SetBoolSigAction(joinMap.AndWhenVacated.JoinNumber, odtOccController.SetAndWhenVacatedState);
+ odtOccController.AndWhenVacatedFeedback.LinkInputSig(trilist.BooleanInput[joinMap.AndWhenVacated.JoinNumber]);
+
+ // Ultrasonic A Sensor
+ trilist.SetSigTrueAction(joinMap.EnableUsA.JoinNumber, () => odtOccController.SetUsAEnable(true));
+ trilist.SetSigTrueAction(joinMap.DisableUsA.JoinNumber, () => odtOccController.SetUsAEnable(false));
+ odtOccController.UltrasonicAEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.EnableUsA.JoinNumber]);
+
+ // Ultrasonic B Sensor
+ trilist.SetSigTrueAction(joinMap.EnableUsB.JoinNumber, () => odtOccController.SetUsBEnable(true));
+ trilist.SetSigTrueAction(joinMap.DisableUsB.JoinNumber, () => odtOccController.SetUsBEnable(false));
+ odtOccController.UltrasonicAEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.EnableUsB.JoinNumber]);
+
+ // US Sensitivity in Occupied State
+ trilist.SetBoolSigAction(joinMap.IncrementUsInOccupiedState.JoinNumber, odtOccController.IncrementUsSensitivityInOccupiedState);
+ trilist.SetBoolSigAction(joinMap.DecrementUsInOccupiedState.JoinNumber, odtOccController.DecrementUsSensitivityInOccupiedState);
+ odtOccController.UltrasonicSensitivityInOccupiedStateFeedback.LinkInputSig(trilist.UShortInput[joinMap.UsSensitivityInOccupiedState.JoinNumber]);
+
+ // US Sensitivity in Vacant State
+ trilist.SetBoolSigAction(joinMap.IncrementUsInVacantState.JoinNumber, odtOccController.IncrementUsSensitivityInVacantState);
+ trilist.SetBoolSigAction(joinMap.DecrementUsInVacantState.JoinNumber, odtOccController.DecrementUsSensitivityInVacantState);
+ odtOccController.UltrasonicSensitivityInVacantStateFeedback.LinkInputSig(trilist.UShortInput[joinMap.UsSensitivityInVacantState.JoinNumber]);
+
+ //Sensor Raw States
+ odtOccController.RawOccupancyPirFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RawOccupancyPirFeedback.JoinNumber]);
+ odtOccController.RawOccupancyUsFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RawOccupancyUsFeedback.JoinNumber]);
+
+ #endregion
+ }
+
+ public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
+ {
+ LinkOccSensorToApi(this, trilist, joinStart, joinMapKey, bridge);
+ }
+ }
+
+ public class GlsOccupancySensorBaseControllerFactory : EssentialsDeviceFactory
+ {
+ public GlsOccupancySensorBaseControllerFactory()
+ {
+ TypeNames = new List() { "glsoirccn" };
+ }
+
+ public override EssentialsDevice BuildDevice(DeviceConfig dc)
+ {
+ Debug.Console(1, "Factory Attempting to create new GlsOccupancySensorBaseController Device");
+
+ var typeName = dc.Type.ToLower();
+ var key = dc.Key;
+ var name = dc.Name;
+ var comm = CommFactory.GetControlPropertiesConfig(dc);
+
+ GlsOccupancySensorBase occSensor = null;
+
+ occSensor = new GlsOirCCn(comm.CresnetIdInt, Global.ControlSystem);
+
+ if (occSensor != null)
+ {
+ return new GlsOccupancySensorBaseController(key, name, occSensor);
+ }
+ else
+ {
+ Debug.Console(0, "ERROR: Unable to create Occupancy Sensor Device. Key: '{0}'", key);
+ return null;
+ }
+
+ }
+ }
+
}
\ No newline at end of file
diff --git a/essentials-framework/Essentials Devices Common/Essentials Devices Common/Power Controllers/Digitallogger.cs b/essentials-framework/Essentials Devices Common/Essentials Devices Common/Power Controllers/Digitallogger.cs
index 11a96537..2a079c97 100644
--- a/essentials-framework/Essentials Devices Common/Essentials Devices Common/Power Controllers/Digitallogger.cs
+++ b/essentials-framework/Essentials Devices Common/Essentials Devices Common/Power Controllers/Digitallogger.cs
@@ -11,12 +11,14 @@ using Crestron.SimplSharp.Net.Http;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using PepperDash.Essentials.Core.Bridges;
-using PepperDash.Essentials.Core.Config;
+using PepperDash.Essentials.Core.Config;
+using PepperDash.Essentials;
+
namespace PepperDash.Essentials.Devices.Common
-{
-
+{
+ [Obsolete("This Device will be moved to a plugin in a future update")]
public class DigitalLogger : EssentialsBridgeableDevice
{
public IBasicCommunication Communication { get; private set; }
diff --git a/essentials-framework/Essentials Devices Common/Essentials Devices Common/SetTopBox/IRSetTopBoxBase.cs b/essentials-framework/Essentials Devices Common/Essentials Devices Common/SetTopBox/IRSetTopBoxBase.cs
index 25d17eb4..8bf690a6 100644
--- a/essentials-framework/Essentials Devices Common/Essentials Devices Common/SetTopBox/IRSetTopBoxBase.cs
+++ b/essentials-framework/Essentials Devices Common/Essentials Devices Common/SetTopBox/IRSetTopBoxBase.cs
@@ -373,93 +373,93 @@ namespace PepperDash.Essentials.Devices.Common
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
{
- var joinMap = new SetTopBoxControllerJoinMap();
+ var joinMap = new SetTopBoxControllerJoinMap(joinStart);
var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
if (!string.IsNullOrEmpty(joinMapSerialized))
joinMap = JsonConvert.DeserializeObject(joinMapSerialized);
- joinMap.OffsetJoinNumbers(joinStart);
+ bridge.AddJoinMap(Key, joinMap);
Debug.Console(1, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
Debug.Console(0, "Linking to Display: {0}", Name);
- trilist.StringInput[joinMap.Name].StringValue = Name;
+ trilist.StringInput[joinMap.Name.JoinNumber].StringValue = Name;
var stbBase = this as ISetTopBoxControls;
- trilist.BooleanInput[joinMap.HasDpad].BoolValue = stbBase.HasDpad;
- trilist.BooleanInput[joinMap.HasNumeric].BoolValue = stbBase.HasNumeric;
- trilist.BooleanInput[joinMap.HasDvr].BoolValue = stbBase.HasDvr;
- trilist.BooleanInput[joinMap.HasPresets].BoolValue = stbBase.HasPresets;
+ trilist.BooleanInput[joinMap.HasDpad.JoinNumber].BoolValue = stbBase.HasDpad;
+ trilist.BooleanInput[joinMap.HasNumeric.JoinNumber].BoolValue = stbBase.HasNumeric;
+ trilist.BooleanInput[joinMap.HasDvr.JoinNumber].BoolValue = stbBase.HasDvr;
+ trilist.BooleanInput[joinMap.HasPresets.JoinNumber].BoolValue = stbBase.HasPresets;
- trilist.SetBoolSigAction(joinMap.DvrList, stbBase.DvrList);
- trilist.SetBoolSigAction(joinMap.Replay, stbBase.Replay);
+ trilist.SetBoolSigAction(joinMap.DvrList.JoinNumber, stbBase.DvrList);
+ trilist.SetBoolSigAction(joinMap.Replay.JoinNumber, stbBase.Replay);
- trilist.SetStringSigAction(joinMap.LoadPresets, stbBase.LoadPresets);
+ trilist.SetStringSigAction(joinMap.LoadPresets.JoinNumber, stbBase.LoadPresets);
var stbPower = this as IPower;
- trilist.SetSigTrueAction(joinMap.PowerOn, stbPower.PowerOn);
- trilist.SetSigTrueAction(joinMap.PowerOff, stbPower.PowerOff);
- trilist.SetSigTrueAction(joinMap.PowerToggle, stbPower.PowerToggle);
+ trilist.SetSigTrueAction(joinMap.PowerOn.JoinNumber, stbPower.PowerOn);
+ trilist.SetSigTrueAction(joinMap.PowerOff.JoinNumber, stbPower.PowerOff);
+ trilist.SetSigTrueAction(joinMap.PowerToggle.JoinNumber, stbPower.PowerToggle);
var stbDPad = this as IDPad;
- trilist.SetBoolSigAction(joinMap.Up, stbDPad.Up);
- trilist.SetBoolSigAction(joinMap.Down, stbDPad.Down);
- trilist.SetBoolSigAction(joinMap.Left, stbDPad.Left);
- trilist.SetBoolSigAction(joinMap.Right, stbDPad.Right);
- trilist.SetBoolSigAction(joinMap.Select, stbDPad.Select);
- trilist.SetBoolSigAction(joinMap.Menu, stbDPad.Menu);
- trilist.SetBoolSigAction(joinMap.Exit, stbDPad.Exit);
+ trilist.SetBoolSigAction(joinMap.Up.JoinNumber, stbDPad.Up);
+ trilist.SetBoolSigAction(joinMap.Down.JoinNumber, stbDPad.Down);
+ trilist.SetBoolSigAction(joinMap.Left.JoinNumber, stbDPad.Left);
+ trilist.SetBoolSigAction(joinMap.Right.JoinNumber, stbDPad.Right);
+ trilist.SetBoolSigAction(joinMap.Select.JoinNumber, stbDPad.Select);
+ trilist.SetBoolSigAction(joinMap.Menu.JoinNumber, stbDPad.Menu);
+ trilist.SetBoolSigAction(joinMap.Exit.JoinNumber, stbDPad.Exit);
var stbChannel = this as IChannel;
- trilist.SetBoolSigAction(joinMap.ChannelUp, stbChannel.ChannelUp);
- trilist.SetBoolSigAction(joinMap.ChannelDown, stbChannel.ChannelDown);
- trilist.SetBoolSigAction(joinMap.LastChannel, stbChannel.LastChannel);
- trilist.SetBoolSigAction(joinMap.Guide, stbChannel.Guide);
- trilist.SetBoolSigAction(joinMap.Info, stbChannel.Info);
- trilist.SetBoolSigAction(joinMap.Exit, stbChannel.Exit);
+ trilist.SetBoolSigAction(joinMap.ChannelUp.JoinNumber, stbChannel.ChannelUp);
+ trilist.SetBoolSigAction(joinMap.ChannelDown.JoinNumber, stbChannel.ChannelDown);
+ trilist.SetBoolSigAction(joinMap.LastChannel.JoinNumber, stbChannel.LastChannel);
+ trilist.SetBoolSigAction(joinMap.Guide.JoinNumber, stbChannel.Guide);
+ trilist.SetBoolSigAction(joinMap.Info.JoinNumber, stbChannel.Info);
+ trilist.SetBoolSigAction(joinMap.Exit.JoinNumber, stbChannel.Exit);
var stbColor = this as IColor;
- trilist.SetBoolSigAction(joinMap.Red, stbColor.Red);
- trilist.SetBoolSigAction(joinMap.Green, stbColor.Green);
- trilist.SetBoolSigAction(joinMap.Yellow, stbColor.Yellow);
- trilist.SetBoolSigAction(joinMap.Blue, stbColor.Blue);
+ trilist.SetBoolSigAction(joinMap.Red.JoinNumber, stbColor.Red);
+ trilist.SetBoolSigAction(joinMap.Green.JoinNumber, stbColor.Green);
+ trilist.SetBoolSigAction(joinMap.Yellow.JoinNumber, stbColor.Yellow);
+ trilist.SetBoolSigAction(joinMap.Blue.JoinNumber, stbColor.Blue);
var stbKeypad = this as ISetTopBoxNumericKeypad;
- trilist.StringInput[joinMap.KeypadAccessoryButton1Label].StringValue = stbKeypad.KeypadAccessoryButton1Label;
- trilist.StringInput[joinMap.KeypadAccessoryButton2Label].StringValue = stbKeypad.KeypadAccessoryButton2Label;
+ trilist.StringInput[joinMap.KeypadAccessoryButton1Label.JoinNumber].StringValue = stbKeypad.KeypadAccessoryButton1Label;
+ trilist.StringInput[joinMap.KeypadAccessoryButton2Label.JoinNumber].StringValue = stbKeypad.KeypadAccessoryButton2Label;
- trilist.BooleanInput[joinMap.HasKeypadAccessoryButton1].BoolValue = stbKeypad.HasKeypadAccessoryButton1;
- trilist.BooleanInput[joinMap.HasKeypadAccessoryButton2].BoolValue = stbKeypad.HasKeypadAccessoryButton2;
+ trilist.BooleanInput[joinMap.HasKeypadAccessoryButton1.JoinNumber].BoolValue = stbKeypad.HasKeypadAccessoryButton1;
+ trilist.BooleanInput[joinMap.HasKeypadAccessoryButton2.JoinNumber].BoolValue = stbKeypad.HasKeypadAccessoryButton2;
- trilist.SetBoolSigAction(joinMap.Digit0, stbKeypad.Digit0);
- trilist.SetBoolSigAction(joinMap.Digit1, stbKeypad.Digit1);
- trilist.SetBoolSigAction(joinMap.Digit2, stbKeypad.Digit2);
- trilist.SetBoolSigAction(joinMap.Digit3, stbKeypad.Digit3);
- trilist.SetBoolSigAction(joinMap.Digit4, stbKeypad.Digit4);
- trilist.SetBoolSigAction(joinMap.Digit5, stbKeypad.Digit5);
- trilist.SetBoolSigAction(joinMap.Digit6, stbKeypad.Digit6);
- trilist.SetBoolSigAction(joinMap.Digit7, stbKeypad.Digit7);
- trilist.SetBoolSigAction(joinMap.Digit8, stbKeypad.Digit8);
- trilist.SetBoolSigAction(joinMap.Digit9, stbKeypad.Digit9);
- trilist.SetBoolSigAction(joinMap.KeypadAccessoryButton1Press, stbKeypad.KeypadAccessoryButton1);
- trilist.SetBoolSigAction(joinMap.KeypadAccessoryButton2Press, stbKeypad.KeypadAccessoryButton1);
- trilist.SetBoolSigAction(joinMap.Dash, stbKeypad.Dash);
- trilist.SetBoolSigAction(joinMap.KeypadEnter, stbKeypad.KeypadEnter);
+ trilist.SetBoolSigAction(joinMap.Digit0.JoinNumber, stbKeypad.Digit0);
+ trilist.SetBoolSigAction(joinMap.Digit1.JoinNumber, stbKeypad.Digit1);
+ trilist.SetBoolSigAction(joinMap.Digit2.JoinNumber, stbKeypad.Digit2);
+ trilist.SetBoolSigAction(joinMap.Digit3.JoinNumber, stbKeypad.Digit3);
+ trilist.SetBoolSigAction(joinMap.Digit4.JoinNumber, stbKeypad.Digit4);
+ trilist.SetBoolSigAction(joinMap.Digit5.JoinNumber, stbKeypad.Digit5);
+ trilist.SetBoolSigAction(joinMap.Digit6.JoinNumber, stbKeypad.Digit6);
+ trilist.SetBoolSigAction(joinMap.Digit7.JoinNumber, stbKeypad.Digit7);
+ trilist.SetBoolSigAction(joinMap.Digit8.JoinNumber, stbKeypad.Digit8);
+ trilist.SetBoolSigAction(joinMap.Digit9.JoinNumber, stbKeypad.Digit9);
+ trilist.SetBoolSigAction(joinMap.KeypadAccessoryButton1Press.JoinNumber, stbKeypad.KeypadAccessoryButton1);
+ trilist.SetBoolSigAction(joinMap.KeypadAccessoryButton2Press.JoinNumber, stbKeypad.KeypadAccessoryButton1);
+ trilist.SetBoolSigAction(joinMap.Dash.JoinNumber, stbKeypad.Dash);
+ trilist.SetBoolSigAction(joinMap.KeypadEnter.JoinNumber, stbKeypad.KeypadEnter);
var stbTransport = this as ITransport;
- trilist.SetBoolSigAction(joinMap.Play, stbTransport.Play);
- trilist.SetBoolSigAction(joinMap.Pause, stbTransport.Pause);
- trilist.SetBoolSigAction(joinMap.Rewind, stbTransport.Rewind);
- trilist.SetBoolSigAction(joinMap.FFwd, stbTransport.FFwd);
- trilist.SetBoolSigAction(joinMap.ChapMinus, stbTransport.ChapMinus);
- trilist.SetBoolSigAction(joinMap.ChapPlus, stbTransport.ChapPlus);
- trilist.SetBoolSigAction(joinMap.Stop, stbTransport.Stop);
- trilist.SetBoolSigAction(joinMap.Record, stbTransport.Record);
+ trilist.SetBoolSigAction(joinMap.Play.JoinNumber, stbTransport.Play);
+ trilist.SetBoolSigAction(joinMap.Pause.JoinNumber, stbTransport.Pause);
+ trilist.SetBoolSigAction(joinMap.Rewind.JoinNumber, stbTransport.Rewind);
+ trilist.SetBoolSigAction(joinMap.FFwd.JoinNumber, stbTransport.FFwd);
+ trilist.SetBoolSigAction(joinMap.ChapMinus.JoinNumber, stbTransport.ChapMinus);
+ trilist.SetBoolSigAction(joinMap.ChapPlus.JoinNumber, stbTransport.ChapPlus);
+ trilist.SetBoolSigAction(joinMap.Stop.JoinNumber, stbTransport.Stop);
+ trilist.SetBoolSigAction(joinMap.Record.JoinNumber, stbTransport.Record);
}
}
diff --git a/essentials-framework/Essentials Devices Common/Essentials Devices Common/Streaming/AppleTV.cs b/essentials-framework/Essentials Devices Common/Essentials Devices Common/Streaming/AppleTV.cs
index 1182d312..5d01ccc7 100644
--- a/essentials-framework/Essentials Devices Common/Essentials Devices Common/Streaming/AppleTV.cs
+++ b/essentials-framework/Essentials Devices Common/Essentials Devices Common/Streaming/AppleTV.cs
@@ -1,186 +1,186 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Crestron.SimplSharp;
-using Crestron.SimplSharpPro;
-using Crestron.SimplSharpPro.DeviceSupport;
-using Newtonsoft.Json;
-using PepperDash.Core;
-using PepperDash.Essentials.Core;
-using PepperDash.Essentials.Core.Config;
-using PepperDash.Essentials.Core.Bridges;
-using PepperDash.Essentials.Core.Routing;
-
-namespace PepperDash.Essentials.Devices.Common
-{
- public class AppleTV : EssentialsBridgeableDevice, IDPad, ITransport, IUiDisplayInfo, IRoutingOutputs
- {
-
- public IrOutputPortController IrPort { get; private set; }
- public const string StandardDriverName = "Apple AppleTV-v2.ir";
- public uint DisplayUiType { get { return DisplayUiConstants.TypeAppleTv; } }
-
- public AppleTV(string key, string name, IrOutputPortController portCont)
- : base(key, name)
- {
- IrPort = portCont;
- DeviceManager.AddDevice(portCont);
-
- HdmiOut = new RoutingOutputPort(RoutingPortNames.HdmiOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
- eRoutingPortConnectionType.Hdmi, null, this);
- AnyAudioOut = new RoutingOutputPort(RoutingPortNames.AnyAudioOut, eRoutingSignalType.Audio,
- eRoutingPortConnectionType.DigitalAudio, null, this);
- OutputPorts = new RoutingPortCollection { HdmiOut, AnyAudioOut };
- }
-
-
- #region IDPad Members
-
- public void Up(bool pressRelease)
- {
- IrPort.PressRelease("+", pressRelease);
- }
-
- public void Down(bool pressRelease)
- {
- IrPort.PressRelease("-", pressRelease);
- }
-
- public void Left(bool pressRelease)
- {
- IrPort.PressRelease(IROutputStandardCommands.IROut_TRACK_MINUS, pressRelease);
- }
-
- public void Right(bool pressRelease)
- {
- IrPort.PressRelease(IROutputStandardCommands.IROut_TRACK_PLUS, pressRelease);
- }
-
- public void Select(bool pressRelease)
- {
- IrPort.PressRelease(IROutputStandardCommands.IROut_ENTER, pressRelease);
- }
-
- public void Menu(bool pressRelease)
- {
- IrPort.PressRelease("Menu", pressRelease);
- }
-
- public void Exit(bool pressRelease)
- {
-
- }
-
- #endregion
-
- #region ITransport Members
-
- public void Play(bool pressRelease)
- {
- IrPort.PressRelease("PLAY/PAUSE", pressRelease);
- }
-
- public void Pause(bool pressRelease)
- {
- IrPort.PressRelease("PLAY/PAUSE", pressRelease);
- }
-
- ///
- /// Not implemented
- ///
- ///
- public void Rewind(bool pressRelease)
- {
- }
-
- ///
- /// Not implemented
- ///
- ///
- public void FFwd(bool pressRelease)
- {
- }
-
- ///
- /// Not implemented
- ///
- ///
- public void ChapMinus(bool pressRelease)
- {
- }
-
- ///
- /// Not implemented
- ///
- ///
- public void ChapPlus(bool pressRelease)
- {
- }
-
- ///
- /// Not implemented
- ///
- ///
- public void Stop(bool pressRelease)
- {
- }
-
- ///
- /// Not implemented
- ///
- ///
- public void Record(bool pressRelease)
- {
- }
-
- #endregion
-
- #region IRoutingOutputs Members
-
- public RoutingOutputPort HdmiOut { get; private set; }
- public RoutingOutputPort AnyAudioOut { get; private set; }
- public RoutingPortCollection OutputPorts { get; private set; }
-
- #endregion
-
- public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
- {
- var joinMap = new AppleTvJoinMap();
-
- 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 Bridge Type {0}", GetType().Name);
-
- trilist.SetBoolSigAction(joinMap.UpArrow, Up);
- trilist.SetBoolSigAction(joinMap.DnArrow, Down);
- trilist.SetBoolSigAction(joinMap.LeftArrow, Left);
- trilist.SetBoolSigAction(joinMap.RightArrow, Right);
- trilist.SetBoolSigAction(joinMap.Select, Select);
- trilist.SetBoolSigAction(joinMap.Menu, Menu);
- trilist.SetBoolSigAction(joinMap.PlayPause, Play);
- }
- }
-
- public class AppleTVFactory : EssentialsDeviceFactory
- {
- public AppleTVFactory()
- {
- TypeNames = new List() { "appletv" };
- }
-
- public override EssentialsDevice BuildDevice(DeviceConfig dc)
- {
- Debug.Console(1, "Factory Attempting to create new AppleTV Device");
- var irCont = IRPortHelper.GetIrOutputPortController(dc);
- return new AppleTV(dc.Key, dc.Name, irCont);
- }
- }
-
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Crestron.SimplSharp;
+using Crestron.SimplSharpPro;
+using Crestron.SimplSharpPro.DeviceSupport;
+using Newtonsoft.Json;
+using PepperDash.Core;
+using PepperDash.Essentials.Core;
+using PepperDash.Essentials.Core.Config;
+using PepperDash.Essentials.Core.Bridges;
+using PepperDash.Essentials.Core.Routing;
+
+namespace PepperDash.Essentials.Devices.Common
+{
+ public class AppleTV : EssentialsBridgeableDevice, IDPad, ITransport, IUiDisplayInfo, IRoutingOutputs
+ {
+
+ public IrOutputPortController IrPort { get; private set; }
+ public const string StandardDriverName = "Apple AppleTV-v2.ir";
+ public uint DisplayUiType { get { return DisplayUiConstants.TypeAppleTv; } }
+
+ public AppleTV(string key, string name, IrOutputPortController portCont)
+ : base(key, name)
+ {
+ IrPort = portCont;
+ DeviceManager.AddDevice(portCont);
+
+ HdmiOut = new RoutingOutputPort(RoutingPortNames.HdmiOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
+ eRoutingPortConnectionType.Hdmi, null, this);
+ AnyAudioOut = new RoutingOutputPort(RoutingPortNames.AnyAudioOut, eRoutingSignalType.Audio,
+ eRoutingPortConnectionType.DigitalAudio, null, this);
+ OutputPorts = new RoutingPortCollection { HdmiOut, AnyAudioOut };
+ }
+
+
+ #region IDPad Members
+
+ public void Up(bool pressRelease)
+ {
+ IrPort.PressRelease("+", pressRelease);
+ }
+
+ public void Down(bool pressRelease)
+ {
+ IrPort.PressRelease("-", pressRelease);
+ }
+
+ public void Left(bool pressRelease)
+ {
+ IrPort.PressRelease(IROutputStandardCommands.IROut_TRACK_MINUS, pressRelease);
+ }
+
+ public void Right(bool pressRelease)
+ {
+ IrPort.PressRelease(IROutputStandardCommands.IROut_TRACK_PLUS, pressRelease);
+ }
+
+ public void Select(bool pressRelease)
+ {
+ IrPort.PressRelease(IROutputStandardCommands.IROut_ENTER, pressRelease);
+ }
+
+ public void Menu(bool pressRelease)
+ {
+ IrPort.PressRelease("Menu", pressRelease);
+ }
+
+ public void Exit(bool pressRelease)
+ {
+
+ }
+
+ #endregion
+
+ #region ITransport Members
+
+ public void Play(bool pressRelease)
+ {
+ IrPort.PressRelease("PLAY/PAUSE", pressRelease);
+ }
+
+ public void Pause(bool pressRelease)
+ {
+ IrPort.PressRelease("PLAY/PAUSE", pressRelease);
+ }
+
+ ///
+ /// Not implemented
+ ///
+ ///
+ public void Rewind(bool pressRelease)
+ {
+ }
+
+ ///
+ /// Not implemented
+ ///
+ ///
+ public void FFwd(bool pressRelease)
+ {
+ }
+
+ ///
+ /// Not implemented
+ ///
+ ///
+ public void ChapMinus(bool pressRelease)
+ {
+ }
+
+ ///
+ /// Not implemented
+ ///
+ ///
+ public void ChapPlus(bool pressRelease)
+ {
+ }
+
+ ///
+ /// Not implemented
+ ///
+ ///
+ public void Stop(bool pressRelease)
+ {
+ }
+
+ ///
+ /// Not implemented
+ ///
+ ///
+ public void Record(bool pressRelease)
+ {
+ }
+
+ #endregion
+
+ #region IRoutingOutputs Members
+
+ public RoutingOutputPort HdmiOut { get; private set; }
+ public RoutingOutputPort AnyAudioOut { get; private set; }
+ public RoutingPortCollection OutputPorts { get; private set; }
+
+ #endregion
+
+ public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
+ {
+ var joinMap = new AppleTvJoinMap(joinStart);
+
+ var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
+
+ if (!string.IsNullOrEmpty(joinMapSerialized))
+ joinMap = JsonConvert.DeserializeObject