From: Jérôme Benoit Date: Fri, 18 Mar 2022 15:38:16 +0000 (+0100) Subject: Small variable namespace cleanups X-Git-Tag: v1.1.57~36 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=71a77ac2f725a07cf391ad34e56dbd0dbb194329;p=e-mobility-charging-stations-simulator.git Small variable namespace cleanups Signed-off-by: Jérôme Benoit --- diff --git a/src/charging-station/ChargingStation.ts b/src/charging-station/ChargingStation.ts index 5393aebd..507246b5 100644 --- a/src/charging-station/ChargingStation.ts +++ b/src/charging-station/ChargingStation.ts @@ -1991,7 +1991,7 @@ export default class ChargingStation { this.wsConnectionRestarted = true; } else if (this.getAutoReconnectMaxRetries() !== -1) { logger.error( - `${this.logPrefix()} WebSocket reconnect failure: max retries reached (${ + `${this.logPrefix()} WebSocket reconnect failure: maximum retries reached (${ this.autoReconnectRetryCount }) or retry disabled (${this.getAutoReconnectMaxRetries()})` ); diff --git a/src/charging-station/ocpp/1.6/OCPP16ServiceUtils.ts b/src/charging-station/ocpp/1.6/OCPP16ServiceUtils.ts index 23d8a014..64b49c46 100644 --- a/src/charging-station/ocpp/1.6/OCPP16ServiceUtils.ts +++ b/src/charging-station/ocpp/1.6/OCPP16ServiceUtils.ts @@ -366,9 +366,10 @@ export class OCPP16ServiceUtils { ) ); const sampledValuesIndex = meterValue.sampledValue.length - 1; - const maxPowerRounded = Utils.roundTo(maximumPower / unitDivider, 2); + const maximumPowerRounded = Utils.roundTo(maximumPower / unitDivider, 2); if ( - Utils.convertToFloat(meterValue.sampledValue[sampledValuesIndex].value) > maxPowerRounded || + Utils.convertToFloat(meterValue.sampledValue[sampledValuesIndex].value) > + maximumPowerRounded || debug ) { logger.error( @@ -377,7 +378,7 @@ export class OCPP16ServiceUtils { OCPP16MeterValueMeasurand.ENERGY_ACTIVE_IMPORT_REGISTER }: connectorId ${connectorId}, transaction ${connector.transactionId}, value: ${ meterValue.sampledValue[sampledValuesIndex].value - }/${maxPowerRounded}` + }/${maximumPowerRounded}` ); } for ( @@ -396,10 +397,10 @@ export class OCPP16ServiceUtils { ) ); const sampledValuesPerPhaseIndex = meterValue.sampledValue.length - 1; - const maxPowerPerPhaseRounded = Utils.roundTo(maximumPowerPerPhase / unitDivider, 2); + const maximumPowerPerPhaseRounded = Utils.roundTo(maximumPowerPerPhase / unitDivider, 2); if ( Utils.convertToFloat(meterValue.sampledValue[sampledValuesPerPhaseIndex].value) > - maxPowerPerPhaseRounded || + maximumPowerPerPhaseRounded || debug ) { logger.error( @@ -410,7 +411,7 @@ export class OCPP16ServiceUtils { meterValue.sampledValue[sampledValuesPerPhaseIndex].phase }, connectorId ${connectorId}, transaction ${connector.transactionId}, value: ${ meterValue.sampledValue[sampledValuesPerPhaseIndex].value - }/${maxPowerPerPhaseRounded}` + }/${maximumPowerPerPhaseRounded}` ); } }