1 import { AvailabilityStatus
, ChargingProfileStatus
, ClearChargingProfileStatus
, ConfigurationStatus
, DefaultStatus
, TriggerMessageStatus
, UnlockStatus
} from
'../types/ocpp/Responses';
3 import { MeterValueMeasurand
} from
'../types/ocpp/MeterValues';
5 export default class Constants
{
6 static readonly OCPP_RESPONSE_EMPTY
= Object.freeze({});
7 static readonly OCPP_RESPONSE_ACCEPTED
= Object.freeze({ status: DefaultStatus
.ACCEPTED
});
8 static readonly OCPP_RESPONSE_REJECTED
= Object.freeze({ status: DefaultStatus
.REJECTED
});
9 static readonly OCPP_CONFIGURATION_RESPONSE_ACCEPTED
= Object.freeze({ status: ConfigurationStatus
.ACCEPTED
});
10 static readonly OCPP_CONFIGURATION_RESPONSE_REJECTED
= Object.freeze({ status: ConfigurationStatus
.REJECTED
});
11 static readonly OCPP_CONFIGURATION_RESPONSE_REBOOT_REQUIRED
= Object.freeze({ status: ConfigurationStatus
.REBOOT_REQUIRED
});
12 static readonly OCPP_CONFIGURATION_RESPONSE_NOT_SUPPORTED
= Object.freeze({ status: ConfigurationStatus
.NOT_SUPPORTED
});
13 static readonly OCPP_SET_CHARGING_PROFILE_RESPONSE_ACCEPTED
= Object.freeze({ status: ChargingProfileStatus
.ACCEPTED
});
14 static readonly OCPP_SET_CHARGING_PROFILE_RESPONSE_REJECTED
= Object.freeze({ status: ChargingProfileStatus
.REJECTED
});
15 static readonly OCPP_SET_CHARGING_PROFILE_RESPONSE_NOT_SUPPORTED
= Object.freeze({ status: ChargingProfileStatus
.NOT_SUPPORTED
});
16 static readonly OCPP_CLEAR_CHARGING_PROFILE_RESPONSE_ACCEPTED
= Object.freeze({ status: ClearChargingProfileStatus
.ACCEPTED
});
17 static readonly OCPP_CLEAR_CHARGING_PROFILE_RESPONSE_UNKNOWN
= Object.freeze({ status: ClearChargingProfileStatus
.UNKNOWN
});
18 static readonly OCPP_RESPONSE_UNLOCKED
= Object.freeze({ status: UnlockStatus
.UNLOCKED
});
19 static readonly OCPP_RESPONSE_UNLOCK_FAILED
= Object.freeze({ status: UnlockStatus
.UNLOCK_FAILED
});
20 static readonly OCPP_RESPONSE_UNLOCK_NOT_SUPPORTED
= Object.freeze({ status: UnlockStatus
.NOT_SUPPORTED
});
21 static readonly OCPP_AVAILABILITY_RESPONSE_ACCEPTED
= Object.freeze({ status: AvailabilityStatus
.ACCEPTED
});
22 static readonly OCPP_AVAILABILITY_RESPONSE_REJECTED
= Object.freeze({ status: AvailabilityStatus
.REJECTED
});
23 static readonly OCPP_AVAILABILITY_RESPONSE_SCHEDULED
= Object.freeze({ status: AvailabilityStatus
.SCHEDULED
});
24 static readonly OCPP_TRIGGER_MESSAGE_RESPONSE_ACCEPTED
= Object.freeze({ status: TriggerMessageStatus
.ACCEPTED
});
25 static readonly OCPP_TRIGGER_MESSAGE_RESPONSE_REJECTED
= Object.freeze({ status: TriggerMessageStatus
.REJECTED
});
26 static readonly OCPP_TRIGGER_MESSAGE_RESPONSE_NOT_IMPLEMENTED
= Object.freeze({ status: TriggerMessageStatus
.NOT_IMPLEMENTED
});
28 static readonly OCPP_DEFAULT_BOOT_NOTIFICATION_INTERVAL
= 60000; // Ms
29 static readonly OCPP_SOCKET_TIMEOUT
= 60000; // Ms
30 static readonly OCPP_TRIGGER_MESSAGE_DELAY
= 2000; // Ms
32 static readonly CHARGING_STATION_DEFAULT_RESET_TIME
= 60000; // Ms
33 static readonly CHARGING_STATION_ATG_INITIALIZATION_TIME
= 1000; // Ms
34 static readonly CHARGING_STATION_ATG_DEFAULT_STOP_AFTER_HOURS
= 0.25; // Hours
36 static readonly TRANSACTION_DEFAULT_IDTAG
= '00000000';
38 static readonly WORKER_START_DELAY
= 500;
39 static readonly WORKER_POOL_MAX_INACTIVE_TIME
= 60000;
40 static readonly DEFAULT_WORKER_POOL_MIN_SIZE
= 4;
41 static readonly DEFAULT_WORKER_POOL_MAX_SIZE
= 16;
42 static readonly DEFAULT_CHARGING_STATIONS_PER_WORKER
= 1;
44 static readonly DEFAULT_CONNECTION_TIMEOUT
= 30;
46 static readonly DEFAULT_HEARTBEAT_INTERVAL
= 60000; // Ms
48 static readonly SUPPORTED_MEASURANDS
= Object.freeze([MeterValueMeasurand
.STATE_OF_CHARGE
, MeterValueMeasurand
.VOLTAGE
,
49 MeterValueMeasurand
.POWER_ACTIVE_IMPORT
, MeterValueMeasurand
.CURRENT_IMPORT
, MeterValueMeasurand
.ENERGY_ACTIVE_IMPORT_REGISTER
]);
51 static readonly DEFAULT_FLUCTUATION_PERCENT
= 5;
53 static readonly PERFORMANCE_RECORDS_FILETYPE
= 'Performance records';
54 static readonly DEFAULT_PERFORMANCE_RECORDS_FILENAME
= 'performanceRecords.json';
55 static readonly DEFAULT_PERFORMANCE_RECORDS_DB_NAME
= 'charging-stations-simulator';
56 static readonly PERFORMANCE_RECORDS_TABLE
= 'performance_records';