Merge branch 'development' into feature/reconfigurable-device-write-control

This commit is contained in:
Jason Alborough
2021-05-11 15:24:40 -04:00
2 changed files with 1421 additions and 1416 deletions

View File

@@ -123,25 +123,34 @@ namespace PepperDash.Essentials.Core
// No direct tie? Run back out on the inputs' attached devices... // No direct tie? Run back out on the inputs' attached devices...
// Only the ones that are routing devices // Only the ones that are routing devices
var attachedMidpoints = destDevInputTies.Where(t => t.SourcePort.ParentDevice is IRoutingInputsOutputs); var attachedMidpoints = destDevInputTies.Where(t => t.SourcePort.ParentDevice is IRoutingInputsOutputs);
//Create a list for tracking already checked devices to avoid loops, if it doesn't already exist from previous iteration
if (alreadyCheckedDevices == null)
alreadyCheckedDevices = new List<IRoutingInputsOutputs>();
alreadyCheckedDevices.Add(destination as IRoutingInputsOutputs);
foreach (var inputTieToTry in attachedMidpoints) foreach (var inputTieToTry in attachedMidpoints)
{ {
Debug.Console(2, destination, "Trying to find route on {0}", inputTieToTry.SourcePort.ParentDevice.Key);
var upstreamDeviceOutputPort = inputTieToTry.SourcePort; var upstreamDeviceOutputPort = inputTieToTry.SourcePort;
var upstreamRoutingDevice = upstreamDeviceOutputPort.ParentDevice as IRoutingInputsOutputs; var upstreamRoutingDevice = upstreamDeviceOutputPort.ParentDevice as IRoutingInputsOutputs;
Debug.Console(2, destination, "Trying to find route on {0}", upstreamRoutingDevice.Key);
// Check if this previous device has already been walked // Check if this previous device has already been walked
if (!(alreadyCheckedDevices != null && alreadyCheckedDevices.Contains(upstreamRoutingDevice))) if (alreadyCheckedDevices.Contains(upstreamRoutingDevice))
{ {
// haven't seen this device yet. Do it. Pass the output port to the next Debug.Console(2, destination, "Skipping input {0} on {1}, this was already checked", upstreamRoutingDevice.Key, destination.Key);
// level to enable switching on success continue;
var upstreamRoutingSuccess = upstreamRoutingDevice.GetRouteToSource(source, upstreamDeviceOutputPort, }
alreadyCheckedDevices, signalType, cycle, routeTable); // haven't seen this device yet. Do it. Pass the output port to the next
if (upstreamRoutingSuccess) // level to enable switching on success
{ var upstreamRoutingSuccess = upstreamRoutingDevice.GetRouteToSource(source, upstreamDeviceOutputPort,
Debug.Console(2, destination, "Upstream device route found"); alreadyCheckedDevices, signalType, cycle, routeTable);
goodInputPort = inputTieToTry.DestinationPort; if (upstreamRoutingSuccess)
break; // Stop looping the inputs in this cycle {
} Debug.Console(2, destination, "Upstream device route found");
} goodInputPort = inputTieToTry.DestinationPort;
break; // Stop looping the inputs in this cycle
}
} }
} }
@@ -164,10 +173,6 @@ namespace PepperDash.Essentials.Core
return true; return true;
} }
if(alreadyCheckedDevices == null)
alreadyCheckedDevices = new List<IRoutingInputsOutputs>();
alreadyCheckedDevices.Add(destination as IRoutingInputsOutputs);
Debug.Console(2, destination, "No route found to {0}", source.Key); Debug.Console(2, destination, "No route found to {0}", source.Key);
return false; return false;
} }

View File

@@ -1220,7 +1220,7 @@ namespace PepperDash.Essentials.DM
{ {
dmMdMnxn.AudioEnter.BoolValue = true; dmMdMnxn.AudioEnter.BoolValue = true;
} }
output.VideoOut = input; output.AudioOut = input;
//Chassis.Outputs[output].AudioOut = inCard; //Chassis.Outputs[output].AudioOut = inCard;
} }
@@ -1643,7 +1643,7 @@ namespace PepperDash.Essentials.DM
{ {
// Routing Control // Routing Control
trilist.SetUShortSigAction(joinMap.OutputVideo.JoinNumber + ioSlotJoin, trilist.SetUShortSigAction(joinMap.OutputVideo.JoinNumber + ioSlotJoin,
o => ExecuteNumericSwitch(o, (ushort) ioSlot, eRoutingSignalType.Video)); o => ExecuteNumericSwitch(o, (ushort) ioSlot, eRoutingSignalType.Video));
trilist.SetUShortSigAction(joinMap.OutputAudio.JoinNumber + ioSlotJoin, trilist.SetUShortSigAction(joinMap.OutputAudio.JoinNumber + ioSlotJoin,
o => ExecuteNumericSwitch(o, (ushort) ioSlot, eRoutingSignalType.Audio)); o => ExecuteNumericSwitch(o, (ushort) ioSlot, eRoutingSignalType.Audio));
trilist.SetUShortSigAction(joinMap.OutputUsb.JoinNumber + ioSlotJoin, trilist.SetUShortSigAction(joinMap.OutputUsb.JoinNumber + ioSlotJoin,