mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-01-11 19:44:52 +00:00
fix: add OverrideType property to TieLineConfig
The TielineConfig had no property for the `type` property from an Essentials configuration file to be deserialized into. This has been corrected so that the `type` property in a Tieline JSON configuration is now respected and used to build the tieline.
This commit is contained in:
@@ -57,6 +57,16 @@ namespace PepperDash.Essentials.Core
|
||||
DestinationPort = destinationPort;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a tie line with an overriding Type. See help for OverrideType property for info
|
||||
/// </summary>
|
||||
/// <param name="overrideType">The signal type to limit the link to. Overrides DestinationPort.Type</param>
|
||||
public TieLine(RoutingOutputPort sourcePort, RoutingInputPort destinationPort, eRoutingSignalType? overrideType) :
|
||||
this(sourcePort, destinationPort)
|
||||
{
|
||||
OverrideType = overrideType;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a tie line with an overriding Type. See help for OverrideType property for info
|
||||
/// </summary>
|
||||
|
||||
@@ -7,6 +7,7 @@ using Crestron.SimplSharp.CrestronIO;
|
||||
using Crestron.SimplSharpPro;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
@@ -23,6 +24,10 @@ namespace PepperDash.Essentials.Core.Config
|
||||
public string DestinationCard { get; set; }
|
||||
public string DestinationPort { get; set; }
|
||||
|
||||
[JsonProperty("type", NullValueHandling = NullValueHandling.Ignore)]
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public eRoutingSignalType? OverrideType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns the appropriate tie line for either a card-based device or
|
||||
/// regular device with ports on-device.
|
||||
@@ -65,7 +70,7 @@ namespace PepperDash.Essentials.Core.Config
|
||||
return null;
|
||||
}
|
||||
|
||||
return new TieLine(sourceOutputPort, destinationInputPort);
|
||||
return new TieLine(sourceOutputPort, destinationInputPort, OverrideType);
|
||||
}
|
||||
|
||||
void LogError(string msg)
|
||||
|
||||
Reference in New Issue
Block a user