mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-15 12:44:58 +00:00
Merge pull request #556 from PepperDash/feature/add-hdbasettx-support
Feature/add hdbasettx support
This commit is contained in:
@@ -122,6 +122,8 @@ namespace PepperDash.Essentials.DM
|
|||||||
return new DmTx4kz302CController(key, name, new DmTx4kz302C(chassis.Inputs[num]));
|
return new DmTx4kz302CController(key, name, new DmTx4kz302C(chassis.Inputs[num]));
|
||||||
if (typeName.StartsWith("dmtx401"))
|
if (typeName.StartsWith("dmtx401"))
|
||||||
return new DmTx401CController(key, name, new DmTx401C(chassis.Inputs[num]));
|
return new DmTx401CController(key, name, new DmTx401C(chassis.Inputs[num]));
|
||||||
|
if (typeName.StartsWith("hdbasettx"))
|
||||||
|
return new HDBaseTTxController(key, name, new HDTx3CB(chassis.Inputs[num]));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -145,6 +147,8 @@ namespace PepperDash.Essentials.DM
|
|||||||
return new DmTx4kz302CController(key, name, new DmTx4kz302C(ipid, chassis.Inputs[num]));
|
return new DmTx4kz302CController(key, name, new DmTx4kz302C(ipid, chassis.Inputs[num]));
|
||||||
if (typeName.StartsWith("dmtx401"))
|
if (typeName.StartsWith("dmtx401"))
|
||||||
return new DmTx401CController(key, name, new DmTx401C(ipid, chassis.Inputs[num]));
|
return new DmTx401CController(key, name, new DmTx401C(ipid, chassis.Inputs[num]));
|
||||||
|
if (typeName.StartsWith("hdbasettx"))
|
||||||
|
return new HDBaseTTxController(key, name, new HDTx3CB(ipid, chassis.Inputs[num]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
@@ -355,7 +359,7 @@ namespace PepperDash.Essentials.DM
|
|||||||
public DmTxControllerFactory()
|
public DmTxControllerFactory()
|
||||||
{
|
{
|
||||||
TypeNames = new List<string>() { "dmtx200c", "dmtx201c", "dmtx201s", "dmtx4k100c", "dmtx4k202c", "dmtx4kz202c", "dmtx4k302c", "dmtx4kz302c",
|
TypeNames = new List<string>() { "dmtx200c", "dmtx201c", "dmtx201s", "dmtx4k100c", "dmtx4k202c", "dmtx4kz202c", "dmtx4k302c", "dmtx4kz302c",
|
||||||
"dmtx401c", "dmtx401s", "dmtx4k100c1g", "dmtx4kz100c1g" };
|
"dmtx401c", "dmtx401s", "dmtx4k100c1g", "dmtx4kz100c1g", "hdbasettx" };
|
||||||
}
|
}
|
||||||
|
|
||||||
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||||
|
|||||||
@@ -0,0 +1,113 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using Crestron.SimplSharp;
|
||||||
|
using Crestron.SimplSharpPro;
|
||||||
|
using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
|
using Crestron.SimplSharpPro.DM.Endpoints.Transmitters;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
|
using PepperDash.Core;
|
||||||
|
using PepperDash.Essentials.Core;
|
||||||
|
using PepperDash.Essentials.Core.Bridges;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.DM
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Controller class for suitable for HDBaseT transmitters
|
||||||
|
/// </summary>
|
||||||
|
[Description("Wrapper Class for HDBaseT devices based on HDTx3CB class")]
|
||||||
|
public class HDBaseTTxController: BasicDmTxControllerBase, IRoutingInputsOutputs, IComPorts
|
||||||
|
{
|
||||||
|
public RoutingInputPort HdmiIn { get; private set; }
|
||||||
|
public RoutingOutputPort DmOut { get; private set; }
|
||||||
|
|
||||||
|
public HDBaseTTxController(string key, string name, HDTx3CB tx)
|
||||||
|
: base(key, name, tx)
|
||||||
|
{
|
||||||
|
HdmiIn = new RoutingInputPort(DmPortName.HdmiIn1, eRoutingSignalType.Audio | eRoutingSignalType.Video,
|
||||||
|
eRoutingPortConnectionType.Hdmi, null, this) { Port = tx };
|
||||||
|
|
||||||
|
DmOut = new RoutingOutputPort(DmPortName.DmOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
|
||||||
|
eRoutingPortConnectionType.DmCat, null, this);
|
||||||
|
|
||||||
|
InputPorts = new RoutingPortCollection<RoutingInputPort> { HdmiIn };
|
||||||
|
OutputPorts = new RoutingPortCollection<RoutingOutputPort> { DmOut };
|
||||||
|
}
|
||||||
|
|
||||||
|
#region IRoutingInputs Members
|
||||||
|
|
||||||
|
public RoutingPortCollection<RoutingInputPort> InputPorts { get; private set; }
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region IRoutingOutputs Members
|
||||||
|
|
||||||
|
public RoutingPortCollection<RoutingOutputPort> OutputPorts { get; private set; }
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region IComPorts Members
|
||||||
|
|
||||||
|
public CrestronCollection<ComPort> ComPorts { get { return (Hardware as HDTx3CB).ComPorts; } }
|
||||||
|
public int NumberOfComPorts { get { return (Hardware as HDTx3CB).NumberOfComPorts; } }
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region CrestronBridgeableBaseDevice abstract overrides
|
||||||
|
|
||||||
|
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
||||||
|
{
|
||||||
|
var joinMap = new HDBaseTTxControllerJoinMap(joinStart);
|
||||||
|
|
||||||
|
var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(joinMapSerialized))
|
||||||
|
joinMap = JsonConvert.DeserializeObject<HDBaseTTxControllerJoinMap>(joinMapSerialized);
|
||||||
|
|
||||||
|
|
||||||
|
if (bridge != null)
|
||||||
|
{
|
||||||
|
bridge.AddJoinMap(Key, joinMap);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Debug.Console(0, this, "Please update config to use 'eiscapiadvanced' to get all join map features for this device.");
|
||||||
|
}
|
||||||
|
|
||||||
|
Debug.Console(1, this, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
||||||
|
|
||||||
|
this.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline.JoinNumber]);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
|
||||||
|
public class HDBaseTTxControllerJoinMap : JoinMapBaseAdvanced
|
||||||
|
{
|
||||||
|
[JoinName("IsOnline")]
|
||||||
|
public JoinDataComplete IsOnline = new JoinDataComplete(
|
||||||
|
new JoinData
|
||||||
|
{
|
||||||
|
JoinNumber = 1,
|
||||||
|
JoinSpan = 1
|
||||||
|
},
|
||||||
|
new JoinMetadata
|
||||||
|
{
|
||||||
|
Description = "HDBaseT device online feedback",
|
||||||
|
JoinCapabilities = eJoinCapabilities.ToSIMPL,
|
||||||
|
JoinType = eJoinType.Digital
|
||||||
|
});
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Plugin device BridgeJoinMap constructor
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="joinStart">This will be the join it starts on the EISC bridge</param>
|
||||||
|
public HDBaseTTxControllerJoinMap(uint joinStart)
|
||||||
|
: base(joinStart, typeof(HDBaseTTxControllerJoinMap))
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -108,6 +108,7 @@
|
|||||||
<Compile Include="Endpoints\Transmitters\DmTx4kz202CController.cs" />
|
<Compile Include="Endpoints\Transmitters\DmTx4kz202CController.cs" />
|
||||||
<Compile Include="Endpoints\Transmitters\DmTx201SController.cs" />
|
<Compile Include="Endpoints\Transmitters\DmTx201SController.cs" />
|
||||||
<Compile Include="Endpoints\Transmitters\DmTx4kz100Controller.cs" />
|
<Compile Include="Endpoints\Transmitters\DmTx4kz100Controller.cs" />
|
||||||
|
<Compile Include="Endpoints\Transmitters\HDBaseTTxController.cs" />
|
||||||
<Compile Include="Endpoints\Transmitters\TxInterfaces.cs" />
|
<Compile Include="Endpoints\Transmitters\TxInterfaces.cs" />
|
||||||
<Compile Include="IDmSwitch.cs" />
|
<Compile Include="IDmSwitch.cs" />
|
||||||
<Compile Include="Config\DmpsRoutingConfig.cs" />
|
<Compile Include="Config\DmpsRoutingConfig.cs" />
|
||||||
|
|||||||
Reference in New Issue
Block a user