mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-15 20:54:55 +00:00
Fixed issue with Output type on DMPS3-4K-150-C when assigning name. Also adds protection if config incorrectly defiines inputs or outputs that don't exist.
This commit is contained in:
@@ -121,10 +121,18 @@ namespace PepperDash.Essentials.DM
|
|||||||
// Set input and output names from config
|
// Set input and output names from config
|
||||||
if (InputNames != null)
|
if (InputNames != null)
|
||||||
foreach (var kvp in InputNames)
|
foreach (var kvp in InputNames)
|
||||||
(Dmps.SwitcherInputs[kvp.Key] as DMInput).Name.StringValue = kvp.Value;
|
{
|
||||||
|
var input = (Dmps.SwitcherInputs[kvp.Key] as DMInput);
|
||||||
|
if(input != null)
|
||||||
|
input.Name.StringValue = kvp.Value;
|
||||||
|
}
|
||||||
if (OutputNames != null)
|
if (OutputNames != null)
|
||||||
foreach (var kvp in OutputNames)
|
foreach (var kvp in OutputNames)
|
||||||
(Dmps.SwitcherOutputs[kvp.Key] as Card.Dmps3OutputBase).Name.StringValue = kvp.Value;
|
{
|
||||||
|
var output = (Dmps.SwitcherOutputs[kvp.Key] as DMOutput);
|
||||||
|
if(output != null)
|
||||||
|
output.Name.StringValue = kvp.Value;
|
||||||
|
}
|
||||||
|
|
||||||
// Subscribe to events
|
// Subscribe to events
|
||||||
Dmps.DMInputChange += new DMInputEventHandler(Dmps_DMInputChange);
|
Dmps.DMInputChange += new DMInputEventHandler(Dmps_DMInputChange);
|
||||||
|
|||||||
Reference in New Issue
Block a user