mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-04-14 04:57:15 +00:00
Adds Display Controller base with some basic functioanlity.
This commit is contained in:
parent
e145bfbaee
commit
34f3e543f2
4 changed files with 127 additions and 149 deletions
|
|
@ -87,6 +87,11 @@ namespace PepperDash.Essentials.Bridges
|
||||||
(device as GenericComm).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
(device as GenericComm).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
else if (device is PepperDash.Essentials.Core.TwoWayDisplayBase)
|
||||||
|
{
|
||||||
|
(device as TwoWayDisplayBase).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
else if (device is DmChassisController)
|
else if (device is DmChassisController)
|
||||||
{
|
{
|
||||||
(device as DmChassisController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
(device as DmChassisController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@ using Crestron.SimplSharpPro;
|
||||||
using Crestron.SimplSharpPro.EthernetCommunication;
|
using Crestron.SimplSharpPro.EthernetCommunication;
|
||||||
|
|
||||||
namespace PepperDash.Essentials
|
namespace PepperDash.Essentials
|
||||||
|
|
||||||
{
|
{
|
||||||
public class BridgeFactory
|
public class BridgeFactory
|
||||||
{
|
{
|
||||||
|
|
@ -41,48 +42,6 @@ namespace PepperDash.Essentials
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class DmBridge : Device
|
|
||||||
{
|
|
||||||
public EiscBridgeProperties Properties { get; private set; }
|
|
||||||
|
|
||||||
public PepperDash.Essentials.DM.DmChassisController DmSwitch { get; private set; }
|
|
||||||
|
|
||||||
public DmBridge(string key, string name, JToken properties) : base(key, name)
|
|
||||||
{
|
|
||||||
Properties = JsonConvert.DeserializeObject<EiscBridgeProperties>(properties.ToString());
|
|
||||||
}
|
|
||||||
|
|
||||||
public override bool CustomActivate()
|
|
||||||
{
|
|
||||||
// Create EiscApis
|
|
||||||
if (Properties.Eiscs != null)
|
|
||||||
{
|
|
||||||
foreach (var eisc in Properties.Eiscs)
|
|
||||||
{
|
|
||||||
var ApiEisc = new BridgeApiEisc(eisc.IpId, eisc.Hostname);
|
|
||||||
|
|
||||||
ApiEisc.Eisc.SetUShortSigAction(101, u => DmSwitch.ExecuteSwitch(u,1, eRoutingSignalType.Video));
|
|
||||||
ApiEisc.Eisc.SetUShortSigAction(102, u => DmSwitch.ExecuteSwitch(u,2, eRoutingSignalType.Video));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach (var device in DeviceManager.AllDevices)
|
|
||||||
{
|
|
||||||
if (device.Key == this.Properties.ParentDeviceKey)
|
|
||||||
{
|
|
||||||
Debug.Console(0, "deviceKey {0} Matches", device.Key);
|
|
||||||
DmSwitch = DeviceManager.GetDeviceForKey(device.Key) as PepperDash.Essentials.DM.DmChassisController;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Debug.Console(0, "deviceKey {0} doesn't match", device.Key);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Debug.Console(0, "Bridge {0} Activated", this.Name);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public class CommBridge : Device
|
public class CommBridge : Device
|
||||||
{
|
{
|
||||||
|
|
@ -179,3 +138,4 @@ namespace PepperDash.Essentials
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -10,7 +10,7 @@ using PepperDash.Essentials.Devices.Common;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Bridges
|
namespace PepperDash.Essentials.Bridges
|
||||||
{
|
{
|
||||||
public static class SamsungDisplayControllerApiExtensions
|
public static class DisplayControllerApiExtensions
|
||||||
{
|
{
|
||||||
public static void LinkToApi(this PepperDash.Essentials.Core.TwoWayDisplayBase displayDevice, BasicTriList trilist, uint joinStart, string joinMapKey)
|
public static void LinkToApi(this PepperDash.Essentials.Core.TwoWayDisplayBase displayDevice, BasicTriList trilist, uint joinStart, string joinMapKey)
|
||||||
{
|
{
|
||||||
|
|
@ -23,7 +23,7 @@ namespace PepperDash.Essentials.Bridges
|
||||||
|
|
||||||
joinMap.OffsetJoinNumbers(joinStart);
|
joinMap.OffsetJoinNumbers(joinStart);
|
||||||
Debug.Console(1, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
Debug.Console(1, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
||||||
Debug.Console(0, "Linking to lighting Type {0}", displayDevice.GetType().Name.ToString());
|
Debug.Console(0, "Linking to Bridge Type {0}", displayDevice.GetType().Name.ToString());
|
||||||
|
|
||||||
var commMonitor = displayDevice as ICommunicationMonitor;
|
var commMonitor = displayDevice as ICommunicationMonitor;
|
||||||
commMonitor.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
|
commMonitor.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
|
||||||
|
|
@ -37,6 +37,18 @@ namespace PepperDash.Essentials.Bridges
|
||||||
trilist.SetSigTrueAction(joinMap.PowerOn, () => displayDevice.PowerOn());
|
trilist.SetSigTrueAction(joinMap.PowerOn, () => displayDevice.PowerOn());
|
||||||
displayDevice.PowerIsOnFeedback.LinkInputSig(trilist.BooleanInput[joinMap.PowerOn]);
|
displayDevice.PowerIsOnFeedback.LinkInputSig(trilist.BooleanInput[joinMap.PowerOn]);
|
||||||
|
|
||||||
|
|
||||||
|
trilist.SetUShortSigAction(joinMap.InputSelect, (a) =>
|
||||||
|
{
|
||||||
|
if (a == 0)
|
||||||
|
{
|
||||||
|
displayDevice.PowerOff();
|
||||||
|
}
|
||||||
|
else if (a > 0 && a < displayDevice.InputPorts.Count)
|
||||||
|
{
|
||||||
|
displayDevice.ExecuteSwitch(displayDevice.InputPorts.ElementAt(a - 1).Selector);
|
||||||
|
}
|
||||||
|
});
|
||||||
// GenericLighitng Actions & FeedBack
|
// GenericLighitng Actions & FeedBack
|
||||||
|
|
||||||
// int sceneIndex = 1;
|
// int sceneIndex = 1;
|
||||||
|
|
@ -83,6 +95,7 @@ namespace PepperDash.Essentials.Bridges
|
||||||
{
|
{
|
||||||
public uint IsOnline { get; set; }
|
public uint IsOnline { get; set; }
|
||||||
public uint PowerOff { get; set; }
|
public uint PowerOff { get; set; }
|
||||||
|
public uint InputSelect { get; set; }
|
||||||
public uint PowerOn { get; set; }
|
public uint PowerOn { get; set; }
|
||||||
public uint SelectScene { get; set; }
|
public uint SelectScene { get; set; }
|
||||||
public uint LightingSceneOffset { get; set; }
|
public uint LightingSceneOffset { get; set; }
|
||||||
|
|
@ -95,7 +108,7 @@ namespace PepperDash.Essentials.Bridges
|
||||||
IsOnline = 1;
|
IsOnline = 1;
|
||||||
PowerOff = 1;
|
PowerOff = 1;
|
||||||
PowerOn = 2;
|
PowerOn = 2;
|
||||||
SelectScene = 1;
|
InputSelect = 1;
|
||||||
IntegrationIdSet = 1;
|
IntegrationIdSet = 1;
|
||||||
LightingSceneOffset = 10;
|
LightingSceneOffset = 10;
|
||||||
ButtonVisibilityOffset = 40;
|
ButtonVisibilityOffset = 40;
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
Subproject commit 78182ecd8650f59e9f02494233c23ea44a5dc490
|
Subproject commit 2cfdc4f2668f803b376415ebd938326c1047f206
|
||||||
Loading…
Add table
Add a link
Reference in a new issue