2 type AutomaticTransactionGeneratorConfiguration
,
3 type ChargingStationInfo
,
5 type IncomingRequestCommand
,
9 } from
'../types/index.js'
11 // eslint-disable-next-line @typescript-eslint/no-extraneous-class
12 export class Constants
{
13 static readonly DEFAULT_ATG_CONFIGURATION
: AutomaticTransactionGeneratorConfiguration
=
16 maxDelayBetweenTwoTransactions
: 30,
18 minDelayBetweenTwoTransactions
: 15,
20 probabilityOfStart
: 1,
21 stopAbsoluteDuration
: false,
25 static readonly DEFAULT_ATG_WAIT_TIME
= 1000 // Ms
27 static readonly DEFAULT_BOOT_NOTIFICATION_INTERVAL
= 60000 // Ms
29 static readonly DEFAULT_CIRCULAR_BUFFER_CAPACITY
= 386
30 static readonly DEFAULT_CONNECTION_TIMEOUT
= 30
32 static readonly DEFAULT_FLUCTUATION_PERCENT
= 5
33 static readonly DEFAULT_HASH_ALGORITHM
= 'sha384'
35 static readonly DEFAULT_HEARTBEAT_INTERVAL
= 60000 // Ms
37 static readonly DEFAULT_IDTAG
= '00000000'
39 static readonly DEFAULT_LOG_STATISTICS_INTERVAL
= 60 // Seconds
41 static readonly DEFAULT_MESSAGE_BUFFER_FLUSH_INTERVAL
= 60000 // Ms
43 static readonly DEFAULT_METER_VALUES_INTERVAL
= 60000 // Ms
45 static readonly DEFAULT_PERFORMANCE_DIRECTORY
= 'performance'
47 static readonly DEFAULT_PERFORMANCE_RECORDS_DB_NAME
= 'e-mobility-charging-stations-simulator'
48 static readonly DEFAULT_PERFORMANCE_RECORDS_FILENAME
= 'performanceRecords.json'
49 static readonly DEFAULT_STATION_INFO
: Partial
<ChargingStationInfo
> = Object.freeze({
50 automaticTransactionGeneratorPersistentConfiguration
: true,
51 autoReconnectMaxRetries
: -1,
53 beginEndMeterValues
: false,
54 currentOutType
: CurrentType
.AC
,
55 customValueLimitationMeterValues
: true,
56 enableStatistics
: false,
63 // See https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string
64 firmwareVersionPattern
:
65 '^(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-]+)*))?$',
66 mainVoltageMeterValues
: true,
67 meteringPerTransaction
: true,
68 ocppPersistentConfiguration
: true,
69 ocppStrictCompliance
: true,
70 ocppVersion
: OCPPVersion
.VERSION_16
,
71 outOfOrderEndMeterValues
: false,
72 phaseLineToLineVoltageMeterValues
: false,
73 reconnectExponentialDelay
: false,
74 registrationMaxRetries
: -1,
75 remoteAuthorization
: true,
76 resetTime
: 30000, // Ms
77 stationInfoPersistentConfiguration
: true,
78 stopTransactionsOnStopped
: true,
79 supervisionUrlOcppConfiguration
: false,
80 supervisionUrlOcppKey
: VendorParametersKey
.ConnectionUrl
,
81 transactionDataMeterValues
: false,
82 useConnectorId0
: true,
85 static readonly DEFAULT_UI_SERVER_HOST
= 'localhost'
87 static readonly DEFAULT_UI_SERVER_PORT
= 8080
88 static readonly EMPTY_FROZEN_OBJECT
= Object.freeze({})
90 static readonly EMPTY_FUNCTION
= Object.freeze(() => {
91 /* This is intentional */
94 static readonly MAX_RANDOM_INTEGER
= 281474976710655
96 static readonly PERFORMANCE_RECORDS_TABLE
= 'performance_records'
98 static readonly STOP_CHARGING_STATIONS_TIMEOUT
= 60000 // Ms
100 static readonly UNKNOWN_OCPP_COMMAND
= 'unknown OCPP command' as
101 | IncomingRequestCommand
104 private constructor () {
105 // This is intentional