mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-16 21:24:54 +00:00
Merge remote-tracking branch 'origin/feature/ecs-1154' into maintenance/pr-3
This commit is contained in:
@@ -9,18 +9,20 @@ using PepperDash.Essentials.Core;
|
|||||||
using PepperDash.Essentials.Devices.Common;
|
using PepperDash.Essentials.Devices.Common;
|
||||||
using PepperDash.Essentials.DM.AirMedia;
|
using PepperDash.Essentials.DM.AirMedia;
|
||||||
|
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Bridges
|
namespace PepperDash.Essentials.Bridges
|
||||||
{
|
{
|
||||||
public static class AirMediaControllerApiExtensions
|
public static class AirMediaControllerApiExtensions
|
||||||
{
|
{
|
||||||
public static void LinkToApi(this AirMediaController airMedia, BasicTriList trilist, uint joinStart, string joinMapKey)
|
public static void LinkToApi(this AirMediaController airMedia, BasicTriList trilist, uint joinStart, string joinMapKey)
|
||||||
{
|
{
|
||||||
var joinMap = JoinMapHelper.GetJoinMapForDevice(joinMapKey) as AirMediaControllerJoinMap;
|
AirMediaControllerJoinMap joinMap = new AirMediaControllerJoinMap();
|
||||||
|
|
||||||
if (joinMap == null)
|
var joinMapSerialized = JoinMapHelper.GetJoinMapForDevice(joinMapKey);
|
||||||
{
|
|
||||||
joinMap = new AirMediaControllerJoinMap();
|
if (!string.IsNullOrEmpty(joinMapSerialized))
|
||||||
}
|
joinMap = JsonConvert.DeserializeObject<AirMediaControllerJoinMap>(joinMapSerialized);
|
||||||
|
|
||||||
joinMap.OffsetJoinNumbers(joinStart);
|
joinMap.OffsetJoinNumbers(joinStart);
|
||||||
|
|
||||||
|
|||||||
@@ -9,18 +9,20 @@ using PepperDash.Core;
|
|||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
using PepperDash.Essentials.Devices.Common;
|
using PepperDash.Essentials.Devices.Common;
|
||||||
|
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Bridges
|
namespace PepperDash.Essentials.Bridges
|
||||||
{
|
{
|
||||||
public static class AppleTvApiExtensions
|
public static class AppleTvApiExtensions
|
||||||
{
|
{
|
||||||
public static void LinkToApi(this AppleTV appleTv, BasicTriList trilist, uint joinStart, string joinMapKey)
|
public static void LinkToApi(this AppleTV appleTv, BasicTriList trilist, uint joinStart, string joinMapKey)
|
||||||
{
|
{
|
||||||
var joinMap = JoinMapHelper.GetJoinMapForDevice(joinMapKey) as AppleTvJoinMap;
|
AppleTvJoinMap joinMap = new AppleTvJoinMap();
|
||||||
|
|
||||||
if (joinMap == null)
|
var joinMapSerialized = JoinMapHelper.GetJoinMapForDevice(joinMapKey);
|
||||||
{
|
|
||||||
joinMap = new AppleTvJoinMap();
|
if(!string.IsNullOrEmpty(joinMapSerialized))
|
||||||
}
|
joinMap = JsonConvert.DeserializeObject<AppleTvJoinMap>(joinMapSerialized);
|
||||||
|
|
||||||
joinMap.OffsetJoinNumbers(joinStart);
|
joinMap.OffsetJoinNumbers(joinStart);
|
||||||
|
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ using PepperDash.Essentials.Core;
|
|||||||
using PepperDash.Essentials.Core.Lighting;
|
using PepperDash.Essentials.Core.Lighting;
|
||||||
using PepperDash.Essentials.Core.Devices;
|
using PepperDash.Essentials.Core.Devices;
|
||||||
using PepperDash.Essentials.Devices.Common;
|
using PepperDash.Essentials.Devices.Common;
|
||||||
|
using PepperDash.Essentials.Devices.Common.Cameras;
|
||||||
using PepperDash.Essentials.Core.Config;
|
using PepperDash.Essentials.Core.Config;
|
||||||
using PepperDash.Essentials.Core.CrestronIO;
|
using PepperDash.Essentials.Core.CrestronIO;
|
||||||
using PepperDash.Essentials.DM;
|
using PepperDash.Essentials.DM;
|
||||||
@@ -77,7 +78,12 @@ namespace PepperDash.Essentials.Bridges
|
|||||||
|
|
||||||
if (device != null)
|
if (device != null)
|
||||||
{
|
{
|
||||||
if (device is PepperDash.Essentials.Core.Monitoring.SystemMonitorController)
|
if (device is IBridge) // Check for this first to allow bridges in plugins to override existing bridges that apply to the same type.
|
||||||
|
{
|
||||||
|
(device as IBridge).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else if (device is PepperDash.Essentials.Core.Monitoring.SystemMonitorController)
|
||||||
{
|
{
|
||||||
(device as PepperDash.Essentials.Core.Monitoring.SystemMonitorController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
(device as PepperDash.Essentials.Core.Monitoring.SystemMonitorController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
||||||
continue;
|
continue;
|
||||||
@@ -87,11 +93,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 CameraBase)
|
else if (device is CameraBase)
|
||||||
//{
|
{
|
||||||
// (device as CameraBase).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
(device as CameraBase).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
||||||
// continue;
|
continue;
|
||||||
//}
|
}
|
||||||
else if (device is PepperDash.Essentials.Core.DisplayBase)
|
else if (device is PepperDash.Essentials.Core.DisplayBase)
|
||||||
{
|
{
|
||||||
(device as DisplayBase).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
(device as DisplayBase).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
||||||
@@ -137,26 +143,21 @@ namespace PepperDash.Essentials.Bridges
|
|||||||
(device as AppleTV).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
(device as AppleTV).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else if (device is IBridge)
|
|
||||||
{
|
|
||||||
(device as IBridge).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
else if (device is HdMdxxxCEController)
|
else if (device is HdMdxxxCEController)
|
||||||
{
|
{
|
||||||
(device as HdMdxxxCEController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
(device as HdMdxxxCEController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
//else if (device is LightingBase)
|
else if (device is LightingBase)
|
||||||
//{
|
{
|
||||||
// (device as LightingBase).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
(device as LightingBase).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
||||||
// continue;
|
continue;
|
||||||
//}
|
}
|
||||||
//else if (device is DigitalLogger)
|
else if (device is DigitalLogger)
|
||||||
//{
|
{
|
||||||
// (device as DigitalLogger).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
(device as DigitalLogger).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
||||||
// continue;
|
continue;
|
||||||
//}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,187 +1,137 @@
|
|||||||
//using System;
|
using System;
|
||||||
//using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
//using System.Linq;
|
using System.Linq;
|
||||||
//using System.Text;
|
using System.Text;
|
||||||
//using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
//using Crestron.SimplSharpPro.DeviceSupport;
|
using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
//using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
//using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
//using PepperDash.Essentials.Devices.Common;
|
using PepperDash.Essentials.Devices.Common;
|
||||||
|
using PepperDash.Essentials.Devices.Common.Cameras;
|
||||||
|
|
||||||
//namespace PepperDash.Essentials.Bridges
|
using Newtonsoft.Json;
|
||||||
//{
|
|
||||||
// public static class CameraControllerApiExtensions
|
|
||||||
// {
|
|
||||||
|
|
||||||
// public static BasicTriList _TriList;
|
namespace PepperDash.Essentials.Bridges
|
||||||
// public static CameraControllerJoinMap JoinMap;
|
{
|
||||||
// public static void LinkToApi(this PepperDash.Essentials.Devices.Common.Cameras.CameraBase cameraDevice, BasicTriList trilist, uint joinStart, string joinMapKey)
|
public static class CameraControllerApiExtensions
|
||||||
// {
|
{
|
||||||
// JoinMap = JoinMapHelper.GetJoinMapForDevice(joinMapKey) as CameraControllerJoinMap;
|
|
||||||
|
|
||||||
// _TriList = trilist;
|
public static void LinkToApi(this PepperDash.Essentials.Devices.Common.Cameras.CameraBase cameraDevice, BasicTriList trilist, uint joinStart, string joinMapKey)
|
||||||
// if (JoinMap == null)
|
{
|
||||||
// {
|
CameraControllerJoinMap joinMap = new CameraControllerJoinMap();
|
||||||
// JoinMap = new CameraControllerJoinMap();
|
|
||||||
// }
|
|
||||||
|
|
||||||
// JoinMap.OffsetJoinNumbers(joinStart);
|
var joinMapSerialized = JoinMapHelper.GetJoinMapForDevice(joinMapKey);
|
||||||
// Debug.Console(1, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
|
||||||
// Debug.Console(0, "Linking to Bridge Type {0}", cameraDevice.GetType().Name.ToString());
|
|
||||||
|
|
||||||
// var commMonitor = cameraDevice as ICommunicationMonitor;
|
if (!string.IsNullOrEmpty(joinMapSerialized))
|
||||||
// commMonitor.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[JoinMap.IsOnline]);
|
joinMap = JsonConvert.DeserializeObject<CameraControllerJoinMap>(joinMapSerialized);
|
||||||
|
|
||||||
|
joinMap.OffsetJoinNumbers(joinStart);
|
||||||
|
|
||||||
// trilist.SetBoolSigAction(JoinMap.Left, (b) =>
|
Debug.Console(1, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
||||||
// {
|
Debug.Console(0, "Linking to Bridge Type {0}", cameraDevice.GetType().Name.ToString());
|
||||||
// if (b)
|
|
||||||
// {
|
|
||||||
// cameraDevice.PanLeft();
|
|
||||||
// }
|
|
||||||
// else
|
|
||||||
// {
|
|
||||||
// cameraDevice.Stop();
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// trilist.SetBoolSigAction(JoinMap.Right, (b) =>
|
|
||||||
// {
|
|
||||||
// if (b)
|
|
||||||
// {
|
|
||||||
// cameraDevice.PanRight();
|
|
||||||
// }
|
|
||||||
// else
|
|
||||||
// {
|
|
||||||
// cameraDevice.Stop();
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
|
|
||||||
// trilist.SetBoolSigAction(JoinMap.Up, (b) =>
|
var commMonitor = cameraDevice as ICommunicationMonitor;
|
||||||
// {
|
commMonitor.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
|
||||||
// if (b)
|
|
||||||
// {
|
|
||||||
// cameraDevice.TiltUp();
|
|
||||||
// }
|
|
||||||
// else
|
|
||||||
// {
|
|
||||||
// cameraDevice.Stop();
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// trilist.SetBoolSigAction(JoinMap.Down, (b) =>
|
|
||||||
// {
|
|
||||||
// if (b)
|
|
||||||
// {
|
|
||||||
// cameraDevice.TiltDown();
|
|
||||||
// }
|
|
||||||
// else
|
|
||||||
// {
|
|
||||||
// cameraDevice.Stop();
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
|
|
||||||
// trilist.SetBoolSigAction(JoinMap.ZoomIn, (b) =>
|
var ptzCamera = cameraDevice as IHasCameraPtzControl;
|
||||||
// {
|
|
||||||
// if (b)
|
|
||||||
// {
|
|
||||||
// cameraDevice.ZoomIn();
|
|
||||||
// }
|
|
||||||
// else
|
|
||||||
// {
|
|
||||||
// cameraDevice.Stop();
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
|
|
||||||
// trilist.SetBoolSigAction(JoinMap.ZoomOut, (b) =>
|
if (ptzCamera != null)
|
||||||
// {
|
{
|
||||||
// if (b)
|
trilist.SetBoolSigAction(joinMap.Left, (b) =>
|
||||||
// {
|
{
|
||||||
// cameraDevice.ZoomOut();
|
if (b)
|
||||||
// }
|
{
|
||||||
// else
|
ptzCamera.PanLeft();
|
||||||
// {
|
}
|
||||||
// cameraDevice.Stop();
|
else
|
||||||
// }
|
{
|
||||||
// });
|
ptzCamera.PanStop();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
trilist.SetBoolSigAction(joinMap.Right, (b) =>
|
||||||
|
{
|
||||||
|
if (b)
|
||||||
|
{
|
||||||
|
ptzCamera.PanRight();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ptzCamera.PanStop();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
trilist.SetBoolSigAction(joinMap.Up, (b) =>
|
||||||
|
{
|
||||||
|
if (b)
|
||||||
|
{
|
||||||
|
ptzCamera.TiltUp();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ptzCamera.TiltStop();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
trilist.SetBoolSigAction(joinMap.Down, (b) =>
|
||||||
|
{
|
||||||
|
if (b)
|
||||||
|
{
|
||||||
|
ptzCamera.TiltDown();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ptzCamera.TiltStop();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// if (cameraDevice.GetType().Name.ToString().ToLower() == "cameravisca")
|
trilist.SetBoolSigAction(joinMap.ZoomIn, (b) =>
|
||||||
// {
|
{
|
||||||
// var viscaCamera = cameraDevice as PepperDash.Essentials.Devices.Common.Cameras.CameraVisca;
|
if (b)
|
||||||
// trilist.SetSigTrueAction(JoinMap.PowerOn, () => viscaCamera.PowerOn());
|
{
|
||||||
// trilist.SetSigTrueAction(JoinMap.PowerOff, () => viscaCamera.PowerOff());
|
ptzCamera.ZoomIn();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ptzCamera.ZoomStop();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// viscaCamera.PowerIsOnFeedback.LinkInputSig(trilist.BooleanInput[JoinMap.PowerOn]);
|
trilist.SetBoolSigAction(joinMap.ZoomOut, (b) =>
|
||||||
// viscaCamera.PowerIsOnFeedback.LinkComplementInputSig(trilist.BooleanInput[JoinMap.PowerOff]);
|
{
|
||||||
|
if (b)
|
||||||
|
{
|
||||||
|
ptzCamera.ZoomOut();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ptzCamera.ZoomStop();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// viscaCamera.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[JoinMap.IsOnline]);
|
if (cameraDevice.GetType().Name.ToString().ToLower() == "cameravisca")
|
||||||
// for (int i = 0; i < JoinMap.NumberOfPresets; i++)
|
{
|
||||||
// {
|
var viscaCamera = cameraDevice as PepperDash.Essentials.Devices.Common.Cameras.CameraVisca;
|
||||||
// int tempNum = i;
|
trilist.SetSigTrueAction(joinMap.PowerOn, () => viscaCamera.PowerOn());
|
||||||
// trilist.SetSigTrueAction((ushort)(JoinMap.PresetRecallOffset + tempNum), () =>
|
trilist.SetSigTrueAction(joinMap.PowerOff, () => viscaCamera.PowerOff());
|
||||||
// {
|
|
||||||
// viscaCamera.RecallPreset(tempNum);
|
|
||||||
// });
|
|
||||||
// trilist.SetSigTrueAction((ushort)(JoinMap.PresetSaveOffset + tempNum), () =>
|
|
||||||
// {
|
|
||||||
// viscaCamera.SavePreset(tempNum);
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
viscaCamera.PowerIsOnFeedback.LinkInputSig(trilist.BooleanInput[joinMap.PowerOn]);
|
||||||
|
viscaCamera.PowerIsOnFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.PowerOff]);
|
||||||
|
|
||||||
|
viscaCamera.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
|
||||||
|
for (int i = 0; i < joinMap.NumberOfPresets; i++)
|
||||||
|
{
|
||||||
|
int tempNum = i;
|
||||||
|
trilist.SetSigTrueAction((ushort)(joinMap.PresetRecallOffset + tempNum), () =>
|
||||||
|
{
|
||||||
|
viscaCamera.RecallPreset(tempNum);
|
||||||
|
});
|
||||||
|
trilist.SetSigTrueAction((ushort)(joinMap.PresetSaveOffset + tempNum), () =>
|
||||||
|
{
|
||||||
|
viscaCamera.SavePreset(tempNum);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// }
|
}
|
||||||
|
|
||||||
|
|
||||||
// }
|
|
||||||
// public class CameraControllerJoinMap : JoinMapBase
|
|
||||||
// {
|
|
||||||
// public uint IsOnline { get; set; }
|
|
||||||
// public uint PowerOff { get; set; }
|
|
||||||
// public uint PowerOn { get; set; }
|
|
||||||
// public uint Up { get; set; }
|
|
||||||
// public uint Down { get; set; }
|
|
||||||
// public uint Left { get; set; }
|
|
||||||
// public uint Right { get; set; }
|
|
||||||
// public uint ZoomIn { get; set; }
|
|
||||||
// public uint ZoomOut { get; set; }
|
|
||||||
// public uint PresetRecallOffset { get; set; }
|
|
||||||
// public uint PresetSaveOffset { get; set; }
|
|
||||||
// public uint NumberOfPresets { get; set; }
|
|
||||||
|
|
||||||
// public CameraControllerJoinMap()
|
|
||||||
// {
|
|
||||||
// // Digital
|
|
||||||
// IsOnline = 9;
|
|
||||||
// PowerOff = 8;
|
|
||||||
// PowerOn = 7;
|
|
||||||
// Up = 1;
|
|
||||||
// Down = 2;
|
|
||||||
// Left = 3;
|
|
||||||
// Right = 4;
|
|
||||||
// ZoomIn = 5;
|
|
||||||
// ZoomOut = 6;
|
|
||||||
// PresetRecallOffset = 10;
|
|
||||||
// PresetSaveOffset = 30;
|
|
||||||
// NumberOfPresets = 5;
|
|
||||||
// // Analog
|
|
||||||
// }
|
|
||||||
|
|
||||||
// public override void OffsetJoinNumbers(uint joinStart)
|
|
||||||
// {
|
|
||||||
// var joinOffset = joinStart - 1;
|
|
||||||
|
|
||||||
// IsOnline = IsOnline + joinOffset;
|
|
||||||
// PowerOff = PowerOff + joinOffset;
|
|
||||||
// PowerOn = PowerOn + joinOffset;
|
|
||||||
// Up = Up + joinOffset;
|
|
||||||
// Down = Down + joinOffset;
|
|
||||||
// Left = Left + joinOffset;
|
|
||||||
// Right = Right + joinOffset;
|
|
||||||
// ZoomIn = ZoomIn + joinOffset;
|
|
||||||
// ZoomOut = ZoomOut + joinOffset;
|
|
||||||
// PresetRecallOffset = PresetRecallOffset + joinOffset;
|
|
||||||
// PresetSaveOffset = PresetSaveOffset + joinOffset;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
@@ -1,77 +1,42 @@
|
|||||||
//using System;
|
using System;
|
||||||
//using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
//using System.Linq;
|
using System.Linq;
|
||||||
//using System.Text;
|
using System.Text;
|
||||||
//using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
//using Crestron.SimplSharpPro.DeviceSupport;
|
using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
//using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
//using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
//using PepperDash.Essentials.Devices.Common;
|
using PepperDash.Essentials.Devices.Common;
|
||||||
|
|
||||||
//namespace PepperDash.Essentials.Bridges
|
using Newtonsoft.Json;
|
||||||
//{
|
|
||||||
// public static class DigitalLoggerApiExtensions
|
|
||||||
// {
|
|
||||||
// public static void LinkToApi(this DigitalLogger DigitalLogger, BasicTriList trilist, uint joinStart, string joinMapKey)
|
|
||||||
// {
|
|
||||||
// var joinMap = JoinMapHelper.GetJoinMapForDevice(joinMapKey) as DigitalLoggerJoinMap;
|
|
||||||
|
|
||||||
// if (joinMap == null)
|
namespace PepperDash.Essentials.Bridges
|
||||||
// joinMap = new DigitalLoggerJoinMap();
|
{
|
||||||
|
public static class DigitalLoggerApiExtensions
|
||||||
|
{
|
||||||
|
public static void LinkToApi(this DigitalLogger DigitalLogger, BasicTriList trilist, uint joinStart, string joinMapKey)
|
||||||
|
{
|
||||||
|
DigitalLoggerJoinMap joinMap = new DigitalLoggerJoinMap();
|
||||||
|
|
||||||
// joinMap.OffsetJoinNumbers(joinStart);
|
var joinMapSerialized = JoinMapHelper.GetJoinMapForDevice(joinMapKey);
|
||||||
// Debug.Console(1, DigitalLogger, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
|
||||||
// for (uint i = 1; i <= DigitalLogger.CircuitCount; i++)
|
|
||||||
// {
|
|
||||||
// var circuit = i;
|
|
||||||
// DigitalLogger.CircuitNameFeedbacks[circuit - 1].LinkInputSig(trilist.StringInput[joinMap.CircuitNames + circuit]);
|
|
||||||
// DigitalLogger.CircuitIsCritical[circuit - 1].LinkInputSig(trilist.BooleanInput[joinMap.CircuitIsCritical + circuit]);
|
|
||||||
// DigitalLogger.CircuitState[circuit - 1].LinkInputSig(trilist.BooleanInput[joinMap.CircuitState + circuit]);
|
|
||||||
// trilist.SetSigTrueAction(joinMap.CircuitCycle + circuit, () => DigitalLogger.CycleCircuit(circuit - 1));
|
|
||||||
// trilist.SetSigTrueAction(joinMap.CircuitOnCmd + circuit, () => DigitalLogger.TurnOnCircuit(circuit - 1));
|
|
||||||
// trilist.SetSigTrueAction(joinMap.CircuitOffCmd + circuit, () => DigitalLogger.TurnOffCircuit(circuit - 1));
|
|
||||||
|
|
||||||
// }
|
if (!string.IsNullOrEmpty(joinMapSerialized))
|
||||||
// }
|
joinMap = JsonConvert.DeserializeObject<DigitalLoggerJoinMap>(joinMapSerialized);
|
||||||
// }
|
|
||||||
// public class DigitalLoggerJoinMap : JoinMapBase
|
|
||||||
// {
|
|
||||||
// public uint IsOnline { get; set; }
|
|
||||||
// public uint CircuitNames { get; set; }
|
|
||||||
// public uint CircuitState { get; set; }
|
|
||||||
// public uint CircuitCycle { get; set; }
|
|
||||||
// public uint CircuitIsCritical { get; set; }
|
|
||||||
// public uint CircuitOnCmd { get; set; }
|
|
||||||
// public uint CircuitOffCmd { get; set; }
|
|
||||||
// public DigitalLoggerJoinMap()
|
|
||||||
// {
|
|
||||||
// // Digital
|
|
||||||
// IsOnline = 9;
|
|
||||||
// CircuitState = 0;
|
|
||||||
// CircuitCycle = 0;
|
|
||||||
// CircuitIsCritical = 10;
|
|
||||||
// CircuitOnCmd = 10;
|
|
||||||
// CircuitOffCmd = 20;
|
|
||||||
// // Serial
|
|
||||||
// CircuitNames = 0;
|
|
||||||
// // Analog
|
|
||||||
// }
|
|
||||||
|
|
||||||
// public override void OffsetJoinNumbers(uint joinStart)
|
joinMap.OffsetJoinNumbers(joinStart);
|
||||||
// {
|
|
||||||
// var joinOffset = joinStart - 1;
|
|
||||||
|
|
||||||
// IsOnline = IsOnline + joinOffset;
|
Debug.Console(1, DigitalLogger, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
||||||
// CircuitNames = CircuitNames + joinOffset;
|
for (uint i = 1; i <= DigitalLogger.CircuitCount; i++)
|
||||||
// CircuitState = CircuitState + joinOffset;
|
{
|
||||||
// CircuitCycle = CircuitCycle + joinOffset;
|
var circuit = i;
|
||||||
// CircuitIsCritical = CircuitIsCritical + joinOffset;
|
DigitalLogger.CircuitNameFeedbacks[circuit - 1].LinkInputSig(trilist.StringInput[joinMap.CircuitNames + circuit]);
|
||||||
// CircuitOnCmd = CircuitOnCmd + joinOffset;
|
DigitalLogger.CircuitIsCritical[circuit - 1].LinkInputSig(trilist.BooleanInput[joinMap.CircuitIsCritical + circuit]);
|
||||||
// CircuitOffCmd = CircuitOffCmd + joinOffset;
|
DigitalLogger.CircuitState[circuit - 1].LinkInputSig(trilist.BooleanInput[joinMap.CircuitState + circuit]);
|
||||||
|
trilist.SetSigTrueAction(joinMap.CircuitCycle + circuit, () => DigitalLogger.CycleCircuit(circuit - 1));
|
||||||
|
trilist.SetSigTrueAction(joinMap.CircuitOnCmd + circuit, () => DigitalLogger.TurnOnCircuit(circuit - 1));
|
||||||
|
trilist.SetSigTrueAction(joinMap.CircuitOffCmd + circuit, () => DigitalLogger.TurnOffCircuit(circuit - 1));
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
|
|
||||||
//}
|
|
||||||
@@ -8,23 +8,25 @@ using PepperDash.Core;
|
|||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
using PepperDash.Essentials.Devices.Common;
|
using PepperDash.Essentials.Devices.Common;
|
||||||
|
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Bridges
|
namespace PepperDash.Essentials.Bridges
|
||||||
{
|
{
|
||||||
public static class DisplayControllerApiExtensions
|
public static class DisplayControllerApiExtensions
|
||||||
{
|
{
|
||||||
|
|
||||||
public static int InputNumber;
|
|
||||||
public static IntFeedback InputNumberFeedback;
|
|
||||||
public static List<string> InputKeys = new List<string>();
|
|
||||||
public static void LinkToApi(this PepperDash.Essentials.Core.DisplayBase displayDevice, BasicTriList trilist, uint joinStart, string joinMapKey)
|
public static void LinkToApi(this PepperDash.Essentials.Core.DisplayBase displayDevice, BasicTriList trilist, uint joinStart, string joinMapKey)
|
||||||
{
|
{
|
||||||
|
int inputNumber = 0;
|
||||||
|
IntFeedback inputNumberFeedback;
|
||||||
|
List<string> inputKeys = new List<string>();
|
||||||
|
|
||||||
var joinMap = JoinMapHelper.GetJoinMapForDevice(joinMapKey) as DisplayControllerJoinMap;
|
DisplayControllerJoinMap joinMap = new DisplayControllerJoinMap();
|
||||||
|
|
||||||
if (joinMap == null)
|
var joinMapSerialized = JoinMapHelper.GetJoinMapForDevice(joinMapKey);
|
||||||
{
|
|
||||||
joinMap = new DisplayControllerJoinMap();
|
if(!string.IsNullOrEmpty(joinMapSerialized))
|
||||||
}
|
joinMap = JsonConvert.DeserializeObject<DisplayControllerJoinMap>(joinMapSerialized);
|
||||||
|
|
||||||
joinMap.OffsetJoinNumbers(joinStart);
|
joinMap.OffsetJoinNumbers(joinStart);
|
||||||
|
|
||||||
@@ -39,7 +41,7 @@ namespace PepperDash.Essentials.Bridges
|
|||||||
commMonitor.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
|
commMonitor.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
|
||||||
}
|
}
|
||||||
|
|
||||||
InputNumberFeedback = new IntFeedback(() => { return InputNumber; });
|
inputNumberFeedback = new IntFeedback(() => { return inputNumber; });
|
||||||
|
|
||||||
// Two way feedbacks
|
// Two way feedbacks
|
||||||
var twoWayDisplay = displayDevice as PepperDash.Essentials.Core.TwoWayDisplayBase;
|
var twoWayDisplay = displayDevice as PepperDash.Essentials.Core.TwoWayDisplayBase;
|
||||||
@@ -50,25 +52,38 @@ namespace PepperDash.Essentials.Bridges
|
|||||||
twoWayDisplay.CurrentInputFeedback.OutputChange += new EventHandler<FeedbackEventArgs>(CurrentInputFeedback_OutputChange);
|
twoWayDisplay.CurrentInputFeedback.OutputChange += new EventHandler<FeedbackEventArgs>(CurrentInputFeedback_OutputChange);
|
||||||
|
|
||||||
|
|
||||||
InputNumberFeedback.LinkInputSig(trilist.UShortInput[joinMap.InputSelect]);
|
inputNumberFeedback.LinkInputSig(trilist.UShortInput[joinMap.InputSelect]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Power Off
|
// Power Off
|
||||||
trilist.SetSigTrueAction(joinMap.PowerOff, () =>
|
trilist.SetSigTrueAction(joinMap.PowerOff, () =>
|
||||||
{
|
{
|
||||||
InputNumber = 102;
|
inputNumber = 102;
|
||||||
InputNumberFeedback.FireUpdate();
|
inputNumberFeedback.FireUpdate();
|
||||||
displayDevice.PowerOff();
|
displayDevice.PowerOff();
|
||||||
});
|
});
|
||||||
|
|
||||||
displayDevice.PowerIsOnFeedback.OutputChange += new EventHandler<FeedbackEventArgs>(PowerIsOnFeedback_OutputChange);
|
displayDevice.PowerIsOnFeedback.OutputChange += new EventHandler<FeedbackEventArgs>( (o,a) => {
|
||||||
|
if (!a.BoolValue)
|
||||||
|
{
|
||||||
|
inputNumber = 102;
|
||||||
|
inputNumberFeedback.FireUpdate();
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
inputNumber = 0;
|
||||||
|
inputNumberFeedback.FireUpdate();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
displayDevice.PowerIsOnFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.PowerOff]);
|
displayDevice.PowerIsOnFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.PowerOff]);
|
||||||
|
|
||||||
// PowerOn
|
// PowerOn
|
||||||
trilist.SetSigTrueAction(joinMap.PowerOn, () =>
|
trilist.SetSigTrueAction(joinMap.PowerOn, () =>
|
||||||
{
|
{
|
||||||
InputNumber = 0;
|
inputNumber = 0;
|
||||||
InputNumberFeedback.FireUpdate();
|
inputNumberFeedback.FireUpdate();
|
||||||
displayDevice.PowerOn();
|
displayDevice.PowerOn();
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -78,8 +93,8 @@ namespace PepperDash.Essentials.Bridges
|
|||||||
int count = 1;
|
int count = 1;
|
||||||
foreach (var input in displayDevice.InputPorts)
|
foreach (var input in displayDevice.InputPorts)
|
||||||
{
|
{
|
||||||
InputKeys.Add(input.Key.ToString());
|
inputKeys.Add(input.Key.ToString());
|
||||||
var tempKey = InputKeys.ElementAt(count - 1);
|
var tempKey = inputKeys.ElementAt(count - 1);
|
||||||
trilist.SetSigTrueAction((ushort)(joinMap.InputSelectOffset + count), () => { displayDevice.ExecuteSwitch(displayDevice.InputPorts[tempKey].Selector); });
|
trilist.SetSigTrueAction((ushort)(joinMap.InputSelectOffset + count), () => { displayDevice.ExecuteSwitch(displayDevice.InputPorts[tempKey].Selector); });
|
||||||
Debug.Console(2, displayDevice, "Setting Input Select Action on Digital Join {0} to Input: {1}", joinMap.InputSelectOffset + count, displayDevice.InputPorts[tempKey].Key.ToString());
|
Debug.Console(2, displayDevice, "Setting Input Select Action on Digital Join {0} to Input: {1}", joinMap.InputSelectOffset + count, displayDevice.InputPorts[tempKey].Key.ToString());
|
||||||
trilist.StringInput[(ushort)(joinMap.InputNamesOffset + count)].StringValue = input.Key.ToString();
|
trilist.StringInput[(ushort)(joinMap.InputNamesOffset + count)].StringValue = input.Key.ToString();
|
||||||
@@ -92,12 +107,12 @@ namespace PepperDash.Essentials.Bridges
|
|||||||
if (a == 0)
|
if (a == 0)
|
||||||
{
|
{
|
||||||
displayDevice.PowerOff();
|
displayDevice.PowerOff();
|
||||||
InputNumber = 0;
|
inputNumber = 0;
|
||||||
}
|
}
|
||||||
else if (a > 0 && a < displayDevice.InputPorts.Count && a != InputNumber)
|
else if (a > 0 && a < displayDevice.InputPorts.Count && a != inputNumber)
|
||||||
{
|
{
|
||||||
displayDevice.ExecuteSwitch(displayDevice.InputPorts.ElementAt(a - 1).Selector);
|
displayDevice.ExecuteSwitch(displayDevice.InputPorts.ElementAt(a - 1).Selector);
|
||||||
InputNumber = a;
|
inputNumber = a;
|
||||||
}
|
}
|
||||||
else if (a == 102)
|
else if (a == 102)
|
||||||
{
|
{
|
||||||
@@ -105,7 +120,7 @@ namespace PepperDash.Essentials.Bridges
|
|||||||
|
|
||||||
}
|
}
|
||||||
if (twoWayDisplay != null)
|
if (twoWayDisplay != null)
|
||||||
InputNumberFeedback.FireUpdate();
|
inputNumberFeedback.FireUpdate();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
@@ -133,22 +148,6 @@ namespace PepperDash.Essentials.Bridges
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void PowerIsOnFeedback_OutputChange(object sender, FeedbackEventArgs e)
|
|
||||||
{
|
|
||||||
|
|
||||||
// Debug.Console(0, "PowerIsOnFeedback_OutputChange {0}", e.BoolValue);
|
|
||||||
if (!e.BoolValue)
|
|
||||||
{
|
|
||||||
InputNumber = 102;
|
|
||||||
InputNumberFeedback.FireUpdate();
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
InputNumber = 0;
|
|
||||||
InputNumberFeedback.FireUpdate();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -12,16 +12,21 @@ using PepperDash.Core;
|
|||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
using PepperDash.Essentials.DM;
|
using PepperDash.Essentials.DM;
|
||||||
|
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Bridges
|
namespace PepperDash.Essentials.Bridges
|
||||||
{
|
{
|
||||||
public static class DmChassisControllerApiExtentions
|
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)
|
||||||
{
|
{
|
||||||
var joinMap = JoinMapHelper.GetJoinMapForDevice(joinMapKey) as DmChassisControllerJoinMap;
|
DmChassisControllerJoinMap joinMap = new DmChassisControllerJoinMap();
|
||||||
|
|
||||||
|
var joinMapSerialized = JoinMapHelper.GetJoinMapForDevice(joinMapKey);
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(joinMapSerialized))
|
||||||
|
joinMap = JsonConvert.DeserializeObject<DmChassisControllerJoinMap>(joinMapSerialized);
|
||||||
|
|
||||||
if (joinMap == null)
|
|
||||||
joinMap = new DmChassisControllerJoinMap();
|
|
||||||
|
|
||||||
joinMap.OffsetJoinNumbers(joinStart);
|
joinMap.OffsetJoinNumbers(joinStart);
|
||||||
|
|
||||||
|
|||||||
@@ -9,16 +9,20 @@ using PepperDash.Core;
|
|||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
using PepperDash.Essentials.DM;
|
using PepperDash.Essentials.DM;
|
||||||
|
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Bridges
|
namespace PepperDash.Essentials.Bridges
|
||||||
{
|
{
|
||||||
public static class DmRmcControllerApiExtensions
|
public static class DmRmcControllerApiExtensions
|
||||||
{
|
{
|
||||||
public static void LinkToApi(this DmRmcControllerBase rmc, BasicTriList trilist, uint joinStart, string joinMapKey)
|
public static void LinkToApi(this DmRmcControllerBase rmc, BasicTriList trilist, uint joinStart, string joinMapKey)
|
||||||
{
|
{
|
||||||
var joinMap = JoinMapHelper.GetJoinMapForDevice(joinMapKey) as DmRmcControllerJoinMap;
|
DmRmcControllerJoinMap joinMap = new DmRmcControllerJoinMap();
|
||||||
|
|
||||||
if (joinMap == null)
|
var joinMapSerialized = JoinMapHelper.GetJoinMapForDevice(joinMapKey);
|
||||||
joinMap = new DmRmcControllerJoinMap();
|
|
||||||
|
if (!string.IsNullOrEmpty(joinMapSerialized))
|
||||||
|
joinMap = JsonConvert.DeserializeObject<DmRmcControllerJoinMap>(joinMapSerialized);
|
||||||
|
|
||||||
joinMap.OffsetJoinNumbers(joinStart);
|
joinMap.OffsetJoinNumbers(joinStart);
|
||||||
|
|
||||||
|
|||||||
@@ -12,16 +12,20 @@ using PepperDash.Core;
|
|||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
using PepperDash.Essentials.DM;
|
using PepperDash.Essentials.DM;
|
||||||
|
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Bridges
|
namespace PepperDash.Essentials.Bridges
|
||||||
{
|
{
|
||||||
public static class DmTxControllerApiExtensions
|
public static class DmTxControllerApiExtensions
|
||||||
{
|
{
|
||||||
public static void LinkToApi(this DmTxControllerBase tx, BasicTriList trilist, uint joinStart, string joinMapKey)
|
public static void LinkToApi(this DmTxControllerBase tx, BasicTriList trilist, uint joinStart, string joinMapKey)
|
||||||
{
|
{
|
||||||
var joinMap = JoinMapHelper.GetJoinMapForDevice(joinMapKey) as DmTxControllerJoinMap;
|
DmTxControllerJoinMap joinMap = new DmTxControllerJoinMap();
|
||||||
|
|
||||||
if (joinMap == null)
|
var joinMapSerialized = JoinMapHelper.GetJoinMapForDevice(joinMapKey);
|
||||||
joinMap = new DmTxControllerJoinMap();
|
|
||||||
|
if (!string.IsNullOrEmpty(joinMapSerialized))
|
||||||
|
joinMap = JsonConvert.DeserializeObject<DmTxControllerJoinMap>(joinMapSerialized);
|
||||||
|
|
||||||
joinMap.OffsetJoinNumbers(joinStart);
|
joinMap.OffsetJoinNumbers(joinStart);
|
||||||
|
|
||||||
|
|||||||
@@ -10,16 +10,20 @@ using PepperDash.Core;
|
|||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
using PepperDash.Essentials.DM;
|
using PepperDash.Essentials.DM;
|
||||||
|
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Bridges
|
namespace PepperDash.Essentials.Bridges
|
||||||
{
|
{
|
||||||
public static class DmpsAudioOutputControllerApiExtensions
|
public static class DmpsAudioOutputControllerApiExtensions
|
||||||
{
|
{
|
||||||
public static void LinkToApi(this DmpsAudioOutputController dmAudioOutputController, BasicTriList trilist, uint joinStart, string joinMapKey)
|
public static void LinkToApi(this DmpsAudioOutputController dmAudioOutputController, BasicTriList trilist, uint joinStart, string joinMapKey)
|
||||||
{
|
{
|
||||||
var joinMap = JoinMapHelper.GetJoinMapForDevice(joinMapKey) as DmpsAudioOutputControllerJoinMap;
|
DmpsAudioOutputControllerJoinMap joinMap = new DmpsAudioOutputControllerJoinMap();
|
||||||
|
|
||||||
if (joinMap == null)
|
var joinMapSerialized = JoinMapHelper.GetJoinMapForDevice(joinMapKey);
|
||||||
joinMap = new DmpsAudioOutputControllerJoinMap();
|
|
||||||
|
if (!string.IsNullOrEmpty(joinMapSerialized))
|
||||||
|
joinMap = JsonConvert.DeserializeObject<DmpsAudioOutputControllerJoinMap>(joinMapSerialized);
|
||||||
|
|
||||||
joinMap.OffsetJoinNumbers(joinStart);
|
joinMap.OffsetJoinNumbers(joinStart);
|
||||||
|
|
||||||
|
|||||||
@@ -10,16 +10,20 @@ using PepperDash.Core;
|
|||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
using PepperDash.Essentials.DM;
|
using PepperDash.Essentials.DM;
|
||||||
|
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Bridges
|
namespace PepperDash.Essentials.Bridges
|
||||||
{
|
{
|
||||||
public static class DmpsRoutingControllerApiExtentions
|
public static class DmpsRoutingControllerApiExtentions
|
||||||
{
|
{
|
||||||
public static void LinkToApi(this DmpsRoutingController dmpsRouter, BasicTriList trilist, uint joinStart, string joinMapKey)
|
public static void LinkToApi(this DmpsRoutingController dmpsRouter, BasicTriList trilist, uint joinStart, string joinMapKey)
|
||||||
{
|
{
|
||||||
var joinMap = JoinMapHelper.GetJoinMapForDevice(joinMapKey) as DmpsRoutingControllerJoinMap;
|
DmpsRoutingControllerJoinMap joinMap = new DmpsRoutingControllerJoinMap();
|
||||||
|
|
||||||
if (joinMap == null)
|
var joinMapSerialized = JoinMapHelper.GetJoinMapForDevice(joinMapKey);
|
||||||
joinMap = new DmpsRoutingControllerJoinMap();
|
|
||||||
|
if (!string.IsNullOrEmpty(joinMapSerialized))
|
||||||
|
joinMap = JsonConvert.DeserializeObject<DmpsRoutingControllerJoinMap>(joinMapSerialized);
|
||||||
|
|
||||||
joinMap.OffsetJoinNumbers(joinStart);
|
joinMap.OffsetJoinNumbers(joinStart);
|
||||||
|
|
||||||
|
|||||||
@@ -1,103 +1,74 @@
|
|||||||
//using System;
|
using System;
|
||||||
//using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
//using System.Linq;
|
using System.Linq;
|
||||||
//using System.Text;
|
using System.Text;
|
||||||
//using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
//using Crestron.SimplSharpPro.DeviceSupport;
|
using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
//using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
//using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
//using PepperDash.Essentials.Devices.Common;
|
using PepperDash.Essentials.Devices.Common;
|
||||||
|
|
||||||
//namespace PepperDash.Essentials.Bridges
|
using Newtonsoft.Json;
|
||||||
//{
|
|
||||||
// public static class GenericLightingApiExtensions
|
|
||||||
// {
|
|
||||||
// public static void LinkToApi(this PepperDash.Essentials.Core.Lighting.LightingBase lightingDevice, BasicTriList trilist, uint joinStart, string joinMapKey)
|
|
||||||
// {
|
|
||||||
// var joinMap = JoinMapHelper.GetJoinMapForDevice(joinMapKey) as GenericLightingJoinMap;
|
|
||||||
|
|
||||||
// if (joinMap == null)
|
namespace PepperDash.Essentials.Bridges
|
||||||
// joinMap = new GenericLightingJoinMap();
|
{
|
||||||
|
public static class GenericLightingApiExtensions
|
||||||
|
{
|
||||||
|
public static void LinkToApi(this PepperDash.Essentials.Core.Lighting.LightingBase lightingDevice, BasicTriList trilist, uint joinStart, string joinMapKey)
|
||||||
|
{
|
||||||
|
GenericLightingJoinMap joinMap = new GenericLightingJoinMap();
|
||||||
|
|
||||||
// joinMap.OffsetJoinNumbers(joinStart);
|
var joinMapSerialized = JoinMapHelper.GetJoinMapForDevice(joinMapKey);
|
||||||
// Debug.Console(1, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
|
||||||
|
if (!string.IsNullOrEmpty(joinMapSerialized))
|
||||||
|
joinMap = JsonConvert.DeserializeObject<GenericLightingJoinMap>(joinMapSerialized);
|
||||||
|
|
||||||
|
joinMap.OffsetJoinNumbers(joinStart);
|
||||||
|
|
||||||
|
Debug.Console(1, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
||||||
|
|
||||||
|
Debug.Console(0, "Linking to Lighting Type {0}", lightingDevice.GetType().Name.ToString());
|
||||||
|
|
||||||
|
// GenericLighitng Actions & FeedBack
|
||||||
|
trilist.SetUShortSigAction(joinMap.SelectScene, u => lightingDevice.SelectScene(lightingDevice.LightingScenes[u]));
|
||||||
|
|
||||||
|
int sceneIndex = 1;
|
||||||
|
foreach (var scene in lightingDevice.LightingScenes)
|
||||||
|
{
|
||||||
|
var tempIndex = sceneIndex - 1;
|
||||||
|
trilist.SetSigTrueAction((uint)(joinMap.LightingSceneOffset + sceneIndex), () => lightingDevice.SelectScene(lightingDevice.LightingScenes[tempIndex]));
|
||||||
|
scene.IsActiveFeedback.LinkInputSig(trilist.BooleanInput[(uint)(joinMap.LightingSceneOffset + sceneIndex)]);
|
||||||
|
trilist.StringInput[(uint)(joinMap.LightingSceneOffset + sceneIndex)].StringValue = scene.Name;
|
||||||
|
trilist.BooleanInput[(uint)(joinMap.ButtonVisibilityOffset + sceneIndex)].BoolValue = true;
|
||||||
|
sceneIndex++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (lightingDevice.GetType().Name.ToString() == "LutronQuantumArea")
|
||||||
|
{
|
||||||
|
var lutronDevice = lightingDevice as PepperDash.Essentials.Devices.Common.Environment.Lutron.LutronQuantumArea;
|
||||||
|
lutronDevice.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
|
||||||
|
trilist.SetStringSigAction(joinMap.IntegrationIdSet, s => lutronDevice.IntegrationId = s);
|
||||||
|
}
|
||||||
|
|
||||||
|
//ApiEisc.Eisc.SetStringSigAction(ApiMap.integrationID, (s) => { lutronLights.IntegrationId = s; });
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
// Debug.Console(0, "Linking to lighting Type {0}", lightingDevice.GetType().Name.ToString());
|
var lutronLights = lightingDevice as PepperDash.Essentials.Devices.Common.Environment.Lutron.LutronQuantumArea;
|
||||||
|
|
||||||
// // GenericLighitng Actions & FeedBack
|
|
||||||
// trilist.SetUShortSigAction(joinMap.SelectScene, u => lightingDevice.SelectScene(lightingDevice.LightingScenes[u]));
|
|
||||||
|
|
||||||
// int sceneIndex = 1;
|
|
||||||
// foreach (var scene in lightingDevice.LightingScenes)
|
|
||||||
// {
|
|
||||||
// var tempIndex = sceneIndex - 1;
|
|
||||||
// trilist.SetSigTrueAction((uint)(joinMap.LightingSceneOffset + sceneIndex), () => lightingDevice.SelectScene(lightingDevice.LightingScenes[tempIndex]));
|
|
||||||
// scene.IsActiveFeedback.LinkInputSig(trilist.BooleanInput[(uint)(joinMap.LightingSceneOffset + sceneIndex)]);
|
|
||||||
// trilist.StringInput[(uint)(joinMap.LightingSceneOffset + sceneIndex)].StringValue = scene.Name;
|
|
||||||
// trilist.BooleanInput[(uint)(joinMap.ButtonVisibilityOffset + sceneIndex)].BoolValue = true;
|
|
||||||
// sceneIndex++;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// if (lightingDevice.GetType().Name.ToString() == "LutronQuantumArea")
|
|
||||||
// {
|
|
||||||
// var lutronDevice = lightingDevice as PepperDash.Essentials.Devices.Common.Environment.Lutron.LutronQuantumArea;
|
|
||||||
// lutronDevice.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
|
|
||||||
// trilist.SetStringSigAction(joinMap.IntegrationIdSet, s => lutronDevice.IntegrationId = s);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// //ApiEisc.Eisc.SetStringSigAction(ApiMap.integrationID, (s) => { lutronLights.IntegrationId = s; });
|
|
||||||
|
|
||||||
|
|
||||||
// /*
|
for (uint i = 1; i <= lightingBase.CircuitCount; i++)
|
||||||
// var lutronLights = lightingDevice as PepperDash.Essentials.Devices.Common.Environment.Lutron.LutronQuantumArea;
|
{
|
||||||
|
var circuit = i;
|
||||||
|
lightingBase.CircuitNameFeedbacks[circuit - 1].LinkInputSig(trilist.StringInput[joinMap.CircuitNames + circuit]);
|
||||||
|
lightingBase.CircuitIsCritical[circuit - 1].LinkInputSig(trilist.BooleanInput[joinMap.CircuitIsCritical + circuit]);
|
||||||
|
lightingBase.CircuitState[circuit - 1].LinkInputSig(trilist.BooleanInput[joinMap.CircuitState + circuit]);
|
||||||
|
trilist.SetSigTrueAction(joinMap.CircuitCycle + circuit, () => lightingBase.CycleCircuit(circuit - 1));
|
||||||
|
trilist.SetSigTrueAction(joinMap.CircuitOnCmd + circuit, () => lightingBase.TurnOnCircuit(circuit - 1));
|
||||||
|
trilist.SetSigTrueAction(joinMap.CircuitOffCmd + circuit, () => lightingBase.TurnOffCircuit(circuit - 1));
|
||||||
|
|
||||||
|
}
|
||||||
// for (uint i = 1; i <= lightingBase.CircuitCount; i++)
|
*/
|
||||||
// {
|
}
|
||||||
// var circuit = i;
|
}
|
||||||
// lightingBase.CircuitNameFeedbacks[circuit - 1].LinkInputSig(trilist.StringInput[joinMap.CircuitNames + circuit]);
|
}
|
||||||
// lightingBase.CircuitIsCritical[circuit - 1].LinkInputSig(trilist.BooleanInput[joinMap.CircuitIsCritical + circuit]);
|
|
||||||
// lightingBase.CircuitState[circuit - 1].LinkInputSig(trilist.BooleanInput[joinMap.CircuitState + circuit]);
|
|
||||||
// trilist.SetSigTrueAction(joinMap.CircuitCycle + circuit, () => lightingBase.CycleCircuit(circuit - 1));
|
|
||||||
// trilist.SetSigTrueAction(joinMap.CircuitOnCmd + circuit, () => lightingBase.TurnOnCircuit(circuit - 1));
|
|
||||||
// trilist.SetSigTrueAction(joinMap.CircuitOffCmd + circuit, () => lightingBase.TurnOffCircuit(circuit - 1));
|
|
||||||
|
|
||||||
// }
|
|
||||||
// */
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// public class GenericLightingJoinMap : JoinMapBase
|
|
||||||
// {
|
|
||||||
// public uint IsOnline { get; set; }
|
|
||||||
// public uint SelectScene { get; set; }
|
|
||||||
// public uint LightingSceneOffset { get; set; }
|
|
||||||
// public uint ButtonVisibilityOffset { get; set; }
|
|
||||||
// public uint IntegrationIdSet { get; set; }
|
|
||||||
|
|
||||||
// public GenericLightingJoinMap()
|
|
||||||
// {
|
|
||||||
// // Digital
|
|
||||||
// IsOnline = 1;
|
|
||||||
// SelectScene = 1;
|
|
||||||
// IntegrationIdSet = 1;
|
|
||||||
// LightingSceneOffset = 10;
|
|
||||||
// ButtonVisibilityOffset = 40;
|
|
||||||
// // Analog
|
|
||||||
// }
|
|
||||||
|
|
||||||
// public override void OffsetJoinNumbers(uint joinStart)
|
|
||||||
// {
|
|
||||||
// var joinOffset = joinStart - 1;
|
|
||||||
|
|
||||||
// IsOnline = IsOnline + joinOffset;
|
|
||||||
// SelectScene = SelectScene + joinOffset;
|
|
||||||
// LightingSceneOffset = LightingSceneOffset + joinOffset;
|
|
||||||
// ButtonVisibilityOffset = ButtonVisibilityOffset + joinOffset;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
@@ -5,21 +5,24 @@ using System.Text;
|
|||||||
using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
using Crestron.SimplSharpPro.DeviceSupport;
|
using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
|
|
||||||
|
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
using PepperDash.Essentials.Core.CrestronIO;
|
using PepperDash.Essentials.Core.CrestronIO;
|
||||||
|
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Bridges
|
namespace PepperDash.Essentials.Bridges
|
||||||
{
|
{
|
||||||
public static class GenericRelayDeviceApiExtensions
|
public static class GenericRelayDeviceApiExtensions
|
||||||
{
|
{
|
||||||
public static void LinkToApi(this GenericRelayDevice relay, BasicTriList trilist, uint joinStart, string joinMapKey)
|
public static void LinkToApi(this GenericRelayDevice relay, BasicTriList trilist, uint joinStart, string joinMapKey)
|
||||||
{
|
{
|
||||||
var joinMap = JoinMapHelper.GetJoinMapForDevice(joinMapKey) as GenericRelayControllerJoinMap;
|
GenericRelayControllerJoinMap joinMap = new GenericRelayControllerJoinMap();
|
||||||
|
|
||||||
if (joinMap == null)
|
var joinMapSerialized = JoinMapHelper.GetJoinMapForDevice(joinMapKey);
|
||||||
joinMap = new GenericRelayControllerJoinMap();
|
|
||||||
|
if (!string.IsNullOrEmpty(joinMapSerialized))
|
||||||
|
joinMap = JsonConvert.DeserializeObject<GenericRelayControllerJoinMap>(joinMapSerialized);
|
||||||
|
|
||||||
joinMap.OffsetJoinNumbers(joinStart);
|
joinMap.OffsetJoinNumbers(joinStart);
|
||||||
|
|
||||||
|
|||||||
@@ -12,16 +12,20 @@ using PepperDash.Core;
|
|||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
using PepperDash.Essentials.DM;
|
using PepperDash.Essentials.DM;
|
||||||
|
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Bridges
|
namespace PepperDash.Essentials.Bridges
|
||||||
{
|
{
|
||||||
public static class HdMdxxxCEControllerApiExtensions
|
public static class HdMdxxxCEControllerApiExtensions
|
||||||
{
|
{
|
||||||
public static void LinkToApi(this HdMdxxxCEController hdMdPair, BasicTriList trilist, uint joinStart, string joinMapKey)
|
public static void LinkToApi(this HdMdxxxCEController hdMdPair, BasicTriList trilist, uint joinStart, string joinMapKey)
|
||||||
{
|
{
|
||||||
var joinMap = JoinMapHelper.GetJoinMapForDevice(joinMapKey) as HdMdxxxCEControllerJoinMap;
|
HdMdxxxCEControllerJoinMap joinMap = new HdMdxxxCEControllerJoinMap();
|
||||||
|
|
||||||
if (joinMap == null)
|
var joinMapSerialized = JoinMapHelper.GetJoinMapForDevice(joinMapKey);
|
||||||
joinMap = new HdMdxxxCEControllerJoinMap();
|
|
||||||
|
if (!string.IsNullOrEmpty(joinMapSerialized))
|
||||||
|
joinMap = JsonConvert.DeserializeObject<HdMdxxxCEControllerJoinMap>(joinMapSerialized);
|
||||||
|
|
||||||
joinMap.OffsetJoinNumbers(joinStart);
|
joinMap.OffsetJoinNumbers(joinStart);
|
||||||
|
|
||||||
|
|||||||
@@ -8,17 +8,20 @@ using Crestron.SimplSharpPro.DeviceSupport;
|
|||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
|
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Bridges
|
namespace PepperDash.Essentials.Bridges
|
||||||
{
|
{
|
||||||
public static class IBasicCommunicationApiExtensions
|
public static class IBasicCommunicationApiExtensions
|
||||||
{
|
{
|
||||||
public static void LinkToApi(this GenericComm comm, BasicTriList trilist, uint joinStart, string joinMapKey)
|
public static void LinkToApi(this GenericComm comm, BasicTriList trilist, uint joinStart, string joinMapKey)
|
||||||
{
|
{
|
||||||
var joinMap = JoinMapHelper.GetJoinMapForDevice(joinMapKey) as IBasicCommunicationJoinMap;
|
IBasicCommunicationJoinMap joinMap = new IBasicCommunicationJoinMap();
|
||||||
|
|
||||||
if (joinMap == null)
|
var joinMapSerialized = JoinMapHelper.GetJoinMapForDevice(joinMapKey);
|
||||||
joinMap = new IBasicCommunicationJoinMap();
|
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(joinMapSerialized))
|
||||||
|
joinMap = JsonConvert.DeserializeObject<IBasicCommunicationJoinMap>(joinMapSerialized);
|
||||||
joinMap.OffsetJoinNumbers(joinStart);
|
joinMap.OffsetJoinNumbers(joinStart);
|
||||||
|
|
||||||
if (comm.CommPort == null)
|
if (comm.CommPort == null)
|
||||||
@@ -36,7 +39,7 @@ namespace PepperDash.Essentials.Bridges
|
|||||||
trilist.SetString(joinMap.TextReceived, a.Text);
|
trilist.SetString(joinMap.TextReceived, a.Text);
|
||||||
};
|
};
|
||||||
trilist.SetStringSigAction(joinMap.SendText, new Action<string>(s => comm.CommPort.SendText(s)));
|
trilist.SetStringSigAction(joinMap.SendText, new Action<string>(s => comm.CommPort.SendText(s)));
|
||||||
trilist.SetStringSigAction(joinMap.SetPortConfig + 1, new Action<string>(s => comm.SetPortConfig(s)));
|
trilist.SetStringSigAction(joinMap.SetPortConfig, new Action<string>(s => comm.SetPortConfig(s)));
|
||||||
|
|
||||||
|
|
||||||
var sComm = comm.CommPort as ISocketStatus;
|
var sComm = comm.CommPort as ISocketStatus;
|
||||||
|
|||||||
@@ -6,18 +6,23 @@ using Crestron.SimplSharp;
|
|||||||
using Crestron.SimplSharpPro.DeviceSupport;
|
using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
|
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
|
using PepperDash.Essentials.Core;
|
||||||
using PepperDash.Essentials.Core.CrestronIO;
|
using PepperDash.Essentials.Core.CrestronIO;
|
||||||
|
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Bridges
|
namespace PepperDash.Essentials.Bridges
|
||||||
{
|
{
|
||||||
public static class IDigitalInputApiExtenstions
|
public static class IDigitalInputApiExtenstions
|
||||||
{
|
{
|
||||||
public static void LinkToApi(this IDigitalInput input, BasicTriList trilist, uint joinStart, string joinMapKey)
|
public static void LinkToApi(this IDigitalInput input, BasicTriList trilist, uint joinStart, string joinMapKey)
|
||||||
{
|
{
|
||||||
var joinMap = JoinMapHelper.GetJoinMapForDevice(joinMapKey) as IDigitalInputJoinMap;
|
IDigitalInputJoinMap joinMap = new IDigitalInputJoinMap();
|
||||||
|
|
||||||
if (joinMap == null)
|
var joinMapSerialized = JoinMapHelper.GetJoinMapForDevice(joinMapKey);
|
||||||
joinMap = new IDigitalInputJoinMap();
|
|
||||||
|
if (!string.IsNullOrEmpty(joinMapSerialized))
|
||||||
|
joinMap = JsonConvert.DeserializeObject<IDigitalInputJoinMap>(joinMapSerialized);
|
||||||
|
|
||||||
joinMap.OffsetJoinNumbers(joinStart);
|
joinMap.OffsetJoinNumbers(joinStart);
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
|
using PepperDash.Essentials.Core;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Bridges
|
namespace PepperDash.Essentials.Bridges
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
|
using PepperDash.Essentials.Core;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Bridges
|
namespace PepperDash.Essentials.Bridges
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -0,0 +1,61 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using Crestron.SimplSharp;
|
||||||
|
|
||||||
|
using PepperDash.Essentials.Core;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Bridges
|
||||||
|
{
|
||||||
|
public class CameraControllerJoinMap : JoinMapBase
|
||||||
|
{
|
||||||
|
public uint IsOnline { get; set; }
|
||||||
|
public uint PowerOff { get; set; }
|
||||||
|
public uint PowerOn { get; set; }
|
||||||
|
public uint Up { get; set; }
|
||||||
|
public uint Down { get; set; }
|
||||||
|
public uint Left { get; set; }
|
||||||
|
public uint Right { get; set; }
|
||||||
|
public uint ZoomIn { get; set; }
|
||||||
|
public uint ZoomOut { get; set; }
|
||||||
|
public uint PresetRecallOffset { get; set; }
|
||||||
|
public uint PresetSaveOffset { get; set; }
|
||||||
|
public uint NumberOfPresets { get; set; }
|
||||||
|
|
||||||
|
public CameraControllerJoinMap()
|
||||||
|
{
|
||||||
|
// Digital
|
||||||
|
IsOnline = 9;
|
||||||
|
PowerOff = 8;
|
||||||
|
PowerOn = 7;
|
||||||
|
Up = 1;
|
||||||
|
Down = 2;
|
||||||
|
Left = 3;
|
||||||
|
Right = 4;
|
||||||
|
ZoomIn = 5;
|
||||||
|
ZoomOut = 6;
|
||||||
|
PresetRecallOffset = 10;
|
||||||
|
PresetSaveOffset = 30;
|
||||||
|
NumberOfPresets = 5;
|
||||||
|
// Analog
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void OffsetJoinNumbers(uint joinStart)
|
||||||
|
{
|
||||||
|
var joinOffset = joinStart - 1;
|
||||||
|
|
||||||
|
IsOnline = IsOnline + joinOffset;
|
||||||
|
PowerOff = PowerOff + joinOffset;
|
||||||
|
PowerOn = PowerOn + joinOffset;
|
||||||
|
Up = Up + joinOffset;
|
||||||
|
Down = Down + joinOffset;
|
||||||
|
Left = Left + joinOffset;
|
||||||
|
Right = Right + joinOffset;
|
||||||
|
ZoomIn = ZoomIn + joinOffset;
|
||||||
|
ZoomOut = ZoomOut + joinOffset;
|
||||||
|
PresetRecallOffset = PresetRecallOffset + joinOffset;
|
||||||
|
PresetSaveOffset = PresetSaveOffset + joinOffset;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using Crestron.SimplSharp;
|
||||||
|
|
||||||
|
using PepperDash.Essentials.Core;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Bridges
|
||||||
|
{
|
||||||
|
public class DigitalLoggerJoinMap : JoinMapBase
|
||||||
|
{
|
||||||
|
public uint IsOnline { get; set; }
|
||||||
|
public uint CircuitNames { get; set; }
|
||||||
|
public uint CircuitState { get; set; }
|
||||||
|
public uint CircuitCycle { get; set; }
|
||||||
|
public uint CircuitIsCritical { get; set; }
|
||||||
|
public uint CircuitOnCmd { get; set; }
|
||||||
|
public uint CircuitOffCmd { get; set; }
|
||||||
|
|
||||||
|
public DigitalLoggerJoinMap()
|
||||||
|
{
|
||||||
|
// Digital
|
||||||
|
IsOnline = 9;
|
||||||
|
CircuitState = 0;
|
||||||
|
CircuitCycle = 0;
|
||||||
|
CircuitIsCritical = 10;
|
||||||
|
CircuitOnCmd = 10;
|
||||||
|
CircuitOffCmd = 20;
|
||||||
|
// Serial
|
||||||
|
CircuitNames = 0;
|
||||||
|
// Analog
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void OffsetJoinNumbers(uint joinStart)
|
||||||
|
{
|
||||||
|
var joinOffset = joinStart - 1;
|
||||||
|
|
||||||
|
IsOnline = IsOnline + joinOffset;
|
||||||
|
CircuitNames = CircuitNames + joinOffset;
|
||||||
|
CircuitState = CircuitState + joinOffset;
|
||||||
|
CircuitCycle = CircuitCycle + joinOffset;
|
||||||
|
CircuitIsCritical = CircuitIsCritical + joinOffset;
|
||||||
|
CircuitOnCmd = CircuitOnCmd + joinOffset;
|
||||||
|
CircuitOffCmd = CircuitOffCmd + joinOffset;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
|
using PepperDash.Essentials.Core;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Bridges
|
namespace PepperDash.Essentials.Bridges
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
|
using PepperDash.Essentials.Core;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Bridges
|
namespace PepperDash.Essentials.Bridges
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
|
using PepperDash.Essentials.Core;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Bridges
|
namespace PepperDash.Essentials.Bridges
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
|
using PepperDash.Essentials.Core;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Bridges
|
namespace PepperDash.Essentials.Bridges
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
|
using PepperDash.Essentials.Core;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Bridges
|
namespace PepperDash.Essentials.Bridges
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
|
using PepperDash.Essentials.Core;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Bridges
|
namespace PepperDash.Essentials.Bridges
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -0,0 +1,41 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using Crestron.SimplSharp;
|
||||||
|
|
||||||
|
using PepperDash.Essentials.Core;
|
||||||
|
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Bridges
|
||||||
|
{
|
||||||
|
public class GenericLightingJoinMap : JoinMapBase
|
||||||
|
{
|
||||||
|
public uint IsOnline { get; set; }
|
||||||
|
public uint SelectScene { get; set; }
|
||||||
|
public uint LightingSceneOffset { get; set; }
|
||||||
|
public uint ButtonVisibilityOffset { get; set; }
|
||||||
|
public uint IntegrationIdSet { get; set; }
|
||||||
|
|
||||||
|
public GenericLightingJoinMap()
|
||||||
|
{
|
||||||
|
// Digital
|
||||||
|
IsOnline = 1;
|
||||||
|
SelectScene = 1;
|
||||||
|
IntegrationIdSet = 1;
|
||||||
|
LightingSceneOffset = 10;
|
||||||
|
ButtonVisibilityOffset = 40;
|
||||||
|
// Analog
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void OffsetJoinNumbers(uint joinStart)
|
||||||
|
{
|
||||||
|
var joinOffset = joinStart - 1;
|
||||||
|
|
||||||
|
IsOnline = IsOnline + joinOffset;
|
||||||
|
SelectScene = SelectScene + joinOffset;
|
||||||
|
LightingSceneOffset = LightingSceneOffset + joinOffset;
|
||||||
|
ButtonVisibilityOffset = ButtonVisibilityOffset + joinOffset;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
|
using PepperDash.Essentials.Core;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Bridges
|
namespace PepperDash.Essentials.Bridges
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
|
using PepperDash.Essentials.Core;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Bridges
|
namespace PepperDash.Essentials.Bridges
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
|
using PepperDash.Essentials.Core;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Bridges
|
namespace PepperDash.Essentials.Bridges
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
|
using PepperDash.Essentials.Core;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Bridges
|
namespace PepperDash.Essentials.Bridges
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
|
using PepperDash.Essentials.Core;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Bridges
|
namespace PepperDash.Essentials.Bridges
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -9,20 +9,25 @@ using PepperDash.Core;
|
|||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
using PepperDash.Essentials.Core.Monitoring;
|
using PepperDash.Essentials.Core.Monitoring;
|
||||||
|
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Bridges
|
namespace PepperDash.Essentials.Bridges
|
||||||
{
|
{
|
||||||
public static class SystemMonitorBridge
|
public static class SystemMonitorBridge
|
||||||
{
|
{
|
||||||
public static void LinkToApi(this SystemMonitorController systemMonitorController, BasicTriList trilist, uint joinStart, string joinMapKey)
|
public static void LinkToApi(this SystemMonitorController systemMonitorController, BasicTriList trilist, uint joinStart, string joinMapKey)
|
||||||
{
|
{
|
||||||
var joinMap = JoinMapHelper.GetJoinMapForDevice(joinMapKey) as SystemMonitorJoinMap;
|
SystemMonitorJoinMap joinMap = new SystemMonitorJoinMap();
|
||||||
|
|
||||||
if (joinMap == null)
|
var joinMapSerialized = JoinMapHelper.GetJoinMapForDevice(joinMapKey);
|
||||||
joinMap = new SystemMonitorJoinMap();
|
|
||||||
|
if(!string.IsNullOrEmpty(joinMapSerialized))
|
||||||
|
joinMap = JsonConvert.DeserializeObject<SystemMonitorJoinMap>(joinMapSerialized);
|
||||||
|
|
||||||
joinMap.OffsetJoinNumbers(joinStart);
|
joinMap.OffsetJoinNumbers(joinStart);
|
||||||
|
|
||||||
//Debug.Console(1, systemMonitorController, "Linking API starting at join: {0}", joinStart);
|
Debug.Console(1, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
||||||
|
Debug.Console(2, systemMonitorController, "Linking API starting at join: {0}", joinStart);
|
||||||
|
|
||||||
systemMonitorController.TimeZoneFeedback.LinkInputSig(trilist.UShortInput[joinMap.TimeZone]);
|
systemMonitorController.TimeZoneFeedback.LinkInputSig(trilist.UShortInput[joinMap.TimeZone]);
|
||||||
//trilist.SetUShortSigAction(joinMap.TimeZone, new Action<ushort>(u => systemMonitorController.SetTimeZone(u)));
|
//trilist.SetUShortSigAction(joinMap.TimeZone, new Action<ushort>(u => systemMonitorController.SetTimeZone(u)));
|
||||||
@@ -33,18 +38,13 @@ namespace PepperDash.Essentials.Bridges
|
|||||||
systemMonitorController.BACnetAppVersionFeedback.LinkInputSig(trilist.StringInput[joinMap.BACnetAppVersion]);
|
systemMonitorController.BACnetAppVersionFeedback.LinkInputSig(trilist.StringInput[joinMap.BACnetAppVersion]);
|
||||||
systemMonitorController.ControllerVersionFeedback.LinkInputSig(trilist.StringInput[joinMap.ControllerVersion]);
|
systemMonitorController.ControllerVersionFeedback.LinkInputSig(trilist.StringInput[joinMap.ControllerVersion]);
|
||||||
|
|
||||||
|
|
||||||
// iterate the program status feedback collection and map all the joins
|
// iterate the program status feedback collection and map all the joins
|
||||||
var programSlotJoinStart = joinMap.ProgramStartJoin;
|
var programSlotJoinStart = joinMap.ProgramStartJoin;
|
||||||
|
|
||||||
foreach (var p in systemMonitorController.ProgramStatusFeedbackCollection)
|
foreach (var p in systemMonitorController.ProgramStatusFeedbackCollection)
|
||||||
{
|
{
|
||||||
|
|
||||||
// TODO: link feedbacks for each program slot
|
|
||||||
var programNumber = p.Value.Program.Number;
|
var programNumber = p.Value.Program.Number;
|
||||||
|
|
||||||
//Debug.Console(1, systemMonitorController, "Linking API for Program Slot: {0} starting at join: {1}", programNumber, programSlotJoinStart);
|
|
||||||
|
|
||||||
trilist.SetBoolSigAction(programSlotJoinStart + joinMap.ProgramStart, new Action<bool>
|
trilist.SetBoolSigAction(programSlotJoinStart + joinMap.ProgramStart, new Action<bool>
|
||||||
(b => SystemMonitor.ProgramCollection[programNumber].OperatingState = eProgramOperatingState.Start));
|
(b => SystemMonitor.ProgramCollection[programNumber].OperatingState = eProgramOperatingState.Start));
|
||||||
p.Value.ProgramStartedFeedback.LinkInputSig(trilist.BooleanInput[programSlotJoinStart + joinMap.ProgramStart]);
|
p.Value.ProgramStartedFeedback.LinkInputSig(trilist.BooleanInput[programSlotJoinStart + joinMap.ProgramStart]);
|
||||||
|
|||||||
@@ -134,15 +134,17 @@
|
|||||||
<Compile Include="Bridges\DmRmcControllerBridge.cs" />
|
<Compile Include="Bridges\DmRmcControllerBridge.cs" />
|
||||||
<Compile Include="Bridges\IBridge.cs" />
|
<Compile Include="Bridges\IBridge.cs" />
|
||||||
<Compile Include="Bridges\IDigitalInputBridge.cs" />
|
<Compile Include="Bridges\IDigitalInputBridge.cs" />
|
||||||
<Compile Include="Bridges\JoinMapBase.cs" />
|
|
||||||
<Compile Include="Bridges\JoinMaps\AirMediaControllerJoinMap.cs" />
|
<Compile Include="Bridges\JoinMaps\AirMediaControllerJoinMap.cs" />
|
||||||
<Compile Include="Bridges\JoinMaps\AppleTvJoinMap.cs" />
|
<Compile Include="Bridges\JoinMaps\AppleTvJoinMap.cs" />
|
||||||
|
<Compile Include="Bridges\JoinMaps\CameraControllerJoinMap.cs" />
|
||||||
|
<Compile Include="Bridges\JoinMaps\DigitalLoggerJoinMap.cs" />
|
||||||
<Compile Include="Bridges\JoinMaps\DisplayControllerJoinMap.cs" />
|
<Compile Include="Bridges\JoinMaps\DisplayControllerJoinMap.cs" />
|
||||||
<Compile Include="Bridges\JoinMaps\DmChassisControllerJoinMap.cs" />
|
<Compile Include="Bridges\JoinMaps\DmChassisControllerJoinMap.cs" />
|
||||||
<Compile Include="Bridges\JoinMaps\DmpsAudioOutputControllerJoinMap.cs" />
|
<Compile Include="Bridges\JoinMaps\DmpsAudioOutputControllerJoinMap.cs" />
|
||||||
<Compile Include="Bridges\JoinMaps\DmpsRoutingControllerJoinMap.cs" />
|
<Compile Include="Bridges\JoinMaps\DmpsRoutingControllerJoinMap.cs" />
|
||||||
<Compile Include="Bridges\JoinMaps\DmRmcControllerJoinMap.cs" />
|
<Compile Include="Bridges\JoinMaps\DmRmcControllerJoinMap.cs" />
|
||||||
<Compile Include="Bridges\JoinMaps\DmTxControllerJoinMap.cs" />
|
<Compile Include="Bridges\JoinMaps\DmTxControllerJoinMap.cs" />
|
||||||
|
<Compile Include="Bridges\JoinMaps\GenericLightingJoinMap.cs" />
|
||||||
<Compile Include="Bridges\JoinMaps\GenericRelayControllerJoinMap.cs" />
|
<Compile Include="Bridges\JoinMaps\GenericRelayControllerJoinMap.cs" />
|
||||||
<Compile Include="Bridges\JoinMaps\HdMdxxxCEControllerJoinMap.cs" />
|
<Compile Include="Bridges\JoinMaps\HdMdxxxCEControllerJoinMap.cs" />
|
||||||
<Compile Include="Bridges\JoinMaps\IBasicCommunicationJoinMap.cs" />
|
<Compile Include="Bridges\JoinMaps\IBasicCommunicationJoinMap.cs" />
|
||||||
|
|||||||
@@ -26,6 +26,9 @@ namespace PepperDash.Essentials.Core.Config
|
|||||||
[JsonProperty("tieLines")]
|
[JsonProperty("tieLines")]
|
||||||
public List<TieLineConfig> TieLines { get; set; }
|
public List<TieLineConfig> TieLines { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("joinMaps")]
|
||||||
|
public Dictionary<string, string> JoinMaps { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Checks SourceLists for a given list and returns it if found. Otherwise, returns null
|
/// Checks SourceLists for a given list and returns it if found. Otherwise, returns null
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -4,22 +4,29 @@ using System.Linq;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Bridges
|
using PepperDash.Essentials.Core.Config;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Core
|
||||||
{
|
{
|
||||||
public static class JoinMapHelper
|
public static class JoinMapHelper
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Attempts to get the join map from config
|
/// Attempts to get the serialized join map from config
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="joinMapKey"></param>
|
/// <param name="joinMapKey"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static JoinMapBase GetJoinMapForDevice(string joinMapKey)
|
public static string GetJoinMapForDevice(string joinMapKey)
|
||||||
{
|
{
|
||||||
if (!string.IsNullOrEmpty(joinMapKey))
|
if (string.IsNullOrEmpty(joinMapKey))
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
// FUTURE TODO: Get the join map from the ConfigReader.ConfigObject
|
var joinMap = ConfigReader.ConfigObject.JoinMaps[joinMapKey];
|
||||||
|
|
||||||
|
if (joinMap != null)
|
||||||
|
{
|
||||||
|
return joinMap;
|
||||||
|
}
|
||||||
|
else
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -82,7 +82,7 @@
|
|||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="SimplSharpHelperInterface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
<Reference Include="SimplSharpHelperInterface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||||
<SpecificVersion>False</SpecificVersion>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpHelperInterface.dll</HintPath>
|
<HintPath>..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpHelperInterface.dll</HintPath>
|
||||||
<Private>False</Private>
|
<Private>False</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="SimplSharpNewtonsoft, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
<Reference Include="SimplSharpNewtonsoft, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||||
@@ -134,6 +134,7 @@
|
|||||||
<Compile Include="Feedbacks\StringFeedback.cs" />
|
<Compile Include="Feedbacks\StringFeedback.cs" />
|
||||||
<Compile Include="Global\JobTimer.cs" />
|
<Compile Include="Global\JobTimer.cs" />
|
||||||
<Compile Include="Global\Scheduler.cs" />
|
<Compile Include="Global\Scheduler.cs" />
|
||||||
|
<Compile Include="JoinMaps\JoinMapBase.cs" />
|
||||||
<Compile Include="Lighting\Lighting Interfaces.cs" />
|
<Compile Include="Lighting\Lighting Interfaces.cs" />
|
||||||
<Compile Include="Lighting\LightingBase.cs" />
|
<Compile Include="Lighting\LightingBase.cs" />
|
||||||
<Compile Include="Monitoring\SystemMonitorController.cs" />
|
<Compile Include="Monitoring\SystemMonitorController.cs" />
|
||||||
|
|||||||
@@ -120,7 +120,7 @@
|
|||||||
<Compile Include="ImageProcessors\AnalogWay\AnalogWayLiveCorePropertiesConfig.cs" />
|
<Compile Include="ImageProcessors\AnalogWay\AnalogWayLiveCorePropertiesConfig.cs" />
|
||||||
<Compile Include="VideoCodec\CiscoCodec\CiscoCamera.cs" />
|
<Compile Include="VideoCodec\CiscoCodec\CiscoCamera.cs" />
|
||||||
<Compile Include="VideoCodec\CiscoCodec\RoomPresets.cs" />
|
<Compile Include="VideoCodec\CiscoCodec\RoomPresets.cs" />
|
||||||
<Compile Include="VideoCodec\Interfaces\CameraControl.cs" />
|
<Compile Include="Cameras\CameraControl.cs" />
|
||||||
<Compile Include="Display\PanasonicThDisplay.cs" />
|
<Compile Include="Display\PanasonicThDisplay.cs" />
|
||||||
<Compile Include="VideoCodec\Interfaces\iVideoCodecInfo.cs" />
|
<Compile Include="VideoCodec\Interfaces\iVideoCodecInfo.cs" />
|
||||||
<Compile Include="Codec\iHasCallFavorites.cs" />
|
<Compile Include="Codec\iHasCallFavorites.cs" />
|
||||||
|
|||||||
Reference in New Issue
Block a user