mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-04-13 12:37:07 +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:
parent
db08b1fcd9
commit
11a01c707c
1 changed files with 10 additions and 2 deletions
|
|
@ -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);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue