X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Ftypes%2FChargingStationWorker.ts;h=2326d765c7ddd05f3021cb46d1d001ae2f4da0b9;hb=156c5f4ee0466adeb90e1e131e98b3f271955787;hp=9a9d357463a0fb5f5c246e4208a557c492f3ee31;hpb=268a74bb051fcbbad532fd833f0d8fd2b33b6c64;p=e-mobility-charging-stations-simulator.git diff --git a/src/types/ChargingStationWorker.ts b/src/types/ChargingStationWorker.ts index 9a9d3574..2326d765 100644 --- a/src/types/ChargingStationWorker.ts +++ b/src/types/ChargingStationWorker.ts @@ -2,13 +2,15 @@ import type { WebSocket } from 'ws'; import type { ChargingStationAutomaticTransactionGeneratorConfiguration } from './AutomaticTransactionGenerator'; import type { ChargingStationInfo } from './ChargingStationInfo'; +import type { ChargingStationOcppConfiguration } from './ChargingStationOcppConfiguration'; import type { ConnectorStatus } from './ConnectorStatus'; +import type { EvseStatus } from './Evse'; import type { JsonObject } from './JsonType'; import type { BootNotificationResponse } from './ocpp/Responses'; import type { Statistics } from './Statistics'; import { type WorkerData, type WorkerMessage, WorkerMessageEvents } from '../worker'; -export interface ChargingStationWorkerOptions extends JsonObject { +interface ChargingStationWorkerOptions extends JsonObject { elementStartDelay?: number; } @@ -18,24 +20,30 @@ export interface ChargingStationWorkerData extends WorkerData { chargingStationWorkerOptions?: ChargingStationWorkerOptions; } +export type EvseStatusWorkerType = Omit & { + connectors?: ConnectorStatus[]; +}; + export interface ChargingStationData extends WorkerData { - stationInfo: ChargingStationInfo; started: boolean; + stationInfo: ChargingStationInfo; + connectors: ConnectorStatus[]; + evses: EvseStatusWorkerType[]; + ocppConfiguration: ChargingStationOcppConfiguration; wsState?: | typeof WebSocket.CONNECTING | typeof WebSocket.OPEN | typeof WebSocket.CLOSING | typeof WebSocket.CLOSED; bootNotificationResponse?: BootNotificationResponse; - connectors: ConnectorStatus[]; automaticTransactionGenerator?: ChargingStationAutomaticTransactionGeneratorConfiguration; } enum ChargingStationMessageEvents { - STARTED = 'started', - STOPPED = 'stopped', - UPDATED = 'updated', - PERFORMANCE_STATISTICS = 'performanceStatistics', + started = 'started', + stopped = 'stopped', + updated = 'updated', + performanceStatistics = 'performanceStatistics', } export const ChargingStationWorkerMessageEvents = { @@ -48,7 +56,7 @@ export type ChargingStationWorkerMessageData = ChargingStationData | Statistics; export type ChargingStationWorkerMessage = Omit< WorkerMessage, - 'id' + 'event' > & { - id: ChargingStationWorkerMessageEvents; + event: ChargingStationWorkerMessageEvents; };