mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-04-14 04:57:15 +00:00
Merge branch 'development' into feature/add-component-room
This commit is contained in:
commit
fb97cf4753
53 changed files with 8796 additions and 6982 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -388,3 +388,4 @@ MigrationBackup/
|
||||||
|
|
||||||
# Fody - auto-generated XML schema
|
# Fody - auto-generated XML schema
|
||||||
FodyWeavers.xsd
|
FodyWeavers.xsd
|
||||||
|
essentials-framework/Essentials Interfaces/PepperDash_Essentials_Interfaces/PepperDash_Essentials_Interfaces.csproj
|
||||||
|
|
|
||||||
Binary file not shown.
Binary file not shown.
|
|
@ -70,6 +70,14 @@ namespace PepperDash.Essentials.Bridges
|
||||||
/// Range reports the highest supported HDCP state level for the corresponding input card
|
/// Range reports the highest supported HDCP state level for the corresponding input card
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public uint HdcpSupportCapability { get; set; }
|
public uint HdcpSupportCapability { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// DM Chassis Stream Input Start (1), Stop (2), Pause (3) with Feedback
|
||||||
|
/// </summary>
|
||||||
|
public uint InputStreamCardStatus { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// DM Chassis Stream Output Start (1), Stop (2), Pause (3) with Feedback
|
||||||
|
/// </summary>
|
||||||
|
public uint OutputStreamCardStatus { get; set; }
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Serials
|
#region Serials
|
||||||
|
|
@ -115,6 +123,8 @@ namespace PepperDash.Essentials.Bridges
|
||||||
InputUsb = 700; //701-899
|
InputUsb = 700; //701-899
|
||||||
HdcpSupportState = 1000; //1001-1199
|
HdcpSupportState = 1000; //1001-1199
|
||||||
HdcpSupportCapability = 1200; //1201-1399
|
HdcpSupportCapability = 1200; //1201-1399
|
||||||
|
InputStreamCardStatus = 1500; //1501-1532
|
||||||
|
OutputStreamCardStatus = 1600; //1601-1632
|
||||||
|
|
||||||
|
|
||||||
//Serial
|
//Serial
|
||||||
|
|
@ -145,6 +155,8 @@ namespace PepperDash.Essentials.Bridges
|
||||||
OutputEndpointOnline = OutputEndpointOnline + joinOffset;
|
OutputEndpointOnline = OutputEndpointOnline + joinOffset;
|
||||||
HdcpSupportState = HdcpSupportState + joinOffset;
|
HdcpSupportState = HdcpSupportState + joinOffset;
|
||||||
HdcpSupportCapability = HdcpSupportCapability + joinOffset;
|
HdcpSupportCapability = HdcpSupportCapability + joinOffset;
|
||||||
|
InputStreamCardStatus = InputStreamCardStatus + joinOffset;
|
||||||
|
OutputStreamCardStatus = OutputStreamCardStatus + joinOffset;
|
||||||
OutputDisabledByHdcp = OutputDisabledByHdcp + joinOffset;
|
OutputDisabledByHdcp = OutputDisabledByHdcp + joinOffset;
|
||||||
TxAdvancedIsPresent = TxAdvancedIsPresent + joinOffset;
|
TxAdvancedIsPresent = TxAdvancedIsPresent + joinOffset;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
using PepperDash.Essentials.Core.Bridges;
|
using PepperDash.Essentials.Core.Bridges;
|
||||||
using PepperDash.Essentials.Core.Config;
|
using PepperDash.Essentials.Core.Config;
|
||||||
|
using PepperDash.Essentials.Core.Fusion;
|
||||||
using PepperDash.Essentials.Devices.Common;
|
using PepperDash.Essentials.Devices.Common;
|
||||||
using PepperDash.Essentials.DM;
|
using PepperDash.Essentials.DM;
|
||||||
using PepperDash.Essentials.Fusion;
|
using PepperDash.Essentials.Fusion;
|
||||||
|
|
@ -53,7 +54,7 @@ namespace PepperDash.Essentials
|
||||||
|
|
||||||
if (Debug.DoNotLoadOnNextBoot)
|
if (Debug.DoNotLoadOnNextBoot)
|
||||||
{
|
{
|
||||||
CrestronConsole.AddNewConsoleCommand(s => GoWithLoad(), "go", "Loads configuration file",
|
CrestronConsole.AddNewConsoleCommand(s => CrestronInvoke.BeginInvoke((o) => GoWithLoad()), "go", "Loads configuration file",
|
||||||
ConsoleAccessLevelEnum.AccessOperator);
|
ConsoleAccessLevelEnum.AccessOperator);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -444,11 +445,30 @@ namespace PepperDash.Essentials
|
||||||
|
|
||||||
if (room != null && room is EssentialsRoomBase)
|
if (room != null && room is EssentialsRoomBase)
|
||||||
{
|
{
|
||||||
|
// default IPID
|
||||||
|
uint fusionIpId = 0xf1;
|
||||||
|
|
||||||
|
// default to no join map key
|
||||||
|
string fusionJoinMapKey = string.Empty;
|
||||||
|
|
||||||
|
if (room.Config.Properties["fusion"] != null)
|
||||||
|
{
|
||||||
|
Debug.Console(2, "Custom Fusion config found. Using custom values");
|
||||||
|
|
||||||
|
var fusionConfig = room.Config.Properties["fusion"].ToObject<EssentialsRoomFusionConfig>();
|
||||||
|
|
||||||
|
if (fusionConfig != null)
|
||||||
|
{
|
||||||
|
fusionIpId = fusionConfig.IpIdInt;
|
||||||
|
fusionJoinMapKey = fusionConfig.JoinMapKey;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (room is EssentialsHuddleSpaceRoom)
|
if (room is EssentialsHuddleSpaceRoom)
|
||||||
{
|
{
|
||||||
|
|
||||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Room is EssentialsHuddleSpaceRoom, attempting to add to DeviceManager with Fusion");
|
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Room is EssentialsHuddleSpaceRoom, attempting to add to DeviceManager with Fusion");
|
||||||
DeviceManager.AddDevice(new Core.Fusion.EssentialsHuddleSpaceFusionSystemControllerBase((EssentialsHuddleSpaceRoom)room, 0xf1));
|
DeviceManager.AddDevice(new Core.Fusion.EssentialsHuddleSpaceFusionSystemControllerBase(room, fusionIpId, fusionJoinMapKey));
|
||||||
|
|
||||||
|
|
||||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Attempting to build Mobile Control Bridge...");
|
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Attempting to build Mobile Control Bridge...");
|
||||||
|
|
@ -459,12 +479,24 @@ namespace PepperDash.Essentials
|
||||||
{
|
{
|
||||||
|
|
||||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Room is EssentialsHuddleVtc1Room, attempting to add to DeviceManager with Fusion");
|
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Room is EssentialsHuddleVtc1Room, attempting to add to DeviceManager with Fusion");
|
||||||
DeviceManager.AddDevice(new EssentialsHuddleVtc1FusionController((EssentialsHuddleVtc1Room)room, 0xf1));
|
DeviceManager.AddDevice(new EssentialsHuddleVtc1FusionController((EssentialsHuddleVtc1Room)room, fusionIpId, fusionJoinMapKey));
|
||||||
|
|
||||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Attempting to build Mobile Control Bridge...");
|
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Attempting to build Mobile Control Bridge...");
|
||||||
|
|
||||||
CreateMobileControlBridge(room as EssentialsRoomBase);
|
CreateMobileControlBridge(room as EssentialsRoomBase);
|
||||||
}
|
}
|
||||||
|
else if (room is EssentialsTechRoom)
|
||||||
|
{
|
||||||
|
DeviceManager.AddDevice(room);
|
||||||
|
|
||||||
|
Debug.Console(0, Debug.ErrorLogLevel.Notice,
|
||||||
|
"Room is EssentialsTechRoom, Attempting to add to DeviceManager with Fusion");
|
||||||
|
DeviceManager.AddDevice(new EssentialsTechRoomFusionSystemController((EssentialsTechRoom)room, fusionIpId, fusionJoinMapKey));
|
||||||
|
|
||||||
|
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Attempting to build Mobile Control Bridge");
|
||||||
|
|
||||||
|
CreateMobileControlBridge(room);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Room is NOT EssentialsRoom, attempting to add to DeviceManager w/o Fusion");
|
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Room is NOT EssentialsRoom, attempting to add to DeviceManager w/o Fusion");
|
||||||
|
|
@ -569,7 +601,7 @@ namespace PepperDash.Essentials
|
||||||
return ((logoDark != null && logoDark == "system") ||
|
return ((logoDark != null && logoDark == "system") ||
|
||||||
(logoLight != null && logoLight == "system") || (logo != null && logo == "system"));
|
(logoLight != null && logoLight == "system") || (logo != null && logo == "system"));
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch
|
||||||
{
|
{
|
||||||
Debug.Console(1, Debug.ErrorLogLevel.Notice, "Unable to find logo information in any room config: {0}", e);
|
Debug.Console(1, Debug.ErrorLogLevel.Notice, "Unable to find logo information in any room config: {0}", e);
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -16,8 +16,8 @@ namespace PepperDash.Essentials.Fusion
|
||||||
{
|
{
|
||||||
BooleanSigData CodecIsInCall;
|
BooleanSigData CodecIsInCall;
|
||||||
|
|
||||||
public EssentialsHuddleVtc1FusionController(EssentialsHuddleVtc1Room room, uint ipId)
|
public EssentialsHuddleVtc1FusionController(EssentialsHuddleVtc1Room room, uint ipId, string joinMapKey)
|
||||||
: base(room, ipId)
|
: base(room, ipId, joinMapKey)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -55,25 +55,25 @@ namespace PepperDash.Essentials.Fusion
|
||||||
// Map FusionRoom Attributes:
|
// Map FusionRoom Attributes:
|
||||||
|
|
||||||
// Codec volume
|
// Codec volume
|
||||||
var codecVolume = FusionRoom.CreateOffsetUshortSig(50, "Volume - Fader01", eSigIoMask.InputOutputSig);
|
var codecVolume = FusionRoom.CreateOffsetUshortSig(JoinMap.VolumeFader1.JoinNumber, JoinMap.VolumeFader1.AttributeName, eSigIoMask.InputOutputSig);
|
||||||
codecVolume.OutputSig.UserObject = new Action<ushort>(b => (codec as IBasicVolumeWithFeedback).SetVolume(b));
|
codecVolume.OutputSig.UserObject = new Action<ushort>(b => (codec as IBasicVolumeWithFeedback).SetVolume(b));
|
||||||
(codec as IBasicVolumeWithFeedback).VolumeLevelFeedback.LinkInputSig(codecVolume.InputSig);
|
(codec as IBasicVolumeWithFeedback).VolumeLevelFeedback.LinkInputSig(codecVolume.InputSig);
|
||||||
|
|
||||||
// In Call Status
|
// In Call Status
|
||||||
CodecIsInCall = FusionRoom.CreateOffsetBoolSig(69, "Conf - VC 1 In Call", eSigIoMask.InputSigOnly);
|
CodecIsInCall = FusionRoom.CreateOffsetBoolSig(JoinMap.VcCodecInCall.JoinNumber, JoinMap.VcCodecInCall.AttributeName, eSigIoMask.InputSigOnly);
|
||||||
codec.CallStatusChange += new EventHandler<PepperDash.Essentials.Devices.Common.Codec.CodecCallStatusItemChangeEventArgs>(codec_CallStatusChange);
|
codec.CallStatusChange += new EventHandler<PepperDash.Essentials.Devices.Common.Codec.CodecCallStatusItemChangeEventArgs>(codec_CallStatusChange);
|
||||||
|
|
||||||
// Online status
|
// Online status
|
||||||
if (codec is ICommunicationMonitor)
|
if (codec is ICommunicationMonitor)
|
||||||
{
|
{
|
||||||
var c = codec as ICommunicationMonitor;
|
var c = codec as ICommunicationMonitor;
|
||||||
var codecOnline = FusionRoom.CreateOffsetBoolSig(122, "Online - VC 1", eSigIoMask.InputSigOnly);
|
var codecOnline = FusionRoom.CreateOffsetBoolSig(JoinMap.VcCodecOnline.JoinNumber, JoinMap.VcCodecOnline.AttributeName, eSigIoMask.InputSigOnly);
|
||||||
codecOnline.InputSig.BoolValue = c.CommunicationMonitor.Status == MonitorStatus.IsOk;
|
codecOnline.InputSig.BoolValue = c.CommunicationMonitor.Status == MonitorStatus.IsOk;
|
||||||
c.CommunicationMonitor.StatusChange += (o, a) =>
|
c.CommunicationMonitor.StatusChange += (o, a) =>
|
||||||
{
|
{
|
||||||
codecOnline.InputSig.BoolValue = a.Status == MonitorStatus.IsOk;
|
codecOnline.InputSig.BoolValue = a.Status == MonitorStatus.IsOk;
|
||||||
};
|
};
|
||||||
Debug.Console(0, this, "Linking '{0}' communication monitor to Fusion '{1}'", codec.Key, "Online - VC 1");
|
Debug.Console(0, this, "Linking '{0}' communication monitor to Fusion '{1}'", codec.Key, JoinMap.VcCodecOnline.AttributeName);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Codec IP Address
|
// Codec IP Address
|
||||||
|
|
@ -101,10 +101,10 @@ namespace PepperDash.Essentials.Fusion
|
||||||
|
|
||||||
if (codecHasIpInfo)
|
if (codecHasIpInfo)
|
||||||
{
|
{
|
||||||
codecIpAddressSig = FusionRoom.CreateOffsetStringSig(121, "IP Address - VC", eSigIoMask.InputSigOnly);
|
codecIpAddressSig = FusionRoom.CreateOffsetStringSig(JoinMap.VcCodecIpAddress.JoinNumber, JoinMap.VcCodecIpAddress.AttributeName, eSigIoMask.InputSigOnly);
|
||||||
codecIpAddressSig.InputSig.StringValue = codecIpAddress;
|
codecIpAddressSig.InputSig.StringValue = codecIpAddress;
|
||||||
|
|
||||||
codecIpPortSig = FusionRoom.CreateOffsetStringSig(150, "IP Port - VC", eSigIoMask.InputSigOnly);
|
codecIpPortSig = FusionRoom.CreateOffsetStringSig(JoinMap.VcCodecIpPort.JoinNumber, JoinMap.VcCodecIpPort.AttributeName, eSigIoMask.InputSigOnly);
|
||||||
codecIpPortSig.InputSig.StringValue = codecIpPort.ToString();
|
codecIpPortSig.InputSig.StringValue = codecIpPort.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -123,7 +123,7 @@ namespace PepperDash.Essentials.Fusion
|
||||||
FusionStaticAssets.Add(deviceConfig.Uid, tempAsset);
|
FusionStaticAssets.Add(deviceConfig.Uid, tempAsset);
|
||||||
}
|
}
|
||||||
|
|
||||||
var codecAsset = FusionRoom.CreateStaticAsset(tempAsset.SlotNumber, tempAsset.Name, "Display", tempAsset.InstanceId);
|
var codecAsset = FusionRoom.CreateStaticAsset(tempAsset.SlotNumber, tempAsset.Name, "Codec", tempAsset.InstanceId);
|
||||||
codecAsset.PowerOn.OutputSig.UserObject = codecPowerOnAction;
|
codecAsset.PowerOn.OutputSig.UserObject = codecPowerOnAction;
|
||||||
codecAsset.PowerOff.OutputSig.UserObject = codecPowerOffAction;
|
codecAsset.PowerOff.OutputSig.UserObject = codecPowerOffAction;
|
||||||
codec.StandbyIsOnFeedback.LinkComplementInputSig(codecAsset.PowerOn.InputSig);
|
codec.StandbyIsOnFeedback.LinkComplementInputSig(codecAsset.PowerOn.InputSig);
|
||||||
|
|
@ -166,20 +166,19 @@ namespace PepperDash.Essentials.Fusion
|
||||||
|
|
||||||
CrestronConsole.AddNewConsoleCommand(RequestFullRoomSchedule, "FusReqRoomSchedule", "Requests schedule of the room for the next 24 hours", ConsoleAccessLevelEnum.AccessOperator);
|
CrestronConsole.AddNewConsoleCommand(RequestFullRoomSchedule, "FusReqRoomSchedule", "Requests schedule of the room for the next 24 hours", ConsoleAccessLevelEnum.AccessOperator);
|
||||||
CrestronConsole.AddNewConsoleCommand(ModifyMeetingEndTimeConsoleHelper, "FusReqRoomSchMod", "Ends or extends a meeting by the specified time", ConsoleAccessLevelEnum.AccessOperator);
|
CrestronConsole.AddNewConsoleCommand(ModifyMeetingEndTimeConsoleHelper, "FusReqRoomSchMod", "Ends or extends a meeting by the specified time", ConsoleAccessLevelEnum.AccessOperator);
|
||||||
CrestronConsole.AddNewConsoleCommand(CreateAsHocMeeting, "FusCreateMeeting", "Creates and Ad Hoc meeting for on hour or until the next meeting", ConsoleAccessLevelEnum.AccessOperator);
|
CrestronConsole.AddNewConsoleCommand(CreateAdHocMeeting, "FusCreateMeeting", "Creates and Ad Hoc meeting for on hour or until the next meeting", ConsoleAccessLevelEnum.AccessOperator);
|
||||||
|
|
||||||
// Room to fusion room
|
// Room to fusion room
|
||||||
Room.OnFeedback.LinkInputSig(FusionRoom.SystemPowerOn.InputSig);
|
Room.OnFeedback.LinkInputSig(FusionRoom.SystemPowerOn.InputSig);
|
||||||
|
|
||||||
// Moved to
|
// Moved to
|
||||||
CurrentRoomSourceNameSig = FusionRoom.CreateOffsetStringSig(84, "Display 1 - Current Source", eSigIoMask.InputSigOnly);
|
CurrentRoomSourceNameSig = FusionRoom.CreateOffsetStringSig(JoinMap.Display1CurrentSourceName.JoinNumber, JoinMap.Display1CurrentSourceName.AttributeName, eSigIoMask.InputSigOnly);
|
||||||
// Don't think we need to get current status of this as nothing should be alive yet.
|
// Don't think we need to get current status of this as nothing should be alive yet.
|
||||||
(Room as EssentialsHuddleVtc1Room).CurrentSourceChange += Room_CurrentSourceInfoChange;
|
(Room as EssentialsHuddleVtc1Room).CurrentSourceChange += Room_CurrentSourceInfoChange;
|
||||||
|
|
||||||
|
|
||||||
FusionRoom.SystemPowerOn.OutputSig.SetSigFalseAction((Room as EssentialsHuddleVtc1Room).PowerOnToDefaultOrLastSource);
|
FusionRoom.SystemPowerOn.OutputSig.SetSigFalseAction((Room as EssentialsHuddleVtc1Room).PowerOnToDefaultOrLastSource);
|
||||||
FusionRoom.SystemPowerOff.OutputSig.SetSigFalseAction(() => (Room as EssentialsHuddleVtc1Room).RunRouteAction("roomOff", Room.SourceListKey));
|
FusionRoom.SystemPowerOff.OutputSig.SetSigFalseAction(() => (Room as EssentialsHuddleVtc1Room).RunRouteAction("roomOff", Room.SourceListKey));
|
||||||
// NO!! room.RoomIsOn.LinkComplementInputSig(FusionRoom.SystemPowerOff.InputSig);
|
|
||||||
|
|
||||||
|
|
||||||
CrestronEnvironment.EthernetEventHandler += CrestronEnvironment_EthernetEventHandler;
|
CrestronEnvironment.EthernetEventHandler += CrestronEnvironment_EthernetEventHandler;
|
||||||
|
|
@ -197,9 +196,9 @@ namespace PepperDash.Essentials.Fusion
|
||||||
uint i = 1;
|
uint i = 1;
|
||||||
foreach (var kvp in setTopBoxes)
|
foreach (var kvp in setTopBoxes)
|
||||||
{
|
{
|
||||||
TryAddRouteActionSigs("Display 1 - Source TV " + i, 188 + i, kvp.Key, kvp.Value.SourceDevice);
|
TryAddRouteActionSigs(JoinMap.Display1DiscPlayerSourceStart.AttributeName + " " + i, JoinMap.Display1DiscPlayerSourceStart.JoinNumber + i, kvp.Key, kvp.Value.SourceDevice);
|
||||||
i++;
|
i++;
|
||||||
if (i > 5) // We only have five spots
|
if (i > JoinMap.Display1SetTopBoxSourceStart.JoinSpan) // We only have five spots
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -207,7 +206,7 @@ namespace PepperDash.Essentials.Fusion
|
||||||
i = 1;
|
i = 1;
|
||||||
foreach (var kvp in discPlayers)
|
foreach (var kvp in discPlayers)
|
||||||
{
|
{
|
||||||
TryAddRouteActionSigs("Display 1 - Source DVD " + i, 181 + i, kvp.Key, kvp.Value.SourceDevice);
|
TryAddRouteActionSigs(JoinMap.Display1DiscPlayerSourceStart.AttributeName + " " + i, JoinMap.Display1DiscPlayerSourceStart.JoinNumber + i, kvp.Key, kvp.Value.SourceDevice);
|
||||||
i++;
|
i++;
|
||||||
if (i > 5) // We only have five spots
|
if (i > 5) // We only have five spots
|
||||||
break;
|
break;
|
||||||
|
|
@ -217,9 +216,9 @@ namespace PepperDash.Essentials.Fusion
|
||||||
i = 1;
|
i = 1;
|
||||||
foreach (var kvp in laptops)
|
foreach (var kvp in laptops)
|
||||||
{
|
{
|
||||||
TryAddRouteActionSigs("Display 1 - Source Laptop " + i, 166 + i, kvp.Key, kvp.Value.SourceDevice);
|
TryAddRouteActionSigs(JoinMap.Display1LaptopSourceStart.AttributeName + " " + i, JoinMap.Display1LaptopSourceStart.JoinNumber + i, kvp.Key, kvp.Value.SourceDevice);
|
||||||
i++;
|
i++;
|
||||||
if (i > 10) // We only have ten spots???
|
if (i > JoinMap.Display1LaptopSourceStart.JoinSpan) // We only have ten spots???
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -283,7 +282,7 @@ namespace PepperDash.Essentials.Fusion
|
||||||
if (defaultDisplay is IDisplayUsage)
|
if (defaultDisplay is IDisplayUsage)
|
||||||
(defaultDisplay as IDisplayUsage).LampHours.LinkInputSig(FusionRoom.DisplayUsage.InputSig);
|
(defaultDisplay as IDisplayUsage).LampHours.LinkInputSig(FusionRoom.DisplayUsage.InputSig);
|
||||||
|
|
||||||
MapDisplayToRoomJoins(1, 158, defaultDisplay);
|
MapDisplayToRoomJoins(1, JoinMap.Display1Start.JoinNumber, defaultDisplay);
|
||||||
|
|
||||||
var deviceConfig = ConfigReader.ConfigObject.Devices.FirstOrDefault(d => d.Key.Equals(defaultDisplay.Key));
|
var deviceConfig = ConfigReader.ConfigObject.Devices.FirstOrDefault(d => d.Key.Equals(defaultDisplay.Key));
|
||||||
|
|
||||||
|
|
@ -328,7 +327,7 @@ namespace PepperDash.Essentials.Fusion
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void MapDisplayToRoomJoins(int displayIndex, int joinOffset, DisplayBase display)
|
protected override void MapDisplayToRoomJoins(int displayIndex, uint joinOffset, DisplayBase display)
|
||||||
{
|
{
|
||||||
string displayName = string.Format("Display {0} - ", displayIndex);
|
string displayName = string.Format("Display {0} - ", displayIndex);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,98 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using Crestron.SimplSharp;
|
||||||
|
|
||||||
|
using PepperDash.Core;
|
||||||
|
using PepperDash.Essentials.Core;
|
||||||
|
using PepperDash.Essentials.Core.Config;
|
||||||
|
using PepperDash.Essentials.Core.Fusion;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Fusion
|
||||||
|
{
|
||||||
|
public class EssentialsTechRoomFusionSystemController : EssentialsHuddleSpaceFusionSystemControllerBase
|
||||||
|
{
|
||||||
|
public EssentialsTechRoomFusionSystemController(EssentialsTechRoom room, uint ipId, string joinMapKey)
|
||||||
|
: base(room, ipId, joinMapKey)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void SetUpDisplay()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
|
||||||
|
var displays = (Room as EssentialsTechRoom).Displays;
|
||||||
|
|
||||||
|
Debug.Console(1, this, "Setting up Static Assets for {0} Displays", displays.Count);
|
||||||
|
|
||||||
|
foreach (var display in displays.Values.Cast<DisplayBase>())
|
||||||
|
{
|
||||||
|
Debug.Console(2, this, "Setting up Static Asset for {0}", display.Key);
|
||||||
|
|
||||||
|
display.UsageTracker = new UsageTracking(display) { UsageIsTracked = true };
|
||||||
|
display.UsageTracker.DeviceUsageEnded += UsageTracker_DeviceUsageEnded;
|
||||||
|
|
||||||
|
var dispPowerOnAction = new Action<bool>(b =>
|
||||||
|
{
|
||||||
|
if (!b)
|
||||||
|
{
|
||||||
|
display.PowerOn();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
var dispPowerOffAction = new Action<bool>(b =>
|
||||||
|
{
|
||||||
|
if (!b)
|
||||||
|
{
|
||||||
|
display.PowerOff();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
var deviceConfig = ConfigReader.ConfigObject.GetDeviceForKey(display.Key);
|
||||||
|
|
||||||
|
FusionAsset tempAsset;
|
||||||
|
|
||||||
|
if (FusionStaticAssets.ContainsKey(deviceConfig.Uid))
|
||||||
|
{
|
||||||
|
// Used existing asset
|
||||||
|
tempAsset = FusionStaticAssets[deviceConfig.Uid];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Create a new asset
|
||||||
|
tempAsset = new FusionAsset(FusionRoomGuids.GetNextAvailableAssetNumber(FusionRoom),
|
||||||
|
display.Name, "Display", "");
|
||||||
|
FusionStaticAssets.Add(deviceConfig.Uid, tempAsset);
|
||||||
|
}
|
||||||
|
|
||||||
|
var dispAsset = FusionRoom.CreateStaticAsset(tempAsset.SlotNumber, tempAsset.Name, "Display",
|
||||||
|
tempAsset.InstanceId);
|
||||||
|
dispAsset.PowerOn.OutputSig.UserObject = dispPowerOnAction;
|
||||||
|
dispAsset.PowerOff.OutputSig.UserObject = dispPowerOffAction;
|
||||||
|
|
||||||
|
var defaultTwoWayDisplay = display as IHasPowerControlWithFeedback;
|
||||||
|
if (defaultTwoWayDisplay != null)
|
||||||
|
{
|
||||||
|
defaultTwoWayDisplay.PowerIsOnFeedback.LinkInputSig(FusionRoom.DisplayPowerOn.InputSig);
|
||||||
|
if (display is IDisplayUsage)
|
||||||
|
{
|
||||||
|
(display as IDisplayUsage).LampHours.LinkInputSig(FusionRoom.DisplayUsage.InputSig);
|
||||||
|
}
|
||||||
|
|
||||||
|
defaultTwoWayDisplay.PowerIsOnFeedback.LinkInputSig(dispAsset.PowerOn.InputSig);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Use extension methods
|
||||||
|
dispAsset.TrySetMakeModel(display);
|
||||||
|
dispAsset.TryLinkAssetErrorToCommunication(display);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Debug.Console(1, this, "Error setting up displays in Fusion: {0}", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -133,6 +133,7 @@
|
||||||
<Compile Include="Devices\Amplifier.cs" />
|
<Compile Include="Devices\Amplifier.cs" />
|
||||||
<Compile Include="ControlSystem.cs" />
|
<Compile Include="ControlSystem.cs" />
|
||||||
<Compile Include="Fusion\EssentialsHuddleVtc1FusionController.cs" />
|
<Compile Include="Fusion\EssentialsHuddleVtc1FusionController.cs" />
|
||||||
|
<Compile Include="Fusion\EssentialsTechRoomFusionSystemController.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
<Compile Include="Room\Config\EssentialsDualDisplayRoomPropertiesConfig.cs" />
|
<Compile Include="Room\Config\EssentialsDualDisplayRoomPropertiesConfig.cs" />
|
||||||
<Compile Include="Room\Config\EssentialsNDisplayRoomPropertiesConfig.cs" />
|
<Compile Include="Room\Config\EssentialsNDisplayRoomPropertiesConfig.cs" />
|
||||||
|
|
@ -141,11 +142,13 @@
|
||||||
<Compile Include="Room\Config\EssentialsHuddleRoomPropertiesConfig.cs" />
|
<Compile Include="Room\Config\EssentialsHuddleRoomPropertiesConfig.cs" />
|
||||||
<Compile Include="Room\Config\EssentialsHuddleVtc1PropertiesConfig.cs" />
|
<Compile Include="Room\Config\EssentialsHuddleVtc1PropertiesConfig.cs" />
|
||||||
<Compile Include="Room\Config\EssentialsRoomEmergencyConfig.cs" />
|
<Compile Include="Room\Config\EssentialsRoomEmergencyConfig.cs" />
|
||||||
|
<Compile Include="Room\Config\EssentialsTechRoomConfig.cs" />
|
||||||
<Compile Include="Room\Emergency\EsentialsRoomEmergencyContactClosure.cs" />
|
<Compile Include="Room\Emergency\EsentialsRoomEmergencyContactClosure.cs" />
|
||||||
<Compile Include="Room\Types\EssentialsDualDisplayRoom.cs" />
|
<Compile Include="Room\Types\EssentialsDualDisplayRoom.cs" />
|
||||||
<Compile Include="Room\Types\EssentialsHuddleVtc1Room.cs" />
|
<Compile Include="Room\Types\EssentialsHuddleVtc1Room.cs" />
|
||||||
<Compile Include="Room\Types\EssentialsNDisplayRoomBase.cs" />
|
<Compile Include="Room\Types\EssentialsNDisplayRoomBase.cs" />
|
||||||
<Compile Include="Room\Config\EssentialsRoomConfig.cs" />
|
<Compile Include="Room\Config\EssentialsRoomConfig.cs" />
|
||||||
|
<Compile Include="Room\Types\EssentialsTechRoom.cs" />
|
||||||
<Compile Include="UIDrivers\Environment Drivers\EssentialsEnvironmentDriver.cs" />
|
<Compile Include="UIDrivers\Environment Drivers\EssentialsEnvironmentDriver.cs" />
|
||||||
<Compile Include="UIDrivers\Environment Drivers\EssentialsLightingDriver.cs" />
|
<Compile Include="UIDrivers\Environment Drivers\EssentialsLightingDriver.cs" />
|
||||||
<Compile Include="UIDrivers\Environment Drivers\EssentialsShadeDriver.cs" />
|
<Compile Include="UIDrivers\Environment Drivers\EssentialsShadeDriver.cs" />
|
||||||
|
|
|
||||||
|
|
@ -22,30 +22,25 @@ namespace PepperDash.Essentials.Room.Config
|
||||||
public static Device GetRoomObject(DeviceConfig roomConfig)
|
public static Device GetRoomObject(DeviceConfig roomConfig)
|
||||||
{
|
{
|
||||||
var typeName = roomConfig.Type.ToLower();
|
var typeName = roomConfig.Type.ToLower();
|
||||||
|
|
||||||
if (typeName == "huddle")
|
if (typeName == "huddle")
|
||||||
{
|
{
|
||||||
var huddle = new EssentialsHuddleSpaceRoom(roomConfig);
|
return new EssentialsHuddleSpaceRoom(roomConfig);
|
||||||
|
|
||||||
return huddle;
|
|
||||||
}
|
}
|
||||||
else if (typeName == "huddlevtc1")
|
if (typeName == "huddlevtc1")
|
||||||
{
|
{
|
||||||
var rm = new EssentialsHuddleVtc1Room(roomConfig);
|
return new EssentialsHuddleVtc1Room(roomConfig);
|
||||||
|
|
||||||
return rm;
|
|
||||||
}
|
}
|
||||||
else if (typeName == "ddvc01Bridge")
|
if (typeName == "ddvc01bridge")
|
||||||
{
|
{
|
||||||
return new Device(roomConfig.Key, roomConfig.Name); // placeholder device that does nothing.
|
return new Device(roomConfig.Key, roomConfig.Name); // placeholder device that does nothing.
|
||||||
}
|
}
|
||||||
else if (typeName == "dualdisplay")
|
if (typeName == "dualdisplay")
|
||||||
{
|
{
|
||||||
var rm = new EssentialsDualDisplayRoom(roomConfig);
|
return new EssentialsDualDisplayRoom(roomConfig);
|
||||||
|
|
||||||
return rm;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return typeName != "techroom" ? null : new EssentialsTechRoom(roomConfig);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -182,6 +177,9 @@ namespace PepperDash.Essentials.Room.Config
|
||||||
[JsonProperty("volumes")]
|
[JsonProperty("volumes")]
|
||||||
public EssentialsRoomVolumesConfig Volumes { get; set; }
|
public EssentialsRoomVolumesConfig Volumes { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("fusion")]
|
||||||
|
public EssentialsRoomFusionConfig Fusion { get; set; }
|
||||||
|
|
||||||
[JsonProperty("zeroVolumeWhenSwtichingVolumeDevices")]
|
[JsonProperty("zeroVolumeWhenSwtichingVolumeDevices")]
|
||||||
public bool ZeroVolumeWhenSwtichingVolumeDevices { get; set; }
|
public bool ZeroVolumeWhenSwtichingVolumeDevices { get; set; }
|
||||||
|
|
||||||
|
|
@ -225,6 +223,32 @@ namespace PepperDash.Essentials.Room.Config
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class EssentialsRoomFusionConfig
|
||||||
|
{
|
||||||
|
public uint IpIdInt
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
return Convert.ToUInt32(IpId, 16);
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
throw new FormatException(string.Format("ERROR:Unable to convert IP ID: {0} to hex. Error:\n{1}", IpId));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[JsonProperty("ipId")]
|
||||||
|
public string IpId { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("joinMapKey")]
|
||||||
|
public string JoinMapKey { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public class EssentialsRoomMicrophonePrivacyConfig
|
public class EssentialsRoomMicrophonePrivacyConfig
|
||||||
{
|
{
|
||||||
[JsonProperty("deviceKey")]
|
[JsonProperty("deviceKey")]
|
||||||
|
|
|
||||||
40
PepperDashEssentials/Room/Config/EssentialsTechRoomConfig.cs
Normal file
40
PepperDashEssentials/Room/Config/EssentialsTechRoomConfig.cs
Normal file
|
|
@ -0,0 +1,40 @@
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Room.Config
|
||||||
|
{
|
||||||
|
public class EssentialsTechRoomConfig
|
||||||
|
{
|
||||||
|
[JsonProperty("dummySourceKey")]
|
||||||
|
public string DummySourceKey { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("displays")]
|
||||||
|
public List<string> Displays;
|
||||||
|
|
||||||
|
[JsonProperty("tuners")]
|
||||||
|
public List<string> Tuners;
|
||||||
|
|
||||||
|
[JsonProperty("userPin")]
|
||||||
|
public string UserPin;
|
||||||
|
|
||||||
|
[JsonProperty("techPin")]
|
||||||
|
public string TechPin;
|
||||||
|
|
||||||
|
[JsonProperty("presetsFileName")]
|
||||||
|
public string PresetsFileName;
|
||||||
|
|
||||||
|
[JsonProperty("scheduledEvents")]
|
||||||
|
public List<ScheduledEventConfig> ScheduledEvents;
|
||||||
|
|
||||||
|
[JsonProperty("isPrimary")] public bool IsPrimary;
|
||||||
|
|
||||||
|
[JsonProperty("isTvPresetsProvider")] public bool IsTvPresetsProvider;
|
||||||
|
|
||||||
|
public EssentialsTechRoomConfig()
|
||||||
|
{
|
||||||
|
Displays = new List<string>();
|
||||||
|
Tuners = new List<string>();
|
||||||
|
ScheduledEvents = new List<ScheduledEventConfig>();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
473
PepperDashEssentials/Room/Types/EssentialsTechRoom.cs
Normal file
473
PepperDashEssentials/Room/Types/EssentialsTechRoom.cs
Normal file
|
|
@ -0,0 +1,473 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using Crestron.SimplSharp;
|
||||||
|
using Crestron.SimplSharp.Scheduler;
|
||||||
|
using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using PepperDash.Core;
|
||||||
|
using PepperDash.Essentials.Core;
|
||||||
|
using PepperDash.Essentials.Core.Bridges;
|
||||||
|
using PepperDash.Essentials.Core.Config;
|
||||||
|
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
|
||||||
|
using PepperDash.Essentials.Core.Presets;
|
||||||
|
using PepperDash.Essentials.Devices.Common;
|
||||||
|
using PepperDash.Essentials.Room.Config;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials
|
||||||
|
{
|
||||||
|
public class EssentialsTechRoom : EssentialsRoomBase, ITvPresetsProvider, IBridgeAdvanced, IRunDirectRouteAction
|
||||||
|
{
|
||||||
|
private readonly EssentialsTechRoomConfig _config;
|
||||||
|
private readonly Dictionary<string, TwoWayDisplayBase> _displays;
|
||||||
|
|
||||||
|
private readonly DevicePresetsModel _tunerPresets;
|
||||||
|
private readonly Dictionary<string, IRSetTopBoxBase> _tuners;
|
||||||
|
|
||||||
|
private Dictionary<string, string> _currentPresets;
|
||||||
|
private ScheduledEventGroup _roomScheduledEventGroup;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
protected override Func<bool> IsWarmingFeedbackFunc
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return () =>
|
||||||
|
{
|
||||||
|
return _displays.All(kv => kv.Value.IsWarmingUpFeedback.BoolValue);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
protected override Func<bool> IsCoolingFeedbackFunc
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return () =>
|
||||||
|
{
|
||||||
|
return _displays.All(kv => kv.Value.IsCoolingDownFeedback.BoolValue);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public EssentialsTechRoom(DeviceConfig config) : base(config)
|
||||||
|
{
|
||||||
|
_config = config.Properties.ToObject<EssentialsTechRoomConfig>();
|
||||||
|
|
||||||
|
_tunerPresets = new DevicePresetsModel(String.Format("{0}-presets", config.Key), _config.PresetsFileName);
|
||||||
|
|
||||||
|
_tunerPresets.SetFileName(_config.PresetsFileName);
|
||||||
|
|
||||||
|
_tunerPresets.PresetRecalled += TunerPresetsOnPresetRecalled;
|
||||||
|
|
||||||
|
_tuners = GetDevices<IRSetTopBoxBase>(_config.Tuners);
|
||||||
|
_displays = GetDevices<TwoWayDisplayBase>(_config.Displays);
|
||||||
|
|
||||||
|
RoomPowerIsOnFeedback = new BoolFeedback(() => RoomPowerIsOn);
|
||||||
|
|
||||||
|
SetUpTunerPresetsFeedback();
|
||||||
|
|
||||||
|
SubscribeToDisplayFeedbacks();
|
||||||
|
|
||||||
|
CreateOrUpdateScheduledEvents();
|
||||||
|
}
|
||||||
|
|
||||||
|
public Dictionary<string, StringFeedback> CurrentPresetsFeedbacks { get; private set; }
|
||||||
|
|
||||||
|
public Dictionary<string, IRSetTopBoxBase> Tuners
|
||||||
|
{
|
||||||
|
get { return _tuners; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public Dictionary<string, TwoWayDisplayBase> Displays
|
||||||
|
{
|
||||||
|
get { return _displays; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public BoolFeedback RoomPowerIsOnFeedback { get; private set; }
|
||||||
|
|
||||||
|
public bool RoomPowerIsOn
|
||||||
|
{
|
||||||
|
get { return _displays.All(kv => kv.Value.PowerIsOnFeedback.BoolValue); }
|
||||||
|
}
|
||||||
|
|
||||||
|
#region ITvPresetsProvider Members
|
||||||
|
|
||||||
|
public DevicePresetsModel TvPresets
|
||||||
|
{
|
||||||
|
get { return _tunerPresets; }
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private void TunerPresetsOnPresetRecalled(ISetTopBoxNumericKeypad device, string channel)
|
||||||
|
{
|
||||||
|
if (!_currentPresets.ContainsKey(device.Key))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
_currentPresets[device.Key] = channel;
|
||||||
|
|
||||||
|
if (!CurrentPresetsFeedbacks.ContainsKey(device.Key))
|
||||||
|
{
|
||||||
|
CurrentPresetsFeedbacks[device.Key].FireUpdate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SetUpTunerPresetsFeedback()
|
||||||
|
{
|
||||||
|
_currentPresets = new Dictionary<string, string>();
|
||||||
|
CurrentPresetsFeedbacks = new Dictionary<string, StringFeedback>();
|
||||||
|
|
||||||
|
foreach (var setTopBox in _tuners)
|
||||||
|
{
|
||||||
|
var tuner = setTopBox.Value;
|
||||||
|
_currentPresets.Add(tuner.Key, String.Empty);
|
||||||
|
CurrentPresetsFeedbacks.Add(tuner.Key, new StringFeedback(() => _currentPresets[tuner.Key]));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SubscribeToDisplayFeedbacks()
|
||||||
|
{
|
||||||
|
foreach (var display in _displays)
|
||||||
|
{
|
||||||
|
display.Value.PowerIsOnFeedback.OutputChange +=
|
||||||
|
(sender, args) =>
|
||||||
|
{
|
||||||
|
RoomPowerIsOnFeedback.InvokeFireUpdate();
|
||||||
|
IsWarmingUpFeedback.InvokeFireUpdate();
|
||||||
|
IsCoolingDownFeedback.InvokeFireUpdate();
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void CreateOrUpdateScheduledEvents()
|
||||||
|
{
|
||||||
|
var eventsConfig = _config.ScheduledEvents;
|
||||||
|
|
||||||
|
GetOrCreateScheduleGroup();
|
||||||
|
|
||||||
|
foreach (var eventConfig in eventsConfig)
|
||||||
|
{
|
||||||
|
CreateOrUpdateSingleEvent(eventConfig);
|
||||||
|
}
|
||||||
|
|
||||||
|
_roomScheduledEventGroup.UserGroupCallBack += HandleScheduledEvent;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void GetOrCreateScheduleGroup()
|
||||||
|
{
|
||||||
|
if (_roomScheduledEventGroup == null)
|
||||||
|
{
|
||||||
|
_roomScheduledEventGroup = Scheduler.GetEventGroup(Key) ?? new ScheduledEventGroup(Key);
|
||||||
|
|
||||||
|
Scheduler.AddEventGroup(_roomScheduledEventGroup);
|
||||||
|
}
|
||||||
|
|
||||||
|
_roomScheduledEventGroup.RetrieveAllEvents();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void CreateOrUpdateSingleEvent(ScheduledEventConfig scheduledEvent)
|
||||||
|
{
|
||||||
|
if (!_roomScheduledEventGroup.ScheduledEvents.ContainsKey(scheduledEvent.Key))
|
||||||
|
{
|
||||||
|
SchedulerUtilities.CreateEventFromConfig(scheduledEvent, _roomScheduledEventGroup, HandleScheduledEvent);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var roomEvent = _roomScheduledEventGroup.ScheduledEvents[scheduledEvent.Key];
|
||||||
|
|
||||||
|
if (!SchedulerUtilities.CheckEventTimeForMatch(roomEvent, DateTime.Parse(scheduledEvent.Time)) &&
|
||||||
|
!SchedulerUtilities.CheckEventRecurrenceForMatch(roomEvent, scheduledEvent.Days))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Debug.Console(1, this,
|
||||||
|
"Existing event does not match new config properties. Deleting existing event '{0}' and creating new event from configuration",
|
||||||
|
roomEvent.Name);
|
||||||
|
|
||||||
|
_roomScheduledEventGroup.DeleteEvent(roomEvent);
|
||||||
|
|
||||||
|
SchedulerUtilities.CreateEventFromConfig(scheduledEvent, _roomScheduledEventGroup, HandleScheduledEvent);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void AddOrUpdateScheduledEvent(ScheduledEventConfig scheduledEvent)
|
||||||
|
{
|
||||||
|
//update config based on key of scheduleEvent
|
||||||
|
GetOrCreateScheduleGroup();
|
||||||
|
var existingEventIndex = _config.ScheduledEvents.FindIndex((e) => e.Key == scheduledEvent.Key);
|
||||||
|
|
||||||
|
if (existingEventIndex < 0)
|
||||||
|
{
|
||||||
|
_config.ScheduledEvents.Add(scheduledEvent);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_config.ScheduledEvents[existingEventIndex] = scheduledEvent;
|
||||||
|
}
|
||||||
|
|
||||||
|
//create or update event based on config
|
||||||
|
CreateOrUpdateSingleEvent(scheduledEvent);
|
||||||
|
//save config
|
||||||
|
Config.Properties = JToken.FromObject(_config);
|
||||||
|
|
||||||
|
CustomSetConfig(Config);
|
||||||
|
//Fire Event
|
||||||
|
OnScheduledEventUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<ScheduledEventConfig> GetScheduledEvents()
|
||||||
|
{
|
||||||
|
return _config.ScheduledEvents ?? new List<ScheduledEventConfig>();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnScheduledEventUpdate()
|
||||||
|
{
|
||||||
|
var handler = ScheduledEventsChanged;
|
||||||
|
|
||||||
|
if (handler == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
handler(this, new ScheduledEventEventArgs {ScheduledEvents = _config.ScheduledEvents});
|
||||||
|
}
|
||||||
|
|
||||||
|
public event EventHandler<ScheduledEventEventArgs> ScheduledEventsChanged;
|
||||||
|
|
||||||
|
private void HandleScheduledEvent(ScheduledEvent schevent, ScheduledEventCommon.eCallbackReason type)
|
||||||
|
{
|
||||||
|
var eventConfig = _config.ScheduledEvents.FirstOrDefault(e => e.Key == schevent.Name);
|
||||||
|
|
||||||
|
if (eventConfig == null)
|
||||||
|
{
|
||||||
|
Debug.Console(1, this, "Event with name {0} not found", schevent.Name);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Debug.Console(1, this, "Running actions for event {0}", schevent.Name);
|
||||||
|
|
||||||
|
if (eventConfig.Acknowledgeable)
|
||||||
|
{
|
||||||
|
schevent.Acknowledge();
|
||||||
|
}
|
||||||
|
|
||||||
|
CrestronInvoke.BeginInvoke((o) =>
|
||||||
|
{
|
||||||
|
Debug.Console(2, this, "There are {0} actions to execute for this event.", eventConfig.Actions.Count);
|
||||||
|
|
||||||
|
foreach (var a in eventConfig.Actions)
|
||||||
|
{
|
||||||
|
Debug.Console(2, this,
|
||||||
|
@"Attempting to run action:
|
||||||
|
DeviceKey: {0}
|
||||||
|
MethodName: {1}
|
||||||
|
Params: {2}"
|
||||||
|
, a.DeviceKey, a.MethodName, a.Params);
|
||||||
|
DeviceJsonApi.DoDeviceAction(a);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void RoomPowerOn()
|
||||||
|
{
|
||||||
|
Debug.Console(2, this, "Room Powering On");
|
||||||
|
|
||||||
|
var dummySource = DeviceManager.GetDeviceForKey(_config.DummySourceKey) as IRoutingOutputs;
|
||||||
|
|
||||||
|
if (dummySource == null)
|
||||||
|
{
|
||||||
|
Debug.Console(1, this, "Unable to get source with key: {0}", _config.DummySourceKey);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (var display in _displays)
|
||||||
|
{
|
||||||
|
RunDirectRoute(dummySource, display.Value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void RoomPowerOff()
|
||||||
|
{
|
||||||
|
Debug.Console(2, this, "Room Powering Off");
|
||||||
|
|
||||||
|
foreach (var display in _displays)
|
||||||
|
{
|
||||||
|
display.Value.PowerOff();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private Dictionary<string, T> GetDevices<T>(ICollection<string> config) where T : IKeyed
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var returnValue = DeviceManager.AllDevices.OfType<T>()
|
||||||
|
.Where(d => config.Contains(d.Key))
|
||||||
|
.ToDictionary(d => d.Key, d => d);
|
||||||
|
|
||||||
|
return returnValue;
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
Debug.Console(0, this, Debug.ErrorLogLevel.Error,
|
||||||
|
"Error getting devices. Check Essentials Configuration");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Overrides of EssentialsRoomBase
|
||||||
|
|
||||||
|
protected override Func<bool> OnFeedbackFunc
|
||||||
|
{
|
||||||
|
get { return () => RoomPowerIsOn; }
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void EndShutdown()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void SetDefaultLevels()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void PowerOnToDefaultOrLastSource()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public override bool RunDefaultPresentRoute()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void RoomVacatedForTimeoutPeriod(object o)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Implementation of IBridgeAdvanced
|
||||||
|
|
||||||
|
public void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
||||||
|
{
|
||||||
|
|
||||||
|
var joinMap = new EssentialsTechRoomJoinMap(joinStart);
|
||||||
|
var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
|
||||||
|
|
||||||
|
if (!String.IsNullOrEmpty(joinMapSerialized))
|
||||||
|
{
|
||||||
|
joinMap = JsonConvert.DeserializeObject<EssentialsTechRoomJoinMap>(joinMapSerialized);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (bridge != null)
|
||||||
|
{
|
||||||
|
bridge.AddJoinMap(Key, joinMap);
|
||||||
|
}
|
||||||
|
uint i;
|
||||||
|
if (_config.IsPrimary)
|
||||||
|
{
|
||||||
|
i = 0;
|
||||||
|
foreach (var feedback in CurrentPresetsFeedbacks)
|
||||||
|
{
|
||||||
|
feedback.Value.LinkInputSig(trilist.StringInput[(uint) (joinMap.CurrentPreset.JoinNumber + i)]);
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
trilist.OnlineStatusChange += (device, args) =>
|
||||||
|
{
|
||||||
|
if (!args.DeviceOnLine)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (var feedback in CurrentPresetsFeedbacks)
|
||||||
|
{
|
||||||
|
feedback.Value.FireUpdate();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
i = 0;
|
||||||
|
foreach (var setTopBox in _tuners)
|
||||||
|
{
|
||||||
|
var tuner = setTopBox;
|
||||||
|
|
||||||
|
trilist.SetStringSigAction(joinMap.CurrentPreset.JoinNumber + i, s => _tunerPresets.Dial(s, tuner.Value));
|
||||||
|
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private class EssentialsTechRoomJoinMap : JoinMapBaseAdvanced
|
||||||
|
{
|
||||||
|
[JoinName("currentPreset")]
|
||||||
|
public JoinDataComplete CurrentPreset = new JoinDataComplete(new JoinData {JoinNumber = 1, JoinSpan = 16},
|
||||||
|
new JoinMetadata {Description = "Current Tuner Preset", JoinType = eJoinType.Serial});
|
||||||
|
|
||||||
|
public EssentialsTechRoomJoinMap(uint joinStart) : base(joinStart, typeof(EssentialsTechRoomJoinMap))
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#region IRunDirectRouteAction Members
|
||||||
|
|
||||||
|
private void RunDirectRoute(IRoutingOutputs source, IRoutingSink dest)
|
||||||
|
{
|
||||||
|
if (dest == null)
|
||||||
|
{
|
||||||
|
Debug.Console(1, this, "Cannot route, unknown destination '{0}'", dest.Key);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (source == null)
|
||||||
|
{
|
||||||
|
dest.ReleaseRoute();
|
||||||
|
if (dest is IHasPowerControl)
|
||||||
|
(dest as IHasPowerControl).PowerOff();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dest.ReleaseAndMakeRoute(source, eRoutingSignalType.Video);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Attempts to route directly between a source and destination
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sourceKey"></param>
|
||||||
|
/// <param name="destinationKey"></param>
|
||||||
|
public void RunDirectRoute(string sourceKey, string destinationKey)
|
||||||
|
{
|
||||||
|
IRoutingSink dest = null;
|
||||||
|
|
||||||
|
dest = DeviceManager.GetDeviceForKey(destinationKey) as IRoutingSink;
|
||||||
|
|
||||||
|
var source = DeviceManager.GetDeviceForKey(sourceKey) as IRoutingOutputs;
|
||||||
|
|
||||||
|
if (source == null || dest == null)
|
||||||
|
{
|
||||||
|
Debug.Console(1, this, "Cannot route unknown source or destination '{0}' to {1}", sourceKey, destinationKey);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
RunDirectRoute(source, dest);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ScheduledEventEventArgs : EventArgs
|
||||||
|
{
|
||||||
|
public List<ScheduledEventConfig> ScheduledEvents;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -78,7 +78,7 @@ namespace PepperDash.Essentials.Core.Bridges
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Bridge API using EISC
|
/// Bridge API using EISC
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class EiscApiAdvanced : BridgeApi
|
public class EiscApiAdvanced : BridgeApi, ICommunicationMonitor
|
||||||
{
|
{
|
||||||
public EiscApiPropertiesConfig PropertiesConfig { get; private set; }
|
public EiscApiPropertiesConfig PropertiesConfig { get; private set; }
|
||||||
|
|
||||||
|
|
@ -98,13 +98,35 @@ namespace PepperDash.Essentials.Core.Bridges
|
||||||
|
|
||||||
Eisc.SigChange += Eisc_SigChange;
|
Eisc.SigChange += Eisc_SigChange;
|
||||||
|
|
||||||
|
CommunicationMonitor = new CrestronGenericBaseCommunicationMonitor(this, Eisc, 120000, 300000);
|
||||||
|
|
||||||
AddPostActivationAction(LinkDevices);
|
AddPostActivationAction(LinkDevices);
|
||||||
|
AddPostActivationAction(LinkRooms);
|
||||||
|
AddPostActivationAction(RegisterEisc);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override bool CustomActivate()
|
||||||
|
{
|
||||||
|
CommunicationMonitor.Start();
|
||||||
|
return base.CustomActivate();
|
||||||
|
}
|
||||||
|
|
||||||
|
public override bool Deactivate()
|
||||||
|
{
|
||||||
|
CommunicationMonitor.Stop();
|
||||||
|
return base.Deactivate();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void LinkDevices()
|
private void LinkDevices()
|
||||||
{
|
{
|
||||||
Debug.Console(1, this, "Linking Devices...");
|
Debug.Console(1, this, "Linking Devices...");
|
||||||
|
|
||||||
|
if (PropertiesConfig.Devices == null)
|
||||||
|
{
|
||||||
|
Debug.Console(1, this, Debug.ErrorLogLevel.Notice, "No devices linked to this bridge");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
foreach (var d in PropertiesConfig.Devices)
|
foreach (var d in PropertiesConfig.Devices)
|
||||||
{
|
{
|
||||||
var device = DeviceManager.GetDeviceForKey(d.DeviceKey);
|
var device = DeviceManager.GetDeviceForKey(d.DeviceKey);
|
||||||
|
|
@ -130,6 +152,14 @@ namespace PepperDash.Essentials.Core.Bridges
|
||||||
bridge.LinkToApi(Eisc, d.JoinStart, d.JoinMapKey, this);
|
bridge.LinkToApi(Eisc, d.JoinStart, d.JoinMapKey, this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void RegisterEisc()
|
||||||
|
{
|
||||||
|
if (Eisc.Registered)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var registerResult = Eisc.Register();
|
var registerResult = Eisc.Register();
|
||||||
|
|
||||||
|
|
@ -142,6 +172,31 @@ namespace PepperDash.Essentials.Core.Bridges
|
||||||
Debug.Console(1, this, Debug.ErrorLogLevel.Notice, "EISC registration successful");
|
Debug.Console(1, this, Debug.ErrorLogLevel.Notice, "EISC registration successful");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void LinkRooms()
|
||||||
|
{
|
||||||
|
Debug.Console(1, this, "Linking Rooms...");
|
||||||
|
|
||||||
|
if (PropertiesConfig.Rooms == null)
|
||||||
|
{
|
||||||
|
Debug.Console(1, this, Debug.ErrorLogLevel.Notice, "No rooms linked to this bridge.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (var room in PropertiesConfig.Rooms)
|
||||||
|
{
|
||||||
|
var rm = DeviceManager.GetDeviceForKey(room.RoomKey) as IBridgeAdvanced;
|
||||||
|
|
||||||
|
if (rm == null)
|
||||||
|
{
|
||||||
|
Debug.Console(1, this, Debug.ErrorLogLevel.Notice,
|
||||||
|
"Room {0} does not implement IBridgeAdvanced. Skipping...", room.RoomKey);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
rm.LinkToApi(Eisc, room.JoinStart, room.JoinMapKey, this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Adds a join map
|
/// Adds a join map
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -280,6 +335,12 @@ namespace PepperDash.Essentials.Core.Bridges
|
||||||
Debug.Console(2, this, "Error in Eisc_SigChange handler: {0}", e);
|
Debug.Console(2, this, "Error in Eisc_SigChange handler: {0}", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#region Implementation of ICommunicationMonitor
|
||||||
|
|
||||||
|
public StatusMonitorBase CommunicationMonitor { get; private set; }
|
||||||
|
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
public class EiscApiPropertiesConfig
|
public class EiscApiPropertiesConfig
|
||||||
|
|
@ -290,6 +351,9 @@ namespace PepperDash.Essentials.Core.Bridges
|
||||||
[JsonProperty("devices")]
|
[JsonProperty("devices")]
|
||||||
public List<ApiDevicePropertiesConfig> Devices { get; set; }
|
public List<ApiDevicePropertiesConfig> Devices { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("rooms")]
|
||||||
|
public List<ApiRoomPropertiesConfig> Rooms { get; set; }
|
||||||
|
|
||||||
|
|
||||||
public class ApiDevicePropertiesConfig
|
public class ApiDevicePropertiesConfig
|
||||||
{
|
{
|
||||||
|
|
@ -303,6 +367,18 @@ namespace PepperDash.Essentials.Core.Bridges
|
||||||
public string JoinMapKey { get; set; }
|
public string JoinMapKey { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class ApiRoomPropertiesConfig
|
||||||
|
{
|
||||||
|
[JsonProperty("roomKey")]
|
||||||
|
public string RoomKey { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("joinStart")]
|
||||||
|
public uint JoinStart { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("joinMapKey")]
|
||||||
|
public string JoinMapKey { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class EiscApiAdvancedFactory : EssentialsDeviceFactory<EiscApiAdvanced>
|
public class EiscApiAdvancedFactory : EssentialsDeviceFactory<EiscApiAdvanced>
|
||||||
|
|
|
||||||
|
|
@ -76,6 +76,14 @@ namespace PepperDash.Essentials.Core.Bridges
|
||||||
public JoinDataComplete HdcpSupportCapability = new JoinDataComplete(new JoinData { JoinNumber = 1201, JoinSpan = 32 },
|
public JoinDataComplete HdcpSupportCapability = new JoinDataComplete(new JoinData { JoinNumber = 1201, JoinSpan = 32 },
|
||||||
new JoinMetadata { Description = "DM Chassis Input HDCP Support Capability", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Analog });
|
new JoinMetadata { Description = "DM Chassis Input HDCP Support Capability", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Analog });
|
||||||
|
|
||||||
|
[JoinName("InputStreamCardState")]
|
||||||
|
public JoinDataComplete InputStreamCardState = new JoinDataComplete(new JoinData { JoinNumber = 1501, JoinSpan = 32 },
|
||||||
|
new JoinMetadata { Description = "DM Chassis Stream Input Start (1), Stop (2), Pause (3) with Feedback", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Analog });
|
||||||
|
|
||||||
|
[JoinName("OutputStreamCardState")]
|
||||||
|
public JoinDataComplete OutputStreamCardState = new JoinDataComplete(new JoinData { JoinNumber = 1601, JoinSpan = 32 },
|
||||||
|
new JoinMetadata { Description = "DM Chassis Stream Output Start (1), Stop (2), Pause (3) with Feedback", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Analog });
|
||||||
|
|
||||||
[JoinName("InputNames")]
|
[JoinName("InputNames")]
|
||||||
public JoinDataComplete InputNames = new JoinDataComplete(new JoinData { JoinNumber = 101, JoinSpan = 32 },
|
public JoinDataComplete InputNames = new JoinDataComplete(new JoinData { JoinNumber = 101, JoinSpan = 32 },
|
||||||
new JoinMetadata { Description = "DM Chassis Input Name", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
|
new JoinMetadata { Description = "DM Chassis Input Name", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
|
||||||
|
|
|
||||||
|
|
@ -56,6 +56,11 @@ namespace PepperDash.Essentials.Core
|
||||||
|
|
||||||
private void RegisterAndConfigureComPort()
|
private void RegisterAndConfigureComPort()
|
||||||
{
|
{
|
||||||
|
if (Port == null)
|
||||||
|
{
|
||||||
|
Debug.Console(0,this,Debug.ErrorLogLevel.Error, "Configured com Port for this device does not exist.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (Port.Parent is CrestronControlSystem)
|
if (Port.Parent is CrestronControlSystem)
|
||||||
{
|
{
|
||||||
var result = Port.Register();
|
var result = Port.Register();
|
||||||
|
|
|
||||||
|
|
@ -104,7 +104,7 @@ namespace PepperDash.Essentials.Core
|
||||||
var dev = GetIComPortsDeviceFromManagedDevice(config.ControlPortDevKey);
|
var dev = GetIComPortsDeviceFromManagedDevice(config.ControlPortDevKey);
|
||||||
if (dev != null && config.ControlPortNumber <= dev.NumberOfComPorts)
|
if (dev != null && config.ControlPortNumber <= dev.NumberOfComPorts)
|
||||||
return dev.ComPorts[config.ControlPortNumber];
|
return dev.ComPorts[config.ControlPortNumber];
|
||||||
Debug.Console(0, "GetComPort: Device '{0}' does not have com port {1}", config.ControlPortDevKey, config.ControlPortNumber);
|
Debug.Console(0,Debug.ErrorLogLevel.Notice, "GetComPort: Device '{0}' does not have com port {1}", config.ControlPortDevKey, config.ControlPortNumber);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,8 @@ using Newtonsoft.Json;
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
|
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Core.Config
|
namespace PepperDash.Essentials.Core.Config
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -27,7 +29,7 @@ namespace PepperDash.Essentials.Core.Config
|
||||||
public List<TieLineConfig> TieLines { get; set; }
|
public List<TieLineConfig> TieLines { get; set; }
|
||||||
|
|
||||||
[JsonProperty("joinMaps")]
|
[JsonProperty("joinMaps")]
|
||||||
public Dictionary<string, string> JoinMaps { get; set; }
|
public Dictionary<string, JObject> 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
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
using Crestron.SimplSharpPro.DeviceSupport;
|
using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
using PepperDash.Essentials.Core.SmartObjects;
|
using PepperDash.Essentials.Core.SmartObjects;
|
||||||
|
|
||||||
|
|
@ -8,7 +8,7 @@ namespace PepperDash.Essentials.Core
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface INumericKeypad
|
public interface INumericKeypad:IKeyed
|
||||||
{
|
{
|
||||||
void Digit0(bool pressRelease);
|
void Digit0(bool pressRelease);
|
||||||
void Digit1(bool pressRelease);
|
void Digit1(bool pressRelease);
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
using PepperDash.Essentials.Core.Presets;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
|
||||||
|
{
|
||||||
|
public interface ITvPresetsProvider
|
||||||
|
{
|
||||||
|
DevicePresetsModel TvPresets { get; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -83,13 +83,13 @@ namespace PepperDash.Essentials.Core
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static object GetPropertyByName(string deviceObjectPath, string propertyName)
|
public static object GetPropertyByName(string deviceObjectPath, string propertyName)
|
||||||
{
|
{
|
||||||
var obj = FindObjectOnPath(deviceObjectPath);
|
var dev = FindObjectOnPath(deviceObjectPath);
|
||||||
if(obj == null)
|
if(dev == null)
|
||||||
return "{ \"error\":\"No Device\"}";
|
return "{ \"error\":\"No Device\"}";
|
||||||
|
|
||||||
CType t = obj.GetType();
|
object prop = dev.GetType().GetCType().GetProperty(propertyName).GetValue(dev, null);
|
||||||
|
|
||||||
var prop = t.GetProperty(propertyName);
|
// var prop = t.GetProperty(propertyName);
|
||||||
if (prop != null)
|
if (prop != null)
|
||||||
{
|
{
|
||||||
return prop;
|
return prop;
|
||||||
|
|
|
||||||
|
|
@ -361,8 +361,8 @@ namespace PepperDash.Essentials.Core
|
||||||
var device = GetDeviceForKey(s);
|
var device = GetDeviceForKey(s);
|
||||||
|
|
||||||
if (device == null) return;
|
if (device == null) return;
|
||||||
var inputPorts = (device as IRoutingInputsOutputs).InputPorts;
|
var inputPorts = ((device as IRoutingInputs) != null) ? (device as IRoutingInputs).InputPorts : null;
|
||||||
var outputPorts = (device as IRoutingInputsOutputs).OutputPorts;
|
var outputPorts = ((device as IRoutingOutputs) != null) ? (device as IRoutingOutputs).OutputPorts : null;
|
||||||
if (inputPorts != null)
|
if (inputPorts != null)
|
||||||
{
|
{
|
||||||
Debug.Console(0, "Device {0} has {1} Input Ports:", s, inputPorts.Count);
|
Debug.Console(0, "Device {0} has {1} Input Ports:", s, inputPorts.Count);
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,8 @@ namespace PepperDash.Essentials.Core
|
||||||
public IrOutputPortController IrPort { get; private set; }
|
public IrOutputPortController IrPort { get; private set; }
|
||||||
public ushort IrPulseTime { get; set; }
|
public ushort IrPulseTime { get; set; }
|
||||||
|
|
||||||
public BoolFeedback PowerIsOnFeedback { get; private set; }
|
[Obsolete("This property will be removed in version 2.0.0")]
|
||||||
|
public override BoolFeedback PowerIsOnFeedback { get; protected set; }
|
||||||
|
|
||||||
protected Func<bool> PowerIsOnFeedbackFunc
|
protected Func<bool> PowerIsOnFeedbackFunc
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ namespace PepperDash.Essentials.Core
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public abstract class DisplayBase : EssentialsDevice, IHasFeedback, IRoutingSinkWithSwitching, IHasPowerControl, IWarmingCooling, IUsageTracking
|
public abstract class DisplayBase : EssentialsDevice, IHasFeedback, IRoutingSinkWithSwitching, IHasPowerControl, IWarmingCooling, IUsageTracking, IPower
|
||||||
{
|
{
|
||||||
public event SourceInfoChangeHandler CurrentSourceChange;
|
public event SourceInfoChangeHandler CurrentSourceChange;
|
||||||
|
|
||||||
|
|
@ -49,6 +49,9 @@ namespace PepperDash.Essentials.Core
|
||||||
public BoolFeedback IsCoolingDownFeedback { get; protected set; }
|
public BoolFeedback IsCoolingDownFeedback { get; protected set; }
|
||||||
public BoolFeedback IsWarmingUpFeedback { get; private set; }
|
public BoolFeedback IsWarmingUpFeedback { get; private set; }
|
||||||
|
|
||||||
|
[Obsolete("This property will be removed in version 2.0.0")]
|
||||||
|
public abstract BoolFeedback PowerIsOnFeedback { get; protected set; }
|
||||||
|
|
||||||
public UsageTracking UsageTracker { get; set; }
|
public UsageTracking UsageTracker { get; set; }
|
||||||
|
|
||||||
public uint WarmupTime { get; set; }
|
public uint WarmupTime { get; set; }
|
||||||
|
|
@ -81,8 +84,6 @@ namespace PepperDash.Essentials.Core
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public abstract void PowerOn();
|
public abstract void PowerOn();
|
||||||
public abstract void PowerOff();
|
public abstract void PowerOff();
|
||||||
public abstract void PowerToggle();
|
public abstract void PowerToggle();
|
||||||
|
|
@ -261,7 +262,8 @@ namespace PepperDash.Essentials.Core
|
||||||
|
|
||||||
abstract protected Func<string> CurrentInputFeedbackFunc { get; }
|
abstract protected Func<string> CurrentInputFeedbackFunc { get; }
|
||||||
|
|
||||||
public BoolFeedback PowerIsOnFeedback { get; protected set; }
|
public override BoolFeedback PowerIsOnFeedback { get; protected set; }
|
||||||
|
|
||||||
abstract protected Func<bool> PowerIsOnFeedbackFunc { get; }
|
abstract protected Func<bool> PowerIsOnFeedbackFunc { get; }
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -315,7 +317,5 @@ namespace PepperDash.Essentials.Core
|
||||||
var newEvent = NumericSwitchChange;
|
var newEvent = NumericSwitchChange;
|
||||||
if (newEvent != null) newEvent(this, e);
|
if (newEvent != null) newEvent(this, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -0,0 +1,150 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using Crestron.SimplSharp;
|
||||||
|
|
||||||
|
using PepperDash.Essentials.Core.Bridges;
|
||||||
|
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Core.Fusion
|
||||||
|
{
|
||||||
|
public class EssentialsHuddleSpaceRoomFusionRoomJoinMap : JoinMapBaseAdvanced
|
||||||
|
{
|
||||||
|
|
||||||
|
// Processor Attributes
|
||||||
|
[JoinName("ProcessorIp1")]
|
||||||
|
public JoinDataComplete ProcessorIp1 = new JoinDataComplete(new JoinData { JoinNumber = 50, JoinSpan = 1, AttributeName = "Info - Processor - IP 1" },
|
||||||
|
new JoinMetadata { Description = "Info - Processor - IP 1", JoinCapabilities = eJoinCapabilities.ToFusion, JoinType = eJoinType.Serial });
|
||||||
|
|
||||||
|
[JoinName("ProcessorIp2")]
|
||||||
|
public JoinDataComplete ProcessorIp2 = new JoinDataComplete(new JoinData { JoinNumber = 51, JoinSpan = 1, AttributeName = "Info - Processor - IP 2" },
|
||||||
|
new JoinMetadata { Description = "Info - Processor - IP 2", JoinCapabilities = eJoinCapabilities.ToFusion, JoinType = eJoinType.Serial });
|
||||||
|
|
||||||
|
[JoinName("ProcessorGateway")]
|
||||||
|
public JoinDataComplete ProcessorGateway = new JoinDataComplete(new JoinData { JoinNumber = 52, JoinSpan = 1, AttributeName = "Info - Processor - Gateway" },
|
||||||
|
new JoinMetadata { Description = "Info - Processor - Gateway", JoinCapabilities = eJoinCapabilities.ToFusion, JoinType = eJoinType.Serial });
|
||||||
|
|
||||||
|
[JoinName("ProcessorHostname")]
|
||||||
|
public JoinDataComplete ProcessorHostname = new JoinDataComplete(new JoinData { JoinNumber = 53, JoinSpan = 1, AttributeName = "Info - Processor - Hostname" },
|
||||||
|
new JoinMetadata { Description = "Info - Processor - Hostname", JoinCapabilities = eJoinCapabilities.ToFusion, JoinType = eJoinType.Serial });
|
||||||
|
|
||||||
|
[JoinName("ProcessorDomain")]
|
||||||
|
public JoinDataComplete ProcessorDomain = new JoinDataComplete(new JoinData { JoinNumber = 54, JoinSpan = 1, AttributeName = "Info - Processor - Domain" },
|
||||||
|
new JoinMetadata { Description = "Info - Processor - Domain", JoinCapabilities = eJoinCapabilities.ToFusion, JoinType = eJoinType.Serial });
|
||||||
|
|
||||||
|
[JoinName("ProcessorDns1")]
|
||||||
|
public JoinDataComplete ProcessorDns1 = new JoinDataComplete(new JoinData { JoinNumber = 55, JoinSpan = 1, AttributeName = "Info - Processor - DNS 1" },
|
||||||
|
new JoinMetadata { Description = "Info - Processor - DNS 1", JoinCapabilities = eJoinCapabilities.ToFusion, JoinType = eJoinType.Serial });
|
||||||
|
|
||||||
|
[JoinName("ProcessorDns2")]
|
||||||
|
public JoinDataComplete ProcessorDns2 = new JoinDataComplete(new JoinData { JoinNumber = 56, JoinSpan = 1, AttributeName = "Info - Processor - DNS 2" },
|
||||||
|
new JoinMetadata { Description = "Info - Processor - DNS 2", JoinCapabilities = eJoinCapabilities.ToFusion, JoinType = eJoinType.Serial });
|
||||||
|
|
||||||
|
[JoinName("ProcessorMac1")]
|
||||||
|
public JoinDataComplete ProcessorMac1 = new JoinDataComplete(new JoinData { JoinNumber = 57, JoinSpan = 1, AttributeName = "Info - Processor - MAC 1" },
|
||||||
|
new JoinMetadata { Description = "Info - Processor - MAC 1", JoinCapabilities = eJoinCapabilities.ToFusion, JoinType = eJoinType.Serial });
|
||||||
|
|
||||||
|
[JoinName("ProcessorMac2")]
|
||||||
|
public JoinDataComplete ProcessorMac2 = new JoinDataComplete(new JoinData { JoinNumber = 58, JoinSpan = 1, AttributeName = "Info - Processor - MAC 2" },
|
||||||
|
new JoinMetadata { Description = "Info - Processor - MAC 2", JoinCapabilities = eJoinCapabilities.ToFusion, JoinType = eJoinType.Serial });
|
||||||
|
|
||||||
|
[JoinName("ProcessorNetMask1")]
|
||||||
|
public JoinDataComplete ProcessorNetMask1 = new JoinDataComplete(new JoinData { JoinNumber = 59, JoinSpan = 1, AttributeName = "Info - Processor - Net Mask 1" },
|
||||||
|
new JoinMetadata { Description = "Info - Processor - Net Mask 1", JoinCapabilities = eJoinCapabilities.ToFusion, JoinType = eJoinType.Serial });
|
||||||
|
|
||||||
|
[JoinName("ProcessorNetMask2")]
|
||||||
|
public JoinDataComplete ProcessorNetMask2 = new JoinDataComplete(new JoinData { JoinNumber = 60, JoinSpan = 1, AttributeName = "Info - Processor - Net Mask 2" },
|
||||||
|
new JoinMetadata { Description = "Info - Processor - Net Mask 2", JoinCapabilities = eJoinCapabilities.ToFusion, JoinType = eJoinType.Serial });
|
||||||
|
|
||||||
|
[JoinName("ProcessorFirmware")]
|
||||||
|
public JoinDataComplete ProcessorFirmware = new JoinDataComplete(new JoinData { JoinNumber = 61, JoinSpan = 1, AttributeName = "Info - Processor - Firmware" },
|
||||||
|
new JoinMetadata { Description = "Info - Processor - Firmware", JoinCapabilities = eJoinCapabilities.ToFusion, JoinType = eJoinType.Serial });
|
||||||
|
|
||||||
|
[JoinName("ProgramNameStart")]
|
||||||
|
public JoinDataComplete ProgramNameStart = new JoinDataComplete(new JoinData { JoinNumber = 62, JoinSpan = 10, AttributeName = "Info - Processor - Program" },
|
||||||
|
new JoinMetadata { Description = "Info - Processor - Program", JoinCapabilities = eJoinCapabilities.ToFusion, JoinType = eJoinType.Serial });
|
||||||
|
|
||||||
|
[JoinName("ProcessorReboot")]
|
||||||
|
public JoinDataComplete ProcessorReboot = new JoinDataComplete(new JoinData { JoinNumber = 74, JoinSpan = 1, AttributeName = "Processor - Reboot" },
|
||||||
|
new JoinMetadata { Description = "Processor - Reboot", JoinCapabilities = eJoinCapabilities.FromFusion, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
// Volume Controls
|
||||||
|
[JoinName("VolumeFader1")]
|
||||||
|
public JoinDataComplete VolumeFader1 = new JoinDataComplete(new JoinData { JoinNumber = 50, JoinSpan = 1, AttributeName = "Volume - Fader01" },
|
||||||
|
new JoinMetadata { Description = "Volume - Fader01", JoinCapabilities = eJoinCapabilities.ToFromFusion, JoinType = eJoinType.Analog });
|
||||||
|
|
||||||
|
// Codec Info
|
||||||
|
[JoinName("VcCodecInCall")]
|
||||||
|
public JoinDataComplete VcCodecInCall = new JoinDataComplete(new JoinData { JoinNumber = 69, JoinSpan = 1, AttributeName = "Conf - VC 1 In Call" },
|
||||||
|
new JoinMetadata { Description = "Conf - VC 1 In Call", JoinCapabilities = eJoinCapabilities.ToFusion, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
[JoinName("VcCodecOnline")]
|
||||||
|
public JoinDataComplete VcCodecOnline = new JoinDataComplete(new JoinData { JoinNumber = 122, JoinSpan = 1, AttributeName = "Online - VC 1" },
|
||||||
|
new JoinMetadata { Description = "Online - VC 1", JoinCapabilities = eJoinCapabilities.ToFusion, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
[JoinName("VcCodecIpAddress")]
|
||||||
|
public JoinDataComplete VcCodecIpAddress = new JoinDataComplete(new JoinData { JoinNumber = 121, JoinSpan = 1, AttributeName = "IP Address - VC" },
|
||||||
|
new JoinMetadata { Description = "IP Address - VC", JoinCapabilities = eJoinCapabilities.ToFusion, JoinType = eJoinType.Serial });
|
||||||
|
|
||||||
|
[JoinName("VcCodecIpPort")]
|
||||||
|
public JoinDataComplete VcCodecIpPort = new JoinDataComplete(new JoinData { JoinNumber = 150, JoinSpan = 1, AttributeName = "IP Port - VC" },
|
||||||
|
new JoinMetadata { Description = "IP Port - VC", JoinCapabilities = eJoinCapabilities.ToFusion, JoinType = eJoinType.Serial });
|
||||||
|
|
||||||
|
// Source Attributes
|
||||||
|
[JoinName("Display1CurrentSourceName")]
|
||||||
|
public JoinDataComplete Display1CurrentSourceName = new JoinDataComplete(new JoinData { JoinNumber = 84, JoinSpan = 1, AttributeName = "Display 1 - Current Source" },
|
||||||
|
new JoinMetadata { Description = "Display 1 - Current Source", JoinCapabilities = eJoinCapabilities.ToFusion, JoinType = eJoinType.Serial });
|
||||||
|
|
||||||
|
|
||||||
|
// Device Online Status
|
||||||
|
[JoinName("TouchpanelOnlineStart")]
|
||||||
|
public JoinDataComplete TouchpanelOnlineStart = new JoinDataComplete(new JoinData { JoinNumber = 150, JoinSpan = 10, AttributeName = "Online - Touch Panel" },
|
||||||
|
new JoinMetadata { Description = "Online - Touch Panel", JoinCapabilities = eJoinCapabilities.ToFusion, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
[JoinName("XpanelOnlineStart")]
|
||||||
|
public JoinDataComplete XpanelOnlineStart = new JoinDataComplete(new JoinData { JoinNumber = 160, JoinSpan = 5, AttributeName = "Online - XPanel" },
|
||||||
|
new JoinMetadata { Description = "Online - XPanel", JoinCapabilities = eJoinCapabilities.ToFusion, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
[JoinName("DisplayOnlineStart")]
|
||||||
|
public JoinDataComplete DisplayOnlineStart = new JoinDataComplete(new JoinData { JoinNumber = 170, JoinSpan = 10, AttributeName = "Online - Display" },
|
||||||
|
new JoinMetadata { Description = "Online - Display", JoinCapabilities = eJoinCapabilities.ToFusion, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
[JoinName("Display1LaptopSourceStart")]
|
||||||
|
public JoinDataComplete Display1LaptopSourceStart = new JoinDataComplete(new JoinData { JoinNumber = 166, JoinSpan = 5, AttributeName = "Display 1 - Source Laptop" },
|
||||||
|
new JoinMetadata { Description = "Display 1 - Source Laptop", JoinCapabilities = eJoinCapabilities.ToFromFusion, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
[JoinName("Display1DiscPlayerSourceStart")]
|
||||||
|
public JoinDataComplete Display1DiscPlayerSourceStart = new JoinDataComplete(new JoinData { JoinNumber = 181, JoinSpan = 5, AttributeName = "Display 1 - Source Disc Player" },
|
||||||
|
new JoinMetadata { Description = "Display 1 - Source Disc Player", JoinCapabilities = eJoinCapabilities.ToFromFusion, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
[JoinName("Display1SetTopBoxSourceStart")]
|
||||||
|
public JoinDataComplete Display1SetTopBoxSourceStart = new JoinDataComplete(new JoinData { JoinNumber = 188, JoinSpan = 5, AttributeName = "Display 1 - Source TV" },
|
||||||
|
new JoinMetadata { Description = "Display 1 - Source TV", JoinCapabilities = eJoinCapabilities.ToFromFusion, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
// Display 1
|
||||||
|
[JoinName("Display1Start")]
|
||||||
|
public JoinDataComplete Display1Start = new JoinDataComplete(new JoinData { JoinNumber = 158, JoinSpan = 1 },
|
||||||
|
new JoinMetadata { Description = "Display 1 Start", JoinCapabilities = eJoinCapabilities.ToFromFusion, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Constructor to use when instantiating this Join Map without inheriting from it
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="joinStart">Join this join map will start at</param>
|
||||||
|
public EssentialsHuddleSpaceRoomFusionRoomJoinMap(uint joinStart)
|
||||||
|
: base(joinStart, typeof(EssentialsHuddleSpaceRoomFusionRoomJoinMap))
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Constructor to use when extending this Join map
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="joinStart">Join this join map will start at</param>
|
||||||
|
/// <param name="type">Type of the child join map</param>
|
||||||
|
public EssentialsHuddleSpaceRoomFusionRoomJoinMap(uint joinStart, Type type) : base(joinStart, type)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,11 +1,14 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
|
||||||
using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
|
using Crestron.SimplSharp.Reflection;
|
||||||
using Crestron.SimplSharp.Scheduler;
|
using Crestron.SimplSharp.Scheduler;
|
||||||
|
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
|
using PepperDash.Essentials.Core.Fusion;
|
||||||
|
using PepperDash.Essentials.Room.Config;
|
||||||
|
using Activator = System.Activator;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Core
|
namespace PepperDash.Essentials.Core
|
||||||
{
|
{
|
||||||
|
|
@ -14,7 +17,7 @@ namespace PepperDash.Essentials.Core
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static class Scheduler
|
public static class Scheduler
|
||||||
{
|
{
|
||||||
private static Dictionary<string, ScheduledEventGroup> EventGroups = new Dictionary<string,ScheduledEventGroup>();
|
private static readonly Dictionary<string, ScheduledEventGroup> EventGroups = new Dictionary<string,ScheduledEventGroup>();
|
||||||
|
|
||||||
static Scheduler()
|
static Scheduler()
|
||||||
{
|
{
|
||||||
|
|
@ -49,7 +52,6 @@ namespace PepperDash.Essentials.Core
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Adds the event group to the global list
|
/// Adds the event group to the global list
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="name"></param>
|
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static void AddEventGroup(ScheduledEventGroup eventGroup)
|
public static void AddEventGroup(ScheduledEventGroup eventGroup)
|
||||||
{
|
{
|
||||||
|
|
@ -67,6 +69,13 @@ namespace PepperDash.Essentials.Core
|
||||||
if(!EventGroups.ContainsKey(eventGroup.Name))
|
if(!EventGroups.ContainsKey(eventGroup.Name))
|
||||||
EventGroups.Remove(eventGroup.Name);
|
EventGroups.Remove(eventGroup.Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static ScheduledEventGroup GetEventGroup(string key)
|
||||||
|
{
|
||||||
|
ScheduledEventGroup returnValue;
|
||||||
|
|
||||||
|
return EventGroups.TryGetValue(key, out returnValue) ? returnValue : null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class SchedulerUtilities
|
public static class SchedulerUtilities
|
||||||
|
|
@ -135,5 +144,90 @@ namespace PepperDash.Essentials.Core
|
||||||
|
|
||||||
return isMatch;
|
return isMatch;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static bool CheckEventTimeForMatch(ScheduledEvent evnt, DateTime time)
|
||||||
|
{
|
||||||
|
return evnt.DateAndTime.Hour == time.Hour && evnt.DateAndTime.Minute == time.Minute;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static bool CheckEventRecurrenceForMatch(ScheduledEvent evnt, ScheduledEventCommon.eWeekDays days)
|
||||||
|
{
|
||||||
|
return evnt.Recurrence.RecurrenceDays == days;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void CreateEventFromConfig(ScheduledEventConfig config, ScheduledEventGroup group, ScheduledEvent.UserEventCallBack handler)
|
||||||
|
{
|
||||||
|
if (group == null)
|
||||||
|
{
|
||||||
|
Debug.Console(0, "Unable to create event. Group is null");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var scheduledEvent = new ScheduledEvent(config.Key, group)
|
||||||
|
{
|
||||||
|
Acknowledgeable = config.Acknowledgeable,
|
||||||
|
Persistent = config.Persistent
|
||||||
|
};
|
||||||
|
|
||||||
|
scheduledEvent.UserCallBack += handler;
|
||||||
|
|
||||||
|
scheduledEvent.DateAndTime.SetFirstDayOfWeek(ScheduledEventCommon.eFirstDayOfWeek.Sunday);
|
||||||
|
|
||||||
|
var eventTime = DateTime.Parse(config.Time);
|
||||||
|
|
||||||
|
if (DateTime.Now > eventTime)
|
||||||
|
{
|
||||||
|
eventTime = eventTime.AddDays(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
Debug.Console(2, "[Scheduler] Current Date day of week: {0} recurrence days: {1}", eventTime.DayOfWeek,
|
||||||
|
config.Days);
|
||||||
|
|
||||||
|
var dayOfWeekConverted = ConvertDayOfWeek(eventTime);
|
||||||
|
|
||||||
|
Debug.Console(1, "[Scheduler] eventTime Day: {0}", dayOfWeekConverted);
|
||||||
|
|
||||||
|
while (!dayOfWeekConverted.IsFlagSet(config.Days))
|
||||||
|
{
|
||||||
|
eventTime = eventTime.AddDays(1);
|
||||||
|
|
||||||
|
dayOfWeekConverted = ConvertDayOfWeek(eventTime);
|
||||||
|
}
|
||||||
|
|
||||||
|
scheduledEvent.DateAndTime.SetAbsoluteEventTime(eventTime);
|
||||||
|
|
||||||
|
scheduledEvent.Recurrence.Weekly(config.Days);
|
||||||
|
|
||||||
|
if (config.Enable)
|
||||||
|
{
|
||||||
|
scheduledEvent.Enable();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
scheduledEvent.Disable();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static ScheduledEventCommon.eWeekDays ConvertDayOfWeek(DateTime eventTime)
|
||||||
|
{
|
||||||
|
return (ScheduledEventCommon.eWeekDays) Enum.Parse(typeof(ScheduledEventCommon.eWeekDays), eventTime.DayOfWeek.ToString(), true);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static bool IsFlagSet<T>(this T value, T flag) where T : struct
|
||||||
|
{
|
||||||
|
CheckIsEnum<T>(true);
|
||||||
|
|
||||||
|
var lValue = Convert.ToInt64(value);
|
||||||
|
var lFlag = Convert.ToInt64(flag);
|
||||||
|
|
||||||
|
return (lValue & lFlag) != 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void CheckIsEnum<T>(bool withFlags)
|
||||||
|
{
|
||||||
|
if (!typeof(T).IsEnum)
|
||||||
|
throw new ArgumentException(string.Format("Type '{0}' is not an enum", typeof(T).FullName));
|
||||||
|
if (withFlags && !Attribute.IsDefined(typeof(T), typeof(FlagsAttribute)))
|
||||||
|
throw new ArgumentException(string.Format("Type '{0}' doesn't have the 'Flags' attribute", typeof(T).FullName));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -0,0 +1,17 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using Crestron.SimplSharp;
|
||||||
|
using PepperDash.Core;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Core.Interfaces
|
||||||
|
{
|
||||||
|
public interface ILogStrings : IKeyed
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Defines a class that is capable of logging a string
|
||||||
|
/// </summary>
|
||||||
|
void SendToLog(IKeyed device, string logMessage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,18 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using Crestron.SimplSharp;
|
||||||
|
using PepperDash.Core;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Core.Interfaces
|
||||||
|
{
|
||||||
|
public interface ILogStringsWithLevel : IKeyed
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Defines a class that is capable of logging a string with an int level
|
||||||
|
/// </summary>
|
||||||
|
void SendToLog(IKeyed device, Debug.ErrorLogLevel level,string logMessage);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -25,7 +25,7 @@ namespace PepperDash.Essentials.Core
|
||||||
|
|
||||||
var joinMap = ConfigReader.ConfigObject.JoinMaps[joinMapKey];
|
var joinMap = ConfigReader.ConfigObject.JoinMaps[joinMapKey];
|
||||||
|
|
||||||
return joinMap;
|
return joinMap.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -44,18 +44,35 @@ namespace PepperDash.Essentials.Core
|
||||||
/// <param name="joinMapKey"></param>
|
/// <param name="joinMapKey"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static Dictionary<string, JoinData> TryGetJoinMapAdvancedForDevice(string joinMapKey)
|
public static Dictionary<string, JoinData> TryGetJoinMapAdvancedForDevice(string joinMapKey)
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(joinMapKey))
|
if (string.IsNullOrEmpty(joinMapKey))
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
var joinMapSerialzed = ConfigReader.ConfigObject.JoinMaps[joinMapKey];
|
if (!ConfigReader.ConfigObject.JoinMaps.ContainsKey(joinMapKey))
|
||||||
|
{
|
||||||
|
Debug.Console(2, "No Join Map found in config with key: '{0}'", joinMapKey);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
if (joinMapSerialzed == null) return null;
|
Debug.Console(2, "Attempting to load custom join map with key: {0}", joinMapKey);
|
||||||
|
|
||||||
var joinMapData = JsonConvert.DeserializeObject<Dictionary<string, JoinData>>(joinMapSerialzed);
|
var joinMapJToken = ConfigReader.ConfigObject.JoinMaps[joinMapKey];
|
||||||
|
|
||||||
|
if (joinMapJToken == null)
|
||||||
|
return null;
|
||||||
|
|
||||||
|
var joinMapData = joinMapJToken.ToObject<Dictionary<string, JoinData>>();
|
||||||
|
|
||||||
return joinMapData;
|
return joinMapData;
|
||||||
}
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Debug.Console(2, "Error getting join map for key: '{0}'. Error: {1}", joinMapKey, e);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -266,7 +283,7 @@ namespace PepperDash.Essentials.Core
|
||||||
@"Join Number: {0} | JoinSpan: '{1}' | Description: '{2}' | Type: '{3}' | Capabilities: '{4}'",
|
@"Join Number: {0} | JoinSpan: '{1}' | Description: '{2}' | Type: '{3}' | Capabilities: '{4}'",
|
||||||
join.Value.JoinNumber,
|
join.Value.JoinNumber,
|
||||||
join.Value.JoinSpan,
|
join.Value.JoinSpan,
|
||||||
String.IsNullOrEmpty(join.Value.Metadata.Description) ? join.Value.Metadata.Label: join.Value.Metadata.Description,
|
String.IsNullOrEmpty(join.Value.AttributeName) ? join.Value.Metadata.Label : join.Value.AttributeName,
|
||||||
join.Value.Metadata.JoinType.ToString(),
|
join.Value.Metadata.JoinType.ToString(),
|
||||||
join.Value.Metadata.JoinCapabilities.ToString());
|
join.Value.Metadata.JoinCapabilities.ToString());
|
||||||
}
|
}
|
||||||
|
|
@ -288,7 +305,7 @@ namespace PepperDash.Essentials.Core
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Debug.Console(2, "No mathcing key found in join map for: '{0}'", customJoinData.Key);
|
Debug.Console(2, "No matching key found in join map for: '{0}'", customJoinData.Key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -327,7 +344,10 @@ namespace PepperDash.Essentials.Core
|
||||||
None = 0,
|
None = 0,
|
||||||
ToSIMPL = 1,
|
ToSIMPL = 1,
|
||||||
FromSIMPL = 2,
|
FromSIMPL = 2,
|
||||||
ToFromSIMPL = ToSIMPL | FromSIMPL
|
ToFromSIMPL = ToSIMPL | FromSIMPL,
|
||||||
|
ToFusion = 4,
|
||||||
|
FromFusion = 8,
|
||||||
|
ToFromFusion = ToFusion | FromFusion,
|
||||||
}
|
}
|
||||||
|
|
||||||
[Flags]
|
[Flags]
|
||||||
|
|
@ -340,7 +360,7 @@ namespace PepperDash.Essentials.Core
|
||||||
DigitalAnalog = Digital | Analog,
|
DigitalAnalog = Digital | Analog,
|
||||||
DigitalSerial = Digital | Serial,
|
DigitalSerial = Digital | Serial,
|
||||||
AnalogSerial = Analog | Serial,
|
AnalogSerial = Analog | Serial,
|
||||||
DigitalAnalogSerial = Digital | Analog | Serial
|
DigitalAnalogSerial = Digital | Analog | Serial,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -394,7 +414,7 @@ namespace PepperDash.Essentials.Core
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Data describing the join. Can be
|
/// Data describing the join. Can be overridden from configuratino
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class JoinData
|
public class JoinData
|
||||||
{
|
{
|
||||||
|
|
@ -408,6 +428,11 @@ namespace PepperDash.Essentials.Core
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("joinSpan")]
|
[JsonProperty("joinSpan")]
|
||||||
public uint JoinSpan { get; set; }
|
public uint JoinSpan { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// Fusion Attribute Name (optional)
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("attributeName")]
|
||||||
|
public string AttributeName { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -419,6 +444,10 @@ namespace PepperDash.Essentials.Core
|
||||||
|
|
||||||
private JoinData _data;
|
private JoinData _data;
|
||||||
public JoinMetadata Metadata { get; set; }
|
public JoinMetadata Metadata { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// To store some future information as you please
|
||||||
|
/// </summary>
|
||||||
|
public object UserObject { get; private set; }
|
||||||
|
|
||||||
public JoinDataComplete(JoinData data, JoinMetadata metadata)
|
public JoinDataComplete(JoinData data, JoinMetadata metadata)
|
||||||
{
|
{
|
||||||
|
|
@ -449,6 +478,11 @@ namespace PepperDash.Essentials.Core
|
||||||
get { return _data.JoinSpan; }
|
get { return _data.JoinSpan; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public string AttributeName
|
||||||
|
{
|
||||||
|
get { return _data.AttributeName; }
|
||||||
|
}
|
||||||
|
|
||||||
public void SetCustomJoinData(JoinData customJoinData)
|
public void SetCustomJoinData(JoinData customJoinData)
|
||||||
{
|
{
|
||||||
_data = customJoinData;
|
_data = customJoinData;
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,7 @@ namespace PepperDash.Essentials.Core
|
||||||
initialStatus = MonitorStatus.InWarning;
|
initialStatus = MonitorStatus.InWarning;
|
||||||
prefix = "2:";
|
prefix = "2:";
|
||||||
}
|
}
|
||||||
else if (InWarning.Count() > 0)
|
else if (IsOk.Count() > 0)
|
||||||
initialStatus = MonitorStatus.IsOk;
|
initialStatus = MonitorStatus.IsOk;
|
||||||
else
|
else
|
||||||
initialStatus = MonitorStatus.StatusUnknown;
|
initialStatus = MonitorStatus.StatusUnknown;
|
||||||
|
|
@ -88,6 +88,10 @@ namespace PepperDash.Essentials.Core
|
||||||
}
|
}
|
||||||
Message = sb.ToString();
|
Message = sb.ToString();
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Message = "Room Ok.";
|
||||||
|
}
|
||||||
|
|
||||||
// Want to fire even if status doesn't change because the message may.
|
// Want to fire even if status doesn't change because the message may.
|
||||||
Status = initialStatus;
|
Status = initialStatus;
|
||||||
|
|
|
||||||
|
|
@ -505,17 +505,23 @@ namespace PepperDash.Essentials.Core.Monitoring
|
||||||
ProgramInfo.RegistrationState = Program.RegistrationState;
|
ProgramInfo.RegistrationState = Program.RegistrationState;
|
||||||
|
|
||||||
ProgramStartedFeedback = new BoolFeedback(() => Program.OperatingState == eProgramOperatingState.Start);
|
ProgramStartedFeedback = new BoolFeedback(() => Program.OperatingState == eProgramOperatingState.Start);
|
||||||
|
ProgramStartedFeedback.FireUpdate();
|
||||||
|
|
||||||
ProgramStoppedFeedback = new BoolFeedback(() => Program.OperatingState == eProgramOperatingState.Stop);
|
ProgramStoppedFeedback = new BoolFeedback(() => Program.OperatingState == eProgramOperatingState.Stop);
|
||||||
|
ProgramStoppedFeedback.FireUpdate();
|
||||||
|
|
||||||
ProgramRegisteredFeedback =
|
ProgramRegisteredFeedback =
|
||||||
new BoolFeedback(() => Program.RegistrationState == eProgramRegistrationState.Register);
|
new BoolFeedback(() => Program.RegistrationState == eProgramRegistrationState.Register);
|
||||||
|
ProgramRegisteredFeedback.FireUpdate();
|
||||||
|
|
||||||
ProgramUnregisteredFeedback =
|
ProgramUnregisteredFeedback =
|
||||||
new BoolFeedback(() => Program.RegistrationState == eProgramRegistrationState.Unregister);
|
new BoolFeedback(() => Program.RegistrationState == eProgramRegistrationState.Unregister);
|
||||||
|
ProgramUnregisteredFeedback.FireUpdate();
|
||||||
|
|
||||||
ProgramNameFeedback = new StringFeedback(() => ProgramInfo.ProgramFile);
|
ProgramNameFeedback = new StringFeedback(() => ProgramInfo.ProgramFile);
|
||||||
ProgramCompileTimeFeedback = new StringFeedback(() => ProgramInfo.CompileTime);
|
ProgramCompileTimeFeedback = new StringFeedback(() => ProgramInfo.CompileTime);
|
||||||
CrestronDataBaseVersionFeedback = new StringFeedback(() => ProgramInfo.CrestronDb);
|
CrestronDataBaseVersionFeedback = new StringFeedback(() => ProgramInfo.CrestronDb);
|
||||||
EnvironmentVersionFeedback = new StringFeedback(() => ProgramInfo.Environment);
|
EnvironmentVersionFeedback = new StringFeedback(() => ProgramInfo.Environment);
|
||||||
|
|
||||||
AggregatedProgramInfoFeedback = new StringFeedback(() => JsonConvert.SerializeObject(ProgramInfo));
|
AggregatedProgramInfoFeedback = new StringFeedback(() => JsonConvert.SerializeObject(ProgramInfo));
|
||||||
|
|
||||||
GetProgramInfo();
|
GetProgramInfo();
|
||||||
|
|
|
||||||
|
|
@ -199,6 +199,7 @@
|
||||||
<Compile Include="Devices\PC\Laptop.cs" />
|
<Compile Include="Devices\PC\Laptop.cs" />
|
||||||
<Compile Include="Devices\ReconfigurableDevice.cs" />
|
<Compile Include="Devices\ReconfigurableDevice.cs" />
|
||||||
<Compile Include="Devices\VolumeDeviceChangeEventArgs.cs" />
|
<Compile Include="Devices\VolumeDeviceChangeEventArgs.cs" />
|
||||||
|
<Compile Include="DeviceTypeInterfaces\ITvPresetsProvider.cs" />
|
||||||
<Compile Include="DeviceTypeInterfaces\LanguageLabel.cs" />
|
<Compile Include="DeviceTypeInterfaces\LanguageLabel.cs" />
|
||||||
<Compile Include="DeviceTypeInterfaces\ILanguageProvider.cs" />
|
<Compile Include="DeviceTypeInterfaces\ILanguageProvider.cs" />
|
||||||
<Compile Include="DeviceTypeInterfaces\IHasBranding.cs" />
|
<Compile Include="DeviceTypeInterfaces\IHasBranding.cs" />
|
||||||
|
|
@ -219,11 +220,14 @@
|
||||||
<Compile Include="Fusion\FusionCustomPropertiesBridge.cs" />
|
<Compile Include="Fusion\FusionCustomPropertiesBridge.cs" />
|
||||||
<Compile Include="Fusion\FusionEventHandlers.cs" />
|
<Compile Include="Fusion\FusionEventHandlers.cs" />
|
||||||
<Compile Include="Fusion\FusionProcessorQueries.cs" />
|
<Compile Include="Fusion\FusionProcessorQueries.cs" />
|
||||||
|
<Compile Include="Fusion\EssentialsHuddleSpaceRoomFusionRoomJoinMap.cs" />
|
||||||
<Compile Include="Fusion\FusionRviDataClasses.cs" />
|
<Compile Include="Fusion\FusionRviDataClasses.cs" />
|
||||||
<Compile Include="Gateways\CenRfgwController.cs" />
|
<Compile Include="Gateways\CenRfgwController.cs" />
|
||||||
<Compile Include="Gateways\EssentialsRfGatewayConfig.cs" />
|
<Compile Include="Gateways\EssentialsRfGatewayConfig.cs" />
|
||||||
<Compile Include="Global\EthernetAdapterInfo.cs" />
|
<Compile Include="Global\EthernetAdapterInfo.cs" />
|
||||||
<Compile Include="Interfaces\Components\RoomComponents.cs" />
|
<Compile Include="Interfaces\Components\RoomComponents.cs" />
|
||||||
|
<Compile Include="Interfaces\ILogStrings.cs" />
|
||||||
|
<Compile Include="Interfaces\ILogStringsWithLevel.cs" />
|
||||||
<Compile Include="Queues\ComsMessage.cs" />
|
<Compile Include="Queues\ComsMessage.cs" />
|
||||||
<Compile Include="Queues\ProcessStringMessage.cs" />
|
<Compile Include="Queues\ProcessStringMessage.cs" />
|
||||||
<Compile Include="Queues\GenericQueue.cs" />
|
<Compile Include="Queues\GenericQueue.cs" />
|
||||||
|
|
@ -282,6 +286,7 @@
|
||||||
<Compile Include="Room\Components\ComponentRoom.cs" />
|
<Compile Include="Room\Components\ComponentRoom.cs" />
|
||||||
<Compile Include="Room\Components\RoomComponentBase.cs" />
|
<Compile Include="Room\Components\RoomComponentBase.cs" />
|
||||||
<Compile Include="Room\EssentialsRoomBase.cs" />
|
<Compile Include="Room\EssentialsRoomBase.cs" />
|
||||||
|
<Compile Include="Room\Config\EssentialsRoomScheduledEventsConfig.cs" />
|
||||||
<Compile Include="Room\Interfaces.cs" />
|
<Compile Include="Room\Interfaces.cs" />
|
||||||
<Compile Include="Room\iOccupancyStatusProvider.cs" />
|
<Compile Include="Room\iOccupancyStatusProvider.cs" />
|
||||||
<Compile Include="Room\RoomFactory.cs" />
|
<Compile Include="Room\RoomFactory.cs" />
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@
|
||||||
<tags>crestron 3series 4series</tags>
|
<tags>crestron 3series 4series</tags>
|
||||||
<repository type="git" url="https://github.com/PepperDash/Essentials"/>
|
<repository type="git" url="https://github.com/PepperDash/Essentials"/>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency id="PepperDashCore" version="[1.0.43, 1.1.0)"/>
|
<dependency id="PepperDashCore" version="[1.0.45, 1.1.0)"/>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</metadata>
|
</metadata>
|
||||||
<files>
|
<files>
|
||||||
|
|
|
||||||
|
|
@ -402,13 +402,16 @@ namespace PepperDash.Essentials
|
||||||
/// Loads a
|
/// Loads a
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="plugin"></param>
|
/// <param name="plugin"></param>
|
||||||
|
/// <param name="loadedAssembly"></param>
|
||||||
static void LoadCustomPlugin(IPluginDeviceFactory plugin, LoadedAssembly loadedAssembly)
|
static void LoadCustomPlugin(IPluginDeviceFactory plugin, LoadedAssembly loadedAssembly)
|
||||||
{
|
{
|
||||||
var passed = Global.IsRunningMinimumVersionOrHigher(plugin.MinimumEssentialsFrameworkVersion);
|
var passed = Global.IsRunningMinimumVersionOrHigher(plugin.MinimumEssentialsFrameworkVersion);
|
||||||
|
|
||||||
if (!passed)
|
if (!passed)
|
||||||
{
|
{
|
||||||
Debug.Console(0, Debug.ErrorLogLevel.Error, "Plugin indicates minimum Essentials version {0}. Dependency check failed. Skipping Plugin", plugin.MinimumEssentialsFrameworkVersion);
|
Debug.Console(0, Debug.ErrorLogLevel.Error,
|
||||||
|
"\r\n********************\r\n\tPlugin indicates minimum Essentials version {0}. Dependency check failed. Skipping Plugin {1}\r\n********************",
|
||||||
|
plugin.MinimumEssentialsFrameworkVersion, loadedAssembly.Name);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,13 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
using Crestron.SimplSharp.CrestronIO;
|
using Crestron.SimplSharp.CrestronIO;
|
||||||
|
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Newtonsoft.Json.Linq;
|
|
||||||
|
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
|
|
||||||
//using SSMono.IO;
|
//using SSMono.IO;
|
||||||
|
using PepperDash.Core.WebApi.Presets;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Core.Presets
|
namespace PepperDash.Essentials.Core.Presets
|
||||||
{
|
{
|
||||||
|
|
@ -19,43 +16,34 @@ namespace PepperDash.Essentials.Core.Presets
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class DevicePresetsModel : Device
|
public class DevicePresetsModel : Device
|
||||||
{
|
{
|
||||||
public event EventHandler PresetsLoaded;
|
public delegate void PresetRecalledCallback(ISetTopBoxNumericKeypad device, string channel);
|
||||||
|
|
||||||
public int PulseTime { get; set; }
|
public delegate void PresetsSavedCallback(List<PresetChannel> presets);
|
||||||
public int DigitSpacingMS { get; set; }
|
|
||||||
public bool PresetsAreLoaded { get; private set; }
|
|
||||||
|
|
||||||
public List<PresetChannel> PresetsList { get { return _PresetsList.ToList(); } }
|
private readonly CCriticalSection _fileOps = new CCriticalSection();
|
||||||
List<PresetChannel> _PresetsList;
|
private readonly bool _initSuccess;
|
||||||
public int Count { get { return PresetsList != null ? PresetsList.Count : 0; } }
|
|
||||||
|
|
||||||
public bool UseLocalImageStorage { get; set; }
|
private readonly ISetTopBoxNumericKeypad _setTopBox;
|
||||||
public string ImagesLocalHostPrefix { get; set; }
|
|
||||||
public string ImagesPathPrefix { get; set; }
|
|
||||||
public string ListPathPrefix { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The methods on the STB device to call when dialing
|
/// The methods on the STB device to call when dialing
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Dictionary<char, Action<bool>> DialFunctions;
|
private Dictionary<char, Action<bool>> _dialFunctions;
|
||||||
Action<bool> EnterFunction;
|
|
||||||
|
|
||||||
bool DialIsRunning;
|
private bool _dialIsRunning;
|
||||||
string FilePath;
|
private Action<bool> _enterFunction;
|
||||||
bool InitSuccess;
|
private string _filePath;
|
||||||
//SSMono.IO.FileSystemWatcher ListWatcher;
|
|
||||||
|
|
||||||
public DevicePresetsModel(string key, ISetTopBoxNumericKeypad setTopBox, string fileName)
|
public DevicePresetsModel(string key, ISetTopBoxNumericKeypad setTopBox, string fileName)
|
||||||
: base(key)
|
: this(key, fileName)
|
||||||
{
|
{
|
||||||
PulseTime = 150;
|
|
||||||
DigitSpacingMS = 150;
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
_setTopBox = setTopBox;
|
||||||
|
|
||||||
// Grab the digit functions from the device
|
// Grab the digit functions from the device
|
||||||
// If any fail, the whole thing fails peacefully
|
// If any fail, the whole thing fails peacefully
|
||||||
DialFunctions = new Dictionary<char, Action<bool>>(10)
|
_dialFunctions = new Dictionary<char, Action<bool>>(10)
|
||||||
{
|
{
|
||||||
{'1', setTopBox.Digit1},
|
{'1', setTopBox.Digit1},
|
||||||
{'2', setTopBox.Digit2},
|
{'2', setTopBox.Digit2},
|
||||||
|
|
@ -73,11 +61,17 @@ namespace PepperDash.Essentials.Core.Presets
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
Debug.Console(0, "DevicePresets '{0}', not attached to INumericKeypad device. Ignoring", key);
|
Debug.Console(0, "DevicePresets '{0}', not attached to INumericKeypad device. Ignoring", key);
|
||||||
DialFunctions = null;
|
_dialFunctions = null;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
EnterFunction = setTopBox.KeypadEnter;
|
_enterFunction = setTopBox.KeypadEnter;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DevicePresetsModel(string key, string fileName) : base(key)
|
||||||
|
{
|
||||||
|
PulseTime = 150;
|
||||||
|
DigitSpacingMs = 150;
|
||||||
|
|
||||||
UseLocalImageStorage = true;
|
UseLocalImageStorage = true;
|
||||||
|
|
||||||
|
|
@ -88,91 +82,219 @@ namespace PepperDash.Essentials.Core.Presets
|
||||||
|
|
||||||
SetFileName(fileName);
|
SetFileName(fileName);
|
||||||
|
|
||||||
//ListWatcher = new FileSystemWatcher(@"\HTML\presets\lists");
|
_initSuccess = true;
|
||||||
//ListWatcher.NotifyFilter = NotifyFilters.LastWrite;
|
|
||||||
//ListWatcher.EnableRaisingEvents = true;
|
|
||||||
//ListWatcher.Changed += ListWatcher_Changed;
|
|
||||||
InitSuccess = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public event PresetRecalledCallback PresetRecalled;
|
||||||
|
public event PresetsSavedCallback PresetsSaved;
|
||||||
|
|
||||||
|
public int PulseTime { get; set; }
|
||||||
|
public int DigitSpacingMs { get; set; }
|
||||||
|
public bool PresetsAreLoaded { get; private set; }
|
||||||
|
|
||||||
|
public List<PresetChannel> PresetsList { get; private set; }
|
||||||
|
|
||||||
|
public int Count
|
||||||
|
{
|
||||||
|
get { return PresetsList != null ? PresetsList.Count : 0; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool UseLocalImageStorage { get; set; }
|
||||||
|
public string ImagesLocalHostPrefix { get; set; }
|
||||||
|
public string ImagesPathPrefix { get; set; }
|
||||||
|
public string ListPathPrefix { get; set; }
|
||||||
|
public event EventHandler PresetsLoaded;
|
||||||
|
|
||||||
|
|
||||||
public void SetFileName(string path)
|
public void SetFileName(string path)
|
||||||
{
|
{
|
||||||
FilePath = ListPathPrefix + path;
|
_filePath = ListPathPrefix + path;
|
||||||
|
|
||||||
|
Debug.Console(2, this, "Setting presets file path to {0}", _filePath);
|
||||||
LoadChannels();
|
LoadChannels();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void LoadChannels()
|
public void LoadChannels()
|
||||||
{
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
_fileOps.Enter();
|
||||||
|
|
||||||
|
Debug.Console(2, this, "Loading presets from {0}", _filePath);
|
||||||
PresetsAreLoaded = false;
|
PresetsAreLoaded = false;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var pl = JsonConvert.DeserializeObject<PresetsList>(Crestron.SimplSharp.CrestronIO.File.ReadToEnd(FilePath, Encoding.ASCII));
|
var pl = JsonConvert.DeserializeObject<PresetsList>(File.ReadToEnd(_filePath, Encoding.ASCII));
|
||||||
Name = pl.Name;
|
Name = pl.Name;
|
||||||
_PresetsList = pl.Channels;
|
PresetsList = pl.Channels;
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
Debug.Console(2, this, "LoadChannels: Error reading presets file. These presets will be empty:\r '{0}'\r Error:{1}", FilePath, e.Message);
|
Debug.Console(2, this,
|
||||||
|
"LoadChannels: Error reading presets file. These presets will be empty:\r '{0}'\r Error:{1}",
|
||||||
|
_filePath, e.Message);
|
||||||
// Just save a default empty list
|
// Just save a default empty list
|
||||||
_PresetsList = new List<PresetChannel>();
|
PresetsList = new List<PresetChannel>();
|
||||||
}
|
}
|
||||||
PresetsAreLoaded = true;
|
PresetsAreLoaded = true;
|
||||||
|
|
||||||
var handler = PresetsLoaded;
|
var handler = PresetsLoaded;
|
||||||
if (handler != null)
|
if (handler != null)
|
||||||
|
{
|
||||||
handler(this, EventArgs.Empty);
|
handler(this, EventArgs.Empty);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
_fileOps.Leave();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void Dial(int presetNum)
|
public void Dial(int presetNum)
|
||||||
{
|
{
|
||||||
if (presetNum <= _PresetsList.Count)
|
if (presetNum <= PresetsList.Count)
|
||||||
Dial(_PresetsList[presetNum - 1].Channel);
|
{
|
||||||
|
Dial(PresetsList[presetNum - 1].Channel);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Dial(string chanNum)
|
public void Dial(string chanNum)
|
||||||
{
|
{
|
||||||
if (DialIsRunning || !InitSuccess) return;
|
if (_dialIsRunning || !_initSuccess)
|
||||||
if (DialFunctions == null)
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (_dialFunctions == null)
|
||||||
{
|
{
|
||||||
Debug.Console(1, "DevicePresets '{0}', not attached to keypad device. Ignoring channel", Key);
|
Debug.Console(1, "DevicePresets '{0}', not attached to keypad device. Ignoring channel", Key);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
DialIsRunning = true;
|
_dialIsRunning = true;
|
||||||
CrestronInvoke.BeginInvoke(o =>
|
CrestronInvoke.BeginInvoke(o =>
|
||||||
{
|
{
|
||||||
foreach (var c in chanNum.ToCharArray())
|
foreach (var c in chanNum.ToCharArray())
|
||||||
{
|
{
|
||||||
if (DialFunctions.ContainsKey(c))
|
if (_dialFunctions.ContainsKey(c))
|
||||||
Pulse(DialFunctions[c]);
|
{
|
||||||
CrestronEnvironment.Sleep(DigitSpacingMS);
|
Pulse(_dialFunctions[c]);
|
||||||
|
}
|
||||||
|
CrestronEnvironment.Sleep(DigitSpacingMs);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (EnterFunction != null)
|
if (_enterFunction != null)
|
||||||
Pulse(EnterFunction);
|
{
|
||||||
DialIsRunning = false;
|
Pulse(_enterFunction);
|
||||||
|
}
|
||||||
|
_dialIsRunning = false;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (_setTopBox == null) return;
|
||||||
|
|
||||||
|
OnPresetRecalled(_setTopBox, chanNum);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Pulse(Action<bool> act)
|
public void Dial(int presetNum, ISetTopBoxNumericKeypad setTopBox)
|
||||||
|
{
|
||||||
|
if (presetNum <= PresetsList.Count)
|
||||||
|
{
|
||||||
|
Dial(PresetsList[presetNum - 1].Channel, setTopBox);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Dial(string chanNum, ISetTopBoxNumericKeypad setTopBox)
|
||||||
|
{
|
||||||
|
_dialFunctions = new Dictionary<char, Action<bool>>(10)
|
||||||
|
{
|
||||||
|
{'1', setTopBox.Digit1},
|
||||||
|
{'2', setTopBox.Digit2},
|
||||||
|
{'3', setTopBox.Digit3},
|
||||||
|
{'4', setTopBox.Digit4},
|
||||||
|
{'5', setTopBox.Digit5},
|
||||||
|
{'6', setTopBox.Digit6},
|
||||||
|
{'7', setTopBox.Digit7},
|
||||||
|
{'8', setTopBox.Digit8},
|
||||||
|
{'9', setTopBox.Digit9},
|
||||||
|
{'0', setTopBox.Digit0},
|
||||||
|
{'-', setTopBox.Dash}
|
||||||
|
};
|
||||||
|
|
||||||
|
_enterFunction = setTopBox.KeypadEnter;
|
||||||
|
|
||||||
|
OnPresetRecalled(setTopBox, chanNum);
|
||||||
|
|
||||||
|
Dial(chanNum);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnPresetRecalled(ISetTopBoxNumericKeypad setTopBox, string channel)
|
||||||
|
{
|
||||||
|
var handler = PresetRecalled;
|
||||||
|
|
||||||
|
if (handler == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
handler(setTopBox, channel);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UpdatePreset(int index, PresetChannel preset)
|
||||||
|
{
|
||||||
|
if (index >= PresetsList.Count)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
PresetsList[index] = preset;
|
||||||
|
|
||||||
|
SavePresets();
|
||||||
|
|
||||||
|
OnPresetsSaved();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UpdatePresets(List<PresetChannel> presets)
|
||||||
|
{
|
||||||
|
PresetsList = presets;
|
||||||
|
|
||||||
|
SavePresets();
|
||||||
|
|
||||||
|
OnPresetsSaved();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SavePresets()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
_fileOps.Enter();
|
||||||
|
var pl = new PresetsList {Channels = PresetsList, Name = Name};
|
||||||
|
var json = JsonConvert.SerializeObject(pl, Formatting.Indented);
|
||||||
|
|
||||||
|
using (var file = File.Open(_filePath, FileMode.Truncate))
|
||||||
|
{
|
||||||
|
file.Write(json, Encoding.UTF8);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
_fileOps.Leave();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnPresetsSaved()
|
||||||
|
{
|
||||||
|
var handler = PresetsSaved;
|
||||||
|
|
||||||
|
if (handler == null) return;
|
||||||
|
|
||||||
|
handler(PresetsList);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Pulse(Action<bool> act)
|
||||||
{
|
{
|
||||||
act(true);
|
act(true);
|
||||||
CrestronEnvironment.Sleep(PulseTime);
|
CrestronEnvironment.Sleep(PulseTime);
|
||||||
act(false);
|
act(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Event handler for filesystem watcher. When directory changes, this is called
|
|
||||||
/// </summary>
|
|
||||||
//void ListWatcher_Changed(object sender, FileSystemEventArgs e)
|
|
||||||
//{
|
|
||||||
// Debug.Console(1, this, "folder modified: {0}", e.FullPath);
|
|
||||||
// if (e.FullPath.Equals(FilePath, StringComparison.OrdinalIgnoreCase))
|
|
||||||
// {
|
|
||||||
// Debug.Console(1, this, "File changed: {0}", e.ChangeType);
|
|
||||||
// LoadChannels();
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -10,19 +10,22 @@ namespace PepperDash.Essentials.Core.Presets
|
||||||
public class PresetChannel
|
public class PresetChannel
|
||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty(Required = Required.Always)]
|
[JsonProperty(Required = Required.Always,PropertyName = "name")]
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
[JsonProperty(Required = Required.Always)]
|
|
||||||
|
[JsonProperty(Required = Required.Always, PropertyName = "iconUrl")]
|
||||||
public string IconUrl { get; set; }
|
public string IconUrl { get; set; }
|
||||||
[JsonProperty(Required = Required.Always)]
|
|
||||||
|
[JsonProperty(Required = Required.Always, PropertyName = "channel")]
|
||||||
public string Channel { get; set; }
|
public string Channel { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class PresetsList
|
public class PresetsList
|
||||||
{
|
{
|
||||||
[JsonProperty(Required=Required.Always)]
|
[JsonProperty(Required=Required.Always,PropertyName = "name")]
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
[JsonProperty(Required = Required.Always)]
|
|
||||||
|
[JsonProperty(Required = Required.Always, PropertyName = "channels")]
|
||||||
public List<PresetChannel> Channels { get; set; }
|
public List<PresetChannel> Channels { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -40,7 +40,7 @@ namespace PepperDash_Essentials_Core.Queues
|
||||||
|
|
||||||
private void Validate(IBasicCommunication coms, object message)
|
private void Validate(IBasicCommunication coms, object message)
|
||||||
{
|
{
|
||||||
if (_coms == null)
|
if (coms == null)
|
||||||
throw new ArgumentNullException("coms");
|
throw new ArgumentNullException("coms");
|
||||||
|
|
||||||
if (message == null)
|
if (message == null)
|
||||||
|
|
|
||||||
|
|
@ -15,23 +15,37 @@ namespace PepperDash_Essentials_Core.Queues
|
||||||
protected readonly Thread _worker;
|
protected readonly Thread _worker;
|
||||||
protected readonly CEvent _waitHandle = new CEvent();
|
protected readonly CEvent _waitHandle = new CEvent();
|
||||||
|
|
||||||
private readonly bool _delayEnabled;
|
private bool _delayEnabled;
|
||||||
private readonly int _delayTime;
|
private int _delayTime;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// If the instance has been disposed.
|
/// If the instance has been disposed.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool Disposed { get; private set; }
|
public bool Disposed { get; private set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Constructor with no thread priority
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="key"></param>
|
||||||
|
public GenericQueue(string key)
|
||||||
|
: this(key, Thread.eThreadPriority.MediumPriority)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Constructor for generic queue with no pacing
|
/// Constructor for generic queue with no pacing
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="key">Key</param>
|
/// <param name="key">Key</param>
|
||||||
public GenericQueue(string key)
|
/// <param name="priority"></param>
|
||||||
|
public GenericQueue(string key, Thread.eThreadPriority priority)
|
||||||
{
|
{
|
||||||
_key = key;
|
_key = key;
|
||||||
_queue = new CrestronQueue<IQueueMessage>();
|
_queue = new CrestronQueue<IQueueMessage>(25);
|
||||||
_worker = new Thread(ProcessQueue, null, Thread.eThreadStartOptions.Running);
|
_worker = new Thread(ProcessQueue, null, Thread.eThreadStartOptions.Running)
|
||||||
|
{
|
||||||
|
Priority = priority
|
||||||
|
};
|
||||||
|
|
||||||
CrestronEnvironment.ProgramStatusEventHandler += programEvent =>
|
CrestronEnvironment.ProgramStatusEventHandler += programEvent =>
|
||||||
{
|
{
|
||||||
|
|
@ -49,6 +63,23 @@ namespace PepperDash_Essentials_Core.Queues
|
||||||
/// <param name="pacing">Pacing in ms between actions</param>
|
/// <param name="pacing">Pacing in ms between actions</param>
|
||||||
public GenericQueue(string key, int pacing)
|
public GenericQueue(string key, int pacing)
|
||||||
: this(key)
|
: this(key)
|
||||||
|
{
|
||||||
|
SetDelayValues(pacing);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Constructor with pacing and priority
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="key"></param>
|
||||||
|
/// <param name="pacing"></param>
|
||||||
|
/// <param name="priority"></param>
|
||||||
|
public GenericQueue(string key, int pacing, Thread.eThreadPriority priority)
|
||||||
|
: this(key, priority)
|
||||||
|
{
|
||||||
|
SetDelayValues(pacing);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SetDelayValues(int pacing)
|
||||||
{
|
{
|
||||||
_delayEnabled = pacing > 0;
|
_delayEnabled = pacing > 0;
|
||||||
_delayTime = pacing;
|
_delayTime = pacing;
|
||||||
|
|
@ -83,7 +114,7 @@ namespace PepperDash_Essentials_Core.Queues
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Debug.ConsoleWithLog(0, this, "Caught an exception in the Queue {0}\r{1}\r{2}", ex.Message, ex.InnerException, ex.StackTrace);
|
Debug.Console(0, this, Debug.ErrorLogLevel.Error, "Caught an exception in the Queue {0}\r{1}\r{2}", ex.Message, ex.InnerException, ex.StackTrace);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else _waitHandle.Wait();
|
else _waitHandle.Wait();
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,41 @@
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using Crestron.SimplSharp.Scheduler;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Converters;
|
||||||
|
using PepperDash.Essentials.Core;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Room.Config
|
||||||
|
{
|
||||||
|
public class EssentialsRoomScheduledEventsConfig
|
||||||
|
{
|
||||||
|
[JsonProperty("scheduledEvents")]
|
||||||
|
public List<ScheduledEventConfig> ScheduledEvents;
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ScheduledEventConfig
|
||||||
|
{
|
||||||
|
[JsonProperty("key")]
|
||||||
|
public string Key;
|
||||||
|
|
||||||
|
[JsonProperty("name")]
|
||||||
|
public string Name;
|
||||||
|
|
||||||
|
[JsonProperty("days")]
|
||||||
|
public ScheduledEventCommon.eWeekDays Days;
|
||||||
|
|
||||||
|
[JsonProperty("time")]
|
||||||
|
public string Time;
|
||||||
|
|
||||||
|
[JsonProperty("actions")]
|
||||||
|
public List<DeviceActionWrapper> Actions;
|
||||||
|
|
||||||
|
[JsonProperty("persistent")]
|
||||||
|
public bool Persistent;
|
||||||
|
|
||||||
|
[JsonProperty("acknowledgeable")]
|
||||||
|
public bool Acknowledgeable;
|
||||||
|
|
||||||
|
[JsonProperty("enable")]
|
||||||
|
public bool Enable;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -41,6 +41,14 @@ namespace PepperDash.Essentials.Core
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Simplified routing direct from source to destination
|
||||||
|
/// </summary>
|
||||||
|
public interface IRunDirectRouteAction
|
||||||
|
{
|
||||||
|
void RunDirectRoute(string sourceKey, string destinationKey);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// For rooms that default presentation only routing
|
/// For rooms that default presentation only routing
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
|
|
@ -50,6 +50,8 @@ namespace PepperDash.Essentials.DM
|
||||||
public BoolFeedback EnableUsbBreakawayFeedback { get; private set; }
|
public BoolFeedback EnableUsbBreakawayFeedback { get; private set; }
|
||||||
|
|
||||||
public Dictionary<uint, IntFeedback> InputCardHdcpStateFeedbacks { get; private set; }
|
public Dictionary<uint, IntFeedback> InputCardHdcpStateFeedbacks { get; private set; }
|
||||||
|
public Dictionary<uint, IntFeedback> InputStreamCardStateFeedbacks { get; private set; }
|
||||||
|
public Dictionary<uint, IntFeedback> OutputStreamCardStateFeedbacks { get; private set; }
|
||||||
|
|
||||||
public Dictionary<uint, eHdcpCapabilityType> InputCardHdcpCapabilityTypes { get; private set; }
|
public Dictionary<uint, eHdcpCapabilityType> InputCardHdcpCapabilityTypes { get; private set; }
|
||||||
|
|
||||||
|
|
@ -224,6 +226,8 @@ namespace PepperDash.Essentials.DM
|
||||||
new BoolFeedback(() => (Chassis as DmMDMnxn).EnableUSBBreakawayFeedback.BoolValue);
|
new BoolFeedback(() => (Chassis as DmMDMnxn).EnableUSBBreakawayFeedback.BoolValue);
|
||||||
|
|
||||||
InputCardHdcpStateFeedbacks = new Dictionary<uint, IntFeedback>();
|
InputCardHdcpStateFeedbacks = new Dictionary<uint, IntFeedback>();
|
||||||
|
InputStreamCardStateFeedbacks = new Dictionary<uint, IntFeedback>();
|
||||||
|
OutputStreamCardStateFeedbacks = new Dictionary<uint, IntFeedback>();
|
||||||
InputCardHdcpCapabilityTypes = new Dictionary<uint, eHdcpCapabilityType>();
|
InputCardHdcpCapabilityTypes = new Dictionary<uint, eHdcpCapabilityType>();
|
||||||
|
|
||||||
for (uint x = 1; x <= Chassis.NumberOfOutputs; x++)
|
for (uint x = 1; x <= Chassis.NumberOfOutputs; x++)
|
||||||
|
|
@ -308,6 +312,33 @@ namespace PepperDash.Essentials.DM
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
OutputStreamCardStateFeedbacks[tempX] = new IntFeedback(() =>
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var outputCard = Chassis.Outputs[tempX];
|
||||||
|
|
||||||
|
if (outputCard.Card is DmcStroAV)
|
||||||
|
{
|
||||||
|
Debug.Console(2, "Found output stream card in slot: {0}.", tempX);
|
||||||
|
var streamCard = outputCard.Card as DmcStroAV;
|
||||||
|
if (streamCard.Control.StartFeedback.BoolValue == true)
|
||||||
|
return 1;
|
||||||
|
else if (streamCard.Control.StopFeedback.BoolValue == true)
|
||||||
|
return 2;
|
||||||
|
else if (streamCard.Control.PauseFeedback.BoolValue == true)
|
||||||
|
return 3;
|
||||||
|
else
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
catch (InvalidOperationException iopex)
|
||||||
|
{
|
||||||
|
Debug.Console(0, this, Debug.ErrorLogLevel.Warning, "Error adding output stream card in slot: {0}. Error: {1}", tempX, iopex);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Chassis.Inputs[tempX] != null)
|
if (Chassis.Inputs[tempX] != null)
|
||||||
|
|
@ -407,6 +438,33 @@ namespace PepperDash.Essentials.DM
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
InputStreamCardStateFeedbacks[tempX] = new IntFeedback(() =>
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var inputCard = Chassis.Inputs[tempX];
|
||||||
|
|
||||||
|
if (inputCard.Card is DmcStr)
|
||||||
|
{
|
||||||
|
Debug.Console(2, "Found input stream card in slot: {0}.", tempX);
|
||||||
|
var streamCard = inputCard.Card as DmcStr;
|
||||||
|
if (streamCard.Control.StartFeedback.BoolValue == true)
|
||||||
|
return 1;
|
||||||
|
else if (streamCard.Control.StopFeedback.BoolValue == true)
|
||||||
|
return 2;
|
||||||
|
else if (streamCard.Control.PauseFeedback.BoolValue == true)
|
||||||
|
return 3;
|
||||||
|
else
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
catch (InvalidOperationException iopex)
|
||||||
|
{
|
||||||
|
Debug.Console(0, this, Debug.ErrorLogLevel.Warning, "Error adding input stream card in slot: {0}. Error: {1}", tempX, iopex);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -916,6 +974,19 @@ namespace PepperDash.Essentials.DM
|
||||||
Debug.Console(1, this, "No index of {0} found in InputCardHdcpCapabilityFeedbacks");
|
Debug.Console(1, this, "No index of {0} found in InputCardHdcpCapabilityFeedbacks");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case DMInputEventIds.StartEventId:
|
||||||
|
case DMInputEventIds.StopEventId:
|
||||||
|
case DMInputEventIds.PauseEventId:
|
||||||
|
{
|
||||||
|
Debug.Console(2, this, "DM Input {0} Stream Status EventId", args.Number);
|
||||||
|
if (InputStreamCardStateFeedbacks[args.Number] != null)
|
||||||
|
{
|
||||||
|
InputStreamCardStateFeedbacks[args.Number].FireUpdate();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
Debug.Console(2, this, "No index of {0} found in InputStreamCardStateFeedbacks");
|
||||||
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
Debug.Console(2, this, "DMInputChange fired for Input {0} with Unhandled EventId: {1}", args.Number, args.EventId);
|
Debug.Console(2, this, "DMInputChange fired for Input {0} with Unhandled EventId: {1}", args.Number, args.EventId);
|
||||||
|
|
@ -1044,6 +1115,19 @@ namespace PepperDash.Essentials.DM
|
||||||
OutputDisabledByHdcpFeedbacks[args.Number].FireUpdate();
|
OutputDisabledByHdcpFeedbacks[args.Number].FireUpdate();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case DMOutputEventIds.StartEventId:
|
||||||
|
case DMOutputEventIds.StopEventId:
|
||||||
|
case DMOutputEventIds.PauseEventId:
|
||||||
|
{
|
||||||
|
Debug.Console(2, this, "DM Output {0} Stream Status EventId", args.Number);
|
||||||
|
if (OutputStreamCardStateFeedbacks[args.Number] != null)
|
||||||
|
{
|
||||||
|
OutputStreamCardStateFeedbacks[args.Number].FireUpdate();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
Debug.Console(2, this, "No index of {0} found in OutputStreamCardStateFeedbacks");
|
||||||
|
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);
|
||||||
|
|
@ -1243,12 +1327,15 @@ namespace PepperDash.Essentials.DM
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
LinkHdmiInputToApi(trilist, ioSlot, joinMap, ioSlotJoin);
|
LinkHdmiInputToApi(trilist, ioSlot, joinMap, ioSlotJoin);
|
||||||
|
LinkStreamInputToApi(trilist, ioSlot, joinMap, ioSlotJoin);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (RxDictionary.ContainsKey(ioSlot))
|
if (RxDictionary.ContainsKey(ioSlot))
|
||||||
{
|
{
|
||||||
LinkRxToApi(trilist, ioSlot, joinMap, ioSlotJoin);
|
LinkRxToApi(trilist, ioSlot, joinMap, ioSlotJoin);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
LinkStreamOutputToApi(trilist, ioSlot, joinMap, ioSlotJoin);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1297,6 +1384,86 @@ namespace PepperDash.Essentials.DM
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void LinkStreamInputToApi(BasicTriList trilist, uint ioSlot, DmChassisControllerJoinMap joinMap, uint ioSlotJoin)
|
||||||
|
{
|
||||||
|
var inputPort = InputPorts[string.Format("inputCard{0}--streamIn", ioSlot)];
|
||||||
|
if (inputPort == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var streamCard = Chassis.Inputs[ioSlot].Card as DmcStr;
|
||||||
|
var join = joinMap.InputStreamCardState.JoinNumber + ioSlotJoin;
|
||||||
|
|
||||||
|
Debug.Console(1, "Port value for input card {0} is set as a stream card", ioSlot);
|
||||||
|
|
||||||
|
trilist.SetUShortSigAction(join, s =>
|
||||||
|
{
|
||||||
|
if (s == 1)
|
||||||
|
{
|
||||||
|
Debug.Console(2, this, "Join {0} value {1}: Setting stream state to start", join, s);
|
||||||
|
streamCard.Control.Start();
|
||||||
|
}
|
||||||
|
else if (s == 2)
|
||||||
|
{
|
||||||
|
Debug.Console(2, this, "Join {0} value {1}: Setting stream state to stop", join, s);
|
||||||
|
streamCard.Control.Stop();
|
||||||
|
}
|
||||||
|
else if (s == 3)
|
||||||
|
{
|
||||||
|
Debug.Console(2, this, "Join {0} value {1}: Setting stream state to pause", join, s);
|
||||||
|
streamCard.Control.Pause();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Debug.Console(2, this, "Join {0} value {1}: Ignore stream state", join, s);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
InputStreamCardStateFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[join]);
|
||||||
|
|
||||||
|
trilist.UShortInput[join].UShortValue = InputStreamCardStateFeedbacks[ioSlot].UShortValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void LinkStreamOutputToApi(BasicTriList trilist, uint ioSlot, DmChassisControllerJoinMap joinMap, uint ioSlotJoin)
|
||||||
|
{
|
||||||
|
var outputPort = OutputPorts[string.Format("outputCard{0}--streamOut", ioSlot)];
|
||||||
|
if (outputPort == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var streamCard = Chassis.Outputs[ioSlot].Card as DmcStroAV;
|
||||||
|
var join = joinMap.OutputStreamCardState.JoinNumber + ioSlotJoin;
|
||||||
|
|
||||||
|
Debug.Console(1, "Port value for output card {0} is set as a stream card", ioSlot);
|
||||||
|
|
||||||
|
trilist.SetUShortSigAction(join, s =>
|
||||||
|
{
|
||||||
|
if (s == 1)
|
||||||
|
{
|
||||||
|
Debug.Console(2, this, "Join {0} value {1}: Setting stream state to start", join, s);
|
||||||
|
streamCard.Control.Start();
|
||||||
|
}
|
||||||
|
else if (s == 2)
|
||||||
|
{
|
||||||
|
Debug.Console(2, this, "Join {0} value {1}: Setting stream state to stop", join, s);
|
||||||
|
streamCard.Control.Stop();
|
||||||
|
}
|
||||||
|
else if (s == 3)
|
||||||
|
{
|
||||||
|
Debug.Console(2, this, "Join {0} value {1}: Setting stream state to pause", join, s);
|
||||||
|
streamCard.Control.Pause();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Debug.Console(2, this, "Join {0} value {1}: Ignore stream state", join, s);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
OutputStreamCardStateFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[join]);
|
||||||
|
|
||||||
|
trilist.UShortInput[join].UShortValue = OutputStreamCardStateFeedbacks[ioSlot].UShortValue;
|
||||||
|
}
|
||||||
|
|
||||||
private void LinkRxToApi(BasicTriList trilist, uint ioSlot, DmChassisControllerJoinMap joinMap, uint ioSlotJoin)
|
private void LinkRxToApi(BasicTriList trilist, uint ioSlot, DmChassisControllerJoinMap joinMap, uint ioSlotJoin)
|
||||||
{
|
{
|
||||||
Debug.Console(2, "Creating Rx Feedbacks {0}", ioSlot);
|
Debug.Console(2, "Creating Rx Feedbacks {0}", ioSlot);
|
||||||
|
|
|
||||||
|
|
@ -39,12 +39,12 @@ namespace PepperDash.Essentials.DM.Endpoints.DGEs
|
||||||
{
|
{
|
||||||
_dge = device;
|
_dge = device;
|
||||||
_dgeEthernetInfo = _dge.ExtenderEthernetReservedSigs;
|
_dgeEthernetInfo = _dge.ExtenderEthernetReservedSigs;
|
||||||
_dgeEthernetInfo.DeviceExtenderSigChange += (extender, args) => UpdateDeviceInfo();
|
//_dgeEthernetInfo.DeviceExtenderSigChange += (extender, args) => UpdateDeviceInfo();
|
||||||
_dgeEthernetInfo.Use();
|
_dgeEthernetInfo.Use();
|
||||||
|
|
||||||
DeviceInfo = new DeviceInfo();
|
DeviceInfo = new DeviceInfo();
|
||||||
|
|
||||||
_dge.OnlineStatusChange += (currentDevice, args) => { if (args.DeviceOnLine) UpdateDeviceInfo(); };
|
//_dge.OnlineStatusChange += (currentDevice, args) => { if (args.DeviceOnLine) UpdateDeviceInfo(); };
|
||||||
|
|
||||||
_dc = dc;
|
_dc = dc;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -259,29 +259,35 @@ namespace PepperDash.Essentials.DM
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
{
|
{
|
||||||
ExecuteSwitch(eVst.Auto, null, eRoutingSignalType.Audio | eRoutingSignalType.Video);
|
ExecuteSwitch(eVst.Auto, null, type);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 1:
|
case 1:
|
||||||
{
|
{
|
||||||
ExecuteSwitch(HdmiIn1.Selector, null, eRoutingSignalType.Audio | eRoutingSignalType.Video);
|
ExecuteSwitch(HdmiIn1.Selector, null, type);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 2:
|
case 2:
|
||||||
{
|
{
|
||||||
ExecuteSwitch(HdmiIn2.Selector, null, eRoutingSignalType.Audio | eRoutingSignalType.Video);
|
ExecuteSwitch(HdmiIn2.Selector, null, type);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 3:
|
case 3:
|
||||||
{
|
{
|
||||||
ExecuteSwitch(DisplayPortIn.Selector, null, eRoutingSignalType.Audio | eRoutingSignalType.Video);
|
ExecuteSwitch(DisplayPortIn.Selector, null, type);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 4:
|
case 4:
|
||||||
{
|
{
|
||||||
ExecuteSwitch(eVst.AllDisabled, null, eRoutingSignalType.Audio | eRoutingSignalType.Video);
|
ExecuteSwitch(eVst.AllDisabled, null, type);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
Debug.Console(2, this, "Unable to execute numeric switch to input {0}", input);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -289,6 +295,9 @@ namespace PepperDash.Essentials.DM
|
||||||
|
|
||||||
public void ExecuteSwitch(object inputSelector, object outputSelector, eRoutingSignalType signalType)
|
public void ExecuteSwitch(object inputSelector, object outputSelector, eRoutingSignalType signalType)
|
||||||
{
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Debug.Console(2, this, "Attempting to switch InputSelector {0}", ((eVst)inputSelector).ToString());
|
||||||
if ((signalType | eRoutingSignalType.Video) == eRoutingSignalType.Video)
|
if ((signalType | eRoutingSignalType.Video) == eRoutingSignalType.Video)
|
||||||
Tx.VideoSource = (eVst)inputSelector;
|
Tx.VideoSource = (eVst)inputSelector;
|
||||||
|
|
||||||
|
|
@ -299,6 +308,11 @@ namespace PepperDash.Essentials.DM
|
||||||
Debug.Console(2, this, "Unable to execute audio-only switch for tx {0}", Key);
|
Debug.Console(2, this, "Unable to execute audio-only switch for tx {0}", Key);
|
||||||
//Tx.AudioSource = (eAst)inputSelector;
|
//Tx.AudioSource = (eAst)inputSelector;
|
||||||
}
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Debug.Console(2, this, "Exception in ExecuteSwitch: {0}", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void InputStreamChangeEvent(EndpointInputStream inputStream, EndpointInputStreamEventArgs args)
|
void InputStreamChangeEvent(EndpointInputStream inputStream, EndpointInputStreamEventArgs args)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -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))
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -65,12 +65,12 @@
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="SimplSharpCustomAttributesInterface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
<Reference Include="SimplSharpCustomAttributesInterface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||||
<SpecificVersion>False</SpecificVersion>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
<HintPath>..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpCustomAttributesInterface.dll</HintPath>
|
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpCustomAttributesInterface.dll</HintPath>
|
||||||
<Private>False</Private>
|
<Private>False</Private>
|
||||||
</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">
|
||||||
|
|
@ -79,7 +79,7 @@
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="SimplSharpPro, Version=1.5.3.17, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
<Reference Include="SimplSharpPro, Version=1.5.3.17, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||||
<SpecificVersion>False</SpecificVersion>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
<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">
|
<Reference Include="SimplSharpReflectionInterface, Version=1.0.5583.25238, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||||
|
|
@ -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" />
|
||||||
|
|
|
||||||
|
|
@ -69,12 +69,12 @@
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="SimplSharpCustomAttributesInterface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
<Reference Include="SimplSharpCustomAttributesInterface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||||
<SpecificVersion>False</SpecificVersion>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
<HintPath>..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpCustomAttributesInterface.dll</HintPath>
|
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpCustomAttributesInterface.dll</HintPath>
|
||||||
<Private>False</Private>
|
<Private>False</Private>
|
||||||
</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">
|
||||||
|
|
@ -83,7 +83,7 @@
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="SimplSharpPro, Version=1.5.3.17, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
<Reference Include="SimplSharpPro, Version=1.5.3.17, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||||
<SpecificVersion>False</SpecificVersion>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
<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">
|
<Reference Include="SimplSharpReflectionInterface, Version=1.0.5583.25238, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ namespace PepperDash.Essentials.Devices.Common
|
||||||
KeypadAccessoryButton1Label = "-";
|
KeypadAccessoryButton1Label = "-";
|
||||||
|
|
||||||
HasKeypadAccessoryButton2 = true;
|
HasKeypadAccessoryButton2 = true;
|
||||||
KeypadAccessoryButton2Command = "NumericEnter";
|
KeypadAccessoryButton2Command = "KEYPAD_ENTER";
|
||||||
KeypadAccessoryButton2Label = "Enter";
|
KeypadAccessoryButton2Label = "Enter";
|
||||||
|
|
||||||
AnyVideoOut = new RoutingOutputPort(RoutingPortNames.AnyVideoOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
|
AnyVideoOut = new RoutingOutputPort(RoutingPortNames.AnyVideoOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
|
||||||
|
|
|
||||||
|
|
@ -596,6 +596,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
||||||
trilist.SetBoolSigAction(joinMap.SourceShareAutoStart.JoinNumber, (b) => AutoShareContentWhileInCall = b);
|
trilist.SetBoolSigAction(joinMap.SourceShareAutoStart.JoinNumber, (b) => AutoShareContentWhileInCall = b);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO [ ] 2021-01-06, jkd: Added to debug OBTP dialing issues
|
||||||
|
private List<Meeting> _currentMeetings = new List<Meeting>();
|
||||||
|
|
||||||
private void LinkVideoCodecScheduleToApi(IHasScheduleAwareness codec, BasicTriList trilist, VideoCodecControllerJoinMap joinMap)
|
private void LinkVideoCodecScheduleToApi(IHasScheduleAwareness codec, BasicTriList trilist, VideoCodecControllerJoinMap joinMap)
|
||||||
{
|
{
|
||||||
trilist.SetSigFalseAction(joinMap.UpdateMeetings.JoinNumber, codec.GetSchedule);
|
trilist.SetSigFalseAction(joinMap.UpdateMeetings.JoinNumber, codec.GetSchedule);
|
||||||
|
|
@ -605,10 +608,39 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
||||||
codec.CodecSchedule.MeetingWarningMinutes = i;
|
codec.CodecSchedule.MeetingWarningMinutes = i;
|
||||||
});
|
});
|
||||||
|
|
||||||
codec.CodecSchedule.MeetingsListHasChanged += (sender, args) => UpdateMeetingsList(codec, trilist, joinMap);
|
// TODO [ ] 2021-01-06, jkd: Added to debug OBTP dialing issues
|
||||||
|
trilist.SetSigFalseAction(joinMap.DialMeeting1.JoinNumber, () =>
|
||||||
|
{
|
||||||
|
var mtg = 1;
|
||||||
|
var index = mtg - 1;
|
||||||
|
Debug.Console(1, this, "Meeting {0} Selected (EISC dig-o{1}) > _currentMeetings[{2}].Id: {3}, Title: {4}",
|
||||||
|
mtg, joinMap.DialMeeting1.JoinNumber, index, _currentMeetings[index].Id, _currentMeetings[index].Title);
|
||||||
|
if (_currentMeetings[index] != null)
|
||||||
|
Dial(_currentMeetings[index]);
|
||||||
|
});
|
||||||
|
// TODO [ ] 2021-01-06, jkd: Added to debug OBTP dialing issues
|
||||||
|
trilist.SetSigFalseAction(joinMap.DialMeeting2.JoinNumber, () =>
|
||||||
|
{
|
||||||
|
var mtg = 2;
|
||||||
|
var index = mtg - 1;
|
||||||
|
Debug.Console(1, this, "Meeting {0} Selected (EISC dig-o{1}) > _currentMeetings[{2}].Id: {3}, Title: {4}",
|
||||||
|
mtg, joinMap.DialMeeting2.JoinNumber, index, _currentMeetings[index].Id, _currentMeetings[index].Title);
|
||||||
|
if (_currentMeetings[index] != null)
|
||||||
|
Dial(_currentMeetings[index]);
|
||||||
|
});
|
||||||
|
// TODO [ ] 2021-01-06, jkd: Added to debug OBTP dialing issues
|
||||||
|
trilist.SetSigFalseAction(joinMap.DialMeeting3.JoinNumber, () =>
|
||||||
|
{
|
||||||
|
var mtg = 3;
|
||||||
|
var index = mtg - 1;
|
||||||
|
Debug.Console(1, this, "Meeting {0} Selected (EISC dig-o{1}) > _currentMeetings[{2}].Id: {3}, Title: {4}",
|
||||||
|
mtg, joinMap.DialMeeting3.JoinNumber, index, _currentMeetings[index].Id, _currentMeetings[index].Title);
|
||||||
|
if (_currentMeetings[index] != null)
|
||||||
|
Dial(_currentMeetings[index]);
|
||||||
|
});
|
||||||
|
|
||||||
codec.CodecSchedule.MeetingEventChange +=
|
codec.CodecSchedule.MeetingsListHasChanged += (sender, args) => UpdateMeetingsList(codec, trilist, joinMap);
|
||||||
(sender, args) =>
|
codec.CodecSchedule.MeetingEventChange += (sender, args) =>
|
||||||
{
|
{
|
||||||
if (args.ChangeType == eMeetingEventChangeType.MeetingStartWarning)
|
if (args.ChangeType == eMeetingEventChangeType.MeetingStartWarning)
|
||||||
{
|
{
|
||||||
|
|
@ -620,30 +652,18 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
||||||
private void UpdateMeetingsList(IHasScheduleAwareness codec, BasicTriList trilist, VideoCodecControllerJoinMap joinMap)
|
private void UpdateMeetingsList(IHasScheduleAwareness codec, BasicTriList trilist, VideoCodecControllerJoinMap joinMap)
|
||||||
{
|
{
|
||||||
var currentTime = DateTime.Now;
|
var currentTime = DateTime.Now;
|
||||||
var currentMeetings =
|
|
||||||
codec.CodecSchedule.Meetings.Where(m => m.StartTime >= currentTime || m.EndTime >= currentTime).ToList();
|
|
||||||
|
|
||||||
var meetingsData = UpdateMeetingsListXSig(currentMeetings);
|
// TODO [ ] 2021-01-06, jkd: Added to debug OBTP dialing issues
|
||||||
|
// - changed var currentMeetings >> field _currentMeetings
|
||||||
|
//_currentMeetings.Clear();
|
||||||
|
_currentMeetings = codec.CodecSchedule.Meetings.Where(m => m.StartTime >= currentTime || m.EndTime >= currentTime).ToList();
|
||||||
|
|
||||||
|
// TODO [ ] 2021-01-06, jkd: Added to debug OBTP dialing issues
|
||||||
|
// - moved the trilist.SetSigFlaseAction(joinMap.DialMeeting1..3.JoinNumber) lambda's to LinkVideoCodecScheduleToApi
|
||||||
|
|
||||||
|
var meetingsData = UpdateMeetingsListXSig(_currentMeetings);
|
||||||
trilist.SetString(joinMap.Schedule.JoinNumber, meetingsData);
|
trilist.SetString(joinMap.Schedule.JoinNumber, meetingsData);
|
||||||
|
trilist.SetUshort(joinMap.MeetingCount.JoinNumber, (ushort)_currentMeetings.Count);
|
||||||
trilist.SetSigFalseAction(joinMap.DialMeeting1.JoinNumber, () =>
|
|
||||||
{
|
|
||||||
if(codec.CodecSchedule.Meetings[0] != null)
|
|
||||||
Dial(codec.CodecSchedule.Meetings[0]);
|
|
||||||
});
|
|
||||||
trilist.SetSigFalseAction(joinMap.DialMeeting2.JoinNumber, () =>
|
|
||||||
{
|
|
||||||
if (codec.CodecSchedule.Meetings[1] != null)
|
|
||||||
Dial(codec.CodecSchedule.Meetings[1]);
|
|
||||||
});
|
|
||||||
trilist.SetSigFalseAction(joinMap.DialMeeting3.JoinNumber, () =>
|
|
||||||
{
|
|
||||||
if (codec.CodecSchedule.Meetings[2] != null)
|
|
||||||
Dial(codec.CodecSchedule.Meetings[2]);
|
|
||||||
});
|
|
||||||
|
|
||||||
trilist.SetUshort(joinMap.MeetingCount.JoinNumber, (ushort)currentMeetings.Count);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private string UpdateMeetingsListXSig(List<Meeting> meetings)
|
private string UpdateMeetingsListXSig(List<Meeting> meetings)
|
||||||
|
|
@ -669,6 +689,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
||||||
* Start Time - 4
|
* Start Time - 4
|
||||||
* End Date - 5
|
* End Date - 5
|
||||||
* End Time - 6
|
* End Time - 6
|
||||||
|
* Id - 7
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -681,7 +702,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
||||||
if (meetingIndex >= maxMeetings * offset)
|
if (meetingIndex >= maxMeetings * offset)
|
||||||
{
|
{
|
||||||
Debug.Console(2, this, "Max Meetings reached");
|
Debug.Console(2, this, "Max Meetings reached");
|
||||||
break;}
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
//digitals
|
//digitals
|
||||||
tokenArray[digitalIndex] = new XSigDigitalToken(digitalIndex + 1, meeting.Joinable);
|
tokenArray[digitalIndex] = new XSigDigitalToken(digitalIndex + 1, meeting.Joinable);
|
||||||
|
|
@ -826,7 +848,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
||||||
|
|
||||||
Debug.Console(1, this, "Call Direction: {0}", args.CallItem.Direction);
|
Debug.Console(1, this, "Call Direction: {0}", args.CallItem.Direction);
|
||||||
Debug.Console(1, this, "Call is incoming: {0}", args.CallItem.Direction == eCodecCallDirection.Incoming);
|
Debug.Console(1, this, "Call is incoming: {0}", args.CallItem.Direction == eCodecCallDirection.Incoming);
|
||||||
trilist.SetBool(joinMap.IncomingCall.JoinNumber, args.CallItem.Direction == eCodecCallDirection.Incoming && args.CallItem.Status != eCodecCallStatus.Disconnected);
|
trilist.SetBool(joinMap.IncomingCall.JoinNumber, args.CallItem.Direction == eCodecCallDirection.Incoming && args.CallItem.Status == eCodecCallStatus.Ringing);
|
||||||
|
|
||||||
if (args.CallItem.Direction == eCodecCallDirection.Incoming)
|
if (args.CallItem.Direction == eCodecCallDirection.Incoming)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -205,7 +205,14 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||||
|
|
||||||
protected Func<string> SelfviewPipPositionFeedbackFunc
|
protected Func<string> SelfviewPipPositionFeedbackFunc
|
||||||
{
|
{
|
||||||
get { return () => _currentSelfviewPipPosition.Command; }
|
get
|
||||||
|
{
|
||||||
|
return
|
||||||
|
() =>
|
||||||
|
_currentSelfviewPipPosition != null
|
||||||
|
? _currentSelfviewPipPosition.Command ?? "Unknown"
|
||||||
|
: "Unknown";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Func<string> LocalLayoutFeedbackFunc
|
protected Func<string> LocalLayoutFeedbackFunc
|
||||||
|
|
@ -1373,13 +1380,17 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private void UpdateCallStatus()
|
private void UpdateCallStatus()
|
||||||
{
|
{
|
||||||
|
Debug.Console(1, this, "[UpdateCallStatus] Current Call Status: {0}",
|
||||||
|
Status.Call != null ? Status.Call.Sharing.State.ToString() : "no call");
|
||||||
|
|
||||||
if (Status.Call != null)
|
if (Status.Call != null)
|
||||||
{
|
{
|
||||||
var callStatus = Status.Call.Status;
|
var callStatus = Status.Call.Status;
|
||||||
|
|
||||||
// If not currently in a meeting, intialize the call object
|
// If not currently in a meeting, intialize the call object
|
||||||
if (callStatus != zStatus.eCallStatus.IN_MEETING || callStatus != zStatus.eCallStatus.CONNECTING_MEETING)
|
if (callStatus != zStatus.eCallStatus.IN_MEETING && callStatus != zStatus.eCallStatus.CONNECTING_MEETING)
|
||||||
{
|
{
|
||||||
|
Debug.Console(1, this, "Creating new Status.Call object");
|
||||||
Status.Call = new zStatus.Call {Status = callStatus};
|
Status.Call = new zStatus.Call {Status = callStatus};
|
||||||
|
|
||||||
SetUpCallFeedbackActions();
|
SetUpCallFeedbackActions();
|
||||||
|
|
@ -1406,6 +1417,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||||
|
|
||||||
ActiveCalls.Add(newCall);
|
ActiveCalls.Add(newCall);
|
||||||
|
|
||||||
|
Debug.Console(1, this, "[UpdateCallStatus] Current Call Status: {0}",
|
||||||
|
Status.Call != null ? Status.Call.Sharing.State.ToString() : "no call");
|
||||||
|
|
||||||
OnCallStatusChange(newCall);
|
OnCallStatusChange(newCall);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1423,6 +1437,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Debug.Console(1, this, "[UpdateCallStatus] Current Call Status: {0}",
|
||||||
|
Status.Call != null ? Status.Call.Sharing.State.ToString() : "no call");
|
||||||
|
|
||||||
OnCallStatusChange(existingCall);
|
OnCallStatusChange(existingCall);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1460,6 +1477,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||||
{
|
{
|
||||||
base.OnCallStatusChange(item);
|
base.OnCallStatusChange(item);
|
||||||
|
|
||||||
|
Debug.Console(1, this, "[OnCallStatusChange] Current Call Status: {0}",
|
||||||
|
Status.Call != null ? Status.Call.Sharing.State.ToString() : "no call");
|
||||||
|
|
||||||
if (_props.AutoDefaultLayouts)
|
if (_props.AutoDefaultLayouts)
|
||||||
{
|
{
|
||||||
SetLayout();
|
SetLayout();
|
||||||
|
|
@ -1635,6 +1655,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||||
|
|
||||||
public override void Dial(Meeting meeting)
|
public override void Dial(Meeting meeting)
|
||||||
{
|
{
|
||||||
|
Debug.Console(1, this,"Dialing meeting.Id: {0} Title: {1}", meeting.Id, meeting.Title);
|
||||||
SendText(string.Format("zCommand Dial Start meetingNumber: {0}", meeting.Id));
|
SendText(string.Format("zCommand Dial Start meetingNumber: {0}", meeting.Id));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
<packages>
|
<packages>
|
||||||
<package id="PepperDashCore" version="1.0.43" targetFramework="net35" allowedVersions="[1.0,1.1)"/>
|
<package id="PepperDashCore" version="1.0.45" targetFramework="net35" allowedVersions="[1.0,1.1)"/>
|
||||||
</packages>
|
</packages>
|
||||||
Loading…
Add table
Add a link
Reference in a new issue