mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-13 11:44:54 +00:00
Merge branch 'development' into hotfix/videocodecbase-max-meeting-xsig-value-set
This commit is contained in:
@@ -28,6 +28,7 @@ namespace PepperDash.Essentials
|
|||||||
HttpLogoServer LogoServer;
|
HttpLogoServer LogoServer;
|
||||||
|
|
||||||
private CTimer _startTimer;
|
private CTimer _startTimer;
|
||||||
|
private CEvent _initializeEvent;
|
||||||
private const long StartupTime = 500;
|
private const long StartupTime = 500;
|
||||||
|
|
||||||
public ControlSystem()
|
public ControlSystem()
|
||||||
@@ -46,6 +47,24 @@ namespace PepperDash.Essentials
|
|||||||
public override void InitializeSystem()
|
public override void InitializeSystem()
|
||||||
{
|
{
|
||||||
_startTimer = new CTimer(StartSystem,StartupTime);
|
_startTimer = new CTimer(StartSystem,StartupTime);
|
||||||
|
|
||||||
|
|
||||||
|
// If the control system is a DMPS type, we need to wait to exit this method until all devices have had time to activate
|
||||||
|
// to allow any HD-BaseT DM endpoints to register first.
|
||||||
|
if (Global.ControlSystemIsDmpsType)
|
||||||
|
{
|
||||||
|
Debug.Console(2, "******************* InitializeSystem() Entering **********************");
|
||||||
|
|
||||||
|
_initializeEvent = new CEvent();
|
||||||
|
|
||||||
|
DeviceManager.AllDevicesActivated += (o, a) =>
|
||||||
|
{
|
||||||
|
_initializeEvent.Set();
|
||||||
|
Debug.Console(2, "******************* InitializeSystem() Exiting **********************");
|
||||||
|
};
|
||||||
|
|
||||||
|
_initializeEvent.Wait(30000);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void StartSystem(object obj)
|
private void StartSystem(object obj)
|
||||||
@@ -361,9 +380,7 @@ namespace PepperDash.Essentials
|
|||||||
if(propertiesConfig == null)
|
if(propertiesConfig == null)
|
||||||
propertiesConfig = new DM.Config.DmpsRoutingPropertiesConfig();
|
propertiesConfig = new DM.Config.DmpsRoutingPropertiesConfig();
|
||||||
|
|
||||||
var dmpsRoutingController = DmpsRoutingController.GetDmpsRoutingController("processor-avRouting", this.ControllerPrompt, propertiesConfig);
|
DeviceManager.AddDevice(DmpsRoutingController.GetDmpsRoutingController("processor-avRouting", this.ControllerPrompt, propertiesConfig));
|
||||||
|
|
||||||
DeviceManager.AddDevice(dmpsRoutingController);
|
|
||||||
}
|
}
|
||||||
else if (this.ControllerPrompt.IndexOf("mpc3", StringComparison.OrdinalIgnoreCase) > -1)
|
else if (this.ControllerPrompt.IndexOf("mpc3", StringComparison.OrdinalIgnoreCase) > -1)
|
||||||
{
|
{
|
||||||
@@ -450,14 +467,13 @@ namespace PepperDash.Essentials
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint fusionIpId = 0xf1;
|
||||||
|
|
||||||
foreach (var roomConfig in ConfigReader.ConfigObject.Rooms)
|
foreach (var roomConfig in ConfigReader.ConfigObject.Rooms)
|
||||||
{
|
{
|
||||||
var room = EssentialsRoomConfigHelper.GetRoomObject(roomConfig) as IEssentialsRoom;
|
var room = EssentialsRoomConfigHelper.GetRoomObject(roomConfig) as IEssentialsRoom;
|
||||||
if (room != null)
|
if (room != null)
|
||||||
{
|
{
|
||||||
// default IPID
|
|
||||||
uint fusionIpId = 0xf1;
|
|
||||||
|
|
||||||
// default to no join map key
|
// default to no join map key
|
||||||
string fusionJoinMapKey = string.Empty;
|
string fusionJoinMapKey = string.Empty;
|
||||||
|
|
||||||
@@ -478,7 +494,7 @@ namespace PepperDash.Essentials
|
|||||||
{
|
{
|
||||||
DeviceManager.AddDevice(room);
|
DeviceManager.AddDevice(room);
|
||||||
|
|
||||||
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 with IP-ID {0:X2}", fusionIpId);
|
||||||
DeviceManager.AddDevice(new Core.Fusion.EssentialsHuddleSpaceFusionSystemControllerBase(room, fusionIpId, fusionJoinMapKey));
|
DeviceManager.AddDevice(new Core.Fusion.EssentialsHuddleSpaceFusionSystemControllerBase(room, fusionIpId, fusionJoinMapKey));
|
||||||
|
|
||||||
|
|
||||||
@@ -490,7 +506,7 @@ namespace PepperDash.Essentials
|
|||||||
{
|
{
|
||||||
DeviceManager.AddDevice(room);
|
DeviceManager.AddDevice(room);
|
||||||
|
|
||||||
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 with IP-ID {0:X2}", fusionIpId);
|
||||||
DeviceManager.AddDevice(new EssentialsHuddleVtc1FusionController((IEssentialsHuddleVtc1Room)room, fusionIpId, fusionJoinMapKey));
|
DeviceManager.AddDevice(new EssentialsHuddleVtc1FusionController((IEssentialsHuddleVtc1Room)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...");
|
||||||
@@ -502,7 +518,7 @@ namespace PepperDash.Essentials
|
|||||||
DeviceManager.AddDevice(room);
|
DeviceManager.AddDevice(room);
|
||||||
|
|
||||||
Debug.Console(0, Debug.ErrorLogLevel.Notice,
|
Debug.Console(0, Debug.ErrorLogLevel.Notice,
|
||||||
"Room is EssentialsTechRoom, Attempting to add to DeviceManager with Fusion");
|
"Room is EssentialsTechRoom, Attempting to add to DeviceManager with Fusion with IP-ID {0:X2}", fusionIpId);
|
||||||
DeviceManager.AddDevice(new EssentialsTechRoomFusionSystemController((EssentialsTechRoom)room, fusionIpId, fusionJoinMapKey));
|
DeviceManager.AddDevice(new EssentialsTechRoomFusionSystemController((EssentialsTechRoom)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");
|
||||||
@@ -515,9 +531,13 @@ namespace PepperDash.Essentials
|
|||||||
DeviceManager.AddDevice(room);
|
DeviceManager.AddDevice(room);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fusionIpId += 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Notice: Cannot create room from config, key '{0}' - Is this intentional? This may be a valid configuration.", roomConfig.Key);
|
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Notice: Cannot create room from config, key '{0}' - Is this intentional? This may be a valid configuration.", roomConfig.Key);
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "All Rooms Loaded.");
|
Debug.Console(0, Debug.ErrorLogLevel.Notice, "All Rooms Loaded.");
|
||||||
|
|||||||
@@ -150,7 +150,7 @@ namespace PepperDash.Essentials.Fusion
|
|||||||
|
|
||||||
protected override void CreateSymbolAndBasicSigs(uint ipId)
|
protected override void CreateSymbolAndBasicSigs(uint ipId)
|
||||||
{
|
{
|
||||||
Debug.Console(1, this, "Creating Fusion Room symbol with GUID: {0}", RoomGuid);
|
Debug.Console(0, this, "Creating Fusion Room symbol with GUID: {0} and IP-ID {1:X2}", RoomGuid, ipId);
|
||||||
|
|
||||||
FusionRoom = new FusionRoom(ipId, Global.ControlSystem, Room.Name, RoomGuid);
|
FusionRoom = new FusionRoom(ipId, Global.ControlSystem, Room.Name, RoomGuid);
|
||||||
FusionRoom.ExtenderRoomViewSchedulingDataReservedSigs.Use();
|
FusionRoom.ExtenderRoomViewSchedulingDataReservedSigs.Use();
|
||||||
|
|||||||
@@ -149,7 +149,8 @@
|
|||||||
<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="Room\Types\EssentialsTechRoom.cs" />
|
||||||
<Compile Include="Room\Types\IEssentialsHuddleSpaceRoom.cs" />
|
<Compile Include="Room\Types\Interfaces\IEssentialsHuddleSpaceRoom.cs" />
|
||||||
|
<Compile Include="Room\Types\Interfaces\IEssentialsHuddleVtc1Room.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" />
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
using System;
|
||||||
|
|
||||||
|
using PepperDash.Essentials.Core;
|
||||||
|
using PepperDash.Essentials.Room.Config;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials
|
||||||
|
{
|
||||||
|
public interface IEssentialsHuddleSpaceRoom : IEssentialsRoom, IHasCurrentSourceInfoChange, IRunRouteAction, IRunDefaultPresentRoute, IHasDefaultDisplay
|
||||||
|
{
|
||||||
|
bool ExcludeFromGlobalFunctions { get; }
|
||||||
|
|
||||||
|
void RunRouteAction(string routeKey);
|
||||||
|
|
||||||
|
EssentialsHuddleRoomPropertiesConfig PropertiesConfig { get; }
|
||||||
|
|
||||||
|
IBasicVolumeControls CurrentVolumeControls { get; }
|
||||||
|
|
||||||
|
event EventHandler<VolumeDeviceChangeEventArgs> CurrentVolumeDeviceChange;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
|
||||||
|
using PepperDash.Essentials.Core;
|
||||||
|
using PepperDash.Essentials.Room.Config;
|
||||||
|
using PepperDash.Essentials.Devices.Common.Codec;
|
||||||
|
using PepperDash.Essentials.Devices.Common.VideoCodec;
|
||||||
|
using PepperDash.Essentials.Devices.Common.AudioCodec;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials
|
||||||
|
{
|
||||||
|
public interface IEssentialsHuddleVtc1Room : IEssentialsRoom, IHasCurrentSourceInfoChange,
|
||||||
|
IPrivacy, IHasCurrentVolumeControls, IRunRouteAction, IRunDefaultCallRoute, IHasVideoCodec, IHasAudioCodec, IHasDefaultDisplay, IHasInCallFeedback
|
||||||
|
{
|
||||||
|
EssentialsHuddleVtc1PropertiesConfig PropertiesConfig { get; }
|
||||||
|
|
||||||
|
void RunRouteAction(string routeKey);
|
||||||
|
|
||||||
|
IHasScheduleAwareness ScheduleSource { get; }
|
||||||
|
|
||||||
|
new BoolFeedback InCallFeedback { get; }
|
||||||
|
|
||||||
|
new BoolFeedback PrivacyModeIsOnFeedback { get; }
|
||||||
|
|
||||||
|
string DefaultCodecRouteString { get; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,326 +1,326 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
using Crestron.SimplSharpPro.DeviceSupport;
|
using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
|
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials;
|
using PepperDash.Essentials;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
using PepperDash.Essentials.Core.Config;
|
using PepperDash.Essentials.Core.Config;
|
||||||
using PepperDash.Essentials.Core.SmartObjects;
|
using PepperDash.Essentials.Core.SmartObjects;
|
||||||
using PepperDash.Essentials.Core.Touchpanels.Keyboards;
|
using PepperDash.Essentials.Core.Touchpanels.Keyboards;
|
||||||
using PepperDash.Essentials.Devices.Displays;
|
using PepperDash.Essentials.Devices.Displays;
|
||||||
using PepperDash.Essentials.Room.Config;
|
using PepperDash.Essentials.Room.Config;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.UIDrivers
|
namespace PepperDash.Essentials.UIDrivers
|
||||||
{
|
{
|
||||||
public class EssentialsHuddleTechPageDriver : PanelDriverBase
|
public class EssentialsHuddleTechPageDriver : PanelDriverBase
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
SmartObjectDynamicList MenuList;
|
SmartObjectDynamicList MenuList;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
SubpageReferenceList StatusList;
|
SubpageReferenceList StatusList;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The list of display controls
|
/// The list of display controls
|
||||||
/// </summary>
|
/// </summary>
|
||||||
SubpageReferenceList DisplayList;
|
SubpageReferenceList DisplayList;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// References lines in the list against device instances
|
/// References lines in the list against device instances
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Dictionary<ICommunicationMonitor, uint> StatusListDeviceIndexes;
|
Dictionary<ICommunicationMonitor, uint> StatusListDeviceIndexes;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
JoinedSigInterlock PagesInterlock;
|
JoinedSigInterlock PagesInterlock;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 1
|
/// 1
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public const uint JoinText = 1;
|
public const uint JoinText = 1;
|
||||||
|
|
||||||
CTimer PinAuthorizedTimer;
|
CTimer PinAuthorizedTimer;
|
||||||
|
|
||||||
EssentialsRoomTechConfig Config;
|
EssentialsRoomTechConfig Config;
|
||||||
|
|
||||||
StringBuilder PinEntryBuilder = new StringBuilder(4);
|
StringBuilder PinEntryBuilder = new StringBuilder(4);
|
||||||
|
|
||||||
bool IsAuthorized;
|
bool IsAuthorized;
|
||||||
|
|
||||||
SmartObjectNumeric PinKeypad;
|
SmartObjectNumeric PinKeypad;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="trilist"></param>
|
/// <param name="trilist"></param>
|
||||||
/// <param name="parent"></param>
|
/// <param name="parent"></param>
|
||||||
public EssentialsHuddleTechPageDriver(BasicTriListWithSmartObject trilist, EssentialsRoomTechConfig config)
|
public EssentialsHuddleTechPageDriver(BasicTriListWithSmartObject trilist, EssentialsRoomTechConfig config)
|
||||||
: base(trilist)
|
: base(trilist)
|
||||||
{
|
{
|
||||||
Config = config;
|
Config = config;
|
||||||
|
|
||||||
PagesInterlock = new JoinedSigInterlock(trilist);
|
PagesInterlock = new JoinedSigInterlock(trilist);
|
||||||
PagesInterlock.SetButDontShow(UIBoolJoin.TechSystemStatusVisible);
|
PagesInterlock.SetButDontShow(UIBoolJoin.TechSystemStatusVisible);
|
||||||
|
|
||||||
trilist.SetSigFalseAction(UIBoolJoin.TechExitButton, Hide);
|
trilist.SetSigFalseAction(UIBoolJoin.TechExitButton, Hide);
|
||||||
|
|
||||||
MenuList = new SmartObjectDynamicList(trilist.SmartObjects[UISmartObjectJoin.TechMenuList],
|
MenuList = new SmartObjectDynamicList(trilist.SmartObjects[UISmartObjectJoin.TechMenuList],
|
||||||
true, 3100);
|
true, 3100);
|
||||||
|
|
||||||
MenuList.SetFeedback(1, true); // initial fb
|
MenuList.SetFeedback(1, true); // initial fb
|
||||||
ushort count = 0;
|
ushort count = 0;
|
||||||
|
|
||||||
MenuList.SetItemMainText(1, "System Status");
|
MenuList.SetItemMainText(1, "System Status");
|
||||||
MenuList.SetItemButtonAction(1, b => {
|
MenuList.SetItemButtonAction(1, b => {
|
||||||
if (b) PagesInterlock.ShowInterlocked(UIBoolJoin.TechSystemStatusVisible);
|
if (b) PagesInterlock.ShowInterlocked(UIBoolJoin.TechSystemStatusVisible);
|
||||||
MenuList.SetFeedback(1, true);
|
MenuList.SetFeedback(1, true);
|
||||||
});
|
});
|
||||||
|
|
||||||
MenuList.SetItemMainText(2, "Display Controls");
|
MenuList.SetItemMainText(2, "Display Controls");
|
||||||
MenuList.SetItemButtonAction(2, b => {
|
MenuList.SetItemButtonAction(2, b => {
|
||||||
if (b) PagesInterlock.ShowInterlocked(UIBoolJoin.TechDisplayControlsVisible);
|
if (b) PagesInterlock.ShowInterlocked(UIBoolJoin.TechDisplayControlsVisible);
|
||||||
MenuList.SetFeedback(2, true);
|
MenuList.SetFeedback(2, true);
|
||||||
});
|
});
|
||||||
|
|
||||||
count = 2;
|
count = 2;
|
||||||
|
|
||||||
// Don't show panel setup on iPad or xpanel
|
// Don't show panel setup on iPad or xpanel
|
||||||
if (TriList is Crestron.SimplSharpPro.DeviceSupport.TswFt5Button)
|
if (TriList is Crestron.SimplSharpPro.DeviceSupport.TswFt5Button)
|
||||||
{
|
{
|
||||||
count++;
|
count++;
|
||||||
MenuList.SetItemMainText(count, "Panel Setup");
|
MenuList.SetItemMainText(count, "Panel Setup");
|
||||||
MenuList.SetItemButtonAction(count, b =>
|
MenuList.SetItemButtonAction(count, b =>
|
||||||
{
|
{
|
||||||
if (b) PagesInterlock.ShowInterlocked(UIBoolJoin.TechPanelSetupVisible);
|
if (b) PagesInterlock.ShowInterlocked(UIBoolJoin.TechPanelSetupVisible);
|
||||||
MenuList.SetFeedback(count, true);
|
MenuList.SetFeedback(count, true);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
MenuList.Count = count;
|
MenuList.Count = count;
|
||||||
BuildStatusList();
|
BuildStatusList();
|
||||||
BuildDisplayList();
|
BuildDisplayList();
|
||||||
SetupPinModal();
|
SetupPinModal();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public override void Show()
|
public override void Show()
|
||||||
{
|
{
|
||||||
// divert to PIN if we need auth
|
// divert to PIN if we need auth
|
||||||
if (IsAuthorized)
|
if (IsAuthorized)
|
||||||
{
|
{
|
||||||
// Cancel the auth timer so we don't deauth after coming back in
|
// Cancel the auth timer so we don't deauth after coming back in
|
||||||
if (PinAuthorizedTimer != null)
|
if (PinAuthorizedTimer != null)
|
||||||
PinAuthorizedTimer.Stop();
|
PinAuthorizedTimer.Stop();
|
||||||
|
|
||||||
TriList.SetBool(UIBoolJoin.TechCommonItemsVisbible, true);
|
TriList.SetBool(UIBoolJoin.TechCommonItemsVisbible, true);
|
||||||
PagesInterlock.Show();
|
PagesInterlock.Show();
|
||||||
base.Show();
|
base.Show();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
TriList.SetBool(UIBoolJoin.PinDialog4DigitVisible, true);
|
TriList.SetBool(UIBoolJoin.PinDialog4DigitVisible, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public override void Hide()
|
public override void Hide()
|
||||||
{
|
{
|
||||||
// Leave it authorized for 60 seconds.
|
// Leave it authorized for 60 seconds.
|
||||||
if (IsAuthorized)
|
if (IsAuthorized)
|
||||||
PinAuthorizedTimer = new CTimer(o => {
|
PinAuthorizedTimer = new CTimer(o => {
|
||||||
IsAuthorized = false;
|
IsAuthorized = false;
|
||||||
PinAuthorizedTimer = null;
|
PinAuthorizedTimer = null;
|
||||||
}, 60000);
|
}, 60000);
|
||||||
TriList.SetBool(UIBoolJoin.TechCommonItemsVisbible, false);
|
TriList.SetBool(UIBoolJoin.TechCommonItemsVisbible, false);
|
||||||
PagesInterlock.Hide();
|
PagesInterlock.Hide();
|
||||||
base.Hide();
|
base.Hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Wire up the keypad and buttons
|
/// Wire up the keypad and buttons
|
||||||
/// </summary>
|
/// </summary>
|
||||||
void SetupPinModal()
|
void SetupPinModal()
|
||||||
{
|
{
|
||||||
TriList.SetSigFalseAction(UIBoolJoin.PinDialogCancelPress, CancelPinDialog);
|
TriList.SetSigFalseAction(UIBoolJoin.PinDialogCancelPress, CancelPinDialog);
|
||||||
PinKeypad = new SmartObjectNumeric(TriList.SmartObjects[UISmartObjectJoin.TechPinDialogKeypad], true);
|
PinKeypad = new SmartObjectNumeric(TriList.SmartObjects[UISmartObjectJoin.TechPinDialogKeypad], true);
|
||||||
PinKeypad.Digit0.UserObject = new Action<bool>(b => { if (b)DialPinDigit('0'); });
|
PinKeypad.Digit0.UserObject = new Action<bool>(b => { if (b)DialPinDigit('0'); });
|
||||||
PinKeypad.Digit1.UserObject = new Action<bool>(b => { if (b)DialPinDigit('1'); });
|
PinKeypad.Digit1.UserObject = new Action<bool>(b => { if (b)DialPinDigit('1'); });
|
||||||
PinKeypad.Digit2.UserObject = new Action<bool>(b => { if (b)DialPinDigit('2'); });
|
PinKeypad.Digit2.UserObject = new Action<bool>(b => { if (b)DialPinDigit('2'); });
|
||||||
PinKeypad.Digit3.UserObject = new Action<bool>(b => { if (b)DialPinDigit('3'); });
|
PinKeypad.Digit3.UserObject = new Action<bool>(b => { if (b)DialPinDigit('3'); });
|
||||||
PinKeypad.Digit4.UserObject = new Action<bool>(b => { if (b)DialPinDigit('4'); });
|
PinKeypad.Digit4.UserObject = new Action<bool>(b => { if (b)DialPinDigit('4'); });
|
||||||
PinKeypad.Digit5.UserObject = new Action<bool>(b => { if (b)DialPinDigit('5'); });
|
PinKeypad.Digit5.UserObject = new Action<bool>(b => { if (b)DialPinDigit('5'); });
|
||||||
PinKeypad.Digit6.UserObject = new Action<bool>(b => { if (b)DialPinDigit('6'); });
|
PinKeypad.Digit6.UserObject = new Action<bool>(b => { if (b)DialPinDigit('6'); });
|
||||||
PinKeypad.Digit7.UserObject = new Action<bool>(b => { if (b)DialPinDigit('7'); });
|
PinKeypad.Digit7.UserObject = new Action<bool>(b => { if (b)DialPinDigit('7'); });
|
||||||
PinKeypad.Digit8.UserObject = new Action<bool>(b => { if (b)DialPinDigit('8'); });
|
PinKeypad.Digit8.UserObject = new Action<bool>(b => { if (b)DialPinDigit('8'); });
|
||||||
PinKeypad.Digit9.UserObject = new Action<bool>(b => { if (b)DialPinDigit('9'); });
|
PinKeypad.Digit9.UserObject = new Action<bool>(b => { if (b)DialPinDigit('9'); });
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="d"></param>
|
/// <param name="d"></param>
|
||||||
void DialPinDigit(char d)
|
void DialPinDigit(char d)
|
||||||
{
|
{
|
||||||
PinEntryBuilder.Append(d);
|
PinEntryBuilder.Append(d);
|
||||||
var len = PinEntryBuilder.Length;
|
var len = PinEntryBuilder.Length;
|
||||||
SetPinDotsFeedback(len);
|
SetPinDotsFeedback(len);
|
||||||
|
|
||||||
// check it!
|
// check it!
|
||||||
if (len == 4)
|
if (len == 4)
|
||||||
{
|
{
|
||||||
if (Config.Password == PinEntryBuilder.ToString())
|
if (Config.Password == PinEntryBuilder.ToString())
|
||||||
{
|
{
|
||||||
IsAuthorized = true;
|
IsAuthorized = true;
|
||||||
SetPinDotsFeedback(0);
|
SetPinDotsFeedback(0);
|
||||||
TriList.SetBool(UIBoolJoin.PinDialog4DigitVisible, false);
|
TriList.SetBool(UIBoolJoin.PinDialog4DigitVisible, false);
|
||||||
Show();
|
Show();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SetPinDotsFeedback(0);
|
SetPinDotsFeedback(0);
|
||||||
TriList.SetBool(UIBoolJoin.PinDialogErrorVisible, true);
|
TriList.SetBool(UIBoolJoin.PinDialogErrorVisible, true);
|
||||||
new CTimer(o =>
|
new CTimer(o =>
|
||||||
{
|
{
|
||||||
TriList.SetBool(UIBoolJoin.PinDialogErrorVisible, false);
|
TriList.SetBool(UIBoolJoin.PinDialogErrorVisible, false);
|
||||||
}, 1500);
|
}, 1500);
|
||||||
}
|
}
|
||||||
|
|
||||||
PinEntryBuilder.Remove(0, len); // clear it either way
|
PinEntryBuilder.Remove(0, len); // clear it either way
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Draws the dots as pin is entered
|
/// Draws the dots as pin is entered
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="len"></param>
|
/// <param name="len"></param>
|
||||||
void SetPinDotsFeedback(int len)
|
void SetPinDotsFeedback(int len)
|
||||||
{
|
{
|
||||||
TriList.SetBool(UIBoolJoin.PinDialogDot1, len >= 1);
|
TriList.SetBool(UIBoolJoin.PinDialogDot1, len >= 1);
|
||||||
TriList.SetBool(UIBoolJoin.PinDialogDot2, len >= 2);
|
TriList.SetBool(UIBoolJoin.PinDialogDot2, len >= 2);
|
||||||
TriList.SetBool(UIBoolJoin.PinDialogDot3, len >= 3);
|
TriList.SetBool(UIBoolJoin.PinDialogDot3, len >= 3);
|
||||||
TriList.SetBool(UIBoolJoin.PinDialogDot4, len == 4);
|
TriList.SetBool(UIBoolJoin.PinDialogDot4, len == 4);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Does what it says
|
/// Does what it says
|
||||||
/// </summary>
|
/// </summary>
|
||||||
void CancelPinDialog()
|
void CancelPinDialog()
|
||||||
{
|
{
|
||||||
PinEntryBuilder.Remove(0, PinEntryBuilder.Length);
|
PinEntryBuilder.Remove(0, PinEntryBuilder.Length);
|
||||||
TriList.SetBool(UIBoolJoin.PinDialog4DigitVisible, false);
|
TriList.SetBool(UIBoolJoin.PinDialog4DigitVisible, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
void BuildStatusList()
|
void BuildStatusList()
|
||||||
{
|
{
|
||||||
StatusList = new SubpageReferenceList(TriList, UISmartObjectJoin.TechStatusList, 3, 3, 3);
|
StatusList = new SubpageReferenceList(TriList, UISmartObjectJoin.TechStatusList, 3, 3, 3);
|
||||||
StatusListDeviceIndexes = new Dictionary<ICommunicationMonitor, uint>();
|
StatusListDeviceIndexes = new Dictionary<ICommunicationMonitor, uint>();
|
||||||
uint i = 0;
|
uint i = 0;
|
||||||
foreach (var d in DeviceManager.AllDevices)
|
foreach (var d in DeviceManager.AllDevices)
|
||||||
{
|
{
|
||||||
// make sure it is both ICommunicationMonitor and a Device
|
// make sure it is both ICommunicationMonitor and a Device
|
||||||
var sd = d as ICommunicationMonitor;
|
var sd = d as ICommunicationMonitor;
|
||||||
if (sd == null)
|
if (sd == null)
|
||||||
continue;
|
continue;
|
||||||
var dd = sd as Device;
|
var dd = sd as Device;
|
||||||
if(dd == null)
|
if(dd == null)
|
||||||
continue;
|
continue;
|
||||||
i++;
|
i++;
|
||||||
StatusList.StringInputSig(i, 1).StringValue = dd.Name;
|
StatusList.StringInputSig(i, 1).StringValue = dd.Name;
|
||||||
StatusList.UShortInputSig(i, 1).UShortValue = (ushort)sd.CommunicationMonitor.Status;
|
StatusList.UShortInputSig(i, 1).UShortValue = (ushort)sd.CommunicationMonitor.Status;
|
||||||
StatusListDeviceIndexes.Add(sd, i);
|
StatusListDeviceIndexes.Add(sd, i);
|
||||||
sd.CommunicationMonitor.StatusChange += CommunicationMonitor_StatusChange ;
|
sd.CommunicationMonitor.StatusChange += CommunicationMonitor_StatusChange ;
|
||||||
}
|
}
|
||||||
StatusList.Count = (ushort)i;
|
StatusList.Count = (ushort)i;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Builds the list of display controls
|
/// Builds the list of display controls
|
||||||
/// </summary>
|
/// </summary>
|
||||||
void BuildDisplayList()
|
void BuildDisplayList()
|
||||||
{
|
{
|
||||||
DisplayList = new SubpageReferenceList(TriList, UISmartObjectJoin.TechDisplayControlsList, 10, 3, 3);
|
DisplayList = new SubpageReferenceList(TriList, UISmartObjectJoin.TechDisplayControlsList, 10, 3, 3);
|
||||||
|
|
||||||
var devKeys = ConfigReader.ConfigObject.Devices.Where(d =>
|
var devKeys = ConfigReader.ConfigObject.Devices.Where(d =>
|
||||||
d.Group.Equals("display", StringComparison.OrdinalIgnoreCase)
|
d.Group.Equals("display", StringComparison.OrdinalIgnoreCase)
|
||||||
|| d.Group.Equals("projector", StringComparison.OrdinalIgnoreCase))
|
|| d.Group.Equals("projector", StringComparison.OrdinalIgnoreCase))
|
||||||
.Select(dd => dd.Key);
|
.Select(dd => dd.Key);
|
||||||
var disps = DeviceManager.AllDevices.Where(d =>
|
var disps = DeviceManager.AllDevices.Where(d =>
|
||||||
devKeys.Contains(d.Key));
|
devKeys.Contains(d.Key));
|
||||||
ushort i = 0;
|
ushort i = 0;
|
||||||
foreach (var disp in disps)
|
foreach (var disp in disps)
|
||||||
{
|
{
|
||||||
var display = disp as DisplayBase;
|
var display = disp as DisplayBase;
|
||||||
if (display != null)
|
if (display != null)
|
||||||
{
|
{
|
||||||
i++;
|
i++;
|
||||||
DisplayList.StringInputSig(i, 1).StringValue = display.Name;
|
DisplayList.StringInputSig(i, 1).StringValue = display.Name;
|
||||||
DisplayList.GetBoolFeedbackSig(i, 1).SetSigFalseAction(display.PowerOn);
|
DisplayList.GetBoolFeedbackSig(i, 1).SetSigFalseAction(display.PowerOn);
|
||||||
DisplayList.GetBoolFeedbackSig(i, 2).SetSigFalseAction(display.PowerOff);
|
DisplayList.GetBoolFeedbackSig(i, 2).SetSigFalseAction(display.PowerOff);
|
||||||
if (display is TwoWayDisplayBase)
|
if (display is TwoWayDisplayBase)
|
||||||
{
|
{
|
||||||
var powerOnSig = DisplayList.BoolInputSig(i, 1);
|
var powerOnSig = DisplayList.BoolInputSig(i, 1);
|
||||||
(display as TwoWayDisplayBase).PowerIsOnFeedback.LinkInputSig(powerOnSig);
|
(display as TwoWayDisplayBase).PowerIsOnFeedback.LinkInputSig(powerOnSig);
|
||||||
|
|
||||||
var powerOffSig = DisplayList.BoolInputSig(1, 2);
|
var powerOffSig = DisplayList.BoolInputSig(1, 2);
|
||||||
(display as TwoWayDisplayBase).PowerIsOnFeedback.LinkComplementInputSig(powerOffSig);
|
(display as TwoWayDisplayBase).PowerIsOnFeedback.LinkComplementInputSig(powerOffSig);
|
||||||
}
|
}
|
||||||
DisplayList.GetBoolFeedbackSig(i, 3).SetSigFalseAction(() =>
|
DisplayList.GetBoolFeedbackSig(i, 3).SetSigFalseAction(() =>
|
||||||
{ if (display is IInputHdmi1) (display as IInputHdmi1).InputHdmi1(); });
|
{ if (display is IInputHdmi1) (display as IInputHdmi1).InputHdmi1(); });
|
||||||
DisplayList.GetBoolFeedbackSig(i, 4).SetSigFalseAction(() =>
|
DisplayList.GetBoolFeedbackSig(i, 4).SetSigFalseAction(() =>
|
||||||
{ if (display is IInputHdmi2) (display as IInputHdmi2).InputHdmi2(); });
|
{ if (display is IInputHdmi2) (display as IInputHdmi2).InputHdmi2(); });
|
||||||
DisplayList.GetBoolFeedbackSig(i, 5).SetSigFalseAction(() =>
|
DisplayList.GetBoolFeedbackSig(i, 5).SetSigFalseAction(() =>
|
||||||
{ if (display is IInputHdmi3) (display as IInputHdmi3).InputHdmi3(); });
|
{ if (display is IInputHdmi3) (display as IInputHdmi3).InputHdmi3(); });
|
||||||
//DisplayList.GetBoolFeedbackSig(i, 6).SetSigFalseAction(() =>
|
//DisplayList.GetBoolFeedbackSig(i, 6).SetSigFalseAction(() =>
|
||||||
//{ if (display is IInputHdmi4) (display as IInputHdmi4).InputHdmi4(); });
|
//{ if (display is IInputHdmi4) (display as IInputHdmi4).InputHdmi4(); });
|
||||||
DisplayList.GetBoolFeedbackSig(i, 6).SetSigFalseAction(() =>
|
DisplayList.GetBoolFeedbackSig(i, 6).SetSigFalseAction(() =>
|
||||||
{ if (display is IInputDisplayPort1) (display as IInputDisplayPort1).InputDisplayPort1(); });
|
{ if (display is IInputDisplayPort1) (display as IInputDisplayPort1).InputDisplayPort1(); });
|
||||||
|
|
||||||
|
|
||||||
// Figure out some way to provide current input feedback
|
// Figure out some way to provide current input feedback
|
||||||
if (display is TwoWayDisplayBase)
|
if (display is TwoWayDisplayBase)
|
||||||
{
|
{
|
||||||
(display as TwoWayDisplayBase).CurrentInputFeedback.OutputChange += CurrentInputFeedback_OutputChange;
|
(display as TwoWayDisplayBase).CurrentInputFeedback.OutputChange += CurrentInputFeedback_OutputChange;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DisplayList.Count = i;
|
DisplayList.Count = i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void CurrentInputFeedback_OutputChange(object sender, EventArgs e)
|
void CurrentInputFeedback_OutputChange(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
void CommunicationMonitor_StatusChange(object sender, MonitorStatusChangeEventArgs e)
|
void CommunicationMonitor_StatusChange(object sender, MonitorStatusChangeEventArgs e)
|
||||||
{
|
{
|
||||||
var c = sender as ICommunicationMonitor;
|
var c = sender as ICommunicationMonitor;
|
||||||
if (c != null && StatusListDeviceIndexes.ContainsKey(c))
|
if (c != null && StatusListDeviceIndexes.ContainsKey(c))
|
||||||
{
|
{
|
||||||
var i = StatusListDeviceIndexes[c];
|
var i = StatusListDeviceIndexes[c];
|
||||||
StatusList.UShortInputSig(i, 1).UShortValue = (ushort)e.Status;
|
StatusList.UShortInputSig(i, 1).UShortValue = (ushort)e.Status;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -46,6 +46,14 @@ namespace PepperDash.Essentials.Core.Bridges
|
|||||||
public JoinDataComplete RawOccupancyUsFeedback = new JoinDataComplete(new JoinData { JoinNumber = 7, JoinSpan = 1 },
|
public JoinDataComplete RawOccupancyUsFeedback = new JoinDataComplete(new JoinData { JoinNumber = 7, JoinSpan = 1 },
|
||||||
new JoinMetadata { Description = "Raw Occupancy Us Feedback", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
new JoinMetadata { Description = "Raw Occupancy Us Feedback", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
[JoinName("IdentityModeOn")]
|
||||||
|
public JoinDataComplete IdentityMode = new JoinDataComplete(new JoinData { JoinNumber = 8, JoinSpan = 1 },
|
||||||
|
new JoinMetadata { Description = "Enable Identity Mode", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
[JoinName("IdentityModeFeedback")]
|
||||||
|
public JoinDataComplete IdentityModeFeedback = new JoinDataComplete(new JoinData { JoinNumber = 8, JoinSpan = 1 },
|
||||||
|
new JoinMetadata { Description = "Identity Mode Feedback", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
[JoinName("EnableLedFlash")]
|
[JoinName("EnableLedFlash")]
|
||||||
public JoinDataComplete EnableLedFlash = new JoinDataComplete(new JoinData { JoinNumber = 11, JoinSpan = 1 },
|
public JoinDataComplete EnableLedFlash = new JoinDataComplete(new JoinData { JoinNumber = 11, JoinSpan = 1 },
|
||||||
new JoinMetadata { Description = "Enable Led Flash", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
|
new JoinMetadata { Description = "Enable Led Flash", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ namespace PepperDash.Essentials.Core.Bridges
|
|||||||
new JoinMetadata
|
new JoinMetadata
|
||||||
{
|
{
|
||||||
Description = "DM Chassis enable audio breakaway routing",
|
Description = "DM Chassis enable audio breakaway routing",
|
||||||
JoinCapabilities = eJoinCapabilities.ToSIMPL,
|
JoinCapabilities = eJoinCapabilities.FromSIMPL,
|
||||||
JoinType = eJoinType.Digital
|
JoinType = eJoinType.Digital
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -20,7 +20,7 @@ namespace PepperDash.Essentials.Core.Bridges
|
|||||||
new JoinMetadata
|
new JoinMetadata
|
||||||
{
|
{
|
||||||
Description = "DM Chassis enable USB breakaway routing",
|
Description = "DM Chassis enable USB breakaway routing",
|
||||||
JoinCapabilities = eJoinCapabilities.ToSIMPL,
|
JoinCapabilities = eJoinCapabilities.FromSIMPL,
|
||||||
JoinType = eJoinType.Digital
|
JoinType = eJoinType.Digital
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,17 @@
|
|||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Core.Bridges
|
namespace PepperDash.Essentials.Core.Bridges
|
||||||
{
|
{
|
||||||
public class DmpsRoutingControllerJoinMap : JoinMapBaseAdvanced
|
public class DmpsRoutingControllerJoinMap : JoinMapBaseAdvanced
|
||||||
{
|
{
|
||||||
|
[JoinName("SystemPowerOn")]
|
||||||
|
public JoinDataComplete SystemPowerOn = new JoinDataComplete(new JoinData { JoinNumber = 12, JoinSpan = 1 },
|
||||||
|
new JoinMetadata { Description = "DMPS System Power On Get/Set", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
[JoinName("SystemPowerOff")]
|
||||||
|
public JoinDataComplete SystemPowerOff = new JoinDataComplete(new JoinData { JoinNumber = 13, JoinSpan = 1 },
|
||||||
|
new JoinMetadata { Description = "DMPS System Power Off Get/Set", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
[JoinName("VideoSyncStatus")]
|
[JoinName("VideoSyncStatus")]
|
||||||
public JoinDataComplete VideoSyncStatus = new JoinDataComplete(new JoinData { JoinNumber = 101, JoinSpan = 32 },
|
public JoinDataComplete VideoSyncStatus = new JoinDataComplete(new JoinData { JoinNumber = 101, JoinSpan = 32 },
|
||||||
new JoinMetadata { Description = "DM Input Video Sync", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
new JoinMetadata { Description = "DM Input Video Sync", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||||
@@ -61,5 +69,5 @@ namespace PepperDash.Essentials.Core.Bridges
|
|||||||
protected DmpsRoutingControllerJoinMap(uint joinStart, Type type) : base(joinStart, type)
|
protected DmpsRoutingControllerJoinMap(uint joinStart, Type type) : base(joinStart, type)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -5,6 +5,9 @@ namespace PepperDash.Essentials.Core.Bridges.JoinMaps
|
|||||||
{
|
{
|
||||||
public class GlsPartitionSensorJoinMap : JoinMapBaseAdvanced
|
public class GlsPartitionSensorJoinMap : JoinMapBaseAdvanced
|
||||||
{
|
{
|
||||||
|
|
||||||
|
#region Digital
|
||||||
|
|
||||||
[JoinName("IsOnline")]
|
[JoinName("IsOnline")]
|
||||||
public JoinDataComplete IsOnline = new JoinDataComplete(
|
public JoinDataComplete IsOnline = new JoinDataComplete(
|
||||||
new JoinData
|
new JoinData
|
||||||
@@ -19,20 +22,7 @@ namespace PepperDash.Essentials.Core.Bridges.JoinMaps
|
|||||||
JoinType = eJoinType.Digital
|
JoinType = eJoinType.Digital
|
||||||
});
|
});
|
||||||
|
|
||||||
[JoinName("Name")]
|
|
||||||
public JoinDataComplete Name = new JoinDataComplete(
|
|
||||||
new JoinData
|
|
||||||
{
|
|
||||||
JoinNumber = 1,
|
|
||||||
JoinSpan = 1
|
|
||||||
},
|
|
||||||
new JoinMetadata
|
|
||||||
{
|
|
||||||
Description = "Sensor Name",
|
|
||||||
JoinCapabilities = eJoinCapabilities.ToSIMPL,
|
|
||||||
JoinType = eJoinType.Serial
|
|
||||||
});
|
|
||||||
|
|
||||||
[JoinName("Enable")]
|
[JoinName("Enable")]
|
||||||
public JoinDataComplete Enable = new JoinDataComplete(
|
public JoinDataComplete Enable = new JoinDataComplete(
|
||||||
new JoinData
|
new JoinData
|
||||||
@@ -101,7 +91,11 @@ namespace PepperDash.Essentials.Core.Bridges.JoinMaps
|
|||||||
Description = "Sensor Decrease Sensitivity",
|
Description = "Sensor Decrease Sensitivity",
|
||||||
JoinCapabilities = eJoinCapabilities.FromSIMPL,
|
JoinCapabilities = eJoinCapabilities.FromSIMPL,
|
||||||
JoinType = eJoinType.Digital
|
JoinType = eJoinType.Digital
|
||||||
});
|
});
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Analog
|
||||||
|
|
||||||
[JoinName("Sensitivity")]
|
[JoinName("Sensitivity")]
|
||||||
public JoinDataComplete Sensitivity = new JoinDataComplete(
|
public JoinDataComplete Sensitivity = new JoinDataComplete(
|
||||||
@@ -117,6 +111,28 @@ namespace PepperDash.Essentials.Core.Bridges.JoinMaps
|
|||||||
JoinType = eJoinType.Analog
|
JoinType = eJoinType.Analog
|
||||||
});
|
});
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
#region Serial
|
||||||
|
|
||||||
|
[JoinName("Name")]
|
||||||
|
public JoinDataComplete Name = new JoinDataComplete(
|
||||||
|
new JoinData
|
||||||
|
{
|
||||||
|
JoinNumber = 1,
|
||||||
|
JoinSpan = 1
|
||||||
|
},
|
||||||
|
new JoinMetadata
|
||||||
|
{
|
||||||
|
Description = "Sensor Name",
|
||||||
|
JoinCapabilities = eJoinCapabilities.ToSIMPL,
|
||||||
|
JoinType = eJoinType.Serial
|
||||||
|
});
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Constructor to use when instantiating this Join Map without inheriting from it
|
/// Constructor to use when instantiating this Join Map without inheriting from it
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -0,0 +1,77 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
using Crestron.SimplSharpPro;
|
||||||
|
using Crestron.SimplSharpPro.GeneralIO;
|
||||||
|
using PepperDash.Core;
|
||||||
|
using PepperDash.Essentials.Core.Config;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Core
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Wrapper class for CEN-IO-RY-104 relay module
|
||||||
|
/// </summary>
|
||||||
|
[Description("Wrapper class for the CEN-IO-RY-104 relay module")]
|
||||||
|
public class CenIoRy104Controller : EssentialsDevice, IRelayPorts
|
||||||
|
{
|
||||||
|
private readonly CenIoRy104 _ry104;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Constructor
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="key"></param>
|
||||||
|
/// <param name="name"></param>
|
||||||
|
/// <param name="ry104"></param>
|
||||||
|
public CenIoRy104Controller(string key, string name, CenIoRy104 ry104)
|
||||||
|
: base(key, name)
|
||||||
|
{
|
||||||
|
_ry104 = ry104;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Relay port collection
|
||||||
|
/// </summary>
|
||||||
|
public CrestronCollection<Relay> RelayPorts
|
||||||
|
{
|
||||||
|
get { return _ry104.RelayPorts; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Number of relay ports property
|
||||||
|
/// </summary>
|
||||||
|
public int NumberOfRelayPorts
|
||||||
|
{
|
||||||
|
get { return _ry104.NumberOfRelayPorts; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// CEN-IO-RY Controller factory
|
||||||
|
/// </summary>
|
||||||
|
public class CenIoRy104ControllerFactory : EssentialsDeviceFactory<CenIoRy104Controller>
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Constructor
|
||||||
|
/// </summary>
|
||||||
|
public CenIoRy104ControllerFactory()
|
||||||
|
{
|
||||||
|
TypeNames = new List<string>() { "ceniory104" };
|
||||||
|
}
|
||||||
|
|
||||||
|
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||||
|
{
|
||||||
|
Debug.Console(1, "Factory Attempting to create a new CEN-IO-RY-104 Device");
|
||||||
|
|
||||||
|
var controlPropertiesConfig = CommFactory.GetControlPropertiesConfig(dc);
|
||||||
|
if (controlPropertiesConfig == null)
|
||||||
|
{
|
||||||
|
Debug.Console(1, "Factory failed to create a new CEN-IO-RY-104 Device");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
var ipid = controlPropertiesConfig.IpIdInt;
|
||||||
|
if (ipid != 0) return new CenIoRy104Controller(dc.Key, dc.Name, new CenIoRy104(ipid, Global.ControlSystem));
|
||||||
|
|
||||||
|
Debug.Console(1, "Factory failed to create a new CEN-IO-RY-104 Device using IP-ID-{0}", ipid);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -69,19 +69,28 @@ namespace PepperDash.Essentials.Core
|
|||||||
public override bool CustomActivate()
|
public override bool CustomActivate()
|
||||||
{
|
{
|
||||||
Debug.Console(0, this, "Activating");
|
Debug.Console(0, this, "Activating");
|
||||||
if (!PreventRegistration)
|
if (!PreventRegistration)
|
||||||
{
|
{
|
||||||
//Debug.Console(1, this, " Does not require registration. Skipping");
|
//Debug.Console(1, this, " Does not require registration. Skipping");
|
||||||
|
|
||||||
var response = Hardware.RegisterWithLogging(Key);
|
var response = Hardware.RegisterWithLogging(Key);
|
||||||
if (response != eDeviceRegistrationUnRegistrationResponse.Success)
|
if (response != eDeviceRegistrationUnRegistrationResponse.Success)
|
||||||
{
|
{
|
||||||
//Debug.Console(0, this, "ERROR: Cannot register Crestron device: {0}", response);
|
//Debug.Console(0, this, "ERROR: Cannot register Crestron device: {0}", response);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
IsRegistered.FireUpdate();
|
IsRegistered.FireUpdate();
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
AddPostActivationAction(() =>
|
||||||
|
{
|
||||||
|
var response = Hardware.RegisterWithLogging(Key);
|
||||||
|
|
||||||
|
IsRegistered.FireUpdate();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
foreach (var f in Feedbacks)
|
foreach (var f in Feedbacks)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -60,6 +60,7 @@ namespace PepperDash.Essentials.Core
|
|||||||
DeviceCriticalSection.Enter();
|
DeviceCriticalSection.Enter();
|
||||||
AddDeviceEnabled = false;
|
AddDeviceEnabled = false;
|
||||||
// PreActivate all devices
|
// PreActivate all devices
|
||||||
|
Debug.Console(0,"****PreActivation starting...****");
|
||||||
foreach (var d in Devices.Values)
|
foreach (var d in Devices.Values)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@@ -69,9 +70,12 @@ namespace PepperDash.Essentials.Core
|
|||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
Debug.Console(0, d, "ERROR: Device PreActivation failure:\r{0}", e);
|
Debug.Console(0, d, "ERROR: Device {1} PreActivation failure: {0}", e.Message, d.Key);
|
||||||
|
Debug.Console(1, d, "Stack Trace: {0}", e.StackTrace);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Debug.Console(0, "****PreActivation complete****");
|
||||||
|
Debug.Console(0, "****Activation starting...****");
|
||||||
|
|
||||||
// Activate all devices
|
// Activate all devices
|
||||||
foreach (var d in Devices.Values)
|
foreach (var d in Devices.Values)
|
||||||
@@ -83,10 +87,14 @@ namespace PepperDash.Essentials.Core
|
|||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
Debug.Console(0, d, "ERROR: Device Activation failure:\r{0}", e);
|
Debug.Console(0, d, "ERROR: Device {1} Activation failure: {0}", e.Message, d.Key);
|
||||||
|
Debug.Console(1, d, "Stack Trace: {0}", e.StackTrace);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Debug.Console(0, "****Activation complete****");
|
||||||
|
Debug.Console(0, "****PostActivation starting...****");
|
||||||
|
|
||||||
// PostActivate all devices
|
// PostActivate all devices
|
||||||
foreach (var d in Devices.Values)
|
foreach (var d in Devices.Values)
|
||||||
{
|
{
|
||||||
@@ -97,10 +105,13 @@ namespace PepperDash.Essentials.Core
|
|||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
Debug.Console(0, d, "ERROR: Device PostActivation failure:\r{0}", e);
|
Debug.Console(0, d, "ERROR: Device {1} PostActivation failure: {0}", e.Message, d.Key);
|
||||||
|
Debug.Console(1, d, "Stack Trace: {0}", e.StackTrace);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Debug.Console(0, "****PostActivation complete****");
|
||||||
|
|
||||||
OnAllDevicesActivated();
|
OnAllDevicesActivated();
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ namespace PepperDash.Essentials.Core
|
|||||||
|
|
||||||
public DescriptionAttribute(string description)
|
public DescriptionAttribute(string description)
|
||||||
{
|
{
|
||||||
Debug.Console(2, "Setting Description: {0}", description);
|
//Debug.Console(2, "Setting Description: {0}", description);
|
||||||
_Description = description;
|
_Description = description;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -74,7 +74,7 @@ namespace PepperDash.Essentials.Core
|
|||||||
|
|
||||||
public ConfigSnippetAttribute(string configSnippet)
|
public ConfigSnippetAttribute(string configSnippet)
|
||||||
{
|
{
|
||||||
Debug.Console(2, "Setting Config Snippet {0}", configSnippet);
|
//Debug.Console(2, "Setting Config Snippet {0}", configSnippet);
|
||||||
_ConfigSnippet = configSnippet;
|
_ConfigSnippet = configSnippet;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -103,7 +103,7 @@ namespace PepperDash.Essentials.Core
|
|||||||
{
|
{
|
||||||
foreach (var typeName in TypeNames)
|
foreach (var typeName in TypeNames)
|
||||||
{
|
{
|
||||||
Debug.Console(2, "Getting Description Attribute from class: '{0}'", typeof(T).FullName);
|
//Debug.Console(2, "Getting Description Attribute from class: '{0}'", typeof(T).FullName);
|
||||||
var descriptionAttribute = typeof(T).GetCustomAttributes(typeof(DescriptionAttribute), true) as DescriptionAttribute[];
|
var descriptionAttribute = typeof(T).GetCustomAttributes(typeof(DescriptionAttribute), true) as DescriptionAttribute[];
|
||||||
string description = descriptionAttribute[0].Description;
|
string description = descriptionAttribute[0].Description;
|
||||||
var snippetAttribute = typeof(T).GetCustomAttributes(typeof(ConfigSnippetAttribute), true) as ConfigSnippetAttribute[];
|
var snippetAttribute = typeof(T).GetCustomAttributes(typeof(ConfigSnippetAttribute), true) as ConfigSnippetAttribute[];
|
||||||
|
|||||||
@@ -69,13 +69,13 @@ namespace PepperDash.Essentials.Core
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static void AddFactoryForType(string typeName, Func<DeviceConfig, IKeyed> method)
|
public static void AddFactoryForType(string typeName, Func<DeviceConfig, IKeyed> method)
|
||||||
{
|
{
|
||||||
Debug.Console(1, Debug.ErrorLogLevel.Notice, "Adding factory method for type '{0}'", typeName);
|
//Debug.Console(1, Debug.ErrorLogLevel.Notice, "Adding factory method for type '{0}'", typeName);
|
||||||
DeviceFactory.FactoryMethods.Add(typeName, new DeviceFactoryWrapper() { FactoryMethod = method});
|
DeviceFactory.FactoryMethods.Add(typeName, new DeviceFactoryWrapper() { FactoryMethod = method});
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void AddFactoryForType(string typeName, string description, CType cType, Func<DeviceConfig, IKeyed> method)
|
public static void AddFactoryForType(string typeName, string description, CType cType, Func<DeviceConfig, IKeyed> method)
|
||||||
{
|
{
|
||||||
Debug.Console(1, Debug.ErrorLogLevel.Notice, "Adding factory method for type '{0}'", typeName);
|
//Debug.Console(1, Debug.ErrorLogLevel.Notice, "Adding factory method for type '{0}'", typeName);
|
||||||
|
|
||||||
if(FactoryMethods.ContainsKey(typeName))
|
if(FactoryMethods.ContainsKey(typeName))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -62,6 +62,11 @@ namespace PepperDash.Essentials.Core
|
|||||||
ValueFunc = valueFunc;
|
ValueFunc = valueFunc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void SetValueFunc(Func<bool> newFunc)
|
||||||
|
{
|
||||||
|
ValueFunc = newFunc;
|
||||||
|
}
|
||||||
|
|
||||||
public override void FireUpdate()
|
public override void FireUpdate()
|
||||||
{
|
{
|
||||||
bool newValue = InTestMode ? TestValue : ValueFunc.Invoke();
|
bool newValue = InTestMode ? TestValue : ValueFunc.Invoke();
|
||||||
|
|||||||
@@ -51,6 +51,12 @@ namespace PepperDash.Essentials.Core
|
|||||||
ValueFunc = valueFunc;
|
ValueFunc = valueFunc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void SetValueFunc(Func<int> newFunc)
|
||||||
|
{
|
||||||
|
ValueFunc = newFunc;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public override void FireUpdate()
|
public override void FireUpdate()
|
||||||
{
|
{
|
||||||
var newValue = InTestMode ? TestValue : ValueFunc.Invoke();
|
var newValue = InTestMode ? TestValue : ValueFunc.Invoke();
|
||||||
|
|||||||
@@ -52,7 +52,10 @@ namespace PepperDash.Essentials.Core
|
|||||||
ValueFunc = valueFunc;
|
ValueFunc = valueFunc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void SetValueFunc(Func<string> newFunc)
|
||||||
|
{
|
||||||
|
ValueFunc = newFunc;
|
||||||
|
}
|
||||||
|
|
||||||
public override void FireUpdate()
|
public override void FireUpdate()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -119,9 +119,21 @@ namespace PepperDash.Essentials.Core.Fusion
|
|||||||
var slot = Global.ControlSystem.ProgramNumber;
|
var slot = Global.ControlSystem.ProgramNumber;
|
||||||
|
|
||||||
var guidFilePath = Global.FilePathPrefix +
|
var guidFilePath = Global.FilePathPrefix +
|
||||||
string.Format(@"{0}-FusionGuids.json", InitialParametersClass.ProgramIDTag);
|
string.Format(@"{0}-FusionGuids-{1:X2}.json", InitialParametersClass.ProgramIDTag, _ipId);
|
||||||
|
|
||||||
_guidFileExists = File.Exists(guidFilePath);
|
var oldGuidFilePath = Global.FilePathPrefix +
|
||||||
|
string.Format(@"{0}-FusionGuids.json", InitialParametersClass.ProgramIDTag);
|
||||||
|
|
||||||
|
if (File.Exists(oldGuidFilePath))
|
||||||
|
{
|
||||||
|
Debug.Console(0, this, "Migrating from old Fusion GUID file to new Fusion GUID File");
|
||||||
|
|
||||||
|
File.Copy(oldGuidFilePath, guidFilePath);
|
||||||
|
|
||||||
|
File.Delete(oldGuidFilePath);
|
||||||
|
}
|
||||||
|
|
||||||
|
_guidFileExists = File.Exists(guidFilePath);
|
||||||
|
|
||||||
// Check if file exists
|
// Check if file exists
|
||||||
if (!_guidFileExists)
|
if (!_guidFileExists)
|
||||||
@@ -149,19 +161,7 @@ namespace PepperDash.Essentials.Core.Fusion
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
AddPostActivationAction(() =>
|
AddPostActivationAction(() => PostActivate(guidFilePath));
|
||||||
{
|
|
||||||
CreateSymbolAndBasicSigs(_ipId);
|
|
||||||
SetUpSources();
|
|
||||||
SetUpCommunitcationMonitors();
|
|
||||||
SetUpDisplay();
|
|
||||||
SetUpError();
|
|
||||||
ExecuteCustomSteps();
|
|
||||||
|
|
||||||
FusionRVI.GenerateFileForAllFusionDevices();
|
|
||||||
|
|
||||||
GenerateGuidFile(guidFilePath);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
@@ -169,6 +169,20 @@ namespace PepperDash.Essentials.Core.Fusion
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void PostActivate(string guidFilePath)
|
||||||
|
{
|
||||||
|
CreateSymbolAndBasicSigs(_ipId);
|
||||||
|
SetUpSources();
|
||||||
|
SetUpCommunitcationMonitors();
|
||||||
|
SetUpDisplay();
|
||||||
|
SetUpError();
|
||||||
|
ExecuteCustomSteps();
|
||||||
|
|
||||||
|
FusionRVI.GenerateFileForAllFusionDevices();
|
||||||
|
|
||||||
|
GenerateGuidFile(guidFilePath);
|
||||||
|
}
|
||||||
|
|
||||||
protected string RoomGuid
|
protected string RoomGuid
|
||||||
{
|
{
|
||||||
get { return _guiDs.RoomGuid; }
|
get { return _guiDs.RoomGuid; }
|
||||||
@@ -314,7 +328,7 @@ namespace PepperDash.Essentials.Core.Fusion
|
|||||||
|
|
||||||
protected virtual void CreateSymbolAndBasicSigs(uint ipId)
|
protected virtual void CreateSymbolAndBasicSigs(uint ipId)
|
||||||
{
|
{
|
||||||
Debug.Console(0, this, Debug.ErrorLogLevel.Notice, "Creating Fusion Room symbol with GUID: {0}", RoomGuid);
|
Debug.Console(0, this, Debug.ErrorLogLevel.Notice, "Creating Fusion Room symbol with GUID: {0} and IP-ID {1:X2}", RoomGuid, ipId);
|
||||||
|
|
||||||
FusionRoom = new FusionRoom(ipId, Global.ControlSystem, Room.Name, RoomGuid);
|
FusionRoom = new FusionRoom(ipId, Global.ControlSystem, Room.Name, RoomGuid);
|
||||||
FusionRoom.ExtenderRoomViewSchedulingDataReservedSigs.Use();
|
FusionRoom.ExtenderRoomViewSchedulingDataReservedSigs.Use();
|
||||||
|
|||||||
@@ -32,6 +32,27 @@ namespace PepperDash.Essentials.Core
|
|||||||
// TODO: consider making this configurable later
|
// TODO: consider making this configurable later
|
||||||
public static IFormatProvider Culture = CultureInfo.CreateSpecificCulture("en-US");
|
public static IFormatProvider Culture = CultureInfo.CreateSpecificCulture("en-US");
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// True when the processor type is a DMPS variant
|
||||||
|
/// </summary>
|
||||||
|
public static bool ControlSystemIsDmpsType
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return ControlSystem.ControllerPrompt.ToLower().IndexOf("dmps") > -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// True when the processor type is a DMPS 4K variant
|
||||||
|
/// </summary>
|
||||||
|
public static bool ControlSystemIsDmps4kType
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return ControlSystemIsDmpsType && ControlSystem.ControllerPrompt.ToLower().IndexOf("4k") > -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The file path prefix to the folder containing configuration files
|
/// The file path prefix to the folder containing configuration files
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Resources;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
using Crestron.SimplSharpPro.DeviceSupport;
|
using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
@@ -61,6 +62,8 @@ namespace PepperDash.Essentials.Core
|
|||||||
|
|
||||||
public BoolFeedback RawOccupancyUsFeedback { get; private set; }
|
public BoolFeedback RawOccupancyUsFeedback { get; private set; }
|
||||||
|
|
||||||
|
public BoolFeedback IdentityModeFeedback { get; private set; }
|
||||||
|
|
||||||
// Debug properties
|
// Debug properties
|
||||||
public bool InTestMode { get; private set; }
|
public bool InTestMode { get; private set; }
|
||||||
|
|
||||||
@@ -117,6 +120,8 @@ namespace PepperDash.Essentials.Core
|
|||||||
|
|
||||||
RawOccupancyUsFeedback = new BoolFeedback(() => OccSensor.RawOccupancyDetectedByUltrasonicSensorFeedback.BoolValue);
|
RawOccupancyUsFeedback = new BoolFeedback(() => OccSensor.RawOccupancyDetectedByUltrasonicSensorFeedback.BoolValue);
|
||||||
|
|
||||||
|
IdentityModeFeedback = new BoolFeedback(()=>OccSensor.IdentityModeOnFeedback.BoolValue);
|
||||||
|
|
||||||
UltrasonicSensitivityInVacantStateFeedback = new IntFeedback(() => (int)OccSensor.UltrasonicSensorSensitivityInVacantStateFeedback);
|
UltrasonicSensitivityInVacantStateFeedback = new IntFeedback(() => (int)OccSensor.UltrasonicSensorSensitivityInVacantStateFeedback);
|
||||||
|
|
||||||
UltrasonicSensitivityInOccupiedStateFeedback = new IntFeedback(() => (int)OccSensor.UltrasonicSensorSensitivityInOccupiedStateFeedback);
|
UltrasonicSensitivityInOccupiedStateFeedback = new IntFeedback(() => (int)OccSensor.UltrasonicSensorSensitivityInOccupiedStateFeedback);
|
||||||
@@ -199,6 +204,27 @@ namespace PepperDash.Essentials.Core
|
|||||||
{
|
{
|
||||||
SetAndWhenVacatedState((bool)PropertiesConfig.AndWhenVacatedState);
|
SetAndWhenVacatedState((bool)PropertiesConfig.AndWhenVacatedState);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO [ ] feature/cenoodtcpoe-sensor-sensitivity-configuration
|
||||||
|
if (PropertiesConfig.UsSensitivityOccupied != null)
|
||||||
|
{
|
||||||
|
SetUsSensitivityOccupied((ushort)PropertiesConfig.UsSensitivityOccupied);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (PropertiesConfig.UsSensitivityVacant != null)
|
||||||
|
{
|
||||||
|
SetUsSensitivityVacant((ushort)PropertiesConfig.UsSensitivityVacant);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (PropertiesConfig.PirSensitivityOccupied != null)
|
||||||
|
{
|
||||||
|
SetPirSensitivityOccupied((ushort)PropertiesConfig.PirSensitivityOccupied);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (PropertiesConfig.PirSensitivityVacant != null)
|
||||||
|
{
|
||||||
|
SetPirSensitivityVacant((ushort)PropertiesConfig.PirSensitivityVacant);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -279,7 +305,21 @@ namespace PepperDash.Essentials.Core
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
/// Sets the identity mode on or off
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="state"></param>
|
||||||
|
public void SetIdentityMode(bool state)
|
||||||
|
{
|
||||||
|
if (state)
|
||||||
|
OccSensor.IdentityModeOn();
|
||||||
|
else
|
||||||
|
OccSensor.IdentityModeOff();
|
||||||
|
|
||||||
|
Debug.Console(1, this, "Identity Mode: {0}", OccSensor.IdentityModeOnFeedback.BoolValue ? "On" : "Off");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
/// Enables or disables the PIR sensor
|
/// Enables or disables the PIR sensor
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="state"></param>
|
/// <param name="state"></param>
|
||||||
@@ -506,6 +546,54 @@ namespace PepperDash.Essentials.Core
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sets the US sensor sensitivity for occupied state
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sensitivity"></param>
|
||||||
|
public void SetUsSensitivityOccupied(ushort sensitivity)
|
||||||
|
{
|
||||||
|
var level = (eSensitivityLevel) sensitivity;
|
||||||
|
if (level == 0) return;
|
||||||
|
|
||||||
|
OccSensor.UltrasonicSensorSensitivityInOccupiedState = level;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sets the US sensor sensitivity for vacant state
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sensitivity"></param>
|
||||||
|
public void SetUsSensitivityVacant(ushort sensitivity)
|
||||||
|
{
|
||||||
|
var level = (eSensitivityLevel)sensitivity;
|
||||||
|
if (level == 0) return;
|
||||||
|
|
||||||
|
OccSensor.UltrasonicSensorSensitivityInVacantState = level;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sets the PIR sensor sensitivity for occupied state
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sensitivity"></param>
|
||||||
|
public void SetPirSensitivityOccupied(ushort sensitivity)
|
||||||
|
{
|
||||||
|
var level = (eSensitivityLevel)sensitivity;
|
||||||
|
if (level == 0) return;
|
||||||
|
|
||||||
|
OccSensor.PassiveInfraredSensorSensitivityInOccupiedState = level;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sets the PIR sensor sensitivity for vacant state
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sensitivity"></param>
|
||||||
|
public void SetPirSensitivityVacant(ushort sensitivity)
|
||||||
|
{
|
||||||
|
var level = (eSensitivityLevel)sensitivity;
|
||||||
|
if (level == 0) return;
|
||||||
|
|
||||||
|
OccSensor.PassiveInfraredSensorSensitivityInVacantState = level;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Method to print current settings to console
|
/// Method to print current settings to console
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -647,8 +735,11 @@ namespace PepperDash.Essentials.Core
|
|||||||
|
|
||||||
//Sensor Raw States
|
//Sensor Raw States
|
||||||
occController.RawOccupancyPirFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RawOccupancyPirFeedback.JoinNumber]);
|
occController.RawOccupancyPirFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RawOccupancyPirFeedback.JoinNumber]);
|
||||||
occController.RawOccupancyUsFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RawOccupancyUsFeedback.JoinNumber]);
|
occController.RawOccupancyUsFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RawOccupancyUsFeedback.JoinNumber]);
|
||||||
|
|
||||||
|
// Identity mode
|
||||||
|
trilist.SetBoolSigAction(joinMap.IdentityMode.JoinNumber, occController.SetIdentityMode);
|
||||||
|
occController.IdentityModeFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IdentityModeFeedback.JoinNumber]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public class CenOdtOccupancySensorBaseControllerFactory : EssentialsDeviceFactory<CenOdtOccupancySensorBaseController>
|
public class CenOdtOccupancySensorBaseControllerFactory : EssentialsDeviceFactory<CenOdtOccupancySensorBaseController>
|
||||||
|
|||||||
@@ -47,5 +47,35 @@ namespace PepperDash.Essentials.Core
|
|||||||
|
|
||||||
[JsonProperty("andWhenVacatedState")]
|
[JsonProperty("andWhenVacatedState")]
|
||||||
public bool? AndWhenVacatedState { get; set; }
|
public bool? AndWhenVacatedState { get; set; }
|
||||||
|
|
||||||
|
// PoE Sensors: CenOdtCPoe
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sets the sensitivity level for US while sensor is in occupied state
|
||||||
|
/// 1 = low; 2 = medium; 3 = high; 4 = xlow; 5 = 2xlow; 6 = 3xlow
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("usSensitivityOccupied")]
|
||||||
|
public ushort? UsSensitivityOccupied { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sets the sensitivity level for US while sensor is in vacant state
|
||||||
|
/// 1 = low; 2 = medium; 3 = high; 4 = xlow; 5 = 2xlow; 6 = 3xlow
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("usSensitivityVacant")]
|
||||||
|
public ushort? UsSensitivityVacant { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sets the sensitivity level for PIR while sensor is in occupied state
|
||||||
|
/// 1 = low; 2 = medium; 3 = high
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("pirSensitivityOccupied")]
|
||||||
|
public ushort? PirSensitivityOccupied { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sets the sensitivity level for PIR while sensor is in vacant state
|
||||||
|
/// 1 = low; 2 = medium; 3 = high
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("pirSensitivityVacant")]
|
||||||
|
public ushort? PirSensitivityVacant { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,149 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using Crestron.SimplSharp;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Core
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Represents an abstract controller device for a partition dividing rooms that are combinable
|
||||||
|
///
|
||||||
|
/// In Auto mode, it can use a partition sensor to automatically determine whether the partition is present.
|
||||||
|
///
|
||||||
|
/// In Manual mode it accepts user input to tell it whether the partition is present.
|
||||||
|
/// </summary>
|
||||||
|
public class EssentialsPartitionController : IPartitionController
|
||||||
|
{
|
||||||
|
private IPartitionStateProvider _partitionSensor;
|
||||||
|
|
||||||
|
private bool isInAutoMode;
|
||||||
|
|
||||||
|
private bool partitionPresent;
|
||||||
|
|
||||||
|
public EssentialsPartitionController(string key, string name, IPartitionStateProvider sensor, bool defaultToManualMode, List<string> adjacentRoomKeys)
|
||||||
|
{
|
||||||
|
Key = key;
|
||||||
|
|
||||||
|
Name = name;
|
||||||
|
|
||||||
|
AdjacentRoomKeys = adjacentRoomKeys;
|
||||||
|
|
||||||
|
if (sensor != null)
|
||||||
|
{
|
||||||
|
_partitionSensor = sensor;
|
||||||
|
|
||||||
|
if (!defaultToManualMode)
|
||||||
|
{
|
||||||
|
SetAutoMode();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SetManualMode();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SetManualMode();
|
||||||
|
}
|
||||||
|
|
||||||
|
PartitionPresentFeedback.FireUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
|
void PartitionPresentFeedback_OutputChange(object sender, FeedbackEventArgs e)
|
||||||
|
{
|
||||||
|
if (isInAutoMode)
|
||||||
|
{
|
||||||
|
PartitionPresentFeedback.FireUpdate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#region IPartitionController Members
|
||||||
|
|
||||||
|
public List<string> AdjacentRoomKeys { get; private set; }
|
||||||
|
|
||||||
|
public void SetAutoMode()
|
||||||
|
{
|
||||||
|
isInAutoMode = true;
|
||||||
|
if (PartitionPresentFeedback != null)
|
||||||
|
{
|
||||||
|
PartitionPresentFeedback.SetValueFunc(() => _partitionSensor.PartitionPresentFeedback.BoolValue);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
PartitionPresentFeedback = new BoolFeedback(() => _partitionSensor.PartitionPresentFeedback.BoolValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_partitionSensor != null)
|
||||||
|
{
|
||||||
|
_partitionSensor.PartitionPresentFeedback.OutputChange += PartitionPresentFeedback_OutputChange;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetManualMode()
|
||||||
|
{
|
||||||
|
isInAutoMode = false;
|
||||||
|
if (PartitionPresentFeedback != null)
|
||||||
|
{
|
||||||
|
PartitionPresentFeedback.SetValueFunc(() => partitionPresent);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
PartitionPresentFeedback = new BoolFeedback(() => partitionPresent);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_partitionSensor != null)
|
||||||
|
{
|
||||||
|
_partitionSensor.PartitionPresentFeedback.OutputChange -= PartitionPresentFeedback_OutputChange;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void SetPartitionStatePresent()
|
||||||
|
{
|
||||||
|
if (!isInAutoMode)
|
||||||
|
{
|
||||||
|
partitionPresent = true;
|
||||||
|
PartitionPresentFeedback.FireUpdate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetPartitionStateNotPresent()
|
||||||
|
{
|
||||||
|
if (!isInAutoMode)
|
||||||
|
{
|
||||||
|
partitionPresent = false;
|
||||||
|
PartitionPresentFeedback.FireUpdate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ToggglePartitionState()
|
||||||
|
{
|
||||||
|
if (!isInAutoMode)
|
||||||
|
{
|
||||||
|
partitionPresent = !partitionPresent;
|
||||||
|
PartitionPresentFeedback.FireUpdate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region IPartitionStateProvider Members
|
||||||
|
|
||||||
|
public BoolFeedback PartitionPresentFeedback { get; private set; }
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region IKeyName Members
|
||||||
|
|
||||||
|
public string Name { get; private set; }
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region IKeyed Members
|
||||||
|
|
||||||
|
public string Key { get; private set; }
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
using Crestron.SimplSharpPro;
|
using Crestron.SimplSharp;
|
||||||
|
using Crestron.SimplSharpPro;
|
||||||
using Crestron.SimplSharpPro.DeviceSupport;
|
using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
using Crestron.SimplSharpPro.GeneralIO;
|
using Crestron.SimplSharpPro.GeneralIO;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
@@ -9,17 +10,20 @@ using PepperDash.Essentials.Core.Bridges.JoinMaps;
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using PepperDash.Essentials.Core.Config;
|
using PepperDash.Essentials.Core.Config;
|
||||||
|
using PepperDash_Essentials_Core.PartitionSensor;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Core
|
namespace PepperDash.Essentials.Core
|
||||||
{
|
{
|
||||||
[Description("Wrapper class for GLS Cresnet Partition Sensor")]
|
[Description("Wrapper class for GLS Cresnet Partition Sensor")]
|
||||||
public class GlsPartitionSensorController : CrestronGenericBridgeableBaseDevice
|
public class GlsPartitionSensorController : CrestronGenericBridgeableBaseDevice, IPartitionStateProvider
|
||||||
{
|
{
|
||||||
private GlsPartCn _partitionSensor;
|
|
||||||
|
|
||||||
public StringFeedback NameFeedback { get; private set; }
|
public GlsPartitionSensorPropertiesConfig PropertiesConfig { get; private set; }
|
||||||
|
|
||||||
|
private GlsPartCn _partitionSensor;
|
||||||
|
|
||||||
public BoolFeedback EnableFeedback { get; private set; }
|
public BoolFeedback EnableFeedback { get; private set; }
|
||||||
public BoolFeedback PartitionSensedFeedback { get; private set; }
|
public BoolFeedback PartitionPresentFeedback { get; private set; }
|
||||||
public BoolFeedback PartitionNotSensedFeedback { get; private set; }
|
public BoolFeedback PartitionNotSensedFeedback { get; private set; }
|
||||||
public IntFeedback SensitivityFeedback { get; private set; }
|
public IntFeedback SensitivityFeedback { get; private set; }
|
||||||
|
|
||||||
@@ -32,23 +36,71 @@ namespace PepperDash.Essentials.Core
|
|||||||
public GlsPartitionSensorController(string key, Func<DeviceConfig, GlsPartCn> preActivationFunc, DeviceConfig config)
|
public GlsPartitionSensorController(string key, Func<DeviceConfig, GlsPartCn> preActivationFunc, DeviceConfig config)
|
||||||
: base(key, config.Name)
|
: base(key, config.Name)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
var props = config.Properties.ToObject<GlsPartitionSensorPropertiesConfig>();
|
||||||
|
if (props != null)
|
||||||
|
{
|
||||||
|
PropertiesConfig = props;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Debug.Console(1, this, "props are null. Unable to deserialize into GlsPartSensorPropertiesConfig");
|
||||||
|
}
|
||||||
|
|
||||||
AddPreActivationAction(() =>
|
AddPreActivationAction(() =>
|
||||||
{
|
{
|
||||||
_partitionSensor = preActivationFunc(config);
|
_partitionSensor = preActivationFunc(config);
|
||||||
|
|
||||||
RegisterCrestronGenericBase(_partitionSensor);
|
RegisterCrestronGenericBase(_partitionSensor);
|
||||||
|
|
||||||
|
EnableFeedback = new BoolFeedback(() => InTestMode ? TestEnableFeedback : _partitionSensor.EnableFeedback.BoolValue);
|
||||||
|
PartitionPresentFeedback = new BoolFeedback(() => InTestMode ? TestPartitionSensedFeedback : _partitionSensor.PartitionSensedFeedback.BoolValue);
|
||||||
|
PartitionNotSensedFeedback = new BoolFeedback(() => InTestMode ? !TestPartitionSensedFeedback : _partitionSensor.PartitionNotSensedFeedback.BoolValue);
|
||||||
|
SensitivityFeedback = new IntFeedback(() => InTestMode ? TestSensitivityFeedback : _partitionSensor.SensitivityFeedback.UShortValue);
|
||||||
|
|
||||||
NameFeedback = new StringFeedback(() => Name);
|
if (_partitionSensor != null)
|
||||||
EnableFeedback = new BoolFeedback(() => _partitionSensor.EnableFeedback.BoolValue);
|
{
|
||||||
PartitionSensedFeedback = new BoolFeedback(() => _partitionSensor.PartitionSensedFeedback.BoolValue);
|
_partitionSensor.BaseEvent += PartitionSensor_BaseEvent;
|
||||||
PartitionNotSensedFeedback = new BoolFeedback(() => _partitionSensor.PartitionNotSensedFeedback.BoolValue);
|
}
|
||||||
SensitivityFeedback = new IntFeedback(() => _partitionSensor.SensitivityFeedback.UShortValue);
|
|
||||||
|
|
||||||
if (_partitionSensor != null) _partitionSensor.BaseEvent += PartitionSensor_BaseEvent;
|
|
||||||
});
|
});
|
||||||
}
|
|
||||||
|
|
||||||
private void PartitionSensor_BaseEvent(GenericBase device, BaseEventArgs args)
|
AddPostActivationAction(() =>
|
||||||
|
{
|
||||||
|
_partitionSensor.OnlineStatusChange += (o, a) =>
|
||||||
|
{
|
||||||
|
if (a.DeviceOnLine)
|
||||||
|
{
|
||||||
|
ApplySettingsToSensorFromConfig();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
if (_partitionSensor.IsOnline)
|
||||||
|
{
|
||||||
|
ApplySettingsToSensorFromConfig();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ApplySettingsToSensorFromConfig()
|
||||||
|
{
|
||||||
|
if (_partitionSensor.IsOnline == false) return;
|
||||||
|
|
||||||
|
Debug.Console(1, this, "Attempting to apply settings to sensor from config");
|
||||||
|
|
||||||
|
if (PropertiesConfig.Sensitivity != null)
|
||||||
|
{
|
||||||
|
Debug.Console(1, this, "Sensitivity found, attempting to set value '{0}' from config",
|
||||||
|
PropertiesConfig.Sensitivity);
|
||||||
|
_partitionSensor.Sensitivity.UShortValue = (ushort) PropertiesConfig.Sensitivity;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Debug.Console(1, this, "Sensitivity null, no value specified in config");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void PartitionSensor_BaseEvent(GenericBase device, BaseEventArgs args)
|
||||||
{
|
{
|
||||||
Debug.Console(2, this, "EventId: {0}, Index: {1}", args.EventId, args.Index);
|
Debug.Console(2, this, "EventId: {0}, Index: {1}", args.EventId, args.Index);
|
||||||
|
|
||||||
@@ -61,11 +113,13 @@ namespace PepperDash.Essentials.Core
|
|||||||
}
|
}
|
||||||
case (GlsPartCn.PartitionSensedFeedbackEventId):
|
case (GlsPartCn.PartitionSensedFeedbackEventId):
|
||||||
{
|
{
|
||||||
PartitionSensedFeedback.FireUpdate();
|
Debug.Console(1, this, "Partition Sensed State: {0}", _partitionSensor.PartitionSensedFeedback.BoolValue);
|
||||||
|
PartitionPresentFeedback.FireUpdate();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case (GlsPartCn.PartitionNotSensedFeedbackEventId):
|
case (GlsPartCn.PartitionNotSensedFeedbackEventId):
|
||||||
{
|
{
|
||||||
|
Debug.Console(1, this, "Partition Not Sensed State: {0}", _partitionSensor.PartitionNotSensedFeedback.BoolValue);
|
||||||
PartitionNotSensedFeedback.FireUpdate();
|
PartitionNotSensedFeedback.FireUpdate();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -73,7 +127,7 @@ namespace PepperDash.Essentials.Core
|
|||||||
{
|
{
|
||||||
SensitivityFeedback.FireUpdate();
|
SensitivityFeedback.FireUpdate();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
Debug.Console(2, this, "Unhandled args.EventId: {0}", args.EventId);
|
Debug.Console(2, this, "Unhandled args.EventId: {0}", args.EventId);
|
||||||
@@ -93,6 +147,9 @@ namespace PepperDash.Essentials.Core
|
|||||||
if (InTestMode)
|
if (InTestMode)
|
||||||
{
|
{
|
||||||
TestEnableFeedback = state;
|
TestEnableFeedback = state;
|
||||||
|
|
||||||
|
EnableFeedback.FireUpdate();
|
||||||
|
|
||||||
Debug.Console(1, this, "TestEnableFeedback: {0}", TestEnableFeedback.ToString());
|
Debug.Console(1, this, "TestEnableFeedback: {0}", TestEnableFeedback.ToString());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -105,6 +162,10 @@ namespace PepperDash.Essentials.Core
|
|||||||
if (InTestMode)
|
if (InTestMode)
|
||||||
{
|
{
|
||||||
TestPartitionSensedFeedback = state;
|
TestPartitionSensedFeedback = state;
|
||||||
|
|
||||||
|
PartitionPresentFeedback.FireUpdate();
|
||||||
|
PartitionNotSensedFeedback.FireUpdate();
|
||||||
|
|
||||||
Debug.Console(1, this, "TestPartitionSensedFeedback: {0}", TestPartitionSensedFeedback.ToString());
|
Debug.Console(1, this, "TestPartitionSensedFeedback: {0}", TestPartitionSensedFeedback.ToString());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -117,6 +178,8 @@ namespace PepperDash.Essentials.Core
|
|||||||
if (InTestMode)
|
if (InTestMode)
|
||||||
{
|
{
|
||||||
TestSensitivityFeedback = value;
|
TestSensitivityFeedback = value;
|
||||||
|
|
||||||
|
SensitivityFeedback.FireUpdate();
|
||||||
Debug.Console(1, this, "TestSensitivityFeedback: {0}", TestSensitivityFeedback);
|
Debug.Console(1, this, "TestSensitivityFeedback: {0}", TestSensitivityFeedback);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -124,7 +187,22 @@ namespace PepperDash.Essentials.Core
|
|||||||
Debug.Console(1, this, "InTestMode: {0}, unable to set sensitivity value: {1}", InTestMode.ToString(), value);
|
Debug.Console(1, this, "InTestMode: {0}, unable to set sensitivity value: {1}", InTestMode.ToString(), value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetEnableState(bool state)
|
public void GetSettings()
|
||||||
|
{
|
||||||
|
var dash = new string('*', 50);
|
||||||
|
CrestronConsole.PrintLine(string.Format("{0}\n", dash));
|
||||||
|
|
||||||
|
Debug.Console(0, this, "Enabled State: {0}", _partitionSensor.EnableFeedback.BoolValue);
|
||||||
|
|
||||||
|
Debug.Console(0, this, "Partition Sensed State: {0}", _partitionSensor.PartitionSensedFeedback.BoolValue);
|
||||||
|
Debug.Console(0, this, "Partition Not Sensed State: {0}", _partitionSensor.PartitionNotSensedFeedback.BoolValue);
|
||||||
|
|
||||||
|
Debug.Console(0, this, "Sensitivity Value: {0}", _partitionSensor.SensitivityFeedback.UShortValue);
|
||||||
|
|
||||||
|
CrestronConsole.PrintLine(string.Format("{0}\n", dash));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetEnableState(bool state)
|
||||||
{
|
{
|
||||||
Debug.Console(2, this, "Sensor is {0}, SetEnableState: {1}", _partitionSensor == null ? "null" : "not null", state);
|
Debug.Console(2, this, "Sensor is {0}, SetEnableState: {1}", _partitionSensor == null ? "null" : "not null", state);
|
||||||
if (_partitionSensor == null)
|
if (_partitionSensor == null)
|
||||||
@@ -180,18 +258,20 @@ namespace PepperDash.Essentials.Core
|
|||||||
Debug.Console(1, this, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
Debug.Console(1, this, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
||||||
Debug.Console(0, this, "Linking to Bridge Type {0}", GetType().Name);
|
Debug.Console(0, this, "Linking to Bridge Type {0}", GetType().Name);
|
||||||
|
|
||||||
// link input from simpl
|
IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline.JoinNumber]);
|
||||||
|
trilist.StringInput[joinMap.Name.JoinNumber].StringValue = _partitionSensor.Name;
|
||||||
|
|
||||||
trilist.SetBoolSigAction(joinMap.Enable.JoinNumber, SetEnableState);
|
trilist.SetBoolSigAction(joinMap.Enable.JoinNumber, SetEnableState);
|
||||||
|
EnableFeedback.LinkInputSig(trilist.BooleanInput[joinMap.Enable.JoinNumber]);
|
||||||
|
|
||||||
|
PartitionPresentFeedback.LinkInputSig(trilist.BooleanInput[joinMap.PartitionSensed.JoinNumber]);
|
||||||
|
PartitionNotSensedFeedback.LinkInputSig(trilist.BooleanInput[joinMap.PartitionNotSensed.JoinNumber]);
|
||||||
|
|
||||||
trilist.SetSigTrueAction(joinMap.IncreaseSensitivity.JoinNumber, IncreaseSensitivity);
|
trilist.SetSigTrueAction(joinMap.IncreaseSensitivity.JoinNumber, IncreaseSensitivity);
|
||||||
trilist.SetSigTrueAction(joinMap.DecreaseSensitivity.JoinNumber, DecreaseSensitivity);
|
trilist.SetSigTrueAction(joinMap.DecreaseSensitivity.JoinNumber, DecreaseSensitivity);
|
||||||
trilist.SetUShortSigAction(joinMap.Sensitivity.JoinNumber, SetSensitivity);
|
|
||||||
|
|
||||||
// link output to simpl
|
SensitivityFeedback.LinkInputSig(trilist.UShortInput[joinMap.Sensitivity.JoinNumber]);
|
||||||
IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline.JoinNumber]);
|
trilist.SetUShortSigAction(joinMap.Sensitivity.JoinNumber, SetSensitivity);
|
||||||
EnableFeedback.LinkInputSig(trilist.BooleanInput[joinMap.Enable.JoinNumber]);
|
|
||||||
PartitionSensedFeedback.LinkInputSig(trilist.BooleanInput[joinMap.PartitionSensed.JoinNumber]);
|
|
||||||
PartitionNotSensedFeedback.LinkInputSig(trilist.BooleanInput[joinMap.PartitionNotSensed.JoinNumber]);
|
|
||||||
SensitivityFeedback.LinkInputSig(trilist.UShortInput[joinMap.Sensitivity.JoinNumber]);
|
|
||||||
|
|
||||||
FeedbacksFireUpdates();
|
FeedbacksFireUpdates();
|
||||||
|
|
||||||
@@ -209,6 +289,7 @@ namespace PepperDash.Essentials.Core
|
|||||||
{
|
{
|
||||||
if (a.DeviceOnLine)
|
if (a.DeviceOnLine)
|
||||||
{
|
{
|
||||||
|
trilist.StringInput[joinMap.Name.JoinNumber].StringValue = _partitionSensor.Name;
|
||||||
FeedbacksFireUpdates();
|
FeedbacksFireUpdates();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -216,10 +297,9 @@ namespace PepperDash.Essentials.Core
|
|||||||
|
|
||||||
private void FeedbacksFireUpdates()
|
private void FeedbacksFireUpdates()
|
||||||
{
|
{
|
||||||
IsOnline.FireUpdate();
|
IsOnline.FireUpdate();
|
||||||
NameFeedback.FireUpdate();
|
|
||||||
EnableFeedback.FireUpdate();
|
EnableFeedback.FireUpdate();
|
||||||
PartitionSensedFeedback.FireUpdate();
|
PartitionPresentFeedback.FireUpdate();
|
||||||
PartitionNotSensedFeedback.FireUpdate();
|
PartitionNotSensedFeedback.FireUpdate();
|
||||||
SensitivityFeedback.FireUpdate();
|
SensitivityFeedback.FireUpdate();
|
||||||
}
|
}
|
||||||
@@ -260,7 +340,7 @@ namespace PepperDash.Essentials.Core
|
|||||||
|
|
||||||
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||||
{
|
{
|
||||||
Debug.Console(1, "Factory Attempting to create new C2N-RTHS Device");
|
Debug.Console(1, "Factory Attempting to create new GlsPartitionSensorController Device");
|
||||||
|
|
||||||
return new GlsPartitionSensorController(dc.Key, GetGlsPartCnDevice, dc);
|
return new GlsPartitionSensorController(dc.Key, GetGlsPartCnDevice, dc);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using Crestron.SimplSharp;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
|
namespace PepperDash_Essentials_Core.PartitionSensor
|
||||||
|
{
|
||||||
|
public class GlsPartitionSensorPropertiesConfig
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Sets the sensor sensitivity
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// The sensitivity range shall be between 1(lowest) to 10 (highest).
|
||||||
|
/// </remarks>
|
||||||
|
[JsonProperty("sensitivity")]
|
||||||
|
public ushort? Sensitivity { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using Crestron.SimplSharp;
|
||||||
|
|
||||||
|
using PepperDash.Core;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Core
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Describes the functionality of a device that senses and provides partition state
|
||||||
|
/// </summary>
|
||||||
|
public interface IPartitionStateProvider : IKeyName
|
||||||
|
{
|
||||||
|
BoolFeedback PartitionPresentFeedback { get; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Describes the functionality of a device that can provide partition state either manually via user input or optionally via a sensor state
|
||||||
|
/// </summary>
|
||||||
|
public interface IPartitionController : IPartitionStateProvider
|
||||||
|
{
|
||||||
|
List<string> AdjacentRoomKeys { get; }
|
||||||
|
|
||||||
|
void SetPartitionStatePresent();
|
||||||
|
|
||||||
|
void SetPartitionStateNotPresent();
|
||||||
|
|
||||||
|
void ToggglePartitionState();
|
||||||
|
|
||||||
|
void SetManualMode();
|
||||||
|
|
||||||
|
void SetAutoMode();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -182,6 +182,7 @@
|
|||||||
<Compile Include="Crestron IO\Inputs\GenericVersiportInputDevice.cs" />
|
<Compile Include="Crestron IO\Inputs\GenericVersiportInputDevice.cs" />
|
||||||
<Compile Include="Crestron IO\Inputs\IDigitalInput.cs" />
|
<Compile Include="Crestron IO\Inputs\IDigitalInput.cs" />
|
||||||
<Compile Include="Crestron IO\IOPortConfig.cs" />
|
<Compile Include="Crestron IO\IOPortConfig.cs" />
|
||||||
|
<Compile Include="Crestron IO\Relay\CenIoRy104Controller.cs" />
|
||||||
<Compile Include="Crestron IO\Relay\GenericRelayDevice.cs" />
|
<Compile Include="Crestron IO\Relay\GenericRelayDevice.cs" />
|
||||||
<Compile Include="Crestron IO\Relay\ISwitchedOutput.cs" />
|
<Compile Include="Crestron IO\Relay\ISwitchedOutput.cs" />
|
||||||
<Compile Include="Crestron IO\StatusSign\StatusSignController.cs" />
|
<Compile Include="Crestron IO\StatusSign\StatusSignController.cs" />
|
||||||
@@ -235,6 +236,9 @@
|
|||||||
<Compile Include="Interfaces\ILogStringsWithLevel.cs" />
|
<Compile Include="Interfaces\ILogStringsWithLevel.cs" />
|
||||||
<Compile Include="Occupancy\GlsOccupancySensorPropertiesConfig.cs" />
|
<Compile Include="Occupancy\GlsOccupancySensorPropertiesConfig.cs" />
|
||||||
<Compile Include="Occupancy\GlsOirOccupancySensorController.cs" />
|
<Compile Include="Occupancy\GlsOirOccupancySensorController.cs" />
|
||||||
|
<Compile Include="PartitionSensor\EssentialsPartitionController.cs" />
|
||||||
|
<Compile Include="PartitionSensor\GlsPartitionSensorPropertiesConfig.cs" />
|
||||||
|
<Compile Include="PartitionSensor\IPartitionStateProvider.cs" />
|
||||||
<Compile Include="Occupancy\OccupancyAggregatorConfig.cs" />
|
<Compile Include="Occupancy\OccupancyAggregatorConfig.cs" />
|
||||||
<Compile Include="Queues\ComsMessage.cs" />
|
<Compile Include="Queues\ComsMessage.cs" />
|
||||||
<Compile Include="Queues\ProcessStringMessage.cs" />
|
<Compile Include="Queues\ProcessStringMessage.cs" />
|
||||||
@@ -290,6 +294,10 @@
|
|||||||
<Compile Include="Remotes\CrestronRemotePropertiesConfig.cs" />
|
<Compile Include="Remotes\CrestronRemotePropertiesConfig.cs" />
|
||||||
<Compile Include="Remotes\Hrxx0WirelessRemoteController.cs" />
|
<Compile Include="Remotes\Hrxx0WirelessRemoteController.cs" />
|
||||||
<Compile Include="Room\Behaviours\RoomOnToDefaultSourceWhenOccupied.cs" />
|
<Compile Include="Room\Behaviours\RoomOnToDefaultSourceWhenOccupied.cs" />
|
||||||
|
<Compile Include="Room\Combining\EssentialsRoomCombiner.cs" />
|
||||||
|
<Compile Include="Room\Combining\EssentialsRoomCombinerPropertiesConfig.cs" />
|
||||||
|
<Compile Include="Room\Combining\IEssentialsRoomCombiner.cs" />
|
||||||
|
<Compile Include="Room\Combining\RoomCombinationScenario.cs" />
|
||||||
<Compile Include="Room\EssentialsRoomBase.cs" />
|
<Compile Include="Room\EssentialsRoomBase.cs" />
|
||||||
<Compile Include="Room\Config\EssentialsRoomScheduledEventsConfig.cs" />
|
<Compile Include="Room\Config\EssentialsRoomScheduledEventsConfig.cs" />
|
||||||
<Compile Include="Room\IEssentialsRoom.cs" />
|
<Compile Include="Room\IEssentialsRoom.cs" />
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ namespace PepperDash.Essentials
|
|||||||
/// <param name="fileName"></param>
|
/// <param name="fileName"></param>
|
||||||
static LoadedAssembly LoadAssembly(string filePath)
|
static LoadedAssembly LoadAssembly(string filePath)
|
||||||
{
|
{
|
||||||
Debug.Console(2, "Attempting to load {0}", filePath);
|
//Debug.Console(2, "Attempting to load {0}", filePath);
|
||||||
var assembly = Assembly.LoadFrom(filePath);
|
var assembly = Assembly.LoadFrom(filePath);
|
||||||
if (assembly != null)
|
if (assembly != null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -0,0 +1,264 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using Crestron.SimplSharp;
|
||||||
|
|
||||||
|
using PepperDash.Core;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Core
|
||||||
|
{
|
||||||
|
public class EssentialsRoomCombiner : EssentialsDevice, IEssentialsRoomCombiner
|
||||||
|
{
|
||||||
|
private EssentialsRoomCombinerPropertiesConfig _propertiesConfig;
|
||||||
|
|
||||||
|
private IRoomCombinationScenario _currentScenario;
|
||||||
|
|
||||||
|
private List<IEssentialsRoom> _rooms;
|
||||||
|
|
||||||
|
private bool isInAutoMode;
|
||||||
|
|
||||||
|
private CTimer _scenarioChangeDebounceTimer;
|
||||||
|
|
||||||
|
private int _scenarioChangeDebounceTimeSeconds = 10; // default to 10s
|
||||||
|
|
||||||
|
public EssentialsRoomCombiner(string key, EssentialsRoomCombinerPropertiesConfig props)
|
||||||
|
: base(key)
|
||||||
|
{
|
||||||
|
_propertiesConfig = props;
|
||||||
|
|
||||||
|
Partitions = new List<IPartitionController>();
|
||||||
|
RoomCombinationScenarios = new List<IRoomCombinationScenario>();
|
||||||
|
|
||||||
|
if (_propertiesConfig.ScenarioChangeDebounceTimeSeconds > 0)
|
||||||
|
{
|
||||||
|
_scenarioChangeDebounceTimeSeconds = _propertiesConfig.ScenarioChangeDebounceTimeSeconds;
|
||||||
|
}
|
||||||
|
|
||||||
|
IsInAutoModeFeedback = new BoolFeedback(() => isInAutoMode);
|
||||||
|
|
||||||
|
// default to auto mode
|
||||||
|
isInAutoMode = true;
|
||||||
|
|
||||||
|
if (_propertiesConfig.defaultToManualMode)
|
||||||
|
{
|
||||||
|
isInAutoMode = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
IsInAutoModeFeedback.FireUpdate();
|
||||||
|
|
||||||
|
CreateScenarios();
|
||||||
|
|
||||||
|
AddPostActivationAction(() =>
|
||||||
|
{
|
||||||
|
SetupPartitionStateProviders();
|
||||||
|
|
||||||
|
SetRooms();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
void CreateScenarios()
|
||||||
|
{
|
||||||
|
RoomCombinationScenarios = new List<IRoomCombinationScenario>();
|
||||||
|
|
||||||
|
foreach (var scenarioConfig in _propertiesConfig.Scenarios)
|
||||||
|
{
|
||||||
|
var scenario = new RoomCombinationScenario(scenarioConfig);
|
||||||
|
RoomCombinationScenarios.Add(scenario);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void SetRooms()
|
||||||
|
{
|
||||||
|
_rooms = new List<IEssentialsRoom>();
|
||||||
|
|
||||||
|
foreach (var roomKey in _propertiesConfig.RoomKeys)
|
||||||
|
{
|
||||||
|
var room = DeviceManager.GetDeviceForKey(roomKey) as IEssentialsRoom;
|
||||||
|
if (room != null)
|
||||||
|
{
|
||||||
|
_rooms.Add(room);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void SetupPartitionStateProviders()
|
||||||
|
{
|
||||||
|
foreach (var pConfig in _propertiesConfig.Partitions)
|
||||||
|
{
|
||||||
|
var sensor = DeviceManager.GetDeviceForKey(pConfig.DeviceKey) as IPartitionStateProvider;
|
||||||
|
|
||||||
|
var partition = new EssentialsPartitionController(pConfig.Key, pConfig.Name, sensor, _propertiesConfig.defaultToManualMode, pConfig.AdjacentRoomKeys);
|
||||||
|
|
||||||
|
partition.PartitionPresentFeedback.OutputChange += PartitionPresentFeedback_OutputChange;
|
||||||
|
|
||||||
|
Partitions.Add(partition);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void PartitionPresentFeedback_OutputChange(object sender, FeedbackEventArgs e)
|
||||||
|
{
|
||||||
|
StartDebounceTimer();
|
||||||
|
}
|
||||||
|
|
||||||
|
void StartDebounceTimer()
|
||||||
|
{
|
||||||
|
var time = _scenarioChangeDebounceTimeSeconds * 1000;
|
||||||
|
|
||||||
|
if (_scenarioChangeDebounceTimer == null)
|
||||||
|
{
|
||||||
|
_scenarioChangeDebounceTimer = new CTimer((o) => DetermineRoomCombinationScenario(), time);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_scenarioChangeDebounceTimer.Reset(time);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Determines the current room combination scenario based on the state of the partition sensors
|
||||||
|
/// </summary>
|
||||||
|
void DetermineRoomCombinationScenario()
|
||||||
|
{
|
||||||
|
if (_scenarioChangeDebounceTimer != null)
|
||||||
|
{
|
||||||
|
_scenarioChangeDebounceTimer.Dispose();
|
||||||
|
_scenarioChangeDebounceTimer = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
var currentScenario = RoomCombinationScenarios.FirstOrDefault((s) =>
|
||||||
|
{
|
||||||
|
// iterate the partition states
|
||||||
|
foreach (var partitionState in s.PartitionStates)
|
||||||
|
{
|
||||||
|
// get the partition by key
|
||||||
|
var partition = Partitions.FirstOrDefault((p) => p.Key.Equals(partitionState.PartitionKey));
|
||||||
|
|
||||||
|
if (partition != null && partitionState.PartitionPresent != partition.PartitionPresentFeedback.BoolValue)
|
||||||
|
{
|
||||||
|
// the partition can't be found or the state doesn't match
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// if it hasn't returned false by now we have the matching scenario
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
|
||||||
|
if (currentScenario != null)
|
||||||
|
{
|
||||||
|
CurrentScenario = currentScenario;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#region IEssentialsRoomCombiner Members
|
||||||
|
|
||||||
|
public event EventHandler<EventArgs> RoomCombinationScenarioChanged;
|
||||||
|
|
||||||
|
public IRoomCombinationScenario CurrentScenario
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return _currentScenario;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value != _currentScenario)
|
||||||
|
{
|
||||||
|
_currentScenario = value;
|
||||||
|
Debug.Console(1, this, "Current Scenario: {0}", _currentScenario.Name);
|
||||||
|
var handler = RoomCombinationScenarioChanged;
|
||||||
|
if (handler != null)
|
||||||
|
{
|
||||||
|
handler(this, new EventArgs());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public BoolFeedback IsInAutoModeFeedback { get; private set; }
|
||||||
|
|
||||||
|
public void SetAutoMode()
|
||||||
|
{
|
||||||
|
isInAutoMode = true;
|
||||||
|
IsInAutoModeFeedback.FireUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetManualMode()
|
||||||
|
{
|
||||||
|
isInAutoMode = false;
|
||||||
|
IsInAutoModeFeedback.FireUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ToggleMode()
|
||||||
|
{
|
||||||
|
isInAutoMode = !isInAutoMode;
|
||||||
|
IsInAutoModeFeedback.FireUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<IRoomCombinationScenario> RoomCombinationScenarios { get; private set; }
|
||||||
|
|
||||||
|
public List<IPartitionController> Partitions { get; private set; }
|
||||||
|
|
||||||
|
public void TogglePartitionState(string partitionKey)
|
||||||
|
{
|
||||||
|
var partition = Partitions.FirstOrDefault((p) => p.Key.Equals(partitionKey)) as IPartitionController;
|
||||||
|
|
||||||
|
if (partition != null)
|
||||||
|
{
|
||||||
|
partition.ToggglePartitionState();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetRoomCombinationScenario(string scenarioKey)
|
||||||
|
{
|
||||||
|
if (isInAutoMode)
|
||||||
|
{
|
||||||
|
Debug.Console(0, this, "Cannot set room combination scenario when in auto mode. Set to auto mode first.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get the scenario
|
||||||
|
var scenario = RoomCombinationScenarios.FirstOrDefault((s) => s.Key.Equals(scenarioKey));
|
||||||
|
|
||||||
|
// Set the parition states from the scenario manually
|
||||||
|
if (scenario != null)
|
||||||
|
{
|
||||||
|
foreach (var partitionState in scenario.PartitionStates)
|
||||||
|
{
|
||||||
|
var partition = Partitions.FirstOrDefault((p) => p.Key.Equals(partitionState.PartitionKey));
|
||||||
|
|
||||||
|
if (partition != null)
|
||||||
|
{
|
||||||
|
if (partitionState.PartitionPresent)
|
||||||
|
{
|
||||||
|
partition.SetPartitionStatePresent();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
partition.SetPartitionStateNotPresent();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
|
||||||
|
public class EssentialsRoomCombinerFactory : EssentialsDeviceFactory<EssentialsRoomCombiner>
|
||||||
|
{
|
||||||
|
public EssentialsRoomCombinerFactory()
|
||||||
|
{
|
||||||
|
TypeNames = new List<string> { "essentialsroomcombiner" };
|
||||||
|
}
|
||||||
|
|
||||||
|
public override EssentialsDevice BuildDevice(PepperDash.Essentials.Core.Config.DeviceConfig dc)
|
||||||
|
{
|
||||||
|
Debug.Console(1, "Factory Attempting to create new EssentialsRoomCombiner Device");
|
||||||
|
|
||||||
|
var props = dc.Properties.ToObject<EssentialsRoomCombinerPropertiesConfig>();
|
||||||
|
|
||||||
|
return new EssentialsRoomCombiner(dc.Key, props);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,111 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using Crestron.SimplSharp;
|
||||||
|
|
||||||
|
using PepperDash.Core;
|
||||||
|
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Core
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Config properties for an EssentialsRoomCombiner device
|
||||||
|
/// </summary>
|
||||||
|
public class EssentialsRoomCombinerPropertiesConfig
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The list of partitions that device the rooms
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("partitions")]
|
||||||
|
public List<PartitionConfig> Partitions {get; set;}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The list of combinations scenarios for the rooms
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("scenarios")]
|
||||||
|
public List<RoomCombinationScenarioConfig> Scenarios { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The list of rooms keys that can be combined
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("roomMap")]
|
||||||
|
public List<string> RoomKeys {get; set;}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Set to true to default to manual mode
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("defaultToManualMode")]
|
||||||
|
public bool defaultToManualMode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The key of the scenario to default to at system startup if in manual mode
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("defaultScenarioKey")]
|
||||||
|
public string defaultScenarioKey { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("scenarioChangeDebounceTimeSeconds")]
|
||||||
|
public int ScenarioChangeDebounceTimeSeconds { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Config properties for a partition that separates rooms
|
||||||
|
/// </summary>
|
||||||
|
public class PartitionConfig : IKeyName
|
||||||
|
{
|
||||||
|
[JsonProperty("key")]
|
||||||
|
public string Key { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("name")]
|
||||||
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Key of the device that implements IPartitionStateProvider to provide the state of the partition
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("deviceKey")]
|
||||||
|
public string DeviceKey { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Keys of the rooms that this partion would be located between
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("adjacentRoomKeys")]
|
||||||
|
public List<string> AdjacentRoomKeys { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Config propeties for a room combination scenario
|
||||||
|
/// </summary>
|
||||||
|
public class RoomCombinationScenarioConfig : IKeyName
|
||||||
|
{
|
||||||
|
[JsonProperty("key")]
|
||||||
|
public string Key { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("name")]
|
||||||
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("partitionStates")]
|
||||||
|
public List<PartitionState> PartitionStates { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("uiMap")]
|
||||||
|
public Dictionary<string, string> UiMap { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("activationActions")]
|
||||||
|
public List<DeviceActionWrapper> ActivationActions { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("deactivationActions")]
|
||||||
|
public List<DeviceActionWrapper> DeactivationActions { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Config properties to represent the state of a partition sensor in a RoomCombinationScenario
|
||||||
|
/// </summary>
|
||||||
|
public class PartitionState
|
||||||
|
{
|
||||||
|
[JsonProperty("partitionKey")]
|
||||||
|
public string PartitionKey { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("partitionSensedState")]
|
||||||
|
public bool PartitionPresent { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,92 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using Crestron.SimplSharp;
|
||||||
|
|
||||||
|
using PepperDash.Core;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Core
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Describes the functionality for an EssentailsRoomCombiner device
|
||||||
|
/// </summary>
|
||||||
|
public interface IEssentialsRoomCombiner : IKeyed
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Indicates that the room combination scenario has changed
|
||||||
|
/// </summary>
|
||||||
|
event EventHandler<EventArgs> RoomCombinationScenarioChanged;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The current room combination scenario
|
||||||
|
/// </summary>
|
||||||
|
IRoomCombinationScenario CurrentScenario { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// When true, indicates the current mode is auto mode
|
||||||
|
/// </summary>
|
||||||
|
BoolFeedback IsInAutoModeFeedback {get;}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sets auto mode
|
||||||
|
/// </summary>
|
||||||
|
void SetAutoMode();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sets manual mode
|
||||||
|
/// </summary>
|
||||||
|
void SetManualMode();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Toggles the current mode between auto and manual
|
||||||
|
/// </summary>
|
||||||
|
void ToggleMode();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The available room combinatino scenarios
|
||||||
|
/// </summary>
|
||||||
|
List<IRoomCombinationScenario> RoomCombinationScenarios { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The partition
|
||||||
|
/// </summary>
|
||||||
|
List<IPartitionController> Partitions { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Toggles the state of a manual partition sensor
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="partitionKey"></param>
|
||||||
|
void TogglePartitionState(string partitionKey);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sets the room combination scenario (if in manual mode)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="scenarioKey"></param>
|
||||||
|
void SetRoomCombinationScenario(string scenarioKey);
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface IRoomCombinationScenario : IKeyName
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// When true, indicates that this room combination scenario is active
|
||||||
|
/// </summary>
|
||||||
|
BoolFeedback IsActiveFeedback { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Activates this room combination scenario
|
||||||
|
/// </summary>
|
||||||
|
void Activate();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The state of the partitions that would activate this scenario
|
||||||
|
/// </summary>
|
||||||
|
List<PartitionState> PartitionStates { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The mapping of UIs by key to rooms by key
|
||||||
|
/// </summary>
|
||||||
|
Dictionary<string, string> UiMap { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,83 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using Crestron.SimplSharp;
|
||||||
|
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Core
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Represents a room combination scenario
|
||||||
|
/// </summary>
|
||||||
|
public class RoomCombinationScenario: IRoomCombinationScenario
|
||||||
|
{
|
||||||
|
private RoomCombinationScenarioConfig _config;
|
||||||
|
|
||||||
|
public string Key { get; set; }
|
||||||
|
|
||||||
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
public List<PartitionState> PartitionStates { get; private set; }
|
||||||
|
|
||||||
|
public Dictionary<string, string> UiMap { get; set; }
|
||||||
|
|
||||||
|
private bool _isActive;
|
||||||
|
|
||||||
|
public BoolFeedback IsActiveFeedback { get; private set; }
|
||||||
|
|
||||||
|
List<DeviceActionWrapper> activationActions;
|
||||||
|
|
||||||
|
List<DeviceActionWrapper> deactivationActions;
|
||||||
|
|
||||||
|
public RoomCombinationScenario(RoomCombinationScenarioConfig config)
|
||||||
|
{
|
||||||
|
Key = config.Key;
|
||||||
|
|
||||||
|
Name = config.Name;
|
||||||
|
|
||||||
|
PartitionStates = config.PartitionStates;
|
||||||
|
|
||||||
|
UiMap = config.UiMap;
|
||||||
|
|
||||||
|
activationActions = config.ActivationActions;
|
||||||
|
|
||||||
|
deactivationActions = config.DeactivationActions;
|
||||||
|
|
||||||
|
_config = config;
|
||||||
|
|
||||||
|
IsActiveFeedback = new BoolFeedback(() => _isActive);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Activate()
|
||||||
|
{
|
||||||
|
if (activationActions != null)
|
||||||
|
{
|
||||||
|
foreach (var action in activationActions)
|
||||||
|
{
|
||||||
|
DeviceJsonApi.DoDeviceAction(action);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_isActive = true;
|
||||||
|
IsActiveFeedback.FireUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Deactivate()
|
||||||
|
{
|
||||||
|
if (deactivationActions != null)
|
||||||
|
{
|
||||||
|
foreach (var action in deactivationActions)
|
||||||
|
{
|
||||||
|
DeviceJsonApi.DoDeviceAction(action);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_isActive = false;
|
||||||
|
IsActiveFeedback.FireUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -16,7 +16,8 @@ using PepperDash.Essentials.Core;
|
|||||||
using PepperDash.Essentials.Core.Bridges;
|
using PepperDash.Essentials.Core.Bridges;
|
||||||
using PepperDash.Essentials.DM.Config;
|
using PepperDash.Essentials.DM.Config;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.DM {
|
namespace PepperDash.Essentials.DM
|
||||||
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Builds a controller for basic DM-RMCs with Com and IR ports and no control functions
|
/// Builds a controller for basic DM-RMCs with Com and IR ports and no control functions
|
||||||
///
|
///
|
||||||
@@ -75,8 +76,10 @@ namespace PepperDash.Essentials.DM {
|
|||||||
/// Factory method to create a new chassis controller from config data. Limited to 8x8 right now
|
/// Factory method to create a new chassis controller from config data. Limited to 8x8 right now
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static DmBladeChassisController GetDmChassisController(string key, string name,
|
public static DmBladeChassisController GetDmChassisController(string key, string name,
|
||||||
string type, DMChassisPropertiesConfig properties) {
|
string type, DMChassisPropertiesConfig properties)
|
||||||
try {
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
type = type.ToLower();
|
type = type.ToLower();
|
||||||
uint ipid = properties.Control.IpIdInt;
|
uint ipid = properties.Control.IpIdInt;
|
||||||
|
|
||||||
@@ -85,7 +88,8 @@ namespace PepperDash.Essentials.DM {
|
|||||||
else if (type == "dmmd128x128") { chassis = new DmMd128x128(ipid, Global.ControlSystem); }
|
else if (type == "dmmd128x128") { chassis = new DmMd128x128(ipid, Global.ControlSystem); }
|
||||||
|
|
||||||
|
|
||||||
if (chassis == null) {
|
if (chassis == null)
|
||||||
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -93,11 +97,13 @@ namespace PepperDash.Essentials.DM {
|
|||||||
// add the cards and port names
|
// add the cards and port names
|
||||||
foreach (var kvp in properties.InputSlots)
|
foreach (var kvp in properties.InputSlots)
|
||||||
controller.AddInputBlade(kvp.Value, kvp.Key);
|
controller.AddInputBlade(kvp.Value, kvp.Key);
|
||||||
foreach (var kvp in properties.OutputSlots) {
|
foreach (var kvp in properties.OutputSlots)
|
||||||
|
{
|
||||||
controller.AddOutputBlade(kvp.Value, kvp.Key);
|
controller.AddOutputBlade(kvp.Value, kvp.Key);
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (var kvp in properties.VolumeControls) {
|
foreach (var kvp in properties.VolumeControls)
|
||||||
|
{
|
||||||
// get the card
|
// get the card
|
||||||
// check it for an audio-compatible type
|
// check it for an audio-compatible type
|
||||||
// make a something-something that will make it work
|
// make a something-something that will make it work
|
||||||
@@ -123,7 +129,8 @@ namespace PepperDash.Essentials.DM {
|
|||||||
controller.PropertiesConfig = properties;
|
controller.PropertiesConfig = properties;
|
||||||
return controller;
|
return controller;
|
||||||
}
|
}
|
||||||
catch (System.Exception e) {
|
catch (System.Exception e)
|
||||||
|
{
|
||||||
Debug.Console(0, "Error creating DM chassis:\r{0}", e);
|
Debug.Console(0, "Error creating DM chassis:\r{0}", e);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
@@ -137,7 +144,8 @@ namespace PepperDash.Essentials.DM {
|
|||||||
/// <param name="name"></param>
|
/// <param name="name"></param>
|
||||||
/// <param name="chassis"></param>
|
/// <param name="chassis"></param>
|
||||||
public DmBladeChassisController(string key, string name, BladeSwitch chassis)
|
public DmBladeChassisController(string key, string name, BladeSwitch chassis)
|
||||||
: base(key, name, chassis) {
|
: base(key, name, chassis)
|
||||||
|
{
|
||||||
Chassis = chassis;
|
Chassis = chassis;
|
||||||
InputPorts = new RoutingPortCollection<RoutingInputPort>();
|
InputPorts = new RoutingPortCollection<RoutingInputPort>();
|
||||||
OutputPorts = new RoutingPortCollection<RoutingOutputPort>();
|
OutputPorts = new RoutingPortCollection<RoutingOutputPort>();
|
||||||
@@ -161,68 +169,87 @@ namespace PepperDash.Essentials.DM {
|
|||||||
InputCardHdcpCapabilityFeedbacks = new Dictionary<uint, IntFeedback>();
|
InputCardHdcpCapabilityFeedbacks = 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++)
|
||||||
|
{
|
||||||
var tempX = x;
|
var tempX = x;
|
||||||
|
|
||||||
if (Chassis.Outputs[tempX] != null) {
|
if (Chassis.Outputs[tempX] != null)
|
||||||
VideoOutputFeedbacks[tempX] = new IntFeedback(() => {
|
{
|
||||||
|
VideoOutputFeedbacks[tempX] = new IntFeedback(() =>
|
||||||
|
{
|
||||||
if (Chassis.Outputs[tempX].VideoOutFeedback != null) { return (ushort)Chassis.Outputs[tempX].VideoOutFeedback.Number; }
|
if (Chassis.Outputs[tempX].VideoOutFeedback != null) { return (ushort)Chassis.Outputs[tempX].VideoOutFeedback.Number; }
|
||||||
else { return 0; };
|
else { return 0; };
|
||||||
});
|
});
|
||||||
|
|
||||||
OutputNameFeedbacks[tempX] = new StringFeedback(() => {
|
OutputNameFeedbacks[tempX] = new StringFeedback(() =>
|
||||||
if (Chassis.Outputs[tempX].NameFeedback != null) {
|
{
|
||||||
|
if (Chassis.Outputs[tempX].NameFeedback != null)
|
||||||
|
{
|
||||||
return Chassis.Outputs[tempX].NameFeedback.StringValue;
|
return Chassis.Outputs[tempX].NameFeedback.StringValue;
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
OutputVideoRouteNameFeedbacks[tempX] = new StringFeedback(() => {
|
OutputVideoRouteNameFeedbacks[tempX] = new StringFeedback(() =>
|
||||||
if (Chassis.Outputs[tempX].VideoOutFeedback != null) {
|
{
|
||||||
|
if (Chassis.Outputs[tempX].VideoOutFeedback != null)
|
||||||
|
{
|
||||||
return Chassis.Outputs[tempX].VideoOutFeedback.NameFeedback.StringValue;
|
return Chassis.Outputs[tempX].VideoOutFeedback.NameFeedback.StringValue;
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
OutputEndpointOnlineFeedbacks[tempX] = new BoolFeedback(() => {
|
OutputEndpointOnlineFeedbacks[tempX] = new BoolFeedback(() =>
|
||||||
|
{
|
||||||
//if (Chassis.Outputs[tempX].Endpoint != null)
|
//if (Chassis.Outputs[tempX].Endpoint != null)
|
||||||
// return Chassis.Outputs[tempX].Endpoint.IsOnline;
|
// return Chassis.Outputs[tempX].Endpoint.IsOnline;
|
||||||
//else
|
//else
|
||||||
return Chassis.Outputs[tempX].EndpointOnlineFeedback;
|
return Chassis.Outputs[tempX].EndpointOnlineFeedback;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Chassis.Inputs[tempX] != null) {
|
if (Chassis.Inputs[tempX] != null)
|
||||||
UsbInputRoutedToFeebacks[tempX] = new IntFeedback(() => {
|
{
|
||||||
|
UsbInputRoutedToFeebacks[tempX] = new IntFeedback(() =>
|
||||||
|
{
|
||||||
if (Chassis.Inputs[tempX].USBRoutedToFeedback != null) { return (ushort)Chassis.Inputs[tempX].USBRoutedToFeedback.Number; }
|
if (Chassis.Inputs[tempX].USBRoutedToFeedback != null) { return (ushort)Chassis.Inputs[tempX].USBRoutedToFeedback.Number; }
|
||||||
else { return 0; };
|
else { return 0; };
|
||||||
});
|
});
|
||||||
VideoInputSyncFeedbacks[tempX] = new BoolFeedback(() => {
|
VideoInputSyncFeedbacks[tempX] = new BoolFeedback(() =>
|
||||||
|
{
|
||||||
if (Chassis.Inputs[tempX].VideoDetectedFeedback != null)
|
if (Chassis.Inputs[tempX].VideoDetectedFeedback != null)
|
||||||
return Chassis.Inputs[tempX].VideoDetectedFeedback.BoolValue;
|
return Chassis.Inputs[tempX].VideoDetectedFeedback.BoolValue;
|
||||||
else
|
else
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
InputNameFeedbacks[tempX] = new StringFeedback(() => {
|
InputNameFeedbacks[tempX] = new StringFeedback(() =>
|
||||||
if (Chassis.Inputs[tempX].NameFeedback != null) {
|
{
|
||||||
|
if (Chassis.Inputs[tempX].NameFeedback != null)
|
||||||
|
{
|
||||||
return Chassis.Inputs[tempX].NameFeedback.StringValue;
|
return Chassis.Inputs[tempX].NameFeedback.StringValue;
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
InputEndpointOnlineFeedbacks[tempX] = new BoolFeedback(() => {
|
InputEndpointOnlineFeedbacks[tempX] = new BoolFeedback(() =>
|
||||||
|
{
|
||||||
return Chassis.Inputs[tempX].EndpointOnlineFeedback;
|
return Chassis.Inputs[tempX].EndpointOnlineFeedback;
|
||||||
});
|
});
|
||||||
|
|
||||||
InputCardHdcpCapabilityFeedbacks[tempX] = new IntFeedback(() => {
|
InputCardHdcpCapabilityFeedbacks[tempX] = new IntFeedback(() =>
|
||||||
|
{
|
||||||
var inputCard = Chassis.Inputs[tempX];
|
var inputCard = Chassis.Inputs[tempX];
|
||||||
|
|
||||||
if (inputCard.Card is DmHdmi4kInputBladeCard) {
|
if (inputCard.Card is DmHdmi4kInputBladeCard)
|
||||||
|
{
|
||||||
InputCardHdcpCapabilityTypes[tempX] = eHdcpCapabilityType.Hdcp2_2Support;
|
InputCardHdcpCapabilityTypes[tempX] = eHdcpCapabilityType.Hdcp2_2Support;
|
||||||
|
|
||||||
if ((inputCard.Card as DmHdmi4kInputBladeCard).Hdmi4kInput.HdcpSupportOnFeedback.BoolValue)
|
if ((inputCard.Card as DmHdmi4kInputBladeCard).Hdmi4kInput.HdcpSupportOnFeedback.BoolValue)
|
||||||
@@ -231,7 +258,8 @@ namespace PepperDash.Essentials.DM {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (inputCard.Card is DmC4kInputBladeCard) {
|
if (inputCard.Card is DmC4kInputBladeCard)
|
||||||
|
{
|
||||||
InputCardHdcpCapabilityTypes[tempX] = eHdcpCapabilityType.Hdcp2_2Support;
|
InputCardHdcpCapabilityTypes[tempX] = eHdcpCapabilityType.Hdcp2_2Support;
|
||||||
|
|
||||||
if ((inputCard.Card as DmC4kInputBladeCard).DmInput.HdcpCapabilityFeedback.Equals(eHdcpCapabilityType.HdcpSupportOff))
|
if ((inputCard.Card as DmC4kInputBladeCard).DmInput.HdcpCapabilityFeedback.Equals(eHdcpCapabilityType.HdcpSupportOff))
|
||||||
@@ -252,45 +280,56 @@ namespace PepperDash.Essentials.DM {
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="type"></param>
|
/// <param name="type"></param>
|
||||||
/// <param name="number"></param>
|
/// <param name="number"></param>
|
||||||
public void AddInputBlade(string type, uint number) {
|
public void AddInputBlade(string type, uint number)
|
||||||
|
{
|
||||||
Debug.Console(2, this, "Adding input blade '{0}', slot {1}", type, number);
|
Debug.Console(2, this, "Adding input blade '{0}', slot {1}", type, number);
|
||||||
|
|
||||||
type = type.ToLower();
|
type = type.ToLower();
|
||||||
|
|
||||||
if (type == "dmb4kihd") {
|
if (type == "dmb4kihd")
|
||||||
|
{
|
||||||
var inputBlade = new Dmb4kIHd(number, this.Chassis);
|
var inputBlade = new Dmb4kIHd(number, this.Chassis);
|
||||||
foreach (var item in inputBlade.Inputs) {
|
foreach (var item in inputBlade.Inputs)
|
||||||
|
{
|
||||||
var card = (item.Card as DmHdmi4kInputBladeCard).Hdmi4kInput;
|
var card = (item.Card as DmHdmi4kInputBladeCard).Hdmi4kInput;
|
||||||
var cecPort = card as ICec;
|
var cecPort = card as ICec;
|
||||||
AddHdmiInBladePorts(item.Number, cecPort);
|
AddHdmiInBladePorts(item.Number, cecPort);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (type == "dmb4kihddnt") {
|
else if (type == "dmb4kihddnt")
|
||||||
|
{
|
||||||
var inputBlade = new Dmb4kIHd(number, this.Chassis);
|
var inputBlade = new Dmb4kIHd(number, this.Chassis);
|
||||||
foreach (var item in inputBlade.Inputs) {
|
foreach (var item in inputBlade.Inputs)
|
||||||
|
{
|
||||||
var card = (item.Card as DmHdmi4kInputBladeCard).Hdmi4kInput;
|
var card = (item.Card as DmHdmi4kInputBladeCard).Hdmi4kInput;
|
||||||
var cecPort = card as ICec;
|
var cecPort = card as ICec;
|
||||||
AddHdmiInBladePorts(item.Number, cecPort);
|
AddHdmiInBladePorts(item.Number, cecPort);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (type == "dmb4kic") {
|
else if (type == "dmb4kic")
|
||||||
|
{
|
||||||
var inputBlade = new Dmb4kIC(number, this.Chassis);
|
var inputBlade = new Dmb4kIC(number, this.Chassis);
|
||||||
foreach (var item in inputBlade.Inputs) {
|
foreach (var item in inputBlade.Inputs)
|
||||||
|
{
|
||||||
AddDmInBladePorts(item.Number);
|
AddDmInBladePorts(item.Number);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (type == "dmbis") {
|
else if (type == "dmbis")
|
||||||
|
{
|
||||||
var inputBlade = new DmbIS(number, this.Chassis);
|
var inputBlade = new DmbIS(number, this.Chassis);
|
||||||
foreach (var item in inputBlade.Inputs) {
|
foreach (var item in inputBlade.Inputs)
|
||||||
|
{
|
||||||
AddDmInMmFiberPorts(item.Number);
|
AddDmInMmFiberPorts(item.Number);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (type == "dmbis2") {
|
else if (type == "dmbis2")
|
||||||
|
{
|
||||||
var inputBlade = new DmbIS2(number, this.Chassis);
|
var inputBlade = new DmbIS2(number, this.Chassis);
|
||||||
foreach (var item in inputBlade.Inputs) {
|
foreach (var item in inputBlade.Inputs)
|
||||||
|
{
|
||||||
AddDmInSmFiberPorts(item.Number);
|
AddDmInSmFiberPorts(item.Number);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -307,19 +346,23 @@ namespace PepperDash.Essentials.DM {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void AddHdmiInBladePorts(uint number, ICec cecPort) {
|
void AddHdmiInBladePorts(uint number, ICec cecPort)
|
||||||
|
{
|
||||||
AddInputPortWithDebug(number, "hdmiIn", eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.DmCat, cecPort);
|
AddInputPortWithDebug(number, "hdmiIn", eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.DmCat, cecPort);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AddDmInBladePorts(uint number) {
|
void AddDmInBladePorts(uint number)
|
||||||
|
{
|
||||||
AddInputPortWithDebug(number, "dmCIn", eRoutingSignalType.Video, eRoutingPortConnectionType.DmCat);
|
AddInputPortWithDebug(number, "dmCIn", eRoutingSignalType.Video, eRoutingPortConnectionType.DmCat);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AddDmInMmFiberPorts(uint number) {
|
void AddDmInMmFiberPorts(uint number)
|
||||||
|
{
|
||||||
AddInputPortWithDebug(number, "dmMmIn", eRoutingSignalType.Video, eRoutingPortConnectionType.DmMmFiber);
|
AddInputPortWithDebug(number, "dmMmIn", eRoutingSignalType.Video, eRoutingPortConnectionType.DmMmFiber);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AddDmInSmFiberPorts(uint number) {
|
void AddDmInSmFiberPorts(uint number)
|
||||||
|
{
|
||||||
AddInputPortWithDebug(number, "dmSmIn", eRoutingSignalType.Video, eRoutingPortConnectionType.DmSmFiber);
|
AddInputPortWithDebug(number, "dmSmIn", eRoutingSignalType.Video, eRoutingPortConnectionType.DmSmFiber);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -328,64 +371,81 @@ namespace PepperDash.Essentials.DM {
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="type"></param>
|
/// <param name="type"></param>
|
||||||
/// <param name="number"></param>
|
/// <param name="number"></param>
|
||||||
public void AddOutputBlade(string type, uint number) {
|
public void AddOutputBlade(string type, uint number)
|
||||||
|
{
|
||||||
type = type.ToLower();
|
type = type.ToLower();
|
||||||
|
|
||||||
Debug.Console(2, this, "Adding output blade '{0}', slot {1}", type, number);
|
Debug.Console(2, this, "Adding output blade '{0}', slot {1}", type, number);
|
||||||
if (type == "dmb4kohd") {
|
if (type == "dmb4kohd")
|
||||||
|
{
|
||||||
var outputBlade = new Dmb4KOHD(number, Chassis);
|
var outputBlade = new Dmb4KOHD(number, Chassis);
|
||||||
foreach (var item in outputBlade.Outputs) {
|
foreach (var item in outputBlade.Outputs)
|
||||||
|
{
|
||||||
AddHdmiOutBladePorts(item.Number);
|
AddHdmiOutBladePorts(item.Number);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (type == "dmb4kohddnt") {
|
else if (type == "dmb4kohddnt")
|
||||||
|
{
|
||||||
var outputBlade = new Dmb4KOHD(number, Chassis);
|
var outputBlade = new Dmb4KOHD(number, Chassis);
|
||||||
foreach (var item in outputBlade.Outputs) {
|
foreach (var item in outputBlade.Outputs)
|
||||||
|
{
|
||||||
AddHdmiOutBladePorts(item.Number);
|
AddHdmiOutBladePorts(item.Number);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (type == "dmb4koc") {
|
else if (type == "dmb4koc")
|
||||||
|
{
|
||||||
var outputBlade = new Dmb4KOC(number, Chassis);
|
var outputBlade = new Dmb4KOC(number, Chassis);
|
||||||
foreach (var item in outputBlade.Outputs) {
|
foreach (var item in outputBlade.Outputs)
|
||||||
|
{
|
||||||
AddDmOutBladePorts(item.Number);
|
AddDmOutBladePorts(item.Number);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (type == "dmb4koc") {
|
else if (type == "dmb4koc")
|
||||||
|
{
|
||||||
var outputBlade = new Dmb4KOC(number, Chassis);
|
var outputBlade = new Dmb4KOC(number, Chassis);
|
||||||
foreach (var item in outputBlade.Outputs) {
|
foreach (var item in outputBlade.Outputs)
|
||||||
|
{
|
||||||
AddDmOutBladePorts(item.Number);
|
AddDmOutBladePorts(item.Number);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (type == "dmbos") {
|
else if (type == "dmbos")
|
||||||
|
{
|
||||||
var outputBlade = new DmbOS(number, Chassis);
|
var outputBlade = new DmbOS(number, Chassis);
|
||||||
foreach (var item in outputBlade.Outputs) {
|
foreach (var item in outputBlade.Outputs)
|
||||||
|
{
|
||||||
AddDmOutMmFiberBladePorts(item.Number);
|
AddDmOutMmFiberBladePorts(item.Number);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (type == "dmbos2") {
|
else if (type == "dmbos2")
|
||||||
|
{
|
||||||
var outputBlade = new DmbOS2(number, Chassis);
|
var outputBlade = new DmbOS2(number, Chassis);
|
||||||
foreach (var item in outputBlade.Outputs) {
|
foreach (var item in outputBlade.Outputs)
|
||||||
|
{
|
||||||
AddDmOutSmFiberBladePorts(item.Number);
|
AddDmOutSmFiberBladePorts(item.Number);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AddHdmiOutBladePorts(uint number) {
|
void AddHdmiOutBladePorts(uint number)
|
||||||
AddOutputPortWithDebug(String.Format("outputBlade{0}", (number / 8 > 0 ? 1 : number / 8)), String.Format("hdmiOut{0}", number) , eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, Chassis.Outputs[number]);
|
{
|
||||||
|
AddOutputPortWithDebug(number, "hdmiOut", eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, Chassis.Outputs[number]);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AddDmOutBladePorts(uint number) {
|
void AddDmOutBladePorts(uint number)
|
||||||
AddOutputPortWithDebug(String.Format("outputBlade{0}", (number / 8 > 0 ? 1 : number / 8)), String.Format("dmOut{0}", number), eRoutingSignalType.Video, eRoutingPortConnectionType.DmCat, Chassis.Outputs[number]);
|
{
|
||||||
|
AddOutputPortWithDebug(number, "dmOut", eRoutingSignalType.Video, eRoutingPortConnectionType.DmCat, Chassis.Outputs[number]);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AddDmOutMmFiberBladePorts(uint number) {
|
void AddDmOutMmFiberBladePorts(uint number)
|
||||||
AddOutputPortWithDebug(String.Format("outputBlade{0}", (number / 8 > 0 ? 1 : number / 8)), String.Format("dmOut{0}", number), eRoutingSignalType.Video, eRoutingPortConnectionType.DmMmFiber, Chassis.Outputs[number]);
|
{
|
||||||
|
AddOutputPortWithDebug(number, "dmMmOut", eRoutingSignalType.Video, eRoutingPortConnectionType.DmMmFiber, Chassis.Outputs[number]);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AddDmOutSmFiberBladePorts(uint number) {
|
void AddDmOutSmFiberBladePorts(uint number)
|
||||||
AddOutputPortWithDebug(String.Format("outputBlade{0}", (number / 8 > 0 ? 1 : number / 8)), String.Format("dmOut{0}", number), eRoutingSignalType.Video, eRoutingPortConnectionType.DmSmFiber, Chassis.Outputs[number]);
|
{
|
||||||
|
AddOutputPortWithDebug(number, "dmSmOut", eRoutingSignalType.Video, eRoutingPortConnectionType.DmSmFiber, Chassis.Outputs[number]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -417,23 +477,44 @@ namespace PepperDash.Essentials.DM {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Adds OutputPort
|
/*void AddOutputPortWithDebug(string cardName, string portName, eRoutingSignalType sigType, eRoutingPortConnectionType portType, object selector) {
|
||||||
/// </summary>
|
|
||||||
void AddOutputPortWithDebug(string cardName, string portName, eRoutingSignalType sigType, eRoutingPortConnectionType portType, object selector) {
|
|
||||||
var portKey = string.Format("{0}--{1}", cardName, portName);
|
var portKey = string.Format("{0}--{1}", cardName, portName);
|
||||||
Debug.Console(2, this, "Adding output port '{0}'", portKey);
|
Debug.Console(2, this, "Adding output port '{0}'", portKey);
|
||||||
OutputPorts.Add(new RoutingOutputPort(portKey, sigType, portType, selector, this)
|
OutputPorts.Add(new RoutingOutputPort(portKey, sigType, portType, selector, this)
|
||||||
{
|
{
|
||||||
FeedbackMatchObject = selector
|
FeedbackMatchObject = selector
|
||||||
});
|
});
|
||||||
|
}*/
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Adds OutputPort
|
||||||
|
/// </summary>
|
||||||
|
void AddOutputPortWithDebug(uint cardNum, string portName, eRoutingSignalType sigType, eRoutingPortConnectionType portType, object selector)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var portKey = string.Format("outputCard{0}--{1}", cardNum, portName);
|
||||||
|
Debug.Console(2, this, "Adding output port '{0}'", portKey);
|
||||||
|
var outputPort = new RoutingOutputPort(portKey, sigType, portType, selector, this)
|
||||||
|
{
|
||||||
|
FeedbackMatchObject = Chassis.Outputs[cardNum]
|
||||||
|
};
|
||||||
|
OutputPorts.Add(outputPort);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Debug.Console(0, this, "Exception : {0}", ex);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
void AddVolumeControl(uint number, Audio.Output audio) {
|
void AddVolumeControl(uint number, Audio.Output audio)
|
||||||
|
{
|
||||||
VolumeControls.Add(number, new DmCardAudioOutputController(audio));
|
VolumeControls.Add(number, new DmCardAudioOutputController(audio));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -443,35 +524,43 @@ namespace PepperDash.Essentials.DM {
|
|||||||
//}
|
//}
|
||||||
|
|
||||||
|
|
||||||
void Chassis_DMInputChange(Switch device, DMInputEventArgs args) {
|
void Chassis_DMInputChange(Switch device, DMInputEventArgs args)
|
||||||
|
{
|
||||||
|
|
||||||
switch (args.EventId) {
|
switch (args.EventId)
|
||||||
case DMInputEventIds.EndpointOnlineEventId: {
|
{
|
||||||
|
case DMInputEventIds.EndpointOnlineEventId:
|
||||||
|
{
|
||||||
Debug.Console(2, this, "DM Input EndpointOnlineEventId for input: {0}. State: {1}", args.Number, device.Inputs[args.Number].EndpointOnlineFeedback);
|
Debug.Console(2, this, "DM Input EndpointOnlineEventId for input: {0}. State: {1}", args.Number, device.Inputs[args.Number].EndpointOnlineFeedback);
|
||||||
InputEndpointOnlineFeedbacks[args.Number].FireUpdate();
|
InputEndpointOnlineFeedbacks[args.Number].FireUpdate();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case DMInputEventIds.OnlineFeedbackEventId: {
|
case DMInputEventIds.OnlineFeedbackEventId:
|
||||||
|
{
|
||||||
Debug.Console(2, this, "DM Input OnlineFeedbackEventId for input: {0}. State: {1}", args.Number, device.Inputs[args.Number].EndpointOnlineFeedback);
|
Debug.Console(2, this, "DM Input OnlineFeedbackEventId for input: {0}. State: {1}", args.Number, device.Inputs[args.Number].EndpointOnlineFeedback);
|
||||||
InputEndpointOnlineFeedbacks[args.Number].FireUpdate();
|
InputEndpointOnlineFeedbacks[args.Number].FireUpdate();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case DMInputEventIds.VideoDetectedEventId: {
|
case DMInputEventIds.VideoDetectedEventId:
|
||||||
|
{
|
||||||
Debug.Console(2, this, "DM Input {0} VideoDetectedEventId", args.Number);
|
Debug.Console(2, this, "DM Input {0} VideoDetectedEventId", args.Number);
|
||||||
VideoInputSyncFeedbacks[args.Number].FireUpdate();
|
VideoInputSyncFeedbacks[args.Number].FireUpdate();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case DMInputEventIds.InputNameEventId: {
|
case DMInputEventIds.InputNameEventId:
|
||||||
|
{
|
||||||
Debug.Console(2, this, "DM Input {0} NameFeedbackEventId", args.Number);
|
Debug.Console(2, this, "DM Input {0} NameFeedbackEventId", args.Number);
|
||||||
InputNameFeedbacks[args.Number].FireUpdate();
|
InputNameFeedbacks[args.Number].FireUpdate();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case DMInputEventIds.HdcpCapabilityFeedbackEventId: {
|
case DMInputEventIds.HdcpCapabilityFeedbackEventId:
|
||||||
|
{
|
||||||
Debug.Console(2, this, "DM Input {0} HdcpCapabilityFeedbackEventId", args.Number);
|
Debug.Console(2, this, "DM Input {0} HdcpCapabilityFeedbackEventId", args.Number);
|
||||||
InputCardHdcpCapabilityFeedbacks[args.Number].FireUpdate();
|
InputCardHdcpCapabilityFeedbacks[args.Number].FireUpdate();
|
||||||
break;
|
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);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -487,74 +576,74 @@ namespace PepperDash.Essentials.DM {
|
|||||||
switch (args.EventId)
|
switch (args.EventId)
|
||||||
{
|
{
|
||||||
case DMOutputEventIds.VolumeEventId:
|
case DMOutputEventIds.VolumeEventId:
|
||||||
{
|
|
||||||
if (VolumeControls.ContainsKey(output))
|
|
||||||
{
|
{
|
||||||
VolumeControls[args.Number].VolumeEventFromChassis();
|
if (VolumeControls.ContainsKey(output))
|
||||||
|
{
|
||||||
|
VolumeControls[args.Number].VolumeEventFromChassis();
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
}
|
|
||||||
case DMOutputEventIds.EndpointOnlineEventId:
|
case DMOutputEventIds.EndpointOnlineEventId:
|
||||||
{
|
{
|
||||||
Debug.Console(2, this,
|
|
||||||
"Output {0} DMOutputEventIds.EndpointOnlineEventId fired. EndpointOnlineFeedback State: {1}",
|
|
||||||
args.Number, Chassis.Outputs[output].EndpointOnlineFeedback);
|
|
||||||
if (Chassis.Outputs[output].Endpoint != null)
|
|
||||||
Debug.Console(2, this,
|
Debug.Console(2, this,
|
||||||
"Output {0} DMOutputEventIds.EndpointOnlineEventId fired. Endpoint.IsOnline State: {1}",
|
"Output {0} DMOutputEventIds.EndpointOnlineEventId fired. EndpointOnlineFeedback State: {1}",
|
||||||
args.Number, Chassis.Outputs[output].Endpoint.IsOnline);
|
args.Number, Chassis.Outputs[output].EndpointOnlineFeedback);
|
||||||
|
if (Chassis.Outputs[output].Endpoint != null)
|
||||||
|
Debug.Console(2, this,
|
||||||
|
"Output {0} DMOutputEventIds.EndpointOnlineEventId fired. Endpoint.IsOnline State: {1}",
|
||||||
|
args.Number, Chassis.Outputs[output].Endpoint.IsOnline);
|
||||||
|
|
||||||
OutputEndpointOnlineFeedbacks[output].FireUpdate();
|
OutputEndpointOnlineFeedbacks[output].FireUpdate();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case DMOutputEventIds.OnlineFeedbackEventId:
|
case DMOutputEventIds.OnlineFeedbackEventId:
|
||||||
{
|
{
|
||||||
Debug.Console(2, this, "Output {0} DMInputEventIds.OnlineFeedbackEventId fired. State: {1}",
|
Debug.Console(2, this, "Output {0} DMInputEventIds.OnlineFeedbackEventId fired. State: {1}",
|
||||||
args.Number, Chassis.Outputs[output].EndpointOnlineFeedback);
|
args.Number, Chassis.Outputs[output].EndpointOnlineFeedback);
|
||||||
OutputEndpointOnlineFeedbacks[output].FireUpdate();
|
OutputEndpointOnlineFeedbacks[output].FireUpdate();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case DMOutputEventIds.VideoOutEventId:
|
case DMOutputEventIds.VideoOutEventId:
|
||||||
{
|
|
||||||
|
|
||||||
var inputNumber = Chassis.Outputs[output].VideoOutFeedback == null ? 0 : Chassis.Outputs[output].VideoOutFeedback.Number;
|
|
||||||
|
|
||||||
Debug.Console(2, this, "DMSwitchAudioVideo:{0} Routed Input:{1} Output:{2}'", this.Name,
|
|
||||||
inputNumber, output);
|
|
||||||
|
|
||||||
if (VideoOutputFeedbacks.ContainsKey(output))
|
|
||||||
{
|
{
|
||||||
var localInputPort = InputPorts.FirstOrDefault(p => (DMInput)p.FeedbackMatchObject == Chassis.Outputs[output].VideoOutFeedback);
|
|
||||||
var localOutputPort =
|
var inputNumber = Chassis.Outputs[output].VideoOutFeedback == null ? 0 : Chassis.Outputs[output].VideoOutFeedback.Number;
|
||||||
OutputPorts.FirstOrDefault(p => (DMOutput) p.FeedbackMatchObject == Chassis.Outputs[output]);
|
|
||||||
|
Debug.Console(2, this, "DMSwitchAudioVideo:{0} Routed Input:{1} Output:{2}'", this.Name,
|
||||||
|
inputNumber, output);
|
||||||
|
|
||||||
|
if (VideoOutputFeedbacks.ContainsKey(output))
|
||||||
|
{
|
||||||
|
var localInputPort = InputPorts.FirstOrDefault(p => (DMInput)p.FeedbackMatchObject == Chassis.Outputs[output].VideoOutFeedback);
|
||||||
|
var localOutputPort =
|
||||||
|
OutputPorts.FirstOrDefault(p => (DMOutput)p.FeedbackMatchObject == Chassis.Outputs[output]);
|
||||||
|
|
||||||
|
|
||||||
VideoOutputFeedbacks[output].FireUpdate();
|
VideoOutputFeedbacks[output].FireUpdate();
|
||||||
OnSwitchChange(new RoutingNumericEventArgs(output,
|
OnSwitchChange(new RoutingNumericEventArgs(output,
|
||||||
inputNumber,
|
inputNumber,
|
||||||
localOutputPort,
|
localOutputPort,
|
||||||
localInputPort,
|
localInputPort,
|
||||||
eRoutingSignalType.AudioVideo));
|
eRoutingSignalType.AudioVideo));
|
||||||
|
|
||||||
|
}
|
||||||
|
if (OutputVideoRouteNameFeedbacks.ContainsKey(output))
|
||||||
|
{
|
||||||
|
OutputVideoRouteNameFeedbacks[output].FireUpdate();
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
if (OutputVideoRouteNameFeedbacks.ContainsKey(output))
|
|
||||||
{
|
|
||||||
OutputVideoRouteNameFeedbacks[output].FireUpdate();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case DMOutputEventIds.OutputNameEventId:
|
case DMOutputEventIds.OutputNameEventId:
|
||||||
{
|
{
|
||||||
Debug.Console(2, this, "DM Output {0} NameFeedbackEventId", output);
|
Debug.Console(2, this, "DM Output {0} NameFeedbackEventId", output);
|
||||||
OutputNameFeedbacks[output].FireUpdate();
|
OutputNameFeedbacks[output].FireUpdate();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
Debug.Console(2, this, "DMOutputChange fired for Output {0} with Unhandled EventId: {1}",
|
Debug.Console(2, this, "DMOutputChange fired for Output {0} with Unhandled EventId: {1}",
|
||||||
args.Number, args.EventId);
|
args.Number, args.EventId);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -564,7 +653,8 @@ namespace PepperDash.Essentials.DM {
|
|||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="pnt"></param>
|
/// <param name="pnt"></param>
|
||||||
void StartOffTimer(PortNumberType pnt) {
|
void StartOffTimer(PortNumberType pnt)
|
||||||
|
{
|
||||||
if (RouteOffTimers.ContainsKey(pnt))
|
if (RouteOffTimers.ContainsKey(pnt))
|
||||||
return;
|
return;
|
||||||
RouteOffTimers[pnt] = new CTimer(o => ExecuteSwitch(null, pnt.Selector, pnt.Type), RouteOffTime);
|
RouteOffTimers[pnt] = new CTimer(o => ExecuteSwitch(null, pnt.Selector, pnt.Type), RouteOffTime);
|
||||||
@@ -572,8 +662,10 @@ namespace PepperDash.Essentials.DM {
|
|||||||
|
|
||||||
|
|
||||||
// Send out sigs when coming online
|
// Send out sigs when coming online
|
||||||
void IsOnline_OutputChange(object sender, EventArgs e) {
|
void IsOnline_OutputChange(object sender, EventArgs e)
|
||||||
if (IsOnline.BoolValue) {
|
{
|
||||||
|
if (IsOnline.BoolValue)
|
||||||
|
{
|
||||||
Chassis.EnableUSBBreakaway.BoolValue = true;
|
Chassis.EnableUSBBreakaway.BoolValue = true;
|
||||||
|
|
||||||
if (InputNames != null)
|
if (InputNames != null)
|
||||||
@@ -587,12 +679,13 @@ namespace PepperDash.Essentials.DM {
|
|||||||
|
|
||||||
#region IRouting Members
|
#region IRouting Members
|
||||||
|
|
||||||
public void ExecuteSwitch(object inputSelector, object outputSelector, eRoutingSignalType sigType) {
|
public void ExecuteSwitch(object inputSelector, object outputSelector, eRoutingSignalType sigType)
|
||||||
|
{
|
||||||
Debug.Console(2, this, "Making an awesome DM route from {0} to {1} {2}", inputSelector, outputSelector, sigType);
|
Debug.Console(2, this, "Making an awesome DM route from {0} to {1} {2}", inputSelector, outputSelector, sigType);
|
||||||
|
|
||||||
var input = inputSelector as DMInput; // Cast can sometimes fail
|
var input = inputSelector as DMInput; // Cast can sometimes fail
|
||||||
var output = outputSelector as DMOutput;
|
var output = outputSelector as DMOutput;
|
||||||
|
|
||||||
|
|
||||||
if (output == null)
|
if (output == null)
|
||||||
{
|
{
|
||||||
@@ -605,11 +698,14 @@ namespace PepperDash.Essentials.DM {
|
|||||||
// Check to see if there's an off timer waiting on this and if so, cancel
|
// Check to see if there's an off timer waiting on this and if so, cancel
|
||||||
var key = new PortNumberType(output, sigType);
|
var key = new PortNumberType(output, sigType);
|
||||||
|
|
||||||
if (input == null) {
|
if (input == null)
|
||||||
|
{
|
||||||
StartOffTimer(key);
|
StartOffTimer(key);
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
if (RouteOffTimers.ContainsKey(key)) {
|
{
|
||||||
|
if (RouteOffTimers.ContainsKey(key))
|
||||||
|
{
|
||||||
Debug.Console(2, this, "{0} cancelling route off due to new source", output);
|
Debug.Console(2, this, "{0} cancelling route off due to new source", output);
|
||||||
RouteOffTimers[key].Stop();
|
RouteOffTimers[key].Stop();
|
||||||
RouteOffTimers.Remove(key);
|
RouteOffTimers.Remove(key);
|
||||||
@@ -671,7 +767,7 @@ namespace PepperDash.Essentials.DM {
|
|||||||
var ioSlotJoin = ioSlot - 1;
|
var ioSlotJoin = ioSlot - 1;
|
||||||
|
|
||||||
// Control
|
// Control
|
||||||
trilist.SetUShortSigAction(joinMap.OutputVideo.JoinNumber + ioSlotJoin, o => ExecuteNumericSwitch(o, (ushort) ioSlot, eRoutingSignalType.Video));
|
trilist.SetUShortSigAction(joinMap.OutputVideo.JoinNumber + ioSlotJoin, o => ExecuteNumericSwitch(o, (ushort)ioSlot, eRoutingSignalType.Video));
|
||||||
|
|
||||||
if (TxDictionary.ContainsKey(ioSlot))
|
if (TxDictionary.ContainsKey(ioSlot))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -25,9 +25,16 @@ namespace PepperDash.Essentials.DM
|
|||||||
|
|
||||||
public CrestronControlSystem Dmps { get; set; }
|
public CrestronControlSystem Dmps { get; set; }
|
||||||
public ISystemControl SystemControl { get; private set; }
|
public ISystemControl SystemControl { get; private set; }
|
||||||
|
|
||||||
|
//Check if DMPS is a DMPS3-4K type for endpoint creation
|
||||||
|
public bool Dmps4kType { get; private set; }
|
||||||
|
|
||||||
//IroutingNumericEvent
|
//IroutingNumericEvent
|
||||||
public event EventHandler<RoutingNumericEventArgs> NumericSwitchChange;
|
public event EventHandler<RoutingNumericEventArgs> NumericSwitchChange;
|
||||||
|
|
||||||
|
//Feedback for DMPS System Power
|
||||||
|
public BoolFeedback SystemPowerOnFeedback { get; private set; }
|
||||||
|
public BoolFeedback SystemPowerOffFeedback { get; private set; }
|
||||||
|
|
||||||
// Feedbacks for EssentialDM
|
// Feedbacks for EssentialDM
|
||||||
public Dictionary<uint, IntFeedback> VideoOutputFeedbacks { get; private set; }
|
public Dictionary<uint, IntFeedback> VideoOutputFeedbacks { get; private set; }
|
||||||
@@ -112,10 +119,29 @@ namespace PepperDash.Essentials.DM
|
|||||||
/// <param name="chassis"></param>
|
/// <param name="chassis"></param>
|
||||||
public DmpsRoutingController(string key, string name, ISystemControl systemControl)
|
public DmpsRoutingController(string key, string name, ISystemControl systemControl)
|
||||||
: base(key, name)
|
: base(key, name)
|
||||||
{
|
{
|
||||||
|
|
||||||
Dmps = Global.ControlSystem;
|
Dmps = Global.ControlSystem;
|
||||||
SystemControl = systemControl;
|
|
||||||
|
switch (name.Replace("-", "").Replace("c", "").Replace("C", ""))
|
||||||
|
{
|
||||||
|
case "dmps34k50":
|
||||||
|
case "dmps34k100":
|
||||||
|
case "dmps34k150":
|
||||||
|
SystemControl = systemControl as Dmps34K150CSystemControl;
|
||||||
|
Dmps4kType = true;
|
||||||
|
break;
|
||||||
|
case "dmps34k200":
|
||||||
|
case "dmps34k250":
|
||||||
|
case "dmps34k300":
|
||||||
|
case "dmps34k350":
|
||||||
|
SystemControl = systemControl as Dmps34K300CSystemControl;
|
||||||
|
Dmps4kType = true;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
SystemControl = systemControl as Dmps3SystemControl;
|
||||||
|
Dmps4kType = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
InputPorts = new RoutingPortCollection<RoutingInputPort>();
|
InputPorts = new RoutingPortCollection<RoutingInputPort>();
|
||||||
OutputPorts = new RoutingPortCollection<RoutingOutputPort>();
|
OutputPorts = new RoutingPortCollection<RoutingOutputPort>();
|
||||||
@@ -123,6 +149,29 @@ namespace PepperDash.Essentials.DM
|
|||||||
TxDictionary = new Dictionary<uint, string>();
|
TxDictionary = new Dictionary<uint, string>();
|
||||||
RxDictionary = new Dictionary<uint, string>();
|
RxDictionary = new Dictionary<uint, string>();
|
||||||
|
|
||||||
|
SystemPowerOnFeedback = new BoolFeedback(() =>
|
||||||
|
{
|
||||||
|
if (SystemControl is Dmps3SystemControl)
|
||||||
|
{
|
||||||
|
return ((Dmps3SystemControl)SystemControl).SystemPowerOnFeedBack.BoolValue;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
SystemPowerOffFeedback = new BoolFeedback(() =>
|
||||||
|
{
|
||||||
|
if (SystemControl is Dmps3SystemControl)
|
||||||
|
{
|
||||||
|
return ((Dmps3SystemControl)SystemControl).SystemPowerOffFeedBack.BoolValue;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
VideoOutputFeedbacks = new Dictionary<uint, IntFeedback>();
|
VideoOutputFeedbacks = new Dictionary<uint, IntFeedback>();
|
||||||
AudioOutputFeedbacks = new Dictionary<uint, IntFeedback>();
|
AudioOutputFeedbacks = new Dictionary<uint, IntFeedback>();
|
||||||
VideoInputSyncFeedbacks = new Dictionary<uint, BoolFeedback>();
|
VideoInputSyncFeedbacks = new Dictionary<uint, BoolFeedback>();
|
||||||
@@ -154,6 +203,7 @@ namespace PepperDash.Essentials.DM
|
|||||||
// Subscribe to events
|
// Subscribe to events
|
||||||
Dmps.DMInputChange += Dmps_DMInputChange;
|
Dmps.DMInputChange += Dmps_DMInputChange;
|
||||||
Dmps.DMOutputChange += Dmps_DMOutputChange;
|
Dmps.DMOutputChange += Dmps_DMOutputChange;
|
||||||
|
Dmps.DMSystemChange += Dmps_DMSystemChange;
|
||||||
|
|
||||||
return base.CustomActivate();
|
return base.CustomActivate();
|
||||||
}
|
}
|
||||||
@@ -191,6 +241,22 @@ namespace PepperDash.Essentials.DM
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void SetPowerOn(bool a)
|
||||||
|
{
|
||||||
|
if (SystemControl is Dmps3SystemControl)
|
||||||
|
{
|
||||||
|
((Dmps3SystemControl)SystemControl).SystemPowerOn();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetPowerOff(bool a)
|
||||||
|
{
|
||||||
|
if (SystemControl is Dmps3SystemControl)
|
||||||
|
{
|
||||||
|
((Dmps3SystemControl)SystemControl).SystemPowerOff();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
||||||
{
|
{
|
||||||
var joinMap = new DmpsRoutingControllerJoinMap(joinStart);
|
var joinMap = new DmpsRoutingControllerJoinMap(joinStart);
|
||||||
@@ -211,9 +277,22 @@ namespace PepperDash.Essentials.DM
|
|||||||
|
|
||||||
Debug.Console(1, this, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
Debug.Console(1, this, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
||||||
|
|
||||||
|
//Link up system
|
||||||
|
trilist.SetBoolSigAction(joinMap.SystemPowerOn.JoinNumber, SetPowerOn);
|
||||||
|
trilist.SetBoolSigAction(joinMap.SystemPowerOff.JoinNumber, SetPowerOff);
|
||||||
|
if (SystemPowerOnFeedback != null)
|
||||||
|
{
|
||||||
|
SystemPowerOnFeedback.LinkInputSig(
|
||||||
|
trilist.BooleanInput[joinMap.SystemPowerOn.JoinNumber]);
|
||||||
|
}
|
||||||
|
if (SystemPowerOffFeedback != null)
|
||||||
|
{
|
||||||
|
SystemPowerOffFeedback.LinkInputSig(
|
||||||
|
trilist.BooleanInput[joinMap.SystemPowerOff.JoinNumber]);
|
||||||
|
}
|
||||||
|
|
||||||
// Link up outputs
|
// Link up outputs
|
||||||
LinkInputsToApi(trilist, joinMap);
|
LinkInputsToApi(trilist, joinMap);
|
||||||
|
|
||||||
LinkOutputsToApi(trilist, joinMap);
|
LinkOutputsToApi(trilist, joinMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -719,28 +798,36 @@ namespace PepperDash.Essentials.DM
|
|||||||
|
|
||||||
void Dmps_DMInputChange(Switch device, DMInputEventArgs args)
|
void Dmps_DMInputChange(Switch device, DMInputEventArgs args)
|
||||||
{
|
{
|
||||||
//Debug.Console(2, this, "DMSwitch:{0} Input:{1} Event:{2}'", this.Name, args.Number, args.EventId.ToString());
|
try
|
||||||
|
|
||||||
switch (args.EventId)
|
|
||||||
{
|
{
|
||||||
case (DMInputEventIds.OnlineFeedbackEventId):
|
switch (args.EventId)
|
||||||
{
|
{
|
||||||
Debug.Console(2, this, "DM Input OnlineFeedbackEventId for input: {0}. State: {1}", args.Number, device.Inputs[args.Number].EndpointOnlineFeedback);
|
case (DMInputEventIds.OnlineFeedbackEventId):
|
||||||
InputEndpointOnlineFeedbacks[args.Number].FireUpdate();
|
{
|
||||||
break;
|
Debug.Console(2, this, "DM Input OnlineFeedbackEventId for input: {0}. State: {1}", args.Number, device.Inputs[args.Number].EndpointOnlineFeedback);
|
||||||
}
|
InputEndpointOnlineFeedbacks[args.Number].FireUpdate();
|
||||||
case (DMInputEventIds.VideoDetectedEventId):
|
break;
|
||||||
{
|
}
|
||||||
Debug.Console(2, this, "DM Input {0} VideoDetectedEventId", args.Number);
|
case (DMInputEventIds.VideoDetectedEventId):
|
||||||
VideoInputSyncFeedbacks[args.Number].FireUpdate();
|
{
|
||||||
break;
|
Debug.Console(2, this, "DM Input {0} VideoDetectedEventId", args.Number);
|
||||||
}
|
VideoInputSyncFeedbacks[args.Number].FireUpdate();
|
||||||
case (DMInputEventIds.InputNameEventId):
|
break;
|
||||||
{
|
}
|
||||||
Debug.Console(2, this, "DM Input {0} NameFeedbackEventId", args.Number);
|
case (DMInputEventIds.InputNameEventId):
|
||||||
InputNameFeedbacks[args.Number].FireUpdate();
|
{
|
||||||
break;
|
Debug.Console(2, this, "DM Input {0} NameFeedbackEventId", args.Number);
|
||||||
}
|
if(InputNameFeedbacks.ContainsKey(args.Number))
|
||||||
|
{
|
||||||
|
InputNameFeedbacks[args.Number].FireUpdate();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Debug.Console(0, Debug.ErrorLogLevel.Notice, "DMSwitch Input Change:{0} Input:{1} Event:{2}\rException: {3}", this.Name, args.Number, args.EventId.ToString(), e.ToString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void Dmps_DMOutputChange(Switch device, DMOutputEventArgs args)
|
void Dmps_DMOutputChange(Switch device, DMOutputEventArgs args)
|
||||||
@@ -812,6 +899,23 @@ namespace PepperDash.Essentials.DM
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Dmps_DMSystemChange(Switch device, DMSystemEventArgs args)
|
||||||
|
{
|
||||||
|
switch (args.EventId)
|
||||||
|
{
|
||||||
|
case DMSystemEventIds.SystemPowerOnEventId:
|
||||||
|
{
|
||||||
|
SystemPowerOnFeedback.FireUpdate();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case DMSystemEventIds.SystemPowerOffEventId:
|
||||||
|
{
|
||||||
|
SystemPowerOffFeedback.FireUpdate();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -879,7 +983,6 @@ namespace PepperDash.Essentials.DM
|
|||||||
// NOTE THAT BITWISE COMPARISONS - TO CATCH ALL ROUTING TYPES
|
// NOTE THAT BITWISE COMPARISONS - TO CATCH ALL ROUTING TYPES
|
||||||
if ((sigType & eRoutingSignalType.Video) == eRoutingSignalType.Video)
|
if ((sigType & eRoutingSignalType.Video) == eRoutingSignalType.Video)
|
||||||
{
|
{
|
||||||
|
|
||||||
output.VideoOut = input;
|
output.VideoOut = input;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -903,7 +1006,6 @@ namespace PepperDash.Essentials.DM
|
|||||||
|
|
||||||
if ((sigType & eRoutingSignalType.UsbOutput) == eRoutingSignalType.UsbOutput)
|
if ((sigType & eRoutingSignalType.UsbOutput) == eRoutingSignalType.UsbOutput)
|
||||||
{
|
{
|
||||||
|
|
||||||
output.USBRoutedTo = input;
|
output.USBRoutedTo = input;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -329,7 +329,14 @@ namespace PepperDash.Essentials.DM
|
|||||||
var parentDev = DeviceManager.GetDeviceForKey(pKey);
|
var parentDev = DeviceManager.GetDeviceForKey(pKey);
|
||||||
if (parentDev is DmpsRoutingController)
|
if (parentDev is DmpsRoutingController)
|
||||||
{
|
{
|
||||||
return GetDmRmcControllerForDmps(key, name, typeName, parentDev as DmpsRoutingController, props.ParentOutputNumber);
|
if ((parentDev as DmpsRoutingController).Dmps4kType)
|
||||||
|
{
|
||||||
|
return GetDmRmcControllerForDmps4k(key, name, typeName, parentDev as DmpsRoutingController, props.ParentOutputNumber);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return GetDmRmcControllerForDmps(key, name, typeName, ipid, parentDev as DmpsRoutingController, props.ParentOutputNumber);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (!(parentDev is IDmSwitch))
|
if (!(parentDev is IDmSwitch))
|
||||||
{
|
{
|
||||||
@@ -395,25 +402,47 @@ namespace PepperDash.Essentials.DM
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static CrestronGenericBaseDevice GetDmRmcControllerForDmps(string key, string name, string typeName,
|
private static CrestronGenericBaseDevice GetDmRmcControllerForDmps(string key, string name, string typeName,
|
||||||
|
uint ipid, DmpsRoutingController controller, uint num)
|
||||||
|
{
|
||||||
|
Func<string, string, uint, DMOutput, CrestronGenericBaseDevice> dmpsHandler;
|
||||||
|
if (ChassisDict.TryGetValue(typeName.ToLower(), out dmpsHandler))
|
||||||
|
{
|
||||||
|
var output = controller.Dmps.SwitcherOutputs[num] as DMOutput;
|
||||||
|
|
||||||
|
if (output != null)
|
||||||
|
{
|
||||||
|
return dmpsHandler(key, name, ipid, output);
|
||||||
|
}
|
||||||
|
Debug.Console(0, Debug.ErrorLogLevel.Error,
|
||||||
|
"Cannot attach DM-RMC of type '{0}' to output {1} on DMPS chassis. Output is not a DM Output.",
|
||||||
|
typeName, num);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
Debug.Console(0, Debug.ErrorLogLevel.Error, "Cannot create DM-RMC of type '{0}' to output {1} on DMPS chassis", typeName, num);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static CrestronGenericBaseDevice GetDmRmcControllerForDmps4k(string key, string name, string typeName,
|
||||||
DmpsRoutingController controller, uint num)
|
DmpsRoutingController controller, uint num)
|
||||||
{
|
{
|
||||||
Func<string, string, DMOutput, CrestronGenericBaseDevice> dmpsHandler;
|
Func<string, string, DMOutput, CrestronGenericBaseDevice> dmps4kHandler;
|
||||||
if (ChassisCpu3Dict.TryGetValue(typeName.ToLower(), out dmpsHandler))
|
if (ChassisCpu3Dict.TryGetValue(typeName.ToLower(), out dmps4kHandler))
|
||||||
{
|
{
|
||||||
var output = controller.Dmps.SwitcherOutputs[num] as DMOutput;
|
var output = controller.Dmps.SwitcherOutputs[num] as DMOutput;
|
||||||
|
|
||||||
if (output != null)
|
if (output != null)
|
||||||
{
|
{
|
||||||
return dmpsHandler(key, name, output);
|
return dmps4kHandler(key, name, output);
|
||||||
}
|
}
|
||||||
Debug.Console(0, Debug.ErrorLogLevel.Error,
|
Debug.Console(0, Debug.ErrorLogLevel.Error,
|
||||||
"Cannot attach DM-RMC of type '{0}' to output {1} on DMPS chassis. Output is not a DM Output.",
|
"Cannot attach DM-RMC of type '{0}' to output {1} on DMPS-4K chassis. Output is not a DM Output.",
|
||||||
typeName, num);
|
typeName, num);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
Debug.Console(0, Debug.ErrorLogLevel.Error, "Cannot create DM-RMC of type '{0}' to output {1} on DMPS chassis", typeName, num);
|
Debug.Console(0, Debug.ErrorLogLevel.Error, "Cannot create DM-RMC of type '{0}' to output {1} on DMPS-4K chassis", typeName, num);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ namespace PepperDash.Essentials.DM
|
|||||||
var ipid = props.Control.IpIdInt;
|
var ipid = props.Control.IpIdInt;
|
||||||
var pKey = props.ParentDeviceKey.ToLower();
|
var pKey = props.ParentDeviceKey.ToLower();
|
||||||
|
|
||||||
if (pKey == "processor")
|
if (pKey == "processor")
|
||||||
{
|
{
|
||||||
// Catch constructor failures, mainly dues to IPID
|
// Catch constructor failures, mainly dues to IPID
|
||||||
try
|
try
|
||||||
@@ -65,99 +65,135 @@ namespace PepperDash.Essentials.DM
|
|||||||
{
|
{
|
||||||
Debug.Console(0, "[{0}] WARNING: Cannot create DM-TX device: {1}", key, e);
|
Debug.Console(0, "[{0}] WARNING: Cannot create DM-TX device: {1}", key, e);
|
||||||
}
|
}
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
var parentDev = DeviceManager.GetDeviceForKey(pKey);
|
|
||||||
if (!(parentDev is IDmSwitch))
|
|
||||||
{
|
|
||||||
Debug.Console(0, "Cannot create DM device '{0}'. '{1}' is not a DM Chassis.",
|
|
||||||
key, pKey);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
var parentDev = DeviceManager.GetDeviceForKey(pKey);
|
||||||
|
DMInput dmInput;
|
||||||
|
bool isCpu3 = false;
|
||||||
|
|
||||||
|
if (parentDev is IDmSwitch)
|
||||||
|
{
|
||||||
// Get the Crestron chassis and link stuff up
|
// Get the Crestron chassis and link stuff up
|
||||||
var switchDev = (parentDev as IDmSwitch);
|
var switchDev = (parentDev as IDmSwitch);
|
||||||
var chassis = switchDev.Chassis;
|
var chassis = switchDev.Chassis;
|
||||||
|
|
||||||
var num = props.ParentInputNumber;
|
//Check that the input is within range of this chassis' possible inputs
|
||||||
if (num <= 0 || num > chassis.NumberOfInputs)
|
var num = props.ParentInputNumber;
|
||||||
{
|
if (num <= 0 || num > chassis.NumberOfInputs)
|
||||||
Debug.Console(0, "Cannot create DM device '{0}'. Input number '{1}' is out of range",
|
{
|
||||||
key, num);
|
Debug.Console(0, "Cannot create DM device '{0}'. Input number '{1}' is out of range",
|
||||||
return null;
|
key, num);
|
||||||
}
|
return null;
|
||||||
else
|
}
|
||||||
|
|
||||||
|
switchDev.TxDictionary.Add(num, key);
|
||||||
|
dmInput = chassis.Inputs[num];
|
||||||
|
|
||||||
|
//Determine if IpId is needed for this chassis type
|
||||||
|
if (chassis is DmMd8x8Cpu3 || chassis is DmMd16x16Cpu3 ||
|
||||||
|
chassis is DmMd32x32Cpu3 || chassis is DmMd8x8Cpu3rps ||
|
||||||
|
chassis is DmMd16x16Cpu3rps || chassis is DmMd32x32Cpu3rps ||
|
||||||
|
chassis is DmMd128x128 || chassis is DmMd64x64)
|
||||||
{
|
{
|
||||||
var controller = (parentDev as IDmSwitch);
|
isCpu3 = true;
|
||||||
controller.TxDictionary.Add(num, key);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Catch constructor failures, mainly dues to IPID
|
}
|
||||||
try
|
else if(parentDev is DmpsRoutingController)
|
||||||
{
|
{
|
||||||
// Must use different constructor for CPU3 chassis types. No IPID
|
// Get the DMPS chassis and link stuff up
|
||||||
if (chassis is DmMd8x8Cpu3 || chassis is DmMd16x16Cpu3 ||
|
var dmpsDev = (parentDev as DmpsRoutingController);
|
||||||
chassis is DmMd32x32Cpu3 || chassis is DmMd8x8Cpu3rps ||
|
var chassis = dmpsDev.Dmps;
|
||||||
chassis is DmMd16x16Cpu3rps || chassis is DmMd32x32Cpu3rps||
|
|
||||||
chassis is DmMd128x128 || chassis is DmMd64x64)
|
//Check that the input is within range of this chassis' possible inputs
|
||||||
{
|
var num = props.ParentInputNumber;
|
||||||
if (typeName.StartsWith("dmtx200"))
|
if (num <= 0 || num > chassis.SwitcherInputs.Count)
|
||||||
return new DmTx200Controller(key, name, new DmTx200C2G(chassis.Inputs[num]));
|
{
|
||||||
if (typeName.StartsWith("dmtx201c"))
|
Debug.Console(0, "Cannot create DMPS device '{0}'. Input number '{1}' is out of range",
|
||||||
return new DmTx201CController(key, name, new DmTx201C(chassis.Inputs[num]));
|
key, num);
|
||||||
if (typeName.StartsWith("dmtx201s"))
|
return null;
|
||||||
return new DmTx201SController(key, name, new DmTx201S(chassis.Inputs[num]));
|
}
|
||||||
if (typeName.StartsWith("dmtx4k100"))
|
|
||||||
return new DmTx4k100Controller(key, name, new DmTx4K100C1G(chassis.Inputs[num]));
|
dmpsDev.TxDictionary.Add(num, key);
|
||||||
if (typeName.StartsWith("dmtx4kz100"))
|
|
||||||
return new DmTx4kz100Controller(key, name, new DmTx4kz100C1G(chassis.Inputs[num]));
|
try
|
||||||
if (typeName.StartsWith("dmtx4k202"))
|
{
|
||||||
return new DmTx4k202CController(key, name, new DmTx4k202C(chassis.Inputs[num]));
|
dmInput = chassis.SwitcherInputs[num] as DMInput;
|
||||||
if (typeName.StartsWith("dmtx4kz202"))
|
}
|
||||||
return new DmTx4kz202CController(key, name, new DmTx4kz202C(chassis.Inputs[num]));
|
catch
|
||||||
if (typeName.StartsWith("dmtx4k302"))
|
{
|
||||||
return new DmTx4k302CController(key, name, new DmTx4k302C(chassis.Inputs[num]));
|
Debug.Console(0, "Cannot create DMPS device '{0}'. Input number '{1}' is not a DM input", key, num);
|
||||||
if (typeName.StartsWith("dmtx4kz302"))
|
return null;
|
||||||
return new DmTx4kz302CController(key, name, new DmTx4kz302C(chassis.Inputs[num]));
|
}
|
||||||
if (typeName.StartsWith("dmtx401"))
|
}
|
||||||
return new DmTx401CController(key, name, new DmTx401C(chassis.Inputs[num]));
|
|
||||||
if (typeName.StartsWith("hdbasettx"))
|
else
|
||||||
return new HDBaseTTxController(key, name, new HDTx3CB(chassis.Inputs[num]));
|
{
|
||||||
}
|
Debug.Console(0, "Cannot create DM device '{0}'. '{1}' is not a processor, DM Chassis or DMPS.", key, pKey);
|
||||||
else
|
return null;
|
||||||
{
|
|
||||||
if (typeName.StartsWith("dmtx200"))
|
|
||||||
return new DmTx200Controller(key, name, new DmTx200C2G(ipid, chassis.Inputs[num]));
|
|
||||||
if (typeName.StartsWith("dmtx201c"))
|
|
||||||
return new DmTx201CController(key, name, new DmTx201C(ipid, chassis.Inputs[num]));
|
|
||||||
if (typeName.StartsWith("dmtx201s"))
|
|
||||||
return new DmTx201SController(key, name, new DmTx201S(ipid, chassis.Inputs[num]));
|
|
||||||
if (typeName.StartsWith("dmtx4k100"))
|
|
||||||
return new DmTx4k100Controller(key, name, new DmTx4K100C1G(ipid, chassis.Inputs[num]));
|
|
||||||
if (typeName.StartsWith("dmtx4kz100"))
|
|
||||||
return new DmTx4kz100Controller(key, name, new DmTx4kz100C1G(ipid, chassis.Inputs[num]));
|
|
||||||
if (typeName.StartsWith("dmtx4k202"))
|
|
||||||
return new DmTx4k202CController(key, name, new DmTx4k202C(ipid, chassis.Inputs[num]));
|
|
||||||
if (typeName.StartsWith("dmtx4kz202"))
|
|
||||||
return new DmTx4kz202CController(key, name, new DmTx4kz202C(ipid, chassis.Inputs[num]));
|
|
||||||
if (typeName.StartsWith("dmtx4k302"))
|
|
||||||
return new DmTx4k302CController(key, name, new DmTx4k302C(ipid, chassis.Inputs[num]));
|
|
||||||
if (typeName.StartsWith("dmtx4kz302"))
|
|
||||||
return new DmTx4kz302CController(key, name, new DmTx4kz302C(ipid, chassis.Inputs[num]));
|
|
||||||
if (typeName.StartsWith("dmtx401"))
|
|
||||||
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)
|
|
||||||
{
|
|
||||||
Debug.Console(0, "[{0}] WARNING: Cannot create DM-TX device: {1}", key, e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
try
|
||||||
|
{
|
||||||
|
// Must use different constructor for CPU3 or DMPS3-4K types. No IPID
|
||||||
|
if (isCpu3 || Global.ControlSystemIsDmps4kType)
|
||||||
|
{
|
||||||
|
if (typeName.StartsWith("dmtx200"))
|
||||||
|
return new DmTx200Controller(key, name, new DmTx200C2G(dmInput));
|
||||||
|
if (typeName.StartsWith("dmtx201c"))
|
||||||
|
return new DmTx201CController(key, name, new DmTx201C(dmInput));
|
||||||
|
if (typeName.StartsWith("dmtx201s"))
|
||||||
|
return new DmTx201SController(key, name, new DmTx201S(dmInput));
|
||||||
|
if (typeName.StartsWith("dmtx4k100"))
|
||||||
|
return new DmTx4k100Controller(key, name, new DmTx4K100C1G(dmInput));
|
||||||
|
if (typeName.StartsWith("dmtx4kz100"))
|
||||||
|
return new DmTx4kz100Controller(key, name, new DmTx4kz100C1G(dmInput));
|
||||||
|
if (typeName.StartsWith("dmtx4k202"))
|
||||||
|
return new DmTx4k202CController(key, name, new DmTx4k202C(dmInput));
|
||||||
|
if (typeName.StartsWith("dmtx4kz202"))
|
||||||
|
return new DmTx4kz202CController(key, name, new DmTx4kz202C(dmInput));
|
||||||
|
if (typeName.StartsWith("dmtx4k302"))
|
||||||
|
return new DmTx4k302CController(key, name, new DmTx4k302C(dmInput));
|
||||||
|
if (typeName.StartsWith("dmtx4kz302"))
|
||||||
|
return new DmTx4kz302CController(key, name, new DmTx4kz302C(dmInput));
|
||||||
|
if (typeName.StartsWith("dmtx401"))
|
||||||
|
return new DmTx401CController(key, name, new DmTx401C(dmInput));
|
||||||
|
if (typeName.StartsWith("hdbasettx"))
|
||||||
|
return new HDBaseTTxController(key, name, new HDTx3CB(dmInput));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (typeName.StartsWith("dmtx200"))
|
||||||
|
return new DmTx200Controller(key, name, new DmTx200C2G(ipid, dmInput));
|
||||||
|
if (typeName.StartsWith("dmtx201c"))
|
||||||
|
return new DmTx201CController(key, name, new DmTx201C(ipid, dmInput));
|
||||||
|
if (typeName.StartsWith("dmtx201s"))
|
||||||
|
return new DmTx201SController(key, name, new DmTx201S(ipid, dmInput));
|
||||||
|
if (typeName.StartsWith("dmtx4k100"))
|
||||||
|
return new DmTx4k100Controller(key, name, new DmTx4K100C1G(ipid, dmInput));
|
||||||
|
if (typeName.StartsWith("dmtx4kz100"))
|
||||||
|
return new DmTx4kz100Controller(key, name, new DmTx4kz100C1G(ipid, dmInput));
|
||||||
|
if (typeName.StartsWith("dmtx4k202"))
|
||||||
|
return new DmTx4k202CController(key, name, new DmTx4k202C(ipid, dmInput));
|
||||||
|
if (typeName.StartsWith("dmtx4kz202"))
|
||||||
|
return new DmTx4kz202CController(key, name, new DmTx4kz202C(ipid, dmInput));
|
||||||
|
if (typeName.StartsWith("dmtx4k302"))
|
||||||
|
return new DmTx4k302CController(key, name, new DmTx4k302C(ipid, dmInput));
|
||||||
|
if (typeName.StartsWith("dmtx4kz302"))
|
||||||
|
return new DmTx4kz302CController(key, name, new DmTx4kz302C(ipid, dmInput));
|
||||||
|
if (typeName.StartsWith("dmtx401"))
|
||||||
|
return new DmTx401CController(key, name, new DmTx401C(ipid, dmInput));
|
||||||
|
if (typeName.StartsWith("hdbasettx"))
|
||||||
|
return new HDBaseTTxController(key, name, new HDTx3CB(ipid, dmInput));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Debug.Console(0, "[{0}] WARNING: Cannot create DM-TX device: {1}", key, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -185,11 +221,12 @@ namespace PepperDash.Essentials.DM
|
|||||||
protected DmTxControllerBase(string key, string name, EndpointTransmitterBase hardware)
|
protected DmTxControllerBase(string key, string name, EndpointTransmitterBase hardware)
|
||||||
: base(key, name, hardware)
|
: base(key, name, hardware)
|
||||||
{
|
{
|
||||||
// if wired to a chassis, skip registration step in base class
|
// if wired to a chassis or DMPS, skip registration step in base class
|
||||||
if (hardware.DMInput != null)
|
if (hardware.DMInput != null || (Global.ControlSystemIsDmpsType && hardware.DMInput != null))
|
||||||
{
|
{
|
||||||
this.PreventRegistration = true;
|
this.PreventRegistration = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
AddToFeedbackList(ActiveVideoInputFeedback);
|
AddToFeedbackList(ActiveVideoInputFeedback);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -216,21 +216,11 @@ namespace PepperDash.Essentials.Devices.Common.Cameras
|
|||||||
var presetsCamera = cameraDevice as IHasCameraPresets;
|
var presetsCamera = cameraDevice as IHasCameraPresets;
|
||||||
presetsCamera.PresetsListHasChanged += new EventHandler<EventArgs>((o, a) =>
|
presetsCamera.PresetsListHasChanged += new EventHandler<EventArgs>((o, a) =>
|
||||||
{
|
{
|
||||||
for (int i = 1; i <= joinMap.NumberOfPresets.JoinNumber; i++)
|
SendCameraPresetNamesToApi(presetsCamera, joinMap, trilist);
|
||||||
{
|
|
||||||
int tempNum = i - 1;
|
|
||||||
|
|
||||||
string label = "";
|
|
||||||
|
|
||||||
var preset = presetsCamera.Presets.FirstOrDefault(p => p.ID.Equals(i));
|
|
||||||
|
|
||||||
if (preset != null)
|
|
||||||
label = preset.Description;
|
|
||||||
|
|
||||||
trilist.SetString((ushort) (joinMap.PresetLabelStart.JoinNumber + tempNum), label);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
SendCameraPresetNamesToApi(presetsCamera, joinMap, trilist);
|
||||||
|
|
||||||
for (int i = 0; i < joinMap.NumberOfPresets.JoinNumber; i++)
|
for (int i = 0; i < joinMap.NumberOfPresets.JoinNumber; i++)
|
||||||
{
|
{
|
||||||
int tempNum = i;
|
int tempNum = i;
|
||||||
@@ -246,10 +236,35 @@ namespace PepperDash.Essentials.Devices.Common.Cameras
|
|||||||
presetsCamera.PresetStore(tempNum, label);
|
presetsCamera.PresetStore(tempNum, label);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
trilist.OnlineStatusChange += (sender, args) =>
|
||||||
|
{
|
||||||
|
if (!args.DeviceOnLine)
|
||||||
|
{ return; }
|
||||||
|
|
||||||
|
SendCameraPresetNamesToApi(presetsCamera, joinMap, trilist);
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private void SendCameraPresetNamesToApi(IHasCameraPresets presetsCamera, CameraControllerJoinMap joinMap, BasicTriList trilist)
|
||||||
|
{
|
||||||
|
for (int i = 1; i <= joinMap.NumberOfPresets.JoinNumber; i++)
|
||||||
|
{
|
||||||
|
int tempNum = i - 1;
|
||||||
|
|
||||||
|
string label = "";
|
||||||
|
|
||||||
|
var preset = presetsCamera.Presets.FirstOrDefault(p => p.ID.Equals(i));
|
||||||
|
|
||||||
|
if (preset != null)
|
||||||
|
label = preset.Description;
|
||||||
|
|
||||||
|
trilist.SetString((ushort)(joinMap.PresetLabelStart.JoinNumber + tempNum), label);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public class CameraPreset : PresetBase
|
public class CameraPreset : PresetBase
|
||||||
{
|
{
|
||||||
public CameraPreset(int id, string description, bool isDefined, bool isDefinable)
|
public CameraPreset(int id, string description, bool isDefined, bool isDefinable)
|
||||||
|
|||||||
@@ -525,6 +525,15 @@ namespace PepperDash.Essentials.Devices.Common.Cameras
|
|||||||
|
|
||||||
public event EventHandler<EventArgs> PresetsListHasChanged;
|
public event EventHandler<EventArgs> PresetsListHasChanged;
|
||||||
|
|
||||||
|
protected void OnPresetsListHasChanged()
|
||||||
|
{
|
||||||
|
var handler = PresetsListHasChanged;
|
||||||
|
if (handler == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
handler.Invoke(this, EventArgs.Empty);
|
||||||
|
}
|
||||||
|
|
||||||
public List<CameraPreset> Presets { get; private set; }
|
public List<CameraPreset> Presets { get; private set; }
|
||||||
|
|
||||||
public void PresetSelect(int preset)
|
public void PresetSelect(int preset)
|
||||||
@@ -537,6 +546,7 @@ namespace PepperDash.Essentials.Devices.Common.Cameras
|
|||||||
SavePreset(preset);
|
SavePreset(preset);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region IHasCameraFocusControl Members
|
#region IHasCameraFocusControl Members
|
||||||
|
|||||||
@@ -0,0 +1,45 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using Crestron.SimplSharp;
|
||||||
|
|
||||||
|
using PepperDash.Essentials.Core;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Devices.Common.Codec
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Describes a device that has Do Not Disturb mode capability
|
||||||
|
/// </summary>
|
||||||
|
public interface IHasDoNotDisturbMode
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Indictes whether Do Not Disturb mode is on (Activated)
|
||||||
|
/// </summary>
|
||||||
|
BoolFeedback DoNotDisturbModeIsOnFeedback { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Activates Do Not Disturb mode
|
||||||
|
/// </summary>
|
||||||
|
void ActivateDoNotDisturbMode();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Deactivates Do Not Disturb mode
|
||||||
|
/// </summary>
|
||||||
|
void DeactivateDoNotDisturbMode();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Toggles Do Not Disturb mode
|
||||||
|
/// </summary>
|
||||||
|
void ToggleDoNotDisturbMode();
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface IHasDoNotDisturbModeWithTimeout : IHasDoNotDisturbMode
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Activates Do Not Disturb mode with a timeout
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="timeout"></param>
|
||||||
|
void ActivateDoNotDisturbMode(int timeout);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -108,6 +108,7 @@
|
|||||||
<Compile Include="Codec\eCodecCallStatus.cs" />
|
<Compile Include="Codec\eCodecCallStatus.cs" />
|
||||||
<Compile Include="Codec\eMeetingPrivacy.cs" />
|
<Compile Include="Codec\eMeetingPrivacy.cs" />
|
||||||
<Compile Include="Codec\iCodecAudio.cs" />
|
<Compile Include="Codec\iCodecAudio.cs" />
|
||||||
|
<Compile Include="Codec\IHasDoNotDisturb.cs" />
|
||||||
<Compile Include="Codec\IHasExternalSourceSwitching.cs" />
|
<Compile Include="Codec\IHasExternalSourceSwitching.cs" />
|
||||||
<Compile Include="ImageProcessors\TVOneCorio.cs" />
|
<Compile Include="ImageProcessors\TVOneCorio.cs" />
|
||||||
<Compile Include="ImageProcessors\TVOneCorioPropertiesConfig.cs" />
|
<Compile Include="ImageProcessors\TVOneCorioPropertiesConfig.cs" />
|
||||||
@@ -117,6 +118,7 @@
|
|||||||
<Compile Include="ImageProcessors\AnalogWay\AnalogWayLiveCorePropertiesConfig.cs" />
|
<Compile Include="ImageProcessors\AnalogWay\AnalogWayLiveCorePropertiesConfig.cs" />
|
||||||
<Compile Include="SoftCodec\BlueJeansPc.cs" />
|
<Compile Include="SoftCodec\BlueJeansPc.cs" />
|
||||||
<Compile Include="VideoCodec\CiscoCodec\CiscoCamera.cs" />
|
<Compile Include="VideoCodec\CiscoCodec\CiscoCamera.cs" />
|
||||||
|
<Compile Include="VideoCodec\CiscoCodec\CiscoCodecJoinMap.cs" />
|
||||||
<Compile Include="VideoCodec\CiscoCodec\RoomPresets.cs" />
|
<Compile Include="VideoCodec\CiscoCodec\RoomPresets.cs" />
|
||||||
<Compile Include="Cameras\CameraControl.cs" />
|
<Compile Include="Cameras\CameraControl.cs" />
|
||||||
<Compile Include="Display\PanasonicThDisplay.cs" />
|
<Compile Include="Display\PanasonicThDisplay.cs" />
|
||||||
@@ -127,6 +129,7 @@
|
|||||||
<Compile Include="VideoCodec\Interfaces\IHasPresentationOnlyMeeting.cs" />
|
<Compile Include="VideoCodec\Interfaces\IHasPresentationOnlyMeeting.cs" />
|
||||||
<Compile Include="VideoCodec\Interfaces\IHasSelfviewPosition.cs" />
|
<Compile Include="VideoCodec\Interfaces\IHasSelfviewPosition.cs" />
|
||||||
<Compile Include="VideoCodec\Interfaces\IHasSelfviewSize.cs" />
|
<Compile Include="VideoCodec\Interfaces\IHasSelfviewSize.cs" />
|
||||||
|
<Compile Include="VideoCodec\Interfaces\IHasStandbyMode.cs" />
|
||||||
<Compile Include="VideoCodec\Interfaces\IHasStartMeeting.cs" />
|
<Compile Include="VideoCodec\Interfaces\IHasStartMeeting.cs" />
|
||||||
<Compile Include="VideoCodec\Interfaces\iVideoCodecInfo.cs" />
|
<Compile Include="VideoCodec\Interfaces\iVideoCodecInfo.cs" />
|
||||||
<Compile Include="Codec\iHasCallFavorites.cs" />
|
<Compile Include="Codec\iHasCallFavorites.cs" />
|
||||||
|
|||||||
@@ -0,0 +1,134 @@
|
|||||||
|
using System;
|
||||||
|
using PepperDash.Essentials.Core;
|
||||||
|
using PepperDash.Essentials.Core.Bridges.JoinMaps;
|
||||||
|
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
||||||
|
{
|
||||||
|
public class CiscoCodecJoinMap : VideoCodecControllerJoinMap
|
||||||
|
{
|
||||||
|
#region Digital
|
||||||
|
|
||||||
|
[JoinName("ActivateDoNotDisturbMode")]
|
||||||
|
public JoinDataComplete ActivateDoNotDisturbMode = new JoinDataComplete(
|
||||||
|
new JoinData
|
||||||
|
{
|
||||||
|
JoinNumber = 221,
|
||||||
|
JoinSpan = 1
|
||||||
|
},
|
||||||
|
new JoinMetadata
|
||||||
|
{
|
||||||
|
Description = "Activates Do Not Disturb Mode. FB High if active.",
|
||||||
|
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
|
||||||
|
JoinType = eJoinType.Digital
|
||||||
|
});
|
||||||
|
|
||||||
|
[JoinName("DeactivateDoNotDisturbMode")]
|
||||||
|
public JoinDataComplete DeactivateDoNotDisturbMode = new JoinDataComplete(
|
||||||
|
new JoinData
|
||||||
|
{
|
||||||
|
JoinNumber = 222,
|
||||||
|
JoinSpan = 1
|
||||||
|
},
|
||||||
|
new JoinMetadata
|
||||||
|
{
|
||||||
|
Description = "Deactivates Do Not Disturb Mode. FB High if deactivated.",
|
||||||
|
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
|
||||||
|
JoinType = eJoinType.Digital
|
||||||
|
});
|
||||||
|
|
||||||
|
[JoinName("ToggleDoNotDisturbMode")]
|
||||||
|
public JoinDataComplete ToggleDoNotDisturbMode = new JoinDataComplete(
|
||||||
|
new JoinData
|
||||||
|
{
|
||||||
|
JoinNumber = 223,
|
||||||
|
JoinSpan = 1
|
||||||
|
},
|
||||||
|
new JoinMetadata
|
||||||
|
{
|
||||||
|
Description = "Toggles Do Not Disturb Mode.",
|
||||||
|
JoinCapabilities = eJoinCapabilities.ToSIMPL,
|
||||||
|
JoinType = eJoinType.Digital
|
||||||
|
});
|
||||||
|
|
||||||
|
[JoinName("ActivateStandby")]
|
||||||
|
public JoinDataComplete ActivateStandby = new JoinDataComplete(
|
||||||
|
new JoinData
|
||||||
|
{
|
||||||
|
JoinNumber = 226,
|
||||||
|
JoinSpan = 1
|
||||||
|
},
|
||||||
|
new JoinMetadata
|
||||||
|
{
|
||||||
|
Description = "Activates Standby Mode. FB High if active.",
|
||||||
|
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
|
||||||
|
JoinType = eJoinType.Digital
|
||||||
|
});
|
||||||
|
|
||||||
|
[JoinName("DeactivateStandby")]
|
||||||
|
public JoinDataComplete DeactivateStandby = new JoinDataComplete(
|
||||||
|
new JoinData
|
||||||
|
{
|
||||||
|
JoinNumber = 227,
|
||||||
|
JoinSpan = 1
|
||||||
|
},
|
||||||
|
new JoinMetadata
|
||||||
|
{
|
||||||
|
Description = "Deactivates Standby Mode. FB High if deactivated.",
|
||||||
|
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
|
||||||
|
JoinType = eJoinType.Digital
|
||||||
|
});
|
||||||
|
|
||||||
|
[JoinName("ActivateHalfWakeMode")]
|
||||||
|
public JoinDataComplete ActivateHalfWakeMode = new JoinDataComplete(
|
||||||
|
new JoinData
|
||||||
|
{
|
||||||
|
JoinNumber = 228,
|
||||||
|
JoinSpan = 1
|
||||||
|
},
|
||||||
|
new JoinMetadata
|
||||||
|
{
|
||||||
|
Description = "Activates Half Wake Mode. FB High if active.",
|
||||||
|
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
|
||||||
|
JoinType = eJoinType.Digital
|
||||||
|
});
|
||||||
|
|
||||||
|
[JoinName("EnteringStandbyMode")]
|
||||||
|
public JoinDataComplete EnteringStandbyMode = new JoinDataComplete(
|
||||||
|
new JoinData
|
||||||
|
{
|
||||||
|
JoinNumber = 229,
|
||||||
|
JoinSpan = 1
|
||||||
|
},
|
||||||
|
new JoinMetadata
|
||||||
|
{
|
||||||
|
Description = "High to indicate that the codec is entering standby mode",
|
||||||
|
JoinCapabilities = eJoinCapabilities.ToSIMPL,
|
||||||
|
JoinType = eJoinType.Digital
|
||||||
|
});
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
#region Analog
|
||||||
|
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
#region Serials
|
||||||
|
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
public CiscoCodecJoinMap(uint joinStart)
|
||||||
|
: base(joinStart, typeof(CiscoCodecJoinMap))
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public CiscoCodecJoinMap(uint joinStart, Type type)
|
||||||
|
: base(joinStart, type)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -440,9 +440,26 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
|||||||
public CallId CallId { get; set; }
|
public CallId CallId { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class DoNotDisturb
|
public class DoNotDisturb : ValueProperty
|
||||||
{
|
{
|
||||||
public string Value { get; set; }
|
string _Value;
|
||||||
|
|
||||||
|
public bool BoolValue { get; private set; }
|
||||||
|
|
||||||
|
public string Value
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return _Value;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_Value = value;
|
||||||
|
// If the incoming value is "On" it sets the BoolValue true, otherwise sets it false
|
||||||
|
BoolValue = value == "On" || value == "Active";
|
||||||
|
OnValueChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class Mode
|
public class Mode
|
||||||
@@ -600,6 +617,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
|||||||
public Conference2()
|
public Conference2()
|
||||||
{
|
{
|
||||||
Presentation = new Presentation();
|
Presentation = new Presentation();
|
||||||
|
DoNotDisturb = new DoNotDisturb();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1380,12 +1398,16 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
|||||||
|
|
||||||
public class State : ValueProperty
|
public class State : ValueProperty
|
||||||
{
|
{
|
||||||
|
string _value;
|
||||||
|
|
||||||
public bool BoolValue { get; private set; }
|
public bool BoolValue { get; private set; }
|
||||||
|
|
||||||
public string Value // Valid values are Standby/EnteringStandby/Halfwake/Off
|
public string Value // Valid values are Standby/EnteringStandby/Halfwake/Off
|
||||||
{
|
{
|
||||||
|
get { return _value; }
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
|
_value = value;
|
||||||
// If the incoming value is "On" it sets the BoolValue true, otherwise sets it false
|
// If the incoming value is "On" it sets the BoolValue true, otherwise sets it false
|
||||||
BoolValue = value == "On" || value == "Standby";
|
BoolValue = value == "On" || value == "Standby";
|
||||||
OnValueChanged();
|
OnValueChanged();
|
||||||
@@ -2091,6 +2113,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
|||||||
Conference = new Conference2();
|
Conference = new Conference2();
|
||||||
SystemUnit = new SystemUnit();
|
SystemUnit = new SystemUnit();
|
||||||
Video = new Video();
|
Video = new Video();
|
||||||
|
Conference = new Conference2();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,34 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using Crestron.SimplSharp;
|
||||||
|
|
||||||
|
using PepperDash.Essentials.Core;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Describes a device that has Standby Mode capability
|
||||||
|
/// </summary>
|
||||||
|
public interface IHasStandbyMode
|
||||||
|
{
|
||||||
|
BoolFeedback StandbyIsOnFeedback { get; }
|
||||||
|
|
||||||
|
void StandbyActivate();
|
||||||
|
|
||||||
|
void StandbyDeactivate();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Describes a device that has Half Waek Mode capability
|
||||||
|
/// </summary>
|
||||||
|
public interface IHasHalfWakeMode : IHasStandbyMode
|
||||||
|
{
|
||||||
|
BoolFeedback HalfWakeModeIsOnFeedback { get; }
|
||||||
|
|
||||||
|
BoolFeedback EnteringStandbyModeFeedback { get; }
|
||||||
|
|
||||||
|
void HalfwakeActivate();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -25,7 +25,7 @@ using Feedback = PepperDash.Essentials.Core.Feedback;
|
|||||||
namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
||||||
{
|
{
|
||||||
public abstract class VideoCodecBase : ReconfigurableDevice, IRoutingInputsOutputs,
|
public abstract class VideoCodecBase : ReconfigurableDevice, IRoutingInputsOutputs,
|
||||||
IUsageTracking, IHasDialer, IHasContentSharing, ICodecAudio, iVideoCodecInfo, IBridgeAdvanced
|
IUsageTracking, IHasDialer, IHasContentSharing, ICodecAudio, iVideoCodecInfo, IBridgeAdvanced, IHasStandbyMode
|
||||||
{
|
{
|
||||||
private const int XSigEncoding = 28591;
|
private const int XSigEncoding = 28591;
|
||||||
protected const int MaxParticipants = 50;
|
protected const int MaxParticipants = 50;
|
||||||
|
|||||||
Reference in New Issue
Block a user