X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fcharging-station%2FChargingStation.ts;h=30b21bdc357bd2ab65c70e90c4232b5352961750;hb=4c2b490420d856ee0602b3806d6508b67643613b;hp=9d2b687448d37c1063eda0cd6ff98831e6de7484;hpb=5a20b4fd01f3efb08e45409716f8365ca2088e9a;p=e-mobility-charging-stations-simulator.git diff --git a/src/charging-station/ChargingStation.ts b/src/charging-station/ChargingStation.ts index 9d2b6874..30b21bdc 100644 --- a/src/charging-station/ChargingStation.ts +++ b/src/charging-station/ChargingStation.ts @@ -1,6 +1,6 @@ import { BootNotificationResponse, RegistrationStatus } from '../types/ocpp/Responses'; import ChargingStationConfiguration, { ConfigurationKey } from '../types/ChargingStationConfiguration'; -import ChargingStationTemplate, { CurrentOutType, PowerUnits, VoltageOut } from '../types/ChargingStationTemplate'; +import ChargingStationTemplate, { CurrentType, PowerUnits, Voltage } from '../types/ChargingStationTemplate'; import { ConnectorPhaseRotation, StandardParametersKey, SupportedFeatureProfiles } from '../types/ocpp/Configuration'; import Connectors, { Connector, SampledValueTemplate } from '../types/Connectors'; import { MeterValueMeasurand, MeterValuePhase } from '../types/ocpp/MeterValues'; @@ -93,9 +93,9 @@ export default class ChargingStation { public getNumberOfPhases(): number | undefined { switch (this.getCurrentOutType()) { - case CurrentOutType.AC: + case CurrentType.AC: return !Utils.isUndefined(this.stationInfo.numberOfPhases) ? this.stationInfo.numberOfPhases : 3; - case CurrentOutType.DC: + case CurrentType.DC: return 0; } } @@ -120,19 +120,19 @@ export default class ChargingStation { return this.connectors[id]; } - public getCurrentOutType(): CurrentOutType | undefined { - return this.stationInfo.currentOutType ?? CurrentOutType.AC; + public getCurrentOutType(): CurrentType | undefined { + return this.stationInfo.currentOutType ?? CurrentType.AC; } public getVoltageOut(): number | undefined { const errMsg = `${this.logPrefix()} Unknown ${this.getCurrentOutType()} currentOutType in template file ${this.stationTemplateFile}, cannot define default voltage out`; let defaultVoltageOut: number; switch (this.getCurrentOutType()) { - case CurrentOutType.AC: - defaultVoltageOut = VoltageOut.VOLTAGE_230; + case CurrentType.AC: + defaultVoltageOut = Voltage.VOLTAGE_230; break; - case CurrentOutType.DC: - defaultVoltageOut = VoltageOut.VOLTAGE_400; + case CurrentType.DC: + defaultVoltageOut = Voltage.VOLTAGE_400; break; default: logger.error(errMsg); @@ -375,7 +375,7 @@ export default class ChargingStation { if (!Utils.isEmptyArray(this.getConnector(connectorId).chargingProfiles)) { this.getConnector(connectorId).chargingProfiles?.forEach((chargingProfile: ChargingProfile, index: number) => { if (chargingProfile.chargingProfileId === cp.chargingProfileId - || (chargingProfile.stackLevel === cp.stackLevel && chargingProfile.chargingProfilePurpose === cp.chargingProfilePurpose)) { + || (chargingProfile.stackLevel === cp.stackLevel && chargingProfile.chargingProfilePurpose === cp.chargingProfilePurpose)) { this.getConnector(connectorId).chargingProfiles[index] = cp; return true; }