1 import type { AutomaticTransactionGeneratorConfiguration
} from
'../types';
3 export class Constants
{
4 static readonly DEFAULT_BOOT_NOTIFICATION_INTERVAL
= 60000; // Ms
5 static readonly DEFAULT_HEARTBEAT_INTERVAL
= 60000; // Ms
6 static readonly DEFAULT_METER_VALUES_INTERVAL
= 60000; // Ms
8 static readonly CHARGING_STATION_DEFAULT_RESET_TIME
= 60000; // Ms
9 static readonly CHARGING_STATION_ATG_INITIALIZATION_TIME
= 1000; // Ms
11 static readonly DEFAULT_ATG_MIN_DURATION
= 60;
12 static readonly DEFAULT_ATG_MAX_DURATION
= 120;
13 static readonly DEFAULT_ATG_MIN_DELAY_BETWEEN_TWO_TRANSACTIONS
= 15;
14 static readonly DEFAULT_ATG_MAX_DELAY_BETWEEN_TWO_TRANSACTIONS
= 30;
15 static readonly DEFAULT_ATG_STOP_AFTER_HOURS
= 0.25; // Hours
16 static readonly DEFAULT_ATG_CONFIGURATION
: AutomaticTransactionGeneratorConfiguration
=
19 minDuration
: Constants
.DEFAULT_ATG_MIN_DURATION
,
20 maxDuration
: Constants
.DEFAULT_ATG_MAX_DURATION
,
21 minDelayBetweenTwoTransactions
: Constants
.DEFAULT_ATG_MIN_DELAY_BETWEEN_TWO_TRANSACTIONS
,
22 maxDelayBetweenTwoTransactions
: Constants
.DEFAULT_ATG_MAX_DELAY_BETWEEN_TWO_TRANSACTIONS
,
23 probabilityOfStart
: 1,
24 stopAfterHours
: Constants
.DEFAULT_ATG_STOP_AFTER_HOURS
,
25 stopOnConnectionFailure
: true,
28 // See https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string
29 static readonly SEMVER_PATTERN
=
30 '^(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-]+)*))?$';
32 static readonly DEFAULT_CIRCULAR_BUFFER_CAPACITY
= 1024;
34 static readonly DEFAULT_HASH_ALGORITHM
= 'sha384';
36 static readonly DEFAULT_IDTAG
= '00000000';
38 static readonly DEFAULT_CONNECTION_TIMEOUT
= 30;
40 static readonly DEFAULT_LOG_STATISTICS_INTERVAL
= 60; // Seconds
42 static readonly DEFAULT_FLUCTUATION_PERCENT
= 5;
44 static readonly DEFAULT_PERFORMANCE_RECORDS_FILENAME
= 'performanceRecords.json';
45 static readonly DEFAULT_PERFORMANCE_RECORDS_DB_NAME
= 'e-mobility-charging-stations-simulator';
46 static readonly PERFORMANCE_RECORDS_TABLE
= 'performance_records';
48 static readonly DEFAULT_UI_SERVER_HOST
= 'localhost';
49 static readonly DEFAULT_UI_SERVER_PORT
= 8080;
51 static readonly UNKNOWN_COMMAND
= 'unknown command';
53 static readonly MAX_RANDOM_INTEGER
= 281474976710654;
55 static readonly EMPTY_FREEZED_OBJECT
= Object.freeze({});
56 static readonly EMPTY_FUNCTION
= Object.freeze(() => {
57 /* This is intentional */
60 private constructor() {
61 // This is intentional