diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/DeviceManager.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/DeviceManager.cs index df864550..57bf2287 100644 --- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/DeviceManager.cs +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/DeviceManager.cs @@ -14,6 +14,7 @@ namespace PepperDash.Essentials.Core public static class DeviceManager { public static event EventHandler AllDevicesActivated; + public static event EventHandler AllDevicesRegistered; private static readonly CCriticalSection DeviceCriticalSection = new CCriticalSection(); private static readonly CEvent AllowAddDevicesCEvent = new CEvent(false, true); @@ -57,6 +58,8 @@ namespace PepperDash.Essentials.Core { try { + OnAllDevicesRegistered(); + DeviceCriticalSection.Enter(); AddDeviceEnabled = false; // PreActivate all devices @@ -129,6 +132,15 @@ namespace PepperDash.Essentials.Core } } + private static void OnAllDevicesRegistered() + { + var handler = AllDevicesRegistered; + if (handler != null) + { + handler(null, new EventArgs()); + } + } + /// /// Calls activate on all Device class items /// diff --git a/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmpsRoutingController.cs b/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmpsRoutingController.cs index 22dfc195..5c03e8e9 100644 --- a/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmpsRoutingController.cs +++ b/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmpsRoutingController.cs @@ -26,13 +26,10 @@ namespace PepperDash.Essentials.DM public CrestronControlSystem Dmps { get; set; } public ISystemControl SystemControl { get; private set; } public bool? EnableRouting { get; private set; } - - //Check if DMPS is a DMPS3-4K type for endpoint creation - public bool Dmps4kType { get; private set; } //IroutingNumericEvent public event EventHandler NumericSwitchChange; - + //Feedback for DMPS System Control public BoolFeedback SystemPowerOnFeedback { get; private set; } public BoolFeedback SystemPowerOffFeedback { get; private set; } @@ -123,14 +120,13 @@ namespace PepperDash.Essentials.DM /// public DmpsRoutingController(string key, string name, ISystemControl systemControl) : base(key, name) - { + { Dmps = Global.ControlSystem; - + switch (systemControl.SystemControlType) { case eSystemControlType.Dmps34K150CSystemControl: SystemControl = systemControl as Dmps34K150CSystemControl; - Dmps4kType = true; SystemPowerOnFeedback = new BoolFeedback(() => { return true; }); SystemPowerOffFeedback = new BoolFeedback(() => { return false; }); break; @@ -139,13 +135,11 @@ namespace PepperDash.Essentials.DM case eSystemControlType.Dmps34K300CSystemControl: case eSystemControlType.Dmps34K350CSystemControl: SystemControl = systemControl as Dmps34K300CSystemControl; - Dmps4kType = true; SystemPowerOnFeedback = new BoolFeedback(() => { return true; }); SystemPowerOffFeedback = new BoolFeedback(() => { return false; }); break; default: SystemControl = systemControl as Dmps3SystemControl; - Dmps4kType = false; SystemPowerOnFeedback = new BoolFeedback(() => { return ((Dmps3SystemControl)SystemControl).SystemPowerOnFeedBack.BoolValue; @@ -156,7 +150,7 @@ namespace PepperDash.Essentials.DM }); break; } - Debug.Console(1, this, "DMPS Type = {0}, 4K Type = {1}", systemControl.SystemControlType, Dmps4kType); + Debug.Console(1, this, "DMPS Type = {0}, 4K Type = {1}", systemControl.SystemControlType, Global.ControlSystemIsDmps4kType); InputPorts = new RoutingPortCollection(); OutputPorts = new RoutingPortCollection(); @@ -406,7 +400,7 @@ namespace PepperDash.Essentials.DM private void LinkInputsToApi(BasicTriList trilist, DmpsRoutingControllerJoinMap joinMap) { - if (Dmps4kType) + if (Global.ControlSystemIsDmps4kType) { //DMPS-4K audio inputs 1-5 are aux inputs for (uint i = 1; i <= 5; i++) @@ -427,12 +421,12 @@ namespace PepperDash.Essentials.DM trilist.BooleanInput[joinMap.VideoSyncStatus.JoinNumber + ioSlotJoin]); } - if (InputNameFeedbacks.ContainsKey(ioSlot) && InputNameFeedbacks[ioSlot] != null) + if (InputNameFeedbacks.ContainsKey(ioSlot) && InputNameFeedbacks[ioSlot] != null) { InputNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.InputNames.JoinNumber + ioSlotJoin]); InputNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.InputVideoNames.JoinNumber + ioSlotJoin]); - if (Dmps4kType) + if (Global.ControlSystemIsDmps4kType) { //DMPS-4K Audio Inputs are offset by 5 InputNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.InputAudioNames.JoinNumber + ioSlotJoin + 5]);