mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-15 04:34:56 +00:00
Removes redundant check for DMPS-4K type. Property exists elsewhere
This commit is contained in:
@@ -14,6 +14,7 @@ namespace PepperDash.Essentials.Core
|
|||||||
public static class DeviceManager
|
public static class DeviceManager
|
||||||
{
|
{
|
||||||
public static event EventHandler<EventArgs> AllDevicesActivated;
|
public static event EventHandler<EventArgs> AllDevicesActivated;
|
||||||
|
public static event EventHandler<EventArgs> AllDevicesRegistered;
|
||||||
|
|
||||||
private static readonly CCriticalSection DeviceCriticalSection = new CCriticalSection();
|
private static readonly CCriticalSection DeviceCriticalSection = new CCriticalSection();
|
||||||
private static readonly CEvent AllowAddDevicesCEvent = new CEvent(false, true);
|
private static readonly CEvent AllowAddDevicesCEvent = new CEvent(false, true);
|
||||||
@@ -57,6 +58,8 @@ namespace PepperDash.Essentials.Core
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
OnAllDevicesRegistered();
|
||||||
|
|
||||||
DeviceCriticalSection.Enter();
|
DeviceCriticalSection.Enter();
|
||||||
AddDeviceEnabled = false;
|
AddDeviceEnabled = false;
|
||||||
// PreActivate all devices
|
// 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());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Calls activate on all Device class items
|
/// Calls activate on all Device class items
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -26,13 +26,10 @@ 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; }
|
||||||
public bool? EnableRouting { 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
|
//IroutingNumericEvent
|
||||||
public event EventHandler<RoutingNumericEventArgs> NumericSwitchChange;
|
public event EventHandler<RoutingNumericEventArgs> NumericSwitchChange;
|
||||||
|
|
||||||
//Feedback for DMPS System Control
|
//Feedback for DMPS System Control
|
||||||
public BoolFeedback SystemPowerOnFeedback { get; private set; }
|
public BoolFeedback SystemPowerOnFeedback { get; private set; }
|
||||||
public BoolFeedback SystemPowerOffFeedback { get; private set; }
|
public BoolFeedback SystemPowerOffFeedback { get; private set; }
|
||||||
@@ -123,14 +120,13 @@ 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;
|
||||||
|
|
||||||
switch (systemControl.SystemControlType)
|
switch (systemControl.SystemControlType)
|
||||||
{
|
{
|
||||||
case eSystemControlType.Dmps34K150CSystemControl:
|
case eSystemControlType.Dmps34K150CSystemControl:
|
||||||
SystemControl = systemControl as Dmps34K150CSystemControl;
|
SystemControl = systemControl as Dmps34K150CSystemControl;
|
||||||
Dmps4kType = true;
|
|
||||||
SystemPowerOnFeedback = new BoolFeedback(() => { return true; });
|
SystemPowerOnFeedback = new BoolFeedback(() => { return true; });
|
||||||
SystemPowerOffFeedback = new BoolFeedback(() => { return false; });
|
SystemPowerOffFeedback = new BoolFeedback(() => { return false; });
|
||||||
break;
|
break;
|
||||||
@@ -139,13 +135,11 @@ namespace PepperDash.Essentials.DM
|
|||||||
case eSystemControlType.Dmps34K300CSystemControl:
|
case eSystemControlType.Dmps34K300CSystemControl:
|
||||||
case eSystemControlType.Dmps34K350CSystemControl:
|
case eSystemControlType.Dmps34K350CSystemControl:
|
||||||
SystemControl = systemControl as Dmps34K300CSystemControl;
|
SystemControl = systemControl as Dmps34K300CSystemControl;
|
||||||
Dmps4kType = true;
|
|
||||||
SystemPowerOnFeedback = new BoolFeedback(() => { return true; });
|
SystemPowerOnFeedback = new BoolFeedback(() => { return true; });
|
||||||
SystemPowerOffFeedback = new BoolFeedback(() => { return false; });
|
SystemPowerOffFeedback = new BoolFeedback(() => { return false; });
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
SystemControl = systemControl as Dmps3SystemControl;
|
SystemControl = systemControl as Dmps3SystemControl;
|
||||||
Dmps4kType = false;
|
|
||||||
SystemPowerOnFeedback = new BoolFeedback(() =>
|
SystemPowerOnFeedback = new BoolFeedback(() =>
|
||||||
{
|
{
|
||||||
return ((Dmps3SystemControl)SystemControl).SystemPowerOnFeedBack.BoolValue;
|
return ((Dmps3SystemControl)SystemControl).SystemPowerOnFeedBack.BoolValue;
|
||||||
@@ -156,7 +150,7 @@ namespace PepperDash.Essentials.DM
|
|||||||
});
|
});
|
||||||
break;
|
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<RoutingInputPort>();
|
InputPorts = new RoutingPortCollection<RoutingInputPort>();
|
||||||
OutputPorts = new RoutingPortCollection<RoutingOutputPort>();
|
OutputPorts = new RoutingPortCollection<RoutingOutputPort>();
|
||||||
@@ -406,7 +400,7 @@ namespace PepperDash.Essentials.DM
|
|||||||
|
|
||||||
private void LinkInputsToApi(BasicTriList trilist, DmpsRoutingControllerJoinMap joinMap)
|
private void LinkInputsToApi(BasicTriList trilist, DmpsRoutingControllerJoinMap joinMap)
|
||||||
{
|
{
|
||||||
if (Dmps4kType)
|
if (Global.ControlSystemIsDmps4kType)
|
||||||
{
|
{
|
||||||
//DMPS-4K audio inputs 1-5 are aux inputs
|
//DMPS-4K audio inputs 1-5 are aux inputs
|
||||||
for (uint i = 1; i <= 5; i++)
|
for (uint i = 1; i <= 5; i++)
|
||||||
@@ -427,12 +421,12 @@ namespace PepperDash.Essentials.DM
|
|||||||
trilist.BooleanInput[joinMap.VideoSyncStatus.JoinNumber + ioSlotJoin]);
|
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.InputNames.JoinNumber + ioSlotJoin]);
|
||||||
InputNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.InputVideoNames.JoinNumber + ioSlotJoin]);
|
InputNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.InputVideoNames.JoinNumber + ioSlotJoin]);
|
||||||
|
|
||||||
if (Dmps4kType)
|
if (Global.ControlSystemIsDmps4kType)
|
||||||
{
|
{
|
||||||
//DMPS-4K Audio Inputs are offset by 5
|
//DMPS-4K Audio Inputs are offset by 5
|
||||||
InputNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.InputAudioNames.JoinNumber + ioSlotJoin + 5]);
|
InputNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.InputAudioNames.JoinNumber + ioSlotJoin + 5]);
|
||||||
|
|||||||
Reference in New Issue
Block a user