Revised DmBladeChassisController ExecuteNumericSwitch method

#207
This commit is contained in:
Trevor Payne
2020-05-21 12:05:25 -05:00
parent ef4b0441d3
commit b95c341fca

View File

@@ -575,35 +575,7 @@ namespace PepperDash.Essentials.DM {
public void ExecuteNumericSwitch(ushort inputSelector, ushort outputSelector, eRoutingSignalType sigType)
{
Debug.Console(2, this, "Making an awesome DM route from {0} to {1} {2}", inputSelector, outputSelector, sigType);
var input = Convert.ToUInt32(inputSelector); // Cast can sometimes fail
var output = Convert.ToUInt32(outputSelector);
// Check to see if there's an off timer waiting on this and if so, cancel
var key = new PortNumberType(output, sigType);
if (input == 0)
{
StartOffTimer(key);
}
else
{
if (RouteOffTimers.ContainsKey(key))
{
Debug.Console(2, this, "{0} cancelling route off due to new source", output);
RouteOffTimers[key].Stop();
RouteOffTimers.Remove(key);
}
}
var inCard = input == 0 ? null : Chassis.Inputs[input];
var outCard = input == 0 ? null : Chassis.Outputs[output];
// NOTE THAT BITWISE COMPARISONS - TO CATCH ALL ROUTING TYPES
if ((sigType | eRoutingSignalType.Video) != eRoutingSignalType.Video) return;
Chassis.VideoEnter.BoolValue = true;
Chassis.Outputs[output].VideoOut = inCard;
ExecuteSwitch(inputSelector, outputSelector, sigType);
}
#endregion