X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Ftypes%2FChargingStationWorker.ts;h=6fe529f91ac45183dd4ffaf147136f1745cddc54;hb=899cb106c44c0b7a56266b5470a22c0cc773cc44;hp=f0a58013d275f9adec5aa0c4d6384d76022c0a7c;hpb=1895299db899eb53db7fb1615b82624f806017e8;p=e-mobility-charging-stations-simulator.git diff --git a/src/types/ChargingStationWorker.ts b/src/types/ChargingStationWorker.ts index f0a58013..6fe529f9 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 { WorkerData, WorkerMessage, WorkerMessageEvents } from './Worker'; +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 = {