import { StorageFactory } from '../performance/storage/StorageFactory';
import {
ChargingStationData,
ChargingStationWorkerData,
ChargingStationWorkerMessage,
import { StorageFactory } from '../performance/storage/StorageFactory';
import {
ChargingStationData,
ChargingStationWorkerData,
ChargingStationWorkerMessage,
ChargingStationWorkerMessageEvents,
} from '../types/ChargingStationWorker';
ChargingStationWorkerMessageEvents,
} from '../types/ChargingStationWorker';
-import { StationTemplateUrl } from '../types/ConfigurationData';
-import Statistics from '../types/Statistics';
-import { ApplicationProtocol } from '../types/UIProtocol';
+import type { StationTemplateUrl } from '../types/ConfigurationData';
+import type Statistics from '../types/Statistics';
import Configuration from '../utils/Configuration';
import logger from '../utils/Logger';
import Utils from '../utils/Utils';
import Configuration from '../utils/Configuration';
import logger from '../utils/Logger';
import Utils from '../utils/Utils';
import WorkerFactory from '../worker/WorkerFactory';
import { ChargingStationUtils } from './ChargingStationUtils';
import WorkerFactory from '../worker/WorkerFactory';
import { ChargingStationUtils } from './ChargingStationUtils';
import { UIServiceUtils } from './ui-server/ui-services/UIServiceUtils';
import UIServerFactory from './ui-server/UIServerFactory';
const moduleName = 'Bootstrap';
import { UIServiceUtils } from './ui-server/ui-services/UIServiceUtils';
import UIServerFactory from './ui-server/UIServerFactory';
const moduleName = 'Bootstrap';
private static instance: Bootstrap | null = null;
private workerImplementation: WorkerAbstract<ChargingStationWorkerData> | null = null;
private readonly uiServer!: AbstractUIServer;
private readonly storage!: Storage;
private numberOfChargingStationTemplates!: number;
private numberOfChargingStations!: number;
private static instance: Bootstrap | null = null;
private workerImplementation: WorkerAbstract<ChargingStationWorkerData> | null = null;
private readonly uiServer!: AbstractUIServer;
private readonly storage!: Storage;
private numberOfChargingStationTemplates!: number;
private numberOfChargingStations!: number;
private readonly version: string = version;
private started: boolean;
private readonly workerScript: string;
private readonly version: string = version;
private started: boolean;
private readonly workerScript: string;
...Configuration.getUIServer().options,
handleProtocols: UIServiceUtils.handleProtocols,
}));
...Configuration.getUIServer().options,
handleProtocols: UIServiceUtils.handleProtocols,
}));
}
if (this.numberOfChargingStations === 0) {
console.warn(
chalk.yellow('No charging station template enabled in configuration, exiting')
);
}
if (this.numberOfChargingStations === 0) {
console.warn(
chalk.yellow('No charging station template enabled in configuration, exiting')
);
workerChoiceStrategy: Configuration.getWorker().poolStrategy,
},
messageHandler: this.messageHandler.bind(this) as (
workerChoiceStrategy: Configuration.getWorker().poolStrategy,
},
messageHandler: this.messageHandler.bind(this) as (
- this.uiServer?.chargingStations.set(data.hashId, data);
- this.started && ++this.numberOfChargingStations;
+ this.uiServer?.chargingStations.set(data.stationInfo.hashId, data);
+ ++this.numberOfStartedChargingStations;
- this.uiServer?.chargingStations.delete(data.hashId);
- this.started && --this.numberOfChargingStations;
+ this.uiServer?.chargingStations.set(data.stationInfo.hashId, data);
+ --this.numberOfStartedChargingStations;