mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-01-24 01:45:07 +00:00
Compare commits
39 Commits
1.7.7-beta
...
1.8.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8ed236abae | ||
|
|
4a9b1514e3 | ||
|
|
9c7e38b379 | ||
|
|
846e905ae1 | ||
|
|
31f6a4bcfd | ||
|
|
2da8f8c9a8 | ||
|
|
743accd980 | ||
|
|
b445f68466 | ||
|
|
847e106b8d | ||
|
|
57f2d7c938 | ||
|
|
f0415d0d05 | ||
|
|
07fbe102bd | ||
|
|
319909539c | ||
|
|
00589488ac | ||
|
|
f25219c20a | ||
|
|
c5aef18943 | ||
|
|
70d4a7054f | ||
|
|
b20009b247 | ||
|
|
9588564633 | ||
|
|
eef3b5fb31 | ||
|
|
7078ba55c7 | ||
|
|
e06be3ebe9 | ||
|
|
10046a9ed4 | ||
|
|
51f294c37f | ||
|
|
1990201215 | ||
|
|
be78d17af5 | ||
|
|
8a6d5ebd56 | ||
|
|
93c0b33958 | ||
|
|
dca21aa4dc | ||
|
|
ac09267173 | ||
|
|
ef63c1db02 | ||
|
|
f828cbecbd | ||
|
|
890abf4383 | ||
|
|
52c96cc2c3 | ||
|
|
4ab3cdb1ff | ||
|
|
2dfd647f63 | ||
|
|
7f054d5e98 | ||
|
|
43297c0341 | ||
|
|
3ebe44be34 |
164
.github/workflows/docker.yml
vendored
164
.github/workflows/docker.yml
vendored
@@ -78,16 +78,9 @@ jobs:
|
||||
with:
|
||||
name: Version
|
||||
path: ${{env.GITHUB_HOME}}\output\version.txt
|
||||
# Create the release on the source repo
|
||||
- name: Create tag for non-rc builds
|
||||
if: contains(env.VERSION, 'alpha') || contains(env.VERSION, 'beta')
|
||||
run: |
|
||||
git tag $($Env:VERSION)
|
||||
git push --tags origin
|
||||
- name: Create Release
|
||||
id: create_release
|
||||
# using contributor's version to allow for pointing at the right commit
|
||||
if: contains(env.VERSION,'-rc-') || contains(env.VERSION,'-hotfix-')
|
||||
uses: fleskesvor/create-release@feature/support-target-commitish
|
||||
with:
|
||||
tag_name: ${{ env.VERSION }}
|
||||
@@ -150,160 +143,3 @@ jobs:
|
||||
run: nuget push **/*.nupkg -source github
|
||||
- name: Publish nuget package to nuget.org
|
||||
run: nuget push **/*.nupkg -Source https://api.nuget.org/v3/index.json
|
||||
# This step always runs and pushes the build to the internal build rep
|
||||
Internal_Push_Output:
|
||||
needs: Build_Project
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- name: check Github ref
|
||||
run: ${{toJson(github.ref)}}
|
||||
# Checkout the repo
|
||||
- name: Checkout Builds Repo
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
token: ${{ secrets.BUILDS_TOKEN }}
|
||||
repository: PepperDash-Engineering/essentials-builds
|
||||
ref: ${{ Env.GITHUB_REF }}
|
||||
# Download the version artifact from the build job
|
||||
- name: Download Build Version Info
|
||||
uses: actions/download-artifact@v1
|
||||
with:
|
||||
name: Version
|
||||
- name: Check Directory
|
||||
run: Get-ChildItem "./"
|
||||
# Set the version number environment variable from the file we just downloaded
|
||||
- name: Set Version Number
|
||||
shell: powershell
|
||||
run: |
|
||||
Get-ChildItem "./Version"
|
||||
$version = Get-Content -Path ./Version/version.txt
|
||||
Write-Host "Version: $version"
|
||||
echo "VERSION=$version" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||
Remove-Item -Path ./Version/version.txt
|
||||
Remove-Item -Path ./Version
|
||||
# Checkout/Create the branch
|
||||
- name: Create new branch
|
||||
run: git checkout -b $($Env:GITHUB_REF -replace "refs/heads/")
|
||||
# Download the build output into the repo
|
||||
- name: Download Build output
|
||||
uses: actions/download-artifact@v1
|
||||
with:
|
||||
name: Build
|
||||
path: ./
|
||||
- name: Check directory
|
||||
run: Get-ChildItem ./
|
||||
# Unzip the build package file
|
||||
- name: Unzip Build file
|
||||
run: |
|
||||
Get-ChildItem .\*.zip | Expand-Archive -DestinationPath .\
|
||||
Remove-Item -Path .\*.zip
|
||||
- name: Check directory again
|
||||
run: Get-ChildItem ./
|
||||
# Copy Contents of output folder to root directory
|
||||
- name: Copy Files to root & delete output directory
|
||||
run: |
|
||||
Remove-Item -Path .\* -Include @("*.cpz","*.md","*.cplz","*.json","*.dll","*.clz")
|
||||
Get-ChildItem -Path .\output\* | Copy-Item -Destination .\
|
||||
Remove-Item -Path .\output -Recurse
|
||||
# Commits the build output to the branch and tags it with the version
|
||||
- name: Commit build output and tag the commit
|
||||
shell: powershell
|
||||
run: |
|
||||
git config user.email "actions@pepperdash.com"
|
||||
git config user.name "GitHub Actions"
|
||||
git add .
|
||||
$commit = "Build $($Env:GITHUB_RUN_NUMBER) from commit: https://github.com/$($Env:GITHUB_REPOSITORY)/commit/$($Env:GITHUB_SHA)"
|
||||
Write-Host "Commit: $commit"
|
||||
git commit -m $commit
|
||||
git tag $($Env:VERSION)
|
||||
# Push the commit
|
||||
- name: Push to Builds Repo
|
||||
shell: powershell
|
||||
run: |
|
||||
$branch = $($Env:GITHUB_REF) -replace "refs/heads/"
|
||||
Write-Host "Branch: $branch"
|
||||
git push -u origin $($branch) --force
|
||||
# Push the tags
|
||||
- name: Push tags
|
||||
run: git push --tags origin
|
||||
- name: Check Directory
|
||||
run: Get-ChildItem ./
|
||||
# This step only runs if the branch is main or release/ runs and pushes the build to the public build repo
|
||||
Public_Push_Output:
|
||||
needs: Build_Project
|
||||
runs-on: windows-latest
|
||||
if: contains(github.ref, 'main') || contains(github.ref, '/release/')
|
||||
steps:
|
||||
# Checkout the repo
|
||||
- name: check Github ref
|
||||
run: ${{toJson(github.ref)}}
|
||||
- name: Checkout Builds Repo
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
token: ${{ secrets.BUILDS_TOKEN }}
|
||||
repository: PepperDash/Essentials-Builds
|
||||
ref: ${{ Env.GITHUB_REF }}
|
||||
# Download the version artifact from the build job
|
||||
- name: Download Build Version Info
|
||||
uses: actions/download-artifact@v1
|
||||
with:
|
||||
name: Version
|
||||
- name: Check Directory
|
||||
run: Get-ChildItem "./"
|
||||
# Set the version number environment variable from the file we just downloaded
|
||||
- name: Set Version Number
|
||||
shell: powershell
|
||||
run: |
|
||||
Get-ChildItem "./Version"
|
||||
$version = Get-Content -Path ./Version/version.txt
|
||||
Write-Host "Version: $version"
|
||||
echo "VERSION=$version" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||
Remove-Item -Path ./Version/version.txt
|
||||
Remove-Item -Path ./Version
|
||||
# Checkout/Create the branch
|
||||
- name: Create new branch
|
||||
run: git checkout -b $($Env:GITHUB_REF -replace "refs/heads/")
|
||||
# Download the build output into the repo
|
||||
- name: Download Build output
|
||||
uses: actions/download-artifact@v1
|
||||
with:
|
||||
name: Build
|
||||
path: ./
|
||||
- name: Check directory
|
||||
run: Get-ChildItem ./
|
||||
# Unzip the build package file
|
||||
- name: Unzip Build file
|
||||
run: |
|
||||
Get-ChildItem .\*.zip | Expand-Archive -DestinationPath .\
|
||||
Remove-Item -Path .\*.zip
|
||||
- name: Check directory again
|
||||
run: Get-ChildItem ./
|
||||
# Copy Contents of output folder to root directory
|
||||
- name: Copy Files to root & delete output directory
|
||||
run: |
|
||||
Remove-Item -Path .\* -Include @("*.cpz","*.md","*.cplz","*.json","*.dll","*.clz")
|
||||
Get-ChildItem -Path .\output\* | Copy-Item -Destination .\
|
||||
Remove-Item -Path .\output -Recurse
|
||||
# Commits the build output to the branch and tags it with the version
|
||||
- name: Commit build output and tag the commit
|
||||
shell: powershell
|
||||
run: |
|
||||
git config user.email "actions@pepperdash.com"
|
||||
git config user.name "GitHub Actions"
|
||||
git add .
|
||||
$commit = "Build $($Env:GITHUB_RUN_NUMBER) from commit: https://github.com/$($Env:GITHUB_REPOSITORY)/commit/$($Env:GITHUB_SHA)"
|
||||
Write-Host "Commit: $commit"
|
||||
git commit -m $commit
|
||||
git tag $($Env:VERSION)
|
||||
# Push the commit
|
||||
- name: Push to Builds Repo
|
||||
shell: powershell
|
||||
run: |
|
||||
$branch = $($Env:GITHUB_REF) -replace "refs/heads/"
|
||||
Write-Host "Branch: $branch"
|
||||
git push -u origin $($branch) --force
|
||||
# Push the tags
|
||||
- name: Push tags
|
||||
run: git push --tags origin
|
||||
- name: Check Directory
|
||||
run: Get-ChildItem ./
|
||||
|
||||
145
.github/workflows/main.yml
vendored
145
.github/workflows/main.yml
vendored
@@ -123,148 +123,3 @@ jobs:
|
||||
run: nuget push **/*.nupkg -source github
|
||||
- name: Publish nuget package to nuget.org
|
||||
run: nuget push **/*.nupkg -Source https://api.nuget.org/v3/index.json
|
||||
Internal_Push_Output:
|
||||
needs: Build_Project
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
# Checkout the repo
|
||||
- name: Checkout Builds Repo
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
token: ${{ secrets.BUILDS_TOKEN }}
|
||||
repository: PepperDash-Engineering/essentials-builds
|
||||
ref: ${{ Env.GITHUB_REF }}
|
||||
# Download the version artifact from the build job
|
||||
- name: Download Build Version Info
|
||||
uses: actions/download-artifact@v1
|
||||
with:
|
||||
name: Version
|
||||
- name: Check Directory
|
||||
run: Get-ChildItem "./"
|
||||
# Set the version number environment variable from the file we just downloaded
|
||||
- name: Set Version Number
|
||||
shell: powershell
|
||||
run: |
|
||||
Get-ChildItem "./Version"
|
||||
$version = Get-Content -Path ./Version/version.txt
|
||||
Write-Host "Version: $version"
|
||||
echo "VERSION=$version" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||
Remove-Item -Path ./Version/version.txt
|
||||
Remove-Item -Path ./Version
|
||||
# Checkout/Create the branch
|
||||
- name: Checkout main branch
|
||||
run: git checkout main
|
||||
# Download the build output into the repo
|
||||
- name: Download Build output
|
||||
uses: actions/download-artifact@v1
|
||||
with:
|
||||
name: Build
|
||||
path: ./
|
||||
- name: Check directory
|
||||
run: Get-ChildItem ./
|
||||
# Unzip the build package file
|
||||
- name: Unzip Build file
|
||||
run: |
|
||||
Get-ChildItem .\*.zip | Expand-Archive -DestinationPath .\
|
||||
Remove-Item -Path .\*.zip
|
||||
- name: Check directory again
|
||||
run: Get-ChildItem ./
|
||||
# Copy Contents of output folder to root directory
|
||||
- name: Copy Files to root & delete output directory
|
||||
run: |
|
||||
Remove-Item -Path .\* -Include @("*.cpz","*.md","*.cplz","*.json","*.dll","*.clz")
|
||||
Get-ChildItem -Path .\output\* | Copy-Item -Destination .\
|
||||
Remove-Item -Path .\output -Recurse
|
||||
# Commits the build output to the branch and tags it with the version
|
||||
- name: Commit build output and tag the commit
|
||||
shell: powershell
|
||||
run: |
|
||||
git config user.email "actions@pepperdash.com"
|
||||
git config user.name "GitHub Actions"
|
||||
git add .
|
||||
$commit = "Build $($Env:GITHUB_RUN_NUMBER) from commit: https://github.com/$($Env:GITHUB_REPOSITORY)/commit/$($Env:GITHUB_SHA)"
|
||||
Write-Host "Commit: $commit"
|
||||
git commit -m $commit
|
||||
git tag $($Env:VERSION)
|
||||
# Push the commit
|
||||
- name: Push to Builds Repo
|
||||
shell: powershell
|
||||
run: git push -u origin main --force
|
||||
# Push the tags
|
||||
- name: Push tags
|
||||
run: git push --tags origin
|
||||
- name: Check Directory
|
||||
run: Get-ChildItem ./
|
||||
# This step only runs if the branch is main or release/ runs and pushes the build to the public build repo
|
||||
Public_Push_Output:
|
||||
needs: Build_Project
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
# Checkout the repo
|
||||
- name: Checkout Builds Repo
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
token: ${{ secrets.BUILDS_TOKEN }}
|
||||
repository: PepperDash/Essentials-Builds
|
||||
ref: ${{ Env.GITHUB_REF }}
|
||||
# Download the version artifact from the build job
|
||||
- name: Download Build Version Info
|
||||
uses: actions/download-artifact@v1
|
||||
with:
|
||||
name: Version
|
||||
- name: Check Directory
|
||||
run: Get-ChildItem "./"
|
||||
# Set the version number environment variable from the file we just downloaded
|
||||
- name: Set Version Number
|
||||
shell: powershell
|
||||
run: |
|
||||
Get-ChildItem "./Version"
|
||||
$version = Get-Content -Path ./Version/version.txt
|
||||
Write-Host "Version: $version"
|
||||
echo "VERSION=$version" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||
Remove-Item -Path ./Version/version.txt
|
||||
Remove-Item -Path ./Version
|
||||
# Checkout main branch
|
||||
- name: Create new branch
|
||||
run: git checkout main
|
||||
# Download the build output into the repo
|
||||
- name: Download Build output
|
||||
uses: actions/download-artifact@v1
|
||||
with:
|
||||
name: Build
|
||||
path: ./
|
||||
- name: Check directory
|
||||
run: Get-ChildItem ./
|
||||
# Unzip the build package file
|
||||
- name: Unzip Build file
|
||||
run: |
|
||||
Get-ChildItem .\*.zip | Expand-Archive -DestinationPath .\
|
||||
Remove-Item -Path .\*.zip
|
||||
- name: Check directory again
|
||||
run: Get-ChildItem ./
|
||||
# Copy Contents of output folder to root directory
|
||||
- name: Copy Files to root & delete output directory
|
||||
run: |
|
||||
Remove-Item -Path .\* -Include @("*.cpz","*.md","*.cplz","*.json","*.dll","*.clz")
|
||||
Get-ChildItem -Path .\output\* | Copy-Item -Destination .\
|
||||
Remove-Item -Path .\output -Recurse
|
||||
# Commits the build output to the branch and tags it with the version
|
||||
- name: Commit build output and tag the commit
|
||||
shell: powershell
|
||||
run: |
|
||||
git config user.email "actions@pepperdash.com"
|
||||
git config user.name "GitHub Actions"
|
||||
git add .
|
||||
$commit = "Build $($Env:GITHUB_RUN_NUMBER) from commit: https://github.com/$($Env:GITHUB_REPOSITORY)/commit/$($Env:GITHUB_SHA)"
|
||||
Write-Host "Commit: $commit"
|
||||
git commit -m $commit
|
||||
git tag $($Env:VERSION)
|
||||
# Push the commit
|
||||
- name: Push to Builds Repo
|
||||
shell: powershell
|
||||
run: git push -u origin main --force
|
||||
# Push the tags
|
||||
- name: Push tags
|
||||
run: git push --tags origin
|
||||
- name: Check Directory
|
||||
run: Get-ChildItem ./
|
||||
|
||||
@@ -5,30 +5,62 @@ namespace PepperDash.Essentials.Room.Config
|
||||
{
|
||||
public class EssentialsTechRoomConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// The key of the dummy device used to enable routing
|
||||
/// </summary>
|
||||
[JsonProperty("dummySourceKey")]
|
||||
public string DummySourceKey { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The keys of the displays assigned to this room
|
||||
/// </summary>
|
||||
[JsonProperty("displays")]
|
||||
public List<string> Displays;
|
||||
public List<string> Displays { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The keys of the tuners assinged to this room
|
||||
/// </summary>
|
||||
[JsonProperty("tuners")]
|
||||
public List<string> Tuners;
|
||||
public List<string> Tuners { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// PIN to access the room as a normal user
|
||||
/// </summary>
|
||||
[JsonProperty("userPin")]
|
||||
public string UserPin;
|
||||
public string UserPin { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// PIN to access the room as a tech user
|
||||
/// </summary>
|
||||
[JsonProperty("techPin")]
|
||||
public string TechPin;
|
||||
public string TechPin { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Name of the presets file. Path prefix is assumed to be /html/presets/lists/
|
||||
/// </summary>
|
||||
[JsonProperty("presetsFileName")]
|
||||
public string PresetsFileName;
|
||||
public string PresetsFileName { get; set; }
|
||||
|
||||
[JsonProperty("scheduledEvents")]
|
||||
public List<ScheduledEventConfig> ScheduledEvents;
|
||||
public List<ScheduledEventConfig> ScheduledEvents { get; set; }
|
||||
|
||||
[JsonProperty("isPrimary")] public bool IsPrimary;
|
||||
/// <summary>
|
||||
/// Indicates that the room is the primary when true
|
||||
/// </summary>
|
||||
[JsonProperty("isPrimary")]
|
||||
public bool IsPrimary { get; set; }
|
||||
|
||||
[JsonProperty("isTvPresetsProvider")] public bool IsTvPresetsProvider;
|
||||
/// <summary>
|
||||
/// Indicates which tuners should mirror preset recall when two rooms are configured in a primary->secondary scenario
|
||||
/// </summary>
|
||||
[JsonProperty("mirroredTuners")]
|
||||
public Dictionary<uint, string> MirroredTuners { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates the room
|
||||
/// </summary>
|
||||
[JsonProperty("isTvPresetsProvider")]
|
||||
public bool IsTvPresetsProvider;
|
||||
|
||||
public EssentialsTechRoomConfig()
|
||||
{
|
||||
|
||||
@@ -13,7 +13,7 @@ using PepperDash.Essentials.Room.Config;
|
||||
using PepperDash.Essentials.Devices.Common.Codec;
|
||||
using PepperDash.Essentials.Devices.Common.VideoCodec;
|
||||
using PepperDash.Essentials.Devices.Common.AudioCodec;
|
||||
using PepperDash_Essentials_Core.DeviceTypeInterfaces;
|
||||
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
|
||||
|
||||
namespace PepperDash.Essentials
|
||||
{
|
||||
|
||||
@@ -183,11 +183,12 @@ namespace PepperDash.Essentials
|
||||
|
||||
var roomEvent = _roomScheduledEventGroup.ScheduledEvents[scheduledEvent.Key];
|
||||
|
||||
if (!SchedulerUtilities.CheckEventTimeForMatch(roomEvent, DateTime.Parse(scheduledEvent.Time)) &&
|
||||
!SchedulerUtilities.CheckEventRecurrenceForMatch(roomEvent, scheduledEvent.Days))
|
||||
{
|
||||
return;
|
||||
}
|
||||
//if (SchedulerUtilities.CheckEventTimeForMatch(roomEvent, DateTime.Parse(scheduledEvent.Time)) &&
|
||||
// SchedulerUtilities.CheckEventRecurrenceForMatch(roomEvent, scheduledEvent.Days))
|
||||
//{
|
||||
// Debug.Console(1, this, "Existing event matches new event properties. Nothing to update");
|
||||
// return;
|
||||
//}
|
||||
|
||||
Debug.Console(1, this,
|
||||
"Existing event does not match new config properties. Deleting existing event '{0}' and creating new event from configuration",
|
||||
@@ -373,13 +374,32 @@ Params: {2}"
|
||||
uint i;
|
||||
if (_config.IsPrimary)
|
||||
{
|
||||
i = 0;
|
||||
foreach (var feedback in CurrentPresetsFeedbacks)
|
||||
Debug.Console(1, this, "Linking Primary system Tuner Preset Mirroring");
|
||||
if (_config.MirroredTuners != null && _config.MirroredTuners.Count > 0)
|
||||
{
|
||||
feedback.Value.LinkInputSig(trilist.StringInput[(uint) (joinMap.CurrentPreset.JoinNumber + i)]);
|
||||
i++;
|
||||
foreach (var tuner in _config.MirroredTuners)
|
||||
{
|
||||
var f = CurrentPresetsFeedbacks[tuner.Value];
|
||||
|
||||
if (f == null)
|
||||
{
|
||||
Debug.Console(1, this, "Unable to find feedback with key: {0}", tuner.Value);
|
||||
continue;
|
||||
}
|
||||
|
||||
var join = joinMap.CurrentPreset.JoinNumber + tuner.Key;
|
||||
f.LinkInputSig(trilist.StringInput[(uint)(join)]);
|
||||
Debug.Console(1, this, "Linked Current Preset feedback for tuner: {0} to serial join: {1}", tuner.Value, join);
|
||||
}
|
||||
}
|
||||
|
||||
//i = 0;
|
||||
//foreach (var feedback in CurrentPresetsFeedbacks)
|
||||
//{
|
||||
// feedback.Value.LinkInputSig(trilist.StringInput[(uint) (joinMap.CurrentPreset.JoinNumber + i)]);
|
||||
// i++;
|
||||
//}
|
||||
|
||||
trilist.OnlineStatusChange += (device, args) =>
|
||||
{
|
||||
if (!args.DeviceOnLine)
|
||||
@@ -395,15 +415,35 @@ Params: {2}"
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
i = 0;
|
||||
foreach (var setTopBox in _tuners)
|
||||
else
|
||||
{
|
||||
var tuner = setTopBox;
|
||||
Debug.Console(1, this, "Linking Secondary system Tuner Preset Mirroring");
|
||||
|
||||
trilist.SetStringSigAction(joinMap.CurrentPreset.JoinNumber + i, s => _tunerPresets.Dial(s, tuner.Value));
|
||||
if (_config.MirroredTuners != null && _config.MirroredTuners.Count > 0)
|
||||
{
|
||||
foreach (var tuner in _config.MirroredTuners)
|
||||
{
|
||||
var t = _tuners[tuner.Value];
|
||||
|
||||
i++;
|
||||
if (t == null)
|
||||
{
|
||||
Debug.Console(1, this, "Unable to find tuner with key: {0}", tuner.Value);
|
||||
continue;
|
||||
}
|
||||
|
||||
var join = joinMap.CurrentPreset.JoinNumber + tuner.Key;
|
||||
trilist.SetStringSigAction(join, s => _tunerPresets.Dial(s, t));
|
||||
Debug.Console(1, this, "Linked preset recall action for tuner: {0} to serial join: {1}", tuner.Value, join);
|
||||
}
|
||||
|
||||
//foreach (var setTopBox in _tuners)
|
||||
//{
|
||||
// var tuner = setTopBox;
|
||||
|
||||
// trilist.SetStringSigAction(joinMap.CurrentPreset.JoinNumber + i, s => _tunerPresets.Dial(s, tuner.Value));
|
||||
|
||||
//}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,131 +1,274 @@
|
||||
using System;
|
||||
using PepperDash.Essentials.Core;
|
||||
|
||||
namespace PepperDash_Essentials_Core.Bridges.JoinMaps
|
||||
namespace PepperDash.Essentials.Core.Bridges.JoinMaps
|
||||
{
|
||||
public class GlsPartitionSensorJoinMap : JoinMapBaseAdvanced
|
||||
{
|
||||
[JoinName("IsOnline")]
|
||||
public JoinDataComplete IsOnline = new JoinDataComplete(
|
||||
new JoinData
|
||||
{
|
||||
JoinNumber = 1,
|
||||
JoinSpan = 1
|
||||
},
|
||||
new JoinMetadata
|
||||
{
|
||||
Description = "Sensor Is Online",
|
||||
JoinCapabilities = eJoinCapabilities.ToSIMPL,
|
||||
JoinType = eJoinType.Digital
|
||||
});
|
||||
public class GlsPartitionSensorJoinMap : JoinMapBaseAdvanced
|
||||
{
|
||||
[JoinName("IsOnline")]
|
||||
public JoinDataComplete IsOnline = new JoinDataComplete(
|
||||
new JoinData
|
||||
{
|
||||
JoinNumber = 1,
|
||||
JoinSpan = 1
|
||||
},
|
||||
new JoinMetadata
|
||||
{
|
||||
Description = "Sensor Is Online",
|
||||
JoinCapabilities = eJoinCapabilities.ToSIMPL,
|
||||
JoinType = eJoinType.Digital
|
||||
});
|
||||
|
||||
[JoinName("Name")]
|
||||
public JoinDataComplete Name = new JoinDataComplete(
|
||||
new JoinData
|
||||
{
|
||||
JoinNumber = 1,
|
||||
JoinSpan = 1
|
||||
},
|
||||
new JoinMetadata
|
||||
{
|
||||
Description = "Sensor Name",
|
||||
JoinCapabilities = eJoinCapabilities.ToSIMPL,
|
||||
JoinType = eJoinType.Serial
|
||||
});
|
||||
[JoinName("Name")]
|
||||
public JoinDataComplete Name = new JoinDataComplete(
|
||||
new JoinData
|
||||
{
|
||||
JoinNumber = 1,
|
||||
JoinSpan = 1
|
||||
},
|
||||
new JoinMetadata
|
||||
{
|
||||
Description = "Sensor Name",
|
||||
JoinCapabilities = eJoinCapabilities.ToSIMPL,
|
||||
JoinType = eJoinType.Serial
|
||||
});
|
||||
|
||||
[JoinName("Enable")]
|
||||
public JoinDataComplete Enable = new JoinDataComplete(
|
||||
new JoinData
|
||||
{
|
||||
JoinNumber = 2,
|
||||
JoinSpan = 1
|
||||
},
|
||||
new JoinMetadata
|
||||
{
|
||||
Description = "Sensor Enable",
|
||||
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
|
||||
JoinType = eJoinType.Digital
|
||||
});
|
||||
[JoinName("Enable")]
|
||||
public JoinDataComplete Enable = new JoinDataComplete(
|
||||
new JoinData
|
||||
{
|
||||
JoinNumber = 2,
|
||||
JoinSpan = 1
|
||||
},
|
||||
new JoinMetadata
|
||||
{
|
||||
Description = "Sensor Enable",
|
||||
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
|
||||
JoinType = eJoinType.Digital
|
||||
});
|
||||
|
||||
[JoinName("PartitionSensed")]
|
||||
public JoinDataComplete PartitionSensed = new JoinDataComplete(
|
||||
new JoinData
|
||||
{
|
||||
JoinNumber = 3,
|
||||
JoinSpan = 1
|
||||
},
|
||||
new JoinMetadata
|
||||
{
|
||||
Description = "Sensor Partition Sensed",
|
||||
JoinCapabilities = eJoinCapabilities.ToSIMPL,
|
||||
JoinType = eJoinType.Digital
|
||||
});
|
||||
[JoinName("PartitionSensed")]
|
||||
public JoinDataComplete PartitionSensed = new JoinDataComplete(
|
||||
new JoinData
|
||||
{
|
||||
JoinNumber = 3,
|
||||
JoinSpan = 1
|
||||
},
|
||||
new JoinMetadata
|
||||
{
|
||||
Description = "Sensor Partition Sensed",
|
||||
JoinCapabilities = eJoinCapabilities.ToSIMPL,
|
||||
JoinType = eJoinType.Digital
|
||||
});
|
||||
|
||||
[JoinName("PartitionNotSensed")]
|
||||
public JoinDataComplete PartitionNotSensed = new JoinDataComplete(
|
||||
new JoinData
|
||||
{
|
||||
JoinNumber = 4,
|
||||
JoinSpan = 1
|
||||
},
|
||||
new JoinMetadata
|
||||
{
|
||||
Description = "Sensor Partition Not Sensed",
|
||||
JoinCapabilities = eJoinCapabilities.ToSIMPL,
|
||||
JoinType = eJoinType.Digital
|
||||
});
|
||||
[JoinName("PartitionNotSensed")]
|
||||
public JoinDataComplete PartitionNotSensed = new JoinDataComplete(
|
||||
new JoinData
|
||||
{
|
||||
JoinNumber = 4,
|
||||
JoinSpan = 1
|
||||
},
|
||||
new JoinMetadata
|
||||
{
|
||||
Description = "Sensor Partition Not Sensed",
|
||||
JoinCapabilities = eJoinCapabilities.ToSIMPL,
|
||||
JoinType = eJoinType.Digital
|
||||
});
|
||||
|
||||
[JoinName("IncreaseSensitivity")]
|
||||
public JoinDataComplete IncreaseSensitivity = new JoinDataComplete(
|
||||
new JoinData
|
||||
{
|
||||
JoinNumber = 6,
|
||||
JoinSpan = 1
|
||||
},
|
||||
new JoinMetadata
|
||||
{
|
||||
Description = "Sensor Increase Sensitivity",
|
||||
JoinCapabilities = eJoinCapabilities.FromSIMPL,
|
||||
JoinType = eJoinType.Digital
|
||||
});
|
||||
[JoinName("IncreaseSensitivity")]
|
||||
public JoinDataComplete IncreaseSensitivity = new JoinDataComplete(
|
||||
new JoinData
|
||||
{
|
||||
JoinNumber = 6,
|
||||
JoinSpan = 1
|
||||
},
|
||||
new JoinMetadata
|
||||
{
|
||||
Description = "Sensor Increase Sensitivity",
|
||||
JoinCapabilities = eJoinCapabilities.FromSIMPL,
|
||||
JoinType = eJoinType.Digital
|
||||
});
|
||||
|
||||
[JoinName("DecreaseSensitivity")]
|
||||
public JoinDataComplete DecreaseSensitivity = new JoinDataComplete(
|
||||
new JoinData
|
||||
{
|
||||
JoinNumber = 7,
|
||||
JoinSpan = 1
|
||||
},
|
||||
new JoinMetadata
|
||||
{
|
||||
Description = "Sensor Decrease Sensitivity",
|
||||
JoinCapabilities = eJoinCapabilities.FromSIMPL,
|
||||
JoinType = eJoinType.Digital
|
||||
});
|
||||
[JoinName("DecreaseSensitivity")]
|
||||
public JoinDataComplete DecreaseSensitivity = new JoinDataComplete(
|
||||
new JoinData
|
||||
{
|
||||
JoinNumber = 7,
|
||||
JoinSpan = 1
|
||||
},
|
||||
new JoinMetadata
|
||||
{
|
||||
Description = "Sensor Decrease Sensitivity",
|
||||
JoinCapabilities = eJoinCapabilities.FromSIMPL,
|
||||
JoinType = eJoinType.Digital
|
||||
});
|
||||
|
||||
[JoinName("Sensitivity")]
|
||||
public JoinDataComplete Sensitivity = new JoinDataComplete(
|
||||
new JoinData
|
||||
{
|
||||
JoinNumber = 2,
|
||||
JoinSpan = 1
|
||||
},
|
||||
new JoinMetadata
|
||||
{
|
||||
Description = "Sensor Sensitivity",
|
||||
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
|
||||
JoinType = eJoinType.Analog
|
||||
});
|
||||
[JoinName("Sensitivity")]
|
||||
public JoinDataComplete Sensitivity = new JoinDataComplete(
|
||||
new JoinData
|
||||
{
|
||||
JoinNumber = 2,
|
||||
JoinSpan = 1
|
||||
},
|
||||
new JoinMetadata
|
||||
{
|
||||
Description = "Sensor Sensitivity",
|
||||
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
|
||||
JoinType = eJoinType.Analog
|
||||
});
|
||||
|
||||
/// <summary>
|
||||
/// Constructor to use when instantiating this Join Map without inheriting from it
|
||||
/// </summary>
|
||||
/// <param name="joinStart">Join this join map will start at</param>
|
||||
public GlsPartitionSensorJoinMap(uint joinStart)
|
||||
: this(joinStart, typeof (GlsPartitionSensorJoinMap))
|
||||
{
|
||||
public GlsPartitionSensorJoinMap(uint joinStart)
|
||||
: this(joinStart, typeof(GlsPartitionSensorJoinMap))
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Constructor to use when extending this Join map
|
||||
/// </summary>
|
||||
/// <param name="joinStart">Join this join map will start at</param>
|
||||
/// <param name="type">Type of the child join map</param>
|
||||
protected GlsPartitionSensorJoinMap(uint joinStart, Type type)
|
||||
: base(joinStart, type)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
namespace PepperDash_Essentials_Core.Bridges.JoinMaps
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
[Obsolete("use PepperDash.Essentials.Core.Bridges.JoinMaps version")]
|
||||
public class GlsPartitionSensorJoinMap:JoinMapBaseAdvanced
|
||||
{
|
||||
[JoinName("IsOnline")]
|
||||
public JoinDataComplete IsOnline = new JoinDataComplete(
|
||||
new JoinData
|
||||
{
|
||||
JoinNumber = 1,
|
||||
JoinSpan = 1
|
||||
},
|
||||
new JoinMetadata
|
||||
{
|
||||
Description = "Sensor Is Online",
|
||||
JoinCapabilities = eJoinCapabilities.ToSIMPL,
|
||||
JoinType = eJoinType.Digital
|
||||
});
|
||||
|
||||
[JoinName("Name")]
|
||||
public JoinDataComplete Name = new JoinDataComplete(
|
||||
new JoinData
|
||||
{
|
||||
JoinNumber = 1,
|
||||
JoinSpan = 1
|
||||
},
|
||||
new JoinMetadata
|
||||
{
|
||||
Description = "Sensor Name",
|
||||
JoinCapabilities = eJoinCapabilities.ToSIMPL,
|
||||
JoinType = eJoinType.Serial
|
||||
});
|
||||
|
||||
[JoinName("Enable")]
|
||||
public JoinDataComplete Enable = new JoinDataComplete(
|
||||
new JoinData
|
||||
{
|
||||
JoinNumber = 2,
|
||||
JoinSpan = 1
|
||||
},
|
||||
new JoinMetadata
|
||||
{
|
||||
Description = "Sensor Enable",
|
||||
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
|
||||
JoinType = eJoinType.Digital
|
||||
});
|
||||
|
||||
[JoinName("PartitionSensed")]
|
||||
public JoinDataComplete PartitionSensed = new JoinDataComplete(
|
||||
new JoinData
|
||||
{
|
||||
JoinNumber = 3,
|
||||
JoinSpan = 1
|
||||
},
|
||||
new JoinMetadata
|
||||
{
|
||||
Description = "Sensor Partition Sensed",
|
||||
JoinCapabilities = eJoinCapabilities.ToSIMPL,
|
||||
JoinType = eJoinType.Digital
|
||||
});
|
||||
|
||||
[JoinName("PartitionNotSensed")]
|
||||
public JoinDataComplete PartitionNotSensed = new JoinDataComplete(
|
||||
new JoinData
|
||||
{
|
||||
JoinNumber = 4,
|
||||
JoinSpan = 1
|
||||
},
|
||||
new JoinMetadata
|
||||
{
|
||||
Description = "Sensor Partition Not Sensed",
|
||||
JoinCapabilities = eJoinCapabilities.ToSIMPL,
|
||||
JoinType = eJoinType.Digital
|
||||
});
|
||||
|
||||
[JoinName("IncreaseSensitivity")]
|
||||
public JoinDataComplete IncreaseSensitivity = new JoinDataComplete(
|
||||
new JoinData
|
||||
{
|
||||
JoinNumber = 6,
|
||||
JoinSpan = 1
|
||||
},
|
||||
new JoinMetadata
|
||||
{
|
||||
Description = "Sensor Increase Sensitivity",
|
||||
JoinCapabilities = eJoinCapabilities.FromSIMPL,
|
||||
JoinType = eJoinType.Digital
|
||||
});
|
||||
|
||||
[JoinName("DecreaseSensitivity")]
|
||||
public JoinDataComplete DecreaseSensitivity = new JoinDataComplete(
|
||||
new JoinData
|
||||
{
|
||||
JoinNumber = 7,
|
||||
JoinSpan = 1
|
||||
},
|
||||
new JoinMetadata
|
||||
{
|
||||
Description = "Sensor Decrease Sensitivity",
|
||||
JoinCapabilities = eJoinCapabilities.FromSIMPL,
|
||||
JoinType = eJoinType.Digital
|
||||
});
|
||||
|
||||
[JoinName("Sensitivity")]
|
||||
public JoinDataComplete Sensitivity = new JoinDataComplete(
|
||||
new JoinData
|
||||
{
|
||||
JoinNumber = 2,
|
||||
JoinSpan = 1
|
||||
},
|
||||
new JoinMetadata
|
||||
{
|
||||
Description = "Sensor Sensitivity",
|
||||
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
|
||||
JoinType = eJoinType.Analog
|
||||
});
|
||||
|
||||
/// <summary>
|
||||
/// Constructor to use when instantiating this Join Map without inheriting from it
|
||||
/// </summary>
|
||||
/// <param name="joinStart">Join this join map will start at</param>
|
||||
public GlsPartitionSensorJoinMap(uint joinStart)
|
||||
: this(joinStart, typeof(GlsPartitionSensorJoinMap))
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Constructor to use when extending this Join map
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,8 +1,20 @@
|
||||
namespace PepperDash_Essentials_Core.DeviceTypeInterfaces
|
||||
using System;
|
||||
|
||||
namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
|
||||
{
|
||||
public interface IHasBranding
|
||||
{
|
||||
bool BrandingEnabled { get; }
|
||||
void InitializeBranding(string roomKey);
|
||||
}
|
||||
}
|
||||
|
||||
namespace PepperDash_Essentials_Core.DeviceTypeInterfaces
|
||||
{
|
||||
[Obsolete("Use PepperDash.Essentials.Core.DeviceTypeInterfaces")]
|
||||
public interface IHasBranding
|
||||
{
|
||||
bool BrandingEnabled { get; }
|
||||
void InitializeBranding(string roomKey);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
using PepperDash.Essentials.Core;
|
||||
using System;
|
||||
using PepperDash.Essentials.Core;
|
||||
|
||||
namespace PepperDash_Essentials_Core.DeviceTypeInterfaces
|
||||
namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
|
||||
{
|
||||
public interface IHasPhoneDialing
|
||||
{
|
||||
@@ -11,4 +12,18 @@ namespace PepperDash_Essentials_Core.DeviceTypeInterfaces
|
||||
void EndPhoneCall();
|
||||
void SendDtmfToPhone(string digit);
|
||||
}
|
||||
}
|
||||
|
||||
namespace PepperDash_Essentials_Core.DeviceTypeInterfaces
|
||||
{
|
||||
[Obsolete("Use PepperDash.Essentials.Core.DeviceTypeInterfaces")]
|
||||
public interface IHasPhoneDialing
|
||||
{
|
||||
BoolFeedback PhoneOffHookFeedback { get; }
|
||||
StringFeedback CallerIdNameFeedback { get; }
|
||||
StringFeedback CallerIdNumberFeedback { get; }
|
||||
void DialPhoneCall(string number);
|
||||
void EndPhoneCall();
|
||||
void SendDtmfToPhone(string digit);
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace PepperDash_Essentials_Core.DeviceTypeInterfaces
|
||||
namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
|
||||
{
|
||||
public interface ILanguageDefinition
|
||||
{
|
||||
@@ -15,4 +15,21 @@ namespace PepperDash_Essentials_Core.DeviceTypeInterfaces
|
||||
List<LanguageLabel> DestinationGroupNames { get; set; }
|
||||
List<LanguageLabel> RoomNames { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
namespace PepperDash_Essentials_Core.DeviceTypeInterfaces
|
||||
{
|
||||
[Obsolete("Use PepperDash.Essentials.Core.DeviceTypeInterfaces")]
|
||||
public interface ILanguageDefinition
|
||||
{
|
||||
string LocaleName { get; set; }
|
||||
string FriendlyName { get; set; }
|
||||
bool Enable { get; set; }
|
||||
List<LanguageLabel> UiLabels { get; set; }
|
||||
List<LanguageLabel> Sources { get; set; }
|
||||
List<LanguageLabel> Destinations { get; set; }
|
||||
List<LanguageLabel> SourceGroupNames { get; set; }
|
||||
List<LanguageLabel> DestinationGroupNames { get; set; }
|
||||
List<LanguageLabel> RoomNames { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
|
||||
{
|
||||
|
||||
public interface ILanguageProvider
|
||||
{
|
||||
ILanguageDefinition CurrentLanguage { get; set; }
|
||||
|
||||
event EventHandler CurrentLanguageChanged;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
namespace PepperDash_Essentials_Core.DeviceTypeInterfaces
|
||||
{
|
||||
public interface ILanguageProvider
|
||||
[Obsolete("Use PepperDash.Essentials.Core.DeviceTypeInterfaces")]
|
||||
public interface ILanguageProvider
|
||||
{
|
||||
ILanguageDefinition CurrentLanguage { get; set; }
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using PepperDash.Core;
|
||||
using System;
|
||||
using PepperDash.Core;
|
||||
|
||||
namespace PepperDash_Essentials_Core.DeviceTypeInterfaces
|
||||
namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
|
||||
{
|
||||
public class LanguageLabel
|
||||
{
|
||||
@@ -9,4 +10,16 @@ namespace PepperDash_Essentials_Core.DeviceTypeInterfaces
|
||||
public string DisplayText { get; set; }
|
||||
public uint JoinNumber { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
namespace PepperDash_Essentials_Core.DeviceTypeInterfaces
|
||||
{
|
||||
[Obsolete("Use PepperDash.Essentials.Core.DeviceTypeInterfaces")]
|
||||
public class LanguageLabel
|
||||
{
|
||||
public string Key { get; set; }
|
||||
public string Description { get; set; }
|
||||
public string DisplayText { get; set; }
|
||||
public uint JoinNumber { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,7 @@ using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.Bridges;
|
||||
using PepperDash.Essentials.Core.Config;
|
||||
|
||||
namespace PepperDash_Essentials_Core.Devices
|
||||
namespace PepperDash.Essentials.Core.Devices
|
||||
{
|
||||
public class GenericIrController: EssentialsBridgeableDevice
|
||||
{
|
||||
|
||||
@@ -3,8 +3,9 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using PepperDash.Essentials.Core;
|
||||
|
||||
namespace PepperDash_Essentials_Core
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
public class IsReadyEventArgs : EventArgs
|
||||
{
|
||||
@@ -16,6 +17,27 @@ namespace PepperDash_Essentials_Core
|
||||
}
|
||||
}
|
||||
|
||||
public interface IHasReady
|
||||
{
|
||||
event EventHandler<IsReadyEventArgs> IsReadyEvent;
|
||||
bool IsReady { get; }
|
||||
}
|
||||
}
|
||||
|
||||
namespace PepperDash_Essentials_Core
|
||||
{
|
||||
[Obsolete("Use PepperDash.Essentials.Core")]
|
||||
public class IsReadyEventArgs : EventArgs
|
||||
{
|
||||
public bool IsReady { get; set; }
|
||||
|
||||
public IsReadyEventArgs(bool data)
|
||||
{
|
||||
IsReady = data;
|
||||
}
|
||||
}
|
||||
|
||||
[Obsolete("Use PepperDash.Essentials.Core")]
|
||||
public interface IHasReady
|
||||
{
|
||||
event EventHandler<IsReadyEventArgs> IsReadyEvent;
|
||||
|
||||
@@ -10,9 +10,7 @@ using Crestron.SimplSharpPro.DeviceSupport;
|
||||
|
||||
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.Config;
|
||||
using PepperDash_Essentials_Core;
|
||||
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace PepperDash.Essentials.Core
|
||||
|
||||
RegisterCrestronGenericBase(_occSensor);
|
||||
|
||||
RegisterGlsOccupancySensorBaseController(OccSensor);
|
||||
RegisterGlsOccupancySensorBaseController(_occSensor);
|
||||
|
||||
AndWhenVacatedFeedback = new BoolFeedback(() => _occSensor.AndWhenVacatedFeedback.BoolValue);
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ using Crestron.SimplSharpPro.GeneralIO;
|
||||
using Newtonsoft.Json;
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core.Bridges;
|
||||
using PepperDash_Essentials_Core.Bridges.JoinMaps;
|
||||
using PepperDash.Essentials.Core.Bridges.JoinMaps;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using PepperDash.Core;
|
||||
|
||||
namespace PepperDash_Essentials_Core.Queues
|
||||
namespace PepperDash.Essentials.Core.Queues
|
||||
{
|
||||
/// <summary>
|
||||
/// IBasicCommunication Message for IQueue
|
||||
@@ -62,6 +62,78 @@ namespace PepperDash_Essentials_Core.Queues
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Shows either the byte[] or string to be sent
|
||||
/// </summary>
|
||||
public override string ToString()
|
||||
{
|
||||
return _bytes != null ? _bytes.ToString() : _string;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
namespace PepperDash_Essentials_Core.Queues
|
||||
{
|
||||
/// <summary>
|
||||
/// IBasicCommunication Message for IQueue
|
||||
/// </summary>
|
||||
[Obsolete("Use PepperDash.Essentials.Core.Queues")]
|
||||
public class ComsMessage : IQueueMessage
|
||||
{
|
||||
private readonly byte[] _bytes;
|
||||
private readonly IBasicCommunication _coms;
|
||||
private readonly string _string;
|
||||
private readonly bool _isByteMessage;
|
||||
|
||||
/// <summary>
|
||||
/// Constructor for a string message
|
||||
/// </summary>
|
||||
/// <param name="coms">IBasicCommunication to send the message</param>
|
||||
/// <param name="message">Message to send</param>
|
||||
public ComsMessage(IBasicCommunication coms, string message)
|
||||
{
|
||||
Validate(coms, message);
|
||||
_coms = coms;
|
||||
_string = message;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Constructor for a byte message
|
||||
/// </summary>
|
||||
/// <param name="coms">IBasicCommunication to send the message</param>
|
||||
/// <param name="message">Message to send</param>
|
||||
public ComsMessage(IBasicCommunication coms, byte[] message)
|
||||
{
|
||||
Validate(coms, message);
|
||||
_coms = coms;
|
||||
_bytes = message;
|
||||
_isByteMessage = true;
|
||||
}
|
||||
|
||||
private void Validate(IBasicCommunication coms, object message)
|
||||
{
|
||||
if (coms == null)
|
||||
throw new ArgumentNullException("coms");
|
||||
|
||||
if (message == null)
|
||||
throw new ArgumentNullException("message");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Dispatchs the string/byte[] to the IBasicCommunication specified
|
||||
/// </summary>
|
||||
public void Dispatch()
|
||||
{
|
||||
if (_isByteMessage)
|
||||
{
|
||||
_coms.SendBytes(_bytes);
|
||||
}
|
||||
else
|
||||
{
|
||||
_coms.SendText(_string);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Shows either the byte[] or string to be sent
|
||||
/// </summary>
|
||||
|
||||
@@ -3,7 +3,7 @@ using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro.CrestronThread;
|
||||
using PepperDash.Core;
|
||||
|
||||
namespace PepperDash_Essentials_Core.Queues
|
||||
namespace PepperDash.Essentials.Core.Queues
|
||||
{
|
||||
/// <summary>
|
||||
/// Threadsafe processing of queued items with pacing if required
|
||||
@@ -126,7 +126,9 @@ namespace PepperDash_Essentials_Core.Queues
|
||||
/// </summary>
|
||||
/// <param name="key">Key</param>
|
||||
/// <param name="priority"></param>
|
||||
private GenericQueue(string key, Thread.eThreadPriority priority, int capacity, int pacing)
|
||||
/// <param name="capacity"></param>
|
||||
/// <param name="pacing"></param>
|
||||
protected GenericQueue(string key, Thread.eThreadPriority priority, int capacity, int pacing)
|
||||
{
|
||||
_key = key;
|
||||
int cap = 25; // sets default
|
||||
@@ -236,6 +238,252 @@ namespace PepperDash_Essentials_Core.Queues
|
||||
Dispose(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Key
|
||||
/// </summary>
|
||||
public string Key
|
||||
{
|
||||
get { return _key; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
namespace PepperDash_Essentials_Core.Queues
|
||||
{
|
||||
/// <summary>
|
||||
/// Threadsafe processing of queued items with pacing if required
|
||||
/// </summary>
|
||||
[Obsolete("Use PepperDash.Essentials.Core.Queues")]
|
||||
public class GenericQueue : IQueue<IQueueMessage>
|
||||
{
|
||||
private readonly string _key;
|
||||
protected readonly CrestronQueue<IQueueMessage> _queue;
|
||||
protected readonly Thread _worker;
|
||||
protected readonly CEvent _waitHandle = new CEvent();
|
||||
|
||||
private bool _delayEnabled;
|
||||
private int _delayTime;
|
||||
|
||||
private const Thread.eThreadPriority _defaultPriority = Thread.eThreadPriority.MediumPriority;
|
||||
|
||||
/// <summary>
|
||||
/// If the instance has been disposed.
|
||||
/// </summary>
|
||||
public bool Disposed { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns the capacity of the CrestronQueue (fixed Size property)
|
||||
/// </summary>
|
||||
public int QueueCapacity
|
||||
{
|
||||
get
|
||||
{
|
||||
return _queue.Size;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the number of elements currently in the CrestronQueue
|
||||
/// </summary>
|
||||
public int QueueCount
|
||||
{
|
||||
get
|
||||
{
|
||||
return _queue.Count;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Constructor with no thread priority
|
||||
/// </summary>
|
||||
/// <param name="key"></param>
|
||||
public GenericQueue(string key)
|
||||
: this(key, _defaultPriority, 0, 0)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Constructor with queue size
|
||||
/// </summary>
|
||||
/// <param name="key"></param>
|
||||
/// <param name="capacity">Fixed size for the queue to hold</param>
|
||||
public GenericQueue(string key, int capacity)
|
||||
: this(key, _defaultPriority, capacity, 0)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Constructor for generic queue with no pacing
|
||||
/// </summary>
|
||||
/// <param name="key">Key</param>
|
||||
/// <param name="pacing">Pacing in ms between actions</param>
|
||||
public GenericQueue(int pacing, string key)
|
||||
: this(key, _defaultPriority, 0, pacing)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Constructor with pacing and capacity
|
||||
/// </summary>
|
||||
/// <param name="key"></param>
|
||||
/// <param name="pacing"></param>
|
||||
/// <param name="capacity"></param>
|
||||
public GenericQueue(string key, int pacing, int capacity)
|
||||
: this(key, _defaultPriority, capacity, pacing)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Constructor with pacing and priority
|
||||
/// </summary>
|
||||
/// <param name="key"></param>
|
||||
/// <param name="pacing"></param>
|
||||
/// <param name="priority"></param>
|
||||
public GenericQueue(string key, int pacing, Thread.eThreadPriority priority)
|
||||
: this(key, priority, 0, pacing)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Constructor with pacing, priority and capacity
|
||||
/// </summary>
|
||||
/// <param name="key"></param>
|
||||
/// <param name="priority"></param>
|
||||
/// <param name="capacity"></param>
|
||||
public GenericQueue(string key, Thread.eThreadPriority priority, int capacity)
|
||||
: this(key, priority, capacity, 0)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Constructor with pacing, priority and capacity
|
||||
/// </summary>
|
||||
/// <param name="key"></param>
|
||||
/// <param name="pacing"></param>
|
||||
/// <param name="priority"></param>
|
||||
/// <param name="capacity"></param>
|
||||
public GenericQueue(string key, int pacing, Thread.eThreadPriority priority, int capacity)
|
||||
: this(key, priority, capacity, pacing)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Constructor for generic queue with no pacing
|
||||
/// </summary>
|
||||
/// <param name="key">Key</param>
|
||||
/// <param name="priority"></param>
|
||||
/// <param name="capacity"></param>
|
||||
/// <param name="pacing"></param>
|
||||
protected GenericQueue(string key, Thread.eThreadPriority priority, int capacity, int pacing)
|
||||
{
|
||||
_key = key;
|
||||
int cap = 25; // sets default
|
||||
if (capacity > 0)
|
||||
{
|
||||
cap = capacity; // overrides default
|
||||
}
|
||||
_queue = new CrestronQueue<IQueueMessage>(cap);
|
||||
_worker = new Thread(ProcessQueue, null, Thread.eThreadStartOptions.Running)
|
||||
{
|
||||
Priority = priority
|
||||
};
|
||||
|
||||
SetDelayValues(pacing);
|
||||
}
|
||||
|
||||
private void SetDelayValues(int pacing)
|
||||
{
|
||||
_delayEnabled = pacing > 0;
|
||||
_delayTime = pacing;
|
||||
|
||||
CrestronEnvironment.ProgramStatusEventHandler += programEvent =>
|
||||
{
|
||||
if (programEvent != eProgramStatusEventType.Stopping)
|
||||
return;
|
||||
|
||||
Dispose();
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Thread callback
|
||||
/// </summary>
|
||||
/// <param name="obj">The action used to process dequeued items</param>
|
||||
/// <returns>Null when the thread is exited</returns>
|
||||
private object ProcessQueue(object obj)
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
IQueueMessage item = null;
|
||||
|
||||
if (_queue.Count > 0)
|
||||
{
|
||||
item = _queue.Dequeue();
|
||||
if (item == null)
|
||||
break;
|
||||
}
|
||||
if (item != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
Debug.Console(2, this, "Processing queue item: '{0}'", item.ToString());
|
||||
item.Dispatch();
|
||||
|
||||
if (_delayEnabled)
|
||||
Thread.Sleep(_delayTime);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.Console(0, this, Debug.ErrorLogLevel.Error, "Caught an exception in the Queue {0}\r{1}\r{2}", ex.Message, ex.InnerException, ex.StackTrace);
|
||||
}
|
||||
}
|
||||
else _waitHandle.Wait();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public void Enqueue(IQueueMessage item)
|
||||
{
|
||||
_queue.Enqueue(item);
|
||||
_waitHandle.Set();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Disposes the thread and cleans up resources. Thread cannot be restarted once
|
||||
/// disposed.
|
||||
/// </summary>
|
||||
public void Dispose()
|
||||
{
|
||||
Dispose(true);
|
||||
CrestronEnvironment.GC.SuppressFinalize(this);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Actually does the disposing. If you override this method, be sure to either call the base implementation
|
||||
/// or clean up all the resources yourself.
|
||||
/// </summary>
|
||||
/// <param name="disposing">set to true unless called from finalizer</param>
|
||||
protected void Dispose(bool disposing)
|
||||
{
|
||||
if (Disposed)
|
||||
return;
|
||||
|
||||
if (disposing)
|
||||
{
|
||||
Enqueue(null);
|
||||
_worker.Join();
|
||||
_waitHandle.Close();
|
||||
}
|
||||
|
||||
Disposed = true;
|
||||
}
|
||||
|
||||
~GenericQueue()
|
||||
{
|
||||
Dispose(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Key
|
||||
/// </summary>
|
||||
|
||||
@@ -5,11 +5,21 @@ using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using PepperDash.Core;
|
||||
|
||||
namespace PepperDash_Essentials_Core.Queues
|
||||
namespace PepperDash.Essentials.Core.Queues
|
||||
{
|
||||
public interface IQueue<T> : IKeyed, IDisposable where T : class
|
||||
{
|
||||
void Enqueue(T item);
|
||||
bool Disposed { get; }
|
||||
}
|
||||
}
|
||||
|
||||
namespace PepperDash_Essentials_Core.Queues
|
||||
{
|
||||
[Obsolete("Use PepperDash.Essentials.Core.Queues")]
|
||||
public interface IQueue<T> : IKeyed, IDisposable where T : class
|
||||
{
|
||||
void Enqueue(T item);
|
||||
bool Disposed { get; }
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,18 @@
|
||||
namespace PepperDash_Essentials_Core.Queues
|
||||
using System;
|
||||
|
||||
namespace PepperDash.Essentials.Core.Queues
|
||||
{
|
||||
public interface IQueueMessage
|
||||
{
|
||||
void Dispatch();
|
||||
}
|
||||
}
|
||||
|
||||
namespace PepperDash_Essentials_Core.Queues
|
||||
{
|
||||
[Obsolete("Use PepperDash.Essentials.Core.Queues")]
|
||||
public interface IQueueMessage
|
||||
{
|
||||
void Dispatch();
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
using System;
|
||||
|
||||
namespace PepperDash_Essentials_Core.Queues
|
||||
namespace PepperDash.Essentials.Core.Queues
|
||||
{
|
||||
/// <summary>
|
||||
/// Message class for processing strings via an IQueue
|
||||
@@ -32,6 +32,50 @@ namespace PepperDash_Essentials_Core.Queues
|
||||
_action(_message);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// To string
|
||||
/// </summary>
|
||||
/// <returns>The current message</returns>
|
||||
public override string ToString()
|
||||
{
|
||||
return _message ?? String.Empty;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
namespace PepperDash_Essentials_Core.Queues
|
||||
{
|
||||
/// <summary>
|
||||
/// Message class for processing strings via an IQueue
|
||||
/// </summary>
|
||||
[Obsolete("Use PepperDash.Essentials.Core.Queues")]
|
||||
public class ProcessStringMessage : IQueueMessage
|
||||
{
|
||||
private readonly Action<string> _action;
|
||||
private readonly string _message;
|
||||
|
||||
/// <summary>
|
||||
/// Constructor
|
||||
/// </summary>
|
||||
/// <param name="message">Message to be processed</param>
|
||||
/// <param name="action">Action to invoke on the message</param>
|
||||
public ProcessStringMessage(string message, Action<string> action)
|
||||
{
|
||||
_message = message;
|
||||
_action = action;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Processes the string with the given action
|
||||
/// </summary>
|
||||
public void Dispatch()
|
||||
{
|
||||
if (_action == null || String.IsNullOrEmpty(_message))
|
||||
return;
|
||||
|
||||
_action(_message);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// To string
|
||||
/// </summary>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
using Crestron.SimplSharp;
|
||||
using PepperDash.Core;
|
||||
|
||||
namespace PepperDash_Essentials_Core.Queues
|
||||
namespace PepperDash.Essentials.Core.Queues
|
||||
{
|
||||
public sealed class StringResponseProcessor : IKeyed, IDisposable
|
||||
{
|
||||
@@ -98,6 +98,110 @@ namespace PepperDash_Essentials_Core.Queues
|
||||
/// </summary>
|
||||
public bool Disposed { get; private set; }
|
||||
|
||||
~StringResponseProcessor()
|
||||
{
|
||||
Dispose(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
namespace PepperDash_Essentials_Core.Queues
|
||||
{
|
||||
[Obsolete("Use PepperDash.Essentials.Core.Queues")]
|
||||
public sealed class StringResponseProcessor : IKeyed, IDisposable
|
||||
{
|
||||
private readonly Action<string> _processStringAction;
|
||||
private readonly IQueue<IQueueMessage> _queue;
|
||||
private readonly IBasicCommunication _coms;
|
||||
private readonly CommunicationGather _gather;
|
||||
|
||||
private StringResponseProcessor(string key, Action<string> processStringAction)
|
||||
{
|
||||
_processStringAction = processStringAction;
|
||||
_queue = new GenericQueue(key);
|
||||
|
||||
CrestronEnvironment.ProgramStatusEventHandler += programEvent =>
|
||||
{
|
||||
if (programEvent != eProgramStatusEventType.Stopping)
|
||||
return;
|
||||
|
||||
Dispose();
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Constructor that builds an instance and subscribes to coms TextReceived for processing
|
||||
/// </summary>
|
||||
/// <param name="coms">Com port to process strings from</param>
|
||||
/// <param name="processStringAction">Action to process the incoming strings</param>
|
||||
public StringResponseProcessor(IBasicCommunication coms, Action<string> processStringAction)
|
||||
: this(coms.Key, processStringAction)
|
||||
{
|
||||
_coms = coms;
|
||||
coms.TextReceived += OnResponseReceived;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Constructor that builds an instance and subscribes to gather Line Received for processing
|
||||
/// </summary>
|
||||
/// <param name="gather">Gather to process strings from</param>
|
||||
/// <param name="processStringAction">Action to process the incoming strings</param>
|
||||
public StringResponseProcessor(CommunicationGather gather, Action<string> processStringAction)
|
||||
: this(gather.Port.Key, processStringAction)
|
||||
{
|
||||
_gather = gather;
|
||||
gather.LineReceived += OnResponseReceived;
|
||||
}
|
||||
|
||||
private void OnResponseReceived(object sender, GenericCommMethodReceiveTextArgs args)
|
||||
{
|
||||
_queue.Enqueue(new ProcessStringMessage(args.Text, _processStringAction));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Key
|
||||
/// </summary>
|
||||
public string Key
|
||||
{
|
||||
get { return _queue.Key; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Disposes the instance and cleans up resources.
|
||||
/// </summary>
|
||||
public void Dispose()
|
||||
{
|
||||
Dispose(true);
|
||||
CrestronEnvironment.GC.SuppressFinalize(this);
|
||||
}
|
||||
|
||||
private void Dispose(bool disposing)
|
||||
{
|
||||
if (Disposed)
|
||||
return;
|
||||
|
||||
if (disposing)
|
||||
{
|
||||
if (_coms != null)
|
||||
_coms.TextReceived -= OnResponseReceived;
|
||||
|
||||
if (_gather != null)
|
||||
{
|
||||
_gather.LineReceived -= OnResponseReceived;
|
||||
_gather.Stop();
|
||||
}
|
||||
|
||||
_queue.Dispose();
|
||||
}
|
||||
|
||||
Disposed = true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// If the instance has been disposed or not. If it has, you can not use it anymore
|
||||
/// </summary>
|
||||
public bool Disposed { get; private set; }
|
||||
|
||||
~StringResponseProcessor()
|
||||
{
|
||||
Dispose(false);
|
||||
|
||||
@@ -83,7 +83,7 @@ namespace PepperDash.Essentials.Core
|
||||
}
|
||||
}
|
||||
|
||||
void _gateway_IsReadyEvent(object sender, PepperDash_Essentials_Core.IsReadyEventArgs e)
|
||||
void _gateway_IsReadyEvent(object sender, IsReadyEventArgs e)
|
||||
{
|
||||
if (e.IsReady != true) return;
|
||||
_remote = GetHr1x0WirelessRemote(_config);
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace PepperDash.Essentials.Core
|
||||
public string Key { get; private set; }
|
||||
|
||||
public BoolFeedback IsRunningFeedback { get; private set; }
|
||||
bool _IsRunning;
|
||||
bool _isRunning;
|
||||
|
||||
public IntFeedback PercentFeedback { get; private set; }
|
||||
public StringFeedback TimeRemainingFeedback { get; private set; }
|
||||
@@ -32,7 +32,7 @@ namespace PepperDash.Essentials.Core
|
||||
public DateTime StartTime { get; private set; }
|
||||
public DateTime FinishTime { get; private set; }
|
||||
|
||||
CTimer SecondTimer;
|
||||
private CTimer _secondTimer;
|
||||
|
||||
/// <summary>
|
||||
/// Constructor
|
||||
@@ -41,38 +41,34 @@ namespace PepperDash.Essentials.Core
|
||||
public SecondsCountdownTimer(string key)
|
||||
{
|
||||
Key = key;
|
||||
IsRunningFeedback = new BoolFeedback(() => _IsRunning);
|
||||
IsRunningFeedback = new BoolFeedback(() => _isRunning);
|
||||
|
||||
TimeRemainingFeedback = new StringFeedback(() =>
|
||||
{
|
||||
// Need to handle up and down here.
|
||||
|
||||
if (StartTime == null || FinishTime == null)
|
||||
return "";
|
||||
var timeSpan = FinishTime - DateTime.Now;
|
||||
|
||||
if (timeSpan.TotalSeconds < 60)
|
||||
Debug.Console(2, this,
|
||||
"timeSpan.Minutes == {0}, timeSpan.Seconds == {1}, timeSpan.TotalSeconds == {2}",
|
||||
timeSpan.Minutes, timeSpan.Seconds, timeSpan.TotalSeconds);
|
||||
|
||||
if (Math.Floor(timeSpan.TotalSeconds) < 60 && Math.Floor(timeSpan.TotalSeconds) >= 0) //ignore milliseconds
|
||||
{
|
||||
return Math.Round(timeSpan.TotalSeconds).ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Console(2, this, "timeSpan.Minutes == {0}, timeSpan.Seconds == {1}", timeSpan.Minutes, timeSpan.Seconds);
|
||||
return String.Format("{0:D2}:{1:D2}",
|
||||
timeSpan.Minutes,
|
||||
timeSpan.Seconds);
|
||||
return String.Format("{0:00}", timeSpan.Seconds);
|
||||
}
|
||||
|
||||
return Math.Floor(timeSpan.TotalSeconds) < 0
|
||||
? "00"
|
||||
: String.Format("{0:00}:{1:00}", timeSpan.Minutes, timeSpan.Seconds);
|
||||
});
|
||||
|
||||
PercentFeedback = new IntFeedback(() =>
|
||||
{
|
||||
if (StartTime == null || FinishTime == null)
|
||||
return 0;
|
||||
double percent = (FinishTime - DateTime.Now).TotalSeconds
|
||||
/ (FinishTime - StartTime).TotalSeconds
|
||||
* 100;
|
||||
return (int)percent;
|
||||
});
|
||||
PercentFeedback =
|
||||
new IntFeedback(
|
||||
() =>
|
||||
(int)
|
||||
(Math.Floor((FinishTime - DateTime.Now).TotalSeconds)/
|
||||
Math.Floor((FinishTime - StartTime).TotalSeconds)*100));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -80,15 +76,15 @@ namespace PepperDash.Essentials.Core
|
||||
/// </summary>
|
||||
public void Start()
|
||||
{
|
||||
if (_IsRunning)
|
||||
if (_isRunning)
|
||||
return;
|
||||
StartTime = DateTime.Now;
|
||||
FinishTime = StartTime + TimeSpan.FromSeconds(SecondsToCount);
|
||||
|
||||
if (SecondTimer != null)
|
||||
SecondTimer.Stop();
|
||||
SecondTimer = new CTimer(SecondElapsedTimerCallback, null, 0, 1000);
|
||||
_IsRunning = true;
|
||||
if (_secondTimer != null)
|
||||
_secondTimer.Stop();
|
||||
_secondTimer = new CTimer(SecondElapsedTimerCallback, null, 0, 1000);
|
||||
_isRunning = true;
|
||||
IsRunningFeedback.FireUpdate();
|
||||
|
||||
var handler = HasStarted;
|
||||
@@ -101,7 +97,7 @@ namespace PepperDash.Essentials.Core
|
||||
/// </summary>
|
||||
public void Reset()
|
||||
{
|
||||
_IsRunning = false;
|
||||
_isRunning = false;
|
||||
Start();
|
||||
}
|
||||
|
||||
@@ -131,19 +127,22 @@ namespace PepperDash.Essentials.Core
|
||||
|
||||
void StopHelper()
|
||||
{
|
||||
if (SecondTimer != null)
|
||||
SecondTimer.Stop();
|
||||
_IsRunning = false;
|
||||
if (_secondTimer != null)
|
||||
_secondTimer.Stop();
|
||||
_isRunning = false;
|
||||
IsRunningFeedback.FireUpdate();
|
||||
}
|
||||
|
||||
void SecondElapsedTimerCallback(object o)
|
||||
{
|
||||
if (DateTime.Now >= FinishTime)
|
||||
{
|
||||
Finish();
|
||||
return;
|
||||
}
|
||||
|
||||
PercentFeedback.FireUpdate();
|
||||
TimeRemainingFeedback.FireUpdate();
|
||||
|
||||
if (DateTime.Now >= FinishTime)
|
||||
Finish();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -47,7 +47,7 @@ namespace PepperDash.Essentials.Core.Utilities
|
||||
/// </summary>
|
||||
public void StartSequence()
|
||||
{
|
||||
if (_worker.ThreadState == Thread.eThreadStates.ThreadRunning)
|
||||
if (_worker !=null && _worker.ThreadState == Thread.eThreadStates.ThreadRunning)
|
||||
{
|
||||
Debug.Console(1, this, "Thread already running. Cannot Start Sequence");
|
||||
return;
|
||||
|
||||
@@ -23,6 +23,8 @@ namespace PepperDash.Essentials.DM {
|
||||
/// </summary>
|
||||
public class DmBladeChassisController : CrestronGenericBridgeableBaseDevice, IDmSwitch, IRoutingNumericWithFeedback
|
||||
{
|
||||
private const string NonePortKey = "inputCard0--None";
|
||||
|
||||
public DMChassisPropertiesConfig PropertiesConfig { get; set; }
|
||||
|
||||
public Switch Chassis { get; private set; }
|
||||
@@ -112,6 +114,10 @@ namespace PepperDash.Essentials.DM {
|
||||
controller.AddVolumeControl(outNum, audio);
|
||||
}
|
||||
|
||||
controller.InputPorts.Add(new RoutingInputPort(NonePortKey, eRoutingSignalType.Video,
|
||||
eRoutingPortConnectionType.None, null, controller));
|
||||
|
||||
|
||||
controller.InputNames = properties.InputNames;
|
||||
controller.OutputNames = properties.OutputNames;
|
||||
controller.PropertiesConfig = properties;
|
||||
@@ -367,34 +373,28 @@ namespace PepperDash.Essentials.DM {
|
||||
}
|
||||
|
||||
void AddHdmiOutBladePorts(uint number) {
|
||||
AddOutputPortWithDebug(String.Format("outputBlade{0}", (number / 8 > 0 ? 1 : number / 8)), String.Format("hdmiOut{0}", number) , eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, number);
|
||||
AddOutputPortWithDebug(String.Format("outputBlade{0}", (number / 8 > 0 ? 1 : number / 8)), String.Format("hdmiOut{0}", number) , eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, Chassis.Outputs[number]);
|
||||
}
|
||||
|
||||
void AddDmOutBladePorts(uint number) {
|
||||
AddOutputPortWithDebug(String.Format("outputBlade{0}", (number / 8 > 0 ? 1 : number / 8)), String.Format("dmOut{0}", number), eRoutingSignalType.Video, eRoutingPortConnectionType.DmCat, number);
|
||||
AddOutputPortWithDebug(String.Format("outputBlade{0}", (number / 8 > 0 ? 1 : number / 8)), String.Format("dmOut{0}", number), eRoutingSignalType.Video, eRoutingPortConnectionType.DmCat, Chassis.Outputs[number]);
|
||||
}
|
||||
|
||||
void AddDmOutMmFiberBladePorts(uint number) {
|
||||
AddOutputPortWithDebug(String.Format("outputBlade{0}", (number / 8 > 0 ? 1 : number / 8)), String.Format("dmOut{0}", number), eRoutingSignalType.Video, eRoutingPortConnectionType.DmMmFiber, number);
|
||||
AddOutputPortWithDebug(String.Format("outputBlade{0}", (number / 8 > 0 ? 1 : number / 8)), String.Format("dmOut{0}", number), eRoutingSignalType.Video, eRoutingPortConnectionType.DmMmFiber, Chassis.Outputs[number]);
|
||||
}
|
||||
|
||||
void AddDmOutSmFiberBladePorts(uint number) {
|
||||
AddOutputPortWithDebug(String.Format("outputBlade{0}", (number / 8 > 0 ? 1 : number / 8)), String.Format("dmOut{0}", number), eRoutingSignalType.Video, eRoutingPortConnectionType.DmSmFiber, number);
|
||||
AddOutputPortWithDebug(String.Format("outputBlade{0}", (number / 8 > 0 ? 1 : number / 8)), String.Format("dmOut{0}", number), eRoutingSignalType.Video, eRoutingPortConnectionType.DmSmFiber, Chassis.Outputs[number]);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Adds InputPort
|
||||
/// </summary>
|
||||
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)
|
||||
{
|
||||
FeedbackMatchObject = Chassis.Inputs[cardNum]
|
||||
};
|
||||
|
||||
InputPorts.Add(inputPort);
|
||||
void AddInputPortWithDebug(uint cardNum, string portName, eRoutingSignalType sigType, eRoutingPortConnectionType portType)
|
||||
{
|
||||
AddInputPortWithDebug(cardNum, portName, sigType, portType, null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -405,7 +405,7 @@ namespace PepperDash.Essentials.DM {
|
||||
{
|
||||
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)
|
||||
var inputPort = new RoutingInputPort(portKey, sigType, portType, Chassis.Inputs[cardNum], this)
|
||||
{
|
||||
FeedbackMatchObject = Chassis.Inputs[cardNum]
|
||||
};
|
||||
@@ -567,9 +567,7 @@ namespace PepperDash.Essentials.DM {
|
||||
void StartOffTimer(PortNumberType pnt) {
|
||||
if (RouteOffTimers.ContainsKey(pnt))
|
||||
return;
|
||||
RouteOffTimers[pnt] = new CTimer(o => {
|
||||
ExecuteSwitch(0, pnt.Number, pnt.Type);
|
||||
}, RouteOffTime);
|
||||
RouteOffTimers[pnt] = new CTimer(o => ExecuteSwitch(null, pnt.Selector, pnt.Type), RouteOffTime);
|
||||
}
|
||||
|
||||
|
||||
@@ -592,11 +590,22 @@ namespace PepperDash.Essentials.DM {
|
||||
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 input = inputSelector as DMInput; // Cast can sometimes fail
|
||||
var output = outputSelector as DMOutput;
|
||||
|
||||
|
||||
if (output == null)
|
||||
{
|
||||
Debug.Console(0, this, Debug.ErrorLogLevel.Warning,
|
||||
"Unable to execute switch for inputSelector {0} to outputSelector {1}", inputSelector,
|
||||
outputSelector);
|
||||
return;
|
||||
}
|
||||
|
||||
// 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) {
|
||||
|
||||
if (input == null) {
|
||||
StartOffTimer(key);
|
||||
}
|
||||
else {
|
||||
@@ -609,13 +618,13 @@ namespace PepperDash.Essentials.DM {
|
||||
|
||||
|
||||
|
||||
var inCard = input == 0 ? null : Chassis.Inputs[input];
|
||||
var outCard = input == 0 ? null : Chassis.Outputs[output];
|
||||
/*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) return;
|
||||
if ((sigType & eRoutingSignalType.Video) != eRoutingSignalType.Video) return;
|
||||
Chassis.VideoEnter.BoolValue = true;
|
||||
Chassis.Outputs[output].VideoOut = inCard;
|
||||
output.VideoOut = input;
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -624,7 +633,10 @@ namespace PepperDash.Essentials.DM {
|
||||
|
||||
public void ExecuteNumericSwitch(ushort inputSelector, ushort outputSelector, eRoutingSignalType sigType)
|
||||
{
|
||||
ExecuteSwitch(inputSelector, outputSelector, sigType);
|
||||
var input = inputSelector == 0 ? null : Chassis.Inputs[inputSelector];
|
||||
var output = Chassis.Outputs[outputSelector];
|
||||
|
||||
ExecuteSwitch(input, output, sigType);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -21,8 +21,9 @@ namespace PepperDash.Essentials.DM
|
||||
///
|
||||
/// </summary>
|
||||
[Description("Wrapper class for all DM-MD chassis variants from 8x8 to 32x32")]
|
||||
public class DmChassisController : CrestronGenericBridgeableBaseDevice, IDmSwitch, IRoutingNumericWithFeedback
|
||||
{
|
||||
public class DmChassisController : CrestronGenericBridgeableBaseDevice, IDmSwitch, IRoutingNumericWithFeedback
|
||||
{
|
||||
private const string NonePortKey = "inputCard0--None";
|
||||
public DMChassisPropertiesConfig PropertiesConfig { get; set; }
|
||||
|
||||
public Switch Chassis { get; private set; }
|
||||
@@ -133,6 +134,12 @@ namespace PepperDash.Essentials.DM
|
||||
|
||||
var controller = new DmChassisController(key, name, chassis);
|
||||
|
||||
//
|
||||
var clearInputPort = new RoutingInputPort(NonePortKey, eRoutingSignalType.AudioVideo,
|
||||
eRoutingPortConnectionType.None, null, controller);
|
||||
|
||||
controller.InputPorts.Add(clearInputPort);
|
||||
|
||||
// add the cards and port names
|
||||
foreach (var kvp in properties.InputSlots)
|
||||
controller.AddInputCard(kvp.Value, kvp.Key);
|
||||
@@ -485,169 +492,170 @@ namespace PepperDash.Essentials.DM
|
||||
|
||||
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);
|
||||
switch (type)
|
||||
{
|
||||
case "dmchd":
|
||||
{
|
||||
var inputCard = new DmcHd(number, this.Chassis);
|
||||
var cecPort = inputCard.HdmiInput as ICec;
|
||||
AddHdmiInCardPorts(number, cecPort);
|
||||
}
|
||||
break;
|
||||
case "dmchddsp":
|
||||
{
|
||||
var inputCard = new DmcHdDsp(number, this.Chassis);
|
||||
var cecPort = inputCard.HdmiInput as ICec;
|
||||
AddHdmiInCardPorts(number, cecPort);
|
||||
}
|
||||
break;
|
||||
case "dmc4khd":
|
||||
{
|
||||
var inputCard = new Dmc4kHd(number, this.Chassis);
|
||||
var cecPort = inputCard.HdmiInput as ICec;
|
||||
AddHdmiInCardPorts(number, cecPort);
|
||||
}
|
||||
break;
|
||||
case "dmc4khddsp":
|
||||
{
|
||||
var inputCard = new Dmc4kHdDsp(number, this.Chassis);
|
||||
var cecPort = inputCard.HdmiInput as ICec;
|
||||
AddHdmiInCardPorts(number, cecPort);
|
||||
}
|
||||
break;
|
||||
case "dmc4kzhd":
|
||||
{
|
||||
var inputCard = new Dmc4kzHd(number, this.Chassis);
|
||||
var cecPort = inputCard.HdmiInput as ICec;
|
||||
AddHdmiInCardPorts(number, cecPort);
|
||||
}
|
||||
break;
|
||||
case "dmc4kzhddsp":
|
||||
{
|
||||
var inputCard = new Dmc4kzHdDsp(number, this.Chassis);
|
||||
var cecPort = inputCard.HdmiInput as ICec;
|
||||
AddHdmiInCardPorts(number, cecPort);
|
||||
}
|
||||
break;
|
||||
case "dmcc":
|
||||
{
|
||||
var inputCard = new DmcC(number, this.Chassis);
|
||||
var cecPort = inputCard.DmInput as ICec;
|
||||
AddDmInCardPorts(number, cecPort);
|
||||
}
|
||||
break;
|
||||
case "dmccdsp":
|
||||
{
|
||||
var inputCard = new DmcCDsp(number, this.Chassis);
|
||||
var cecPort = inputCard.DmInput as ICec;
|
||||
AddDmInCardPorts(number, cecPort);
|
||||
}
|
||||
break;
|
||||
case "dmc4kc":
|
||||
{
|
||||
var inputCard = new Dmc4kC(number, this.Chassis);
|
||||
var cecPort = inputCard.DmInput as ICec;
|
||||
AddDmInCardPorts(number, cecPort);
|
||||
}
|
||||
break;
|
||||
case "dmc4kcdsp":
|
||||
{
|
||||
var inputCard = new Dmc4kCDsp(number, this.Chassis);
|
||||
var cecPort = inputCard.DmInput as ICec;
|
||||
AddDmInCardPorts(number, cecPort);
|
||||
}
|
||||
break;
|
||||
case "dmc4kzc":
|
||||
{
|
||||
var inputCard = new Dmc4kzC(number, this.Chassis);
|
||||
var cecPort = inputCard.DmInput as ICec;
|
||||
AddDmInCardPorts(number, cecPort);
|
||||
}
|
||||
break;
|
||||
case "dmc4kzcdsp":
|
||||
{
|
||||
var inputCard = new Dmc4kzCDsp(number, this.Chassis);
|
||||
var cecPort = inputCard.DmInput as ICec;
|
||||
AddDmInCardPorts(number, cecPort);
|
||||
}
|
||||
break;
|
||||
case "dmccat":
|
||||
new DmcCat(number, this.Chassis);
|
||||
AddDmInCardPorts(number);
|
||||
break;
|
||||
case "dmccatdsp":
|
||||
new DmcCatDsp(number, this.Chassis);
|
||||
AddDmInCardPorts(number);
|
||||
break;
|
||||
case "dmcs":
|
||||
new DmcS(number, Chassis);
|
||||
AddInputPortWithDebug(number, "dmIn", eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.DmMmFiber);
|
||||
AddInCardHdmiAndAudioLoopPorts(number);
|
||||
break;
|
||||
case "dmcsdsp":
|
||||
new DmcSDsp(number, Chassis);
|
||||
AddInputPortWithDebug(number, "dmIn", eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.DmMmFiber);
|
||||
AddInCardHdmiAndAudioLoopPorts(number);
|
||||
break;
|
||||
case "dmcs2":
|
||||
new DmcS2(number, Chassis);
|
||||
AddInputPortWithDebug(number, "dmIn", eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.DmSmFiber);
|
||||
AddInCardHdmiAndAudioLoopPorts(number);
|
||||
break;
|
||||
case "dmcs2dsp":
|
||||
new DmcS2Dsp(number, Chassis);
|
||||
AddInputPortWithDebug(number, "dmIn", eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.DmSmFiber);
|
||||
AddInCardHdmiAndAudioLoopPorts(number);
|
||||
break;
|
||||
case "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);
|
||||
break;
|
||||
case "dmcdvi":
|
||||
new DmcDvi(number, Chassis);
|
||||
AddInputPortWithDebug(number, "dviIn", eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Dvi);
|
||||
AddInputPortWithDebug(number, "audioIn", eRoutingSignalType.Audio, eRoutingPortConnectionType.LineAudio);
|
||||
AddInCardHdmiLoopPort(number);
|
||||
break;
|
||||
case "dmcvga":
|
||||
new DmcVga(number, Chassis);
|
||||
AddInputPortWithDebug(number, "vgaIn", eRoutingSignalType.Video, eRoutingPortConnectionType.Vga);
|
||||
AddInputPortWithDebug(number, "audioIn", eRoutingSignalType.Audio, eRoutingPortConnectionType.LineAudio);
|
||||
AddInCardHdmiLoopPort(number);
|
||||
break;
|
||||
case "dmcvidbnc":
|
||||
new DmcVidBnc(number, Chassis);
|
||||
AddInputPortWithDebug(number, "componentIn", eRoutingSignalType.Video, eRoutingPortConnectionType.Component);
|
||||
AddInputPortWithDebug(number, "audioIn", eRoutingSignalType.Audio, eRoutingPortConnectionType.LineAudio);
|
||||
AddInCardHdmiLoopPort(number);
|
||||
break;
|
||||
case "dmcvidrcaa":
|
||||
new DmcVidRcaA(number, Chassis);
|
||||
AddInputPortWithDebug(number, "componentIn", eRoutingSignalType.Video, eRoutingPortConnectionType.Component);
|
||||
AddInputPortWithDebug(number, "audioIn", eRoutingSignalType.Audio, eRoutingPortConnectionType.LineAudio);
|
||||
AddInCardHdmiLoopPort(number);
|
||||
break;
|
||||
case "dmcvidrcad":
|
||||
new DmcVidRcaD(number, Chassis);
|
||||
AddInputPortWithDebug(number, "componentIn", eRoutingSignalType.Video, eRoutingPortConnectionType.Component);
|
||||
AddInputPortWithDebug(number, "audioIn", eRoutingSignalType.Audio, eRoutingPortConnectionType.DigitalAudio);
|
||||
AddInCardHdmiLoopPort(number);
|
||||
break;
|
||||
case "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);
|
||||
break;
|
||||
case "dmcstr":
|
||||
new DmcStr(number, Chassis);
|
||||
AddInputPortWithDebug(number, "streamIn", eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Streaming);
|
||||
AddInCardHdmiAndAudioLoopPorts(number);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -692,119 +700,122 @@ namespace PepperDash.Essentials.DM
|
||||
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);
|
||||
switch (type)
|
||||
{
|
||||
case "dmc4khdo":
|
||||
{
|
||||
var outputCard = new Dmc4kHdoSingle(number, Chassis);
|
||||
var cecPort1 = outputCard.Card1.HdmiOutput;
|
||||
var cecPort2 = outputCard.Card2.HdmiOutput;
|
||||
AddDmcHdoPorts(number, cecPort1, cecPort2);
|
||||
}
|
||||
break;
|
||||
case "dmc4kzhdo":
|
||||
{
|
||||
var outputCard = new Dmc4kzHdoSingle(number, Chassis);
|
||||
var cecPort1 = outputCard.Card1.HdmiOutput;
|
||||
var cecPort2 = outputCard.Card2.HdmiOutput;
|
||||
AddDmcHdoPorts(number, cecPort1, cecPort2);
|
||||
}
|
||||
break;
|
||||
case "dmchdo":
|
||||
{
|
||||
var outputCard = new DmcHdoSingle(number, Chassis);
|
||||
var cecPort1 = outputCard.Card1.HdmiOutput;
|
||||
var cecPort2 = outputCard.Card2.HdmiOutput;
|
||||
AddDmcHdoPorts(number, cecPort1, cecPort2);
|
||||
}
|
||||
break;
|
||||
case "dmc4kcohd":
|
||||
{
|
||||
var outputCard = new Dmc4kCoHdSingle(number, Chassis);
|
||||
var cecPort1 = outputCard.Card1.HdmiOutput;
|
||||
AddDmcCoPorts(number, cecPort1);
|
||||
}
|
||||
break;
|
||||
case "dmc4kzcohd":
|
||||
{
|
||||
var outputCard = new Dmc4kzCoHdSingle(number, Chassis);
|
||||
var cecPort1 = outputCard.Card1.HdmiOutput;
|
||||
AddDmcCoPorts(number, cecPort1);
|
||||
}
|
||||
break;
|
||||
case "dmccohd":
|
||||
{
|
||||
var outputCard = new DmcCoHdSingle(number, Chassis);
|
||||
var cecPort1 = outputCard.Card1.HdmiOutput;
|
||||
AddDmcCoPorts(number, cecPort1);
|
||||
}
|
||||
break;
|
||||
case "dmccatohd":
|
||||
{
|
||||
var outputCard = new DmcCatoHdSingle(number, Chassis);
|
||||
var cecPort1 = outputCard.Card1.HdmiOutput;
|
||||
AddDmcCoPorts(number, cecPort1);
|
||||
}
|
||||
break;
|
||||
case "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, Chassis.Outputs[2 * (number - 1) + 1]);
|
||||
AddOutputPortWithDebug(string.Format("outputCard{0}", number), "hdmiOut1", eRoutingSignalType.Audio | eRoutingSignalType.Video,
|
||||
eRoutingPortConnectionType.Hdmi, Chassis.Outputs[2 * (number - 1) + 1], cecPort1);
|
||||
AddOutputPortWithDebug(string.Format("outputCard{0}", number), "dmOut2", eRoutingSignalType.Audio | eRoutingSignalType.Video,
|
||||
eRoutingPortConnectionType.DmMmFiber, Chassis.Outputs[2 * (number - 1) + 2]);
|
||||
}
|
||||
break;
|
||||
case "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, Chassis.Outputs[2 * (number - 1) + 1]);
|
||||
AddOutputPortWithDebug(string.Format("outputCard{0}", number), "hdmiOut1", eRoutingSignalType.Audio | eRoutingSignalType.Video,
|
||||
eRoutingPortConnectionType.Hdmi, Chassis.Outputs[2 * (number - 1) + 1], cecPort1);
|
||||
AddOutputPortWithDebug(string.Format("outputCard{0}", number), "dmOut2", eRoutingSignalType.Audio | eRoutingSignalType.Video,
|
||||
eRoutingPortConnectionType.DmSmFiber, Chassis.Outputs[2 * (number - 1) + 2]);
|
||||
}
|
||||
break;
|
||||
case "dmcstro":
|
||||
AddOutputPortWithDebug(string.Format("outputCard{0}", number), "streamOut", eRoutingSignalType.Audio | eRoutingSignalType.Video,
|
||||
eRoutingPortConnectionType.Streaming, Chassis.Outputs[2 * (number - 1) + 1]);
|
||||
break;
|
||||
default:
|
||||
Debug.Console(1, this, " WARNING: Output card type '{0}' is not available", type);
|
||||
break;
|
||||
}
|
||||
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);
|
||||
eRoutingPortConnectionType.Hdmi, Chassis.Outputs[2 * (number - 1) + 1], cecPort1);
|
||||
AddOutputPortWithDebug(string.Format("outputCard{0}", number), "audioOut1", eRoutingSignalType.Audio, eRoutingPortConnectionType.LineAudio,
|
||||
2 * (number - 1) + 1);
|
||||
Chassis.Outputs[2 * (number - 1) + 1]);
|
||||
AddOutputPortWithDebug(string.Format("outputCard{0}", number), "hdmiOut2", eRoutingSignalType.Audio | eRoutingSignalType.Video,
|
||||
eRoutingPortConnectionType.Hdmi, 2 * (number - 1) + 2, cecPort2);
|
||||
eRoutingPortConnectionType.Hdmi, Chassis.Outputs[2 * (number - 1) + 2], cecPort2);
|
||||
AddOutputPortWithDebug(string.Format("outputCard{0}", number), "audioOut2", eRoutingSignalType.Audio, eRoutingPortConnectionType.LineAudio,
|
||||
2 * (number - 1) + 2);
|
||||
Chassis.Outputs[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);
|
||||
eRoutingPortConnectionType.DmCat, Chassis.Outputs[2 * (number - 1) + 1]);
|
||||
AddOutputPortWithDebug(string.Format("outputCard{0}", number), "hdmiOut1", eRoutingSignalType.Audio | eRoutingSignalType.Video,
|
||||
eRoutingPortConnectionType.Hdmi, 2 * (number - 1) + 1, cecPort1);
|
||||
eRoutingPortConnectionType.Hdmi, Chassis.Outputs[2 * (number - 1) + 1], cecPort1);
|
||||
AddOutputPortWithDebug(string.Format("outputCard{0}", number), "dmOut2", eRoutingSignalType.Audio | eRoutingSignalType.Video,
|
||||
eRoutingPortConnectionType.DmCat, 2 * (number - 1) + 2);
|
||||
eRoutingPortConnectionType.DmCat, Chassis.Outputs[2 * (number - 1) + 2]);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds InputPort
|
||||
/// </summary>
|
||||
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)
|
||||
{
|
||||
FeedbackMatchObject = Chassis.Inputs[cardNum]
|
||||
};
|
||||
|
||||
InputPorts.Add(inputPort);
|
||||
void AddInputPortWithDebug(uint cardNum, string portName, eRoutingSignalType sigType, eRoutingPortConnectionType portType)
|
||||
{
|
||||
AddInputPortWithDebug(cardNum, portName, sigType, portType, null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -814,7 +825,7 @@ namespace PepperDash.Essentials.DM
|
||||
{
|
||||
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)
|
||||
var inputPort = new RoutingInputPort(portKey, sigType, portType, Chassis.Inputs[cardNum], this)
|
||||
{
|
||||
FeedbackMatchObject = Chassis.Inputs[cardNum]
|
||||
}; ;
|
||||
@@ -828,19 +839,9 @@ namespace PepperDash.Essentials.DM
|
||||
/// <summary>
|
||||
/// Adds OutputPort
|
||||
/// </summary>
|
||||
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);
|
||||
|
||||
var outputPort = new RoutingOutputPort(portKey, sigType, portType, selector, this);
|
||||
|
||||
if (portName.IndexOf("Loop", StringComparison.InvariantCultureIgnoreCase) < 0)
|
||||
{
|
||||
outputPort.FeedbackMatchObject = Chassis.Outputs[(uint) selector];
|
||||
}
|
||||
|
||||
OutputPorts.Add(outputPort);
|
||||
void AddOutputPortWithDebug(string cardName, string portName, eRoutingSignalType sigType, eRoutingPortConnectionType portType, object selector)
|
||||
{
|
||||
AddOutputPortWithDebug(cardName, portName, sigType, portType, selector, null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -854,7 +855,7 @@ namespace PepperDash.Essentials.DM
|
||||
|
||||
if (portName.IndexOf("Loop", StringComparison.InvariantCultureIgnoreCase) < 0)
|
||||
{
|
||||
outputPort.FeedbackMatchObject = Chassis.Outputs[(uint)selector];
|
||||
outputPort.FeedbackMatchObject = selector;
|
||||
}
|
||||
if (cecPort != null)
|
||||
outputPort.Port = cecPort;
|
||||
@@ -1144,7 +1145,7 @@ namespace PepperDash.Essentials.DM
|
||||
{
|
||||
if (RouteOffTimers.ContainsKey(pnt))
|
||||
return;
|
||||
RouteOffTimers[pnt] = new CTimer(o => { ExecuteSwitch(0, pnt.Number, pnt.Type); }, RouteOffTime);
|
||||
RouteOffTimers[pnt] = new CTimer(o => ExecuteSwitch(null, pnt.Selector, pnt.Type), RouteOffTime);
|
||||
}
|
||||
|
||||
// Send out sigs when coming online
|
||||
@@ -1171,18 +1172,24 @@ namespace PepperDash.Essentials.DM
|
||||
#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
|
||||
Debug.Console(2, this, "Making an awesome DM route from {0} to {1} {2}", inputSelector, outputSelector, sigType);
|
||||
|
||||
var input = inputSelector as DMInput;//Input Selector could be null...
|
||||
|
||||
var output = outputSelector as DMOutput;
|
||||
|
||||
if (output == null)
|
||||
{
|
||||
Debug.Console(0, this, Debug.ErrorLogLevel.Warning,
|
||||
"Unable to execute switch for inputSelector {0} to outputSelector {1}", inputSelector,
|
||||
outputSelector);
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
// 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)
|
||||
if (input == null)
|
||||
{
|
||||
StartOffTimer(key);
|
||||
}
|
||||
@@ -1196,110 +1203,109 @@ namespace PepperDash.Essentials.DM
|
||||
}
|
||||
}
|
||||
|
||||
var inCard = input == 0 ? null : Chassis.Inputs[input];
|
||||
var outCard = input == 0 ? null : Chassis.Outputs[output];
|
||||
//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;
|
||||
Chassis.VideoEnter.BoolValue = true;
|
||||
output.VideoOut = input; //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.Audio) == eRoutingSignalType.Audio)
|
||||
{
|
||||
var dmMdMnxn = Chassis as DmMDMnxn;
|
||||
if (dmMdMnxn != null)
|
||||
{
|
||||
dmMdMnxn.AudioEnter.BoolValue = true;
|
||||
}
|
||||
output.VideoOut = input;
|
||||
//Chassis.Outputs[output].AudioOut = inCard;
|
||||
}
|
||||
|
||||
if ((sigType & eRoutingSignalType.UsbOutput) == eRoutingSignalType.UsbOutput || (sigType & eRoutingSignalType.UsbInput) == eRoutingSignalType.UsbInput)
|
||||
{
|
||||
Chassis.USBEnter.BoolValue = true;
|
||||
output.USBRoutedTo = input;
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
#region IRoutingNumeric Members
|
||||
|
||||
public void ExecuteNumericSwitch(ushort inputSelector, ushort outputSelector, eRoutingSignalType sigType)
|
||||
{
|
||||
ExecuteSwitch(inputSelector, outputSelector, sigType);
|
||||
public void ExecuteNumericSwitch(ushort inputSelector, ushort outputSelector, eRoutingSignalType sigType)
|
||||
{
|
||||
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
|
||||
|
||||
DMInputOutputBase dmCard;
|
||||
|
||||
if ((sigType & eRoutingSignalType.UsbInput) == eRoutingSignalType.UsbInput)
|
||||
{
|
||||
if (outputSelector > chassisSize)
|
||||
{
|
||||
uint outputIndex;
|
||||
|
||||
if (chassisSize == 8)
|
||||
{
|
||||
outputIndex = (uint) inputSelector - 16;
|
||||
}
|
||||
else
|
||||
{
|
||||
outputIndex = inputSelector - chassisSize;
|
||||
}
|
||||
dmCard = Chassis.Outputs[outputIndex];
|
||||
}
|
||||
else
|
||||
{
|
||||
dmCard = Chassis.Inputs[inputSelector];
|
||||
}
|
||||
|
||||
ExecuteSwitch(dmCard, Chassis.Outputs[outputSelector], sigType);
|
||||
return;
|
||||
}
|
||||
if ((sigType & eRoutingSignalType.UsbOutput) == eRoutingSignalType.UsbOutput)
|
||||
{
|
||||
Debug.Console(2, this, "Executing USB Output switch.\r\n in:{0} output: {1}", inputSelector, outputSelector);
|
||||
|
||||
if (inputSelector > 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 = (uint) inputSelector - 16;
|
||||
}
|
||||
else
|
||||
{
|
||||
outputIndex = inputSelector - chassisSize;
|
||||
}
|
||||
|
||||
dmCard = Chassis.Outputs[outputIndex];
|
||||
}
|
||||
else
|
||||
{
|
||||
dmCard = Chassis.Inputs[inputSelector];
|
||||
}
|
||||
Chassis.USBEnter.BoolValue = true;
|
||||
|
||||
Debug.Console(2, this, "Routing USB for input {0} to {1}", inputSelector, dmCard);
|
||||
ExecuteSwitch(dmCard, Chassis.Outputs[outputSelector], sigType);
|
||||
return;
|
||||
}
|
||||
|
||||
var inputCard = inputSelector == 0 ? null : Chassis.Inputs[inputSelector];
|
||||
var outputCard = Chassis.Outputs[outputSelector];
|
||||
|
||||
ExecuteSwitch(inputCard, outputCard, sigType);
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -1850,13 +1856,23 @@ namespace PepperDash.Essentials.DM
|
||||
public struct PortNumberType
|
||||
{
|
||||
public uint Number { get; private set; }
|
||||
public object Selector { get; private set; }
|
||||
public eRoutingSignalType Type { get; private set; }
|
||||
|
||||
public PortNumberType(uint number, eRoutingSignalType type)
|
||||
public PortNumberType(object selector, eRoutingSignalType type)
|
||||
: this()
|
||||
{
|
||||
Number = number;
|
||||
Type = type;
|
||||
Selector = selector;
|
||||
Type = type;
|
||||
|
||||
if (Selector is DMOutput)
|
||||
{
|
||||
Number = (selector as DMOutput).Number;
|
||||
}
|
||||
else if (Selector is uint)
|
||||
{
|
||||
Number = (uint) selector;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,6 +21,8 @@ namespace PepperDash.Essentials.DM
|
||||
{
|
||||
public class DmpsRoutingController : EssentialsBridgeableDevice, IRoutingNumericWithFeedback, IHasFeedback
|
||||
{
|
||||
private const string NonePortKey = "none";
|
||||
|
||||
public CrestronControlSystem Dmps { get; set; }
|
||||
public ISystemControl SystemControl { get; private set; }
|
||||
|
||||
@@ -75,20 +77,18 @@ namespace PepperDash.Essentials.DM
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
ISystemControl systemControl = null;
|
||||
|
||||
systemControl = Global.ControlSystem.SystemControl as ISystemControl;
|
||||
var systemControl = Global.ControlSystem.SystemControl;
|
||||
|
||||
if (systemControl == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
var controller = new DmpsRoutingController(key, name, systemControl);
|
||||
|
||||
controller.InputNames = properties.InputNames;
|
||||
controller.OutputNames = properties.OutputNames;
|
||||
var controller = new DmpsRoutingController(key, name, systemControl)
|
||||
{
|
||||
InputNames = properties.InputNames,
|
||||
OutputNames = properties.OutputNames
|
||||
};
|
||||
|
||||
if (!string.IsNullOrEmpty(properties.NoRouteText))
|
||||
controller.NoRouteText = properties.NoRouteText;
|
||||
@@ -96,9 +96,9 @@ namespace PepperDash.Essentials.DM
|
||||
return controller;
|
||||
|
||||
}
|
||||
catch (System.Exception e)
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.Console(0, "Error getting DMPS Controller:\r{0}", e);
|
||||
Debug.Console(0, "Error getting DMPS Controller:\r\n{0}", e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -113,6 +113,7 @@ namespace PepperDash.Essentials.DM
|
||||
public DmpsRoutingController(string key, string name, ISystemControl systemControl)
|
||||
: base(key, name)
|
||||
{
|
||||
|
||||
Dmps = Global.ControlSystem;
|
||||
SystemControl = systemControl;
|
||||
|
||||
@@ -427,14 +428,11 @@ namespace PepperDash.Essentials.DM
|
||||
{
|
||||
Debug.Console(1, this, "Adding Input Card Number {0} Type: {1}", inputCard.Number, inputCard.CardInputOutputType.ToString());
|
||||
|
||||
InputEndpointOnlineFeedbacks[inputCard.Number] = new BoolFeedback(() => { return inputCard.EndpointOnlineFeedback; });
|
||||
InputEndpointOnlineFeedbacks[inputCard.Number] = new BoolFeedback(() => inputCard.EndpointOnlineFeedback);
|
||||
|
||||
if (inputCard.VideoDetectedFeedback != null)
|
||||
{
|
||||
VideoInputSyncFeedbacks[inputCard.Number] = new BoolFeedback(() =>
|
||||
{
|
||||
return inputCard.VideoDetectedFeedback.BoolValue;
|
||||
});
|
||||
VideoInputSyncFeedbacks[inputCard.Number] = new BoolFeedback(() => inputCard.VideoDetectedFeedback.BoolValue);
|
||||
}
|
||||
|
||||
InputNameFeedbacks[inputCard.Number] = new StringFeedback(() =>
|
||||
@@ -443,13 +441,10 @@ namespace PepperDash.Essentials.DM
|
||||
{
|
||||
Debug.Console(2, this, "Input Card {0} Name: {1}", inputCard.Number, inputCard.NameFeedback.StringValue);
|
||||
return inputCard.NameFeedback.StringValue;
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Console(2, this, "Input Card {0} Name is null", inputCard.Number);
|
||||
return "";
|
||||
}
|
||||
Debug.Console(2, this, "Input Card {0} Name is null", inputCard.Number);
|
||||
return "";
|
||||
});
|
||||
|
||||
AddInputCard(inputCard.Number, inputCard);
|
||||
@@ -459,6 +454,9 @@ namespace PepperDash.Essentials.DM
|
||||
Debug.Console(2, this, "***********Input Card of type {0} is cannot be cast as DMInput*************", card.CardInputOutputType);
|
||||
}
|
||||
}
|
||||
|
||||
InputPorts.Add(new RoutingInputPort(NonePortKey, eRoutingSignalType.AudioVideo,
|
||||
eRoutingPortConnectionType.None, null, this));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -531,15 +529,7 @@ namespace PepperDash.Essentials.DM
|
||||
private 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)
|
||||
{
|
||||
FeedbackMatchObject = Dmps.SwitcherInputs[cardNum]
|
||||
};
|
||||
;
|
||||
|
||||
InputPorts.Add(inputPort);
|
||||
AddInputPortWithDebug(cardNum, portName, sigType, portType, null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -549,11 +539,10 @@ namespace PepperDash.Essentials.DM
|
||||
{
|
||||
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)
|
||||
var inputPort = new RoutingInputPort(portKey, sigType, portType, Dmps.SwitcherInputs[cardNum], this)
|
||||
{
|
||||
FeedbackMatchObject = Dmps.SwitcherInputs[cardNum]
|
||||
};
|
||||
;
|
||||
|
||||
if (cecPort != null)
|
||||
inputPort.Port = cecPort;
|
||||
@@ -672,7 +661,7 @@ namespace PepperDash.Essentials.DM
|
||||
/// <param name="number"></param>
|
||||
void AddAudioOnlyOutputPort(uint number, string portName)
|
||||
{
|
||||
AddOutputPortWithDebug(number, portName, eRoutingSignalType.Audio, eRoutingPortConnectionType.LineAudio, number);
|
||||
AddOutputPortWithDebug(number, portName, eRoutingSignalType.Audio, eRoutingPortConnectionType.LineAudio, Dmps.SwitcherOutputs[number]);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -682,7 +671,7 @@ namespace PepperDash.Essentials.DM
|
||||
/// <param name="cecPort"></param>
|
||||
void AddHdmiOutputPort(uint number, ICec cecPort)
|
||||
{
|
||||
AddOutputPortWithDebug(number, string.Format("hdmiOut{0}", number), eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, number, cecPort);
|
||||
AddOutputPortWithDebug(number, string.Format("hdmiOut{0}", number), eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, Dmps.SwitcherOutputs[number], cecPort);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -691,7 +680,7 @@ namespace PepperDash.Essentials.DM
|
||||
/// <param name="number"></param>
|
||||
void AddDmOutputPort(uint number)
|
||||
{
|
||||
AddOutputPortWithDebug(number, string.Format("dmOut{0}", number), eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.DmCat, number);
|
||||
AddOutputPortWithDebug(number, string.Format("dmOut{0}", number), eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.DmCat, Dmps.SwitcherOutputs[number]);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -699,12 +688,7 @@ namespace PepperDash.Essentials.DM
|
||||
/// </summary>
|
||||
void AddOutputPortWithDebug(uint cardNum, string portName, eRoutingSignalType sigType, eRoutingPortConnectionType portType, object selector)
|
||||
{
|
||||
var portKey = string.Format("outputCard{0}--{1}", cardNum, portName);
|
||||
Debug.Console(2, this, "Adding output port '{0}'", portKey);
|
||||
OutputPorts.Add(new RoutingOutputPort(portKey, sigType, portType, selector, this)
|
||||
{
|
||||
FeedbackMatchObject = Dmps.SwitcherOutputs[cardNum]
|
||||
});
|
||||
AddOutputPortWithDebug(cardNum, portName, sigType, portType, selector, null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -836,7 +820,7 @@ namespace PepperDash.Essentials.DM
|
||||
{
|
||||
if (RouteOffTimers.ContainsKey(pnt))
|
||||
return;
|
||||
RouteOffTimers[pnt] = new CTimer(o => ExecuteSwitch(0, pnt.Number, pnt.Type), RouteOffTime);
|
||||
RouteOffTimers[pnt] = new CTimer(o => ExecuteSwitch(null, pnt.Selector, pnt.Type), RouteOffTime);
|
||||
}
|
||||
|
||||
#region IRouting Members
|
||||
@@ -848,21 +832,32 @@ namespace PepperDash.Essentials.DM
|
||||
|
||||
Debug.Console(2, this, "Attempting a DM route from input {0} to output {1} {2}", inputSelector, outputSelector, sigType);
|
||||
|
||||
var input = Convert.ToUInt32(inputSelector); // Cast can sometimes fail
|
||||
var output = Convert.ToUInt32(outputSelector);
|
||||
//var input = Convert.ToUInt32(inputSelector); // Cast can sometimes fail
|
||||
//var output = Convert.ToUInt32(outputSelector);
|
||||
|
||||
var input = inputSelector as DMInput;
|
||||
var output = outputSelector as DMOutput;
|
||||
|
||||
if (output == null)
|
||||
{
|
||||
Debug.Console(0, this, Debug.ErrorLogLevel.Warning,
|
||||
"Unable to execute switch for inputSelector {0} to outputSelector {1}", inputSelector,
|
||||
outputSelector);
|
||||
return;
|
||||
}
|
||||
|
||||
var sigTypeIsUsbOrVideo = ((sigType & eRoutingSignalType.Video) == eRoutingSignalType.Video) ||
|
||||
((sigType & eRoutingSignalType.UsbInput) == eRoutingSignalType.UsbInput) ||
|
||||
((sigType & eRoutingSignalType.UsbOutput) == eRoutingSignalType.UsbOutput);
|
||||
|
||||
if ((input <= Dmps.NumberOfSwitcherInputs && output <= Dmps.NumberOfSwitcherOutputs &&
|
||||
if (input == null || (input.Number <= Dmps.NumberOfSwitcherInputs && output.Number <= Dmps.NumberOfSwitcherOutputs &&
|
||||
sigTypeIsUsbOrVideo) ||
|
||||
(input <= Dmps.NumberOfSwitcherInputs + 5 && output <= Dmps.NumberOfSwitcherOutputs &&
|
||||
(input.Number <= Dmps.NumberOfSwitcherInputs + 5 && output.Number <= Dmps.NumberOfSwitcherOutputs &&
|
||||
(sigType & eRoutingSignalType.Audio) == eRoutingSignalType.Audio))
|
||||
{
|
||||
// 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)
|
||||
if (input == null)
|
||||
{
|
||||
StartOffTimer(key);
|
||||
}
|
||||
@@ -877,60 +872,47 @@ namespace PepperDash.Essentials.DM
|
||||
}
|
||||
|
||||
|
||||
DMOutput dmOutputCard = output == 0 ? null : Dmps.SwitcherOutputs[output] as DMOutput;
|
||||
//DMOutput dmOutputCard = output == 0 ? null : Dmps.SwitcherOutputs[output] as DMOutput;
|
||||
|
||||
//if (inCard != null)
|
||||
//{
|
||||
// NOTE THAT BITWISE COMPARISONS - TO CATCH ALL ROUTING TYPES
|
||||
if ((sigType & eRoutingSignalType.Video) == eRoutingSignalType.Video)
|
||||
{
|
||||
DMInput dmInputCard = input == 0 ? null : Dmps.SwitcherInputs[input] as DMInput;
|
||||
//SystemControl.VideoEnter.BoolValue = true;
|
||||
if (dmOutputCard != null)
|
||||
dmOutputCard.VideoOut = dmInputCard;
|
||||
|
||||
output.VideoOut = input;
|
||||
}
|
||||
|
||||
if ((sigType & eRoutingSignalType.Audio) == eRoutingSignalType.Audio)
|
||||
{
|
||||
DMInput dmInputCard = null;
|
||||
if (input <= Dmps.NumberOfSwitcherInputs)
|
||||
try
|
||||
{
|
||||
dmInputCard = input == 0 ? null : Dmps.SwitcherInputs[input] as DMInput;
|
||||
output.AudioOut = input;
|
||||
}
|
||||
catch (NotSupportedException)
|
||||
{
|
||||
Debug.Console(1, this, "Routing input {0} audio to output {1}",
|
||||
(eDmps34KAudioOutSource) (input == null ? 0 : input.Number),
|
||||
(CrestronControlSystem.eDmps34K350COutputs) output.Number);
|
||||
|
||||
if (dmOutputCard != null)
|
||||
try
|
||||
{
|
||||
dmOutputCard.AudioOut = dmInputCard;
|
||||
}
|
||||
catch (NotSupportedException)
|
||||
{
|
||||
Debug.Console(1, this, "Routing input {0} audio to output {1}",
|
||||
(eDmps34KAudioOutSource) input, (CrestronControlSystem.eDmps34K350COutputs) output);
|
||||
|
||||
dmOutputCard.AudioOutSource = (eDmps34KAudioOutSource) input;
|
||||
}
|
||||
output.AudioOutSource = input == null
|
||||
? eDmps34KAudioOutSource.NoRoute
|
||||
: (eDmps34KAudioOutSource)input.Number;
|
||||
}
|
||||
}
|
||||
|
||||
if ((sigType & eRoutingSignalType.UsbOutput) == eRoutingSignalType.UsbOutput)
|
||||
{
|
||||
DMInput dmInputCard = input == 0 ? null : Dmps.SwitcherInputs[input] as DMInput;
|
||||
if (dmOutputCard != null)
|
||||
dmOutputCard.USBRoutedTo = dmInputCard;
|
||||
|
||||
output.USBRoutedTo = input;
|
||||
}
|
||||
|
||||
if ((sigType & eRoutingSignalType.UsbInput) == eRoutingSignalType.UsbInput)
|
||||
if ((sigType & eRoutingSignalType.UsbInput) != eRoutingSignalType.UsbInput)
|
||||
{
|
||||
DMInput dmInputCard = input == 0 ? null : Dmps.SwitcherInputs[input] as DMInput;
|
||||
if (dmInputCard != null)
|
||||
dmInputCard.USBRoutedTo = dmOutputCard;
|
||||
return;
|
||||
}
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// Debug.Console(1, this, "Unable to execute route from input {0} to output {1}. Input card not available", inputSelector, outputSelector);
|
||||
//}
|
||||
|
||||
if (input != null)
|
||||
input.USBRoutedTo = output;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -950,7 +932,10 @@ namespace PepperDash.Essentials.DM
|
||||
|
||||
public void ExecuteNumericSwitch(ushort inputSelector, ushort outputSelector, eRoutingSignalType sigType)
|
||||
{
|
||||
ExecuteSwitch(inputSelector, outputSelector, sigType);
|
||||
var input = inputSelector == 0 ? null : Dmps.SwitcherInputs[inputSelector];
|
||||
var output = Dmps.SwitcherOutputs[outputSelector];
|
||||
|
||||
ExecuteSwitch(input, output, sigType);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -18,8 +18,7 @@ using PepperDash.Essentials.Core.Routing;
|
||||
using PepperDash.Essentials.Devices.Common.Cameras;
|
||||
using PepperDash.Essentials.Devices.Common.Codec;
|
||||
using PepperDash.Essentials.Devices.Common.VideoCodec;
|
||||
using PepperDash_Essentials_Core.Queues;
|
||||
using PepperDash_Essentials_Core.DeviceTypeInterfaces;
|
||||
using PepperDash.Essentials.Core.Queues;
|
||||
|
||||
namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
||||
{
|
||||
|
||||
@@ -19,8 +19,7 @@ using PepperDash.Essentials.Core.Routing;
|
||||
using PepperDash.Essentials.Devices.Common.Cameras;
|
||||
using PepperDash.Essentials.Devices.Common.Codec;
|
||||
using PepperDash.Essentials.Devices.Common.VideoCodec.Interfaces;
|
||||
using PepperDash_Essentials_Core.Bridges.JoinMaps;
|
||||
using PepperDash_Essentials_Core.DeviceTypeInterfaces;
|
||||
using PepperDash.Essentials.Core.Bridges.JoinMaps;
|
||||
using Feedback = PepperDash.Essentials.Core.Feedback;
|
||||
|
||||
namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
||||
|
||||
@@ -17,7 +17,6 @@ using PepperDash.Essentials.Devices.Common.Cameras;
|
||||
using PepperDash.Essentials.Devices.Common.Codec;
|
||||
using PepperDash.Essentials.Devices.Common.VideoCodec.Cisco;
|
||||
using PepperDash.Essentials.Devices.Common.VideoCodec.Interfaces;
|
||||
using PepperDash_Essentials_Core.DeviceTypeInterfaces;
|
||||
|
||||
namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user