Skip to content

Commit

Permalink
added isCustomerSplitter and isLineTermination to connectivity trace
Browse files Browse the repository at this point in the history
  • Loading branch information
jesper-dax committed May 14, 2024
1 parent 18aa8e6 commit df7423c
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public record TerminalEquipmentSpecification : IIdentifiedObject
public bool IsAddressable { get; init; }
public bool IsCustomerTermination { get; init; }
public bool IsLineTermination { get; init; }
public bool IsCustomerSplitter { get; init; }


public TerminalEquipmentSpecification(Guid id, string category, string name, string shortName, bool isRackEquipment, int heightInRackUnits, TerminalStructureTemplate[] structureTemplates)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ public record ConnectivityTraceViewHopInfo
public int HopSeqNo { get; }
public int Level { get; }
public bool IsSplitter { get; }
public bool IsLineTermination { get; }
public bool IsCustomerSplitter { get; }
public bool IsTraceSource { get; }
public string Node { get; }
public string Equipment { get; }
Expand All @@ -20,11 +22,13 @@ public record ConnectivityTraceViewHopInfo
public Guid[] RouteSegmentIds { get; }
public string[] RouteSegmentGeometries { get; }

public ConnectivityTraceViewHopInfo(int hopSeqNo, int level, bool isSplitter, bool isTraceSource, string node, string equipment, string terminalStructure, string terminal, string connectionInfo, double totalLength, Guid[] routeSegmentIds, string[] routeSegmentGeometries)
public ConnectivityTraceViewHopInfo(int hopSeqNo, int level, bool isSplitter, bool isLineTermination, bool isCustomerSplitter, bool isTraceSource, string node, string equipment, string terminalStructure, string terminal, string connectionInfo, double totalLength, Guid[] routeSegmentIds, string[] routeSegmentGeometries)
{
HopSeqNo = hopSeqNo;
Level = level;
IsSplitter = isSplitter;
IsLineTermination = isLineTermination;
IsCustomerSplitter = isCustomerSplitter;
IsTraceSource = isTraceSource;
Node = node;
Equipment = equipment;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,9 @@ private Result<ConnectivityTraceView> BuildTraceViewFromTerminal(IUtilityGraphTe
connectionInfo: connectionInfo,
totalLength: totalLength,
routeSegmentGeometries: routeSegmentGeometries,
routeSegmentIds: routeSegmentIds
routeSegmentIds: routeSegmentIds,
isCustomerSplitter: relatedData.IsCustomerSplitter(terminalRef),
isLineTermination: relatedData.IsLineTermination(terminalRef)
)
);

Expand Down Expand Up @@ -295,7 +297,9 @@ private Result<ConnectivityTraceView> BuildTraceViewFromSegment(Guid spanSegment
connectionInfo: connectionInfo,
totalLength: totalLength,
routeSegmentGeometries: routeSegmentGeometries,
routeSegmentIds: routeSegmentIds
routeSegmentIds: routeSegmentIds,
isCustomerSplitter: relatedData.IsCustomerSplitter(terminalRef),
isLineTermination: relatedData.IsLineTermination(terminalRef)
)
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,25 @@ public string GetEquipmentStructureInfoString(IUtilityGraphTerminalRef terminalR
}
}

public bool IsCustomerSplitter(IUtilityGraphTerminalRef terminalRef)
{
var terminalEquipment = terminalRef.TerminalEquipment(_utilityNetwork);

var terminalEquipmentSpecification = _terminalEquipmentSpecifications[terminalEquipment.SpecificationId];

return terminalEquipmentSpecification.IsCustomerSplitter;
}

public bool IsLineTermination(IUtilityGraphTerminalRef terminalRef)
{
var terminalEquipment = terminalRef.TerminalEquipment(_utilityNetwork);

var terminalEquipmentSpecification = _terminalEquipmentSpecifications[terminalEquipment.SpecificationId];

return terminalEquipmentSpecification.IsLineTermination;
}


public string GetEquipmentTerminalInfoString(IUtilityGraphTerminalRef terminalRef)
{
if (terminalRef.IsDummyEnd)
Expand Down

0 comments on commit df7423c

Please sign in to comment.