mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-15 20:54:55 +00:00
Fixes for DM endpoints on DMPS3 non-4k types
This commit is contained in:
@@ -343,7 +343,7 @@ namespace PepperDash.Essentials
|
|||||||
{
|
{
|
||||||
var prompt = Global.ControlSystem.ControllerPrompt;
|
var prompt = Global.ControlSystem.ControllerPrompt;
|
||||||
|
|
||||||
var typeMatch = String.Equals(devConf.Type, prompt, StringComparison.OrdinalIgnoreCase) &&
|
var typeMatch = String.Equals(devConf.Type, prompt, StringComparison.OrdinalIgnoreCase) ||
|
||||||
String.Equals(devConf.Type, prompt.Replace("-", ""), StringComparison.OrdinalIgnoreCase);
|
String.Equals(devConf.Type, prompt.Replace("-", ""), StringComparison.OrdinalIgnoreCase);
|
||||||
|
|
||||||
if (!typeMatch)
|
if (!typeMatch)
|
||||||
@@ -361,7 +361,8 @@ 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);
|
bool dmps4kType = this.ControllerPrompt.IndexOf("4k", StringComparison.OrdinalIgnoreCase) > -1;
|
||||||
|
var dmpsRoutingController = DmpsRoutingController.GetDmpsRoutingController("processor-avRouting", this.ControllerPrompt, propertiesConfig, dmps4kType);
|
||||||
|
|
||||||
DeviceManager.AddDevice(dmpsRoutingController);
|
DeviceManager.AddDevice(dmpsRoutingController);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,6 +26,9 @@ 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;
|
||||||
|
|
||||||
@@ -73,7 +76,7 @@ namespace PepperDash.Essentials.DM
|
|||||||
|
|
||||||
|
|
||||||
public static DmpsRoutingController GetDmpsRoutingController(string key, string name,
|
public static DmpsRoutingController GetDmpsRoutingController(string key, string name,
|
||||||
DmpsRoutingPropertiesConfig properties)
|
DmpsRoutingPropertiesConfig properties, bool dmps4kType)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -84,7 +87,7 @@ namespace PepperDash.Essentials.DM
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
var controller = new DmpsRoutingController(key, name, systemControl)
|
var controller = new DmpsRoutingController(key, name, systemControl, dmps4kType)
|
||||||
{
|
{
|
||||||
InputNames = properties.InputNames,
|
InputNames = properties.InputNames,
|
||||||
OutputNames = properties.OutputNames
|
OutputNames = properties.OutputNames
|
||||||
@@ -110,12 +113,13 @@ namespace PepperDash.Essentials.DM
|
|||||||
/// <param name="key"></param>
|
/// <param name="key"></param>
|
||||||
/// <param name="name"></param>
|
/// <param name="name"></param>
|
||||||
/// <param name="chassis"></param>
|
/// <param name="chassis"></param>
|
||||||
public DmpsRoutingController(string key, string name, ISystemControl systemControl)
|
public DmpsRoutingController(string key, string name, ISystemControl systemControl, bool dmps4kType)
|
||||||
: base(key, name)
|
: base(key, name)
|
||||||
{
|
{
|
||||||
|
|
||||||
Dmps = Global.ControlSystem;
|
Dmps = Global.ControlSystem;
|
||||||
SystemControl = systemControl;
|
SystemControl = systemControl;
|
||||||
|
Dmps4kType = dmps4kType;
|
||||||
|
|
||||||
InputPorts = new RoutingPortCollection<RoutingInputPort>();
|
InputPorts = new RoutingPortCollection<RoutingInputPort>();
|
||||||
OutputPorts = new RoutingPortCollection<RoutingOutputPort>();
|
OutputPorts = new RoutingPortCollection<RoutingOutputPort>();
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user