Update Ac3Bus to have on S3

This commit is contained in:
atef 2023-10-03 15:58:33 +02:00
parent 965a85ba81
commit 88fb93f095
1 changed files with 20 additions and 19 deletions

View File

@ -3,7 +3,8 @@ using System.Collections;
namespace InnovEnergy.Lib.Units.Composite;
public record Ac3Bus : IReadOnlyList<AcPhase>
// removed to have it on S3. Find a better solution
public record Ac3Bus // : IReadOnlyList<AcPhase>
{
public required AcPhase L1 { get; init; }
public required AcPhase L2 { get; init; }
@ -20,22 +21,22 @@ public record Ac3Bus : IReadOnlyList<AcPhase>
L3 = AcPhase.Zero,
};
public IEnumerator<AcPhase> GetEnumerator()
{
yield return L1;
yield return L2;
yield return L3;
}
IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
public Int32 Count => 3;
public AcPhase this[Int32 index] => index switch
{
0 => L1, // it's retarded
1 => L2,
2 => L3,
_ => throw new ArgumentOutOfRangeException(nameof(index))
};
// public IEnumerator<AcPhase> GetEnumerator()
// {
// yield return L1;
// yield return L2;
// yield return L3;
// }
//
// IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
//
// public Int32 Count => 3;
//
// public AcPhase this[Int32 index] => index switch
// {
// 0 => L1, // it's retarded
// 1 => L2,
// 2 => L3,
// _ => throw new ArgumentOutOfRangeException(nameof(index))
// };
}