Commit | Line | Data |
---|---|---|
5e3cb728 | 1 | import type { Status } from './AutomaticTransactionGenerator'; |
6c1761d4 JB |
2 | import type ChargingStationInfo from './ChargingStationInfo'; |
3 | import type { ConnectorStatus } from './ConnectorStatus'; | |
4 | import type { JsonObject } from './JsonType'; | |
5 | import type { BootNotificationResponse } from './ocpp/Responses'; | |
6 | import type Statistics from './Statistics'; | |
8114d10e | 7 | import { WorkerData, WorkerMessage, WorkerMessageEvents } from './Worker'; |
d070d967 | 8 | |
e3822d6f | 9 | export interface ChargingStationWorkerOptions extends JsonObject { |
d070d967 JB |
10 | elementStartDelay?: number; |
11 | } | |
12 | ||
98dc07fa JB |
13 | export interface ChargingStationWorkerData extends WorkerData { |
14 | index: number; | |
15 | templateFile: string; | |
d070d967 | 16 | chargingStationWorkerOptions?: ChargingStationWorkerOptions; |
98dc07fa JB |
17 | } |
18 | ||
32de5a57 | 19 | export interface ChargingStationData extends WorkerData { |
32de5a57 | 20 | stationInfo: ChargingStationInfo; |
452a82ca | 21 | started: boolean; |
5e3cb728 | 22 | wsState?: number; |
ce7a4fc3 | 23 | bootNotificationResponse: BootNotificationResponse; |
32de5a57 | 24 | connectors: ConnectorStatus[]; |
5e3cb728 | 25 | automaticTransactionGeneratorStatuses?: Status[]; |
32de5a57 LM |
26 | } |
27 | ||
28 | enum ChargingStationMessageEvents { | |
ee0f106b JB |
29 | STARTED = 'started', |
30 | STOPPED = 'stopped', | |
32de5a57 | 31 | UPDATED = 'updated', |
e7aeea18 | 32 | PERFORMANCE_STATISTICS = 'performanceStatistics', |
98dc07fa JB |
33 | } |
34 | ||
32de5a57 | 35 | export type ChargingStationWorkerMessageEvents = WorkerMessageEvents | ChargingStationMessageEvents; |
98dc07fa JB |
36 | |
37 | export const ChargingStationWorkerMessageEvents = { | |
38 | ...WorkerMessageEvents, | |
32de5a57 | 39 | ...ChargingStationMessageEvents, |
98dc07fa JB |
40 | }; |
41 | ||
53e5fd67 JB |
42 | export type ChargingStationWorkerMessageData = ChargingStationData | Statistics; |
43 | ||
32de5a57 LM |
44 | export interface ChargingStationWorkerMessage<T extends WorkerData> |
45 | extends Omit<WorkerMessage<T>, 'id'> { | |
98dc07fa JB |
46 | id: ChargingStationWorkerMessageEvents; |
47 | } |