mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-04-14 04:57:15 +00:00
Merge branch 'development' into hotfix/DMPS-Routing-issues
This commit is contained in:
commit
b44bc8fae3
38 changed files with 4436 additions and 3668 deletions
9
.github/workflows/docker.yml
vendored
9
.github/workflows/docker.yml
vendored
|
|
@ -32,7 +32,6 @@ jobs:
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
submodules: true
|
|
||||||
# Fetch all tags
|
# Fetch all tags
|
||||||
- name: Fetch tags
|
- name: Fetch tags
|
||||||
run: git fetch --tags
|
run: git fetch --tags
|
||||||
|
|
@ -41,7 +40,7 @@ jobs:
|
||||||
shell: powershell
|
shell: powershell
|
||||||
run: |
|
run: |
|
||||||
$version = ./.github/scripts/GenerateVersionNumber.ps1
|
$version = ./.github/scripts/GenerateVersionNumber.ps1
|
||||||
Write-Output "::set-env name=VERSION::$version"
|
echo "VERSION=$version" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||||
# Use the version number to set the version of the assemblies
|
# Use the version number to set the version of the assemblies
|
||||||
- name: Update AssemblyInfo.cs
|
- name: Update AssemblyInfo.cs
|
||||||
shell: powershell
|
shell: powershell
|
||||||
|
|
@ -123,7 +122,7 @@ jobs:
|
||||||
Get-ChildItem "./Version"
|
Get-ChildItem "./Version"
|
||||||
$version = Get-Content -Path ./Version/version.txt
|
$version = Get-Content -Path ./Version/version.txt
|
||||||
Write-Host "Version: $version"
|
Write-Host "Version: $version"
|
||||||
Write-Output "::set-env name=VERSION::$version"
|
echo "VERSION=$version" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||||
Remove-Item -Path ./Version/version.txt
|
Remove-Item -Path ./Version/version.txt
|
||||||
Remove-Item -Path ./Version
|
Remove-Item -Path ./Version
|
||||||
- name: Download Build output
|
- name: Download Build output
|
||||||
|
|
@ -180,7 +179,7 @@ jobs:
|
||||||
Get-ChildItem "./Version"
|
Get-ChildItem "./Version"
|
||||||
$version = Get-Content -Path ./Version/version.txt
|
$version = Get-Content -Path ./Version/version.txt
|
||||||
Write-Host "Version: $version"
|
Write-Host "Version: $version"
|
||||||
Write-Output "::set-env name=VERSION::$version"
|
echo "VERSION=$version" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||||
Remove-Item -Path ./Version/version.txt
|
Remove-Item -Path ./Version/version.txt
|
||||||
Remove-Item -Path ./Version
|
Remove-Item -Path ./Version
|
||||||
# Checkout/Create the branch
|
# Checkout/Create the branch
|
||||||
|
|
@ -259,7 +258,7 @@ jobs:
|
||||||
Get-ChildItem "./Version"
|
Get-ChildItem "./Version"
|
||||||
$version = Get-Content -Path ./Version/version.txt
|
$version = Get-Content -Path ./Version/version.txt
|
||||||
Write-Host "Version: $version"
|
Write-Host "Version: $version"
|
||||||
Write-Output "::set-env name=VERSION::$version"
|
echo "VERSION=$version" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||||
Remove-Item -Path ./Version/version.txt
|
Remove-Item -Path ./Version/version.txt
|
||||||
Remove-Item -Path ./Version
|
Remove-Item -Path ./Version
|
||||||
# Checkout/Create the branch
|
# Checkout/Create the branch
|
||||||
|
|
|
||||||
18
.github/workflows/main.yml
vendored
18
.github/workflows/main.yml
vendored
|
|
@ -24,20 +24,14 @@ jobs:
|
||||||
# First we checkout the source repo
|
# First we checkout the source repo
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
# And any submodules
|
with:
|
||||||
- name: Checkout submodules
|
fetch-depth: 0
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
git config --global url."https://github.com/".insteadOf "git@github.com:"
|
|
||||||
auth_header="$(git config --local --get http.https://github.com/.extraheader)"
|
|
||||||
git submodule sync --recursive
|
|
||||||
git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
|
|
||||||
# Generate the appropriate version number
|
# Generate the appropriate version number
|
||||||
- name: Set Version Number
|
- name: Set Version Number
|
||||||
shell: powershell
|
shell: powershell
|
||||||
env:
|
env:
|
||||||
TAG_NAME: ${{ github.event.release.tag_name }}
|
TAG_NAME: ${{ github.event.release.tag_name }}
|
||||||
run: Write-Output "::set-env name=VERSION::$($Env:TAG_NAME)"
|
run: echo "VERSION=$version" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||||
# Use the version number to set the version of the assemblies
|
# Use the version number to set the version of the assemblies
|
||||||
- name: Update AssemblyInfo.cs
|
- name: Update AssemblyInfo.cs
|
||||||
shell: powershell
|
shell: powershell
|
||||||
|
|
@ -101,7 +95,7 @@ jobs:
|
||||||
Get-ChildItem "./Version"
|
Get-ChildItem "./Version"
|
||||||
$version = Get-Content -Path ./Version/version.txt
|
$version = Get-Content -Path ./Version/version.txt
|
||||||
Write-Host "Version: $version"
|
Write-Host "Version: $version"
|
||||||
Write-Output "::set-env name=VERSION::$version"
|
echo "VERSION=$version" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||||
Remove-Item -Path ./Version/version.txt
|
Remove-Item -Path ./Version/version.txt
|
||||||
Remove-Item -Path ./Version
|
Remove-Item -Path ./Version
|
||||||
- name: Download Build output
|
- name: Download Build output
|
||||||
|
|
@ -155,7 +149,7 @@ jobs:
|
||||||
Get-ChildItem "./Version"
|
Get-ChildItem "./Version"
|
||||||
$version = Get-Content -Path ./Version/version.txt
|
$version = Get-Content -Path ./Version/version.txt
|
||||||
Write-Host "Version: $version"
|
Write-Host "Version: $version"
|
||||||
Write-Output "::set-env name=VERSION::$version"
|
echo "VERSION=$version" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||||
Remove-Item -Path ./Version/version.txt
|
Remove-Item -Path ./Version/version.txt
|
||||||
Remove-Item -Path ./Version
|
Remove-Item -Path ./Version
|
||||||
# Checkout/Create the branch
|
# Checkout/Create the branch
|
||||||
|
|
@ -228,7 +222,7 @@ jobs:
|
||||||
Get-ChildItem "./Version"
|
Get-ChildItem "./Version"
|
||||||
$version = Get-Content -Path ./Version/version.txt
|
$version = Get-Content -Path ./Version/version.txt
|
||||||
Write-Host "Version: $version"
|
Write-Host "Version: $version"
|
||||||
Write-Output "::set-env name=VERSION::$version"
|
echo "VERSION=$version" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||||
Remove-Item -Path ./Version/version.txt
|
Remove-Item -Path ./Version/version.txt
|
||||||
Remove-Item -Path ./Version
|
Remove-Item -Path ./Version
|
||||||
# Checkout main branch
|
# Checkout main branch
|
||||||
|
|
|
||||||
|
|
@ -273,15 +273,18 @@ namespace PepperDash.Essentials.Fusion
|
||||||
// Display to fusion room sigs
|
// Display to fusion room sigs
|
||||||
FusionRoom.DisplayPowerOn.OutputSig.UserObject = dispPowerOnAction;
|
FusionRoom.DisplayPowerOn.OutputSig.UserObject = dispPowerOnAction;
|
||||||
FusionRoom.DisplayPowerOff.OutputSig.UserObject = dispPowerOffAction;
|
FusionRoom.DisplayPowerOff.OutputSig.UserObject = dispPowerOffAction;
|
||||||
defaultDisplay.PowerIsOnFeedback.LinkInputSig(FusionRoom.DisplayPowerOn.InputSig);
|
|
||||||
|
var defaultDisplayTwoWay = defaultDisplay as IHasPowerControlWithFeedback;
|
||||||
|
if (defaultDisplayTwoWay != null)
|
||||||
|
{
|
||||||
|
defaultDisplayTwoWay.PowerIsOnFeedback.LinkInputSig(FusionRoom.DisplayPowerOn.InputSig);
|
||||||
|
}
|
||||||
|
|
||||||
if (defaultDisplay is IDisplayUsage)
|
if (defaultDisplay is IDisplayUsage)
|
||||||
(defaultDisplay as IDisplayUsage).LampHours.LinkInputSig(FusionRoom.DisplayUsage.InputSig);
|
(defaultDisplay as IDisplayUsage).LampHours.LinkInputSig(FusionRoom.DisplayUsage.InputSig);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
MapDisplayToRoomJoins(1, 158, defaultDisplay);
|
MapDisplayToRoomJoins(1, 158, defaultDisplay);
|
||||||
|
|
||||||
|
|
||||||
var deviceConfig = ConfigReader.ConfigObject.Devices.FirstOrDefault(d => d.Key.Equals(defaultDisplay.Key));
|
var deviceConfig = ConfigReader.ConfigObject.Devices.FirstOrDefault(d => d.Key.Equals(defaultDisplay.Key));
|
||||||
|
|
||||||
//Check for existing asset in GUIDs collection
|
//Check for existing asset in GUIDs collection
|
||||||
|
|
@ -302,8 +305,18 @@ namespace PepperDash.Essentials.Fusion
|
||||||
var dispAsset = FusionRoom.CreateStaticAsset(tempAsset.SlotNumber, tempAsset.Name, "Display", tempAsset.InstanceId);
|
var dispAsset = FusionRoom.CreateStaticAsset(tempAsset.SlotNumber, tempAsset.Name, "Display", tempAsset.InstanceId);
|
||||||
dispAsset.PowerOn.OutputSig.UserObject = dispPowerOnAction;
|
dispAsset.PowerOn.OutputSig.UserObject = dispPowerOnAction;
|
||||||
dispAsset.PowerOff.OutputSig.UserObject = dispPowerOffAction;
|
dispAsset.PowerOff.OutputSig.UserObject = dispPowerOffAction;
|
||||||
defaultDisplay.PowerIsOnFeedback.LinkInputSig(dispAsset.PowerOn.InputSig);
|
|
||||||
// NO!! display.PowerIsOn.LinkComplementInputSig(dispAsset.PowerOff.InputSig);
|
|
||||||
|
var defaultTwoWayDisplay = defaultDisplay as IHasPowerControlWithFeedback;
|
||||||
|
if (defaultTwoWayDisplay != null)
|
||||||
|
{
|
||||||
|
defaultTwoWayDisplay.PowerIsOnFeedback.LinkInputSig(FusionRoom.DisplayPowerOn.InputSig);
|
||||||
|
if (defaultDisplay is IDisplayUsage)
|
||||||
|
(defaultDisplay as IDisplayUsage).LampHours.LinkInputSig(FusionRoom.DisplayUsage.InputSig);
|
||||||
|
|
||||||
|
defaultTwoWayDisplay.PowerIsOnFeedback.LinkInputSig(dispAsset.PowerOn.InputSig);
|
||||||
|
}
|
||||||
|
|
||||||
// Use extension methods
|
// Use extension methods
|
||||||
dispAsset.TrySetMakeModel(defaultDisplay);
|
dispAsset.TrySetMakeModel(defaultDisplay);
|
||||||
dispAsset.TryLinkAssetErrorToCommunication(defaultDisplay);
|
dispAsset.TryLinkAssetErrorToCommunication(defaultDisplay);
|
||||||
|
|
@ -325,12 +338,17 @@ namespace PepperDash.Essentials.Fusion
|
||||||
// Power on
|
// Power on
|
||||||
var defaultDisplayPowerOn = FusionRoom.CreateOffsetBoolSig((uint)joinOffset, displayName + "Power On", eSigIoMask.InputOutputSig);
|
var defaultDisplayPowerOn = FusionRoom.CreateOffsetBoolSig((uint)joinOffset, displayName + "Power On", eSigIoMask.InputOutputSig);
|
||||||
defaultDisplayPowerOn.OutputSig.UserObject = new Action<bool>(b => { if (!b) display.PowerOn(); });
|
defaultDisplayPowerOn.OutputSig.UserObject = new Action<bool>(b => { if (!b) display.PowerOn(); });
|
||||||
display.PowerIsOnFeedback.LinkInputSig(defaultDisplayPowerOn.InputSig);
|
|
||||||
|
|
||||||
// Power Off
|
// Power Off
|
||||||
var defaultDisplayPowerOff = FusionRoom.CreateOffsetBoolSig((uint)joinOffset + 1, displayName + "Power Off", eSigIoMask.InputOutputSig);
|
var defaultDisplayPowerOff = FusionRoom.CreateOffsetBoolSig((uint)joinOffset + 1, displayName + "Power Off", eSigIoMask.InputOutputSig);
|
||||||
defaultDisplayPowerOn.OutputSig.UserObject = new Action<bool>(b => { if (!b) display.PowerOff(); }); ;
|
defaultDisplayPowerOn.OutputSig.UserObject = new Action<bool>(b => { if (!b) display.PowerOff(); }); ;
|
||||||
display.PowerIsOnFeedback.LinkInputSig(defaultDisplayPowerOn.InputSig);
|
|
||||||
|
var displayTwoWay = display as IHasPowerControlWithFeedback;
|
||||||
|
if (displayTwoWay != null)
|
||||||
|
{
|
||||||
|
displayTwoWay.PowerIsOnFeedback.LinkInputSig(defaultDisplayPowerOn.InputSig);
|
||||||
|
displayTwoWay.PowerIsOnFeedback.LinkInputSig(defaultDisplayPowerOn.InputSig);
|
||||||
|
}
|
||||||
|
|
||||||
// Current Source
|
// Current Source
|
||||||
var defaultDisplaySourceNone = FusionRoom.CreateOffsetBoolSig((uint)joinOffset + 8, displayName + "Source None", eSigIoMask.InputOutputSig);
|
var defaultDisplaySourceNone = FusionRoom.CreateOffsetBoolSig((uint)joinOffset + 8, displayName + "Source None", eSigIoMask.InputOutputSig);
|
||||||
|
|
|
||||||
|
|
@ -283,19 +283,23 @@ namespace PepperDash.Essentials
|
||||||
if (disp != null)
|
if (disp != null)
|
||||||
{
|
{
|
||||||
// Link power, warming, cooling to display
|
// Link power, warming, cooling to display
|
||||||
disp.PowerIsOnFeedback.OutputChange += (o, a) =>
|
var dispTwoWay = disp as IHasPowerControlWithFeedback;
|
||||||
|
if (dispTwoWay != null)
|
||||||
{
|
{
|
||||||
if (disp.PowerIsOnFeedback.BoolValue != OnFeedback.BoolValue)
|
dispTwoWay.PowerIsOnFeedback.OutputChange += (o, a) =>
|
||||||
{
|
{
|
||||||
if (!disp.PowerIsOnFeedback.BoolValue)
|
if (dispTwoWay.PowerIsOnFeedback.BoolValue != OnFeedback.BoolValue)
|
||||||
|
{
|
||||||
|
if (!dispTwoWay.PowerIsOnFeedback.BoolValue)
|
||||||
disp.CurrentSourceInfo = null;
|
disp.CurrentSourceInfo = null;
|
||||||
OnFeedback.FireUpdate();
|
OnFeedback.FireUpdate();
|
||||||
}
|
}
|
||||||
if (disp.PowerIsOnFeedback.BoolValue)
|
if (dispTwoWay.PowerIsOnFeedback.BoolValue)
|
||||||
{
|
{
|
||||||
SetDefaultLevels();
|
SetDefaultLevels();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
disp.IsWarmingUpFeedback.OutputChange += (o, a) =>
|
disp.IsWarmingUpFeedback.OutputChange += (o, a) =>
|
||||||
{
|
{
|
||||||
|
|
@ -579,8 +583,8 @@ namespace PepperDash.Essentials
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (dest is IPower)
|
if (dest is IHasPowerControl)
|
||||||
(dest as IPower).PowerOff();
|
(dest as IHasPowerControl).PowerOff();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -176,15 +176,19 @@ namespace PepperDash.Essentials
|
||||||
if (disp != null)
|
if (disp != null)
|
||||||
{
|
{
|
||||||
// Link power, warming, cooling to display
|
// Link power, warming, cooling to display
|
||||||
disp.PowerIsOnFeedback.OutputChange += (o, a) =>
|
var dispTwoWay = disp as IHasPowerControlWithFeedback;
|
||||||
|
if (dispTwoWay != null)
|
||||||
{
|
{
|
||||||
if (disp.PowerIsOnFeedback.BoolValue != OnFeedback.BoolValue)
|
dispTwoWay.PowerIsOnFeedback.OutputChange += (o, a) =>
|
||||||
{
|
{
|
||||||
if (!disp.PowerIsOnFeedback.BoolValue)
|
if (dispTwoWay.PowerIsOnFeedback.BoolValue != OnFeedback.BoolValue)
|
||||||
|
{
|
||||||
|
if (!dispTwoWay.PowerIsOnFeedback.BoolValue)
|
||||||
CurrentSourceInfo = null;
|
CurrentSourceInfo = null;
|
||||||
OnFeedback.FireUpdate();
|
OnFeedback.FireUpdate();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
disp.IsWarmingUpFeedback.OutputChange += (o, a) =>
|
disp.IsWarmingUpFeedback.OutputChange += (o, a) =>
|
||||||
{
|
{
|
||||||
|
|
@ -495,8 +499,8 @@ namespace PepperDash.Essentials
|
||||||
if (route.SourceKey.Equals("$off", StringComparison.OrdinalIgnoreCase))
|
if (route.SourceKey.Equals("$off", StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
dest.ReleaseRoute();
|
dest.ReleaseRoute();
|
||||||
if (dest is IPower)
|
if (dest is IHasPowerControl)
|
||||||
(dest as IPower).PowerOff();
|
(dest as IHasPowerControl).PowerOff();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -190,6 +190,12 @@ namespace PepperDash.Essentials
|
||||||
(_CurrentSourceInfo.SourceDevice as IInUseTracking).InUseTracker.AddUser(this, "control");
|
(_CurrentSourceInfo.SourceDevice as IInUseTracking).InUseTracker.AddUser(this, "control");
|
||||||
if (handler != null)
|
if (handler != null)
|
||||||
handler(_CurrentSourceInfo, ChangeType.DidChange);
|
handler(_CurrentSourceInfo, ChangeType.DidChange);
|
||||||
|
|
||||||
|
var vc = VideoCodec as IHasExternalSourceSwitching;
|
||||||
|
if (vc != null)
|
||||||
|
{
|
||||||
|
vc.SetSelectedSource(_CurrentSourceInfo.SourceKey);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SourceListItem _CurrentSourceInfo;
|
SourceListItem _CurrentSourceInfo;
|
||||||
|
|
@ -273,19 +279,23 @@ namespace PepperDash.Essentials
|
||||||
if (disp != null)
|
if (disp != null)
|
||||||
{
|
{
|
||||||
// Link power, warming, cooling to display
|
// Link power, warming, cooling to display
|
||||||
disp.PowerIsOnFeedback.OutputChange += (o, a) =>
|
var dispTwoWay = disp as IHasPowerControlWithFeedback;
|
||||||
|
if (dispTwoWay != null)
|
||||||
{
|
{
|
||||||
if (disp.PowerIsOnFeedback.BoolValue != OnFeedback.BoolValue)
|
dispTwoWay.PowerIsOnFeedback.OutputChange += (o, a) =>
|
||||||
{
|
{
|
||||||
if (!disp.PowerIsOnFeedback.BoolValue)
|
if (dispTwoWay.PowerIsOnFeedback.BoolValue != OnFeedback.BoolValue)
|
||||||
|
{
|
||||||
|
if (!dispTwoWay.PowerIsOnFeedback.BoolValue)
|
||||||
CurrentSourceInfo = null;
|
CurrentSourceInfo = null;
|
||||||
OnFeedback.FireUpdate();
|
OnFeedback.FireUpdate();
|
||||||
}
|
}
|
||||||
if (disp.PowerIsOnFeedback.BoolValue)
|
if (dispTwoWay.PowerIsOnFeedback.BoolValue)
|
||||||
{
|
{
|
||||||
SetDefaultLevels();
|
SetDefaultLevels();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
disp.IsWarmingUpFeedback.OutputChange += (o, a) =>
|
disp.IsWarmingUpFeedback.OutputChange += (o, a) =>
|
||||||
{
|
{
|
||||||
|
|
@ -640,8 +650,8 @@ namespace PepperDash.Essentials
|
||||||
if (route.SourceKey.Equals("$off", StringComparison.OrdinalIgnoreCase))
|
if (route.SourceKey.Equals("$off", StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
dest.ReleaseRoute();
|
dest.ReleaseRoute();
|
||||||
if (dest is IPower)
|
if (dest is IHasPowerControl)
|
||||||
(dest as IPower).PowerOff();
|
(dest as IHasPowerControl).PowerOff();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -306,8 +306,8 @@ namespace PepperDash.Essentials
|
||||||
|
|
||||||
TriList.SetSigFalseAction(UIBoolJoin.DisplayPowerTogglePress, () =>
|
TriList.SetSigFalseAction(UIBoolJoin.DisplayPowerTogglePress, () =>
|
||||||
{
|
{
|
||||||
if (CurrentRoom != null && CurrentRoom.DefaultDisplay is IPower)
|
if (CurrentRoom != null && CurrentRoom.DefaultDisplay is IHasPowerControl)
|
||||||
(CurrentRoom.DefaultDisplay as IPower).PowerToggle();
|
(CurrentRoom.DefaultDisplay as IHasPowerControl).PowerToggle();
|
||||||
});
|
});
|
||||||
|
|
||||||
base.Show();
|
base.Show();
|
||||||
|
|
@ -984,8 +984,8 @@ namespace PepperDash.Essentials
|
||||||
(previousDev as IDvr).UnlinkButtons(TriList);
|
(previousDev as IDvr).UnlinkButtons(TriList);
|
||||||
if (previousDev is INumericKeypad)
|
if (previousDev is INumericKeypad)
|
||||||
(previousDev as INumericKeypad).UnlinkButtons(TriList);
|
(previousDev as INumericKeypad).UnlinkButtons(TriList);
|
||||||
if (previousDev is IPower)
|
if (previousDev is IHasPowerControl)
|
||||||
(previousDev as IPower).UnlinkButtons(TriList);
|
(previousDev as IHasPowerControl).UnlinkButtons(TriList);
|
||||||
if (previousDev is ITransport)
|
if (previousDev is ITransport)
|
||||||
(previousDev as ITransport).UnlinkButtons(TriList);
|
(previousDev as ITransport).UnlinkButtons(TriList);
|
||||||
//if (previousDev is IRadio)
|
//if (previousDev is IRadio)
|
||||||
|
|
@ -1044,8 +1044,8 @@ namespace PepperDash.Essentials
|
||||||
(dev as IDvr).LinkButtons(TriList);
|
(dev as IDvr).LinkButtons(TriList);
|
||||||
if (dev is INumericKeypad)
|
if (dev is INumericKeypad)
|
||||||
(dev as INumericKeypad).LinkButtons(TriList);
|
(dev as INumericKeypad).LinkButtons(TriList);
|
||||||
if (dev is IPower)
|
if (dev is IHasPowerControl)
|
||||||
(dev as IPower).LinkButtons(TriList);
|
(dev as IHasPowerControl).LinkButtons(TriList);
|
||||||
if (dev is ITransport)
|
if (dev is ITransport)
|
||||||
(dev as ITransport).LinkButtons(TriList);
|
(dev as ITransport).LinkButtons(TriList);
|
||||||
//if (dev is IRadio)
|
//if (dev is IRadio)
|
||||||
|
|
|
||||||
|
|
@ -319,8 +319,8 @@ namespace PepperDash.Essentials
|
||||||
|
|
||||||
TriList.SetSigFalseAction(UIBoolJoin.DisplayPowerTogglePress, () =>
|
TriList.SetSigFalseAction(UIBoolJoin.DisplayPowerTogglePress, () =>
|
||||||
{
|
{
|
||||||
if (CurrentRoom != null && CurrentRoom.DefaultDisplay is IPower)
|
if (CurrentRoom != null && CurrentRoom.DefaultDisplay is IHasPowerControl)
|
||||||
(CurrentRoom.DefaultDisplay as IPower).PowerToggle();
|
(CurrentRoom.DefaultDisplay as IHasPowerControl).PowerToggle();
|
||||||
});
|
});
|
||||||
|
|
||||||
SetupNextMeetingTimer();
|
SetupNextMeetingTimer();
|
||||||
|
|
@ -1293,8 +1293,8 @@ namespace PepperDash.Essentials
|
||||||
(previousDev as IDvr).UnlinkButtons(TriList);
|
(previousDev as IDvr).UnlinkButtons(TriList);
|
||||||
if (previousDev is INumericKeypad)
|
if (previousDev is INumericKeypad)
|
||||||
(previousDev as INumericKeypad).UnlinkButtons(TriList);
|
(previousDev as INumericKeypad).UnlinkButtons(TriList);
|
||||||
if (previousDev is IPower)
|
if (previousDev is IHasPowerControl)
|
||||||
(previousDev as IPower).UnlinkButtons(TriList);
|
(previousDev as IHasPowerControl).UnlinkButtons(TriList);
|
||||||
if (previousDev is ITransport)
|
if (previousDev is ITransport)
|
||||||
(previousDev as ITransport).UnlinkButtons(TriList);
|
(previousDev as ITransport).UnlinkButtons(TriList);
|
||||||
}
|
}
|
||||||
|
|
@ -1351,8 +1351,8 @@ namespace PepperDash.Essentials
|
||||||
(dev as IDvr).LinkButtons(TriList);
|
(dev as IDvr).LinkButtons(TriList);
|
||||||
if (dev is INumericKeypad)
|
if (dev is INumericKeypad)
|
||||||
(dev as INumericKeypad).LinkButtons(TriList);
|
(dev as INumericKeypad).LinkButtons(TriList);
|
||||||
if (dev is IPower)
|
if (dev is IHasPowerControl)
|
||||||
(dev as IPower).LinkButtons(TriList);
|
(dev as IHasPowerControl).LinkButtons(TriList);
|
||||||
if (dev is ITransport)
|
if (dev is ITransport)
|
||||||
(dev as ITransport).LinkButtons(TriList);
|
(dev as ITransport).LinkButtons(TriList);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ using PepperDash.Essentials.Core.SmartObjects;
|
||||||
namespace PepperDash.Essentials.Core
|
namespace PepperDash.Essentials.Core
|
||||||
{
|
{
|
||||||
|
|
||||||
public interface IDiscPlayerControls : IColor, IDPad, INumericKeypad, IPower, ITransport, IUiDisplayInfo
|
public interface IDiscPlayerControls : IColor, IDPad, INumericKeypad, IHasPowerControl, ITransport, IUiDisplayInfo
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,8 +14,9 @@ using PepperDash.Essentials.Core.SmartObjects;
|
||||||
namespace PepperDash.Essentials.Core
|
namespace PepperDash.Essentials.Core
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
/// Defines the ability to power a device on and off
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[Obsolete("Will be replaced by IHasPowerControlWithFeedback")]
|
||||||
public interface IPower
|
public interface IPower
|
||||||
{
|
{
|
||||||
void PowerOn();
|
void PowerOn();
|
||||||
|
|
@ -24,25 +25,53 @@ namespace PepperDash.Essentials.Core
|
||||||
BoolFeedback PowerIsOnFeedback { get; }
|
BoolFeedback PowerIsOnFeedback { get; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Adds feedback for current power state
|
||||||
|
/// </summary>
|
||||||
|
public interface IHasPowerControlWithFeedback : IHasPowerControl
|
||||||
|
{
|
||||||
|
BoolFeedback PowerIsOnFeedback { get; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Defines the ability to power a device on and off
|
||||||
|
/// </summary>
|
||||||
|
public interface IHasPowerControl
|
||||||
|
{
|
||||||
|
void PowerOn();
|
||||||
|
void PowerOff();
|
||||||
|
void PowerToggle();
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static class IPowerExtensions
|
public static class IHasPowerControlExtensions
|
||||||
{
|
{
|
||||||
public static void LinkButtons(this IPower dev, BasicTriList triList)
|
public static void LinkButtons(this IHasPowerControl dev, BasicTriList triList)
|
||||||
{
|
{
|
||||||
triList.SetSigFalseAction(101, dev.PowerOn);
|
triList.SetSigFalseAction(101, dev.PowerOn);
|
||||||
triList.SetSigFalseAction(102, dev.PowerOff);
|
triList.SetSigFalseAction(102, dev.PowerOff);
|
||||||
triList.SetSigFalseAction(103, dev.PowerToggle);
|
triList.SetSigFalseAction(103, dev.PowerToggle);
|
||||||
dev.PowerIsOnFeedback.LinkInputSig(triList.BooleanInput[101]);
|
|
||||||
|
var fbdev = dev as IHasPowerControlWithFeedback;
|
||||||
|
if (fbdev != null)
|
||||||
|
{
|
||||||
|
fbdev.PowerIsOnFeedback.LinkInputSig(triList.BooleanInput[101]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void UnlinkButtons(this IPower dev, BasicTriList triList)
|
public static void UnlinkButtons(this IHasPowerControl dev, BasicTriList triList)
|
||||||
{
|
{
|
||||||
triList.ClearBoolSigAction(101);
|
triList.ClearBoolSigAction(101);
|
||||||
triList.ClearBoolSigAction(102);
|
triList.ClearBoolSigAction(102);
|
||||||
triList.ClearBoolSigAction(103);
|
triList.ClearBoolSigAction(103);
|
||||||
dev.PowerIsOnFeedback.UnlinkInputSig(triList.BooleanInput[101]);
|
|
||||||
|
var fbdev = dev as IHasPowerControlWithFeedback;
|
||||||
|
if (fbdev != null)
|
||||||
|
{
|
||||||
|
fbdev.PowerIsOnFeedback.UnlinkInputSig(triList.BooleanInput[101]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -20,7 +20,9 @@ namespace PepperDash.Essentials.Core
|
||||||
public IrOutputPortController IrPort { get; private set; }
|
public IrOutputPortController IrPort { get; private set; }
|
||||||
public ushort IrPulseTime { get; set; }
|
public ushort IrPulseTime { get; set; }
|
||||||
|
|
||||||
protected override Func<bool> PowerIsOnFeedbackFunc
|
public BoolFeedback PowerIsOnFeedback { get; private set; }
|
||||||
|
|
||||||
|
protected Func<bool> PowerIsOnFeedbackFunc
|
||||||
{
|
{
|
||||||
get { return () => _PowerIsOn; }
|
get { return () => _PowerIsOn; }
|
||||||
}
|
}
|
||||||
|
|
@ -43,7 +45,10 @@ namespace PepperDash.Essentials.Core
|
||||||
IrPort = new IrOutputPortController(key + "-ir", port, irDriverFilepath);
|
IrPort = new IrOutputPortController(key + "-ir", port, irDriverFilepath);
|
||||||
DeviceManager.AddDevice(IrPort);
|
DeviceManager.AddDevice(IrPort);
|
||||||
|
|
||||||
PowerIsOnFeedback.OutputChange += (o, a) => {
|
PowerIsOnFeedback = new BoolFeedback(PowerIsOnFeedbackFunc);
|
||||||
|
|
||||||
|
PowerIsOnFeedback.OutputChange += (o, a) =>
|
||||||
|
{
|
||||||
Debug.Console(2, this, "Power on={0}", _PowerIsOn);
|
Debug.Console(2, this, "Power on={0}", _PowerIsOn);
|
||||||
if (_PowerIsOn) StartWarmingTimer();
|
if (_PowerIsOn) StartWarmingTimer();
|
||||||
else StartCoolingTimer();
|
else StartCoolingTimer();
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ namespace PepperDash.Essentials.Core
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public abstract class DisplayBase : EssentialsDevice, IHasFeedback, IRoutingSinkWithSwitching, IPower, IWarmingCooling, IUsageTracking
|
public abstract class DisplayBase : EssentialsDevice, IHasFeedback, IRoutingSinkWithSwitching, IHasPowerControl, IWarmingCooling, IUsageTracking
|
||||||
{
|
{
|
||||||
public event SourceInfoChangeHandler CurrentSourceChange;
|
public event SourceInfoChangeHandler CurrentSourceChange;
|
||||||
|
|
||||||
|
|
@ -46,7 +46,6 @@ namespace PepperDash.Essentials.Core
|
||||||
}
|
}
|
||||||
SourceListItem _CurrentSourceInfo;
|
SourceListItem _CurrentSourceInfo;
|
||||||
|
|
||||||
public BoolFeedback PowerIsOnFeedback { get; protected set; }
|
|
||||||
public BoolFeedback IsCoolingDownFeedback { get; protected set; }
|
public BoolFeedback IsCoolingDownFeedback { get; protected set; }
|
||||||
public BoolFeedback IsWarmingUpFeedback { get; private set; }
|
public BoolFeedback IsWarmingUpFeedback { get; private set; }
|
||||||
|
|
||||||
|
|
@ -59,7 +58,6 @@ namespace PepperDash.Essentials.Core
|
||||||
/// Bool Func that will provide a value for the PowerIsOn Output. Must be implemented
|
/// Bool Func that will provide a value for the PowerIsOn Output. Must be implemented
|
||||||
/// by concrete sub-classes
|
/// by concrete sub-classes
|
||||||
/// </summary>
|
/// </summary>
|
||||||
abstract protected Func<bool> PowerIsOnFeedbackFunc { get; }
|
|
||||||
abstract protected Func<bool> IsCoolingDownFeedbackFunc { get; }
|
abstract protected Func<bool> IsCoolingDownFeedbackFunc { get; }
|
||||||
abstract protected Func<bool> IsWarmingUpFeedbackFunc { get; }
|
abstract protected Func<bool> IsWarmingUpFeedbackFunc { get; }
|
||||||
|
|
||||||
|
|
@ -76,25 +74,14 @@ namespace PepperDash.Essentials.Core
|
||||||
protected DisplayBase(string key, string name)
|
protected DisplayBase(string key, string name)
|
||||||
: base(key, name)
|
: base(key, name)
|
||||||
{
|
{
|
||||||
PowerIsOnFeedback = new BoolFeedback("PowerOnFeedback", PowerIsOnFeedbackFunc);
|
|
||||||
IsCoolingDownFeedback = new BoolFeedback("IsCoolingDown", IsCoolingDownFeedbackFunc);
|
IsCoolingDownFeedback = new BoolFeedback("IsCoolingDown", IsCoolingDownFeedbackFunc);
|
||||||
IsWarmingUpFeedback = new BoolFeedback("IsWarmingUp", IsWarmingUpFeedbackFunc);
|
IsWarmingUpFeedback = new BoolFeedback("IsWarmingUp", IsWarmingUpFeedbackFunc);
|
||||||
|
|
||||||
InputPorts = new RoutingPortCollection<RoutingInputPort>();
|
InputPorts = new RoutingPortCollection<RoutingInputPort>();
|
||||||
|
|
||||||
PowerIsOnFeedback.OutputChange += PowerIsOnFeedback_OutputChange;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PowerIsOnFeedback_OutputChange(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
if (UsageTracker != null)
|
|
||||||
{
|
|
||||||
if (PowerIsOnFeedback.BoolValue)
|
|
||||||
UsageTracker.StartDeviceUsage();
|
|
||||||
else
|
|
||||||
UsageTracker.EndDeviceUsage();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public abstract void PowerOn();
|
public abstract void PowerOn();
|
||||||
public abstract void PowerOff();
|
public abstract void PowerOff();
|
||||||
|
|
@ -106,7 +93,6 @@ namespace PepperDash.Essentials.Core
|
||||||
{
|
{
|
||||||
return new FeedbackCollection<Feedback>
|
return new FeedbackCollection<Feedback>
|
||||||
{
|
{
|
||||||
PowerIsOnFeedback,
|
|
||||||
IsCoolingDownFeedback,
|
IsCoolingDownFeedback,
|
||||||
IsWarmingUpFeedback
|
IsWarmingUpFeedback
|
||||||
};
|
};
|
||||||
|
|
@ -171,7 +157,10 @@ namespace PepperDash.Essentials.Core
|
||||||
displayDevice.PowerOff();
|
displayDevice.PowerOff();
|
||||||
});
|
});
|
||||||
|
|
||||||
displayDevice.PowerIsOnFeedback.OutputChange += (o, a) =>
|
var twoWayDisplayDevice = displayDevice as TwoWayDisplayBase;
|
||||||
|
if (twoWayDisplayDevice != null)
|
||||||
|
{
|
||||||
|
twoWayDisplayDevice.PowerIsOnFeedback.OutputChange += (o, a) =>
|
||||||
{
|
{
|
||||||
if (!a.BoolValue)
|
if (!a.BoolValue)
|
||||||
{
|
{
|
||||||
|
|
@ -186,7 +175,9 @@ namespace PepperDash.Essentials.Core
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
displayDevice.PowerIsOnFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.PowerOff.JoinNumber]);
|
twoWayDisplayDevice.PowerIsOnFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.PowerOff.JoinNumber]);
|
||||||
|
twoWayDisplayDevice.PowerIsOnFeedback.LinkInputSig(trilist.BooleanInput[joinMap.PowerOn.JoinNumber]);
|
||||||
|
}
|
||||||
|
|
||||||
// PowerOn
|
// PowerOn
|
||||||
trilist.SetSigTrueAction(joinMap.PowerOn.JoinNumber, () =>
|
trilist.SetSigTrueAction(joinMap.PowerOn.JoinNumber, () =>
|
||||||
|
|
@ -197,7 +188,6 @@ namespace PepperDash.Essentials.Core
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
displayDevice.PowerIsOnFeedback.LinkInputSig(trilist.BooleanInput[joinMap.PowerOn.JoinNumber]);
|
|
||||||
|
|
||||||
for (int i = 0; i < displayDevice.InputPorts.Count; i++)
|
for (int i = 0; i < displayDevice.InputPorts.Count; i++)
|
||||||
{
|
{
|
||||||
|
|
@ -259,17 +249,21 @@ namespace PepperDash.Essentials.Core
|
||||||
volumeDisplayWithFeedback.MuteFeedback.LinkInputSig(trilist.BooleanInput[joinMap.VolumeMuteOn.JoinNumber]);
|
volumeDisplayWithFeedback.MuteFeedback.LinkInputSig(trilist.BooleanInput[joinMap.VolumeMuteOn.JoinNumber]);
|
||||||
volumeDisplayWithFeedback.MuteFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.VolumeMuteOff.JoinNumber]);
|
volumeDisplayWithFeedback.MuteFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.VolumeMuteOff.JoinNumber]);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public abstract class TwoWayDisplayBase : DisplayBase
|
public abstract class TwoWayDisplayBase : DisplayBase, IRoutingFeedback, IHasPowerControlWithFeedback
|
||||||
{
|
{
|
||||||
public StringFeedback CurrentInputFeedback { get; private set; }
|
public StringFeedback CurrentInputFeedback { get; private set; }
|
||||||
|
|
||||||
abstract protected Func<string> CurrentInputFeedbackFunc { get; }
|
abstract protected Func<string> CurrentInputFeedbackFunc { get; }
|
||||||
|
|
||||||
|
public BoolFeedback PowerIsOnFeedback { get; protected set; }
|
||||||
|
abstract protected Func<bool> PowerIsOnFeedbackFunc { get; }
|
||||||
|
|
||||||
|
|
||||||
public static MockDisplay DefaultDisplay
|
public static MockDisplay DefaultDisplay
|
||||||
{
|
{
|
||||||
|
|
@ -290,10 +284,38 @@ namespace PepperDash.Essentials.Core
|
||||||
WarmupTime = 7000;
|
WarmupTime = 7000;
|
||||||
CooldownTime = 15000;
|
CooldownTime = 15000;
|
||||||
|
|
||||||
Feedbacks.Add(CurrentInputFeedback);
|
PowerIsOnFeedback = new BoolFeedback("PowerOnFeedback", PowerIsOnFeedbackFunc);
|
||||||
|
|
||||||
|
Feedbacks.Add(CurrentInputFeedback);
|
||||||
|
Feedbacks.Add(PowerIsOnFeedback);
|
||||||
|
|
||||||
|
PowerIsOnFeedback.OutputChange += PowerIsOnFeedback_OutputChange;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PowerIsOnFeedback_OutputChange(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (UsageTracker != null)
|
||||||
|
{
|
||||||
|
if (PowerIsOnFeedback.BoolValue)
|
||||||
|
UsageTracker.StartDeviceUsage();
|
||||||
|
else
|
||||||
|
UsageTracker.EndDeviceUsage();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public event EventHandler<RoutingNumericEventArgs> NumericSwitchChange;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Raise an event when the status of a switch object changes.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="e">Arguments defined as IKeyName sender, output, input, and eRoutingSignalType</param>
|
||||||
|
protected void OnSwitchChange(RoutingNumericEventArgs e)
|
||||||
|
{
|
||||||
|
var newEvent = NumericSwitchChange;
|
||||||
|
if (newEvent != null) newEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1227,11 +1227,6 @@ namespace PepperDash.Essentials.Core.Fusion
|
||||||
// Display to fusion room sigs
|
// Display to fusion room sigs
|
||||||
FusionRoom.DisplayPowerOn.OutputSig.UserObject = dispPowerOnAction;
|
FusionRoom.DisplayPowerOn.OutputSig.UserObject = dispPowerOnAction;
|
||||||
FusionRoom.DisplayPowerOff.OutputSig.UserObject = dispPowerOffAction;
|
FusionRoom.DisplayPowerOff.OutputSig.UserObject = dispPowerOffAction;
|
||||||
defaultDisplay.PowerIsOnFeedback.LinkInputSig(FusionRoom.DisplayPowerOn.InputSig);
|
|
||||||
if (defaultDisplay is IDisplayUsage)
|
|
||||||
(defaultDisplay as IDisplayUsage).LampHours.LinkInputSig(FusionRoom.DisplayUsage.InputSig);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
MapDisplayToRoomJoins(1, 158, defaultDisplay);
|
MapDisplayToRoomJoins(1, 158, defaultDisplay);
|
||||||
|
|
||||||
|
|
@ -1256,8 +1251,18 @@ namespace PepperDash.Essentials.Core.Fusion
|
||||||
var dispAsset = FusionRoom.CreateStaticAsset(tempAsset.SlotNumber, tempAsset.Name, "Display", tempAsset.InstanceId);
|
var dispAsset = FusionRoom.CreateStaticAsset(tempAsset.SlotNumber, tempAsset.Name, "Display", tempAsset.InstanceId);
|
||||||
dispAsset.PowerOn.OutputSig.UserObject = dispPowerOnAction;
|
dispAsset.PowerOn.OutputSig.UserObject = dispPowerOnAction;
|
||||||
dispAsset.PowerOff.OutputSig.UserObject = dispPowerOffAction;
|
dispAsset.PowerOff.OutputSig.UserObject = dispPowerOffAction;
|
||||||
defaultDisplay.PowerIsOnFeedback.LinkInputSig(dispAsset.PowerOn.InputSig);
|
|
||||||
// NO!! display.PowerIsOn.LinkComplementInputSig(dispAsset.PowerOff.InputSig);
|
var defaultTwoWayDisplay = defaultDisplay as IHasPowerControlWithFeedback;
|
||||||
|
if (defaultTwoWayDisplay != null)
|
||||||
|
{
|
||||||
|
defaultTwoWayDisplay.PowerIsOnFeedback.LinkInputSig(FusionRoom.DisplayPowerOn.InputSig);
|
||||||
|
if (defaultDisplay is IDisplayUsage)
|
||||||
|
(defaultDisplay as IDisplayUsage).LampHours.LinkInputSig(FusionRoom.DisplayUsage.InputSig);
|
||||||
|
|
||||||
|
defaultTwoWayDisplay.PowerIsOnFeedback.LinkInputSig(dispAsset.PowerOn.InputSig);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
// Use extension methods
|
// Use extension methods
|
||||||
dispAsset.TrySetMakeModel(defaultDisplay);
|
dispAsset.TrySetMakeModel(defaultDisplay);
|
||||||
dispAsset.TryLinkAssetErrorToCommunication(defaultDisplay);
|
dispAsset.TryLinkAssetErrorToCommunication(defaultDisplay);
|
||||||
|
|
@ -1289,12 +1294,18 @@ namespace PepperDash.Essentials.Core.Fusion
|
||||||
// Power on
|
// Power on
|
||||||
var defaultDisplayPowerOn = FusionRoom.CreateOffsetBoolSig((uint)joinOffset, displayName + "Power On", eSigIoMask.InputOutputSig);
|
var defaultDisplayPowerOn = FusionRoom.CreateOffsetBoolSig((uint)joinOffset, displayName + "Power On", eSigIoMask.InputOutputSig);
|
||||||
defaultDisplayPowerOn.OutputSig.UserObject = new Action<bool>(b => { if (!b) display.PowerOn(); });
|
defaultDisplayPowerOn.OutputSig.UserObject = new Action<bool>(b => { if (!b) display.PowerOn(); });
|
||||||
display.PowerIsOnFeedback.LinkInputSig(defaultDisplayPowerOn.InputSig);
|
|
||||||
|
|
||||||
// Power Off
|
// Power Off
|
||||||
var defaultDisplayPowerOff = FusionRoom.CreateOffsetBoolSig((uint)joinOffset + 1, displayName + "Power Off", eSigIoMask.InputOutputSig);
|
var defaultDisplayPowerOff = FusionRoom.CreateOffsetBoolSig((uint)joinOffset + 1, displayName + "Power Off", eSigIoMask.InputOutputSig);
|
||||||
defaultDisplayPowerOn.OutputSig.UserObject = new Action<bool>(b => { if (!b) display.PowerOff(); }); ;
|
defaultDisplayPowerOn.OutputSig.UserObject = new Action<bool>(b => { if (!b) display.PowerOff(); }); ;
|
||||||
display.PowerIsOnFeedback.LinkInputSig(defaultDisplayPowerOn.InputSig);
|
|
||||||
|
|
||||||
|
var defaultTwoWayDisplay = display as IHasPowerControlWithFeedback;
|
||||||
|
if (defaultTwoWayDisplay != null)
|
||||||
|
{
|
||||||
|
defaultTwoWayDisplay.PowerIsOnFeedback.LinkInputSig(defaultDisplayPowerOn.InputSig);
|
||||||
|
defaultTwoWayDisplay.PowerIsOnFeedback.LinkComplementInputSig(defaultDisplayPowerOff.InputSig);
|
||||||
|
}
|
||||||
|
|
||||||
// Current Source
|
// Current Source
|
||||||
var defaultDisplaySourceNone = FusionRoom.CreateOffsetBoolSig((uint)joinOffset + 8, displayName + "Source None", eSigIoMask.InputOutputSig);
|
var defaultDisplaySourceNone = FusionRoom.CreateOffsetBoolSig((uint)joinOffset + 8, displayName + "Source None", eSigIoMask.InputOutputSig);
|
||||||
|
|
|
||||||
|
|
@ -111,10 +111,87 @@ namespace PepperDash.Essentials.Core
|
||||||
IntFeedback AudioVideoSourceNumericFeedback { get; }
|
IntFeedback AudioVideoSourceNumericFeedback { get; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Defines an IRmcRouting with a feedback event
|
||||||
|
/// </summary>
|
||||||
|
public interface ITxRoutingWithFeedback : ITxRouting
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Defines an IRmcRouting with a feedback event
|
||||||
|
/// </summary>
|
||||||
|
public interface IRmcRoutingWithFeedback : IRmcRouting
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Defines an IRoutingOutputs devices as being a source - the start of the chain
|
/// Defines an IRoutingOutputs devices as being a source - the start of the chain
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IRoutingSource : IRoutingOutputs
|
public interface IRoutingSource : IRoutingOutputs
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Defines an event structure for reporting output route data
|
||||||
|
/// </summary>
|
||||||
|
public interface IRoutingFeedback : IKeyName
|
||||||
|
{
|
||||||
|
event EventHandler<RoutingNumericEventArgs> NumericSwitchChange;
|
||||||
|
//void OnSwitchChange(RoutingNumericEventArgs e);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Defines an IRoutingNumeric with a feedback event
|
||||||
|
/// </summary>
|
||||||
|
public interface IRoutingNumericWithFeedback : IRoutingNumeric, IRoutingFeedback
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Defines an IRouting with a feedback event
|
||||||
|
/// </summary>
|
||||||
|
public interface IRoutingWithFeedback : IRouting, IRoutingFeedback
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class RoutingNumericEventArgs : EventArgs
|
||||||
|
{
|
||||||
|
|
||||||
|
public uint? Output { get; set; }
|
||||||
|
public uint? Input { get; set; }
|
||||||
|
|
||||||
|
public eRoutingSignalType SigType { get; set; }
|
||||||
|
public RoutingInputPort InputPort { get; set; }
|
||||||
|
public RoutingOutputPort OutputPort { get; set; }
|
||||||
|
|
||||||
|
public RoutingNumericEventArgs(uint output, uint input, eRoutingSignalType sigType) : this(output, input, null, null, sigType)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public RoutingNumericEventArgs(RoutingOutputPort outputPort, RoutingInputPort inputPort,
|
||||||
|
eRoutingSignalType sigType)
|
||||||
|
: this(null, null, outputPort, inputPort, sigType)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public RoutingNumericEventArgs()
|
||||||
|
: this(null, null, null, null, 0)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public RoutingNumericEventArgs(uint? output, uint? input, RoutingOutputPort outputPort,
|
||||||
|
RoutingInputPort inputPort, eRoutingSignalType sigType)
|
||||||
|
{
|
||||||
|
OutputPort = outputPort;
|
||||||
|
InputPort = inputPort;
|
||||||
|
|
||||||
|
Output = output;
|
||||||
|
Input = input;
|
||||||
|
SigType = sigType;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -17,7 +17,7 @@ using PepperDash.Essentials.Core.Config;
|
||||||
namespace PepperDash.Essentials.DM.AirMedia
|
namespace PepperDash.Essentials.DM.AirMedia
|
||||||
{
|
{
|
||||||
[Description("Wrapper class for an AM-200 or AM-300")]
|
[Description("Wrapper class for an AM-200 or AM-300")]
|
||||||
public class AirMediaController : CrestronGenericBridgeableBaseDevice, IRoutingNumeric, IIROutputPorts, IComPorts
|
public class AirMediaController : CrestronGenericBridgeableBaseDevice, IRoutingNumericWithFeedback, IIROutputPorts, IComPorts
|
||||||
{
|
{
|
||||||
public AmX00 AirMedia { get; private set; }
|
public AmX00 AirMedia { get; private set; }
|
||||||
|
|
||||||
|
|
@ -29,6 +29,10 @@ namespace PepperDash.Essentials.DM.AirMedia
|
||||||
|
|
||||||
public RoutingPortCollection<RoutingOutputPort> OutputPorts { get; private set; }
|
public RoutingPortCollection<RoutingOutputPort> OutputPorts { get; private set; }
|
||||||
|
|
||||||
|
|
||||||
|
//IroutingNumericEvent
|
||||||
|
public event EventHandler<RoutingNumericEventArgs> NumericSwitchChange;
|
||||||
|
|
||||||
public BoolFeedback IsInSessionFeedback { get; private set; }
|
public BoolFeedback IsInSessionFeedback { get; private set; }
|
||||||
public IntFeedback ErrorFeedback { get; private set; }
|
public IntFeedback ErrorFeedback { get; private set; }
|
||||||
public IntFeedback NumberOfUsersConnectedFeedback { get; set; }
|
public IntFeedback NumberOfUsersConnectedFeedback { get; set; }
|
||||||
|
|
@ -43,6 +47,7 @@ namespace PepperDash.Essentials.DM.AirMedia
|
||||||
public AirMediaController(string key, string name, AmX00 device, DeviceConfig dc, AirMediaPropertiesConfig props)
|
public AirMediaController(string key, string name, AmX00 device, DeviceConfig dc, AirMediaPropertiesConfig props)
|
||||||
: base(key, name, device)
|
: base(key, name, device)
|
||||||
{
|
{
|
||||||
|
|
||||||
AirMedia = device;
|
AirMedia = device;
|
||||||
|
|
||||||
DeviceConfig = dc;
|
DeviceConfig = dc;
|
||||||
|
|
@ -53,21 +58,36 @@ namespace PepperDash.Essentials.DM.AirMedia
|
||||||
OutputPorts = new RoutingPortCollection<RoutingOutputPort>();
|
OutputPorts = new RoutingPortCollection<RoutingOutputPort>();
|
||||||
|
|
||||||
InputPorts.Add(new RoutingInputPort(DmPortName.Osd, eRoutingSignalType.AudioVideo,
|
InputPorts.Add(new RoutingInputPort(DmPortName.Osd, eRoutingSignalType.AudioVideo,
|
||||||
eRoutingPortConnectionType.None, new Action(SelectPinPointUxLandingPage), this));
|
eRoutingPortConnectionType.None, new Action(SelectPinPointUxLandingPage), this)
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = 0
|
||||||
|
});
|
||||||
|
|
||||||
InputPorts.Add(new RoutingInputPort(DmPortName.AirMediaIn, eRoutingSignalType.AudioVideo,
|
InputPorts.Add(new RoutingInputPort(DmPortName.AirMediaIn, eRoutingSignalType.AudioVideo,
|
||||||
eRoutingPortConnectionType.Streaming, new Action(SelectAirMedia), this));
|
eRoutingPortConnectionType.Streaming, new Action(SelectAirMedia), this)
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = 1
|
||||||
|
});
|
||||||
|
|
||||||
InputPorts.Add(new RoutingInputPort(DmPortName.HdmiIn, eRoutingSignalType.AudioVideo,
|
InputPorts.Add(new RoutingInputPort(DmPortName.HdmiIn, eRoutingSignalType.AudioVideo,
|
||||||
eRoutingPortConnectionType.Hdmi, new Action(SelectHdmiIn), this));
|
eRoutingPortConnectionType.Hdmi, new Action(SelectHdmiIn), this)
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = 2
|
||||||
|
});
|
||||||
|
|
||||||
InputPorts.Add(new RoutingInputPort(DmPortName.AirBoardIn, eRoutingSignalType.AudioVideo,
|
InputPorts.Add(new RoutingInputPort(DmPortName.AirBoardIn, eRoutingSignalType.AudioVideo,
|
||||||
eRoutingPortConnectionType.None, new Action(SelectAirboardIn), this));
|
eRoutingPortConnectionType.None, new Action(SelectAirboardIn), this)
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = 4
|
||||||
|
});
|
||||||
|
|
||||||
if (AirMedia is Am300)
|
if (AirMedia is Am300)
|
||||||
{
|
{
|
||||||
InputPorts.Add(new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.AudioVideo,
|
InputPorts.Add(new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.AudioVideo,
|
||||||
eRoutingPortConnectionType.DmCat, new Action(SelectDmIn), this));
|
eRoutingPortConnectionType.DmCat, new Action(SelectDmIn), this)
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = 3
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
OutputPorts.Add(new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.AudioVideo,
|
OutputPorts.Add(new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.AudioVideo,
|
||||||
|
|
@ -153,6 +173,17 @@ namespace PepperDash.Essentials.DM.AirMedia
|
||||||
SerialNumberFeedback.LinkInputSig(trilist.StringInput[joinMap.SerialNumberFeedback.JoinNumber]);
|
SerialNumberFeedback.LinkInputSig(trilist.StringInput[joinMap.SerialNumberFeedback.JoinNumber]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Raise an event when the status of a switch object changes.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="e">Arguments defined as IKeyName sender, output, input, and eRoutingSignalType</param>
|
||||||
|
private void OnSwitchChange(RoutingNumericEventArgs e)
|
||||||
|
{
|
||||||
|
var newEvent = NumericSwitchChange;
|
||||||
|
if (newEvent != null) newEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void AirMedia_AirMediaChange(object sender, Crestron.SimplSharpPro.DeviceSupport.GenericEventArgs args)
|
void AirMedia_AirMediaChange(object sender, Crestron.SimplSharpPro.DeviceSupport.GenericEventArgs args)
|
||||||
{
|
{
|
||||||
if (args.EventId == AirMediaInputSlot.AirMediaStatusFeedbackEventId)
|
if (args.EventId == AirMediaInputSlot.AirMediaStatusFeedbackEventId)
|
||||||
|
|
@ -172,12 +203,20 @@ namespace PepperDash.Essentials.DM.AirMedia
|
||||||
void DisplayControl_DisplayControlChange(object sender, Crestron.SimplSharpPro.DeviceSupport.GenericEventArgs args)
|
void DisplayControl_DisplayControlChange(object sender, Crestron.SimplSharpPro.DeviceSupport.GenericEventArgs args)
|
||||||
{
|
{
|
||||||
if (args.EventId == AmX00.VideoOutFeedbackEventId)
|
if (args.EventId == AmX00.VideoOutFeedbackEventId)
|
||||||
|
{
|
||||||
VideoOutFeedback.FireUpdate();
|
VideoOutFeedback.FireUpdate();
|
||||||
|
|
||||||
|
var localInputPort =
|
||||||
|
InputPorts.FirstOrDefault(p => (int) p.FeedbackMatchObject == VideoOutFeedback.UShortValue);
|
||||||
|
|
||||||
|
OnSwitchChange(new RoutingNumericEventArgs(1, VideoOutFeedback.UShortValue, OutputPorts.First(),
|
||||||
|
localInputPort, eRoutingSignalType.AudioVideo));
|
||||||
|
}
|
||||||
else if (args.EventId == AmX00.EnableAutomaticRoutingFeedbackEventId)
|
else if (args.EventId == AmX00.EnableAutomaticRoutingFeedbackEventId)
|
||||||
AutomaticInputRoutingEnabledFeedback.FireUpdate();
|
AutomaticInputRoutingEnabledFeedback.FireUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
void HdmiIn_StreamChange(Crestron.SimplSharpPro.DeviceSupport.Stream stream, Crestron.SimplSharpPro.DeviceSupport.StreamEventArgs args)
|
void HdmiIn_StreamChange(Stream stream, Crestron.SimplSharpPro.DeviceSupport.StreamEventArgs args)
|
||||||
{
|
{
|
||||||
if (args.EventId == DMInputEventIds.SourceSyncEventId)
|
if (args.EventId == DMInputEventIds.SourceSyncEventId)
|
||||||
HdmiVideoSyncDetectedFeedback.FireUpdate();
|
HdmiVideoSyncDetectedFeedback.FireUpdate();
|
||||||
|
|
|
||||||
|
|
@ -21,12 +21,15 @@ namespace PepperDash.Essentials.DM {
|
||||||
/// Builds a controller for basic DM-RMCs with Com and IR ports and no control functions
|
/// Builds a controller for basic DM-RMCs with Com and IR ports and no control functions
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class DmBladeChassisController : CrestronGenericBridgeableBaseDevice, IDmSwitch, IRoutingNumeric
|
public class DmBladeChassisController : CrestronGenericBridgeableBaseDevice, IDmSwitch, IRoutingNumericWithFeedback
|
||||||
{
|
{
|
||||||
public DMChassisPropertiesConfig PropertiesConfig { get; set; }
|
public DMChassisPropertiesConfig PropertiesConfig { get; set; }
|
||||||
|
|
||||||
public Switch Chassis { get; private set; }
|
public Switch Chassis { get; private set; }
|
||||||
|
|
||||||
|
//IroutingNumericEvent
|
||||||
|
public event EventHandler<RoutingNumericEventArgs> NumericSwitchChange;
|
||||||
|
|
||||||
// Feedbacks for EssentialDM
|
// Feedbacks for EssentialDM
|
||||||
public Dictionary<uint, IntFeedback> VideoOutputFeedbacks { get; private set; }
|
public Dictionary<uint, IntFeedback> VideoOutputFeedbacks { get; private set; }
|
||||||
public Dictionary<uint, IntFeedback> AudioOutputFeedbacks { get; private set; }
|
public Dictionary<uint, IntFeedback> AudioOutputFeedbacks { get; private set; }
|
||||||
|
|
@ -287,6 +290,15 @@ namespace PepperDash.Essentials.DM {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Raise an event when the status of a switch object changes.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="e">Arguments defined as IKeyName sender, output, input, and eRoutingSignalType</param>
|
||||||
|
private void OnSwitchChange(RoutingNumericEventArgs e)
|
||||||
|
{
|
||||||
|
var newEvent = NumericSwitchChange;
|
||||||
|
if (newEvent != null) newEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void AddHdmiInBladePorts(uint number, ICec cecPort) {
|
void AddHdmiInBladePorts(uint number, ICec cecPort) {
|
||||||
|
|
@ -377,7 +389,10 @@ namespace PepperDash.Essentials.DM {
|
||||||
void AddInputPortWithDebug(uint cardNum, string portName, eRoutingSignalType sigType, eRoutingPortConnectionType portType) {
|
void AddInputPortWithDebug(uint cardNum, string portName, eRoutingSignalType sigType, eRoutingPortConnectionType portType) {
|
||||||
var portKey = string.Format("inputCard{0}--{1}", cardNum, portName);
|
var portKey = string.Format("inputCard{0}--{1}", cardNum, portName);
|
||||||
Debug.Console(2, this, "Adding input port '{0}'", portKey);
|
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, cardNum, this)
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = Chassis.Inputs[cardNum]
|
||||||
|
};
|
||||||
|
|
||||||
InputPorts.Add(inputPort);
|
InputPorts.Add(inputPort);
|
||||||
}
|
}
|
||||||
|
|
@ -385,20 +400,21 @@ namespace PepperDash.Essentials.DM {
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Adds InputPort and sets Port as ICec object
|
/// Adds InputPort and sets Port as ICec object
|
||||||
/// </summary>
|
/// </summary>
|
||||||
void AddInputPortWithDebug(uint cardNum, string portName, eRoutingSignalType sigType, eRoutingPortConnectionType portType, ICec cecPort) {
|
private void AddInputPortWithDebug(uint cardNum, string portName, eRoutingSignalType sigType,
|
||||||
|
eRoutingPortConnectionType portType, ICec cecPort)
|
||||||
|
{
|
||||||
var portKey = string.Format("inputCard{0}--{1}", cardNum, portName);
|
var portKey = string.Format("inputCard{0}--{1}", cardNum, portName);
|
||||||
Debug.Console(2, this, "Adding input port '{0}'", portKey);
|
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, cardNum, this)
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = Chassis.Inputs[cardNum]
|
||||||
|
};
|
||||||
|
|
||||||
if (inputPort != null) {
|
|
||||||
if (cecPort != null)
|
if (cecPort != null)
|
||||||
inputPort.Port = cecPort;
|
inputPort.Port = cecPort;
|
||||||
|
|
||||||
InputPorts.Add(inputPort);
|
InputPorts.Add(inputPort);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
Debug.Console(2, this, "inputPort is null");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -407,7 +423,10 @@ namespace PepperDash.Essentials.DM {
|
||||||
void AddOutputPortWithDebug(string cardName, string portName, eRoutingSignalType sigType, eRoutingPortConnectionType portType, object selector) {
|
void AddOutputPortWithDebug(string cardName, string portName, eRoutingSignalType sigType, eRoutingPortConnectionType portType, object selector) {
|
||||||
var portKey = string.Format("{0}--{1}", cardName, portName);
|
var portKey = string.Format("{0}--{1}", cardName, portName);
|
||||||
Debug.Console(2, this, "Adding output port '{0}'", portKey);
|
Debug.Console(2, this, "Adding output port '{0}'", portKey);
|
||||||
OutputPorts.Add(new RoutingOutputPort(portKey, sigType, portType, selector, this));
|
OutputPorts.Add(new RoutingOutputPort(portKey, sigType, portType, selector, this)
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = Chassis.Outputs[(uint)selector]
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -458,52 +477,82 @@ namespace PepperDash.Essentials.DM {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
void Chassis_DMOutputChange(Switch device, DMOutputEventArgs args)
|
private void Chassis_DMOutputChange(Switch device, DMOutputEventArgs args)
|
||||||
{
|
{
|
||||||
var output = args.Number;
|
var output = args.Number;
|
||||||
|
|
||||||
switch (args.EventId) {
|
switch (args.EventId)
|
||||||
case DMOutputEventIds.VolumeEventId: {
|
{
|
||||||
if (VolumeControls.ContainsKey(output)) {
|
case DMOutputEventIds.VolumeEventId:
|
||||||
|
{
|
||||||
|
if (VolumeControls.ContainsKey(output))
|
||||||
|
{
|
||||||
VolumeControls[args.Number].VolumeEventFromChassis();
|
VolumeControls[args.Number].VolumeEventFromChassis();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case DMOutputEventIds.EndpointOnlineEventId: {
|
case DMOutputEventIds.EndpointOnlineEventId:
|
||||||
Debug.Console(2, this, "Output {0} DMOutputEventIds.EndpointOnlineEventId fired. EndpointOnlineFeedback State: {1}", args.Number, Chassis.Outputs[output].EndpointOnlineFeedback);
|
{
|
||||||
if(Chassis.Outputs[output].Endpoint != null)
|
Debug.Console(2, this,
|
||||||
Debug.Console(2, this, "Output {0} DMOutputEventIds.EndpointOnlineEventId fired. Endpoint.IsOnline State: {1}", args.Number, Chassis.Outputs[output].Endpoint.IsOnline);
|
"Output {0} DMOutputEventIds.EndpointOnlineEventId fired. EndpointOnlineFeedback State: {1}",
|
||||||
|
args.Number, Chassis.Outputs[output].EndpointOnlineFeedback);
|
||||||
|
if (Chassis.Outputs[output].Endpoint != null)
|
||||||
|
Debug.Console(2, this,
|
||||||
|
"Output {0} DMOutputEventIds.EndpointOnlineEventId fired. Endpoint.IsOnline State: {1}",
|
||||||
|
args.Number, Chassis.Outputs[output].Endpoint.IsOnline);
|
||||||
|
|
||||||
OutputEndpointOnlineFeedbacks[output].FireUpdate();
|
OutputEndpointOnlineFeedbacks[output].FireUpdate();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case DMOutputEventIds.OnlineFeedbackEventId: {
|
case DMOutputEventIds.OnlineFeedbackEventId:
|
||||||
Debug.Console(2, this, "Output {0} DMInputEventIds.OnlineFeedbackEventId fired. State: {1}", args.Number, Chassis.Outputs[output].EndpointOnlineFeedback);
|
{
|
||||||
|
Debug.Console(2, this, "Output {0} DMInputEventIds.OnlineFeedbackEventId fired. State: {1}",
|
||||||
|
args.Number, Chassis.Outputs[output].EndpointOnlineFeedback);
|
||||||
OutputEndpointOnlineFeedbacks[output].FireUpdate();
|
OutputEndpointOnlineFeedbacks[output].FireUpdate();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case DMOutputEventIds.VideoOutEventId: {
|
case DMOutputEventIds.VideoOutEventId:
|
||||||
if (Chassis.Outputs[output].VideoOutFeedback != null) {
|
{
|
||||||
Debug.Console(2, this, "DMSwitchVideo:{0} Routed Input:{1} Output:{2}'", this.Name, Chassis.Outputs[output].VideoOutFeedback.Number, output);
|
|
||||||
}
|
var inputNumber = Chassis.Outputs[output].VideoOutFeedback == null ? 0 : Chassis.Outputs[output].VideoOutFeedback.Number;
|
||||||
if (VideoOutputFeedbacks.ContainsKey(output)) {
|
|
||||||
|
Debug.Console(2, this, "DMSwitchAudioVideo:{0} Routed Input:{1} Output:{2}'", this.Name,
|
||||||
|
inputNumber, output);
|
||||||
|
|
||||||
|
if (VideoOutputFeedbacks.ContainsKey(output))
|
||||||
|
{
|
||||||
|
var localInputPort = InputPorts.FirstOrDefault(p => (DMInput)p.FeedbackMatchObject == Chassis.Outputs[output].VideoOutFeedback);
|
||||||
|
var localOutputPort =
|
||||||
|
OutputPorts.FirstOrDefault(p => (DMOutput) p.FeedbackMatchObject == Chassis.Outputs[output]);
|
||||||
|
|
||||||
|
|
||||||
VideoOutputFeedbacks[output].FireUpdate();
|
VideoOutputFeedbacks[output].FireUpdate();
|
||||||
|
OnSwitchChange(new RoutingNumericEventArgs(output,
|
||||||
|
inputNumber,
|
||||||
|
localOutputPort,
|
||||||
|
localInputPort,
|
||||||
|
eRoutingSignalType.AudioVideo));
|
||||||
|
|
||||||
}
|
}
|
||||||
if (OutputVideoRouteNameFeedbacks.ContainsKey(output)) {
|
if (OutputVideoRouteNameFeedbacks.ContainsKey(output))
|
||||||
|
{
|
||||||
OutputVideoRouteNameFeedbacks[output].FireUpdate();
|
OutputVideoRouteNameFeedbacks[output].FireUpdate();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case DMOutputEventIds.OutputNameEventId: {
|
case DMOutputEventIds.OutputNameEventId:
|
||||||
|
{
|
||||||
Debug.Console(2, this, "DM Output {0} NameFeedbackEventId", output);
|
Debug.Console(2, this, "DM Output {0} NameFeedbackEventId", output);
|
||||||
OutputNameFeedbacks[output].FireUpdate();
|
OutputNameFeedbacks[output].FireUpdate();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default: {
|
default:
|
||||||
Debug.Console(2, this, "DMOutputChange fired for Output {0} with Unhandled EventId: {1}", args.Number, args.EventId);
|
{
|
||||||
|
Debug.Console(2, this, "DMOutputChange fired for Output {0} with Unhandled EventId: {1}",
|
||||||
|
args.Number, args.EventId);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,12 +21,15 @@ namespace PepperDash.Essentials.DM
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Description("Wrapper class for all DM-MD chassis variants from 8x8 to 32x32")]
|
[Description("Wrapper class for all DM-MD chassis variants from 8x8 to 32x32")]
|
||||||
public class DmChassisController : CrestronGenericBridgeableBaseDevice, IDmSwitch, IRoutingNumeric
|
public class DmChassisController : CrestronGenericBridgeableBaseDevice, IDmSwitch, IRoutingNumericWithFeedback
|
||||||
{
|
{
|
||||||
public DMChassisPropertiesConfig PropertiesConfig { get; set; }
|
public DMChassisPropertiesConfig PropertiesConfig { get; set; }
|
||||||
|
|
||||||
public Switch Chassis { get; private set; }
|
public Switch Chassis { get; private set; }
|
||||||
|
|
||||||
|
//IroutingNumericEvent
|
||||||
|
public event EventHandler<RoutingNumericEventArgs> NumericSwitchChange;
|
||||||
|
|
||||||
// Feedbacks for EssentialDM
|
// Feedbacks for EssentialDM
|
||||||
public Dictionary<uint, IntFeedback> VideoOutputFeedbacks { get; private set; }
|
public Dictionary<uint, IntFeedback> VideoOutputFeedbacks { get; private set; }
|
||||||
public Dictionary<uint, IntFeedback> AudioOutputFeedbacks { get; private set; }
|
public Dictionary<uint, IntFeedback> AudioOutputFeedbacks { get; private set; }
|
||||||
|
|
@ -188,6 +191,7 @@ namespace PepperDash.Essentials.DM
|
||||||
public DmChassisController(string key, string name, DmMDMnxn chassis)
|
public DmChassisController(string key, string name, DmMDMnxn chassis)
|
||||||
: base(key, name, chassis)
|
: base(key, name, chassis)
|
||||||
{
|
{
|
||||||
|
|
||||||
Chassis = chassis;
|
Chassis = chassis;
|
||||||
InputPorts = new RoutingPortCollection<RoutingInputPort>();
|
InputPorts = new RoutingPortCollection<RoutingInputPort>();
|
||||||
OutputPorts = new RoutingPortCollection<RoutingOutputPort>();
|
OutputPorts = new RoutingPortCollection<RoutingOutputPort>();
|
||||||
|
|
@ -737,7 +741,10 @@ namespace PepperDash.Essentials.DM
|
||||||
{
|
{
|
||||||
var portKey = string.Format("inputCard{0}--{1}", cardNum, portName);
|
var portKey = string.Format("inputCard{0}--{1}", cardNum, portName);
|
||||||
Debug.Console(2, this, "Adding input port '{0}'", portKey);
|
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, cardNum, this)
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = Chassis.Inputs[cardNum]
|
||||||
|
};
|
||||||
|
|
||||||
InputPorts.Add(inputPort);
|
InputPorts.Add(inputPort);
|
||||||
}
|
}
|
||||||
|
|
@ -749,7 +756,10 @@ namespace PepperDash.Essentials.DM
|
||||||
{
|
{
|
||||||
var portKey = string.Format("inputCard{0}--{1}", cardNum, portName);
|
var portKey = string.Format("inputCard{0}--{1}", cardNum, portName);
|
||||||
Debug.Console(2, this, "Adding input port '{0}'", portKey);
|
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, cardNum, this)
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = Chassis.Inputs[cardNum]
|
||||||
|
}; ;
|
||||||
|
|
||||||
if (cecPort != null)
|
if (cecPort != null)
|
||||||
inputPort.Port = cecPort;
|
inputPort.Port = cecPort;
|
||||||
|
|
@ -764,7 +774,10 @@ namespace PepperDash.Essentials.DM
|
||||||
{
|
{
|
||||||
var portKey = string.Format("{0}--{1}", cardName, portName);
|
var portKey = string.Format("{0}--{1}", cardName, portName);
|
||||||
Debug.Console(2, this, "Adding output port '{0}'", portKey);
|
Debug.Console(2, this, "Adding output port '{0}'", portKey);
|
||||||
OutputPorts.Add(new RoutingOutputPort(portKey, sigType, portType, selector, this));
|
OutputPorts.Add(new RoutingOutputPort(portKey, sigType, portType, selector, this)
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = Chassis.Outputs[(uint)selector]
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -774,7 +787,10 @@ namespace PepperDash.Essentials.DM
|
||||||
{
|
{
|
||||||
var portKey = string.Format("{0}--{1}", cardName, portName);
|
var portKey = string.Format("{0}--{1}", cardName, portName);
|
||||||
Debug.Console(2, this, "Adding output port '{0}'", portKey);
|
Debug.Console(2, this, "Adding output port '{0}'", portKey);
|
||||||
var outputPort = new RoutingOutputPort(portKey, sigType, portType, selector, this);
|
var outputPort = new RoutingOutputPort(portKey, sigType, portType, selector, this)
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = Chassis.Outputs[(uint)selector]
|
||||||
|
}; ;
|
||||||
|
|
||||||
if (cecPort != null)
|
if (cecPort != null)
|
||||||
outputPort.Port = cecPort;
|
outputPort.Port = cecPort;
|
||||||
|
|
@ -907,6 +923,17 @@ namespace PepperDash.Essentials.DM
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// <summary>
|
||||||
|
/// Raise an event when the status of a switch object changes.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="e">Arguments defined as IKeyName sender, output, input, and eRoutingSignalType</param>
|
||||||
|
private void OnSwitchChange(RoutingNumericEventArgs e)
|
||||||
|
{
|
||||||
|
var newEvent = NumericSwitchChange;
|
||||||
|
if (newEvent != null) newEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
void Chassis_DMOutputChange(Switch device, DMOutputEventArgs args)
|
void Chassis_DMOutputChange(Switch device, DMOutputEventArgs args)
|
||||||
|
|
@ -940,11 +967,26 @@ namespace PepperDash.Essentials.DM
|
||||||
}
|
}
|
||||||
case DMOutputEventIds.VideoOutEventId:
|
case DMOutputEventIds.VideoOutEventId:
|
||||||
{
|
{
|
||||||
if (Chassis.Outputs[output].VideoOutFeedback != null)
|
|
||||||
Debug.Console(2, this, "DMSwitchVideo:{0} Routed Input:{1} Output:{2}'", this.Name, Chassis.Outputs[output].VideoOutFeedback.Number, output);
|
var inputNumber = Chassis.Outputs[output].VideoOutFeedback == null ? 0 : Chassis.
|
||||||
|
Outputs[output].VideoOutFeedback.Number;
|
||||||
|
|
||||||
|
Debug.Console(2, this, "DMSwitchVideo:{0} Routed Input:{1} Output:{2}'", this.Name, inputNumber, output);
|
||||||
|
|
||||||
if (VideoOutputFeedbacks.ContainsKey(output))
|
if (VideoOutputFeedbacks.ContainsKey(output))
|
||||||
|
{
|
||||||
|
var localInputPort = InputPorts.FirstOrDefault(p => (DMInput)p.FeedbackMatchObject == Chassis.Outputs[output].VideoOutFeedback);
|
||||||
|
var localOutputPort =
|
||||||
|
OutputPorts.FirstOrDefault(p => (DMOutput) p.FeedbackMatchObject == Chassis.Outputs[output]);
|
||||||
|
|
||||||
|
|
||||||
VideoOutputFeedbacks[output].FireUpdate();
|
VideoOutputFeedbacks[output].FireUpdate();
|
||||||
|
OnSwitchChange(new RoutingNumericEventArgs(output,
|
||||||
|
inputNumber,
|
||||||
|
localOutputPort,
|
||||||
|
localInputPort,
|
||||||
|
eRoutingSignalType.Video));
|
||||||
|
}
|
||||||
|
|
||||||
if (OutputVideoRouteNameFeedbacks.ContainsKey(output))
|
if (OutputVideoRouteNameFeedbacks.ContainsKey(output))
|
||||||
OutputVideoRouteNameFeedbacks[output].FireUpdate();
|
OutputVideoRouteNameFeedbacks[output].FireUpdate();
|
||||||
|
|
@ -953,11 +995,25 @@ namespace PepperDash.Essentials.DM
|
||||||
}
|
}
|
||||||
case DMOutputEventIds.AudioOutEventId:
|
case DMOutputEventIds.AudioOutEventId:
|
||||||
{
|
{
|
||||||
if (Chassis.Outputs[output].AudioOutFeedback != null)
|
var inputNumber = Chassis.Outputs[output].AudioOutFeedback == null ? 0 : Chassis.
|
||||||
Debug.Console(2, this, "DMSwitchAudio:{0} Routed Input:{1} Output:{2}'", this.Name, Chassis.Outputs[output].AudioOutFeedback.Number, output);
|
Outputs[output].AudioOutFeedback.Number;
|
||||||
|
|
||||||
|
Debug.Console(2, this, "DMSwitchAudio:{0} Routed Input:{1} Output:{2}'", this.Name, inputNumber, output);
|
||||||
|
|
||||||
if (AudioOutputFeedbacks.ContainsKey(output))
|
if (AudioOutputFeedbacks.ContainsKey(output))
|
||||||
|
{
|
||||||
|
var localInputPort = InputPorts.FirstOrDefault(p => (DMInput)p.FeedbackMatchObject == Chassis.Outputs[output].AudioOutFeedback);
|
||||||
|
var localOutputPort =
|
||||||
|
OutputPorts.FirstOrDefault(p => (DMOutput)p.FeedbackMatchObject == Chassis.Outputs[output]);
|
||||||
|
|
||||||
|
|
||||||
AudioOutputFeedbacks[output].FireUpdate();
|
AudioOutputFeedbacks[output].FireUpdate();
|
||||||
|
OnSwitchChange(new RoutingNumericEventArgs(output,
|
||||||
|
inputNumber,
|
||||||
|
localOutputPort,
|
||||||
|
localInputPort,
|
||||||
|
eRoutingSignalType.Audio));
|
||||||
|
}
|
||||||
|
|
||||||
if (OutputAudioRouteNameFeedbacks.ContainsKey(output))
|
if (OutputAudioRouteNameFeedbacks.ContainsKey(output))
|
||||||
OutputAudioRouteNameFeedbacks[output].FireUpdate();
|
OutputAudioRouteNameFeedbacks[output].FireUpdate();
|
||||||
|
|
|
||||||
|
|
@ -19,11 +19,14 @@ using Feedback = PepperDash.Essentials.Core.Feedback;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.DM
|
namespace PepperDash.Essentials.DM
|
||||||
{
|
{
|
||||||
public class DmpsRoutingController : EssentialsBridgeableDevice, IRoutingNumeric, IHasFeedback
|
public class DmpsRoutingController : EssentialsBridgeableDevice, IRoutingNumericWithFeedback, IHasFeedback
|
||||||
{
|
{
|
||||||
public CrestronControlSystem Dmps { get; set; }
|
public CrestronControlSystem Dmps { get; set; }
|
||||||
public ISystemControl SystemControl { get; private set; }
|
public ISystemControl SystemControl { get; private set; }
|
||||||
|
|
||||||
|
//IroutingNumericEvent
|
||||||
|
public event EventHandler<RoutingNumericEventArgs> NumericSwitchChange;
|
||||||
|
|
||||||
// Feedbacks for EssentialDM
|
// Feedbacks for EssentialDM
|
||||||
public Dictionary<uint, IntFeedback> VideoOutputFeedbacks { get; private set; }
|
public Dictionary<uint, IntFeedback> VideoOutputFeedbacks { get; private set; }
|
||||||
public Dictionary<uint, IntFeedback> AudioOutputFeedbacks { get; private set; }
|
public Dictionary<uint, IntFeedback> AudioOutputFeedbacks { get; private set; }
|
||||||
|
|
@ -56,11 +59,23 @@ namespace PepperDash.Essentials.DM
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string NoRouteText = "";
|
public string NoRouteText = "";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Raise an event when the status of a switch object changes.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="e">Arguments defined as IKeyName sender, output, input, and eRoutingSignalType</param>
|
||||||
|
private void OnSwitchChange(RoutingNumericEventArgs e)
|
||||||
|
{
|
||||||
|
var newEvent = NumericSwitchChange;
|
||||||
|
if (newEvent != null) newEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public static DmpsRoutingController GetDmpsRoutingController(string key, string name,
|
public static DmpsRoutingController GetDmpsRoutingController(string key, string name,
|
||||||
DmpsRoutingPropertiesConfig properties)
|
DmpsRoutingPropertiesConfig properties)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
||||||
ISystemControl systemControl = null;
|
ISystemControl systemControl = null;
|
||||||
|
|
||||||
systemControl = Global.ControlSystem.SystemControl as ISystemControl;
|
systemControl = Global.ControlSystem.SystemControl as ISystemControl;
|
||||||
|
|
@ -513,11 +528,16 @@ namespace PepperDash.Essentials.DM
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Adds InputPort
|
/// Adds InputPort
|
||||||
/// </summary>
|
/// </summary>
|
||||||
void AddInputPortWithDebug(uint cardNum, string portName, eRoutingSignalType sigType, eRoutingPortConnectionType portType)
|
private void AddInputPortWithDebug(uint cardNum, string portName, eRoutingSignalType sigType,
|
||||||
|
eRoutingPortConnectionType portType)
|
||||||
{
|
{
|
||||||
var portKey = string.Format("inputCard{0}--{1}", cardNum, portName);
|
var portKey = string.Format("inputCard{0}--{1}", cardNum, portName);
|
||||||
Debug.Console(2, this, "Adding input port '{0}'", portKey);
|
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, cardNum, this)
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = Dmps.SwitcherInputs[cardNum]
|
||||||
|
};
|
||||||
|
;
|
||||||
|
|
||||||
InputPorts.Add(inputPort);
|
InputPorts.Add(inputPort);
|
||||||
}
|
}
|
||||||
|
|
@ -529,7 +549,11 @@ namespace PepperDash.Essentials.DM
|
||||||
{
|
{
|
||||||
var portKey = string.Format("inputCard{0}--{1}", cardNum, portName);
|
var portKey = string.Format("inputCard{0}--{1}", cardNum, portName);
|
||||||
Debug.Console(2, this, "Adding input port '{0}'", portKey);
|
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, cardNum, this)
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = Dmps.SwitcherInputs[cardNum]
|
||||||
|
};
|
||||||
|
;
|
||||||
|
|
||||||
if (cecPort != null)
|
if (cecPort != null)
|
||||||
inputPort.Port = cecPort;
|
inputPort.Port = cecPort;
|
||||||
|
|
@ -537,6 +561,7 @@ namespace PepperDash.Essentials.DM
|
||||||
InputPorts.Add(inputPort);
|
InputPorts.Add(inputPort);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Builds the appropriate ports and calls the appropriate add port method
|
/// Builds the appropriate ports and calls the appropriate add port method
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -676,7 +701,10 @@ namespace PepperDash.Essentials.DM
|
||||||
{
|
{
|
||||||
var portKey = string.Format("outputCard{0}--{1}", cardNum, portName);
|
var portKey = string.Format("outputCard{0}--{1}", cardNum, portName);
|
||||||
Debug.Console(2, this, "Adding output port '{0}'", portKey);
|
Debug.Console(2, this, "Adding output port '{0}'", portKey);
|
||||||
OutputPorts.Add(new RoutingOutputPort(portKey, sigType, portType, selector, this));
|
OutputPorts.Add(new RoutingOutputPort(portKey, sigType, portType, selector, this)
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = Dmps.SwitcherOutputs[cardNum]
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -686,7 +714,10 @@ namespace PepperDash.Essentials.DM
|
||||||
{
|
{
|
||||||
var portKey = string.Format("outputCard{0}--{1}", cardNum, portName);
|
var portKey = string.Format("outputCard{0}--{1}", cardNum, portName);
|
||||||
Debug.Console(2, this, "Adding output port '{0}'", portKey);
|
Debug.Console(2, this, "Adding output port '{0}'", portKey);
|
||||||
var outputPort = new RoutingOutputPort(portKey, sigType, portType, selector, this);
|
var outputPort = new RoutingOutputPort(portKey, sigType, portType, selector, this)
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = Dmps.SwitcherOutputs[cardNum]
|
||||||
|
};
|
||||||
|
|
||||||
if (cecPort != null)
|
if (cecPort != null)
|
||||||
outputPort.Port = cecPort;
|
outputPort.Port = cecPort;
|
||||||
|
|
|
||||||
|
|
@ -16,11 +16,14 @@ using PepperDash.Essentials.Core.Config;
|
||||||
namespace PepperDash.Essentials.DM.Chassis
|
namespace PepperDash.Essentials.DM.Chassis
|
||||||
{
|
{
|
||||||
[Description("Wrapper class for all HdMdNxM4E switchers")]
|
[Description("Wrapper class for all HdMdNxM4E switchers")]
|
||||||
public class HdMdNxM4kEBridgeableController : CrestronGenericBridgeableBaseDevice, IRoutingInputsOutputs, IRoutingNumeric, IHasFeedback
|
public class HdMdNxM4kEBridgeableController : CrestronGenericBridgeableBaseDevice, IRoutingNumericWithFeedback, IHasFeedback
|
||||||
{
|
{
|
||||||
private HdMdNxM _Chassis;
|
private HdMdNxM _Chassis;
|
||||||
private HdMd4x14kE _Chassis4x1;
|
private HdMd4x14kE _Chassis4x1;
|
||||||
|
|
||||||
|
//IroutingNumericEvent
|
||||||
|
public event EventHandler<RoutingNumericEventArgs> NumericSwitchChange;
|
||||||
|
|
||||||
public Dictionary<uint, string> InputNames { get; set; }
|
public Dictionary<uint, string> InputNames { get; set; }
|
||||||
public Dictionary<uint, string> OutputNames { get; set; }
|
public Dictionary<uint, string> OutputNames { get; set; }
|
||||||
|
|
||||||
|
|
@ -70,26 +73,34 @@ namespace PepperDash.Essentials.DM.Chassis
|
||||||
|
|
||||||
for (uint i = 1; i <= _Chassis.NumberOfInputs; i++)
|
for (uint i = 1; i <= _Chassis.NumberOfInputs; i++)
|
||||||
{
|
{
|
||||||
var inputName = InputNames[i];
|
var index = i;
|
||||||
_Chassis.Inputs[i].Name.StringValue = inputName;
|
var inputName = InputNames[index];
|
||||||
|
_Chassis.Inputs[index].Name.StringValue = inputName;
|
||||||
|
|
||||||
InputPorts.Add(new RoutingInputPort(inputName, eRoutingSignalType.AudioVideo,
|
InputPorts.Add(new RoutingInputPort(inputName, eRoutingSignalType.AudioVideo,
|
||||||
eRoutingPortConnectionType.Hdmi, i, this));
|
eRoutingPortConnectionType.Hdmi, index, this)
|
||||||
VideoInputSyncFeedbacks.Add(new BoolFeedback(inputName, () => _Chassis.Inputs[i].VideoDetectedFeedback.BoolValue));
|
{
|
||||||
InputNameFeedbacks.Add(new StringFeedback(inputName, () => _Chassis.Inputs[i].Name.StringValue));
|
FeedbackMatchObject = _Chassis.HdmiInputs[index]
|
||||||
InputHdcpEnableFeedback.Add(new BoolFeedback(inputName, () => _Chassis.HdmiInputs[i].HdmiInputPort.HdcpSupportOnFeedback.BoolValue));
|
});
|
||||||
|
VideoInputSyncFeedbacks.Add(new BoolFeedback(inputName, () => _Chassis.Inputs[index].VideoDetectedFeedback.BoolValue));
|
||||||
|
InputNameFeedbacks.Add(new StringFeedback(inputName, () => _Chassis.Inputs[index].Name.StringValue));
|
||||||
|
InputHdcpEnableFeedback.Add(new BoolFeedback(inputName, () => _Chassis.HdmiInputs[index].HdmiInputPort.HdcpSupportOnFeedback.BoolValue));
|
||||||
}
|
}
|
||||||
|
|
||||||
for (uint i = 1; i <= _Chassis.NumberOfOutputs; i++)
|
for (uint i = 1; i <= _Chassis.NumberOfOutputs; i++)
|
||||||
{
|
{
|
||||||
var outputName = OutputNames[i];
|
var index = i;
|
||||||
|
var outputName = OutputNames[index];
|
||||||
_Chassis.Outputs[i].Name.StringValue = outputName;
|
_Chassis.Outputs[i].Name.StringValue = outputName;
|
||||||
|
|
||||||
OutputPorts.Add(new RoutingOutputPort(outputName, eRoutingSignalType.AudioVideo,
|
OutputPorts.Add(new RoutingOutputPort(outputName, eRoutingSignalType.AudioVideo,
|
||||||
eRoutingPortConnectionType.Hdmi, i, this));
|
eRoutingPortConnectionType.Hdmi, index, this)
|
||||||
VideoOutputRouteFeedbacks.Add(new IntFeedback(outputName, () => (int)_Chassis.Outputs[i].VideoOutFeedback.Number));
|
{
|
||||||
OutputNameFeedbacks.Add(new StringFeedback(outputName, () => _Chassis.Outputs[i].Name.StringValue));
|
FeedbackMatchObject = _Chassis.HdmiOutputs[index]
|
||||||
OutputRouteNameFeedbacks.Add(new StringFeedback(outputName, () => _Chassis.Outputs[i].VideoOutFeedback.NameFeedback.StringValue));
|
});
|
||||||
|
VideoOutputRouteFeedbacks.Add(new IntFeedback(outputName, () => (int)_Chassis.Outputs[index].VideoOutFeedback.Number));
|
||||||
|
OutputNameFeedbacks.Add(new StringFeedback(outputName, () => _Chassis.Outputs[index].Name.StringValue));
|
||||||
|
OutputRouteNameFeedbacks.Add(new StringFeedback(outputName, () => _Chassis.Outputs[index].VideoOutFeedback.NameFeedback.StringValue));
|
||||||
}
|
}
|
||||||
|
|
||||||
_Chassis.DMInputChange += new DMInputEventHandler(Chassis_DMInputChange);
|
_Chassis.DMInputChange += new DMInputEventHandler(Chassis_DMInputChange);
|
||||||
|
|
@ -102,6 +113,16 @@ namespace PepperDash.Essentials.DM.Chassis
|
||||||
|
|
||||||
#region Methods
|
#region Methods
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Raise an event when the status of a switch object changes.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="e">Arguments defined as IKeyName sender, output, input, and eRoutingSignalType</param>
|
||||||
|
private void OnSwitchChange(RoutingNumericEventArgs e)
|
||||||
|
{
|
||||||
|
var newEvent = NumericSwitchChange;
|
||||||
|
if (newEvent != null) newEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
public void EnableHdcp(uint port)
|
public void EnableHdcp(uint port)
|
||||||
{
|
{
|
||||||
if (port > _Chassis.NumberOfInputs) return;
|
if (port > _Chassis.NumberOfInputs) return;
|
||||||
|
|
@ -328,8 +349,7 @@ namespace PepperDash.Essentials.DM.Chassis
|
||||||
|
|
||||||
void Chassis_OnlineStatusChange(Crestron.SimplSharpPro.GenericBase currentDevice, Crestron.SimplSharpPro.OnlineOfflineEventArgs args)
|
void Chassis_OnlineStatusChange(Crestron.SimplSharpPro.GenericBase currentDevice, Crestron.SimplSharpPro.OnlineOfflineEventArgs args)
|
||||||
{
|
{
|
||||||
if (args.DeviceOnLine)
|
if (!args.DeviceOnLine) return;
|
||||||
{
|
|
||||||
for (uint i = 1; i <= _Chassis.NumberOfInputs; i++)
|
for (uint i = 1; i <= _Chassis.NumberOfInputs; i++)
|
||||||
{
|
{
|
||||||
_Chassis.Inputs[i].Name.StringValue = InputNames[i];
|
_Chassis.Inputs[i].Name.StringValue = InputNames[i];
|
||||||
|
|
@ -345,29 +365,31 @@ namespace PepperDash.Essentials.DM.Chassis
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void Chassis_DMOutputChange(Switch device, DMOutputEventArgs args)
|
void Chassis_DMOutputChange(Switch device, DMOutputEventArgs args)
|
||||||
{
|
{
|
||||||
if (args.EventId == DMOutputEventIds.VideoOutEventId)
|
if (args.EventId != DMOutputEventIds.VideoOutEventId) return;
|
||||||
|
|
||||||
|
for (var i = 0; i < VideoOutputRouteFeedbacks.Count; i++)
|
||||||
{
|
{
|
||||||
foreach (var item in VideoOutputRouteFeedbacks)
|
var index = i;
|
||||||
{
|
var localInputPort = InputPorts.FirstOrDefault(p => (DMInput)p.FeedbackMatchObject == _Chassis.HdmiOutputs[(uint)index + 1].VideoOutFeedback);
|
||||||
item.FireUpdate();
|
var localOutputPort =
|
||||||
}
|
OutputPorts.FirstOrDefault(p => (DMOutput)p.FeedbackMatchObject == _Chassis.HdmiOutputs[(uint)index + 1]);
|
||||||
|
|
||||||
|
|
||||||
|
VideoOutputRouteFeedbacks[i].FireUpdate();
|
||||||
|
OnSwitchChange(new RoutingNumericEventArgs((ushort)i, VideoOutputRouteFeedbacks[i].UShortValue, localOutputPort, localInputPort, eRoutingSignalType.AudioVideo));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Chassis_DMInputChange(Switch device, DMInputEventArgs args)
|
void Chassis_DMInputChange(Switch device, DMInputEventArgs args)
|
||||||
{
|
{
|
||||||
if (args.EventId == DMInputEventIds.VideoDetectedEventId)
|
if (args.EventId != DMInputEventIds.VideoDetectedEventId) return;
|
||||||
{
|
|
||||||
foreach (var item in VideoInputSyncFeedbacks)
|
foreach (var item in VideoInputSyncFeedbacks)
|
||||||
{
|
{
|
||||||
item.FireUpdate();
|
item.FireUpdate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ using PepperDash.Core;
|
||||||
namespace PepperDash.Essentials.DM
|
namespace PepperDash.Essentials.DM
|
||||||
{
|
{
|
||||||
[Description("Wrapper Class for DM-RMC-4K-Z-SCALER-C")]
|
[Description("Wrapper Class for DM-RMC-4K-Z-SCALER-C")]
|
||||||
public class DmRmc4kZScalerCController : DmRmcControllerBase, IRmcRouting,
|
public class DmRmc4kZScalerCController : DmRmcControllerBase, IRmcRoutingWithFeedback,
|
||||||
IIROutputPorts, IComPorts, ICec
|
IIROutputPorts, IComPorts, ICec
|
||||||
{
|
{
|
||||||
private readonly DmRmc4kzScalerC _rmc;
|
private readonly DmRmc4kzScalerC _rmc;
|
||||||
|
|
@ -31,14 +31,34 @@ namespace PepperDash.Essentials.DM
|
||||||
|
|
||||||
public RoutingPortCollection<RoutingOutputPort> OutputPorts { get; private set; }
|
public RoutingPortCollection<RoutingOutputPort> OutputPorts { get; private set; }
|
||||||
|
|
||||||
|
//IroutingNumericEvent
|
||||||
|
public event EventHandler<RoutingNumericEventArgs> NumericSwitchChange;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Raise an event when the status of a switch object changes.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="e">Arguments defined as IKeyName sender, output, input, and eRoutingSignalType</param>
|
||||||
|
private void OnSwitchChange(RoutingNumericEventArgs e)
|
||||||
|
{
|
||||||
|
var newEvent = NumericSwitchChange;
|
||||||
|
if (newEvent != null) newEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public DmRmc4kZScalerCController(string key, string name, DmRmc4kzScalerC rmc)
|
public DmRmc4kZScalerCController(string key, string name, DmRmc4kzScalerC rmc)
|
||||||
: base(key, name, rmc)
|
: base(key, name, rmc)
|
||||||
{
|
{
|
||||||
_rmc = rmc;
|
_rmc = rmc;
|
||||||
DmIn = new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.AudioVideo,
|
DmIn = new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.AudioVideo,
|
||||||
eRoutingPortConnectionType.DmCat, 0, this);
|
eRoutingPortConnectionType.DmCat, 0, this)
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = 1
|
||||||
|
};
|
||||||
HdmiIn = new RoutingInputPort(DmPortName.HdmiIn, eRoutingSignalType.AudioVideo,
|
HdmiIn = new RoutingInputPort(DmPortName.HdmiIn, eRoutingSignalType.AudioVideo,
|
||||||
eRoutingPortConnectionType.Hdmi, 0, this);
|
eRoutingPortConnectionType.Hdmi, 0, this)
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = 2
|
||||||
|
};
|
||||||
HdmiOut = new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.AudioVideo,
|
HdmiOut = new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.AudioVideo,
|
||||||
eRoutingPortConnectionType.Hdmi, null, this);
|
eRoutingPortConnectionType.Hdmi, null, this);
|
||||||
|
|
||||||
|
|
@ -55,12 +75,20 @@ namespace PepperDash.Essentials.DM
|
||||||
_rmc.HdmiOutput.OutputStreamChange += HdmiOutput_OutputStreamChange;
|
_rmc.HdmiOutput.OutputStreamChange += HdmiOutput_OutputStreamChange;
|
||||||
_rmc.HdmiOutput.ConnectedDevice.DeviceInformationChange += ConnectedDevice_DeviceInformationChange;
|
_rmc.HdmiOutput.ConnectedDevice.DeviceInformationChange += ConnectedDevice_DeviceInformationChange;
|
||||||
|
|
||||||
|
_rmc.OnlineStatusChange += _rmc_OnlineStatusChange;
|
||||||
|
|
||||||
// Set Ports for CEC
|
// Set Ports for CEC
|
||||||
HdmiOut.Port = _rmc.HdmiOutput;
|
HdmiOut.Port = _rmc.HdmiOutput;
|
||||||
|
|
||||||
AudioVideoSourceNumericFeedback = new IntFeedback(() => (ushort)(_rmc.SelectedSourceFeedback));
|
AudioVideoSourceNumericFeedback = new IntFeedback(() => (ushort)(_rmc.SelectedSourceFeedback));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void _rmc_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args)
|
||||||
|
{
|
||||||
|
AudioVideoSourceNumericFeedback.FireUpdate();
|
||||||
|
OnSwitchChange(new RoutingNumericEventArgs(1, AudioVideoSourceNumericFeedback.UShortValue, eRoutingSignalType.AudioVideo));
|
||||||
|
}
|
||||||
|
|
||||||
void HdmiOutput_OutputStreamChange(EndpointOutputStream outputStream, EndpointOutputStreamEventArgs args)
|
void HdmiOutput_OutputStreamChange(EndpointOutputStream outputStream, EndpointOutputStreamEventArgs args)
|
||||||
{
|
{
|
||||||
if (args.EventId == EndpointOutputStreamEventIds.HorizontalResolutionFeedbackEventId || args.EventId == EndpointOutputStreamEventIds.VerticalResolutionFeedbackEventId ||
|
if (args.EventId == EndpointOutputStreamEventIds.HorizontalResolutionFeedbackEventId || args.EventId == EndpointOutputStreamEventIds.VerticalResolutionFeedbackEventId ||
|
||||||
|
|
@ -71,7 +99,12 @@ namespace PepperDash.Essentials.DM
|
||||||
|
|
||||||
if (args.EventId == EndpointOutputStreamEventIds.SelectedSourceFeedbackEventId)
|
if (args.EventId == EndpointOutputStreamEventIds.SelectedSourceFeedbackEventId)
|
||||||
{
|
{
|
||||||
|
var localInputPort =
|
||||||
|
InputPorts.FirstOrDefault(p => (int)p.FeedbackMatchObject == AudioVideoSourceNumericFeedback.UShortValue);
|
||||||
|
|
||||||
|
|
||||||
AudioVideoSourceNumericFeedback.FireUpdate();
|
AudioVideoSourceNumericFeedback.FireUpdate();
|
||||||
|
OnSwitchChange(new RoutingNumericEventArgs(1, AudioVideoSourceNumericFeedback.UShortValue, OutputPorts.First(), localInputPort, eRoutingSignalType.AudioVideo));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
using System;
|
using System;
|
||||||
|
using System.Linq;
|
||||||
using Crestron.SimplSharpPro;
|
using Crestron.SimplSharpPro;
|
||||||
using Crestron.SimplSharpPro.DeviceSupport;
|
using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
using Crestron.SimplSharpPro.DM;
|
using Crestron.SimplSharpPro.DM;
|
||||||
|
|
@ -17,7 +18,7 @@ namespace PepperDash.Essentials.DM
|
||||||
/// Controller class for all DM-TX-201C/S/F transmitters
|
/// Controller class for all DM-TX-201C/S/F transmitters
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Description("Wrapper class for DM-TX-200-C")]
|
[Description("Wrapper class for DM-TX-200-C")]
|
||||||
public class DmTx200Controller : DmTxControllerBase, ITxRouting, IHasFreeRun, IVgaBrightnessContrastControls
|
public class DmTx200Controller : DmTxControllerBase, ITxRoutingWithFeedback, IHasFreeRun, IVgaBrightnessContrastControls
|
||||||
{
|
{
|
||||||
public DmTx200C2G Tx { get; private set; }
|
public DmTx200C2G Tx { get; private set; }
|
||||||
|
|
||||||
|
|
@ -37,6 +38,20 @@ namespace PepperDash.Essentials.DM
|
||||||
public IntFeedback VgaBrightnessFeedback { get; protected set; }
|
public IntFeedback VgaBrightnessFeedback { get; protected set; }
|
||||||
public IntFeedback VgaContrastFeedback { get; protected set; }
|
public IntFeedback VgaContrastFeedback { get; protected set; }
|
||||||
|
|
||||||
|
//IroutingNumericEvent
|
||||||
|
public event EventHandler<RoutingNumericEventArgs> NumericSwitchChange;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Raise an event when the status of a switch object changes.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="e">Arguments defined as IKeyName sender, output, input, and eRoutingSignalType</param>
|
||||||
|
private void OnSwitchChange(RoutingNumericEventArgs e)
|
||||||
|
{
|
||||||
|
var newEvent = NumericSwitchChange;
|
||||||
|
if (newEvent != null) newEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Helps get the "real" inputs, including when in Auto
|
/// Helps get the "real" inputs, including when in Auto
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -88,11 +103,19 @@ namespace PepperDash.Essentials.DM
|
||||||
Tx = tx;
|
Tx = tx;
|
||||||
|
|
||||||
HdmiInput = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn,
|
HdmiInput = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn,
|
||||||
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, DmTx200Base.eSourceSelection.Digital, this,
|
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi,
|
||||||
VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInput));
|
DmTx200Base.eSourceSelection.Digital, this,
|
||||||
|
VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInput))
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = DmTx200Base.eSourceSelection.Digital
|
||||||
|
};
|
||||||
|
|
||||||
VgaInput = new RoutingInputPortWithVideoStatuses(DmPortName.VgaIn,
|
VgaInput = new RoutingInputPortWithVideoStatuses(DmPortName.VgaIn,
|
||||||
eRoutingSignalType.Video, eRoutingPortConnectionType.Vga, DmTx200Base.eSourceSelection.Analog, this,
|
eRoutingSignalType.Video, eRoutingPortConnectionType.Vga, DmTx200Base.eSourceSelection.Analog, this,
|
||||||
VideoStatusHelper.GetVgaInputStatusFuncs(tx.VgaInput));
|
VideoStatusHelper.GetVgaInputStatusFuncs(tx.VgaInput))
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = DmTx200Base.eSourceSelection.Analog
|
||||||
|
};
|
||||||
|
|
||||||
ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput",
|
ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput",
|
||||||
() => ActualActiveVideoInput.ToString());
|
() => ActualActiveVideoInput.ToString());
|
||||||
|
|
@ -197,10 +220,17 @@ namespace PepperDash.Essentials.DM
|
||||||
|
|
||||||
void Tx_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args)
|
void Tx_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args)
|
||||||
{
|
{
|
||||||
|
var localVideoInputPort =
|
||||||
|
InputPorts.FirstOrDefault(p => (DmTx200Base.eSourceSelection) p.Selector == Tx.VideoSourceFeedback);
|
||||||
|
var localAudioInputPort =
|
||||||
|
InputPorts.FirstOrDefault(p => (DmTx200Base.eSourceSelection) p.Selector == Tx.AudioSourceFeedback);
|
||||||
|
|
||||||
|
|
||||||
ActiveVideoInputFeedback.FireUpdate();
|
ActiveVideoInputFeedback.FireUpdate();
|
||||||
VideoSourceNumericFeedback.FireUpdate();
|
VideoSourceNumericFeedback.FireUpdate();
|
||||||
AudioSourceNumericFeedback.FireUpdate();
|
AudioSourceNumericFeedback.FireUpdate();
|
||||||
|
OnSwitchChange(new RoutingNumericEventArgs(1, VideoSourceNumericFeedback.UShortValue, OutputPorts.First(), localVideoInputPort, eRoutingSignalType.Video));
|
||||||
|
OnSwitchChange(new RoutingNumericEventArgs(1, AudioSourceNumericFeedback.UShortValue, OutputPorts.First(), localAudioInputPort, eRoutingSignalType.Audio));
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool CustomActivate()
|
public override bool CustomActivate()
|
||||||
|
|
@ -304,13 +334,17 @@ namespace PepperDash.Essentials.DM
|
||||||
switch (id)
|
switch (id)
|
||||||
{
|
{
|
||||||
case EndpointTransmitterBase.VideoSourceFeedbackEventId:
|
case EndpointTransmitterBase.VideoSourceFeedbackEventId:
|
||||||
|
var localVideoInputPort = InputPorts.FirstOrDefault(p => (DmTx200Base.eSourceSelection)p.Selector == Tx.VideoSourceFeedback);
|
||||||
Debug.Console(2, this, " Video Source: {0}", Tx.VideoSourceFeedback);
|
Debug.Console(2, this, " Video Source: {0}", Tx.VideoSourceFeedback);
|
||||||
VideoSourceNumericFeedback.FireUpdate();
|
VideoSourceNumericFeedback.FireUpdate();
|
||||||
ActiveVideoInputFeedback.FireUpdate();
|
ActiveVideoInputFeedback.FireUpdate();
|
||||||
|
OnSwitchChange(new RoutingNumericEventArgs(1, VideoSourceNumericFeedback.UShortValue, OutputPorts.First(), localVideoInputPort, eRoutingSignalType.Video));
|
||||||
break;
|
break;
|
||||||
case EndpointTransmitterBase.AudioSourceFeedbackEventId:
|
case EndpointTransmitterBase.AudioSourceFeedbackEventId:
|
||||||
|
var localInputAudioPort = InputPorts.FirstOrDefault(p => (DmTx200Base.eSourceSelection)p.Selector == Tx.AudioSourceFeedback);
|
||||||
Debug.Console(2, this, " Audio Source: {0}", Tx.AudioSourceFeedback);
|
Debug.Console(2, this, " Audio Source: {0}", Tx.AudioSourceFeedback);
|
||||||
AudioSourceNumericFeedback.FireUpdate();
|
AudioSourceNumericFeedback.FireUpdate();
|
||||||
|
OnSwitchChange(new RoutingNumericEventArgs(1, AudioSourceNumericFeedback.UShortValue, OutputPorts.First(), localInputAudioPort, eRoutingSignalType.Audio));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
using Crestron.SimplSharpPro.DM;
|
using Crestron.SimplSharpPro.DM;
|
||||||
using Crestron.SimplSharpPro.DM.Endpoints;
|
using Crestron.SimplSharpPro.DM.Endpoints;
|
||||||
using Crestron.SimplSharpPro.DM.Endpoints.Transmitters;
|
using Crestron.SimplSharpPro.DM.Endpoints.Transmitters;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
|
|
@ -15,7 +16,7 @@ namespace PepperDash.Essentials.DM
|
||||||
/// Controller class for all DM-TX-201C/S/F transmitters
|
/// Controller class for all DM-TX-201C/S/F transmitters
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Description("Wrapper class for DM-TX-201-C")]
|
[Description("Wrapper class for DM-TX-201-C")]
|
||||||
public class DmTx201CController : DmTxControllerBase, ITxRouting, IHasFreeRun, IVgaBrightnessContrastControls
|
public class DmTx201CController : DmTxControllerBase, ITxRoutingWithFeedback, IHasFreeRun, IVgaBrightnessContrastControls
|
||||||
{
|
{
|
||||||
public DmTx201C Tx { get; private set; }
|
public DmTx201C Tx { get; private set; }
|
||||||
|
|
||||||
|
|
@ -36,6 +37,19 @@ namespace PepperDash.Essentials.DM
|
||||||
public IntFeedback VgaBrightnessFeedback { get; protected set; }
|
public IntFeedback VgaBrightnessFeedback { get; protected set; }
|
||||||
public IntFeedback VgaContrastFeedback { get; protected set; }
|
public IntFeedback VgaContrastFeedback { get; protected set; }
|
||||||
|
|
||||||
|
//IroutingNumericEvent
|
||||||
|
public event EventHandler<RoutingNumericEventArgs> NumericSwitchChange;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Raise an event when the status of a switch object changes.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="e">Arguments defined as IKeyName sender, output, input, and eRoutingSignalType</param>
|
||||||
|
private void OnSwitchChange(RoutingNumericEventArgs e)
|
||||||
|
{
|
||||||
|
var newEvent = NumericSwitchChange;
|
||||||
|
if (newEvent != null) newEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Helps get the "real" inputs, including when in Auto
|
/// Helps get the "real" inputs, including when in Auto
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -92,11 +106,19 @@ namespace PepperDash.Essentials.DM
|
||||||
Tx = tx;
|
Tx = tx;
|
||||||
|
|
||||||
HdmiInput = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn,
|
HdmiInput = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn,
|
||||||
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, DmTx200Base.eSourceSelection.Digital, this,
|
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi,
|
||||||
VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInput));
|
DmTx200Base.eSourceSelection.Digital, this,
|
||||||
|
VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInput))
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = DmTx200Base.eSourceSelection.Digital
|
||||||
|
};
|
||||||
|
|
||||||
VgaInput = new RoutingInputPortWithVideoStatuses(DmPortName.VgaIn,
|
VgaInput = new RoutingInputPortWithVideoStatuses(DmPortName.VgaIn,
|
||||||
eRoutingSignalType.Video, eRoutingPortConnectionType.Vga, DmTx200Base.eSourceSelection.Analog, this,
|
eRoutingSignalType.Video, eRoutingPortConnectionType.Vga, DmTx200Base.eSourceSelection.Analog, this,
|
||||||
VideoStatusHelper.GetVgaInputStatusFuncs(tx.VgaInput));
|
VideoStatusHelper.GetVgaInputStatusFuncs(tx.VgaInput))
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = DmTx200Base.eSourceSelection.Analog
|
||||||
|
};
|
||||||
|
|
||||||
ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput",
|
ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput",
|
||||||
() => ActualActiveVideoInput.ToString());
|
() => ActualActiveVideoInput.ToString());
|
||||||
|
|
@ -194,10 +216,17 @@ namespace PepperDash.Essentials.DM
|
||||||
|
|
||||||
void Tx_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args)
|
void Tx_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args)
|
||||||
{
|
{
|
||||||
|
var localVideoInputPort =
|
||||||
|
InputPorts.FirstOrDefault(p => (DmTx200Base.eSourceSelection)p.Selector == Tx.VideoSourceFeedback);
|
||||||
|
var localAudioInputPort =
|
||||||
|
InputPorts.FirstOrDefault(p => (DmTx200Base.eSourceSelection)p.Selector == Tx.AudioSourceFeedback);
|
||||||
|
|
||||||
|
|
||||||
ActiveVideoInputFeedback.FireUpdate();
|
ActiveVideoInputFeedback.FireUpdate();
|
||||||
VideoSourceNumericFeedback.FireUpdate();
|
VideoSourceNumericFeedback.FireUpdate();
|
||||||
AudioSourceNumericFeedback.FireUpdate();
|
AudioSourceNumericFeedback.FireUpdate();
|
||||||
|
OnSwitchChange(new RoutingNumericEventArgs(1, VideoSourceNumericFeedback.UShortValue, OutputPorts.First(), localVideoInputPort, eRoutingSignalType.Video));
|
||||||
|
OnSwitchChange(new RoutingNumericEventArgs(1, AudioSourceNumericFeedback.UShortValue, OutputPorts.First(), localAudioInputPort, eRoutingSignalType.Audio));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void VgaInputOnInputStreamChange(EndpointInputStream inputStream, EndpointInputStreamEventArgs args)
|
private void VgaInputOnInputStreamChange(EndpointInputStream inputStream, EndpointInputStreamEventArgs args)
|
||||||
|
|
@ -319,14 +348,17 @@ namespace PepperDash.Essentials.DM
|
||||||
switch (id)
|
switch (id)
|
||||||
{
|
{
|
||||||
case EndpointTransmitterBase.VideoSourceFeedbackEventId:
|
case EndpointTransmitterBase.VideoSourceFeedbackEventId:
|
||||||
|
var localVideoInputPort = InputPorts.FirstOrDefault(p => (DmTx200Base.eSourceSelection)p.Selector == Tx.VideoSourceFeedback);
|
||||||
Debug.Console(2, this, " Video Source: {0}", Tx.VideoSourceFeedback);
|
Debug.Console(2, this, " Video Source: {0}", Tx.VideoSourceFeedback);
|
||||||
ActiveVideoInputFeedback.FireUpdate();
|
|
||||||
VideoSourceNumericFeedback.FireUpdate();
|
VideoSourceNumericFeedback.FireUpdate();
|
||||||
ActiveVideoInputFeedback.FireUpdate();
|
ActiveVideoInputFeedback.FireUpdate();
|
||||||
|
OnSwitchChange(new RoutingNumericEventArgs(1, VideoSourceNumericFeedback.UShortValue, OutputPorts.First(), localVideoInputPort, eRoutingSignalType.Video));
|
||||||
break;
|
break;
|
||||||
case EndpointTransmitterBase.AudioSourceFeedbackEventId:
|
case EndpointTransmitterBase.AudioSourceFeedbackEventId:
|
||||||
Debug.Console(2, this, " Audio Source : {0}", Tx.AudioSourceFeedback);
|
var localInputAudioPort = InputPorts.FirstOrDefault(p => (DmTx200Base.eSourceSelection)p.Selector == Tx.AudioSourceFeedback);
|
||||||
|
Debug.Console(2, this, " Audio Source: {0}", Tx.AudioSourceFeedback);
|
||||||
AudioSourceNumericFeedback.FireUpdate();
|
AudioSourceNumericFeedback.FireUpdate();
|
||||||
|
OnSwitchChange(new RoutingNumericEventArgs(1, AudioSourceNumericFeedback.UShortValue, OutputPorts.First(), localInputAudioPort, eRoutingSignalType.Audio));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
using Crestron.SimplSharpPro.DM;
|
using Crestron.SimplSharpPro.DM;
|
||||||
using Crestron.SimplSharpPro.DM.Endpoints;
|
using Crestron.SimplSharpPro.DM.Endpoints;
|
||||||
using Crestron.SimplSharpPro.DM.Endpoints.Transmitters;
|
using Crestron.SimplSharpPro.DM.Endpoints.Transmitters;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
|
|
@ -15,7 +16,7 @@ namespace PepperDash.Essentials.DM
|
||||||
/// Controller class for all DM-TX-201S/F transmitters
|
/// Controller class for all DM-TX-201S/F transmitters
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Description("Wrapper class for DM-TX-201-S/F")]
|
[Description("Wrapper class for DM-TX-201-S/F")]
|
||||||
public class DmTx201SController : DmTxControllerBase, ITxRouting, IHasFreeRun, IVgaBrightnessContrastControls
|
public class DmTx201SController : DmTxControllerBase, ITxRoutingWithFeedback, IHasFreeRun, IVgaBrightnessContrastControls
|
||||||
{
|
{
|
||||||
public DmTx201S Tx { get; private set; }
|
public DmTx201S Tx { get; private set; }
|
||||||
|
|
||||||
|
|
@ -36,6 +37,21 @@ namespace PepperDash.Essentials.DM
|
||||||
public IntFeedback VgaBrightnessFeedback { get; protected set; }
|
public IntFeedback VgaBrightnessFeedback { get; protected set; }
|
||||||
public IntFeedback VgaContrastFeedback { get; protected set; }
|
public IntFeedback VgaContrastFeedback { get; protected set; }
|
||||||
|
|
||||||
|
//IroutingNumericEvent
|
||||||
|
public event EventHandler<RoutingNumericEventArgs> NumericSwitchChange;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// <summary>
|
||||||
|
/// Raise an event when the status of a switch object changes.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="e">Arguments defined as IKeyName sender, output, input, and eRoutingSignalType</param>
|
||||||
|
private void OnSwitchChange(RoutingNumericEventArgs e)
|
||||||
|
{
|
||||||
|
var newEvent = NumericSwitchChange;
|
||||||
|
if (newEvent != null) newEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Helps get the "real" inputs, including when in Auto
|
/// Helps get the "real" inputs, including when in Auto
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -92,11 +108,19 @@ namespace PepperDash.Essentials.DM
|
||||||
Tx = tx;
|
Tx = tx;
|
||||||
|
|
||||||
HdmiInput = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn,
|
HdmiInput = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn,
|
||||||
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, DmTx200Base.eSourceSelection.Digital, this,
|
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi,
|
||||||
VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInput));
|
DmTx200Base.eSourceSelection.Digital, this,
|
||||||
|
VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInput))
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = DmTx200Base.eSourceSelection.Digital
|
||||||
|
};
|
||||||
|
|
||||||
VgaInput = new RoutingInputPortWithVideoStatuses(DmPortName.VgaIn,
|
VgaInput = new RoutingInputPortWithVideoStatuses(DmPortName.VgaIn,
|
||||||
eRoutingSignalType.Video, eRoutingPortConnectionType.Vga, DmTx200Base.eSourceSelection.Analog, this,
|
eRoutingSignalType.Video, eRoutingPortConnectionType.Vga, DmTx200Base.eSourceSelection.Analog, this,
|
||||||
VideoStatusHelper.GetVgaInputStatusFuncs(tx.VgaInput));
|
VideoStatusHelper.GetVgaInputStatusFuncs(tx.VgaInput))
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = DmTx200Base.eSourceSelection.Analog
|
||||||
|
};
|
||||||
|
|
||||||
ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput",
|
ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput",
|
||||||
() => ActualActiveVideoInput.ToString());
|
() => ActualActiveVideoInput.ToString());
|
||||||
|
|
@ -194,10 +218,17 @@ namespace PepperDash.Essentials.DM
|
||||||
|
|
||||||
void Tx_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args)
|
void Tx_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args)
|
||||||
{
|
{
|
||||||
|
var localVideoInputPort =
|
||||||
|
InputPorts.FirstOrDefault(p => (DmTx200Base.eSourceSelection)p.Selector == Tx.VideoSourceFeedback);
|
||||||
|
var localAudioInputPort =
|
||||||
|
InputPorts.FirstOrDefault(p => (DmTx200Base.eSourceSelection)p.Selector == Tx.AudioSourceFeedback);
|
||||||
|
|
||||||
|
|
||||||
ActiveVideoInputFeedback.FireUpdate();
|
ActiveVideoInputFeedback.FireUpdate();
|
||||||
VideoSourceNumericFeedback.FireUpdate();
|
VideoSourceNumericFeedback.FireUpdate();
|
||||||
AudioSourceNumericFeedback.FireUpdate();
|
AudioSourceNumericFeedback.FireUpdate();
|
||||||
|
OnSwitchChange(new RoutingNumericEventArgs(1, VideoSourceNumericFeedback.UShortValue, OutputPorts.First(), localVideoInputPort, eRoutingSignalType.Video));
|
||||||
|
OnSwitchChange(new RoutingNumericEventArgs(1, AudioSourceNumericFeedback.UShortValue, OutputPorts.First(), localAudioInputPort, eRoutingSignalType.Audio));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void VgaInputOnInputStreamChange(EndpointInputStream inputStream, EndpointInputStreamEventArgs args)
|
private void VgaInputOnInputStreamChange(EndpointInputStream inputStream, EndpointInputStreamEventArgs args)
|
||||||
|
|
@ -319,14 +350,17 @@ namespace PepperDash.Essentials.DM
|
||||||
switch (id)
|
switch (id)
|
||||||
{
|
{
|
||||||
case EndpointTransmitterBase.VideoSourceFeedbackEventId:
|
case EndpointTransmitterBase.VideoSourceFeedbackEventId:
|
||||||
|
var localVideoInputPort = InputPorts.FirstOrDefault(p => (DmTx200Base.eSourceSelection)p.Selector == Tx.VideoSourceFeedback);
|
||||||
Debug.Console(2, this, " Video Source: {0}", Tx.VideoSourceFeedback);
|
Debug.Console(2, this, " Video Source: {0}", Tx.VideoSourceFeedback);
|
||||||
ActiveVideoInputFeedback.FireUpdate();
|
|
||||||
VideoSourceNumericFeedback.FireUpdate();
|
VideoSourceNumericFeedback.FireUpdate();
|
||||||
ActiveVideoInputFeedback.FireUpdate();
|
ActiveVideoInputFeedback.FireUpdate();
|
||||||
|
OnSwitchChange(new RoutingNumericEventArgs(1, VideoSourceNumericFeedback.UShortValue, OutputPorts.First(), localVideoInputPort, eRoutingSignalType.Video));
|
||||||
break;
|
break;
|
||||||
case EndpointTransmitterBase.AudioSourceFeedbackEventId:
|
case EndpointTransmitterBase.AudioSourceFeedbackEventId:
|
||||||
Debug.Console(2, this, " Audio Source : {0}", Tx.AudioSourceFeedback);
|
var localInputAudioPort = InputPorts.FirstOrDefault(p => (DmTx200Base.eSourceSelection)p.Selector == Tx.AudioSourceFeedback);
|
||||||
|
Debug.Console(2, this, " Audio Source: {0}", Tx.AudioSourceFeedback);
|
||||||
AudioSourceNumericFeedback.FireUpdate();
|
AudioSourceNumericFeedback.FireUpdate();
|
||||||
|
OnSwitchChange(new RoutingNumericEventArgs(1, AudioSourceNumericFeedback.UShortValue, OutputPorts.First(), localInputAudioPort, eRoutingSignalType.Audio));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ namespace PepperDash.Essentials.DM
|
||||||
using eVst = DmTx401C.eSourceSelection;
|
using eVst = DmTx401C.eSourceSelection;
|
||||||
|
|
||||||
[Description("Wrapper class for DM-TX-401-C")]
|
[Description("Wrapper class for DM-TX-401-C")]
|
||||||
public class DmTx401CController : DmTxControllerBase, ITxRouting, IIROutputPorts, IComPorts, IHasFreeRun, IVgaBrightnessContrastControls
|
public class DmTx401CController : DmTxControllerBase, ITxRoutingWithFeedback, IIROutputPorts, IComPorts, IHasFreeRun, IVgaBrightnessContrastControls
|
||||||
{
|
{
|
||||||
public DmTx401C Tx { get; private set; }
|
public DmTx401C Tx { get; private set; }
|
||||||
|
|
||||||
|
|
@ -43,6 +43,20 @@ namespace PepperDash.Essentials.DM
|
||||||
public IntFeedback VgaBrightnessFeedback { get; protected set; }
|
public IntFeedback VgaBrightnessFeedback { get; protected set; }
|
||||||
public IntFeedback VgaContrastFeedback { get; protected set; }
|
public IntFeedback VgaContrastFeedback { get; protected set; }
|
||||||
|
|
||||||
|
//IroutingNumericEvent
|
||||||
|
public event EventHandler<RoutingNumericEventArgs> NumericSwitchChange;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Raise an event when the status of a switch object changes.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="e">Arguments defined as IKeyName sender, output, input, and eRoutingSignalType</param>
|
||||||
|
private void OnSwitchChange(RoutingNumericEventArgs e)
|
||||||
|
{
|
||||||
|
var newEvent = NumericSwitchChange;
|
||||||
|
if (newEvent != null) newEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Helps get the "real" inputs, including when in Auto
|
/// Helps get the "real" inputs, including when in Auto
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -104,20 +118,33 @@ namespace PepperDash.Essentials.DM
|
||||||
|
|
||||||
HdmiIn = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn,
|
HdmiIn = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn,
|
||||||
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, eVst.HDMI, this,
|
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, eVst.HDMI, this,
|
||||||
VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInput));
|
VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInput))
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = eVst.HDMI
|
||||||
|
};
|
||||||
DisplayPortIn = new RoutingInputPortWithVideoStatuses(DmPortName.DisplayPortIn,
|
DisplayPortIn = new RoutingInputPortWithVideoStatuses(DmPortName.DisplayPortIn,
|
||||||
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, eVst.DisplayPort, this,
|
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, eVst.DisplayPort, this,
|
||||||
VideoStatusHelper.GetDisplayPortInputStatusFuncs(tx.DisplayPortInput));
|
VideoStatusHelper.GetDisplayPortInputStatusFuncs(tx.DisplayPortInput))
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = eVst.DisplayPort
|
||||||
|
};
|
||||||
VgaIn = new RoutingInputPortWithVideoStatuses(DmPortName.VgaIn,
|
VgaIn = new RoutingInputPortWithVideoStatuses(DmPortName.VgaIn,
|
||||||
eRoutingSignalType.Video, eRoutingPortConnectionType.Vga, eVst.VGA, this,
|
eRoutingSignalType.Video, eRoutingPortConnectionType.Vga, eVst.VGA, this,
|
||||||
VideoStatusHelper.GetVgaInputStatusFuncs(tx.VgaInput));
|
VideoStatusHelper.GetVgaInputStatusFuncs(tx.VgaInput))
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = eVst.VGA
|
||||||
|
};
|
||||||
CompositeIn = new RoutingInputPortWithVideoStatuses(DmPortName.CompositeIn,
|
CompositeIn = new RoutingInputPortWithVideoStatuses(DmPortName.CompositeIn,
|
||||||
eRoutingSignalType.Video, eRoutingPortConnectionType.Composite, eVst.Composite, this,
|
eRoutingSignalType.Video, eRoutingPortConnectionType.Composite, eVst.Composite, this,
|
||||||
VideoStatusHelper.GetVgaInputStatusFuncs(tx.VgaInput));
|
VideoStatusHelper.GetVgaInputStatusFuncs(tx.VgaInput))
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = eVst.Composite
|
||||||
|
};
|
||||||
|
|
||||||
Tx.HdmiInput.InputStreamChange += HdmiInputStreamChangeEvent;
|
Tx.HdmiInput.InputStreamChange += HdmiInputStreamChangeEvent;
|
||||||
Tx.DisplayPortInput.InputStreamChange += DisplayPortInputStreamChangeEvent;
|
Tx.DisplayPortInput.InputStreamChange += DisplayPortInputStreamChangeEvent;
|
||||||
Tx.BaseEvent += Tx_BaseEvent;
|
Tx.BaseEvent += Tx_BaseEvent;
|
||||||
|
Tx.OnlineStatusChange += Tx_OnlineStatusChange;
|
||||||
Tx.VgaInput.InputStreamChange += VgaInputOnInputStreamChange;
|
Tx.VgaInput.InputStreamChange += VgaInputOnInputStreamChange;
|
||||||
tx.VgaInput.VideoControls.ControlChange += VideoControls_ControlChange;
|
tx.VgaInput.VideoControls.ControlChange += VideoControls_ControlChange;
|
||||||
|
|
||||||
|
|
@ -286,6 +313,20 @@ namespace PepperDash.Essentials.DM
|
||||||
Tx.AudioSource = (eVst)inputSelector;
|
Tx.AudioSource = (eVst)inputSelector;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Tx_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args)
|
||||||
|
{
|
||||||
|
var localVideoInputPort =
|
||||||
|
InputPorts.FirstOrDefault(p => (eVst)p.Selector == Tx.VideoSourceFeedback);
|
||||||
|
var localAudioInputPort =
|
||||||
|
InputPorts.FirstOrDefault(p => (eVst)p.Selector == Tx.AudioSourceFeedback);
|
||||||
|
|
||||||
|
ActiveVideoInputFeedback.FireUpdate();
|
||||||
|
VideoSourceNumericFeedback.FireUpdate();
|
||||||
|
AudioSourceNumericFeedback.FireUpdate();
|
||||||
|
OnSwitchChange(new RoutingNumericEventArgs(1, VideoSourceNumericFeedback.UShortValue, OutputPorts.First(), localVideoInputPort, eRoutingSignalType.Video));
|
||||||
|
OnSwitchChange(new RoutingNumericEventArgs(1, AudioSourceNumericFeedback.UShortValue, OutputPorts.First(), localAudioInputPort, eRoutingSignalType.Audio));
|
||||||
|
}
|
||||||
|
|
||||||
void Tx_BaseEvent(GenericBase device, BaseEventArgs args)
|
void Tx_BaseEvent(GenericBase device, BaseEventArgs args)
|
||||||
{
|
{
|
||||||
var id = args.EventId;
|
var id = args.EventId;
|
||||||
|
|
@ -294,13 +335,17 @@ namespace PepperDash.Essentials.DM
|
||||||
switch (id)
|
switch (id)
|
||||||
{
|
{
|
||||||
case EndpointTransmitterBase.VideoSourceFeedbackEventId:
|
case EndpointTransmitterBase.VideoSourceFeedbackEventId:
|
||||||
|
var localVideoInputPort = InputPorts.FirstOrDefault(p => (eVst)p.Selector == Tx.VideoSourceFeedback);
|
||||||
Debug.Console(2, this, " Video Source: {0}", Tx.VideoSourceFeedback);
|
Debug.Console(2, this, " Video Source: {0}", Tx.VideoSourceFeedback);
|
||||||
VideoSourceNumericFeedback.FireUpdate();
|
VideoSourceNumericFeedback.FireUpdate();
|
||||||
ActiveVideoInputFeedback.FireUpdate();
|
ActiveVideoInputFeedback.FireUpdate();
|
||||||
|
OnSwitchChange(new RoutingNumericEventArgs(1, VideoSourceNumericFeedback.UShortValue, OutputPorts.First(), localVideoInputPort, eRoutingSignalType.Video));
|
||||||
break;
|
break;
|
||||||
case EndpointTransmitterBase.AudioSourceFeedbackEventId:
|
case EndpointTransmitterBase.AudioSourceFeedbackEventId:
|
||||||
|
var localInputAudioPort = InputPorts.FirstOrDefault(p => (eVst)p.Selector == Tx.AudioSourceFeedback);
|
||||||
Debug.Console(2, this, " Audio Source: {0}", Tx.AudioSourceFeedback);
|
Debug.Console(2, this, " Audio Source: {0}", Tx.AudioSourceFeedback);
|
||||||
AudioSourceNumericFeedback.FireUpdate();
|
AudioSourceNumericFeedback.FireUpdate();
|
||||||
|
OnSwitchChange(new RoutingNumericEventArgs(1, AudioSourceNumericFeedback.UShortValue, OutputPorts.First(), localInputAudioPort, eRoutingSignalType.Audio));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ namespace PepperDash.Essentials.DM
|
||||||
using eAst = Crestron.SimplSharpPro.DeviceSupport.eX02AudioSourceType;
|
using eAst = Crestron.SimplSharpPro.DeviceSupport.eX02AudioSourceType;
|
||||||
|
|
||||||
[Description("Wrapper class for DM-TX-4K-202-C")]
|
[Description("Wrapper class for DM-TX-4K-202-C")]
|
||||||
public class DmTx4k202CController : DmTxControllerBase, ITxRouting, IHasFeedback,
|
public class DmTx4k202CController : DmTxControllerBase, ITxRoutingWithFeedback, IHasFeedback,
|
||||||
IIROutputPorts, IComPorts
|
IIROutputPorts, IComPorts
|
||||||
{
|
{
|
||||||
public DmTx4k202C Tx { get; private set; }
|
public DmTx4k202C Tx { get; private set; }
|
||||||
|
|
@ -39,6 +39,20 @@ namespace PepperDash.Essentials.DM
|
||||||
public BoolFeedback Hdmi1VideoSyncFeedback { get; protected set; }
|
public BoolFeedback Hdmi1VideoSyncFeedback { get; protected set; }
|
||||||
public BoolFeedback Hdmi2VideoSyncFeedback { get; protected set; }
|
public BoolFeedback Hdmi2VideoSyncFeedback { get; protected set; }
|
||||||
|
|
||||||
|
//IroutingNumericEvent
|
||||||
|
public event EventHandler<RoutingNumericEventArgs> NumericSwitchChange;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Raise an event when the status of a switch object changes.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="e">Arguments defined as IKeyName sender, output, input, and eRoutingSignalType</param>
|
||||||
|
private void OnSwitchChange(RoutingNumericEventArgs e)
|
||||||
|
{
|
||||||
|
var newEvent = NumericSwitchChange;
|
||||||
|
if (newEvent != null) newEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//public override IntFeedback HdcpSupportAllFeedback { get; protected set; }
|
//public override IntFeedback HdcpSupportAllFeedback { get; protected set; }
|
||||||
//public override ushort HdcpSupportCapability { get; protected set; }
|
//public override ushort HdcpSupportCapability { get; protected set; }
|
||||||
|
|
||||||
|
|
@ -81,6 +95,7 @@ namespace PepperDash.Essentials.DM
|
||||||
return new RoutingPortCollection<RoutingOutputPort> { DmOut, HdmiLoopOut };
|
return new RoutingPortCollection<RoutingOutputPort> { DmOut, HdmiLoopOut };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public DmTx4k202CController(string key, string name, DmTx4k202C tx)
|
public DmTx4k202CController(string key, string name, DmTx4k202C tx)
|
||||||
: base(key, name, tx)
|
: base(key, name, tx)
|
||||||
{
|
{
|
||||||
|
|
@ -88,10 +103,17 @@ namespace PepperDash.Essentials.DM
|
||||||
|
|
||||||
HdmiIn1 = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn1,
|
HdmiIn1 = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn1,
|
||||||
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, eVst.Hdmi1, this,
|
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, eVst.Hdmi1, this,
|
||||||
VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInputs[1]));
|
VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInputs[1]))
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = eVst.Hdmi1
|
||||||
|
};
|
||||||
HdmiIn2 = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn2,
|
HdmiIn2 = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn2,
|
||||||
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, eVst.Hdmi2, this,
|
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, eVst.Hdmi2, this,
|
||||||
VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInputs[2]));
|
VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInputs[2]))
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = eVst.Hdmi2
|
||||||
|
};
|
||||||
|
|
||||||
ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput",
|
ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput",
|
||||||
() => ActualActiveVideoInput.ToString());
|
() => ActualActiveVideoInput.ToString());
|
||||||
|
|
||||||
|
|
@ -102,13 +124,17 @@ namespace PepperDash.Essentials.DM
|
||||||
|
|
||||||
Tx.BaseEvent += Tx_BaseEvent;
|
Tx.BaseEvent += Tx_BaseEvent;
|
||||||
|
|
||||||
VideoSourceNumericFeedback = new IntFeedback(() => (int)Tx.VideoSourceFeedback);
|
Tx.OnlineStatusChange += Tx_OnlineStatusChange;
|
||||||
|
|
||||||
AudioSourceNumericFeedback = new IntFeedback(() => (int)Tx.AudioSourceFeedback);
|
VideoSourceNumericFeedback = new IntFeedback(() => (int) Tx.VideoSourceFeedback);
|
||||||
|
|
||||||
HdmiIn1HdcpCapabilityFeedback = new IntFeedback("HdmiIn1HdcpCapability", () => (int)tx.HdmiInputs[1].HdcpCapabilityFeedback);
|
AudioSourceNumericFeedback = new IntFeedback(() => (int) Tx.AudioSourceFeedback);
|
||||||
|
|
||||||
HdmiIn2HdcpCapabilityFeedback = new IntFeedback("HdmiIn2HdcpCapability", () => (int)tx.HdmiInputs[2].HdcpCapabilityFeedback);
|
HdmiIn1HdcpCapabilityFeedback = new IntFeedback("HdmiIn1HdcpCapability",
|
||||||
|
() => (int) tx.HdmiInputs[1].HdcpCapabilityFeedback);
|
||||||
|
|
||||||
|
HdmiIn2HdcpCapabilityFeedback = new IntFeedback("HdmiIn2HdcpCapability",
|
||||||
|
() => (int) tx.HdmiInputs[2].HdcpCapabilityFeedback);
|
||||||
|
|
||||||
HdcpStateFeedback =
|
HdcpStateFeedback =
|
||||||
new IntFeedback(
|
new IntFeedback(
|
||||||
|
|
@ -119,9 +145,9 @@ namespace PepperDash.Essentials.DM
|
||||||
|
|
||||||
HdcpSupportCapability = eHdcpCapabilityType.Hdcp2_2Support;
|
HdcpSupportCapability = eHdcpCapabilityType.Hdcp2_2Support;
|
||||||
|
|
||||||
Hdmi1VideoSyncFeedback = new BoolFeedback(() => (bool)tx.HdmiInputs[1].SyncDetectedFeedback.BoolValue);
|
Hdmi1VideoSyncFeedback = new BoolFeedback(() => (bool) tx.HdmiInputs[1].SyncDetectedFeedback.BoolValue);
|
||||||
|
|
||||||
Hdmi2VideoSyncFeedback = new BoolFeedback(() => (bool)tx.HdmiInputs[2].SyncDetectedFeedback.BoolValue);
|
Hdmi2VideoSyncFeedback = new BoolFeedback(() => (bool) tx.HdmiInputs[2].SyncDetectedFeedback.BoolValue);
|
||||||
|
|
||||||
var combinedFuncs = new VideoStatusFuncsWrapper
|
var combinedFuncs = new VideoStatusFuncsWrapper
|
||||||
{
|
{
|
||||||
|
|
@ -157,18 +183,21 @@ namespace PepperDash.Essentials.DM
|
||||||
};
|
};
|
||||||
|
|
||||||
AnyVideoInput = new RoutingInputPortWithVideoStatuses(DmPortName.AnyVideoIn,
|
AnyVideoInput = new RoutingInputPortWithVideoStatuses(DmPortName.AnyVideoIn,
|
||||||
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.None, 0, this, combinedFuncs);
|
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.None, 0, this,
|
||||||
|
combinedFuncs);
|
||||||
|
|
||||||
DmOut = new RoutingOutputPort(DmPortName.DmOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
|
DmOut = new RoutingOutputPort(DmPortName.DmOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
|
||||||
eRoutingPortConnectionType.DmCat, null, this);
|
eRoutingPortConnectionType.DmCat, null, this);
|
||||||
HdmiLoopOut = new RoutingOutputPort(DmPortName.HdmiLoopOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
|
HdmiLoopOut = new RoutingOutputPort(DmPortName.HdmiLoopOut,
|
||||||
|
eRoutingSignalType.Audio | eRoutingSignalType.Video,
|
||||||
eRoutingPortConnectionType.Hdmi, null, this);
|
eRoutingPortConnectionType.Hdmi, null, this);
|
||||||
|
|
||||||
|
|
||||||
AddToFeedbackList(ActiveVideoInputFeedback, VideoSourceNumericFeedback, AudioSourceNumericFeedback,
|
AddToFeedbackList(ActiveVideoInputFeedback, VideoSourceNumericFeedback, AudioSourceNumericFeedback,
|
||||||
AnyVideoInput.VideoStatus.HasVideoStatusFeedback, AnyVideoInput.VideoStatus.HdcpActiveFeedback,
|
AnyVideoInput.VideoStatus.HasVideoStatusFeedback, AnyVideoInput.VideoStatus.HdcpActiveFeedback,
|
||||||
AnyVideoInput.VideoStatus.HdcpStateFeedback, AnyVideoInput.VideoStatus.VideoResolutionFeedback,
|
AnyVideoInput.VideoStatus.HdcpStateFeedback, AnyVideoInput.VideoStatus.VideoResolutionFeedback,
|
||||||
AnyVideoInput.VideoStatus.VideoSyncFeedback, HdmiIn1HdcpCapabilityFeedback, HdmiIn2HdcpCapabilityFeedback,
|
AnyVideoInput.VideoStatus.VideoSyncFeedback, HdmiIn1HdcpCapabilityFeedback,
|
||||||
|
HdmiIn2HdcpCapabilityFeedback,
|
||||||
Hdmi1VideoSyncFeedback, Hdmi2VideoSyncFeedback);
|
Hdmi1VideoSyncFeedback, Hdmi2VideoSyncFeedback);
|
||||||
|
|
||||||
// Set Ports for CEC
|
// Set Ports for CEC
|
||||||
|
|
@ -296,6 +325,20 @@ namespace PepperDash.Essentials.DM
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Tx_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args)
|
||||||
|
{
|
||||||
|
var localVideoInputPort =
|
||||||
|
InputPorts.FirstOrDefault(p => (eVst)p.Selector == Tx.VideoSourceFeedback);
|
||||||
|
var localAudioInputPort =
|
||||||
|
InputPorts.FirstOrDefault(p => (eAst)p.Selector == Tx.AudioSourceFeedback);
|
||||||
|
|
||||||
|
ActiveVideoInputFeedback.FireUpdate();
|
||||||
|
VideoSourceNumericFeedback.FireUpdate();
|
||||||
|
AudioSourceNumericFeedback.FireUpdate();
|
||||||
|
OnSwitchChange(new RoutingNumericEventArgs(1, VideoSourceNumericFeedback.UShortValue, OutputPorts.First(), localVideoInputPort, eRoutingSignalType.Video));
|
||||||
|
OnSwitchChange(new RoutingNumericEventArgs(1, AudioSourceNumericFeedback.UShortValue, OutputPorts.First(), localAudioInputPort, eRoutingSignalType.Audio));
|
||||||
|
}
|
||||||
|
|
||||||
void Tx_BaseEvent(GenericBase device, BaseEventArgs args)
|
void Tx_BaseEvent(GenericBase device, BaseEventArgs args)
|
||||||
{
|
{
|
||||||
var id = args.EventId;
|
var id = args.EventId;
|
||||||
|
|
@ -304,14 +347,17 @@ namespace PepperDash.Essentials.DM
|
||||||
switch (id)
|
switch (id)
|
||||||
{
|
{
|
||||||
case EndpointTransmitterBase.VideoSourceFeedbackEventId:
|
case EndpointTransmitterBase.VideoSourceFeedbackEventId:
|
||||||
|
var localVideoInputPort = InputPorts.FirstOrDefault(p => (eVst)p.Selector == Tx.VideoSourceFeedback);
|
||||||
Debug.Console(2, this, " Video Source: {0}", Tx.VideoSourceFeedback);
|
Debug.Console(2, this, " Video Source: {0}", Tx.VideoSourceFeedback);
|
||||||
ActiveVideoInputFeedback.FireUpdate();
|
|
||||||
VideoSourceNumericFeedback.FireUpdate();
|
VideoSourceNumericFeedback.FireUpdate();
|
||||||
ActiveVideoInputFeedback.FireUpdate();
|
ActiveVideoInputFeedback.FireUpdate();
|
||||||
|
OnSwitchChange(new RoutingNumericEventArgs(1, VideoSourceNumericFeedback.UShortValue, OutputPorts.First(), localVideoInputPort, eRoutingSignalType.Video));
|
||||||
break;
|
break;
|
||||||
case EndpointTransmitterBase.AudioSourceFeedbackEventId:
|
case EndpointTransmitterBase.AudioSourceFeedbackEventId:
|
||||||
Debug.Console(2, this, " Audio Source : {0}", Tx.AudioSourceFeedback);
|
var localInputAudioPort = InputPorts.FirstOrDefault(p => (eAst)p.Selector == Tx.AudioSourceFeedback);
|
||||||
|
Debug.Console(2, this, " Audio Source: {0}", Tx.AudioSourceFeedback);
|
||||||
AudioSourceNumericFeedback.FireUpdate();
|
AudioSourceNumericFeedback.FireUpdate();
|
||||||
|
OnSwitchChange(new RoutingNumericEventArgs(1, AudioSourceNumericFeedback.UShortValue, OutputPorts.First(), localInputAudioPort, eRoutingSignalType.Audio));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ namespace PepperDash.Essentials.DM
|
||||||
using eAst = Crestron.SimplSharpPro.DeviceSupport.eX02AudioSourceType;
|
using eAst = Crestron.SimplSharpPro.DeviceSupport.eX02AudioSourceType;
|
||||||
|
|
||||||
[Description("Wrapper class for DM-TX-4K-302-C")]
|
[Description("Wrapper class for DM-TX-4K-302-C")]
|
||||||
public class DmTx4k302CController : DmTxControllerBase, ITxRouting, IHasFeedback,
|
public class DmTx4k302CController : DmTxControllerBase, ITxRoutingWithFeedback, IHasFeedback,
|
||||||
IIROutputPorts, IComPorts, IHasFreeRun, IVgaBrightnessContrastControls
|
IIROutputPorts, IComPorts, IHasFreeRun, IVgaBrightnessContrastControls
|
||||||
{
|
{
|
||||||
public DmTx4k302C Tx { get; private set; }
|
public DmTx4k302C Tx { get; private set; }
|
||||||
|
|
@ -46,6 +46,20 @@ namespace PepperDash.Essentials.DM
|
||||||
public IntFeedback VgaBrightnessFeedback { get; protected set; }
|
public IntFeedback VgaBrightnessFeedback { get; protected set; }
|
||||||
public IntFeedback VgaContrastFeedback { get; protected set; }
|
public IntFeedback VgaContrastFeedback { get; protected set; }
|
||||||
|
|
||||||
|
//IroutingNumericEvent
|
||||||
|
public event EventHandler<RoutingNumericEventArgs> NumericSwitchChange;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Raise an event when the status of a switch object changes.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="e">Arguments defined as IKeyName sender, output, input, and eRoutingSignalType</param>
|
||||||
|
private void OnSwitchChange(RoutingNumericEventArgs e)
|
||||||
|
{
|
||||||
|
var newEvent = NumericSwitchChange;
|
||||||
|
if (newEvent != null) newEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Helps get the "real" inputs, including when in Auto
|
/// Helps get the "real" inputs, including when in Auto
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -95,13 +109,24 @@ namespace PepperDash.Essentials.DM
|
||||||
|
|
||||||
HdmiIn1 = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn1,
|
HdmiIn1 = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn1,
|
||||||
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, eVst.Hdmi1, this,
|
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, eVst.Hdmi1, this,
|
||||||
VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInputs[1]));
|
VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInputs[1]))
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = eVst.Hdmi1
|
||||||
|
};
|
||||||
HdmiIn2 = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn2,
|
HdmiIn2 = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn2,
|
||||||
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, eVst.Hdmi2, this,
|
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, eVst.Hdmi2, this,
|
||||||
VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInputs[2]));
|
VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInputs[2]))
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = eVst.Hdmi2
|
||||||
|
};
|
||||||
|
|
||||||
VgaIn = new RoutingInputPortWithVideoStatuses(DmPortName.VgaIn,
|
VgaIn = new RoutingInputPortWithVideoStatuses(DmPortName.VgaIn,
|
||||||
eRoutingSignalType.Video, eRoutingPortConnectionType.Vga, eVst.Vga, this,
|
eRoutingSignalType.Video, eRoutingPortConnectionType.Vga, eVst.Vga, this,
|
||||||
VideoStatusHelper.GetVgaInputStatusFuncs(tx.VgaInput));
|
VideoStatusHelper.GetVgaInputStatusFuncs(tx.VgaInput))
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = eVst.Vga
|
||||||
|
};
|
||||||
|
|
||||||
ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput",
|
ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput",
|
||||||
() => ActualActiveVideoInput.ToString());
|
() => ActualActiveVideoInput.ToString());
|
||||||
|
|
||||||
|
|
@ -110,6 +135,8 @@ namespace PepperDash.Essentials.DM
|
||||||
Tx.VgaInput.InputStreamChange += VgaInputOnInputStreamChange;
|
Tx.VgaInput.InputStreamChange += VgaInputOnInputStreamChange;
|
||||||
Tx.BaseEvent += Tx_BaseEvent;
|
Tx.BaseEvent += Tx_BaseEvent;
|
||||||
|
|
||||||
|
Tx.OnlineStatusChange += Tx_OnlineStatusChange;
|
||||||
|
|
||||||
VideoSourceNumericFeedback = new IntFeedback(() => (int)Tx.VideoSourceFeedback);
|
VideoSourceNumericFeedback = new IntFeedback(() => (int)Tx.VideoSourceFeedback);
|
||||||
AudioSourceNumericFeedback = new IntFeedback(() => (int)Tx.AudioSourceFeedback);
|
AudioSourceNumericFeedback = new IntFeedback(() => (int)Tx.AudioSourceFeedback);
|
||||||
|
|
||||||
|
|
@ -387,20 +414,39 @@ namespace PepperDash.Essentials.DM
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
void Tx_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args)
|
||||||
|
{
|
||||||
|
var localVideoInputPort =
|
||||||
|
InputPorts.FirstOrDefault(p => (eVst)p.Selector == Tx.VideoSourceFeedback);
|
||||||
|
var localAudioInputPort =
|
||||||
|
InputPorts.FirstOrDefault(p => (eAst)p.Selector == Tx.AudioSourceFeedback);
|
||||||
|
|
||||||
|
ActiveVideoInputFeedback.FireUpdate();
|
||||||
|
VideoSourceNumericFeedback.FireUpdate();
|
||||||
|
AudioSourceNumericFeedback.FireUpdate();
|
||||||
|
OnSwitchChange(new RoutingNumericEventArgs(1, VideoSourceNumericFeedback.UShortValue, OutputPorts.First(), localVideoInputPort, eRoutingSignalType.Video));
|
||||||
|
OnSwitchChange(new RoutingNumericEventArgs(1, AudioSourceNumericFeedback.UShortValue, OutputPorts.First(), localAudioInputPort, eRoutingSignalType.Audio));
|
||||||
|
}
|
||||||
|
|
||||||
void Tx_BaseEvent(GenericBase device, BaseEventArgs args)
|
void Tx_BaseEvent(GenericBase device, BaseEventArgs args)
|
||||||
{
|
{
|
||||||
var id = args.EventId;
|
var id = args.EventId;
|
||||||
|
Debug.Console(2, this, "EventId {0}", args.EventId);
|
||||||
|
|
||||||
switch (id)
|
switch (id)
|
||||||
{
|
{
|
||||||
case EndpointTransmitterBase.VideoSourceFeedbackEventId:
|
case EndpointTransmitterBase.VideoSourceFeedbackEventId:
|
||||||
|
var localVideoInputPort = InputPorts.FirstOrDefault(p => (eVst)p.Selector == Tx.VideoSourceFeedback);
|
||||||
Debug.Console(2, this, " Video Source: {0}", Tx.VideoSourceFeedback);
|
Debug.Console(2, this, " Video Source: {0}", Tx.VideoSourceFeedback);
|
||||||
VideoSourceNumericFeedback.FireUpdate();
|
VideoSourceNumericFeedback.FireUpdate();
|
||||||
ActiveVideoInputFeedback.FireUpdate();
|
ActiveVideoInputFeedback.FireUpdate();
|
||||||
|
OnSwitchChange(new RoutingNumericEventArgs(1, VideoSourceNumericFeedback.UShortValue, OutputPorts.First(), localVideoInputPort, eRoutingSignalType.Video));
|
||||||
break;
|
break;
|
||||||
case EndpointTransmitterBase.AudioSourceFeedbackEventId:
|
case EndpointTransmitterBase.AudioSourceFeedbackEventId:
|
||||||
|
var localInputAudioPort = InputPorts.FirstOrDefault(p => (eAst)p.Selector == Tx.AudioSourceFeedback);
|
||||||
Debug.Console(2, this, " Audio Source: {0}", Tx.AudioSourceFeedback);
|
Debug.Console(2, this, " Audio Source: {0}", Tx.AudioSourceFeedback);
|
||||||
AudioSourceNumericFeedback.FireUpdate();
|
AudioSourceNumericFeedback.FireUpdate();
|
||||||
|
OnSwitchChange(new RoutingNumericEventArgs(1, AudioSourceNumericFeedback.UShortValue, OutputPorts.First(), localInputAudioPort, eRoutingSignalType.Audio));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
using Crestron.SimplSharpPro;
|
using Crestron.SimplSharpPro;
|
||||||
|
using System;
|
||||||
|
using System.Linq;
|
||||||
//using Crestron.SimplSharpPro.DeviceSupport;
|
//using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
using Crestron.SimplSharpPro.DeviceSupport;
|
using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
using Crestron.SimplSharpPro.DM;
|
using Crestron.SimplSharpPro.DM;
|
||||||
|
|
@ -14,7 +16,7 @@ namespace PepperDash.Essentials.DM
|
||||||
using eVst = eX02VideoSourceType;
|
using eVst = eX02VideoSourceType;
|
||||||
using eAst = eX02AudioSourceType;
|
using eAst = eX02AudioSourceType;
|
||||||
|
|
||||||
public class DmTx4kz202CController : DmTxControllerBase, ITxRouting,
|
public class DmTx4kz202CController : DmTxControllerBase, ITxRoutingWithFeedback,
|
||||||
IIROutputPorts, IComPorts
|
IIROutputPorts, IComPorts
|
||||||
{
|
{
|
||||||
public DmTx4kz202C Tx { get; private set; }
|
public DmTx4kz202C Tx { get; private set; }
|
||||||
|
|
@ -34,6 +36,20 @@ namespace PepperDash.Essentials.DM
|
||||||
|
|
||||||
//public override IntFeedback HdcpSupportAllFeedback { get; protected set; }
|
//public override IntFeedback HdcpSupportAllFeedback { get; protected set; }
|
||||||
//public override ushort HdcpSupportCapability { get; protected set; }
|
//public override ushort HdcpSupportCapability { get; protected set; }
|
||||||
|
//IroutingNumericEvent
|
||||||
|
public event EventHandler<RoutingNumericEventArgs> NumericSwitchChange;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Raise an event when the status of a switch object changes.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="e">Arguments defined as IKeyName sender, output, input, and eRoutingSignalType</param>
|
||||||
|
private void OnSwitchChange(RoutingNumericEventArgs e)
|
||||||
|
{
|
||||||
|
var newEvent = NumericSwitchChange;
|
||||||
|
if (newEvent != null) newEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Helps get the "real" inputs, including when in Auto
|
/// Helps get the "real" inputs, including when in Auto
|
||||||
|
|
@ -77,10 +93,17 @@ namespace PepperDash.Essentials.DM
|
||||||
|
|
||||||
HdmiIn1 = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn1,
|
HdmiIn1 = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn1,
|
||||||
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, eVst.Hdmi1, this,
|
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, eVst.Hdmi1, this,
|
||||||
VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInputs[1]));
|
VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInputs[1]))
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = eVst.Hdmi1
|
||||||
|
};
|
||||||
HdmiIn2 = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn2,
|
HdmiIn2 = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn2,
|
||||||
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, eVst.Hdmi2, this,
|
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, eVst.Hdmi2, this,
|
||||||
VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInputs[2]));
|
VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInputs[2]))
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = eVst.Hdmi2
|
||||||
|
};
|
||||||
|
|
||||||
ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput",
|
ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput",
|
||||||
() => ActualActiveVideoInput.ToString());
|
() => ActualActiveVideoInput.ToString());
|
||||||
|
|
||||||
|
|
@ -89,6 +112,7 @@ namespace PepperDash.Essentials.DM
|
||||||
Tx.HdmiInputs[1].InputStreamChange += InputStreamChangeEvent;
|
Tx.HdmiInputs[1].InputStreamChange += InputStreamChangeEvent;
|
||||||
Tx.HdmiInputs[2].InputStreamChange += InputStreamChangeEvent;
|
Tx.HdmiInputs[2].InputStreamChange += InputStreamChangeEvent;
|
||||||
Tx.BaseEvent += Tx_BaseEvent;
|
Tx.BaseEvent += Tx_BaseEvent;
|
||||||
|
Tx.OnlineStatusChange += Tx_OnlineStatusChange;
|
||||||
|
|
||||||
VideoSourceNumericFeedback = new IntFeedback(() => (int)Tx.VideoSourceFeedback);
|
VideoSourceNumericFeedback = new IntFeedback(() => (int)Tx.VideoSourceFeedback);
|
||||||
|
|
||||||
|
|
@ -284,6 +308,21 @@ namespace PepperDash.Essentials.DM
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Tx_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args)
|
||||||
|
{
|
||||||
|
var localVideoInputPort =
|
||||||
|
InputPorts.FirstOrDefault(p => (eVst)p.Selector == Tx.VideoSourceFeedback);
|
||||||
|
var localAudioInputPort =
|
||||||
|
InputPorts.FirstOrDefault(p => (eAst)p.Selector == Tx.AudioSourceFeedback);
|
||||||
|
|
||||||
|
ActiveVideoInputFeedback.FireUpdate();
|
||||||
|
VideoSourceNumericFeedback.FireUpdate();
|
||||||
|
AudioSourceNumericFeedback.FireUpdate();
|
||||||
|
OnSwitchChange(new RoutingNumericEventArgs(1, VideoSourceNumericFeedback.UShortValue, OutputPorts.First(), localVideoInputPort, eRoutingSignalType.Video));
|
||||||
|
OnSwitchChange(new RoutingNumericEventArgs(1, AudioSourceNumericFeedback.UShortValue, OutputPorts.First(), localAudioInputPort, eRoutingSignalType.Audio));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void Tx_BaseEvent(GenericBase device, BaseEventArgs args)
|
void Tx_BaseEvent(GenericBase device, BaseEventArgs args)
|
||||||
{
|
{
|
||||||
var id = args.EventId;
|
var id = args.EventId;
|
||||||
|
|
@ -292,15 +331,17 @@ namespace PepperDash.Essentials.DM
|
||||||
switch (id)
|
switch (id)
|
||||||
{
|
{
|
||||||
case EndpointTransmitterBase.VideoSourceFeedbackEventId:
|
case EndpointTransmitterBase.VideoSourceFeedbackEventId:
|
||||||
|
var localVideoInputPort = InputPorts.FirstOrDefault(p => (eVst)p.Selector == Tx.VideoSourceFeedback);
|
||||||
Debug.Console(2, this, " Video Source: {0}", Tx.VideoSourceFeedback);
|
Debug.Console(2, this, " Video Source: {0}", Tx.VideoSourceFeedback);
|
||||||
ActiveVideoInputFeedback.FireUpdate();
|
|
||||||
VideoSourceNumericFeedback.FireUpdate();
|
VideoSourceNumericFeedback.FireUpdate();
|
||||||
AudioSourceNumericFeedback.FireUpdate();
|
|
||||||
ActiveVideoInputFeedback.FireUpdate();
|
ActiveVideoInputFeedback.FireUpdate();
|
||||||
|
OnSwitchChange(new RoutingNumericEventArgs(1, VideoSourceNumericFeedback.UShortValue, OutputPorts.First(), localVideoInputPort, eRoutingSignalType.Video));
|
||||||
break;
|
break;
|
||||||
case EndpointTransmitterBase.AudioSourceFeedbackEventId:
|
case EndpointTransmitterBase.AudioSourceFeedbackEventId:
|
||||||
Debug.Console(2, this, " Audio Source : {0}", Tx.AudioSourceFeedback);
|
var localInputAudioPort = InputPorts.FirstOrDefault(p => (eAst)p.Selector == Tx.AudioSourceFeedback);
|
||||||
|
Debug.Console(2, this, " Audio Source: {0}", Tx.AudioSourceFeedback);
|
||||||
AudioSourceNumericFeedback.FireUpdate();
|
AudioSourceNumericFeedback.FireUpdate();
|
||||||
|
OnSwitchChange(new RoutingNumericEventArgs(1, AudioSourceNumericFeedback.UShortValue, OutputPorts.First(), localInputAudioPort, eRoutingSignalType.Audio));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
using Crestron.SimplSharpPro;
|
using Crestron.SimplSharpPro;
|
||||||
|
using System;
|
||||||
|
using System.Linq;
|
||||||
//using Crestron.SimplSharpPro.DeviceSupport;
|
//using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
using Crestron.SimplSharpPro.DeviceSupport;
|
using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
using Crestron.SimplSharpPro.DM;
|
using Crestron.SimplSharpPro.DM;
|
||||||
|
|
@ -16,7 +18,7 @@ namespace PepperDash.Essentials.DM
|
||||||
|
|
||||||
|
|
||||||
[Description("Wrapper class for DM-TX-4K-Z-302-C")]
|
[Description("Wrapper class for DM-TX-4K-Z-302-C")]
|
||||||
public class DmTx4kz302CController : DmTxControllerBase, ITxRouting, IHasFeedback,
|
public class DmTx4kz302CController : DmTxControllerBase, ITxRoutingWithFeedback, IHasFeedback,
|
||||||
IIROutputPorts, IComPorts
|
IIROutputPorts, IComPorts
|
||||||
{
|
{
|
||||||
public DmTx4kz302C Tx { get; private set; }
|
public DmTx4kz302C Tx { get; private set; }
|
||||||
|
|
@ -39,6 +41,19 @@ namespace PepperDash.Essentials.DM
|
||||||
//public override IntFeedback HdcpSupportAllFeedback { get; protected set; }
|
//public override IntFeedback HdcpSupportAllFeedback { get; protected set; }
|
||||||
//public override ushort HdcpSupportCapability { get; protected set; }
|
//public override ushort HdcpSupportCapability { get; protected set; }
|
||||||
|
|
||||||
|
//IroutingNumericEvent
|
||||||
|
public event EventHandler<RoutingNumericEventArgs> NumericSwitchChange;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Raise an event when the status of a switch object changes.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="e">Arguments defined as IKeyName sender, output, input, and eRoutingSignalType</param>
|
||||||
|
private void OnSwitchChange(RoutingNumericEventArgs e)
|
||||||
|
{
|
||||||
|
var newEvent = NumericSwitchChange;
|
||||||
|
if (newEvent != null) newEvent(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Helps get the "real" inputs, including when in Auto
|
/// Helps get the "real" inputs, including when in Auto
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -83,13 +98,22 @@ namespace PepperDash.Essentials.DM
|
||||||
|
|
||||||
HdmiIn1 = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn1,
|
HdmiIn1 = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn1,
|
||||||
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, eVst.Hdmi1, this,
|
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, eVst.Hdmi1, this,
|
||||||
VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInputs[1]));
|
VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInputs[1]))
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = eVst.Hdmi1
|
||||||
|
};
|
||||||
HdmiIn2 = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn2,
|
HdmiIn2 = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn2,
|
||||||
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, eVst.Hdmi2, this,
|
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, eVst.Hdmi2, this,
|
||||||
VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInputs[2]));
|
VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInputs[2]))
|
||||||
DisplayPortIn = new RoutingInputPortWithVideoStatuses(DmPortName.VgaIn,
|
{
|
||||||
|
FeedbackMatchObject = eVst.Hdmi2
|
||||||
|
};
|
||||||
|
DisplayPortIn = new RoutingInputPortWithVideoStatuses(DmPortName.DisplayPortIn,
|
||||||
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.DisplayPort, eVst.DisplayPort, this,
|
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.DisplayPort, eVst.DisplayPort, this,
|
||||||
VideoStatusHelper.GetDisplayPortInputStatusFuncs(tx.DisplayPortInput));
|
VideoStatusHelper.GetDisplayPortInputStatusFuncs(tx.DisplayPortInput))
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = eVst.DisplayPort
|
||||||
|
};
|
||||||
ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput",
|
ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput",
|
||||||
() => ActualActiveVideoInput.ToString());
|
() => ActualActiveVideoInput.ToString());
|
||||||
|
|
||||||
|
|
@ -97,6 +121,7 @@ namespace PepperDash.Essentials.DM
|
||||||
Tx.HdmiInputs[2].InputStreamChange += InputStreamChangeEvent;
|
Tx.HdmiInputs[2].InputStreamChange += InputStreamChangeEvent;
|
||||||
Tx.DisplayPortInput.InputStreamChange += DisplayPortInputStreamChange;
|
Tx.DisplayPortInput.InputStreamChange += DisplayPortInputStreamChange;
|
||||||
Tx.BaseEvent += Tx_BaseEvent;
|
Tx.BaseEvent += Tx_BaseEvent;
|
||||||
|
Tx.OnlineStatusChange += Tx_OnlineStatusChange;
|
||||||
|
|
||||||
VideoSourceNumericFeedback = new IntFeedback(() => (int)Tx.VideoSourceFeedback);
|
VideoSourceNumericFeedback = new IntFeedback(() => (int)Tx.VideoSourceFeedback);
|
||||||
AudioSourceNumericFeedback = new IntFeedback(() => (int)Tx.VideoSourceFeedback);
|
AudioSourceNumericFeedback = new IntFeedback(() => (int)Tx.VideoSourceFeedback);
|
||||||
|
|
@ -295,19 +320,40 @@ namespace PepperDash.Essentials.DM
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Tx_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args)
|
||||||
|
{
|
||||||
|
var localVideoInputPort =
|
||||||
|
InputPorts.FirstOrDefault(p => (eVst)p.Selector == Tx.VideoSourceFeedback);
|
||||||
|
var localAudioInputPort =
|
||||||
|
InputPorts.FirstOrDefault(p => (eAst)p.Selector == Tx.AudioSourceFeedback);
|
||||||
|
|
||||||
|
ActiveVideoInputFeedback.FireUpdate();
|
||||||
|
VideoSourceNumericFeedback.FireUpdate();
|
||||||
|
AudioSourceNumericFeedback.FireUpdate();
|
||||||
|
OnSwitchChange(new RoutingNumericEventArgs(1, VideoSourceNumericFeedback.UShortValue, OutputPorts.First(), localVideoInputPort, eRoutingSignalType.Video));
|
||||||
|
OnSwitchChange(new RoutingNumericEventArgs(1, AudioSourceNumericFeedback.UShortValue, OutputPorts.First(), localAudioInputPort, eRoutingSignalType.Audio));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void Tx_BaseEvent(GenericBase device, BaseEventArgs args)
|
void Tx_BaseEvent(GenericBase device, BaseEventArgs args)
|
||||||
{
|
{
|
||||||
var id = args.EventId;
|
var id = args.EventId;
|
||||||
|
Debug.Console(2, this, "EventId {0}", args.EventId);
|
||||||
|
|
||||||
switch (id)
|
switch (id)
|
||||||
{
|
{
|
||||||
case EndpointTransmitterBase.VideoSourceFeedbackEventId:
|
case EndpointTransmitterBase.VideoSourceFeedbackEventId:
|
||||||
|
var localVideoInputPort = InputPorts.FirstOrDefault(p => (eVst)p.Selector == Tx.VideoSourceFeedback);
|
||||||
Debug.Console(2, this, " Video Source: {0}", Tx.VideoSourceFeedback);
|
Debug.Console(2, this, " Video Source: {0}", Tx.VideoSourceFeedback);
|
||||||
VideoSourceNumericFeedback.FireUpdate();
|
VideoSourceNumericFeedback.FireUpdate();
|
||||||
ActiveVideoInputFeedback.FireUpdate();
|
ActiveVideoInputFeedback.FireUpdate();
|
||||||
|
OnSwitchChange(new RoutingNumericEventArgs(1, VideoSourceNumericFeedback.UShortValue, OutputPorts.First(), localVideoInputPort, eRoutingSignalType.Video));
|
||||||
break;
|
break;
|
||||||
case EndpointTransmitterBase.AudioSourceFeedbackEventId:
|
case EndpointTransmitterBase.AudioSourceFeedbackEventId:
|
||||||
|
var localInputAudioPort = InputPorts.FirstOrDefault(p => (eAst)p.Selector == Tx.AudioSourceFeedback);
|
||||||
Debug.Console(2, this, " Audio Source: {0}", Tx.AudioSourceFeedback);
|
Debug.Console(2, this, " Audio Source: {0}", Tx.AudioSourceFeedback);
|
||||||
AudioSourceNumericFeedback.FireUpdate();
|
AudioSourceNumericFeedback.FireUpdate();
|
||||||
|
OnSwitchChange(new RoutingNumericEventArgs(1, AudioSourceNumericFeedback.UShortValue, OutputPorts.First(), localInputAudioPort, eRoutingSignalType.Audio));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -181,14 +181,18 @@ namespace PepperDash.Essentials.Devices.Common.Cameras
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cameraDevice is IPower)
|
var powerCamera = cameraDevice as IHasPowerControl;
|
||||||
|
if (powerCamera != null)
|
||||||
{
|
{
|
||||||
var powerCamera = cameraDevice as IPower;
|
|
||||||
trilist.SetSigTrueAction(joinMap.PowerOn.JoinNumber, () => powerCamera.PowerOn());
|
trilist.SetSigTrueAction(joinMap.PowerOn.JoinNumber, () => powerCamera.PowerOn());
|
||||||
trilist.SetSigTrueAction(joinMap.PowerOff.JoinNumber, () => powerCamera.PowerOff());
|
trilist.SetSigTrueAction(joinMap.PowerOff.JoinNumber, () => powerCamera.PowerOff());
|
||||||
|
|
||||||
powerCamera.PowerIsOnFeedback.LinkInputSig(trilist.BooleanInput[joinMap.PowerOn.JoinNumber]);
|
var powerFbCamera = powerCamera as IHasPowerControlWithFeedback;
|
||||||
powerCamera.PowerIsOnFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.PowerOff.JoinNumber]);
|
if (powerFbCamera != null)
|
||||||
|
{
|
||||||
|
powerFbCamera.PowerIsOnFeedback.LinkInputSig(trilist.BooleanInput[joinMap.PowerOn.JoinNumber]);
|
||||||
|
powerFbCamera.PowerIsOnFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.PowerOff.JoinNumber]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cameraDevice is ICommunicationMonitor)
|
if (cameraDevice is ICommunicationMonitor)
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ using Crestron.SimplSharp.Reflection;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Devices.Common.Cameras
|
namespace PepperDash.Essentials.Devices.Common.Cameras
|
||||||
{
|
{
|
||||||
public class CameraVisca : CameraBase, IHasCameraPtzControl, ICommunicationMonitor, IHasCameraPresets, IPower, IBridgeAdvanced
|
public class CameraVisca : CameraBase, IHasCameraPtzControl, ICommunicationMonitor, IHasCameraPresets, IHasPowerControlWithFeedback, IBridgeAdvanced
|
||||||
{
|
{
|
||||||
public IBasicCommunication Communication { get; private set; }
|
public IBasicCommunication Communication { get; private set; }
|
||||||
public CommunicationGather PortGather { get; private set; }
|
public CommunicationGather PortGather { get; private set; }
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@ namespace PepperDash.Essentials.Devices.Common.Codec
|
||||||
void AddExternalSource(string connectorId, string key, string name, eExternalSourceType type);
|
void AddExternalSource(string connectorId, string key, string name, eExternalSourceType type);
|
||||||
void SetExternalSourceState(string key, eExternalSourceMode mode);
|
void SetExternalSourceState(string key, eExternalSourceMode mode);
|
||||||
void ClearExternalSources();
|
void ClearExternalSources();
|
||||||
|
void SetSelectedSource(string key);
|
||||||
Action<string, string> RunRouteAction { set;}
|
Action<string, string> RunRouteAction { set;}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,26 +10,28 @@ using PepperDash.Essentials.Core;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Devices.Displays
|
namespace PepperDash.Essentials.Devices.Displays
|
||||||
{
|
{
|
||||||
public abstract class ComTcpDisplayBase : DisplayBase, IPower
|
[Obsolete("Please use TwoWayDisplayBase instead")]
|
||||||
|
public abstract class ComTcpDisplayBase : TwoWayDisplayBase
|
||||||
{
|
{
|
||||||
/// <summary>
|
|
||||||
/// Sets the communication method for this - swaps out event handlers and output handlers
|
///// <summary>
|
||||||
/// </summary>
|
///// Sets the communication method for this - swaps out event handlers and output handlers
|
||||||
public IBasicCommunication CommunicationMethod
|
///// </summary>
|
||||||
{
|
//public IBasicCommunication CommunicationMethod
|
||||||
get { return _CommunicationMethod; }
|
//{
|
||||||
set
|
// get { return _CommunicationMethod; }
|
||||||
{
|
// set
|
||||||
if (_CommunicationMethod != null)
|
// {
|
||||||
_CommunicationMethod.BytesReceived -= this.CommunicationMethod_BytesReceived;
|
// if (_CommunicationMethod != null)
|
||||||
// Outputs???
|
// _CommunicationMethod.BytesReceived -= this.CommunicationMethod_BytesReceived;
|
||||||
_CommunicationMethod = value;
|
// // Outputs???
|
||||||
if (_CommunicationMethod != null)
|
// _CommunicationMethod = value;
|
||||||
_CommunicationMethod.BytesReceived += this.CommunicationMethod_BytesReceived;
|
// if (_CommunicationMethod != null)
|
||||||
// Outputs?
|
// _CommunicationMethod.BytesReceived += this.CommunicationMethod_BytesReceived;
|
||||||
}
|
// // Outputs?
|
||||||
}
|
// }
|
||||||
IBasicCommunication _CommunicationMethod;
|
//}
|
||||||
|
//IBasicCommunication _CommunicationMethod;
|
||||||
|
|
||||||
public ComTcpDisplayBase(string key, string name)
|
public ComTcpDisplayBase(string key, string name)
|
||||||
: base(key, name)
|
: base(key, name)
|
||||||
|
|
@ -38,6 +40,6 @@ namespace PepperDash.Essentials.Devices.Displays
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected abstract void CommunicationMethod_BytesReceived(object sender, GenericCommMethodReceiveBytesArgs args);
|
//protected abstract void CommunicationMethod_BytesReceived(object sender, GenericCommMethodReceiveBytesArgs args);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -11,217 +11,222 @@ using PepperDash.Essentials.Core.Bridges;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Devices.Displays
|
namespace PepperDash.Essentials.Devices.Displays
|
||||||
{
|
{
|
||||||
public class NecPaSeriesProjector : ComTcpDisplayBase, IBridgeAdvanced
|
//public class NecPaSeriesProjector : TwoWayDisplayBase, IBridgeAdvanced
|
||||||
{
|
//{
|
||||||
public readonly IntFeedback Lamp1RemainingPercent;
|
// public readonly IntFeedback Lamp1RemainingPercent;
|
||||||
int _Lamp1RemainingPercent;
|
// int _Lamp1RemainingPercent;
|
||||||
public readonly IntFeedback Lamp2RemainingPercent;
|
// public readonly IntFeedback Lamp2RemainingPercent;
|
||||||
int _Lamp2RemainingPercent;
|
// int _Lamp2RemainingPercent;
|
||||||
protected override Func<bool> PowerIsOnFeedbackFunc
|
|
||||||
{
|
|
||||||
get { return () => _PowerIsOn; }
|
|
||||||
}
|
|
||||||
bool _PowerIsOn;
|
|
||||||
|
|
||||||
protected override Func<bool> IsCoolingDownFeedbackFunc
|
// RoutingInputPort _CurrentInputPort;
|
||||||
{
|
|
||||||
get { return () => false; }
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override Func<bool> IsWarmingUpFeedbackFunc
|
// protected override Func<string> CurrentInputFeedbackFunc { get { return () => _CurrentInputPort.Key; } }
|
||||||
{
|
|
||||||
get { return () => false; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void PowerToggle()
|
// protected override Func<bool> PowerIsOnFeedbackFunc
|
||||||
{
|
// {
|
||||||
throw new NotImplementedException();
|
// get { return () => _PowerIsOn; }
|
||||||
}
|
// }
|
||||||
|
// bool _PowerIsOn;
|
||||||
|
|
||||||
public override void ExecuteSwitch(object selector)
|
// protected override Func<bool> IsCoolingDownFeedbackFunc
|
||||||
{
|
// {
|
||||||
throw new NotImplementedException();
|
// get { return () => false; }
|
||||||
}
|
// }
|
||||||
|
|
||||||
Dictionary<string, string> InputMap;
|
// protected override Func<bool> IsWarmingUpFeedbackFunc
|
||||||
|
// {
|
||||||
|
// get { return () => false; }
|
||||||
|
// }
|
||||||
|
|
||||||
/// <summary>
|
// public override void PowerToggle()
|
||||||
/// Constructor
|
// {
|
||||||
/// </summary>
|
// throw new NotImplementedException();
|
||||||
public NecPaSeriesProjector(string key, string name)
|
// }
|
||||||
: base(key, name)
|
|
||||||
{
|
|
||||||
Lamp1RemainingPercent = new IntFeedback("Lamp1RemainingPercent", () => _Lamp1RemainingPercent);
|
|
||||||
Lamp2RemainingPercent = new IntFeedback("Lamp2RemainingPercent", () => _Lamp2RemainingPercent);
|
|
||||||
|
|
||||||
InputMap = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase)
|
// public override void ExecuteSwitch(object selector)
|
||||||
{
|
// {
|
||||||
{ "computer1", "\x02\x03\x00\x00\x02\x01\x01\x09" },
|
// throw new NotImplementedException();
|
||||||
{ "computer2", "\x02\x03\x00\x00\x02\x01\x02\x0a" },
|
// }
|
||||||
{ "computer3", "\x02\x03\x00\x00\x02\x01\x03\x0b" },
|
|
||||||
{ "hdmi", "\x02\x03\x00\x00\x02\x01\x1a\x22" },
|
|
||||||
{ "dp", "\x02\x03\x00\x00\x02\x01\x1b\x23" },
|
|
||||||
{ "video", "\x02\x03\x00\x00\x02\x01\x06\x0e" },
|
|
||||||
{ "viewer", "\x02\x03\x00\x00\x02\x01\x1f\x27" },
|
|
||||||
{ "network", "\x02\x03\x00\x00\x02\x01\x20\x28" },
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
void IsConnected_OutputChange(object sender, EventArgs e)
|
// Dictionary<string, string> InputMap;
|
||||||
{
|
|
||||||
|
|
||||||
}
|
// /// <summary>
|
||||||
|
// /// Constructor
|
||||||
|
// /// </summary>
|
||||||
|
// public NecPaSeriesProjector(string key, string name)
|
||||||
|
// : base(key, name)
|
||||||
|
// {
|
||||||
|
// Lamp1RemainingPercent = new IntFeedback("Lamp1RemainingPercent", () => _Lamp1RemainingPercent);
|
||||||
|
// Lamp2RemainingPercent = new IntFeedback("Lamp2RemainingPercent", () => _Lamp2RemainingPercent);
|
||||||
|
|
||||||
public void SetEnable(bool state)
|
// InputMap = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase)
|
||||||
{
|
// {
|
||||||
var tcp = CommunicationMethod as GenericTcpIpClient;
|
// { "computer1", "\x02\x03\x00\x00\x02\x01\x01\x09" },
|
||||||
if (tcp != null)
|
// { "computer2", "\x02\x03\x00\x00\x02\x01\x02\x0a" },
|
||||||
{
|
// { "computer3", "\x02\x03\x00\x00\x02\x01\x03\x0b" },
|
||||||
tcp.Connect();
|
// { "hdmi", "\x02\x03\x00\x00\x02\x01\x1a\x22" },
|
||||||
}
|
// { "dp", "\x02\x03\x00\x00\x02\x01\x1b\x23" },
|
||||||
}
|
// { "video", "\x02\x03\x00\x00\x02\x01\x06\x0e" },
|
||||||
|
// { "viewer", "\x02\x03\x00\x00\x02\x01\x1f\x27" },
|
||||||
|
// { "network", "\x02\x03\x00\x00\x02\x01\x20\x28" },
|
||||||
|
// };
|
||||||
|
// }
|
||||||
|
|
||||||
public override void PowerOn()
|
// void IsConnected_OutputChange(object sender, EventArgs e)
|
||||||
{
|
// {
|
||||||
SendText("\x02\x00\x00\x00\x00\x02");
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void PowerOff()
|
// }
|
||||||
{
|
|
||||||
SendText("\x02\x01\x00\x00\x00\x03");
|
|
||||||
}
|
|
||||||
|
|
||||||
public void PictureMuteOn()
|
// public void SetEnable(bool state)
|
||||||
{
|
// {
|
||||||
SendText("\x02\x10\x00\x00\x00\x12");
|
// var tcp = CommunicationMethod as GenericTcpIpClient;
|
||||||
}
|
// if (tcp != null)
|
||||||
|
// {
|
||||||
|
// tcp.Connect();
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
public void PictureMuteOff()
|
// public override void PowerOn()
|
||||||
{
|
// {
|
||||||
SendText("\x02\x11\x00\x00\x00\x13");
|
// SendText("\x02\x00\x00\x00\x00\x02");
|
||||||
}
|
// }
|
||||||
|
|
||||||
public void GetRunningStatus()
|
// public override void PowerOff()
|
||||||
{
|
// {
|
||||||
SendText("\x00\x85\x00\x00\x01\x01\x87");
|
// SendText("\x02\x01\x00\x00\x00\x03");
|
||||||
}
|
// }
|
||||||
|
|
||||||
public void GetLampRemaining(int lampNum)
|
// public void PictureMuteOn()
|
||||||
{
|
// {
|
||||||
if (!_PowerIsOn) return;
|
// SendText("\x02\x10\x00\x00\x00\x12");
|
||||||
|
// }
|
||||||
|
|
||||||
var bytes = new byte[]{0x03,0x96,0x00,0x00,0x02,0x00,0x04};
|
// public void PictureMuteOff()
|
||||||
if (lampNum == 2)
|
// {
|
||||||
bytes[5] = 0x01;
|
// SendText("\x02\x11\x00\x00\x00\x13");
|
||||||
SendBytes(AppendChecksum(bytes));
|
// }
|
||||||
}
|
|
||||||
|
|
||||||
public void SelectInput(string inputKey)
|
// public void GetRunningStatus()
|
||||||
{
|
// {
|
||||||
if (InputMap.ContainsKey(inputKey))
|
// SendText("\x00\x85\x00\x00\x01\x01\x87");
|
||||||
SendText(InputMap[inputKey]);
|
// }
|
||||||
}
|
|
||||||
|
|
||||||
void SendText(string text)
|
// public void GetLampRemaining(int lampNum)
|
||||||
{
|
// {
|
||||||
if (CommunicationMethod != null)
|
// if (!_PowerIsOn) return;
|
||||||
CommunicationMethod.SendText(text);
|
|
||||||
}
|
|
||||||
|
|
||||||
void SendBytes(byte[] bytes)
|
// var bytes = new byte[]{0x03,0x96,0x00,0x00,0x02,0x00,0x04};
|
||||||
{
|
// if (lampNum == 2)
|
||||||
if (CommunicationMethod != null)
|
// bytes[5] = 0x01;
|
||||||
CommunicationMethod.SendBytes(bytes);
|
// SendBytes(AppendChecksum(bytes));
|
||||||
}
|
// }
|
||||||
|
|
||||||
byte[] AppendChecksum(byte[] bytes)
|
// public void SelectInput(string inputKey)
|
||||||
{
|
// {
|
||||||
byte sum = unchecked((byte)bytes.Sum(x => (int)x));
|
// if (InputMap.ContainsKey(inputKey))
|
||||||
var retVal = new byte[bytes.Length + 1];
|
// SendText(InputMap[inputKey]);
|
||||||
bytes.CopyTo(retVal, 0);
|
// }
|
||||||
retVal[retVal.Length - 1] = sum;
|
|
||||||
return retVal;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void CommunicationMethod_BytesReceived(object sender, GenericCommMethodReceiveBytesArgs args)
|
// void SendText(string text)
|
||||||
{
|
// {
|
||||||
var bytes = args.Bytes;
|
// if (CommunicationMethod != null)
|
||||||
ParseBytes(args.Bytes);
|
// CommunicationMethod.SendText(text);
|
||||||
}
|
// }
|
||||||
|
|
||||||
void ParseBytes(byte[] bytes)
|
// void SendBytes(byte[] bytes)
|
||||||
{
|
// {
|
||||||
if (bytes[0] == 0x22)
|
// if (CommunicationMethod != null)
|
||||||
{
|
// CommunicationMethod.SendBytes(bytes);
|
||||||
// Power on
|
// }
|
||||||
if (bytes[1] == 0x00)
|
|
||||||
{
|
|
||||||
_PowerIsOn = true;
|
|
||||||
PowerIsOnFeedback.FireUpdate();
|
|
||||||
}
|
|
||||||
// Power off
|
|
||||||
else if (bytes[1] == 0x01)
|
|
||||||
{
|
|
||||||
_PowerIsOn = false;
|
|
||||||
PowerIsOnFeedback.FireUpdate();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Running Status
|
|
||||||
else if (bytes[0] == 0x20 && bytes[1] == 0x85 && bytes[4] == 0x10)
|
|
||||||
{
|
|
||||||
var operationStates = new Dictionary<int, string>
|
|
||||||
{
|
|
||||||
{ 0x00, "Standby" },
|
|
||||||
{ 0x04, "Power On" },
|
|
||||||
{ 0x05, "Cooling" },
|
|
||||||
{ 0x06, "Standby (error)" },
|
|
||||||
{ 0x0f, "Standby (power saving" },
|
|
||||||
{ 0x10, "Network Standby" },
|
|
||||||
{ 0xff, "Not supported" }
|
|
||||||
};
|
|
||||||
|
|
||||||
var newPowerIsOn = bytes[7] == 0x01;
|
// byte[] AppendChecksum(byte[] bytes)
|
||||||
if (newPowerIsOn != _PowerIsOn)
|
// {
|
||||||
{
|
// byte sum = unchecked((byte)bytes.Sum(x => (int)x));
|
||||||
_PowerIsOn = newPowerIsOn;
|
// var retVal = new byte[bytes.Length + 1];
|
||||||
PowerIsOnFeedback.FireUpdate();
|
// bytes.CopyTo(retVal, 0);
|
||||||
}
|
// retVal[retVal.Length - 1] = sum;
|
||||||
|
// return retVal;
|
||||||
|
// }
|
||||||
|
|
||||||
Debug.Console(2, this, "PowerIsOn={0}\rCooling={1}\rPowering on/off={2}\rStatus={3}",
|
// protected override void CommunicationMethod_BytesReceived(object sender, GenericCommMethodReceiveBytesArgs args)
|
||||||
_PowerIsOn,
|
// {
|
||||||
bytes[8] == 0x01,
|
// var bytes = args.Bytes;
|
||||||
bytes[9] == 0x01,
|
// ParseBytes(args.Bytes);
|
||||||
operationStates[bytes[10]]);
|
// }
|
||||||
|
|
||||||
}
|
// void ParseBytes(byte[] bytes)
|
||||||
// Lamp remaining
|
// {
|
||||||
else if (bytes[0] == 0x23 && bytes[1] == 0x96 && bytes[4] == 0x06 && bytes[6] == 0x04)
|
// if (bytes[0] == 0x22)
|
||||||
{
|
// {
|
||||||
var newValue = bytes[7];
|
// // Power on
|
||||||
if (bytes[5] == 0x00)
|
// if (bytes[1] == 0x00)
|
||||||
{
|
// {
|
||||||
if (newValue != _Lamp1RemainingPercent)
|
// _PowerIsOn = true;
|
||||||
{
|
// PowerIsOnFeedback.FireUpdate();
|
||||||
_Lamp1RemainingPercent = newValue;
|
// }
|
||||||
Lamp1RemainingPercent.FireUpdate();
|
// // Power off
|
||||||
}
|
// else if (bytes[1] == 0x01)
|
||||||
}
|
// {
|
||||||
else
|
// _PowerIsOn = false;
|
||||||
{
|
// PowerIsOnFeedback.FireUpdate();
|
||||||
if (newValue != _Lamp2RemainingPercent)
|
// }
|
||||||
{
|
// }
|
||||||
_Lamp2RemainingPercent = newValue;
|
// // Running Status
|
||||||
Lamp2RemainingPercent.FireUpdate();
|
// else if (bytes[0] == 0x20 && bytes[1] == 0x85 && bytes[4] == 0x10)
|
||||||
}
|
// {
|
||||||
}
|
// var operationStates = new Dictionary<int, string>
|
||||||
Debug.Console(0, this, "Lamp {0}, {1}% remaining", (bytes[5] + 1), bytes[7]);
|
// {
|
||||||
}
|
// { 0x00, "Standby" },
|
||||||
|
// { 0x04, "Power On" },
|
||||||
|
// { 0x05, "Cooling" },
|
||||||
|
// { 0x06, "Standby (error)" },
|
||||||
|
// { 0x0f, "Standby (power saving" },
|
||||||
|
// { 0x10, "Network Standby" },
|
||||||
|
// { 0xff, "Not supported" }
|
||||||
|
// };
|
||||||
|
|
||||||
}
|
// var newPowerIsOn = bytes[7] == 0x01;
|
||||||
|
// if (newPowerIsOn != _PowerIsOn)
|
||||||
|
// {
|
||||||
|
// _PowerIsOn = newPowerIsOn;
|
||||||
|
// PowerIsOnFeedback.FireUpdate();
|
||||||
|
// }
|
||||||
|
|
||||||
public void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
// Debug.Console(2, this, "PowerIsOn={0}\rCooling={1}\rPowering on/off={2}\rStatus={3}",
|
||||||
{
|
// _PowerIsOn,
|
||||||
LinkDisplayToApi(this, trilist, joinStart, joinMapKey, bridge);
|
// bytes[8] == 0x01,
|
||||||
}
|
// bytes[9] == 0x01,
|
||||||
}
|
// operationStates[bytes[10]]);
|
||||||
|
|
||||||
|
// }
|
||||||
|
// // Lamp remaining
|
||||||
|
// else if (bytes[0] == 0x23 && bytes[1] == 0x96 && bytes[4] == 0x06 && bytes[6] == 0x04)
|
||||||
|
// {
|
||||||
|
// var newValue = bytes[7];
|
||||||
|
// if (bytes[5] == 0x00)
|
||||||
|
// {
|
||||||
|
// if (newValue != _Lamp1RemainingPercent)
|
||||||
|
// {
|
||||||
|
// _Lamp1RemainingPercent = newValue;
|
||||||
|
// Lamp1RemainingPercent.FireUpdate();
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
// if (newValue != _Lamp2RemainingPercent)
|
||||||
|
// {
|
||||||
|
// _Lamp2RemainingPercent = newValue;
|
||||||
|
// Lamp2RemainingPercent.FireUpdate();
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// Debug.Console(0, this, "Lamp {0}, {1}% remaining", (bytes[5] + 1), bytes[7]);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// }
|
||||||
|
|
||||||
|
// public void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
||||||
|
// {
|
||||||
|
// LinkDisplayToApi(this, trilist, joinStart, joinMapKey, bridge);
|
||||||
|
// }
|
||||||
|
//}
|
||||||
}
|
}
|
||||||
|
|
@ -25,6 +25,8 @@ namespace PepperDash.Essentials.Devices.Displays
|
||||||
{
|
{
|
||||||
public IBasicCommunication Communication { get; private set; }
|
public IBasicCommunication Communication { get; private set; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public StatusMonitorBase CommunicationMonitor { get; private set; }
|
public StatusMonitorBase CommunicationMonitor { get; private set; }
|
||||||
|
|
||||||
public byte ID { get; private set; }
|
public byte ID { get; private set; }
|
||||||
|
|
@ -326,6 +328,9 @@ namespace PepperDash.Essentials.Devices.Displays
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -336,6 +341,7 @@ namespace PepperDash.Essentials.Devices.Displays
|
||||||
{
|
{
|
||||||
_CurrentInputPort = newInput;
|
_CurrentInputPort = newInput;
|
||||||
CurrentInputFeedback.FireUpdate();
|
CurrentInputFeedback.FireUpdate();
|
||||||
|
OnSwitchChange(new RoutingNumericEventArgs(null, _CurrentInputPort, eRoutingSignalType.AudioVideo));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,12 +16,12 @@ using PepperDash.Essentials.Core.Routing;
|
||||||
namespace PepperDash.Essentials.Devices.Common
|
namespace PepperDash.Essentials.Devices.Common
|
||||||
{
|
{
|
||||||
[Description("Wrapper class for an IR Set Top Box")]
|
[Description("Wrapper class for an IR Set Top Box")]
|
||||||
public class IRSetTopBoxBase : EssentialsBridgeableDevice, ISetTopBoxControls, IRoutingOutputs, IUsageTracking, IPower
|
public class IRSetTopBoxBase : EssentialsBridgeableDevice, ISetTopBoxControls, IRoutingOutputs, IUsageTracking, IHasPowerControl
|
||||||
{
|
{
|
||||||
public IrOutputPortController IrPort { get; private set; }
|
public IrOutputPortController IrPort { get; private set; }
|
||||||
|
|
||||||
public uint DisplayUiType { get { return DisplayUiConstants.TypeDirecTv; } }
|
public uint DisplayUiType { get { return DisplayUiConstants.TypeDirecTv; } }
|
||||||
|
public ushort IrPulseTime { get; set; }
|
||||||
|
|
||||||
public bool HasPresets { get; set; }
|
public bool HasPresets { get; set; }
|
||||||
public bool HasDvr { get; set; }
|
public bool HasDvr { get; set; }
|
||||||
|
|
@ -35,6 +35,13 @@ namespace PepperDash.Essentials.Devices.Common
|
||||||
: base(key, name)
|
: base(key, name)
|
||||||
{
|
{
|
||||||
IrPort = portCont;
|
IrPort = portCont;
|
||||||
|
IrPulseTime = 200;
|
||||||
|
|
||||||
|
if (props.IrPulseTime > 0)
|
||||||
|
{
|
||||||
|
IrPulseTime = (ushort)props.IrPulseTime;
|
||||||
|
}
|
||||||
|
|
||||||
DeviceManager.AddDevice(portCont);
|
DeviceManager.AddDevice(portCont);
|
||||||
|
|
||||||
HasPresets = props.HasPresets;
|
HasPresets = props.HasPresets;
|
||||||
|
|
@ -55,7 +62,6 @@ namespace PepperDash.Essentials.Devices.Common
|
||||||
AnyAudioOut = new RoutingOutputPort(RoutingPortNames.AnyAudioOut, eRoutingSignalType.Audio,
|
AnyAudioOut = new RoutingOutputPort(RoutingPortNames.AnyAudioOut, eRoutingSignalType.Audio,
|
||||||
eRoutingPortConnectionType.DigitalAudio, null, this);
|
eRoutingPortConnectionType.DigitalAudio, null, this);
|
||||||
OutputPorts = new RoutingPortCollection<RoutingOutputPort> { AnyVideoOut, AnyAudioOut };
|
OutputPorts = new RoutingPortCollection<RoutingOutputPort> { AnyVideoOut, AnyAudioOut };
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void LoadPresets(string filePath)
|
public void LoadPresets(string filePath)
|
||||||
|
|
@ -348,26 +354,17 @@ namespace PepperDash.Essentials.Devices.Common
|
||||||
|
|
||||||
public void PowerOn()
|
public void PowerOn()
|
||||||
{
|
{
|
||||||
IrPort.PressRelease(IROutputStandardCommands.IROut_POWER_ON, true);
|
IrPort.Pulse(IROutputStandardCommands.IROut_POWER_ON, IrPulseTime);
|
||||||
IrPort.PressRelease(IROutputStandardCommands.IROut_POWER_ON, false);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void PowerOff()
|
public void PowerOff()
|
||||||
{
|
{
|
||||||
IrPort.PressRelease(IROutputStandardCommands.IROut_POWER_OFF, true);
|
IrPort.Pulse(IROutputStandardCommands.IROut_POWER_OFF, IrPulseTime);
|
||||||
IrPort.PressRelease(IROutputStandardCommands.IROut_POWER_OFF, false);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void PowerToggle()
|
public void PowerToggle()
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
IrPort.Pulse(IROutputStandardCommands.IROut_POWER, IrPulseTime);
|
||||||
}
|
|
||||||
|
|
||||||
public BoolFeedback PowerIsOnFeedback
|
|
||||||
{
|
|
||||||
get { throw new NotImplementedException(); }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
@ -395,7 +392,8 @@ namespace PepperDash.Essentials.Devices.Common
|
||||||
trilist.StringInput[joinMap.Name.JoinNumber].StringValue = Name;
|
trilist.StringInput[joinMap.Name.JoinNumber].StringValue = Name;
|
||||||
|
|
||||||
var stbBase = this as ISetTopBoxControls;
|
var stbBase = this as ISetTopBoxControls;
|
||||||
|
if (stbBase != null)
|
||||||
|
{
|
||||||
trilist.BooleanInput[joinMap.HasDpad.JoinNumber].BoolValue = stbBase.HasDpad;
|
trilist.BooleanInput[joinMap.HasDpad.JoinNumber].BoolValue = stbBase.HasDpad;
|
||||||
trilist.BooleanInput[joinMap.HasNumeric.JoinNumber].BoolValue = stbBase.HasNumeric;
|
trilist.BooleanInput[joinMap.HasNumeric.JoinNumber].BoolValue = stbBase.HasNumeric;
|
||||||
trilist.BooleanInput[joinMap.HasDvr.JoinNumber].BoolValue = stbBase.HasDvr;
|
trilist.BooleanInput[joinMap.HasDvr.JoinNumber].BoolValue = stbBase.HasDvr;
|
||||||
|
|
@ -405,15 +403,19 @@ namespace PepperDash.Essentials.Devices.Common
|
||||||
trilist.SetBoolSigAction(joinMap.Replay.JoinNumber, stbBase.Replay);
|
trilist.SetBoolSigAction(joinMap.Replay.JoinNumber, stbBase.Replay);
|
||||||
|
|
||||||
trilist.SetStringSigAction(joinMap.LoadPresets.JoinNumber, stbBase.LoadPresets);
|
trilist.SetStringSigAction(joinMap.LoadPresets.JoinNumber, stbBase.LoadPresets);
|
||||||
|
}
|
||||||
|
|
||||||
var stbPower = this as IPower;
|
var stbPower = this as IHasPowerControl;
|
||||||
|
if (stbPower != null)
|
||||||
|
{
|
||||||
trilist.SetSigTrueAction(joinMap.PowerOn.JoinNumber, stbPower.PowerOn);
|
trilist.SetSigTrueAction(joinMap.PowerOn.JoinNumber, stbPower.PowerOn);
|
||||||
trilist.SetSigTrueAction(joinMap.PowerOff.JoinNumber, stbPower.PowerOff);
|
trilist.SetSigTrueAction(joinMap.PowerOff.JoinNumber, stbPower.PowerOff);
|
||||||
trilist.SetSigTrueAction(joinMap.PowerToggle.JoinNumber, stbPower.PowerToggle);
|
trilist.SetSigTrueAction(joinMap.PowerToggle.JoinNumber, stbPower.PowerToggle);
|
||||||
|
}
|
||||||
|
|
||||||
var stbDPad = this as IDPad;
|
var stbDPad = this as IDPad;
|
||||||
|
if (stbDPad != null)
|
||||||
|
{
|
||||||
trilist.SetBoolSigAction(joinMap.Up.JoinNumber, stbDPad.Up);
|
trilist.SetBoolSigAction(joinMap.Up.JoinNumber, stbDPad.Up);
|
||||||
trilist.SetBoolSigAction(joinMap.Down.JoinNumber, stbDPad.Down);
|
trilist.SetBoolSigAction(joinMap.Down.JoinNumber, stbDPad.Down);
|
||||||
trilist.SetBoolSigAction(joinMap.Left.JoinNumber, stbDPad.Left);
|
trilist.SetBoolSigAction(joinMap.Left.JoinNumber, stbDPad.Left);
|
||||||
|
|
@ -421,23 +423,31 @@ namespace PepperDash.Essentials.Devices.Common
|
||||||
trilist.SetBoolSigAction(joinMap.Select.JoinNumber, stbDPad.Select);
|
trilist.SetBoolSigAction(joinMap.Select.JoinNumber, stbDPad.Select);
|
||||||
trilist.SetBoolSigAction(joinMap.Menu.JoinNumber, stbDPad.Menu);
|
trilist.SetBoolSigAction(joinMap.Menu.JoinNumber, stbDPad.Menu);
|
||||||
trilist.SetBoolSigAction(joinMap.Exit.JoinNumber, stbDPad.Exit);
|
trilist.SetBoolSigAction(joinMap.Exit.JoinNumber, stbDPad.Exit);
|
||||||
|
}
|
||||||
|
|
||||||
var stbChannel = this as IChannel;
|
var stbChannel = this as IChannel;
|
||||||
|
if (stbChannel != null)
|
||||||
|
{
|
||||||
trilist.SetBoolSigAction(joinMap.ChannelUp.JoinNumber, stbChannel.ChannelUp);
|
trilist.SetBoolSigAction(joinMap.ChannelUp.JoinNumber, stbChannel.ChannelUp);
|
||||||
trilist.SetBoolSigAction(joinMap.ChannelDown.JoinNumber, stbChannel.ChannelDown);
|
trilist.SetBoolSigAction(joinMap.ChannelDown.JoinNumber, stbChannel.ChannelDown);
|
||||||
trilist.SetBoolSigAction(joinMap.LastChannel.JoinNumber, stbChannel.LastChannel);
|
trilist.SetBoolSigAction(joinMap.LastChannel.JoinNumber, stbChannel.LastChannel);
|
||||||
trilist.SetBoolSigAction(joinMap.Guide.JoinNumber, stbChannel.Guide);
|
trilist.SetBoolSigAction(joinMap.Guide.JoinNumber, stbChannel.Guide);
|
||||||
trilist.SetBoolSigAction(joinMap.Info.JoinNumber, stbChannel.Info);
|
trilist.SetBoolSigAction(joinMap.Info.JoinNumber, stbChannel.Info);
|
||||||
trilist.SetBoolSigAction(joinMap.Exit.JoinNumber, stbChannel.Exit);
|
trilist.SetBoolSigAction(joinMap.Exit.JoinNumber, stbChannel.Exit);
|
||||||
|
}
|
||||||
|
|
||||||
var stbColor = this as IColor;
|
var stbColor = this as IColor;
|
||||||
|
if (stbColor != null)
|
||||||
|
{
|
||||||
trilist.SetBoolSigAction(joinMap.Red.JoinNumber, stbColor.Red);
|
trilist.SetBoolSigAction(joinMap.Red.JoinNumber, stbColor.Red);
|
||||||
trilist.SetBoolSigAction(joinMap.Green.JoinNumber, stbColor.Green);
|
trilist.SetBoolSigAction(joinMap.Green.JoinNumber, stbColor.Green);
|
||||||
trilist.SetBoolSigAction(joinMap.Yellow.JoinNumber, stbColor.Yellow);
|
trilist.SetBoolSigAction(joinMap.Yellow.JoinNumber, stbColor.Yellow);
|
||||||
trilist.SetBoolSigAction(joinMap.Blue.JoinNumber, stbColor.Blue);
|
trilist.SetBoolSigAction(joinMap.Blue.JoinNumber, stbColor.Blue);
|
||||||
|
}
|
||||||
|
|
||||||
var stbKeypad = this as ISetTopBoxNumericKeypad;
|
var stbKeypad = this as ISetTopBoxNumericKeypad;
|
||||||
|
if (stbKeypad != null)
|
||||||
|
{
|
||||||
trilist.StringInput[joinMap.KeypadAccessoryButton1Label.JoinNumber].StringValue = stbKeypad.KeypadAccessoryButton1Label;
|
trilist.StringInput[joinMap.KeypadAccessoryButton1Label.JoinNumber].StringValue = stbKeypad.KeypadAccessoryButton1Label;
|
||||||
trilist.StringInput[joinMap.KeypadAccessoryButton2Label.JoinNumber].StringValue = stbKeypad.KeypadAccessoryButton2Label;
|
trilist.StringInput[joinMap.KeypadAccessoryButton2Label.JoinNumber].StringValue = stbKeypad.KeypadAccessoryButton2Label;
|
||||||
|
|
||||||
|
|
@ -458,8 +468,11 @@ namespace PepperDash.Essentials.Devices.Common
|
||||||
trilist.SetBoolSigAction(joinMap.KeypadAccessoryButton2Press.JoinNumber, stbKeypad.KeypadAccessoryButton1);
|
trilist.SetBoolSigAction(joinMap.KeypadAccessoryButton2Press.JoinNumber, stbKeypad.KeypadAccessoryButton1);
|
||||||
trilist.SetBoolSigAction(joinMap.Dash.JoinNumber, stbKeypad.Dash);
|
trilist.SetBoolSigAction(joinMap.Dash.JoinNumber, stbKeypad.Dash);
|
||||||
trilist.SetBoolSigAction(joinMap.KeypadEnter.JoinNumber, stbKeypad.KeypadEnter);
|
trilist.SetBoolSigAction(joinMap.KeypadEnter.JoinNumber, stbKeypad.KeypadEnter);
|
||||||
|
}
|
||||||
|
|
||||||
var stbTransport = this as ITransport;
|
var stbTransport = this as ITransport;
|
||||||
|
if (stbTransport != null)
|
||||||
|
{
|
||||||
trilist.SetBoolSigAction(joinMap.Play.JoinNumber, stbTransport.Play);
|
trilist.SetBoolSigAction(joinMap.Play.JoinNumber, stbTransport.Play);
|
||||||
trilist.SetBoolSigAction(joinMap.Pause.JoinNumber, stbTransport.Pause);
|
trilist.SetBoolSigAction(joinMap.Pause.JoinNumber, stbTransport.Pause);
|
||||||
trilist.SetBoolSigAction(joinMap.Rewind.JoinNumber, stbTransport.Rewind);
|
trilist.SetBoolSigAction(joinMap.Rewind.JoinNumber, stbTransport.Rewind);
|
||||||
|
|
@ -470,6 +483,7 @@ namespace PepperDash.Essentials.Devices.Common
|
||||||
trilist.SetBoolSigAction(joinMap.Record.JoinNumber, stbTransport.Record);
|
trilist.SetBoolSigAction(joinMap.Record.JoinNumber, stbTransport.Record);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public class IRSetTopBoxBaseFactory : EssentialsDeviceFactory<IRSetTopBoxBase>
|
public class IRSetTopBoxBaseFactory : EssentialsDeviceFactory<IRSetTopBoxBase>
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@ namespace PepperDash.Essentials.Devices.Common
|
||||||
public bool HasDvr { get; set; }
|
public bool HasDvr { get; set; }
|
||||||
public bool HasDpad { get; set; }
|
public bool HasDpad { get; set; }
|
||||||
public bool HasNumeric { get; set; }
|
public bool HasNumeric { get; set; }
|
||||||
|
public int IrPulseTime { get; set; }
|
||||||
|
|
||||||
public ControlPropertiesConfig Control { get; set; }
|
public ControlPropertiesConfig Control { get; set; }
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -106,8 +106,8 @@ namespace PepperDash.Essentials.Devices.Common.SoftCodec
|
||||||
if (route.SourceKey.Equals("$off", StringComparison.OrdinalIgnoreCase))
|
if (route.SourceKey.Equals("$off", StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
dest.ReleaseRoute();
|
dest.ReleaseRoute();
|
||||||
if (dest is IPower)
|
if (dest is IHasPowerControl)
|
||||||
(dest as IPower).PowerOff();
|
(dest as IHasPowerControl).PowerOff();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1970,6 +1970,14 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sets the selected source of the available external sources on teh Touch10 UI
|
||||||
|
/// </summary>
|
||||||
|
public void SetSelectedSource(string key)
|
||||||
|
{
|
||||||
|
SendText(string.Format("xCommand UserInterface Presentation ExternalSource Select SourceIdentifier: {0}", key));
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Action that will run when the External Source is selected.
|
/// Action that will run when the External Source is selected.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue