X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Futils%2FElectricUtils.ts;h=b0f8dff412ba6984f5443155339d40f0b4ec5691;hb=ab7a96fac9432c4759e0bb69a12bb481b1570e02;hp=7b91344296009c4e10c093774a8cdb905eb33f2c;hpb=edd134392e237a3242dc2093341df70244c51472;p=e-mobility-charging-stations-simulator.git diff --git a/src/utils/ElectricUtils.ts b/src/utils/ElectricUtils.ts index 7b913442..b0f8dff4 100644 --- a/src/utils/ElectricUtils.ts +++ b/src/utils/ElectricUtils.ts @@ -12,8 +12,8 @@ export class ACElectricUtils { // This is intentional } - static amperageTotal(nbOfPhases: number, Iph: number): number { - return nbOfPhases * Iph; + static powerTotal(nbOfPhases: number, V: number, Iph: number, cosPhi = 1): number { + return nbOfPhases * ACElectricUtils.powerPerPhase(V, Iph, cosPhi); } static powerPerPhase(V: number, Iph: number, cosPhi = 1): number { @@ -24,8 +24,8 @@ export class ACElectricUtils { return Math.round(powerPerPhase); } - static powerTotal(nbOfPhases: number, V: number, Iph: number, cosPhi = 1): number { - return nbOfPhases * ACElectricUtils.powerPerPhase(V, Iph, cosPhi); + static amperageTotal(nbOfPhases: number, Iph: number): number { + return nbOfPhases * Iph; } static amperageTotalFromPower(P: number, V: number, cosPhi = 1): number {