コード例 #1
0
 /// <summary>
 /// Connects the <see cref="PowerDeliveryElement"/> on the phases in <paramref name="bus1AndLinePhases"/>
 /// to the same phases on <paramref name="bus1"/>, and to the correspondingly-indexed phases <paramref name="bus2Phases"/>
 /// on <paramref name="bus2"/>.
 /// </summary>
 /// <example>
 /// The following code connects the <see cref="PowerDeliveryElement"/> to <paramref name="bus1"/>
 /// and <paramref name="bus2"/>, with the following phasing:
 /// <code>
 /// // key: line phase -> bus1 phase, bus2 phase
 /// // 1 -> 1, 2
 /// // 2 -> 2, 3
 /// // 3 -> 3, 1
 /// myPowerDeliveryElement.Connect(bus1, new[] {1,2,3}, bus2, new[] {2,3,1});
 /// </code></example>
 /// <param name="bus1">The first <see cref="Bus"/> to connect to. Shares common phases with the <see cref="PowerDeliveryElement"/>.</param>
 /// <param name="bus1AndLinePhases">The common phases to connect between the <see cref="PowerDeliveryElement"/> and the <see cref="Bus"/>.</param>
 /// <param name="bus2">The second <see cref="Bus"/> to connect to.</param>
 /// <param name="bus2Phases">Phase connections for <paramref name="bus2"/>.</param>
 public void Connect(Bus bus1, IEnumerable <int> bus1AndLinePhases, Bus bus2, IEnumerable <int> bus2Phases)
 {
     foreach (var phasePair in bus1AndLinePhases.Zip(bus2Phases, (phase1, phase2) => new { Bus1AndLinePhase = phase1, Bus2Phase = phase2 }))
     {
         NetworkElement.ConnectBetween(this,
                                       phasePair.Bus1AndLinePhase,
                                       bus1,
                                       phasePair.Bus1AndLinePhase,
                                       bus2,
                                       phasePair.Bus2Phase
                                       );
     }
 }
コード例 #2
0
 /// <summary>
 /// Connects <paramref name="thisPhase"/> of this <see cref="PowerDeliveryElement"/> between
 /// <paramref name="bus1Phase"/> of <paramref name="bus1"/> and <paramref name="bus2Phase"/>
 /// of <paramref name="bus2"/>.
 /// </summary>
 /// <param name="thisPhase">The phase of this element to connect.</param>
 /// <param name="bus1">The <see cref="Bus"/> to connect on one side of this <see cref="PowerDeliveryElement"/>.</param>
 /// <param name="bus1Phase">The phase of <paramref name="bus1"/> to connect to.</param>
 /// <param name="bus2">The <see cref="Bus"/> to connect on the other side of this <see cref="PowerDeliveryElement"/>.</param>
 /// <param name="bus2Phase">The phase of <paramref name="bus2"/> to connect to.</param>
 public void Connect(int thisPhase, Bus bus1, int bus1Phase, Bus bus2, int bus2Phase)
 {
     NetworkElement.ConnectBetween(this, thisPhase, bus1, bus1Phase, bus2, bus2Phase);
 }