X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Ftypes%2FChargingStationTemplate.ts;h=23644c7faa86d146867df651a2717a1ba57d9367;hb=ac7f79af9a7d553aa0806b97fa138b15cd3d9542;hp=0136ab329beb8931eede6b34524537023bd68d6a;hpb=47e224777669f935f45d443b6da948e7977fd9b7;p=e-mobility-charging-stations-simulator.git diff --git a/src/types/ChargingStationTemplate.ts b/src/types/ChargingStationTemplate.ts index 0136ab32..23644c7f 100644 --- a/src/types/ChargingStationTemplate.ts +++ b/src/types/ChargingStationTemplate.ts @@ -1,7 +1,19 @@ -import ChargingStationConfiguration from './ChargingStationConfiguration'; -import Connectors from './Connectors'; -import { OCPPProtocol } from './ocpp/OCPPProtocol'; -import { OCPPVersion } from './ocpp/OCPPVersion'; +import type { ClientRequestArgs } from 'node:http'; + +import type { ClientOptions } from 'ws'; + +import type { + AutomaticTransactionGeneratorConfiguration, + ChargingStationOcppConfiguration, + ConnectorStatus, + EvseTemplate, + FirmwareStatus, + IncomingRequestCommand, + MessageTrigger, + OCPPProtocol, + OCPPVersion, + RequestCommand, +} from './internal'; export enum CurrentType { AC = 'AC', @@ -13,37 +25,64 @@ export enum PowerUnits { KILO_WATT = 'kW', } +export enum AmpereUnits { + MILLI_AMPERE = 'mA', + CENTI_AMPERE = 'cA', + DECI_AMPERE = 'dA', + AMPERE = 'A', +} + export enum Voltage { VOLTAGE_110 = 110, VOLTAGE_230 = 230, VOLTAGE_400 = 400, - VOLTAGE_800 = 800 + VOLTAGE_800 = 800, } -export interface AutomaticTransactionGenerator { - enable: boolean; - minDuration: number; - maxDuration: number; - minDelayBetweenTwoTransactions: number; - maxDelayBetweenTwoTransactions: number; - probabilityOfStart: number; - stopAfterHours: number; - stopOnConnectionFailure: boolean; - requireAuthorize?: boolean -} +export type WsOptions = ClientOptions & ClientRequestArgs; + +export type FirmwareUpgrade = { + versionUpgrade?: { + patternGroup?: number; + step?: number; + }; + reset?: boolean; + failureStatus?: FirmwareStatus; +}; -export default interface ChargingStationTemplate { - supervisionURL?: string; +type CommandsSupport = { + incomingCommands: Record; + outgoingCommands?: Record; +}; + +export type ChargingStationTemplate = { + templateHash?: string; + supervisionUrls?: string | string[]; + supervisionUrlOcppConfiguration?: boolean; + supervisionUrlOcppKey?: string; + supervisionUser?: string; + supervisionPassword?: string; ocppVersion?: OCPPVersion; ocppProtocol?: OCPPProtocol; - authorizationFile?: string; + ocppStrictCompliance?: boolean; + ocppPersistentConfiguration?: boolean; + stationInfoPersistentConfiguration?: boolean; + wsOptions?: WsOptions; + idTagsFile?: string; baseName: string; nameSuffix?: string; fixedName?: boolean; chargePointModel: string; chargePointVendor: string; + chargePointSerialNumberPrefix?: string; chargeBoxSerialNumberPrefix?: string; + firmwareVersionPattern?: string; firmwareVersion?: string; + firmwareUpgrade?: FirmwareUpgrade; + iccid?: string; + imsi?: string; + meterSerialNumberPrefix?: string; + meterType?: string; power: number | number[]; powerSharedByConnectors?: boolean; powerUnit: PowerUnits; @@ -54,19 +93,26 @@ export default interface ChargingStationTemplate { useConnectorId0?: boolean; randomConnectors?: boolean; resetTime?: number; - autoRegister: boolean; + autoRegister?: boolean; autoReconnectMaxRetries?: number; reconnectExponentialDelay?: boolean; registrationMaxRetries?: number; enableStatistics?: boolean; - mayAuthorizeAtRemoteStart: boolean; + mustAuthorizeAtRemoteStart?: boolean; + payloadSchemaValidation?: boolean; + amperageLimitationOcppKey?: string; + amperageLimitationUnit?: AmpereUnits; beginEndMeterValues?: boolean; outOfOrderEndMeterValues?: boolean; meteringPerTransaction?: boolean; transactionDataMeterValues?: boolean; mainVoltageMeterValues?: boolean; phaseLineToLineVoltageMeterValues?: boolean; - Configuration?: ChargingStationConfiguration; - AutomaticTransactionGenerator: AutomaticTransactionGenerator; - Connectors: Connectors; -} + customValueLimitationMeterValues?: boolean; + commandsSupport?: CommandsSupport; + messageTriggerSupport?: Record; + Configuration?: ChargingStationOcppConfiguration; + AutomaticTransactionGenerator?: AutomaticTransactionGeneratorConfiguration; + Evses?: Record; + Connectors?: Record; +};