+ public static checkTemplateFile(
+ stationTemplate: ChargingStationTemplate,
+ logPrefix: string,
+ templateFile: string
+ ) {
+ if (Utils.isNullOrUndefined(stationTemplate)) {
+ const errorMsg = `Failed to read charging station template file ${templateFile}`;
+ logger.error(`${logPrefix} ${errorMsg}`);
+ throw new BaseError(errorMsg);
+ }
+ if (Utils.isEmptyObject(stationTemplate)) {
+ const errorMsg = `Empty charging station information from template file ${templateFile}`;
+ logger.error(`${logPrefix} ${errorMsg}`);
+ 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,
+ };
+ logger.warn(
+ `${logPrefix} Empty automatic transaction generator configuration from template file ${templateFile}, set to default values`
+ );
+ }
+ }
+