1 import { AvailabilityStatus
, ChargingProfileStatus
, ClearChargingProfileStatus
, ConfigurationStatus
, DefaultStatus
, UnlockStatus
} from
'../types/ocpp/Responses';
3 import { MeterValueMeasurand
} from
'../types/ocpp/MeterValues';
5 export default class Constants
{
6 static readonly ENTITY_CHARGING_STATION
= 'ChargingStation';
7 static readonly ENTITY_AUTOMATIC_TRANSACTION_GENERATOR
= 'AutomaticTransactionGenerator';
9 static readonly OCPP_RESPONSE_EMPTY
= Object.freeze({});
10 static readonly OCPP_RESPONSE_ACCEPTED
= Object.freeze({ status: DefaultStatus
.ACCEPTED
});
11 static readonly OCPP_RESPONSE_REJECTED
= Object.freeze({ status: DefaultStatus
.REJECTED
});
12 static readonly OCPP_CONFIGURATION_RESPONSE_ACCEPTED
= Object.freeze({ status: ConfigurationStatus
.ACCEPTED
});
13 static readonly OCPP_CONFIGURATION_RESPONSE_REJECTED
= Object.freeze({ status: ConfigurationStatus
.REJECTED
});
14 static readonly OCPP_CONFIGURATION_RESPONSE_REBOOT_REQUIRED
= Object.freeze({ status: ConfigurationStatus
.REBOOT_REQUIRED
});
15 static readonly OCPP_CONFIGURATION_RESPONSE_NOT_SUPPORTED
= Object.freeze({ status: ConfigurationStatus
.NOT_SUPPORTED
});
16 static readonly OCPP_SET_CHARGING_PROFILE_RESPONSE_ACCEPTED
= Object.freeze({ status: ChargingProfileStatus
.ACCEPTED
});
17 static readonly OCPP_SET_CHARGING_PROFILE_RESPONSE_REJECTED
= Object.freeze({ status: ChargingProfileStatus
.REJECTED
});
18 static readonly OCPP_SET_CHARGING_PROFILE_RESPONSE_NOT_SUPPORTED
= Object.freeze({ status: ChargingProfileStatus
.NOT_SUPPORTED
});
19 static readonly OCPP_CLEAR_CHARGING_PROFILE_RESPONSE_ACCEPTED
= Object.freeze({ status: ClearChargingProfileStatus
.ACCEPTED
});
20 static readonly OCPP_CLEAR_CHARGING_PROFILE_RESPONSE_UNKNOWN
= Object.freeze({ status: ClearChargingProfileStatus
.UNKNOWN
});
21 static readonly OCPP_RESPONSE_UNLOCKED
= Object.freeze({ status: UnlockStatus
.UNLOCKED
});
22 static readonly OCPP_RESPONSE_UNLOCK_FAILED
= Object.freeze({ status: UnlockStatus
.UNLOCK_FAILED
});
23 static readonly OCPP_RESPONSE_UNLOCK_NOT_SUPPORTED
= Object.freeze({ status: UnlockStatus
.NOT_SUPPORTED
});
24 static readonly OCPP_AVAILABILITY_RESPONSE_ACCEPTED
= Object.freeze({ status: AvailabilityStatus
.ACCEPTED
});
25 static readonly OCPP_AVAILABILITY_RESPONSE_REJECTED
= Object.freeze({ status: AvailabilityStatus
.REJECTED
});
26 static readonly OCPP_AVAILABILITY_RESPONSE_SCHEDULED
= Object.freeze({ status: AvailabilityStatus
.SCHEDULED
});
28 static readonly OCPP_DEFAULT_BOOT_NOTIFICATION_INTERVAL
= 60000; // Ms
29 static readonly OCPP_ERROR_TIMEOUT
= 60000; // Ms
31 static readonly CHARGING_STATION_DEFAULT_RESET_TIME
= 60000; // Ms
32 static readonly CHARGING_STATION_ATG_WAIT_TIME
= 2000; // Ms
33 static readonly CHARGING_STATION_ATG_INITIALIZATION_TIME
= 1000; // Ms
35 static readonly TRANSACTION_DEFAULT_IDTAG
= '00000000';
37 static readonly WORKER_START_DELAY
= 500;
38 static readonly WORKER_POOL_MAX_INACTIVE_TIME
= 60000;
39 static readonly DEFAULT_WORKER_POOL_MIN_SIZE
= 4;
40 static readonly DEFAULT_WORKER_POOL_MAX_SIZE
= 16;
41 static readonly DEFAULT_CHARGING_STATIONS_PER_WORKER
= 1;
43 static readonly DEFAULT_CONNECTION_TIMEOUT
= 30;
45 static readonly DEFAULT_HEARTBEAT_INTERVAL
= 60000; // Ms
47 static readonly SUPPORTED_MEASURANDS
= Object.freeze([MeterValueMeasurand
.STATE_OF_CHARGE
, MeterValueMeasurand
.VOLTAGE
,
48 MeterValueMeasurand
.POWER_ACTIVE_IMPORT
, MeterValueMeasurand
.CURRENT_IMPORT
, MeterValueMeasurand
.ENERGY_ACTIVE_IMPORT_REGISTER
]);
50 static readonly DEFAULT_FLUCTUATION_PERCENT
= 5;