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