mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-01-28 03:45:01 +00:00
Routing methods will now take a source port and destination port. This should solve the issue where a device could have multiple input ports defined in tielines and allow Essentials routing to find a path correctly.
47 lines
1.5 KiB
C#
47 lines
1.5 KiB
C#
namespace PepperDash.Essentials.Core
|
|
{
|
|
public class RouteRequest
|
|
{
|
|
public RoutingInputPort DestinationPort { get; set; }
|
|
|
|
public RoutingOutputPort SourcePort { get; set; }
|
|
public IRoutingInputs Destination { get; set; }
|
|
public IRoutingOutputs Source { get; set; }
|
|
public eRoutingSignalType SignalType { get; set; }
|
|
|
|
public void HandleCooldown(object sender, FeedbackEventArgs args)
|
|
{
|
|
var coolingDevice = sender as IWarmingCooling;
|
|
|
|
if (args.BoolValue == false)
|
|
{
|
|
Destination.ReleaseAndMakeRoute(Source, SignalType);
|
|
|
|
if (sender == null) return;
|
|
|
|
coolingDevice.IsCoolingDownFeedback.OutputChange -= HandleCooldown;
|
|
}
|
|
}
|
|
}
|
|
|
|
/*public class RouteRequest<TInputSelector, TOutputSelector>
|
|
{
|
|
public IRoutingSink<TInputSelector> Destination { get; set; }
|
|
public IRoutingOutputs<TOutputSelector> Source { get; set; }
|
|
public eRoutingSignalType SignalType { get; set; }
|
|
|
|
public void HandleCooldown(object sender, FeedbackEventArgs args)
|
|
{
|
|
var coolingDevice = sender as IWarmingCooling;
|
|
|
|
if (args.BoolValue == false)
|
|
{
|
|
Destination.ReleaseAndMakeRoute(Source, SignalType);
|
|
|
|
if (sender == null) return;
|
|
|
|
coolingDevice.IsCoolingDownFeedback.OutputChange -= HandleCooldown;
|
|
}
|
|
}
|
|
}*/
|
|
} |