X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fcharging-station%2FChargingStationUtils.ts;h=f86c5d783b82657c483183f9bf43c562e2c11de1;hb=3f3ac53e97ea4b79d0750836bd9d8ac33a7bec77;hp=e76b3a6e0bb357eca59cb59f689f4c7b191bc87c;hpb=aa7d6d9568ce5ec481a0a230f4ae24c9ee9d44fa;p=e-mobility-charging-stations-simulator.git diff --git a/src/charging-station/ChargingStationUtils.ts b/src/charging-station/ChargingStationUtils.ts index e76b3a6e..f86c5d78 100644 --- a/src/charging-station/ChargingStationUtils.ts +++ b/src/charging-station/ChargingStationUtils.ts @@ -145,7 +145,7 @@ export class ChargingStationUtils { return connectorBootStatus; } - public static checkTemplateFile( + public static checkTemplate( stationTemplate: ChargingStationTemplate, logPrefix: string, templateFile: string @@ -161,18 +161,18 @@ export class ChargingStationUtils { throw new BaseError(errorMsg); } if (Utils.isEmptyObject(stationTemplate.AutomaticTransactionGenerator)) { - stationTemplate.AutomaticTransactionGenerator = { - enable: false, - minDuration: 60, - maxDuration: 120, - minDelayBetweenTwoTransactions: 15, - maxDelayBetweenTwoTransactions: 30, - probabilityOfStart: 1, - stopAfterHours: 0.3, - stopOnConnectionFailure: true, - }; + stationTemplate.AutomaticTransactionGenerator = Constants.DEFAULT_ATG_CONFIGURATION; logger.warn( - `${logPrefix} Empty automatic transaction generator configuration from template file ${templateFile}, set to default values` + `${logPrefix} Empty automatic transaction generator configuration from template file ${templateFile}, set to default: %j`, + Constants.DEFAULT_ATG_CONFIGURATION + ); + } + if ( + Utils.isNullOrUndefined(stationTemplate.idTagsFile) || + Utils.isEmptyString(stationTemplate.idTagsFile) + ) { + logger.warn( + `${logPrefix} Missing id tags file in template file ${templateFile}. That can lead to issues with the Automatic Transaction Generator` ); } }