From bc4da6e19f89cd298d1e6abaed8ae74374820c8b Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Wed, 1 Nov 2023 10:56:59 +0100 Subject: [PATCH] test: add ElectricUtils.ts tests MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/utils/ElectricUtils.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 { -- 2.34.1