Innovenergy_trunk/csharp/Lib/Units/Composite/Ac3Bus.cs

28 lines
968 B
C#

namespace InnovEnergy.Lib.Units.Composite;
public sealed class Ac3Bus
{
private Ac3Bus() {}
public AcPhase L1 { get; private init; } = null!;
public AcPhase L2 { get; private init; } = null!;
public AcPhase L3 { get; private init; } = null!;
public AcPower Power { get; private init; } = null!;
public Frequency Frequency { get; private init; } = null!;
public static Ac3Bus FromPhasesAndFrequency(AcPhase l1,
AcPhase l2,
AcPhase l3,
Frequency frequency) => new()
{
L1 = l1,
L2 = l2,
L3 = l3,
Power = AcPower.SumOf(l1.Power, l2.Power, l3.Power),
Frequency = frequency,
};
public static Ac3Bus Null { get; } = FromPhasesAndFrequency(AcPhase.Null, AcPhase.Null, AcPhase.Null, 0);
}