X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Ftypes%2FChargingStationTemplate.ts;h=1c68743d8b2903a61e84f9748cf2e020c258b2ef;hb=51c83d6f833f27f9990c17fc380ab5ee618894b1;hp=5fff748bdbdad42c4718ac6d75e672e83b436a49;hpb=6b10669bf67da4baa14bc5b28161710e4025c913;p=e-mobility-charging-stations-simulator.git diff --git a/src/types/ChargingStationTemplate.ts b/src/types/ChargingStationTemplate.ts index 5fff748b..1c68743d 100644 --- a/src/types/ChargingStationTemplate.ts +++ b/src/types/ChargingStationTemplate.ts @@ -1,9 +1,15 @@ -import ChargingStationConfiguration from './ChargingStationConfiguration'; -import Connectors from './Connectors'; -import { OCPPProtocol } from './ocpp/OCPPProtocol'; -import { OCPPVersion } from './ocpp/OCPPVersion'; +import type { ClientRequestArgs } from 'http'; -export enum CurrentOutType { +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', DC = 'DC', } @@ -13,58 +19,81 @@ export enum PowerUnits { KILO_WATT = 'kW', } -export enum VoltageOut { +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; + +interface CommandsSupport { + incomingCommands: Record; + outgoingCommands?: Record; } export default interface ChargingStationTemplate { - supervisionURL?: string; + templateHash?: string; + supervisionUrls?: string | string[]; + supervisionUrlOcppConfiguration?: boolean; + supervisionUrlOcppKey?: string; + supervisionUser?: string; + supervisionPassword?: string; ocppVersion?: OCPPVersion; ocppProtocol?: OCPPProtocol; + ocppStrictCompliance?: boolean; + ocppPersistentConfiguration?: boolean; + stationInfoPersistentConfiguration?: boolean; + wsOptions?: WsOptions; authorizationFile?: string; baseName: string; nameSuffix?: string; fixedName?: boolean; chargePointModel: string; chargePointVendor: string; + chargePointSerialNumberPrefix?: string; chargeBoxSerialNumberPrefix?: string; firmwareVersion?: string; + iccid?: string; + imsi?: string; + meterSerialNumberPrefix?: string; + meterType?: string; power: number | number[]; powerSharedByConnectors?: boolean; powerUnit: PowerUnits; - currentOutType?: CurrentOutType; - voltageOut?: number; + currentOutType?: CurrentType; + voltageOut?: Voltage; numberOfPhases?: number; numberOfConnectors?: number | number[]; useConnectorId0?: boolean; randomConnectors?: boolean; resetTime?: number; + autoRegister?: boolean; autoReconnectMaxRetries?: number; reconnectExponentialDelay?: boolean; registrationMaxRetries?: number; enableStatistics?: 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; + Configuration?: ChargingStationOcppConfiguration; + AutomaticTransactionGenerator?: AutomaticTransactionGeneratorConfiguration; + Connectors: Record; }