X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Ftypes%2FChargingStationTemplate.ts;h=acf70e499c8634e6067a6c4102a272c9644dd7d4;hb=83e00df1c1ba02de8b637ca4cb0464eb909ebb18;hp=65a7ad6fdd1a356c93df055f7abbedcea10ed687;hpb=2484ac1e71dc33f01b965b5898b319de938cf90d;p=e-mobility-charging-stations-simulator.git diff --git a/src/types/ChargingStationTemplate.ts b/src/types/ChargingStationTemplate.ts index 65a7ad6f..acf70e49 100644 --- a/src/types/ChargingStationTemplate.ts +++ b/src/types/ChargingStationTemplate.ts @@ -1,9 +1,13 @@ -import ChargingStationOcppConfiguration from './ChargingStationOcppConfiguration'; -import { ClientOptions } from 'ws'; -import { ClientRequestArgs } from 'http'; -import { ConnectorStatus } from './ConnectorStatus'; -import { OCPPProtocol } from './ocpp/OCPPProtocol'; -import { OCPPVersion } from './ocpp/OCPPVersion'; +import type { ClientRequestArgs } from 'http'; + +import type { ClientOptions } from 'ws'; + +import type { AutomaticTransactionGeneratorConfiguration } from './AutomaticTransactionGenerator'; +import type { ChargingStationOcppConfiguration } from './ChargingStationOcppConfiguration'; +import type { ConnectorStatus } from './ConnectorStatus'; +import type { OCPPProtocol } from './ocpp/OCPPProtocol'; +import type { OCPPVersion } from './ocpp/OCPPVersion'; +import type { IncomingRequestCommand, RequestCommand } from './ocpp/Requests'; export enum CurrentType { AC = 'AC', @@ -15,6 +19,13 @@ 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, @@ -22,22 +33,15 @@ export enum Voltage { 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; +type CommandsSupport = { + incomingCommands: Record; + outgoingCommands?: Record; +}; + export default interface ChargingStationTemplate { - hash?: string; + templateHash?: string; supervisionUrls?: string | string[]; supervisionUrlOcppConfiguration?: boolean; supervisionUrlOcppKey?: string; @@ -47,6 +51,7 @@ export default interface ChargingStationTemplate { ocppProtocol?: OCPPProtocol; ocppStrictCompliance?: boolean; ocppPersistentConfiguration?: boolean; + stationInfoPersistentConfiguration?: boolean; wsOptions?: WsOptions; authorizationFile?: string; baseName: string; @@ -59,7 +64,7 @@ export default interface ChargingStationTemplate { firmwareVersion?: string; iccid?: string; imsi?: string; - meterSerialNumber?: string; + meterSerialNumberPrefix?: string; meterType?: string; power: number | number[]; powerSharedByConnectors?: boolean; @@ -71,19 +76,24 @@ 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; + customValueLimitationMeterValues?: boolean; + commandsSupport?: CommandsSupport; Configuration?: ChargingStationOcppConfiguration; - AutomaticTransactionGenerator: AutomaticTransactionGenerator; + AutomaticTransactionGenerator?: AutomaticTransactionGeneratorConfiguration; Connectors: Record; }