mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-04-12 03:57:27 +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:
parent
1b17d92ee0
commit
b531d724ff
2 changed files with 16 additions and 1 deletions
|
|
@ -57,6 +57,16 @@ namespace PepperDash.Essentials.Core
|
||||||
DestinationPort = destinationPort;
|
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>
|
/// <summary>
|
||||||
/// Creates a tie line with an overriding Type. See help for OverrideType property for info
|
/// Creates a tie line with an overriding Type. See help for OverrideType property for info
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ using Crestron.SimplSharp.CrestronIO;
|
||||||
using Crestron.SimplSharpPro;
|
using Crestron.SimplSharpPro;
|
||||||
|
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Converters;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
|
|
@ -23,6 +24,10 @@ namespace PepperDash.Essentials.Core.Config
|
||||||
public string DestinationCard { get; set; }
|
public string DestinationCard { get; set; }
|
||||||
public string DestinationPort { get; set; }
|
public string DestinationPort { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("type", NullValueHandling = NullValueHandling.Ignore)]
|
||||||
|
[JsonConverter(typeof(StringEnumConverter))]
|
||||||
|
public eRoutingSignalType? OverrideType { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the appropriate tie line for either a card-based device or
|
/// Returns the appropriate tie line for either a card-based device or
|
||||||
/// regular device with ports on-device.
|
/// regular device with ports on-device.
|
||||||
|
|
@ -65,7 +70,7 @@ namespace PepperDash.Essentials.Core.Config
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return new TieLine(sourceOutputPort, destinationInputPort);
|
return new TieLine(sourceOutputPort, destinationInputPort, OverrideType);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LogError(string msg)
|
void LogError(string msg)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue