Skip to content

Commit cd8265b

Browse files
committed
add references to feeder info; remove one that was not never set
1 parent 3730c86 commit cd8265b

File tree

4 files changed

+53
-8
lines changed

4 files changed

+53
-8
lines changed

src/CIM.Core/DAX.CIM.PhysicalNetworkModel.FeederInfo/ConductingEquipmentFeederInfo.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@ public class ConductingEquipmentFeederInfo
1212
public int TraversalOrder { get; set; }
1313
public int SubstationHop { get; set; }
1414
public Guid FirstCustomerCableId { get; set; }
15+
public Guid ParentBusbarId { get; set; }
1516
}
1617
}

src/CIM.Core/DAX.CIM.PhysicalNetworkModel.FeederInfo/FeederInfoContext.cs

Lines changed: 38 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -321,12 +321,26 @@ private void SubstationInternalPowerTransformerTrace()
321321
false
322322
).ToList();
323323

324+
BusbarSectionExt busbar = null;
325+
324326
foreach (var cimObj in traceResult)
325327
{
328+
329+
if (cimObj is ConnectivityNode)
330+
{
331+
var connections = _cimContext.GetConnections((ConnectivityNode)cimObj);
332+
333+
var busbarFound = connections.FirstOrDefault(c => c.ConductingEquipment is BusbarSectionExt).ConductingEquipment as BusbarSectionExt;
334+
335+
if (busbarFound != null)
336+
busbar = busbarFound;
337+
}
338+
326339
if (cimObj is ConnectivityNode && _connectionPoints.ContainsKey((ConnectivityNode)cimObj))
327340
{
328341
var cp = _connectionPoints[(ConnectivityNode)cimObj];
329342
cp.PowerTransformer = pt;
343+
cp.BusbarSection = busbar;
330344
}
331345
}
332346
}
@@ -416,6 +430,7 @@ ce is PowerTransformer // because power transformers sometimes has no base volta
416430

417431
bool customerCableFound = false;
418432
Guid customerCableId = Guid.Empty;
433+
Guid parentBusbarId = Guid.Empty;
419434

420435
int traversalOrder = 0;
421436

@@ -475,7 +490,9 @@ ce is PowerTransformer // because power transformers sometimes has no base volta
475490

476491
busbarProcessed.Add((BusbarSection)busbar);
477492

478-
AssignFeederToConductingEquipment(busbar, feeder, traversalOrder, stationHop, customerCableId);
493+
AssignFeederToConductingEquipment(busbar, feeder, traversalOrder, stationHop, customerCableId, parentBusbarId);
494+
495+
parentBusbarId = Guid.Parse(busbar.mRID);
479496
}
480497
}
481498

@@ -487,10 +504,12 @@ ce is PowerTransformer // because power transformers sometimes has no base volta
487504
if (ce is BusbarSection)
488505
{
489506
if (!busbarProcessed.Contains(ce))
490-
AssignFeederToConductingEquipment(ce, feeder, traversalOrder, cimObj.stationHop, customerCableId);
507+
AssignFeederToConductingEquipment(ce, feeder, traversalOrder, cimObj.stationHop, customerCableId, parentBusbarId);
508+
509+
parentBusbarId = Guid.Parse(ce.mRID);
491510
}
492511
else
493-
AssignFeederToConductingEquipment(ce, feeder, traversalOrder, cimObj.stationHop, customerCableId);
512+
AssignFeederToConductingEquipment(ce, feeder, traversalOrder, cimObj.stationHop, customerCableId, parentBusbarId);
494513

495514
// If a busbar or powertransformer inside substation container add feeder to substation as well
496515
if ((ce is BusbarSection || ce is PowerTransformer) && ce.IsInsideSubstation(_cimContext))
@@ -513,6 +532,8 @@ ce is PowerTransformer // because power transformers sometimes has no base volta
513532
// power transformer feeders
514533
if (cp.Kind == ConnectionPointKind.PowerTranformer)
515534
{
535+
Guid parentBusbarId = Guid.Empty;
536+
516537
foreach (var feeder in cp.Feeders)
517538
{
518539
var pt = feeder.ConductingEquipment as PowerTransformer;
@@ -531,6 +552,17 @@ ce is PowerTransformer // because power transformers sometimes has no base volta
531552
{
532553
int traversalOrder = 0;
533554

555+
if (cimObj is ConnectivityNode)
556+
{
557+
var connections = _cimContext.GetConnections((ConnectivityNode)cimObj);
558+
var busbar = connections.FirstOrDefault(c => c.ConductingEquipment is BusbarSection).ConductingEquipment;
559+
560+
if (busbar != null)
561+
{
562+
parentBusbarId = Guid.Parse(busbar.mRID);
563+
}
564+
}
565+
534566
if (cimObj is ConductingEquipment)
535567
{
536568
traversalOrder++;
@@ -539,19 +571,19 @@ ce is PowerTransformer // because power transformers sometimes has no base volta
539571

540572
// We don't want to add feeder to power transformers and ac line segments outsit station.
541573
if (!(ce is PowerTransformer) && !(ce is ACLineSegment && !ce.IsInsideSubstation(_cimContext)))
542-
AssignFeederToConductingEquipment(ce, feeder, traversalOrder, 0, Guid.Empty);
574+
AssignFeederToConductingEquipment(ce, feeder, traversalOrder, 0, Guid.Empty, parentBusbarId);
543575
}
544576
}
545577
}
546578
}
547579
}
548580
}
549581

550-
private void AssignFeederToConductingEquipment(ConductingEquipment ce, Feeder feeder, int traversalOrder, int substationHop, Guid customerCableId)
582+
private void AssignFeederToConductingEquipment(ConductingEquipment ce, Feeder feeder, int traversalOrder, int substationHop, Guid customerCableId, Guid parentBusbarId)
551583
{
552584
if (!_conductingEquipmentFeeders.ContainsKey(ce))
553585
{
554-
_conductingEquipmentFeeders[ce] = new ConductingEquipmentFeederInfo() { SubstationHop = substationHop, TraversalOrder=traversalOrder, FirstCustomerCableId = customerCableId };
586+
_conductingEquipmentFeeders[ce] = new ConductingEquipmentFeederInfo() { SubstationHop = substationHop, TraversalOrder=traversalOrder, FirstCustomerCableId = customerCableId, ParentBusbarId = parentBusbarId };
555587
_conductingEquipmentFeeders[ce].Feeders.Add(feeder);
556588
}
557589
else

src/CIM.Core/DAX.CIM.PhysicalNetworkModel.FeederInfo/FlatFeederInfo.cs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ public class FlatFeederInfo : IdentifiedObject
1515
public bool Multifeed { get; set; }
1616
public Guid CustomerFeederCableMRID { get; set; }
1717
public Guid CableBoxMRID { get; set; }
18-
public Guid CableBoxBusbarMRID { get; set; }
1918
public Guid SecondarySubstationMRID { get; set; }
2019
public Guid SecondarySubstationBayMRID { get; set; }
2120
public Guid SecondarySubstationTransformerMRID { get; set; }
@@ -27,7 +26,18 @@ public class FlatFeederInfo : IdentifiedObject
2726
public bool MultifeedAllowed { get; set; }
2827
public int NodeHopCount { get; set; }
2928
public int TraversalOrder { get; set; }
30-
29+
public Guid CableBoxBayMRID { get; set; }
30+
31+
/// <summary>
32+
/// Upstream busbar in the feeding substation that the feeder get its power from. Might be null - i.e. if there's a connection directly to the power transformer.
33+
/// </summary>
34+
public Guid FeederBusbarMRID { get; set; }
35+
36+
/// <summary>
37+
/// As soon a busbar is passed this attribut will be filled out. Until then it will be null. Can be used to create busbar-to-busbar topologies.
38+
/// </summary>
39+
public Guid ParentBusbarMRID { get; set; }
40+
3141
public FlatFeederInfo()
3242
{
3343
mRID = Guid.NewGuid().ToString();

src/CIM.Core/DAX.CIM.PhysicalNetworkModel/FeederInfo/ConnectionPoint.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ public class ConnectionPoint
2020
public ConnectivityNode ConnectivityNode { get; set; }
2121
public Substation Substation { get; set; }
2222
public PowerTransformer PowerTransformer { get; set; }
23+
public BusbarSectionExt BusbarSection { get; set; }
2324
public Bay Bay { get; set; }
2425

2526
public IReadOnlyList<Feeder> Feeders
@@ -33,6 +34,7 @@ public IReadOnlyList<Feeder> Feeders
3334
}
3435
}
3536

37+
3638
public void AddFeeder(Feeder feeder)
3739
{
3840
if (_feeders == null)

0 commit comments

Comments
 (0)