perf(simulator): build once address for tags caches addressable indexes
[e-mobility-charging-stations-simulator.git] / src / charging-station / ChargingStationUtils.ts
index efa8921c645707a293ecbd7a2b60dcb3de1d84c4..ca9a93bce9a7c06f851cbea3e1af30c238931eb9 100644 (file)
@@ -89,6 +89,14 @@ export class ChargingStationUtils {
       .digest('hex');
   }
 
+  public static checkChargingStation(chargingStation: ChargingStation, logPrefix: string): boolean {
+    if (chargingStation.started === false && chargingStation.starting === false) {
+      logger.warn(`${logPrefix} charging station is stopped, cannot proceed`);
+      return false;
+    }
+    return true;
+  }
+
   public static getTemplateMaxNumberOfConnectors(stationTemplate: ChargingStationTemplate): number {
     const templateConnectors = stationTemplate?.Connectors;
     if (!templateConnectors) {