1 import { MeterValueMeasurand
} from
'../types/ocpp/MeterValues';
3 export default class Constants
{
4 static readonly OCPP_DEFAULT_BOOT_NOTIFICATION_INTERVAL
= 60000; // Ms
5 static readonly OCPP_WEBSOCKET_TIMEOUT
= 60000; // Ms
6 static readonly OCPP_TRIGGER_MESSAGE_DELAY
= 500; // Ms
8 static readonly CHARGING_STATION_DEFAULT_RESET_TIME
= 60000; // Ms
9 static readonly CHARGING_STATION_ATG_INITIALIZATION_TIME
= 1000; // Ms
10 static readonly CHARGING_STATION_ATG_DEFAULT_STOP_AFTER_HOURS
= 0.25; // Hours
12 // See https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string
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-]+)*))?$';
16 static readonly DEFAULT_CIRCULAR_BUFFER_CAPACITY
= Number.MAX_SAFE_INTEGER
;
18 static readonly DEFAULT_HASH_ALGORITHM
= 'sha384';
20 static readonly DEFAULT_IDTAG
= '00000000';
22 static readonly DEFAULT_CONNECTION_TIMEOUT
= 30;
24 static readonly DEFAULT_LOG_STATISTICS_INTERVAL
= 60; // Seconds
26 static readonly DEFAULT_HEARTBEAT_INTERVAL
= 60000; // Ms
27 static readonly DEFAULT_METER_VALUES_INTERVAL
= 60000; // Ms
29 static readonly SUPPORTED_MEASURANDS
= Object.freeze([
30 MeterValueMeasurand
.STATE_OF_CHARGE
,
31 MeterValueMeasurand
.VOLTAGE
,
32 MeterValueMeasurand
.POWER_ACTIVE_IMPORT
,
33 MeterValueMeasurand
.CURRENT_IMPORT
,
34 MeterValueMeasurand
.ENERGY_ACTIVE_IMPORT_REGISTER
,
37 static readonly DEFAULT_FLUCTUATION_PERCENT
= 5;
39 static readonly DEFAULT_PERFORMANCE_RECORDS_FILENAME
= 'performanceRecords.json';
40 static readonly DEFAULT_PERFORMANCE_RECORDS_DB_NAME
= 'e-mobility-charging-stations-simulator';
41 static readonly PERFORMANCE_RECORDS_TABLE
= 'performance_records';
43 static readonly DEFAULT_UI_SERVER_HOST
= 'localhost';
44 static readonly DEFAULT_UI_SERVER_PORT
= 8080;
46 static readonly UNKNOWN_COMMAND
= 'unknown command';
48 private constructor() {
49 // This is intentional