Merge branch 'feature/OccSensor-Fixes' of https://github.com/PepperDash/Essentials into feature/OccSensor-Fixes

This commit is contained in:
Trevor Payne
2020-03-16 10:19:31 -05:00
18 changed files with 1655 additions and 1350 deletions

21
.github/workflows/main.yml vendored Normal file
View File

@@ -0,0 +1,21 @@
name: Build Non-Release Branch
on:
push:
branches:
- feature/*
- bugfix/*
- hotfix/*
- release/*
- development
- master
jobs:
build:
name: Build
runs-on: self-hosted
steps:
- run: Invoke-WebRequest -URI "http://localhost:8080/job/Essentials%20Builds/build?token=$($Env:projectToken)" -Headers @{Authorization = "Basic $([System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes("ndorin:$($Env:token)")))"} -Method POST -UseBasicParsing
env:
token: ${{ secrets.TOKEN }}
projectToken: ${{ secrets.PROJECTTOKEN}}

View File

@@ -1,4 +1,5 @@
using System;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
@@ -16,7 +17,7 @@ using Newtonsoft.Json;
namespace PepperDash.Essentials.Bridges namespace PepperDash.Essentials.Bridges
{ {
public static class DmChassisControllerApiExtensions public static class DmChassisControllerApiExtentions
{ {
public static void LinkToApi(this DmChassisController dmChassis, BasicTriList trilist, uint joinStart, string joinMapKey) public static void LinkToApi(this DmChassisController dmChassis, BasicTriList trilist, uint joinStart, string joinMapKey)
{ {
@@ -81,14 +82,14 @@ namespace PepperDash.Essentials.Bridges
} }
} }
if (advancedTxDevice != null) // Advanced TX device if (basicTxDevice != null && advancedTxDevice == null)
trilist.BooleanInput[joinMap.TxAdvancedIsPresent + ioSlot].BoolValue = true;
if (advancedTxDevice != null)
{ {
advancedTxDevice.AnyVideoInput.VideoStatus.VideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.VideoSyncStatus + ioSlot]); advancedTxDevice.AnyVideoInput.VideoStatus.VideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.VideoSyncStatus + ioSlot]);
// Flag if the TX is an advanced endpoint type
trilist.BooleanInput[joinMap.TxAdvancedIsPresent + ioSlot].BoolValue = true;
} }
else if(advancedTxDevice == null || basicTxDevice != null) // Basic TX device else if(advancedTxDevice == null || basicTxDevice != null)
{ {
Debug.Console(1, "Setting up actions and feedbacks on input card {0}", ioSlot); Debug.Console(1, "Setting up actions and feedbacks on input card {0}", ioSlot);
dmChassis.VideoInputSyncFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.VideoSyncStatus + ioSlot]); dmChassis.VideoInputSyncFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.VideoSyncStatus + ioSlot]);
@@ -167,6 +168,7 @@ namespace PepperDash.Essentials.Bridges
} }
} }
} }
if (dmChassis.RxDictionary.ContainsKey(ioSlot)) if (dmChassis.RxDictionary.ContainsKey(ioSlot))
{ {
Debug.Console(2, "Creating Rx Feedbacks {0}", ioSlot); Debug.Console(2, "Creating Rx Feedbacks {0}", ioSlot);
@@ -191,11 +193,12 @@ namespace PepperDash.Essentials.Bridges
dmChassis.UsbOutputRoutedToFeebacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.OutputUsb + ioSlot]); dmChassis.UsbOutputRoutedToFeebacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.OutputUsb + ioSlot]);
dmChassis.UsbInputRoutedToFeebacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.InputUsb + ioSlot]); dmChassis.UsbInputRoutedToFeebacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.InputUsb + ioSlot]);
dmChassis.OutputNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputNames + ioSlot]); dmChassis.OutputNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputNames + ioSlot]);
dmChassis.InputNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.InputNames + ioSlot]); dmChassis.InputNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.InputNames + ioSlot]);
dmChassis.OutputVideoRouteNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputCurrentVideoInputNames + ioSlot]); dmChassis.OutputVideoRouteNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputCurrentVideoInputNames + ioSlot]);
dmChassis.OutputAudioRouteNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputCurrentAudioInputNames + ioSlot]); dmChassis.OutputAudioRouteNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputCurrentAudioInputNames + ioSlot]);
dmChassis.OutputDisabledByHdcpFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.OutputDisabledByHdcp + ioSlot]);
} }
} }
@@ -281,4 +284,5 @@ namespace PepperDash.Essentials.Bridges
} }
} }
} }

View File

@@ -1,4 +1,4 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
@@ -38,6 +38,10 @@ namespace PepperDash.Essentials.Bridges
/// Range reports high if corresponding input's transmitter supports bridging as a separate device for detailed AV switching, HDCP control, etc. /// Range reports high if corresponding input's transmitter supports bridging as a separate device for detailed AV switching, HDCP control, etc.
/// </summary> /// </summary>
public uint TxAdvancedIsPresent { get; set; } // indicates that there is an attached transmitter that should be bridged to be interacted with public uint TxAdvancedIsPresent { get; set; } // indicates that there is an attached transmitter that should be bridged to be interacted with
/// <summary>
/// Range reports high if corresponding output is disabled by HDCP.
/// </summary>
public uint OutputDisabledByHdcp { get; set; } // indicates that there is an attached transmitter that should be bridged to be interacted with
#endregion #endregion
#region Analogs #region Analogs
@@ -101,6 +105,7 @@ namespace PepperDash.Essentials.Bridges
InputEndpointOnline = 500; //501-699 InputEndpointOnline = 500; //501-699
OutputEndpointOnline = 700; //701-899 OutputEndpointOnline = 700; //701-899
TxAdvancedIsPresent = 1000; //1001-1199 TxAdvancedIsPresent = 1000; //1001-1199
OutputDisabledByHdcp = 1200; //1201-1399
//Analog //Analog
OutputVideo = 100; //101-299 OutputVideo = 100; //101-299
@@ -139,6 +144,7 @@ namespace PepperDash.Essentials.Bridges
OutputEndpointOnline = OutputEndpointOnline + joinOffset; OutputEndpointOnline = OutputEndpointOnline + joinOffset;
HdcpSupportState = HdcpSupportState + joinOffset; HdcpSupportState = HdcpSupportState + joinOffset;
HdcpSupportCapability = HdcpSupportCapability + joinOffset; HdcpSupportCapability = HdcpSupportCapability + joinOffset;
OutputDisabledByHdcp = OutputDisabledByHdcp + joinOffset;
TxAdvancedIsPresent = TxAdvancedIsPresent + joinOffset; TxAdvancedIsPresent = TxAdvancedIsPresent + joinOffset;
} }
} }

View File

@@ -97,9 +97,11 @@ namespace PepperDash.Essentials
directoryPrefix = Crestron.SimplSharp.CrestronIO.Directory.GetApplicationRootDirectory(); directoryPrefix = Crestron.SimplSharp.CrestronIO.Directory.GetApplicationRootDirectory();
var version = Crestron.SimplSharp.Reflection.Assembly.GetExecutingAssembly().GetName().Version; var fullVersion = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyInformationalVersionAttribute), false);
Global.SetAssemblyVersion(string.Format("{0}.{1}.{2}", version.Major, version.Minor, version.Build)); AssemblyInformationalVersionAttribute fullVersionAtt = fullVersion[0] as AssemblyInformationalVersionAttribute;
Global.SetAssemblyVersion(fullVersionAtt.InformationalVersion);
if (CrestronEnvironment.DevicePlatform != eDevicePlatform.Server) // Handles 3-series running Windows CE OS if (CrestronEnvironment.DevicePlatform != eDevicePlatform.Server) // Handles 3-series running Windows CE OS
{ {
@@ -426,11 +428,30 @@ namespace PepperDash.Essentials
DeviceManager.AddDevice(dmpsRoutingController); DeviceManager.AddDevice(dmpsRoutingController);
} }
else if (this.ControllerPrompt.IndexOf("mpc3", StringComparison.OrdinalIgnoreCase) > -1)
{
Debug.Console(2, "MPC3 processor type detected. Adding Mpc3TouchpanelController.");
var butToken = devConf.Properties["buttons"];
if (butToken != null)
{
var buttons = butToken.ToObject<Dictionary<string, Essentials.Core.Touchpanels.KeypadButton>>();
var tpController = new Essentials.Core.Touchpanels.Mpc3TouchpanelController(devConf.Key, devConf.Name, Global.ControlSystem, buttons);
DeviceManager.AddDevice(tpController);
}
else
{
Debug.Console(0, Debug.ErrorLogLevel.Error, "Error: Unable to deserialize buttons collection for device: {0}", devConf.Key);
}
}
else else
{ {
Debug.Console(2, "************Processor is not DMPS type***************"); Debug.Console(2, "************Processor is not DMPS type***************");
} }
continue; continue;
} }

View File

@@ -1,8 +1,10 @@
using System.Reflection; using System.Reflection;
using Crestron.SimplSharp.Reflection;
[assembly: AssemblyTitle("PepperDashEssentials")] [assembly: System.Reflection.AssemblyTitle("PepperDashEssentials")]
[assembly: AssemblyCompany("PepperDash Technology Corp")] [assembly: System.Reflection.AssemblyCompany("PepperDash Technology Corp")]
[assembly: AssemblyProduct("PepperDashEssentials")] [assembly: System.Reflection.AssemblyProduct("PepperDashEssentials")]
[assembly: AssemblyCopyright("Copyright © PepperDash Technology Corp 2018")] [assembly: System.Reflection.AssemblyCopyright("Copyright © PepperDash Technology Corp 2020")]
[assembly: AssemblyVersion("0.0.0.*")] [assembly: System.Reflection.AssemblyVersion("0.0.0.*")]
[assembly: System.Reflection.AssemblyInformationalVersion("0.0.0-buildType-buildNumber")]
[assembly: Crestron.SimplSharp.Reflection.AssemblyInformationalVersion("0.0.0-buildType-buildNumber")]

View File

@@ -1,13 +1,23 @@
function Update-SourceVersion function Update-SourceVersion
{ {
Param ([string]$Version) Param ([string]$Version)
$NewVersion = AssemblyVersion(" + $Version + .*"); $fullVersion = $Version
$baseVersion = [regex]::Match($Version, "(\d+.\d+.\d+).*").captures.groups[1].value
$NewAssemblyVersion = AssemblyVersion(" + $baseVersion + .*")
echo "AssemblyVersion = $NewAssemblyVersion"
$NewAssemblyInformationalVersion = AssemblyInformationalVersion(" + $Version + ")
echo "AssemblyInformationalVersion = $NewAssemblyInformationalVersion"
foreach ($o in $input) foreach ($o in $input)
{ {
Write-output $o.FullName Write-output $o.FullName
$TmpFile = $o.FullName + .tmp $TmpFile = $o.FullName + .tmp
get-content $o.FullName | get-content $o.FullName |
%{$_ -replace AssemblyVersion\("(\d+\.\d+\.\d+)\.\*"\), $NewVersion } > $TmpFile %{
$_ -replace AssemblyVersion\(".*"\), $NewAssemblyVersion} |
%{
$_ -replace AssemblyInformationalVersion\(".*"\), $NewAssemblyInformationalVersion
} > $TmpFile
move-item $TmpFile $o.FullName -force move-item $TmpFile $o.FullName -force
} }
} }
@@ -21,9 +31,10 @@ function Update-AllAssemblyInfoFiles ( $version )
} }
# validate arguments # validate arguments
$r= [System.Text.RegularExpressions.Regex]::Match($args[0], "^\d+\.\d+\.\d+$"); $r= [System.Text.RegularExpressions.Regex]::Match($args[0], "\d+\.\d+\.\d+.*");
if ($r.Success) if ($r.Success)
{ {
echo "Updating Assembly Version to $args ...";
Update-AllAssemblyInfoFiles $args[0]; Update-AllAssemblyInfoFiles $args[0];
} }
else else

View File

@@ -41,3 +41,4 @@ devjson:1 {"deviceKey":"commBridge", "methodName":"ExecuteJoinAction", "params":
devjson:2 {"deviceKey":"display01Comm-com", "methodName":"SendText", "params": [ "I'M GETTING TIRED OF THIS" ]} devjson:2 {"deviceKey":"display01Comm-com", "methodName":"SendText", "params": [ "I'M GETTING TIRED OF THIS" ]}
devjson:10 {"deviceKey":"dmLink-ssh", "methodName":"Connect", "params": []} devjson:10 {"deviceKey":"dmLink-ssh", "methodName":"Connect", "params": []}

View File

@@ -0,0 +1,32 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using PepperDash.Core;
namespace PepperDash.Essentials.Core
{
public static class DeviceFeedbackExtensions
{
/// <summary>
/// Attempts to get and return a feedback property from a device by name.
/// If unsuccessful, returns null.
/// </summary>
/// <param name="device"></param>
/// <param name="propertyName"></param>
/// <returns></returns>
public static Feedback GetFeedbackProperty(this Device device, string propertyName)
{
var feedback = DeviceJsonApi.GetPropertyByName(device.Key, propertyName) as Feedback;
if (feedback != null)
{
return feedback;
}
return null;
}
}
}

View File

@@ -59,7 +59,7 @@ namespace PepperDash.Essentials.Core
} }
/// <summary> /// <summary>
/// /// Gets the properties on a device
/// </summary> /// </summary>
/// <param name="key"></param> /// <param name="key"></param>
/// <returns></returns> /// <returns></returns>
@@ -76,7 +76,33 @@ namespace PepperDash.Essentials.Core
} }
/// <summary> /// <summary>
/// /// Gets a property from a device path by name
/// </summary>
/// <param name="deviceObjectPath"></param>
/// <param name="propertyName"></param>
/// <returns></returns>
public static object GetPropertyByName(string deviceObjectPath, string propertyName)
{
var obj = FindObjectOnPath(deviceObjectPath);
if(obj == null)
return "{ \"error\":\"No Device\"}";
CType t = obj.GetType();
var prop = t.GetProperty(propertyName);
if (prop != null)
{
return prop;
}
else
{
Debug.Console(1, "Unable to find Property: {0} on Device with path: {1}", propertyName, deviceObjectPath);
return null;
}
}
/// <summary>
/// Gets the methods on a device
/// </summary> /// </summary>
/// <param name="key"></param> /// <param name="key"></param>
/// <returns></returns> /// <returns></returns>

View File

@@ -9,6 +9,7 @@ using PepperDash.Core;
using PepperDash.Essentials.Core; using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Config; using PepperDash.Essentials.Core.Config;
using PepperDash.Essentials.Core.CrestronIO; using PepperDash.Essentials.Core.CrestronIO;
using PepperDash.Essentials.Core.Touchpanels;
namespace PepperDash.Essentials.Core namespace PepperDash.Essentials.Core
{ {
@@ -47,13 +48,21 @@ namespace PepperDash.Essentials.Core
var typeName = dc.Type.ToLower(); var typeName = dc.Type.ToLower();
// Check "core" types first
// Check for types that have been added by plugin dlls.
if (FactoryMethods.ContainsKey(typeName))
{
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Loading '{0}' from plugin", dc.Type);
return FactoryMethods[typeName](dc);
}
// Check "core" types
if (typeName == "genericcomm") if (typeName == "genericcomm")
{ {
Debug.Console(1, "Factory Attempting to create new Generic Comm Device"); Debug.Console(1, "Factory Attempting to create new Generic Comm Device");
return new GenericComm(dc); return new GenericComm(dc);
} }
else if (typeName == "ceniodigin104") if (typeName == "ceniodigin104")
{ {
var control = CommFactory.GetControlPropertiesConfig(dc); var control = CommFactory.GetControlPropertiesConfig(dc);
var ipid = control.IpIdInt; var ipid = control.IpIdInt;
@@ -75,13 +84,6 @@ namespace PepperDash.Essentials.Core
return new C2nRthsController(key, name, new C2nRths(cresnetId, Global.ControlSystem)); return new C2nRthsController(key, name, new C2nRths(cresnetId, Global.ControlSystem));
} }
// then check for types that have been added by plugin dlls.
if (FactoryMethods.ContainsKey(typeName))
{
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Loading '{0}' from plugin", dc.Type);
return FactoryMethods[typeName](dc);
}
return null; return null;
} }
} }

View File

@@ -32,6 +32,8 @@ namespace PepperDash.Essentials.Core
List<BoolInputSig> LinkedInputSigs = new List<BoolInputSig>(); List<BoolInputSig> LinkedInputSigs = new List<BoolInputSig>();
List<BoolInputSig> LinkedComplementInputSigs = new List<BoolInputSig>(); List<BoolInputSig> LinkedComplementInputSigs = new List<BoolInputSig>();
List<Crestron.SimplSharpPro.DeviceSupport.Feedback> LinkedCrestronFeedbacks = new List<Crestron.SimplSharpPro.DeviceSupport.Feedback>();
public BoolFeedback(Func<bool> valueFunc) public BoolFeedback(Func<bool> valueFunc)
: this(null, valueFunc) : this(null, valueFunc)
{ {
@@ -56,28 +58,63 @@ namespace PepperDash.Essentials.Core
} }
} }
/// <summary>
/// Links an input sig
/// </summary>
/// <param name="sig"></param>
public void LinkInputSig(BoolInputSig sig) public void LinkInputSig(BoolInputSig sig)
{ {
LinkedInputSigs.Add(sig); LinkedInputSigs.Add(sig);
UpdateSig(sig); UpdateSig(sig);
} }
/// <summary>
/// Unlinks an inputs sig
/// </summary>
/// <param name="sig"></param>
public void UnlinkInputSig(BoolInputSig sig) public void UnlinkInputSig(BoolInputSig sig)
{ {
LinkedInputSigs.Remove(sig); LinkedInputSigs.Remove(sig);
} }
/// <summary>
/// Links an input sig to the complement value
/// </summary>
/// <param name="sig"></param>
public void LinkComplementInputSig(BoolInputSig sig) public void LinkComplementInputSig(BoolInputSig sig)
{ {
LinkedComplementInputSigs.Add(sig); LinkedComplementInputSigs.Add(sig);
UpdateComplementSig(sig); UpdateComplementSig(sig);
} }
/// <summary>
/// Unlinks an input sig to the complement value
/// </summary>
/// <param name="sig"></param>
public void UnlinkComplementInputSig(BoolInputSig sig) public void UnlinkComplementInputSig(BoolInputSig sig)
{ {
LinkedComplementInputSigs.Remove(sig); LinkedComplementInputSigs.Remove(sig);
} }
/// <summary>
/// Links a Crestron Feedback object
/// </summary>
/// <param name="feedback"></param>
public void LinkCrestronFeedback(Crestron.SimplSharpPro.DeviceSupport.Feedback feedback)
{
LinkedCrestronFeedbacks.Add(feedback);
UpdateCrestronFeedback(feedback);
}
/// <summary>
///
/// </summary>
/// <param name="feedback"></param>
public void UnlinkCrestronFeedback(Crestron.SimplSharpPro.DeviceSupport.Feedback feedback)
{
LinkedCrestronFeedbacks.Remove(feedback);
}
public override string ToString() public override string ToString()
{ {
return (InTestMode ? "TEST -- " : "") + BoolValue.ToString(); return (InTestMode ? "TEST -- " : "") + BoolValue.ToString();
@@ -103,6 +140,11 @@ namespace PepperDash.Essentials.Core
{ {
sig.BoolValue = !_BoolValue; sig.BoolValue = !_BoolValue;
} }
void UpdateCrestronFeedback(Crestron.SimplSharpPro.DeviceSupport.Feedback feedback)
{
feedback.State = _BoolValue;
}
} }
} }

View File

@@ -131,6 +131,7 @@
<Compile Include="Devices\CodecInterfaces.cs" /> <Compile Include="Devices\CodecInterfaces.cs" />
<Compile Include="Devices\CrestronProcessor.cs" /> <Compile Include="Devices\CrestronProcessor.cs" />
<Compile Include="Devices\DeviceApiBase.cs" /> <Compile Include="Devices\DeviceApiBase.cs" />
<Compile Include="Devices\DeviceFeedbackExtensions.cs" />
<Compile Include="Devices\PC\InRoomPc.cs" /> <Compile Include="Devices\PC\InRoomPc.cs" />
<Compile Include="Devices\PC\Laptop.cs" /> <Compile Include="Devices\PC\Laptop.cs" />
<Compile Include="Devices\ReconfigurableDevice.cs" /> <Compile Include="Devices\ReconfigurableDevice.cs" />
@@ -236,6 +237,7 @@
<Compile Include="Touchpanels\CrestronTouchpanelPropertiesConfig.cs" /> <Compile Include="Touchpanels\CrestronTouchpanelPropertiesConfig.cs" />
<Compile Include="Touchpanels\Interfaces.cs" /> <Compile Include="Touchpanels\Interfaces.cs" />
<Compile Include="Touchpanels\Keyboards\HabaneroKeyboardController.cs" /> <Compile Include="Touchpanels\Keyboards\HabaneroKeyboardController.cs" />
<Compile Include="Touchpanels\Mpc3Touchpanel.cs" />
<Compile Include="Touchpanels\TriListExtensions.cs" /> <Compile Include="Touchpanels\TriListExtensions.cs" />
<Compile Include="UI PageManagers\BlurayPageManager.cs" /> <Compile Include="UI PageManagers\BlurayPageManager.cs" />
<Compile Include="UI PageManagers\SetTopBoxThreePanelPageManager.cs" /> <Compile Include="UI PageManagers\SetTopBoxThreePanelPageManager.cs" />

View File

@@ -1,7 +1,11 @@
using System.Reflection; using System.Reflection;
using Crestron.SimplSharp.Reflection;
[assembly: System.Reflection.AssemblyTitle("PepperDashEssentialsBase")]
[assembly: System.Reflection.AssemblyCompany("PepperDash Technology Corp")]
[assembly: System.Reflection.AssemblyProduct("PepperDashEssentials")]
[assembly: System.Reflection.AssemblyCopyright("Copyright © PepperDash Technology Corp 2020")]
[assembly: System.Reflection.AssemblyVersion("0.0.0.*")]
[assembly: System.Reflection.AssemblyInformationalVersion("0.0.0-buildType-buildNumber")]
[assembly: Crestron.SimplSharp.Reflection.AssemblyInformationalVersion("0.0.0-buildType-buildNumber")]
[assembly: AssemblyTitle("PepperDashEssentialsBase")]
[assembly: AssemblyCompany("PepperDash Technology Corp")]
[assembly: AssemblyProduct("PepperDashEssentialsBase")]
[assembly: AssemblyCopyright("Copyright © Pepperdash 2019")]
[assembly: AssemblyVersion("1.4.0.*")]

View File

@@ -0,0 +1,145 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro;
using PepperDash.Core;
using PepperDash.Essentials.Core;
namespace PepperDash.Essentials.Core.Touchpanels
{
/// <summary>
/// A wrapper class for the touchpanel portion of an MPC3 class process to allow for configurable
/// behavior of the keybad buttons
/// </summary>
public class Mpc3TouchpanelController : Device
{
MPC3Basic _Touchpanel;
Dictionary<string, KeypadButton> _Buttons;
public Mpc3TouchpanelController(string key, string name, CrestronControlSystem processor, Dictionary<string, KeypadButton> buttons)
: base(key, name)
{
_Touchpanel = processor.ControllerTouchScreenSlotDevice as MPC3Basic;
_Buttons = buttons;
_Touchpanel.ButtonStateChange += new Crestron.SimplSharpPro.DeviceSupport.ButtonEventHandler(_Touchpanel_ButtonStateChange);
AddPostActivationAction(() =>
{
// Link up the button feedbacks to the specified BoolFeedbacks
foreach (var button in _Buttons)
{
var feedbackConfig = button.Value.Feedback;
var device = DeviceManager.GetDeviceForKey(feedbackConfig.DeviceKey) as Device;
if (device != null)
{
var bKey = button.Key.ToLower();
var feedback = device.GetFeedbackProperty(feedbackConfig.BoolFeedbackName);
var bFeedback = feedback as BoolFeedback;
var iFeedback = feedback as IntFeedback;
if (bFeedback != null)
{
if (bKey == "power")
{
bFeedback.LinkCrestronFeedback(_Touchpanel.FeedbackPower);
continue;
}
else if (bKey == "mute")
{
bFeedback.LinkCrestronFeedback(_Touchpanel.FeedbackMute);
continue;
}
// Link to the Crestron Feedback corresponding to the button number
bFeedback.LinkCrestronFeedback(_Touchpanel.Feedbacks[UInt16.Parse(button.Key)]);
}
else if (iFeedback != null)
{
if (bKey == "volumefeedback")
{
var volFeedback = feedback as IntFeedback;
// TODO: Figure out how to subsribe to a volume IntFeedback and link it to the voluem
volFeedback.LinkInputSig(_Touchpanel.VolumeBargraph);
}
}
else
{
Debug.Console(1, this, "Unable to get BoolFeedback with name: {0} from device: {1}", feedbackConfig.BoolFeedbackName, device.Key);
}
}
else
{
Debug.Console(1, this, "Unable to get device with key: {0}", feedbackConfig.DeviceKey);
}
}
});
}
void _Touchpanel_ButtonStateChange(GenericBase device, Crestron.SimplSharpPro.DeviceSupport.ButtonEventArgs args)
{
Debug.Console(1, this, "Button {0} ({1}), {2}", args.Button.Number, args.Button.Name, args.NewButtonState);
var type = args.NewButtonState.ToString();
if (_Buttons.ContainsKey(args.Button.Number.ToString()))
{
Press(args.Button.Number.ToString(), type);
}
else if(_Buttons.ContainsKey(args.Button.Name.ToString()))
{
Press(args.Button.Name.ToString(), type);
}
}
/// <summary>
/// Runs the function associated with this button/type. One of the following strings:
/// Pressed, Released, Tapped, DoubleTapped, Held, HeldReleased
/// </summary>
/// <param name="number"></param>
/// <param name="type"></param>
public void Press(string number, string type)
{
// TODO: In future, consider modifying this to generate actions at device activation time
// to prevent the need to dynamically call the method via reflection on each button press
if (!_Buttons.ContainsKey(number)) { return; }
var but = _Buttons[number];
if (but.EventTypes.ContainsKey(type))
{
foreach (var a in but.EventTypes[type]) { DeviceJsonApi.DoDeviceAction(a); }
}
}
}
/// <summary>
/// Represents the configuration of a keybad buggon
/// </summary>
public class KeypadButton
{
public Dictionary<string, DeviceActionWrapper[]> EventTypes { get; set; }
public KeypadButtonFeedback Feedback { get; set; }
public KeypadButton()
{
EventTypes = new Dictionary<string, DeviceActionWrapper[]>();
Feedback = new KeypadButtonFeedback();
}
}
/// <summary>
///
/// </summary>
public class KeypadButtonFeedback
{
public string DeviceKey { get; set; }
public string BoolFeedbackName { get; set; }
}
}

View File

@@ -1,18 +1,11 @@
using System;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp; using Crestron.SimplSharp;
using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.DM; using Crestron.SimplSharpPro.DM;
using Crestron.SimplSharpPro.DM.Cards; using Crestron.SimplSharpPro.DM.Cards;
using Crestron.SimplSharpPro.DM.Endpoints;
using Crestron.SimplSharpPro.DM.Endpoints.Receivers;
using PepperDash.Core; using PepperDash.Core;
using PepperDash.Essentials.Core; using PepperDash.Essentials.Core;
//using PepperDash.Essentials.DM.Cards;
using PepperDash.Essentials.DM.Config; using PepperDash.Essentials.DM.Config;
namespace PepperDash.Essentials.DM namespace PepperDash.Essentials.DM
@@ -39,16 +32,15 @@ namespace PepperDash.Essentials.DM
public Dictionary<uint, StringFeedback> OutputAudioRouteNameFeedbacks { get; private set; } public Dictionary<uint, StringFeedback> OutputAudioRouteNameFeedbacks { get; private set; }
public Dictionary<uint, IntFeedback> UsbOutputRoutedToFeebacks { get; private set; } public Dictionary<uint, IntFeedback> UsbOutputRoutedToFeebacks { get; private set; }
public Dictionary<uint, IntFeedback> UsbInputRoutedToFeebacks { get; private set; } public Dictionary<uint, IntFeedback> UsbInputRoutedToFeebacks { get; private set; }
public Dictionary<uint, BoolFeedback> OutputDisabledByHdcpFeedbacks { get; private set; }
public IntFeedback SystemIdFeebdack { get; private set; } public IntFeedback SystemIdFeebdack { get; private set; }
public BoolFeedback SystemIdBusyFeedback { get; private set; } public BoolFeedback SystemIdBusyFeedback { get; private set; }
public Dictionary<uint, IntFeedback> InputCardHdcpCapabilityFeedbacks { get; private set; } public Dictionary<uint, IntFeedback> InputCardHdcpCapabilityFeedbacks { get; private set; }
public Dictionary<uint, eHdcpCapabilityType> InputCardHdcpCapabilityTypes { get; private set; } public Dictionary<uint, eHdcpCapabilityType> InputCardHdcpCapabilityTypes { get; private set; }
// Need a couple Lists of generic Backplane ports // Need a couple Lists of generic Backplane ports
public RoutingPortCollection<RoutingInputPort> InputPorts { get; private set; } public RoutingPortCollection<RoutingInputPort> InputPorts { get; private set; }
public RoutingPortCollection<RoutingOutputPort> OutputPorts { get; private set; } public RoutingPortCollection<RoutingOutputPort> OutputPorts { get; private set; }
@@ -83,37 +75,56 @@ namespace PepperDash.Essentials.DM
uint ipid = properties.Control.IpIdInt; uint ipid = properties.Control.IpIdInt;
DmMDMnxn chassis = null; DmMDMnxn chassis = null;
if (type == "dmmd8x8") { chassis = new DmMd8x8(ipid, Global.ControlSystem); } switch (type) {
else if (type == "dmmd8x8rps") { chassis = new DmMd8x8rps(ipid, Global.ControlSystem); } case "dmmd8x8":
else if (type == "dmmd8x8cpu3") { chassis = new DmMd8x8Cpu3(ipid, Global.ControlSystem); } chassis = new DmMd8x8(ipid, Global.ControlSystem);
else if (type == "dmmd8x8cpu3rps") { chassis = new DmMd8x8Cpu3rps(ipid, Global.ControlSystem); } break;
case "dmmd8x8rps":
else if (type == "dmmd16x16") { chassis = new DmMd16x16(ipid, Global.ControlSystem); } chassis = new DmMd8x8rps(ipid, Global.ControlSystem);
else if (type == "dmmd16x16rps") { chassis = new DmMd16x16rps(ipid, Global.ControlSystem); } break;
else if (type == "dmmd16x16cpu3") { chassis = new DmMd16x16Cpu3(ipid, Global.ControlSystem); } case "dmmd8x8cpu3":
else if (type == "dmmd16x16cpu3rps") { chassis = new DmMd16x16Cpu3rps(ipid, Global.ControlSystem); } chassis = new DmMd8x8Cpu3(ipid, Global.ControlSystem);
break;
else if (type == "dmmd32x32") { chassis = new DmMd32x32(ipid, Global.ControlSystem); } case "dmmd8x8cpu3rps":
else if (type == "dmmd32x32rps") { chassis = new DmMd32x32rps(ipid, Global.ControlSystem); } chassis = new DmMd8x8Cpu3rps(ipid, Global.ControlSystem);
else if (type == "dmmd32x32cpu3") { chassis = new DmMd32x32Cpu3(ipid, Global.ControlSystem); } break;
else if (type == "dmmd32x32cpu3rps") { chassis = new DmMd32x32Cpu3rps(ipid, Global.ControlSystem); } case "dmmd16x16":
chassis = new DmMd16x16(ipid, Global.ControlSystem);
break;
case "dmmd16x16rps":
chassis = new DmMd16x16rps(ipid, Global.ControlSystem);
break;
case "dmmd16x16cpu3":
chassis = new DmMd16x16Cpu3(ipid, Global.ControlSystem);
break;
case "dmmd16x16cpu3rps":
chassis = new DmMd16x16Cpu3rps(ipid, Global.ControlSystem);
break;
case "dmmd32x32":
chassis = new DmMd32x32(ipid, Global.ControlSystem);
break;
case "dmmd32x32rps":
chassis = new DmMd32x32rps(ipid, Global.ControlSystem);
break;
case "dmmd32x32cpu3":
chassis = new DmMd32x32Cpu3(ipid, Global.ControlSystem);
break;
case "dmmd32x32cpu3rps":
chassis = new DmMd32x32Cpu3rps(ipid, Global.ControlSystem);
break;
}
if (chassis == null) if (chassis == null)
{
return null; return null;
}
var controller = new DmChassisController(key, name, chassis); var controller = new DmChassisController(key, name, chassis);
// add the cards and port names // add the cards and port names
foreach (var kvp in properties.InputSlots) foreach (var kvp in properties.InputSlots)
{
controller.AddInputCard(kvp.Value, kvp.Key); controller.AddInputCard(kvp.Value, kvp.Key);
}
foreach (var kvp in properties.OutputSlots) foreach (var kvp in properties.OutputSlots)
{
controller.AddOutputCard(kvp.Value, kvp.Key); controller.AddOutputCard(kvp.Value, kvp.Key);
}
foreach (var kvp in properties.VolumeControls) foreach (var kvp in properties.VolumeControls)
{ {
@@ -130,6 +141,7 @@ namespace PepperDash.Essentials.DM
audio = (card as Dmc4kHdo).Audio; audio = (card as Dmc4kHdo).Audio;
if (audio == null) if (audio == null)
continue; continue;
// wire up the audio to something here... // wire up the audio to something here...
controller.AddVolumeControl(outNum, audio); controller.AddVolumeControl(outNum, audio);
} }
@@ -143,19 +155,21 @@ namespace PepperDash.Essentials.DM
Debug.Console(1, controller, "Setting No Route Text value to: {0}", controller.NoRouteText); Debug.Console(1, controller, "Setting No Route Text value to: {0}", controller.NoRouteText);
} }
else else
{
Debug.Console(1, controller, "NoRouteText not specified. Defaulting to blank string.", controller.NoRouteText); Debug.Console(1, controller, "NoRouteText not specified. Defaulting to blank string.", controller.NoRouteText);
}
controller.PropertiesConfig = properties; controller.PropertiesConfig = properties;
return controller; return controller;
} }
catch (System.Exception e) catch (Exception e)
{ {
Debug.Console(0, "Error creating DM chassis:\r{0}", e); Debug.Console(0, "Error creating DM chassis:\r{0}", e);
} }
return null; return null;
} }
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
@@ -179,6 +193,7 @@ namespace PepperDash.Essentials.DM
AudioOutputFeedbacks = new Dictionary<uint, IntFeedback>(); AudioOutputFeedbacks = new Dictionary<uint, IntFeedback>();
UsbOutputRoutedToFeebacks = new Dictionary<uint, IntFeedback>(); UsbOutputRoutedToFeebacks = new Dictionary<uint, IntFeedback>();
UsbInputRoutedToFeebacks = new Dictionary<uint, IntFeedback>(); UsbInputRoutedToFeebacks = new Dictionary<uint, IntFeedback>();
OutputDisabledByHdcpFeedbacks = new Dictionary<uint, BoolFeedback>();
VideoInputSyncFeedbacks = new Dictionary<uint, BoolFeedback>(); VideoInputSyncFeedbacks = new Dictionary<uint, BoolFeedback>();
InputNameFeedbacks = new Dictionary<uint, StringFeedback>(); InputNameFeedbacks = new Dictionary<uint, StringFeedback>();
OutputNameFeedbacks = new Dictionary<uint, StringFeedback>(); OutputNameFeedbacks = new Dictionary<uint, StringFeedback>();
@@ -191,211 +206,170 @@ namespace PepperDash.Essentials.DM
SystemIdBusyFeedback = new BoolFeedback(() => { return (Chassis as DmMDMnxn).SystemIdBusy.BoolValue; }); SystemIdBusyFeedback = new BoolFeedback(() => { return (Chassis as DmMDMnxn).SystemIdBusy.BoolValue; });
InputCardHdcpCapabilityFeedbacks = new Dictionary<uint, IntFeedback>(); InputCardHdcpCapabilityFeedbacks = new Dictionary<uint, IntFeedback>();
InputCardHdcpCapabilityTypes = new Dictionary<uint, eHdcpCapabilityType>(); InputCardHdcpCapabilityTypes = new Dictionary<uint, eHdcpCapabilityType>();
}
public override bool CustomActivate()
{
Debug.Console(2, this, "Setting up feedbacks.");
// Setup Output Card Feedbacks
for (uint x = 1; x <= Chassis.NumberOfOutputs; x++) for (uint x = 1; x <= Chassis.NumberOfOutputs; x++)
{ {
var tempX = x; var tempX = x;
Debug.Console(2, this, "Setting up feedbacks for output slot: {0}", tempX);
if (Chassis.Outputs[tempX] != null) if (Chassis.Outputs[tempX] != null)
{ {
VideoOutputFeedbacks[tempX] = new IntFeedback(() => VideoOutputFeedbacks[tempX] = new IntFeedback(() => {
{
if (Chassis.Outputs[tempX].VideoOutFeedback != null) { return (ushort)Chassis.Outputs[tempX].VideoOutFeedback.Number; }
else { return 0; };
});
AudioOutputFeedbacks[tempX] = new IntFeedback(() =>
{
if (Chassis.Outputs[tempX].AudioOutFeedback != null) { return (ushort)Chassis.Outputs[tempX].AudioOutFeedback.Number; }
else { return 0; };
});
UsbOutputRoutedToFeebacks[tempX] = new IntFeedback(() =>
{
if (Chassis.Outputs[tempX].USBRoutedToFeedback != null) { return (ushort)Chassis.Outputs[tempX].USBRoutedToFeedback.Number; }
else { return 0; };
});
OutputNameFeedbacks[tempX] = new StringFeedback(() =>
{
if (Chassis.Outputs[tempX].NameFeedback != null)
{
return Chassis.Outputs[tempX].NameFeedback.StringValue;
}
else
{
return "";
}
});
OutputVideoRouteNameFeedbacks[tempX] = new StringFeedback(() =>
{
if (Chassis.Outputs[tempX].VideoOutFeedback != null) if (Chassis.Outputs[tempX].VideoOutFeedback != null)
{ return (ushort)Chassis.Outputs[tempX].VideoOutFeedback.Number;
return Chassis.Outputs[tempX].VideoOutFeedback.NameFeedback.StringValue;
} return 0;
else
{
return NoRouteText;
}
}); });
OutputAudioRouteNameFeedbacks[tempX] = new StringFeedback(() => AudioOutputFeedbacks[tempX] = new IntFeedback(() => {
{
if (Chassis.Outputs[tempX].AudioOutFeedback != null) if (Chassis.Outputs[tempX].AudioOutFeedback != null)
{ return (ushort)Chassis.Outputs[tempX].AudioOutFeedback.Number;
return Chassis.Outputs[tempX].AudioOutFeedback.NameFeedback.StringValue;
} return 0;
else });
{ UsbOutputRoutedToFeebacks[tempX] = new IntFeedback(() => {
if (Chassis.Outputs[tempX].USBRoutedToFeedback != null)
return (ushort)Chassis.Outputs[tempX].USBRoutedToFeedback.Number;
return 0;
});
OutputNameFeedbacks[tempX] = new StringFeedback(() => {
if (Chassis.Outputs[tempX].NameFeedback != null)
return Chassis.Outputs[tempX].NameFeedback.StringValue;
return "";
});
OutputVideoRouteNameFeedbacks[tempX] = new StringFeedback(() => {
if (Chassis.Outputs[tempX].VideoOutFeedback != null)
return Chassis.Outputs[tempX].VideoOutFeedback.NameFeedback.StringValue;
return NoRouteText; return NoRouteText;
}
}); });
OutputAudioRouteNameFeedbacks[tempX] = new StringFeedback(() => {
if (Chassis.Outputs[tempX].AudioOutFeedback != null)
return Chassis.Outputs[tempX].AudioOutFeedback.NameFeedback.StringValue;
OutputEndpointOnlineFeedbacks[tempX] = new BoolFeedback(() => return NoRouteText;
{ });
return Chassis.Outputs[tempX].EndpointOnlineFeedback; OutputEndpointOnlineFeedbacks[tempX] = new BoolFeedback(() => Chassis.Outputs[tempX].EndpointOnlineFeedback);
OutputDisabledByHdcpFeedbacks[tempX] = new BoolFeedback(() => {
var output = Chassis.Outputs[tempX];
var hdmiTxOutput = output as Card.HdmiTx;
if (hdmiTxOutput != null)
return hdmiTxOutput.HdmiOutput.DisabledByHdcp.BoolValue;
var dmHdmiOutput = output as Card.DmHdmiOutput;
if (dmHdmiOutput != null)
return dmHdmiOutput.DisabledByHdcpFeedback.BoolValue;
var dmsDmOutAdvanced = output as Card.DmsDmOutAdvanced;
if (dmsDmOutAdvanced != null)
return dmsDmOutAdvanced.DisabledByHdcpFeedback.BoolValue;
var dmps3HdmiAudioOutput = output as Card.Dmps3HdmiAudioOutput;
if (dmps3HdmiAudioOutput != null)
return dmps3HdmiAudioOutput.HdmiOutputPort.DisabledByHdcpFeedback.BoolValue;
var dmps3HdmiOutput = output as Card.Dmps3HdmiOutput;
if (dmps3HdmiOutput != null)
return dmps3HdmiOutput.HdmiOutputPort.DisabledByHdcpFeedback.BoolValue;
var dmps3HdmiOutputBackend = output as Card.Dmps3HdmiOutputBackend;
if (dmps3HdmiOutputBackend != null)
return dmps3HdmiOutputBackend.HdmiOutputPort.DisabledByHdcpFeedback.BoolValue;
// var hdRx4kX10HdmiOutput = output as HdRx4kX10HdmiOutput;
// if (hdRx4kX10HdmiOutput != null)
// return hdRx4kX10HdmiOutput.HdmiOutputPort.DisabledByHdcpFeedback.BoolValue;
// var hdMdNxMHdmiOutput = output as HdMdNxMHdmiOutput;
// if (hdMdNxMHdmiOutput != null)
// return hdMdNxMHdmiOutput.HdmiOutputPort.DisabledByHdcpFeedback.BoolValue;
return false;
}); });
} }
else
{
Debug.Console(2, this, "No Output Card defined in slot: {0}", tempX);
}
};
// Setup Input Card Feedbacks
for (uint x = 1; x <= Chassis.NumberOfInputs; x++)
{
var tempX = x;
Debug.Console(2, this, "Setting up feedbacks for input slot: {0}", tempX);
CheckForHdcp2Property(tempX);
if (Chassis.Inputs[tempX] != null) if (Chassis.Inputs[tempX] != null)
{ {
UsbInputRoutedToFeebacks[tempX] = new IntFeedback(() => {
if (Chassis.Inputs[tempX].USBRoutedToFeedback != null)
return (ushort)Chassis.Inputs[tempX].USBRoutedToFeedback.Number;
UsbInputRoutedToFeebacks[tempX] = new IntFeedback(() => return 0;
{
if (Chassis.Inputs[tempX].USBRoutedToFeedback != null) { return (ushort)Chassis.Inputs[tempX].USBRoutedToFeedback.Number; }
else { return 0; };
}); });
VideoInputSyncFeedbacks[tempX] = new BoolFeedback(() => VideoInputSyncFeedbacks[tempX] = new BoolFeedback(() => {
{
if (Chassis.Inputs[tempX].VideoDetectedFeedback != null) if (Chassis.Inputs[tempX].VideoDetectedFeedback != null)
return Chassis.Inputs[tempX].VideoDetectedFeedback.BoolValue; return Chassis.Inputs[tempX].VideoDetectedFeedback.BoolValue;
else
return false; return false;
}); });
InputNameFeedbacks[tempX] = new StringFeedback(() => InputNameFeedbacks[tempX] = new StringFeedback(() => {
{
if (Chassis.Inputs[tempX].NameFeedback != null) if (Chassis.Inputs[tempX].NameFeedback != null)
{
return Chassis.Inputs[tempX].NameFeedback.StringValue; return Chassis.Inputs[tempX].NameFeedback.StringValue;
}
else
{
return ""; return "";
}
}); });
InputEndpointOnlineFeedbacks[tempX] = new BoolFeedback(() => InputEndpointOnlineFeedbacks[tempX] = new BoolFeedback(() => { return Chassis.Inputs[tempX].EndpointOnlineFeedback; });
{
return Chassis.Inputs[tempX].EndpointOnlineFeedback;
});
InputCardHdcpCapabilityFeedbacks[tempX] = new IntFeedback(() => InputCardHdcpCapabilityFeedbacks[tempX] = new IntFeedback(() => {
{
var inputCard = Chassis.Inputs[tempX]; var inputCard = Chassis.Inputs[tempX];
Debug.Console(2, this, "Adding InputCardHdcpCapabilityFeedback for slot: {0}", inputCard);
if (inputCard.Card is DmcHd) if (inputCard.Card is DmcHd)
{ {
InputCardHdcpCapabilityTypes[tempX] = eHdcpCapabilityType.HdcpAutoSupport; InputCardHdcpCapabilityTypes[tempX] = eHdcpCapabilityType.HdcpAutoSupport;
if ((inputCard.Card as DmcHd).HdmiInput.HdcpSupportOnFeedback.BoolValue) if ((inputCard.Card as DmcHd).HdmiInput.HdcpSupportOnFeedback.BoolValue)
return 1; return 1;
else
return 0; return 0;
} }
else if (inputCard.Card is DmcHdDsp)
if (inputCard.Card is DmcHdDsp)
{ {
InputCardHdcpCapabilityTypes[tempX] = eHdcpCapabilityType.HdcpAutoSupport; InputCardHdcpCapabilityTypes[tempX] = eHdcpCapabilityType.HdcpAutoSupport;
if ((inputCard.Card as DmcHdDsp).HdmiInput.HdcpSupportOnFeedback.BoolValue) if ((inputCard.Card as DmcHdDsp).HdmiInput.HdcpSupportOnFeedback.BoolValue)
return 1; return 1;
else
return 0; return 0;
} }
else if (inputCard.Card is Dmc4kHdBase) if (inputCard.Card is Dmc4kHdBase)
{ {
InputCardHdcpCapabilityTypes[tempX] = eHdcpCapabilityType.Hdcp2_2Support; InputCardHdcpCapabilityTypes[tempX] = eHdcpCapabilityType.Hdcp2_2Support;
return (int)(inputCard.Card as Dmc4kHdBase).HdmiInput.HdcpReceiveCapability; return (int)(inputCard.Card as Dmc4kHdBase).HdmiInput.HdcpReceiveCapability;
} }
else if (inputCard.Card is Dmc4kCBase) if (inputCard.Card is Dmc4kCBase)
{ {
if (PropertiesConfig.InputSlotSupportsHdcp2[tempX]) if (PropertiesConfig.InputSlotSupportsHdcp2[tempX])
{ {
InputCardHdcpCapabilityTypes[tempX] = eHdcpCapabilityType.HdcpAutoSupport; InputCardHdcpCapabilityTypes[tempX] = eHdcpCapabilityType.HdcpAutoSupport;
return (int)(inputCard.Card as Dmc4kCBase).DmInput.HdcpReceiveCapability; return (int)(inputCard.Card as Dmc4kCBase).DmInput.HdcpReceiveCapability;
} }
else if ((inputCard.Card as Dmc4kCBase).DmInput.HdcpSupportOnFeedback.BoolValue)
if ((inputCard.Card as Dmc4kCBase).DmInput.HdcpSupportOnFeedback.BoolValue)
return 1; return 1;
else
return 0; return 0;
} }
else if (inputCard.Card is Dmc4kCDspBase) if (inputCard.Card is Dmc4kCDspBase)
{ {
if (PropertiesConfig.InputSlotSupportsHdcp2[tempX]) if (PropertiesConfig.InputSlotSupportsHdcp2[tempX])
{ {
InputCardHdcpCapabilityTypes[tempX] = eHdcpCapabilityType.HdcpAutoSupport; InputCardHdcpCapabilityTypes[tempX] = eHdcpCapabilityType.HdcpAutoSupport;
return (int)(inputCard.Card as Dmc4kCDspBase).DmInput.HdcpReceiveCapability; return (int)(inputCard.Card as Dmc4kCDspBase).DmInput.HdcpReceiveCapability;
} }
else if ((inputCard.Card as Dmc4kCDspBase).DmInput.HdcpSupportOnFeedback.BoolValue)
if ((inputCard.Card as Dmc4kCDspBase).DmInput.HdcpSupportOnFeedback.BoolValue)
return 1; return 1;
else
return 0; return 0;
} }
else
return 0; return 0;
}); });
} }
else
{
Debug.Console(2, this, "No Input Card defined in slot: {0}", tempX);
} }
} }
return base.CustomActivate();
}
/// <summary>
/// Checks for presence of config property defining if the input card supports HDCP2.
/// If not found, assumes false.
/// </summary>
/// <param name="inputSlot">Input Slot</param>
void CheckForHdcp2Property(uint inputSlot)
{
if (!PropertiesConfig.InputSlotSupportsHdcp2.ContainsKey(inputSlot))
{
Debug.Console(0, this, Debug.ErrorLogLevel.Warning,
@"Properties Config does not define inputSlotSupportsHdcp2 entry for input card: {0}. Assuming false.
If HDCP2 is required, HDCP control/feedback will not fucntion correctly!", inputSlot);
PropertiesConfig.InputSlotSupportsHdcp2.Add(inputSlot, false);
}
else
Debug.Console(2, this, "inputSlotSupportsHdcp2 for input card: {0} = {1}", inputSlot, PropertiesConfig.InputSlotSupportsHdcp2[inputSlot]);
}
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
@@ -517,7 +491,8 @@ If HDCP2 is required, HDCP control/feedback will not fucntion correctly!", input
{ {
new DmcSdi(number, Chassis); new DmcSdi(number, Chassis);
AddInputPortWithDebug(number, "sdiIn", eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Sdi); AddInputPortWithDebug(number, "sdiIn", eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Sdi);
AddOutputPortWithDebug(string.Format("inputCard{0}", number), "sdiOut", eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Sdi, null); AddOutputPortWithDebug(string.Format("inputCard{0}", number), "sdiOut", eRoutingSignalType.Audio | eRoutingSignalType.Video,
eRoutingPortConnectionType.Sdi, null);
AddInCardHdmiAndAudioLoopPorts(number); AddInCardHdmiAndAudioLoopPorts(number);
} }
else if (type == "dmcdvi") else if (type == "dmcdvi")
@@ -577,6 +552,7 @@ If HDCP2 is required, HDCP control/feedback will not fucntion correctly!", input
AddInputPortWithDebug(number, "dmIn", eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.DmCat); AddInputPortWithDebug(number, "dmIn", eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.DmCat);
AddInCardHdmiAndAudioLoopPorts(number); AddInCardHdmiAndAudioLoopPorts(number);
} }
void AddDmInCardPorts(uint number, ICec cecPort) void AddDmInCardPorts(uint number, ICec cecPort)
{ {
AddInputPortWithDebug(number, "dmIn", eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.DmCat, cecPort); AddInputPortWithDebug(number, "dmIn", eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.DmCat, cecPort);
@@ -591,13 +567,15 @@ If HDCP2 is required, HDCP control/feedback will not fucntion correctly!", input
void AddInCardHdmiAndAudioLoopPorts(uint number) void AddInCardHdmiAndAudioLoopPorts(uint number)
{ {
AddOutputPortWithDebug(string.Format("inputCard{0}", number), "hdmiLoopOut", eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, null); AddOutputPortWithDebug(string.Format("inputCard{0}", number), "hdmiLoopOut", eRoutingSignalType.Audio | eRoutingSignalType.Video,
eRoutingPortConnectionType.Hdmi, null);
AddOutputPortWithDebug(string.Format("inputCard{0}", number), "audioLoopOut", eRoutingSignalType.Audio, eRoutingPortConnectionType.Hdmi, null); AddOutputPortWithDebug(string.Format("inputCard{0}", number), "audioLoopOut", eRoutingSignalType.Audio, eRoutingPortConnectionType.Hdmi, null);
} }
void AddInCardHdmiLoopPort(uint number) void AddInCardHdmiLoopPort(uint number)
{ {
AddOutputPortWithDebug(string.Format("inputCard{0}", number), "hdmiLoopOut", eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, null); AddOutputPortWithDebug(string.Format("inputCard{0}", number), "hdmiLoopOut", eRoutingSignalType.Audio | eRoutingSignalType.Video,
eRoutingPortConnectionType.Hdmi, null);
} }
/// <summary> /// <summary>
@@ -617,13 +595,6 @@ If HDCP2 is required, HDCP control/feedback will not fucntion correctly!", input
var cecPort2 = outputCard.Card2.HdmiOutput; var cecPort2 = outputCard.Card2.HdmiOutput;
AddDmcHdoPorts(number, cecPort1, cecPort2); AddDmcHdoPorts(number, cecPort1, cecPort2);
} }
else if (type == "dmc4kzhdo")
{
var outputCard = new Dmc4kzHdoSingle(number, Chassis);
var cecPort1 = outputCard.Card1.HdmiOutput;
var cecPort2 = outputCard.Card2.HdmiOutput;
AddDmcHdoPorts(number, cecPort1, cecPort2);
}
else if (type == "dmchdo") else if (type == "dmchdo")
{ {
var outputCard = new DmcHdoSingle(number, Chassis); var outputCard = new DmcHdoSingle(number, Chassis);
@@ -659,23 +630,29 @@ If HDCP2 is required, HDCP control/feedback will not fucntion correctly!", input
{ {
var outputCard = new DmcSoHdSingle(number, Chassis); var outputCard = new DmcSoHdSingle(number, Chassis);
var cecPort1 = outputCard.Card1.HdmiOutput; var cecPort1 = outputCard.Card1.HdmiOutput;
AddOutputPortWithDebug(string.Format("outputCard{0}", number), "dmOut1", eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.DmMmFiber, 2 * (number - 1) + 1); AddOutputPortWithDebug(string.Format("outputCard{0}", number), "dmOut1", eRoutingSignalType.Audio | eRoutingSignalType.Video,
AddOutputPortWithDebug(string.Format("outputCard{0}", number), "hdmiOut1", eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, 2 * (number - 1) + 1, cecPort1); eRoutingPortConnectionType.DmMmFiber, 2 * (number - 1) + 1);
AddOutputPortWithDebug(string.Format("outputCard{0}", number), "dmOut2", eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.DmMmFiber, 2 * (number - 1) + 2); AddOutputPortWithDebug(string.Format("outputCard{0}", number), "hdmiOut1", eRoutingSignalType.Audio | eRoutingSignalType.Video,
eRoutingPortConnectionType.Hdmi, 2 * (number - 1) + 1, cecPort1);
AddOutputPortWithDebug(string.Format("outputCard{0}", number), "dmOut2", eRoutingSignalType.Audio | eRoutingSignalType.Video,
eRoutingPortConnectionType.DmMmFiber, 2 * (number - 1) + 2);
} }
else if (type == "dmcs2ohd") else if (type == "dmcs2ohd")
{ {
var outputCard = new DmcS2oHdSingle(number, Chassis); var outputCard = new DmcS2oHdSingle(number, Chassis);
var cecPort1 = outputCard.Card1.HdmiOutput; var cecPort1 = outputCard.Card1.HdmiOutput;
AddOutputPortWithDebug(string.Format("outputCard{0}", number), "dmOut1", eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.DmSmFiber, 2 * (number - 1) + 1); AddOutputPortWithDebug(string.Format("outputCard{0}", number), "dmOut1", eRoutingSignalType.Audio | eRoutingSignalType.Video,
AddOutputPortWithDebug(string.Format("outputCard{0}", number), "hdmiOut1", eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, 2 * (number - 1) + 1, cecPort1); eRoutingPortConnectionType.DmSmFiber, 2 * (number - 1) + 1);
AddOutputPortWithDebug(string.Format("outputCard{0}", number), "dmOut2", eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.DmSmFiber, 2 * (number - 1) + 2); AddOutputPortWithDebug(string.Format("outputCard{0}", number), "hdmiOut1", eRoutingSignalType.Audio | eRoutingSignalType.Video,
eRoutingPortConnectionType.Hdmi, 2 * (number - 1) + 1, cecPort1);
AddOutputPortWithDebug(string.Format("outputCard{0}", number), "dmOut2", eRoutingSignalType.Audio | eRoutingSignalType.Video,
eRoutingPortConnectionType.DmSmFiber, 2 * (number - 1) + 2);
} }
else if (type == "dmcstro") else if (type == "dmcstro")
{ {
var outputCard = new DmcStroSingle(number, Chassis); var outputCard = new DmcStroSingle(number, Chassis);
AddOutputPortWithDebug(string.Format("outputCard{0}", number), "streamOut", eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Streaming, 2 * (number - 1) + 1); AddOutputPortWithDebug(string.Format("outputCard{0}", number), "streamOut", eRoutingSignalType.Audio | eRoutingSignalType.Video,
eRoutingPortConnectionType.Streaming, 2 * (number - 1) + 1);
} }
else else
@@ -684,20 +661,26 @@ If HDCP2 is required, HDCP control/feedback will not fucntion correctly!", input
void AddDmcHdoPorts(uint number, ICec cecPort1, ICec cecPort2) void AddDmcHdoPorts(uint number, ICec cecPort1, ICec cecPort2)
{ {
AddOutputPortWithDebug(string.Format("outputCard{0}", number), "hdmiOut1", eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, 2 * (number - 1) + 1, cecPort1); AddOutputPortWithDebug(string.Format("outputCard{0}", number), "hdmiOut1", eRoutingSignalType.Audio | eRoutingSignalType.Video,
AddOutputPortWithDebug(string.Format("outputCard{0}", number), "audioOut1", eRoutingSignalType.Audio, eRoutingPortConnectionType.LineAudio, 2 * (number - 1) + 1); eRoutingPortConnectionType.Hdmi, 2 * (number - 1) + 1, cecPort1);
AddOutputPortWithDebug(string.Format("outputCard{0}", number), "hdmiOut2", eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, 2 * (number - 1) + 2, cecPort2); AddOutputPortWithDebug(string.Format("outputCard{0}", number), "audioOut1", eRoutingSignalType.Audio, eRoutingPortConnectionType.LineAudio,
AddOutputPortWithDebug(string.Format("outputCard{0}", number), "audioOut2", eRoutingSignalType.Audio, eRoutingPortConnectionType.LineAudio, 2 * (number - 1) + 2); 2 * (number - 1) + 1);
AddOutputPortWithDebug(string.Format("outputCard{0}", number), "hdmiOut2", eRoutingSignalType.Audio | eRoutingSignalType.Video,
eRoutingPortConnectionType.Hdmi, 2 * (number - 1) + 2, cecPort2);
AddOutputPortWithDebug(string.Format("outputCard{0}", number), "audioOut2", eRoutingSignalType.Audio, eRoutingPortConnectionType.LineAudio,
2 * (number - 1) + 2);
} }
void AddDmcCoPorts(uint number, ICec cecPort1) void AddDmcCoPorts(uint number, ICec cecPort1)
{ {
AddOutputPortWithDebug(string.Format("outputCard{0}", number), "dmOut1", eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.DmCat, 2 * (number - 1) + 1); AddOutputPortWithDebug(string.Format("outputCard{0}", number), "dmOut1", eRoutingSignalType.Audio | eRoutingSignalType.Video,
AddOutputPortWithDebug(string.Format("outputCard{0}", number), "hdmiOut1", eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, 2 * (number - 1) + 1, cecPort1); eRoutingPortConnectionType.DmCat, 2 * (number - 1) + 1);
AddOutputPortWithDebug(string.Format("outputCard{0}", number), "dmOut2", eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.DmCat, 2 * (number - 1) + 2); AddOutputPortWithDebug(string.Format("outputCard{0}", number), "hdmiOut1", eRoutingSignalType.Audio | eRoutingSignalType.Video,
eRoutingPortConnectionType.Hdmi, 2 * (number - 1) + 1, cecPort1);
AddOutputPortWithDebug(string.Format("outputCard{0}", number), "dmOut2", eRoutingSignalType.Audio | eRoutingSignalType.Video,
eRoutingPortConnectionType.DmCat, 2 * (number - 1) + 2);
} }
/// <summary> /// <summary>
/// Adds InputPort /// Adds InputPort
/// </summary> /// </summary>
@@ -719,16 +702,11 @@ If HDCP2 is required, HDCP control/feedback will not fucntion correctly!", input
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);
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>
/// Adds OutputPort /// Adds OutputPort
@@ -768,7 +746,6 @@ If HDCP2 is required, HDCP control/feedback will not fucntion correctly!", input
//} //}
void Chassis_DMSystemChange(Switch device, DMSystemEventArgs args) void Chassis_DMSystemChange(Switch device, DMSystemEventArgs args)
{ {
switch (args.EventId) switch (args.EventId)
@@ -790,8 +767,8 @@ If HDCP2 is required, HDCP control/feedback will not fucntion correctly!", input
void Chassis_DMInputChange(Switch device, DMInputEventArgs args) void Chassis_DMInputChange(Switch device, DMInputEventArgs args)
{ {
switch (args.EventId)
switch (args.EventId) { {
case DMInputEventIds.EndpointOnlineEventId: case DMInputEventIds.EndpointOnlineEventId:
{ {
Debug.Console(2, this, "DM Input EndpointOnlineEventId for input: {0}. State: {1}", args.Number, device.Inputs[args.Number].EndpointOnlineFeedback); Debug.Console(2, this, "DM Input EndpointOnlineEventId for input: {0}. State: {1}", args.Number, device.Inputs[args.Number].EndpointOnlineFeedback);
@@ -819,7 +796,7 @@ If HDCP2 is required, HDCP control/feedback will not fucntion correctly!", input
case DMInputEventIds.UsbRoutedToEventId: case DMInputEventIds.UsbRoutedToEventId:
{ {
Debug.Console(2, this, "DM Input {0} UsbRoutedToEventId", args.Number); Debug.Console(2, this, "DM Input {0} UsbRoutedToEventId", args.Number);
if(UsbInputRoutedToFeebacks[args.Number] != null) if (UsbInputRoutedToFeebacks[args.Number] != null)
UsbInputRoutedToFeebacks[args.Number].FireUpdate(); UsbInputRoutedToFeebacks[args.Number].FireUpdate();
else else
Debug.Console(1, this, "No index of {0} found in UsbInputRoutedToFeedbacks"); Debug.Console(1, this, "No index of {0} found in UsbInputRoutedToFeedbacks");
@@ -841,6 +818,7 @@ If HDCP2 is required, HDCP control/feedback will not fucntion correctly!", input
} }
} }
} }
/// ///
/// </summary> /// </summary>
void Chassis_DMOutputChange(Switch device, DMOutputEventArgs args) void Chassis_DMOutputChange(Switch device, DMOutputEventArgs args)
@@ -855,51 +833,47 @@ If HDCP2 is required, HDCP control/feedback will not fucntion correctly!", input
{ {
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. State: {1}", args.Number, Chassis.Outputs[output].EndpointOnlineFeedback); Debug.Console(2, this, "Output {0} DMOutputEventIds.EndpointOnlineEventId fired. State: {1}", args.Number,
Chassis.Outputs[output].EndpointOnlineFeedback);
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) 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); Debug.Console(2, this, "DMSwitchVideo:{0} Routed Input:{1} Output:{2}'", this.Name, Chassis.Outputs[output].VideoOutFeedback.Number, output);
}
if (VideoOutputFeedbacks.ContainsKey(output)) if (VideoOutputFeedbacks.ContainsKey(output))
{
VideoOutputFeedbacks[output].FireUpdate(); VideoOutputFeedbacks[output].FireUpdate();
}
if (OutputVideoRouteNameFeedbacks.ContainsKey(output)) if (OutputVideoRouteNameFeedbacks.ContainsKey(output))
{
OutputVideoRouteNameFeedbacks[output].FireUpdate(); OutputVideoRouteNameFeedbacks[output].FireUpdate();
}
break; break;
} }
case DMOutputEventIds.AudioOutEventId: case DMOutputEventIds.AudioOutEventId:
{ {
if (Chassis.Outputs[output].AudioOutFeedback != null) if (Chassis.Outputs[output].AudioOutFeedback != null)
{
Debug.Console(2, this, "DMSwitchAudio:{0} Routed Input:{1} Output:{2}'", this.Name, Chassis.Outputs[output].AudioOutFeedback.Number, output); Debug.Console(2, this, "DMSwitchAudio:{0} Routed Input:{1} Output:{2}'", this.Name, Chassis.Outputs[output].AudioOutFeedback.Number, output);
}
if (AudioOutputFeedbacks.ContainsKey(output)) if (AudioOutputFeedbacks.ContainsKey(output))
{
AudioOutputFeedbacks[output].FireUpdate(); AudioOutputFeedbacks[output].FireUpdate();
}
if (OutputAudioRouteNameFeedbacks.ContainsKey(output)) if (OutputAudioRouteNameFeedbacks.ContainsKey(output))
{
OutputAudioRouteNameFeedbacks[output].FireUpdate(); OutputAudioRouteNameFeedbacks[output].FireUpdate();
}
break; break;
} }
case DMOutputEventIds.OutputNameEventId: case DMOutputEventIds.OutputNameEventId:
@@ -914,13 +888,18 @@ If HDCP2 is required, HDCP control/feedback will not fucntion correctly!", input
UsbOutputRoutedToFeebacks[args.Number].FireUpdate(); UsbOutputRoutedToFeebacks[args.Number].FireUpdate();
break; break;
} }
case DMOutputEventIds.DisabledByHdcpEventId:
{
Debug.Console(2, this, "DM Output {0} DisabledByHdcpEventId", args.Number);
OutputDisabledByHdcpFeedbacks[args.Number].FireUpdate();
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;
} }
} }
} }
/// <summary> /// <summary>
@@ -931,13 +910,9 @@ If HDCP2 is required, HDCP control/feedback will not fucntion correctly!", input
{ {
if (RouteOffTimers.ContainsKey(pnt)) if (RouteOffTimers.ContainsKey(pnt))
return; return;
RouteOffTimers[pnt] = new CTimer(o => RouteOffTimers[pnt] = new CTimer(o => { ExecuteSwitch(0, pnt.Number, pnt.Type); }, RouteOffTime);
{
ExecuteSwitch(0, pnt.Number, pnt.Type);
}, RouteOffTime);
} }
// Send out sigs when coming online // Send out sigs when coming online
void IsOnline_OutputChange(object sender, EventArgs e) void IsOnline_OutputChange(object sender, EventArgs e)
{ {
@@ -950,19 +925,19 @@ If HDCP2 is required, HDCP control/feedback will not fucntion correctly!", input
foreach (var kvp in InputNames) foreach (var kvp in InputNames)
Chassis.Inputs[kvp.Key].Name.StringValue = kvp.Value; Chassis.Inputs[kvp.Key].Name.StringValue = kvp.Value;
if (OutputNames != null) if (OutputNames != null)
foreach(var kvp in OutputNames) foreach (var kvp in OutputNames)
Chassis.Outputs[kvp.Key].Name.StringValue = kvp.Value; Chassis.Outputs[kvp.Key].Name.StringValue = kvp.Value;
} }
} }
#region IRouting Members #region IRouting Members
public void ExecuteSwitch(object inputSelector, object outputSelector, eRoutingSignalType sigType) public void ExecuteSwitch(object inputSelector, object outputSelector, eRoutingSignalType sigType)
{ {
Debug.Console(2, this, "Making an awesome DM route from {0} to {1} {2}", inputSelector, outputSelector, sigType); Debug.Console(2, this, "Making an awesome DM route from {0} to {1} {2}", inputSelector, outputSelector, sigType);
var input = Convert.ToUInt32(inputSelector); // Cast can sometimes fail var input = Convert.ToUInt32(inputSelector); // Cast can sometimes fail
var output = Convert.ToUInt32(outputSelector); var output = Convert.ToUInt32(outputSelector);
// Check to see if there's an off timer waiting on this and if so, cancel // Check to see if there's an off timer waiting on this and if so, cancel
var key = new PortNumberType(output, sigType); var key = new PortNumberType(output, sigType);
if (input == 0) if (input == 0)
@@ -971,7 +946,7 @@ If HDCP2 is required, HDCP control/feedback will not fucntion correctly!", input
} }
else else
{ {
if(RouteOffTimers.ContainsKey(key)) if (RouteOffTimers.ContainsKey(key))
{ {
Debug.Console(2, this, "{0} cancelling route off due to new source", output); Debug.Console(2, this, "{0} cancelling route off due to new source", output);
RouteOffTimers[key].Stop(); RouteOffTimers[key].Stop();
@@ -1005,11 +980,10 @@ If HDCP2 is required, HDCP control/feedback will not fucntion correctly!", input
if ((sigType | eRoutingSignalType.UsbInput) == eRoutingSignalType.UsbInput) if ((sigType | eRoutingSignalType.UsbInput) == eRoutingSignalType.UsbInput)
{ {
Chassis.USBEnter.BoolValue = true; Chassis.USBEnter.BoolValue = true;
if(Chassis.Inputs[input] != null) if (Chassis.Inputs[input] != null)
Chassis.Inputs[input].USBRoutedTo = outCard; Chassis.Inputs[input].USBRoutedTo = outCard;
} }
} }
#endregion #endregion
} }
@@ -1018,10 +992,12 @@ If HDCP2 is required, HDCP control/feedback will not fucntion correctly!", input
public uint Number { get; private set; } public uint Number { get; private set; }
public eRoutingSignalType Type { get; private set; } public eRoutingSignalType Type { get; private set; }
public PortNumberType(uint number, eRoutingSignalType type) : this() public PortNumberType(uint number, eRoutingSignalType type)
: this()
{ {
Number = number; Number = number;
Type = type; Type = type;
} }
} }
} }

View File

@@ -82,6 +82,10 @@
<HintPath>..\..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpPro.exe</HintPath> <HintPath>..\..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpPro.exe</HintPath>
<Private>False</Private> <Private>False</Private>
</Reference> </Reference>
<Reference Include="SimplSharpReflectionInterface, Version=1.0.5583.25238, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpReflectionInterface.dll</HintPath>
</Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
<Reference Include="System.Data" /> <Reference Include="System.Data" />

View File

@@ -1,7 +1,10 @@
using System.Reflection; using System.Reflection;
using Crestron.SimplSharp.Reflection;
[assembly: AssemblyTitle("Essentials_DM")] [assembly: System.Reflection.AssemblyTitle("Essentials_DM")]
[assembly: AssemblyCompany("PepperDash Technology Corp")] [assembly: System.Reflection.AssemblyCompany("PepperDash Technology Corp")]
[assembly: AssemblyProduct("Essentials_DM")] [assembly: System.Reflection.AssemblyProduct("PepperDashEssentials")]
[assembly: AssemblyCopyright("Copyright © 2019")] [assembly: System.Reflection.AssemblyCopyright("Copyright © PepperDash Technology Corp 2020")]
[assembly: AssemblyVersion("1.3.*")] [assembly: System.Reflection.AssemblyVersion("0.0.0.*")]
[assembly: System.Reflection.AssemblyInformationalVersion("0.0.0-buildType-buildNumber")]
[assembly: Crestron.SimplSharp.Reflection.AssemblyInformationalVersion("0.0.0-buildType-buildNumber")]

View File

@@ -1,7 +1,10 @@
using System.Reflection; using System.Reflection;
using Crestron.SimplSharp.Reflection;
[assembly: AssemblyTitle("Essentials_Devices_Common")] [assembly: System.Reflection.AssemblyTitle("Essentials_Devices_Common")]
[assembly: AssemblyCompany("PepperDash Technology Corp")] [assembly: System.Reflection.AssemblyCompany("PepperDash Technology Corp")]
[assembly: AssemblyProduct("Essentials_Devices_Common")] [assembly: System.Reflection.AssemblyProduct("PepperDashEssentials")]
[assembly: AssemblyCopyright("Copyright © 2019")] [assembly: System.Reflection.AssemblyCopyright("Copyright © PepperDash Technology Corp 2020")]
[assembly: AssemblyVersion("1.4.*")] [assembly: System.Reflection.AssemblyVersion("0.0.0.*")]
[assembly: System.Reflection.AssemblyInformationalVersion("0.0.0-buildType-buildNumber")]
[assembly: Crestron.SimplSharp.Reflection.AssemblyInformationalVersion("0.0.0-buildType-buildNumber")]