mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-15 12:44:58 +00:00
Adds ability to read input/output names from processor device properties config. Fixes issues with routing to output on DMPS3-4K-150-C
This commit is contained in:
@@ -17,6 +17,8 @@ using PepperDash.Essentials.Fusion;
|
|||||||
using PepperDash.Essentials.Room.Config;
|
using PepperDash.Essentials.Room.Config;
|
||||||
using PepperDash.Essentials.Room.Cotija;
|
using PepperDash.Essentials.Room.Cotija;
|
||||||
|
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace PepperDash.Essentials
|
namespace PepperDash.Essentials
|
||||||
{
|
{
|
||||||
public class ControlSystem : CrestronControlSystem
|
public class ControlSystem : CrestronControlSystem
|
||||||
@@ -359,21 +361,7 @@ namespace PepperDash.Essentials
|
|||||||
|
|
||||||
DeviceManager.AddDevice(new PepperDash.Essentials.Core.Devices.CrestronProcessor("processor"));
|
DeviceManager.AddDevice(new PepperDash.Essentials.Core.Devices.CrestronProcessor("processor"));
|
||||||
|
|
||||||
// Check if the processor is a DMPS model
|
|
||||||
if (this.ControllerPrompt.IndexOf("dmps", StringComparison.OrdinalIgnoreCase) > -1)
|
|
||||||
{
|
|
||||||
Debug.Console(2, "Adding DmpsRoutingController for {0} to Device Manager.", this.ControllerPrompt);
|
|
||||||
|
|
||||||
var dmpsRoutingController = DmpsRoutingController.GetDmpsRoutingController("processor-avRouting", this.ControllerPrompt, new DM.Config.DmpsRoutingPropertiesConfig());
|
|
||||||
|
|
||||||
DeviceManager.AddDevice(dmpsRoutingController);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Debug.Console(2, "************Processor is not DMPS type***************");
|
|
||||||
}
|
|
||||||
|
|
||||||
// Add global System Monitor device
|
// Add global System Monitor device
|
||||||
DeviceManager.AddDevice(new PepperDash.Essentials.Core.Monitoring.SystemMonitorController("systemMonitor"));
|
DeviceManager.AddDevice(new PepperDash.Essentials.Core.Monitoring.SystemMonitorController("systemMonitor"));
|
||||||
@@ -392,6 +380,25 @@ namespace PepperDash.Essentials
|
|||||||
"WARNING: Config file defines processor type as '{0}' but actual processor is '{1}'! Some ports may not be available",
|
"WARNING: Config file defines processor type as '{0}' but actual processor is '{1}'! Some ports may not be available",
|
||||||
devConf.Type.ToUpper(), Global.ControlSystem.ControllerPrompt.ToUpper());
|
devConf.Type.ToUpper(), Global.ControlSystem.ControllerPrompt.ToUpper());
|
||||||
|
|
||||||
|
// Check if the processor is a DMPS model
|
||||||
|
if (this.ControllerPrompt.IndexOf("dmps", StringComparison.OrdinalIgnoreCase) > -1)
|
||||||
|
{
|
||||||
|
Debug.Console(2, "Adding DmpsRoutingController for {0} to Device Manager.", this.ControllerPrompt);
|
||||||
|
|
||||||
|
var propertiesConfig = JsonConvert.DeserializeObject<DM.Config.DmpsRoutingPropertiesConfig>(devConf.Properties.ToString());
|
||||||
|
|
||||||
|
if(propertiesConfig == null)
|
||||||
|
propertiesConfig = new DM.Config.DmpsRoutingPropertiesConfig();
|
||||||
|
|
||||||
|
var dmpsRoutingController = DmpsRoutingController.GetDmpsRoutingController("processor-avRouting", this.ControllerPrompt, propertiesConfig);
|
||||||
|
|
||||||
|
DeviceManager.AddDevice(dmpsRoutingController);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Debug.Console(2, "************Processor is not DMPS type***************");
|
||||||
|
}
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -629,10 +629,10 @@ namespace PepperDash.Essentials.DM
|
|||||||
}
|
}
|
||||||
|
|
||||||
DMInput inCard = input == 0 ? null : Dmps.SwitcherInputs[input] as DMInput;
|
DMInput inCard = input == 0 ? null : Dmps.SwitcherInputs[input] as DMInput;
|
||||||
Card.Dmps3OutputBase outCard = output == 0 ? null : Dmps.SwitcherOutputs[output] as Card.Dmps3OutputBase;
|
DMOutput outCard = output == 0 ? null : Dmps.SwitcherOutputs[output] as Card.Dmps3OutputBase;
|
||||||
|
|
||||||
if (inCard != null)
|
//if (inCard != null)
|
||||||
{
|
//{
|
||||||
// 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)
|
||||||
{
|
{
|
||||||
@@ -659,11 +659,11 @@ namespace PepperDash.Essentials.DM
|
|||||||
if (inCard != null && inCard.USBRoutedTo != null)
|
if (inCard != null && inCard.USBRoutedTo != null)
|
||||||
inCard.USBRoutedTo = outCard;
|
inCard.USBRoutedTo = outCard;
|
||||||
}
|
}
|
||||||
}
|
//}
|
||||||
else
|
//else
|
||||||
{
|
//{
|
||||||
Debug.Console(1, this, "Unable to execute route from input {0} to output {1}. Input card not available", inputSelector, outputSelector);
|
// Debug.Console(1, this, "Unable to execute route from input {0} to output {1}. Input card not available", inputSelector, outputSelector);
|
||||||
}
|
//}
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user