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_WEBSOCKET_TIMEOUT
= 60000; // Ms
30 static readonly OCPP_TRIGGER_MESSAGE_DELAY
= 500; // 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 DEFAULT_IDTAG
= '00000000';
38 static readonly ELEMENT_START_DELAY
= 0;
39 static readonly WORKER_START_DELAY
= 500;
40 static readonly WORKER_POOL_MAX_INACTIVE_TIME
= 60000;
41 static readonly DEFAULT_WORKER_POOL_MIN_SIZE
= 4;
42 static readonly DEFAULT_WORKER_POOL_MAX_SIZE
= 16;
43 static readonly DEFAULT_CHARGING_STATIONS_PER_WORKER
= 1;
45 static readonly DEFAULT_CONNECTION_TIMEOUT
= 30;
47 static readonly DEFAULT_HEARTBEAT_INTERVAL
= 60000; // Ms
49 static readonly SUPPORTED_MEASURANDS
= Object.freeze([
50 MeterValueMeasurand
.STATE_OF_CHARGE
,
51 MeterValueMeasurand
.VOLTAGE
,
52 MeterValueMeasurand
.POWER_ACTIVE_IMPORT
,
53 MeterValueMeasurand
.CURRENT_IMPORT
,
54 MeterValueMeasurand
.ENERGY_ACTIVE_IMPORT_REGISTER
57 static readonly DEFAULT_FLUCTUATION_PERCENT
= 5;
59 static readonly PERFORMANCE_RECORDS_FILETYPE
= 'Performance records';
60 static readonly DEFAULT_PERFORMANCE_RECORDS_FILENAME
= 'performanceRecords.json';
61 static readonly DEFAULT_PERFORMANCE_RECORDS_DB_NAME
= 'charging-stations-simulator';
62 static readonly PERFORMANCE_RECORDS_TABLE
= 'performance_records';
64 static readonly DEFAULT_UI_WEBSOCKET_SERVER_HOST
= 'localhost';
65 static readonly DEFAULT_UI_WEBSOCKET_SERVER_PORT
= 8080;