X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Ftypes%2FChargingStationTemplate.ts;h=cd92616c11063cb4060013081ce8ffd45e974bc2;hb=b25b86842dc61b2a95f672dcf38992f7d63d6ec3;hp=74848226683c9bf0d4377c1bbf7f1b2aa7addd21;hpb=cd8dd45729bcb9838f1f3c7b82596b8b30f8ce4d;p=e-mobility-charging-stations-simulator.git diff --git a/src/types/ChargingStationTemplate.ts b/src/types/ChargingStationTemplate.ts index 74848226..cd92616c 100644 --- a/src/types/ChargingStationTemplate.ts +++ b/src/types/ChargingStationTemplate.ts @@ -1,9 +1,13 @@ -import ChargingStationConfiguration from './ChargingStationConfiguration'; -import { ClientOptions } from 'ws'; -import { ClientRequestArgs } from 'http'; -import { ConnectorStatus } from './Connectors'; -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, MessageTrigger, RequestCommand } from './ocpp/Requests'; export enum CurrentType { AC = 'AC', @@ -15,40 +19,65 @@ 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; + +type FirmwareUpgrade = { + versionUpgrade: { + patternGroup?: number | number[]; + to?: string; + }; + reset?: boolean; + resetDelay?: number; + checkIntegrity?: boolean; +}; -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; - wsOptions?: ClientOptions & ClientRequestArgs; + ocppStrictCompliance?: boolean; + ocppPersistentConfiguration?: boolean; + stationInfoPersistentConfiguration?: boolean; + wsOptions?: WsOptions; authorizationFile?: 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; @@ -59,19 +88,25 @@ 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; + customValueLimitationMeterValues?: boolean; + commandsSupport?: CommandsSupport; + messageTriggerSupport?: Record; + Configuration?: ChargingStationOcppConfiguration; + AutomaticTransactionGenerator?: AutomaticTransactionGeneratorConfiguration; Connectors: Record; -} +};