mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-14 20:24:57 +00:00
fix: change ports and what's used where
This commit is contained in:
@@ -178,8 +178,8 @@ namespace PepperDash.Essentials.Core
|
|||||||
/// <param name="routeTable">The RouteDescriptor being populated as the route is discovered</param>
|
/// <param name="routeTable">The RouteDescriptor being populated as the route is discovered</param>
|
||||||
/// <returns>true if source is hit</returns>
|
/// <returns>true if source is hit</returns>
|
||||||
private static bool GetRouteToSource(this IRoutingInputs destination, IRoutingOutputs source,
|
private static bool GetRouteToSource(this IRoutingInputs destination, IRoutingOutputs source,
|
||||||
RoutingOutputPort sourcePort, List<IRoutingInputsOutputs> alreadyCheckedDevices,
|
RoutingOutputPort outputPortToUse, List<IRoutingInputsOutputs> alreadyCheckedDevices,
|
||||||
eRoutingSignalType signalType, int cycle, RouteDescriptor routeTable, RoutingInputPort destinationPort)
|
eRoutingSignalType signalType, int cycle, RouteDescriptor routeTable, RoutingInputPort destinationPort, RoutingOutputPort sourcePort)
|
||||||
{
|
{
|
||||||
cycle++;
|
cycle++;
|
||||||
|
|
||||||
@@ -250,14 +250,14 @@ namespace PepperDash.Essentials.Core
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
var midpointOutputPort = sourcePort ?? tieLine.SourcePort;
|
var midpointOutputPort = tieLine.SourcePort;
|
||||||
|
|
||||||
Debug.LogMessage(LogEventLevel.Verbose, "Trying to find route on {0}", destination, midpointDevice.Key);
|
Debug.LogMessage(LogEventLevel.Verbose, "Trying to find route on {0}", destination, midpointDevice.Key);
|
||||||
|
|
||||||
// haven't seen this device yet. Do it. Pass the output port to the next
|
// haven't seen this device yet. Do it. Pass the output port to the next
|
||||||
// level to enable switching on success
|
// level to enable switching on success
|
||||||
var upstreamRoutingSuccess = midpointDevice.GetRouteToSource(source, midpointOutputPort,
|
var upstreamRoutingSuccess = midpointDevice.GetRouteToSource(source, midpointOutputPort,
|
||||||
alreadyCheckedDevices, signalType, cycle, routeTable, null);
|
alreadyCheckedDevices, signalType, cycle, routeTable, null, sourcePort);
|
||||||
|
|
||||||
if (upstreamRoutingSuccess)
|
if (upstreamRoutingSuccess)
|
||||||
{
|
{
|
||||||
@@ -277,14 +277,14 @@ namespace PepperDash.Essentials.Core
|
|||||||
|
|
||||||
// we have a route on corresponding inputPort. *** Do the route ***
|
// we have a route on corresponding inputPort. *** Do the route ***
|
||||||
|
|
||||||
if (sourcePort == null)
|
if (destination is IRoutingSink)
|
||||||
{
|
{
|
||||||
// it's a sink device
|
// it's a sink device
|
||||||
routeTable.Routes.Add(new RouteSwitchDescriptor(goodInputPort));
|
routeTable.Routes.Add(new RouteSwitchDescriptor(goodInputPort));
|
||||||
}
|
}
|
||||||
else if (destination is IRouting)
|
else if (destination is IRouting)
|
||||||
{
|
{
|
||||||
routeTable.Routes.Add(new RouteSwitchDescriptor(sourcePort, goodInputPort));
|
routeTable.Routes.Add(new RouteSwitchDescriptor(outputPortToUse, goodInputPort));
|
||||||
}
|
}
|
||||||
else // device is merely IRoutingInputOutputs
|
else // device is merely IRoutingInputOutputs
|
||||||
Debug.LogMessage(LogEventLevel.Verbose, "No routing. Passthrough device", destination);
|
Debug.LogMessage(LogEventLevel.Verbose, "No routing. Passthrough device", destination);
|
||||||
|
|||||||
Reference in New Issue
Block a user