refactor(simulator): switch to named exports
[e-mobility-charging-stations-simulator.git] / src / utils / Constants.ts
CommitLineData
268a74bb 1import { MeterValueMeasurand } from '../types';
9ccca265 2
268a74bb 3export class Constants {
c55b9bc2 4 static readonly OCPP_DEFAULT_BOOT_NOTIFICATION_INTERVAL = 60000; // Ms
6d9abcc2 5 static readonly OCPP_WEBSOCKET_TIMEOUT = 60000; // Ms
4d7227e6 6 static readonly OCPP_TRIGGER_MESSAGE_DELAY = 500; // Ms
d2a64eb5 7
10570d97 8 static readonly CHARGING_STATION_DEFAULT_RESET_TIME = 60000; // Ms
a4cc42ea 9 static readonly CHARGING_STATION_ATG_INITIALIZATION_TIME = 1000; // Ms
7d75bee1 10 static readonly CHARGING_STATION_ATG_DEFAULT_STOP_AFTER_HOURS = 0.25; // Hours
9ac86a7e 11
b25b8684 12 // See https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string
3637ca2c
JB
13 static readonly SEMVER_PATTERN =
14 '^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$';
b25b8684 15
9a15316c 16 static readonly DEFAULT_CIRCULAR_BUFFER_CAPACITY = 1024;
1e080116 17
3f94cab5
JB
18 static readonly DEFAULT_HASH_ALGORITHM = 'sha384';
19
c69294f7 20 static readonly DEFAULT_IDTAG = '00000000';
3d2ff9e4 21
291cb255 22 static readonly DEFAULT_CONNECTION_TIMEOUT = 30;
9ccca265 23
25f5a959
JB
24 static readonly DEFAULT_LOG_STATISTICS_INTERVAL = 60; // Seconds
25
47e22477 26 static readonly DEFAULT_HEARTBEAT_INTERVAL = 60000; // Ms
d3195f0a 27 static readonly DEFAULT_METER_VALUES_INTERVAL = 60000; // Ms
47e22477 28
6a49ad23
JB
29 static readonly SUPPORTED_MEASURANDS = Object.freeze([
30 MeterValueMeasurand.STATE_OF_CHARGE,
31 MeterValueMeasurand.VOLTAGE,
32 MeterValueMeasurand.POWER_ACTIVE_IMPORT,
33 MeterValueMeasurand.CURRENT_IMPORT,
e7aeea18 34 MeterValueMeasurand.ENERGY_ACTIVE_IMPORT_REGISTER,
6a49ad23 35 ]);
9ccca265
JB
36
37 static readonly DEFAULT_FLUCTUATION_PERCENT = 5;
2a370053 38
a6b3c6c3 39 static readonly DEFAULT_PERFORMANCE_RECORDS_FILENAME = 'performanceRecords.json';
7f774a55 40 static readonly DEFAULT_PERFORMANCE_RECORDS_DB_NAME = 'e-mobility-charging-stations-simulator';
ae8ee665 41 static readonly PERFORMANCE_RECORDS_TABLE = 'performance_records';
6a49ad23 42
adbddcb4
JB
43 static readonly DEFAULT_UI_SERVER_HOST = 'localhost';
44 static readonly DEFAULT_UI_SERVER_PORT = 8080;
4db8406c 45
2a232a18
JB
46 static readonly UNKNOWN_COMMAND = 'unknown command';
47
59395dc1
JB
48 static readonly MAX_RANDOM_INTEGER = 281474976710654;
49
4db8406c
JB
50 private constructor() {
51 // This is intentional
52 }
f7869514 53}