2 type AutomaticTransactionGeneratorConfiguration
,
3 type ChargingStationInfo
,
7 } from
'../types/index.js';
9 export class Constants
{
10 static readonly DEFAULT_STATION_INFO
: Partial
<ChargingStationInfo
> = Object.freeze({
11 enableStatistics
: false,
12 remoteAuthorization
: true,
13 currentOutType
: CurrentType
.AC
,
14 mainVoltageMeterValues
: true,
15 phaseLineToLineVoltageMeterValues
: false,
16 customValueLimitationMeterValues
: true,
17 ocppStrictCompliance
: true,
18 outOfOrderEndMeterValues
: false,
19 beginEndMeterValues
: false,
20 meteringPerTransaction
: true,
21 transactionDataMeterValues
: false,
22 supervisionUrlOcppConfiguration
: false,
23 supervisionUrlOcppKey
: VendorParametersKey
.ConnectionUrl
,
24 ocppVersion
: OCPPVersion
.VERSION_16
,
25 ocppPersistentConfiguration
: true,
26 stationInfoPersistentConfiguration
: true,
27 automaticTransactionGeneratorPersistentConfiguration
: true,
28 autoReconnectMaxRetries
: -1,
29 registrationMaxRetries
: -1,
30 reconnectExponentialDelay
: false,
31 stopTransactionsOnStopped
: true,
34 static readonly DEFAULT_BOOT_NOTIFICATION_INTERVAL
= 60000; // Ms
35 static readonly DEFAULT_HEARTBEAT_INTERVAL
= 60000; // Ms
36 static readonly DEFAULT_METER_VALUES_INTERVAL
= 60000; // Ms
38 static readonly CHARGING_STATION_DEFAULT_RESET_TIME
= 60000; // Ms
39 static readonly CHARGING_STATION_ATG_AVAILABILITY_TIME
= 1000; // Ms
40 static readonly CHARGING_STATION_ATG_INITIALIZATION_TIME
= 1000; // Ms
42 static readonly DEFAULT_ATG_CONFIGURATION
: AutomaticTransactionGeneratorConfiguration
=
47 minDelayBetweenTwoTransactions
: 15,
48 maxDelayBetweenTwoTransactions
: 30,
49 probabilityOfStart
: 1,
51 stopOnConnectionFailure
: true,
54 // See https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string
55 static readonly SEMVER_PATTERN
=
56 '^(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-]+)*))?$';
58 static readonly DEFAULT_CIRCULAR_BUFFER_CAPACITY
= 4096;
60 static readonly DEFAULT_HASH_ALGORITHM
= 'sha384';
62 static readonly DEFAULT_IDTAG
= '00000000';
64 static readonly DEFAULT_CONNECTION_TIMEOUT
= 30;
66 static readonly DEFAULT_LOG_STATISTICS_INTERVAL
= 60; // Seconds
68 static readonly DEFAULT_FLUCTUATION_PERCENT
= 5;
70 static readonly DEFAULT_PERFORMANCE_DIRECTORY
= 'performance';
71 static readonly DEFAULT_PERFORMANCE_RECORDS_FILENAME
= 'performanceRecords.json';
72 static readonly DEFAULT_PERFORMANCE_RECORDS_DB_NAME
= 'e-mobility-charging-stations-simulator';
73 static readonly PERFORMANCE_RECORDS_TABLE
= 'performance_records';
75 static readonly DEFAULT_UI_SERVER_HOST
= 'localhost';
76 static readonly DEFAULT_UI_SERVER_PORT
= 8080;
78 static readonly UNKNOWN_COMMAND
= 'unknown command';
80 static readonly MAX_RANDOM_INTEGER
= 281474976710654;
82 static readonly STOP_CHARGING_STATIONS_TIMEOUT
= 120000; // Ms
84 static readonly EMPTY_FROZEN_OBJECT
= Object.freeze({});
85 static readonly EMPTY_FUNCTION
= Object.freeze(() => {
86 /* This is intentional */
89 static readonly DEFAULT_MESSAGE_BUFFER_FLUSH_INTERVAL
= 60000; // Ms
91 private constructor() {
92 // This is intentional