mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-15 04:34:56 +00:00
Fixed some issues discovered during testing
This commit is contained in:
@@ -813,16 +813,9 @@ namespace PepperDash.Essentials.DM
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Adds InputPort
|
/// Adds InputPort
|
||||||
/// </summary>
|
/// </summary>
|
||||||
void AddInputPortWithDebug(uint cardNum, string portName, eRoutingSignalType sigType, eRoutingPortConnectionType portType)
|
void AddInputPortWithDebug(uint cardNum, string portName, eRoutingSignalType sigType, eRoutingPortConnectionType portType)
|
||||||
{
|
{
|
||||||
var portKey = string.Format("inputCard{0}--{1}", cardNum, portName);
|
AddInputPortWithDebug(cardNum, portName, sigType, portType, null);
|
||||||
Debug.Console(2, this, "Adding input port '{0}'", portKey);
|
|
||||||
var inputPort = new RoutingInputPort(portKey, sigType, portType, Chassis.Inputs[cardNum], this)
|
|
||||||
{
|
|
||||||
FeedbackMatchObject = Chassis.Inputs[cardNum]
|
|
||||||
};
|
|
||||||
|
|
||||||
InputPorts.Add(inputPort);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -846,19 +839,9 @@ namespace PepperDash.Essentials.DM
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Adds OutputPort
|
/// Adds OutputPort
|
||||||
/// </summary>
|
/// </summary>
|
||||||
void AddOutputPortWithDebug(string cardName, string portName, eRoutingSignalType sigType, eRoutingPortConnectionType portType, object selector)
|
void AddOutputPortWithDebug(string cardName, string portName, eRoutingSignalType sigType, eRoutingPortConnectionType portType, object selector)
|
||||||
{
|
{
|
||||||
var portKey = string.Format("{0}--{1}", cardName, portName);
|
AddOutputPortWithDebug(cardName, portName, sigType, portType, selector, null);
|
||||||
Debug.Console(2, this, "Adding output port '{0}'", portKey);
|
|
||||||
|
|
||||||
var outputPort = new RoutingOutputPort(portKey, sigType, portType, selector, this);
|
|
||||||
|
|
||||||
if (portName.IndexOf("Loop", StringComparison.InvariantCultureIgnoreCase) < 0)
|
|
||||||
{
|
|
||||||
outputPort.FeedbackMatchObject = Chassis.Outputs[(uint) selector];
|
|
||||||
}
|
|
||||||
|
|
||||||
OutputPorts.Add(outputPort);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -872,7 +855,7 @@ namespace PepperDash.Essentials.DM
|
|||||||
|
|
||||||
if (portName.IndexOf("Loop", StringComparison.InvariantCultureIgnoreCase) < 0)
|
if (portName.IndexOf("Loop", StringComparison.InvariantCultureIgnoreCase) < 0)
|
||||||
{
|
{
|
||||||
outputPort.FeedbackMatchObject = Chassis.Outputs[(uint)selector];
|
outputPort.FeedbackMatchObject = selector;
|
||||||
}
|
}
|
||||||
if (cecPort != null)
|
if (cecPort != null)
|
||||||
outputPort.Port = cecPort;
|
outputPort.Port = cecPort;
|
||||||
@@ -1162,7 +1145,7 @@ namespace PepperDash.Essentials.DM
|
|||||||
{
|
{
|
||||||
if (RouteOffTimers.ContainsKey(pnt))
|
if (RouteOffTimers.ContainsKey(pnt))
|
||||||
return;
|
return;
|
||||||
RouteOffTimers[pnt] = new CTimer(o => { ExecuteSwitch(0, pnt.Number, pnt.Type); }, RouteOffTime);
|
RouteOffTimers[pnt] = new CTimer(o => ExecuteSwitch(null, pnt.Selector, pnt.Type), RouteOffTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Send out sigs when coming online
|
// Send out sigs when coming online
|
||||||
@@ -1205,7 +1188,7 @@ namespace PepperDash.Essentials.DM
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check to see if there's an off timer waiting on this and if so, cancel
|
// Check to see if there's an off timer waiting on this and if so, cancel
|
||||||
var key = new PortNumberType(output.Number, sigType);
|
var key = new PortNumberType(output, sigType);
|
||||||
if (input == null)
|
if (input == null)
|
||||||
{
|
{
|
||||||
StartOffTimer(key);
|
StartOffTimer(key);
|
||||||
@@ -1873,13 +1856,23 @@ namespace PepperDash.Essentials.DM
|
|||||||
public struct PortNumberType
|
public struct PortNumberType
|
||||||
{
|
{
|
||||||
public uint Number { get; private set; }
|
public uint Number { get; private set; }
|
||||||
|
public object Selector { get; private set; }
|
||||||
public eRoutingSignalType Type { get; private set; }
|
public eRoutingSignalType Type { get; private set; }
|
||||||
|
|
||||||
public PortNumberType(uint number, eRoutingSignalType type)
|
public PortNumberType(object selector, eRoutingSignalType type)
|
||||||
: this()
|
: this()
|
||||||
{
|
{
|
||||||
Number = number;
|
Selector = selector;
|
||||||
Type = type;
|
Type = type;
|
||||||
|
|
||||||
|
if (Selector is DMOutput)
|
||||||
|
{
|
||||||
|
Number = (selector as DMOutput).Number;
|
||||||
|
}
|
||||||
|
else if (Selector is uint)
|
||||||
|
{
|
||||||
|
Number = (uint) selector;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user