Cleanups.
authorJérôme Benoit <jerome.benoit@sap.com>
Thu, 21 Jan 2021 10:35:03 +0000 (11:35 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Thu, 21 Jan 2021 10:35:03 +0000 (11:35 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
26 files changed:
.gitignore
package-lock.json
package.json
src/assets/config-template.json
src/assets/station-templates/abb-atg.station-template.json
src/assets/station-templates/abb.station-template.json
src/assets/station-templates/evlink.station-template.json
src/assets/station-templates/keba.station-template.json
src/assets/station-templates/schneider-imredd.station-template.json
src/assets/station-templates/schneider.station-template.json
src/assets/station-templates/siemens.station-template.json
src/assets/station-templates/virtual-simple-atg.station-template.json
src/assets/station-templates/virtual-simple.station-template.json
src/assets/station-templates/virtual.station-template.json
src/charging-station/AutomaticTransactionGenerator.ts
src/charging-station/ChargingStation.ts
src/charging-station/StationWorker.ts
src/charging-station/Worker.ts
src/scripts/deleteChargingStations.ts
src/scripts/scriptConfig-template.json
src/scripts/setCSPublicFlag.ts
src/start.ts
src/types/ChargingStationTemplate.ts
src/types/ConfigurationData.ts
src/utils/Configuration.ts
src/utils/Constants.ts

index 3a622e5d9846860203ea9f46b6870000015570fa..ca88d032a4c2d321aba6dceabf86aaad5f19ddf6 100644 (file)
@@ -1,5 +1,6 @@
 # config
 src/assets/config.json
+src/scripts/scriptConfig.json
 manifest.yml
 
 # Logs
@@ -86,4 +87,3 @@ Thumbs.db
 # MTA
 *.mta
 mta_archives/
-src/scripts/scriptConfig.json
index c5dd1f8650e2ee68f42874e82b6eca0385743a85..6d0fc1e5ad0ba428c4bd6048c3f65d79afea4137 100644 (file)
       "dev": true
     },
     "@types/node": {
-      "version": "14.14.21",
-      "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.21.tgz",
-      "integrity": "sha512-cHYfKsnwllYhjOzuC5q1VpguABBeecUp24yFluHpn/BQaVxB1CuQ1FSRZCzrPxrkIfWISXV2LbeoBthLWg0+0A==",
+      "version": "14.14.22",
+      "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.22.tgz",
+      "integrity": "sha512-g+f/qj/cNcqKkc3tFqlXOYjrmZA+jNBiDzbP3kH+B+otKFqAdPgVTGP1IeKRdMml/aE69as5S4FqtxAbl+LaMw==",
       "dev": true
     },
     "@types/offscreencanvas": {
index 11c18cff7875fa46860e04825777337ebabcdbac..8a4d7a29a79ea90d93d66b86554faf54f0f75859 100644 (file)
@@ -60,7 +60,7 @@
     "utf-8-validate": "^5.0.4"
   },
   "devDependencies": {
-    "@types/node": "^14.14.21",
+    "@types/node": "^14.14.22",
     "@types/uuid": "^8.3.0",
     "@types/worker-threads-pool": "^2.0.0",
     "@types/ws": "^7.4.0",
index 61067bcf9839bc40656b254eda4137d46227cb2a..bfa96ecca108561810f8f00e5d760364c1f65e30 100644 (file)
@@ -7,7 +7,6 @@
   "useWorkerPool": false,
   "workerPoolSize": 16,
   "chargingStationsPerWorker": 1,
-  "chargingStationIdSuffix": "",
   "stationTemplateURLs": [
     {
       "file": "./src/assets/station-templates/siemens.station-template.json",
index acb6238200f8d56f0638212677546e5a21c4bafd..935509afbbd744331bc89d56fbd94c71cfc926a6 100644 (file)
@@ -1,6 +1,7 @@
 {
   "authorizationFile": "./src/assets/authorization-tags.json",
   "baseName": "CS-ABB",
+  "nameSuffix": "Roaming",
   "chargePointModel": "MD_TERRA_53",
   "chargePointVendor": "ABB",
   "firmwareVersion": "4.0.4.22",
@@ -62,7 +63,8 @@
     "maxDelayBetweenTwoTransactions": 30,
     "probabilityOfStart": 1,
     "stopAfterHours": 0.3,
-    "stopOnConnectionFailure": false
+    "stopOnConnectionFailure": false,
+    "requireAuthorize": false
   },
   "Connectors": {
     "0": {},
index 510045e7f5d143fcc661fc76071c15c357b88428..ce2025c9ffba33d0d3debc44836c7e96e343b4ae 100644 (file)
@@ -62,7 +62,8 @@
     "maxDelayBetweenTwoTransactions": 30,
     "probabilityOfStart": 1,
     "stopAfterHours": 0.3,
-    "stopOnConnectionFailure": true
+    "stopOnConnectionFailure": true,
+    "requireAuthorize": false
   },
   "Connectors": {
     "0": {},
index 4ced13756293734a6bea144de8d162e269eafe57..aebc3d0546fc285f3deff485503f62c48a280127 100644 (file)
@@ -48,7 +48,8 @@
     "maxDelayBetweenTwoTransactions": 30,
     "probabilityOfStart": 1,
     "stopAfterHours": 0.3,
-    "stopOnConnectionFailure": false
+    "stopOnConnectionFailure": false,
+    "requireAuthorize": false
   },
   "Connectors": {
     "0": {},
index 4c8ef7ebc8d8d253341219339e5d325a42d6130f..b1337fc7468d4fb71bed0b0c9017f71e6daba0dc 100644 (file)
@@ -45,7 +45,8 @@
     "maxDelayBetweenTwoTransactions": 30,
     "probabilityOfStart": 1,
     "stopAfterHours": 0.3,
-    "stopOnConnectionFailure": false
+    "stopOnConnectionFailure": false,
+    "requireAuthorize": false
   },
   "Connectors": {
     "0": {},
index 0e3330658f114db2842f63b494fe4848522d3148..e82998e16f6e94746f4f2ef02954c34c16df1612 100644 (file)
@@ -47,7 +47,8 @@
     "maxDelayBetweenTwoTransactions": 30,
     "probabilityOfStart": 1,
     "stopAfterHours": 0.3,
-    "stopOnConnectionFailure": false
+    "stopOnConnectionFailure": false,
+    "requireAuthorize": false
   },
   "Connectors": {
     "0": {},
index 26f36319aabd08adaad7c8ee92f83cbdda987f7c..1502c595b6a95ca8a2eee6f2da5a455beec9b8e9 100644 (file)
@@ -52,7 +52,8 @@
     "maxDelayBetweenTwoTransactions": 30,
     "probabilityOfStart": 1,
     "stopAfterHours": 0.3,
-    "stopOnConnectionFailure": false
+    "stopOnConnectionFailure": false,
+    "requireAuthorize": false
   },
   "Connectors": {
     "0": {},
index 0c6cdc34a8e300c233ca3607d0a23f0fde4b4b29..0f48b40489477bc6e6d7a74d3ffa2e3df4abeb04 100644 (file)
@@ -46,7 +46,8 @@
     "maxDelayBetweenTwoTransactions": 30,
     "probabilityOfStart": 1,
     "stopAfterHours": 0.3,
-    "stopOnConnectionFailure": false
+    "stopOnConnectionFailure": false,
+    "requireAuthorize": false
   },
   "Connectors": {
     "0": {},
index ae81e876bcf7bc4ef67abb666436efd16bad88c2..6b9df513d78937c3584769220a63c2c0669d5b6a 100644 (file)
@@ -46,7 +46,8 @@
     "maxDelayBetweenTwoTransactions": 30,
     "probabilityOfStart": 1,
     "stopAfterHours": 0.3,
-    "stopOnConnectionFailure": false
+    "stopOnConnectionFailure": false,
+    "requireAuthorize": false
   },
   "Connectors": {
     "0": {},
index d2ff814a8e5fd7569f08b2ae8175d3cb21cb78be..63e4c1435f6795615adbf5f8d18624fa75a39b67 100644 (file)
@@ -46,7 +46,8 @@
     "maxDelayBetweenTwoTransactions": 30,
     "probabilityOfStart": 1,
     "stopAfterHours": 0.3,
-    "stopOnConnectionFailure": false
+    "stopOnConnectionFailure": false,
+    "requireAuthorize": false
   },
   "Connectors": {
     "0": {},
index b4c019214a347fd4271cb0ab909f7702f8b78452..a28fccf5f2102c551ef6634b331963b51bab1d63 100644 (file)
@@ -46,7 +46,8 @@
     "maxDelayBetweenTwoTransactions": 30,
     "probabilityOfStart": 1,
     "stopAfterHours": 0.3,
-    "stopOnConnectionFailure": false
+    "stopOnConnectionFailure": false,
+    "requireAuthorize": false
   },
   "Connectors": {
     "0": {},
index 363605be0e8a19d8d57718c2e3a33a1fe58ae3d0..d6a825ed0db7eb419ad4a8f1c443a02f8b5bfc26 100644 (file)
@@ -130,15 +130,19 @@ export default class AutomaticTransactionGenerator {
   private async startTransaction(connectorId: number, self: AutomaticTransactionGenerator): Promise<StartTransactionResponse> {
     if (self._chargingStation.hasAuthorizedTags()) {
       const tagId = self._chargingStation.getRandomTagId();
-      logger.info(self._logPrefix(connectorId) + ' start transaction for tagID ' + tagId);
-      // Authorize tagId
-      const authorizeResponse = await self._chargingStation.sendAuthorize(tagId);
-      if (authorizeResponse?.idTagInfo?.status === AuthorizationStatus.ACCEPTED) {
-        // Start transaction
-        return await self._chargingStation.sendStartTransaction(connectorId, tagId);
-      } else {
+      if (self._chargingStation.stationInfo.AutomaticTransactionGenerator.requireAuthorize) {
+        // Authorize tagId
+        const authorizeResponse = await self._chargingStation.sendAuthorize(tagId);
+        if (authorizeResponse?.idTagInfo?.status === AuthorizationStatus.ACCEPTED) {
+          logger.info(self._logPrefix(connectorId) + ' start transaction for tagID ' + tagId);
+          // Start transaction
+          return await self._chargingStation.sendStartTransaction(connectorId, tagId);
+        }
         return authorizeResponse as StartTransactionResponse;
       }
+      logger.info(self._logPrefix(connectorId) + ' start transaction for tagID ' + tagId);
+      // Start transaction
+      return await self._chargingStation.sendStartTransaction(connectorId, tagId);
     }
     logger.info(self._logPrefix(connectorId) + ' start transaction without a tagID');
     return await self._chargingStation.sendStartTransaction(connectorId);
index b8ac0233f8abb66ff4c17d4e0da0ad803eaab2c0..8341fe30a71612a1b52ff5da90ca5245dde53d09 100644 (file)
@@ -75,9 +75,9 @@ export default class ChargingStation {
     let instanceIndex = process.env.CF_INSTANCE_INDEX ? process.env.CF_INSTANCE_INDEX : 0;
     instanceIndex = instanceIndex > 0 ? instanceIndex : '';
 
-    const idSuffix = Configuration.getChargingStationIdSuffix();
+    const idSuffix = stationTemplate.nameSuffix ? stationTemplate.nameSuffix : '';
 
-    return stationTemplate.fixedName ? stationTemplate.baseName : stationTemplate.baseName + '-' + instanceIndex + ('000000000' + this._index.toString()).substr(('000000000' + this._index.toString()).length - 4) + idSuffix;
+    return stationTemplate.fixedName ? stationTemplate.baseName : stationTemplate.baseName + '-' + instanceIndex.toString() + ('000000000' + this._index.toString()).substr(('000000000' + this._index.toString()).length - 4) + idSuffix;
   }
 
   _buildStationInfo(): ChargingStationInfo {
@@ -527,7 +527,7 @@ export default class ChargingStation {
   }
 
   _startAuthorizationFileMonitoring(): void {
-    fs.watch(this._getAuthorizationFile()).on("change", e => {
+    fs.watch(this._getAuthorizationFile()).on('change', (e) => {
       try {
         logger.debug(this._logPrefix() + ' Authorization file ' + this._getAuthorizationFile() + ' have changed, reload');
         // Initialize _authorizedTags
@@ -539,7 +539,7 @@ export default class ChargingStation {
   }
 
   _startStationTemplateFileMonitoring(): void {
-    fs.watch(this._stationTemplateFile).on("change", e => {
+    fs.watch(this._stationTemplateFile).on('change', (e) => {
       try {
         logger.debug(this._logPrefix() + ' Template file ' + this._stationTemplateFile + ' have changed, reload');
         // Initialize
@@ -828,7 +828,7 @@ export default class ChargingStation {
   async sendAuthorize(idTag?: string): Promise<AuthorizeResponse> {
     try {
       const payload: AuthorizeRequest = {
-        ...!Utils.isUndefined(idTag) ? { idTag } : { idTag: Constants.TRANSACTION_DEFAULT_IDTAG },
+        ...!Utils.isUndefined(idTag) ? { idTag } : { idTag: Constants.TRANSACTION_DEFAULT_TAGID },
       };
       return await this.sendMessage(Utils.generateUUID(), payload, MessageType.CALL_MESSAGE, RequestCommand.AUTHORIZE) as AuthorizeResponse;
     } catch (error) {
@@ -840,7 +840,7 @@ export default class ChargingStation {
     try {
       const payload: StartTransactionRequest = {
         connectorId,
-        ...!Utils.isUndefined(idTag) ? { idTag } : { idTag: Constants.TRANSACTION_DEFAULT_IDTAG },
+        ...!Utils.isUndefined(idTag) ? { idTag } : { idTag: Constants.TRANSACTION_DEFAULT_TAGID },
         meterStart: 0,
         timestamp: new Date().toISOString(),
       };
@@ -1009,7 +1009,7 @@ export default class ChargingStation {
       return;
     }
 
-    if (payload.idTagInfo.status === AuthorizationStatus.ACCEPTED) {
+    if (payload?.idTagInfo?.status === AuthorizationStatus.ACCEPTED) {
       this.getConnector(connectorId).transactionStarted = true;
       this.getConnector(connectorId).transactionId = payload.transactionId;
       this.getConnector(connectorId).idTag = requestPayload.idTag;
@@ -1023,7 +1023,7 @@ export default class ChargingStation {
       this._startMeterValues(connectorId,
         configuredMeterValueSampleInterval ? Utils.convertToInt(configuredMeterValueSampleInterval.value) * 1000 : 60000);
     } else {
-      logger.error(this._logPrefix() + ' Starting transaction id ' + payload.transactionId.toString() + ' REJECTED with status ' + payload.idTagInfo.status + ', idTag ' + requestPayload.idTag);
+      logger.error(this._logPrefix() + ' Starting transaction id ' + payload.transactionId.toString() + ' REJECTED with status ' + payload?.idTagInfo?.status + ', idTag ' + requestPayload.idTag);
       this._resetTransactionOnConnector(connectorId);
       await this.sendStatusNotification(connectorId, ChargePointStatus.AVAILABLE);
     }
index c7bc2337b0e772c4d73a3712b0606b9981500096..8eac9e46ab2bc1c0aa7b15cd687bf1f53d971e53 100644 (file)
@@ -1,7 +1,7 @@
 import { isMainThread, parentPort, workerData } from 'worker_threads';
-import Constants from '../utils/Constants';
 
 import ChargingStation from './ChargingStation';
+import Constants from '../utils/Constants';
 
 if (!isMainThread) {
   const station = new ChargingStation(workerData.index as number, workerData.templateFile as string);
@@ -12,10 +12,10 @@ if (!isMainThread) {
 }
 
 function addListener() {
-  parentPort.setMaxListeners(1000);
-  parentPort.on("message", e => {
-    if (e.id === Constants.START_NEW_CHARGING_STATION) {
-        startChargingStation(e.workerData);
+  parentPort.setMaxListeners(Constants.MAX_LISTENERS);
+  parentPort.on('message', (e) => {
+    if (e.id === Constants.START_CHARGING_STATION) {
+      startChargingStation(e.workerData);
     }
   });
 }
index fbfdf3d1f047fa1886febf126750265ae73c5d79..84ec9edff55ba258813e498cfbdb45a4daa4ded8 100644 (file)
@@ -1,9 +1,9 @@
 import { Worker, WorkerOptions } from 'worker_threads';
 
 import Configuration from '../utils/Configuration';
+import Constants from '../utils/Constants';
 import Pool from 'worker-threads-pool';
 import WorkerData from '../types/WorkerData';
-import Constants from '../utils/Constants';
 
 export default class Wrk {
   private _workerScript: string;
@@ -46,23 +46,23 @@ export default class Wrk {
    */
   async start(): Promise<Worker> {
     if (Configuration.useWorkerPool()) {
-      this._startWorkerWithPool();
+      await this._startWorkerWithPool();
     } else {
-      this._startWorker();
+      await this._startWorker();
     }
     return this._worker;
   }
 
-    /**
+  /**
    *
-   * @return {Promise}
+   * @return {void}
    * @public
    */
-  async startNewChargingStation(workerData: WorkerData, numConcurrentWorkers: number): Promise<void> {
+  addChargingStation(workerData: WorkerData, numConcurrentWorkers: number): void {
     this._workerData = workerData;
     this._index = workerData.index;
     this._concurrentWorkers = numConcurrentWorkers;
-    this._worker.postMessage({ id : Constants.START_NEW_CHARGING_STATION, workerData: workerData });
+    this._worker.postMessage({ id : Constants.START_CHARGING_STATION, workerData: workerData });
   }
 
   /**
index db07c6c1e9a71cddd40a3ed9f4ca3542dc5f03ad..9ac7a08588df1b98a0269a64b2e77765bc186416 100644 (file)
@@ -1,5 +1,5 @@
-var MongoClient = require('mongodb');
-var fs = require('fs');
+import MongoClient from 'mongodb';
+import fs from 'fs';
 
 // This script deletes charging stations
 // Filter charging stations by id pattern
@@ -8,19 +8,19 @@ var fs = require('fs');
 // Delete these charging stations all at once
 
 // Config
-var config = JSON.parse(fs.readFileSync('scriptConfig.json', 'utf8'));
+const config = JSON.parse(fs.readFileSync('scriptConfig.json', 'utf8'));
 
 // Mongo Connection and Query
 if (config && config.mongoConnectionString) {
   MongoClient.connect(config.mongoConnectionString, {
     useUnifiedTopology: true,
     useNewUrlParser: true
-    }, async function(err, client) {
+  }, async function(err, client) {
     const db = client.db('evse');
 
     for await (const tenantID of config.tenantIDs) {
-      let response = await db.collection(tenantID + '.chargingstations').deleteMany(
-        { _id: {'$regex': config.idPattern} }
+      const response = await db.collection(tenantID + '.chargingstations').deleteMany(
+        { _id: { '$regex': config.idPattern } }
       );
       console.log(response.deletedCount, `Charging Stations with id = %${config.idPattern}% deleted. TenantID =`, tenantID);
     }
index fb911ff30d23f20dc837b216829a9f9b40c3b4f3..f30b37ad30fd1fc4180f07987333c7d9e9714bf2 100644 (file)
@@ -1,6 +1,8 @@
 {
   "publicFlag": true,
-  "tenantIDs": [""],
+  "tenantIDs": [
+    ""
+  ],
   "idPattern": "",
   "mongoConnectionString": "mongodb://..."
 }
index 2bc6b7e83e45ca9cde89becd6b35ab2678c07ed9..5c1978e8ed3f524cf8165c60260522179d082c4d 100644 (file)
@@ -1,5 +1,5 @@
-var MongoClient = require('mongodb');
-var fs = require('fs');
+import MongoClient from 'mongodb';
+import fs from 'fs';
 
 // This script sets charging stations public or private
 // Filter charging stations by id pattern
@@ -9,20 +9,20 @@ var fs = require('fs');
 // set public = true
 
 // Config
-var config = JSON.parse(fs.readFileSync('scriptConfig.json', 'utf8'));
+const config = JSON.parse(fs.readFileSync('scriptConfig.json', 'utf8'));
 
 // Mongo Connection and Query
 if (config && config.mongoConnectionString) {
   MongoClient.connect(config.mongoConnectionString, {
     useUnifiedTopology: true,
     useNewUrlParser: true
-    }, async function(err, client) {
+  }, async function(err, client) {
     const db = client.db('evse');
 
     for await (const tenantID of config.tenantIDs) {
-      let response = await db.collection(tenantID + '.chargingstations').updateMany(
-        { _id: {'$regex': config.idPattern} },
-        { $set: { public : config.publicFlag } }
+      const response = await db.collection(tenantID + '.chargingstations').updateMany(
+        { _id: { '$regex': config.idPattern } },
+        { $set: { public: config.publicFlag } }
       );
       console.log(response.modifiedCount, `Charging Stations with id = %${config.idPattern}% updated. TenantID =`, tenantID);
     }
index fb58c2d28ca2187dbcf0bb48b8e5b4905f23c512..67df5a3f44b1538ebabc3eeb4f79d5c87afaf6a7 100644 (file)
@@ -1,9 +1,8 @@
 import Configuration from './utils/Configuration';
-import { StationTemplateURL } from './types/ConfigurationData';
+import Constants from './utils/Constants';
 import Utils from './utils/Utils';
-import Wrk from './charging-station/Worker';
 import WorkerData from './types/WorkerData';
-import fs from 'fs';
+import Wrk from './charging-station/Worker';
 
 class Bootstrap {
   static async start() {
@@ -11,7 +10,7 @@ class Bootstrap {
       let numStationsTotal = 0;
       let numConcurrentWorkers = 0;
       let worker: Wrk;
-      let chargingStationsPerWorker = Configuration.getChargingStationsPerWorker();
+      const chargingStationsPerWorker = Configuration.getChargingStationsPerWorker();
       let counter = 0;
       // Start each ChargingStation object in a worker thread
       if (Configuration.getStationTemplateURLs()) {
@@ -24,19 +23,18 @@ class Bootstrap {
                 index,
                 templateFile: stationURL.file
               } as WorkerData;
-              if(counter === 0 || counter === chargingStationsPerWorker) {
+              if (counter === 0 || counter === chargingStationsPerWorker) {
                 // Start new worker with one charging station
-                worker = await new Wrk('./dist/charging-station/StationWorker.js', workerData, numStationsTotal);
-                worker.start().catch(() => {});
+                worker = new Wrk('./dist/charging-station/StationWorker.js', workerData, numStationsTotal);
+                worker.start().catch(() => { });
                 counter = 0;
                 // Start workers sequentially to optimize memory at start time
-                await Utils.sleep(500);
+                await Utils.sleep(Constants.START_WORKER_DELAY);
               } else {
-                // Add new charging station to existing Worker
-                worker.startNewChargingStation(workerData, numStationsTotal)
+                // Add charging station to existing Worker
+                worker.addChargingStation(workerData, numStationsTotal);
               }
               counter++;
-              // Start charging station sequentially to optimize memory at start time
               numConcurrentWorkers = worker.concurrentWorkers;
             }
           } catch (error) {
index 65e22ea3f0cfac7612b59c16e07d5c7988268ef2..c97079d536802242aeda8835c68e0f7c07ab5148 100644 (file)
@@ -25,13 +25,15 @@ export interface AutomaticTransactionGenerator {
   maxDelayBetweenTwoTransactions: number;
   probabilityOfStart: number;
   stopAfterHours: number;
-  stopOnConnectionFailure: boolean
+  stopOnConnectionFailure: boolean;
+  requireAuthorize: boolean
 }
 
 export default interface ChargingStationTemplate {
   supervisionURL?: string;
   authorizationFile?: string;
   baseName: string;
+  nameSuffix?: string;
   fixedName?: string;
   chargePointModel: string;
   chargePointVendor: string;
index e056471cfe5ed160513d727e5ca124627d07fb7a..bc4e0f8846225ffb7547d216e21bb05c340ddf5a 100644 (file)
@@ -12,8 +12,7 @@ export default interface ConfigurationData {
   distributeStationsToTenantsEqually?: boolean;
   useWorkerPool?: boolean;
   workerPoolSize?: number;
-  chargingStationsPerWorker: number;
-  chargingStationIdSuffix: string;
+  chargingStationsPerWorker?: number;
   logFormat?: string;
   logLevel?: string;
   logRotate?: boolean;
index 090e2e2c066f5e6a2e5fec886762e372fd12f327..3e2a66bcaa266a136a9a82248ec466c5f3a7d583 100644 (file)
@@ -49,10 +49,6 @@ export default class Configuration {
     return Configuration.objectHasOwnProperty(Configuration.getConfig(), 'chargingStationsPerWorker') ? Configuration.getConfig().chargingStationsPerWorker : 1;
   }
 
-  static getChargingStationIdSuffix(): string {
-    return Configuration.objectHasOwnProperty(Configuration.getConfig(), 'chargingStationIdSuffix') ? Configuration.getConfig().chargingStationIdSuffix : '';
-  }
-
   static getLogConsole(): boolean {
     Configuration.deprecateConfigurationKey('consoleLog', 'Use \'logConsole\' instead');
     return Configuration.objectHasOwnProperty(Configuration.getConfig(), 'logConsole') ? Configuration.getConfig().logConsole : false;
index 6e5eb6972441ecb4109906591d1010c50ed5f2c9..bad0858d8b55db289b201e8e74a1cd2d75a6c478 100644 (file)
@@ -33,7 +33,10 @@ export default class Constants {
   static readonly CHARGING_STATION_DEFAULT_RESET_TIME = 60000; // Ms
   static readonly CHARGING_STATION_ATG_WAIT_TIME = 2000; // Ms
 
-  static readonly TRANSACTION_DEFAULT_IDTAG = '00000000';
+  static readonly TRANSACTION_DEFAULT_TAGID = '00000000';
 
-  static readonly START_NEW_CHARGING_STATION = 'startNewChargingStation';
+  static readonly MAX_LISTENERS = 1000;
+
+  static readonly START_WORKER_DELAY = 500;
+  static readonly START_CHARGING_STATION = 'startChargingStation';
 }