From: Jérôme Benoit Date: Sun, 25 Sep 2022 22:04:58 +0000 (+0200) Subject: Fix broadcast channel payload cleanup for ATG X-Git-Tag: v1.1.74~16 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=8f879946a2def1ccaa048a1793258127087e8285;p=e-mobility-charging-stations-simulator.git Fix broadcast channel payload cleanup for ATG Signed-off-by: Jérôme Benoit --- diff --git a/e-mobility-charging-stations-simulator.code-workspace b/e-mobility-charging-stations-simulator.code-workspace index e0dbb0cd..b99ab1de 100644 --- a/e-mobility-charging-stations-simulator.code-workspace +++ b/e-mobility-charging-stations-simulator.code-workspace @@ -1,11 +1,10 @@ { - "folders": [ - { - "path": "." - }, - { - "path": "src/ui/web" - } - ], - "settings": {} -} \ No newline at end of file + "folders": [ + { + "path": "." + }, + { + "path": "src/ui/web" + } + ] +} diff --git a/src/charging-station/ChargingStation.ts b/src/charging-station/ChargingStation.ts index 9fabd2a5..d70223e3 100644 --- a/src/charging-station/ChargingStation.ts +++ b/src/charging-station/ChargingStation.ts @@ -711,13 +711,15 @@ export default class ChargingStation { } } - public startAutomaticTransactionGenerator(connectorIds?: number[]): void { - if (!this.automaticTransactionGenerator) { - this.automaticTransactionGenerator = AutomaticTransactionGenerator.getInstance( + public startAutomaticTransactionGenerator( + connectorIds?: number[], + automaticTransactionGeneratorConfiguration?: AutomaticTransactionGeneratorConfiguration + ): void { + this.automaticTransactionGenerator = AutomaticTransactionGenerator.getInstance( + automaticTransactionGeneratorConfiguration ?? this.getAutomaticTransactionGeneratorConfigurationFromTemplate(), - this - ); - } + this + ); if (!Utils.isEmptyArray(connectorIds)) { for (const connectorId of connectorIds) { this.automaticTransactionGenerator.startConnector(connectorId); diff --git a/src/charging-station/ChargingStationWorkerBroadcastChannel.ts b/src/charging-station/ChargingStationWorkerBroadcastChannel.ts index 274267ca..00780f2f 100644 --- a/src/charging-station/ChargingStationWorkerBroadcastChannel.ts +++ b/src/charging-station/ChargingStationWorkerBroadcastChannel.ts @@ -268,7 +268,7 @@ export default class ChargingStationWorkerBroadcastChannel extends WorkerBroadca [ BroadcastChannelProcedureName.START_AUTOMATIC_TRANSACTION_GENERATOR, BroadcastChannelProcedureName.STOP_AUTOMATIC_TRANSACTION_GENERATOR, - ].includes(command) === true && delete requestPayload.connectorIds; + ].includes(command) === false && delete requestPayload.connectorIds; } private commandResponseToResponsePayload(