Avoid information duplication for connectors
authorJérôme Benoit <jerome.benoit@sap.com>
Wed, 21 Oct 2020 12:30:13 +0000 (14:30 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Wed, 21 Oct 2020 12:30:13 +0000 (14:30 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/charging-station/ChargingStation.js
src/index.js

index d5b1a692b2851dbb70e0e06cda7b38b3711dddfe..dc484cf98fb15e3752c931a763c02150fd4fcc98 100644 (file)
@@ -95,6 +95,8 @@ class ChargingStation {
         this._connectors[index] = connectorsConfig[randConnectorID];
       }
     }
+    // Avoid duplication of connectors related information
+    delete this._stationInfo.Connectors;
     // Initialize transaction attributes on connectors
     for (const connector in this._connectors) {
       if (!this._connectors[connector].transactionStarted) {
@@ -168,10 +170,6 @@ class ChargingStation {
     return powerDivider;
   }
 
-  _getConnectorFromTemplate(number) {
-    return this._stationInfo.Connectors[number];
-  }
-
   _getConnector(number) {
     return this._connectors[number];
   }
index b87c42535d0804c0f6b59dd97a2c9e64f306063a..fa6ef1bf4c301840fa1f1253d03127afc69e6a80 100644 (file)
@@ -31,6 +31,8 @@ class Bootstrap {
       }
       if (numStationsTotal === 0) {
         console.log('No charging station template enabled in configuration, exiting');
+      } else {
+        console.log('Charging station simulator started with ' + numStationsTotal + ' charging stations');
       }
     } catch (error) {
       // eslint-disable-next-line no-console