Commit | Line | Data |
---|---|---|
e7aeea18 JB |
1 | import { |
2 | AvailabilityStatus, | |
3 | ChargingProfileStatus, | |
4 | ClearChargingProfileStatus, | |
5 | ConfigurationStatus, | |
6 | DefaultStatus, | |
7 | TriggerMessageStatus, | |
8 | UnlockStatus, | |
9 | } from '../types/ocpp/Responses'; | |
9ccca265 JB |
10 | |
11 | import { MeterValueMeasurand } from '../types/ocpp/MeterValues'; | |
9ac86a7e | 12 | |
3f40bc9c | 13 | export default class Constants { |
47e22477 | 14 | static readonly OCPP_RESPONSE_EMPTY = Object.freeze({}); |
f738a0e9 JB |
15 | static readonly OCPP_RESPONSE_ACCEPTED = Object.freeze({ status: DefaultStatus.ACCEPTED }); |
16 | static readonly OCPP_RESPONSE_REJECTED = Object.freeze({ status: DefaultStatus.REJECTED }); | |
e7aeea18 JB |
17 | static readonly OCPP_CONFIGURATION_RESPONSE_ACCEPTED = Object.freeze({ |
18 | status: ConfigurationStatus.ACCEPTED, | |
19 | }); | |
20 | static readonly OCPP_CONFIGURATION_RESPONSE_REJECTED = Object.freeze({ | |
21 | status: ConfigurationStatus.REJECTED, | |
22 | }); | |
23 | static readonly OCPP_CONFIGURATION_RESPONSE_REBOOT_REQUIRED = Object.freeze({ | |
24 | status: ConfigurationStatus.REBOOT_REQUIRED, | |
25 | }); | |
26 | static readonly OCPP_CONFIGURATION_RESPONSE_NOT_SUPPORTED = Object.freeze({ | |
27 | status: ConfigurationStatus.NOT_SUPPORTED, | |
28 | }); | |
29 | static readonly OCPP_SET_CHARGING_PROFILE_RESPONSE_ACCEPTED = Object.freeze({ | |
30 | status: ChargingProfileStatus.ACCEPTED, | |
31 | }); | |
32 | static readonly OCPP_SET_CHARGING_PROFILE_RESPONSE_REJECTED = Object.freeze({ | |
33 | status: ChargingProfileStatus.REJECTED, | |
34 | }); | |
35 | static readonly OCPP_SET_CHARGING_PROFILE_RESPONSE_NOT_SUPPORTED = Object.freeze({ | |
36 | status: ChargingProfileStatus.NOT_SUPPORTED, | |
37 | }); | |
38 | static readonly OCPP_CLEAR_CHARGING_PROFILE_RESPONSE_ACCEPTED = Object.freeze({ | |
39 | status: ClearChargingProfileStatus.ACCEPTED, | |
40 | }); | |
41 | static readonly OCPP_CLEAR_CHARGING_PROFILE_RESPONSE_UNKNOWN = Object.freeze({ | |
42 | status: ClearChargingProfileStatus.UNKNOWN, | |
43 | }); | |
9ac86a7e | 44 | static readonly OCPP_RESPONSE_UNLOCKED = Object.freeze({ status: UnlockStatus.UNLOCKED }); |
e7aeea18 JB |
45 | static readonly OCPP_RESPONSE_UNLOCK_FAILED = Object.freeze({ |
46 | status: UnlockStatus.UNLOCK_FAILED, | |
47 | }); | |
48 | static readonly OCPP_RESPONSE_UNLOCK_NOT_SUPPORTED = Object.freeze({ | |
49 | status: UnlockStatus.NOT_SUPPORTED, | |
50 | }); | |
51 | static readonly OCPP_AVAILABILITY_RESPONSE_ACCEPTED = Object.freeze({ | |
52 | status: AvailabilityStatus.ACCEPTED, | |
53 | }); | |
54 | static readonly OCPP_AVAILABILITY_RESPONSE_REJECTED = Object.freeze({ | |
55 | status: AvailabilityStatus.REJECTED, | |
56 | }); | |
57 | static readonly OCPP_AVAILABILITY_RESPONSE_SCHEDULED = Object.freeze({ | |
58 | status: AvailabilityStatus.SCHEDULED, | |
59 | }); | |
60 | static readonly OCPP_TRIGGER_MESSAGE_RESPONSE_ACCEPTED = Object.freeze({ | |
61 | status: TriggerMessageStatus.ACCEPTED, | |
62 | }); | |
63 | static readonly OCPP_TRIGGER_MESSAGE_RESPONSE_REJECTED = Object.freeze({ | |
64 | status: TriggerMessageStatus.REJECTED, | |
65 | }); | |
66 | static readonly OCPP_TRIGGER_MESSAGE_RESPONSE_NOT_IMPLEMENTED = Object.freeze({ | |
67 | status: TriggerMessageStatus.NOT_IMPLEMENTED, | |
68 | }); | |
2e6f5966 | 69 | |
c55b9bc2 | 70 | static readonly OCPP_DEFAULT_BOOT_NOTIFICATION_INTERVAL = 60000; // Ms |
6d9abcc2 | 71 | static readonly OCPP_WEBSOCKET_TIMEOUT = 60000; // Ms |
4d7227e6 | 72 | static readonly OCPP_TRIGGER_MESSAGE_DELAY = 500; // Ms |
d2a64eb5 | 73 | |
10570d97 | 74 | static readonly CHARGING_STATION_DEFAULT_RESET_TIME = 60000; // Ms |
a4cc42ea | 75 | static readonly CHARGING_STATION_ATG_INITIALIZATION_TIME = 1000; // Ms |
7d75bee1 | 76 | static readonly CHARGING_STATION_ATG_DEFAULT_STOP_AFTER_HOURS = 0.25; // Hours |
9ac86a7e | 77 | |
c69294f7 | 78 | static readonly DEFAULT_IDTAG = '00000000'; |
3d2ff9e4 | 79 | |
4bfd80fa | 80 | static readonly ELEMENT_START_DELAY = 0; |
322c9192 | 81 | static readonly WORKER_START_DELAY = 500; |
a4624c96 | 82 | static readonly WORKER_POOL_MAX_INACTIVE_TIME = 60000; |
1f0052b9 JB |
83 | static readonly DEFAULT_WORKER_POOL_MIN_SIZE = 4; |
84 | static readonly DEFAULT_WORKER_POOL_MAX_SIZE = 16; | |
85 | static readonly DEFAULT_CHARGING_STATIONS_PER_WORKER = 1; | |
291cb255 JB |
86 | |
87 | static readonly DEFAULT_CONNECTION_TIMEOUT = 30; | |
9ccca265 | 88 | |
47e22477 JB |
89 | static readonly DEFAULT_HEARTBEAT_INTERVAL = 60000; // Ms |
90 | ||
6a49ad23 JB |
91 | static readonly SUPPORTED_MEASURANDS = Object.freeze([ |
92 | MeterValueMeasurand.STATE_OF_CHARGE, | |
93 | MeterValueMeasurand.VOLTAGE, | |
94 | MeterValueMeasurand.POWER_ACTIVE_IMPORT, | |
95 | MeterValueMeasurand.CURRENT_IMPORT, | |
e7aeea18 | 96 | MeterValueMeasurand.ENERGY_ACTIVE_IMPORT_REGISTER, |
6a49ad23 | 97 | ]); |
9ccca265 JB |
98 | |
99 | static readonly DEFAULT_FLUCTUATION_PERCENT = 5; | |
2a370053 JB |
100 | |
101 | static readonly PERFORMANCE_RECORDS_FILETYPE = 'Performance records'; | |
a6b3c6c3 | 102 | static readonly DEFAULT_PERFORMANCE_RECORDS_FILENAME = 'performanceRecords.json'; |
2a370053 | 103 | static readonly DEFAULT_PERFORMANCE_RECORDS_DB_NAME = 'charging-stations-simulator'; |
ae8ee665 | 104 | static readonly PERFORMANCE_RECORDS_TABLE = 'performance_records'; |
6a49ad23 JB |
105 | |
106 | static readonly DEFAULT_UI_WEBSOCKET_SERVER_HOST = 'localhost'; | |
5f8a4fd6 | 107 | static readonly DEFAULT_UI_WEBSOCKET_SERVER_PORT = 8080; |
f7869514 | 108 | } |