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