- if (!this.initializedCounters) {
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
- const stationTemplateUrls = Configuration.getStationTemplateUrls()!
- if (isNotEmptyArray(stationTemplateUrls)) {
- for (const stationTemplateUrl of stationTemplateUrls) {
- const templateName = parse(stationTemplateUrl.file).name
- this.templatesChargingStations.set(templateName, {
- configured: stationTemplateUrl.numberOfStations,
- added: 0,
- started: 0,
- indexes: new Set<number>()
- })
- this.uiServer?.chargingStationTemplates.add(templateName)
- }
- if (this.templatesChargingStations.size !== stationTemplateUrls.length) {
- console.error(
- chalk.red(
- "'stationTemplateUrls' contains duplicate entries, please check your configuration"
- )
- )
- exit(exitCodes.duplicateChargingStationTemplateUrls)
- }
- } else {
- console.error(
- chalk.red("'stationTemplateUrls' not defined or empty, please check your configuration")
- )
- exit(exitCodes.missingChargingStationsConfiguration)
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
+ const stationTemplateUrls = Configuration.getStationTemplateUrls()!
+ if (isNotEmptyArray(stationTemplateUrls)) {
+ for (const stationTemplateUrl of stationTemplateUrls) {
+ const templateName = buildTemplateName(stationTemplateUrl.file)
+ this.templateStatistics.set(templateName, {
+ configured: stationTemplateUrl.numberOfStations,
+ provisioned: stationTemplateUrl.provisionedNumberOfStations ?? 0,
+ added: 0,
+ started: 0,
+ indexes: new Set<number>()
+ })
+ this.uiServer.chargingStationTemplates.add(templateName)